bootstrap 5.0.0.beta2 → 5.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/javascripts/bootstrap-sprockets.js +1 -0
- data/assets/javascripts/bootstrap.js +2051 -2009
- data/assets/javascripts/bootstrap.min.js +2 -2
- data/assets/javascripts/bootstrap/alert.js +75 -118
- data/assets/javascripts/bootstrap/base-component.js +23 -37
- data/assets/javascripts/bootstrap/button.js +39 -78
- data/assets/javascripts/bootstrap/carousel.js +284 -364
- data/assets/javascripts/bootstrap/collapse.js +178 -247
- data/assets/javascripts/bootstrap/dom/data.js +34 -47
- data/assets/javascripts/bootstrap/dom/event-handler.js +71 -77
- data/assets/javascripts/bootstrap/dom/manipulator.js +23 -21
- data/assets/javascripts/bootstrap/dom/selector-engine.js +20 -28
- data/assets/javascripts/bootstrap/dropdown.js +195 -265
- data/assets/javascripts/bootstrap/modal.js +256 -344
- data/assets/javascripts/bootstrap/offcanvas.js +508 -0
- data/assets/javascripts/bootstrap/popover.js +88 -157
- data/assets/javascripts/bootstrap/scrollspy.js +134 -212
- data/assets/javascripts/bootstrap/tab.js +108 -142
- data/assets/javascripts/bootstrap/toast.js +113 -183
- data/assets/javascripts/bootstrap/tooltip.js +297 -392
- data/assets/stylesheets/_bootstrap-grid.scss +1 -1
- data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
- data/assets/stylesheets/_bootstrap.scss +2 -1
- data/assets/stylesheets/bootstrap/_accordion.scss +22 -32
- data/assets/stylesheets/bootstrap/_buttons.scss +2 -0
- data/assets/stylesheets/bootstrap/_card.scss +1 -1
- data/assets/stylesheets/bootstrap/_dropdown.scss +3 -6
- data/assets/stylesheets/bootstrap/_list-group.scss +11 -0
- data/assets/stylesheets/bootstrap/_modal.scss +2 -0
- data/assets/stylesheets/bootstrap/_nav.scss +7 -0
- data/assets/stylesheets/bootstrap/_navbar.scss +2 -0
- data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
- data/assets/stylesheets/bootstrap/_progress.scss +3 -0
- data/assets/stylesheets/bootstrap/_reboot.scss +7 -21
- data/assets/stylesheets/bootstrap/_spinners.scss +4 -0
- data/assets/stylesheets/bootstrap/_transitions.scss +2 -0
- data/assets/stylesheets/bootstrap/_utilities.scss +65 -37
- data/assets/stylesheets/bootstrap/_variables.scss +138 -30
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +0 -4
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +6 -1
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +11 -1
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -0
- data/bootstrap.gemspec +1 -1
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +1 -1
- data/tasks/updater/network.rb +7 -1
- metadata +6 -4
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap data.js v5.0.0-
|
2
|
+
* Bootstrap data.js v5.0.0-beta3 (https://getbootstrap.com/)
|
3
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
|
*/
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
/**
|
13
13
|
* --------------------------------------------------------------------------
|
14
|
-
* Bootstrap (v5.0.0-
|
14
|
+
* Bootstrap (v5.0.0-beta3): dom/data.js
|
15
15
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
16
16
|
* --------------------------------------------------------------------------
|
17
17
|
*/
|
@@ -21,61 +21,48 @@
|
|
21
21
|
* Constants
|
22
22
|
* ------------------------------------------------------------------------
|
23
23
|
*/
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
element.bsKey = {
|
31
|
-
key: key,
|
32
|
-
id: id
|
33
|
-
};
|
34
|
-
id++;
|
35
|
-
}
|
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
|
+
}
|
36
30
|
|
37
|
-
|
38
|
-
|
39
|
-
get: function get(element, key) {
|
40
|
-
if (!element || typeof element.bsKey === 'undefined') {
|
41
|
-
return null;
|
42
|
-
}
|
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
|
43
33
|
|
44
|
-
|
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
|
+
}
|
45
39
|
|
46
|
-
|
47
|
-
|
48
|
-
}
|
40
|
+
instanceMap.set(key, instance);
|
41
|
+
},
|
49
42
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
return;
|
55
|
-
}
|
43
|
+
get(element, key) {
|
44
|
+
if (elementMap.has(element)) {
|
45
|
+
return elementMap.get(element).get(key) || null;
|
46
|
+
}
|
56
47
|
|
57
|
-
|
48
|
+
return null;
|
49
|
+
},
|
58
50
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
}
|
51
|
+
remove(element, key) {
|
52
|
+
if (!elementMap.has(element)) {
|
53
|
+
return;
|
63
54
|
}
|
64
|
-
};
|
65
|
-
}();
|
66
55
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
},
|
74
|
-
removeData: function removeData(instance, key) {
|
75
|
-
mapData.delete(instance, key);
|
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
|
+
}
|
76
62
|
}
|
63
|
+
|
77
64
|
};
|
78
65
|
|
79
|
-
return
|
66
|
+
return data;
|
80
67
|
|
81
68
|
})));
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap event-handler.js v5.0.0-
|
2
|
+
* Bootstrap event-handler.js v5.0.0-beta3 (https://getbootstrap.com/)
|
3
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
|
*/
|
@@ -11,14 +11,15 @@
|
|
11
11
|
|
12
12
|
/**
|
13
13
|
* --------------------------------------------------------------------------
|
14
|
-
* Bootstrap (v5.0.0-
|
14
|
+
* Bootstrap (v5.0.0-beta3): util/index.js
|
15
15
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
16
16
|
* --------------------------------------------------------------------------
|
17
17
|
*/
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
const getjQuery = () => {
|
20
|
+
const {
|
21
|
+
jQuery
|
22
|
+
} = window;
|
22
23
|
|
23
24
|
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
24
25
|
return jQuery;
|
@@ -27,11 +28,9 @@
|
|
27
28
|
return null;
|
28
29
|
};
|
29
30
|
|
30
|
-
document.documentElement.dir === 'rtl';
|
31
|
-
|
32
31
|
/**
|
33
32
|
* --------------------------------------------------------------------------
|
34
|
-
* Bootstrap (v5.0.0-
|
33
|
+
* Bootstrap (v5.0.0-beta3): dom/event-handler.js
|
35
34
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
36
35
|
* --------------------------------------------------------------------------
|
37
36
|
*/
|
@@ -41,17 +40,17 @@
|
|
41
40
|
* ------------------------------------------------------------------------
|
42
41
|
*/
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
|
44
|
+
const stripNameRegex = /\..*/;
|
45
|
+
const stripUidRegex = /::\d+$/;
|
46
|
+
const eventRegistry = {}; // Events storage
|
48
47
|
|
49
|
-
|
50
|
-
|
48
|
+
let uidEvent = 1;
|
49
|
+
const customEvents = {
|
51
50
|
mouseenter: 'mouseover',
|
52
51
|
mouseleave: 'mouseout'
|
53
52
|
};
|
54
|
-
|
53
|
+
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']);
|
55
54
|
/**
|
56
55
|
* ------------------------------------------------------------------------
|
57
56
|
* Private methods
|
@@ -59,11 +58,11 @@
|
|
59
58
|
*/
|
60
59
|
|
61
60
|
function getUidEvent(element, uid) {
|
62
|
-
return uid && uid
|
61
|
+
return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
|
63
62
|
}
|
64
63
|
|
65
64
|
function getEvent(element) {
|
66
|
-
|
65
|
+
const uid = getUidEvent(element);
|
67
66
|
element.uidEvent = uid;
|
68
67
|
eventRegistry[uid] = eventRegistry[uid] || {};
|
69
68
|
return eventRegistry[uid];
|
@@ -83,10 +82,12 @@
|
|
83
82
|
|
84
83
|
function bootstrapDelegationHandler(element, selector, fn) {
|
85
84
|
return function handler(event) {
|
86
|
-
|
85
|
+
const domElements = element.querySelectorAll(selector);
|
87
86
|
|
88
|
-
for (
|
89
|
-
|
87
|
+
for (let {
|
88
|
+
target
|
89
|
+
} = event; target && target !== this; target = target.parentNode) {
|
90
|
+
for (let i = domElements.length; i--;) {
|
90
91
|
if (domElements[i] === target) {
|
91
92
|
event.delegateTarget = target;
|
92
93
|
|
@@ -105,15 +106,11 @@
|
|
105
106
|
};
|
106
107
|
}
|
107
108
|
|
108
|
-
function findHandler(events, handler, delegationSelector) {
|
109
|
-
|
110
|
-
delegationSelector = null;
|
111
|
-
}
|
112
|
-
|
113
|
-
var uidEventList = Object.keys(events);
|
109
|
+
function findHandler(events, handler, delegationSelector = null) {
|
110
|
+
const uidEventList = Object.keys(events);
|
114
111
|
|
115
|
-
for (
|
116
|
-
|
112
|
+
for (let i = 0, len = uidEventList.length; i < len; i++) {
|
113
|
+
const event = events[uidEventList[i]];
|
117
114
|
|
118
115
|
if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
|
119
116
|
return event;
|
@@ -124,17 +121,17 @@
|
|
124
121
|
}
|
125
122
|
|
126
123
|
function normalizeParams(originalTypeEvent, handler, delegationFn) {
|
127
|
-
|
128
|
-
|
124
|
+
const delegation = typeof handler === 'string';
|
125
|
+
const originalHandler = delegation ? delegationFn : handler; // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
|
129
126
|
|
130
|
-
|
131
|
-
|
127
|
+
let typeEvent = originalTypeEvent.replace(stripNameRegex, '');
|
128
|
+
const custom = customEvents[typeEvent];
|
132
129
|
|
133
130
|
if (custom) {
|
134
131
|
typeEvent = custom;
|
135
132
|
}
|
136
133
|
|
137
|
-
|
134
|
+
const isNative = nativeEvents.has(typeEvent);
|
138
135
|
|
139
136
|
if (!isNative) {
|
140
137
|
typeEvent = originalTypeEvent;
|
@@ -153,22 +150,18 @@
|
|
153
150
|
delegationFn = null;
|
154
151
|
}
|
155
152
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
var events = getEvent(element);
|
162
|
-
var handlers = events[typeEvent] || (events[typeEvent] = {});
|
163
|
-
var previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
|
153
|
+
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
|
154
|
+
const events = getEvent(element);
|
155
|
+
const handlers = events[typeEvent] || (events[typeEvent] = {});
|
156
|
+
const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
|
164
157
|
|
165
158
|
if (previousFn) {
|
166
159
|
previousFn.oneOff = previousFn.oneOff && oneOff;
|
167
160
|
return;
|
168
161
|
}
|
169
162
|
|
170
|
-
|
171
|
-
|
163
|
+
const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
|
164
|
+
const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
|
172
165
|
fn.delegationSelector = delegation ? handler : null;
|
173
166
|
fn.originalHandler = originalHandler;
|
174
167
|
fn.oneOff = oneOff;
|
@@ -178,7 +171,7 @@
|
|
178
171
|
}
|
179
172
|
|
180
173
|
function removeHandler(element, events, typeEvent, handler, delegationSelector) {
|
181
|
-
|
174
|
+
const fn = findHandler(events[typeEvent], handler, delegationSelector);
|
182
175
|
|
183
176
|
if (!fn) {
|
184
177
|
return;
|
@@ -189,35 +182,33 @@
|
|
189
182
|
}
|
190
183
|
|
191
184
|
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
|
192
|
-
|
193
|
-
Object.keys(storeElementEvent).forEach(
|
185
|
+
const storeElementEvent = events[typeEvent] || {};
|
186
|
+
Object.keys(storeElementEvent).forEach(handlerKey => {
|
194
187
|
if (handlerKey.includes(namespace)) {
|
195
|
-
|
188
|
+
const event = storeElementEvent[handlerKey];
|
196
189
|
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
|
197
190
|
}
|
198
191
|
});
|
199
192
|
}
|
200
193
|
|
201
|
-
|
202
|
-
on
|
194
|
+
const EventHandler = {
|
195
|
+
on(element, event, handler, delegationFn) {
|
203
196
|
addHandler(element, event, handler, delegationFn, false);
|
204
197
|
},
|
205
|
-
|
198
|
+
|
199
|
+
one(element, event, handler, delegationFn) {
|
206
200
|
addHandler(element, event, handler, delegationFn, true);
|
207
201
|
},
|
208
|
-
|
202
|
+
|
203
|
+
off(element, originalTypeEvent, handler, delegationFn) {
|
209
204
|
if (typeof originalTypeEvent !== 'string' || !element) {
|
210
205
|
return;
|
211
206
|
}
|
212
207
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
var inNamespace = typeEvent !== originalTypeEvent;
|
219
|
-
var events = getEvent(element);
|
220
|
-
var isNamespace = originalTypeEvent.startsWith('.');
|
208
|
+
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
|
209
|
+
const inNamespace = typeEvent !== originalTypeEvent;
|
210
|
+
const events = getEvent(element);
|
211
|
+
const isNamespace = originalTypeEvent.startsWith('.');
|
221
212
|
|
222
213
|
if (typeof originalHandler !== 'undefined') {
|
223
214
|
// Simplest case: handler is passed, remove that listener ONLY.
|
@@ -230,35 +221,36 @@
|
|
230
221
|
}
|
231
222
|
|
232
223
|
if (isNamespace) {
|
233
|
-
Object.keys(events).forEach(
|
224
|
+
Object.keys(events).forEach(elementEvent => {
|
234
225
|
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
|
235
226
|
});
|
236
227
|
}
|
237
228
|
|
238
|
-
|
239
|
-
Object.keys(storeElementEvent).forEach(
|
240
|
-
|
229
|
+
const storeElementEvent = events[typeEvent] || {};
|
230
|
+
Object.keys(storeElementEvent).forEach(keyHandlers => {
|
231
|
+
const handlerKey = keyHandlers.replace(stripUidRegex, '');
|
241
232
|
|
242
233
|
if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
|
243
|
-
|
234
|
+
const event = storeElementEvent[keyHandlers];
|
244
235
|
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
|
245
236
|
}
|
246
237
|
});
|
247
238
|
},
|
248
|
-
|
239
|
+
|
240
|
+
trigger(element, event, args) {
|
249
241
|
if (typeof event !== 'string' || !element) {
|
250
242
|
return null;
|
251
243
|
}
|
252
244
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
245
|
+
const $ = getjQuery();
|
246
|
+
const typeEvent = event.replace(stripNameRegex, '');
|
247
|
+
const inNamespace = event !== typeEvent;
|
248
|
+
const isNative = nativeEvents.has(typeEvent);
|
249
|
+
let jQueryEvent;
|
250
|
+
let bubbles = true;
|
251
|
+
let nativeDispatch = true;
|
252
|
+
let defaultPrevented = false;
|
253
|
+
let evt = null;
|
262
254
|
|
263
255
|
if (inNamespace && $) {
|
264
256
|
jQueryEvent = $.Event(event, args);
|
@@ -273,18 +265,19 @@
|
|
273
265
|
evt.initEvent(typeEvent, bubbles, true);
|
274
266
|
} else {
|
275
267
|
evt = new CustomEvent(event, {
|
276
|
-
bubbles
|
268
|
+
bubbles,
|
277
269
|
cancelable: true
|
278
270
|
});
|
279
271
|
} // merge custom information in our event
|
280
272
|
|
281
273
|
|
282
274
|
if (typeof args !== 'undefined') {
|
283
|
-
Object.keys(args).forEach(
|
275
|
+
Object.keys(args).forEach(key => {
|
284
276
|
Object.defineProperty(evt, key, {
|
285
|
-
get
|
277
|
+
get() {
|
286
278
|
return args[key];
|
287
279
|
}
|
280
|
+
|
288
281
|
});
|
289
282
|
});
|
290
283
|
}
|
@@ -303,6 +296,7 @@
|
|
303
296
|
|
304
297
|
return evt;
|
305
298
|
}
|
299
|
+
|
306
300
|
};
|
307
301
|
|
308
302
|
return EventHandler;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap manipulator.js v5.0.0-
|
2
|
+
* Bootstrap manipulator.js v5.0.0-beta3 (https://getbootstrap.com/)
|
3
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
|
*/
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
/**
|
13
13
|
* --------------------------------------------------------------------------
|
14
|
-
* Bootstrap (v5.0.0-
|
14
|
+
* Bootstrap (v5.0.0-beta3): dom/manipulator.js
|
15
15
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
16
16
|
* --------------------------------------------------------------------------
|
17
17
|
*/
|
@@ -36,49 +36,51 @@
|
|
36
36
|
}
|
37
37
|
|
38
38
|
function normalizeDataKey(key) {
|
39
|
-
return key.replace(/[A-Z]/g,
|
40
|
-
return "-" + chr.toLowerCase();
|
41
|
-
});
|
39
|
+
return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
|
42
40
|
}
|
43
41
|
|
44
|
-
|
45
|
-
setDataAttribute
|
46
|
-
element.setAttribute(
|
42
|
+
const Manipulator = {
|
43
|
+
setDataAttribute(element, key, value) {
|
44
|
+
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
|
47
45
|
},
|
48
|
-
|
49
|
-
|
46
|
+
|
47
|
+
removeDataAttribute(element, key) {
|
48
|
+
element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
|
50
49
|
},
|
51
|
-
|
50
|
+
|
51
|
+
getDataAttributes(element) {
|
52
52
|
if (!element) {
|
53
53
|
return {};
|
54
54
|
}
|
55
55
|
|
56
|
-
|
57
|
-
Object.keys(element.dataset).filter(
|
58
|
-
|
59
|
-
}).forEach(function (key) {
|
60
|
-
var pureKey = key.replace(/^bs/, '');
|
56
|
+
const attributes = {};
|
57
|
+
Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
|
58
|
+
let pureKey = key.replace(/^bs/, '');
|
61
59
|
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
|
62
60
|
attributes[pureKey] = normalizeData(element.dataset[key]);
|
63
61
|
});
|
64
62
|
return attributes;
|
65
63
|
},
|
66
|
-
|
67
|
-
|
64
|
+
|
65
|
+
getDataAttribute(element, key) {
|
66
|
+
return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
|
68
67
|
},
|
69
|
-
|
70
|
-
|
68
|
+
|
69
|
+
offset(element) {
|
70
|
+
const rect = element.getBoundingClientRect();
|
71
71
|
return {
|
72
72
|
top: rect.top + document.body.scrollTop,
|
73
73
|
left: rect.left + document.body.scrollLeft
|
74
74
|
};
|
75
75
|
},
|
76
|
-
|
76
|
+
|
77
|
+
position(element) {
|
77
78
|
return {
|
78
79
|
top: element.offsetTop,
|
79
80
|
left: element.offsetLeft
|
80
81
|
};
|
81
82
|
}
|
83
|
+
|
82
84
|
};
|
83
85
|
|
84
86
|
return Manipulator;
|