bootstrap 4.4.1 → 5.0.1

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 +13 -2
  3. data/README.md +7 -4
  4. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  5. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  6. data/assets/javascripts/bootstrap-sprockets.js +15 -8
  7. data/assets/javascripts/bootstrap.js +3244 -2770
  8. data/assets/javascripts/bootstrap.min.js +4 -4
  9. data/assets/javascripts/bootstrap/alert.js +130 -124
  10. data/assets/javascripts/bootstrap/base-component.js +168 -0
  11. data/assets/javascripts/bootstrap/button.js +85 -179
  12. data/assets/javascripts/bootstrap/carousel.js +430 -405
  13. data/assets/javascripts/bootstrap/collapse.js +325 -264
  14. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  15. data/assets/javascripts/bootstrap/dom/event-handler.js +315 -0
  16. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  17. data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
  18. data/assets/javascripts/bootstrap/dropdown.js +464 -400
  19. data/assets/javascripts/bootstrap/modal.js +604 -464
  20. data/assets/javascripts/bootstrap/offcanvas.js +671 -0
  21. data/assets/javascripts/bootstrap/popover.js +119 -192
  22. data/assets/javascripts/bootstrap/scrollspy.js +250 -238
  23. data/assets/javascripts/bootstrap/tab.js +189 -151
  24. data/assets/javascripts/bootstrap/toast.js +215 -192
  25. data/assets/javascripts/bootstrap/tooltip.js +604 -544
  26. data/assets/stylesheets/_bootstrap-grid.scss +54 -18
  27. data/assets/stylesheets/_bootstrap-reboot.scss +7 -4
  28. data/assets/stylesheets/_bootstrap.scss +19 -11
  29. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +15 -9
  31. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +4 -18
  33. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  34. data/assets/stylesheets/bootstrap/_buttons.scss +27 -55
  35. data/assets/stylesheets/bootstrap/_card.scss +43 -106
  36. data/assets/stylesheets/bootstrap/_carousel.scss +65 -33
  37. data/assets/stylesheets/bootstrap/_close.scss +30 -31
  38. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  39. data/assets/stylesheets/bootstrap/_dropdown.scss +87 -38
  40. data/assets/stylesheets/bootstrap/_forms.scss +9 -338
  41. data/assets/stylesheets/bootstrap/_functions.scss +99 -28
  42. data/assets/stylesheets/bootstrap/_grid.scss +3 -50
  43. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  44. data/assets/stylesheets/bootstrap/_list-group.scss +38 -22
  45. data/assets/stylesheets/bootstrap/_mixins.scss +8 -13
  46. data/assets/stylesheets/bootstrap/_modal.scss +45 -65
  47. data/assets/stylesheets/bootstrap/_nav.scss +28 -9
  48. data/assets/stylesheets/bootstrap/_navbar.scss +51 -69
  49. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  50. data/assets/stylesheets/bootstrap/_pagination.scss +11 -20
  51. data/assets/stylesheets/bootstrap/_popover.scss +15 -27
  52. data/assets/stylesheets/bootstrap/_progress.scss +6 -4
  53. data/assets/stylesheets/bootstrap/_reboot.scss +339 -200
  54. data/assets/stylesheets/bootstrap/_root.scss +5 -9
  55. data/assets/stylesheets/bootstrap/_spinners.scss +21 -7
  56. data/assets/stylesheets/bootstrap/_tables.scss +80 -114
  57. data/assets/stylesheets/bootstrap/_toasts.scss +21 -14
  58. data/assets/stylesheets/bootstrap/_tooltip.scss +17 -17
  59. data/assets/stylesheets/bootstrap/_transitions.scss +2 -1
  60. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  61. data/assets/stylesheets/bootstrap/_utilities.scss +594 -17
  62. data/assets/stylesheets/bootstrap/_variables.scss +810 -489
  63. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  64. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  70. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  71. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  72. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  73. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -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 +37 -22
  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 +75 -52
  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 +42 -75
  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 +2 -2
  97. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  98. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  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 +234 -126
  103. data/bootstrap.gemspec +1 -3
  104. data/lib/bootstrap/version.rb +2 -2
  105. data/tasks/updater/js.rb +20 -5
  106. data/tasks/updater/network.rb +8 -2
  107. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  108. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  109. data/test/dummy_rails/app/views/pages/root.html +89 -0
  110. data/test/dummy_rails/config/application.rb +0 -3
  111. data/test/gemfiles/rails_6_0.gemfile +7 -0
  112. data/test/gemfiles/rails_6_1.gemfile +7 -0
  113. metadata +48 -73
  114. data/assets/javascripts/bootstrap/util.js +0 -188
  115. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  116. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -521
  117. data/assets/stylesheets/bootstrap/_input-group.scss +0 -191
  118. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  119. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  120. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  121. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -22
  122. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  123. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  124. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -71
  125. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  126. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  127. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  128. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  129. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  130. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  131. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  132. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  133. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  134. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  135. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  136. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  137. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  138. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  139. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  140. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  141. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  142. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  143. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  144. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  145. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  146. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  147. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  148. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  149. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -0,0 +1,68 @@
