bootstrap 4.6.2 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +7 -4
  4. data/assets/javascripts/bootstrap/alert.js +192 -115
  5. data/assets/javascripts/bootstrap/base-component.js +63 -0
  6. data/assets/javascripts/bootstrap/button.js +96 -179
  7. data/assets/javascripts/bootstrap/carousel.js +472 -359
  8. data/assets/javascripts/bootstrap/collapse.js +379 -225
  9. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  10. data/assets/javascripts/bootstrap/dom/event-handler.js +322 -0
  11. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  12. data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
  13. data/assets/javascripts/bootstrap/dropdown.js +472 -355
  14. data/assets/javascripts/bootstrap/modal.js +612 -438
  15. data/assets/javascripts/bootstrap/offcanvas.js +671 -0
  16. data/assets/javascripts/bootstrap/popover.js +138 -167
  17. data/assets/javascripts/bootstrap/scrollspy.js +250 -192
  18. data/assets/javascripts/bootstrap/tab.js +241 -144
  19. data/assets/javascripts/bootstrap/toast.js +223 -157
  20. data/assets/javascripts/bootstrap/tooltip.js +651 -487
  21. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  22. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  23. data/assets/javascripts/bootstrap-sprockets.js +8 -1
  24. data/assets/javascripts/bootstrap.js +3277 -2590
  25. data/assets/javascripts/bootstrap.min.js +3 -3
  26. data/assets/stylesheets/_bootstrap-grid.scss +53 -18
  27. data/assets/stylesheets/_bootstrap-reboot.scss +6 -3
  28. data/assets/stylesheets/_bootstrap.scss +18 -10
  29. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +15 -10
  31. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
  33. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  34. data/assets/stylesheets/bootstrap/_buttons.scss +29 -60
  35. data/assets/stylesheets/bootstrap/_card.scss +20 -91
  36. data/assets/stylesheets/bootstrap/_carousel.scss +64 -35
  37. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  38. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  39. data/assets/stylesheets/bootstrap/_dropdown.scss +84 -36
  40. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  41. data/assets/stylesheets/bootstrap/_functions.scss +84 -69
  42. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  43. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  44. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  45. data/assets/stylesheets/bootstrap/_list-group.scss +28 -8
  46. data/assets/stylesheets/bootstrap/_mixins.scss +8 -13
  47. data/assets/stylesheets/bootstrap/_modal.scss +45 -57
  48. data/assets/stylesheets/bootstrap/_nav.scss +20 -6
  49. data/assets/stylesheets/bootstrap/_navbar.scss +45 -71
  50. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  51. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  52. data/assets/stylesheets/bootstrap/_popover.scss +24 -36
  53. data/assets/stylesheets/bootstrap/_progress.scss +5 -4
  54. data/assets/stylesheets/bootstrap/_reboot.scss +316 -179
  55. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  56. data/assets/stylesheets/bootstrap/_spinners.scss +11 -7
  57. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  58. data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
  59. data/assets/stylesheets/bootstrap/_tooltip.scss +21 -21
  60. data/assets/stylesheets/bootstrap/_transitions.scss +2 -7
  61. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  62. data/assets/stylesheets/bootstrap/_utilities.scss +594 -18
  63. data/assets/stylesheets/bootstrap/_variables.scss +800 -485
  64. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  65. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  70. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  71. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  72. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  73. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  74. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  75. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  76. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  77. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  78. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  79. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  80. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  81. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
  82. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  83. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  84. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +71 -48
  85. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  86. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  87. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  88. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  89. data/assets/stylesheets/bootstrap/mixins/_forms.scss +39 -97
  90. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  91. data/assets/stylesheets/bootstrap/mixins/_grid.scss +90 -34
  92. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  93. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  94. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  95. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  96. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +3 -3
  97. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  98. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  99. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  100. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  101. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  102. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +214 -130
  103. data/bootstrap.gemspec +1 -3
  104. data/lib/bootstrap/version.rb +2 -2
  105. data/tasks/updater/js.rb +19 -16
  106. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  107. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  108. data/test/dummy_rails/app/views/pages/root.html +89 -0
  109. data/test/dummy_rails/config/application.rb +0 -3
  110. data/test/gemfiles/rails_6_1.gemfile +7 -0
  111. metadata +45 -73
  112. data/assets/javascripts/bootstrap/util.js +0 -189
  113. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  114. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  115. data/assets/stylesheets/bootstrap/_input-group.scss +0 -211
  116. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  117. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  118. data/assets/stylesheets/bootstrap/_print.scss +0 -132
  119. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  120. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  121. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  122. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  123. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  124. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  125. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  126. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  127. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  128. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  129. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  130. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  131. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  132. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  133. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  134. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  135. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  136. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  137. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  138. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  139. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  140. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  141. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  142. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  143. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  144. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  145. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  146. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  147. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  148. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  149. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -1,91 +1,181 @@
