bootstrap-propshaft 5.3.2
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 +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
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: bac757ba3e18aa2af1d52a3dd633588227d3d44c06b3f15ac1d28a982c2ddc7d
|
|
4
|
+
data.tar.gz: e141f2ad96f8a587b4214cf3e22d3e151221247404524302bd259d1ac2b57135
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: db403734eadd07854b6eccbcfe3d6e5135df00f560329c52e0175cbcece030bb493ed4263752398c1cd4c90ebb928d1c06b943571d73bfbf2dec3ef09e408d71
|
|
7
|
+
data.tar.gz: 7bdd0efaa4981c67b3743f9ff6cf4d51e1d3b26810acc193c6909d2797672017b2077f80c575dc9cb6b31ec018e43527c293111837b28efa372d5d11ec3d834c
|
data/.gitattributes
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.* text eol=lf
|
|
2
|
+
Gemfile text eol=lf
|
|
3
|
+
LICENSE text eol=lf
|
|
4
|
+
Rakefile text eol=lf
|
|
5
|
+
*.gemfile text eol=lf
|
|
6
|
+
*.gemspec text eol=lf
|
|
7
|
+
*.html.erb text eol=lf
|
|
8
|
+
*.html.slim text eol=lf
|
|
9
|
+
*.js text eol=lf
|
|
10
|
+
*.rb text eol=lf
|
|
11
|
+
*.ru text eol=lf
|
|
12
|
+
*.sass text eol=lf
|
|
13
|
+
*.scss text eol=lf
|
|
14
|
+
*.yml text eol=lf
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- push
|
|
5
|
+
- pull_request
|
|
6
|
+
- workflow_dispatch
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
env:
|
|
11
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
ruby_version: ['2.5', '2.6', '2.7', '3.0', '3.1']
|
|
16
|
+
gemfile:
|
|
17
|
+
- test/gemfiles/rails_5_0.gemfile
|
|
18
|
+
- test/gemfiles/rails_5_1.gemfile
|
|
19
|
+
- test/gemfiles/rails_5_2.gemfile
|
|
20
|
+
- test/gemfiles/rails_6_0.gemfile
|
|
21
|
+
- test/gemfiles/rails_6_1.gemfile
|
|
22
|
+
- test/gemfiles/rails_7_0_sassc.gemfile
|
|
23
|
+
- test/gemfiles/rails_7_0_dartsass.gemfile
|
|
24
|
+
include:
|
|
25
|
+
- ruby_version: '2.5'
|
|
26
|
+
gemfile: test/gemfiles/rails_4_2.gemfile
|
|
27
|
+
- ruby_version: '2.6'
|
|
28
|
+
gemfile: test/gemfiles/rails_4_2.gemfile
|
|
29
|
+
exclude:
|
|
30
|
+
- ruby_version: '2.5'
|
|
31
|
+
gemfile: test/gemfiles/rails_7_0_sassc.gemfile
|
|
32
|
+
- ruby_version: '2.5'
|
|
33
|
+
gemfile: test/gemfiles/rails_7_0_dartsass.gemfile
|
|
34
|
+
- ruby_version: '2.6'
|
|
35
|
+
gemfile: test/gemfiles/rails_7_0_sassc.gemfile
|
|
36
|
+
- ruby_version: '2.6'
|
|
37
|
+
gemfile: test/gemfiles/rails_7_0_dartsass.gemfile
|
|
38
|
+
- ruby_version: '3.0'
|
|
39
|
+
gemfile: test/gemfiles/rails_5_0.gemfile
|
|
40
|
+
- ruby_version: '3.0'
|
|
41
|
+
gemfile: test/gemfiles/rails_5_1.gemfile
|
|
42
|
+
- ruby_version: '3.0'
|
|
43
|
+
gemfile: test/gemfiles/rails_5_2.gemfile
|
|
44
|
+
- ruby_version: '3.1'
|
|
45
|
+
gemfile: test/gemfiles/rails_5_0.gemfile
|
|
46
|
+
- ruby_version: '3.1'
|
|
47
|
+
gemfile: test/gemfiles/rails_5_1.gemfile
|
|
48
|
+
- ruby_version: '3.1'
|
|
49
|
+
gemfile: test/gemfiles/rails_5_2.gemfile
|
|
50
|
+
- ruby_version: '3.1'
|
|
51
|
+
gemfile: test/gemfiles/rails_6_0.gemfile
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v3
|
|
55
|
+
- name: Set up Ruby
|
|
56
|
+
uses: ruby/setup-ruby@v1
|
|
57
|
+
with:
|
|
58
|
+
ruby-version: ${{ matrix.ruby_version }}
|
|
59
|
+
bundler-cache: true # 'bundle install' and cache
|
|
60
|
+
- name: Build and test with Rake
|
|
61
|
+
run: bundle exec rake --trace
|
data/.gitignore
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
.sass-cache
|
|
3
|
+
bootstrap.css
|
|
4
|
+
bootstrap-responsive.css
|
|
5
|
+
Gemfile.lock
|
|
6
|
+
*.gemfile.lock
|
|
7
|
+
.rvmrc
|
|
8
|
+
.rbenv-version
|
|
9
|
+
|
|
10
|
+
# Ignore bundler config
|
|
11
|
+
/.bundle
|
|
12
|
+
/vendor/cache
|
|
13
|
+
/vendor/bundle
|
|
14
|
+
tmp/
|
|
15
|
+
test/screenshots/
|
|
16
|
+
test/dummy_rails/log/*.log
|
|
17
|
+
test/dummy_rails/public/assets/
|
|
18
|
+
.DS_Store
|
|
19
|
+
node_modules
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
The changelog is tracked here but also in [the Releases section of the GitHub project](https://github.com/twbs/bootstrap-rubygem/releases).
|
|
4
|
+
The changelog only includes changes specific to the RubyGem.
|
|
5
|
+
|
|
6
|
+
The Bootstrap framework changes can be found in [the Releases section of twbs/bootstrap](https://github.com/twbs/bootstrap/releases).
|
|
7
|
+
Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release of Bootstrap.
|
|
8
|
+
|
|
9
|
+
# 4.2.1
|
|
10
|
+
|
|
11
|
+
* Bootstrap rubygem now depends on SassC instead of Sass.
|
|
12
|
+
|
|
13
|
+
# 4.0.0.beta2.1
|
|
14
|
+
|
|
15
|
+
Fixes an extraneous `sourceMappingURL` in `bootstrap.js`.
|
|
16
|
+
[#124](https://github.com/twbs/bootstrap-rubygem/issues/124)
|
|
17
|
+
|
|
18
|
+
# 4.0.0.beta2
|
|
19
|
+
|
|
20
|
+
Compass is no longer supported. Minimum required Sass version is now v3.5.2.
|
|
21
|
+
[#122](https://github.com/twbs/bootstrap-rubygem/pull/122)
|
|
22
|
+
|
|
23
|
+
# 4.0.0.alpha3.1
|
|
24
|
+
|
|
25
|
+
This release corresponds to the upstream Bootstrap 4 Alpha 3.
|
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-2016 Twitter, Inc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Bootstrap Ruby Gem [](https://github.com/twbs/bootstrap-rubygem/actions/workflows/ci.yml) [](https://rubygems.org/gems/bootstrap)
|
|
2
|
+
|
|
3
|
+
[Bootstrap 5][bootstrap-home] ruby gem for Ruby on Rails (*Sprockets*/*Importmaps*) and Hanami (formerly Lotus).
|
|
4
|
+
|
|
5
|
+
For Sass versions of Bootstrap 3 and 2 see [bootstrap-sass](https://github.com/twbs/bootstrap-sass) instead.
|
|
6
|
+
|
|
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.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Please see the appropriate guide for your environment of choice:
|
|
14
|
+
|
|
15
|
+
* [Ruby on Rails 4+](#a-ruby-on-rails) or other Sprockets environment.
|
|
16
|
+
* [Other Ruby frameworks](#b-other-ruby-frameworks) not on Rails.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### a. Ruby on Rails
|
|
20
|
+
|
|
21
|
+
Add `bootstrap` to your Gemfile:
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
gem 'bootstrap', '~> 5.3.2'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This gem requires a Sass engine, so make sure you have **one** of these two gems in your Gemfile:
|
|
28
|
+
- [`dartsass-sprockets`](https://github.com/tablecheck/dartsass-sprockets): Dart Sass engine, recommended but only works for Ruby 2.6+ and Rails 5+
|
|
29
|
+
- [`sassc-rails`](https://github.com/sass/sassc-rails): SassC engine, deprecated but compatible with Ruby 2.3+ and Rails 4
|
|
30
|
+
|
|
31
|
+
Also ensure that `sprockets-rails` is at least v2.3.2.
|
|
32
|
+
|
|
33
|
+
`bundle install` and restart your server to make the files available through the pipeline.
|
|
34
|
+
|
|
35
|
+
Import Bootstrap styles in `app/assets/stylesheets/application.scss`:
|
|
36
|
+
|
|
37
|
+
```scss
|
|
38
|
+
// Custom bootstrap variables must be set or imported *before* bootstrap.
|
|
39
|
+
@import "bootstrap";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The available variables can be found [here](assets/stylesheets/bootstrap/_variables.scss).
|
|
43
|
+
|
|
44
|
+
Make sure the file has `.scss` extension (or `.sass` for Sass syntax). If you have just generated a new Rails app,
|
|
45
|
+
it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so rename it:
|
|
46
|
+
|
|
47
|
+
```console
|
|
48
|
+
$ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then, remove all the `*= require` and `*= require_tree` statements from the Sass file. Instead, use `@import` to import Sass files.
|
|
52
|
+
|
|
53
|
+
Do not use `*= require` in Sass or your other stylesheets will not be able to access the Bootstrap mixins and variables.
|
|
54
|
+
|
|
55
|
+
Bootstrap JavaScript can optionally use jQuery.
|
|
56
|
+
If you're using Rails 5.1+, you can add the `jquery-rails` gem to your Gemfile:
|
|
57
|
+
|
|
58
|
+
```ruby
|
|
59
|
+
gem 'jquery-rails'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Bootstrap tooltips and popovers depend on [popper.js] for positioning.
|
|
63
|
+
The `bootstrap` gem already depends on the
|
|
64
|
+
[popper_js](https://github.com/glebm/popper_js-rubygem) gem.
|
|
65
|
+
|
|
66
|
+
#### Importmaps
|
|
67
|
+
|
|
68
|
+
You can pin either `bootstrap.js` or `bootstrap.min.js` in `config/importmap.rb`
|
|
69
|
+
as well as `popper.js`:
|
|
70
|
+
|
|
71
|
+
```ruby
|
|
72
|
+
pin "bootstrap", to: "bootstrap.min.js", preload: true
|
|
73
|
+
pin "@popperjs/core", to: "popper.js", preload: true
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Whichever files you pin will need to be added to `config.assets.precompile`:
|
|
77
|
+
|
|
78
|
+
```ruby
|
|
79
|
+
# config/initializers/assets.rb
|
|
80
|
+
Rails.application.config.assets.precompile += %w(bootstrap.min.js popper.js)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Sprockets
|
|
84
|
+
|
|
85
|
+
Add Bootstrap dependencies and Bootstrap to your `application.js`:
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
//= require jquery3
|
|
89
|
+
//= require popper
|
|
90
|
+
//= require bootstrap-sprockets
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
While `bootstrap-sprockets` provides individual Bootstrap components
|
|
94
|
+
for ease of debugging, you may alternatively require
|
|
95
|
+
the concatenated `bootstrap` for faster compilation:
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
//= require jquery3
|
|
99
|
+
//= require popper
|
|
100
|
+
//= require bootstrap
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### b. Other Ruby frameworks
|
|
104
|
+
|
|
105
|
+
If your framework uses Sprockets or Hanami,
|
|
106
|
+
the assets will be registered with Sprockets when the gem is required,
|
|
107
|
+
and you can use them as per the Rails section of the guide.
|
|
108
|
+
|
|
109
|
+
Otherwise you may need to register the assets manually.
|
|
110
|
+
Refer to your framework's documentation on the subject.
|
|
111
|
+
|
|
112
|
+
## Configuration
|
|
113
|
+
|
|
114
|
+
### Sass: Autoprefixer
|
|
115
|
+
|
|
116
|
+
Bootstrap requires the use of [Autoprefixer][autoprefixer].
|
|
117
|
+
[Autoprefixer][autoprefixer] adds vendor prefixes to CSS rules using values from [Can I Use](http://caniuse.com/).
|
|
118
|
+
|
|
119
|
+
If you are using bootstrap with Rails, autoprefixer is set up for you automatically.
|
|
120
|
+
Otherwise, please consult the [Autoprefixer documentation][autoprefixer].
|
|
121
|
+
|
|
122
|
+
### Sass: Individual components
|
|
123
|
+
|
|
124
|
+
By default all of Bootstrap is imported.
|
|
125
|
+
|
|
126
|
+
You can also import components explicitly. To start with a full list of modules copy
|
|
127
|
+
[`_bootstrap.scss`](assets/stylesheets/_bootstrap.scss) file into your assets as `_bootstrap-custom.scss`.
|
|
128
|
+
Then comment out components you do not want from `_bootstrap-custom`.
|
|
129
|
+
In the application Sass file, replace `@import 'bootstrap'` with:
|
|
130
|
+
|
|
131
|
+
```scss
|
|
132
|
+
@import 'bootstrap-custom';
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
[bootstrap-home]: https://getbootstrap.com
|
|
136
|
+
[bootstrap-variables.scss]: https://github.com/twbs/bootstrap-rubygem/blob/master/templates/project/_bootstrap-variables.scss
|
|
137
|
+
[autoprefixer]: https://github.com/ai/autoprefixer
|
|
138
|
+
[popper.js]: https://popper.js.org
|
data/Rakefile
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
2
|
+
require 'bundler/setup'
|
|
3
|
+
|
|
4
|
+
lib_path = File.join(File.dirname(__FILE__), 'lib')
|
|
5
|
+
$:.unshift(lib_path) unless $:.include?(lib_path)
|
|
6
|
+
|
|
7
|
+
require 'rake/testtask'
|
|
8
|
+
Rake::TestTask.new do |t|
|
|
9
|
+
t.libs << 'test'
|
|
10
|
+
t.test_files = FileList['test/**/*_test.rb']
|
|
11
|
+
t.verbose = false
|
|
12
|
+
t.warning = false
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
desc 'Test all Gemfiles from test/*.gemfile'
|
|
16
|
+
task :test_all_gemfiles do
|
|
17
|
+
require 'term/ansicolor'
|
|
18
|
+
require 'pty'
|
|
19
|
+
require 'shellwords'
|
|
20
|
+
cmd = 'bundle install --quiet && bundle exec rake --trace'
|
|
21
|
+
statuses = Dir.glob('./test/gemfiles/*{[!.lock]}').map do |gemfile|
|
|
22
|
+
env = {'BUNDLE_GEMFILE' => gemfile}
|
|
23
|
+
cmd_with_env = " (#{env.map { |k, v| "export #{k}=#{Shellwords.escape v}" } * ' '}; #{cmd})"
|
|
24
|
+
$stderr.puts Term::ANSIColor.cyan("Testing\n#{cmd_with_env}")
|
|
25
|
+
Bundler.with_clean_env do
|
|
26
|
+
PTY.spawn(env, cmd) do |r, _w, pid|
|
|
27
|
+
begin
|
|
28
|
+
r.each_line { |l| puts l }
|
|
29
|
+
rescue Errno::EIO
|
|
30
|
+
# Errno:EIO error means that the process has finished giving output.
|
|
31
|
+
ensure
|
|
32
|
+
::Process.wait pid
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
[$? && $?.exitstatus == 0, cmd_with_env]
|
|
37
|
+
end
|
|
38
|
+
failed_cmds = statuses.reject(&:first).map { |(_status, cmd_with_env)| cmd_with_env }
|
|
39
|
+
if failed_cmds.empty?
|
|
40
|
+
$stderr.puts Term::ANSIColor.green('Tests pass with all gemfiles')
|
|
41
|
+
else
|
|
42
|
+
$stderr.puts Term::ANSIColor.red("Failing (#{failed_cmds.size} / #{statuses.size})\n#{failed_cmds * "\n"}")
|
|
43
|
+
exit 1
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
desc 'Dumps output to a CSS file for testing'
|
|
48
|
+
task :debug do
|
|
49
|
+
begin
|
|
50
|
+
require 'dartsass-ruby'
|
|
51
|
+
rescue LoadError
|
|
52
|
+
require 'sassc'
|
|
53
|
+
rescue LoadError
|
|
54
|
+
raise LoadError.new("bootstrap-rubygem requires a Sass engine. Please add dartsass-sprockets or sassc-rails to your dependencies.")
|
|
55
|
+
end
|
|
56
|
+
require './lib/bootstrap'
|
|
57
|
+
require 'term/ansicolor'
|
|
58
|
+
require 'autoprefixer-rails'
|
|
59
|
+
path = Bootstrap.stylesheets_path
|
|
60
|
+
%w(_bootstrap _bootstrap-reboot _bootstrap-grid).each do |file|
|
|
61
|
+
# For ease of upgrading, the root namespace ::SassC is still used by dartsass-sprockets.
|
|
62
|
+
# This is planned to be renamed in a future major version release.
|
|
63
|
+
engine = SassC::Engine.new(File.read("#{path}/#{file}.scss"), syntax: :scss, load_paths: [path])
|
|
64
|
+
out = File.join('tmp', "#{file[1..-1]}.css")
|
|
65
|
+
css = engine.render
|
|
66
|
+
css = AutoprefixerRails.process(css)
|
|
67
|
+
File.write(out, css)
|
|
68
|
+
$stderr.puts Term::ANSIColor.green "Compiled #{out}"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
desc 'Update bootstrap from upstream'
|
|
73
|
+
task :update, :branch do |t, args|
|
|
74
|
+
require './tasks/updater'
|
|
75
|
+
Updater.new(branch: args[:branch]).update_bootstrap
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
desc 'Start a dummy Rails app server'
|
|
79
|
+
task :rails_server do
|
|
80
|
+
require 'rack'
|
|
81
|
+
require 'term/ansicolor'
|
|
82
|
+
port = ENV['PORT'] || 9292
|
|
83
|
+
puts %Q(Starting on #{Term::ANSIColor.cyan "http://localhost:#{port}"})
|
|
84
|
+
Rack::Server.start(
|
|
85
|
+
config: 'test/dummy_rails/config.ru',
|
|
86
|
+
Port: port)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
task default: :test
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Bootstrap alert.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.Alert = 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 alert.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 = 'alert';
|
|
25
|
+
const DATA_KEY = 'bs.alert';
|
|
26
|
+
const EVENT_KEY = `.${DATA_KEY}`;
|
|
27
|
+
const EVENT_CLOSE = `close${EVENT_KEY}`;
|
|
28
|
+
const EVENT_CLOSED = `closed${EVENT_KEY}`;
|
|
29
|
+
const CLASS_NAME_FADE = 'fade';
|
|
30
|
+
const CLASS_NAME_SHOW = 'show';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Class definition
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
class Alert extends BaseComponent {
|
|
37
|
+
// Getters
|
|
38
|
+
static get NAME() {
|
|
39
|
+
return NAME;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Public
|
|
43
|
+
close() {
|
|
44
|
+
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
|
45
|
+
if (closeEvent.defaultPrevented) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
49
|
+
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE);
|
|
50
|
+
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Private
|
|
54
|
+
_destroyElement() {
|
|
55
|
+
this._element.remove();
|
|
56
|
+
EventHandler.trigger(this._element, EVENT_CLOSED);
|
|
57
|
+
this.dispose();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Static
|
|
61
|
+
static jQueryInterface(config) {
|
|
62
|
+
return this.each(function () {
|
|
63
|
+
const data = Alert.getOrCreateInstance(this);
|
|
64
|
+
if (typeof config !== 'string') {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
|
68
|
+
throw new TypeError(`No method named "${config}"`);
|
|
69
|
+
}
|
|
70
|
+
data[config](this);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Data API implementation
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
componentFunctions_js.enableDismissTrigger(Alert, 'close');
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* jQuery
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
index_js.defineJQueryPlugin(Alert);
|
|
86
|
+
|
|
87
|
+
return Alert;
|
|
88
|
+
|
|
89
|
+
}));
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Bootstrap base-component.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('./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';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* --------------------------------------------------------------------------
|
|
14
|
+
* Bootstrap base-component.js
|
|
15
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
16
|
+
* --------------------------------------------------------------------------
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Constants
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const VERSION = '5.3.2';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Class definition
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
class BaseComponent extends Config {
|
|
31
|
+
constructor(element, config) {
|
|
32
|
+
super();
|
|
33
|
+
element = index_js.getElement(element);
|
|
34
|
+
if (!element) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this._element = element;
|
|
38
|
+
this._config = this._getConfig(config);
|
|
39
|
+
Data.set(this._element, this.constructor.DATA_KEY, this);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Public
|
|
43
|
+
dispose() {
|
|
44
|
+
Data.remove(this._element, this.constructor.DATA_KEY);
|
|
45
|
+
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
|
46
|
+
for (const propertyName of Object.getOwnPropertyNames(this)) {
|
|
47
|
+
this[propertyName] = null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
_queueCallback(callback, element, isAnimated = true) {
|
|
51
|
+
index_js.executeAfterTransition(callback, element, isAnimated);
|
|
52
|
+
}
|
|
53
|
+
_getConfig(config) {
|
|
54
|
+
config = this._mergeConfigObj(config, this._element);
|
|
55
|
+
config = this._configAfterMerge(config);
|
|
56
|
+
this._typeCheckConfig(config);
|
|
57
|
+
return config;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Static
|
|
61
|
+
static getInstance(element) {
|
|
62
|
+
return Data.get(index_js.getElement(element), this.DATA_KEY);
|
|
63
|
+
}
|
|
64
|
+
static getOrCreateInstance(element, config = {}) {
|
|
65
|
+
return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
|
|
66
|
+
}
|
|
67
|
+
static get VERSION() {
|
|
68
|
+
return VERSION;
|
|
69
|
+
}
|
|
70
|
+
static get DATA_KEY() {
|
|
71
|
+
return `bs.${this.NAME}`;
|
|
72
|
+
}
|
|
73
|
+
static get EVENT_KEY() {
|
|
74
|
+
return `.${this.DATA_KEY}`;
|
|
75
|
+
}
|
|
76
|
+
static eventName(name) {
|
|
77
|
+
return `${name}${this.EVENT_KEY}`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return BaseComponent;
|
|
82
|
+
|
|
83
|
+
}));
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Bootstrap button.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/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';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* --------------------------------------------------------------------------
|
|
14
|
+
* Bootstrap button.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 = 'button';
|
|
25
|
+
const DATA_KEY = 'bs.button';
|
|
26
|
+
const EVENT_KEY = `.${DATA_KEY}`;
|
|
27
|
+
const DATA_API_KEY = '.data-api';
|
|
28
|
+
const CLASS_NAME_ACTIVE = 'active';
|
|
29
|
+
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
|
|
30
|
+
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Class definition
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
class Button extends BaseComponent {
|
|
37
|
+
// Getters
|
|
38
|
+
static get NAME() {
|
|
39
|
+
return NAME;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Public
|
|
43
|
+
toggle() {
|
|
44
|
+
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
|
45
|
+
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Static
|
|
49
|
+
static jQueryInterface(config) {
|
|
50
|
+
return this.each(function () {
|
|
51
|
+
const data = Button.getOrCreateInstance(this);
|
|
52
|
+
if (config === 'toggle') {
|
|
53
|
+
data[config]();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Data API implementation
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
const button = event.target.closest(SELECTOR_DATA_TOGGLE);
|
|
66
|
+
const data = Button.getOrCreateInstance(button);
|
|
67
|
+
data.toggle();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* jQuery
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
index_js.defineJQueryPlugin(Button);
|
|
75
|
+
|
|
76
|
+
return Button;
|
|
77
|
+
|
|
78
|
+
}));
|