@openeuropa/bcl-bootstrap 0.14.0 → 0.18.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 (81) hide show
  1. package/bin/build-plugins.js +77 -160
  2. package/bootstrap-icons.js +211 -1
  3. package/js/dist/alert.js +6 -137
  4. package/js/dist/alert.js.map +1 -1
  5. package/js/dist/base-component.js +7 -109
  6. package/js/dist/base-component.js.map +1 -1
  7. package/js/dist/button.js +5 -65
  8. package/js/dist/button.js.map +1 -1
  9. package/js/dist/carousel.js +13 -190
  10. package/js/dist/carousel.js.map +1 -1
  11. package/js/dist/collapse.js +12 -170
  12. package/js/dist/collapse.js.map +1 -1
  13. package/js/dist/dom/data.js +0 -5
  14. package/js/dist/dom/data.js.map +1 -1
  15. package/js/dist/dom/event-handler.js +5 -29
  16. package/js/dist/dom/event-handler.js.map +1 -1
  17. package/js/dist/dom/manipulator.js +0 -5
  18. package/js/dist/dom/manipulator.js.map +1 -1
  19. package/js/dist/dom/selector-engine.js +5 -53
  20. package/js/dist/dom/selector-engine.js.map +1 -1
  21. package/js/dist/dropdown.js +23 -212
  22. package/js/dist/dropdown.js.map +1 -1
  23. package/js/dist/modal.js +18 -611
  24. package/js/dist/modal.js.map +1 -1
  25. package/js/dist/offcanvas.js +19 -610
  26. package/js/dist/offcanvas.js.map +1 -1
  27. package/js/dist/popover.js +5 -65
  28. package/js/dist/popover.js.map +1 -1
  29. package/js/dist/scrollspy.js +8 -147
  30. package/js/dist/scrollspy.js.map +1 -1
  31. package/js/dist/tab.js +8 -127
  32. package/js/dist/tab.js.map +1 -1
  33. package/js/dist/toast.js +8 -185
  34. package/js/dist/toast.js.map +1 -1
  35. package/js/dist/tooltip.js +18 -277
  36. package/js/dist/tooltip.js.map +1 -1
  37. package/js/dist/util/backdrop.js +138 -0
  38. package/js/dist/util/backdrop.js.map +1 -0
  39. package/js/dist/util/component-functions.js +42 -0
  40. package/js/dist/util/component-functions.js.map +1 -0
  41. package/js/dist/util/focustrap.js +118 -0
  42. package/js/dist/util/focustrap.js.map +1 -0
  43. package/js/dist/util/index.js +342 -0
  44. package/js/dist/util/index.js.map +1 -0
  45. package/js/dist/util/sanitizer.js +125 -0
  46. package/js/dist/util/sanitizer.js.map +1 -0
  47. package/js/dist/util/scrollbar.js +119 -0
  48. package/js/dist/util/scrollbar.js.map +1 -0
  49. package/package.json +4 -3
  50. package/plugins/alert.js +0 -230
  51. package/plugins/alert.js.map +0 -1
  52. package/plugins/base-component.js +0 -178
  53. package/plugins/base-component.js.map +0 -1
  54. package/plugins/button.js +0 -141
  55. package/plugins/button.js.map +0 -1
  56. package/plugins/carousel.js +0 -738
  57. package/plugins/carousel.js.map +0 -1
  58. package/plugins/collapse.js +0 -490
  59. package/plugins/collapse.js.map +0 -1
  60. package/plugins/dom/data.js +0 -64
  61. package/plugins/dom/data.js.map +0 -1
  62. package/plugins/dom/event-handler.js +0 -317
  63. package/plugins/dom/event-handler.js.map +0 -1
  64. package/plugins/dom/manipulator.js +0 -84
  65. package/plugins/dom/manipulator.js.map +0 -1
  66. package/plugins/dom/selector-engine.js +0 -123
  67. package/plugins/dom/selector-engine.js.map +0 -1
  68. package/plugins/dropdown.js +0 -682
  69. package/plugins/dropdown.js.map +0 -1
  70. package/plugins/modal.js +0 -1037
  71. package/plugins/modal.js.map +0 -1
  72. package/plugins/popover.js +0 -179
  73. package/plugins/popover.js.map +0 -1
  74. package/plugins/scrollspy.js +0 -386
  75. package/plugins/scrollspy.js.map +0 -1
  76. package/plugins/tab.js +0 -328
  77. package/plugins/tab.js.map +0 -1
  78. package/plugins/toast.js +0 -418
  79. package/plugins/toast.js.map +0 -1
  80. package/plugins/tooltip.js +0 -1001
  81. package/plugins/tooltip.js.map +0 -1
