Compare commits
436 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f2480a90a | |||
| c0aa405632 | |||
| e6ab4ad86a | |||
| af4419b723 | |||
| f083759d03 | |||
| 89dc9750ec | |||
| e0f89dc90b | |||
| 30d375b33f | |||
| 6879a3c51d | |||
| d44a1e105e | |||
| 81d3e2b917 | |||
| 1abe9264aa | |||
| f530ab7549 | |||
| 0ec2ce44b4 | |||
| cc49a5b506 | |||
| 99013a5c54 | |||
| 38bcf108c9 | |||
| f40e1b651b | |||
| ad8d3a6c54 | |||
| 9a6cfeb36e | |||
| ea01c29294 | |||
| 234dd96abf | |||
| c49b084158 | |||
| b2ef98f154 | |||
| 04dbb6c24c | |||
| 5a9fc2938c | |||
| c995886c0f | |||
| 9b241e630c | |||
| 920dc619a4 | |||
| f6b74b8b41 | |||
| 2e991732de | |||
| 2314247825 | |||
| 3349eb6a41 | |||
| 6c04d186e2 | |||
| 7de8582657 | |||
| 242f75cd1f | |||
| 78a51cb12f | |||
| 89be07b51f | |||
| 4f44a2afd0 | |||
| 7b5e48d307 | |||
| c3572ceca9 | |||
| 7c6a0db820 | |||
| 5b8163301c | |||
| e9f039d1fe | |||
| ba6d5e802b | |||
| 8429acf460 | |||
| 3caea1ca02 | |||
| 7ac763bcdc | |||
| 8bc6dcd280 | |||
| 288b9b82b5 | |||
| ac3c2e2356 | |||
| 24d5a1e996 | |||
| 35310454b1 | |||
| 7a9bbd4489 | |||
| fdb596b2c3 | |||
| ce23903a76 | |||
| ac48bbe081 | |||
| f4a7888af5 | |||
| 4e685e70b7 | |||
| b287736327 | |||
| 6f4d9fff02 | |||
| daa01aacb5 | |||
| 58dd4cc66c | |||
| a8eb919f44 | |||
| 700c6036aa | |||
| 7a6da5e3e7 | |||
| 109ad5db90 | |||
| 4a0ddb02db | |||
| 0f26be5ff3 | |||
| 842b0d2ae4 | |||
| 32932d27d5 | |||
| 4a26e51540 | |||
| 0f3eda8254 | |||
| 30e7df6cca | |||
| f1827ce9cd | |||
| eb1df3e079 | |||
| df91d2cab0 | |||
| d2f9fbd055 | |||
| bad48dc3b9 | |||
| 86f2c01459 | |||
| 955c437f32 | |||
| eb720f20ff | |||
| 53eace04df | |||
| 1c9e203c52 | |||
| 5f79b75ea8 | |||
| 195585f5a6 | |||
| fa8a7eca06 | |||
| 52fdab8d70 | |||
| b3601aae5b | |||
| 456194da11 | |||
| fb4c8eacb0 | |||
| 5d10e4a58e | |||
| fce3370843 | |||
| 345d68cdbb | |||
| a1d8ed4413 | |||
| 4111242cbb | |||
| e82888daf4 | |||
| 015aaf3c3d | |||
| 22f75ca2e3 | |||
| 5f267b1854 | |||
| 0f6cb9139f | |||
| f3aed77dc7 | |||
| d8691fcd5a | |||
| 566c829a1c | |||
| e51a09a2b8 | |||
| 8876866399 | |||
| d63b651f37 | |||
| 1fef25b777 | |||
| 63dbe4705d | |||
| 5f00bba652 | |||
| c06a1f305d | |||
| 1b16736a72 | |||
| ec637483f2 | |||
| 971738b4b5 | |||
| 33f47771ca | |||
| 6d9256d2b1 | |||
| f93e58eddb | |||
| e344ed4446 | |||
| f79d14f7c8 | |||
| 748b1b9a5a | |||
| 5ecccd1171 | |||
| 92fe8445b1 | |||
| 9c7ee5e554 | |||
| f5c7da4c78 | |||
| 7a678fc64f | |||
| a66d9a3d50 | |||
| 9d0097013a | |||
| 4853c5b527 | |||
| c4355e4a6b | |||
| 0321c632ed | |||
| e33e344410 | |||
| 9f7fc4ac2b | |||
| f5ec0dbf74 | |||
| d848c32297 | |||
| 05cfefd32b | |||
| 04b8219c18 | |||
| 341ad62517 | |||
| 5053725870 | |||
| 04c1ecd79d | |||
| abc17a4858 | |||
| 4d863effdb | |||
| 5455e30048 | |||
| c1a75a7d8f | |||
| adb08ca33a | |||
| 5f15f8cdbd | |||
| 6edeaa4291 | |||
| fe9384c216 | |||
| ddc58343d3 | |||
| 706bd3602d | |||
| 0cf29baf63 | |||
| 8cc9defbc0 | |||
| 1b575c27cd | |||
| f7ed579d91 | |||
| 0225c1173b | |||
| 467c961976 | |||
| b30c68f8a1 | |||
| 573c10f099 | |||
| effe4e9588 | |||
| dabd458b4b | |||
| 0c8d8a48e1 | |||
| 03fec36b44 | |||
| 138e8da421 | |||
| 45c99f7130 | |||
| 8b6dd449d7 | |||
| ac5685d368 | |||
| 81e8f52fcb | |||
| d65977a991 | |||
| 90fef3086d | |||
| 9b71d9817d | |||
| 3b5283602c | |||
| cc3ca2586f | |||
| 906a5de548 | |||
| 61276d0881 | |||
| 0ca1ec6fc3 | |||
| f852dff122 | |||
| efb3fc402e | |||
| 81ba76bb3c | |||
| 39ac525f6e | |||
| fa7510c6af | |||
| 69f36286f9 | |||
| 52c13233a3 | |||
| 642d1001e3 | |||
| 473d36ff38 | |||
| 4a7cbd5b9f | |||
| c40b71318c | |||
| 037bad148c | |||
| 0bd57ce212 | |||
| 8c4b61e30c | |||
| c77ec4fb06 | |||
| 4ea685a001 | |||
| 0d35f10842 | |||
| 6daae47cc0 | |||
| 0f0a8c364d | |||
| 7ca811315f | |||
| 1884b8a421 | |||
| 92525e9ec4 | |||
| 6c46493803 | |||
| f737c73a27 | |||
| 411922b14d | |||
| 21041eecb7 | |||
| fbf294a605 | |||
| 0d1aee6a2f | |||
| 3c0cf9365b | |||
| 0e09c6b831 | |||
| 80d842b501 | |||
| 55945dcc36 | |||
| 42714733b6 | |||
| 35d5cbf4fd | |||
| 0d08c74d2f | |||
| 00b0e0a9b7 | |||
| 16a82e7e99 | |||
| e2530bf312 | |||
| 2d54fa9c3f | |||
| 97e2e0da7c | |||
| b77af55325 | |||
| 52aceee0ab | |||
| 70de5e8398 | |||
| 52762f83d8 | |||
| dca1ab7d87 | |||
| b07b6f743c | |||
| 0d148d8854 | |||
| c24aaa6cbf | |||
| 301ee1972d | |||
| 593574d510 | |||
| d61bba584f | |||
| 7aa1722a97 | |||
| 340009e6de | |||
| bdd8752994 | |||
| e0a2d5890d | |||
| 136afcf59b | |||
| eb1e1cfb49 | |||
| 5be0fe8820 | |||
| a0bb417691 | |||
| 590c1baeeb | |||
| f12ae8cea2 | |||
| 6b7ca1234b | |||
| 0aa6a81c11 | |||
| 7629daedc1 | |||
| dd96b832f7 | |||
| 29f585365f | |||
| f55566e36b | |||
| 7ecfa6a343 | |||
| 7453733ff6 | |||
| dd6b8682a6 | |||
| 8e935b60c8 | |||
| 9be7aac831 | |||
| f830450ca8 | |||
| b0b8d3c982 | |||
| 90d4b72e06 | |||
| ea1d09c444 | |||
| 7bd70e54f2 | |||
| ed4a4e6081 | |||
| 087d0ea1e1 | |||
| 8cf6c209d8 | |||
| db19e8c706 | |||
| 510a446be6 | |||
| 327bfca418 | |||
| be452a0ed3 | |||
| 23a78f0ab1 | |||
| 6c9640c245 | |||
| 1260b4fb3f | |||
| d521e147f9 | |||
| f47243460e | |||
| 91a9fd96b9 | |||
| 5e304b60a1 | |||
| 4c74d58f26 | |||
| cd64a164f1 | |||
| 1f2b048312 | |||
| caf889e49e | |||
| b5ba078b12 | |||
| cdfba0be4a | |||
| 61cc86d68d | |||
| 846b603413 | |||
| 791b1943f2 | |||
| 8741eed7a5 | |||
| afc9cae32c | |||
| d08567797f | |||
| acb2b7061c | |||
| 9ed860ef24 | |||
| 28758a03f0 | |||
| f732bf025a | |||
| 68ddcec057 | |||
| 6d5739320e | |||
| 5d39e36083 | |||
| 269e5351aa | |||
| ef1c7aadbc | |||
| dd181e91bd | |||
| bab999701c | |||
| 41b8ce278b | |||
| de94f6003f | |||
| 3a3b0a4eae | |||
| c4e5aa0d32 | |||
| 7652d326e4 | |||
| 6381c63fb1 | |||
| 9e1ef5623f | |||
| 9519b9e055 | |||
| 94395af932 | |||
| 81d5e6eb1b | |||
| 38d055e7fb | |||
| 727c1684bb | |||
| e538b9f23e | |||
| 116da0b746 | |||
| c387223720 | |||
| 81fa902454 | |||
| d55f6c3073 | |||
| e5a3ee5e9c | |||
| 3695c3a1fb | |||
| 2892675f65 | |||
| 9abaafa546 | |||
| c93fdec2f0 | |||
| 8c3a1298f7 | |||
| fb6266a8df | |||
| 96d4a64944 | |||
| cf07b5a7ab | |||
| f6b00cda24 | |||
| af0786b10f | |||
| d5266dc995 | |||
| 397359154c | |||
| cd58245f10 | |||
| e4d4c5d0bc | |||
| 8f95b26d65 | |||
| e1cd51e4fb | |||
| dcdd9be0b3 | |||
| 48e86c5796 | |||
| d59aa2c702 | |||
| 22f6a4beea | |||
| 470adc3f16 | |||
| e01103e3f9 | |||
| 9322cc83bc | |||
| 0f376c1107 | |||
| b66abdf3b1 | |||
| 1bee3c03cf | |||
| a2a38058af | |||
| 41fd25abe1 | |||
| f233e05acc | |||
| eeea633150 | |||
| a5d280365b | |||
| c26e68427c | |||
| 68ab243ffa | |||
| cac30c0722 | |||
| def8173e7b | |||
| 921f17a650 | |||
| 636204974b | |||
| c6cbae6b2a | |||
| 4e4a1febb0 | |||
| f2185b9b5f | |||
| a894ea3a51 | |||
| 0ad0985ac0 | |||
| d361194a99 | |||
| 3d72b94ee9 | |||
| d395dfaafc | |||
| e61d609bc0 | |||
| 23d7dd6dbd | |||
| be80d26cdb | |||
| 22f6b373f9 | |||
| a92f838c8d | |||
| e76fce5852 | |||
| c121778b49 | |||
| 4376d92ea7 | |||
| de163b337c | |||
| 5f44e01dab | |||
| 1c5e1cb3c9 | |||
| b165aff2f7 | |||
| 1bdeab8159 | |||
| 1da3aa3103 | |||
| 6587e5cf80 | |||
| 6c9f833a90 | |||
| 24abed1336 | |||
| 5bf876cb0f | |||
| 911b72cf78 | |||
| e0d0f5a1c6 | |||
| 5baad13902 | |||
| d9a8b8ea80 | |||
| 1161bff6eb | |||
| a84a05a56a | |||
| 9d075734cb | |||
| 9508c4c11b | |||
| 01a71532d9 | |||
| 621391255b | |||
| c6dd1a7d93 | |||
| fe777292b5 | |||
| 67be130c7b | |||
| be7198a05b | |||
| f72d2511ba | |||
| 4251c23f71 | |||
| fc745a3ec8 | |||
| e9d8c1a9dd | |||
| 36ea7e7421 | |||
| aa7b055064 | |||
| add38103ad | |||
| 5c65ea6a38 | |||
| 27287a6884 | |||
| cc5292f510 | |||
| 7da9729a62 | |||
| 605704d7f5 | |||
| 68932330f0 | |||
| 78f47133e9 | |||
| c50c1e9d23 | |||
| 10f91729aa | |||
| 57ff6ee9ef | |||
| 77973cd7fb | |||
| 41eea9edc4 | |||
| 060880296a | |||
| 1c7cb61072 | |||
| 3bf08d87c9 | |||
| 8fda884ad3 | |||
| c0b2f72a06 | |||
| 12532dc913 | |||
| 3ab0441667 | |||
| 60f31b32f8 | |||
| 77212386c0 | |||
| e34ba3532f | |||
| 72a1437dae | |||
| 413c313644 | |||
| c9159ccf05 | |||
| 9ba80d31d4 | |||
| 86a97d197e | |||
| 87527d8149 | |||
| be8ef5f655 | |||
| 86de1d3875 | |||
| dad0765ed3 | |||
| f2b9055c2b | |||
| a5179125b0 | |||
| 1a8886b7f7 | |||
| ba641ae507 | |||
| 11c40217cf | |||
| 3b6c5ee620 | |||
| d30039c1a9 | |||
| a46866c950 | |||
| 146cfa21a3 | |||
| 5e9fd345da | |||
| b2e9341b8c | |||
| 58a1c6ef92 | |||
| fad6dda456 | |||
| 60ba89b9a7 | |||
| 8d109b62ba |
+3
-6
@@ -1,17 +1,14 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@babel/env',
|
||||
'@babel/preset-env',
|
||||
{
|
||||
loose: true,
|
||||
modules: false,
|
||||
exclude: ['transform-typeof-symbol']
|
||||
bugfixes: true,
|
||||
modules: false
|
||||
}
|
||||
]
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-proposal-object-rest-spread'
|
||||
],
|
||||
env: {
|
||||
test: {
|
||||
plugins: [ 'istanbul' ]
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"path": "./dist/css/bootstrap-grid.css",
|
||||
"maxSize": "7 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap-grid.min.css",
|
||||
"maxSize": "6.25 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap-reboot.css",
|
||||
"maxSize": "2 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap-reboot.min.css",
|
||||
"maxSize": "2 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap.css",
|
||||
"maxSize": "25.5 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap.min.css",
|
||||
"maxSize": "23.5 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.bundle.js",
|
||||
"maxSize": "47.50 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.bundle.min.js",
|
||||
"maxSize": "21.5 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.js",
|
||||
"maxSize": "25 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.min.js",
|
||||
"maxSize": "14.75 kB"
|
||||
}
|
||||
],
|
||||
"ci": {
|
||||
"trackBranches": [
|
||||
"main",
|
||||
"v4-dev"
|
||||
]
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -29,6 +29,7 @@
|
||||
"guard-for-in": "error",
|
||||
"no-alert": "error",
|
||||
"no-caller": "error",
|
||||
"no-console": "error",
|
||||
"no-div-regex": "error",
|
||||
"no-else-return": "error",
|
||||
"no-empty-function": "error",
|
||||
@@ -101,7 +102,6 @@
|
||||
"no-shadow": "off",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-undefined": "error",
|
||||
"no-use-before-define": "off",
|
||||
|
||||
// Node.js and CommonJS
|
||||
@@ -111,7 +111,6 @@
|
||||
"no-mixed-requires": "error",
|
||||
"no-new-require": "error",
|
||||
"no-path-concat": "error",
|
||||
"no-process-env": "error",
|
||||
"no-process-exit": "error",
|
||||
"no-restricted-modules": "error",
|
||||
"no-sync": "error",
|
||||
@@ -175,7 +174,6 @@
|
||||
"no-underscore-dangle": "off",
|
||||
"no-unneeded-ternary": "error",
|
||||
"no-whitespace-before-property": "error",
|
||||
"object-curly-newline": ["error", { "minProperties": 1 }],
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"object-property-newline": "error",
|
||||
"one-var": ["error", "never"],
|
||||
|
||||
+2
-12
@@ -1,18 +1,8 @@
|
||||
# Enforce Unix newlines
|
||||
*.css text eol=lf
|
||||
*.html text eol=lf
|
||||
*.js text eol=lf
|
||||
*.json text eol=lf
|
||||
*.md text eol=lf
|
||||
*.rb text eol=lf
|
||||
*.scss text eol=lf
|
||||
*.svg text eol=lf
|
||||
*.txt text eol=lf
|
||||
*.xml text eol=lf
|
||||
*.yml text eol=lf
|
||||
* text=auto eol=lf
|
||||
|
||||
# Don't diff or textually merge source maps
|
||||
*.map binary
|
||||
*.map binary
|
||||
|
||||
bootstrap.css linguist-vendored=false
|
||||
bootstrap.js linguist-vendored=false
|
||||
|
||||
+17
-21
@@ -19,7 +19,8 @@ and [submitting pull requests](#pull-requests), but please respect the following
|
||||
restrictions:
|
||||
|
||||
* Please **do not** use the issue tracker for personal support requests. Stack
|
||||
Overflow ([`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag), [Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](README.md#community) are better places to get help.
|
||||
Overflow ([`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag),
|
||||
[Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](README.md#community) are better places to get help.
|
||||
|
||||
* Please **do not** derail or troll issues. Keep the discussion on topic and
|
||||
respect the opinions of others.
|
||||
@@ -57,15 +58,14 @@ Good bug reports are extremely helpful, so thanks!
|
||||
|
||||
Guidelines for bug reports:
|
||||
|
||||
0. **Validate and lint your code** — [validate your HTML](https://html5.validator.nu/)
|
||||
and [lint your HTML](https://github.com/twbs/bootlint) to ensure your
|
||||
0. **[validate your HTML](https://html5.validator.nu/)** to ensure your
|
||||
problem isn't caused by a simple error in your own code.
|
||||
|
||||
1. **Use the GitHub issue search** — check if the issue has already been
|
||||
reported.
|
||||
|
||||
2. **Check if the issue has been fixed** — try to reproduce it using the
|
||||
latest `master` or development branch in the repository.
|
||||
latest `master` or `v4-dev` branch in the repository.
|
||||
|
||||
3. **Isolate the problem** — ideally create a [reduced test
|
||||
case](https://css-tricks.com/reduced-test-cases/) and a live example.
|
||||
@@ -109,10 +109,6 @@ When feasible, we aim to report such upstream bugs to the relevant browser vendo
|
||||
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | https://bugs.chromium.org/p/chromium/issues/list | Click the "New issue" button. |
|
||||
| Microsoft | Edge | EdgeHTML | https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/ | |
|
||||
|
||||
### Issues bots
|
||||
|
||||
[@twbs-lmvtfy](https://github.com/twbs-lmvtfy) is a Bootstrap bot that hangs out in our GitHub issue tracker and automatically checks for HTML validation errors in live examples (e.g. jsFiddles, JS Bins, Bootplys, Plunks, CodePens, etc.) posted in issue comments. If it finds any errors, it will post a follow-up comment on the issue and point out the errors. If this happens with an example you've posted, please fix the errors and post an updated live example. If you opened a bug report, please check whether the bug still occurs with your revised, valid live example. If the bug no longer occurs, it was probably due to your invalid HTML rather than something in Bootstrap and we'd appreciate it if you could close out the GitHub issue.
|
||||
|
||||
|
||||
## Feature requests
|
||||
|
||||
@@ -139,12 +135,12 @@ project (indentation, accurate comments, etc.) and any other requirements
|
||||
|
||||
**Do not edit `bootstrap.css`, or `bootstrap.js`
|
||||
directly!** Those files are automatically generated. You should edit the
|
||||
source files in [`/bootstrap/scss/`](https://github.com/twbs/bootstrap/tree/master/scss)
|
||||
and/or [`/bootstrap/js/`](https://github.com/twbs/bootstrap/tree/master/js) instead.
|
||||
source files in [`/bootstrap/scss/`](https://github.com/twbs/bootstrap/tree/v4-dev/scss)
|
||||
and/or [`/bootstrap/js/src/`](https://github.com/twbs/bootstrap/tree/v4-dev/js/src) instead.
|
||||
|
||||
Similarly, when contributing to Bootstrap's documentation, you should edit the
|
||||
documentation source files in
|
||||
[the `/bootstrap/docs/` directory of the `master` branch](https://github.com/twbs/bootstrap/tree/master/docs).
|
||||
[the `/bootstrap/site/docs/` directory of the `v4-dev` branch](https://github.com/twbs/bootstrap/tree/v4-dev/site/docs).
|
||||
**Do not edit the `gh-pages` branch.** That branch is generated from the
|
||||
documentation source files and is managed separately by the Bootstrap Core Team.
|
||||
|
||||
@@ -166,8 +162,8 @@ included in the project:
|
||||
2. If you cloned a while ago, get the latest changes from upstream:
|
||||
|
||||
```bash
|
||||
git checkout master
|
||||
git pull upstream master
|
||||
git checkout v4-dev
|
||||
git pull upstream v4-dev
|
||||
```
|
||||
|
||||
3. Create a new topic branch (off the main project development branch) to
|
||||
@@ -186,7 +182,7 @@ included in the project:
|
||||
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
||||
|
||||
```bash
|
||||
git pull [--rebase] upstream master
|
||||
git pull [--rebase] upstream v4-dev
|
||||
```
|
||||
|
||||
6. Push your topic branch up to your fork:
|
||||
@@ -196,12 +192,12 @@ included in the project:
|
||||
```
|
||||
|
||||
7. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/)
|
||||
with a clear title and description against the `master` branch.
|
||||
with a clear title and description against the `v4-dev` branch.
|
||||
|
||||
**IMPORTANT**: By submitting a patch, you agree to allow the project owners to
|
||||
license your work under the terms of the [MIT License](LICENSE) (if it
|
||||
license your work under the terms of the [MIT License](../LICENSE) (if it
|
||||
includes code changes) and under the terms of the
|
||||
[Creative Commons Attribution 3.0 Unported License](docs/LICENSE)
|
||||
[Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/)
|
||||
(if it includes documentation changes).
|
||||
|
||||
|
||||
@@ -209,7 +205,7 @@ includes code changes) and under the terms of the
|
||||
|
||||
### HTML
|
||||
|
||||
[Adhere to the Code Guide.](http://codeguide.co/#html)
|
||||
[Adhere to the Code Guide.](https://codeguide.co/#html)
|
||||
|
||||
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
|
||||
- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`.
|
||||
@@ -217,7 +213,7 @@ includes code changes) and under the terms of the
|
||||
|
||||
### CSS
|
||||
|
||||
[Adhere to the Code Guide.](http://codeguide.co/#css)
|
||||
[Adhere to the Code Guide.](https://codeguide.co/#css)
|
||||
|
||||
- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG20/#visual-audio-contrast).
|
||||
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://a11yproject.com/posts/never-remove-css-outlines/) for more details.
|
||||
@@ -237,7 +233,7 @@ Run `npm run test` before committing to ensure your changes follow our coding st
|
||||
|
||||
## License
|
||||
|
||||
By contributing your code, you agree to license your contribution under the [MIT License](LICENSE).
|
||||
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](docs/LICENSE).
|
||||
By contributing your code, you agree to license your contribution under the [MIT License](../LICENSE).
|
||||
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/).
|
||||
|
||||
Prior to v3.1.0, Bootstrap's code was released under the Apache License v2.0.
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
Before opening:
|
||||
|
||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||
- [Validate](https://html5.validator.nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems
|
||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
||||
|
||||
Bug reports must include:
|
||||
|
||||
- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile)
|
||||
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
|
||||
- [Reduced test case](https://css-tricks.com/reduced-test-cases/) and suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)
|
||||
@@ -1,17 +1,20 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Tell us about a bug you may have identified in Bootstrap.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Before opening:
|
||||
|
||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||
- [Validate](https://html5.validator.nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems
|
||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
||||
- [Validate](https://html5.validator.nu/) any HTML to avoid common problems
|
||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md)
|
||||
|
||||
Bug reports must include:
|
||||
|
||||
- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile)
|
||||
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
|
||||
- [Reduced test case](https://css-tricks.com/reduced-test-cases/) and suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)
|
||||
- Operating system and version (Windows, macOS, Android, iOS)
|
||||
- Browser and version (Chrome, Firefox, Safari, Internet Explorer, Microsoft Edge, Opera, Android Browser)
|
||||
- A [reduced test case](https://css-tricks.com/reduced-test-cases/) or suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
Before opening:
|
||||
|
||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
||||
|
||||
Feature requests must include:
|
||||
|
||||
- As much detail as possible for what we should add and why it's important to Bootstrap
|
||||
- Relevant links to prior art, screenshots, or live demos whenever possible
|
||||
@@ -1,13 +1,16 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for a new feature in Bootstrap.
|
||||
title: ''
|
||||
labels: feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Before opening:
|
||||
|
||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md)
|
||||
|
||||
Feature requests must include:
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
name: BrowserStack
|
||||
on: [push]
|
||||
env:
|
||||
CI: true
|
||||
NODE: 12.x
|
||||
|
||||
jobs:
|
||||
browserstack:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'twbs/bootstrap'
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run dist
|
||||
run: npm run dist
|
||||
|
||||
- name: Run BrowserStack tests
|
||||
run: npm run js-test-cloud
|
||||
env:
|
||||
BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}"
|
||||
BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}"
|
||||
@@ -0,0 +1,39 @@
|
||||
name: Bundlewatch
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
CI: true
|
||||
NODE: 12.x
|
||||
|
||||
jobs:
|
||||
bundlewatch:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run dist
|
||||
run: npm run dist
|
||||
|
||||
- name: Run bundlewatch
|
||||
run: npm run bundlewatch
|
||||
env:
|
||||
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"
|
||||
CI_BRANCH_BASE: v4-dev
|
||||
@@ -0,0 +1,25 @@
|
||||
name: "Code Scanning - Action"
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
@@ -0,0 +1,33 @@
|
||||
name: CSS
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
CI: true
|
||||
NODE: 12.x
|
||||
|
||||
jobs:
|
||||
css:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build CSS
|
||||
run: npm run css
|
||||
@@ -0,0 +1,24 @@
|
||||
name: CSS (Dart Sass)
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
CI: true
|
||||
NODE: 12.x
|
||||
|
||||
jobs:
|
||||
css:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
- name: Build CSS with Dart Sass
|
||||
run: |
|
||||
npx --package sass@latest sass --version
|
||||
npx --package sass@latest sass --style expanded --source-map --embed-sources --no-error-css scss/:dist-sass/css/
|
||||
ls -Al dist-sass/css
|
||||
@@ -0,0 +1,65 @@
|
||||
name: Docs
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
CI: true
|
||||
NODE: 12.x
|
||||
RUBY: 2.7.x
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ env.RUBY }}
|
||||
|
||||
- name: Set up Ruby env
|
||||
run: |
|
||||
echo "gem: --no-document" > ~/.gemrc # Disable gem docs
|
||||
bundle config set clean 'true'
|
||||
bundle config set deployment 'true'
|
||||
|
||||
- name: Set up Ruby cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}
|
||||
${{ runner.os }}-ruby-v${{ env.RUBY }}-
|
||||
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||
|
||||
- run: ruby --version
|
||||
- run: gem --version
|
||||
- run: bundle --version
|
||||
- run: java -version
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Install bundler dependencies
|
||||
run: bundle install --deployment --jobs=4 --retry=3 --clean
|
||||
|
||||
- name: Copy CSS and JS
|
||||
run: npm run css-copy && npm run js-copy
|
||||
|
||||
- name: Test docs
|
||||
run: npm run docs
|
||||
@@ -0,0 +1,48 @@
|
||||
name: JS Tests
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
CI: true
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: Node ${{ matrix.node }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node: [10, 12]
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
${{ runner.OS }}-node-v${{ matrix.node }}-
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run dist
|
||||
run: npm run js
|
||||
|
||||
- name: Run JS tests
|
||||
run: npm run js-test
|
||||
|
||||
- name: Run Coveralls
|
||||
uses: coverallsapp/github-action@master
|
||||
if: matrix.node == 12
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
path-to-lcov: "./js/coverage/lcov.info"
|
||||
@@ -0,0 +1,33 @@
|
||||
name: Lint
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
CI: true
|
||||
NODE: 12.x
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
@@ -1,7 +1,10 @@
|
||||
# Ignore docs files
|
||||
/_gh_pages/
|
||||
/site/.jekyll-cache
|
||||
/site/.jekyll-metadata
|
||||
/site/docs/**/dist/
|
||||
# Hugo folders
|
||||
/resources/
|
||||
|
||||
# Ignore ruby/bundler files
|
||||
/.bundle/
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@
|
||||
"border-bottom-right-radius",
|
||||
"border-bottom-left-radius",
|
||||
"transition"
|
||||
]
|
||||
],
|
||||
"function-blacklist": ["calc"]
|
||||
}
|
||||
}
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
addons:
|
||||
chrome: stable
|
||||
language: node_js
|
||||
git:
|
||||
depth: 3
|
||||
node_js:
|
||||
- "6"
|
||||
- "8"
|
||||
install:
|
||||
- bundle install --deployment --jobs=3 --retry=3 --clean
|
||||
- npm install
|
||||
before_script:
|
||||
- google-chrome-stable --product-version
|
||||
script:
|
||||
- npm test || travis_terminate 1
|
||||
- if [[ "$TRAVIS_NODE_VERSION" = "8" ]]; then npm run check-broken-links; fi
|
||||
- if [[ "$TRAVIS_NODE_VERSION" = "8" && "$TRAVIS_EVENT_TYPE" = "push" && ! `git log --format=%B --no-merges -n 1 | grep '\[skip browser\]'` ]]; then npm run js-test-cloud; fi
|
||||
after_success:
|
||||
- if [[ "$TRAVIS_NODE_VERSION" = "8" ]]; then npm run coveralls; fi
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- vendor/bundle
|
||||
notifications:
|
||||
email: false
|
||||
@@ -1,9 +1,9 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'jekyll', '~> 3.8.5'
|
||||
gem 'jekyll-redirect-from', '~> 0.14.0'
|
||||
gem 'jekyll-sitemap', '~> 1.2.0'
|
||||
gem 'jekyll-toc', '~> 0.9.1'
|
||||
gem 'jekyll', '~> 4.1.1'
|
||||
gem 'jekyll-redirect-from', '~> 0.16.0'
|
||||
gem 'jekyll-sitemap', '~> 1.4.0'
|
||||
gem 'jekyll-toc', '~> 0.14.0'
|
||||
gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?
|
||||
end
|
||||
|
||||
+53
-46
@@ -1,70 +1,77 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.6.0)
|
||||
public_suffix (>= 2.0.2, < 4.0)
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
colorator (1.1.0)
|
||||
concurrent-ruby (1.1.4)
|
||||
concurrent-ruby (1.1.6)
|
||||
em-websocket (0.5.1)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
eventmachine (1.2.7)
|
||||
eventmachine (1.2.7-x64-mingw32)
|
||||
ffi (1.10.0)
|
||||
ffi (1.10.0-x64-mingw32)
|
||||
ffi (1.13.1)
|
||||
ffi (1.13.1-x64-mingw32)
|
||||
forwardable-extended (2.6.0)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (0.9.5)
|
||||
i18n (1.8.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
jekyll (3.8.5)
|
||||
jekyll (4.1.1)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
em-websocket (~> 0.5)
|
||||
i18n (~> 0.7)
|
||||
jekyll-sass-converter (~> 1.0)
|
||||
i18n (~> 1.0)
|
||||
jekyll-sass-converter (~> 2.0)
|
||||
jekyll-watch (~> 2.0)
|
||||
kramdown (~> 1.14)
|
||||
kramdown (~> 2.1)
|
||||
kramdown-parser-gfm (~> 1.0)
|
||||
liquid (~> 4.0)
|
||||
mercenary (~> 0.3.3)
|
||||
mercenary (~> 0.4.0)
|
||||
pathutil (~> 0.9)
|
||||
rouge (>= 1.7, < 4)
|
||||
rouge (~> 3.0)
|
||||
safe_yaml (~> 1.0)
|
||||
jekyll-redirect-from (0.14.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-sass-converter (1.5.2)
|
||||
sass (~> 3.4)
|
||||
jekyll-sitemap (1.2.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-toc (0.9.1)
|
||||
nokogiri (~> 1.8)
|
||||
jekyll-watch (2.1.2)
|
||||
terminal-table (~> 1.8)
|
||||
jekyll-redirect-from (0.16.0)
|
||||
jekyll (>= 3.3, < 5.0)
|
||||
jekyll-sass-converter (2.1.0)
|
||||
sassc (> 2.0.1, < 3.0)
|
||||
jekyll-sitemap (1.4.0)
|
||||
jekyll (>= 3.7, < 5.0)
|
||||
jekyll-toc (0.14.0)
|
||||
jekyll (>= 3.8)
|
||||
nokogiri (~> 1.10)
|
||||
jekyll-watch (2.2.1)
|
||||
listen (~> 3.0)
|
||||
kramdown (1.17.0)
|
||||
liquid (4.0.1)
|
||||
listen (3.1.5)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
ruby_dep (~> 1.2)
|
||||
mercenary (0.3.6)
|
||||
kramdown (2.3.0)
|
||||
rexml
|
||||
kramdown-parser-gfm (1.1.0)
|
||||
kramdown (~> 2.0)
|
||||
liquid (4.0.3)
|
||||
listen (3.2.1)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
rb-inotify (~> 0.9, >= 0.9.10)
|
||||
mercenary (0.4.0)
|
||||
mini_portile2 (2.4.0)
|
||||
nokogiri (1.10.1)
|
||||
nokogiri (1.10.10)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
nokogiri (1.10.1-x64-mingw32)
|
||||
nokogiri (1.10.10-x64-mingw32)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
pathutil (0.16.2)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (3.0.3)
|
||||
rb-fsevent (0.10.3)
|
||||
rb-inotify (0.10.0)
|
||||
public_suffix (4.0.5)
|
||||
rb-fsevent (0.10.4)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rouge (3.3.0)
|
||||
ruby_dep (1.5.0)
|
||||
safe_yaml (1.0.4)
|
||||
sass (3.7.3)
|
||||
sass-listen (~> 4.0.0)
|
||||
sass-listen (4.0.0)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
rexml (3.2.4)
|
||||
rouge (3.21.0)
|
||||
safe_yaml (1.0.5)
|
||||
sassc (2.4.0)
|
||||
ffi (~> 1.9)
|
||||
sassc (2.4.0-x64-mingw32)
|
||||
ffi (~> 1.9)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
unicode-display_width (1.7.0)
|
||||
wdm (0.1.1)
|
||||
|
||||
PLATFORMS
|
||||
@@ -72,11 +79,11 @@ PLATFORMS
|
||||
x64-mingw32
|
||||
|
||||
DEPENDENCIES
|
||||
jekyll (~> 3.8.5)
|
||||
jekyll-redirect-from (~> 0.14.0)
|
||||
jekyll-sitemap (~> 1.2.0)
|
||||
jekyll-toc (~> 0.9.1)
|
||||
jekyll (~> 4.1.1)
|
||||
jekyll-redirect-from (~> 0.16.0)
|
||||
jekyll-sitemap (~> 1.4.0)
|
||||
jekyll-toc (~> 0.14.0)
|
||||
wdm (~> 0.1.1)
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.3
|
||||
2.1.4
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2019 Twitter, Inc.
|
||||
Copyright (c) 2011-2019 The Bootstrap Authors
|
||||
Copyright (c) 2011-2020 Twitter, Inc.
|
||||
Copyright (c) 2011-2020 The Bootstrap Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<a href="https://getbootstrap.com/">
|
||||
<img src="https://getbootstrap.com/docs/4.3/assets/brand/bootstrap-solid.svg" alt="Bootstrap logo" width="72" height="72">
|
||||
<img src="https://getbootstrap.com/docs/4.5/assets/brand/bootstrap-solid.svg" alt="Bootstrap logo" width="72" height="72">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
<p align="center">
|
||||
Sleek, intuitive, and powerful front-end framework for faster and easier web development.
|
||||
<br>
|
||||
<a href="https://getbootstrap.com/docs/4.3/"><strong>Explore Bootstrap docs »</strong></a>
|
||||
<a href="https://getbootstrap.com/docs/4.5/"><strong>Explore Bootstrap docs »</strong></a>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://github.com/twbs/bootstrap/issues/new?template=bug.md">Report bug</a>
|
||||
<a href="https://github.com/twbs/bootstrap/issues/new?template=bug_report.md">Report bug</a>
|
||||
·
|
||||
<a href="https://github.com/twbs/bootstrap/issues/new?template=feature.md&labels=feature">Request feature</a>
|
||||
<a href="https://github.com/twbs/bootstrap/issues/new?template=feature_request.md">Request feature</a>
|
||||
·
|
||||
<a href="https://themes.getbootstrap.com/">Themes</a>
|
||||
·
|
||||
@@ -41,33 +41,33 @@
|
||||
|
||||
Several quick start options are available:
|
||||
|
||||
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.3.1.zip)
|
||||
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.5.2.zip)
|
||||
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
|
||||
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap`
|
||||
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@4.3.1`
|
||||
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.3.1`
|
||||
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@4.5.2`
|
||||
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.5.2`
|
||||
- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass`
|
||||
|
||||
Read the [Getting started page](https://getbootstrap.com/docs/4.3/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
|
||||
Read the [Getting started page](https://getbootstrap.com/docs/4.5/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
|
||||
|
||||
|
||||
## Status
|
||||
|
||||
[](https://bootstrap-slack.herokuapp.com/)
|
||||
[](https://travis-ci.org/twbs/bootstrap)
|
||||
[](https://www.npmjs.com/package/bootstrap)
|
||||
[](https://rubygems.org/gems/bootstrap)
|
||||
[](https://atmospherejs.com/twbs/bootstrap)
|
||||
[](https://packagist.org/packages/twbs/bootstrap)
|
||||
[](https://www.nuget.org/packages/bootstrap/absoluteLatest)
|
||||
[](https://david-dm.org/twbs/bootstrap?type=peer)
|
||||
[](https://david-dm.org/twbs/bootstrap?type=dev)
|
||||
[](https://coveralls.io/github/twbs/bootstrap?branch=v4-dev)
|
||||
[](https://github.com/twbs/bootstrap/tree/v4-dev/dist/css/bootstrap.min.css)
|
||||
[](https://github.com/twbs/bootstrap/tree/v4-dev/dist/js/bootstrap.min.js)
|
||||
[](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Av4-dev)
|
||||
[](https://www.npmjs.com/package/bootstrap)
|
||||
[](https://rubygems.org/gems/bootstrap)
|
||||
[](https://atmospherejs.com/twbs/bootstrap)
|
||||
[](https://packagist.org/packages/twbs/bootstrap)
|
||||
[](https://www.nuget.org/packages/bootstrap/absoluteLatest)
|
||||
[](https://david-dm.org/twbs/bootstrap?type=peer)
|
||||
[](https://david-dm.org/twbs/bootstrap?type=dev)
|
||||
[](https://coveralls.io/github/twbs/bootstrap?branch=v4-dev)
|
||||
[](https://github.com/twbs/bootstrap/tree/v4-dev/dist/css/bootstrap.min.css)
|
||||
[](https://github.com/twbs/bootstrap/tree/v4-dev/dist/js/bootstrap.min.js)
|
||||
[](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
|
||||
## What's included
|
||||
@@ -106,18 +106,18 @@ We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified
|
||||
|
||||
## Bugs and feature requests
|
||||
|
||||
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).
|
||||
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.
|
||||
|
||||
Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/docs/4.3/assets/js/src/search.js` file.
|
||||
Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/docs/4.5/assets/js/src/search.js` file.
|
||||
|
||||
### Running documentation locally
|
||||
|
||||
1. Run through the [tooling setup](https://getbootstrap.com/docs/4.3/getting-started/build-tools/#tooling-setup) to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`.
|
||||
1. Run through the [tooling setup](https://getbootstrap.com/docs/4.5/getting-started/build-tools/#tooling-setup) to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`.
|
||||
2. Run `npm install` to install Node.js dependencies.
|
||||
3. Run `npm start` to compile CSS and JavaScript files, generate our docs, and watch for changes.
|
||||
4. Open `http://localhost:9001` in your browser, and voilà.
|
||||
@@ -126,23 +126,18 @@ Learn more about using Jekyll by reading its [documentation](https://jekyllrb.co
|
||||
|
||||
### Documentation for previous releases
|
||||
|
||||
- For v2.3.2: <https://getbootstrap.com/2.3.2/>
|
||||
- For v3.3.x: <https://getbootstrap.com/docs/3.3/>
|
||||
- For v3.4.0: <https://getbootstrap.com/docs/3.4/>
|
||||
- For v4.0.x: <https://getbootstrap.com/docs/4.0/>
|
||||
- For v4.1.x: <https://getbootstrap.com/docs/4.1/>
|
||||
- For v4.2.x: <https://getbootstrap.com/docs/4.2/>
|
||||
You can find all our previous releases docs on <https://getbootstrap.com/docs/versions/>.
|
||||
|
||||
[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
||||
Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
||||
|
||||
Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/master/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo).
|
||||
Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/v4-dev/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo).
|
||||
|
||||
Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at <https://editorconfig.org/>.
|
||||
Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/v4-dev/.editorconfig) for easy use in common text editors. Read more and download plugins at <https://editorconfig.org/>.
|
||||
|
||||
|
||||
## Community
|
||||
@@ -186,13 +181,6 @@ See [the Releases section of our GitHub project](https://github.com/twbs/bootstr
|
||||
Thanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers!
|
||||
|
||||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/bootstrap#backer)]
|
||||
|
||||
[](https://opencollective.com/bootstrap#backers)
|
||||
|
||||
|
||||
## Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/bootstrap#sponsor)]
|
||||
@@ -209,6 +197,13 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
|
||||
[](https://opencollective.com/bootstrap/sponsor/9/website)
|
||||
|
||||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/bootstrap#backer)]
|
||||
|
||||
[](https://opencollective.com/bootstrap#backers)
|
||||
|
||||
|
||||
## Copyright and license
|
||||
|
||||
Code and documentation copyright 2011-2019 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE).
|
||||
Code and documentation copyright 2011-2020 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/main/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Reporting Security Issues
|
||||
|
||||
The Bootstrap team and community take security issues in Bootstrap seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
|
||||
|
||||
To report a security issue, email [security@getbootstrap.com](mailto:security@getbootstrap.com) and include the word "SECURITY" in the subject line.
|
||||
|
||||
We'll endeavor to respond quickly, and will keep you updated throughout the process.
|
||||
+24
-18
@@ -17,48 +17,54 @@ baseurl: ""
|
||||
url: "https://getbootstrap.com"
|
||||
encoding: UTF-8
|
||||
exclude:
|
||||
- docs/4.3/assets/scss/
|
||||
- docs/4.5/assets/scss/
|
||||
|
||||
plugins:
|
||||
- jekyll-redirect-from
|
||||
- jekyll-sitemap
|
||||
- jekyll-toc
|
||||
|
||||
redirect_from:
|
||||
json: false
|
||||
|
||||
# Social
|
||||
title: Bootstrap
|
||||
description: "The most popular HTML, CSS, and JS library in the world."
|
||||
twitter: getbootstrap
|
||||
authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
|
||||
social_image_path: /docs/4.3/assets/brand/bootstrap-social.png
|
||||
social_logo_path: /docs/4.3/assets/brand/bootstrap-social-logo.png
|
||||
social_image_path: /docs/4.5/assets/brand/bootstrap-social.png
|
||||
social_logo_path: /docs/4.5/assets/brand/bootstrap-social-logo.png
|
||||
|
||||
# Custom variables
|
||||
current_version: 4.3.1
|
||||
current_ruby_version: 4.3.1
|
||||
docs_version: 4.3
|
||||
current_version: 4.5.2
|
||||
current_ruby_version: 4.5.2
|
||||
docs_version: 4.5
|
||||
github_org: "https://github.com/twbs"
|
||||
repo: "https://github.com/twbs/bootstrap"
|
||||
slack: "https://bootstrap-slack.herokuapp.com"
|
||||
opencollective: "https://opencollective.com/bootstrap"
|
||||
blog: "https://blog.getbootstrap.com"
|
||||
expo: "https://expo.getbootstrap.com"
|
||||
themes: "https://themes.getbootstrap.com"
|
||||
icons: "https://icons.getbootstrap.com"
|
||||
|
||||
download:
|
||||
source: "https://github.com/twbs/bootstrap/archive/v4.3.1.zip"
|
||||
dist: "https://github.com/twbs/bootstrap/releases/download/v4.3.1/bootstrap-4.3.1-dist.zip"
|
||||
source: "https://github.com/twbs/bootstrap/archive/v4.5.2.zip"
|
||||
dist: "https://github.com/twbs/bootstrap/releases/download/v4.5.2/bootstrap-4.5.2-dist.zip"
|
||||
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v4.5.2/bootstrap-4.5.2-examples.zip"
|
||||
|
||||
cdn:
|
||||
# See https://www.srihash.org for info on how to generate the hashes
|
||||
css: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
|
||||
css_hash: "sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
|
||||
js: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
|
||||
js_hash: "sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
|
||||
js_bundle: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
|
||||
js_bundle_hash: "sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o"
|
||||
jquery: "https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
||||
jquery_hash: "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
|
||||
popper: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
|
||||
popper_hash: "sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
|
||||
css: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
|
||||
css_hash: "sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
|
||||
js: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
|
||||
js_hash: "sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
|
||||
js_bundle: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"
|
||||
js_bundle_hash: "sha384-LtrjvnR4Twt/qOuYxE721u19sVFLVSA4hf/rRt6PrZTmiPltdZcI7q7PXQBYTKyf"
|
||||
jquery: "https://code.jquery.com/jquery-3.5.1.slim.min.js"
|
||||
jquery_hash: "sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
|
||||
popper: "https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
|
||||
popper_hash: "sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
|
||||
|
||||
toc:
|
||||
min_level: 2
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
"func-style": "off",
|
||||
"no-console": "off",
|
||||
"no-magic-numbers": "off",
|
||||
"no-process-env": "off",
|
||||
"no-process-exit": "off",
|
||||
"no-sync": "off",
|
||||
"spaced-comment": "off"
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ function getBanner(pluginFilename) {
|
||||
return `/*!
|
||||
* Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
|
||||
* Copyright 2011-${year} ${pkg.author}
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/`
|
||||
}
|
||||
|
||||
|
||||
+38
-31
@@ -1,28 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/*!
|
||||
* Script to build our plugins to use them separately.
|
||||
* Copyright 2019 The Bootstrap Authors
|
||||
* Copyright 2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Copyright 2020 The Bootstrap Authors
|
||||
* Copyright 2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const rollup = require('rollup')
|
||||
const babel = require('rollup-plugin-babel')
|
||||
const banner = require('./banner.js')
|
||||
const path = require('path')
|
||||
const rollup = require('rollup')
|
||||
const { babel } = require('@rollup/plugin-babel')
|
||||
const banner = require('./banner.js')
|
||||
|
||||
const TEST = process.env.NODE_ENV === 'test'
|
||||
const TEST = process.env.NODE_ENV === 'test'
|
||||
const plugins = [
|
||||
babel({
|
||||
exclude: 'node_modules/**', // Only transpile our source code
|
||||
externalHelpersWhitelist: [ // Include only required helpers
|
||||
'defineProperties',
|
||||
'createClass',
|
||||
'inheritsLoose',
|
||||
'defineProperty',
|
||||
'objectSpread'
|
||||
]
|
||||
// Only transpile our source code
|
||||
exclude: 'node_modules/**',
|
||||
// Inline the required helpers in each file
|
||||
babelHelpers: 'inline'
|
||||
})
|
||||
]
|
||||
const bsPlugins = {
|
||||
@@ -41,7 +39,7 @@ const bsPlugins = {
|
||||
}
|
||||
const rootPath = TEST ? '../js/coverage/dist/' : '../js/dist/'
|
||||
|
||||
function build(plugin) {
|
||||
const build = async (plugin) => {
|
||||
console.log(`Building ${plugin} plugin...`)
|
||||
|
||||
const external = ['jquery', 'popper.js']
|
||||
@@ -63,23 +61,32 @@ function build(plugin) {
|
||||
}
|
||||
|
||||
const pluginFilename = `${plugin.toLowerCase()}.js`
|
||||
|
||||
rollup.rollup({
|
||||
const bundle = await rollup.rollup({
|
||||
input: bsPlugins[plugin],
|
||||
plugins,
|
||||
external
|
||||
}).then((bundle) => {
|
||||
bundle.write({
|
||||
banner: banner(pluginFilename),
|
||||
format: 'umd',
|
||||
name: plugin,
|
||||
sourcemap: true,
|
||||
globals,
|
||||
file: path.resolve(__dirname, `${rootPath}${pluginFilename}`)
|
||||
})
|
||||
.then(() => console.log(`Building ${plugin} plugin... Done!`))
|
||||
.catch((err) => console.error(`${plugin}: ${err}`))
|
||||
})
|
||||
|
||||
await bundle.write({
|
||||
banner: banner(pluginFilename),
|
||||
format: 'umd',
|
||||
name: plugin,
|
||||
sourcemap: true,
|
||||
globals,
|
||||
file: path.resolve(__dirname, `${rootPath}${pluginFilename}`)
|
||||
})
|
||||
|
||||
console.log(`Building ${plugin} plugin... Done!`)
|
||||
}
|
||||
|
||||
Object.keys(bsPlugins).forEach((plugin) => build(plugin))
|
||||
const main = async () => {
|
||||
try {
|
||||
await Promise.all(Object.keys(bsPlugins).map((plugin) => build(plugin)))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
/*!
|
||||
* Script to update version number references in the project.
|
||||
* Copyright 2017-2019 The Bootstrap Authors
|
||||
* Copyright 2017-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Copyright 2017-2020 The Bootstrap Authors
|
||||
* Copyright 2017-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
@@ -17,11 +17,11 @@ sh.config.fatal = true
|
||||
|
||||
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
|
||||
function regExpQuote(string) {
|
||||
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
|
||||
return string.replace(/[$()*+.?[\\\]^{|}-]/g, '\\$&')
|
||||
}
|
||||
|
||||
function regExpQuoteReplacement(string) {
|
||||
return string.replace(/[$]/g, '$$')
|
||||
return string.replace(/\$/g, '$$')
|
||||
}
|
||||
|
||||
const DRY_RUN = false
|
||||
@@ -83,6 +83,7 @@ function main(args) {
|
||||
const newVersion = args[1]
|
||||
const EXCLUDED_DIRS = new Set([
|
||||
'.git',
|
||||
'_gh_pages',
|
||||
'node_modules',
|
||||
'vendor'
|
||||
])
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* Remember to use the same vendor files as the CDN ones,
|
||||
* otherwise the hashes won't match!
|
||||
*
|
||||
* Copyright 2017-2019 The Bootstrap Authors
|
||||
* Copyright 2017-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Copyright 2017-2020 The Bootstrap Authors
|
||||
* Copyright 2017-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
@@ -40,7 +40,7 @@ const files = [
|
||||
configPropertyName: 'js_bundle_hash'
|
||||
},
|
||||
{
|
||||
file: `site/docs/${pkg.version_short}/assets/js/vendor/jquery-slim.min.js`,
|
||||
file: `site/docs/${pkg.version_short}/assets/js/vendor/jquery.slim.min.js`,
|
||||
configPropertyName: 'jquery_hash'
|
||||
},
|
||||
{
|
||||
|
||||
+11
-15
@@ -1,24 +1,20 @@
|
||||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const babel = require('rollup-plugin-babel')
|
||||
const resolve = require('rollup-plugin-node-resolve')
|
||||
const banner = require('./banner.js')
|
||||
const path = require('path')
|
||||
const { babel } = require('@rollup/plugin-babel')
|
||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||
const banner = require('./banner.js')
|
||||
|
||||
const BUNDLE = process.env.BUNDLE === 'true'
|
||||
const BUNDLE = process.env.BUNDLE === 'true'
|
||||
|
||||
let fileDest = 'bootstrap.js'
|
||||
let fileDest = 'bootstrap.js'
|
||||
const external = ['jquery', 'popper.js']
|
||||
const plugins = [
|
||||
babel({
|
||||
exclude: 'node_modules/**', // Only transpile our source code
|
||||
externalHelpersWhitelist: [ // Include only required helpers
|
||||
'defineProperties',
|
||||
'createClass',
|
||||
'inheritsLoose',
|
||||
'defineProperty',
|
||||
'objectSpread'
|
||||
]
|
||||
// Only transpile our source code
|
||||
exclude: 'node_modules/**',
|
||||
// Include the helpers in the bundle, at most one copy of each
|
||||
babelHelpers: 'bundled'
|
||||
})
|
||||
]
|
||||
const globals = {
|
||||
@@ -31,7 +27,7 @@ if (BUNDLE) {
|
||||
// Remove last entry in external array to bundle Popper
|
||||
external.pop()
|
||||
delete globals['popper.js']
|
||||
plugins.push(resolve())
|
||||
plugins.push(nodeResolve())
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
+19
-16
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
#
|
||||
# Usage
|
||||
# ---------------
|
||||
@@ -18,35 +21,35 @@ end=$'\e[0m'
|
||||
current_version=$(node -p "require('./package.json').version")
|
||||
|
||||
if [[ $# -lt 1 ]]; then
|
||||
printf "\n%s⚠️ Shipping aborted. You must specify a version.\n%s" $red $end
|
||||
printf "\n%s⚠️ Shipping aborted. You must specify a version.\n%s" "$red" "$end"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Pulling latest changes, just to be sure
|
||||
printf "\n%s=======================================================%s" $magenta $end
|
||||
printf "\n%sPulling latest changes...%s" $magenta $end
|
||||
printf "\n%s=======================================================\n\n%s" $magenta $end
|
||||
printf "\n%s=======================================================%s" "$magenta" "$end"
|
||||
printf "\n%sPulling latest changes...%s" "$magenta" "$end"
|
||||
printf "\n%s=======================================================\n\n%s" "$magenta" "$end"
|
||||
git pull origin v4-dev
|
||||
|
||||
# Update version number
|
||||
printf "\n%s=======================================================%s" $magenta $end
|
||||
printf "\n%sUpdating version number...%s" $magenta $end
|
||||
printf "\n%s=======================================================\n%s" $magenta $end
|
||||
printf "\n%s=======================================================%s" "$magenta" "$end"
|
||||
printf "\n%sUpdating version number...%s" "$magenta" "$end"
|
||||
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
||||
npm run release-version "$current_version" "$1"
|
||||
|
||||
# Build release
|
||||
printf "\n%s=======================================================%s" $magenta $end
|
||||
printf "\n%sBuilding release...%s" $magenta $end
|
||||
printf "\n%s=======================================================\n%s" $magenta $end
|
||||
printf "\n%s=======================================================%s" "$magenta" "$end"
|
||||
printf "\n%sBuilding release...%s" "$magenta" "$end"
|
||||
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
||||
npm run release
|
||||
|
||||
# Copy the contents of the built docs site over to `bs-docs` repo
|
||||
printf "\n%s=======================================================%s" $magenta $end
|
||||
printf "\n%sCopy it over...%s" $magenta $end
|
||||
printf "\n%s=======================================================\n%s" $magenta $end
|
||||
printf "\n%s=======================================================%s" "$magenta" "$end"
|
||||
printf "\n%sCopy it over...%s" "$magenta" "$end"
|
||||
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
||||
cp -rf _gh_pages/. ../bs-docs/
|
||||
printf "\nDone!\n"
|
||||
|
||||
printf "\n%s=======================================================%s" $green $end
|
||||
printf "\n%sSuccess, $1 is ready to review and publish.%s" $green $end
|
||||
printf "\n%s=======================================================\n\n%s" $green $end
|
||||
printf "\n%s=======================================================%s" "$green" "$end"
|
||||
printf "\n%sSuccess, $1 is ready to review and publish.%s" "$green" "$end"
|
||||
printf "\n%s=======================================================\n\n%s" "$green" "$end"
|
||||
|
||||
@@ -35,6 +35,9 @@ plugins:
|
||||
- minifyStyles: true
|
||||
- moveElemsAttrsToGroup: true
|
||||
- moveGroupAttrsToElems: true
|
||||
- removeAttrs:
|
||||
attrs:
|
||||
- "data-name"
|
||||
- removeComments: true
|
||||
- removeDesc: true
|
||||
- removeDoctype: true
|
||||
|
||||
+7
-7
@@ -2,9 +2,9 @@
|
||||
|
||||
/*!
|
||||
* Script to run vnu-jar if Java is available.
|
||||
* Copyright 2017-2019 The Bootstrap Authors
|
||||
* Copyright 2017-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Copyright 2017-2020 The Bootstrap Authors
|
||||
* Copyright 2017-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
@@ -18,7 +18,7 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||
return
|
||||
}
|
||||
|
||||
const is32bitJava = !stderr.match(/64-Bit/)
|
||||
const is32bitJava = !/64-Bit/.test(stderr)
|
||||
|
||||
// vnu-jar accepts multiple ignores joined with a `|`.
|
||||
// Also note that the ignores are regular expressions.
|
||||
@@ -36,9 +36,7 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||
'The “time” input type is not supported in all browsers.*',
|
||||
// IE11 doesn't recognise <main> / give the element an implicit "main" landmark.
|
||||
// Explicit role="main" is redundant for other modern browsers, but still valid.
|
||||
'The “main” role is unnecessary for element “main”.',
|
||||
// Ignore the wrong lanuage code warnings for now; they happen randomly.
|
||||
'This document appears to be written in.*'
|
||||
'The “main” role is unnecessary for element “main”.'
|
||||
].join('|')
|
||||
|
||||
const args = [
|
||||
@@ -46,6 +44,8 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||
vnu,
|
||||
'--asciiquotes',
|
||||
'--skip-non-html',
|
||||
// Ignore the language code warnings
|
||||
'--no-langdetect',
|
||||
'--Werror',
|
||||
`--filterpattern "${ignores}"`,
|
||||
'_gh_pages/',
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/*!
|
||||
* Script to create the built examples zip archive;
|
||||
* requires the `zip` command to be present!
|
||||
* Copyright 2020 The Bootstrap Authors
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const sh = require('shelljs')
|
||||
|
||||
const {
|
||||
version, version_short: versionShort
|
||||
} = require('../package.json')
|
||||
|
||||
const folderName = `bootstrap-${version}-examples`
|
||||
|
||||
sh.config.fatal = true
|
||||
|
||||
if (!sh.test('-d', '_gh_pages')) {
|
||||
throw new Error('The "_gh_pages" folder does not exist, did you forget building the docs?')
|
||||
}
|
||||
|
||||
// switch to the root dir
|
||||
sh.cd(path.join(__dirname, '..'))
|
||||
|
||||
// remove any previously created folder with the same name
|
||||
sh.rm('-rf', folderName)
|
||||
// create any folders so that `cp` works
|
||||
sh.mkdir('-p', folderName)
|
||||
sh.mkdir('-p', `${folderName}/assets/brand/`)
|
||||
|
||||
sh.cp('-Rf', `_gh_pages/docs/${versionShort}/examples/*`, folderName)
|
||||
sh.cp('-Rf', `_gh_pages/docs/${versionShort}/dist/`, `${folderName}/assets/`)
|
||||
// also copy the two brand images we use in the examples
|
||||
sh.cp('-f', [
|
||||
`_gh_pages/docs/${versionShort}/assets/brand/bootstrap-outline.svg`,
|
||||
`_gh_pages/docs/${versionShort}/assets/brand/bootstrap-solid.svg`
|
||||
], `${folderName}/assets/brand/`)
|
||||
sh.rm(`${folderName}/index.html`)
|
||||
|
||||
// get all examples' HTML files
|
||||
sh.find(`${folderName}/**/*.html`).forEach((file) => {
|
||||
const fileContents = sh.cat(file)
|
||||
.toString()
|
||||
.replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../')
|
||||
.replace(/"..\/dist\//g, '"../assets/dist/')
|
||||
.replace(/(<link href="\.\.\/.*) integrity=".*>/g, '$1>')
|
||||
.replace(/(<script src="\.\.\/.*) integrity=".*>/g, '$1></script>')
|
||||
.replace(/( +)<!-- favicons(.|\n)+<style>/i, ' <style>')
|
||||
new sh.ShellString(fileContents).to(file)
|
||||
})
|
||||
|
||||
// create the zip file
|
||||
sh.exec(`zip -r9 "${folderName}.zip" "${folderName}"`, {
|
||||
fatal: true
|
||||
})
|
||||
|
||||
// remove the folder we created
|
||||
sh.rm('-rf', folderName)
|
||||
Vendored
+170
-17
@@ -1,8 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap Grid v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap Grid v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
@@ -15,7 +15,12 @@ html {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
.container {
|
||||
.container,
|
||||
.container-fluid,
|
||||
.container-sm,
|
||||
.container-md,
|
||||
.container-lg,
|
||||
.container-xl {
|
||||
width: 100%;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
@@ -24,37 +29,29 @@ html {
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container {
|
||||
.container, .container-sm {
|
||||
max-width: 540px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.container {
|
||||
.container, .container-sm, .container-md {
|
||||
max-width: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.container {
|
||||
.container, .container-sm, .container-md, .container-lg {
|
||||
max-width: 960px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.container {
|
||||
.container, .container-sm, .container-md, .container-lg, .container-xl {
|
||||
max-width: 1140px;
|
||||
}
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
width: 100%;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
@@ -95,6 +92,42 @@ html {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.row-cols-1 > * {
|
||||
-ms-flex: 0 0 100%;
|
||||
flex: 0 0 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.row-cols-2 > * {
|
||||
-ms-flex: 0 0 50%;
|
||||
flex: 0 0 50%;
|
||||
max-width: 50%;
|
||||
}
|
||||
|
||||
.row-cols-3 > * {
|
||||
-ms-flex: 0 0 33.333333%;
|
||||
flex: 0 0 33.333333%;
|
||||
max-width: 33.333333%;
|
||||
}
|
||||
|
||||
.row-cols-4 > * {
|
||||
-ms-flex: 0 0 25%;
|
||||
flex: 0 0 25%;
|
||||
max-width: 25%;
|
||||
}
|
||||
|
||||
.row-cols-5 > * {
|
||||
-ms-flex: 0 0 20%;
|
||||
flex: 0 0 20%;
|
||||
max-width: 20%;
|
||||
}
|
||||
|
||||
.row-cols-6 > * {
|
||||
-ms-flex: 0 0 16.666667%;
|
||||
flex: 0 0 16.666667%;
|
||||
max-width: 16.666667%;
|
||||
}
|
||||
|
||||
.col-auto {
|
||||
-ms-flex: 0 0 auto;
|
||||
flex: 0 0 auto;
|
||||
@@ -301,6 +334,36 @@ html {
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-sm-1 > * {
|
||||
-ms-flex: 0 0 100%;
|
||||
flex: 0 0 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-sm-2 > * {
|
||||
-ms-flex: 0 0 50%;
|
||||
flex: 0 0 50%;
|
||||
max-width: 50%;
|
||||
}
|
||||
.row-cols-sm-3 > * {
|
||||
-ms-flex: 0 0 33.333333%;
|
||||
flex: 0 0 33.333333%;
|
||||
max-width: 33.333333%;
|
||||
}
|
||||
.row-cols-sm-4 > * {
|
||||
-ms-flex: 0 0 25%;
|
||||
flex: 0 0 25%;
|
||||
max-width: 25%;
|
||||
}
|
||||
.row-cols-sm-5 > * {
|
||||
-ms-flex: 0 0 20%;
|
||||
flex: 0 0 20%;
|
||||
max-width: 20%;
|
||||
}
|
||||
.row-cols-sm-6 > * {
|
||||
-ms-flex: 0 0 16.666667%;
|
||||
flex: 0 0 16.666667%;
|
||||
max-width: 16.666667%;
|
||||
}
|
||||
.col-sm-auto {
|
||||
-ms-flex: 0 0 auto;
|
||||
flex: 0 0 auto;
|
||||
@@ -473,6 +536,36 @@ html {
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-md-1 > * {
|
||||
-ms-flex: 0 0 100%;
|
||||
flex: 0 0 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-md-2 > * {
|
||||
-ms-flex: 0 0 50%;
|
||||
flex: 0 0 50%;
|
||||
max-width: 50%;
|
||||
}
|
||||
.row-cols-md-3 > * {
|
||||
-ms-flex: 0 0 33.333333%;
|
||||
flex: 0 0 33.333333%;
|
||||
max-width: 33.333333%;
|
||||
}
|
||||
.row-cols-md-4 > * {
|
||||
-ms-flex: 0 0 25%;
|
||||
flex: 0 0 25%;
|
||||
max-width: 25%;
|
||||
}
|
||||
.row-cols-md-5 > * {
|
||||
-ms-flex: 0 0 20%;
|
||||
flex: 0 0 20%;
|
||||
max-width: 20%;
|
||||
}
|
||||
.row-cols-md-6 > * {
|
||||
-ms-flex: 0 0 16.666667%;
|
||||
flex: 0 0 16.666667%;
|
||||
max-width: 16.666667%;
|
||||
}
|
||||
.col-md-auto {
|
||||
-ms-flex: 0 0 auto;
|
||||
flex: 0 0 auto;
|
||||
@@ -645,6 +738,36 @@ html {
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-lg-1 > * {
|
||||
-ms-flex: 0 0 100%;
|
||||
flex: 0 0 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-lg-2 > * {
|
||||
-ms-flex: 0 0 50%;
|
||||
flex: 0 0 50%;
|
||||
max-width: 50%;
|
||||
}
|
||||
.row-cols-lg-3 > * {
|
||||
-ms-flex: 0 0 33.333333%;
|
||||
flex: 0 0 33.333333%;
|
||||
max-width: 33.333333%;
|
||||
}
|
||||
.row-cols-lg-4 > * {
|
||||
-ms-flex: 0 0 25%;
|
||||
flex: 0 0 25%;
|
||||
max-width: 25%;
|
||||
}
|
||||
.row-cols-lg-5 > * {
|
||||
-ms-flex: 0 0 20%;
|
||||
flex: 0 0 20%;
|
||||
max-width: 20%;
|
||||
}
|
||||
.row-cols-lg-6 > * {
|
||||
-ms-flex: 0 0 16.666667%;
|
||||
flex: 0 0 16.666667%;
|
||||
max-width: 16.666667%;
|
||||
}
|
||||
.col-lg-auto {
|
||||
-ms-flex: 0 0 auto;
|
||||
flex: 0 0 auto;
|
||||
@@ -817,6 +940,36 @@ html {
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-xl-1 > * {
|
||||
-ms-flex: 0 0 100%;
|
||||
flex: 0 0 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-xl-2 > * {
|
||||
-ms-flex: 0 0 50%;
|
||||
flex: 0 0 50%;
|
||||
max-width: 50%;
|
||||
}
|
||||
.row-cols-xl-3 > * {
|
||||
-ms-flex: 0 0 33.333333%;
|
||||
flex: 0 0 33.333333%;
|
||||
max-width: 33.333333%;
|
||||
}
|
||||
.row-cols-xl-4 > * {
|
||||
-ms-flex: 0 0 25%;
|
||||
flex: 0 0 25%;
|
||||
max-width: 25%;
|
||||
}
|
||||
.row-cols-xl-5 > * {
|
||||
-ms-flex: 0 0 20%;
|
||||
flex: 0 0 20%;
|
||||
max-width: 20%;
|
||||
}
|
||||
.row-cols-xl-6 > * {
|
||||
-ms-flex: 0 0 16.666667%;
|
||||
flex: 0 0 16.666667%;
|
||||
max-width: 16.666667%;
|
||||
}
|
||||
.col-xl-auto {
|
||||
-ms-flex: 0 0 auto;
|
||||
flex: 0 0 auto;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+5
-5
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+12
-18
@@ -1,8 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap Reboot v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||
*/
|
||||
*,
|
||||
@@ -33,7 +33,7 @@ body {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
[tabindex="-1"]:focus {
|
||||
[tabindex="-1"]:focus:not(:focus-visible) {
|
||||
outline: 0 !important;
|
||||
}
|
||||
|
||||
@@ -133,20 +133,16 @@ a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]) {
|
||||
a:not([href]):not([class]) {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
|
||||
a:not([href]):not([class]):hover {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]):focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
@@ -159,6 +155,7 @@ pre {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
overflow: auto;
|
||||
-ms-overflow-style: scrollbar;
|
||||
}
|
||||
|
||||
figure {
|
||||
@@ -226,6 +223,10 @@ select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
[role="button"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
select {
|
||||
word-wrap: normal;
|
||||
}
|
||||
@@ -258,13 +259,6 @@ input[type="checkbox"] {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input[type="date"],
|
||||
input[type="time"],
|
||||
input[type="datetime-local"],
|
||||
input[type="month"] {
|
||||
-webkit-appearance: listbox;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
resize: vertical;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+5
-5
@@ -1,8 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap Reboot v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
|
||||
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([class]){color:inherit;text-decoration:none}a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
|
||||
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+494
-273
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+5
-5
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+901
-891
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+829
-854
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+30
-52
@@ -1,33 +1,20 @@
|
||||
/*!
|
||||
* Bootstrap alert.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap alert.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||
(global = global || self, global.Alert = factory(global.jQuery, global.Util));
|
||||
}(this, function ($, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.jQuery, global.Util));
|
||||
}(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -35,34 +22,25 @@
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.alert';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var Selector = {
|
||||
DISMISS: '[data-dismiss="alert"]'
|
||||
};
|
||||
var Event = {
|
||||
CLOSE: "close" + EVENT_KEY,
|
||||
CLOSED: "closed" + EVENT_KEY,
|
||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
ALERT: 'alert',
|
||||
FADE: 'fade',
|
||||
SHOW: 'show'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var SELECTOR_DISMISS = '[data-dismiss="alert"]';
|
||||
var EVENT_CLOSE = "close" + EVENT_KEY;
|
||||
var EVENT_CLOSED = "closed" + EVENT_KEY;
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var CLASS_NAME_ALERT = 'alert';
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
var Alert =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Alert = /*#__PURE__*/function () {
|
||||
function Alert(element) {
|
||||
this._element = element;
|
||||
} // Getters
|
||||
@@ -102,14 +80,14 @@
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
parent = $(element).closest("." + ClassName.ALERT)[0];
|
||||
parent = $(element).closest("." + CLASS_NAME_ALERT)[0];
|
||||
}
|
||||
|
||||
return parent;
|
||||
};
|
||||
|
||||
_proto._triggerCloseEvent = function _triggerCloseEvent(element) {
|
||||
var closeEvent = $.Event(Event.CLOSE);
|
||||
var closeEvent = $.Event(EVENT_CLOSE);
|
||||
$(element).trigger(closeEvent);
|
||||
return closeEvent;
|
||||
};
|
||||
@@ -117,9 +95,9 @@
|
||||
_proto._removeElement = function _removeElement(element) {
|
||||
var _this = this;
|
||||
|
||||
$(element).removeClass(ClassName.SHOW);
|
||||
$(element).removeClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (!$(element).hasClass(ClassName.FADE)) {
|
||||
if (!$(element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._destroyElement(element);
|
||||
|
||||
return;
|
||||
@@ -132,7 +110,7 @@
|
||||
};
|
||||
|
||||
_proto._destroyElement = function _destroyElement(element) {
|
||||
$(element).detach().trigger(Event.CLOSED).remove();
|
||||
$(element).detach().trigger(EVENT_CLOSED).remove();
|
||||
} // Static
|
||||
;
|
||||
|
||||
@@ -178,7 +156,7 @@
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
@@ -195,5 +173,5 @@
|
||||
|
||||
return Alert;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=alert.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+95
-69
@@ -1,32 +1,19 @@
|
||||
/*!
|
||||
* Bootstrap button.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap button.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
||||
(global = global || self, global.Button = factory(global.jQuery));
|
||||
}(this, function ($) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.jQuery));
|
||||
}(this, (function ($) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -34,37 +21,31 @@
|
||||
*/
|
||||
|
||||
var NAME = 'button';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.button';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var ClassName = {
|
||||
ACTIVE: 'active',
|
||||
BUTTON: 'btn',
|
||||
FOCUS: 'focus'
|
||||
};
|
||||
var Selector = {
|
||||
DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
|
||||
DATA_TOGGLE: '[data-toggle="buttons"]',
|
||||
INPUT: 'input:not([type="hidden"])',
|
||||
ACTIVE: '.active',
|
||||
BUTTON: '.btn'
|
||||
};
|
||||
var Event = {
|
||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
|
||||
FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var CLASS_NAME_ACTIVE = 'active';
|
||||
var CLASS_NAME_BUTTON = 'btn';
|
||||
var CLASS_NAME_FOCUS = 'focus';
|
||||
var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
|
||||
var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
|
||||
var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
|
||||
var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
|
||||
var SELECTOR_INPUT = 'input:not([type="hidden"])';
|
||||
var SELECTOR_ACTIVE = '.active';
|
||||
var SELECTOR_BUTTON = '.btn';
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY);
|
||||
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
var Button =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Button = /*#__PURE__*/function () {
|
||||
function Button(element) {
|
||||
this._element = element;
|
||||
} // Getters
|
||||
@@ -76,30 +57,30 @@
|
||||
_proto.toggle = function toggle() {
|
||||
var triggerChangeEvent = true;
|
||||
var addAriaPressed = true;
|
||||
var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
|
||||
var rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0];
|
||||
|
||||
if (rootElement) {
|
||||
var input = this._element.querySelector(Selector.INPUT);
|
||||
var input = this._element.querySelector(SELECTOR_INPUT);
|
||||
|
||||
if (input) {
|
||||
if (input.type === 'radio') {
|
||||
if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
|
||||
if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
||||
triggerChangeEvent = false;
|
||||
} else {
|
||||
var activeElement = rootElement.querySelector(Selector.ACTIVE);
|
||||
var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
|
||||
|
||||
if (activeElement) {
|
||||
$(activeElement).removeClass(ClassName.ACTIVE);
|
||||
$(activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (triggerChangeEvent) {
|
||||
if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
|
||||
return;
|
||||
// if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
|
||||
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
input.checked = !this._element.classList.contains(ClassName.ACTIVE);
|
||||
$(input).trigger('change');
|
||||
}
|
||||
|
||||
@@ -108,12 +89,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (addAriaPressed) {
|
||||
this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
|
||||
}
|
||||
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
|
||||
if (addAriaPressed) {
|
||||
this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
|
||||
}
|
||||
|
||||
if (triggerChangeEvent) {
|
||||
$(this._element).toggleClass(ClassName.ACTIVE);
|
||||
if (triggerChangeEvent) {
|
||||
$(this._element).toggleClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -154,18 +137,61 @@
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
||||
event.preventDefault();
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
|
||||
var button = event.target;
|
||||
var initialButton = button;
|
||||
|
||||
if (!$(button).hasClass(ClassName.BUTTON)) {
|
||||
button = $(button).closest(Selector.BUTTON);
|
||||
if (!$(button).hasClass(CLASS_NAME_BUTTON)) {
|
||||
button = $(button).closest(SELECTOR_BUTTON)[0];
|
||||
}
|
||||
|
||||
Button._jQueryInterface.call($(button), 'toggle');
|
||||
}).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
||||
var button = $(event.target).closest(Selector.BUTTON)[0];
|
||||
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
|
||||
if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
|
||||
event.preventDefault(); // work around Firefox bug #1540995
|
||||
} else {
|
||||
var inputBtn = button.querySelector(SELECTOR_INPUT);
|
||||
|
||||
if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
|
||||
event.preventDefault(); // work around Firefox bug #1540995
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (initialButton.tagName !== 'LABEL' || inputBtn && inputBtn.type !== 'checkbox') {
|
||||
Button._jQueryInterface.call($(button), 'toggle');
|
||||
}
|
||||
}
|
||||
}).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
|
||||
var button = $(event.target).closest(SELECTOR_BUTTON)[0];
|
||||
$(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
|
||||
});
|
||||
$(window).on(EVENT_LOAD_DATA_API, function () {
|
||||
// ensure correct active class is set to match the controls' actual values/states
|
||||
// find all checkboxes/readio buttons inside data-toggle groups
|
||||
var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
|
||||
|
||||
for (var i = 0, len = buttons.length; i < len; i++) {
|
||||
var button = buttons[i];
|
||||
var input = button.querySelector(SELECTOR_INPUT);
|
||||
|
||||
if (input.checked || input.hasAttribute('checked')) {
|
||||
button.classList.add(CLASS_NAME_ACTIVE);
|
||||
} else {
|
||||
button.classList.remove(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
} // find all button toggles
|
||||
|
||||
|
||||
buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||
|
||||
for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
|
||||
var _button = buttons[_i];
|
||||
|
||||
if (_button.getAttribute('aria-pressed') === 'true') {
|
||||
_button.classList.add(CLASS_NAME_ACTIVE);
|
||||
} else {
|
||||
_button.classList.remove(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
}
|
||||
});
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -183,5 +209,5 @@
|
||||
|
||||
return Button;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=button.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+102
-160
@@ -1,67 +1,22 @@
|
||||
/*!
|
||||
* Bootstrap carousel.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap carousel.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||
(global = global || self, global.Carousel = factory(global.jQuery, global.Util));
|
||||
}(this, function ($, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Carousel = factory(global.jQuery, global.Util));
|
||||
}(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -69,7 +24,7 @@
|
||||
*/
|
||||
|
||||
var NAME = 'carousel';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.carousel';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@@ -97,62 +52,50 @@
|
||||
wrap: 'boolean',
|
||||
touch: 'boolean'
|
||||
};
|
||||
var Direction = {
|
||||
NEXT: 'next',
|
||||
PREV: 'prev',
|
||||
LEFT: 'left',
|
||||
RIGHT: 'right'
|
||||
};
|
||||
var Event = {
|
||||
SLIDE: "slide" + EVENT_KEY,
|
||||
SLID: "slid" + EVENT_KEY,
|
||||
KEYDOWN: "keydown" + EVENT_KEY,
|
||||
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
||||
MOUSELEAVE: "mouseleave" + EVENT_KEY,
|
||||
TOUCHSTART: "touchstart" + EVENT_KEY,
|
||||
TOUCHMOVE: "touchmove" + EVENT_KEY,
|
||||
TOUCHEND: "touchend" + EVENT_KEY,
|
||||
POINTERDOWN: "pointerdown" + EVENT_KEY,
|
||||
POINTERUP: "pointerup" + EVENT_KEY,
|
||||
DRAG_START: "dragstart" + EVENT_KEY,
|
||||
LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
|
||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
CAROUSEL: 'carousel',
|
||||
ACTIVE: 'active',
|
||||
SLIDE: 'slide',
|
||||
RIGHT: 'carousel-item-right',
|
||||
LEFT: 'carousel-item-left',
|
||||
NEXT: 'carousel-item-next',
|
||||
PREV: 'carousel-item-prev',
|
||||
ITEM: 'carousel-item',
|
||||
POINTER_EVENT: 'pointer-event'
|
||||
};
|
||||
var Selector = {
|
||||
ACTIVE: '.active',
|
||||
ACTIVE_ITEM: '.active.carousel-item',
|
||||
ITEM: '.carousel-item',
|
||||
ITEM_IMG: '.carousel-item img',
|
||||
NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
|
||||
INDICATORS: '.carousel-indicators',
|
||||
DATA_SLIDE: '[data-slide], [data-slide-to]',
|
||||
DATA_RIDE: '[data-ride="carousel"]'
|
||||
};
|
||||
var DIRECTION_NEXT = 'next';
|
||||
var DIRECTION_PREV = 'prev';
|
||||
var DIRECTION_LEFT = 'left';
|
||||
var DIRECTION_RIGHT = 'right';
|
||||
var EVENT_SLIDE = "slide" + EVENT_KEY;
|
||||
var EVENT_SLID = "slid" + EVENT_KEY;
|
||||
var EVENT_KEYDOWN = "keydown" + EVENT_KEY;
|
||||
var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY;
|
||||
var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY;
|
||||
var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY;
|
||||
var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY;
|
||||
var EVENT_TOUCHEND = "touchend" + EVENT_KEY;
|
||||
var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY;
|
||||
var EVENT_POINTERUP = "pointerup" + EVENT_KEY;
|
||||
var EVENT_DRAG_START = "dragstart" + EVENT_KEY;
|
||||
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var CLASS_NAME_CAROUSEL = 'carousel';
|
||||
var CLASS_NAME_ACTIVE = 'active';
|
||||
var CLASS_NAME_SLIDE = 'slide';
|
||||
var CLASS_NAME_RIGHT = 'carousel-item-right';
|
||||
var CLASS_NAME_LEFT = 'carousel-item-left';
|
||||
var CLASS_NAME_NEXT = 'carousel-item-next';
|
||||
var CLASS_NAME_PREV = 'carousel-item-prev';
|
||||
var CLASS_NAME_POINTER_EVENT = 'pointer-event';
|
||||
var SELECTOR_ACTIVE = '.active';
|
||||
var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
|
||||
var SELECTOR_ITEM = '.carousel-item';
|
||||
var SELECTOR_ITEM_IMG = '.carousel-item img';
|
||||
var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
|
||||
var SELECTOR_INDICATORS = '.carousel-indicators';
|
||||
var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
|
||||
var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
|
||||
var PointerType = {
|
||||
TOUCH: 'touch',
|
||||
PEN: 'pen'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Carousel =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Carousel = /*#__PURE__*/function () {
|
||||
function Carousel(element, config) {
|
||||
this._items = null;
|
||||
this._interval = null;
|
||||
@@ -164,7 +107,7 @@
|
||||
this.touchDeltaX = 0;
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);
|
||||
this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
|
||||
|
||||
@@ -177,7 +120,7 @@
|
||||
// Public
|
||||
_proto.next = function next() {
|
||||
if (!this._isSliding) {
|
||||
this._slide(Direction.NEXT);
|
||||
this._slide(DIRECTION_NEXT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -191,7 +134,7 @@
|
||||
|
||||
_proto.prev = function prev() {
|
||||
if (!this._isSliding) {
|
||||
this._slide(Direction.PREV);
|
||||
this._slide(DIRECTION_PREV);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -200,7 +143,7 @@
|
||||
this._isPaused = true;
|
||||
}
|
||||
|
||||
if (this._element.querySelector(Selector.NEXT_PREV)) {
|
||||
if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
|
||||
Util.triggerTransitionEnd(this._element);
|
||||
this.cycle(true);
|
||||
}
|
||||
@@ -227,7 +170,7 @@
|
||||
_proto.to = function to(index) {
|
||||
var _this = this;
|
||||
|
||||
this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
|
||||
this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
|
||||
|
||||
var activeIndex = this._getItemIndex(this._activeElement);
|
||||
|
||||
@@ -236,7 +179,7 @@
|
||||
}
|
||||
|
||||
if (this._isSliding) {
|
||||
$(this._element).one(Event.SLID, function () {
|
||||
$(this._element).one(EVENT_SLID, function () {
|
||||
return _this.to(index);
|
||||
});
|
||||
return;
|
||||
@@ -248,7 +191,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
|
||||
var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
|
||||
|
||||
this._slide(direction, this._items[index]);
|
||||
};
|
||||
@@ -268,7 +211,7 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread({}, Default, config);
|
||||
config = _extends({}, Default, config);
|
||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||
return config;
|
||||
};
|
||||
@@ -280,7 +223,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var direction = absDeltax / this.touchDeltaX; // swipe left
|
||||
var direction = absDeltax / this.touchDeltaX;
|
||||
this.touchDeltaX = 0; // swipe left
|
||||
|
||||
if (direction > 0) {
|
||||
this.prev();
|
||||
@@ -296,15 +240,15 @@
|
||||
var _this2 = this;
|
||||
|
||||
if (this._config.keyboard) {
|
||||
$(this._element).on(Event.KEYDOWN, function (event) {
|
||||
$(this._element).on(EVENT_KEYDOWN, function (event) {
|
||||
return _this2._keydown(event);
|
||||
});
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
$(this._element).on(Event.MOUSEENTER, function (event) {
|
||||
$(this._element).on(EVENT_MOUSEENTER, function (event) {
|
||||
return _this2.pause(event);
|
||||
}).on(Event.MOUSELEAVE, function (event) {
|
||||
}).on(EVENT_MOUSELEAVE, function (event) {
|
||||
return _this2.cycle(event);
|
||||
});
|
||||
}
|
||||
@@ -365,27 +309,27 @@
|
||||
}
|
||||
};
|
||||
|
||||
$(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, function (e) {
|
||||
$(this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {
|
||||
return e.preventDefault();
|
||||
});
|
||||
|
||||
if (this._pointerEvent) {
|
||||
$(this._element).on(Event.POINTERDOWN, function (event) {
|
||||
$(this._element).on(EVENT_POINTERDOWN, function (event) {
|
||||
return start(event);
|
||||
});
|
||||
$(this._element).on(Event.POINTERUP, function (event) {
|
||||
$(this._element).on(EVENT_POINTERUP, function (event) {
|
||||
return end(event);
|
||||
});
|
||||
|
||||
this._element.classList.add(ClassName.POINTER_EVENT);
|
||||
this._element.classList.add(CLASS_NAME_POINTER_EVENT);
|
||||
} else {
|
||||
$(this._element).on(Event.TOUCHSTART, function (event) {
|
||||
$(this._element).on(EVENT_TOUCHSTART, function (event) {
|
||||
return start(event);
|
||||
});
|
||||
$(this._element).on(Event.TOUCHMOVE, function (event) {
|
||||
$(this._element).on(EVENT_TOUCHMOVE, function (event) {
|
||||
return move(event);
|
||||
});
|
||||
$(this._element).on(Event.TOUCHEND, function (event) {
|
||||
$(this._element).on(EVENT_TOUCHEND, function (event) {
|
||||
return end(event);
|
||||
});
|
||||
}
|
||||
@@ -406,19 +350,17 @@
|
||||
event.preventDefault();
|
||||
this.next();
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
};
|
||||
|
||||
_proto._getItemIndex = function _getItemIndex(element) {
|
||||
this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : [];
|
||||
this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];
|
||||
return this._items.indexOf(element);
|
||||
};
|
||||
|
||||
_proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
|
||||
var isNextDirection = direction === Direction.NEXT;
|
||||
var isPrevDirection = direction === Direction.PREV;
|
||||
var isNextDirection = direction === DIRECTION_NEXT;
|
||||
var isPrevDirection = direction === DIRECTION_PREV;
|
||||
|
||||
var activeIndex = this._getItemIndex(activeElement);
|
||||
|
||||
@@ -429,7 +371,7 @@
|
||||
return activeElement;
|
||||
}
|
||||
|
||||
var delta = direction === Direction.PREV ? -1 : 1;
|
||||
var delta = direction === DIRECTION_PREV ? -1 : 1;
|
||||
var itemIndex = (activeIndex + delta) % this._items.length;
|
||||
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
||||
};
|
||||
@@ -437,9 +379,9 @@
|
||||
_proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||
var targetIndex = this._getItemIndex(relatedTarget);
|
||||
|
||||
var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM));
|
||||
var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
|
||||
|
||||
var slideEvent = $.Event(Event.SLIDE, {
|
||||
var slideEvent = $.Event(EVENT_SLIDE, {
|
||||
relatedTarget: relatedTarget,
|
||||
direction: eventDirectionName,
|
||||
from: fromIndex,
|
||||
@@ -451,13 +393,13 @@
|
||||
|
||||
_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
|
||||
if (this._indicatorsElement) {
|
||||
var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));
|
||||
$(indicators).removeClass(ClassName.ACTIVE);
|
||||
var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE));
|
||||
$(indicators).removeClass(CLASS_NAME_ACTIVE);
|
||||
|
||||
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
||||
|
||||
if (nextIndicator) {
|
||||
$(nextIndicator).addClass(ClassName.ACTIVE);
|
||||
$(nextIndicator).addClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -465,7 +407,7 @@
|
||||
_proto._slide = function _slide(direction, element) {
|
||||
var _this4 = this;
|
||||
|
||||
var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
|
||||
var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
|
||||
|
||||
var activeElementIndex = this._getItemIndex(activeElement);
|
||||
|
||||
@@ -478,17 +420,17 @@
|
||||
var orderClassName;
|
||||
var eventDirectionName;
|
||||
|
||||
if (direction === Direction.NEXT) {
|
||||
directionalClassName = ClassName.LEFT;
|
||||
orderClassName = ClassName.NEXT;
|
||||
eventDirectionName = Direction.LEFT;
|
||||
if (direction === DIRECTION_NEXT) {
|
||||
directionalClassName = CLASS_NAME_LEFT;
|
||||
orderClassName = CLASS_NAME_NEXT;
|
||||
eventDirectionName = DIRECTION_LEFT;
|
||||
} else {
|
||||
directionalClassName = ClassName.RIGHT;
|
||||
orderClassName = ClassName.PREV;
|
||||
eventDirectionName = Direction.RIGHT;
|
||||
directionalClassName = CLASS_NAME_RIGHT;
|
||||
orderClassName = CLASS_NAME_PREV;
|
||||
eventDirectionName = DIRECTION_RIGHT;
|
||||
}
|
||||
|
||||
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
|
||||
if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE)) {
|
||||
this._isSliding = false;
|
||||
return;
|
||||
}
|
||||
@@ -512,14 +454,14 @@
|
||||
|
||||
this._setActiveIndicatorElement(nextElement);
|
||||
|
||||
var slidEvent = $.Event(Event.SLID, {
|
||||
var slidEvent = $.Event(EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
to: nextElementIndex
|
||||
});
|
||||
|
||||
if ($(this._element).hasClass(ClassName.SLIDE)) {
|
||||
if ($(this._element).hasClass(CLASS_NAME_SLIDE)) {
|
||||
$(nextElement).addClass(orderClassName);
|
||||
Util.reflow(nextElement);
|
||||
$(activeElement).addClass(directionalClassName);
|
||||
@@ -535,16 +477,16 @@
|
||||
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
|
||||
$(activeElement).one(Util.TRANSITION_END, function () {
|
||||
$(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
|
||||
$(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
|
||||
$(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE);
|
||||
$(activeElement).removeClass(CLASS_NAME_ACTIVE + " " + orderClassName + " " + directionalClassName);
|
||||
_this4._isSliding = false;
|
||||
setTimeout(function () {
|
||||
return $(_this4._element).trigger(slidEvent);
|
||||
}, 0);
|
||||
}).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
$(activeElement).removeClass(ClassName.ACTIVE);
|
||||
$(nextElement).addClass(ClassName.ACTIVE);
|
||||
$(activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||
$(nextElement).addClass(CLASS_NAME_ACTIVE);
|
||||
this._isSliding = false;
|
||||
$(this._element).trigger(slidEvent);
|
||||
}
|
||||
@@ -559,10 +501,10 @@
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
|
||||
var _config = _objectSpread({}, Default, $(this).data());
|
||||
var _config = _extends({}, Default, $(this).data());
|
||||
|
||||
if (typeof config === 'object') {
|
||||
_config = _objectSpread({}, _config, config);
|
||||
_config = _extends({}, _config, config);
|
||||
}
|
||||
|
||||
var action = typeof config === 'string' ? config : _config.slide;
|
||||
@@ -596,11 +538,11 @@
|
||||
|
||||
var target = $(selector)[0];
|
||||
|
||||
if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
|
||||
if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var config = _objectSpread({}, $(target).data(), $(this).data());
|
||||
var config = _extends({}, $(target).data(), $(this).data());
|
||||
|
||||
var slideIndex = this.getAttribute('data-slide-to');
|
||||
|
||||
@@ -638,9 +580,9 @@
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
|
||||
$(window).on(Event.LOAD_DATA_API, function () {
|
||||
var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
|
||||
$(window).on(EVENT_LOAD_DATA_API, function () {
|
||||
var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));
|
||||
|
||||
for (var i = 0, len = carousels.length; i < len; i++) {
|
||||
var $carousel = $(carousels[i]);
|
||||
@@ -664,5 +606,5 @@
|
||||
|
||||
return Carousel;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=carousel.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+55
-111
@@ -1,67 +1,22 @@
|
||||
/*!
|
||||
* Bootstrap collapse.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap collapse.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||
(global = global || self, global.Collapse = factory(global.jQuery, global.Util));
|
||||
}(this, function ($, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.jQuery, global.Util));
|
||||
}(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -69,7 +24,7 @@
|
||||
*/
|
||||
|
||||
var NAME = 'collapse';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.collapse';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@@ -82,43 +37,32 @@
|
||||
toggle: 'boolean',
|
||||
parent: '(string|element)'
|
||||
};
|
||||
var Event = {
|
||||
SHOW: "show" + EVENT_KEY,
|
||||
SHOWN: "shown" + EVENT_KEY,
|
||||
HIDE: "hide" + EVENT_KEY,
|
||||
HIDDEN: "hidden" + EVENT_KEY,
|
||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
SHOW: 'show',
|
||||
COLLAPSE: 'collapse',
|
||||
COLLAPSING: 'collapsing',
|
||||
COLLAPSED: 'collapsed'
|
||||
};
|
||||
var Dimension = {
|
||||
WIDTH: 'width',
|
||||
HEIGHT: 'height'
|
||||
};
|
||||
var Selector = {
|
||||
ACTIVES: '.show, .collapsing',
|
||||
DATA_TOGGLE: '[data-toggle="collapse"]'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var CLASS_NAME_COLLAPSE = 'collapse';
|
||||
var CLASS_NAME_COLLAPSING = 'collapsing';
|
||||
var CLASS_NAME_COLLAPSED = 'collapsed';
|
||||
var DIMENSION_WIDTH = 'width';
|
||||
var DIMENSION_HEIGHT = 'height';
|
||||
var SELECTOR_ACTIVES = '.show, .collapsing';
|
||||
var SELECTOR_DATA_TOGGLE = '[data-toggle="collapse"]';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
var Collapse =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Collapse = /*#__PURE__*/function () {
|
||||
function Collapse(element, config) {
|
||||
this._isTransitioning = false;
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
|
||||
var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
|
||||
var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||
|
||||
for (var i = 0, len = toggleList.length; i < len; i++) {
|
||||
var elem = toggleList[i];
|
||||
@@ -150,7 +94,7 @@
|
||||
|
||||
// Public
|
||||
_proto.toggle = function toggle() {
|
||||
if ($(this._element).hasClass(ClassName.SHOW)) {
|
||||
if ($(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
this.hide();
|
||||
} else {
|
||||
this.show();
|
||||
@@ -160,7 +104,7 @@
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
|
||||
if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) {
|
||||
if (this._isTransitioning || $(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -168,12 +112,12 @@
|
||||
var activesData;
|
||||
|
||||
if (this._parent) {
|
||||
actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {
|
||||
actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {
|
||||
if (typeof _this._config.parent === 'string') {
|
||||
return elem.getAttribute('data-parent') === _this._config.parent;
|
||||
}
|
||||
|
||||
return elem.classList.contains(ClassName.COLLAPSE);
|
||||
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
||||
});
|
||||
|
||||
if (actives.length === 0) {
|
||||
@@ -189,7 +133,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var startEvent = $.Event(Event.SHOW);
|
||||
var startEvent = $.Event(EVENT_SHOW);
|
||||
$(this._element).trigger(startEvent);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
@@ -206,22 +150,22 @@
|
||||
|
||||
var dimension = this._getDimension();
|
||||
|
||||
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
|
||||
$(this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
|
||||
this._element.style[dimension] = 0;
|
||||
|
||||
if (this._triggerArray.length) {
|
||||
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
|
||||
$(this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
|
||||
}
|
||||
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
$(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
|
||||
$(_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW);
|
||||
_this._element.style[dimension] = '';
|
||||
|
||||
_this.setTransitioning(false);
|
||||
|
||||
$(_this._element).trigger(Event.SHOWN);
|
||||
$(_this._element).trigger(EVENT_SHOWN);
|
||||
};
|
||||
|
||||
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||
@@ -234,11 +178,11 @@
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) {
|
||||
if (this._isTransitioning || !$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var startEvent = $.Event(Event.HIDE);
|
||||
var startEvent = $.Event(EVENT_HIDE);
|
||||
$(this._element).trigger(startEvent);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
@@ -249,7 +193,7 @@
|
||||
|
||||
this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
|
||||
Util.reflow(this._element);
|
||||
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
|
||||
$(this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW);
|
||||
var triggerArrayLength = this._triggerArray.length;
|
||||
|
||||
if (triggerArrayLength > 0) {
|
||||
@@ -260,8 +204,8 @@
|
||||
if (selector !== null) {
|
||||
var $elem = $([].slice.call(document.querySelectorAll(selector)));
|
||||
|
||||
if (!$elem.hasClass(ClassName.SHOW)) {
|
||||
$(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
|
||||
if (!$elem.hasClass(CLASS_NAME_SHOW)) {
|
||||
$(trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -272,7 +216,7 @@
|
||||
var complete = function complete() {
|
||||
_this2.setTransitioning(false);
|
||||
|
||||
$(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
|
||||
$(_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
@@ -295,7 +239,7 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread({}, Default, config);
|
||||
config = _extends({}, Default, config);
|
||||
config.toggle = Boolean(config.toggle); // Coerce string values
|
||||
|
||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||
@@ -303,8 +247,8 @@
|
||||
};
|
||||
|
||||
_proto._getDimension = function _getDimension() {
|
||||
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
|
||||
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
|
||||
var hasWidth = $(this._element).hasClass(DIMENSION_WIDTH);
|
||||
return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
|
||||
};
|
||||
|
||||
_proto._getParent = function _getParent() {
|
||||
@@ -331,10 +275,10 @@
|
||||
};
|
||||
|
||||
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
|
||||
var isOpen = $(element).hasClass(ClassName.SHOW);
|
||||
var isOpen = $(element).hasClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (triggerArray.length) {
|
||||
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||
$(triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||
}
|
||||
} // Static
|
||||
;
|
||||
@@ -349,9 +293,9 @@
|
||||
var $this = $(this);
|
||||
var data = $this.data(DATA_KEY);
|
||||
|
||||
var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
|
||||
var _config = _extends({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (!data && _config.toggle && /show|hide/.test(config)) {
|
||||
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||
_config.toggle = false;
|
||||
}
|
||||
|
||||
@@ -391,7 +335,7 @@
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
|
||||
if (event.currentTarget.tagName === 'A') {
|
||||
event.preventDefault();
|
||||
@@ -424,5 +368,5 @@
|
||||
|
||||
return Collapse;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=collapse.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+125
-182
@@ -1,68 +1,23 @@
|
||||
/*!
|
||||
* Bootstrap dropdown.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap dropdown.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
|
||||
(global = global || self, global.Dropdown = factory(global.jQuery, global.Popper, global.Util));
|
||||
}(this, function ($, Popper, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.jQuery, global.Popper, global.Util));
|
||||
}(this, (function ($, Popper, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -70,7 +25,7 @@
|
||||
*/
|
||||
|
||||
var NAME = 'dropdown';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.dropdown';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@@ -88,67 +43,55 @@
|
||||
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
||||
|
||||
var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
|
||||
var Event = {
|
||||
HIDE: "hide" + EVENT_KEY,
|
||||
HIDDEN: "hidden" + EVENT_KEY,
|
||||
SHOW: "show" + EVENT_KEY,
|
||||
SHOWN: "shown" + EVENT_KEY,
|
||||
CLICK: "click" + EVENT_KEY,
|
||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
|
||||
KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
|
||||
KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
DISABLED: 'disabled',
|
||||
SHOW: 'show',
|
||||
DROPUP: 'dropup',
|
||||
DROPRIGHT: 'dropright',
|
||||
DROPLEFT: 'dropleft',
|
||||
MENURIGHT: 'dropdown-menu-right',
|
||||
MENULEFT: 'dropdown-menu-left',
|
||||
POSITION_STATIC: 'position-static'
|
||||
};
|
||||
var Selector = {
|
||||
DATA_TOGGLE: '[data-toggle="dropdown"]',
|
||||
FORM_CHILD: '.dropdown form',
|
||||
MENU: '.dropdown-menu',
|
||||
NAVBAR_NAV: '.navbar-nav',
|
||||
VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
|
||||
};
|
||||
var AttachmentMap = {
|
||||
TOP: 'top-start',
|
||||
TOPEND: 'top-end',
|
||||
BOTTOM: 'bottom-start',
|
||||
BOTTOMEND: 'bottom-end',
|
||||
RIGHT: 'right-start',
|
||||
RIGHTEND: 'right-end',
|
||||
LEFT: 'left-start',
|
||||
LEFTEND: 'left-end'
|
||||
};
|
||||
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||
var EVENT_CLICK = "click" + EVENT_KEY;
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY + DATA_API_KEY;
|
||||
var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY + DATA_API_KEY;
|
||||
var CLASS_NAME_DISABLED = 'disabled';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var CLASS_NAME_DROPUP = 'dropup';
|
||||
var CLASS_NAME_DROPRIGHT = 'dropright';
|
||||
var CLASS_NAME_DROPLEFT = 'dropleft';
|
||||
var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
|
||||
var CLASS_NAME_POSITION_STATIC = 'position-static';
|
||||
var SELECTOR_DATA_TOGGLE = '[data-toggle="dropdown"]';
|
||||
var SELECTOR_FORM_CHILD = '.dropdown form';
|
||||
var SELECTOR_MENU = '.dropdown-menu';
|
||||
var SELECTOR_NAVBAR_NAV = '.navbar-nav';
|
||||
var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
|
||||
var PLACEMENT_TOP = 'top-start';
|
||||
var PLACEMENT_TOPEND = 'top-end';
|
||||
var PLACEMENT_BOTTOM = 'bottom-start';
|
||||
var PLACEMENT_BOTTOMEND = 'bottom-end';
|
||||
var PLACEMENT_RIGHT = 'right-start';
|
||||
var PLACEMENT_LEFT = 'left-start';
|
||||
var Default = {
|
||||
offset: 0,
|
||||
flip: true,
|
||||
boundary: 'scrollParent',
|
||||
reference: 'toggle',
|
||||
display: 'dynamic'
|
||||
display: 'dynamic',
|
||||
popperConfig: null
|
||||
};
|
||||
var DefaultType = {
|
||||
offset: '(number|string|function)',
|
||||
flip: 'boolean',
|
||||
boundary: '(string|element)',
|
||||
reference: '(string|element)',
|
||||
display: 'string'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
display: 'string',
|
||||
popperConfig: '(null|object)'
|
||||
};
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Dropdown =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Dropdown = /*#__PURE__*/function () {
|
||||
function Dropdown(element, config) {
|
||||
this._element = element;
|
||||
this._popper = null;
|
||||
@@ -164,13 +107,11 @@
|
||||
|
||||
// Public
|
||||
_proto.toggle = function toggle() {
|
||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
|
||||
var isActive = $(this._menu).hasClass(ClassName.SHOW);
|
||||
var isActive = $(this._menu).hasClass(CLASS_NAME_SHOW);
|
||||
|
||||
Dropdown._clearMenus();
|
||||
|
||||
@@ -178,10 +119,25 @@
|
||||
return;
|
||||
}
|
||||
|
||||
this.show(true);
|
||||
};
|
||||
|
||||
_proto.show = function show(usePopper) {
|
||||
if (usePopper === void 0) {
|
||||
usePopper = false;
|
||||
}
|
||||
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
};
|
||||
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
||||
var showEvent = $.Event(EVENT_SHOW, relatedTarget);
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
|
||||
$(parent).trigger(showEvent);
|
||||
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
@@ -189,7 +145,7 @@
|
||||
} // Disable totally Popper.js for Dropdown in Navbar
|
||||
|
||||
|
||||
if (!this._inNavbar) {
|
||||
if (!this._inNavbar && usePopper) {
|
||||
/**
|
||||
* Check for Popper dependency
|
||||
* Popper - https://popper.js.org
|
||||
@@ -214,7 +170,7 @@
|
||||
|
||||
|
||||
if (this._config.boundary !== 'scrollParent') {
|
||||
$(parent).addClass(ClassName.POSITION_STATIC);
|
||||
$(parent).addClass(CLASS_NAME_POSITION_STATIC);
|
||||
}
|
||||
|
||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
|
||||
@@ -224,7 +180,7 @@
|
||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||
|
||||
|
||||
if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) {
|
||||
if ('ontouchstart' in document.documentElement && $(parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
|
||||
$(document.body).children().on('mouseover', null, $.noop);
|
||||
}
|
||||
|
||||
@@ -232,41 +188,19 @@
|
||||
|
||||
this._element.setAttribute('aria-expanded', true);
|
||||
|
||||
$(this._menu).toggleClass(ClassName.SHOW);
|
||||
$(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
};
|
||||
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
|
||||
$(parent).trigger(showEvent);
|
||||
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(this._menu).toggleClass(ClassName.SHOW);
|
||||
$(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));
|
||||
$(this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||
$(parent).toggleClass(CLASS_NAME_SHOW).trigger($.Event(EVENT_SHOWN, relatedTarget));
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) {
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
};
|
||||
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
||||
var hideEvent = $.Event(EVENT_HIDE, relatedTarget);
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
|
||||
@@ -276,8 +210,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$(this._menu).toggleClass(ClassName.SHOW);
|
||||
$(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
}
|
||||
|
||||
$(this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||
$(parent).toggleClass(CLASS_NAME_SHOW).trigger($.Event(EVENT_HIDDEN, relatedTarget));
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
@@ -305,7 +243,7 @@
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this = this;
|
||||
|
||||
$(this._element).on(Event.CLICK, function (event) {
|
||||
$(this._element).on(EVENT_CLICK, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
@@ -314,7 +252,7 @@
|
||||
};
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
|
||||
config = _extends({}, this.constructor.Default, $(this._element).data(), config);
|
||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
return config;
|
||||
};
|
||||
@@ -324,7 +262,7 @@
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
|
||||
if (parent) {
|
||||
this._menu = parent.querySelector(Selector.MENU);
|
||||
this._menu = parent.querySelector(SELECTOR_MENU);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,20 +271,16 @@
|
||||
|
||||
_proto._getPlacement = function _getPlacement() {
|
||||
var $parentDropdown = $(this._element.parentNode);
|
||||
var placement = AttachmentMap.BOTTOM; // Handle dropup
|
||||
var placement = PLACEMENT_BOTTOM; // Handle dropup
|
||||
|
||||
if ($parentDropdown.hasClass(ClassName.DROPUP)) {
|
||||
placement = AttachmentMap.TOP;
|
||||
|
||||
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
||||
placement = AttachmentMap.TOPEND;
|
||||
}
|
||||
} else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
|
||||
placement = AttachmentMap.RIGHT;
|
||||
} else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
|
||||
placement = AttachmentMap.LEFT;
|
||||
} else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
||||
placement = AttachmentMap.BOTTOMEND;
|
||||
if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
|
||||
placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
|
||||
placement = PLACEMENT_RIGHT;
|
||||
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
|
||||
placement = PLACEMENT_LEFT;
|
||||
} else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
|
||||
placement = PLACEMENT_BOTTOMEND;
|
||||
}
|
||||
|
||||
return placement;
|
||||
@@ -363,7 +297,7 @@
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@@ -384,9 +318,8 @@
|
||||
preventOverflow: {
|
||||
boundariesElement: this._config.boundary
|
||||
}
|
||||
} // Disable Popper.js if we have a static display
|
||||
|
||||
};
|
||||
}
|
||||
}; // Disable Popper.js if we have a static display
|
||||
|
||||
if (this._config.display === 'static') {
|
||||
popperConfig.modifiers.applyStyle = {
|
||||
@@ -394,7 +327,7 @@
|
||||
};
|
||||
}
|
||||
|
||||
return popperConfig;
|
||||
return _extends({}, popperConfig, this._config.popperConfig);
|
||||
} // Static
|
||||
;
|
||||
|
||||
@@ -424,7 +357,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
|
||||
var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||
|
||||
for (var i = 0, len = toggles.length; i < len; i++) {
|
||||
var parent = Dropdown._getParentFromElement(toggles[i]);
|
||||
@@ -444,7 +377,7 @@
|
||||
|
||||
var dropdownMenu = context._menu;
|
||||
|
||||
if (!$(parent).hasClass(ClassName.SHOW)) {
|
||||
if (!$(parent).hasClass(CLASS_NAME_SHOW)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -452,7 +385,7 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
||||
var hideEvent = $.Event(EVENT_HIDE, relatedTarget);
|
||||
$(parent).trigger(hideEvent);
|
||||
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
@@ -466,8 +399,13 @@
|
||||
}
|
||||
|
||||
toggles[i].setAttribute('aria-expanded', 'false');
|
||||
$(dropdownMenu).removeClass(ClassName.SHOW);
|
||||
$(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
|
||||
|
||||
if (context._popper) {
|
||||
context._popper.destroy();
|
||||
}
|
||||
|
||||
$(dropdownMenu).removeClass(CLASS_NAME_SHOW);
|
||||
$(parent).removeClass(CLASS_NAME_SHOW).trigger($.Event(EVENT_HIDDEN, relatedTarget));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -491,32 +429,37 @@
|
||||
// - If key is other than escape
|
||||
// - If key is not up or down => not a dropdown command
|
||||
// - If trigger inside the menu => not a dropdown command
|
||||
if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
||||
if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this);
|
||||
|
||||
var isActive = $(parent).hasClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this);
|
||||
|
||||
var isActive = $(parent).hasClass(ClassName.SHOW);
|
||||
|
||||
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
var toggle = parent.querySelector(Selector.DATA_TOGGLE);
|
||||
$(toggle).trigger('focus');
|
||||
$(parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus');
|
||||
}
|
||||
|
||||
$(this).trigger('click');
|
||||
return;
|
||||
}
|
||||
|
||||
var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));
|
||||
var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
|
||||
return $(item).is(':visible');
|
||||
});
|
||||
|
||||
if (items.length === 0) {
|
||||
return;
|
||||
@@ -567,12 +510,12 @@
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
$(document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
Dropdown._jQueryInterface.call($(this), 'toggle');
|
||||
}).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
|
||||
}).on(EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
/**
|
||||
@@ -591,5 +534,5 @@
|
||||
|
||||
return Dropdown;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=dropdown.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): index.js
|
||||
* Bootstrap (v4.4.0): index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Vendored
+162
-174
@@ -1,67 +1,22 @@
|
||||
/*!
|
||||
* Bootstrap modal.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap modal.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||
(global = global || self, global.Modal = factory(global.jQuery, global.Util));
|
||||
}(this, function ($, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.jQuery, global.Util));
|
||||
}(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -69,7 +24,7 @@
|
||||
*/
|
||||
|
||||
var NAME = 'modal';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.modal';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@@ -88,49 +43,42 @@
|
||||
focus: 'boolean',
|
||||
show: 'boolean'
|
||||
};
|
||||
var Event = {
|
||||
HIDE: "hide" + EVENT_KEY,
|
||||
HIDDEN: "hidden" + EVENT_KEY,
|
||||
SHOW: "show" + EVENT_KEY,
|
||||
SHOWN: "shown" + EVENT_KEY,
|
||||
FOCUSIN: "focusin" + EVENT_KEY,
|
||||
RESIZE: "resize" + EVENT_KEY,
|
||||
CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
|
||||
KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
|
||||
MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
|
||||
MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
|
||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
SCROLLABLE: 'modal-dialog-scrollable',
|
||||
SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
|
||||
BACKDROP: 'modal-backdrop',
|
||||
OPEN: 'modal-open',
|
||||
FADE: 'fade',
|
||||
SHOW: 'show'
|
||||
};
|
||||
var Selector = {
|
||||
DIALOG: '.modal-dialog',
|
||||
MODAL_BODY: '.modal-body',
|
||||
DATA_TOGGLE: '[data-toggle="modal"]',
|
||||
DATA_DISMISS: '[data-dismiss="modal"]',
|
||||
FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
|
||||
STICKY_CONTENT: '.sticky-top'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY;
|
||||
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||
var EVENT_FOCUSIN = "focusin" + EVENT_KEY;
|
||||
var EVENT_RESIZE = "resize" + EVENT_KEY;
|
||||
var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
|
||||
var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY;
|
||||
var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY;
|
||||
var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY;
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
|
||||
var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
|
||||
var CLASS_NAME_BACKDROP = 'modal-backdrop';
|
||||
var CLASS_NAME_OPEN = 'modal-open';
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var CLASS_NAME_STATIC = 'modal-static';
|
||||
var SELECTOR_DIALOG = '.modal-dialog';
|
||||
var SELECTOR_MODAL_BODY = '.modal-body';
|
||||
var SELECTOR_DATA_TOGGLE = '[data-toggle="modal"]';
|
||||
var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
|
||||
var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||
var SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
var Modal =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Modal = /*#__PURE__*/function () {
|
||||
function Modal(element, config) {
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._dialog = element.querySelector(Selector.DIALOG);
|
||||
this._dialog = element.querySelector(SELECTOR_DIALOG);
|
||||
this._backdrop = null;
|
||||
this._isShown = false;
|
||||
this._isBodyOverflowing = false;
|
||||
@@ -154,11 +102,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if ($(this._element).hasClass(ClassName.FADE)) {
|
||||
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._isTransitioning = true;
|
||||
}
|
||||
|
||||
var showEvent = $.Event(Event.SHOW, {
|
||||
var showEvent = $.Event(EVENT_SHOW, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
$(this._element).trigger(showEvent);
|
||||
@@ -179,11 +127,11 @@
|
||||
|
||||
this._setResizeEvent();
|
||||
|
||||
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
|
||||
$(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
|
||||
return _this.hide(event);
|
||||
});
|
||||
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
|
||||
$(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
|
||||
$(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {
|
||||
$(_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if ($(event.target).is(_this._element)) {
|
||||
_this._ignoreBackdropClick = true;
|
||||
}
|
||||
@@ -206,7 +154,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(Event.HIDE);
|
||||
var hideEvent = $.Event(EVENT_HIDE);
|
||||
$(this._element).trigger(hideEvent);
|
||||
|
||||
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
||||
@@ -214,7 +162,7 @@
|
||||
}
|
||||
|
||||
this._isShown = false;
|
||||
var transition = $(this._element).hasClass(ClassName.FADE);
|
||||
var transition = $(this._element).hasClass(CLASS_NAME_FADE);
|
||||
|
||||
if (transition) {
|
||||
this._isTransitioning = true;
|
||||
@@ -224,10 +172,10 @@
|
||||
|
||||
this._setResizeEvent();
|
||||
|
||||
$(document).off(Event.FOCUSIN);
|
||||
$(this._element).removeClass(ClassName.SHOW);
|
||||
$(this._element).off(Event.CLICK_DISMISS);
|
||||
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
|
||||
$(document).off(EVENT_FOCUSIN);
|
||||
$(this._element).removeClass(CLASS_NAME_SHOW);
|
||||
$(this._element).off(EVENT_CLICK_DISMISS);
|
||||
$(this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
|
||||
|
||||
if (transition) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
@@ -244,12 +192,12 @@
|
||||
return $(htmlElement).off(EVENT_KEY);
|
||||
});
|
||||
/**
|
||||
* `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
|
||||
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||
* Do not move `document` in `htmlElements` array
|
||||
* It will remove `Event.CLICK_DATA_API` event that should remain
|
||||
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||
*/
|
||||
|
||||
$(document).off(Event.FOCUSIN);
|
||||
$(document).off(EVENT_FOCUSIN);
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
@@ -268,15 +216,53 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread({}, Default, config);
|
||||
config = _extends({}, Default, config);
|
||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||
return config;
|
||||
};
|
||||
|
||||
_proto._showElement = function _showElement(relatedTarget) {
|
||||
_proto._triggerBackdropTransition = function _triggerBackdropTransition() {
|
||||
var _this3 = this;
|
||||
|
||||
var transition = $(this._element).hasClass(ClassName.FADE);
|
||||
if (this._config.backdrop === 'static') {
|
||||
var hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED);
|
||||
$(this._element).trigger(hideEventPrevented);
|
||||
|
||||
if (hideEventPrevented.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
this._element.style.overflowY = 'hidden';
|
||||
}
|
||||
|
||||
this._element.classList.add(CLASS_NAME_STATIC);
|
||||
|
||||
var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog);
|
||||
$(this._element).off(Util.TRANSITION_END);
|
||||
$(this._element).one(Util.TRANSITION_END, function () {
|
||||
_this3._element.classList.remove(CLASS_NAME_STATIC);
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
$(_this3._element).one(Util.TRANSITION_END, function () {
|
||||
_this3._element.style.overflowY = '';
|
||||
}).emulateTransitionEnd(_this3._element, modalTransitionDuration);
|
||||
}
|
||||
}).emulateTransitionEnd(modalTransitionDuration);
|
||||
|
||||
this._element.focus();
|
||||
} else {
|
||||
this.hide();
|
||||
}
|
||||
};
|
||||
|
||||
_proto._showElement = function _showElement(relatedTarget) {
|
||||
var _this4 = this;
|
||||
|
||||
var transition = $(this._element).hasClass(CLASS_NAME_FADE);
|
||||
var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;
|
||||
|
||||
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
||||
// Don't move modal's DOM position
|
||||
@@ -289,8 +275,10 @@
|
||||
|
||||
this._element.setAttribute('aria-modal', true);
|
||||
|
||||
if ($(this._dialog).hasClass(ClassName.SCROLLABLE)) {
|
||||
this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0;
|
||||
this._element.setAttribute('role', 'dialog');
|
||||
|
||||
if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
|
||||
modalBody.scrollTop = 0;
|
||||
} else {
|
||||
this._element.scrollTop = 0;
|
||||
}
|
||||
@@ -299,23 +287,23 @@
|
||||
Util.reflow(this._element);
|
||||
}
|
||||
|
||||
$(this._element).addClass(ClassName.SHOW);
|
||||
$(this._element).addClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (this._config.focus) {
|
||||
this._enforceFocus();
|
||||
}
|
||||
|
||||
var shownEvent = $.Event(Event.SHOWN, {
|
||||
var shownEvent = $.Event(EVENT_SHOWN, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
|
||||
var transitionComplete = function transitionComplete() {
|
||||
if (_this3._config.focus) {
|
||||
_this3._element.focus();
|
||||
if (_this4._config.focus) {
|
||||
_this4._element.focus();
|
||||
}
|
||||
|
||||
_this3._isTransitioning = false;
|
||||
$(_this3._element).trigger(shownEvent);
|
||||
_this4._isTransitioning = false;
|
||||
$(_this4._element).trigger(shownEvent);
|
||||
};
|
||||
|
||||
if (transition) {
|
||||
@@ -327,46 +315,48 @@
|
||||
};
|
||||
|
||||
_proto._enforceFocus = function _enforceFocus() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
$(document).off(Event.FOCUSIN) // Guard against infinite focus loop
|
||||
.on(Event.FOCUSIN, function (event) {
|
||||
if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
|
||||
_this4._element.focus();
|
||||
$(document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
|
||||
.on(EVENT_FOCUSIN, function (event) {
|
||||
if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {
|
||||
_this5._element.focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_proto._setEscapeEvent = function _setEscapeEvent() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
if (this._isShown && this._config.keyboard) {
|
||||
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
if (this._isShown) {
|
||||
$(this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
|
||||
if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
event.preventDefault();
|
||||
|
||||
_this5.hide();
|
||||
_this6.hide();
|
||||
} else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
_this6._triggerBackdropTransition();
|
||||
}
|
||||
});
|
||||
} else if (!this._isShown) {
|
||||
$(this._element).off(Event.KEYDOWN_DISMISS);
|
||||
$(this._element).off(EVENT_KEYDOWN_DISMISS);
|
||||
}
|
||||
};
|
||||
|
||||
_proto._setResizeEvent = function _setResizeEvent() {
|
||||
var _this6 = this;
|
||||
var _this7 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
$(window).on(Event.RESIZE, function (event) {
|
||||
return _this6.handleUpdate(event);
|
||||
$(window).on(EVENT_RESIZE, function (event) {
|
||||
return _this7.handleUpdate(event);
|
||||
});
|
||||
} else {
|
||||
$(window).off(Event.RESIZE);
|
||||
$(window).off(EVENT_RESIZE);
|
||||
}
|
||||
};
|
||||
|
||||
_proto._hideModal = function _hideModal() {
|
||||
var _this7 = this;
|
||||
var _this8 = this;
|
||||
|
||||
this._element.style.display = 'none';
|
||||
|
||||
@@ -374,16 +364,18 @@
|
||||
|
||||
this._element.removeAttribute('aria-modal');
|
||||
|
||||
this._element.removeAttribute('role');
|
||||
|
||||
this._isTransitioning = false;
|
||||
|
||||
this._showBackdrop(function () {
|
||||
$(document.body).removeClass(ClassName.OPEN);
|
||||
$(document.body).removeClass(CLASS_NAME_OPEN);
|
||||
|
||||
_this7._resetAdjustments();
|
||||
_this8._resetAdjustments();
|
||||
|
||||
_this7._resetScrollbar();
|
||||
_this8._resetScrollbar();
|
||||
|
||||
$(_this7._element).trigger(Event.HIDDEN);
|
||||
$(_this8._element).trigger(EVENT_HIDDEN);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -395,22 +387,22 @@
|
||||
};
|
||||
|
||||
_proto._showBackdrop = function _showBackdrop(callback) {
|
||||
var _this8 = this;
|
||||
var _this9 = this;
|
||||
|
||||
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
|
||||
var animate = $(this._element).hasClass(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||
|
||||
if (this._isShown && this._config.backdrop) {
|
||||
this._backdrop = document.createElement('div');
|
||||
this._backdrop.className = ClassName.BACKDROP;
|
||||
this._backdrop.className = CLASS_NAME_BACKDROP;
|
||||
|
||||
if (animate) {
|
||||
this._backdrop.classList.add(animate);
|
||||
}
|
||||
|
||||
$(this._backdrop).appendTo(document.body);
|
||||
$(this._element).on(Event.CLICK_DISMISS, function (event) {
|
||||
if (_this8._ignoreBackdropClick) {
|
||||
_this8._ignoreBackdropClick = false;
|
||||
$(this._element).on(EVENT_CLICK_DISMISS, function (event) {
|
||||
if (_this9._ignoreBackdropClick) {
|
||||
_this9._ignoreBackdropClick = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -418,18 +410,14 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (_this8._config.backdrop === 'static') {
|
||||
_this8._element.focus();
|
||||
} else {
|
||||
_this8.hide();
|
||||
}
|
||||
_this9._triggerBackdropTransition();
|
||||
});
|
||||
|
||||
if (animate) {
|
||||
Util.reflow(this._backdrop);
|
||||
}
|
||||
|
||||
$(this._backdrop).addClass(ClassName.SHOW);
|
||||
$(this._backdrop).addClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (!callback) {
|
||||
return;
|
||||
@@ -443,17 +431,17 @@
|
||||
var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
|
||||
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
|
||||
} else if (!this._isShown && this._backdrop) {
|
||||
$(this._backdrop).removeClass(ClassName.SHOW);
|
||||
$(this._backdrop).removeClass(CLASS_NAME_SHOW);
|
||||
|
||||
var callbackRemove = function callbackRemove() {
|
||||
_this8._removeBackdrop();
|
||||
_this9._removeBackdrop();
|
||||
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
if ($(this._element).hasClass(ClassName.FADE)) {
|
||||
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
|
||||
|
||||
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
|
||||
@@ -488,29 +476,29 @@
|
||||
|
||||
_proto._checkScrollbar = function _checkScrollbar() {
|
||||
var rect = document.body.getBoundingClientRect();
|
||||
this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
|
||||
this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
|
||||
this._scrollbarWidth = this._getScrollbarWidth();
|
||||
};
|
||||
|
||||
_proto._setScrollbar = function _setScrollbar() {
|
||||
var _this9 = this;
|
||||
var _this10 = this;
|
||||
|
||||
if (this._isBodyOverflowing) {
|
||||
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
||||
var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
|
||||
var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding
|
||||
var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
|
||||
var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding
|
||||
|
||||
$(fixedContent).each(function (index, element) {
|
||||
var actualPadding = element.style.paddingRight;
|
||||
var calculatedPadding = $(element).css('padding-right');
|
||||
$(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
|
||||
$(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
|
||||
}); // Adjust sticky content margin
|
||||
|
||||
$(stickyContent).each(function (index, element) {
|
||||
var actualMargin = element.style.marginRight;
|
||||
var calculatedMargin = $(element).css('margin-right');
|
||||
$(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
|
||||
$(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
|
||||
}); // Adjust body padding
|
||||
|
||||
var actualPadding = document.body.style.paddingRight;
|
||||
@@ -518,19 +506,19 @@
|
||||
$(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
|
||||
}
|
||||
|
||||
$(document.body).addClass(ClassName.OPEN);
|
||||
$(document.body).addClass(CLASS_NAME_OPEN);
|
||||
};
|
||||
|
||||
_proto._resetScrollbar = function _resetScrollbar() {
|
||||
// Restore fixed content padding
|
||||
var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
|
||||
var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
|
||||
$(fixedContent).each(function (index, element) {
|
||||
var padding = $(element).data('padding-right');
|
||||
$(element).removeData('padding-right');
|
||||
element.style.paddingRight = padding ? padding : '';
|
||||
}); // Restore sticky content
|
||||
|
||||
var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
|
||||
var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));
|
||||
$(elements).each(function (index, element) {
|
||||
var margin = $(element).data('margin-right');
|
||||
|
||||
@@ -547,7 +535,7 @@
|
||||
_proto._getScrollbarWidth = function _getScrollbarWidth() {
|
||||
// thx d.walsh
|
||||
var scrollDiv = document.createElement('div');
|
||||
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
|
||||
scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
|
||||
document.body.appendChild(scrollDiv);
|
||||
var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
|
||||
document.body.removeChild(scrollDiv);
|
||||
@@ -559,7 +547,7 @@
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
|
||||
var _config = _objectSpread({}, Default, $(this).data(), typeof config === 'object' && config ? config : {});
|
||||
var _config = _extends({}, Default, $(this).data(), typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (!data) {
|
||||
data = new Modal(this, _config);
|
||||
@@ -599,8 +587,8 @@
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
var _this10 = this;
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
var _this11 = this;
|
||||
|
||||
var target;
|
||||
var selector = Util.getSelectorFromElement(this);
|
||||
@@ -609,21 +597,21 @@
|
||||
target = document.querySelector(selector);
|
||||
}
|
||||
|
||||
var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
|
||||
var config = $(target).data(DATA_KEY) ? 'toggle' : _extends({}, $(target).data(), $(this).data());
|
||||
|
||||
if (this.tagName === 'A' || this.tagName === 'AREA') {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
var $target = $(target).one(Event.SHOW, function (showEvent) {
|
||||
var $target = $(target).one(EVENT_SHOW, function (showEvent) {
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
// Only register focus restorer if modal will actually get shown
|
||||
return;
|
||||
}
|
||||
|
||||
$target.one(Event.HIDDEN, function () {
|
||||
if ($(_this10).is(':visible')) {
|
||||
_this10.focus();
|
||||
$target.one(EVENT_HIDDEN, function () {
|
||||
if ($(_this11).is(':visible')) {
|
||||
_this11.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -646,5 +634,5 @@
|
||||
|
||||
return Modal;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=modal.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+28
-84
@@ -1,73 +1,24 @@
|
||||
/*!
|
||||
* Bootstrap popover.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap popover.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) :
|
||||
(global = global || self, global.Popover = factory(global.jQuery, global.Tooltip));
|
||||
}(this, function ($, Tooltip) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.jQuery, global.Tooltip));
|
||||
}(this, (function ($, Tooltip) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Tooltip = Tooltip && Tooltip.hasOwnProperty('default') ? Tooltip['default'] : Tooltip;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Tooltip = Tooltip && Object.prototype.hasOwnProperty.call(Tooltip, 'default') ? Tooltip['default'] : Tooltip;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _inheritsLoose(subClass, superClass) {
|
||||
subClass.prototype = Object.create(superClass.prototype);
|
||||
subClass.prototype.constructor = subClass;
|
||||
subClass.__proto__ = superClass;
|
||||
}
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -75,32 +26,28 @@
|
||||
*/
|
||||
|
||||
var NAME = 'popover';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.popover';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var CLASS_PREFIX = 'bs-popover';
|
||||
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
||||
|
||||
var Default = _objectSpread({}, Tooltip.Default, {
|
||||
var Default = _extends({}, Tooltip.Default, {
|
||||
placement: 'right',
|
||||
trigger: 'click',
|
||||
content: '',
|
||||
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
|
||||
});
|
||||
|
||||
var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
|
||||
var DefaultType = _extends({}, Tooltip.DefaultType, {
|
||||
content: '(string|element|function)'
|
||||
});
|
||||
|
||||
var ClassName = {
|
||||
FADE: 'fade',
|
||||
SHOW: 'show'
|
||||
};
|
||||
var Selector = {
|
||||
TITLE: '.popover-header',
|
||||
CONTENT: '.popover-body'
|
||||
};
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var SELECTOR_TITLE = '.popover-header';
|
||||
var SELECTOR_CONTENT = '.popover-body';
|
||||
var Event = {
|
||||
HIDE: "hide" + EVENT_KEY,
|
||||
HIDDEN: "hidden" + EVENT_KEY,
|
||||
@@ -112,17 +59,14 @@
|
||||
FOCUSOUT: "focusout" + EVENT_KEY,
|
||||
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
||||
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Popover =
|
||||
/*#__PURE__*/
|
||||
function (_Tooltip) {
|
||||
var Popover = /*#__PURE__*/function (_Tooltip) {
|
||||
_inheritsLoose(Popover, _Tooltip);
|
||||
|
||||
function Popover() {
|
||||
@@ -148,7 +92,7 @@
|
||||
_proto.setContent = function setContent() {
|
||||
var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
|
||||
|
||||
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
|
||||
this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
|
||||
|
||||
var content = this._getContent();
|
||||
|
||||
@@ -156,8 +100,8 @@
|
||||
content = content.call(this.element);
|
||||
}
|
||||
|
||||
this.setElementContent($tip.find(Selector.CONTENT), content);
|
||||
$tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
|
||||
this.setElementContent($tip.find(SELECTOR_CONTENT), content);
|
||||
$tip.removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
|
||||
} // Private
|
||||
;
|
||||
|
||||
@@ -257,5 +201,5 @@
|
||||
|
||||
return Popover;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=popover.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+51
-111
@@ -1,67 +1,22 @@
|
||||
/*!
|
||||
* Bootstrap scrollspy.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap scrollspy.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||
(global = global || self, global.ScrollSpy = factory(global.jQuery, global.Util));
|
||||
}(this, function ($, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ScrollSpy = factory(global.jQuery, global.Util));
|
||||
}(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -69,7 +24,7 @@
|
||||
*/
|
||||
|
||||
var NAME = 'scrollspy';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.scrollspy';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@@ -84,53 +39,40 @@
|
||||
method: 'string',
|
||||
target: '(string|element)'
|
||||
};
|
||||
var Event = {
|
||||
ACTIVATE: "activate" + EVENT_KEY,
|
||||
SCROLL: "scroll" + EVENT_KEY,
|
||||
LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
DROPDOWN_ITEM: 'dropdown-item',
|
||||
DROPDOWN_MENU: 'dropdown-menu',
|
||||
ACTIVE: 'active'
|
||||
};
|
||||
var Selector = {
|
||||
DATA_SPY: '[data-spy="scroll"]',
|
||||
ACTIVE: '.active',
|
||||
NAV_LIST_GROUP: '.nav, .list-group',
|
||||
NAV_LINKS: '.nav-link',
|
||||
NAV_ITEMS: '.nav-item',
|
||||
LIST_ITEMS: '.list-group-item',
|
||||
DROPDOWN: '.dropdown',
|
||||
DROPDOWN_ITEMS: '.dropdown-item',
|
||||
DROPDOWN_TOGGLE: '.dropdown-toggle'
|
||||
};
|
||||
var OffsetMethod = {
|
||||
OFFSET: 'offset',
|
||||
POSITION: 'position'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var EVENT_ACTIVATE = "activate" + EVENT_KEY;
|
||||
var EVENT_SCROLL = "scroll" + EVENT_KEY;
|
||||
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||
var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
|
||||
var CLASS_NAME_ACTIVE = 'active';
|
||||
var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
|
||||
var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
|
||||
var SELECTOR_NAV_LINKS = '.nav-link';
|
||||
var SELECTOR_NAV_ITEMS = '.nav-item';
|
||||
var SELECTOR_LIST_ITEMS = '.list-group-item';
|
||||
var SELECTOR_DROPDOWN = '.dropdown';
|
||||
var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';
|
||||
var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
||||
var METHOD_OFFSET = 'offset';
|
||||
var METHOD_POSITION = 'position';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
var ScrollSpy =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var ScrollSpy = /*#__PURE__*/function () {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this = this;
|
||||
|
||||
this._element = element;
|
||||
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
this._config = this._getConfig(config);
|
||||
this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
|
||||
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);
|
||||
this._offsets = [];
|
||||
this._targets = [];
|
||||
this._activeTarget = null;
|
||||
this._scrollHeight = 0;
|
||||
$(this._scrollElement).on(Event.SCROLL, function (event) {
|
||||
$(this._scrollElement).on(EVENT_SCROLL, function (event) {
|
||||
return _this._process(event);
|
||||
});
|
||||
this.refresh();
|
||||
@@ -145,9 +87,9 @@
|
||||
_proto.refresh = function refresh() {
|
||||
var _this2 = this;
|
||||
|
||||
var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
|
||||
var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
|
||||
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
|
||||
var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
|
||||
var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
|
||||
this._offsets = [];
|
||||
this._targets = [];
|
||||
this._scrollHeight = this._getScrollHeight();
|
||||
@@ -196,9 +138,9 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});
|
||||
config = _extends({}, Default, typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (typeof config.target !== 'string') {
|
||||
if (typeof config.target !== 'string' && Util.isElement(config.target)) {
|
||||
var id = $(config.target).attr('id');
|
||||
|
||||
if (!id) {
|
||||
@@ -254,9 +196,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var offsetLength = this._offsets.length;
|
||||
|
||||
for (var i = offsetLength; i--;) {
|
||||
for (var i = this._offsets.length; i--;) {
|
||||
var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
|
||||
|
||||
if (isActiveTarget) {
|
||||
@@ -276,29 +216,29 @@
|
||||
|
||||
var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
|
||||
|
||||
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
|
||||
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
||||
$link.addClass(ClassName.ACTIVE);
|
||||
if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
|
||||
$link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE);
|
||||
$link.addClass(CLASS_NAME_ACTIVE);
|
||||
} else {
|
||||
// Set triggered link as active
|
||||
$link.addClass(ClassName.ACTIVE); // Set triggered links parents as active
|
||||
$link.addClass(CLASS_NAME_ACTIVE); // Set triggered links parents as active
|
||||
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
||||
|
||||
$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item
|
||||
$link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE); // Handle special case when .nav-link is inside .nav-item
|
||||
|
||||
$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
|
||||
$link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
||||
$(this._scrollElement).trigger(EVENT_ACTIVATE, {
|
||||
relatedTarget: target
|
||||
});
|
||||
};
|
||||
|
||||
_proto._clear = function _clear() {
|
||||
[].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
|
||||
return node.classList.contains(ClassName.ACTIVE);
|
||||
return node.classList.contains(CLASS_NAME_ACTIVE);
|
||||
}).forEach(function (node) {
|
||||
return node.classList.remove(ClassName.ACTIVE);
|
||||
return node.classList.remove(CLASS_NAME_ACTIVE);
|
||||
});
|
||||
} // Static
|
||||
;
|
||||
@@ -345,8 +285,8 @@
|
||||
*/
|
||||
|
||||
|
||||
$(window).on(Event.LOAD_DATA_API, function () {
|
||||
var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY));
|
||||
$(window).on(EVENT_LOAD_DATA_API, function () {
|
||||
var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));
|
||||
var scrollSpysLength = scrollSpys.length;
|
||||
|
||||
for (var i = scrollSpysLength; i--;) {
|
||||
@@ -371,5 +311,5 @@
|
||||
|
||||
return ScrollSpy;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=scrollspy.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+55
-77
@@ -1,33 +1,20 @@
|
||||
/*!
|
||||
* Bootstrap tab.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap tab.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||
(global = global || self, global.Tab = factory(global.jQuery, global.Util));
|
||||
}(this, function ($, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tab = factory(global.jQuery, global.Util));
|
||||
}(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -35,44 +22,35 @@
|
||||
*/
|
||||
|
||||
var NAME = 'tab';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.tab';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var Event = {
|
||||
HIDE: "hide" + EVENT_KEY,
|
||||
HIDDEN: "hidden" + EVENT_KEY,
|
||||
SHOW: "show" + EVENT_KEY,
|
||||
SHOWN: "shown" + EVENT_KEY,
|
||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
DROPDOWN_MENU: 'dropdown-menu',
|
||||
ACTIVE: 'active',
|
||||
DISABLED: 'disabled',
|
||||
FADE: 'fade',
|
||||
SHOW: 'show'
|
||||
};
|
||||
var Selector = {
|
||||
DROPDOWN: '.dropdown',
|
||||
NAV_LIST_GROUP: '.nav, .list-group',
|
||||
ACTIVE: '.active',
|
||||
ACTIVE_UL: '> li > .active',
|
||||
DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
|
||||
DROPDOWN_TOGGLE: '.dropdown-toggle',
|
||||
DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
|
||||
var CLASS_NAME_ACTIVE = 'active';
|
||||
var CLASS_NAME_DISABLED = 'disabled';
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var SELECTOR_DROPDOWN = '.dropdown';
|
||||
var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
|
||||
var SELECTOR_ACTIVE = '.active';
|
||||
var SELECTOR_ACTIVE_UL = '> li > .active';
|
||||
var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
|
||||
var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
||||
var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
var Tab =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Tab = /*#__PURE__*/function () {
|
||||
function Tab(element) {
|
||||
this._element = element;
|
||||
} // Getters
|
||||
@@ -84,25 +62,25 @@
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
|
||||
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) {
|
||||
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(CLASS_NAME_ACTIVE) || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var target;
|
||||
var previous;
|
||||
var listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0];
|
||||
var listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];
|
||||
var selector = Util.getSelectorFromElement(this._element);
|
||||
|
||||
if (listElement) {
|
||||
var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
|
||||
var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
|
||||
previous = $.makeArray($(listElement).find(itemSelector));
|
||||
previous = previous[previous.length - 1];
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(Event.HIDE, {
|
||||
var hideEvent = $.Event(EVENT_HIDE, {
|
||||
relatedTarget: this._element
|
||||
});
|
||||
var showEvent = $.Event(Event.SHOW, {
|
||||
var showEvent = $.Event(EVENT_SHOW, {
|
||||
relatedTarget: previous
|
||||
});
|
||||
|
||||
@@ -123,10 +101,10 @@
|
||||
this._activate(this._element, listElement);
|
||||
|
||||
var complete = function complete() {
|
||||
var hiddenEvent = $.Event(Event.HIDDEN, {
|
||||
var hiddenEvent = $.Event(EVENT_HIDDEN, {
|
||||
relatedTarget: _this._element
|
||||
});
|
||||
var shownEvent = $.Event(Event.SHOWN, {
|
||||
var shownEvent = $.Event(EVENT_SHOWN, {
|
||||
relatedTarget: previous
|
||||
});
|
||||
$(previous).trigger(hiddenEvent);
|
||||
@@ -149,9 +127,9 @@
|
||||
_proto._activate = function _activate(element, container, callback) {
|
||||
var _this2 = this;
|
||||
|
||||
var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector.ACTIVE_UL) : $(container).children(Selector.ACTIVE);
|
||||
var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(SELECTOR_ACTIVE_UL) : $(container).children(SELECTOR_ACTIVE);
|
||||
var active = activeElements[0];
|
||||
var isTransitioning = callback && active && $(active).hasClass(ClassName.FADE);
|
||||
var isTransitioning = callback && active && $(active).hasClass(CLASS_NAME_FADE);
|
||||
|
||||
var complete = function complete() {
|
||||
return _this2._transitionComplete(element, active, callback);
|
||||
@@ -159,7 +137,7 @@
|
||||
|
||||
if (active && isTransitioning) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(active);
|
||||
$(active).removeClass(ClassName.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
$(active).removeClass(CLASS_NAME_SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
@@ -167,11 +145,11 @@
|
||||
|
||||
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
|
||||
if (active) {
|
||||
$(active).removeClass(ClassName.ACTIVE);
|
||||
var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
|
||||
$(active).removeClass(CLASS_NAME_ACTIVE);
|
||||
var dropdownChild = $(active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
|
||||
|
||||
if (dropdownChild) {
|
||||
$(dropdownChild).removeClass(ClassName.ACTIVE);
|
||||
$(dropdownChild).removeClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
if (active.getAttribute('role') === 'tab') {
|
||||
@@ -179,7 +157,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
$(element).addClass(ClassName.ACTIVE);
|
||||
$(element).addClass(CLASS_NAME_ACTIVE);
|
||||
|
||||
if (element.getAttribute('role') === 'tab') {
|
||||
element.setAttribute('aria-selected', true);
|
||||
@@ -187,16 +165,16 @@
|
||||
|
||||
Util.reflow(element);
|
||||
|
||||
if (element.classList.contains(ClassName.FADE)) {
|
||||
element.classList.add(ClassName.SHOW);
|
||||
if (element.classList.contains(CLASS_NAME_FADE)) {
|
||||
element.classList.add(CLASS_NAME_SHOW);
|
||||
}
|
||||
|
||||
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
||||
var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
|
||||
if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
|
||||
var dropdownElement = $(element).closest(SELECTOR_DROPDOWN)[0];
|
||||
|
||||
if (dropdownElement) {
|
||||
var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE));
|
||||
$(dropdownToggleList).addClass(ClassName.ACTIVE);
|
||||
var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE));
|
||||
$(dropdownToggleList).addClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
element.setAttribute('aria-expanded', true);
|
||||
@@ -244,7 +222,7 @@
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
Tab._jQueryInterface.call($(this), 'show');
|
||||
@@ -265,5 +243,5 @@
|
||||
|
||||
return Tab;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=tab.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+72
-114
@@ -1,67 +1,22 @@
|
||||
/*!
|
||||
* Bootstrap toast.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap toast.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||
(global = global || self, global.Toast = factory(global.jQuery, global.Util));
|
||||
}(this, function ($, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.jQuery, global.Util));
|
||||
}(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -69,23 +24,19 @@
|
||||
*/
|
||||
|
||||
var NAME = 'toast';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.toast';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var Event = {
|
||||
CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
|
||||
HIDE: "hide" + EVENT_KEY,
|
||||
HIDDEN: "hidden" + EVENT_KEY,
|
||||
SHOW: "show" + EVENT_KEY,
|
||||
SHOWN: "shown" + EVENT_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
FADE: 'fade',
|
||||
HIDE: 'hide',
|
||||
SHOW: 'show',
|
||||
SHOWING: 'showing'
|
||||
};
|
||||
var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
|
||||
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_HIDE = 'hide';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var CLASS_NAME_SHOWING = 'showing';
|
||||
var DefaultType = {
|
||||
animation: 'boolean',
|
||||
autohide: 'boolean',
|
||||
@@ -96,19 +47,14 @@
|
||||
autohide: true,
|
||||
delay: 500
|
||||
};
|
||||
var Selector = {
|
||||
DATA_DISMISS: '[data-dismiss="toast"]'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
var Toast =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Toast = /*#__PURE__*/function () {
|
||||
function Toast(element, config) {
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
@@ -124,27 +70,38 @@
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
|
||||
$(this._element).trigger(Event.SHOW);
|
||||
var showEvent = $.Event(EVENT_SHOW);
|
||||
$(this._element).trigger(showEvent);
|
||||
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._clearTimeout();
|
||||
|
||||
if (this._config.animation) {
|
||||
this._element.classList.add(ClassName.FADE);
|
||||
this._element.classList.add(CLASS_NAME_FADE);
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(ClassName.SHOWING);
|
||||
_this._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
|
||||
_this._element.classList.add(ClassName.SHOW);
|
||||
_this._element.classList.add(CLASS_NAME_SHOW);
|
||||
|
||||
$(_this._element).trigger(Event.SHOWN);
|
||||
$(_this._element).trigger(EVENT_SHOWN);
|
||||
|
||||
if (_this._config.autohide) {
|
||||
_this.hide();
|
||||
_this._timeout = setTimeout(function () {
|
||||
_this.hide();
|
||||
}, _this._config.delay);
|
||||
}
|
||||
};
|
||||
|
||||
this._element.classList.remove(ClassName.HIDE);
|
||||
this._element.classList.remove(CLASS_NAME_HIDE);
|
||||
|
||||
this._element.classList.add(ClassName.SHOWING);
|
||||
Util.reflow(this._element);
|
||||
|
||||
this._element.classList.add(CLASS_NAME_SHOWING);
|
||||
|
||||
if (this._config.animation) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
@@ -154,33 +111,29 @@
|
||||
}
|
||||
};
|
||||
|
||||
_proto.hide = function hide(withoutTimeout) {
|
||||
var _this2 = this;
|
||||
|
||||
if (!this._element.classList.contains(ClassName.SHOW)) {
|
||||
_proto.hide = function hide() {
|
||||
if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(this._element).trigger(Event.HIDE);
|
||||
var hideEvent = $.Event(EVENT_HIDE);
|
||||
$(this._element).trigger(hideEvent);
|
||||
|
||||
if (withoutTimeout) {
|
||||
this._close();
|
||||
} else {
|
||||
this._timeout = setTimeout(function () {
|
||||
_this2._close();
|
||||
}, this._config.delay);
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._close();
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
clearTimeout(this._timeout);
|
||||
this._timeout = null;
|
||||
this._clearTimeout();
|
||||
|
||||
if (this._element.classList.contains(ClassName.SHOW)) {
|
||||
this._element.classList.remove(ClassName.SHOW);
|
||||
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||
}
|
||||
|
||||
$(this._element).off(Event.CLICK_DISMISS);
|
||||
$(this._element).off(EVENT_CLICK_DISMISS);
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
this._config = null;
|
||||
@@ -188,29 +141,29 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread({}, Default, $(this._element).data(), typeof config === 'object' && config ? config : {});
|
||||
config = _extends({}, Default, $(this._element).data(), typeof config === 'object' && config ? config : {});
|
||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
return config;
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this3 = this;
|
||||
var _this2 = this;
|
||||
|
||||
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function () {
|
||||
return _this3.hide(true);
|
||||
$(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
|
||||
return _this2.hide();
|
||||
});
|
||||
};
|
||||
|
||||
_proto._close = function _close() {
|
||||
var _this4 = this;
|
||||
var _this3 = this;
|
||||
|
||||
var complete = function complete() {
|
||||
_this4._element.classList.add(ClassName.HIDE);
|
||||
_this3._element.classList.add(CLASS_NAME_HIDE);
|
||||
|
||||
$(_this4._element).trigger(Event.HIDDEN);
|
||||
$(_this3._element).trigger(EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.classList.remove(ClassName.SHOW);
|
||||
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||
|
||||
if (this._config.animation) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
@@ -218,6 +171,11 @@
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
};
|
||||
|
||||
_proto._clearTimeout = function _clearTimeout() {
|
||||
clearTimeout(this._timeout);
|
||||
this._timeout = null;
|
||||
} // Static
|
||||
;
|
||||
|
||||
@@ -279,5 +237,5 @@
|
||||
|
||||
return Toast;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=toast.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+125
-175
@@ -1,72 +1,22 @@
|
||||
/*!
|
||||
* Bootstrap tooltip.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap tooltip.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
|
||||
(global = global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
|
||||
}(this, function ($, Popper, Util) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
|
||||
}(this, (function ($, Popper, Util) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
|
||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): tools/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): tools/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
|
||||
@@ -90,7 +40,7 @@
|
||||
h5: [],
|
||||
h6: [],
|
||||
i: [],
|
||||
img: ['src', 'alt', 'title', 'width', 'height'],
|
||||
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
|
||||
li: [],
|
||||
ol: [],
|
||||
p: [],
|
||||
@@ -103,21 +53,21 @@
|
||||
strong: [],
|
||||
u: [],
|
||||
ul: []
|
||||
/**
|
||||
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
|
||||
};
|
||||
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
|
||||
/**
|
||||
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
|
||||
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
|
||||
/**
|
||||
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
|
||||
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
|
||||
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
|
||||
|
||||
function allowedAttribute(attr, allowedAttributeList) {
|
||||
var attrName = attr.nodeName.toLowerCase();
|
||||
@@ -134,7 +84,7 @@
|
||||
return attrRegex instanceof RegExp;
|
||||
}); // Check if a regular expression validates the attribute.
|
||||
|
||||
for (var i = 0, l = regExp.length; i < l; i++) {
|
||||
for (var i = 0, len = regExp.length; i < len; i++) {
|
||||
if (attrName.match(regExp[i])) {
|
||||
return true;
|
||||
}
|
||||
@@ -176,7 +126,7 @@
|
||||
};
|
||||
|
||||
for (var i = 0, len = elements.length; i < len; i++) {
|
||||
var _ret = _loop(i, len);
|
||||
var _ret = _loop(i);
|
||||
|
||||
if (_ret === "continue") continue;
|
||||
}
|
||||
@@ -184,6 +134,11 @@
|
||||
return createdDocument.body.innerHTML;
|
||||
}
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
@@ -191,7 +146,7 @@
|
||||
*/
|
||||
|
||||
var NAME = 'tooltip';
|
||||
var VERSION = '4.3.1';
|
||||
var VERSION = '4.5.2';
|
||||
var DATA_KEY = 'bs.tooltip';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
@@ -213,7 +168,8 @@
|
||||
boundary: '(string|element)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
whiteList: 'object'
|
||||
whiteList: 'object',
|
||||
popperConfig: '(null|object)'
|
||||
};
|
||||
var AttachmentMap = {
|
||||
AUTO: 'auto',
|
||||
@@ -237,12 +193,11 @@
|
||||
boundary: 'scrollParent',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
whiteList: DefaultWhitelist
|
||||
};
|
||||
var HoverState = {
|
||||
SHOW: 'show',
|
||||
OUT: 'out'
|
||||
whiteList: DefaultWhitelist,
|
||||
popperConfig: null
|
||||
};
|
||||
var HOVER_STATE_SHOW = 'show';
|
||||
var HOVER_STATE_OUT = 'out';
|
||||
var Event = {
|
||||
HIDE: "hide" + EVENT_KEY,
|
||||
HIDDEN: "hidden" + EVENT_KEY,
|
||||
@@ -255,36 +210,22 @@
|
||||
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
||||
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
||||
};
|
||||
var ClassName = {
|
||||
FADE: 'fade',
|
||||
SHOW: 'show'
|
||||
};
|
||||
var Selector = {
|
||||
TOOLTIP: '.tooltip',
|
||||
TOOLTIP_INNER: '.tooltip-inner',
|
||||
ARROW: '.arrow'
|
||||
};
|
||||
var Trigger = {
|
||||
HOVER: 'hover',
|
||||
FOCUS: 'focus',
|
||||
CLICK: 'click',
|
||||
MANUAL: 'manual'
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
||||
var SELECTOR_ARROW = '.arrow';
|
||||
var TRIGGER_HOVER = 'hover';
|
||||
var TRIGGER_FOCUS = 'focus';
|
||||
var TRIGGER_CLICK = 'click';
|
||||
var TRIGGER_MANUAL = 'manual';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
var Tooltip =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var Tooltip = /*#__PURE__*/function () {
|
||||
function Tooltip(element, config) {
|
||||
/**
|
||||
* Check for Popper dependency
|
||||
* Popper - https://popper.js.org
|
||||
*/
|
||||
if (typeof Popper === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
|
||||
} // private
|
||||
@@ -341,7 +282,7 @@
|
||||
context._leave(null, context);
|
||||
}
|
||||
} else {
|
||||
if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
|
||||
if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
|
||||
this._leave(null, this);
|
||||
|
||||
return;
|
||||
@@ -355,7 +296,7 @@
|
||||
clearTimeout(this._timeout);
|
||||
$.removeData(this.element, this.constructor.DATA_KEY);
|
||||
$(this.element).off(this.constructor.EVENT_KEY);
|
||||
$(this.element).closest('.modal').off('hide.bs.modal');
|
||||
$(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.tip) {
|
||||
$(this.tip).remove();
|
||||
@@ -366,7 +307,7 @@
|
||||
this._hoverState = null;
|
||||
this._activeTrigger = null;
|
||||
|
||||
if (this._popper !== null) {
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
}
|
||||
|
||||
@@ -401,7 +342,7 @@
|
||||
this.setContent();
|
||||
|
||||
if (this.config.animation) {
|
||||
$(tip).addClass(ClassName.FADE);
|
||||
$(tip).addClass(CLASS_NAME_FADE);
|
||||
}
|
||||
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||
@@ -419,30 +360,8 @@
|
||||
}
|
||||
|
||||
$(this.element).trigger(this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper(this.element, tip, {
|
||||
placement: attachment,
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
behavior: this.config.fallbackPlacement
|
||||
},
|
||||
arrow: {
|
||||
element: Selector.ARROW
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this.config.boundary
|
||||
}
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
_this._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this._handlePopperPlacementChange(data);
|
||||
}
|
||||
});
|
||||
$(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
|
||||
this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
|
||||
$(tip).addClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||
@@ -460,12 +379,12 @@
|
||||
_this._hoverState = null;
|
||||
$(_this.element).trigger(_this.constructor.Event.SHOWN);
|
||||
|
||||
if (prevHoverState === HoverState.OUT) {
|
||||
if (prevHoverState === HOVER_STATE_OUT) {
|
||||
_this._leave(null, _this);
|
||||
}
|
||||
};
|
||||
|
||||
if ($(this.tip).hasClass(ClassName.FADE)) {
|
||||
if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
|
||||
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
@@ -481,7 +400,7 @@
|
||||
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
|
||||
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
tip.parentNode.removeChild(tip);
|
||||
}
|
||||
|
||||
@@ -506,18 +425,18 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
|
||||
$(tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
|
||||
// empty mouseover listeners we added for iOS support
|
||||
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
$(document.body).children().off('mouseover', null, $.noop);
|
||||
}
|
||||
|
||||
this._activeTrigger[Trigger.CLICK] = false;
|
||||
this._activeTrigger[Trigger.FOCUS] = false;
|
||||
this._activeTrigger[Trigger.HOVER] = false;
|
||||
this._activeTrigger[TRIGGER_CLICK] = false;
|
||||
this._activeTrigger[TRIGGER_FOCUS] = false;
|
||||
this._activeTrigger[TRIGGER_HOVER] = false;
|
||||
|
||||
if ($(this.tip).hasClass(ClassName.FADE)) {
|
||||
if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(tip);
|
||||
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
@@ -549,8 +468,8 @@
|
||||
|
||||
_proto.setContent = function setContent() {
|
||||
var tip = this.getTipElement();
|
||||
this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
|
||||
$(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
|
||||
this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
|
||||
$(tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
|
||||
};
|
||||
|
||||
_proto.setElementContent = function setElementContent($element, content) {
|
||||
@@ -589,14 +508,43 @@
|
||||
} // Private
|
||||
;
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this3 = this;
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
behavior: this.config.fallbackPlacement
|
||||
},
|
||||
arrow: {
|
||||
element: SELECTOR_ARROW
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this.config.boundary
|
||||
}
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
_this3._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this3._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this4 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@@ -623,32 +571,35 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
$(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
|
||||
return _this4.toggle(event);
|
||||
$(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
});
|
||||
} else if (trigger !== Trigger.MANUAL) {
|
||||
var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
|
||||
$(_this4.element).on(eventIn, _this4.config.selector, function (event) {
|
||||
return _this4._enter(event);
|
||||
}).on(eventOut, _this4.config.selector, function (event) {
|
||||
return _this4._leave(event);
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
$(_this5.element).on(eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
}).on(eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
$(this.element).closest('.modal').on('hide.bs.modal', function () {
|
||||
if (_this4.element) {
|
||||
_this4.hide();
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this5.element) {
|
||||
_this5.hide();
|
||||
}
|
||||
};
|
||||
|
||||
$(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.config.selector) {
|
||||
this.config = _objectSpread({}, this.config, {
|
||||
this.config = _extends({}, this.config, {
|
||||
trigger: 'manual',
|
||||
selector: ''
|
||||
});
|
||||
@@ -676,16 +627,16 @@
|
||||
}
|
||||
|
||||
if (event) {
|
||||
context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
|
||||
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
||||
}
|
||||
|
||||
if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
|
||||
context._hoverState = HoverState.SHOW;
|
||||
if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
|
||||
context._hoverState = HOVER_STATE_SHOW;
|
||||
return;
|
||||
}
|
||||
|
||||
clearTimeout(context._timeout);
|
||||
context._hoverState = HoverState.SHOW;
|
||||
context._hoverState = HOVER_STATE_SHOW;
|
||||
|
||||
if (!context.config.delay || !context.config.delay.show) {
|
||||
context.show();
|
||||
@@ -693,7 +644,7 @@
|
||||
}
|
||||
|
||||
context._timeout = setTimeout(function () {
|
||||
if (context._hoverState === HoverState.SHOW) {
|
||||
if (context._hoverState === HOVER_STATE_SHOW) {
|
||||
context.show();
|
||||
}
|
||||
}, context.config.delay.show);
|
||||
@@ -709,7 +660,7 @@
|
||||
}
|
||||
|
||||
if (event) {
|
||||
context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
|
||||
context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
|
||||
}
|
||||
|
||||
if (context._isWithActiveTrigger()) {
|
||||
@@ -717,7 +668,7 @@
|
||||
}
|
||||
|
||||
clearTimeout(context._timeout);
|
||||
context._hoverState = HoverState.OUT;
|
||||
context._hoverState = HOVER_STATE_OUT;
|
||||
|
||||
if (!context.config.delay || !context.config.delay.hide) {
|
||||
context.hide();
|
||||
@@ -725,7 +676,7 @@
|
||||
}
|
||||
|
||||
context._timeout = setTimeout(function () {
|
||||
if (context._hoverState === HoverState.OUT) {
|
||||
if (context._hoverState === HOVER_STATE_OUT) {
|
||||
context.hide();
|
||||
}
|
||||
}, context.config.delay.hide);
|
||||
@@ -748,7 +699,7 @@
|
||||
delete dataAttributes[dataAttr];
|
||||
}
|
||||
});
|
||||
config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
|
||||
config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (typeof config.delay === 'number') {
|
||||
config.delay = {
|
||||
@@ -798,8 +749,7 @@
|
||||
};
|
||||
|
||||
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||
var popperInstance = popperData.instance;
|
||||
this.tip = popperInstance.popper;
|
||||
this.tip = popperData.instance.popper;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
@@ -814,7 +764,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$(tip).removeClass(ClassName.FADE);
|
||||
$(tip).removeClass(CLASS_NAME_FADE);
|
||||
this.config.animation = false;
|
||||
this.hide();
|
||||
this.show();
|
||||
@@ -903,5 +853,5 @@
|
||||
|
||||
return Tooltip;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=tooltip.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+31
-10
@@ -1,20 +1,20 @@
|
||||
/*!
|
||||
* Bootstrap util.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap util.js v4.5.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
||||
(global = global || self, global.Util = factory(global.jQuery));
|
||||
}(this, function ($) { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Util = factory(global.jQuery));
|
||||
}(this, (function ($) { 'use strict';
|
||||
|
||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): util.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): util.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
@@ -28,6 +28,10 @@
|
||||
var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
|
||||
function toType(obj) {
|
||||
if (obj === null || typeof obj === 'undefined') {
|
||||
return "" + obj;
|
||||
}
|
||||
|
||||
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
|
||||
}
|
||||
|
||||
@@ -40,7 +44,7 @@
|
||||
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
||||
}
|
||||
|
||||
return undefined; // eslint-disable-line no-undefined
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -162,11 +166,28 @@
|
||||
}
|
||||
|
||||
return Util.findShadowRoot(element.parentNode);
|
||||
},
|
||||
jQueryDetection: function jQueryDetection() {
|
||||
if (typeof $ === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
|
||||
}
|
||||
|
||||
var version = $.fn.jquery.split(' ')[0].split('.');
|
||||
var minMajor = 1;
|
||||
var ltMajor = 2;
|
||||
var minMinor = 9;
|
||||
var minPatch = 1;
|
||||
var maxMajor = 4;
|
||||
|
||||
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
|
||||
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
|
||||
}
|
||||
}
|
||||
};
|
||||
Util.jQueryDetection();
|
||||
setTransitionEndSupport();
|
||||
|
||||
return Util;
|
||||
|
||||
}));
|
||||
})));
|
||||
//# sourceMappingURL=util.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+17
-23
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,27 +15,21 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'alert'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.alert'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
|
||||
const Selector = {
|
||||
DISMISS : '[data-dismiss="alert"]'
|
||||
}
|
||||
const SELECTOR_DISMISS = '[data-dismiss="alert"]'
|
||||
|
||||
const Event = {
|
||||
CLOSE : `close${EVENT_KEY}`,
|
||||
CLOSED : `closed${EVENT_KEY}`,
|
||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
}
|
||||
const EVENT_CLOSE = `close${EVENT_KEY}`
|
||||
const EVENT_CLOSED = `closed${EVENT_KEY}`
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const ClassName = {
|
||||
ALERT : 'alert',
|
||||
FADE : 'fade',
|
||||
SHOW : 'show'
|
||||
}
|
||||
const CLASS_NAME_ALERT = 'alert'
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -87,23 +81,23 @@ class Alert {
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
parent = $(element).closest(`.${ClassName.ALERT}`)[0]
|
||||
parent = $(element).closest(`.${CLASS_NAME_ALERT}`)[0]
|
||||
}
|
||||
|
||||
return parent
|
||||
}
|
||||
|
||||
_triggerCloseEvent(element) {
|
||||
const closeEvent = $.Event(Event.CLOSE)
|
||||
const closeEvent = $.Event(EVENT_CLOSE)
|
||||
|
||||
$(element).trigger(closeEvent)
|
||||
return closeEvent
|
||||
}
|
||||
|
||||
_removeElement(element) {
|
||||
$(element).removeClass(ClassName.SHOW)
|
||||
$(element).removeClass(CLASS_NAME_SHOW)
|
||||
|
||||
if (!$(element).hasClass(ClassName.FADE)) {
|
||||
if (!$(element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._destroyElement(element)
|
||||
return
|
||||
}
|
||||
@@ -118,7 +112,7 @@ class Alert {
|
||||
_destroyElement(element) {
|
||||
$(element)
|
||||
.detach()
|
||||
.trigger(Event.CLOSED)
|
||||
.trigger(EVENT_CLOSED)
|
||||
.remove()
|
||||
}
|
||||
|
||||
@@ -158,8 +152,8 @@ class Alert {
|
||||
*/
|
||||
|
||||
$(document).on(
|
||||
Event.CLICK_DATA_API,
|
||||
Selector.DISMISS,
|
||||
EVENT_CLICK_DATA_API,
|
||||
SELECTOR_DISMISS,
|
||||
Alert._handleDismiss(new Alert())
|
||||
)
|
||||
|
||||
|
||||
+80
-45
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -14,31 +14,28 @@ import $ from 'jquery'
|
||||
*/
|
||||
|
||||
const NAME = 'button'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.button'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
|
||||
const ClassName = {
|
||||
ACTIVE : 'active',
|
||||
BUTTON : 'btn',
|
||||
FOCUS : 'focus'
|
||||
}
|
||||
const CLASS_NAME_ACTIVE = 'active'
|
||||
const CLASS_NAME_BUTTON = 'btn'
|
||||
const CLASS_NAME_FOCUS = 'focus'
|
||||
|
||||
const Selector = {
|
||||
DATA_TOGGLE_CARROT : '[data-toggle^="button"]',
|
||||
DATA_TOGGLE : '[data-toggle="buttons"]',
|
||||
INPUT : 'input:not([type="hidden"])',
|
||||
ACTIVE : '.active',
|
||||
BUTTON : '.btn'
|
||||
}
|
||||
const SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'
|
||||
const SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'
|
||||
const SELECTOR_DATA_TOGGLE = '[data-toggle="button"]'
|
||||
const SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'
|
||||
const SELECTOR_INPUT = 'input:not([type="hidden"])'
|
||||
const SELECTOR_ACTIVE = '.active'
|
||||
const SELECTOR_BUTTON = '.btn'
|
||||
|
||||
const Event = {
|
||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,
|
||||
FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} ` +
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
const EVENT_FOCUS_BLUR_DATA_API = `focus${EVENT_KEY}${DATA_API_KEY} ` +
|
||||
`blur${EVENT_KEY}${DATA_API_KEY}`
|
||||
}
|
||||
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -63,34 +60,31 @@ class Button {
|
||||
let triggerChangeEvent = true
|
||||
let addAriaPressed = true
|
||||
const rootElement = $(this._element).closest(
|
||||
Selector.DATA_TOGGLE
|
||||
SELECTOR_DATA_TOGGLES
|
||||
)[0]
|
||||
|
||||
if (rootElement) {
|
||||
const input = this._element.querySelector(Selector.INPUT)
|
||||
const input = this._element.querySelector(SELECTOR_INPUT)
|
||||
|
||||
if (input) {
|
||||
if (input.type === 'radio') {
|
||||
if (input.checked &&
|
||||
this._element.classList.contains(ClassName.ACTIVE)) {
|
||||
this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
||||
triggerChangeEvent = false
|
||||
} else {
|
||||
const activeElement = rootElement.querySelector(Selector.ACTIVE)
|
||||
const activeElement = rootElement.querySelector(SELECTOR_ACTIVE)
|
||||
|
||||
if (activeElement) {
|
||||
$(activeElement).removeClass(ClassName.ACTIVE)
|
||||
$(activeElement).removeClass(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (triggerChangeEvent) {
|
||||
if (input.hasAttribute('disabled') ||
|
||||
rootElement.hasAttribute('disabled') ||
|
||||
input.classList.contains('disabled') ||
|
||||
rootElement.classList.contains('disabled')) {
|
||||
return
|
||||
// if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
|
||||
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
input.checked = !this._element.classList.contains(ClassName.ACTIVE)
|
||||
$(input).trigger('change')
|
||||
}
|
||||
|
||||
@@ -99,13 +93,15 @@ class Button {
|
||||
}
|
||||
}
|
||||
|
||||
if (addAriaPressed) {
|
||||
this._element.setAttribute('aria-pressed',
|
||||
!this._element.classList.contains(ClassName.ACTIVE))
|
||||
}
|
||||
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
|
||||
if (addAriaPressed) {
|
||||
this._element.setAttribute('aria-pressed',
|
||||
!this._element.classList.contains(CLASS_NAME_ACTIVE))
|
||||
}
|
||||
|
||||
if (triggerChangeEvent) {
|
||||
$(this._element).toggleClass(ClassName.ACTIVE)
|
||||
if (triggerChangeEvent) {
|
||||
$(this._element).toggleClass(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,22 +135,61 @@ class Button {
|
||||
*/
|
||||
|
||||
$(document)
|
||||
.on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {
|
||||
event.preventDefault()
|
||||
|
||||
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, (event) => {
|
||||
let button = event.target
|
||||
const initialButton = button
|
||||
|
||||
if (!$(button).hasClass(ClassName.BUTTON)) {
|
||||
button = $(button).closest(Selector.BUTTON)
|
||||
if (!$(button).hasClass(CLASS_NAME_BUTTON)) {
|
||||
button = $(button).closest(SELECTOR_BUTTON)[0]
|
||||
}
|
||||
|
||||
Button._jQueryInterface.call($(button), 'toggle')
|
||||
if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
|
||||
event.preventDefault() // work around Firefox bug #1540995
|
||||
} else {
|
||||
const inputBtn = button.querySelector(SELECTOR_INPUT)
|
||||
|
||||
if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
|
||||
event.preventDefault() // work around Firefox bug #1540995
|
||||
return
|
||||
}
|
||||
|
||||
if (initialButton.tagName !== 'LABEL' || inputBtn && inputBtn.type !== 'checkbox') {
|
||||
Button._jQueryInterface.call($(button), 'toggle')
|
||||
}
|
||||
}
|
||||
})
|
||||
.on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {
|
||||
const button = $(event.target).closest(Selector.BUTTON)[0]
|
||||
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))
|
||||
.on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, (event) => {
|
||||
const button = $(event.target).closest(SELECTOR_BUTTON)[0]
|
||||
$(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type))
|
||||
})
|
||||
|
||||
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||
// ensure correct active class is set to match the controls' actual values/states
|
||||
|
||||
// find all checkboxes/readio buttons inside data-toggle groups
|
||||
let buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS))
|
||||
for (let i = 0, len = buttons.length; i < len; i++) {
|
||||
const button = buttons[i]
|
||||
const input = button.querySelector(SELECTOR_INPUT)
|
||||
if (input.checked || input.hasAttribute('checked')) {
|
||||
button.classList.add(CLASS_NAME_ACTIVE)
|
||||
} else {
|
||||
button.classList.remove(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
}
|
||||
|
||||
// find all button toggles
|
||||
buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||
for (let i = 0, len = buttons.length; i < len; i++) {
|
||||
const button = buttons[i]
|
||||
if (button.getAttribute('aria-pressed') === 'true') {
|
||||
button.classList.add(CLASS_NAME_ACTIVE)
|
||||
} else {
|
||||
button.classList.remove(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
|
||||
+87
-95
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'carousel'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.carousel'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@@ -43,51 +43,42 @@ const DefaultType = {
|
||||
touch : 'boolean'
|
||||
}
|
||||
|
||||
const Direction = {
|
||||
NEXT : 'next',
|
||||
PREV : 'prev',
|
||||
LEFT : 'left',
|
||||
RIGHT : 'right'
|
||||
}
|
||||
const DIRECTION_NEXT = 'next'
|
||||
const DIRECTION_PREV = 'prev'
|
||||
const DIRECTION_LEFT = 'left'
|
||||
const DIRECTION_RIGHT = 'right'
|
||||
|
||||
const Event = {
|
||||
SLIDE : `slide${EVENT_KEY}`,
|
||||
SLID : `slid${EVENT_KEY}`,
|
||||
KEYDOWN : `keydown${EVENT_KEY}`,
|
||||
MOUSEENTER : `mouseenter${EVENT_KEY}`,
|
||||
MOUSELEAVE : `mouseleave${EVENT_KEY}`,
|
||||
TOUCHSTART : `touchstart${EVENT_KEY}`,
|
||||
TOUCHMOVE : `touchmove${EVENT_KEY}`,
|
||||
TOUCHEND : `touchend${EVENT_KEY}`,
|
||||
POINTERDOWN : `pointerdown${EVENT_KEY}`,
|
||||
POINTERUP : `pointerup${EVENT_KEY}`,
|
||||
DRAG_START : `dragstart${EVENT_KEY}`,
|
||||
LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,
|
||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
}
|
||||
const EVENT_SLIDE = `slide${EVENT_KEY}`
|
||||
const EVENT_SLID = `slid${EVENT_KEY}`
|
||||
const EVENT_KEYDOWN = `keydown${EVENT_KEY}`
|
||||
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`
|
||||
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`
|
||||
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`
|
||||
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`
|
||||
const EVENT_TOUCHEND = `touchend${EVENT_KEY}`
|
||||
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`
|
||||
const EVENT_POINTERUP = `pointerup${EVENT_KEY}`
|
||||
const EVENT_DRAG_START = `dragstart${EVENT_KEY}`
|
||||
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const ClassName = {
|
||||
CAROUSEL : 'carousel',
|
||||
ACTIVE : 'active',
|
||||
SLIDE : 'slide',
|
||||
RIGHT : 'carousel-item-right',
|
||||
LEFT : 'carousel-item-left',
|
||||
NEXT : 'carousel-item-next',
|
||||
PREV : 'carousel-item-prev',
|
||||
ITEM : 'carousel-item',
|
||||
POINTER_EVENT : 'pointer-event'
|
||||
}
|
||||
const CLASS_NAME_CAROUSEL = 'carousel'
|
||||
const CLASS_NAME_ACTIVE = 'active'
|
||||
const CLASS_NAME_SLIDE = 'slide'
|
||||
const CLASS_NAME_RIGHT = 'carousel-item-right'
|
||||
const CLASS_NAME_LEFT = 'carousel-item-left'
|
||||
const CLASS_NAME_NEXT = 'carousel-item-next'
|
||||
const CLASS_NAME_PREV = 'carousel-item-prev'
|
||||
const CLASS_NAME_POINTER_EVENT = 'pointer-event'
|
||||
|
||||
const Selector = {
|
||||
ACTIVE : '.active',
|
||||
ACTIVE_ITEM : '.active.carousel-item',
|
||||
ITEM : '.carousel-item',
|
||||
ITEM_IMG : '.carousel-item img',
|
||||
NEXT_PREV : '.carousel-item-next, .carousel-item-prev',
|
||||
INDICATORS : '.carousel-indicators',
|
||||
DATA_SLIDE : '[data-slide], [data-slide-to]',
|
||||
DATA_RIDE : '[data-ride="carousel"]'
|
||||
}
|
||||
const SELECTOR_ACTIVE = '.active'
|
||||
const SELECTOR_ACTIVE_ITEM = '.active.carousel-item'
|
||||
const SELECTOR_ITEM = '.carousel-item'
|
||||
const SELECTOR_ITEM_IMG = '.carousel-item img'
|
||||
const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'
|
||||
const SELECTOR_INDICATORS = '.carousel-indicators'
|
||||
const SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'
|
||||
const SELECTOR_DATA_RIDE = '[data-ride="carousel"]'
|
||||
|
||||
const PointerType = {
|
||||
TOUCH : 'touch',
|
||||
@@ -112,7 +103,7 @@ class Carousel {
|
||||
|
||||
this._config = this._getConfig(config)
|
||||
this._element = element
|
||||
this._indicatorsElement = this._element.querySelector(Selector.INDICATORS)
|
||||
this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS)
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
|
||||
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent)
|
||||
|
||||
@@ -133,7 +124,7 @@ class Carousel {
|
||||
|
||||
next() {
|
||||
if (!this._isSliding) {
|
||||
this._slide(Direction.NEXT)
|
||||
this._slide(DIRECTION_NEXT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +139,7 @@ class Carousel {
|
||||
|
||||
prev() {
|
||||
if (!this._isSliding) {
|
||||
this._slide(Direction.PREV)
|
||||
this._slide(DIRECTION_PREV)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +148,7 @@ class Carousel {
|
||||
this._isPaused = true
|
||||
}
|
||||
|
||||
if (this._element.querySelector(Selector.NEXT_PREV)) {
|
||||
if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
|
||||
Util.triggerTransitionEnd(this._element)
|
||||
this.cycle(true)
|
||||
}
|
||||
@@ -185,7 +176,7 @@ class Carousel {
|
||||
}
|
||||
|
||||
to(index) {
|
||||
this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)
|
||||
this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||
|
||||
const activeIndex = this._getItemIndex(this._activeElement)
|
||||
|
||||
@@ -194,7 +185,7 @@ class Carousel {
|
||||
}
|
||||
|
||||
if (this._isSliding) {
|
||||
$(this._element).one(Event.SLID, () => this.to(index))
|
||||
$(this._element).one(EVENT_SLID, () => this.to(index))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -205,8 +196,8 @@ class Carousel {
|
||||
}
|
||||
|
||||
const direction = index > activeIndex
|
||||
? Direction.NEXT
|
||||
: Direction.PREV
|
||||
? DIRECTION_NEXT
|
||||
: DIRECTION_PREV
|
||||
|
||||
this._slide(direction, this._items[index])
|
||||
}
|
||||
@@ -245,6 +236,8 @@ class Carousel {
|
||||
|
||||
const direction = absDeltax / this.touchDeltaX
|
||||
|
||||
this.touchDeltaX = 0
|
||||
|
||||
// swipe left
|
||||
if (direction > 0) {
|
||||
this.prev()
|
||||
@@ -258,14 +251,13 @@ class Carousel {
|
||||
|
||||
_addEventListeners() {
|
||||
if (this._config.keyboard) {
|
||||
$(this._element)
|
||||
.on(Event.KEYDOWN, (event) => this._keydown(event))
|
||||
$(this._element).on(EVENT_KEYDOWN, (event) => this._keydown(event))
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
$(this._element)
|
||||
.on(Event.MOUSEENTER, (event) => this.pause(event))
|
||||
.on(Event.MOUSELEAVE, (event) => this.cycle(event))
|
||||
.on(EVENT_MOUSEENTER, (event) => this.pause(event))
|
||||
.on(EVENT_MOUSELEAVE, (event) => this.cycle(event))
|
||||
}
|
||||
|
||||
if (this._config.touch) {
|
||||
@@ -318,16 +310,18 @@ class Carousel {
|
||||
}
|
||||
}
|
||||
|
||||
$(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, (e) => e.preventDefault())
|
||||
if (this._pointerEvent) {
|
||||
$(this._element).on(Event.POINTERDOWN, (event) => start(event))
|
||||
$(this._element).on(Event.POINTERUP, (event) => end(event))
|
||||
$(this._element.querySelectorAll(SELECTOR_ITEM_IMG))
|
||||
.on(EVENT_DRAG_START, (e) => e.preventDefault())
|
||||
|
||||
this._element.classList.add(ClassName.POINTER_EVENT)
|
||||
if (this._pointerEvent) {
|
||||
$(this._element).on(EVENT_POINTERDOWN, (event) => start(event))
|
||||
$(this._element).on(EVENT_POINTERUP, (event) => end(event))
|
||||
|
||||
this._element.classList.add(CLASS_NAME_POINTER_EVENT)
|
||||
} else {
|
||||
$(this._element).on(Event.TOUCHSTART, (event) => start(event))
|
||||
$(this._element).on(Event.TOUCHMOVE, (event) => move(event))
|
||||
$(this._element).on(Event.TOUCHEND, (event) => end(event))
|
||||
$(this._element).on(EVENT_TOUCHSTART, (event) => start(event))
|
||||
$(this._element).on(EVENT_TOUCHMOVE, (event) => move(event))
|
||||
$(this._element).on(EVENT_TOUCHEND, (event) => end(event))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,14 +345,14 @@ class Carousel {
|
||||
|
||||
_getItemIndex(element) {
|
||||
this._items = element && element.parentNode
|
||||
? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM))
|
||||
? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM))
|
||||
: []
|
||||
return this._items.indexOf(element)
|
||||
}
|
||||
|
||||
_getItemByDirection(direction, activeElement) {
|
||||
const isNextDirection = direction === Direction.NEXT
|
||||
const isPrevDirection = direction === Direction.PREV
|
||||
const isNextDirection = direction === DIRECTION_NEXT
|
||||
const isPrevDirection = direction === DIRECTION_PREV
|
||||
const activeIndex = this._getItemIndex(activeElement)
|
||||
const lastItemIndex = this._items.length - 1
|
||||
const isGoingToWrap = isPrevDirection && activeIndex === 0 ||
|
||||
@@ -368,7 +362,7 @@ class Carousel {
|
||||
return activeElement
|
||||
}
|
||||
|
||||
const delta = direction === Direction.PREV ? -1 : 1
|
||||
const delta = direction === DIRECTION_PREV ? -1 : 1
|
||||
const itemIndex = (activeIndex + delta) % this._items.length
|
||||
|
||||
return itemIndex === -1
|
||||
@@ -377,8 +371,8 @@ class Carousel {
|
||||
|
||||
_triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||
const targetIndex = this._getItemIndex(relatedTarget)
|
||||
const fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM))
|
||||
const slideEvent = $.Event(Event.SLIDE, {
|
||||
const fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM))
|
||||
const slideEvent = $.Event(EVENT_SLIDE, {
|
||||
relatedTarget,
|
||||
direction: eventDirectionName,
|
||||
from: fromIndex,
|
||||
@@ -392,22 +386,21 @@ class Carousel {
|
||||
|
||||
_setActiveIndicatorElement(element) {
|
||||
if (this._indicatorsElement) {
|
||||
const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE))
|
||||
$(indicators)
|
||||
.removeClass(ClassName.ACTIVE)
|
||||
const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE))
|
||||
$(indicators).removeClass(CLASS_NAME_ACTIVE)
|
||||
|
||||
const nextIndicator = this._indicatorsElement.children[
|
||||
this._getItemIndex(element)
|
||||
]
|
||||
|
||||
if (nextIndicator) {
|
||||
$(nextIndicator).addClass(ClassName.ACTIVE)
|
||||
$(nextIndicator).addClass(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_slide(direction, element) {
|
||||
const activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)
|
||||
const activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||
const activeElementIndex = this._getItemIndex(activeElement)
|
||||
const nextElement = element || activeElement &&
|
||||
this._getItemByDirection(direction, activeElement)
|
||||
@@ -418,17 +411,17 @@ class Carousel {
|
||||
let orderClassName
|
||||
let eventDirectionName
|
||||
|
||||
if (direction === Direction.NEXT) {
|
||||
directionalClassName = ClassName.LEFT
|
||||
orderClassName = ClassName.NEXT
|
||||
eventDirectionName = Direction.LEFT
|
||||
if (direction === DIRECTION_NEXT) {
|
||||
directionalClassName = CLASS_NAME_LEFT
|
||||
orderClassName = CLASS_NAME_NEXT
|
||||
eventDirectionName = DIRECTION_LEFT
|
||||
} else {
|
||||
directionalClassName = ClassName.RIGHT
|
||||
orderClassName = ClassName.PREV
|
||||
eventDirectionName = Direction.RIGHT
|
||||
directionalClassName = CLASS_NAME_RIGHT
|
||||
orderClassName = CLASS_NAME_PREV
|
||||
eventDirectionName = DIRECTION_RIGHT
|
||||
}
|
||||
|
||||
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
|
||||
if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE)) {
|
||||
this._isSliding = false
|
||||
return
|
||||
}
|
||||
@@ -451,14 +444,14 @@ class Carousel {
|
||||
|
||||
this._setActiveIndicatorElement(nextElement)
|
||||
|
||||
const slidEvent = $.Event(Event.SLID, {
|
||||
const slidEvent = $.Event(EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
to: nextElementIndex
|
||||
})
|
||||
|
||||
if ($(this._element).hasClass(ClassName.SLIDE)) {
|
||||
if ($(this._element).hasClass(CLASS_NAME_SLIDE)) {
|
||||
$(nextElement).addClass(orderClassName)
|
||||
|
||||
Util.reflow(nextElement)
|
||||
@@ -480,9 +473,9 @@ class Carousel {
|
||||
.one(Util.TRANSITION_END, () => {
|
||||
$(nextElement)
|
||||
.removeClass(`${directionalClassName} ${orderClassName}`)
|
||||
.addClass(ClassName.ACTIVE)
|
||||
.addClass(CLASS_NAME_ACTIVE)
|
||||
|
||||
$(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)
|
||||
$(activeElement).removeClass(`${CLASS_NAME_ACTIVE} ${orderClassName} ${directionalClassName}`)
|
||||
|
||||
this._isSliding = false
|
||||
|
||||
@@ -490,8 +483,8 @@ class Carousel {
|
||||
})
|
||||
.emulateTransitionEnd(transitionDuration)
|
||||
} else {
|
||||
$(activeElement).removeClass(ClassName.ACTIVE)
|
||||
$(nextElement).addClass(ClassName.ACTIVE)
|
||||
$(activeElement).removeClass(CLASS_NAME_ACTIVE)
|
||||
$(nextElement).addClass(CLASS_NAME_ACTIVE)
|
||||
|
||||
this._isSliding = false
|
||||
$(this._element).trigger(slidEvent)
|
||||
@@ -549,7 +542,7 @@ class Carousel {
|
||||
|
||||
const target = $(selector)[0]
|
||||
|
||||
if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
|
||||
if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -579,11 +572,10 @@ class Carousel {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$(document)
|
||||
.on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler)
|
||||
|
||||
$(window).on(Event.LOAD_DATA_API, () => {
|
||||
const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE))
|
||||
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||
const carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE))
|
||||
for (let i = 0, len = carousels.length; i < len; i++) {
|
||||
const $carousel = $(carousels[i])
|
||||
Carousel._jQueryInterface.call($carousel, $carousel.data())
|
||||
|
||||
+45
-56
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'collapse'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.collapse'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@@ -31,30 +31,22 @@ const DefaultType = {
|
||||
parent : '(string|element)'
|
||||
}
|
||||
|
||||
const Event = {
|
||||
SHOW : `show${EVENT_KEY}`,
|
||||
SHOWN : `shown${EVENT_KEY}`,
|
||||
HIDE : `hide${EVENT_KEY}`,
|
||||
HIDDEN : `hidden${EVENT_KEY}`,
|
||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
}
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const ClassName = {
|
||||
SHOW : 'show',
|
||||
COLLAPSE : 'collapse',
|
||||
COLLAPSING : 'collapsing',
|
||||
COLLAPSED : 'collapsed'
|
||||
}
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_COLLAPSE = 'collapse'
|
||||
const CLASS_NAME_COLLAPSING = 'collapsing'
|
||||
const CLASS_NAME_COLLAPSED = 'collapsed'
|
||||
|
||||
const Dimension = {
|
||||
WIDTH : 'width',
|
||||
HEIGHT : 'height'
|
||||
}
|
||||
const DIMENSION_WIDTH = 'width'
|
||||
const DIMENSION_HEIGHT = 'height'
|
||||
|
||||
const Selector = {
|
||||
ACTIVES : '.show, .collapsing',
|
||||
DATA_TOGGLE : '[data-toggle="collapse"]'
|
||||
}
|
||||
const SELECTOR_ACTIVES = '.show, .collapsing'
|
||||
const SELECTOR_DATA_TOGGLE = '[data-toggle="collapse"]'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -72,7 +64,7 @@ class Collapse {
|
||||
`[data-toggle="collapse"][data-target="#${element.id}"]`
|
||||
))
|
||||
|
||||
const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))
|
||||
const toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||
for (let i = 0, len = toggleList.length; i < len; i++) {
|
||||
const elem = toggleList[i]
|
||||
const selector = Util.getSelectorFromElement(elem)
|
||||
@@ -109,7 +101,7 @@ class Collapse {
|
||||
// Public
|
||||
|
||||
toggle() {
|
||||
if ($(this._element).hasClass(ClassName.SHOW)) {
|
||||
if ($(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
this.hide()
|
||||
} else {
|
||||
this.show()
|
||||
@@ -118,7 +110,7 @@ class Collapse {
|
||||
|
||||
show() {
|
||||
if (this._isTransitioning ||
|
||||
$(this._element).hasClass(ClassName.SHOW)) {
|
||||
$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -126,13 +118,13 @@ class Collapse {
|
||||
let activesData
|
||||
|
||||
if (this._parent) {
|
||||
actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES))
|
||||
actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES))
|
||||
.filter((elem) => {
|
||||
if (typeof this._config.parent === 'string') {
|
||||
return elem.getAttribute('data-parent') === this._config.parent
|
||||
}
|
||||
|
||||
return elem.classList.contains(ClassName.COLLAPSE)
|
||||
return elem.classList.contains(CLASS_NAME_COLLAPSE)
|
||||
})
|
||||
|
||||
if (actives.length === 0) {
|
||||
@@ -147,7 +139,7 @@ class Collapse {
|
||||
}
|
||||
}
|
||||
|
||||
const startEvent = $.Event(Event.SHOW)
|
||||
const startEvent = $.Event(EVENT_SHOW)
|
||||
$(this._element).trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return
|
||||
@@ -163,14 +155,14 @@ class Collapse {
|
||||
const dimension = this._getDimension()
|
||||
|
||||
$(this._element)
|
||||
.removeClass(ClassName.COLLAPSE)
|
||||
.addClass(ClassName.COLLAPSING)
|
||||
.removeClass(CLASS_NAME_COLLAPSE)
|
||||
.addClass(CLASS_NAME_COLLAPSING)
|
||||
|
||||
this._element.style[dimension] = 0
|
||||
|
||||
if (this._triggerArray.length) {
|
||||
$(this._triggerArray)
|
||||
.removeClass(ClassName.COLLAPSED)
|
||||
.removeClass(CLASS_NAME_COLLAPSED)
|
||||
.attr('aria-expanded', true)
|
||||
}
|
||||
|
||||
@@ -178,15 +170,14 @@ class Collapse {
|
||||
|
||||
const complete = () => {
|
||||
$(this._element)
|
||||
.removeClass(ClassName.COLLAPSING)
|
||||
.addClass(ClassName.COLLAPSE)
|
||||
.addClass(ClassName.SHOW)
|
||||
.removeClass(CLASS_NAME_COLLAPSING)
|
||||
.addClass(`${CLASS_NAME_COLLAPSE} ${CLASS_NAME_SHOW}`)
|
||||
|
||||
this._element.style[dimension] = ''
|
||||
|
||||
this.setTransitioning(false)
|
||||
|
||||
$(this._element).trigger(Event.SHOWN)
|
||||
$(this._element).trigger(EVENT_SHOWN)
|
||||
}
|
||||
|
||||
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)
|
||||
@@ -202,11 +193,11 @@ class Collapse {
|
||||
|
||||
hide() {
|
||||
if (this._isTransitioning ||
|
||||
!$(this._element).hasClass(ClassName.SHOW)) {
|
||||
!$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
return
|
||||
}
|
||||
|
||||
const startEvent = $.Event(Event.HIDE)
|
||||
const startEvent = $.Event(EVENT_HIDE)
|
||||
$(this._element).trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return
|
||||
@@ -219,9 +210,8 @@ class Collapse {
|
||||
Util.reflow(this._element)
|
||||
|
||||
$(this._element)
|
||||
.addClass(ClassName.COLLAPSING)
|
||||
.removeClass(ClassName.COLLAPSE)
|
||||
.removeClass(ClassName.SHOW)
|
||||
.addClass(CLASS_NAME_COLLAPSING)
|
||||
.removeClass(`${CLASS_NAME_COLLAPSE} ${CLASS_NAME_SHOW}`)
|
||||
|
||||
const triggerArrayLength = this._triggerArray.length
|
||||
if (triggerArrayLength > 0) {
|
||||
@@ -231,8 +221,8 @@ class Collapse {
|
||||
|
||||
if (selector !== null) {
|
||||
const $elem = $([].slice.call(document.querySelectorAll(selector)))
|
||||
if (!$elem.hasClass(ClassName.SHOW)) {
|
||||
$(trigger).addClass(ClassName.COLLAPSED)
|
||||
if (!$elem.hasClass(CLASS_NAME_SHOW)) {
|
||||
$(trigger).addClass(CLASS_NAME_COLLAPSED)
|
||||
.attr('aria-expanded', false)
|
||||
}
|
||||
}
|
||||
@@ -244,9 +234,9 @@ class Collapse {
|
||||
const complete = () => {
|
||||
this.setTransitioning(false)
|
||||
$(this._element)
|
||||
.removeClass(ClassName.COLLAPSING)
|
||||
.addClass(ClassName.COLLAPSE)
|
||||
.trigger(Event.HIDDEN)
|
||||
.removeClass(CLASS_NAME_COLLAPSING)
|
||||
.addClass(CLASS_NAME_COLLAPSE)
|
||||
.trigger(EVENT_HIDDEN)
|
||||
}
|
||||
|
||||
this._element.style[dimension] = ''
|
||||
@@ -284,8 +274,8 @@ class Collapse {
|
||||
}
|
||||
|
||||
_getDimension() {
|
||||
const hasWidth = $(this._element).hasClass(Dimension.WIDTH)
|
||||
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT
|
||||
const hasWidth = $(this._element).hasClass(DIMENSION_WIDTH)
|
||||
return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT
|
||||
}
|
||||
|
||||
_getParent() {
|
||||
@@ -302,10 +292,9 @@ class Collapse {
|
||||
parent = document.querySelector(this._config.parent)
|
||||
}
|
||||
|
||||
const selector =
|
||||
`[data-toggle="collapse"][data-parent="${this._config.parent}"]`
|
||||
|
||||
const selector = `[data-toggle="collapse"][data-parent="${this._config.parent}"]`
|
||||
const children = [].slice.call(parent.querySelectorAll(selector))
|
||||
|
||||
$(children).each((i, element) => {
|
||||
this._addAriaAndCollapsedClass(
|
||||
Collapse._getTargetFromElement(element),
|
||||
@@ -317,11 +306,11 @@ class Collapse {
|
||||
}
|
||||
|
||||
_addAriaAndCollapsedClass(element, triggerArray) {
|
||||
const isOpen = $(element).hasClass(ClassName.SHOW)
|
||||
const isOpen = $(element).hasClass(CLASS_NAME_SHOW)
|
||||
|
||||
if (triggerArray.length) {
|
||||
$(triggerArray)
|
||||
.toggleClass(ClassName.COLLAPSED, !isOpen)
|
||||
.toggleClass(CLASS_NAME_COLLAPSED, !isOpen)
|
||||
.attr('aria-expanded', isOpen)
|
||||
}
|
||||
}
|
||||
@@ -343,7 +332,7 @@ class Collapse {
|
||||
...typeof config === 'object' && config ? config : {}
|
||||
}
|
||||
|
||||
if (!data && _config.toggle && /show|hide/.test(config)) {
|
||||
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||
_config.toggle = false
|
||||
}
|
||||
|
||||
@@ -368,7 +357,7 @@ class Collapse {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
|
||||
if (event.currentTarget.tagName === 'A') {
|
||||
event.preventDefault()
|
||||
|
||||
+115
-126
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'dropdown'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.dropdown'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@@ -29,61 +29,52 @@ const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow
|
||||
const RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
||||
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)
|
||||
|
||||
const Event = {
|
||||
HIDE : `hide${EVENT_KEY}`,
|
||||
HIDDEN : `hidden${EVENT_KEY}`,
|
||||
SHOW : `show${EVENT_KEY}`,
|
||||
SHOWN : `shown${EVENT_KEY}`,
|
||||
CLICK : `click${EVENT_KEY}`,
|
||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,
|
||||
KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,
|
||||
KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}`
|
||||
}
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||
const EVENT_CLICK = `click${EVENT_KEY}`
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`
|
||||
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const ClassName = {
|
||||
DISABLED : 'disabled',
|
||||
SHOW : 'show',
|
||||
DROPUP : 'dropup',
|
||||
DROPRIGHT : 'dropright',
|
||||
DROPLEFT : 'dropleft',
|
||||
MENURIGHT : 'dropdown-menu-right',
|
||||
MENULEFT : 'dropdown-menu-left',
|
||||
POSITION_STATIC : 'position-static'
|
||||
}
|
||||
const CLASS_NAME_DISABLED = 'disabled'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_DROPUP = 'dropup'
|
||||
const CLASS_NAME_DROPRIGHT = 'dropright'
|
||||
const CLASS_NAME_DROPLEFT = 'dropleft'
|
||||
const CLASS_NAME_MENURIGHT = 'dropdown-menu-right'
|
||||
const CLASS_NAME_POSITION_STATIC = 'position-static'
|
||||
|
||||
const Selector = {
|
||||
DATA_TOGGLE : '[data-toggle="dropdown"]',
|
||||
FORM_CHILD : '.dropdown form',
|
||||
MENU : '.dropdown-menu',
|
||||
NAVBAR_NAV : '.navbar-nav',
|
||||
VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
|
||||
}
|
||||
const SELECTOR_DATA_TOGGLE = '[data-toggle="dropdown"]'
|
||||
const SELECTOR_FORM_CHILD = '.dropdown form'
|
||||
const SELECTOR_MENU = '.dropdown-menu'
|
||||
const SELECTOR_NAVBAR_NAV = '.navbar-nav'
|
||||
const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
|
||||
|
||||
const AttachmentMap = {
|
||||
TOP : 'top-start',
|
||||
TOPEND : 'top-end',
|
||||
BOTTOM : 'bottom-start',
|
||||
BOTTOMEND : 'bottom-end',
|
||||
RIGHT : 'right-start',
|
||||
RIGHTEND : 'right-end',
|
||||
LEFT : 'left-start',
|
||||
LEFTEND : 'left-end'
|
||||
}
|
||||
const PLACEMENT_TOP = 'top-start'
|
||||
const PLACEMENT_TOPEND = 'top-end'
|
||||
const PLACEMENT_BOTTOM = 'bottom-start'
|
||||
const PLACEMENT_BOTTOMEND = 'bottom-end'
|
||||
const PLACEMENT_RIGHT = 'right-start'
|
||||
const PLACEMENT_LEFT = 'left-start'
|
||||
|
||||
const Default = {
|
||||
offset : 0,
|
||||
flip : true,
|
||||
boundary : 'scrollParent',
|
||||
reference : 'toggle',
|
||||
display : 'dynamic'
|
||||
offset : 0,
|
||||
flip : true,
|
||||
boundary : 'scrollParent',
|
||||
reference : 'toggle',
|
||||
display : 'dynamic',
|
||||
popperConfig : null
|
||||
}
|
||||
|
||||
const DefaultType = {
|
||||
offset : '(number|string|function)',
|
||||
flip : 'boolean',
|
||||
boundary : '(string|element)',
|
||||
reference : '(string|element)',
|
||||
display : 'string'
|
||||
offset : '(number|string|function)',
|
||||
flip : 'boolean',
|
||||
boundary : '(string|element)',
|
||||
reference : '(string|element)',
|
||||
display : 'string',
|
||||
popperConfig : '(null|object)'
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,12 +111,11 @@ class Dropdown {
|
||||
// Public
|
||||
|
||||
toggle() {
|
||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return
|
||||
}
|
||||
|
||||
const parent = Dropdown._getParentFromElement(this._element)
|
||||
const isActive = $(this._menu).hasClass(ClassName.SHOW)
|
||||
const isActive = $(this._menu).hasClass(CLASS_NAME_SHOW)
|
||||
|
||||
Dropdown._clearMenus()
|
||||
|
||||
@@ -133,10 +123,19 @@ class Dropdown {
|
||||
return
|
||||
}
|
||||
|
||||
this.show(true)
|
||||
}
|
||||
|
||||
show(usePopper = false) {
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||
return
|
||||
}
|
||||
|
||||
const relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
}
|
||||
const showEvent = $.Event(Event.SHOW, relatedTarget)
|
||||
const showEvent = $.Event(EVENT_SHOW, relatedTarget)
|
||||
const parent = Dropdown._getParentFromElement(this._element)
|
||||
|
||||
$(parent).trigger(showEvent)
|
||||
|
||||
@@ -145,7 +144,7 @@ class Dropdown {
|
||||
}
|
||||
|
||||
// Disable totally Popper.js for Dropdown in Navbar
|
||||
if (!this._inNavbar) {
|
||||
if (!this._inNavbar && usePopper) {
|
||||
/**
|
||||
* Check for Popper dependency
|
||||
* Popper - https://popper.js.org
|
||||
@@ -171,7 +170,7 @@ class Dropdown {
|
||||
// to allow the menu to "escape" the scroll parent's boundaries
|
||||
// https://github.com/twbs/bootstrap/issues/24251
|
||||
if (this._config.boundary !== 'scrollParent') {
|
||||
$(parent).addClass(ClassName.POSITION_STATIC)
|
||||
$(parent).addClass(CLASS_NAME_POSITION_STATIC)
|
||||
}
|
||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())
|
||||
}
|
||||
@@ -181,51 +180,28 @@ class Dropdown {
|
||||
// only needed because of broken event delegation on iOS
|
||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||
if ('ontouchstart' in document.documentElement &&
|
||||
$(parent).closest(Selector.NAVBAR_NAV).length === 0) {
|
||||
$(parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
|
||||
$(document.body).children().on('mouseover', null, $.noop)
|
||||
}
|
||||
|
||||
this._element.focus()
|
||||
this._element.setAttribute('aria-expanded', true)
|
||||
|
||||
$(this._menu).toggleClass(ClassName.SHOW)
|
||||
$(this._menu).toggleClass(CLASS_NAME_SHOW)
|
||||
$(parent)
|
||||
.toggleClass(ClassName.SHOW)
|
||||
.trigger($.Event(Event.SHOWN, relatedTarget))
|
||||
}
|
||||
|
||||
show() {
|
||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) {
|
||||
return
|
||||
}
|
||||
|
||||
const relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
}
|
||||
const showEvent = $.Event(Event.SHOW, relatedTarget)
|
||||
const parent = Dropdown._getParentFromElement(this._element)
|
||||
|
||||
$(parent).trigger(showEvent)
|
||||
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return
|
||||
}
|
||||
|
||||
$(this._menu).toggleClass(ClassName.SHOW)
|
||||
$(parent)
|
||||
.toggleClass(ClassName.SHOW)
|
||||
.trigger($.Event(Event.SHOWN, relatedTarget))
|
||||
.toggleClass(CLASS_NAME_SHOW)
|
||||
.trigger($.Event(EVENT_SHOWN, relatedTarget))
|
||||
}
|
||||
|
||||
hide() {
|
||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) {
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||
return
|
||||
}
|
||||
|
||||
const relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
}
|
||||
const hideEvent = $.Event(Event.HIDE, relatedTarget)
|
||||
const hideEvent = $.Event(EVENT_HIDE, relatedTarget)
|
||||
const parent = Dropdown._getParentFromElement(this._element)
|
||||
|
||||
$(parent).trigger(hideEvent)
|
||||
@@ -234,10 +210,14 @@ class Dropdown {
|
||||
return
|
||||
}
|
||||
|
||||
$(this._menu).toggleClass(ClassName.SHOW)
|
||||
if (this._popper) {
|
||||
this._popper.destroy()
|
||||
}
|
||||
|
||||
$(this._menu).toggleClass(CLASS_NAME_SHOW)
|
||||
$(parent)
|
||||
.toggleClass(ClassName.SHOW)
|
||||
.trigger($.Event(Event.HIDDEN, relatedTarget))
|
||||
.toggleClass(CLASS_NAME_SHOW)
|
||||
.trigger($.Event(EVENT_HIDDEN, relatedTarget))
|
||||
}
|
||||
|
||||
dispose() {
|
||||
@@ -261,7 +241,7 @@ class Dropdown {
|
||||
// Private
|
||||
|
||||
_addEventListeners() {
|
||||
$(this._element).on(Event.CLICK, (event) => {
|
||||
$(this._element).on(EVENT_CLICK, (event) => {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
this.toggle()
|
||||
@@ -289,7 +269,7 @@ class Dropdown {
|
||||
const parent = Dropdown._getParentFromElement(this._element)
|
||||
|
||||
if (parent) {
|
||||
this._menu = parent.querySelector(Selector.MENU)
|
||||
this._menu = parent.querySelector(SELECTOR_MENU)
|
||||
}
|
||||
}
|
||||
return this._menu
|
||||
@@ -297,20 +277,19 @@ class Dropdown {
|
||||
|
||||
_getPlacement() {
|
||||
const $parentDropdown = $(this._element.parentNode)
|
||||
let placement = AttachmentMap.BOTTOM
|
||||
let placement = PLACEMENT_BOTTOM
|
||||
|
||||
// Handle dropup
|
||||
if ($parentDropdown.hasClass(ClassName.DROPUP)) {
|
||||
placement = AttachmentMap.TOP
|
||||
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
||||
placement = AttachmentMap.TOPEND
|
||||
}
|
||||
} else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
|
||||
placement = AttachmentMap.RIGHT
|
||||
} else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
|
||||
placement = AttachmentMap.LEFT
|
||||
} else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
||||
placement = AttachmentMap.BOTTOMEND
|
||||
if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
|
||||
placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT)
|
||||
? PLACEMENT_TOPEND
|
||||
: PLACEMENT_TOP
|
||||
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
|
||||
placement = PLACEMENT_RIGHT
|
||||
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
|
||||
placement = PLACEMENT_LEFT
|
||||
} else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
|
||||
placement = PLACEMENT_BOTTOMEND
|
||||
}
|
||||
return placement
|
||||
}
|
||||
@@ -359,7 +338,10 @@ class Dropdown {
|
||||
}
|
||||
}
|
||||
|
||||
return popperConfig
|
||||
return {
|
||||
...popperConfig,
|
||||
...this._config.popperConfig
|
||||
}
|
||||
}
|
||||
|
||||
// Static
|
||||
@@ -389,7 +371,7 @@ class Dropdown {
|
||||
return
|
||||
}
|
||||
|
||||
const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))
|
||||
const toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||
|
||||
for (let i = 0, len = toggles.length; i < len; i++) {
|
||||
const parent = Dropdown._getParentFromElement(toggles[i])
|
||||
@@ -407,7 +389,7 @@ class Dropdown {
|
||||
}
|
||||
|
||||
const dropdownMenu = context._menu
|
||||
if (!$(parent).hasClass(ClassName.SHOW)) {
|
||||
if (!$(parent).hasClass(CLASS_NAME_SHOW)) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -417,7 +399,7 @@ class Dropdown {
|
||||
continue
|
||||
}
|
||||
|
||||
const hideEvent = $.Event(Event.HIDE, relatedTarget)
|
||||
const hideEvent = $.Event(EVENT_HIDE, relatedTarget)
|
||||
$(parent).trigger(hideEvent)
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
continue
|
||||
@@ -431,10 +413,14 @@ class Dropdown {
|
||||
|
||||
toggles[i].setAttribute('aria-expanded', 'false')
|
||||
|
||||
$(dropdownMenu).removeClass(ClassName.SHOW)
|
||||
if (context._popper) {
|
||||
context._popper.destroy()
|
||||
}
|
||||
|
||||
$(dropdownMenu).removeClass(CLASS_NAME_SHOW)
|
||||
$(parent)
|
||||
.removeClass(ClassName.SHOW)
|
||||
.trigger($.Event(Event.HIDDEN, relatedTarget))
|
||||
.removeClass(CLASS_NAME_SHOW)
|
||||
.trigger($.Event(EVENT_HIDDEN, relatedTarget))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,31 +447,35 @@ class Dropdown {
|
||||
if (/input|textarea/i.test(event.target.tagName)
|
||||
? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE &&
|
||||
(event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE ||
|
||||
$(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
||||
$(event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return
|
||||
}
|
||||
|
||||
const parent = Dropdown._getParentFromElement(this)
|
||||
const isActive = $(parent).hasClass(CLASS_NAME_SHOW)
|
||||
|
||||
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||
return
|
||||
}
|
||||
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
||||
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
||||
return
|
||||
}
|
||||
|
||||
const parent = Dropdown._getParentFromElement(this)
|
||||
const isActive = $(parent).hasClass(ClassName.SHOW)
|
||||
|
||||
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
const toggle = parent.querySelector(Selector.DATA_TOGGLE)
|
||||
$(toggle).trigger('focus')
|
||||
$(parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus')
|
||||
}
|
||||
|
||||
$(this).trigger('click')
|
||||
return
|
||||
}
|
||||
|
||||
const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS))
|
||||
const items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS))
|
||||
.filter((item) => $(item).is(':visible'))
|
||||
|
||||
if (items.length === 0) {
|
||||
return
|
||||
@@ -516,15 +506,15 @@ class Dropdown {
|
||||
*/
|
||||
|
||||
$(document)
|
||||
.on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)
|
||||
.on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)
|
||||
.on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus)
|
||||
.on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
.on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown._dataApiKeydownHandler)
|
||||
.on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler)
|
||||
.on(`${EVENT_CLICK_DATA_API} ${EVENT_KEYUP_DATA_API}`, Dropdown._clearMenus)
|
||||
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
Dropdown._jQueryInterface.call($(this), 'toggle')
|
||||
})
|
||||
.on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {
|
||||
.on(EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, (e) => {
|
||||
e.stopPropagation()
|
||||
})
|
||||
|
||||
@@ -541,5 +531,4 @@ $.fn[NAME].noConflict = () => {
|
||||
return Dropdown._jQueryInterface
|
||||
}
|
||||
|
||||
|
||||
export default Dropdown
|
||||
|
||||
+2
-20
@@ -1,4 +1,3 @@
|
||||
import $ from 'jquery'
|
||||
import Alert from './alert'
|
||||
import Button from './button'
|
||||
import Carousel from './carousel'
|
||||
@@ -14,28 +13,11 @@ import Util from './util'
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
(() => {
|
||||
if (typeof $ === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.')
|
||||
}
|
||||
|
||||
const version = $.fn.jquery.split(' ')[0].split('.')
|
||||
const minMajor = 1
|
||||
const ltMajor = 2
|
||||
const minMinor = 9
|
||||
const minPatch = 1
|
||||
const maxMajor = 4
|
||||
|
||||
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
|
||||
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
|
||||
}
|
||||
})()
|
||||
|
||||
export {
|
||||
Util,
|
||||
Alert,
|
||||
|
||||
+119
-86
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'modal'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.modal'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@@ -36,37 +36,33 @@ const DefaultType = {
|
||||
show : 'boolean'
|
||||
}
|
||||
|
||||
const Event = {
|
||||
HIDE : `hide${EVENT_KEY}`,
|
||||
HIDDEN : `hidden${EVENT_KEY}`,
|
||||
SHOW : `show${EVENT_KEY}`,
|
||||
SHOWN : `shown${EVENT_KEY}`,
|
||||
FOCUSIN : `focusin${EVENT_KEY}`,
|
||||
RESIZE : `resize${EVENT_KEY}`,
|
||||
CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,
|
||||
KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,
|
||||
MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,
|
||||
MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,
|
||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
}
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||
const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`
|
||||
const EVENT_RESIZE = `resize${EVENT_KEY}`
|
||||
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
|
||||
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`
|
||||
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY}`
|
||||
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const ClassName = {
|
||||
SCROLLABLE : 'modal-dialog-scrollable',
|
||||
SCROLLBAR_MEASURER : 'modal-scrollbar-measure',
|
||||
BACKDROP : 'modal-backdrop',
|
||||
OPEN : 'modal-open',
|
||||
FADE : 'fade',
|
||||
SHOW : 'show'
|
||||
}
|
||||
const CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'
|
||||
const CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'
|
||||
const CLASS_NAME_BACKDROP = 'modal-backdrop'
|
||||
const CLASS_NAME_OPEN = 'modal-open'
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_STATIC = 'modal-static'
|
||||
|
||||
const Selector = {
|
||||
DIALOG : '.modal-dialog',
|
||||
MODAL_BODY : '.modal-body',
|
||||
DATA_TOGGLE : '[data-toggle="modal"]',
|
||||
DATA_DISMISS : '[data-dismiss="modal"]',
|
||||
FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
|
||||
STICKY_CONTENT : '.sticky-top'
|
||||
}
|
||||
const SELECTOR_DIALOG = '.modal-dialog'
|
||||
const SELECTOR_MODAL_BODY = '.modal-body'
|
||||
const SELECTOR_DATA_TOGGLE = '[data-toggle="modal"]'
|
||||
const SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]'
|
||||
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'
|
||||
const SELECTOR_STICKY_CONTENT = '.sticky-top'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -78,7 +74,7 @@ class Modal {
|
||||
constructor(element, config) {
|
||||
this._config = this._getConfig(config)
|
||||
this._element = element
|
||||
this._dialog = element.querySelector(Selector.DIALOG)
|
||||
this._dialog = element.querySelector(SELECTOR_DIALOG)
|
||||
this._backdrop = null
|
||||
this._isShown = false
|
||||
this._isBodyOverflowing = false
|
||||
@@ -108,11 +104,11 @@ class Modal {
|
||||
return
|
||||
}
|
||||
|
||||
if ($(this._element).hasClass(ClassName.FADE)) {
|
||||
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._isTransitioning = true
|
||||
}
|
||||
|
||||
const showEvent = $.Event(Event.SHOW, {
|
||||
const showEvent = $.Event(EVENT_SHOW, {
|
||||
relatedTarget
|
||||
})
|
||||
|
||||
@@ -133,13 +129,13 @@ class Modal {
|
||||
this._setResizeEvent()
|
||||
|
||||
$(this._element).on(
|
||||
Event.CLICK_DISMISS,
|
||||
Selector.DATA_DISMISS,
|
||||
EVENT_CLICK_DISMISS,
|
||||
SELECTOR_DATA_DISMISS,
|
||||
(event) => this.hide(event)
|
||||
)
|
||||
|
||||
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {
|
||||
$(this._element).one(Event.MOUSEUP_DISMISS, (event) => {
|
||||
$(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, () => {
|
||||
$(this._element).one(EVENT_MOUSEUP_DISMISS, (event) => {
|
||||
if ($(event.target).is(this._element)) {
|
||||
this._ignoreBackdropClick = true
|
||||
}
|
||||
@@ -158,7 +154,7 @@ class Modal {
|
||||
return
|
||||
}
|
||||
|
||||
const hideEvent = $.Event(Event.HIDE)
|
||||
const hideEvent = $.Event(EVENT_HIDE)
|
||||
|
||||
$(this._element).trigger(hideEvent)
|
||||
|
||||
@@ -167,7 +163,7 @@ class Modal {
|
||||
}
|
||||
|
||||
this._isShown = false
|
||||
const transition = $(this._element).hasClass(ClassName.FADE)
|
||||
const transition = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||
|
||||
if (transition) {
|
||||
this._isTransitioning = true
|
||||
@@ -176,13 +172,12 @@ class Modal {
|
||||
this._setEscapeEvent()
|
||||
this._setResizeEvent()
|
||||
|
||||
$(document).off(Event.FOCUSIN)
|
||||
$(document).off(EVENT_FOCUSIN)
|
||||
|
||||
$(this._element).removeClass(ClassName.SHOW)
|
||||
|
||||
$(this._element).off(Event.CLICK_DISMISS)
|
||||
$(this._dialog).off(Event.MOUSEDOWN_DISMISS)
|
||||
$(this._element).removeClass(CLASS_NAME_SHOW)
|
||||
|
||||
$(this._element).off(EVENT_CLICK_DISMISS)
|
||||
$(this._dialog).off(EVENT_MOUSEDOWN_DISMISS)
|
||||
|
||||
if (transition) {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||
@@ -200,11 +195,11 @@ class Modal {
|
||||
.forEach((htmlElement) => $(htmlElement).off(EVENT_KEY))
|
||||
|
||||
/**
|
||||
* `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
|
||||
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||
* Do not move `document` in `htmlElements` array
|
||||
* It will remove `Event.CLICK_DATA_API` event that should remain
|
||||
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||
*/
|
||||
$(document).off(Event.FOCUSIN)
|
||||
$(document).off(EVENT_FOCUSIN)
|
||||
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
|
||||
@@ -234,8 +229,45 @@ class Modal {
|
||||
return config
|
||||
}
|
||||
|
||||
_triggerBackdropTransition() {
|
||||
if (this._config.backdrop === 'static') {
|
||||
const hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED)
|
||||
|
||||
$(this._element).trigger(hideEventPrevented)
|
||||
if (hideEventPrevented.defaultPrevented) {
|
||||
return
|
||||
}
|
||||
|
||||
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
this._element.style.overflowY = 'hidden'
|
||||
}
|
||||
|
||||
this._element.classList.add(CLASS_NAME_STATIC)
|
||||
|
||||
const modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog)
|
||||
$(this._element).off(Util.TRANSITION_END)
|
||||
|
||||
$(this._element).one(Util.TRANSITION_END, () => {
|
||||
this._element.classList.remove(CLASS_NAME_STATIC)
|
||||
if (!isModalOverflowing) {
|
||||
$(this._element).one(Util.TRANSITION_END, () => {
|
||||
this._element.style.overflowY = ''
|
||||
})
|
||||
.emulateTransitionEnd(this._element, modalTransitionDuration)
|
||||
}
|
||||
})
|
||||
.emulateTransitionEnd(modalTransitionDuration)
|
||||
this._element.focus()
|
||||
} else {
|
||||
this.hide()
|
||||
}
|
||||
}
|
||||
|
||||
_showElement(relatedTarget) {
|
||||
const transition = $(this._element).hasClass(ClassName.FADE)
|
||||
const transition = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||
const modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null
|
||||
|
||||
if (!this._element.parentNode ||
|
||||
this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
||||
@@ -246,9 +278,10 @@ class Modal {
|
||||
this._element.style.display = 'block'
|
||||
this._element.removeAttribute('aria-hidden')
|
||||
this._element.setAttribute('aria-modal', true)
|
||||
this._element.setAttribute('role', 'dialog')
|
||||
|
||||
if ($(this._dialog).hasClass(ClassName.SCROLLABLE)) {
|
||||
this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0
|
||||
if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
|
||||
modalBody.scrollTop = 0
|
||||
} else {
|
||||
this._element.scrollTop = 0
|
||||
}
|
||||
@@ -257,13 +290,13 @@ class Modal {
|
||||
Util.reflow(this._element)
|
||||
}
|
||||
|
||||
$(this._element).addClass(ClassName.SHOW)
|
||||
$(this._element).addClass(CLASS_NAME_SHOW)
|
||||
|
||||
if (this._config.focus) {
|
||||
this._enforceFocus()
|
||||
}
|
||||
|
||||
const shownEvent = $.Event(Event.SHOWN, {
|
||||
const shownEvent = $.Event(EVENT_SHOWN, {
|
||||
relatedTarget
|
||||
})
|
||||
|
||||
@@ -288,8 +321,8 @@ class Modal {
|
||||
|
||||
_enforceFocus() {
|
||||
$(document)
|
||||
.off(Event.FOCUSIN) // Guard against infinite focus loop
|
||||
.on(Event.FOCUSIN, (event) => {
|
||||
.off(EVENT_FOCUSIN) // Guard against infinite focus loop
|
||||
.on(EVENT_FOCUSIN, (event) => {
|
||||
if (document !== event.target &&
|
||||
this._element !== event.target &&
|
||||
$(this._element).has(event.target).length === 0) {
|
||||
@@ -299,23 +332,25 @@ class Modal {
|
||||
}
|
||||
|
||||
_setEscapeEvent() {
|
||||
if (this._isShown && this._config.keyboard) {
|
||||
$(this._element).on(Event.KEYDOWN_DISMISS, (event) => {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
if (this._isShown) {
|
||||
$(this._element).on(EVENT_KEYDOWN_DISMISS, (event) => {
|
||||
if (this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
event.preventDefault()
|
||||
this.hide()
|
||||
} else if (!this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
this._triggerBackdropTransition()
|
||||
}
|
||||
})
|
||||
} else if (!this._isShown) {
|
||||
$(this._element).off(Event.KEYDOWN_DISMISS)
|
||||
$(this._element).off(EVENT_KEYDOWN_DISMISS)
|
||||
}
|
||||
}
|
||||
|
||||
_setResizeEvent() {
|
||||
if (this._isShown) {
|
||||
$(window).on(Event.RESIZE, (event) => this.handleUpdate(event))
|
||||
$(window).on(EVENT_RESIZE, (event) => this.handleUpdate(event))
|
||||
} else {
|
||||
$(window).off(Event.RESIZE)
|
||||
$(window).off(EVENT_RESIZE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,12 +358,13 @@ class Modal {
|
||||
this._element.style.display = 'none'
|
||||
this._element.setAttribute('aria-hidden', true)
|
||||
this._element.removeAttribute('aria-modal')
|
||||
this._element.removeAttribute('role')
|
||||
this._isTransitioning = false
|
||||
this._showBackdrop(() => {
|
||||
$(document.body).removeClass(ClassName.OPEN)
|
||||
$(document.body).removeClass(CLASS_NAME_OPEN)
|
||||
this._resetAdjustments()
|
||||
this._resetScrollbar()
|
||||
$(this._element).trigger(Event.HIDDEN)
|
||||
$(this._element).trigger(EVENT_HIDDEN)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -340,12 +376,12 @@ class Modal {
|
||||
}
|
||||
|
||||
_showBackdrop(callback) {
|
||||
const animate = $(this._element).hasClass(ClassName.FADE)
|
||||
? ClassName.FADE : ''
|
||||
const animate = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||
? CLASS_NAME_FADE : ''
|
||||
|
||||
if (this._isShown && this._config.backdrop) {
|
||||
this._backdrop = document.createElement('div')
|
||||
this._backdrop.className = ClassName.BACKDROP
|
||||
this._backdrop.className = CLASS_NAME_BACKDROP
|
||||
|
||||
if (animate) {
|
||||
this._backdrop.classList.add(animate)
|
||||
@@ -353,7 +389,7 @@ class Modal {
|
||||
|
||||
$(this._backdrop).appendTo(document.body)
|
||||
|
||||
$(this._element).on(Event.CLICK_DISMISS, (event) => {
|
||||
$(this._element).on(EVENT_CLICK_DISMISS, (event) => {
|
||||
if (this._ignoreBackdropClick) {
|
||||
this._ignoreBackdropClick = false
|
||||
return
|
||||
@@ -361,18 +397,15 @@ class Modal {
|
||||
if (event.target !== event.currentTarget) {
|
||||
return
|
||||
}
|
||||
if (this._config.backdrop === 'static') {
|
||||
this._element.focus()
|
||||
} else {
|
||||
this.hide()
|
||||
}
|
||||
|
||||
this._triggerBackdropTransition()
|
||||
})
|
||||
|
||||
if (animate) {
|
||||
Util.reflow(this._backdrop)
|
||||
}
|
||||
|
||||
$(this._backdrop).addClass(ClassName.SHOW)
|
||||
$(this._backdrop).addClass(CLASS_NAME_SHOW)
|
||||
|
||||
if (!callback) {
|
||||
return
|
||||
@@ -389,7 +422,7 @@ class Modal {
|
||||
.one(Util.TRANSITION_END, callback)
|
||||
.emulateTransitionEnd(backdropTransitionDuration)
|
||||
} else if (!this._isShown && this._backdrop) {
|
||||
$(this._backdrop).removeClass(ClassName.SHOW)
|
||||
$(this._backdrop).removeClass(CLASS_NAME_SHOW)
|
||||
|
||||
const callbackRemove = () => {
|
||||
this._removeBackdrop()
|
||||
@@ -398,7 +431,7 @@ class Modal {
|
||||
}
|
||||
}
|
||||
|
||||
if ($(this._element).hasClass(ClassName.FADE)) {
|
||||
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)
|
||||
|
||||
$(this._backdrop)
|
||||
@@ -437,7 +470,7 @@ class Modal {
|
||||
|
||||
_checkScrollbar() {
|
||||
const rect = document.body.getBoundingClientRect()
|
||||
this._isBodyOverflowing = rect.left + rect.right < window.innerWidth
|
||||
this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth
|
||||
this._scrollbarWidth = this._getScrollbarWidth()
|
||||
}
|
||||
|
||||
@@ -445,8 +478,8 @@ class Modal {
|
||||
if (this._isBodyOverflowing) {
|
||||
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
||||
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
|
||||
const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))
|
||||
const fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT))
|
||||
const stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT))
|
||||
|
||||
// Adjust fixed content padding
|
||||
$(fixedContent).each((index, element) => {
|
||||
@@ -474,12 +507,12 @@ class Modal {
|
||||
.css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
|
||||
}
|
||||
|
||||
$(document.body).addClass(ClassName.OPEN)
|
||||
$(document.body).addClass(CLASS_NAME_OPEN)
|
||||
}
|
||||
|
||||
_resetScrollbar() {
|
||||
// Restore fixed content padding
|
||||
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
|
||||
const fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT))
|
||||
$(fixedContent).each((index, element) => {
|
||||
const padding = $(element).data('padding-right')
|
||||
$(element).removeData('padding-right')
|
||||
@@ -487,7 +520,7 @@ class Modal {
|
||||
})
|
||||
|
||||
// Restore sticky content
|
||||
const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`))
|
||||
const elements = [].slice.call(document.querySelectorAll(`${SELECTOR_STICKY_CONTENT}`))
|
||||
$(elements).each((index, element) => {
|
||||
const margin = $(element).data('margin-right')
|
||||
if (typeof margin !== 'undefined') {
|
||||
@@ -503,7 +536,7 @@ class Modal {
|
||||
|
||||
_getScrollbarWidth() { // thx d.walsh
|
||||
const scrollDiv = document.createElement('div')
|
||||
scrollDiv.className = ClassName.SCROLLBAR_MEASURER
|
||||
scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER
|
||||
document.body.appendChild(scrollDiv)
|
||||
const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth
|
||||
document.body.removeChild(scrollDiv)
|
||||
@@ -544,7 +577,7 @@ class Modal {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
let target
|
||||
const selector = Util.getSelectorFromElement(this)
|
||||
|
||||
@@ -562,13 +595,13 @@ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
event.preventDefault()
|
||||
}
|
||||
|
||||
const $target = $(target).one(Event.SHOW, (showEvent) => {
|
||||
const $target = $(target).one(EVENT_SHOW, (showEvent) => {
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
// Only register focus restorer if modal will actually get shown
|
||||
return
|
||||
}
|
||||
|
||||
$target.one(Event.HIDDEN, () => {
|
||||
$target.one(EVENT_HIDDEN, () => {
|
||||
if ($(this).is(':visible')) {
|
||||
this.focus()
|
||||
}
|
||||
|
||||
+10
-14
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ import Tooltip from './tooltip'
|
||||
*/
|
||||
|
||||
const NAME = 'popover'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.popover'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
@@ -38,15 +38,11 @@ const DefaultType = {
|
||||
content : '(string|element|function)'
|
||||
}
|
||||
|
||||
const ClassName = {
|
||||
FADE : 'fade',
|
||||
SHOW : 'show'
|
||||
}
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
|
||||
const Selector = {
|
||||
TITLE : '.popover-header',
|
||||
CONTENT : '.popover-body'
|
||||
}
|
||||
const SELECTOR_TITLE = '.popover-header'
|
||||
const SELECTOR_CONTENT = '.popover-body'
|
||||
|
||||
const Event = {
|
||||
HIDE : `hide${EVENT_KEY}`,
|
||||
@@ -117,14 +113,14 @@ class Popover extends Tooltip {
|
||||
const $tip = $(this.getTipElement())
|
||||
|
||||
// We use append for html objects to maintain js events
|
||||
this.setElementContent($tip.find(Selector.TITLE), this.getTitle())
|
||||
this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle())
|
||||
let content = this._getContent()
|
||||
if (typeof content === 'function') {
|
||||
content = content.call(this.element)
|
||||
}
|
||||
this.setElementContent($tip.find(Selector.CONTENT), content)
|
||||
this.setElementContent($tip.find(SELECTOR_CONTENT), content)
|
||||
|
||||
$tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
|
||||
$tip.removeClass(`${CLASS_NAME_FADE} ${CLASS_NAME_SHOW}`)
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
+45
-51
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'scrollspy'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.scrollspy'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@@ -33,34 +33,24 @@ const DefaultType = {
|
||||
target : '(string|element)'
|
||||
}
|
||||
|
||||
const Event = {
|
||||
ACTIVATE : `activate${EVENT_KEY}`,
|
||||
SCROLL : `scroll${EVENT_KEY}`,
|
||||
LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`
|
||||
}
|
||||
const EVENT_ACTIVATE = `activate${EVENT_KEY}`
|
||||
const EVENT_SCROLL = `scroll${EVENT_KEY}`
|
||||
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const ClassName = {
|
||||
DROPDOWN_ITEM : 'dropdown-item',
|
||||
DROPDOWN_MENU : 'dropdown-menu',
|
||||
ACTIVE : 'active'
|
||||
}
|
||||
const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'
|
||||
const CLASS_NAME_ACTIVE = 'active'
|
||||
|
||||
const Selector = {
|
||||
DATA_SPY : '[data-spy="scroll"]',
|
||||
ACTIVE : '.active',
|
||||
NAV_LIST_GROUP : '.nav, .list-group',
|
||||
NAV_LINKS : '.nav-link',
|
||||
NAV_ITEMS : '.nav-item',
|
||||
LIST_ITEMS : '.list-group-item',
|
||||
DROPDOWN : '.dropdown',
|
||||
DROPDOWN_ITEMS : '.dropdown-item',
|
||||
DROPDOWN_TOGGLE : '.dropdown-toggle'
|
||||
}
|
||||
const SELECTOR_DATA_SPY = '[data-spy="scroll"]'
|
||||
const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'
|
||||
const SELECTOR_NAV_LINKS = '.nav-link'
|
||||
const SELECTOR_NAV_ITEMS = '.nav-item'
|
||||
const SELECTOR_LIST_ITEMS = '.list-group-item'
|
||||
const SELECTOR_DROPDOWN = '.dropdown'
|
||||
const SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'
|
||||
const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'
|
||||
|
||||
const OffsetMethod = {
|
||||
OFFSET : 'offset',
|
||||
POSITION : 'position'
|
||||
}
|
||||
const METHOD_OFFSET = 'offset'
|
||||
const METHOD_POSITION = 'position'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -73,15 +63,15 @@ class ScrollSpy {
|
||||
this._element = element
|
||||
this._scrollElement = element.tagName === 'BODY' ? window : element
|
||||
this._config = this._getConfig(config)
|
||||
this._selector = `${this._config.target} ${Selector.NAV_LINKS},` +
|
||||
`${this._config.target} ${Selector.LIST_ITEMS},` +
|
||||
`${this._config.target} ${Selector.DROPDOWN_ITEMS}`
|
||||
this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS},` +
|
||||
`${this._config.target} ${SELECTOR_LIST_ITEMS},` +
|
||||
`${this._config.target} ${SELECTOR_DROPDOWN_ITEMS}`
|
||||
this._offsets = []
|
||||
this._targets = []
|
||||
this._activeTarget = null
|
||||
this._scrollHeight = 0
|
||||
|
||||
$(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))
|
||||
$(this._scrollElement).on(EVENT_SCROLL, (event) => this._process(event))
|
||||
|
||||
this.refresh()
|
||||
this._process()
|
||||
@@ -101,12 +91,12 @@ class ScrollSpy {
|
||||
|
||||
refresh() {
|
||||
const autoMethod = this._scrollElement === this._scrollElement.window
|
||||
? OffsetMethod.OFFSET : OffsetMethod.POSITION
|
||||
? METHOD_OFFSET : METHOD_POSITION
|
||||
|
||||
const offsetMethod = this._config.method === 'auto'
|
||||
? autoMethod : this._config.method
|
||||
|
||||
const offsetBase = offsetMethod === OffsetMethod.POSITION
|
||||
const offsetBase = offsetMethod === METHOD_POSITION
|
||||
? this._getScrollTop() : 0
|
||||
|
||||
this._offsets = []
|
||||
@@ -167,7 +157,7 @@ class ScrollSpy {
|
||||
...typeof config === 'object' && config ? config : {}
|
||||
}
|
||||
|
||||
if (typeof config.target !== 'string') {
|
||||
if (typeof config.target !== 'string' && Util.isElement(config.target)) {
|
||||
let id = $(config.target).attr('id')
|
||||
if (!id) {
|
||||
id = Util.getUID(NAME)
|
||||
@@ -201,9 +191,7 @@ class ScrollSpy {
|
||||
_process() {
|
||||
const scrollTop = this._getScrollTop() + this._config.offset
|
||||
const scrollHeight = this._getScrollHeight()
|
||||
const maxScroll = this._config.offset +
|
||||
scrollHeight -
|
||||
this._getOffsetHeight()
|
||||
const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight()
|
||||
|
||||
if (this._scrollHeight !== scrollHeight) {
|
||||
this.refresh()
|
||||
@@ -224,8 +212,7 @@ class ScrollSpy {
|
||||
return
|
||||
}
|
||||
|
||||
const offsetLength = this._offsets.length
|
||||
for (let i = offsetLength; i--;) {
|
||||
for (let i = this._offsets.length; i--;) {
|
||||
const isActiveTarget = this._activeTarget !== this._targets[i] &&
|
||||
scrollTop >= this._offsets[i] &&
|
||||
(typeof this._offsets[i + 1] === 'undefined' ||
|
||||
@@ -248,28 +235,35 @@ class ScrollSpy {
|
||||
|
||||
const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))
|
||||
|
||||
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
|
||||
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)
|
||||
$link.addClass(ClassName.ACTIVE)
|
||||
if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
|
||||
$link.closest(SELECTOR_DROPDOWN)
|
||||
.find(SELECTOR_DROPDOWN_TOGGLE)
|
||||
.addClass(CLASS_NAME_ACTIVE)
|
||||
$link.addClass(CLASS_NAME_ACTIVE)
|
||||
} else {
|
||||
// Set triggered link as active
|
||||
$link.addClass(ClassName.ACTIVE)
|
||||
$link.addClass(CLASS_NAME_ACTIVE)
|
||||
// Set triggered links parents as active
|
||||
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
||||
$link.parents(Selector.NAV_LIST_GROUP).prev(`${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`).addClass(ClassName.ACTIVE)
|
||||
$link.parents(SELECTOR_NAV_LIST_GROUP)
|
||||
.prev(`${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`)
|
||||
.addClass(CLASS_NAME_ACTIVE)
|
||||
// Handle special case when .nav-link is inside .nav-item
|
||||
$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE)
|
||||
$link.parents(SELECTOR_NAV_LIST_GROUP)
|
||||
.prev(SELECTOR_NAV_ITEMS)
|
||||
.children(SELECTOR_NAV_LINKS)
|
||||
.addClass(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
|
||||
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
||||
$(this._scrollElement).trigger(EVENT_ACTIVATE, {
|
||||
relatedTarget: target
|
||||
})
|
||||
}
|
||||
|
||||
_clear() {
|
||||
[].slice.call(document.querySelectorAll(this._selector))
|
||||
.filter((node) => node.classList.contains(ClassName.ACTIVE))
|
||||
.forEach((node) => node.classList.remove(ClassName.ACTIVE))
|
||||
.filter((node) => node.classList.contains(CLASS_NAME_ACTIVE))
|
||||
.forEach((node) => node.classList.remove(CLASS_NAME_ACTIVE))
|
||||
}
|
||||
|
||||
// Static
|
||||
@@ -300,8 +294,8 @@ class ScrollSpy {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$(window).on(Event.LOAD_DATA_API, () => {
|
||||
const scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY))
|
||||
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||
const scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY))
|
||||
const scrollSpysLength = scrollSpys.length
|
||||
|
||||
for (let i = scrollSpysLength; i--;) {
|
||||
|
||||
+43
-49
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,37 +15,31 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'tab'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.tab'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
|
||||
const Event = {
|
||||
HIDE : `hide${EVENT_KEY}`,
|
||||
HIDDEN : `hidden${EVENT_KEY}`,
|
||||
SHOW : `show${EVENT_KEY}`,
|
||||
SHOWN : `shown${EVENT_KEY}`,
|
||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
}
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const ClassName = {
|
||||
DROPDOWN_MENU : 'dropdown-menu',
|
||||
ACTIVE : 'active',
|
||||
DISABLED : 'disabled',
|
||||
FADE : 'fade',
|
||||
SHOW : 'show'
|
||||
}
|
||||
const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'
|
||||
const CLASS_NAME_ACTIVE = 'active'
|
||||
const CLASS_NAME_DISABLED = 'disabled'
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
|
||||
const Selector = {
|
||||
DROPDOWN : '.dropdown',
|
||||
NAV_LIST_GROUP : '.nav, .list-group',
|
||||
ACTIVE : '.active',
|
||||
ACTIVE_UL : '> li > .active',
|
||||
DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
|
||||
DROPDOWN_TOGGLE : '.dropdown-toggle',
|
||||
DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active'
|
||||
}
|
||||
const SELECTOR_DROPDOWN = '.dropdown'
|
||||
const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'
|
||||
const SELECTOR_ACTIVE = '.active'
|
||||
const SELECTOR_ACTIVE_UL = '> li > .active'
|
||||
const SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'
|
||||
const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'
|
||||
const SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -69,27 +63,27 @@ class Tab {
|
||||
show() {
|
||||
if (this._element.parentNode &&
|
||||
this._element.parentNode.nodeType === Node.ELEMENT_NODE &&
|
||||
$(this._element).hasClass(ClassName.ACTIVE) ||
|
||||
$(this._element).hasClass(ClassName.DISABLED)) {
|
||||
$(this._element).hasClass(CLASS_NAME_ACTIVE) ||
|
||||
$(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return
|
||||
}
|
||||
|
||||
let target
|
||||
let previous
|
||||
const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]
|
||||
const listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]
|
||||
const selector = Util.getSelectorFromElement(this._element)
|
||||
|
||||
if (listElement) {
|
||||
const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE
|
||||
const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE
|
||||
previous = $.makeArray($(listElement).find(itemSelector))
|
||||
previous = previous[previous.length - 1]
|
||||
}
|
||||
|
||||
const hideEvent = $.Event(Event.HIDE, {
|
||||
const hideEvent = $.Event(EVENT_HIDE, {
|
||||
relatedTarget: this._element
|
||||
})
|
||||
|
||||
const showEvent = $.Event(Event.SHOW, {
|
||||
const showEvent = $.Event(EVENT_SHOW, {
|
||||
relatedTarget: previous
|
||||
})
|
||||
|
||||
@@ -114,11 +108,11 @@ class Tab {
|
||||
)
|
||||
|
||||
const complete = () => {
|
||||
const hiddenEvent = $.Event(Event.HIDDEN, {
|
||||
const hiddenEvent = $.Event(EVENT_HIDDEN, {
|
||||
relatedTarget: this._element
|
||||
})
|
||||
|
||||
const shownEvent = $.Event(Event.SHOWN, {
|
||||
const shownEvent = $.Event(EVENT_SHOWN, {
|
||||
relatedTarget: previous
|
||||
})
|
||||
|
||||
@@ -142,11 +136,11 @@ class Tab {
|
||||
|
||||
_activate(element, container, callback) {
|
||||
const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL')
|
||||
? $(container).find(Selector.ACTIVE_UL)
|
||||
: $(container).children(Selector.ACTIVE)
|
||||
? $(container).find(SELECTOR_ACTIVE_UL)
|
||||
: $(container).children(SELECTOR_ACTIVE)
|
||||
|
||||
const active = activeElements[0]
|
||||
const isTransitioning = callback && (active && $(active).hasClass(ClassName.FADE))
|
||||
const isTransitioning = callback && (active && $(active).hasClass(CLASS_NAME_FADE))
|
||||
const complete = () => this._transitionComplete(
|
||||
element,
|
||||
active,
|
||||
@@ -157,7 +151,7 @@ class Tab {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(active)
|
||||
|
||||
$(active)
|
||||
.removeClass(ClassName.SHOW)
|
||||
.removeClass(CLASS_NAME_SHOW)
|
||||
.one(Util.TRANSITION_END, complete)
|
||||
.emulateTransitionEnd(transitionDuration)
|
||||
} else {
|
||||
@@ -167,14 +161,14 @@ class Tab {
|
||||
|
||||
_transitionComplete(element, active, callback) {
|
||||
if (active) {
|
||||
$(active).removeClass(ClassName.ACTIVE)
|
||||
$(active).removeClass(CLASS_NAME_ACTIVE)
|
||||
|
||||
const dropdownChild = $(active.parentNode).find(
|
||||
Selector.DROPDOWN_ACTIVE_CHILD
|
||||
SELECTOR_DROPDOWN_ACTIVE_CHILD
|
||||
)[0]
|
||||
|
||||
if (dropdownChild) {
|
||||
$(dropdownChild).removeClass(ClassName.ACTIVE)
|
||||
$(dropdownChild).removeClass(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
|
||||
if (active.getAttribute('role') === 'tab') {
|
||||
@@ -182,24 +176,24 @@ class Tab {
|
||||
}
|
||||
}
|
||||
|
||||
$(element).addClass(ClassName.ACTIVE)
|
||||
$(element).addClass(CLASS_NAME_ACTIVE)
|
||||
if (element.getAttribute('role') === 'tab') {
|
||||
element.setAttribute('aria-selected', true)
|
||||
}
|
||||
|
||||
Util.reflow(element)
|
||||
|
||||
if (element.classList.contains(ClassName.FADE)) {
|
||||
element.classList.add(ClassName.SHOW)
|
||||
if (element.classList.contains(CLASS_NAME_FADE)) {
|
||||
element.classList.add(CLASS_NAME_SHOW)
|
||||
}
|
||||
|
||||
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
||||
const dropdownElement = $(element).closest(Selector.DROPDOWN)[0]
|
||||
if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
|
||||
const dropdownElement = $(element).closest(SELECTOR_DROPDOWN)[0]
|
||||
|
||||
if (dropdownElement) {
|
||||
const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE))
|
||||
const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE))
|
||||
|
||||
$(dropdownToggleList).addClass(ClassName.ACTIVE)
|
||||
$(dropdownToggleList).addClass(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
|
||||
element.setAttribute('aria-expanded', true)
|
||||
@@ -239,7 +233,7 @@ class Tab {
|
||||
*/
|
||||
|
||||
$(document)
|
||||
.on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
event.preventDefault()
|
||||
Tab._jQueryInterface.call($(this), 'show')
|
||||
})
|
||||
|
||||
+52
-49
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,25 +15,21 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'toast'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.toast'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
|
||||
const Event = {
|
||||
CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,
|
||||
HIDE : `hide${EVENT_KEY}`,
|
||||
HIDDEN : `hidden${EVENT_KEY}`,
|
||||
SHOW : `show${EVENT_KEY}`,
|
||||
SHOWN : `shown${EVENT_KEY}`
|
||||
}
|
||||
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||
|
||||
const ClassName = {
|
||||
FADE : 'fade',
|
||||
HIDE : 'hide',
|
||||
SHOW : 'show',
|
||||
SHOWING : 'showing'
|
||||
}
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_HIDE = 'hide'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_SHOWING = 'showing'
|
||||
|
||||
const DefaultType = {
|
||||
animation : 'boolean',
|
||||
@@ -47,9 +43,7 @@ const Default = {
|
||||
delay : 500
|
||||
}
|
||||
|
||||
const Selector = {
|
||||
DATA_DISMISS : '[data-dismiss="toast"]'
|
||||
}
|
||||
const SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -82,25 +76,35 @@ class Toast {
|
||||
// Public
|
||||
|
||||
show() {
|
||||
$(this._element).trigger(Event.SHOW)
|
||||
const showEvent = $.Event(EVENT_SHOW)
|
||||
|
||||
$(this._element).trigger(showEvent)
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return
|
||||
}
|
||||
|
||||
this._clearTimeout()
|
||||
|
||||
if (this._config.animation) {
|
||||
this._element.classList.add(ClassName.FADE)
|
||||
this._element.classList.add(CLASS_NAME_FADE)
|
||||
}
|
||||
|
||||
const complete = () => {
|
||||
this._element.classList.remove(ClassName.SHOWING)
|
||||
this._element.classList.add(ClassName.SHOW)
|
||||
this._element.classList.remove(CLASS_NAME_SHOWING)
|
||||
this._element.classList.add(CLASS_NAME_SHOW)
|
||||
|
||||
$(this._element).trigger(Event.SHOWN)
|
||||
$(this._element).trigger(EVENT_SHOWN)
|
||||
|
||||
if (this._config.autohide) {
|
||||
this.hide()
|
||||
this._timeout = setTimeout(() => {
|
||||
this.hide()
|
||||
}, this._config.delay)
|
||||
}
|
||||
}
|
||||
|
||||
this._element.classList.remove(ClassName.HIDE)
|
||||
this._element.classList.add(ClassName.SHOWING)
|
||||
this._element.classList.remove(CLASS_NAME_HIDE)
|
||||
Util.reflow(this._element)
|
||||
this._element.classList.add(CLASS_NAME_SHOWING)
|
||||
if (this._config.animation) {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||
|
||||
@@ -112,31 +116,29 @@ class Toast {
|
||||
}
|
||||
}
|
||||
|
||||
hide(withoutTimeout) {
|
||||
if (!this._element.classList.contains(ClassName.SHOW)) {
|
||||
hide() {
|
||||
if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return
|
||||
}
|
||||
|
||||
$(this._element).trigger(Event.HIDE)
|
||||
const hideEvent = $.Event(EVENT_HIDE)
|
||||
|
||||
if (withoutTimeout) {
|
||||
this._close()
|
||||
} else {
|
||||
this._timeout = setTimeout(() => {
|
||||
this._close()
|
||||
}, this._config.delay)
|
||||
$(this._element).trigger(hideEvent)
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
return
|
||||
}
|
||||
|
||||
this._close()
|
||||
}
|
||||
|
||||
dispose() {
|
||||
clearTimeout(this._timeout)
|
||||
this._timeout = null
|
||||
this._clearTimeout()
|
||||
|
||||
if (this._element.classList.contains(ClassName.SHOW)) {
|
||||
this._element.classList.remove(ClassName.SHOW)
|
||||
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
this._element.classList.remove(CLASS_NAME_SHOW)
|
||||
}
|
||||
|
||||
$(this._element).off(Event.CLICK_DISMISS)
|
||||
$(this._element).off(EVENT_CLICK_DISMISS)
|
||||
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
this._element = null
|
||||
@@ -162,20 +164,16 @@ class Toast {
|
||||
}
|
||||
|
||||
_setListeners() {
|
||||
$(this._element).on(
|
||||
Event.CLICK_DISMISS,
|
||||
Selector.DATA_DISMISS,
|
||||
() => this.hide(true)
|
||||
)
|
||||
$(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide())
|
||||
}
|
||||
|
||||
_close() {
|
||||
const complete = () => {
|
||||
this._element.classList.add(ClassName.HIDE)
|
||||
$(this._element).trigger(Event.HIDDEN)
|
||||
this._element.classList.add(CLASS_NAME_HIDE)
|
||||
$(this._element).trigger(EVENT_HIDDEN)
|
||||
}
|
||||
|
||||
this._element.classList.remove(ClassName.SHOW)
|
||||
this._element.classList.remove(CLASS_NAME_SHOW)
|
||||
if (this._config.animation) {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||
|
||||
@@ -187,6 +185,11 @@ class Toast {
|
||||
}
|
||||
}
|
||||
|
||||
_clearTimeout() {
|
||||
clearTimeout(this._timeout)
|
||||
this._timeout = null
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): tools/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): tools/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ export const DefaultWhitelist = {
|
||||
h5: [],
|
||||
h6: [],
|
||||
i: [],
|
||||
img: ['src', 'alt', 'title', 'width', 'height'],
|
||||
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
|
||||
li: [],
|
||||
ol: [],
|
||||
p: [],
|
||||
@@ -57,14 +57,14 @@ export const DefaultWhitelist = {
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
|
||||
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi
|
||||
|
||||
/**
|
||||
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
|
||||
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i
|
||||
|
||||
function allowedAttribute(attr, allowedAttributeList) {
|
||||
const attrName = attr.nodeName.toLowerCase()
|
||||
@@ -80,7 +80,7 @@ function allowedAttribute(attr, allowedAttributeList) {
|
||||
const regExp = allowedAttributeList.filter((attrRegex) => attrRegex instanceof RegExp)
|
||||
|
||||
// Check if a regular expression validates the attribute.
|
||||
for (let i = 0, l = regExp.length; i < l; i++) {
|
||||
for (let i = 0, len = regExp.length; i < len; i++) {
|
||||
if (attrName.match(regExp[i])) {
|
||||
return true
|
||||
}
|
||||
|
||||
+83
-96
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): tooltip.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): tooltip.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@ import Util from './util'
|
||||
*/
|
||||
|
||||
const NAME = 'tooltip'
|
||||
const VERSION = '4.3.1'
|
||||
const VERSION = '4.5.2'
|
||||
const DATA_KEY = 'bs.tooltip'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
@@ -43,7 +43,8 @@ const DefaultType = {
|
||||
boundary : '(string|element)',
|
||||
sanitize : 'boolean',
|
||||
sanitizeFn : '(null|function)',
|
||||
whiteList : 'object'
|
||||
whiteList : 'object',
|
||||
popperConfig : '(null|object)'
|
||||
}
|
||||
|
||||
const AttachmentMap = {
|
||||
@@ -71,13 +72,12 @@ const Default = {
|
||||
boundary : 'scrollParent',
|
||||
sanitize : true,
|
||||
sanitizeFn : null,
|
||||
whiteList : DefaultWhitelist
|
||||
whiteList : DefaultWhitelist,
|
||||
popperConfig : null
|
||||
}
|
||||
|
||||
const HoverState = {
|
||||
SHOW : 'show',
|
||||
OUT : 'out'
|
||||
}
|
||||
const HOVER_STATE_SHOW = 'show'
|
||||
const HOVER_STATE_OUT = 'out'
|
||||
|
||||
const Event = {
|
||||
HIDE : `hide${EVENT_KEY}`,
|
||||
@@ -92,24 +92,16 @@ const Event = {
|
||||
MOUSELEAVE : `mouseleave${EVENT_KEY}`
|
||||
}
|
||||
|
||||
const ClassName = {
|
||||
FADE : 'fade',
|
||||
SHOW : 'show'
|
||||
}
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
|
||||
const Selector = {
|
||||
TOOLTIP : '.tooltip',
|
||||
TOOLTIP_INNER : '.tooltip-inner',
|
||||
ARROW : '.arrow'
|
||||
}
|
||||
|
||||
const Trigger = {
|
||||
HOVER : 'hover',
|
||||
FOCUS : 'focus',
|
||||
CLICK : 'click',
|
||||
MANUAL : 'manual'
|
||||
}
|
||||
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'
|
||||
const SELECTOR_ARROW = '.arrow'
|
||||
|
||||
const TRIGGER_HOVER = 'hover'
|
||||
const TRIGGER_FOCUS = 'focus'
|
||||
const TRIGGER_CLICK = 'click'
|
||||
const TRIGGER_MANUAL = 'manual'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -119,10 +111,6 @@ const Trigger = {
|
||||
|
||||
class Tooltip {
|
||||
constructor(element, config) {
|
||||
/**
|
||||
* Check for Popper dependency
|
||||
* Popper - https://popper.js.org
|
||||
*/
|
||||
if (typeof Popper === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)')
|
||||
}
|
||||
@@ -211,7 +199,7 @@ class Tooltip {
|
||||
context._leave(null, context)
|
||||
}
|
||||
} else {
|
||||
if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
|
||||
if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
|
||||
this._leave(null, this)
|
||||
return
|
||||
}
|
||||
@@ -226,7 +214,7 @@ class Tooltip {
|
||||
$.removeData(this.element, this.constructor.DATA_KEY)
|
||||
|
||||
$(this.element).off(this.constructor.EVENT_KEY)
|
||||
$(this.element).closest('.modal').off('hide.bs.modal')
|
||||
$(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler)
|
||||
|
||||
if (this.tip) {
|
||||
$(this.tip).remove()
|
||||
@@ -236,7 +224,7 @@ class Tooltip {
|
||||
this._timeout = null
|
||||
this._hoverState = null
|
||||
this._activeTrigger = null
|
||||
if (this._popper !== null) {
|
||||
if (this._popper) {
|
||||
this._popper.destroy()
|
||||
}
|
||||
|
||||
@@ -274,7 +262,7 @@ class Tooltip {
|
||||
this.setContent()
|
||||
|
||||
if (this.config.animation) {
|
||||
$(tip).addClass(ClassName.FADE)
|
||||
$(tip).addClass(CLASS_NAME_FADE)
|
||||
}
|
||||
|
||||
const placement = typeof this.config.placement === 'function'
|
||||
@@ -293,29 +281,9 @@ class Tooltip {
|
||||
|
||||
$(this.element).trigger(this.constructor.Event.INSERTED)
|
||||
|
||||
this._popper = new Popper(this.element, tip, {
|
||||
placement: attachment,
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
behavior: this.config.fallbackPlacement
|
||||
},
|
||||
arrow: {
|
||||
element: Selector.ARROW
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this.config.boundary
|
||||
}
|
||||
},
|
||||
onCreate: (data) => {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
this._handlePopperPlacementChange(data)
|
||||
}
|
||||
},
|
||||
onUpdate: (data) => this._handlePopperPlacementChange(data)
|
||||
})
|
||||
this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment))
|
||||
|
||||
$(tip).addClass(ClassName.SHOW)
|
||||
$(tip).addClass(CLASS_NAME_SHOW)
|
||||
|
||||
// If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
@@ -334,12 +302,12 @@ class Tooltip {
|
||||
|
||||
$(this.element).trigger(this.constructor.Event.SHOWN)
|
||||
|
||||
if (prevHoverState === HoverState.OUT) {
|
||||
if (prevHoverState === HOVER_STATE_OUT) {
|
||||
this._leave(null, this)
|
||||
}
|
||||
}
|
||||
|
||||
if ($(this.tip).hasClass(ClassName.FADE)) {
|
||||
if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(this.tip)
|
||||
|
||||
$(this.tip)
|
||||
@@ -355,7 +323,7 @@ class Tooltip {
|
||||
const tip = this.getTipElement()
|
||||
const hideEvent = $.Event(this.constructor.Event.HIDE)
|
||||
const complete = () => {
|
||||
if (this._hoverState !== HoverState.SHOW && tip.parentNode) {
|
||||
if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
tip.parentNode.removeChild(tip)
|
||||
}
|
||||
|
||||
@@ -377,7 +345,7 @@ class Tooltip {
|
||||
return
|
||||
}
|
||||
|
||||
$(tip).removeClass(ClassName.SHOW)
|
||||
$(tip).removeClass(CLASS_NAME_SHOW)
|
||||
|
||||
// If this is a touch-enabled device we remove the extra
|
||||
// empty mouseover listeners we added for iOS support
|
||||
@@ -385,11 +353,11 @@ class Tooltip {
|
||||
$(document.body).children().off('mouseover', null, $.noop)
|
||||
}
|
||||
|
||||
this._activeTrigger[Trigger.CLICK] = false
|
||||
this._activeTrigger[Trigger.FOCUS] = false
|
||||
this._activeTrigger[Trigger.HOVER] = false
|
||||
this._activeTrigger[TRIGGER_CLICK] = false
|
||||
this._activeTrigger[TRIGGER_FOCUS] = false
|
||||
this._activeTrigger[TRIGGER_HOVER] = false
|
||||
|
||||
if ($(this.tip).hasClass(ClassName.FADE)) {
|
||||
if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(tip)
|
||||
|
||||
$(tip)
|
||||
@@ -425,8 +393,8 @@ class Tooltip {
|
||||
|
||||
setContent() {
|
||||
const tip = this.getTipElement()
|
||||
this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle())
|
||||
$(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
|
||||
this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle())
|
||||
$(tip).removeClass(`${CLASS_NAME_FADE} ${CLASS_NAME_SHOW}`)
|
||||
}
|
||||
|
||||
setElementContent($element, content) {
|
||||
@@ -468,6 +436,35 @@ class Tooltip {
|
||||
|
||||
// Private
|
||||
|
||||
_getPopperConfig(attachment) {
|
||||
const defaultBsConfig = {
|
||||
placement: attachment,
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
behavior: this.config.fallbackPlacement
|
||||
},
|
||||
arrow: {
|
||||
element: SELECTOR_ARROW
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this.config.boundary
|
||||
}
|
||||
},
|
||||
onCreate: (data) => {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
this._handlePopperPlacementChange(data)
|
||||
}
|
||||
},
|
||||
onUpdate: (data) => this._handlePopperPlacementChange(data)
|
||||
}
|
||||
|
||||
return {
|
||||
...defaultBsConfig,
|
||||
...this.config.popperConfig
|
||||
}
|
||||
}
|
||||
|
||||
_getOffset() {
|
||||
const offset = {}
|
||||
|
||||
@@ -513,36 +510,27 @@ class Tooltip {
|
||||
this.config.selector,
|
||||
(event) => this.toggle(event)
|
||||
)
|
||||
} else if (trigger !== Trigger.MANUAL) {
|
||||
const eventIn = trigger === Trigger.HOVER
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
const eventIn = trigger === TRIGGER_HOVER
|
||||
? this.constructor.Event.MOUSEENTER
|
||||
: this.constructor.Event.FOCUSIN
|
||||
const eventOut = trigger === Trigger.HOVER
|
||||
const eventOut = trigger === TRIGGER_HOVER
|
||||
? this.constructor.Event.MOUSELEAVE
|
||||
: this.constructor.Event.FOCUSOUT
|
||||
|
||||
$(this.element)
|
||||
.on(
|
||||
eventIn,
|
||||
this.config.selector,
|
||||
(event) => this._enter(event)
|
||||
)
|
||||
.on(
|
||||
eventOut,
|
||||
this.config.selector,
|
||||
(event) => this._leave(event)
|
||||
)
|
||||
.on(eventIn, this.config.selector, (event) => this._enter(event))
|
||||
.on(eventOut, this.config.selector, (event) => this._leave(event))
|
||||
}
|
||||
})
|
||||
|
||||
$(this.element).closest('.modal').on(
|
||||
'hide.bs.modal',
|
||||
() => {
|
||||
if (this.element) {
|
||||
this.hide()
|
||||
}
|
||||
this._hideModalHandler = () => {
|
||||
if (this.element) {
|
||||
this.hide()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
$(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler)
|
||||
|
||||
if (this.config.selector) {
|
||||
this.config = {
|
||||
@@ -582,18 +570,18 @@ class Tooltip {
|
||||
|
||||
if (event) {
|
||||
context._activeTrigger[
|
||||
event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER
|
||||
event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER
|
||||
] = true
|
||||
}
|
||||
|
||||
if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
|
||||
context._hoverState = HoverState.SHOW
|
||||
if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
|
||||
context._hoverState = HOVER_STATE_SHOW
|
||||
return
|
||||
}
|
||||
|
||||
clearTimeout(context._timeout)
|
||||
|
||||
context._hoverState = HoverState.SHOW
|
||||
context._hoverState = HOVER_STATE_SHOW
|
||||
|
||||
if (!context.config.delay || !context.config.delay.show) {
|
||||
context.show()
|
||||
@@ -601,7 +589,7 @@ class Tooltip {
|
||||
}
|
||||
|
||||
context._timeout = setTimeout(() => {
|
||||
if (context._hoverState === HoverState.SHOW) {
|
||||
if (context._hoverState === HOVER_STATE_SHOW) {
|
||||
context.show()
|
||||
}
|
||||
}, context.config.delay.show)
|
||||
@@ -621,7 +609,7 @@ class Tooltip {
|
||||
|
||||
if (event) {
|
||||
context._activeTrigger[
|
||||
event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER
|
||||
event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER
|
||||
] = false
|
||||
}
|
||||
|
||||
@@ -631,7 +619,7 @@ class Tooltip {
|
||||
|
||||
clearTimeout(context._timeout)
|
||||
|
||||
context._hoverState = HoverState.OUT
|
||||
context._hoverState = HOVER_STATE_OUT
|
||||
|
||||
if (!context.config.delay || !context.config.delay.hide) {
|
||||
context.hide()
|
||||
@@ -639,7 +627,7 @@ class Tooltip {
|
||||
}
|
||||
|
||||
context._timeout = setTimeout(() => {
|
||||
if (context._hoverState === HoverState.OUT) {
|
||||
if (context._hoverState === HOVER_STATE_OUT) {
|
||||
context.hide()
|
||||
}
|
||||
}, context.config.delay.hide)
|
||||
@@ -722,8 +710,7 @@ class Tooltip {
|
||||
}
|
||||
|
||||
_handlePopperPlacementChange(popperData) {
|
||||
const popperInstance = popperData.instance
|
||||
this.tip = popperInstance.popper
|
||||
this.tip = popperData.instance.popper
|
||||
this._cleanTipClass()
|
||||
this.addAttachmentClass(this._getAttachment(popperData.placement))
|
||||
}
|
||||
@@ -736,7 +723,7 @@ class Tooltip {
|
||||
return
|
||||
}
|
||||
|
||||
$(tip).removeClass(ClassName.FADE)
|
||||
$(tip).removeClass(CLASS_NAME_FADE)
|
||||
this.config.animation = false
|
||||
this.hide()
|
||||
this.show()
|
||||
|
||||
+25
-4
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): util.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.5.2): util.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,10 @@ const MILLISECONDS_MULTIPLIER = 1000
|
||||
|
||||
// Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
function toType(obj) {
|
||||
if (obj === null || typeof obj === 'undefined') {
|
||||
return `${obj}`
|
||||
}
|
||||
|
||||
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()
|
||||
}
|
||||
|
||||
@@ -30,7 +34,7 @@ function getSpecialTransitionEndEvent() {
|
||||
if ($(event.target).is(this)) {
|
||||
return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params
|
||||
}
|
||||
return undefined // eslint-disable-line no-undefined
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +67,6 @@ function setTransitionEndSupport() {
|
||||
*/
|
||||
|
||||
const Util = {
|
||||
|
||||
TRANSITION_END: 'bsTransitionEnd',
|
||||
|
||||
getUID(prefix) {
|
||||
@@ -169,9 +172,27 @@ const Util = {
|
||||
}
|
||||
|
||||
return Util.findShadowRoot(element.parentNode)
|
||||
},
|
||||
|
||||
jQueryDetection() {
|
||||
if (typeof $ === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.')
|
||||
}
|
||||
|
||||
const version = $.fn.jquery.split(' ')[0].split('.')
|
||||
const minMajor = 1
|
||||
const ltMajor = 2
|
||||
const minMinor = 9
|
||||
const minPatch = 1
|
||||
const maxMajor = 4
|
||||
|
||||
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
|
||||
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Util.jQueryDetection()
|
||||
setTransitionEndSupport()
|
||||
|
||||
export default Util
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ To run the unit test suite via a real web browser, open `index.html` in the brow
|
||||
* Each test should have a unique name clearly stating what unit is being tested.
|
||||
* Each test should test only one unit per test, although one test can include several assertions. Create multiple tests for multiple units of functionality.
|
||||
* Each test should begin with [`assert.expect`](https://api.qunitjs.com/assert/expect/) to ensure that the expected assertions are run.
|
||||
* Each test should follow the project's [JavaScript Code Guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js)
|
||||
* Each test should follow the project's [JavaScript Code Guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md#js)
|
||||
|
||||
## Code coverage
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ const browsers = {
|
||||
os: 'Windows',
|
||||
os_version: '10',
|
||||
browser: 'Edge',
|
||||
browser_version: 'latest'
|
||||
browser_version: '15'
|
||||
},
|
||||
ie11Win10: {
|
||||
base: 'BrowserStack',
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@
|
||||
'contextmenu'
|
||||
].forEach(function(eventAlias) {
|
||||
$.fn[eventAlias] = function() {
|
||||
throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js')
|
||||
throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md#js')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Hello, world!</h1>
|
||||
<div class="col-12">
|
||||
<div class="mt-5 mb-3">
|
||||
<div class="mt-5">
|
||||
<div class="mb-3">
|
||||
<span>Util.getUID: </span>
|
||||
<span id="resultUID"></span>
|
||||
</div>
|
||||
@@ -29,21 +29,21 @@
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item">
|
||||
<img class="d-block w-100" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826cb%20text%20%7B%20fill%3A%23555%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826cb%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22285.921875%22%20y%3D%22217.7%22%3EFirst%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
|
||||
<img class="d-block w-100" alt="First slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826cb%20text%20%7B%20fill%3A%23555%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826cb%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22285.921875%22%20y%3D%22217.7%22%3EFirst%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h5>First slide label</h5>
|
||||
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item active">
|
||||
<img class="d-block w-100" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826ce%20text%20%7B%20fill%3A%23444%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826ce%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23666%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22247.3203125%22%20y%3D%22217.7%22%3ESecond%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
|
||||
<img class="d-block w-100" alt="Second slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826ce%20text%20%7B%20fill%3A%23444%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826ce%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23666%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22247.3203125%22%20y%3D%22217.7%22%3ESecond%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h5>Second slide label</h5>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img class="d-block w-100" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826cf%20text%20%7B%20fill%3A%23333%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826cf%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23555%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22277%22%20y%3D%22217.7%22%3EThird%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
|
||||
<img class="d-block w-100" alt="Third slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826cf%20text%20%7B%20fill%3A%23333%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826cf%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23555%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22277%22%20y%3D%22217.7%22%3EThird%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h5>Third slide label</h5>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-env node */
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve')
|
||||
const commonjs = require('rollup-plugin-commonjs')
|
||||
const babel = require('rollup-plugin-babel')
|
||||
const commonjs = require('@rollup/plugin-commonjs')
|
||||
const { babel } = require('@rollup/plugin-babel')
|
||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||
|
||||
module.exports = {
|
||||
input: 'js/tests/integration/bundle.js',
|
||||
@@ -11,10 +11,11 @@ module.exports = {
|
||||
format: 'iife'
|
||||
},
|
||||
plugins: [
|
||||
resolve(),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: 'node_modules/**'
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'bundled'
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user