initial commit
This commit is contained in:
commit
2c3e91dae4
0
.hugo_build.lock
Normal file
0
.hugo_build.lock
Normal file
20
LICENSE
Normal file
20
LICENSE
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2020 StaticMania
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
52
README.md
Normal file
52
README.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<h1>Portio Hugo</h1>
|
||||||
|
<img src="https://user-images.githubusercontent.com/25920065/91142412-8a895c80-e6d2-11ea-93dd-5de59ce60adf.jpg" alt="screenshot" width="100%">
|
||||||
|
|
||||||
|
Portio is a simple, minimal and responsive Portfolio Hugo Theme. Portio is well organized, well-formatted and named accordingly so it’s easy to change any and all of the design. Portio is built with Bootstrap 4. You can customize it very easy to fit your needs.
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
- [Live Demo](#live-demo)
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [Main Features](#features)
|
||||||
|
- [Support](#support)
|
||||||
|
- [Licensing](#licensing)
|
||||||
|
- [Hire](#hire)
|
||||||
|
|
||||||
|
## Live Demo
|
||||||
|
|
||||||
|
Checkout the live demo [here](https://portio-hugo.staticmania.com/)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Add the repository into your Hugo Project repository as a submodule, `git submodule add https://github.com/StaticMania/portio-hugo themes/portio`.
|
||||||
|
2. Copy the `.forestry`, `data`, `content`, `static`, `resources` & `config.toml` files from the `exampleSite` directory and paste it on you Hugo Project repository/directory. From the site home directory:
|
||||||
|
|
||||||
|
cp -a themes/portio/exampleSite/\* .
|
||||||
|
|
||||||
|
3. Build your site with `hugo serve` and see the result at `http://localhost:1313/`.
|
||||||
|
|
||||||
|
**Make sure to use Hugo Extended to serve/build your site, as else the SASS/SCSS won't be rendered correctly**
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Responsive Ready.
|
||||||
|
- Powered by Bootstrap 4.
|
||||||
|
- Blog Support.
|
||||||
|
- Well formatted code.
|
||||||
|
- Easy Customization.
|
||||||
|
- FabForm.io [static website form](https://fabform.io).
|
||||||
|
- Google Analytics.
|
||||||
|
- Forestry Integrated.
|
||||||
|
- Crafted for Personal Portfolio
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
Have some question or facing any technical trouble feel free to [Contact Us](https://staticmania.com/contact/)
|
||||||
|
|
||||||
|
## Licensing
|
||||||
|
|
||||||
|
This Repository is licensed under the [MIT](https://github.com/StaticMania/portio-hugo/blob/master/LICENSE) License
|
||||||
|
|
||||||
|
## Hire
|
||||||
|
|
||||||
|
Need help to build HUGO websites with your custom requirements. Feel free to [contact](https://staticmania.com/contact/) us. We provide custom development service for HUGO.
|
17
assets/bootstrap-4.5.2/.babelrc.js
vendored
Normal file
17
assets/bootstrap-4.5.2/.babelrc.js
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
'@babel/preset-env',
|
||||||
|
{
|
||||||
|
loose: true,
|
||||||
|
bugfixes: true,
|
||||||
|
modules: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
env: {
|
||||||
|
test: {
|
||||||
|
plugins: [ 'istanbul' ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
13
assets/bootstrap-4.5.2/.browserslistrc
Normal file
13
assets/bootstrap-4.5.2/.browserslistrc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# https://github.com/browserslist/browserslist#readme
|
||||||
|
|
||||||
|
>= 1%
|
||||||
|
last 1 major version
|
||||||
|
not dead
|
||||||
|
Chrome >= 45
|
||||||
|
Firefox >= 38
|
||||||
|
Edge >= 12
|
||||||
|
Explorer >= 10
|
||||||
|
iOS >= 9
|
||||||
|
Safari >= 9
|
||||||
|
Android >= 4.4
|
||||||
|
Opera >= 30
|
50
assets/bootstrap-4.5.2/.bundlewatch.config.json
Normal file
50
assets/bootstrap-4.5.2/.bundlewatch.config.json
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap-grid.css",
|
||||||
|
"maxSize": "7 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap-grid.min.css",
|
||||||
|
"maxSize": "6.25 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap-reboot.css",
|
||||||
|
"maxSize": "2 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap-reboot.min.css",
|
||||||
|
"maxSize": "2 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap.css",
|
||||||
|
"maxSize": "25.5 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap.min.css",
|
||||||
|
"maxSize": "23.5 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/js/bootstrap.bundle.js",
|
||||||
|
"maxSize": "47.50 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/js/bootstrap.bundle.min.js",
|
||||||
|
"maxSize": "21.5 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/js/bootstrap.js",
|
||||||
|
"maxSize": "25 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/js/bootstrap.min.js",
|
||||||
|
"maxSize": "14.75 kB"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ci": {
|
||||||
|
"trackBranches": [
|
||||||
|
"main",
|
||||||
|
"v4-dev"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
14
assets/bootstrap-4.5.2/.editorconfig
Normal file
14
assets/bootstrap-4.5.2/.editorconfig
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# editorconfig.org
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
6
assets/bootstrap-4.5.2/.eslintignore
Normal file
6
assets/bootstrap-4.5.2/.eslintignore
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
**/*.min.js
|
||||||
|
**/dist/
|
||||||
|
**/vendor/
|
||||||
|
/_gh_pages/
|
||||||
|
/js/coverage/
|
||||||
|
/package.js
|
231
assets/bootstrap-4.5.2/.eslintrc.json
Normal file
231
assets/bootstrap-4.5.2/.eslintrc.json
Normal file
@ -0,0 +1,231 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"parser": "babel-eslint",
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es6": true
|
||||||
|
},
|
||||||
|
"extends": ["eslint:recommended"],
|
||||||
|
"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",
|
||||||
|
"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",
|
||||||
|
"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-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"
|
||||||
|
}
|
||||||
|
}
|
8
assets/bootstrap-4.5.2/.gitattributes
vendored
Normal file
8
assets/bootstrap-4.5.2/.gitattributes
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Enforce Unix newlines
|
||||||
|
* text=auto eol=lf
|
||||||
|
|
||||||
|
# Don't diff or textually merge source maps
|
||||||
|
*.map binary
|
||||||
|
|
||||||
|
bootstrap.css linguist-vendored=false
|
||||||
|
bootstrap.js linguist-vendored=false
|
3
assets/bootstrap-4.5.2/.github/CODEOWNERS
vendored
Normal file
3
assets/bootstrap-4.5.2/.github/CODEOWNERS
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.js @twbs/js-review
|
||||||
|
*.css @twbs/css-review
|
||||||
|
*.scss @twbs/css-review
|
239
assets/bootstrap-4.5.2/.github/CONTRIBUTING.md
vendored
Normal file
239
assets/bootstrap-4.5.2/.github/CONTRIBUTING.md
vendored
Normal file
@ -0,0 +1,239 @@
|
|||||||
|
# Contributing to Bootstrap
|
||||||
|
|
||||||
|
Looking to contribute something to Bootstrap? **Here's how you can help.**
|
||||||
|
|
||||||
|
Please take a moment to review this document in order to make the contribution
|
||||||
|
process easy and effective for everyone involved.
|
||||||
|
|
||||||
|
Following these guidelines helps to communicate that you respect the time of
|
||||||
|
the developers managing and developing this open source project. In return,
|
||||||
|
they should reciprocate that respect in addressing your issue or assessing
|
||||||
|
patches and features.
|
||||||
|
|
||||||
|
|
||||||
|
## Using the issue tracker
|
||||||
|
|
||||||
|
The [issue tracker](https://github.com/twbs/bootstrap/issues) is
|
||||||
|
the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests)
|
||||||
|
and [submitting pull requests](#pull-requests), but please respect the following
|
||||||
|
restrictions:
|
||||||
|
|
||||||
|
* Please **do not** use the issue tracker for personal support requests. Stack
|
||||||
|
Overflow ([`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag),
|
||||||
|
[Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](README.md#community) are better places to get help.
|
||||||
|
|
||||||
|
* Please **do not** derail or troll issues. Keep the discussion on topic and
|
||||||
|
respect the opinions of others.
|
||||||
|
|
||||||
|
* Please **do not** post comments consisting solely of "+1" or ":thumbsup:".
|
||||||
|
Use [GitHub's "reactions" feature](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
|
||||||
|
instead. We reserve the right to delete comments which violate this rule.
|
||||||
|
|
||||||
|
* Please **do not** open issues regarding the official themes offered on <https://themes.getbootstrap.com/>.
|
||||||
|
Instead, please email any questions or feedback regarding those themes to `themes AT getbootstrap DOT com`.
|
||||||
|
|
||||||
|
|
||||||
|
## Issues and labels
|
||||||
|
|
||||||
|
Our bug tracker utilizes several labels to help organize and identify issues. Here's what they represent and how we use them:
|
||||||
|
|
||||||
|
- `browser bug` - Issues that are reported to us, but actually are the result of a browser-specific bug. These are diagnosed with reduced test cases and result in an issue opened on that browser's own bug tracker.
|
||||||
|
- `confirmed` - Issues that have been confirmed with a reduced test case and identify a bug in Bootstrap.
|
||||||
|
- `css` - Issues stemming from our compiled CSS or source Sass files.
|
||||||
|
- `docs` - Issues for improving or updating our documentation.
|
||||||
|
- `examples` - Issues involving the example templates included in our docs.
|
||||||
|
- `feature` - Issues asking for a new feature to be added, or an existing one to be extended or modified. New features require a minor version bump (e.g., `v3.0.0` to `v3.1.0`).
|
||||||
|
- `build` - Issues with our build system, which is used to run all our tests, concatenate and compile source files, and more.
|
||||||
|
- `help wanted` - Issues we need or would love help from the community to resolve.
|
||||||
|
- `js` - Issues stemming from our compiled or source JavaScript files.
|
||||||
|
- `meta` - Issues with the project itself or our GitHub repository.
|
||||||
|
|
||||||
|
For a complete look at our labels, see the [project labels page](https://github.com/twbs/bootstrap/labels).
|
||||||
|
|
||||||
|
|
||||||
|
## Bug reports
|
||||||
|
|
||||||
|
A bug is a _demonstrable problem_ that is caused by the code in the repository.
|
||||||
|
Good bug reports are extremely helpful, so thanks!
|
||||||
|
|
||||||
|
Guidelines for bug reports:
|
||||||
|
|
||||||
|
0. **[validate your HTML](https://html5.validator.nu/)** to ensure your
|
||||||
|
problem isn't caused by a simple error in your own code.
|
||||||
|
|
||||||
|
1. **Use the GitHub issue search** — check if the issue has already been
|
||||||
|
reported.
|
||||||
|
|
||||||
|
2. **Check if the issue has been fixed** — try to reproduce it using the
|
||||||
|
latest `master` or `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.
|
||||||
|
[This JS Bin](https://jsbin.com/lolome/edit?html,output) is a helpful template.
|
||||||
|
|
||||||
|
|
||||||
|
A good bug report shouldn't leave others needing to chase you up for more
|
||||||
|
information. Please try to be as detailed as possible in your report. What is
|
||||||
|
your environment? What steps will reproduce the issue? What browser(s) and OS
|
||||||
|
experience the problem? Do other browsers show the bug differently? What
|
||||||
|
would you expect to be the outcome? All these details will help people to fix
|
||||||
|
any potential bugs.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
> Short and descriptive example bug report title
|
||||||
|
>
|
||||||
|
> A summary of the issue and the browser/OS environment in which it occurs. If
|
||||||
|
> suitable, include the steps required to reproduce the bug.
|
||||||
|
>
|
||||||
|
> 1. This is the first step
|
||||||
|
> 2. This is the second step
|
||||||
|
> 3. Further steps, etc.
|
||||||
|
>
|
||||||
|
> `<url>` - a link to the reduced test case
|
||||||
|
>
|
||||||
|
> Any other information you want to share that is relevant to the issue being
|
||||||
|
> reported. This might include the lines of code that you have identified as
|
||||||
|
> causing the bug, and potential solutions (and your opinions on their
|
||||||
|
> merits).
|
||||||
|
|
||||||
|
### Reporting upstream browser bugs
|
||||||
|
|
||||||
|
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/ | |
|
||||||
|
|
||||||
|
|
||||||
|
## Feature requests
|
||||||
|
|
||||||
|
Feature requests are welcome. But take a moment to find out whether your idea
|
||||||
|
fits with the scope and aims of the project. It's up to *you* to make a strong
|
||||||
|
case to convince the project's developers of the merits of this feature. Please
|
||||||
|
provide as much detail and context as possible.
|
||||||
|
|
||||||
|
|
||||||
|
## Pull requests
|
||||||
|
|
||||||
|
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.
|
||||||
|
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.
|
||||||
|
|
||||||
|
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/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 `v4-dev` branch](https://github.com/twbs/bootstrap/tree/v4-dev/site/docs).
|
||||||
|
**Do not edit the `gh-pages` branch.** That branch is generated from the
|
||||||
|
documentation source files and is managed separately by the Bootstrap Core Team.
|
||||||
|
|
||||||
|
Adhering to the following process is the best way to get your work
|
||||||
|
included in the project:
|
||||||
|
|
||||||
|
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork,
|
||||||
|
and configure the remotes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone your fork of the repo into the current directory
|
||||||
|
git clone https://github.com/<your-username>/bootstrap.git
|
||||||
|
# Navigate to the newly cloned directory
|
||||||
|
cd bootstrap
|
||||||
|
# Assign the original repo to a remote called "upstream"
|
||||||
|
git remote add upstream https://github.com/twbs/bootstrap.git
|
||||||
|
```
|
||||||
|
|
||||||
|
2. If you cloned a while ago, get the latest changes from upstream:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout v4-dev
|
||||||
|
git pull upstream v4-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Create a new topic branch (off the main project development branch) to
|
||||||
|
contain your feature, change, or fix:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout -b <topic-branch-name>
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Commit your changes in logical chunks. Please adhere to these [git commit
|
||||||
|
message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
||||||
|
or your code is unlikely be merged into the main project. Use Git's
|
||||||
|
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
|
||||||
|
feature to tidy up your commits before making them public.
|
||||||
|
|
||||||
|
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git pull [--rebase] upstream v4-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Push your topic branch up to your fork:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git push origin <topic-branch-name>
|
||||||
|
```
|
||||||
|
|
||||||
|
7. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/)
|
||||||
|
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
|
||||||
|
includes code changes) and under the terms of the
|
||||||
|
[Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/)
|
||||||
|
(if it includes documentation changes).
|
||||||
|
|
||||||
|
|
||||||
|
## Code guidelines
|
||||||
|
|
||||||
|
### HTML
|
||||||
|
|
||||||
|
[Adhere to the Code Guide.](https://codeguide.co/#html)
|
||||||
|
|
||||||
|
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
|
||||||
|
- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`.
|
||||||
|
- Use [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes in documentation examples to promote accessibility.
|
||||||
|
|
||||||
|
### CSS
|
||||||
|
|
||||||
|
[Adhere to the Code Guide.](https://codeguide.co/#css)
|
||||||
|
|
||||||
|
- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG20/#visual-audio-contrast).
|
||||||
|
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://a11yproject.com/posts/never-remove-css-outlines/) for more details.
|
||||||
|
|
||||||
|
### JS
|
||||||
|
|
||||||
|
- No semicolons (in client-side JS)
|
||||||
|
- 2 spaces (no tabs)
|
||||||
|
- strict mode
|
||||||
|
- "Attractive"
|
||||||
|
- Don't use [jQuery event alias convenience methods](https://github.com/jquery/jquery/blob/master/src/event/alias.js) (such as `$().focus()`). Instead, use [`$().trigger(eventType, ...)`](https://api.jquery.com/trigger/) or [`$().on(eventType, ...)`](https://api.jquery.com/on/), depending on whether you're firing an event or listening for an event. (For example, `$().trigger('focus')` or `$().on('focus', function (event) { /* handle focus event */ })`) We do this to be compatible with custom builds of jQuery where the event aliases module has been excluded.
|
||||||
|
|
||||||
|
### Checking coding style
|
||||||
|
|
||||||
|
Run `npm run test` before committing to ensure your changes follow our coding standards.
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
By contributing your code, you agree to license your contribution under the [MIT License](../LICENSE).
|
||||||
|
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/).
|
||||||
|
|
||||||
|
Prior to v3.1.0, Bootstrap's code was released under the Apache License v2.0.
|
20
assets/bootstrap-4.5.2/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
20
assets/bootstrap-4.5.2/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +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/) 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)
|
||||||
|
- 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/)
|
18
assets/bootstrap-4.5.2/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
18
assets/bootstrap-4.5.2/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
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/v4-dev/.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
|
11
assets/bootstrap-4.5.2/.github/SUPPORT.md
vendored
Normal file
11
assets/bootstrap-4.5.2/.github/SUPPORT.md
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
### Bug reports
|
||||||
|
|
||||||
|
See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports.
|
||||||
|
|
||||||
|
### How-to
|
||||||
|
|
||||||
|
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.
|
||||||
|
- Ask and explore Stack Overflow with the [`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag.
|
40
assets/bootstrap-4.5.2/.github/workflows/browserstack.yml
vendored
Normal file
40
assets/bootstrap-4.5.2/.github/workflows/browserstack.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
name: BrowserStack
|
||||||
|
on: [push]
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
NODE: 12.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
browserstack:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository == 'twbs/bootstrap'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run dist
|
||||||
|
run: npm run dist
|
||||||
|
|
||||||
|
- name: Run BrowserStack tests
|
||||||
|
run: npm run js-test-cloud
|
||||||
|
env:
|
||||||
|
BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}"
|
||||||
|
BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}"
|
39
assets/bootstrap-4.5.2/.github/workflows/bundlewatch.yml
vendored
Normal file
39
assets/bootstrap-4.5.2/.github/workflows/bundlewatch.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: Bundlewatch
|
||||||
|
on: [push, pull_request]
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
NODE: 12.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bundlewatch:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run dist
|
||||||
|
run: npm run dist
|
||||||
|
|
||||||
|
- name: Run bundlewatch
|
||||||
|
run: npm run bundlewatch
|
||||||
|
env:
|
||||||
|
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"
|
||||||
|
CI_BRANCH_BASE: v4-dev
|
25
assets/bootstrap-4.5.2/.github/workflows/codeql.yml
vendored
Normal file
25
assets/bootstrap-4.5.2/.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: "Code Scanning - Action"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * 0"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CodeQL-Build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: javascript
|
||||||
|
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
33
assets/bootstrap-4.5.2/.github/workflows/css.yml
vendored
Normal file
33
assets/bootstrap-4.5.2/.github/workflows/css.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: CSS
|
||||||
|
on: [push, pull_request]
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
NODE: 12.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
css:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build CSS
|
||||||
|
run: npm run css
|
24
assets/bootstrap-4.5.2/.github/workflows/dart-sass.yml
vendored
Normal file
24
assets/bootstrap-4.5.2/.github/workflows/dart-sass.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: CSS (Dart Sass)
|
||||||
|
on: [push, pull_request]
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
NODE: 12.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
css:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Build CSS with Dart Sass
|
||||||
|
run: |
|
||||||
|
npx --package sass@latest sass --version
|
||||||
|
npx --package sass@latest sass --style expanded --source-map --embed-sources --no-error-css scss/:dist-sass/css/
|
||||||
|
ls -Al dist-sass/css
|
65
assets/bootstrap-4.5.2/.github/workflows/docs.yml
vendored
Normal file
65
assets/bootstrap-4.5.2/.github/workflows/docs.yml
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
name: Docs
|
||||||
|
on: [push, pull_request]
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
NODE: 12.x
|
||||||
|
RUBY: 2.7.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up Ruby
|
||||||
|
uses: actions/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: ${{ env.RUBY }}
|
||||||
|
|
||||||
|
- name: Set up Ruby env
|
||||||
|
run: |
|
||||||
|
echo "gem: --no-document" > ~/.gemrc # Disable gem docs
|
||||||
|
bundle config set clean 'true'
|
||||||
|
bundle config set deployment 'true'
|
||||||
|
|
||||||
|
- name: Set up Ruby cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: vendor/bundle
|
||||||
|
key: ${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}
|
||||||
|
${{ runner.os }}-ruby-v${{ env.RUBY }}-
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- run: ruby --version
|
||||||
|
- run: gem --version
|
||||||
|
- run: bundle --version
|
||||||
|
- run: java -version
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Install bundler dependencies
|
||||||
|
run: bundle install --deployment --jobs=4 --retry=3 --clean
|
||||||
|
|
||||||
|
- name: Copy CSS and JS
|
||||||
|
run: npm run css-copy && npm run js-copy
|
||||||
|
|
||||||
|
- name: Test docs
|
||||||
|
run: npm run docs
|
48
assets/bootstrap-4.5.2/.github/workflows/js.yml
vendored
Normal file
48
assets/bootstrap-4.5.2/.github/workflows/js.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
name: JS Tests
|
||||||
|
on: [push, pull_request]
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
name: Node ${{ matrix.node }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
node: [10, 12]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.OS }}-node-v${{ matrix.node }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run dist
|
||||||
|
run: npm run js
|
||||||
|
|
||||||
|
- name: Run JS tests
|
||||||
|
run: npm run js-test
|
||||||
|
|
||||||
|
- name: Run Coveralls
|
||||||
|
uses: coverallsapp/github-action@master
|
||||||
|
if: matrix.node == 12
|
||||||
|
with:
|
||||||
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
path-to-lcov: "./js/coverage/lcov.info"
|
33
assets/bootstrap-4.5.2/.github/workflows/lint.yml
vendored
Normal file
33
assets/bootstrap-4.5.2/.github/workflows/lint.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: Lint
|
||||||
|
on: [push, pull_request]
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
NODE: 12.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.OS }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
46
assets/bootstrap-4.5.2/.gitignore
vendored
Normal file
46
assets/bootstrap-4.5.2/.gitignore
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# Ignore docs files
|
||||||
|
/_gh_pages/
|
||||||
|
/site/.jekyll-cache
|
||||||
|
/site/.jekyll-metadata
|
||||||
|
/site/docs/**/dist/
|
||||||
|
# Hugo folders
|
||||||
|
/resources/
|
||||||
|
|
||||||
|
# Ignore ruby/bundler files
|
||||||
|
/.bundle/
|
||||||
|
/vendor/
|
||||||
|
/.ruby-version
|
||||||
|
|
||||||
|
# Numerous always-ignore extensions
|
||||||
|
*.diff
|
||||||
|
*.err
|
||||||
|
*.log
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
*.swo
|
||||||
|
*.swp
|
||||||
|
*.vi
|
||||||
|
*.zip
|
||||||
|
*~
|
||||||
|
|
||||||
|
# OS or Editor folders
|
||||||
|
._*
|
||||||
|
.cache
|
||||||
|
.DS_Store
|
||||||
|
.idea
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.tmproj
|
||||||
|
*.esproj
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
|
nbproject
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Komodo
|
||||||
|
.komodotools
|
||||||
|
*.komodoproject
|
||||||
|
|
||||||
|
# Folders to ignore
|
||||||
|
/js/coverage/
|
||||||
|
/node_modules/
|
4
assets/bootstrap-4.5.2/.stylelintignore
Normal file
4
assets/bootstrap-4.5.2/.stylelintignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
**/*.min.css
|
||||||
|
**/dist/
|
||||||
|
**/vendor/
|
||||||
|
/_gh_pages/
|
16
assets/bootstrap-4.5.2/.stylelintrc
Normal file
16
assets/bootstrap-4.5.2/.stylelintrc
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"stylelint-config-twbs-bootstrap/scss"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"property-blacklist": [
|
||||||
|
"border-radius",
|
||||||
|
"border-top-left-radius",
|
||||||
|
"border-top-right-radius",
|
||||||
|
"border-bottom-right-radius",
|
||||||
|
"border-bottom-left-radius",
|
||||||
|
"transition"
|
||||||
|
],
|
||||||
|
"function-blacklist": ["calc"]
|
||||||
|
}
|
||||||
|
}
|
1
assets/bootstrap-4.5.2/CNAME
Normal file
1
assets/bootstrap-4.5.2/CNAME
Normal file
@ -0,0 +1 @@
|
|||||||
|
getbootstrap.com
|
46
assets/bootstrap-4.5.2/CODE_OF_CONDUCT.md
Normal file
46
assets/bootstrap-4.5.2/CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||||
|
|
||||||
|
## Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mdo@getbootstrap.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||||
|
|
||||||
|
## 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
|
9
assets/bootstrap-4.5.2/Gemfile
Normal file
9
assets/bootstrap-4.5.2/Gemfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
group :development, :test do
|
||||||
|
gem 'jekyll', '~> 4.1.1'
|
||||||
|
gem 'jekyll-redirect-from', '~> 0.16.0'
|
||||||
|
gem 'jekyll-sitemap', '~> 1.4.0'
|
||||||
|
gem 'jekyll-toc', '~> 0.14.0'
|
||||||
|
gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?
|
||||||
|
end
|
89
assets/bootstrap-4.5.2/Gemfile.lock
Normal file
89
assets/bootstrap-4.5.2/Gemfile.lock
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
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.13.1)
|
||||||
|
ffi (1.13.1-x64-mingw32)
|
||||||
|
forwardable-extended (2.6.0)
|
||||||
|
http_parser.rb (0.6.0)
|
||||||
|
i18n (1.8.5)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
|
jekyll (4.1.1)
|
||||||
|
addressable (~> 2.4)
|
||||||
|
colorator (~> 1.0)
|
||||||
|
em-websocket (~> 0.5)
|
||||||
|
i18n (~> 1.0)
|
||||||
|
jekyll-sass-converter (~> 2.0)
|
||||||
|
jekyll-watch (~> 2.0)
|
||||||
|
kramdown (~> 2.1)
|
||||||
|
kramdown-parser-gfm (~> 1.0)
|
||||||
|
liquid (~> 4.0)
|
||||||
|
mercenary (~> 0.4.0)
|
||||||
|
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.3.0)
|
||||||
|
rexml
|
||||||
|
kramdown-parser-gfm (1.1.0)
|
||||||
|
kramdown (~> 2.0)
|
||||||
|
liquid (4.0.3)
|
||||||
|
listen (3.2.1)
|
||||||
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
|
mercenary (0.4.0)
|
||||||
|
mini_portile2 (2.4.0)
|
||||||
|
nokogiri (1.10.10)
|
||||||
|
mini_portile2 (~> 2.4.0)
|
||||||
|
nokogiri (1.10.10-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.21.0)
|
||||||
|
safe_yaml (1.0.5)
|
||||||
|
sassc (2.4.0)
|
||||||
|
ffi (~> 1.9)
|
||||||
|
sassc (2.4.0-x64-mingw32)
|
||||||
|
ffi (~> 1.9)
|
||||||
|
terminal-table (1.8.0)
|
||||||
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||||
|
unicode-display_width (1.7.0)
|
||||||
|
wdm (0.1.1)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
x64-mingw32
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
jekyll (~> 4.1.1)
|
||||||
|
jekyll-redirect-from (~> 0.16.0)
|
||||||
|
jekyll-sitemap (~> 1.4.0)
|
||||||
|
jekyll-toc (~> 0.14.0)
|
||||||
|
wdm (~> 0.1.1)
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
2.1.4
|
22
assets/bootstrap-4.5.2/LICENSE
Normal file
22
assets/bootstrap-4.5.2/LICENSE
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2011-2020 Twitter, Inc.
|
||||||
|
Copyright (c) 2011-2020 The Bootstrap Authors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
209
assets/bootstrap-4.5.2/README.md
Normal file
209
assets/bootstrap-4.5.2/README.md
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
<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">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 align="center">Bootstrap</h3>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<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_request.md">Request feature</a>
|
||||||
|
·
|
||||||
|
<a href="https://themes.getbootstrap.com/">Themes</a>
|
||||||
|
·
|
||||||
|
<a href="https://blog.getbootstrap.com/">Blog</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
- [Quick start](#quick-start)
|
||||||
|
- [Status](#status)
|
||||||
|
- [What's included](#whats-included)
|
||||||
|
- [Bugs and feature requests](#bugs-and-feature-requests)
|
||||||
|
- [Documentation](#documentation)
|
||||||
|
- [Contributing](#contributing)
|
||||||
|
- [Community](#community)
|
||||||
|
- [Versioning](#versioning)
|
||||||
|
- [Creators](#creators)
|
||||||
|
- [Thanks](#thanks)
|
||||||
|
- [Copyright and license](#copyright-and-license)
|
||||||
|
|
||||||
|
|
||||||
|
## Quick start
|
||||||
|
|
||||||
|
Several quick start options are available:
|
||||||
|
|
||||||
|
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.5.2.zip)
|
||||||
|
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
|
||||||
|
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap`
|
||||||
|
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@4.5.2`
|
||||||
|
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.5.2`
|
||||||
|
- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass`
|
||||||
|
|
||||||
|
Read the [Getting started page](https://getbootstrap.com/docs/4.5/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
|
||||||
|
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
[![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com/)
|
||||||
|
[![Build Status](https://github.com/twbs/bootstrap/workflows/JS%20Tests/badge.svg?branch=v4-dev)](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Av4-dev)
|
||||||
|
[![npm version](https://img.shields.io/npm/v/bootstrap)](https://www.npmjs.com/package/bootstrap)
|
||||||
|
[![Gem version](https://img.shields.io/gem/v/bootstrap)](https://rubygems.org/gems/bootstrap)
|
||||||
|
[![Meteor Atmosphere](https://img.shields.io/badge/meteor-twbs%3Abootstrap-blue)](https://atmospherejs.com/twbs/bootstrap)
|
||||||
|
[![Packagist Prerelease](https://img.shields.io/packagist/vpre/twbs/bootstrap)](https://packagist.org/packages/twbs/bootstrap)
|
||||||
|
[![NuGet](https://img.shields.io/nuget/vpre/bootstrap)](https://www.nuget.org/packages/bootstrap/absoluteLatest)
|
||||||
|
[![peerDependencies Status](https://img.shields.io/david/peer/twbs/bootstrap)](https://david-dm.org/twbs/bootstrap?type=peer)
|
||||||
|
[![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap)](https://david-dm.org/twbs/bootstrap?type=dev)
|
||||||
|
[![Coverage Status](https://img.shields.io/coveralls/github/twbs/bootstrap/v4-dev)](https://coveralls.io/github/twbs/bootstrap?branch=v4-dev)
|
||||||
|
[![CSS gzip size](https://img.badgesize.io/twbs/bootstrap/v4-dev/dist/css/bootstrap.min.css?compression=gzip&label=CSS%20gzip%20size)](https://github.com/twbs/bootstrap/tree/v4-dev/dist/css/bootstrap.min.css)
|
||||||
|
[![JS gzip size](https://img.badgesize.io/twbs/bootstrap/v4-dev/dist/js/bootstrap.min.js?compression=gzip&label=JS%20gzip%20size)](https://github.com/twbs/bootstrap/tree/v4-dev/dist/js/bootstrap.min.js)
|
||||||
|
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)
|
||||||
|
[![Backers on Open Collective](https://img.shields.io/opencollective/backers/bootstrap)](#backers)
|
||||||
|
[![Sponsors on Open Collective](https://img.shields.io/opencollective/sponsors/bootstrap)](#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:
|
||||||
|
|
||||||
|
```text
|
||||||
|
bootstrap/
|
||||||
|
└── dist/
|
||||||
|
├── css/
|
||||||
|
│ ├── bootstrap-grid.css
|
||||||
|
│ ├── bootstrap-grid.css.map
|
||||||
|
│ ├── bootstrap-grid.min.css
|
||||||
|
│ ├── bootstrap-grid.min.css.map
|
||||||
|
│ ├── bootstrap-reboot.css
|
||||||
|
│ ├── bootstrap-reboot.css.map
|
||||||
|
│ ├── bootstrap-reboot.min.css
|
||||||
|
│ ├── bootstrap-reboot.min.css.map
|
||||||
|
│ ├── bootstrap.css
|
||||||
|
│ ├── bootstrap.css.map
|
||||||
|
│ ├── bootstrap.min.css
|
||||||
|
│ └── bootstrap.min.css.map
|
||||||
|
└── js/
|
||||||
|
├── bootstrap.bundle.js
|
||||||
|
├── bootstrap.bundle.js.map
|
||||||
|
├── bootstrap.bundle.min.js
|
||||||
|
├── bootstrap.bundle.min.js.map
|
||||||
|
├── bootstrap.js
|
||||||
|
├── bootstrap.js.map
|
||||||
|
├── bootstrap.min.js
|
||||||
|
└── bootstrap.min.js.map
|
||||||
|
```
|
||||||
|
|
||||||
|
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/v4-dev/.github/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.
|
||||||
|
|
||||||
|
Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/docs/4.5/assets/js/src/search.js` file.
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
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à.
|
||||||
|
|
||||||
|
Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/).
|
||||||
|
|
||||||
|
### Documentation for previous releases
|
||||||
|
|
||||||
|
You can find all our previous releases docs on <https://getbootstrap.com/docs/versions/>.
|
||||||
|
|
||||||
|
[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.
|
||||||
|
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/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/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/v4-dev/.editorconfig) for easy use in common text editors. Read more and download plugins at <https://editorconfig.org/>.
|
||||||
|
|
||||||
|
|
||||||
|
## Community
|
||||||
|
|
||||||
|
Get updates on Bootstrap's development and chat with the project maintainers and community members.
|
||||||
|
|
||||||
|
- 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.
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
|
||||||
|
## Versioning
|
||||||
|
|
||||||
|
For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](https://semver.org/). Sometimes we screw up, but we adhere to those rules whenever possible.
|
||||||
|
|
||||||
|
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](https://blog.getbootstrap.com/) contain summaries of the most noteworthy changes made in each release.
|
||||||
|
|
||||||
|
|
||||||
|
## Creators
|
||||||
|
|
||||||
|
**Mark Otto**
|
||||||
|
|
||||||
|
- <https://twitter.com/mdo>
|
||||||
|
- <https://github.com/mdo>
|
||||||
|
|
||||||
|
**Jacob Thornton**
|
||||||
|
|
||||||
|
- <https://twitter.com/fat>
|
||||||
|
- <https://github.com/fat>
|
||||||
|
|
||||||
|
|
||||||
|
## Thanks
|
||||||
|
|
||||||
|
<a href="https://www.browserstack.com/">
|
||||||
|
<img src="https://live.browserstack.com/images/opensource/browserstack-logo.svg" alt="BrowserStack Logo" width="192" height="42">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
Thanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers!
|
||||||
|
|
||||||
|
|
||||||
|
## Sponsors
|
||||||
|
|
||||||
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/bootstrap#sponsor)]
|
||||||
|
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/0/avatar.svg)](https://opencollective.com/bootstrap/sponsor/0/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/1/avatar.svg)](https://opencollective.com/bootstrap/sponsor/1/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/2/avatar.svg)](https://opencollective.com/bootstrap/sponsor/2/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/3/avatar.svg)](https://opencollective.com/bootstrap/sponsor/3/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/4/avatar.svg)](https://opencollective.com/bootstrap/sponsor/4/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/5/avatar.svg)](https://opencollective.com/bootstrap/sponsor/5/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/6/avatar.svg)](https://opencollective.com/bootstrap/sponsor/6/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/7/avatar.svg)](https://opencollective.com/bootstrap/sponsor/7/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/8/avatar.svg)](https://opencollective.com/bootstrap/sponsor/8/website)
|
||||||
|
[![](https://opencollective.com/bootstrap/sponsor/9/avatar.svg)](https://opencollective.com/bootstrap/sponsor/9/website)
|
||||||
|
|
||||||
|
|
||||||
|
## Backers
|
||||||
|
|
||||||
|
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/bootstrap#backer)]
|
||||||
|
|
||||||
|
[![Backers](https://opencollective.com/bootstrap/backers.svg?width=890)](https://opencollective.com/bootstrap#backers)
|
||||||
|
|
||||||
|
|
||||||
|
## 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/main/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).
|
7
assets/bootstrap-4.5.2/SECURITY.md
Normal file
7
assets/bootstrap-4.5.2/SECURITY.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Reporting Security Issues
|
||||||
|
|
||||||
|
The Bootstrap team and community take security issues in Bootstrap seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
|
||||||
|
|
||||||
|
To report a security issue, email [security@getbootstrap.com](mailto:security@getbootstrap.com) and include the word "SECURITY" in the subject line.
|
||||||
|
|
||||||
|
We'll endeavor to respond quickly, and will keep you updated throughout the process.
|
74
assets/bootstrap-4.5.2/_config.yml
Normal file
74
assets/bootstrap-4.5.2/_config.yml
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
# 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.2
|
||||||
|
current_ruby_version: 4.5.2
|
||||||
|
docs_version: 4.5
|
||||||
|
github_org: "https://github.com/twbs"
|
||||||
|
repo: "https://github.com/twbs/bootstrap"
|
||||||
|
slack: "https://bootstrap-slack.herokuapp.com"
|
||||||
|
opencollective: "https://opencollective.com/bootstrap"
|
||||||
|
blog: "https://blog.getbootstrap.com"
|
||||||
|
expo: "https://expo.getbootstrap.com"
|
||||||
|
themes: "https://themes.getbootstrap.com"
|
||||||
|
icons: "https://icons.getbootstrap.com"
|
||||||
|
|
||||||
|
download:
|
||||||
|
source: "https://github.com/twbs/bootstrap/archive/v4.5.2.zip"
|
||||||
|
dist: "https://github.com/twbs/bootstrap/releases/download/v4.5.2/bootstrap-4.5.2-dist.zip"
|
||||||
|
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v4.5.2/bootstrap-4.5.2-examples.zip"
|
||||||
|
|
||||||
|
cdn:
|
||||||
|
# See https://www.srihash.org for info on how to generate the hashes
|
||||||
|
css: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
|
||||||
|
css_hash: "sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
|
||||||
|
js: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
|
||||||
|
js_hash: "sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
|
||||||
|
js_bundle: "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"
|
||||||
|
js_bundle_hash: "sha384-LtrjvnR4Twt/qOuYxE721u19sVFLVSA4hf/rRt6PrZTmiPltdZcI7q7PXQBYTKyf"
|
||||||
|
jquery: "https://code.jquery.com/jquery-3.5.1.slim.min.js"
|
||||||
|
jquery_hash: "sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
|
||||||
|
popper: "https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
|
||||||
|
popper_hash: "sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
|
||||||
|
|
||||||
|
toc:
|
||||||
|
min_level: 2
|
||||||
|
max_level: 4
|
||||||
|
no_toc_section_class:
|
||||||
|
- "bd-callout"
|
||||||
|
- "bd-example"
|
19
assets/bootstrap-4.5.2/build/.eslintrc.json
Normal file
19
assets/bootstrap-4.5.2/build/.eslintrc.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": false,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"sourceType": "script"
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
14
assets/bootstrap-4.5.2/build/banner.js
vendored
Normal file
14
assets/bootstrap-4.5.2/build/banner.js
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
|
const pkg = require('../package.json')
|
||||||
|
const year = new Date().getFullYear()
|
||||||
|
|
||||||
|
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/main/LICENSE)
|
||||||
|
*/`
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = getBanner
|
92
assets/bootstrap-4.5.2/build/build-plugins.js
vendored
Normal file
92
assets/bootstrap-4.5.2/build/build-plugins.js
vendored
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 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/main/LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
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 plugins = [
|
||||||
|
babel({
|
||||||
|
// Only transpile our source code
|
||||||
|
exclude: 'node_modules/**',
|
||||||
|
// Inline the required helpers in each file
|
||||||
|
babelHelpers: 'inline'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
const bsPlugins = {
|
||||||
|
Alert: path.resolve(__dirname, '../js/src/alert.js'),
|
||||||
|
Button: path.resolve(__dirname, '../js/src/button.js'),
|
||||||
|
Carousel: path.resolve(__dirname, '../js/src/carousel.js'),
|
||||||
|
Collapse: path.resolve(__dirname, '../js/src/collapse.js'),
|
||||||
|
Dropdown: path.resolve(__dirname, '../js/src/dropdown.js'),
|
||||||
|
Modal: path.resolve(__dirname, '../js/src/modal.js'),
|
||||||
|
Popover: path.resolve(__dirname, '../js/src/popover.js'),
|
||||||
|
ScrollSpy: path.resolve(__dirname, '../js/src/scrollspy.js'),
|
||||||
|
Tab: path.resolve(__dirname, '../js/src/tab.js'),
|
||||||
|
Toast: path.resolve(__dirname, '../js/src/toast.js'),
|
||||||
|
Tooltip: path.resolve(__dirname, '../js/src/tooltip.js'),
|
||||||
|
Util: path.resolve(__dirname, '../js/src/util.js')
|
||||||
|
}
|
||||||
|
const rootPath = TEST ? '../js/coverage/dist/' : '../js/dist/'
|
||||||
|
|
||||||
|
const build = async (plugin) => {
|
||||||
|
console.log(`Building ${plugin} plugin...`)
|
||||||
|
|
||||||
|
const external = ['jquery', 'popper.js']
|
||||||
|
const globals = {
|
||||||
|
jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
|
||||||
|
'popper.js': 'Popper'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do not bundle Util in plugins
|
||||||
|
if (plugin !== 'Util') {
|
||||||
|
external.push(bsPlugins.Util)
|
||||||
|
globals[bsPlugins.Util] = 'Util'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do not bundle Tooltip in Popover
|
||||||
|
if (plugin === 'Popover') {
|
||||||
|
external.push(bsPlugins.Tooltip)
|
||||||
|
globals[bsPlugins.Tooltip] = 'Tooltip'
|
||||||
|
}
|
||||||
|
|
||||||
|
const pluginFilename = `${plugin.toLowerCase()}.js`
|
||||||
|
const bundle = await rollup.rollup({
|
||||||
|
input: bsPlugins[plugin],
|
||||||
|
plugins,
|
||||||
|
external
|
||||||
|
})
|
||||||
|
|
||||||
|
await bundle.write({
|
||||||
|
banner: banner(pluginFilename),
|
||||||
|
format: 'umd',
|
||||||
|
name: plugin,
|
||||||
|
sourcemap: true,
|
||||||
|
globals,
|
||||||
|
file: path.resolve(__dirname, `${rootPath}${pluginFilename}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(`Building ${plugin} plugin... Done!`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const main = async () => {
|
||||||
|
try {
|
||||||
|
await Promise.all(Object.keys(bsPlugins).map((plugin) => build(plugin)))
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
105
assets/bootstrap-4.5.2/build/change-version.js
vendored
Normal file
105
assets/bootstrap-4.5.2/build/change-version.js
vendored
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 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/main/LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const sh = require('shelljs')
|
||||||
|
|
||||||
|
sh.config.fatal = true
|
||||||
|
|
||||||
|
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
|
||||||
|
function regExpQuote(string) {
|
||||||
|
return string.replace(/[$()*+.?[\\\]^{|}-]/g, '\\$&')
|
||||||
|
}
|
||||||
|
|
||||||
|
function regExpQuoteReplacement(string) {
|
||||||
|
return string.replace(/\$/g, '$$')
|
||||||
|
}
|
||||||
|
|
||||||
|
const DRY_RUN = false
|
||||||
|
|
||||||
|
function walkAsync(directory, excludedDirectories, fileCallback, errback) {
|
||||||
|
if (excludedDirectories.has(path.parse(directory).base)) {
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
walkAsync(directory, excludedDirectories, updateFile, (err) => {
|
||||||
|
console.error('ERROR while traversing directory!:')
|
||||||
|
console.error(err)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function main(args) {
|
||||||
|
if (args.length !== 2) {
|
||||||
|
console.error('USAGE: change-version old_version new_version')
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
main(process.argv.slice(2))
|
66
assets/bootstrap-4.5.2/build/generate-sri.js
vendored
Normal file
66
assets/bootstrap-4.5.2/build/generate-sri.js
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Script to generate SRI hashes for use in our docs.
|
||||||
|
* 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/main/LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const crypto = require('crypto')
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const sh = require('shelljs')
|
||||||
|
|
||||||
|
const pkg = require('../package.json')
|
||||||
|
|
||||||
|
sh.config.fatal = true
|
||||||
|
|
||||||
|
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
|
||||||
|
const files = [
|
||||||
|
{
|
||||||
|
file: 'dist/css/bootstrap.min.css',
|
||||||
|
configPropertyName: 'css_hash'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
file: 'dist/js/bootstrap.min.js',
|
||||||
|
configPropertyName: 'js_hash'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
file: 'dist/js/bootstrap.bundle.min.js',
|
||||||
|
configPropertyName: 'js_bundle_hash'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
file: `site/docs/${pkg.version_short}/assets/js/vendor/jquery.slim.min.js`,
|
||||||
|
configPropertyName: 'jquery_hash'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
file: 'node_modules/popper.js/dist/umd/popper.min.js',
|
||||||
|
configPropertyName: 'popper_hash'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
files.forEach((file) => {
|
||||||
|
fs.readFile(file.file, 'utf8', (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
|
||||||
|
const algo = 'sha384'
|
||||||
|
const hash = crypto.createHash(algo).update(data, 'utf8').digest('base64')
|
||||||
|
const integrity = `${algo}-${hash}`
|
||||||
|
|
||||||
|
console.log(`${file.configPropertyName}: ${integrity}`)
|
||||||
|
|
||||||
|
sh.sed('-i', new RegExp(`(\\s${file.configPropertyName}:\\s+"|')(\\S+)("|')`), `$1${integrity}$3`, configFile)
|
||||||
|
})
|
||||||
|
})
|
14
assets/bootstrap-4.5.2/build/postcss.config.js
vendored
Normal file
14
assets/bootstrap-4.5.2/build/postcss.config.js
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
|
module.exports = (ctx) => ({
|
||||||
|
map: ctx.file.dirname.includes('examples') ? false : {
|
||||||
|
inline: false,
|
||||||
|
annotation: true,
|
||||||
|
sourcesContent: true
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
autoprefixer: {
|
||||||
|
cascade: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
44
assets/bootstrap-4.5.2/build/rollup.config.js
vendored
Normal file
44
assets/bootstrap-4.5.2/build/rollup.config.js
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
|
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'
|
||||||
|
|
||||||
|
let fileDest = 'bootstrap.js'
|
||||||
|
const external = ['jquery', 'popper.js']
|
||||||
|
const plugins = [
|
||||||
|
babel({
|
||||||
|
// Only transpile our source code
|
||||||
|
exclude: 'node_modules/**',
|
||||||
|
// Include the helpers in the bundle, at most one copy of each
|
||||||
|
babelHelpers: 'bundled'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
const globals = {
|
||||||
|
jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
|
||||||
|
'popper.js': 'Popper'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BUNDLE) {
|
||||||
|
fileDest = 'bootstrap.bundle.js'
|
||||||
|
// Remove last entry in external array to bundle Popper
|
||||||
|
external.pop()
|
||||||
|
delete globals['popper.js']
|
||||||
|
plugins.push(nodeResolve())
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
input: path.resolve(__dirname, '../js/src/index.js'),
|
||||||
|
output: {
|
||||||
|
banner,
|
||||||
|
file: path.resolve(__dirname, `../dist/js/${fileDest}`),
|
||||||
|
format: 'umd',
|
||||||
|
globals,
|
||||||
|
name: 'bootstrap'
|
||||||
|
},
|
||||||
|
external,
|
||||||
|
plugins
|
||||||
|
}
|
55
assets/bootstrap-4.5.2/build/ship.sh
Normal file
55
assets/bootstrap-4.5.2/build/ship.sh
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#!/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"
|
60
assets/bootstrap-4.5.2/build/svgo.yml
Normal file
60
assets/bootstrap-4.5.2/build/svgo.yml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
# 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
|
65
assets/bootstrap-4.5.2/build/vnu-jar.js
vendored
Normal file
65
assets/bootstrap-4.5.2/build/vnu-jar.js
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 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/main/LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const childProcess = require('child_process')
|
||||||
|
const vnu = require('vnu-jar')
|
||||||
|
|
||||||
|
childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||||
|
if (error) {
|
||||||
|
console.error('Skipping vnu-jar test; Java is missing.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const is32bitJava = !/64-Bit/.test(stderr)
|
||||||
|
|
||||||
|
// vnu-jar accepts multiple ignores joined with a `|`.
|
||||||
|
// Also note that the ignores are 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”.'
|
||||||
|
].join('|')
|
||||||
|
|
||||||
|
const args = [
|
||||||
|
'-jar',
|
||||||
|
vnu,
|
||||||
|
'--asciiquotes',
|
||||||
|
'--skip-non-html',
|
||||||
|
// Ignore the language code warnings
|
||||||
|
'--no-langdetect',
|
||||||
|
'--Werror',
|
||||||
|
`--filterpattern "${ignores}"`,
|
||||||
|
'_gh_pages/',
|
||||||
|
'js/tests/'
|
||||||
|
]
|
||||||
|
|
||||||
|
// For the 32-bit Java we need to pass `-Xss512k`
|
||||||
|
if (is32bitJava) {
|
||||||
|
args.splice(0, 0, '-Xss512k')
|
||||||
|
}
|
||||||
|
|
||||||
|
return childProcess.spawn('java', args, {
|
||||||
|
shell: true,
|
||||||
|
stdio: 'inherit'
|
||||||
|
})
|
||||||
|
.on('exit', process.exit)
|
||||||
|
})
|
63
assets/bootstrap-4.5.2/build/zip-examples.js
vendored
Normal file
63
assets/bootstrap-4.5.2/build/zip-examples.js
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Script to create the built examples zip archive;
|
||||||
|
* requires the `zip` command to be present!
|
||||||
|
* Copyright 2020 The Bootstrap Authors
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const path = require('path')
|
||||||
|
const sh = require('shelljs')
|
||||||
|
|
||||||
|
const {
|
||||||
|
version, version_short: versionShort
|
||||||
|
} = require('../package.json')
|
||||||
|
|
||||||
|
const folderName = `bootstrap-${version}-examples`
|
||||||
|
|
||||||
|
sh.config.fatal = true
|
||||||
|
|
||||||
|
if (!sh.test('-d', '_gh_pages')) {
|
||||||
|
throw new Error('The "_gh_pages" folder does not exist, did you forget building the docs?')
|
||||||
|
}
|
||||||
|
|
||||||
|
// switch to the root dir
|
||||||
|
sh.cd(path.join(__dirname, '..'))
|
||||||
|
|
||||||
|
// remove any previously created folder with the same name
|
||||||
|
sh.rm('-rf', folderName)
|
||||||
|
// create any folders so that `cp` works
|
||||||
|
sh.mkdir('-p', folderName)
|
||||||
|
sh.mkdir('-p', `${folderName}/assets/brand/`)
|
||||||
|
|
||||||
|
sh.cp('-Rf', `_gh_pages/docs/${versionShort}/examples/*`, folderName)
|
||||||
|
sh.cp('-Rf', `_gh_pages/docs/${versionShort}/dist/`, `${folderName}/assets/`)
|
||||||
|
// also copy the two brand images we use in the examples
|
||||||
|
sh.cp('-f', [
|
||||||
|
`_gh_pages/docs/${versionShort}/assets/brand/bootstrap-outline.svg`,
|
||||||
|
`_gh_pages/docs/${versionShort}/assets/brand/bootstrap-solid.svg`
|
||||||
|
], `${folderName}/assets/brand/`)
|
||||||
|
sh.rm(`${folderName}/index.html`)
|
||||||
|
|
||||||
|
// get all examples' HTML files
|
||||||
|
sh.find(`${folderName}/**/*.html`).forEach((file) => {
|
||||||
|
const fileContents = sh.cat(file)
|
||||||
|
.toString()
|
||||||
|
.replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../')
|
||||||
|
.replace(/"..\/dist\//g, '"../assets/dist/')
|
||||||
|
.replace(/(<link href="\.\.\/.*) integrity=".*>/g, '$1>')
|
||||||
|
.replace(/(<script src="\.\.\/.*) integrity=".*>/g, '$1></script>')
|
||||||
|
.replace(/( +)<!-- favicons(.|\n)+<style>/i, ' <style>')
|
||||||
|
new sh.ShellString(fileContents).to(file)
|
||||||
|
})
|
||||||
|
|
||||||
|
// create the zip file
|
||||||
|
sh.exec(`zip -r9 "${folderName}.zip" "${folderName}"`, {
|
||||||
|
fatal: true
|
||||||
|
})
|
||||||
|
|
||||||
|
// remove the folder we created
|
||||||
|
sh.rm('-rf', folderName)
|
37
assets/bootstrap-4.5.2/composer.json
Normal file
37
assets/bootstrap-4.5.2/composer.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"name": "twbs/bootstrap",
|
||||||
|
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
|
||||||
|
"keywords": [
|
||||||
|
"css",
|
||||||
|
"js",
|
||||||
|
"sass",
|
||||||
|
"mobile-first",
|
||||||
|
"responsive",
|
||||||
|
"front-end",
|
||||||
|
"framework",
|
||||||
|
"web"
|
||||||
|
],
|
||||||
|
"homepage": "https://getbootstrap.com/",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Mark Otto",
|
||||||
|
"email": "markdotto@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jacob Thornton",
|
||||||
|
"email": "jacobthornton@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/twbs/bootstrap/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "3.3.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"replace": {
|
||||||
|
"twitter/bootstrap": "self.version"
|
||||||
|
}
|
||||||
|
}
|
3872
assets/bootstrap-4.5.2/dist/css/bootstrap-grid.css
vendored
Normal file
3872
assets/bootstrap-4.5.2/dist/css/bootstrap-grid.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap-grid.css.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap-grid.css.map
vendored
Normal file
Binary file not shown.
7
assets/bootstrap-4.5.2/dist/css/bootstrap-grid.min.css
vendored
Normal file
7
assets/bootstrap-4.5.2/dist/css/bootstrap-grid.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap-grid.min.css.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap-grid.min.css.map
vendored
Normal file
Binary file not shown.
325
assets/bootstrap-4.5.2/dist/css/bootstrap-reboot.css
vendored
Normal file
325
assets/bootstrap-4.5.2/dist/css/bootstrap-reboot.css
vendored
Normal file
@ -0,0 +1,325 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap Reboot v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors
|
||||||
|
* Copyright 2011-2020 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||||
|
*/
|
||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: sans-serif;
|
||||||
|
line-height: 1.15;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
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: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
abbr[title],
|
||||||
|
abbr[data-original-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;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol,
|
||||||
|
ul,
|
||||||
|
dl {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol ol,
|
||||||
|
ul ul,
|
||||||
|
ol ul,
|
||||||
|
ul ol {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre,
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
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: 0.75rem;
|
||||||
|
padding-bottom: 0.75rem;
|
||||||
|
color: #6c757d;
|
||||||
|
text-align: left;
|
||||||
|
caption-side: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
text-align: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:focus {
|
||||||
|
outline: 1px dotted;
|
||||||
|
outline: 5px auto -webkit-focus-ring-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
button,
|
||||||
|
select,
|
||||||
|
optgroup,
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
[type="button"],
|
||||||
|
[type="reset"],
|
||||||
|
[type="submit"] {
|
||||||
|
-webkit-appearance: button;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:not(:disabled),
|
||||||
|
[type="button"]:not(:disabled),
|
||||||
|
[type="reset"]:not(:disabled),
|
||||||
|
[type="submit"]:not(:disabled) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
[type="button"]::-moz-focus-inner,
|
||||||
|
[type="reset"]::-moz-focus-inner,
|
||||||
|
[type="submit"]::-moz-focus-inner {
|
||||||
|
padding: 0;
|
||||||
|
border-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="radio"],
|
||||||
|
input[type="checkbox"] {
|
||||||
|
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.css.map */
|
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap-reboot.css.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap-reboot.css.map
vendored
Normal file
Binary file not shown.
8
assets/bootstrap-4.5.2/dist/css/bootstrap-reboot.min.css
vendored
Normal file
8
assets/bootstrap-4.5.2/dist/css/bootstrap-reboot.min.css
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap Reboot v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors
|
||||||
|
* Copyright 2011-2020 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||||
|
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([class]){color:inherit;text-decoration:none}a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
|
||||||
|
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap-reboot.min.css.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap-reboot.min.css.map
vendored
Normal file
Binary file not shown.
10259
assets/bootstrap-4.5.2/dist/css/bootstrap.css
Normal file
10259
assets/bootstrap-4.5.2/dist/css/bootstrap.css
Normal file
File diff suppressed because it is too large
Load Diff
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap.css.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap.css.map
vendored
Normal file
Binary file not shown.
7
assets/bootstrap-4.5.2/dist/css/bootstrap.min.css
vendored
Normal file
7
assets/bootstrap-4.5.2/dist/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap.min.css.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/css/bootstrap.min.css.map
vendored
Normal file
Binary file not shown.
7023
assets/bootstrap-4.5.2/dist/js/bootstrap.bundle.js
vendored
Normal file
7023
assets/bootstrap-4.5.2/dist/js/bootstrap.bundle.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
assets/bootstrap-4.5.2/dist/js/bootstrap.bundle.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/js/bootstrap.bundle.js.map
vendored
Normal file
Binary file not shown.
7
assets/bootstrap-4.5.2/dist/js/bootstrap.bundle.min.js
vendored
Normal file
7
assets/bootstrap-4.5.2/dist/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
assets/bootstrap-4.5.2/dist/js/bootstrap.bundle.min.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/js/bootstrap.bundle.min.js.map
vendored
Normal file
Binary file not shown.
4410
assets/bootstrap-4.5.2/dist/js/bootstrap.js
Normal file
4410
assets/bootstrap-4.5.2/dist/js/bootstrap.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
assets/bootstrap-4.5.2/dist/js/bootstrap.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/js/bootstrap.js.map
vendored
Normal file
Binary file not shown.
7
assets/bootstrap-4.5.2/dist/js/bootstrap.min.js
vendored
Normal file
7
assets/bootstrap-4.5.2/dist/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
assets/bootstrap-4.5.2/dist/js/bootstrap.min.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/dist/js/bootstrap.min.js.map
vendored
Normal file
Binary file not shown.
177
assets/bootstrap-4.5.2/js/dist/alert.js
vendored
Normal file
177
assets/bootstrap-4.5.2/js/dist/alert.js
vendored
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap alert.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
|
(global = 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 _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'alert';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.alert';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var DATA_API_KEY = '.data-api';
|
||||||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||||
|
var SELECTOR_DISMISS = '[data-dismiss="alert"]';
|
||||||
|
var EVENT_CLOSE = "close" + EVENT_KEY;
|
||||||
|
var EVENT_CLOSED = "closed" + EVENT_KEY;
|
||||||
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var CLASS_NAME_ALERT = 'alert';
|
||||||
|
var CLASS_NAME_FADE = 'fade';
|
||||||
|
var CLASS_NAME_SHOW = 'show';
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Alert = /*#__PURE__*/function () {
|
||||||
|
function Alert(element) {
|
||||||
|
this._element = element;
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Alert.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.close = function close(element) {
|
||||||
|
var rootElement = this._element;
|
||||||
|
|
||||||
|
if (element) {
|
||||||
|
rootElement = this._getRootElement(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
var customEvent = this._triggerCloseEvent(rootElement);
|
||||||
|
|
||||||
|
if (customEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._removeElement(rootElement);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
this._element = null;
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._getRootElement = function _getRootElement(element) {
|
||||||
|
var selector = Util.getSelectorFromElement(element);
|
||||||
|
var parent = false;
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
parent = document.querySelector(selector);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!parent) {
|
||||||
|
parent = $(element).closest("." + CLASS_NAME_ALERT)[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._triggerCloseEvent = function _triggerCloseEvent(element) {
|
||||||
|
var closeEvent = $.Event(EVENT_CLOSE);
|
||||||
|
$(element).trigger(closeEvent);
|
||||||
|
return closeEvent;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._removeElement = function _removeElement(element) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
$(element).removeClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
|
if (!$(element).hasClass(CLASS_NAME_FADE)) {
|
||||||
|
this._destroyElement(element);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var transitionDuration = Util.getTransitionDurationFromElement(element);
|
||||||
|
$(element).one(Util.TRANSITION_END, function (event) {
|
||||||
|
return _this._destroyElement(element, event);
|
||||||
|
}).emulateTransitionEnd(transitionDuration);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._destroyElement = function _destroyElement(element) {
|
||||||
|
$(element).detach().trigger(EVENT_CLOSED).remove();
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Alert._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $element = $(this);
|
||||||
|
var data = $element.data(DATA_KEY);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Alert(this);
|
||||||
|
$element.data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config === 'close') {
|
||||||
|
data[config](this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Alert._handleDismiss = function _handleDismiss(alertInstance) {
|
||||||
|
return function (event) {
|
||||||
|
if (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
alertInstance.close(this);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Alert, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Alert;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Alert._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Alert;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Alert._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Alert;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=alert.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/alert.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/alert.js.map
vendored
Normal file
Binary file not shown.
213
assets/bootstrap-4.5.2/js/dist/button.js
vendored
Normal file
213
assets/bootstrap-4.5.2/js/dist/button.js
vendored
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap button.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
||||||
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.jQuery));
|
||||||
|
}(this, (function ($) { 'use strict';
|
||||||
|
|
||||||
|
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'button';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.button';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var DATA_API_KEY = '.data-api';
|
||||||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||||
|
var CLASS_NAME_ACTIVE = 'active';
|
||||||
|
var CLASS_NAME_BUTTON = 'btn';
|
||||||
|
var CLASS_NAME_FOCUS = 'focus';
|
||||||
|
var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
|
||||||
|
var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
|
||||||
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
|
||||||
|
var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
|
||||||
|
var SELECTOR_INPUT = 'input:not([type="hidden"])';
|
||||||
|
var SELECTOR_ACTIVE = '.active';
|
||||||
|
var SELECTOR_BUTTON = '.btn';
|
||||||
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY);
|
||||||
|
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Button = /*#__PURE__*/function () {
|
||||||
|
function Button(element) {
|
||||||
|
this._element = element;
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Button.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.toggle = function toggle() {
|
||||||
|
var triggerChangeEvent = true;
|
||||||
|
var addAriaPressed = true;
|
||||||
|
var rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0];
|
||||||
|
|
||||||
|
if (rootElement) {
|
||||||
|
var input = this._element.querySelector(SELECTOR_INPUT);
|
||||||
|
|
||||||
|
if (input) {
|
||||||
|
if (input.type === 'radio') {
|
||||||
|
if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
||||||
|
triggerChangeEvent = false;
|
||||||
|
} else {
|
||||||
|
var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
|
||||||
|
|
||||||
|
if (activeElement) {
|
||||||
|
$(activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triggerChangeEvent) {
|
||||||
|
// if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
|
||||||
|
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||||
|
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(input).trigger('change');
|
||||||
|
}
|
||||||
|
|
||||||
|
input.focus();
|
||||||
|
addAriaPressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
|
||||||
|
if (addAriaPressed) {
|
||||||
|
this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triggerChangeEvent) {
|
||||||
|
$(this._element).toggleClass(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
this._element = null;
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Button._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Button(this);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config === 'toggle') {
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Button, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Button;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(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 (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
|
||||||
|
event.preventDefault(); // work around Firefox bug #1540995
|
||||||
|
} else {
|
||||||
|
var inputBtn = button.querySelector(SELECTOR_INPUT);
|
||||||
|
|
||||||
|
if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
|
||||||
|
event.preventDefault(); // work around Firefox bug #1540995
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (initialButton.tagName !== 'LABEL' || inputBtn && inputBtn.type !== 'checkbox') {
|
||||||
|
Button._jQueryInterface.call($(button), 'toggle');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
|
||||||
|
var button = $(event.target).closest(SELECTOR_BUTTON)[0];
|
||||||
|
$(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
|
||||||
|
});
|
||||||
|
$(window).on(EVENT_LOAD_DATA_API, function () {
|
||||||
|
// ensure correct active class is set to match the controls' actual values/states
|
||||||
|
// find all checkboxes/readio buttons inside data-toggle groups
|
||||||
|
var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
|
||||||
|
|
||||||
|
for (var i = 0, len = buttons.length; i < len; i++) {
|
||||||
|
var button = buttons[i];
|
||||||
|
var input = button.querySelector(SELECTOR_INPUT);
|
||||||
|
|
||||||
|
if (input.checked || input.hasAttribute('checked')) {
|
||||||
|
button.classList.add(CLASS_NAME_ACTIVE);
|
||||||
|
} else {
|
||||||
|
button.classList.remove(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
} // find all button toggles
|
||||||
|
|
||||||
|
|
||||||
|
buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||||
|
|
||||||
|
for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
|
||||||
|
var _button = buttons[_i];
|
||||||
|
|
||||||
|
if (_button.getAttribute('aria-pressed') === 'true') {
|
||||||
|
_button.classList.add(CLASS_NAME_ACTIVE);
|
||||||
|
} else {
|
||||||
|
_button.classList.remove(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Button._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Button;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Button._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Button;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=button.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/button.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/button.js.map
vendored
Normal file
Binary file not shown.
610
assets/bootstrap-4.5.2/js/dist/carousel.js
vendored
Normal file
610
assets/bootstrap-4.5.2/js/dist/carousel.js
vendored
Normal file
@ -0,0 +1,610 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap carousel.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
|
(global = 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 _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'carousel';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.carousel';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var DATA_API_KEY = '.data-api';
|
||||||
|
var JQUERY_NO_CONFLICT = $.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
|
||||||
|
|
||||||
|
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 DIRECTION_NEXT = 'next';
|
||||||
|
var DIRECTION_PREV = 'prev';
|
||||||
|
var DIRECTION_LEFT = 'left';
|
||||||
|
var DIRECTION_RIGHT = 'right';
|
||||||
|
var EVENT_SLIDE = "slide" + EVENT_KEY;
|
||||||
|
var EVENT_SLID = "slid" + EVENT_KEY;
|
||||||
|
var EVENT_KEYDOWN = "keydown" + EVENT_KEY;
|
||||||
|
var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY;
|
||||||
|
var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY;
|
||||||
|
var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY;
|
||||||
|
var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY;
|
||||||
|
var EVENT_TOUCHEND = "touchend" + EVENT_KEY;
|
||||||
|
var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY;
|
||||||
|
var EVENT_POINTERUP = "pointerup" + EVENT_KEY;
|
||||||
|
var EVENT_DRAG_START = "dragstart" + EVENT_KEY;
|
||||||
|
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var CLASS_NAME_CAROUSEL = 'carousel';
|
||||||
|
var CLASS_NAME_ACTIVE = 'active';
|
||||||
|
var CLASS_NAME_SLIDE = 'slide';
|
||||||
|
var CLASS_NAME_RIGHT = 'carousel-item-right';
|
||||||
|
var CLASS_NAME_LEFT = 'carousel-item-left';
|
||||||
|
var CLASS_NAME_NEXT = 'carousel-item-next';
|
||||||
|
var CLASS_NAME_PREV = 'carousel-item-prev';
|
||||||
|
var CLASS_NAME_POINTER_EVENT = 'pointer-event';
|
||||||
|
var SELECTOR_ACTIVE = '.active';
|
||||||
|
var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
|
||||||
|
var SELECTOR_ITEM = '.carousel-item';
|
||||||
|
var SELECTOR_ITEM_IMG = '.carousel-item img';
|
||||||
|
var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
|
||||||
|
var SELECTOR_INDICATORS = '.carousel-indicators';
|
||||||
|
var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
|
||||||
|
var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
|
||||||
|
var PointerType = {
|
||||||
|
TOUCH: 'touch',
|
||||||
|
PEN: 'pen'
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Carousel = /*#__PURE__*/function () {
|
||||||
|
function Carousel(element, config) {
|
||||||
|
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._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._addEventListeners();
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Carousel.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.next = function next() {
|
||||||
|
if (!this._isSliding) {
|
||||||
|
this._slide(DIRECTION_NEXT);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.nextWhenVisible = function nextWhenVisible() {
|
||||||
|
// 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') {
|
||||||
|
this.next();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.prev = function prev() {
|
||||||
|
if (!this._isSliding) {
|
||||||
|
this._slide(DIRECTION_PREV);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.pause = function pause(event) {
|
||||||
|
if (!event) {
|
||||||
|
this._isPaused = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
|
||||||
|
Util.triggerTransitionEnd(this._element);
|
||||||
|
this.cycle(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
clearInterval(this._interval);
|
||||||
|
this._interval = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.cycle = function cycle(event) {
|
||||||
|
if (!event) {
|
||||||
|
this._isPaused = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._interval) {
|
||||||
|
clearInterval(this._interval);
|
||||||
|
this._interval = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._config.interval && !this._isPaused) {
|
||||||
|
this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.to = function to(index) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
|
||||||
|
|
||||||
|
var activeIndex = this._getItemIndex(this._activeElement);
|
||||||
|
|
||||||
|
if (index > this._items.length - 1 || index < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._isSliding) {
|
||||||
|
$(this._element).one(EVENT_SLID, function () {
|
||||||
|
return _this.to(index);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (activeIndex === index) {
|
||||||
|
this.pause();
|
||||||
|
this.cycle();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
|
||||||
|
|
||||||
|
this._slide(direction, this._items[index]);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
$(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._indicatorsElement = null;
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._getConfig = function _getConfig(config) {
|
||||||
|
config = _extends({}, Default, config);
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._handleSwipe = function _handleSwipe() {
|
||||||
|
var absDeltax = Math.abs(this.touchDeltaX);
|
||||||
|
|
||||||
|
if (absDeltax <= SWIPE_THRESHOLD) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var direction = absDeltax / this.touchDeltaX;
|
||||||
|
this.touchDeltaX = 0; // swipe left
|
||||||
|
|
||||||
|
if (direction > 0) {
|
||||||
|
this.prev();
|
||||||
|
} // swipe right
|
||||||
|
|
||||||
|
|
||||||
|
if (direction < 0) {
|
||||||
|
this.next();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._addEventListeners = function _addEventListeners() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
if (this._config.keyboard) {
|
||||||
|
$(this._element).on(EVENT_KEYDOWN, function (event) {
|
||||||
|
return _this2._keydown(event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._config.pause === 'hover') {
|
||||||
|
$(this._element).on(EVENT_MOUSEENTER, function (event) {
|
||||||
|
return _this2.pause(event);
|
||||||
|
}).on(EVENT_MOUSELEAVE, function (event) {
|
||||||
|
return _this2.cycle(event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._config.touch) {
|
||||||
|
this._addTouchEventListeners();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._addTouchEventListeners = function _addTouchEventListeners() {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
if (!this._touchSupported) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var start = function start(event) {
|
||||||
|
if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||||
|
_this3.touchStartX = event.originalEvent.clientX;
|
||||||
|
} else if (!_this3._pointerEvent) {
|
||||||
|
_this3.touchStartX = event.originalEvent.touches[0].clientX;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var end = function end(event) {
|
||||||
|
if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||||
|
_this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
|
||||||
|
}
|
||||||
|
|
||||||
|
_this3._handleSwipe();
|
||||||
|
|
||||||
|
if (_this3._config.pause === 'hover') {
|
||||||
|
// If it's a touch-enabled device, mouseenter/leave are fired as
|
||||||
|
// part of the mouse compatibility events on first tap - the carousel
|
||||||
|
// would stop cycling until user tapped out of it;
|
||||||
|
// here, we listen for touchend, explicitly pause the carousel
|
||||||
|
// (as if it's the second time we tap on it, mouseenter compat event
|
||||||
|
// is NOT fired) and after a timeout (to allow for mouse compatibility
|
||||||
|
// events to fire) we explicitly restart cycling
|
||||||
|
_this3.pause();
|
||||||
|
|
||||||
|
if (_this3.touchTimeout) {
|
||||||
|
clearTimeout(_this3.touchTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
_this3.touchTimeout = setTimeout(function (event) {
|
||||||
|
return _this3.cycle(event);
|
||||||
|
}, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(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) {
|
||||||
|
return start(event);
|
||||||
|
});
|
||||||
|
$(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) {
|
||||||
|
return start(event);
|
||||||
|
});
|
||||||
|
$(this._element).on(EVENT_TOUCHMOVE, function (event) {
|
||||||
|
return move(event);
|
||||||
|
});
|
||||||
|
$(this._element).on(EVENT_TOUCHEND, function (event) {
|
||||||
|
return end(event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._keydown = function _keydown(event) {
|
||||||
|
if (/input|textarea/i.test(event.target.tagName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (event.which) {
|
||||||
|
case ARROW_LEFT_KEYCODE:
|
||||||
|
event.preventDefault();
|
||||||
|
this.prev();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ARROW_RIGHT_KEYCODE:
|
||||||
|
event.preventDefault();
|
||||||
|
this.next();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getItemIndex = function _getItemIndex(element) {
|
||||||
|
this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];
|
||||||
|
return this._items.indexOf(element);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
|
||||||
|
var isNextDirection = direction === DIRECTION_NEXT;
|
||||||
|
var isPrevDirection = direction === DIRECTION_PREV;
|
||||||
|
|
||||||
|
var activeIndex = this._getItemIndex(activeElement);
|
||||||
|
|
||||||
|
var lastItemIndex = this._items.length - 1;
|
||||||
|
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
|
||||||
|
|
||||||
|
if (isGoingToWrap && !this._config.wrap) {
|
||||||
|
return activeElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
var delta = direction === DIRECTION_PREV ? -1 : 1;
|
||||||
|
var itemIndex = (activeIndex + delta) % this._items.length;
|
||||||
|
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||||
|
var targetIndex = this._getItemIndex(relatedTarget);
|
||||||
|
|
||||||
|
var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
|
||||||
|
|
||||||
|
var slideEvent = $.Event(EVENT_SLIDE, {
|
||||||
|
relatedTarget: relatedTarget,
|
||||||
|
direction: eventDirectionName,
|
||||||
|
from: fromIndex,
|
||||||
|
to: targetIndex
|
||||||
|
});
|
||||||
|
$(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);
|
||||||
|
|
||||||
|
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
||||||
|
|
||||||
|
if (nextIndicator) {
|
||||||
|
$(nextIndicator).addClass(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._slide = function _slide(direction, element) {
|
||||||
|
var _this4 = this;
|
||||||
|
|
||||||
|
var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
|
||||||
|
|
||||||
|
var activeElementIndex = this._getItemIndex(activeElement);
|
||||||
|
|
||||||
|
var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
|
||||||
|
|
||||||
|
var nextElementIndex = this._getItemIndex(nextElement);
|
||||||
|
|
||||||
|
var isCycling = Boolean(this._interval);
|
||||||
|
var directionalClassName;
|
||||||
|
var orderClassName;
|
||||||
|
var eventDirectionName;
|
||||||
|
|
||||||
|
if (direction === DIRECTION_NEXT) {
|
||||||
|
directionalClassName = CLASS_NAME_LEFT;
|
||||||
|
orderClassName = CLASS_NAME_NEXT;
|
||||||
|
eventDirectionName = DIRECTION_LEFT;
|
||||||
|
} else {
|
||||||
|
directionalClassName = CLASS_NAME_RIGHT;
|
||||||
|
orderClassName = CLASS_NAME_PREV;
|
||||||
|
eventDirectionName = DIRECTION_RIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE)) {
|
||||||
|
this._isSliding = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
|
||||||
|
|
||||||
|
if (slideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!activeElement || !nextElement) {
|
||||||
|
// Some weirdness is happening, so we bail
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isSliding = true;
|
||||||
|
|
||||||
|
if (isCycling) {
|
||||||
|
this.pause();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._setActiveIndicatorElement(nextElement);
|
||||||
|
|
||||||
|
var slidEvent = $.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);
|
||||||
|
_this4._isSliding = false;
|
||||||
|
setTimeout(function () {
|
||||||
|
return $(_this4._element).trigger(slidEvent);
|
||||||
|
}, 0);
|
||||||
|
}).emulateTransitionEnd(transitionDuration);
|
||||||
|
} else {
|
||||||
|
$(activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||||
|
$(nextElement).addClass(CLASS_NAME_ACTIVE);
|
||||||
|
this._isSliding = false;
|
||||||
|
$(this._element).trigger(slidEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isCycling) {
|
||||||
|
this.cycle();
|
||||||
|
}
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Carousel._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
var _config = _extends({}, Default, $(this).data());
|
||||||
|
|
||||||
|
if (typeof config === 'object') {
|
||||||
|
_config = _extends({}, _config, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
var action = typeof config === 'string' ? config : _config.slide;
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Carousel(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'number') {
|
||||||
|
data.to(config);
|
||||||
|
} else if (typeof action === 'string') {
|
||||||
|
if (typeof data[action] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + action + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[action]();
|
||||||
|
} else if (_config.interval && _config.ride) {
|
||||||
|
data.pause();
|
||||||
|
data.cycle();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
|
||||||
|
var selector = Util.getSelectorFromElement(this);
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var target = $(selector)[0];
|
||||||
|
|
||||||
|
if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var config = _extends({}, $(target).data(), $(this).data());
|
||||||
|
|
||||||
|
var slideIndex = this.getAttribute('data-slide-to');
|
||||||
|
|
||||||
|
if (slideIndex) {
|
||||||
|
config.interval = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel._jQueryInterface.call($(target), config);
|
||||||
|
|
||||||
|
if (slideIndex) {
|
||||||
|
$(target).data(DATA_KEY).to(slideIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Carousel, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Default",
|
||||||
|
get: function get() {
|
||||||
|
return Default;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Carousel;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
|
||||||
|
$(window).on(EVENT_LOAD_DATA_API, function () {
|
||||||
|
var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));
|
||||||
|
|
||||||
|
for (var i = 0, len = carousels.length; i < len; i++) {
|
||||||
|
var $carousel = $(carousels[i]);
|
||||||
|
|
||||||
|
Carousel._jQueryInterface.call($carousel, $carousel.data());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Carousel._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Carousel;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Carousel._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Carousel;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=carousel.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/carousel.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/carousel.js.map
vendored
Normal file
Binary file not shown.
372
assets/bootstrap-4.5.2/js/dist/collapse.js
vendored
Normal file
372
assets/bootstrap-4.5.2/js/dist/collapse.js
vendored
Normal file
@ -0,0 +1,372 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap collapse.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
|
(global = 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 _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'collapse';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.collapse';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var DATA_API_KEY = '.data-api';
|
||||||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||||
|
var Default = {
|
||||||
|
toggle: true,
|
||||||
|
parent: ''
|
||||||
|
};
|
||||||
|
var DefaultType = {
|
||||||
|
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
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Collapse = /*#__PURE__*/function () {
|
||||||
|
function Collapse(element, config) {
|
||||||
|
this._isTransitioning = false;
|
||||||
|
this._element = element;
|
||||||
|
this._config = this._getConfig(config);
|
||||||
|
this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
|
||||||
|
var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||||
|
|
||||||
|
for (var i = 0, len = toggleList.length; i < len; i++) {
|
||||||
|
var elem = toggleList[i];
|
||||||
|
var selector = Util.getSelectorFromElement(elem);
|
||||||
|
var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
|
||||||
|
return foundElem === element;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (selector !== null && filterElement.length > 0) {
|
||||||
|
this._selector = selector;
|
||||||
|
|
||||||
|
this._triggerArray.push(elem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this._parent = this._config.parent ? this._getParent() : null;
|
||||||
|
|
||||||
|
if (!this._config.parent) {
|
||||||
|
this._addAriaAndCollapsedClass(this._element, this._triggerArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._config.toggle) {
|
||||||
|
this.toggle();
|
||||||
|
}
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Collapse.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.toggle = function toggle() {
|
||||||
|
if ($(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
this.hide();
|
||||||
|
} else {
|
||||||
|
this.show();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.show = function show() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
if (this._isTransitioning || $(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var actives;
|
||||||
|
var activesData;
|
||||||
|
|
||||||
|
if (this._parent) {
|
||||||
|
actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {
|
||||||
|
if (typeof _this._config.parent === 'string') {
|
||||||
|
return elem.getAttribute('data-parent') === _this._config.parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (actives.length === 0) {
|
||||||
|
actives = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actives) {
|
||||||
|
activesData = $(actives).not(this._selector).data(DATA_KEY);
|
||||||
|
|
||||||
|
if (activesData && activesData._isTransitioning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var startEvent = $.Event(EVENT_SHOW);
|
||||||
|
$(this._element).trigger(startEvent);
|
||||||
|
|
||||||
|
if (startEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actives) {
|
||||||
|
Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
|
||||||
|
|
||||||
|
if (!activesData) {
|
||||||
|
$(actives).data(DATA_KEY, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var dimension = this._getDimension();
|
||||||
|
|
||||||
|
$(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);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setTransitioning(true);
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
$(_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);
|
||||||
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
this._element.style[dimension] = this._element[scrollSize] + "px";
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.hide = function hide() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
if (this._isTransitioning || !$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var startEvent = $.Event(EVENT_HIDE);
|
||||||
|
$(this._element).trigger(startEvent);
|
||||||
|
|
||||||
|
if (startEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
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);
|
||||||
|
|
||||||
|
if (selector !== null) {
|
||||||
|
var $elem = $([].slice.call(document.querySelectorAll(selector)));
|
||||||
|
|
||||||
|
if (!$elem.hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
$(trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setTransitioning(true);
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
_this2.setTransitioning(false);
|
||||||
|
|
||||||
|
$(_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);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.setTransitioning = function setTransitioning(isTransitioning) {
|
||||||
|
this._isTransitioning = isTransitioning;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
this._config = null;
|
||||||
|
this._parent = null;
|
||||||
|
this._element = null;
|
||||||
|
this._triggerArray = null;
|
||||||
|
this._isTransitioning = null;
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._getConfig = function _getConfig(config) {
|
||||||
|
config = _extends({}, Default, config);
|
||||||
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
||||||
|
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getDimension = function _getDimension() {
|
||||||
|
var hasWidth = $(this._element).hasClass(DIMENSION_WIDTH);
|
||||||
|
return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getParent = function _getParent() {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
var parent;
|
||||||
|
|
||||||
|
if (Util.isElement(this._config.parent)) {
|
||||||
|
parent = this._config.parent; // It's a jQuery object
|
||||||
|
|
||||||
|
if (typeof this._config.parent.jquery !== 'undefined') {
|
||||||
|
parent = this._config.parent[0];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
parent = document.querySelector(this._config.parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
|
||||||
|
var children = [].slice.call(parent.querySelectorAll(selector));
|
||||||
|
$(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);
|
||||||
|
|
||||||
|
if (triggerArray.length) {
|
||||||
|
$(triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||||
|
}
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
|
||||||
|
var selector = Util.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 _config = _extends({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
|
||||||
|
|
||||||
|
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||||
|
_config.toggle = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Collapse(this, _config);
|
||||||
|
$this.data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + config + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Collapse, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Default",
|
||||||
|
get: function get() {
|
||||||
|
return Default;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Collapse;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(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 selectors = [].slice.call(document.querySelectorAll(selector));
|
||||||
|
$(selectors).each(function () {
|
||||||
|
var $target = $(this);
|
||||||
|
var data = $target.data(DATA_KEY);
|
||||||
|
var config = data ? 'toggle' : $trigger.data();
|
||||||
|
|
||||||
|
Collapse._jQueryInterface.call($target, config);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Collapse._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Collapse;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Collapse._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Collapse;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=collapse.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/collapse.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/collapse.js.map
vendored
Normal file
Binary file not shown.
538
assets/bootstrap-4.5.2/js/dist/dropdown.js
vendored
Normal file
538
assets/bootstrap-4.5.2/js/dist/dropdown.js
vendored
Normal file
@ -0,0 +1,538 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap dropdown.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
|
||||||
|
(global = 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 _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'dropdown';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.dropdown';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var DATA_API_KEY = '.data-api';
|
||||||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||||
|
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
||||||
|
|
||||||
|
var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
|
||||||
|
|
||||||
|
var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
|
||||||
|
|
||||||
|
var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
|
||||||
|
|
||||||
|
var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
|
||||||
|
|
||||||
|
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
||||||
|
|
||||||
|
var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
|
||||||
|
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||||
|
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||||
|
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||||
|
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||||
|
var EVENT_CLICK = "click" + EVENT_KEY;
|
||||||
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var CLASS_NAME_DISABLED = 'disabled';
|
||||||
|
var CLASS_NAME_SHOW = 'show';
|
||||||
|
var CLASS_NAME_DROPUP = 'dropup';
|
||||||
|
var CLASS_NAME_DROPRIGHT = 'dropright';
|
||||||
|
var CLASS_NAME_DROPLEFT = 'dropleft';
|
||||||
|
var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
|
||||||
|
var CLASS_NAME_POSITION_STATIC = 'position-static';
|
||||||
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="dropdown"]';
|
||||||
|
var SELECTOR_FORM_CHILD = '.dropdown form';
|
||||||
|
var SELECTOR_MENU = '.dropdown-menu';
|
||||||
|
var SELECTOR_NAVBAR_NAV = '.navbar-nav';
|
||||||
|
var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
|
||||||
|
var PLACEMENT_TOP = 'top-start';
|
||||||
|
var PLACEMENT_TOPEND = 'top-end';
|
||||||
|
var PLACEMENT_BOTTOM = 'bottom-start';
|
||||||
|
var PLACEMENT_BOTTOMEND = 'bottom-end';
|
||||||
|
var PLACEMENT_RIGHT = 'right-start';
|
||||||
|
var PLACEMENT_LEFT = 'left-start';
|
||||||
|
var Default = {
|
||||||
|
offset: 0,
|
||||||
|
flip: true,
|
||||||
|
boundary: 'scrollParent',
|
||||||
|
reference: 'toggle',
|
||||||
|
display: 'dynamic',
|
||||||
|
popperConfig: null
|
||||||
|
};
|
||||||
|
var DefaultType = {
|
||||||
|
offset: '(number|string|function)',
|
||||||
|
flip: 'boolean',
|
||||||
|
boundary: '(string|element)',
|
||||||
|
reference: '(string|element)',
|
||||||
|
display: 'string',
|
||||||
|
popperConfig: '(null|object)'
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Dropdown = /*#__PURE__*/function () {
|
||||||
|
function Dropdown(element, config) {
|
||||||
|
this._element = element;
|
||||||
|
this._popper = null;
|
||||||
|
this._config = this._getConfig(config);
|
||||||
|
this._menu = this._getMenuElement();
|
||||||
|
this._inNavbar = this._detectNavbar();
|
||||||
|
|
||||||
|
this._addEventListeners();
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Dropdown.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.toggle = function toggle() {
|
||||||
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var isActive = $(this._menu).hasClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
|
Dropdown._clearMenus();
|
||||||
|
|
||||||
|
if (isActive) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.show(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.show = function show(usePopper) {
|
||||||
|
if (usePopper === void 0) {
|
||||||
|
usePopper = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var relatedTarget = {
|
||||||
|
relatedTarget: this._element
|
||||||
|
};
|
||||||
|
var showEvent = $.Event(EVENT_SHOW, relatedTarget);
|
||||||
|
|
||||||
|
var parent = Dropdown._getParentFromElement(this._element);
|
||||||
|
|
||||||
|
$(parent).trigger(showEvent);
|
||||||
|
|
||||||
|
if (showEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
} // Disable totally Popper.js for Dropdown 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/)');
|
||||||
|
}
|
||||||
|
|
||||||
|
var referenceElement = this._element;
|
||||||
|
|
||||||
|
if (this._config.reference === 'parent') {
|
||||||
|
referenceElement = parent;
|
||||||
|
} else if (Util.isElement(this._config.reference)) {
|
||||||
|
referenceElement = this._config.reference; // Check if it's jQuery element
|
||||||
|
|
||||||
|
if (typeof this._config.reference.jquery !== 'undefined') {
|
||||||
|
referenceElement = this._config.reference[0];
|
||||||
|
}
|
||||||
|
} // If boundary is not `scrollParent`, then set position to `static`
|
||||||
|
// to allow the menu to "escape" the scroll parent's boundaries
|
||||||
|
// https://github.com/twbs/bootstrap/issues/24251
|
||||||
|
|
||||||
|
|
||||||
|
if (this._config.boundary !== 'scrollParent') {
|
||||||
|
$(parent).addClass(CLASS_NAME_POSITION_STATIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._popper = new Popper(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);
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.hide = function hide() {
|
||||||
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var relatedTarget = {
|
||||||
|
relatedTarget: this._element
|
||||||
|
};
|
||||||
|
var hideEvent = $.Event(EVENT_HIDE, relatedTarget);
|
||||||
|
|
||||||
|
var parent = Dropdown._getParentFromElement(this._element);
|
||||||
|
|
||||||
|
$(parent).trigger(hideEvent);
|
||||||
|
|
||||||
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._popper) {
|
||||||
|
this._popper.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||||
|
$(parent).toggleClass(CLASS_NAME_SHOW).trigger($.Event(EVENT_HIDDEN, relatedTarget));
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
$(this._element).off(EVENT_KEY);
|
||||||
|
this._element = null;
|
||||||
|
this._menu = null;
|
||||||
|
|
||||||
|
if (this._popper !== null) {
|
||||||
|
this._popper.destroy();
|
||||||
|
|
||||||
|
this._popper = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.update = function update() {
|
||||||
|
this._inNavbar = this._detectNavbar();
|
||||||
|
|
||||||
|
if (this._popper !== null) {
|
||||||
|
this._popper.scheduleUpdate();
|
||||||
|
}
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._addEventListeners = function _addEventListeners() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
$(this._element).on(EVENT_CLICK, function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
_this.toggle();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getConfig = function _getConfig(config) {
|
||||||
|
config = _extends({}, this.constructor.Default, $(this._element).data(), config);
|
||||||
|
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getMenuElement = function _getMenuElement() {
|
||||||
|
if (!this._menu) {
|
||||||
|
var parent = Dropdown._getParentFromElement(this._element);
|
||||||
|
|
||||||
|
if (parent) {
|
||||||
|
this._menu = parent.querySelector(SELECTOR_MENU);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._menu;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getPlacement = function _getPlacement() {
|
||||||
|
var $parentDropdown = $(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;
|
||||||
|
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
|
||||||
|
placement = PLACEMENT_RIGHT;
|
||||||
|
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
|
||||||
|
placement = PLACEMENT_LEFT;
|
||||||
|
} else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
|
||||||
|
placement = PLACEMENT_BOTTOMEND;
|
||||||
|
}
|
||||||
|
|
||||||
|
return placement;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._detectNavbar = function _detectNavbar() {
|
||||||
|
return $(this._element).closest('.navbar').length > 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getOffset = function _getOffset() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var offset = {};
|
||||||
|
|
||||||
|
if (typeof this._config.offset === 'function') {
|
||||||
|
offset.fn = function (data) {
|
||||||
|
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
offset.offset = this._config.offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getPopperConfig = function _getPopperConfig() {
|
||||||
|
var popperConfig = {
|
||||||
|
placement: this._getPlacement(),
|
||||||
|
modifiers: {
|
||||||
|
offset: this._getOffset(),
|
||||||
|
flip: {
|
||||||
|
enabled: this._config.flip
|
||||||
|
},
|
||||||
|
preventOverflow: {
|
||||||
|
boundariesElement: this._config.boundary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}; // Disable Popper.js if we have a static display
|
||||||
|
|
||||||
|
if (this._config.display === 'static') {
|
||||||
|
popperConfig.modifiers.applyStyle = {
|
||||||
|
enabled: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return _extends({}, popperConfig, this._config.popperConfig);
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Dropdown._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
var _config = typeof config === 'object' ? config : null;
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Dropdown(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + config + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Dropdown._clearMenus = function _clearMenus(event) {
|
||||||
|
if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||||
|
|
||||||
|
for (var i = 0, len = toggles.length; i < len; i++) {
|
||||||
|
var parent = Dropdown._getParentFromElement(toggles[i]);
|
||||||
|
|
||||||
|
var context = $(toggles[i]).data(DATA_KEY);
|
||||||
|
var relatedTarget = {
|
||||||
|
relatedTarget: toggles[i]
|
||||||
|
};
|
||||||
|
|
||||||
|
if (event && event.type === 'click') {
|
||||||
|
relatedTarget.clickEvent = event;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!context) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dropdownMenu = context._menu;
|
||||||
|
|
||||||
|
if (!$(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)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hideEvent = $.Event(EVENT_HIDE, relatedTarget);
|
||||||
|
$(parent).trigger(hideEvent);
|
||||||
|
|
||||||
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
|
continue;
|
||||||
|
} // 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
toggles[i].setAttribute('aria-expanded', 'false');
|
||||||
|
|
||||||
|
if (context._popper) {
|
||||||
|
context._popper.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(dropdownMenu).removeClass(CLASS_NAME_SHOW);
|
||||||
|
$(parent).removeClass(CLASS_NAME_SHOW).trigger($.Event(EVENT_HIDDEN, relatedTarget));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Dropdown._getParentFromElement = function _getParentFromElement(element) {
|
||||||
|
var parent;
|
||||||
|
var selector = Util.getSelectorFromElement(element);
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
parent = document.querySelector(selector);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent || element.parentNode;
|
||||||
|
} // eslint-disable-next-line complexity
|
||||||
|
;
|
||||||
|
|
||||||
|
Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
|
||||||
|
// If not input/textarea:
|
||||||
|
// - And not a key in REGEXP_KEYDOWN => not a dropdown command
|
||||||
|
// If input/textarea:
|
||||||
|
// - If space key => not a dropdown command
|
||||||
|
// - 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)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var parent = Dropdown._getParentFromElement(this);
|
||||||
|
|
||||||
|
var isActive = $(parent).hasClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
|
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||||
|
if (event.which === ESCAPE_KEYCODE) {
|
||||||
|
$(parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus');
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this).trigger('click');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
|
||||||
|
return $(item).is(':visible');
|
||||||
|
});
|
||||||
|
|
||||||
|
if (items.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var index = items.indexOf(event.target);
|
||||||
|
|
||||||
|
if (event.which === ARROW_UP_KEYCODE && index > 0) {
|
||||||
|
// Up
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
|
||||||
|
// Down
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index < 0) {
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
items[index].focus();
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Dropdown, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Default",
|
||||||
|
get: function get() {
|
||||||
|
return Default;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "DefaultType",
|
||||||
|
get: function get() {
|
||||||
|
return DefaultType;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Dropdown;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* 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) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
Dropdown._jQueryInterface.call($(this), 'toggle');
|
||||||
|
}).on(EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Dropdown._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Dropdown;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Dropdown._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Dropdown;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=dropdown.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/dropdown.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/dropdown.js.map
vendored
Normal file
Binary file not shown.
23
assets/bootstrap-4.5.2/js/dist/index.js
vendored
Normal file
23
assets/bootstrap-4.5.2/js/dist/index.js
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.4.0): index.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
(function ($) {
|
||||||
|
if (typeof $ === 'undefined') {
|
||||||
|
throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
|
||||||
|
}
|
||||||
|
|
||||||
|
var version = $.fn.jquery.split(' ')[0].split('.');
|
||||||
|
var minMajor = 1;
|
||||||
|
var ltMajor = 2;
|
||||||
|
var minMinor = 9;
|
||||||
|
var minPatch = 1;
|
||||||
|
var maxMajor = 4;
|
||||||
|
|
||||||
|
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
|
||||||
|
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
|
||||||
|
}
|
||||||
|
})($);
|
||||||
|
//# sourceMappingURL=index.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/index.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/index.js.map
vendored
Normal file
Binary file not shown.
638
assets/bootstrap-4.5.2/js/dist/modal.js
vendored
Normal file
638
assets/bootstrap-4.5.2/js/dist/modal.js
vendored
Normal file
@ -0,0 +1,638 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap modal.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
|
(global = 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 _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'modal';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.modal';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var DATA_API_KEY = '.data-api';
|
||||||
|
var JQUERY_NO_CONFLICT = $.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 EVENT_HIDE = "hide" + EVENT_KEY;
|
||||||
|
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY;
|
||||||
|
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||||
|
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||||
|
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||||
|
var EVENT_FOCUSIN = "focusin" + EVENT_KEY;
|
||||||
|
var EVENT_RESIZE = "resize" + EVENT_KEY;
|
||||||
|
var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
|
||||||
|
var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY;
|
||||||
|
var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY;
|
||||||
|
var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY;
|
||||||
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
|
||||||
|
var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
|
||||||
|
var CLASS_NAME_BACKDROP = 'modal-backdrop';
|
||||||
|
var CLASS_NAME_OPEN = 'modal-open';
|
||||||
|
var CLASS_NAME_FADE = 'fade';
|
||||||
|
var CLASS_NAME_SHOW = 'show';
|
||||||
|
var CLASS_NAME_STATIC = 'modal-static';
|
||||||
|
var SELECTOR_DIALOG = '.modal-dialog';
|
||||||
|
var SELECTOR_MODAL_BODY = '.modal-body';
|
||||||
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="modal"]';
|
||||||
|
var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
|
||||||
|
var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||||
|
var SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Modal = /*#__PURE__*/function () {
|
||||||
|
function Modal(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._ignoreBackdropClick = false;
|
||||||
|
this._isTransitioning = false;
|
||||||
|
this._scrollbarWidth = 0;
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Modal.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.toggle = function toggle(relatedTarget) {
|
||||||
|
return this._isShown ? this.hide() : this.show(relatedTarget);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.show = function show(relatedTarget) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
if (this._isShown || this._isTransitioning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||||
|
this._isTransitioning = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var showEvent = $.Event(EVENT_SHOW, {
|
||||||
|
relatedTarget: relatedTarget
|
||||||
|
});
|
||||||
|
$(this._element).trigger(showEvent);
|
||||||
|
|
||||||
|
if (this._isShown || showEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isShown = true;
|
||||||
|
|
||||||
|
this._checkScrollbar();
|
||||||
|
|
||||||
|
this._setScrollbar();
|
||||||
|
|
||||||
|
this._adjustDialog();
|
||||||
|
|
||||||
|
this._setEscapeEvent();
|
||||||
|
|
||||||
|
this._setResizeEvent();
|
||||||
|
|
||||||
|
$(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)) {
|
||||||
|
_this._ignoreBackdropClick = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this._showBackdrop(function () {
|
||||||
|
return _this._showElement(relatedTarget);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.hide = function hide(event) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
if (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this._isShown || this._isTransitioning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hideEvent = $.Event(EVENT_HIDE);
|
||||||
|
$(this._element).trigger(hideEvent);
|
||||||
|
|
||||||
|
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isShown = false;
|
||||||
|
var transition = $(this._element).hasClass(CLASS_NAME_FADE);
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
this._isTransitioning = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._setEscapeEvent();
|
||||||
|
|
||||||
|
this._setResizeEvent();
|
||||||
|
|
||||||
|
$(document).off(EVENT_FOCUSIN);
|
||||||
|
$(this._element).removeClass(CLASS_NAME_SHOW);
|
||||||
|
$(this._element).off(EVENT_CLICK_DISMISS);
|
||||||
|
$(this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
||||||
|
$(this._element).one(Util.TRANSITION_END, function (event) {
|
||||||
|
return _this2._hideModal(event);
|
||||||
|
}).emulateTransitionEnd(transitionDuration);
|
||||||
|
} else {
|
||||||
|
this._hideModal();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
[window, this._element, this._dialog].forEach(function (htmlElement) {
|
||||||
|
return $(htmlElement).off(EVENT_KEY);
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||||
|
* Do not move `document` in `htmlElements` array
|
||||||
|
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).off(EVENT_FOCUSIN);
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.handleUpdate = function handleUpdate() {
|
||||||
|
this._adjustDialog();
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._getConfig = function _getConfig(config) {
|
||||||
|
config = _extends({}, Default, config);
|
||||||
|
Util.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);
|
||||||
|
|
||||||
|
if (hideEventPrevented.defaultPrevented) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
||||||
|
|
||||||
|
if (!isModalOverflowing) {
|
||||||
|
this._element.style.overflowY = 'hidden';
|
||||||
|
}
|
||||||
|
|
||||||
|
this._element.classList.add(CLASS_NAME_STATIC);
|
||||||
|
|
||||||
|
var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog);
|
||||||
|
$(this._element).off(Util.TRANSITION_END);
|
||||||
|
$(this._element).one(Util.TRANSITION_END, function () {
|
||||||
|
_this3._element.classList.remove(CLASS_NAME_STATIC);
|
||||||
|
|
||||||
|
if (!isModalOverflowing) {
|
||||||
|
$(_this3._element).one(Util.TRANSITION_END, function () {
|
||||||
|
_this3._element.style.overflowY = '';
|
||||||
|
}).emulateTransitionEnd(_this3._element, modalTransitionDuration);
|
||||||
|
}
|
||||||
|
}).emulateTransitionEnd(modalTransitionDuration);
|
||||||
|
|
||||||
|
this._element.focus();
|
||||||
|
} else {
|
||||||
|
this.hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._showElement = function _showElement(relatedTarget) {
|
||||||
|
var _this4 = this;
|
||||||
|
|
||||||
|
var transition = $(this._element).hasClass(CLASS_NAME_FADE);
|
||||||
|
var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;
|
||||||
|
|
||||||
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
||||||
|
// Don't move modal's DOM position
|
||||||
|
document.body.appendChild(this._element);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
} else {
|
||||||
|
this._element.scrollTop = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
Util.reflow(this._element);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._element).addClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
|
if (this._config.focus) {
|
||||||
|
this._enforceFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
var shownEvent = $.Event(EVENT_SHOWN, {
|
||||||
|
relatedTarget: relatedTarget
|
||||||
|
});
|
||||||
|
|
||||||
|
var transitionComplete = function transitionComplete() {
|
||||||
|
if (_this4._config.focus) {
|
||||||
|
_this4._element.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
_this4._isTransitioning = false;
|
||||||
|
$(_this4._element).trigger(shownEvent);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
|
||||||
|
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
|
||||||
|
} else {
|
||||||
|
transitionComplete();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._enforceFocus = function _enforceFocus() {
|
||||||
|
var _this5 = this;
|
||||||
|
|
||||||
|
$(document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
|
||||||
|
.on(EVENT_FOCUSIN, function (event) {
|
||||||
|
if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {
|
||||||
|
_this5._element.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._setEscapeEvent = function _setEscapeEvent() {
|
||||||
|
var _this6 = this;
|
||||||
|
|
||||||
|
if (this._isShown) {
|
||||||
|
$(this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
|
||||||
|
if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
_this6.hide();
|
||||||
|
} else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||||
|
_this6._triggerBackdropTransition();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (!this._isShown) {
|
||||||
|
$(this._element).off(EVENT_KEYDOWN_DISMISS);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._setResizeEvent = function _setResizeEvent() {
|
||||||
|
var _this7 = this;
|
||||||
|
|
||||||
|
if (this._isShown) {
|
||||||
|
$(window).on(EVENT_RESIZE, function (event) {
|
||||||
|
return _this7.handleUpdate(event);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$(window).off(EVENT_RESIZE);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._hideModal = function _hideModal() {
|
||||||
|
var _this8 = this;
|
||||||
|
|
||||||
|
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(function () {
|
||||||
|
$(document.body).removeClass(CLASS_NAME_OPEN);
|
||||||
|
|
||||||
|
_this8._resetAdjustments();
|
||||||
|
|
||||||
|
_this8._resetScrollbar();
|
||||||
|
|
||||||
|
$(_this8._element).trigger(EVENT_HIDDEN);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._removeBackdrop = function _removeBackdrop() {
|
||||||
|
if (this._backdrop) {
|
||||||
|
$(this._backdrop).remove();
|
||||||
|
this._backdrop = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._showBackdrop = function _showBackdrop(callback) {
|
||||||
|
var _this9 = this;
|
||||||
|
|
||||||
|
var animate = $(this._element).hasClass(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||||
|
|
||||||
|
if (this._isShown && this._config.backdrop) {
|
||||||
|
this._backdrop = document.createElement('div');
|
||||||
|
this._backdrop.className = CLASS_NAME_BACKDROP;
|
||||||
|
|
||||||
|
if (animate) {
|
||||||
|
this._backdrop.classList.add(animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._backdrop).appendTo(document.body);
|
||||||
|
$(this._element).on(EVENT_CLICK_DISMISS, function (event) {
|
||||||
|
if (_this9._ignoreBackdropClick) {
|
||||||
|
_this9._ignoreBackdropClick = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.target !== event.currentTarget) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_this9._triggerBackdropTransition();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (animate) {
|
||||||
|
Util.reflow(this._backdrop);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._backdrop).addClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
|
if (!callback) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!animate) {
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
|
||||||
|
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
|
||||||
|
} else if (!this._isShown && this._backdrop) {
|
||||||
|
$(this._backdrop).removeClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
|
var callbackRemove = function callbackRemove() {
|
||||||
|
_this9._removeBackdrop();
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||||
|
var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
|
||||||
|
|
||||||
|
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
|
||||||
|
} else {
|
||||||
|
callbackRemove();
|
||||||
|
}
|
||||||
|
} else if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
} // ----------------------------------------------------------------------
|
||||||
|
// the following methods are used to handle overflowing modals
|
||||||
|
// todo (fat): these should probably be refactored out of modal.js
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._adjustDialog = function _adjustDialog() {
|
||||||
|
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
||||||
|
|
||||||
|
if (!this._isBodyOverflowing && isModalOverflowing) {
|
||||||
|
this._element.style.paddingLeft = this._scrollbarWidth + "px";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._isBodyOverflowing && !isModalOverflowing) {
|
||||||
|
this._element.style.paddingRight = this._scrollbarWidth + "px";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._resetAdjustments = function _resetAdjustments() {
|
||||||
|
this._element.style.paddingLeft = '';
|
||||||
|
this._element.style.paddingRight = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._checkScrollbar = function _checkScrollbar() {
|
||||||
|
var rect = document.body.getBoundingClientRect();
|
||||||
|
this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
|
||||||
|
this._scrollbarWidth = this._getScrollbarWidth();
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._setScrollbar = function _setScrollbar() {
|
||||||
|
var _this10 = this;
|
||||||
|
|
||||||
|
if (this._isBodyOverflowing) {
|
||||||
|
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||||
|
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
||||||
|
var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
|
||||||
|
var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding
|
||||||
|
|
||||||
|
$(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");
|
||||||
|
}); // Adjust sticky content margin
|
||||||
|
|
||||||
|
$(stickyContent).each(function (index, element) {
|
||||||
|
var actualMargin = element.style.marginRight;
|
||||||
|
var calculatedMargin = $(element).css('margin-right');
|
||||||
|
$(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _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");
|
||||||
|
}
|
||||||
|
|
||||||
|
$(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');
|
||||||
|
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');
|
||||||
|
|
||||||
|
if (typeof margin !== 'undefined') {
|
||||||
|
$(element).css('margin-right', margin).removeData('margin-right');
|
||||||
|
}
|
||||||
|
}); // Restore body padding
|
||||||
|
|
||||||
|
var padding = $(document.body).data('padding-right');
|
||||||
|
$(document.body).removeData('padding-right');
|
||||||
|
document.body.style.paddingRight = padding ? padding : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getScrollbarWidth = function _getScrollbarWidth() {
|
||||||
|
// thx d.walsh
|
||||||
|
var scrollDiv = document.createElement('div');
|
||||||
|
scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
|
||||||
|
document.body.appendChild(scrollDiv);
|
||||||
|
var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
|
||||||
|
document.body.removeChild(scrollDiv);
|
||||||
|
return scrollbarWidth;
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
var _config = _extends({}, Default, $(this).data(), typeof config === 'object' && config ? config : {});
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Modal(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + config + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[config](relatedTarget);
|
||||||
|
} else if (_config.show) {
|
||||||
|
data.show(relatedTarget);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Modal, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Default",
|
||||||
|
get: function get() {
|
||||||
|
return Default;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Modal;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
|
var _this11 = this;
|
||||||
|
|
||||||
|
var target;
|
||||||
|
var selector = Util.getSelectorFromElement(this);
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
target = document.querySelector(selector);
|
||||||
|
}
|
||||||
|
|
||||||
|
var config = $(target).data(DATA_KEY) ? 'toggle' : _extends({}, $(target).data(), $(this).data());
|
||||||
|
|
||||||
|
if (this.tagName === 'A' || this.tagName === 'AREA') {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
var $target = $(target).one(EVENT_SHOW, function (showEvent) {
|
||||||
|
if (showEvent.isDefaultPrevented()) {
|
||||||
|
// Only register focus restorer if modal will actually get shown
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$target.one(EVENT_HIDDEN, function () {
|
||||||
|
if ($(_this11).is(':visible')) {
|
||||||
|
_this11.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
Modal._jQueryInterface.call($(target), config, this);
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Modal._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Modal;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Modal._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Modal;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=modal.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/modal.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/modal.js.map
vendored
Normal file
Binary file not shown.
205
assets/bootstrap-4.5.2/js/dist/popover.js
vendored
Normal file
205
assets/bootstrap-4.5.2/js/dist/popover.js
vendored
Normal file
@ -0,0 +1,205 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap popover.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) :
|
||||||
|
(global = 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 _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||||
|
|
||||||
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'popover';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.popover';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||||
|
var CLASS_PREFIX = 'bs-popover';
|
||||||
|
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
||||||
|
|
||||||
|
var Default = _extends({}, Tooltip.Default, {
|
||||||
|
placement: 'right',
|
||||||
|
trigger: 'click',
|
||||||
|
content: '',
|
||||||
|
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
|
||||||
|
});
|
||||||
|
|
||||||
|
var DefaultType = _extends({}, Tooltip.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,
|
||||||
|
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
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Popover = /*#__PURE__*/function (_Tooltip) {
|
||||||
|
_inheritsLoose(Popover, _Tooltip);
|
||||||
|
|
||||||
|
function Popover() {
|
||||||
|
return _Tooltip.apply(this, arguments) || this;
|
||||||
|
}
|
||||||
|
|
||||||
|
var _proto = Popover.prototype;
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
_proto.isWithContent = function isWithContent() {
|
||||||
|
return this.getTitle() || this._getContent();
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
||||||
|
$(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.getTipElement = function getTipElement() {
|
||||||
|
this.tip = this.tip || $(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
|
||||||
|
|
||||||
|
this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
|
||||||
|
|
||||||
|
var content = this._getContent();
|
||||||
|
|
||||||
|
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
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._getContent = function _getContent() {
|
||||||
|
return this.element.getAttribute('data-content') || this.config.content;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._cleanTipClass = function _cleanTipClass() {
|
||||||
|
var $tip = $(this.getTipElement());
|
||||||
|
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
||||||
|
|
||||||
|
if (tabClass !== null && tabClass.length > 0) {
|
||||||
|
$tip.removeClass(tabClass.join(''));
|
||||||
|
}
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Popover._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
var _config = typeof config === 'object' ? config : null;
|
||||||
|
|
||||||
|
if (!data && /dispose|hide/.test(config)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Popover(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + config + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Popover, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
// Getters
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Default",
|
||||||
|
get: function get() {
|
||||||
|
return Default;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "NAME",
|
||||||
|
get: function get() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "DATA_KEY",
|
||||||
|
get: function get() {
|
||||||
|
return DATA_KEY;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Event",
|
||||||
|
get: function get() {
|
||||||
|
return Event;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "EVENT_KEY",
|
||||||
|
get: function get() {
|
||||||
|
return EVENT_KEY;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "DefaultType",
|
||||||
|
get: function get() {
|
||||||
|
return DefaultType;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Popover;
|
||||||
|
}(Tooltip);
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$.fn[NAME] = Popover._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Popover;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Popover._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Popover;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=popover.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/popover.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/popover.js.map
vendored
Normal file
Binary file not shown.
315
assets/bootstrap-4.5.2/js/dist/scrollspy.js
vendored
Normal file
315
assets/bootstrap-4.5.2/js/dist/scrollspy.js
vendored
Normal file
@ -0,0 +1,315 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap scrollspy.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
|
(global = 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 _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'scrollspy';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.scrollspy';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var DATA_API_KEY = '.data-api';
|
||||||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||||
|
var Default = {
|
||||||
|
offset: 10,
|
||||||
|
method: 'auto',
|
||||||
|
target: ''
|
||||||
|
};
|
||||||
|
var DefaultType = {
|
||||||
|
offset: 'number',
|
||||||
|
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
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var ScrollSpy = /*#__PURE__*/function () {
|
||||||
|
function ScrollSpy(element, config) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this._element = element;
|
||||||
|
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||||
|
this._config = this._getConfig(config);
|
||||||
|
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);
|
||||||
|
this._offsets = [];
|
||||||
|
this._targets = [];
|
||||||
|
this._activeTarget = null;
|
||||||
|
this._scrollHeight = 0;
|
||||||
|
$(this._scrollElement).on(EVENT_SCROLL, function (event) {
|
||||||
|
return _this._process(event);
|
||||||
|
});
|
||||||
|
this.refresh();
|
||||||
|
|
||||||
|
this._process();
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = ScrollSpy.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.refresh = function refresh() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
|
||||||
|
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
|
||||||
|
var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
|
||||||
|
this._offsets = [];
|
||||||
|
this._targets = [];
|
||||||
|
this._scrollHeight = this._getScrollHeight();
|
||||||
|
var targets = [].slice.call(document.querySelectorAll(this._selector));
|
||||||
|
targets.map(function (element) {
|
||||||
|
var target;
|
||||||
|
var targetSelector = Util.getSelectorFromElement(element);
|
||||||
|
|
||||||
|
if (targetSelector) {
|
||||||
|
target = document.querySelector(targetSelector);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target) {
|
||||||
|
var targetBCR = target.getBoundingClientRect();
|
||||||
|
|
||||||
|
if (targetBCR.width || targetBCR.height) {
|
||||||
|
// TODO (fat): remove sketch reliance on jQuery position/offset
|
||||||
|
return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}).filter(function (item) {
|
||||||
|
return item;
|
||||||
|
}).sort(function (a, b) {
|
||||||
|
return a[0] - b[0];
|
||||||
|
}).forEach(function (item) {
|
||||||
|
_this2._offsets.push(item[0]);
|
||||||
|
|
||||||
|
_this2._targets.push(item[1]);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
$(this._scrollElement).off(EVENT_KEY);
|
||||||
|
this._element = null;
|
||||||
|
this._scrollElement = null;
|
||||||
|
this._config = null;
|
||||||
|
this._selector = null;
|
||||||
|
this._offsets = null;
|
||||||
|
this._targets = null;
|
||||||
|
this._activeTarget = null;
|
||||||
|
this._scrollHeight = null;
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._getConfig = function _getConfig(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 (!id) {
|
||||||
|
id = Util.getUID(NAME);
|
||||||
|
$(config.target).attr('id', id);
|
||||||
|
}
|
||||||
|
|
||||||
|
config.target = "#" + id;
|
||||||
|
}
|
||||||
|
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getScrollTop = function _getScrollTop() {
|
||||||
|
return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getScrollHeight = function _getScrollHeight() {
|
||||||
|
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getOffsetHeight = function _getOffsetHeight() {
|
||||||
|
return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._process = function _process() {
|
||||||
|
var scrollTop = this._getScrollTop() + this._config.offset;
|
||||||
|
|
||||||
|
var scrollHeight = this._getScrollHeight();
|
||||||
|
|
||||||
|
var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
|
||||||
|
|
||||||
|
if (this._scrollHeight !== scrollHeight) {
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scrollTop >= maxScroll) {
|
||||||
|
var target = this._targets[this._targets.length - 1];
|
||||||
|
|
||||||
|
if (this._activeTarget !== target) {
|
||||||
|
this._activate(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
|
||||||
|
this._activeTarget = null;
|
||||||
|
|
||||||
|
this._clear();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = this._offsets.length; i--;) {
|
||||||
|
var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
|
||||||
|
|
||||||
|
if (isActiveTarget) {
|
||||||
|
this._activate(this._targets[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._activate = function _activate(target) {
|
||||||
|
this._activeTarget = target;
|
||||||
|
|
||||||
|
this._clear();
|
||||||
|
|
||||||
|
var queries = this._selector.split(',').map(function (selector) {
|
||||||
|
return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
|
||||||
|
});
|
||||||
|
|
||||||
|
var $link = $([].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);
|
||||||
|
$link.addClass(CLASS_NAME_ACTIVE);
|
||||||
|
} else {
|
||||||
|
// Set triggered link as active
|
||||||
|
$link.addClass(CLASS_NAME_ACTIVE); // Set triggered links parents as active
|
||||||
|
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
||||||
|
|
||||||
|
$link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE); // Handle special case when .nav-link is inside .nav-item
|
||||||
|
|
||||||
|
$link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._scrollElement).trigger(EVENT_ACTIVATE, {
|
||||||
|
relatedTarget: target
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._clear = function _clear() {
|
||||||
|
[].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
|
||||||
|
return node.classList.contains(CLASS_NAME_ACTIVE);
|
||||||
|
}).forEach(function (node) {
|
||||||
|
return node.classList.remove(CLASS_NAME_ACTIVE);
|
||||||
|
});
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
var _config = typeof config === 'object' && config;
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new ScrollSpy(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + config + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(ScrollSpy, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Default",
|
||||||
|
get: function get() {
|
||||||
|
return Default;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return ScrollSpy;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(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]);
|
||||||
|
|
||||||
|
ScrollSpy._jQueryInterface.call($spy, $spy.data());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = ScrollSpy._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = ScrollSpy;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return ScrollSpy._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return ScrollSpy;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=scrollspy.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/scrollspy.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/scrollspy.js.map
vendored
Normal file
Binary file not shown.
247
assets/bootstrap-4.5.2/js/dist/tab.js
vendored
Normal file
247
assets/bootstrap-4.5.2/js/dist/tab.js
vendored
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap tab.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
|
(global = 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 _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'tab';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.tab';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var DATA_API_KEY = '.data-api';
|
||||||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||||
|
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||||
|
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||||
|
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||||
|
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||||
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
|
var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
|
||||||
|
var CLASS_NAME_ACTIVE = 'active';
|
||||||
|
var CLASS_NAME_DISABLED = 'disabled';
|
||||||
|
var CLASS_NAME_FADE = 'fade';
|
||||||
|
var CLASS_NAME_SHOW = 'show';
|
||||||
|
var SELECTOR_DROPDOWN = '.dropdown';
|
||||||
|
var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
|
||||||
|
var SELECTOR_ACTIVE = '.active';
|
||||||
|
var SELECTOR_ACTIVE_UL = '> li > .active';
|
||||||
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
|
||||||
|
var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
||||||
|
var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Tab = /*#__PURE__*/function () {
|
||||||
|
function Tab(element) {
|
||||||
|
this._element = element;
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Tab.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_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)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var target;
|
||||||
|
var previous;
|
||||||
|
var listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];
|
||||||
|
var selector = Util.getSelectorFromElement(this._element);
|
||||||
|
|
||||||
|
if (listElement) {
|
||||||
|
var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
|
||||||
|
previous = $.makeArray($(listElement).find(itemSelector));
|
||||||
|
previous = previous[previous.length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
var hideEvent = $.Event(EVENT_HIDE, {
|
||||||
|
relatedTarget: this._element
|
||||||
|
});
|
||||||
|
var showEvent = $.Event(EVENT_SHOW, {
|
||||||
|
relatedTarget: previous
|
||||||
|
});
|
||||||
|
|
||||||
|
if (previous) {
|
||||||
|
$(previous).trigger(hideEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._element).trigger(showEvent);
|
||||||
|
|
||||||
|
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
target = document.querySelector(selector);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._activate(this._element, listElement);
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
var hiddenEvent = $.Event(EVENT_HIDDEN, {
|
||||||
|
relatedTarget: _this._element
|
||||||
|
});
|
||||||
|
var shownEvent = $.Event(EVENT_SHOWN, {
|
||||||
|
relatedTarget: previous
|
||||||
|
});
|
||||||
|
$(previous).trigger(hiddenEvent);
|
||||||
|
$(_this._element).trigger(shownEvent);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (target) {
|
||||||
|
this._activate(target, target.parentNode, complete);
|
||||||
|
} else {
|
||||||
|
complete();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
this._element = null;
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_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 active = activeElements[0];
|
||||||
|
var isTransitioning = callback && active && $(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);
|
||||||
|
} else {
|
||||||
|
complete();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
|
||||||
|
if (active) {
|
||||||
|
$(active).removeClass(CLASS_NAME_ACTIVE);
|
||||||
|
var dropdownChild = $(active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
|
||||||
|
|
||||||
|
if (dropdownChild) {
|
||||||
|
$(dropdownChild).removeClass(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (active.getAttribute('role') === 'tab') {
|
||||||
|
active.setAttribute('aria-selected', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(element).addClass(CLASS_NAME_ACTIVE);
|
||||||
|
|
||||||
|
if (element.getAttribute('role') === 'tab') {
|
||||||
|
element.setAttribute('aria-selected', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Util.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];
|
||||||
|
|
||||||
|
if (dropdownElement) {
|
||||||
|
var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE));
|
||||||
|
$(dropdownToggleList).addClass(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
element.setAttribute('aria-expanded', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Tab._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this);
|
||||||
|
var data = $this.data(DATA_KEY);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Tab(this);
|
||||||
|
$this.data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + config + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Tab, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Tab;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
Tab._jQueryInterface.call($(this), 'show');
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Tab._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Tab;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Tab._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Tab;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=tab.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/tab.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/tab.js.map
vendored
Normal file
Binary file not shown.
241
assets/bootstrap-4.5.2/js/dist/toast.js
vendored
Normal file
241
assets/bootstrap-4.5.2/js/dist/toast.js
vendored
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap toast.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
|
(global = 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 _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'toast';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.toast';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||||
|
var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
|
||||||
|
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 Default = {
|
||||||
|
animation: true,
|
||||||
|
autohide: true,
|
||||||
|
delay: 500
|
||||||
|
};
|
||||||
|
var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Toast = /*#__PURE__*/function () {
|
||||||
|
function Toast(element, config) {
|
||||||
|
this._element = element;
|
||||||
|
this._config = this._getConfig(config);
|
||||||
|
this._timeout = null;
|
||||||
|
|
||||||
|
this._setListeners();
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Toast.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.show = function show() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
var showEvent = $.Event(EVENT_SHOW);
|
||||||
|
$(this._element).trigger(showEvent);
|
||||||
|
|
||||||
|
if (showEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._clearTimeout();
|
||||||
|
|
||||||
|
if (this._config.animation) {
|
||||||
|
this._element.classList.add(CLASS_NAME_FADE);
|
||||||
|
}
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
_this._element.classList.remove(CLASS_NAME_SHOWING);
|
||||||
|
|
||||||
|
_this._element.classList.add(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
|
$(_this._element).trigger(EVENT_SHOWN);
|
||||||
|
|
||||||
|
if (_this._config.autohide) {
|
||||||
|
_this._timeout = setTimeout(function () {
|
||||||
|
_this.hide();
|
||||||
|
}, _this._config.delay);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this._element.classList.remove(CLASS_NAME_HIDE);
|
||||||
|
|
||||||
|
Util.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);
|
||||||
|
} else {
|
||||||
|
complete();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.hide = function hide() {
|
||||||
|
if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hideEvent = $.Event(EVENT_HIDE);
|
||||||
|
$(this._element).trigger(hideEvent);
|
||||||
|
|
||||||
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._close();
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.dispose = function dispose() {
|
||||||
|
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);
|
||||||
|
this._element = null;
|
||||||
|
this._config = null;
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._getConfig = function _getConfig(config) {
|
||||||
|
config = _extends({}, Default, $(this._element).data(), typeof config === 'object' && config ? config : {});
|
||||||
|
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._setListeners = function _setListeners() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
$(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
|
||||||
|
return _this2.hide();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._close = function _close() {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
_this3._element.classList.add(CLASS_NAME_HIDE);
|
||||||
|
|
||||||
|
$(_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);
|
||||||
|
} 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 data = $element.data(DATA_KEY);
|
||||||
|
|
||||||
|
var _config = typeof config === 'object' && config;
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Toast(this, _config);
|
||||||
|
$element.data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + config + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[config](this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Toast, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "DefaultType",
|
||||||
|
get: function get() {
|
||||||
|
return DefaultType;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Default",
|
||||||
|
get: function get() {
|
||||||
|
return Default;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Toast;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$.fn[NAME] = Toast._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Toast;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Toast._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Toast;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=toast.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/toast.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/toast.js.map
vendored
Normal file
Binary file not shown.
857
assets/bootstrap-4.5.2/js/dist/tooltip.js
vendored
Normal file
857
assets/bootstrap-4.5.2/js/dist/tooltip.js
vendored
Normal file
@ -0,0 +1,857 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap tooltip.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
|
||||||
|
(global = 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.2): tools/sanitizer.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
|
||||||
|
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
||||||
|
var DefaultWhitelist = {
|
||||||
|
// Global attributes allowed on any supplied element below.
|
||||||
|
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
||||||
|
a: ['target', 'href', 'title', 'rel'],
|
||||||
|
area: [],
|
||||||
|
b: [],
|
||||||
|
br: [],
|
||||||
|
col: [],
|
||||||
|
code: [],
|
||||||
|
div: [],
|
||||||
|
em: [],
|
||||||
|
hr: [],
|
||||||
|
h1: [],
|
||||||
|
h2: [],
|
||||||
|
h3: [],
|
||||||
|
h4: [],
|
||||||
|
h5: [],
|
||||||
|
h6: [],
|
||||||
|
i: [],
|
||||||
|
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
|
||||||
|
li: [],
|
||||||
|
ol: [],
|
||||||
|
p: [],
|
||||||
|
pre: [],
|
||||||
|
s: [],
|
||||||
|
small: [],
|
||||||
|
span: [],
|
||||||
|
sub: [],
|
||||||
|
sup: [],
|
||||||
|
strong: [],
|
||||||
|
u: [],
|
||||||
|
ul: []
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||||
|
*
|
||||||
|
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||||
|
*/
|
||||||
|
|
||||||
|
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
|
||||||
|
/**
|
||||||
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
||||||
|
*
|
||||||
|
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||||
|
*/
|
||||||
|
|
||||||
|
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
|
||||||
|
|
||||||
|
function allowedAttribute(attr, allowedAttributeList) {
|
||||||
|
var attrName = attr.nodeName.toLowerCase();
|
||||||
|
|
||||||
|
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 true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var regExp = allowedAttributeList.filter(function (attrRegex) {
|
||||||
|
return attrRegex instanceof RegExp;
|
||||||
|
}); // Check if a regular expression validates the attribute.
|
||||||
|
|
||||||
|
for (var i = 0, len = regExp.length; i < len; i++) {
|
||||||
|
if (attrName.match(regExp[i])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||||
|
if (unsafeHtml.length === 0) {
|
||||||
|
return unsafeHtml;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sanitizeFn && typeof sanitizeFn === 'function') {
|
||||||
|
return sanitizeFn(unsafeHtml);
|
||||||
|
}
|
||||||
|
|
||||||
|
var domParser = new window.DOMParser();
|
||||||
|
var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
||||||
|
var whitelistKeys = Object.keys(whiteList);
|
||||||
|
var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
|
||||||
|
|
||||||
|
var _loop = function _loop(i, len) {
|
||||||
|
var el = elements[i];
|
||||||
|
var elName = el.nodeName.toLowerCase();
|
||||||
|
|
||||||
|
if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
|
||||||
|
el.parentNode.removeChild(el);
|
||||||
|
return "continue";
|
||||||
|
}
|
||||||
|
|
||||||
|
var attributeList = [].slice.call(el.attributes);
|
||||||
|
var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
|
||||||
|
attributeList.forEach(function (attr) {
|
||||||
|
if (!allowedAttribute(attr, whitelistedAttributes)) {
|
||||||
|
el.removeAttribute(attr.nodeName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var i = 0, len = elements.length; i < len; i++) {
|
||||||
|
var _ret = _loop(i);
|
||||||
|
|
||||||
|
if (_ret === "continue") continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return createdDocument.body.innerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NAME = 'tooltip';
|
||||||
|
var VERSION = '4.5.2';
|
||||||
|
var DATA_KEY = 'bs.tooltip';
|
||||||
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
|
var JQUERY_NO_CONFLICT = $.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 AttachmentMap = {
|
||||||
|
AUTO: 'auto',
|
||||||
|
TOP: 'top',
|
||||||
|
RIGHT: 'right',
|
||||||
|
BOTTOM: 'bottom',
|
||||||
|
LEFT: 'left'
|
||||||
|
};
|
||||||
|
var Default = {
|
||||||
|
animation: true,
|
||||||
|
template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
|
||||||
|
trigger: 'hover focus',
|
||||||
|
title: '',
|
||||||
|
delay: 0,
|
||||||
|
html: false,
|
||||||
|
selector: false,
|
||||||
|
placement: 'top',
|
||||||
|
offset: 0,
|
||||||
|
container: false,
|
||||||
|
fallbackPlacement: 'flip',
|
||||||
|
boundary: 'scrollParent',
|
||||||
|
sanitize: true,
|
||||||
|
sanitizeFn: null,
|
||||||
|
whiteList: DefaultWhitelist,
|
||||||
|
popperConfig: null
|
||||||
|
};
|
||||||
|
var HOVER_STATE_SHOW = 'show';
|
||||||
|
var HOVER_STATE_OUT = 'out';
|
||||||
|
var 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
|
||||||
|
};
|
||||||
|
var CLASS_NAME_FADE = 'fade';
|
||||||
|
var CLASS_NAME_SHOW = 'show';
|
||||||
|
var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
||||||
|
var SELECTOR_ARROW = '.arrow';
|
||||||
|
var TRIGGER_HOVER = 'hover';
|
||||||
|
var TRIGGER_FOCUS = 'focus';
|
||||||
|
var TRIGGER_CLICK = 'click';
|
||||||
|
var TRIGGER_MANUAL = 'manual';
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Tooltip = /*#__PURE__*/function () {
|
||||||
|
function Tooltip(element, config) {
|
||||||
|
if (typeof Popper === 'undefined') {
|
||||||
|
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
|
||||||
|
} // private
|
||||||
|
|
||||||
|
|
||||||
|
this._isEnabled = true;
|
||||||
|
this._timeout = 0;
|
||||||
|
this._hoverState = '';
|
||||||
|
this._activeTrigger = {};
|
||||||
|
this._popper = null; // Protected
|
||||||
|
|
||||||
|
this.element = element;
|
||||||
|
this.config = this._getConfig(config);
|
||||||
|
this.tip = null;
|
||||||
|
|
||||||
|
this._setListeners();
|
||||||
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
var _proto = Tooltip.prototype;
|
||||||
|
|
||||||
|
// Public
|
||||||
|
_proto.enable = function enable() {
|
||||||
|
this._isEnabled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.disable = function disable() {
|
||||||
|
this._isEnabled = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.toggleEnabled = function toggleEnabled() {
|
||||||
|
this._isEnabled = !this._isEnabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.toggle = function toggle(event) {
|
||||||
|
if (!this._isEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event) {
|
||||||
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
|
var context = $(event.currentTarget).data(dataKey);
|
||||||
|
|
||||||
|
if (!context) {
|
||||||
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
|
$(event.currentTarget).data(dataKey, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
context._activeTrigger.click = !context._activeTrigger.click;
|
||||||
|
|
||||||
|
if (context._isWithActiveTrigger()) {
|
||||||
|
context._enter(null, context);
|
||||||
|
} else {
|
||||||
|
context._leave(null, context);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
this._leave(null, this);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._enter(null, this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_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);
|
||||||
|
|
||||||
|
if (this.tip) {
|
||||||
|
$(this.tip).remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isEnabled = null;
|
||||||
|
this._timeout = null;
|
||||||
|
this._hoverState = null;
|
||||||
|
this._activeTrigger = null;
|
||||||
|
|
||||||
|
if (this._popper) {
|
||||||
|
this._popper.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._popper = null;
|
||||||
|
this.element = null;
|
||||||
|
this.config = null;
|
||||||
|
this.tip = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.show = function show() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
if ($(this.element).css('display') === 'none') {
|
||||||
|
throw new Error('Please use show on visible elements');
|
||||||
|
}
|
||||||
|
|
||||||
|
var showEvent = $.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);
|
||||||
|
|
||||||
|
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tip = this.getTipElement();
|
||||||
|
var tipId = Util.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||||
|
|
||||||
|
var attachment = this._getAttachment(placement);
|
||||||
|
|
||||||
|
this.addAttachmentClass(attachment);
|
||||||
|
|
||||||
|
var container = this._getContainer();
|
||||||
|
|
||||||
|
$(tip).data(this.constructor.DATA_KEY, this);
|
||||||
|
|
||||||
|
if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
|
||||||
|
$(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
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
if (_this.config.animation) {
|
||||||
|
_this._fixTransition();
|
||||||
|
}
|
||||||
|
|
||||||
|
var prevHoverState = _this._hoverState;
|
||||||
|
_this._hoverState = null;
|
||||||
|
$(_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);
|
||||||
|
} else {
|
||||||
|
complete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.hide = function hide(callback) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var tip = this.getTipElement();
|
||||||
|
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||||
|
tip.parentNode.removeChild(tip);
|
||||||
|
}
|
||||||
|
|
||||||
|
_this2._cleanTipClass();
|
||||||
|
|
||||||
|
_this2.element.removeAttribute('aria-describedby');
|
||||||
|
|
||||||
|
$(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
|
||||||
|
|
||||||
|
if (_this2._popper !== null) {
|
||||||
|
_this2._popper.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(this.element).trigger(hideEvent);
|
||||||
|
|
||||||
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
|
||||||
|
// empty mouseover listeners we added for iOS support
|
||||||
|
|
||||||
|
if ('ontouchstart' in document.documentElement) {
|
||||||
|
$(document.body).children().off('mouseover', null, $.noop);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
||||||
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
||||||
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
||||||
|
|
||||||
|
if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||||
|
var transitionDuration = Util.getTransitionDurationFromElement(tip);
|
||||||
|
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||||
|
} else {
|
||||||
|
complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._hoverState = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.update = function update() {
|
||||||
|
if (this._popper !== null) {
|
||||||
|
this._popper.scheduleUpdate();
|
||||||
|
}
|
||||||
|
} // Protected
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto.isWithContent = function isWithContent() {
|
||||||
|
return Boolean(this.getTitle());
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
||||||
|
$(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.getTipElement = function getTipElement() {
|
||||||
|
this.tip = this.tip || $(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);
|
||||||
|
};
|
||||||
|
|
||||||
|
_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)) {
|
||||||
|
$element.empty().append(content);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$element.text($(content).text());
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.config.html) {
|
||||||
|
if (this.config.sanitize) {
|
||||||
|
content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
|
||||||
|
}
|
||||||
|
|
||||||
|
$element.html(content);
|
||||||
|
} else {
|
||||||
|
$element.text(content);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.getTitle = function getTitle() {
|
||||||
|
var title = this.element.getAttribute('data-original-title');
|
||||||
|
|
||||||
|
if (!title) {
|
||||||
|
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
||||||
|
}
|
||||||
|
|
||||||
|
return title;
|
||||||
|
} // Private
|
||||||
|
;
|
||||||
|
|
||||||
|
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
var defaultBsConfig = {
|
||||||
|
placement: attachment,
|
||||||
|
modifiers: {
|
||||||
|
offset: this._getOffset(),
|
||||||
|
flip: {
|
||||||
|
behavior: this.config.fallbackPlacement
|
||||||
|
},
|
||||||
|
arrow: {
|
||||||
|
element: SELECTOR_ARROW
|
||||||
|
},
|
||||||
|
preventOverflow: {
|
||||||
|
boundariesElement: this.config.boundary
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCreate: function onCreate(data) {
|
||||||
|
if (data.originalPlacement !== data.placement) {
|
||||||
|
_this3._handlePopperPlacementChange(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onUpdate: function onUpdate(data) {
|
||||||
|
return _this3._handlePopperPlacementChange(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getOffset = function _getOffset() {
|
||||||
|
var _this4 = this;
|
||||||
|
|
||||||
|
var offset = {};
|
||||||
|
|
||||||
|
if (typeof this.config.offset === 'function') {
|
||||||
|
offset.fn = function (data) {
|
||||||
|
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
offset.offset = this.config.offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getContainer = function _getContainer() {
|
||||||
|
if (this.config.container === false) {
|
||||||
|
return document.body;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Util.isElement(this.config.container)) {
|
||||||
|
return $(this.config.container);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $(document).find(this.config.container);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getAttachment = function _getAttachment(placement) {
|
||||||
|
return AttachmentMap[placement.toUpperCase()];
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._setListeners = function _setListeners() {
|
||||||
|
var _this5 = this;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
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) {
|
||||||
|
return _this5._enter(event);
|
||||||
|
}).on(eventOut, _this5.config.selector, function (event) {
|
||||||
|
return _this5._leave(event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this._hideModalHandler = function () {
|
||||||
|
if (_this5.element) {
|
||||||
|
_this5.hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
|
||||||
|
|
||||||
|
if (this.config.selector) {
|
||||||
|
this.config = _extends({}, this.config, {
|
||||||
|
trigger: 'manual',
|
||||||
|
selector: ''
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this._fixTitle();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._fixTitle = function _fixTitle() {
|
||||||
|
var titleType = typeof this.element.getAttribute('data-original-title');
|
||||||
|
|
||||||
|
if (this.element.getAttribute('title') || titleType !== 'string') {
|
||||||
|
this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
|
||||||
|
this.element.setAttribute('title', '');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._enter = function _enter(event, context) {
|
||||||
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
|
context = context || $(event.currentTarget).data(dataKey);
|
||||||
|
|
||||||
|
if (!context) {
|
||||||
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
|
$(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) {
|
||||||
|
context._hoverState = HOVER_STATE_SHOW;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(context._timeout);
|
||||||
|
context._hoverState = HOVER_STATE_SHOW;
|
||||||
|
|
||||||
|
if (!context.config.delay || !context.config.delay.show) {
|
||||||
|
context.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
context._timeout = setTimeout(function () {
|
||||||
|
if (context._hoverState === HOVER_STATE_SHOW) {
|
||||||
|
context.show();
|
||||||
|
}
|
||||||
|
}, context.config.delay.show);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._leave = function _leave(event, context) {
|
||||||
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
|
context = context || $(event.currentTarget).data(dataKey);
|
||||||
|
|
||||||
|
if (!context) {
|
||||||
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
|
$(event.currentTarget).data(dataKey, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event) {
|
||||||
|
context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context._isWithActiveTrigger()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(context._timeout);
|
||||||
|
context._hoverState = HOVER_STATE_OUT;
|
||||||
|
|
||||||
|
if (!context.config.delay || !context.config.delay.hide) {
|
||||||
|
context.hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
context._timeout = setTimeout(function () {
|
||||||
|
if (context._hoverState === HOVER_STATE_OUT) {
|
||||||
|
context.hide();
|
||||||
|
}
|
||||||
|
}, context.config.delay.hide);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._isWithActiveTrigger = function _isWithActiveTrigger() {
|
||||||
|
for (var trigger in this._activeTrigger) {
|
||||||
|
if (this._activeTrigger[trigger]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getConfig = function _getConfig(config) {
|
||||||
|
var dataAttributes = $(this.element).data();
|
||||||
|
Object.keys(dataAttributes).forEach(function (dataAttr) {
|
||||||
|
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
|
||||||
|
delete dataAttributes[dataAttr];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
|
||||||
|
|
||||||
|
if (typeof config.delay === 'number') {
|
||||||
|
config.delay = {
|
||||||
|
show: config.delay,
|
||||||
|
hide: config.delay
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config.title === 'number') {
|
||||||
|
config.title = config.title.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config.content === 'number') {
|
||||||
|
config.content = config.content.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||||
|
|
||||||
|
if (config.sanitize) {
|
||||||
|
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getDelegateConfig = function _getDelegateConfig() {
|
||||||
|
var config = {};
|
||||||
|
|
||||||
|
if (this.config) {
|
||||||
|
for (var key in this.config) {
|
||||||
|
if (this.constructor.Default[key] !== this.config[key]) {
|
||||||
|
config[key] = this.config[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._cleanTipClass = function _cleanTipClass() {
|
||||||
|
var $tip = $(this.getTipElement());
|
||||||
|
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
||||||
|
|
||||||
|
if (tabClass !== null && tabClass.length) {
|
||||||
|
$tip.removeClass(tabClass.join(''));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||||
|
this.tip = popperData.instance.popper;
|
||||||
|
|
||||||
|
this._cleanTipClass();
|
||||||
|
|
||||||
|
this.addAttachmentClass(this._getAttachment(popperData.placement));
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._fixTransition = function _fixTransition() {
|
||||||
|
var tip = this.getTipElement();
|
||||||
|
var initConfigAnimation = this.config.animation;
|
||||||
|
|
||||||
|
if (tip.getAttribute('x-placement') !== null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(tip).removeClass(CLASS_NAME_FADE);
|
||||||
|
this.config.animation = false;
|
||||||
|
this.hide();
|
||||||
|
this.show();
|
||||||
|
this.config.animation = initConfigAnimation;
|
||||||
|
} // Static
|
||||||
|
;
|
||||||
|
|
||||||
|
Tooltip._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
var _config = typeof config === 'object' && config;
|
||||||
|
|
||||||
|
if (!data && /dispose|hide/.test(config)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Tooltip(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError("No method named \"" + config + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Tooltip, null, [{
|
||||||
|
key: "VERSION",
|
||||||
|
get: function get() {
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Default",
|
||||||
|
get: function get() {
|
||||||
|
return Default;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "NAME",
|
||||||
|
get: function get() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "DATA_KEY",
|
||||||
|
get: function get() {
|
||||||
|
return DATA_KEY;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "Event",
|
||||||
|
get: function get() {
|
||||||
|
return Event;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "EVENT_KEY",
|
||||||
|
get: function get() {
|
||||||
|
return EVENT_KEY;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "DefaultType",
|
||||||
|
get: function get() {
|
||||||
|
return DefaultType;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Tooltip;
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$.fn[NAME] = Tooltip._jQueryInterface;
|
||||||
|
$.fn[NAME].Constructor = Tooltip;
|
||||||
|
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
|
return Tooltip._jQueryInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Tooltip;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=tooltip.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/tooltip.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/tooltip.js.map
vendored
Normal file
Binary file not shown.
193
assets/bootstrap-4.5.2/js/dist/util.js
vendored
Normal file
193
assets/bootstrap-4.5.2/js/dist/util.js
vendored
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap util.js v4.5.2 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
||||||
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Util = factory(global.jQuery));
|
||||||
|
}(this, (function ($) { 'use strict';
|
||||||
|
|
||||||
|
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.2): util.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Private TransitionEnd Helpers
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
var TRANSITION_END = 'transitionend';
|
||||||
|
var MAX_UID = 1000000;
|
||||||
|
var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||||
|
|
||||||
|
function toType(obj) {
|
||||||
|
if (obj === null || typeof obj === 'undefined') {
|
||||||
|
return "" + obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSpecialTransitionEndEvent() {
|
||||||
|
return {
|
||||||
|
bindType: TRANSITION_END,
|
||||||
|
delegateType: TRANSITION_END,
|
||||||
|
handle: function handle(event) {
|
||||||
|
if ($(event.target).is(this)) {
|
||||||
|
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function transitionEndEmulator(duration) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
var called = false;
|
||||||
|
$(this).one(Util.TRANSITION_END, function () {
|
||||||
|
called = true;
|
||||||
|
});
|
||||||
|
setTimeout(function () {
|
||||||
|
if (!called) {
|
||||||
|
Util.triggerTransitionEnd(_this);
|
||||||
|
}
|
||||||
|
}, duration);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTransitionEndSupport() {
|
||||||
|
$.fn.emulateTransitionEnd = transitionEndEmulator;
|
||||||
|
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Public Util Api
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var Util = {
|
||||||
|
TRANSITION_END: 'bsTransitionEnd',
|
||||||
|
getUID: function getUID(prefix) {
|
||||||
|
do {
|
||||||
|
// eslint-disable-next-line no-bitwise
|
||||||
|
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
|
||||||
|
} while (document.getElementById(prefix));
|
||||||
|
|
||||||
|
return prefix;
|
||||||
|
},
|
||||||
|
getSelectorFromElement: function getSelectorFromElement(element) {
|
||||||
|
var selector = element.getAttribute('data-target');
|
||||||
|
|
||||||
|
if (!selector || selector === '#') {
|
||||||
|
var hrefAttr = element.getAttribute('href');
|
||||||
|
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return document.querySelector(selector) ? selector : null;
|
||||||
|
} catch (err) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
|
||||||
|
if (!element) {
|
||||||
|
return 0;
|
||||||
|
} // Get transition-duration of the element
|
||||||
|
|
||||||
|
|
||||||
|
var transitionDuration = $(element).css('transition-duration');
|
||||||
|
var transitionDelay = $(element).css('transition-delay');
|
||||||
|
var floatTransitionDuration = parseFloat(transitionDuration);
|
||||||
|
var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
|
||||||
|
|
||||||
|
if (!floatTransitionDuration && !floatTransitionDelay) {
|
||||||
|
return 0;
|
||||||
|
} // If multiple durations are defined, take the first
|
||||||
|
|
||||||
|
|
||||||
|
transitionDuration = transitionDuration.split(',')[0];
|
||||||
|
transitionDelay = transitionDelay.split(',')[0];
|
||||||
|
return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
|
||||||
|
},
|
||||||
|
reflow: function reflow(element) {
|
||||||
|
return element.offsetHeight;
|
||||||
|
},
|
||||||
|
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
||||||
|
$(element).trigger(TRANSITION_END);
|
||||||
|
},
|
||||||
|
// TODO: Remove in v5
|
||||||
|
supportsTransitionEnd: function supportsTransitionEnd() {
|
||||||
|
return Boolean(TRANSITION_END);
|
||||||
|
},
|
||||||
|
isElement: function isElement(obj) {
|
||||||
|
return (obj[0] || obj).nodeType;
|
||||||
|
},
|
||||||
|
typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
|
||||||
|
for (var property in configTypes) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
|
||||||
|
var expectedTypes = configTypes[property];
|
||||||
|
var value = config[property];
|
||||||
|
var valueType = value && Util.isElement(value) ? 'element' : toType(value);
|
||||||
|
|
||||||
|
if (!new RegExp(expectedTypes).test(valueType)) {
|
||||||
|
throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
findShadowRoot: function findShadowRoot(element) {
|
||||||
|
if (!document.documentElement.attachShadow) {
|
||||||
|
return null;
|
||||||
|
} // Can find the shadow root otherwise it'll return the document
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof element.getRootNode === 'function') {
|
||||||
|
var root = element.getRootNode();
|
||||||
|
return root instanceof ShadowRoot ? root : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (element instanceof ShadowRoot) {
|
||||||
|
return element;
|
||||||
|
} // when we don't find a shadow root
|
||||||
|
|
||||||
|
|
||||||
|
if (!element.parentNode) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Util.findShadowRoot(element.parentNode);
|
||||||
|
},
|
||||||
|
jQueryDetection: function jQueryDetection() {
|
||||||
|
if (typeof $ === 'undefined') {
|
||||||
|
throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
|
||||||
|
}
|
||||||
|
|
||||||
|
var version = $.fn.jquery.split(' ')[0].split('.');
|
||||||
|
var minMajor = 1;
|
||||||
|
var ltMajor = 2;
|
||||||
|
var minMinor = 9;
|
||||||
|
var minPatch = 1;
|
||||||
|
var maxMajor = 4;
|
||||||
|
|
||||||
|
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
|
||||||
|
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Util.jQueryDetection();
|
||||||
|
setTransitionEndSupport();
|
||||||
|
|
||||||
|
return Util;
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=util.js.map
|
BIN
assets/bootstrap-4.5.2/js/dist/util.js.map
vendored
Normal file
BIN
assets/bootstrap-4.5.2/js/dist/util.js.map
vendored
Normal file
Binary file not shown.
173
assets/bootstrap-4.5.2/js/src/alert.js
vendored
Normal file
173
assets/bootstrap-4.5.2/js/src/alert.js
vendored
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.2): alert.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
import $ from 'jquery'
|
||||||
|
import Util from './util'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'alert'
|
||||||
|
const VERSION = '4.5.2'
|
||||||
|
const DATA_KEY = 'bs.alert'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const DATA_API_KEY = '.data-api'
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
|
const SELECTOR_DISMISS = '[data-dismiss="alert"]'
|
||||||
|
|
||||||
|
const 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 Alert {
|
||||||
|
constructor(element) {
|
||||||
|
this._element = element
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
|
||||||
|
static get VERSION() {
|
||||||
|
return VERSION
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
close(element) {
|
||||||
|
let rootElement = this._element
|
||||||
|
if (element) {
|
||||||
|
rootElement = this._getRootElement(element)
|
||||||
|
}
|
||||||
|
|
||||||
|
const customEvent = this._triggerCloseEvent(rootElement)
|
||||||
|
|
||||||
|
if (customEvent.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this._removeElement(rootElement)
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY)
|
||||||
|
this._element = null
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_getRootElement(element) {
|
||||||
|
const selector = Util.getSelectorFromElement(element)
|
||||||
|
let parent = false
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
parent = document.querySelector(selector)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!parent) {
|
||||||
|
parent = $(element).closest(`.${CLASS_NAME_ALERT}`)[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent
|
||||||
|
}
|
||||||
|
|
||||||
|
_triggerCloseEvent(element) {
|
||||||
|
const closeEvent = $.Event(EVENT_CLOSE)
|
||||||
|
|
||||||
|
$(element).trigger(closeEvent)
|
||||||
|
return closeEvent
|
||||||
|
}
|
||||||
|
|
||||||
|
_removeElement(element) {
|
||||||
|
$(element).removeClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
if (!$(element).hasClass(CLASS_NAME_FADE)) {
|
||||||
|
this._destroyElement(element)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const transitionDuration = Util.getTransitionDurationFromElement(element)
|
||||||
|
|
||||||
|
$(element)
|
||||||
|
.one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))
|
||||||
|
.emulateTransitionEnd(transitionDuration)
|
||||||
|
}
|
||||||
|
|
||||||
|
_destroyElement(element) {
|
||||||
|
$(element)
|
||||||
|
.detach()
|
||||||
|
.trigger(EVENT_CLOSED)
|
||||||
|
.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
const $element = $(this)
|
||||||
|
let data = $element.data(DATA_KEY)
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Alert(this)
|
||||||
|
$element.data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config === 'close') {
|
||||||
|
data[config](this)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
static _handleDismiss(alertInstance) {
|
||||||
|
return function (event) {
|
||||||
|
if (event) {
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
alertInstance.close(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).on(
|
||||||
|
EVENT_CLICK_DATA_API,
|
||||||
|
SELECTOR_DISMISS,
|
||||||
|
Alert._handleDismiss(new Alert())
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Alert._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Alert
|
||||||
|
$.fn[NAME].noConflict = () => {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Alert._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Alert
|
206
assets/bootstrap-4.5.2/js/src/button.js
vendored
Normal file
206
assets/bootstrap-4.5.2/js/src/button.js
vendored
Normal file
@ -0,0 +1,206 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.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.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 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_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}`
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Button {
|
||||||
|
constructor(element) {
|
||||||
|
this._element = element
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
|
||||||
|
static get VERSION() {
|
||||||
|
return VERSION
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
toggle() {
|
||||||
|
let triggerChangeEvent = true
|
||||||
|
let addAriaPressed = true
|
||||||
|
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)) {
|
||||||
|
triggerChangeEvent = false
|
||||||
|
} else {
|
||||||
|
const activeElement = rootElement.querySelector(SELECTOR_ACTIVE)
|
||||||
|
|
||||||
|
if (activeElement) {
|
||||||
|
$(activeElement).removeClass(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triggerChangeEvent) {
|
||||||
|
// if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
|
||||||
|
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||||
|
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
|
$(input).trigger('change')
|
||||||
|
}
|
||||||
|
|
||||||
|
input.focus()
|
||||||
|
addAriaPressed = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
|
||||||
|
if (addAriaPressed) {
|
||||||
|
this._element.setAttribute('aria-pressed',
|
||||||
|
!this._element.classList.contains(CLASS_NAME_ACTIVE))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triggerChangeEvent) {
|
||||||
|
$(this._element).toggleClass(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY)
|
||||||
|
this._element = null
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Button(this)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config === 'toggle') {
|
||||||
|
data[config]()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document)
|
||||||
|
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, (event) => {
|
||||||
|
let button = event.target
|
||||||
|
const initialButton = button
|
||||||
|
|
||||||
|
if (!$(button).hasClass(CLASS_NAME_BUTTON)) {
|
||||||
|
button = $(button).closest(SELECTOR_BUTTON)[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
|
||||||
|
event.preventDefault() // work around Firefox bug #1540995
|
||||||
|
} else {
|
||||||
|
const inputBtn = button.querySelector(SELECTOR_INPUT)
|
||||||
|
|
||||||
|
if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
|
||||||
|
event.preventDefault() // work around Firefox bug #1540995
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (initialButton.tagName !== 'LABEL' || inputBtn && inputBtn.type !== 'checkbox') {
|
||||||
|
Button._jQueryInterface.call($(button), 'toggle')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, (event) => {
|
||||||
|
const button = $(event.target).closest(SELECTOR_BUTTON)[0]
|
||||||
|
$(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type))
|
||||||
|
})
|
||||||
|
|
||||||
|
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||||
|
// ensure correct active class is set to match the controls' actual values/states
|
||||||
|
|
||||||
|
// find all checkboxes/readio buttons inside data-toggle groups
|
||||||
|
let buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS))
|
||||||
|
for (let i = 0, len = buttons.length; i < len; i++) {
|
||||||
|
const button = buttons[i]
|
||||||
|
const input = button.querySelector(SELECTOR_INPUT)
|
||||||
|
if (input.checked || input.hasAttribute('checked')) {
|
||||||
|
button.classList.add(CLASS_NAME_ACTIVE)
|
||||||
|
} else {
|
||||||
|
button.classList.remove(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// find all button toggles
|
||||||
|
buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||||
|
for (let i = 0, len = buttons.length; i < len; i++) {
|
||||||
|
const button = buttons[i]
|
||||||
|
if (button.getAttribute('aria-pressed') === 'true') {
|
||||||
|
button.classList.add(CLASS_NAME_ACTIVE)
|
||||||
|
} else {
|
||||||
|
button.classList.remove(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Button._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Button
|
||||||
|
$.fn[NAME].noConflict = () => {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Button._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Button
|
598
assets/bootstrap-4.5.2/js/src/carousel.js
vendored
Normal file
598
assets/bootstrap-4.5.2/js/src/carousel.js
vendored
Normal file
@ -0,0 +1,598 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.2): carousel.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
import $ from 'jquery'
|
||||||
|
import Util from './util'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'carousel'
|
||||||
|
const VERSION = '4.5.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 Default = {
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
class Carousel {
|
||||||
|
constructor(element, config) {
|
||||||
|
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._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._addEventListeners()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
|
||||||
|
static get VERSION() {
|
||||||
|
return VERSION
|
||||||
|
}
|
||||||
|
|
||||||
|
static get Default() {
|
||||||
|
return Default
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
next() {
|
||||||
|
if (!this._isSliding) {
|
||||||
|
this._slide(DIRECTION_NEXT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nextWhenVisible() {
|
||||||
|
// 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')) {
|
||||||
|
this.next()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prev() {
|
||||||
|
if (!this._isSliding) {
|
||||||
|
this._slide(DIRECTION_PREV)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pause(event) {
|
||||||
|
if (!event) {
|
||||||
|
this._isPaused = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
|
||||||
|
Util.triggerTransitionEnd(this._element)
|
||||||
|
this.cycle(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
clearInterval(this._interval)
|
||||||
|
this._interval = null
|
||||||
|
}
|
||||||
|
|
||||||
|
cycle(event) {
|
||||||
|
if (!event) {
|
||||||
|
this._isPaused = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._interval) {
|
||||||
|
clearInterval(this._interval)
|
||||||
|
this._interval = null
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._config.interval && !this._isPaused) {
|
||||||
|
this._interval = setInterval(
|
||||||
|
(document.visibilityState ? this.nextWhenVisible : this.next).bind(this),
|
||||||
|
this._config.interval
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
to(index) {
|
||||||
|
this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||||
|
|
||||||
|
const activeIndex = this._getItemIndex(this._activeElement)
|
||||||
|
|
||||||
|
if (index > this._items.length - 1 || index < 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._isSliding) {
|
||||||
|
$(this._element).one(EVENT_SLID, () => this.to(index))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (activeIndex === index) {
|
||||||
|
this.pause()
|
||||||
|
this.cycle()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const direction = index > activeIndex
|
||||||
|
? DIRECTION_NEXT
|
||||||
|
: DIRECTION_PREV
|
||||||
|
|
||||||
|
this._slide(direction, this._items[index])
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
$(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._indicatorsElement = null
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_getConfig(config) {
|
||||||
|
config = {
|
||||||
|
...Default,
|
||||||
|
...config
|
||||||
|
}
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType)
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleSwipe() {
|
||||||
|
const absDeltax = Math.abs(this.touchDeltaX)
|
||||||
|
|
||||||
|
if (absDeltax <= SWIPE_THRESHOLD) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const direction = absDeltax / this.touchDeltaX
|
||||||
|
|
||||||
|
this.touchDeltaX = 0
|
||||||
|
|
||||||
|
// swipe left
|
||||||
|
if (direction > 0) {
|
||||||
|
this.prev()
|
||||||
|
}
|
||||||
|
|
||||||
|
// swipe right
|
||||||
|
if (direction < 0) {
|
||||||
|
this.next()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_addEventListeners() {
|
||||||
|
if (this._config.keyboard) {
|
||||||
|
$(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))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._config.touch) {
|
||||||
|
this._addTouchEventListeners()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_addTouchEventListeners() {
|
||||||
|
if (!this._touchSupported) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const start = (event) => {
|
||||||
|
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||||
|
this.touchStartX = event.originalEvent.clientX
|
||||||
|
} else if (!this._pointerEvent) {
|
||||||
|
this.touchStartX = event.originalEvent.touches[0].clientX
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const end = (event) => {
|
||||||
|
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||||
|
this.touchDeltaX = event.originalEvent.clientX - this.touchStartX
|
||||||
|
}
|
||||||
|
|
||||||
|
this._handleSwipe()
|
||||||
|
if (this._config.pause === 'hover') {
|
||||||
|
// If it's a touch-enabled device, mouseenter/leave are fired as
|
||||||
|
// part of the mouse compatibility events on first tap - the carousel
|
||||||
|
// would stop cycling until user tapped out of it;
|
||||||
|
// here, we listen for touchend, explicitly pause the carousel
|
||||||
|
// (as if it's the second time we tap on it, mouseenter compat event
|
||||||
|
// is NOT fired) and after a timeout (to allow for mouse compatibility
|
||||||
|
// events to fire) we explicitly restart cycling
|
||||||
|
|
||||||
|
this.pause()
|
||||||
|
if (this.touchTimeout) {
|
||||||
|
clearTimeout(this.touchTimeout)
|
||||||
|
}
|
||||||
|
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())
|
||||||
|
|
||||||
|
if (this._pointerEvent) {
|
||||||
|
$(this._element).on(EVENT_POINTERDOWN, (event) => start(event))
|
||||||
|
$(this._element).on(EVENT_POINTERUP, (event) => end(event))
|
||||||
|
|
||||||
|
this._element.classList.add(CLASS_NAME_POINTER_EVENT)
|
||||||
|
} else {
|
||||||
|
$(this._element).on(EVENT_TOUCHSTART, (event) => start(event))
|
||||||
|
$(this._element).on(EVENT_TOUCHMOVE, (event) => move(event))
|
||||||
|
$(this._element).on(EVENT_TOUCHEND, (event) => end(event))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_keydown(event) {
|
||||||
|
if (/input|textarea/i.test(event.target.tagName)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (event.which) {
|
||||||
|
case ARROW_LEFT_KEYCODE:
|
||||||
|
event.preventDefault()
|
||||||
|
this.prev()
|
||||||
|
break
|
||||||
|
case ARROW_RIGHT_KEYCODE:
|
||||||
|
event.preventDefault()
|
||||||
|
this.next()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_getItemIndex(element) {
|
||||||
|
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 ||
|
||||||
|
isNextDirection && activeIndex === lastItemIndex
|
||||||
|
|
||||||
|
if (isGoingToWrap && !this._config.wrap) {
|
||||||
|
return activeElement
|
||||||
|
}
|
||||||
|
|
||||||
|
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]
|
||||||
|
}
|
||||||
|
|
||||||
|
_triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||||
|
const targetIndex = this._getItemIndex(relatedTarget)
|
||||||
|
const fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM))
|
||||||
|
const slideEvent = $.Event(EVENT_SLIDE, {
|
||||||
|
relatedTarget,
|
||||||
|
direction: eventDirectionName,
|
||||||
|
from: fromIndex,
|
||||||
|
to: targetIndex
|
||||||
|
})
|
||||||
|
|
||||||
|
$(this._element).trigger(slideEvent)
|
||||||
|
|
||||||
|
return slideEvent
|
||||||
|
}
|
||||||
|
|
||||||
|
_setActiveIndicatorElement(element) {
|
||||||
|
if (this._indicatorsElement) {
|
||||||
|
const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE))
|
||||||
|
$(indicators).removeClass(CLASS_NAME_ACTIVE)
|
||||||
|
|
||||||
|
const nextIndicator = this._indicatorsElement.children[
|
||||||
|
this._getItemIndex(element)
|
||||||
|
]
|
||||||
|
|
||||||
|
if (nextIndicator) {
|
||||||
|
$(nextIndicator).addClass(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_slide(direction, element) {
|
||||||
|
const activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||||
|
const activeElementIndex = this._getItemIndex(activeElement)
|
||||||
|
const nextElement = element || activeElement &&
|
||||||
|
this._getItemByDirection(direction, activeElement)
|
||||||
|
const nextElementIndex = this._getItemIndex(nextElement)
|
||||||
|
const isCycling = Boolean(this._interval)
|
||||||
|
|
||||||
|
let directionalClassName
|
||||||
|
let orderClassName
|
||||||
|
let eventDirectionName
|
||||||
|
|
||||||
|
if (direction === DIRECTION_NEXT) {
|
||||||
|
directionalClassName = CLASS_NAME_LEFT
|
||||||
|
orderClassName = CLASS_NAME_NEXT
|
||||||
|
eventDirectionName = DIRECTION_LEFT
|
||||||
|
} else {
|
||||||
|
directionalClassName = CLASS_NAME_RIGHT
|
||||||
|
orderClassName = CLASS_NAME_PREV
|
||||||
|
eventDirectionName = DIRECTION_RIGHT
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE)) {
|
||||||
|
this._isSliding = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)
|
||||||
|
if (slideEvent.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!activeElement || !nextElement) {
|
||||||
|
// Some weirdness is happening, so we bail
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isSliding = true
|
||||||
|
|
||||||
|
if (isCycling) {
|
||||||
|
this.pause()
|
||||||
|
}
|
||||||
|
|
||||||
|
this._setActiveIndicatorElement(nextElement)
|
||||||
|
|
||||||
|
const slidEvent = $.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)
|
||||||
|
|
||||||
|
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)
|
||||||
|
.one(Util.TRANSITION_END, () => {
|
||||||
|
$(nextElement)
|
||||||
|
.removeClass(`${directionalClassName} ${orderClassName}`)
|
||||||
|
.addClass(CLASS_NAME_ACTIVE)
|
||||||
|
|
||||||
|
$(activeElement).removeClass(`${CLASS_NAME_ACTIVE} ${orderClassName} ${directionalClassName}`)
|
||||||
|
|
||||||
|
this._isSliding = false
|
||||||
|
|
||||||
|
setTimeout(() => $(this._element).trigger(slidEvent), 0)
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd(transitionDuration)
|
||||||
|
} else {
|
||||||
|
$(activeElement).removeClass(CLASS_NAME_ACTIVE)
|
||||||
|
$(nextElement).addClass(CLASS_NAME_ACTIVE)
|
||||||
|
|
||||||
|
this._isSliding = false
|
||||||
|
$(this._element).trigger(slidEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isCycling) {
|
||||||
|
this.cycle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
let _config = {
|
||||||
|
...Default,
|
||||||
|
...$(this).data()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'object') {
|
||||||
|
_config = {
|
||||||
|
..._config,
|
||||||
|
...config
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const action = typeof config === 'string' ? config : _config.slide
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Carousel(this, _config)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'number') {
|
||||||
|
data.to(config)
|
||||||
|
} else if (typeof action === 'string') {
|
||||||
|
if (typeof data[action] === 'undefined') {
|
||||||
|
throw new TypeError(`No method named "${action}"`)
|
||||||
|
}
|
||||||
|
data[action]()
|
||||||
|
} else if (_config.interval && _config.ride) {
|
||||||
|
data.pause()
|
||||||
|
data.cycle()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
static _dataApiClickHandler(event) {
|
||||||
|
const selector = Util.getSelectorFromElement(this)
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const target = $(selector)[0]
|
||||||
|
|
||||||
|
if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
...$(target).data(),
|
||||||
|
...$(this).data()
|
||||||
|
}
|
||||||
|
const slideIndex = this.getAttribute('data-slide-to')
|
||||||
|
|
||||||
|
if (slideIndex) {
|
||||||
|
config.interval = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel._jQueryInterface.call($(target), config)
|
||||||
|
|
||||||
|
if (slideIndex) {
|
||||||
|
$(target).data(DATA_KEY).to(slideIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler)
|
||||||
|
|
||||||
|
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||||
|
const carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE))
|
||||||
|
for (let i = 0, len = carousels.length; i < len; i++) {
|
||||||
|
const $carousel = $(carousels[i])
|
||||||
|
Carousel._jQueryInterface.call($carousel, $carousel.data())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Carousel._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Carousel
|
||||||
|
$.fn[NAME].noConflict = () => {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Carousel._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Carousel
|
391
assets/bootstrap-4.5.2/js/src/collapse.js
vendored
Normal file
391
assets/bootstrap-4.5.2/js/src/collapse.js
vendored
Normal file
@ -0,0 +1,391 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.2): collapse.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
import $ from 'jquery'
|
||||||
|
import Util from './util'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'collapse'
|
||||||
|
const VERSION = '4.5.2'
|
||||||
|
const DATA_KEY = 'bs.collapse'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const DATA_API_KEY = '.data-api'
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
toggle : true,
|
||||||
|
parent : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
const DefaultType = {
|
||||||
|
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 Collapse {
|
||||||
|
constructor(element, config) {
|
||||||
|
this._isTransitioning = false
|
||||||
|
this._element = element
|
||||||
|
this._config = this._getConfig(config)
|
||||||
|
this._triggerArray = [].slice.call(document.querySelectorAll(
|
||||||
|
`[data-toggle="collapse"][href="#${element.id}"],` +
|
||||||
|
`[data-toggle="collapse"][data-target="#${element.id}"]`
|
||||||
|
))
|
||||||
|
|
||||||
|
const toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||||
|
for (let i = 0, len = toggleList.length; i < len; i++) {
|
||||||
|
const elem = toggleList[i]
|
||||||
|
const selector = Util.getSelectorFromElement(elem)
|
||||||
|
const filterElement = [].slice.call(document.querySelectorAll(selector))
|
||||||
|
.filter((foundElem) => foundElem === element)
|
||||||
|
|
||||||
|
if (selector !== null && filterElement.length > 0) {
|
||||||
|
this._selector = selector
|
||||||
|
this._triggerArray.push(elem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this._parent = this._config.parent ? this._getParent() : null
|
||||||
|
|
||||||
|
if (!this._config.parent) {
|
||||||
|
this._addAriaAndCollapsedClass(this._element, this._triggerArray)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._config.toggle) {
|
||||||
|
this.toggle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
|
||||||
|
static get VERSION() {
|
||||||
|
return VERSION
|
||||||
|
}
|
||||||
|
|
||||||
|
static get Default() {
|
||||||
|
return Default
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
toggle() {
|
||||||
|
if ($(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
this.hide()
|
||||||
|
} else {
|
||||||
|
this.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
show() {
|
||||||
|
if (this._isTransitioning ||
|
||||||
|
$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let actives
|
||||||
|
let activesData
|
||||||
|
|
||||||
|
if (this._parent) {
|
||||||
|
actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES))
|
||||||
|
.filter((elem) => {
|
||||||
|
if (typeof this._config.parent === 'string') {
|
||||||
|
return elem.getAttribute('data-parent') === this._config.parent
|
||||||
|
}
|
||||||
|
|
||||||
|
return elem.classList.contains(CLASS_NAME_COLLAPSE)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (actives.length === 0) {
|
||||||
|
actives = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actives) {
|
||||||
|
activesData = $(actives).not(this._selector).data(DATA_KEY)
|
||||||
|
if (activesData && activesData._isTransitioning) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const startEvent = $.Event(EVENT_SHOW)
|
||||||
|
$(this._element).trigger(startEvent)
|
||||||
|
if (startEvent.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actives) {
|
||||||
|
Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide')
|
||||||
|
if (!activesData) {
|
||||||
|
$(actives).data(DATA_KEY, null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const dimension = this._getDimension()
|
||||||
|
|
||||||
|
$(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)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setTransitioning(true)
|
||||||
|
|
||||||
|
const complete = () => {
|
||||||
|
$(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)
|
||||||
|
}
|
||||||
|
|
||||||
|
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)
|
||||||
|
const scrollSize = `scroll${capitalizedDimension}`
|
||||||
|
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||||
|
|
||||||
|
$(this._element)
|
||||||
|
.one(Util.TRANSITION_END, complete)
|
||||||
|
.emulateTransitionEnd(transitionDuration)
|
||||||
|
|
||||||
|
this._element.style[dimension] = `${this._element[scrollSize]}px`
|
||||||
|
}
|
||||||
|
|
||||||
|
hide() {
|
||||||
|
if (this._isTransitioning ||
|
||||||
|
!$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const startEvent = $.Event(EVENT_HIDE)
|
||||||
|
$(this._element).trigger(startEvent)
|
||||||
|
if (startEvent.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const 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}`)
|
||||||
|
|
||||||
|
const triggerArrayLength = this._triggerArray.length
|
||||||
|
if (triggerArrayLength > 0) {
|
||||||
|
for (let i = 0; i < triggerArrayLength; i++) {
|
||||||
|
const trigger = this._triggerArray[i]
|
||||||
|
const selector = Util.getSelectorFromElement(trigger)
|
||||||
|
|
||||||
|
if (selector !== null) {
|
||||||
|
const $elem = $([].slice.call(document.querySelectorAll(selector)))
|
||||||
|
if (!$elem.hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
$(trigger).addClass(CLASS_NAME_COLLAPSED)
|
||||||
|
.attr('aria-expanded', false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setTransitioning(true)
|
||||||
|
|
||||||
|
const complete = () => {
|
||||||
|
this.setTransitioning(false)
|
||||||
|
$(this._element)
|
||||||
|
.removeClass(CLASS_NAME_COLLAPSING)
|
||||||
|
.addClass(CLASS_NAME_COLLAPSE)
|
||||||
|
.trigger(EVENT_HIDDEN)
|
||||||
|
}
|
||||||
|
|
||||||
|
this._element.style[dimension] = ''
|
||||||
|
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||||
|
|
||||||
|
$(this._element)
|
||||||
|
.one(Util.TRANSITION_END, complete)
|
||||||
|
.emulateTransitionEnd(transitionDuration)
|
||||||
|
}
|
||||||
|
|
||||||
|
setTransitioning(isTransitioning) {
|
||||||
|
this._isTransitioning = isTransitioning
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY)
|
||||||
|
|
||||||
|
this._config = null
|
||||||
|
this._parent = null
|
||||||
|
this._element = null
|
||||||
|
this._triggerArray = null
|
||||||
|
this._isTransitioning = null
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_getConfig(config) {
|
||||||
|
config = {
|
||||||
|
...Default,
|
||||||
|
...config
|
||||||
|
}
|
||||||
|
config.toggle = Boolean(config.toggle) // Coerce string values
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType)
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
|
||||||
|
_getDimension() {
|
||||||
|
const hasWidth = $(this._element).hasClass(DIMENSION_WIDTH)
|
||||||
|
return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT
|
||||||
|
}
|
||||||
|
|
||||||
|
_getParent() {
|
||||||
|
let parent
|
||||||
|
|
||||||
|
if (Util.isElement(this._config.parent)) {
|
||||||
|
parent = this._config.parent
|
||||||
|
|
||||||
|
// It's a jQuery object
|
||||||
|
if (typeof this._config.parent.jquery !== 'undefined') {
|
||||||
|
parent = this._config.parent[0]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
parent = document.querySelector(this._config.parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
const selector = `[data-toggle="collapse"][data-parent="${this._config.parent}"]`
|
||||||
|
const children = [].slice.call(parent.querySelectorAll(selector))
|
||||||
|
|
||||||
|
$(children).each((i, element) => {
|
||||||
|
this._addAriaAndCollapsedClass(
|
||||||
|
Collapse._getTargetFromElement(element),
|
||||||
|
[element]
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
return parent
|
||||||
|
}
|
||||||
|
|
||||||
|
_addAriaAndCollapsedClass(element, triggerArray) {
|
||||||
|
const isOpen = $(element).hasClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
if (triggerArray.length) {
|
||||||
|
$(triggerArray)
|
||||||
|
.toggleClass(CLASS_NAME_COLLAPSED, !isOpen)
|
||||||
|
.attr('aria-expanded', isOpen)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _getTargetFromElement(element) {
|
||||||
|
const selector = Util.getSelectorFromElement(element)
|
||||||
|
return selector ? document.querySelector(selector) : null
|
||||||
|
}
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
const $this = $(this)
|
||||||
|
let data = $this.data(DATA_KEY)
|
||||||
|
const _config = {
|
||||||
|
...Default,
|
||||||
|
...$this.data(),
|
||||||
|
...typeof config === 'object' && config ? config : {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||||
|
_config.toggle = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Collapse(this, _config)
|
||||||
|
$this.data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError(`No method named "${config}"`)
|
||||||
|
}
|
||||||
|
data[config]()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(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()
|
||||||
|
}
|
||||||
|
|
||||||
|
const $trigger = $(this)
|
||||||
|
const selector = Util.getSelectorFromElement(this)
|
||||||
|
const selectors = [].slice.call(document.querySelectorAll(selector))
|
||||||
|
|
||||||
|
$(selectors).each(function () {
|
||||||
|
const $target = $(this)
|
||||||
|
const data = $target.data(DATA_KEY)
|
||||||
|
const config = data ? 'toggle' : $trigger.data()
|
||||||
|
Collapse._jQueryInterface.call($target, config)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Collapse._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Collapse
|
||||||
|
$.fn[NAME].noConflict = () => {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Collapse._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Collapse
|
534
assets/bootstrap-4.5.2/js/src/dropdown.js
vendored
Normal file
534
assets/bootstrap-4.5.2/js/src/dropdown.js
vendored
Normal file
@ -0,0 +1,534 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.2): dropdown.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
import $ from 'jquery'
|
||||||
|
import Popper from 'popper.js'
|
||||||
|
import Util from './util'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'dropdown'
|
||||||
|
const VERSION = '4.5.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 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_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 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_BOTTOMEND = 'bottom-end'
|
||||||
|
const PLACEMENT_RIGHT = 'right-start'
|
||||||
|
const PLACEMENT_LEFT = 'left-start'
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
offset : 0,
|
||||||
|
flip : true,
|
||||||
|
boundary : 'scrollParent',
|
||||||
|
reference : 'toggle',
|
||||||
|
display : 'dynamic',
|
||||||
|
popperConfig : null
|
||||||
|
}
|
||||||
|
|
||||||
|
const DefaultType = {
|
||||||
|
offset : '(number|string|function)',
|
||||||
|
flip : 'boolean',
|
||||||
|
boundary : '(string|element)',
|
||||||
|
reference : '(string|element)',
|
||||||
|
display : 'string',
|
||||||
|
popperConfig : '(null|object)'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Dropdown {
|
||||||
|
constructor(element, config) {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
static get Default() {
|
||||||
|
return Default
|
||||||
|
}
|
||||||
|
|
||||||
|
static get DefaultType() {
|
||||||
|
return DefaultType
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
toggle() {
|
||||||
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const isActive = $(this._menu).hasClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
Dropdown._clearMenus()
|
||||||
|
|
||||||
|
if (isActive) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.show(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
show(usePopper = false) {
|
||||||
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedTarget = {
|
||||||
|
relatedTarget: this._element
|
||||||
|
}
|
||||||
|
const showEvent = $.Event(EVENT_SHOW, relatedTarget)
|
||||||
|
const parent = Dropdown._getParentFromElement(this._element)
|
||||||
|
|
||||||
|
$(parent).trigger(showEvent)
|
||||||
|
|
||||||
|
if (showEvent.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable totally Popper.js for Dropdown 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/)')
|
||||||
|
}
|
||||||
|
|
||||||
|
let referenceElement = this._element
|
||||||
|
|
||||||
|
if (this._config.reference === 'parent') {
|
||||||
|
referenceElement = parent
|
||||||
|
} else if (Util.isElement(this._config.reference)) {
|
||||||
|
referenceElement = this._config.reference
|
||||||
|
|
||||||
|
// Check if it's jQuery element
|
||||||
|
if (typeof this._config.reference.jquery !== 'undefined') {
|
||||||
|
referenceElement = this._config.reference[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If boundary is not `scrollParent`, then set position to `static`
|
||||||
|
// to allow the menu to "escape" the scroll parent's boundaries
|
||||||
|
// https://github.com/twbs/bootstrap/issues/24251
|
||||||
|
if (this._config.boundary !== 'scrollParent') {
|
||||||
|
$(parent).addClass(CLASS_NAME_POSITION_STATIC)
|
||||||
|
}
|
||||||
|
this._popper = new Popper(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)
|
||||||
|
}
|
||||||
|
|
||||||
|
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))
|
||||||
|
}
|
||||||
|
|
||||||
|
hide() {
|
||||||
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedTarget = {
|
||||||
|
relatedTarget: this._element
|
||||||
|
}
|
||||||
|
const hideEvent = $.Event(EVENT_HIDE, relatedTarget)
|
||||||
|
const parent = Dropdown._getParentFromElement(this._element)
|
||||||
|
|
||||||
|
$(parent).trigger(hideEvent)
|
||||||
|
|
||||||
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._popper) {
|
||||||
|
this._popper.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._menu).toggleClass(CLASS_NAME_SHOW)
|
||||||
|
$(parent)
|
||||||
|
.toggleClass(CLASS_NAME_SHOW)
|
||||||
|
.trigger($.Event(EVENT_HIDDEN, relatedTarget))
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY)
|
||||||
|
$(this._element).off(EVENT_KEY)
|
||||||
|
this._element = null
|
||||||
|
this._menu = null
|
||||||
|
if (this._popper !== null) {
|
||||||
|
this._popper.destroy()
|
||||||
|
this._popper = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
this._inNavbar = this._detectNavbar()
|
||||||
|
if (this._popper !== null) {
|
||||||
|
this._popper.scheduleUpdate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_addEventListeners() {
|
||||||
|
$(this._element).on(EVENT_CLICK, (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
this.toggle()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_getConfig(config) {
|
||||||
|
config = {
|
||||||
|
...this.constructor.Default,
|
||||||
|
...$(this._element).data(),
|
||||||
|
...config
|
||||||
|
}
|
||||||
|
|
||||||
|
Util.typeCheckConfig(
|
||||||
|
NAME,
|
||||||
|
config,
|
||||||
|
this.constructor.DefaultType
|
||||||
|
)
|
||||||
|
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
|
||||||
|
_getMenuElement() {
|
||||||
|
if (!this._menu) {
|
||||||
|
const parent = Dropdown._getParentFromElement(this._element)
|
||||||
|
|
||||||
|
if (parent) {
|
||||||
|
this._menu = parent.querySelector(SELECTOR_MENU)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this._menu
|
||||||
|
}
|
||||||
|
|
||||||
|
_getPlacement() {
|
||||||
|
const $parentDropdown = $(this._element.parentNode)
|
||||||
|
let placement = PLACEMENT_BOTTOM
|
||||||
|
|
||||||
|
// Handle dropup
|
||||||
|
if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
|
||||||
|
placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT)
|
||||||
|
? PLACEMENT_TOPEND
|
||||||
|
: PLACEMENT_TOP
|
||||||
|
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
|
||||||
|
placement = PLACEMENT_RIGHT
|
||||||
|
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
|
||||||
|
placement = PLACEMENT_LEFT
|
||||||
|
} else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
|
||||||
|
placement = PLACEMENT_BOTTOMEND
|
||||||
|
}
|
||||||
|
return placement
|
||||||
|
}
|
||||||
|
|
||||||
|
_detectNavbar() {
|
||||||
|
return $(this._element).closest('.navbar').length > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
_getOffset() {
|
||||||
|
const offset = {}
|
||||||
|
|
||||||
|
if (typeof this._config.offset === 'function') {
|
||||||
|
offset.fn = (data) => {
|
||||||
|
data.offsets = {
|
||||||
|
...data.offsets,
|
||||||
|
...this._config.offset(data.offsets, this._element) || {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
offset.offset = this._config.offset
|
||||||
|
}
|
||||||
|
|
||||||
|
return offset
|
||||||
|
}
|
||||||
|
|
||||||
|
_getPopperConfig() {
|
||||||
|
const popperConfig = {
|
||||||
|
placement: this._getPlacement(),
|
||||||
|
modifiers: {
|
||||||
|
offset: this._getOffset(),
|
||||||
|
flip: {
|
||||||
|
enabled: this._config.flip
|
||||||
|
},
|
||||||
|
preventOverflow: {
|
||||||
|
boundariesElement: this._config.boundary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable Popper.js if we have a static display
|
||||||
|
if (this._config.display === 'static') {
|
||||||
|
popperConfig.modifiers.applyStyle = {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...popperConfig,
|
||||||
|
...this._config.popperConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _config = typeof config === 'object' ? config : null
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Dropdown(this, _config)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError(`No method named "${config}"`)
|
||||||
|
}
|
||||||
|
data[config]()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
static _clearMenus(event) {
|
||||||
|
if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH ||
|
||||||
|
event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||||
|
|
||||||
|
for (let i = 0, len = toggles.length; i < len; i++) {
|
||||||
|
const parent = Dropdown._getParentFromElement(toggles[i])
|
||||||
|
const context = $(toggles[i]).data(DATA_KEY)
|
||||||
|
const relatedTarget = {
|
||||||
|
relatedTarget: toggles[i]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event && event.type === 'click') {
|
||||||
|
relatedTarget.clickEvent = event
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!context) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
const dropdownMenu = context._menu
|
||||||
|
if (!$(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)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideEvent = $.Event(EVENT_HIDE, relatedTarget)
|
||||||
|
$(parent).trigger(hideEvent)
|
||||||
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
toggles[i].setAttribute('aria-expanded', 'false')
|
||||||
|
|
||||||
|
if (context._popper) {
|
||||||
|
context._popper.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
$(dropdownMenu).removeClass(CLASS_NAME_SHOW)
|
||||||
|
$(parent)
|
||||||
|
.removeClass(CLASS_NAME_SHOW)
|
||||||
|
.trigger($.Event(EVENT_HIDDEN, relatedTarget))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static _getParentFromElement(element) {
|
||||||
|
let parent
|
||||||
|
const selector = Util.getSelectorFromElement(element)
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
parent = document.querySelector(selector)
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent || element.parentNode
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
|
static _dataApiKeydownHandler(event) {
|
||||||
|
// If not input/textarea:
|
||||||
|
// - And not a key in REGEXP_KEYDOWN => not a dropdown command
|
||||||
|
// If input/textarea:
|
||||||
|
// - If space key => not a dropdown command
|
||||||
|
// - 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)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const parent = Dropdown._getParentFromElement(this)
|
||||||
|
const isActive = $(parent).hasClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
|
||||||
|
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||||
|
if (event.which === ESCAPE_KEYCODE) {
|
||||||
|
$(parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus')
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this).trigger('click')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS))
|
||||||
|
.filter((item) => $(item).is(':visible'))
|
||||||
|
|
||||||
|
if (items.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let index = items.indexOf(event.target)
|
||||||
|
|
||||||
|
if (event.which === ARROW_UP_KEYCODE && index > 0) { // Up
|
||||||
|
index--
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // Down
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index < 0) {
|
||||||
|
index = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
items[index].focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* 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) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
Dropdown._jQueryInterface.call($(this), 'toggle')
|
||||||
|
})
|
||||||
|
.on(EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, (e) => {
|
||||||
|
e.stopPropagation()
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Dropdown._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Dropdown
|
||||||
|
$.fn[NAME].noConflict = () => {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Dropdown._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Dropdown
|
34
assets/bootstrap-4.5.2/js/src/index.js
vendored
Normal file
34
assets/bootstrap-4.5.2/js/src/index.js
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
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.2): index.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
export {
|
||||||
|
Util,
|
||||||
|
Alert,
|
||||||
|
Button,
|
||||||
|
Carousel,
|
||||||
|
Collapse,
|
||||||
|
Dropdown,
|
||||||
|
Modal,
|
||||||
|
Popover,
|
||||||
|
Scrollspy,
|
||||||
|
Tab,
|
||||||
|
Toast,
|
||||||
|
Tooltip
|
||||||
|
}
|
627
assets/bootstrap-4.5.2/js/src/modal.js
vendored
Normal file
627
assets/bootstrap-4.5.2/js/src/modal.js
vendored
Normal file
@ -0,0 +1,627 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.2): modal.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
import $ from 'jquery'
|
||||||
|
import Util from './util'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'modal'
|
||||||
|
const VERSION = '4.5.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 Default = {
|
||||||
|
backdrop : true,
|
||||||
|
keyboard : true,
|
||||||
|
focus : true,
|
||||||
|
show : true
|
||||||
|
}
|
||||||
|
|
||||||
|
const DefaultType = {
|
||||||
|
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 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._ignoreBackdropClick = false
|
||||||
|
this._isTransitioning = false
|
||||||
|
this._scrollbarWidth = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
|
||||||
|
static get VERSION() {
|
||||||
|
return VERSION
|
||||||
|
}
|
||||||
|
|
||||||
|
static get Default() {
|
||||||
|
return Default
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
toggle(relatedTarget) {
|
||||||
|
return this._isShown ? this.hide() : this.show(relatedTarget)
|
||||||
|
}
|
||||||
|
|
||||||
|
show(relatedTarget) {
|
||||||
|
if (this._isShown || this._isTransitioning) {
|
||||||
|
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()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isShown = true
|
||||||
|
|
||||||
|
this._checkScrollbar()
|
||||||
|
this._setScrollbar()
|
||||||
|
|
||||||
|
this._adjustDialog()
|
||||||
|
|
||||||
|
this._setEscapeEvent()
|
||||||
|
this._setResizeEvent()
|
||||||
|
|
||||||
|
$(this._element).on(
|
||||||
|
EVENT_CLICK_DISMISS,
|
||||||
|
SELECTOR_DATA_DISMISS,
|
||||||
|
(event) => this.hide(event)
|
||||||
|
)
|
||||||
|
|
||||||
|
$(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, () => {
|
||||||
|
$(this._element).one(EVENT_MOUSEUP_DISMISS, (event) => {
|
||||||
|
if ($(event.target).is(this._element)) {
|
||||||
|
this._ignoreBackdropClick = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
this._showBackdrop(() => this._showElement(relatedTarget))
|
||||||
|
}
|
||||||
|
|
||||||
|
hide(event) {
|
||||||
|
if (event) {
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this._isShown || this._isTransitioning) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideEvent = $.Event(EVENT_HIDE)
|
||||||
|
|
||||||
|
$(this._element).trigger(hideEvent)
|
||||||
|
|
||||||
|
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isShown = false
|
||||||
|
const transition = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
this._isTransitioning = true
|
||||||
|
}
|
||||||
|
|
||||||
|
this._setEscapeEvent()
|
||||||
|
this._setResizeEvent()
|
||||||
|
|
||||||
|
$(document).off(EVENT_FOCUSIN)
|
||||||
|
|
||||||
|
$(this._element).removeClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
$(this._element).off(EVENT_CLICK_DISMISS)
|
||||||
|
$(this._dialog).off(EVENT_MOUSEDOWN_DISMISS)
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||||
|
|
||||||
|
$(this._element)
|
||||||
|
.one(Util.TRANSITION_END, (event) => this._hideModal(event))
|
||||||
|
.emulateTransitionEnd(transitionDuration)
|
||||||
|
} else {
|
||||||
|
this._hideModal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
[window, this._element, this._dialog]
|
||||||
|
.forEach((htmlElement) => $(htmlElement).off(EVENT_KEY))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||||
|
* Do not move `document` in `htmlElements` array
|
||||||
|
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||||
|
*/
|
||||||
|
$(document).off(EVENT_FOCUSIN)
|
||||||
|
|
||||||
|
$.removeData(this._element, DATA_KEY)
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
handleUpdate() {
|
||||||
|
this._adjustDialog()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_getConfig(config) {
|
||||||
|
config = {
|
||||||
|
...Default,
|
||||||
|
...config
|
||||||
|
}
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType)
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
|
||||||
|
_triggerBackdropTransition() {
|
||||||
|
if (this._config.backdrop === 'static') {
|
||||||
|
const hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED)
|
||||||
|
|
||||||
|
$(this._element).trigger(hideEventPrevented)
|
||||||
|
if (hideEventPrevented.defaultPrevented) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
|
||||||
|
|
||||||
|
if (!isModalOverflowing) {
|
||||||
|
this._element.style.overflowY = 'hidden'
|
||||||
|
}
|
||||||
|
|
||||||
|
this._element.classList.add(CLASS_NAME_STATIC)
|
||||||
|
|
||||||
|
const modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog)
|
||||||
|
$(this._element).off(Util.TRANSITION_END)
|
||||||
|
|
||||||
|
$(this._element).one(Util.TRANSITION_END, () => {
|
||||||
|
this._element.classList.remove(CLASS_NAME_STATIC)
|
||||||
|
if (!isModalOverflowing) {
|
||||||
|
$(this._element).one(Util.TRANSITION_END, () => {
|
||||||
|
this._element.style.overflowY = ''
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd(this._element, modalTransitionDuration)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd(modalTransitionDuration)
|
||||||
|
this._element.focus()
|
||||||
|
} else {
|
||||||
|
this.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_showElement(relatedTarget) {
|
||||||
|
const transition = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||||
|
const modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null
|
||||||
|
|
||||||
|
if (!this._element.parentNode ||
|
||||||
|
this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
||||||
|
// Don't move modal's DOM position
|
||||||
|
document.body.appendChild(this._element)
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
} else {
|
||||||
|
this._element.scrollTop = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
Util.reflow(this._element)
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._element).addClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
if (this._config.focus) {
|
||||||
|
this._enforceFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
const shownEvent = $.Event(EVENT_SHOWN, {
|
||||||
|
relatedTarget
|
||||||
|
})
|
||||||
|
|
||||||
|
const transitionComplete = () => {
|
||||||
|
if (this._config.focus) {
|
||||||
|
this._element.focus()
|
||||||
|
}
|
||||||
|
this._isTransitioning = false
|
||||||
|
$(this._element).trigger(shownEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
const transitionDuration = Util.getTransitionDurationFromElement(this._dialog)
|
||||||
|
|
||||||
|
$(this._dialog)
|
||||||
|
.one(Util.TRANSITION_END, transitionComplete)
|
||||||
|
.emulateTransitionEnd(transitionDuration)
|
||||||
|
} else {
|
||||||
|
transitionComplete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_enforceFocus() {
|
||||||
|
$(document)
|
||||||
|
.off(EVENT_FOCUSIN) // Guard against infinite focus loop
|
||||||
|
.on(EVENT_FOCUSIN, (event) => {
|
||||||
|
if (document !== event.target &&
|
||||||
|
this._element !== event.target &&
|
||||||
|
$(this._element).has(event.target).length === 0) {
|
||||||
|
this._element.focus()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_setEscapeEvent() {
|
||||||
|
if (this._isShown) {
|
||||||
|
$(this._element).on(EVENT_KEYDOWN_DISMISS, (event) => {
|
||||||
|
if (this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||||
|
event.preventDefault()
|
||||||
|
this.hide()
|
||||||
|
} else if (!this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||||
|
this._triggerBackdropTransition()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (!this._isShown) {
|
||||||
|
$(this._element).off(EVENT_KEYDOWN_DISMISS)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_setResizeEvent() {
|
||||||
|
if (this._isShown) {
|
||||||
|
$(window).on(EVENT_RESIZE, (event) => this.handleUpdate(event))
|
||||||
|
} else {
|
||||||
|
$(window).off(EVENT_RESIZE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_hideModal() {
|
||||||
|
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)
|
||||||
|
this._resetAdjustments()
|
||||||
|
this._resetScrollbar()
|
||||||
|
$(this._element).trigger(EVENT_HIDDEN)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_removeBackdrop() {
|
||||||
|
if (this._backdrop) {
|
||||||
|
$(this._backdrop).remove()
|
||||||
|
this._backdrop = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_showBackdrop(callback) {
|
||||||
|
const animate = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||||
|
? CLASS_NAME_FADE : ''
|
||||||
|
|
||||||
|
if (this._isShown && this._config.backdrop) {
|
||||||
|
this._backdrop = document.createElement('div')
|
||||||
|
this._backdrop.className = CLASS_NAME_BACKDROP
|
||||||
|
|
||||||
|
if (animate) {
|
||||||
|
this._backdrop.classList.add(animate)
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._backdrop).appendTo(document.body)
|
||||||
|
|
||||||
|
$(this._element).on(EVENT_CLICK_DISMISS, (event) => {
|
||||||
|
if (this._ignoreBackdropClick) {
|
||||||
|
this._ignoreBackdropClick = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (event.target !== event.currentTarget) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this._triggerBackdropTransition()
|
||||||
|
})
|
||||||
|
|
||||||
|
if (animate) {
|
||||||
|
Util.reflow(this._backdrop)
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._backdrop).addClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
if (!callback) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!animate) {
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)
|
||||||
|
|
||||||
|
$(this._backdrop)
|
||||||
|
.one(Util.TRANSITION_END, callback)
|
||||||
|
.emulateTransitionEnd(backdropTransitionDuration)
|
||||||
|
} else if (!this._isShown && this._backdrop) {
|
||||||
|
$(this._backdrop).removeClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
const callbackRemove = () => {
|
||||||
|
this._removeBackdrop()
|
||||||
|
if (callback) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||||
|
const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)
|
||||||
|
|
||||||
|
$(this._backdrop)
|
||||||
|
.one(Util.TRANSITION_END, callbackRemove)
|
||||||
|
.emulateTransitionEnd(backdropTransitionDuration)
|
||||||
|
} else {
|
||||||
|
callbackRemove()
|
||||||
|
}
|
||||||
|
} else if (callback) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
// the following methods are used to handle overflowing modals
|
||||||
|
// todo (fat): these should probably be refactored out of modal.js
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
_adjustDialog() {
|
||||||
|
const isModalOverflowing =
|
||||||
|
this._element.scrollHeight > document.documentElement.clientHeight
|
||||||
|
|
||||||
|
if (!this._isBodyOverflowing && isModalOverflowing) {
|
||||||
|
this._element.style.paddingLeft = `${this._scrollbarWidth}px`
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._isBodyOverflowing && !isModalOverflowing) {
|
||||||
|
this._element.style.paddingRight = `${this._scrollbarWidth}px`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_resetAdjustments() {
|
||||||
|
this._element.style.paddingLeft = ''
|
||||||
|
this._element.style.paddingRight = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
_checkScrollbar() {
|
||||||
|
const rect = document.body.getBoundingClientRect()
|
||||||
|
this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth
|
||||||
|
this._scrollbarWidth = this._getScrollbarWidth()
|
||||||
|
}
|
||||||
|
|
||||||
|
_setScrollbar() {
|
||||||
|
if (this._isBodyOverflowing) {
|
||||||
|
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||||
|
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
||||||
|
const fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT))
|
||||||
|
const stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT))
|
||||||
|
|
||||||
|
// Adjust fixed content padding
|
||||||
|
$(fixedContent).each((index, element) => {
|
||||||
|
const actualPadding = element.style.paddingRight
|
||||||
|
const calculatedPadding = $(element).css('padding-right')
|
||||||
|
$(element)
|
||||||
|
.data('padding-right', actualPadding)
|
||||||
|
.css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Adjust sticky content margin
|
||||||
|
$(stickyContent).each((index, element) => {
|
||||||
|
const actualMargin = element.style.marginRight
|
||||||
|
const calculatedMargin = $(element).css('margin-right')
|
||||||
|
$(element)
|
||||||
|
.data('margin-right', actualMargin)
|
||||||
|
.css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Adjust body padding
|
||||||
|
const actualPadding = document.body.style.paddingRight
|
||||||
|
const calculatedPadding = $(document.body).css('padding-right')
|
||||||
|
$(document.body)
|
||||||
|
.data('padding-right', actualPadding)
|
||||||
|
.css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document.body).addClass(CLASS_NAME_OPEN)
|
||||||
|
}
|
||||||
|
|
||||||
|
_resetScrollbar() {
|
||||||
|
// Restore fixed content padding
|
||||||
|
const fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT))
|
||||||
|
$(fixedContent).each((index, element) => {
|
||||||
|
const padding = $(element).data('padding-right')
|
||||||
|
$(element).removeData('padding-right')
|
||||||
|
element.style.paddingRight = padding ? padding : ''
|
||||||
|
})
|
||||||
|
|
||||||
|
// Restore sticky content
|
||||||
|
const elements = [].slice.call(document.querySelectorAll(`${SELECTOR_STICKY_CONTENT}`))
|
||||||
|
$(elements).each((index, element) => {
|
||||||
|
const margin = $(element).data('margin-right')
|
||||||
|
if (typeof margin !== 'undefined') {
|
||||||
|
$(element).css('margin-right', margin).removeData('margin-right')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Restore body padding
|
||||||
|
const padding = $(document.body).data('padding-right')
|
||||||
|
$(document.body).removeData('padding-right')
|
||||||
|
document.body.style.paddingRight = padding ? padding : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
_getScrollbarWidth() { // thx d.walsh
|
||||||
|
const scrollDiv = document.createElement('div')
|
||||||
|
scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER
|
||||||
|
document.body.appendChild(scrollDiv)
|
||||||
|
const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth
|
||||||
|
document.body.removeChild(scrollDiv)
|
||||||
|
return scrollbarWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 : {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Modal(this, _config)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError(`No method named "${config}"`)
|
||||||
|
}
|
||||||
|
data[config](relatedTarget)
|
||||||
|
} else if (_config.show) {
|
||||||
|
data.show(relatedTarget)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
|
let target
|
||||||
|
const selector = Util.getSelectorFromElement(this)
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
target = document.querySelector(selector)
|
||||||
|
}
|
||||||
|
|
||||||
|
const config = $(target).data(DATA_KEY)
|
||||||
|
? 'toggle' : {
|
||||||
|
...$(target).data(),
|
||||||
|
...$(this).data()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.tagName === 'A' || this.tagName === 'AREA') {
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
const $target = $(target).one(EVENT_SHOW, (showEvent) => {
|
||||||
|
if (showEvent.isDefaultPrevented()) {
|
||||||
|
// Only register focus restorer if modal will actually get shown
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
$target.one(EVENT_HIDDEN, () => {
|
||||||
|
if ($(this).is(':visible')) {
|
||||||
|
this.focus()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
Modal._jQueryInterface.call($(target), config, this)
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Modal._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Modal
|
||||||
|
$.fn[NAME].noConflict = () => {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Modal._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Modal
|
180
assets/bootstrap-4.5.2/js/src/popover.js
vendored
Normal file
180
assets/bootstrap-4.5.2/js/src/popover.js
vendored
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.2): popover.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
import $ from 'jquery'
|
||||||
|
import Tooltip from './tooltip'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Constants
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'popover'
|
||||||
|
const VERSION = '4.5.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 Default = {
|
||||||
|
...Tooltip.Default,
|
||||||
|
placement : 'right',
|
||||||
|
trigger : 'click',
|
||||||
|
content : '',
|
||||||
|
template : '<div class="popover" role="tooltip">' +
|
||||||
|
'<div class="arrow"></div>' +
|
||||||
|
'<h3 class="popover-header"></h3>' +
|
||||||
|
'<div class="popover-body"></div></div>'
|
||||||
|
}
|
||||||
|
|
||||||
|
const DefaultType = {
|
||||||
|
...Tooltip.DefaultType,
|
||||||
|
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}`
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Popover extends Tooltip {
|
||||||
|
// Getters
|
||||||
|
|
||||||
|
static get VERSION() {
|
||||||
|
return VERSION
|
||||||
|
}
|
||||||
|
|
||||||
|
static get Default() {
|
||||||
|
return Default
|
||||||
|
}
|
||||||
|
|
||||||
|
static get NAME() {
|
||||||
|
return NAME
|
||||||
|
}
|
||||||
|
|
||||||
|
static get DATA_KEY() {
|
||||||
|
return DATA_KEY
|
||||||
|
}
|
||||||
|
|
||||||
|
static get Event() {
|
||||||
|
return Event
|
||||||
|
}
|
||||||
|
|
||||||
|
static get EVENT_KEY() {
|
||||||
|
return EVENT_KEY
|
||||||
|
}
|
||||||
|
|
||||||
|
static get DefaultType() {
|
||||||
|
return DefaultType
|
||||||
|
}
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
|
||||||
|
isWithContent() {
|
||||||
|
return this.getTitle() || this._getContent()
|
||||||
|
}
|
||||||
|
|
||||||
|
addAttachmentClass(attachment) {
|
||||||
|
$(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
getTipElement() {
|
||||||
|
this.tip = this.tip || $(this.config.template)[0]
|
||||||
|
return this.tip
|
||||||
|
}
|
||||||
|
|
||||||
|
setContent() {
|
||||||
|
const $tip = $(this.getTipElement())
|
||||||
|
|
||||||
|
// We use append for html objects to maintain js events
|
||||||
|
this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle())
|
||||||
|
let content = this._getContent()
|
||||||
|
if (typeof content === 'function') {
|
||||||
|
content = content.call(this.element)
|
||||||
|
}
|
||||||
|
this.setElementContent($tip.find(SELECTOR_CONTENT), content)
|
||||||
|
|
||||||
|
$tip.removeClass(`${CLASS_NAME_FADE} ${CLASS_NAME_SHOW}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_getContent() {
|
||||||
|
return this.element.getAttribute('data-content') ||
|
||||||
|
this.config.content
|
||||||
|
}
|
||||||
|
|
||||||
|
_cleanTipClass() {
|
||||||
|
const $tip = $(this.getTipElement())
|
||||||
|
const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)
|
||||||
|
if (tabClass !== null && tabClass.length > 0) {
|
||||||
|
$tip.removeClass(tabClass.join(''))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _config = typeof config === 'object' ? config : null
|
||||||
|
|
||||||
|
if (!data && /dispose|hide/.test(config)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Popover(this, _config)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (typeof data[config] === 'undefined') {
|
||||||
|
throw new TypeError(`No method named "${config}"`)
|
||||||
|
}
|
||||||
|
data[config]()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Popover._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Popover
|
||||||
|
$.fn[NAME].noConflict = () => {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Popover._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Popover
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user