1
+ /*!
2
+ * Bootstrap data.js v5.0.1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
+ */
6
+ (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
+ typeof define === 'function' && define.amd ? define(factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Data = factory());
10
+ }(this, (function () { 'use strict';
11
+
12
+ /**
13
+ * --------------------------------------------------------------------------
14
+ * Bootstrap (v5.0.1): dom/data.js
15
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
+ * --------------------------------------------------------------------------
17
+ */
18
+
19
+ /**
20
+ * ------------------------------------------------------------------------
21
+ * Constants
22
+ * ------------------------------------------------------------------------
23
+ */
24
+ const elementMap = new Map();
25
+ var data = {
26
+ set(element, key, instance) {
27
+ if (!elementMap.has(element)) {
28
+ elementMap.set(element, new Map());
29
+ }
30
+
31
+ const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
32
+ // can be removed later when multiple key/instances are fine to be used
33
+
34
+ if (!instanceMap.has(key) && instanceMap.size !== 0) {
35
+ // eslint-disable-next-line no-console
36
+ console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
37
+ return;
38
+ }
39
+
40
+ instanceMap.set(key, instance);
41
+ },
42
+
43
+ get(element, key) {
44
+ if (elementMap.has(element)) {
45
+ return elementMap.get(element).get(key) || null;
46
+ }
47
+
48
+ return null;
49
+ },
50
+
51
+ remove(element, key) {
52
+ if (!elementMap.has(element)) {
53
+ return;
54
+ }
55
+
56
+ const instanceMap = elementMap.get(element);
57
+ instanceMap.delete(key); // free up element references if there are no instances left for an element
58
+
59
+ if (instanceMap.size === 0) {
60
+ elementMap.delete(element);
61
+ }
62
+ }
63
+
64
+ };
65
+
66
+ return data;
67
+
68
+ })));
@@ -0,0 +1,315 @@
1
+ /*!
2
+ * Bootstrap event-handler.js v5.0.1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
+ */
6
+ (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
+ typeof define === 'function' && define.amd ? define(factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory());
10
+ }(this, (function () { 'use strict';
11
+
12
+ const getjQuery = () => {
13
+ const {
14
+ jQuery
15
+ } = window;
16
+
17
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
18
+ return jQuery;
19
+ }
20
+
21
+ return null;
22
+ };
23
+
24
+ /**
25
+ * --------------------------------------------------------------------------
26
+ * Bootstrap (v5.0.1): dom/event-handler.js
27
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
28
+ * --------------------------------------------------------------------------
29
+ */
30
+ /**
31
+ * ------------------------------------------------------------------------
32
+ * Constants
33
+ * ------------------------------------------------------------------------
34
+ */
35
+
36
+ const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
37
+ const stripNameRegex = /\..*/;
38
+ const stripUidRegex = /::\d+$/;
39
+ const eventRegistry = {}; // Events storage
40
+
41
+ let uidEvent = 1;
42
+ const customEvents = {
43
+ mouseenter: 'mouseover',
44
+ mouseleave: 'mouseout'
45
+ };
46
+ const customEventsRegex = /^(mouseenter|mouseleave)/i;
47
+ const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);
48
+ /**
49
+ * ------------------------------------------------------------------------
50
+ * Private methods
51
+ * ------------------------------------------------------------------------
52
+ */
53
+
54
+ function getUidEvent(element, uid) {
55
+ return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
56
+ }
57
+
58
+ function getEvent(element) {
59
+ const uid = getUidEvent(element);
60
+ element.uidEvent = uid;
61
+ eventRegistry[uid] = eventRegistry[uid] || {};
62
+ return eventRegistry[uid];
63
+ }
64
+
65
+ function bootstrapHandler(element, fn) {
66
+ return function handler(event) {
67
+ event.delegateTarget = element;
68
+
69
+ if (handler.oneOff) {
70
+ EventHandler.off(element, event.type, fn);
71
+ }
72
+
73
+ return fn.apply(element, [event]);
74
+ };
75
+ }
76
+
77
+ function bootstrapDelegationHandler(element, selector, fn) {
78
+ return function handler(event) {
79
+ const domElements = element.querySelectorAll(selector);
80
+
81
+ for (let {
82
+ target
83
+ } = event; target && target !== this; target = target.parentNode) {
84
+ for (let i = domElements.length; i--;) {
85
+ if (domElements[i] === target) {
86
+ event.delegateTarget = target;
87
+
88
+ if (handler.oneOff) {
89
+ // eslint-disable-next-line unicorn/consistent-destructuring
90
+ EventHandler.off(element, event.type, selector, fn);
91
+ }
92
+
93
+ return fn.apply(target, [event]);
94
+ }
95
+ }
96
+ } // To please ESLint
97
+
98
+
99
+ return null;
100
+ };
101
+ }
102
+
103
+ function findHandler(events, handler, delegationSelector = null) {
104
+ const uidEventList = Object.keys(events);
105
+
106
+ for (let i = 0, len = uidEventList.length; i < len; i++) {
107
+ const event = events[uidEventList[i]];
108
+
109
+ if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
110
+ return event;
111
+ }
112
+ }
113
+
114
+ return null;
115
+ }
116
+
117
+ function normalizeParams(originalTypeEvent, handler, delegationFn) {
118
+ const delegation = typeof handler === 'string';
119
+ const originalHandler = delegation ? delegationFn : handler;
120
+ let typeEvent = getTypeEvent(originalTypeEvent);
121
+ const isNative = nativeEvents.has(typeEvent);
122
+
123
+ if (!isNative) {
124
+ typeEvent = originalTypeEvent;
125
+ }
126
+
127
+ return [delegation, originalHandler, typeEvent];
128
+ }
129
+
130
+ function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
131
+ if (typeof originalTypeEvent !== 'string' || !element) {
132
+ return;
133
+ }
134
+
135
+ if (!handler) {
136
+ handler = delegationFn;
137
+ delegationFn = null;
138
+ } // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
139
+ // this prevents the handler from being dispatched the same way as mouseover or mouseout does
140
+
141
+
142
+ if (customEventsRegex.test(originalTypeEvent)) {
143
+ const wrapFn = fn => {
144
+ return function (event) {
145
+ if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
146
+ return fn.call(this, event);
147
+ }
148
+ };
149
+ };
150
+
151
+ if (delegationFn) {
152
+ delegationFn = wrapFn(delegationFn);
153
+ } else {
154
+ handler = wrapFn(handler);
155
+ }
156
+ }
157
+
158
+ const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
159
+ const events = getEvent(element);
160
+ const handlers = events[typeEvent] || (events[typeEvent] = {});
161
+ const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
162
+
163
+ if (previousFn) {
164
+ previousFn.oneOff = previousFn.oneOff && oneOff;
165
+ return;
166
+ }
167
+
168
+ const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
169
+ const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
170
+ fn.delegationSelector = delegation ? handler : null;
171
+ fn.originalHandler = originalHandler;
172
+ fn.oneOff = oneOff;
173
+ fn.uidEvent = uid;
174
+ handlers[uid] = fn;
175
+ element.addEventListener(typeEvent, fn, delegation);
176
+ }
177
+
178
+ function removeHandler(element, events, typeEvent, handler, delegationSelector) {
179
+ const fn = findHandler(events[typeEvent], handler, delegationSelector);
180
+
181
+ if (!fn) {
182
+ return;
183
+ }
184
+
185
+ element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
186
+ delete events[typeEvent][fn.uidEvent];
187
+ }
188
+
189
+ function removeNamespacedHandlers(element, events, typeEvent, namespace) {
190
+ const storeElementEvent = events[typeEvent] || {};
191
+ Object.keys(storeElementEvent).forEach(handlerKey => {
192
+ if (handlerKey.includes(namespace)) {
193
+ const event = storeElementEvent[handlerKey];
194
+ removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
195
+ }
196
+ });
197
+ }
198
+
199
+ function getTypeEvent(event) {
200
+ // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
201
+ event = event.replace(stripNameRegex, '');
202
+ return customEvents[event] || event;
203
+ }
204
+
205
+ const EventHandler = {
206
+ on(element, event, handler, delegationFn) {
207
+ addHandler(element, event, handler, delegationFn, false);
208
+ },
209
+
210
+ one(element, event, handler, delegationFn) {
211
+ addHandler(element, event, handler, delegationFn, true);
212
+ },
213
+
214
+ off(element, originalTypeEvent, handler, delegationFn) {
215
+ if (typeof originalTypeEvent !== 'string' || !element) {
216
+ return;
217
+ }
218
+
219
+ const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
220
+ const inNamespace = typeEvent !== originalTypeEvent;
221
+ const events = getEvent(element);
222
+ const isNamespace = originalTypeEvent.startsWith('.');
223
+
224
+ if (typeof originalHandler !== 'undefined') {
225
+ // Simplest case: handler is passed, remove that listener ONLY.
226
+ if (!events || !events[typeEvent]) {
227
+ return;
228
+ }
229
+
230
+ removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
231
+ return;
232
+ }
233
+
234
+ if (isNamespace) {
235
+ Object.keys(events).forEach(elementEvent => {
236
+ removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
237
+ });
238
+ }
239
+
240
+ const storeElementEvent = events[typeEvent] || {};
241
+ Object.keys(storeElementEvent).forEach(keyHandlers => {
242
+ const handlerKey = keyHandlers.replace(stripUidRegex, '');
243
+
244
+ if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
245
+ const event = storeElementEvent[keyHandlers];
246
+ removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
247
+ }
248
+ });
249
+ },
250
+
251
+ trigger(element, event, args) {
252
+ if (typeof event !== 'string' || !element) {
253
+ return null;
254
+ }
255
+
256
+ const $ = getjQuery();
257
+ const typeEvent = getTypeEvent(event);
258
+ const inNamespace = event !== typeEvent;
259
+ const isNative = nativeEvents.has(typeEvent);
260
+ let jQueryEvent;
261
+ let bubbles = true;
262
+ let nativeDispatch = true;
263
+ let defaultPrevented = false;
264
+ let evt = null;
265
+
266
+ if (inNamespace && $) {
267
+ jQueryEvent = $.Event(event, args);
268
+ $(element).trigger(jQueryEvent);
269
+ bubbles = !jQueryEvent.isPropagationStopped();
270
+ nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
271
+ defaultPrevented = jQueryEvent.isDefaultPrevented();
272
+ }
273
+
274
+ if (isNative) {
275
+ evt = document.createEvent('HTMLEvents');
276
+ evt.initEvent(typeEvent, bubbles, true);
277
+ } else {
278
+ evt = new CustomEvent(event, {
279
+ bubbles,
280
+ cancelable: true
281
+ });
282
+ } // merge custom information in our event
283
+
284
+
285
+ if (typeof args !== 'undefined') {
286
+ Object.keys(args).forEach(key => {
287
+ Object.defineProperty(evt, key, {
288
+ get() {
289
+ return args[key];
290
+ }
291
+
292
+ });
293
+ });
294
+ }
295
+
296
+ if (defaultPrevented) {
297
+ evt.preventDefault();
298
+ }
299
+
300
+ if (nativeDispatch) {
301
+ element.dispatchEvent(evt);
302
+ }
303
+
304
+ if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
305
+ jQueryEvent.preventDefault();
306
+ }
307
+
308
+ return evt;
309
+ }
310
+
311
+ };
312
+
313
+ return EventHandler;
314
+
315
+ })));
@@ -0,0 +1,88 @@
1
+ /*!
2
+ * Bootstrap manipulator.js v5.0.1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
+ */
6
+ (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
+ typeof define === 'function' && define.amd ? define(factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Manipulator = factory());
10
+ }(this, (function () { 'use strict';
11
+
12
+ /**
13
+ * --------------------------------------------------------------------------
14
+ * Bootstrap (v5.0.1): dom/manipulator.js
15
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
+ * --------------------------------------------------------------------------
17
+ */
18
+ function normalizeData(val) {
19
+ if (val === 'true') {
20
+ return true;
21
+ }
22
+
23
+ if (val === 'false') {
24
+ return false;
25
+ }
26
+
27
+ if (val === Number(val).toString()) {
28
+ return Number(val);
29
+ }
30
+
31
+ if (val === '' || val === 'null') {
32
+ return null;
33
+ }
34
+
35
+ return val;
36
+ }
37
+
38
+ function normalizeDataKey(key) {
39
+ return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
40
+ }
41
+
42
+ const Manipulator = {
43
+ setDataAttribute(element, key, value) {
44
+ element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
45
+ },
46
+
47
+ removeDataAttribute(element, key) {
48
+ element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
49
+ },
50
+
51
+ getDataAttributes(element) {
52
+ if (!element) {
53
+ return {};
54
+ }
55
+
56
+ const attributes = {};
57
+ Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
58
+ let pureKey = key.replace(/^bs/, '');
59
+ pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
60
+ attributes[pureKey] = normalizeData(element.dataset[key]);
61
+ });
62
+ return attributes;
63
+ },
64
+
65
+ getDataAttribute(element, key) {
66
+ return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
67
+ },
68
+
69
+ offset(element) {
70
+ const rect = element.getBoundingClientRect();
71
+ return {
72
+ top: rect.top + document.body.scrollTop,
73
+ left: rect.left + document.body.scrollLeft
74
+ };
75
+ },
76
+
77
+ position(element) {
78
+ return {
79
+ top: element.offsetTop,
80
+ left: element.offsetLeft
81
+ };
82
+ }
83
+
84
+ };
85
+
86
+ return Manipulator;
87
+
88
+ })));