New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vizuaalog/bulmajs

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vizuaalog/bulmajs - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

4

changelog.md

@@ -0,1 +1,5 @@

# 0.5.0
+ [#38](https://github.com/VizuaaLOG/BulmaJS/pull/38) Adjust how plugins are initialised by using classes instead. Data attributes can still be used for customising the plugins behaviour, if supported. (closes [#20](https://github.com/VizuaaLOG/BulmaJS/issues/20))
+ [43b64cd](https://github.com/VizuaaLOG/BulmaJS/commit/43b64cdea58fe6b512ce95c69172889d75b68179) Add a new option to the tabs plugin that allows tabs to be changed when the user hovers over the tab link. On mobile this will revert back to the click/tap handler due to the lack of a hover event being called. (closes [#35](https://github.com/VizuaaLOG/BulmaJS/issues/35))
# 0.4.0

@@ -2,0 +6,0 @@ + [#28](https://github.com/VizuaaLOG/BulmaJS/pull/28) Add the option to disable the modal being closable

4

dist/accordion.js

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Accordion {\n /**\n * Plugin constructor\n * @param {Object} options The plugin's options\n * @return {this} The new plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Accordion items\n * @type {Array}\n */\n this.accordions = this.findAccordions();\n\n /**\n * Toggle buttons for each accordion item\n * @type {Array}\n */\n this.toggleButtons = this.findToggleButtons();\n\n this.addToggleButtonEvents();\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n findAccordions() {\n return this.root.querySelectorAll('.accordion');\n }\n\n /**\n * Find the toggle buttons within this accordions element\n * @returns {Array} The toggle buttons found\n */\n findToggleButtons() {\n let buttons = [];\n\n this.accordions.forEach(accordion => {\n buttons.push(accordion.querySelector('button.toggle'));\n });\n\n return buttons;\n }\n\n /**\n * Add click events to toggle buttons\n * @return {undefined}\n */\n addToggleButtonEvents() {\n this.toggleButtons.forEach((toggleButton, index) => {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', event => {\n this.handleToggleClick(event, index);\n });\n }\n });\n }\n\n /**\n * Handle the click\n * @param {Object} event The event object\n * @param {number} index Index of the accordion to toggle\n * @return {undefined}\n */\n handleToggleClick(event, index) {\n this.toggleAccordionVisibility(this.accordions[index]);\n }\n\n /**\n * Show or hide the accordion\n * @param {HTMLElement} accordion The accordion element\n * @return {undefined}\n */\n toggleAccordionVisibility(accordion) {\n this.accordions.forEach(function (a) {\n a.classList.remove('is-active');\n });\n\n if (accordion.classList.contains('is-active')) {\n accordion.classList.remove('is-active');\n } else {\n accordion.classList.add('is-active');\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The plugin's options\n * @return {Accordion} The newly created instance\n */\n static create(options) {\n return new Accordion(options);\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n this.root = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Accordion({\n element\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('accordion', Accordion);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Accordion);\n\n//# sourceURL=webpack:///./src/plugins/accordion.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Accordion {\n /**\n * Plugin constructor\n * @param {Object} options The plugin's options\n * @return {this} The new plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Accordion items\n * @type {Array}\n */\n this.accordions = this.findAccordions();\n\n /**\n * Toggle buttons for each accordion item\n * @type {Array}\n */\n this.toggleButtons = this.findToggleButtons();\n\n this.addToggleButtonEvents();\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n findAccordions() {\n return this.root.querySelectorAll('.accordion');\n }\n\n /**\n * Find the toggle buttons within this accordions element\n * @returns {Array} The toggle buttons found\n */\n findToggleButtons() {\n let buttons = [];\n\n this.accordions.forEach(accordion => {\n buttons.push(accordion.querySelector('button.toggle'));\n });\n\n return buttons;\n }\n\n /**\n * Add click events to toggle buttons\n * @return {undefined}\n */\n addToggleButtonEvents() {\n this.toggleButtons.forEach((toggleButton, index) => {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', event => {\n this.handleToggleClick(event, index);\n });\n }\n });\n }\n\n /**\n * Handle the click\n * @param {Object} event The event object\n * @param {number} index Index of the accordion to toggle\n * @return {undefined}\n */\n handleToggleClick(event, index) {\n this.toggleAccordionVisibility(this.accordions[index]);\n }\n\n /**\n * Show or hide the accordion\n * @param {HTMLElement} accordion The accordion element\n * @return {undefined}\n */\n toggleAccordionVisibility(accordion) {\n this.accordions.forEach(function (a) {\n a.classList.remove('is-active');\n });\n\n if (accordion.classList.contains('is-active')) {\n accordion.classList.remove('is-active');\n } else {\n accordion.classList.add('is-active');\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The plugin's options\n * @return {Accordion} The newly created instance\n */\n static create(options) {\n return new Accordion(options);\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n this.root = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Accordion({\n element\n });\n }\n\n static getRootClass() {\n return 'accordions';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('accordion', Accordion);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Accordion);\n\n//# sourceURL=webpack:///./src/plugins/accordion.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -94,3 +94,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -119,3 +119,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Accordion {\n /**\n * Plugin constructor\n * @param {Object} options The plugin's options\n * @return {this} The new plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Accordion items\n * @type {Array}\n */\n this.accordions = this.findAccordions();\n\n /**\n * Toggle buttons for each accordion item\n * @type {Array}\n */\n this.toggleButtons = this.findToggleButtons();\n\n this.addToggleButtonEvents();\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n findAccordions() {\n return this.root.querySelectorAll('.accordion');\n }\n\n /**\n * Find the toggle buttons within this accordions element\n * @returns {Array} The toggle buttons found\n */\n findToggleButtons() {\n let buttons = [];\n\n this.accordions.forEach(accordion => {\n buttons.push(accordion.querySelector('button.toggle'));\n });\n\n return buttons;\n }\n\n /**\n * Add click events to toggle buttons\n * @return {undefined}\n */\n addToggleButtonEvents() {\n this.toggleButtons.forEach((toggleButton, index) => {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', event => {\n this.handleToggleClick(event, index);\n });\n }\n });\n }\n\n /**\n * Handle the click\n * @param {Object} event The event object\n * @param {number} index Index of the accordion to toggle\n * @return {undefined}\n */\n handleToggleClick(event, index) {\n this.toggleAccordionVisibility(this.accordions[index]);\n }\n\n /**\n * Show or hide the accordion\n * @param {HTMLElement} accordion The accordion element\n * @return {undefined}\n */\n toggleAccordionVisibility(accordion) {\n this.accordions.forEach(function (a) {\n a.classList.remove('is-active');\n });\n\n if (accordion.classList.contains('is-active')) {\n accordion.classList.remove('is-active');\n } else {\n accordion.classList.add('is-active');\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The plugin's options\n * @return {Accordion} The newly created instance\n */\n static create(options) {\n return new Accordion(options);\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n this.root = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Accordion({\n element\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('accordion', Accordion);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Accordion);\n\n//# sourceURL=webpack:///./src/plugins/accordion.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Accordion {\n /**\n * Plugin constructor\n * @param {Object} options The plugin's options\n * @return {this} The new plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Accordion items\n * @type {Array}\n */\n this.accordions = this.findAccordions();\n\n /**\n * Toggle buttons for each accordion item\n * @type {Array}\n */\n this.toggleButtons = this.findToggleButtons();\n\n this.addToggleButtonEvents();\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n findAccordions() {\n return this.root.querySelectorAll('.accordion');\n }\n\n /**\n * Find the toggle buttons within this accordions element\n * @returns {Array} The toggle buttons found\n */\n findToggleButtons() {\n let buttons = [];\n\n this.accordions.forEach(accordion => {\n buttons.push(accordion.querySelector('button.toggle'));\n });\n\n return buttons;\n }\n\n /**\n * Add click events to toggle buttons\n * @return {undefined}\n */\n addToggleButtonEvents() {\n this.toggleButtons.forEach((toggleButton, index) => {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', event => {\n this.handleToggleClick(event, index);\n });\n }\n });\n }\n\n /**\n * Handle the click\n * @param {Object} event The event object\n * @param {number} index Index of the accordion to toggle\n * @return {undefined}\n */\n handleToggleClick(event, index) {\n this.toggleAccordionVisibility(this.accordions[index]);\n }\n\n /**\n * Show or hide the accordion\n * @param {HTMLElement} accordion The accordion element\n * @return {undefined}\n */\n toggleAccordionVisibility(accordion) {\n this.accordions.forEach(function (a) {\n a.classList.remove('is-active');\n });\n\n if (accordion.classList.contains('is-active')) {\n accordion.classList.remove('is-active');\n } else {\n accordion.classList.add('is-active');\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The plugin's options\n * @return {Accordion} The newly created instance\n */\n static create(options) {\n return new Accordion(options);\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n this.root = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Accordion({\n element\n });\n }\n\n static getRootClass() {\n return 'accordions';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('accordion', Accordion);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Accordion);\n\n//# sourceURL=webpack:///./src/plugins/accordion.js?");

@@ -144,3 +144,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Dropdown {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element || !options.trigger) {\n throw new Error('[BulmaJS] The dropdown component requires an element and trigger to function.');\n }\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n } else {\n this.root.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HtmlElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('[data-trigger]');\n\n new Dropdown({\n element: element,\n trigger: trigger\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('dropdown', Dropdown);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Dropdown);\n\n//# sourceURL=webpack:///./src/plugins/dropdown.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Dropdown {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element || !options.trigger) {\n throw new Error('[BulmaJS] The dropdown component requires an element and trigger to function.');\n }\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n } else {\n this.root.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HtmlElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('.dropdown-trigger');\n\n new Dropdown({\n element: element,\n trigger: trigger\n });\n }\n\n static getRootClass() {\n return 'dropdown';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('dropdown', Dropdown);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Dropdown);\n\n//# sourceURL=webpack:///./src/plugins/dropdown.js?");

@@ -157,3 +157,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass File {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The file component requires an element to function.');\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n this.trigger = this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n this.target = this.root.querySelector('.file-name');\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n handleTriggerChange(event) {\n if (event.target.files.length === 0) {\n this.clearFileName();\n }\n\n if (event.target.files.length === 1) {\n this.setFileName(event.target.files[0].name);\n }\n\n if (event.target.files.length > 1) {\n this.setFileName(event.target.files.length + ' files');\n }\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n clearFileName() {\n this.target.innerHTML = '';\n }\n\n /**\n * Set the text for the file name element.\n * @param {string} value The name of the file to update the label with\n * @return {undefined}\n */\n setFileName(value) {\n this.target.innerHTML = value;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new File({\n element: element\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('file', File);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (File);\n\n//# sourceURL=webpack:///./src/plugins/file.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass File {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The file component requires an element to function.');\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n this.trigger = this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n this.target = this.root.querySelector('.file-name');\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n handleTriggerChange(event) {\n if (event.target.files.length === 0) {\n this.clearFileName();\n }\n\n if (event.target.files.length === 1) {\n this.setFileName(event.target.files[0].name);\n }\n\n if (event.target.files.length > 1) {\n this.setFileName(event.target.files.length + ' files');\n }\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n clearFileName() {\n this.target.innerHTML = '';\n }\n\n /**\n * Set the text for the file name element.\n * @param {string} value The name of the file to update the label with\n * @return {undefined}\n */\n setFileName(value) {\n this.target.innerHTML = value;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new File({\n element: element\n });\n }\n\n static getRootClass() {\n return 'file';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('file', File);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (File);\n\n//# sourceURL=webpack:///./src/plugins/file.js?");

@@ -170,3 +170,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Message extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('message', options);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n this.size = options.hasOwnProperty('size') ? options.size : '';\n\n /**\n * The title of the message\n * @type {String}\n */\n this.title = options.hasOwnProperty('title') ? options.title : '';\n\n if (this.title) {\n this.createMessageHeader();\n }\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n\n if (this.size) {\n this.setSize();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for this instance\n * @return {Message} The newly created message instance\n */\n static create(options) {\n return new Message(options);\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n createMessageHeader() {\n let header = document.createElement('div');\n header.classList.add('message-header');\n\n header.innerHTML = '<p>' + this.title + '</p>';\n\n this.title = header;\n\n this.root.insertBefore(this.title, this.root.firstChild);\n }\n\n /**\n * Set the size of the message.\n * @return {undefined}\n */\n setSize() {\n this.root.classList.add('is-' + this.size);\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n insertBody() {\n let body = document.createElement('div');\n body.classList.add('message-body');\n body.innerHTML = this.body;\n\n this.root.appendChild(body);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Message(options);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('message', Message);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Message);\n\n//# sourceURL=webpack:///./src/plugins/message.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Message extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('message', options);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n this.size = options.hasOwnProperty('size') ? options.size : '';\n\n /**\n * The title of the message\n * @type {String}\n */\n this.title = options.hasOwnProperty('title') ? options.title : '';\n\n if (this.title) {\n this.createMessageHeader();\n }\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n\n if (this.size) {\n this.setSize();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for this instance\n * @return {Message} The newly created message instance\n */\n static create(options) {\n return new Message(options);\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n createMessageHeader() {\n let header = document.createElement('div');\n header.classList.add('message-header');\n\n header.innerHTML = '<p>' + this.title + '</p>';\n\n this.title = header;\n\n this.root.insertBefore(this.title, this.root.firstChild);\n }\n\n /**\n * Set the size of the message.\n * @return {undefined}\n */\n setSize() {\n this.root.classList.add('is-' + this.size);\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n insertBody() {\n let body = document.createElement('div');\n body.classList.add('message-body');\n body.innerHTML = this.body;\n\n this.root.appendChild(body);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Message(options);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n\n static getRootClass() {\n return 'message';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('message', Message);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Message);\n\n//# sourceURL=webpack:///./src/plugins/message.js?");

@@ -183,3 +183,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Modal {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Closable toggle switch.\n * @type {bool}\n */\n this.closable = options.hasOwnProperty('closable') ? options.closable : true;\n\n /**\n * The element used to close the message.\n * @type {HTMLElement}\n */\n this.closeButton = this.findCloseButton();\n\n if (this.closeButton && this.closable) {\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for the new instance\n * @return {Modal} The newly created instance\n */\n static create(options) {\n return new Modal(options);\n }\n\n /**\n * Show the message.\n * @return {undefined}\n */\n open() {\n this.root.classList.add('is-active');\n }\n\n /**\n * Hide the message.\n * @return {undefined}\n */\n close() {\n this.root.classList.remove('is-active');\n }\n\n /**\n * Find the close button.\n * @return {HTMLElement} The newly created element\n */\n findCloseButton() {\n let element = this.root.querySelector('.modal-close');\n\n if (!element) {\n return this.root.querySelector('.delete');\n }\n\n return element;\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n setupCloseEvent() {\n this.closeButton.addEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n /**\n * Handle the event when our close button is clicked.\n * @return {undefined}\n */\n handleCloseEvent() {\n this.close();\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n if (this.closable && this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n this.root = null;\n this.closeButton = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @return {undefined}\n */\n static handleDomParsing() {\n return;\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('modal', Modal);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modal);\n\n//# sourceURL=webpack:///./src/plugins/modal.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Modal {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Closable toggle switch.\n * @type {bool}\n */\n this.closable = options.hasOwnProperty('closable') ? options.closable : true;\n\n /**\n * The element used to close the message.\n * @type {HTMLElement}\n */\n this.closeButton = this.findCloseButton();\n\n if (this.closeButton && this.closable) {\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for the new instance\n * @return {Modal} The newly created instance\n */\n static create(options) {\n return new Modal(options);\n }\n\n /**\n * Show the message.\n * @return {undefined}\n */\n open() {\n this.root.classList.add('is-active');\n }\n\n /**\n * Hide the message.\n * @return {undefined}\n */\n close() {\n this.root.classList.remove('is-active');\n }\n\n /**\n * Find the close button.\n * @return {HTMLElement} The newly created element\n */\n findCloseButton() {\n let element = this.root.querySelector('.modal-close');\n\n if (!element) {\n return this.root.querySelector('.delete');\n }\n\n return element;\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n setupCloseEvent() {\n this.closeButton.addEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n /**\n * Handle the event when our close button is clicked.\n * @return {undefined}\n */\n handleCloseEvent() {\n this.close();\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n if (this.closable && this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n this.root = null;\n this.closeButton = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @return {undefined}\n */\n static handleDomParsing() {\n return;\n }\n\n static getRootClass() {\n return 'modal';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('modal', Modal);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modal);\n\n//# sourceURL=webpack:///./src/plugins/modal.js?");

@@ -196,3 +196,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Navbar {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element || !options.trigger || !options.target) {\n throw new Error('[BulmaJS] The navbar component requires an element, trigger and target to function.');\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n this.target = options.target;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('[data-trigger]'),\n target = trigger.getAttribute('data-target');\n\n new Navbar({\n element: element,\n trigger: trigger,\n target: element.querySelector('#' + target)\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('navbar', Navbar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navbar);\n\n//# sourceURL=webpack:///./src/plugins/navbar.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Navbar {\n\n static getRootClass() {\n return 'navbar';\n }\n\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element || !options.trigger || !options.target) {\n throw new Error('[BulmaJS] The navbar component requires an element, trigger and target to function.');\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n this.target = options.target;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Navbar({\n element: element,\n trigger: element.querySelector('.navbar-burger'),\n target: element.querySelector('.navbar-menu')\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('navbar', Navbar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navbar);\n\n//# sourceURL=webpack:///./src/plugins/navbar.js?");

@@ -209,3 +209,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Notification extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('notification', options);\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Notification} The newly created instance\n */\n static create(options) {\n return new Notification(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Notification(options);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('notification', Notification);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Notification);\n\n//# sourceURL=webpack:///./src/plugins/notification.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Notification extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('notification', options);\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Notification} The newly created instance\n */\n static create(options) {\n return new Notification(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Notification(options);\n }\n\n static getRootClass() {\n return 'notification';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('notification', Notification);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Notification);\n\n//# sourceURL=webpack:///./src/plugins/notification.js?");

@@ -222,3 +222,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Tabs {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n this.root = options.hasOwnProperty('root') ? options.root : null;\n\n this.nav = this.findNav();\n this.navItems = this.findNavItems();\n\n this.content = this.findContent();\n this.contentItems = this.findContentItems();\n\n this.setupNavEvents();\n }\n\n findNav() {\n return this.root.querySelector('[data-links]');\n }\n\n findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n findContent() {\n return this.root.querySelector('[data-content]');\n }\n\n findContentItems() {\n return this.content.querySelectorAll('li');\n }\n\n setupNavEvents() {\n this.navItems.forEach((navItem, index) => {\n navItem.addEventListener('click', () => {\n this.handleNavClick(navItem, index);\n });\n });\n }\n\n handleNavClick(navItem, index) {\n this.navItems.forEach(navItem => {\n navItem.classList.remove('is-active');\n });\n\n this.contentItems.forEach(contentItem => {\n contentItem.classList.remove('is-active');\n });\n\n navItem.classList.add('is-active');\n this.contentItems[index].classList.add('is-active');\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Tabs} The newly created instance\n */\n static create(options) {\n return new Tabs(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let options = {\n root: element\n };\n\n new Tabs(options);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('tabs', Tabs);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tabs);\n\n//# sourceURL=webpack:///./src/plugins/tabs.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Tabs {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * The root tab element\n * @param {HTMLElement}\n */\n this.root = options.hasOwnProperty('root') ? options.root : null;\n\n /**\n * Whether the tabs should be changed when the nav item is hovered over\n * @param {boolean}\n */\n this.hover = options.hasOwnProperty('hover') ? options.hover : false;\n\n /**\n * The tab nav container\n * @param {HTMLElement}\n */\n this.nav = this.findNav();\n\n /**\n * The tab's nav items\n * @param {HTMLElement[]}\n */\n this.navItems = this.findNavItems();\n\n /**\n * The tab content container\n * @param {HTMLElement}\n */\n this.content = this.findContent();\n\n /**\n * The tab's content items\n * @param {HTMLElement[]}\n */\n this.contentItems = this.findContentItems();\n\n this.setupNavEvents();\n }\n\n /**\n * Find the tab navigation container.\n * @returns {HTMLElement} The navigation container\n */\n findNav() {\n return this.root.querySelector('.tabs');\n }\n\n /**\n * Find each individual tab item\n * @returns {HTMLElement[]} An array of the found items\n */\n findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n /**\n * Find the tab content container.\n * @returns {HTMLElement} The content container\n */\n findContent() {\n return this.root.querySelector('.tabs-content');\n }\n\n /**\n * Find each individual content item\n * @returns {HTMLElement[]} An array of the found items\n */\n findContentItems() {\n return this.content.querySelectorAll('li');\n }\n\n /**\n * Setup the events to handle tab changing\n */\n setupNavEvents() {\n this.navItems.forEach((navItem, index) => {\n navItem.addEventListener('click', () => {\n this.handleNavClick(navItem, index);\n });\n\n if (this.hover) {\n navItem.addEventListener('mouseover', () => {\n this.handleNavClick(navItem, index);\n });\n }\n });\n }\n\n /**\n * Handle the changing of the visible tab\n * @param {HTMLelement} navItem \n * @param {number} index \n */\n handleNavClick(navItem, index) {\n this.navItems.forEach(navItem => {\n navItem.classList.remove('is-active');\n });\n\n this.contentItems.forEach(contentItem => {\n contentItem.classList.remove('is-active');\n });\n\n navItem.classList.add('is-active');\n this.contentItems[index].classList.add('is-active');\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Tabs} The newly created instance\n */\n static create(options) {\n return new Tabs(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let hover = element.hasAttribute('data-hover') ? true : false;\n\n let options = {\n root: element,\n hover: hover\n };\n\n console.log(new Tabs(options));\n }\n\n /**\n * The root class used for initialisation\n * @returns {string}\n */\n static getRootClass() {\n return 'tabs-wrapper';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('tabs', Tabs);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tabs);\n\n//# sourceURL=webpack:///./src/plugins/tabs.js?");

@@ -225,0 +225,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -85,0 +85,0 @@ /***/ }),

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Dropdown {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element || !options.trigger) {\n throw new Error('[BulmaJS] The dropdown component requires an element and trigger to function.');\n }\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n } else {\n this.root.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HtmlElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('[data-trigger]');\n\n new Dropdown({\n element: element,\n trigger: trigger\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('dropdown', Dropdown);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Dropdown);\n\n//# sourceURL=webpack:///./src/plugins/dropdown.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Dropdown {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element || !options.trigger) {\n throw new Error('[BulmaJS] The dropdown component requires an element and trigger to function.');\n }\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n } else {\n this.root.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HtmlElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('.dropdown-trigger');\n\n new Dropdown({\n element: element,\n trigger: trigger\n });\n }\n\n static getRootClass() {\n return 'dropdown';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('dropdown', Dropdown);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Dropdown);\n\n//# sourceURL=webpack:///./src/plugins/dropdown.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass File {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The file component requires an element to function.');\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n this.trigger = this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n this.target = this.root.querySelector('.file-name');\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n handleTriggerChange(event) {\n if (event.target.files.length === 0) {\n this.clearFileName();\n }\n\n if (event.target.files.length === 1) {\n this.setFileName(event.target.files[0].name);\n }\n\n if (event.target.files.length > 1) {\n this.setFileName(event.target.files.length + ' files');\n }\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n clearFileName() {\n this.target.innerHTML = '';\n }\n\n /**\n * Set the text for the file name element.\n * @param {string} value The name of the file to update the label with\n * @return {undefined}\n */\n setFileName(value) {\n this.target.innerHTML = value;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new File({\n element: element\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('file', File);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (File);\n\n//# sourceURL=webpack:///./src/plugins/file.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass File {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The file component requires an element to function.');\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n this.trigger = this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n this.target = this.root.querySelector('.file-name');\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n handleTriggerChange(event) {\n if (event.target.files.length === 0) {\n this.clearFileName();\n }\n\n if (event.target.files.length === 1) {\n this.setFileName(event.target.files[0].name);\n }\n\n if (event.target.files.length > 1) {\n this.setFileName(event.target.files.length + ' files');\n }\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n clearFileName() {\n this.target.innerHTML = '';\n }\n\n /**\n * Set the text for the file name element.\n * @param {string} value The name of the file to update the label with\n * @return {undefined}\n */\n setFileName(value) {\n this.target.innerHTML = value;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new File({\n element: element\n });\n }\n\n static getRootClass() {\n return 'file';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('file', File);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (File);\n\n//# sourceURL=webpack:///./src/plugins/file.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -107,3 +107,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Message extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('message', options);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n this.size = options.hasOwnProperty('size') ? options.size : '';\n\n /**\n * The title of the message\n * @type {String}\n */\n this.title = options.hasOwnProperty('title') ? options.title : '';\n\n if (this.title) {\n this.createMessageHeader();\n }\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n\n if (this.size) {\n this.setSize();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for this instance\n * @return {Message} The newly created message instance\n */\n static create(options) {\n return new Message(options);\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n createMessageHeader() {\n let header = document.createElement('div');\n header.classList.add('message-header');\n\n header.innerHTML = '<p>' + this.title + '</p>';\n\n this.title = header;\n\n this.root.insertBefore(this.title, this.root.firstChild);\n }\n\n /**\n * Set the size of the message.\n * @return {undefined}\n */\n setSize() {\n this.root.classList.add('is-' + this.size);\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n insertBody() {\n let body = document.createElement('div');\n body.classList.add('message-body');\n body.innerHTML = this.body;\n\n this.root.appendChild(body);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Message(options);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('message', Message);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Message);\n\n//# sourceURL=webpack:///./src/plugins/message.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Message extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('message', options);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n this.size = options.hasOwnProperty('size') ? options.size : '';\n\n /**\n * The title of the message\n * @type {String}\n */\n this.title = options.hasOwnProperty('title') ? options.title : '';\n\n if (this.title) {\n this.createMessageHeader();\n }\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n\n if (this.size) {\n this.setSize();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for this instance\n * @return {Message} The newly created message instance\n */\n static create(options) {\n return new Message(options);\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n createMessageHeader() {\n let header = document.createElement('div');\n header.classList.add('message-header');\n\n header.innerHTML = '<p>' + this.title + '</p>';\n\n this.title = header;\n\n this.root.insertBefore(this.title, this.root.firstChild);\n }\n\n /**\n * Set the size of the message.\n * @return {undefined}\n */\n setSize() {\n this.root.classList.add('is-' + this.size);\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n insertBody() {\n let body = document.createElement('div');\n body.classList.add('message-body');\n body.innerHTML = this.body;\n\n this.root.appendChild(body);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Message(options);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n\n static getRootClass() {\n return 'message';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('message', Message);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Message);\n\n//# sourceURL=webpack:///./src/plugins/message.js?");

@@ -110,0 +110,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Modal {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Closable toggle switch.\n * @type {bool}\n */\n this.closable = options.hasOwnProperty('closable') ? options.closable : true;\n\n /**\n * The element used to close the message.\n * @type {HTMLElement}\n */\n this.closeButton = this.findCloseButton();\n\n if (this.closeButton && this.closable) {\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for the new instance\n * @return {Modal} The newly created instance\n */\n static create(options) {\n return new Modal(options);\n }\n\n /**\n * Show the message.\n * @return {undefined}\n */\n open() {\n this.root.classList.add('is-active');\n }\n\n /**\n * Hide the message.\n * @return {undefined}\n */\n close() {\n this.root.classList.remove('is-active');\n }\n\n /**\n * Find the close button.\n * @return {HTMLElement} The newly created element\n */\n findCloseButton() {\n let element = this.root.querySelector('.modal-close');\n\n if (!element) {\n return this.root.querySelector('.delete');\n }\n\n return element;\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n setupCloseEvent() {\n this.closeButton.addEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n /**\n * Handle the event when our close button is clicked.\n * @return {undefined}\n */\n handleCloseEvent() {\n this.close();\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n if (this.closable && this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n this.root = null;\n this.closeButton = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @return {undefined}\n */\n static handleDomParsing() {\n return;\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('modal', Modal);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modal);\n\n//# sourceURL=webpack:///./src/plugins/modal.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Modal {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Closable toggle switch.\n * @type {bool}\n */\n this.closable = options.hasOwnProperty('closable') ? options.closable : true;\n\n /**\n * The element used to close the message.\n * @type {HTMLElement}\n */\n this.closeButton = this.findCloseButton();\n\n if (this.closeButton && this.closable) {\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for the new instance\n * @return {Modal} The newly created instance\n */\n static create(options) {\n return new Modal(options);\n }\n\n /**\n * Show the message.\n * @return {undefined}\n */\n open() {\n this.root.classList.add('is-active');\n }\n\n /**\n * Hide the message.\n * @return {undefined}\n */\n close() {\n this.root.classList.remove('is-active');\n }\n\n /**\n * Find the close button.\n * @return {HTMLElement} The newly created element\n */\n findCloseButton() {\n let element = this.root.querySelector('.modal-close');\n\n if (!element) {\n return this.root.querySelector('.delete');\n }\n\n return element;\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n setupCloseEvent() {\n this.closeButton.addEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n /**\n * Handle the event when our close button is clicked.\n * @return {undefined}\n */\n handleCloseEvent() {\n this.close();\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n if (this.closable && this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n this.root = null;\n this.closeButton = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @return {undefined}\n */\n static handleDomParsing() {\n return;\n }\n\n static getRootClass() {\n return 'modal';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('modal', Modal);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modal);\n\n//# sourceURL=webpack:///./src/plugins/modal.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Navbar {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element || !options.trigger || !options.target) {\n throw new Error('[BulmaJS] The navbar component requires an element, trigger and target to function.');\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n this.target = options.target;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('[data-trigger]'),\n target = trigger.getAttribute('data-target');\n\n new Navbar({\n element: element,\n trigger: trigger,\n target: element.querySelector('#' + target)\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('navbar', Navbar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navbar);\n\n//# sourceURL=webpack:///./src/plugins/navbar.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Navbar {\n\n static getRootClass() {\n return 'navbar';\n }\n\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element || !options.trigger || !options.target) {\n throw new Error('[BulmaJS] The navbar component requires an element, trigger and target to function.');\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n this.target = options.target;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Navbar({\n element: element,\n trigger: element.querySelector('.navbar-burger'),\n target: element.querySelector('.navbar-menu')\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('navbar', Navbar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navbar);\n\n//# sourceURL=webpack:///./src/plugins/navbar.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -107,3 +107,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Notification extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('notification', options);\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Notification} The newly created instance\n */\n static create(options) {\n return new Notification(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Notification(options);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('notification', Notification);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Notification);\n\n//# sourceURL=webpack:///./src/plugins/notification.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Notification extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('notification', options);\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Notification} The newly created instance\n */\n static create(options) {\n return new Notification(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Notification(options);\n }\n\n static getRootClass() {\n return 'notification';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('notification', Notification);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Notification);\n\n//# sourceURL=webpack:///./src/plugins/notification.js?");

@@ -110,0 +110,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Tabs {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n this.root = options.hasOwnProperty('root') ? options.root : null;\n\n this.nav = this.findNav();\n this.navItems = this.findNavItems();\n\n this.content = this.findContent();\n this.contentItems = this.findContentItems();\n\n this.setupNavEvents();\n }\n\n findNav() {\n return this.root.querySelector('[data-links]');\n }\n\n findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n findContent() {\n return this.root.querySelector('[data-content]');\n }\n\n findContentItems() {\n return this.content.querySelectorAll('li');\n }\n\n setupNavEvents() {\n this.navItems.forEach((navItem, index) => {\n navItem.addEventListener('click', () => {\n this.handleNavClick(navItem, index);\n });\n });\n }\n\n handleNavClick(navItem, index) {\n this.navItems.forEach(navItem => {\n navItem.classList.remove('is-active');\n });\n\n this.contentItems.forEach(contentItem => {\n contentItem.classList.remove('is-active');\n });\n\n navItem.classList.add('is-active');\n this.contentItems[index].classList.add('is-active');\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Tabs} The newly created instance\n */\n static create(options) {\n return new Tabs(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let options = {\n root: element\n };\n\n new Tabs(options);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('tabs', Tabs);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tabs);\n\n//# sourceURL=webpack:///./src/plugins/tabs.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Tabs {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * The root tab element\n * @param {HTMLElement}\n */\n this.root = options.hasOwnProperty('root') ? options.root : null;\n\n /**\n * Whether the tabs should be changed when the nav item is hovered over\n * @param {boolean}\n */\n this.hover = options.hasOwnProperty('hover') ? options.hover : false;\n\n /**\n * The tab nav container\n * @param {HTMLElement}\n */\n this.nav = this.findNav();\n\n /**\n * The tab's nav items\n * @param {HTMLElement[]}\n */\n this.navItems = this.findNavItems();\n\n /**\n * The tab content container\n * @param {HTMLElement}\n */\n this.content = this.findContent();\n\n /**\n * The tab's content items\n * @param {HTMLElement[]}\n */\n this.contentItems = this.findContentItems();\n\n this.setupNavEvents();\n }\n\n /**\n * Find the tab navigation container.\n * @returns {HTMLElement} The navigation container\n */\n findNav() {\n return this.root.querySelector('.tabs');\n }\n\n /**\n * Find each individual tab item\n * @returns {HTMLElement[]} An array of the found items\n */\n findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n /**\n * Find the tab content container.\n * @returns {HTMLElement} The content container\n */\n findContent() {\n return this.root.querySelector('.tabs-content');\n }\n\n /**\n * Find each individual content item\n * @returns {HTMLElement[]} An array of the found items\n */\n findContentItems() {\n return this.content.querySelectorAll('li');\n }\n\n /**\n * Setup the events to handle tab changing\n */\n setupNavEvents() {\n this.navItems.forEach((navItem, index) => {\n navItem.addEventListener('click', () => {\n this.handleNavClick(navItem, index);\n });\n\n if (this.hover) {\n navItem.addEventListener('mouseover', () => {\n this.handleNavClick(navItem, index);\n });\n }\n });\n }\n\n /**\n * Handle the changing of the visible tab\n * @param {HTMLelement} navItem \n * @param {number} index \n */\n handleNavClick(navItem, index) {\n this.navItems.forEach(navItem => {\n navItem.classList.remove('is-active');\n });\n\n this.contentItems.forEach(contentItem => {\n contentItem.classList.remove('is-active');\n });\n\n navItem.classList.add('is-active');\n this.contentItems[index].classList.add('is-active');\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Tabs} The newly created instance\n */\n static create(options) {\n return new Tabs(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let hover = element.hasAttribute('data-hover') ? true : false;\n\n let options = {\n root: element,\n hover: hover\n };\n\n console.log(new Tabs(options));\n }\n\n /**\n * The root class used for initialisation\n * @returns {string}\n */\n static getRootClass() {\n return 'tabs-wrapper';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('tabs', Tabs);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tabs);\n\n//# sourceURL=webpack:///./src/plugins/tabs.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Accordion {\n /**\n * Plugin constructor\n * @param {Object} options The plugin's options\n * @return {this} The new plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Accordion items\n * @type {Array}\n */\n this.accordions = this.findAccordions();\n\n /**\n * Toggle buttons for each accordion item\n * @type {Array}\n */\n this.toggleButtons = this.findToggleButtons();\n\n this.addToggleButtonEvents();\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n findAccordions() {\n return this.root.querySelectorAll('.accordion');\n }\n\n /**\n * Find the toggle buttons within this accordions element\n * @returns {Array} The toggle buttons found\n */\n findToggleButtons() {\n let buttons = [];\n\n this.accordions.forEach(accordion => {\n buttons.push(accordion.querySelector('button.toggle'));\n });\n\n return buttons;\n }\n\n /**\n * Add click events to toggle buttons\n * @return {undefined}\n */\n addToggleButtonEvents() {\n this.toggleButtons.forEach((toggleButton, index) => {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', event => {\n this.handleToggleClick(event, index);\n });\n }\n });\n }\n\n /**\n * Handle the click\n * @param {Object} event The event object\n * @param {number} index Index of the accordion to toggle\n * @return {undefined}\n */\n handleToggleClick(event, index) {\n this.toggleAccordionVisibility(this.accordions[index]);\n }\n\n /**\n * Show or hide the accordion\n * @param {HTMLElement} accordion The accordion element\n * @return {undefined}\n */\n toggleAccordionVisibility(accordion) {\n this.accordions.forEach(function (a) {\n a.classList.remove('is-active');\n });\n\n if (accordion.classList.contains('is-active')) {\n accordion.classList.remove('is-active');\n } else {\n accordion.classList.add('is-active');\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The plugin's options\n * @return {Accordion} The newly created instance\n */\n static create(options) {\n return new Accordion(options);\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n this.root = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Accordion({\n element\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('accordion', Accordion);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Accordion);\n\n//# sourceURL=webpack:///./src/plugins/accordion.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Accordion {\n /**\n * Plugin constructor\n * @param {Object} options The plugin's options\n * @return {this} The new plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Accordion items\n * @type {Array}\n */\n this.accordions = this.findAccordions();\n\n /**\n * Toggle buttons for each accordion item\n * @type {Array}\n */\n this.toggleButtons = this.findToggleButtons();\n\n this.addToggleButtonEvents();\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n findAccordions() {\n return this.root.querySelectorAll('.accordion');\n }\n\n /**\n * Find the toggle buttons within this accordions element\n * @returns {Array} The toggle buttons found\n */\n findToggleButtons() {\n let buttons = [];\n\n this.accordions.forEach(accordion => {\n buttons.push(accordion.querySelector('button.toggle'));\n });\n\n return buttons;\n }\n\n /**\n * Add click events to toggle buttons\n * @return {undefined}\n */\n addToggleButtonEvents() {\n this.toggleButtons.forEach((toggleButton, index) => {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', event => {\n this.handleToggleClick(event, index);\n });\n }\n });\n }\n\n /**\n * Handle the click\n * @param {Object} event The event object\n * @param {number} index Index of the accordion to toggle\n * @return {undefined}\n */\n handleToggleClick(event, index) {\n this.toggleAccordionVisibility(this.accordions[index]);\n }\n\n /**\n * Show or hide the accordion\n * @param {HTMLElement} accordion The accordion element\n * @return {undefined}\n */\n toggleAccordionVisibility(accordion) {\n this.accordions.forEach(function (a) {\n a.classList.remove('is-active');\n });\n\n if (accordion.classList.contains('is-active')) {\n accordion.classList.remove('is-active');\n } else {\n accordion.classList.add('is-active');\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The plugin's options\n * @return {Accordion} The newly created instance\n */\n static create(options) {\n return new Accordion(options);\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n this.root = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Accordion({\n element\n });\n }\n\n static getRootClass() {\n return 'accordions';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('accordion', Accordion);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Accordion);\n\n//# sourceURL=webpack:///./src/plugins/accordion.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -94,3 +94,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -119,3 +119,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Accordion {\n /**\n * Plugin constructor\n * @param {Object} options The plugin's options\n * @return {this} The new plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Accordion items\n * @type {Array}\n */\n this.accordions = this.findAccordions();\n\n /**\n * Toggle buttons for each accordion item\n * @type {Array}\n */\n this.toggleButtons = this.findToggleButtons();\n\n this.addToggleButtonEvents();\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n findAccordions() {\n return this.root.querySelectorAll('.accordion');\n }\n\n /**\n * Find the toggle buttons within this accordions element\n * @returns {Array} The toggle buttons found\n */\n findToggleButtons() {\n let buttons = [];\n\n this.accordions.forEach(accordion => {\n buttons.push(accordion.querySelector('button.toggle'));\n });\n\n return buttons;\n }\n\n /**\n * Add click events to toggle buttons\n * @return {undefined}\n */\n addToggleButtonEvents() {\n this.toggleButtons.forEach((toggleButton, index) => {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', event => {\n this.handleToggleClick(event, index);\n });\n }\n });\n }\n\n /**\n * Handle the click\n * @param {Object} event The event object\n * @param {number} index Index of the accordion to toggle\n * @return {undefined}\n */\n handleToggleClick(event, index) {\n this.toggleAccordionVisibility(this.accordions[index]);\n }\n\n /**\n * Show or hide the accordion\n * @param {HTMLElement} accordion The accordion element\n * @return {undefined}\n */\n toggleAccordionVisibility(accordion) {\n this.accordions.forEach(function (a) {\n a.classList.remove('is-active');\n });\n\n if (accordion.classList.contains('is-active')) {\n accordion.classList.remove('is-active');\n } else {\n accordion.classList.add('is-active');\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The plugin's options\n * @return {Accordion} The newly created instance\n */\n static create(options) {\n return new Accordion(options);\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n this.root = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Accordion({\n element\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('accordion', Accordion);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Accordion);\n\n//# sourceURL=webpack:///./src/plugins/accordion.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Accordion {\n /**\n * Plugin constructor\n * @param {Object} options The plugin's options\n * @return {this} The new plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Accordion items\n * @type {Array}\n */\n this.accordions = this.findAccordions();\n\n /**\n * Toggle buttons for each accordion item\n * @type {Array}\n */\n this.toggleButtons = this.findToggleButtons();\n\n this.addToggleButtonEvents();\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n findAccordions() {\n return this.root.querySelectorAll('.accordion');\n }\n\n /**\n * Find the toggle buttons within this accordions element\n * @returns {Array} The toggle buttons found\n */\n findToggleButtons() {\n let buttons = [];\n\n this.accordions.forEach(accordion => {\n buttons.push(accordion.querySelector('button.toggle'));\n });\n\n return buttons;\n }\n\n /**\n * Add click events to toggle buttons\n * @return {undefined}\n */\n addToggleButtonEvents() {\n this.toggleButtons.forEach((toggleButton, index) => {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', event => {\n this.handleToggleClick(event, index);\n });\n }\n });\n }\n\n /**\n * Handle the click\n * @param {Object} event The event object\n * @param {number} index Index of the accordion to toggle\n * @return {undefined}\n */\n handleToggleClick(event, index) {\n this.toggleAccordionVisibility(this.accordions[index]);\n }\n\n /**\n * Show or hide the accordion\n * @param {HTMLElement} accordion The accordion element\n * @return {undefined}\n */\n toggleAccordionVisibility(accordion) {\n this.accordions.forEach(function (a) {\n a.classList.remove('is-active');\n });\n\n if (accordion.classList.contains('is-active')) {\n accordion.classList.remove('is-active');\n } else {\n accordion.classList.add('is-active');\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The plugin's options\n * @return {Accordion} The newly created instance\n */\n static create(options) {\n return new Accordion(options);\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n this.root = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Accordion({\n element\n });\n }\n\n static getRootClass() {\n return 'accordions';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('accordion', Accordion);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Accordion);\n\n//# sourceURL=webpack:///./src/plugins/accordion.js?");

@@ -144,3 +144,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Dropdown {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element || !options.trigger) {\n throw new Error('[BulmaJS] The dropdown component requires an element and trigger to function.');\n }\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n } else {\n this.root.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HtmlElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('[data-trigger]');\n\n new Dropdown({\n element: element,\n trigger: trigger\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('dropdown', Dropdown);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Dropdown);\n\n//# sourceURL=webpack:///./src/plugins/dropdown.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Dropdown {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element || !options.trigger) {\n throw new Error('[BulmaJS] The dropdown component requires an element and trigger to function.');\n }\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n } else {\n this.root.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HtmlElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('.dropdown-trigger');\n\n new Dropdown({\n element: element,\n trigger: trigger\n });\n }\n\n static getRootClass() {\n return 'dropdown';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('dropdown', Dropdown);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Dropdown);\n\n//# sourceURL=webpack:///./src/plugins/dropdown.js?");

@@ -157,3 +157,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass File {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The file component requires an element to function.');\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n this.trigger = this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n this.target = this.root.querySelector('.file-name');\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n handleTriggerChange(event) {\n if (event.target.files.length === 0) {\n this.clearFileName();\n }\n\n if (event.target.files.length === 1) {\n this.setFileName(event.target.files[0].name);\n }\n\n if (event.target.files.length > 1) {\n this.setFileName(event.target.files.length + ' files');\n }\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n clearFileName() {\n this.target.innerHTML = '';\n }\n\n /**\n * Set the text for the file name element.\n * @param {string} value The name of the file to update the label with\n * @return {undefined}\n */\n setFileName(value) {\n this.target.innerHTML = value;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new File({\n element: element\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('file', File);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (File);\n\n//# sourceURL=webpack:///./src/plugins/file.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass File {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The file component requires an element to function.');\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n this.trigger = this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n this.target = this.root.querySelector('.file-name');\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n handleTriggerChange(event) {\n if (event.target.files.length === 0) {\n this.clearFileName();\n }\n\n if (event.target.files.length === 1) {\n this.setFileName(event.target.files[0].name);\n }\n\n if (event.target.files.length > 1) {\n this.setFileName(event.target.files.length + ' files');\n }\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n clearFileName() {\n this.target.innerHTML = '';\n }\n\n /**\n * Set the text for the file name element.\n * @param {string} value The name of the file to update the label with\n * @return {undefined}\n */\n setFileName(value) {\n this.target.innerHTML = value;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new File({\n element: element\n });\n }\n\n static getRootClass() {\n return 'file';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('file', File);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (File);\n\n//# sourceURL=webpack:///./src/plugins/file.js?");

@@ -170,3 +170,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Message extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('message', options);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n this.size = options.hasOwnProperty('size') ? options.size : '';\n\n /**\n * The title of the message\n * @type {String}\n */\n this.title = options.hasOwnProperty('title') ? options.title : '';\n\n if (this.title) {\n this.createMessageHeader();\n }\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n\n if (this.size) {\n this.setSize();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for this instance\n * @return {Message} The newly created message instance\n */\n static create(options) {\n return new Message(options);\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n createMessageHeader() {\n let header = document.createElement('div');\n header.classList.add('message-header');\n\n header.innerHTML = '<p>' + this.title + '</p>';\n\n this.title = header;\n\n this.root.insertBefore(this.title, this.root.firstChild);\n }\n\n /**\n * Set the size of the message.\n * @return {undefined}\n */\n setSize() {\n this.root.classList.add('is-' + this.size);\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n insertBody() {\n let body = document.createElement('div');\n body.classList.add('message-body');\n body.innerHTML = this.body;\n\n this.root.appendChild(body);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Message(options);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('message', Message);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Message);\n\n//# sourceURL=webpack:///./src/plugins/message.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Message extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('message', options);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n this.size = options.hasOwnProperty('size') ? options.size : '';\n\n /**\n * The title of the message\n * @type {String}\n */\n this.title = options.hasOwnProperty('title') ? options.title : '';\n\n if (this.title) {\n this.createMessageHeader();\n }\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n\n if (this.size) {\n this.setSize();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for this instance\n * @return {Message} The newly created message instance\n */\n static create(options) {\n return new Message(options);\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n createMessageHeader() {\n let header = document.createElement('div');\n header.classList.add('message-header');\n\n header.innerHTML = '<p>' + this.title + '</p>';\n\n this.title = header;\n\n this.root.insertBefore(this.title, this.root.firstChild);\n }\n\n /**\n * Set the size of the message.\n * @return {undefined}\n */\n setSize() {\n this.root.classList.add('is-' + this.size);\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n insertBody() {\n let body = document.createElement('div');\n body.classList.add('message-body');\n body.innerHTML = this.body;\n\n this.root.appendChild(body);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Message(options);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n\n static getRootClass() {\n return 'message';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('message', Message);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Message);\n\n//# sourceURL=webpack:///./src/plugins/message.js?");

@@ -183,3 +183,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Modal {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Closable toggle switch.\n * @type {bool}\n */\n this.closable = options.hasOwnProperty('closable') ? options.closable : true;\n\n /**\n * The element used to close the message.\n * @type {HTMLElement}\n */\n this.closeButton = this.findCloseButton();\n\n if (this.closeButton && this.closable) {\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for the new instance\n * @return {Modal} The newly created instance\n */\n static create(options) {\n return new Modal(options);\n }\n\n /**\n * Show the message.\n * @return {undefined}\n */\n open() {\n this.root.classList.add('is-active');\n }\n\n /**\n * Hide the message.\n * @return {undefined}\n */\n close() {\n this.root.classList.remove('is-active');\n }\n\n /**\n * Find the close button.\n * @return {HTMLElement} The newly created element\n */\n findCloseButton() {\n let element = this.root.querySelector('.modal-close');\n\n if (!element) {\n return this.root.querySelector('.delete');\n }\n\n return element;\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n setupCloseEvent() {\n this.closeButton.addEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n /**\n * Handle the event when our close button is clicked.\n * @return {undefined}\n */\n handleCloseEvent() {\n this.close();\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n if (this.closable && this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n this.root = null;\n this.closeButton = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @return {undefined}\n */\n static handleDomParsing() {\n return;\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('modal', Modal);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modal);\n\n//# sourceURL=webpack:///./src/plugins/modal.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Modal {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Closable toggle switch.\n * @type {bool}\n */\n this.closable = options.hasOwnProperty('closable') ? options.closable : true;\n\n /**\n * The element used to close the message.\n * @type {HTMLElement}\n */\n this.closeButton = this.findCloseButton();\n\n if (this.closeButton && this.closable) {\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for the new instance\n * @return {Modal} The newly created instance\n */\n static create(options) {\n return new Modal(options);\n }\n\n /**\n * Show the message.\n * @return {undefined}\n */\n open() {\n this.root.classList.add('is-active');\n }\n\n /**\n * Hide the message.\n * @return {undefined}\n */\n close() {\n this.root.classList.remove('is-active');\n }\n\n /**\n * Find the close button.\n * @return {HTMLElement} The newly created element\n */\n findCloseButton() {\n let element = this.root.querySelector('.modal-close');\n\n if (!element) {\n return this.root.querySelector('.delete');\n }\n\n return element;\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n setupCloseEvent() {\n this.closeButton.addEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n /**\n * Handle the event when our close button is clicked.\n * @return {undefined}\n */\n handleCloseEvent() {\n this.close();\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n if (this.closable && this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n this.root = null;\n this.closeButton = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @return {undefined}\n */\n static handleDomParsing() {\n return;\n }\n\n static getRootClass() {\n return 'modal';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('modal', Modal);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modal);\n\n//# sourceURL=webpack:///./src/plugins/modal.js?");

@@ -196,3 +196,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Navbar {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element || !options.trigger || !options.target) {\n throw new Error('[BulmaJS] The navbar component requires an element, trigger and target to function.');\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n this.target = options.target;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('[data-trigger]'),\n target = trigger.getAttribute('data-target');\n\n new Navbar({\n element: element,\n trigger: trigger,\n target: element.querySelector('#' + target)\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('navbar', Navbar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navbar);\n\n//# sourceURL=webpack:///./src/plugins/navbar.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Navbar {\n\n static getRootClass() {\n return 'navbar';\n }\n\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element || !options.trigger || !options.target) {\n throw new Error('[BulmaJS] The navbar component requires an element, trigger and target to function.');\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n this.target = options.target;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Navbar({\n element: element,\n trigger: element.querySelector('.navbar-burger'),\n target: element.querySelector('.navbar-menu')\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('navbar', Navbar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navbar);\n\n//# sourceURL=webpack:///./src/plugins/navbar.js?");

@@ -209,3 +209,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Notification extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('notification', options);\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Notification} The newly created instance\n */\n static create(options) {\n return new Notification(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Notification(options);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('notification', Notification);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Notification);\n\n//# sourceURL=webpack:///./src/plugins/notification.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Notification extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('notification', options);\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Notification} The newly created instance\n */\n static create(options) {\n return new Notification(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Notification(options);\n }\n\n static getRootClass() {\n return 'notification';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('notification', Notification);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Notification);\n\n//# sourceURL=webpack:///./src/plugins/notification.js?");

@@ -222,3 +222,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Tabs {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n this.root = options.hasOwnProperty('root') ? options.root : null;\n\n this.nav = this.findNav();\n this.navItems = this.findNavItems();\n\n this.content = this.findContent();\n this.contentItems = this.findContentItems();\n\n this.setupNavEvents();\n }\n\n findNav() {\n return this.root.querySelector('[data-links]');\n }\n\n findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n findContent() {\n return this.root.querySelector('[data-content]');\n }\n\n findContentItems() {\n return this.content.querySelectorAll('li');\n }\n\n setupNavEvents() {\n this.navItems.forEach((navItem, index) => {\n navItem.addEventListener('click', () => {\n this.handleNavClick(navItem, index);\n });\n });\n }\n\n handleNavClick(navItem, index) {\n this.navItems.forEach(navItem => {\n navItem.classList.remove('is-active');\n });\n\n this.contentItems.forEach(contentItem => {\n contentItem.classList.remove('is-active');\n });\n\n navItem.classList.add('is-active');\n this.contentItems[index].classList.add('is-active');\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Tabs} The newly created instance\n */\n static create(options) {\n return new Tabs(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let options = {\n root: element\n };\n\n new Tabs(options);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('tabs', Tabs);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tabs);\n\n//# sourceURL=webpack:///./src/plugins/tabs.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Tabs {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * The root tab element\n * @param {HTMLElement}\n */\n this.root = options.hasOwnProperty('root') ? options.root : null;\n\n /**\n * Whether the tabs should be changed when the nav item is hovered over\n * @param {boolean}\n */\n this.hover = options.hasOwnProperty('hover') ? options.hover : false;\n\n /**\n * The tab nav container\n * @param {HTMLElement}\n */\n this.nav = this.findNav();\n\n /**\n * The tab's nav items\n * @param {HTMLElement[]}\n */\n this.navItems = this.findNavItems();\n\n /**\n * The tab content container\n * @param {HTMLElement}\n */\n this.content = this.findContent();\n\n /**\n * The tab's content items\n * @param {HTMLElement[]}\n */\n this.contentItems = this.findContentItems();\n\n this.setupNavEvents();\n }\n\n /**\n * Find the tab navigation container.\n * @returns {HTMLElement} The navigation container\n */\n findNav() {\n return this.root.querySelector('.tabs');\n }\n\n /**\n * Find each individual tab item\n * @returns {HTMLElement[]} An array of the found items\n */\n findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n /**\n * Find the tab content container.\n * @returns {HTMLElement} The content container\n */\n findContent() {\n return this.root.querySelector('.tabs-content');\n }\n\n /**\n * Find each individual content item\n * @returns {HTMLElement[]} An array of the found items\n */\n findContentItems() {\n return this.content.querySelectorAll('li');\n }\n\n /**\n * Setup the events to handle tab changing\n */\n setupNavEvents() {\n this.navItems.forEach((navItem, index) => {\n navItem.addEventListener('click', () => {\n this.handleNavClick(navItem, index);\n });\n\n if (this.hover) {\n navItem.addEventListener('mouseover', () => {\n this.handleNavClick(navItem, index);\n });\n }\n });\n }\n\n /**\n * Handle the changing of the visible tab\n * @param {HTMLelement} navItem \n * @param {number} index \n */\n handleNavClick(navItem, index) {\n this.navItems.forEach(navItem => {\n navItem.classList.remove('is-active');\n });\n\n this.contentItems.forEach(contentItem => {\n contentItem.classList.remove('is-active');\n });\n\n navItem.classList.add('is-active');\n this.contentItems[index].classList.add('is-active');\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Tabs} The newly created instance\n */\n static create(options) {\n return new Tabs(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let hover = element.hasAttribute('data-hover') ? true : false;\n\n let options = {\n root: element,\n hover: hover\n };\n\n console.log(new Tabs(options));\n }\n\n /**\n * The root class used for initialisation\n * @returns {string}\n */\n static getRootClass() {\n return 'tabs-wrapper';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('tabs', Tabs);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tabs);\n\n//# sourceURL=webpack:///./src/plugins/tabs.js?");

@@ -225,0 +225,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -85,0 +85,0 @@ /***/ }),

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Dropdown {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element || !options.trigger) {\n throw new Error('[BulmaJS] The dropdown component requires an element and trigger to function.');\n }\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n } else {\n this.root.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HtmlElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('[data-trigger]');\n\n new Dropdown({\n element: element,\n trigger: trigger\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('dropdown', Dropdown);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Dropdown);\n\n//# sourceURL=webpack:///./src/plugins/dropdown.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Dropdown {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element || !options.trigger) {\n throw new Error('[BulmaJS] The dropdown component requires an element and trigger to function.');\n }\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n } else {\n this.root.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HtmlElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('.dropdown-trigger');\n\n new Dropdown({\n element: element,\n trigger: trigger\n });\n }\n\n static getRootClass() {\n return 'dropdown';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('dropdown', Dropdown);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Dropdown);\n\n//# sourceURL=webpack:///./src/plugins/dropdown.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass File {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The file component requires an element to function.');\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n this.trigger = this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n this.target = this.root.querySelector('.file-name');\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n handleTriggerChange(event) {\n if (event.target.files.length === 0) {\n this.clearFileName();\n }\n\n if (event.target.files.length === 1) {\n this.setFileName(event.target.files[0].name);\n }\n\n if (event.target.files.length > 1) {\n this.setFileName(event.target.files.length + ' files');\n }\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n clearFileName() {\n this.target.innerHTML = '';\n }\n\n /**\n * Set the text for the file name element.\n * @param {string} value The name of the file to update the label with\n * @return {undefined}\n */\n setFileName(value) {\n this.target.innerHTML = value;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new File({\n element: element\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('file', File);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (File);\n\n//# sourceURL=webpack:///./src/plugins/file.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass File {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The file component requires an element to function.');\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n this.trigger = this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n this.target = this.root.querySelector('.file-name');\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n handleTriggerChange(event) {\n if (event.target.files.length === 0) {\n this.clearFileName();\n }\n\n if (event.target.files.length === 1) {\n this.setFileName(event.target.files[0].name);\n }\n\n if (event.target.files.length > 1) {\n this.setFileName(event.target.files.length + ' files');\n }\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n clearFileName() {\n this.target.innerHTML = '';\n }\n\n /**\n * Set the text for the file name element.\n * @param {string} value The name of the file to update the label with\n * @return {undefined}\n */\n setFileName(value) {\n this.target.innerHTML = value;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new File({\n element: element\n });\n }\n\n static getRootClass() {\n return 'file';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('file', File);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (File);\n\n//# sourceURL=webpack:///./src/plugins/file.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -107,3 +107,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Message extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('message', options);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n this.size = options.hasOwnProperty('size') ? options.size : '';\n\n /**\n * The title of the message\n * @type {String}\n */\n this.title = options.hasOwnProperty('title') ? options.title : '';\n\n if (this.title) {\n this.createMessageHeader();\n }\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n\n if (this.size) {\n this.setSize();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for this instance\n * @return {Message} The newly created message instance\n */\n static create(options) {\n return new Message(options);\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n createMessageHeader() {\n let header = document.createElement('div');\n header.classList.add('message-header');\n\n header.innerHTML = '<p>' + this.title + '</p>';\n\n this.title = header;\n\n this.root.insertBefore(this.title, this.root.firstChild);\n }\n\n /**\n * Set the size of the message.\n * @return {undefined}\n */\n setSize() {\n this.root.classList.add('is-' + this.size);\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n insertBody() {\n let body = document.createElement('div');\n body.classList.add('message-body');\n body.innerHTML = this.body;\n\n this.root.appendChild(body);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Message(options);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('message', Message);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Message);\n\n//# sourceURL=webpack:///./src/plugins/message.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Message extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('message', options);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n this.size = options.hasOwnProperty('size') ? options.size : '';\n\n /**\n * The title of the message\n * @type {String}\n */\n this.title = options.hasOwnProperty('title') ? options.title : '';\n\n if (this.title) {\n this.createMessageHeader();\n }\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n\n if (this.size) {\n this.setSize();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for this instance\n * @return {Message} The newly created message instance\n */\n static create(options) {\n return new Message(options);\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n createMessageHeader() {\n let header = document.createElement('div');\n header.classList.add('message-header');\n\n header.innerHTML = '<p>' + this.title + '</p>';\n\n this.title = header;\n\n this.root.insertBefore(this.title, this.root.firstChild);\n }\n\n /**\n * Set the size of the message.\n * @return {undefined}\n */\n setSize() {\n this.root.classList.add('is-' + this.size);\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n insertBody() {\n let body = document.createElement('div');\n body.classList.add('message-body');\n body.innerHTML = this.body;\n\n this.root.appendChild(body);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this plugin\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Message(options);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n\n static getRootClass() {\n return 'message';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('message', Message);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Message);\n\n//# sourceURL=webpack:///./src/plugins/message.js?");

@@ -110,0 +110,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Modal {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Closable toggle switch.\n * @type {bool}\n */\n this.closable = options.hasOwnProperty('closable') ? options.closable : true;\n\n /**\n * The element used to close the message.\n * @type {HTMLElement}\n */\n this.closeButton = this.findCloseButton();\n\n if (this.closeButton && this.closable) {\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for the new instance\n * @return {Modal} The newly created instance\n */\n static create(options) {\n return new Modal(options);\n }\n\n /**\n * Show the message.\n * @return {undefined}\n */\n open() {\n this.root.classList.add('is-active');\n }\n\n /**\n * Hide the message.\n * @return {undefined}\n */\n close() {\n this.root.classList.remove('is-active');\n }\n\n /**\n * Find the close button.\n * @return {HTMLElement} The newly created element\n */\n findCloseButton() {\n let element = this.root.querySelector('.modal-close');\n\n if (!element) {\n return this.root.querySelector('.delete');\n }\n\n return element;\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n setupCloseEvent() {\n this.closeButton.addEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n /**\n * Handle the event when our close button is clicked.\n * @return {undefined}\n */\n handleCloseEvent() {\n this.close();\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n if (this.closable && this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n this.root = null;\n this.closeButton = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @return {undefined}\n */\n static handleDomParsing() {\n return;\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('modal', Modal);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modal);\n\n//# sourceURL=webpack:///./src/plugins/modal.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Modal {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * Message body text.\n * @type {string}\n */\n this.root = options.hasOwnProperty('element') ? options.element : '';\n\n /**\n * Closable toggle switch.\n * @type {bool}\n */\n this.closable = options.hasOwnProperty('closable') ? options.closable : true;\n\n /**\n * The element used to close the message.\n * @type {HTMLElement}\n */\n this.closeButton = this.findCloseButton();\n\n if (this.closeButton && this.closable) {\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options THe options object for the new instance\n * @return {Modal} The newly created instance\n */\n static create(options) {\n return new Modal(options);\n }\n\n /**\n * Show the message.\n * @return {undefined}\n */\n open() {\n this.root.classList.add('is-active');\n }\n\n /**\n * Hide the message.\n * @return {undefined}\n */\n close() {\n this.root.classList.remove('is-active');\n }\n\n /**\n * Find the close button.\n * @return {HTMLElement} The newly created element\n */\n findCloseButton() {\n let element = this.root.querySelector('.modal-close');\n\n if (!element) {\n return this.root.querySelector('.delete');\n }\n\n return element;\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n setupCloseEvent() {\n this.closeButton.addEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n /**\n * Handle the event when our close button is clicked.\n * @return {undefined}\n */\n handleCloseEvent() {\n this.close();\n }\n\n /**\n * Destroy the message, removing the event listener, interval and element.\n * @return {undefined}\n */\n destroy() {\n if (this.closable && this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n this.root = null;\n this.closeButton = null;\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @return {undefined}\n */\n static handleDomParsing() {\n return;\n }\n\n static getRootClass() {\n return 'modal';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('modal', Modal);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modal);\n\n//# sourceURL=webpack:///./src/plugins/modal.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Navbar {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element || !options.trigger || !options.target) {\n throw new Error('[BulmaJS] The navbar component requires an element, trigger and target to function.');\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n this.target = options.target;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let trigger = element.querySelector('[data-trigger]'),\n target = trigger.getAttribute('data-target');\n\n new Navbar({\n element: element,\n trigger: trigger,\n target: element.querySelector('#' + target)\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('navbar', Navbar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navbar);\n\n//# sourceURL=webpack:///./src/plugins/navbar.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Navbar {\n\n static getRootClass() {\n return 'navbar';\n }\n\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created plugin instance\n */\n constructor(options) {\n if (!options.element || !options.trigger || !options.target) {\n throw new Error('[BulmaJS] The navbar component requires an element, trigger and target to function.');\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n this.trigger = options.trigger;\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n this.target = options.target;\n\n this.registerEvents();\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n registerEvents() {\n this.trigger.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n }\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n new Navbar({\n element: element,\n trigger: element.querySelector('.navbar-burger'),\n target: element.querySelector('.navbar-menu')\n });\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('navbar', Navbar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Navbar);\n\n//# sourceURL=webpack:///./src/plugins/navbar.js?");

@@ -98,0 +98,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -107,3 +107,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Notification extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('notification', options);\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Notification} The newly created instance\n */\n static create(options) {\n return new Notification(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Notification(options);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('notification', Notification);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Notification);\n\n//# sourceURL=webpack:///./src/plugins/notification.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n/* harmony import */ var _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\n\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nclass Notification extends _dismissableComponent__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n super('notification', options);\n\n // TODO: Move this into the DismissableComponent class. Due to the required\n // changes between different components, we may need a way to trigger this\n // when the component is ready.\n if (this.isDismissable) {\n if (!options.hasOwnProperty('closeButton')) {\n this.prependCloseButton();\n }\n\n this.setupCloseEvent();\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Notification} The newly created instance\n */\n static create(options) {\n return new Notification(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let closeBtn = element.querySelector('.delete');\n let dismissInterval = element.getAttribute('data-dismiss-interval');\n\n let options = {\n body: null,\n parent: element.parentNode,\n element: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true\n };\n\n if (dismissInterval) {\n options['dismissInterval'] = parseInt(dismissInterval);\n }\n\n new Notification(options);\n }\n\n static getRootClass() {\n return 'notification';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('notification', Notification);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Notification);\n\n//# sourceURL=webpack:///./src/plugins/notification.js?");

@@ -110,0 +110,0 @@ /***/ })

@@ -82,3 +82,3 @@ /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.4.0',\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll('[data-bulma]');\n\n elements.forEach(function (element) {\n let plugin = element.getAttribute('data-bulma');\n\n if (!Bulma.hasOwnProperty(plugin)) {\n throw new Error('[BulmaJS] Plugin with the key \\'' + plugin + '\\' has not been registered.');\n }\n\n if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {\n Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);\n }\n });\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");
eval("__webpack_require__.r(__webpack_exports__);\nconst Bulma = {\n /**\n * Current BulmaJS version.\n * @type {String}\n */\n VERSION: '0.5.0',\n\n /**\n * An index of the registered plugins\n * @type {Object}\n */\n plugins: {},\n\n /**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} options The options to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\n create(key, options) {\n if (!key || !Bulma.plugins.hasOwnProperty(key)) {\n throw new Error('[BulmaJS] A plugin with the key \\'' + key + '\\' has not been registered.');\n }\n\n return Bulma.plugins[key].create(options);\n },\n\n /**\n * Register a new plugin\n * @param {String} key The key to register the plugin under\n * @param {Object} plugin The plugin's main constructor\n * @return {undefined}\n */\n registerPlugin(key, plugin) {\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n this.plugins[key] = plugin;\n },\n\n /**\n * Parse the HTML DOM searching for data-bulma attributes. We will then pass\n * each element to the appropriate plugin to handle the required processing.\n * \n * @return {undefined}\n */\n traverseDOM() {\n let elements = document.querySelectorAll(this.getPluginClasses());\n\n elements.forEach(element => {\n let plugin = this.findCompatiblePlugin(element);\n\n if (plugin.hasOwnProperty('handleDomParsing')) {\n plugin.handleDomParsing(element);\n }\n });\n },\n\n getPluginClasses() {\n var classes = [];\n\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n classes.push('.' + this.plugins[key].getRootClass());\n }\n }\n\n return classes.join(',');\n },\n\n findCompatiblePlugin(element) {\n for (var key in this.plugins) {\n // FIXME: This is temporary, this check should not be required!\n if (this.plugins[key].hasOwnProperty('getRootClass')) {\n if (element.classList.contains(this.plugins[key].getRootClass())) {\n return this.plugins[key];\n }\n }\n }\n },\n\n /**\n * Create an element and assign classes\n * @param {string} name The name of the element to create\n * @param {array} classes An array of classes to add to the element\n * @return {HTMLElement} The newly created element\n */\n createElement(name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n let elem = document.createElement(name);\n\n classes.forEach(className => {\n elem.classList.add(className);\n });\n\n return elem;\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Bulma.traverseDOM();\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bulma);\n\n//# sourceURL=webpack:///./src/core.js?");

@@ -95,3 +95,3 @@ /***/ }),

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Tabs {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n this.root = options.hasOwnProperty('root') ? options.root : null;\n\n this.nav = this.findNav();\n this.navItems = this.findNavItems();\n\n this.content = this.findContent();\n this.contentItems = this.findContentItems();\n\n this.setupNavEvents();\n }\n\n findNav() {\n return this.root.querySelector('[data-links]');\n }\n\n findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n findContent() {\n return this.root.querySelector('[data-content]');\n }\n\n findContentItems() {\n return this.content.querySelectorAll('li');\n }\n\n setupNavEvents() {\n this.navItems.forEach((navItem, index) => {\n navItem.addEventListener('click', () => {\n this.handleNavClick(navItem, index);\n });\n });\n }\n\n handleNavClick(navItem, index) {\n this.navItems.forEach(navItem => {\n navItem.classList.remove('is-active');\n });\n\n this.contentItems.forEach(contentItem => {\n contentItem.classList.remove('is-active');\n });\n\n navItem.classList.add('is-active');\n this.contentItems[index].classList.add('is-active');\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Tabs} The newly created instance\n */\n static create(options) {\n return new Tabs(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let options = {\n root: element\n };\n\n new Tabs(options);\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('tabs', Tabs);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tabs);\n\n//# sourceURL=webpack:///./src/plugins/tabs.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Tabs {\n /**\n * Plugin constructor\n * @param {Object} options The options object for this plugin\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options) {\n options = {};\n }\n\n /**\n * The root tab element\n * @param {HTMLElement}\n */\n this.root = options.hasOwnProperty('root') ? options.root : null;\n\n /**\n * Whether the tabs should be changed when the nav item is hovered over\n * @param {boolean}\n */\n this.hover = options.hasOwnProperty('hover') ? options.hover : false;\n\n /**\n * The tab nav container\n * @param {HTMLElement}\n */\n this.nav = this.findNav();\n\n /**\n * The tab's nav items\n * @param {HTMLElement[]}\n */\n this.navItems = this.findNavItems();\n\n /**\n * The tab content container\n * @param {HTMLElement}\n */\n this.content = this.findContent();\n\n /**\n * The tab's content items\n * @param {HTMLElement[]}\n */\n this.contentItems = this.findContentItems();\n\n this.setupNavEvents();\n }\n\n /**\n * Find the tab navigation container.\n * @returns {HTMLElement} The navigation container\n */\n findNav() {\n return this.root.querySelector('.tabs');\n }\n\n /**\n * Find each individual tab item\n * @returns {HTMLElement[]} An array of the found items\n */\n findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n /**\n * Find the tab content container.\n * @returns {HTMLElement} The content container\n */\n findContent() {\n return this.root.querySelector('.tabs-content');\n }\n\n /**\n * Find each individual content item\n * @returns {HTMLElement[]} An array of the found items\n */\n findContentItems() {\n return this.content.querySelectorAll('li');\n }\n\n /**\n * Setup the events to handle tab changing\n */\n setupNavEvents() {\n this.navItems.forEach((navItem, index) => {\n navItem.addEventListener('click', () => {\n this.handleNavClick(navItem, index);\n });\n\n if (this.hover) {\n navItem.addEventListener('mouseover', () => {\n this.handleNavClick(navItem, index);\n });\n }\n });\n }\n\n /**\n * Handle the changing of the visible tab\n * @param {HTMLelement} navItem \n * @param {number} index \n */\n handleNavClick(navItem, index) {\n this.navItems.forEach(navItem => {\n navItem.classList.remove('is-active');\n });\n\n this.contentItems.forEach(contentItem => {\n contentItem.classList.remove('is-active');\n });\n\n navItem.classList.add('is-active');\n this.contentItems[index].classList.add('is-active');\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The options object for this instance\n * @return {Tabs} The newly created instance\n */\n static create(options) {\n return new Tabs(options);\n }\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @return {undefined}\n */\n static handleDomParsing(element) {\n let hover = element.hasAttribute('data-hover') ? true : false;\n\n let options = {\n root: element,\n hover: hover\n };\n\n console.log(new Tabs(options));\n }\n\n /**\n * The root class used for initialisation\n * @returns {string}\n */\n static getRootClass() {\n return 'tabs-wrapper';\n }\n}\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin('tabs', Tabs);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tabs);\n\n//# sourceURL=webpack:///./src/plugins/tabs.js?");

@@ -98,0 +98,0 @@ /***/ })

{
"name": "@vizuaalog/bulmajs",
"version": "0.4.0",
"version": "0.5.0",
"description": "Unofficial javascript extension to the awesome Bulma CSS framework.",

@@ -5,0 +5,0 @@ "main": "src/bulma.js",

@@ -6,5 +6,11 @@ const Bulma = {

*/
VERSION: '0.4.0',
VERSION: '0.5.0',
/**
* An index of the registered plugins
* @type {Object}
*/
plugins: {},
/**
* Helper method to create a new plugin.

@@ -16,7 +22,7 @@ * @param {String} key The plugin's key

create(key, options) {
if(!key || !Bulma.hasOwnProperty(key)) {
if(!key || !Bulma.plugins.hasOwnProperty(key)) {
throw new Error('[BulmaJS] A plugin with the key \''+key+'\' has not been registered.');
}
return Bulma[key].create(options);
return Bulma.plugins[key].create(options);
},

@@ -34,4 +40,4 @@

}
this[key] = plugin;
this.plugins[key] = plugin;
},

@@ -46,15 +52,35 @@

traverseDOM() {
let elements = document.querySelectorAll('[data-bulma]');
let elements = document.querySelectorAll(this.getPluginClasses());
elements.forEach((element) => {
let plugin = this.findCompatiblePlugin(element);
elements.forEach(function(element) {
let plugin = element.getAttribute('data-bulma');
if(plugin.hasOwnProperty('handleDomParsing')) {
plugin.handleDomParsing(element);
}
});
},
if(!Bulma.hasOwnProperty(plugin)) {
throw new Error('[BulmaJS] Plugin with the key \''+plugin+'\' has not been registered.');
getPluginClasses() {
var classes = [];
for(var key in this.plugins) {
// FIXME: This is temporary, this check should not be required!
if(this.plugins[key].hasOwnProperty('getRootClass')) {
classes.push('.' + this.plugins[key].getRootClass());
}
}
if(Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Bulma[element.getAttribute('data-bulma')].handleDomParsing(element);
return classes.join(',');
},
findCompatiblePlugin(element) {
for(var key in this.plugins) {
// FIXME: This is temporary, this check should not be required!
if(this.plugins[key].hasOwnProperty('getRootClass')) {
if(element.classList.contains(this.plugins[key].getRootClass())) {
return this.plugins[key];
}
}
});
}
},

@@ -61,0 +87,0 @@

@@ -131,2 +131,6 @@ import Bulma from '../core';

}
static getRootClass() {
return 'accordions';
}
}

@@ -133,0 +137,0 @@

@@ -60,3 +60,3 @@ import Bulma from '../core';

static handleDomParsing(element) {
let trigger = element.querySelector('[data-trigger]');
let trigger = element.querySelector('.dropdown-trigger');

@@ -68,2 +68,6 @@ new Dropdown({

}
static getRootClass() {
return 'dropdown';
}
}

@@ -70,0 +74,0 @@

@@ -94,2 +94,6 @@ import Bulma from '../core';

}
static getRootClass() {
return 'file';
}
}

@@ -96,0 +100,0 @@

@@ -131,2 +131,6 @@ import Bulma from '../core';

}
static getRootClass() {
return 'message';
}
}

@@ -133,0 +137,0 @@

@@ -117,2 +117,6 @@ import Bulma from '../core';

}
static getRootClass() {
return 'modal';
}
}

@@ -119,0 +123,0 @@

@@ -9,2 +9,7 @@ import Bulma from '../core';

class Navbar {
static getRootClass() {
return 'navbar';
}
/**

@@ -67,9 +72,6 @@ * Plugin constructor

static handleDomParsing(element) {
let trigger = element.querySelector('[data-trigger]'),
target = trigger.getAttribute('data-target');
new Navbar({
element: element,
trigger: trigger,
target: element.querySelector('#' + target)
trigger: element.querySelector('.navbar-burger'),
target: element.querySelector('.navbar-menu')
});

@@ -76,0 +78,0 @@ }

@@ -68,2 +68,6 @@ import Bulma from '../core';

}
static getRootClass() {
return 'notification';
}
}

@@ -70,0 +74,0 @@

@@ -19,8 +19,36 @@ import Bulma from '../core';

/**
* The root tab element
* @param {HTMLElement}
*/
this.root = options.hasOwnProperty('root') ? options.root : null;
/**
* Whether the tabs should be changed when the nav item is hovered over
* @param {boolean}
*/
this.hover = options.hasOwnProperty('hover') ? options.hover : false;
/**
* The tab nav container
* @param {HTMLElement}
*/
this.nav = this.findNav();
/**
* The tab's nav items
* @param {HTMLElement[]}
*/
this.navItems = this.findNavItems();
/**
* The tab content container
* @param {HTMLElement}
*/
this.content = this.findContent();
/**
* The tab's content items
* @param {HTMLElement[]}
*/
this.contentItems = this.findContentItems();

@@ -31,6 +59,14 @@

/**
* Find the tab navigation container.
* @returns {HTMLElement} The navigation container
*/
findNav() {
return this.root.querySelector('[data-links]');
return this.root.querySelector('.tabs');
}
/**
* Find each individual tab item
* @returns {HTMLElement[]} An array of the found items
*/
findNavItems() {

@@ -40,6 +76,14 @@ return this.nav.querySelectorAll('li');

/**
* Find the tab content container.
* @returns {HTMLElement} The content container
*/
findContent() {
return this.root.querySelector('[data-content]');
return this.root.querySelector('.tabs-content');
}
/**
* Find each individual content item
* @returns {HTMLElement[]} An array of the found items
*/
findContentItems() {

@@ -49,2 +93,6 @@ return this.content.querySelectorAll('li');

/**
* Setup the events to handle tab changing
* @returns {void}
*/
setupNavEvents() {

@@ -55,5 +103,17 @@ this.navItems.forEach((navItem, index) => {

});
if(this.hover) {
navItem.addEventListener('mouseover', () => {
this.handleNavClick(navItem, index);
});
}
});
}
/**
* Handle the changing of the visible tab
* @param {HTMLelement} navItem The nav item we are changing to
* @param {number} index The internal index of the nav item we're changing to
* @returns {void}
*/
handleNavClick(navItem, index) {

@@ -75,3 +135,3 @@ this.navItems.forEach((navItem) => {

* @param {Object} options The options object for this instance
* @return {Tabs} The newly created instance
* @returns {Tabs} The newly created instance
*/

@@ -85,7 +145,10 @@ static create(options) {

* @param {HTMLElement} element The root element for this instance
* @return {undefined}
* @returns {undefined}
*/
static handleDomParsing(element) {
let hover = element.hasAttribute('data-hover') ? true : false;
let options = {
root: element
root: element,
hover: hover
};

@@ -95,2 +158,10 @@

}
/**
* The root class used for initialisation
* @returns {string} The class this plugin is responsible for
*/
static getRootClass() {
return 'tabs-wrapper';
}
}

@@ -97,0 +168,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc