@vonage/vivid 5.4.0 → 5.6.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/LICENSE.md +201 -0
- package/accordion/definition.cjs +5 -0
- package/accordion/definition.js +5 -0
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +14 -3
- package/alert/definition.cjs +4 -12
- package/alert/definition.js +5 -13
- package/alert/index.cjs +11 -11
- package/alert/index.js +33 -37
- package/audio-player/definition.cjs +4 -0
- package/audio-player/definition.js +4 -0
- package/audio-player/index.cjs +1 -1
- package/audio-player/index.js +8 -2
- package/banner/definition.cjs +2 -4
- package/banner/definition.js +2 -4
- package/banner/index.cjs +2 -2
- package/banner/index.js +1 -1
- package/breadcrumb/definition.cjs +1 -0
- package/breadcrumb/definition.js +1 -0
- package/breadcrumb/index.cjs +1 -1
- package/breadcrumb/index.js +1 -0
- package/bundled/affix.js +1 -1
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +3 -1
- package/bundled/base-color-picker.cjs +18 -13
- package/bundled/base-color-picker.js +107 -84
- package/bundled/base-progress.cjs +1 -1
- package/bundled/base-progress.js +3 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +14 -10
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +4 -2
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/definition10.cjs +7 -7
- package/bundled/definition10.js +29 -19
- package/bundled/definition11.cjs +12 -19
- package/bundled/definition11.js +73 -204
- package/bundled/definition12.cjs +19 -10
- package/bundled/definition12.js +218 -36
- package/bundled/definition13.cjs +10 -1
- package/bundled/definition13.js +38 -14
- package/bundled/definition14.cjs +1 -5
- package/bundled/definition14.js +15 -24
- package/bundled/definition15.cjs +5 -30
- package/bundled/definition15.js +22 -73
- package/bundled/definition16.cjs +30 -19
- package/bundled/definition16.js +74 -97
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +86 -117
- package/bundled/definition18.cjs +13 -12
- package/bundled/definition18.js +125 -71
- package/bundled/definition19.cjs +16 -16
- package/bundled/definition19.js +132 -94
- package/bundled/definition2.cjs +8 -9
- package/bundled/definition2.js +89 -142
- package/bundled/definition22.cjs +1 -1
- package/bundled/definition22.js +1 -0
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +2 -1
- package/bundled/definition5.cjs +1 -1
- package/bundled/definition5.js +9 -3
- package/bundled/definition6.cjs +1 -1
- package/bundled/definition6.js +1 -0
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +7 -4
- package/bundled/definition8.cjs +1 -1
- package/bundled/definition8.js +1 -0
- package/bundled/definition9.cjs +6 -6
- package/bundled/definition9.js +545 -488
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +3 -1
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +11 -3
- package/bundled/host-semantics.js +4 -4
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +22 -4
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +149 -66
- package/bundled/mixins.cjs +4 -4
- package/bundled/mixins.js +11 -8
- package/bundled/picker-field.template.cjs +14 -14
- package/bundled/picker-field.template.js +36 -56
- package/bundled/scrollIntoView.cjs +1 -1
- package/bundled/scrollIntoView.js +4 -1
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +12 -12
- package/bundled/time-selection-picker.template.js +16 -12
- package/bundled/trapped-focus.cjs +1 -0
- package/bundled/trapped-focus.js +26 -0
- package/bundled/vivid-element.cjs +4 -4
- package/bundled/vivid-element.js +529 -492
- package/calendar/definition.cjs +2 -0
- package/calendar/definition.js +2 -0
- package/calendar/index.cjs +13 -13
- package/calendar/index.js +174 -144
- package/checkbox/definition.cjs +1 -0
- package/checkbox/definition.js +1 -0
- package/color-picker/definition.cjs +213 -112
- package/color-picker/definition.js +213 -112
- package/color-picker/index.cjs +104 -75
- package/color-picker/index.js +417 -326
- package/combobox/definition.cjs +17 -6
- package/combobox/definition.js +17 -6
- package/combobox/index.cjs +14 -9
- package/combobox/index.js +54 -42
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +6976 -484
- package/data-grid/definition.cjs +105 -7
- package/data-grid/definition.js +105 -7
- package/data-grid/index.cjs +52 -38
- package/data-grid/index.js +313 -242
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/definition.cjs +2 -0
- package/date-range-picker/definition.js +2 -0
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +7 -3
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +148 -0
- package/dial-pad/definition.js +148 -0
- package/dial-pad/index.cjs +27 -20
- package/dial-pad/index.js +202 -101
- package/dialog/definition.cjs +1 -0
- package/dialog/definition.js +1 -0
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -0
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/fab/definition.cjs +1 -0
- package/fab/definition.js +1 -0
- package/fab/index.cjs +1 -1
- package/fab/index.js +1 -0
- package/file-picker/definition.cjs +7 -2
- package/file-picker/definition.js +7 -2
- package/file-picker/index.cjs +6 -6
- package/file-picker/index.js +82 -73
- package/icon/definition.cjs +66 -41
- package/icon/definition.js +67 -42
- package/index.cjs +21 -0
- package/index.js +1 -1
- package/lib/color-picker/color-picker.d.ts +390 -12
- package/lib/color-picker/locale.d.ts +4 -0
- package/lib/data-grid/locale.d.ts +5 -0
- package/lib/date-picker/date-picker.d.ts +38 -38
- package/lib/date-range-picker/date-range-picker.d.ts +20 -20
- package/lib/date-time-picker/date-time-picker.d.ts +40 -40
- package/lib/dial-pad/dial-pad.d.ts +1 -0
- package/lib/icon/icon.d.ts +1 -1
- package/lib/menu/menu.d.ts +4 -4
- package/lib/rich-text-editor/definition.d.ts +3 -2
- package/lib/rich-text-editor/locale.d.ts +29 -3
- package/lib/rich-text-editor/popover.d.ts +19 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +16 -45
- package/lib/rich-text-editor/rich-text-editor.template.d.ts +2 -2
- package/lib/rich-text-editor/rte/config.d.ts +18 -0
- package/lib/rich-text-editor/rte/document.d.ts +28 -0
- package/lib/rich-text-editor/rte/exports.d.ts +23 -0
- package/lib/rich-text-editor/rte/feature.d.ts +46 -0
- package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +33 -0
- package/lib/rich-text-editor/rte/features/internal/foreign-html.d.ts +11 -0
- package/lib/rich-text-editor/rte/features/internal/history.d.ts +10 -0
- package/lib/rich-text-editor/rte/features/internal/text-style.d.ts +18 -0
- package/lib/rich-text-editor/rte/html-parser.d.ts +24 -0
- package/lib/rich-text-editor/rte/html-serializer.d.ts +30 -0
- package/lib/rich-text-editor/rte/instance.d.ts +57 -0
- package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -0
- package/lib/rich-text-editor/rte/utils/impl.d.ts +1 -0
- package/lib/rich-text-editor/rte/utils/textblock-attrs.d.ts +29 -0
- package/lib/rich-text-editor/rte/utils/textblock-marks.d.ts +10 -0
- package/lib/rich-text-editor/rte/utils/ui.d.ts +109 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +6 -5
- package/lib/text-area/text-area.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +4 -4
- package/locales/de-DE.cjs +58 -7
- package/locales/de-DE.js +58 -7
- package/locales/en-GB.cjs +60 -9
- package/locales/en-GB.js +60 -9
- package/locales/en-US.cjs +60 -9
- package/locales/en-US.js +60 -9
- package/locales/ja-JP.cjs +59 -8
- package/locales/ja-JP.js +59 -8
- package/locales/zh-CN.cjs +58 -7
- package/locales/zh-CN.js +58 -7
- package/menu/definition.cjs +1 -0
- package/menu/definition.js +1 -0
- package/number-field/definition.cjs +5 -3
- package/number-field/definition.js +5 -3
- package/number-field/index.cjs +5 -3
- package/number-field/index.js +34 -32
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +76 -62
- package/pagination/definition.cjs +2 -0
- package/pagination/definition.js +2 -0
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +2 -0
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/definition.cjs +4 -0
- package/radio/definition.js +4 -0
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/definition.cjs +2 -1
- package/range-slider/definition.js +2 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +3 -1
- package/rich-text-editor/definition.cjs +17942 -1074
- package/rich-text-editor/definition.js +17926 -1079
- package/rich-text-editor/index.cjs +29 -130
- package/rich-text-editor/index.js +5565 -2474
- package/searchable-select/definition.cjs +6 -2
- package/searchable-select/definition.js +6 -2
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +14 -10
- package/select/definition.cjs +22 -4
- package/select/definition.js +22 -4
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/color-picker/base-color-picker.d.ts +2 -1
- package/shared/patterns/anchored.d.ts +8 -8
- package/shared/patterns/char-count/char-count.d.ts +1 -1
- package/shared/patterns/localized.d.ts +386 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
- package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
- package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
- package/shared/utils/promise.d.ts +7 -0
- package/simple-color-picker/definition.cjs +11 -6
- package/simple-color-picker/definition.js +11 -6
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +44 -39
- package/slider/definition.cjs +7 -1
- package/slider/definition.js +7 -1
- package/styles/core/all.css +5 -1
- package/styles/core/theme.css +5 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/definition.cjs +1 -0
- package/switch/definition.js +1 -0
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -0
- package/tabs/definition.cjs +2 -0
- package/tabs/definition.js +2 -0
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +2 -0
- package/tag/definition.cjs +34 -14
- package/tag/definition.js +34 -14
- package/tag/index.cjs +25 -12
- package/tag/index.js +64 -47
- package/tag-group/definition.cjs +1 -2
- package/tag-group/definition.js +1 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +11 -12
- package/text-area/definition.cjs +13 -7
- package/text-area/definition.js +13 -7
- package/text-area/index.cjs +6 -6
- package/text-area/index.js +20 -14
- package/text-field/definition.cjs +16 -6
- package/text-field/definition.js +16 -6
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/definition.cjs +5 -1
- package/toggletip/definition.js +5 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +6 -3
- package/tooltip/definition.js +6 -3
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-view/definition.cjs +28 -6
- package/tree-view/definition.js +28 -6
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +28 -6
- package/unbundled/_commonjsHelpers.cjs +0 -26
- package/unbundled/_commonjsHelpers.js +1 -26
- package/unbundled/attribute-binding-behaviour.cjs +1 -0
- package/unbundled/attribute-binding-behaviour.js +1 -0
- package/unbundled/base-color-picker.cjs +45 -21
- package/unbundled/base-color-picker.js +45 -21
- package/unbundled/base-progress.cjs +3 -0
- package/unbundled/base-progress.js +3 -0
- package/unbundled/button.cjs +14 -10
- package/unbundled/button.js +14 -10
- package/unbundled/calendar-picker.template.cjs +3 -1
- package/unbundled/calendar-picker.template.js +3 -1
- package/unbundled/definition.cjs +1 -0
- package/unbundled/definition.js +1 -0
- package/unbundled/definition2.cjs +4 -1
- package/unbundled/definition2.js +4 -1
- package/unbundled/definition3.cjs +1 -0
- package/unbundled/definition3.js +1 -0
- package/unbundled/definition4.cjs +1 -0
- package/unbundled/definition4.js +1 -0
- package/unbundled/definition5.cjs +3 -2
- package/unbundled/definition5.js +4 -3
- package/unbundled/delegates-aria.cjs +1 -0
- package/unbundled/delegates-aria.js +1 -0
- package/unbundled/form-associated.cjs +4 -0
- package/unbundled/form-associated.js +4 -0
- package/unbundled/listbox.cjs +16 -1
- package/unbundled/listbox.js +16 -1
- package/unbundled/localized.cjs +36 -0
- package/unbundled/localized.js +37 -2
- package/unbundled/mixins.cjs +2 -0
- package/unbundled/mixins.js +2 -0
- package/unbundled/picker-field.template.cjs +3 -35
- package/unbundled/picker-field.template.js +3 -34
- package/unbundled/scrollIntoView.cjs +1 -0
- package/unbundled/scrollIntoView.js +1 -0
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +5 -1
- package/unbundled/time-selection-picker.template.js +5 -1
- package/unbundled/trapped-focus.cjs +37 -0
- package/unbundled/trapped-focus.js +34 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +54 -44
- package/video-player/definition.js +50 -40
- package/video-player/index.cjs +28 -28
- package/video-player/index.js +1448 -1442
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +6463 -6099
- package/bundled/_has.cjs +0 -1
- package/bundled/_has.js +0 -34
- package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +0 -4
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +0 -18
- package/lib/rich-text-editor/image-placeholder/definition.d.ts +0 -2
- package/lib/rich-text-editor/image-placeholder/image-placeholder.d.ts +0 -7
- package/lib/rich-text-editor/image-placeholder/image-placeholder.template.d.ts +0 -4
- package/lib/rich-text-editor/menubar/consts.d.ts +0 -18
- package/lib/rich-text-editor/menubar/definition.d.ts +0 -2
- package/lib/rich-text-editor/menubar/menubar.d.ts +0 -386
- package/lib/rich-text-editor/menubar/menubar.template.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonage/vivid",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
|
+
"homepage": "https://vivid.deno.dev",
|
|
5
|
+
"bugs": {
|
|
6
|
+
"url": "https://github.com/Vonage/vivid-3/issues"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/vonage/vivid-3",
|
|
11
|
+
"directory": "libs/components"
|
|
12
|
+
},
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"./*/index.js",
|
|
16
|
+
"./*/index.cjs",
|
|
17
|
+
"*.css"
|
|
18
|
+
],
|
|
4
19
|
"type": "module",
|
|
5
|
-
"module": "./index.js",
|
|
6
|
-
"main": "./index.cjs",
|
|
7
20
|
"exports": {
|
|
8
21
|
".": {
|
|
9
22
|
"types": "./index.d.ts",
|
|
@@ -22,91 +35,92 @@
|
|
|
22
35
|
},
|
|
23
36
|
"./*.css": "./*.css"
|
|
24
37
|
},
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"./*/index.cjs",
|
|
28
|
-
"*.css"
|
|
29
|
-
],
|
|
30
|
-
"customElements": "custom-elements.json",
|
|
31
|
-
"homepage": "https://vivid.deno.dev",
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "https://github.com/vonage/vivid-3",
|
|
35
|
-
"directory": "libs/components"
|
|
36
|
-
},
|
|
37
|
-
"bugs": {
|
|
38
|
-
"url": "https://github.com/Vonage/vivid-3/issues"
|
|
39
|
-
},
|
|
40
|
-
"license": "Apache-2.0",
|
|
41
|
-
"scripts": {
|
|
42
|
-
"prebuild": "cem analyze --config ./cem.config.mjs",
|
|
43
|
-
"build": "vite build && vite build -c ./vite.config.bundled.ts",
|
|
44
|
-
"postbuild": "api-extractor run -c ./dist/api-extractor.json && tsx scripts/copyPackageJson.ts",
|
|
45
|
-
"dev": "WATCH_MODE=true vite build -w -c ./vite.config.ts",
|
|
46
|
-
"dev:bundled": "WATCH_MODE=true vite build -w -c ./vite.config.bundled.ts",
|
|
47
|
-
"lint": "eslint . --max-warnings=0",
|
|
48
|
-
"lint:fix": "eslint . --max-warnings=0 --fix",
|
|
49
|
-
"stylelint": "stylelint 'src/**/*.{css,scss}'",
|
|
50
|
-
"stylelint:fix": "stylelint 'src/**/*.{css,scss}' --fix",
|
|
51
|
-
"test": "vitest run",
|
|
52
|
-
"test:watch": "vitest --watch",
|
|
53
|
-
"test:coverage": "vitest run --coverage",
|
|
54
|
-
"e2e": "playwright test",
|
|
55
|
-
"e2e:ui": "playwright test --ui",
|
|
56
|
-
"e2e:docker": "PW_TEST_CONNECT_WS_ENDPOINT=ws://0.0.0.0:3000/ playwright test",
|
|
57
|
-
"e2e:docker:ui": "PW_TEST_CONNECT_WS_ENDPOINT=ws://0.0.0.0:3000/ playwright test --ui",
|
|
58
|
-
"typecheck": "tsc --noEmit"
|
|
59
|
-
},
|
|
38
|
+
"main": "./index.cjs",
|
|
39
|
+
"module": "./index.js",
|
|
60
40
|
"dependencies": {
|
|
61
41
|
"@floating-ui/dom": "^1.6.13",
|
|
62
|
-
"@microsoft/fast-element": "^2.
|
|
42
|
+
"@microsoft/fast-element": "^2.8.3",
|
|
63
43
|
"@microsoft/fast-web-utilities": "^6.0.0",
|
|
64
44
|
"date-fns": "^3.0.0",
|
|
65
|
-
"
|
|
45
|
+
"dompurify": "^3.3.0",
|
|
66
46
|
"prosemirror-commands": "^1.7.1",
|
|
47
|
+
"prosemirror-dropcursor": "^1.8.2",
|
|
48
|
+
"prosemirror-gapcursor": "^1.3.2",
|
|
49
|
+
"prosemirror-history": "^1.4.1",
|
|
67
50
|
"prosemirror-keymap": "^1.2.3",
|
|
68
51
|
"prosemirror-model": "^1.25.4",
|
|
69
52
|
"prosemirror-schema-basic": "^1.2.3",
|
|
70
53
|
"prosemirror-state": "^1.4.4",
|
|
54
|
+
"prosemirror-transform": "^1.10.5",
|
|
71
55
|
"prosemirror-view": "^1.40.1",
|
|
72
56
|
"ramda": "^0.32.0",
|
|
73
|
-
"uuid": "^11.1.0"
|
|
57
|
+
"uuid": "^11.1.0",
|
|
58
|
+
"vanilla-colorful": "^0.7.2"
|
|
74
59
|
},
|
|
75
60
|
"devDependencies": {
|
|
76
|
-
"@
|
|
61
|
+
"@custom-elements-manifest/analyzer": "^0.5.7",
|
|
62
|
+
"@microsoft/api-extractor": "^7.55.0",
|
|
77
63
|
"@microsoft/eslint-config-fast-dna": "^2.1.0",
|
|
78
|
-
"@playwright/test": "1.
|
|
79
|
-
"@
|
|
80
|
-
"@repo/consts": "*",
|
|
81
|
-
"@repo/eslint-config": "*",
|
|
82
|
-
"@repo/eslint-plugin-repo": "*",
|
|
83
|
-
"@repo/shared": "*",
|
|
84
|
-
"@repo/stylelint-config": "*",
|
|
85
|
-
"@repo/styles": "*",
|
|
86
|
-
"@repo/typescript-config": "*",
|
|
87
|
-
"@repo/vitest-config": "*",
|
|
88
|
-
"video.js": "^8.23.3",
|
|
89
|
-
"@testing-library/dom": "^8.18.1",
|
|
64
|
+
"@playwright/test": "1.57.0",
|
|
65
|
+
"@testing-library/dom": "^8.20.1",
|
|
90
66
|
"@testing-library/user-event": "^14.6.1",
|
|
91
|
-
"@types/
|
|
67
|
+
"@types/jsdom": "^21.1.7",
|
|
68
|
+
"@types/markdown-it": "^13.0.9",
|
|
69
|
+
"@types/node": "^20.19.25",
|
|
70
|
+
"@types/ramda": "^0.30.2",
|
|
92
71
|
"@types/uuid": "^10.0.0",
|
|
93
|
-
"@vonage/vivid-figma-tokens": "github:vonage/vivid-figma-tokens#v1.4.0",
|
|
94
72
|
"cem-plugin-async-function": "^0.0.5",
|
|
95
73
|
"cem-plugin-jsdoc-example": "^0.0.9",
|
|
96
74
|
"cem-plugin-jsdoc-function": "^0.0.5",
|
|
97
75
|
"cem-plugin-readonly": "^0.0.5",
|
|
76
|
+
"concurrently": "^9.2.1",
|
|
98
77
|
"dialog-polyfill": "^0.5.6",
|
|
99
78
|
"element-internals-polyfill": "^1.3.13",
|
|
100
|
-
"
|
|
101
|
-
"jsdom": "^23.
|
|
79
|
+
"http-server": "^14.1.1",
|
|
80
|
+
"jsdom": "^23.2.0",
|
|
102
81
|
"markdown-it": "^13.0.2",
|
|
103
|
-
"playwright": "1.
|
|
104
|
-
"sass": "^1.
|
|
82
|
+
"playwright": "1.57.0",
|
|
83
|
+
"sass": "^1.94.2",
|
|
84
|
+
"tsx": "^4.20.6",
|
|
85
|
+
"typescript": "5.9.3",
|
|
86
|
+
"video.js": "^8.23.4",
|
|
87
|
+
"vite": "^5.4.18",
|
|
88
|
+
"vite-plugin-dts": "~2.3.0",
|
|
105
89
|
"vite-plugin-static-copy": "^1.0.6",
|
|
106
|
-
"vitest": "^2.
|
|
90
|
+
"vitest": "^3.2.4",
|
|
107
91
|
"vitest-axe": "^0.1.0",
|
|
108
92
|
"vitest-fetch-mock": "^0.4.5",
|
|
109
93
|
"wait-on": "^8.0.5",
|
|
110
|
-
"
|
|
94
|
+
"@repo/cem-analyzer-plugins": "1.0.0",
|
|
95
|
+
"@repo/consts": "1.0.0",
|
|
96
|
+
"@repo/eslint-config": "1.0.0",
|
|
97
|
+
"@repo/eslint-plugin-repo": "1.0.0",
|
|
98
|
+
"@repo/shared": "1.0.0",
|
|
99
|
+
"@repo/stylelint-config": "1.0.0",
|
|
100
|
+
"@repo/styles": "1.0.0",
|
|
101
|
+
"@repo/tools": "1.0.0",
|
|
102
|
+
"@repo/tokens": "1.0.0",
|
|
103
|
+
"@repo/typescript-config": "1.0.0",
|
|
104
|
+
"@repo/vitest-config": "1.0.0"
|
|
105
|
+
},
|
|
106
|
+
"customElements": "custom-elements.json",
|
|
107
|
+
"scripts": {
|
|
108
|
+
"prebuild": "cem analyze --config ./cem.config.mjs",
|
|
109
|
+
"build": "vite build && vite build -c ./vite.config.bundled.ts",
|
|
110
|
+
"postbuild": "api-extractor run -c ./dist/api-extractor.json && move-manifest-to-dist .",
|
|
111
|
+
"dev": "WATCH_MODE=true vite build -w -c ./vite.config.ts",
|
|
112
|
+
"dev:bundled": "WATCH_MODE=true vite build -w -c ./vite.config.bundled.ts",
|
|
113
|
+
"e2e": "playwright test",
|
|
114
|
+
"e2e:docker": "PW_TEST_CONNECT_WS_ENDPOINT=ws://localhost:3000/ playwright test",
|
|
115
|
+
"e2e:docker:ui": "PW_TEST_CONNECT_WS_ENDPOINT=ws://localhost:3000/ playwright test --ui",
|
|
116
|
+
"e2e:ui": "playwright test --ui",
|
|
117
|
+
"lint": "eslint . --max-warnings=0",
|
|
118
|
+
"lint:fix": "eslint . --max-warnings=0 --fix",
|
|
119
|
+
"stylelint": "stylelint 'src/**/*.{css,scss}'",
|
|
120
|
+
"stylelint:fix": "stylelint 'src/**/*.{css,scss}' --fix",
|
|
121
|
+
"test": "vitest run",
|
|
122
|
+
"test:coverage": "vitest run --coverage",
|
|
123
|
+
"test:watch": "vitest --watch",
|
|
124
|
+
"typecheck": "tsc --noEmit"
|
|
111
125
|
}
|
|
112
126
|
}
|
|
@@ -61,10 +61,12 @@ class Pagination extends localized.Localized(vividElement.VividElement) {
|
|
|
61
61
|
if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
|
|
62
62
|
if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2)
|
|
63
63
|
return this.selectedIndex + (i - 2);
|
|
64
|
+
/* v8 ignore else -- @preserve */
|
|
64
65
|
if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return "...";
|
|
65
66
|
}
|
|
66
67
|
if (this.selectedIndex > this.total - 5) {
|
|
67
68
|
if (i > 1) return this.total - (6 - i);
|
|
69
|
+
/* v8 ignore else -- @preserve */
|
|
68
70
|
if (i === 1) return "...";
|
|
69
71
|
}
|
|
70
72
|
}
|
package/pagination/definition.js
CHANGED
|
@@ -57,10 +57,12 @@ class Pagination extends Localized(VividElement) {
|
|
|
57
57
|
if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
|
|
58
58
|
if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2)
|
|
59
59
|
return this.selectedIndex + (i - 2);
|
|
60
|
+
/* v8 ignore else -- @preserve */
|
|
60
61
|
if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return "...";
|
|
61
62
|
}
|
|
62
63
|
if (this.selectedIndex > this.total - 5) {
|
|
63
64
|
if (i > 1) return this.total - (6 - i);
|
|
65
|
+
/* v8 ignore else -- @preserve */
|
|
64
66
|
if (i === 1) return "...";
|
|
65
67
|
}
|
|
66
68
|
}
|
package/pagination/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const h=require("../bundled/definition3.cjs"),s=require("../bundled/vivid-element.cjs"),m=require("../bundled/localized.cjs"),l=require("../bundled/enums.cjs"),g=require("../bundled/ref.cjs"),I=require("../bundled/children.cjs"),z=require("../bundled/repeat.cjs"),y=require("../bundled/slotted.cjs"),b=require("../bundled/when.cjs"),w=require("../bundled/class-names.cjs"),S=".control{display:inline-flex;justify-content:space-between}.control:not(.shape-pill){border-radius:4px}.control.shape-pill{border-radius:16px}.buttons-wrapper{display:flex;column-gap:4px}.vwc-pagination-button[size=super-condensed]{--base-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button[size=condensed]{--base-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button[size=normal]{--base-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button::part(button){padding-inline:0}.dots{align-self:center;text-align:center}.dots:not(.size-super-condensed){font:var(--vvd-typography-base-bold)}.dots.size-super-condensed{font:var(--vvd-typography-base-condensed-bold);inline-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.dots.size-condensed{inline-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.dots.size-normal{inline-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}";var B=Object.defineProperty,_=Object.getOwnPropertyDescriptor,r=(i,e,t,o)=>{for(var n=o>1?void 0:o?_(e,t):e,c=i.length-1,d;c>=0;c--)(d=i[c])&&(n=(o?d(e,t,n):d(n))||n);return o&&n&&B(e,t,n),n};const p=7,f={fromView:i=>parseInt(i,10),toView:i=>i.toString()};class a extends m.Localized(s.VividElement){constructor(){super(),this.navIcons=!1,this.total=0,this.selectedIndex=0,this.addEventListener("tabpressed",e=>{const{value:t,shiftKey:o}=e.detail,n=this.paginationButtons.findIndex($=>Number($.label)===t),c=o?-1:1,d=n+c;if(d<0)return this.prevButton.focus();if(d>this.paginationButtons.length-1)return this.nextButton.focus();this.paginationButtons&&this.paginationButtons[n+c].focus()})}get pagesList(){return new Array(this.total<p?this.total:p).fill(0).map((e,t,o)=>{if(t===0)return 1;if(t===o.length-1)return this.total;if(this.selectedIndex!==void 0&&this.total>p){if(this.selectedIndex<4&&t===p-2)return"...";if(this.selectedIndex>=4&&this.selectedIndex<=this.total-5){if(t>1&&t<p-2)return this.selectedIndex+(t-2)
|
|
1
|
+
"use strict";const h=require("../bundled/definition3.cjs"),s=require("../bundled/vivid-element.cjs"),m=require("../bundled/localized.cjs"),l=require("../bundled/enums.cjs"),g=require("../bundled/ref.cjs"),I=require("../bundled/children.cjs"),z=require("../bundled/repeat.cjs"),y=require("../bundled/slotted.cjs"),b=require("../bundled/when.cjs"),w=require("../bundled/class-names.cjs"),S=".control{display:inline-flex;justify-content:space-between}.control:not(.shape-pill){border-radius:4px}.control.shape-pill{border-radius:16px}.buttons-wrapper{display:flex;column-gap:4px}.vwc-pagination-button[size=super-condensed]{--base-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button[size=condensed]{--base-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button[size=normal]{--base-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button::part(button){padding-inline:0}.dots{align-self:center;text-align:center}.dots:not(.size-super-condensed){font:var(--vvd-typography-base-bold)}.dots.size-super-condensed{font:var(--vvd-typography-base-condensed-bold);inline-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.dots.size-condensed{inline-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.dots.size-normal{inline-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}";var B=Object.defineProperty,_=Object.getOwnPropertyDescriptor,r=(i,e,t,o)=>{for(var n=o>1?void 0:o?_(e,t):e,c=i.length-1,d;c>=0;c--)(d=i[c])&&(n=(o?d(e,t,n):d(n))||n);return o&&n&&B(e,t,n),n};const p=7,f={fromView:i=>parseInt(i,10),toView:i=>i.toString()};class a extends m.Localized(s.VividElement){constructor(){super(),this.navIcons=!1,this.total=0,this.selectedIndex=0,this.addEventListener("tabpressed",e=>{const{value:t,shiftKey:o}=e.detail,n=this.paginationButtons.findIndex($=>Number($.label)===t),c=o?-1:1,d=n+c;if(d<0)return this.prevButton.focus();if(d>this.paginationButtons.length-1)return this.nextButton.focus();this.paginationButtons&&this.paginationButtons[n+c].focus()})}get pagesList(){return new Array(this.total<p?this.total:p).fill(0).map((e,t,o)=>{if(t===0)return 1;if(t===o.length-1)return this.total;if(this.selectedIndex!==void 0&&this.total>p){if(this.selectedIndex<4&&t===p-2)return"...";if(this.selectedIndex>=4&&this.selectedIndex<=this.total-5){if(t>1&&t<p-2)return this.selectedIndex+(t-2);/* v8 ignore else -- @preserve */if(t===1||t===p-2)return"..."}if(this.selectedIndex>this.total-5){if(t>1)return this.total-(6-t);/* v8 ignore else -- @preserve */if(t===1)return"..."}}return t+1})}totalChanged(e,t){if(t<0){this.total=0;return}this.#t()}selectedIndexChanged(e,t){e!==void 0&&(this.$emit("pagination-change",{selectedIndex:t,total:this.total,oldIndex:e}),this.#t())}paginationButtonsChanged(e,t){t.forEach(o=>{o.shadowRoot.querySelector("button").setAttribute("part","button")})}get#e(){return Math.max(0,Math.min(this.selectedIndex??0,this.total-1))}#t(){this.selectedIndex!==this.#e&&window.queueMicrotask(()=>{this.selectedIndex!==this.#e&&(this.selectedIndex=this.#e)})}}r([s.attr],a.prototype,"size",2);r([s.attr],a.prototype,"shape",2);r([s.observable],a.prototype,"paginationButtons",2);r([s.observable],a.prototype,"prevButton",2);r([s.observable],a.prototype,"nextButton",2);r([s.attr({attribute:"nav-icons",mode:"boolean"})],a.prototype,"navIcons",2);r([s.volatile],a.prototype,"pagesList",1);r([s.attr({mode:"reflect",converter:f})],a.prototype,"total",2);r([s.attr({mode:"reflect",converter:f,attribute:"selected-index"})],a.prototype,"selectedIndex",2);const P=[l.Size.SuperCondensed,l.Size.Condensed,l.Size.Normal],L=[l.Shape.Rounded,l.Shape.Pill],x=(i,{parent:e})=>e.selectedIndex=Number(i)-1,E=(i,{event:e,parent:t})=>{(e.key===" "||e.key==="Enter")&&x(i,{parent:t}),e.key==="Tab"&&e.target.dispatchEvent(new CustomEvent("tabpressed",{detail:{value:i,shiftKey:e.shiftKey},bubbles:!0,composed:!0}))},q=i=>w.classNames("control");function C(i,{parent:e}){return e.selectedIndex===Number(i)-1?"filled":"ghost"}const D=i=>s.html` ${b.when(e=>e!=="...",s.html`
|
|
2
2
|
<${i} class="vwc-pagination-button"
|
|
3
3
|
label="${e=>e}"
|
|
4
4
|
appearance="${C}"
|
package/pagination/index.js
CHANGED
|
@@ -43,10 +43,12 @@ class a extends P(w) {
|
|
|
43
43
|
if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
|
|
44
44
|
if (t > 1 && t < d - 2)
|
|
45
45
|
return this.selectedIndex + (t - 2);
|
|
46
|
+
/* v8 ignore else -- @preserve */
|
|
46
47
|
if (t === 1 || t === d - 2) return "...";
|
|
47
48
|
}
|
|
48
49
|
if (this.selectedIndex > this.total - 5) {
|
|
49
50
|
if (t > 1) return this.total - (6 - t);
|
|
51
|
+
/* v8 ignore else -- @preserve */
|
|
50
52
|
if (t === 1) return "...";
|
|
51
53
|
}
|
|
52
54
|
}
|
package/progress-ring/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("../bundled/
|
|
1
|
+
"use strict";const e=require("../bundled/definition16.cjs");e.registerProgressRing();
|
package/progress-ring/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r } from "../bundled/
|
|
1
|
+
import { r } from "../bundled/definition16.js";
|
|
2
2
|
r();
|
package/radio/definition.cjs
CHANGED
|
@@ -85,6 +85,7 @@ class Radio extends withErrorText.WithErrorText(
|
|
|
85
85
|
* @internal
|
|
86
86
|
*/
|
|
87
87
|
readOnlyChanged() {
|
|
88
|
+
/* v8 ignore if -- @preserve */
|
|
88
89
|
if (this.proxy instanceof HTMLInputElement) {
|
|
89
90
|
this.proxy.readOnly = this.readOnly;
|
|
90
91
|
}
|
|
@@ -94,6 +95,7 @@ class Radio extends withErrorText.WithErrorText(
|
|
|
94
95
|
*/
|
|
95
96
|
defaultCheckedChanged() {
|
|
96
97
|
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
98
|
+
/* v8 ignore else -- @preserve */
|
|
97
99
|
if (!this.isInsideRadioGroup()) {
|
|
98
100
|
this.checked = this.defaultChecked;
|
|
99
101
|
this.dirtyChecked = false;
|
|
@@ -115,11 +117,13 @@ class Radio extends withErrorText.WithErrorText(
|
|
|
115
117
|
super.connectedCallback();
|
|
116
118
|
fastElement.Updates.enqueue(this.validate);
|
|
117
119
|
if (this.parentElement.getAttribute("data-vvd-component") !== "radio-group" && this.getAttribute("tabindex") === null) {
|
|
120
|
+
/* v8 ignore else -- @preserve */
|
|
118
121
|
if (!this.disabled) {
|
|
119
122
|
this.setAttribute("tabindex", "0");
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
125
|
if (this.defaultChecked) {
|
|
126
|
+
/* v8 ignore else -- @preserve */
|
|
123
127
|
if (!this.dirtyChecked) {
|
|
124
128
|
if (!this.isInsideRadioGroup()) {
|
|
125
129
|
this.checked = this.defaultChecked;
|
package/radio/definition.js
CHANGED
|
@@ -81,6 +81,7 @@ class Radio extends WithErrorText(
|
|
|
81
81
|
* @internal
|
|
82
82
|
*/
|
|
83
83
|
readOnlyChanged() {
|
|
84
|
+
/* v8 ignore if -- @preserve */
|
|
84
85
|
if (this.proxy instanceof HTMLInputElement) {
|
|
85
86
|
this.proxy.readOnly = this.readOnly;
|
|
86
87
|
}
|
|
@@ -90,6 +91,7 @@ class Radio extends WithErrorText(
|
|
|
90
91
|
*/
|
|
91
92
|
defaultCheckedChanged() {
|
|
92
93
|
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
94
|
+
/* v8 ignore else -- @preserve */
|
|
93
95
|
if (!this.isInsideRadioGroup()) {
|
|
94
96
|
this.checked = this.defaultChecked;
|
|
95
97
|
this.dirtyChecked = false;
|
|
@@ -111,11 +113,13 @@ class Radio extends WithErrorText(
|
|
|
111
113
|
super.connectedCallback();
|
|
112
114
|
Updates.enqueue(this.validate);
|
|
113
115
|
if (this.parentElement.getAttribute("data-vvd-component") !== "radio-group" && this.getAttribute("tabindex") === null) {
|
|
116
|
+
/* v8 ignore else -- @preserve */
|
|
114
117
|
if (!this.disabled) {
|
|
115
118
|
this.setAttribute("tabindex", "0");
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
if (this.defaultChecked) {
|
|
122
|
+
/* v8 ignore else -- @preserve */
|
|
119
123
|
if (!this.dirtyChecked) {
|
|
120
124
|
if (!this.isInsideRadioGroup()) {
|
|
121
125
|
this.checked = this.defaultChecked;
|
package/radio/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("../bundled/
|
|
1
|
+
"use strict";const i=require("../bundled/definition18.cjs");i.registerRadio();
|
package/radio/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r } from "../bundled/
|
|
1
|
+
import { r } from "../bundled/definition18.js";
|
|
2
2
|
r();
|
package/radio-group/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("../bundled/vivid-element.cjs"),c=require("../bundled/
|
|
1
|
+
"use strict";const r=require("../bundled/vivid-element.cjs"),c=require("../bundled/definition18.cjs"),f=require("../bundled/mixins.cjs"),n=require("../bundled/key-codes.cjs"),g=require("../bundled/aria.cjs"),p=require("../bundled/delegates-aria.cjs"),b=require("../bundled/when.cjs"),u=require("../bundled/slotted.cjs"),v=".base{display:flex;flex-direction:column;gap:8px;--_low-ink-color: var(--vvd-color-neutral-600)}.positioning-region{display:flex;flex-wrap:wrap;gap:8px}.positioning-region.vertical{flex-direction:column}fieldset{display:block;padding:0;border:none;margin:0}legend{padding:0;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);margin-block-end:8px}";var y=Object.defineProperty,s=(d,t,e,i)=>{for(var o=void 0,l=d.length-1,h;l>=0;l--)(h=d[l])&&(o=h(t,e,o)||o);return o&&y(t,e,o),o};class a extends f.WithFeedback(r.VividElement){constructor(){super(...arguments),this.errorValidationMessage="",this.orientation=g.Orientation.horizontal,this.slottedRadioButtons=[],this.radioErrorHandler=t=>{const e=t.target;this.errorValidationMessage=e.errorValidationMessage||""},this.radioChangeHandler=t=>{const e=t.target;e.checked&&(this.slottedRadioButtons?.forEach(i=>{i!==e&&(i.checked=!1)}),this.value=e.value,this.#e(e)),t.stopPropagation()},this.moveToRadioByIndex=(t,e)=>{const i=t[e];!this.isInsideToolbar&&!i.readOnly&&(i.checked=!0),i.focus()},this.moveRightOffGroup=()=>{this.nextElementSibling?.focus()},this.moveLeftOffGroup=()=>{this.previousElementSibling?.focus()},this.moveRight=t=>{const e=t.target,i=this.#t;let o=0;if(o=i.indexOf(e)+1,o===i.length&&this.isInsideToolbar&&t.key===n.keyArrowRight){this.moveRightOffGroup();return}o===i.length&&(o=0),this.moveToRadioByIndex(i,o)},this.moveLeft=t=>{const e=t.target,i=this.#t;let o=i.indexOf(e)-1;if(this.isInsideToolbar&&t.key===n.keyArrowLeft&&o<0){this.moveLeftOffGroup();return}o=o<0?i.length-1:o,this.moveToRadioByIndex(i,o)},this.keydownHandler=t=>{switch(t.key){case n.keyEnter:this.checkFocusedRadio(t.target);break;case n.keyArrowRight:case n.keyArrowDown:this.moveRight(t);break;case n.keyArrowLeft:case n.keyArrowUp:this.moveLeft(t);break;default:return!0}}}requiredChanged(){this.slottedRadioButtons?.forEach(t=>{this.required?t.required=!0:t.required=!1})}readOnlyChanged(){this.slottedRadioButtons?.forEach(t=>{this.readOnly?t.readOnly=!0:t.readOnly=!1})}disabledChanged(){this.slottedRadioButtons?.forEach(t=>{this.disabled?t.disabled=!0:t.disabled=!1})}nameChanged(){this.slottedRadioButtons?.forEach(t=>{t.setAttribute("name",this.name)})}valueChanged(){this.slottedRadioButtons?.forEach(t=>{t.value===this.value&&(t.checked=!0)}),this.$emit("change")}handleSlotChange(){this.errorText&&this.slottedRadioButtons?.forEach(t=>{t.errorText=this.errorText})}errorTextChanged(t,e){e?this.errorValidationMessage=e:this.errorValidationMessage=""}get#t(){return this.slottedRadioButtons?.filter(t=>!t.disabled)}slottedRadioButtonsChanged(){this.slottedRadioButtons&&this.slottedRadioButtons.length>0&&this.setupRadioButtons()}get isInsideToolbar(){return!!this.closest('[role="toolbar"]')}connectedCallback(){super.connectedCallback(),this.setupRadioButtons()}disconnectedCallback(){this.slottedRadioButtons?.forEach(t=>{t.removeEventListener("change",this.radioChangeHandler),t.removeEventListener("invalid",this.radioErrorHandler)})}setupRadioButtons(){let t=!1;for(const e of this.slottedRadioButtons)this.name!==void 0&&e.setAttribute("name",this.name),this.disabled&&(e.disabled=!0),this.readOnly&&(e.readOnly=!0),this.required&&(e.required=!0),this.value&&this.value===e.value?(e.checked=!0,this.#e(e),t=!0):e.checked=!1,e.addEventListener("change",this.radioChangeHandler),e.addEventListener("invalid",this.radioErrorHandler);if(this.value===void 0&&this.slottedRadioButtons?.length>0){const e=this.slottedRadioButtons?.filter(i=>i.hasAttribute("checked"));if(e.length>0&&!t){const i=e[e.length-1];i.checked=!0,this.#e(i)}else this.#e(this.slottedRadioButtons[0])}}focusInHandler(t){this.#e(t.target)}#e(t){t.setAttribute("tabindex","0");for(const e of this.slottedRadioButtons)e!==t&&e.setAttribute("tabindex","-1")}checkFocusedRadio(t){t.readOnly||(t.checked=!0)}}s([r.attr],a.prototype,"label");s([r.attr({attribute:"required",mode:"boolean"})],a.prototype,"required");s([r.attr({attribute:"readonly",mode:"boolean"})],a.prototype,"readOnly");s([r.attr({attribute:"disabled",mode:"boolean"})],a.prototype,"disabled");s([r.attr],a.prototype,"name");s([r.attr],a.prototype,"value");s([r.observable],a.prototype,"errorValidationMessage");s([r.attr({attribute:"error-text"})],a.prototype,"errorText");s([r.attr],a.prototype,"orientation");s([r.observable],a.prototype,"slottedRadioButtons");const R=d=>{const t=d.tagFor(c.Radio,!0);return r.html`
|
|
2
2
|
<template
|
|
3
3
|
@keydown="${(e,i)=>e.keydownHandler(i.event)}"
|
|
4
4
|
@focusin="${(e,i)=>e.focusInHandler(i.event)}"
|
package/radio-group/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { V as p, a as r, o as f, h, c as b, d as v } from "../bundled/vivid-element.js";
|
|
2
|
-
import { R as m, a as y } from "../bundled/
|
|
2
|
+
import { R as m, a as y } from "../bundled/definition18.js";
|
|
3
3
|
import { W as R, f as k } from "../bundled/mixins.js";
|
|
4
4
|
import { g as u, h as c, c as B, b as x, f as O } from "../bundled/key-codes.js";
|
|
5
5
|
import { O as g } from "../bundled/aria.js";
|
|
@@ -105,7 +105,8 @@ class RangeSlider extends localized.Localized(
|
|
|
105
105
|
} else if (e.key === fastWebUtilities.keyEnd) {
|
|
106
106
|
e.preventDefault();
|
|
107
107
|
this.#updateValues({ [thumb]: `${this.#thumbConstraints[thumb].max}` });
|
|
108
|
-
} else
|
|
108
|
+
} else {
|
|
109
|
+
if (e.shiftKey) return;
|
|
109
110
|
switch (e.key) {
|
|
110
111
|
case keyCodes.keyArrowRight:
|
|
111
112
|
case fastWebUtilities.keyArrowDown:
|
|
@@ -101,7 +101,8 @@ class RangeSlider extends Localized(
|
|
|
101
101
|
} else if (e.key === keyEnd) {
|
|
102
102
|
e.preventDefault();
|
|
103
103
|
this.#updateValues({ [thumb]: `${this.#thumbConstraints[thumb].max}` });
|
|
104
|
-
} else
|
|
104
|
+
} else {
|
|
105
|
+
if (e.shiftKey) return;
|
|
105
106
|
switch (e.key) {
|
|
106
107
|
case keyArrowRight:
|
|
107
108
|
case keyArrowDown:
|
package/range-slider/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const h=require("../bundled/definition9.cjs"),i=require("../bundled/vivid-element.cjs"),c=require("../bundled/key-codes.cjs"),k=require("../bundled/form-associated.cjs"),u=require("../bundled/slider.template.cjs"),f=require("../bundled/localized.cjs"),y=require("../bundled/form-element.cjs"),d=require("../bundled/aria.cjs"),T=require("../bundled/numbers.cjs"),m=require("../bundled/ref.cjs"),b=require("../bundled/when.cjs"),_=require("../bundled/class-names.cjs"),z=':host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control.connotation-cta{--_connotation-color-primary: var(--vvd-slider-cta-primary, var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-slider-accent-primary, var(--vvd-color-canvas-text))}.control{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control{--_thumb-size: 12px;--_thumb-interaction-indicator-size: 36px;--_track-start-inset-inline-start: 0;--_track-start-inset-block-start: 0;cursor:pointer;outline:none;user-select:none}.control .positioning-region{position:relative}.control .track{position:absolute;border-radius:4px;background:var(--_track-background-color)}.control .track-start{position:absolute;border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));margin-inline-start:calc(var(--_thumb-size) / 2);min-inline-size:var(--_thumb-size)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);right:0;left:0;block-size:2px}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start: 1px;border-bottom-left-radius:0;border-top-left-radius:0}.control.horizontal .track .mark{position:absolute;block-size:6px;inline-size:100%;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{position:absolute;block-size:100%;inline-size:6px;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start: 1px;border-radius:0}.control.disabled{--_track-background-color: var(--vvd-color-neutral-100);--_track-start-background-color: var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color: var(--vvd-color-neutral-300);--_track-start-background-color: var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{position:absolute;border-radius:50%;block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);outline:none;touch-action:none}.thumb-container.focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--_thumb-interaction-indicator-alpha: .05;border-radius:50%}.control.horizontal .thumb-container{transform:translate(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}@media (hover: hover){.control:not(.disabled) .thumb-container:hover{--_thumb-interaction-indicator-alpha: .12}}.control:not(.disabled) .thumb-container:active{--_thumb-interaction-indicator-alpha: .25}.thumb-container:before{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-interaction-indicator-size);content:"";inline-size:var(--_thumb-interaction-indicator-size);opacity:var(--_thumb-interaction-indicator-alpha, 0);transition:opacity .2s ease-out 0s}.thumb-container:after{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-size);content:"";inline-size:var(--_thumb-size);inset:calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2)}.popup{pointer-events:none}.tooltip{width:auto;padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}:host([internal-part]) .thumb-container{opacity:0;transition:opacity .2s ease}:host([internal-part]) .control.horizontal .track{top:16px;block-size:4px;overflow:hidden}:host([internal-part]) .control:focus .thumb-container{opacity:1}@media (hover: hover){:host([internal-part]) .control:hover .thumb-container{opacity:1}}.control{--_track-start-inset-inline-start: auto;--_track-start-inset-block-start: auto}:host([markers]) .control.horizontal .track-start,:host([markers]) .control.vertical .track-start{--_track-start-inset-inline-start: auto;--_track-start-inset-block-start: auto}';var $=Object.defineProperty,a=(l,e,t,n)=>{for(var s=void 0,o=l.length-1,v;o>=0;o--)(v=l[o])&&(s=v(e,t,s)||s);return s&&$(e,t,s),s};const p={Increment:1,Decrement:-1};class r extends f.Localized(y.FormElement(k.FormAssociated(i.VividElement))){constructor(){super(...arguments),this.#r=!1,this.start="",this.end="",this.min=0,this.max=10,this.step=1,this.orientation=d.Orientation.horizontal,this.ariaStartLabel=null,this.ariaEndLabel=null,this.markers=!1,this.pin=!1,this.valueTextFormatter=e=>parseFloat(e).toLocaleString(this.locale.lang),this.proxy=document.createElement("input"),this._trackEl=null,this._startThumbEl=null,this._endThumbEl=null,this._draggingThumb=!1,this._visiblyFocusedThumb=null,this._hoveredThumb=null,this._startThumbCss="",this._endThumbCss="",this._selectedRangeCss="",this.#c=!1,this.#d=e=>{this.#c||(this._visiblyFocusedThumb=this.#h(e))},this.#m=()=>{this._visiblyFocusedThumb=null},this.#b=e=>{this._hoveredThumb=this.#h(e)},this.#v=()=>{this._hoveredThumb=null},this.#a=e=>{if(this.disabled||e.defaultPrevented)return;let t=e.target;t===this._endThumbEl&&this.startAsNumber===this.max&&this.endAsNumber===this.max&&(t=this._startThumbEl),this.#y(t),this._draggingThumb=this.#_(t),this.#T()},this.#p=e=>{const t=this.#h(e);if(this._visiblyFocusedThumb=t,e.key===c.keyHome)e.preventDefault(),this.#e({[t]:`${this.#s[t].min}`});else if(e.key===c.keyEnd)e.preventDefault(),this.#e({[t]:`${this.#s[t].max}`});else if(!e.shiftKey)switch(e.key){case c.keyArrowRight:case c.keyArrowDown:e.preventDefault(),this.#g(t,p.Increment);break;case c.keyArrowLeft:case c.keyArrowUp:e.preventDefault(),this.#g(t,p.Decrement);break}},this.#n=e=>{if(this.disabled||e.defaultPrevented||!this._draggingThumb)return;const t="TouchEvent"in window&&e instanceof TouchEvent?e.touches[0]:e,n=this.#f(t);this.#e({[this._draggingThumb]:`${this.#u(this._draggingThumb,n)}`})},this.#i=()=>{this._draggingThumb=!1,this.#z()}}#r;startChanged(){this.currentStart=this.start,this.#r||(this.dirtyValue=!0,this.#o()),this.$fastController.isConnected&&this.#l()}initialStartChanged(e,t){t&&!this.dirtyValue&&(this.start=t,this.dirtyValue=!1)}currentStartChanged(){this.start=this.currentStart}get startAsNumber(){return parseFloat(this.start)}set startAsNumber(e){this.start=e.toString()}endChanged(){this.currentEnd=this.end,this.#r||(this.dirtyValue=!0,this.#o()),this.$fastController.isConnected&&this.#l()}initialEndChanged(e,t){t&&!this.dirtyValue&&(this.end=t,this.dirtyValue=!1)}currentEndChanged(){this.end=this.currentEnd}get endAsNumber(){return parseFloat(this.end)}set endAsNumber(e){this.end=e.toString()}#e({start:e,end:t},n=!0){e===this.start&&(e=void 0),t===this.end&&(t=void 0),!(e===void 0&&t===void 0)&&(this.#r=!0,e!==void 0&&(this.start=e),t!==void 0&&(this.end=t),this.#r=!1,n&&(e!==void 0&&this.$emit("input:start"),t!==void 0&&this.$emit("input:end"),this.$emit("input"),this.$emit("change"),this.dirtyValue=!0),this.#o())}#g(e,t){this.#e({[e]:this.#u(e,Number(this[e])+t*this.step).toString()})}orientationChanged(){this.$fastController.isConnected&&this.#l()}nameChanged(e,t){super.nameChanged(e,t),this.#o()}#o(){if(!this.name)this.setFormValue(null);else{const e=new FormData;e.append(this.name,this.start),e.append(this.name,this.end),this.setFormValue(e)}}formResetCallback(){this.#e({start:this.initialStart??this.min.toString(),end:this.initialEnd??this.max.toString()}),super.formResetCallback()}get#t(){return{start:this._startThumbEl,end:this._endThumbEl}}get#s(){return{start:{min:this.min,max:this.endAsNumber},end:{min:this.startAsNumber,max:this.max}}}#_(e){return e===this._startThumbEl?"start":"end"}#h(e){return this.#_(e.target)}#l(){const e=this.#k(this.startAsNumber),t=this.#k(this.endAsNumber),[n,s]=this.orientation===d.Orientation.horizontal?["right","width"]:["bottom","height"],o=`transition: ${this._draggingThumb?"none":"all 0.2s ease"};`;this._startThumbCss=`${n}: ${e}%; ${o}`,this._endThumbCss=`${n}: ${t}%; ${o}`,this._selectedRangeCss=`${n}: ${t}%; ${s}: ${e-t}%; ${o}`}#k(e){return(1-u.inverseLerp(this.min,this.max,e))*100}#f(e){const t=this._trackEl.getBoundingClientRect(),[n,s,o]=this.orientation===d.Orientation.horizontal?[this._trackEl.clientLeft,this._trackEl.clientWidth,e.pageX-document.documentElement.scrollLeft-this.getBoundingClientRect().left]:[t.top,t.bottom,e.pageY-document.documentElement.scrollTop];return u.lerp(this.min,this.max,u.inverseLerp(n,s,o))}#u(e,t){return T.limit(this.#s[e].min,this.#s[e].max,u.roundToStepValue(t-this.min,this.step)+this.min)}#c;#y(e){this.#c=!0,e.focus(),this.#c=!1}_isThumbPopupOpen(e){return this._visiblyFocusedThumb===e||this._hoveredThumb===e||this._draggingThumb===e}connectedCallback(){super.connectedCallback(),this.#e({start:this.start||this.initialStart||this.min.toString(),end:this.end||this.initialEnd||this.max.toString()},!1),this.#$(),this.#l()}disconnectedCallback(){super.disconnectedCallback(),this.#E(),this.#z()}#$(){for(const e of["start","end"])this.#t[e].addEventListener("keydown",this.#p),this.#t[e].addEventListener("mousedown",this.#a,{passive:!0}),this.#t[e].addEventListener("touchstart",this.#a,{passive:!0}),this.#t[e].addEventListener("mouseover",this.#b,{passive:!0}),this.#t[e].addEventListener("mouseout",this.#v,{passive:!0}),this.#t[e].addEventListener("focus",this.#d),this.#t[e].addEventListener("blur",this.#m)}#E(){for(const e of["start","end"])this.#t[e].removeEventListener("keydown",this.#p),this.#t[e].removeEventListener("mousedown",this.#a),this.#t[e].removeEventListener("touchstart",this.#a),this.#t[e].removeEventListener("mouseover",this.#b),this.#t[e].removeEventListener("mouseout",this.#v),this.#t[e].removeEventListener("focus",this.#d),this.#t[e].removeEventListener("blur",this.#m)}_onMouseDown(e){if(this.disabled||this._draggingThumb)return;const t=this.#f(e),n=Math.abs(t-Number(this.start)),s=Math.abs(t-Number(this.end)),o=n<s||n===s&&t<Number(this.start)?"start":"end";this.#e({[o]:`${this.#u(o,t)}`}),this._draggingThumb=o,this.#y(this.#t[o]),this.#T()}#d;#m;#b;#v;#a;#p;#T(){window.addEventListener("mousemove",this.#n,{passive:!0}),window.addEventListener("touchmove",this.#n,{passive:!0}),window.addEventListener("mouseup",this.#i),window.addEventListener("touchend",this.#i),window.document.addEventListener("mouseleave",this.#i)}#z(){window.removeEventListener("mouseup",this.#i),window.document.removeEventListener("mouseleave",this.#i),window.removeEventListener("mousemove",this.#n),window.removeEventListener("touchmove",this.#n),window.removeEventListener("touchend",this.#i)}#n;#i}a([i.observable],r.prototype,"start");a([i.attr({mode:"fromView",attribute:"start"})],r.prototype,"initialStart");a([i.attr({attribute:"current-start"})],r.prototype,"currentStart");a([i.observable],r.prototype,"end");a([i.attr({mode:"fromView",attribute:"end"})],r.prototype,"initialEnd");a([i.attr({attribute:"current-end"})],r.prototype,"currentEnd");a([i.attr({converter:i.nullableNumberConverter})],r.prototype,"min");a([i.attr({converter:i.nullableNumberConverter})],r.prototype,"max");a([i.attr({converter:u.defaultToOneConverter})],r.prototype,"step");a([i.attr],r.prototype,"orientation");a([i.attr({attribute:"aria-start-label"})],r.prototype,"ariaStartLabel");a([i.attr({attribute:"aria-end-label"})],r.prototype,"ariaEndLabel");a([i.attr({mode:"boolean"})],r.prototype,"markers");a([i.attr],r.prototype,"connotation");a([i.attr({mode:"boolean"})],r.prototype,"pin");a([i.observable],r.prototype,"valueTextFormatter");a([i.observable],r.prototype,"_draggingThumb");a([i.observable],r.prototype,"_visiblyFocusedThumb");a([i.observable],r.prototype,"_hoveredThumb");a([i.observable],r.prototype,"_startThumbCss");a([i.observable],r.prototype,"_endThumbCss");a([i.observable],r.prototype,"_selectedRangeCss");const E=({disabled:l,connotation:e})=>_.classNames("control",["disabled",!!l],[`connotation-${e}`,!!e]),g=l=>({_visiblyFocusedThumb:e})=>_.classNames("thumb-container",["focus-visible",e===l]),w=l=>{const e=l.tagFor(h.Popup);return i.html` <template
|
|
1
|
+
"use strict";const h=require("../bundled/definition9.cjs"),i=require("../bundled/vivid-element.cjs"),c=require("../bundled/key-codes.cjs"),k=require("../bundled/form-associated.cjs"),u=require("../bundled/slider.template.cjs"),f=require("../bundled/localized.cjs"),y=require("../bundled/form-element.cjs"),d=require("../bundled/aria.cjs"),T=require("../bundled/numbers.cjs"),m=require("../bundled/ref.cjs"),b=require("../bundled/when.cjs"),_=require("../bundled/class-names.cjs"),z=':host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control.connotation-cta{--_connotation-color-primary: var(--vvd-slider-cta-primary, var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-slider-accent-primary, var(--vvd-color-canvas-text))}.control{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control{--_thumb-size: 12px;--_thumb-interaction-indicator-size: 36px;--_track-start-inset-inline-start: 0;--_track-start-inset-block-start: 0;cursor:pointer;outline:none;user-select:none}.control .positioning-region{position:relative}.control .track{position:absolute;border-radius:4px;background:var(--_track-background-color)}.control .track-start{position:absolute;border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));margin-inline-start:calc(var(--_thumb-size) / 2);min-inline-size:var(--_thumb-size)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);right:0;left:0;block-size:2px}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start: 1px;border-bottom-left-radius:0;border-top-left-radius:0}.control.horizontal .track .mark{position:absolute;block-size:6px;inline-size:100%;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{position:absolute;block-size:100%;inline-size:6px;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start: 1px;border-radius:0}.control.disabled{--_track-background-color: var(--vvd-color-neutral-100);--_track-start-background-color: var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color: var(--vvd-color-neutral-300);--_track-start-background-color: var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{position:absolute;border-radius:50%;block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);outline:none;touch-action:none}.thumb-container.focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--_thumb-interaction-indicator-alpha: .05;border-radius:50%}.control.horizontal .thumb-container{transform:translate(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}@media (hover: hover){.control:not(.disabled) .thumb-container:hover{--_thumb-interaction-indicator-alpha: .12}}.control:not(.disabled) .thumb-container:active{--_thumb-interaction-indicator-alpha: .25}.thumb-container:before{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-interaction-indicator-size);content:"";inline-size:var(--_thumb-interaction-indicator-size);opacity:var(--_thumb-interaction-indicator-alpha, 0);transition:opacity .2s ease-out 0s}.thumb-container:after{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-size);content:"";inline-size:var(--_thumb-size);inset:calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2)}.popup{pointer-events:none}.tooltip{width:auto;padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}:host([internal-part]) .thumb-container{opacity:0;transition:opacity .2s ease}:host([internal-part]) .control.horizontal .track{top:16px;block-size:4px;overflow:hidden}:host([internal-part]) .control:focus .thumb-container{opacity:1}@media (hover: hover){:host([internal-part]) .control:hover .thumb-container{opacity:1}}.control{--_track-start-inset-inline-start: auto;--_track-start-inset-block-start: auto}:host([markers]) .control.horizontal .track-start,:host([markers]) .control.vertical .track-start{--_track-start-inset-inline-start: auto;--_track-start-inset-block-start: auto}';var $=Object.defineProperty,a=(l,e,t,n)=>{for(var s=void 0,o=l.length-1,v;o>=0;o--)(v=l[o])&&(s=v(e,t,s)||s);return s&&$(e,t,s),s};const p={Increment:1,Decrement:-1};class r extends f.Localized(y.FormElement(k.FormAssociated(i.VividElement))){constructor(){super(...arguments),this.#r=!1,this.start="",this.end="",this.min=0,this.max=10,this.step=1,this.orientation=d.Orientation.horizontal,this.ariaStartLabel=null,this.ariaEndLabel=null,this.markers=!1,this.pin=!1,this.valueTextFormatter=e=>parseFloat(e).toLocaleString(this.locale.lang),this.proxy=document.createElement("input"),this._trackEl=null,this._startThumbEl=null,this._endThumbEl=null,this._draggingThumb=!1,this._visiblyFocusedThumb=null,this._hoveredThumb=null,this._startThumbCss="",this._endThumbCss="",this._selectedRangeCss="",this.#c=!1,this.#d=e=>{this.#c||(this._visiblyFocusedThumb=this.#h(e))},this.#m=()=>{this._visiblyFocusedThumb=null},this.#b=e=>{this._hoveredThumb=this.#h(e)},this.#v=()=>{this._hoveredThumb=null},this.#a=e=>{if(this.disabled||e.defaultPrevented)return;let t=e.target;t===this._endThumbEl&&this.startAsNumber===this.max&&this.endAsNumber===this.max&&(t=this._startThumbEl),this.#y(t),this._draggingThumb=this.#_(t),this.#T()},this.#p=e=>{const t=this.#h(e);if(this._visiblyFocusedThumb=t,e.key===c.keyHome)e.preventDefault(),this.#e({[t]:`${this.#s[t].min}`});else if(e.key===c.keyEnd)e.preventDefault(),this.#e({[t]:`${this.#s[t].max}`});else{if(e.shiftKey)return;switch(e.key){case c.keyArrowRight:case c.keyArrowDown:e.preventDefault(),this.#g(t,p.Increment);break;case c.keyArrowLeft:case c.keyArrowUp:e.preventDefault(),this.#g(t,p.Decrement);break}}},this.#n=e=>{if(this.disabled||e.defaultPrevented||!this._draggingThumb)return;const t="TouchEvent"in window&&e instanceof TouchEvent?e.touches[0]:e,n=this.#f(t);this.#e({[this._draggingThumb]:`${this.#u(this._draggingThumb,n)}`})},this.#i=()=>{this._draggingThumb=!1,this.#z()}}#r;startChanged(){this.currentStart=this.start,this.#r||(this.dirtyValue=!0,this.#o()),this.$fastController.isConnected&&this.#l()}initialStartChanged(e,t){t&&!this.dirtyValue&&(this.start=t,this.dirtyValue=!1)}currentStartChanged(){this.start=this.currentStart}get startAsNumber(){return parseFloat(this.start)}set startAsNumber(e){this.start=e.toString()}endChanged(){this.currentEnd=this.end,this.#r||(this.dirtyValue=!0,this.#o()),this.$fastController.isConnected&&this.#l()}initialEndChanged(e,t){t&&!this.dirtyValue&&(this.end=t,this.dirtyValue=!1)}currentEndChanged(){this.end=this.currentEnd}get endAsNumber(){return parseFloat(this.end)}set endAsNumber(e){this.end=e.toString()}#e({start:e,end:t},n=!0){e===this.start&&(e=void 0),t===this.end&&(t=void 0),!(e===void 0&&t===void 0)&&(this.#r=!0,e!==void 0&&(this.start=e),t!==void 0&&(this.end=t),this.#r=!1,n&&(e!==void 0&&this.$emit("input:start"),t!==void 0&&this.$emit("input:end"),this.$emit("input"),this.$emit("change"),this.dirtyValue=!0),this.#o())}#g(e,t){this.#e({[e]:this.#u(e,Number(this[e])+t*this.step).toString()})}orientationChanged(){this.$fastController.isConnected&&this.#l()}nameChanged(e,t){super.nameChanged(e,t),this.#o()}#o(){if(!this.name)this.setFormValue(null);else{const e=new FormData;e.append(this.name,this.start),e.append(this.name,this.end),this.setFormValue(e)}}formResetCallback(){this.#e({start:this.initialStart??this.min.toString(),end:this.initialEnd??this.max.toString()}),super.formResetCallback()}get#t(){return{start:this._startThumbEl,end:this._endThumbEl}}get#s(){return{start:{min:this.min,max:this.endAsNumber},end:{min:this.startAsNumber,max:this.max}}}#_(e){return e===this._startThumbEl?"start":"end"}#h(e){return this.#_(e.target)}#l(){const e=this.#k(this.startAsNumber),t=this.#k(this.endAsNumber),[n,s]=this.orientation===d.Orientation.horizontal?["right","width"]:["bottom","height"],o=`transition: ${this._draggingThumb?"none":"all 0.2s ease"};`;this._startThumbCss=`${n}: ${e}%; ${o}`,this._endThumbCss=`${n}: ${t}%; ${o}`,this._selectedRangeCss=`${n}: ${t}%; ${s}: ${e-t}%; ${o}`}#k(e){return(1-u.inverseLerp(this.min,this.max,e))*100}#f(e){const t=this._trackEl.getBoundingClientRect(),[n,s,o]=this.orientation===d.Orientation.horizontal?[this._trackEl.clientLeft,this._trackEl.clientWidth,e.pageX-document.documentElement.scrollLeft-this.getBoundingClientRect().left]:[t.top,t.bottom,e.pageY-document.documentElement.scrollTop];return u.lerp(this.min,this.max,u.inverseLerp(n,s,o))}#u(e,t){return T.limit(this.#s[e].min,this.#s[e].max,u.roundToStepValue(t-this.min,this.step)+this.min)}#c;#y(e){this.#c=!0,e.focus(),this.#c=!1}_isThumbPopupOpen(e){return this._visiblyFocusedThumb===e||this._hoveredThumb===e||this._draggingThumb===e}connectedCallback(){super.connectedCallback(),this.#e({start:this.start||this.initialStart||this.min.toString(),end:this.end||this.initialEnd||this.max.toString()},!1),this.#$(),this.#l()}disconnectedCallback(){super.disconnectedCallback(),this.#E(),this.#z()}#$(){for(const e of["start","end"])this.#t[e].addEventListener("keydown",this.#p),this.#t[e].addEventListener("mousedown",this.#a,{passive:!0}),this.#t[e].addEventListener("touchstart",this.#a,{passive:!0}),this.#t[e].addEventListener("mouseover",this.#b,{passive:!0}),this.#t[e].addEventListener("mouseout",this.#v,{passive:!0}),this.#t[e].addEventListener("focus",this.#d),this.#t[e].addEventListener("blur",this.#m)}#E(){for(const e of["start","end"])this.#t[e].removeEventListener("keydown",this.#p),this.#t[e].removeEventListener("mousedown",this.#a),this.#t[e].removeEventListener("touchstart",this.#a),this.#t[e].removeEventListener("mouseover",this.#b),this.#t[e].removeEventListener("mouseout",this.#v),this.#t[e].removeEventListener("focus",this.#d),this.#t[e].removeEventListener("blur",this.#m)}_onMouseDown(e){if(this.disabled||this._draggingThumb)return;const t=this.#f(e),n=Math.abs(t-Number(this.start)),s=Math.abs(t-Number(this.end)),o=n<s||n===s&&t<Number(this.start)?"start":"end";this.#e({[o]:`${this.#u(o,t)}`}),this._draggingThumb=o,this.#y(this.#t[o]),this.#T()}#d;#m;#b;#v;#a;#p;#T(){window.addEventListener("mousemove",this.#n,{passive:!0}),window.addEventListener("touchmove",this.#n,{passive:!0}),window.addEventListener("mouseup",this.#i),window.addEventListener("touchend",this.#i),window.document.addEventListener("mouseleave",this.#i)}#z(){window.removeEventListener("mouseup",this.#i),window.document.removeEventListener("mouseleave",this.#i),window.removeEventListener("mousemove",this.#n),window.removeEventListener("touchmove",this.#n),window.removeEventListener("touchend",this.#i)}#n;#i}a([i.observable],r.prototype,"start");a([i.attr({mode:"fromView",attribute:"start"})],r.prototype,"initialStart");a([i.attr({attribute:"current-start"})],r.prototype,"currentStart");a([i.observable],r.prototype,"end");a([i.attr({mode:"fromView",attribute:"end"})],r.prototype,"initialEnd");a([i.attr({attribute:"current-end"})],r.prototype,"currentEnd");a([i.attr({converter:i.nullableNumberConverter})],r.prototype,"min");a([i.attr({converter:i.nullableNumberConverter})],r.prototype,"max");a([i.attr({converter:u.defaultToOneConverter})],r.prototype,"step");a([i.attr],r.prototype,"orientation");a([i.attr({attribute:"aria-start-label"})],r.prototype,"ariaStartLabel");a([i.attr({attribute:"aria-end-label"})],r.prototype,"ariaEndLabel");a([i.attr({mode:"boolean"})],r.prototype,"markers");a([i.attr],r.prototype,"connotation");a([i.attr({mode:"boolean"})],r.prototype,"pin");a([i.observable],r.prototype,"valueTextFormatter");a([i.observable],r.prototype,"_draggingThumb");a([i.observable],r.prototype,"_visiblyFocusedThumb");a([i.observable],r.prototype,"_hoveredThumb");a([i.observable],r.prototype,"_startThumbCss");a([i.observable],r.prototype,"_endThumbCss");a([i.observable],r.prototype,"_selectedRangeCss");const E=({disabled:l,connotation:e})=>_.classNames("control",["disabled",!!l],[`connotation-${e}`,!!e]),g=l=>({_visiblyFocusedThumb:e})=>_.classNames("thumb-container",["focus-visible",e===l]),w=l=>{const e=l.tagFor(h.Popup);return i.html` <template
|
|
2
2
|
@mousedown="${(t,n)=>t._onMouseDown(n.event)}"
|
|
3
3
|
>
|
|
4
4
|
<div class="${E} ${t=>t.orientation}">
|
package/range-slider/index.js
CHANGED
|
@@ -43,7 +43,8 @@ class i extends R(
|
|
|
43
43
|
e.preventDefault(), this.#e({ [t]: `${this.#n[t].min}` });
|
|
44
44
|
else if (e.key === w)
|
|
45
45
|
e.preventDefault(), this.#e({ [t]: `${this.#n[t].max}` });
|
|
46
|
-
else
|
|
46
|
+
else {
|
|
47
|
+
if (e.shiftKey) return;
|
|
47
48
|
switch (e.key) {
|
|
48
49
|
case S:
|
|
49
50
|
case F:
|
|
@@ -54,6 +55,7 @@ class i extends R(
|
|
|
54
55
|
e.preventDefault(), this.#g(t, g.Decrement);
|
|
55
56
|
break;
|
|
56
57
|
}
|
|
58
|
+
}
|
|
57
59
|
}, this.#o = (e) => {
|
|
58
60
|
if (this.disabled || e.defaultPrevented || !this._draggingThumb)
|
|
59
61
|
return;
|