Merge branch 'main' into pr/34529

This commit is contained in:
Mark Otto 2022-12-28 14:28:25 -08:00
commit 69896d1ddb
641 changed files with 36838 additions and 35124 deletions

View File

@ -2,59 +2,59 @@
"files": [ "files": [
{ {
"path": "./dist/css/bootstrap-grid.css", "path": "./dist/css/bootstrap-grid.css",
"maxSize": "7.5 kB" "maxSize": "8.25 kB"
}, },
{ {
"path": "./dist/css/bootstrap-grid.min.css", "path": "./dist/css/bootstrap-grid.min.css",
"maxSize": "6.55 kB" "maxSize": "7.5 kB"
}, },
{ {
"path": "./dist/css/bootstrap-reboot.css", "path": "./dist/css/bootstrap-reboot.css",
"maxSize": "2.55 kB" "maxSize": "3.5 kB"
}, },
{ {
"path": "./dist/css/bootstrap-reboot.min.css", "path": "./dist/css/bootstrap-reboot.min.css",
"maxSize": "2.5 kB" "maxSize": "3.25 kB"
}, },
{ {
"path": "./dist/css/bootstrap-utilities.css", "path": "./dist/css/bootstrap-utilities.css",
"maxSize": "7.75 kB" "maxSize": "10.5 kB"
}, },
{ {
"path": "./dist/css/bootstrap-utilities.min.css", "path": "./dist/css/bootstrap-utilities.min.css",
"maxSize": "7.0 kB" "maxSize": "9.75 kB"
}, },
{ {
"path": "./dist/css/bootstrap.css", "path": "./dist/css/bootstrap.css",
"maxSize": "27.75 kB" "maxSize": "31.25 kB"
}, },
{ {
"path": "./dist/css/bootstrap.min.css", "path": "./dist/css/bootstrap.min.css",
"maxSize": "26.0 kB" "maxSize": "29.25 kB"
}, },
{ {
"path": "./dist/js/bootstrap.bundle.js", "path": "./dist/js/bootstrap.bundle.js",
"maxSize": "42.5 kB" "maxSize": "43.0 kB"
}, },
{ {
"path": "./dist/js/bootstrap.bundle.min.js", "path": "./dist/js/bootstrap.bundle.min.js",
"maxSize": "22.75 kB" "maxSize": "23.0 kB"
}, },
{ {
"path": "./dist/js/bootstrap.esm.js", "path": "./dist/js/bootstrap.esm.js",
"maxSize": "27.5 kB" "maxSize": "28.0 kB"
}, },
{ {
"path": "./dist/js/bootstrap.esm.min.js", "path": "./dist/js/bootstrap.esm.min.js",
"maxSize": "18.5 kB" "maxSize": "18.25 kB"
}, },
{ {
"path": "./dist/js/bootstrap.js", "path": "./dist/js/bootstrap.js",
"maxSize": "28.25 kB" "maxSize": "28.75 kB"
}, },
{ {
"path": "./dist/js/bootstrap.min.js", "path": "./dist/js/bootstrap.min.js",
"maxSize": "16.25 kB" "maxSize": "16.0 kB"
} }
], ],
"ci": { "ci": {
@ -63,4 +63,4 @@
"v4-dev" "v4-dev"
] ]
} }
} }

View File

@ -8,6 +8,7 @@
"autohiding", "autohiding",
"autoplay", "autoplay",
"autoplays", "autoplays",
"autoplaying",
"blazingly", "blazingly",
"Blockquotes", "Blockquotes",
"Bootstrappers", "Bootstrappers",
@ -19,6 +20,7 @@
"btnradio", "btnradio",
"callout", "callout",
"callouts", "callouts",
"camelCase",
"clearfix", "clearfix",
"Codesniffer", "Codesniffer",
"combinator", "combinator",
@ -49,6 +51,7 @@
"Hoverable", "Hoverable",
"hreflang", "hreflang",
"hstack", "hstack",
"importmap",
"jsdelivr", "jsdelivr",
"Jumpstart", "Jumpstart",
"keyframes", "keyframes",
@ -60,6 +63,8 @@
"markdownify", "markdownify",
"mediaqueries", "mediaqueries",
"minifiers", "minifiers",
"misfunction",
"mkdir",
"monospace", "monospace",
"mouseleave", "mouseleave",
"navbars", "navbars",
@ -72,7 +77,6 @@
"Packagist", "Packagist",
"popperjs", "popperjs",
"prebuild", "prebuild",
"precompiled",
"prefersreducedmotion", "prefersreducedmotion",
"prepended", "prepended",
"printf", "printf",
@ -87,7 +91,9 @@
"scrollspy", "scrollspy",
"Segoe", "Segoe",
"semibold", "semibold",
"socio",
"srcset", "srcset",
"stackblitz",
"stickied", "stickied",
"Stylelint", "Stylelint",
"subnav", "subnav",
@ -104,6 +110,7 @@
"urlize", "urlize",
"vbtn", "vbtn",
"viewports", "viewports",
"Vite",
"vstack", "vstack",
"walkthroughs", "walkthroughs",
"WCAG", "WCAG",

View File

@ -3,4 +3,6 @@
**/vendor/ **/vendor/
/_site/ /_site/
/js/coverage/ /js/coverage/
/js/tests/integration/
/site/static/sw.js /site/static/sw.js
/site/layouts/

View File

