@astryx-vue/core 0.1.0 → 0.1.3
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/README.md +1 -1
- package/dist/AppShell/index.d.ts +2 -0
- package/dist/AppShell/index.js +2 -0
- package/dist/AppShell-b0PWt9Fz.js +249 -0
- package/dist/AspectRatio/index.d.ts +2 -0
- package/dist/AspectRatio/index.js +2 -0
- package/dist/AspectRatio-Bij7e-tq.js +40 -0
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-DpYFXwgb.js → Calendar-CYhGDT6f.js} +2 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-Bfd-YPAK.js → Chat-C1aWl5V3.js} +2 -2
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-C86o3XoG.js → CheckboxInput-CMsEE1_4.js} +4 -2
- package/dist/CheckboxList/index.d.ts +2 -0
- package/dist/CheckboxList/index.js +2 -0
- package/dist/CheckboxList-EsIEXjK_.js +174 -0
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-DaDd1teb.js → Citation-C1X0Rde8.js} +2 -2
- package/dist/ClickableCard/index.d.ts +2 -0
- package/dist/ClickableCard/index.js +2 -0
- package/dist/ClickableCard-Bhds4RRe.js +112 -0
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-CK-NWM_1.js → CodeBlock-BQdooQy2.js} +1 -1
- package/dist/Collapsible/index.d.ts +2 -2
- package/dist/Collapsible/index.js +2 -2
- package/dist/Collapsible-BS9ctCQV.js +192 -0
- package/dist/CommandPalette/index.d.ts +2 -0
- package/dist/CommandPalette/index.js +2 -0
- package/dist/CommandPalette-u5h_E05P.js +489 -0
- package/dist/ComplexSelector/index.d.ts +2 -0
- package/dist/ComplexSelector/index.js +2 -0
- package/dist/ComplexSelector-BHmGWml0.js +293 -0
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-BJh99Exj.js → ContextMenu-dA-ppaRQ.js} +284 -12
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-zJAdXByM.js → DateInput-D2ErjXYO.js} +18 -10
- package/dist/DateRangeInput/index.d.ts +2 -0
- package/dist/DateRangeInput/index.js +2 -0
- package/dist/DateRangeInput-fmQlr_A7.js +385 -0
- package/dist/DateTimeInput/index.d.ts +2 -0
- package/dist/DateTimeInput/index.js +2 -0
- package/dist/DateTimeInput-Bs1JmcIp.js +196 -0
- package/dist/Divider/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +1 -1
- package/dist/DropdownMenu/index.js +1 -1
- package/dist/{DropdownMenu-C3j2zaEn.js → DropdownMenu-B0gogrvG.js} +2 -2
- package/dist/Field/index.d.ts +2 -2
- package/dist/Field/index.js +3 -4
- package/dist/{Field-VlTBsIEo.js → Field-8zRxzDHE.js} +11 -3
- package/dist/{FieldLabel-B1NRyQlS.js → FieldLabel-DmmJyX7w.js} +6 -1
- package/dist/FieldStatus/index.d.ts +2 -0
- package/dist/FieldStatus/index.js +2 -0
- package/dist/FileInput/index.d.ts +2 -0
- package/dist/FileInput/index.js +2 -0
- package/dist/FileInput-CmAfOpkA.js +238 -0
- package/dist/FormLayout/index.d.ts +2 -0
- package/dist/FormLayout/index.js +2 -0
- package/dist/FormLayout-D47FjiOq.js +40 -0
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/{Icon-B6qNgBP9.js → Icon-5MdZQ18k.js} +10 -2
- package/dist/Layout/index.d.ts +2 -0
- package/dist/Layout/index.js +3 -0
- package/dist/Layout-Bed3kP0M.js +56 -0
- package/dist/LayoutPanel-C34uOq3e.js +358 -0
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-DyKIwAL_.js → Markdown-CwtLr3f_.js} +2 -2
- package/dist/MetadataList/index.d.ts +2 -0
- package/dist/MetadataList/index.js +2 -0
- package/dist/MetadataList-DlXQTLog.js +124 -0
- package/dist/MobileNav/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-BK2iRJF-.js → MobileNavToggle-CgQamG6E.js} +19 -12
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BjUsVWWk.js → MoreMenu-BXL6Dqsu.js} +2 -2
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-CKTbTj1A.js → MultiSelector-DT8ZccMI.js} +3 -3
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DU3_rw7z.js → NumberInput-DspJO6z6.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-B2T5UtiQ.js → OverflowList-zXg3g6fy.js} +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-qCgNwwhr.js → Pagination-DXfgMUKJ.js} +2 -2
- package/dist/Popover/index.d.ts +2 -1
- package/dist/Radio/index.d.ts +2 -2
- package/dist/Radio/index.js +2 -2
- package/dist/{Radio-BioQfwHQ.js → RadioGroup-BqjdSCfJ.js} +21 -88
- package/dist/RadioList/index.d.ts +2 -0
- package/dist/RadioList/index.js +2 -0
- package/dist/RadioList-DI8ujXcT.js +122 -0
- package/dist/Resizable/index.d.ts +2 -0
- package/dist/Resizable/index.js +2 -0
- package/dist/Resizable-BuGKvU9I.js +261 -0
- package/dist/ScrollableArea/index.d.ts +2 -0
- package/dist/ScrollableArea/index.js +2 -0
- package/dist/ScrollableArea-DQDYjnxO.js +78 -0
- package/dist/Section/index.d.ts +2 -0
- package/dist/Section/index.js +2 -0
- package/dist/Section-C48Wqfc7.js +68 -0
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +2 -0
- package/dist/SelectableCard/index.js +2 -0
- package/dist/SelectableCard-Bj5s_tIN.js +108 -0
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-C6sPJMtH.js → Selector-DlZpQh42.js} +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -1
- package/dist/{SideNav-D9lnn-sM.js → SideNav-Cdrigq2A.js} +49 -27
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DTnWxtnb.js → Slider-D8h_RKcF.js} +1 -1
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +2 -0
- package/dist/Stepper/index.js +2 -0
- package/dist/Stepper-DxmLfh8O.js +423 -0
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-CNdnr5TP.js → Switch-SesQzPGZ.js} +4 -2
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.js +2 -2
- package/dist/TabList-C411uNQU.js +380 -0
- package/dist/Table/index.d.ts +3 -0
- package/dist/Table/index.js +2 -0
- package/dist/Table-7qRmlIQd.js +967 -0
- package/dist/Text/index.d.ts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-BL0NuB99.js → TextArea-Cv9UVbzS.js} +5 -3
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-B0IKC7g5.js → TextInput-BasnjVvy.js} +5 -3
- package/dist/Thumbnail/index.d.ts +2 -0
- package/dist/Thumbnail/index.js +2 -0
- package/dist/Thumbnail-BWVzLLyI.js +163 -0
- package/dist/TimeField-l3QzU6vC.js +214 -0
- package/dist/TimeInput/index.d.ts +2 -0
- package/dist/TimeInput/index.js +2 -0
- package/dist/TimeInput-OkgX-xbQ.js +121 -0
- package/dist/Timestamp/index.d.ts +2 -0
- package/dist/Timestamp/index.js +2 -0
- package/dist/Timestamp-DUoP9ari.js +465 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-Ctf9jekS.js → Token-C4KD0fZD.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-D5MPgau0.js → Tokenizer-BA8sTMPZ.js} +3 -3
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CjbMCbkC.js → TopNav-CZokS7E_.js} +57 -31
- package/dist/TreeList/index.d.ts +2 -0
- package/dist/TreeList/index.js +2 -0
- package/dist/TreeList-CIbAGOMf.js +506 -0
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-BMoU3hfx.js → Typeahead-DIw-K4aa.js} +3 -3
- package/dist/composables/index.d.ts +3 -2
- package/dist/composables/index.js +8 -2
- package/dist/composables-CVfjp9h4.js +502 -0
- package/dist/context-BjNya0v8.js +19 -0
- package/dist/context-Cfjh8te1.js +29 -0
- package/dist/{locale-56lkR7OK.js → context-D6ECRdc5.js} +267 -18
- package/dist/index-1uRMrk63.d.ts +54 -0
- package/dist/{index-Dw21t7Uf.d.ts → index-2u4l3wq8.d.ts} +2 -2
- package/dist/{index-CvLlWLIZ.d.ts → index-B4OOtNP8.d.ts} +4 -4
- package/dist/{index-_1-uvr27.d.ts → index-B8MbfMwV.d.ts} +1 -1
- package/dist/{index-MPcg1Pm4.d.ts → index-BKr7yvVv.d.ts} +1 -1
- package/dist/index-Be1czg3M.d.ts +167 -0
- package/dist/{index-Dbmgcm8a.d.ts → index-BeR-1LgF.d.ts} +2 -0
- package/dist/{index-CnVbMebA.d.ts → index-Bqb_Fyju.d.ts} +3 -3
- package/dist/index-BrJzFA5X.d.ts +38 -0
- package/dist/{index-BDZCJ9ri.d.ts → index-BuubzuE8.d.ts} +2 -2
- package/dist/index-By2mSzUA.d.ts +67 -0
- package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
- package/dist/{index-BQuN_dWR.d.ts → index-BzqRns96.d.ts} +1 -1
- package/dist/{index-BkIgRYGz.d.ts → index-C5p2NeCr.d.ts} +2 -2
- package/dist/{index-Cc2HGODZ.d.ts → index-C6RecznD.d.ts} +3 -3
- package/dist/{index-BSRk8MFK.d.ts → index-C8wDPDcP.d.ts} +1 -1
- package/dist/index-CDdRQQF3.d.ts +170 -0
- package/dist/index-COqjznX0.d.ts +47 -0
- package/dist/{index-Cz9ZHVf6.d.ts → index-CT8KEpec.d.ts} +2 -2
- package/dist/{index-CxspvLBl.d.ts → index-CTolyeii.d.ts} +1 -1
- package/dist/index-CVn0GBdB.d.ts +115 -0
- package/dist/index-CX97hlld.d.ts +158 -0
- package/dist/index-C_2Z65Rp.d.ts +67 -0
- package/dist/index-CjtAH60j.d.ts +38 -0
- package/dist/index-CtlkhQ55.d.ts +36 -0
- package/dist/{index-JeZ0YTyd.d.ts → index-D-ZuubCK.d.ts} +4 -4
- package/dist/index-DA52oIdw.d.ts +171 -0
- package/dist/{index-C8NW9xre.d.ts → index-DGNqi2za.d.ts} +7 -7
- package/dist/{index-CCA4R0Mf.d.ts → index-DT9S92sh.d.ts} +31 -6
- package/dist/index-DXSs3rwa.d.ts +252 -0
- package/dist/{index-C0S2Xzoi.d.ts → index-DYChvBOM.d.ts} +135 -0
- package/dist/index-Da7Jm8Ht.d.ts +10 -0
- package/dist/{index-CaHXYQ_E.d.ts → index-Df2YvC8o.d.ts} +717 -147
- package/dist/{index-DjOdQv5B.d.ts → index-DfgHJE7H.d.ts} +1 -1
- package/dist/{index-CPhDtlv-.d.ts → index-FEy8qFSD.d.ts} +3 -3
- package/dist/{index-DBcbfStA.d.ts → index-SMh42NI8.d.ts} +182 -2
- package/dist/{index-Cdi82rTW.d.ts → index-ZJyk8RtQ.d.ts} +6 -2
- package/dist/{index-BeJqhW4l.d.ts → index-fa72tWIU.d.ts} +3 -3
- package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
- package/dist/{index-BQa836Vz.d.ts → index-iBLzInje.d.ts} +6 -14
- package/dist/{index-BhYFxnjV.d.ts → index-kaKBOZSU.d.ts} +2 -2
- package/dist/index-nKlTsNfV.d.ts +42 -0
- package/dist/index-utZGF4GR.d.ts +79 -0
- package/dist/index.d.ts +76 -59
- package/dist/index.js +119 -78
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +2 -1
- package/dist/locale-Cpk_nrLA.js +18 -0
- package/dist/size-BuTzpgnR.d.ts +14 -0
- package/dist/size-xcIqExkS.js +79 -0
- package/dist/{index-Cp0NlzQv.d.ts → types-Db3Owy8Q.d.ts} +1 -36
- package/dist/types-JktRxujg.d.ts +107 -0
- package/dist/useAppShellMobile-DTsyuAJ4.js +19 -0
- package/dist/useClickableContainer-DyNpnSEa.js +112 -0
- package/dist/useFileSelection-BPtaegqK.js +58 -0
- package/dist/useMonthGrid-CmJsZTcB.js +139 -0
- package/dist/useResizable-CeESZS1v.d.ts +72 -0
- package/dist/useScrollableArea-DDk_CluT.js +172 -0
- package/dist/useTimeValue-DWk6oTAZ.js +113 -0
- package/package.json +97 -1
- package/styles/app-shell.css +151 -0
- package/styles/aspect-ratio.css +49 -0
- package/styles/bordered-control.css +87 -0
- package/styles/calendar.css +8 -2
- package/styles/card.css +5 -1
- package/styles/checkbox-list.css +15 -0
- package/styles/clickable-card.css +101 -0
- package/styles/collapsible.css +37 -0
- package/styles/command-palette.css +183 -0
- package/styles/complex-selector.css +114 -0
- package/styles/date-range-input.css +163 -0
- package/styles/date-time-input.css +40 -0
- package/styles/field.css +14 -3
- package/styles/file-input.css +87 -0
- package/styles/form-layout.css +31 -0
- package/styles/heading.css +19 -17
- package/styles/icon.css +32 -0
- package/styles/layout.css +280 -0
- package/styles/metadata-list.css +107 -0
- package/styles/number-input.css +6 -0
- package/styles/radio.css +32 -0
- package/styles/resize-handle.css +128 -0
- package/styles/scrollable-area.css +50 -0
- package/styles/section.css +60 -0
- package/styles/selector.css +10 -0
- package/styles/side-nav.css +26 -0
- package/styles/stepper.css +357 -0
- package/styles/tab-menu.css +91 -0
- package/styles/table.css +256 -0
- package/styles/text-area.css +6 -1
- package/styles/text-input.css +6 -0
- package/styles/thumbnail.css +151 -0
- package/styles/time-input.css +51 -0
- package/styles/timestamp.css +93 -0
- package/styles/tree-list.css +229 -0
- package/styles.css +23 -0
- package/dist/Collapsible-ByXCGhT8.js +0 -102
- package/dist/TabList-LV1U4ZD6.js +0 -184
- package/dist/composables-Dq9RS33w.js +0 -111
- package/dist/index-TnaIHsCS.d.ts +0 -87
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { a as useAstryxMessages } from "./context-D6ECRdc5.js";
|
|
2
|
+
import { t as _sfc_main$1 } from "./Icon-5MdZQ18k.js";
|
|
3
|
+
import { t as _sfc_main$2 } from "./Spinner-9cYUCnDy.js";
|
|
4
|
+
import { t as _sfc_main$3 } from "./Field-8zRxzDHE.js";
|
|
5
|
+
import { t as _sfc_main$4 } from "./Popover-Crhk9PNP.js";
|
|
6
|
+
import { computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, normalizeProps, onBeforeUnmount, openBlock, ref, renderSlot, resolveDynamicComponent, toDisplayString, useId, useModel, useSlots, watch, withCtx } from "vue";
|
|
7
|
+
import "../styles/complex-selector.css";
|
|
8
|
+
//#region src/ComplexSelector/ComplexSelector.vue
|
|
9
|
+
const _hoisted_1 = [
|
|
10
|
+
"data-placeholder",
|
|
11
|
+
"data-size",
|
|
12
|
+
"data-status",
|
|
13
|
+
"data-variant",
|
|
14
|
+
"aria-busy",
|
|
15
|
+
"aria-expanded",
|
|
16
|
+
"aria-invalid",
|
|
17
|
+
"aria-required",
|
|
18
|
+
"disabled"
|
|
19
|
+
];
|
|
20
|
+
const _hoisted_2 = { class: "astryx-complex-selector-value" };
|
|
21
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
22
|
+
name: "AstryxComplexSelector",
|
|
23
|
+
__name: "ComplexSelector",
|
|
24
|
+
props: /*@__PURE__*/ mergeModels({
|
|
25
|
+
label: {},
|
|
26
|
+
modelValue: {},
|
|
27
|
+
triggerLabel: {},
|
|
28
|
+
placeholder: {},
|
|
29
|
+
isLabelHidden: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
description: {},
|
|
34
|
+
isOptional: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
isRequired: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
isDisabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
isLoading: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
status: {},
|
|
51
|
+
statusVariant: { default: "attached" },
|
|
52
|
+
labelTooltip: {},
|
|
53
|
+
size: { default: "md" },
|
|
54
|
+
width: {},
|
|
55
|
+
placement: { default: "below" },
|
|
56
|
+
alignment: { default: "start" },
|
|
57
|
+
startIcon: {},
|
|
58
|
+
variant: { default: "input" },
|
|
59
|
+
renderTrigger: {},
|
|
60
|
+
handleRef: {},
|
|
61
|
+
changeAction: {}
|
|
62
|
+
}, {
|
|
63
|
+
"modelValue": { required: true },
|
|
64
|
+
"modelModifiers": {}
|
|
65
|
+
}),
|
|
66
|
+
emits: /*@__PURE__*/ mergeModels(["change"], ["update:modelValue"]),
|
|
67
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
68
|
+
const props = __props;
|
|
69
|
+
const emit = __emit;
|
|
70
|
+
const slots = useSlots();
|
|
71
|
+
const model = useModel(__props, "modelValue");
|
|
72
|
+
const messages = useAstryxMessages();
|
|
73
|
+
const isOpen = ref(false);
|
|
74
|
+
const isPending = ref(false);
|
|
75
|
+
const optimistic = ref(void 0);
|
|
76
|
+
const triggerId = `astryx-complex-selector-${useId()}`;
|
|
77
|
+
const labelId = `${triggerId}-label`;
|
|
78
|
+
const contentId = `${triggerId}-content`;
|
|
79
|
+
const placeholder = computed(() => props.placeholder ?? messages.value.selector.placeholder);
|
|
80
|
+
const isBusy = computed(() => props.isLoading || isPending.value);
|
|
81
|
+
const displayValue = computed(() => isPending.value && optimistic.value !== void 0 ? optimistic.value : model.value);
|
|
82
|
+
const hasTriggerLabel = computed(() => props.triggerLabel != null && props.triggerLabel !== "");
|
|
83
|
+
const state = computed(() => ({
|
|
84
|
+
isOpen: isOpen.value,
|
|
85
|
+
isBusy: isBusy.value,
|
|
86
|
+
triggerId,
|
|
87
|
+
contentId
|
|
88
|
+
}));
|
|
89
|
+
function setOpen(next) {
|
|
90
|
+
if (props.isDisabled) return;
|
|
91
|
+
isOpen.value = next;
|
|
92
|
+
}
|
|
93
|
+
async function commit(next) {
|
|
94
|
+
model.value = next;
|
|
95
|
+
emit("change", next);
|
|
96
|
+
if (props.changeAction == null) return;
|
|
97
|
+
optimistic.value = next;
|
|
98
|
+
isPending.value = true;
|
|
99
|
+
try {
|
|
100
|
+
await props.changeAction(next);
|
|
101
|
+
} finally {
|
|
102
|
+
isPending.value = false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function close() {
|
|
106
|
+
isOpen.value = false;
|
|
107
|
+
}
|
|
108
|
+
function open() {
|
|
109
|
+
if (props.isDisabled) return;
|
|
110
|
+
isOpen.value = true;
|
|
111
|
+
}
|
|
112
|
+
function toggle() {
|
|
113
|
+
if (isOpen.value) close();
|
|
114
|
+
else open();
|
|
115
|
+
}
|
|
116
|
+
function onTriggerKeyDown(event) {
|
|
117
|
+
if (event.key === "ArrowDown" && !isOpen.value && !props.isDisabled) {
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
isOpen.value = true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function onCustomClick(event) {
|
|
123
|
+
event.stopImmediatePropagation();
|
|
124
|
+
toggle();
|
|
125
|
+
}
|
|
126
|
+
const hasCustomTrigger = computed(() => props.renderTrigger != null || slots.trigger != null);
|
|
127
|
+
const triggerProps = computed(() => ({
|
|
128
|
+
"id": triggerId,
|
|
129
|
+
"onClick": onCustomClick,
|
|
130
|
+
"onKeydown": onTriggerKeyDown,
|
|
131
|
+
"aria-haspopup": "dialog",
|
|
132
|
+
"aria-expanded": isOpen.value,
|
|
133
|
+
"aria-controls": isOpen.value ? contentId : void 0,
|
|
134
|
+
"aria-busy": isBusy.value ? true : void 0,
|
|
135
|
+
"aria-label": props.label
|
|
136
|
+
}));
|
|
137
|
+
const triggerView = () => props.renderTrigger?.(triggerProps.value) ?? null;
|
|
138
|
+
const handle = {
|
|
139
|
+
open,
|
|
140
|
+
close,
|
|
141
|
+
toggle,
|
|
142
|
+
isOpen: () => isOpen.value
|
|
143
|
+
};
|
|
144
|
+
function publishHandle(value) {
|
|
145
|
+
const target = props.handleRef;
|
|
146
|
+
if (target == null) return;
|
|
147
|
+
if (typeof target === "function") target(value);
|
|
148
|
+
else target.value = value;
|
|
149
|
+
}
|
|
150
|
+
watch(() => props.handleRef, (_next, previous) => {
|
|
151
|
+
if (previous != null && previous !== props.handleRef) {
|
|
152
|
+
if (typeof previous === "function") previous(null);
|
|
153
|
+
else previous.value = null;
|
|
154
|
+
}
|
|
155
|
+
publishHandle(handle);
|
|
156
|
+
}, { immediate: true });
|
|
157
|
+
onBeforeUnmount(() => publishHandle(null));
|
|
158
|
+
__expose(handle);
|
|
159
|
+
return (_ctx, _cache) => {
|
|
160
|
+
return hasCustomTrigger.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
161
|
+
key: 0,
|
|
162
|
+
alignment: __props.alignment,
|
|
163
|
+
"has-auto-focus": true,
|
|
164
|
+
"has-close-button": false,
|
|
165
|
+
"is-enabled": !__props.isDisabled,
|
|
166
|
+
"is-open": isOpen.value,
|
|
167
|
+
label: __props.label,
|
|
168
|
+
padding: 3,
|
|
169
|
+
placement: __props.placement,
|
|
170
|
+
role: "dialog",
|
|
171
|
+
onOpenChange: setOpen
|
|
172
|
+
}, {
|
|
173
|
+
content: withCtx(() => [createElementVNode("div", {
|
|
174
|
+
id: contentId,
|
|
175
|
+
class: "astryx-complex-selector-content"
|
|
176
|
+
}, [renderSlot(_ctx.$slots, "default", {
|
|
177
|
+
close,
|
|
178
|
+
commit,
|
|
179
|
+
state: state.value,
|
|
180
|
+
value: displayValue.value
|
|
181
|
+
})])]),
|
|
182
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(triggerProps.value)), () => [(openBlock(), createBlock(resolveDynamicComponent(triggerView)))])]),
|
|
183
|
+
_: 3
|
|
184
|
+
}, 8, [
|
|
185
|
+
"alignment",
|
|
186
|
+
"is-enabled",
|
|
187
|
+
"is-open",
|
|
188
|
+
"label",
|
|
189
|
+
"placement"
|
|
190
|
+
])) : (openBlock(), createBlock(_sfc_main$3, {
|
|
191
|
+
key: 1,
|
|
192
|
+
class: "astryx-complex-selector-field",
|
|
193
|
+
"data-variant": __props.variant,
|
|
194
|
+
description: __props.description,
|
|
195
|
+
"input-id": triggerId,
|
|
196
|
+
"is-disabled": __props.isDisabled,
|
|
197
|
+
"is-label-hidden": __props.isLabelHidden,
|
|
198
|
+
"is-optional": __props.isOptional,
|
|
199
|
+
"is-required": __props.isRequired,
|
|
200
|
+
label: __props.label,
|
|
201
|
+
"label-id": labelId,
|
|
202
|
+
"label-tooltip": __props.labelTooltip,
|
|
203
|
+
status: __props.status,
|
|
204
|
+
"status-variant": __props.statusVariant,
|
|
205
|
+
width: __props.width
|
|
206
|
+
}, {
|
|
207
|
+
default: withCtx(() => [createVNode(_sfc_main$4, {
|
|
208
|
+
alignment: __props.alignment,
|
|
209
|
+
"has-auto-focus": true,
|
|
210
|
+
"has-close-button": false,
|
|
211
|
+
"is-enabled": !__props.isDisabled,
|
|
212
|
+
"is-open": isOpen.value,
|
|
213
|
+
label: __props.label,
|
|
214
|
+
padding: 3,
|
|
215
|
+
placement: __props.placement,
|
|
216
|
+
role: "dialog",
|
|
217
|
+
onOpenChange: setOpen
|
|
218
|
+
}, {
|
|
219
|
+
content: withCtx(() => [createElementVNode("div", {
|
|
220
|
+
id: contentId,
|
|
221
|
+
class: "astryx-complex-selector-content"
|
|
222
|
+
}, [renderSlot(_ctx.$slots, "default", {
|
|
223
|
+
close,
|
|
224
|
+
commit,
|
|
225
|
+
state: state.value,
|
|
226
|
+
value: displayValue.value
|
|
227
|
+
})])]),
|
|
228
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
229
|
+
id: triggerId,
|
|
230
|
+
class: "astryx-complex-selector",
|
|
231
|
+
"data-placeholder": hasTriggerLabel.value ? void 0 : "",
|
|
232
|
+
"data-size": __props.size,
|
|
233
|
+
"data-status": __props.status?.type,
|
|
234
|
+
"data-variant": __props.variant,
|
|
235
|
+
"aria-busy": isBusy.value || void 0,
|
|
236
|
+
"aria-expanded": isOpen.value,
|
|
237
|
+
"aria-invalid": __props.status?.type === "error" || void 0,
|
|
238
|
+
"aria-labelledby": labelId,
|
|
239
|
+
"aria-required": __props.isRequired || void 0,
|
|
240
|
+
disabled: __props.isDisabled,
|
|
241
|
+
type: "button",
|
|
242
|
+
onKeydown: onTriggerKeyDown
|
|
243
|
+
}, [
|
|
244
|
+
__props.startIcon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "astryx-complex-selector-start",
|
|
247
|
+
color: "secondary",
|
|
248
|
+
icon: __props.startIcon,
|
|
249
|
+
size: "sm"
|
|
250
|
+
}, null, 8, ["icon"])) : createCommentVNode("v-if", true),
|
|
251
|
+
createElementVNode("span", _hoisted_2, toDisplayString(hasTriggerLabel.value ? __props.triggerLabel : placeholder.value), 1),
|
|
252
|
+
isBusy.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
253
|
+
key: 1,
|
|
254
|
+
size: "sm"
|
|
255
|
+
})) : createCommentVNode("v-if", true),
|
|
256
|
+
createVNode(_sfc_main$1, {
|
|
257
|
+
class: "astryx-complex-selector-chevron",
|
|
258
|
+
"data-state": isOpen.value ? "expanded" : "collapsed",
|
|
259
|
+
color: "secondary",
|
|
260
|
+
icon: "chevronDown",
|
|
261
|
+
size: "sm"
|
|
262
|
+
}, null, 8, ["data-state"])
|
|
263
|
+
], 40, _hoisted_1)]),
|
|
264
|
+
_: 3
|
|
265
|
+
}, 8, [
|
|
266
|
+
"alignment",
|
|
267
|
+
"is-enabled",
|
|
268
|
+
"is-open",
|
|
269
|
+
"label",
|
|
270
|
+
"placement"
|
|
271
|
+
])]),
|
|
272
|
+
_: 3
|
|
273
|
+
}, 8, [
|
|
274
|
+
"data-variant",
|
|
275
|
+
"description",
|
|
276
|
+
"is-disabled",
|
|
277
|
+
"is-label-hidden",
|
|
278
|
+
"is-optional",
|
|
279
|
+
"is-required",
|
|
280
|
+
"label",
|
|
281
|
+
"label-tooltip",
|
|
282
|
+
"status",
|
|
283
|
+
"status-variant",
|
|
284
|
+
"width"
|
|
285
|
+
]));
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/ComplexSelector/index.ts
|
|
291
|
+
var ComplexSelector_default = _sfc_main;
|
|
292
|
+
//#endregion
|
|
293
|
+
export { _sfc_main as n, ComplexSelector_default as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as ContextMenuSlots, D as ContextMenuTriggerElement, E as ContextMenuSubMenuSlots, O as ContextMenuVariant, S as ContextMenuSize, T as ContextMenuSubMenuProps, _ as ContextMenuItemSlots, a as _default, b as ContextMenuProps, c as ContextMenuDividerData, d as ContextMenuGroupProps, f as ContextMenuGroupSlots, g as ContextMenuItemProps, h as ContextMenuItemIcon, i as _default$1, k as ContextMenuWidth, l as ContextMenuDividerProps, m as ContextMenuItemEmits, n as _default$3, o as useContextMenu, p as ContextMenuItemData, r as _default$2, s as useContextMenuSize, t as _default$4, u as ContextMenuEmits, v as ContextMenuItemTarget, w as ContextMenuSubMenuEmits, x as ContextMenuSection, y as ContextMenuOption } from "../index-
|
|
1
|
+
import { C as ContextMenuSlots, D as ContextMenuTriggerElement, E as ContextMenuSubMenuSlots, O as ContextMenuVariant, S as ContextMenuSize, T as ContextMenuSubMenuProps, _ as ContextMenuItemSlots, a as _default, b as ContextMenuProps, c as ContextMenuDividerData, d as ContextMenuGroupProps, f as ContextMenuGroupSlots, g as ContextMenuItemProps, h as ContextMenuItemIcon, i as _default$1, k as ContextMenuWidth, l as ContextMenuDividerProps, m as ContextMenuItemEmits, n as _default$3, o as useContextMenu, p as ContextMenuItemData, r as _default$2, s as useContextMenuSize, t as _default$4, u as ContextMenuEmits, v as ContextMenuItemTarget, w as ContextMenuSubMenuEmits, x as ContextMenuSection, y as ContextMenuOption } from "../index-CTolyeii.js";
|
|
2
2
|
export { _default as ContextMenu, _default$1 as ContextMenuDivider, type ContextMenuDividerData, type ContextMenuDividerProps, type ContextMenuEmits, _default$2 as ContextMenuGroup, type ContextMenuGroupProps, type ContextMenuGroupSlots, _default$3 as ContextMenuItem, type ContextMenuItemData, type ContextMenuItemEmits, type ContextMenuItemIcon, type ContextMenuItemProps, type ContextMenuItemSlots, type ContextMenuItemTarget, type ContextMenuOption, type ContextMenuProps, type ContextMenuSection, type ContextMenuSize, type ContextMenuSlots, _default$4 as ContextMenuSubMenu, type ContextMenuSubMenuEmits, type ContextMenuSubMenuProps, type ContextMenuSubMenuSlots, type ContextMenuTriggerElement, type ContextMenuVariant, type ContextMenuWidth, useContextMenu, useContextMenuSize };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as _sfc_main$1, i as _sfc_main$2, n as _sfc_main$4, o as useContextMenu, r as _sfc_main$3, s as useContextMenuSize, t as _sfc_main } from "../ContextMenu-
|
|
1
|
+
import { a as _sfc_main$1, i as _sfc_main$2, n as _sfc_main$4, o as useContextMenu, r as _sfc_main$3, s as useContextMenuSize, t as _sfc_main } from "../ContextMenu-dA-ppaRQ.js";
|
|
2
2
|
export { _sfc_main as ContextMenu, _sfc_main$1 as ContextMenuDivider, _sfc_main$2 as ContextMenuGroup, _sfc_main$3 as ContextMenuItem, _sfc_main$4 as ContextMenuSubMenu, useContextMenu, useContextMenuSize };
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
import { t as useMediaQuery } from "./useMediaQuery-GMmgp28-.js";
|
|
1
2
|
import { t as useDismiss } from "./useDismiss-CAiHU6QD.js";
|
|
2
3
|
import { t as useLongPress } from "./useLongPress-Cyxwa73s.js";
|
|
3
4
|
import { n as useOverflow } from "./useOverflow-VrwF5oek.js";
|
|
4
|
-
import { t as _sfc_main$6 } from "./Icon-
|
|
5
|
+
import { t as _sfc_main$6 } from "./Icon-5MdZQ18k.js";
|
|
5
6
|
import { t as _sfc_main$7 } from "./Divider-BtwnL18I.js";
|
|
6
7
|
import { t as usePositionedLayer } from "./usePositionedLayer-C1NBOsVT.js";
|
|
7
|
-
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
8
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
8
9
|
import "../styles/context-menu.css";
|
|
9
10
|
//#region src/ContextMenu/context.ts
|
|
10
11
|
const contextMenuContextKey = Symbol("astryx-context-menu");
|
|
12
|
+
/**
|
|
13
|
+
* Whether the submenu flyout that contains this one is showing.
|
|
14
|
+
*
|
|
15
|
+
* Nested flyouts are teleported to `body`, so hiding an ancestor's DOM does
|
|
16
|
+
* not hide them. Each submenu provides its own `showsFlyout` for the next
|
|
17
|
+
* level; a row with no ancestor submenu reads as open.
|
|
18
|
+
*/
|
|
19
|
+
const submenuAncestorOpenKey = Symbol("astryx-submenu-ancestor-open");
|
|
11
20
|
/** The surrounding menu, or `undefined` when the row stands alone. */
|
|
12
21
|
function useContextMenu() {
|
|
13
22
|
return inject(contextMenuContextKey, void 0);
|
|
@@ -385,6 +394,229 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
385
394
|
};
|
|
386
395
|
}
|
|
387
396
|
});
|
|
397
|
+
function sign(p1, p2, p3) {
|
|
398
|
+
return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
|
|
399
|
+
}
|
|
400
|
+
function isPointInTriangle(p, a, b, c) {
|
|
401
|
+
const d1 = sign(p, a, b);
|
|
402
|
+
const d2 = sign(p, b, c);
|
|
403
|
+
const d3 = sign(p, c, a);
|
|
404
|
+
return !((d1 < 0 || d2 < 0 || d3 < 0) && (d1 > 0 || d2 > 0 || d3 > 0));
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Whether `point` lies inside the triangle from `origin` (where the pointer
|
|
408
|
+
* left the row) to the flyout's near edge — the edge facing the origin.
|
|
409
|
+
*/
|
|
410
|
+
function isPointInSafeTriangle(point, origin, flyout) {
|
|
411
|
+
const pad = 8;
|
|
412
|
+
let edgeStart;
|
|
413
|
+
let edgeEnd;
|
|
414
|
+
if (origin.x <= flyout.left) {
|
|
415
|
+
edgeStart = {
|
|
416
|
+
x: flyout.left,
|
|
417
|
+
y: flyout.top - pad
|
|
418
|
+
};
|
|
419
|
+
edgeEnd = {
|
|
420
|
+
x: flyout.left,
|
|
421
|
+
y: flyout.bottom + pad
|
|
422
|
+
};
|
|
423
|
+
} else if (origin.x >= flyout.right) {
|
|
424
|
+
edgeStart = {
|
|
425
|
+
x: flyout.right,
|
|
426
|
+
y: flyout.top - pad
|
|
427
|
+
};
|
|
428
|
+
edgeEnd = {
|
|
429
|
+
x: flyout.right,
|
|
430
|
+
y: flyout.bottom + pad
|
|
431
|
+
};
|
|
432
|
+
} else if (origin.y <= flyout.top) {
|
|
433
|
+
edgeStart = {
|
|
434
|
+
x: flyout.left - pad,
|
|
435
|
+
y: flyout.top
|
|
436
|
+
};
|
|
437
|
+
edgeEnd = {
|
|
438
|
+
x: flyout.right + pad,
|
|
439
|
+
y: flyout.top
|
|
440
|
+
};
|
|
441
|
+
} else if (origin.y >= flyout.bottom) {
|
|
442
|
+
edgeStart = {
|
|
443
|
+
x: flyout.left - pad,
|
|
444
|
+
y: flyout.bottom
|
|
445
|
+
};
|
|
446
|
+
edgeEnd = {
|
|
447
|
+
x: flyout.right + pad,
|
|
448
|
+
y: flyout.bottom
|
|
449
|
+
};
|
|
450
|
+
} else return false;
|
|
451
|
+
return isPointInTriangle(point, origin, edgeStart, edgeEnd);
|
|
452
|
+
}
|
|
453
|
+
function useSubmenuHover(options) {
|
|
454
|
+
const hasHover = useMediaQuery("(hover: hover)");
|
|
455
|
+
let showTimer;
|
|
456
|
+
let hideTimer;
|
|
457
|
+
let stopTriangle = null;
|
|
458
|
+
/** Hover opened this flyout, so leaving may close it. */
|
|
459
|
+
let provenance = null;
|
|
460
|
+
let hoverOpenedAt = 0;
|
|
461
|
+
/** When the flyout last closed. A pointer enter inside the suppress window is ignored. */
|
|
462
|
+
let closedAt = 0;
|
|
463
|
+
/** While true, a point inside `isInsideTriangle` is still heading for the flyout. */
|
|
464
|
+
let isTracking = false;
|
|
465
|
+
let isInsideTriangle = () => false;
|
|
466
|
+
function clearShowTimer() {
|
|
467
|
+
if (showTimer != null) clearTimeout(showTimer);
|
|
468
|
+
showTimer = void 0;
|
|
469
|
+
}
|
|
470
|
+
function clearHideTimer() {
|
|
471
|
+
if (hideTimer != null) clearTimeout(hideTimer);
|
|
472
|
+
hideTimer = void 0;
|
|
473
|
+
}
|
|
474
|
+
function clearTriangle() {
|
|
475
|
+
stopTriangle?.();
|
|
476
|
+
stopTriangle = null;
|
|
477
|
+
isTracking = false;
|
|
478
|
+
isInsideTriangle = () => false;
|
|
479
|
+
}
|
|
480
|
+
function cancelTimers() {
|
|
481
|
+
clearShowTimer();
|
|
482
|
+
clearHideTimer();
|
|
483
|
+
clearTriangle();
|
|
484
|
+
}
|
|
485
|
+
function markClosed() {
|
|
486
|
+
const shouldStamp = options.isOpen() || provenance != null;
|
|
487
|
+
cancelTimers();
|
|
488
|
+
provenance = null;
|
|
489
|
+
hoverOpenedAt = 0;
|
|
490
|
+
if (shouldStamp) closedAt = Date.now();
|
|
491
|
+
}
|
|
492
|
+
function closeNow() {
|
|
493
|
+
cancelTimers();
|
|
494
|
+
provenance = null;
|
|
495
|
+
hoverOpenedAt = 0;
|
|
496
|
+
if (options.isOpen()) options.closeFromPointer();
|
|
497
|
+
}
|
|
498
|
+
function notePinned() {
|
|
499
|
+
cancelTimers();
|
|
500
|
+
provenance = "pinned";
|
|
501
|
+
hoverOpenedAt = 0;
|
|
502
|
+
closedAt = 0;
|
|
503
|
+
}
|
|
504
|
+
function noteHoverOpened() {
|
|
505
|
+
provenance = "hover";
|
|
506
|
+
hoverOpenedAt = Date.now();
|
|
507
|
+
closedAt = 0;
|
|
508
|
+
}
|
|
509
|
+
function scheduleHide(event) {
|
|
510
|
+
if (provenance !== "hover") return;
|
|
511
|
+
clearHideTimer();
|
|
512
|
+
clearTriangle();
|
|
513
|
+
let lastPoint = null;
|
|
514
|
+
const arm = () => {
|
|
515
|
+
clearHideTimer();
|
|
516
|
+
hideTimer = setTimeout(() => {
|
|
517
|
+
if (isTracking && lastPoint != null && isInsideTriangle(lastPoint)) {
|
|
518
|
+
arm();
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
closeNow();
|
|
522
|
+
}, 200);
|
|
523
|
+
};
|
|
524
|
+
arm();
|
|
525
|
+
const menu = unref(options.flyout);
|
|
526
|
+
const apex = event != null ? {
|
|
527
|
+
x: event.clientX,
|
|
528
|
+
y: event.clientY
|
|
529
|
+
} : null;
|
|
530
|
+
if (menu == null || apex == null || !options.isOpen()) return;
|
|
531
|
+
const rect = menu.getBoundingClientRect();
|
|
532
|
+
if (rect.width <= 0 || rect.height <= 0) return;
|
|
533
|
+
const doc = menu.ownerDocument;
|
|
534
|
+
isInsideTriangle = (point) => isPointInSafeTriangle(point, apex, rect);
|
|
535
|
+
isTracking = true;
|
|
536
|
+
lastPoint = apex;
|
|
537
|
+
const onPointerMove = (move) => {
|
|
538
|
+
const point = {
|
|
539
|
+
x: move.clientX,
|
|
540
|
+
y: move.clientY
|
|
541
|
+
};
|
|
542
|
+
lastPoint = point;
|
|
543
|
+
if (isInsideTriangle(point)) {
|
|
544
|
+
arm();
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
isTracking = false;
|
|
548
|
+
clearTriangle();
|
|
549
|
+
};
|
|
550
|
+
doc.addEventListener("pointermove", onPointerMove, true);
|
|
551
|
+
stopTriangle = () => {
|
|
552
|
+
doc.removeEventListener("pointermove", onPointerMove, true);
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
function onTriggerPointerEnter(event) {
|
|
556
|
+
if (event.pointerType !== "mouse" || !hasHover.value) return;
|
|
557
|
+
if (options.isOpen()) {
|
|
558
|
+
clearHideTimer();
|
|
559
|
+
clearTriangle();
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (closedAt > 0 && Date.now() - closedAt < 300) return;
|
|
563
|
+
clearShowTimer();
|
|
564
|
+
if (!options.isEnabled()) return;
|
|
565
|
+
showTimer = setTimeout(() => {
|
|
566
|
+
showTimer = void 0;
|
|
567
|
+
if (!options.isEnabled() || options.isOpen()) return;
|
|
568
|
+
options.openFromHover();
|
|
569
|
+
}, 150);
|
|
570
|
+
}
|
|
571
|
+
function onTriggerPointerLeave(event) {
|
|
572
|
+
if (event.pointerType !== "mouse") return;
|
|
573
|
+
closedAt = 0;
|
|
574
|
+
clearShowTimer();
|
|
575
|
+
scheduleHide(event);
|
|
576
|
+
}
|
|
577
|
+
function onFlyoutPointerEnter(event) {
|
|
578
|
+
if (event.pointerType !== "mouse") return;
|
|
579
|
+
clearShowTimer();
|
|
580
|
+
clearHideTimer();
|
|
581
|
+
clearTriangle();
|
|
582
|
+
}
|
|
583
|
+
function onFlyoutPointerLeave(event) {
|
|
584
|
+
if (event.pointerType !== "mouse") return;
|
|
585
|
+
closedAt = 0;
|
|
586
|
+
scheduleHide(event);
|
|
587
|
+
}
|
|
588
|
+
function onTriggerClick(event) {
|
|
589
|
+
if (!options.isEnabled()) return;
|
|
590
|
+
if (event.detail === 0) {
|
|
591
|
+
if (!options.isOpen()) options.openPinned();
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
cancelTimers();
|
|
595
|
+
if (!options.isOpen()) {
|
|
596
|
+
options.openPinned();
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
if (provenance === "hover" && hoverOpenedAt > 0 && Date.now() - hoverOpenedAt < 500) {
|
|
600
|
+
provenance = "pinned";
|
|
601
|
+
hoverOpenedAt = 0;
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
options.closeFromPointer();
|
|
605
|
+
}
|
|
606
|
+
onScopeDispose(cancelTimers);
|
|
607
|
+
return {
|
|
608
|
+
cancel: cancelTimers,
|
|
609
|
+
isHoverDriven: () => provenance === "hover",
|
|
610
|
+
markClosed,
|
|
611
|
+
noteHoverOpened,
|
|
612
|
+
notePinned,
|
|
613
|
+
onFlyoutPointerEnter,
|
|
614
|
+
onFlyoutPointerLeave,
|
|
615
|
+
onTriggerClick,
|
|
616
|
+
onTriggerPointerEnter,
|
|
617
|
+
onTriggerPointerLeave
|
|
618
|
+
};
|
|
619
|
+
}
|
|
388
620
|
//#endregion
|
|
389
621
|
//#region src/ContextMenu/ContextMenuSubMenu.vue
|
|
390
622
|
const _hoisted_1$1 = [
|
|
@@ -441,7 +673,9 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
441
673
|
const isOpen = ref(false);
|
|
442
674
|
const flyoutId = `astryx-context-menu-submenu-${useId()}`;
|
|
443
675
|
const flyoutLabel = computed(() => typeof props.label === "string" ? props.label : menu?.menuLabel.value ?? "Submenu");
|
|
444
|
-
const
|
|
676
|
+
const ancestorOpen = inject(submenuAncestorOpenKey, computed(() => true));
|
|
677
|
+
const showsFlyout = computed(() => isOpen.value && (menu?.isOpen.value ?? true) && ancestorOpen.value);
|
|
678
|
+
provide(submenuAncestorOpenKey, showsFlyout);
|
|
445
679
|
const { position } = usePositionedLayer({
|
|
446
680
|
anchor: row,
|
|
447
681
|
layer: flyout,
|
|
@@ -469,6 +703,14 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
469
703
|
enableEscape: computed(() => true),
|
|
470
704
|
onDismiss: () => close(true)
|
|
471
705
|
});
|
|
706
|
+
const hover = useSubmenuHover({
|
|
707
|
+
isEnabled: () => !props.isDisabled,
|
|
708
|
+
isOpen: () => isOpen.value,
|
|
709
|
+
flyout,
|
|
710
|
+
openFromHover,
|
|
711
|
+
openPinned: () => open(false),
|
|
712
|
+
closeFromPointer: () => close(false)
|
|
713
|
+
});
|
|
472
714
|
function open(focusFirstRow) {
|
|
473
715
|
if (props.isDisabled) return;
|
|
474
716
|
if (isOpen.value) {
|
|
@@ -477,10 +719,19 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
477
719
|
}
|
|
478
720
|
isOpen.value = true;
|
|
479
721
|
emit("openChange", true);
|
|
722
|
+
hover.notePinned();
|
|
480
723
|
if (focusFirstRow) nextTick(() => nav.focusFirst());
|
|
481
724
|
}
|
|
725
|
+
function openFromHover() {
|
|
726
|
+
if (props.isDisabled || isOpen.value) return;
|
|
727
|
+
isOpen.value = true;
|
|
728
|
+
emit("openChange", true);
|
|
729
|
+
hover.noteHoverOpened();
|
|
730
|
+
}
|
|
482
731
|
function close(focusRow) {
|
|
483
|
-
|
|
732
|
+
const wasOpen = isOpen.value;
|
|
733
|
+
hover.markClosed();
|
|
734
|
+
if (!wasOpen) return;
|
|
484
735
|
isOpen.value = false;
|
|
485
736
|
nav.resetTypeahead();
|
|
486
737
|
emit("openChange", false);
|
|
@@ -496,12 +747,22 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
496
747
|
close(false);
|
|
497
748
|
}
|
|
498
749
|
function onRowFocusOut() {
|
|
499
|
-
if (!isOpen.value) return;
|
|
750
|
+
if (!isOpen.value || hover.isHoverDriven()) return;
|
|
500
751
|
nextTick(() => {
|
|
752
|
+
if (!isOpen.value || hover.isHoverDriven()) return;
|
|
501
753
|
const active = row.value?.ownerDocument.activeElement;
|
|
502
754
|
if (!(active instanceof Node && (row.value?.contains(active) === true || flyout.value?.contains(active) === true))) close(false);
|
|
503
755
|
});
|
|
504
756
|
}
|
|
757
|
+
function onRowClick(event) {
|
|
758
|
+
hover.onTriggerClick(event);
|
|
759
|
+
}
|
|
760
|
+
function onRowPointerMove(event) {
|
|
761
|
+
if (props.isDisabled || event.pointerType !== "mouse") return;
|
|
762
|
+
const element = row.value;
|
|
763
|
+
if (element == null || element === element.ownerDocument.activeElement) return;
|
|
764
|
+
element.focus({ preventScroll: true });
|
|
765
|
+
}
|
|
505
766
|
function onFlyoutKeyDown(event) {
|
|
506
767
|
if (event.isComposing) return;
|
|
507
768
|
if (event.key === "ArrowLeft") {
|
|
@@ -515,11 +776,18 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
515
776
|
emit("select", item, event);
|
|
516
777
|
}
|
|
517
778
|
function onRowPointerEnter(event) {
|
|
518
|
-
|
|
519
|
-
open(false);
|
|
779
|
+
hover.onTriggerPointerEnter(event);
|
|
520
780
|
}
|
|
521
|
-
watch(() => menu?.isOpen.value, (
|
|
522
|
-
if (
|
|
781
|
+
watch(() => menu?.isOpen.value, (menuOpen) => {
|
|
782
|
+
if (menuOpen === false) {
|
|
783
|
+
hover.cancel();
|
|
784
|
+
close(false);
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
watch(ancestorOpen, (visible) => {
|
|
788
|
+
if (visible) return;
|
|
789
|
+
hover.cancel();
|
|
790
|
+
close(false);
|
|
523
791
|
});
|
|
524
792
|
return (_ctx, _cache) => {
|
|
525
793
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
@@ -538,10 +806,12 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
538
806
|
role: "menuitem",
|
|
539
807
|
style: unref(attrs).style,
|
|
540
808
|
tabindex: __props.isDisabled ? void 0 : -1,
|
|
541
|
-
onClick:
|
|
809
|
+
onClick: onRowClick,
|
|
542
810
|
onFocusout: onRowFocusOut,
|
|
543
811
|
onKeydown: onRowKeyDown,
|
|
544
|
-
onPointerenter: onRowPointerEnter
|
|
812
|
+
onPointerenter: onRowPointerEnter,
|
|
813
|
+
onPointerleave: _cache[0] || (_cache[0] = (...args) => unref(hover).onTriggerPointerLeave && unref(hover).onTriggerPointerLeave(...args)),
|
|
814
|
+
onPointermove: onRowPointerMove
|
|
545
815
|
}), [
|
|
546
816
|
__props.icon != null || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$6, {
|
|
547
817
|
icon: __props.icon,
|
|
@@ -573,7 +843,9 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
573
843
|
style: normalizeStyle(flyoutStyle.value),
|
|
574
844
|
tabindex: "-1",
|
|
575
845
|
onContextmenu: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
|
|
576
|
-
onKeydown: onFlyoutKeyDown
|
|
846
|
+
onKeydown: onFlyoutKeyDown,
|
|
847
|
+
onPointerenter: _cache[2] || (_cache[2] = (...args) => unref(hover).onFlyoutPointerEnter && unref(hover).onFlyoutPointerEnter(...args)),
|
|
848
|
+
onPointerleave: _cache[3] || (_cache[3] = (...args) => unref(hover).onFlyoutPointerLeave && unref(hover).onFlyoutPointerLeave(...args))
|
|
577
849
|
}, [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(_sfc_main$1, {
|
|
578
850
|
items: __props.items ?? [],
|
|
579
851
|
onSelect: onNestedSelect
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as DateInputSlots, n as DateInputEmits, r as DateInputProps, t as _default } from "../index-
|
|
1
|
+
import { i as DateInputSlots, n as DateInputEmits, r as DateInputProps, t as _default } from "../index-ZJyk8RtQ.js";
|
|
2
2
|
export { _default as DateInput, type DateInputEmits, type DateInputProps, type DateInputSlots };
|
package/dist/DateInput/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _sfc_main } from "../DateInput-
|
|
1
|
+
import { t as _sfc_main } from "../DateInput-D2ErjXYO.js";
|
|
2
2
|
export { _sfc_main as DateInput };
|