browser-extension-manager 1.0.13 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/CLAUDE.md +672 -0
- package/TODO.md +3 -0
- package/dist/assets/css/browser-extension-manager.scss +18 -0
- package/dist/assets/css/components/content/index.scss +5 -0
- package/dist/assets/css/components/options/index.scss +5 -0
- package/dist/assets/css/components/pages/index.scss +5 -0
- package/dist/assets/css/components/popup/index.scss +5 -0
- package/dist/assets/css/core/_animations.scss +64 -0
- package/dist/assets/css/core/_initialize.scss +23 -0
- package/dist/assets/css/core/_utilities.scss +80 -0
- package/dist/assets/themes/_template/_theme.js +5 -0
- package/dist/assets/themes/_template/_theme.scss +5 -0
- package/dist/assets/themes/bootstrap/_theme.js +16 -0
- package/dist/assets/themes/bootstrap/_theme.scss +232 -0
- package/dist/assets/themes/bootstrap/js/index.esm.js +19 -0
- package/dist/assets/themes/bootstrap/js/index.umd.js +34 -0
- package/dist/assets/themes/bootstrap/js/src/alert.js +87 -0
- package/dist/assets/themes/bootstrap/js/src/base-component.js +86 -0
- package/dist/assets/themes/bootstrap/js/src/button.js +72 -0
- package/dist/assets/themes/bootstrap/js/src/carousel.js +474 -0
- package/dist/assets/themes/bootstrap/js/src/collapse.js +297 -0
- package/dist/assets/themes/bootstrap/js/src/dom/data.js +55 -0
- package/dist/assets/themes/bootstrap/js/src/dom/event-handler.js +317 -0
- package/dist/assets/themes/bootstrap/js/src/dom/manipulator.js +71 -0
- package/dist/assets/themes/bootstrap/js/src/dom/selector-engine.js +126 -0
- package/dist/assets/themes/bootstrap/js/src/dropdown.js +458 -0
- package/dist/assets/themes/bootstrap/js/src/modal.js +378 -0
- package/dist/assets/themes/bootstrap/js/src/offcanvas.js +282 -0
- package/dist/assets/themes/bootstrap/js/src/popover.js +97 -0
- package/dist/assets/themes/bootstrap/js/src/scrollspy.js +296 -0
- package/dist/assets/themes/bootstrap/js/src/tab.js +315 -0
- package/dist/assets/themes/bootstrap/js/src/toast.js +224 -0
- package/dist/assets/themes/bootstrap/js/src/tooltip.js +632 -0
- package/dist/assets/themes/bootstrap/js/src/util/backdrop.js +151 -0
- package/dist/assets/themes/bootstrap/js/src/util/component-functions.js +35 -0
- package/dist/assets/themes/bootstrap/js/src/util/config.js +65 -0
- package/dist/assets/themes/bootstrap/js/src/util/focustrap.js +115 -0
- package/dist/assets/themes/bootstrap/js/src/util/index.js +306 -0
- package/dist/assets/themes/bootstrap/js/src/util/sanitizer.js +117 -0
- package/dist/assets/themes/bootstrap/js/src/util/scrollbar.js +114 -0
- package/dist/assets/themes/bootstrap/js/src/util/swipe.js +146 -0
- package/dist/assets/themes/bootstrap/js/src/util/template-factory.js +160 -0
- package/dist/assets/themes/bootstrap/scss/_accordion.scss +153 -0
- package/dist/assets/themes/bootstrap/scss/_alert.scss +68 -0
- package/dist/assets/themes/bootstrap/scss/_badge.scss +38 -0
- package/dist/assets/themes/bootstrap/scss/_breadcrumb.scss +40 -0
- package/dist/assets/themes/bootstrap/scss/_button-group.scss +147 -0
- package/dist/assets/themes/bootstrap/scss/_buttons.scss +216 -0
- package/dist/assets/themes/bootstrap/scss/_card.scss +238 -0
- package/dist/assets/themes/bootstrap/scss/_carousel.scss +226 -0
- package/dist/assets/themes/bootstrap/scss/_close.scss +66 -0
- package/dist/assets/themes/bootstrap/scss/_containers.scss +41 -0
- package/dist/assets/themes/bootstrap/scss/_dropdown.scss +250 -0
- package/dist/assets/themes/bootstrap/scss/_forms.scss +9 -0
- package/dist/assets/themes/bootstrap/scss/_functions.scss +302 -0
- package/dist/assets/themes/bootstrap/scss/_grid.scss +39 -0
- package/dist/assets/themes/bootstrap/scss/_helpers.scss +12 -0
- package/dist/assets/themes/bootstrap/scss/_images.scss +42 -0
- package/dist/assets/themes/bootstrap/scss/_list-group.scss +199 -0
- package/dist/assets/themes/bootstrap/scss/_maps.scss +174 -0
- package/dist/assets/themes/bootstrap/scss/_mixins.scss +42 -0
- package/dist/assets/themes/bootstrap/scss/_modal.scss +240 -0
- package/dist/assets/themes/bootstrap/scss/_nav.scss +197 -0
- package/dist/assets/themes/bootstrap/scss/_navbar.scss +289 -0
- package/dist/assets/themes/bootstrap/scss/_offcanvas.scss +147 -0
- package/dist/assets/themes/bootstrap/scss/_pagination.scss +109 -0
- package/dist/assets/themes/bootstrap/scss/_placeholders.scss +51 -0
- package/dist/assets/themes/bootstrap/scss/_popover.scss +196 -0
- package/dist/assets/themes/bootstrap/scss/_progress.scss +68 -0
- package/dist/assets/themes/bootstrap/scss/_reboot.scss +611 -0
- package/dist/assets/themes/bootstrap/scss/_root.scss +187 -0
- package/dist/assets/themes/bootstrap/scss/_spinners.scss +85 -0
- package/dist/assets/themes/bootstrap/scss/_tables.scss +171 -0
- package/dist/assets/themes/bootstrap/scss/_toasts.scss +73 -0
- package/dist/assets/themes/bootstrap/scss/_tooltip.scss +119 -0
- package/dist/assets/themes/bootstrap/scss/_transitions.scss +27 -0
- package/dist/assets/themes/bootstrap/scss/_type.scss +106 -0
- package/dist/assets/themes/bootstrap/scss/_utilities.scss +806 -0
- package/dist/assets/themes/bootstrap/scss/_variables-dark.scss +102 -0
- package/dist/assets/themes/bootstrap/scss/_variables.scss +1753 -0
- package/dist/assets/themes/bootstrap/scss/bootstrap-grid.scss +62 -0
- package/dist/assets/themes/bootstrap/scss/bootstrap-reboot.scss +10 -0
- package/dist/assets/themes/bootstrap/scss/bootstrap-utilities.scss +19 -0
- package/dist/assets/themes/bootstrap/scss/bootstrap.scss +52 -0
- package/dist/assets/themes/bootstrap/scss/forms/_floating-labels.scss +97 -0
- package/dist/assets/themes/bootstrap/scss/forms/_form-check.scss +189 -0
- package/dist/assets/themes/bootstrap/scss/forms/_form-control.scss +214 -0
- package/dist/assets/themes/bootstrap/scss/forms/_form-range.scss +91 -0
- package/dist/assets/themes/bootstrap/scss/forms/_form-select.scss +80 -0
- package/dist/assets/themes/bootstrap/scss/forms/_form-text.scss +11 -0
- package/dist/assets/themes/bootstrap/scss/forms/_input-group.scss +132 -0
- package/dist/assets/themes/bootstrap/scss/forms/_labels.scss +36 -0
- package/dist/assets/themes/bootstrap/scss/forms/_validation.scss +12 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_clearfix.scss +3 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_color-bg.scss +7 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_colored-links.scss +30 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_focus-ring.scss +5 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_icon-link.scss +25 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_position.scss +36 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_ratio.scss +26 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_stacks.scss +15 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_stretched-link.scss +15 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_text-truncation.scss +7 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
- package/dist/assets/themes/bootstrap/scss/helpers/_vr.scss +8 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_alert.scss +18 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_backdrop.scss +14 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_banner.scss +7 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_border-radius.scss +78 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_box-shadow.scss +18 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_breakpoints.scss +127 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_buttons.scss +70 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_caret.scss +69 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_clearfix.scss +9 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_color-mode.scss +21 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_color-scheme.scss +7 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_container.scss +11 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_deprecate.scss +10 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_forms.scss +163 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_gradients.scss +47 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_grid.scss +151 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_image.scss +16 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_list-group.scss +26 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_lists.scss +7 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_pagination.scss +10 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_reset-text.scss +17 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_resize.scss +6 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_table-variants.scss +24 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_text-truncate.scss +8 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_transition.scss +26 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_utilities.scss +97 -0
- package/dist/assets/themes/bootstrap/scss/mixins/_visually-hidden.scss +38 -0
- package/dist/assets/themes/bootstrap/scss/tests/jasmine.js +16 -0
- package/dist/assets/themes/bootstrap/scss/tests/mixins/_auto-import-of-variables-dark.test.scss +7 -0
- package/dist/assets/themes/bootstrap/scss/tests/mixins/_color-modes.test.scss +69 -0
- package/dist/assets/themes/bootstrap/scss/tests/mixins/_media-query-color-mode-full.test.scss +8 -0
- package/dist/assets/themes/bootstrap/scss/tests/mixins/_utilities.test.scss +393 -0
- package/dist/assets/themes/bootstrap/scss/tests/sass-true/register.js +14 -0
- package/dist/assets/themes/bootstrap/scss/tests/sass-true/runner.js +17 -0
- package/dist/assets/themes/bootstrap/scss/tests/utilities/_api.test.scss +75 -0
- package/dist/assets/themes/bootstrap/scss/utilities/_api.scss +47 -0
- package/dist/assets/themes/bootstrap/scss/vendor/_rfs.scss +348 -0
- package/dist/assets/themes/classy/README.md +75 -0
- package/dist/assets/themes/classy/_config.scss +185 -0
- package/dist/assets/themes/classy/_theme.js +29 -0
- package/dist/assets/themes/classy/_theme.scss +34 -0
- package/dist/assets/themes/classy/css/base/_animations.scss +27 -0
- package/dist/assets/themes/classy/css/base/_backgrounds.scss +191 -0
- package/dist/assets/themes/classy/css/base/_borders.scss +65 -0
- package/dist/assets/themes/classy/css/base/_root.scss +58 -0
- package/dist/assets/themes/classy/css/base/_soft-colors.scss +92 -0
- package/dist/assets/themes/classy/css/base/_spacing.scss +64 -0
- package/dist/assets/themes/classy/css/base/_typography.scss +179 -0
- package/dist/assets/themes/classy/css/base/_utilities.scss +77 -0
- package/dist/assets/themes/classy/css/components/_accordion.scss +33 -0
- package/dist/assets/themes/classy/css/components/_avatars.scss +32 -0
- package/dist/assets/themes/classy/css/components/_badges.scss +25 -0
- package/dist/assets/themes/classy/css/components/_buttons.scss +397 -0
- package/dist/assets/themes/classy/css/components/_cards.scss +33 -0
- package/dist/assets/themes/classy/css/components/_carousel.scss +41 -0
- package/dist/assets/themes/classy/css/components/_forms.scss +115 -0
- package/dist/assets/themes/classy/css/components/_links.scss +19 -0
- package/dist/assets/themes/classy/css/components/_logo-scroll.scss +57 -0
- package/dist/assets/themes/classy/css/components/_spinners.scss +19 -0
- package/dist/assets/themes/classy/css/components/_text.scss +41 -0
- package/dist/assets/themes/classy/css/layout/_blog.scss +42 -0
- package/dist/assets/themes/classy/css/layout/_general.scss +139 -0
- package/dist/assets/themes/classy/css/layout/_navigation.scss +576 -0
- package/dist/assets/themes/classy/css/layout/_team.scss +18 -0
- package/dist/assets/themes/classy/js/logo-scroll.js +83 -0
- package/dist/assets/themes/classy/js/navbar-scroll.js +65 -0
- package/dist/background.js +236 -260
- package/dist/build.js +93 -4
- package/dist/commands/setup.js +0 -268
- package/dist/config/manifest.json +11 -3
- package/dist/config/page-template.html +21 -0
- package/dist/defaults/.nvmrc +1 -1
- package/dist/defaults/CLAUDE.md +8 -0
- package/dist/defaults/config/browser-extension-manager.json +37 -0
- package/dist/defaults/src/assets/css/components/content/index.scss +11 -0
- package/dist/defaults/src/assets/css/components/options/index.scss +14 -0
- package/dist/defaults/src/assets/css/components/pages/index.scss +10 -0
- package/dist/defaults/src/assets/css/components/popup/index.scss +10 -0
- package/dist/defaults/src/assets/css/components/sidepanel/index.scss +6 -0
- package/dist/defaults/src/assets/css/main.scss +32 -0
- package/dist/defaults/src/assets/js/components/background/index.js +22 -0
- package/dist/defaults/src/assets/js/components/content/index.js +22 -0
- package/dist/defaults/src/assets/js/components/options/index.js +22 -0
- package/dist/defaults/src/assets/js/components/pages/index.js +22 -0
- package/dist/defaults/src/assets/js/components/popup/index.js +22 -0
- package/dist/defaults/src/assets/js/components/sidepanel/index.js +20 -0
- package/dist/defaults/src/assets/vendor/.gitkeep +0 -0
- package/dist/defaults/src/manifest.json +11 -6
- package/dist/defaults/src/views/options/index.html +8 -0
- package/dist/defaults/src/views/pages/index.html +10 -0
- package/dist/defaults/src/views/popup/index.html +4 -0
- package/dist/defaults/src/views/sidepanel/index.html +4 -0
- package/dist/gulp/main.js +11 -5
- package/dist/gulp/plugins/webpack/strip-dev-blocks.js +53 -0
- package/dist/gulp/tasks/{_package.js → BU/_package.js} +1 -1
- package/dist/gulp/tasks/{developmentRebuild.js → BU/developmentRebuild.js} +1 -1
- package/dist/gulp/tasks/{themes.js → BU/themes.js} +3 -2
- package/dist/gulp/tasks/{test.js → _.js} +3 -3
- package/dist/gulp/tasks/audit.js +154 -0
- package/dist/gulp/tasks/defaults.js +308 -0
- package/dist/gulp/tasks/distribute.js +87 -92
- package/dist/gulp/tasks/html.js +150 -0
- package/dist/gulp/tasks/icons.js +3 -2
- package/dist/gulp/tasks/package.js +216 -27
- package/dist/gulp/tasks/sass.js +188 -43
- package/dist/gulp/tasks/serve.js +1 -0
- package/dist/gulp/tasks/utils/template-transform.js +50 -0
- package/dist/gulp/tasks/webpack.js +338 -134
- package/dist/index.js +34 -34
- package/dist/options.js +40 -0
- package/dist/page.js +40 -0
- package/dist/popup.js +40 -0
- package/dist/sidepanel.js +40 -0
- package/firebase-debug.log +322 -0
- package/package.json +25 -18
- package/dist/assets/css/main.scss +0 -3
- package/dist/assets/themes/bootstrap/5.3.3/css/bootstrap.css +0 -12057
- package/dist/assets/themes/bootstrap/5.3.3/css/bootstrap.css.map +0 -1
- package/dist/assets/themes/bootstrap/5.3.3/js/bootstrap.bundle.js +0 -6314
- package/dist/assets/themes/bootstrap/5.3.3/js/bootstrap.bundle.js.map +0 -1
- package/dist/assets/themes/bootstrap/5.3.3/js/bootstrap.js +0 -4494
- package/dist/assets/themes/bootstrap/5.3.3/js/bootstrap.js.map +0 -1
- package/dist/defaults/src/assets/css/content.scss +0 -2
- package/dist/defaults/src/assets/css/options.scss +0 -11
- package/dist/defaults/src/assets/css/popup.scss +0 -14
- package/dist/defaults/src/assets/js/background.js +0 -18
- package/dist/defaults/src/assets/js/content.js +0 -15
- package/dist/defaults/src/assets/js/options.js +0 -17
- package/dist/defaults/src/assets/js/popup.js +0 -17
- package/dist/defaults/src/pages/options.html +0 -26
- package/dist/defaults/src/pages/popup.html +0 -26
- /package/dist/{defaults/src/assets/images/_ → assets/css/bundles/.gitkeep} +0 -0
- /package/dist/assets/css/{fontawesome.scss → core/_fontawesome.scss} +0 -0
- /package/dist/defaults/src/assets/{vendor/_ → images/.gitkeep} +0 -0
- /package/dist/gulp/tasks/{_importer.js → BU/_importer.js} +0 -0
- /package/dist/gulp/tasks/{_vendor.js → BU/_vendor.js} +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap util/sanitizer.js
|
|
4
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// js-docs-start allow-list
|
|
9
|
+
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
|
|
10
|
+
|
|
11
|
+
export const DefaultAllowlist = {
|
|
12
|
+
// Global attributes allowed on any supplied element below.
|
|
13
|
+
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
|
14
|
+
a: ['target', 'href', 'title', 'rel'],
|
|
15
|
+
area: [],
|
|
16
|
+
b: [],
|
|
17
|
+
br: [],
|
|
18
|
+
col: [],
|
|
19
|
+
code: [],
|
|
20
|
+
dd: [],
|
|
21
|
+
div: [],
|
|
22
|
+
dl: [],
|
|
23
|
+
dt: [],
|
|
24
|
+
em: [],
|
|
25
|
+
hr: [],
|
|
26
|
+
h1: [],
|
|
27
|
+
h2: [],
|
|
28
|
+
h3: [],
|
|
29
|
+
h4: [],
|
|
30
|
+
h5: [],
|
|
31
|
+
h6: [],
|
|
32
|
+
i: [],
|
|
33
|
+
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
|
|
34
|
+
li: [],
|
|
35
|
+
ol: [],
|
|
36
|
+
p: [],
|
|
37
|
+
pre: [],
|
|
38
|
+
s: [],
|
|
39
|
+
small: [],
|
|
40
|
+
span: [],
|
|
41
|
+
sub: [],
|
|
42
|
+
sup: [],
|
|
43
|
+
strong: [],
|
|
44
|
+
u: [],
|
|
45
|
+
ul: []
|
|
46
|
+
}
|
|
47
|
+
// js-docs-end allow-list
|
|
48
|
+
|
|
49
|
+
const uriAttributes = new Set([
|
|
50
|
+
'background',
|
|
51
|
+
'cite',
|
|
52
|
+
'href',
|
|
53
|
+
'itemtype',
|
|
54
|
+
'longdesc',
|
|
55
|
+
'poster',
|
|
56
|
+
'src',
|
|
57
|
+
'xlink:href'
|
|
58
|
+
])
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
|
|
62
|
+
* contexts.
|
|
63
|
+
*
|
|
64
|
+
* Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
|
|
65
|
+
*/
|
|
66
|
+
// eslint-disable-next-line unicorn/better-regex
|
|
67
|
+
const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i
|
|
68
|
+
|
|
69
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
70
|
+
const attributeName = attribute.nodeName.toLowerCase()
|
|
71
|
+
|
|
72
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
73
|
+
if (uriAttributes.has(attributeName)) {
|
|
74
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue))
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return true
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Check if a regular expression validates the attribute.
|
|
81
|
+
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)
|
|
82
|
+
.some(regex => regex.test(attributeName))
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
|
86
|
+
if (!unsafeHtml.length) {
|
|
87
|
+
return unsafeHtml
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (sanitizeFunction && typeof sanitizeFunction === 'function') {
|
|
91
|
+
return sanitizeFunction(unsafeHtml)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const domParser = new window.DOMParser()
|
|
95
|
+
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')
|
|
96
|
+
const elements = [].concat(...createdDocument.body.querySelectorAll('*'))
|
|
97
|
+
|
|
98
|
+
for (const element of elements) {
|
|
99
|
+
const elementName = element.nodeName.toLowerCase()
|
|
100
|
+
|
|
101
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
|
102
|
+
element.remove()
|
|
103
|
+
continue
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const attributeList = [].concat(...element.attributes)
|
|
107
|
+
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || [])
|
|
108
|
+
|
|
109
|
+
for (const attribute of attributeList) {
|
|
110
|
+
if (!allowedAttribute(attribute, allowedAttributes)) {
|
|
111
|
+
element.removeAttribute(attribute.nodeName)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return createdDocument.body.innerHTML
|
|
117
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap util/scrollBar.js
|
|
4
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Manipulator from '../dom/manipulator.js'
|
|
9
|
+
import SelectorEngine from '../dom/selector-engine.js'
|
|
10
|
+
import { isElement } from './index.js'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Constants
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'
|
|
17
|
+
const SELECTOR_STICKY_CONTENT = '.sticky-top'
|
|
18
|
+
const PROPERTY_PADDING = 'padding-right'
|
|
19
|
+
const PROPERTY_MARGIN = 'margin-right'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Class definition
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
class ScrollBarHelper {
|
|
26
|
+
constructor() {
|
|
27
|
+
this._element = document.body
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Public
|
|
31
|
+
getWidth() {
|
|
32
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
|
33
|
+
const documentWidth = document.documentElement.clientWidth
|
|
34
|
+
return Math.abs(window.innerWidth - documentWidth)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
hide() {
|
|
38
|
+
const width = this.getWidth()
|
|
39
|
+
this._disableOverFlow()
|
|
40
|
+
// give padding to element to balance the hidden scrollbar width
|
|
41
|
+
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width)
|
|
42
|
+
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
|
43
|
+
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width)
|
|
44
|
+
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
reset() {
|
|
48
|
+
this._resetElementAttributes(this._element, 'overflow')
|
|
49
|
+
this._resetElementAttributes(this._element, PROPERTY_PADDING)
|
|
50
|
+
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING)
|
|
51
|
+
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
isOverflowing() {
|
|
55
|
+
return this.getWidth() > 0
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Private
|
|
59
|
+
_disableOverFlow() {
|
|
60
|
+
this._saveInitialAttribute(this._element, 'overflow')
|
|
61
|
+
this._element.style.overflow = 'hidden'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
_setElementAttributes(selector, styleProperty, callback) {
|
|
65
|
+
const scrollbarWidth = this.getWidth()
|
|
66
|
+
const manipulationCallBack = element => {
|
|
67
|
+
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
this._saveInitialAttribute(element, styleProperty)
|
|
72
|
+
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty)
|
|
73
|
+
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
this._applyManipulationCallback(selector, manipulationCallBack)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
_saveInitialAttribute(element, styleProperty) {
|
|
80
|
+
const actualValue = element.style.getPropertyValue(styleProperty)
|
|
81
|
+
if (actualValue) {
|
|
82
|
+
Manipulator.setDataAttribute(element, styleProperty, actualValue)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
_resetElementAttributes(selector, styleProperty) {
|
|
87
|
+
const manipulationCallBack = element => {
|
|
88
|
+
const value = Manipulator.getDataAttribute(element, styleProperty)
|
|
89
|
+
// We only want to remove the property if the value is `null`; the value can also be zero
|
|
90
|
+
if (value === null) {
|
|
91
|
+
element.style.removeProperty(styleProperty)
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
Manipulator.removeDataAttribute(element, styleProperty)
|
|
96
|
+
element.style.setProperty(styleProperty, value)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
this._applyManipulationCallback(selector, manipulationCallBack)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
_applyManipulationCallback(selector, callBack) {
|
|
103
|
+
if (isElement(selector)) {
|
|
104
|
+
callBack(selector)
|
|
105
|
+
return
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
for (const sel of SelectorEngine.find(selector, this._element)) {
|
|
109
|
+
callBack(sel)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default ScrollBarHelper
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap util/swipe.js
|
|
4
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import EventHandler from '../dom/event-handler.js'
|
|
9
|
+
import Config from './config.js'
|
|
10
|
+
import { execute } from './index.js'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Constants
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const NAME = 'swipe'
|
|
17
|
+
const EVENT_KEY = '.bs.swipe'
|
|
18
|
+
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`
|
|
19
|
+
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`
|
|
20
|
+
const EVENT_TOUCHEND = `touchend${EVENT_KEY}`
|
|
21
|
+
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`
|
|
22
|
+
const EVENT_POINTERUP = `pointerup${EVENT_KEY}`
|
|
23
|
+
const POINTER_TYPE_TOUCH = 'touch'
|
|
24
|
+
const POINTER_TYPE_PEN = 'pen'
|
|
25
|
+
const CLASS_NAME_POINTER_EVENT = 'pointer-event'
|
|
26
|
+
const SWIPE_THRESHOLD = 40
|
|
27
|
+
|
|
28
|
+
const Default = {
|
|
29
|
+
endCallback: null,
|
|
30
|
+
leftCallback: null,
|
|
31
|
+
rightCallback: null
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const DefaultType = {
|
|
35
|
+
endCallback: '(function|null)',
|
|
36
|
+
leftCallback: '(function|null)',
|
|
37
|
+
rightCallback: '(function|null)'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Class definition
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
class Swipe extends Config {
|
|
45
|
+
constructor(element, config) {
|
|
46
|
+
super()
|
|
47
|
+
this._element = element
|
|
48
|
+
|
|
49
|
+
if (!element || !Swipe.isSupported()) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
this._config = this._getConfig(config)
|
|
54
|
+
this._deltaX = 0
|
|
55
|
+
this._supportPointerEvents = Boolean(window.PointerEvent)
|
|
56
|
+
this._initEvents()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Getters
|
|
60
|
+
static get Default() {
|
|
61
|
+
return Default
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static get DefaultType() {
|
|
65
|
+
return DefaultType
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static get NAME() {
|
|
69
|
+
return NAME
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Public
|
|
73
|
+
dispose() {
|
|
74
|
+
EventHandler.off(this._element, EVENT_KEY)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Private
|
|
78
|
+
_start(event) {
|
|
79
|
+
if (!this._supportPointerEvents) {
|
|
80
|
+
this._deltaX = event.touches[0].clientX
|
|
81
|
+
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (this._eventIsPointerPenTouch(event)) {
|
|
86
|
+
this._deltaX = event.clientX
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
_end(event) {
|
|
91
|
+
if (this._eventIsPointerPenTouch(event)) {
|
|
92
|
+
this._deltaX = event.clientX - this._deltaX
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
this._handleSwipe()
|
|
96
|
+
execute(this._config.endCallback)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_move(event) {
|
|
100
|
+
this._deltaX = event.touches && event.touches.length > 1 ?
|
|
101
|
+
0 :
|
|
102
|
+
event.touches[0].clientX - this._deltaX
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
_handleSwipe() {
|
|
106
|
+
const absDeltaX = Math.abs(this._deltaX)
|
|
107
|
+
|
|
108
|
+
if (absDeltaX <= SWIPE_THRESHOLD) {
|
|
109
|
+
return
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const direction = absDeltaX / this._deltaX
|
|
113
|
+
|
|
114
|
+
this._deltaX = 0
|
|
115
|
+
|
|
116
|
+
if (!direction) {
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
_initEvents() {
|
|
124
|
+
if (this._supportPointerEvents) {
|
|
125
|
+
EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event))
|
|
126
|
+
EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event))
|
|
127
|
+
|
|
128
|
+
this._element.classList.add(CLASS_NAME_POINTER_EVENT)
|
|
129
|
+
} else {
|
|
130
|
+
EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event))
|
|
131
|
+
EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event))
|
|
132
|
+
EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event))
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
_eventIsPointerPenTouch(event) {
|
|
137
|
+
return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Static
|
|
141
|
+
static isSupported() {
|
|
142
|
+
return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export default Swipe
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap util/template-factory.js
|
|
4
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import SelectorEngine from '../dom/selector-engine.js'
|
|
9
|
+
import Config from './config.js'
|
|
10
|
+
import { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'
|
|
11
|
+
import { execute, getElement, isElement } from './index.js'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Constants
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const NAME = 'TemplateFactory'
|
|
18
|
+
|
|
19
|
+
const Default = {
|
|
20
|
+
allowList: DefaultAllowlist,
|
|
21
|
+
content: {}, // { selector : text , selector2 : text2 , }
|
|
22
|
+
extraClass: '',
|
|
23
|
+
html: false,
|
|
24
|
+
sanitize: true,
|
|
25
|
+
sanitizeFn: null,
|
|
26
|
+
template: '<div></div>'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const DefaultType = {
|
|
30
|
+
allowList: 'object',
|
|
31
|
+
content: 'object',
|
|
32
|
+
extraClass: '(string|function)',
|
|
33
|
+
html: 'boolean',
|
|
34
|
+
sanitize: 'boolean',
|
|
35
|
+
sanitizeFn: '(null|function)',
|
|
36
|
+
template: 'string'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const DefaultContentType = {
|
|
40
|
+
entry: '(string|element|function|null)',
|
|
41
|
+
selector: '(string|element)'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Class definition
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
class TemplateFactory extends Config {
|
|
49
|
+
constructor(config) {
|
|
50
|
+
super()
|
|
51
|
+
this._config = this._getConfig(config)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Getters
|
|
55
|
+
static get Default() {
|
|
56
|
+
return Default
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static get DefaultType() {
|
|
60
|
+
return DefaultType
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static get NAME() {
|
|
64
|
+
return NAME
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Public
|
|
68
|
+
getContent() {
|
|
69
|
+
return Object.values(this._config.content)
|
|
70
|
+
.map(config => this._resolvePossibleFunction(config))
|
|
71
|
+
.filter(Boolean)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
hasContent() {
|
|
75
|
+
return this.getContent().length > 0
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
changeContent(content) {
|
|
79
|
+
this._checkContent(content)
|
|
80
|
+
this._config.content = { ...this._config.content, ...content }
|
|
81
|
+
return this
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
toHtml() {
|
|
85
|
+
const templateWrapper = document.createElement('div')
|
|
86
|
+
templateWrapper.innerHTML = this._maybeSanitize(this._config.template)
|
|
87
|
+
|
|
88
|
+
for (const [selector, text] of Object.entries(this._config.content)) {
|
|
89
|
+
this._setContent(templateWrapper, text, selector)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const template = templateWrapper.children[0]
|
|
93
|
+
const extraClass = this._resolvePossibleFunction(this._config.extraClass)
|
|
94
|
+
|
|
95
|
+
if (extraClass) {
|
|
96
|
+
template.classList.add(...extraClass.split(' '))
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return template
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Private
|
|
103
|
+
_typeCheckConfig(config) {
|
|
104
|
+
super._typeCheckConfig(config)
|
|
105
|
+
this._checkContent(config.content)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
_checkContent(arg) {
|
|
109
|
+
for (const [selector, content] of Object.entries(arg)) {
|
|
110
|
+
super._typeCheckConfig({ selector, entry: content }, DefaultContentType)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
_setContent(template, content, selector) {
|
|
115
|
+
const templateElement = SelectorEngine.findOne(selector, template)
|
|
116
|
+
|
|
117
|
+
if (!templateElement) {
|
|
118
|
+
return
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
content = this._resolvePossibleFunction(content)
|
|
122
|
+
|
|
123
|
+
if (!content) {
|
|
124
|
+
templateElement.remove()
|
|
125
|
+
return
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (isElement(content)) {
|
|
129
|
+
this._putElementInTemplate(getElement(content), templateElement)
|
|
130
|
+
return
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (this._config.html) {
|
|
134
|
+
templateElement.innerHTML = this._maybeSanitize(content)
|
|
135
|
+
return
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
templateElement.textContent = content
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
_maybeSanitize(arg) {
|
|
142
|
+
return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
_resolvePossibleFunction(arg) {
|
|
146
|
+
return execute(arg, [undefined, this])
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
_putElementInTemplate(element, templateElement) {
|
|
150
|
+
if (this._config.html) {
|
|
151
|
+
templateElement.innerHTML = ''
|
|
152
|
+
templateElement.append(element)
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
templateElement.textContent = element.textContent
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export default TemplateFactory
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Base styles
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
.accordion {
|
|
6
|
+
// scss-docs-start accordion-css-vars
|
|
7
|
+
--#{$prefix}accordion-color: #{$accordion-color};
|
|
8
|
+
--#{$prefix}accordion-bg: #{$accordion-bg};
|
|
9
|
+
--#{$prefix}accordion-transition: #{$accordion-transition};
|
|
10
|
+
--#{$prefix}accordion-border-color: #{$accordion-border-color};
|
|
11
|
+
--#{$prefix}accordion-border-width: #{$accordion-border-width};
|
|
12
|
+
--#{$prefix}accordion-border-radius: #{$accordion-border-radius};
|
|
13
|
+
--#{$prefix}accordion-inner-border-radius: #{$accordion-inner-border-radius};
|
|
14
|
+
--#{$prefix}accordion-btn-padding-x: #{$accordion-button-padding-x};
|
|
15
|
+
--#{$prefix}accordion-btn-padding-y: #{$accordion-button-padding-y};
|
|
16
|
+
--#{$prefix}accordion-btn-color: #{$accordion-button-color};
|
|
17
|
+
--#{$prefix}accordion-btn-bg: #{$accordion-button-bg};
|
|
18
|
+
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon)};
|
|
19
|
+
--#{$prefix}accordion-btn-icon-width: #{$accordion-icon-width};
|
|
20
|
+
--#{$prefix}accordion-btn-icon-transform: #{$accordion-icon-transform};
|
|
21
|
+
--#{$prefix}accordion-btn-icon-transition: #{$accordion-icon-transition};
|
|
22
|
+
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon)};
|
|
23
|
+
--#{$prefix}accordion-btn-focus-box-shadow: #{$accordion-button-focus-box-shadow};
|
|
24
|
+
--#{$prefix}accordion-body-padding-x: #{$accordion-body-padding-x};
|
|
25
|
+
--#{$prefix}accordion-body-padding-y: #{$accordion-body-padding-y};
|
|
26
|
+
--#{$prefix}accordion-active-color: #{$accordion-button-active-color};
|
|
27
|
+
--#{$prefix}accordion-active-bg: #{$accordion-button-active-bg};
|
|
28
|
+
// scss-docs-end accordion-css-vars
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.accordion-button {
|
|
32
|
+
position: relative;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
width: 100%;
|
|
36
|
+
padding: var(--#{$prefix}accordion-btn-padding-y) var(--#{$prefix}accordion-btn-padding-x);
|
|
37
|
+
@include font-size($font-size-base);
|
|
38
|
+
color: var(--#{$prefix}accordion-btn-color);
|
|
39
|
+
text-align: left; // Reset button style
|
|
40
|
+
background-color: var(--#{$prefix}accordion-btn-bg);
|
|
41
|
+
border: 0;
|
|
42
|
+
@include border-radius(0);
|
|
43
|
+
overflow-anchor: none;
|
|
44
|
+
@include transition(var(--#{$prefix}accordion-transition));
|
|
45
|
+
|
|
46
|
+
&:not(.collapsed) {
|
|
47
|
+
color: var(--#{$prefix}accordion-active-color);
|
|
48
|
+
background-color: var(--#{$prefix}accordion-active-bg);
|
|
49
|
+
box-shadow: inset 0 calc(-1 * var(--#{$prefix}accordion-border-width)) 0 var(--#{$prefix}accordion-border-color); // stylelint-disable-line function-disallowed-list
|
|
50
|
+
|
|
51
|
+
&::after {
|
|
52
|
+
background-image: var(--#{$prefix}accordion-btn-active-icon);
|
|
53
|
+
transform: var(--#{$prefix}accordion-btn-icon-transform);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Accordion icon
|
|
58
|
+
&::after {
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
width: var(--#{$prefix}accordion-btn-icon-width);
|
|
61
|
+
height: var(--#{$prefix}accordion-btn-icon-width);
|
|
62
|
+
margin-left: auto;
|
|
63
|
+
content: "";
|
|
64
|
+
background-image: var(--#{$prefix}accordion-btn-icon);
|
|
65
|
+
background-repeat: no-repeat;
|
|
66
|
+
background-size: var(--#{$prefix}accordion-btn-icon-width);
|
|
67
|
+
@include transition(var(--#{$prefix}accordion-btn-icon-transition));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
z-index: 2;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:focus {
|
|
75
|
+
z-index: 3;
|
|
76
|
+
outline: 0;
|
|
77
|
+
box-shadow: var(--#{$prefix}accordion-btn-focus-box-shadow);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.accordion-header {
|
|
82
|
+
margin-bottom: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.accordion-item {
|
|
86
|
+
color: var(--#{$prefix}accordion-color);
|
|
87
|
+
background-color: var(--#{$prefix}accordion-bg);
|
|
88
|
+
border: var(--#{$prefix}accordion-border-width) solid var(--#{$prefix}accordion-border-color);
|
|
89
|
+
|
|
90
|
+
&:first-of-type {
|
|
91
|
+
@include border-top-radius(var(--#{$prefix}accordion-border-radius));
|
|
92
|
+
|
|
93
|
+
> .accordion-header .accordion-button {
|
|
94
|
+
@include border-top-radius(var(--#{$prefix}accordion-inner-border-radius));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:not(:first-of-type) {
|
|
99
|
+
border-top: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Only set a border-radius on the last item if the accordion is collapsed
|
|
103
|
+
&:last-of-type {
|
|
104
|
+
@include border-bottom-radius(var(--#{$prefix}accordion-border-radius));
|
|
105
|
+
|
|
106
|
+
> .accordion-header .accordion-button {
|
|
107
|
+
&.collapsed {
|
|
108
|
+
@include border-bottom-radius(var(--#{$prefix}accordion-inner-border-radius));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
> .accordion-collapse {
|
|
113
|
+
@include border-bottom-radius(var(--#{$prefix}accordion-border-radius));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.accordion-body {
|
|
119
|
+
padding: var(--#{$prefix}accordion-body-padding-y) var(--#{$prefix}accordion-body-padding-x);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
// Flush accordion items
|
|
124
|
+
//
|
|
125
|
+
// Remove borders and border-radius to keep accordion items edge-to-edge.
|
|
126
|
+
|
|
127
|
+
.accordion-flush {
|
|
128
|
+
> .accordion-item {
|
|
129
|
+
border-right: 0;
|
|
130
|
+
border-left: 0;
|
|
131
|
+
@include border-radius(0);
|
|
132
|
+
|
|
133
|
+
&:first-child { border-top: 0; }
|
|
134
|
+
&:last-child { border-bottom: 0; }
|
|
135
|
+
|
|
136
|
+
// stylelint-disable selector-max-class
|
|
137
|
+
> .accordion-collapse,
|
|
138
|
+
> .accordion-header .accordion-button,
|
|
139
|
+
> .accordion-header .accordion-button.collapsed {
|
|
140
|
+
@include border-radius(0);
|
|
141
|
+
}
|
|
142
|
+
// stylelint-enable selector-max-class
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@if $enable-dark-mode {
|
|
147
|
+
@include color-mode(dark) {
|
|
148
|
+
.accordion-button::after {
|
|
149
|
+
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon-dark)};
|
|
150
|
+
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon-dark)};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|