mirror of https://github.com/twbs/bootstrap.git
Merge branch 'main' into pr/34529
This commit is contained in:
commit
69896d1ddb
|
@ -2,59 +2,59 @@
|
|||
"files": [
|
||||
{
|
||||
"path": "./dist/css/bootstrap-grid.css",
|
||||
"maxSize": "7.5 kB"
|
||||
"maxSize": "8.25 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap-grid.min.css",
|
||||
"maxSize": "6.55 kB"
|
||||
"maxSize": "7.5 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap-reboot.css",
|
||||
"maxSize": "2.55 kB"
|
||||
"maxSize": "3.5 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap-reboot.min.css",
|
||||
"maxSize": "2.5 kB"
|
||||
"maxSize": "3.25 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap-utilities.css",
|
||||
"maxSize": "7.75 kB"
|
||||
"maxSize": "10.5 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap-utilities.min.css",
|
||||
"maxSize": "7.0 kB"
|
||||
"maxSize": "9.75 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap.css",
|
||||
"maxSize": "27.75 kB"
|
||||
"maxSize": "31.25 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/css/bootstrap.min.css",
|
||||
"maxSize": "26.0 kB"
|
||||
"maxSize": "29.25 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.bundle.js",
|
||||
"maxSize": "42.5 kB"
|
||||
"maxSize": "43.0 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.bundle.min.js",
|
||||
"maxSize": "22.75 kB"
|
||||
"maxSize": "23.0 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.esm.js",
|
||||
"maxSize": "27.5 kB"
|
||||
"maxSize": "28.0 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.esm.min.js",
|
||||
"maxSize": "18.5 kB"
|
||||
"maxSize": "18.25 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.js",
|
||||
"maxSize": "28.25 kB"
|
||||
"maxSize": "28.75 kB"
|
||||
},
|
||||
{
|
||||
"path": "./dist/js/bootstrap.min.js",
|
||||
"maxSize": "16.25 kB"
|
||||
"maxSize": "16.0 kB"
|
||||
}
|
||||
],
|
||||
"ci": {
|
||||
|
@ -63,4 +63,4 @@
|
|||
"v4-dev"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
"autohiding",
|
||||
"autoplay",
|
||||
"autoplays",
|
||||
"autoplaying",
|
||||
"blazingly",
|
||||
"Blockquotes",
|
||||
"Bootstrappers",
|
||||
|
@ -19,6 +20,7 @@
|
|||
"btnradio",
|
||||
"callout",
|
||||
"callouts",
|
||||
"camelCase",
|
||||
"clearfix",
|
||||
"Codesniffer",
|
||||
"combinator",
|
||||
|
@ -49,6 +51,7 @@
|
|||
"Hoverable",
|
||||
"hreflang",
|
||||
"hstack",
|
||||
"importmap",
|
||||
"jsdelivr",
|
||||
"Jumpstart",
|
||||
"keyframes",
|
||||
|
@ -60,6 +63,8 @@
|
|||
"markdownify",
|
||||
"mediaqueries",
|
||||
"minifiers",
|
||||
"misfunction",
|
||||
"mkdir",
|
||||
"monospace",
|
||||
"mouseleave",
|
||||
"navbars",
|
||||
|
@ -72,7 +77,6 @@
|
|||
"Packagist",
|
||||
"popperjs",
|
||||
"prebuild",
|
||||
"precompiled",
|
||||
"prefersreducedmotion",
|
||||
"prepended",
|
||||
"printf",
|
||||
|
@ -87,7 +91,9 @@
|
|||
"scrollspy",
|
||||
"Segoe",
|
||||
"semibold",
|
||||
"socio",
|
||||
"srcset",
|
||||
"stackblitz",
|
||||
"stickied",
|
||||
"Stylelint",
|
||||
"subnav",
|
||||
|
@ -104,6 +110,7 @@
|
|||
"urlize",
|
||||
"vbtn",
|
||||
"viewports",
|
||||
"Vite",
|
||||
"vstack",
|
||||
"walkthroughs",
|
||||
"WCAG",
|
||||
|
|
|
@ -3,4 +3,6 @@
|
|||
**/vendor/
|
||||
/_site/
|
||||
/js/coverage/
|
||||
/js/tests/integration/
|
||||
/site/static/sw.js
|
||||
/site/layouts/
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
"error",
|
||||
"after"
|
||||
],
|
||||
"prefer-template": "error",
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
|
@ -54,6 +55,7 @@
|
|||
"unicorn/no-array-callback-reference": "off",
|
||||
"unicorn/no-array-method-this-argument": "off",
|
||||
"unicorn/no-null": "off",
|
||||
"unicorn/no-typeof-undefined": "off",
|
||||
"unicorn/no-unused-properties": "error",
|
||||
"unicorn/prefer-array-flat": "off",
|
||||
"unicorn/prefer-dom-node-dataset": "off",
|
||||
|
|
|
@ -18,18 +18,16 @@ the preferred channel for [bug reports](#bug-reports), [features requests](#feat
|
|||
and [submitting pull requests](#pull-requests), but please respect the following
|
||||
restrictions:
|
||||
|
||||
* Please **do not** use the issue tracker for personal support requests. Stack
|
||||
Overflow ([`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5) tag),
|
||||
[Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](/README.md#community) are better places to get help.
|
||||
- Please **do not** use the issue tracker for personal support requests. Stack Overflow ([`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5) tag), [our GitHub Discussions](https://github.com/twbs/bootstrap/discussions) or [IRC](/README.md#community) are better places to get help.
|
||||
|
||||
* Please **do not** derail or troll issues. Keep the discussion on topic and
|
||||
- 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:".
|
||||
- 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/>.
|
||||
- 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`.
|
||||
|
||||
|
||||
|
@ -69,7 +67,7 @@ Guidelines for bug reports:
|
|||
|
||||
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.
|
||||
These [v4 CodePen](https://codepen.io/team/bootstrap/pen/yLabNQL) and [v5 CodePen](https://codepen.io/team/bootstrap/pen/qBamdLj) are helpful templates.
|
||||
|
||||
|
||||
A good bug report shouldn't leave others needing to chase you up for more
|
||||
|
@ -103,16 +101,16 @@ Sometimes bugs reported to us are actually caused by bugs in the browser(s) them
|
|||
|
||||
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
|
||||
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------ | -------------------------------------------------------- |
|
||||
| Mozilla | Firefox | Gecko | https://bugzilla.mozilla.org/enter_bug.cgi | "Core" is normally the right product option to choose. |
|
||||
| Apple | Safari | WebKit | https://bugs.webkit.org/enter_bug.cgi?product=WebKit | In Apple's bug reporter, choose "Safari" as the product. |
|
||||
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | https://bugs.chromium.org/p/chromium/issues/list | Click the "New issue" button. |
|
||||
| Microsoft | Edge | Blink | https://developer.microsoft.com/en-us/microsoft-edge/ | Go to "Help > Send Feedback" from the browser |
|
||||
| Mozilla | Firefox | Gecko | <https://bugzilla.mozilla.org/enter_bug.cgi> | "Core" is normally the right product option to choose. |
|
||||
| Apple | Safari | WebKit | <https://bugs.webkit.org/enter_bug.cgi?product=WebKit> | In Apple's bug reporter, choose "Safari" as the product. |
|
||||
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | <https://bugs.chromium.org/p/chromium/issues/list> | Click the "New issue" button. |
|
||||
| Microsoft | Edge | Blink | <https://developer.microsoft.com/en-us/microsoft-edge/> | Go to "Help > Send Feedback" from the browser |
|
||||
|
||||
|
||||
## Feature requests
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
### Description
|
||||
|
||||
<!-- Describe your changes in detail -->
|
||||
|
||||
### Motivation & Context
|
||||
|
||||
<!-- Why is this change required? What problem does it solve? -->
|
||||
|
||||
### Type of changes
|
||||
|
||||
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
|
||||
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Refactoring (non-breaking change)
|
||||
- [ ] Breaking change (fix or feature that would change existing functionality)
|
||||
|
||||
### Checklist
|
||||
|
||||
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||
|
||||
- [ ] I have read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md)
|
||||
- [ ] My code follows the code style of the project _(using `npm run lint`)_
|
||||
- [ ] My change introduces changes to the documentation
|
||||
- [ ] I have updated the documentation accordingly
|
||||
- [ ] I have added tests to cover my changes
|
||||
- [ ] All new and existing tests passed
|
||||
|
||||
#### Live previews
|
||||
|
||||
<!-- Please add direct links where your modifications can be seen in the documentation -->
|
||||
|
||||
- <https://deploy-preview-{your_pr_number}--twbs-bootstrap.netlify.app/>
|
||||
|
||||
### Related issues
|
||||
|
||||
<!-- Please link any related issues here. -->
|
|
@ -6,6 +6,6 @@ See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports.
|
|||
|
||||
For general troubleshooting or help getting started:
|
||||
|
||||
- Join [the official Slack room](https://bootstrap-slack.herokuapp.com/).
|
||||
- Ask and explore [our GitHub Discussions](https://github.com/twbs/bootstrap/discussions).
|
||||
- Chat with fellow Bootstrappers in IRC. On the `irc.libera.chat` server, in the `#bootstrap` channel.
|
||||
- Ask and explore Stack Overflow with the [`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5) tag.
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
name: "CodeQL config"
|
||||
paths-ignore:
|
||||
- dist
|
|
@ -6,7 +6,10 @@ on:
|
|||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
NODE: 18
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
browserstack:
|
||||
|
@ -17,6 +20,8 @@ jobs:
|
|||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
|
|
|
@ -9,7 +9,10 @@ on:
|
|||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
NODE: 18
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
bundlewatch:
|
||||
|
@ -18,6 +21,8 @@ jobs:
|
|||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
name: Compress Images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.jpg'
|
||||
- '**.jpeg'
|
||||
- '**.png'
|
||||
- '**.webp'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# Only run on Pull Requests within the same repository, and not from forks.
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||
name: calibreapp/image-actions
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Compress Images
|
||||
uses: calibreapp/image-actions@1.1.0
|
||||
with:
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -7,7 +7,6 @@ on:
|
|||
- v4-dev
|
||||
- "!dependabot/**"
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches:
|
||||
- main
|
||||
- v4-dev
|
||||
|
@ -28,11 +27,20 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
config-file: ./.github/codeql/codeql-config.yml
|
||||
languages: "javascript"
|
||||
queries: +security-and-quality
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: "/language:javascript"
|
||||
|
|
|
@ -9,18 +9,26 @@ on:
|
|||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
cspell:
|
||||
permissions:
|
||||
# allow streetsidesoftware/cspell-action to fetch files for commits and PRs
|
||||
contents: read
|
||||
pull-requests: read
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Run cspell
|
||||
uses: streetsidesoftware/cspell-action@v1
|
||||
uses: streetsidesoftware/cspell-action@v2
|
||||
with:
|
||||
config: ".cspell.json"
|
||||
files: "**/*.md"
|
||||
|
|
|
@ -9,7 +9,10 @@ on:
|
|||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
NODE: 18
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
css:
|
||||
|
@ -18,6 +21,8 @@ jobs:
|
|||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
|
@ -30,3 +35,6 @@ jobs:
|
|||
|
||||
- name: Build CSS
|
||||
run: npm run css
|
||||
|
||||
- name: Run CSS tests
|
||||
run: npm run css-test
|
||||
|
|
|
@ -9,7 +9,10 @@ on:
|
|||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
NODE: 18
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
|
@ -18,6 +21,8 @@ jobs:
|
|||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
|
|
|
@ -4,8 +4,15 @@ on:
|
|||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
issue-close-require:
|
||||
permissions:
|
||||
# allow actions-cool/issues-helper to update issues and PRs
|
||||
issues: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'twbs/bootstrap'
|
||||
steps:
|
||||
|
|
|
@ -4,16 +4,23 @@ on:
|
|||
issues:
|
||||
types: [labeled]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
issue-labeled:
|
||||
permissions:
|
||||
# allow actions-cool/issues-helper to update issues and PRs
|
||||
issues: write
|
||||
pull-requests: write
|
||||
if: github.repository == 'twbs/bootstrap'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: awaiting reply
|
||||
if: github.event.label.name == 'awaiting-reply'
|
||||
if: github.event.label.name == 'needs-example'
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "create-comment"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
body: |
|
||||
Hello @${{ github.event.issue.user.login }}. Bug reports must include a **live demo** of the issue. Per our [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md), please create a reduced test case on [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/) and report back with your link, Bootstrap version, and specific browser and Operating System details.
|
||||
Hello @${{ github.event.issue.user.login }}. Bug reports must include a **live demo** of the issue. Per our [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md), please create a reduced test case on [CodePen](https://codepen.io/) or [StackBlitz](https://stackblitz.com/) and report back with your link, Bootstrap version, and specific browser and Operating System details.
|
||||
|
|
|
@ -9,16 +9,25 @@ on:
|
|||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
NODE: 18
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
run:
|
||||
permissions:
|
||||
# allow coverallsapp/github-action to create new checks issues and fetch code
|
||||
checks: write
|
||||
contents: read
|
||||
name: JS Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
|
|
|
@ -9,7 +9,10 @@ on:
|
|||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
NODE: 18
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
|
@ -18,6 +21,8 @@ jobs:
|
|||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
|
|
|
@ -9,7 +9,10 @@ on:
|
|||
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 16
|
||||
NODE: 18
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
css:
|
||||
|
@ -18,6 +21,8 @@ jobs:
|
|||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
|
|
|
@ -6,8 +6,15 @@ on:
|
|||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update_release_draft:
|
||||
permissions:
|
||||
# allow release-drafter/release-drafter to create GitHub releases and add labels to PRs
|
||||
contents: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'twbs/bootstrap'
|
||||
steps:
|
||||
|
|
11
.stylelintrc
11
.stylelintrc
|
@ -27,5 +27,14 @@
|
|||
}
|
||||
],
|
||||
"scss/selector-no-union-class-name": true
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": "scss/**/*.{test,spec}.scss",
|
||||
"rules": {
|
||||
"scss/dollar-variable-default": null,
|
||||
"declaration-no-important": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,42 +2,131 @@
|
|||
|
||||
## 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.
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community 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
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
- Trolling, insulting or 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
|
||||
- Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
## Enforcement 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.
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
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.
|
||||
Community leaders 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, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## 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.
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## 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.
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
mdo@getbootstrap.com.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
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.
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of
|
||||
actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or permanent
|
||||
ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||
community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4, available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct/>
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||
[https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
|
|
1
LICENSE
1
LICENSE
|
@ -1,6 +1,5 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2022 Twitter, Inc.
|
||||
Copyright (c) 2011-2022 The Bootstrap Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
|
41
README.md
41
README.md
|
@ -1,6 +1,6 @@
|
|||
<p align="center">
|
||||
<a href="https://getbootstrap.com/">
|
||||
<img src="https://getbootstrap.com/docs/5.1/assets/brand/bootstrap-logo-shadow.png" alt="Bootstrap logo" width="200" height="165">
|
||||
<img src="https://getbootstrap.com/docs/5.3/assets/brand/bootstrap-logo-shadow.png" alt="Bootstrap logo" width="200" height="165">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
|||
<p align="center">
|
||||
Sleek, intuitive, and powerful front-end framework for faster and easier web development.
|
||||
<br>
|
||||
<a href="https://getbootstrap.com/docs/5.1/"><strong>Explore Bootstrap docs »</strong></a>
|
||||
<a href="https://getbootstrap.com/docs/5.3/"><strong>Explore Bootstrap docs »</strong></a>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://github.com/twbs/bootstrap/issues/new?assignees=-&labels=bug&template=bug_report.yml">Report bug</a>
|
||||
|
@ -46,33 +46,32 @@ Our default branch is for development of our Bootstrap 5 release. Head to the [`
|
|||
|
||||
Several quick start options are available:
|
||||
|
||||
- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.1.3.zip)
|
||||
- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.3.0-alpha1.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`
|
||||
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.1.3`
|
||||
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap@v5.3.0-alpha1`
|
||||
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@v5.3.0-alpha1`
|
||||
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.3.0-alpha1`
|
||||
- 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/5.1/getting-started/introduction/) for information on the framework contents, templates, examples, and more.
|
||||
Read the [Getting started page](https://getbootstrap.com/docs/5.3/getting-started/introduction/) for information on the framework contents, templates, examples, and more.
|
||||
|
||||
|
||||
## Status
|
||||
|
||||
[](https://bootstrap-slack.herokuapp.com/)
|
||||
[](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Amain)
|
||||
[](https://www.npmjs.com/package/bootstrap)
|
||||
[](https://rubygems.org/gems/bootstrap)
|
||||
[](https://atmospherejs.com/twbs/bootstrap)
|
||||
[](https://packagist.org/packages/twbs/bootstrap)
|
||||
[](https://www.nuget.org/packages/bootstrap/absoluteLatest)
|
||||
[](https://coveralls.io/github/twbs/bootstrap?branch=main)
|
||||
[](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Amain)
|
||||
[](https://www.npmjs.com/package/bootstrap)
|
||||
[](https://rubygems.org/gems/bootstrap)
|
||||
[](https://atmospherejs.com/twbs/bootstrap)
|
||||
[](https://packagist.org/packages/twbs/bootstrap)
|
||||
[](https://www.nuget.org/packages/bootstrap/absoluteLatest)
|
||||
[](https://coveralls.io/github/twbs/bootstrap?branch=main)
|
||||
[](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css)
|
||||
[](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css)
|
||||
[](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js)
|
||||
[](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js)
|
||||
[](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
|
||||
## What's included
|
||||
|
@ -138,14 +137,14 @@ We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified
|
|||
|
||||
## Bugs and feature requests
|
||||
|
||||
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/main/.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).
|
||||
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/main/.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/choose).
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
Bootstrap's documentation, included in this repo in the root directory, is built with [Hugo](https://gohugo.io/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.
|
||||
|
||||
Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/assets/js/search.js`.
|
||||
Documentation search is powered by [Algolia's DocSearch](https://docsearch.algolia.com/). Working on our search? Be sure to set `debug: true` in `site/assets/js/search.js`.
|
||||
|
||||
### Running documentation locally
|
||||
|
||||
|
@ -178,7 +177,7 @@ Get updates on Bootstrap's development and chat with the project maintainers and
|
|||
|
||||
- Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
|
||||
- Read and subscribe to [The Official Bootstrap Blog](https://blog.getbootstrap.com/).
|
||||
- Join [the official Slack room](https://bootstrap-slack.herokuapp.com/).
|
||||
- Ask and explore [our GitHub Discussions](https://github.com/twbs/bootstrap/discussions).
|
||||
- Chat with fellow Bootstrappers in IRC. On the `irc.libera.chat` server, in the `#bootstrap` channel.
|
||||
- Implementation help may be found at Stack Overflow (tagged [`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5)).
|
||||
- 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.
|
||||
|
@ -244,4 +243,4 @@ Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com
|
|||
|
||||
## Copyright and license
|
||||
|
||||
Code and documentation copyright 2011–2022 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/main/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).
|
||||
Code and documentation copyright 2011–2022 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors). 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/).
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"extends": "../.eslintrc.json",
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"strict": "error"
|
||||
"strict": "error",
|
||||
"unicorn/prefer-top-level-await": "off"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,20 +3,19 @@
|
|||
/*!
|
||||
* Script to build our plugins to use them separately.
|
||||
* Copyright 2020-2022 The Bootstrap Authors
|
||||
* Copyright 2020-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const path = require('node:path')
|
||||
const rollup = require('rollup')
|
||||
const globby = require('globby')
|
||||
const { babel } = require('@rollup/plugin-babel')
|
||||
const banner = require('./banner.js')
|
||||
|
||||
const sourcePath = path.resolve(__dirname, '../js/src/').replace(/\\/g, '/')
|
||||
const jsFiles = globby.sync(sourcePath + '/**/*.js')
|
||||
const jsFiles = globby.sync(`${sourcePath}/**/*.js`)
|
||||
|
||||
// Array which holds the resolved plugins
|
||||
const resolvedPlugins = []
|
||||
|
@ -27,7 +26,7 @@ const filenameToEntity = filename => filename.replace('.js', '')
|
|||
|
||||
for (const file of jsFiles) {
|
||||
resolvedPlugins.push({
|
||||
src: file.replace('.js', ''),
|
||||
src: file,
|
||||
dist: file.replace('src', 'dist'),
|
||||
fileName: path.basename(file),
|
||||
className: filenameToEntity(path.basename(file))
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
/*!
|
||||
* Script to update version number references in the project.
|
||||
* Copyright 2017-2022 The Bootstrap Authors
|
||||
* Copyright 2017-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const fs = require('fs').promises
|
||||
const path = require('path')
|
||||
const fs = require('node:fs').promises
|
||||
const path = require('node:path')
|
||||
const globby = require('globby')
|
||||
|
||||
const VERBOSE = process.argv.includes('--verbose')
|
||||
|
|
|
@ -6,15 +6,14 @@
|
|||
* otherwise the hashes won't match!
|
||||
*
|
||||
* Copyright 2017-2022 The Bootstrap Authors
|
||||
* Copyright 2017-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const crypto = require('crypto')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const crypto = require('node:crypto')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const sh = require('shelljs')
|
||||
|
||||
sh.config.fatal = true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const path = require('node:path')
|
||||
const { babel } = require('@rollup/plugin-babel')
|
||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||
const replace = require('@rollup/plugin-replace')
|
||||
|
@ -40,7 +40,7 @@ if (BUNDLE) {
|
|||
const rollupConfig = {
|
||||
input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
|
||||
output: {
|
||||
banner,
|
||||
banner: banner(),
|
||||
file: path.resolve(__dirname, `../dist/js/${fileDestination}.js`),
|
||||
format: ESM ? 'esm' : 'umd',
|
||||
globals,
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
/*!
|
||||
* Script to run vnu-jar if Java is available.
|
||||
* Copyright 2017-2022 The Bootstrap Authors
|
||||
* Copyright 2017-2022 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const { execFile, spawn } = require('child_process')
|
||||
const { execFile, spawn } = require('node:child_process')
|
||||
const vnu = require('vnu-jar')
|
||||
|
||||
execFile('java', ['-version'], (error, stdout, stderr) => {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const path = require('node:path')
|
||||
const sh = require('shelljs')
|
||||
|
||||
const pkg = require('../package.json')
|
||||
|
|
45
config.yml
45
config.yml
|
@ -31,7 +31,7 @@ publishDir: "_site"
|
|||
module:
|
||||
mounts:
|
||||
- source: dist
|
||||
target: static/docs/5.1/dist
|
||||
target: static/docs/5.3/dist
|
||||
- source: site/assets
|
||||
target: assets
|
||||
- source: site/content
|
||||
|
@ -42,47 +42,46 @@ module:
|
|||
target: layouts
|
||||
- source: site/static
|
||||
target: static
|
||||
- source: site/static/docs/5.1/assets/img/favicons/apple-touch-icon.png
|
||||
- source: site/static/docs/5.3/assets/img/favicons/apple-touch-icon.png
|
||||
target: static/apple-touch-icon.png
|
||||
- source: site/static/docs/5.1/assets/img/favicons/favicon.ico
|
||||
- source: site/static/docs/5.3/assets/img/favicons/favicon.ico
|
||||
target: static/favicon.ico
|
||||
|
||||
params:
|
||||
description: "The most popular HTML, CSS, and JS library in the world."
|
||||
subtitle: "The most popular HTML, CSS, and JS library in the world."
|
||||
description: "Powerful, extensible, and feature-packed frontend toolkit. Build and customize with Sass, utilize prebuilt grid system and components, and bring projects to life with powerful JavaScript plugins."
|
||||
authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
|
||||
social_image_path: /docs/5.1/assets/brand/bootstrap-social.png
|
||||
social_logo_path: /docs/5.1/assets/brand/bootstrap-social-logo.png
|
||||
|
||||
current_version: "5.1.3"
|
||||
current_ruby_version: "5.1.3"
|
||||
docs_version: "5.1"
|
||||
current_version: "5.3.0-alpha1"
|
||||
current_ruby_version: "5.3.0-alpha1"
|
||||
docs_version: "5.3"
|
||||
rfs_version: "v9.0.6"
|
||||
github_org: "https://github.com/twbs"
|
||||
repo: "https://github.com/twbs/bootstrap"
|
||||
twitter: "getbootstrap"
|
||||
slack: "https://bootstrap-slack.herokuapp.com/"
|
||||
opencollective: "https://opencollective.com/bootstrap"
|
||||
blog: "https://blog.getbootstrap.com/"
|
||||
themes: "https://themes.getbootstrap.com/"
|
||||
icons: "https://icons.getbootstrap.com/"
|
||||
swag: "https://cottonbureau.com/people/bootstrap"
|
||||
|
||||
download:
|
||||
source: "https://github.com/twbs/bootstrap/archive/v5.1.3.zip"
|
||||
dist: "https://github.com/twbs/bootstrap/releases/download/v5.1.3/bootstrap-5.1.3-dist.zip"
|
||||
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v5.1.3/bootstrap-5.1.3-examples.zip"
|
||||
source: "https://github.com/twbs/bootstrap/archive/v5.3.0-alpha1.zip"
|
||||
dist: "https://github.com/twbs/bootstrap/releases/download/v5.3.0-alpha1/bootstrap-5.3.0-alpha1-dist.zip"
|
||||
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v5.3.0-alpha1/bootstrap-5.3.0-alpha1-examples.zip"
|
||||
|
||||
cdn:
|
||||
# See https://www.srihash.org for info on how to generate the hashes
|
||||
css: "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
css_hash: "sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
|
||||
css_rtl: "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.rtl.min.css"
|
||||
css_rtl_hash: "sha384-+qdLaIRZfNu4cVPK/PxJJEy0B0f3Ugv8i482AKY7gwXwhaCroABd086ybrVKTa0q"
|
||||
js: "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"
|
||||
js_hash: "sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
|
||||
js_bundle: "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
|
||||
js_bundle_hash: "sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
|
||||
popper: "https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.5/dist/umd/popper.min.js"
|
||||
popper_hash: "sha384-Xe+8cL9oJa6tN/veChSP7q+mnSPaj5Bcu9mPX5F5xIGE0DVittaqT5lorf0EI7Vk"
|
||||
css: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
|
||||
css_hash: "sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD"
|
||||
css_rtl: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.rtl.min.css"
|
||||
css_rtl_hash: "sha384-WJUUqfoMmnfkBLne5uxXj+na/c7sesSJ32gI7GfCk4zO4GthUKhSEGyvQ839BC51"
|
||||
js: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js"
|
||||
js_hash: "sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD"
|
||||
js_bundle: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
|
||||
js_bundle_hash: "sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
|
||||
popper: "https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
|
||||
popper_hash: "sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3"
|
||||
|
||||
anchors:
|
||||
min: 2
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,11 +1,10 @@
|
|||
/*!
|
||||
* Bootstrap Reboot v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors
|
||||
* Copyright 2011-2021 Twitter, Inc.
|
||||
* Bootstrap Reboot v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors
|
||||
* 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)
|
||||
*/
|
||||
:root {
|
||||
:root,
|
||||
[data-bs-theme=light] {
|
||||
--bs-blue: #0d6efd;
|
||||
--bs-indigo: #6610f2;
|
||||
--bs-purple: #6f42c1;
|
||||
|
@ -16,6 +15,7 @@
|
|||
--bs-green: #198754;
|
||||
--bs-teal: #20c997;
|
||||
--bs-cyan: #0dcaf0;
|
||||
--bs-black: #000;
|
||||
--bs-white: #fff;
|
||||
--bs-gray: #6c757d;
|
||||
--bs-gray-dark: #343a40;
|
||||
|
@ -44,11 +44,35 @@
|
|||
--bs-danger-rgb: 220, 53, 69;
|
||||
--bs-light-rgb: 248, 249, 250;
|
||||
--bs-dark-rgb: 33, 37, 41;
|
||||
--bs-primary-text: #0a58ca;
|
||||
--bs-secondary-text: #6c757d;
|
||||
--bs-success-text: #146c43;
|
||||
--bs-info-text: #087990;
|
||||
--bs-warning-text: #997404;
|
||||
--bs-danger-text: #b02a37;
|
||||
--bs-light-text: #6c757d;
|
||||
--bs-dark-text: #495057;
|
||||
--bs-primary-bg-subtle: #cfe2ff;
|
||||
--bs-secondary-bg-subtle: #f8f9fa;
|
||||
--bs-success-bg-subtle: #d1e7dd;
|
||||
--bs-info-bg-subtle: #cff4fc;
|
||||
--bs-warning-bg-subtle: #fff3cd;
|
||||
--bs-danger-bg-subtle: #f8d7da;
|
||||
--bs-light-bg-subtle: #fcfcfd;
|
||||
--bs-dark-bg-subtle: #ced4da;
|
||||
--bs-primary-border-subtle: #9ec5fe;
|
||||
--bs-secondary-border-subtle: #e9ecef;
|
||||
--bs-success-border-subtle: #a3cfbb;
|
||||
--bs-info-border-subtle: #9eeaf9;
|
||||
--bs-warning-border-subtle: #ffe69c;
|
||||
--bs-danger-border-subtle: #f1aeb5;
|
||||
--bs-light-border-subtle: #e9ecef;
|
||||
--bs-dark-border-subtle: #adb5bd;
|
||||
--bs-white-rgb: 255, 255, 255;
|
||||
--bs-black-rgb: 0, 0, 0;
|
||||
--bs-body-color-rgb: 33, 37, 41;
|
||||
--bs-body-bg-rgb: 255, 255, 255;
|
||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
||||
--bs-body-font-family: var(--bs-font-sans-serif);
|
||||
|
@ -56,7 +80,99 @@
|
|||
--bs-body-font-weight: 400;
|
||||
--bs-body-line-height: 1.5;
|
||||
--bs-body-color: #212529;
|
||||
--bs-emphasis-color: #000;
|
||||
--bs-emphasis-color-rgb: 0, 0, 0;
|
||||
--bs-secondary-color: rgba(33, 37, 41, 0.75);
|
||||
--bs-secondary-color-rgb: 33, 37, 41;
|
||||
--bs-secondary-bg: #e9ecef;
|
||||
--bs-secondary-bg-rgb: 233, 236, 239;
|
||||
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
|
||||
--bs-tertiary-color-rgb: 33, 37, 41;
|
||||
--bs-tertiary-bg: #f8f9fa;
|
||||
--bs-tertiary-bg-rgb: 248, 249, 250;
|
||||
--bs-body-bg: #fff;
|
||||
--bs-body-bg-rgb: 255, 255, 255;
|
||||
--bs-link-color: #0d6efd;
|
||||
--bs-link-color-rgb: 13, 110, 253;
|
||||
--bs-link-decoration: underline;
|
||||
--bs-link-hover-color: #0a58ca;
|
||||
--bs-link-hover-color-rgb: 10, 88, 202;
|
||||
--bs-code-color: #d63384;
|
||||
--bs-highlight-bg: #fff3cd;
|
||||
--bs-border-width: 1px;
|
||||
--bs-border-style: solid;
|
||||
--bs-border-color: #dee2e6;
|
||||
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
|
||||
--bs-border-radius: 0.375rem;
|
||||
--bs-border-radius-sm: 0.25rem;
|
||||
--bs-border-radius-lg: 0.5rem;
|
||||
--bs-border-radius-xl: 1rem;
|
||||
--bs-border-radius-2xl: 2rem;
|
||||
--bs-border-radius-pill: 50rem;
|
||||
--bs-box-shadow: 0 0.5rem 1rem rgba(var(--bs-body-color-rgb), 0.15);
|
||||
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(var(--bs-body-color-rgb), 0.075);
|
||||
--bs-box-shadow-lg: 0 1rem 3rem rgba(var(--bs-body-color-rgb), 0.175);
|
||||
--bs-box-shadow-inset: inset 0 1px 2px rgba(var(--bs-body-color-rgb), 0.075);
|
||||
--bs-emphasis-color: #000;
|
||||
--bs-form-control-bg: var(--bs-body-bg);
|
||||
--bs-form-control-disabled-bg: var(--bs-secondary-bg);
|
||||
--bs-highlight-bg: #fff3cd;
|
||||
--bs-breakpoint-xs: 0;
|
||||
--bs-breakpoint-sm: 576px;
|
||||
--bs-breakpoint-md: 768px;
|
||||
--bs-breakpoint-lg: 992px;
|
||||
--bs-breakpoint-xl: 1200px;
|
||||
--bs-breakpoint-xxl: 1400px;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] {
|
||||
--bs-body-color: #adb5bd;
|
||||
--bs-body-color-rgb: 173, 181, 189;
|
||||
--bs-body-bg: #212529;
|
||||
--bs-body-bg-rgb: 33, 37, 41;
|
||||
--bs-emphasis-color: #f8f9fa;
|
||||
--bs-emphasis-color-rgb: 248, 249, 250;
|
||||
--bs-secondary-color: rgba(173, 181, 189, 0.75);
|
||||
--bs-secondary-color-rgb: 173, 181, 189;
|
||||
--bs-secondary-bg: #343a40;
|
||||
--bs-secondary-bg-rgb: 52, 58, 64;
|
||||
--bs-tertiary-color: rgba(173, 181, 189, 0.5);
|
||||
--bs-tertiary-color-rgb: 173, 181, 189;
|
||||
--bs-tertiary-bg: #2b3035;
|
||||
--bs-tertiary-bg-rgb: 43, 48, 53;
|
||||
--bs-emphasis-color: #fff;
|
||||
--bs-primary-text: #6ea8fe;
|
||||
--bs-secondary-text: #dee2e6;
|
||||
--bs-success-text: #75b798;
|
||||
--bs-info-text: #6edff6;
|
||||
--bs-warning-text: #ffda6a;
|
||||
--bs-danger-text: #ea868f;
|
||||
--bs-light-text: #f8f9fa;
|
||||
--bs-dark-text: #dee2e6;
|
||||
--bs-primary-bg-subtle: #031633;
|
||||
--bs-secondary-bg-subtle: #212529;
|
||||
--bs-success-bg-subtle: #051b11;
|
||||
--bs-info-bg-subtle: #032830;
|
||||
--bs-warning-bg-subtle: #332701;
|
||||
--bs-danger-bg-subtle: #2c0b0e;
|
||||
--bs-light-bg-subtle: #343a40;
|
||||
--bs-dark-bg-subtle: #1a1d20;
|
||||
--bs-primary-border-subtle: #084298;
|
||||
--bs-secondary-border-subtle: #495057;
|
||||
--bs-success-border-subtle: #0f5132;
|
||||
--bs-info-border-subtle: #055160;
|
||||
--bs-warning-border-subtle: #664d03;
|
||||
--bs-danger-border-subtle: #842029;
|
||||
--bs-light-border-subtle: #495057;
|
||||
--bs-dark-border-subtle: #343a40;
|
||||
--bs-heading-color: #fff;
|
||||
--bs-link-color: #6ea8fe;
|
||||
--bs-link-hover-color: #9ec5fe;
|
||||
--bs-link-color-rgb: 110, 168, 254;
|
||||
--bs-link-hover-color-rgb: 158, 197, 254;
|
||||
--bs-code-color: #e685b5;
|
||||
--bs-border-color: #495057;
|
||||
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
*,
|
||||
|
@ -87,20 +203,17 @@ body {
|
|||
hr {
|
||||
margin: 1rem 0;
|
||||
color: inherit;
|
||||
background-color: currentColor;
|
||||
border: 0;
|
||||
border-top: var(--bs-border-width) solid;
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
hr:not([size]) {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
h6, h5, h4, h3, h2, h1 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
color: var(--bs-heading-color, inherit);
|
||||
}
|
||||
|
||||
h1 {
|
||||
|
@ -152,8 +265,7 @@ p {
|
|||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title],
|
||||
abbr[data-bs-original-title] {
|
||||
abbr[title] {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
|
@ -209,8 +321,8 @@ small {
|
|||
}
|
||||
|
||||
mark {
|
||||
padding: 0.2em;
|
||||
background-color: #fcf8e3;
|
||||
padding: 0.1875em;
|
||||
background-color: var(--bs-highlight-bg);
|
||||
}
|
||||
|
||||
sub,
|
||||
|
@ -230,11 +342,11 @@ sup {
|
|||
}
|
||||
|
||||
a {
|
||||
color: #0d6efd;
|
||||
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover {
|
||||
color: #0a58ca;
|
||||
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
|
||||
}
|
||||
|
||||
a:not([href]):not([class]), a:not([href]):not([class]):hover {
|
||||
|
@ -248,8 +360,6 @@ kbd,
|
|||
samp {
|
||||
font-family: var(--bs-font-monospace);
|
||||
font-size: 1em;
|
||||
direction: ltr /* rtl:ignore */;
|
||||
unicode-bidi: bidi-override;
|
||||
}
|
||||
|
||||
pre {
|
||||
|
@ -267,7 +377,7 @@ pre code {
|
|||
|
||||
code {
|
||||
font-size: 0.875em;
|
||||
color: #d63384;
|
||||
color: var(--bs-code-color);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
a > code {
|
||||
|
@ -275,16 +385,15 @@ a > code {
|
|||
}
|
||||
|
||||
kbd {
|
||||
padding: 0.2rem 0.4rem;
|
||||
padding: 0.1875rem 0.375rem;
|
||||
font-size: 0.875em;
|
||||
color: #fff;
|
||||
background-color: #212529;
|
||||
border-radius: 0.2rem;
|
||||
color: var(--bs-body-bg);
|
||||
background-color: var(--bs-body-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
kbd kbd {
|
||||
padding: 0;
|
||||
font-size: 1em;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
figure {
|
||||
|
@ -304,7 +413,7 @@ table {
|
|||
caption {
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
color: #6c757d;
|
||||
color: var(--bs-secondary-color);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
@ -363,8 +472,8 @@ select:disabled {
|
|||
opacity: 1;
|
||||
}
|
||||
|
||||
[list]::-webkit-calendar-picker-indicator {
|
||||
display: none;
|
||||
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
button,
|
||||
|
@ -450,14 +559,11 @@ legend + * {
|
|||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
::file-selector-button {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,11 +1,10 @@
|
|||
/*!
|
||||
* Bootstrap Reboot v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors
|
||||
* Copyright 2011-2021 Twitter, Inc.
|
||||
* Bootstrap Reboot v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors
|
||||
* 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)
|
||||
*/
|
||||
:root {
|
||||
:root,
|
||||
[data-bs-theme=light] {
|
||||
--bs-blue: #0d6efd;
|
||||
--bs-indigo: #6610f2;
|
||||
--bs-purple: #6f42c1;
|
||||
|
@ -16,6 +15,7 @@
|
|||
--bs-green: #198754;
|
||||
--bs-teal: #20c997;
|
||||
--bs-cyan: #0dcaf0;
|
||||
--bs-black: #000;
|
||||
--bs-white: #fff;
|
||||
--bs-gray: #6c757d;
|
||||
--bs-gray-dark: #343a40;
|
||||
|
@ -44,11 +44,35 @@
|
|||
--bs-danger-rgb: 220, 53, 69;
|
||||
--bs-light-rgb: 248, 249, 250;
|
||||
--bs-dark-rgb: 33, 37, 41;
|
||||
--bs-primary-text: #0a58ca;
|
||||
--bs-secondary-text: #6c757d;
|
||||
--bs-success-text: #146c43;
|
||||
--bs-info-text: #087990;
|
||||
--bs-warning-text: #997404;
|
||||
--bs-danger-text: #b02a37;
|
||||
--bs-light-text: #6c757d;
|
||||
--bs-dark-text: #495057;
|
||||
--bs-primary-bg-subtle: #cfe2ff;
|
||||
--bs-secondary-bg-subtle: #f8f9fa;
|
||||
--bs-success-bg-subtle: #d1e7dd;
|
||||
--bs-info-bg-subtle: #cff4fc;
|
||||
--bs-warning-bg-subtle: #fff3cd;
|
||||
--bs-danger-bg-subtle: #f8d7da;
|
||||
--bs-light-bg-subtle: #fcfcfd;
|
||||
--bs-dark-bg-subtle: #ced4da;
|
||||
--bs-primary-border-subtle: #9ec5fe;
|
||||
--bs-secondary-border-subtle: #e9ecef;
|
||||
--bs-success-border-subtle: #a3cfbb;
|
||||
--bs-info-border-subtle: #9eeaf9;
|
||||
--bs-warning-border-subtle: #ffe69c;
|
||||
--bs-danger-border-subtle: #f1aeb5;
|
||||
--bs-light-border-subtle: #e9ecef;
|
||||
--bs-dark-border-subtle: #adb5bd;
|
||||
--bs-white-rgb: 255, 255, 255;
|
||||
--bs-black-rgb: 0, 0, 0;
|
||||
--bs-body-color-rgb: 33, 37, 41;
|
||||
--bs-body-bg-rgb: 255, 255, 255;
|
||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
||||
--bs-body-font-family: var(--bs-font-sans-serif);
|
||||
|
@ -56,7 +80,99 @@
|
|||
--bs-body-font-weight: 400;
|
||||
--bs-body-line-height: 1.5;
|
||||
--bs-body-color: #212529;
|
||||
--bs-emphasis-color: #000;
|
||||
--bs-emphasis-color-rgb: 0, 0, 0;
|
||||
--bs-secondary-color: rgba(33, 37, 41, 0.75);
|
||||
--bs-secondary-color-rgb: 33, 37, 41;
|
||||
--bs-secondary-bg: #e9ecef;
|
||||
--bs-secondary-bg-rgb: 233, 236, 239;
|
||||
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
|
||||
--bs-tertiary-color-rgb: 33, 37, 41;
|
||||
--bs-tertiary-bg: #f8f9fa;
|
||||
--bs-tertiary-bg-rgb: 248, 249, 250;
|
||||
--bs-body-bg: #fff;
|
||||
--bs-body-bg-rgb: 255, 255, 255;
|
||||
--bs-link-color: #0d6efd;
|
||||
--bs-link-color-rgb: 13, 110, 253;
|
||||
--bs-link-decoration: underline;
|
||||
--bs-link-hover-color: #0a58ca;
|
||||
--bs-link-hover-color-rgb: 10, 88, 202;
|
||||
--bs-code-color: #d63384;
|
||||
--bs-highlight-bg: #fff3cd;
|
||||
--bs-border-width: 1px;
|
||||
--bs-border-style: solid;
|
||||
--bs-border-color: #dee2e6;
|
||||
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
|
||||
--bs-border-radius: 0.375rem;
|
||||
--bs-border-radius-sm: 0.25rem;
|
||||
--bs-border-radius-lg: 0.5rem;
|
||||
--bs-border-radius-xl: 1rem;
|
||||
--bs-border-radius-2xl: 2rem;
|
||||
--bs-border-radius-pill: 50rem;
|
||||
--bs-box-shadow: 0 0.5rem 1rem rgba(var(--bs-body-color-rgb), 0.15);
|
||||
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(var(--bs-body-color-rgb), 0.075);
|
||||
--bs-box-shadow-lg: 0 1rem 3rem rgba(var(--bs-body-color-rgb), 0.175);
|
||||
--bs-box-shadow-inset: inset 0 1px 2px rgba(var(--bs-body-color-rgb), 0.075);
|
||||
--bs-emphasis-color: #000;
|
||||
--bs-form-control-bg: var(--bs-body-bg);
|
||||
--bs-form-control-disabled-bg: var(--bs-secondary-bg);
|
||||
--bs-highlight-bg: #fff3cd;
|
||||
--bs-breakpoint-xs: 0;
|
||||
--bs-breakpoint-sm: 576px;
|
||||
--bs-breakpoint-md: 768px;
|
||||
--bs-breakpoint-lg: 992px;
|
||||
--bs-breakpoint-xl: 1200px;
|
||||
--bs-breakpoint-xxl: 1400px;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] {
|
||||
--bs-body-color: #adb5bd;
|
||||
--bs-body-color-rgb: 173, 181, 189;
|
||||
--bs-body-bg: #212529;
|
||||
--bs-body-bg-rgb: 33, 37, 41;
|
||||
--bs-emphasis-color: #f8f9fa;
|
||||
--bs-emphasis-color-rgb: 248, 249, 250;
|
||||
--bs-secondary-color: rgba(173, 181, 189, 0.75);
|
||||
--bs-secondary-color-rgb: 173, 181, 189;
|
||||
--bs-secondary-bg: #343a40;
|
||||
--bs-secondary-bg-rgb: 52, 58, 64;
|
||||
--bs-tertiary-color: rgba(173, 181, 189, 0.5);
|
||||
--bs-tertiary-color-rgb: 173, 181, 189;
|
||||
--bs-tertiary-bg: #2b3035;
|
||||
--bs-tertiary-bg-rgb: 43, 48, 53;
|
||||
--bs-emphasis-color: #fff;
|
||||
--bs-primary-text: #6ea8fe;
|
||||
--bs-secondary-text: #dee2e6;
|
||||
--bs-success-text: #75b798;
|
||||
--bs-info-text: #6edff6;
|
||||
--bs-warning-text: #ffda6a;
|
||||
--bs-danger-text: #ea868f;
|
||||
--bs-light-text: #f8f9fa;
|
||||
--bs-dark-text: #dee2e6;
|
||||
--bs-primary-bg-subtle: #031633;
|
||||
--bs-secondary-bg-subtle: #212529;
|
||||
--bs-success-bg-subtle: #051b11;
|
||||
--bs-info-bg-subtle: #032830;
|
||||
--bs-warning-bg-subtle: #332701;
|
||||
--bs-danger-bg-subtle: #2c0b0e;
|
||||
--bs-light-bg-subtle: #343a40;
|
||||
--bs-dark-bg-subtle: #1a1d20;
|
||||
--bs-primary-border-subtle: #084298;
|
||||
--bs-secondary-border-subtle: #495057;
|
||||
--bs-success-border-subtle: #0f5132;
|
||||
--bs-info-border-subtle: #055160;
|
||||
--bs-warning-border-subtle: #664d03;
|
||||
--bs-danger-border-subtle: #842029;
|
||||
--bs-light-border-subtle: #495057;
|
||||
--bs-dark-border-subtle: #343a40;
|
||||
--bs-heading-color: #fff;
|
||||
--bs-link-color: #6ea8fe;
|
||||
--bs-link-hover-color: #9ec5fe;
|
||||
--bs-link-color-rgb: 110, 168, 254;
|
||||
--bs-link-hover-color-rgb: 158, 197, 254;
|
||||
--bs-code-color: #e685b5;
|
||||
--bs-border-color: #495057;
|
||||
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
*,
|
||||
|
@ -87,20 +203,17 @@ body {
|
|||
hr {
|
||||
margin: 1rem 0;
|
||||
color: inherit;
|
||||
background-color: currentColor;
|
||||
border: 0;
|
||||
border-top: var(--bs-border-width) solid;
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
hr:not([size]) {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
h6, h5, h4, h3, h2, h1 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
color: var(--bs-heading-color, inherit);
|
||||
}
|
||||
|
||||
h1 {
|
||||
|
@ -152,8 +265,7 @@ p {
|
|||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title],
|
||||
abbr[data-bs-original-title] {
|
||||
abbr[title] {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
|
@ -209,8 +321,8 @@ small {
|
|||
}
|
||||
|
||||
mark {
|
||||
padding: 0.2em;
|
||||
background-color: #fcf8e3;
|
||||
padding: 0.1875em;
|
||||
background-color: var(--bs-highlight-bg);
|
||||
}
|
||||
|
||||
sub,
|
||||
|
@ -230,11 +342,11 @@ sup {
|
|||
}
|
||||
|
||||
a {
|
||||
color: #0d6efd;
|
||||
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover {
|
||||
color: #0a58ca;
|
||||
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
|
||||
}
|
||||
|
||||
a:not([href]):not([class]), a:not([href]):not([class]):hover {
|
||||
|
@ -248,8 +360,6 @@ kbd,
|
|||
samp {
|
||||
font-family: var(--bs-font-monospace);
|
||||
font-size: 1em;
|
||||
direction: ltr ;
|
||||
unicode-bidi: bidi-override;
|
||||
}
|
||||
|
||||
pre {
|
||||
|
@ -267,7 +377,7 @@ pre code {
|
|||
|
||||
code {
|
||||
font-size: 0.875em;
|
||||
color: #d63384;
|
||||
color: var(--bs-code-color);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
a > code {
|
||||
|
@ -275,16 +385,15 @@ a > code {
|
|||
}
|
||||
|
||||
kbd {
|
||||
padding: 0.2rem 0.4rem;
|
||||
padding: 0.1875rem 0.375rem;
|
||||
font-size: 0.875em;
|
||||
color: #fff;
|
||||
background-color: #212529;
|
||||
border-radius: 0.2rem;
|
||||
color: var(--bs-body-bg);
|
||||
background-color: var(--bs-body-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
kbd kbd {
|
||||
padding: 0;
|
||||
font-size: 1em;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
figure {
|
||||
|
@ -304,7 +413,7 @@ table {
|
|||
caption {
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
color: #6c757d;
|
||||
color: var(--bs-secondary-color);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
@ -363,8 +472,8 @@ select:disabled {
|
|||
opacity: 1;
|
||||
}
|
||||
|
||||
[list]::-webkit-calendar-picker-indicator {
|
||||
display: none;
|
||||
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
button,
|
||||
|
@ -448,14 +557,11 @@ legend + * {
|
|||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
::file-selector-button {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
5168
dist/js/bootstrap.js
5168
dist/js/bootstrap.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"extends": "../.eslintrc.json",
|
||||
"env": {
|
||||
"es2022": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"./*.js",
|
||||
"./src/**/*.js"
|
||||
],
|
||||
"rules": {
|
||||
"import/extensions": [
|
||||
2,
|
||||
{
|
||||
"js": "always"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,155 +1,23 @@
|
|||
/*!
|
||||
* Bootstrap alert.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap alert.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/event-handler', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.EventHandler, global.Base));
|
||||
})(this, (function (EventHandler, BaseComponent) { 'use strict';
|
||||
|
||||
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
||||
|
||||
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
||||
const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index.js'), require('./dom/event-handler.js'), require('./base-component.js'), require('./util/component-functions.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./util/index', './dom/event-handler', './base-component', './util/component-functions'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.Index, global.EventHandler, global.BaseComponent, global.ComponentFunctions));
|
||||
})(this, (function (index_js, EventHandler, BaseComponent, componentFunctions_js) { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Bootstrap (v5.3.0-alpha1): alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const getSelector = element => {
|
||||
let selector = element.getAttribute('data-bs-target');
|
||||
|
||||
if (!selector || selector === '#') {
|
||||
let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
|
||||
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
||||
// `document.querySelector` will rightfully complain it is invalid.
|
||||
// See https://github.com/twbs/bootstrap/issues/32273
|
||||
|
||||
if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
|
||||
return null;
|
||||
} // Just in case some CMS puts out a full URL with the anchor appended
|
||||
|
||||
|
||||
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
||||
hrefAttr = `#${hrefAttr.split('#')[1]}`;
|
||||
}
|
||||
|
||||
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
|
||||
}
|
||||
|
||||
return selector;
|
||||
};
|
||||
|
||||
const getElementFromSelector = element => {
|
||||
const selector = getSelector(element);
|
||||
return selector ? document.querySelector(selector) : null;
|
||||
};
|
||||
|
||||
const isDisabled = element => {
|
||||
if (!element || element.nodeType !== Node.ELEMENT_NODE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (element.classList.contains('disabled')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof element.disabled !== 'undefined') {
|
||||
return element.disabled;
|
||||
}
|
||||
|
||||
return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
|
||||
};
|
||||
|
||||
const getjQuery = () => {
|
||||
const {
|
||||
jQuery
|
||||
} = window;
|
||||
|
||||
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
||||
return jQuery;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const DOMContentLoadedCallbacks = [];
|
||||
|
||||
const onDOMContentLoaded = callback => {
|
||||
if (document.readyState === 'loading') {
|
||||
// add listener on the first call when the document is in loading state
|
||||
if (!DOMContentLoadedCallbacks.length) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
DOMContentLoadedCallbacks.forEach(callback => callback());
|
||||
});
|
||||
}
|
||||
|
||||
DOMContentLoadedCallbacks.push(callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const defineJQueryPlugin = plugin => {
|
||||
onDOMContentLoaded(() => {
|
||||
const $ = getjQuery();
|
||||
/* istanbul ignore if */
|
||||
|
||||
if ($) {
|
||||
const name = plugin.NAME;
|
||||
const JQUERY_NO_CONFLICT = $.fn[name];
|
||||
$.fn[name] = plugin.jQueryInterface;
|
||||
$.fn[name].Constructor = plugin;
|
||||
|
||||
$.fn[name].noConflict = () => {
|
||||
$.fn[name] = JQUERY_NO_CONFLICT;
|
||||
return plugin.jQueryInterface;
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/component-functions.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const enableDismissTrigger = (component, method = 'hide') => {
|
||||
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
||||
const name = component.NAME;
|
||||
EventHandler__default.default.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
|
||||
if (['A', 'AREA'].includes(this.tagName)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
if (isDisabled(this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
||||
const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
||||
|
||||
instance[method]();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'alert';
|
||||
|
@ -159,75 +27,61 @@
|
|||
const EVENT_CLOSED = `closed${EVENT_KEY}`;
|
||||
const CLASS_NAME_FADE = 'fade';
|
||||
const CLASS_NAME_SHOW = 'show';
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Alert extends BaseComponent__default.default {
|
||||
class Alert extends BaseComponent {
|
||||
// Getters
|
||||
static get NAME() {
|
||||
return NAME;
|
||||
} // Public
|
||||
|
||||
}
|
||||
|
||||
// Public
|
||||
close() {
|
||||
const closeEvent = EventHandler__default.default.trigger(this._element, EVENT_CLOSE);
|
||||
|
||||
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
||||
if (closeEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||
|
||||
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE);
|
||||
|
||||
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
||||
} // Private
|
||||
|
||||
}
|
||||
|
||||
// Private
|
||||
_destroyElement() {
|
||||
this._element.remove();
|
||||
|
||||
EventHandler__default.default.trigger(this._element, EVENT_CLOSED);
|
||||
EventHandler.trigger(this._element, EVENT_CLOSED);
|
||||
this.dispose();
|
||||
} // Static
|
||||
|
||||
}
|
||||
|
||||
// Static
|
||||
static jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
const data = Alert.getOrCreateInstance(this);
|
||||
|
||||
if (typeof config !== 'string') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
||||
throw new TypeError(`No method named "${config}"`);
|
||||
}
|
||||
|
||||
data[config](this);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
componentFunctions_js.enableDismissTrigger(Alert, 'close');
|
||||
|
||||
enableDismissTrigger(Alert, 'close');
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
* add .Alert to jQuery only if jQuery is present
|
||||
*/
|
||||
|
||||
defineJQueryPlugin(Alert);
|
||||
index_js.defineJQueryPlugin(Alert);
|
||||
|
||||
return Alert;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,180 +1,80 @@
|
|||
/*!
|
||||
* Bootstrap base-component.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap base-component.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Base = factory(global.Data, global.EventHandler));
|
||||
})(this, (function (Data, EventHandler) { 'use strict';
|
||||
|
||||
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
||||
|
||||
const Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
||||
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./util/index.js'), require('./dom/event-handler.js'), require('./util/config.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './util/index', './dom/event-handler', './util/config'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BaseComponent = factory(global.Data, global.Index, global.EventHandler, global.Config));
|
||||
})(this, (function (Data, index_js, EventHandler, Config) { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Bootstrap (v5.3.0-alpha1): base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
const MILLISECONDS_MULTIPLIER = 1000;
|
||||
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
|
||||
const getTransitionDurationFromElement = element => {
|
||||
if (!element) {
|
||||
return 0;
|
||||
} // Get transition-duration of the element
|
||||
|
||||
|
||||
let {
|
||||
transitionDuration,
|
||||
transitionDelay
|
||||
} = window.getComputedStyle(element);
|
||||
const floatTransitionDuration = Number.parseFloat(transitionDuration);
|
||||
const floatTransitionDelay = Number.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 (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
|
||||
};
|
||||
|
||||
const triggerTransitionEnd = element => {
|
||||
element.dispatchEvent(new Event(TRANSITION_END));
|
||||
};
|
||||
|
||||
const isElement = obj => {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof obj.jquery !== 'undefined') {
|
||||
obj = obj[0];
|
||||
}
|
||||
|
||||
return typeof obj.nodeType !== 'undefined';
|
||||
};
|
||||
|
||||
const getElement = obj => {
|
||||
if (isElement(obj)) {
|
||||
// it's a jQuery object or a node element
|
||||
return obj.jquery ? obj[0] : obj;
|
||||
}
|
||||
|
||||
if (typeof obj === 'string' && obj.length > 0) {
|
||||
return document.querySelector(obj);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const execute = callback => {
|
||||
if (typeof callback === 'function') {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
|
||||
if (!waitForTransition) {
|
||||
execute(callback);
|
||||
return;
|
||||
}
|
||||
|
||||
const durationPadding = 5;
|
||||
const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
|
||||
let called = false;
|
||||
|
||||
const handler = ({
|
||||
target
|
||||
}) => {
|
||||
if (target !== transitionElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
called = true;
|
||||
transitionElement.removeEventListener(TRANSITION_END, handler);
|
||||
execute(callback);
|
||||
};
|
||||
|
||||
transitionElement.addEventListener(TRANSITION_END, handler);
|
||||
setTimeout(() => {
|
||||
if (!called) {
|
||||
triggerTransitionEnd(transitionElement);
|
||||
}
|
||||
}, emulatedDuration);
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const VERSION = '5.1.3';
|
||||
const VERSION = '5.3.0-alpha1';
|
||||
|
||||
class BaseComponent {
|
||||
constructor(element) {
|
||||
element = getElement(element);
|
||||
/**
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class BaseComponent extends Config {
|
||||
constructor(element, config) {
|
||||
super();
|
||||
element = index_js.getElement(element);
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default.default.set(this._element, this.constructor.DATA_KEY, this);
|
||||
this._config = this._getConfig(config);
|
||||
Data.set(this._element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
// Public
|
||||
dispose() {
|
||||
Data__default.default.remove(this._element, this.constructor.DATA_KEY);
|
||||
EventHandler__default.default.off(this._element, this.constructor.EVENT_KEY);
|
||||
Object.getOwnPropertyNames(this).forEach(propertyName => {
|
||||
Data.remove(this._element, this.constructor.DATA_KEY);
|
||||
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
||||
for (const propertyName of Object.getOwnPropertyNames(this)) {
|
||||
this[propertyName] = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_queueCallback(callback, element, isAnimated = true) {
|
||||
executeAfterTransition(callback, element, isAnimated);
|
||||
index_js.executeAfterTransition(callback, element, isAnimated);
|
||||
}
|
||||
_getConfig(config) {
|
||||
config = this._mergeConfigObj(config, this._element);
|
||||
config = this._configAfterMerge(config);
|
||||
this._typeCheckConfig(config);
|
||||
return config;
|
||||
}
|
||||
/** Static */
|
||||
|
||||
|
||||
// Static
|
||||
static getInstance(element) {
|
||||
return Data__default.default.get(getElement(element), this.DATA_KEY);
|
||||
return Data.get(index_js.getElement(element), this.DATA_KEY);
|
||||
}
|
||||
|
||||
static getOrCreateInstance(element, config = {}) {
|
||||
return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
|
||||
}
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
static get NAME() {
|
||||
throw new Error('You have to implement the static method "NAME", for each component!');
|
||||
}
|
||||
|
||||
static get DATA_KEY() {
|
||||
return `bs.${this.NAME}`;
|
||||
}
|
||||
|
||||
static get EVENT_KEY() {
|
||||
return `.${this.DATA_KEY}`;
|
||||
}
|
||||
|
||||
static eventName(name) {
|
||||
return `${name}${this.EVENT_KEY}`;
|
||||
}
|
||||
}
|
||||
|
||||
return BaseComponent;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,84 +1,23 @@
|
|||
/*!
|
||||
* Bootstrap button.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap button.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/event-handler', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.EventHandler, global.Base));
|
||||
})(this, (function (EventHandler, BaseComponent) { 'use strict';
|
||||
|
||||
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
||||
|
||||
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
||||
const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index.js'), require('./dom/event-handler.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./util/index', './dom/event-handler', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.Index, global.EventHandler, global.BaseComponent));
|
||||
})(this, (function (index_js, EventHandler, BaseComponent) { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Bootstrap (v5.3.0-alpha1): button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const getjQuery = () => {
|
||||
const {
|
||||
jQuery
|
||||
} = window;
|
||||
|
||||
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
||||
return jQuery;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const DOMContentLoadedCallbacks = [];
|
||||
|
||||
const onDOMContentLoaded = callback => {
|
||||
if (document.readyState === 'loading') {
|
||||
// add listener on the first call when the document is in loading state
|
||||
if (!DOMContentLoadedCallbacks.length) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
DOMContentLoadedCallbacks.forEach(callback => callback());
|
||||
});
|
||||
}
|
||||
|
||||
DOMContentLoadedCallbacks.push(callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const defineJQueryPlugin = plugin => {
|
||||
onDOMContentLoaded(() => {
|
||||
const $ = getjQuery();
|
||||
/* istanbul ignore if */
|
||||
|
||||
if ($) {
|
||||
const name = plugin.NAME;
|
||||
const JQUERY_NO_CONFLICT = $.fn[name];
|
||||
$.fn[name] = plugin.jQueryInterface;
|
||||
$.fn[name].Constructor = plugin;
|
||||
|
||||
$.fn[name].noConflict = () => {
|
||||
$.fn[name] = JQUERY_NO_CONFLICT;
|
||||
return plugin.jQueryInterface;
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'button';
|
||||
|
@ -88,57 +27,50 @@
|
|||
const CLASS_NAME_ACTIVE = 'active';
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Button extends BaseComponent__default.default {
|
||||
class Button extends BaseComponent {
|
||||
// Getters
|
||||
static get NAME() {
|
||||
return NAME;
|
||||
} // Public
|
||||
|
||||
}
|
||||
|
||||
// Public
|
||||
toggle() {
|
||||
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
||||
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
||||
} // Static
|
||||
|
||||
}
|
||||
|
||||
// Static
|
||||
static jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
const data = Button.getOrCreateInstance(this);
|
||||
|
||||
if (config === 'toggle') {
|
||||
data[config]();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
|
||||
event.preventDefault();
|
||||
const button = event.target.closest(SELECTOR_DATA_TOGGLE);
|
||||
const data = Button.getOrCreateInstance(button);
|
||||
data.toggle();
|
||||
});
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
* add .Button to jQuery only if jQuery is present
|
||||
*/
|
||||
|
||||
defineJQueryPlugin(Button);
|
||||
index_js.defineJQueryPlugin(Button);
|
||||
|
||||
return Button;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,203 +1,23 @@
|
|||
/*!
|
||||
* Bootstrap carousel.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap carousel.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Carousel = factory(global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
|
||||
})(this, (function (EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
|
||||
|
||||
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
||||
|
||||
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
||||
const Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
|
||||
const SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
|
||||
const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./util/swipe.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./util/index', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './util/swipe', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Carousel = factory(global.Index, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Swipe, global.BaseComponent));
|
||||
})(this, (function (index_js, EventHandler, Manipulator, SelectorEngine, Swipe, BaseComponent) { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Bootstrap (v5.3.0-alpha1): carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
|
||||
const toType = obj => {
|
||||
if (obj === null || obj === undefined) {
|
||||
return `${obj}`;
|
||||
}
|
||||
|
||||
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
|
||||
};
|
||||
|
||||
const getSelector = element => {
|
||||
let selector = element.getAttribute('data-bs-target');
|
||||
|
||||
if (!selector || selector === '#') {
|
||||
let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
|
||||
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
||||
// `document.querySelector` will rightfully complain it is invalid.
|
||||
// See https://github.com/twbs/bootstrap/issues/32273
|
||||
|
||||
if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
|
||||
return null;
|
||||
} // Just in case some CMS puts out a full URL with the anchor appended
|
||||
|
||||
|
||||
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
||||
hrefAttr = `#${hrefAttr.split('#')[1]}`;
|
||||
}
|
||||
|
||||
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
|
||||
}
|
||||
|
||||
return selector;
|
||||
};
|
||||
|
||||
const getElementFromSelector = element => {
|
||||
const selector = getSelector(element);
|
||||
return selector ? document.querySelector(selector) : null;
|
||||
};
|
||||
|
||||
const triggerTransitionEnd = element => {
|
||||
element.dispatchEvent(new Event(TRANSITION_END));
|
||||
};
|
||||
|
||||
const isElement = obj => {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof obj.jquery !== 'undefined') {
|
||||
obj = obj[0];
|
||||
}
|
||||
|
||||
return typeof obj.nodeType !== 'undefined';
|
||||
};
|
||||
|
||||
const typeCheckConfig = (componentName, config, configTypes) => {
|
||||
Object.keys(configTypes).forEach(property => {
|
||||
const expectedTypes = configTypes[property];
|
||||
const value = config[property];
|
||||
const valueType = value && isElement(value) ? 'element' : toType(value);
|
||||
|
||||
if (!new RegExp(expectedTypes).test(valueType)) {
|
||||
throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const isVisible = element => {
|
||||
if (!isElement(element) || element.getClientRects().length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
|
||||
};
|
||||
/**
|
||||
* Trick to restart an element's animation
|
||||
*
|
||||
* @param {HTMLElement} element
|
||||
* @return void
|
||||
*
|
||||
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
||||
*/
|
||||
|
||||
|
||||
const reflow = element => {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
element.offsetHeight;
|
||||
};
|
||||
|
||||
const getjQuery = () => {
|
||||
const {
|
||||
jQuery
|
||||
} = window;
|
||||
|
||||
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
||||
return jQuery;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const DOMContentLoadedCallbacks = [];
|
||||
|
||||
const onDOMContentLoaded = callback => {
|
||||
if (document.readyState === 'loading') {
|
||||
// add listener on the first call when the document is in loading state
|
||||
if (!DOMContentLoadedCallbacks.length) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
DOMContentLoadedCallbacks.forEach(callback => callback());
|
||||
});
|
||||
}
|
||||
|
||||
DOMContentLoadedCallbacks.push(callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const isRTL = () => document.documentElement.dir === 'rtl';
|
||||
|
||||
const defineJQueryPlugin = plugin => {
|
||||
onDOMContentLoaded(() => {
|
||||
const $ = getjQuery();
|
||||
/* istanbul ignore if */
|
||||
|
||||
if ($) {
|
||||
const name = plugin.NAME;
|
||||
const JQUERY_NO_CONFLICT = $.fn[name];
|
||||
$.fn[name] = plugin.jQueryInterface;
|
||||
$.fn[name].Constructor = plugin;
|
||||
|
||||
$.fn[name].noConflict = () => {
|
||||
$.fn[name] = JQUERY_NO_CONFLICT;
|
||||
return plugin.jQueryInterface;
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return the previous/next element of a list.
|
||||
*
|
||||
* @param {array} list The list of elements
|
||||
* @param activeElement The active element
|
||||
* @param shouldGetNext Choose to get next or previous element
|
||||
* @param isCycleAllowed
|
||||
* @return {Element|elem} The proper element
|
||||
*/
|
||||
|
||||
|
||||
const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
|
||||
let index = list.indexOf(activeElement); // if the element does not exist in the list return an element depending on the direction and if cycle is allowed
|
||||
|
||||
if (index === -1) {
|
||||
return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0];
|
||||
}
|
||||
|
||||
const listLength = list.length;
|
||||
index += shouldGetNext ? 1 : -1;
|
||||
|
||||
if (isCycleAllowed) {
|
||||
index = (index + listLength) % listLength;
|
||||
}
|
||||
|
||||
return list[Math.max(0, Math.min(index, listLength - 1))];
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'carousel';
|
||||
|
@ -208,41 +28,15 @@
|
|||
const ARROW_RIGHT_KEY = 'ArrowRight';
|
||||
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 ORDER_NEXT = 'next';
|
||||
const ORDER_PREV = 'prev';
|
||||
const DIRECTION_LEFT = 'left';
|
||||
const DIRECTION_RIGHT = 'right';
|
||||
const KEY_TO_DIRECTION = {
|
||||
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
|
||||
[ARROW_RIGHT_KEY]: DIRECTION_LEFT
|
||||
};
|
||||
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}`;
|
||||
|
@ -253,489 +47,339 @@
|
|||
const CLASS_NAME_START = 'carousel-item-start';
|
||||
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_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_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_INDICATOR = '[data-bs-target]';
|
||||
const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';
|
||||
const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]';
|
||||
const POINTER_TYPE_TOUCH = 'touch';
|
||||
const POINTER_TYPE_PEN = 'pen';
|
||||
const KEY_TO_DIRECTION = {
|
||||
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
|
||||
[ARROW_RIGHT_KEY]: DIRECTION_LEFT
|
||||
};
|
||||
const Default = {
|
||||
interval: 5000,
|
||||
keyboard: true,
|
||||
pause: 'hover',
|
||||
ride: false,
|
||||
touch: true,
|
||||
wrap: true
|
||||
};
|
||||
const DefaultType = {
|
||||
interval: '(number|boolean)',
|
||||
// TODO:v6 remove boolean support
|
||||
keyboard: 'boolean',
|
||||
pause: '(string|boolean)',
|
||||
ride: '(boolean|string)',
|
||||
touch: 'boolean',
|
||||
wrap: 'boolean'
|
||||
};
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Carousel extends BaseComponent__default.default {
|
||||
class Carousel extends BaseComponent {
|
||||
constructor(element, config) {
|
||||
super(element);
|
||||
this._items = null;
|
||||
super(element, config);
|
||||
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._indicatorsElement = SelectorEngine__default.default.findOne(SELECTOR_INDICATORS, this._element);
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
this._pointerEvent = Boolean(window.PointerEvent);
|
||||
|
||||
this._swipeHelper = null;
|
||||
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
|
||||
this._addEventListeners();
|
||||
} // Getters
|
||||
|
||||
if (this._config.ride === CLASS_NAME_CAROUSEL) {
|
||||
this.cycle();
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
static get Default() {
|
||||
return Default;
|
||||
}
|
||||
|
||||
static get DefaultType() {
|
||||
return DefaultType;
|
||||
}
|
||||
static get NAME() {
|
||||
return NAME;
|
||||
} // Public
|
||||
|
||||
}
|
||||
|
||||
// Public
|
||||
next() {
|
||||
this._slide(ORDER_NEXT);
|
||||
}
|
||||
|
||||
nextWhenVisible() {
|
||||
// FIXME TODO use `document.visibilityState`
|
||||
// Don't call next when the page isn't visible
|
||||
// or the carousel or its parent isn't visible
|
||||
if (!document.hidden && isVisible(this._element)) {
|
||||
if (!document.hidden && index_js.isVisible(this._element)) {
|
||||
this.next();
|
||||
}
|
||||
}
|
||||
|
||||
prev() {
|
||||
this._slide(ORDER_PREV);
|
||||
}
|
||||
|
||||
pause(event) {
|
||||
if (!event) {
|
||||
this._isPaused = true;
|
||||
}
|
||||
|
||||
if (SelectorEngine__default.default.findOne(SELECTOR_NEXT_PREV, this._element)) {
|
||||
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 && this._config.interval && !this._isPaused) {
|
||||
this._updateInterval();
|
||||
|
||||
this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
|
||||
}
|
||||
}
|
||||
|
||||
to(index) {
|
||||
this._activeElement = SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
const activeIndex = this._getItemIndex(this._activeElement);
|
||||
|
||||
if (index > this._items.length - 1 || index < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
pause() {
|
||||
if (this._isSliding) {
|
||||
EventHandler__default.default.one(this._element, EVENT_SLID, () => this.to(index));
|
||||
index_js.triggerTransitionEnd(this._element);
|
||||
}
|
||||
this._clearInterval();
|
||||
}
|
||||
cycle() {
|
||||
this._clearInterval();
|
||||
this._updateInterval();
|
||||
this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval);
|
||||
}
|
||||
_maybeEnableCycle() {
|
||||
if (!this._config.ride) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._isSliding) {
|
||||
EventHandler.one(this._element, EVENT_SLID, () => this.cycle());
|
||||
return;
|
||||
}
|
||||
this.cycle();
|
||||
}
|
||||
to(index) {
|
||||
const items = this._getItems();
|
||||
if (index > items.length - 1 || index < 0) {
|
||||
return;
|
||||
}
|
||||
if (this._isSliding) {
|
||||
EventHandler.one(this._element, EVENT_SLID, () => this.to(index));
|
||||
return;
|
||||
}
|
||||
const activeIndex = this._getItemIndex(this._getActive());
|
||||
if (activeIndex === index) {
|
||||
this.pause();
|
||||
this.cycle();
|
||||
return;
|
||||
}
|
||||
|
||||
const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;
|
||||
this._slide(order, items[index]);
|
||||
}
|
||||
dispose() {
|
||||
if (this._swipeHelper) {
|
||||
this._swipeHelper.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
this._slide(order, this._items[index]);
|
||||
} // Private
|
||||
|
||||
|
||||
_getConfig(config) {
|
||||
config = { ...Default,
|
||||
...Manipulator__default.default.getDataAttributes(this._element),
|
||||
...(typeof config === 'object' ? config : {})
|
||||
};
|
||||
typeCheckConfig(NAME, config, DefaultType);
|
||||
// Private
|
||||
_configAfterMerge(config) {
|
||||
config.defaultInterval = config.interval;
|
||||
return config;
|
||||
}
|
||||
|
||||
_handleSwipe() {
|
||||
const absDeltax = Math.abs(this.touchDeltaX);
|
||||
|
||||
if (absDeltax <= SWIPE_THRESHOLD) {
|
||||
return;
|
||||
}
|
||||
|
||||
const direction = absDeltax / this.touchDeltaX;
|
||||
this.touchDeltaX = 0;
|
||||
|
||||
if (!direction) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._slide(direction > 0 ? DIRECTION_RIGHT : DIRECTION_LEFT);
|
||||
}
|
||||
|
||||
_addEventListeners() {
|
||||
if (this._config.keyboard) {
|
||||
EventHandler__default.default.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));
|
||||
EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
EventHandler__default.default.on(this._element, EVENT_MOUSEENTER, event => this.pause(event));
|
||||
EventHandler__default.default.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event));
|
||||
EventHandler.on(this._element, EVENT_MOUSEENTER, () => this.pause());
|
||||
EventHandler.on(this._element, EVENT_MOUSELEAVE, () => this._maybeEnableCycle());
|
||||
}
|
||||
|
||||
if (this._config.touch && this._touchSupported) {
|
||||
if (this._config.touch && Swipe.isSupported()) {
|
||||
this._addTouchEventListeners();
|
||||
}
|
||||
}
|
||||
|
||||
_addTouchEventListeners() {
|
||||
const hasPointerPenTouch = event => {
|
||||
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
|
||||
};
|
||||
|
||||
const start = event => {
|
||||
if (hasPointerPenTouch(event)) {
|
||||
this.touchStartX = event.clientX;
|
||||
} else if (!this._pointerEvent) {
|
||||
this.touchStartX = event.touches[0].clientX;
|
||||
}
|
||||
};
|
||||
|
||||
const move = event => {
|
||||
// ensure swiping with one touch and not pinching
|
||||
this.touchDeltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this.touchStartX;
|
||||
};
|
||||
|
||||
const end = event => {
|
||||
if (hasPointerPenTouch(event)) {
|
||||
this.touchDeltaX = event.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);
|
||||
}
|
||||
};
|
||||
|
||||
SelectorEngine__default.default.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
|
||||
EventHandler__default.default.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());
|
||||
});
|
||||
|
||||
if (this._pointerEvent) {
|
||||
EventHandler__default.default.on(this._element, EVENT_POINTERDOWN, event => start(event));
|
||||
EventHandler__default.default.on(this._element, EVENT_POINTERUP, event => end(event));
|
||||
|
||||
this._element.classList.add(CLASS_NAME_POINTER_EVENT);
|
||||
} else {
|
||||
EventHandler__default.default.on(this._element, EVENT_TOUCHSTART, event => start(event));
|
||||
EventHandler__default.default.on(this._element, EVENT_TOUCHMOVE, event => move(event));
|
||||
EventHandler__default.default.on(this._element, EVENT_TOUCHEND, event => end(event));
|
||||
for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {
|
||||
EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault());
|
||||
}
|
||||
}
|
||||
const endCallBack = () => {
|
||||
if (this._config.pause !== 'hover') {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval);
|
||||
};
|
||||
const swipeConfig = {
|
||||
leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),
|
||||
rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),
|
||||
endCallback: endCallBack
|
||||
};
|
||||
this._swipeHelper = new Swipe(this._element, swipeConfig);
|
||||
}
|
||||
_keydown(event) {
|
||||
if (/input|textarea/i.test(event.target.tagName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const direction = KEY_TO_DIRECTION[event.key];
|
||||
|
||||
if (direction) {
|
||||
event.preventDefault();
|
||||
|
||||
this._slide(direction);
|
||||
this._slide(this._directionToOrder(direction));
|
||||
}
|
||||
}
|
||||
|
||||
_getItemIndex(element) {
|
||||
this._items = element && element.parentNode ? SelectorEngine__default.default.find(SELECTOR_ITEM, element.parentNode) : [];
|
||||
return this._items.indexOf(element);
|
||||
return this._getItems().indexOf(element);
|
||||
}
|
||||
|
||||
_getItemByOrder(order, activeElement) {
|
||||
const isNext = order === ORDER_NEXT;
|
||||
return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap);
|
||||
}
|
||||
|
||||
_triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||
const targetIndex = this._getItemIndex(relatedTarget);
|
||||
|
||||
const fromIndex = this._getItemIndex(SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM, this._element));
|
||||
|
||||
return EventHandler__default.default.trigger(this._element, EVENT_SLIDE, {
|
||||
relatedTarget,
|
||||
direction: eventDirectionName,
|
||||
from: fromIndex,
|
||||
to: targetIndex
|
||||
});
|
||||
}
|
||||
|
||||
_setActiveIndicatorElement(element) {
|
||||
if (this._indicatorsElement) {
|
||||
const activeIndicator = SelectorEngine__default.default.findOne(SELECTOR_ACTIVE, this._indicatorsElement);
|
||||
activeIndicator.classList.remove(CLASS_NAME_ACTIVE);
|
||||
activeIndicator.removeAttribute('aria-current');
|
||||
const indicators = SelectorEngine__default.default.find(SELECTOR_INDICATOR, this._indicatorsElement);
|
||||
|
||||
for (let i = 0; i < indicators.length; i++) {
|
||||
if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
|
||||
indicators[i].classList.add(CLASS_NAME_ACTIVE);
|
||||
indicators[i].setAttribute('aria-current', 'true');
|
||||
break;
|
||||
}
|
||||
}
|
||||
_setActiveIndicatorElement(index) {
|
||||
if (!this._indicatorsElement) {
|
||||
return;
|
||||
}
|
||||
const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);
|
||||
activeIndicator.classList.remove(CLASS_NAME_ACTIVE);
|
||||
activeIndicator.removeAttribute('aria-current');
|
||||
const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement);
|
||||
if (newActiveIndicator) {
|
||||
newActiveIndicator.classList.add(CLASS_NAME_ACTIVE);
|
||||
newActiveIndicator.setAttribute('aria-current', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
_updateInterval() {
|
||||
const element = this._activeElement || SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
const element = this._activeElement || this._getActive();
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);
|
||||
|
||||
if (elementInterval) {
|
||||
this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
|
||||
this._config.interval = elementInterval;
|
||||
} else {
|
||||
this._config.interval = this._config.defaultInterval || this._config.interval;
|
||||
}
|
||||
this._config.interval = elementInterval || this._config.defaultInterval;
|
||||
}
|
||||
|
||||
_slide(directionOrOrder, element) {
|
||||
const order = this._directionToOrder(directionOrOrder);
|
||||
|
||||
const activeElement = SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
const activeElementIndex = this._getItemIndex(activeElement);
|
||||
|
||||
const nextElement = element || this._getItemByOrder(order, activeElement);
|
||||
|
||||
const nextElementIndex = this._getItemIndex(nextElement);
|
||||
|
||||
const isCycling = Boolean(this._interval);
|
||||
const isNext = order === ORDER_NEXT;
|
||||
const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;
|
||||
const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;
|
||||
|
||||
const eventDirectionName = this._orderToDirection(order);
|
||||
|
||||
if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE)) {
|
||||
this._isSliding = false;
|
||||
return;
|
||||
}
|
||||
|
||||
_slide(order, element = null) {
|
||||
if (this._isSliding) {
|
||||
return;
|
||||
}
|
||||
|
||||
const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
|
||||
|
||||
if (slideEvent.defaultPrevented) {
|
||||
const activeElement = this._getActive();
|
||||
const isNext = order === ORDER_NEXT;
|
||||
const nextElement = element || index_js.getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap);
|
||||
if (nextElement === activeElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!activeElement || !nextElement) {
|
||||
// Some weirdness is happening, so we bail
|
||||
return;
|
||||
}
|
||||
|
||||
this._isSliding = true;
|
||||
|
||||
if (isCycling) {
|
||||
this.pause();
|
||||
}
|
||||
|
||||
this._setActiveIndicatorElement(nextElement);
|
||||
|
||||
this._activeElement = nextElement;
|
||||
|
||||
const triggerSlidEvent = () => {
|
||||
EventHandler__default.default.trigger(this._element, EVENT_SLID, {
|
||||
const nextElementIndex = this._getItemIndex(nextElement);
|
||||
const triggerEvent = eventName => {
|
||||
return EventHandler.trigger(this._element, eventName, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
direction: this._orderToDirection(order),
|
||||
from: this._getItemIndex(activeElement),
|
||||
to: nextElementIndex
|
||||
});
|
||||
};
|
||||
|
||||
if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
|
||||
nextElement.classList.add(orderClassName);
|
||||
reflow(nextElement);
|
||||
activeElement.classList.add(directionalClassName);
|
||||
nextElement.classList.add(directionalClassName);
|
||||
|
||||
const completeCallBack = () => {
|
||||
nextElement.classList.remove(directionalClassName, orderClassName);
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE);
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName);
|
||||
this._isSliding = false;
|
||||
setTimeout(triggerSlidEvent, 0);
|
||||
};
|
||||
|
||||
this._queueCallback(completeCallBack, activeElement, true);
|
||||
} else {
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE);
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE);
|
||||
this._isSliding = false;
|
||||
triggerSlidEvent();
|
||||
const slideEvent = triggerEvent(EVENT_SLIDE);
|
||||
if (slideEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!activeElement || !nextElement) {
|
||||
// Some weirdness is happening, so we bail
|
||||
// todo: change tests that use empty divs to avoid this check
|
||||
return;
|
||||
}
|
||||
const isCycling = Boolean(this._interval);
|
||||
this.pause();
|
||||
this._isSliding = true;
|
||||
this._setActiveIndicatorElement(nextElementIndex);
|
||||
this._activeElement = nextElement;
|
||||
const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;
|
||||
const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;
|
||||
nextElement.classList.add(orderClassName);
|
||||
index_js.reflow(nextElement);
|
||||
activeElement.classList.add(directionalClassName);
|
||||
nextElement.classList.add(directionalClassName);
|
||||
const completeCallBack = () => {
|
||||
nextElement.classList.remove(directionalClassName, orderClassName);
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE);
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName);
|
||||
this._isSliding = false;
|
||||
triggerEvent(EVENT_SLID);
|
||||
};
|
||||
this._queueCallback(completeCallBack, activeElement, this._isAnimated());
|
||||
if (isCycling) {
|
||||
this.cycle();
|
||||
}
|
||||
}
|
||||
|
||||
_directionToOrder(direction) {
|
||||
if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) {
|
||||
return direction;
|
||||
_isAnimated() {
|
||||
return this._element.classList.contains(CLASS_NAME_SLIDE);
|
||||
}
|
||||
_getActive() {
|
||||
return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
}
|
||||
_getItems() {
|
||||
return SelectorEngine.find(SELECTOR_ITEM, this._element);
|
||||
}
|
||||
_clearInterval() {
|
||||
if (this._interval) {
|
||||
clearInterval(this._interval);
|
||||
this._interval = null;
|
||||
}
|
||||
|
||||
if (isRTL()) {
|
||||
}
|
||||
_directionToOrder(direction) {
|
||||
if (index_js.isRTL()) {
|
||||
return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;
|
||||
}
|
||||
|
||||
return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;
|
||||
}
|
||||
|
||||
_orderToDirection(order) {
|
||||
if (![ORDER_NEXT, ORDER_PREV].includes(order)) {
|
||||
return order;
|
||||
}
|
||||
|
||||
if (isRTL()) {
|
||||
if (index_js.isRTL()) {
|
||||
return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
||||
}
|
||||
|
||||
return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;
|
||||
} // Static
|
||||
|
||||
|
||||
static carouselInterface(element, config) {
|
||||
const data = Carousel.getOrCreateInstance(element, config);
|
||||
let {
|
||||
_config
|
||||
} = data;
|
||||
|
||||
if (typeof config === 'object') {
|
||||
_config = { ..._config,
|
||||
...config
|
||||
};
|
||||
}
|
||||
|
||||
const action = typeof config === 'string' ? config : _config.slide;
|
||||
|
||||
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
|
||||
static jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
Carousel.carouselInterface(this, config);
|
||||
const data = Carousel.getOrCreateInstance(this, config);
|
||||
if (typeof config === 'number') {
|
||||
data.to(config);
|
||||
return;
|
||||
}
|
||||
if (typeof config === 'string') {
|
||||
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
||||
throw new TypeError(`No method named "${config}"`);
|
||||
}
|
||||
data[config]();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static dataApiClickHandler(event) {
|
||||
const target = getElementFromSelector(this);
|
||||
|
||||
if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const config = { ...Manipulator__default.default.getDataAttributes(target),
|
||||
...Manipulator__default.default.getDataAttributes(this)
|
||||
};
|
||||
const slideIndex = this.getAttribute('data-bs-slide-to');
|
||||
|
||||
if (slideIndex) {
|
||||
config.interval = false;
|
||||
}
|
||||
|
||||
Carousel.carouselInterface(target, config);
|
||||
|
||||
if (slideIndex) {
|
||||
Carousel.getInstance(target).to(slideIndex);
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler);
|
||||
EventHandler__default.default.on(window, EVENT_LOAD_DATA_API, () => {
|
||||
const carousels = SelectorEngine__default.default.find(SELECTOR_DATA_RIDE);
|
||||
|
||||
for (let i = 0, len = carousels.length; i < len; i++) {
|
||||
Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]));
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {
|
||||
const target = SelectorEngine.getElementFromSelector(this);
|
||||
if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
const carousel = Carousel.getOrCreateInstance(target);
|
||||
const slideIndex = this.getAttribute('data-bs-slide-to');
|
||||
if (slideIndex) {
|
||||
carousel.to(slideIndex);
|
||||
carousel._maybeEnableCycle();
|
||||
return;
|
||||
}
|
||||
if (Manipulator.getDataAttribute(this, 'slide') === 'next') {
|
||||
carousel.next();
|
||||
carousel._maybeEnableCycle();
|
||||
return;
|
||||
}
|
||||
carousel.prev();
|
||||
carousel._maybeEnableCycle();
|
||||
});
|
||||
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
||||
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
|
||||
for (const carousel of carousels) {
|
||||
Carousel.getOrCreateInstance(carousel);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
* add .Carousel to jQuery only if jQuery is present
|
||||
*/
|
||||
|
||||
defineJQueryPlugin(Carousel);
|
||||
index_js.defineJQueryPlugin(Carousel);
|
||||
|
||||
return Carousel;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,199 +1,29 @@
|
|||
/*!
|
||||
* Bootstrap collapse.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap collapse.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
|
||||
})(this, (function (Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
|
||||
|
||||
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
||||
|
||||
const Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
||||
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
||||
const Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
|
||||
const SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
|
||||
const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./util/index', './dom/event-handler', './dom/selector-engine', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.Index, global.EventHandler, global.SelectorEngine, global.BaseComponent));
|
||||
})(this, (function (index_js, EventHandler, SelectorEngine, BaseComponent) { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Bootstrap (v5.3.0-alpha1): collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const toType = obj => {
|
||||
if (obj === null || obj === undefined) {
|
||||
return `${obj}`;
|
||||
}
|
||||
|
||||
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
|
||||
};
|
||||
|
||||
const getSelector = element => {
|
||||
let selector = element.getAttribute('data-bs-target');
|
||||
|
||||
if (!selector || selector === '#') {
|
||||
let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
|
||||
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
||||
// `document.querySelector` will rightfully complain it is invalid.
|
||||
// See https://github.com/twbs/bootstrap/issues/32273
|
||||
|
||||
if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
|
||||
return null;
|
||||
} // Just in case some CMS puts out a full URL with the anchor appended
|
||||
|
||||
|
||||
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
||||
hrefAttr = `#${hrefAttr.split('#')[1]}`;
|
||||
}
|
||||
|
||||
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
|
||||
}
|
||||
|
||||
return selector;
|
||||
};
|
||||
|
||||
const getSelectorFromElement = element => {
|
||||
const selector = getSelector(element);
|
||||
|
||||
if (selector) {
|
||||
return document.querySelector(selector) ? selector : null;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const getElementFromSelector = element => {
|
||||
const selector = getSelector(element);
|
||||
return selector ? document.querySelector(selector) : null;
|
||||
};
|
||||
|
||||
const isElement = obj => {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof obj.jquery !== 'undefined') {
|
||||
obj = obj[0];
|
||||
}
|
||||
|
||||
return typeof obj.nodeType !== 'undefined';
|
||||
};
|
||||
|
||||
const getElement = obj => {
|
||||
if (isElement(obj)) {
|
||||
// it's a jQuery object or a node element
|
||||
return obj.jquery ? obj[0] : obj;
|
||||
}
|
||||
|
||||
if (typeof obj === 'string' && obj.length > 0) {
|
||||
return document.querySelector(obj);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const typeCheckConfig = (componentName, config, configTypes) => {
|
||||
Object.keys(configTypes).forEach(property => {
|
||||
const expectedTypes = configTypes[property];
|
||||
const value = config[property];
|
||||
const valueType = value && isElement(value) ? 'element' : toType(value);
|
||||
|
||||
if (!new RegExp(expectedTypes).test(valueType)) {
|
||||
throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Trick to restart an element's animation
|
||||
*
|
||||
* @param {HTMLElement} element
|
||||
* @return void
|
||||
*
|
||||
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
||||
*/
|
||||
|
||||
|
||||
const reflow = element => {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
element.offsetHeight;
|
||||
};
|
||||
|
||||
const getjQuery = () => {
|
||||
const {
|
||||
jQuery
|
||||
} = window;
|
||||
|
||||
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
||||
return jQuery;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const DOMContentLoadedCallbacks = [];
|
||||
|
||||
const onDOMContentLoaded = callback => {
|
||||
if (document.readyState === 'loading') {
|
||||
// add listener on the first call when the document is in loading state
|
||||
if (!DOMContentLoadedCallbacks.length) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
DOMContentLoadedCallbacks.forEach(callback => callback());
|
||||
});
|
||||
}
|
||||
|
||||
DOMContentLoadedCallbacks.push(callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const defineJQueryPlugin = plugin => {
|
||||
onDOMContentLoaded(() => {
|
||||
const $ = getjQuery();
|
||||
/* istanbul ignore if */
|
||||
|
||||
if ($) {
|
||||
const name = plugin.NAME;
|
||||
const JQUERY_NO_CONFLICT = $.fn[name];
|
||||
$.fn[name] = plugin.jQueryInterface;
|
||||
$.fn[name].Constructor = plugin;
|
||||
|
||||
$.fn[name].noConflict = () => {
|
||||
$.fn[name] = JQUERY_NO_CONFLICT;
|
||||
return plugin.jQueryInterface;
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'collapse';
|
||||
const DATA_KEY = 'bs.collapse';
|
||||
const EVENT_KEY = `.${DATA_KEY}`;
|
||||
const DATA_API_KEY = '.data-api';
|
||||
const Default = {
|
||||
toggle: true,
|
||||
parent: null
|
||||
};
|
||||
const DefaultType = {
|
||||
toggle: 'boolean',
|
||||
parent: '(null|element)'
|
||||
};
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`;
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`;
|
||||
|
@ -209,53 +39,53 @@
|
|||
const HEIGHT = 'height';
|
||||
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]';
|
||||
const Default = {
|
||||
parent: null,
|
||||
toggle: true
|
||||
};
|
||||
const DefaultType = {
|
||||
parent: '(null|element)',
|
||||
toggle: 'boolean'
|
||||
};
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Collapse extends BaseComponent__default.default {
|
||||
class Collapse extends BaseComponent {
|
||||
constructor(element, config) {
|
||||
super(element);
|
||||
super(element, config);
|
||||
this._isTransitioning = false;
|
||||
this._config = this._getConfig(config);
|
||||
this._triggerArray = [];
|
||||
const toggleList = SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE);
|
||||
|
||||
for (let i = 0, len = toggleList.length; i < len; i++) {
|
||||
const elem = toggleList[i];
|
||||
const selector = getSelectorFromElement(elem);
|
||||
const filterElement = SelectorEngine__default.default.find(selector).filter(foundElem => foundElem === this._element);
|
||||
|
||||
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE);
|
||||
for (const elem of toggleList) {
|
||||
const selector = SelectorEngine.getSelectorFromElement(elem);
|
||||
const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);
|
||||
if (selector !== null && filterElement.length) {
|
||||
this._selector = selector;
|
||||
|
||||
this._triggerArray.push(elem);
|
||||
}
|
||||
}
|
||||
|
||||
this._initializeChildren();
|
||||
|
||||
if (!this._config.parent) {
|
||||
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
|
||||
}
|
||||
|
||||
if (this._config.toggle) {
|
||||
this.toggle();
|
||||
}
|
||||
} // Getters
|
||||
|
||||
}
|
||||
|
||||
// Getters
|
||||
static get Default() {
|
||||
return Default;
|
||||
}
|
||||
|
||||
static get DefaultType() {
|
||||
return DefaultType;
|
||||
}
|
||||
static get NAME() {
|
||||
return NAME;
|
||||
} // Public
|
||||
|
||||
}
|
||||
|
||||
// Public
|
||||
toggle() {
|
||||
if (this._isShown()) {
|
||||
this.hide();
|
||||
|
@ -263,231 +93,154 @@
|
|||
this.show();
|
||||
}
|
||||
}
|
||||
|
||||
show() {
|
||||
if (this._isTransitioning || this._isShown()) {
|
||||
return;
|
||||
}
|
||||
let activeChildren = [];
|
||||
|
||||
let actives = [];
|
||||
let activesData;
|
||||
|
||||
// find active children
|
||||
if (this._config.parent) {
|
||||
const children = SelectorEngine__default.default.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
||||
actives = SelectorEngine__default.default.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
||||
activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, {
|
||||
toggle: false
|
||||
}));
|
||||
}
|
||||
|
||||
const container = SelectorEngine__default.default.findOne(this._selector);
|
||||
|
||||
if (actives.length) {
|
||||
const tempActiveData = actives.find(elem => container !== elem);
|
||||
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
|
||||
|
||||
if (activesData && activesData._isTransitioning) {
|
||||
return;
|
||||
}
|
||||
if (activeChildren.length && activeChildren[0]._isTransitioning) {
|
||||
return;
|
||||
}
|
||||
|
||||
const startEvent = EventHandler__default.default.trigger(this._element, EVENT_SHOW);
|
||||
|
||||
const startEvent = EventHandler.trigger(this._element, EVENT_SHOW);
|
||||
if (startEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
actives.forEach(elemActive => {
|
||||
if (container !== elemActive) {
|
||||
Collapse.getOrCreateInstance(elemActive, {
|
||||
toggle: false
|
||||
}).hide();
|
||||
}
|
||||
|
||||
if (!activesData) {
|
||||
Data__default.default.set(elemActive, DATA_KEY, null);
|
||||
}
|
||||
});
|
||||
|
||||
for (const activeInstance of activeChildren) {
|
||||
activeInstance.hide();
|
||||
}
|
||||
const dimension = this._getDimension();
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_COLLAPSE);
|
||||
|
||||
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
||||
|
||||
this._element.style[dimension] = 0;
|
||||
|
||||
this._addAriaAndCollapsedClass(this._triggerArray, true);
|
||||
|
||||
this._isTransitioning = true;
|
||||
|
||||
const complete = () => {
|
||||
this._isTransitioning = false;
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
EventHandler__default.default.trigger(this._element, EVENT_SHOWN);
|
||||
EventHandler.trigger(this._element, EVENT_SHOWN);
|
||||
};
|
||||
|
||||
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||
const scrollSize = `scroll${capitalizedDimension}`;
|
||||
|
||||
this._queueCallback(complete, this._element, true);
|
||||
|
||||
this._element.style[dimension] = `${this._element[scrollSize]}px`;
|
||||
}
|
||||
|
||||
hide() {
|
||||
if (this._isTransitioning || !this._isShown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const startEvent = EventHandler__default.default.trigger(this._element, EVENT_HIDE);
|
||||
|
||||
const startEvent = EventHandler.trigger(this._element, EVENT_HIDE);
|
||||
if (startEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
const dimension = this._getDimension();
|
||||
|
||||
this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;
|
||||
reflow(this._element);
|
||||
|
||||
index_js.reflow(this._element);
|
||||
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
|
||||
const triggerArrayLength = this._triggerArray.length;
|
||||
|
||||
for (let i = 0; i < triggerArrayLength; i++) {
|
||||
const trigger = this._triggerArray[i];
|
||||
const elem = getElementFromSelector(trigger);
|
||||
|
||||
if (elem && !this._isShown(elem)) {
|
||||
for (const trigger of this._triggerArray) {
|
||||
const element = SelectorEngine.getElementFromSelector(trigger);
|
||||
if (element && !this._isShown(element)) {
|
||||
this._addAriaAndCollapsedClass([trigger], false);
|
||||
}
|
||||
}
|
||||
|
||||
this._isTransitioning = true;
|
||||
|
||||
const complete = () => {
|
||||
this._isTransitioning = false;
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
this._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
|
||||
EventHandler__default.default.trigger(this._element, EVENT_HIDDEN);
|
||||
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
|
||||
this._queueCallback(complete, this._element, true);
|
||||
}
|
||||
|
||||
_isShown(element = this._element) {
|
||||
return element.classList.contains(CLASS_NAME_SHOW);
|
||||
} // Private
|
||||
|
||||
|
||||
_getConfig(config) {
|
||||
config = { ...Default,
|
||||
...Manipulator__default.default.getDataAttributes(this._element),
|
||||
...config
|
||||
};
|
||||
config.toggle = Boolean(config.toggle); // Coerce string values
|
||||
|
||||
config.parent = getElement(config.parent);
|
||||
typeCheckConfig(NAME, config, DefaultType);
|
||||
return config;
|
||||
}
|
||||
|
||||
// Private
|
||||
_configAfterMerge(config) {
|
||||
config.toggle = Boolean(config.toggle); // Coerce string values
|
||||
config.parent = index_js.getElement(config.parent);
|
||||
return config;
|
||||
}
|
||||
_getDimension() {
|
||||
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
|
||||
}
|
||||
|
||||
_initializeChildren() {
|
||||
if (!this._config.parent) {
|
||||
return;
|
||||
}
|
||||
|
||||
const children = SelectorEngine__default.default.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
||||
SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
|
||||
const selected = getElementFromSelector(element);
|
||||
|
||||
const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE);
|
||||
for (const element of children) {
|
||||
const selected = SelectorEngine.getElementFromSelector(element);
|
||||
if (selected) {
|
||||
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
_getFirstLevelChildren(selector) {
|
||||
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
||||
// remove children if greater depth
|
||||
return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element));
|
||||
}
|
||||
|
||||
_addAriaAndCollapsedClass(triggerArray, isOpen) {
|
||||
if (!triggerArray.length) {
|
||||
return;
|
||||
}
|
||||
for (const element of triggerArray) {
|
||||
element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen);
|
||||
element.setAttribute('aria-expanded', isOpen);
|
||||
}
|
||||
}
|
||||
|
||||
triggerArray.forEach(elem => {
|
||||
if (isOpen) {
|
||||
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
||||
} else {
|
||||
elem.classList.add(CLASS_NAME_COLLAPSED);
|
||||
}
|
||||
|
||||
elem.setAttribute('aria-expanded', isOpen);
|
||||
});
|
||||
} // Static
|
||||
|
||||
|
||||
// Static
|
||||
static jQueryInterface(config) {
|
||||
const _config = {};
|
||||
if (typeof config === 'string' && /show|hide/.test(config)) {
|
||||
_config.toggle = false;
|
||||
}
|
||||
return this.each(function () {
|
||||
const _config = {};
|
||||
|
||||
if (typeof config === 'string' && /show|hide/.test(config)) {
|
||||
_config.toggle = false;
|
||||
}
|
||||
|
||||
const data = Collapse.getOrCreateInstance(this, _config);
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`);
|
||||
}
|
||||
|
||||
data[config]();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
EventHandler.on(document, 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.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
const selector = getSelectorFromElement(this);
|
||||
const selectorElements = SelectorEngine__default.default.find(selector);
|
||||
selectorElements.forEach(element => {
|
||||
for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {
|
||||
Collapse.getOrCreateInstance(element, {
|
||||
toggle: false
|
||||
}).toggle();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
* add .Collapse to jQuery only if jQuery is present
|
||||
*/
|
||||
|
||||
defineJQueryPlugin(Collapse);
|
||||
index_js.defineJQueryPlugin(Collapse);
|
||||
|
||||
return Collapse;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
/*!
|
||||
* Bootstrap data.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap data.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
|
@ -11,56 +11,50 @@
|
|||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dom/data.js
|
||||
* Bootstrap (v5.3.0-alpha1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const elementMap = new Map();
|
||||
const data = {
|
||||
set(element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map());
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
|
||||
// make it clear we only want one instance per element
|
||||
// can be removed later when multiple key/instances are fine to be used
|
||||
|
||||
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
||||
return;
|
||||
}
|
||||
|
||||
instanceMap.set(key, instance);
|
||||
},
|
||||
|
||||
get(element, key) {
|
||||
if (elementMap.has(element)) {
|
||||
return elementMap.get(element).get(key) || null;
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
remove(element, key) {
|
||||
if (!elementMap.has(element)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const instanceMap = elementMap.get(element);
|
||||
instanceMap.delete(key); // free up element references if there are no instances left for an element
|
||||
instanceMap.delete(key);
|
||||
|
||||
// free up element references if there are no instances left for an element
|
||||
if (instanceMap.size === 0) {
|
||||
elementMap.delete(element);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return data;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst elementMap = new Map()\n\nexport default {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map())\n }\n\n const instanceMap = elementMap.get(element)\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n return\n }\n\n instanceMap.set(key, instance)\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null\n }\n\n return null\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return\n }\n\n const instanceMap = elementMap.get(element)\n\n instanceMap.delete(key)\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element)\n }\n }\n}\n"],"names":["elementMap","Map","set","element","key","instance","has","instanceMap","get","size","console","error","Array","from","keys","remove","delete"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,MAAMA,UAAU,GAAG,IAAIC,GAAJ,EAAnB;AAEA,eAAe;EACbC,EAAAA,GAAG,CAACC,OAAD,EAAUC,GAAV,EAAeC,QAAf,EAAyB;EAC1B,QAAI,CAACL,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAL,EAA8B;EAC5BH,MAAAA,UAAU,CAACE,GAAX,CAAeC,OAAf,EAAwB,IAAIF,GAAJ,EAAxB;EACD;;EAED,UAAMM,WAAW,GAAGP,UAAU,CAACQ,GAAX,CAAeL,OAAf,CAApB,CAL0B;EAQ1B;;EACA,QAAI,CAACI,WAAW,CAACD,GAAZ,CAAgBF,GAAhB,CAAD,IAAyBG,WAAW,CAACE,IAAZ,KAAqB,CAAlD,EAAqD;EACnD;EACAC,MAAAA,OAAO,CAACC,KAAR,CAAe,+EAA8EC,KAAK,CAACC,IAAN,CAAWN,WAAW,CAACO,IAAZ,EAAX,EAA+B,CAA/B,CAAkC,GAA/H;EACA;EACD;;EAEDP,IAAAA,WAAW,CAACL,GAAZ,CAAgBE,GAAhB,EAAqBC,QAArB;EACD,GAjBY;;EAmBbG,EAAAA,GAAG,CAACL,OAAD,EAAUC,GAAV,EAAe;EAChB,QAAIJ,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAJ,EAA6B;EAC3B,aAAOH,UAAU,CAACQ,GAAX,CAAeL,OAAf,EAAwBK,GAAxB,CAA4BJ,GAA5B,KAAoC,IAA3C;EACD;;EAED,WAAO,IAAP;EACD,GAzBY;;EA2BbW,EAAAA,MAAM,CAACZ,OAAD,EAAUC,GAAV,EAAe;EACnB,QAAI,CAACJ,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAL,EAA8B;EAC5B;EACD;;EAED,UAAMI,WAAW,GAAGP,UAAU,CAACQ,GAAX,CAAeL,OAAf,CAApB;EAEAI,IAAAA,WAAW,CAACS,MAAZ,CAAmBZ,GAAnB,EAPmB;;EAUnB,QAAIG,WAAW,CAACE,IAAZ,KAAqB,CAAzB,EAA4B;EAC1BT,MAAAA,UAAU,CAACgB,MAAX,CAAkBb,OAAlB;EACD;EACF;;EAxCY,CAAf;;;;;;;;"}
|
||||
{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.3.0-alpha1): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map()\n\nexport default {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map())\n }\n\n const instanceMap = elementMap.get(element)\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n return\n }\n\n instanceMap.set(key, instance)\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null\n }\n\n return null\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return\n }\n\n const instanceMap = elementMap.get(element)\n\n instanceMap.delete(key)\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element)\n }\n }\n}\n"],"names":["elementMap","Map","set","element","key","instance","has","instanceMap","get","size","console","error","Array","from","keys","remove","delete"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA,MAAMA,UAAU,GAAG,IAAIC,GAAG,EAAE,CAAA;AAE5B,eAAe;EACbC,EAAAA,GAAG,CAACC,OAAO,EAAEC,GAAG,EAAEC,QAAQ,EAAE;EAC1B,IAAA,IAAI,CAACL,UAAU,CAACM,GAAG,CAACH,OAAO,CAAC,EAAE;QAC5BH,UAAU,CAACE,GAAG,CAACC,OAAO,EAAE,IAAIF,GAAG,EAAE,CAAC,CAAA;EACpC,KAAA;EAEA,IAAA,MAAMM,WAAW,GAAGP,UAAU,CAACQ,GAAG,CAACL,OAAO,CAAC,CAAA;;EAE3C;EACA;EACA,IAAA,IAAI,CAACI,WAAW,CAACD,GAAG,CAACF,GAAG,CAAC,IAAIG,WAAW,CAACE,IAAI,KAAK,CAAC,EAAE;EACnD;EACAC,MAAAA,OAAO,CAACC,KAAK,CAAE,CAA8EC,4EAAAA,EAAAA,KAAK,CAACC,IAAI,CAACN,WAAW,CAACO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAE,GAAE,CAAC,CAAA;EAClI,MAAA,OAAA;EACF,KAAA;EAEAP,IAAAA,WAAW,CAACL,GAAG,CAACE,GAAG,EAAEC,QAAQ,CAAC,CAAA;KAC/B;EAEDG,EAAAA,GAAG,CAACL,OAAO,EAAEC,GAAG,EAAE;EAChB,IAAA,IAAIJ,UAAU,CAACM,GAAG,CAACH,OAAO,CAAC,EAAE;EAC3B,MAAA,OAAOH,UAAU,CAACQ,GAAG,CAACL,OAAO,CAAC,CAACK,GAAG,CAACJ,GAAG,CAAC,IAAI,IAAI,CAAA;EACjD,KAAA;EAEA,IAAA,OAAO,IAAI,CAAA;KACZ;EAEDW,EAAAA,MAAM,CAACZ,OAAO,EAAEC,GAAG,EAAE;EACnB,IAAA,IAAI,CAACJ,UAAU,CAACM,GAAG,CAACH,OAAO,CAAC,EAAE;EAC5B,MAAA,OAAA;EACF,KAAA;EAEA,IAAA,MAAMI,WAAW,GAAGP,UAAU,CAACQ,GAAG,CAACL,OAAO,CAAC,CAAA;EAE3CI,IAAAA,WAAW,CAACS,MAAM,CAACZ,GAAG,CAAC,CAAA;;EAEvB;EACA,IAAA,IAAIG,WAAW,CAACE,IAAI,KAAK,CAAC,EAAE;EAC1BT,MAAAA,UAAU,CAACgB,MAAM,CAACb,OAAO,CAAC,CAAA;EAC5B,KAAA;EACF,GAAA;EACF,CAAC;;;;;;;;"}
|
|
@ -1,274 +1,196 @@
|
|||
/*!
|
||||
* Bootstrap event-handler.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap event-handler.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory());
|
||||
})(this, (function () { 'use strict';
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../util/index.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['../util/index'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory(global.Index));
|
||||
})(this, (function (index_js) { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Bootstrap (v5.3.0-alpha1): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const getjQuery = () => {
|
||||
const {
|
||||
jQuery
|
||||
} = window;
|
||||
|
||||
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
||||
return jQuery;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
|
||||
const stripNameRegex = /\..*/;
|
||||
const stripUidRegex = /::\d+$/;
|
||||
const eventRegistry = {}; // Events storage
|
||||
|
||||
let uidEvent = 1;
|
||||
const customEvents = {
|
||||
mouseenter: 'mouseover',
|
||||
mouseleave: 'mouseout'
|
||||
};
|
||||
const customEventsRegex = /^(mouseenter|mouseleave)/i;
|
||||
const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Private methods
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
function getUidEvent(element, uid) {
|
||||
function makeEventUid(element, uid) {
|
||||
return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
|
||||
}
|
||||
|
||||
function getEvent(element) {
|
||||
const uid = getUidEvent(element);
|
||||
function getElementEvents(element) {
|
||||
const uid = makeEventUid(element);
|
||||
element.uidEvent = uid;
|
||||
eventRegistry[uid] = eventRegistry[uid] || {};
|
||||
return eventRegistry[uid];
|
||||
}
|
||||
|
||||
function bootstrapHandler(element, fn) {
|
||||
return function handler(event) {
|
||||
event.delegateTarget = element;
|
||||
|
||||
hydrateObj(event, {
|
||||
delegateTarget: element
|
||||
});
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn);
|
||||
}
|
||||
|
||||
return fn.apply(element, [event]);
|
||||
};
|
||||
}
|
||||
|
||||
function bootstrapDelegationHandler(element, selector, fn) {
|
||||
return function handler(event) {
|
||||
const domElements = element.querySelectorAll(selector);
|
||||
|
||||
for (let {
|
||||
target
|
||||
} = event; target && target !== this; target = target.parentNode) {
|
||||
for (let i = domElements.length; i--;) {
|
||||
if (domElements[i] === target) {
|
||||
event.delegateTarget = target;
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, selector, fn);
|
||||
}
|
||||
|
||||
return fn.apply(target, [event]);
|
||||
for (const domElement of domElements) {
|
||||
if (domElement !== target) {
|
||||
continue;
|
||||
}
|
||||
hydrateObj(event, {
|
||||
delegateTarget: target
|
||||
});
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, selector, fn);
|
||||
}
|
||||
return fn.apply(target, [event]);
|
||||
}
|
||||
} // To please ESLint
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function findHandler(events, handler, delegationSelector = null) {
|
||||
const uidEventList = Object.keys(events);
|
||||
|
||||
for (let i = 0, len = uidEventList.length; i < len; i++) {
|
||||
const event = events[uidEventList[i]];
|
||||
|
||||
if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
|
||||
return event;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
function findHandler(events, callable, delegationSelector = null) {
|
||||
return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);
|
||||
}
|
||||
|
||||
function normalizeParams(originalTypeEvent, handler, delegationFn) {
|
||||
const delegation = typeof handler === 'string';
|
||||
const originalHandler = delegation ? delegationFn : handler;
|
||||
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
||||
const isDelegated = typeof handler === 'string';
|
||||
// todo: tooltip passes `false` instead of selector, so we need to check
|
||||
const callable = isDelegated ? delegationFunction : handler || delegationFunction;
|
||||
let typeEvent = getTypeEvent(originalTypeEvent);
|
||||
const isNative = nativeEvents.has(typeEvent);
|
||||
|
||||
if (!isNative) {
|
||||
if (!nativeEvents.has(typeEvent)) {
|
||||
typeEvent = originalTypeEvent;
|
||||
}
|
||||
|
||||
return [delegation, originalHandler, typeEvent];
|
||||
return [isDelegated, callable, typeEvent];
|
||||
}
|
||||
|
||||
function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
|
||||
function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {
|
||||
if (typeof originalTypeEvent !== 'string' || !element) {
|
||||
return;
|
||||
}
|
||||
let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
|
||||
|
||||
if (!handler) {
|
||||
handler = delegationFn;
|
||||
delegationFn = null;
|
||||
} // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
|
||||
// in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
|
||||
// this prevents the handler from being dispatched the same way as mouseover or mouseout does
|
||||
|
||||
|
||||
if (customEventsRegex.test(originalTypeEvent)) {
|
||||
const wrapFn = fn => {
|
||||
if (originalTypeEvent in customEvents) {
|
||||
const wrapFunction = fn => {
|
||||
return function (event) {
|
||||
if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
|
||||
return fn.call(this, event);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
if (delegationFn) {
|
||||
delegationFn = wrapFn(delegationFn);
|
||||
} else {
|
||||
handler = wrapFn(handler);
|
||||
}
|
||||
callable = wrapFunction(callable);
|
||||
}
|
||||
|
||||
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
|
||||
const events = getEvent(element);
|
||||
const events = getElementEvents(element);
|
||||
const handlers = events[typeEvent] || (events[typeEvent] = {});
|
||||
const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
|
||||
|
||||
if (previousFn) {
|
||||
previousFn.oneOff = previousFn.oneOff && oneOff;
|
||||
const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);
|
||||
if (previousFunction) {
|
||||
previousFunction.oneOff = previousFunction.oneOff && oneOff;
|
||||
return;
|
||||
}
|
||||
|
||||
const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
|
||||
const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
|
||||
fn.delegationSelector = delegation ? handler : null;
|
||||
fn.originalHandler = originalHandler;
|
||||
const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));
|
||||
const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);
|
||||
fn.delegationSelector = isDelegated ? handler : null;
|
||||
fn.callable = callable;
|
||||
fn.oneOff = oneOff;
|
||||
fn.uidEvent = uid;
|
||||
handlers[uid] = fn;
|
||||
element.addEventListener(typeEvent, fn, delegation);
|
||||
element.addEventListener(typeEvent, fn, isDelegated);
|
||||
}
|
||||
|
||||
function removeHandler(element, events, typeEvent, handler, delegationSelector) {
|
||||
const fn = findHandler(events[typeEvent], handler, delegationSelector);
|
||||
|
||||
if (!fn) {
|
||||
return;
|
||||
}
|
||||
|
||||
element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
|
||||
delete events[typeEvent][fn.uidEvent];
|
||||
}
|
||||
|
||||
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
|
||||
const storeElementEvent = events[typeEvent] || {};
|
||||
Object.keys(storeElementEvent).forEach(handlerKey => {
|
||||
for (const [handlerKey, event] of Object.entries(storeElementEvent)) {
|
||||
if (handlerKey.includes(namespace)) {
|
||||
const event = storeElementEvent[handlerKey];
|
||||
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
|
||||
removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getTypeEvent(event) {
|
||||
// allow to get the native events from namespaced events ('click.bs.button' --> 'click')
|
||||
event = event.replace(stripNameRegex, '');
|
||||
return customEvents[event] || event;
|
||||
}
|
||||
|
||||
const EventHandler = {
|
||||
on(element, event, handler, delegationFn) {
|
||||
addHandler(element, event, handler, delegationFn, false);
|
||||
on(element, event, handler, delegationFunction) {
|
||||
addHandler(element, event, handler, delegationFunction, false);
|
||||
},
|
||||
|
||||
one(element, event, handler, delegationFn) {
|
||||
addHandler(element, event, handler, delegationFn, true);
|
||||
one(element, event, handler, delegationFunction) {
|
||||
addHandler(element, event, handler, delegationFunction, true);
|
||||
},
|
||||
|
||||
off(element, originalTypeEvent, handler, delegationFn) {
|
||||
off(element, originalTypeEvent, handler, delegationFunction) {
|
||||
if (typeof originalTypeEvent !== 'string' || !element) {
|
||||
return;
|
||||
}
|
||||
|
||||
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
|
||||
const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
|
||||
const inNamespace = typeEvent !== originalTypeEvent;
|
||||
const events = getEvent(element);
|
||||
const events = getElementEvents(element);
|
||||
const storeElementEvent = events[typeEvent] || {};
|
||||
const isNamespace = originalTypeEvent.startsWith('.');
|
||||
|
||||
if (typeof originalHandler !== 'undefined') {
|
||||
if (typeof callable !== 'undefined') {
|
||||
// Simplest case: handler is passed, remove that listener ONLY.
|
||||
if (!events || !events[typeEvent]) {
|
||||
if (!Object.keys(storeElementEvent).length) {
|
||||
return;
|
||||
}
|
||||
|
||||
removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
|
||||
removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isNamespace) {
|
||||
Object.keys(events).forEach(elementEvent => {
|
||||
for (const elementEvent of Object.keys(events)) {
|
||||
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
|
||||
});
|
||||
}
|
||||
|
||||
const storeElementEvent = events[typeEvent] || {};
|
||||
Object.keys(storeElementEvent).forEach(keyHandlers => {
|
||||
const handlerKey = keyHandlers.replace(stripUidRegex, '');
|
||||
|
||||
if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
|
||||
const event = storeElementEvent[keyHandlers];
|
||||
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
|
||||
}
|
||||
});
|
||||
}
|
||||
for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {
|
||||
const handlerKey = keyHandlers.replace(stripUidRegex, '');
|
||||
if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
|
||||
removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
trigger(element, event, args) {
|
||||
if (typeof event !== 'string' || !element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const $ = getjQuery();
|
||||
const $ = index_js.getjQuery();
|
||||
const typeEvent = getTypeEvent(event);
|
||||
const inNamespace = event !== typeEvent;
|
||||
const isNative = nativeEvents.has(typeEvent);
|
||||
let jQueryEvent;
|
||||
let jQueryEvent = null;
|
||||
let bubbles = true;
|
||||
let nativeDispatch = true;
|
||||
let defaultPrevented = false;
|
||||
let evt = null;
|
||||
|
||||
if (inNamespace && $) {
|
||||
jQueryEvent = $.Event(event, args);
|
||||
$(element).trigger(jQueryEvent);
|
||||
|
@ -276,45 +198,38 @@
|
|||
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
|
||||
defaultPrevented = jQueryEvent.isDefaultPrevented();
|
||||
}
|
||||
|
||||
if (isNative) {
|
||||
evt = document.createEvent('HTMLEvents');
|
||||
evt.initEvent(typeEvent, bubbles, true);
|
||||
} else {
|
||||
evt = new CustomEvent(event, {
|
||||
bubbles,
|
||||
cancelable: true
|
||||
});
|
||||
} // merge custom information in our event
|
||||
|
||||
|
||||
if (typeof args !== 'undefined') {
|
||||
Object.keys(args).forEach(key => {
|
||||
Object.defineProperty(evt, key, {
|
||||
get() {
|
||||
return args[key];
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
let evt = new Event(event, {
|
||||
bubbles,
|
||||
cancelable: true
|
||||
});
|
||||
evt = hydrateObj(evt, args);
|
||||
if (defaultPrevented) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
if (nativeDispatch) {
|
||||
element.dispatchEvent(evt);
|
||||
}
|
||||
|
||||
if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
|
||||
if (evt.defaultPrevented && jQueryEvent) {
|
||||
jQueryEvent.preventDefault();
|
||||
}
|
||||
|
||||
return evt;
|
||||
}
|
||||
|
||||
};
|
||||
function hydrateObj(obj, meta = {}) {
|
||||
for (const [key, value] of Object.entries(meta)) {
|
||||
try {
|
||||
obj[key] = value;
|
||||
} catch (_unused) {
|
||||
Object.defineProperty(obj, key, {
|
||||
configurable: true,
|
||||
get() {
|
||||
return value;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
return EventHandler;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
/*!
|
||||
* Bootstrap manipulator.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap manipulator.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
|
@ -11,76 +11,59 @@
|
|||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dom/manipulator.js
|
||||
* Bootstrap (v5.3.0-alpha1): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
function normalizeData(val) {
|
||||
if (val === 'true') {
|
||||
|
||||
function normalizeData(value) {
|
||||
if (value === 'true') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (val === 'false') {
|
||||
if (value === 'false') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (val === Number(val).toString()) {
|
||||
return Number(val);
|
||||
if (value === Number(value).toString()) {
|
||||
return Number(value);
|
||||
}
|
||||
|
||||
if (val === '' || val === 'null') {
|
||||
if (value === '' || value === 'null') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return val;
|
||||
if (typeof value !== 'string') {
|
||||
return value;
|
||||
}
|
||||
try {
|
||||
return JSON.parse(decodeURIComponent(value));
|
||||
} catch (_unused) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeDataKey(key) {
|
||||
return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
|
||||
}
|
||||
|
||||
const Manipulator = {
|
||||
setDataAttribute(element, key, value) {
|
||||
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
|
||||
},
|
||||
|
||||
removeDataAttribute(element, key) {
|
||||
element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
|
||||
},
|
||||
|
||||
getDataAttributes(element) {
|
||||
if (!element) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const attributes = {};
|
||||
Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
|
||||
const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));
|
||||
for (const key of bsKeys) {
|
||||
let pureKey = key.replace(/^bs/, '');
|
||||
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
|
||||
attributes[pureKey] = normalizeData(element.dataset[key]);
|
||||
});
|
||||
}
|
||||
return attributes;
|
||||
},
|
||||
|
||||
getDataAttribute(element, key) {
|
||||
return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
|
||||
},
|
||||
|
||||
offset(element) {
|
||||
const rect = element.getBoundingClientRect();
|
||||
return {
|
||||
top: rect.top + window.pageYOffset,
|
||||
left: rect.left + window.pageXOffset
|
||||
};
|
||||
},
|
||||
|
||||
position(element) {
|
||||
return {
|
||||
top: element.offsetTop,
|
||||
left: element.offsetLeft
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return Manipulator;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n\n Object.keys(element.dataset)\n .filter(key => key.startsWith('bs'))\n .forEach(key => {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n attributes[pureKey] = normalizeData(element.dataset[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + window.pageYOffset,\n left: rect.left + window.pageXOffset\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","val","Number","toString","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","value","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","Object","keys","dataset","filter","startsWith","forEach","pureKey","charAt","slice","length","getDataAttribute","getAttribute","offset","rect","getBoundingClientRect","top","window","pageYOffset","left","pageXOffset","position","offsetTop","offsetLeft"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EAEA,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;EAC1B,MAAIA,GAAG,KAAK,MAAZ,EAAoB;EAClB,WAAO,IAAP;EACD;;EAED,MAAIA,GAAG,KAAK,OAAZ,EAAqB;EACnB,WAAO,KAAP;EACD;;EAED,MAAIA,GAAG,KAAKC,MAAM,CAACD,GAAD,CAAN,CAAYE,QAAZ,EAAZ,EAAoC;EAClC,WAAOD,MAAM,CAACD,GAAD,CAAb;EACD;;EAED,MAAIA,GAAG,KAAK,EAAR,IAAcA,GAAG,KAAK,MAA1B,EAAkC;EAChC,WAAO,IAAP;EACD;;EAED,SAAOA,GAAP;EACD;;EAED,SAASG,gBAAT,CAA0BC,GAA1B,EAA+B;EAC7B,SAAOA,GAAG,CAACC,OAAJ,CAAY,QAAZ,EAAsBC,GAAG,IAAK,IAAGA,GAAG,CAACC,WAAJ,EAAkB,EAAnD,CAAP;EACD;;QAEKC,WAAW,GAAG;EAClBC,EAAAA,gBAAgB,CAACC,OAAD,EAAUN,GAAV,EAAeO,KAAf,EAAsB;EACpCD,IAAAA,OAAO,CAACE,YAAR,CAAsB,WAAUT,gBAAgB,CAACC,GAAD,CAAM,EAAtD,EAAyDO,KAAzD;EACD,GAHiB;;EAKlBE,EAAAA,mBAAmB,CAACH,OAAD,EAAUN,GAAV,EAAe;EAChCM,IAAAA,OAAO,CAACI,eAAR,CAAyB,WAAUX,gBAAgB,CAACC,GAAD,CAAM,EAAzD;EACD,GAPiB;;EASlBW,EAAAA,iBAAiB,CAACL,OAAD,EAAU;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,UAAMM,UAAU,GAAG,EAAnB;EAEAC,IAAAA,MAAM,CAACC,IAAP,CAAYR,OAAO,CAACS,OAApB,EACGC,MADH,CACUhB,GAAG,IAAIA,GAAG,CAACiB,UAAJ,CAAe,IAAf,CADjB,EAEGC,OAFH,CAEWlB,GAAG,IAAI;EACd,UAAImB,OAAO,GAAGnB,GAAG,CAACC,OAAJ,CAAY,KAAZ,EAAmB,EAAnB,CAAd;EACAkB,MAAAA,OAAO,GAAGA,OAAO,CAACC,MAAR,CAAe,CAAf,EAAkBjB,WAAlB,KAAkCgB,OAAO,CAACE,KAAR,CAAc,CAAd,EAAiBF,OAAO,CAACG,MAAzB,CAA5C;EACAV,MAAAA,UAAU,CAACO,OAAD,CAAV,GAAsBxB,aAAa,CAACW,OAAO,CAACS,OAAR,CAAgBf,GAAhB,CAAD,CAAnC;EACD,KANH;EAQA,WAAOY,UAAP;EACD,GAzBiB;;EA2BlBW,EAAAA,gBAAgB,CAACjB,OAAD,EAAUN,GAAV,EAAe;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACkB,YAAR,CAAsB,WAAUzB,gBAAgB,CAACC,GAAD,CAAM,EAAtD,CAAD,CAApB;EACD,GA7BiB;;EA+BlByB,EAAAA,MAAM,CAACnB,OAAD,EAAU;EACd,UAAMoB,IAAI,GAAGpB,OAAO,CAACqB,qBAAR,EAAb;EAEA,WAAO;EACLC,MAAAA,GAAG,EAAEF,IAAI,CAACE,GAAL,GAAWC,MAAM,CAACC,WADlB;EAELC,MAAAA,IAAI,EAAEL,IAAI,CAACK,IAAL,GAAYF,MAAM,CAACG;EAFpB,KAAP;EAID,GAtCiB;;EAwClBC,EAAAA,QAAQ,CAAC3B,OAAD,EAAU;EAChB,WAAO;EACLsB,MAAAA,GAAG,EAAEtB,OAAO,CAAC4B,SADR;EAELH,MAAAA,IAAI,EAAEzB,OAAO,CAAC6B;EAFT,KAAP;EAID;;EA7CiB;;;;;;;;"}
|
||||
{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.3.0-alpha1): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n if (value === 'true') {\n return true\n }\n\n if (value === 'false') {\n return false\n }\n\n if (value === Number(value).toString()) {\n return Number(value)\n }\n\n if (value === '' || value === 'null') {\n return null\n }\n\n if (typeof value !== 'string') {\n return value\n }\n\n try {\n return JSON.parse(decodeURIComponent(value))\n } catch {\n return value\n }\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'))\n\n for (const key of bsKeys) {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n attributes[pureKey] = normalizeData(element.dataset[key])\n }\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","value","Number","toString","JSON","parse","decodeURIComponent","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","bsKeys","Object","keys","dataset","filter","startsWith","pureKey","charAt","slice","length","getDataAttribute","getAttribute"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA,SAASA,aAAa,CAACC,KAAK,EAAE;IAC5B,IAAIA,KAAK,KAAK,MAAM,EAAE;EACpB,IAAA,OAAO,IAAI,CAAA;EACb,GAAA;IAEA,IAAIA,KAAK,KAAK,OAAO,EAAE;EACrB,IAAA,OAAO,KAAK,CAAA;EACd,GAAA;IAEA,IAAIA,KAAK,KAAKC,MAAM,CAACD,KAAK,CAAC,CAACE,QAAQ,EAAE,EAAE;MACtC,OAAOD,MAAM,CAACD,KAAK,CAAC,CAAA;EACtB,GAAA;EAEA,EAAA,IAAIA,KAAK,KAAK,EAAE,IAAIA,KAAK,KAAK,MAAM,EAAE;EACpC,IAAA,OAAO,IAAI,CAAA;EACb,GAAA;EAEA,EAAA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;EAC7B,IAAA,OAAOA,KAAK,CAAA;EACd,GAAA;IAEA,IAAI;MACF,OAAOG,IAAI,CAACC,KAAK,CAACC,kBAAkB,CAACL,KAAK,CAAC,CAAC,CAAA;EAC9C,GAAC,CAAC,OAAM,OAAA,EAAA;EACN,IAAA,OAAOA,KAAK,CAAA;EACd,GAAA;EACF,CAAA;EAEA,SAASM,gBAAgB,CAACC,GAAG,EAAE;EAC7B,EAAA,OAAOA,GAAG,CAACC,OAAO,CAAC,QAAQ,EAAEC,GAAG,IAAK,CAAA,CAAA,EAAGA,GAAG,CAACC,WAAW,EAAG,EAAC,CAAC,CAAA;EAC9D,CAAA;AAEA,QAAMC,WAAW,GAAG;EAClBC,EAAAA,gBAAgB,CAACC,OAAO,EAAEN,GAAG,EAAEP,KAAK,EAAE;MACpCa,OAAO,CAACC,YAAY,CAAE,CAAUR,QAAAA,EAAAA,gBAAgB,CAACC,GAAG,CAAE,CAAA,CAAC,EAAEP,KAAK,CAAC,CAAA;KAChE;EAEDe,EAAAA,mBAAmB,CAACF,OAAO,EAAEN,GAAG,EAAE;MAChCM,OAAO,CAACG,eAAe,CAAE,CAAA,QAAA,EAAUV,gBAAgB,CAACC,GAAG,CAAE,CAAA,CAAC,CAAC,CAAA;KAC5D;IAEDU,iBAAiB,CAACJ,OAAO,EAAE;MACzB,IAAI,CAACA,OAAO,EAAE;EACZ,MAAA,OAAO,EAAE,CAAA;EACX,KAAA;MAEA,MAAMK,UAAU,GAAG,EAAE,CAAA;EACrB,IAAA,MAAMC,MAAM,GAAGC,MAAM,CAACC,IAAI,CAACR,OAAO,CAACS,OAAO,CAAC,CAACC,MAAM,CAAChB,GAAG,IAAIA,GAAG,CAACiB,UAAU,CAAC,IAAI,CAAC,IAAI,CAACjB,GAAG,CAACiB,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA;EAE9G,IAAA,KAAK,MAAMjB,GAAG,IAAIY,MAAM,EAAE;QACxB,IAAIM,OAAO,GAAGlB,GAAG,CAACC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QACpCiB,OAAO,GAAGA,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAAChB,WAAW,EAAE,GAAGe,OAAO,CAACE,KAAK,CAAC,CAAC,EAAEF,OAAO,CAACG,MAAM,CAAC,CAAA;EAC5EV,MAAAA,UAAU,CAACO,OAAO,CAAC,GAAG1B,aAAa,CAACc,OAAO,CAACS,OAAO,CAACf,GAAG,CAAC,CAAC,CAAA;EAC3D,KAAA;EAEA,IAAA,OAAOW,UAAU,CAAA;KAClB;EAEDW,EAAAA,gBAAgB,CAAChB,OAAO,EAAEN,GAAG,EAAE;EAC7B,IAAA,OAAOR,aAAa,CAACc,OAAO,CAACiB,YAAY,CAAE,CAAUxB,QAAAA,EAAAA,gBAAgB,CAACC,GAAG,CAAE,CAAA,CAAC,CAAC,CAAC,CAAA;EAChF,GAAA;EACF;;;;;;;;"}
|
|
@ -1,125 +1,100 @@
|
|||
/*!
|
||||
* Bootstrap selector-engine.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap selector-engine.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory());
|
||||
})(this, (function () { 'use strict';
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../util/index.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['../util/index'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory(global.Index));
|
||||
})(this, (function (index_js) { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Bootstrap (v5.3.0-alpha1): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
const getSelector = element => {
|
||||
let selector = element.getAttribute('data-bs-target');
|
||||
if (!selector || selector === '#') {
|
||||
let hrefAttribute = element.getAttribute('href');
|
||||
|
||||
const isElement = obj => {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
// The only valid content that could double as a selector are IDs or classes,
|
||||
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
||||
// `document.querySelector` will rightfully complain it is invalid.
|
||||
// See https://github.com/twbs/bootstrap/issues/32273
|
||||
if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Just in case some CMS puts out a full URL with the anchor appended
|
||||
if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
|
||||
hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
|
||||
}
|
||||
selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
|
||||
}
|
||||
|
||||
if (typeof obj.jquery !== 'undefined') {
|
||||
obj = obj[0];
|
||||
}
|
||||
|
||||
return typeof obj.nodeType !== 'undefined';
|
||||
return index_js.parseSelector(selector);
|
||||
};
|
||||
|
||||
const isVisible = element => {
|
||||
if (!isElement(element) || element.getClientRects().length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
|
||||
};
|
||||
|
||||
const isDisabled = element => {
|
||||
if (!element || element.nodeType !== Node.ELEMENT_NODE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (element.classList.contains('disabled')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof element.disabled !== 'undefined') {
|
||||
return element.disabled;
|
||||
}
|
||||
|
||||
return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
const NODE_TEXT = 3;
|
||||
const SelectorEngine = {
|
||||
find(selector, element = document.documentElement) {
|
||||
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
||||
},
|
||||
|
||||
findOne(selector, element = document.documentElement) {
|
||||
return Element.prototype.querySelector.call(element, selector);
|
||||
},
|
||||
|
||||
children(element, selector) {
|
||||
return [].concat(...element.children).filter(child => child.matches(selector));
|
||||
},
|
||||
|
||||
parents(element, selector) {
|
||||
const parents = [];
|
||||
let ancestor = element.parentNode;
|
||||
|
||||
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
||||
if (ancestor.matches(selector)) {
|
||||
parents.push(ancestor);
|
||||
}
|
||||
|
||||
ancestor = ancestor.parentNode;
|
||||
let ancestor = element.parentNode.closest(selector);
|
||||
while (ancestor) {
|
||||
parents.push(ancestor);
|
||||
ancestor = ancestor.parentNode.closest(selector);
|
||||
}
|
||||
|
||||
return parents;
|
||||
},
|
||||
|
||||
prev(element, selector) {
|
||||
let previous = element.previousElementSibling;
|
||||
|
||||
while (previous) {
|
||||
if (previous.matches(selector)) {
|
||||
return [previous];
|
||||
}
|
||||
|
||||
previous = previous.previousElementSibling;
|
||||
}
|
||||
|
||||
return [];
|
||||
},
|
||||
|
||||
// TODO: this is now unused; remove later along with prev()
|
||||
next(element, selector) {
|
||||
let next = element.nextElementSibling;
|
||||
|
||||
while (next) {
|
||||
if (next.matches(selector)) {
|
||||
return [next];
|
||||
}
|
||||
|
||||
next = next.nextElementSibling;
|
||||
}
|
||||
|
||||
return [];
|
||||
},
|
||||
|
||||
focusableChildren(element) {
|
||||
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
|
||||
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
||||
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
|
||||
return this.find(focusables, element).filter(el => !index_js.isDisabled(el) && index_js.isVisible(el));
|
||||
},
|
||||
getSelectorFromElement(element) {
|
||||
const selector = getSelector(element);
|
||||
if (selector) {
|
||||
return SelectorEngine.findOne(selector) ? selector : null;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getElementFromSelector(element) {
|
||||
const selector = getSelector(element);
|
||||
return selector ? SelectorEngine.findOne(selector) : null;
|
||||
},
|
||||
getMultipleElementsFromSelector(element) {
|
||||
const selector = getSelector(element);
|
||||
return selector ? SelectorEngine.find(selector) : [];
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return SelectorEngine;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,19 +1,16 @@
|
|||
/*!
|
||||
* Bootstrap dropdown.js v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap dropdown.js v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Popper, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
|
||||
})(this, (function (Popper, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./util/index.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['@popperjs/core', './util/index', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global["@popperjs/core"], global.Index, global.EventHandler, global.Manipulator, global.SelectorEngine, global.BaseComponent));
|
||||
})(this, (function (Popper, index_js, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
|
||||
|
||||
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
||||
|
||||
function _interopNamespace(e) {
|
||||
if (e && e.__esModule) return e;
|
||||
const n = Object.create(null);
|
||||
function _interopNamespaceDefault(e) {
|
||||
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
||||
if (e) {
|
||||
for (const k in e) {
|
||||
if (k !== 'default') {
|
||||
|
@ -29,206 +26,17 @@
|
|||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
const Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
||||
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
||||
const Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
|
||||
const SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
|
||||
const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
||||
const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Bootstrap (v5.3.0-alpha1): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const toType = obj => {
|
||||
if (obj === null || obj === undefined) {
|
||||
return `${obj}`;
|
||||
}
|
||||
|
||||
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
|
||||
};
|
||||
|
||||
const getSelector = element => {
|
||||
let selector = element.getAttribute('data-bs-target');
|
||||
|
||||
if (!selector || selector === '#') {
|
||||
let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
|
||||
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
||||
// `document.querySelector` will rightfully complain it is invalid.
|
||||
// See https://github.com/twbs/bootstrap/issues/32273
|
||||
|
||||
if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
|
||||
return null;
|
||||
} // Just in case some CMS puts out a full URL with the anchor appended
|
||||
|
||||
|
||||
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
||||
hrefAttr = `#${hrefAttr.split('#')[1]}`;
|
||||
}
|
||||
|
||||
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
|
||||
}
|
||||
|
||||
return selector;
|
||||
};
|
||||
|
||||
const getElementFromSelector = element => {
|
||||
const selector = getSelector(element);
|
||||
return selector ? document.querySelector(selector) : null;
|
||||
};
|
||||
|
||||
const isElement = obj => {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof obj.jquery !== 'undefined') {
|
||||
obj = obj[0];
|
||||
}
|
||||
|
||||
return typeof obj.nodeType !== 'undefined';
|
||||
};
|
||||
|
||||
const getElement = obj => {
|
||||
if (isElement(obj)) {
|
||||
// it's a jQuery object or a node element
|
||||
return obj.jquery ? obj[0] : obj;
|
||||
}
|
||||
|
||||
if (typeof obj === 'string' && obj.length > 0) {
|
||||
return document.querySelector(obj);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const typeCheckConfig = (componentName, config, configTypes) => {
|
||||
Object.keys(configTypes).forEach(property => {
|
||||
const expectedTypes = configTypes[property];
|
||||
const value = config[property];
|
||||
const valueType = value && isElement(value) ? 'element' : toType(value);
|
||||
|
||||
if (!new RegExp(expectedTypes).test(valueType)) {
|
||||
throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const isVisible = element => {
|
||||
if (!isElement(element) || element.getClientRects().length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
|
||||
};
|
||||
|
||||
const isDisabled = element => {
|
||||
if (!element || element.nodeType !== Node.ELEMENT_NODE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (element.classList.contains('disabled')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof element.disabled !== 'undefined') {
|
||||
return element.disabled;
|
||||
}
|
||||
|
||||
return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
|
||||
};
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
const getjQuery = () => {
|
||||
const {
|
||||
jQuery
|
||||
} = window;
|
||||
|
||||
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
||||
return jQuery;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const DOMContentLoadedCallbacks = [];
|
||||
|
||||
const onDOMContentLoaded = callback => {
|
||||
if (document.readyState === 'loading') {
|
||||
// add listener on the first call when the document is in loading state
|
||||
if (!DOMContentLoadedCallbacks.length) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
DOMContentLoadedCallbacks.forEach(callback => callback());
|
||||
});
|
||||
}
|
||||
|
||||
DOMContentLoadedCallbacks.push(callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const isRTL = () => document.documentElement.dir === 'rtl';
|
||||
|
||||
const defineJQueryPlugin = plugin => {
|
||||
onDOMContentLoaded(() => {
|
||||
const $ = getjQuery();
|
||||
/* istanbul ignore if */
|
||||
|
||||
if ($) {
|
||||
const name = plugin.NAME;
|
||||
const JQUERY_NO_CONFLICT = $.fn[name];
|
||||
$.fn[name] = plugin.jQueryInterface;
|
||||
$.fn[name].Constructor = plugin;
|
||||
|
||||
$.fn[name].noConflict = () => {
|
||||
$.fn[name] = JQUERY_NO_CONFLICT;
|
||||
return plugin.jQueryInterface;
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return the previous/next element of a list.
|
||||
*
|
||||
* @param {array} list The list of elements
|
||||
* @param activeElement The active element
|
||||
* @param shouldGetNext Choose to get next or previous element
|
||||
* @param isCycleAllowed
|
||||
* @return {Element|elem} The proper element
|
||||
*/
|
||||
|
||||
|
||||
const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
|
||||
let index = list.indexOf(activeElement); // if the element does not exist in the list return an element depending on the direction and if cycle is allowed
|
||||
|
||||
if (index === -1) {
|
||||
return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0];
|
||||
}
|
||||
|
||||
const listLength = list.length;
|
||||
index += shouldGetNext ? 1 : -1;
|
||||
|
||||
if (isCycleAllowed) {
|
||||
index = (index + listLength) % listLength;
|
||||
}
|
||||
|
||||
return list[Math.max(0, Math.min(index, listLength - 1))];
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'dropdown';
|
||||
|
@ -236,13 +44,11 @@
|
|||
const EVENT_KEY = `.${DATA_KEY}`;
|
||||
const DATA_API_KEY = '.data-api';
|
||||
const ESCAPE_KEY = 'Escape';
|
||||
const SPACE_KEY = 'Space';
|
||||
const TAB_KEY = 'Tab';
|
||||
const ARROW_UP_KEY = 'ArrowUp';
|
||||
const ARROW_DOWN_KEY = 'ArrowDown';
|
||||
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
|
||||
|
||||
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY}`);
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`;
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`;
|
||||
|
@ -254,252 +60,204 @@
|
|||
const CLASS_NAME_DROPUP = 'dropup';
|
||||
const CLASS_NAME_DROPEND = 'dropend';
|
||||
const CLASS_NAME_DROPSTART = 'dropstart';
|
||||
const CLASS_NAME_NAVBAR = 'navbar';
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]';
|
||||
const CLASS_NAME_DROPUP_CENTER = 'dropup-center';
|
||||
const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)';
|
||||
const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`;
|
||||
const SELECTOR_MENU = '.dropdown-menu';
|
||||
const SELECTOR_NAVBAR = '.navbar';
|
||||
const SELECTOR_NAVBAR_NAV = '.navbar-nav';
|
||||
const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
|
||||
const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';
|
||||
const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';
|
||||
const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';
|
||||
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
|
||||
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
|
||||
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
|
||||
const PLACEMENT_TOP = index_js.isRTL() ? 'top-end' : 'top-start';
|
||||
const PLACEMENT_TOPEND = index_js.isRTL() ? 'top-start' : 'top-end';
|
||||
const PLACEMENT_BOTTOM = index_js.isRTL() ? 'bottom-end' : 'bottom-start';
|
||||
const PLACEMENT_BOTTOMEND = index_js.isRTL() ? 'bottom-start' : 'bottom-end';
|
||||
const PLACEMENT_RIGHT = index_js.isRTL() ? 'left-start' : 'right-start';
|
||||
const PLACEMENT_LEFT = index_js.isRTL() ? 'right-start' : 'left-start';
|
||||
const PLACEMENT_TOPCENTER = 'top';
|
||||
const PLACEMENT_BOTTOMCENTER = 'bottom';
|
||||
const Default = {
|
||||
offset: [0, 2],
|
||||
autoClose: true,
|
||||
boundary: 'clippingParents',
|
||||
reference: 'toggle',
|
||||
display: 'dynamic',
|
||||
offset: [0, 2],
|
||||
popperConfig: null,
|
||||
autoClose: true
|
||||
reference: 'toggle'
|
||||
};
|
||||
const DefaultType = {
|
||||
offset: '(array|string|function)',
|
||||
autoClose: '(boolean|string)',
|
||||
boundary: '(string|element)',
|
||||
reference: '(string|element|object)',
|
||||
display: 'string',
|
||||
offset: '(array|string|function)',
|
||||
popperConfig: '(null|object|function)',
|
||||
autoClose: '(boolean|string)'
|
||||
reference: '(string|element|object)'
|
||||
};
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Dropdown extends BaseComponent__default.default {
|
||||
class Dropdown extends BaseComponent {
|
||||
constructor(element, config) {
|
||||
super(element);
|
||||
super(element, config);
|
||||
this._popper = null;
|
||||
this._config = this._getConfig(config);
|
||||
this._menu = this._getMenuElement();
|
||||
this._parent = this._element.parentNode; // dropdown wrapper
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
|
||||
this._inNavbar = this._detectNavbar();
|
||||
} // Getters
|
||||
|
||||
}
|
||||
|
||||
// Getters
|
||||
static get Default() {
|
||||
return Default;
|
||||
}
|
||||
|
||||
static get DefaultType() {
|
||||
return DefaultType;
|
||||
}
|
||||
|
||||
static get NAME() {
|
||||
return NAME;
|
||||
} // Public
|
||||
|
||||
}
|
||||
|
||||
// Public
|
||||
toggle() {
|
||||
return this._isShown() ? this.hide() : this.show();
|
||||
}
|
||||
|
||||
show() {
|
||||
if (isDisabled(this._element) || this._isShown(this._menu)) {
|
||||
if (index_js.isDisabled(this._element) || this._isShown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
};
|
||||
const showEvent = EventHandler__default.default.trigger(this._element, EVENT_SHOW, relatedTarget);
|
||||
|
||||
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget);
|
||||
if (showEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
this._createPopper();
|
||||
|
||||
const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar
|
||||
|
||||
if (this._inNavbar) {
|
||||
Manipulator__default.default.setDataAttribute(this._menu, 'popper', 'none');
|
||||
} else {
|
||||
this._createPopper(parent);
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// 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)) {
|
||||
[].concat(...document.body.children).forEach(elem => EventHandler__default.default.on(elem, 'mouseover', noop));
|
||||
if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {
|
||||
for (const element of [].concat(...document.body.children)) {
|
||||
EventHandler.on(element, 'mouseover', index_js.noop);
|
||||
}
|
||||
}
|
||||
|
||||
this._element.focus();
|
||||
|
||||
this._element.setAttribute('aria-expanded', true);
|
||||
|
||||
this._menu.classList.add(CLASS_NAME_SHOW);
|
||||
|
||||
this._element.classList.add(CLASS_NAME_SHOW);
|
||||
|
||||
EventHandler__default.default.trigger(this._element, EVENT_SHOWN, relatedTarget);
|
||||
EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget);
|
||||
}
|
||||
|
||||
hide() {
|
||||
if (isDisabled(this._element) || !this._isShown(this._menu)) {
|
||||
if (index_js.isDisabled(this._element) || !this._isShown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const relatedTarget = {
|
||||
relatedTarget: this._element
|
||||
};
|
||||
|
||||
this._completeHide(relatedTarget);
|
||||
}
|
||||
|
||||
dispose() {
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
update() {
|
||||
this._inNavbar = this._detectNavbar();
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.update();
|
||||
}
|
||||
} // Private
|
||||
|
||||
}
|
||||
|
||||
// Private
|
||||
_completeHide(relatedTarget) {
|
||||
const hideEvent = EventHandler__default.default.trigger(this._element, EVENT_HIDE, relatedTarget);
|
||||
|
||||
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget);
|
||||
if (hideEvent.defaultPrevented) {
|
||||
return;
|
||||
} // If this is a touch-enabled device we remove the extra
|
||||
// empty mouseover listeners we added for iOS support
|
||||
|
||||
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
[].concat(...document.body.children).forEach(elem => EventHandler__default.default.off(elem, 'mouseover', noop));
|
||||
}
|
||||
|
||||
// If this is a touch-enabled device we remove the extra
|
||||
// empty mouseover listeners we added for iOS support
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
for (const element of [].concat(...document.body.children)) {
|
||||
EventHandler.off(element, 'mouseover', index_js.noop);
|
||||
}
|
||||
}
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
}
|
||||
|
||||
this._menu.classList.remove(CLASS_NAME_SHOW);
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||
|
||||
this._element.setAttribute('aria-expanded', 'false');
|
||||
|
||||
Manipulator__default.default.removeDataAttribute(this._menu, 'popper');
|
||||
EventHandler__default.default.trigger(this._element, EVENT_HIDDEN, relatedTarget);
|
||||
Manipulator.removeDataAttribute(this._menu, 'popper');
|
||||
EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget);
|
||||
}
|
||||
|
||||
_getConfig(config) {
|
||||
config = { ...this.constructor.Default,
|
||||
...Manipulator__default.default.getDataAttributes(this._element),
|
||||
...config
|
||||
};
|
||||
typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
|
||||
if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
||||
config = super._getConfig(config);
|
||||
if (typeof config.reference === 'object' && !index_js.isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
||||
// Popper virtual elements require a getBoundingClientRect method
|
||||
throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
_createPopper(parent) {
|
||||
_createPopper() {
|
||||
if (typeof Popper__namespace === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
||||
}
|
||||
|
||||
let referenceElement = this._element;
|
||||
|
||||
if (this._config.reference === 'parent') {
|
||||
referenceElement = parent;
|
||||
} else if (isElement(this._config.reference)) {
|
||||
referenceElement = getElement(this._config.reference);
|
||||
referenceElement = this._parent;
|
||||
} else if (index_js.isElement(this._config.reference)) {
|
||||
referenceElement = index_js.getElement(this._config.reference);
|
||||
} else if (typeof this._config.reference === 'object') {
|
||||
referenceElement = this._config.reference;
|
||||
}
|
||||
|
||||
const popperConfig = this._getPopperConfig();
|
||||
|
||||
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
||||
this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
|
||||
|
||||
if (isDisplayStatic) {
|
||||
Manipulator__default.default.setDataAttribute(this._menu, 'popper', 'static');
|
||||
}
|
||||
}
|
||||
|
||||
_isShown(element = this._element) {
|
||||
return element.classList.contains(CLASS_NAME_SHOW);
|
||||
_isShown() {
|
||||
return this._menu.classList.contains(CLASS_NAME_SHOW);
|
||||
}
|
||||
|
||||
_getMenuElement() {
|
||||
return SelectorEngine__default.default.next(this._element, SELECTOR_MENU)[0];
|
||||
}
|
||||
|
||||
_getPlacement() {
|
||||
const parentDropdown = this._element.parentNode;
|
||||
|
||||
const parentDropdown = this._parent;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
return PLACEMENT_RIGHT;
|
||||
}
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
return PLACEMENT_LEFT;
|
||||
} // We need to trim the value because custom properties can also include spaces
|
||||
|
||||
}
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {
|
||||
return PLACEMENT_TOPCENTER;
|
||||
}
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {
|
||||
return PLACEMENT_BOTTOMCENTER;
|
||||
}
|
||||
|
||||
// We need to trim the value because custom properties can also include spaces
|
||||
const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
}
|
||||
|
||||
return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
|
||||
}
|
||||
|
||||
_detectNavbar() {
|
||||
return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null;
|
||||
return this._element.closest(SELECTOR_NAVBAR) !== null;
|
||||
}
|
||||
|
||||
_getOffset() {
|
||||
const {
|
||||
offset
|
||||
} = this._config;
|
||||
|
||||
if (typeof offset === 'string') {
|
||||
return offset.split(',').map(val => Number.parseInt(val, 10));
|
||||
return offset.split(',').map(value => Number.parseInt(value, 10));
|
||||
}
|
||||
|
||||
if (typeof offset === 'function') {
|
||||
return popperData => offset(popperData, this._element);
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
_getPopperConfig() {
|
||||
const defaultBsPopperConfig = {
|
||||
placement: this._getPlacement(),
|
||||
|
@ -514,172 +272,128 @@
|
|||
offset: this._getOffset()
|
||||
}
|
||||
}]
|
||||
}; // Disable Popper if we have a static display
|
||||
};
|
||||
|
||||
if (this._config.display === 'static') {
|
||||
// Disable Popper if we have a static display or Dropdown is in Navbar
|
||||
if (this._inNavbar || this._config.display === 'static') {
|
||||
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove
|
||||
defaultBsPopperConfig.modifiers = [{
|
||||
name: 'applyStyles',
|
||||
enabled: false
|
||||
}];
|
||||
}
|
||||
|
||||
return { ...defaultBsPopperConfig,
|
||||
...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
|
||||
return {
|
||||
...defaultBsPopperConfig,
|
||||
...index_js.execute(this._config.popperConfig, [defaultBsPopperConfig])
|
||||
};
|
||||
}
|
||||
|
||||
_selectMenuItem({
|
||||
key,
|
||||
target
|
||||
}) {
|
||||
const items = SelectorEngine__default.default.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible);
|
||||
|
||||
const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => index_js.isVisible(element));
|
||||
if (!items.length) {
|
||||
return;
|
||||
} // if target isn't included in items (e.g. when expanding the dropdown)
|
||||
}
|
||||
|
||||
// if target isn't included in items (e.g. when expanding the dropdown)
|
||||
// allow cycling to get the last item in case key equals ARROW_UP_KEY
|
||||
index_js.getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();
|
||||
}
|
||||
|
||||
|
||||
getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();
|
||||
} // Static
|
||||
|
||||
|
||||
// Static
|
||||
static jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
const data = Dropdown.getOrCreateInstance(this, config);
|
||||
|
||||
if (typeof config !== 'string') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`);
|
||||
}
|
||||
|
||||
data[config]();
|
||||
});
|
||||
}
|
||||
|
||||
static clearMenus(event) {
|
||||
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
|
||||
if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY) {
|
||||
return;
|
||||
}
|
||||
|
||||
const toggles = SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE);
|
||||
|
||||
for (let i = 0, len = toggles.length; i < len; i++) {
|
||||
const context = Dropdown.getInstance(toggles[i]);
|
||||
|
||||
const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);
|
||||
for (const toggle of openToggles) {
|
||||
const context = Dropdown.getInstance(toggle);
|
||||
if (!context || context._config.autoClose === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!context._isShown()) {
|
||||
const composedPath = event.composedPath();
|
||||
const isMenuTarget = composedPath.includes(context._menu);
|
||||
if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
|
||||
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
||||
continue;
|
||||
}
|
||||
const relatedTarget = {
|
||||
relatedTarget: context._element
|
||||
};
|
||||
|
||||
if (event) {
|
||||
const composedPath = event.composedPath();
|
||||
const isMenuTarget = composedPath.includes(context._menu);
|
||||
|
||||
if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
|
||||
continue;
|
||||
} // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
|
||||
|
||||
|
||||
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (event.type === 'click') {
|
||||
relatedTarget.clickEvent = event;
|
||||
}
|
||||
if (event.type === 'click') {
|
||||
relatedTarget.clickEvent = event;
|
||||
}
|
||||
|
||||
context._completeHide(relatedTarget);
|
||||
}
|
||||
}
|
||||
|
||||
static getParentFromElement(element) {
|
||||
return getElementFromSelector(element) || element.parentNode;
|
||||
}
|
||||
|
||||
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.key === SPACE_KEY || event.key !== ESCAPE_KEY && (event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY || event.target.closest(SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.key)) {
|
||||
// If not an UP | DOWN | ESCAPE key => not a dropdown command
|
||||
// If input/textarea && if key is other than ESCAPE => not a dropdown command
|
||||
|
||||
const isInput = /input|textarea/i.test(event.target.tagName);
|
||||
const isEscapeEvent = event.key === ESCAPE_KEY;
|
||||
const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key);
|
||||
if (!isUpOrDownEvent && !isEscapeEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isActive = this.classList.contains(CLASS_NAME_SHOW);
|
||||
|
||||
if (!isActive && event.key === ESCAPE_KEY) {
|
||||
if (isInput && !isEscapeEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if (isDisabled(this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine__default.default.prev(this, SELECTOR_DATA_TOGGLE)[0];
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode);
|
||||
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
||||
|
||||
if (event.key === ESCAPE_KEY) {
|
||||
instance.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
|
||||
if (!isActive) {
|
||||
instance.show();
|
||||
}
|
||||
|
||||
if (isUpOrDownEvent) {
|
||||
event.stopPropagation();
|
||||
instance.show();
|
||||
instance._selectMenuItem(event);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isActive || event.key === SPACE_KEY) {
|
||||
Dropdown.clearMenus();
|
||||
if (instance._isShown()) {
|
||||
// else is escape and we check if it is shown
|
||||
event.stopPropagation();
|
||||
instance.hide();
|
||||
getToggleButton.focus();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
|
||||
EventHandler__default.default.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler);
|
||||
EventHandler__default.default.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
|
||||
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus);
|
||||
EventHandler__default.default.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
|
||||
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler);
|
||||
EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus);
|
||||
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
event.preventDefault();
|
||||
Dropdown.getOrCreateInstance(this).toggle();
|
||||
});
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
* add .Dropdown to jQuery only if jQuery is present
|
||||
*/
|
||||
|
||||
defineJQueryPlugin(Dropdown);
|
||||
index_js.defineJQueryPlugin(Dropdown);
|
||||
|
||||
return Dropdown;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue