bootstrap 4.3.1 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +55 -0
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +28 -5
  5. data/assets/javascripts/bootstrap/alert.js +54 -163
  6. data/assets/javascripts/bootstrap/base-component.js +83 -0
  7. data/assets/javascripts/bootstrap/button.js +44 -152
  8. data/assets/javascripts/bootstrap/carousel.js +289 -569
  9. data/assets/javascripts/bootstrap/collapse.js +170 -349
  10. data/assets/javascripts/bootstrap/dom/data.js +62 -0
  11. data/assets/javascripts/bootstrap/dom/event-handler.js +236 -0
  12. data/assets/javascripts/bootstrap/dom/manipulator.js +71 -0
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +103 -0
  14. data/assets/javascripts/bootstrap/dropdown.js +303 -496
  15. data/assets/javascripts/bootstrap/modal.js +229 -559
  16. data/assets/javascripts/bootstrap/offcanvas.js +245 -0
  17. data/assets/javascripts/bootstrap/popover.js +61 -226
  18. data/assets/javascripts/bootstrap/scrollspy.js +217 -317
  19. data/assets/javascripts/bootstrap/tab.js +220 -212
  20. data/assets/javascripts/bootstrap/toast.js +145 -229
  21. data/assets/javascripts/bootstrap/tooltip.js +421 -782
  22. data/assets/javascripts/bootstrap/util/backdrop.js +139 -0
  23. data/assets/javascripts/bootstrap/util/component-functions.js +41 -0
  24. data/assets/javascripts/bootstrap/util/config.js +67 -0
  25. data/assets/javascripts/bootstrap/util/focustrap.js +113 -0
  26. data/assets/javascripts/bootstrap/util/index.js +281 -0
  27. data/assets/javascripts/bootstrap/util/sanitizer.js +110 -0
  28. data/assets/javascripts/bootstrap/util/scrollbar.js +112 -0
  29. data/assets/javascripts/bootstrap/util/swipe.js +134 -0
  30. data/assets/javascripts/bootstrap/util/template-factory.js +150 -0
  31. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  32. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  33. data/assets/javascripts/bootstrap-sprockets.js +23 -7
  34. data/assets/javascripts/bootstrap.js +3690 -3639
  35. data/assets/javascripts/bootstrap.min.js +4 -4
  36. data/assets/stylesheets/_bootstrap-grid.scss +53 -20
  37. data/assets/stylesheets/_bootstrap-reboot.scss +5 -7
  38. data/assets/stylesheets/_bootstrap.scss +21 -13
  39. data/assets/stylesheets/bootstrap/_accordion.scss +158 -0
  40. data/assets/stylesheets/bootstrap/_alert.scss +32 -15
  41. data/assets/stylesheets/bootstrap/_badge.scss +15 -31
  42. data/assets/stylesheets/bootstrap/_breadcrumb.scss +23 -24
  43. data/assets/stylesheets/bootstrap/_button-group.scss +27 -48
  44. data/assets/stylesheets/bootstrap/_buttons.scss +139 -69
  45. data/assets/stylesheets/bootstrap/_card.scss +91 -141
  46. data/assets/stylesheets/bootstrap/_carousel.scss +86 -39
  47. data/assets/stylesheets/bootstrap/_close.scss +51 -29
  48. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  49. data/assets/stylesheets/bootstrap/_dropdown.scss +131 -72
  50. data/assets/stylesheets/bootstrap/_forms.scss +9 -330
  51. data/assets/stylesheets/bootstrap/_functions.scss +244 -28
  52. data/assets/stylesheets/bootstrap/_grid.scss +18 -31
  53. data/assets/stylesheets/bootstrap/_helpers.scss +12 -0
  54. data/assets/stylesheets/bootstrap/_images.scss +3 -3
  55. data/assets/stylesheets/bootstrap/_list-group.scss +101 -53
  56. data/assets/stylesheets/bootstrap/_maps.scss +174 -0
  57. data/assets/stylesheets/bootstrap/_mixins.scss +13 -18
  58. data/assets/stylesheets/bootstrap/_modal.scss +120 -112
  59. data/assets/stylesheets/bootstrap/_nav.scss +113 -24
  60. data/assets/stylesheets/bootstrap/_navbar.scss +145 -150
  61. data/assets/stylesheets/bootstrap/_offcanvas.scss +146 -0
  62. data/assets/stylesheets/bootstrap/_pagination.scss +74 -38
  63. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  64. data/assets/stylesheets/bootstrap/_popover.scss +99 -74
  65. data/assets/stylesheets/bootstrap/_progress.scss +40 -15
  66. data/assets/stylesheets/bootstrap/_reboot.scss +342 -215
  67. data/assets/stylesheets/bootstrap/_root.scss +174 -9
  68. data/assets/stylesheets/bootstrap/_spinners.scss +52 -22
  69. data/assets/stylesheets/bootstrap/_tables.scss +101 -115
  70. data/assets/stylesheets/bootstrap/_toasts.scss +54 -25
  71. data/assets/stylesheets/bootstrap/_tooltip.scss +67 -63
  72. data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
  73. data/assets/stylesheets/bootstrap/_type.scss +42 -61
  74. data/assets/stylesheets/bootstrap/_utilities.scss +806 -17
  75. data/assets/stylesheets/bootstrap/_variables-dark.scss +85 -0
  76. data/assets/stylesheets/bootstrap/_variables.scss +1235 -615
  77. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +19 -0
  78. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +94 -0
  79. data/assets/stylesheets/bootstrap/forms/_form-check.scss +188 -0
  80. data/assets/stylesheets/bootstrap/forms/_form-control.scss +214 -0
  81. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  82. data/assets/stylesheets/bootstrap/forms/_form-select.scss +80 -0
  83. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  84. data/assets/stylesheets/bootstrap/forms/_input-group.scss +132 -0
  85. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  86. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  87. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +8 -0
  88. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +30 -0
  89. data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
  90. data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
  91. data/assets/stylesheets/bootstrap/helpers/_position.scss +36 -0
  92. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  93. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  94. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  95. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  96. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  97. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  98. data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -6
  99. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  100. data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
  101. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +37 -22
  102. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  103. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +20 -16
  104. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +60 -97
  105. data/assets/stylesheets/bootstrap/mixins/_caret.scss +34 -27
  106. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  107. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  108. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  109. data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
  110. data/assets/stylesheets/bootstrap/mixins/_forms.scss +77 -116
  111. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  112. data/assets/stylesheets/bootstrap/mixins/_grid.scss +133 -33
  113. data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
  114. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +7 -2
  115. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +7 -19
  116. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  117. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +24 -0
  118. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  119. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +97 -0
  120. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +33 -0
  121. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  122. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +276 -132
  123. data/bootstrap.gemspec +4 -6
  124. data/lib/bootstrap/version.rb +2 -2
  125. data/tasks/updater/js.rb +31 -7
  126. data/tasks/updater/network.rb +10 -4
  127. data/tasks/updater/scss.rb +1 -1
  128. data/tasks/updater.rb +2 -2
  129. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  130. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  131. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  132. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  133. data/test/dummy_rails/app/views/pages/root.html +89 -0
  134. data/test/dummy_rails/config/application.rb +0 -3
  135. data/test/gemfiles/rails_5_2.gemfile +8 -0
  136. data/test/gemfiles/rails_6_0.gemfile +7 -0
  137. data/test/gemfiles/rails_6_1.gemfile +7 -0
  138. data/test/gemfiles/rails_7_0.gemfile +7 -0
  139. data/test/support/dummy_rails_integration.rb +3 -1
  140. data/test/test_helper.rb +18 -12
  141. metadata +86 -84
  142. data/.travis.yml +0 -17
  143. data/assets/javascripts/bootstrap/util.js +0 -171
  144. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  145. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -507
  146. data/assets/stylesheets/bootstrap/_input-group.scss +0 -193
  147. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  148. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  149. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  150. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
  151. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  152. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  153. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -66
  154. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  155. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
  156. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -33
  157. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  158. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  159. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -16
  160. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  161. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  162. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  163. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  164. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  165. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  166. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  167. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  168. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  169. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  170. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  171. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  172. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  173. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  174. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  175. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  176. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  177. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  178. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  179. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -1,281 +1,197 @@
1
1
  /*!
2
- * Bootstrap toast.js v4.3.1 (https://getbootstrap.com/)
3
- * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2
+ * Bootstrap toast.js v5.3.0 (https://getbootstrap.com/)
3
+ * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
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.js'], factory) :
9
- (global = 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('./base-component.js'), require('./dom/event-handler.js'), require('./util/component-functions.js'), require('./util/index.js')) :
8
+ typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './util/component-functions', './util/index'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.BaseComponent, global.EventHandler, global.ComponentFunctions, global.Index));
10
+ })(this, (function (BaseComponent, EventHandler, componentFunctions_js, index_js) { 'use strict';
11
11
 
12
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
13
- Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
14
-
15
- function _defineProperties(target, props) {
16
- for (var i = 0; i < props.length; i++) {
17
- var descriptor = props[i];
18
- descriptor.enumerable = descriptor.enumerable || false;
19
- descriptor.configurable = true;
20
- if ("value" in descriptor) descriptor.writable = true;
21
- Object.defineProperty(target, descriptor.key, descriptor);
22
- }
23
- }
24
-
25
- function _createClass(Constructor, protoProps, staticProps) {
26
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
- if (staticProps) _defineProperties(Constructor, staticProps);
28
- return Constructor;
29
- }
30
-
31
- function _defineProperty(obj, key, value) {
32
- if (key in obj) {
33
- Object.defineProperty(obj, key, {
34
- value: value,
35
- enumerable: true,
36
- configurable: true,
37
- writable: true
38
- });
39
- } else {
40
- obj[key] = value;
41
- }
42
-
43
- return obj;
44
- }
45
-
46
- function _objectSpread(target) {
47
- for (var i = 1; i < arguments.length; i++) {
48
- var source = arguments[i] != null ? arguments[i] : {};
49
- var ownKeys = Object.keys(source);
50
-
51
- if (typeof Object.getOwnPropertySymbols === 'function') {
52
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
53
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
54
- }));
55
- }
56
-
57
- ownKeys.forEach(function (key) {
58
- _defineProperty(target, key, source[key]);
59
- });
60
- }
12
+ /**
13
+ * --------------------------------------------------------------------------
14
+ * Bootstrap toast.js
15
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
+ * --------------------------------------------------------------------------
17
+ */
61
18
 
