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.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +61 -0
  3. data/CHANGELOG.md +7 -2
  4. data/Gemfile +1 -0
  5. data/README.md +33 -15
  6. data/Rakefile +1 -2
  7. data/assets/javascripts/bootstrap/alert.js +50 -147
  8. data/assets/javascripts/bootstrap/base-component.js +83 -0
  9. data/assets/javascripts/bootstrap/button.js +40 -190
  10. data/assets/javascripts/bootstrap/carousel.js +282 -537
  11. data/assets/javascripts/bootstrap/collapse.js +166 -314
  12. data/assets/javascripts/bootstrap/dom/data.js +62 -0
  13. data/assets/javascripts/bootstrap/dom/event-handler.js +236 -0
  14. data/assets/javascripts/bootstrap/dom/manipulator.js +71 -0
  15. data/assets/javascripts/bootstrap/dom/selector-engine.js +103 -0
  16. data/assets/javascripts/bootstrap/dropdown.js +297 -455
  17. data/assets/javascripts/bootstrap/modal.js +223 -566
  18. data/assets/javascripts/bootstrap/offcanvas.js +245 -0
  19. data/assets/javascripts/bootstrap/popover.js +59 -208
  20. data/assets/javascripts/bootstrap/scrollspy.js +213 -276
  21. data/assets/javascripts/bootstrap/tab.js +222 -200
  22. data/assets/javascripts/bootstrap/toast.js +137 -206
  23. data/assets/javascripts/bootstrap/tooltip.js +403 -747
  24. data/assets/javascripts/bootstrap/util/backdrop.js +138 -0
  25. data/assets/javascripts/bootstrap/util/component-functions.js +41 -0
  26. data/assets/javascripts/bootstrap/util/config.js +67 -0
  27. data/assets/javascripts/bootstrap/util/focustrap.js +112 -0
  28. data/assets/javascripts/bootstrap/util/index.js +280 -0
  29. data/assets/javascripts/bootstrap/util/sanitizer.js +113 -0
  30. data/assets/javascripts/bootstrap/util/scrollbar.js +112 -0
  31. data/assets/javascripts/bootstrap/util/swipe.js +134 -0
  32. data/assets/javascripts/bootstrap/util/template-factory.js +150 -0
  33. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  34. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  35. data/assets/javascripts/bootstrap-sprockets.js +21 -5
  36. data/assets/javascripts/bootstrap.js +3625 -3488
  37. data/assets/javascripts/bootstrap.min.js +3 -3
  38. data/assets/stylesheets/_bootstrap-grid.scss +53 -21
  39. data/assets/stylesheets/_bootstrap-reboot.scss +5 -7
  40. data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
  41. data/assets/stylesheets/_bootstrap.scss +21 -13
  42. data/assets/stylesheets/bootstrap/_accordion.scss +153 -0
  43. data/assets/stylesheets/bootstrap/_alert.scss +32 -16
  44. data/assets/stylesheets/bootstrap/_badge.scss +15 -31
  45. data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -24
  46. data/assets/stylesheets/bootstrap/_button-group.scss +32 -48
  47. data/assets/stylesheets/bootstrap/_buttons.scss +145 -71
  48. data/assets/stylesheets/bootstrap/_card.scss +67 -115
  49. data/assets/stylesheets/bootstrap/_carousel.scss +63 -37
  50. data/assets/stylesheets/bootstrap/_close.scss +53 -27
  51. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  52. data/assets/stylesheets/bootstrap/_dropdown.scss +129 -71
  53. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  54. data/assets/stylesheets/bootstrap/_functions.scss +135 -23
  55. data/assets/stylesheets/bootstrap/_grid.scss +18 -52
  56. data/assets/stylesheets/bootstrap/_helpers.scss +12 -0
  57. data/assets/stylesheets/bootstrap/_list-group.scss +93 -48
  58. data/assets/stylesheets/bootstrap/_maps.scss +174 -0
  59. data/assets/stylesheets/bootstrap/_mixins.scss +10 -15
  60. data/assets/stylesheets/bootstrap/_modal.scss +112 -112
  61. data/assets/stylesheets/bootstrap/_nav.scss +100 -28
  62. data/assets/stylesheets/bootstrap/_navbar.scss +130 -173
  63. data/assets/stylesheets/bootstrap/_offcanvas.scss +147 -0
  64. data/assets/stylesheets/bootstrap/_pagination.scss +72 -37
  65. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  66. data/assets/stylesheets/bootstrap/_popover.scss +99 -73
  67. data/assets/stylesheets/bootstrap/_progress.scss +35 -14
  68. data/assets/stylesheets/bootstrap/_reboot.scss +319 -192
  69. data/assets/stylesheets/bootstrap/_root.scss +177 -9
  70. data/assets/stylesheets/bootstrap/_spinners.scss +43 -23
  71. data/assets/stylesheets/bootstrap/_tables.scss +101 -115
  72. data/assets/stylesheets/bootstrap/_toasts.scss +54 -27
  73. data/assets/stylesheets/bootstrap/_tooltip.scss +67 -63
  74. data/assets/stylesheets/bootstrap/_transitions.scss +3 -2
  75. data/assets/stylesheets/bootstrap/_type.scss +40 -59
  76. data/assets/stylesheets/bootstrap/_utilities.scss +806 -18
  77. data/assets/stylesheets/bootstrap/_variables-dark.scss +102 -0
  78. data/assets/stylesheets/bootstrap/_variables.scss +1210 -606
  79. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +97 -0
  80. data/assets/stylesheets/bootstrap/forms/_form-check.scss +189 -0
  81. data/assets/stylesheets/bootstrap/forms/_form-control.scss +214 -0
  82. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  83. data/assets/stylesheets/bootstrap/forms/_form-select.scss +80 -0
  84. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  85. data/assets/stylesheets/bootstrap/forms/_input-group.scss +132 -0
  86. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  87. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  88. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +7 -0
  89. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +30 -0
  90. data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
  91. data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
  92. data/assets/stylesheets/bootstrap/helpers/_position.scss +36 -0
  93. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  94. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  95. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  96. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  97. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  98. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  99. data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -6
  100. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  101. data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
  102. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
  103. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  104. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +20 -16
  105. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +60 -100
  106. data/assets/stylesheets/bootstrap/mixins/_caret.scss +34 -27
  107. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  108. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  109. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  110. data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
  111. data/assets/stylesheets/bootstrap/mixins/_forms.scss +64 -96
  112. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  113. data/assets/stylesheets/bootstrap/mixins/_grid.scss +118 -36
  114. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  115. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +7 -2
  116. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  117. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +7 -19
  118. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  119. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +24 -0
  120. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  121. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +97 -0
  122. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +33 -0
  123. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  124. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +211 -91
  125. data/bootstrap.gemspec +6 -6
  126. data/lib/bootstrap/engine.rb +0 -1
  127. data/lib/bootstrap/version.rb +2 -2
  128. data/tasks/updater/js.rb +17 -5
  129. data/tasks/updater/network.rb +2 -2
  130. data/tasks/updater/scss.rb +2 -2
  131. data/tasks/updater.rb +2 -2
  132. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  133. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  134. data/test/dummy_rails/app/views/pages/root.html +89 -0
  135. data/test/dummy_rails/config/application.rb +0 -5
  136. data/test/dummy_rails/public/favicon.ico +0 -0
  137. data/test/gemfiles/rails_4_2.gemfile +2 -1
  138. data/test/gemfiles/rails_5_0.gemfile +1 -2
  139. data/test/gemfiles/rails_5_1.gemfile +1 -2
  140. data/test/gemfiles/rails_5_2.gemfile +7 -0
  141. data/test/gemfiles/rails_6_0.gemfile +1 -1
  142. data/test/gemfiles/rails_6_1.gemfile +7 -0
  143. data/test/gemfiles/rails_7_0_dartsass.gemfile +0 -1
  144. data/test/gemfiles/rails_7_0_sassc.gemfile +0 -1
  145. data/test/rails_test.rb +0 -5
  146. data/test/test_helper.rb +3 -2
  147. metadata +92 -86
  148. data/.travis.yml +0 -31
  149. data/assets/javascripts/bootstrap/util.js +0 -189
  150. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  151. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  152. data/assets/stylesheets/bootstrap/_input-group.scss +0 -211
  153. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  154. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  155. data/assets/stylesheets/bootstrap/_print.scss +0 -132
  156. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  157. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  158. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  159. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  160. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  161. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  162. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  163. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  164. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  165. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  166. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  167. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  168. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  169. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  170. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  171. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  172. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  173. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  174. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  175. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  176. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  177. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  178. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  179. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  180. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  181. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  182. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  183. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  184. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  185. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  186. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd382f63309c8fbf7da627ee4990fdaeb3e9eb7f25ba5d06f77346c0dcc68de4
