bootstrap 4.6.2.1 → 5.3.5
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 +61 -0
- data/CHANGELOG.md +7 -2
- data/Gemfile +1 -0
- data/README.md +33 -15
- data/Rakefile +1 -2
- data/assets/javascripts/bootstrap/alert.js +50 -147
- data/assets/javascripts/bootstrap/base-component.js +83 -0
- data/assets/javascripts/bootstrap/button.js +40 -190
- data/assets/javascripts/bootstrap/carousel.js +282 -537
- data/assets/javascripts/bootstrap/collapse.js +166 -314
- data/assets/javascripts/bootstrap/dom/data.js +62 -0
- data/assets/javascripts/bootstrap/dom/event-handler.js +236 -0
- data/assets/javascripts/bootstrap/dom/manipulator.js +71 -0
- data/assets/javascripts/bootstrap/dom/selector-engine.js +103 -0
- data/assets/javascripts/bootstrap/dropdown.js +297 -455
- data/assets/javascripts/bootstrap/modal.js +223 -566
- data/assets/javascripts/bootstrap/offcanvas.js +245 -0
- data/assets/javascripts/bootstrap/popover.js +59 -208
- data/assets/javascripts/bootstrap/scrollspy.js +213 -276
- data/assets/javascripts/bootstrap/tab.js +222 -200
- data/assets/javascripts/bootstrap/toast.js +137 -206
- data/assets/javascripts/bootstrap/tooltip.js +403 -747
- data/assets/javascripts/bootstrap/util/backdrop.js +138 -0
- data/assets/javascripts/bootstrap/util/component-functions.js +41 -0
- data/assets/javascripts/bootstrap/util/config.js +67 -0
- data/assets/javascripts/bootstrap/util/focustrap.js +112 -0
- data/assets/javascripts/bootstrap/util/index.js +280 -0
- data/assets/javascripts/bootstrap/util/sanitizer.js +113 -0
- data/assets/javascripts/bootstrap/util/scrollbar.js +112 -0
- data/assets/javascripts/bootstrap/util/swipe.js +134 -0
- data/assets/javascripts/bootstrap/util/template-factory.js +150 -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 +21 -5
- data/assets/javascripts/bootstrap.js +3625 -3488
- data/assets/javascripts/bootstrap.min.js +3 -3
- data/assets/stylesheets/_bootstrap-grid.scss +53 -21
- data/assets/stylesheets/_bootstrap-reboot.scss +5 -7
- data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
- data/assets/stylesheets/_bootstrap.scss +21 -13
- data/assets/stylesheets/bootstrap/_accordion.scss +153 -0
- data/assets/stylesheets/bootstrap/_alert.scss +32 -16
- data/assets/stylesheets/bootstrap/_badge.scss +15 -31
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -24
- data/assets/stylesheets/bootstrap/_button-group.scss +32 -48
- data/assets/stylesheets/bootstrap/_buttons.scss +145 -71
- data/assets/stylesheets/bootstrap/_card.scss +67 -115
- data/assets/stylesheets/bootstrap/_carousel.scss +63 -37
- data/assets/stylesheets/bootstrap/_close.scss +53 -27
- data/assets/stylesheets/bootstrap/_containers.scss +41 -0
- data/assets/stylesheets/bootstrap/_dropdown.scss +129 -71
- data/assets/stylesheets/bootstrap/_forms.scss +9 -347
- data/assets/stylesheets/bootstrap/_functions.scss +135 -23
- data/assets/stylesheets/bootstrap/_grid.scss +18 -52
- data/assets/stylesheets/bootstrap/_helpers.scss +12 -0
- data/assets/stylesheets/bootstrap/_list-group.scss +93 -48
- data/assets/stylesheets/bootstrap/_maps.scss +174 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +10 -15
- data/assets/stylesheets/bootstrap/_modal.scss +112 -112
- data/assets/stylesheets/bootstrap/_nav.scss +100 -28
- data/assets/stylesheets/bootstrap/_navbar.scss +130 -173
- data/assets/stylesheets/bootstrap/_offcanvas.scss +147 -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 +35 -14
- data/assets/stylesheets/bootstrap/_reboot.scss +319 -192
- data/assets/stylesheets/bootstrap/_root.scss +177 -9
- data/assets/stylesheets/bootstrap/_spinners.scss +43 -23
- data/assets/stylesheets/bootstrap/_tables.scss +101 -115
- data/assets/stylesheets/bootstrap/_toasts.scss +54 -27
- data/assets/stylesheets/bootstrap/_tooltip.scss +67 -63
- data/assets/stylesheets/bootstrap/_transitions.scss +3 -2
- data/assets/stylesheets/bootstrap/_type.scss +40 -59
- data/assets/stylesheets/bootstrap/_utilities.scss +806 -18
- data/assets/stylesheets/bootstrap/_variables-dark.scss +102 -0
- data/assets/stylesheets/bootstrap/_variables.scss +1210 -606
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +97 -0
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +189 -0
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +214 -0
- data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +80 -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 +7 -0
- data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +30 -0
- data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
- data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -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 +11 -6
- data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
- data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -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 +34 -27
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -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 +64 -96
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +118 -36
- data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +7 -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 +2 -2
- 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 +33 -0
- data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +211 -91
- data/bootstrap.gemspec +6 -6
- data/lib/bootstrap/engine.rb +0 -1
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +17 -5
- data/tasks/updater/network.rb +2 -2
- data/tasks/updater/scss.rb +2 -2
- 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 -5
- data/test/dummy_rails/public/favicon.ico +0 -0
- data/test/gemfiles/rails_4_2.gemfile +2 -1
- data/test/gemfiles/rails_5_0.gemfile +1 -2
- data/test/gemfiles/rails_5_1.gemfile +1 -2
- data/test/gemfiles/rails_5_2.gemfile +7 -0
- data/test/gemfiles/rails_6_0.gemfile +1 -1
- data/test/gemfiles/rails_6_1.gemfile +7 -0
- data/test/gemfiles/rails_7_0_dartsass.gemfile +0 -1
- data/test/gemfiles/rails_7_0_sassc.gemfile +0 -1
- data/test/rails_test.rb +0 -5
- data/test/test_helper.rb +3 -2
- metadata +92 -86
- data/.travis.yml +0 -31
- data/assets/javascripts/bootstrap/util.js +0 -189
- data/assets/stylesheets/bootstrap/_code.scss +0 -48
- data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
- data/assets/stylesheets/bootstrap/_input-group.scss +0 -211
- data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
- data/assets/stylesheets/bootstrap/_media.scss +0 -8
- data/assets/stylesheets/bootstrap/_print.scss +0 -132
- 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,245 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap offcanvas.js v5.3.5 (https://getbootstrap.com/)
|
3
|
+
* Copyright 2011-2025 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('./base-component.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js'), require('./util/backdrop.js'), require('./util/component-functions.js'), require('./util/focustrap.js'), require('./util/index.js'), require('./util/scrollbar.js')) :
|
8
|
+
typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './dom/selector-engine', './util/backdrop', './util/component-functions', './util/focustrap', './util/index', './util/scrollbar'], factory) :
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Offcanvas = factory(global.BaseComponent, global.EventHandler, global.SelectorEngine, global.Backdrop, global.ComponentFunctions, global.Focustrap, global.Index, global.Scrollbar));
|
10
|
+
})(this, (function (BaseComponent, EventHandler, SelectorEngine, Backdrop, componentFunctions_js, FocusTrap, index_js, ScrollBarHelper) { 'use strict';
|
11
|
+
|
12
|
+
/**
|
13
|
+
* --------------------------------------------------------------------------
|
14
|
+
* Bootstrap offcanvas.js
|
15
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
16
|
+
* --------------------------------------------------------------------------
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Constants
|
22
|
+
*/
|
23
|
+
|
24
|
+
const NAME = 'offcanvas';
|
25
|
+
const DATA_KEY = 'bs.offcanvas';
|
26
|
+
const EVENT_KEY = `.${DATA_KEY}`;
|
27
|
+
const DATA_API_KEY = '.data-api';
|
28
|
+
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`;
|
29
|
+
const ESCAPE_KEY = 'Escape';
|
30
|
+
const CLASS_NAME_SHOW = 'show';
|
31
|
+
const CLASS_NAME_SHOWING = 'showing';
|
32
|
+
const CLASS_NAME_HIDING = 'hiding';
|
33
|
+
const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';
|
34
|
+
const OPEN_SELECTOR = '.offcanvas.show';
|
35
|
+
const EVENT_SHOW = `show${EVENT_KEY}`;
|
36
|
+
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
37
|
+
const EVENT_HIDE = `hide${EVENT_KEY}`;
|
38
|
+
const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`;
|
39
|
+
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
|
40
|
+
const EVENT_RESIZE = `resize${EVENT_KEY}`;
|
41
|
+
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
42
|
+
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`;
|
43
|
+
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="offcanvas"]';
|
44
|
+
const Default = {
|
45
|
+
backdrop: true,
|
46
|
+
keyboard: true,
|
47
|
+
scroll: false
|
48
|
+
};
|
49
|
+
const DefaultType = {
|
50
|
+
backdrop: '(boolean|string)',
|
51
|
+
keyboard: 'boolean',
|
52
|
+
scroll: 'boolean'
|
53
|
+
};
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Class definition
|
57
|
+
*/
|
58
|
+
|
59
|
+
class Offcanvas extends BaseComponent {
|
60
|
+
constructor(element, config) {
|
61
|
+
super(element, config);
|
62
|
+
this._isShown = false;
|
63
|
+
this._backdrop = this._initializeBackDrop();
|
64
|
+
this._focustrap = this._initializeFocusTrap();
|
65
|
+
this._addEventListeners();
|
66
|
+
}
|
67
|
+
|
68
|
+
// Getters
|
69
|
+
static get Default() {
|
70
|
+
return Default;
|
71
|
+
}
|
72
|
+
static get DefaultType() {
|
73
|
+
return DefaultType;
|
74
|
+
}
|
75
|
+
static get NAME() {
|
76
|
+
return NAME;
|
77
|
+
}
|
78
|
+
|
79
|
+
// Public
|
80
|
+
toggle(relatedTarget) {
|
81
|
+
return this._isShown ? this.hide() : this.show(relatedTarget);
|
82
|
+
}
|
83
|
+
show(relatedTarget) {
|
84
|
+
if (this._isShown) {
|
85
|
+
return;
|
86
|
+
}
|
87
|
+
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
|
88
|
+
relatedTarget
|
89
|
+
});
|
90
|
+
if (showEvent.defaultPrevented) {
|
91
|
+
return;
|
92
|
+
}
|
93
|
+
this._isShown = true;
|
94
|
+
this._backdrop.show();
|
95
|
+
if (!this._config.scroll) {
|
96
|
+
new ScrollBarHelper().hide();
|
97
|
+
}
|
98
|
+
this._element.setAttribute('aria-modal', true);
|
99
|
+
this._element.setAttribute('role', 'dialog');
|
100
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
101
|
+
const completeCallBack = () => {
|
102
|
+
if (!this._config.scroll || this._config.backdrop) {
|
103
|
+
this._focustrap.activate();
|
104
|
+
}
|
105
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
106
|
+
this._element.classList.remove(CLASS_NAME_SHOWING);
|
107
|
+
EventHandler.trigger(this._element, EVENT_SHOWN, {
|
108
|
+
relatedTarget
|
109
|
+
});
|
110
|
+
};
|
111
|
+
this._queueCallback(completeCallBack, this._element, true);
|
112
|
+
}
|
113
|
+
hide() {
|
114
|
+
if (!this._isShown) {
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
|
118
|
+
if (hideEvent.defaultPrevented) {
|
119
|
+
return;
|
120
|
+
}
|
121
|
+
this._focustrap.deactivate();
|
122
|
+
this._element.blur();
|
123
|
+
this._isShown = false;
|
124
|
+
this._element.classList.add(CLASS_NAME_HIDING);
|
125
|
+
this._backdrop.hide();
|
126
|
+
const completeCallback = () => {
|
127
|
+
this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING);
|
128
|
+
this._element.removeAttribute('aria-modal');
|
129
|
+
this._element.removeAttribute('role');
|
130
|
+
if (!this._config.scroll) {
|
131
|
+
new ScrollBarHelper().reset();
|
132
|
+
}
|
133
|
+
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
134
|
+
};
|
135
|
+
this._queueCallback(completeCallback, this._element, true);
|
136
|
+
}
|
137
|
+
dispose() {
|
138
|
+
this._backdrop.dispose();
|
139
|
+
this._focustrap.deactivate();
|
140
|
+
super.dispose();
|
141
|
+
}
|
142
|
+
|
143
|
+
// Private
|
144
|
+
_initializeBackDrop() {
|
145
|
+
const clickCallback = () => {
|
146
|
+
if (this._config.backdrop === 'static') {
|
147
|
+
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
this.hide();
|
151
|
+
};
|
152
|
+
|
153
|
+
// 'static' option will be translated to true, and booleans will keep their value
|
154
|
+
const isVisible = Boolean(this._config.backdrop);
|
155
|
+
return new Backdrop({
|
156
|
+
className: CLASS_NAME_BACKDROP,
|
157
|
+
isVisible,
|
158
|
+
isAnimated: true,
|
159
|
+
rootElement: this._element.parentNode,
|
160
|
+
clickCallback: isVisible ? clickCallback : null
|
161
|
+
});
|
162
|
+
}
|
163
|
+
_initializeFocusTrap() {
|
164
|
+
return new FocusTrap({
|
165
|
+
trapElement: this._element
|
166
|
+
});
|
167
|
+
}
|
168
|
+
_addEventListeners() {
|
169
|
+
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
170
|
+
if (event.key !== ESCAPE_KEY) {
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
if (this._config.keyboard) {
|
174
|
+
this.hide();
|
175
|
+
return;
|
176
|
+
}
|
177
|
+
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
178
|
+
});
|
179
|
+
}
|
180
|
+
|
181
|
+
// Static
|
182
|
+
static jQueryInterface(config) {
|
183
|
+
return this.each(function () {
|
184
|
+
const data = Offcanvas.getOrCreateInstance(this, config);
|
185
|
+
if (typeof config !== 'string') {
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
189
|
+
throw new TypeError(`No method named "${config}"`);
|
190
|
+
}
|
191
|
+
data[config](this);
|
192
|
+
});
|
193
|
+
}
|
194
|
+
}
|
195
|
+
|
196
|
+
/**
|
197
|
+
* Data API implementation
|
198
|
+
*/
|
199
|
+
|
200
|
+
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
201
|
+
const target = SelectorEngine.getElementFromSelector(this);
|
202
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
203
|
+
event.preventDefault();
|
204
|
+
}
|
205
|
+
if (index_js.isDisabled(this)) {
|
206
|
+
return;
|
207
|
+
}
|
208
|
+
EventHandler.one(target, EVENT_HIDDEN, () => {
|
209
|
+
// focus on trigger when it is closed
|
210
|
+
if (index_js.isVisible(this)) {
|
211
|
+
this.focus();
|
212
|
+
}
|
213
|
+
});
|
214
|
+
|
215
|
+
// avoid conflict when clicking a toggler of an offcanvas, while another is open
|
216
|
+
const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);
|
217
|
+
if (alreadyOpen && alreadyOpen !== target) {
|
218
|
+
Offcanvas.getInstance(alreadyOpen).hide();
|
219
|
+
}
|
220
|
+
const data = Offcanvas.getOrCreateInstance(target);
|
221
|
+
data.toggle(this);
|
222
|
+
});
|
223
|
+
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
224
|
+
for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {
|
225
|
+
Offcanvas.getOrCreateInstance(selector).show();
|
226
|
+
}
|
227
|
+
});
|
228
|
+
EventHandler.on(window, EVENT_RESIZE, () => {
|
229
|
+
for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {
|
230
|
+
if (getComputedStyle(element).position !== 'fixed') {
|
231
|
+
Offcanvas.getOrCreateInstance(element).hide();
|
232
|
+
}
|
233
|
+
}
|
234
|
+
});
|
235
|
+
componentFunctions_js.enableDismissTrigger(Offcanvas);
|
236
|
+
|
237
|
+
/**
|
238
|
+
* jQuery
|
239
|
+
*/
|
240
|
+
|
241
|
+
index_js.defineJQueryPlugin(Offcanvas);
|
242
|
+
|
243
|
+
return Offcanvas;
|
244
|
+
|
245
|
+
}));
|
@@ -1,243 +1,94 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap popover.js
|
3
|
-
* Copyright 2011-
|
2
|
+
* Bootstrap popover.js v5.3.5 (https://getbootstrap.com/)
|
3
|
+
* Copyright 2011-2025 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
|
*/
|
6
6
|
(function (global, factory) {
|
7
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('
|
8
|
-
typeof define === 'function' && define.amd ? define(['
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.
|
10
|
-
})(this, (function (
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./tooltip.js'), require('./util/index.js')) :
|
8
|
+
typeof define === 'function' && define.amd ? define(['./tooltip', './util/index'], factory) :
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.Tooltip, global.Index));
|
10
|
+
})(this, (function (Tooltip, index_js) { 'use strict';
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
for (var i = 0; i < props.length; i++) {
|
19
|
-
var descriptor = props[i];
|
20
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
21
|
-
descriptor.configurable = true;
|
22
|
-
if ("value" in descriptor) descriptor.writable = true;
|
23
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
28
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
29
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
30
|
-
Object.defineProperty(Constructor, "prototype", {
|
31
|
-
writable: false
|
32
|
-
});
|
33
|
-
return Constructor;
|
34
|
-
}
|
35
|
-
|
36
|
-
function _extends() {
|
37
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
38
|
-
for (var i = 1; i < arguments.length; i++) {
|
39
|
-
var source = arguments[i];
|
40
|
-
|
41
|
-
for (var key in source) {
|
42
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
43
|
-
target[key] = source[key];
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
47
|
-
|
48
|
-
return target;
|
49
|
-
};
|
50
|
-
return _extends.apply(this, arguments);
|
51
|
-
}
|
52
|
-
|
53
|
-
function _inheritsLoose(subClass, superClass) {
|
54
|
-
subClass.prototype = Object.create(superClass.prototype);
|
55
|
-
subClass.prototype.constructor = subClass;
|
56
|
-
|
57
|
-
_setPrototypeOf(subClass, superClass);
|
58
|
-
}
|
12
|
+
/**
|
13
|
+
* --------------------------------------------------------------------------
|
14
|
+
* Bootstrap popover.js
|
15
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
16
|
+
* --------------------------------------------------------------------------
|
17
|
+
*/
|
59
18
|
|
60
|
-
function _setPrototypeOf(o, p) {
|
61
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
62
|
-
o.__proto__ = p;
|
63
|
-
return o;
|
64
|
-
};
|
65
|
-
return _setPrototypeOf(o, p);
|
66
|
-
}
|
67
19
|
|
68
20
|
/**
|
69
21
|
* Constants
|
70
22
|
*/
|
71
23
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
var CLASS_PREFIX = 'bs-popover';
|
78
|
-
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
79
|
-
var CLASS_NAME_FADE = 'fade';
|
80
|
-
var CLASS_NAME_SHOW = 'show';
|
81
|
-
var SELECTOR_TITLE = '.popover-header';
|
82
|
-
var SELECTOR_CONTENT = '.popover-body';
|
83
|
-
|
84
|
-
var Default = _extends({}, Tooltip__default["default"].Default, {
|
85
|
-
placement: 'right',
|
86
|
-
trigger: 'click',
|
24
|
+
const NAME = 'popover';
|
25
|
+
const SELECTOR_TITLE = '.popover-header';
|
26
|
+
const SELECTOR_CONTENT = '.popover-body';
|
27
|
+
const Default = {
|
28
|
+
...Tooltip.Default,
|
87
29
|
content: '',
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
HIDE: "hide" + EVENT_KEY,
|
97
|
-
HIDDEN: "hidden" + EVENT_KEY,
|
98
|
-
SHOW: "show" + EVENT_KEY,
|
99
|
-
SHOWN: "shown" + EVENT_KEY,
|
100
|
-
INSERTED: "inserted" + EVENT_KEY,
|
101
|
-
CLICK: "click" + EVENT_KEY,
|
102
|
-
FOCUSIN: "focusin" + EVENT_KEY,
|
103
|
-
FOCUSOUT: "focusout" + EVENT_KEY,
|
104
|
-
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
105
|
-
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
30
|
+
offset: [0, 8],
|
31
|
+
placement: 'right',
|
32
|
+
template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>',
|
33
|
+
trigger: 'click'
|
34
|
+
};
|
35
|
+
const DefaultType = {
|
36
|
+
...Tooltip.DefaultType,
|
37
|
+
content: '(null|string|element|function)'
|
106
38
|
};
|
39
|
+
|
107
40
|
/**
|
108
41
|
* Class definition
|
109
42
|
*/
|
110
43
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
44
|
+
class Popover extends Tooltip {
|
45
|
+
// Getters
|
46
|
+
static get Default() {
|
47
|
+
return Default;
|
48
|
+
}
|
49
|
+
static get DefaultType() {
|
50
|
+
return DefaultType;
|
51
|
+
}
|
52
|
+
static get NAME() {
|
53
|
+
return NAME;
|
116
54
|
}
|
117
|
-
|
118
|
-
var _proto = Popover.prototype;
|
119
55
|
|
120
56
|
// Overrides
|
121
|
-
|
122
|
-
return this.
|
123
|
-
}
|
124
|
-
|
125
|
-
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
126
|
-
$__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
127
|
-
};
|
128
|
-
|
129
|
-
_proto.getTipElement = function getTipElement() {
|
130
|
-
this.tip = this.tip || $__default["default"](this.config.template)[0];
|
131
|
-
return this.tip;
|
132
|
-
};
|
133
|
-
|
134
|
-
_proto.setContent = function setContent() {
|
135
|
-
var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events
|
136
|
-
|
137
|
-
this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
|
138
|
-
|
139
|
-
var content = this._getContent();
|
140
|
-
|
141
|
-
if (typeof content === 'function') {
|
142
|
-
content = content.call(this.element);
|
143
|
-
}
|
144
|
-
|
145
|
-
this.setElementContent($tip.find(SELECTOR_CONTENT), content);
|
146
|
-
$tip.removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
|
147
|
-
} // Private
|
148
|
-
;
|
149
|
-
|
150
|
-
_proto._getContent = function _getContent() {
|
151
|
-
return this.element.getAttribute('data-content') || this.config.content;
|
152
|
-
};
|
153
|
-
|
154
|
-
_proto._cleanTipClass = function _cleanTipClass() {
|
155
|
-
var $tip = $__default["default"](this.getTipElement());
|
156
|
-
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
57
|
+
_isWithContent() {
|
58
|
+
return this._getTitle() || this._getContent();
|
59
|
+
}
|
157
60
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
61
|
+
// Private
|
62
|
+
_getContentForTemplate() {
|
63
|
+
return {
|
64
|
+
[SELECTOR_TITLE]: this._getTitle(),
|
65
|
+
[SELECTOR_CONTENT]: this._getContent()
|
66
|
+
};
|
67
|
+
}
|
68
|
+
_getContent() {
|
69
|
+
return this._resolvePossibleFunction(this._config.content);
|
70
|
+
}
|
163
71
|
|
164
|
-
|
72
|
+
// Static
|
73
|
+
static jQueryInterface(config) {
|
165
74
|
return this.each(function () {
|
166
|
-
|
167
|
-
|
168
|
-
var _config = typeof config === 'object' ? config : null;
|
169
|
-
|
170
|
-
if (!data && /dispose|hide/.test(config)) {
|
75
|
+
const data = Popover.getOrCreateInstance(this, config);
|
76
|
+
if (typeof config !== 'string') {
|
171
77
|
return;
|
172
78
|
}
|
173
|
-
|
174
|
-
|
175
|
-
data = new Popover(this, _config);
|
176
|
-
$__default["default"](this).data(DATA_KEY, data);
|
177
|
-
}
|
178
|
-
|
179
|
-
if (typeof config === 'string') {
|
180
|
-
if (typeof data[config] === 'undefined') {
|
181
|
-
throw new TypeError("No method named \"" + config + "\"");
|
182
|
-
}
|
183
|
-
|
184
|
-
data[config]();
|
79
|
+
if (typeof data[config] === 'undefined') {
|
80
|
+
throw new TypeError(`No method named "${config}"`);
|
185
81
|
}
|
82
|
+
data[config]();
|
186
83
|
});
|
187
|
-
}
|
188
|
-
|
189
|
-
_createClass(Popover, null, [{
|
190
|
-
key: "VERSION",
|
191
|
-
get: // Getters
|
192
|
-
function get() {
|
193
|
-
return VERSION;
|
194
|
-
}
|
195
|
-
}, {
|
196
|
-
key: "Default",
|
197
|
-
get: function get() {
|
198
|
-
return Default;
|
199
|
-
}
|
200
|
-
}, {
|
201
|
-
key: "NAME",
|
202
|
-
get: function get() {
|
203
|
-
return NAME;
|
204
|
-
}
|
205
|
-
}, {
|
206
|
-
key: "DATA_KEY",
|
207
|
-
get: function get() {
|
208
|
-
return DATA_KEY;
|
209
|
-
}
|
210
|
-
}, {
|
211
|
-
key: "Event",
|
212
|
-
get: function get() {
|
213
|
-
return Event;
|
214
|
-
}
|
215
|
-
}, {
|
216
|
-
key: "EVENT_KEY",
|
217
|
-
get: function get() {
|
218
|
-
return EVENT_KEY;
|
219
|
-
}
|
220
|
-
}, {
|
221
|
-
key: "DefaultType",
|
222
|
-
get: function get() {
|
223
|
-
return DefaultType;
|
224
|
-
}
|
225
|
-
}]);
|
84
|
+
}
|
85
|
+
}
|
226
86
|
|
227
|
-
return Popover;
|
228
|
-
}(Tooltip__default["default"]);
|
229
87
|
/**
|
230
88
|
* jQuery
|
231
89
|
*/
|
232
90
|
|
233
|
-
|
234
|
-
$__default["default"].fn[NAME] = Popover._jQueryInterface;
|
235
|
-
$__default["default"].fn[NAME].Constructor = Popover;
|
236
|
-
|
237
|
-
$__default["default"].fn[NAME].noConflict = function () {
|
238
|
-
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
239
|
-
return Popover._jQueryInterface;
|
240
|
-
};
|
91
|
+
index_js.defineJQueryPlugin(Popover);
|
241
92
|
|
242
93
|
return Popover;
|
243
94
|
|