package/js/dist/modal.js CHANGED
@@ -1,611 +1,18 @@
1
- /*!
2
- * Bootstrap modal.js v5.1.3 (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
1
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
8
- typeof define === 'function' && define.amd ? define(['./dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
10
- })(this, (function (EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index'), require('./dom/event-handler'), require('./dom/manipulator'), require('./dom/selector-engine'), require('./util/scrollbar'), require('./base-component'), require('./util/backdrop'), require('./util/focustrap'), require('./util/component-functions')) :
3
+ typeof define === 'function' && define.amd ? define(['./util/index', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './util/scrollbar', './base-component', './util/backdrop', './util/focustrap', './util/component-functions'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.Index, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Scrollbar, global.BaseComponent, global.Backdrop, global.Focustrap, global.ComponentFunctions));
5
+ })(this, (function (index, EventHandler, Manipulator, SelectorEngine, ScrollBarHelper, BaseComponent, Backdrop, FocusTrap, componentFunctions) { 'use strict';
11
6
 
12
7
  const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
13
8
 
14
9
  const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
15
10
  const Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
16
11
  const SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
12
+ const ScrollBarHelper__default = /*#__PURE__*/_interopDefaultLegacy(ScrollBarHelper);
17
13
  const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
18
-
19
- /**
20
- * --------------------------------------------------------------------------
21
- * Bootstrap (v5.1.3): util/index.js
22
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
23
- * --------------------------------------------------------------------------
24
- */
25
- const MILLISECONDS_MULTIPLIER = 1000;
26
- const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
27
-
28
- const toType = obj => {
29
- if (obj === null || obj === undefined) {
30
- return `${obj}`;
31
- }
32
-
33
- return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
34
- };
35
-
36
- const getSelector = element => {
37
- let selector = element.getAttribute('data-bs-target');
38
-
39
- if (!selector || selector === '#') {
40
- let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
41
- // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
42
- // `document.querySelector` will rightfully complain it is invalid.
43
- // See https://github.com/twbs/bootstrap/issues/32273
44
-
45
- if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
46
- return null;
47
- } // Just in case some CMS puts out a full URL with the anchor appended
48
-
49
-
50
- if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
51
- hrefAttr = `#${hrefAttr.split('#')[1]}`;
52
- }
53
-
54
- selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
55
- }
56
-
57
- return selector;
58
- };
59
-
60
- const getElementFromSelector = element => {
61
- const selector = getSelector(element);
62
- return selector ? document.querySelector(selector) : null;
63
- };
64
-
65
- const getTransitionDurationFromElement = element => {
66
- if (!element) {
67
- return 0;
68
- } // Get transition-duration of the element
69
-
70
-
71
- let {
72
- transitionDuration,
73
- transitionDelay
74
- } = window.getComputedStyle(element);
75
- const floatTransitionDuration = Number.parseFloat(transitionDuration);
76
- const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
77
-
78
- if (!floatTransitionDuration && !floatTransitionDelay) {
79
- return 0;
80
- } // If multiple durations are defined, take the first
81
-
82
-
83
- transitionDuration = transitionDuration.split(',')[0];
84
- transitionDelay = transitionDelay.split(',')[0];
85
- return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
86
- };
87
-
88
- const triggerTransitionEnd = element => {
89
- element.dispatchEvent(new Event(TRANSITION_END));
90
- };
91
-
92
- const isElement = obj => {
93
- if (!obj || typeof obj !== 'object') {
94
- return false;
95
- }
96
-
97
- if (typeof obj.jquery !== 'undefined') {
98
- obj = obj[0];
99
- }
100
-
101
- return typeof obj.nodeType !== 'undefined';
102
- };
103
-
104
- const getElement = obj => {
105
- if (isElement(obj)) {
106
- // it's a jQuery object or a node element
107
- return obj.jquery ? obj[0] : obj;
108
- }
109
-
110
- if (typeof obj === 'string' && obj.length > 0) {
111
- return document.querySelector(obj);
112
- }
113
-
114
- return null;
115
- };
116
-
117
- const typeCheckConfig = (componentName, config, configTypes) => {
118
- Object.keys(configTypes).forEach(property => {
119
- const expectedTypes = configTypes[property];
120
- const value = config[property];
121
- const valueType = value && isElement(value) ? 'element' : toType(value);
122
-
123
- if (!new RegExp(expectedTypes).test(valueType)) {
124
- throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
125
- }
126
- });
127
- };
128
-
129
- const isVisible = element => {
130
- if (!isElement(element) || element.getClientRects().length === 0) {
131
- return false;
132
- }
133
-
134
- return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
135
- };
136
-
137
- const isDisabled = element => {
138
- if (!element || element.nodeType !== Node.ELEMENT_NODE) {
139
- return true;
140
- }
141
-
142
- if (element.classList.contains('disabled')) {
143
- return true;
144
- }
145
-
146
- if (typeof element.disabled !== 'undefined') {
147
- return element.disabled;
148
- }
149
-
150
- return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
151
- };
152
- /**
153
- * Trick to restart an element's animation
154
- *
155
- * @param {HTMLElement} element
156
- * @return void
157
- *
158
- * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
159
- */
160
-
161
-
162
- const reflow = element => {
163
- // eslint-disable-next-line no-unused-expressions
164
- element.offsetHeight;
165
- };
166
-
167
- const getjQuery = () => {
168
- const {
169
- jQuery
170
- } = window;
171
-
172
- if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
173
- return jQuery;
174
- }
175
-
176
- return null;
177
- };
178
-
179
- const DOMContentLoadedCallbacks = [];
180
-
181
- const onDOMContentLoaded = callback => {
182
- if (document.readyState === 'loading') {
183
- // add listener on the first call when the document is in loading state
184
- if (!DOMContentLoadedCallbacks.length) {
185
- document.addEventListener('DOMContentLoaded', () => {
186
- DOMContentLoadedCallbacks.forEach(callback => callback());
187
- });
188
- }
189
-
190
- DOMContentLoadedCallbacks.push(callback);
191
- } else {
192
- callback();
193
- }
194
- };
195
-
196
- const isRTL = () => document.documentElement.dir === 'rtl';
197
-
198
- const defineJQueryPlugin = plugin => {
199
- onDOMContentLoaded(() => {
200
- const $ = getjQuery();
201
- /* istanbul ignore if */
202
-
203
- if ($) {
204
- const name = plugin.NAME;
205
- const JQUERY_NO_CONFLICT = $.fn[name];
206
- $.fn[name] = plugin.jQueryInterface;
207
- $.fn[name].Constructor = plugin;
208
-
209
- $.fn[name].noConflict = () => {
210
- $.fn[name] = JQUERY_NO_CONFLICT;
211
- return plugin.jQueryInterface;
212
- };
213
- }
214
- });
215
- };
216
-
217
- const execute = callback => {
218
- if (typeof callback === 'function') {
219
- callback();
220
- }
221
- };
222
-
223
- const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
224
- if (!waitForTransition) {
225
- execute(callback);
226
- return;
227
- }
228
-
229
- const durationPadding = 5;
230
- const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
231
- let called = false;
232
-
233
- const handler = ({
234
- target
235
- }) => {
236
- if (target !== transitionElement) {
237
- return;
238
- }
239
-
240
- called = true;
241
- transitionElement.removeEventListener(TRANSITION_END, handler);
242
- execute(callback);
243
- };
244
-
245
- transitionElement.addEventListener(TRANSITION_END, handler);
246
- setTimeout(() => {
247
- if (!called) {
248
- triggerTransitionEnd(transitionElement);
249
- }
250
- }, emulatedDuration);
251
- };
252
-
253
- /**
254
- * --------------------------------------------------------------------------
255
- * Bootstrap (v5.1.3): util/scrollBar.js
256
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
257
- * --------------------------------------------------------------------------
258
- */
259
- const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
260
- const SELECTOR_STICKY_CONTENT = '.sticky-top';
261
-
262
- class ScrollBarHelper {
263
- constructor() {
264
- this._element = document.body;
265
- }
266
-
267
- getWidth() {
268
- // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
269
- const documentWidth = document.documentElement.clientWidth;
270
- return Math.abs(window.innerWidth - documentWidth);
271
- }
272
-
273
- hide() {
274
- const width = this.getWidth();
275
-
276
- this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width
277
-
278
-
279
- this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
280
-
281
-
282
- this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
283
-
284
- this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
285
- }
286
-
287
- _disableOverFlow() {
288
- this._saveInitialAttribute(this._element, 'overflow');
289
-
290
- this._element.style.overflow = 'hidden';
291
- }
292
-
293
- _setElementAttributes(selector, styleProp, callback) {
294
- const scrollbarWidth = this.getWidth();
295
-
296
- const manipulationCallBack = element => {
297
- if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
298
- return;
299
- }
300
-
301
- this._saveInitialAttribute(element, styleProp);
302
-
303
- const calculatedValue = window.getComputedStyle(element)[styleProp];
304
- element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
305
- };
306
-
307
- this._applyManipulationCallback(selector, manipulationCallBack);
308
- }
309
-
310
- reset() {
311
- this._resetElementAttributes(this._element, 'overflow');
312
-
313
- this._resetElementAttributes(this._element, 'paddingRight');
314
-
315
- this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
316
-
317
- this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
318
- }
319
-
320
- _saveInitialAttribute(element, styleProp) {
321
- const actualValue = element.style[styleProp];
322
-
323
- if (actualValue) {
324
- Manipulator__default.default.setDataAttribute(element, styleProp, actualValue);
325
- }
326
- }
327
-
328
- _resetElementAttributes(selector, styleProp) {
329
- const manipulationCallBack = element => {
330
- const value = Manipulator__default.default.getDataAttribute(element, styleProp);
331
-
332
- if (typeof value === 'undefined') {
333
- element.style.removeProperty(styleProp);
334
- } else {
335
- Manipulator__default.default.removeDataAttribute(element, styleProp);
336
- element.style[styleProp] = value;
337
- }
338
- };
339
-
340
- this._applyManipulationCallback(selector, manipulationCallBack);
341
- }
342
-
343
- _applyManipulationCallback(selector, callBack) {
344
- if (isElement(selector)) {
345
- callBack(selector);
346
- } else {
347
- SelectorEngine__default.default.find(selector, this._element).forEach(callBack);
348
- }
349
- }
350
-
351
- isOverflowing() {
352
- return this.getWidth() > 0;
353
- }
354
-
355
- }
356
-
357
- /**
358
- * --------------------------------------------------------------------------
359
- * Bootstrap (v5.1.3): util/backdrop.js
360
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
361
- * --------------------------------------------------------------------------
362
- */
363
- const Default$2 = {
364
- className: 'modal-backdrop',
365
- isVisible: true,
366
- // if false, we use the backdrop helper without adding any element to the dom
367
- isAnimated: false,
368
- rootElement: 'body',
369
- // give the choice to place backdrop under different elements
370
- clickCallback: null
371
- };
372
- const DefaultType$2 = {
373
- className: 'string',
374
- isVisible: 'boolean',
375
- isAnimated: 'boolean',
376
- rootElement: '(element|string)',
377
- clickCallback: '(function|null)'
378
- };
379
- const NAME$2 = 'backdrop';
380
- const CLASS_NAME_FADE$1 = 'fade';
381
- const CLASS_NAME_SHOW$1 = 'show';
382
- const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$2}`;
383
-
384
- class Backdrop {
385
- constructor(config) {
386
- this._config = this._getConfig(config);
387
- this._isAppended = false;
388
- this._element = null;
389
- }
390
-
391
- show(callback) {
392
- if (!this._config.isVisible) {
393
- execute(callback);
394
- return;
395
- }
396
-
397
- this._append();
398
-
399
- if (this._config.isAnimated) {
400
- reflow(this._getElement());
401
- }
402
-
403
- this._getElement().classList.add(CLASS_NAME_SHOW$1);
404
-
405
- this._emulateAnimation(() => {
406
- execute(callback);
407
- });
408
- }
409
-
410
- hide(callback) {
411
- if (!this._config.isVisible) {
412
- execute(callback);
413
- return;
414
- }
415
-
416
- this._getElement().classList.remove(CLASS_NAME_SHOW$1);
417
-
418
- this._emulateAnimation(() => {
419
- this.dispose();
420
- execute(callback);
421
- });
422
- } // Private
423
-
424
-
425
- _getElement() {
426
- if (!this._element) {
427
- const backdrop = document.createElement('div');
428
- backdrop.className = this._config.className;
429
-
430
- if (this._config.isAnimated) {
431
- backdrop.classList.add(CLASS_NAME_FADE$1);
432
- }
433
-
434
- this._element = backdrop;
435
- }
436
-
437
- return this._element;
438
- }
439
-
440
- _getConfig(config) {
441
- config = { ...Default$2,
442
- ...(typeof config === 'object' ? config : {})
443
- }; // use getElement() with the default "body" to get a fresh Element on each instantiation
444
-
445
- config.rootElement = getElement(config.rootElement);
446
- typeCheckConfig(NAME$2, config, DefaultType$2);
447
- return config;
448
- }
449
-
450
- _append() {
451
- if (this._isAppended) {
452
- return;
453
- }
454
-
455
- this._config.rootElement.append(this._getElement());
456
-
457
- EventHandler__default.default.on(this._getElement(), EVENT_MOUSEDOWN, () => {
458
- execute(this._config.clickCallback);
459
- });
460
- this._isAppended = true;
461
- }
462
-
463
- dispose() {
464
- if (!this._isAppended) {
465
- return;
466
- }
467
-
468
- EventHandler__default.default.off(this._element, EVENT_MOUSEDOWN);
469
-
470
- this._element.remove();
471
-
472
- this._isAppended = false;
473
- }
474
-
475
- _emulateAnimation(callback) {
476
- executeAfterTransition(callback, this._getElement(), this._config.isAnimated);
477
- }
478
-
479
- }
480
-
481
- /**
482
- * --------------------------------------------------------------------------
483
- * Bootstrap (v5.1.3): util/focustrap.js
484
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
485
- * --------------------------------------------------------------------------
486
- */
487
- const Default$1 = {
488
- trapElement: null,
489
- // The element to trap focus inside of
490
- autofocus: true
491
- };
492
- const DefaultType$1 = {
493
- trapElement: 'element',
494
- autofocus: 'boolean'
495
- };
496
- const NAME$1 = 'focustrap';
497
- const DATA_KEY$1 = 'bs.focustrap';
498
- const EVENT_KEY$1 = `.${DATA_KEY$1}`;
499
- const EVENT_FOCUSIN = `focusin${EVENT_KEY$1}`;
500
- const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$1}`;
501
- const TAB_KEY = 'Tab';
502
- const TAB_NAV_FORWARD = 'forward';
503
- const TAB_NAV_BACKWARD = 'backward';
504
-
505
- class FocusTrap {
506
- constructor(config) {
507
- this._config = this._getConfig(config);
508
- this._isActive = false;
509
- this._lastTabNavDirection = null;
510
- }
511
-
512
- activate() {
513
- const {
514
- trapElement,
515
- autofocus
516
- } = this._config;
517
-
518
- if (this._isActive) {
519
- return;
520
- }
521
-
522
- if (autofocus) {
523
- trapElement.focus();
524
- }
525
-
526
- EventHandler__default.default.off(document, EVENT_KEY$1); // guard against infinite focus loop
527
-
528
- EventHandler__default.default.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event));
529
- EventHandler__default.default.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
530
- this._isActive = true;
531
- }
532
-
533
- deactivate() {
534
- if (!this._isActive) {
535
- return;
536
- }
537
-
538
- this._isActive = false;
539
- EventHandler__default.default.off(document, EVENT_KEY$1);
540
- } // Private
541
-
542
-
543
- _handleFocusin(event) {
544
- const {
545
- target
546
- } = event;
547
- const {
548
- trapElement
549
- } = this._config;
550
-
551
- if (target === document || target === trapElement || trapElement.contains(target)) {
552
- return;
553
- }
554
-
555
- const elements = SelectorEngine__default.default.focusableChildren(trapElement);
556
-
557
- if (elements.length === 0) {
558
- trapElement.focus();
559
- } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
560
- elements[elements.length - 1].focus();
561
- } else {
562
- elements[0].focus();
563
- }
564
- }
565
-
566
- _handleKeydown(event) {
567
- if (event.key !== TAB_KEY) {
568
- return;
569
- }
570
-
571
- this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
572
- }
573
-
574
- _getConfig(config) {
575
- config = { ...Default$1,
576
- ...(typeof config === 'object' ? config : {})
577
- };
578
- typeCheckConfig(NAME$1, config, DefaultType$1);
579
- return config;
580
- }
581
-
582
- }
583
-
584
- /**
585
- * --------------------------------------------------------------------------
586
- * Bootstrap (v5.1.3): util/component-functions.js
587
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
588
- * --------------------------------------------------------------------------
589
- */
590
-
591
- const enableDismissTrigger = (component, method = 'hide') => {
592
- const clickEvent = `click.dismiss${component.EVENT_KEY}`;
593
- const name = component.NAME;
594
- EventHandler__default.default.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
595
- if (['A', 'AREA'].includes(this.tagName)) {
596
- event.preventDefault();
597
- }
598
-
599
- if (isDisabled(this)) {
600
- return;
601
- }
602
-
603
- const target = getElementFromSelector(this) || this.closest(`.${name}`);
604
- const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
605
-
606
- instance[method]();
607
- });
608
- };
14
+ const Backdrop__default = /*#__PURE__*/_interopDefaultLegacy(Backdrop);
15
+ const FocusTrap__default = /*#__PURE__*/_interopDefaultLegacy(FocusTrap);
609
16
 
