@astryx-vue/core 0.6.1 → 0.7.1
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/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-CBkJecfc.js → AlertDialog-Bya9zo9h.js} +3 -3
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-BSsueavl.js → Avatar-BHT4xY-0.js} +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-DhVBdHeQ.js → AvatarGroup-ezWQX5UE.js} +5 -2
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-m54uCMJN.js → BottomSheet-BrxST6Zp.js} +2 -1
- package/dist/{BottomSheet-B4sc3F1S.js → BottomSheet-itRm1Yh5.js} +1 -0
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/{Breadcrumbs-DRXYUqOk.js → Breadcrumbs-DYmOUlSu.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Card/index.d.ts +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-sNg2CZ_P.js → Chat-DpH2ob4k.js} +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-DnqRfWKg.js → CheckboxList-C4naSbfT.js} +1 -1
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-DM66XZ07.js → ClickableCard-CGjr4c7g.js} +1 -1
- package/dist/Code/index.d.ts +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-DFxk2sil.js → CommandPalette-B6lzcEE4.js} +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-32r0RVQE.js → ComplexSelector-CABdPOyw.js} +16 -3
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-BH_yV1xZ.js → ContextMenu-DMSJQdZ5.js} +1 -1
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-B57PrbII.js → DateInput-cVln1Xnn.js} +4 -6
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-BMw1A5Q3.js → DateTimeInput-CViJJt8m.js} +3 -3
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +3 -2
- package/dist/{Dialog-fhyxB00e.js → Dialog-BhxN-tp4.js} +1 -0
- package/dist/Dialog-Bn4eUNiy.js +49 -0
- package/dist/{Dialog-CL8u76KG.js → DialogHeader-B-Lz4rB5.js} +3 -49
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +2 -0
- package/dist/Drawer/index.js +2 -0
- package/dist/Drawer-DjSbpQcy.js +137 -0
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-C0QDklYy.js → DropdownMenu-CtrztU4N.js} +147 -30
- package/dist/{DropdownMenu-DO9lDRvW.js → DropdownMenu-CxbpuT2r.js} +2 -2
- package/dist/{DropdownMenuRadioItem.vue-D-VSfulY.d.ts → DropdownMenuRadioItem.vue-z0XU7pZS.d.ts} +9 -0
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-QNsJMLv1.js → EmptyState-CM7cJ9fJ.js} +2 -2
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BzBunfN7.js → Heading-Cdveyoqy.js} +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-BpJhT0sn.js → HoverCard-C3zQizyS.js} +93 -67
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-Dq-v9ioN.js → Link-DZeCmoC7.js} +1 -1
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-b8M7X3Pg.js → Markdown-BrlfeGxD.js} +2 -2
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-op981Hx8.js → MoreMenu-DOJ4A4bM.js} +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-DVqD6OEy.js → MultiSelector-r5acBuN0.js} +10 -5
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-L0IDhBbo.js → Pagination-CYmPEKKt.js} +1 -1
- package/dist/Popover/index.d.ts +1 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-CBYYhpvA.js → PowerSearch-Dly2Behg.js} +9 -9
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-VP4JS7vm.js → ProgressBar-DRXMv9wa.js} +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-aPYacVf4.js → RadioGroup-CoXtTIbN.js} +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-bSQ-r2bJ.js → RadioList-BT3EX9eg.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-Dle5Lbvs.js → Selector-PYpxWfKo.js} +38 -15
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-2YawTRxj.js → SideNav-BHdpZcGB.js} +1 -1
- package/dist/Stack/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-BS_ohXhd.js → StatusDot-Dp8aOfpX.js} +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-npiEQK-q.js → TabList-CXLDPFte.js} +30 -6
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-DiCsQaqu.js → Table-DB1DBqHj.js} +5 -5
- package/dist/Text/index.js +1 -1
- package/dist/{Text-D5Cc7BMp.js → Text-ukuKa6kX.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-CiTkiqS_.js → Thumbnail-CyvBQAi6.js} +1 -1
- package/dist/{TimeField-Dajh0ej2.js → TimeField-BnXwqr_O.js} +8 -12
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-BVrrBcMF.js → TimeInput-68-3BdYQ.js} +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-DFC8PhJl.js → Timer-DShkQlT0.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-Bf6iQTk6.js → Timestamp-CbDyOZFU.js} +2 -2
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-CBrEN21_.js → Token-DP3bU-8c.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-DxOCrbq3.js → Tokenizer-DT1Kj9dR.js} +1 -1
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-sAM8i1eO.js → Tooltip-B0aQ9CKg.js} +8 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-XpX5aA-Q.js → Typeahead-D4oT1wUP.js} +1 -1
- package/dist/{disabledInteraction-C9lrgFxB.js → disabledInteraction-CPzL8kVP.js} +20 -1
- package/dist/{index-DybUnyAp.d.ts → index--17eKu38.d.ts} +9 -9
- package/dist/{index-TXcNH86P.d.ts → index-B1eCxBCY.d.ts} +1 -1
- package/dist/{index-DbiZvj1P.d.ts → index-B8EnP-PB.d.ts} +1 -1
- package/dist/{index-j0WJTviq.d.ts → index-BAC56Bhr.d.ts} +3 -3
- package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
- package/dist/{index-wY6dKz6c.d.ts → index-BEZ4ezJk.d.ts} +2 -2
- package/dist/{index-C1zwvxPH.d.ts → index-BVQwXcnZ.d.ts} +1 -1
- package/dist/{index-CTjkJP4x.d.ts → index-Bgk1Rj2A.d.ts} +1 -1
- package/dist/{index-mkbGYz8f.d.ts → index-Bn-v89Vt.d.ts} +3 -3
- package/dist/{index-UFlyBbRd.d.ts → index-BngdKVro.d.ts} +1 -1
- package/dist/{index-_pze-_fd.d.ts → index-C085uLOn.d.ts} +5 -5
- package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
- package/dist/{index-gW0HW02U.d.ts → index-COxy6LEW.d.ts} +1 -1
- package/dist/{index-eP0-QrWx.d.ts → index-CW32PbaD.d.ts} +9 -9
- package/dist/{index-B5cFQLav.d.ts → index-CXdImpTj.d.ts} +218 -127
- package/dist/{index-Ca8VIE4l.d.ts → index-ChOyJzJh.d.ts} +2 -2
- package/dist/{index-hCpxKePE.d.ts → index-D5N9ikrS.d.ts} +1 -1
- package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
- package/dist/{index-Cy1rEWC-.d.ts → index-DMcf0QeR.d.ts} +2 -2
- package/dist/{index-BhLLG-Gi.d.ts → index-DfsX0szf.d.ts} +3 -3
- package/dist/{index-BNaRK-s5.d.ts → index-DsaP4-eB.d.ts} +1 -1
- package/dist/{index-C_6RCsGf.d.ts → index-Gnewu6-J.d.ts} +1 -1
- package/dist/{index-Ds201-d2.d.ts → index-IfiA8CSr.d.ts} +3 -3
- package/dist/{index-B1WWphal.d.ts → index-IvAfdGCC.d.ts} +1 -1
- package/dist/{index-COgrQZIL.d.ts → index-YKCx03zD.d.ts} +2 -2
- package/dist/{index-EvhMa33P.d.ts → index-itjBXTrm.d.ts} +3 -3
- package/dist/{index-DXJ3U3ve.d.ts → index-oYGkhGRq.d.ts} +3 -3
- package/dist/{index-Dy746dfn.d.ts → index-unAZVFGz.d.ts} +1 -1
- package/dist/index.d.ts +68 -68
- package/dist/index.js +104 -102
- package/dist/{useMenuHover-Djreu23i.js → useMenuHover-Ctmp4Xkh.js} +1 -0
- package/package.json +5 -1
- package/styles/drawer.css +77 -0
- package/styles/dropdown-menu.css +28 -0
- package/styles.css +1 -0
- package/dist/{index-J6YRJ7Ul.d.ts → index-BJ9Wim6J.d.ts} +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as _sfc_main$1 } from "./IconButton-BmMIccb4.js";
|
|
2
2
|
import { s as useAstryxMessages } from "./context-CVUee2tp.js";
|
|
3
|
-
import { n as DIALOG_CONTEXT_KEY
|
|
4
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent,
|
|
3
|
+
import { n as DIALOG_CONTEXT_KEY } from "./Dialog-BhxN-tp4.js";
|
|
4
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, mergeProps, normalizeClass, onBeforeUnmount, onMounted, openBlock, renderSlot, toDisplayString, useAttrs, useId, useSlots, withCtx } from "vue";
|
|
5
5
|
import "../styles/dialog-header.css";
|
|
6
6
|
//#region src/Dialog/DialogHeader.vue
|
|
7
7
|
const _hoisted_1 = {
|
|
@@ -109,50 +109,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
//#endregion
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 无需管理 `isOpen` 状态即可打开对话框。
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```
|
|
118
|
-
* const dialog = useImperativeDialog()
|
|
119
|
-
* // <button @click="dialog.show(() => h('p', 'Hello'))">Open</button>
|
|
120
|
-
* // <dialog.Host />
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
function useImperativeDialog(defaultOptions = {}) {
|
|
124
|
-
const isOpen = ref(false);
|
|
125
|
-
const content = shallowRef(() => null);
|
|
126
|
-
const options = shallowRef(defaultOptions);
|
|
127
|
-
function show(nextContent, nextOptions) {
|
|
128
|
-
content.value = nextContent;
|
|
129
|
-
if (nextOptions) options.value = {
|
|
130
|
-
...options.value,
|
|
131
|
-
...nextOptions
|
|
132
|
-
};
|
|
133
|
-
isOpen.value = true;
|
|
134
|
-
}
|
|
135
|
-
function hide() {
|
|
136
|
-
isOpen.value = false;
|
|
137
|
-
}
|
|
138
|
-
const Host = defineComponent({
|
|
139
|
-
name: "AstryxImperativeDialogHost",
|
|
140
|
-
setup() {
|
|
141
|
-
return () => h(_sfc_main$2, {
|
|
142
|
-
...options.value,
|
|
143
|
-
isOpen: isOpen.value,
|
|
144
|
-
onOpenChange: (open) => {
|
|
145
|
-
if (!open) isOpen.value = false;
|
|
146
|
-
}
|
|
147
|
-
}, { default: () => content.value() });
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
return {
|
|
151
|
-
show,
|
|
152
|
-
hide,
|
|
153
|
-
isOpen: readonly(isOpen),
|
|
154
|
-
Host
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
export { _sfc_main as n, useImperativeDialog as t };
|
|
112
|
+
export { _sfc_main as t };
|
package/dist/Divider/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as DividerVariant, n as DividerOrientation, r as DividerProps, t as _default } from "../index-
|
|
1
|
+
import { i as DividerVariant, n as DividerOrientation, r as DividerProps, t as _default } from "../index-C8wfe0Mr.js";
|
|
2
2
|
export { _default as Divider, type DividerOrientation, type DividerProps, type DividerVariant };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Ci as DrawerHeaderSlots, Ei as DrawerSlots, Si as DrawerHeaderProps, Ti as DrawerProps, bi as DrawerEmits, vi as _default$1, wi as DrawerPlacement, xi as DrawerHeaderEmits, yi as _default } from "../index-CXdImpTj.js";
|
|
2
|
+
export { _default as Drawer, type DrawerEmits, _default$1 as DrawerHeader, type DrawerHeaderEmits, type DrawerHeaderProps, type DrawerHeaderSlots, type DrawerPlacement, type DrawerProps, type DrawerSlots };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { t as _sfc_main$2 } from "./Dialog-BhxN-tp4.js";
|
|
2
|
+
import { t as _sfc_main$3 } from "./DialogHeader-B-Lz4rB5.js";
|
|
3
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, defineComponent, getCurrentInstance, mergeProps, openBlock, renderSlot, unref, useAttrs, useSlots, withCtx } from "vue";
|
|
4
|
+
import "../styles/drawer.css";
|
|
5
|
+
//#region src/Drawer/Drawer.vue
|
|
6
|
+
const _hoisted_1 = { class: "astryx-drawer-body" };
|
|
7
|
+
const _hoisted_2 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "astryx-drawer-footer"
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 贴边的模态面板。模态、焦点陷阱、焦点归还、滚动锁和 `purpose` 的关闭规则
|
|
13
|
+
* 都由 `Dialog` 负责,这里只决定贴哪一边和多大。
|
|
14
|
+
*/
|
|
15
|
+
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
16
|
+
name: "AstryxDrawer",
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
__name: "Drawer",
|
|
19
|
+
props: {
|
|
20
|
+
isOpen: { type: Boolean },
|
|
21
|
+
label: {},
|
|
22
|
+
placement: { default: "end" },
|
|
23
|
+
width: { default: 400 },
|
|
24
|
+
padding: { default: void 0 },
|
|
25
|
+
purpose: { default: "info" }
|
|
26
|
+
},
|
|
27
|
+
emits: ["openChange"],
|
|
28
|
+
setup(__props, { emit: __emit }) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const emit = __emit;
|
|
31
|
+
const attrs = useAttrs();
|
|
32
|
+
const position = computed(() => props.placement === "start" ? {
|
|
33
|
+
start: 0,
|
|
34
|
+
top: 0,
|
|
35
|
+
bottom: 0
|
|
36
|
+
} : {
|
|
37
|
+
end: 0,
|
|
38
|
+
top: 0,
|
|
39
|
+
bottom: 0
|
|
40
|
+
});
|
|
41
|
+
const rootAttrs = computed(() => Object.fromEntries(Object.entries(attrs).filter(([name]) => name !== "class" && name !== "style")));
|
|
42
|
+
return (_ctx, _cache) => {
|
|
43
|
+
return openBlock(), createBlock(_sfc_main$2, mergeProps(rootAttrs.value, {
|
|
44
|
+
"aria-label": __props.label,
|
|
45
|
+
class: ["astryx-drawer", [`astryx-drawer--${__props.placement}`, unref(attrs).class]],
|
|
46
|
+
"is-open": __props.isOpen,
|
|
47
|
+
"max-height": "100dvh",
|
|
48
|
+
padding: __props.padding,
|
|
49
|
+
position: position.value,
|
|
50
|
+
purpose: __props.purpose,
|
|
51
|
+
style: unref(attrs).style,
|
|
52
|
+
width: __props.width,
|
|
53
|
+
onOpenChange: _cache[0] || (_cache[0] = ($event) => emit("openChange", $event))
|
|
54
|
+
}), {
|
|
55
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [renderSlot(_ctx.$slots, "default")]), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_2, [renderSlot(_ctx.$slots, "footer")])) : createCommentVNode("v-if", true)]),
|
|
56
|
+
_: 3
|
|
57
|
+
}, 16, [
|
|
58
|
+
"aria-label",
|
|
59
|
+
"class",
|
|
60
|
+
"is-open",
|
|
61
|
+
"padding",
|
|
62
|
+
"position",
|
|
63
|
+
"purpose",
|
|
64
|
+
"style",
|
|
65
|
+
"width"
|
|
66
|
+
]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/Drawer/DrawerHeader.vue
|
|
72
|
+
/**
|
|
73
|
+
* 抽屉的标题行。布局、标题语义和关闭按钮的补偿边都复用 `DialogHeader`,
|
|
74
|
+
* 这里只把关闭按钮的默认值和事件名换成抽屉的说法。
|
|
75
|
+
*/
|
|
76
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
77
|
+
name: "AstryxDrawerHeader",
|
|
78
|
+
__name: "DrawerHeader",
|
|
79
|
+
props: {
|
|
80
|
+
title: {},
|
|
81
|
+
subtitle: { default: void 0 },
|
|
82
|
+
hasCloseButton: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: void 0
|
|
85
|
+
},
|
|
86
|
+
closeButtonLabel: { default: void 0 }
|
|
87
|
+
},
|
|
88
|
+
emits: ["openChange"],
|
|
89
|
+
setup(__props, { emit: __emit }) {
|
|
90
|
+
const props = __props;
|
|
91
|
+
const emit = __emit;
|
|
92
|
+
const instance = getCurrentInstance();
|
|
93
|
+
const slots = useSlots();
|
|
94
|
+
/**
|
|
95
|
+
* 关闭按钮只在有人接关闭请求时出现:没人处理的按钮点了什么也不会发生。
|
|
96
|
+
* 显式传 `hasCloseButton` 时以传入值为准。监听函数在渲染时才看得到,所以放在 computed 里读。
|
|
97
|
+
*/
|
|
98
|
+
const showClose = computed(() => props.hasCloseButton ?? instance?.vnode?.props?.onOpenChange != null);
|
|
99
|
+
return (_ctx, _cache) => {
|
|
100
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
101
|
+
"close-button-label": __props.closeButtonLabel,
|
|
102
|
+
"has-close-button": showClose.value,
|
|
103
|
+
subtitle: __props.subtitle,
|
|
104
|
+
title: __props.title,
|
|
105
|
+
onOpenChange: _cache[0] || (_cache[0] = ($event) => emit("openChange", false))
|
|
106
|
+
}, createSlots({ _: 2 }, [
|
|
107
|
+
unref(slots).title ? {
|
|
108
|
+
name: "title",
|
|
109
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "title")]),
|
|
110
|
+
key: "0"
|
|
111
|
+
} : void 0,
|
|
112
|
+
unref(slots).subtitle ? {
|
|
113
|
+
name: "subtitle",
|
|
114
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "subtitle")]),
|
|
115
|
+
key: "1"
|
|
116
|
+
} : void 0,
|
|
117
|
+
unref(slots).startContent ? {
|
|
118
|
+
name: "startContent",
|
|
119
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "startContent")]),
|
|
120
|
+
key: "2"
|
|
121
|
+
} : void 0,
|
|
122
|
+
unref(slots).endContent ? {
|
|
123
|
+
name: "endContent",
|
|
124
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "endContent")]),
|
|
125
|
+
key: "3"
|
|
126
|
+
} : void 0
|
|
127
|
+
]), 1032, [
|
|
128
|
+
"close-button-label",
|
|
129
|
+
"has-close-button",
|
|
130
|
+
"subtitle",
|
|
131
|
+
"title"
|
|
132
|
+
]);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
//#endregion
|
|
137
|
+
export { _sfc_main$1 as n, _sfc_main as t };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as DropdownMenuRadioGroupSlots, C as DropdownMenuGroupSlots, D as DropdownMenuItemVariant, E as DropdownMenuItemSlots, F as DropdownMenuSubMenuProps, I as DropdownMenuSubMenuSlots, M as DropdownMenuRadioItemSlots, N as DropdownMenuSubMenuEmits, O as DropdownMenuRadioGroupEmits, P as DropdownMenuSubMenuPresentation, S as DropdownMenuGroupProps, T as DropdownMenuItemProps, _ as DropdownMenuSlots, a as DropdownMenuCheckboxData, b as DropdownMenuCheckboxItemProps, c as DropdownMenuEntry, d as DropdownMenuPresentation, f as DropdownMenuProps, g as DropdownMenuSize, h as DropdownMenuSection, i as DropdownMenuButtonProps, j as DropdownMenuRadioItemProps, k as DropdownMenuRadioGroupProps, l as DropdownMenuItemData, m as DropdownMenuRadioOptionData, n as _default$5, o as DropdownMenuDividerData, p as DropdownMenuRadioData, r as _default$1, s as DropdownMenuEmits, t as _default$6, u as DropdownMenuOption, v as DropdownMenuTriggerProps, w as DropdownMenuItemEmits, x as DropdownMenuCheckboxItemSlots, y as DropdownMenuCheckboxItemEmits } from "../DropdownMenuRadioItem.vue-
|
|
2
|
-
import { a as _default, c as useDropdownMenuContext, i as _default$2, l as useDropdownMenuRadioGroup, n as _default$4, o as DropdownMenuContextValue, r as _default$3, s as DropdownMenuRadioGroupContext, t as _default$7 } from "../index-
|
|
1
|
+
import { A as DropdownMenuRadioGroupSlots, C as DropdownMenuGroupSlots, D as DropdownMenuItemVariant, E as DropdownMenuItemSlots, F as DropdownMenuSubMenuProps, I as DropdownMenuSubMenuSlots, M as DropdownMenuRadioItemSlots, N as DropdownMenuSubMenuEmits, O as DropdownMenuRadioGroupEmits, P as DropdownMenuSubMenuPresentation, S as DropdownMenuGroupProps, T as DropdownMenuItemProps, _ as DropdownMenuSlots, a as DropdownMenuCheckboxData, b as DropdownMenuCheckboxItemProps, c as DropdownMenuEntry, d as DropdownMenuPresentation, f as DropdownMenuProps, g as DropdownMenuSize, h as DropdownMenuSection, i as DropdownMenuButtonProps, j as DropdownMenuRadioItemProps, k as DropdownMenuRadioGroupProps, l as DropdownMenuItemData, m as DropdownMenuRadioOptionData, n as _default$5, o as DropdownMenuDividerData, p as DropdownMenuRadioData, r as _default$1, s as DropdownMenuEmits, t as _default$6, u as DropdownMenuOption, v as DropdownMenuTriggerProps, w as DropdownMenuItemEmits, x as DropdownMenuCheckboxItemSlots, y as DropdownMenuCheckboxItemEmits } from "../DropdownMenuRadioItem.vue-z0XU7pZS.js";
|
|
2
|
+
import { a as _default, c as useDropdownMenuContext, i as _default$2, l as useDropdownMenuRadioGroup, n as _default$4, o as DropdownMenuContextValue, r as _default$3, s as DropdownMenuRadioGroupContext, t as _default$7 } from "../index-IvAfdGCC.js";
|
|
3
3
|
export { _default as DropdownMenu, type DropdownMenuButtonProps, type DropdownMenuCheckboxData, _default$1 as DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemEmits, type DropdownMenuCheckboxItemProps, type DropdownMenuCheckboxItemSlots, type DropdownMenuContextValue, _default$2 as DropdownMenuDivider, type DropdownMenuDividerData, type DropdownMenuEmits, type DropdownMenuEntry, _default$3 as DropdownMenuGroup, type DropdownMenuGroupProps, type DropdownMenuGroupSlots, _default$4 as DropdownMenuItem, type DropdownMenuItemData, type DropdownMenuItemEmits, type DropdownMenuItemProps, type DropdownMenuItemSlots, type DropdownMenuItemVariant, type DropdownMenuOption, type DropdownMenuPresentation, type DropdownMenuProps, type DropdownMenuRadioData, _default$5 as DropdownMenuRadioGroup, type DropdownMenuRadioGroupContext, type DropdownMenuRadioGroupEmits, type DropdownMenuRadioGroupProps, type DropdownMenuRadioGroupSlots, _default$6 as DropdownMenuRadioItem, type DropdownMenuRadioItemProps, type DropdownMenuRadioItemSlots, type DropdownMenuRadioOptionData, type DropdownMenuSection, type DropdownMenuSize, type DropdownMenuSlots, _default$7 as DropdownMenuSubMenu, type DropdownMenuSubMenuEmits, type DropdownMenuSubMenuPresentation, type DropdownMenuSubMenuProps, type DropdownMenuSubMenuSlots, type DropdownMenuTriggerProps, useDropdownMenuContext, useDropdownMenuRadioGroup };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { i as _sfc_main$1, n as _sfc_main$6, o as useDropdownMenuContext, r as _sfc_main$5, s as useDropdownMenuRadioGroup } from "../useMenuDrillIn-CjU_ZMhh.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as _sfc_main$7 } from "../DropdownMenu-
|
|
2
|
+
import { c as _sfc_main$2, i as _sfc_main$4, s as _sfc_main$3, t as _sfc_main } from "../DropdownMenu-CxbpuT2r.js";
|
|
3
|
+
import { t as _sfc_main$7 } from "../DropdownMenu-CtrztU4N.js";
|
|
4
4
|
export { _sfc_main as DropdownMenu, _sfc_main$1 as DropdownMenuCheckboxItem, _sfc_main$2 as DropdownMenuDivider, _sfc_main$3 as DropdownMenuGroup, _sfc_main$4 as DropdownMenuItem, _sfc_main$5 as DropdownMenuRadioGroup, _sfc_main$6 as DropdownMenuRadioItem, _sfc_main$7 as DropdownMenuSubMenu, useDropdownMenuContext, useDropdownMenuRadioGroup };
|
|
@@ -6,12 +6,12 @@ import { n as useOverflow } from "./useOverflow-VrwF5oek.js";
|
|
|
6
6
|
import { t as _sfc_main$2 } from "./LayerContentBoundary-CvsKxwwm.js";
|
|
7
7
|
import { t as _sfc_main$3 } from "./Item-DWMIjN8n.js";
|
|
8
8
|
import { o as useDropdownMenuContext } from "./useMenuDrillIn-CjU_ZMhh.js";
|
|
9
|
-
import { a as
|
|
9
|
+
import { a as MENU_ITEM_ROLES, i as _sfc_main$5, l as _sfc_main$4, n as useMenuRegions, o as activateMenuItem, r as useMenuFocus } from "./DropdownMenu-CxbpuT2r.js";
|
|
10
10
|
import { n as clampInlineSize, r as isIntrinsicInlineSize } from "./inlineSize-BNe8wggI.js";
|
|
11
11
|
import { t as _sfc_main$6 } from "./Spinner-B7xuy3ZA.js";
|
|
12
12
|
import { t as useSubmenuMode } from "./useSubmenuMode-CZN9qrUo.js";
|
|
13
|
-
import { t as useMenuHover } from "./useMenuHover-
|
|
14
|
-
import { Fragment, Teleport, computed, createBlock, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, mergeProps, nextTick, normalizeStyle, openBlock, ref, renderSlot, unref, useId, useSlots, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
13
|
+
import { t as useMenuHover } from "./useMenuHover-Ctmp4Xkh.js";
|
|
14
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, unref, useId, useSlots, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
15
15
|
import "../styles/dropdown-menu.css";
|
|
16
16
|
//#region src/DropdownMenu/DropdownMenuSubMenu.vue
|
|
17
17
|
const _hoisted_1 = {
|
|
@@ -19,8 +19,20 @@ const _hoisted_1 = {
|
|
|
19
19
|
class: "astryx-dropdown-menu-spinner",
|
|
20
20
|
"aria-hidden": "true"
|
|
21
21
|
};
|
|
22
|
-
const _hoisted_2 = [
|
|
23
|
-
|
|
22
|
+
const _hoisted_2 = [
|
|
23
|
+
"role",
|
|
24
|
+
"aria-label",
|
|
25
|
+
"aria-modal",
|
|
26
|
+
"hidden"
|
|
27
|
+
];
|
|
28
|
+
const _hoisted_3 = ["aria-label"];
|
|
29
|
+
const _hoisted_4 = [
|
|
30
|
+
"role",
|
|
31
|
+
"aria-label",
|
|
32
|
+
"aria-modal",
|
|
33
|
+
"data-overflow"
|
|
34
|
+
];
|
|
35
|
+
const _hoisted_5 = ["aria-label"];
|
|
24
36
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
25
37
|
name: "AstryxDropdownMenuSubMenu",
|
|
26
38
|
inheritAttrs: false,
|
|
@@ -56,10 +68,32 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
56
68
|
const menuSize = computed(() => menu?.menuSize.value ?? "md");
|
|
57
69
|
const density = computed(() => menuSize.value === "sm" ? "compact" : "balanced");
|
|
58
70
|
const hasStart = computed(() => slots.icon != null || props.icon != null);
|
|
71
|
+
const hasRegions = computed(() => slots.header != null || slots.footer != null);
|
|
72
|
+
const headerRef = ref(null);
|
|
73
|
+
const footerRef = ref(null);
|
|
74
|
+
const regionMenuRef = ref(null);
|
|
75
|
+
function setHeader(el) {
|
|
76
|
+
headerRef.value = el ?? null;
|
|
77
|
+
}
|
|
78
|
+
function setFooter(el) {
|
|
79
|
+
footerRef.value = el ?? null;
|
|
80
|
+
}
|
|
81
|
+
function setRegionMenu(el) {
|
|
82
|
+
regionMenuRef.value = el ?? null;
|
|
83
|
+
}
|
|
59
84
|
const stringLabel = computed(() => typeof props.label === "string" ? props.label : void 0);
|
|
60
85
|
const focus = useMenuFocus({ list: flyoutRef });
|
|
61
86
|
const drillFocus = useMenuFocus({ list: drillRef });
|
|
62
87
|
const hasOverflow = useOverflow(flyoutRef, flyoutOpen);
|
|
88
|
+
/** Tab 循环里的「菜单」那一站:有头尾时是里层的 `role="menu"`,否则就是整个飞出层。 */
|
|
89
|
+
const menuStop = computed(() => hasRegions.value ? regionMenuRef.value : flyoutRef.value);
|
|
90
|
+
const regions = useMenuRegions({
|
|
91
|
+
header: headerRef,
|
|
92
|
+
footer: footerRef,
|
|
93
|
+
menu: menuStop,
|
|
94
|
+
hasRegions,
|
|
95
|
+
closeMenu: () => closeFlyout(true)
|
|
96
|
+
});
|
|
63
97
|
const mode = useSubmenuMode({
|
|
64
98
|
drillIn: computed(() => menu?.drillIn.value),
|
|
65
99
|
presentation: computed(() => props.presentation),
|
|
@@ -99,7 +133,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
99
133
|
if (!drillFocus.focusFirst()) drillRef.value?.focus({ preventScroll: true });
|
|
100
134
|
}
|
|
101
135
|
async function openFlyout(options) {
|
|
102
|
-
if (props.isDisabled) return;
|
|
136
|
+
if (props.isDisabled || menu?.isOpen.value === false) return;
|
|
103
137
|
const skipAutoFocus = options?.skipAutoFocus === true;
|
|
104
138
|
if (isDrill.value) {
|
|
105
139
|
const wasOpen = drillOnStack.value;
|
|
@@ -114,19 +148,32 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
114
148
|
await nextTick();
|
|
115
149
|
focus.focusFirst();
|
|
116
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* 焦点回到触发行。行的 `focus()` 只会找里面的链接或按钮,子菜单这一行两者都没有,
|
|
153
|
+
* 所以直接聚焦行元素本身。
|
|
154
|
+
*/
|
|
155
|
+
function focusRowElement() {
|
|
156
|
+
rowRef.value?.focus();
|
|
157
|
+
nextTick(() => rowRef.value?.focus());
|
|
158
|
+
}
|
|
117
159
|
function closeFlyout(focusRow = true) {
|
|
118
160
|
if (isDrill.value) {
|
|
119
161
|
if (!mode.closeDrill()) return;
|
|
120
162
|
emit("openChange", false);
|
|
121
|
-
if (focusRow)
|
|
163
|
+
if (focusRow) focusRowElement();
|
|
122
164
|
return;
|
|
123
165
|
}
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
166
|
+
if (flyoutOpen.value) {
|
|
167
|
+
flyoutOpen.value = false;
|
|
168
|
+
emit("openChange", false);
|
|
169
|
+
}
|
|
170
|
+
if (focusRow) focusRowElement();
|
|
128
171
|
}
|
|
129
172
|
function onDrillKeydown(event) {
|
|
173
|
+
if (event.key === "Tab" && hasRegions.value) {
|
|
174
|
+
regions.moveDialogTab(event);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
130
177
|
if (event.key === "Tab" && menu?.hasRegions.value) {
|
|
131
178
|
event.preventDefault();
|
|
132
179
|
event.stopPropagation();
|
|
@@ -152,6 +199,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
152
199
|
drillFocus.handleKeyDown(event);
|
|
153
200
|
}
|
|
154
201
|
function onFlyoutKeydown(event) {
|
|
202
|
+
if (event.key === "Tab" && hasRegions.value) {
|
|
203
|
+
regions.moveDialogTab(event);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
155
206
|
if (event.key === "Tab" && menu?.hasRegions.value) {
|
|
156
207
|
event.preventDefault();
|
|
157
208
|
event.stopPropagation();
|
|
@@ -198,7 +249,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
198
249
|
};
|
|
199
250
|
const hover = useMenuHover({
|
|
200
251
|
show: (options) => void openFlyout(options),
|
|
201
|
-
hide: () =>
|
|
252
|
+
hide: () => {
|
|
253
|
+
if (hasRegions.value && flyoutRef.value?.contains(document.activeElement)) return;
|
|
254
|
+
closeFlyout(false);
|
|
255
|
+
},
|
|
202
256
|
isOpen: flyoutOpen,
|
|
203
257
|
isEnabled: () => !props.isDisabled && !isDrill.value,
|
|
204
258
|
flyoutRef,
|
|
@@ -214,11 +268,22 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
214
268
|
}
|
|
215
269
|
hover.triggerProps.onClick(event);
|
|
216
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* 关闭时焦点还留在面板里(Escape、外部关闭都会这样),就交还给触发行:
|
|
273
|
+
* 否则焦点会落进一个已经隐藏的容器。
|
|
274
|
+
*/
|
|
275
|
+
watch(flyoutOpen, (open, wasOpen) => {
|
|
276
|
+
if (open || !wasOpen) return;
|
|
277
|
+
if (isDrill.value) return;
|
|
278
|
+
const active = document.activeElement;
|
|
279
|
+
if (active instanceof Node && flyoutRef.value?.contains(active)) focusRowElement();
|
|
280
|
+
}, { flush: "pre" });
|
|
217
281
|
useDismiss({
|
|
218
282
|
container: flyoutRef,
|
|
219
283
|
trigger: rowRef,
|
|
220
284
|
isEnabled: computed(() => flyoutOpen.value && !isDrill.value),
|
|
221
|
-
onDismiss: () => closeFlyout(false)
|
|
285
|
+
onDismiss: () => closeFlyout(false),
|
|
286
|
+
onEscape: () => closeFlyout(true)
|
|
222
287
|
});
|
|
223
288
|
useDismiss({
|
|
224
289
|
container: drillRef,
|
|
@@ -228,10 +293,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
228
293
|
}
|
|
229
294
|
});
|
|
230
295
|
watch(() => menu?.isOpen.value, (open) => {
|
|
231
|
-
if (
|
|
296
|
+
if (open) return;
|
|
297
|
+
hover.cancelPending();
|
|
298
|
+
if (!isDrill.value) closeFlyout(false);
|
|
232
299
|
});
|
|
233
300
|
watch(drillOnStack, (onStack, wasOnStack) => {
|
|
234
|
-
if (wasOnStack === true && !onStack && menu?.isOpen.value)
|
|
301
|
+
if (wasOnStack === true && !onStack && menu?.isOpen.value) focusRowElement();
|
|
235
302
|
});
|
|
236
303
|
return (_ctx, _cache) => {
|
|
237
304
|
return openBlock(), createElementBlock(Fragment, null, [createVNode(_sfc_main$3, mergeProps(_ctx.$attrs, {
|
|
@@ -239,7 +306,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
239
306
|
ref: rowComponent,
|
|
240
307
|
class: "astryx-dropdown-menu-item",
|
|
241
308
|
role: "menuitem",
|
|
242
|
-
"aria-haspopup": "menu",
|
|
309
|
+
"aria-haspopup": hasRegions.value ? "dialog" : "menu",
|
|
243
310
|
"aria-expanded": isShown.value,
|
|
244
311
|
"data-menu-size": menuSize.value,
|
|
245
312
|
"data-variant": "default",
|
|
@@ -285,6 +352,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
285
352
|
key: "2"
|
|
286
353
|
} : void 0
|
|
287
354
|
]), 1040, [
|
|
355
|
+
"aria-haspopup",
|
|
288
356
|
"aria-expanded",
|
|
289
357
|
"data-menu-size",
|
|
290
358
|
"density",
|
|
@@ -297,21 +365,51 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
297
365
|
]), drillHost.value ? (openBlock(), createBlock(Teleport, {
|
|
298
366
|
key: 0,
|
|
299
367
|
to: drillHost.value
|
|
300
|
-
}, [withDirectives(createElementVNode("div", {
|
|
368
|
+
}, [createCommentVNode(" eslint-disable-next-line vue-a11y/no-static-element-interactions -- 键盘事件在面板根上接住再分发给头部、菜单和尾部,交互元素仍是里面的行和控件。 "), withDirectives(createElementVNode("div", {
|
|
301
369
|
ref_key: "drillRef",
|
|
302
370
|
ref: drillRef,
|
|
303
|
-
class: "astryx-dropdown-menu-drill",
|
|
304
|
-
role: "menu",
|
|
371
|
+
class: normalizeClass(["astryx-dropdown-menu-drill", { "is-frame": hasRegions.value }]),
|
|
372
|
+
role: hasRegions.value ? "dialog" : "menu",
|
|
305
373
|
"aria-label": stringLabel.value,
|
|
374
|
+
"aria-modal": hasRegions.value ? "true" : void 0,
|
|
306
375
|
hidden: unref(drillIsTop) ? void 0 : true,
|
|
307
376
|
tabindex: "-1",
|
|
308
377
|
onKeydown: onDrillKeydown
|
|
309
378
|
}, [createVNode(_sfc_main$2, null, {
|
|
310
379
|
default: withCtx(() => [createVNode(_sfc_main$4, { value: nestedContext }, {
|
|
311
|
-
default: withCtx(() => [
|
|
380
|
+
default: withCtx(() => [hasRegions.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
381
|
+
createElementVNode("div", {
|
|
382
|
+
ref: setHeader,
|
|
383
|
+
class: "astryx-dropdown-menu-region",
|
|
384
|
+
onKeydown: _cache[3] || (_cache[3] = (...args) => unref(regions).onRegionKeydown && unref(regions).onRegionKeydown(...args))
|
|
385
|
+
}, [renderSlot(_ctx.$slots, "header")], 544),
|
|
386
|
+
createElementVNode("div", {
|
|
387
|
+
ref: setRegionMenu,
|
|
388
|
+
class: "astryx-dropdown-menu-region-menu",
|
|
389
|
+
"aria-label": stringLabel.value,
|
|
390
|
+
role: "menu",
|
|
391
|
+
tabindex: "-1"
|
|
392
|
+
}, [createVNode(_sfc_main$5, {
|
|
393
|
+
"has-close-on-select": false,
|
|
394
|
+
label: backLabel.value,
|
|
395
|
+
onClick: _cache[4] || (_cache[4] = ($event) => closeFlyout(true))
|
|
396
|
+
}, {
|
|
397
|
+
icon: withCtx(() => [createVNode(_sfc_main$1, {
|
|
398
|
+
color: "secondary",
|
|
399
|
+
icon: "chevronLeft",
|
|
400
|
+
size: "sm"
|
|
401
|
+
})]),
|
|
402
|
+
_: 1
|
|
403
|
+
}, 8, ["label"]), renderSlot(_ctx.$slots, "default")], 8, _hoisted_3),
|
|
404
|
+
createElementVNode("div", {
|
|
405
|
+
ref: setFooter,
|
|
406
|
+
class: "astryx-dropdown-menu-region",
|
|
407
|
+
onKeydown: _cache[5] || (_cache[5] = (...args) => unref(regions).onRegionKeydown && unref(regions).onRegionKeydown(...args))
|
|
408
|
+
}, [renderSlot(_ctx.$slots, "footer")], 544)
|
|
409
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(_sfc_main$5, {
|
|
312
410
|
"has-close-on-select": false,
|
|
313
411
|
label: backLabel.value,
|
|
314
|
-
onClick: _cache[
|
|
412
|
+
onClick: _cache[6] || (_cache[6] = ($event) => closeFlyout(true))
|
|
315
413
|
}, {
|
|
316
414
|
icon: withCtx(() => [createVNode(_sfc_main$1, {
|
|
317
415
|
color: "secondary",
|
|
@@ -319,32 +417,51 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
319
417
|
size: "sm"
|
|
320
418
|
})]),
|
|
321
419
|
_: 1
|
|
322
|
-
}, 8, ["label"]), renderSlot(_ctx.$slots, "default")]),
|
|
420
|
+
}, 8, ["label"]), renderSlot(_ctx.$slots, "default")], 64))]),
|
|
323
421
|
_: 3
|
|
324
422
|
})]),
|
|
325
423
|
_: 3
|
|
326
|
-
})],
|
|
424
|
+
})], 42, _hoisted_2), [[vShow, unref(drillOnStack)]])], 8, ["to"])) : (openBlock(), createBlock(Teleport, {
|
|
327
425
|
key: 1,
|
|
328
426
|
to: unref(teleportTarget)
|
|
329
|
-
}, [withDirectives(createElementVNode("div", {
|
|
427
|
+
}, [createCommentVNode(" eslint-disable-next-line vue-a11y/no-static-element-interactions -- 键盘事件在面板根上接住再分发给头部、菜单和尾部,交互元素仍是里面的行和控件。 "), withDirectives(createElementVNode("div", {
|
|
330
428
|
ref_key: "flyoutRef",
|
|
331
429
|
ref: flyoutRef,
|
|
332
|
-
class: "astryx-dropdown-menu astryx-dropdown-submenu",
|
|
333
|
-
role: "menu",
|
|
430
|
+
class: normalizeClass(["astryx-dropdown-menu astryx-dropdown-submenu", { "is-frame": hasRegions.value }]),
|
|
431
|
+
role: hasRegions.value ? "dialog" : "menu",
|
|
334
432
|
"aria-label": stringLabel.value,
|
|
433
|
+
"aria-modal": hasRegions.value ? "true" : void 0,
|
|
335
434
|
"data-overflow": unref(hasOverflow) || void 0,
|
|
336
435
|
style: normalizeStyle(flyoutStyle.value),
|
|
337
436
|
tabindex: "-1",
|
|
338
437
|
onKeydown: onFlyoutKeydown,
|
|
339
|
-
onMouseenter: _cache[
|
|
340
|
-
onMouseleave: _cache[
|
|
438
|
+
onMouseenter: _cache[9] || (_cache[9] = (...args) => unref(hover).contentProps.onMouseenter && unref(hover).contentProps.onMouseenter(...args)),
|
|
439
|
+
onMouseleave: _cache[10] || (_cache[10] = (...args) => unref(hover).contentProps.onMouseleave && unref(hover).contentProps.onMouseleave(...args))
|
|
341
440
|
}, [createVNode(_sfc_main$2, null, {
|
|
342
441
|
default: withCtx(() => [createVNode(_sfc_main$4, { value: nestedContext }, {
|
|
343
|
-
default: withCtx(() => [
|
|
442
|
+
default: withCtx(() => [hasRegions.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
443
|
+
createElementVNode("div", {
|
|
444
|
+
ref: setHeader,
|
|
445
|
+
class: "astryx-dropdown-menu-region",
|
|
446
|
+
onKeydown: _cache[7] || (_cache[7] = (...args) => unref(regions).onRegionKeydown && unref(regions).onRegionKeydown(...args))
|
|
447
|
+
}, [renderSlot(_ctx.$slots, "header")], 544),
|
|
448
|
+
createElementVNode("div", {
|
|
449
|
+
ref: setRegionMenu,
|
|
450
|
+
class: "astryx-dropdown-menu-region-menu",
|
|
451
|
+
"aria-label": stringLabel.value,
|
|
452
|
+
role: "menu",
|
|
453
|
+
tabindex: "-1"
|
|
454
|
+
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_5),
|
|
455
|
+
createElementVNode("div", {
|
|
456
|
+
ref: setFooter,
|
|
457
|
+
class: "astryx-dropdown-menu-region",
|
|
458
|
+
onKeydown: _cache[8] || (_cache[8] = (...args) => unref(regions).onRegionKeydown && unref(regions).onRegionKeydown(...args))
|
|
459
|
+
}, [renderSlot(_ctx.$slots, "footer")], 544)
|
|
460
|
+
], 64)) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)]),
|
|
344
461
|
_: 3
|
|
345
462
|
})]),
|
|
346
463
|
_: 3
|
|
347
|
-
})],
|
|
464
|
+
})], 46, _hoisted_4), [[vShow, flyoutOpen.value]])], 8, ["to"]))], 64);
|
|
348
465
|
};
|
|
349
466
|
}
|
|
350
467
|
});
|
|
@@ -11,7 +11,7 @@ import { n as useOverflow } from "./useOverflow-VrwF5oek.js";
|
|
|
11
11
|
import { t as useTypeahead } from "./useTypeahead-BvtflkRk.js";
|
|
12
12
|
import { t as _sfc_main$9 } from "./LayerContentBoundary-CvsKxwwm.js";
|
|
13
13
|
import { t as useScrollbars } from "./useScrollbars-C2NJ6Qwq.js";
|
|
14
|
-
import { t as _sfc_main$10 } from "./BottomSheet-
|
|
14
|
+
import { t as _sfc_main$10 } from "./BottomSheet-itRm1Yh5.js";
|
|
15
15
|
import { t as _sfc_main$11 } from "./Item-DWMIjN8n.js";
|
|
16
16
|
import { a as dropdownMenuContextKey, i as _sfc_main$13, n as _sfc_main$12, o as useDropdownMenuContext, r as _sfc_main$14, t as useMenuDrillIn } from "./useMenuDrillIn-CjU_ZMhh.js";
|
|
17
17
|
import { n as clampInlineSize, r as isIntrinsicInlineSize, t as LAYER_MAX_INLINE_SIZE } from "./inlineSize-BNe8wggI.js";
|
|
@@ -1267,4 +1267,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1267
1267
|
}
|
|
1268
1268
|
});
|
|
1269
1269
|
//#endregion
|
|
1270
|
-
export {
|
|
1270
|
+
export { MENU_ITEM_ROLES as a, _sfc_main$5 as c, _sfc_main$2 as i, _sfc_main$6 as l, useMenuRegions as n, activateMenuItem as o, useMenuFocus as r, _sfc_main$3 as s, _sfc_main as t };
|
package/dist/{DropdownMenuRadioItem.vue-D-VSfulY.d.ts → DropdownMenuRadioItem.vue-z0XU7pZS.d.ts}
RENAMED
|
@@ -133,6 +133,15 @@ interface DropdownMenuSubMenuEmits {
|
|
|
133
133
|
interface DropdownMenuSubMenuSlots {
|
|
134
134
|
/** The rows of the nested menu. */
|
|
135
135
|
default?: () => VNodeChild;
|
|
136
|
+
/**
|
|
137
|
+
* 行内容上方、菜单之外的内容,例如筛选这些行的输入框。
|
|
138
|
+
* 有 header 或 footer 时,子菜单的面板变成以行为名的模态对话框:
|
|
139
|
+
* 行带 `aria-haspopup="dialog"`,Tab 在头部、行、尾部之间循环,
|
|
140
|
+
* Escape 回到行,指针离开时只要焦点还在里面就不关闭。
|
|
141
|
+
*/
|
|
142
|
+
header?: () => VNodeChild;
|
|
143
|
+
/** 行内容下方、菜单之外的内容。规则和 header 相同。 */
|
|
144
|
+
footer?: () => VNodeChild;
|
|
136
145
|
icon?: () => VNodeChild;
|
|
137
146
|
label?: () => VNodeChild;
|
|
138
147
|
description?: () => VNodeChild;
|
package/dist/EmptyState/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _sfc_main } from "../EmptyState-
|
|
1
|
+
import { t as _sfc_main } from "../EmptyState-CM7cJ9fJ.js";
|
|
2
2
|
export { _sfc_main as EmptyState };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as _sfc_main$1 } from "./Heading-
|
|
2
|
-
import { t as _sfc_main$2 } from "./Text-
|
|
1
|
+
import { t as _sfc_main$1 } from "./Heading-Cdveyoqy.js";
|
|
2
|
+
import { t as _sfc_main$2 } from "./Text-ukuKa6kX.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, useTemplateRef, withCtx } from "vue";
|
|
4
4
|
import "../styles/empty-state.css";
|
|
5
5
|
//#region src/EmptyState/EmptyState.vue
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _i as FileInputValue, di as _default, fi as FileInputEmits, gi as FileInputStatus, hi as FileInputSize, mi as FileInputProps, pi as FileInputMode } from "../index-
|
|
1
|
+
import { _i as FileInputValue, di as _default, fi as FileInputEmits, gi as FileInputStatus, hi as FileInputSize, mi as FileInputProps, pi as FileInputMode } from "../index-CXdImpTj.js";
|
|
2
2
|
export { _default as FileInput, type FileInputEmits, type FileInputMode, type FileInputProps, type FileInputSize, type FileInputStatus, type FileInputValue };
|
package/dist/Heading/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _sfc_main } from "../Heading-
|
|
1
|
+
import { t as _sfc_main } from "../Heading-Cdveyoqy.js";
|
|
2
2
|
export { _sfc_main as Heading };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as useTruncation, t as truncatePlacement } from "./useTruncation-B5qXQzAP.js";
|
|
2
|
-
import { t as _sfc_main$1 } from "./Tooltip-
|
|
2
|
+
import { t as _sfc_main$1 } from "./Tooltip-B0aQ9CKg.js";
|
|
3
3
|
import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, unref, useAttrs, withCtx } from "vue";
|
|
4
4
|
import "../styles/heading.css";
|
|
5
5
|
//#region src/Heading/Heading.vue
|
package/dist/HoverCard/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useHoverCard, t as _sfc_main } from "../HoverCard-
|
|
1
|
+
import { n as useHoverCard, t as _sfc_main } from "../HoverCard-C3zQizyS.js";
|
|
2
2
|
export { _sfc_main as HoverCard, useHoverCard };
|