62
- return target;
63
- }
64
19
 
65
20
  /**
66
- * ------------------------------------------------------------------------
67
21
  * Constants
68
- * ------------------------------------------------------------------------
69
22
  */
70
23
 
71
- var NAME = 'toast';
72
- var VERSION = '4.3.1';
73
- var DATA_KEY = 'bs.toast';
74
- var EVENT_KEY = "." + DATA_KEY;
75
- var JQUERY_NO_CONFLICT = $.fn[NAME];
76
- var Event = {
77
- CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
78
- HIDE: "hide" + EVENT_KEY,
79
- HIDDEN: "hidden" + EVENT_KEY,
80
- SHOW: "show" + EVENT_KEY,
81
- SHOWN: "shown" + EVENT_KEY
82
- };
83
- var ClassName = {
84
- FADE: 'fade',
85
- HIDE: 'hide',
86
- SHOW: 'show',
87
- SHOWING: 'showing'
88
- };
89
- var DefaultType = {
24
+ const NAME = 'toast';
25
+ const DATA_KEY = 'bs.toast';
26
+ const EVENT_KEY = `.${DATA_KEY}`;
27
+ const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
28
+ const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
29
+ const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
30
+ const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
31
+ const EVENT_HIDE = `hide${EVENT_KEY}`;
32
+ const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
33
+ const EVENT_SHOW = `show${EVENT_KEY}`;
34
+ const EVENT_SHOWN = `shown${EVENT_KEY}`;
35
+ const CLASS_NAME_FADE = 'fade';
36
+ const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
37
+ const CLASS_NAME_SHOW = 'show';
38
+ const CLASS_NAME_SHOWING = 'showing';
39
+ const DefaultType = {
90
40
  animation: 'boolean',
91
41
  autohide: 'boolean',
92
42
  delay: 'number'
93
43
  };
94
- var Default = {
44
+ const Default = {
95
45
  animation: true,
96
46
  autohide: true,
97
- delay: 500
47
+ delay: 5000
98
48
  };
99
- var Selector = {
100
- DATA_DISMISS: '[data-dismiss="toast"]'
101
- /**
102
- * ------------------------------------------------------------------------
103
- * Class Definition
104
- * ------------------------------------------------------------------------
105
- */
106
49
 
107
- };
50
+ /**
51
+ * Class definition
52
+ */
108
53
 
109
- var Toast =
110
- /*#__PURE__*/
111
- function () {
112
- function Toast(element, config) {
113
- this._element = element;
114
- this._config = this._getConfig(config);
54
+ class Toast extends BaseComponent {
55
+ constructor(element, config) {
56
+ super(element, config);
115
57
  this._timeout = null;
116
-
58
+ this._hasMouseInteraction = false;
59
+ this._hasKeyboardInteraction = false;
117
60
  this._setListeners();
118
- } // Getters
119
-
61
+ }
120
62
 
121
- var _proto = Toast.prototype;
63
+ // Getters
64
+ static get Default() {
65
+ return Default;
66
+ }
67
+ static get DefaultType() {
68
+ return DefaultType;
69
+ }
70
+ static get NAME() {
71
+ return NAME;
72
+ }
122
73
 
123
74
  // Public
124
- _proto.show = function show() {
125
- var _this = this;
126
-
127
- $(this._element).trigger(Event.SHOW);
128
-
75
+ show() {
76
+ const showEvent = EventHandler.trigger(this._element, EVENT_SHOW);
77
+ if (showEvent.defaultPrevented) {
78
+ return;
79
+ }
80
+ this._clearTimeout();
129
81
  if (this._config.animation) {
130
- this._element.classList.add(ClassName.FADE);
82
+ this._element.classList.add(CLASS_NAME_FADE);
131
83
  }
132
-
133
- var complete = function complete() {
134
- _this._element.classList.remove(ClassName.SHOWING);
135
-
136
- _this._element.classList.add(ClassName.SHOW);
137
-
138
- $(_this._element).trigger(Event.SHOWN);
139
-
140
- if (_this._config.autohide) {
141
- _this.hide();
142
- }
84
+ const complete = () => {
85
+ this._element.classList.remove(CLASS_NAME_SHOWING);
86
+ EventHandler.trigger(this._element, EVENT_SHOWN);
87
+ this._maybeScheduleHide();
143
88
  };
144
-
145
- this._element.classList.remove(ClassName.HIDE);
146
-
147
- this._element.classList.add(ClassName.SHOWING);
148
-
149
- if (this._config.animation) {
150
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
151
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
152
- } else {
153
- complete();
89
+ this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
90
+ index_js.reflow(this._element);
91
+ this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING);
92
+ this._queueCallback(complete, this._element, this._config.animation);
93
+ }
94
+ hide() {
95
+ if (!this.isShown()) {
96
+ return;
154
97
  }
155
- };
156
-
157
- _proto.hide = function hide(withoutTimeout) {
158
- var _this2 = this;
159
-
160
- if (!this._element.classList.contains(ClassName.SHOW)) {
98
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
99
+ if (hideEvent.defaultPrevented) {
161
100
  return;
162
101
  }
163
-
164
- $(this._element).trigger(Event.HIDE);
165
-
166
- if (withoutTimeout) {
167
- this._close();
168
- } else {
169
- this._timeout = setTimeout(function () {
170
- _this2._close();
171
- }, this._config.delay);
102
+ const complete = () => {
103
+ this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
104
+ this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW);
105
+ EventHandler.trigger(this._element, EVENT_HIDDEN);
106
+ };
107
+ this._element.classList.add(CLASS_NAME_SHOWING);
108
+ this._queueCallback(complete, this._element, this._config.animation);
109
+ }
110
+ dispose() {
111
+ this._clearTimeout();
112
+ if (this.isShown()) {
113
+ this._element.classList.remove(CLASS_NAME_SHOW);
172
114
  }
173
- };
115
+ super.dispose();
116
+ }
117
+ isShown() {
118
+ return this._element.classList.contains(CLASS_NAME_SHOW);
119
+ }
174
120
 
175
- _proto.dispose = function dispose() {
176
- clearTimeout(this._timeout);
177
- this._timeout = null;
121
+ // Private
178
122
 
179
- if (this._element.classList.contains(ClassName.SHOW)) {
180
- this._element.classList.remove(ClassName.SHOW);
123
+ _maybeScheduleHide() {
124
+ if (!this._config.autohide) {
125
+ return;
181
126
  }
182
-
183
- $(this._element).off(Event.CLICK_DISMISS);
184
- $.removeData(this._element, DATA_KEY);
185
- this._element = null;
186
- this._config = null;
187
- } // Private
188
- ;
189
-
190
- _proto._getConfig = function _getConfig(config) {
191
- config = _objectSpread({}, Default, $(this._element).data(), typeof config === 'object' && config ? config : {});
192
- Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
193
- return config;
194
- };
195
-
196
- _proto._setListeners = function _setListeners() {
197
- var _this3 = this;
198
-
199
- $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function () {
200
- return _this3.hide(true);
201
- });
202
- };
203
-
204
- _proto._close = function _close() {
205
- var _this4 = this;
206
-
207
- var complete = function complete() {
208
- _this4._element.classList.add(ClassName.HIDE);
209
-
210
- $(_this4._element).trigger(Event.HIDDEN);
211
- };
212
-
213
- this._element.classList.remove(ClassName.SHOW);
214
-
215
- if (this._config.animation) {
216
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
217
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
218
- } else {
219
- complete();
127
+ if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
128
+ return;
129
+ }
130
+ this._timeout = setTimeout(() => {
131
+ this.hide();
132
+ }, this._config.delay);
133
+ }
134
+ _onInteraction(event, isInteracting) {
135
+ switch (event.type) {
136
+ case 'mouseover':
137
+ case 'mouseout':
138
+ {
139
+ this._hasMouseInteraction = isInteracting;
140
+ break;
141
+ }
142
+ case 'focusin':
143
+ case 'focusout':
144
+ {
145
+ this._hasKeyboardInteraction = isInteracting;
146
+ break;
147
+ }
220
148
  }
221
- } // Static
222
- ;
149
+ if (isInteracting) {
150
+ this._clearTimeout();
151
+ return;
152
+ }
153
+ const nextElement = event.relatedTarget;
154
+ if (this._element === nextElement || this._element.contains(nextElement)) {
155
+ return;
156
+ }
157
+ this._maybeScheduleHide();
158
+ }
159
+ _setListeners() {
160
+ EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
161
+ EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
162
+ EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
163
+ EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));
164
+ }
165
+ _clearTimeout() {
166
+ clearTimeout(this._timeout);
167
+ this._timeout = null;
168
+ }
223
169
 
224
- Toast._jQueryInterface = function _jQueryInterface(config) {
170
+ // Static
171
+ static jQueryInterface(config) {
225
172
  return this.each(function () {
226
- var $element = $(this);
227
- var data = $element.data(DATA_KEY);
228
-
229
- var _config = typeof config === 'object' && config;
230
-
231
- if (!data) {
232
- data = new Toast(this, _config);
233
- $element.data(DATA_KEY, data);
234
- }
235
-
173
+ const data = Toast.getOrCreateInstance(this, config);
236
174
  if (typeof config === 'string') {
237
175
  if (typeof data[config] === 'undefined') {
238
- throw new TypeError("No method named \"" + config + "\"");
176
+ throw new TypeError(`No method named "${config}"`);
239
177
  }
240
-
241
178
  data[config](this);
242
179
  }
243
180
  });
244
- };
245
-
246
- _createClass(Toast, null, [{
247
- key: "VERSION",
248
- get: function get() {
249
- return VERSION;
250
- }
251
- }, {
252
- key: "DefaultType",
253
- get: function get() {
254
- return DefaultType;
255
- }
256
- }, {
257
- key: "Default",
258
- get: function get() {
259
- return Default;
260
- }
261
- }]);
181
+ }
182
+ }
262
183
 
263
- return Toast;
264
- }();
265
184
  /**
266
- * ------------------------------------------------------------------------
267
- * jQuery
268
- * ------------------------------------------------------------------------
185
+ * Data API implementation
269
186
  */
270
187
 
188
+ componentFunctions_js.enableDismissTrigger(Toast);
271
189
 
272
- $.fn[NAME] = Toast._jQueryInterface;
273
- $.fn[NAME].Constructor = Toast;
190
+ /**
191
+ * jQuery
192
+ */
274
193
 
275
- $.fn[NAME].noConflict = function () {
276
- $.fn[NAME] = JQUERY_NO_CONFLICT;
277
- return Toast._jQueryInterface;
278
- };
194
+ index_js.defineJQueryPlugin(Toast);
279
195
 
280
196
  return Toast;
281
197