bootstrap 5.2.0 → 5.3.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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +55 -0
- data/README.md +25 -5
- data/assets/javascripts/bootstrap/alert.js +22 -32
- data/assets/javascripts/bootstrap/base-component.js +22 -38
- data/assets/javascripts/bootstrap/button.js +19 -22
- data/assets/javascripts/bootstrap/carousel.js +52 -135
- data/assets/javascripts/bootstrap/collapse.js +40 -102
- data/assets/javascripts/bootstrap/dom/data.js +8 -12
- data/assets/javascripts/bootstrap/dom/event-handler.js +19 -66
- data/assets/javascripts/bootstrap/dom/manipulator.js +4 -17
- data/assets/javascripts/bootstrap/dom/selector-engine.js +42 -24
- data/assets/javascripts/bootstrap/dropdown.js +74 -143
- data/assets/javascripts/bootstrap/modal.js +66 -143
- data/assets/javascripts/bootstrap/offcanvas.js +50 -102
- data/assets/javascripts/bootstrap/popover.js +23 -29
- data/assets/javascripts/bootstrap/scrollspy.js +64 -97
- data/assets/javascripts/bootstrap/tab.js +55 -112
- data/assets/javascripts/bootstrap/toast.js +39 -77
- data/assets/javascripts/bootstrap/tooltip.js +99 -216
- data/assets/javascripts/bootstrap/util/backdrop.js +28 -54
- data/assets/javascripts/bootstrap/util/component-functions.js +13 -18
- data/assets/javascripts/bootstrap/util/config.js +15 -27
- data/assets/javascripts/bootstrap/util/focustrap.js +20 -36
- data/assets/javascripts/bootstrap/util/index.js +42 -111
- data/assets/javascripts/bootstrap/util/sanitizer.js +30 -42
- data/assets/javascripts/bootstrap/util/scrollbar.js +24 -50
- data/assets/javascripts/bootstrap/util/swipe.js +27 -48
- data/assets/javascripts/bootstrap/util/template-factory.js +25 -52
- data/assets/javascripts/bootstrap-sprockets.js +12 -12
- data/assets/javascripts/bootstrap.js +764 -1529
- data/assets/javascripts/bootstrap.min.js +3 -3
- data/assets/stylesheets/_bootstrap-grid.scss +1 -3
- data/assets/stylesheets/_bootstrap-reboot.scss +1 -0
- data/assets/stylesheets/_bootstrap.scss +1 -0
- data/assets/stylesheets/bootstrap/_accordion.scss +16 -4
- data/assets/stylesheets/bootstrap/_alert.scss +8 -11
- data/assets/stylesheets/bootstrap/_button-group.scss +3 -3
- data/assets/stylesheets/bootstrap/_buttons.scss +31 -10
- data/assets/stylesheets/bootstrap/_card.scss +5 -0
- data/assets/stylesheets/bootstrap/_carousel.scss +20 -5
- data/assets/stylesheets/bootstrap/_close.scss +32 -9
- data/assets/stylesheets/bootstrap/_dropdown.scss +3 -1
- data/assets/stylesheets/bootstrap/_functions.scss +3 -3
- data/assets/stylesheets/bootstrap/_grid.scss +6 -0
- data/assets/stylesheets/bootstrap/_helpers.scss +2 -0
- data/assets/stylesheets/bootstrap/_list-group.scss +18 -12
- data/assets/stylesheets/bootstrap/_maps.scss +120 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +1 -2
- data/assets/stylesheets/bootstrap/_modal.scss +1 -1
- data/assets/stylesheets/bootstrap/_nav.scss +42 -5
- data/assets/stylesheets/bootstrap/_navbar.scss +17 -4
- data/assets/stylesheets/bootstrap/_offcanvas.scss +9 -6
- data/assets/stylesheets/bootstrap/_pagination.scss +1 -1
- data/assets/stylesheets/bootstrap/_popover.scss +5 -5
- data/assets/stylesheets/bootstrap/_progress.scss +10 -1
- data/assets/stylesheets/bootstrap/_reboot.scss +3 -3
- data/assets/stylesheets/bootstrap/_root.scss +121 -10
- data/assets/stylesheets/bootstrap/_tables.scss +18 -11
- data/assets/stylesheets/bootstrap/_toasts.scss +5 -2
- data/assets/stylesheets/bootstrap/_tooltip.scss +4 -5
- data/assets/stylesheets/bootstrap/_utilities.scss +172 -13
- data/assets/stylesheets/bootstrap/_variables-dark.scss +85 -0
- data/assets/stylesheets/bootstrap/_variables.scss +272 -162
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +4 -0
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +23 -3
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +24 -11
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +23 -3
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +11 -2
- data/assets/stylesheets/bootstrap/forms/_input-group.scss +7 -4
- data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +0 -2
- data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +20 -2
- data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
- data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +4 -1
- data/assets/stylesheets/bootstrap/mixins/_banner.scss +3 -5
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +30 -25
- data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +18 -17
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_utilities.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +5 -1
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +23 -29
- data/bootstrap.gemspec +1 -1
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +2 -2
- data/tasks/updater/network.rb +2 -2
- data/tasks/updater/scss.rb +1 -1
- data/tasks/updater.rb +2 -2
- data/test/gemfiles/rails_5_2.gemfile +8 -0
- data/test/gemfiles/rails_7_0.gemfile +7 -0
- data/test/test_helper.rb +3 -2
- metadata +17 -9
- data/.travis.yml +0 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1297df4a046b73652d3beb2a4edea3d3964b185320d890661af5f7ea8f420236
|
|
4
|
+
data.tar.gz: 9552130734b9698ce8cf99a92617e8df11664dc1d2bc24a9c1e306de646a1f48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4553a9d115f51a7516243cb392aa9c2f3b1e07f75c315f0400dd62772abd37b907ed3d9b40b37dfd42ec8c1bc809ab60ce7528784485374166d61416df882116
|
|
7
|
+
data.tar.gz: e01e045f2dd4616399a52dcef1037f177a625d7141b424b9b793fbc203e6b8315634296189af57fcbb7ad004fed61193be04d1d1101115df0cd1364351bd42b3
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
env:
|
|
10
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
ruby_version: ['2.5', '2.6', '2.7', '3.0', '3.1']
|
|
15
|
+
gemfile:
|
|
16
|
+
- test/gemfiles/rails_5_0.gemfile
|
|
17
|
+
- test/gemfiles/rails_5_1.gemfile
|
|
18
|
+
- test/gemfiles/rails_5_2.gemfile
|
|
19
|
+
- test/gemfiles/rails_6_0.gemfile
|
|
20
|
+
- test/gemfiles/rails_6_1.gemfile
|
|
21
|
+
- test/gemfiles/rails_7_0.gemfile
|
|
22
|
+
include:
|
|
23
|
+
- ruby_version: '2.5'
|
|
24
|
+
gemfile: test/gemfiles/rails_4_2.gemfile
|
|
25
|
+
- ruby_version: '2.6'
|
|
26
|
+
gemfile: test/gemfiles/rails_4_2.gemfile
|
|
27
|
+
exclude:
|
|
28
|
+
- ruby_version: '2.5'
|
|
29
|
+
gemfile: test/gemfiles/rails_7_0.gemfile
|
|
30
|
+
- ruby_version: '2.6'
|
|
31
|
+
gemfile: test/gemfiles/rails_7_0.gemfile
|
|
32
|
+
- ruby_version: '3.0'
|
|
33
|
+
gemfile: test/gemfiles/rails_5_0.gemfile
|
|
34
|
+
- ruby_version: '3.0'
|
|
35
|
+
gemfile: test/gemfiles/rails_5_1.gemfile
|
|
36
|
+
- ruby_version: '3.0'
|
|
37
|
+
gemfile: test/gemfiles/rails_5_2.gemfile
|
|
38
|
+
- ruby_version: '3.1'
|
|
39
|
+
gemfile: test/gemfiles/rails_5_0.gemfile
|
|
40
|
+
- ruby_version: '3.1'
|
|
41
|
+
gemfile: test/gemfiles/rails_5_1.gemfile
|
|
42
|
+
- ruby_version: '3.1'
|
|
43
|
+
gemfile: test/gemfiles/rails_5_2.gemfile
|
|
44
|
+
- ruby_version: '3.1'
|
|
45
|
+
gemfile: test/gemfiles/rails_6_0.gemfile
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
steps:
|
|
48
|
+
- uses: actions/checkout@v3
|
|
49
|
+
- name: Set up Ruby
|
|
50
|
+
uses: ruby/setup-ruby@v1
|
|
51
|
+
with:
|
|
52
|
+
ruby-version: ${{ matrix.ruby_version }}
|
|
53
|
+
bundler-cache: true # 'bundle install' and cache
|
|
54
|
+
- name: Build and test with Rake
|
|
55
|
+
run: bundle exec rake --trace
|
data/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# Bootstrap Ruby Gem [](https://github.com/twbs/bootstrap-rubygem/actions/workflows/ci.yml) [](https://rubygems.org/gems/bootstrap)
|
|
2
2
|
|
|
3
|
-
[Bootstrap 5][bootstrap-home] ruby gem for Ruby on Rails (*Sprockets*) and Hanami (formerly Lotus).
|
|
3
|
+
[Bootstrap 5][bootstrap-home] ruby gem for Ruby on Rails (*Sprockets*/*Importmaps*) and Hanami (formerly Lotus).
|
|
4
4
|
|
|
5
5
|
For Sass versions of Bootstrap 3 and 2 see [bootstrap-sass](https://github.com/twbs/bootstrap-sass) instead.
|
|
6
6
|
|
|
7
|
-
**Ruby on Rails
|
|
8
|
-
|
|
7
|
+
**Ruby on Rails Note**: Newer releases of Rails have added additional ways for
|
|
8
|
+
assets to be processed. The `twbs/bootstrap-rubygem` is for use with Importmaps
|
|
9
|
+
or Sprockets, but not Webpack.
|
|
9
10
|
|
|
10
11
|
## Installation
|
|
11
12
|
|
|
@@ -20,7 +21,7 @@ Please see the appropriate guide for your environment of choice:
|
|
|
20
21
|
Add `bootstrap` to your Gemfile:
|
|
21
22
|
|
|
22
23
|
```ruby
|
|
23
|
-
gem 'bootstrap', '~> 5.
|
|
24
|
+
gem 'bootstrap', '~> 5.3.0'
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
Ensure that `sprockets-rails` is at least v2.3.2.
|
|
@@ -58,6 +59,25 @@ Bootstrap tooltips and popovers depend on [popper.js] for positioning.
|
|
|
58
59
|
The `bootstrap` gem already depends on the
|
|
59
60
|
[popper_js](https://github.com/glebm/popper_js-rubygem) gem.
|
|
60
61
|
|
|
62
|
+
#### Importmaps
|
|
63
|
+
|
|
64
|
+
You can pin either `bootstrap.js` or `bootstrap.min.js` in `config/importmap.rb`
|
|
65
|
+
as well as `popper.js`:
|
|
66
|
+
|
|
67
|
+
```ruby
|
|
68
|
+
pin "bootstrap", to: "bootstrap.min.js", preload: true
|
|
69
|
+
pin "@popperjs/core", to: "popper.js", preload: true
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Whichever files you pin will need to be added to `config.assets.precompile`:
|
|
73
|
+
|
|
74
|
+
```ruby
|
|
75
|
+
# config/initializers/assets.rb
|
|
76
|
+
Rails.application.config.assets.precompile += %w(bootstrap.min.js popper.js)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Sprockets
|
|
80
|
+
|
|
61
81
|
Add Bootstrap dependencies and Bootstrap to your `application.js`:
|
|
62
82
|
|
|
63
83
|
```js
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Bootstrap alert.js v5.
|
|
3
|
-
* Copyright 2011-
|
|
2
|
+
* Bootstrap alert.js v5.3.0 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2023 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.Alert = factory(global.
|
|
10
|
-
})(this, (function (
|
|
11
|
-
|
|
12
|
-
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
13
|
-
|
|
14
|
-
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
|
15
|
-
const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
|
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.Alert = factory(global.BaseComponent, global.EventHandler, global.ComponentFunctions, global.Index));
|
|
10
|
+
})(this, (function (BaseComponent, EventHandler, componentFunctions_js, index_js) { 'use strict';
|
|
16
11
|
|
|
17
12
|
/**
|
|
18
13
|
* --------------------------------------------------------------------------
|
|
19
|
-
* Bootstrap
|
|
14
|
+
* Bootstrap alert.js
|
|
20
15
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
21
16
|
* --------------------------------------------------------------------------
|
|
22
17
|
*/
|
|
18
|
+
|
|
19
|
+
|
|
23
20
|
/**
|
|
24
21
|
* Constants
|
|
25
22
|
*/
|
|
@@ -31,68 +28,61 @@
|
|
|
31
28
|
const EVENT_CLOSED = `closed${EVENT_KEY}`;
|
|
32
29
|
const CLASS_NAME_FADE = 'fade';
|
|
33
30
|
const CLASS_NAME_SHOW = 'show';
|
|
31
|
+
|
|
34
32
|
/**
|
|
35
33
|
* Class definition
|
|
36
34
|
*/
|
|
37
35
|
|
|
38
|
-
class Alert extends
|
|
36
|
+
class Alert extends BaseComponent {
|
|
39
37
|
// Getters
|
|
40
38
|
static get NAME() {
|
|
41
39
|
return NAME;
|
|
42
|
-
}
|
|
43
|
-
|
|
40
|
+
}
|
|
44
41
|
|
|
42
|
+
// Public
|
|
45
43
|
close() {
|
|
46
|
-
const closeEvent =
|
|
47
|
-
|
|
44
|
+
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
|
48
45
|
if (closeEvent.defaultPrevented) {
|
|
49
46
|
return;
|
|
50
47
|
}
|
|
51
|
-
|
|
52
48
|
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
53
|
-
|
|
54
49
|
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE);
|
|
55
|
-
|
|
56
50
|
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
|
57
|
-
}
|
|
58
|
-
|
|
51
|
+
}
|
|
59
52
|
|
|
53
|
+
// Private
|
|
60
54
|
_destroyElement() {
|
|
61
55
|
this._element.remove();
|
|
62
|
-
|
|
63
|
-
EventHandler__default.default.trigger(this._element, EVENT_CLOSED);
|
|
56
|
+
EventHandler.trigger(this._element, EVENT_CLOSED);
|
|
64
57
|
this.dispose();
|
|
65
|
-
}
|
|
66
|
-
|
|
58
|
+
}
|
|
67
59
|
|
|
60
|
+
// Static
|
|
68
61
|
static jQueryInterface(config) {
|
|
69
62
|
return this.each(function () {
|
|
70
63
|
const data = Alert.getOrCreateInstance(this);
|
|
71
|
-
|
|
72
64
|
if (typeof config !== 'string') {
|
|
73
65
|
return;
|
|
74
66
|
}
|
|
75
|
-
|
|
76
67
|
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
|
77
68
|
throw new TypeError(`No method named "${config}"`);
|
|
78
69
|
}
|
|
79
|
-
|
|
80
70
|
data[config](this);
|
|
81
71
|
});
|
|
82
72
|
}
|
|
83
|
-
|
|
84
73
|
}
|
|
74
|
+
|
|
85
75
|
/**
|
|
86
76
|
* Data API implementation
|
|
87
77
|
*/
|
|
88
78
|
|
|
79
|
+
componentFunctions_js.enableDismissTrigger(Alert, 'close');
|
|
89
80
|
|
|
90
|
-
componentFunctions.enableDismissTrigger(Alert, 'close');
|
|
91
81
|
/**
|
|
92
82
|
* jQuery
|
|
93
83
|
*/
|
|
94
84
|
|
|
95
|
-
|
|
85
|
+
index_js.defineJQueryPlugin(Alert);
|
|
96
86
|
|
|
97
87
|
return Alert;
|
|
98
88
|
|
|
@@ -1,97 +1,81 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Bootstrap base-component.js v5.
|
|
3
|
-
* Copyright 2011-
|
|
2
|
+
* Bootstrap base-component.js v5.3.0 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2023 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('./dom/data'), require('./
|
|
8
|
-
typeof define === 'function' && define.amd ? define(['./dom/data', './
|
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BaseComponent = factory(global.Data, global.
|
|
10
|
-
})(this, (function (Data,
|
|
11
|
-
|
|
12
|
-
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
13
|
-
|
|
14
|
-
const Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
|
15
|
-
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
|
16
|
-
const Config__default = /*#__PURE__*/_interopDefaultLegacy(Config);
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./util/config.js'), require('./util/index.js')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './util/config', './util/index'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BaseComponent = factory(global.Data, global.EventHandler, global.Config, global.Index));
|
|
10
|
+
})(this, (function (Data, EventHandler, Config, index_js) { 'use strict';
|
|
17
11
|
|
|
18
12
|
/**
|
|
19
13
|
* --------------------------------------------------------------------------
|
|
20
|
-
* Bootstrap
|
|
14
|
+
* Bootstrap base-component.js
|
|
21
15
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
22
16
|
* --------------------------------------------------------------------------
|
|
23
17
|
*/
|
|
18
|
+
|
|
19
|
+
|
|
24
20
|
/**
|
|
25
21
|
* Constants
|
|
26
22
|
*/
|
|
27
23
|
|
|
28
|
-
const VERSION = '5.
|
|
24
|
+
const VERSION = '5.3.0';
|
|
25
|
+
|
|
29
26
|
/**
|
|
30
27
|
* Class definition
|
|
31
28
|
*/
|
|
32
29
|
|
|
33
|
-
class BaseComponent extends
|
|
30
|
+
class BaseComponent extends Config {
|
|
34
31
|
constructor(element, config) {
|
|
35
32
|
super();
|
|
36
|
-
element =
|
|
37
|
-
|
|
33
|
+
element = index_js.getElement(element);
|
|
38
34
|
if (!element) {
|
|
39
35
|
return;
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
this._element = element;
|
|
43
38
|
this._config = this._getConfig(config);
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
39
|
+
Data.set(this._element, this.constructor.DATA_KEY, this);
|
|
40
|
+
}
|
|
47
41
|
|
|
42
|
+
// Public
|
|
48
43
|
dispose() {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
Data.remove(this._element, this.constructor.DATA_KEY);
|
|
45
|
+
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
|
52
46
|
for (const propertyName of Object.getOwnPropertyNames(this)) {
|
|
53
47
|
this[propertyName] = null;
|
|
54
48
|
}
|
|
55
49
|
}
|
|
56
|
-
|
|
57
50
|
_queueCallback(callback, element, isAnimated = true) {
|
|
58
|
-
|
|
51
|
+
index_js.executeAfterTransition(callback, element, isAnimated);
|
|
59
52
|
}
|
|
60
|
-
|
|
61
53
|
_getConfig(config) {
|
|
62
54
|
config = this._mergeConfigObj(config, this._element);
|
|
63
55
|
config = this._configAfterMerge(config);
|
|
64
|
-
|
|
65
56
|
this._typeCheckConfig(config);
|
|
66
|
-
|
|
67
57
|
return config;
|
|
68
|
-
}
|
|
69
|
-
|
|
58
|
+
}
|
|
70
59
|
|
|
60
|
+
// Static
|
|
71
61
|
static getInstance(element) {
|
|
72
|
-
return
|
|
62
|
+
return Data.get(index_js.getElement(element), this.DATA_KEY);
|
|
73
63
|
}
|
|
74
|
-
|
|
75
64
|
static getOrCreateInstance(element, config = {}) {
|
|
76
65
|
return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
|
|
77
66
|
}
|
|
78
|
-
|
|
79
67
|
static get VERSION() {
|
|
80
68
|
return VERSION;
|
|
81
69
|
}
|
|
82
|
-
|
|
83
70
|
static get DATA_KEY() {
|
|
84
71
|
return `bs.${this.NAME}`;
|
|
85
72
|
}
|
|
86
|
-
|
|
87
73
|
static get EVENT_KEY() {
|
|
88
74
|
return `.${this.DATA_KEY}`;
|
|
89
75
|
}
|
|
90
|
-
|
|
91
76
|
static eventName(name) {
|
|
92
77
|
return `${name}${this.EVENT_KEY}`;
|
|
93
78
|
}
|
|
94
|
-
|
|
95
79
|
}
|
|
96
80
|
|
|
97
81
|
return BaseComponent;
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Bootstrap button.js v5.
|
|
3
|
-
* Copyright 2011-
|
|
2
|
+
* Bootstrap button.js v5.3.0 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2023 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.Button = factory(global.
|
|
10
|
-
})(this, (function (
|
|
11
|
-
|
|
12
|
-
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
13
|
-
|
|
14
|
-
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
|
15
|
-
const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./util/index.js')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './util/index'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.BaseComponent, global.EventHandler, global.Index));
|
|
10
|
+
})(this, (function (BaseComponent, EventHandler, index_js) { 'use strict';
|
|
16
11
|
|
|
17
12
|
/**
|
|
18
13
|
* --------------------------------------------------------------------------
|
|
19
|
-
* Bootstrap
|
|
14
|
+
* Bootstrap button.js
|
|
20
15
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
21
16
|
* --------------------------------------------------------------------------
|
|
22
17
|
*/
|
|
18
|
+
|
|
19
|
+
|
|
23
20
|
/**
|
|
24
21
|
* Constants
|
|
25
22
|
*/
|
|
@@ -31,50 +28,50 @@
|
|
|
31
28
|
const CLASS_NAME_ACTIVE = 'active';
|
|
32
29
|
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
|
|
33
30
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
|
31
|
+
|
|
34
32
|
/**
|
|
35
33
|
* Class definition
|
|
36
34
|
*/
|
|
37
35
|
|
|
38
|
-
class Button extends
|
|
36
|
+
class Button extends BaseComponent {
|
|
39
37
|
// Getters
|
|
40
38
|
static get NAME() {
|
|
41
39
|
return NAME;
|
|
42
|
-
}
|
|
43
|
-
|
|
40
|
+
}
|
|
44
41
|
|
|
42
|
+
// Public
|
|
45
43
|
toggle() {
|
|
46
44
|
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
|
47
45
|
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
|
48
|
-
}
|
|
49
|
-
|
|
46
|
+
}
|
|
50
47
|
|
|
48
|
+
// Static
|
|
51
49
|
static jQueryInterface(config) {
|
|
52
50
|
return this.each(function () {
|
|
53
51
|
const data = Button.getOrCreateInstance(this);
|
|
54
|
-
|
|
55
52
|
if (config === 'toggle') {
|
|
56
53
|
data[config]();
|
|
57
54
|
}
|
|
58
55
|
});
|
|
59
56
|
}
|
|
60
|
-
|
|
61
57
|
}
|
|
58
|
+
|
|
62
59
|
/**
|
|
63
60
|
* Data API implementation
|
|
64
61
|
*/
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
|
|
63
|
+
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
|
|
68
64
|
event.preventDefault();
|
|
69
65
|
const button = event.target.closest(SELECTOR_DATA_TOGGLE);
|
|
70
66
|
const data = Button.getOrCreateInstance(button);
|
|
71
67
|
data.toggle();
|
|
72
68
|
});
|
|
69
|
+
|
|
73
70
|
/**
|
|
74
71
|
* jQuery
|
|
75
72
|
*/
|
|
76
73
|
|
|
77
|
-
|
|
74
|
+
index_js.defineJQueryPlugin(Button);
|
|
78
75
|
|
|
79
76
|
return Button;
|
|
80
77
|
|