bulmajs-rails 0.3.3 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +13 -13
- data/.rspec +3 -3
- data/.travis.yml +5 -5
- data/CODE_OF_CONDUCT.md +74 -74
- data/Gemfile +6 -6
- data/Gemfile.lock +17 -17
- data/LICENSE.txt +21 -21
- data/README.md +128 -128
- data/Rakefile +6 -6
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/bulmajs-rails.gemspec +25 -25
- data/lib/bulmajs-rails.rb +4 -4
- data/vendor/assets/javascripts/bulma.js +289 -301
- metadata +12 -12
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rspec/core/rake_task"
|
3
|
-
|
4
|
-
RSpec::Core::RakeTask.new(:spec)
|
5
|
-
|
6
|
-
task :default => :spec
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
task :default => :spec
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "bulmajs/rails"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "bulmajs/rails"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -euo pipefail
|
3
|
-
IFS=$'\n\t'
|
4
|
-
set -vx
|
5
|
-
|
6
|
-
bundle install
|
7
|
-
|
8
|
-
# Do any other automated setup that you need to do here
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
IFS=$'\n\t'
|
4
|
+
set -vx
|
5
|
+
|
6
|
+
bundle install
|
7
|
+
|
8
|
+
# Do any other automated setup that you need to do here
|
data/bulmajs-rails.gemspec
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "bulmajs-rails"
|
7
|
-
spec.version = "0.
|
8
|
-
spec.authors = ["Douglas Harrington Muhone"]
|
9
|
-
spec.email = ["
|
10
|
-
|
11
|
-
spec.summary = %q{Ruby on rails wrapper for the unofficial javascript extension to the awesome Bulma CSS framework.}
|
12
|
-
spec.homepage = "https://github.com/
|
13
|
-
spec.license = "MIT"
|
14
|
-
|
15
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
|
-
f.match(%r{^(test|spec|features)/})
|
17
|
-
end
|
18
|
-
spec.bindir = "exe"
|
19
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = ["lib"]
|
21
|
-
|
22
|
-
spec.add_development_dependency "bundler", "~> 1.
|
23
|
-
spec.add_development_dependency "rake", "~>
|
24
|
-
spec.add_development_dependency "rspec", "~> 3.
|
25
|
-
end
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "bulmajs-rails"
|
7
|
+
spec.version = "0.11.0"
|
8
|
+
spec.authors = ["DHM Group", "Douglas Harrington Muhone"]
|
9
|
+
spec.email = ["doug@dhmgroup.dev"]
|
10
|
+
|
11
|
+
spec.summary = %q{Ruby on rails wrapper for the unofficial javascript extension to the awesome Bulma CSS framework.}
|
12
|
+
spec.homepage = "https://github.com/dhmgroup/bulmajs-rails"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
|
+
f.match(%r{^(test|spec|features)/})
|
17
|
+
end
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
23
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.8"
|
25
|
+
end
|
data/lib/bulmajs-rails.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module Bulmajs
|
2
|
-
class Engine < ::Rails::Engine
|
3
|
-
end
|
4
|
-
end
|
1
|
+
module Bulmajs
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
end
|
4
|
+
end
|
@@ -1,304 +1,292 @@
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
3
|
+
module.exports = factory();
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
5
|
+
define("Bulma", [], factory);
|
6
|
+
else if(typeof exports === 'object')
|
7
|
+
exports["Bulma"] = factory();
|
8
|
+
else
|
9
|
+
root["Bulma"] = factory();
|
10
|
+
})(window, function() {
|
11
|
+
return /******/ (function(modules) { // webpackBootstrap
|
12
|
+
/******/ // The module cache
|
13
|
+
/******/ var installedModules = {};
|
1
14
|
/******/
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
/******/
|
40
|
-
return module.exports;
|
41
|
-
/******/
|
42
|
-
}
|
43
|
-
/******/
|
44
|
-
/******/
|
45
|
-
/******/ // expose the modules object (__webpack_modules__)
|
46
|
-
/******/
|
47
|
-
__webpack_require__.m = modules;
|
48
|
-
/******/
|
49
|
-
/******/ // expose the module cache
|
50
|
-
/******/
|
51
|
-
__webpack_require__.c = installedModules;
|
52
|
-
/******/
|
53
|
-
/******/ // define getter function for harmony exports
|
54
|
-
/******/
|
55
|
-
__webpack_require__.d = function (exports, name, getter) {
|
56
|
-
/******/
|
57
|
-
if (!__webpack_require__.o(exports, name)) {
|
58
|
-
/******/
|
59
|
-
Object.defineProperty(exports, name, {
|
60
|
-
/******/
|
61
|
-
configurable: false,
|
62
|
-
/******/
|
63
|
-
enumerable: true,
|
64
|
-
/******/
|
65
|
-
get: getter
|
66
|
-
/******/
|
67
|
-
});
|
68
|
-
/******/
|
69
|
-
}
|
70
|
-
/******/
|
71
|
-
};
|
72
|
-
/******/
|
73
|
-
/******/ // define __esModule on exports
|
74
|
-
/******/
|
75
|
-
__webpack_require__.r = function (exports) {
|
76
|
-
/******/
|
77
|
-
Object.defineProperty(exports, '__esModule', {
|
78
|
-
value: true
|
79
|
-
});
|
80
|
-
/******/
|
81
|
-
};
|
82
|
-
/******/
|
83
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
84
|
-
/******/
|
85
|
-
__webpack_require__.n = function (module) {
|
86
|
-
/******/
|
87
|
-
var getter = module && module.__esModule ?
|
88
|
-
/******/
|
89
|
-
function getDefault() {
|
90
|
-
return module['default'];
|
91
|
-
} :
|
92
|
-
/******/
|
93
|
-
function getModuleExports() {
|
94
|
-
return module;
|
95
|
-
};
|
96
|
-
/******/
|
97
|
-
__webpack_require__.d(getter, 'a', getter);
|
98
|
-
/******/
|
99
|
-
return getter;
|
100
|
-
/******/
|
101
|
-
};
|
102
|
-
/******/
|
103
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
104
|
-
/******/
|
105
|
-
__webpack_require__.o = function (object, property) {
|
106
|
-
return Object.prototype.hasOwnProperty.call(object, property);
|
107
|
-
};
|
108
|
-
/******/
|
109
|
-
/******/ // __webpack_public_path__
|
110
|
-
/******/
|
111
|
-
__webpack_require__.p = "";
|
112
|
-
/******/
|
113
|
-
/******/
|
114
|
-
/******/ // Load entry module and return exports
|
115
|
-
/******/
|
116
|
-
return __webpack_require__(__webpack_require__.s = "./src/bulma.js");
|
117
|
-
/******/
|
118
|
-
})
|
119
|
-
/************************************************************************/
|
15
|
+
/******/ // The require function
|
16
|
+
/******/ function __webpack_require__(moduleId) {
|
17
|
+
/******/
|
18
|
+
/******/ // Check if module is in cache
|
19
|
+
/******/ if(installedModules[moduleId]) {
|
20
|
+
/******/ return installedModules[moduleId].exports;
|
21
|
+
/******/ }
|
22
|
+
/******/ // Create a new module (and put it into the cache)
|
23
|
+
/******/ var module = installedModules[moduleId] = {
|
24
|
+
/******/ i: moduleId,
|
25
|
+
/******/ l: false,
|
26
|
+
/******/ exports: {}
|
27
|
+
/******/ };
|
28
|
+
/******/
|
29
|
+
/******/ // Execute the module function
|
30
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31
|
+
/******/
|
32
|
+
/******/ // Flag the module as loaded
|
33
|
+
/******/ module.l = true;
|
34
|
+
/******/
|
35
|
+
/******/ // Return the exports of the module
|
36
|
+
/******/ return module.exports;
|
37
|
+
/******/ }
|
38
|
+
/******/
|
39
|
+
/******/
|
40
|
+
/******/ // expose the modules object (__webpack_modules__)
|
41
|
+
/******/ __webpack_require__.m = modules;
|
42
|
+
/******/
|
43
|
+
/******/ // expose the module cache
|
44
|
+
/******/ __webpack_require__.c = installedModules;
|
45
|
+
/******/
|
46
|
+
/******/ // define getter function for harmony exports
|
47
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
48
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
49
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
50
|
+
/******/ }
|
51
|
+
/******/ };
|
120
52
|
/******/
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
(function (
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
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 Calendar\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nclass Calendar {\n /**\n * Plugin constructor\n * @param {Object} options Plugin instance's options\n * @return {this} The newly created instance\n */\n constructor(options) {\n if (!options.element) {\n throw new Error('[BulmaJS] The Calendar component requires an element.');\n }\n\n /**\n * The root Calendar element.\n * @type {HTMLElement}\n */\n this.root = options.element;\n\n /**\n * The input element this calendar belongs to.\n * @type {HTMLElement|null}\n */\n this.inputElement = null;\n\n if (this.root.nodeName === 'INPUT') {\n this.inputElement = this.root;\n this.root = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div');\n }\n\n /**\n * The wrapper for the calendar\n * @type {HTMLElement}\n */\n this.wrapper = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', ['calendar']);\n\n /**\n * The current date for today tests\n * @type {Date}\n */\n this.now = new Date();\n\n /**\n * The date this calendar starts at\n * @type {Date}\n */\n this.date = options.hasOwnProperty('date') ? options.date : this.now;\n\n /**\n * The current year for the calendar\n * @type {int}\n */\n this.year = this.date.getFullYear();\n\n /**\n * The current month for the calendar\n * @type {int}\n */\n this.month = this.date.getMonth();\n\n /**\n * Month names\n * @type {Array}\n */\n this.months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n\n /**\n * Short day names\n * @type {Array}\n */\n this.shortDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n /**\n * Number of days in each month\n * @type {Array}\n */\n this.monthDays = [31, this.isLeapYear(this.year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n /**\n * Show the navigating buttons\n * @type {boolean}\n */\n this.navButtons = options.hasOwnProperty('navButtons') ? options.navButtons : true;\n\n /**\n * The format string for the date output. Used when attached to an input element.\n * @type {string}\n */\n this.format = options.hasOwnProperty('format') ? options.format : 'yyyy-mm-dd';\n\n /**\n * Should the calendar be shown as a modal. Used when attached to an input element\n * @type {boolean}\n */\n this.overlay = options.hasOwnProperty('overlay') ? options.overlay : false;\n\n if (this.overlay) {\n this.buildModal();\n }\n\n if (this.inputElement !== null) {\n this.inputElement.addEventListener('focus', event => {\n this.handleInputFocus(event);\n });\n }\n\n this.render();\n }\n\n ////////////////////////////////////////\n ///// HELPER METHODS TO BUILD HTML /////\n ////////////////////////////////////////\n\n /**\n * If we are to show as an overlay, build the modal's HTML\n * @return {undefined}\n */\n buildModal() {\n this.modal = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', ['modal']);\n this.modalBackground = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', ['modal-background']);\n\n let modalClose = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('button', ['modal-close']);\n\n modalClose.addEventListener('click', () => {\n this.modal.classList.remove('is-active');\n });\n\n this.modal.appendChild(this.modalBackground);\n this.modal.appendChild(modalClose);\n\n this.root.appendChild(this.modal);\n\n this.wrapper.style.zIndex = 40;\n }\n\n /**\n * Build the calendars nav HTML\n * @return {undefined}\n */\n buildNav() {\n let prevIcon, nextIcon;\n let nav = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', 'calendar-nav');\n let navLeft = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', 'calendar-nav-left');\n let navRight = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', 'calendar-nav-right');\n\n // Left side of nav (prev year/month buttons)\n if (this.navButtons) {\n this.prevYearButton = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('button', ['button', 'is-text']);\n prevIcon = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('i', ['fa', 'fa-backward']);\n this.prevYearButton.appendChild(prevIcon);\n\n this.prevYearButton.addEventListener('click', event => {\n this.handlePrevYearClick(event);\n });\n\n navLeft.appendChild(this.prevYearButton);\n\n this.prevMonthButton = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('button', ['button', 'is-text']);\n prevIcon = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('i', ['fa', 'fa-chevron-left']);\n this.prevMonthButton.appendChild(prevIcon);\n\n this.prevMonthButton.addEventListener('click', event => {\n this.handlePrevMonthClick(event);\n });\n\n navLeft.appendChild(this.prevMonthButton);\n\n // Right side of nav (next year/month buttons)\n this.nextMonthButton = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('button', ['button', 'is-text']);\n nextIcon = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('i', ['fa', 'fa-chevron-right']);\n this.nextMonthButton.appendChild(nextIcon);\n\n this.nextMonthButton.addEventListener('click', event => {\n this.handleNextMonthClick(event);\n });\n\n navRight.appendChild(this.nextMonthButton);\n\n this.nextYearButton = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('button', ['button', 'is-text']);\n prevIcon = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('i', ['fa', 'fa-forward']);\n this.nextYearButton.appendChild(prevIcon);\n\n this.nextYearButton.addEventListener('click', event => {\n this.handleNextYearClick(event);\n });\n\n navRight.appendChild(this.nextYearButton);\n }\n\n // Month/year label\n this.monthYearLabel = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div');\n this.monthYearLabel.innerHTML = this.months[this.month] + ' ' + this.year;\n\n nav.appendChild(navLeft);\n nav.appendChild(this.monthYearLabel);\n nav.appendChild(navRight);\n\n return nav;\n }\n\n /**\n * Build the calendar's container HTML\n * @return {HTMLElement} The calendar's container\n */\n buildContainer() {\n return _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', 'calendar-container');\n }\n\n /**\n * Build the calendar's header HTML\n * @return {HTMLElement} The calendar's header element\n */\n buildHeader() {\n let calendarHeader = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', 'calendar-header');\n\n this.shortDays.forEach(dayName => {\n let day = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', 'calendar-date');\n day.innerHTML = dayName;\n calendarHeader.appendChild(day);\n });\n\n return calendarHeader;\n }\n\n /**\n * Build the calendar's body. This includes all days.\n * @return {HTMLElement} The calendar's body element\n */\n buildBody() {\n let calendarBody = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', 'calendar-body');\n\n let daysInMonth = this.monthDays[this.now.getMonth()];\n\n // Number of days to show from the previous month.\n let daysBefore = new Date(this.year, this.month, 1).getDay();\n\n // Number of days to show from the next month\n let daysAfter;\n\n let numDays = daysInMonth + daysBefore;\n\n daysAfter = numDays;\n while (daysAfter > 7) {\n daysAfter -= 7;\n }\n\n numDays += 7 - daysAfter;\n\n let cells = [];\n\n for (let i = 0; i < numDays; i++) {\n let d = new Date(this.year, this.month, 1 + (i - daysBefore));\n\n let today = false;\n let thisMonth = false;\n\n if (d.getFullYear() === this.now.getFullYear() && d.getMonth() === this.now.getMonth() && d.getDate() === this.now.getDate()) {\n today = true;\n }\n\n if (d.getMonth() === this.month) {\n thisMonth = true;\n }\n\n cells.push({\n day: d.getDate(),\n isToday: today,\n isThisMonth: thisMonth\n });\n }\n\n cells.forEach(day => {\n let d = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('div', 'calendar-date');\n\n if (!day.isThisMonth) {\n d.classList.add('is-disabled');\n }\n\n let button = _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createElement('button', 'date-item');\n\n if (this.inputElement !== null && day.isThisMonth) {\n button.addEventListener('click', event => {\n this.handleDayClick(event, day);\n });\n }\n\n if (day.isToday) {\n button.classList.add('is-today');\n }\n\n button.innerHTML = day.day;\n\n d.appendChild(button);\n\n calendarBody.appendChild(d);\n });\n\n return calendarBody;\n }\n\n //////////////////////////\n ///// EVENT HANDLERS /////\n //////////////////////////\n\n /**\n * Called when the input box is in focus.\n * @return {undefined}\n */\n handleInputFocus() {\n if (this.overlay) {\n this.modal.classList.add('is-active');\n }\n\n this.inputElement.parentNode.insertBefore(this.root, this.inputElement.nextSibling);\n }\n\n /**\n * Event hander for when a day is clicked.\n * @param {Object} event The event object\n * @param {Object} day The day that was clicked\n * @return {undefined}\n */\n handleDayClick(event, day) {\n day = new Date(this.year, this.month, day.day);\n\n let dateString = this.formatDateString(day);\n\n this.inputElement.value = dateString;\n\n if (this.overlay) {\n this.modal.classList.remove('is-active');\n } else {\n this.inputElement.parentNode.removeChild(this.root);\n }\n }\n\n /**\n * Event handler for the previous month button.\n * @return {undefined}\n */\n handlePrevMonthClick() {\n this.month--;\n\n if (this.month < 0) {\n this.year--;\n this.month = 11;\n }\n\n this.render();\n }\n\n /**\n * Event handler for the next month button.\n * @return {undefined}\n */\n handleNextMonthClick() {\n this.month++;\n\n if (this.month > 11) {\n this.year++;\n this.month = 0;\n }\n\n this.render();\n }\n\n /**\n * Event handler for the previous year button.\n * @return {undefined}\n */\n handlePrevYearClick() {\n this.year--;\n\n this.render();\n }\n\n /**\n * Event handler for the next year button.\n * @return {undefined}\n */\n handleNextYearClick() {\n this.year++;\n\n this.render();\n }\n\n /**\n * Format the date based on the supplied format string.\n * @param {Object} day Date object representing the day to format\n * @returns {string} The formatted date string\n */\n formatDateString(day) {\n let dateString = this.format;\n\n // May be a better/faster way of doing this?\n if (dateString.indexOf('yyyy') !== -1) {\n dateString = this.format.replace('yyyy', day.getFullYear());\n } else {\n dateString = this.format.replace('yy', day.getFullYear().toString().substr(-2));\n }\n\n if (dateString.indexOf('mm') !== -1) {\n let month = day.getMonth() + 1;\n if (month < 10) {\n month = '0' + month.toString();\n }\n dateString = dateString.replace('mm', month);\n } else {\n dateString = dateString.replace('m', day.getMonth() + 1);\n }\n\n if (dateString.indexOf('dd') !== -1) {\n let date = day.getDate();\n if (date < 10) {\n date = '0' + date.toString();\n }\n dateString = dateString.replace('dd', date);\n } else {\n dateString = dateString.replace('d', day.getDate());\n }\n\n return dateString;\n }\n\n /**\n * Clear the calendar HTML, ready for a re-render.\n * @return {undefined}\n */\n clearCalendar() {\n while (this.wrapper.firstChild) {\n this.wrapper.removeChild(this.wrapper.firstChild);\n }\n }\n\n /**\n * Check if the passed year is a leap year.\n * @param {int} year The year to check against\n * @return {boolean} Is the year a leap year or not\n */\n isLeapYear(year) {\n // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n }\n\n /**\n * Render/build the calendar's HTML.\n * @return {undefined}\n */\n render() {\n this.clearCalendar();\n\n this.wrapper.appendChild(this.buildNav());\n\n let container = this.buildContainer();\n container.appendChild(this.buildHeader());\n container.appendChild(this.buildBody());\n\n this.wrapper.appendChild(container);\n\n if (this.overlay) {\n this.modal.insertBefore(this.wrapper, this.modalBackground.nextSibling);\n this.root.appendChild(this.modal);\n } else {\n this.root.appendChild(this.wrapper);\n }\n }\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} options The new calendar's options\n * @return {Calendar} The newly created calendar instance\n */\n static create(options) {\n return new Calendar(options);\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('calendar', Calendar);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Calendar);\n\n//# sourceURL=webpack:///./src/plugins/calendar.js?");
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
}),
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
"./src/plugins/
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
}),
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
(function (module,
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
53
|
+
/******/ // define __esModule on exports
|
54
|
+
/******/ __webpack_require__.r = function(exports) {
|
55
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
56
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
57
|
+
/******/ }
|
58
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
59
|
+
/******/ };
|
60
|
+
/******/
|
61
|
+
/******/ // create a fake namespace object
|
62
|
+
/******/ // mode & 1: value is a module id, require it
|
63
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
64
|
+
/******/ // mode & 4: return value when already ns object
|
65
|
+
/******/ // mode & 8|1: behave like require
|
66
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
67
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
68
|
+
/******/ if(mode & 8) return value;
|
69
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
70
|
+
/******/ var ns = Object.create(null);
|
71
|
+
/******/ __webpack_require__.r(ns);
|
72
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
73
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
74
|
+
/******/ return ns;
|
75
|
+
/******/ };
|
76
|
+
/******/
|
77
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
78
|
+
/******/ __webpack_require__.n = function(module) {
|
79
|
+
/******/ var getter = module && module.__esModule ?
|
80
|
+
/******/ function getDefault() { return module['default']; } :
|
81
|
+
/******/ function getModuleExports() { return module; };
|
82
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
83
|
+
/******/ return getter;
|
84
|
+
/******/ };
|
85
|
+
/******/
|
86
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
87
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88
|
+
/******/
|
89
|
+
/******/ // __webpack_public_path__
|
90
|
+
/******/ __webpack_require__.p = "";
|
91
|
+
/******/
|
92
|
+
/******/
|
93
|
+
/******/ // Load entry module and return exports
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = "./src/bulma.js");
|
95
|
+
/******/ })
|
96
|
+
/************************************************************************/
|
97
|
+
/******/ ({
|
98
|
+
|
99
|
+
/***/ "./src/ConfigBag.js":
|
100
|
+
/*!**************************!*\
|
101
|
+
!*** ./src/ConfigBag.js ***!
|
102
|
+
\**************************/
|
103
|
+
/*! no static exports found */
|
104
|
+
/***/ (function(module, exports, __webpack_require__) {
|
105
|
+
|
106
|
+
"use strict";
|
107
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Object to hold a plugin's configuration\n * @class ConfigBag\n * @since 0.11.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar ConfigBag = function () {\n function ConfigBag() {\n var initialConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n _classCallCheck(this, ConfigBag);\n\n if ((typeof initialConfig === 'undefined' ? 'undefined' : _typeof(initialConfig)) !== 'object') {\n throw new TypeError('initialConfig must be of type object.');\n }\n\n this._items = initialConfig;\n }\n\n /**\n * Set a new config property\n * @param {string} key The config property's key\n * @param {mixed} value The config property's value\n */\n\n\n _createClass(ConfigBag, [{\n key: 'set',\n value: function set(key, value) {\n if (!key || !value) {\n throw new Error('A key and value must be provided when setting a new option.');\n }\n\n this._items[key] = value;\n }\n\n /**\n * Check if a key exists\n * @param {string} key\n * @returns {boolean}\n */\n\n }, {\n key: 'has',\n value: function has(key) {\n if (!key) {\n throw new Error('A key must be provided.');\n }\n\n return this._items.hasOwnProperty(key) && this._items[key];\n }\n\n /**\n * Get a property by it's key. Returns the defaultValue if it doesn't exists\n * @param {string} key \n * @param {mixed} defaultValue \n * @returns {mixed}\n */\n\n }, {\n key: 'get',\n value: function get(key) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (defaultValue && !this.has(key)) {\n if (typeof defaultValue === 'function') {\n return defaultValue();\n }\n\n return defaultValue;\n }\n\n return this._items[key];\n }\n }]);\n\n return ConfigBag;\n}();\n\nexports.default = ConfigBag;\n\n//# sourceURL=webpack://Bulma/./src/ConfigBag.js?");
|
108
|
+
|
109
|
+
/***/ }),
|
110
|
+
|
111
|
+
/***/ "./src/Data.js":
|
112
|
+
/*!*********************!*\
|
113
|
+
!*** ./src/Data.js ***!
|
114
|
+
\*********************/
|
115
|
+
/*! no static exports found */
|
116
|
+
/***/ (function(module, exports, __webpack_require__) {
|
117
|
+
|
118
|
+
"use strict";
|
119
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Data = function () {\n function Data() {\n _classCallCheck(this, Data);\n\n this._data = {};\n }\n\n _createClass(Data, [{\n key: \"set\",\n value: function set(uid, key, value) {\n if (!this._data.hasOwnProperty(uid)) {\n this._data[uid] = {};\n }\n\n this._data[uid][key] = value;\n }\n }, {\n key: \"get\",\n value: function get(uid, key) {\n if (!this._data.hasOwnProperty(uid)) {\n return undefined;\n }\n\n return this._data[uid][key];\n }\n }, {\n key: \"destroy\",\n value: function destroy(uid) {\n if (this._data.hasOwnProperty(uid)) {\n delete this._data[uid];\n }\n }\n }]);\n\n return Data;\n}();\n\nData.uid = 1;\n\nexports.default = Data;\n\n//# sourceURL=webpack://Bulma/./src/Data.js?");
|
120
|
+
|
121
|
+
/***/ }),
|
122
|
+
|
123
|
+
/***/ "./src/bulma.js":
|
124
|
+
/*!**********************!*\
|
125
|
+
!*** ./src/bulma.js ***!
|
126
|
+
\**********************/
|
127
|
+
/*! no static exports found */
|
128
|
+
/***/ (function(module, exports, __webpack_require__) {
|
129
|
+
|
130
|
+
"use strict";
|
131
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _core = __webpack_require__(/*! ./core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _notification = __webpack_require__(/*! ./plugins/notification */ \"./src/plugins/notification.js\");\n\nvar _notification2 = _interopRequireDefault(_notification);\n\nvar _navbar = __webpack_require__(/*! ./plugins/navbar */ \"./src/plugins/navbar.js\");\n\nvar _navbar2 = _interopRequireDefault(_navbar);\n\nvar _message = __webpack_require__(/*! ./plugins/message */ \"./src/plugins/message.js\");\n\nvar _message2 = _interopRequireDefault(_message);\n\nvar _dropdown = __webpack_require__(/*! ./plugins/dropdown */ \"./src/plugins/dropdown.js\");\n\nvar _dropdown2 = _interopRequireDefault(_dropdown);\n\nvar _modal = __webpack_require__(/*! ./plugins/modal */ \"./src/plugins/modal.js\");\n\nvar _modal2 = _interopRequireDefault(_modal);\n\nvar _alert = __webpack_require__(/*! ./plugins/alert */ \"./src/plugins/alert.js\");\n\nvar _alert2 = _interopRequireDefault(_alert);\n\nvar _file = __webpack_require__(/*! ./plugins/file */ \"./src/plugins/file.js\");\n\nvar _file2 = _interopRequireDefault(_file);\n\nvar _tabs = __webpack_require__(/*! ./plugins/tabs */ \"./src/plugins/tabs.js\");\n\nvar _tabs2 = _interopRequireDefault(_tabs);\n\nvar _accordion = __webpack_require__(/*! ./plugins/accordion */ \"./src/plugins/accordion.js\");\n\nvar _accordion2 = _interopRequireDefault(_accordion);\n\nvar _calendar = __webpack_require__(/*! ./plugins/calendar */ \"./src/plugins/calendar.js\");\n\nvar _calendar2 = _interopRequireDefault(_calendar);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _core2.default; /* eslint no-unused-vars: 0 */\n\n//# sourceURL=webpack://Bulma/./src/bulma.js?");
|
132
|
+
|
133
|
+
/***/ }),
|
134
|
+
|
135
|
+
/***/ "./src/core.js":
|
136
|
+
/*!*********************!*\
|
137
|
+
!*** ./src/core.js ***!
|
138
|
+
\*********************/
|
139
|
+
/*! no static exports found */
|
140
|
+
/***/ (function(module, exports, __webpack_require__) {
|
141
|
+
|
142
|
+
"use strict";
|
143
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Data = __webpack_require__(/*! ./Data */ \"./src/Data.js\");\n\nvar _Data2 = _interopRequireDefault(_Data);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Wrap an element around Bulma.\n * @param {String|HTMLElement} selector The selector or HTMLElement to wrap.\n */\nfunction Bulma(selector) {\n if (!(this instanceof Bulma)) {\n return new Bulma(selector);\n }\n\n if (selector instanceof Bulma) {\n return selector;\n }\n\n if (selector instanceof HTMLElement) {\n this._elem = selector;\n } else {\n this._elem = document.querySelector(selector);\n }\n\n if (!this._elem.hasOwnProperty(Bulma.id)) {\n this._elem[Bulma.id] = _Data2.default.uid++;\n }\n\n return this;\n}\n\n/**\n * Current BulmaJS version.\n * @type {String}\n */\nBulma.VERSION = '0.11.0';\n\n/**\n * Unique ID of Bulma\n * @type {String}\n */\nBulma.id = 'bulma-' + new Date().getTime();\n\n/**\n * Global data cache for HTML elements\n * @type {Data}\n */\nBulma.cache = new _Data2.default();\n\n/**\n * An index of the registered plugins\n * @type {Object}\n */\nBulma.plugins = {};\n\n/**\n * Helper method to create a new plugin.\n * @param {String} key The plugin's key\n * @param {Object} config The config to be passed to the plugin\n * @return {Object} The newly created plugin instance\n */\nBulma.create = function (key, config) {\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 new Bulma.plugins[key].handler(config);\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 * @param {number?} priority The priority this plugin has over other plugins. Higher means the plugin is registered before lower.\n * @return {undefined}\n */\nBulma.registerPlugin = function (key, plugin) {\n var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (!key) {\n throw new Error('[BulmaJS] Key attribute is required.');\n }\n\n Bulma.plugins[key] = {\n priority: priority,\n handler: plugin\n };\n\n Bulma.prototype[key] = function (config) {\n return new Bulma.plugins[key].handler(config, this);\n };\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 * @param {HTMLElement} root The root of the document we're going to parse.\n * @return {undefined}\n */\nBulma.parseDocument = function () {\n var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n\n var sortedPlugins = Object.keys(Bulma.plugins).sort(function (a, b) {\n return Bulma.plugins[a].priority < Bulma.plugins[b].priority;\n });\n\n Bulma.each(sortedPlugins, function (key) {\n if (!Bulma.plugins[key].handler.hasOwnProperty('parseDocument')) {\n // eslint-disable-next-line no-console\n console.error('[BulmaJS] Plugin ' + key + ' does not have a parseDocument method. Automatic document parsing is not possible for this plugin.');\n return;\n }\n\n Bulma.plugins[key].handler.parseDocument(root);\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 */\nBulma.createElement = function (name, classes) {\n if (!classes) {\n classes = [];\n }\n\n if (typeof classes === 'string') {\n classes = [classes];\n }\n\n var elem = document.createElement(name);\n\n Bulma.each(classes, function (className) {\n elem.classList.add(className);\n });\n\n return elem;\n};\n\n/**\n * Find an element otherwise create a new one.\n * @param {string} query The CSS selector query to find\n * @param {HTMLElement|null} parent The parent we want to search/create within\n * @param {[string]} elemName The name of the element to create\n * @param {[array]} classes The classes to apply to the element\n * @returns {HTMLElement} The HTML element we found or created\n */\nBulma.findOrCreateElement = function (query) {\n var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;\n var elemName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'div';\n var classes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n\n var elem = parent.querySelector(query);\n\n if (!elem) {\n if (classes.length === 0) {\n classes = query.split('.').filter(function (item) {\n return item;\n });\n }\n\n var newElem = Bulma.createElement(elemName, classes);\n\n parent.appendChild(newElem);\n\n return newElem;\n }\n\n return elem;\n};\n\n/**\n * For loop helper\n * @param {*} objects The array/object to loop through\n * @param {*} callback The callback used for each item\n */\nBulma.each = function (objects, callback) {\n var i = void 0;\n\n for (i = 0; i < objects.length; i++) {\n callback(objects[i], i);\n }\n};\n\n/**\n * Make an AJAX GET request to the specified URL. Stripping any script tags from the response.\n * @param {*} url The url to send the request to\n * @returns {Promise} Returns a promise containing the response HTML or error\n */\nBulma.ajax = function (url) {\n return new Promise(function (resolve, reject) {\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n\n request.onload = function () {\n if (request.status >= 200 && request.status < 400) {\n resolve(Bulma._stripScripts(request.responseText));\n } else {\n reject();\n }\n };\n\n request.onerror = function () {\n return reject();\n };\n\n request.send();\n });\n};\n\n/**\n * Strip any script tags from a HTML string.\n * @param {string} htmlString \n * @returns {string} The cleaned HTML string\n * \n * @private\n */\nBulma._stripScripts = function (htmlString) {\n var div = document.createElement('div');\n div.innerHTML = htmlString;\n\n var scripts = div.getElementsByTagName('script');\n\n var i = scripts.length;\n\n while (i--) {\n scripts[i].parentNode.removeChild(scripts[i]);\n }\n\n return div.innerHTML.replace(/ +/g, ' ');;\n};\n\n/**\n * Get or set custom data on a Bulma element.\n * @type {String} key\n * @type {any} value\n * @returns {Bulma}\n */\nBulma.prototype.data = function (key, value) {\n if (!value) {\n return Bulma.cache.get(this._elem[Bulma.id], key);\n }\n\n Bulma.cache.set(this._elem[Bulma.id], key, value);\n\n return this;\n};\n\n/**\n * Destroy the data for an element.\n * @returns {Bulma}\n */\nBulma.prototype.destroyData = function () {\n Bulma.cache.destroy(this._elem[Bulma.id]);\n\n return this;\n};\n\ndocument.addEventListener('turbolinks:load', function () {\n if (window.hasOwnProperty('bulmaOptions') && window.bulmaOptions.autoParseDocument === false) {\n return;\n }\n\n Bulma.parseDocument();\n});\n\nexports.default = Bulma;\n\n//# sourceURL=webpack://Bulma/./src/core.js?");
|
144
|
+
|
145
|
+
/***/ }),
|
146
|
+
|
147
|
+
/***/ "./src/dismissableComponent.js":
|
148
|
+
/*!*************************************!*\
|
149
|
+
!*** ./src/dismissableComponent.js ***!
|
150
|
+
\*************************************/
|
151
|
+
/*! no static exports found */
|
152
|
+
/***/ (function(module, exports, __webpack_require__) {
|
153
|
+
|
154
|
+
"use strict";
|
155
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _plugin = __webpack_require__(/*! ./plugin */ \"./src/plugin.js\");\n\nvar _plugin2 = _interopRequireDefault(_plugin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module DismissableComponent\n * @since 0.2.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar DismissableComponent = function (_Plugin) {\n _inherits(DismissableComponent, _Plugin);\n\n _createClass(DismissableComponent, null, [{\n key: 'defaultConfig',\n\n /**\n * Returns an object containing the default config for this plugin.\n * @returns {object} The default config object.\n */\n value: function defaultConfig() {\n return {\n isDismissable: false,\n destroyOnDismiss: true,\n element: null\n };\n }\n\n /**\n * Plugin constructor\n * @param {string} name Plugin's name\n * @param {Object} config Plugin's config\n * @return {this} The new plugin instance\n */\n\n }]);\n\n function DismissableComponent(name, config) {\n _classCallCheck(this, DismissableComponent);\n\n /**\n * The name of this component, this will be used as the root class\n * @type {string}\n */\n var _this = _possibleConstructorReturn(this, (DismissableComponent.__proto__ || Object.getPrototypeOf(DismissableComponent)).call(this, config));\n\n _this.name = name;\n\n /**\n * Body text.\n * @type {string}\n */\n _this.body = _this.config.get('body');\n\n /**\n * Color modifier.\n * @type {string} Possible values are null, primary, info, success, warning, danger\n */\n _this.color = _this.config.get('color');\n\n /**\n * How long to wait before auto dismissing the component.\n * @type {int|null} If null component must be dismissed manually.\n */\n _this.dismissInterval = _this.config.get('dismissInterval') ? _this.createDismissInterval(_this.config.get('dismissInterval')) : null;\n\n /**\n * Does this component have a dismiss button?\n * @type {Boolean}\n */\n _this.isDismissable = _this.config.get('isDismissable');\n\n /**\n * Should this component be destroyed when it is dismissed.\n * @type {Boolean}\n */\n _this.destroyOnDismiss = _this.config.get('destroyOnDismiss');\n\n /**\n * The root element.\n * @type {HTMLElement|null} If this is not provided a new element will be created.\n */\n _this.root = _this.config.get('element');\n\n if (!_this.root) {\n _this.createRootElement();\n _this.parent.appendChild(_this.root);\n }\n\n _this.root.setAttribute('data-bulma-attached', 'attached');\n\n /**\n * The element used to close the component.\n * @type {HTMLElement}\n */\n _this.closeButton = _this.config.get('closeButton', _this.createCloseButton());\n\n if (_this.body) {\n _this.insertBody();\n }\n\n if (_this.color) {\n _this.setColor();\n }\n return _this;\n }\n\n /**\n * Create the main element.\n * @return {undefined}\n */\n\n\n _createClass(DismissableComponent, [{\n key: 'createRootElement',\n value: function createRootElement() {\n this.root = document.createElement('div');\n\n this.root.classList.add(this.name);\n this.hide();\n }\n\n /**\n * Show the component.\n * @return {undefined}\n */\n\n }, {\n key: 'show',\n value: function show() {\n this.root.classList.remove('is-hidden');\n }\n\n /**\n * Hide the component.\n * @return {undefined}\n */\n\n }, {\n key: 'hide',\n value: function hide() {\n this.root.classList.add('is-hidden');\n }\n\n /**\n * Insert the body text into the component.\n * @return {undefined}\n */\n\n }, {\n key: 'insertBody',\n value: function insertBody() {\n this.root.innerHTML = this.body;\n }\n\n /**\n * Create the element that will be used to close the component.\n * @return {HTMLElement} The newly created close button\n */\n\n }, {\n key: 'createCloseButton',\n value: function createCloseButton() {\n var closeButton = document.createElement('button');\n closeButton.setAttribute('type', 'button');\n closeButton.classList.add('delete');\n\n return closeButton;\n }\n\n /**\n * Create an interval to dismiss the component after the set number of ms.\n * @param {int} interval The time to wait before dismissing the component\n * @return {undefined}\n */\n\n }, {\n key: 'createDismissInterval',\n value: function createDismissInterval(interval) {\n var _this2 = this;\n\n return setInterval(function () {\n _this2.handleCloseEvent();\n }, interval);\n }\n\n /**\n * Insert the close button before our content.\n * @return {undefined}\n */\n\n }, {\n key: 'prependCloseButton',\n value: function prependCloseButton() {\n this.root.insertBefore(this.closeButton, this.root.firstChild);\n }\n\n /**\n * Setup the event listener for the close button.\n * @return {undefined}\n */\n\n }, {\n key: 'setupCloseEvent',\n value: function 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\n }, {\n key: 'handleCloseEvent',\n value: function handleCloseEvent() {\n this.trigger('dismissed');\n\n if (this.destroyOnDismiss) {\n this.destroy();\n } else {\n this.hide();\n }\n\n this.trigger('close');\n }\n\n /**\n * Set the colour of the component.\n * @return {undefined}\n */\n\n }, {\n key: 'setColor',\n value: function setColor() {\n this.root.classList.add('is-' + this.color);\n }\n\n /**\n * Destroy the component, removing the event listener, interval and element.\n * @return {undefined}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _get(DismissableComponent.prototype.__proto__ || Object.getPrototypeOf(DismissableComponent.prototype), 'destroy', this).call(this);\n\n if (this.closeButton) {\n this.closeButton.removeEventListener('click', this.handleCloseEvent.bind(this));\n }\n\n clearInterval(this.dismissInterval);\n\n this.parent.removeChild(this.root);\n this.parent = null;\n this.root = null;\n\n this.trigger('destroyed');\n }\n }]);\n\n return DismissableComponent;\n}(_plugin2.default);\n\nexports.default = DismissableComponent;\n\n//# sourceURL=webpack://Bulma/./src/dismissableComponent.js?");
|
156
|
+
|
157
|
+
/***/ }),
|
158
|
+
|
159
|
+
/***/ "./src/plugin.js":
|
160
|
+
/*!***********************!*\
|
161
|
+
!*** ./src/plugin.js ***!
|
162
|
+
\***********************/
|
163
|
+
/*! no static exports found */
|
164
|
+
/***/ (function(module, exports, __webpack_require__) {
|
165
|
+
|
166
|
+
"use strict";
|
167
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _ConfigBag = __webpack_require__(/*! ./ConfigBag */ \"./src/ConfigBag.js\");\n\nvar _ConfigBag2 = _interopRequireDefault(_ConfigBag);\n\nvar _core = __webpack_require__(/*! ./core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Base plugin class. Provides basic, common functionality.\n * @class Plugin\n * @since 0.7.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar Plugin = function () {\n _createClass(Plugin, null, [{\n key: 'defaultConfig',\n\n /**\n * Returns an object containing the default config for this plugin.\n * @returns {object} The default config object.\n */\n value: function defaultConfig() {\n return {};\n }\n\n /**\n * Create a plugin.\n * @param {object} config The config for this plugin\n */\n\n }]);\n\n function Plugin() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var root = arguments[1];\n\n _classCallCheck(this, Plugin);\n\n if (root) {\n config.root = root._elem;\n }\n\n this.config = new _ConfigBag2.default(_extends({}, this.constructor.defaultConfig(), config));\n\n this.parent = this.config.get('parent', config.root.parentNode);\n\n this._events = {};\n }\n\n _createClass(Plugin, [{\n key: 'on',\n value: function on(event, callback) {\n if (!this._events.hasOwnProperty(event)) {\n this._events[event] = [];\n }\n\n this._events[event].push(callback);\n }\n }, {\n key: 'trigger',\n value: function trigger(event) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!this._events.hasOwnProperty(event)) {\n return;\n }\n\n for (var i = 0; i < this._events[event].length; i++) {\n this._events[event][i](data);\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n (0, _core2.default)(this.root).destroyData();\n }\n }]);\n\n return Plugin;\n}();\n\nexports.default = Plugin;\n\n//# sourceURL=webpack://Bulma/./src/plugin.js?");
|
168
|
+
|
169
|
+
/***/ }),
|
170
|
+
|
171
|
+
/***/ "./src/plugins/accordion.js":
|
172
|
+
/*!**********************************!*\
|
173
|
+
!*** ./src/plugins/accordion.js ***!
|
174
|
+
\**********************************/
|
175
|
+
/*! no static exports found */
|
176
|
+
/***/ (function(module, exports, __webpack_require__) {
|
177
|
+
|
178
|
+
"use strict";
|
179
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _plugin = __webpack_require__(/*! ../plugin */ \"./src/plugin.js\");\n\nvar _plugin2 = _interopRequireDefault(_plugin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Accordion\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @deprecated\n */\nvar Accordion = function (_Plugin) {\n _inherits(Accordion, _Plugin);\n\n _createClass(Accordion, null, [{\n key: 'parseDocument',\n\n /**\n * Handle parsing the DOM.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n value: function parseDocument(context) {\n var elements = context.querySelectorAll('.accordions');\n\n _core2.default.each(elements, function (element) {\n (0, _core2.default)(element).data('accordion', new Accordion({\n root: element\n }));\n });\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The plugin's config\n * @return {this} The new plugin instance\n */\n\n }]);\n\n function Accordion(config, root) {\n _classCallCheck(this, Accordion);\n\n // eslint-disable-next-line no-console\n var _this = _possibleConstructorReturn(this, (Accordion.__proto__ || Object.getPrototypeOf(Accordion)).call(this, config, root));\n\n console.warn('[BulmaJS] The accordion plugin has been deprecated and will be removed in the 1.0 release. It is recommended to use the Wikiki\\'s accordion plugin');\n\n /**\n * Accordion element.\n * @type {string}\n */\n _this.root = _this.config.get('root');\n _this.root.setAttribute('data-bulma-attached', 'attached');\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 (0, _core2.default)(_this.root).data('accordion', _this);\n\n _this.trigger('init');\n return _this;\n }\n\n /**\n * Find the accordion items within this accordions element\n * @returns {Array} The accordion elements found\n */\n\n\n _createClass(Accordion, [{\n key: 'findAccordions',\n value: function 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\n }, {\n key: 'findToggleButtons',\n value: function findToggleButtons() {\n var buttons = [];\n\n _core2.default.each(this.accordions, function (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\n }, {\n key: 'addToggleButtonEvents',\n value: function addToggleButtonEvents() {\n var _this2 = this;\n\n _core2.default.each(this.toggleButtons, function (toggleButton, index) {\n // If the button is null, the accordion item has no toggle button\n if (toggleButton !== null) {\n toggleButton.addEventListener('click', function (event) {\n _this2.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\n }, {\n key: 'handleToggleClick',\n value: function 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\n }, {\n key: 'toggleAccordionVisibility',\n value: function toggleAccordionVisibility(accordion) {\n _core2.default.each(this.accordions, 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 * Destroy the accordion\n * @return {undefined}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _get(Accordion.prototype.__proto__ || Object.getPrototypeOf(Accordion.prototype), 'destroy', this).call(this);\n\n this.root = null;\n\n this.trigger('destroyed');\n }\n }]);\n\n return Accordion;\n}(_plugin2.default);\n\n_core2.default.registerPlugin('accordion', Accordion);\n\nexports.default = Accordion;\n\n//# sourceURL=webpack://Bulma/./src/plugins/accordion.js?");
|
180
|
+
|
181
|
+
/***/ }),
|
182
|
+
|
183
|
+
/***/ "./src/plugins/alert.js":
|
184
|
+
/*!******************************!*\
|
185
|
+
!*** ./src/plugins/alert.js ***!
|
186
|
+
\******************************/
|
187
|
+
/*! no static exports found */
|
188
|
+
/***/ (function(module, exports, __webpack_require__) {
|
189
|
+
|
190
|
+
"use strict";
|
191
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _modal = __webpack_require__(/*! ./modal */ \"./src/plugins/modal.js\");\n\nvar _modal2 = _interopRequireDefault(_modal);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Alert\n * @since 0.8.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar Alert = function (_Modal) {\n _inherits(Alert, _Modal);\n\n _createClass(Alert, null, [{\n key: 'parseDocument',\n\n /**\n * Handle parsing the DOM.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n value: function parseDocument() {}\n\n /**\n * Returns an object containing the default config for this plugin.\n * @returns {object} The default config object.\n */\n\n }, {\n key: 'defaultConfig',\n value: function defaultConfig() {\n return {\n type: 'info',\n title: '',\n body: '',\n confirm: 'Okay',\n cancel: null,\n style: 'card',\n parent: document.body,\n showHeader: true\n };\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The config object for this plugin\n * @return {this} The newly created plugin instance\n */\n\n }]);\n\n function Alert(config, root) {\n _classCallCheck(this, Alert);\n\n var _this = _possibleConstructorReturn(this, (Alert.__proto__ || Object.getPrototypeOf(Alert)).call(this, config, root));\n\n _this.root.classList.add('alert');\n\n (0, _core2.default)(_this.root).data('alert', _this);\n\n _this.trigger('init');\n\n _this.open();\n return _this;\n }\n\n /**\n * Create the alerts structure\n * @returns {void}\n */\n\n\n _createClass(Alert, [{\n key: 'createCardStructure',\n value: function createCardStructure() {\n if (this.config.get('showHeader')) {\n /** @param {HTMLElement} */\n this.header = _core2.default.findOrCreateElement('.modal-card-head', this.content, 'header', ['modal-card-head', 'has-background-' + this.config.get('type')]);\n\n /** @param {HTMLElement} */\n var textColor = this.config.get('type') == 'warning' ? 'black' : 'white';\n this.headerTitle = _core2.default.createElement('p', ['modal-card-title', 'has-text-' + textColor]);\n this.headerTitle.innerHTML = this.title;\n this.header.appendChild(this.headerTitle);\n }\n\n /** @param {HTMLElement} */\n this.cardBody = _core2.default.findOrCreateElement('.modal-card-body', this.content, 'section');\n if (!this.cardBody.innerHTML) {\n this.cardBody.innerHTML = this.body;\n }\n\n /** @param {HTMLElement} */\n this.footer = _core2.default.findOrCreateElement('.modal-card-foot', this.content, 'footer');\n }\n\n /**\n * Go through the provided buttons option and create the buttons.\n * @returns {void}\n */\n\n }, {\n key: 'createButtons',\n value: function createButtons() {\n var _this2 = this;\n\n var defaultButtonOptions = { close: true, destroy: true, onClick: function onClick() {} };\n\n var confirmOptions = this.config.get('confirm');\n if (typeof confirmOptions === 'string') {\n confirmOptions = {\n label: confirmOptions,\n classes: []\n };\n }\n confirmOptions = _extends({}, defaultButtonOptions, confirmOptions);\n\n var confirmButton = _core2.default.createElement('button', ['button', 'is-' + this.config.get('type')].concat(confirmOptions.classes));\n confirmButton.innerHTML = confirmOptions.label;\n confirmButton.addEventListener('click', function (e) {\n confirmOptions.onClick(e);\n\n if (confirmOptions.close) {\n _this2.close();\n }\n\n if (confirmOptions.destory) {\n _this2.destroy();\n }\n });\n this.footer.appendChild(confirmButton);\n\n if (this.config.get('cancel')) {\n var cancelOptions = this.config.get('cancel');\n if (typeof cancelOptions === 'string') {\n cancelOptions = {\n label: cancelOptions,\n classes: []\n };\n }\n cancelOptions = _extends({}, defaultButtonOptions, cancelOptions);\n\n var cancelButton = _core2.default.createElement('button', ['button'].concat(cancelOptions.classes));\n cancelButton.innerHTML = cancelOptions.label;\n cancelButton.addEventListener('click', function (e) {\n cancelOptions.onClick(e);\n\n if (cancelOptions.close) {\n _this2.close();\n }\n\n if (cancelOptions.destroy) {\n _this2.destroy();\n }\n });\n this.footer.appendChild(cancelButton);\n }\n }\n }]);\n\n return Alert;\n}(_modal2.default);\n\n_core2.default.registerPlugin('alert', Alert);\n\nexports.default = Alert;\n\n//# sourceURL=webpack://Bulma/./src/plugins/alert.js?");
|
192
|
+
|
193
|
+
/***/ }),
|
194
|
+
|
195
|
+
/***/ "./src/plugins/calendar.js":
|
196
|
+
/*!*********************************!*\
|
197
|
+
!*** ./src/plugins/calendar.js ***!
|
198
|
+
\*********************************/
|
199
|
+
/*! no static exports found */
|
200
|
+
/***/ (function(module, exports, __webpack_require__) {
|
201
|
+
|
202
|
+
"use strict";
|
203
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _plugin = __webpack_require__(/*! ../plugin */ \"./src/plugin.js\");\n\nvar _plugin2 = _interopRequireDefault(_plugin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Calendar\n * @since 0.3.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @deprecated\n */\nvar Calendar = function (_Plugin) {\n _inherits(Calendar, _Plugin);\n\n _createClass(Calendar, null, [{\n key: 'defaultConfig',\n\n /**\n * Returns an object containing the default config for this plugin.\n * @returns {object} The default config object.\n */\n value: function defaultConfig() {\n return {\n date: new Date(),\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n navButtons: true,\n format: 'yyyy-mm-dd',\n overlay: false\n };\n }\n\n /**\n * Handle parsing the DOM.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n\n }, {\n key: 'parseDocument',\n value: function parseDocument() {}\n\n /**\n * Plugin constructor\n * @param {Object} config Plugin instance's config\n * @return {this} The newly created instance\n */\n\n }]);\n\n function Calendar(parent, config) {\n _classCallCheck(this, Calendar);\n\n // eslint-disable-next-line no-console\n var _this = _possibleConstructorReturn(this, (Calendar.__proto__ || Object.getPrototypeOf(Calendar)).call(this, parent, config));\n\n console.warn('[BulmaJS] The calendar plugin has been deprecated and will be removed in the 1.0 release. It is recommended to use the Wikiki\\'s calendar plugin');\n\n /**\n * The root Calendar element.\n * @type {HTMLElement}\n */\n _this.root = _core2.default.createElement('div', ['calendar']);\n\n /**\n * The input element this calendar belongs to.\n * @type {HTMLElement|null}\n */\n _this.isInput = _this.parent.nodeName === 'INPUT';\n\n /**\n * The current date for today tests\n * @type {Date}\n */\n _this.now = new Date();\n\n /**\n * The date this calendar starts at\n * @type {Date}\n */\n _this.date = _this.config.get('date');\n\n /**\n * The current year for the calendar\n * @type {int}\n */\n _this.year = _this.date.getFullYear();\n\n /**\n * The current month for the calendar\n * @type {int}\n */\n _this.month = _this.date.getMonth();\n\n /**\n * Month names\n * @type {Array}\n */\n _this.months = _this.config.get('months');\n\n /**\n * Short day names\n * @type {Array}\n */\n _this.shortDays = _this.config.get('shortDays');\n\n /**\n * Number of days in each month\n * @type {Array}\n */\n _this.monthDays = [31, _this.isLeapYear(_this.year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n /**\n * Show the navigating buttons\n * @type {boolean}\n */\n _this.navButtons = _this.config.get('navButtons');\n\n /**\n * The format string for the date output. Used when attached to an input element.\n * @type {string}\n */\n _this.format = _this.config.get('format');\n\n /**\n * Should the calendar be shown as a modal. Used when attached to an input element\n * @type {boolean}\n */\n _this.overlay = _this.config.get('overlay');\n\n if (_this.overlay) {\n _this.buildModal();\n }\n\n if (_this.isInput) {\n _this.parent.addEventListener('focus', function (event) {\n _this.handleInputFocus(event);\n });\n }\n\n _this.render();\n\n (0, _core2.default)(_this.root).data('calendar', _this);\n\n _this.trigger('init');\n return _this;\n }\n\n ////////////////////////////////////////\n ///// HELPER METHODS TO BUILD HTML /////\n ////////////////////////////////////////\n\n /**\n * If we are to show as an overlay, build the modal's HTML\n * @return {undefined}\n */\n\n\n _createClass(Calendar, [{\n key: 'buildModal',\n value: function buildModal() {\n var _this2 = this;\n\n this.modal = _core2.default.createElement('div', ['modal']);\n this.modalBackground = _core2.default.createElement('div', ['modal-background']);\n\n var modalClose = _core2.default.createElement('button', ['modal-close']);\n\n modalClose.addEventListener('click', function () {\n _this2.modal.classList.remove('is-active');\n });\n\n this.modal.appendChild(this.modalBackground);\n this.modal.appendChild(modalClose);\n\n this.root.appendChild(this.modal);\n\n this.root.style.zIndex = 40;\n }\n\n /**\n * Build the calendars nav HTML\n * @return {undefined}\n */\n\n }, {\n key: 'buildNav',\n value: function buildNav() {\n var _this3 = this;\n\n var prevIcon = void 0,\n nextIcon = void 0;\n var nav = _core2.default.createElement('div', 'calendar-nav');\n var navLeft = _core2.default.createElement('div', 'calendar-nav-left');\n var navRight = _core2.default.createElement('div', 'calendar-nav-right');\n\n // Left side of nav (prev year/month buttons)\n if (this.navButtons) {\n this.prevYearButton = _core2.default.createElement('button', ['button', 'is-text']);\n prevIcon = _core2.default.createElement('i', ['fa', 'fa-backward']);\n this.prevYearButton.appendChild(prevIcon);\n\n this.prevYearButton.addEventListener('click', function (event) {\n _this3.handlePrevYearClick(event);\n });\n\n navLeft.appendChild(this.prevYearButton);\n\n this.prevMonthButton = _core2.default.createElement('button', ['button', 'is-text']);\n prevIcon = _core2.default.createElement('i', ['fa', 'fa-chevron-left']);\n this.prevMonthButton.appendChild(prevIcon);\n\n this.prevMonthButton.addEventListener('click', function (event) {\n _this3.handlePrevMonthClick(event);\n });\n\n navLeft.appendChild(this.prevMonthButton);\n\n // Right side of nav (next year/month buttons)\n this.nextMonthButton = _core2.default.createElement('button', ['button', 'is-text']);\n nextIcon = _core2.default.createElement('i', ['fa', 'fa-chevron-right']);\n this.nextMonthButton.appendChild(nextIcon);\n\n this.nextMonthButton.addEventListener('click', function (event) {\n _this3.handleNextMonthClick(event);\n });\n\n navRight.appendChild(this.nextMonthButton);\n\n this.nextYearButton = _core2.default.createElement('button', ['button', 'is-text']);\n prevIcon = _core2.default.createElement('i', ['fa', 'fa-forward']);\n this.nextYearButton.appendChild(prevIcon);\n\n this.nextYearButton.addEventListener('click', function (event) {\n _this3.handleNextYearClick(event);\n });\n\n navRight.appendChild(this.nextYearButton);\n }\n\n // Month/year label\n this.monthYearLabel = _core2.default.createElement('div');\n this.monthYearLabel.innerHTML = this.months[this.month] + ' ' + this.year;\n\n nav.appendChild(navLeft);\n nav.appendChild(this.monthYearLabel);\n nav.appendChild(navRight);\n\n return nav;\n }\n\n /**\n * Build the calendar's container HTML\n * @return {HTMLElement} The calendar's container\n */\n\n }, {\n key: 'buildContainer',\n value: function buildContainer() {\n return _core2.default.createElement('div', 'calendar-container');\n }\n\n /**\n * Build the calendar's header HTML\n * @return {HTMLElement} The calendar's header element\n */\n\n }, {\n key: 'buildHeader',\n value: function buildHeader() {\n var calendarHeader = _core2.default.createElement('div', 'calendar-header');\n\n _core2.default.each(this.shortDays, function (dayName) {\n var day = _core2.default.createElement('div', 'calendar-date');\n day.innerHTML = dayName;\n calendarHeader.appendChild(day);\n });\n\n return calendarHeader;\n }\n\n /**\n * Build the calendar's body. This includes all days.\n * @return {HTMLElement} The calendar's body element\n */\n\n }, {\n key: 'buildBody',\n value: function buildBody() {\n var _this4 = this;\n\n var calendarBody = _core2.default.createElement('div', 'calendar-body');\n\n var daysInMonth = this.monthDays[this.now.getMonth()];\n\n // Number of days to show from the previous month.\n var daysBefore = new Date(this.year, this.month, 1).getDay();\n\n // Number of days to show from the next month\n var daysAfter = void 0;\n\n var numDays = daysInMonth + daysBefore;\n\n daysAfter = numDays;\n while (daysAfter > 7) {\n daysAfter -= 7;\n }\n\n numDays += 7 - daysAfter;\n\n var cells = [];\n\n for (var i = 0; i < numDays; i++) {\n var d = new Date(this.year, this.month, 1 + (i - daysBefore));\n\n var today = false;\n var thisMonth = false;\n\n if (d.getFullYear() === this.now.getFullYear() && d.getMonth() === this.now.getMonth() && d.getDate() === this.now.getDate()) {\n today = true;\n }\n\n if (d.getMonth() === this.month) {\n thisMonth = true;\n }\n\n cells.push({\n day: d.getDate(),\n isToday: today,\n isThisMonth: thisMonth\n });\n }\n\n _core2.default.each(cells, function (day) {\n var d = _core2.default.createElement('div', 'calendar-date');\n\n if (!day.isThisMonth) {\n d.classList.add('is-disabled');\n }\n\n var button = _core2.default.createElement('button', 'date-item');\n\n if (_this4.isInput && day.isThisMonth) {\n button.addEventListener('click', function (event) {\n _this4.handleDayClick(event, day);\n });\n }\n\n if (day.isToday) {\n button.classList.add('is-today');\n }\n\n button.innerHTML = day.day;\n\n d.appendChild(button);\n\n calendarBody.appendChild(d);\n });\n\n return calendarBody;\n }\n\n //////////////////////////\n ///// EVENT HANDLERS /////\n //////////////////////////\n\n /**\n * Called when the input box is in focus.\n * @return {undefined}\n */\n\n }, {\n key: 'handleInputFocus',\n value: function handleInputFocus() {\n if (this.overlay) {\n this.modal.classList.add('is-active');\n }\n\n this.parent.parentNode.insertBefore(this.root, this.parent.nextSibling);\n }\n\n /**\n * Event hander for when a day is clicked.\n * @param {Object} event The event object\n * @param {Object} day The day that was clicked\n * @return {undefined}\n */\n\n }, {\n key: 'handleDayClick',\n value: function handleDayClick(event, day) {\n day = new Date(this.year, this.month, day.day);\n\n var dateString = this.formatDateString(day);\n\n this.parent.value = dateString;\n\n if (this.overlay) {\n this.modal.classList.remove('is-active');\n } else {\n this.parent.parentNode.removeChild(this.root);\n }\n }\n\n /**\n * Event handler for the previous month button.\n * @return {undefined}\n */\n\n }, {\n key: 'handlePrevMonthClick',\n value: function handlePrevMonthClick() {\n this.month--;\n\n if (this.month < 0) {\n this.year--;\n this.month = 11;\n }\n\n this.render();\n }\n\n /**\n * Event handler for the next month button.\n * @return {undefined}\n */\n\n }, {\n key: 'handleNextMonthClick',\n value: function handleNextMonthClick() {\n this.month++;\n\n if (this.month > 11) {\n this.year++;\n this.month = 0;\n }\n\n this.render();\n }\n\n /**\n * Event handler for the previous year button.\n * @return {undefined}\n */\n\n }, {\n key: 'handlePrevYearClick',\n value: function handlePrevYearClick() {\n this.year--;\n\n this.render();\n }\n\n /**\n * Event handler for the next year button.\n * @return {undefined}\n */\n\n }, {\n key: 'handleNextYearClick',\n value: function handleNextYearClick() {\n this.year++;\n\n this.render();\n }\n\n /**\n * Format the date based on the supplied format string.\n * @param {Object} day Date object representing the day to format\n * @returns {string} The formatted date string\n */\n\n }, {\n key: 'formatDateString',\n value: function formatDateString(day) {\n var dateString = this.format;\n\n // May be a better/faster way of doing this?\n if (dateString.indexOf('yyyy') !== -1) {\n dateString = this.format.replace('yyyy', day.getFullYear());\n } else {\n dateString = this.format.replace('yy', day.getFullYear().toString().substr(-2));\n }\n\n if (dateString.indexOf('mm') !== -1) {\n var month = day.getMonth() + 1;\n if (month < 10) {\n month = '0' + month.toString();\n }\n dateString = dateString.replace('mm', month);\n } else {\n dateString = dateString.replace('m', day.getMonth() + 1);\n }\n\n if (dateString.indexOf('dd') !== -1) {\n var date = day.getDate();\n if (date < 10) {\n date = '0' + date.toString();\n }\n dateString = dateString.replace('dd', date);\n } else {\n dateString = dateString.replace('d', day.getDate());\n }\n\n return dateString;\n }\n\n /**\n * Clear the calendar HTML, ready for a re-render.\n * @return {undefined}\n */\n\n }, {\n key: 'clearCalendar',\n value: function clearCalendar() {\n while (this.root.firstChild) {\n this.root.removeChild(this.root.firstChild);\n }\n }\n\n /**\n * Check if the passed year is a leap year.\n * @param {int} year The year to check against\n * @return {boolean} Is the year a leap year or not\n */\n\n }, {\n key: 'isLeapYear',\n value: function isLeapYear(year) {\n // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n }\n\n /**\n * Render/build the calendar's HTML.\n * @return {undefined}\n */\n\n }, {\n key: 'render',\n value: function render() {\n this.clearCalendar();\n\n this.root.appendChild(this.buildNav());\n\n var container = this.buildContainer();\n container.appendChild(this.buildHeader());\n container.appendChild(this.buildBody());\n\n this.root.appendChild(container);\n\n if (this.overlay) {\n this.modal.insertBefore(this.root, this.modalBackground.nextSibling);\n this.parent.appendChild(this.modal);\n } else {\n this.parent.appendChild(this.root);\n }\n }\n }]);\n\n return Calendar;\n}(_plugin2.default);\n\n_core2.default.registerPlugin('calendar', Calendar);\n\nexports.default = Calendar;\n\n//# sourceURL=webpack://Bulma/./src/plugins/calendar.js?");
|
204
|
+
|
205
|
+
/***/ }),
|
206
|
+
|
207
|
+
/***/ "./src/plugins/dropdown.js":
|
208
|
+
/*!*********************************!*\
|
209
|
+
!*** ./src/plugins/dropdown.js ***!
|
210
|
+
\*********************************/
|
211
|
+
/*! no static exports found */
|
212
|
+
/***/ (function(module, exports, __webpack_require__) {
|
213
|
+
|
214
|
+
"use strict";
|
215
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _plugin = __webpack_require__(/*! ../plugin */ \"./src/plugin.js\");\n\nvar _plugin2 = _interopRequireDefault(_plugin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Dropdown\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar Dropdown = function (_Plugin) {\n _inherits(Dropdown, _Plugin);\n\n _createClass(Dropdown, null, [{\n key: 'parseDocument',\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 value: function parseDocument(context) {\n var elements = context.querySelectorAll('.dropdown');\n\n _core2.default.each(elements, function (element) {\n (0, _core2.default)(element).data('dropdown', new Dropdown({\n root: element\n }));\n });\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The config object for this plugin\n * @return {this} The newly created instance\n */\n\n }]);\n\n function Dropdown(config, root) {\n _classCallCheck(this, Dropdown);\n\n /**\n * The root dropdown element.\n * @type {HTMLElement}\n */\n var _this = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, config, root));\n\n _this.root = _this.config.get('root');\n _this.root.setAttribute('data-bulma-attached', 'attached');\n\n /**\n * The element to trigger when clicked.\n * @type {HTMLElement}\n */\n _this.triggerElement = _this.root.querySelector('.dropdown-trigger');\n\n _this.registerEvents();\n\n (0, _core2.default)(_this.root).data('dropdown', _this);\n\n _this.trigger('init');\n return _this;\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n\n\n _createClass(Dropdown, [{\n key: 'registerEvents',\n value: function registerEvents() {\n this.triggerElement.addEventListener('click', this.handleTriggerClick.bind(this));\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n\n }, {\n key: 'handleTriggerClick',\n value: function handleTriggerClick() {\n if (this.root.classList.contains('is-active')) {\n this.root.classList.remove('is-active');\n\n this.trigger('close');\n } else {\n this.root.classList.add('is-active');\n\n this.trigger('open');\n }\n }\n }]);\n\n return Dropdown;\n}(_plugin2.default);\n\n_core2.default.registerPlugin('dropdown', Dropdown);\n\nexports.default = Dropdown;\n\n//# sourceURL=webpack://Bulma/./src/plugins/dropdown.js?");
|
216
|
+
|
217
|
+
/***/ }),
|
218
|
+
|
219
|
+
/***/ "./src/plugins/file.js":
|
220
|
+
/*!*****************************!*\
|
221
|
+
!*** ./src/plugins/file.js ***!
|
222
|
+
\*****************************/
|
223
|
+
/*! no static exports found */
|
224
|
+
/***/ (function(module, exports, __webpack_require__) {
|
225
|
+
|
226
|
+
"use strict";
|
227
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _plugin = __webpack_require__(/*! ../plugin */ \"./src/plugin.js\");\n\nvar _plugin2 = _interopRequireDefault(_plugin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module File\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar File = function (_Plugin) {\n _inherits(File, _Plugin);\n\n _createClass(File, null, [{\n key: 'parseDocument',\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 value: function parseDocument(context) {\n var elements = context.querySelectorAll('.file');\n\n _core2.default.each(elements, function (element) {\n (0, _core2.default)(element).data('file', new File({\n element: element\n }));\n });\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The config object for this plugin\n * @return {this} The newly created plugin instance\n */\n\n }]);\n\n function File(config) {\n _classCallCheck(this, File);\n\n // Work out the parent if it hasn't been supplied as an option.\n var _this = _possibleConstructorReturn(this, (File.__proto__ || Object.getPrototypeOf(File)).call(this, config));\n\n if (_this.parent === null) {\n _this.parent = _this.config.get('element').parentNode;\n }\n\n /**\n * The root file element.\n * @type {HTMLElement}\n */\n _this.root = _this.config.get('element');\n _this.root.setAttribute('data-bulma-attached', 'attached');\n\n /**\n * The element to use as the trigger.\n * @type {HTMLELement}\n */\n _this.input = _this.root.querySelector('input');\n\n /**\n * The element to show the file name.\n * @type {HTMLElement}\n */\n _this.filename = _this.root.querySelector('.file-name');\n\n _this.registerEvents();\n\n (0, _core2.default)(_this.root).data('file', _this);\n\n _this.trigger('init');\n return _this;\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n\n\n _createClass(File, [{\n key: 'registerEvents',\n value: function registerEvents() {\n var _this2 = this;\n\n if (this.filename) {\n this.input.addEventListener('change', this.handleTriggerChange.bind(this));\n }\n\n this.root.addEventListener('dragover', function (e) {\n e.preventDefault();\n _this2.addHoverClass();\n });\n\n this.root.addEventListener('dragleave', function (e) {\n e.preventDefault();\n _this2.addHoverClass();\n });\n\n this.root.addEventListener('drop', function (e) {\n e.preventDefault();\n _this2.removeHoverClass();\n _this2.input.files = e.dataTransfer.files;\n });\n }\n\n /**\n * Handle the click event on the trigger.\n * @param {Object} event The event object\n * @return {undefined}\n */\n\n }, {\n key: 'handleTriggerChange',\n value: function 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 this.trigger('changed', event);\n }\n\n /**\n * Clear the file name element.\n * @return {undefined}\n */\n\n }, {\n key: 'clearFileName',\n value: function clearFileName() {\n this.filename.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\n }, {\n key: 'setFileName',\n value: function setFileName(value) {\n this.filename.innerHTML = value;\n }\n\n /**\n * Add hover class to root element.\n * @return {undefined}\n */\n\n }, {\n key: 'addHoverClass',\n value: function addHoverClass() {\n this.root.classList.add('is-hovered');\n }\n\n /**\n * Remove hover class from root element.\n * @return {undefined}\n */\n\n }, {\n key: 'removeHoverClass',\n value: function removeHoverClass() {\n this.root.classList.remove('is-hovered');\n }\n }]);\n\n return File;\n}(_plugin2.default);\n\n_core2.default.registerPlugin('file', File);\n\nexports.default = File;\n\n//# sourceURL=webpack://Bulma/./src/plugins/file.js?");
|
228
|
+
|
229
|
+
/***/ }),
|
230
|
+
|
231
|
+
/***/ "./src/plugins/message.js":
|
232
|
+
/*!********************************!*\
|
233
|
+
!*** ./src/plugins/message.js ***!
|
234
|
+
\********************************/
|
235
|
+
/*! no static exports found */
|
236
|
+
/***/ (function(module, exports, __webpack_require__) {
|
237
|
+
|
238
|
+
"use strict";
|
239
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _dismissableComponent = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\nvar _dismissableComponent2 = _interopRequireDefault(_dismissableComponent);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Message\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nvar Message = function (_DismissableComponent) {\n _inherits(Message, _DismissableComponent);\n\n _createClass(Message, null, [{\n key: 'create',\n\n /**\n * Helper method used by the Bulma core to create a new instance.\n * @param {Object} config The config object for this instance\n * @return {Message} The newly created message instance\n */\n value: function create(element, config) {\n return (0, _core2.default)(element).data('message', new Message(config)).data('message');\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\n }, {\n key: 'parseDocument',\n value: function parseDocument(context) {\n var elements = context.querySelectorAll('.message');\n\n _core2.default.each(elements, function (element) {\n var closeBtn = element.querySelector('.delete');\n\n (0, _core2.default)(element).data('message', new Message({\n body: null,\n parent: element.parentNode,\n root: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true,\n dismissInterval: element.hasAttribute('data-dismiss-interval') ? element.getAttribute('data-dismiss-interval') : null\n }));\n });\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The config object for this plugin\n * @return {this} The newly created instance\n */\n\n }]);\n\n function Message(config) {\n _classCallCheck(this, Message);\n\n /**\n * The size of the message\n * @type {String} Possible values are small, normal, medium or large\n */\n var _this = _possibleConstructorReturn(this, (Message.__proto__ || Object.getPrototypeOf(Message)).call(this, 'message', config));\n\n _this.size = _this.config.get('size');\n\n /**\n * The title of the message\n * @type {String}\n */\n _this.title = _this.config.get('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 (!_this.config.get('closeButton')) {\n _this.prependCloseButton();\n }\n\n _this.setupCloseEvent();\n }\n\n if (_this.size) {\n _this.setSize();\n }\n\n (0, _core2.default)(_this.root).data('message', _this);\n\n _this.trigger('init');\n return _this;\n }\n\n /**\n * Create the message header\n * @return {undefined}\n */\n\n\n _createClass(Message, [{\n key: 'createMessageHeader',\n value: function createMessageHeader() {\n var 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\n }, {\n key: 'setSize',\n value: function 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\n }, {\n key: 'insertBody',\n value: function insertBody() {\n var 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 * Insert the close button before our content.\n * @return {undefined}\n */\n\n }, {\n key: 'prependCloseButton',\n value: function prependCloseButton() {\n this.title.appendChild(this.closeButton);\n }\n }]);\n\n return Message;\n}(_dismissableComponent2.default);\n\n_core2.default.registerPlugin('message', Message);\n\nexports.default = Message;\n\n//# sourceURL=webpack://Bulma/./src/plugins/message.js?");
|
240
|
+
|
241
|
+
/***/ }),
|
242
|
+
|
243
|
+
/***/ "./src/plugins/modal.js":
|
244
|
+
/*!******************************!*\
|
245
|
+
!*** ./src/plugins/modal.js ***!
|
246
|
+
\******************************/
|
247
|
+
/*! no static exports found */
|
248
|
+
/***/ (function(module, exports, __webpack_require__) {
|
249
|
+
|
250
|
+
"use strict";
|
251
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _plugin = __webpack_require__(/*! ../plugin */ \"./src/plugin.js\");\n\nvar _plugin2 = _interopRequireDefault(_plugin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Modal\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar Modal = function (_Plugin) {\n _inherits(Modal, _Plugin);\n\n _createClass(Modal, null, [{\n key: 'parseDocument',\n\n /**\n * Handle parsing the DOM.\n * @param {HTMLElement} element The root element for this accordion\n * @return {undefined}\n */\n value: function parseDocument() {}\n\n /**\n * Returns an object containing the default config for this plugin.\n * @returns {object} The default config object.\n */\n\n }, {\n key: 'defaultConfig',\n value: function defaultConfig() {\n return {\n style: 'card',\n closable: true\n };\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The config object for this plugin\n * @return {this} The newly created plugin instance\n */\n\n }]);\n\n function Modal(config, root) {\n _classCallCheck(this, Modal);\n\n /** @param {string} */\n var _this = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, config, root));\n\n _this.style = _this.config.get('style');\n\n /** @param {HTMLElement} */\n _this.root = _this.config.get('root');\n\n if (!_this.root) {\n _this.root = _core2.default.createElement('div', 'modal');\n }\n\n if (!_this.parent) {\n if (!_this.root.parentNode) {\n _this.parent = document.body;\n\n _this.parent.appendChild(_this.root);\n } else {\n _this.parent = _this.root.parentNode;\n }\n } else {\n _this.parent.appendChild(_this.root);\n }\n\n /** @param {HTMLElement} */\n _this.background = _core2.default.findOrCreateElement('.modal-background', _this.root);\n\n /** @param {HTMLElement} */\n _this.content = _this.style === 'card' ? _core2.default.findOrCreateElement('.modal-card', _this.root) : _core2.default.findOrCreateElement('.modal-content', _this.root);\n\n /** @param {boolean} */\n _this.closable = _this.config.get('closable');\n\n /** @param {string|null} */\n _this.body = _this.config.get('body');\n\n /** @param {string|null} */\n _this.title = _this.config.get('title');\n\n if (_this.config.get('bodyUrl')) {\n _core2.default.ajax(_this.config.get('bodyUrl')).then(function (response) {\n _this.body = response;\n _this.buildModal();\n });\n } else {\n _this.buildModal();\n }\n\n (0, _core2.default)(_this.root).data('modal', _this);\n\n _this.trigger('init');\n return _this;\n }\n\n // Build the modal's HTML\n\n\n _createClass(Modal, [{\n key: 'buildModal',\n value: function buildModal() {\n if (this.style === 'card') {\n this.createCardStructure();\n } else {\n if (!this.content.innerHTML) {\n this.content.innerHTML = this.body;\n }\n }\n\n if (this.closable) {\n /** @param {HTMLElement} */\n this.closeButton = this.style === 'card' ? _core2.default.findOrCreateElement('.delete', this.header, 'button') : _core2.default.findOrCreateElement('.modal-close', this.root, 'button');\n }\n\n if (this.style === 'card') {\n this.createButtons();\n }\n\n this.setupEvents();\n }\n\n /**\n * Create the card style structure\n * @returns {void}\n */\n\n }, {\n key: 'createCardStructure',\n value: function createCardStructure() {\n /** @param {HTMLElement} */\n this.header = _core2.default.findOrCreateElement('.modal-card-head', this.content, 'header');\n\n /** @param {HTMLElement} */\n this.headerTitle = _core2.default.findOrCreateElement('.modal-card-title', this.header, 'p');\n if (!this.headerTitle.innerHTML) {\n this.headerTitle.innerHTML = this.title;\n }\n\n /** @param {HTMLElement} */\n this.cardBody = _core2.default.findOrCreateElement('.modal-card-body', this.content, 'section');\n if (!this.cardBody.innerHTML) {\n this.cardBody.innerHTML = this.body;\n }\n\n /** @param {HTMLElement} */\n this.footer = _core2.default.findOrCreateElement('.modal-card-foot', this.content, 'footer');\n }\n\n /**\n * Setup the events used by this modal.\n * @returns {void}\n */\n\n }, {\n key: 'setupEvents',\n value: function setupEvents() {\n var _this2 = this;\n\n if (this.closable) {\n this.closeButton.addEventListener('click', this.close.bind(this));\n\n document.addEventListener('keyup', function (event) {\n if (!_this2.root.classList.contains('is-active')) {\n return;\n }\n\n var key = event.key || event.keyCode;\n\n if (key === 'Escape' || key === 'Esc' || key === 27) {\n _this2.close();\n }\n });\n\n this.background.addEventListener('click', this.close.bind(this));\n }\n }\n\n /**\n * Go through the provided buttons option and create the buttons.\n * @returns {void}\n */\n\n }, {\n key: 'createButtons',\n value: function createButtons() {\n var buttonsConfig = this.config.get('buttons', []);\n var modal = this;\n\n _core2.default.each(buttonsConfig, function (buttonConfig) {\n var button = _core2.default.createElement('button', buttonConfig.classes);\n button.innerHTML = buttonConfig.label;\n\n button.addEventListener('click', function (event) {\n buttonConfig.onClick(event);\n });\n\n modal.footer.appendChild(button);\n });\n }\n\n /**\n * Open the modal\n * @returns {void}\n */\n\n }, {\n key: 'open',\n value: function open() {\n this.root.classList.add('is-active');\n document.documentElement.classList.add('is-clipped');\n\n this.trigger('open');\n }\n\n /**\n * Close the modal\n * @returns {void} \n */\n\n }, {\n key: 'close',\n value: function close() {\n this.root.classList.remove('is-active');\n document.documentElement.classList.remove('is-clipped');\n\n this.trigger('close');\n }\n\n /**\n * Destroy this modal, unregistering element references and removing the modal.\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _get(Modal.prototype.__proto__ || Object.getPrototypeOf(Modal.prototype), 'destroy', this).call(this);\n\n this.root.remove();\n\n this.parent = null;\n this.root = null;\n this.background = null;\n this.content = null;\n\n if (this.style === 'card') {\n this.header = null;\n this.headerTitle = null;\n this.cardBody = null;\n this.footer = null;\n }\n\n if (this.closable) {\n this.closeButton = null;\n }\n\n this.config.gets = [];\n\n this.trigger('destroyed');\n }\n }]);\n\n return Modal;\n}(_plugin2.default);\n\n_core2.default.registerPlugin('modal', Modal);\n\nexports.default = Modal;\n\n//# sourceURL=webpack://Bulma/./src/plugins/modal.js?");
|
252
|
+
|
253
|
+
/***/ }),
|
254
|
+
|
255
|
+
/***/ "./src/plugins/navbar.js":
|
256
|
+
/*!*******************************!*\
|
257
|
+
!*** ./src/plugins/navbar.js ***!
|
258
|
+
\*******************************/
|
259
|
+
/*! no static exports found */
|
260
|
+
/***/ (function(module, exports, __webpack_require__) {
|
261
|
+
|
262
|
+
"use strict";
|
263
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _plugin = __webpack_require__(/*! ../plugin */ \"./src/plugin.js\");\n\nvar _plugin2 = _interopRequireDefault(_plugin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Navbar\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar Navbar = function (_Plugin) {\n _inherits(Navbar, _Plugin);\n\n _createClass(Navbar, null, [{\n key: 'parseDocument',\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 value: function parseDocument(context) {\n var elements = context.querySelectorAll('.navbar');\n\n _core2.default.each(elements, function (element) {\n\n (0, _core2.default)(element).data('navbar', new Navbar({\n root: element,\n sticky: element.hasAttribute('data-sticky') ? true : false,\n stickyOffset: element.hasAttribute('data-sticky-offset') ? element.getAttribute('data-sticky-offset') : 0,\n hideOnScroll: element.hasAttribute('data-hide-on-scroll') ? true : false,\n tolerance: element.hasAttribute('data-tolerance') ? element.getAttribute('data-tolerance') : 0,\n shadow: element.hasAttribute('data-sticky-shadow') ? true : false\n })).data('navbar');\n });\n }\n\n /**\n * Returns an object containing the default config for this plugin.\n * @returns {object} The default config object.\n */\n\n }, {\n key: 'defaultconfig',\n value: function defaultconfig() {\n return {\n sticky: false,\n stickyOffset: 0,\n hideOnScroll: false,\n tolerance: 0,\n shadow: false\n };\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The config object for this plugin\n * @return {this} The newly created plugin instance\n */\n\n }]);\n\n function Navbar(config) {\n _classCallCheck(this, Navbar);\n\n // Work out the parent if it hasn't been supplied as an option.\n var _this = _possibleConstructorReturn(this, (Navbar.__proto__ || Object.getPrototypeOf(Navbar)).call(this, config));\n\n if (_this.parent === null) {\n _this.parent = _this.config.get('root').parentNode;\n }\n\n /**\n * The root navbar element.\n * @type {HTMLElement}\n */\n _this.root = _this.config.get('root');\n\n /**\n * The element used for the trigger.\n * @type {HTMLElement}\n */\n _this.triggerElement = _this.root.querySelector('.navbar-burger'),\n\n /**\n * The target element.\n * @type {HTMLELement}\n */\n _this.target = _this.root.querySelector('.navbar-menu');\n\n /**\n * Should this navbar stick to the top of the page?\n * @type {boolean}\n */\n _this.sticky = _this.config.get('sticky');\n\n /**\n * The offset in pixels before the navbar will stick to the top of the page\n * @type {number}\n */\n _this.stickyOffset = parseInt(_this.config.get('stickyOffset'));\n\n /**\n * Should the navbar hide when scrolling? Note: this just applies a 'is-hidden-scroll' class.\n * @type {boolean}\n */\n _this.hideOnScroll = _this.config.get('hideOnScroll');\n\n /**\n * The amount of tolerance required before checking the navbar should hide/show\n * @type {number}\n */\n _this.tolerance = _this.config.get('tolerance');\n\n /**\n * Add a shadow when the navbar is sticky?\n * @type {boolean}\n */\n _this.shadow = _this.config.get('shadow');\n\n /**\n * The last scroll Y known, this is used to calculate scroll direction\n * @type {number}\n */\n _this.lastScrollY = 0;\n\n (0, _core2.default)(_this.root).data('navbar', _this);\n\n _this.registerEvents();\n return _this;\n }\n\n /**\n * Register all the events this module needs.\n * @return {undefined}\n */\n\n\n _createClass(Navbar, [{\n key: 'registerEvents',\n value: function registerEvents() {\n this.triggerElement.addEventListener('click', this.handleTriggerClick.bind(this));\n\n if (this.sticky) {\n window.addEventListener('scroll', this.handleScroll.bind(this));\n }\n }\n\n /**\n * Handle the click event on the trigger.\n * @return {undefined}\n */\n\n }, {\n key: 'handleTriggerClick',\n value: function handleTriggerClick() {\n if (this.target.classList.contains('is-active')) {\n this.target.classList.remove('is-active');\n this.triggerElement.classList.remove('is-active');\n } else {\n this.target.classList.add('is-active');\n this.triggerElement.classList.add('is-active');\n }\n }\n\n /**\n * Handle the scroll event\n * @return {undefined}\n */\n\n }, {\n key: 'handleScroll',\n value: function handleScroll() {\n this.toggleSticky(window.pageYOffset);\n }\n\n /**\n * Toggle the navbar's sticky state\n * @param {number} scrollY The amount of pixels that has been scrolled\n * @return {undefined}\n */\n\n }, {\n key: 'toggleSticky',\n value: function toggleSticky(scrollY) {\n if (scrollY > this.stickyOffset) {\n this.root.classList.add('is-fixed-top');\n document.body.classList.add('has-navbar-fixed-top');\n\n if (this.shadow) {\n this.root.classList.add('has-shadow');\n }\n } else {\n this.root.classList.remove('is-fixed-top');\n document.body.classList.remove('has-navbar-fixed-top');\n\n if (this.shadow) {\n this.root.classList.remove('has-shadow');\n }\n }\n\n if (this.hideOnScroll) {\n var scrollDirection = this.calculateScrollDirection(scrollY, this.lastScrollY);\n var triggeredTolerance = this.difference(scrollY, this.lastScrollY) >= this.tolerance;\n\n if (triggeredTolerance) {\n if (scrollDirection === 'down') {\n this.root.classList.add('is-hidden-scroll');\n } else {\n this.root.classList.remove('is-hidden-scroll');\n }\n }\n\n this.lastScrollY = scrollY;\n }\n }\n }, {\n key: 'difference',\n value: function difference(a, b) {\n if (a > b) {\n return a - b;\n } else {\n return b - a;\n }\n }\n }, {\n key: 'calculateScrollDirection',\n value: function calculateScrollDirection(currentY, lastY) {\n return currentY >= lastY ? 'down' : 'up';\n }\n }]);\n\n return Navbar;\n}(_plugin2.default);\n\n_core2.default.registerPlugin('navbar', Navbar);\n\nexports.default = Navbar;\n\n//# sourceURL=webpack://Bulma/./src/plugins/navbar.js?");
|
264
|
+
|
265
|
+
/***/ }),
|
266
|
+
|
267
|
+
/***/ "./src/plugins/notification.js":
|
268
|
+
/*!*************************************!*\
|
269
|
+
!*** ./src/plugins/notification.js ***!
|
270
|
+
\*************************************/
|
271
|
+
/*! no static exports found */
|
272
|
+
/***/ (function(module, exports, __webpack_require__) {
|
273
|
+
|
274
|
+
"use strict";
|
275
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _dismissableComponent = __webpack_require__(/*! ../dismissableComponent */ \"./src/dismissableComponent.js\");\n\nvar _dismissableComponent2 = _interopRequireDefault(_dismissableComponent);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Notification\n * @since 0.1.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n * @extends DismissableComponent\n */\nvar Notification = function (_DismissableComponent) {\n _inherits(Notification, _DismissableComponent);\n\n _createClass(Notification, null, [{\n key: 'parseDocument',\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 value: function parseDocument(context) {\n var elements = context.querySelectorAll('.notification');\n\n _core2.default.each(elements, function (element) {\n var bulmaElement = (0, _core2.default)(element);\n\n if (bulmaElement.data('notification')) {\n return;\n }\n\n var closeBtn = element.querySelector('.delete');\n\n bulmaElement.data('notification', new Notification({\n body: null,\n parent: element.parentNode,\n root: element,\n closeButton: closeBtn,\n isDismissable: !!closeBtn,\n destroyOnDismiss: true,\n dismissInterval: element.hasAttribute('data-dismiss-interval') ? element.getAttribute('data-dismiss-interval') : null\n }));\n });\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The config object for this plugin\n * @return {this} The newly created instance\n */\n\n }]);\n\n function Notification(config) {\n _classCallCheck(this, Notification);\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 var _this = _possibleConstructorReturn(this, (Notification.__proto__ || Object.getPrototypeOf(Notification)).call(this, 'notification', config));\n\n if (_this.isDismissable) {\n if (!_this.config.has('closeButton')) {\n _this.prependCloseButton();\n }\n\n _this.setupCloseEvent();\n }\n\n (0, _core2.default)(_this.root).data('notification', _this);\n\n _this.trigger('init');\n return _this;\n }\n\n return Notification;\n}(_dismissableComponent2.default);\n\n_core2.default.registerPlugin('notification', Notification);\n\nexports.default = Notification;\n\n//# sourceURL=webpack://Bulma/./src/plugins/notification.js?");
|
276
|
+
|
277
|
+
/***/ }),
|
278
|
+
|
279
|
+
/***/ "./src/plugins/tabs.js":
|
280
|
+
/*!*****************************!*\
|
281
|
+
!*** ./src/plugins/tabs.js ***!
|
282
|
+
\*****************************/
|
283
|
+
/*! no static exports found */
|
284
|
+
/***/ (function(module, exports, __webpack_require__) {
|
285
|
+
|
286
|
+
"use strict";
|
287
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(/*! ../core */ \"./src/core.js\");\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _plugin = __webpack_require__(/*! ../plugin */ \"./src/plugin.js\");\n\nvar _plugin2 = _interopRequireDefault(_plugin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @module Tabs\n * @since 0.4.0\n * @author Thomas Erbe <vizuaalog@gmail.com>\n */\nvar Tabs = function (_Plugin) {\n _inherits(Tabs, _Plugin);\n\n _createClass(Tabs, null, [{\n key: 'parseDocument',\n\n /**\n * Handle parsing the DOMs data attribute API.\n * @param {HTMLElement} element The root element for this instance\n * @returns {undefined}\n */\n value: function parseDocument(context) {\n var elements = context.querySelectorAll('.tabs-wrapper');\n\n _core2.default.each(elements, function (element) {\n (0, _core2.default)(element).data('tabs', new Tabs({\n root: element,\n hover: element.hasAttribute('data-hover') ? true : false\n }));\n });\n }\n\n /**\n * Returns an object containing the default config for this plugin.\n * @returns {object} The default config object.\n */\n\n }, {\n key: 'defaultConfig',\n value: function defaultConfig() {\n return {\n hover: false\n };\n }\n\n /**\n * Plugin constructor\n * @param {Object} config The config object for this plugin\n * @return {this} The newly created instance\n */\n\n }]);\n\n function Tabs(config) {\n _classCallCheck(this, Tabs);\n\n /**\n * The root tab element\n * @param {HTMLElement}\n */\n var _this = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, config));\n\n _this.root = _this.config.get('element');\n _this.root.setAttribute('data-bulma-attached', 'attached');\n\n /**\n * Whether the tabs should be changed when the nav item is hovered over\n * @param {boolean}\n */\n _this.hover = _this.config.get('hover');\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 (0, _core2.default)(_this.root).data('tabs', _this);\n\n _this.trigger('init');\n return _this;\n }\n\n /**\n * Find the tab navigation container.\n * @returns {HTMLElement} The navigation container\n */\n\n\n _createClass(Tabs, [{\n key: 'findNav',\n value: function 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\n }, {\n key: 'findNavItems',\n value: function findNavItems() {\n return this.nav.querySelectorAll('li');\n }\n\n /**\n * Find the tab content container.\n * @returns {HTMLElement} The content container\n */\n\n }, {\n key: 'findContent',\n value: function 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\n }, {\n key: 'findContentItems',\n value: function findContentItems() {\n // We have to use the root here as the querySelectorAll API doesn't\n // support using '>' as the first character. So we have to have a\n // class to start with.\n return this.root.querySelectorAll('.tabs-content > ul > li');\n }\n\n /**\n * Setup the events to handle tab changing\n * @returns {void}\n */\n\n }, {\n key: 'setupNavEvents',\n value: function setupNavEvents() {\n var _this2 = this;\n\n _core2.default.each(this.navItems, function (navItem, index) {\n navItem.addEventListener('click', function () {\n _this2.handleNavClick(navItem, index);\n });\n\n if (_this2.hover) {\n navItem.addEventListener('mouseover', function () {\n _this2.handleNavClick(navItem, index);\n });\n }\n });\n }\n\n /**\n * Handle the changing of the visible tab\n * @param {HTMLelement} navItem The nav item we are changing to\n * @param {number} index The internal index of the nav item we're changing to\n * @returns {void}\n */\n\n }, {\n key: 'handleNavClick',\n value: function handleNavClick(navItem, index) {\n _core2.default.each(this.navItems, function (navItem) {\n navItem.classList.remove('is-active');\n });\n\n _core2.default.each(this.contentItems, function (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 return Tabs;\n}(_plugin2.default);\n\n_core2.default.registerPlugin('tabs', Tabs);\n\nexports.default = Tabs;\n\n//# sourceURL=webpack://Bulma/./src/plugins/tabs.js?");
|
288
|
+
|
289
|
+
/***/ })
|
290
|
+
|
291
|
+
/******/ })["default"];
|
304
292
|
});
|