Compare commits
375 Commits
v4.5.0
..
v4-dev-nes
| Author | SHA1 | Date | |
|---|---|---|---|
| 5816fae803 | |||
| b04b43619d | |||
| 00da6cc06b | |||
| 1b8b70b067 | |||
| a8f4adc864 | |||
| 6bbc12ba12 | |||
| 26f225831a | |||
| fa4fbc8798 | |||
| 5aa7f72689 | |||
| e5643aaa89 | |||
| 82a1f334cf | |||
| 4954ea15fa | |||
| fdf1c372d4 | |||
| 35be9e74af | |||
| def158dc10 | |||
| 6fd203060b | |||
| d136302a57 | |||
| b4c994d296 | |||
| 4e951f8bc9 | |||
| 8274bf25d0 | |||
| 4444f090b6 | |||
| 5968ef23ca | |||
| 261b418798 | |||
| c043a75d53 | |||
| c1b42e3538 | |||
| 7d57d9a68b | |||
| e4dc2e91a5 | |||
| 6a500849de | |||
| d9481ee054 | |||
| d36b1a46cf | |||
| 7613953998 | |||
| 0090af6a9c | |||
| bae047fcee | |||
| 3b63d509de | |||
| 5299abeeab | |||
| 349a373ff6 | |||
| 69c5dc8934 | |||
| 8469f695f9 | |||
| bee3847e6d | |||
| a3d14bb7b7 | |||
| 9c60983949 | |||
| f7cb3639a7 | |||
| c488b8fcc3 | |||
| 0b3796e33d | |||
| c24f751c63 | |||
| 33f37880df | |||
| 9a5a5c57aa | |||
| 7245437856 | |||
| d99c820f9c | |||
| b81ce1f9e2 | |||
| 4097441977 | |||
| e87eeb4ad6 | |||
| 043a03c95a | |||
| ef6a418535 | |||
| 3f88326815 | |||
| 41330696b9 | |||
| fc492edfa3 | |||
| fe73da982f | |||
| 4f0187c891 | |||
| 6d0fd8c3a5 | |||
| 7b3a47ee3d | |||
| e482fbb159 | |||
| 8133c3e5b2 | |||
| 44a01ec5b7 | |||
| 8ebd6d95d6 | |||
| bdab948670 | |||
| af52795501 | |||
| f6ff736a59 | |||
| 77e0855e5e | |||
| ed62ab6e41 | |||
| d4e162f4ac | |||
| 551f37aff6 | |||
| 5391ecdfde | |||
| e202996a2b | |||
| cb55e389b8 | |||
| 08a550a044 | |||
| b0cd2078f7 | |||
| 9cdfbc06ce | |||
| f9a79141be | |||
| 1db75d111b | |||
| 01036ff2ef | |||
| f4a1a35cf2 | |||
| 408252eff1 | |||
| 94b310dc6f | |||
| 8dec3d0a34 | |||
| b010a6f9f4 | |||
| 5d24fef741 | |||
| 70267da28e | |||
| 9cf31d9f8e | |||
| a6618c437b | |||
| 6c9951203c | |||
| ec986fcb57 | |||
| c272eb80bf | |||
| ca3ff6dc29 | |||
| 0ef990f18e | |||
| 6c2c14d887 | |||
| 086c0bfc25 | |||
| 538ea32cb7 | |||
| e376773ccc | |||
| c2f949c1fd | |||
| fb604bc03f | |||
| 68f6aa6780 | |||
| f61c2ed8f1 | |||
| 6ed3845f31 | |||
| 5e69eab37a | |||
| 072a0402d8 | |||
| 767856c7b8 | |||
| 4b5eb3ca51 | |||
| d967553913 | |||
| 016f8fff11 | |||
| 67f873f41a | |||
| a06c2b6706 | |||
| b58ea4a42e | |||
| 459cc246b9 | |||
| 90228a4743 | |||
| 51c8b91d91 | |||
| e16b06929a | |||
| 7365592fbe | |||
| 40da702f80 | |||
| a59d436518 | |||
| cce467616f | |||
| 58192b3cac | |||
| cf70a58149 | |||
| 6692d1ed47 | |||
| 7ad0625b8d | |||
| 8ec32eec44 | |||
| c341721439 | |||
| 23a26e12ff | |||
| bb5b5891da | |||
| 210cb72872 | |||
| 6487ba72f5 | |||
| 9c264dbea5 | |||
| 254de4cb42 | |||
| a824d09ecd | |||
| 9722106781 | |||
| 030af97fad | |||
| 29674b8426 | |||
| ce8af15ad1 | |||
| 72a9fb4624 | |||
| 2267193d8f | |||
| 17d8fba548 | |||
| 6ffb0b48e4 | |||
| 9d87bd7a30 | |||
| 9c4abcc6a1 | |||
| d2477abecd | |||
| ee282aff27 | |||
| 87e42ce7c5 | |||
| 5a17956e5e | |||
| 05a108b3d5 | |||
| ec1d745c10 | |||
| d674c33a04 | |||
| 80aefd862c | |||
| 2ed7504783 | |||
| aeccf0e270 | |||
| 17521ed43a | |||
| da458176f3 | |||
| 67c2f2c965 | |||
| e7cbb59d53 | |||
| dfe4810199 | |||
| 4e6c981f4e | |||
| 2e8f70f5a1 | |||
| 0f1069a32e | |||
| f8da510367 | |||
| 37186db5fc | |||
| 6b788acf63 | |||
| cafcca31ac | |||
| b633c2befe | |||
| 4540436f3d | |||
| 3768b6e5b6 | |||
| 264a412589 | |||
| 1141a51789 | |||
| ccee913e59 | |||
| 378f3939c8 | |||
| bb99676a8a | |||
| 9fbf50c3ce | |||
| 984aacc32f | |||
| b0e7e02ab6 | |||
| fcfd2ce4b2 | |||
| fca04236ad | |||
| 810de41bc3 | |||
| 307c08af42 | |||
| 4620b9838b | |||
| d1e0610a45 | |||
| f1b2ed93df | |||
| 4fc35bdc3c | |||
| 5db105e587 | |||
| 1897b4cd89 | |||
| 17bb67dd5b | |||
| fbfaba5bb8 | |||
| 53542dc027 | |||
| 8e59752ee1 | |||
| 22168e9b15 | |||
| 6f58383f5a | |||
| 90ad4ffc82 | |||
| b45b5e9e65 | |||
| c9876ed15b | |||
| b26768ee42 | |||
| 9260427a34 | |||
| 398ddedac7 | |||
| 57e045f0ab | |||
| 631b5d4df1 | |||
| 13486b8e27 | |||
| aed84c9430 | |||
| 7eee78c517 | |||
| bfb773d64b | |||
| 2d8c02eb10 | |||
| ffa88deb85 | |||
| 6bc18dc113 | |||
| e567b9a7ab | |||
| e5b5881f8c | |||
| 052f72d360 | |||
| 764184fc43 | |||
| b46f05a948 | |||
| ae87f8f7ce | |||
| 5fd0c239bc | |||
| 4bdaa2604f | |||
| 5795e421ac | |||
| d3cb97ad71 | |||
| c41897ca98 | |||
| 6ddedbff77 | |||
| 4bbc32dda7 | |||
| fb12b0bd6a | |||
| 45bf55e4ba | |||
| e2e6e867f8 | |||
| 49d5756f01 | |||
| 03ec5342e0 | |||
| 896e444895 | |||
| 9e9e1e61d5 | |||
| dec3d86514 | |||
| 43f7befe36 | |||
| 44d54eb578 | |||
| f1acc7f1d8 | |||
| b3aa3958da | |||
| 3063d74b86 | |||
| ecf7db731f | |||
| 39e9cced88 | |||
| 30641eb346 | |||
| bbfd22f924 | |||
| 5664e728b4 | |||
| 465135a0f8 | |||
| f808026e5b | |||
| 76d4f728a0 | |||
| 1266103171 | |||
| 3f0b15cca6 | |||
| 76958761f2 | |||
| 9a094d44ef | |||
| 71e5b7ca2b | |||
| 23cf931c7f | |||
| 09df15cc3c | |||
| 1a90b8a418 | |||
| 35de511cb3 | |||
| d8c189df59 | |||
| 5f1bc4a756 | |||
| a7d5923470 | |||
| 084795db82 | |||
| c0401ebfa0 | |||
| d29b05c775 | |||
| 4b30fe622c | |||
| efabff3a74 | |||
| 59b65a2cb8 | |||
| 5f3fa833c9 | |||
| cec8e5ddc3 | |||
| 5d310db486 | |||
| 61b5efbaf7 | |||
| a1b2071fe0 | |||
| 171da55628 | |||
| b1ae785f40 | |||
| f86149807d | |||
| a716fb03f9 | |||
| d9f4bcf6ff | |||
| c049713382 | |||
| 1b48122641 | |||
| 5d066caace | |||
| 429a84ff33 | |||
| 91d0a65243 | |||
| c437735b6c | |||
| ca68277976 | |||
| a03b2feff2 | |||
| 24572b1577 | |||
| d9b4426b07 | |||
| d9cccf476b | |||
| b25e6d5fa9 | |||
| 80fc8d9f76 | |||
| e0cd05019e | |||
| 3cd2cd25b7 | |||
| 6c051294aa | |||
| ff1d751e36 | |||
| d106b01dec | |||
| f927a95b6c | |||
| e45fbe7f72 | |||
| 16aa05752b | |||
| 34208778ba | |||
| 400364c7fd | |||
| 30c3cd45a2 | |||
| 6994dacee4 | |||
| dfefd48c34 | |||
| 31eb108811 | |||
| b31046aab3 | |||
| c86b74fe88 | |||
| be18957933 | |||
| 8acd7c9fbe | |||
| b0a0c56788 | |||
| ab0aec397e | |||
| 63b8a6ffdd | |||
| 7539cfb29c | |||
| dc2f1e68cd | |||
| 1bd1d78a78 | |||
| 3be585990c | |||
| 1c37a2ba77 | |||
| 39282bcc9d | |||
| 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 |
+2
-5
@@ -4,14 +4,11 @@ module.exports = {
|
||||
'@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' ]
|
||||
|
||||
@@ -18,32 +18,32 @@
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap.css",
|
||||
"maxSize": "25.25 kB"
|
||||
"maxSize": "26 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap.min.css",
|
||||
"maxSize": "23.25 kB"
|
||||
"maxSize": "23.75 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.bundle.js",
|
||||
"maxSize": "47.50 kB"
|
||||
"maxSize": "48 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.bundle.min.js",
|
||||
"maxSize": "21.5 kB"
|
||||
"maxSize": "21.75 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.js",
|
||||
"maxSize": "25 kB"
|
||||
"maxSize": "25.5 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.min.js",
|
||||
"maxSize": "14.75 kB"
|
||||
"maxSize": "15 kB"
|
||||
}
|
||||
],
|
||||
"ci": {
|
||||
"trackBranches": [
|
||||
"master",
|
||||
"main",
|
||||
"v4-dev"
|
||||
]
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
**/*.min.js
|
||||
**/dist/
|
||||
**/vendor/
|
||||
/_gh_pages/
|
||||
/_site/
|
||||
/js/coverage/
|
||||
/package.js
|
||||
/site/static/sw.js
|
||||
|
||||
+68
-224
@@ -1,232 +1,76 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "babel-eslint",
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"extends": ["eslint:recommended"],
|
||||
"extends": [
|
||||
"plugin:import/errors",
|
||||
"plugin:import/warnings",
|
||||
"plugin:unicorn/recommended",
|
||||
"xo",
|
||||
"xo/browser"
|
||||
],
|
||||
"rules": {
|
||||
// Possible Errors
|
||||
"no-await-in-loop": "error",
|
||||
"no-extra-parens": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-template-curly-in-string": "error",
|
||||
"valid-jsdoc": "error",
|
||||
|
||||
// Best Practices
|
||||
"accessor-pairs": "error",
|
||||
"array-callback-return": "error",
|
||||
"block-scoped-var": "error",
|
||||
"class-methods-use-this": "off",
|
||||
"complexity": "error",
|
||||
"consistent-return": "error",
|
||||
"curly": "error",
|
||||
"default-case": "error",
|
||||
"dot-location": ["error", "property"],
|
||||
"dot-notation": "error",
|
||||
"eqeqeq": "error",
|
||||
"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",
|
||||
"no-eq-null": "error",
|
||||
"no-eval": "error",
|
||||
"no-extend-native": "error",
|
||||
"no-extra-bind": "error",
|
||||
"no-extra-label": "error",
|
||||
"no-floating-decimal": "error",
|
||||
"no-implicit-coercion": "error",
|
||||
"no-implicit-globals": "error",
|
||||
"no-implied-eval": "error",
|
||||
"no-invalid-this": "off",
|
||||
"no-iterator": "error",
|
||||
"no-labels": "error",
|
||||
"no-lone-blocks": "error",
|
||||
"no-loop-func": "error",
|
||||
"no-magic-numbers": ["error", {
|
||||
"ignore": [-1, 0, 1],
|
||||
"ignoreArrayIndexes": true
|
||||
}
|
||||
],
|
||||
"no-multi-spaces": ["error", {
|
||||
"ignoreEOLComments": true,
|
||||
"exceptions": {
|
||||
"AssignmentExpression": true,
|
||||
"ArrowFunctionExpression": true,
|
||||
"CallExpression": true,
|
||||
"VariableDeclarator": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"no-multi-str": "error",
|
||||
"no-new": "error",
|
||||
"no-new-func": "error",
|
||||
"no-new-wrappers": "error",
|
||||
"no-octal-escape": "error",
|
||||
"no-param-reassign": "off",
|
||||
"no-proto": "error",
|
||||
"no-restricted-properties": "error",
|
||||
"no-return-assign": "error",
|
||||
"no-return-await": "error",
|
||||
"no-script-url": "error",
|
||||
"no-self-compare": "error",
|
||||
"no-sequences": "error",
|
||||
"no-throw-literal": "error",
|
||||
"no-unmodified-loop-condition": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-concat": "error",
|
||||
"no-useless-return": "error",
|
||||
"no-void": "error",
|
||||
"no-warning-comments": "off",
|
||||
"no-with": "error",
|
||||
"prefer-promise-reject-errors": "error",
|
||||
"radix": "error",
|
||||
"require-await": "error",
|
||||
"vars-on-top": "error",
|
||||
"wrap-iife": "error",
|
||||
"yoda": "error",
|
||||
|
||||
// Strict Mode
|
||||
"strict": "error",
|
||||
|
||||
// Variables
|
||||
"init-declarations": "off",
|
||||
"no-catch-shadow": "error",
|
||||
"no-label-var": "error",
|
||||
"no-restricted-globals": "error",
|
||||
"no-shadow": "off",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-use-before-define": "off",
|
||||
|
||||
// Node.js and CommonJS
|
||||
"callback-return": "off",
|
||||
"global-require": "error",
|
||||
"handle-callback-err": "error",
|
||||
"no-mixed-requires": "error",
|
||||
"no-new-require": "error",
|
||||
"no-path-concat": "error",
|
||||
"no-process-exit": "error",
|
||||
"no-restricted-modules": "error",
|
||||
"no-sync": "error",
|
||||
|
||||
// Stylistic Issues
|
||||
"array-bracket-spacing": "error",
|
||||
"block-spacing": "error",
|
||||
"brace-style": "error",
|
||||
"camelcase": "error",
|
||||
"arrow-body-style": "off",
|
||||
"capitalized-comments": "off",
|
||||
"comma-dangle": "error",
|
||||
"comma-spacing": "error",
|
||||
"comma-style": "error",
|
||||
"computed-property-spacing": "error",
|
||||
"consistent-this": "error",
|
||||
"eol-last": "error",
|
||||
"func-call-spacing": "error",
|
||||
"func-name-matching": "error",
|
||||
"func-names": "off",
|
||||
"func-style": ["error", "declaration"],
|
||||
"id-blacklist": "error",
|
||||
"id-length": "off",
|
||||
"id-match": "error",
|
||||
"indent": ["error", 2, { "SwitchCase": 1 }],
|
||||
"jsx-quotes": "error",
|
||||
"key-spacing": "off",
|
||||
"keyword-spacing": "error",
|
||||
"linebreak-style": ["error", "unix"],
|
||||
"line-comment-position": "off",
|
||||
"lines-around-comment": "off",
|
||||
"lines-around-directive": "error",
|
||||
"max-depth": ["error", 10],
|
||||
"max-len": "off",
|
||||
"max-lines": "off",
|
||||
"max-nested-callbacks": "error",
|
||||
"max-params": "off",
|
||||
"max-statements": "off",
|
||||
"max-statements-per-line": "error",
|
||||
"multiline-ternary": "off",
|
||||
"new-cap": ["error", { "capIsNewExceptionPattern": "$.*" }],
|
||||
"newline-after-var": "off",
|
||||
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 5 }],
|
||||
"new-parens": "error",
|
||||
"no-array-constructor": "error",
|
||||
"no-bitwise": "error",
|
||||
"no-continue": "off",
|
||||
"no-inline-comments": "off",
|
||||
"no-lonely-if": "error",
|
||||
"comma-dangle": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"indent": [
|
||||
"error",
|
||||
2,
|
||||
{
|
||||
"MemberExpression": "off",
|
||||
"SwitchCase": 1
|
||||
}
|
||||
],
|
||||
"max-params": [
|
||||
"warn",
|
||||
5
|
||||
],
|
||||
"new-cap": [
|
||||
"error",
|
||||
{
|
||||
"properties": false
|
||||
}
|
||||
],
|
||||
"no-console": "error",
|
||||
"no-mixed-operators": "off",
|
||||
"no-multi-assign": "error",
|
||||
"no-multiple-empty-lines": "error",
|
||||
"nonblock-statement-body-position": "error",
|
||||
"no-negated-condition": "off",
|
||||
"no-nested-ternary": "error",
|
||||
"no-new-object": "error",
|
||||
"no-plusplus": "off",
|
||||
"no-restricted-syntax": "error",
|
||||
"no-tabs": "error",
|
||||
"no-ternary": "off",
|
||||
"no-trailing-spaces": "error",
|
||||
"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"],
|
||||
"one-var-declaration-per-line": "error",
|
||||
"operator-assignment": "error",
|
||||
"operator-linebreak": "error",
|
||||
"padded-blocks": ["error", "never"],
|
||||
"padding-line-between-statements": "off",
|
||||
"quote-props": ["error", "as-needed"],
|
||||
"quotes": ["error", "single"],
|
||||
"require-jsdoc": "off",
|
||||
"semi": ["error", "never"],
|
||||
"semi-spacing": "error",
|
||||
"sort-keys": "off",
|
||||
"sort-vars": "error",
|
||||
"space-before-blocks": "error",
|
||||
"space-before-function-paren": ["error", {
|
||||
"anonymous": "always",
|
||||
"named": "never"
|
||||
}],
|
||||
"space-in-parens": "error",
|
||||
"space-infix-ops": "error",
|
||||
"space-unary-ops": "error",
|
||||
"spaced-comment": "error",
|
||||
"template-tag-spacing": "error",
|
||||
"unicode-bom": "error",
|
||||
"wrap-regex": "off",
|
||||
|
||||
// ECMAScript 6
|
||||
"arrow-body-style": ["error", "as-needed"],
|
||||
"arrow-parens": "error",
|
||||
"arrow-spacing": "error",
|
||||
"generator-star-spacing": "error",
|
||||
"no-confusing-arrow": "error",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-restricted-imports": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
"no-useless-constructor": "error",
|
||||
"no-useless-rename": "error",
|
||||
"no-var": "error",
|
||||
"object-shorthand": "error",
|
||||
"prefer-arrow-callback": "error",
|
||||
"prefer-const": "error",
|
||||
"prefer-destructuring": "off",
|
||||
"prefer-numeric-literals": "error",
|
||||
"prefer-rest-params": "error",
|
||||
"prefer-spread": "error",
|
||||
"prefer-template": "error",
|
||||
"rest-spread-spacing": "error",
|
||||
"sort-imports": "error",
|
||||
"symbol-description": "error",
|
||||
"template-curly-spacing": "error",
|
||||
"yield-star-spacing": "error"
|
||||
"object-curly-spacing": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"operator-linebreak": [
|
||||
"error",
|
||||
"after"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"unicorn/consistent-function-scoping": "off",
|
||||
"unicorn/explicit-length-check": "off",
|
||||
"unicorn/no-array-callback-reference": "off",
|
||||
"unicorn/no-array-for-each": "off",
|
||||
"unicorn/no-array-method-this-argument": "off",
|
||||
"unicorn/no-for-loop": "off",
|
||||
"unicorn/no-null": "off",
|
||||
"unicorn/no-unused-properties": "error",
|
||||
"unicorn/no-useless-undefined": "off",
|
||||
"unicorn/numeric-separators-style": "off",
|
||||
"unicorn/prefer-array-find": "off",
|
||||
"unicorn/prefer-array-flat": "off",
|
||||
"unicorn/prefer-dom-node-append": "off",
|
||||
"unicorn/prefer-dom-node-dataset": "off",
|
||||
"unicorn/prefer-dom-node-remove": "off",
|
||||
"unicorn/prefer-includes": "off",
|
||||
"unicorn/prefer-math-trunc": "off",
|
||||
"unicorn/prefer-module": "off",
|
||||
"unicorn/prefer-number-properties": "off",
|
||||
"unicorn/prefer-optional-catch-binding": "off",
|
||||
"unicorn/prefer-prototype-methods": "off",
|
||||
"unicorn/prefer-query-selector": "off",
|
||||
"unicorn/prefer-reflect-apply": "off",
|
||||
"unicorn/prefer-set-has": "off",
|
||||
"unicorn/prevent-abbreviations": "off"
|
||||
}
|
||||
}
|
||||
|
||||
+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
|
||||
*.scss text eol=lf
|
||||
*.sh 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
|
||||
|
||||
+23
-21
@@ -18,9 +18,9 @@ the preferred channel for [bug reports](#bug-reports), [features requests](#feat
|
||||
and [submitting pull requests](#pull-requests), but please respect the following
|
||||
restrictions:
|
||||
|
||||
* Please **do not** use the issue tracker for personal support requests. Stack
|
||||
* 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.
|
||||
[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.
|
||||
@@ -65,7 +65,7 @@ Guidelines for bug reports:
|
||||
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.
|
||||
@@ -102,12 +102,12 @@ Example:
|
||||
Sometimes bugs reported to us are actually caused by bugs in the browser(s) themselves, not bugs in Bootstrap per se.
|
||||
When feasible, we aim to report such upstream bugs to the relevant browser vendor(s), and then list them on our [Wall of Browser Bugs](https://getbootstrap.com/browser-bugs/) and [document them in MDN](https://developer.mozilla.org/en-US/docs/Web).
|
||||
|
||||
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
|
||||
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
||||
| Mozilla | Firefox | Gecko | https://bugzilla.mozilla.org/enter_bug.cgi | "Core" is normally the right product option to choose. |
|
||||
| Apple | Safari | WebKit | https://bugs.webkit.org/enter_bug.cgi?product=WebKit <br> https://bugreport.apple.com/ | In Apple's bug reporter, choose "Safari" as the product. |
|
||||
| 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/ | |
|
||||
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
|
||||
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------ | -------------------------------------------------------- |
|
||||
| Mozilla | Firefox | Gecko | https://bugzilla.mozilla.org/enter_bug.cgi | "Core" is normally the right product option to choose. |
|
||||
| Apple | Safari | WebKit | https://bugs.webkit.org/enter_bug.cgi?product=WebKit | In Apple's bug reporter, choose "Safari" as the product. |
|
||||
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | https://bugs.chromium.org/p/chromium/issues/list | Click the "New issue" button. |
|
||||
| Microsoft | Edge | Blink | https://developer.microsoft.com/en-us/microsoft-edge/ | Go to "Help > Send Feedback" from the browser |
|
||||
|
||||
|
||||
## Feature requests
|
||||
@@ -124,23 +124,25 @@ Good pull requests—patches, improvements, new features—are a fantastic
|
||||
help. They should remain focused in scope and avoid containing unrelated
|
||||
commits.
|
||||
|
||||
**Please ask first** before embarking on any significant pull request (e.g.
|
||||
**Please ask first** before embarking on any **significant** pull request (e.g.
|
||||
implementing features, refactoring code, porting to a different language),
|
||||
otherwise you risk spending a lot of time working on something that the
|
||||
project's developers might not want to merge into the project.
|
||||
project's developers might not want to merge into the project. For trivial
|
||||
things, or things that don't require a lot of your time, you can go ahead and
|
||||
make a PR.
|
||||
|
||||
Please adhere to the [coding guidelines](#code-guidelines) used throughout the
|
||||
project (indentation, accurate comments, etc.) and any other requirements
|
||||
(such as test coverage).
|
||||
|
||||
**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/src/`](https://github.com/twbs/bootstrap/tree/master/js/src) instead.
|
||||
**Do not edit `bootstrap.css` or `bootstrap.js`, and do not commit
|
||||
any dist files (`dist/` or `js/dist`).** Those files are automatically generated by our build tools. You should
|
||||
edit the 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/site/docs/` directory of the `master` branch](https://github.com/twbs/bootstrap/tree/master/site/docs).
|
||||
[the `/bootstrap/site/content/docs/` directory of the `v4-dev` branch](https://github.com/twbs/bootstrap/tree/v4-dev/site/content/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.
|
||||
|
||||
@@ -162,8 +164,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
|
||||
@@ -182,7 +184,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:
|
||||
@@ -192,7 +194,7 @@ 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
|
||||
@@ -216,7 +218,7 @@ includes code changes) and under the terms of the
|
||||
[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.
|
||||
- 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://www.a11yproject.com/posts/2013-01-25-never-remove-css-outlines/) for more details.
|
||||
|
||||
### JS
|
||||
|
||||
|
||||
@@ -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/.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/)
|
||||
@@ -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/.github/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/.github/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/.github/CONTRIBUTING.md)
|
||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md)
|
||||
|
||||
Feature requests must include:
|
||||
|
||||
|
||||
+1
-1
@@ -7,5 +7,5 @@ See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports.
|
||||
For general troubleshooting or help getting started:
|
||||
|
||||
- Join [the official Slack room](https://bootstrap-slack.herokuapp.com/).
|
||||
- Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
|
||||
- Chat with fellow Bootstrappers in IRC. On the `irc.libera.chat` server, in the `#bootstrap` channel.
|
||||
- Ask and explore Stack Overflow with the [`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag.
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
name: BrowserStack
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
|
||||
jobs:
|
||||
browserstack:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'twbs/bootstrap' && (!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]'))
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
- 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,38 @@
|
||||
name: Bundlewatch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
|
||||
jobs:
|
||||
bundlewatch:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
- 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
|
||||
@@ -1,25 +1,38 @@
|
||||
name: "Code Scanning - Action"
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v4-dev
|
||||
- "!dependabot/**"
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches:
|
||||
- main
|
||||
- v4-dev
|
||||
- "!dependabot/**"
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
- cron: "0 2 * * 5"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
languages: "javascript"
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
name: CSS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
|
||||
jobs:
|
||||
css:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build CSS
|
||||
run: npm run css
|
||||
@@ -0,0 +1,31 @@
|
||||
name: CSS (Dart Sass)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
|
||||
jobs:
|
||||
css:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
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,45 @@
|
||||
name: Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
- run: java -version
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build docs
|
||||
run: npm run docs-build
|
||||
|
||||
- name: Validate HTML
|
||||
run: npm run docs-vnu
|
||||
|
||||
- name: Run linkinator
|
||||
uses: JustinBeckwith/linkinator-action@v1
|
||||
with:
|
||||
paths: _site
|
||||
recurse: true
|
||||
verbosity: error
|
||||
skip: "^(?!http://localhost)"
|
||||
@@ -0,0 +1,42 @@
|
||||
name: JS Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: JS Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE }}
|
||||
cache: npm
|
||||
|
||||
- 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@1.1.3
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
path-to-lcov: "./js/coverage/lcov.info"
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
@@ -1,88 +0,0 @@
|
||||
name: 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]
|
||||
ruby: [2.6.x]
|
||||
|
||||
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 Ruby
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
|
||||
- name: Disable gem docs
|
||||
run: 'echo "gem: --no-document" > ~/.gemrc'
|
||||
|
||||
- name: Set up Ruby cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-ruby-v${{ matrix.ruby }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-ruby-v${{ matrix.ruby }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}
|
||||
${{ runner.os }}-ruby-v${{ matrix.ruby }}-
|
||||
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v1
|
||||
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: Set up Bundler
|
||||
run: gem install bundler -v "~> 1.17"
|
||||
|
||||
- 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: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Run bundlewatch
|
||||
run: npm run bundlewatch
|
||||
if: matrix.node == 10
|
||||
env:
|
||||
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"
|
||||
CI_BRANCH_BASE: v4-dev
|
||||
|
||||
- name: Run BrowserStack tests
|
||||
run: npm run js-test-cloud
|
||||
if: matrix.node == 10 && github.repository == 'twbs/bootstrap' && github.event_name == 'push'
|
||||
env:
|
||||
BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}"
|
||||
BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}"
|
||||
|
||||
- name: Run Coveralls
|
||||
uses: coverallsapp/github-action@master
|
||||
if: matrix.node == 10
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
path-to-lcov: "./js/coverage/lcov.info"
|
||||
+6
-10
@@ -1,15 +1,8 @@
|
||||
# Ignore docs files
|
||||
/_gh_pages/
|
||||
/site/.jekyll-cache
|
||||
/site/.jekyll-metadata
|
||||
/site/docs/**/dist/
|
||||
# Hugo folders
|
||||
/_site/
|
||||
# Hugo files
|
||||
/resources/
|
||||
|
||||
# Ignore ruby/bundler files
|
||||
/.bundle/
|
||||
/vendor/
|
||||
/.ruby-version
|
||||
/.hugo_build.lock
|
||||
|
||||
# Numerous always-ignore extensions
|
||||
*.diff
|
||||
@@ -36,6 +29,9 @@
|
||||
*.sublime-workspace
|
||||
nbproject
|
||||
Thumbs.db
|
||||
/.vscode/
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
|
||||
# Komodo
|
||||
.komodotools
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
**/*.min.css
|
||||
**/dist/
|
||||
**/vendor/
|
||||
/_gh_pages/
|
||||
/_site/
|
||||
/js/coverage/
|
||||
|
||||
+10
-4
@@ -1,16 +1,22 @@
|
||||
{
|
||||
"extends": [
|
||||
"stylelint-config-twbs-bootstrap/scss"
|
||||
"stylelint-config-twbs-bootstrap"
|
||||
],
|
||||
"rules": {
|
||||
"property-blacklist": [
|
||||
"declaration-property-value-disallowed-list": {
|
||||
"border": "none",
|
||||
"outline": "none"
|
||||
},
|
||||
"function-disallowed-list": [
|
||||
"calc"
|
||||
],
|
||||
"property-disallowed-list": [
|
||||
"border-radius",
|
||||
"border-top-left-radius",
|
||||
"border-top-right-radius",
|
||||
"border-bottom-right-radius",
|
||||
"border-bottom-left-radius",
|
||||
"transition"
|
||||
],
|
||||
"function-blacklist": ["calc"]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+1
-4
@@ -40,7 +40,4 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html][version]
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org/
|
||||
[version]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4, available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct/>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'jekyll', '~> 4.0.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
|
||||
@@ -1,89 +0,0 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
colorator (1.1.0)
|
||||
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.12.2)
|
||||
ffi (1.12.2-x64-mingw32)
|
||||
forwardable-extended (2.6.0)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (1.8.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
jekyll (4.0.1)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
em-websocket (~> 0.5)
|
||||
i18n (>= 0.9.5, < 2)
|
||||
jekyll-sass-converter (~> 2.0)
|
||||
jekyll-watch (~> 2.0)
|
||||
kramdown (~> 2.1)
|
||||
kramdown-parser-gfm (~> 1.0)
|
||||
liquid (~> 4.0)
|
||||
mercenary (~> 0.3.3)
|
||||
pathutil (~> 0.9)
|
||||
rouge (~> 3.0)
|
||||
safe_yaml (~> 1.0)
|
||||
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 (2.2.1)
|
||||
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.3.6)
|
||||
mini_portile2 (2.4.0)
|
||||
nokogiri (1.10.9)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
nokogiri (1.10.9-x64-mingw32)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
pathutil (0.16.2)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (4.0.5)
|
||||
rb-fsevent (0.10.4)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rexml (3.2.4)
|
||||
rouge (3.18.0)
|
||||
safe_yaml (1.0.5)
|
||||
sassc (2.3.0)
|
||||
ffi (~> 1.9)
|
||||
sassc (2.3.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
|
||||
ruby
|
||||
x64-mingw32
|
||||
|
||||
DEPENDENCIES
|
||||
jekyll (~> 4.0.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
|
||||
@@ -1,7 +1,7 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2020 Twitter, Inc.
|
||||
Copyright (c) 2011-2020 The Bootstrap Authors
|
||||
Copyright (c) 2011-2022 Twitter, Inc.
|
||||
Copyright (c) 2011-2022 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.5/assets/brand/bootstrap-solid.svg" alt="Bootstrap logo" width="72" height="72">
|
||||
<img src="https://getbootstrap.com/docs/4.6/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.5/"><strong>Explore Bootstrap docs »</strong></a>
|
||||
<a href="https://getbootstrap.com/docs/4.6/"><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,38 +41,38 @@
|
||||
|
||||
Several quick start options are available:
|
||||
|
||||
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.5.0.zip)
|
||||
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.6.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.5.0`
|
||||
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.5.0`
|
||||
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@4.6.2`
|
||||
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.6.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.5/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
|
||||
Read the [Getting started page](https://getbootstrap.com/docs/4.6/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
|
||||
|
||||
|
||||
## Status
|
||||
|
||||
[](https://bootstrap-slack.herokuapp.com/)
|
||||
[](https://github.com/twbs/bootstrap/actions?query=workflow%3ATests+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://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://coveralls.io/github/twbs/bootstrap?branch=v4-dev)
|
||||
[](https://github.com/twbs/bootstrap/blob/v4-dev/dist/css/bootstrap.min.css)
|
||||
[](https://github.com/twbs/bootstrap/blob/v4-dev/dist/js/bootstrap.min.js)
|
||||
[](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
|
||||
## What's included
|
||||
|
||||
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
|
||||
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations.
|
||||
|
||||
<details><summary>Download contents</summary>
|
||||
|
||||
```text
|
||||
bootstrap/
|
||||
@@ -100,29 +100,30 @@ bootstrap/
|
||||
├── bootstrap.min.js
|
||||
└── bootstrap.min.js.map
|
||||
```
|
||||
</details>
|
||||
|
||||
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/), but not [jQuery](https://jquery.com/).
|
||||
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [Source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/), but not [jQuery](https://jquery.com/).
|
||||
|
||||
|
||||
## 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.
|
||||
Bootstrap's documentation, included in this repo in the root directory, is built with [Hugo](https://gohugo.io/) 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.5/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/assets/js/search.js`.
|
||||
|
||||
### Running documentation locally
|
||||
|
||||
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.
|
||||
1. Run `npm install` to install the Node.js dependencies, including Hugo (the site builder).
|
||||
2. Run `npm run test` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets.
|
||||
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à.
|
||||
4. Open `http://localhost:9001/` in your browser, and voilà.
|
||||
|
||||
Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/).
|
||||
Learn more about using Hugo by reading its [documentation](https://gohugo.io/documentation/).
|
||||
|
||||
### Documentation for previous releases
|
||||
|
||||
@@ -133,11 +134,11 @@ You can find all our previous releases docs on <https://getbootstrap.com/docs/ve
|
||||
|
||||
## 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
|
||||
@@ -147,7 +148,7 @@ Get updates on Bootstrap's development and chat with the project maintainers and
|
||||
- Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
|
||||
- Read and subscribe to [The Official Bootstrap Blog](https://blog.getbootstrap.com/).
|
||||
- Join [the official Slack room](https://bootstrap-slack.herokuapp.com/).
|
||||
- Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
|
||||
- Chat with fellow Bootstrappers in IRC. On the `irc.libera.chat` server, in the `#bootstrap` channel.
|
||||
- Implementation help may be found at Stack Overflow (tagged [`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4)).
|
||||
- Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability.
|
||||
|
||||
@@ -206,4 +207,4 @@ Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com
|
||||
|
||||
## Copyright and 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/master/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).
|
||||
Code and documentation copyright 2011-2022 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/).
|
||||
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
# Dependencies
|
||||
markdown: kramdown
|
||||
highlighter: rouge
|
||||
|
||||
kramdown:
|
||||
auto_ids: true
|
||||
|
||||
# Permalinks
|
||||
permalink: pretty
|
||||
|
||||
# Server
|
||||
source: "site"
|
||||
destination: ./_gh_pages
|
||||
host: "localhost"
|
||||
port: 9001
|
||||
baseurl: ""
|
||||
url: "https://getbootstrap.com"
|
||||
encoding: UTF-8
|
||||
exclude:
|
||||
- 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.5/assets/brand/bootstrap-social.png
|
||||
social_logo_path: /docs/4.5/assets/brand/bootstrap-social-logo.png
|
||||
|
||||
# Custom variables
|
||||
current_version: 4.5.0
|
||||
current_ruby_version: 4.5.0
|
||||
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.5.0.zip"
|
||||
dist: "https://github.com/twbs/bootstrap/releases/download/v4.5.0/bootstrap-4.5.0-dist.zip"
|
||||
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v4.5.0/bootstrap-4.5.0-examples.zip"
|
||||
|
||||
cdn:
|
||||
# See https://www.srihash.org for info on how to generate the hashes
|
||||
css: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
|
||||
css_hash: "sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
|
||||
js: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"
|
||||
js_hash: "sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI"
|
||||
js_bundle: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js"
|
||||
js_bundle_hash: "sha384-1CmrxMRARb6aLqgBO7yyAxTOQE2AKb9GfXnEo760AUcUmFx3ibVJJAzGytlQcNXd"
|
||||
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.0/dist/umd/popper.min.js"
|
||||
popper_hash: "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
|
||||
|
||||
toc:
|
||||
min_level: 2
|
||||
max_level: 4
|
||||
no_toc_section_class:
|
||||
- "bd-callout"
|
||||
- "bd-example"
|
||||
@@ -8,12 +8,7 @@
|
||||
},
|
||||
"extends": "../.eslintrc.json",
|
||||
"rules": {
|
||||
"consistent-return": "off",
|
||||
"func-style": "off",
|
||||
"no-console": "off",
|
||||
"no-magic-numbers": "off",
|
||||
"no-process-exit": "off",
|
||||
"no-sync": "off",
|
||||
"spaced-comment": "off"
|
||||
"strict": "error"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
// These are the babel helpers we whitelist
|
||||
const helpers = [
|
||||
'createClass',
|
||||
'createSuper',
|
||||
'defineProperties',
|
||||
'defineProperty',
|
||||
'inheritsLoose',
|
||||
'objectSpread2'
|
||||
]
|
||||
|
||||
module.exports = helpers
|
||||
+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)
|
||||
*/`
|
||||
}
|
||||
|
||||
|
||||
+12
-13
@@ -2,26 +2,25 @@
|
||||
|
||||
/*!
|
||||
* Script to build our plugins to use them separately.
|
||||
* Copyright 2020 The Bootstrap Authors
|
||||
* Copyright 2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Copyright 2020-2022 The Bootstrap Authors
|
||||
* Copyright 2020-2022 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 babelHelpers = require('./babel-helpers.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({
|
||||
// Only transpile our source code
|
||||
exclude: 'node_modules/**',
|
||||
// Include only required helpers
|
||||
externalHelpersWhitelist: babelHelpers
|
||||
// Include the helpers in each file, at most one copy of each
|
||||
babelHelpers: 'bundled'
|
||||
})
|
||||
]
|
||||
const bsPlugins = {
|
||||
@@ -40,7 +39,7 @@ const bsPlugins = {
|
||||
}
|
||||
const rootPath = TEST ? '../js/coverage/dist/' : '../js/dist/'
|
||||
|
||||
const build = async (plugin) => {
|
||||
const build = async plugin => {
|
||||
console.log(`Building ${plugin} plugin...`)
|
||||
|
||||
const external = ['jquery', 'popper.js']
|
||||
@@ -82,7 +81,7 @@ const build = async (plugin) => {
|
||||
|
||||
const main = async () => {
|
||||
try {
|
||||
await Promise.all(Object.keys(bsPlugins).map((plugin) => build(plugin)))
|
||||
await Promise.all(Object.keys(bsPlugins).map(plugin => build(plugin)))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
|
||||
Executable → Regular
+48
-72
@@ -2,18 +2,28 @@
|
||||
|
||||
/*!
|
||||
* Script to update version number references in the project.
|
||||
* Copyright 2017-2020 The Bootstrap Authors
|
||||
* Copyright 2017-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Copyright 2017-2022 The Bootstrap Authors
|
||||
* Copyright 2017-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const fs = require('fs')
|
||||
const fs = require('fs').promises
|
||||
const path = require('path')
|
||||
const sh = require('shelljs')
|
||||
const globby = require('globby')
|
||||
|
||||
sh.config.fatal = true
|
||||
const VERBOSE = process.argv.includes('--verbose')
|
||||
const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run')
|
||||
|
||||
// These are the filetypes we only care about replacing the version
|
||||
const GLOB = [
|
||||
'**/*.{css,html,js,json,md,scss,txt,yml}'
|
||||
]
|
||||
const GLOBBY_OPTIONS = {
|
||||
cwd: path.join(__dirname, '..'),
|
||||
gitignore: true
|
||||
}
|
||||
|
||||
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
|
||||
function regExpQuote(string) {
|
||||
@@ -24,82 +34,48 @@ function regExpQuoteReplacement(string) {
|
||||
return string.replace(/\$/g, '$$')
|
||||
}
|
||||
|
||||
const DRY_RUN = false
|
||||
async function replaceRecursively(file, oldVersion, newVersion) {
|
||||
const originalString = await fs.readFile(file, 'utf8')
|
||||
const newString = originalString.replace(
|
||||
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion)
|
||||
)
|
||||
|
||||
function walkAsync(directory, excludedDirectories, fileCallback, errback) {
|
||||
if (excludedDirectories.has(path.parse(directory).base)) {
|
||||
// No need to move any further if the strings are identical
|
||||
if (originalString === newString) {
|
||||
return
|
||||
}
|
||||
fs.readdir(directory, (err, names) => {
|
||||
if (err) {
|
||||
errback(err)
|
||||
return
|
||||
}
|
||||
names.forEach((name) => {
|
||||
const filepath = path.join(directory, name)
|
||||
fs.lstat(filepath, (err, stats) => {
|
||||
if (err) {
|
||||
process.nextTick(errback, err)
|
||||
return
|
||||
}
|
||||
if (stats.isDirectory()) {
|
||||
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback)
|
||||
} else if (stats.isFile()) {
|
||||
process.nextTick(fileCallback, filepath)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
|
||||
original = new RegExp(regExpQuote(original), 'g')
|
||||
replacement = regExpQuoteReplacement(replacement)
|
||||
const updateFile = DRY_RUN ? (filepath) => {
|
||||
if (allowedExtensions.has(path.parse(filepath).ext)) {
|
||||
console.log(`FILE: ${filepath}`)
|
||||
} else {
|
||||
console.log(`EXCLUDED:${filepath}`)
|
||||
}
|
||||
} : (filepath) => {
|
||||
if (allowedExtensions.has(path.parse(filepath).ext)) {
|
||||
sh.sed('-i', original, replacement, filepath)
|
||||
}
|
||||
if (VERBOSE) {
|
||||
console.log(`FILE: ${file}`)
|
||||
}
|
||||
walkAsync(directory, excludedDirectories, updateFile, (err) => {
|
||||
console.error('ERROR while traversing directory!:')
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
if (DRY_RUN) {
|
||||
return
|
||||
}
|
||||
|
||||
await fs.writeFile(file, newString, 'utf8')
|
||||
}
|
||||
|
||||
function main(args) {
|
||||
if (args.length !== 2) {
|
||||
console.error('USAGE: change-version old_version new_version')
|
||||
async function main(args) {
|
||||
let [oldVersion, newVersion] = args
|
||||
|
||||
if (!oldVersion || !newVersion) {
|
||||
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
|
||||
console.error('Got arguments:', args)
|
||||
process.exit(1)
|
||||
}
|
||||
const oldVersion = args[0]
|
||||
const newVersion = args[1]
|
||||
const EXCLUDED_DIRS = new Set([
|
||||
'.git',
|
||||
'_gh_pages',
|
||||
'node_modules',
|
||||
'vendor'
|
||||
])
|
||||
const INCLUDED_EXTENSIONS = new Set([
|
||||
// This extension whitelist is how we avoid modifying binary files
|
||||
'',
|
||||
'.css',
|
||||
'.html',
|
||||
'.js',
|
||||
'.json',
|
||||
'.md',
|
||||
'.scss',
|
||||
'.txt',
|
||||
'.yml'
|
||||
])
|
||||
replaceRecursively('.', EXCLUDED_DIRS, INCLUDED_EXTENSIONS, oldVersion, newVersion)
|
||||
|
||||
// Strip any leading `v` from arguments because otherwise we will end up with duplicate `v`s
|
||||
[oldVersion, newVersion] = [oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)
|
||||
|
||||
try {
|
||||
const files = await globby(GLOB, GLOBBY_OPTIONS)
|
||||
|
||||
await Promise.all(files.map(file => replaceRecursively(file, oldVersion, newVersion)))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
main(process.argv.slice(2))
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* Remember to use the same vendor files as the CDN ones,
|
||||
* otherwise the hashes won't match!
|
||||
*
|
||||
* Copyright 2017-2020 The Bootstrap Authors
|
||||
* Copyright 2017-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Copyright 2017-2022 The Bootstrap Authors
|
||||
* Copyright 2017-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
@@ -21,11 +21,11 @@ const pkg = require('../package.json')
|
||||
|
||||
sh.config.fatal = true
|
||||
|
||||
const configFile = path.join(__dirname, '../_config.yml')
|
||||
const configFile = path.join(__dirname, '../config.yml')
|
||||
|
||||
// Array of objects which holds the files to generate SRI hashes for.
|
||||
// `file` is the path from the root folder
|
||||
// `configPropertyName` is the _config.yml variable's name of the file
|
||||
// `configPropertyName` is the config.yml variable's name of the file
|
||||
const files = [
|
||||
{
|
||||
file: 'dist/css/bootstrap.min.css',
|
||||
@@ -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/static/docs/${pkg.config.version_short}/assets/js/vendor/jquery.slim.min.js`,
|
||||
configPropertyName: 'jquery_hash'
|
||||
},
|
||||
{
|
||||
@@ -49,7 +49,7 @@ const files = [
|
||||
}
|
||||
]
|
||||
|
||||
files.forEach((file) => {
|
||||
files.forEach(file => {
|
||||
fs.readFile(file.file, 'utf8', (err, data) => {
|
||||
if (err) {
|
||||
throw err
|
||||
@@ -61,6 +61,6 @@ files.forEach((file) => {
|
||||
|
||||
console.log(`${file.configPropertyName}: ${integrity}`)
|
||||
|
||||
sh.sed('-i', new RegExp(`(\\s${file.configPropertyName}:\\s+"|')(\\S+)("|')`), `$1${integrity}$3`, configFile)
|
||||
sh.sed('-i', new RegExp(`^(\\s+${file.configPropertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile)
|
||||
})
|
||||
})
|
||||
|
||||
+14
-10
@@ -1,14 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = (ctx) => ({
|
||||
map: ctx.file.dirname.includes('examples') ? false : {
|
||||
inline: false,
|
||||
annotation: true,
|
||||
sourcesContent: true
|
||||
},
|
||||
plugins: {
|
||||
autoprefixer: {
|
||||
cascade: false
|
||||
module.exports = ctx => {
|
||||
return {
|
||||
map: ctx.file.dirname.includes('examples') ?
|
||||
false :
|
||||
{
|
||||
inline: false,
|
||||
annotation: true,
|
||||
sourcesContent: true
|
||||
},
|
||||
plugins: {
|
||||
autoprefixer: {
|
||||
cascade: false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+11
-12
@@ -1,21 +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 babelHelpers = require('./babel-helpers.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({
|
||||
// Only transpile our source code
|
||||
// Only transpile our source code
|
||||
exclude: 'node_modules/**',
|
||||
// Include only required helpers
|
||||
externalHelpersWhitelist: babelHelpers
|
||||
// Include the helpers in the bundle, at most one copy of each
|
||||
babelHelpers: 'bundled'
|
||||
})
|
||||
]
|
||||
const globals = {
|
||||
@@ -28,11 +27,11 @@ 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 = {
|
||||
input: path.resolve(__dirname, '../js/src/index.js'),
|
||||
input: path.resolve(__dirname, '../js/index.js'),
|
||||
output: {
|
||||
banner,
|
||||
file: path.resolve(__dirname, `../dist/js/${fileDest}`),
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
#
|
||||
# Usage
|
||||
# ---------------
|
||||
# 1. Clone second version of Bootstrap in sibling directory named `bs-docs`.
|
||||
# 2. Within `bs-docs` copy, switch to `gh-pages` branch.
|
||||
# 3. Pull latest, re-bundle, re-npm.
|
||||
# 4. Run script.
|
||||
|
||||
red=$'\e[1;31m'
|
||||
green=$'\e[1;32m'
|
||||
#blue=$'\e[1;34m'
|
||||
magenta=$'\e[1;35m'
|
||||
#cyan=$'\e[1;36m'
|
||||
end=$'\e[0m'
|
||||
|
||||
# Get current version from package.json
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
@@ -1,60 +0,0 @@
|
||||
# Usage:
|
||||
# install svgo globally: `npm i -g svgo`
|
||||
# svgo --config=build/svgo.yml --input=foo.svg
|
||||
|
||||
# https://github.com/svg/svgo/blob/master/docs/how-it-works/en.md
|
||||
# replace default config
|
||||
|
||||
multipass: true
|
||||
#full: true
|
||||
|
||||
# https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
|
||||
|
||||
js2svg:
|
||||
pretty: true
|
||||
indent: 2
|
||||
|
||||
plugins:
|
||||
# remove this with IE 11 is no longer supported
|
||||
- addAttributesToSVGElement:
|
||||
attributes:
|
||||
- focusable: false
|
||||
- cleanupAttrs: true
|
||||
- cleanupEnableBackground: true
|
||||
- cleanupIDs: true
|
||||
- cleanupListOfValues: true
|
||||
- cleanupNumericValues: true
|
||||
- collapseGroups: true
|
||||
- convertColors: true
|
||||
- convertPathData: true
|
||||
- convertShapeToPath: true
|
||||
- convertStyleToAttrs: true
|
||||
- convertTransform: true
|
||||
- inlineStyles: true
|
||||
- mergePaths: true
|
||||
- minifyStyles: true
|
||||
- moveElemsAttrsToGroup: true
|
||||
- moveGroupAttrsToElems: true
|
||||
- removeAttrs:
|
||||
attrs:
|
||||
- "data-name"
|
||||
- removeComments: true
|
||||
- removeDesc: true
|
||||
- removeDoctype: true
|
||||
- removeEditorsNSData: true
|
||||
- removeEmptyAttrs: true
|
||||
- removeEmptyContainers: true
|
||||
- removeEmptyText: true
|
||||
- removeHiddenElems: true
|
||||
- removeMetadata: true
|
||||
- removeNonInheritableGroupAttrs: true
|
||||
- removeTitle: false
|
||||
- removeUnknownsAndDefaults:
|
||||
keepRoleAttr: true
|
||||
- removeUnusedNS: true
|
||||
- removeUselessDefs: true
|
||||
- removeUselessStrokeAndFill: true
|
||||
- removeViewBox: false
|
||||
- removeXMLNS: false
|
||||
- removeXMLProcInst: true
|
||||
- sortAttrs: true
|
||||
+14
-19
@@ -2,17 +2,17 @@
|
||||
|
||||
/*!
|
||||
* Script to run vnu-jar if Java is available.
|
||||
* Copyright 2017-2020 The Bootstrap Authors
|
||||
* Copyright 2017-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Copyright 2017-2022 The Bootstrap Authors
|
||||
* Copyright 2017-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const childProcess = require('child_process')
|
||||
const { execFile, spawn } = require('child_process')
|
||||
const vnu = require('vnu-jar')
|
||||
|
||||
childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||
execFile('java', ['-version'], (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error('Skipping vnu-jar test; Java is missing.')
|
||||
return
|
||||
@@ -21,34 +21,29 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||
const is32bitJava = !/64-Bit/.test(stderr)
|
||||
|
||||
// vnu-jar accepts multiple ignores joined with a `|`.
|
||||
// Also note that the ignores are regular expressions.
|
||||
// Also note that the ignores are string regular expressions.
|
||||
const ignores = [
|
||||
// "autocomplete" is included in <button> and checkboxes and radio <input>s due to
|
||||
// Firefox's non-standard autocomplete behavior - see https://bugzilla.mozilla.org/show_bug.cgi?id=654072
|
||||
'Attribute “autocomplete” is only allowed when the input type is.*',
|
||||
'Attribute “autocomplete” not allowed on element “button” at this point.',
|
||||
// Markup used in Components → Forms → Layout → Form grid → Horizontal form is currently invalid,
|
||||
// but used this way due to lack of support for flexbox layout on <fieldset> element in most browsers
|
||||
'Element “legend” not allowed as child of element “div” in this context.*',
|
||||
// Content → Reboot uses various date/time inputs as a visual example.
|
||||
// Documentation does not rely on them being usable.
|
||||
'The “date” input type is not supported in all browsers.*',
|
||||
'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”.'
|
||||
'The “main” role is unnecessary for element “main”.',
|
||||
// Per https://www.w3.org/TR/html-aria/#docconformance having "aria-disabled" on a link is
|
||||
// NOT RECOMMENDED, but it's still valid - we explain in the docs that it's not ideal,
|
||||
// and offer more robust alternatives, but also need to show a less-than-ideal example
|
||||
'An “aria-disabled” attribute whose value is “true” should not be specified on an “a” element that has an “href” attribute.'
|
||||
].join('|')
|
||||
|
||||
const args = [
|
||||
'-jar',
|
||||
vnu,
|
||||
`"${vnu}"`,
|
||||
'--asciiquotes',
|
||||
'--skip-non-html',
|
||||
// Ignore the language code warnings
|
||||
'--no-langdetect',
|
||||
'--Werror',
|
||||
`--filterpattern "${ignores}"`,
|
||||
'_gh_pages/',
|
||||
'_site/',
|
||||
'js/tests/'
|
||||
]
|
||||
|
||||
@@ -57,7 +52,7 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||
args.splice(0, 0, '-Xss512k')
|
||||
}
|
||||
|
||||
return childProcess.spawn('java', args, {
|
||||
return spawn('java', args, {
|
||||
shell: true,
|
||||
stdio: 'inherit'
|
||||
})
|
||||
|
||||
+51
-26
@@ -3,8 +3,8 @@
|
||||
/*!
|
||||
* 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/master/LICENSE)
|
||||
* Copyright 2020-2022 The Bootstrap Authors
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
@@ -12,38 +12,65 @@
|
||||
const path = require('path')
|
||||
const sh = require('shelljs')
|
||||
|
||||
const {
|
||||
version, version_short: versionShort
|
||||
} = require('../package.json')
|
||||
const pkg = require('../package.json')
|
||||
|
||||
const folderName = `bootstrap-${version}-examples`
|
||||
const versionShort = pkg.config.version_short
|
||||
const distFolder = `bootstrap-${pkg.version}-examples`
|
||||
const rootDocsDir = '_site'
|
||||
const docsDir = `${rootDocsDir}/docs/${versionShort}/`
|
||||
|
||||
// these are the files we need in the examples
|
||||
const cssFiles = [
|
||||
'bootstrap.min.css',
|
||||
'bootstrap.min.css.map'
|
||||
]
|
||||
const jsFiles = [
|
||||
'bootstrap.bundle.min.js',
|
||||
'bootstrap.bundle.min.js.map'
|
||||
]
|
||||
const imgFiles = [
|
||||
'bootstrap-outline.svg',
|
||||
'bootstrap-solid.svg'
|
||||
]
|
||||
|
||||
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?')
|
||||
if (!sh.test('-d', rootDocsDir)) {
|
||||
throw new Error(`The "${rootDocsDir}" 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/`)
|
||||
// remove any previously created folder/zip with the same name
|
||||
sh.rm('-rf', [distFolder, `${distFolder}.zip`])
|
||||
|
||||
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`)
|
||||
// create any folders so that `cp` works
|
||||
sh.mkdir('-p', [
|
||||
distFolder,
|
||||
`${distFolder}/assets/brand/`,
|
||||
`${distFolder}/assets/dist/css/`,
|
||||
`${distFolder}/assets/dist/js/`
|
||||
])
|
||||
|
||||
sh.cp('-Rf', `${docsDir}/examples/*`, distFolder)
|
||||
|
||||
cssFiles.forEach(file => {
|
||||
sh.cp('-f', `${docsDir}/dist/css/${file}`, `${distFolder}/assets/dist/css/`)
|
||||
})
|
||||
|
||||
jsFiles.forEach(file => {
|
||||
sh.cp('-f', `${docsDir}/dist/js/${file}`, `${distFolder}/assets/dist/js/`)
|
||||
})
|
||||
|
||||
imgFiles.forEach(file => {
|
||||
sh.cp('-f', `${docsDir}/assets/brand/${file}`, `${distFolder}/assets/brand/`)
|
||||
})
|
||||
|
||||
sh.rm(`${distFolder}/index.html`)
|
||||
|
||||
// get all examples' HTML files
|
||||
sh.find(`${folderName}/**/*.html`).forEach((file) => {
|
||||
sh.find(`${distFolder}/**/*.html`).forEach(file => {
|
||||
const fileContents = sh.cat(file)
|
||||
.toString()
|
||||
.replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../')
|
||||
@@ -55,9 +82,7 @@ sh.find(`${folderName}/**/*.html`).forEach((file) => {
|
||||
})
|
||||
|
||||
// create the zip file
|
||||
sh.exec(`zip -r9 "${folderName}.zip" "${folderName}"`, {
|
||||
fatal: true
|
||||
})
|
||||
sh.exec(`zip -r9 "${distFolder}.zip" "${distFolder}"`)
|
||||
|
||||
// remove the folder we created
|
||||
sh.rm('-rf', folderName)
|
||||
sh.rm('-rf', distFolder)
|
||||
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
languageCode: "en"
|
||||
title: "Bootstrap"
|
||||
baseURL: "https://getbootstrap.com"
|
||||
enableInlineShortcodes: true
|
||||
|
||||
security:
|
||||
enableInlineShortcodes: true
|
||||
funcs:
|
||||
getenv:
|
||||
- ^HUGO_
|
||||
- NETLIFY
|
||||
|
||||
markup:
|
||||
goldmark:
|
||||
renderer:
|
||||
unsafe: true
|
||||
highlight:
|
||||
noClasses: false
|
||||
tableOfContents:
|
||||
startLevel: 2
|
||||
endLevel: 6
|
||||
|
||||
buildDrafts: true
|
||||
buildFuture: true
|
||||
|
||||
enableRobotsTXT: true
|
||||
metaDataFormat: "yaml"
|
||||
disableKinds: ["404", "taxonomy", "term", "RSS"]
|
||||
|
||||
publishDir: "_site"
|
||||
|
||||
module:
|
||||
mounts:
|
||||
- source: dist
|
||||
target: static/docs/4.6/dist
|
||||
- source: site/assets
|
||||
target: assets
|
||||
- source: site/content
|
||||
target: content
|
||||
- source: site/data
|
||||
target: data
|
||||
- source: site/layouts
|
||||
target: layouts
|
||||
- source: site/static
|
||||
target: static
|
||||
- source: site/static/docs/4.6/assets/img/favicons/apple-touch-icon.png
|
||||
target: static/apple-touch-icon.png
|
||||
- source: site/static/docs/4.6/assets/img/favicons/favicon.ico
|
||||
target: static/favicon.ico
|
||||
|
||||
params:
|
||||
description: "The most popular HTML, CSS, and JS library in the world."
|
||||
authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
|
||||
social_image_path: /docs/4.6/assets/brand/bootstrap-social.png
|
||||
social_logo_path: /docs/4.6/assets/brand/bootstrap-social-logo.png
|
||||
|
||||
current_version: "4.6.2"
|
||||
current_ruby_version: "4.6.2"
|
||||
docs_version: "4.6"
|
||||
rfs_version: "v8.1.0"
|
||||
github_org: "https://github.com/twbs"
|
||||
repo: "https://github.com/twbs/bootstrap"
|
||||
twitter: "getbootstrap"
|
||||
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.6.2.zip"
|
||||
dist: "https://github.com/twbs/bootstrap/releases/download/v4.6.2/bootstrap-4.6.2-dist.zip"
|
||||
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v4.6.2/bootstrap-4.6.2-examples.zip"
|
||||
|
||||
cdn:
|
||||
# See https://www.srihash.org for info on how to generate the hashes
|
||||
css: "https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
|
||||
css_hash: "sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N"
|
||||
js: "https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js"
|
||||
js_hash: "sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+"
|
||||
js_bundle: "https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"
|
||||
js_bundle_hash: "sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct"
|
||||
jquery: "https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.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"
|
||||
Vendored
+10
-42
@@ -1,8 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap Grid v4.5.0 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap Grid v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors
|
||||
* Copyright 2011-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
@@ -15,39 +15,12 @@ html {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container {
|
||||
max-width: 540px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.container {
|
||||
max-width: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.container {
|
||||
max-width: 960px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.container {
|
||||
max-width: 1140px;
|
||||
}
|
||||
}
|
||||
|
||||
.container-fluid, .container-sm, .container-md, .container-lg, .container-xl {
|
||||
.container,
|
||||
.container-fluid,
|
||||
.container-sm,
|
||||
.container-md,
|
||||
.container-lg,
|
||||
.container-xl {
|
||||
width: 100%;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
@@ -116,7 +89,6 @@ html {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
@@ -360,7 +332,6 @@ html {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-sm-1 > * {
|
||||
@@ -563,7 +534,6 @@ html {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-md-1 > * {
|
||||
@@ -766,7 +736,6 @@ html {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-lg-1 > * {
|
||||
@@ -969,7 +938,6 @@ html {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-xl-1 > * {
|
||||
|
||||
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
+10
-10
@@ -1,8 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.5.0 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap Reboot v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors
|
||||
* Copyright 2011-2022 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)
|
||||
*/
|
||||
*,
|
||||
@@ -24,7 +24,7 @@ article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
|
||||
|
||||
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-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation 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;
|
||||
@@ -133,12 +133,12 @@ a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:not([href]) {
|
||||
a:not([href]):not([class]) {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):hover {
|
||||
a:not([href]):not([class]):hover {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -186,6 +186,7 @@ caption {
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
text-align: -webkit-match-parent;
|
||||
}
|
||||
|
||||
label {
|
||||
@@ -197,9 +198,8 @@ button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus {
|
||||
outline: 1px dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
button:focus:not(:focus-visible) {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+5
-5
@@ -1,8 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.5.0 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap Reboot v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors
|
||||
* Copyright 2011-2022 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: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]){color:inherit;text-decoration:none}a:not([href]):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}
|
||||
*/*,::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","Liberation 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;text-align:-webkit-match-parent}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus:not(:focus-visible){outline:0}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
+170
-116
@@ -1,8 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap v4.5.0 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors
|
||||
* Copyright 2011-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
:root {
|
||||
--blue: #007bff;
|
||||
@@ -31,7 +31,7 @@
|
||||
--breakpoint-md: 768px;
|
||||
--breakpoint-lg: 992px;
|
||||
--breakpoint-xl: 1200px;
|
||||
--font-family-sans-serif: -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-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
|
||||
|
||||
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-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation 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;
|
||||
@@ -163,12 +163,12 @@ a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:not([href]) {
|
||||
a:not([href]):not([class]) {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):hover {
|
||||
a:not([href]):not([class]):hover {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -216,6 +216,7 @@ caption {
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
text-align: -webkit-match-parent;
|
||||
}
|
||||
|
||||
label {
|
||||
@@ -227,9 +228,8 @@ button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus {
|
||||
outline: 1px dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
button:focus:not(:focus-visible) {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
@@ -422,7 +422,7 @@ hr {
|
||||
|
||||
small,
|
||||
.small {
|
||||
font-size: 80%;
|
||||
font-size: 0.875em;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ mark,
|
||||
|
||||
.blockquote-footer {
|
||||
display: block;
|
||||
font-size: 80%;
|
||||
font-size: 0.875em;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
@@ -539,39 +539,12 @@ pre code {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container {
|
||||
max-width: 540px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.container {
|
||||
max-width: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.container {
|
||||
max-width: 960px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.container {
|
||||
max-width: 1140px;
|
||||
}
|
||||
}
|
||||
|
||||
.container-fluid, .container-sm, .container-md, .container-lg, .container-xl {
|
||||
.container,
|
||||
.container-fluid,
|
||||
.container-sm,
|
||||
.container-md,
|
||||
.container-lg,
|
||||
.container-xl {
|
||||
width: 100%;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
@@ -640,7 +613,6 @@ pre code {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
@@ -884,7 +856,6 @@ pre code {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-sm-1 > * {
|
||||
@@ -1087,7 +1058,6 @@ pre code {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-md-1 > * {
|
||||
@@ -1290,7 +1260,6 @@ pre code {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-lg-1 > * {
|
||||
@@ -1493,7 +1462,6 @@ pre code {
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.row-cols-xl-1 > * {
|
||||
@@ -2060,11 +2028,6 @@ pre code {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.form-control:-moz-focusring {
|
||||
color: transparent;
|
||||
text-shadow: 0 0 0 #495057;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
color: #495057;
|
||||
background-color: #fff;
|
||||
@@ -2112,6 +2075,11 @@ input[type="month"].form-control {
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
select.form-control:-moz-focusring {
|
||||
color: transparent;
|
||||
text-shadow: 0 0 0 #495057;
|
||||
}
|
||||
|
||||
select.form-control:focus::-ms-value {
|
||||
color: #495057;
|
||||
background-color: #fff;
|
||||
@@ -2252,13 +2220,14 @@ textarea.form-control {
|
||||
display: none;
|
||||
width: 100%;
|
||||
margin-top: 0.25rem;
|
||||
font-size: 80%;
|
||||
font-size: 0.875em;
|
||||
color: #28a745;
|
||||
}
|
||||
|
||||
.valid-tooltip {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 5;
|
||||
display: none;
|
||||
max-width: 100%;
|
||||
@@ -2271,6 +2240,11 @@ textarea.form-control {
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.form-row > .col > .valid-tooltip,
|
||||
.form-row > [class*="col-"] > .valid-tooltip {
|
||||
left: 5px;
|
||||
}
|
||||
|
||||
.was-validated :valid ~ .valid-feedback,
|
||||
.was-validated :valid ~ .valid-tooltip,
|
||||
.is-valid ~ .valid-feedback,
|
||||
@@ -2280,7 +2254,7 @@ textarea.form-control {
|
||||
|
||||
.was-validated .form-control:valid, .form-control.is-valid {
|
||||
border-color: #28a745;
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
padding-right: calc(1.5em + 0.75rem) !important;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right calc(0.375em + 0.1875rem) center;
|
||||
@@ -2292,6 +2266,11 @@ textarea.form-control {
|
||||
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
|
||||
}
|
||||
|
||||
.was-validated select.form-control:valid, select.form-control.is-valid {
|
||||
padding-right: 3rem !important;
|
||||
background-position: right 1.5rem center;
|
||||
}
|
||||
|
||||
.was-validated textarea.form-control:valid, textarea.form-control.is-valid {
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem);
|
||||
@@ -2299,8 +2278,8 @@ textarea.form-control {
|
||||
|
||||
.was-validated .custom-select:valid, .custom-select.is-valid {
|
||||
border-color: #28a745;
|
||||
padding-right: calc(0.75em + 2.3125rem);
|
||||
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
|
||||
padding-right: calc(0.75em + 2.3125rem) !important;
|
||||
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right 0.75rem center/8px 10px no-repeat, #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) no-repeat;
|
||||
}
|
||||
|
||||
.was-validated .custom-select:valid:focus, .custom-select.is-valid:focus {
|
||||
@@ -2352,13 +2331,14 @@ textarea.form-control {
|
||||
display: none;
|
||||
width: 100%;
|
||||
margin-top: 0.25rem;
|
||||
font-size: 80%;
|
||||
font-size: 0.875em;
|
||||
color: #dc3545;
|
||||
}
|
||||
|
||||
.invalid-tooltip {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 5;
|
||||
display: none;
|
||||
max-width: 100%;
|
||||
@@ -2371,6 +2351,11 @@ textarea.form-control {
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.form-row > .col > .invalid-tooltip,
|
||||
.form-row > [class*="col-"] > .invalid-tooltip {
|
||||
left: 5px;
|
||||
}
|
||||
|
||||
.was-validated :invalid ~ .invalid-feedback,
|
||||
.was-validated :invalid ~ .invalid-tooltip,
|
||||
.is-invalid ~ .invalid-feedback,
|
||||
@@ -2380,7 +2365,7 @@ textarea.form-control {
|
||||
|
||||
.was-validated .form-control:invalid, .form-control.is-invalid {
|
||||
border-color: #dc3545;
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
padding-right: calc(1.5em + 0.75rem) !important;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right calc(0.375em + 0.1875rem) center;
|
||||
@@ -2392,6 +2377,11 @@ textarea.form-control {
|
||||
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
|
||||
}
|
||||
|
||||
.was-validated select.form-control:invalid, select.form-control.is-invalid {
|
||||
padding-right: 3rem !important;
|
||||
background-position: right 1.5rem center;
|
||||
}
|
||||
|
||||
.was-validated textarea.form-control:invalid, textarea.form-control.is-invalid {
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem);
|
||||
@@ -2399,8 +2389,8 @@ textarea.form-control {
|
||||
|
||||
.was-validated .custom-select:invalid, .custom-select.is-invalid {
|
||||
border-color: #dc3545;
|
||||
padding-right: calc(0.75em + 2.3125rem);
|
||||
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
|
||||
padding-right: calc(0.75em + 2.3125rem) !important;
|
||||
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right 0.75rem center/8px 10px no-repeat, #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) no-repeat;
|
||||
}
|
||||
|
||||
.was-validated .custom-select:invalid:focus, .custom-select.is-invalid:focus {
|
||||
@@ -3203,6 +3193,18 @@ input[type="button"].btn-block {
|
||||
}
|
||||
}
|
||||
|
||||
.collapsing.width {
|
||||
width: 0;
|
||||
height: auto;
|
||||
transition: width 0.35s ease;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.collapsing.width {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.dropup,
|
||||
.dropright,
|
||||
.dropdown,
|
||||
@@ -3417,7 +3419,7 @@ input[type="button"].btn-block {
|
||||
.dropdown-item:hover, .dropdown-item:focus {
|
||||
color: #16181b;
|
||||
text-decoration: none;
|
||||
background-color: #f8f9fa;
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
|
||||
.dropdown-item.active, .dropdown-item:active {
|
||||
@@ -3427,7 +3429,7 @@ input[type="button"].btn-block {
|
||||
}
|
||||
|
||||
.dropdown-item.disabled, .dropdown-item:disabled {
|
||||
color: #6c757d;
|
||||
color: #adb5bd;
|
||||
pointer-events: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
@@ -3626,12 +3628,6 @@ input[type="button"].btn-block {
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.input-group > .form-control:not(:last-child),
|
||||
.input-group > .custom-select:not(:last-child) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.input-group > .form-control:not(:first-child),
|
||||
.input-group > .custom-select:not(:first-child) {
|
||||
border-top-left-radius: 0;
|
||||
@@ -3656,6 +3652,22 @@ input[type="button"].btn-block {
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.input-group:not(.has-validation) > .form-control:not(:last-child),
|
||||
.input-group:not(.has-validation) > .custom-select:not(:last-child),
|
||||
.input-group:not(.has-validation) > .custom-file:not(:last-child) .custom-file-label,
|
||||
.input-group:not(.has-validation) > .custom-file:not(:last-child) .custom-file-label::after {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.input-group.has-validation > .form-control:nth-last-child(n + 3),
|
||||
.input-group.has-validation > .custom-select:nth-last-child(n + 3),
|
||||
.input-group.has-validation > .custom-file:nth-last-child(n + 3) .custom-file-label,
|
||||
.input-group.has-validation > .custom-file:nth-last-child(n + 3) .custom-file-label::after {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.input-group-prepend,
|
||||
.input-group-append {
|
||||
display: -ms-flexbox;
|
||||
@@ -3756,8 +3768,10 @@ input[type="button"].btn-block {
|
||||
|
||||
.input-group > .input-group-prepend > .btn,
|
||||
.input-group > .input-group-prepend > .input-group-text,
|
||||
.input-group > .input-group-append:not(:last-child) > .btn,
|
||||
.input-group > .input-group-append:not(:last-child) > .input-group-text,
|
||||
.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .btn,
|
||||
.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .input-group-text,
|
||||
.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .btn,
|
||||
.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .input-group-text,
|
||||
.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle),
|
||||
.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) {
|
||||
border-top-right-radius: 0;
|
||||
@@ -3776,9 +3790,13 @@ input[type="button"].btn-block {
|
||||
|
||||
.custom-control {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: block;
|
||||
min-height: 1.5rem;
|
||||
padding-left: 1.5rem;
|
||||
-webkit-print-color-adjust: exact;
|
||||
color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.custom-control-inline {
|
||||
@@ -3840,7 +3858,7 @@ input[type="button"].btn-block {
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
background-color: #fff;
|
||||
border: #adb5bd solid 1px;
|
||||
border: 1px solid #adb5bd;
|
||||
}
|
||||
|
||||
.custom-control-label::after {
|
||||
@@ -3851,7 +3869,7 @@ input[type="button"].btn-block {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
content: "";
|
||||
background: no-repeat 50% / 50% 50%;
|
||||
background: 50% / 50% 50% no-repeat;
|
||||
}
|
||||
|
||||
.custom-checkbox .custom-control-label::before {
|
||||
@@ -3940,7 +3958,7 @@ input[type="button"].btn-block {
|
||||
line-height: 1.5;
|
||||
color: #495057;
|
||||
vertical-align: middle;
|
||||
background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px;
|
||||
background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right 0.75rem center/8px 10px no-repeat;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: 0.25rem;
|
||||
-webkit-appearance: none;
|
||||
@@ -4009,6 +4027,7 @@ input[type="button"].btn-block {
|
||||
width: 100%;
|
||||
height: calc(1.5em + 0.75rem + 2px);
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@@ -4038,6 +4057,7 @@ input[type="button"].btn-block {
|
||||
z-index: 1;
|
||||
height: calc(1.5em + 0.75rem + 2px);
|
||||
padding: 0.375rem 0.75rem;
|
||||
overflow: hidden;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: #495057;
|
||||
@@ -4074,7 +4094,7 @@ input[type="button"].btn-block {
|
||||
}
|
||||
|
||||
.custom-range:focus {
|
||||
outline: none;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.custom-range:focus::-webkit-slider-thumb {
|
||||
@@ -4269,17 +4289,16 @@ input[type="button"].btn-block {
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-item {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link {
|
||||
margin-bottom: -1px;
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
border-top-left-radius: 0.25rem;
|
||||
border-top-right-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus {
|
||||
isolation: isolate;
|
||||
border-color: #e9ecef #e9ecef #dee2e6;
|
||||
}
|
||||
|
||||
@@ -4303,6 +4322,8 @@ input[type="button"].btn-block {
|
||||
}
|
||||
|
||||
.nav-pills .nav-link {
|
||||
background: none;
|
||||
border: 0;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
@@ -4312,12 +4333,14 @@ input[type="button"].btn-block {
|
||||
background-color: #007bff;
|
||||
}
|
||||
|
||||
.nav-fill > .nav-link,
|
||||
.nav-fill .nav-item {
|
||||
-ms-flex: 1 1 auto;
|
||||
flex: 1 1 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-justified > .nav-link,
|
||||
.nav-justified .nav-item {
|
||||
-ms-flex-preferred-size: 0;
|
||||
flex-basis: 0;
|
||||
@@ -4427,8 +4450,12 @@ input[type="button"].btn-block {
|
||||
height: 1.5em;
|
||||
vertical-align: middle;
|
||||
content: "";
|
||||
background: no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
background: 50% / 100% 100% no-repeat;
|
||||
}
|
||||
|
||||
.navbar-nav-scroll {
|
||||
max-height: 75vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
@@ -4462,6 +4489,9 @@ input[type="button"].btn-block {
|
||||
-ms-flex-wrap: nowrap;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.navbar-expand-sm .navbar-nav-scroll {
|
||||
overflow: visible;
|
||||
}
|
||||
.navbar-expand-sm .navbar-collapse {
|
||||
display: -ms-flexbox !important;
|
||||
display: flex !important;
|
||||
@@ -4504,6 +4534,9 @@ input[type="button"].btn-block {
|
||||
-ms-flex-wrap: nowrap;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.navbar-expand-md .navbar-nav-scroll {
|
||||
overflow: visible;
|
||||
}
|
||||
.navbar-expand-md .navbar-collapse {
|
||||
display: -ms-flexbox !important;
|
||||
display: flex !important;
|
||||
@@ -4546,6 +4579,9 @@ input[type="button"].btn-block {
|
||||
-ms-flex-wrap: nowrap;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.navbar-expand-lg .navbar-nav-scroll {
|
||||
overflow: visible;
|
||||
}
|
||||
.navbar-expand-lg .navbar-collapse {
|
||||
display: -ms-flexbox !important;
|
||||
display: flex !important;
|
||||
@@ -4588,6 +4624,9 @@ input[type="button"].btn-block {
|
||||
-ms-flex-wrap: nowrap;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.navbar-expand-xl .navbar-nav-scroll {
|
||||
overflow: visible;
|
||||
}
|
||||
.navbar-expand-xl .navbar-collapse {
|
||||
display: -ms-flexbox !important;
|
||||
display: flex !important;
|
||||
@@ -4632,6 +4671,10 @@ input[type="button"].btn-block {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.navbar-expand .navbar-nav-scroll {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.navbar-expand .navbar-collapse {
|
||||
display: -ms-flexbox !important;
|
||||
display: flex !important;
|
||||
@@ -4775,6 +4818,11 @@ input[type="button"].btn-block {
|
||||
border-bottom-left-radius: calc(0.25rem - 1px);
|
||||
}
|
||||
|
||||
.card > .card-header + .list-group,
|
||||
.card > .list-group + .card-footer {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
-ms-flex: 1 1 auto;
|
||||
flex: 1 1 auto;
|
||||
@@ -4814,10 +4862,6 @@ input[type="button"].btn-block {
|
||||
border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;
|
||||
}
|
||||
|
||||
.card-header + .list-group .list-group-item:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
padding: 0.75rem 1.25rem;
|
||||
background-color: rgba(0, 0, 0, 0.03);
|
||||
@@ -4847,6 +4891,7 @@ input[type="button"].btn-block {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 1.25rem;
|
||||
border-radius: calc(0.25rem - 1px);
|
||||
}
|
||||
|
||||
.card-img,
|
||||
@@ -4958,6 +5003,10 @@ input[type="button"].btn-block {
|
||||
}
|
||||
}
|
||||
|
||||
.accordion {
|
||||
overflow-anchor: none;
|
||||
}
|
||||
|
||||
.accordion > .card {
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -4990,17 +5039,12 @@ input[type="button"].btn-block {
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.breadcrumb-item {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.breadcrumb-item + .breadcrumb-item {
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
.breadcrumb-item + .breadcrumb-item::before {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
padding-right: 0.5rem;
|
||||
color: #6c757d;
|
||||
content: "/";
|
||||
@@ -5310,6 +5354,7 @@ a.badge-dark:focus, a.badge-dark.focus {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
padding: 0.75rem 1.25rem;
|
||||
color: inherit;
|
||||
}
|
||||
@@ -5482,8 +5527,8 @@ a.badge-dark:focus, a.badge-dark.focus {
|
||||
}
|
||||
|
||||
.progress-bar-animated {
|
||||
-webkit-animation: progress-bar-stripes 1s linear infinite;
|
||||
animation: progress-bar-stripes 1s linear infinite;
|
||||
-webkit-animation: 1s linear infinite progress-bar-stripes;
|
||||
animation: 1s linear infinite progress-bar-stripes;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
@@ -5876,15 +5921,14 @@ a.close.disabled {
|
||||
}
|
||||
|
||||
.toast {
|
||||
-ms-flex-preferred-size: 350px;
|
||||
flex-basis: 350px;
|
||||
max-width: 350px;
|
||||
overflow: hidden;
|
||||
font-size: 0.875rem;
|
||||
background-color: rgba(255, 255, 255, 0.85);
|
||||
background-clip: padding-box;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
backdrop-filter: blur(10px);
|
||||
opacity: 0;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
@@ -5916,6 +5960,8 @@ a.close.disabled {
|
||||
background-color: rgba(255, 255, 255, 0.85);
|
||||
background-clip: padding-box;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
||||
border-top-left-radius: calc(0.25rem - 1px);
|
||||
border-top-right-radius: calc(0.25rem - 1px);
|
||||
}
|
||||
|
||||
.toast-body {
|
||||
@@ -6161,7 +6207,7 @@ a.close.disabled {
|
||||
z-index: 1070;
|
||||
display: block;
|
||||
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-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
@@ -6172,8 +6218,8 @@ a.close.disabled {
|
||||
text-transform: none;
|
||||
letter-spacing: normal;
|
||||
word-break: normal;
|
||||
word-spacing: normal;
|
||||
white-space: normal;
|
||||
word-spacing: normal;
|
||||
line-break: auto;
|
||||
font-size: 0.875rem;
|
||||
word-wrap: break-word;
|
||||
@@ -6274,7 +6320,7 @@ a.close.disabled {
|
||||
z-index: 1060;
|
||||
display: block;
|
||||
max-width: 276px;
|
||||
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-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
@@ -6285,8 +6331,8 @@ a.close.disabled {
|
||||
text-transform: none;
|
||||
letter-spacing: normal;
|
||||
word-break: normal;
|
||||
word-spacing: normal;
|
||||
white-space: normal;
|
||||
word-spacing: normal;
|
||||
line-break: auto;
|
||||
font-size: 0.875rem;
|
||||
word-wrap: break-word;
|
||||
@@ -6527,8 +6573,11 @@ a.close.disabled {
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
width: 15%;
|
||||
padding: 0;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: none;
|
||||
border: 0;
|
||||
opacity: 0.5;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
@@ -6562,7 +6611,7 @@ a.close.disabled {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: no-repeat 50% / 100% 100%;
|
||||
background: 50% / 100% 100% no-repeat;
|
||||
}
|
||||
|
||||
.carousel-control-prev-icon {
|
||||
@@ -6647,12 +6696,12 @@ a.close.disabled {
|
||||
display: inline-block;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
vertical-align: text-bottom;
|
||||
border: 0.25em solid currentColor;
|
||||
vertical-align: -0.125em;
|
||||
border: 0.25em solid currentcolor;
|
||||
border-right-color: transparent;
|
||||
border-radius: 50%;
|
||||
-webkit-animation: spinner-border .75s linear infinite;
|
||||
animation: spinner-border .75s linear infinite;
|
||||
-webkit-animation: .75s linear infinite spinner-border;
|
||||
animation: .75s linear infinite spinner-border;
|
||||
}
|
||||
|
||||
.spinner-border-sm {
|
||||
@@ -6689,12 +6738,12 @@ a.close.disabled {
|
||||
display: inline-block;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
vertical-align: text-bottom;
|
||||
background-color: currentColor;
|
||||
vertical-align: -0.125em;
|
||||
background-color: currentcolor;
|
||||
border-radius: 50%;
|
||||
opacity: 0;
|
||||
-webkit-animation: spinner-grow .75s linear infinite;
|
||||
animation: spinner-grow .75s linear infinite;
|
||||
-webkit-animation: .75s linear infinite spinner-grow;
|
||||
animation: .75s linear infinite spinner-grow;
|
||||
}
|
||||
|
||||
.spinner-grow-sm {
|
||||
@@ -6702,6 +6751,14 @@ a.close.disabled {
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.spinner-border,
|
||||
.spinner-grow {
|
||||
-webkit-animation-duration: 1.5s;
|
||||
animation-duration: 1.5s;
|
||||
}
|
||||
}
|
||||
|
||||
.align-baseline {
|
||||
vertical-align: baseline !important;
|
||||
}
|
||||
@@ -7970,7 +8027,6 @@ button.bg-dark:focus {
|
||||
.user-select-all {
|
||||
-webkit-user-select: all !important;
|
||||
-moz-user-select: all !important;
|
||||
-ms-user-select: all !important;
|
||||
user-select: all !important;
|
||||
}
|
||||
|
||||
@@ -10182,6 +10238,7 @@ a.text-dark:hover, a.text-dark:focus {
|
||||
}
|
||||
|
||||
.text-break {
|
||||
word-break: break-word !important;
|
||||
word-wrap: break-word !important;
|
||||
}
|
||||
|
||||
@@ -10218,9 +10275,6 @@ a.text-dark:hover, a.text-dark:focus {
|
||||
border: 1px solid #adb5bd;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
tr,
|
||||
img {
|
||||
page-break-inside: avoid;
|
||||
|
||||
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
+897
-959
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
+888
-952
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
+38
-41
@@ -1,16 +1,18 @@
|
||||
/*!
|
||||
* Bootstrap alert.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap alert.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.jQuery, global.Util));
|
||||
})(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -25,32 +27,31 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.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;
|
||||
var EVENT_CLOSED = "closed" + EVENT_KEY;
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var CLASS_NAME_ALERT = 'alert';
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var EVENT_CLOSE = "close" + EVENT_KEY;
|
||||
var EVENT_CLOSED = "closed" + EVENT_KEY;
|
||||
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||
var SELECTOR_DISMISS = '[data-dismiss="alert"]';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Alert = /*#__PURE__*/function () {
|
||||
@@ -79,13 +80,13 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
_proto._getRootElement = function _getRootElement(element) {
|
||||
var selector = Util.getSelectorFromElement(element);
|
||||
var selector = Util__default["default"].getSelectorFromElement(element);
|
||||
var parent = false;
|
||||
|
||||
if (selector) {
|
||||
@@ -93,43 +94,43 @@
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
parent = $(element).closest("." + CLASS_NAME_ALERT)[0];
|
||||
parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0];
|
||||
}
|
||||
|
||||
return parent;
|
||||
};
|
||||
|
||||
_proto._triggerCloseEvent = function _triggerCloseEvent(element) {
|
||||
var closeEvent = $.Event(EVENT_CLOSE);
|
||||
$(element).trigger(closeEvent);
|
||||
var closeEvent = $__default["default"].Event(EVENT_CLOSE);
|
||||
$__default["default"](element).trigger(closeEvent);
|
||||
return closeEvent;
|
||||
};
|
||||
|
||||
_proto._removeElement = function _removeElement(element) {
|
||||
var _this = this;
|
||||
|
||||
$(element).removeClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](element).removeClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (!$(element).hasClass(CLASS_NAME_FADE)) {
|
||||
if (!$__default["default"](element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._destroyElement(element);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(element);
|
||||
$(element).one(Util.TRANSITION_END, function (event) {
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(element);
|
||||
$__default["default"](element).one(Util__default["default"].TRANSITION_END, function (event) {
|
||||
return _this._destroyElement(element, event);
|
||||
}).emulateTransitionEnd(transitionDuration);
|
||||
};
|
||||
|
||||
_proto._destroyElement = function _destroyElement(element) {
|
||||
$(element).detach().trigger(EVENT_CLOSED).remove();
|
||||
$__default["default"](element).detach().trigger(EVENT_CLOSED).remove();
|
||||
} // Static
|
||||
;
|
||||
|
||||
Alert._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var $element = $(this);
|
||||
var $element = $__default["default"](this);
|
||||
var data = $element.data(DATA_KEY);
|
||||
|
||||
if (!data) {
|
||||
@@ -163,28 +164,24 @@
|
||||
return Alert;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
|
||||
$__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Alert._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Alert;
|
||||
$__default["default"].fn[NAME] = Alert._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Alert;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Alert._jQueryInterface;
|
||||
};
|
||||
|
||||
return Alert;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=alert.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+45
-44
@@ -1,15 +1,17 @@
|
||||
/*!
|
||||
* Bootstrap button.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap button.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -24,24 +26,28 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'button';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.button';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var CLASS_NAME_ACTIVE = 'active';
|
||||
var CLASS_NAME_BUTTON = 'btn';
|
||||
var CLASS_NAME_FOCUS = 'focus';
|
||||
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;
|
||||
var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
|
||||
var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
|
||||
var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
|
||||
@@ -49,18 +55,14 @@
|
||||
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
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Button = /*#__PURE__*/function () {
|
||||
function Button(element) {
|
||||
this._element = element;
|
||||
this.shouldAvoidTriggerChange = false;
|
||||
} // Getters
|
||||
|
||||
|
||||
@@ -70,7 +72,7 @@
|
||||
_proto.toggle = function toggle() {
|
||||
var triggerChangeEvent = true;
|
||||
var addAriaPressed = true;
|
||||
var rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0];
|
||||
var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0];
|
||||
|
||||
if (rootElement) {
|
||||
var input = this._element.querySelector(SELECTOR_INPUT);
|
||||
@@ -83,7 +85,7 @@
|
||||
var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
|
||||
|
||||
if (activeElement) {
|
||||
$(activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +96,9 @@
|
||||
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
$(input).trigger('change');
|
||||
if (!this.shouldAvoidTriggerChange) {
|
||||
$__default["default"](input).trigger('change');
|
||||
}
|
||||
}
|
||||
|
||||
input.focus();
|
||||
@@ -108,26 +112,29 @@
|
||||
}
|
||||
|
||||
if (triggerChangeEvent) {
|
||||
$(this._element).toggleClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Static
|
||||
;
|
||||
|
||||
Button._jQueryInterface = function _jQueryInterface(config) {
|
||||
Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) {
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var $element = $__default["default"](this);
|
||||
var data = $element.data(DATA_KEY);
|
||||
|
||||
if (!data) {
|
||||
data = new Button(this);
|
||||
$(this).data(DATA_KEY, data);
|
||||
$element.data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
data.shouldAvoidTriggerChange = avoidTriggerChange;
|
||||
|
||||
if (config === 'toggle') {
|
||||
data[config]();
|
||||
}
|
||||
@@ -144,18 +151,16 @@
|
||||
return Button;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
|
||||
$__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
|
||||
var button = event.target;
|
||||
var initialButton = button;
|
||||
|
||||
if (!$(button).hasClass(CLASS_NAME_BUTTON)) {
|
||||
button = $(button).closest(SELECTOR_BUTTON)[0];
|
||||
if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) {
|
||||
button = $__default["default"](button).closest(SELECTOR_BUTTON)[0];
|
||||
}
|
||||
|
||||
if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
|
||||
@@ -169,17 +174,15 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (initialButton.tagName === 'LABEL' && inputBtn && inputBtn.type === 'checkbox') {
|
||||
event.preventDefault(); // work around event sent to label and input
|
||||
if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {
|
||||
Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT');
|
||||
}
|
||||
|
||||
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));
|
||||
var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0];
|
||||
$__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
|
||||
});
|
||||
$(window).on(EVENT_LOAD_DATA_API, function () {
|
||||
$__default["default"](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));
|
||||
@@ -209,20 +212,18 @@
|
||||
}
|
||||
});
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Button._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Button;
|
||||
$__default["default"].fn[NAME] = Button._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Button;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Button._jQueryInterface;
|
||||
};
|
||||
|
||||
return Button;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=button.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+128
-155
@@ -1,16 +1,18 @@
|
||||
/*!
|
||||
* Bootstrap carousel.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap carousel.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Carousel = factory(global.jQuery, global.Util));
|
||||
})(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -25,70 +27,39 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
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;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'carousel';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.carousel';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
|
||||
|
||||
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
|
||||
@@ -96,22 +67,14 @@
|
||||
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
||||
|
||||
var SWIPE_THRESHOLD = 40;
|
||||
var Default = {
|
||||
interval: 5000,
|
||||
keyboard: true,
|
||||
slide: false,
|
||||
pause: 'hover',
|
||||
wrap: true,
|
||||
touch: true
|
||||
};
|
||||
var DefaultType = {
|
||||
interval: '(number|boolean)',
|
||||
keyboard: 'boolean',
|
||||
slide: '(boolean|string)',
|
||||
pause: '(string|boolean)',
|
||||
wrap: 'boolean',
|
||||
touch: 'boolean'
|
||||
};
|
||||
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 DIRECTION_NEXT = 'next';
|
||||
var DIRECTION_PREV = 'prev';
|
||||
var DIRECTION_LEFT = 'left';
|
||||
@@ -129,14 +92,6 @@
|
||||
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';
|
||||
@@ -145,14 +100,28 @@
|
||||
var SELECTOR_INDICATORS = '.carousel-indicators';
|
||||
var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
|
||||
var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
|
||||
var Default = {
|
||||
interval: 5000,
|
||||
keyboard: true,
|
||||
slide: false,
|
||||
pause: 'hover',
|
||||
wrap: true,
|
||||
touch: true
|
||||
};
|
||||
var DefaultType = {
|
||||
interval: '(number|boolean)',
|
||||
keyboard: 'boolean',
|
||||
slide: '(boolean|string)',
|
||||
pause: '(string|boolean)',
|
||||
wrap: 'boolean',
|
||||
touch: 'boolean'
|
||||
};
|
||||
var PointerType = {
|
||||
TOUCH: 'touch',
|
||||
PEN: 'pen'
|
||||
};
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Carousel = /*#__PURE__*/function () {
|
||||
@@ -185,9 +154,10 @@
|
||||
};
|
||||
|
||||
_proto.nextWhenVisible = function nextWhenVisible() {
|
||||
// Don't call next when the page isn't visible
|
||||
var $element = $__default["default"](this._element); // Don't call next when the page isn't visible
|
||||
// or the carousel or its parent isn't visible
|
||||
if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
|
||||
|
||||
if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') {
|
||||
this.next();
|
||||
}
|
||||
};
|
||||
@@ -204,7 +174,7 @@
|
||||
}
|
||||
|
||||
if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
|
||||
Util.triggerTransitionEnd(this._element);
|
||||
Util__default["default"].triggerTransitionEnd(this._element);
|
||||
this.cycle(true);
|
||||
}
|
||||
|
||||
@@ -223,6 +193,8 @@
|
||||
}
|
||||
|
||||
if (this._config.interval && !this._isPaused) {
|
||||
this._updateInterval();
|
||||
|
||||
this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
|
||||
}
|
||||
};
|
||||
@@ -239,7 +211,7 @@
|
||||
}
|
||||
|
||||
if (this._isSliding) {
|
||||
$(this._element).one(EVENT_SLID, function () {
|
||||
$__default["default"](this._element).one(EVENT_SLID, function () {
|
||||
return _this.to(index);
|
||||
});
|
||||
return;
|
||||
@@ -257,8 +229,8 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
$(this._element).off(EVENT_KEY);
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$__default["default"](this._element).off(EVENT_KEY);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
this._items = null;
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
@@ -271,8 +243,8 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default), config);
|
||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||
config = _extends({}, Default, config);
|
||||
Util__default["default"].typeCheckConfig(NAME, config, DefaultType);
|
||||
return config;
|
||||
};
|
||||
|
||||
@@ -300,13 +272,13 @@
|
||||
var _this2 = this;
|
||||
|
||||
if (this._config.keyboard) {
|
||||
$(this._element).on(EVENT_KEYDOWN, function (event) {
|
||||
$__default["default"](this._element).on(EVENT_KEYDOWN, function (event) {
|
||||
return _this2._keydown(event);
|
||||
});
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
$(this._element).on(EVENT_MOUSEENTER, function (event) {
|
||||
$__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) {
|
||||
return _this2.pause(event);
|
||||
}).on(EVENT_MOUSELEAVE, function (event) {
|
||||
return _this2.cycle(event);
|
||||
@@ -335,11 +307,7 @@
|
||||
|
||||
var move = function move(event) {
|
||||
// ensure swiping with one touch and not pinching
|
||||
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
|
||||
_this3.touchDeltaX = 0;
|
||||
} else {
|
||||
_this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
|
||||
}
|
||||
_this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX;
|
||||
};
|
||||
|
||||
var end = function end(event) {
|
||||
@@ -369,27 +337,27 @@
|
||||
}
|
||||
};
|
||||
|
||||
$(this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {
|
||||
$__default["default"](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) {
|
||||
$__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) {
|
||||
return start(event);
|
||||
});
|
||||
$(this._element).on(EVENT_POINTERUP, function (event) {
|
||||
$__default["default"](this._element).on(EVENT_POINTERUP, function (event) {
|
||||
return end(event);
|
||||
});
|
||||
|
||||
this._element.classList.add(CLASS_NAME_POINTER_EVENT);
|
||||
} else {
|
||||
$(this._element).on(EVENT_TOUCHSTART, function (event) {
|
||||
$__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) {
|
||||
return start(event);
|
||||
});
|
||||
$(this._element).on(EVENT_TOUCHMOVE, function (event) {
|
||||
$__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) {
|
||||
return move(event);
|
||||
});
|
||||
$(this._element).on(EVENT_TOUCHEND, function (event) {
|
||||
$__default["default"](this._element).on(EVENT_TOUCHEND, function (event) {
|
||||
return end(event);
|
||||
});
|
||||
}
|
||||
@@ -441,29 +409,46 @@
|
||||
|
||||
var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
|
||||
|
||||
var slideEvent = $.Event(EVENT_SLIDE, {
|
||||
var slideEvent = $__default["default"].Event(EVENT_SLIDE, {
|
||||
relatedTarget: relatedTarget,
|
||||
direction: eventDirectionName,
|
||||
from: fromIndex,
|
||||
to: targetIndex
|
||||
});
|
||||
$(this._element).trigger(slideEvent);
|
||||
$__default["default"](this._element).trigger(slideEvent);
|
||||
return slideEvent;
|
||||
};
|
||||
|
||||
_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
|
||||
if (this._indicatorsElement) {
|
||||
var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE));
|
||||
$(indicators).removeClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE);
|
||||
|
||||
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
||||
|
||||
if (nextIndicator) {
|
||||
$(nextIndicator).addClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_proto._updateInterval = function _updateInterval() {
|
||||
var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM);
|
||||
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
var elementInterval = parseInt(element.getAttribute('data-interval'), 10);
|
||||
|
||||
if (elementInterval) {
|
||||
this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
|
||||
this._config.interval = elementInterval;
|
||||
} else {
|
||||
this._config.interval = this._config.defaultInterval || this._config.interval;
|
||||
}
|
||||
};
|
||||
|
||||
_proto._slide = function _slide(direction, element) {
|
||||
var _this4 = this;
|
||||
|
||||
@@ -490,7 +475,7 @@
|
||||
eventDirectionName = DIRECTION_RIGHT;
|
||||
}
|
||||
|
||||
if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE)) {
|
||||
if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE)) {
|
||||
this._isSliding = false;
|
||||
return;
|
||||
}
|
||||
@@ -514,41 +499,33 @@
|
||||
|
||||
this._setActiveIndicatorElement(nextElement);
|
||||
|
||||
var slidEvent = $.Event(EVENT_SLID, {
|
||||
this._activeElement = nextElement;
|
||||
var slidEvent = $__default["default"].Event(EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
to: nextElementIndex
|
||||
});
|
||||
|
||||
if ($(this._element).hasClass(CLASS_NAME_SLIDE)) {
|
||||
$(nextElement).addClass(orderClassName);
|
||||
Util.reflow(nextElement);
|
||||
$(activeElement).addClass(directionalClassName);
|
||||
$(nextElement).addClass(directionalClassName);
|
||||
var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
|
||||
|
||||
if (nextElementInterval) {
|
||||
this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
|
||||
this._config.interval = nextElementInterval;
|
||||
} else {
|
||||
this._config.interval = this._config.defaultInterval || this._config.interval;
|
||||
}
|
||||
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
|
||||
$(activeElement).one(Util.TRANSITION_END, function () {
|
||||
$(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE);
|
||||
$(activeElement).removeClass(CLASS_NAME_ACTIVE + " " + orderClassName + " " + directionalClassName);
|
||||
if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) {
|
||||
$__default["default"](nextElement).addClass(orderClassName);
|
||||
Util__default["default"].reflow(nextElement);
|
||||
$__default["default"](activeElement).addClass(directionalClassName);
|
||||
$__default["default"](nextElement).addClass(directionalClassName);
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(activeElement);
|
||||
$__default["default"](activeElement).one(Util__default["default"].TRANSITION_END, function () {
|
||||
$__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE + " " + orderClassName + " " + directionalClassName);
|
||||
_this4._isSliding = false;
|
||||
setTimeout(function () {
|
||||
return $(_this4._element).trigger(slidEvent);
|
||||
return $__default["default"](_this4._element).trigger(slidEvent);
|
||||
}, 0);
|
||||
}).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
$(activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||
$(nextElement).addClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE);
|
||||
this._isSliding = false;
|
||||
$(this._element).trigger(slidEvent);
|
||||
$__default["default"](this._element).trigger(slidEvent);
|
||||
}
|
||||
|
||||
if (isCycling) {
|
||||
@@ -559,19 +536,19 @@
|
||||
|
||||
Carousel._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var data = $__default["default"](this).data(DATA_KEY);
|
||||
|
||||
var _config = _objectSpread2(_objectSpread2({}, Default), $(this).data());
|
||||
var _config = _extends({}, Default, $__default["default"](this).data());
|
||||
|
||||
if (typeof config === 'object') {
|
||||
_config = _objectSpread2(_objectSpread2({}, _config), config);
|
||||
_config = _extends({}, _config, config);
|
||||
}
|
||||
|
||||
var action = typeof config === 'string' ? config : _config.slide;
|
||||
|
||||
if (!data) {
|
||||
data = new Carousel(this, _config);
|
||||
$(this).data(DATA_KEY, data);
|
||||
$__default["default"](this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'number') {
|
||||
@@ -590,19 +567,19 @@
|
||||
};
|
||||
|
||||
Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
|
||||
var selector = Util.getSelectorFromElement(this);
|
||||
var selector = Util__default["default"].getSelectorFromElement(this);
|
||||
|
||||
if (!selector) {
|
||||
return;
|
||||
}
|
||||
|
||||
var target = $(selector)[0];
|
||||
var target = $__default["default"](selector)[0];
|
||||
|
||||
if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
|
||||
if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var config = _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data());
|
||||
var config = _extends({}, $__default["default"](target).data(), $__default["default"](this).data());
|
||||
|
||||
var slideIndex = this.getAttribute('data-slide-to');
|
||||
|
||||
@@ -610,10 +587,10 @@
|
||||
config.interval = false;
|
||||
}
|
||||
|
||||
Carousel._jQueryInterface.call($(target), config);
|
||||
Carousel._jQueryInterface.call($__default["default"](target), config);
|
||||
|
||||
if (slideIndex) {
|
||||
$(target).data(DATA_KEY).to(slideIndex);
|
||||
$__default["default"](target).data(DATA_KEY).to(slideIndex);
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
@@ -634,37 +611,33 @@
|
||||
return Carousel;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
|
||||
$(window).on(EVENT_LOAD_DATA_API, function () {
|
||||
$__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
|
||||
$__default["default"](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]);
|
||||
var $carousel = $__default["default"](carousels[i]);
|
||||
|
||||
Carousel._jQueryInterface.call($carousel, $carousel.data());
|
||||
}
|
||||
});
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Carousel._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Carousel;
|
||||
$__default["default"].fn[NAME] = Carousel._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Carousel;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Carousel._jQueryInterface;
|
||||
};
|
||||
|
||||
return Carousel;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=carousel.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+90
-125
@@ -1,16 +1,18 @@
|
||||
/*!
|
||||
* Bootstrap collapse.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap collapse.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.jQuery, global.Util));
|
||||
})(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -25,70 +27,52 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
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;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'collapse';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.collapse';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
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 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 SELECTOR_ACTIVES = '.show, .collapsing';
|
||||
var SELECTOR_DATA_TOGGLE = '[data-toggle="collapse"]';
|
||||
var Default = {
|
||||
toggle: true,
|
||||
parent: ''
|
||||
@@ -97,23 +81,8 @@
|
||||
toggle: 'boolean',
|
||||
parent: '(string|element)'
|
||||
};
|
||||
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
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Collapse = /*#__PURE__*/function () {
|
||||
@@ -126,7 +95,7 @@
|
||||
|
||||
for (var i = 0, len = toggleList.length; i < len; i++) {
|
||||
var elem = toggleList[i];
|
||||
var selector = Util.getSelectorFromElement(elem);
|
||||
var selector = Util__default["default"].getSelectorFromElement(elem);
|
||||
var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
|
||||
return foundElem === element;
|
||||
});
|
||||
@@ -154,7 +123,7 @@
|
||||
|
||||
// Public
|
||||
_proto.toggle = function toggle() {
|
||||
if ($(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
this.hide();
|
||||
} else {
|
||||
this.show();
|
||||
@@ -164,7 +133,7 @@
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
|
||||
if (this._isTransitioning || $(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -186,64 +155,64 @@
|
||||
}
|
||||
|
||||
if (actives) {
|
||||
activesData = $(actives).not(this._selector).data(DATA_KEY);
|
||||
activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY);
|
||||
|
||||
if (activesData && activesData._isTransitioning) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var startEvent = $.Event(EVENT_SHOW);
|
||||
$(this._element).trigger(startEvent);
|
||||
var startEvent = $__default["default"].Event(EVENT_SHOW);
|
||||
$__default["default"](this._element).trigger(startEvent);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (actives) {
|
||||
Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
|
||||
Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), 'hide');
|
||||
|
||||
if (!activesData) {
|
||||
$(actives).data(DATA_KEY, null);
|
||||
$__default["default"](actives).data(DATA_KEY, null);
|
||||
}
|
||||
}
|
||||
|
||||
var dimension = this._getDimension();
|
||||
|
||||
$(this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
|
||||
$__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
|
||||
this._element.style[dimension] = 0;
|
||||
|
||||
if (this._triggerArray.length) {
|
||||
$(this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
|
||||
$__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
|
||||
}
|
||||
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
$(_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW);
|
||||
$__default["default"](_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);
|
||||
$__default["default"](_this._element).trigger(EVENT_SHOWN);
|
||||
};
|
||||
|
||||
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||
var scrollSize = "scroll" + capitalizedDimension;
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this._element);
|
||||
$__default["default"](this._element).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
this._element.style[dimension] = this._element[scrollSize] + "px";
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isTransitioning || !$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var startEvent = $.Event(EVENT_HIDE);
|
||||
$(this._element).trigger(startEvent);
|
||||
var startEvent = $__default["default"].Event(EVENT_HIDE);
|
||||
$__default["default"](this._element).trigger(startEvent);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
@@ -252,20 +221,20 @@
|
||||
var dimension = this._getDimension();
|
||||
|
||||
this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
|
||||
Util.reflow(this._element);
|
||||
$(this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW);
|
||||
Util__default["default"].reflow(this._element);
|
||||
$__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW);
|
||||
var triggerArrayLength = this._triggerArray.length;
|
||||
|
||||
if (triggerArrayLength > 0) {
|
||||
for (var i = 0; i < triggerArrayLength; i++) {
|
||||
var trigger = this._triggerArray[i];
|
||||
var selector = Util.getSelectorFromElement(trigger);
|
||||
var selector = Util__default["default"].getSelectorFromElement(trigger);
|
||||
|
||||
if (selector !== null) {
|
||||
var $elem = $([].slice.call(document.querySelectorAll(selector)));
|
||||
var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector)));
|
||||
|
||||
if (!$elem.hasClass(CLASS_NAME_SHOW)) {
|
||||
$(trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
|
||||
$__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,12 +245,12 @@
|
||||
var complete = function complete() {
|
||||
_this2.setTransitioning(false);
|
||||
|
||||
$(_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
|
||||
$__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this._element);
|
||||
$__default["default"](this._element).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
};
|
||||
|
||||
_proto.setTransitioning = function setTransitioning(isTransitioning) {
|
||||
@@ -289,7 +258,7 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
this._config = null;
|
||||
this._parent = null;
|
||||
this._element = null;
|
||||
@@ -299,15 +268,15 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default), config);
|
||||
config = _extends({}, Default, config);
|
||||
config.toggle = Boolean(config.toggle); // Coerce string values
|
||||
|
||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||
Util__default["default"].typeCheckConfig(NAME, config, DefaultType);
|
||||
return config;
|
||||
};
|
||||
|
||||
_proto._getDimension = function _getDimension() {
|
||||
var hasWidth = $(this._element).hasClass(DIMENSION_WIDTH);
|
||||
var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH);
|
||||
return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
|
||||
};
|
||||
|
||||
@@ -316,7 +285,7 @@
|
||||
|
||||
var parent;
|
||||
|
||||
if (Util.isElement(this._config.parent)) {
|
||||
if (Util__default["default"].isElement(this._config.parent)) {
|
||||
parent = this._config.parent; // It's a jQuery object
|
||||
|
||||
if (typeof this._config.parent.jquery !== 'undefined') {
|
||||
@@ -328,32 +297,32 @@
|
||||
|
||||
var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
|
||||
var children = [].slice.call(parent.querySelectorAll(selector));
|
||||
$(children).each(function (i, element) {
|
||||
$__default["default"](children).each(function (i, element) {
|
||||
_this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
|
||||
});
|
||||
return parent;
|
||||
};
|
||||
|
||||
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
|
||||
var isOpen = $(element).hasClass(CLASS_NAME_SHOW);
|
||||
var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (triggerArray.length) {
|
||||
$(triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||
$__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||
}
|
||||
} // Static
|
||||
;
|
||||
|
||||
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
|
||||
var selector = Util.getSelectorFromElement(element);
|
||||
var selector = Util__default["default"].getSelectorFromElement(element);
|
||||
return selector ? document.querySelector(selector) : null;
|
||||
};
|
||||
|
||||
Collapse._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data(DATA_KEY);
|
||||
var $element = $__default["default"](this);
|
||||
var data = $element.data(DATA_KEY);
|
||||
|
||||
var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default), $this.data()), typeof config === 'object' && config ? config : {});
|
||||
var _config = _extends({}, Default, $element.data(), typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||
_config.toggle = false;
|
||||
@@ -361,7 +330,7 @@
|
||||
|
||||
if (!data) {
|
||||
data = new Collapse(this, _config);
|
||||
$this.data(DATA_KEY, data);
|
||||
$element.data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
@@ -389,23 +358,21 @@
|
||||
return Collapse;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
$__default["default"](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();
|
||||
}
|
||||
|
||||
var $trigger = $(this);
|
||||
var selector = Util.getSelectorFromElement(this);
|
||||
var $trigger = $__default["default"](this);
|
||||
var selector = Util__default["default"].getSelectorFromElement(this);
|
||||
var selectors = [].slice.call(document.querySelectorAll(selector));
|
||||
$(selectors).each(function () {
|
||||
var $target = $(this);
|
||||
$__default["default"](selectors).each(function () {
|
||||
var $target = $__default["default"](this);
|
||||
var data = $target.data(DATA_KEY);
|
||||
var config = data ? 'toggle' : $trigger.data();
|
||||
|
||||
@@ -413,20 +380,18 @@
|
||||
});
|
||||
});
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Collapse._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Collapse;
|
||||
$__default["default"].fn[NAME] = Collapse._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Collapse;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Collapse._jQueryInterface;
|
||||
};
|
||||
|
||||
return Collapse;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=collapse.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+95
-133
@@ -1,17 +1,19 @@
|
||||
/*!
|
||||
* Bootstrap dropdown.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap dropdown.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.jQuery, global.Popper, global.Util));
|
||||
})(this, (function ($, Popper, Util) { 'use strict';
|
||||
|
||||
$ = $ && 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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -26,70 +28,39 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
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;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'dropdown';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.dropdown';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
||||
|
||||
var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
|
||||
@@ -103,6 +74,13 @@
|
||||
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 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 EVENT_HIDE = "hide" + EVENT_KEY;
|
||||
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||
@@ -111,13 +89,6 @@
|
||||
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';
|
||||
@@ -146,9 +117,7 @@
|
||||
popperConfig: '(null|object)'
|
||||
};
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Dropdown = /*#__PURE__*/function () {
|
||||
@@ -167,11 +136,11 @@
|
||||
|
||||
// Public
|
||||
_proto.toggle = function toggle() {
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var isActive = $(this._menu).hasClass(CLASS_NAME_SHOW);
|
||||
var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW);
|
||||
|
||||
Dropdown._clearMenus();
|
||||
|
||||
@@ -187,38 +156,35 @@
|
||||
usePopper = false;
|
||||
}
|
||||
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||
if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
};
|
||||
var showEvent = $.Event(EVENT_SHOW, relatedTarget);
|
||||
var showEvent = $__default["default"].Event(EVENT_SHOW, relatedTarget);
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
|
||||
$(parent).trigger(showEvent);
|
||||
$__default["default"](parent).trigger(showEvent);
|
||||
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
} // Disable totally Popper.js for Dropdown in Navbar
|
||||
} // Totally disable Popper for Dropdowns in Navbar
|
||||
|
||||
|
||||
if (!this._inNavbar && usePopper) {
|
||||
/**
|
||||
* Check for Popper dependency
|
||||
* Popper - https://popper.js.org
|
||||
*/
|
||||
if (typeof Popper === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
|
||||
// Check for Popper dependency
|
||||
if (typeof Popper__default["default"] === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
||||
}
|
||||
|
||||
var referenceElement = this._element;
|
||||
|
||||
if (this._config.reference === 'parent') {
|
||||
referenceElement = parent;
|
||||
} else if (Util.isElement(this._config.reference)) {
|
||||
} else if (Util__default["default"].isElement(this._config.reference)) {
|
||||
referenceElement = this._config.reference; // Check if it's jQuery element
|
||||
|
||||
if (typeof this._config.reference.jquery !== 'undefined') {
|
||||
@@ -230,41 +196,41 @@
|
||||
|
||||
|
||||
if (this._config.boundary !== 'scrollParent') {
|
||||
$(parent).addClass(CLASS_NAME_POSITION_STATIC);
|
||||
$__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC);
|
||||
}
|
||||
|
||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
|
||||
this._popper = new Popper__default["default"](referenceElement, this._menu, this._getPopperConfig());
|
||||
} // 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
|
||||
|
||||
|
||||
if ('ontouchstart' in document.documentElement && $(parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
|
||||
$(document.body).children().on('mouseover', null, $.noop);
|
||||
if ('ontouchstart' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
|
||||
$__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop);
|
||||
}
|
||||
|
||||
this._element.focus();
|
||||
|
||||
this._element.setAttribute('aria-expanded', true);
|
||||
|
||||
$(this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||
$(parent).toggleClass(CLASS_NAME_SHOW).trigger($.Event(EVENT_SHOWN, relatedTarget));
|
||||
$__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](parent).toggleClass(CLASS_NAME_SHOW).trigger($__default["default"].Event(EVENT_SHOWN, relatedTarget));
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||
if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
};
|
||||
var hideEvent = $.Event(EVENT_HIDE, relatedTarget);
|
||||
var hideEvent = $__default["default"].Event(EVENT_HIDE, relatedTarget);
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this._element);
|
||||
|
||||
$(parent).trigger(hideEvent);
|
||||
$__default["default"](parent).trigger(hideEvent);
|
||||
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
@@ -274,13 +240,13 @@
|
||||
this._popper.destroy();
|
||||
}
|
||||
|
||||
$(this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||
$(parent).toggleClass(CLASS_NAME_SHOW).trigger($.Event(EVENT_HIDDEN, relatedTarget));
|
||||
$__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](parent).toggleClass(CLASS_NAME_SHOW).trigger($__default["default"].Event(EVENT_HIDDEN, relatedTarget));
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$(this._element).off(EVENT_KEY);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
$__default["default"](this._element).off(EVENT_KEY);
|
||||
this._element = null;
|
||||
this._menu = null;
|
||||
|
||||
@@ -303,7 +269,7 @@
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this = this;
|
||||
|
||||
$(this._element).on(EVENT_CLICK, function (event) {
|
||||
$__default["default"](this._element).on(EVENT_CLICK, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
@@ -312,8 +278,8 @@
|
||||
};
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), $(this._element).data()), config);
|
||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
config = _extends({}, this.constructor.Default, $__default["default"](this._element).data(), config);
|
||||
Util__default["default"].typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
return config;
|
||||
};
|
||||
|
||||
@@ -330,16 +296,16 @@
|
||||
};
|
||||
|
||||
_proto._getPlacement = function _getPlacement() {
|
||||
var $parentDropdown = $(this._element.parentNode);
|
||||
var $parentDropdown = $__default["default"](this._element.parentNode);
|
||||
var placement = PLACEMENT_BOTTOM; // Handle dropup
|
||||
|
||||
if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
|
||||
placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
placement = $__default["default"](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)) {
|
||||
} else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
|
||||
placement = PLACEMENT_BOTTOMEND;
|
||||
}
|
||||
|
||||
@@ -347,7 +313,7 @@
|
||||
};
|
||||
|
||||
_proto._detectNavbar = function _detectNavbar() {
|
||||
return $(this._element).closest('.navbar').length > 0;
|
||||
return $__default["default"](this._element).closest('.navbar').length > 0;
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
@@ -357,7 +323,7 @@
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element));
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@@ -379,7 +345,7 @@
|
||||
boundariesElement: this._config.boundary
|
||||
}
|
||||
}
|
||||
}; // Disable Popper.js if we have a static display
|
||||
}; // Disable Popper if we have a static display
|
||||
|
||||
if (this._config.display === 'static') {
|
||||
popperConfig.modifiers.applyStyle = {
|
||||
@@ -387,19 +353,19 @@
|
||||
};
|
||||
}
|
||||
|
||||
return _objectSpread2(_objectSpread2({}, popperConfig), this._config.popperConfig);
|
||||
return _extends({}, popperConfig, this._config.popperConfig);
|
||||
} // Static
|
||||
;
|
||||
|
||||
Dropdown._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var data = $__default["default"](this).data(DATA_KEY);
|
||||
|
||||
var _config = typeof config === 'object' ? config : null;
|
||||
|
||||
if (!data) {
|
||||
data = new Dropdown(this, _config);
|
||||
$(this).data(DATA_KEY, data);
|
||||
$__default["default"](this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
@@ -422,7 +388,7 @@
|
||||
for (var i = 0, len = toggles.length; i < len; i++) {
|
||||
var parent = Dropdown._getParentFromElement(toggles[i]);
|
||||
|
||||
var context = $(toggles[i]).data(DATA_KEY);
|
||||
var context = $__default["default"](toggles[i]).data(DATA_KEY);
|
||||
var relatedTarget = {
|
||||
relatedTarget: toggles[i]
|
||||
};
|
||||
@@ -437,16 +403,16 @@
|
||||
|
||||
var dropdownMenu = context._menu;
|
||||
|
||||
if (!$(parent).hasClass(CLASS_NAME_SHOW)) {
|
||||
if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
|
||||
if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(EVENT_HIDE, relatedTarget);
|
||||
$(parent).trigger(hideEvent);
|
||||
var hideEvent = $__default["default"].Event(EVENT_HIDE, relatedTarget);
|
||||
$__default["default"](parent).trigger(hideEvent);
|
||||
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
continue;
|
||||
@@ -455,7 +421,7 @@
|
||||
|
||||
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
$(document.body).children().off('mouseover', null, $.noop);
|
||||
$__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop);
|
||||
}
|
||||
|
||||
toggles[i].setAttribute('aria-expanded', 'false');
|
||||
@@ -464,14 +430,14 @@
|
||||
context._popper.destroy();
|
||||
}
|
||||
|
||||
$(dropdownMenu).removeClass(CLASS_NAME_SHOW);
|
||||
$(parent).removeClass(CLASS_NAME_SHOW).trigger($.Event(EVENT_HIDDEN, relatedTarget));
|
||||
$__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](parent).removeClass(CLASS_NAME_SHOW).trigger($__default["default"].Event(EVENT_HIDDEN, relatedTarget));
|
||||
}
|
||||
};
|
||||
|
||||
Dropdown._getParentFromElement = function _getParentFromElement(element) {
|
||||
var parent;
|
||||
var selector = Util.getSelectorFromElement(element);
|
||||
var selector = Util__default["default"].getSelectorFromElement(element);
|
||||
|
||||
if (selector) {
|
||||
parent = document.querySelector(selector);
|
||||
@@ -489,17 +455,17 @@
|
||||
// - 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 || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
|
||||
if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this);
|
||||
|
||||
var isActive = $(parent).hasClass(CLASS_NAME_SHOW);
|
||||
var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||
return;
|
||||
@@ -508,17 +474,17 @@
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||
if (!isActive || event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE) {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
$(parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus');
|
||||
$__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus');
|
||||
}
|
||||
|
||||
$(this).trigger('click');
|
||||
$__default["default"](this).trigger('click');
|
||||
return;
|
||||
}
|
||||
|
||||
var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
|
||||
return $(item).is(':visible');
|
||||
return $__default["default"](item).is(':visible');
|
||||
});
|
||||
|
||||
if (items.length === 0) {
|
||||
@@ -564,35 +530,31 @@
|
||||
return Dropdown;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
$(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) {
|
||||
$__default["default"](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');
|
||||
Dropdown._jQueryInterface.call($__default["default"](this), 'toggle');
|
||||
}).on(EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Dropdown._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Dropdown;
|
||||
$__default["default"].fn[NAME] = Dropdown._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Dropdown;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Dropdown._jQueryInterface;
|
||||
};
|
||||
|
||||
return Dropdown;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=dropdown.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-2
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.4.0): index.js
|
||||
* Bootstrap (v4.6.0): index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -20,4 +20,3 @@
|
||||
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
|
||||
}
|
||||
})($);
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/index.js"],"names":["$","TypeError","version","fn","jquery","split","minMajor","ltMajor","minMinor","minPatch","maxMajor","Error"],"mappings":"AAaA;;;;;;AAOA,CAAC,UAACA,CAAD,EAAO;AACN,MAAI,OAAOA,CAAP,KAAa,WAAjB,EAA8B;AAC5B,UAAM,IAAIC,SAAJ,CAAc,kGAAd,CAAN;AACD;;AAED,MAAMC,UAAUF,EAAEG,EAAF,CAAKC,MAAL,CAAYC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,UAAU,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;;AAEA,MAAIR,QAAQ,CAAR,IAAaK,OAAb,IAAwBL,QAAQ,CAAR,IAAaM,QAArC,IAAiDN,QAAQ,CAAR,MAAeI,QAAf,IAA2BJ,QAAQ,CAAR,MAAeM,QAA1C,IAAsDN,QAAQ,CAAR,IAAaO,QAApH,IAAgIP,QAAQ,CAAR,KAAcQ,QAAlJ,EAA4J;AAC1J,UAAM,IAAIC,KAAJ,CAAU,8EAAV,CAAN;AACD;AACF,CAfD,EAeGX,CAfH","sourcesContent":["import $ from 'jquery'\nimport Alert from './alert'\nimport Button from './button'\nimport Carousel from './carousel'\nimport Collapse from './collapse'\nimport Dropdown from './dropdown'\nimport Modal from './modal'\nimport Popover from './popover'\nimport Scrollspy from './scrollspy'\nimport Tab from './tab'\nimport Tooltip from './tooltip'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.2): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n(($) => {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n})($)\n\nexport {\n Util,\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Popover,\n Scrollspy,\n Tab,\n Tooltip\n}\n"],"file":"index.js"}
|
||||
Vendored
+167
-185
@@ -1,16 +1,18 @@
|
||||
/*!
|
||||
* Bootstrap modal.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap modal.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.jQuery, global.Util));
|
||||
})(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -25,84 +27,48 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
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;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'modal';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.modal';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
||||
|
||||
var Default = {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
focus: true,
|
||||
show: true
|
||||
};
|
||||
var DefaultType = {
|
||||
backdrop: '(boolean|string)',
|
||||
keyboard: 'boolean',
|
||||
focus: 'boolean',
|
||||
show: 'boolean'
|
||||
};
|
||||
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 EVENT_HIDE = "hide" + EVENT_KEY;
|
||||
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY;
|
||||
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||
@@ -115,23 +81,26 @@
|
||||
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';
|
||||
var Default = {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
focus: true,
|
||||
show: true
|
||||
};
|
||||
var DefaultType = {
|
||||
backdrop: '(boolean|string)',
|
||||
keyboard: 'boolean',
|
||||
focus: 'boolean',
|
||||
show: 'boolean'
|
||||
};
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Modal = /*#__PURE__*/function () {
|
||||
@@ -162,21 +131,21 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._isTransitioning = true;
|
||||
}
|
||||
|
||||
var showEvent = $.Event(EVENT_SHOW, {
|
||||
var showEvent = $__default["default"].Event(EVENT_SHOW, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
$(this._element).trigger(showEvent);
|
||||
$__default["default"](this._element).trigger(showEvent);
|
||||
|
||||
if (this._isShown || showEvent.isDefaultPrevented()) {
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._isShown = true;
|
||||
|
||||
if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._isTransitioning = true;
|
||||
}
|
||||
|
||||
this._checkScrollbar();
|
||||
|
||||
this._setScrollbar();
|
||||
@@ -187,12 +156,12 @@
|
||||
|
||||
this._setResizeEvent();
|
||||
|
||||
$(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
|
||||
$__default["default"](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) {
|
||||
if ($(event.target).is(_this._element)) {
|
||||
$__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {
|
||||
$__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if ($__default["default"](event.target).is(_this._element)) {
|
||||
_this._ignoreBackdropClick = true;
|
||||
}
|
||||
});
|
||||
@@ -214,15 +183,15 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(EVENT_HIDE);
|
||||
$(this._element).trigger(hideEvent);
|
||||
var hideEvent = $__default["default"].Event(EVENT_HIDE);
|
||||
$__default["default"](this._element).trigger(hideEvent);
|
||||
|
||||
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._isShown = false;
|
||||
var transition = $(this._element).hasClass(CLASS_NAME_FADE);
|
||||
var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE);
|
||||
|
||||
if (transition) {
|
||||
this._isTransitioning = true;
|
||||
@@ -232,14 +201,14 @@
|
||||
|
||||
this._setResizeEvent();
|
||||
|
||||
$(document).off(EVENT_FOCUSIN);
|
||||
$(this._element).removeClass(CLASS_NAME_SHOW);
|
||||
$(this._element).off(EVENT_CLICK_DISMISS);
|
||||
$(this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
|
||||
$__default["default"](document).off(EVENT_FOCUSIN);
|
||||
$__default["default"](this._element).removeClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](this._element).off(EVENT_CLICK_DISMISS);
|
||||
$__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
|
||||
|
||||
if (transition) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
$(this._element).one(Util.TRANSITION_END, function (event) {
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this._element);
|
||||
$__default["default"](this._element).one(Util__default["default"].TRANSITION_END, function (event) {
|
||||
return _this2._hideModal(event);
|
||||
}).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
@@ -249,7 +218,7 @@
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
[window, this._element, this._dialog].forEach(function (htmlElement) {
|
||||
return $(htmlElement).off(EVENT_KEY);
|
||||
return $__default["default"](htmlElement).off(EVENT_KEY);
|
||||
});
|
||||
/**
|
||||
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||
@@ -257,8 +226,8 @@
|
||||
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||
*/
|
||||
|
||||
$(document).off(EVENT_FOCUSIN);
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$__default["default"](document).off(EVENT_FOCUSIN);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._dialog = null;
|
||||
@@ -276,39 +245,48 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default), config);
|
||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||
config = _extends({}, Default, config);
|
||||
Util__default["default"].typeCheckConfig(NAME, config, DefaultType);
|
||||
return config;
|
||||
};
|
||||
|
||||
_proto._triggerBackdropTransition = function _triggerBackdropTransition() {
|
||||
var _this3 = this;
|
||||
|
||||
if (this._config.backdrop === 'static') {
|
||||
var hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED);
|
||||
$(this._element).trigger(hideEventPrevented);
|
||||
var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED);
|
||||
$__default["default"](this._element).trigger(hideEventPrevented);
|
||||
|
||||
if (hideEventPrevented.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element.classList.add(CLASS_NAME_STATIC);
|
||||
|
||||
var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
$(this._element).one(Util.TRANSITION_END, function () {
|
||||
_this3._element.classList.remove(CLASS_NAME_STATIC);
|
||||
}).emulateTransitionEnd(modalTransitionDuration);
|
||||
|
||||
this._element.focus();
|
||||
} else {
|
||||
this.hide();
|
||||
if (hideEventPrevented.isDefaultPrevented()) {
|
||||
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__default["default"].getTransitionDurationFromElement(this._dialog);
|
||||
$__default["default"](this._element).off(Util__default["default"].TRANSITION_END);
|
||||
$__default["default"](this._element).one(Util__default["default"].TRANSITION_END, function () {
|
||||
_this3._element.classList.remove(CLASS_NAME_STATIC);
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
$__default["default"](_this3._element).one(Util__default["default"].TRANSITION_END, function () {
|
||||
_this3._element.style.overflowY = '';
|
||||
}).emulateTransitionEnd(_this3._element, modalTransitionDuration);
|
||||
}
|
||||
}).emulateTransitionEnd(modalTransitionDuration);
|
||||
|
||||
this._element.focus();
|
||||
};
|
||||
|
||||
_proto._showElement = function _showElement(relatedTarget) {
|
||||
var _this4 = this;
|
||||
|
||||
var transition = $(this._element).hasClass(CLASS_NAME_FADE);
|
||||
var transition = $__default["default"](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) {
|
||||
@@ -322,23 +300,25 @@
|
||||
|
||||
this._element.setAttribute('aria-modal', true);
|
||||
|
||||
if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
|
||||
this._element.setAttribute('role', 'dialog');
|
||||
|
||||
if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
|
||||
modalBody.scrollTop = 0;
|
||||
} else {
|
||||
this._element.scrollTop = 0;
|
||||
}
|
||||
|
||||
if (transition) {
|
||||
Util.reflow(this._element);
|
||||
Util__default["default"].reflow(this._element);
|
||||
}
|
||||
|
||||
$(this._element).addClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](this._element).addClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (this._config.focus) {
|
||||
this._enforceFocus();
|
||||
}
|
||||
|
||||
var shownEvent = $.Event(EVENT_SHOWN, {
|
||||
var shownEvent = $__default["default"].Event(EVENT_SHOWN, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
|
||||
@@ -348,12 +328,12 @@
|
||||
}
|
||||
|
||||
_this4._isTransitioning = false;
|
||||
$(_this4._element).trigger(shownEvent);
|
||||
$__default["default"](_this4._element).trigger(shownEvent);
|
||||
};
|
||||
|
||||
if (transition) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
|
||||
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this._dialog);
|
||||
$__default["default"](this._dialog).one(Util__default["default"].TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
transitionComplete();
|
||||
}
|
||||
@@ -362,9 +342,9 @@
|
||||
_proto._enforceFocus = function _enforceFocus() {
|
||||
var _this5 = this;
|
||||
|
||||
$(document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
|
||||
$__default["default"](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) {
|
||||
if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) {
|
||||
_this5._element.focus();
|
||||
}
|
||||
});
|
||||
@@ -374,7 +354,7 @@
|
||||
var _this6 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
$(this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
|
||||
$__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
|
||||
if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -384,7 +364,7 @@
|
||||
}
|
||||
});
|
||||
} else if (!this._isShown) {
|
||||
$(this._element).off(EVENT_KEYDOWN_DISMISS);
|
||||
$__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -392,11 +372,11 @@
|
||||
var _this7 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
$(window).on(EVENT_RESIZE, function (event) {
|
||||
$__default["default"](window).on(EVENT_RESIZE, function (event) {
|
||||
return _this7.handleUpdate(event);
|
||||
});
|
||||
} else {
|
||||
$(window).off(EVENT_RESIZE);
|
||||
$__default["default"](window).off(EVENT_RESIZE);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -409,22 +389,24 @@
|
||||
|
||||
this._element.removeAttribute('aria-modal');
|
||||
|
||||
this._element.removeAttribute('role');
|
||||
|
||||
this._isTransitioning = false;
|
||||
|
||||
this._showBackdrop(function () {
|
||||
$(document.body).removeClass(CLASS_NAME_OPEN);
|
||||
$__default["default"](document.body).removeClass(CLASS_NAME_OPEN);
|
||||
|
||||
_this8._resetAdjustments();
|
||||
|
||||
_this8._resetScrollbar();
|
||||
|
||||
$(_this8._element).trigger(EVENT_HIDDEN);
|
||||
$__default["default"](_this8._element).trigger(EVENT_HIDDEN);
|
||||
});
|
||||
};
|
||||
|
||||
_proto._removeBackdrop = function _removeBackdrop() {
|
||||
if (this._backdrop) {
|
||||
$(this._backdrop).remove();
|
||||
$__default["default"](this._backdrop).remove();
|
||||
this._backdrop = null;
|
||||
}
|
||||
};
|
||||
@@ -432,7 +414,7 @@
|
||||
_proto._showBackdrop = function _showBackdrop(callback) {
|
||||
var _this9 = this;
|
||||
|
||||
var animate = $(this._element).hasClass(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||
var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||
|
||||
if (this._isShown && this._config.backdrop) {
|
||||
this._backdrop = document.createElement('div');
|
||||
@@ -442,8 +424,8 @@
|
||||
this._backdrop.classList.add(animate);
|
||||
}
|
||||
|
||||
$(this._backdrop).appendTo(document.body);
|
||||
$(this._element).on(EVENT_CLICK_DISMISS, function (event) {
|
||||
$__default["default"](this._backdrop).appendTo(document.body);
|
||||
$__default["default"](this._element).on(EVENT_CLICK_DISMISS, function (event) {
|
||||
if (_this9._ignoreBackdropClick) {
|
||||
_this9._ignoreBackdropClick = false;
|
||||
return;
|
||||
@@ -453,14 +435,18 @@
|
||||
return;
|
||||
}
|
||||
|
||||
_this9._triggerBackdropTransition();
|
||||
if (_this9._config.backdrop === 'static') {
|
||||
_this9._triggerBackdropTransition();
|
||||
} else {
|
||||
_this9.hide();
|
||||
}
|
||||
});
|
||||
|
||||
if (animate) {
|
||||
Util.reflow(this._backdrop);
|
||||
Util__default["default"].reflow(this._backdrop);
|
||||
}
|
||||
|
||||
$(this._backdrop).addClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW);
|
||||
|
||||
if (!callback) {
|
||||
return;
|
||||
@@ -471,10 +457,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
|
||||
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
|
||||
var backdropTransitionDuration = Util__default["default"].getTransitionDurationFromElement(this._backdrop);
|
||||
$__default["default"](this._backdrop).one(Util__default["default"].TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
|
||||
} else if (!this._isShown && this._backdrop) {
|
||||
$(this._backdrop).removeClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW);
|
||||
|
||||
var callbackRemove = function callbackRemove() {
|
||||
_this9._removeBackdrop();
|
||||
@@ -484,10 +470,10 @@
|
||||
}
|
||||
};
|
||||
|
||||
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
|
||||
if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
var _backdropTransitionDuration = Util__default["default"].getTransitionDurationFromElement(this._backdrop);
|
||||
|
||||
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
|
||||
$__default["default"](this._backdrop).one(Util__default["default"].TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
|
||||
} else {
|
||||
callbackRemove();
|
||||
}
|
||||
@@ -532,46 +518,46 @@
|
||||
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) {
|
||||
$__default["default"](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) + _this10._scrollbarWidth + "px");
|
||||
var calculatedPadding = $__default["default"](element).css('padding-right');
|
||||
$__default["default"](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
|
||||
}); // Adjust sticky content margin
|
||||
|
||||
$(stickyContent).each(function (index, element) {
|
||||
$__default["default"](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) - _this10._scrollbarWidth + "px");
|
||||
var calculatedMargin = $__default["default"](element).css('margin-right');
|
||||
$__default["default"](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
|
||||
}); // Adjust body padding
|
||||
|
||||
var actualPadding = document.body.style.paddingRight;
|
||||
var calculatedPadding = $(document.body).css('padding-right');
|
||||
$(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
|
||||
var calculatedPadding = $__default["default"](document.body).css('padding-right');
|
||||
$__default["default"](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
|
||||
}
|
||||
|
||||
$(document.body).addClass(CLASS_NAME_OPEN);
|
||||
$__default["default"](document.body).addClass(CLASS_NAME_OPEN);
|
||||
};
|
||||
|
||||
_proto._resetScrollbar = function _resetScrollbar() {
|
||||
// Restore fixed content padding
|
||||
var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
|
||||
$(fixedContent).each(function (index, element) {
|
||||
var padding = $(element).data('padding-right');
|
||||
$(element).removeData('padding-right');
|
||||
$__default["default"](fixedContent).each(function (index, element) {
|
||||
var padding = $__default["default"](element).data('padding-right');
|
||||
$__default["default"](element).removeData('padding-right');
|
||||
element.style.paddingRight = padding ? padding : '';
|
||||
}); // Restore sticky content
|
||||
|
||||
var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));
|
||||
$(elements).each(function (index, element) {
|
||||
var margin = $(element).data('margin-right');
|
||||
$__default["default"](elements).each(function (index, element) {
|
||||
var margin = $__default["default"](element).data('margin-right');
|
||||
|
||||
if (typeof margin !== 'undefined') {
|
||||
$(element).css('margin-right', margin).removeData('margin-right');
|
||||
$__default["default"](element).css('margin-right', margin).removeData('margin-right');
|
||||
}
|
||||
}); // Restore body padding
|
||||
|
||||
var padding = $(document.body).data('padding-right');
|
||||
$(document.body).removeData('padding-right');
|
||||
var padding = $__default["default"](document.body).data('padding-right');
|
||||
$__default["default"](document.body).removeData('padding-right');
|
||||
document.body.style.paddingRight = padding ? padding : '';
|
||||
};
|
||||
|
||||
@@ -588,13 +574,13 @@
|
||||
|
||||
Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var data = $__default["default"](this).data(DATA_KEY);
|
||||
|
||||
var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default), $(this).data()), typeof config === 'object' && config ? config : {});
|
||||
var _config = _extends({}, Default, $__default["default"](this).data(), typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (!data) {
|
||||
data = new Modal(this, _config);
|
||||
$(this).data(DATA_KEY, data);
|
||||
$__default["default"](this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
@@ -624,58 +610,54 @@
|
||||
return Modal;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
$__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
var _this11 = this;
|
||||
|
||||
var target;
|
||||
var selector = Util.getSelectorFromElement(this);
|
||||
var selector = Util__default["default"].getSelectorFromElement(this);
|
||||
|
||||
if (selector) {
|
||||
target = document.querySelector(selector);
|
||||
}
|
||||
|
||||
var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data());
|
||||
var config = $__default["default"](target).data(DATA_KEY) ? 'toggle' : _extends({}, $__default["default"](target).data(), $__default["default"](this).data());
|
||||
|
||||
if (this.tagName === 'A' || this.tagName === 'AREA') {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
var $target = $(target).one(EVENT_SHOW, function (showEvent) {
|
||||
var $target = $__default["default"](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 ($(_this11).is(':visible')) {
|
||||
if ($__default["default"](_this11).is(':visible')) {
|
||||
_this11.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Modal._jQueryInterface.call($(target), config, this);
|
||||
Modal._jQueryInterface.call($__default["default"](target), config, this);
|
||||
});
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Modal._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Modal;
|
||||
$__default["default"].fn[NAME] = Modal._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Modal;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Modal._jQueryInterface;
|
||||
};
|
||||
|
||||
return Modal;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=modal.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+58
-82
@@ -1,16 +1,18 @@
|
||||
/*!
|
||||
* Bootstrap popover.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap popover.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './tooltip'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.jQuery, global.Tooltip));
|
||||
})(this, (function ($, Tooltip) { 'use strict';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Tooltip = Tooltip && Object.prototype.hasOwnProperty.call(Tooltip, 'default') ? Tooltip['default'] : Tooltip;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -25,93 +27,71 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
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;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _inheritsLoose(subClass, superClass) {
|
||||
subClass.prototype = Object.create(superClass.prototype);
|
||||
subClass.prototype.constructor = subClass;
|
||||
subClass.__proto__ = superClass;
|
||||
|
||||
_setPrototypeOf(subClass, superClass);
|
||||
}
|
||||
|
||||
function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
return _setPrototypeOf(o, p);
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'popover';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.popover';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var CLASS_PREFIX = 'bs-popover';
|
||||
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var SELECTOR_TITLE = '.popover-header';
|
||||
var SELECTOR_CONTENT = '.popover-body';
|
||||
|
||||
var Default = _objectSpread2(_objectSpread2({}, Tooltip.Default), {}, {
|
||||
var Default = _extends({}, Tooltip__default["default"].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 = _objectSpread2(_objectSpread2({}, Tooltip.DefaultType), {}, {
|
||||
var DefaultType = _extends({}, Tooltip__default["default"].DefaultType, {
|
||||
content: '(string|element|function)'
|
||||
});
|
||||
|
||||
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,
|
||||
@@ -125,9 +105,7 @@
|
||||
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
||||
};
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Popover = /*#__PURE__*/function (_Tooltip) {
|
||||
@@ -145,16 +123,16 @@
|
||||
};
|
||||
|
||||
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
||||
$(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
||||
$__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
||||
};
|
||||
|
||||
_proto.getTipElement = function getTipElement() {
|
||||
this.tip = this.tip || $(this.config.template)[0];
|
||||
this.tip = this.tip || $__default["default"](this.config.template)[0];
|
||||
return this.tip;
|
||||
};
|
||||
|
||||
_proto.setContent = function setContent() {
|
||||
var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
|
||||
var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events
|
||||
|
||||
this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
|
||||
|
||||
@@ -174,7 +152,7 @@
|
||||
};
|
||||
|
||||
_proto._cleanTipClass = function _cleanTipClass() {
|
||||
var $tip = $(this.getTipElement());
|
||||
var $tip = $__default["default"](this.getTipElement());
|
||||
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
||||
|
||||
if (tabClass !== null && tabClass.length > 0) {
|
||||
@@ -185,7 +163,7 @@
|
||||
|
||||
Popover._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var data = $__default["default"](this).data(DATA_KEY);
|
||||
|
||||
var _config = typeof config === 'object' ? config : null;
|
||||
|
||||
@@ -195,7 +173,7 @@
|
||||
|
||||
if (!data) {
|
||||
data = new Popover(this, _config);
|
||||
$(this).data(DATA_KEY, data);
|
||||
$__default["default"](this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
@@ -210,8 +188,8 @@
|
||||
|
||||
_createClass(Popover, null, [{
|
||||
key: "VERSION",
|
||||
// Getters
|
||||
get: function get() {
|
||||
get: // Getters
|
||||
function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
@@ -247,23 +225,21 @@
|
||||
}]);
|
||||
|
||||
return Popover;
|
||||
}(Tooltip);
|
||||
}(Tooltip__default["default"]);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
$.fn[NAME] = Popover._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Popover;
|
||||
$__default["default"].fn[NAME] = Popover._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Popover;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Popover._jQueryInterface;
|
||||
};
|
||||
|
||||
return Popover;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=popover.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+67
-104
@@ -1,16 +1,18 @@
|
||||
/*!
|
||||
* Bootstrap scrollspy.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap scrollspy.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ScrollSpy = factory(global.jQuery, global.Util));
|
||||
})(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -25,70 +27,54 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
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;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'scrollspy';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.scrollspy';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
|
||||
var CLASS_NAME_ACTIVE = 'active';
|
||||
var EVENT_ACTIVATE = "activate" + EVENT_KEY;
|
||||
var EVENT_SCROLL = "scroll" + EVENT_KEY;
|
||||
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||
var METHOD_OFFSET = 'offset';
|
||||
var METHOD_POSITION = 'position';
|
||||
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 Default = {
|
||||
offset: 10,
|
||||
method: 'auto',
|
||||
@@ -99,25 +85,8 @@
|
||||
method: 'string',
|
||||
target: '(string|element)'
|
||||
};
|
||||
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
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var ScrollSpy = /*#__PURE__*/function () {
|
||||
@@ -132,7 +101,7 @@
|
||||
this._targets = [];
|
||||
this._activeTarget = null;
|
||||
this._scrollHeight = 0;
|
||||
$(this._scrollElement).on(EVENT_SCROLL, function (event) {
|
||||
$__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) {
|
||||
return _this._process(event);
|
||||
});
|
||||
this.refresh();
|
||||
@@ -156,7 +125,7 @@
|
||||
var targets = [].slice.call(document.querySelectorAll(this._selector));
|
||||
targets.map(function (element) {
|
||||
var target;
|
||||
var targetSelector = Util.getSelectorFromElement(element);
|
||||
var targetSelector = Util__default["default"].getSelectorFromElement(element);
|
||||
|
||||
if (targetSelector) {
|
||||
target = document.querySelector(targetSelector);
|
||||
@@ -167,14 +136,12 @@
|
||||
|
||||
if (targetBCR.width || targetBCR.height) {
|
||||
// TODO (fat): remove sketch reliance on jQuery position/offset
|
||||
return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
|
||||
return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}).filter(function (item) {
|
||||
return item;
|
||||
}).sort(function (a, b) {
|
||||
}).filter(Boolean).sort(function (a, b) {
|
||||
return a[0] - b[0];
|
||||
}).forEach(function (item) {
|
||||
_this2._offsets.push(item[0]);
|
||||
@@ -184,8 +151,8 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$(this._scrollElement).off(EVENT_KEY);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
$__default["default"](this._scrollElement).off(EVENT_KEY);
|
||||
this._element = null;
|
||||
this._scrollElement = null;
|
||||
this._config = null;
|
||||
@@ -198,20 +165,20 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default), typeof config === 'object' && config ? config : {});
|
||||
config = _extends({}, Default, typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (typeof config.target !== 'string' && Util.isElement(config.target)) {
|
||||
var id = $(config.target).attr('id');
|
||||
if (typeof config.target !== 'string' && Util__default["default"].isElement(config.target)) {
|
||||
var id = $__default["default"](config.target).attr('id');
|
||||
|
||||
if (!id) {
|
||||
id = Util.getUID(NAME);
|
||||
$(config.target).attr('id', id);
|
||||
id = Util__default["default"].getUID(NAME);
|
||||
$__default["default"](config.target).attr('id', id);
|
||||
}
|
||||
|
||||
config.target = "#" + id;
|
||||
}
|
||||
|
||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||
Util__default["default"].typeCheckConfig(NAME, config, DefaultType);
|
||||
return config;
|
||||
};
|
||||
|
||||
@@ -274,7 +241,7 @@
|
||||
return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
|
||||
});
|
||||
|
||||
var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
|
||||
var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(','))));
|
||||
|
||||
if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
|
||||
$link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE);
|
||||
@@ -289,7 +256,7 @@
|
||||
$link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
$(this._scrollElement).trigger(EVENT_ACTIVATE, {
|
||||
$__default["default"](this._scrollElement).trigger(EVENT_ACTIVATE, {
|
||||
relatedTarget: target
|
||||
});
|
||||
};
|
||||
@@ -305,13 +272,13 @@
|
||||
|
||||
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var data = $__default["default"](this).data(DATA_KEY);
|
||||
|
||||
var _config = typeof config === 'object' && config;
|
||||
|
||||
if (!data) {
|
||||
data = new ScrollSpy(this, _config);
|
||||
$(this).data(DATA_KEY, data);
|
||||
$__default["default"](this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
@@ -339,37 +306,33 @@
|
||||
return ScrollSpy;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
$(window).on(EVENT_LOAD_DATA_API, function () {
|
||||
$__default["default"](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--;) {
|
||||
var $spy = $(scrollSpys[i]);
|
||||
var $spy = $__default["default"](scrollSpys[i]);
|
||||
|
||||
ScrollSpy._jQueryInterface.call($spy, $spy.data());
|
||||
}
|
||||
});
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = ScrollSpy._jQueryInterface;
|
||||
$.fn[NAME].Constructor = ScrollSpy;
|
||||
$__default["default"].fn[NAME] = ScrollSpy._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = ScrollSpy;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return ScrollSpy._jQueryInterface;
|
||||
};
|
||||
|
||||
return ScrollSpy;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=scrollspy.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+61
-58
@@ -1,16 +1,18 @@
|
||||
/*!
|
||||
* Bootstrap tab.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap tab.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tab = factory(global.jQuery, global.Util));
|
||||
})(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -25,31 +27,32 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'tab';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.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;
|
||||
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 JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
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 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 SELECTOR_DROPDOWN = '.dropdown';
|
||||
var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
|
||||
var SELECTOR_ACTIVE = '.active';
|
||||
@@ -58,9 +61,7 @@
|
||||
var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
||||
var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Tab = /*#__PURE__*/function () {
|
||||
@@ -75,33 +76,33 @@
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
|
||||
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(CLASS_NAME_ACTIVE) || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || this._element.hasAttribute('disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var target;
|
||||
var previous;
|
||||
var listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];
|
||||
var selector = Util.getSelectorFromElement(this._element);
|
||||
var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];
|
||||
var selector = Util__default["default"].getSelectorFromElement(this._element);
|
||||
|
||||
if (listElement) {
|
||||
var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
|
||||
previous = $.makeArray($(listElement).find(itemSelector));
|
||||
previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector));
|
||||
previous = previous[previous.length - 1];
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(EVENT_HIDE, {
|
||||
var hideEvent = $__default["default"].Event(EVENT_HIDE, {
|
||||
relatedTarget: this._element
|
||||
});
|
||||
var showEvent = $.Event(EVENT_SHOW, {
|
||||
var showEvent = $__default["default"].Event(EVENT_SHOW, {
|
||||
relatedTarget: previous
|
||||
});
|
||||
|
||||
if (previous) {
|
||||
$(previous).trigger(hideEvent);
|
||||
$__default["default"](previous).trigger(hideEvent);
|
||||
}
|
||||
|
||||
$(this._element).trigger(showEvent);
|
||||
$__default["default"](this._element).trigger(showEvent);
|
||||
|
||||
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
@@ -114,14 +115,14 @@
|
||||
this._activate(this._element, listElement);
|
||||
|
||||
var complete = function complete() {
|
||||
var hiddenEvent = $.Event(EVENT_HIDDEN, {
|
||||
var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN, {
|
||||
relatedTarget: _this._element
|
||||
});
|
||||
var shownEvent = $.Event(EVENT_SHOWN, {
|
||||
var shownEvent = $__default["default"].Event(EVENT_SHOWN, {
|
||||
relatedTarget: previous
|
||||
});
|
||||
$(previous).trigger(hiddenEvent);
|
||||
$(_this._element).trigger(shownEvent);
|
||||
$__default["default"](previous).trigger(hiddenEvent);
|
||||
$__default["default"](_this._element).trigger(shownEvent);
|
||||
};
|
||||
|
||||
if (target) {
|
||||
@@ -132,7 +133,7 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
@@ -140,17 +141,17 @@
|
||||
_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') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE);
|
||||
var active = activeElements[0];
|
||||
var isTransitioning = callback && active && $(active).hasClass(CLASS_NAME_FADE);
|
||||
var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE);
|
||||
|
||||
var complete = function complete() {
|
||||
return _this2._transitionComplete(element, active, callback);
|
||||
};
|
||||
|
||||
if (active && isTransitioning) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(active);
|
||||
$(active).removeClass(CLASS_NAME_SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(active);
|
||||
$__default["default"](active).removeClass(CLASS_NAME_SHOW).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
@@ -158,11 +159,11 @@
|
||||
|
||||
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
|
||||
if (active) {
|
||||
$(active).removeClass(CLASS_NAME_ACTIVE);
|
||||
var dropdownChild = $(active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
|
||||
$__default["default"](active).removeClass(CLASS_NAME_ACTIVE);
|
||||
var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
|
||||
|
||||
if (dropdownChild) {
|
||||
$(dropdownChild).removeClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
if (active.getAttribute('role') === 'tab') {
|
||||
@@ -170,24 +171,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
$(element).addClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](element).addClass(CLASS_NAME_ACTIVE);
|
||||
|
||||
if (element.getAttribute('role') === 'tab') {
|
||||
element.setAttribute('aria-selected', true);
|
||||
}
|
||||
|
||||
Util.reflow(element);
|
||||
Util__default["default"].reflow(element);
|
||||
|
||||
if (element.classList.contains(CLASS_NAME_FADE)) {
|
||||
element.classList.add(CLASS_NAME_SHOW);
|
||||
}
|
||||
|
||||
if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
|
||||
var dropdownElement = $(element).closest(SELECTOR_DROPDOWN)[0];
|
||||
var parent = element.parentNode;
|
||||
|
||||
if (parent && parent.nodeName === 'LI') {
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
|
||||
if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
|
||||
var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0];
|
||||
|
||||
if (dropdownElement) {
|
||||
var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE));
|
||||
$(dropdownToggleList).addClass(CLASS_NAME_ACTIVE);
|
||||
$__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
element.setAttribute('aria-expanded', true);
|
||||
@@ -201,7 +208,7 @@
|
||||
|
||||
Tab._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var $this = $__default["default"](this);
|
||||
var data = $this.data(DATA_KEY);
|
||||
|
||||
if (!data) {
|
||||
@@ -229,32 +236,28 @@
|
||||
return Tab;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
$__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
Tab._jQueryInterface.call($(this), 'show');
|
||||
Tab._jQueryInterface.call($__default["default"](this), 'show');
|
||||
});
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Tab._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Tab;
|
||||
$__default["default"].fn[NAME] = Tab._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Tab;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Tab._jQueryInterface;
|
||||
};
|
||||
|
||||
return Tab;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=tab.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+68
-95
@@ -1,16 +1,18 @@
|
||||
/*!
|
||||
* Bootstrap toast.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap toast.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.jQuery, global.Util));
|
||||
})(this, (function ($, Util) { 'use strict';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -25,93 +27,60 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
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;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'toast';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.toast';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_HIDE = 'hide';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var CLASS_NAME_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',
|
||||
delay: 'number'
|
||||
};
|
||||
var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
|
||||
var Default = {
|
||||
animation: true,
|
||||
autohide: true,
|
||||
delay: 500
|
||||
};
|
||||
var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
|
||||
var DefaultType = {
|
||||
animation: 'boolean',
|
||||
autohide: 'boolean',
|
||||
delay: 'number'
|
||||
};
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Toast = /*#__PURE__*/function () {
|
||||
@@ -130,13 +99,15 @@
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
|
||||
var showEvent = $.Event(EVENT_SHOW);
|
||||
$(this._element).trigger(showEvent);
|
||||
var showEvent = $__default["default"].Event(EVENT_SHOW);
|
||||
$__default["default"](this._element).trigger(showEvent);
|
||||
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._clearTimeout();
|
||||
|
||||
if (this._config.animation) {
|
||||
this._element.classList.add(CLASS_NAME_FADE);
|
||||
}
|
||||
@@ -146,7 +117,7 @@
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_SHOW);
|
||||
|
||||
$(_this._element).trigger(EVENT_SHOWN);
|
||||
$__default["default"](_this._element).trigger(EVENT_SHOWN);
|
||||
|
||||
if (_this._config.autohide) {
|
||||
_this._timeout = setTimeout(function () {
|
||||
@@ -157,13 +128,13 @@
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_HIDE);
|
||||
|
||||
Util.reflow(this._element);
|
||||
Util__default["default"].reflow(this._element);
|
||||
|
||||
this._element.classList.add(CLASS_NAME_SHOWING);
|
||||
|
||||
if (this._config.animation) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this._element);
|
||||
$__default["default"](this._element).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
@@ -174,8 +145,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var hideEvent = $.Event(EVENT_HIDE);
|
||||
$(this._element).trigger(hideEvent);
|
||||
var hideEvent = $__default["default"].Event(EVENT_HIDE);
|
||||
$__default["default"](this._element).trigger(hideEvent);
|
||||
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
@@ -185,30 +156,29 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
clearTimeout(this._timeout);
|
||||
this._timeout = null;
|
||||
this._clearTimeout();
|
||||
|
||||
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||
}
|
||||
|
||||
$(this._element).off(EVENT_CLICK_DISMISS);
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
$__default["default"](this._element).off(EVENT_CLICK_DISMISS);
|
||||
$__default["default"].removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
this._config = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default), $(this._element).data()), typeof config === 'object' && config ? config : {});
|
||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
config = _extends({}, Default, $__default["default"](this._element).data(), typeof config === 'object' && config ? config : {});
|
||||
Util__default["default"].typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
return config;
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this2 = this;
|
||||
|
||||
$(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
|
||||
$__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
|
||||
return _this2.hide();
|
||||
});
|
||||
};
|
||||
@@ -219,23 +189,28 @@
|
||||
var complete = function complete() {
|
||||
_this3._element.classList.add(CLASS_NAME_HIDE);
|
||||
|
||||
$(_this3._element).trigger(EVENT_HIDDEN);
|
||||
$__default["default"](_this3._element).trigger(EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||
|
||||
if (this._config.animation) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this._element);
|
||||
$__default["default"](this._element).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
};
|
||||
|
||||
_proto._clearTimeout = function _clearTimeout() {
|
||||
clearTimeout(this._timeout);
|
||||
this._timeout = null;
|
||||
} // Static
|
||||
;
|
||||
|
||||
Toast._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var $element = $(this);
|
||||
var $element = $__default["default"](this);
|
||||
var data = $element.data(DATA_KEY);
|
||||
|
||||
var _config = typeof config === 'object' && config;
|
||||
@@ -275,21 +250,19 @@
|
||||
return Toast;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
$.fn[NAME] = Toast._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Toast;
|
||||
$__default["default"].fn[NAME] = Toast._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Toast;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Toast._jQueryInterface;
|
||||
};
|
||||
|
||||
return Toast;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=toast.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+138
-166
@@ -1,17 +1,19 @@
|
||||
/*!
|
||||
* Bootstrap tooltip.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap tooltip.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
|
||||
})(this, (function ($, Popper, Util) { 'use strict';
|
||||
|
||||
$ = $ && 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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
||||
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -26,62 +28,33 @@
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
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;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): tools/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.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'];
|
||||
@@ -122,14 +95,14 @@
|
||||
/**
|
||||
* 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
|
||||
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
|
||||
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
|
||||
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
||||
/**
|
||||
* 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
|
||||
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/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,[\d+/a-z]+=*$/i;
|
||||
@@ -139,7 +112,7 @@
|
||||
|
||||
if (allowedAttributeList.indexOf(attrName) !== -1) {
|
||||
if (uriAttrs.indexOf(attrName) !== -1) {
|
||||
return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
|
||||
return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -150,7 +123,7 @@
|
||||
}); // Check if a regular expression validates the attribute.
|
||||
|
||||
for (var i = 0, len = regExp.length; i < len; i++) {
|
||||
if (attrName.match(regExp[i])) {
|
||||
if (regExp[i].test(attrName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -181,7 +154,8 @@
|
||||
return "continue";
|
||||
}
|
||||
|
||||
var attributeList = [].slice.call(el.attributes);
|
||||
var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread
|
||||
|
||||
var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
|
||||
attributeList.forEach(function (attr) {
|
||||
if (!allowedAttribute(attr, whitelistedAttributes)) {
|
||||
@@ -200,37 +174,27 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'tooltip';
|
||||
var VERSION = '4.5.0';
|
||||
var VERSION = '4.6.2';
|
||||
var DATA_KEY = 'bs.tooltip';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
|
||||
var CLASS_PREFIX = 'bs-tooltip';
|
||||
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
||||
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
|
||||
var DefaultType = {
|
||||
animation: 'boolean',
|
||||
template: 'string',
|
||||
title: '(string|element|function)',
|
||||
trigger: 'string',
|
||||
delay: '(number|object)',
|
||||
html: 'boolean',
|
||||
selector: '(string|boolean)',
|
||||
placement: '(string|function)',
|
||||
offset: '(number|string|function)',
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
boundary: '(string|element)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
whiteList: 'object',
|
||||
popperConfig: '(null|object)'
|
||||
};
|
||||
var CLASS_NAME_FADE = 'fade';
|
||||
var CLASS_NAME_SHOW = 'show';
|
||||
var HOVER_STATE_SHOW = 'show';
|
||||
var HOVER_STATE_OUT = 'out';
|
||||
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';
|
||||
var AttachmentMap = {
|
||||
AUTO: 'auto',
|
||||
TOP: 'top',
|
||||
@@ -251,13 +215,31 @@
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
whiteList: DefaultWhitelist,
|
||||
popperConfig: null
|
||||
};
|
||||
var HOVER_STATE_SHOW = 'show';
|
||||
var HOVER_STATE_OUT = 'out';
|
||||
var DefaultType = {
|
||||
animation: 'boolean',
|
||||
template: 'string',
|
||||
title: '(string|element|function)',
|
||||
trigger: 'string',
|
||||
delay: '(number|object)',
|
||||
html: 'boolean',
|
||||
selector: '(string|boolean)',
|
||||
placement: '(string|function)',
|
||||
offset: '(number|string|function)',
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
whiteList: 'object',
|
||||
popperConfig: '(null|object)'
|
||||
};
|
||||
var Event = {
|
||||
HIDE: "hide" + EVENT_KEY,
|
||||
HIDDEN: "hidden" + EVENT_KEY,
|
||||
@@ -270,25 +252,15 @@
|
||||
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
||||
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
||||
};
|
||||
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
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
var Tooltip = /*#__PURE__*/function () {
|
||||
function Tooltip(element, config) {
|
||||
if (typeof Popper === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
|
||||
} // private
|
||||
if (typeof Popper__default["default"] === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
|
||||
} // Private
|
||||
|
||||
|
||||
this._isEnabled = true;
|
||||
@@ -327,11 +299,11 @@
|
||||
|
||||
if (event) {
|
||||
var dataKey = this.constructor.DATA_KEY;
|
||||
var context = $(event.currentTarget).data(dataKey);
|
||||
var context = $__default["default"](event.currentTarget).data(dataKey);
|
||||
|
||||
if (!context) {
|
||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||
$(event.currentTarget).data(dataKey, context);
|
||||
$__default["default"](event.currentTarget).data(dataKey, context);
|
||||
}
|
||||
|
||||
context._activeTrigger.click = !context._activeTrigger.click;
|
||||
@@ -342,7 +314,7 @@
|
||||
context._leave(null, context);
|
||||
}
|
||||
} else {
|
||||
if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
|
||||
if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
|
||||
this._leave(null, this);
|
||||
|
||||
return;
|
||||
@@ -354,12 +326,12 @@
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
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._hideModalHandler);
|
||||
$__default["default"].removeData(this.element, this.constructor.DATA_KEY);
|
||||
$__default["default"](this.element).off(this.constructor.EVENT_KEY);
|
||||
$__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.tip) {
|
||||
$(this.tip).remove();
|
||||
$__default["default"](this.tip).remove();
|
||||
}
|
||||
|
||||
this._isEnabled = null;
|
||||
@@ -380,29 +352,29 @@
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
|
||||
if ($(this.element).css('display') === 'none') {
|
||||
if ($__default["default"](this.element).css('display') === 'none') {
|
||||
throw new Error('Please use show on visible elements');
|
||||
}
|
||||
|
||||
var showEvent = $.Event(this.constructor.Event.SHOW);
|
||||
var showEvent = $__default["default"].Event(this.constructor.Event.SHOW);
|
||||
|
||||
if (this.isWithContent() && this._isEnabled) {
|
||||
$(this.element).trigger(showEvent);
|
||||
var shadowRoot = Util.findShadowRoot(this.element);
|
||||
var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
|
||||
$__default["default"](this.element).trigger(showEvent);
|
||||
var shadowRoot = Util__default["default"].findShadowRoot(this.element);
|
||||
var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
|
||||
|
||||
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
||||
return;
|
||||
}
|
||||
|
||||
var tip = this.getTipElement();
|
||||
var tipId = Util.getUID(this.constructor.NAME);
|
||||
var tipId = Util__default["default"].getUID(this.constructor.NAME);
|
||||
tip.setAttribute('id', tipId);
|
||||
this.element.setAttribute('aria-describedby', tipId);
|
||||
this.setContent();
|
||||
|
||||
if (this.config.animation) {
|
||||
$(tip).addClass(CLASS_NAME_FADE);
|
||||
$__default["default"](tip).addClass(CLASS_NAME_FADE);
|
||||
}
|
||||
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||
@@ -413,21 +385,22 @@
|
||||
|
||||
var container = this._getContainer();
|
||||
|
||||
$(tip).data(this.constructor.DATA_KEY, this);
|
||||
$__default["default"](tip).data(this.constructor.DATA_KEY, this);
|
||||
|
||||
if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
|
||||
$(tip).appendTo(container);
|
||||
if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) {
|
||||
$__default["default"](tip).appendTo(container);
|
||||
}
|
||||
|
||||
$(this.element).trigger(this.constructor.Event.INSERTED);
|
||||
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
|
||||
$__default["default"](this.element).trigger(this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment));
|
||||
$__default["default"](tip).addClass(CLASS_NAME_SHOW);
|
||||
$__default["default"](tip).addClass(this.config.customClass); // 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
|
||||
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
$(document.body).children().on('mouseover', null, $.noop);
|
||||
$__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop);
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
@@ -437,16 +410,16 @@
|
||||
|
||||
var prevHoverState = _this._hoverState;
|
||||
_this._hoverState = null;
|
||||
$(_this.element).trigger(_this.constructor.Event.SHOWN);
|
||||
$__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN);
|
||||
|
||||
if (prevHoverState === HOVER_STATE_OUT) {
|
||||
_this._leave(null, _this);
|
||||
}
|
||||
};
|
||||
|
||||
if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
|
||||
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this.tip);
|
||||
$__default["default"](this.tip).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
@@ -457,7 +430,7 @@
|
||||
var _this2 = this;
|
||||
|
||||
var tip = this.getTipElement();
|
||||
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
||||
var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE);
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
@@ -468,7 +441,7 @@
|
||||
|
||||
_this2.element.removeAttribute('aria-describedby');
|
||||
|
||||
$(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
|
||||
$__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
|
||||
|
||||
if (_this2._popper !== null) {
|
||||
_this2._popper.destroy();
|
||||
@@ -479,26 +452,26 @@
|
||||
}
|
||||
};
|
||||
|
||||
$(this.element).trigger(hideEvent);
|
||||
$__default["default"](this.element).trigger(hideEvent);
|
||||
|
||||
if (hideEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
|
||||
$__default["default"](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);
|
||||
$__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop);
|
||||
}
|
||||
|
||||
this._activeTrigger[TRIGGER_CLICK] = false;
|
||||
this._activeTrigger[TRIGGER_FOCUS] = false;
|
||||
this._activeTrigger[TRIGGER_HOVER] = false;
|
||||
|
||||
if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||
var transitionDuration = Util.getTransitionDurationFromElement(tip);
|
||||
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||
var transitionDuration = Util__default["default"].getTransitionDurationFromElement(tip);
|
||||
$__default["default"](tip).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
@@ -518,29 +491,29 @@
|
||||
};
|
||||
|
||||
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
||||
$(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
||||
$__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
||||
};
|
||||
|
||||
_proto.getTipElement = function getTipElement() {
|
||||
this.tip = this.tip || $(this.config.template)[0];
|
||||
this.tip = this.tip || $__default["default"](this.config.template)[0];
|
||||
return this.tip;
|
||||
};
|
||||
|
||||
_proto.setContent = function setContent() {
|
||||
var tip = this.getTipElement();
|
||||
this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
|
||||
$(tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
|
||||
this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
|
||||
$__default["default"](tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
|
||||
};
|
||||
|
||||
_proto.setElementContent = function setElementContent($element, content) {
|
||||
if (typeof content === 'object' && (content.nodeType || content.jquery)) {
|
||||
// Content is a DOM node or a jQuery
|
||||
if (this.config.html) {
|
||||
if (!$(content).parent().is($element)) {
|
||||
if (!$__default["default"](content).parent().is($element)) {
|
||||
$element.empty().append(content);
|
||||
}
|
||||
} else {
|
||||
$element.text($(content).text());
|
||||
$element.text($__default["default"](content).text());
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -594,7 +567,7 @@
|
||||
return _this3._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _objectSpread2(_objectSpread2({}, defaultBsConfig), this.config.popperConfig);
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
@@ -604,7 +577,7 @@
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this4.config.offset(data.offsets, _this4.element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element));
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@@ -619,11 +592,11 @@
|
||||
return document.body;
|
||||
}
|
||||
|
||||
if (Util.isElement(this.config.container)) {
|
||||
return $(this.config.container);
|
||||
if (Util__default["default"].isElement(this.config.container)) {
|
||||
return $__default["default"](this.config.container);
|
||||
}
|
||||
|
||||
return $(document).find(this.config.container);
|
||||
return $__default["default"](document).find(this.config.container);
|
||||
};
|
||||
|
||||
_proto._getAttachment = function _getAttachment(placement) {
|
||||
@@ -636,13 +609,13 @@
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
$(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
$__default["default"](_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 ? _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) {
|
||||
$__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
}).on(eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
@@ -656,10 +629,10 @@
|
||||
}
|
||||
};
|
||||
|
||||
$(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
|
||||
$__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.config.selector) {
|
||||
this.config = _objectSpread2(_objectSpread2({}, this.config), {}, {
|
||||
this.config = _extends({}, this.config, {
|
||||
trigger: 'manual',
|
||||
selector: ''
|
||||
});
|
||||
@@ -679,18 +652,18 @@
|
||||
|
||||
_proto._enter = function _enter(event, context) {
|
||||
var dataKey = this.constructor.DATA_KEY;
|
||||
context = context || $(event.currentTarget).data(dataKey);
|
||||
context = context || $__default["default"](event.currentTarget).data(dataKey);
|
||||
|
||||
if (!context) {
|
||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||
$(event.currentTarget).data(dataKey, context);
|
||||
$__default["default"](event.currentTarget).data(dataKey, context);
|
||||
}
|
||||
|
||||
if (event) {
|
||||
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
||||
}
|
||||
|
||||
if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
|
||||
if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
|
||||
context._hoverState = HOVER_STATE_SHOW;
|
||||
return;
|
||||
}
|
||||
@@ -712,11 +685,11 @@
|
||||
|
||||
_proto._leave = function _leave(event, context) {
|
||||
var dataKey = this.constructor.DATA_KEY;
|
||||
context = context || $(event.currentTarget).data(dataKey);
|
||||
context = context || $__default["default"](event.currentTarget).data(dataKey);
|
||||
|
||||
if (!context) {
|
||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||
$(event.currentTarget).data(dataKey, context);
|
||||
$__default["default"](event.currentTarget).data(dataKey, context);
|
||||
}
|
||||
|
||||
if (event) {
|
||||
@@ -753,13 +726,13 @@
|
||||
};
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
var dataAttributes = $(this.element).data();
|
||||
var dataAttributes = $__default["default"](this.element).data();
|
||||
Object.keys(dataAttributes).forEach(function (dataAttr) {
|
||||
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
|
||||
delete dataAttributes[dataAttr];
|
||||
}
|
||||
});
|
||||
config = _objectSpread2(_objectSpread2(_objectSpread2({}, 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 = {
|
||||
@@ -776,7 +749,7 @@
|
||||
config.content = config.content.toString();
|
||||
}
|
||||
|
||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
Util__default["default"].typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
|
||||
if (config.sanitize) {
|
||||
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
|
||||
@@ -800,7 +773,7 @@
|
||||
};
|
||||
|
||||
_proto._cleanTipClass = function _cleanTipClass() {
|
||||
var $tip = $(this.getTipElement());
|
||||
var $tip = $__default["default"](this.getTipElement());
|
||||
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
||||
|
||||
if (tabClass !== null && tabClass.length) {
|
||||
@@ -824,7 +797,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$(tip).removeClass(CLASS_NAME_FADE);
|
||||
$__default["default"](tip).removeClass(CLASS_NAME_FADE);
|
||||
this.config.animation = false;
|
||||
this.hide();
|
||||
this.show();
|
||||
@@ -834,7 +807,8 @@
|
||||
|
||||
Tooltip._jQueryInterface = function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var $element = $__default["default"](this);
|
||||
var data = $element.data(DATA_KEY);
|
||||
|
||||
var _config = typeof config === 'object' && config;
|
||||
|
||||
@@ -844,7 +818,7 @@
|
||||
|
||||
if (!data) {
|
||||
data = new Tooltip(this, _config);
|
||||
$(this).data(DATA_KEY, data);
|
||||
$element.data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
@@ -897,21 +871,19 @@
|
||||
return Tooltip;
|
||||
}();
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
$.fn[NAME] = Tooltip._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Tooltip;
|
||||
$__default["default"].fn[NAME] = Tooltip._jQueryInterface;
|
||||
$__default["default"].fn[NAME].Constructor = Tooltip;
|
||||
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
$__default["default"].fn[NAME].noConflict = function () {
|
||||
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Tooltip._jQueryInterface;
|
||||
};
|
||||
|
||||
return Tooltip;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=tooltip.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+22
-25
@@ -1,26 +1,26 @@
|
||||
/*!
|
||||
* Bootstrap util.js v4.5.0 (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/master/LICENSE)
|
||||
* Bootstrap util.js v4.6.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 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';
|
||||
|
||||
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): util.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): util.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Private TransitionEnd Helpers
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var TRANSITION_END = 'transitionend';
|
||||
@@ -40,7 +40,7 @@
|
||||
bindType: TRANSITION_END,
|
||||
delegateType: TRANSITION_END,
|
||||
handle: function handle(event) {
|
||||
if ($(event.target).is(this)) {
|
||||
if ($__default["default"](event.target).is(this)) {
|
||||
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
var _this = this;
|
||||
|
||||
var called = false;
|
||||
$(this).one(Util.TRANSITION_END, function () {
|
||||
$__default["default"](this).one(Util.TRANSITION_END, function () {
|
||||
called = true;
|
||||
});
|
||||
setTimeout(function () {
|
||||
@@ -65,13 +65,11 @@
|
||||
}
|
||||
|
||||
function setTransitionEndSupport() {
|
||||
$.fn.emulateTransitionEnd = transitionEndEmulator;
|
||||
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
||||
$__default["default"].fn.emulateTransitionEnd = transitionEndEmulator;
|
||||
$__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
||||
}
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Public Util Api
|
||||
* --------------------------------------------------------------------------
|
||||
* Public Util API
|
||||
*/
|
||||
|
||||
|
||||
@@ -95,7 +93,7 @@
|
||||
|
||||
try {
|
||||
return document.querySelector(selector) ? selector : null;
|
||||
} catch (err) {
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
@@ -105,8 +103,8 @@
|
||||
} // Get transition-duration of the element
|
||||
|
||||
|
||||
var transitionDuration = $(element).css('transition-duration');
|
||||
var transitionDelay = $(element).css('transition-delay');
|
||||
var transitionDuration = $__default["default"](element).css('transition-duration');
|
||||
var transitionDelay = $__default["default"](element).css('transition-delay');
|
||||
var floatTransitionDuration = parseFloat(transitionDuration);
|
||||
var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
|
||||
|
||||
@@ -123,9 +121,8 @@
|
||||
return element.offsetHeight;
|
||||
},
|
||||
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
||||
$(element).trigger(TRANSITION_END);
|
||||
$__default["default"](element).trigger(TRANSITION_END);
|
||||
},
|
||||
// TODO: Remove in v5
|
||||
supportsTransitionEnd: function supportsTransitionEnd() {
|
||||
return Boolean(TRANSITION_END);
|
||||
},
|
||||
@@ -168,11 +165,11 @@
|
||||
return Util.findShadowRoot(element.parentNode);
|
||||
},
|
||||
jQueryDetection: function jQueryDetection() {
|
||||
if (typeof $ === 'undefined') {
|
||||
if (typeof $__default["default"] === '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 version = $__default["default"].fn.jquery.split(' ')[0].split('.');
|
||||
var minMajor = 1;
|
||||
var ltMajor = 2;
|
||||
var minMinor = 9;
|
||||
@@ -189,5 +186,5 @@
|
||||
|
||||
return Util;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=util.js.map
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.6.2): index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
export { default as Alert } from './src/alert'
|
||||
export { default as Button } from './src/button'
|
||||
export { default as Carousel } from './src/carousel'
|
||||
export { default as Collapse } from './src/collapse'
|
||||
export { default as Dropdown } from './src/dropdown'
|
||||
export { default as Modal } from './src/modal'
|
||||
export { default as Popover } from './src/popover'
|
||||
export { default as Scrollspy } from './src/scrollspy'
|
||||
export { default as Tab } from './src/tab'
|
||||
export { default as Toast } from './src/toast'
|
||||
export { default as Tooltip } from './src/tooltip'
|
||||
export { default as Util } from './src/util'
|
||||
+23
-35
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -9,32 +9,28 @@ import $ from 'jquery'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'alert'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.alert'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const NAME = 'alert'
|
||||
const VERSION = '4.6.2'
|
||||
const DATA_KEY = 'bs.alert'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
|
||||
const CLASS_NAME_ALERT = 'alert'
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
|
||||
const EVENT_CLOSE = `close${EVENT_KEY}`
|
||||
const EVENT_CLOSED = `closed${EVENT_KEY}`
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const SELECTOR_DISMISS = '[data-dismiss="alert"]'
|
||||
|
||||
const EVENT_CLOSE = `close${EVENT_KEY}`
|
||||
const EVENT_CLOSED = `closed${EVENT_KEY}`
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const CLASS_NAME_ALERT = 'alert'
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Alert {
|
||||
@@ -43,13 +39,11 @@ class Alert {
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
close(element) {
|
||||
let rootElement = this._element
|
||||
if (element) {
|
||||
@@ -71,10 +65,9 @@ class Alert {
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_getRootElement(element) {
|
||||
const selector = Util.getSelectorFromElement(element)
|
||||
let parent = false
|
||||
let parent = false
|
||||
|
||||
if (selector) {
|
||||
parent = document.querySelector(selector)
|
||||
@@ -105,7 +98,7 @@ class Alert {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(element)
|
||||
|
||||
$(element)
|
||||
.one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))
|
||||
.one(Util.TRANSITION_END, event => this._destroyElement(element, event))
|
||||
.emulateTransitionEnd(transitionDuration)
|
||||
}
|
||||
|
||||
@@ -117,11 +110,10 @@ class Alert {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
const $element = $(this)
|
||||
let data = $element.data(DATA_KEY)
|
||||
let data = $element.data(DATA_KEY)
|
||||
|
||||
if (!data) {
|
||||
data = new Alert(this)
|
||||
@@ -146,9 +138,7 @@ class Alert {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
$(document).on(
|
||||
@@ -158,14 +148,12 @@ $(document).on(
|
||||
)
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Alert._jQueryInterface
|
||||
$.fn[NAME] = Alert._jQueryInterface
|
||||
$.fn[NAME].Constructor = Alert
|
||||
$.fn[NAME].noConflict = () => {
|
||||
$.fn[NAME].noConflict = () => {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||
return Alert._jQueryInterface
|
||||
}
|
||||
|
||||
+39
-48
@@ -1,75 +1,67 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import $ from 'jquery'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'button'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.button'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const NAME = 'button'
|
||||
const VERSION = '4.6.2'
|
||||
const DATA_KEY = 'bs.button'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
|
||||
const CLASS_NAME_ACTIVE = 'active'
|
||||
const CLASS_NAME_BUTTON = 'btn'
|
||||
const CLASS_NAME_FOCUS = 'focus'
|
||||
const CLASS_NAME_FOCUS = 'focus'
|
||||
|
||||
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}`
|
||||
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}`
|
||||
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
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'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Button {
|
||||
constructor(element) {
|
||||
this._element = element
|
||||
this.shouldAvoidTriggerChange = false
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
toggle() {
|
||||
let triggerChangeEvent = true
|
||||
let addAriaPressed = true
|
||||
const rootElement = $(this._element).closest(
|
||||
SELECTOR_DATA_TOGGLES
|
||||
)[0]
|
||||
const rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0]
|
||||
|
||||
if (rootElement) {
|
||||
const input = this._element.querySelector(SELECTOR_INPUT)
|
||||
|
||||
if (input) {
|
||||
if (input.type === 'radio') {
|
||||
if (input.checked &&
|
||||
this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
||||
if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
||||
triggerChangeEvent = false
|
||||
} else {
|
||||
const activeElement = rootElement.querySelector(SELECTOR_ACTIVE)
|
||||
@@ -85,7 +77,10 @@ class Button {
|
||||
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE)
|
||||
}
|
||||
$(input).trigger('change')
|
||||
|
||||
if (!this.shouldAvoidTriggerChange) {
|
||||
$(input).trigger('change')
|
||||
}
|
||||
}
|
||||
|
||||
input.focus()
|
||||
@@ -95,8 +90,7 @@ class Button {
|
||||
|
||||
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
|
||||
if (addAriaPressed) {
|
||||
this._element.setAttribute('aria-pressed',
|
||||
!this._element.classList.contains(CLASS_NAME_ACTIVE))
|
||||
this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE))
|
||||
}
|
||||
|
||||
if (triggerChangeEvent) {
|
||||
@@ -111,16 +105,18 @@ class Button {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
static _jQueryInterface(config, avoidTriggerChange) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const $element = $(this)
|
||||
let data = $element.data(DATA_KEY)
|
||||
|
||||
if (!data) {
|
||||
data = new Button(this)
|
||||
$(this).data(DATA_KEY, data)
|
||||
$element.data(DATA_KEY, data)
|
||||
}
|
||||
|
||||
data.shouldAvoidTriggerChange = avoidTriggerChange
|
||||
|
||||
if (config === 'toggle') {
|
||||
data[config]()
|
||||
}
|
||||
@@ -129,13 +125,11 @@ class Button {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
$(document)
|
||||
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, (event) => {
|
||||
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {
|
||||
let button = event.target
|
||||
const initialButton = button
|
||||
|
||||
@@ -153,13 +147,12 @@ $(document)
|
||||
return
|
||||
}
|
||||
|
||||
if (initialButton.tagName === 'LABEL' && inputBtn && inputBtn.type === 'checkbox') {
|
||||
event.preventDefault() // work around event sent to label and input
|
||||
if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {
|
||||
Button._jQueryInterface.call($(button), 'toggle', initialButton.tagName === 'INPUT')
|
||||
}
|
||||
Button._jQueryInterface.call($(button), 'toggle')
|
||||
}
|
||||
})
|
||||
.on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, (event) => {
|
||||
.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))
|
||||
})
|
||||
@@ -192,9 +185,7 @@ $(window).on(EVENT_LOAD_DATA_API, () => {
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Button._jQueryInterface
|
||||
|
||||
+136
-134
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -9,109 +9,105 @@ import $ from 'jquery'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'carousel'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.carousel'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key
|
||||
const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key
|
||||
const NAME = 'carousel'
|
||||
const VERSION = '4.6.2'
|
||||
const DATA_KEY = 'bs.carousel'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key
|
||||
const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key
|
||||
const TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch
|
||||
const SWIPE_THRESHOLD = 40
|
||||
const SWIPE_THRESHOLD = 40
|
||||
|
||||
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 DIRECTION_NEXT = 'next'
|
||||
const DIRECTION_PREV = 'prev'
|
||||
const DIRECTION_LEFT = 'left'
|
||||
const DIRECTION_RIGHT = 'right'
|
||||
|
||||
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 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 Default = {
|
||||
interval : 5000,
|
||||
keyboard : true,
|
||||
slide : false,
|
||||
pause : 'hover',
|
||||
wrap : true,
|
||||
touch : true
|
||||
interval: 5000,
|
||||
keyboard: true,
|
||||
slide: false,
|
||||
pause: 'hover',
|
||||
wrap: true,
|
||||
touch: true
|
||||
}
|
||||
|
||||
const DefaultType = {
|
||||
interval : '(number|boolean)',
|
||||
keyboard : 'boolean',
|
||||
slide : '(boolean|string)',
|
||||
pause : '(string|boolean)',
|
||||
wrap : 'boolean',
|
||||
touch : 'boolean'
|
||||
interval: '(number|boolean)',
|
||||
keyboard: 'boolean',
|
||||
slide: '(boolean|string)',
|
||||
pause: '(string|boolean)',
|
||||
wrap: 'boolean',
|
||||
touch: 'boolean'
|
||||
}
|
||||
|
||||
const DIRECTION_NEXT = 'next'
|
||||
const DIRECTION_PREV = 'prev'
|
||||
const DIRECTION_LEFT = 'left'
|
||||
const DIRECTION_RIGHT = 'right'
|
||||
|
||||
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 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'
|
||||
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',
|
||||
PEN : 'pen'
|
||||
TOUCH: 'touch',
|
||||
PEN: 'pen'
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Carousel {
|
||||
constructor(element, config) {
|
||||
this._items = null
|
||||
this._interval = null
|
||||
this._items = null
|
||||
this._interval = null
|
||||
this._activeElement = null
|
||||
this._isPaused = false
|
||||
this._isSliding = false
|
||||
this.touchTimeout = null
|
||||
this.touchStartX = 0
|
||||
this.touchDeltaX = 0
|
||||
this._isPaused = false
|
||||
this._isSliding = false
|
||||
this.touchTimeout = null
|
||||
this.touchStartX = 0
|
||||
this.touchDeltaX = 0
|
||||
|
||||
this._config = this._getConfig(config)
|
||||
this._element = element
|
||||
this._config = this._getConfig(config)
|
||||
this._element = element
|
||||
this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS)
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
|
||||
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent)
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
|
||||
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent)
|
||||
|
||||
this._addEventListeners()
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
@@ -121,7 +117,6 @@ class Carousel {
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
next() {
|
||||
if (!this._isSliding) {
|
||||
this._slide(DIRECTION_NEXT)
|
||||
@@ -129,10 +124,11 @@ class Carousel {
|
||||
}
|
||||
|
||||
nextWhenVisible() {
|
||||
const $element = $(this._element)
|
||||
// Don't call next when the page isn't visible
|
||||
// or the carousel or its parent isn't visible
|
||||
if (!document.hidden &&
|
||||
($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {
|
||||
($element.is(':visible') && $element.css('visibility') !== 'hidden')) {
|
||||
this.next()
|
||||
}
|
||||
}
|
||||
@@ -168,6 +164,8 @@ class Carousel {
|
||||
}
|
||||
|
||||
if (this._config.interval && !this._isPaused) {
|
||||
this._updateInterval()
|
||||
|
||||
this._interval = setInterval(
|
||||
(document.visibilityState ? this.nextWhenVisible : this.next).bind(this),
|
||||
this._config.interval
|
||||
@@ -195,9 +193,9 @@ class Carousel {
|
||||
return
|
||||
}
|
||||
|
||||
const direction = index > activeIndex
|
||||
? DIRECTION_NEXT
|
||||
: DIRECTION_PREV
|
||||
const direction = index > activeIndex ?
|
||||
DIRECTION_NEXT :
|
||||
DIRECTION_PREV
|
||||
|
||||
this._slide(direction, this._items[index])
|
||||
}
|
||||
@@ -206,18 +204,17 @@ class Carousel {
|
||||
$(this._element).off(EVENT_KEY)
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
|
||||
this._items = null
|
||||
this._config = null
|
||||
this._element = null
|
||||
this._interval = null
|
||||
this._isPaused = null
|
||||
this._isSliding = null
|
||||
this._activeElement = null
|
||||
this._items = null
|
||||
this._config = null
|
||||
this._element = null
|
||||
this._interval = null
|
||||
this._isPaused = null
|
||||
this._isSliding = null
|
||||
this._activeElement = null
|
||||
this._indicatorsElement = null
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_getConfig(config) {
|
||||
config = {
|
||||
...Default,
|
||||
@@ -251,13 +248,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) {
|
||||
@@ -270,7 +267,7 @@ class Carousel {
|
||||
return
|
||||
}
|
||||
|
||||
const start = (event) => {
|
||||
const start = event => {
|
||||
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||
this.touchStartX = event.originalEvent.clientX
|
||||
} else if (!this._pointerEvent) {
|
||||
@@ -278,16 +275,14 @@ class Carousel {
|
||||
}
|
||||
}
|
||||
|
||||
const move = (event) => {
|
||||
const move = event => {
|
||||
// ensure swiping with one touch and not pinching
|
||||
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
|
||||
this.touchDeltaX = 0
|
||||
} else {
|
||||
this.touchDeltaX = event.originalEvent.touches[0].clientX - this.touchStartX
|
||||
}
|
||||
this.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ?
|
||||
0 :
|
||||
event.originalEvent.touches[0].clientX - this.touchStartX
|
||||
}
|
||||
|
||||
const end = (event) => {
|
||||
const end = event => {
|
||||
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||
this.touchDeltaX = event.originalEvent.clientX - this.touchStartX
|
||||
}
|
||||
@@ -306,22 +301,23 @@ class Carousel {
|
||||
if (this.touchTimeout) {
|
||||
clearTimeout(this.touchTimeout)
|
||||
}
|
||||
this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)
|
||||
|
||||
this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)
|
||||
}
|
||||
}
|
||||
|
||||
$(this._element.querySelectorAll(SELECTOR_ITEM_IMG))
|
||||
.on(EVENT_DRAG_START, (e) => e.preventDefault())
|
||||
.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).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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,29 +340,29 @@ class Carousel {
|
||||
}
|
||||
|
||||
_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)
|
||||
}
|
||||
|
||||
_getItemByDirection(direction, activeElement) {
|
||||
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 ||
|
||||
const activeIndex = this._getItemIndex(activeElement)
|
||||
const lastItemIndex = this._items.length - 1
|
||||
const isGoingToWrap = isPrevDirection && activeIndex === 0 ||
|
||||
isNextDirection && activeIndex === lastItemIndex
|
||||
|
||||
if (isGoingToWrap && !this._config.wrap) {
|
||||
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
|
||||
? this._items[this._items.length - 1] : this._items[itemIndex]
|
||||
return itemIndex === -1 ?
|
||||
this._items[this._items.length - 1] : this._items[itemIndex]
|
||||
}
|
||||
|
||||
_triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||
@@ -399,10 +395,27 @@ class Carousel {
|
||||
}
|
||||
}
|
||||
|
||||
_updateInterval() {
|
||||
const element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||
|
||||
if (!element) {
|
||||
return
|
||||
}
|
||||
|
||||
const elementInterval = parseInt(element.getAttribute('data-interval'), 10)
|
||||
|
||||
if (elementInterval) {
|
||||
this._config.defaultInterval = this._config.defaultInterval || this._config.interval
|
||||
this._config.interval = elementInterval
|
||||
} else {
|
||||
this._config.interval = this._config.defaultInterval || this._config.interval
|
||||
}
|
||||
}
|
||||
|
||||
_slide(direction, element) {
|
||||
const activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||
const activeElementIndex = this._getItemIndex(activeElement)
|
||||
const nextElement = element || activeElement &&
|
||||
const nextElement = element || activeElement &&
|
||||
this._getItemByDirection(direction, activeElement)
|
||||
const nextElementIndex = this._getItemIndex(nextElement)
|
||||
const isCycling = Boolean(this._interval)
|
||||
@@ -443,6 +456,7 @@ class Carousel {
|
||||
}
|
||||
|
||||
this._setActiveIndicatorElement(nextElement)
|
||||
this._activeElement = nextElement
|
||||
|
||||
const slidEvent = $.Event(EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
@@ -459,14 +473,6 @@ class Carousel {
|
||||
$(activeElement).addClass(directionalClassName)
|
||||
$(nextElement).addClass(directionalClassName)
|
||||
|
||||
const nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10)
|
||||
if (nextElementInterval) {
|
||||
this._config.defaultInterval = this._config.defaultInterval || this._config.interval
|
||||
this._config.interval = nextElementInterval
|
||||
} else {
|
||||
this._config.interval = this._config.defaultInterval || this._config.interval
|
||||
}
|
||||
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(activeElement)
|
||||
|
||||
$(activeElement)
|
||||
@@ -496,7 +502,6 @@ class Carousel {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
@@ -525,6 +530,7 @@ class Carousel {
|
||||
if (typeof data[action] === 'undefined') {
|
||||
throw new TypeError(`No method named "${action}"`)
|
||||
}
|
||||
|
||||
data[action]()
|
||||
} else if (_config.interval && _config.ride) {
|
||||
data.pause()
|
||||
@@ -567,9 +573,7 @@ class Carousel {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler)
|
||||
@@ -583,9 +587,7 @@ $(window).on(EVENT_LOAD_DATA_API, () => {
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Carousel._jQueryInterface
|
||||
|
||||
+48
-59
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -9,57 +9,53 @@ import $ from 'jquery'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'collapse'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.collapse'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const NAME = 'collapse'
|
||||
const VERSION = '4.6.2'
|
||||
const DATA_KEY = 'bs.collapse'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_COLLAPSE = 'collapse'
|
||||
const CLASS_NAME_COLLAPSING = 'collapsing'
|
||||
const CLASS_NAME_COLLAPSED = 'collapsed'
|
||||
|
||||
const DIMENSION_WIDTH = 'width'
|
||||
const DIMENSION_HEIGHT = 'height'
|
||||
|
||||
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 SELECTOR_ACTIVES = '.show, .collapsing'
|
||||
const SELECTOR_DATA_TOGGLE = '[data-toggle="collapse"]'
|
||||
|
||||
const Default = {
|
||||
toggle : true,
|
||||
parent : ''
|
||||
toggle: true,
|
||||
parent: ''
|
||||
}
|
||||
|
||||
const DefaultType = {
|
||||
toggle : 'boolean',
|
||||
parent : '(string|element)'
|
||||
toggle: 'boolean',
|
||||
parent: '(string|element)'
|
||||
}
|
||||
|
||||
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 CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_COLLAPSE = 'collapse'
|
||||
const CLASS_NAME_COLLAPSING = 'collapsing'
|
||||
const CLASS_NAME_COLLAPSED = 'collapsed'
|
||||
|
||||
const DIMENSION_WIDTH = 'width'
|
||||
const DIMENSION_HEIGHT = 'height'
|
||||
|
||||
const SELECTOR_ACTIVES = '.show, .collapsing'
|
||||
const SELECTOR_DATA_TOGGLE = '[data-toggle="collapse"]'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Collapse {
|
||||
constructor(element, config) {
|
||||
this._isTransitioning = false
|
||||
this._element = element
|
||||
this._config = this._getConfig(config)
|
||||
this._triggerArray = [].slice.call(document.querySelectorAll(
|
||||
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}"]`
|
||||
))
|
||||
@@ -69,7 +65,7 @@ class Collapse {
|
||||
const elem = toggleList[i]
|
||||
const selector = Util.getSelectorFromElement(elem)
|
||||
const filterElement = [].slice.call(document.querySelectorAll(selector))
|
||||
.filter((foundElem) => foundElem === element)
|
||||
.filter(foundElem => foundElem === element)
|
||||
|
||||
if (selector !== null && filterElement.length > 0) {
|
||||
this._selector = selector
|
||||
@@ -89,7 +85,6 @@ class Collapse {
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
@@ -99,7 +94,6 @@ class Collapse {
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
toggle() {
|
||||
if ($(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||
this.hide()
|
||||
@@ -119,7 +113,7 @@ class Collapse {
|
||||
|
||||
if (this._parent) {
|
||||
actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES))
|
||||
.filter((elem) => {
|
||||
.filter(elem => {
|
||||
if (typeof this._config.parent === 'string') {
|
||||
return elem.getAttribute('data-parent') === this._config.parent
|
||||
}
|
||||
@@ -254,15 +248,14 @@ class Collapse {
|
||||
dispose() {
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
|
||||
this._config = null
|
||||
this._parent = null
|
||||
this._element = null
|
||||
this._triggerArray = null
|
||||
this._config = null
|
||||
this._parent = null
|
||||
this._element = null
|
||||
this._triggerArray = null
|
||||
this._isTransitioning = null
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_getConfig(config) {
|
||||
config = {
|
||||
...Default,
|
||||
@@ -316,7 +309,6 @@ class Collapse {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _getTargetFromElement(element) {
|
||||
const selector = Util.getSelectorFromElement(element)
|
||||
return selector ? document.querySelector(selector) : null
|
||||
@@ -324,12 +316,12 @@ class Collapse {
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
const $this = $(this)
|
||||
let data = $this.data(DATA_KEY)
|
||||
const $element = $(this)
|
||||
let data = $element.data(DATA_KEY)
|
||||
const _config = {
|
||||
...Default,
|
||||
...$this.data(),
|
||||
...typeof config === 'object' && config ? config : {}
|
||||
...$element.data(),
|
||||
...(typeof config === 'object' && config ? config : {})
|
||||
}
|
||||
|
||||
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||
@@ -338,13 +330,14 @@ class Collapse {
|
||||
|
||||
if (!data) {
|
||||
data = new Collapse(this, _config)
|
||||
$this.data(DATA_KEY, data)
|
||||
$element.data(DATA_KEY, data)
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`)
|
||||
}
|
||||
|
||||
data[config]()
|
||||
}
|
||||
})
|
||||
@@ -352,9 +345,7 @@ class Collapse {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
@@ -369,16 +360,14 @@ $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
|
||||
$(selectors).each(function () {
|
||||
const $target = $(this)
|
||||
const data = $target.data(DATA_KEY)
|
||||
const config = data ? 'toggle' : $trigger.data()
|
||||
const data = $target.data(DATA_KEY)
|
||||
const config = data ? 'toggle' : $trigger.data()
|
||||
Collapse._jQueryInterface.call($target, config)
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Collapse._jQueryInterface
|
||||
|
||||
+76
-87
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -10,92 +10,87 @@ import Popper from 'popper.js'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'dropdown'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.dropdown'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
|
||||
const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key
|
||||
const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key
|
||||
const ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key
|
||||
const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key
|
||||
const NAME = 'dropdown'
|
||||
const VERSION = '4.6.2'
|
||||
const DATA_KEY = 'bs.dropdown'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
|
||||
const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key
|
||||
const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key
|
||||
const ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key
|
||||
const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key
|
||||
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 REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)
|
||||
|
||||
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 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_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"]'
|
||||
const SELECTOR_FORM_CHILD = '.dropdown form'
|
||||
const SELECTOR_MENU = '.dropdown-menu'
|
||||
const SELECTOR_NAVBAR_NAV = '.navbar-nav'
|
||||
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 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 PLACEMENT_TOP = 'top-start'
|
||||
const PLACEMENT_TOPEND = 'top-end'
|
||||
const PLACEMENT_BOTTOM = 'bottom-start'
|
||||
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 PLACEMENT_RIGHT = 'right-start'
|
||||
const PLACEMENT_LEFT = 'left-start'
|
||||
|
||||
const Default = {
|
||||
offset : 0,
|
||||
flip : true,
|
||||
boundary : 'scrollParent',
|
||||
reference : 'toggle',
|
||||
display : 'dynamic',
|
||||
popperConfig : null
|
||||
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',
|
||||
popperConfig : '(null|object)'
|
||||
offset: '(number|string|function)',
|
||||
flip: 'boolean',
|
||||
boundary: '(string|element)',
|
||||
reference: '(string|element)',
|
||||
display: 'string',
|
||||
popperConfig: '(null|object)'
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Dropdown {
|
||||
constructor(element, config) {
|
||||
this._element = element
|
||||
this._popper = null
|
||||
this._config = this._getConfig(config)
|
||||
this._menu = this._getMenuElement()
|
||||
this._element = element
|
||||
this._popper = null
|
||||
this._config = this._getConfig(config)
|
||||
this._menu = this._getMenuElement()
|
||||
this._inNavbar = this._detectNavbar()
|
||||
|
||||
this._addEventListeners()
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
@@ -109,7 +104,6 @@ class Dropdown {
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
toggle() {
|
||||
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
return
|
||||
@@ -143,14 +137,11 @@ class Dropdown {
|
||||
return
|
||||
}
|
||||
|
||||
// Disable totally Popper.js for Dropdown in Navbar
|
||||
// Totally disable Popper for Dropdowns in Navbar
|
||||
if (!this._inNavbar && usePopper) {
|
||||
/**
|
||||
* Check for Popper dependency
|
||||
* Popper - https://popper.js.org
|
||||
*/
|
||||
// Check for Popper dependency
|
||||
if (typeof Popper === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)')
|
||||
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)')
|
||||
}
|
||||
|
||||
let referenceElement = this._element
|
||||
@@ -172,6 +163,7 @@ class Dropdown {
|
||||
if (this._config.boundary !== 'scrollParent') {
|
||||
$(parent).addClass(CLASS_NAME_POSITION_STATIC)
|
||||
}
|
||||
|
||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())
|
||||
}
|
||||
|
||||
@@ -239,9 +231,8 @@ class Dropdown {
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_addEventListeners() {
|
||||
$(this._element).on(EVENT_CLICK, (event) => {
|
||||
$(this._element).on(EVENT_CLICK, event => {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
this.toggle()
|
||||
@@ -272,6 +263,7 @@ class Dropdown {
|
||||
this._menu = parent.querySelector(SELECTOR_MENU)
|
||||
}
|
||||
}
|
||||
|
||||
return this._menu
|
||||
}
|
||||
|
||||
@@ -281,9 +273,9 @@ class Dropdown {
|
||||
|
||||
// Handle dropup
|
||||
if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
|
||||
placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT)
|
||||
? PLACEMENT_TOPEND
|
||||
: PLACEMENT_TOP
|
||||
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)) {
|
||||
@@ -291,6 +283,7 @@ class Dropdown {
|
||||
} else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
|
||||
placement = PLACEMENT_BOTTOMEND
|
||||
}
|
||||
|
||||
return placement
|
||||
}
|
||||
|
||||
@@ -302,10 +295,10 @@ class Dropdown {
|
||||
const offset = {}
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = (data) => {
|
||||
offset.fn = data => {
|
||||
data.offsets = {
|
||||
...data.offsets,
|
||||
...this._config.offset(data.offsets, this._element) || {}
|
||||
...this._config.offset(data.offsets, this._element)
|
||||
}
|
||||
|
||||
return data
|
||||
@@ -331,7 +324,7 @@ class Dropdown {
|
||||
}
|
||||
}
|
||||
|
||||
// Disable Popper.js if we have a static display
|
||||
// Disable Popper if we have a static display
|
||||
if (this._config.display === 'static') {
|
||||
popperConfig.modifiers.applyStyle = {
|
||||
enabled: false
|
||||
@@ -345,7 +338,6 @@ class Dropdown {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
@@ -360,6 +352,7 @@ class Dropdown {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`)
|
||||
}
|
||||
|
||||
data[config]()
|
||||
}
|
||||
})
|
||||
@@ -444,8 +437,8 @@ class Dropdown {
|
||||
// - 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 &&
|
||||
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
|
||||
@@ -455,7 +448,7 @@ class Dropdown {
|
||||
return
|
||||
}
|
||||
|
||||
const parent = Dropdown._getParentFromElement(this)
|
||||
const parent = Dropdown._getParentFromElement(this)
|
||||
const isActive = $(parent).hasClass(CLASS_NAME_SHOW)
|
||||
|
||||
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||
@@ -465,7 +458,7 @@ class Dropdown {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
||||
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||
if (!isActive || (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
$(parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus')
|
||||
}
|
||||
@@ -475,7 +468,7 @@ class Dropdown {
|
||||
}
|
||||
|
||||
const items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS))
|
||||
.filter((item) => $(item).is(':visible'))
|
||||
.filter(item => $(item).is(':visible'))
|
||||
|
||||
if (items.length === 0) {
|
||||
return
|
||||
@@ -500,9 +493,7 @@ class Dropdown {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
$(document)
|
||||
@@ -514,14 +505,12 @@ $(document)
|
||||
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()
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Dropdown._jQueryInterface
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import Alert from './alert'
|
||||
import Button from './button'
|
||||
import Carousel from './carousel'
|
||||
import Collapse from './collapse'
|
||||
import Dropdown from './dropdown'
|
||||
import Modal from './modal'
|
||||
import Popover from './popover'
|
||||
import Scrollspy from './scrollspy'
|
||||
import Tab from './tab'
|
||||
import Toast from './toast'
|
||||
import Tooltip from './tooltip'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
export {
|
||||
Util,
|
||||
Alert,
|
||||
Button,
|
||||
Carousel,
|
||||
Collapse,
|
||||
Dropdown,
|
||||
Modal,
|
||||
Popover,
|
||||
Scrollspy,
|
||||
Tab,
|
||||
Toast,
|
||||
Tooltip
|
||||
}
|
||||
+121
-116
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -9,82 +9,77 @@ import $ from 'jquery'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'modal'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.modal'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const NAME = 'modal'
|
||||
const VERSION = '4.6.2'
|
||||
const DATA_KEY = 'bs.modal'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
|
||||
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
|
||||
|
||||
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 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 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'
|
||||
|
||||
const Default = {
|
||||
backdrop : true,
|
||||
keyboard : true,
|
||||
focus : true,
|
||||
show : true
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
focus: true,
|
||||
show: true
|
||||
}
|
||||
|
||||
const DefaultType = {
|
||||
backdrop : '(boolean|string)',
|
||||
keyboard : 'boolean',
|
||||
focus : 'boolean',
|
||||
show : 'boolean'
|
||||
backdrop: '(boolean|string)',
|
||||
keyboard: 'boolean',
|
||||
focus: 'boolean',
|
||||
show: 'boolean'
|
||||
}
|
||||
|
||||
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 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'
|
||||
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'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Modal {
|
||||
constructor(element, config) {
|
||||
this._config = this._getConfig(config)
|
||||
this._element = element
|
||||
this._dialog = element.querySelector(SELECTOR_DIALOG)
|
||||
this._backdrop = null
|
||||
this._isShown = false
|
||||
this._isBodyOverflowing = false
|
||||
this._config = this._getConfig(config)
|
||||
this._element = element
|
||||
this._dialog = element.querySelector(SELECTOR_DIALOG)
|
||||
this._backdrop = null
|
||||
this._isShown = false
|
||||
this._isBodyOverflowing = false
|
||||
this._ignoreBackdropClick = false
|
||||
this._isTransitioning = false
|
||||
this._scrollbarWidth = 0
|
||||
this._isTransitioning = false
|
||||
this._scrollbarWidth = 0
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
@@ -94,7 +89,6 @@ class Modal {
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
toggle(relatedTarget) {
|
||||
return this._isShown ? this.hide() : this.show(relatedTarget)
|
||||
}
|
||||
@@ -104,22 +98,22 @@ class Modal {
|
||||
return
|
||||
}
|
||||
|
||||
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._isTransitioning = true
|
||||
}
|
||||
|
||||
const showEvent = $.Event(EVENT_SHOW, {
|
||||
relatedTarget
|
||||
})
|
||||
|
||||
$(this._element).trigger(showEvent)
|
||||
|
||||
if (this._isShown || showEvent.isDefaultPrevented()) {
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return
|
||||
}
|
||||
|
||||
this._isShown = true
|
||||
|
||||
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||
this._isTransitioning = true
|
||||
}
|
||||
|
||||
this._checkScrollbar()
|
||||
this._setScrollbar()
|
||||
|
||||
@@ -131,11 +125,11 @@ class Modal {
|
||||
$(this._element).on(
|
||||
EVENT_CLICK_DISMISS,
|
||||
SELECTOR_DATA_DISMISS,
|
||||
(event) => this.hide(event)
|
||||
event => this.hide(event)
|
||||
)
|
||||
|
||||
$(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, () => {
|
||||
$(this._element).one(EVENT_MOUSEUP_DISMISS, (event) => {
|
||||
$(this._element).one(EVENT_MOUSEUP_DISMISS, event => {
|
||||
if ($(event.target).is(this._element)) {
|
||||
this._ignoreBackdropClick = true
|
||||
}
|
||||
@@ -180,10 +174,10 @@ class Modal {
|
||||
$(this._dialog).off(EVENT_MOUSEDOWN_DISMISS)
|
||||
|
||||
if (transition) {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||
|
||||
$(this._element)
|
||||
.one(Util.TRANSITION_END, (event) => this._hideModal(event))
|
||||
.one(Util.TRANSITION_END, event => this._hideModal(event))
|
||||
.emulateTransitionEnd(transitionDuration)
|
||||
} else {
|
||||
this._hideModal()
|
||||
@@ -192,7 +186,7 @@ class Modal {
|
||||
|
||||
dispose() {
|
||||
[window, this._element, this._dialog]
|
||||
.forEach((htmlElement) => $(htmlElement).off(EVENT_KEY))
|
||||
.forEach(htmlElement => $(htmlElement).off(EVENT_KEY))
|
||||
|
||||
/**
|
||||
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||
@@ -203,15 +197,15 @@ class Modal {
|
||||
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
|
||||
this._config = null
|
||||
this._element = null
|
||||
this._dialog = null
|
||||
this._backdrop = null
|
||||
this._isShown = null
|
||||
this._isBodyOverflowing = null
|
||||
this._config = null
|
||||
this._element = null
|
||||
this._dialog = null
|
||||
this._backdrop = null
|
||||
this._isShown = null
|
||||
this._isBodyOverflowing = null
|
||||
this._ignoreBackdropClick = null
|
||||
this._isTransitioning = null
|
||||
this._scrollbarWidth = null
|
||||
this._isTransitioning = null
|
||||
this._scrollbarWidth = null
|
||||
}
|
||||
|
||||
handleUpdate() {
|
||||
@@ -219,7 +213,6 @@ class Modal {
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_getConfig(config) {
|
||||
config = {
|
||||
...Default,
|
||||
@@ -230,26 +223,35 @@ class Modal {
|
||||
}
|
||||
|
||||
_triggerBackdropTransition() {
|
||||
if (this._config.backdrop === 'static') {
|
||||
const hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED)
|
||||
const hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED)
|
||||
|
||||
$(this._element).trigger(hideEventPrevented)
|
||||
if (hideEventPrevented.defaultPrevented) {
|
||||
return
|
||||
}
|
||||
|
||||
this._element.classList.add(CLASS_NAME_STATIC)
|
||||
|
||||
const modalTransitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||
|
||||
$(this._element).one(Util.TRANSITION_END, () => {
|
||||
this._element.classList.remove(CLASS_NAME_STATIC)
|
||||
})
|
||||
.emulateTransitionEnd(modalTransitionDuration)
|
||||
this._element.focus()
|
||||
} else {
|
||||
this.hide()
|
||||
$(this._element).trigger(hideEventPrevented)
|
||||
if (hideEventPrevented.isDefaultPrevented()) {
|
||||
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()
|
||||
}
|
||||
|
||||
_showElement(relatedTarget) {
|
||||
@@ -265,6 +267,7 @@ 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(CLASS_NAME_SCROLLABLE) && modalBody) {
|
||||
modalBody.scrollTop = 0
|
||||
@@ -290,12 +293,13 @@ class Modal {
|
||||
if (this._config.focus) {
|
||||
this._element.focus()
|
||||
}
|
||||
|
||||
this._isTransitioning = false
|
||||
$(this._element).trigger(shownEvent)
|
||||
}
|
||||
|
||||
if (transition) {
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(this._dialog)
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(this._dialog)
|
||||
|
||||
$(this._dialog)
|
||||
.one(Util.TRANSITION_END, transitionComplete)
|
||||
@@ -308,7 +312,7 @@ class Modal {
|
||||
_enforceFocus() {
|
||||
$(document)
|
||||
.off(EVENT_FOCUSIN) // Guard against infinite focus loop
|
||||
.on(EVENT_FOCUSIN, (event) => {
|
||||
.on(EVENT_FOCUSIN, event => {
|
||||
if (document !== event.target &&
|
||||
this._element !== event.target &&
|
||||
$(this._element).has(event.target).length === 0) {
|
||||
@@ -319,7 +323,7 @@ class Modal {
|
||||
|
||||
_setEscapeEvent() {
|
||||
if (this._isShown) {
|
||||
$(this._element).on(EVENT_KEYDOWN_DISMISS, (event) => {
|
||||
$(this._element).on(EVENT_KEYDOWN_DISMISS, event => {
|
||||
if (this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
event.preventDefault()
|
||||
this.hide()
|
||||
@@ -334,7 +338,7 @@ class Modal {
|
||||
|
||||
_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)
|
||||
}
|
||||
@@ -344,6 +348,7 @@ 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(CLASS_NAME_OPEN)
|
||||
@@ -361,8 +366,8 @@ class Modal {
|
||||
}
|
||||
|
||||
_showBackdrop(callback) {
|
||||
const animate = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||
? CLASS_NAME_FADE : ''
|
||||
const animate = $(this._element).hasClass(CLASS_NAME_FADE) ?
|
||||
CLASS_NAME_FADE : ''
|
||||
|
||||
if (this._isShown && this._config.backdrop) {
|
||||
this._backdrop = document.createElement('div')
|
||||
@@ -374,16 +379,21 @@ 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
|
||||
}
|
||||
|
||||
if (event.target !== event.currentTarget) {
|
||||
return
|
||||
}
|
||||
|
||||
this._triggerBackdropTransition()
|
||||
if (this._config.backdrop === 'static') {
|
||||
this._triggerBackdropTransition()
|
||||
} else {
|
||||
this.hide()
|
||||
}
|
||||
})
|
||||
|
||||
if (animate) {
|
||||
@@ -436,8 +446,7 @@ class Modal {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
_adjustDialog() {
|
||||
const isModalOverflowing =
|
||||
this._element.scrollHeight > document.documentElement.clientHeight
|
||||
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
|
||||
|
||||
if (!this._isBodyOverflowing && isModalOverflowing) {
|
||||
this._element.style.paddingLeft = `${this._scrollbarWidth}px`
|
||||
@@ -529,14 +538,13 @@ class Modal {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config, relatedTarget) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _config = {
|
||||
...Default,
|
||||
...$(this).data(),
|
||||
...typeof config === 'object' && config ? config : {}
|
||||
...(typeof config === 'object' && config ? config : {})
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
@@ -548,6 +556,7 @@ class Modal {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`)
|
||||
}
|
||||
|
||||
data[config](relatedTarget)
|
||||
} else if (_config.show) {
|
||||
data.show(relatedTarget)
|
||||
@@ -557,9 +566,7 @@ class Modal {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
@@ -570,8 +577,8 @@ $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
target = document.querySelector(selector)
|
||||
}
|
||||
|
||||
const config = $(target).data(DATA_KEY)
|
||||
? 'toggle' : {
|
||||
const config = $(target).data(DATA_KEY) ?
|
||||
'toggle' : {
|
||||
...$(target).data(),
|
||||
...$(this).data()
|
||||
}
|
||||
@@ -580,7 +587,7 @@ $(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
|
||||
@@ -597,9 +604,7 @@ $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Modal._jQueryInterface
|
||||
|
||||
+33
-41
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -9,25 +9,29 @@ import $ from 'jquery'
|
||||
import Tooltip from './tooltip'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'popover'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.popover'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const CLASS_PREFIX = 'bs-popover'
|
||||
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
|
||||
const NAME = 'popover'
|
||||
const VERSION = '4.6.2'
|
||||
const DATA_KEY = 'bs.popover'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const CLASS_PREFIX = 'bs-popover'
|
||||
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
|
||||
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
|
||||
const SELECTOR_TITLE = '.popover-header'
|
||||
const SELECTOR_CONTENT = '.popover-body'
|
||||
|
||||
const Default = {
|
||||
...Tooltip.Default,
|
||||
placement : 'right',
|
||||
trigger : 'click',
|
||||
content : '',
|
||||
template : '<div class="popover" role="tooltip">' +
|
||||
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>'
|
||||
@@ -35,37 +39,28 @@ const Default = {
|
||||
|
||||
const DefaultType = {
|
||||
...Tooltip.DefaultType,
|
||||
content : '(string|element|function)'
|
||||
content: '(string|element|function)'
|
||||
}
|
||||
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
|
||||
const SELECTOR_TITLE = '.popover-header'
|
||||
const SELECTOR_CONTENT = '.popover-body'
|
||||
|
||||
const Event = {
|
||||
HIDE : `hide${EVENT_KEY}`,
|
||||
HIDDEN : `hidden${EVENT_KEY}`,
|
||||
SHOW : `show${EVENT_KEY}`,
|
||||
SHOWN : `shown${EVENT_KEY}`,
|
||||
INSERTED : `inserted${EVENT_KEY}`,
|
||||
CLICK : `click${EVENT_KEY}`,
|
||||
FOCUSIN : `focusin${EVENT_KEY}`,
|
||||
FOCUSOUT : `focusout${EVENT_KEY}`,
|
||||
MOUSEENTER : `mouseenter${EVENT_KEY}`,
|
||||
MOUSELEAVE : `mouseleave${EVENT_KEY}`
|
||||
HIDE: `hide${EVENT_KEY}`,
|
||||
HIDDEN: `hidden${EVENT_KEY}`,
|
||||
SHOW: `show${EVENT_KEY}`,
|
||||
SHOWN: `shown${EVENT_KEY}`,
|
||||
INSERTED: `inserted${EVENT_KEY}`,
|
||||
CLICK: `click${EVENT_KEY}`,
|
||||
FOCUSIN: `focusin${EVENT_KEY}`,
|
||||
FOCUSOUT: `focusout${EVENT_KEY}`,
|
||||
MOUSEENTER: `mouseenter${EVENT_KEY}`,
|
||||
MOUSELEAVE: `mouseleave${EVENT_KEY}`
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Popover extends Tooltip {
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
@@ -95,7 +90,6 @@ class Popover extends Tooltip {
|
||||
}
|
||||
|
||||
// Overrides
|
||||
|
||||
isWithContent() {
|
||||
return this.getTitle() || this._getContent()
|
||||
}
|
||||
@@ -118,13 +112,13 @@ class Popover extends Tooltip {
|
||||
if (typeof content === 'function') {
|
||||
content = content.call(this.element)
|
||||
}
|
||||
|
||||
this.setElementContent($tip.find(SELECTOR_CONTENT), content)
|
||||
|
||||
$tip.removeClass(`${CLASS_NAME_FADE} ${CLASS_NAME_SHOW}`)
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_getContent() {
|
||||
return this.element.getAttribute('data-content') ||
|
||||
this.config.content
|
||||
@@ -139,7 +133,6 @@ class Popover extends Tooltip {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
@@ -158,6 +151,7 @@ class Popover extends Tooltip {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`)
|
||||
}
|
||||
|
||||
data[config]()
|
||||
}
|
||||
})
|
||||
@@ -165,9 +159,7 @@ class Popover extends Tooltip {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Popover._jQueryInterface
|
||||
|
||||
+72
-80
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -9,76 +9,71 @@ import $ from 'jquery'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'scrollspy'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.scrollspy'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const NAME = 'scrollspy'
|
||||
const VERSION = '4.6.2'
|
||||
const DATA_KEY = 'bs.scrollspy'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
|
||||
const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'
|
||||
const CLASS_NAME_ACTIVE = 'active'
|
||||
|
||||
const EVENT_ACTIVATE = `activate${EVENT_KEY}`
|
||||
const EVENT_SCROLL = `scroll${EVENT_KEY}`
|
||||
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const METHOD_OFFSET = 'offset'
|
||||
const METHOD_POSITION = 'position'
|
||||
|
||||
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 Default = {
|
||||
offset : 10,
|
||||
method : 'auto',
|
||||
target : ''
|
||||
offset: 10,
|
||||
method: 'auto',
|
||||
target: ''
|
||||
}
|
||||
|
||||
const DefaultType = {
|
||||
offset : 'number',
|
||||
method : 'string',
|
||||
target : '(string|element)'
|
||||
offset: 'number',
|
||||
method: 'string',
|
||||
target: '(string|element)'
|
||||
}
|
||||
|
||||
const EVENT_ACTIVATE = `activate${EVENT_KEY}`
|
||||
const EVENT_SCROLL = `scroll${EVENT_KEY}`
|
||||
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||
|
||||
const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'
|
||||
const CLASS_NAME_ACTIVE = 'active'
|
||||
|
||||
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 METHOD_OFFSET = 'offset'
|
||||
const METHOD_POSITION = 'position'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class ScrollSpy {
|
||||
constructor(element, config) {
|
||||
this._element = element
|
||||
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 = this._getConfig(config)
|
||||
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._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()
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
@@ -88,16 +83,15 @@ class ScrollSpy {
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
refresh() {
|
||||
const autoMethod = this._scrollElement === this._scrollElement.window
|
||||
? METHOD_OFFSET : METHOD_POSITION
|
||||
const autoMethod = this._scrollElement === this._scrollElement.window ?
|
||||
METHOD_OFFSET : METHOD_POSITION
|
||||
|
||||
const offsetMethod = this._config.method === 'auto'
|
||||
? autoMethod : this._config.method
|
||||
const offsetMethod = this._config.method === 'auto' ?
|
||||
autoMethod : this._config.method
|
||||
|
||||
const offsetBase = offsetMethod === METHOD_POSITION
|
||||
? this._getScrollTop() : 0
|
||||
const offsetBase = offsetMethod === METHOD_POSITION ?
|
||||
this._getScrollTop() : 0
|
||||
|
||||
this._offsets = []
|
||||
this._targets = []
|
||||
@@ -107,7 +101,7 @@ class ScrollSpy {
|
||||
const targets = [].slice.call(document.querySelectorAll(this._selector))
|
||||
|
||||
targets
|
||||
.map((element) => {
|
||||
.map(element => {
|
||||
let target
|
||||
const targetSelector = Util.getSelectorFromElement(element)
|
||||
|
||||
@@ -125,11 +119,12 @@ class ScrollSpy {
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
})
|
||||
.filter((item) => item)
|
||||
.filter(Boolean)
|
||||
.sort((a, b) => a[0] - b[0])
|
||||
.forEach((item) => {
|
||||
.forEach(item => {
|
||||
this._offsets.push(item[0])
|
||||
this._targets.push(item[1])
|
||||
})
|
||||
@@ -139,22 +134,21 @@ class ScrollSpy {
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
$(this._scrollElement).off(EVENT_KEY)
|
||||
|
||||
this._element = null
|
||||
this._element = null
|
||||
this._scrollElement = null
|
||||
this._config = null
|
||||
this._selector = null
|
||||
this._offsets = null
|
||||
this._targets = null
|
||||
this._activeTarget = null
|
||||
this._scrollHeight = null
|
||||
this._config = null
|
||||
this._selector = null
|
||||
this._offsets = null
|
||||
this._targets = null
|
||||
this._activeTarget = null
|
||||
this._scrollHeight = null
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_getConfig(config) {
|
||||
config = {
|
||||
...Default,
|
||||
...typeof config === 'object' && config ? config : {}
|
||||
...(typeof config === 'object' && config ? config : {})
|
||||
}
|
||||
|
||||
if (typeof config.target !== 'string' && Util.isElement(config.target)) {
|
||||
@@ -163,6 +157,7 @@ class ScrollSpy {
|
||||
id = Util.getUID(NAME)
|
||||
$(config.target).attr('id', id)
|
||||
}
|
||||
|
||||
config.target = `#${id}`
|
||||
}
|
||||
|
||||
@@ -172,8 +167,8 @@ class ScrollSpy {
|
||||
}
|
||||
|
||||
_getScrollTop() {
|
||||
return this._scrollElement === window
|
||||
? this._scrollElement.pageYOffset : this._scrollElement.scrollTop
|
||||
return this._scrollElement === window ?
|
||||
this._scrollElement.pageYOffset : this._scrollElement.scrollTop
|
||||
}
|
||||
|
||||
_getScrollHeight() {
|
||||
@@ -184,14 +179,14 @@ class ScrollSpy {
|
||||
}
|
||||
|
||||
_getOffsetHeight() {
|
||||
return this._scrollElement === window
|
||||
? window.innerHeight : this._scrollElement.getBoundingClientRect().height
|
||||
return this._scrollElement === window ?
|
||||
window.innerHeight : this._scrollElement.getBoundingClientRect().height
|
||||
}
|
||||
|
||||
_process() {
|
||||
const scrollTop = this._getScrollTop() + this._config.offset
|
||||
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()
|
||||
@@ -203,6 +198,7 @@ class ScrollSpy {
|
||||
if (this._activeTarget !== target) {
|
||||
this._activate(target)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -231,7 +227,7 @@ class ScrollSpy {
|
||||
|
||||
const queries = this._selector
|
||||
.split(',')
|
||||
.map((selector) => `${selector}[data-target="${target}"],${selector}[href="${target}"]`)
|
||||
.map(selector => `${selector}[data-target="${target}"],${selector}[href="${target}"]`)
|
||||
|
||||
const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))
|
||||
|
||||
@@ -262,12 +258,11 @@ class ScrollSpy {
|
||||
|
||||
_clear() {
|
||||
[].slice.call(document.querySelectorAll(this._selector))
|
||||
.filter((node) => node.classList.contains(CLASS_NAME_ACTIVE))
|
||||
.forEach((node) => node.classList.remove(CLASS_NAME_ACTIVE))
|
||||
.filter(node => node.classList.contains(CLASS_NAME_ACTIVE))
|
||||
.forEach(node => node.classList.remove(CLASS_NAME_ACTIVE))
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
@@ -282,6 +277,7 @@ class ScrollSpy {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`)
|
||||
}
|
||||
|
||||
data[config]()
|
||||
}
|
||||
})
|
||||
@@ -289,9 +285,7 @@ class ScrollSpy {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||
@@ -305,9 +299,7 @@ $(window).on(EVENT_LOAD_DATA_API, () => {
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = ScrollSpy._jQueryInterface
|
||||
|
||||
+37
-42
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -9,42 +9,38 @@ import $ from 'jquery'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'tab'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.tab'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
const NAME = 'tab'
|
||||
const VERSION = '4.6.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}`
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||
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 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 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'
|
||||
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 = '.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'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Tab {
|
||||
@@ -53,18 +49,17 @@ class Tab {
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
show() {
|
||||
if (this._element.parentNode &&
|
||||
this._element.parentNode.nodeType === Node.ELEMENT_NODE &&
|
||||
$(this._element).hasClass(CLASS_NAME_ACTIVE) ||
|
||||
$(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||
$(this._element).hasClass(CLASS_NAME_DISABLED) ||
|
||||
this._element.hasAttribute('disabled')) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -133,11 +128,10 @@ class Tab {
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_activate(element, container, callback) {
|
||||
const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL')
|
||||
? $(container).find(SELECTOR_ACTIVE_UL)
|
||||
: $(container).children(SELECTOR_ACTIVE)
|
||||
const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ?
|
||||
$(container).find(SELECTOR_ACTIVE_UL) :
|
||||
$(container).children(SELECTOR_ACTIVE)
|
||||
|
||||
const active = activeElements[0]
|
||||
const isTransitioning = callback && (active && $(active).hasClass(CLASS_NAME_FADE))
|
||||
@@ -187,7 +181,12 @@ class Tab {
|
||||
element.classList.add(CLASS_NAME_SHOW)
|
||||
}
|
||||
|
||||
if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
|
||||
let parent = element.parentNode
|
||||
if (parent && parent.nodeName === 'LI') {
|
||||
parent = parent.parentNode
|
||||
}
|
||||
|
||||
if (parent && $(parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
|
||||
const dropdownElement = $(element).closest(SELECTOR_DROPDOWN)[0]
|
||||
|
||||
if (dropdownElement) {
|
||||
@@ -205,7 +204,6 @@ class Tab {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
const $this = $(this)
|
||||
@@ -220,6 +218,7 @@ class Tab {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`)
|
||||
}
|
||||
|
||||
data[config]()
|
||||
}
|
||||
})
|
||||
@@ -227,9 +226,7 @@ class Tab {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
$(document)
|
||||
@@ -239,9 +236,7 @@ $(document)
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Tab._jQueryInterface
|
||||
|
||||
+42
-46
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.5.0): toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v4.6.2): toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -9,58 +9,53 @@ import $ from 'jquery'
|
||||
import Util from './util'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'toast'
|
||||
const VERSION = '4.5.0'
|
||||
const DATA_KEY = 'bs.toast'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const NAME = 'toast'
|
||||
const VERSION = '4.6.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}`
|
||||
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 CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_HIDE = 'hide'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_FADE = 'fade'
|
||||
const CLASS_NAME_HIDE = 'hide'
|
||||
const CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_SHOWING = 'showing'
|
||||
|
||||
const DefaultType = {
|
||||
animation : 'boolean',
|
||||
autohide : 'boolean',
|
||||
delay : 'number'
|
||||
}
|
||||
|
||||
const Default = {
|
||||
animation : true,
|
||||
autohide : true,
|
||||
delay : 500
|
||||
}
|
||||
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 SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'
|
||||
|
||||
const Default = {
|
||||
animation: true,
|
||||
autohide: true,
|
||||
delay: 500
|
||||
}
|
||||
|
||||
const DefaultType = {
|
||||
animation: 'boolean',
|
||||
autohide: 'boolean',
|
||||
delay: 'number'
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Toast {
|
||||
constructor(element, config) {
|
||||
this._element = element
|
||||
this._config = this._getConfig(config)
|
||||
this._config = this._getConfig(config)
|
||||
this._timeout = null
|
||||
this._setListeners()
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
@@ -74,7 +69,6 @@ class Toast {
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
show() {
|
||||
const showEvent = $.Event(EVENT_SHOW)
|
||||
|
||||
@@ -83,6 +77,8 @@ class Toast {
|
||||
return
|
||||
}
|
||||
|
||||
this._clearTimeout()
|
||||
|
||||
if (this._config.animation) {
|
||||
this._element.classList.add(CLASS_NAME_FADE)
|
||||
}
|
||||
@@ -130,8 +126,7 @@ class Toast {
|
||||
}
|
||||
|
||||
dispose() {
|
||||
clearTimeout(this._timeout)
|
||||
this._timeout = null
|
||||
this._clearTimeout()
|
||||
|
||||
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
this._element.classList.remove(CLASS_NAME_SHOW)
|
||||
@@ -141,16 +136,15 @@ class Toast {
|
||||
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
this._element = null
|
||||
this._config = null
|
||||
this._config = null
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_getConfig(config) {
|
||||
config = {
|
||||
...Default,
|
||||
...$(this._element).data(),
|
||||
...typeof config === 'object' && config ? config : {}
|
||||
...(typeof config === 'object' && config ? config : {})
|
||||
}
|
||||
|
||||
Util.typeCheckConfig(
|
||||
@@ -184,13 +178,17 @@ class Toast {
|
||||
}
|
||||
}
|
||||
|
||||
// Static
|
||||
_clearTimeout() {
|
||||
clearTimeout(this._timeout)
|
||||
this._timeout = null
|
||||
}
|
||||
|
||||
// Static
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
const $element = $(this)
|
||||
let data = $element.data(DATA_KEY)
|
||||
const _config = typeof config === 'object' && config
|
||||
let data = $element.data(DATA_KEY)
|
||||
const _config = typeof config === 'object' && config
|
||||
|
||||
if (!data) {
|
||||
data = new Toast(this, _config)
|
||||
@@ -209,14 +207,12 @@ class Toast {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = Toast._jQueryInterface
|
||||
$.fn[NAME] = Toast._jQueryInterface
|
||||
$.fn[NAME].Constructor = Toast
|
||||
$.fn[NAME].noConflict = () => {
|
||||
$.fn[NAME].noConflict = () => {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||
return Toast._jQueryInterface
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user