@vonage/vivid 5.1.0 → 5.3.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 +2 -1
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/audio-player/definition.cjs +41 -6
- package/audio-player/definition.js +41 -6
- package/audio-player/index.cjs +27 -25
- package/audio-player/index.js +88 -62
- package/badge/index.cjs +2 -2
- package/badge/index.js +4 -4
- 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 +1 -1
- package/bundled/calendar-picker.template.js +21 -21
- 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 +66 -37
- 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 +17 -14
- package/bundled/definition19.js +85 -77
- 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 +6 -6
- package/bundled/definition6.js +34 -31
- 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 +1 -1
- package/bundled/definition9.js +1 -1
- 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/localized.cjs +1 -1
- package/bundled/localized.js +43 -31
- 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 +18 -13
- package/bundled/picker-field.template.js +45 -37
- 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/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +5 -5
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +2126 -1172
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +8 -7
- package/bundled/with-contextual-help.cjs +1 -1
- package/bundled/with-contextual-help.js +17 -7
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +6 -6
- package/calendar-event/index.cjs +1 -1
- package/calendar-event/index.js +1 -1
- package/card/definition.cjs +10 -2
- package/card/definition.js +10 -2
- 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 +13 -6
- package/combobox/definition.js +14 -7
- package/combobox/index.cjs +15 -11
- package/combobox/index.js +82 -75
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1621 -325
- 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/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +55 -1
- package/dial-pad/definition.js +56 -2
- package/dial-pad/index.cjs +21 -18
- package/dial-pad/index.js +138 -104
- package/dialog/definition.cjs +4 -1
- package/dialog/definition.js +4 -1
- package/dialog/index.cjs +21 -18
- package/dialog/index.js +43 -40
- 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/index.cjs +2 -2
- package/fab/index.js +4 -4
- package/file-picker/definition.cjs +16 -7
- package/file-picker/definition.js +17 -8
- package/file-picker/index.cjs +12 -9
- package/file-picker/index.js +103 -93
- package/icon/definition.cjs +10 -6
- package/icon/definition.js +10 -6
- package/index.cjs +4 -0
- package/index.js +1 -0
- 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 +6 -2
- 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 +495 -78
- 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 +906 -894
- package/lib/date-range-picker/date-range-picker.d.ts +596 -590
- package/lib/date-time-picker/date-time-picker.d.ts +907 -895
- package/lib/dial-pad/dial-pad.d.ts +3 -2
- package/lib/dial-pad/dial-pad.template.d.ts +1 -1
- package/lib/dial-pad/locale.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +4 -4
- package/lib/divider/divider.d.ts +2 -2
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +495 -78
- package/lib/header/header.d.ts +2 -2
- package/lib/menu/menu.d.ts +5 -4
- 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 +19 -18
- package/lib/option/option.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +2 -2
- 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/option-tag.d.ts +2 -2
- package/lib/searchable-select/searchable-select.d.ts +521 -104
- package/lib/select/select.d.ts +484 -67
- 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 +6 -6
- 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/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 -16
- package/lib/text-field/text-field.d.ts +19 -18
- package/lib/time-picker/time-picker.d.ts +579 -573
- 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 +15 -3
- package/locales/de-DE.js +15 -3
- package/locales/en-GB.cjs +15 -3
- package/locales/en-GB.js +15 -3
- package/locales/en-US.cjs +15 -3
- package/locales/en-US.js +15 -3
- package/locales/ja-JP.cjs +15 -3
- package/locales/ja-JP.js +15 -3
- package/locales/zh-CN.cjs +15 -3
- package/locales/zh-CN.js +15 -3
- package/menu/definition.cjs +8 -4
- package/menu/definition.js +9 -5
- package/note/index.cjs +2 -2
- package/note/index.js +4 -4
- package/number-field/definition.cjs +3 -3
- package/number-field/definition.js +4 -4
- package/number-field/index.cjs +8 -8
- package/number-field/index.js +41 -40
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +5 -5
- 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/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/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/definition.cjs +1 -1
- package/rich-text-editor/definition.js +2 -2
- package/rich-text-editor/index.cjs +2 -2
- package/rich-text-editor/index.js +3 -3
- package/searchable-select/definition.cjs +30 -21
- package/searchable-select/definition.js +31 -22
- package/searchable-select/index.cjs +28 -25
- package/searchable-select/index.js +149 -140
- package/select/definition.cjs +15 -7
- package/select/definition.js +16 -8
- 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 +2 -2
- 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/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/index.d.ts +1 -0
- package/shared/patterns/form-elements/with-contextual-help.d.ts +7 -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 +454 -451
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +454 -451
- 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 +600 -594
- package/shared/picker-field/mixins/single-date-picker.d.ts +746 -737
- package/shared/picker-field/mixins/single-value-picker.d.ts +451 -448
- package/shared/picker-field/mixins/time-selection-picker.d.ts +580 -574
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +579 -573
- package/shared/picker-field/picker-field.d.ts +495 -78
- 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 +28 -215
- package/simple-color-picker/definition.js +29 -216
- package/simple-color-picker/index.cjs +9 -21
- package/simple-color-picker/index.js +71 -185
- 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/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/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/text-area/index.cjs +3 -3
- package/text-area/index.js +9 -9
- package/text-field/definition.cjs +3 -3
- package/text-field/definition.js +4 -4
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +2 -2
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +2 -2
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +2 -2
- 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 +1 -1
- 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 +3 -3
- package/unbundled/calendar-picker.template.js +4 -4
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +2 -2
- package/unbundled/definition3.cjs +2 -1
- package/unbundled/definition3.js +2 -1
- 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/mixins.cjs +34 -27
- package/unbundled/mixins.js +35 -28
- package/unbundled/picker-field.template.cjs +13 -5
- package/unbundled/picker-field.template.js +14 -6
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.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/unbundled/with-contextual-help.cjs +11 -0
- package/unbundled/with-contextual-help.js +11 -0
- package/video-player/definition.cjs +69007 -1
- package/video-player/definition.js +69007 -1
- package/video-player/index.cjs +35 -35
- package/video-player/index.js +1358 -1384
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +347 -69
package/bundled/definition7.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { I as h, i as x } from "./definition2.js";
|
|
2
|
-
import { V as y,
|
|
2
|
+
import { V as y, U as _, a as s, o as v, r as k, h as c, c as g, d as $ } from "./vivid-element.js";
|
|
3
3
|
import { h as w, g as C, l as S, f as I } from "./key-codes.js";
|
|
4
4
|
import { b as M, a as E } from "./affix.js";
|
|
5
5
|
import { H as P, a as z } from "./host-semantics.js";
|
|
6
6
|
import { s as m, e as B } from "./slotted.js";
|
|
7
|
-
import { c as D } from "./class-names.js";
|
|
8
7
|
import { w as l } from "./when.js";
|
|
9
|
-
|
|
8
|
+
import { c as T } from "./class-names.js";
|
|
9
|
+
const D = ":host(:focus-visible){outline:none}:host([disabled]){pointer-events:none}.base{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base.connotation-cta{--_connotation-color-primary: var(--vvd-menu-item-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-menu-item-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-menu-item-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-firm: var(--vvd-menu-item-cta-firm, var(--vvd-color-cta-600));--_connotation-color-faint: var(--vvd-menu-item-cta-faint, var(--vvd-color-cta-50));--_connotation-color-soft: var(--vvd-menu-item-cta-soft, var(--vvd-color-cta-100));--_connotation-color-pale: var(--vvd-menu-item-cta-pale, var(--vvd-color-cta-300));--_connotation-color-dim: var(--vvd-menu-item-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-menu-item-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-menu-item-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-menu-item-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-firm: var(--vvd-menu-item-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-menu-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-menu-item-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-menu-item-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-menu-item-accent-dim, var(--vvd-color-neutral-200))}.base{--_menu-item-padding-inline: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) }.base{display: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);inline-size:100%}.base:not(.two-lines){gap:12px;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:8px;padding-inline:var(--_menu-item-padding-inline)}.base.two-lines{gap:16px;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) + 1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:12px;padding-inline:var(--_menu-item-padding-inline)}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}:host(:not([role=presentation]):focus-visible) .base{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}.icon{flex-shrink:0;font-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.action,.decorative{display:flex;place-content:center}.action{color:var(--_appearance-color-text)}.base.trailing .action,.base.has-meta .action{order:2}:host(:not([check-appearance],[checked],[disabled])) .action{color:var(--vvd-color-neutral-500)}.base:not(.disabled) .decorative{color:var(--vvd-color-neutral-600)}.base.disabled .decorative{color:var(--vvd-color-neutral-200)}.base.has-meta .decorative{order:1}.chevron{order:3}.text{display:flex;overflow:hidden;flex-direction:column;gap:4px;margin-inline-end:auto}.text-primary,.text-secondary{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;font:var(--vvd-typography-base)}.text-primary{font:var(--vvd-typography-base);-webkit-line-clamp:var(--text-primary-line-clamp, 1)}.base:not(.disabled) .text-primary{color:var(--vvd-color-canvas-text)}.base.disabled .text-primary{color:var(--_appearance-color-text)}.base.two-lines .text-primary{font:var(--vvd-typography-base-bold)}.text-secondary{color:var(--vvd-color-neutral-800);font:var(--vvd-typography-base-condensed);-webkit-line-clamp:var(--text-secondary-line-clamp, 1)}.base.two-lines .text-secondary{color:var(--vvd-color-neutral-600)}.base.disabled .text-secondary{color:var(--_appearance-color-text)}.base.selected:not(.disabled) .text-secondary{color:var(--vvd-color-neutral-800)}:host([internal-part]) .text-primary{font:var(--_text-primary-custom-size, var--vvd-typography-base)}", u = {
|
|
10
10
|
menuitem: "menuitem",
|
|
11
11
|
menuitemcheckbox: "menuitemcheckbox",
|
|
12
12
|
menuitemradio: "menuitemradio",
|
|
@@ -73,7 +73,7 @@ class n extends P(M(y)) {
|
|
|
73
73
|
* @internal
|
|
74
74
|
*/
|
|
75
75
|
connectedCallback() {
|
|
76
|
-
super.connectedCallback(), _.
|
|
76
|
+
super.connectedCallback(), _.enqueue(() => {
|
|
77
77
|
this._isPresentational = this._isPresentational ?? !0, this.#a();
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -193,7 +193,7 @@ const A = "menu", F = (e) => {
|
|
|
193
193
|
icon: p,
|
|
194
194
|
metaSlottedContent: b,
|
|
195
195
|
checkTrailing: f
|
|
196
|
-
}) =>
|
|
196
|
+
}) => T(
|
|
197
197
|
"base",
|
|
198
198
|
[`connotation-${e}`, !!e],
|
|
199
199
|
["disabled", !!a],
|
|
@@ -276,7 +276,7 @@ const V = (e) => {
|
|
|
276
276
|
V,
|
|
277
277
|
[x],
|
|
278
278
|
{
|
|
279
|
-
styles:
|
|
279
|
+
styles: D
|
|
280
280
|
}
|
|
281
281
|
), X = g(K);
|
|
282
282
|
export {
|
package/bundled/definition8.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const v=require("./definition2.cjs"),o=require("./vivid-element.cjs"),p=require("./mixins.cjs"),h=require("./delegates-aria.cjs"),x=require("./form-associated.cjs"),f=require("./with-error-text.cjs"),k=require("./with-success-text.cjs"),y=require("./form-element.cjs"),
|
|
1
|
+
"use strict";const v=require("./definition2.cjs"),o=require("./vivid-element.cjs"),p=require("./mixins.cjs"),h=require("./delegates-aria.cjs"),x=require("./form-associated.cjs"),f=require("./with-error-text.cjs"),k=require("./with-success-text.cjs"),y=require("./form-element.cjs"),d=require("./when.cjs"),_=require("./slotted.cjs"),g=require("./class-names.cjs"),C=':host{display:inline-flex;flex-direction:column;gap:4px;vertical-align:middle;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary: var(--vvd-checkbox-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-checkbox-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-checkbox-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-intermediate: var(--vvd-checkbox-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-checkbox-cta-firm, var(--vvd-color-cta-600))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-checkbox-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-checkbox-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-checkbox-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-intermediate: var(--vvd-checkbox-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-checkbox-accent-firm, var(--vvd-color-canvas-text))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-500)}@media (hover: hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}.base:checked:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base.checked:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}@media (hover: hover){.base:checked: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: var(--_connotation-color-primary-increment)}}.base.checked.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: var(--_connotation-color-primary-increment)}.base:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.readonly:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base{display:inline-flex;align-items:center;gap:8px;vertical-align:middle}.base:focus-visible{outline:none}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}.base.disabled{pointer-events:none}.control{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);color:var(--_appearance-color-text);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:focus-visible .control{--focus-stroke-gap-color: transparent}.base:focus-visible .control:after{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));position:absolute;display:block;border-radius:var(--focus-border-radius, inherit);block-size:calc(100% + var(--focus-block-size-addition, 4px));content:"";inline-size:calc(100% + var(--focus-block-size-addition, 4px));inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.base.error:not(.checked) .control{background-color:var(--vvd-color-canvas);box-shadow:inset 0 0 0 2px var(--vvd-color-alert-500)}.indicator{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - 4px)}.base:not(.checked) .indicator.checkmark{display:none}.base.checked .indicator.minus,.base:not(.indeterminate) .indicator.minus{display:none}label{display:flex;flex-wrap:wrap;align-items:center;color:var(--vvd-color-canvas-text);column-gap:4px;cursor:pointer;font:var(--vvd-typography-base)}.hide-label label{display:none}.icon{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2))*.6);line-height:1}';var w=Object.defineProperty,i=(r,a,e,c)=>{for(var t=void 0,l=r.length-1,s;l>=0;l--)(s=r[l])&&(t=s(a,e,t)||t);return t&&w(a,e,t),t};const $=" ";class n extends h.DelegatesAria(p.WithFeedback(f.WithErrorText(k.WithSuccessText(y.FormElement(x.CheckableFormAssociated(o.VividElement)))))){constructor(){super(),this.tabindex=null,this.proxy=document.createElement("input"),this.initialValue="on",this.defaultSlottedNodes=[],this.indeterminate=!1,this.keypressHandler=a=>{if(a.target instanceof HTMLAnchorElement)return!0;if(!this.disabled&&!this.readOnly)switch(a.key){case $:this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked;break}return!1},this.clickHandler=a=>a.target instanceof HTMLAnchorElement?!0:(!this.disabled&&!this.readOnly&&(this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked),!1),this.proxy.setAttribute("type","checkbox")}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly)}ariaCheckedChanged(a,e){super.ariaCheckedChanged(a,e),this.ariaChecked==="mixed"?this.indeterminate=!0:(this.indeterminate=!1,this.checked=this.ariaChecked==="true")}checkedChanged(a,e){super.checkedChanged(a,e),this.ariaChecked=e==!0?"true":"false",a!==void 0&&this.$emit("input")}}i([o.attr({attribute:"tabindex"})],n.prototype,"tabindex");i([o.attr],n.prototype,"connotation");i([o.attr({attribute:"readonly",mode:"boolean"})],n.prototype,"readOnly");i([o.observable],n.prototype,"defaultSlottedNodes");i([o.attr({attribute:"indeterminate",mode:"boolean"})],n.prototype,"indeterminate");i([o.observable],n.prototype,"slottedContent");const q=({connotation:r,readOnly:a,checked:e,disabled:c,indeterminate:t,errorValidationMessage:l,successText:s,label:u,slottedContent:m})=>g.classNames("base",[`connotation-${r}`,!!r],["readonly",!!a],["checked",!!e||!!t],["disabled",!!c],["error connotation-alert",!!l],["success connotation-success",!!s],["hide-label",!u&&!m?.length]),z=r=>{const a=r.tagFor(v.Icon);return o.html`<template>
|
|
2
2
|
<div
|
|
3
3
|
class="${q}"
|
|
4
4
|
aria-describedby="${e=>e._feedbackDescribedBy}"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
${d.when(e=>e.indeterminate,o.html`<${a} name="minus-solid" class="icon"></${a}>`)}
|
|
13
13
|
</div>
|
|
14
14
|
${o.html`<label
|
|
15
|
-
>${e=>e.label}<slot ${
|
|
15
|
+
>${e=>e.label}<slot ${_.slotted("slottedContent")}></slot
|
|
16
16
|
></label>`}
|
|
17
17
|
</div>
|
|
18
18
|
${e=>e._getFeedbackTemplate(r)}
|
package/bundled/definition8.js
CHANGED
|
@@ -6,9 +6,9 @@ import { C as w } from "./form-associated.js";
|
|
|
6
6
|
import { W as $ } from "./with-error-text.js";
|
|
7
7
|
import { W as z } from "./with-success-text.js";
|
|
8
8
|
import { F as O } from "./form-element.js";
|
|
9
|
-
import { c as F } from "./class-names.js";
|
|
10
9
|
import { w as v } from "./when.js";
|
|
11
|
-
import { s as
|
|
10
|
+
import { s as F } from "./slotted.js";
|
|
11
|
+
import { c as T } from "./class-names.js";
|
|
12
12
|
const B = ':host{display:inline-flex;flex-direction:column;gap:4px;vertical-align:middle;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary: var(--vvd-checkbox-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-checkbox-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-checkbox-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-intermediate: var(--vvd-checkbox-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-checkbox-cta-firm, var(--vvd-color-cta-600))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-checkbox-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-checkbox-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-checkbox-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-intermediate: var(--vvd-checkbox-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-checkbox-accent-firm, var(--vvd-color-canvas-text))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-500)}@media (hover: hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}.base:checked:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base.checked:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}@media (hover: hover){.base:checked: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: var(--_connotation-color-primary-increment)}}.base.checked.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: var(--_connotation-color-primary-increment)}.base:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.readonly:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base{display:inline-flex;align-items:center;gap:8px;vertical-align:middle}.base:focus-visible{outline:none}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}.base.disabled{pointer-events:none}.control{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);color:var(--_appearance-color-text);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:focus-visible .control{--focus-stroke-gap-color: transparent}.base:focus-visible .control:after{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));position:absolute;display:block;border-radius:var(--focus-border-radius, inherit);block-size:calc(100% + var(--focus-block-size-addition, 4px));content:"";inline-size:calc(100% + var(--focus-block-size-addition, 4px));inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.base.error:not(.checked) .control{background-color:var(--vvd-color-canvas);box-shadow:inset 0 0 0 2px var(--vvd-color-alert-500)}.indicator{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - 4px)}.base:not(.checked) .indicator.checkmark{display:none}.base.checked .indicator.minus,.base:not(.indeterminate) .indicator.minus{display:none}label{display:flex;flex-wrap:wrap;align-items:center;color:var(--vvd-color-canvas-text);column-gap:4px;cursor:pointer;font:var(--vvd-typography-base)}.hide-label label{display:none}.icon{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2))*.6);line-height:1}';
|
|
13
13
|
var D = Object.defineProperty, c = (o, a, e, n) => {
|
|
14
14
|
for (var r = void 0, i = o.length - 1, l; i >= 0; i--)
|
|
@@ -84,7 +84,7 @@ const H = ({
|
|
|
84
84
|
successText: l,
|
|
85
85
|
label: b,
|
|
86
86
|
slottedContent: h
|
|
87
|
-
}) =>
|
|
87
|
+
}) => T(
|
|
88
88
|
"base",
|
|
89
89
|
[`connotation-${o}`, !!o],
|
|
90
90
|
["readonly", !!a],
|
|
@@ -121,7 +121,7 @@ const H = ({
|
|
|
121
121
|
)}
|
|
122
122
|
</div>
|
|
123
123
|
${s`<label
|
|
124
|
-
>${(e) => e.label}<slot ${
|
|
124
|
+
>${(e) => e.label}<slot ${F("slottedContent")}></slot
|
|
125
125
|
></label>`}
|
|
126
126
|
</div>
|
|
127
127
|
${(e) => e._getFeedbackTemplate(o)}
|
package/bundled/definition9.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Vt=require("./definition3.cjs"),Ht=require("./definition4.cjs"),S=require("./vivid-element.cjs"),ht=require("./ref.cjs"),Jt=require("./class-names.cjs"),Pt=require("./when.cjs"),Mt=["top","right","bottom","left"],At=["start","end"],Et=Mt.reduce((t,e)=>t.concat(e,e+"-"+At[0],e+"-"+At[1]),[]),N=Math.min,C=Math.max,ct=Math.round,lt=Math.floor,Y=t=>({x:t,y:t}),Qt={left:"right",right:"left",bottom:"top",top:"bottom"},Zt={start:"end",end:"start"};function te(t,e,n){return C(t,N(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function M(t){return t.split("-")[1]}function ee(t){return t==="x"?"y":"x"}function wt(t){return t==="y"?"height":"width"}const ne=new Set(["top","bottom"]);function X(t){return ne.has(_(t))?"y":"x"}function vt(t){return ee(X(t))}function Nt(t,e,n){n===void 0&&(n=!1);const o=M(t),i=vt(t),r=wt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ft(s)),[s,ft(s)]}function oe(t){const e=ft(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>Zt[e])}const Ct=["left","right"],St=["right","left"],ie=["top","bottom"],re=["bottom","top"];function se(t,e,n){switch(t){case"top":case"bottom":return n?e?St:Ct:e?Ct:St;case"left":case"right":return e?ie:re;default:return[]}}function le(t,e,n,o){const i=M(t);let r=se(_(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(at)))),r}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Qt[e])}function ce(t){return{top:0,right:0,bottom:0,left:0,...t}}function yt(t){return typeof t!="number"?ce(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Tt(t,e,n){let{reference:o,floating:i}=t;const r=X(e),s=vt(e),l=wt(s),c=_(e),a=r==="y",p=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,d=o[l]/2-i[l]/2;let u;switch(c){case"top":u={x:p,y:o.y-i.height};break;case"bottom":u={x:p,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:f};break;case"left":u={x:o.x-i.width,y:f};break;default:u={x:o.x,y:o.y}}switch(M(e)){case"start":u[s]-=d*(n&&a?-1:1);break;case"end":u[s]+=d*(n&&a?-1:1);break}return u}const ae=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:f}=Tt(a,o,c),d=o,u={},m=0;for(let h=0;h<l.length;h++){const{name:g,fn:w}=l[h],{x:y,y:x,data:R,reset:b}=await w({x:p,y:f,initialPlacement:o,placement:d,strategy:i,middlewareData:u,rects:a,platform:s,elements:{reference:t,floating:e}});p=y??p,f=x??f,u={...u,[g]:{...u[g],...R}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(a=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:p,y:f}=Tt(a,d,c)),h=-1)}return{x:p,y:f,placement:d,strategy:i,middlewareData:u}};async function it(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:d=!1,padding:u=0}=J(e,t),m=yt(u),g=l[d?f==="floating"?"reference":"floating":f],w=tt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:a,rootBoundary:p,strategy:c})),y=f==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),R=await(r.isElement==null?void 0:r.isElement(x))?await(r.getScale==null?void 0:r.getScale(x))||{x:1,y:1}:{x:1,y:1},b=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(w.top-b.top+m.top)/R.y,bottom:(b.bottom-w.bottom+m.bottom)/R.y,left:(w.left-b.left+m.left)/R.x,right:(b.right-w.right+m.right)/R.x}}const fe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:l,middlewareData:c}=e,{element:a,padding:p=0}=J(t,e)||{};if(a==null)return{};const f=yt(p),d={x:n,y:o},u=vt(i),m=wt(u),h=await s.getDimensions(a),g=u==="y",w=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",R=r.reference[m]+r.reference[u]-d[u]-r.floating[m],b=d[u]-r.reference[u],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let O=P?P[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(P)))&&(O=l.floating[x]||r.floating[m]);const B=R/2-b/2,T=O/2-h[m]/2-1,v=N(f[w],T),A=N(f[y],T),L=v,D=O-h[m]-A,E=O/2-h[m]/2+B,H=te(L,E,D),V=!c.arrow&&M(i)!=null&&E!==H&&r.reference[m]/2-(E<L?v:A)-h[m]/2<0,k=V?E<L?E-L:E-D:0;return{[u]:d[u]+k,data:{[u]:H,centerOffset:E-H-k,...V&&{alignmentOffset:k}},reset:V}}});function ue(t,e,n){return(t?[...n.filter(i=>M(i)===t),...n.filter(i=>M(i)!==t)]:n.filter(i=>_(i)===i)).filter(i=>t?M(i)===t||(e?at(i)!==i:!1):!0)}const pe=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:l,platform:c,elements:a}=e,{crossAxis:p=!1,alignment:f,allowedPlacements:d=Et,autoAlignment:u=!0,...m}=J(t,e),h=f!==void 0||d===Et?ue(f||null,u,d):d,g=await it(e,m),w=((n=s.autoPlacement)==null?void 0:n.index)||0,y=h[w];if(y==null)return{};const x=Nt(y,r,await(c.isRTL==null?void 0:c.isRTL(a.floating)));if(l!==y)return{reset:{placement:h[0]}};const R=[g[_(y)],g[x[0]],g[x[1]]],b=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:R}],P=h[w+1];if(P)return{data:{index:w+1,overflows:b},reset:{placement:P}};const O=b.map(v=>{const A=M(v.placement);return[v.placement,A&&p?v.overflows.slice(0,2).reduce((L,D)=>L+D,0):v.overflows[0],v.overflows]}).sort((v,A)=>v[1]-A[1]),T=((i=O.filter(v=>v[2].slice(0,M(v[0])?2:3).every(A=>A<=0))[0])==null?void 0:i[0])||O[0][0];return T!==l?{data:{index:w+1,overflows:b},reset:{placement:T}}:{}}}},de=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=J(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=_(i),y=X(l),x=_(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(a.floating)),b=d||(x||!h?[ft(l)]:oe(l)),P=m!=="none";!d&&P&&b.push(...le(l,h,m,R));const O=[l,...b],B=await it(e,g),T=[];let v=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&T.push(B[w]),f){const E=Nt(i,s,R);T.push(B[E[0]],B[E[1]])}if(v=[...v,{placement:i,overflows:T}],!T.every(E=>E<=0)){var A,L;const E=(((A=r.flip)==null?void 0:A.index)||0)+1,H=O[E];if(H&&(!(f==="alignment"?y!==X(H):!1)||v.every($=>X($.placement)===y?$.overflows[0]>0:!0)))return{data:{index:E,overflows:v},reset:{placement:H}};let V=(L=v.filter(k=>k.overflows[0]<=0).sort((k,$)=>k.overflows[1]-$.overflows[1])[0])==null?void 0:L.placement;if(!V)switch(u){case"bestFit":{var D;const k=(D=v.filter($=>{if(P){const K=X($.placement);return K===y||K==="y"}return!0}).map($=>[$.placement,$.overflows.filter(K=>K>0).reduce((K,Gt)=>K+Gt,0)]).sort(($,K)=>$[1]-K[1])[0])==null?void 0:D[0];k&&(V=k);break}case"initialPlacement":V=l;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function Lt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dt(t){return Mt.some(e=>t[e]>=0)}const he=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=J(t,e);switch(o){case"referenceHidden":{const r=await it(e,{...i,elementContext:"reference"}),s=Lt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Dt(s)}}}case"escaped":{const r=await it(e,{...i,altBoundary:!0}),s=Lt(r,n.floating);return{data:{escapedOffsets:s,escaped:Dt(s)}}}default:return{}}}}};function _t(t){const e=N(...t.map(r=>r.left)),n=N(...t.map(r=>r.top)),o=C(...t.map(r=>r.right)),i=C(...t.map(r=>r.bottom));return{x:e,y:n,width:o-e,height:i-n}}function me(t){const e=t.slice().sort((i,r)=>i.y-r.y),n=[];let o=null;for(let i=0;i<e.length;i++){const r=e[i];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(i=>tt(_t(i)))}const ge=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:l=2,x:c,y:a}=J(t,e),p=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(o.reference))||[]),f=me(p),d=tt(_t(p)),u=yt(l);function m(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&a!=null)return f.find(g=>c>g.left-u.left&&c<g.right+u.right&&a>g.top-u.top&&a<g.bottom+u.bottom)||d;if(f.length>=2){if(X(n)==="y"){const v=f[0],A=f[f.length-1],L=_(n)==="top",D=v.top,E=A.bottom,H=L?v.left:A.left,V=L?v.right:A.right,k=V-H,$=E-D;return{top:D,bottom:E,left:H,right:V,width:k,height:$,x:H,y:D}}const g=_(n)==="left",w=C(...f.map(v=>v.right)),y=N(...f.map(v=>v.left)),x=f.filter(v=>g?v.left===y:v.right===w),R=x[0].top,b=x[x.length-1].bottom,P=y,O=w,B=O-P,T=b-R;return{top:R,bottom:b,left:P,right:O,width:B,height:T,x:P,y:R}}return d}const h=await r.getElementRects({reference:{getBoundingClientRect:m},floating:o.floating,strategy:s});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},we=new Set(["left","top"]);async function ve(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=_(n),l=M(n),c=X(n)==="y",a=we.has(s)?-1:1,p=r&&c?-1:1,f=J(e,t);let{mainAxis:d,crossAxis:u,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof m=="number"&&(u=l==="end"?m*-1:m),c?{x:u*p,y:d*a}:{x:d*a,y:u*p}}const ye=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,c=await ve(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},xe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:l}=e,{apply:c=()=>{},...a}=J(t,e),p=await it(e,a),f=_(i),d=M(i),u=X(i)==="y",{width:m,height:h}=r.floating;let g,w;f==="top"||f==="bottom"?(g=f,w=d===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,g=d==="end"?"top":"bottom");const y=h-p.top-p.bottom,x=m-p.left-p.right,R=N(h-p[g],y),b=N(m-p[w],x),P=!e.middlewareData.shift;let O=R,B=b;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(O=y),P&&!d){const v=C(p.left,0),A=C(p.right,0),L=C(p.top,0),D=C(p.bottom,0);u?B=m-2*(v!==0||A!==0?v+A:C(p.left,p.right)):O=h-2*(L!==0||D!==0?L+D:C(p.top,p.bottom))}await c({...e,availableWidth:B,availableHeight:O});const T=await s.getDimensions(l.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function nt(t){return Wt(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function I(t){var e;return(e=(Wt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Wt(t){return ut()?t instanceof Node||t instanceof F(t).Node:!1}function W(t){return ut()?t instanceof Element||t instanceof F(t).Element:!1}function q(t){return ut()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function kt(t){return!ut()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}const be=new Set(["inline","contents"]);function st(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!be.has(i)}const Re=new Set(["table","td","th"]);function Oe(t){return Re.has(nt(t))}const Pe=[":popover-open",":modal"];function pt(t){return Pe.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ae=["transform","translate","scale","rotate","perspective"],Ee=["transform","translate","scale","rotate","perspective","filter"],Ce=["paint","layout","strict","content"];function xt(t){const e=bt(),n=W(t)?z(t):t;return Ae.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ee.some(o=>(n.willChange||"").includes(o))||Ce.some(o=>(n.contain||"").includes(o))}function Se(t){let e=G(t);for(;q(e)&&!et(e);){if(xt(e))return e;if(pt(e))return null;e=G(e)}return null}function bt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Te=new Set(["html","body","#document"]);function et(t){return Te.has(nt(t))}function z(t){return F(t).getComputedStyle(t)}function dt(t){return W(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if(nt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||I(t);return kt(e)?e.host:e}function zt(t){const e=G(t);return et(e)?t.ownerDocument?t.ownerDocument.body:t.body:q(e)&&st(e)?e:zt(e)}function rt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=zt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=F(i);if(r){const l=gt(s);return e.concat(s,s.visualViewport||[],st(i)?i:[],l&&n?rt(l):[])}return e.concat(i,rt(i,[],n))}function gt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function jt(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=ct(n)!==r||ct(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Rt(t){return W(t)?t:t.contextElement}function Z(t){const e=Rt(t);if(!q(e))return Y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=jt(e);let s=(r?ct(n.width):n.width)/o,l=(r?ct(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Le=Y(0);function Yt(t){const e=F(t);return!bt()||!e.visualViewport?Le:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function De(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==F(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Rt(t);let s=Y(1);e&&(o?W(o)&&(s=Z(o)):s=Z(t));const l=De(r,n,o)?Yt(r):Y(0);let c=(i.left+l.x)/s.x,a=(i.top+l.y)/s.y,p=i.width/s.x,f=i.height/s.y;if(r){const d=F(r),u=o&&W(o)?F(o):o;let m=d,h=gt(m);for(;h&&o&&u!==m;){const g=Z(h),w=h.getBoundingClientRect(),y=z(h),x=w.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,R=w.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,a*=g.y,p*=g.x,f*=g.y,c+=x,a+=R,m=F(h),h=gt(m)}}return tt({width:p,height:f,x:c,y:a})}function Ot(t,e){const n=dt(t).scrollLeft;return e?e.left+n:Q(I(t)).left+n}function qt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Ot(t,o)),r=o.top+e.scrollTop;return{x:i,y:r}}function ke(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=I(o),l=e?pt(e.floating):!1;if(o===s||l&&r)return n;let c={scrollLeft:0,scrollTop:0},a=Y(1);const p=Y(0),f=q(o);if((f||!f&&!r)&&((nt(o)!=="body"||st(s))&&(c=dt(o)),q(o))){const u=Q(o);a=Z(o),p.x=u.x+o.clientLeft,p.y=u.y+o.clientTop}const d=s&&!f&&!r?qt(s,c,!0):Y(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+p.x+d.x,y:n.y*a.y-c.scrollTop*a.y+p.y+d.y}}function $e(t){return Array.from(t.getClientRects())}function Fe(t){const e=I(t),n=dt(t),o=t.ownerDocument.body,i=C(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=C(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ot(t);const l=-n.scrollTop;return z(o).direction==="rtl"&&(s+=C(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}function Be(t,e){const n=F(t),o=I(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,c=0;if(i){r=i.width,s=i.height;const a=bt();(!a||a&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:r,height:s,x:l,y:c}}const Ve=new Set(["absolute","fixed"]);function He(t,e){const n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=q(t)?Z(t):Y(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,c=i*r.x,a=o*r.y;return{width:s,height:l,x:c,y:a}}function $t(t,e,n){let o;if(e==="viewport")o=Be(t,n);else if(e==="document")o=Fe(I(t));else if(W(e))o=He(e,n);else{const i=Yt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(o)}function It(t,e){const n=G(t);return n===e||!W(n)||et(n)?!1:z(n).position==="fixed"||It(n,e)}function Me(t,e){const n=e.get(t);if(n)return n;let o=rt(t,[],!1).filter(l=>W(l)&&nt(l)!=="body"),i=null;const r=z(t).position==="fixed";let s=r?G(t):t;for(;W(s)&&!et(s);){const l=z(s),c=xt(s);!c&&l.position==="fixed"&&(i=null),(r?!c&&!i:!c&&l.position==="static"&&!!i&&Ve.has(i.position)||st(s)&&!c&&It(t,s))?o=o.filter(p=>p!==s):i=l,s=G(s)}return e.set(t,o),o}function Ne(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pt(e)?[]:Me(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((a,p)=>{const f=$t(e,p,i);return a.top=C(f.top,a.top),a.right=N(f.right,a.right),a.bottom=N(f.bottom,a.bottom),a.left=C(f.left,a.left),a},$t(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _e(t){const{width:e,height:n}=jt(t);return{width:e,height:n}}function We(t,e,n){const o=q(e),i=I(e),r=n==="fixed",s=Q(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const c=Y(0);function a(){c.x=Ot(i)}if(o||!o&&!r)if((nt(e)!=="body"||st(i))&&(l=dt(e)),o){const u=Q(e,!0,r,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else i&&a();r&&!o&&i&&a();const p=i&&!o&&!r?qt(i,l):Y(0),f=s.left+l.scrollLeft-c.x-p.x,d=s.top+l.scrollTop-c.y-p.y;return{x:f,y:d,width:s.width,height:s.height}}function mt(t){return z(t).position==="static"}function Ft(t,e){if(!q(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return I(t)===n&&(n=n.ownerDocument.body),n}function Xt(t,e){const n=F(t);if(pt(t))return n;if(!q(t)){let i=G(t);for(;i&&!et(i);){if(W(i)&&!mt(i))return i;i=G(i)}return n}let o=Ft(t,e);for(;o&&Oe(o)&&mt(o);)o=Ft(o,e);return o&&et(o)&&mt(o)&&!xt(o)?n:o||Se(t)||n}const ze=async function(t){const e=this.getOffsetParent||Xt,n=this.getDimensions,o=await n(t.floating);return{reference:We(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function je(t){return z(t).direction==="rtl"}const Ye={convertOffsetParentRelativeRectToViewportRelativeRect:ke,getDocumentElement:I,getClippingRect:Ne,getOffsetParent:Xt,getElementRects:ze,getClientRects:$e,getDimensions:_e,getScale:Z,isElement:W,isRTL:je};function Ut(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qe(t,e){let n=null,o;const i=I(t);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),r();const a=t.getBoundingClientRect(),{left:p,top:f,width:d,height:u}=a;if(l||e(),!d||!u)return;const m=lt(f),h=lt(i.clientWidth-(p+d)),g=lt(i.clientHeight-(f+u)),w=lt(p),x={rootMargin:-m+"px "+-h+"px "+-g+"px "+-w+"px",threshold:C(0,N(1,c))||1};let R=!0;function b(P){const O=P[0].intersectionRatio;if(O!==c){if(!R)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Ut(a,t.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(b,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(t)}return s(!0),r}function Ie(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,a=Rt(t),p=i||r?[...a?rt(a):[],...rt(e)]:[];p.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const f=a&&l?qe(a,n):null;let d=-1,u=null;s&&(u=new ResizeObserver(w=>{let[y]=w;y&&y.target===a&&u&&(u.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=u)==null||x.observe(e)})),n()}),a&&!c&&u.observe(a),u.observe(e));let m,h=c?Q(t):null;c&&g();function g(){const w=Q(t);h&&!Ut(h,w)&&n(),h=w,m=requestAnimationFrame(g)}return n(),()=>{var w;p.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),f?.(),(w=u)==null||w.disconnect(),u=null,c&&cancelAnimationFrame(m)}}const Xe=ye,Bt=pe,Ue=de,Ke=xe,Ge=he,Je=fe,Qe=ge,Ze=(t,e,n)=>{const o=new Map,i={platform:Ye,...n},r={...i.platform,_c:o};return ae(t,e,{...i,platform:r})};var tn=Object.defineProperty,U=(t,e,n,o)=>{for(var i=void 0,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=s(e,n,i)||i);return i&&tn(e,n,i),i};const ot={Flip:"flip",AutoPlacementHorizontal:"auto-placement-horizontal",AutoPlacementVertical:"auto-placement-vertical"},en={[ot.Flip]:Ue(),[ot.AutoPlacementHorizontal]:Bt({allowedPlacements:["bottom","top","bottom-start","bottom-end","top-start","top-end"]}),[ot.AutoPlacementVertical]:Bt({allowedPlacements:["left","right","left-start","left-end","right-start","right-end"]})};class j extends S.VividElement{constructor(){super(...arguments),this.open=!1,this.dismissible=!1,this.arrow=!1,this.alternate=!1,this.placementStrategy=ot.Flip,this.animationFrame=!1,this.strategy="fixed",this.offset=null,this.#i=()=>(this.#n=this.updatePosition(),this.#n)}get#r(){let e=[Qe(),en[this.placementStrategy],Ge(),Ke({apply({availableWidth:o,availableHeight:i,elements:r}){Object.assign(r.floating.style,{maxWidth:`${o}px`,maxHeight:`${i}px`})}})],n=this.offset??0;return this.arrow&&(n+=12,e=[...e,Je({element:this.arrowEl,padding:10})]),n>0&&e.unshift(Xe(n)),e}#o;openChanged(e,n){this.#e(),this.#t(),this.$emit(n?"vwc-popup:open":"vwc-popup:close")}animationFrameChanged(){this.#t()}anchorChanged(){this.#t()}strategyChanged(){this.#e()}connectedCallback(){super.connectedCallback(),this.#e(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#t()}#t(){this.#o?.(),this.open&&this.controlEl&&this.controlEl.classList.add("open"),this.anchorEl&&this.open&&this.popupEl&&(this.#o=Ie(this.anchorEl,this.popupEl,this.#i,{animationFrame:this.animationFrame}))}#e(){this.popupEl&&this.strategy==="fixed"&&(this.open?this.popupEl.showPopover():this.popupEl.hidePopover())}#n;#i;async updatePosition(){if(!this.open||!this.anchorEl)return;const e=await Ze(this.anchorEl,this.popupEl,{placement:this.placement,strategy:this.strategy,middleware:this.#r});this.#s(e),this.arrow&&this.#l(e)}#s(e){const{x:n,y:o}=e,{referenceHidden:i}=e.middlewareData.hide;Object.assign(this.popupEl.style,{left:`${n}px`,top:`${o}px`,visibility:i?"hidden":"visible"})}#l(e){const{x:n,y:o}=e.middlewareData.arrow,i={left:"calc(100% - 4px)",right:"-4px",top:"calc(100% - 4px)",bottom:"-4px"},r=e.placement.split("-")[0];Object.assign(this.arrowEl.style,{left:n?`${n}px`:i[r],top:o?`${o}px`:i[r]})}get anchorEl(){return this.anchor??null}show(){return this.open=!0,this.#n??Promise.resolve()}hide(){this.open=!1}}U([S.attr({mode:"boolean"})],j.prototype,"open");U([S.attr({mode:"boolean"})],j.prototype,"dismissible");U([S.attr({mode:"boolean"})],j.prototype,"arrow");U([S.attr({mode:"boolean"})],j.prototype,"alternate");U([S.attr({mode:"fromView"})],j.prototype,"placement");U([S.attr({mode:"boolean",attribute:"animation-frame"})],j.prototype,"animationFrame");U([S.attr({mode:"fromView"})],j.prototype,"strategy");U([S.attr({attribute:"offset",converter:S.nullableNumberConverter})],j.prototype,"offset");U([S.observable],j.prototype,"anchor");const nn=":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}",on=({open:t,dismissible:e,alternate:n})=>Jt.classNames("control",["open",!!t],["dismissible",!!e],["alternate",!!n]);function rn(t){return t.strategy&&t.strategy==="fixed"?"manual":null}const sn=t=>{const e=t.tagFor(Ht.Elevation),n=t.tagFor(Vt.Button);return S.html`
|
|
1
|
+
"use strict";const Vt=require("./definition3.cjs"),Ht=require("./definition4.cjs"),S=require("./vivid-element.cjs"),ht=require("./ref.cjs"),Pt=require("./when.cjs"),Jt=require("./class-names.cjs"),Mt=["top","right","bottom","left"],At=["start","end"],Et=Mt.reduce((t,e)=>t.concat(e,e+"-"+At[0],e+"-"+At[1]),[]),N=Math.min,C=Math.max,ct=Math.round,lt=Math.floor,Y=t=>({x:t,y:t}),Qt={left:"right",right:"left",bottom:"top",top:"bottom"},Zt={start:"end",end:"start"};function te(t,e,n){return C(t,N(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function M(t){return t.split("-")[1]}function ee(t){return t==="x"?"y":"x"}function wt(t){return t==="y"?"height":"width"}const ne=new Set(["top","bottom"]);function X(t){return ne.has(_(t))?"y":"x"}function vt(t){return ee(X(t))}function Nt(t,e,n){n===void 0&&(n=!1);const o=M(t),i=vt(t),r=wt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ft(s)),[s,ft(s)]}function oe(t){const e=ft(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>Zt[e])}const Ct=["left","right"],St=["right","left"],ie=["top","bottom"],re=["bottom","top"];function se(t,e,n){switch(t){case"top":case"bottom":return n?e?St:Ct:e?Ct:St;case"left":case"right":return e?ie:re;default:return[]}}function le(t,e,n,o){const i=M(t);let r=se(_(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(at)))),r}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Qt[e])}function ce(t){return{top:0,right:0,bottom:0,left:0,...t}}function yt(t){return typeof t!="number"?ce(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Tt(t,e,n){let{reference:o,floating:i}=t;const r=X(e),s=vt(e),l=wt(s),c=_(e),a=r==="y",p=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,d=o[l]/2-i[l]/2;let u;switch(c){case"top":u={x:p,y:o.y-i.height};break;case"bottom":u={x:p,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:f};break;case"left":u={x:o.x-i.width,y:f};break;default:u={x:o.x,y:o.y}}switch(M(e)){case"start":u[s]-=d*(n&&a?-1:1);break;case"end":u[s]+=d*(n&&a?-1:1);break}return u}const ae=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:f}=Tt(a,o,c),d=o,u={},m=0;for(let h=0;h<l.length;h++){const{name:g,fn:w}=l[h],{x:y,y:x,data:R,reset:b}=await w({x:p,y:f,initialPlacement:o,placement:d,strategy:i,middlewareData:u,rects:a,platform:s,elements:{reference:t,floating:e}});p=y??p,f=x??f,u={...u,[g]:{...u[g],...R}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(a=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:p,y:f}=Tt(a,d,c)),h=-1)}return{x:p,y:f,placement:d,strategy:i,middlewareData:u}};async function it(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:d=!1,padding:u=0}=J(e,t),m=yt(u),g=l[d?f==="floating"?"reference":"floating":f],w=tt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:a,rootBoundary:p,strategy:c})),y=f==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),R=await(r.isElement==null?void 0:r.isElement(x))?await(r.getScale==null?void 0:r.getScale(x))||{x:1,y:1}:{x:1,y:1},b=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(w.top-b.top+m.top)/R.y,bottom:(b.bottom-w.bottom+m.bottom)/R.y,left:(w.left-b.left+m.left)/R.x,right:(b.right-w.right+m.right)/R.x}}const fe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:l,middlewareData:c}=e,{element:a,padding:p=0}=J(t,e)||{};if(a==null)return{};const f=yt(p),d={x:n,y:o},u=vt(i),m=wt(u),h=await s.getDimensions(a),g=u==="y",w=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",R=r.reference[m]+r.reference[u]-d[u]-r.floating[m],b=d[u]-r.reference[u],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let O=P?P[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(P)))&&(O=l.floating[x]||r.floating[m]);const B=R/2-b/2,T=O/2-h[m]/2-1,v=N(f[w],T),A=N(f[y],T),L=v,D=O-h[m]-A,E=O/2-h[m]/2+B,H=te(L,E,D),V=!c.arrow&&M(i)!=null&&E!==H&&r.reference[m]/2-(E<L?v:A)-h[m]/2<0,k=V?E<L?E-L:E-D:0;return{[u]:d[u]+k,data:{[u]:H,centerOffset:E-H-k,...V&&{alignmentOffset:k}},reset:V}}});function ue(t,e,n){return(t?[...n.filter(i=>M(i)===t),...n.filter(i=>M(i)!==t)]:n.filter(i=>_(i)===i)).filter(i=>t?M(i)===t||(e?at(i)!==i:!1):!0)}const pe=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:l,platform:c,elements:a}=e,{crossAxis:p=!1,alignment:f,allowedPlacements:d=Et,autoAlignment:u=!0,...m}=J(t,e),h=f!==void 0||d===Et?ue(f||null,u,d):d,g=await it(e,m),w=((n=s.autoPlacement)==null?void 0:n.index)||0,y=h[w];if(y==null)return{};const x=Nt(y,r,await(c.isRTL==null?void 0:c.isRTL(a.floating)));if(l!==y)return{reset:{placement:h[0]}};const R=[g[_(y)],g[x[0]],g[x[1]]],b=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:R}],P=h[w+1];if(P)return{data:{index:w+1,overflows:b},reset:{placement:P}};const O=b.map(v=>{const A=M(v.placement);return[v.placement,A&&p?v.overflows.slice(0,2).reduce((L,D)=>L+D,0):v.overflows[0],v.overflows]}).sort((v,A)=>v[1]-A[1]),T=((i=O.filter(v=>v[2].slice(0,M(v[0])?2:3).every(A=>A<=0))[0])==null?void 0:i[0])||O[0][0];return T!==l?{data:{index:w+1,overflows:b},reset:{placement:T}}:{}}}},de=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=J(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=_(i),y=X(l),x=_(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(a.floating)),b=d||(x||!h?[ft(l)]:oe(l)),P=m!=="none";!d&&P&&b.push(...le(l,h,m,R));const O=[l,...b],B=await it(e,g),T=[];let v=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&T.push(B[w]),f){const E=Nt(i,s,R);T.push(B[E[0]],B[E[1]])}if(v=[...v,{placement:i,overflows:T}],!T.every(E=>E<=0)){var A,L;const E=(((A=r.flip)==null?void 0:A.index)||0)+1,H=O[E];if(H&&(!(f==="alignment"?y!==X(H):!1)||v.every($=>X($.placement)===y?$.overflows[0]>0:!0)))return{data:{index:E,overflows:v},reset:{placement:H}};let V=(L=v.filter(k=>k.overflows[0]<=0).sort((k,$)=>k.overflows[1]-$.overflows[1])[0])==null?void 0:L.placement;if(!V)switch(u){case"bestFit":{var D;const k=(D=v.filter($=>{if(P){const K=X($.placement);return K===y||K==="y"}return!0}).map($=>[$.placement,$.overflows.filter(K=>K>0).reduce((K,Gt)=>K+Gt,0)]).sort(($,K)=>$[1]-K[1])[0])==null?void 0:D[0];k&&(V=k);break}case"initialPlacement":V=l;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function Lt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dt(t){return Mt.some(e=>t[e]>=0)}const he=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=J(t,e);switch(o){case"referenceHidden":{const r=await it(e,{...i,elementContext:"reference"}),s=Lt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Dt(s)}}}case"escaped":{const r=await it(e,{...i,altBoundary:!0}),s=Lt(r,n.floating);return{data:{escapedOffsets:s,escaped:Dt(s)}}}default:return{}}}}};function _t(t){const e=N(...t.map(r=>r.left)),n=N(...t.map(r=>r.top)),o=C(...t.map(r=>r.right)),i=C(...t.map(r=>r.bottom));return{x:e,y:n,width:o-e,height:i-n}}function me(t){const e=t.slice().sort((i,r)=>i.y-r.y),n=[];let o=null;for(let i=0;i<e.length;i++){const r=e[i];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(i=>tt(_t(i)))}const ge=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:l=2,x:c,y:a}=J(t,e),p=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(o.reference))||[]),f=me(p),d=tt(_t(p)),u=yt(l);function m(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&a!=null)return f.find(g=>c>g.left-u.left&&c<g.right+u.right&&a>g.top-u.top&&a<g.bottom+u.bottom)||d;if(f.length>=2){if(X(n)==="y"){const v=f[0],A=f[f.length-1],L=_(n)==="top",D=v.top,E=A.bottom,H=L?v.left:A.left,V=L?v.right:A.right,k=V-H,$=E-D;return{top:D,bottom:E,left:H,right:V,width:k,height:$,x:H,y:D}}const g=_(n)==="left",w=C(...f.map(v=>v.right)),y=N(...f.map(v=>v.left)),x=f.filter(v=>g?v.left===y:v.right===w),R=x[0].top,b=x[x.length-1].bottom,P=y,O=w,B=O-P,T=b-R;return{top:R,bottom:b,left:P,right:O,width:B,height:T,x:P,y:R}}return d}const h=await r.getElementRects({reference:{getBoundingClientRect:m},floating:o.floating,strategy:s});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},we=new Set(["left","top"]);async function ve(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=_(n),l=M(n),c=X(n)==="y",a=we.has(s)?-1:1,p=r&&c?-1:1,f=J(e,t);let{mainAxis:d,crossAxis:u,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof m=="number"&&(u=l==="end"?m*-1:m),c?{x:u*p,y:d*a}:{x:d*a,y:u*p}}const ye=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,c=await ve(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},xe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:l}=e,{apply:c=()=>{},...a}=J(t,e),p=await it(e,a),f=_(i),d=M(i),u=X(i)==="y",{width:m,height:h}=r.floating;let g,w;f==="top"||f==="bottom"?(g=f,w=d===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,g=d==="end"?"top":"bottom");const y=h-p.top-p.bottom,x=m-p.left-p.right,R=N(h-p[g],y),b=N(m-p[w],x),P=!e.middlewareData.shift;let O=R,B=b;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(O=y),P&&!d){const v=C(p.left,0),A=C(p.right,0),L=C(p.top,0),D=C(p.bottom,0);u?B=m-2*(v!==0||A!==0?v+A:C(p.left,p.right)):O=h-2*(L!==0||D!==0?L+D:C(p.top,p.bottom))}await c({...e,availableWidth:B,availableHeight:O});const T=await s.getDimensions(l.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function nt(t){return Wt(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function I(t){var e;return(e=(Wt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Wt(t){return ut()?t instanceof Node||t instanceof F(t).Node:!1}function W(t){return ut()?t instanceof Element||t instanceof F(t).Element:!1}function q(t){return ut()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function kt(t){return!ut()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}const be=new Set(["inline","contents"]);function st(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!be.has(i)}const Re=new Set(["table","td","th"]);function Oe(t){return Re.has(nt(t))}const Pe=[":popover-open",":modal"];function pt(t){return Pe.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ae=["transform","translate","scale","rotate","perspective"],Ee=["transform","translate","scale","rotate","perspective","filter"],Ce=["paint","layout","strict","content"];function xt(t){const e=bt(),n=W(t)?z(t):t;return Ae.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ee.some(o=>(n.willChange||"").includes(o))||Ce.some(o=>(n.contain||"").includes(o))}function Se(t){let e=G(t);for(;q(e)&&!et(e);){if(xt(e))return e;if(pt(e))return null;e=G(e)}return null}function bt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Te=new Set(["html","body","#document"]);function et(t){return Te.has(nt(t))}function z(t){return F(t).getComputedStyle(t)}function dt(t){return W(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if(nt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||I(t);return kt(e)?e.host:e}function zt(t){const e=G(t);return et(e)?t.ownerDocument?t.ownerDocument.body:t.body:q(e)&&st(e)?e:zt(e)}function rt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=zt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=F(i);if(r){const l=gt(s);return e.concat(s,s.visualViewport||[],st(i)?i:[],l&&n?rt(l):[])}return e.concat(i,rt(i,[],n))}function gt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function jt(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=ct(n)!==r||ct(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Rt(t){return W(t)?t:t.contextElement}function Z(t){const e=Rt(t);if(!q(e))return Y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=jt(e);let s=(r?ct(n.width):n.width)/o,l=(r?ct(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Le=Y(0);function Yt(t){const e=F(t);return!bt()||!e.visualViewport?Le:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function De(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==F(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Rt(t);let s=Y(1);e&&(o?W(o)&&(s=Z(o)):s=Z(t));const l=De(r,n,o)?Yt(r):Y(0);let c=(i.left+l.x)/s.x,a=(i.top+l.y)/s.y,p=i.width/s.x,f=i.height/s.y;if(r){const d=F(r),u=o&&W(o)?F(o):o;let m=d,h=gt(m);for(;h&&o&&u!==m;){const g=Z(h),w=h.getBoundingClientRect(),y=z(h),x=w.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,R=w.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,a*=g.y,p*=g.x,f*=g.y,c+=x,a+=R,m=F(h),h=gt(m)}}return tt({width:p,height:f,x:c,y:a})}function Ot(t,e){const n=dt(t).scrollLeft;return e?e.left+n:Q(I(t)).left+n}function qt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Ot(t,o)),r=o.top+e.scrollTop;return{x:i,y:r}}function ke(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=I(o),l=e?pt(e.floating):!1;if(o===s||l&&r)return n;let c={scrollLeft:0,scrollTop:0},a=Y(1);const p=Y(0),f=q(o);if((f||!f&&!r)&&((nt(o)!=="body"||st(s))&&(c=dt(o)),q(o))){const u=Q(o);a=Z(o),p.x=u.x+o.clientLeft,p.y=u.y+o.clientTop}const d=s&&!f&&!r?qt(s,c,!0):Y(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+p.x+d.x,y:n.y*a.y-c.scrollTop*a.y+p.y+d.y}}function $e(t){return Array.from(t.getClientRects())}function Fe(t){const e=I(t),n=dt(t),o=t.ownerDocument.body,i=C(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=C(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ot(t);const l=-n.scrollTop;return z(o).direction==="rtl"&&(s+=C(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}function Be(t,e){const n=F(t),o=I(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,c=0;if(i){r=i.width,s=i.height;const a=bt();(!a||a&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:r,height:s,x:l,y:c}}const Ve=new Set(["absolute","fixed"]);function He(t,e){const n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=q(t)?Z(t):Y(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,c=i*r.x,a=o*r.y;return{width:s,height:l,x:c,y:a}}function $t(t,e,n){let o;if(e==="viewport")o=Be(t,n);else if(e==="document")o=Fe(I(t));else if(W(e))o=He(e,n);else{const i=Yt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(o)}function It(t,e){const n=G(t);return n===e||!W(n)||et(n)?!1:z(n).position==="fixed"||It(n,e)}function Me(t,e){const n=e.get(t);if(n)return n;let o=rt(t,[],!1).filter(l=>W(l)&&nt(l)!=="body"),i=null;const r=z(t).position==="fixed";let s=r?G(t):t;for(;W(s)&&!et(s);){const l=z(s),c=xt(s);!c&&l.position==="fixed"&&(i=null),(r?!c&&!i:!c&&l.position==="static"&&!!i&&Ve.has(i.position)||st(s)&&!c&&It(t,s))?o=o.filter(p=>p!==s):i=l,s=G(s)}return e.set(t,o),o}function Ne(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pt(e)?[]:Me(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((a,p)=>{const f=$t(e,p,i);return a.top=C(f.top,a.top),a.right=N(f.right,a.right),a.bottom=N(f.bottom,a.bottom),a.left=C(f.left,a.left),a},$t(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _e(t){const{width:e,height:n}=jt(t);return{width:e,height:n}}function We(t,e,n){const o=q(e),i=I(e),r=n==="fixed",s=Q(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const c=Y(0);function a(){c.x=Ot(i)}if(o||!o&&!r)if((nt(e)!=="body"||st(i))&&(l=dt(e)),o){const u=Q(e,!0,r,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else i&&a();r&&!o&&i&&a();const p=i&&!o&&!r?qt(i,l):Y(0),f=s.left+l.scrollLeft-c.x-p.x,d=s.top+l.scrollTop-c.y-p.y;return{x:f,y:d,width:s.width,height:s.height}}function mt(t){return z(t).position==="static"}function Ft(t,e){if(!q(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return I(t)===n&&(n=n.ownerDocument.body),n}function Xt(t,e){const n=F(t);if(pt(t))return n;if(!q(t)){let i=G(t);for(;i&&!et(i);){if(W(i)&&!mt(i))return i;i=G(i)}return n}let o=Ft(t,e);for(;o&&Oe(o)&&mt(o);)o=Ft(o,e);return o&&et(o)&&mt(o)&&!xt(o)?n:o||Se(t)||n}const ze=async function(t){const e=this.getOffsetParent||Xt,n=this.getDimensions,o=await n(t.floating);return{reference:We(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function je(t){return z(t).direction==="rtl"}const Ye={convertOffsetParentRelativeRectToViewportRelativeRect:ke,getDocumentElement:I,getClippingRect:Ne,getOffsetParent:Xt,getElementRects:ze,getClientRects:$e,getDimensions:_e,getScale:Z,isElement:W,isRTL:je};function Ut(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qe(t,e){let n=null,o;const i=I(t);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),r();const a=t.getBoundingClientRect(),{left:p,top:f,width:d,height:u}=a;if(l||e(),!d||!u)return;const m=lt(f),h=lt(i.clientWidth-(p+d)),g=lt(i.clientHeight-(f+u)),w=lt(p),x={rootMargin:-m+"px "+-h+"px "+-g+"px "+-w+"px",threshold:C(0,N(1,c))||1};let R=!0;function b(P){const O=P[0].intersectionRatio;if(O!==c){if(!R)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Ut(a,t.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(b,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(t)}return s(!0),r}function Ie(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,a=Rt(t),p=i||r?[...a?rt(a):[],...rt(e)]:[];p.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const f=a&&l?qe(a,n):null;let d=-1,u=null;s&&(u=new ResizeObserver(w=>{let[y]=w;y&&y.target===a&&u&&(u.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=u)==null||x.observe(e)})),n()}),a&&!c&&u.observe(a),u.observe(e));let m,h=c?Q(t):null;c&&g();function g(){const w=Q(t);h&&!Ut(h,w)&&n(),h=w,m=requestAnimationFrame(g)}return n(),()=>{var w;p.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),f?.(),(w=u)==null||w.disconnect(),u=null,c&&cancelAnimationFrame(m)}}const Xe=ye,Bt=pe,Ue=de,Ke=xe,Ge=he,Je=fe,Qe=ge,Ze=(t,e,n)=>{const o=new Map,i={platform:Ye,...n},r={...i.platform,_c:o};return ae(t,e,{...i,platform:r})};var tn=Object.defineProperty,U=(t,e,n,o)=>{for(var i=void 0,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=s(e,n,i)||i);return i&&tn(e,n,i),i};const ot={Flip:"flip",AutoPlacementHorizontal:"auto-placement-horizontal",AutoPlacementVertical:"auto-placement-vertical"},en={[ot.Flip]:Ue(),[ot.AutoPlacementHorizontal]:Bt({allowedPlacements:["bottom","top","bottom-start","bottom-end","top-start","top-end"]}),[ot.AutoPlacementVertical]:Bt({allowedPlacements:["left","right","left-start","left-end","right-start","right-end"]})};class j extends S.VividElement{constructor(){super(...arguments),this.open=!1,this.dismissible=!1,this.arrow=!1,this.alternate=!1,this.placementStrategy=ot.Flip,this.animationFrame=!1,this.strategy="fixed",this.offset=null,this.#i=()=>(this.#n=this.updatePosition(),this.#n)}get#r(){let e=[Qe(),en[this.placementStrategy],Ge(),Ke({apply({availableWidth:o,availableHeight:i,elements:r}){Object.assign(r.floating.style,{maxWidth:`${o}px`,maxHeight:`${i}px`})}})],n=this.offset??0;return this.arrow&&(n+=12,e=[...e,Je({element:this.arrowEl,padding:10})]),n>0&&e.unshift(Xe(n)),e}#o;openChanged(e,n){this.#e(),this.#t(),this.$emit(n?"vwc-popup:open":"vwc-popup:close")}animationFrameChanged(){this.#t()}anchorChanged(){this.#t()}strategyChanged(){this.#e()}connectedCallback(){super.connectedCallback(),this.#e(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#t()}#t(){this.#o?.(),this.open&&this.controlEl&&this.controlEl.classList.add("open"),this.anchorEl&&this.open&&this.popupEl&&(this.#o=Ie(this.anchorEl,this.popupEl,this.#i,{animationFrame:this.animationFrame}))}#e(){this.popupEl&&this.strategy==="fixed"&&(this.open?this.popupEl.showPopover():this.popupEl.hidePopover())}#n;#i;async updatePosition(){if(!this.open||!this.anchorEl)return;const e=await Ze(this.anchorEl,this.popupEl,{placement:this.placement,strategy:this.strategy,middleware:this.#r});this.#s(e),this.arrow&&this.#l(e)}#s(e){const{x:n,y:o}=e,{referenceHidden:i}=e.middlewareData.hide;Object.assign(this.popupEl.style,{left:`${n}px`,top:`${o}px`,visibility:i?"hidden":"visible"})}#l(e){const{x:n,y:o}=e.middlewareData.arrow,i={left:"calc(100% - 4px)",right:"-4px",top:"calc(100% - 4px)",bottom:"-4px"},r=e.placement.split("-")[0];Object.assign(this.arrowEl.style,{left:n?`${n}px`:i[r],top:o?`${o}px`:i[r]})}get anchorEl(){return this.anchor??null}show(){return this.open=!0,this.#n??Promise.resolve()}hide(){this.open=!1}}U([S.attr({mode:"boolean"})],j.prototype,"open");U([S.attr({mode:"boolean"})],j.prototype,"dismissible");U([S.attr({mode:"boolean"})],j.prototype,"arrow");U([S.attr({mode:"boolean"})],j.prototype,"alternate");U([S.attr({mode:"fromView"})],j.prototype,"placement");U([S.attr({mode:"boolean",attribute:"animation-frame"})],j.prototype,"animationFrame");U([S.attr({mode:"fromView"})],j.prototype,"strategy");U([S.attr({attribute:"offset",converter:S.nullableNumberConverter})],j.prototype,"offset");U([S.observable],j.prototype,"anchor");const nn=":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}",on=({open:t,dismissible:e,alternate:n})=>Jt.classNames("control",["open",!!t],["dismissible",!!e],["alternate",!!n]);function rn(t){return t.strategy&&t.strategy==="fixed"?"manual":null}const sn=t=>{const e=t.tagFor(Ht.Elevation),n=t.tagFor(Vt.Button);return S.html`
|
|
2
2
|
<${e}>
|
|
3
3
|
<div popover="${rn}" class="popup-wrapper ${o=>o.strategy}" ${ht.ref("popupEl")} part="popup-base">
|
|
4
4
|
<div ${ht.ref("controlEl")} class="${on}" aria-hidden="${o=>o.open?"false":"true"}"
|
package/bundled/definition9.js
CHANGED
|
@@ -2,8 +2,8 @@ import { B as Kt, b as Gt } from "./definition3.js";
|
|
|
2
2
|
import { E as Jt, e as Qt } from "./definition4.js";
|
|
3
3
|
import { V as Zt, a as G, n as te, o as ee, h as mt, c as ne, d as oe } from "./vivid-element.js";
|
|
4
4
|
import { r as ht } from "./ref.js";
|
|
5
|
-
import { c as ie } from "./class-names.js";
|
|
6
5
|
import { w as At } from "./when.js";
|
|
6
|
+
import { c as ie } from "./class-names.js";
|
|
7
7
|
const Ht = ["top", "right", "bottom", "left"], Et = ["start", "end"], Ct = /* @__PURE__ */ Ht.reduce((t, e) => t.concat(e, e + "-" + Et[0], e + "-" + Et[1]), []), M = Math.min, C = Math.max, ct = Math.round, st = Math.floor, z = (t) => ({
|
|
8
8
|
x: t,
|
|
9
9
|
y: t
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const h=require("./attribute-binding-behaviour.cjs"),o=require("./vivid-element.cjs");class g{constructor(e,t){this.target=null,this.bindingBehaviours=[],this.onSourceAriaPropertyChanged=(r,i)=>{!this.forwardedProperties.has(i)||i in this.boundProperties||this.forwardPropertyToTarget(this.target,i,r[i])},this.target=e,this.boundProperties=t.boundProperties,this.forwardedProperties=t.forwardedProperties}bind(e){const t=e.source;this.bindPropertiesToTarget(t,this.boundProperties,this.target),this.startForwardingPropertiesToTarget(t,this.forwardedProperties,this.target)}bindPropertiesToTarget(e,t,r){for(const[i,a]of Object.entries(t)){const n=a instanceof Function?a:()=>a;this.bindingBehaviours.push(new h.AttributeBindingBehavior(r,o.oneWay(n),o.Observable.isVolatileBinding(n),o.ariaAttributeName(i)))}for(const i of this.bindingBehaviours)i.bind({source:e,context:e.$fastController.context})}startForwardingPropertiesToTarget(e,t,r){for(const i of t)i in this.boundProperties||this.forwardPropertyToTarget(r,i,e[i]);o.subscribeToAriaPropertyChanges(e,this.onSourceAriaPropertyChanged)}forwardPropertyToTarget(e,t,r){r==null||r===!1?e.removeAttribute(o.ariaAttributeName(t)):e.setAttribute(o.ariaAttributeName(t),String(r))}}class d extends o.StatelessAttachedAttributeDirective{constructor(e,t){super("vvd-delegate-aria"),this.boundProperties=e,this.forwardedProperties=t,this.targetNodeId=""}bind(e){const t=e.targets[this.targetNodeId];new g(t,{boundProperties:this.boundProperties,forwardedProperties:this.forwardedProperties}).bind(e)}}o.HTMLDirective.define(d);function u(s={},e={}){const t=new Set((e.onlySpecified?[]:o.ariaMixinProperties).filter(r=>!(r in s)));return new d(s,t)}const b=s=>{class e extends s{constructor(){super(...arguments),this._vividAriaBehaviour="delegate"}}return e};exports.DelegatesAria=b;exports.delegateAria=u;
|
|
@@ -1,77 +1,90 @@
|
|
|
1
1
|
import { A as h } from "./attribute-binding-behaviour.js";
|
|
2
|
-
import { O as
|
|
2
|
+
import { g, O as b, j as a, s as c, k as u, S as f, H as p } from "./vivid-element.js";
|
|
3
3
|
class P {
|
|
4
|
-
constructor(
|
|
5
|
-
this.target =
|
|
6
|
-
this.forwardedProperties.has(i)
|
|
7
|
-
}, this.
|
|
4
|
+
constructor(e, r) {
|
|
5
|
+
this.target = null, this.bindingBehaviours = [], this.onSourceAriaPropertyChanged = (t, i) => {
|
|
6
|
+
!this.forwardedProperties.has(i) || i in this.boundProperties || this.forwardPropertyToTarget(this.target, i, t[i]);
|
|
7
|
+
}, this.target = e, this.boundProperties = r.boundProperties, this.forwardedProperties = r.forwardedProperties;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// private source: DelegatesAriaElement | null = null;
|
|
10
|
+
bind(e) {
|
|
11
|
+
const r = e.source;
|
|
12
|
+
this.bindPropertiesToTarget(r, this.boundProperties, this.target), this.startForwardingPropertiesToTarget(
|
|
11
13
|
r,
|
|
12
14
|
this.forwardedProperties,
|
|
13
15
|
this.target
|
|
14
16
|
);
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
bindPropertiesToTarget(r, e, t) {
|
|
20
|
-
for (const [i, o] of Object.entries(e)) {
|
|
21
|
-
const a = o instanceof Function ? o : () => o;
|
|
18
|
+
bindPropertiesToTarget(e, r, t) {
|
|
19
|
+
for (const [i, o] of Object.entries(r)) {
|
|
20
|
+
const n = o instanceof Function ? o : () => o;
|
|
22
21
|
this.bindingBehaviours.push(
|
|
23
22
|
new h(
|
|
24
23
|
t,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
g(n),
|
|
25
|
+
b.isVolatileBinding(n),
|
|
26
|
+
a(i)
|
|
28
27
|
)
|
|
29
28
|
);
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
startForwardingPropertiesToTarget(r, e, t) {
|
|
37
|
-
for (const i of e)
|
|
38
|
-
this.forwardPropertyToTarget(t, i, r[i]);
|
|
39
|
-
g(r, this.onSourceAriaPropertyChanged);
|
|
30
|
+
for (const i of this.bindingBehaviours)
|
|
31
|
+
i.bind({
|
|
32
|
+
source: e,
|
|
33
|
+
context: e.$fastController.context
|
|
34
|
+
});
|
|
40
35
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
// private releasePropertyBindings(source: DelegatesAriaElement) {
|
|
37
|
+
// for (const behavior of this.bindingBehaviours) {
|
|
38
|
+
// (behavior as any).unbind(); // TODO: fix type
|
|
39
|
+
// }
|
|
40
|
+
// this.bindingBehaviours = [];
|
|
41
|
+
// }
|
|
42
|
+
startForwardingPropertiesToTarget(e, r, t) {
|
|
43
|
+
for (const i of r)
|
|
44
|
+
i in this.boundProperties || this.forwardPropertyToTarget(t, i, e[i]);
|
|
45
|
+
c(
|
|
46
|
+
e,
|
|
44
47
|
this.onSourceAriaPropertyChanged
|
|
45
48
|
);
|
|
46
49
|
}
|
|
47
|
-
forwardPropertyToTarget(
|
|
48
|
-
|
|
50
|
+
forwardPropertyToTarget(e, r, t) {
|
|
51
|
+
t == null || t === !1 ? e.removeAttribute(a(r)) : e.setAttribute(a(r), String(t));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
class d extends f {
|
|
55
|
+
constructor(e, r) {
|
|
56
|
+
super("vvd-delegate-aria"), this.boundProperties = e, this.forwardedProperties = r, this.targetNodeId = "";
|
|
57
|
+
}
|
|
58
|
+
bind(e) {
|
|
59
|
+
const r = e.targets[this.targetNodeId];
|
|
60
|
+
new P(
|
|
61
|
+
r,
|
|
62
|
+
// Pass the target element as target
|
|
63
|
+
{
|
|
64
|
+
boundProperties: this.boundProperties,
|
|
65
|
+
forwardedProperties: this.forwardedProperties
|
|
66
|
+
}
|
|
67
|
+
).bind(e);
|
|
49
68
|
}
|
|
50
69
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
p.define(d);
|
|
71
|
+
function v(s = {}, e = {}) {
|
|
72
|
+
const r = new Set(
|
|
73
|
+
(e.onlySpecified ? [] : u).filter(
|
|
54
74
|
(t) => !(t in s)
|
|
55
75
|
)
|
|
56
76
|
);
|
|
57
|
-
return new
|
|
58
|
-
"vvd-delegate-aria",
|
|
59
|
-
P,
|
|
60
|
-
{
|
|
61
|
-
boundProperties: s,
|
|
62
|
-
forwardedProperties: e
|
|
63
|
-
}
|
|
64
|
-
);
|
|
77
|
+
return new d(s, r);
|
|
65
78
|
}
|
|
66
|
-
const
|
|
67
|
-
class
|
|
79
|
+
const A = (s) => {
|
|
80
|
+
class e extends s {
|
|
68
81
|
constructor() {
|
|
69
82
|
super(...arguments), this._vividAriaBehaviour = "delegate";
|
|
70
83
|
}
|
|
71
84
|
}
|
|
72
|
-
return
|
|
85
|
+
return e;
|
|
73
86
|
};
|
|
74
87
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
A as D,
|
|
89
|
+
v as d
|
|
77
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("./vivid-element.cjs"),m=require("./key-codes.cjs");var f=Object.defineProperty,l=(r,i,o,e)=>{for(var t=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(t=n(i,o,t)||t);return t&&f(i,o,t),t};const h="form-associated-proxy",d="ElementInternals",c=d in window&&"setFormValue"in window[d].prototype,u=new WeakMap,p=r=>{class i extends r{constructor(...e){super(...e),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return c}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const e=this.proxy.labels,t=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));return Object.freeze(t.concat(Array.from(e)))}else return a.emptyArray}valueChanged(e,t){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.setFormValue(this.value),this.validate()}get currentValue(){return this.value}set currentValue(e){this.value=e}initialValueChanged(e,t){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),a.
|
|
1
|
+
"use strict";const a=require("./vivid-element.cjs"),m=require("./key-codes.cjs");var f=Object.defineProperty,l=(r,i,o,e)=>{for(var t=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(t=n(i,o,t)||t);return t&&f(i,o,t),t};const h="form-associated-proxy",d="ElementInternals",c=d in window&&"setFormValue"in window[d].prototype,u=new WeakMap,p=r=>{class i extends r{constructor(...e){super(...e),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return c}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const e=this.proxy.labels,t=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));return Object.freeze(t.concat(Array.from(e)))}else return a.emptyArray}valueChanged(e,t){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.setFormValue(this.value),this.validate()}get currentValue(){return this.value}set currentValue(e){this.value=e}initialValueChanged(e,t){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),a.Updates.enqueue(()=>this.classList.toggle("disabled",this.disabled))}nameChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),a.Updates.enqueue(()=>this.classList.toggle("required",this.required)),this.validate()}get elementInternals(){if(!c)return null;let e=u.get(this);return e||(e=this.attachInternals(),u.set(this,e)),e}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){super.disconnectedCallback(),this.proxyEventsToBlock.forEach(e=>this.proxy.removeEventListener(e,this.stopPropagation)),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(e,t,s){if("valid"in e&&this.disabled){const{valid:n,...y}=e;e=y}this.elementInternals?this.elementInternals.setValidity(e,t,s):typeof t=="string"&&this.proxy.setCustomValidity(t)}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach(e=>this.proxy.addEventListener(e,this.stopPropagation)),this.proxy.disabled=this.disabled,this.proxy.required=this.required,typeof this.name=="string"&&(this.proxy.name=this.name),typeof this.value=="string"&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",h),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",h)),this.shadowRoot.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){this.removeChild(this.proxy),this.shadowRoot.removeChild(this.proxySlot)}validate(e){if(this.proxy instanceof HTMLElement&&this.elementInternals){const t=this.proxy.validity.valid,s=this.control,n=s&&s.validity&&!s.validity.valid&&(s.validity.tooShort||s.validity.tooLong);t&&n?this.setValidity(s.validity,s.validationMessage,e):this.setValidity(this.proxy.validity,this.proxy.validationMessage,e)}}setFormValue(e,t){this.elementInternals&&this.elementInternals.setFormValue(e,t||e)}_keypressHandler(e){switch(e.key){case m.keyEnter:this.form instanceof HTMLFormElement&&this.form.querySelector("[type=submit]")?.click();break}}stopPropagation(e){e.stopPropagation()}}return l([a.attr({attribute:"current-value"})],i.prototype,"value"),l([a.attr({mode:"fromView",attribute:"value"})],i.prototype,"initialValue"),l([a.attr({mode:"boolean"})],i.prototype,"disabled"),l([a.attr],i.prototype,"name"),l([a.attr({mode:"boolean"})],i.prototype,"required"),i},v={fromView(r){return typeof r=="string"?r.toLowerCase()==="true":!!r},toView(r){return r?"true":"false"}},k=r=>{class i extends p(r){constructor(){super(...arguments),this.dirtyChecked=!1,this.defaultChecked=!1}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(e,t){this.dirtyChecked||(this.dirtyChecked=!0),this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),e!==void 0&&this.$emit("change"),this.validate()}get checkedAttribute(){return this.defaultChecked}set checkedAttribute(e){this.defaultChecked=e}get currentChecked(){return this.checked}set currentChecked(e){this.checked=e}updateForm(){const e=this.checked?this.value:null;this.setFormValue(e,e)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.defaultChecked,this.dirtyChecked=!1}}return l([a.attr({attribute:"checked",mode:"boolean"})],i.prototype,"defaultChecked"),l([a.attr({attribute:"current-checked",converter:v})],i.prototype,"checked"),i};exports.CheckableFormAssociated=k;exports.FormAssociated=p;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a, e as m,
|
|
1
|
+
import { a, e as m, U as h } from "./vivid-element.js";
|
|
2
2
|
import { f } from "./key-codes.js";
|
|
3
3
|
var v = Object.defineProperty, l = (r, i, o, e) => {
|
|
4
4
|
for (var t = void 0, s = r.length - 1, n; s >= 0; s--)
|
|
@@ -85,7 +85,7 @@ const d = "form-associated-proxy", c = "ElementInternals", u = c in window && "s
|
|
|
85
85
|
* @internal
|
|
86
86
|
*/
|
|
87
87
|
disabledChanged(e, t) {
|
|
88
|
-
this.proxy instanceof HTMLElement && (this.proxy.disabled = this.disabled), h.
|
|
88
|
+
this.proxy instanceof HTMLElement && (this.proxy.disabled = this.disabled), h.enqueue(() => this.classList.toggle("disabled", this.disabled));
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* @internal
|
|
@@ -97,7 +97,7 @@ const d = "form-associated-proxy", c = "ElementInternals", u = c in window && "s
|
|
|
97
97
|
* @internal
|
|
98
98
|
*/
|
|
99
99
|
requiredChanged(e, t) {
|
|
100
|
-
this.proxy instanceof HTMLElement && (this.proxy.required = this.required), h.
|
|
100
|
+
this.proxy instanceof HTMLElement && (this.proxy.required = this.required), h.enqueue(() => this.classList.toggle("required", this.required)), this.validate();
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* The element internals object. Will only exist
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./vivid-element.cjs"),
|
|
1
|
+
"use strict";const s=require("./vivid-element.cjs"),d=require("./attribute-binding-behaviour.cjs");class h{constructor(t,e){this.target=null,this.bindingBehaviours=[],this.target=t,this.boundProperties=e.boundProperties}bind(t){const e=t.source;if(this.target!==e)throw new Error("Target element must be the same as the source element");this.bindPropertiesToTarget(e,this.boundProperties,this.target)}bindPropertiesToTarget(t,e,o){for(const[i,n]of Object.entries(e)){const c=n instanceof Function?n:u=>u[i]??n;this.bindingBehaviours.push(new d.AttributeBindingBehavior(o,s.oneWay(c),!0,s.ariaAttributeName(i)))}for(const i of this.bindingBehaviours)i.bind({source:t,context:t.$fastController.context})}}class a extends s.StatelessAttachedAttributeDirective{constructor(t){super("vvd-host-semantics"),this.boundProperties=t,this.targetNodeId=""}bind(t){const e=t.targets[this.targetNodeId];new h(e,{boundProperties:this.boundProperties,forwardedProperties:new Set(s.ariaMixinProperties.filter(i=>!(i in this.boundProperties)))}).bind(t)}}s.HTMLDirective.define(a);function b(r={}){return new a(r)}const p=r=>{class t extends r{constructor(){super(...arguments),this._vividAriaBehaviour="host"}}return t};exports.HostSemantics=p;exports.applyHostSemantics=b;
|