@ -46,6 +46,7 @@
"error", "error",
"after" "after"
], ],
"prefer-template": "error",
"semi": [ "semi": [
"error", "error",
"never" "never"
@ -54,6 +55,7 @@
"unicorn/no-array-callback-reference": "off", "unicorn/no-array-callback-reference": "off",
"unicorn/no-array-method-this-argument": "off", "unicorn/no-array-method-this-argument": "off",
"unicorn/no-null": "off", "unicorn/no-null": "off",
"unicorn/no-typeof-undefined": "off",
"unicorn/no-unused-properties": "error", "unicorn/no-unused-properties": "error",
"unicorn/prefer-array-flat": "off", "unicorn/prefer-array-flat": "off",
"unicorn/prefer-dom-node-dataset": "off", "unicorn/prefer-dom-node-dataset": "off",

View File

@ -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 and [submitting pull requests](#pull-requests), but please respect the following
restrictions: restrictions:
* Please **do not** use the issue tracker for personal support requests. Stack - Please **do not** use the issue tracker for personal support requests. Stack Overflow ([`bootstrap-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.
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** 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. 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/) 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. 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`. 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** &mdash; ideally create a [reduced test 3. **Isolate the problem** &mdash; ideally create a [reduced test
case](https://css-tricks.com/reduced-test-cases/) and a live example. 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 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 | | 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. | | 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. | | 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. | | 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 | | Microsoft | Edge | Blink | <https://developer.microsoft.com/en-us/microsoft-edge/> | Go to "Help > Send Feedback" from the browser |
## Feature requests ## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea 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 case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible. provide as much detail and context as possible.

38
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -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. -->

2
.github/SUPPORT.md vendored
View File

@ -6,6 +6,6 @@ See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports.
For general troubleshooting or help getting started: 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. - 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. - Ask and explore Stack Overflow with the [`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5) tag.

3
.github/codeql/codeql-config.yml vendored Normal file
View File

@ -0,0 +1,3 @@
name: "CodeQL config"
paths-ignore:
- dist

View File

@ -6,7 +6,10 @@ on:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 16 NODE: 18
permissions:
contents: read
jobs: jobs:
browserstack: browserstack:
@ -17,6 +20,8 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3

View File

@ -9,7 +9,10 @@ on:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 16 NODE: 18
permissions:
contents: read
jobs: jobs:
bundlewatch: bundlewatch:
@ -18,6 +21,8 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3

View File

@ -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 }}

View File

@ -7,7 +7,6 @@ on:
- v4-dev - v4-dev
- "!dependabot/**" - "!dependabot/**"
pull_request: pull_request:
# The branches below must be a subset of the branches above
branches: branches:
- main - main
- v4-dev - v4-dev
@ -28,11 +27,20 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v2
with: with:
config-file: ./.github/codeql/codeql-config.yml
languages: "javascript" languages: "javascript"
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v2
with:
category: "/language:javascript"

View File

@ -9,18 +9,26 @@ on:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 16
permissions:
contents: read
jobs: jobs:
cspell: cspell:
permissions:
# allow streetsidesoftware/cspell-action to fetch files for commits and PRs
contents: read
pull-requests: read
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Run cspell - name: Run cspell
uses: streetsidesoftware/cspell-action@v1 uses: streetsidesoftware/cspell-action@v2
with: with:
config: ".cspell.json" config: ".cspell.json"
files: "**/*.md" files: "**/*.md"

View File

@ -9,7 +9,10 @@ on:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 16 NODE: 18
permissions:
contents: read
jobs: jobs:
css: css:
@ -18,6 +21,8 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
@ -30,3 +35,6 @@ jobs:
- name: Build CSS - name: Build CSS
run: npm run css run: npm run css
- name: Run CSS tests
run: npm run css-test

View File

@ -9,7 +9,10 @@ on:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 16 NODE: 18
permissions:
contents: read
jobs: jobs:
docs: docs:
@ -18,6 +21,8 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3

View File

@ -4,8 +4,15 @@ on:
schedule: schedule:
- cron: "0 0 * * *" - cron: "0 0 * * *"
permissions:
contents: read
jobs: jobs:
issue-close-require: issue-close-require:
permissions:
# allow actions-cool/issues-helper to update issues and PRs
issues: write
pull-requests: write
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'twbs/bootstrap' if: github.repository == 'twbs/bootstrap'
steps: steps:

View File

@ -4,16 +4,23 @@ on:
issues: issues:
types: [labeled] types: [labeled]
permissions:
contents: read
jobs: jobs:
issue-labeled: issue-labeled:
permissions:
# allow actions-cool/issues-helper to update issues and PRs
issues: write
pull-requests: write
if: github.repository == 'twbs/bootstrap' if: github.repository == 'twbs/bootstrap'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: awaiting reply - name: awaiting reply
if: github.event.label.name == 'awaiting-reply' if: github.event.label.name == 'needs-example'
uses: actions-cool/issues-helper@v3 uses: actions-cool/issues-helper@v3
with: with:
actions: "create-comment" actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
body: | 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.

View File

@ -9,16 +9,25 @@ on:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 16 NODE: 18
permissions:
contents: read
jobs: jobs:
run: run:
permissions:
# allow coverallsapp/github-action to create new checks issues and fetch code
checks: write
contents: read
name: JS Tests name: JS Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3

View File

@ -9,7 +9,10 @@ on:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 16 NODE: 18
permissions:
contents: read
jobs: jobs:
lint: lint:
@ -18,6 +21,8 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3

View File

@ -9,7 +9,10 @@ on:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 16 NODE: 18
permissions:
contents: read
jobs: jobs:
css: css:
@ -18,6 +21,8 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3

View File

@ -6,8 +6,15 @@ on:
- main - main
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
update_release_draft: 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 runs-on: ubuntu-latest
if: github.repository == 'twbs/bootstrap' if: github.repository == 'twbs/bootstrap'
steps: steps:

View File

@ -27,5 +27,14 @@
} }
], ],
"scss/selector-no-union-class-name": true "scss/selector-no-union-class-name": true
} },
"overrides": [
{
"files": "scss/**/*.{test,spec}.scss",
"rules": {
"scss/dollar-variable-default": null,
"declaration-no-important": null
}
}
]
} }

View File

@ -2,42 +2,131 @@
## Our Pledge ## 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 ## 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 - Demonstrating empathy and kindness toward other people
- Being respectful of differing viewpoints and experiences - Being respectful of differing opinions, viewpoints, and experiences
- Gracefully accepting constructive criticism - Giving and gracefully accepting constructive feedback
- Focusing on what is best for the community - Accepting responsibility and apologizing to those affected by our mistakes,
- Showing empathy towards other community members 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 - The use of sexualized language or imagery, and sexual attention or advances of
- Trolling, insulting/derogatory comments, and personal or political attacks any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment - Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission - Publishing others' private information, such as a physical or email address,
- Other conduct which could reasonably be considered inappropriate in a professional setting 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 ## 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 ## 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 ## 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

View File

@ -1,6 +1,5 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2011-2022 Twitter, Inc.
Copyright (c) 2011-2022 The Bootstrap Authors Copyright (c) 2011-2022 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -1,6 +1,6 @@
<p align="center"> <p align="center">
<a href="https://getbootstrap.com/"> <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> </a>
</p> </p>
@ -9,7 +9,7 @@
<p align="center"> <p align="center">
Sleek, intuitive, and powerful front-end framework for faster and easier web development. Sleek, intuitive, and powerful front-end framework for faster and easier web development.
<br> <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>
<br> <br>
<a href="https://github.com/twbs/bootstrap/issues/new?assignees=-&labels=bug&template=bug_report.yml">Report bug</a> <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: 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` - Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap` - Install with [npm](https://www.npmjs.com/): `npm install bootstrap@v5.3.0-alpha1`
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap` - Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@v5.3.0-alpha1`
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.1.3` - 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` - 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 ## Status
[![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com/) [![Build Status](https://img.shields.io/github/actions/workflow/status/twbs/bootstrap/js.yml?branch=main&label=JS%20Tests&logo=github)](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Amain)
[![Build Status](https://img.shields.io/github/workflow/status/twbs/bootstrap/JS%20Tests/main?label=JS%20Tests&logo=github)](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Amain) [![npm version](https://img.shields.io/npm/v/bootstrap?logo=npm&logoColor=fff)](https://www.npmjs.com/package/bootstrap)
[![npm version](https://img.shields.io/npm/v/bootstrap)](https://www.npmjs.com/package/bootstrap) [![Gem version](https://img.shields.io/gem/v/bootstrap?logo=rubygems&logoColor=fff)](https://rubygems.org/gems/bootstrap)
[![Gem version](https://img.shields.io/gem/v/bootstrap)](https://rubygems.org/gems/bootstrap) [![Meteor Atmosphere](https://img.shields.io/badge/meteor-twbs%3Abootstrap-blue?logo=meteor&logoColor=fff)](https://atmospherejs.com/twbs/bootstrap)
[![Meteor Atmosphere](https://img.shields.io/badge/meteor-twbs%3Abootstrap-blue)](https://atmospherejs.com/twbs/bootstrap) [![Packagist Prerelease](https://img.shields.io/packagist/vpre/twbs/bootstrap?logo=packagist&logoColor=fff)](https://packagist.org/packages/twbs/bootstrap)
[![Packagist Prerelease](https://img.shields.io/packagist/vpre/twbs/bootstrap)](https://packagist.org/packages/twbs/bootstrap) [![NuGet](https://img.shields.io/nuget/vpre/bootstrap?logo=nuget&logoColor=fff)](https://www.nuget.org/packages/bootstrap/absoluteLatest)
[![NuGet](https://img.shields.io/nuget/vpre/bootstrap)](https://www.nuget.org/packages/bootstrap/absoluteLatest) [![Coverage Status](https://img.shields.io/coveralls/github/twbs/bootstrap/main?logo=coveralls&logoColor=fff)](https://coveralls.io/github/twbs/bootstrap?branch=main)
[![Coverage Status](https://img.shields.io/coveralls/github/twbs/bootstrap/main)](https://coveralls.io/github/twbs/bootstrap?branch=main)
[![CSS gzip size](https://img.badgesize.io/twbs/bootstrap/main/dist/css/bootstrap.min.css?compression=gzip&label=CSS%20gzip%20size)](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css) [![CSS gzip size](https://img.badgesize.io/twbs/bootstrap/main/dist/css/bootstrap.min.css?compression=gzip&label=CSS%20gzip%20size)](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css)
[![CSS Brotli size](https://img.badgesize.io/twbs/bootstrap/main/dist/css/bootstrap.min.css?compression=brotli&label=CSS%20Brotli%20size)](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css) [![CSS Brotli size](https://img.badgesize.io/twbs/bootstrap/main/dist/css/bootstrap.min.css?compression=brotli&label=CSS%20Brotli%20size)](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css)
[![JS gzip size](https://img.badgesize.io/twbs/bootstrap/main/dist/js/bootstrap.min.js?compression=gzip&label=JS%20gzip%20size)](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js) [![JS gzip size](https://img.badgesize.io/twbs/bootstrap/main/dist/js/bootstrap.min.js?compression=gzip&label=JS%20gzip%20size)](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js)
[![JS Brotli size](https://img.badgesize.io/twbs/bootstrap/main/dist/js/bootstrap.min.js?compression=brotli&label=JS%20Brotli%20size)](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js) [![JS Brotli size](https://img.badgesize.io/twbs/bootstrap/main/dist/js/bootstrap.min.js?compression=brotli&label=JS%20Brotli%20size)](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)
[![Backers on Open Collective](https://img.shields.io/opencollective/backers/bootstrap)](#backers) [![Backers on Open Collective](https://img.shields.io/opencollective/backers/bootstrap?logo=opencollective&logoColor=fff)](#backers)
[![Sponsors on Open Collective](https://img.shields.io/opencollective/sponsors/bootstrap)](#sponsors) [![Sponsors on Open Collective](https://img.shields.io/opencollective/sponsors/bootstrap?logo=opencollective&logoColor=fff)](#sponsors)
## What's included ## What's included
@ -138,14 +137,14 @@ We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified
## Bugs and feature requests ## 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 ## 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. 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 ### 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). - Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
- Read and subscribe to [The Official Bootstrap Blog](https://blog.getbootstrap.com/). - 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. - 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)). - 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. - 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 ## Copyright and license
Code and documentation copyright 20112022 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 20112022 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/).

View File

@ -9,6 +9,7 @@
"extends": "../.eslintrc.json", "extends": "../.eslintrc.json",
"rules": { "rules": {
"no-console": "off", "no-console": "off",
"strict": "error" "strict": "error",
"unicorn/prefer-top-level-await": "off"
} }
} }

View File

@ -3,20 +3,19 @@
/*! /*!
* Script to build our plugins to use them separately. * Script to build our plugins to use them separately.
* Copyright 2020-2022 The Bootstrap Authors * Copyright 2020-2022 The Bootstrap Authors
* Copyright 2020-2022 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
'use strict' 'use strict'
const path = require('path') const path = require('node:path')
const rollup = require('rollup') const rollup = require('rollup')
const globby = require('globby') const globby = require('globby')
const { babel } = require('@rollup/plugin-babel') const { babel } = require('@rollup/plugin-babel')
const banner = require('./banner.js') const banner = require('./banner.js')
const sourcePath = path.resolve(__dirname, '../js/src/').replace(/\\/g, '/') 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 // Array which holds the resolved plugins
const resolvedPlugins = [] const resolvedPlugins = []
@ -27,7 +26,7 @@ const filenameToEntity = filename => filename.replace('.js', '')
for (const file of jsFiles) { for (const file of jsFiles) {
resolvedPlugins.push({ resolvedPlugins.push({
src: file.replace('.js', ''), src: file,
dist: file.replace('src', 'dist'), dist: file.replace('src', 'dist'),
fileName: path.basename(file), fileName: path.basename(file),
className: filenameToEntity(path.basename(file)) className: filenameToEntity(path.basename(file))

View File

@ -3,14 +3,13 @@
/*! /*!
* Script to update version number references in the project. * Script to update version number references in the project.
* Copyright 2017-2022 The Bootstrap Authors * Copyright 2017-2022 The Bootstrap Authors
* Copyright 2017-2022 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
'use strict' 'use strict'
const fs = require('fs').promises const fs = require('node:fs').promises
const path = require('path') const path = require('node:path')
const globby = require('globby') const globby = require('globby')
const VERBOSE = process.argv.includes('--verbose') const VERBOSE = process.argv.includes('--verbose')

View File

@ -6,15 +6,14 @@
* otherwise the hashes won't match! * otherwise the hashes won't match!
* *
* Copyright 2017-2022 The Bootstrap Authors * Copyright 2017-2022 The Bootstrap Authors
* Copyright 2017-2022 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
'use strict' 'use strict'
const crypto = require('crypto') const crypto = require('node:crypto')
const fs = require('fs') const fs = require('node:fs')
const path = require('path') const path = require('node:path')
const sh = require('shelljs') const sh = require('shelljs')
sh.config.fatal = true sh.config.fatal = true

View File

@ -1,6 +1,6 @@
'use strict' 'use strict'
const path = require('path') const path = require('node:path')
const { babel } = require('@rollup/plugin-babel') const { babel } = require('@rollup/plugin-babel')
const { nodeResolve } = require('@rollup/plugin-node-resolve') const { nodeResolve } = require('@rollup/plugin-node-resolve')
const replace = require('@rollup/plugin-replace') const replace = require('@rollup/plugin-replace')
@ -40,7 +40,7 @@ if (BUNDLE) {
const rollupConfig = { const rollupConfig = {
input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`), input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
output: { output: {
banner, banner: banner(),
file: path.resolve(__dirname, `../dist/js/${fileDestination}.js`), file: path.resolve(__dirname, `../dist/js/${fileDestination}.js`),
format: ESM ? 'esm' : 'umd', format: ESM ? 'esm' : 'umd',
globals, globals,

View File

@ -3,13 +3,12 @@
/*! /*!
* Script to run vnu-jar if Java is available. * Script to run vnu-jar if Java is available.
* Copyright 2017-2022 The Bootstrap Authors * Copyright 2017-2022 The Bootstrap Authors
* Copyright 2017-2022 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
'use strict' 'use strict'
const { execFile, spawn } = require('child_process') const { execFile, spawn } = require('node:child_process')
const vnu = require('vnu-jar') const vnu = require('vnu-jar')
execFile('java', ['-version'], (error, stdout, stderr) => { execFile('java', ['-version'], (error, stdout, stderr) => {

View File

@ -9,7 +9,7 @@
'use strict' 'use strict'
const path = require('path') const path = require('node:path')
const sh = require('shelljs') const sh = require('shelljs')
const pkg = require('../package.json') const pkg = require('../package.json')

View File

@ -31,7 +31,7 @@ publishDir: "_site"
module: module:
mounts: mounts:
- source: dist - source: dist
target: static/docs/5.1/dist target: static/docs/5.3/dist
- source: site/assets - source: site/assets
target: assets target: assets
- source: site/content - source: site/content
@ -42,47 +42,46 @@ module:
target: layouts target: layouts
- source: site/static - source: site/static
target: 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 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 target: static/favicon.ico
params: 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" 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_version: "5.3.0-alpha1"
current_ruby_version: "5.1.3" current_ruby_version: "5.3.0-alpha1"
docs_version: "5.1" docs_version: "5.3"
rfs_version: "v9.0.6" rfs_version: "v9.0.6"
github_org: "https://github.com/twbs" github_org: "https://github.com/twbs"
repo: "https://github.com/twbs/bootstrap" repo: "https://github.com/twbs/bootstrap"
twitter: "getbootstrap" twitter: "getbootstrap"
slack: "https://bootstrap-slack.herokuapp.com/"
opencollective: "https://opencollective.com/bootstrap" opencollective: "https://opencollective.com/bootstrap"
blog: "https://blog.getbootstrap.com/" blog: "https://blog.getbootstrap.com/"
themes: "https://themes.getbootstrap.com/" themes: "https://themes.getbootstrap.com/"
icons: "https://icons.getbootstrap.com/" icons: "https://icons.getbootstrap.com/"
swag: "https://cottonbureau.com/people/bootstrap"
download: download:
source: "https://github.com/twbs/bootstrap/archive/v5.1.3.zip" source: "https://github.com/twbs/bootstrap/archive/v5.3.0-alpha1.zip"
dist: "https://github.com/twbs/bootstrap/releases/download/v5.1.3/bootstrap-5.1.3-dist.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.1.3/bootstrap-5.1.3-examples.zip" dist_examples: "https://github.com/twbs/bootstrap/releases/download/v5.3.0-alpha1/bootstrap-5.3.0-alpha1-examples.zip"
cdn: cdn:
# See https://www.srihash.org for info on how to generate the hashes # 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: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
css_hash: "sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" css_hash: "sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD"
css_rtl: "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.rtl.min.css" css_rtl: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.rtl.min.css"
css_rtl_hash: "sha384-+qdLaIRZfNu4cVPK/PxJJEy0B0f3Ugv8i482AKY7gwXwhaCroABd086ybrVKTa0q" css_rtl_hash: "sha384-WJUUqfoMmnfkBLne5uxXj+na/c7sesSJ32gI7GfCk4zO4GthUKhSEGyvQ839BC51"
js: "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" js: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js"
js_hash: "sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" js_hash: "sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD"
js_bundle: "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" js_bundle: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
js_bundle_hash: "sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" js_bundle_hash: "sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
popper: "https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.5/dist/umd/popper.min.js" popper: "https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
popper_hash: "sha384-Xe+8cL9oJa6tN/veChSP7q+mnSPaj5Bcu9mPX5F5xIGE0DVittaqT5lorf0EI7Vk" popper_hash: "sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3"
anchors: anchors:
min: 2 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

View File

@ -1,11 +1,10 @@
/*! /*!
* Bootstrap Reboot v5.1.3 (https://getbootstrap.com/) * Bootstrap Reboot v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2022 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * 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-blue: #0d6efd;
--bs-indigo: #6610f2; --bs-indigo: #6610f2;
--bs-purple: #6f42c1; --bs-purple: #6f42c1;
@ -16,6 +15,7 @@
--bs-green: #198754; --bs-green: #198754;
--bs-teal: #20c997; --bs-teal: #20c997;
--bs-cyan: #0dcaf0; --bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff; --bs-white: #fff;
--bs-gray: #6c757d; --bs-gray: #6c757d;
--bs-gray-dark: #343a40; --bs-gray-dark: #343a40;
@ -44,11 +44,35 @@
--bs-danger-rgb: 220, 53, 69; --bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250; --bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41; --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-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0; --bs-black-rgb: 0, 0, 0;
--bs-body-color-rgb: 33, 37, 41; --bs-body-color-rgb: 33, 37, 41;
--bs-body-bg-rgb: 255, 255, 255; --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-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-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif); --bs-body-font-family: var(--bs-font-sans-serif);
@ -56,7 +80,99 @@
--bs-body-font-weight: 400; --bs-body-font-weight: 400;
--bs-body-line-height: 1.5; --bs-body-line-height: 1.5;
--bs-body-color: #212529; --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: #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 { hr {
margin: 1rem 0; margin: 1rem 0;
color: inherit; color: inherit;
background-color: currentColor;
border: 0; border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25; opacity: 0.25;
} }
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 { h6, h5, h4, h3, h2, h1 {
margin-top: 0; margin-top: 0;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
font-weight: 500; font-weight: 500;
line-height: 1.2; line-height: 1.2;
color: var(--bs-heading-color, inherit);
} }
h1 { h1 {
@ -152,8 +265,7 @@ p {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
abbr[title], abbr[title] {
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted; -webkit-text-decoration: underline dotted;
text-decoration: underline dotted; text-decoration: underline dotted;
cursor: help; cursor: help;
@ -209,8 +321,8 @@ small {
} }
mark { mark {
padding: 0.2em; padding: 0.1875em;
background-color: #fcf8e3; background-color: var(--bs-highlight-bg);
} }
sub, sub,
@ -230,11 +342,11 @@ sup {
} }
a { a {
color: #0d6efd; color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline; text-decoration: underline;
} }
a:hover { 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 { a:not([href]):not([class]), a:not([href]):not([class]):hover {
@ -248,8 +360,6 @@ kbd,
samp { samp {
font-family: var(--bs-font-monospace); font-family: var(--bs-font-monospace);
font-size: 1em; font-size: 1em;
direction: ltr /* rtl:ignore */;
unicode-bidi: bidi-override;
} }
pre { pre {
@ -267,7 +377,7 @@ pre code {
code { code {
font-size: 0.875em; font-size: 0.875em;
color: #d63384; color: var(--bs-code-color);
word-wrap: break-word; word-wrap: break-word;
} }
a > code { a > code {
@ -275,16 +385,15 @@ a > code {
} }
kbd { kbd {
padding: 0.2rem 0.4rem; padding: 0.1875rem 0.375rem;
font-size: 0.875em; font-size: 0.875em;
color: #fff; color: var(--bs-body-bg);
background-color: #212529; background-color: var(--bs-body-color);
border-radius: 0.2rem; border-radius: 0.25rem;
} }
kbd kbd { kbd kbd {
padding: 0; padding: 0;
font-size: 1em; font-size: 1em;
font-weight: 700;
} }
figure { figure {
@ -304,7 +413,7 @@ table {
caption { caption {
padding-top: 0.5rem; padding-top: 0.5rem;
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
color: #6c757d; color: var(--bs-secondary-color);
text-align: left; text-align: left;
} }
@ -363,8 +472,8 @@ select:disabled {
opacity: 1; opacity: 1;
} }
[list]::-webkit-calendar-picker-indicator { [list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none; display: none !important;
} }
button, button,
@ -450,14 +559,11 @@ legend + * {
::-webkit-file-upload-button { ::-webkit-file-upload-button {
font: inherit; font: inherit;
-webkit-appearance: button;
} }
::file-selector-button { ::file-selector-button {
font: inherit; font: inherit;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button; -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

View File

@ -1,11 +1,10 @@
/*! /*!
* Bootstrap Reboot v5.1.3 (https://getbootstrap.com/) * Bootstrap Reboot v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2022 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * 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-blue: #0d6efd;
--bs-indigo: #6610f2; --bs-indigo: #6610f2;
--bs-purple: #6f42c1; --bs-purple: #6f42c1;
@ -16,6 +15,7 @@
--bs-green: #198754; --bs-green: #198754;
--bs-teal: #20c997; --bs-teal: #20c997;
--bs-cyan: #0dcaf0; --bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff; --bs-white: #fff;
--bs-gray: #6c757d; --bs-gray: #6c757d;
--bs-gray-dark: #343a40; --bs-gray-dark: #343a40;
@ -44,11 +44,35 @@
--bs-danger-rgb: 220, 53, 69; --bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250; --bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41; --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-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0; --bs-black-rgb: 0, 0, 0;
--bs-body-color-rgb: 33, 37, 41; --bs-body-color-rgb: 33, 37, 41;
--bs-body-bg-rgb: 255, 255, 255; --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-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-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif); --bs-body-font-family: var(--bs-font-sans-serif);
@ -56,7 +80,99 @@
--bs-body-font-weight: 400; --bs-body-font-weight: 400;
--bs-body-line-height: 1.5; --bs-body-line-height: 1.5;
--bs-body-color: #212529; --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: #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 { hr {
margin: 1rem 0; margin: 1rem 0;
color: inherit; color: inherit;
background-color: currentColor;
border: 0; border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25; opacity: 0.25;
} }
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 { h6, h5, h4, h3, h2, h1 {
margin-top: 0; margin-top: 0;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
font-weight: 500; font-weight: 500;
line-height: 1.2; line-height: 1.2;
color: var(--bs-heading-color, inherit);
} }
h1 { h1 {
@ -152,8 +265,7 @@ p {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
abbr[title], abbr[title] {
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted; -webkit-text-decoration: underline dotted;
text-decoration: underline dotted; text-decoration: underline dotted;
cursor: help; cursor: help;
@ -209,8 +321,8 @@ small {
} }
mark { mark {
padding: 0.2em; padding: 0.1875em;
background-color: #fcf8e3; background-color: var(--bs-highlight-bg);
} }
sub, sub,
@ -230,11 +342,11 @@ sup {
} }
a { a {
color: #0d6efd; color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline; text-decoration: underline;
} }
a:hover { 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 { a:not([href]):not([class]), a:not([href]):not([class]):hover {
@ -248,8 +360,6 @@ kbd,
samp { samp {
font-family: var(--bs-font-monospace); font-family: var(--bs-font-monospace);
font-size: 1em; font-size: 1em;
direction: ltr ;
unicode-bidi: bidi-override;
} }
pre { pre {
@ -267,7 +377,7 @@ pre code {
code { code {
font-size: 0.875em; font-size: 0.875em;
color: #d63384; color: var(--bs-code-color);
word-wrap: break-word; word-wrap: break-word;
} }
a > code { a > code {
@ -275,16 +385,15 @@ a > code {
} }
kbd { kbd {
padding: 0.2rem 0.4rem; padding: 0.1875rem 0.375rem;
font-size: 0.875em; font-size: 0.875em;
color: #fff; color: var(--bs-body-bg);
background-color: #212529; background-color: var(--bs-body-color);
border-radius: 0.2rem; border-radius: 0.25rem;
} }
kbd kbd { kbd kbd {
padding: 0; padding: 0;
font-size: 1em; font-size: 1em;
font-weight: 700;
} }
figure { figure {
@ -304,7 +413,7 @@ table {
caption { caption {
padding-top: 0.5rem; padding-top: 0.5rem;
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
color: #6c757d; color: var(--bs-secondary-color);
text-align: right; text-align: right;
} }
@ -363,8 +472,8 @@ select:disabled {
opacity: 1; opacity: 1;
} }
[list]::-webkit-calendar-picker-indicator { [list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none; display: none !important;
} }
button, button,
@ -448,14 +557,11 @@ legend + * {
::-webkit-file-upload-button { ::-webkit-file-upload-button {
font: inherit; font: inherit;
-webkit-appearance: button;
} }
::file-selector-button { ::file-selector-button {
font: inherit; font: inherit;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button; -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

5159
dist/js/bootstrap.esm.js vendored

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

26
js/.eslintrc.json Normal file
View File

@ -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"
}
]
}
}
]
}

190
js/dist/alert.js vendored
View File

@ -1,155 +1,23 @@
/*! /*!
* Bootstrap alert.js v5.1.3 (https://getbootstrap.com/) * Bootstrap alert.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler.js'), require('./base-component.js')) : 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(['./dom/event-handler', './base-component'], factory) : 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.EventHandler, global.Base)); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.Index, global.EventHandler, global.BaseComponent, global.ComponentFunctions));
})(this, (function (EventHandler, BaseComponent) { 'use strict'; })(this, (function (index_js, EventHandler, BaseComponent, componentFunctions_js) { '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);
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* 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) * 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 * Constants
* ------------------------------------------------------------------------
*/ */
const NAME = 'alert'; const NAME = 'alert';
@ -159,75 +27,61 @@
const EVENT_CLOSED = `closed${EVENT_KEY}`; const EVENT_CLOSED = `closed${EVENT_KEY}`;
const CLASS_NAME_FADE = 'fade'; const CLASS_NAME_FADE = 'fade';
const CLASS_NAME_SHOW = 'show'; const CLASS_NAME_SHOW = 'show';
/** /**
* ------------------------------------------------------------------------ * Class definition
* Class Definition
* ------------------------------------------------------------------------
*/ */
class Alert extends BaseComponent__default.default { class Alert extends BaseComponent {
// Getters // Getters
static get NAME() { static get NAME() {
return NAME; return NAME;
} // Public }
// Public
close() { close() {
const closeEvent = EventHandler__default.default.trigger(this._element, EVENT_CLOSE); const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
if (closeEvent.defaultPrevented) { if (closeEvent.defaultPrevented) {
return; return;
} }
this._element.classList.remove(CLASS_NAME_SHOW); this._element.classList.remove(CLASS_NAME_SHOW);
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE); const isAnimated = this._element.classList.contains(CLASS_NAME_FADE);
this._queueCallback(() => this._destroyElement(), this._element, isAnimated); this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
} // Private }
// Private
_destroyElement() { _destroyElement() {
this._element.remove(); this._element.remove();
EventHandler.trigger(this._element, EVENT_CLOSED);
EventHandler__default.default.trigger(this._element, EVENT_CLOSED);
this.dispose(); this.dispose();
} // Static }
// Static
static jQueryInterface(config) { static jQueryInterface(config) {
return this.each(function () { return this.each(function () {
const data = Alert.getOrCreateInstance(this); const data = Alert.getOrCreateInstance(this);
if (typeof config !== 'string') { if (typeof config !== 'string') {
return; return;
} }
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
throw new TypeError(`No method named "${config}"`); throw new TypeError(`No method named "${config}"`);
} }
data[config](this); data[config](this);
}); });
} }
} }
/** /**
* ------------------------------------------------------------------------ * Data API implementation
* Data Api implementation
* ------------------------------------------------------------------------
*/ */
componentFunctions_js.enableDismissTrigger(Alert, 'close');
enableDismissTrigger(Alert, 'close');
/** /**
* ------------------------------------------------------------------------
* jQuery * jQuery
* ------------------------------------------------------------------------
* add .Alert to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(Alert); index_js.defineJQueryPlugin(Alert);
return Alert; return Alert;

File diff suppressed because one or more lines are too long

View File

@ -1,180 +1,80 @@
/*! /*!
* Bootstrap base-component.js v5.1.3 (https://getbootstrap.com/) * Bootstrap base-component.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js')) : 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', './dom/event-handler'], factory) : typeof define === 'function' && define.amd ? define(['./dom/data', './util/index', './dom/event-handler', './util/config'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Base = factory(global.Data, global.EventHandler)); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BaseComponent = factory(global.Data, global.Index, global.EventHandler, global.Config));
})(this, (function (Data, EventHandler) { 'use strict'; })(this, (function (Data, index_js, EventHandler, Config) { '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);
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* 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) * 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 * Constants
* ------------------------------------------------------------------------
*/ */
const VERSION = '5.1.3'; const VERSION = '5.3.0-alpha1';
class BaseComponent { /**
constructor(element) { * Class definition
element = getElement(element); */
class BaseComponent extends Config {
constructor(element, config) {
super();
element = index_js.getElement(element);
if (!element) { if (!element) {
return; return;
} }
this._element = element; 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() { dispose() {
Data__default.default.remove(this._element, this.constructor.DATA_KEY); Data.remove(this._element, this.constructor.DATA_KEY);
EventHandler__default.default.off(this._element, this.constructor.EVENT_KEY); EventHandler.off(this._element, this.constructor.EVENT_KEY);
Object.getOwnPropertyNames(this).forEach(propertyName => { for (const propertyName of Object.getOwnPropertyNames(this)) {
this[propertyName] = null; this[propertyName] = null;
}); }
} }
_queueCallback(callback, element, isAnimated = true) { _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) { 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 = {}) { static getOrCreateInstance(element, config = {}) {
return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
} }
static get VERSION() { static get VERSION() {
return VERSION; return VERSION;
} }
static get NAME() {
throw new Error('You have to implement the static method "NAME", for each component!');
}
static get DATA_KEY() { static get DATA_KEY() {
return `bs.${this.NAME}`; return `bs.${this.NAME}`;
} }
static get EVENT_KEY() { static get EVENT_KEY() {
return `.${this.DATA_KEY}`; return `.${this.DATA_KEY}`;
} }
static eventName(name) {
return `${name}${this.EVENT_KEY}`;
}
} }
return BaseComponent; return BaseComponent;

File diff suppressed because one or more lines are too long

106
js/dist/button.js vendored
View File

@ -1,84 +1,23 @@
/*! /*!
* Bootstrap button.js v5.1.3 (https://getbootstrap.com/) * Bootstrap button.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler.js'), require('./base-component.js')) : 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(['./dom/event-handler', './base-component'], factory) : 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.EventHandler, global.Base)); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.Index, global.EventHandler, global.BaseComponent));
})(this, (function (EventHandler, BaseComponent) { 'use strict'; })(this, (function (index_js, 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);
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* 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) * 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 * Constants
* ------------------------------------------------------------------------
*/ */
const NAME = 'button'; const NAME = 'button';
@ -88,57 +27,50 @@
const CLASS_NAME_ACTIVE = 'active'; const CLASS_NAME_ACTIVE = 'active';
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]'; const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; 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 // Getters
static get NAME() { static get NAME() {
return NAME; return NAME;
} // Public }
// Public
toggle() { toggle() {
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method // 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)); this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
} // Static }
// Static
static jQueryInterface(config) { static jQueryInterface(config) {
return this.each(function () { return this.each(function () {
const data = Button.getOrCreateInstance(this); const data = Button.getOrCreateInstance(this);
if (config === 'toggle') { if (config === 'toggle') {
data[config](); data[config]();
} }
}); });
} }
} }
/** /**
* ------------------------------------------------------------------------ * Data API implementation
* Data Api implementation
* ------------------------------------------------------------------------
*/ */
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
event.preventDefault(); event.preventDefault();
const button = event.target.closest(SELECTOR_DATA_TOGGLE); const button = event.target.closest(SELECTOR_DATA_TOGGLE);
const data = Button.getOrCreateInstance(button); const data = Button.getOrCreateInstance(button);
data.toggle(); data.toggle();
}); });
/** /**
* ------------------------------------------------------------------------
* jQuery * jQuery
* ------------------------------------------------------------------------
* add .Button to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(Button); index_js.defineJQueryPlugin(Button);
return Button; return Button;

File diff suppressed because one or more lines are too long

810
js/dist/carousel.js vendored
View File

@ -1,203 +1,23 @@
/*! /*!
* Bootstrap carousel.js v5.1.3 (https://getbootstrap.com/) * Bootstrap carousel.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (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 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(['./dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) : 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.EventHandler, global.Manipulator, global.SelectorEngine, global.Base)); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Carousel = factory(global.Index, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Swipe, global.BaseComponent));
})(this, (function (EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict'; })(this, (function (index_js, EventHandler, Manipulator, SelectorEngine, Swipe, 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);
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* 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) * 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 * Constants
* ------------------------------------------------------------------------
*/ */
const NAME = 'carousel'; const NAME = 'carousel';
@ -208,41 +28,15 @@
const ARROW_RIGHT_KEY = 'ArrowRight'; const ARROW_RIGHT_KEY = 'ArrowRight';
const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 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_NEXT = 'next';
const ORDER_PREV = 'prev'; const ORDER_PREV = 'prev';
const DIRECTION_LEFT = 'left'; const DIRECTION_LEFT = 'left';
const DIRECTION_RIGHT = 'right'; 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_SLIDE = `slide${EVENT_KEY}`;
const EVENT_SLID = `slid${EVENT_KEY}`; const EVENT_SLID = `slid${EVENT_KEY}`;
const EVENT_KEYDOWN = `keydown${EVENT_KEY}`; const EVENT_KEYDOWN = `keydown${EVENT_KEY}`;
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`; const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`;
const EVENT_MOUSELEAVE = `mouseleave${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_DRAG_START = `dragstart${EVENT_KEY}`;
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`; const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`;
const EVENT_CLICK_DATA_API = `click${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_START = 'carousel-item-start';
const CLASS_NAME_NEXT = 'carousel-item-next'; const CLASS_NAME_NEXT = 'carousel-item-next';
const CLASS_NAME_PREV = 'carousel-item-prev'; const CLASS_NAME_PREV = 'carousel-item-prev';
const CLASS_NAME_POINTER_EVENT = 'pointer-event';
const SELECTOR_ACTIVE = '.active'; const SELECTOR_ACTIVE = '.active';
const SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
const SELECTOR_ITEM = '.carousel-item'; const SELECTOR_ITEM = '.carousel-item';
const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM;
const SELECTOR_ITEM_IMG = '.carousel-item img'; const SELECTOR_ITEM_IMG = '.carousel-item img';
const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
const SELECTOR_INDICATORS = '.carousel-indicators'; 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_SLIDE = '[data-bs-slide], [data-bs-slide-to]';
const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]';
const POINTER_TYPE_TOUCH = 'touch'; const KEY_TO_DIRECTION = {
const POINTER_TYPE_PEN = 'pen'; [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) { constructor(element, config) {
super(element); super(element, config);
this._items = null;
this._interval = null; this._interval = null;
this._activeElement = null; this._activeElement = null;
this._isPaused = false;
this._isSliding = false; this._isSliding = false;
this.touchTimeout = null; this.touchTimeout = null;
this.touchStartX = 0; this._swipeHelper = null;
this.touchDeltaX = 0; this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
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._addEventListeners(); this._addEventListeners();
} // Getters if (this._config.ride === CLASS_NAME_CAROUSEL) {
this.cycle();
}
}
// Getters
static get Default() { static get Default() {
return Default; return Default;
} }
static get DefaultType() {
return DefaultType;
}
static get NAME() { static get NAME() {
return NAME; return NAME;
} // Public }
// Public
next() { next() {
this._slide(ORDER_NEXT); this._slide(ORDER_NEXT);
} }
nextWhenVisible() { nextWhenVisible() {
// FIXME TODO use `document.visibilityState`
// Don't call next when the page isn't visible // Don't call next when the page isn't visible
// or the carousel or its parent 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(); this.next();
} }
} }
prev() { prev() {
this._slide(ORDER_PREV); this._slide(ORDER_PREV);
} }
pause() {
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;
}
if (this._isSliding) { 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; 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) { if (activeIndex === index) {
this.pause();
this.cycle();
return; return;
} }
const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; 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
} // Private _configAfterMerge(config) {
config.defaultInterval = config.interval;
_getConfig(config) {
config = { ...Default,
...Manipulator__default.default.getDataAttributes(this._element),
...(typeof config === 'object' ? config : {})
};
typeCheckConfig(NAME, config, DefaultType);
return config; 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() { _addEventListeners() {
if (this._config.keyboard) { 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') { if (this._config.pause === 'hover') {
EventHandler__default.default.on(this._element, EVENT_MOUSEENTER, event => this.pause(event)); EventHandler.on(this._element, EVENT_MOUSEENTER, () => this.pause());
EventHandler__default.default.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event)); EventHandler.on(this._element, EVENT_MOUSELEAVE, () => this._maybeEnableCycle());
} }
if (this._config.touch && Swipe.isSupported()) {
if (this._config.touch && this._touchSupported) {
this._addTouchEventListeners(); this._addTouchEventListeners();
} }
} }
_addTouchEventListeners() { _addTouchEventListeners() {
const hasPointerPenTouch = event => { for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault());
};
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));
} }
} 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) { _keydown(event) {
if (/input|textarea/i.test(event.target.tagName)) { if (/input|textarea/i.test(event.target.tagName)) {
return; return;
} }
const direction = KEY_TO_DIRECTION[event.key]; const direction = KEY_TO_DIRECTION[event.key];
if (direction) { if (direction) {
event.preventDefault(); event.preventDefault();
this._slide(this._directionToOrder(direction));
this._slide(direction);
} }
} }
_getItemIndex(element) { _getItemIndex(element) {
this._items = element && element.parentNode ? SelectorEngine__default.default.find(SELECTOR_ITEM, element.parentNode) : []; return this._getItems().indexOf(element);
return this._items.indexOf(element);
} }
_setActiveIndicatorElement(index) {
_getItemByOrder(order, activeElement) { if (!this._indicatorsElement) {
const isNext = order === ORDER_NEXT; return;
return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap); }
} const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);
activeIndicator.classList.remove(CLASS_NAME_ACTIVE);
_triggerSlideEvent(relatedTarget, eventDirectionName) { activeIndicator.removeAttribute('aria-current');
const targetIndex = this._getItemIndex(relatedTarget); const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement);
if (newActiveIndicator) {
const fromIndex = this._getItemIndex(SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM, this._element)); newActiveIndicator.classList.add(CLASS_NAME_ACTIVE);
newActiveIndicator.setAttribute('aria-current', 'true');
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;
}
}
} }
} }
_updateInterval() { _updateInterval() {
const element = this._activeElement || SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM, this._element); const element = this._activeElement || this._getActive();
if (!element) { if (!element) {
return; return;
} }
const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);
this._config.interval = elementInterval || this._config.defaultInterval;
if (elementInterval) {
this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
this._config.interval = elementInterval;
} else {
this._config.interval = this._config.defaultInterval || this._config.interval;
}
} }
_slide(order, element = null) {
_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;
}
if (this._isSliding) { if (this._isSliding) {
return; return;
} }
const activeElement = this._getActive();
const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); const isNext = order === ORDER_NEXT;
const nextElement = element || index_js.getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap);
if (slideEvent.defaultPrevented) { if (nextElement === activeElement) {
return; return;
} }
const nextElementIndex = this._getItemIndex(nextElement);
if (!activeElement || !nextElement) { const triggerEvent = eventName => {
// Some weirdness is happening, so we bail return EventHandler.trigger(this._element, eventName, {
return;
}
this._isSliding = true;
if (isCycling) {
this.pause();
}
this._setActiveIndicatorElement(nextElement);
this._activeElement = nextElement;
const triggerSlidEvent = () => {
EventHandler__default.default.trigger(this._element, EVENT_SLID, {
relatedTarget: nextElement, relatedTarget: nextElement,
direction: eventDirectionName, direction: this._orderToDirection(order),
from: activeElementIndex, from: this._getItemIndex(activeElement),
to: nextElementIndex to: nextElementIndex
}); });
}; };
const slideEvent = triggerEvent(EVENT_SLIDE);
if (this._element.classList.contains(CLASS_NAME_SLIDE)) { if (slideEvent.defaultPrevented) {
nextElement.classList.add(orderClassName); return;
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();
} }
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) { if (isCycling) {
this.cycle(); this.cycle();
} }
} }
_isAnimated() {
_directionToOrder(direction) { return this._element.classList.contains(CLASS_NAME_SLIDE);
if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) { }
return direction; _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_PREV : ORDER_NEXT;
} }
return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;
} }
_orderToDirection(order) { _orderToDirection(order) {
if (![ORDER_NEXT, ORDER_PREV].includes(order)) { if (index_js.isRTL()) {
return order;
}
if (isRTL()) {
return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;
} }
return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; 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) { static jQueryInterface(config) {
return this.each(function () { 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.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler); const target = SelectorEngine.getElementFromSelector(this);
EventHandler__default.default.on(window, EVENT_LOAD_DATA_API, () => { if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
const carousels = SelectorEngine__default.default.find(SELECTOR_DATA_RIDE); return;
}
for (let i = 0, len = carousels.length; i < len; i++) { event.preventDefault();
Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i])); 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 * jQuery
* ------------------------------------------------------------------------
* add .Carousel to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(Carousel); index_js.defineJQueryPlugin(Carousel);
return Carousel; return Carousel;

File diff suppressed because one or more lines are too long

407
js/dist/collapse.js vendored
View File

@ -1,199 +1,29 @@
/*! /*!
* Bootstrap collapse.js v5.1.3 (https://getbootstrap.com/) * Bootstrap collapse.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (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 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(['./dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) : 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.Data, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base)); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.Index, global.EventHandler, global.SelectorEngine, global.BaseComponent));
})(this, (function (Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict'; })(this, (function (index_js, EventHandler, 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);
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* 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) * 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 * Constants
* ------------------------------------------------------------------------
*/ */
const NAME = 'collapse'; const NAME = 'collapse';
const DATA_KEY = 'bs.collapse'; const DATA_KEY = 'bs.collapse';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; 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_SHOW = `show${EVENT_KEY}`;
const EVENT_SHOWN = `shown${EVENT_KEY}`; const EVENT_SHOWN = `shown${EVENT_KEY}`;
const EVENT_HIDE = `hide${EVENT_KEY}`; const EVENT_HIDE = `hide${EVENT_KEY}`;
@ -209,53 +39,53 @@
const HEIGHT = 'height'; const HEIGHT = 'height';
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]'; 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) { constructor(element, config) {
super(element); super(element, config);
this._isTransitioning = false; this._isTransitioning = false;
this._config = this._getConfig(config);
this._triggerArray = []; this._triggerArray = [];
const toggleList = SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE); const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE);
for (const elem of toggleList) {
for (let i = 0, len = toggleList.length; i < len; i++) { const selector = SelectorEngine.getSelectorFromElement(elem);
const elem = toggleList[i]; const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);
const selector = getSelectorFromElement(elem);
const filterElement = SelectorEngine__default.default.find(selector).filter(foundElem => foundElem === this._element);
if (selector !== null && filterElement.length) { if (selector !== null && filterElement.length) {
this._selector = selector;
this._triggerArray.push(elem); this._triggerArray.push(elem);
} }
} }
this._initializeChildren(); this._initializeChildren();
if (!this._config.parent) { if (!this._config.parent) {
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()); this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
} }
if (this._config.toggle) { if (this._config.toggle) {
this.toggle(); this.toggle();
} }
} // Getters }
// Getters
static get Default() { static get Default() {
return Default; return Default;
} }
static get DefaultType() {
return DefaultType;
}
static get NAME() { static get NAME() {
return NAME; return NAME;
} // Public }
// Public
toggle() { toggle() {
if (this._isShown()) { if (this._isShown()) {
this.hide(); this.hide();
@ -263,231 +93,154 @@
this.show(); this.show();
} }
} }
show() { show() {
if (this._isTransitioning || this._isShown()) { if (this._isTransitioning || this._isShown()) {
return; return;
} }
let activeChildren = [];
let actives = []; // find active children
let activesData;
if (this._config.parent) { if (this._config.parent) {
const children = SelectorEngine__default.default.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, {
actives = SelectorEngine__default.default.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth toggle: false
}));
} }
if (activeChildren.length && activeChildren[0]._isTransitioning) {
const container = SelectorEngine__default.default.findOne(this._selector); return;
if (actives.length) {
const tempActiveData = actives.find(elem => container !== elem);
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
if (activesData && activesData._isTransitioning) {
return;
}
} }
const startEvent = EventHandler.trigger(this._element, EVENT_SHOW);
const startEvent = EventHandler__default.default.trigger(this._element, EVENT_SHOW);
if (startEvent.defaultPrevented) { if (startEvent.defaultPrevented) {
return; return;
} }
for (const activeInstance of activeChildren) {
actives.forEach(elemActive => { activeInstance.hide();
if (container !== elemActive) { }
Collapse.getOrCreateInstance(elemActive, {
toggle: false
}).hide();
}
if (!activesData) {
Data__default.default.set(elemActive, DATA_KEY, null);
}
});
const dimension = this._getDimension(); const dimension = this._getDimension();
this._element.classList.remove(CLASS_NAME_COLLAPSE); this._element.classList.remove(CLASS_NAME_COLLAPSE);
this._element.classList.add(CLASS_NAME_COLLAPSING); this._element.classList.add(CLASS_NAME_COLLAPSING);
this._element.style[dimension] = 0; this._element.style[dimension] = 0;
this._addAriaAndCollapsedClass(this._triggerArray, true); this._addAriaAndCollapsedClass(this._triggerArray, true);
this._isTransitioning = true; this._isTransitioning = true;
const complete = () => { const complete = () => {
this._isTransitioning = false; this._isTransitioning = false;
this._element.classList.remove(CLASS_NAME_COLLAPSING); this._element.classList.remove(CLASS_NAME_COLLAPSING);
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW); this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
this._element.style[dimension] = ''; 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 capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
const scrollSize = `scroll${capitalizedDimension}`; const scrollSize = `scroll${capitalizedDimension}`;
this._queueCallback(complete, this._element, true); this._queueCallback(complete, this._element, true);
this._element.style[dimension] = `${this._element[scrollSize]}px`; this._element.style[dimension] = `${this._element[scrollSize]}px`;
} }
hide() { hide() {
if (this._isTransitioning || !this._isShown()) { if (this._isTransitioning || !this._isShown()) {
return; return;
} }
const startEvent = EventHandler.trigger(this._element, EVENT_HIDE);
const startEvent = EventHandler__default.default.trigger(this._element, EVENT_HIDE);
if (startEvent.defaultPrevented) { if (startEvent.defaultPrevented) {
return; return;
} }
const dimension = this._getDimension(); const dimension = this._getDimension();
this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; 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.add(CLASS_NAME_COLLAPSING);
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW); this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
for (const trigger of this._triggerArray) {
const triggerArrayLength = this._triggerArray.length; const element = SelectorEngine.getElementFromSelector(trigger);
if (element && !this._isShown(element)) {
for (let i = 0; i < triggerArrayLength; i++) {
const trigger = this._triggerArray[i];
const elem = getElementFromSelector(trigger);
if (elem && !this._isShown(elem)) {
this._addAriaAndCollapsedClass([trigger], false); this._addAriaAndCollapsedClass([trigger], false);
} }
} }
this._isTransitioning = true; this._isTransitioning = true;
const complete = () => { const complete = () => {
this._isTransitioning = false; this._isTransitioning = false;
this._element.classList.remove(CLASS_NAME_COLLAPSING); this._element.classList.remove(CLASS_NAME_COLLAPSING);
this._element.classList.add(CLASS_NAME_COLLAPSE); this._element.classList.add(CLASS_NAME_COLLAPSE);
EventHandler.trigger(this._element, EVENT_HIDDEN);
EventHandler__default.default.trigger(this._element, EVENT_HIDDEN);
}; };
this._element.style[dimension] = ''; this._element.style[dimension] = '';
this._queueCallback(complete, this._element, true); this._queueCallback(complete, this._element, true);
} }
_isShown(element = this._element) { _isShown(element = this._element) {
return element.classList.contains(CLASS_NAME_SHOW); 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() { _getDimension() {
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
} }
_initializeChildren() { _initializeChildren() {
if (!this._config.parent) { if (!this._config.parent) {
return; return;
} }
const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE);
const children = SelectorEngine__default.default.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); for (const element of children) {
SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => { const selected = SelectorEngine.getElementFromSelector(element);
const selected = getElementFromSelector(element);
if (selected) { if (selected) {
this._addAriaAndCollapsedClass([element], this._isShown(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) { _addAriaAndCollapsedClass(triggerArray, isOpen) {
if (!triggerArray.length) { if (!triggerArray.length) {
return; return;
} }
for (const element of triggerArray) {
element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen);
element.setAttribute('aria-expanded', isOpen);
}
}
triggerArray.forEach(elem => { // Static
if (isOpen) {
elem.classList.remove(CLASS_NAME_COLLAPSED);
} else {
elem.classList.add(CLASS_NAME_COLLAPSED);
}
elem.setAttribute('aria-expanded', isOpen);
});
} // Static
static jQueryInterface(config) { static jQueryInterface(config) {
const _config = {};
if (typeof config === 'string' && /show|hide/.test(config)) {
_config.toggle = false;
}
return this.each(function () { return this.each(function () {
const _config = {};
if (typeof config === 'string' && /show|hide/.test(config)) {
_config.toggle = false;
}
const data = Collapse.getOrCreateInstance(this, _config); const data = Collapse.getOrCreateInstance(this, _config);
if (typeof config === 'string') { if (typeof config === 'string') {
if (typeof data[config] === 'undefined') { if (typeof data[config] === 'undefined') {
throw new TypeError(`No method named "${config}"`); throw new TypeError(`No method named "${config}"`);
} }
data[config](); data[config]();
} }
}); });
} }
} }
/** /**
* ------------------------------------------------------------------------ * Data API implementation
* Data Api implementation
* ------------------------------------------------------------------------
*/ */
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
EventHandler__default.default.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 // 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') { if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {
event.preventDefault(); event.preventDefault();
} }
for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {
const selector = getSelectorFromElement(this);
const selectorElements = SelectorEngine__default.default.find(selector);
selectorElements.forEach(element => {
Collapse.getOrCreateInstance(element, { Collapse.getOrCreateInstance(element, {
toggle: false toggle: false
}).toggle(); }).toggle();
}); }
}); });
/** /**
* ------------------------------------------------------------------------
* jQuery * jQuery
* ------------------------------------------------------------------------
* add .Collapse to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(Collapse); index_js.defineJQueryPlugin(Collapse);
return Collapse; return Collapse;

File diff suppressed because one or more lines are too long

22
js/dist/dom/data.js vendored
View File

@ -1,6 +1,6 @@
/*! /*!
* Bootstrap data.js v5.1.3 (https://getbootstrap.com/) * Bootstrap data.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
/** /**
* ------------------------------------------------------------------------
* Constants * Constants
* ------------------------------------------------------------------------
*/ */
const elementMap = new Map(); const elementMap = new Map();
const data = { const data = {
set(element, key, instance) { set(element, key, instance) {
if (!elementMap.has(element)) { if (!elementMap.has(element)) {
elementMap.set(element, new Map()); 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 // can be removed later when multiple key/instances are fine to be used
if (!instanceMap.has(key) && instanceMap.size !== 0) { if (!instanceMap.has(key) && instanceMap.size !== 0) {
// eslint-disable-next-line no-console // 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]}.`); console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
return; return;
} }
instanceMap.set(key, instance); instanceMap.set(key, instance);
}, },
get(element, key) { get(element, key) {
if (elementMap.has(element)) { if (elementMap.has(element)) {
return elementMap.get(element).get(key) || null; return elementMap.get(element).get(key) || null;
} }
return null; return null;
}, },
remove(element, key) { remove(element, key) {
if (!elementMap.has(element)) { if (!elementMap.has(element)) {
return; return;
} }
const instanceMap = elementMap.get(element); 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) { if (instanceMap.size === 0) {
elementMap.delete(element); elementMap.delete(element);
} }
} }
}; };
return data; return data;

View File

@ -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;;;;;;;;"}

View File

@ -1,274 +1,196 @@
/*! /*!
* Bootstrap event-handler.js v5.1.3 (https://getbootstrap.com/) * Bootstrap event-handler.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../util/index.js')) :
typeof define === 'function' && define.amd ? define(factory) : typeof define === 'function' && define.amd ? define(['../util/index'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory()); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory(global.Index));
})(this, (function () { 'use strict'; })(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) * 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 * Constants
* ------------------------------------------------------------------------
*/ */
const namespaceRegex = /[^.]*(?=\..*)\.|.*/; const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
const stripNameRegex = /\..*/; const stripNameRegex = /\..*/;
const stripUidRegex = /::\d+$/; const stripUidRegex = /::\d+$/;
const eventRegistry = {}; // Events storage const eventRegistry = {}; // Events storage
let uidEvent = 1; let uidEvent = 1;
const customEvents = { const customEvents = {
mouseenter: 'mouseover', mouseenter: 'mouseover',
mouseleave: 'mouseout' 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']); 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 * Private methods
* ------------------------------------------------------------------------
*/ */
function getUidEvent(element, uid) { function makeEventUid(element, uid) {
return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
} }
function getElementEvents(element) {
function getEvent(element) { const uid = makeEventUid(element);
const uid = getUidEvent(element);
element.uidEvent = uid; element.uidEvent = uid;
eventRegistry[uid] = eventRegistry[uid] || {}; eventRegistry[uid] = eventRegistry[uid] || {};
return eventRegistry[uid]; return eventRegistry[uid];
} }
function bootstrapHandler(element, fn) { function bootstrapHandler(element, fn) {
return function handler(event) { return function handler(event) {
event.delegateTarget = element; hydrateObj(event, {
delegateTarget: element
});
if (handler.oneOff) { if (handler.oneOff) {
EventHandler.off(element, event.type, fn); EventHandler.off(element, event.type, fn);
} }
return fn.apply(element, [event]); return fn.apply(element, [event]);
}; };
} }
function bootstrapDelegationHandler(element, selector, fn) { function bootstrapDelegationHandler(element, selector, fn) {
return function handler(event) { return function handler(event) {
const domElements = element.querySelectorAll(selector); const domElements = element.querySelectorAll(selector);
for (let { for (let {
target target
} = event; target && target !== this; target = target.parentNode) { } = event; target && target !== this; target = target.parentNode) {
for (let i = domElements.length; i--;) { for (const domElement of domElements) {
if (domElements[i] === target) { if (domElement !== target) {
event.delegateTarget = target; continue;
if (handler.oneOff) {
EventHandler.off(element, event.type, selector, fn);
}
return fn.apply(target, [event]);
} }
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, callable, delegationSelector = null) {
function findHandler(events, handler, delegationSelector = null) { return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);
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 normalizeParameters(originalTypeEvent, handler, delegationFunction) {
function normalizeParams(originalTypeEvent, handler, delegationFn) { const isDelegated = typeof handler === 'string';
const delegation = typeof handler === 'string'; // todo: tooltip passes `false` instead of selector, so we need to check
const originalHandler = delegation ? delegationFn : handler; const callable = isDelegated ? delegationFunction : handler || delegationFunction;
let typeEvent = getTypeEvent(originalTypeEvent); let typeEvent = getTypeEvent(originalTypeEvent);
const isNative = nativeEvents.has(typeEvent); if (!nativeEvents.has(typeEvent)) {
if (!isNative) {
typeEvent = originalTypeEvent; typeEvent = originalTypeEvent;
} }
return [isDelegated, callable, typeEvent];
return [delegation, originalHandler, typeEvent];
} }
function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {
function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
if (typeof originalTypeEvent !== 'string' || !element) { if (typeof originalTypeEvent !== 'string' || !element) {
return; return;
} }
let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
if (!handler) { // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
handler = delegationFn;
delegationFn = null;
} // 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 // this prevents the handler from being dispatched the same way as mouseover or mouseout does
if (originalTypeEvent in customEvents) {
const wrapFunction = fn => {
if (customEventsRegex.test(originalTypeEvent)) {
const wrapFn = fn => {
return function (event) { return function (event) {
if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) { if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
return fn.call(this, event); return fn.call(this, event);
} }
}; };
}; };
callable = wrapFunction(callable);
if (delegationFn) {
delegationFn = wrapFn(delegationFn);
} else {
handler = wrapFn(handler);
}
} }
const events = getElementEvents(element);
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
const events = getEvent(element);
const handlers = events[typeEvent] || (events[typeEvent] = {}); const handlers = events[typeEvent] || (events[typeEvent] = {});
const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null); const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);
if (previousFunction) {
if (previousFn) { previousFunction.oneOff = previousFunction.oneOff && oneOff;
previousFn.oneOff = previousFn.oneOff && oneOff;
return; return;
} }
const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));
const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, '')); const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);
const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler); fn.delegationSelector = isDelegated ? handler : null;
fn.delegationSelector = delegation ? handler : null; fn.callable = callable;
fn.originalHandler = originalHandler;
fn.oneOff = oneOff; fn.oneOff = oneOff;
fn.uidEvent = uid; fn.uidEvent = uid;
handlers[uid] = fn; handlers[uid] = fn;
element.addEventListener(typeEvent, fn, delegation); element.addEventListener(typeEvent, fn, isDelegated);
} }
function removeHandler(element, events, typeEvent, handler, delegationSelector) { function removeHandler(element, events, typeEvent, handler, delegationSelector) {
const fn = findHandler(events[typeEvent], handler, delegationSelector); const fn = findHandler(events[typeEvent], handler, delegationSelector);
if (!fn) { if (!fn) {
return; return;
} }
element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)); element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
delete events[typeEvent][fn.uidEvent]; delete events[typeEvent][fn.uidEvent];
} }
function removeNamespacedHandlers(element, events, typeEvent, namespace) { function removeNamespacedHandlers(element, events, typeEvent, namespace) {
const storeElementEvent = events[typeEvent] || {}; const storeElementEvent = events[typeEvent] || {};
Object.keys(storeElementEvent).forEach(handlerKey => { for (const [handlerKey, event] of Object.entries(storeElementEvent)) {
if (handlerKey.includes(namespace)) { if (handlerKey.includes(namespace)) {
const event = storeElementEvent[handlerKey]; removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
} }
}); }
} }
function getTypeEvent(event) { function getTypeEvent(event) {
// allow to get the native events from namespaced events ('click.bs.button' --> 'click') // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
event = event.replace(stripNameRegex, ''); event = event.replace(stripNameRegex, '');
return customEvents[event] || event; return customEvents[event] || event;
} }
const EventHandler = { const EventHandler = {
on(element, event, handler, delegationFn) { on(element, event, handler, delegationFunction) {
addHandler(element, event, handler, delegationFn, false); addHandler(element, event, handler, delegationFunction, false);
}, },
one(element, event, handler, delegationFunction) {
one(element, event, handler, delegationFn) { addHandler(element, event, handler, delegationFunction, true);
addHandler(element, event, handler, delegationFn, true);
}, },
off(element, originalTypeEvent, handler, delegationFunction) {
off(element, originalTypeEvent, handler, delegationFn) {
if (typeof originalTypeEvent !== 'string' || !element) { if (typeof originalTypeEvent !== 'string' || !element) {
return; return;
} }
const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
const inNamespace = typeEvent !== originalTypeEvent; const inNamespace = typeEvent !== originalTypeEvent;
const events = getEvent(element); const events = getElementEvents(element);
const storeElementEvent = events[typeEvent] || {};
const isNamespace = originalTypeEvent.startsWith('.'); const isNamespace = originalTypeEvent.startsWith('.');
if (typeof callable !== 'undefined') {
if (typeof originalHandler !== 'undefined') {
// Simplest case: handler is passed, remove that listener ONLY. // Simplest case: handler is passed, remove that listener ONLY.
if (!events || !events[typeEvent]) { if (!Object.keys(storeElementEvent).length) {
return; return;
} }
removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);
removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
return; return;
} }
if (isNamespace) { if (isNamespace) {
Object.keys(events).forEach(elementEvent => { for (const elementEvent of Object.keys(events)) {
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); 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) { trigger(element, event, args) {
if (typeof event !== 'string' || !element) { if (typeof event !== 'string' || !element) {
return null; return null;
} }
const $ = index_js.getjQuery();
const $ = getjQuery();
const typeEvent = getTypeEvent(event); const typeEvent = getTypeEvent(event);
const inNamespace = event !== typeEvent; const inNamespace = event !== typeEvent;
const isNative = nativeEvents.has(typeEvent); let jQueryEvent = null;
let jQueryEvent;
let bubbles = true; let bubbles = true;
let nativeDispatch = true; let nativeDispatch = true;
let defaultPrevented = false; let defaultPrevented = false;
let evt = null;
if (inNamespace && $) { if (inNamespace && $) {
jQueryEvent = $.Event(event, args); jQueryEvent = $.Event(event, args);
$(element).trigger(jQueryEvent); $(element).trigger(jQueryEvent);
@ -276,45 +198,38 @@
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
defaultPrevented = jQueryEvent.isDefaultPrevented(); defaultPrevented = jQueryEvent.isDefaultPrevented();
} }
let evt = new Event(event, {
if (isNative) { bubbles,
evt = document.createEvent('HTMLEvents'); cancelable: true
evt.initEvent(typeEvent, bubbles, true); });
} else { evt = hydrateObj(evt, args);
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];
}
});
});
}
if (defaultPrevented) { if (defaultPrevented) {
evt.preventDefault(); evt.preventDefault();
} }
if (nativeDispatch) { if (nativeDispatch) {
element.dispatchEvent(evt); element.dispatchEvent(evt);
} }
if (evt.defaultPrevented && jQueryEvent) {
if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
jQueryEvent.preventDefault(); jQueryEvent.preventDefault();
} }
return evt; 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; return EventHandler;

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
/*! /*!
* Bootstrap manipulator.js v5.1.3 (https://getbootstrap.com/) * Bootstrap manipulator.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (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) * 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; return true;
} }
if (value === 'false') {
if (val === 'false') {
return false; return false;
} }
if (value === Number(value).toString()) {
if (val === Number(val).toString()) { return Number(value);
return Number(val);
} }
if (value === '' || value === 'null') {
if (val === '' || val === 'null') {
return null; return null;
} }
if (typeof value !== 'string') {
return val; return value;
}
try {
return JSON.parse(decodeURIComponent(value));
} catch (_unused) {
return value;
}
} }
function normalizeDataKey(key) { function normalizeDataKey(key) {
return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
} }
const Manipulator = { const Manipulator = {
setDataAttribute(element, key, value) { setDataAttribute(element, key, value) {
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
}, },
removeDataAttribute(element, key) { removeDataAttribute(element, key) {
element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
}, },
getDataAttributes(element) { getDataAttributes(element) {
if (!element) { if (!element) {
return {}; return {};
} }
const attributes = {}; 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/, ''); let pureKey = key.replace(/^bs/, '');
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
attributes[pureKey] = normalizeData(element.dataset[key]); attributes[pureKey] = normalizeData(element.dataset[key]);
}); }
return attributes; return attributes;
}, },
getDataAttribute(element, key) { getDataAttribute(element, key) {
return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(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; return Manipulator;

View File

@ -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;;;;;;;;"}

View File

@ -1,125 +1,100 @@
/*! /*!
* Bootstrap selector-engine.js v5.1.3 (https://getbootstrap.com/) * Bootstrap selector-engine.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../util/index.js')) :
typeof define === 'function' && define.amd ? define(factory) : typeof define === 'function' && define.amd ? define(['../util/index'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory()); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory(global.Index));
})(this, (function () { 'use strict'; })(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) * 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 => { // The only valid content that could double as a selector are IDs or classes,
if (!obj || typeof obj !== 'object') { // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
return false; // `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;
} }
return index_js.parseSelector(selector);
if (typeof obj.jquery !== 'undefined') {
obj = obj[0];
}
return typeof obj.nodeType !== 'undefined';
}; };
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 = { const SelectorEngine = {
find(selector, element = document.documentElement) { find(selector, element = document.documentElement) {
return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
}, },
findOne(selector, element = document.documentElement) { findOne(selector, element = document.documentElement) {
return Element.prototype.querySelector.call(element, selector); return Element.prototype.querySelector.call(element, selector);
}, },
children(element, selector) { children(element, selector) {
return [].concat(...element.children).filter(child => child.matches(selector)); return [].concat(...element.children).filter(child => child.matches(selector));
}, },
parents(element, selector) { parents(element, selector) {
const parents = []; const parents = [];
let ancestor = element.parentNode; let ancestor = element.parentNode.closest(selector);
while (ancestor) {
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) { parents.push(ancestor);
if (ancestor.matches(selector)) { ancestor = ancestor.parentNode.closest(selector);
parents.push(ancestor);
}
ancestor = ancestor.parentNode;
} }
return parents; return parents;
}, },
prev(element, selector) { prev(element, selector) {
let previous = element.previousElementSibling; let previous = element.previousElementSibling;
while (previous) { while (previous) {
if (previous.matches(selector)) { if (previous.matches(selector)) {
return [previous]; return [previous];
} }
previous = previous.previousElementSibling; previous = previous.previousElementSibling;
} }
return []; return [];
}, },
// TODO: this is now unused; remove later along with prev()
next(element, selector) { next(element, selector) {
let next = element.nextElementSibling; let next = element.nextElementSibling;
while (next) { while (next) {
if (next.matches(selector)) { if (next.matches(selector)) {
return [next]; return [next];
} }
next = next.nextElementSibling; next = next.nextElementSibling;
} }
return []; return [];
}, },
focusableChildren(element) { focusableChildren(element) {
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', '); 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)); 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; return SelectorEngine;

File diff suppressed because one or more lines are too long

556
js/dist/dropdown.js vendored
View File

@ -1,19 +1,16 @@
/*! /*!
* Bootstrap dropdown.js v5.1.3 (https://getbootstrap.com/) * Bootstrap dropdown.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (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 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', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) : 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.Popper, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base)); (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, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict'; })(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 _interopNamespaceDefault(e) {
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
function _interopNamespace(e) {
if (e && e.__esModule) return e;
const n = Object.create(null);
if (e) { if (e) {
for (const k in e) { for (const k in e) {
if (k !== 'default') { if (k !== 'default') {
@ -29,206 +26,17 @@
return Object.freeze(n); return Object.freeze(n);
} }
const Popper__namespace = /*#__PURE__*/_interopNamespace(Popper); const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(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);
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* 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) * 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 * Constants
* ------------------------------------------------------------------------
*/ */
const NAME = 'dropdown'; const NAME = 'dropdown';
@ -236,13 +44,11 @@
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; const DATA_API_KEY = '.data-api';
const ESCAPE_KEY = 'Escape'; const ESCAPE_KEY = 'Escape';
const SPACE_KEY = 'Space';
const TAB_KEY = 'Tab'; const TAB_KEY = 'Tab';
const ARROW_UP_KEY = 'ArrowUp'; const ARROW_UP_KEY = 'ArrowUp';
const ARROW_DOWN_KEY = 'ArrowDown'; const ARROW_DOWN_KEY = 'ArrowDown';
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button 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_HIDE = `hide${EVENT_KEY}`;
const EVENT_HIDDEN = `hidden${EVENT_KEY}`; const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
const EVENT_SHOW = `show${EVENT_KEY}`; const EVENT_SHOW = `show${EVENT_KEY}`;
@ -254,252 +60,204 @@
const CLASS_NAME_DROPUP = 'dropup'; const CLASS_NAME_DROPUP = 'dropup';
const CLASS_NAME_DROPEND = 'dropend'; const CLASS_NAME_DROPEND = 'dropend';
const CLASS_NAME_DROPSTART = 'dropstart'; const CLASS_NAME_DROPSTART = 'dropstart';
const CLASS_NAME_NAVBAR = 'navbar'; const CLASS_NAME_DROPUP_CENTER = 'dropup-center';
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]'; 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_MENU = '.dropdown-menu';
const SELECTOR_NAVBAR = '.navbar';
const SELECTOR_NAVBAR_NAV = '.navbar-nav'; const SELECTOR_NAVBAR_NAV = '.navbar-nav';
const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; const PLACEMENT_TOP = index_js.isRTL() ? 'top-end' : 'top-start';
const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; const PLACEMENT_TOPEND = index_js.isRTL() ? 'top-start' : 'top-end';
const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; const PLACEMENT_BOTTOM = index_js.isRTL() ? 'bottom-end' : 'bottom-start';
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; const PLACEMENT_BOTTOMEND = index_js.isRTL() ? 'bottom-start' : 'bottom-end';
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; const PLACEMENT_RIGHT = index_js.isRTL() ? 'left-start' : 'right-start';
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; const PLACEMENT_LEFT = index_js.isRTL() ? 'right-start' : 'left-start';
const PLACEMENT_TOPCENTER = 'top';
const PLACEMENT_BOTTOMCENTER = 'bottom';
const Default = { const Default = {
offset: [0, 2], autoClose: true,
boundary: 'clippingParents', boundary: 'clippingParents',
reference: 'toggle',
display: 'dynamic', display: 'dynamic',
offset: [0, 2],
popperConfig: null, popperConfig: null,
autoClose: true reference: 'toggle'
}; };
const DefaultType = { const DefaultType = {
offset: '(array|string|function)', autoClose: '(boolean|string)',
boundary: '(string|element)', boundary: '(string|element)',
reference: '(string|element|object)',
display: 'string', display: 'string',
offset: '(array|string|function)',
popperConfig: '(null|object|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) { constructor(element, config) {
super(element); super(element, config);
this._popper = null; this._popper = null;
this._config = this._getConfig(config); this._parent = this._element.parentNode; // dropdown wrapper
this._menu = this._getMenuElement(); // 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(); this._inNavbar = this._detectNavbar();
} // Getters }
// Getters
static get Default() { static get Default() {
return Default; return Default;
} }
static get DefaultType() { static get DefaultType() {
return DefaultType; return DefaultType;
} }
static get NAME() { static get NAME() {
return NAME; return NAME;
} // Public }
// Public
toggle() { toggle() {
return this._isShown() ? this.hide() : this.show(); return this._isShown() ? this.hide() : this.show();
} }
show() { show() {
if (isDisabled(this._element) || this._isShown(this._menu)) { if (index_js.isDisabled(this._element) || this._isShown()) {
return; return;
} }
const relatedTarget = { const relatedTarget = {
relatedTarget: this._element 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) { if (showEvent.defaultPrevented) {
return; return;
} }
this._createPopper();
const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar // If this is a touch-enabled device we add extra
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
// empty mouseover listeners to the body's immediate children; // empty mouseover listeners to the body's immediate children;
// only needed because of broken event delegation on iOS // only needed because of broken event delegation on iOS
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {
for (const element of [].concat(...document.body.children)) {
if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) { EventHandler.on(element, 'mouseover', index_js.noop);
[].concat(...document.body.children).forEach(elem => EventHandler__default.default.on(elem, 'mouseover', noop)); }
} }
this._element.focus(); this._element.focus();
this._element.setAttribute('aria-expanded', true); this._element.setAttribute('aria-expanded', true);
this._menu.classList.add(CLASS_NAME_SHOW); this._menu.classList.add(CLASS_NAME_SHOW);
this._element.classList.add(CLASS_NAME_SHOW); this._element.classList.add(CLASS_NAME_SHOW);
EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget);
EventHandler__default.default.trigger(this._element, EVENT_SHOWN, relatedTarget);
} }
hide() { hide() {
if (isDisabled(this._element) || !this._isShown(this._menu)) { if (index_js.isDisabled(this._element) || !this._isShown()) {
return; return;
} }
const relatedTarget = { const relatedTarget = {
relatedTarget: this._element relatedTarget: this._element
}; };
this._completeHide(relatedTarget); this._completeHide(relatedTarget);
} }
dispose() { dispose() {
if (this._popper) { if (this._popper) {
this._popper.destroy(); this._popper.destroy();
} }
super.dispose(); super.dispose();
} }
update() { update() {
this._inNavbar = this._detectNavbar(); this._inNavbar = this._detectNavbar();
if (this._popper) { if (this._popper) {
this._popper.update(); this._popper.update();
} }
} // Private }
// Private
_completeHide(relatedTarget) { _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) { if (hideEvent.defaultPrevented) {
return; 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) { if (this._popper) {
this._popper.destroy(); this._popper.destroy();
} }
this._menu.classList.remove(CLASS_NAME_SHOW); this._menu.classList.remove(CLASS_NAME_SHOW);
this._element.classList.remove(CLASS_NAME_SHOW); this._element.classList.remove(CLASS_NAME_SHOW);
this._element.setAttribute('aria-expanded', 'false'); this._element.setAttribute('aria-expanded', 'false');
Manipulator.removeDataAttribute(this._menu, 'popper');
Manipulator__default.default.removeDataAttribute(this._menu, 'popper'); EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget);
EventHandler__default.default.trigger(this._element, EVENT_HIDDEN, relatedTarget);
} }
_getConfig(config) { _getConfig(config) {
config = { ...this.constructor.Default, config = super._getConfig(config);
...Manipulator__default.default.getDataAttributes(this._element), if (typeof config.reference === 'object' && !index_js.isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
...config
};
typeCheckConfig(NAME, config, this.constructor.DefaultType);
if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
// Popper virtual elements require a getBoundingClientRect method // Popper virtual elements require a getBoundingClientRect method
throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
} }
return config; return config;
} }
_createPopper() {
_createPopper(parent) {
if (typeof Popper__namespace === 'undefined') { if (typeof Popper__namespace === 'undefined') {
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
} }
let referenceElement = this._element; let referenceElement = this._element;
if (this._config.reference === 'parent') { if (this._config.reference === 'parent') {
referenceElement = parent; referenceElement = this._parent;
} else if (isElement(this._config.reference)) { } else if (index_js.isElement(this._config.reference)) {
referenceElement = getElement(this._config.reference); referenceElement = index_js.getElement(this._config.reference);
} else if (typeof this._config.reference === 'object') { } else if (typeof this._config.reference === 'object') {
referenceElement = this._config.reference; referenceElement = this._config.reference;
} }
const popperConfig = this._getPopperConfig(); 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); this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
if (isDisplayStatic) {
Manipulator__default.default.setDataAttribute(this._menu, 'popper', 'static');
}
} }
_isShown() {
_isShown(element = this._element) { return this._menu.classList.contains(CLASS_NAME_SHOW);
return element.classList.contains(CLASS_NAME_SHOW);
} }
_getMenuElement() {
return SelectorEngine__default.default.next(this._element, SELECTOR_MENU)[0];
}
_getPlacement() { _getPlacement() {
const parentDropdown = this._element.parentNode; const parentDropdown = this._parent;
if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
return PLACEMENT_RIGHT; return PLACEMENT_RIGHT;
} }
if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
return PLACEMENT_LEFT; 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'; const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
} }
return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
} }
_detectNavbar() { _detectNavbar() {
return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null; return this._element.closest(SELECTOR_NAVBAR) !== null;
} }
_getOffset() { _getOffset() {
const { const {
offset offset
} = this._config; } = this._config;
if (typeof offset === 'string') { 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') { if (typeof offset === 'function') {
return popperData => offset(popperData, this._element); return popperData => offset(popperData, this._element);
} }
return offset; return offset;
} }
_getPopperConfig() { _getPopperConfig() {
const defaultBsPopperConfig = { const defaultBsPopperConfig = {
placement: this._getPlacement(), placement: this._getPlacement(),
@ -514,172 +272,128 @@
offset: this._getOffset() 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 = [{ defaultBsPopperConfig.modifiers = [{
name: 'applyStyles', name: 'applyStyles',
enabled: false enabled: false
}]; }];
} }
return {
return { ...defaultBsPopperConfig, ...defaultBsPopperConfig,
...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig) ...index_js.execute(this._config.popperConfig, [defaultBsPopperConfig])
}; };
} }
_selectMenuItem({ _selectMenuItem({
key, key,
target 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) { if (!items.length) {
return; 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 // 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();
}
// Static
getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();
} // Static
static jQueryInterface(config) { static jQueryInterface(config) {
return this.each(function () { return this.each(function () {
const data = Dropdown.getOrCreateInstance(this, config); const data = Dropdown.getOrCreateInstance(this, config);
if (typeof config !== 'string') { if (typeof config !== 'string') {
return; return;
} }
if (typeof data[config] === 'undefined') { if (typeof data[config] === 'undefined') {
throw new TypeError(`No method named "${config}"`); throw new TypeError(`No method named "${config}"`);
} }
data[config](); data[config]();
}); });
} }
static clearMenus(event) { 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; return;
} }
const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);
const toggles = SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE); for (const toggle of openToggles) {
const context = Dropdown.getInstance(toggle);
for (let i = 0, len = toggles.length; i < len; i++) {
const context = Dropdown.getInstance(toggles[i]);
if (!context || context._config.autoClose === false) { if (!context || context._config.autoClose === false) {
continue; continue;
} }
const composedPath = event.composedPath();
if (!context._isShown()) { const isMenuTarget = composedPath.includes(context._menu);
if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
continue; 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 = { const relatedTarget = {
relatedTarget: context._element relatedTarget: context._element
}; };
if (event.type === 'click') {
if (event) { relatedTarget.clickEvent = 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;
}
} }
context._completeHide(relatedTarget); context._completeHide(relatedTarget);
} }
} }
static getParentFromElement(element) {
return getElementFromSelector(element) || element.parentNode;
}
static dataApiKeydownHandler(event) { static dataApiKeydownHandler(event) {
// If not input/textarea: // If not an UP | DOWN | ESCAPE key => not a dropdown command
// - And not a key in REGEXP_KEYDOWN => not a dropdown command // If input/textarea && if key is other than ESCAPE => not a dropdown command
// If input/textarea:
// - If space key => not a dropdown command const isInput = /input|textarea/i.test(event.target.tagName);
// - If key is other than escape const isEscapeEvent = event.key === ESCAPE_KEY;
// - If key is not up or down => not a dropdown command const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key);
// - If trigger inside the menu => not a dropdown command if (!isUpOrDownEvent && !isEscapeEvent) {
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)) {
return; return;
} }
if (isInput && !isEscapeEvent) {
const isActive = this.classList.contains(CLASS_NAME_SHOW);
if (!isActive && event.key === ESCAPE_KEY) {
return; return;
} }
event.preventDefault(); event.preventDefault();
event.stopPropagation();
if (isDisabled(this)) { // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
return; 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 getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine__default.default.prev(this, SELECTOR_DATA_TOGGLE)[0];
const instance = Dropdown.getOrCreateInstance(getToggleButton); const instance = Dropdown.getOrCreateInstance(getToggleButton);
if (isUpOrDownEvent) {
if (event.key === ESCAPE_KEY) { event.stopPropagation();
instance.hide(); instance.show();
return;
}
if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
if (!isActive) {
instance.show();
}
instance._selectMenuItem(event); instance._selectMenuItem(event);
return; return;
} }
if (instance._isShown()) {
if (!isActive || event.key === SPACE_KEY) { // else is escape and we check if it is shown
Dropdown.clearMenus(); event.stopPropagation();
instance.hide();
getToggleButton.focus();
} }
} }
} }
/** /**
* ------------------------------------------------------------------------ * Data API implementation
* Data Api implementation
* ------------------------------------------------------------------------
*/ */
EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler);
EventHandler__default.default.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler); EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
EventHandler__default.default.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); EventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus);
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus); EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
EventHandler__default.default.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
event.preventDefault(); event.preventDefault();
Dropdown.getOrCreateInstance(this).toggle(); Dropdown.getOrCreateInstance(this).toggle();
}); });
/** /**
* ------------------------------------------------------------------------
* jQuery * jQuery
* ------------------------------------------------------------------------
* add .Dropdown to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(Dropdown); index_js.defineJQueryPlugin(Dropdown);
return Dropdown; return Dropdown;

File diff suppressed because one or more lines are too long

955
js/dist/modal.js vendored

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