bootstrap-propshaft 5.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitattributes +14 -0
- data/.github/workflows/ci.yml +61 -0
- data/.gitignore +19 -0
- data/CHANGELOG.md +25 -0
- data/Gemfile +12 -0
- data/LICENSE +21 -0
- data/README.md +138 -0
- data/Rakefile +89 -0
- data/assets/javascripts/bootstrap/alert.js +89 -0
- data/assets/javascripts/bootstrap/base-component.js +83 -0
- data/assets/javascripts/bootstrap/button.js +78 -0
- data/assets/javascripts/bootstrap/carousel.js +387 -0
- data/assets/javascripts/bootstrap/collapse.js +248 -0
- 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 +401 -0
- data/assets/javascripts/bootstrap/modal.js +319 -0
- data/assets/javascripts/bootstrap/offcanvas.js +245 -0
- data/assets/javascripts/bootstrap/popover.js +95 -0
- data/assets/javascripts/bootstrap/scrollspy.js +274 -0
- data/assets/javascripts/bootstrap/tab.js +284 -0
- data/assets/javascripts/bootstrap/toast.js +198 -0
- data/assets/javascripts/bootstrap/tooltip.js +545 -0
- data/assets/javascripts/bootstrap/util/backdrop.js +139 -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 +113 -0
- data/assets/javascripts/bootstrap/util/index.js +281 -0
- data/assets/javascripts/bootstrap/util/sanitizer.js +110 -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 +28 -0
- data/assets/javascripts/bootstrap.js +4493 -0
- data/assets/javascripts/bootstrap.min.js +6 -0
- data/assets/stylesheets/_bootstrap-grid.scss +62 -0
- data/assets/stylesheets/_bootstrap-reboot.scss +10 -0
- data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
- data/assets/stylesheets/_bootstrap.scss +52 -0
- data/assets/stylesheets/bootstrap/_accordion.scss +158 -0
- data/assets/stylesheets/bootstrap/_alert.scss +68 -0
- data/assets/stylesheets/bootstrap/_badge.scss +38 -0
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +40 -0
- data/assets/stylesheets/bootstrap/_button-group.scss +142 -0
- data/assets/stylesheets/bootstrap/_buttons.scss +207 -0
- data/assets/stylesheets/bootstrap/_card.scss +239 -0
- data/assets/stylesheets/bootstrap/_carousel.scss +244 -0
- data/assets/stylesheets/bootstrap/_close.scss +63 -0
- data/assets/stylesheets/bootstrap/_containers.scss +41 -0
- data/assets/stylesheets/bootstrap/_dropdown.scss +250 -0
- data/assets/stylesheets/bootstrap/_forms.scss +9 -0
- data/assets/stylesheets/bootstrap/_functions.scss +302 -0
- data/assets/stylesheets/bootstrap/_grid.scss +39 -0
- data/assets/stylesheets/bootstrap/_helpers.scss +12 -0
- data/assets/stylesheets/bootstrap/_images.scss +42 -0
- data/assets/stylesheets/bootstrap/_list-group.scss +197 -0
- data/assets/stylesheets/bootstrap/_maps.scss +174 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +42 -0
- data/assets/stylesheets/bootstrap/_modal.scss +237 -0
- data/assets/stylesheets/bootstrap/_nav.scss +197 -0
- data/assets/stylesheets/bootstrap/_navbar.scss +289 -0
- data/assets/stylesheets/bootstrap/_offcanvas.scss +146 -0
- data/assets/stylesheets/bootstrap/_pagination.scss +109 -0
- data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
- data/assets/stylesheets/bootstrap/_popover.scss +196 -0
- data/assets/stylesheets/bootstrap/_progress.scss +68 -0
- data/assets/stylesheets/bootstrap/_reboot.scss +611 -0
- data/assets/stylesheets/bootstrap/_root.scss +187 -0
- data/assets/stylesheets/bootstrap/_spinners.scss +85 -0
- data/assets/stylesheets/bootstrap/_tables.scss +171 -0
- data/assets/stylesheets/bootstrap/_toasts.scss +73 -0
- data/assets/stylesheets/bootstrap/_tooltip.scss +119 -0
- data/assets/stylesheets/bootstrap/_transitions.scss +27 -0
- data/assets/stylesheets/bootstrap/_type.scss +106 -0
- data/assets/stylesheets/bootstrap/_utilities.scss +806 -0
- data/assets/stylesheets/bootstrap/_variables-dark.scss +87 -0
- data/assets/stylesheets/bootstrap/_variables.scss +1747 -0
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +95 -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/_clearfix.scss +3 -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 +18 -0
- 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 +78 -0
- data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +18 -0
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +127 -0
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +70 -0
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +69 -0
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +9 -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/_deprecate.scss +10 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +153 -0
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +47 -0
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +151 -0
- data/assets/stylesheets/bootstrap/mixins/_image.scss +16 -0
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +26 -0
- data/assets/stylesheets/bootstrap/mixins/_lists.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +10 -0
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +17 -0
- data/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
- data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +24 -0
- data/assets/stylesheets/bootstrap/mixins/_text-truncate.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_transition.scss +26 -0
- 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 +348 -0
- data/bootstrap.gemspec +39 -0
- data/lib/bootstrap/engine.rb +22 -0
- data/lib/bootstrap/version.rb +6 -0
- data/lib/bootstrap.rb +75 -0
- data/tasks/updater/js.rb +92 -0
- data/tasks/updater/logger.rb +57 -0
- data/tasks/updater/network.rb +109 -0
- data/tasks/updater/scss.rb +26 -0
- data/tasks/updater.rb +67 -0
- data/test/dummy_rails/README.rdoc +3 -0
- data/test/dummy_rails/Rakefile +6 -0
- data/test/dummy_rails/app/assets/config/manifest.js +3 -0
- data/test/dummy_rails/app/assets/images/.keep +0 -0
- data/test/dummy_rails/app/assets/javascripts/application.js +8 -0
- data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
- data/test/dummy_rails/app/assets/stylesheets/application.sass +4 -0
- data/test/dummy_rails/app/controllers/application_controller.rb +5 -0
- data/test/dummy_rails/app/controllers/pages_controller.rb +4 -0
- data/test/dummy_rails/app/helpers/application_helper.rb +2 -0
- data/test/dummy_rails/app/views/layouts/application.html.erb +16 -0
- data/test/dummy_rails/app/views/pages/root.html +89 -0
- data/test/dummy_rails/config/application.rb +32 -0
- data/test/dummy_rails/config/boot.rb +5 -0
- data/test/dummy_rails/config/environment.rb +5 -0
- data/test/dummy_rails/config/environments/development.rb +23 -0
- data/test/dummy_rails/config/environments/production.rb +82 -0
- data/test/dummy_rails/config/environments/test.rb +38 -0
- data/test/dummy_rails/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy_rails/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy_rails/config/initializers/inflections.rb +16 -0
- data/test/dummy_rails/config/initializers/mime_types.rb +5 -0
- data/test/dummy_rails/config/initializers/secret_token.rb +18 -0
- data/test/dummy_rails/config/initializers/session_store.rb +3 -0
- data/test/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy_rails/config/locales/en.yml +3 -0
- data/test/dummy_rails/config/locales/es.yml +3 -0
- data/test/dummy_rails/config/routes.rb +3 -0
- data/test/dummy_rails/config.ru +4 -0
- data/test/dummy_rails/log/.keep +0 -0
- data/test/gemfiles/rails_4_2.gemfile +7 -0
- data/test/gemfiles/rails_5_0.gemfile +8 -0
- data/test/gemfiles/rails_5_1.gemfile +8 -0
- data/test/gemfiles/rails_5_2.gemfile +8 -0
- data/test/gemfiles/rails_6_0.gemfile +8 -0
- data/test/gemfiles/rails_6_1.gemfile +8 -0
- data/test/gemfiles/rails_7_0_dartsass.gemfile +8 -0
- data/test/gemfiles/rails_7_0_sassc.gemfile +8 -0
- data/test/rails_test.rb +24 -0
- data/test/support/dummy_rails_integration.rb +31 -0
- data/test/support/reporting.rb +27 -0
- data/test/test_helper.rb +42 -0
- data/test/test_helper_rails.rb +6 -0
- metadata +471 -0
@@ -0,0 +1,198 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap toast.js v5.3.2 (https://getbootstrap.com/)
|
3
|
+
* Copyright 2011-2023 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('./util/component-functions.js'), require('./util/index.js')) :
|
8
|
+
typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './util/component-functions', './util/index'], factory) :
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.BaseComponent, global.EventHandler, global.ComponentFunctions, global.Index));
|
10
|
+
})(this, (function (BaseComponent, EventHandler, componentFunctions_js, index_js) { 'use strict';
|
11
|
+
|
12
|
+
/**
|
13
|
+
* --------------------------------------------------------------------------
|
14
|
+
* Bootstrap toast.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 = 'toast';
|
25
|
+
const DATA_KEY = 'bs.toast';
|
26
|
+
const EVENT_KEY = `.${DATA_KEY}`;
|
27
|
+
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
|
28
|
+
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
|
29
|
+
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
|
30
|
+
const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
|
31
|
+
const EVENT_HIDE = `hide${EVENT_KEY}`;
|
32
|
+
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
|
33
|
+
const EVENT_SHOW = `show${EVENT_KEY}`;
|
34
|
+
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
35
|
+
const CLASS_NAME_FADE = 'fade';
|
36
|
+
const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
|
37
|
+
const CLASS_NAME_SHOW = 'show';
|
38
|
+
const CLASS_NAME_SHOWING = 'showing';
|
39
|
+
const DefaultType = {
|
40
|
+
animation: 'boolean',
|
41
|
+
autohide: 'boolean',
|
42
|
+
delay: 'number'
|
43
|
+
};
|
44
|
+
const Default = {
|
45
|
+
animation: true,
|
46
|
+
autohide: true,
|
47
|
+
delay: 5000
|
48
|
+
};
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Class definition
|
52
|
+
*/
|
53
|
+
|
54
|
+
class Toast extends BaseComponent {
|
55
|
+
constructor(element, config) {
|
56
|
+
super(element, config);
|
57
|
+
this._timeout = null;
|
58
|
+
this._hasMouseInteraction = false;
|
59
|
+
this._hasKeyboardInteraction = false;
|
60
|
+
this._setListeners();
|
61
|
+
}
|
62
|
+
|
63
|
+
// Getters
|
64
|
+
static get Default() {
|
65
|
+
return Default;
|
66
|
+
}
|
67
|
+
static get DefaultType() {
|
68
|
+
return DefaultType;
|
69
|
+
}
|
70
|
+
static get NAME() {
|
71
|
+
return NAME;
|
72
|
+
}
|
73
|
+
|
74
|
+
// Public
|
75
|
+
show() {
|
76
|
+
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW);
|
77
|
+
if (showEvent.defaultPrevented) {
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
this._clearTimeout();
|
81
|
+
if (this._config.animation) {
|
82
|
+
this._element.classList.add(CLASS_NAME_FADE);
|
83
|
+
}
|
84
|
+
const complete = () => {
|
85
|
+
this._element.classList.remove(CLASS_NAME_SHOWING);
|
86
|
+
EventHandler.trigger(this._element, EVENT_SHOWN);
|
87
|
+
this._maybeScheduleHide();
|
88
|
+
};
|
89
|
+
this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
|
90
|
+
index_js.reflow(this._element);
|
91
|
+
this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING);
|
92
|
+
this._queueCallback(complete, this._element, this._config.animation);
|
93
|
+
}
|
94
|
+
hide() {
|
95
|
+
if (!this.isShown()) {
|
96
|
+
return;
|
97
|
+
}
|
98
|
+
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
|
99
|
+
if (hideEvent.defaultPrevented) {
|
100
|
+
return;
|
101
|
+
}
|
102
|
+
const complete = () => {
|
103
|
+
this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
|
104
|
+
this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW);
|
105
|
+
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
106
|
+
};
|
107
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
108
|
+
this._queueCallback(complete, this._element, this._config.animation);
|
109
|
+
}
|
110
|
+
dispose() {
|
111
|
+
this._clearTimeout();
|
112
|
+
if (this.isShown()) {
|
113
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
114
|
+
}
|
115
|
+
super.dispose();
|
116
|
+
}
|
117
|
+
isShown() {
|
118
|
+
return this._element.classList.contains(CLASS_NAME_SHOW);
|
119
|
+
}
|
120
|
+
|
121
|
+
// Private
|
122
|
+
|
123
|
+
_maybeScheduleHide() {
|
124
|
+
if (!this._config.autohide) {
|
125
|
+
return;
|
126
|
+
}
|
127
|
+
if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
|
128
|
+
return;
|
129
|
+
}
|
130
|
+
this._timeout = setTimeout(() => {
|
131
|
+
this.hide();
|
132
|
+
}, this._config.delay);
|
133
|
+
}
|
134
|
+
_onInteraction(event, isInteracting) {
|
135
|
+
switch (event.type) {
|
136
|
+
case 'mouseover':
|
137
|
+
case 'mouseout':
|
138
|
+
{
|
139
|
+
this._hasMouseInteraction = isInteracting;
|
140
|
+
break;
|
141
|
+
}
|
142
|
+
case 'focusin':
|
143
|
+
case 'focusout':
|
144
|
+
{
|
145
|
+
this._hasKeyboardInteraction = isInteracting;
|
146
|
+
break;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
if (isInteracting) {
|
150
|
+
this._clearTimeout();
|
151
|
+
return;
|
152
|
+
}
|
153
|
+
const nextElement = event.relatedTarget;
|
154
|
+
if (this._element === nextElement || this._element.contains(nextElement)) {
|
155
|
+
return;
|
156
|
+
}
|
157
|
+
this._maybeScheduleHide();
|
158
|
+
}
|
159
|
+
_setListeners() {
|
160
|
+
EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
|
161
|
+
EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
|
162
|
+
EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
|
163
|
+
EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));
|
164
|
+
}
|
165
|
+
_clearTimeout() {
|
166
|
+
clearTimeout(this._timeout);
|
167
|
+
this._timeout = null;
|
168
|
+
}
|
169
|
+
|
170
|
+
// Static
|
171
|
+
static jQueryInterface(config) {
|
172
|
+
return this.each(function () {
|
173
|
+
const data = Toast.getOrCreateInstance(this, config);
|
174
|
+
if (typeof config === 'string') {
|
175
|
+
if (typeof data[config] === 'undefined') {
|
176
|
+
throw new TypeError(`No method named "${config}"`);
|
177
|
+
}
|
178
|
+
data[config](this);
|
179
|
+
}
|
180
|
+
});
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
/**
|
185
|
+
* Data API implementation
|
186
|
+
*/
|
187
|
+
|
188
|
+
componentFunctions_js.enableDismissTrigger(Toast);
|
189
|
+
|
190
|
+
/**
|
191
|
+
* jQuery
|
192
|
+
*/
|
193
|
+
|
194
|
+
index_js.defineJQueryPlugin(Toast);
|
195
|
+
|
196
|
+
return Toast;
|
197
|
+
|
198
|
+
}));
|