bootstrap 4.5.3 → 5.2.3
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +55 -0
- data/README.md +28 -5
- data/assets/javascripts/bootstrap/alert.js +54 -133
- data/assets/javascripts/bootstrap/base-component.js +99 -0
- data/assets/javascripts/bootstrap/button.js +44 -183
- data/assets/javascripts/bootstrap/carousel.js +308 -450
- data/assets/javascripts/bootstrap/collapse.js +180 -243
- data/assets/javascripts/bootstrap/dom/data.js +66 -0
- data/assets/javascripts/bootstrap/dom/event-handler.js +283 -0
- data/assets/javascripts/bootstrap/dom/manipulator.js +84 -0
- data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
- data/assets/javascripts/bootstrap/dropdown.js +320 -387
- data/assets/javascripts/bootstrap/modal.js +238 -478
- data/assets/javascripts/bootstrap/offcanvas.js +297 -0
- data/assets/javascripts/bootstrap/popover.js +58 -163
- data/assets/javascripts/bootstrap/scrollspy.js +223 -228
- data/assets/javascripts/bootstrap/tab.js +251 -166
- data/assets/javascripts/bootstrap/toast.js +147 -149
- data/assets/javascripts/bootstrap/tooltip.js +434 -646
- data/assets/javascripts/bootstrap/util/backdrop.js +165 -0
- data/assets/javascripts/bootstrap/util/component-functions.js +46 -0
- data/assets/javascripts/bootstrap/util/config.js +79 -0
- data/assets/javascripts/bootstrap/util/focustrap.js +129 -0
- data/assets/javascripts/bootstrap/util/index.js +350 -0
- data/assets/javascripts/bootstrap/util/sanitizer.js +122 -0
- data/assets/javascripts/bootstrap/util/scrollbar.js +138 -0
- data/assets/javascripts/bootstrap/util/swipe.js +155 -0
- data/assets/javascripts/bootstrap/util/template-factory.js +177 -0
- data/assets/javascripts/bootstrap-global-this-define.js +6 -0
- data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
- data/assets/javascripts/bootstrap-sprockets.js +24 -8
- data/assets/javascripts/bootstrap.js +4037 -3206
- data/assets/javascripts/bootstrap.min.js +3 -3
- data/assets/stylesheets/_bootstrap-grid.scss +56 -21
- data/assets/stylesheets/_bootstrap-reboot.scss +4 -7
- data/assets/stylesheets/_bootstrap.scss +20 -13
- data/assets/stylesheets/bootstrap/_accordion.scss +149 -0
- data/assets/stylesheets/bootstrap/_alert.scss +33 -14
- data/assets/stylesheets/bootstrap/_badge.scss +15 -31
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +23 -27
- data/assets/stylesheets/bootstrap/_button-group.scss +25 -46
- data/assets/stylesheets/bootstrap/_buttons.scss +136 -71
- data/assets/stylesheets/bootstrap/_card.scss +61 -113
- data/assets/stylesheets/bootstrap/_carousel.scss +64 -35
- data/assets/stylesheets/bootstrap/_close.scss +30 -30
- data/assets/stylesheets/bootstrap/_containers.scss +41 -0
- data/assets/stylesheets/bootstrap/_dropdown.scss +128 -71
- data/assets/stylesheets/bootstrap/_forms.scss +9 -347
- data/assets/stylesheets/bootstrap/_functions.scss +181 -23
- data/assets/stylesheets/bootstrap/_grid.scss +13 -53
- data/assets/stylesheets/bootstrap/_helpers.scss +10 -0
- data/assets/stylesheets/bootstrap/_images.scss +1 -1
- data/assets/stylesheets/bootstrap/_list-group.scss +72 -34
- data/assets/stylesheets/bootstrap/_maps.scss +54 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +9 -13
- data/assets/stylesheets/bootstrap/_modal.scss +107 -110
- data/assets/stylesheets/bootstrap/_nav.scss +72 -23
- data/assets/stylesheets/bootstrap/_navbar.scss +127 -173
- data/assets/stylesheets/bootstrap/_offcanvas.scss +144 -0
- data/assets/stylesheets/bootstrap/_pagination.scss +72 -37
- data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
- data/assets/stylesheets/bootstrap/_popover.scss +99 -73
- data/assets/stylesheets/bootstrap/_progress.scss +26 -14
- data/assets/stylesheets/bootstrap/_reboot.scss +326 -200
- data/assets/stylesheets/bootstrap/_root.scss +62 -9
- data/assets/stylesheets/bootstrap/_spinners.scss +51 -22
- data/assets/stylesheets/bootstrap/_tables.scss +94 -115
- data/assets/stylesheets/bootstrap/_toasts.scss +54 -27
- data/assets/stylesheets/bootstrap/_tooltip.scss +68 -63
- data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
- data/assets/stylesheets/bootstrap/_type.scss +40 -59
- data/assets/stylesheets/bootstrap/_utilities.scss +647 -18
- data/assets/stylesheets/bootstrap/_variables.scss +1018 -526
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +75 -0
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +175 -0
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +194 -0
- data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +71 -0
- data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
- data/assets/stylesheets/bootstrap/forms/_input-group.scss +132 -0
- data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
- data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
- data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +10 -0
- data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
- data/assets/stylesheets/bootstrap/helpers/_position.scss +36 -0
- data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
- data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
- data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
- data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
- data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
- data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +8 -6
- data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
- data/assets/stylesheets/bootstrap/mixins/_banner.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
- data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +20 -16
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +60 -100
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +48 -74
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +119 -37
- data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
- data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +7 -19
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +24 -0
- data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_utilities.scss +97 -0
- data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
- data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +278 -128
- data/bootstrap.gemspec +3 -5
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +31 -7
- data/tasks/updater/network.rb +9 -3
- data/tasks/updater.rb +2 -2
- data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
- data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
- data/test/dummy_rails/app/views/pages/root.html +89 -0
- data/test/dummy_rails/config/application.rb +0 -3
- data/test/gemfiles/rails_5_2.gemfile +8 -0
- data/test/gemfiles/rails_6_1.gemfile +7 -0
- data/test/gemfiles/rails_7_0.gemfile +7 -0
- data/test/test_helper.rb +3 -2
- metadata +70 -78
- data/.travis.yml +0 -31
- data/assets/javascripts/bootstrap/util.js +0 -192
- data/assets/stylesheets/bootstrap/_code.scss +0 -48
- data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -524
- data/assets/stylesheets/bootstrap/_input-group.scss +0 -192
- data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
- data/assets/stylesheets/bootstrap/_media.scss +0 -8
- data/assets/stylesheets/bootstrap/_print.scss +0 -141
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
- data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
- data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
- data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
- data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
- data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
- data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
- data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
- data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
- data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
- data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
- data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
- data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
- data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
- data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
- data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
- data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
- data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
- data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
- data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
- data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
- data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
- data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
- data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
- data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
- data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
- data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
- data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
- /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Bootstrap event-handler.js v5.2.3 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2022 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(require('../util/index')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['../util/index'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory(global.Index));
|
|
10
|
+
})(this, (function (index) { 'use strict';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* --------------------------------------------------------------------------
|
|
14
|
+
* Bootstrap (v5.2.3): dom/event-handler.js
|
|
15
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
16
|
+
* --------------------------------------------------------------------------
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Constants
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
|
|
23
|
+
const stripNameRegex = /\..*/;
|
|
24
|
+
const stripUidRegex = /::\d+$/;
|
|
25
|
+
const eventRegistry = {}; // Events storage
|
|
26
|
+
|
|
27
|
+
let uidEvent = 1;
|
|
28
|
+
const customEvents = {
|
|
29
|
+
mouseenter: 'mouseover',
|
|
30
|
+
mouseleave: 'mouseout'
|
|
31
|
+
};
|
|
32
|
+
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']);
|
|
33
|
+
/**
|
|
34
|
+
* Private methods
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
function makeEventUid(element, uid) {
|
|
38
|
+
return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getElementEvents(element) {
|
|
42
|
+
const uid = makeEventUid(element);
|
|
43
|
+
element.uidEvent = uid;
|
|
44
|
+
eventRegistry[uid] = eventRegistry[uid] || {};
|
|
45
|
+
return eventRegistry[uid];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function bootstrapHandler(element, fn) {
|
|
49
|
+
return function handler(event) {
|
|
50
|
+
hydrateObj(event, {
|
|
51
|
+
delegateTarget: element
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (handler.oneOff) {
|
|
55
|
+
EventHandler.off(element, event.type, fn);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return fn.apply(element, [event]);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function bootstrapDelegationHandler(element, selector, fn) {
|
|
63
|
+
return function handler(event) {
|
|
64
|
+
const domElements = element.querySelectorAll(selector);
|
|
65
|
+
|
|
66
|
+
for (let {
|
|
67
|
+
target
|
|
68
|
+
} = event; target && target !== this; target = target.parentNode) {
|
|
69
|
+
for (const domElement of domElements) {
|
|
70
|
+
if (domElement !== target) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
hydrateObj(event, {
|
|
75
|
+
delegateTarget: target
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (handler.oneOff) {
|
|
79
|
+
EventHandler.off(element, event.type, selector, fn);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return fn.apply(target, [event]);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function findHandler(events, callable, delegationSelector = null) {
|
|
89
|
+
return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
|
93
|
+
const isDelegated = typeof handler === 'string'; // todo: tooltip passes `false` instead of selector, so we need to check
|
|
94
|
+
|
|
95
|
+
const callable = isDelegated ? delegationFunction : handler || delegationFunction;
|
|
96
|
+
let typeEvent = getTypeEvent(originalTypeEvent);
|
|
97
|
+
|
|
98
|
+
if (!nativeEvents.has(typeEvent)) {
|
|
99
|
+
typeEvent = originalTypeEvent;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return [isDelegated, callable, typeEvent];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {
|
|
106
|
+
if (typeof originalTypeEvent !== 'string' || !element) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
|
|
111
|
+
// this prevents the handler from being dispatched the same way as mouseover or mouseout does
|
|
112
|
+
|
|
113
|
+
if (originalTypeEvent in customEvents) {
|
|
114
|
+
const wrapFunction = fn => {
|
|
115
|
+
return function (event) {
|
|
116
|
+
if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
|
|
117
|
+
return fn.call(this, event);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
callable = wrapFunction(callable);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const events = getElementEvents(element);
|
|
126
|
+
const handlers = events[typeEvent] || (events[typeEvent] = {});
|
|
127
|
+
const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);
|
|
128
|
+
|
|
129
|
+
if (previousFunction) {
|
|
130
|
+
previousFunction.oneOff = previousFunction.oneOff && oneOff;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));
|
|
135
|
+
const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);
|
|
136
|
+
fn.delegationSelector = isDelegated ? handler : null;
|
|
137
|
+
fn.callable = callable;
|
|
138
|
+
fn.oneOff = oneOff;
|
|
139
|
+
fn.uidEvent = uid;
|
|
140
|
+
handlers[uid] = fn;
|
|
141
|
+
element.addEventListener(typeEvent, fn, isDelegated);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function removeHandler(element, events, typeEvent, handler, delegationSelector) {
|
|
145
|
+
const fn = findHandler(events[typeEvent], handler, delegationSelector);
|
|
146
|
+
|
|
147
|
+
if (!fn) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
|
|
152
|
+
delete events[typeEvent][fn.uidEvent];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
|
|
156
|
+
const storeElementEvent = events[typeEvent] || {};
|
|
157
|
+
|
|
158
|
+
for (const handlerKey of Object.keys(storeElementEvent)) {
|
|
159
|
+
if (handlerKey.includes(namespace)) {
|
|
160
|
+
const event = storeElementEvent[handlerKey];
|
|
161
|
+
removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function getTypeEvent(event) {
|
|
167
|
+
// allow to get the native events from namespaced events ('click.bs.button' --> 'click')
|
|
168
|
+
event = event.replace(stripNameRegex, '');
|
|
169
|
+
return customEvents[event] || event;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const EventHandler = {
|
|
173
|
+
on(element, event, handler, delegationFunction) {
|
|
174
|
+
addHandler(element, event, handler, delegationFunction, false);
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
one(element, event, handler, delegationFunction) {
|
|
178
|
+
addHandler(element, event, handler, delegationFunction, true);
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
off(element, originalTypeEvent, handler, delegationFunction) {
|
|
182
|
+
if (typeof originalTypeEvent !== 'string' || !element) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
|
|
187
|
+
const inNamespace = typeEvent !== originalTypeEvent;
|
|
188
|
+
const events = getElementEvents(element);
|
|
189
|
+
const storeElementEvent = events[typeEvent] || {};
|
|
190
|
+
const isNamespace = originalTypeEvent.startsWith('.');
|
|
191
|
+
|
|
192
|
+
if (typeof callable !== 'undefined') {
|
|
193
|
+
// Simplest case: handler is passed, remove that listener ONLY.
|
|
194
|
+
if (!Object.keys(storeElementEvent).length) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (isNamespace) {
|
|
203
|
+
for (const elementEvent of Object.keys(events)) {
|
|
204
|
+
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
for (const keyHandlers of Object.keys(storeElementEvent)) {
|
|
209
|
+
const handlerKey = keyHandlers.replace(stripUidRegex, '');
|
|
210
|
+
|
|
211
|
+
if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
|
|
212
|
+
const event = storeElementEvent[keyHandlers];
|
|
213
|
+
removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
trigger(element, event, args) {
|
|
219
|
+
if (typeof event !== 'string' || !element) {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const $ = index.getjQuery();
|
|
224
|
+
const typeEvent = getTypeEvent(event);
|
|
225
|
+
const inNamespace = event !== typeEvent;
|
|
226
|
+
let jQueryEvent = null;
|
|
227
|
+
let bubbles = true;
|
|
228
|
+
let nativeDispatch = true;
|
|
229
|
+
let defaultPrevented = false;
|
|
230
|
+
|
|
231
|
+
if (inNamespace && $) {
|
|
232
|
+
jQueryEvent = $.Event(event, args);
|
|
233
|
+
$(element).trigger(jQueryEvent);
|
|
234
|
+
bubbles = !jQueryEvent.isPropagationStopped();
|
|
235
|
+
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
|
|
236
|
+
defaultPrevented = jQueryEvent.isDefaultPrevented();
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
let evt = new Event(event, {
|
|
240
|
+
bubbles,
|
|
241
|
+
cancelable: true
|
|
242
|
+
});
|
|
243
|
+
evt = hydrateObj(evt, args);
|
|
244
|
+
|
|
245
|
+
if (defaultPrevented) {
|
|
246
|
+
evt.preventDefault();
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (nativeDispatch) {
|
|
250
|
+
element.dispatchEvent(evt);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (evt.defaultPrevented && jQueryEvent) {
|
|
254
|
+
jQueryEvent.preventDefault();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return evt;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
function hydrateObj(obj, meta) {
|
|
263
|
+
for (const [key, value] of Object.entries(meta || {})) {
|
|
264
|
+
try {
|
|
265
|
+
obj[key] = value;
|
|
266
|
+
} catch (_unused) {
|
|
267
|
+
Object.defineProperty(obj, key, {
|
|
268
|
+
configurable: true,
|
|
269
|
+
|
|
270
|
+
get() {
|
|
271
|
+
return value;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return obj;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return EventHandler;
|
|
282
|
+
|
|
283
|
+
}));
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Bootstrap manipulator.js v5.2.3 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2022 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.2.3): dom/manipulator.js
|
|
15
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
16
|
+
* --------------------------------------------------------------------------
|
|
17
|
+
*/
|
|
18
|
+
function normalizeData(value) {
|
|
19
|
+
if (value === 'true') {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (value === 'false') {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (value === Number(value).toString()) {
|
|
28
|
+
return Number(value);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (value === '' || value === 'null') {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (typeof value !== 'string') {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(decodeURIComponent(value));
|
|
41
|
+
} catch (_unused) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function normalizeDataKey(key) {
|
|
47
|
+
return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const Manipulator = {
|
|
51
|
+
setDataAttribute(element, key, value) {
|
|
52
|
+
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
removeDataAttribute(element, key) {
|
|
56
|
+
element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
getDataAttributes(element) {
|
|
60
|
+
if (!element) {
|
|
61
|
+
return {};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const attributes = {};
|
|
65
|
+
const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));
|
|
66
|
+
|
|
67
|
+
for (const key of bsKeys) {
|
|
68
|
+
let pureKey = key.replace(/^bs/, '');
|
|
69
|
+
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
|
|
70
|
+
attributes[pureKey] = normalizeData(element.dataset[key]);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return attributes;
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
getDataAttribute(element, key) {
|
|
77
|
+
return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return Manipulator;
|
|
83
|
+
|
|
84
|
+
}));
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Bootstrap selector-engine.js v5.2.3 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2022 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(require('../util/index')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['../util/index'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory(global.Index));
|
|
10
|
+
})(this, (function (index) { 'use strict';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* --------------------------------------------------------------------------
|
|
14
|
+
* Bootstrap (v5.2.3): dom/selector-engine.js
|
|
15
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
16
|
+
* --------------------------------------------------------------------------
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Constants
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const SelectorEngine = {
|
|
23
|
+
find(selector, element = document.documentElement) {
|
|
24
|
+
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
findOne(selector, element = document.documentElement) {
|
|
28
|
+
return Element.prototype.querySelector.call(element, selector);
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
children(element, selector) {
|
|
32
|
+
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
parents(element, selector) {
|
|
36
|
+
const parents = [];
|
|
37
|
+
let ancestor = element.parentNode.closest(selector);
|
|
38
|
+
|
|
39
|
+
while (ancestor) {
|
|
40
|
+
parents.push(ancestor);
|
|
41
|
+
ancestor = ancestor.parentNode.closest(selector);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return parents;
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
prev(element, selector) {
|
|
48
|
+
let previous = element.previousElementSibling;
|
|
49
|
+
|
|
50
|
+
while (previous) {
|
|
51
|
+
if (previous.matches(selector)) {
|
|
52
|
+
return [previous];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
previous = previous.previousElementSibling;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return [];
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
// TODO: this is now unused; remove later along with prev()
|
|
62
|
+
next(element, selector) {
|
|
63
|
+
let next = element.nextElementSibling;
|
|
64
|
+
|
|
65
|
+
while (next) {
|
|
66
|
+
if (next.matches(selector)) {
|
|
67
|
+
return [next];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
next = next.nextElementSibling;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return [];
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
focusableChildren(element) {
|
|
77
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
|
|
78
|
+
return this.find(focusables, element).filter(el => !index.isDisabled(el) && index.isVisible(el));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return SelectorEngine;
|
|
84
|
+
|
|
85
|
+
}));
|