1
1
  /*!
2
- * Bootstrap toast.js v4.6.2 (https://getbootstrap.com/)
3
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2
+ * Bootstrap toast.js v5.0.0 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
8
- typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.jQuery, global.Util));
10
- })(this, (function ($, Util) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./base-component.js')) :
8
+ typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './base-component'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.Data, global.EventHandler, global.Manipulator, global.Base));
10
+ }(this, (function (Data, EventHandler, Manipulator, BaseComponent) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
14
- var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
- var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
14
+ var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15
+ var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16
+ var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17
+ var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
16
18
 
17
- function _defineProperties(target, props) {
18
- for (var i = 0; i < props.length; i++) {
19
- var descriptor = props[i];
20
- descriptor.enumerable = descriptor.enumerable || false;
21
- descriptor.configurable = true;
22
- if ("value" in descriptor) descriptor.writable = true;
23
- Object.defineProperty(target, descriptor.key, descriptor);
19
+ /**
20
+ * --------------------------------------------------------------------------
21
+ * Bootstrap (v5.0.0): util/index.js
22
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
23
+ * --------------------------------------------------------------------------
24
+ */
25
+ const MILLISECONDS_MULTIPLIER = 1000;
26
+ const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
27
+
28
+ const toType = obj => {
29
+ if (obj === null || obj === undefined) {
30
+ return `${obj}`;
24
31
  }
25
- }
26
32
 
27
- function _createClass(Constructor, protoProps, staticProps) {
28
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
29
- if (staticProps) _defineProperties(Constructor, staticProps);
30
- Object.defineProperty(Constructor, "prototype", {
31
- writable: false
32
- });
33
- return Constructor;
34
- }
33
+ return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
34
+ };
35
35
 
36
- function _extends() {
37
- _extends = Object.assign ? Object.assign.bind() : function (target) {
38
- for (var i = 1; i < arguments.length; i++) {
39
- var source = arguments[i];
36
+ const getTransitionDurationFromElement = element => {
37
+ if (!element) {
38
+ return 0;
39
+ } // Get transition-duration of the element
40
40
 
41
- for (var key in source) {
42
- if (Object.prototype.hasOwnProperty.call(source, key)) {
43
- target[key] = source[key];
44
- }
45
- }
41
+
42
+ let {
43
+ transitionDuration,
44
+ transitionDelay
45
+ } = window.getComputedStyle(element);
46
+ const floatTransitionDuration = Number.parseFloat(transitionDuration);
47
+ const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
48
+
49
+ if (!floatTransitionDuration && !floatTransitionDelay) {
50
+ return 0;
51
+ } // If multiple durations are defined, take the first
52
+
53
+
54
+ transitionDuration = transitionDuration.split(',')[0];
55
+ transitionDelay = transitionDelay.split(',')[0];
56
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
57
+ };
58
+
59
+ const triggerTransitionEnd = element => {
60
+ element.dispatchEvent(new Event(TRANSITION_END));
61
+ };
62
+
63
+ const isElement = obj => (obj[0] || obj).nodeType;
64
+
65
+ const emulateTransitionEnd = (element, duration) => {
66
+ let called = false;
67
+ const durationPadding = 5;
68
+ const emulatedDuration = duration + durationPadding;
69
+
70
+ function listener() {
71
+ called = true;
72
+ element.removeEventListener(TRANSITION_END, listener);
73
+ }
74
+
75
+ element.addEventListener(TRANSITION_END, listener);
76
+ setTimeout(() => {
77
+ if (!called) {
78
+ triggerTransitionEnd(element);
46
79
  }
80
+ }, emulatedDuration);
81
+ };
47
82
 
48
- return target;
49
- };
50
- return _extends.apply(this, arguments);
51
- }
83
+ const typeCheckConfig = (componentName, config, configTypes) => {
84
+ Object.keys(configTypes).forEach(property => {
85
+ const expectedTypes = configTypes[property];
86
+ const value = config[property];
87
+ const valueType = value && isElement(value) ? 'element' : toType(value);
88
+
89
+ if (!new RegExp(expectedTypes).test(valueType)) {
90
+ throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
91
+ }
92
+ });
93
+ };
94
+
95
+ const reflow = element => element.offsetHeight;
96
+
97
+ const getjQuery = () => {
98
+ const {
99
+ jQuery
100
+ } = window;
101
+
102
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
103
+ return jQuery;
104
+ }
105
+
106
+ return null;
107
+ };
108
+
109
+ const onDOMContentLoaded = callback => {
110
+ if (document.readyState === 'loading') {
111
+ document.addEventListener('DOMContentLoaded', callback);
112
+ } else {
113
+ callback();
114
+ }
115
+ };
116
+
117
+ const defineJQueryPlugin = (name, plugin) => {
118
+ onDOMContentLoaded(() => {
119
+ const $ = getjQuery();
120
+ /* istanbul ignore if */
121
+
122
+ if ($) {
123
+ const JQUERY_NO_CONFLICT = $.fn[name];
124
+ $.fn[name] = plugin.jQueryInterface;
125
+ $.fn[name].Constructor = plugin;
126
+
127
+ $.fn[name].noConflict = () => {
128
+ $.fn[name] = JQUERY_NO_CONFLICT;
129
+ return plugin.jQueryInterface;
130
+ };
131
+ }
132
+ });
133
+ };
52
134
 
