@kuina-ui/vue 0.5.0 → 0.7.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/dist/blocks/pagination/Pagination.js +4 -0
- package/dist/blocks/pagination/Pagination.vue.d.ts +39 -0
- package/dist/blocks/pagination/Pagination.vue_vue_type_script_setup_true_lang.js +151 -0
- package/dist/blocks/pagination/index.d.ts +2 -0
- package/dist/blocks/pagination/pagination.theme.d.ts +12 -0
- package/dist/blocks/pagination/pagination.theme.js +12 -0
- package/dist/blocks/table/Table.js +4 -0
- package/dist/blocks/table/Table.vue.d.ts +149 -0
- package/dist/blocks/table/Table.vue_vue_type_script_setup_true_lang.js +933 -0
- package/dist/blocks/table/TableCellText.js +4 -0
- package/dist/blocks/table/TableCellText.vue.d.ts +8 -0
- package/dist/blocks/table/TableCellText.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/blocks/table/index.d.ts +2 -0
- package/dist/blocks/table/table.theme.d.ts +286 -0
- package/dist/blocks/table/table.theme.js +391 -0
- package/dist/blocks/table/useLoadMoreTrigger.d.ts +11 -0
- package/dist/blocks/table/useLoadMoreTrigger.js +31 -0
- package/dist/blocks/table/usePinnedColumnOffsets.d.ts +10 -0
- package/dist/blocks/table/usePinnedColumnOffsets.js +63 -0
- package/dist/blocks/table/useRowReorder.d.ts +18 -0
- package/dist/blocks/table/useRowReorder.js +92 -0
- package/dist/blocks/table/useRowVirtualizer.d.ts +17 -0
- package/dist/blocks/table/useRowVirtualizer.js +45 -0
- package/dist/blocks/table/useTableSections.d.ts +46 -0
- package/dist/blocks/table/useTableSections.js +86 -0
- package/dist/components/alert/Alert.js +4 -0
- package/dist/components/alert/Alert.vue.d.ts +2 -2
- package/dist/components/alert/Alert.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/components/alert/alert.theme.js +93 -0
- package/dist/components/avatar-group/AvatarGroup.js +4 -0
- package/dist/components/avatar-group/AvatarGroup.vue.d.ts +1 -1
- package/dist/components/avatar-group/AvatarGroup.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/avatar-group/avatar-group.theme.js +22 -0
- package/dist/components/date-picker/DateCalendar.js +4 -0
- package/dist/components/date-picker/DateCalendar.vue_vue_type_script_setup_true_lang.js +194 -0
- package/dist/components/date-picker/DateCalendarMonth.js +4 -0
- package/dist/components/date-picker/DateCalendarMonth.vue_vue_type_script_setup_true_lang.js +106 -0
- package/dist/components/date-picker/DateCalendarPopover.js +4 -0
- package/dist/components/date-picker/DateCalendarPopover.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/components/date-picker/DatePicker.js +4 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +6 -6
- package/dist/components/date-picker/DatePicker.vue_vue_type_script_setup_true_lang.js +224 -0
- package/dist/components/date-picker/DatePickerField.js +4 -0
- package/dist/components/date-picker/DatePickerField.vue.d.ts +6 -6
- package/dist/components/date-picker/DatePickerField.vue_vue_type_script_setup_true_lang.js +241 -0
- package/dist/components/date-picker/DatePickerPanel.js +4 -0
- package/dist/components/date-picker/DatePickerPanel.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/date-picker/DateRangePicker.js +4 -0
- package/dist/components/date-picker/DateRangePicker.vue.d.ts +6 -6
- package/dist/components/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +212 -0
- package/dist/components/date-picker/DateRangePickerField.js +4 -0
- package/dist/components/date-picker/DateRangePickerField.vue.d.ts +7 -7
- package/dist/components/date-picker/DateRangePickerField.vue_vue_type_script_setup_true_lang.js +228 -0
- package/dist/components/date-picker/date-calendar.theme.js +46 -0
- package/dist/components/date-picker/date-picker.theme.js +16 -0
- package/dist/components/date-picker/useDatePickerControl.js +47 -0
- package/dist/components/date-picker/useDatePickerPopover.js +39 -0
- package/dist/components/date-picker/useDateRangeSelection.js +50 -0
- package/dist/components/date-picker/useDateRangeTyping.js +59 -0
- package/dist/components/date-picker/useDateTypingFocus.js +37 -0
- package/dist/components/date-picker/useSingleDateSelection.js +11 -0
- package/dist/components/date-picker/useSingleDateTyping.js +31 -0
- package/dist/components/date-picker/useTypedDateInput.js +39 -0
- package/dist/components/menu/Menu.js +4 -0
- package/dist/components/menu/Menu.vue.d.ts +3 -2
- package/dist/components/menu/Menu.vue_vue_type_script_setup_true_lang.js +137 -0
- package/dist/components/menu/MenuItemRow.js +4 -0
- package/dist/components/menu/MenuItemRow.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/components/menu/MenuPanel.js +4 -0
- package/dist/components/menu/MenuPanel.vue.d.ts +2 -1
- package/dist/components/menu/MenuPanel.vue_vue_type_script_setup_true_lang.js +249 -0
- package/dist/components/menu/menu.theme.d.ts +5 -0
- package/dist/components/menu/menu.theme.js +174 -0
- package/dist/components/menu/menuContext.js +9 -0
- package/dist/components/menu/menuEntries.js +25 -0
- package/dist/components/select/Select.js +4 -0
- package/dist/components/select/Select.vue.d.ts +2 -2
- package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js +262 -0
- package/dist/components/select/SelectField.js +4 -0
- package/dist/components/select/SelectField.vue.d.ts +2 -2
- package/dist/components/select/SelectField.vue_vue_type_script_setup_true_lang.js +271 -0
- package/dist/components/select/SelectOptionRow.js +4 -0
- package/dist/components/select/SelectOptionRow.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/select/SelectPanel.js +4 -0
- package/dist/components/select/SelectPanel.vue_vue_type_script_setup_true_lang.js +169 -0
- package/dist/components/select/select-panel.theme.js +44 -0
- package/dist/components/select/selectOptions.d.ts +0 -2
- package/dist/components/select/selectOptions.js +66 -0
- package/dist/components/select/useSelectControl.d.ts +3 -3
- package/dist/components/select/useSelectControl.js +62 -0
- package/dist/components/select/useSelectListbox.js +169 -0
- package/dist/components/slider/RangeSlider.js +4 -0
- package/dist/components/slider/RangeSlider.vue.d.ts +55 -0
- package/dist/components/slider/RangeSlider.vue_vue_type_script_setup_true_lang.js +214 -0
- package/dist/components/slider/Slider.js +4 -0
- package/dist/components/slider/Slider.vue.d.ts +49 -0
- package/dist/components/slider/Slider.vue_vue_type_script_setup_true_lang.js +151 -0
- package/dist/components/slider/SliderHeader.js +4 -0
- package/dist/components/slider/SliderHeader.vue.d.ts +30 -0
- package/dist/components/slider/SliderHeader.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/components/slider/index.d.ts +5 -0
- package/dist/components/slider/slider.theme.d.ts +33 -0
- package/dist/components/slider/slider.theme.js +34 -0
- package/dist/components/text-field/TextField.js +4 -0
- package/dist/components/text-field/TextField.vue.d.ts +2 -2
- package/dist/components/text-field/TextField.vue_vue_type_script_setup_true_lang.js +122 -0
- package/dist/components/text-field/text-field.theme.js +379 -0
- package/dist/components/textarea/Textarea.js +4 -0
- package/dist/components/textarea/Textarea.vue.d.ts +1 -1
- package/dist/components/textarea/Textarea.vue_vue_type_script_setup_true_lang.js +93 -0
- package/dist/components/textarea/textarea.theme.js +222 -0
- package/dist/elements/avatar/Avatar.js +4 -0
- package/dist/elements/avatar/Avatar.vue.d.ts +3 -3
- package/dist/elements/avatar/Avatar.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/elements/avatar/avatar.theme.js +141 -0
- package/dist/elements/badge/Badge.js +4 -0
- package/dist/elements/badge/Badge.vue.d.ts +2 -2
- package/dist/elements/badge/Badge.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/elements/badge/badge.theme.js +111 -0
- package/dist/elements/button/Button.js +4 -0
- package/dist/elements/button/Button.vue.d.ts +3 -3
- package/dist/elements/button/Button.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/elements/button/button.theme.js +424 -0
- package/dist/elements/checkbox/Checkbox.js +4 -0
- package/dist/elements/checkbox/Checkbox.vue.d.ts +3 -1
- package/dist/elements/checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/elements/checkbox/checkbox.theme.d.ts +1 -0
- package/dist/elements/checkbox/checkbox.theme.js +22 -0
- package/dist/elements/circular-progress/CircularProgress.js +4 -0
- package/dist/elements/circular-progress/CircularProgress.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/elements/circular-progress/circular-progress.theme.js +8 -0
- package/dist/elements/input/Input.js +4 -0
- package/dist/elements/input/Input.vue.d.ts +62 -0
- package/dist/elements/input/Input.vue_vue_type_script_setup_true_lang.js +138 -0
- package/dist/elements/input/focusInputFromContainer.d.ts +2 -0
- package/dist/elements/input/focusInputFromContainer.js +28 -0
- package/dist/elements/input/index.d.ts +2 -0
- package/dist/elements/input/input.theme.d.ts +81 -0
- package/dist/elements/input/input.theme.js +391 -0
- package/dist/elements/loading-dots/LoadingDots.js +4 -0
- package/dist/elements/loading-dots/LoadingDots.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/elements/loading-dots/loading-dots.theme.js +4 -0
- package/dist/elements/loading-indicator/LoadingIndicator.js +4 -0
- package/dist/elements/loading-indicator/LoadingIndicator.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/elements/loading-indicator/loading-indicator.theme.js +4 -0
- package/dist/elements/popover/Popover.js +4 -0
- package/dist/elements/popover/Popover.vue.d.ts +60 -0
- package/dist/elements/popover/Popover.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/elements/popover/index.d.ts +2 -0
- package/dist/elements/popover/popover.theme.d.ts +20 -0
- package/dist/elements/popover/popover.theme.js +17 -0
- package/dist/elements/popover/popoverLayers.d.ts +5 -0
- package/dist/elements/popover/popoverLayers.js +22 -0
- package/dist/elements/radio-group/RadioGroup.js +4 -0
- package/dist/elements/radio-group/RadioGroup.vue.d.ts +1 -1
- package/dist/elements/radio-group/RadioGroup.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/elements/radio-group/radio-group.theme.js +126 -0
- package/dist/elements/segmented-control/SegmentedControl.js +4 -0
- package/dist/elements/segmented-control/SegmentedControl.vue.d.ts +1 -1
- package/dist/elements/segmented-control/SegmentedControl.vue_vue_type_script_setup_true_lang.js +98 -0
- package/dist/elements/segmented-control/segmented-control.theme.js +201 -0
- package/dist/elements/select-control/SelectControl.js +4 -0
- package/dist/elements/select-control/SelectControl.vue.d.ts +1 -1
- package/dist/elements/select-control/SelectControl.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/elements/select-control/select-control.theme.js +360 -0
- package/dist/elements/select-field-control/SelectFieldControl.js +4 -0
- package/dist/elements/select-field-control/SelectFieldControl.vue.d.ts +1 -1
- package/dist/elements/select-field-control/SelectFieldControl.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/elements/select-field-control/select-field-control.theme.js +299 -0
- package/dist/elements/slider-control/SliderControl.js +4 -0
- package/dist/elements/slider-control/SliderControl.vue.d.ts +35 -0
- package/dist/elements/slider-control/SliderControl.vue_vue_type_script_setup_true_lang.js +228 -0
- package/dist/elements/slider-control/index.d.ts +3 -0
- package/dist/elements/slider-control/slider-control.theme.d.ts +38 -0
- package/dist/elements/slider-control/slider-control.theme.js +35 -0
- package/dist/elements/slider-control/useSliderMarksLayout.d.ts +6 -0
- package/dist/elements/slider-control/useSliderMarksLayout.js +25 -0
- package/dist/elements/switch/Switch.js +4 -0
- package/dist/elements/switch/Switch.vue.d.ts +1 -1
- package/dist/elements/switch/Switch.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/elements/switch/switch.theme.js +37 -0
- package/dist/elements/text-link/TextLink.js +4 -0
- package/dist/elements/text-link/TextLink.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/elements/text-link/text-link.theme.js +25 -0
- package/dist/elements/tooltip/Tooltip.js +4 -0
- package/dist/elements/tooltip/Tooltip.vue.d.ts +48 -0
- package/dist/elements/tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/elements/tooltip/index.d.ts +2 -0
- package/dist/elements/tooltip/tooltip.theme.d.ts +29 -0
- package/dist/elements/tooltip/tooltip.theme.js +46 -0
- package/dist/elements/tooltip/useTooltipOpenState.d.ts +17 -0
- package/dist/elements/tooltip/useTooltipOpenState.js +57 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +38 -1
- package/dist/nuxt.js +12 -13
- package/dist/shared/composables/useApplePlatform.js +10 -0
- package/dist/shared/composables/useCalendarLabels.js +13 -0
- package/dist/shared/composables/useCustomColor.js +10 -0
- package/dist/shared/composables/useDismissOnOutsidePointerDown.d.ts +1 -1
- package/dist/shared/composables/useDismissOnOutsidePointerDown.js +14 -0
- package/dist/shared/composables/useFieldDescription.js +16 -0
- package/dist/shared/composables/useFloatingPosition.d.ts +3 -2
- package/dist/shared/composables/useFloatingPosition.js +113 -0
- package/dist/shared/composables/useMask.js +32 -0
- package/dist/shared/composables/useMaskedFieldModel.d.ts +7 -0
- package/dist/shared/composables/useMaskedFieldModel.js +19 -0
- package/dist/shared/composables/useNumberFieldTyping.d.ts +21 -0
- package/dist/shared/composables/useNumberFieldTyping.js +70 -0
- package/dist/shared/composables/usePointerGraceArea.d.ts +11 -0
- package/dist/shared/composables/usePointerGraceArea.js +40 -0
- package/dist/shared/composables/useRowSelection.d.ts +17 -0
- package/dist/shared/composables/useRowSelection.js +40 -0
- package/dist/shared/composables/useShortcuts.js +21 -0
- package/dist/shared/composables/useSlidingThumb.js +65 -0
- package/dist/shared/composables/useTableRows.d.ts +26 -0
- package/dist/shared/composables/useTableRows.js +41 -0
- package/dist/shared/types/floating-position.d.ts +9 -0
- package/dist/shared/types/pointer-grace-area.d.ts +12 -0
- package/dist/shared/types/slider.d.ts +6 -0
- package/dist/shared/types/table.d.ts +59 -0
- package/dist/shared/types/value-path.d.ts +6 -0
- package/dist/shared/utils/calendarMonth.js +23 -0
- package/dist/shared/utils/computeFloatingPosition.js +32 -0
- package/dist/shared/utils/createDateFormatters.js +31 -0
- package/dist/shared/utils/createDateInputMask.js +103 -0
- package/dist/shared/utils/createDebouncedCallback.d.ts +5 -0
- package/dist/shared/utils/createDebouncedCallback.js +17 -0
- package/dist/shared/utils/createMask.js +65 -0
- package/dist/shared/utils/createShortcutHandler.js +60 -0
- package/dist/shared/utils/createTypeaheadSearch.js +16 -0
- package/dist/shared/utils/editableFieldGuard.js +11 -0
- package/dist/shared/utils/findFirstRenderedVNode.d.ts +3 -0
- package/dist/shared/utils/findFirstRenderedVNode.js +14 -0
- package/dist/shared/utils/flipFloatingPosition.js +28 -0
- package/dist/shared/utils/floatingPanelTransition.js +25 -0
- package/dist/shared/utils/formatShortcut.js +86 -0
- package/dist/shared/utils/isApplePlatform.js +5 -0
- package/dist/shared/utils/isExternalUrl.js +5 -0
- package/dist/shared/utils/isoDate.js +50 -0
- package/dist/shared/utils/normalizeSearchText.d.ts +2 -0
- package/dist/shared/utils/normalizeSearchText.js +6 -0
- package/dist/shared/utils/parseShortcut.js +48 -0
- package/dist/shared/utils/pointerGraceArea.d.ts +11 -0
- package/dist/shared/utils/pointerGraceArea.js +92 -0
- package/dist/shared/utils/readValueAtPath.d.ts +2 -0
- package/dist/shared/utils/readValueAtPath.js +7 -0
- package/dist/shared/utils/resolveFloatingAnchor.d.ts +4 -0
- package/dist/shared/utils/resolveFloatingAnchor.js +15 -0
- package/dist/shared/utils/resolvePressScale.js +5 -0
- package/dist/shared/utils/shiftFloatingPosition.d.ts +3 -0
- package/dist/shared/utils/shiftFloatingPosition.js +21 -0
- package/dist/shared/utils/sliderPosition.d.ts +11 -0
- package/dist/shared/utils/sliderPosition.js +27 -0
- package/dist/shared/utils/sliderThumbs.d.ts +13 -0
- package/dist/shared/utils/sliderThumbs.js +16 -0
- package/dist/shared/utils/steppedValue.d.ts +18 -0
- package/dist/shared/utils/steppedValue.js +21 -0
- package/dist/shared/utils/tableColumnTypes.d.ts +21 -0
- package/dist/shared/utils/tableColumnTypes.js +77 -0
- package/dist/shared/utils/tableColumns.d.ts +20 -0
- package/dist/shared/utils/tableColumns.js +77 -0
- package/dist/shared/utils/tableGroups.d.ts +10 -0
- package/dist/shared/utils/tableGroups.js +34 -0
- package/dist/shared/utils/tableRows.d.ts +25 -0
- package/dist/shared/utils/tableRows.js +80 -0
- package/dist/shared/utils/tableTree.d.ts +15 -0
- package/dist/shared/utils/tableTree.js +22 -0
- package/dist/shared/utils/toggleColumnSort.d.ts +5 -0
- package/dist/shared/utils/toggleColumnSort.js +27 -0
- package/dist/shared/utils/tv.js +1 -0
- package/dist/shared/utils/warnInDevelopment.d.ts +3 -0
- package/dist/shared/utils/warnInDevelopment.js +13 -0
- package/package.json +1 -1
- package/src/index.css +2 -0
- package/src/shared/styles/utilities/shake.css +21 -0
- package/src/shared/styles/utilities/slider-mark-position.css +8 -0
- package/dist/src-Bnn36nLV.js +0 -7856
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import e from "../../elements/button/Button.js";
|
|
2
|
+
import { useApplePlatform as t } from "../../shared/composables/useApplePlatform.js";
|
|
3
|
+
import { useDismissOnOutsidePointerDown as n } from "../../shared/composables/useDismissOnOutsidePointerDown.js";
|
|
4
|
+
import { createShortcutHandler as r } from "../../shared/utils/createShortcutHandler.js";
|
|
5
|
+
import { isFloatingPoint as i, resolveFloatingAnchor as a } from "../../shared/utils/resolveFloatingAnchor.js";
|
|
6
|
+
import o from "./MenuPanel.js";
|
|
7
|
+
import { menuContextKey as s } from "./menuContext.js";
|
|
8
|
+
import { menuTheme as c } from "./menu.theme.js";
|
|
9
|
+
import { Teleport as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createVNode as m, defineComponent as h, guardReactiveProps as g, mergeModels as _, mergeProps as v, normalizeClass as y, normalizeProps as b, onMounted as x, openBlock as S, provide as C, renderSlot as w, shallowRef as T, unref as E, useId as D, useModel as O, useSlots as k, useTemplateRef as A, watch as j } from "vue";
|
|
10
|
+
// src/components/menu/Menu.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var M = /*@__PURE__*/ h({
|
|
12
|
+
__name: "Menu",
|
|
13
|
+
props: /*@__PURE__*/ _({
|
|
14
|
+
label: {},
|
|
15
|
+
items: {},
|
|
16
|
+
trigger: {},
|
|
17
|
+
anchor: {},
|
|
18
|
+
side: { default: "bottom" },
|
|
19
|
+
align: { default: "start" },
|
|
20
|
+
width: { default: "md" },
|
|
21
|
+
indicatorPosition: { default: "end" },
|
|
22
|
+
indicatorVariant: { default: "solid" },
|
|
23
|
+
strategy: { default: "absolute" },
|
|
24
|
+
flip: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !0
|
|
27
|
+
},
|
|
28
|
+
ui: {},
|
|
29
|
+
class: { type: [
|
|
30
|
+
Array,
|
|
31
|
+
String,
|
|
32
|
+
null,
|
|
33
|
+
Number,
|
|
34
|
+
Boolean
|
|
35
|
+
] }
|
|
36
|
+
}, {
|
|
37
|
+
open: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
40
|
+
},
|
|
41
|
+
openModifiers: {}
|
|
42
|
+
}),
|
|
43
|
+
emits: ["update:open"],
|
|
44
|
+
setup(h) {
|
|
45
|
+
let _ = h, M = O(h, "open"), N = D(), P = A("menuRoot"), F = A("menuLayer"), I = T(), L = t(), R = k(), z = !1, B, V = u(() => !!(_.anchor && i(_.anchor))), H = u(() => !!R.trigger || !_.anchor), U = u(() => _.anchor ? a(_.anchor) : P.value), W = u(() => ({
|
|
46
|
+
ui: _.ui,
|
|
47
|
+
indicatorPosition: _.indicatorPosition,
|
|
48
|
+
indicatorVariant: _.indicatorVariant,
|
|
49
|
+
strategy: _.strategy,
|
|
50
|
+
flip: _.flip
|
|
51
|
+
})), G = u(() => c({ hasTrigger: H.value }).root({ class: [_.ui?.root, _.class] }));
|
|
52
|
+
function K() {
|
|
53
|
+
return P.value?.querySelector("button, [href], [tabindex]:not([tabindex=\"-1\"])");
|
|
54
|
+
}
|
|
55
|
+
function q(e) {
|
|
56
|
+
I.value = { focusTarget: e }, z = !0, M.value = !0;
|
|
57
|
+
}
|
|
58
|
+
function J({ restoreFocus: e }) {
|
|
59
|
+
M.value = !1, e && (K() ?? B)?.focus();
|
|
60
|
+
}
|
|
61
|
+
function Y(e) {
|
|
62
|
+
M.value ? J({ restoreFocus: !1 }) : q(e.detail === 0 ? "firstItem" : "panel");
|
|
63
|
+
}
|
|
64
|
+
let X = r({
|
|
65
|
+
arrowdown: () => q("firstItem"),
|
|
66
|
+
arrowup: () => q("lastItem")
|
|
67
|
+
});
|
|
68
|
+
function Z(e, t) {
|
|
69
|
+
e.disabled ? t.preventDefault() : (e.onSelect?.(t), e.type !== "checkbox" && J({ restoreFocus: !0 }));
|
|
70
|
+
}
|
|
71
|
+
function Q(e, t) {
|
|
72
|
+
e.onSelect?.(t), J({ restoreFocus: !0 });
|
|
73
|
+
}
|
|
74
|
+
let $ = u(() => ({
|
|
75
|
+
open: M.value,
|
|
76
|
+
triggerAttributes: {
|
|
77
|
+
"aria-haspopup": "menu",
|
|
78
|
+
"aria-expanded": M.value,
|
|
79
|
+
"aria-controls": M.value ? N : void 0,
|
|
80
|
+
onClick: Y,
|
|
81
|
+
onKeydown: X
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
return C(s, {
|
|
85
|
+
menuSettings: W,
|
|
86
|
+
menuLayer: F,
|
|
87
|
+
usesApplePlatform: L,
|
|
88
|
+
closeMenu: J,
|
|
89
|
+
selectMenuItem: Z,
|
|
90
|
+
selectMenuItemAction: Q
|
|
91
|
+
}), n([P, F], {
|
|
92
|
+
active: M,
|
|
93
|
+
onDismiss: () => J({ restoreFocus: !1 })
|
|
94
|
+
}), x(() => {
|
|
95
|
+
j(M, (e) => {
|
|
96
|
+
e && (B = document.activeElement instanceof HTMLElement ? document.activeElement : void 0, z || (I.value = { focusTarget: "panel" }), z = !1);
|
|
97
|
+
}, { immediate: !0 });
|
|
98
|
+
}), (t, n) => (S(), p("div", {
|
|
99
|
+
ref_key: "menuRoot",
|
|
100
|
+
ref: P,
|
|
101
|
+
class: y(G.value)
|
|
102
|
+
}, [H.value ? w(t.$slots, "trigger", b(g($.value)), () => [m(E(e), v({
|
|
103
|
+
...h.trigger,
|
|
104
|
+
...$.value.triggerAttributes
|
|
105
|
+
}, {
|
|
106
|
+
label: h.label,
|
|
107
|
+
selected: M.value,
|
|
108
|
+
"aria-pressed": void 0
|
|
109
|
+
}), null, 16, ["label", "selected"])], void 0, 0) : f("", !0), (S(), d(l, { to: "body" }, [M.value ? (S(), p("div", {
|
|
110
|
+
key: 0,
|
|
111
|
+
ref_key: "menuLayer",
|
|
112
|
+
ref: F
|
|
113
|
+
}, [m(o, {
|
|
114
|
+
"panel-id": E(N),
|
|
115
|
+
label: h.label,
|
|
116
|
+
entries: h.items,
|
|
117
|
+
anchor: U.value,
|
|
118
|
+
side: h.side,
|
|
119
|
+
align: h.align,
|
|
120
|
+
width: h.width,
|
|
121
|
+
"side-offset": V.value ? 0 : 6,
|
|
122
|
+
"align-offset": 0,
|
|
123
|
+
"focus-request": I.value
|
|
124
|
+
}, null, 8, [
|
|
125
|
+
"panel-id",
|
|
126
|
+
"label",
|
|
127
|
+
"entries",
|
|
128
|
+
"anchor",
|
|
129
|
+
"side",
|
|
130
|
+
"align",
|
|
131
|
+
"width",
|
|
132
|
+
"side-offset",
|
|
133
|
+
"focus-request"
|
|
134
|
+
])], 512)) : f("", !0)]))], 2));
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
export { M as default };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import e from "../../elements/button/Button.js";
|
|
2
|
+
import { formatShortcut as t } from "../../shared/utils/formatShortcut.js";
|
|
3
|
+
import { isExternalUrl as n } from "../../shared/utils/isExternalUrl.js";
|
|
4
|
+
import { useMenuContext as r } from "./menuContext.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, openBlock as p, renderList as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, withCtx as v, withModifiers as y } from "vue";
|
|
6
|
+
import { Check as b, ChevronRight as x } from "lucide-vue-next";
|
|
7
|
+
// src/components/menu/MenuItemRow.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var S = /*@__PURE__*/ u({
|
|
9
|
+
__name: "MenuItemRow",
|
|
10
|
+
props: {
|
|
11
|
+
menuItem: {},
|
|
12
|
+
menuThemeSlots: {},
|
|
13
|
+
submenuKey: {},
|
|
14
|
+
submenuId: {},
|
|
15
|
+
isSubmenuOpen: { type: Boolean }
|
|
16
|
+
},
|
|
17
|
+
emits: ["select", "selectAction"],
|
|
18
|
+
setup(u, { emit: S }) {
|
|
19
|
+
let C = u, w = S, { menuSettings: T, usesApplePlatform: E } = r(), D = {
|
|
20
|
+
checkbox: "menuitemcheckbox",
|
|
21
|
+
radio: "menuitemradio"
|
|
22
|
+
}, O = a(() => T.value.ui), k = a(() => C.menuItem.type !== void 0), A = a(() => !!C.menuItem.submenu), j = a(() => !!C.menuItem.actions?.length), M = a(() => !!C.menuItem.disabled), N = a(() => !!C.menuItem.checked), P = a(() => !!C.menuItem.href && !k.value && !A.value && !j.value), F = a(() => P.value && n(C.menuItem.href ?? "")), I = a(() => C.menuItem.shortcut ? t(C.menuItem.shortcut, E.value) : void 0), L = a(() => {
|
|
23
|
+
let e = {
|
|
24
|
+
role: C.menuItem.type ? D[C.menuItem.type] : "menuitem",
|
|
25
|
+
tabindex: -1,
|
|
26
|
+
"aria-disabled": M.value || void 0,
|
|
27
|
+
"data-menu-item-label": C.menuItem.label
|
|
28
|
+
};
|
|
29
|
+
return P.value ? {
|
|
30
|
+
...e,
|
|
31
|
+
href: M.value ? void 0 : C.menuItem.href,
|
|
32
|
+
target: F.value ? "_blank" : void 0,
|
|
33
|
+
rel: F.value ? "noopener noreferrer" : void 0
|
|
34
|
+
} : A.value ? {
|
|
35
|
+
...e,
|
|
36
|
+
"aria-haspopup": "menu",
|
|
37
|
+
"aria-expanded": String(!!C.isSubmenuOpen),
|
|
38
|
+
"aria-controls": C.isSubmenuOpen ? C.submenuId : void 0,
|
|
39
|
+
"data-submenu-key": C.submenuKey
|
|
40
|
+
} : {
|
|
41
|
+
...e,
|
|
42
|
+
"aria-checked": k.value ? String(N.value) : void 0
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
return (t, n) => (p(), o(h(P.value ? "a" : "div"), d(L.value, {
|
|
46
|
+
class: u.menuThemeSlots.item({
|
|
47
|
+
color: u.menuItem.color,
|
|
48
|
+
disabled: M.value,
|
|
49
|
+
hasActions: j.value,
|
|
50
|
+
class: O.value?.item
|
|
51
|
+
}),
|
|
52
|
+
onClick: n[0] ||= (e) => w("select", e)
|
|
53
|
+
}), {
|
|
54
|
+
default: v(() => [l("span", { class: f(u.menuThemeSlots.itemContent({
|
|
55
|
+
hasIndicator: k.value,
|
|
56
|
+
class: O.value?.itemContent
|
|
57
|
+
})) }, [
|
|
58
|
+
k.value ? (p(), c("span", {
|
|
59
|
+
key: 0,
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
class: f(u.menuThemeSlots.indicatorWrapper({ class: O.value?.indicatorWrapper }))
|
|
62
|
+
}, [l("span", { class: f(u.menuThemeSlots.indicator({
|
|
63
|
+
type: u.menuItem.type,
|
|
64
|
+
checked: N.value,
|
|
65
|
+
class: O.value?.indicator
|
|
66
|
+
})) }, [N.value ? (p(), c(i, { key: 0 }, [u.menuItem.type === "radio" ? (p(), c("span", {
|
|
67
|
+
key: 0,
|
|
68
|
+
class: f(u.menuThemeSlots.radioDot({ class: O.value?.radioDot }))
|
|
69
|
+
}, null, 2)) : (p(), o(_(b), {
|
|
70
|
+
key: 1,
|
|
71
|
+
class: f(u.menuThemeSlots.indicatorCheckIcon({ class: O.value?.indicatorCheckIcon }))
|
|
72
|
+
}, null, 8, ["class"]))], 64)) : s("", !0)], 2)], 2)) : s("", !0),
|
|
73
|
+
u.menuItem.icon ? (p(), o(h(u.menuItem.icon), {
|
|
74
|
+
key: 1,
|
|
75
|
+
class: f(u.menuThemeSlots.itemIcon({ class: O.value?.itemIcon }))
|
|
76
|
+
}, null, 8, ["class"])) : s("", !0),
|
|
77
|
+
l("span", { class: f(u.menuThemeSlots.itemText({ class: O.value?.itemText })) }, [l("span", { class: f(u.menuThemeSlots.itemLabel({ class: O.value?.itemLabel })) }, g(u.menuItem.label), 3), u.menuItem.description ? (p(), c("span", {
|
|
78
|
+
key: 0,
|
|
79
|
+
class: f(u.menuThemeSlots.itemDescription({ class: O.value?.itemDescription }))
|
|
80
|
+
}, g(u.menuItem.description), 3)) : s("", !0)], 2),
|
|
81
|
+
I.value ? (p(), c("kbd", {
|
|
82
|
+
key: 2,
|
|
83
|
+
class: f(u.menuThemeSlots.itemShortcut({ class: O.value?.itemShortcut }))
|
|
84
|
+
}, g(I.value), 3)) : s("", !0),
|
|
85
|
+
j.value ? (p(), c("span", {
|
|
86
|
+
key: 3,
|
|
87
|
+
class: f(u.menuThemeSlots.itemActions({ class: O.value?.itemActions }))
|
|
88
|
+
}, [(p(!0), c(i, null, m(u.menuItem.actions, (t, n) => (p(), o(_(e), {
|
|
89
|
+
key: n,
|
|
90
|
+
label: t.label,
|
|
91
|
+
"leading-icon": t.icon,
|
|
92
|
+
variant: "ghost",
|
|
93
|
+
color: "gray",
|
|
94
|
+
size: "xs",
|
|
95
|
+
square: "",
|
|
96
|
+
pill: !1,
|
|
97
|
+
tabindex: "-1",
|
|
98
|
+
"data-menu-item-action": "",
|
|
99
|
+
onClick: y((e) => w("selectAction", t, e), ["stop"])
|
|
100
|
+
}, null, 8, [
|
|
101
|
+
"label",
|
|
102
|
+
"leading-icon",
|
|
103
|
+
"onClick"
|
|
104
|
+
]))), 128))], 2)) : s("", !0),
|
|
105
|
+
A.value ? (p(), o(_(x), {
|
|
106
|
+
key: 4,
|
|
107
|
+
class: f(u.menuThemeSlots.submenuIcon({ class: O.value?.submenuIcon }))
|
|
108
|
+
}, null, 8, ["class"])) : s("", !0)
|
|
109
|
+
], 2), F.value ? (p(), c("span", {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: f(u.menuThemeSlots.newTabHint({ class: O.value?.newTabHint }))
|
|
112
|
+
}, "(opens in a new tab)", 2)) : s("", !0)]),
|
|
113
|
+
_: 1
|
|
114
|
+
}, 16, ["class"]));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
export { S as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { FloatingAnchor } from '../../shared/types/floating-position';
|
|
1
2
|
import type { MenuEntry, MenuProps } from './Menu.vue';
|
|
2
3
|
import { type MenuFocusRequest } from './menuContext';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
panelId: string;
|
|
5
6
|
label: string;
|
|
6
7
|
entries: MenuEntry[];
|
|
7
|
-
|
|
8
|
+
anchor: FloatingAnchor | null | undefined;
|
|
8
9
|
side: NonNullable<MenuProps['side']>;
|
|
9
10
|
align: NonNullable<MenuProps['align']>;
|
|
10
11
|
width: NonNullable<MenuProps['width']>;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { useFloatingPosition as e } from "../../shared/composables/useFloatingPosition.js";
|
|
2
|
+
import { createShortcutHandler as t } from "../../shared/utils/createShortcutHandler.js";
|
|
3
|
+
import { createTypeaheadSearch as n } from "../../shared/utils/createTypeaheadSearch.js";
|
|
4
|
+
import { flipFloatingPosition as r } from "../../shared/utils/flipFloatingPosition.js";
|
|
5
|
+
import i from "./MenuItemRow.js";
|
|
6
|
+
import { useMenuContext as a } from "./menuContext.js";
|
|
7
|
+
import { isMenuGroup as o, isMenuHeader as ee, isMenuItem as s, isMenuSeparator as c } from "./menuEntries.js";
|
|
8
|
+
import { menuTheme as l } from "./menu.theme.js";
|
|
9
|
+
import { Fragment as u, Teleport as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, defineComponent as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as b, openBlock as x, renderList as S, resolveComponent as C, shallowRef as w, toDisplayString as T, unref as E, useId as D, useTemplateRef as te, watch as ne } from "vue";
|
|
10
|
+
// src/components/menu/MenuPanel.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var re = ["id", "aria-label"], ie = ["aria-label"], ae = 150, O = /*@__PURE__*/ _({
|
|
12
|
+
__name: "MenuPanel",
|
|
13
|
+
props: {
|
|
14
|
+
panelId: {},
|
|
15
|
+
label: {},
|
|
16
|
+
entries: {},
|
|
17
|
+
anchor: {},
|
|
18
|
+
side: {},
|
|
19
|
+
align: {},
|
|
20
|
+
width: {},
|
|
21
|
+
sideOffset: {},
|
|
22
|
+
alignOffset: {},
|
|
23
|
+
focusRequest: {},
|
|
24
|
+
isSubmenu: { type: Boolean }
|
|
25
|
+
},
|
|
26
|
+
emits: ["requestClose", "pointerEntered"],
|
|
27
|
+
setup(_, { emit: O }) {
|
|
28
|
+
let k = _, A = O, j = a(), M = te("menuPanel"), N = D(), P = w(), oe = n(), F, I = f(() => j.menuSettings.value.flip ? [r()] : []), { floatingStyles: L, floatingPlacement: R, isPositioned: z } = e(() => k.anchor, M, {
|
|
29
|
+
open: !0,
|
|
30
|
+
side: () => k.side,
|
|
31
|
+
align: () => k.align,
|
|
32
|
+
sideOffset: () => k.sideOffset,
|
|
33
|
+
alignOffset: () => k.alignOffset,
|
|
34
|
+
strategy: () => j.menuSettings.value.strategy,
|
|
35
|
+
positionModifiers: I
|
|
36
|
+
}), B = f(() => l({
|
|
37
|
+
side: R.value.side,
|
|
38
|
+
align: R.value.align,
|
|
39
|
+
width: k.width,
|
|
40
|
+
indicatorPosition: j.menuSettings.value.indicatorPosition,
|
|
41
|
+
indicatorVariant: j.menuSettings.value.indicatorVariant
|
|
42
|
+
})), V = f(() => j.menuSettings.value.ui), H = f(() => {
|
|
43
|
+
let e = /* @__PURE__ */ new Map();
|
|
44
|
+
return k.entries.forEach((t, n) => {
|
|
45
|
+
o(t) ? t.items.forEach((t, r) => {
|
|
46
|
+
t.submenu && e.set(`${n}.${r}`, t);
|
|
47
|
+
}) : s(t) && t.submenu && e.set(String(n), t);
|
|
48
|
+
}), e;
|
|
49
|
+
}), U = f(() => {
|
|
50
|
+
if (P.value) return M.value?.querySelector(`[data-submenu-key="${P.value.submenuKey}"]`);
|
|
51
|
+
});
|
|
52
|
+
function W() {
|
|
53
|
+
return Array.from(M.value?.querySelectorAll("[role^=\"menuitem\"]:not([aria-disabled=\"true\"])") ?? []);
|
|
54
|
+
}
|
|
55
|
+
function G() {
|
|
56
|
+
let e = document.activeElement;
|
|
57
|
+
return !(e instanceof HTMLElement) || !M.value?.contains(e) ? null : e.closest("[role^=\"menuitem\"]");
|
|
58
|
+
}
|
|
59
|
+
function K(e) {
|
|
60
|
+
let t = W();
|
|
61
|
+
({
|
|
62
|
+
panel: M.value,
|
|
63
|
+
firstItem: t.at(0),
|
|
64
|
+
lastItem: t.at(-1)
|
|
65
|
+
}[e] ?? M.value)?.focus({ preventScroll: !0 });
|
|
66
|
+
}
|
|
67
|
+
function q(e) {
|
|
68
|
+
let t = W(), n = t.findIndex((e) => e === G());
|
|
69
|
+
n === -1 ? K(e === 1 ? "firstItem" : "lastItem") : t[(n + e + t.length) % t.length]?.focus();
|
|
70
|
+
}
|
|
71
|
+
function J(e, t) {
|
|
72
|
+
let n = H.value.get(e);
|
|
73
|
+
n && !n.disabled && (clearTimeout(F), (P.value?.submenuKey !== e || t) && (P.value = {
|
|
74
|
+
submenuKey: e,
|
|
75
|
+
menuItem: n,
|
|
76
|
+
focusRequest: t ? { focusTarget: t } : void 0
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
function Y({ focusParentItem: e }) {
|
|
80
|
+
clearTimeout(F);
|
|
81
|
+
let t = U.value;
|
|
82
|
+
P.value = void 0, e && t?.focus();
|
|
83
|
+
}
|
|
84
|
+
function se() {
|
|
85
|
+
P.value && (clearTimeout(F), F = setTimeout(() => Y({ focusParentItem: !1 }), ae));
|
|
86
|
+
}
|
|
87
|
+
function ce() {
|
|
88
|
+
clearTimeout(F);
|
|
89
|
+
}
|
|
90
|
+
function le() {
|
|
91
|
+
let e = G(), t = e?.dataset.submenuKey;
|
|
92
|
+
if (!e) return;
|
|
93
|
+
if (t) {
|
|
94
|
+
J(t, "firstItem");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
let n = Array.from(e.querySelectorAll("[data-menu-item-action]"));
|
|
98
|
+
n[n.findIndex((e) => e === document.activeElement) + 1]?.focus();
|
|
99
|
+
}
|
|
100
|
+
function ue() {
|
|
101
|
+
let e = G(), t = Array.from(e?.querySelectorAll("[data-menu-item-action]") ?? []), n = t.findIndex((e) => e === document.activeElement);
|
|
102
|
+
n > 0 ? t[n - 1]?.focus() : n === 0 ? e?.focus() : k.isSubmenu && A("requestClose");
|
|
103
|
+
}
|
|
104
|
+
function de(e) {
|
|
105
|
+
if (document.activeElement === M.value) {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let t = W().find((e) => e === document.activeElement);
|
|
110
|
+
t && (e.preventDefault(), t.dataset.submenuKey ? J(t.dataset.submenuKey, "firstItem") : t.click());
|
|
111
|
+
}
|
|
112
|
+
let X = {
|
|
113
|
+
handler: () => j.closeMenu({ restoreFocus: !0 }),
|
|
114
|
+
preventDefault: !1
|
|
115
|
+
}, Z = {
|
|
116
|
+
handler: de,
|
|
117
|
+
preventDefault: !1
|
|
118
|
+
}, fe = t({
|
|
119
|
+
arrowdown: () => q(1),
|
|
120
|
+
arrowup: () => q(-1),
|
|
121
|
+
home: () => K("firstItem"),
|
|
122
|
+
end: () => K("lastItem"),
|
|
123
|
+
arrowright: le,
|
|
124
|
+
arrowleft: ue,
|
|
125
|
+
escape: () => k.isSubmenu ? A("requestClose") : j.closeMenu({ restoreFocus: !0 }),
|
|
126
|
+
tab: X,
|
|
127
|
+
"shift+tab": X,
|
|
128
|
+
enter: Z,
|
|
129
|
+
space: Z
|
|
130
|
+
});
|
|
131
|
+
function pe(e) {
|
|
132
|
+
let t = [...e.key].length === 1 && e.key !== " ", n = e.ctrlKey || e.metaKey || e.altKey;
|
|
133
|
+
if (e.defaultPrevented || !t || n) return;
|
|
134
|
+
let r = W(), i = r.findIndex((e) => e === G()), a = r.map((e) => e.dataset.menuItemLabel ?? "");
|
|
135
|
+
r[oe(e.key, a, i)]?.focus();
|
|
136
|
+
}
|
|
137
|
+
function me(e) {
|
|
138
|
+
fe(e), pe(e);
|
|
139
|
+
}
|
|
140
|
+
function he(e) {
|
|
141
|
+
let t = e.target instanceof Element ? e.target.closest("[role^=\"menuitem\"]") : null, n = t !== null && t.getAttribute("aria-disabled") !== "true", r = n ? t.dataset.submenuKey : void 0;
|
|
142
|
+
if (r ? J(r) : se(), t?.contains(document.activeElement)) return;
|
|
143
|
+
let i = n ? t : M.value;
|
|
144
|
+
i && document.activeElement !== i && i.focus({ preventScroll: !0 });
|
|
145
|
+
}
|
|
146
|
+
function ge() {
|
|
147
|
+
M.value?.contains(document.activeElement) && M.value.focus({ preventScroll: !0 });
|
|
148
|
+
}
|
|
149
|
+
function Q(e, t, n) {
|
|
150
|
+
e.submenu ? J(t, n.detail === 0 ? "firstItem" : void 0) : j.selectMenuItem(e, n);
|
|
151
|
+
}
|
|
152
|
+
function $(e, t) {
|
|
153
|
+
j.selectMenuItemAction(e, t);
|
|
154
|
+
}
|
|
155
|
+
return ne([z, () => k.focusRequest], ([e, t]) => {
|
|
156
|
+
e && t && K(t.focusTarget);
|
|
157
|
+
}, { flush: "post" }), b(() => clearTimeout(F)), (e, t) => {
|
|
158
|
+
let n = C("MenuPanel", !0);
|
|
159
|
+
return x(), h("div", {
|
|
160
|
+
id: _.panelId,
|
|
161
|
+
ref_key: "menuPanel",
|
|
162
|
+
ref: M,
|
|
163
|
+
role: "menu",
|
|
164
|
+
"aria-label": _.label,
|
|
165
|
+
tabindex: "-1",
|
|
166
|
+
style: y(E(L)),
|
|
167
|
+
class: v(B.value.panel({ class: V.value?.panel })),
|
|
168
|
+
onKeydown: me,
|
|
169
|
+
onPointermove: he,
|
|
170
|
+
onPointerleave: ge,
|
|
171
|
+
onPointerenter: t[1] ||= (e) => A("pointerEntered")
|
|
172
|
+
}, [(x(!0), h(u, null, S(_.entries, (e, t) => (x(), h(u, { key: t }, [E(c)(e) ? (x(), h("div", {
|
|
173
|
+
key: 0,
|
|
174
|
+
role: "separator",
|
|
175
|
+
class: v(B.value.separator({ class: V.value?.separator }))
|
|
176
|
+
}, null, 2)) : E(o)(e) ? (x(), h("div", {
|
|
177
|
+
key: 1,
|
|
178
|
+
role: "group",
|
|
179
|
+
"aria-label": e.label
|
|
180
|
+
}, [g("div", {
|
|
181
|
+
"aria-hidden": "true",
|
|
182
|
+
class: v(B.value.groupLabel({ class: V.value?.groupLabel }))
|
|
183
|
+
}, T(e.label), 3), (x(!0), h(u, null, S(e.items, (e, n) => (x(), p(i, {
|
|
184
|
+
key: n,
|
|
185
|
+
"menu-item": e,
|
|
186
|
+
"menu-theme-slots": B.value,
|
|
187
|
+
"submenu-key": `${t}.${n}`,
|
|
188
|
+
"submenu-id": E(N),
|
|
189
|
+
"is-submenu-open": P.value?.submenuKey === `${t}.${n}`,
|
|
190
|
+
onSelect: (r) => Q(e, `${t}.${n}`, r),
|
|
191
|
+
onSelectAction: $
|
|
192
|
+
}, null, 8, [
|
|
193
|
+
"menu-item",
|
|
194
|
+
"menu-theme-slots",
|
|
195
|
+
"submenu-key",
|
|
196
|
+
"submenu-id",
|
|
197
|
+
"is-submenu-open",
|
|
198
|
+
"onSelect"
|
|
199
|
+
]))), 128))], 8, ie)) : E(ee)(e) ? (x(), h("div", {
|
|
200
|
+
key: 2,
|
|
201
|
+
class: v(B.value.header({ class: V.value?.header }))
|
|
202
|
+
}, [g("div", { class: v(B.value.headerLabel({ class: V.value?.headerLabel })) }, T(e.label), 3), e.description ? (x(), h("div", {
|
|
203
|
+
key: 0,
|
|
204
|
+
class: v(B.value.headerDescription({ class: V.value?.headerDescription }))
|
|
205
|
+
}, T(e.description), 3)) : m("", !0)], 2)) : (x(), p(i, {
|
|
206
|
+
key: 3,
|
|
207
|
+
"menu-item": e,
|
|
208
|
+
"menu-theme-slots": B.value,
|
|
209
|
+
"submenu-key": String(t),
|
|
210
|
+
"submenu-id": E(N),
|
|
211
|
+
"is-submenu-open": P.value?.submenuKey === String(t),
|
|
212
|
+
onSelect: (n) => Q(e, String(t), n),
|
|
213
|
+
onSelectAction: $
|
|
214
|
+
}, null, 8, [
|
|
215
|
+
"menu-item",
|
|
216
|
+
"menu-theme-slots",
|
|
217
|
+
"submenu-key",
|
|
218
|
+
"submenu-id",
|
|
219
|
+
"is-submenu-open",
|
|
220
|
+
"onSelect"
|
|
221
|
+
]))], 64))), 128)), P.value?.menuItem.submenu ? (x(), p(d, {
|
|
222
|
+
key: 0,
|
|
223
|
+
to: E(j).menuLayer.value
|
|
224
|
+
}, [(x(), p(n, {
|
|
225
|
+
key: P.value.submenuKey,
|
|
226
|
+
"panel-id": E(N),
|
|
227
|
+
label: P.value.menuItem.label,
|
|
228
|
+
entries: P.value.menuItem.submenu,
|
|
229
|
+
anchor: U.value,
|
|
230
|
+
side: "right",
|
|
231
|
+
align: "start",
|
|
232
|
+
width: "auto",
|
|
233
|
+
"side-offset": 4,
|
|
234
|
+
"align-offset": -7,
|
|
235
|
+
"focus-request": P.value.focusRequest,
|
|
236
|
+
"is-submenu": "",
|
|
237
|
+
onRequestClose: t[0] ||= (e) => Y({ focusParentItem: !0 }),
|
|
238
|
+
onPointerEntered: ce
|
|
239
|
+
}, null, 8, [
|
|
240
|
+
"panel-id",
|
|
241
|
+
"label",
|
|
242
|
+
"entries",
|
|
243
|
+
"anchor",
|
|
244
|
+
"focus-request"
|
|
245
|
+
]))], 8, ["to"])) : m("", !0)], 46, re);
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
export { O as default };
|