@astryx-vue/core 0.19.1 → 0.20.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/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-CNb0dkY9.js → AlertDialog-Dbg8L2oy.js} +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-NvIT99xw.js → AppShell-zEXmJb1h.js} +116 -9
- 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/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-CCW58Kl3.js → BottomSheet-DNuzJPfQ.js} +2 -2
- package/dist/{BottomSheet-HQpcSkPH.js → BottomSheet-DV7bboru.js} +1 -1
- package/dist/Breadcrumbs/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/{Breadcrumbs-DXzBkpkd.js → Breadcrumbs-yB6yZCuZ.js} +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-ExzU7vC0.js → Collapsible-BG-u5nEt.js} +2 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-CECjNvGB.js → CommandPalette-CV7t0ouM.js} +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-Dmaag1wm.js → ComplexSelector-BOACo2vq.js} +1 -1
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-CujLDt4e.js → ContextMenu-_cj8wRB6.js} +1 -1
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-CiIWOWXM.js → DateInput-DrMqXWSj.js} +2 -2
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-CLVQ8E0Y.js → DateRangeInput-BZuyhf-w.js} +1 -1
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-jHSN-Dzu.js → DateTimeInput-DhB2gzx5.js} +3 -3
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-BQ5OBB1d.js → Dialog-B2pOTrnQ.js} +1 -1
- package/dist/{Dialog-DgdbRn2l.js → Dialog-CztWmbf8.js} +1 -1
- package/dist/{DialogHeader-D8234o9F.js → DialogHeader-5A5BUTTB.js} +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-Dqus7kUc.js → Drawer-Dt6paoDZ.js} +2 -2
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-LQsXd-_V.js → DropdownMenu-CFX1k1Ib.js} +1 -1
- package/dist/{DropdownMenu-BC_zB9le.js → DropdownMenu-D8s058G5.js} +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-RN_f7zRw.js → Lightbox-D8kFIbPj.js} +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/List/index.d.ts +1 -1
- package/dist/MobileNav/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-DlQmYaBx.js → MobileNavToggle-CKEOroi0.js} +75 -32
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-BK6nZweN.js → MultiSelector-CkAhUYdn.js} +1 -1
- package/dist/{NavHeadingSurface-C17cbKn9.js → NavHeadingSurface-DZPa2px5.js} +19 -5
- package/dist/NavItem/index.d.ts +2 -2
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-BAe-tUG9.js → NavItem-CcbOJNnY.js} +18 -5
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-DFQNX_Mb.js → Pagination-C0oI5FRP.js} +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CmAEizH-.js → Popover-Cl4gQQZq.js} +2 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-C2x4uuAM.js → PowerSearch-CPgbhvEL.js} +6 -6
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/ScrollableArea/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-Bo7qkt1P.js → Selector-CUTnAjq-.js} +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-CcZLUd7G.js → SideNav-5yLlEOdD.js} +511 -57
- 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/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-o3aGMDT1.js → Table-Eok91IcO.js} +8 -6
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/{TimeField-BM-rVFhC.js → TimeField-jfhGVEyI.js} +1 -1
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-CkZfhhAr.js → TimeInput-CvFcN4nl.js} +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CFkThrKq.js → TopNav-CSFUTuyI.js} +3 -3
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-ugSF9DWj.js → TreeList-B33huihx.js} +2 -1
- package/dist/{landing-Bs0aMIsR.js → batch-BJD6Bt-O.js} +42 -740
- package/dist/composables/index.js +2 -2
- package/dist/{composables-BgfubKnk.js → composables-CDrwFX0l.js} +2 -19
- package/dist/context-Cj_zItu2.js +729 -0
- package/dist/edge-DIlkB7vS.js +164 -0
- package/dist/edgeRide-D0oC2JEB.js +499 -0
- package/dist/focusRegion-CmDg7_4b.js +81 -0
- package/dist/{handle-BPXdHbkr.js → handle-ChN2TMKH.js} +1 -1
- package/dist/{index-X4S7_dmq.d.ts → index-BA8exXNP.d.ts} +1 -1
- package/dist/{index-CryFtTT6.d.ts → index-BIQZa2BD.d.ts} +1 -1
- package/dist/{index-CEjvYAUZ.d.ts → index-BvWBeoa8.d.ts} +1 -1
- package/dist/{index-BeR-1LgF.d.ts → index-C5fbwY7Y.d.ts} +4 -3
- package/dist/{index-CbA8rR_b.d.ts → index-CBOv5j3c.d.ts} +1 -1
- package/dist/{index-D-giO0SA.d.ts → index-CHLLk77c.d.ts} +1 -1
- package/dist/{index-C4S65SAW.d.ts → index-CKnr0JlT.d.ts} +1 -1
- package/dist/{index-B-3EGjfQ.d.ts → index-CO9GW-ik.d.ts} +1 -1
- package/dist/{index-CdvmnNMH.d.ts → index-COgrQZIL.d.ts} +1 -1
- package/dist/{index-B449gOMC.d.ts → index-Cy1rEWC-.d.ts} +2 -2
- package/dist/{index-BO9TY87G.d.ts → index-DFLPv9io.d.ts} +1 -1
- package/dist/{index-ohw86wfM.d.ts → index-DbfcTFO6.d.ts} +37 -33
- package/dist/{index-Dg0JsBpI.d.ts → index-DoSTYXsP.d.ts} +2 -2
- package/dist/{index-CfXW4km8.d.ts → index-GgHVkJtB.d.ts} +1 -1
- package/dist/{index-aE810PYg.d.ts → index-Xhq1E7WZ.d.ts} +2 -2
- package/dist/{index-B3yTdknp.d.ts → index-ZKBj_1nu.d.ts} +3 -2
- package/dist/{index-CUCgbqBB.d.ts → index-gxuXI7KD.d.ts} +4 -4
- package/dist/{index-dWlCpnua.d.ts → index-mK1ICsVg.d.ts} +1 -1
- package/dist/{index-DdT2wE_N.d.ts → index-mPBIdznc.d.ts} +5 -5
- package/dist/index.d.ts +21 -21
- package/dist/index.js +34 -34
- package/dist/landing-C7nc9JHm.js +104 -0
- package/dist/quietFinished-CKZXgsPM.js +19 -0
- package/dist/{types-BG23kC3S.d.ts → types-C2ZuV4jf.d.ts} +7 -1
- package/dist/{useFocusTrap-BUd-fvUH.js → useFocusTrap-DsYtRdmV.js} +2 -81
- package/package.json +1 -1
- package/styles/mobile-nav.css +4 -2
- package/styles/nav-item.css +3 -3
- package/styles/side-nav.css +36 -8
- package/dist/context-ZsDEkhSF.js +0 -24
- package/dist/{index-BqhgeAT4.d.ts → index-CHx33xGa.d.ts} +2 -2
|
@@ -1,22 +1,287 @@
|
|
|
1
|
+
import { t as hasSlotContent } from "./slotContent-CNWOrGOr.js";
|
|
1
2
|
import { t as _sfc_main$5 } from "./Icon-BCHo7W0x.js";
|
|
2
3
|
import { n as useLinkComponent } from "./context-C_peZbXf.js";
|
|
3
4
|
import { n as SizeProvider } from "./SizeContext-BbaF-SEx.js";
|
|
4
5
|
import { t as _sfc_main$6 } from "./Button-BZtim0B-.js";
|
|
6
|
+
import { n as createAnimatedLayout, t as areaOf } from "./handle-ChN2TMKH.js";
|
|
7
|
+
import { d as layoutMotion, g as layoutStartFor, h as beginChange, k as shownBoxAt, r as changeStartIn } from "./batch-BJD6Bt-O.js";
|
|
8
|
+
import { a as isRtl, s as pxClip } from "./edge-DIlkB7vS.js";
|
|
9
|
+
import { a as useSideNavCollapse, c as holdLayoutSwap, i as sideNavShellKey, l as playLayoutFrames, n as sideNavDepthKey, o as useSideNavDepth, s as useSideNavRenderMode, t as sideNavCollapseKey, u as playLayoutSwap } from "./context-Cj_zItu2.js";
|
|
10
|
+
import { r as focusablesIn } from "./focusRegion-CmDg7_4b.js";
|
|
11
|
+
import { n as isFocusDetached, t as focusForLastInput } from "./focusReturn-D7Y7Pwwb.js";
|
|
5
12
|
import { t as useHandleRef } from "./useHandleRef-6cdKugm8.js";
|
|
6
13
|
import { n as useResizable, r as useHotkeys } from "./useResizable-BMlG1oxA.js";
|
|
7
14
|
import { o as useComponentMessages } from "./context-B8IEFCDR.js";
|
|
8
15
|
import { t as _sfc_main$7 } from "./Tooltip-DQipgW1R.js";
|
|
9
16
|
import { t as useScrollbars } from "./useScrollbars-Ch0xqJWO.js";
|
|
10
17
|
import { t as navMessages } from "./nav-DpKQUHqR.js";
|
|
11
|
-
import { a as useSideNavDepth, i as useSideNavCollapse, n as sideNavDepthKey, o as useSideNavRenderMode, t as sideNavCollapseKey } from "./context-ZsDEkhSF.js";
|
|
12
18
|
import { i as safeNavHref, r as resolveNavRoot } from "./link-DuuA2eCL.js";
|
|
13
|
-
import { t as _sfc_main$8 } from "./NavItem-
|
|
19
|
+
import { t as _sfc_main$8 } from "./NavItem-CcbOJNnY.js";
|
|
14
20
|
import { t as _sfc_main$9 } from "./NavDisclosure-Dg6U7pc7.js";
|
|
15
21
|
import { t as _sfc_main$10 } from "./ResizeHandle-4-krI-cQ.js";
|
|
16
|
-
import { t as _sfc_main$11 } from "./NavHeadingSurface-
|
|
17
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, inject, mergeProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, provide, reactive, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, watch, watchEffect, withCtx, withModifiers } from "vue";
|
|
22
|
+
import { t as _sfc_main$11 } from "./NavHeadingSurface-DZPa2px5.js";
|
|
23
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, inject, mergeProps, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, watch, watchEffect, withCtx, withModifiers } from "vue";
|
|
18
24
|
import "../styles/visually-hidden.css";
|
|
19
25
|
import "../styles/side-nav.css";
|
|
26
|
+
//#region src/motion/layout/edgeHold.ts
|
|
27
|
+
const SETTLED = {
|
|
28
|
+
end: () => {},
|
|
29
|
+
shown: () => null
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Before a change commits: hold `element`'s old state for FR9's two-state edge
|
|
33
|
+
* reveal, its box and the extent it shows along `edge`'s axis (`shown`, from a
|
|
34
|
+
* running reveal, or its box), and its old state as one transient copy (null
|
|
35
|
+
* when it cannot be copied, or under an immediate change). Returns null
|
|
36
|
+
* without the element or without Web Animations.
|
|
37
|
+
*/
|
|
38
|
+
function holdLayoutEdge(handle, element, { edge = "block-end", shown = null } = {}) {
|
|
39
|
+
if (element == null || typeof element.animate !== "function") return null;
|
|
40
|
+
beginChange(element.ownerDocument);
|
|
41
|
+
const rect = element.getBoundingClientRect();
|
|
42
|
+
return {
|
|
43
|
+
element,
|
|
44
|
+
rect,
|
|
45
|
+
extent: shown ?? (edge.startsWith("inline") ? rect.width : rect.height),
|
|
46
|
+
swap: holdLayoutSwap(handle, element)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* After the change commits, before paint: FR9's two-state edge reveal, on
|
|
51
|
+
* FR4's one motion. The state that is larger along `edge`'s axis is clipped
|
|
52
|
+
* on that edge, from the extent the element showed to the new one: a conceal
|
|
53
|
+
* covers the old state, held as the swap's copy, with the element raised
|
|
54
|
+
* above it; a reveal opens the element, under the old state. With
|
|
55
|
+
* `rideWith`, an element the glide moves after that edge (a rail's content
|
|
56
|
+
* column), the edge rides its glide, frame by frame, so the two never part,
|
|
57
|
+
* also when this reverses a running reveal; without it the edge follows the
|
|
58
|
+
* motion's curve. `parts` gives the caller's own fades, told whether the edge
|
|
59
|
+
* conceals and the element as it is now. Under Reduce Motion it follows
|
|
60
|
+
* `design:reduced-motion`: opacity only under a coarse primary pointer (DR2),
|
|
61
|
+
* an immediate change otherwise (DR3). `current` is the element after the
|
|
62
|
+
* commit, when it remounted.
|
|
63
|
+
*/
|
|
64
|
+
function playLayoutEdge(hold, current, handle, { edge = "block-end", rideWith = null, parts } = {}) {
|
|
65
|
+
const { rect: before, swap, extent: from } = hold;
|
|
66
|
+
const element = current?.isConnected === true ? current : hold.element;
|
|
67
|
+
if (!element.isConnected) return SETTLED;
|
|
68
|
+
const motion = layoutMotion(element);
|
|
69
|
+
const next = element.getBoundingClientRect();
|
|
70
|
+
const isInline = edge.startsWith("inline");
|
|
71
|
+
const extentOfBox = (box) => isInline ? box.width : box.height;
|
|
72
|
+
const to = extentOfBox(next);
|
|
73
|
+
if (motion.kind === "instant" || Math.abs(to - from) < .5) return SETTLED;
|
|
74
|
+
const isConceal = to < from;
|
|
75
|
+
const isEnd = edge.endsWith("end");
|
|
76
|
+
const rtl = isInline && isRtl(element);
|
|
77
|
+
const host = rideWith?.parentElement != null && rideWith.parentElement.contains(element) ? rideWith.parentElement : element.parentElement;
|
|
78
|
+
const rides = host != null && rideWith != null && rideWith.parentElement === host && swap != null;
|
|
79
|
+
const sign = isEnd ? 1 : -1;
|
|
80
|
+
const towards = (ride) => sign * (isInline ? rtl ? -ride.x : ride.x : ride.y);
|
|
81
|
+
const extentAt = (p, ride) => rides ? from + towards(ride) : from + (to - from) * p;
|
|
82
|
+
const clip = (hidden) => pxClip(edge, hidden, rtl);
|
|
83
|
+
const now = () => Number(element.ownerDocument.timeline?.currentTime ?? 0);
|
|
84
|
+
const startedAt = changeStartIn(areaOf(handle, element), element.ownerDocument)?.at ?? 0;
|
|
85
|
+
const durationMs = motion.kind === "glide" ? motion.progress.durationMs : motion.durationMs;
|
|
86
|
+
const progressAt = (ms) => motion.kind === "glide" ? 1 - motion.progress.remaining(Math.min(ms, durationMs)) : 0;
|
|
87
|
+
const shown = () => {
|
|
88
|
+
const elapsed = Math.max(0, now() - startedAt);
|
|
89
|
+
if (elapsed >= durationMs) return null;
|
|
90
|
+
const progress = progressAt(Math.max(elapsed, layoutStartFor(element.ownerDocument) - startedAt));
|
|
91
|
+
let extent = from + (to - from) * progressAt(elapsed);
|
|
92
|
+
if (rides && rideWith != null) {
|
|
93
|
+
const ridden = shownBoxAt(rideWith, now());
|
|
94
|
+
const own = element.getBoundingClientRect();
|
|
95
|
+
extent = !isInline ? isEnd ? ridden.top - own.top : own.bottom - ridden.bottom : isEnd !== rtl ? ridden.left - own.left : own.right - ridden.right;
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
extent,
|
|
99
|
+
progress
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
const travel = sign * (from - to);
|
|
103
|
+
const rideSpec = rides && rideWith != null ? {
|
|
104
|
+
element: rideWith,
|
|
105
|
+
travel: isInline ? {
|
|
106
|
+
x: rtl ? -travel : travel,
|
|
107
|
+
y: 0
|
|
108
|
+
} : {
|
|
109
|
+
x: 0,
|
|
110
|
+
y: travel
|
|
111
|
+
},
|
|
112
|
+
isCopyMoved: false
|
|
113
|
+
} : void 0;
|
|
114
|
+
const at = new DOMRect(isInline && !(isEnd !== (isInline && rtl)) ? next.right - before.width : next.left, !isInline && !isEnd ? next.bottom - before.height : next.top, before.width, before.height);
|
|
115
|
+
const own = parts?.(isConceal, element) ?? {};
|
|
116
|
+
const copyOpacity = own.copyOpacity ?? (() => 1);
|
|
117
|
+
if (isConceal) {
|
|
118
|
+
if (swap == null || host == null) return SETTLED;
|
|
119
|
+
let raised = element;
|
|
120
|
+
while (raised != null && raised.parentElement !== host) raised = raised.parentElement;
|
|
121
|
+
const restore = raised == null ? null : { position: raised.style.position };
|
|
122
|
+
if (raised != null && getComputedStyle(raised).position === "static") raised.style.position = "relative";
|
|
123
|
+
return {
|
|
124
|
+
end: playLayoutSwap({
|
|
125
|
+
...swap,
|
|
126
|
+
rect: at
|
|
127
|
+
}, {
|
|
128
|
+
host,
|
|
129
|
+
isOpaque: true,
|
|
130
|
+
copyBefore: raised ?? void 0,
|
|
131
|
+
copy: (p, ride) => ({
|
|
132
|
+
clipPath: clip(extentOfBox(before) - extentAt(p, ride)),
|
|
133
|
+
opacity: copyOpacity(p)
|
|
134
|
+
}),
|
|
135
|
+
copyText: own.copyText,
|
|
136
|
+
rideWith: rideSpec,
|
|
137
|
+
onEnd: () => {
|
|
138
|
+
if (raised != null && restore != null) raised.style.position = restore.position;
|
|
139
|
+
},
|
|
140
|
+
incoming: own.incoming ?? []
|
|
141
|
+
}),
|
|
142
|
+
shown
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const incoming = [{
|
|
146
|
+
element,
|
|
147
|
+
frames: (p, ride) => ({ clipPath: clip(to - extentAt(p, ride)) })
|
|
148
|
+
}, ...own.incoming ?? []];
|
|
149
|
+
return {
|
|
150
|
+
end: swap != null && host != null ? playLayoutSwap({
|
|
151
|
+
...swap,
|
|
152
|
+
rect: at
|
|
153
|
+
}, {
|
|
154
|
+
host,
|
|
155
|
+
isOpaque: true,
|
|
156
|
+
copy: (p) => ({ opacity: copyOpacity(p) }),
|
|
157
|
+
copyText: own.copyText,
|
|
158
|
+
rideWith: rideSpec,
|
|
159
|
+
incoming
|
|
160
|
+
}) : playLayoutFrames(handle, incoming),
|
|
161
|
+
shown
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/composables/internal/focusLeaving.ts
|
|
166
|
+
/**
|
|
167
|
+
* @file focusLeaving.ts
|
|
168
|
+
* @position 组件内部:一次状态变化会拿走或藏起带焦点的内容时,先记下焦点、变化提交后再挪走
|
|
169
|
+
*
|
|
170
|
+
* 配合 `focusReturn.ts` 的 `focusForLastInput`:挪动后的焦点环跟着上一次输入走。
|
|
171
|
+
* 侧边导航收起轨道时,焦点所在的行会消失,用它把焦点交给收起按钮或最近的保留行。
|
|
172
|
+
*/
|
|
173
|
+
/**
|
|
174
|
+
* 如果变化会让焦点丢掉就返回 true:现在哪儿都没有焦点,或者焦点还在即将被藏起的 `surface` 里。
|
|
175
|
+
* 读 `surface` 自己所在的文档,所以 iframe 或画中画窗口里的元素也能判断。
|
|
176
|
+
*/
|
|
177
|
+
function isFocusLost(surface, doc) {
|
|
178
|
+
const ownerDocument = doc ?? surface?.ownerDocument ?? document;
|
|
179
|
+
return isFocusDetached(ownerDocument) || surface != null && surface.contains(ownerDocument.activeElement);
|
|
180
|
+
}
|
|
181
|
+
/** 焦点元素在 `container` 里就返回它,否则返回 null。要在 DOM 变化之前调用。 */
|
|
182
|
+
function noteFocusWithin(container) {
|
|
183
|
+
const active = container?.ownerDocument.activeElement;
|
|
184
|
+
if (container == null || active == null || !container.contains(active)) return null;
|
|
185
|
+
return {
|
|
186
|
+
element: active,
|
|
187
|
+
container
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* 变化把焦点弄丢了(掉到页面上,或还留在被藏起的 `hidden` 里)才把焦点挪到 `target`;
|
|
192
|
+
* 焦点没丢,或本来就不在里面,就不动。返回焦点有没有挪。
|
|
193
|
+
*/
|
|
194
|
+
function moveFocusLeftBehind(note, target, hidden = null) {
|
|
195
|
+
if (note == null || target == null || !isFocusLost(hidden, note.container.ownerDocument)) return false;
|
|
196
|
+
focusForLastInput(target);
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* `source` 变化时:DOM 更新之前调用 `note`(参数是离开的值),DOM 更新之后用它的结果调用 `move`。
|
|
201
|
+
* `note` 返回 null 表示没有要挪的焦点。服务端渲染时侦听器不运行。
|
|
202
|
+
*/
|
|
203
|
+
function useFocusLeavingChange(source, note, move) {
|
|
204
|
+
let pending = null;
|
|
205
|
+
watch(source, (_value, previous) => {
|
|
206
|
+
pending = note(previous);
|
|
207
|
+
}, { flush: "pre" });
|
|
208
|
+
watch(source, (value) => {
|
|
209
|
+
const noted = pending;
|
|
210
|
+
pending = null;
|
|
211
|
+
if (noted != null) move(noted, value);
|
|
212
|
+
}, { flush: "post" });
|
|
213
|
+
}
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/SideNav/railFocus.ts
|
|
216
|
+
const SIDE_NAV_ROW_ATTRIBUTE = "data-astryx-side-nav-row";
|
|
217
|
+
/** nav 里所有行,按文档顺序;展开的子菜单浮层是独立的一层,不算。 */
|
|
218
|
+
function railRows(nav) {
|
|
219
|
+
return Array.from(nav.querySelectorAll(`[${SIDE_NAV_ROW_ATTRIBUTE}]`)).filter((row) => row.closest(".astryx-side-nav-item__popover") == null);
|
|
220
|
+
}
|
|
221
|
+
function isKept(row) {
|
|
222
|
+
return row.getAttribute(SIDE_NAV_ROW_ATTRIBUTE) === "kept";
|
|
223
|
+
}
|
|
224
|
+
function toggleIn(nav) {
|
|
225
|
+
return nav.querySelector(".astryx-side-nav-collapse");
|
|
226
|
+
}
|
|
227
|
+
function controlOf(row) {
|
|
228
|
+
if (row == null) return void 0;
|
|
229
|
+
return row.matches("a[href], button, [tabindex]") ? row : focusablesIn(row)[0];
|
|
230
|
+
}
|
|
231
|
+
/** 行之外(页头、页脚)的可聚焦控件。 */
|
|
232
|
+
function controlsOutsideRows(nav, rows) {
|
|
233
|
+
return focusablesIn(nav).filter((control) => !rows.some((row) => row.contains(control)));
|
|
234
|
+
}
|
|
235
|
+
function visibleText(element) {
|
|
236
|
+
const copy = element.cloneNode(true);
|
|
237
|
+
for (const hidden of copy.querySelectorAll("[aria-hidden=\"true\"]")) hidden.remove();
|
|
238
|
+
return (copy.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
239
|
+
}
|
|
240
|
+
/** 控件的无障碍名称,用来在重新渲染之后认出同一个控件。 */
|
|
241
|
+
function controlName(control) {
|
|
242
|
+
const labelledBy = control.getAttribute("aria-labelledby")?.trim();
|
|
243
|
+
if (labelledBy) {
|
|
244
|
+
const text = labelledBy.split(/\s+/).map((id) => control.ownerDocument.getElementById(id)).filter((node) => node != null).map(visibleText).join(" ").trim();
|
|
245
|
+
if (text !== "") return text;
|
|
246
|
+
}
|
|
247
|
+
return control.getAttribute("aria-label")?.trim() || visibleText(control);
|
|
248
|
+
}
|
|
249
|
+
/** DOM 变化之前调用:记下焦点在 nav(或缩放手柄所在的外层框架)的哪里。 */
|
|
250
|
+
function noteRailFocus(nav, frame, wasCollapsed) {
|
|
251
|
+
const focus = wasCollapsed ? null : noteFocusWithin(nav) ?? noteFocusWithin(frame);
|
|
252
|
+
if (focus == null || nav == null) return null;
|
|
253
|
+
const rows = railRows(nav);
|
|
254
|
+
let index = -1;
|
|
255
|
+
rows.forEach((row, at) => {
|
|
256
|
+
if (row.contains(focus.element)) index = at;
|
|
257
|
+
});
|
|
258
|
+
let outside = null;
|
|
259
|
+
if (index < 0) {
|
|
260
|
+
const controls = controlsOutsideRows(nav, rows);
|
|
261
|
+
const at = controls.findIndex((control) => control.contains(focus.element));
|
|
262
|
+
outside = at < 0 ? null : { name: controlName(controls[at]) };
|
|
263
|
+
}
|
|
264
|
+
const toggle = toggleIn(nav);
|
|
265
|
+
return {
|
|
266
|
+
focus,
|
|
267
|
+
outside,
|
|
268
|
+
wasOnToggle: toggle?.contains(focus.element) ?? false,
|
|
269
|
+
isRowKept: index >= 0 && isKept(rows[index]),
|
|
270
|
+
keptBefore: rows.slice(0, Math.max(index, 0)).filter(isKept).length
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/** DOM 变化之后调用:轨道收起了才挪;焦点没丢就不动。 */
|
|
274
|
+
function moveRailFocus(pending, nav, isCollapsed) {
|
|
275
|
+
if (!isCollapsed || nav == null) return;
|
|
276
|
+
const kept = railRows(nav);
|
|
277
|
+
const toggle = toggleIn(nav) ?? void 0;
|
|
278
|
+
let sameOutside;
|
|
279
|
+
if (pending.wasOnToggle) sameOutside = toggle;
|
|
280
|
+
else if (pending.outside != null) sameOutside = controlsOutsideRows(nav, kept).find((control) => controlName(control) === pending.outside?.name);
|
|
281
|
+
const target = pending.isRowKept ? controlOf(kept[pending.keptBefore]) : sameOutside ?? toggle ?? controlOf(kept[pending.keptBefore - 1]) ?? controlOf(kept[pending.keptBefore]);
|
|
282
|
+
moveFocusLeftBehind(pending.focus, target);
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
20
285
|
//#region src/SideNav/SideNavCollapseButton.vue
|
|
21
286
|
const _hoisted_1$4 = {
|
|
22
287
|
class: "astryx-side-nav-collapse__mirror",
|
|
@@ -90,11 +355,154 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
|
90
355
|
}
|
|
91
356
|
});
|
|
92
357
|
//#endregion
|
|
358
|
+
//#region src/SideNav/railMotion.ts
|
|
359
|
+
/** 沿祖先往上找第一个真正有盒子的元素(跳过 `display: contents`)。 */
|
|
360
|
+
function boxedAncestor(element) {
|
|
361
|
+
let node = element?.parentElement ?? null;
|
|
362
|
+
while (node != null && getComputedStyle(node).display === "contents") node = node.parentElement;
|
|
363
|
+
return node;
|
|
364
|
+
}
|
|
365
|
+
/** AppShell 之外的 SideNav 自己持有一个句柄,区域是轨道所在的那一行。 */
|
|
366
|
+
function createRailLayout(rail) {
|
|
367
|
+
return createAnimatedLayout(() => boxedAncestor(rail()));
|
|
368
|
+
}
|
|
369
|
+
/** 变化提交之前:旧轨道在哪里、显示什么(来自进行中的动效或静止状态)。 */
|
|
370
|
+
function snapshotRail(rail, handle, running, isCollapsed) {
|
|
371
|
+
const hold = holdLayoutEdge(handle, rail, {
|
|
372
|
+
edge: "inline-end",
|
|
373
|
+
shown: running?.width ?? null
|
|
374
|
+
});
|
|
375
|
+
if (hold == null) return null;
|
|
376
|
+
return {
|
|
377
|
+
hold,
|
|
378
|
+
swap: hold.swap,
|
|
379
|
+
shown: running ?? {
|
|
380
|
+
width: hold.extent,
|
|
381
|
+
labels: isCollapsed ? 0 : 1,
|
|
382
|
+
collapsed: isCollapsed ? 1 : 0
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
const clamp = (value) => Math.min(1, Math.max(0, value));
|
|
387
|
+
/** 轨道自己的文字:直接装着一段文字的元素。 */
|
|
388
|
+
function textElements(rail) {
|
|
389
|
+
return Array.from(rail.querySelectorAll("*")).filter((element) => Array.from(element.childNodes).some((node) => node.nodeType === 3 && node.textContent?.trim()));
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* 变化提交之后、绘制之前:从快照开始播轨道动效。有 `column`(在 AppShell 里)时,
|
|
393
|
+
* 轨道的边骑在它的滑动上。
|
|
394
|
+
*/
|
|
395
|
+
function playRail(snapshot, current, handle, column = null) {
|
|
396
|
+
const { shown: from } = snapshot;
|
|
397
|
+
let isCollapse = false;
|
|
398
|
+
const labelsAt = (p) => isCollapse ? from.labels * (1 - clamp(p / .4)) : from.labels + (1 - from.labels) * clamp((p - .4) / .6);
|
|
399
|
+
const collapsedAt = (p) => isCollapse ? from.collapsed + (1 - from.collapsed) * clamp((p - .7) / .3) : from.collapsed * (1 - clamp(p / .6));
|
|
400
|
+
const motion = playLayoutEdge(snapshot.hold, current, handle, {
|
|
401
|
+
edge: "inline-end",
|
|
402
|
+
rideWith: column,
|
|
403
|
+
parts: (isConceal, rail) => {
|
|
404
|
+
isCollapse = isConceal;
|
|
405
|
+
return isConceal ? {
|
|
406
|
+
copyOpacity: (p) => 1 - clamp((p - .7) / .3),
|
|
407
|
+
copyText: labelsAt,
|
|
408
|
+
incoming: [{
|
|
409
|
+
element: rail,
|
|
410
|
+
frames: (p) => ({ opacity: collapsedAt(p) })
|
|
411
|
+
}]
|
|
412
|
+
} : {
|
|
413
|
+
copyOpacity: collapsedAt,
|
|
414
|
+
incoming: textElements(rail).map((element) => ({
|
|
415
|
+
element,
|
|
416
|
+
frames: (p) => ({ opacity: labelsAt(p) })
|
|
417
|
+
}))
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
return {
|
|
422
|
+
end: motion.end,
|
|
423
|
+
shown: () => {
|
|
424
|
+
const now = motion.shown();
|
|
425
|
+
return now == null ? null : {
|
|
426
|
+
width: now.extent,
|
|
427
|
+
labels: labelsAt(now.progress),
|
|
428
|
+
collapsed: collapsedAt(now.progress)
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/SideNav/useRailMotion.ts
|
|
435
|
+
/** 时间线每帧只有一个时间,同一帧里读两次相等。 */
|
|
436
|
+
function frameTimeOf(doc) {
|
|
437
|
+
const time = doc?.timeline?.currentTime;
|
|
438
|
+
return time == null ? null : Number(time);
|
|
439
|
+
}
|
|
440
|
+
function useRailMotion(options) {
|
|
441
|
+
const shell = inject(sideNavShellKey, null);
|
|
442
|
+
const ownRail = () => options.isResizable() ? options.frame() : options.nav();
|
|
443
|
+
const ownLayout = createRailLayout(ownRail);
|
|
444
|
+
const railOf = () => shell?.rail() ?? ownRail();
|
|
445
|
+
const handleOf = () => shell?.animatedLayout ?? ownLayout;
|
|
446
|
+
let snapshot = null;
|
|
447
|
+
let running = null;
|
|
448
|
+
let isOwnToggle = false;
|
|
449
|
+
let mountFrame = null;
|
|
450
|
+
function endRunning() {
|
|
451
|
+
running?.rail.end();
|
|
452
|
+
running?.endContent();
|
|
453
|
+
running = null;
|
|
454
|
+
}
|
|
455
|
+
function measure(wasCollapsed) {
|
|
456
|
+
const shown = running?.rail.shown() ?? null;
|
|
457
|
+
endRunning();
|
|
458
|
+
const own = isOwnToggle;
|
|
459
|
+
isOwnToggle = false;
|
|
460
|
+
const frame = frameTimeOf(options.nav()?.ownerDocument);
|
|
461
|
+
if (!own && (frame == null || frame === mountFrame)) {
|
|
462
|
+
snapshot = null;
|
|
463
|
+
shell?.landContent();
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
snapshot = snapshotRail(railOf(), handleOf(), shown, wasCollapsed);
|
|
467
|
+
if (snapshot != null && snapshot.swap == null && !wasCollapsed) {
|
|
468
|
+
shell?.landContent();
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
shell?.beforeRailChange();
|
|
472
|
+
}
|
|
473
|
+
function play() {
|
|
474
|
+
const noted = snapshot;
|
|
475
|
+
snapshot = null;
|
|
476
|
+
if (noted == null) return;
|
|
477
|
+
const endContent = shell?.afterRailChange() ?? (() => {});
|
|
478
|
+
running = {
|
|
479
|
+
rail: playRail(noted, railOf(), handleOf(), shell?.column() ?? null),
|
|
480
|
+
endContent
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
onMounted(() => {
|
|
484
|
+
mountFrame = frameTimeOf(options.nav()?.ownerDocument);
|
|
485
|
+
});
|
|
486
|
+
watch(options.isCollapsed, (_value, wasCollapsed) => measure(wasCollapsed), { flush: "pre" });
|
|
487
|
+
watch(options.isCollapsed, play, { flush: "post" });
|
|
488
|
+
onBeforeUnmount(endRunning);
|
|
489
|
+
function markOwnToggle() {
|
|
490
|
+
isOwnToggle = true;
|
|
491
|
+
}
|
|
492
|
+
return { markOwnToggle };
|
|
493
|
+
}
|
|
494
|
+
//#endregion
|
|
93
495
|
//#region src/SideNav/useSideNavResize.ts
|
|
94
496
|
/** 拖到这条宽度以下就收起。收起后的视觉宽度仍由图标栏样式决定。 */
|
|
95
497
|
const COLLAPSE_THRESHOLD = 160;
|
|
498
|
+
/** `resizable` 传的是不是 `useResizable()` 的返回值:它自己带着区域的宽度和收起状态。 */
|
|
499
|
+
function isResizableRegion(value) {
|
|
500
|
+
if (typeof value !== "object" || value == null) return false;
|
|
501
|
+
const region = value;
|
|
502
|
+
return typeof region.collapse === "function" && typeof region.expand === "function" && region.props?._isResizableProps === true;
|
|
503
|
+
}
|
|
96
504
|
function resizeConfig(value) {
|
|
97
|
-
return typeof value === "object" && value != null ? value : {};
|
|
505
|
+
return typeof value === "object" && value != null && !isResizableRegion(value) ? value : {};
|
|
98
506
|
}
|
|
99
507
|
function collapseConfig(value) {
|
|
100
508
|
return typeof value === "object" && value != null ? value : {};
|
|
@@ -112,6 +520,19 @@ function describeCollapseConflict(collapsible, resizable) {
|
|
|
112
520
|
if (fromCollapsible.length === 0 || fromResizable.length === 0) return null;
|
|
113
521
|
return `collapsible 和 resizable 都写了收起状态(${fromResizable.join("、")})。拖拽这边生效。`;
|
|
114
522
|
}
|
|
523
|
+
/**
|
|
524
|
+
* `resizable` 是区域返回值时,区域拥有宽度和收起状态,并由它自己的 `collapsible` 决定轨道能不能收起。
|
|
525
|
+
* `collapsible` 里写了收起状态、或者和区域不一致,都以区域为准,返回要在开发环境里警告的说明。
|
|
526
|
+
*/
|
|
527
|
+
function describeRegionConflict(collapsible, region) {
|
|
528
|
+
const given = collapseConfig(collapsible);
|
|
529
|
+
const ignored = [given.defaultIsCollapsed !== void 0 && "defaultIsCollapsed", given.isCollapsed !== void 0 && "isCollapsed"].filter((key) => key !== false);
|
|
530
|
+
const conflicts = [];
|
|
531
|
+
if (ignored.length > 0) conflicts.push(`collapsible 写了 ${ignored.join("、")},轨道不看它,跟着区域走。`);
|
|
532
|
+
const regionCollapsible = region.props._collapsible;
|
|
533
|
+
if (collapsible !== void 0 && Boolean(collapsible) !== regionCollapsible) conflicts.push(regionCollapsible ? "collapsible 是 false,但区域可收起,轨道仍会收起。" : "collapsible 打开了收起,但区域不可收起,轨道不会收起。");
|
|
534
|
+
return conflicts.length === 0 ? null : `resizable 是 useResizable() 的返回值,收起状态和能否收起都由它决定。${conflicts.join("")}`;
|
|
535
|
+
}
|
|
115
536
|
function useSideNavResize(source) {
|
|
116
537
|
const initialResize = resizeConfig(source.resizable());
|
|
117
538
|
const initialCollapse = collapseConfig(source.collapsible());
|
|
@@ -135,23 +556,31 @@ function useSideNavResize(source) {
|
|
|
135
556
|
source.onCollapseChange(next);
|
|
136
557
|
}
|
|
137
558
|
});
|
|
138
|
-
const
|
|
559
|
+
const ownRegion = useResizable(input);
|
|
139
560
|
const resizing = ref(false);
|
|
561
|
+
const owner = computed(() => {
|
|
562
|
+
const value = source.resizable();
|
|
563
|
+
return isResizableRegion(value) ? value : null;
|
|
564
|
+
});
|
|
565
|
+
/** 调用方给了区域就用区域;否则用组件自己按配置建的那个。 */
|
|
566
|
+
const active = () => owner.value ?? ownRegion;
|
|
140
567
|
const enabled = computed(() => Boolean(source.resizable()));
|
|
141
|
-
const ownsCollapse = computed(() => ownsCollapseState(resizeConfig(source.resizable())));
|
|
568
|
+
const ownsCollapse = computed(() => owner.value != null || ownsCollapseState(resizeConfig(source.resizable())));
|
|
569
|
+
const isCollapsibleOverride = computed(() => owner.value == null ? void 0 : owner.value.props._collapsible);
|
|
142
570
|
watch(() => source.isCollapsed(), (value) => {
|
|
143
571
|
input.isCollapsed = value;
|
|
144
572
|
});
|
|
145
573
|
let warnedConflict = false;
|
|
146
574
|
watchEffect(() => {
|
|
147
575
|
if (warnedConflict) return;
|
|
148
|
-
const
|
|
576
|
+
const value = source.resizable();
|
|
577
|
+
const message = isResizableRegion(value) ? describeRegionConflict(source.collapsible(), value) : describeCollapseConflict(collapseConfig(source.collapsible()), resizeConfig(value));
|
|
149
578
|
if (!message) return;
|
|
150
579
|
warnedConflict = true;
|
|
151
580
|
console.warn(`[SideNav] ${message}`);
|
|
152
581
|
});
|
|
153
582
|
const handleProps = computed(() => {
|
|
154
|
-
const current =
|
|
583
|
+
const current = active().props;
|
|
155
584
|
return {
|
|
156
585
|
...current,
|
|
157
586
|
_onResizeStart() {
|
|
@@ -169,19 +598,20 @@ function useSideNavResize(source) {
|
|
|
169
598
|
};
|
|
170
599
|
});
|
|
171
600
|
const widthStyle = computed(() => {
|
|
172
|
-
if (!enabled.value ||
|
|
173
|
-
return { width: `${
|
|
601
|
+
if (!enabled.value || active().isCollapsed) return void 0;
|
|
602
|
+
return { width: `${active().size}px` };
|
|
174
603
|
});
|
|
175
604
|
return {
|
|
176
605
|
enabled,
|
|
177
606
|
ownsCollapse,
|
|
178
|
-
|
|
607
|
+
isCollapsibleOverride,
|
|
608
|
+
isCollapsed: computed(() => active().isCollapsed),
|
|
179
609
|
widthStyle,
|
|
180
610
|
resizing,
|
|
181
611
|
handleProps,
|
|
182
612
|
setCollapsed(next) {
|
|
183
|
-
if (next)
|
|
184
|
-
else
|
|
613
|
+
if (next) active().collapse();
|
|
614
|
+
else active().expand();
|
|
185
615
|
}
|
|
186
616
|
};
|
|
187
617
|
}
|
|
@@ -222,7 +652,7 @@ const _hoisted_9$1 = {
|
|
|
222
652
|
key: 0,
|
|
223
653
|
class: "astryx-side-nav__top"
|
|
224
654
|
};
|
|
225
|
-
const _hoisted_10
|
|
655
|
+
const _hoisted_10 = {
|
|
226
656
|
key: 0,
|
|
227
657
|
class: "astryx-side-nav__heading-row"
|
|
228
658
|
};
|
|
@@ -272,11 +702,14 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
272
702
|
const navId = `astryx-side-nav-${useId()}`;
|
|
273
703
|
const localCollapsed = ref(false);
|
|
274
704
|
const bodyEl = useTemplateRef("body");
|
|
705
|
+
const navEl = useTemplateRef("nav");
|
|
706
|
+
const frameEl = useTemplateRef("frame");
|
|
275
707
|
useScrollbars(bodyEl);
|
|
276
708
|
const config = computed(() => typeof props.collapsible === "object" ? props.collapsible : {});
|
|
277
709
|
function controlledCollapsed() {
|
|
710
|
+
if (isResizableRegion(props.resizable)) return void 0;
|
|
278
711
|
if (props.isCollapsed !== void 0) return props.isCollapsed;
|
|
279
|
-
if (typeof props.resizable === "object") {
|
|
712
|
+
if (typeof props.resizable === "object" && !isResizableRegion(props.resizable)) {
|
|
280
713
|
const resizable = props.resizable;
|
|
281
714
|
if (resizable.defaultIsCollapsed !== void 0 || resizable.isCollapsed !== void 0 || resizable.onCollapseChange !== void 0) return resizable.isCollapsed;
|
|
282
715
|
}
|
|
@@ -294,7 +727,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
294
727
|
},
|
|
295
728
|
resizable: () => props.resizable
|
|
296
729
|
});
|
|
297
|
-
const isCollapsible = computed(() => Boolean(props.collapsible) || resize.ownsCollapse.value);
|
|
730
|
+
const isCollapsible = computed(() => resize.isCollapsibleOverride.value ?? (Boolean(props.collapsible) || resize.ownsCollapse.value));
|
|
298
731
|
const isCollapsed = computed(() => {
|
|
299
732
|
if (!isCollapsible.value) return false;
|
|
300
733
|
const controlled = controlledCollapsed();
|
|
@@ -304,14 +737,21 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
304
737
|
});
|
|
305
738
|
const showResizeHandle = computed(() => resize.enabled.value && !isCollapsed.value);
|
|
306
739
|
const showButton = computed(() => isCollapsible.value && (config.value.hasButton ?? true));
|
|
307
|
-
const hasTop = computed(() => slots.header
|
|
308
|
-
const
|
|
740
|
+
const hasTop = computed(() => hasSlotContent(slots.header) || hasSlotContent(slots.top));
|
|
741
|
+
const hasFooterIcons = computed(() => hasSlotContent(slots.footerIcons));
|
|
742
|
+
const hasBottom = computed(() => hasSlotContent(slots.footer) || hasFooterIcons.value || showButton.value);
|
|
309
743
|
const bodyEdgeClass = computed(() => ({
|
|
310
744
|
"astryx-side-nav__body--no-top": !hasTop.value,
|
|
311
745
|
"astryx-side-nav__body--no-bottom": !hasBottom.value
|
|
312
746
|
}));
|
|
313
747
|
const label = computed(() => props.label || messages.value.nav.sideNav);
|
|
314
748
|
const renderMode = useSideNavRenderMode();
|
|
749
|
+
const rail = useRailMotion({
|
|
750
|
+
isCollapsed: () => isCollapsed.value,
|
|
751
|
+
isResizable: () => resize.enabled.value,
|
|
752
|
+
nav: () => navEl.value,
|
|
753
|
+
frame: () => frameEl.value
|
|
754
|
+
});
|
|
315
755
|
watch(() => config.value.defaultIsCollapsed, (value) => {
|
|
316
756
|
if (value != null && props.isCollapsed === void 0 && config.value.isCollapsed === void 0) localCollapsed.value = value;
|
|
317
757
|
}, { immediate: true });
|
|
@@ -326,6 +766,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
326
766
|
emit("collapsedChange", next);
|
|
327
767
|
}
|
|
328
768
|
function toggle() {
|
|
769
|
+
rail.markOwnToggle();
|
|
329
770
|
setCollapsed(!isCollapsed.value);
|
|
330
771
|
}
|
|
331
772
|
useHandleRef(() => props.handleRef, {
|
|
@@ -336,6 +777,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
336
777
|
},
|
|
337
778
|
toggle
|
|
338
779
|
});
|
|
780
|
+
useFocusLeavingChange(() => isCollapsed.value, (wasCollapsed) => noteRailFocus(navEl.value, frameEl.value, wasCollapsed), (pending, collapsed) => moveRailFocus(pending, navEl.value, collapsed));
|
|
339
781
|
useHotkeys(computed(() => {
|
|
340
782
|
const keys = config.value.hotkey;
|
|
341
783
|
if (!isCollapsible.value || keys == null || keys === "") return [];
|
|
@@ -351,21 +793,23 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
351
793
|
toggle
|
|
352
794
|
});
|
|
353
795
|
return (_ctx, _cache) => {
|
|
354
|
-
return unref(renderMode) === "topbar" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [renderSlot(_ctx.$slots, "header"),
|
|
796
|
+
return unref(renderMode) === "topbar" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [renderSlot(_ctx.$slots, "header"), hasFooterIcons.value ? (openBlock(), createElementBlock("div", _hoisted_2$3, [createVNode(unref(SizeProvider), { value: FOOTER_ICON_SIZE }, {
|
|
355
797
|
default: withCtx(() => [renderSlot(_ctx.$slots, "footerIcons")]),
|
|
356
798
|
_: 3
|
|
357
799
|
})])) : createCommentVNode("v-if", true)])) : unref(renderMode) === "drawer" || unref(renderMode) === "drawer-content" ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
358
|
-
slots.top ? (openBlock(), createElementBlock("div", _hoisted_4$3, [renderSlot(_ctx.$slots, "top")])) : createCommentVNode("v-if", true),
|
|
800
|
+
unref(hasSlotContent)(slots.top) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [renderSlot(_ctx.$slots, "top")])) : createCommentVNode("v-if", true),
|
|
359
801
|
createElementVNode("div", _hoisted_5$2, [renderSlot(_ctx.$slots, "default")], 512),
|
|
360
|
-
hasBottom.value ? (openBlock(), createElementBlock("div", _hoisted_6$2, [renderSlot(_ctx.$slots, "footer"),
|
|
802
|
+
hasBottom.value ? (openBlock(), createElementBlock("div", _hoisted_6$2, [renderSlot(_ctx.$slots, "footer"), hasFooterIcons.value ? (openBlock(), createElementBlock("div", _hoisted_7$1, [createVNode(unref(SizeProvider), { value: FOOTER_ICON_SIZE }, {
|
|
361
803
|
default: withCtx(() => [renderSlot(_ctx.$slots, "footerIcons")]),
|
|
362
804
|
_: 3
|
|
363
805
|
})])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true)
|
|
364
806
|
])) : (openBlock(), createElementBlock("div", {
|
|
365
807
|
key: 2,
|
|
366
|
-
|
|
808
|
+
ref: "frame",
|
|
809
|
+
class: normalizeClass(["astryx-side-nav-frame", { "astryx-side-nav-frame--resizable": unref(resize).enabled.value }])
|
|
367
810
|
}, [createElementVNode("nav", {
|
|
368
811
|
id: navId,
|
|
812
|
+
ref: "nav",
|
|
369
813
|
class: normalizeClass(["astryx-side-nav", {
|
|
370
814
|
"astryx-side-nav--collapsed": isCollapsed.value,
|
|
371
815
|
"astryx-side-nav--resizing": unref(resize).resizing.value
|
|
@@ -374,12 +818,12 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
374
818
|
"aria-label": label.value,
|
|
375
819
|
"data-collapsed": isCollapsed.value || void 0
|
|
376
820
|
}, [
|
|
377
|
-
hasTop.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, [slots.header ? (openBlock(), createElementBlock("div", _hoisted_10
|
|
821
|
+
hasTop.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, [unref(hasSlotContent)(slots.header) ? (openBlock(), createElementBlock("div", _hoisted_10, [renderSlot(_ctx.$slots, "header")])) : createCommentVNode("v-if", true), unref(hasSlotContent)(slots.top) ? (openBlock(), createElementBlock("div", _hoisted_11, [renderSlot(_ctx.$slots, "top")])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
|
|
378
822
|
createElementVNode("div", {
|
|
379
823
|
ref: "body",
|
|
380
824
|
class: normalizeClass(["astryx-side-nav__body", bodyEdgeClass.value])
|
|
381
825
|
}, [renderSlot(_ctx.$slots, "default")], 2),
|
|
382
|
-
hasBottom.value ? (openBlock(), createElementBlock("div", _hoisted_12, [renderSlot(_ctx.$slots, "footer"), showButton.value ||
|
|
826
|
+
hasBottom.value ? (openBlock(), createElementBlock("div", _hoisted_12, [renderSlot(_ctx.$slots, "footer"), showButton.value || hasFooterIcons.value ? (openBlock(), createElementBlock("div", _hoisted_13, [createVNode(unref(SizeProvider), { value: FOOTER_ICON_SIZE }, {
|
|
383
827
|
default: withCtx(() => [showButton.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
384
828
|
key: 0,
|
|
385
829
|
label: config.value.buttonLabel
|
|
@@ -434,7 +878,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
434
878
|
const collapse = useSideNavCollapse();
|
|
435
879
|
const linkComponent = useLinkComponent();
|
|
436
880
|
const collapsed = computed(() => collapse.isCollapsed.value);
|
|
437
|
-
const hasIcon = computed(() => slots.icon
|
|
881
|
+
const hasIcon = computed(() => hasSlotContent(slots.icon));
|
|
438
882
|
const hasMenu = computed(() => slots.menu != null);
|
|
439
883
|
/** 自己的 `as` 优先,其次是 LinkProvider 给的默认链接组件。 */
|
|
440
884
|
const customLink = computed(() => props.as ?? linkComponent.value);
|
|
@@ -497,7 +941,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
497
941
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
|
|
498
942
|
key: "0"
|
|
499
943
|
} : void 0,
|
|
500
|
-
unref(slots).end ? {
|
|
944
|
+
unref(hasSlotContent)(unref(slots).end) ? {
|
|
501
945
|
name: "end",
|
|
502
946
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "end")]),
|
|
503
947
|
key: "1"
|
|
@@ -533,18 +977,14 @@ const _hoisted_2$1 = {
|
|
|
533
977
|
};
|
|
534
978
|
const _hoisted_3$1 = ["aria-label"];
|
|
535
979
|
const _hoisted_4$1 = { class: "astryx-side-nav-item__popover-title" };
|
|
536
|
-
const _hoisted_5 = {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
};
|
|
540
|
-
const _hoisted_6 = { class: "astryx-side-nav-item__main" };
|
|
541
|
-
const _hoisted_7 = ["aria-expanded", "aria-label"];
|
|
542
|
-
const _hoisted_8 = {
|
|
980
|
+
const _hoisted_5 = { class: "astryx-side-nav-item__main" };
|
|
981
|
+
const _hoisted_6 = ["aria-expanded", "aria-label"];
|
|
982
|
+
const _hoisted_7 = {
|
|
543
983
|
key: 2,
|
|
544
984
|
class: "astryx-side-nav-item__actions"
|
|
545
985
|
};
|
|
546
|
-
const
|
|
547
|
-
const
|
|
986
|
+
const _hoisted_8 = ["aria-hidden", "inert"];
|
|
987
|
+
const _hoisted_9 = { class: "astryx-side-nav-item__children-inner" };
|
|
548
988
|
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
549
989
|
name: "AstryxSideNavItem",
|
|
550
990
|
inheritAttrs: false,
|
|
@@ -590,9 +1030,12 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
590
1030
|
const labelId = `${childrenId}-label`;
|
|
591
1031
|
const localNested = ref(false);
|
|
592
1032
|
const config = computed(() => typeof props.collapsible === "object" ? props.collapsible : {});
|
|
593
|
-
const hasChildren = computed(() => slots.default
|
|
1033
|
+
const hasChildren = computed(() => hasSlotContent(slots.default));
|
|
594
1034
|
const sidebarCollapsed = computed(() => collapse.isCollapsed.value);
|
|
595
|
-
const hasIcon = computed(() => Boolean(props.iconClass || props.selectedIconClass || slots.icon || slots.selectedIcon));
|
|
1035
|
+
const hasIcon = computed(() => Boolean(props.iconClass || props.selectedIconClass || hasSlotContent(slots.icon) || hasSlotContent(slots.selectedIcon)));
|
|
1036
|
+
/** 收起的轨道只画顶层、带图标的行(见 railFocus)。 */
|
|
1037
|
+
const rowKind = computed(() => hasIcon.value && parentDepth.value === 0 ? "kept" : "dropped");
|
|
1038
|
+
const rowMarker = computed(() => ({ [SIDE_NAV_ROW_ATTRIBUTE]: rowKind.value }));
|
|
596
1039
|
const canNest = computed(() => hasChildren.value && props.collapsible !== false);
|
|
597
1040
|
const hasClickListener = computed(() => {
|
|
598
1041
|
return (instance?.vnode.props)?.onClick != null;
|
|
@@ -636,7 +1079,10 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
636
1079
|
content: __props.label,
|
|
637
1080
|
placement: "end"
|
|
638
1081
|
}, {
|
|
639
|
-
default: withCtx(() => [createVNode(_sfc_main$8, mergeProps(
|
|
1082
|
+
default: withCtx(() => [createVNode(_sfc_main$8, mergeProps({
|
|
1083
|
+
...unref(attrs),
|
|
1084
|
+
[unref(SIDE_NAV_ROW_ATTRIBUTE)]: "kept"
|
|
1085
|
+
}, {
|
|
640
1086
|
block: "",
|
|
641
1087
|
"is-icon-only": "",
|
|
642
1088
|
style: rowStyle.value,
|
|
@@ -645,6 +1091,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
645
1091
|
href: __props.href,
|
|
646
1092
|
"icon-class": __props.iconClass,
|
|
647
1093
|
"is-disabled": __props.isDisabled,
|
|
1094
|
+
"is-focusable-when-disabled": "",
|
|
648
1095
|
"is-selected": __props.isSelected,
|
|
649
1096
|
label: __props.label,
|
|
650
1097
|
rel: __props.rel,
|
|
@@ -652,11 +1099,11 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
652
1099
|
size: __props.size,
|
|
653
1100
|
target: __props.target,
|
|
654
1101
|
onClick: onActivate
|
|
655
|
-
}), createSlots({ _: 2 }, [_ctx.$slots.icon ? {
|
|
1102
|
+
}), createSlots({ _: 2 }, [unref(hasSlotContent)(_ctx.$slots.icon) ? {
|
|
656
1103
|
name: "icon",
|
|
657
1104
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
|
|
658
1105
|
key: "0"
|
|
659
|
-
} : void 0, _ctx.$slots.selectedIcon ? {
|
|
1106
|
+
} : void 0, unref(hasSlotContent)(_ctx.$slots.selectedIcon) ? {
|
|
660
1107
|
name: "selectedIcon",
|
|
661
1108
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "selectedIcon")]),
|
|
662
1109
|
key: "1"
|
|
@@ -682,24 +1129,29 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
682
1129
|
alignment: "start",
|
|
683
1130
|
label: unref(messages).nav.submenu(__props.label)
|
|
684
1131
|
}, {
|
|
685
|
-
trigger: withCtx(({ isOpen, panelId }) => [createElementVNode("button", {
|
|
1132
|
+
trigger: withCtx(({ isOpen, panelId }) => [createElementVNode("button", mergeProps({
|
|
686
1133
|
type: "button",
|
|
687
|
-
class:
|
|
1134
|
+
class: "astryx-nav-item astryx-nav-item--block astryx-nav-item--icon-only"
|
|
1135
|
+
}, { [unref(SIDE_NAV_ROW_ATTRIBUTE)]: "kept" }, {
|
|
1136
|
+
class: [`astryx-nav-item--${__props.size}`, { "astryx-nav-item--selected": __props.isSelected }],
|
|
688
1137
|
"aria-expanded": isOpen ? "true" : "false",
|
|
689
1138
|
"aria-controls": panelId,
|
|
690
1139
|
"aria-haspopup": "menu",
|
|
691
1140
|
"aria-label": accessibleLabel.value
|
|
692
|
-
}, [createElementVNode("span", _hoisted_2$1, [__props.iconClass ? (openBlock(), createElementBlock("span", {
|
|
1141
|
+
}), [createElementVNode("span", _hoisted_2$1, [__props.iconClass ? (openBlock(), createElementBlock("span", {
|
|
693
1142
|
key: 0,
|
|
694
1143
|
class: normalizeClass(["astryx-nav-item__glyph", __props.isSelected && __props.selectedIconClass ? __props.selectedIconClass : __props.iconClass])
|
|
695
|
-
}, null, 2)) : renderSlot(_ctx.$slots, "icon", {}, void 0, void 0, 1)])],
|
|
1144
|
+
}, null, 2)) : renderSlot(_ctx.$slots, "icon", {}, void 0, void 0, 1)])], 16, _hoisted_1$1)]),
|
|
696
1145
|
default: withCtx(() => [createElementVNode("div", {
|
|
697
1146
|
class: "astryx-side-nav-item__popover",
|
|
698
1147
|
role: "group",
|
|
699
1148
|
"aria-label": __props.label
|
|
700
1149
|
}, [createElementVNode("div", _hoisted_4$1, toDisplayString(__props.label), 1), renderSlot(_ctx.$slots, "default")], 8, _hoisted_3$1)]),
|
|
701
1150
|
_: 3
|
|
702
|
-
}, 8, ["label"])) : createCommentVNode("v-if", true)], 64)) : (openBlock(), createElementBlock("div",
|
|
1151
|
+
}, 8, ["label"])) : createCommentVNode("v-if", true)], 64)) : (openBlock(), createElementBlock("div", mergeProps({
|
|
1152
|
+
key: 1,
|
|
1153
|
+
class: "astryx-side-nav-item"
|
|
1154
|
+
}, rowMarker.value), [createElementVNode("div", _hoisted_5, [splitToggle.value ? (openBlock(), createElementBlock("div", {
|
|
703
1155
|
key: 0,
|
|
704
1156
|
class: normalizeClass(["astryx-nav-item astryx-nav-item--block", [`astryx-nav-item--${__props.size}`, { "astryx-nav-item--selected": __props.isSelected }]])
|
|
705
1157
|
}, [createVNode(_sfc_main$8, mergeProps(unref(attrs), {
|
|
@@ -710,6 +1162,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
710
1162
|
href: __props.href,
|
|
711
1163
|
"icon-class": __props.iconClass,
|
|
712
1164
|
"is-disabled": __props.isDisabled,
|
|
1165
|
+
"is-focusable-when-disabled": "",
|
|
713
1166
|
"is-selected": __props.isSelected,
|
|
714
1167
|
label: __props.label,
|
|
715
1168
|
rel: __props.rel,
|
|
@@ -718,17 +1171,17 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
718
1171
|
target: __props.target,
|
|
719
1172
|
onClick: onActivate
|
|
720
1173
|
}), createSlots({ _: 2 }, [
|
|
721
|
-
_ctx.$slots.icon ? {
|
|
1174
|
+
unref(hasSlotContent)(_ctx.$slots.icon) ? {
|
|
722
1175
|
name: "icon",
|
|
723
1176
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
|
|
724
1177
|
key: "0"
|
|
725
1178
|
} : void 0,
|
|
726
|
-
_ctx.$slots.selectedIcon ? {
|
|
1179
|
+
unref(hasSlotContent)(_ctx.$slots.selectedIcon) ? {
|
|
727
1180
|
name: "selectedIcon",
|
|
728
1181
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "selectedIcon")]),
|
|
729
1182
|
key: "1"
|
|
730
1183
|
} : void 0,
|
|
731
|
-
_ctx.$slots.end ? {
|
|
1184
|
+
unref(hasSlotContent)(_ctx.$slots.end) ? {
|
|
732
1185
|
name: "end",
|
|
733
1186
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "end")]),
|
|
734
1187
|
key: "2"
|
|
@@ -756,7 +1209,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
756
1209
|
icon: "chevronDown",
|
|
757
1210
|
size: "sm",
|
|
758
1211
|
class: normalizeClass(["astryx-side-nav-item__chevron", { "astryx-side-nav-item__chevron--open": !nestedCollapsed.value }])
|
|
759
|
-
}, null, 8, ["class"])], 8,
|
|
1212
|
+
}, null, 8, ["class"])], 8, _hoisted_6)], 2)) : (openBlock(), createBlock(_sfc_main$8, mergeProps({ key: 1 }, unref(attrs), {
|
|
760
1213
|
block: "",
|
|
761
1214
|
as: __props.as,
|
|
762
1215
|
controls: canNest.value ? childrenId : void 0,
|
|
@@ -765,6 +1218,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
765
1218
|
href: __props.href,
|
|
766
1219
|
"icon-class": __props.iconClass,
|
|
767
1220
|
"is-disabled": __props.isDisabled,
|
|
1221
|
+
"is-focusable-when-disabled": "",
|
|
768
1222
|
"is-selected": __props.isSelected,
|
|
769
1223
|
label: __props.label,
|
|
770
1224
|
rel: __props.rel,
|
|
@@ -773,17 +1227,17 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
773
1227
|
target: __props.target,
|
|
774
1228
|
onClick: onActivate
|
|
775
1229
|
}), createSlots({ _: 2 }, [
|
|
776
|
-
_ctx.$slots.icon ? {
|
|
1230
|
+
unref(hasSlotContent)(_ctx.$slots.icon) ? {
|
|
777
1231
|
name: "icon",
|
|
778
1232
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
|
|
779
1233
|
key: "0"
|
|
780
1234
|
} : void 0,
|
|
781
|
-
_ctx.$slots.selectedIcon ? {
|
|
1235
|
+
unref(hasSlotContent)(_ctx.$slots.selectedIcon) ? {
|
|
782
1236
|
name: "selectedIcon",
|
|
783
1237
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "selectedIcon")]),
|
|
784
1238
|
key: "1"
|
|
785
1239
|
} : void 0,
|
|
786
|
-
_ctx.$slots.end || canNest.value ? {
|
|
1240
|
+
unref(hasSlotContent)(_ctx.$slots.end) || canNest.value ? {
|
|
787
1241
|
name: "end",
|
|
788
1242
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "end"), canNest.value ? (openBlock(), createBlock(_sfc_main$5, {
|
|
789
1243
|
key: 0,
|
|
@@ -807,7 +1261,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
807
1261
|
"selected-icon-class",
|
|
808
1262
|
"size",
|
|
809
1263
|
"target"
|
|
810
|
-
])), _ctx.$slots.actions ? (openBlock(), createElementBlock("div",
|
|
1264
|
+
])), unref(hasSlotContent)(_ctx.$slots.actions) ? (openBlock(), createElementBlock("div", _hoisted_7, [createVNode(unref(SizeProvider), { value: "sm" }, {
|
|
811
1265
|
default: withCtx(() => [renderSlot(_ctx.$slots, "actions")]),
|
|
812
1266
|
_: 3
|
|
813
1267
|
})])) : createCommentVNode("v-if", true)]), hasChildren.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -818,10 +1272,10 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
818
1272
|
"aria-labelledby": labelId,
|
|
819
1273
|
"aria-hidden": nestedCollapsed.value ? "true" : void 0,
|
|
820
1274
|
inert: nestedCollapsed.value || void 0
|
|
821
|
-
}, [createElementVNode("div",
|
|
1275
|
+
}, [createElementVNode("div", _hoisted_9, [createElementVNode("span", {
|
|
822
1276
|
id: labelId,
|
|
823
1277
|
hidden: ""
|
|
824
|
-
}, toDisplayString(__props.label), 1), renderSlot(_ctx.$slots, "default")])], 10,
|
|
1278
|
+
}, toDisplayString(__props.label), 1), renderSlot(_ctx.$slots, "default")])], 10, _hoisted_8)) : createCommentVNode("v-if", true)], 16));
|
|
825
1279
|
};
|
|
826
1280
|
}
|
|
827
1281
|
});
|
|
@@ -861,7 +1315,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
861
1315
|
}, [createElementVNode("div", { class: normalizeClass(["astryx-side-nav-section__header", { "astryx-visually-hidden": hideHeader.value }]) }, [createElementVNode("span", _hoisted_1, [createElementVNode("span", {
|
|
862
1316
|
id: titleId,
|
|
863
1317
|
class: "astryx-side-nav-section__title"
|
|
864
|
-
}, toDisplayString(__props.title), 1), __props.subtitle ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.subtitle), 1)) : createCommentVNode("v-if", true)]), _ctx.$slots.end ? (openBlock(), createElementBlock("span", _hoisted_3, [renderSlot(_ctx.$slots, "end")])) : createCommentVNode("v-if", true)], 2), createElementVNode("div", _hoisted_4, [renderSlot(_ctx.$slots, "default")])]);
|
|
1318
|
+
}, toDisplayString(__props.title), 1), __props.subtitle ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.subtitle), 1)) : createCommentVNode("v-if", true)]), unref(hasSlotContent)(_ctx.$slots.end) ? (openBlock(), createElementBlock("span", _hoisted_3, [renderSlot(_ctx.$slots, "end")])) : createCommentVNode("v-if", true)], 2), createElementVNode("div", _hoisted_4, [renderSlot(_ctx.$slots, "default")])]);
|
|
865
1319
|
};
|
|
866
1320
|
}
|
|
867
1321
|
});
|