@vonage/vivid 4.16.2 → 4.18.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/custom-elements.json +8857 -5894
- package/date-time-picker/index.cjs +5 -0
- package/date-time-picker/index.js +3 -0
- package/dial-pad/index.cjs +1 -1
- package/dial-pad/index.js +1 -1
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.cjs +1 -1
- package/empty-state/index.js +1 -1
- package/fab/index.cjs +1 -1
- package/fab/index.js +1 -1
- package/file-picker/index.cjs +1 -1
- package/file-picker/index.js +1 -1
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +198 -87
- package/index.js +66 -60
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/accordion/definition.d.ts +2 -0
- package/lib/accordion-item/definition.d.ts +2 -0
- package/lib/action-group/action-group.d.ts +449 -3
- package/lib/action-group/definition.d.ts +2 -0
- package/lib/alert/definition.d.ts +2 -0
- package/lib/audio-player/definition.d.ts +2 -0
- package/lib/avatar/definition.d.ts +2 -0
- package/lib/badge/definition.d.ts +2 -0
- package/lib/banner/banner.d.ts +449 -3
- package/lib/banner/definition.d.ts +2 -0
- package/lib/breadcrumb/definition.d.ts +2 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +449 -1
- package/lib/breadcrumb-item/definition.d.ts +2 -0
- package/lib/button/definition.d.ts +2 -0
- package/lib/calendar/calendar.d.ts +2 -0
- package/lib/calendar/definition.d.ts +2 -0
- package/lib/calendar-event/definition.d.ts +2 -0
- package/lib/card/definition.d.ts +2 -0
- package/lib/checkbox/checkbox.d.ts +449 -4
- package/lib/checkbox/definition.d.ts +2 -0
- package/lib/combobox/definition.d.ts +2 -0
- package/lib/components.d.ts +2 -0
- package/lib/data-grid/definition.d.ts +4 -0
- package/lib/date-picker/date-picker.d.ts +2182 -4
- package/lib/date-picker/date-picker.template.d.ts +2 -0
- package/lib/date-picker/definition.d.ts +2 -0
- package/lib/date-range-picker/date-range-picker.d.ts +1110 -4
- package/lib/date-range-picker/date-range-picker.template.d.ts +2 -0
- package/lib/date-range-picker/definition.d.ts +2 -0
- package/lib/date-time-picker/date-time-picker.d.ts +2175 -0
- package/lib/date-time-picker/date-time-picker.template.d.ts +2 -0
- package/lib/date-time-picker/definition.d.ts +1 -0
- package/lib/date-time-picker/locale.d.ts +9 -0
- package/lib/dial-pad/definition.d.ts +2 -0
- package/lib/dialog/definition.d.ts +2 -0
- package/lib/dialog/dialog.d.ts +449 -2
- package/lib/divider/definition.d.ts +2 -0
- package/lib/divider/divider.d.ts +448 -1
- package/lib/empty-state/definition.d.ts +2 -0
- package/lib/enums.d.ts +6 -0
- package/lib/fab/definition.d.ts +2 -0
- package/lib/file-picker/definition.d.ts +2 -0
- package/lib/header/definition.d.ts +2 -0
- package/lib/icon/definition.d.ts +2 -0
- package/lib/layout/definition.d.ts +2 -0
- package/lib/menu/definition.d.ts +2 -0
- package/lib/menu/menu.d.ts +900 -5
- package/lib/menu-item/definition.d.ts +2 -0
- package/lib/nav/definition.d.ts +2 -0
- package/lib/nav-disclosure/definition.d.ts +2 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +449 -2
- package/lib/nav-item/definition.d.ts +2 -0
- package/lib/note/definition.d.ts +2 -0
- package/lib/number-field/definition.d.ts +2 -0
- package/lib/number-field/number-field.d.ts +450 -3
- package/lib/option/definition.d.ts +2 -0
- package/lib/option/option.d.ts +1 -11
- package/lib/pagination/definition.d.ts +2 -0
- package/lib/popup/definition.d.ts +0 -1
- package/lib/popup/popup.d.ts +25 -0
- package/lib/progress/definition.d.ts +2 -0
- package/lib/progress/progress.d.ts +449 -2
- package/lib/progress-ring/definition.d.ts +2 -0
- package/lib/progress-ring/progress-ring.d.ts +449 -2
- package/lib/radio/definition.d.ts +2 -0
- package/lib/radio-group/definition.d.ts +2 -0
- package/lib/range-slider/definition.d.ts +2 -0
- package/lib/rich-text-editor/definition.d.ts +2 -0
- package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +2 -0
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +8 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +16 -0
- package/lib/rich-text-editor/rich-text-editor.template.d.ts +4 -0
- package/lib/searchable-select/definition.d.ts +2 -0
- package/lib/select/definition.d.ts +2 -0
- package/lib/select/select.d.ts +1 -5
- package/lib/selectable-box/definition.d.ts +2 -0
- package/lib/selectable-box/selectable-box.d.ts +449 -2
- package/lib/side-drawer/definition.d.ts +2 -0
- package/lib/slider/definition.d.ts +2 -0
- package/lib/slider/slider.d.ts +449 -3
- package/lib/split-button/definition.d.ts +2 -0
- package/lib/split-button/split-button.d.ts +449 -3
- package/lib/switch/definition.d.ts +2 -0
- package/lib/switch/switch.d.ts +449 -2
- package/lib/tab/definition.d.ts +2 -0
- package/lib/tab-panel/definition.d.ts +2 -0
- package/lib/tabs/definition.d.ts +2 -0
- package/lib/tag/definition.d.ts +2 -0
- package/lib/tag-group/definition.d.ts +2 -0
- package/lib/tag-group/tag-group.d.ts +449 -2
- package/lib/text-anchor/text-anchor.d.ts +449 -1
- package/lib/text-area/definition.d.ts +2 -0
- package/lib/text-area/text-area.d.ts +450 -3
- package/lib/text-field/definition.d.ts +2 -0
- package/lib/text-field/text-field.d.ts +450 -7
- package/lib/time-picker/definition.d.ts +2 -0
- package/lib/time-picker/locale.d.ts +0 -2
- package/lib/time-picker/time-picker.d.ts +1053 -9
- package/lib/time-picker/time-picker.template.d.ts +2 -2
- package/lib/toggletip/definition.d.ts +2 -0
- package/lib/toggletip/toggletip.d.ts +454 -4
- package/lib/tooltip/definition.d.ts +2 -0
- package/lib/tooltip/tooltip.d.ts +454 -4
- package/lib/tree-item/definition.d.ts +2 -0
- package/lib/tree-view/definition.d.ts +2 -0
- package/lib/video-player/definition.d.ts +2 -0
- package/locales/de-DE.cjs +29 -5
- package/locales/de-DE.js +29 -5
- package/locales/en-GB.cjs +29 -5
- package/locales/en-GB.js +29 -5
- package/locales/en-US.cjs +29 -5
- package/locales/en-US.js +29 -5
- package/locales/ja-JP.cjs +29 -5
- package/locales/ja-JP.js +29 -5
- package/locales/zh-CN.cjs +29 -5
- package/locales/zh-CN.js +29 -5
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/menu-item/index.cjs +1 -1
- package/menu-item/index.js +1 -1
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.cjs +1 -1
- package/note/index.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +7 -2
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +1 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/index.cjs +5 -0
- package/rich-text-editor/index.js +3 -0
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/Reflector.cjs +71 -0
- package/shared/Reflector.js +69 -0
- package/shared/affix.cjs +2 -4
- package/shared/affix.js +3 -5
- package/shared/anchor.cjs +0 -10
- package/shared/anchor.js +0 -10
- package/shared/anchored.cjs +12 -9
- package/shared/anchored.js +13 -10
- package/shared/aria/delegates-aria.d.ts +454 -0
- package/shared/base-progress.js +1 -1
- package/shared/breadcrumb-item.cjs +2 -1
- package/shared/breadcrumb-item.js +2 -1
- package/shared/button.cjs +2 -13
- package/shared/button.js +2 -13
- package/shared/{presentationDate.cjs → calendar-picker.template.cjs} +681 -853
- package/shared/{presentationDate.js → calendar-picker.template.js} +673 -848
- package/shared/datetime/dateTimeStr.d.ts +6 -0
- package/shared/datetime/presentationDate.d.ts +4 -0
- package/shared/{date-picker/calendar → datetime}/presentationDateRange.d.ts +3 -3
- package/shared/datetime/presentationDateTime.d.ts +4 -0
- package/{lib/time-picker/time → shared/datetime}/time.d.ts +1 -0
- package/shared/definition.cjs +1 -1
- package/shared/definition.js +2 -2
- package/shared/definition10.cjs +1 -0
- package/shared/definition10.js +2 -2
- package/shared/definition11.cjs +9 -12
- package/shared/definition11.js +10 -13
- package/shared/definition12.cjs +1 -1
- package/shared/definition12.js +2 -2
- package/shared/definition13.cjs +15 -2
- package/shared/definition13.js +16 -4
- package/shared/definition14.cjs +4 -3
- package/shared/definition14.js +5 -5
- package/shared/definition15.cjs +4 -11
- package/shared/definition15.js +5 -12
- package/shared/definition16.cjs +44 -48
- package/shared/definition16.js +32 -36
- package/shared/definition17.cjs +4 -1
- package/shared/definition17.js +3 -3
- package/shared/definition18.cjs +59 -94
- package/shared/definition18.js +58 -93
- package/shared/definition19.cjs +79 -43
- package/shared/definition19.js +60 -24
- package/shared/definition2.cjs +1 -0
- package/shared/definition2.js +2 -2
- package/shared/definition20.cjs +253 -219
- package/shared/definition20.js +254 -220
- package/shared/definition21.cjs +201 -286
- package/shared/definition21.js +199 -285
- package/shared/definition22.cjs +302 -31
- package/shared/definition22.js +301 -30
- package/shared/definition23.cjs +37 -57
- package/shared/definition23.js +36 -57
- package/shared/definition24.cjs +50 -69
- package/shared/definition24.js +49 -69
- package/shared/definition25.cjs +75 -2475
- package/shared/definition25.js +74 -2475
- package/shared/definition26.cjs +2480 -49
- package/shared/definition26.js +2480 -49
- package/shared/definition27.cjs +53 -271
- package/shared/definition27.js +52 -269
- package/shared/definition28.cjs +271 -47
- package/shared/definition28.js +269 -47
- package/shared/definition29.cjs +37 -772
- package/shared/definition29.js +36 -767
- package/shared/definition3.cjs +3 -9
- package/shared/definition3.js +4 -11
- package/shared/definition30.cjs +739 -56
- package/shared/definition30.js +733 -56
- package/shared/definition31.cjs +93 -21
- package/shared/definition31.js +92 -21
- package/shared/definition32.cjs +28 -9
- package/shared/definition32.js +27 -9
- package/shared/definition33.cjs +10 -51
- package/shared/definition33.js +9 -51
- package/shared/definition34.cjs +31 -412
- package/shared/definition34.js +31 -413
- package/shared/definition35.cjs +423 -53
- package/shared/definition35.js +424 -54
- package/shared/definition36.cjs +53 -215
- package/shared/definition36.js +53 -215
- package/shared/definition37.cjs +202 -72
- package/shared/definition37.js +201 -71
- package/shared/definition38.cjs +54 -48
- package/shared/definition38.js +53 -48
- package/shared/definition39.cjs +57 -262
- package/shared/definition39.js +56 -262
- package/shared/definition4.cjs +4 -3
- package/shared/definition4.js +5 -5
- package/shared/definition40.cjs +220 -148
- package/shared/definition40.js +220 -148
- package/shared/definition41.cjs +144 -568
- package/shared/definition41.js +144 -569
- package/shared/definition42.cjs +476 -967
- package/shared/definition42.js +477 -969
- package/shared/definition43.cjs +13508 -851
- package/shared/definition43.js +13508 -851
- package/shared/definition44.cjs +1111 -103
- package/shared/definition44.js +1112 -103
- package/shared/definition45.cjs +849 -80
- package/shared/definition45.js +849 -80
- package/shared/definition46.cjs +108 -464
- package/shared/definition46.js +107 -463
- package/shared/definition47.cjs +96 -118
- package/shared/definition47.js +95 -118
- package/shared/definition48.cjs +430 -82
- package/shared/definition48.js +430 -83
- package/shared/definition49.cjs +135 -15
- package/shared/definition49.js +134 -15
- package/shared/definition5.cjs +5 -4
- package/shared/definition5.js +6 -6
- package/shared/definition50.cjs +109 -85
- package/shared/definition50.js +108 -85
- package/shared/definition51.cjs +14 -519
- package/shared/definition51.js +13 -519
- package/shared/definition52.cjs +96 -23
- package/shared/definition52.js +95 -23
- package/shared/definition53.cjs +480 -99
- package/shared/definition53.js +479 -99
- package/shared/definition54.cjs +24 -296
- package/shared/definition54.js +23 -296
- package/shared/definition55.cjs +126 -69
- package/shared/definition55.js +125 -69
- package/shared/definition56.cjs +186 -775
- package/shared/definition56.js +187 -776
- package/shared/definition57.cjs +511 -107
- package/shared/definition57.js +511 -107
- package/shared/definition58.cjs +27 -128
- package/shared/definition58.js +27 -128
- package/shared/definition59.cjs +106 -162
- package/shared/definition59.js +105 -160
- package/shared/definition6.cjs +3 -2
- package/shared/definition6.js +4 -4
- package/shared/definition60.cjs +81 -252
- package/shared/definition60.js +80 -252
- package/shared/definition61.cjs +156 -70156
- package/shared/definition61.js +154 -70156
- package/shared/definition62.cjs +271 -29
- package/shared/definition62.js +270 -28
- package/shared/definition63.cjs +69236 -2018
- package/shared/definition63.js +69235 -2016
- package/shared/definition64.cjs +55 -0
- package/shared/definition64.js +51 -0
- package/shared/definition65.cjs +2195 -0
- package/shared/definition65.js +2190 -0
- package/shared/definition7.cjs +3 -2
- package/shared/definition7.js +4 -4
- package/shared/definition8.cjs +5 -10
- package/shared/definition8.js +6 -12
- package/shared/definition9.cjs +2 -2
- package/shared/definition9.js +3 -3
- package/shared/delegates-aria.cjs +69 -0
- package/shared/delegates-aria.js +67 -0
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/form-elements.cjs +8 -8
- package/shared/form-elements.js +9 -9
- package/shared/foundation/anchor/anchor.d.ts +0 -8
- package/shared/foundation/button/button.d.ts +449 -7
- package/shared/foundation/listbox/listbox.d.ts +0 -9
- package/shared/foundation/vivid-element/vivid-element.d.ts +1 -0
- package/shared/listbox.cjs +4 -30
- package/shared/listbox.js +4 -30
- package/shared/localization/Locale.d.ts +6 -2
- package/shared/option.cjs +1 -38
- package/shared/option.js +1 -38
- package/shared/patterns/anchored.d.ts +891 -10
- package/shared/patterns/trapped-focus.d.ts +2 -0
- package/shared/picker-field/locale.d.ts +4 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +558 -0
- package/shared/{date-picker/locale.d.ts → picker-field/mixins/calendar-picker.locale.d.ts} +1 -3
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +555 -0
- package/shared/picker-field/mixins/calendar-segments/calendarGrid.d.ts +17 -0
- package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/monthPickerGrid.d.ts +3 -3
- package/shared/picker-field/mixins/inline-time-picker/columns.d.ts +13 -0
- package/shared/picker-field/mixins/inline-time-picker/definition.d.ts +1 -0
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +15 -0
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.template.d.ts +5 -0
- package/{lib/time-picker/time/picker.d.ts → shared/picker-field/mixins/inline-time-picker/picker-option.d.ts} +1 -1
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +1110 -0
- package/shared/picker-field/mixins/single-date-picker.d.ts +1626 -0
- package/shared/picker-field/mixins/single-value-picker.d.ts +518 -0
- package/shared/picker-field/mixins/time-selection-picker.d.ts +1053 -0
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +1050 -0
- package/shared/picker-field/picker-field.d.ts +11 -0
- package/shared/picker-field/picker-field.form-associated.d.ts +11 -0
- package/shared/picker-field/picker-field.template.d.ts +7 -0
- package/shared/picker-field.template.cjs +315 -0
- package/shared/picker-field.template.js +310 -0
- package/shared/single-date-picker.cjs +46 -0
- package/shared/single-date-picker.js +44 -0
- package/shared/single-value-picker.cjs +77 -0
- package/shared/single-value-picker.js +75 -0
- package/shared/slider.template.cjs +6 -6
- package/shared/slider.template.js +6 -6
- package/shared/text-anchor.cjs +2 -1
- package/shared/text-anchor.js +2 -1
- package/shared/text-anchor.template.cjs +5 -7
- package/shared/text-anchor.template.js +5 -7
- package/shared/time-selection-picker.template.cjs +776 -0
- package/shared/time-selection-picker.template.js +767 -0
- package/shared/utils/mixins.d.ts +3 -0
- package/shared/vivid-element.cjs +3 -0
- package/shared/vivid-element.js +4 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-anchor/index.cjs +1 -1
- package/text-anchor/index.js +2 -2
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- 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 +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +21748 -1
- package/lib/time-picker/time-picker.form-associated.d.ts +0 -11
- package/shared/aria-global.cjs +0 -93
- package/shared/aria-global.js +0 -91
- package/shared/date-picker/calendar/calendarGrid.d.ts +0 -17
- package/shared/date-picker/calendar/presentationDate.d.ts +0 -4
- package/shared/date-picker/date-picker-base.d.ts +0 -21
- package/shared/date-picker/date-picker-base.form-associated.d.ts +0 -11
- package/shared/date-picker/date-picker-base.template.d.ts +0 -3
- package/shared/foundation/patterns/aria-global.d.ts +0 -21
- package/shared/foundation/patterns/index.d.ts +0 -1
- package/shared/text-field2.cjs +0 -575
- package/shared/text-field2.js +0 -572
- package/shared/trapped-focus.cjs +0 -29
- package/shared/trapped-focus.js +0 -27
- /package/shared/{date-picker/calendar → datetime}/dateRange.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/dateStr.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/month.d.ts +0 -0
- /package/{lib/time-picker/time → shared/datetime}/presentationTime.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/year.d.ts +0 -0
- /package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/segment.d.ts +0 -0
package/shared/definition29.cjs
CHANGED
|
@@ -1,365 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const definition$1 = require('./definition63.cjs');
|
|
4
|
-
const definition = require('./definition27.cjs');
|
|
5
3
|
const vividElement = require('./vivid-element.cjs');
|
|
6
|
-
const keyCodes = require('./key-codes.cjs');
|
|
7
|
-
const affix = require('./affix.cjs');
|
|
8
|
-
const applyMixins = require('./apply-mixins.cjs');
|
|
9
|
-
const direction = require('./direction.cjs');
|
|
10
|
-
const anchored = require('./anchored.cjs');
|
|
11
|
-
const dom = require('./dom.cjs');
|
|
12
|
-
const index = require('./index.cjs');
|
|
13
|
-
const ref = require('./ref.cjs');
|
|
14
|
-
const slotted = require('./slotted.cjs');
|
|
15
4
|
const classNames = require('./class-names.cjs');
|
|
16
|
-
const when = require('./when.cjs');
|
|
17
|
-
|
|
18
|
-
const styles$1 = ":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}.base:where(.hover,: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:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected):where(.hover,: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{display:flex;box-sizing:border-box;align-items:center;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:12px}.base.two-lines{padding:12px;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)))}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}:host(:not([role=presentation]):focus-visible) .base{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - 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],[aria-checked=true],[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)}";
|
|
19
|
-
|
|
20
|
-
const MenuItemRole = {
|
|
21
|
-
menuitem: "menuitem",
|
|
22
|
-
menuitemcheckbox: "menuitemcheckbox",
|
|
23
|
-
menuitemradio: "menuitemradio",
|
|
24
|
-
presentation: "presentation"
|
|
25
|
-
};
|
|
26
|
-
const roleForMenuItem = {
|
|
27
|
-
[MenuItemRole.menuitem]: "menuitem",
|
|
28
|
-
[MenuItemRole.menuitemcheckbox]: "menuitemcheckbox",
|
|
29
|
-
[MenuItemRole.menuitemradio]: "menuitemradio",
|
|
30
|
-
[MenuItemRole.presentation]: "presentation"
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var __defProp$1 = Object.defineProperty;
|
|
34
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
35
|
-
var __typeError = (msg) => {
|
|
36
|
-
throw TypeError(msg);
|
|
37
|
-
};
|
|
38
|
-
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
39
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
40
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
41
|
-
if (decorator = decorators[i])
|
|
42
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
43
|
-
if (kind && result) __defProp$1(target, key, result);
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
46
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
47
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
48
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
49
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
50
|
-
var _Menu_instances, triggerBehaviour_get, setupAnchor_fn, updateAnchor_fn, cleanupAnchor_fn, _onAnchorClick;
|
|
51
|
-
exports.Menu = class Menu extends vividElement.VividElement {
|
|
52
|
-
constructor() {
|
|
53
|
-
super(...arguments);
|
|
54
|
-
__privateAdd(this, _Menu_instances);
|
|
55
|
-
this.expandedItem = null;
|
|
56
|
-
/**
|
|
57
|
-
* The index of the focusable element in the items array
|
|
58
|
-
* defaults to -1
|
|
59
|
-
*/
|
|
60
|
-
this.focusIndex = -1;
|
|
61
|
-
/**
|
|
62
|
-
* if focus is moving out of the menu, reset to a stable initial state
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
this.handleFocusOut = (e) => {
|
|
66
|
-
if (!this.contains(e.relatedTarget) && this.menuItems !== void 0 && this.menuItems.length) {
|
|
67
|
-
this.collapseExpandedItem();
|
|
68
|
-
const focusIndex = this.menuItems.findIndex(
|
|
69
|
-
this.isFocusableElement
|
|
70
|
-
);
|
|
71
|
-
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
72
|
-
this.menuItems[focusIndex].setAttribute("tabindex", "0");
|
|
73
|
-
this.focusIndex = focusIndex;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
this.handleItemFocus = (e) => {
|
|
77
|
-
const targetItem = e.target;
|
|
78
|
-
if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) {
|
|
79
|
-
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
80
|
-
this.focusIndex = this.menuItems.indexOf(targetItem);
|
|
81
|
-
targetItem.setAttribute("tabindex", "0");
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
this.handleExpandedChanged = (e) => {
|
|
85
|
-
const changedItem = e.target;
|
|
86
|
-
if (this.expandedItem !== null && changedItem === this.expandedItem && changedItem.expanded === false) {
|
|
87
|
-
this.expandedItem = null;
|
|
88
|
-
}
|
|
89
|
-
if (changedItem.expanded) {
|
|
90
|
-
this.expandedItem = changedItem;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
this.removeItemListeners = () => {
|
|
94
|
-
if (this.menuItems !== void 0) {
|
|
95
|
-
this.menuItems.forEach((item) => {
|
|
96
|
-
item.removeEventListener("expanded-change", this.handleExpandedChanged);
|
|
97
|
-
item.removeEventListener(
|
|
98
|
-
"focus",
|
|
99
|
-
this.handleItemFocus
|
|
100
|
-
);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
this.setItems = () => {
|
|
105
|
-
const newItems = this.domChildren();
|
|
106
|
-
this.removeItemListeners();
|
|
107
|
-
this.menuItems = newItems;
|
|
108
|
-
const menuItems = this.menuItems.filter(this.isMenuItemElement);
|
|
109
|
-
if (menuItems.length) {
|
|
110
|
-
this.focusIndex = 0;
|
|
111
|
-
}
|
|
112
|
-
menuItems.forEach((item, index) => {
|
|
113
|
-
item.setAttribute("tabindex", index === 0 ? "0" : "-1");
|
|
114
|
-
item.addEventListener("expanded-change", this.handleExpandedChanged);
|
|
115
|
-
item.addEventListener("focus", this.handleItemFocus);
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* check if the item is a menu item
|
|
120
|
-
*/
|
|
121
|
-
this.isMenuItemElement = (el) => {
|
|
122
|
-
return dom.isHTMLElement(el) && Object.prototype.hasOwnProperty.call(
|
|
123
|
-
exports.Menu.focusableElementRoles,
|
|
124
|
-
el.getAttribute("role")
|
|
125
|
-
);
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* check if the item is focusable
|
|
129
|
-
*/
|
|
130
|
-
this.isFocusableElement = (el) => {
|
|
131
|
-
return this.isMenuItemElement(el);
|
|
132
|
-
};
|
|
133
|
-
this.ariaLabel = null;
|
|
134
|
-
this.placement = "bottom";
|
|
135
|
-
this.autoDismiss = false;
|
|
136
|
-
this.positionStrategy = "fixed";
|
|
137
|
-
this.open = false;
|
|
138
|
-
__privateAdd(this, _onAnchorClick, () => {
|
|
139
|
-
if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "off") {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "legacy" && this.open) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const newValue = !this.open;
|
|
146
|
-
vividElement.DOM.queueUpdate(() => this.open = newValue);
|
|
147
|
-
});
|
|
148
|
-
this._onFocusout = (e) => {
|
|
149
|
-
const focusTarget = e.relatedTarget;
|
|
150
|
-
const focusMovedAway = !this.contains(focusTarget) && !this._anchorEl?.contains(focusTarget);
|
|
151
|
-
if (this.autoDismiss && focusMovedAway) {
|
|
152
|
-
this.open = false;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* @internal
|
|
158
|
-
*/
|
|
159
|
-
itemsChanged() {
|
|
160
|
-
if (this.$fastController.isConnected && this.menuItems !== void 0) {
|
|
161
|
-
this.setItems();
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* @internal
|
|
166
|
-
*/
|
|
167
|
-
connectedCallback() {
|
|
168
|
-
super.connectedCallback();
|
|
169
|
-
vividElement.DOM.queueUpdate(() => {
|
|
170
|
-
this.setItems();
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* @internal
|
|
175
|
-
*/
|
|
176
|
-
disconnectedCallback() {
|
|
177
|
-
super.disconnectedCallback();
|
|
178
|
-
this.removeItemListeners();
|
|
179
|
-
this.menuItems = void 0;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Moves focus into the menu. If there is a child with the `autofocus` attribute, it will be focused.
|
|
183
|
-
* Otherwise, the first focusable child will be focused.
|
|
184
|
-
*
|
|
185
|
-
* @public
|
|
186
|
-
*/
|
|
187
|
-
focus() {
|
|
188
|
-
const autoFocusElement = this.querySelector(
|
|
189
|
-
'[autofocus]:not([slot="anchor"])'
|
|
190
|
-
);
|
|
191
|
-
if (autoFocusElement instanceof HTMLElement) {
|
|
192
|
-
autoFocusElement.focus();
|
|
193
|
-
} else {
|
|
194
|
-
this.setFocus(0, 1);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Collapses any expanded Menu Items.
|
|
199
|
-
*
|
|
200
|
-
* @public
|
|
201
|
-
*/
|
|
202
|
-
collapseExpandedItem() {
|
|
203
|
-
if (this.expandedItem !== null) {
|
|
204
|
-
this.expandedItem.expanded = false;
|
|
205
|
-
this.expandedItem = null;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* @internal
|
|
210
|
-
*/
|
|
211
|
-
handleMenuKeyDown(e) {
|
|
212
|
-
if (e.defaultPrevented || this.menuItems === void 0) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
switch (e.key) {
|
|
216
|
-
case keyCodes.keyArrowDown:
|
|
217
|
-
this.setFocus(this.focusIndex + 1, 1);
|
|
218
|
-
return;
|
|
219
|
-
case keyCodes.keyArrowUp:
|
|
220
|
-
this.setFocus(this.focusIndex - 1, -1);
|
|
221
|
-
return;
|
|
222
|
-
case keyCodes.keyEnd:
|
|
223
|
-
this.setFocus(this.menuItems.length - 1, -1);
|
|
224
|
-
return;
|
|
225
|
-
case keyCodes.keyHome:
|
|
226
|
-
this.setFocus(0, 1);
|
|
227
|
-
return;
|
|
228
|
-
default:
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* get an array of valid DOM children
|
|
234
|
-
*/
|
|
235
|
-
domChildren() {
|
|
236
|
-
return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")).filter((child) => !child.hasAttribute("slot"));
|
|
237
|
-
}
|
|
238
|
-
setFocus(focusIndex, adjustment) {
|
|
239
|
-
if (this.menuItems === void 0) {
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
while (focusIndex >= 0 && focusIndex < this.menuItems.length) {
|
|
243
|
-
const child = this.menuItems[focusIndex];
|
|
244
|
-
if (this.isFocusableElement(child)) {
|
|
245
|
-
if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) {
|
|
246
|
-
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
247
|
-
}
|
|
248
|
-
this.focusIndex = focusIndex;
|
|
249
|
-
child.setAttribute("tabindex", "0");
|
|
250
|
-
child.focus();
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
focusIndex += adjustment;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
openChanged(_, newValue) {
|
|
257
|
-
if (newValue) {
|
|
258
|
-
this._popupEl?.show();
|
|
259
|
-
this.focus();
|
|
260
|
-
}
|
|
261
|
-
newValue ? this.$emit("open", void 0, { bubbles: false }) : this.$emit("close", void 0, { bubbles: false });
|
|
262
|
-
if (this._anchorEl) {
|
|
263
|
-
__privateMethod(this, _Menu_instances, updateAnchor_fn).call(this, this._anchorEl);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* @internal
|
|
268
|
-
*/
|
|
269
|
-
_anchorElChanged(oldValue, newValue) {
|
|
270
|
-
if (oldValue) __privateMethod(this, _Menu_instances, cleanupAnchor_fn).call(this, oldValue);
|
|
271
|
-
if (newValue) __privateMethod(this, _Menu_instances, setupAnchor_fn).call(this, newValue);
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* @internal
|
|
275
|
-
*/
|
|
276
|
-
_onChange(e) {
|
|
277
|
-
const clickedOnNonCheckboxMenuItem = e.target instanceof HTMLElement && (e.target.role === "menuitem" || e.target.role === "menuitemradio");
|
|
278
|
-
if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
|
|
279
|
-
this.open = false;
|
|
280
|
-
}
|
|
281
|
-
const changedMenuItem = e.target;
|
|
282
|
-
const changeItemIndex = this.menuItems.indexOf(changedMenuItem);
|
|
283
|
-
if (changeItemIndex === -1) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked) {
|
|
287
|
-
for (let i = changeItemIndex - 1; i >= 0; --i) {
|
|
288
|
-
const item = this.menuItems[i];
|
|
289
|
-
const role = item.getAttribute("role");
|
|
290
|
-
if (role === MenuItemRole.menuitemradio) {
|
|
291
|
-
item.checked = false;
|
|
292
|
-
}
|
|
293
|
-
if (role === "separator") {
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
const maxIndex = this.menuItems.length - 1;
|
|
298
|
-
for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
|
|
299
|
-
const item = this.menuItems[i];
|
|
300
|
-
const role = item.getAttribute("role");
|
|
301
|
-
if (role === MenuItemRole.menuitemradio) {
|
|
302
|
-
item.checked = false;
|
|
303
|
-
}
|
|
304
|
-
if (role === "separator") {
|
|
305
|
-
break;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
return true;
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
_Menu_instances = new WeakSet();
|
|
313
|
-
triggerBehaviour_get = function() {
|
|
314
|
-
return this.trigger ?? "legacy";
|
|
315
|
-
};
|
|
316
|
-
setupAnchor_fn = function(a) {
|
|
317
|
-
a.addEventListener("click", __privateGet(this, _onAnchorClick), true);
|
|
318
|
-
a.addEventListener("focusout", this._onFocusout);
|
|
319
|
-
a.setAttribute("aria-haspopup", "menu");
|
|
320
|
-
__privateMethod(this, _Menu_instances, updateAnchor_fn).call(this, a);
|
|
321
|
-
};
|
|
322
|
-
updateAnchor_fn = function(a) {
|
|
323
|
-
a.setAttribute("aria-expanded", this.open.toString());
|
|
324
|
-
};
|
|
325
|
-
cleanupAnchor_fn = function(a) {
|
|
326
|
-
a.removeEventListener("click", __privateGet(this, _onAnchorClick), true);
|
|
327
|
-
a.removeEventListener("focusout", this._onFocusout);
|
|
328
|
-
a.removeAttribute("aria-hasPopup");
|
|
329
|
-
a.removeAttribute("aria-expanded");
|
|
330
|
-
};
|
|
331
|
-
_onAnchorClick = new WeakMap();
|
|
332
|
-
exports.Menu.focusableElementRoles = roleForMenuItem;
|
|
333
|
-
__decorateClass$1([
|
|
334
|
-
vividElement.observable
|
|
335
|
-
], exports.Menu.prototype, "items", 2);
|
|
336
|
-
__decorateClass$1([
|
|
337
|
-
vividElement.attr({ attribute: "aria-label" })
|
|
338
|
-
], exports.Menu.prototype, "ariaLabel", 2);
|
|
339
|
-
__decorateClass$1([
|
|
340
|
-
vividElement.attr({ mode: "fromView" })
|
|
341
|
-
], exports.Menu.prototype, "placement", 2);
|
|
342
|
-
__decorateClass$1([
|
|
343
|
-
vividElement.attr
|
|
344
|
-
], exports.Menu.prototype, "trigger", 2);
|
|
345
|
-
__decorateClass$1([
|
|
346
|
-
vividElement.attr({ mode: "boolean", attribute: "auto-dismiss" })
|
|
347
|
-
], exports.Menu.prototype, "autoDismiss", 2);
|
|
348
|
-
__decorateClass$1([
|
|
349
|
-
vividElement.attr({ mode: "fromView", attribute: "position-strategy" })
|
|
350
|
-
], exports.Menu.prototype, "positionStrategy", 2);
|
|
351
|
-
__decorateClass$1([
|
|
352
|
-
vividElement.attr({ mode: "boolean" })
|
|
353
|
-
], exports.Menu.prototype, "open", 2);
|
|
354
|
-
__decorateClass$1([
|
|
355
|
-
vividElement.observable
|
|
356
|
-
], exports.Menu.prototype, "headerSlottedContent", 2);
|
|
357
|
-
__decorateClass$1([
|
|
358
|
-
vividElement.observable
|
|
359
|
-
], exports.Menu.prototype, "actionItemsSlottedContent", 2);
|
|
360
|
-
exports.Menu = __decorateClass$1([
|
|
361
|
-
anchored.anchored
|
|
362
|
-
], exports.Menu);
|
|
363
5
|
|
|
364
6
|
var __defProp = Object.defineProperty;
|
|
365
7
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -370,435 +12,58 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
370
12
|
if (result) __defProp(target, key, result);
|
|
371
13
|
return result;
|
|
372
14
|
};
|
|
373
|
-
|
|
374
|
-
CheckAppearance2["Normal"] = "normal";
|
|
375
|
-
CheckAppearance2["TickOnly"] = "tick-only";
|
|
376
|
-
return CheckAppearance2;
|
|
377
|
-
})(CheckAppearance || {});
|
|
378
|
-
class MenuItem extends vividElement.VividElement {
|
|
379
|
-
constructor() {
|
|
380
|
-
super();
|
|
381
|
-
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
382
|
-
this.role = MenuItemRole.menuitem;
|
|
383
|
-
this.hasSubmenu = false;
|
|
384
|
-
this.currentDirection = direction.Direction.ltr;
|
|
385
|
-
/**
|
|
386
|
-
* @internal
|
|
387
|
-
*/
|
|
388
|
-
this.handleMenuItemClick = (e) => {
|
|
389
|
-
if (e.defaultPrevented || this.disabled) {
|
|
390
|
-
return false;
|
|
391
|
-
}
|
|
392
|
-
this.invoke();
|
|
393
|
-
return false;
|
|
394
|
-
};
|
|
395
|
-
/**
|
|
396
|
-
* @internal
|
|
397
|
-
*/
|
|
398
|
-
this.handleMouseOver = (_) => {
|
|
399
|
-
if (this.disabled || !this.hasSubmenu || this.expanded) {
|
|
400
|
-
return false;
|
|
401
|
-
}
|
|
402
|
-
this.expanded = true;
|
|
403
|
-
return false;
|
|
404
|
-
};
|
|
405
|
-
/**
|
|
406
|
-
* @internal
|
|
407
|
-
*/
|
|
408
|
-
this.handleMouseOut = (_) => {
|
|
409
|
-
if (!this.expanded || this.contains(document.activeElement)) {
|
|
410
|
-
return false;
|
|
411
|
-
}
|
|
412
|
-
this.expanded = false;
|
|
413
|
-
return false;
|
|
414
|
-
};
|
|
415
|
-
this.invoke = () => {
|
|
416
|
-
if (this.disabled) {
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
|
-
switch (this.role) {
|
|
420
|
-
case MenuItemRole.menuitemcheckbox:
|
|
421
|
-
this.checked = !this.checked;
|
|
422
|
-
break;
|
|
423
|
-
case MenuItemRole.menuitem:
|
|
424
|
-
this.updateSubmenu();
|
|
425
|
-
if (this.hasSubmenu) {
|
|
426
|
-
this.expanded = true;
|
|
427
|
-
} else {
|
|
428
|
-
this.$emit("change");
|
|
429
|
-
}
|
|
430
|
-
break;
|
|
431
|
-
case MenuItemRole.menuitemradio:
|
|
432
|
-
if (!this.checked) {
|
|
433
|
-
this.checked = true;
|
|
434
|
-
}
|
|
435
|
-
break;
|
|
436
|
-
}
|
|
437
|
-
};
|
|
438
|
-
this.checkTrailing = false;
|
|
439
|
-
this.#submenuArray = [];
|
|
440
|
-
/**
|
|
441
|
-
* @internal
|
|
442
|
-
*/
|
|
443
|
-
this.handleMenuItemKeyDown = (e) => {
|
|
444
|
-
if (e.defaultPrevented) {
|
|
445
|
-
return false;
|
|
446
|
-
}
|
|
447
|
-
switch (e.key) {
|
|
448
|
-
case keyCodes.keyEnter:
|
|
449
|
-
case keyCodes.keySpace:
|
|
450
|
-
this.invoke();
|
|
451
|
-
if (!this.disabled) {
|
|
452
|
-
this.#emitSyntheticClick();
|
|
453
|
-
}
|
|
454
|
-
return false;
|
|
455
|
-
case keyCodes.keyArrowRight:
|
|
456
|
-
if (this.hasSubmenu) {
|
|
457
|
-
this.expanded = true;
|
|
458
|
-
this.#emitSyntheticClick();
|
|
459
|
-
}
|
|
460
|
-
return false;
|
|
461
|
-
case keyCodes.keyArrowLeft:
|
|
462
|
-
if (this.expanded) {
|
|
463
|
-
this.#emitSyntheticClick();
|
|
464
|
-
this.expanded = false;
|
|
465
|
-
this.focus();
|
|
466
|
-
return false;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
return true;
|
|
470
|
-
};
|
|
471
|
-
this.#syntheticClickEvents = /* @__PURE__ */ new WeakSet();
|
|
472
|
-
this.addEventListener("expanded-change", this.#expandedChange);
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* @internal
|
|
476
|
-
*/
|
|
477
|
-
expandedChanged() {
|
|
478
|
-
if (this.$fastController.isConnected) {
|
|
479
|
-
if (this.submenu === void 0) {
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
if (this.expanded === false) {
|
|
483
|
-
this.submenu.collapseExpandedItem();
|
|
484
|
-
} else {
|
|
485
|
-
this.currentDirection = direction.getDirection(this);
|
|
486
|
-
}
|
|
487
|
-
this.$emit("expanded-change", this, { bubbles: false });
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* @internal
|
|
492
|
-
*/
|
|
493
|
-
checkedChanged() {
|
|
494
|
-
if (this.$fastController.isConnected) {
|
|
495
|
-
this.$emit("change");
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* @internal
|
|
500
|
-
*/
|
|
501
|
-
connectedCallback() {
|
|
502
|
-
super.connectedCallback();
|
|
503
|
-
vividElement.DOM.queueUpdate(() => {
|
|
504
|
-
this.updateSubmenu();
|
|
505
|
-
});
|
|
506
|
-
this.observer = new MutationObserver(this.updateSubmenu);
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* @internal
|
|
510
|
-
*/
|
|
511
|
-
disconnectedCallback() {
|
|
512
|
-
super.disconnectedCallback();
|
|
513
|
-
this.submenu = void 0;
|
|
514
|
-
if (this.observer !== void 0) {
|
|
515
|
-
this.observer.disconnect();
|
|
516
|
-
this.observer = void 0;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
#submenuArray;
|
|
520
|
-
/**
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
* @internal
|
|
524
|
-
*/
|
|
525
|
-
slottedSubmenuChanged(_oldValue, newValue) {
|
|
526
|
-
this.#submenuArray = newValue;
|
|
527
|
-
}
|
|
528
|
-
updateSubmenu() {
|
|
529
|
-
for (const submenu of this.#submenuArray) {
|
|
530
|
-
this.submenu = submenu;
|
|
531
|
-
this.submenu.anchor = this;
|
|
532
|
-
this.submenu.placement = "right-start";
|
|
533
|
-
this.submenu.collapseExpandedItem = () => this.#collapseExpandedItem();
|
|
534
|
-
}
|
|
535
|
-
this.hasSubmenu = this.submenu === void 0 ? false : true;
|
|
536
|
-
}
|
|
537
|
-
#collapseExpandedItem() {
|
|
538
|
-
this.expanded = false;
|
|
539
|
-
}
|
|
540
|
-
#expandedChange() {
|
|
541
|
-
if (this.hasSubmenu) {
|
|
542
|
-
this.submenu.open = this.expanded;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
#syntheticClickEvents;
|
|
546
|
-
/**
|
|
547
|
-
* @internal
|
|
548
|
-
*/
|
|
549
|
-
_isSyntheticClickEvent(event) {
|
|
550
|
-
return this.#syntheticClickEvents.has(event);
|
|
551
|
-
}
|
|
552
|
-
#emitSyntheticClick() {
|
|
553
|
-
const mouseEvent = new MouseEvent("click", {
|
|
554
|
-
bubbles: true,
|
|
555
|
-
composed: true
|
|
556
|
-
});
|
|
557
|
-
this.#syntheticClickEvents.add(mouseEvent);
|
|
558
|
-
this.dispatchEvent(mouseEvent);
|
|
559
|
-
}
|
|
15
|
+
class Layout extends vividElement.VividElement {
|
|
560
16
|
}
|
|
561
|
-
__decorateClass([
|
|
562
|
-
vividElement.attr({ mode: "boolean" })
|
|
563
|
-
], MenuItem.prototype, "disabled");
|
|
564
|
-
__decorateClass([
|
|
565
|
-
vividElement.attr({ mode: "boolean" })
|
|
566
|
-
], MenuItem.prototype, "expanded");
|
|
567
|
-
__decorateClass([
|
|
568
|
-
vividElement.attr
|
|
569
|
-
], MenuItem.prototype, "role");
|
|
570
|
-
__decorateClass([
|
|
571
|
-
vividElement.attr({ mode: "boolean" })
|
|
572
|
-
], MenuItem.prototype, "checked");
|
|
573
|
-
__decorateClass([
|
|
574
|
-
vividElement.observable
|
|
575
|
-
], MenuItem.prototype, "hasSubmenu");
|
|
576
|
-
__decorateClass([
|
|
577
|
-
vividElement.observable
|
|
578
|
-
], MenuItem.prototype, "currentDirection");
|
|
579
|
-
__decorateClass([
|
|
580
|
-
vividElement.observable
|
|
581
|
-
], MenuItem.prototype, "submenu");
|
|
582
17
|
__decorateClass([
|
|
583
18
|
vividElement.attr
|
|
584
|
-
],
|
|
585
|
-
__decorateClass([
|
|
586
|
-
vividElement.attr({ attribute: "text-secondary" })
|
|
587
|
-
], MenuItem.prototype, "textSecondary");
|
|
588
|
-
__decorateClass([
|
|
589
|
-
vividElement.attr
|
|
590
|
-
], MenuItem.prototype, "connotation");
|
|
591
|
-
__decorateClass([
|
|
592
|
-
vividElement.attr({ mode: "boolean", attribute: "check-trailing" })
|
|
593
|
-
], MenuItem.prototype, "checkTrailing");
|
|
19
|
+
], Layout.prototype, "gutters");
|
|
594
20
|
__decorateClass([
|
|
595
|
-
vividElement.attr({ attribute: "
|
|
596
|
-
],
|
|
21
|
+
vividElement.attr({ attribute: "column-basis" })
|
|
22
|
+
], Layout.prototype, "columnBasis");
|
|
597
23
|
__decorateClass([
|
|
598
|
-
vividElement.
|
|
599
|
-
],
|
|
24
|
+
vividElement.attr({ attribute: "column-spacing" })
|
|
25
|
+
], Layout.prototype, "columnSpacing");
|
|
600
26
|
__decorateClass([
|
|
601
|
-
vividElement.
|
|
602
|
-
],
|
|
27
|
+
vividElement.attr({ attribute: "row-spacing" })
|
|
28
|
+
], Layout.prototype, "rowSpacing");
|
|
603
29
|
__decorateClass([
|
|
604
|
-
vividElement.
|
|
605
|
-
],
|
|
606
|
-
applyMixins.applyMixins(MenuItem, affix.AffixIcon);
|
|
607
|
-
|
|
608
|
-
const getIndicatorIcon = (x) => {
|
|
609
|
-
if (x.checkedAppearance === CheckAppearance.TickOnly) {
|
|
610
|
-
return x.checked ? "check-line" : "";
|
|
611
|
-
}
|
|
612
|
-
const iconType = x.role === MenuItemRole.menuitemcheckbox ? "checkbox" : "radio";
|
|
613
|
-
const iconStatus = x.checked ? "checked" : "unchecked";
|
|
614
|
-
return `${iconType}-${iconStatus}-2-line`;
|
|
615
|
-
};
|
|
616
|
-
const getClasses$1 = ({
|
|
617
|
-
connotation,
|
|
618
|
-
disabled,
|
|
619
|
-
checked,
|
|
620
|
-
role,
|
|
621
|
-
text: text2,
|
|
622
|
-
textSecondary,
|
|
623
|
-
icon,
|
|
624
|
-
metaSlottedContent,
|
|
625
|
-
checkTrailing
|
|
626
|
-
}) => classNames.classNames(
|
|
627
|
-
"base",
|
|
628
|
-
[`connotation-${connotation}`, Boolean(connotation)],
|
|
629
|
-
["disabled", Boolean(disabled)],
|
|
630
|
-
["selected", role !== MenuItemRole.menuitem && Boolean(checked)],
|
|
631
|
-
[
|
|
632
|
-
"trailing",
|
|
633
|
-
role !== MenuItemRole.menuitem && (checkTrailing || Boolean(icon))
|
|
634
|
-
],
|
|
635
|
-
["item-checkbox", role === MenuItemRole.menuitemcheckbox],
|
|
636
|
-
["item-radio", role === MenuItemRole.menuitemradio],
|
|
637
|
-
["two-lines", Boolean(text2?.length) && Boolean(textSecondary?.length)],
|
|
638
|
-
["has-meta", Boolean(metaSlottedContent?.length)]
|
|
639
|
-
);
|
|
640
|
-
function handleClick(x, { event }) {
|
|
641
|
-
if (x._isSyntheticClickEvent(event)) {
|
|
642
|
-
return true;
|
|
643
|
-
}
|
|
644
|
-
x.handleMenuItemClick(event);
|
|
645
|
-
return x.role === MenuItemRole.presentation;
|
|
646
|
-
}
|
|
647
|
-
function checkIndicator(context) {
|
|
648
|
-
const iconTag = context.tagFor(definition.Icon);
|
|
649
|
-
return vividElement.html`${when.when(
|
|
650
|
-
(x) => x.role === MenuItemRole.menuitemcheckbox || x.role === MenuItemRole.menuitemradio,
|
|
651
|
-
vividElement.html`<span class="action"><${iconTag} class="icon" name="${(x) => getIndicatorIcon(x)}"></${iconTag}></span>`
|
|
652
|
-
)}`;
|
|
653
|
-
}
|
|
654
|
-
function text() {
|
|
655
|
-
return vividElement.html`${when.when(
|
|
656
|
-
(x) => x.text || x.textSecondary,
|
|
657
|
-
vividElement.html`<span class="text">
|
|
658
|
-
${when.when(
|
|
659
|
-
(x) => x.text,
|
|
660
|
-
vividElement.html`<span class="text-primary">${(x) => x.text}</span>`
|
|
661
|
-
)}
|
|
662
|
-
${when.when(
|
|
663
|
-
(x) => x.textSecondary,
|
|
664
|
-
vividElement.html`<span class="text-secondary">${(x) => x.textSecondary}</span>`
|
|
665
|
-
)}
|
|
666
|
-
</span>`
|
|
667
|
-
)}`;
|
|
668
|
-
}
|
|
669
|
-
const MenuItemTemplate = (context) => {
|
|
670
|
-
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
671
|
-
const iconTag = context.tagFor(definition.Icon);
|
|
672
|
-
return vividElement.html`
|
|
673
|
-
<template
|
|
674
|
-
role="${(x) => x.role ? x.role : MenuItemRole.menuitem}"
|
|
675
|
-
aria-haspopup="${(x) => x.hasSubmenu ? "menu" : void 0}"
|
|
676
|
-
aria-checked="${(x) => x.role !== MenuItemRole.menuitem ? x.checked : void 0}"
|
|
677
|
-
aria-disabled="${(x) => x.disabled}"
|
|
678
|
-
aria-expanded="${(x) => x.expanded}"
|
|
679
|
-
@keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}"
|
|
680
|
-
@click="${handleClick}"
|
|
681
|
-
@mouseover="${(x, c) => x.handleMouseOver(c.event)}"
|
|
682
|
-
@mouseout="${(x, c) => x.handleMouseOut(c.event)}"
|
|
683
|
-
>
|
|
684
|
-
<div class="${getClasses$1}">
|
|
685
|
-
<slot name="meta" ${slotted.slotted("metaSlottedContent")}></slot>
|
|
686
|
-
${checkIndicator(context)}
|
|
687
|
-
${when.when(
|
|
688
|
-
(x) => x.icon,
|
|
689
|
-
vividElement.html`<span class="decorative"
|
|
690
|
-
>${(x) => affixIconTemplate(x.icon)}</span
|
|
691
|
-
>`
|
|
692
|
-
)}
|
|
693
|
-
${text()}
|
|
694
|
-
<slot
|
|
695
|
-
name="trailing-meta"
|
|
696
|
-
${slotted.slotted("trailingMetaSlottedContent")}
|
|
697
|
-
></slot>
|
|
698
|
-
${when.when(
|
|
699
|
-
(x) => x.hasSubmenu,
|
|
700
|
-
vividElement.html`<${iconTag} class="chevron" name="chevron-right-line"></${iconTag}>`
|
|
701
|
-
)}
|
|
702
|
-
</div>
|
|
703
|
-
<slot
|
|
704
|
-
name="submenu"
|
|
705
|
-
${slotted.slotted({
|
|
706
|
-
property: "slottedSubmenu",
|
|
707
|
-
filter: slotted.elements(context.tagForNonDependency(menuName))
|
|
708
|
-
})}
|
|
709
|
-
></slot>
|
|
710
|
-
</template>
|
|
711
|
-
`;
|
|
712
|
-
};
|
|
713
|
-
|
|
714
|
-
const menuItemDefinition = vividElement.defineVividComponent(
|
|
715
|
-
"menu-item",
|
|
716
|
-
MenuItem,
|
|
717
|
-
MenuItemTemplate,
|
|
718
|
-
[definition.iconDefinition],
|
|
719
|
-
{
|
|
720
|
-
styles: styles$1
|
|
721
|
-
}
|
|
722
|
-
);
|
|
723
|
-
const registerMenuItem = vividElement.createRegisterFunction(menuItemDefinition);
|
|
30
|
+
vividElement.attr({ attribute: "auto-sizing" })
|
|
31
|
+
], Layout.prototype, "autoSizing");
|
|
724
32
|
|
|
725
|
-
const styles = "
|
|
33
|
+
const styles = ".control{display:grid;grid-auto-rows:var(--layout-grid-template-rows, min-content)}@media not all and (width >= 600px){.control.column-basis-medium,.control.column-basis-large{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(100%, 1fr)))}}@media (width >= 600px){.control.column-basis-small{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(160px, 1fr)))}.control:not(.column-basis-small):not(.column-basis-medium):not(.column-basis-large):not(.column-basis-block),.control.column-basis-medium{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(320px, 1fr)))}.control.column-basis-large{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(380px, 1fr)))}.control.column-basis-block{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(1fr, 1fr)))}}.control.column-spacing-small{column-gap:var(--layout-column-gap, calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) )}.control.column-spacing-small-inline{column-gap:var(--layout-column-gap, 0 calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) )}.control.column-spacing-small-block{column-gap:var(--layout-column-gap, calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) 0)}.control:not(.column-spacing-small):not(.column-spacing-small-inline):not(.column-spacing-small-block):not(.column-spacing-medium):not(.column-spacing-medium-inline):not(.column-spacing-medium-block):not(.column-spacing-large):not(.column-spacing-large-inline):not(.column-spacing-large-block),.control.column-spacing-medium{column-gap:var(--layout-column-gap, calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) )}.control.column-spacing-medium-inline{column-gap:var(--layout-column-gap, 0 calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) )}.control.column-spacing-medium-block{column-gap:var(--layout-column-gap, calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) 0)}.control.column-spacing-large{column-gap:var(--layout-column-gap, calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) )}.control.column-spacing-large-inline{column-gap:var(--layout-column-gap, 0 calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) )}.control.column-spacing-large-block{column-gap:var(--layout-column-gap, calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) 0)}.control.row-spacing-small{row-gap:var(--layout-row-gap, calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) )}.control.row-spacing-small-inline{row-gap:var(--layout-row-gap, 0 calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) )}.control.row-spacing-small-block{row-gap:var(--layout-row-gap, calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) 0)}.control:not(.row-spacing-small):not(.row-spacing-small-inline):not(.row-spacing-small-block):not(.row-spacing-medium):not(.row-spacing-medium-inline):not(.row-spacing-medium-block):not(.row-spacing-large):not(.row-spacing-large-inline):not(.row-spacing-large-block),.control.row-spacing-medium{row-gap:var(--layout-row-gap, calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) )}.control.row-spacing-medium-inline{row-gap:var(--layout-row-gap, 0 calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) )}.control.row-spacing-medium-block{row-gap:var(--layout-row-gap, calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) 0)}.control.row-spacing-large{row-gap:var(--layout-row-gap, calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) )}.control.row-spacing-large-inline{row-gap:var(--layout-row-gap, 0 calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) )}.control.row-spacing-large-block{row-gap:var(--layout-row-gap, calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) 0)}.control.gutters-small{margin:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - (1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))))}.control.gutters-small-inline{margin:0 calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - (1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))))}.control.gutters-small-block{margin:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - (1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))) 0}.control.gutters-medium{margin:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.control.gutters-medium-inline{margin:0 calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.control.gutters-medium-block{margin:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) 0}.control.gutters-large{margin:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.control.gutters-large-inline{margin:0 calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.control.gutters-large-block{margin:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))) 0}.control.auto-sizing-fill{--_auto-sizing: auto-fill}.control:not(.auto-sizing-fill):not(.auto-sizing-fit),.control.auto-sizing-fit{--_auto-sizing: auto-fit}";
|
|
726
34
|
|
|
727
35
|
const getClasses = ({
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
36
|
+
columnBasis,
|
|
37
|
+
gutters,
|
|
38
|
+
columnSpacing,
|
|
39
|
+
autoSizing,
|
|
40
|
+
rowSpacing
|
|
731
41
|
}) => classNames.classNames(
|
|
732
|
-
"
|
|
733
|
-
[
|
|
734
|
-
[
|
|
735
|
-
[
|
|
42
|
+
"control",
|
|
43
|
+
[`column-basis-${columnBasis}`, Boolean(columnBasis)],
|
|
44
|
+
[`gutters-${gutters}`, Boolean(gutters)],
|
|
45
|
+
[`column-spacing-${columnSpacing}`, Boolean(columnSpacing)],
|
|
46
|
+
[
|
|
47
|
+
`row-spacing-${rowSpacing ? rowSpacing : columnSpacing}`,
|
|
48
|
+
Boolean(rowSpacing) || Boolean(columnSpacing)
|
|
49
|
+
],
|
|
50
|
+
[`auto-sizing-${autoSizing}`, Boolean(autoSizing)]
|
|
736
51
|
);
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
return true;
|
|
742
|
-
}
|
|
743
|
-
const MenuTemplate = (context) => {
|
|
744
|
-
const popupTag = context.tagFor(definition$1.Popup);
|
|
745
|
-
const anchorSlotTemplate = anchored.anchorSlotTemplateFactory();
|
|
746
|
-
function handlePopupEvents(x, e, state) {
|
|
747
|
-
e.stopPropagation();
|
|
748
|
-
x.open = state;
|
|
749
|
-
}
|
|
750
|
-
return vividElement.html`
|
|
751
|
-
<template role="presentation"
|
|
752
|
-
@change="${(x, c) => x._onChange(c.event)}"
|
|
753
|
-
@focusout="${(x, c) => x._onFocusout(c.event)}">
|
|
754
|
-
${anchorSlotTemplate}
|
|
755
|
-
<${popupTag}
|
|
756
|
-
${ref.ref("_popupEl")}
|
|
757
|
-
:placement=${(x) => x.placement}
|
|
758
|
-
:open=${(x) => x.open}
|
|
759
|
-
:anchor=${(x) => x._anchorEl}
|
|
760
|
-
:strategy="${(x) => x.positionStrategy}"
|
|
761
|
-
@keydown="${(x, c) => handleEscapeKey(x, c.event)}"
|
|
762
|
-
@vwc-popup:open="${(x, c) => handlePopupEvents(x, c.event, true)}"
|
|
763
|
-
@vwc-popup:close="${(x, c) => handlePopupEvents(x, c.event, false)}"
|
|
764
|
-
>
|
|
765
|
-
<div class="${getClasses}">
|
|
766
|
-
<div class="header">
|
|
767
|
-
<slot name="header" ${slotted.slotted("headerSlottedContent")}></slot>
|
|
768
|
-
</div>
|
|
769
|
-
<div
|
|
770
|
-
class="body"
|
|
771
|
-
role="menu"
|
|
772
|
-
aria-label="${(x) => x.ariaLabel}"
|
|
773
|
-
@keydown="${(x, c) => x.handleMenuKeyDown(c.event)}"
|
|
774
|
-
@focusout="${(x, c) => x.handleFocusOut(c.event)}"
|
|
775
|
-
>
|
|
776
|
-
<slot ${slotted.slotted("items")}></slot>
|
|
777
|
-
</div>
|
|
778
|
-
<footer class="action-items"><slot name="action-items" ${slotted.slotted(
|
|
779
|
-
"actionItemsSlottedContent"
|
|
780
|
-
)}></slot></footer>
|
|
781
|
-
</div>
|
|
782
|
-
</${popupTag}>
|
|
783
|
-
</template>`;
|
|
784
|
-
};
|
|
52
|
+
const layoutTemplate = vividElement.html` <div class="${getClasses}">
|
|
53
|
+
<slot></slot>
|
|
54
|
+
</div>`;
|
|
785
55
|
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
[definition$1.popupDefinition, menuItemDefinition],
|
|
56
|
+
const layoutDefinition = vividElement.defineVividComponent(
|
|
57
|
+
"layout",
|
|
58
|
+
Layout,
|
|
59
|
+
layoutTemplate,
|
|
60
|
+
[],
|
|
792
61
|
{
|
|
793
62
|
styles
|
|
794
63
|
}
|
|
795
64
|
);
|
|
796
|
-
const
|
|
65
|
+
const registerLayout = vividElement.createRegisterFunction(layoutDefinition);
|
|
797
66
|
|
|
798
|
-
exports.
|
|
799
|
-
exports.
|
|
800
|
-
exports.
|
|
801
|
-
exports.menuItemDefinition = menuItemDefinition;
|
|
802
|
-
exports.menuName = menuName;
|
|
803
|
-
exports.registerMenu = registerMenu;
|
|
804
|
-
exports.registerMenuItem = registerMenuItem;
|
|
67
|
+
exports.Layout = Layout;
|
|
68
|
+
exports.layoutDefinition = layoutDefinition;
|
|
69
|
+
exports.registerLayout = registerLayout;
|