4
- data.tar.gz: 2c24101f290892643a48f3d530132cca24fb35b9d05e8b19c5305056508065ac
3
+ metadata.gz: b5bca71288a91d860c55563440f48e9df863f1700bf998ed61776d3536e2f397
4
+ data.tar.gz: 01a1490029857cbb450a1c03fdc769c64b1a136abf20091c790f1f0241e531f5
5
5
  SHA512:
6
- metadata.gz: ed3113b844e211e9bd1875de399f167043a7b57c81d399fedaa9fb2a6e9b49dd01d1164c89801476bf6ccce66baf3c88fa88d086895cfc655429f14f821c6b2b
7
- data.tar.gz: b79d08b3e67931da95f530aea47619c1eb486f7f1cf3eae873645b875f65aec62f30018fbd169a490add197037650f0f3cca4dd11de4a7b07f603bbb6c2fb0c8
6
+ metadata.gz: c69ffecb7d28116e379082881823ebeec23bc9bff8496e2fadebb7875dfd24493e92c3066370b2c16136a47072122aa634c540d5c6d7efd271fc720cab138fa9
7
+ data.tar.gz: a3864d7a58c8f85bcccdf06aae34ff2aa10c2a76b84f4d119cd4530a81f29c710635e6d62a281d8e886f6972dfc1dde11af7f17888bcde85723a1c72eeb7f116
@@ -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/CHANGELOG.md CHANGED
@@ -6,9 +6,14 @@ The changelog only includes changes specific to the RubyGem.
6
6
  The Bootstrap framework changes can be found in [the Releases section of twbs/bootstrap](https://github.com/twbs/bootstrap/releases).
7
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
8
 
9
- # 4.6.2.1
9
+ # 5.3.4
10
10
 
11
- * Adds support for other Sass compilers. [#278](https://github.com/twbs/bootstrap-rubygem/pull/278)
11
+ * Autoprefixer is now optional.
12
+ [#283](https://github.com/twbs/bootstrap-rubygem/pull/283)
13
+
14
+ # 5.3.3
15
+
16
+ * Adds support for other Sass engines: dartsass-sprockets, dartsass-rails, and cssbundling-rails.
12
17
 
13
18
  # 4.2.1
14
19
 
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ gemspec
4
4
 
5
5
  group :development do
6
6
  gem 'popper_js', '>= 1.12.3'
7
+ gem 'dartsass-sprockets'
7
8
  end
8
9
 
9
10
  group :debug do
data/README.md CHANGED
@@ -1,9 +1,13 @@
1
- # Bootstrap Ruby Gem [![Build Status](https://travis-ci.org/twbs/bootstrap-rubygem.svg?branch=master)](https://travis-ci.org/twbs/bootstrap-rubygem) [![Gem](https://img.shields.io/gem/v/bootstrap.svg)](https://rubygems.org/gems/bootstrap)
1
+ # Bootstrap Ruby Gem [![CI](https://github.com/twbs/bootstrap-rubygem/actions/workflows/ci.yml/badge.svg)](https://github.com/twbs/bootstrap-rubygem/actions/workflows/ci.yml) [![Gem](https://img.shields.io/gem/v/bootstrap.svg)](https://rubygems.org/gems/bootstrap)
2
2
 
3
- [Bootstrap 4][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 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
+
7
11
  ## Installation
8
12
 
9
13
  Please see the appropriate guide for your environment of choice:
@@ -17,16 +21,19 @@ Please see the appropriate guide for your environment of choice:
17
21
  Add `bootstrap` to your Gemfile:
18
22
 
19
23
  ```ruby
20
- gem 'bootstrap', '~> 4.6.2.1'
24
+ gem 'bootstrap', '~> 5.3.3'
21
25
  ```
22
26
 
23
- This gem requires a Sass engine, so make sure you have **one** of these four gems in your Gemfile:
27
+ This gem requires a Sass engine, so make sure you have **one** of these gems in your Gemfile:
24
28
  - [`dartsass-sprockets`](https://github.com/tablecheck/dartsass-sprockets): Dart Sass engine, recommended but only works for Ruby 2.6+ and Rails 5+
25
29
  - [`dartsass-rails`](https://github.com/rails/dartsass-rails): Dart Sass engine, recommended for Rails projects that use Propshaft
26
30
  - [`cssbundling-rails`](https://github.com/rails/cssbundling-rails): External Sass engine
27
31
  - [`sassc-rails`](https://github.com/sass/sassc-rails): SassC engine, deprecated but compatible with Ruby 2.3+ and Rails 4
28
32
 
29
- Ensure that `sprockets-rails` is at least v2.3.2.
33
+ Also ensure that `sprockets-rails` is at least v2.3.2.
34
+
35
+ For wider browser compatibility, use [Autoprefixer][autoprefixer].
36
+ If you are using Rails, add the `autoprefixer-rails` gem to your app and ensure you have a JavaScript runtime (e.g. NodeJS).
30
37
 
31
38
  `bundle install` and restart your server to make the files available through the pipeline.
32
39
 
@@ -50,8 +57,8 @@ Then, remove all the `*= require` and `*= require_tree` statements from the Sass
50
57
 
51
58
  Do not use `*= require` in Sass or your other stylesheets will not be able to access the Bootstrap mixins and variables.
52
59
 
53
- Bootstrap JavaScript depends on jQuery.
54
- If you're using Rails 5.1+, add the `jquery-rails` gem to your Gemfile:
60
+ Bootstrap JavaScript can optionally use jQuery.
61
+ If you're using Rails 5.1+, you can add the `jquery-rails` gem to your Gemfile:
55
62
 
56
63
  ```ruby
57
64
  gem 'jquery-rails'
@@ -61,6 +68,25 @@ Bootstrap tooltips and popovers depend on [popper.js] for positioning.
61
68
  The `bootstrap` gem already depends on the
62
69
  [popper_js](https://github.com/glebm/popper_js-rubygem) gem.
63
70
 
71
+ #### Importmaps
72
+
73
+ You can pin either `bootstrap.js` or `bootstrap.min.js` in `config/importmap.rb`
74
+ as well as `popper.js`:
75
+
76
+ ```ruby
77
+ pin "bootstrap", to: "bootstrap.min.js", preload: true
78
+ pin "@popperjs/core", to: "popper.js", preload: true
79
+ ```
80
+
81
+ Whichever files you pin will need to be added to `config.assets.precompile`:
82
+
83
+ ```ruby
84
+ # config/initializers/assets.rb
85
+ Rails.application.config.assets.precompile += %w(bootstrap.min.js popper.js)
86
+ ```
87
+
88
+ #### Sprockets
89
+
64
90
  Add Bootstrap dependencies and Bootstrap to your `application.js`:
65
91
 
66
92
  ```js
@@ -90,14 +116,6 @@ Refer to your framework's documentation on the subject.
90
116
 
91
117
  ## Configuration
92
118
 
93
- ### Sass: Autoprefixer
94
-
95
- Bootstrap requires the use of [Autoprefixer][autoprefixer].
96
- [Autoprefixer][autoprefixer] adds vendor prefixes to CSS rules using values from [Can I Use](http://caniuse.com/).
97
-
98
- If you are using bootstrap with Rails, autoprefixer is set up for you automatically.
99
- Otherwise, please consult the [Autoprefixer documentation][autoprefixer].
100
-
101
119
  ### Sass: Individual components
102
120
 
103
121
  By default all of Bootstrap is imported.
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'bundler/setup'
2
3
 
3
4
  lib_path = File.join(File.dirname(__FILE__), 'lib')
4
5
  $:.unshift(lib_path) unless $:.include?(lib_path)
@@ -56,7 +57,6 @@ task :debug do
56
57
  end
57
58
  require './lib/bootstrap'
58
59
  require 'term/ansicolor'
59
- require 'autoprefixer-rails'
60
60
  path = Bootstrap.stylesheets_path
61
61
  %w(_bootstrap _bootstrap-reboot _bootstrap-grid).each do |file|
62
62
  filename = "#{path}/#{file}.scss"
@@ -65,7 +65,6 @@ task :debug do
65
65
  else
66
66
  Sass.compile(filename).css
67
67
  end
68
- css = AutoprefixerRails.process(css)
69
68
  out = File.join('tmp', "#{file[1..-1]}.css")
70
69
  File.write(out, css)
71
70
  $stderr.puts Term::ANSIColor.green "Compiled #{out}"
@@ -1,185 +1,88 @@
1
1
  /*!
2
- * Bootstrap alert.js v4.6.2 (https://getbootstrap.com/)
3
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2
+ * Bootstrap alert.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('jquery'), require('./util.js')) :
8
- typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.jQuery, global.Util));
10
- })(this, (function ($, Util) { 'use strict';
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
11
 
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
- var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
12
+ /**
13
+ * --------------------------------------------------------------------------
14
+ * Bootstrap alert.js
15
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
+ * --------------------------------------------------------------------------
17
+ */
16
18
 
17
- function _defineProperties(target, props) {
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
19
 
36
20
  /**
37
21
  * Constants
38
22
  */
39
23
 
40
- var NAME = 'alert';
41
- var VERSION = '4.6.2';
42
- var DATA_KEY = 'bs.alert';
43
- var EVENT_KEY = "." + DATA_KEY;
44
- var DATA_API_KEY = '.data-api';
45
- var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
46
- var CLASS_NAME_ALERT = 'alert';
47
- var CLASS_NAME_FADE = 'fade';
48
- var CLASS_NAME_SHOW = 'show';
49
- var EVENT_CLOSE = "close" + EVENT_KEY;
50
- var EVENT_CLOSED = "closed" + EVENT_KEY;
51
- var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
52
- var SELECTOR_DISMISS = '[data-dismiss="alert"]';
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
+
53
32
  /**
54
33
  * Class definition
55
34
  */
56
35
 
57
- var Alert = /*#__PURE__*/function () {
58
- function Alert(element) {
59
- this._element = element;
60
- } // Getters
61
-
62
-
63
- var _proto = Alert.prototype;
36
+ class Alert extends BaseComponent {
37
+ // Getters
38
+ static get NAME() {
39
+ return NAME;
40
+ }
64
41
 
65
42
  // Public
66
- _proto.close = function close(element) {
67
- var rootElement = this._element;
68
-
69
- if (element) {
70
- rootElement = this._getRootElement(element);
71
- }
72
-
73
- var customEvent = this._triggerCloseEvent(rootElement);
74
-
75
- if (customEvent.isDefaultPrevented()) {
43
+ close() {
44
+ const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
45
+ if (closeEvent.defaultPrevented) {
76
46
  return;
77
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
+ }
78
52
 
79
- this._removeElement(rootElement);
80
- };
81
-
82
- _proto.dispose = function dispose() {
83
- $__default["default"].removeData(this._element, DATA_KEY);
84
- this._element = null;
85
- } // Private
86
- ;
87
-
88
- _proto._getRootElement = function _getRootElement(element) {
89
- var selector = Util__default["default"].getSelectorFromElement(element);
90
- var parent = false;
91
-
92
- if (selector) {
93
- parent = document.querySelector(selector);
94
- }
95
-
96
- if (!parent) {
97
- parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0];
98
- }
99
-
100
- return parent;
101
- };
102
-
103
- _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
104
- var closeEvent = $__default["default"].Event(EVENT_CLOSE);
105
- $__default["default"](element).trigger(closeEvent);
106
- return closeEvent;
107
- };
108
-
109
- _proto._removeElement = function _removeElement(element) {
110
- var _this = this;
111
-
112
- $__default["default"](element).removeClass(CLASS_NAME_SHOW);
113
-
114
- if (!$__default["default"](element).hasClass(CLASS_NAME_FADE)) {
115
- this._destroyElement(element);
116
-
117
- return;
118
- }
119
-
120
- var transitionDuration = Util__default["default"].getTransitionDurationFromElement(element);
121
- $__default["default"](element).one(Util__default["default"].TRANSITION_END, function (event) {
122
- return _this._destroyElement(element, event);
123
- }).emulateTransitionEnd(transitionDuration);
124
- };
125
-
126
- _proto._destroyElement = function _destroyElement(element) {
127
- $__default["default"](element).detach().trigger(EVENT_CLOSED).remove();
128
- } // Static
129
- ;
53
+ // Private
54
+ _destroyElement() {
55
+ this._element.remove();
56
+ EventHandler.trigger(this._element, EVENT_CLOSED);
57
+ this.dispose();
58
+ }
130
59
 
131
- Alert._jQueryInterface = function _jQueryInterface(config) {
60
+ // Static
61
+ static jQueryInterface(config) {
132
62
  return this.each(function () {
133
- var $element = $__default["default"](this);
134
- var data = $element.data(DATA_KEY);
135
-
136
- if (!data) {
137
- data = new Alert(this);
138
- $element.data(DATA_KEY, data);
63
+ const data = Alert.getOrCreateInstance(this);
64
+ if (typeof config !== 'string') {
65
+ return;
139
66
  }
140
-
141
- if (config === 'close') {
142
- data[config](this);
67
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
68
+ throw new TypeError(`No method named "${config}"`);
143
69
  }
70
+ data[config](this);
144
71
  });
145
- };
146
-
147
- Alert._handleDismiss = function _handleDismiss(alertInstance) {
148
- return function (event) {
149
- if (event) {
150
- event.preventDefault();
151
- }
152
-
153
- alertInstance.close(this);
154
- };
155
- };
156
-
157
- _createClass(Alert, null, [{
158
- key: "VERSION",
159
- get: function get() {
160
- return VERSION;
161
- }
162
- }]);
72
+ }
73
+ }
163
74
 
164
- return Alert;
165
- }();
166
75
  /**
167
76
  * Data API implementation
168
77
  */
169
78
 
79
+ componentFunctions_js.enableDismissTrigger(Alert, 'close');
170
80
 
171
- $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
172
81
  /**
173
82
  * jQuery
174
83
  */
175
84
 
176
- $__default["default"].fn[NAME] = Alert._jQueryInterface;
177
- $__default["default"].fn[NAME].Constructor = Alert;
178
-
179
- $__default["default"].fn[NAME].noConflict = function () {
180
- $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
181
- return Alert._jQueryInterface;
182
- };
85
+ index_js.defineJQueryPlugin(Alert);
183
86
 
184
87
  return Alert;
185
88
 
@@ -0,0 +1,83 @@
1
+ /*!
2
+ * Bootstrap base-component.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('./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.5';
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
+ }));