610
17
  /**
611
18
  * --------------------------------------------------------------------------
@@ -669,7 +76,7 @@
669
76
  this._isShown = false;
670
77
  this._ignoreBackdropClick = false;
671
78
  this._isTransitioning = false;
672
- this._scrollBar = new ScrollBarHelper();
79
+ this._scrollBar = new ScrollBarHelper__default.default();
673
80
  } // Getters
674
81
 
675
82
 
@@ -775,7 +182,7 @@
775
182
 
776
183
 
777
184
  _initializeBackDrop() {
778
- return new Backdrop({
185
+ return new Backdrop__default.default({
779
186
  isVisible: Boolean(this._config.backdrop),
780
187
  // 'static' option will be translated to true, and booleans will keep their value
781
188
  isAnimated: this._isAnimated()
@@ -783,7 +190,7 @@
783
190
  }
784
191
 
785
192
  _initializeFocusTrap() {
786
- return new FocusTrap({
193
+ return new FocusTrap__default.default({
787
194
  trapElement: this._element
788
195
  });
789
196
  }
@@ -793,7 +200,7 @@
793
200
  ...Manipulator__default.default.getDataAttributes(this._element),
794
201
  ...(typeof config === 'object' ? config : {})
795
202
  };
796
- typeCheckConfig(NAME, config, DefaultType);
203
+ index.typeCheckConfig(NAME, config, DefaultType);
797
204
  return config;
798
205
  }
799
206
 
@@ -822,7 +229,7 @@
822
229
  }
823
230
 
824
231
  if (isAnimated) {
825
- reflow(this._element);
232
+ index.reflow(this._element);
826
233
  }
827
234
 
828
235
  this._element.classList.add(CLASS_NAME_SHOW);
@@ -958,11 +365,11 @@
958
365
 
959
366
  const isBodyOverflowing = scrollbarWidth > 0;
960
367
 
961
- if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) {
368
+ if (!isBodyOverflowing && isModalOverflowing && !index.isRTL() || isBodyOverflowing && !isModalOverflowing && index.isRTL()) {
962
369
  this._element.style.paddingLeft = `${scrollbarWidth}px`;
963
370
  }
964
371
 
965
- if (isBodyOverflowing && !isModalOverflowing && !isRTL() || !isBodyOverflowing && isModalOverflowing && isRTL()) {
372
+ if (isBodyOverflowing && !isModalOverflowing && !index.isRTL() || !isBodyOverflowing && isModalOverflowing && index.isRTL()) {
966
373
  this._element.style.paddingRight = `${scrollbarWidth}px`;
967
374
  }
968
375
  }
@@ -998,7 +405,7 @@
998
405
 
999
406
 
1000
407
  EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
1001
- const target = getElementFromSelector(this);
408
+ const target = index.getElementFromSelector(this);
1002
409
 
1003
410
  if (['A', 'AREA'].includes(this.tagName)) {
1004
411
  event.preventDefault();
@@ -1011,7 +418,7 @@
1011
418
  }
1012
419
 
1013
420
  EventHandler__default.default.one(target, EVENT_HIDDEN, () => {
1014
- if (isVisible(this)) {
421
+ if (index.isVisible(this)) {
1015
422
  this.focus();
1016
423
  }
1017
424
  });
@@ -1026,7 +433,7 @@
1026
433
  const data = Modal.getOrCreateInstance(target);
1027
434
  data.toggle(this);
1028
435
  });
1029
- enableDismissTrigger(Modal);
436
+ componentFunctions.enableDismissTrigger(Modal);
1030
437
  /**
1031
438
  * ------------------------------------------------------------------------
1032
439
  * jQuery
@@ -1034,7 +441,7 @@
1034
441
  * add .Modal to jQuery only if jQuery is present
1035
442
  */
1036
443
 
1037
- defineJQueryPlugin(Modal);
444
+ index.defineJQueryPlugin(Modal);
1038
445
 
1039
446
  return Modal;
1040
447