@vonage/vivid 5.2.0 → 5.4.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/accordion-item/definition.cjs +2 -1
- package/accordion-item/definition.js +3 -2
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +2 -2
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/audio-player/definition.cjs +4 -2
- package/audio-player/definition.js +4 -2
- package/audio-player/index.cjs +5 -3
- package/audio-player/index.js +5 -3
- package/badge/definition.js +1 -1
- package/badge/index.cjs +2 -2
- package/badge/index.js +4 -4
- package/banner/definition.js +1 -1
- package/banner/index.cjs +3 -3
- package/banner/index.js +6 -6
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/bundled/affix.cjs +7 -7
- package/bundled/affix.js +5 -5
- 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 +15 -13
- package/bundled/base-color-picker.cjs +13 -0
- package/bundled/base-color-picker.js +194 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +2 -2
- package/bundled/calendar-picker.template.cjs +7 -7
- package/bundled/calendar-picker.template.js +118 -118
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/children.cjs +1 -1
- package/bundled/children.js +28 -20
- package/bundled/definition.cjs +3 -3
- package/bundled/definition.js +38 -38
- package/bundled/definition10.cjs +72 -18
- package/bundled/definition10.js +351 -65
- package/bundled/definition11.cjs +19 -10
- package/bundled/definition11.js +217 -36
- package/bundled/definition12.cjs +10 -1
- package/bundled/definition12.js +38 -14
- package/bundled/definition13.cjs +1 -73
- package/bundled/definition13.js +15 -354
- package/bundled/definition15.cjs +1 -1
- package/bundled/definition15.js +1 -1
- package/bundled/definition16.cjs +2 -2
- package/bundled/definition16.js +8 -8
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +17 -17
- package/bundled/definition19.cjs +23 -24
- package/bundled/definition19.js +151 -163
- package/bundled/definition2.cjs +9 -5
- package/bundled/definition2.js +21 -17
- package/bundled/definition22.cjs +9 -9
- package/bundled/definition22.js +31 -31
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +3 -3
- package/bundled/definition6.js +28 -28
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +6 -6
- package/bundled/definition8.cjs +2 -2
- package/bundled/definition8.js +4 -4
- package/bundled/definition9.cjs +5 -5
- package/bundled/definition9.js +394 -392
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +59 -46
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +3 -3
- package/bundled/host-semantics.cjs +1 -1
- package/bundled/host-semantics.js +48 -34
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +82 -102
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +51 -36
- package/bundled/mixins.cjs +18 -18
- package/bundled/mixins.js +99 -93
- package/bundled/normalize.cjs +1 -0
- package/bundled/normalize.js +7 -0
- package/bundled/picker-field.template.cjs +1 -1
- package/bundled/picker-field.template.js +4 -4
- package/bundled/ref.cjs +1 -1
- package/bundled/ref.js +8 -25
- package/bundled/repeat.cjs +1 -1
- package/bundled/repeat.js +459 -233
- package/bundled/slider.template.cjs +1 -1
- package/bundled/slider.template.js +2 -2
- package/bundled/slotted.cjs +1 -1
- package/bundled/slotted.js +62 -45
- package/bundled/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +5 -5
- package/bundled/vivid-element.cjs +5 -1
- package/bundled/vivid-element.js +2159 -1162
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +8 -7
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +15 -15
- package/calendar-event/index.cjs +1 -1
- package/calendar-event/index.js +1 -1
- package/card/definition.cjs +11 -3
- package/card/definition.js +11 -3
- package/card/index.cjs +19 -11
- package/card/index.js +35 -27
- package/color-picker/definition.cjs +1079 -0
- package/color-picker/definition.js +1073 -0
- package/color-picker/index.cjs +127 -0
- package/color-picker/index.js +726 -0
- package/combobox/definition.cjs +8 -28
- package/combobox/definition.js +10 -30
- package/combobox/index.cjs +7 -7
- package/combobox/index.js +60 -74
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1670 -163
- package/data-grid/definition.cjs +862 -27
- package/data-grid/definition.js +863 -28
- package/data-grid/index.cjs +25 -25
- package/data-grid/index.js +175 -168
- package/date-picker/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/definition.cjs +1 -1
- package/date-range-picker/definition.js +1 -1
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/definition.cjs +1 -1
- package/date-time-picker/definition.js +1 -1
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +4 -0
- package/dial-pad/definition.js +4 -0
- package/dial-pad/index.cjs +3 -3
- package/dial-pad/index.js +42 -39
- package/dialog/definition.cjs +6 -3
- package/dialog/definition.js +6 -3
- package/dialog/index.cjs +22 -19
- package/dialog/index.js +48 -45
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- package/empty-state/definition.cjs +7 -2
- package/empty-state/definition.js +7 -2
- package/empty-state/index.cjs +10 -5
- package/empty-state/index.js +18 -13
- package/fab/definition.js +1 -1
- package/fab/index.cjs +2 -2
- package/fab/index.js +4 -4
- package/file-picker/definition.cjs +2 -2
- package/file-picker/definition.js +3 -3
- package/file-picker/index.cjs +1 -1
- package/file-picker/index.js +4 -4
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/icon/definition.cjs +10 -6
- package/icon/definition.js +10 -6
- package/index.cjs +7 -4
- package/index.js +3 -3
- package/lib/accordion/accordion.d.ts +1 -1
- package/lib/accordion/definition.d.ts +1 -1
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/action-group/action-group.d.ts +2 -2
- package/lib/alert/alert.d.ts +4 -4
- package/lib/audio-player/audio-player.d.ts +3 -3
- package/lib/avatar/avatar.d.ts +2 -2
- package/lib/badge/badge.d.ts +2 -2
- package/lib/banner/banner.d.ts +6 -6
- package/lib/breadcrumb/breadcrumb.d.ts +2 -2
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
- package/lib/button/button.d.ts +6 -6
- package/lib/button/button.template.d.ts +2 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +2 -2
- package/lib/card/card.d.ts +2 -2
- package/lib/checkbox/checkbox.d.ts +12 -12
- package/lib/color-picker/color-picker.d.ts +2420 -0
- package/lib/color-picker/color-picker.template.d.ts +3 -0
- package/lib/color-picker/definition.d.ts +4 -0
- package/lib/color-picker/locale.d.ts +9 -0
- package/lib/combobox/combobox.d.ts +15 -14
- package/lib/combobox/combobox.options.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/data-grid/data-grid-cell.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +3 -4
- package/lib/data-grid/data-grid.d.ts +1 -2
- package/lib/date-picker/date-picker.d.ts +54 -54
- package/lib/date-range-picker/date-range-picker.d.ts +28 -28
- package/lib/date-time-picker/date-time-picker.d.ts +56 -56
- package/lib/dial-pad/dial-pad.d.ts +3 -2
- package/lib/dialog/dialog.d.ts +4 -4
- package/lib/divider/divider.d.ts +3 -3
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +14 -14
- package/lib/header/header.d.ts +2 -2
- package/lib/menu/menu.d.ts +4 -4
- package/lib/menu-item/menu-item-role.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +4 -4
- package/lib/nav/nav.d.ts +2 -2
- package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
- package/lib/nav-item/nav-item.d.ts +4 -4
- package/lib/note/note.d.ts +2 -2
- package/lib/number-field/number-field.d.ts +18 -18
- package/lib/option/option.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/popup/popup.d.ts +1 -1
- package/lib/progress/progress.d.ts +2 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -2
- package/lib/radio/radio.d.ts +6 -6
- package/lib/radio-group/radio-group.d.ts +2 -2
- package/lib/range-slider/range-slider.d.ts +6 -6
- package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
- package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
- package/lib/searchable-select/locale.d.ts +4 -0
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/searchable-select/searchable-select.d.ts +21 -18
- package/lib/select/select.d.ts +19 -17
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/simple-color-picker/locale.d.ts +0 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
- package/lib/slider/slider.d.ts +7 -7
- package/lib/split-button/split-button.d.ts +6 -6
- package/lib/switch/switch.d.ts +4 -4
- package/lib/tab/tab.d.ts +6 -6
- package/lib/tab-panel/tab-panel.d.ts +2 -2
- package/lib/tabs/tabs.d.ts +2 -2
- package/lib/tag/tag.d.ts +6 -6
- package/lib/tag-group/tag-group.d.ts +2 -2
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-area/text-area.d.ts +17 -17
- package/lib/text-field/text-field.d.ts +19 -19
- package/lib/time-picker/time-picker.d.ts +28 -28
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/lib/tree-item/tree-item.d.ts +4 -4
- package/lib/tree-view/tree-view.d.ts +2 -2
- package/lib/video-player/video-player.d.ts +2 -2
- package/locales/de-DE.cjs +17 -2
- package/locales/de-DE.js +17 -2
- package/locales/en-GB.cjs +17 -2
- package/locales/en-GB.js +17 -2
- package/locales/en-US.cjs +17 -2
- package/locales/en-US.js +17 -2
- package/locales/ja-JP.cjs +17 -2
- package/locales/ja-JP.js +17 -2
- package/locales/zh-CN.cjs +17 -2
- package/locales/zh-CN.js +17 -2
- package/menu/definition.cjs +6 -6
- package/menu/definition.js +7 -7
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.js +1 -1
- package/note/index.cjs +2 -2
- package/note/index.js +4 -4
- package/number-field/definition.cjs +1 -1
- package/number-field/definition.js +3 -3
- package/number-field/index.cjs +5 -5
- package/number-field/index.js +21 -21
- package/option/definition.cjs +6 -77
- package/option/definition.js +3 -78
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +34 -8
- package/pagination/definition.cjs +2 -1
- package/pagination/definition.js +2 -1
- package/pagination/index.cjs +12 -12
- package/pagination/index.js +59 -59
- package/popup/definition.cjs +2 -2
- package/popup/definition.js +2 -2
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/radio/definition.cjs +9 -9
- package/radio/definition.js +10 -10
- package/radio-group/definition.cjs +2 -1
- package/radio-group/definition.js +2 -1
- package/radio-group/index.cjs +5 -5
- package/radio-group/index.js +80 -77
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/definition.cjs +3 -4
- package/rich-text-editor/definition.js +3 -4
- package/rich-text-editor/index.cjs +27 -27
- package/rich-text-editor/index.js +1208 -1198
- package/searchable-select/definition.cjs +106 -14
- package/searchable-select/definition.js +107 -15
- package/searchable-select/index.cjs +81 -69
- package/searchable-select/index.js +362 -276
- package/select/definition.cjs +25 -42
- package/select/definition.js +26 -43
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +3 -3
- package/selectable-box/index.js +20 -20
- package/shared/aria/aria-change-subscription.d.ts +0 -1
- package/shared/aria/aria-mixin.d.ts +3 -3
- package/shared/aria/delegate-aria-behavior.d.ts +5 -10
- package/shared/aria/delegates-aria.d.ts +3 -3
- package/shared/aria/host-semantics-behavior.d.ts +5 -8
- package/shared/aria/host-semantics.d.ts +3 -3
- package/shared/color-picker/base-color-picker.d.ts +436 -0
- package/shared/color-picker/index.d.ts +1 -0
- package/shared/color-picker/locale.d.ts +3 -0
- package/shared/color-picker/utils.d.ts +1 -0
- package/shared/deprecation/replaced-props.d.ts +317 -2
- package/shared/design-system/defineVividComponent.d.ts +2 -2
- package/shared/feedback/feedback-message.d.ts +2 -2
- package/shared/feedback/mixins.d.ts +4 -4
- package/shared/foundation/button/button.d.ts +4 -4
- package/shared/foundation/form-associated/form-associated.d.ts +4 -4
- package/shared/foundation/listbox/listbox.d.ts +4 -0
- package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/patterns/affix.d.ts +4 -4
- package/shared/patterns/anchored.d.ts +4 -4
- package/shared/patterns/char-count/char-count.d.ts +2 -2
- package/shared/patterns/form-elements/form-element.d.ts +4 -4
- package/shared/patterns/form-elements/with-contextual-help.d.ts +6 -6
- package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
- package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
- package/shared/patterns/linkable.d.ts +2 -2
- package/shared/patterns/localized.d.ts +2 -2
- package/shared/patterns/trapped-focus.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-picker.d.ts +14 -14
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +14 -14
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-date-picker.d.ts +40 -40
- package/shared/picker-field/mixins/single-value-picker.d.ts +12 -12
- package/shared/picker-field/mixins/time-selection-picker.d.ts +29 -29
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +28 -28
- package/shared/picker-field/picker-field.d.ts +14 -14
- package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
- package/shared/templating/render-in-light-dom.d.ts +13 -12
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/simple-color-picker/definition.cjs +29 -216
- package/simple-color-picker/definition.js +30 -217
- package/simple-color-picker/index.cjs +9 -21
- package/simple-color-picker/index.js +71 -185
- package/slider/definition.cjs +1 -1
- package/slider/definition.js +1 -1
- package/split-button/definition.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -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/index.cjs +2 -2
- package/switch/index.js +4 -4
- package/tab/definition.js +1 -1
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +2 -2
- package/tabs/index.cjs +2 -2
- package/tabs/index.js +16 -16
- package/tag/definition.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/index.cjs +3 -3
- package/text-area/index.js +8 -8
- package/text-field/definition.cjs +2 -2
- package/text-field/definition.js +4 -4
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +2 -2
- package/toggletip/definition.cjs +2 -2
- package/toggletip/definition.js +3 -3
- package/tooltip/definition.cjs +1 -1
- package/tooltip/definition.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +2 -2
- package/tree-view/definition.js +3 -3
- package/tree-view/index.cjs +2 -2
- package/tree-view/index.js +6 -6
- package/unbundled/_commonjsHelpers.cjs +36 -0
- package/unbundled/_commonjsHelpers.js +32 -0
- package/unbundled/affix.cjs +1 -1
- package/unbundled/affix.js +2 -2
- package/unbundled/attribute-binding-behaviour.cjs +11 -10
- package/unbundled/attribute-binding-behaviour.js +11 -10
- package/unbundled/base-color-picker.cjs +278 -0
- package/unbundled/base-color-picker.js +275 -0
- package/unbundled/button.cjs +1 -1
- package/unbundled/button.js +2 -2
- package/unbundled/calendar-picker.template.cjs +4 -4
- package/unbundled/calendar-picker.template.js +5 -5
- package/unbundled/definition.js +1 -1
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +3 -3
- package/unbundled/definition3.cjs +222 -140
- package/unbundled/definition3.js +220 -138
- package/unbundled/definition4.cjs +145 -235
- package/unbundled/definition4.js +143 -233
- package/unbundled/definition5.cjs +269 -27
- package/unbundled/definition5.js +267 -26
- package/unbundled/definition6.cjs +56 -0
- package/unbundled/definition6.js +52 -0
- package/unbundled/delegates-aria.cjs +67 -33
- package/unbundled/delegates-aria.js +69 -35
- package/unbundled/form-associated.cjs +2 -2
- package/unbundled/form-associated.js +3 -3
- package/unbundled/host-semantics.cjs +47 -22
- package/unbundled/host-semantics.js +48 -23
- package/unbundled/listbox.cjs +41 -63
- package/unbundled/listbox.js +39 -61
- package/unbundled/mixins.cjs +34 -27
- package/unbundled/mixins.js +35 -28
- package/unbundled/picker-field.template.cjs +3 -3
- package/unbundled/picker-field.template.js +4 -4
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +4 -4
- package/unbundled/time-selection-picker.template.js +5 -5
- package/unbundled/vivid-element.cjs +22 -15
- package/unbundled/vivid-element.js +23 -15
- package/video-player/definition.cjs +69047 -1
- package/video-player/definition.js +69047 -1
- package/video-player/index.cjs +36 -36
- package/video-player/index.js +1895 -1905
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +719 -224
- package/bundled/option.cjs +0 -1
- package/bundled/option.js +0 -158
- package/unbundled/option.cjs +0 -217
- package/unbundled/option.js +0 -214
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const elevation_definition = require('./definition5.cjs');
|
|
3
|
+
const icon_definition = require('../icon/definition.cjs');
|
|
5
4
|
const vividElement = require('./vivid-element.cjs');
|
|
6
|
-
const fastElement = require('@microsoft/fast-element');
|
|
7
|
-
const dom = require('@floating-ui/dom');
|
|
8
5
|
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
6
|
+
const fastElement = require('@microsoft/fast-element');
|
|
7
|
+
const affix = require('./affix.cjs');
|
|
8
|
+
const hostSemantics = require('./host-semantics.cjs');
|
|
9
|
+
|
|
10
|
+
const styles = ":host(:focus-visible){outline:none}:host([disabled]){cursor:not-allowed}.control{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.control:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.control.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.control.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.control.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}@media (hover: hover){.control.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: transparent}}.control.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: transparent}.control{--_connotation-color-primary: var(--vvd-tree-item-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-tree-item-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-tree-item-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-faint: var(--vvd-tree-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-tree-item-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-tree-item-accent-firm, var(--vvd-color-canvas-text))}.control{position:relative;display:inline-flex;box-sizing:border-box;align-items:center;border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:12px;hyphens:auto;inline-size:100%;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-inline:16px;text-decoration:none;vertical-align:middle;word-break:break-word}@supports (user-select: none){.control{user-select:none}}.control:not(.disabled){cursor:pointer}.control.disabled{pointer-events:none}:host(:focus-visible) .control{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))}:host(:focus-visible) .control:not(.selected){--focus-stroke-gap-color: transparent}.control .text{font:var(--vvd-typography-base)}.expandCollapseButton{display:flex;align-items:center;border-radius:8px;font-size:20px}.expandCollapseButton .expandCollapseIcon{margin:4px}@media (hover: hover){.expandCollapseButton:hover{background-color:var(--vvd-color-neutral-100)}.selected .expandCollapseButton:hover{background-color:var(--vvd-color-neutral-700)}}.items{display:flex;flex-direction:column;gap:4px;margin-block-start:4px;padding-inline-start:48px}slot[name=icon]{font-size:20px;line-height:1}.control:not(.disabled,.selected) slot[name=icon]{color:var(--vvd-color-neutral-600)}";
|
|
9
11
|
|
|
10
12
|
var __defProp = Object.defineProperty;
|
|
11
13
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -16,283 +18,191 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
16
18
|
if (result) __defProp(target, key, result);
|
|
17
19
|
return result;
|
|
18
20
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
const placementStrategyMiddlewares = {
|
|
25
|
-
[PlacementStrategy.Flip]: dom.flip(),
|
|
26
|
-
[PlacementStrategy.AutoPlacementHorizontal]: dom.autoPlacement({
|
|
27
|
-
allowedPlacements: [
|
|
28
|
-
"bottom",
|
|
29
|
-
"top",
|
|
30
|
-
"bottom-start",
|
|
31
|
-
"bottom-end",
|
|
32
|
-
"top-start",
|
|
33
|
-
"top-end"
|
|
34
|
-
]
|
|
35
|
-
}),
|
|
36
|
-
[PlacementStrategy.AutoPlacementVertical]: dom.autoPlacement({
|
|
37
|
-
allowedPlacements: [
|
|
38
|
-
"left",
|
|
39
|
-
"right",
|
|
40
|
-
"left-start",
|
|
41
|
-
"left-end",
|
|
42
|
-
"right-start",
|
|
43
|
-
"right-end"
|
|
44
|
-
]
|
|
45
|
-
})
|
|
46
|
-
};
|
|
47
|
-
class Popup extends vividElement.VividElement {
|
|
21
|
+
function isTreeItemElement(el) {
|
|
22
|
+
return fastWebUtilities.isHTMLElement(el) && (el.getAttribute("role") === "treeitem" || el instanceof TreeItem);
|
|
23
|
+
}
|
|
24
|
+
class TreeItem extends hostSemantics.HostSemantics(affix.AffixIcon(vividElement.VividElement)) {
|
|
48
25
|
constructor() {
|
|
49
26
|
super(...arguments);
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
27
|
+
this.expanded = false;
|
|
28
|
+
this.selected = false;
|
|
29
|
+
this.disabled = false;
|
|
30
|
+
this.focusable = false;
|
|
54
31
|
/**
|
|
55
|
-
*
|
|
32
|
+
* Whether the tree is nested
|
|
56
33
|
*
|
|
57
34
|
* @public
|
|
58
35
|
*/
|
|
59
|
-
this.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
36
|
+
this.isNestedItem = () => {
|
|
37
|
+
return isTreeItemElement(this.parentElement);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Handle expand button click
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
this.handleExpandCollapseButtonClick = (e) => {
|
|
45
|
+
if (!this.disabled && !e.defaultPrevented) {
|
|
46
|
+
this.expanded = !this.expanded;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Handle focus events
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
this.handleFocus = (_e) => {
|
|
55
|
+
this.setAttribute("tabindex", "0");
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Handle blur events
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
this.handleBlur = (_e) => {
|
|
63
|
+
this.setAttribute("tabindex", "-1");
|
|
66
64
|
};
|
|
67
65
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
placementStrategyMiddlewares[this.placementStrategy],
|
|
72
|
-
dom.hide(),
|
|
73
|
-
dom.size({
|
|
74
|
-
apply({ availableWidth, availableHeight, elements }) {
|
|
75
|
-
Object.assign(elements.floating.style, {
|
|
76
|
-
maxWidth: `${availableWidth}px`,
|
|
77
|
-
maxHeight: `${availableHeight}px`
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
];
|
|
82
|
-
let offsetValue = this.offset ?? 0;
|
|
83
|
-
if (this.arrow) {
|
|
84
|
-
offsetValue += 12;
|
|
85
|
-
middleware = [
|
|
86
|
-
...middleware,
|
|
87
|
-
dom.arrow({ element: this.arrowEl, padding: 10 })
|
|
88
|
-
];
|
|
89
|
-
}
|
|
90
|
-
if (offsetValue > 0) {
|
|
91
|
-
middleware.unshift(dom.offset(offsetValue));
|
|
66
|
+
expandedChanged() {
|
|
67
|
+
if (this.$fastController.isConnected) {
|
|
68
|
+
this.$emit("expanded-change", this);
|
|
92
69
|
}
|
|
93
|
-
return middleware;
|
|
94
70
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
this.#updateAutoUpdate();
|
|
99
|
-
this.$emit(newValue ? "vwc-popup:open" : "vwc-popup:close");
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* @internal
|
|
103
|
-
*/
|
|
104
|
-
animationFrameChanged() {
|
|
105
|
-
this.#updateAutoUpdate();
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* @internal
|
|
109
|
-
*/
|
|
110
|
-
anchorChanged() {
|
|
111
|
-
this.#updateAutoUpdate();
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
strategyChanged() {
|
|
117
|
-
this.#togglePopover();
|
|
118
|
-
}
|
|
119
|
-
connectedCallback() {
|
|
120
|
-
super.connectedCallback();
|
|
121
|
-
this.#togglePopover();
|
|
122
|
-
this.#updateAutoUpdate();
|
|
123
|
-
}
|
|
124
|
-
disconnectedCallback() {
|
|
125
|
-
super.disconnectedCallback();
|
|
126
|
-
this.#updateAutoUpdate();
|
|
127
|
-
}
|
|
128
|
-
#updateAutoUpdate() {
|
|
129
|
-
this.#cleanup?.();
|
|
130
|
-
if (this.open && this.controlEl) {
|
|
131
|
-
this.controlEl.classList.add("open");
|
|
132
|
-
}
|
|
133
|
-
if (this.anchorEl && this.open && this.popupEl) {
|
|
134
|
-
this.#cleanup = dom.autoUpdate(
|
|
135
|
-
this.anchorEl,
|
|
136
|
-
this.popupEl,
|
|
137
|
-
this.#autoUpdateCallback,
|
|
138
|
-
{
|
|
139
|
-
animationFrame: this.animationFrame
|
|
140
|
-
}
|
|
141
|
-
);
|
|
71
|
+
selectedChanged() {
|
|
72
|
+
if (this.$fastController.isConnected) {
|
|
73
|
+
this.$emit("selected-change", this);
|
|
142
74
|
}
|
|
143
75
|
}
|
|
144
|
-
|
|
145
|
-
if (this.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
76
|
+
itemsChanged() {
|
|
77
|
+
if (this.$fastController.isConnected) {
|
|
78
|
+
this.items.forEach((node) => {
|
|
79
|
+
if (isTreeItemElement(node)) {
|
|
80
|
+
node.nested = true;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
151
83
|
}
|
|
152
84
|
}
|
|
153
|
-
#lastPositionUpdate;
|
|
154
|
-
#autoUpdateCallback;
|
|
155
85
|
/**
|
|
156
|
-
*
|
|
86
|
+
* Places document focus on a tree item
|
|
157
87
|
*
|
|
158
88
|
* @public
|
|
89
|
+
* @param el - the element to focus
|
|
159
90
|
*/
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
const positionData = await dom.computePosition(this.anchorEl, this.popupEl, {
|
|
165
|
-
placement: this.placement,
|
|
166
|
-
strategy: this.strategy,
|
|
167
|
-
middleware: this.#middleware
|
|
168
|
-
});
|
|
169
|
-
this.#assignPopupPosition(positionData);
|
|
170
|
-
if (this.arrow) {
|
|
171
|
-
this.#assignArrowPosition(positionData);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
#assignPopupPosition(data) {
|
|
175
|
-
const { x: popupX, y: popupY } = data;
|
|
176
|
-
const { referenceHidden } = data.middlewareData.hide;
|
|
177
|
-
Object.assign(this.popupEl.style, {
|
|
178
|
-
left: `${popupX}px`,
|
|
179
|
-
top: `${popupY}px`,
|
|
180
|
-
visibility: referenceHidden ? "hidden" : "visible"
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
#assignArrowPosition(data) {
|
|
184
|
-
const { x: arrowX, y: arrowY } = data.middlewareData.arrow;
|
|
185
|
-
const styles = {
|
|
186
|
-
left: "calc(100% - 4px)",
|
|
187
|
-
right: "-4px",
|
|
188
|
-
top: "calc(100% - 4px)",
|
|
189
|
-
bottom: "-4px"
|
|
190
|
-
};
|
|
191
|
-
const staticAxis = data.placement.split("-")[0];
|
|
192
|
-
Object.assign(this.arrowEl.style, {
|
|
193
|
-
left: arrowX ? `${arrowX}px` : styles[staticAxis],
|
|
194
|
-
top: arrowY ? `${arrowY}px` : styles[staticAxis]
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
get anchorEl() {
|
|
198
|
-
return this.anchor ?? null;
|
|
91
|
+
static focusItem(el) {
|
|
92
|
+
el.focusable = true;
|
|
93
|
+
el.focus();
|
|
199
94
|
}
|
|
200
95
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
96
|
+
* Gets number of children
|
|
97
|
+
*
|
|
98
|
+
* @internal
|
|
203
99
|
*/
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
100
|
+
childItemLength() {
|
|
101
|
+
const treeChildren = this.childItems.filter(
|
|
102
|
+
(item) => {
|
|
103
|
+
return isTreeItemElement(item);
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
return treeChildren.length;
|
|
210
107
|
}
|
|
211
108
|
}
|
|
212
109
|
__decorateClass([
|
|
213
|
-
fastElement.attr
|
|
214
|
-
|
|
215
|
-
})
|
|
216
|
-
], Popup.prototype, "open");
|
|
110
|
+
fastElement.attr
|
|
111
|
+
], TreeItem.prototype, "text");
|
|
217
112
|
__decorateClass([
|
|
218
|
-
fastElement.attr({
|
|
219
|
-
|
|
220
|
-
})
|
|
221
|
-
], Popup.prototype, "dismissible");
|
|
113
|
+
fastElement.attr({ mode: "boolean" })
|
|
114
|
+
], TreeItem.prototype, "expanded");
|
|
222
115
|
__decorateClass([
|
|
223
116
|
fastElement.attr({
|
|
224
117
|
mode: "boolean"
|
|
225
118
|
})
|
|
226
|
-
],
|
|
119
|
+
], TreeItem.prototype, "selected");
|
|
227
120
|
__decorateClass([
|
|
228
|
-
fastElement.attr({
|
|
229
|
-
|
|
230
|
-
})
|
|
231
|
-
], Popup.prototype, "alternate");
|
|
121
|
+
fastElement.attr({ mode: "boolean" })
|
|
122
|
+
], TreeItem.prototype, "disabled");
|
|
232
123
|
__decorateClass([
|
|
233
|
-
fastElement.
|
|
234
|
-
],
|
|
124
|
+
fastElement.observable
|
|
125
|
+
], TreeItem.prototype, "focusable");
|
|
126
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
235
127
|
__decorateClass([
|
|
236
|
-
fastElement.
|
|
237
|
-
],
|
|
128
|
+
fastElement.observable
|
|
129
|
+
], TreeItem.prototype, "childItems");
|
|
238
130
|
__decorateClass([
|
|
239
|
-
fastElement.
|
|
240
|
-
],
|
|
131
|
+
fastElement.observable
|
|
132
|
+
], TreeItem.prototype, "items");
|
|
133
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
241
134
|
__decorateClass([
|
|
242
|
-
fastElement.
|
|
243
|
-
],
|
|
135
|
+
fastElement.observable
|
|
136
|
+
], TreeItem.prototype, "nested");
|
|
137
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
244
138
|
__decorateClass([
|
|
245
139
|
fastElement.observable
|
|
246
|
-
],
|
|
247
|
-
|
|
248
|
-
const styles = ":host{display:var(--_popup-display, inline)}.control{border-radius:inherit;background:var(--vvd-color-surface-4dp);contain:layout}.control:not(.open){display:none}.popup-wrapper{white-space:initial;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.popup-wrapper{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.popup-wrapper ::-webkit-scrollbar{width:4px}.popup-wrapper ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.popup-wrapper ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.popup-wrapper{z-index:var(--_popup-z-index, 10);overflow:visible;padding:0;border:none;border-radius:8px;margin:0;inline-size:max-content}.popup-wrapper:not(.absolute){position:fixed}.popup-wrapper.absolute{position:absolute;top:0;left:0}.popup-content{display:grid;color:var(--vvd-color-canvas-text)}.dismissible .popup-content{align-content:start;grid-template-columns:1fr auto}.arrow{position:absolute;z-index:-1;width:8px;height:8px;background:var(--vvd-color-surface-4dp);transform:rotate(45deg)}.dismissible-button{align-self:flex-start;margin-block-start:4px;margin-inline-end:4px}";
|
|
140
|
+
], TreeItem.prototype, "renderCollapsedChildren");
|
|
249
141
|
|
|
250
|
-
const getClasses = ({
|
|
142
|
+
const getClasses = ({ disabled, selected }) => fastWebUtilities.classNames(
|
|
251
143
|
"control",
|
|
252
|
-
["
|
|
253
|
-
["
|
|
254
|
-
["alternate", Boolean(alternate)]
|
|
144
|
+
["disabled", disabled],
|
|
145
|
+
["selected", Boolean(selected)]
|
|
255
146
|
);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
const popupTemplate = (context) => {
|
|
260
|
-
const elevationTag = context.tagFor(elevation_definition.Elevation);
|
|
261
|
-
const buttonTag = context.tagFor(button_definition.Button);
|
|
147
|
+
const expandCollapseButton = (context) => {
|
|
148
|
+
const iconTag = context.tagFor(icon_definition.VwcIconElement);
|
|
262
149
|
return fastElement.html`
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
150
|
+
<div aria-hidden="true"
|
|
151
|
+
class="expandCollapseButton"
|
|
152
|
+
@click="${(x, c) => x.handleExpandCollapseButtonClick(c.event)}"
|
|
153
|
+
${fastElement.ref("expandCollapseButton")}
|
|
154
|
+
>
|
|
155
|
+
<${iconTag} class="expandCollapseIcon" name="${(x) => x.expanded ? "chevron-down-line" : "chevron-right-line"}"></${iconTag}>
|
|
156
|
+
</div>`;
|
|
157
|
+
};
|
|
158
|
+
const TreeItemTemplate = (context) => {
|
|
159
|
+
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
160
|
+
const treeItemTagName = context.tagFor(TreeItem, true);
|
|
161
|
+
return fastElement.html` <template
|
|
162
|
+
slot="${(x) => x.isNestedItem() ? "item" : void 0}"
|
|
163
|
+
tabindex="-1"
|
|
164
|
+
${hostSemantics.applyHostSemantics({
|
|
165
|
+
role: "treeitem",
|
|
166
|
+
ariaExpanded: (x) => x.childItems && x.childItems.length > 0 ? x.expanded : void 0,
|
|
167
|
+
ariaSelected: (x) => x.selected,
|
|
168
|
+
ariaDisabled: (x) => x.disabled
|
|
169
|
+
})}
|
|
170
|
+
@focusin="${(x, c) => x.handleFocus(c.event)}"
|
|
171
|
+
@focusout="${(x, c) => x.handleBlur(c.event)}"
|
|
172
|
+
${fastElement.children({
|
|
173
|
+
property: "childItems",
|
|
174
|
+
filter: fastElement.elements(treeItemTagName)
|
|
175
|
+
})}
|
|
176
|
+
>
|
|
177
|
+
<div class="${getClasses}">
|
|
178
|
+
${fastElement.when(
|
|
179
|
+
(x) => x.childItems && x.childItems.length > 0,
|
|
180
|
+
expandCollapseButton(context)
|
|
273
181
|
)}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
182
|
+
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
|
|
183
|
+
${(x) => x.text}
|
|
184
|
+
</div>
|
|
185
|
+
${fastElement.when(
|
|
186
|
+
(x) => x.childItems && x.childItems.length > 0 && x.expanded,
|
|
187
|
+
fastElement.html` <div role="group" class="items">
|
|
188
|
+
<slot name="item" ${fastElement.slotted("items")}></slot>
|
|
189
|
+
</div>`
|
|
278
190
|
)}
|
|
279
|
-
|
|
280
|
-
</div>
|
|
281
|
-
</${elevationTag}>`;
|
|
191
|
+
</template>`;
|
|
282
192
|
};
|
|
283
193
|
|
|
284
|
-
const
|
|
285
|
-
"
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
[
|
|
194
|
+
const treeItemDefinition = vividElement.defineVividComponent(
|
|
195
|
+
"tree-item",
|
|
196
|
+
TreeItem,
|
|
197
|
+
TreeItemTemplate,
|
|
198
|
+
[icon_definition.iconDefinition],
|
|
289
199
|
{
|
|
290
200
|
styles
|
|
291
201
|
}
|
|
292
202
|
);
|
|
293
|
-
const
|
|
203
|
+
const registerTreeItem = vividElement.createRegisterFunction(treeItemDefinition);
|
|
294
204
|
|
|
295
|
-
exports.
|
|
296
|
-
exports.
|
|
297
|
-
exports.
|
|
298
|
-
exports.
|
|
205
|
+
exports.TreeItem = TreeItem;
|
|
206
|
+
exports.isTreeItemElement = isTreeItemElement;
|
|
207
|
+
exports.registerTreeItem = registerTreeItem;
|
|
208
|
+
exports.treeItemDefinition = treeItemDefinition;
|