53
135
  /**
136
+ * --------------------------------------------------------------------------
137
+ * Bootstrap (v5.0.0): toast.js
138
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
139
+ * --------------------------------------------------------------------------
140
+ */
141
+ /**
142
+ * ------------------------------------------------------------------------
54
143
  * Constants
144
+ * ------------------------------------------------------------------------
55
145
  */
56
146
 
57
- var NAME = 'toast';
58
- var VERSION = '4.6.2';
59
- var DATA_KEY = 'bs.toast';
60
- var EVENT_KEY = "." + DATA_KEY;
61
- var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
62
- var CLASS_NAME_FADE = 'fade';
63
- var CLASS_NAME_HIDE = 'hide';
64
- var CLASS_NAME_SHOW = 'show';
65
- var CLASS_NAME_SHOWING = 'showing';
66
- var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
67
- var EVENT_HIDE = "hide" + EVENT_KEY;
68
- var EVENT_HIDDEN = "hidden" + EVENT_KEY;
69
- var EVENT_SHOW = "show" + EVENT_KEY;
70
- var EVENT_SHOWN = "shown" + EVENT_KEY;
71
- var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
72
- var Default = {
73
- animation: true,
74
- autohide: true,
75
- delay: 500
76
- };
77
- var DefaultType = {
147
+ const NAME = 'toast';
148
+ const DATA_KEY = 'bs.toast';
149
+ const EVENT_KEY = `.${DATA_KEY}`;
150
+ const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
151
+ const EVENT_HIDE = `hide${EVENT_KEY}`;
152
+ const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
153
+ const EVENT_SHOW = `show${EVENT_KEY}`;
154
+ const EVENT_SHOWN = `shown${EVENT_KEY}`;
155
+ const CLASS_NAME_FADE = 'fade';
156
+ const CLASS_NAME_HIDE = 'hide';
157
+ const CLASS_NAME_SHOW = 'show';
158
+ const CLASS_NAME_SHOWING = 'showing';
159
+ const DefaultType = {
78
160
  animation: 'boolean',
79
161
  autohide: 'boolean',
80
162
  delay: 'number'
81
163
  };
164
+ const Default = {
165
+ animation: true,
166
+ autohide: true,
167
+ delay: 5000
168
+ };
169
+ const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
82
170
  /**
83
- * Class definition
171
+ * ------------------------------------------------------------------------
172
+ * Class Definition
173
+ * ------------------------------------------------------------------------
84
174
  */
85
175
 
86
- var Toast = /*#__PURE__*/function () {
87
- function Toast(element, config) {
88
- this._element = element;
176
+ class Toast extends BaseComponent__default['default'] {
177
+ constructor(element, config) {
178
+ super(element);
89
179
  this._config = this._getConfig(config);
90
180
  this._timeout = null;
91
181
 
@@ -93,16 +183,23 @@
93
183
  } // Getters
94
184
 
95
185
 
96
- var _proto = Toast.prototype;
186
+ static get DefaultType() {
187
+ return DefaultType;
188
+ }
189
+
190
+ static get Default() {
191
+ return Default;
192
+ }
193
+
194
+ static get DATA_KEY() {
195
+ return DATA_KEY;
196
+ } // Public
97
197
 
98
- // Public
99
- _proto.show = function show() {
100
- var _this = this;
101
198
 
102
- var showEvent = $__default["default"].Event(EVENT_SHOW);
103
- $__default["default"](this._element).trigger(showEvent);
199
+ show() {
200
+ const showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
104
201
 
105
- if (showEvent.isDefaultPrevented()) {
202
+ if (showEvent.defaultPrevented) {
106
203
  return;
107
204
  }
108
205
 
@@ -112,156 +209,125 @@
112
209
  this._element.classList.add(CLASS_NAME_FADE);
113
210
  }
114
211
 
115
- var complete = function complete() {
116
- _this._element.classList.remove(CLASS_NAME_SHOWING);
212
+ const complete = () => {
213
+ this._element.classList.remove(CLASS_NAME_SHOWING);
117
214
 
118
- _this._element.classList.add(CLASS_NAME_SHOW);
215
+ this._element.classList.add(CLASS_NAME_SHOW);
119
216
 
120
- $__default["default"](_this._element).trigger(EVENT_SHOWN);
217
+ EventHandler__default['default'].trigger(this._element, EVENT_SHOWN);
121
218
 
122
- if (_this._config.autohide) {
123
- _this._timeout = setTimeout(function () {
124
- _this.hide();
125
- }, _this._config.delay);
219
+ if (this._config.autohide) {
220
+ this._timeout = setTimeout(() => {
221
+ this.hide();
222
+ }, this._config.delay);
126
223
  }
127
224
  };
128
225
 
129
226
  this._element.classList.remove(CLASS_NAME_HIDE);
130
227
 
131
- Util__default["default"].reflow(this._element);
228
+ reflow(this._element);
132
229
 
133
230
  this._element.classList.add(CLASS_NAME_SHOWING);
134
231
 
135
232
  if (this._config.animation) {
136
- var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this._element);
137
- $__default["default"](this._element).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
233
+ const transitionDuration = getTransitionDurationFromElement(this._element);
234
+ EventHandler__default['default'].one(this._element, 'transitionend', complete);
235
+ emulateTransitionEnd(this._element, transitionDuration);
138
236
  } else {
139
237
  complete();
140
238
  }
141
- };
239
+ }
142
240
 
143
- _proto.hide = function hide() {
241
+ hide() {
144
242
  if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
145
243
  return;
146
244
  }
147
245
 
148
- var hideEvent = $__default["default"].Event(EVENT_HIDE);
149
- $__default["default"](this._element).trigger(hideEvent);
246
+ const hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
150
247
 
151
- if (hideEvent.isDefaultPrevented()) {
248
+ if (hideEvent.defaultPrevented) {
152
249
  return;
153
250
  }
154
251
 
155
- this._close();
156
- };
252
+ const complete = () => {
253
+ this._element.classList.add(CLASS_NAME_HIDE);
254
+
255
+ EventHandler__default['default'].trigger(this._element, EVENT_HIDDEN);
256
+ };
257
+
258
+ this._element.classList.remove(CLASS_NAME_SHOW);
157
259
 
158
- _proto.dispose = function dispose() {
260
+ if (this._config.animation) {
261
+ const transitionDuration = getTransitionDurationFromElement(this._element);
262
+ EventHandler__default['default'].one(this._element, 'transitionend', complete);
263
+ emulateTransitionEnd(this._element, transitionDuration);
264
+ } else {
265
+ complete();
266
+ }
267
+ }
268
+
269
+ dispose() {
159
270
  this._clearTimeout();
160
271
 
161
272
  if (this._element.classList.contains(CLASS_NAME_SHOW)) {
162
273
  this._element.classList.remove(CLASS_NAME_SHOW);
163
274
  }
164
275
 
165
- $__default["default"](this._element).off(EVENT_CLICK_DISMISS);
166
- $__default["default"].removeData(this._element, DATA_KEY);
167
- this._element = null;
276
+ super.dispose();
168
277
  this._config = null;
169
278
  } // Private
170
- ;
171
-
172
- _proto._getConfig = function _getConfig(config) {
173
- config = _extends({}, Default, $__default["default"](this._element).data(), typeof config === 'object' && config ? config : {});
174
- Util__default["default"].typeCheckConfig(NAME, config, this.constructor.DefaultType);
175
- return config;
176
- };
177
279
 
178
- _proto._setListeners = function _setListeners() {
179
- var _this2 = this;
180
280
 
181
- $__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
182
- return _this2.hide();
183
- });
184
- };
185
-
186
- _proto._close = function _close() {
187
- var _this3 = this;
188
-
189
- var complete = function complete() {
190
- _this3._element.classList.add(CLASS_NAME_HIDE);
191
-
192
- $__default["default"](_this3._element).trigger(EVENT_HIDDEN);
281
+ _getConfig(config) {
282
+ config = { ...Default,
283
+ ...Manipulator__default['default'].getDataAttributes(this._element),
284
+ ...(typeof config === 'object' && config ? config : {})
193
285
  };
286
+ typeCheckConfig(NAME, config, this.constructor.DefaultType);
287
+ return config;
288
+ }
194
289
 
195
- this._element.classList.remove(CLASS_NAME_SHOW);
196
-
197
- if (this._config.animation) {
198
- var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this._element);
199
- $__default["default"](this._element).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
200
- } else {
201
- complete();
202
- }
203
- };
290
+ _setListeners() {
291
+ EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
292
+ }
204
293
 
205
- _proto._clearTimeout = function _clearTimeout() {
294
+ _clearTimeout() {
206
295
  clearTimeout(this._timeout);
207
296
  this._timeout = null;
208
297
  } // Static
209
- ;
210
298
 
211
- Toast._jQueryInterface = function _jQueryInterface(config) {
299
+
300
+ static jQueryInterface(config) {
212
301
  return this.each(function () {
213
- var $element = $__default["default"](this);
214
- var data = $element.data(DATA_KEY);
302
+ let data = Data__default['default'].get(this, DATA_KEY);
215
303
 
216
- var _config = typeof config === 'object' && config;
304
+ const _config = typeof config === 'object' && config;
217
305
 
218
306
  if (!data) {
219
307
  data = new Toast(this, _config);
220
- $element.data(DATA_KEY, data);
221
308
  }
222
309
 
223
310
  if (typeof config === 'string') {
224
311
  if (typeof data[config] === 'undefined') {
225
- throw new TypeError("No method named \"" + config + "\"");
312
+ throw new TypeError(`No method named "${config}"`);
226
313
  }
227
314
 
228
315
  data[config](this);
229
316
  }
230
317
  });
231
- };
232
-
233
- _createClass(Toast, null, [{
234
- key: "VERSION",
235
- get: function get() {
236
- return VERSION;
237
- }
238
- }, {
239
- key: "DefaultType",
240
- get: function get() {
241
- return DefaultType;
242
- }
243
- }, {
244
- key: "Default",
245
- get: function get() {
246
- return Default;
247
- }
248
- }]);
318
+ }
249
319
 
250
- return Toast;
251
- }();
320
+ }
252
321
  /**
322
+ * ------------------------------------------------------------------------
253
323
  * jQuery
324
+ * ------------------------------------------------------------------------
325
+ * add .Toast to jQuery only if jQuery is present
254
326
  */
255
327
 
256
328
 
257
- $__default["default"].fn[NAME] = Toast._jQueryInterface;
258
- $__default["default"].fn[NAME].Constructor = Toast;
259
-
260
- $__default["default"].fn[NAME].noConflict = function () {
261
- $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
262
- return Toast._jQueryInterface;
263
- };
329
+ defineJQueryPlugin(NAME, Toast);
264
330
 
265
331
  return Toast;
266
332
 
267
- }));
333
+ })));