@astryx-vue/core 0.16.5 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +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/Code/index.d.ts +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Dk9BQQbT.js → Collapsible-ExzU7vC0.js} +104 -40
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-mNR6dV0B.js → CommandPalette-CECjNvGB.js} +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-CR9XbpTa.js → ComplexSelector-Dmaag1wm.js} +5 -1
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-ChGin5zS.js → DateTimeInput-Cfkuec_h.js} +1 -1
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Field/index.d.ts +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/Indicator/index.d.ts +2 -2
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-7rA65NO7.js → InternationalizationProvider-Dr5GE6f0.js} +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-BNVd70jg.js → Markdown-DnnWjJGX.js} +1 -1
- package/dist/{MediaTheme-Bkj-_DFN.js → MediaTheme-DfcdEWx-.js} +2 -36
- 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-CXX1Hsty.js → MultiSelector-BK6nZweN.js} +26 -14
- 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/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-BvZFvwso.js → Pagination-DFQNX_Mb.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-BiupstfT.js → PowerSearch-BAOqpQag.js} +10 -10
- 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/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-DiSLNzl8.js → Selector-Bo7qkt1P.js} +157 -62
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-BD8MugZo.js → Table-iemur_3E.js} +378 -7
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Theme/index.d.ts +3 -3
- package/dist/Theme/index.js +3 -2
- package/dist/{Theme-8bDq2nud.js → Theme-1RJVaRgz.js} +329 -40
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-CzbqvHDN.js → Toast-D4Q6wvYu.js} +1 -1
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-mu0Sak58.js → Tokenizer-CsFiYUJ_.js} +171 -103
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-CNj4KnHH.js → TreeList-ugSF9DWj.js} +117 -2
- package/dist/Typeahead/index.d.ts +2 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-Db8Tu27Z.js → Typeahead--kEp21ut.js} +159 -71
- package/dist/{useKeyboardHighlight-CGCf1O57.js → assertOptions-CK_gJ0d3.js} +12 -1
- package/dist/composables/index.d.ts +4 -3
- package/dist/composables/index.js +5 -5
- package/dist/composables-BgfubKnk.js +5437 -0
- package/dist/handle-BPXdHbkr.js +458 -0
- package/dist/{index-sXu15K4j.d.ts → index-B-3EGjfQ.d.ts} +2 -2
- package/dist/{index-TXcNH86P.d.ts → index-B1eCxBCY.d.ts} +1 -1
- package/dist/{index-9eluGe3a.d.ts → index-BBTU-TKb.d.ts} +1 -1
- package/dist/{index-CE74Qsbn.d.ts → index-BKpnfdq1.d.ts} +9 -9
- package/dist/{index-D_xBhUV5.d.ts → index-B_PKY-Wn.d.ts} +11 -11
- package/dist/{index-Bfm6mF-r.d.ts → index-BfoazhEu.d.ts} +1 -1
- package/dist/{index-BWzEt0gT.d.ts → index-BhxqUt3y.d.ts} +1 -1
- package/dist/{index-CJdOt5Cc.d.ts → index-BtqvPjAf.d.ts} +3 -3
- package/dist/{index-ChqMaV6N.d.ts → index-Bzi3A980.d.ts} +1 -1
- package/dist/{index-DBwEz4M9.d.ts → index-BzmcDJau.d.ts} +11 -11
- package/dist/{index-CQ1bsxLC.d.ts → index-C1qJlC65.d.ts} +1 -1
- package/dist/{index-CMLnSg3T.d.ts → index-C4S65SAW.d.ts} +8 -1
- package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
- package/dist/{index-gmY3A_Iw.d.ts → index-C93nwgTW.d.ts} +1 -1
- package/dist/{index-BvWBeoa8.d.ts → index-CEjvYAUZ.d.ts} +1 -1
- package/dist/{index-B0R5CLPF.d.ts → index-CsYDrQ9R.d.ts} +1 -1
- package/dist/{index-C2cH8OLC.d.ts → index-D31bgBoy.d.ts} +1 -1
- package/dist/{index-BxWCX2pJ.d.ts → index-DFLPv9io.d.ts} +3 -3
- package/dist/index-DGXCnzOL.d.ts +69 -0
- package/dist/{index-BPf_jmME.d.ts → index-DMcf0QeR.d.ts} +3 -3
- package/dist/{index-SWw-WMTO.d.ts → index-DPhQZXYw.d.ts} +3 -3
- package/dist/{index-B-Jla56c.d.ts → index-DmAEpn5E.d.ts} +1 -1
- package/dist/{index-B0yaHi__.d.ts → index-DtZUOyCy.d.ts} +12 -5
- package/dist/{index-BQ3cm7mP.d.ts → index-FeZXsFO-.d.ts} +1 -1
- package/dist/{index-Byan7Dad.d.ts → index-GmoeIuhl.d.ts} +1 -1
- package/dist/{index-ygmRS6Np.d.ts → index-KcCNhdAw.d.ts} +1 -1
- package/dist/{index-BPHqOCfp.d.ts → index-PffxihMx.d.ts} +4 -4
- package/dist/{index-unAZVFGz.d.ts → index-Qdbssopn.d.ts} +2 -2
- package/dist/{index-LHvLg1Pv.d.ts → index-Y4H4X6Vy.d.ts} +88 -82
- package/dist/{index-Xc3q9f84.d.ts → index-YKCx03zD.d.ts} +2 -2
- package/dist/{index-BXDqyk2_.d.ts → index-gu5EvbE0.d.ts} +170 -2
- package/dist/{index-BFZxzCYu.d.ts → index-o00Upzjp.d.ts} +3 -3
- package/dist/{index-BEZ4ezJk.d.ts → index-ql9ApSTF.d.ts} +7 -0
- package/dist/index.d.ts +39 -37
- package/dist/index.js +31 -30
- package/dist/landing-Bs0aMIsR.js +2049 -0
- package/dist/{loadCatalog-DFyDz_4e.d.ts → loadCatalog-BJwcyX8i.d.ts} +2 -0
- package/dist/{loadCatalog-C3MSknfx.js → loadCatalog-C1kms5sO.js} +5 -1
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +3 -3
- package/dist/{locale-OCGw4bi6.js → locale-CHhsd9Mq.js} +1 -1
- package/dist/motionTokenDefaults-EFzpiAF5.js +38 -0
- package/dist/tokenName-0U-WEH09.js +36 -0
- package/dist/{typeahead-RkZw0Ktn.js → typeahead-BgfLP7vR.js} +2 -0
- package/dist/{index-DbFIQDoa.d.ts → types-C1ydeFiu.d.ts} +43 -65
- package/dist/{types-uWxXh1Jm.d.ts → types-fRasDCe4.d.ts} +47 -6
- package/dist/useAnimatedLayout-C0koWm4a.d.ts +56 -0
- package/dist/{useAsyncSource-Gk0VtE7_.js → useAsyncSource-7GTcK8ep.js} +31 -1
- package/dist/{useAsyncSource-aGzrvRkI.d.ts → useAsyncSource-DbG2FSuI.d.ts} +19 -2
- package/dist/{useCombobox-D374_pT8.js → useCombobox-DIR9yoEu.js} +150 -3
- package/dist/{useTypeaheadAnnouncement-CSikDlpK.js → useTypeaheadMenuConfig--4f7jR6G.js} +264 -20
- package/package.json +1 -1
- package/styles/motion.css +10 -0
- package/styles/selector.css +10 -0
- package/styles/table.css +19 -0
- package/dist/composables-CCsHfpCS.js +0 -1256
- package/dist/{Chat-PEkZTrQE.js → Chat-Wq7e98zS.js} +1 -1
- package/dist/{CodeBlock-9Lfec8C8.js → CodeBlock-CLVXVlB7.js} +1 -1
- package/dist/{DateInput-kXAc_r5m.js → DateInput-BitZfGEY.js} +1 -1
- package/dist/{DateRangeInput-DW7IzFQM.js → DateRangeInput-kxXBsUTU.js} +1 -1
|
@@ -3,17 +3,19 @@ import { t as usePressFeedback } from "./usePressFeedback-2YAzGB6C.js";
|
|
|
3
3
|
import { i as isIconGlyph, t as _sfc_main$2 } from "./Icon-BCHo7W0x.js";
|
|
4
4
|
import { n as isSafeUrl } from "./safeUrl-CsvfcZ9m.js";
|
|
5
5
|
import { n as useLinkComponent } from "./context-C_peZbXf.js";
|
|
6
|
+
import { a as playLayoutChange, i as releaseLayoutExit, n as reportLayoutChange, r as holdLayoutExit, t as applyLayoutChangeTransition } from "./landing-Bs0aMIsR.js";
|
|
6
7
|
import { o as useComponentMessages } from "./context-B8IEFCDR.js";
|
|
7
8
|
import { n as isShortcutChord, r as nextTypeaheadBuffer, t as findTypeaheadMatch } from "./typeaheadMatch-Cl-oxKFt.js";
|
|
8
9
|
import { t as _sfc_main$3 } from "./Badge-BbPS_49c.js";
|
|
9
10
|
import { t as consumeWhileDisabled } from "./disabledInteraction-CPzL8kVP.js";
|
|
10
11
|
import { t as treeListMessages } from "./tree-list-NZ1EZhtd.js";
|
|
11
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, onMounted, openBlock, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, toRaw, unref, useAttrs, useId, useSlots, vShow, withCtx, withDirectives } from "vue";
|
|
12
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, onMounted, openBlock, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, unref, useAttrs, useId, useSlots, vShow, watch, withCtx, withDirectives } from "vue";
|
|
12
13
|
import "../styles/tree-list.css";
|
|
13
14
|
//#region src/TreeList/TreeListItem.vue
|
|
14
15
|
const _hoisted_1$1 = [
|
|
15
16
|
"data-tree-id",
|
|
16
17
|
"data-tree-disabled",
|
|
18
|
+
"data-tree-exiting",
|
|
17
19
|
"aria-level",
|
|
18
20
|
"aria-posinset",
|
|
19
21
|
"aria-setsize",
|
|
@@ -95,6 +97,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
95
97
|
isLast: { type: Boolean },
|
|
96
98
|
ancestorsIsLast: {},
|
|
97
99
|
expanded: {},
|
|
100
|
+
exitingIds: {},
|
|
101
|
+
isLeaving: { type: Boolean },
|
|
98
102
|
hasExpandableItems: { type: Boolean },
|
|
99
103
|
tabbableId: {},
|
|
100
104
|
posInSet: {},
|
|
@@ -118,6 +122,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
118
122
|
const linkRel = computed(() => props.item.target === "_blank" ? "noopener noreferrer" : void 0);
|
|
119
123
|
const hasChildren = computed(() => (props.item.children?.length ?? 0) > 0);
|
|
120
124
|
const isExpanded = computed(() => hasChildren.value && props.expanded[props.item.id] === true);
|
|
125
|
+
/** 收起了、子组还在播放退场:子组继续渲染。 */
|
|
126
|
+
const isExiting = computed(() => hasChildren.value && !isExpanded.value && props.exitingIds.has(props.item.id));
|
|
121
127
|
const reservesChevron = computed(() => !hasChildren.value && props.hasExpandableItems);
|
|
122
128
|
const indent = computed(() => reservesChevron.value ? `calc(${props.nestedLevel} * var(--tree-list-indent) + var(--astryx-spacing-4, 16px) + var(--astryx-spacing-2, 8px))` : `calc(${props.nestedLevel} * var(--tree-list-indent))`);
|
|
123
129
|
const childAncestors = computed(() => [...props.ancestorsIsLast, props.isLast]);
|
|
@@ -159,6 +165,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
159
165
|
role: "treeitem",
|
|
160
166
|
"data-tree-id": __props.item.id,
|
|
161
167
|
"data-tree-disabled": __props.item.isDisabled ? "true" : void 0,
|
|
168
|
+
"data-tree-exiting": __props.isLeaving ? "" : void 0,
|
|
162
169
|
style: normalizeStyle(__props.item.style),
|
|
163
170
|
"aria-level": __props.nestedLevel + 1,
|
|
164
171
|
"aria-posinset": __props.posInSet,
|
|
@@ -291,7 +298,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
291
298
|
"aria-hidden": "true"
|
|
292
299
|
}, null, 2)])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true)
|
|
293
300
|
])], 16, _hoisted_4)]),
|
|
294
|
-
hasChildren.value && isExpanded.value ? (openBlock(), createElementBlock("ul", _hoisted_21, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.item.children, (child, index) => {
|
|
301
|
+
hasChildren.value && (isExpanded.value || isExiting.value) ? (openBlock(), createElementBlock("ul", _hoisted_21, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.item.children, (child, index) => {
|
|
295
302
|
return openBlock(), createBlock(_component_TreeListItem, {
|
|
296
303
|
key: child.id,
|
|
297
304
|
item: child,
|
|
@@ -301,6 +308,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
301
308
|
"is-last": index === (__props.item.children?.length ?? 1) - 1,
|
|
302
309
|
"ancestors-is-last": childAncestors.value,
|
|
303
310
|
expanded: __props.expanded,
|
|
311
|
+
"exiting-ids": __props.exitingIds,
|
|
312
|
+
"is-leaving": __props.isLeaving || isExiting.value,
|
|
304
313
|
"has-expandable-items": __props.hasExpandableItems,
|
|
305
314
|
"tabbable-id": __props.tabbableId,
|
|
306
315
|
"pos-in-set": index + 1,
|
|
@@ -314,6 +323,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
314
323
|
"is-last",
|
|
315
324
|
"ancestors-is-last",
|
|
316
325
|
"expanded",
|
|
326
|
+
"exiting-ids",
|
|
327
|
+
"is-leaving",
|
|
317
328
|
"has-expandable-items",
|
|
318
329
|
"tabbable-id",
|
|
319
330
|
"pos-in-set",
|
|
@@ -516,6 +527,89 @@ function useTreeFocus(options) {
|
|
|
516
527
|
};
|
|
517
528
|
}
|
|
518
529
|
//#endregion
|
|
530
|
+
//#region src/TreeList/useTreeLayoutMotion.ts
|
|
531
|
+
const CHEVRON = "[data-tree-toggle] > .astryx-icon";
|
|
532
|
+
function sameIds(a, b) {
|
|
533
|
+
return a.size === b.size && [...a].every((id) => b.has(id));
|
|
534
|
+
}
|
|
535
|
+
function rowOf(tree, id) {
|
|
536
|
+
if (tree == null) return null;
|
|
537
|
+
return [...tree.querySelectorAll("[data-tree-id]")].find((row) => row.dataset.treeId === id) ?? null;
|
|
538
|
+
}
|
|
539
|
+
function useTreeLayoutMotion(options) {
|
|
540
|
+
const exitingIds = shallowRef(/* @__PURE__ */ new Set());
|
|
541
|
+
let pending = [];
|
|
542
|
+
function endExit(id) {
|
|
543
|
+
if (!exitingIds.value.has(id)) return;
|
|
544
|
+
const next = new Set(exitingIds.value);
|
|
545
|
+
next.delete(id);
|
|
546
|
+
exitingIds.value = next;
|
|
547
|
+
}
|
|
548
|
+
function measureChanges(handle, previous, current) {
|
|
549
|
+
const changed = [...[...previous].filter((id) => !current.has(id)), ...[...current].filter((id) => !previous.has(id))];
|
|
550
|
+
const rows = /* @__PURE__ */ new Map();
|
|
551
|
+
for (const id of changed) {
|
|
552
|
+
const row = rowOf(options.tree(), id);
|
|
553
|
+
if (row != null) rows.set(id, row);
|
|
554
|
+
}
|
|
555
|
+
const outerOf = (row) => [...rows].find(([, other]) => other !== row && other.contains(row))?.[0];
|
|
556
|
+
const nested = /* @__PURE__ */ new Map();
|
|
557
|
+
for (const [id, row] of rows) {
|
|
558
|
+
const outer = outerOf(row);
|
|
559
|
+
if (outer != null) nested.set(outer, [...nested.get(outer) ?? [], id]);
|
|
560
|
+
}
|
|
561
|
+
for (const [id, row] of rows) {
|
|
562
|
+
if (outerOf(row) != null) continue;
|
|
563
|
+
applyLayoutChangeTransition(handle, row.querySelector(CHEVRON));
|
|
564
|
+
const change = reportLayoutChange(handle, () => row);
|
|
565
|
+
change.measureBefore();
|
|
566
|
+
pending.push({
|
|
567
|
+
change,
|
|
568
|
+
id,
|
|
569
|
+
isExpanding: current.has(id),
|
|
570
|
+
nested: nested.get(id) ?? []
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
watch(options.expandedIds, (current, previous) => {
|
|
575
|
+
const handle = options.animatedLayout();
|
|
576
|
+
if (handle == null || sameIds(current, previous)) return;
|
|
577
|
+
const next = new Set(exitingIds.value);
|
|
578
|
+
for (const id of previous) if (!current.has(id)) next.add(id);
|
|
579
|
+
for (const id of current) next.delete(id);
|
|
580
|
+
exitingIds.value = next;
|
|
581
|
+
measureChanges(handle, previous, current);
|
|
582
|
+
}, { flush: "pre" });
|
|
583
|
+
watch(options.expandedIds, () => {
|
|
584
|
+
const changes = pending;
|
|
585
|
+
pending = [];
|
|
586
|
+
const handle = options.animatedLayout();
|
|
587
|
+
for (const item of changes) {
|
|
588
|
+
const isMeasured = item.change.animate();
|
|
589
|
+
const group = rowOf(options.tree(), item.id)?.querySelector(":scope > [role=\"group\"]") ?? null;
|
|
590
|
+
if (item.isExpanding) {
|
|
591
|
+
if (group != null) {
|
|
592
|
+
releaseLayoutExit(group);
|
|
593
|
+
if (isMeasured) playLayoutChange(handle, group);
|
|
594
|
+
}
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
const endAll = () => {
|
|
598
|
+
endExit(item.id);
|
|
599
|
+
item.nested.forEach(endExit);
|
|
600
|
+
};
|
|
601
|
+
if (!(isMeasured && group != null && holdLayoutExit(handle, group, endAll))) endAll();
|
|
602
|
+
}
|
|
603
|
+
}, { flush: "post" });
|
|
604
|
+
function clearChevronsWithoutHandle() {
|
|
605
|
+
if (options.animatedLayout() != null) return;
|
|
606
|
+
for (const chevron of options.tree()?.querySelectorAll(CHEVRON) ?? []) applyLayoutChangeTransition(null, chevron);
|
|
607
|
+
}
|
|
608
|
+
onMounted(clearChevronsWithoutHandle);
|
|
609
|
+
watch(options.animatedLayout, clearChevronsWithoutHandle, { flush: "post" });
|
|
610
|
+
return { exitingIds };
|
|
611
|
+
}
|
|
612
|
+
//#endregion
|
|
519
613
|
//#region src/TreeList/TreeList.vue
|
|
520
614
|
const _hoisted_1 = ["data-density", "data-variant"];
|
|
521
615
|
const _hoisted_2 = ["aria-label", "aria-labelledby"];
|
|
@@ -525,6 +619,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
525
619
|
__name: "TreeList",
|
|
526
620
|
props: {
|
|
527
621
|
items: {},
|
|
622
|
+
animatedLayout: {},
|
|
528
623
|
density: { default: "balanced" },
|
|
529
624
|
variant: { default: "lineGuides" },
|
|
530
625
|
header: {},
|
|
@@ -607,9 +702,22 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
607
702
|
return visit(items) ?? firstEnabled ?? items[0]?.id;
|
|
608
703
|
}
|
|
609
704
|
const tabbableId = computed(() => initialTabbable(props.items));
|
|
705
|
+
/** 现在展开着的行(祖先也展开着),不管是点击、键盘还是 `items` 让它展开的。 */
|
|
706
|
+
const expandedIds = computed(() => {
|
|
707
|
+
const out = /* @__PURE__ */ new Set();
|
|
708
|
+
const visit = (list) => {
|
|
709
|
+
for (const item of list) if (item.children && item.children.length > 0 && currentExpanded(item.id, props.items)) {
|
|
710
|
+
out.add(item.id);
|
|
711
|
+
visit(item.children);
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
visit(props.items);
|
|
715
|
+
return out;
|
|
716
|
+
});
|
|
610
717
|
const { treeRef, focusRow, handleKeyDown, handleFocus } = useTreeFocus({
|
|
611
718
|
hasRovingTabIndex: true,
|
|
612
719
|
matchLabelledBy: true,
|
|
720
|
+
itemSelector: "[role=\"treeitem\"]:not([data-tree-exiting])",
|
|
613
721
|
onToggleExpand: toggle,
|
|
614
722
|
onActivate: (current) => {
|
|
615
723
|
const candidates = current.querySelectorAll("a[href], button:not([data-tree-toggle])");
|
|
@@ -620,6 +728,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
620
728
|
return false;
|
|
621
729
|
}
|
|
622
730
|
});
|
|
731
|
+
const { exitingIds } = useTreeLayoutMotion({
|
|
732
|
+
animatedLayout: () => props.animatedLayout,
|
|
733
|
+
expandedIds: () => expandedIds.value,
|
|
734
|
+
tree: () => treeRef.value ?? null
|
|
735
|
+
});
|
|
623
736
|
keepFocusOnCollapsingRow = (id) => {
|
|
624
737
|
const tree = treeRef.value;
|
|
625
738
|
const active = typeof document === "undefined" ? null : document.activeElement;
|
|
@@ -666,6 +779,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
666
779
|
"is-last": index === __props.items.length - 1,
|
|
667
780
|
"ancestors-is-last": [],
|
|
668
781
|
expanded,
|
|
782
|
+
"exiting-ids": unref(exitingIds),
|
|
669
783
|
"has-expandable-items": hasExpandable.value,
|
|
670
784
|
"tabbable-id": tabbableId.value,
|
|
671
785
|
"pos-in-set": index + 1,
|
|
@@ -677,6 +791,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
677
791
|
"variant",
|
|
678
792
|
"is-last",
|
|
679
793
|
"expanded",
|
|
794
|
+
"exiting-ids",
|
|
680
795
|
"has-expandable-items",
|
|
681
796
|
"tabbable-id",
|
|
682
797
|
"pos-in-set",
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as TypeaheadSize, i as TypeaheadItemProps, l as TypeaheadSlots, r as TypeaheadEmits, s as TypeaheadProps, t as BaseTypeaheadProps, u as TypeaheadStatus } from "../types-C1ydeFiu.js";
|
|
2
|
+
import { n as _default$1, r as _default, t as _default$2 } from "../index-DGXCnzOL.js";
|
|
2
3
|
export { _default as BaseTypeahead, type BaseTypeaheadProps, _default$1 as Typeahead, type TypeaheadEmits, _default$2 as TypeaheadItem, type TypeaheadItemProps, type TypeaheadProps, type TypeaheadSize, type TypeaheadSlots, type TypeaheadStatus };
|
package/dist/Typeahead/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as _sfc_main, t as _sfc_main$1 } from "../Typeahead
|
|
1
|
+
import { i as _sfc_main$2 } from "../useTypeaheadMenuConfig--4f7jR6G.js";
|
|
2
|
+
import { n as _sfc_main, t as _sfc_main$1 } from "../Typeahead--kEp21ut.js";
|
|
3
3
|
export { _sfc_main as BaseTypeahead, _sfc_main$1 as Typeahead, _sfc_main$2 as TypeaheadItem };
|