@astryx-vue/core 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -26
- package/THIRD_PARTY_NOTICES.md +2 -0
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-ovx4cBjM.js → AlertDialog-B6UeBCE7.js} +2 -2
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-Dd-D4bA2.js → AppShell-CeBmB0Q9.js} +2 -2
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-jmHInHwj.js → Avatar-BB4Z4LF1.js} +10 -4
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +2 -2
- package/dist/BottomSheet/index.js +3 -2
- package/dist/{BottomSheet-Dg95HB1s.js → BottomSheet-BV6vfgGu.js} +82 -22
- package/dist/BottomSheet-o7xw-TOi.js +153 -0
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-CWGfgLNK.js → Breadcrumbs-D6G7f5WL.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/Calendar/index.js +1 -1
- package/dist/{Calendar-CnOsSjMY.js → Calendar-DmTeM7PO.js} +2 -2
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-JA7ilqI_.js → Carousel-CIKrcA2r.js} +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-C7WrCOE4.js → Chat-BFox3u9D.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-CnCGnkZk.js → CheckboxList-BlPf7vPe.js} +4 -4
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-CtwrU33I.js → Citation-BG-vg9ia.js} +1 -1
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.d.ts +3 -3
- package/dist/Code/index.js +4 -4
- package/dist/{Code-BvefYRpx.js → Code-XnPuGxey.js} +1 -1
- package/dist/{CodeBlock-BZGzYeoL.js → CodeBlock-B2pnEOJY.js} +145 -15
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BNbM9T9y.js → CommandPalette-DKgHzmJk.js} +10 -10
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-LtbLlrcj.js → ComplexSelector-Dv44FFhN.js} +1 -1
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-DVQl0xL5.js → ContextMenu-BeJO5HYx.js} +4 -369
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-zm8sNc0t.js → DateInput-D4XFAEMp.js} +3 -3
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-DlVFzrf7.js → DateRangeInput-Cp6AZfew.js} +2 -2
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-C7Z-p6Yd.js → DateTimeInput-B6MPPp76.js} +3 -3
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-BoZChdev.js → DropdownMenu--lnUeJEG.js} +3 -3
- package/dist/{DropdownMenu-u1psFjis.js → DropdownMenu-6E9jFdFe.js} +4 -4
- package/dist/{DropdownMenuRadioItem.vue-uVM0FD2f.d.ts → DropdownMenuRadioItem.vue-CXEURBcq.d.ts} +1 -1
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-CUJdTYKV.js → EmptyState-0RWymQUS.js} +2 -2
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-QdlZn7qK.js → FileInput-DuNwdbAo.js} +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Heading/index.d.ts +2 -2
- package/dist/Heading/index.js +1 -1
- package/dist/Heading-B9C3LZlS.js +94 -0
- package/dist/Indicator/index.d.ts +2 -2
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/Item-DrYJL1TG.js +590 -0
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-BSzfqZ-u.js → Lightbox-Br3o0SyQ.js} +1 -1
- package/dist/Link/index.d.ts +3 -2
- package/dist/Link/index.js +1 -1
- package/dist/Link-DCZ6922-.js +196 -0
- package/dist/List/index.d.ts +3 -3
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-pGxvn6QJ.js → ListItem-CcRHWuEm.js} +8 -2
- package/dist/Markdown/index.d.ts +2 -2
- package/dist/Markdown/index.js +2 -2
- package/dist/{Markdown-B6tSqenv.js → Markdown-Bz0R3kNj.js} +274 -30
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-aN1tRn6W.js → MetadataList-CFaocx6j.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-fqcSafkc.js → MobileNavToggle-Dh3uLivq.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-B3brqdK_.js → MoreMenu-B95nRSe8.js} +2 -2
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-BD5PMgez.js → MultiSelector-DuF5TECE.js} +4 -4
- package/dist/{NavDisclosure-DbYLDXK0.js → NavDisclosure-C6sPZ89n.js} +4 -1
- package/dist/NavHeadingSurface-Cb3x9iDx.js +287 -0
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavMenu/index.d.ts +2 -2
- package/dist/NavMenu/index.js +4 -3
- package/dist/NavMenu-ClIgMaxE.js +176 -0
- package/dist/{NavMenuItem-DrwIMHKO.js → NavMenuItem-E7S8gBh-.js} +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-CBeU4lEl.js → NumberInput-B4IL3s_8.js} +1 -1
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline--HVMSB6i.js → Outline-DBUuchi9.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-FMh7r-r_.js → OverflowList-aDd_oem0.js} +3 -3
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-DlIvESjx.js → Pagination-CNe9F6Fl.js} +181 -45
- 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-CMG7Rb69.js → PowerSearch-C6U8Sq1Y.js} +13 -13
- package/dist/ProgressBar/index.d.ts +2 -2
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-DO9Chic6.js → ProgressBar-DF6WZNCI.js} +45 -6
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-CXpvj1TZ.js → ResizeHandle-DYy0e3v9.js} +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-BpPnuWH3.js → Selector-5N-hq2nF.js} +3 -3
- package/dist/SideNav/index.d.ts +2 -2
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-D4TupqgE.js → SideNav-CT9lfspi.js} +225 -229
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-H-6-T5Ps.js → Stepper-BqhVCgC-.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-nqA_njNz.js → Table-CsdH8fCB.js} +4 -4
- package/dist/Text/index.d.ts +3 -3
- package/dist/Text/index.js +1 -1
- package/dist/Text-DIzZw6FA.js +86 -0
- 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 +2 -2
- package/dist/Theme-CtaUWo4g.js +1246 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-CXb3m_Hv.js → Thumbnail-BnQwX1cQ.js} +2 -2
- package/dist/{TimeField-B3cndWb0.js → TimeField-Biiuv0hB.js} +1 -1
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-BHQ_LKGm.js → TimeInput-C9gptCOK.js} +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-B7GV6hqd.js → Timer-kxzQx3tp.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-Cfuxbb3i.js → Timestamp-D7bd_nF3.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-CdVLH0_H.js → Token-D2GsI_Ei.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-DlD-S_8-.js → Tokenizer-rwzamZg4.js} +3 -3
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-mp0NMh_Y.js → Tooltip-C2fh9anJ.js} +23 -8
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-DzV874G7.js → TopNav-arWFLTBM.js} +112 -42
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-DEwvlZRV.js → TreeList-C9xvMpJZ.js} +1 -1
- package/dist/Typeahead/index.d.ts +2 -2
- package/dist/Typeahead/index.js +3 -2
- package/dist/Typeahead-_V11btpv.js +499 -0
- package/dist/{TypeaheadMenu-CGvo0Tud.js → TypeaheadMenu-BEObzonz.js} +46 -10
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +4 -4
- package/dist/composables-CWw6t-RJ.js +520 -0
- package/dist/{context-DmOLCubj.js → context-CPh7kE-a.js} +58 -10
- package/dist/{index-BRfR0lhb.d.ts → index-12QYAbiz.d.ts} +1 -1
- package/dist/{index-D1Twv_fL.d.ts → index-4TRnFGxv.d.ts} +6 -6
- package/dist/{index-BTAgQRP0.d.ts → index-B9rqmYxh.d.ts} +150 -62
- package/dist/index-BBtJt5_A.d.ts +26 -0
- package/dist/{index-Ch6BbxCP.d.ts → index-BH9PzQ1F.d.ts} +13 -8
- package/dist/{index-C2sfHfBw.d.ts → index-BK9T1TPZ.d.ts} +4 -4
- package/dist/{index-D_UEJIU5.d.ts → index-BPwD6aBv.d.ts} +1 -1
- package/dist/{index-B1x05arQ.d.ts → index-BlOIC_AM.d.ts} +1 -1
- package/dist/{index-C5p2NeCr.d.ts → index-Blm197N_.d.ts} +11 -2
- package/dist/{index-Bu3oXIIS.d.ts → index-BmmdzwT9.d.ts} +6 -0
- package/dist/{index-MPcg1Pm4.d.ts → index-BpH4wvsg.d.ts} +2 -2
- package/dist/{index-BMn9ghAX.d.ts → index-C1HIqW_H.d.ts} +2 -2
- package/dist/{index-LIyvJTW3.d.ts → index-C3GaPqvJ.d.ts} +84 -8
- package/dist/{index-DkVEBdWa.d.ts → index-CB9Srua5.d.ts} +1 -1
- package/dist/{index-C8wDPDcP.d.ts → index-CLmKfnqf.d.ts} +49 -7
- package/dist/{index-DMQG6kdM.d.ts → index-CPwzSbQQ.d.ts} +2 -2
- package/dist/{index-DAiGhkNZ.d.ts → index-D4I_obqR.d.ts} +1 -1
- package/dist/{index-foQMNKZO.d.ts → index-D5N9ikrS.d.ts} +48 -2
- package/dist/{index-D8o50qOE.d.ts → index-DFbvnBlf.d.ts} +31 -2
- package/dist/{index-Cm_TiLXU.d.ts → index-Dgg0bHVM.d.ts} +7 -3
- package/dist/{index-ViSV0RBx.d.ts → index-DjMwF8ET.d.ts} +11 -1
- package/dist/{index-nCEmW6wa.d.ts → index-DtePJ_w_.d.ts} +1 -1
- package/dist/index-DxR1FChm.d.ts +158 -0
- package/dist/{index-f4NGT-e2.d.ts → index-EFqQF2Bx.d.ts} +1 -1
- package/dist/{index-BB5yVIN-.d.ts → index-JL4auphT.d.ts} +2 -2
- package/dist/{index-B9f1rUEv.d.ts → index-XuAAcYiP.d.ts} +1 -1
- package/dist/{index-D0TlUOtG.d.ts → index-YmSe1ujk.d.ts} +76 -3
- package/dist/{index-BMrggCw-.d.ts → index-bvr3WHvs.d.ts} +1 -1
- package/dist/{index-CDDMDHJM.d.ts → index-c67ca7eJ.d.ts} +1 -1
- package/dist/{index-CGZ2xi3r.d.ts → index-eshFLli0.d.ts} +40 -3
- package/dist/{index-DxsKyAxq.d.ts → index-vizlhXVs.d.ts} +131 -2
- package/dist/{index-DfgHJE7H.d.ts → index-z3uLM1O6.d.ts} +153 -24
- package/dist/index.d.ts +80 -79
- package/dist/index.js +118 -115
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +3 -3
- package/dist/locale-sLw5Caia.js +917 -0
- package/dist/{searchResultMessage-DN0HeRRB.js → searchResultMessage-CCnq-_ce.js} +1 -1
- package/dist/syntaxTheme-CwVEcVDk.d.ts +57 -0
- package/dist/{syntaxTheme-ClpWALZX.js → syntaxTheme-R7xnu5x5.js} +24 -3
- package/dist/{types-Bt-lSgYX.d.ts → types-D9nP_X-c.d.ts} +14 -1
- package/dist/{types-CAZY4Xua.d.ts → types-DGYHIu4I.d.ts} +30 -1
- package/dist/types-D_J66aPN.d.ts +85 -0
- package/dist/types-gKsEkk2g.d.ts +320 -0
- package/dist/{useMenuDrillIn-OaEwjK44.js → useMenuDrillIn-BgjJcY3K.js} +1 -1
- package/dist/useMenuPress-DUmEy4TB.js +425 -0
- package/dist/{composables-DDI08XFF.js → useResizable-B3ahKLoZ.js} +73 -248
- package/dist/useTruncation-B5qXQzAP.js +53 -0
- package/locales/SOURCE.json +37 -0
- package/locales/af-ZA.json +1482 -0
- package/locales/ar-SA.json +1482 -0
- package/locales/ca-ES.json +1482 -0
- package/locales/cs-CZ.json +1482 -0
- package/locales/da-DK.json +1482 -0
- package/locales/de-DE.json +1482 -0
- package/locales/el-GR.json +1482 -0
- package/locales/en.json +1646 -0
- package/locales/es-ES.json +1482 -0
- package/locales/fi-FI.json +1482 -0
- package/locales/fr-FR.json +1482 -0
- package/locales/he-IL.json +1482 -0
- package/locales/hu-HU.json +1482 -0
- package/locales/it-IT.json +1482 -0
- package/locales/ja-JP.json +1482 -0
- package/locales/ko-KR.json +1482 -0
- package/locales/nl-NL.json +1482 -0
- package/locales/no-NO.json +1482 -0
- package/locales/pl-PL.json +1482 -0
- package/locales/pt-BR.json +1482 -0
- package/locales/pt-PT.json +1482 -0
- package/locales/ro-RO.json +1482 -0
- package/locales/ru-RU.json +1482 -0
- package/locales/sr-SP.json +1482 -0
- package/locales/sv-SE.json +1482 -0
- package/locales/tr-TR.json +1482 -0
- package/locales/uk-UA.json +1482 -0
- package/locales/vi-VN.json +1482 -0
- package/locales/zh-CN.json +1482 -0
- package/locales/zh-TW.json +1482 -0
- package/package.json +4 -2
- package/styles/bottom-sheet.css +27 -0
- package/styles/code.css +62 -0
- package/styles/container-reveal.css +104 -0
- package/styles/heading.css +47 -0
- package/styles/keyboard-hint.css +28 -0
- package/styles/link.css +34 -0
- package/styles/list.css +88 -1
- package/styles/markdown.css +12 -0
- package/styles/pagination.css +30 -0
- package/styles/progress-bar.css +49 -0
- package/styles/side-nav.css +36 -1
- package/styles/text.css +18 -0
- package/styles/top-nav.css +145 -6
- package/styles/typeahead.css +24 -0
- package/styles.css +2 -0
- package/dist/Heading-Dugosn6j.js +0 -43
- package/dist/Item-C1z6gXn8.js +0 -289
- package/dist/Link-DqdQZ37C.js +0 -141
- package/dist/Text-BHVghsWo.js +0 -53
- package/dist/Theme-CejS9MHm.js +0 -447
- package/dist/Typeahead-DQ3tmqYe.js +0 -375
- package/dist/index-Bqb_Fyju.d.ts +0 -80
- package/dist/index-Dg3ZmwEg.d.ts +0 -75
- package/dist/locale-CCwVnyMZ.js +0 -42
- package/dist/syntaxTheme-Bcs1YMF7.d.ts +0 -38
- package/dist/types-jmqqnkKA.d.ts +0 -163
- package/dist/useHotkeys-dABSK1o9.js +0 -80
- package/dist/useLongPress-Cyxwa73s.js +0 -60
- package/dist/{index-BXkNZF3q.d.ts → index-CpiWVbRZ.d.ts} +1 -1
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, mergeProps, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toValue, unref, useAttrs, useId, useSlots, useTemplateRef, withCtx, withModifiers } from "vue";
|
|
2
|
+
import "../styles/list.css";
|
|
3
|
+
//#region src/List/context.ts
|
|
4
|
+
const listContextKey = Symbol("astryx-list-context");
|
|
5
|
+
/** The surrounding list, or `undefined` when the row stands alone. */
|
|
6
|
+
function useListContext() {
|
|
7
|
+
return inject(listContextKey, void 0);
|
|
8
|
+
}
|
|
9
|
+
const itemDescriptionContextKey = Symbol("astryx-item-description");
|
|
10
|
+
/**
|
|
11
|
+
* The id of the description element of the nearest row, so a control rendered
|
|
12
|
+
* in one of that row's slots can point `aria-describedby` at it. `null` when
|
|
13
|
+
* the row renders no description.
|
|
14
|
+
*/
|
|
15
|
+
function useItemDescriptionId() {
|
|
16
|
+
return inject(itemDescriptionContextKey, computed(() => null));
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/List/useItemSwipe.ts
|
|
20
|
+
const AXIS_LOCK_PX = 10;
|
|
21
|
+
const REST_FRACTION = .5;
|
|
22
|
+
const COMMIT_PAST_PX = 48;
|
|
23
|
+
const COMMIT_FRACTION = .5;
|
|
24
|
+
const FLING_VELOCITY = .6;
|
|
25
|
+
const FLING_MIN_PX = 44;
|
|
26
|
+
const OVERSHOOT_PX = 24;
|
|
27
|
+
const SETTLE_MS = 200;
|
|
28
|
+
/**
|
|
29
|
+
* 触摸横滑露出行内操作。鼠标不开始拖动;竖着拖留给外面的滚动。
|
|
30
|
+
* `reveal` 松手后停在打开的位置,长拖或甩动触发最外侧。
|
|
31
|
+
* `commit` 松手越过阈值就滑出并触发最外侧,没有停住的状态。
|
|
32
|
+
*/
|
|
33
|
+
function useItemSwipe(options) {
|
|
34
|
+
const phase = ref("idle");
|
|
35
|
+
let pointerId = null;
|
|
36
|
+
let originX = 0;
|
|
37
|
+
let originY = 0;
|
|
38
|
+
let claimed = null;
|
|
39
|
+
let direction = 1;
|
|
40
|
+
let lastX = 0;
|
|
41
|
+
let lastTime = 0;
|
|
42
|
+
let velocity = 0;
|
|
43
|
+
let suppressClick = false;
|
|
44
|
+
let settleTimer;
|
|
45
|
+
function write(travel, duration) {
|
|
46
|
+
const root = options.root.value;
|
|
47
|
+
if (!root) return;
|
|
48
|
+
root.style.setProperty("--_item-swipe-dir", String(direction));
|
|
49
|
+
root.style.setProperty("--_item-swipe-travel", String(travel));
|
|
50
|
+
root.style.setProperty("--_item-swipe-duration", duration);
|
|
51
|
+
}
|
|
52
|
+
function panelWidth(side) {
|
|
53
|
+
return (options.root.value?.querySelector(`[data-side="${side}"]`))?.offsetWidth || 72;
|
|
54
|
+
}
|
|
55
|
+
function clearSettle() {
|
|
56
|
+
if (settleTimer != null) clearTimeout(settleTimer);
|
|
57
|
+
settleTimer = void 0;
|
|
58
|
+
}
|
|
59
|
+
function springTo(travel, next) {
|
|
60
|
+
clearSettle();
|
|
61
|
+
phase.value = "settling";
|
|
62
|
+
write(travel, `${SETTLE_MS}ms`);
|
|
63
|
+
settleTimer = setTimeout(() => {
|
|
64
|
+
phase.value = next;
|
|
65
|
+
if (next === "idle") write(0, "0s");
|
|
66
|
+
}, SETTLE_MS);
|
|
67
|
+
}
|
|
68
|
+
function stopTracking() {
|
|
69
|
+
pointerId = null;
|
|
70
|
+
claimed = null;
|
|
71
|
+
if (typeof document !== "undefined") {
|
|
72
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
73
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
74
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function onPointerMove(event) {
|
|
78
|
+
if (event.pointerId !== pointerId) return;
|
|
79
|
+
const dx = event.clientX - originX;
|
|
80
|
+
const dy = event.clientY - originY;
|
|
81
|
+
if (claimed == null) {
|
|
82
|
+
if (Math.abs(dx) < AXIS_LOCK_PX && Math.abs(dy) < AXIS_LOCK_PX) return;
|
|
83
|
+
if (Math.abs(dy) > Math.abs(dx)) {
|
|
84
|
+
stopTracking();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
claimed = true;
|
|
88
|
+
phase.value = "dragging";
|
|
89
|
+
write(0, "0s");
|
|
90
|
+
}
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
const now = event.timeStamp;
|
|
93
|
+
if (lastTime > 0) velocity = (event.clientX - lastX) / Math.max(1, now - lastTime);
|
|
94
|
+
lastX = event.clientX;
|
|
95
|
+
lastTime = now;
|
|
96
|
+
let logical = dx * direction;
|
|
97
|
+
if (logical > 0 && options.leading.value.length === 0) logical = 0;
|
|
98
|
+
if (logical < 0 && options.trailing.value.length === 0) logical = 0;
|
|
99
|
+
const limit = panelWidth(logical >= 0 ? "leading" : "trailing");
|
|
100
|
+
const distance = Math.abs(logical);
|
|
101
|
+
const resisted = distance > limit ? limit + (distance - limit) * .35 : distance;
|
|
102
|
+
write(Math.sign(logical || 1) * resisted, "0s");
|
|
103
|
+
}
|
|
104
|
+
function currentTravel() {
|
|
105
|
+
const raw = options.root.value?.style.getPropertyValue("--_item-swipe-travel");
|
|
106
|
+
return Number(raw) || 0;
|
|
107
|
+
}
|
|
108
|
+
function actionsFor(side) {
|
|
109
|
+
return side === "leading" ? options.leading.value : options.trailing.value;
|
|
110
|
+
}
|
|
111
|
+
function finish(event) {
|
|
112
|
+
if (event.pointerId !== pointerId) return;
|
|
113
|
+
const travel = currentTravel();
|
|
114
|
+
const didDrag = claimed === true;
|
|
115
|
+
stopTracking();
|
|
116
|
+
if (!didDrag) return;
|
|
117
|
+
suppressClick = true;
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
suppressClick = false;
|
|
120
|
+
}, 400);
|
|
121
|
+
const side = travel >= 0 ? "leading" : "trailing";
|
|
122
|
+
const actions = actionsFor(side);
|
|
123
|
+
const outermost = actions[actions.length - 1];
|
|
124
|
+
const distance = Math.abs(travel);
|
|
125
|
+
const width = panelWidth(side);
|
|
126
|
+
const rowWidth = options.root.value?.offsetWidth ?? width;
|
|
127
|
+
const logicalVelocity = velocity * direction;
|
|
128
|
+
const flung = Math.sign(logicalVelocity) === Math.sign(travel) && Math.abs(logicalVelocity) > FLING_VELOCITY && distance > FLING_MIN_PX;
|
|
129
|
+
if (options.behavior.value === "commit") {
|
|
130
|
+
if ((distance >= Math.max(width + COMMIT_PAST_PX, rowWidth * COMMIT_FRACTION) || flung) && outermost && !outermost.isDisabled) {
|
|
131
|
+
outermost.onActivate();
|
|
132
|
+
springTo(Math.sign(travel || 1) * (rowWidth + OVERSHOOT_PX), outermost.hasRemoval ? "held" : "idle");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
springTo(0, "idle");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (flung && outermost && !outermost.isDisabled && distance > width) {
|
|
139
|
+
outermost.onActivate();
|
|
140
|
+
springTo(Math.sign(travel || 1) * (rowWidth + OVERSHOOT_PX), outermost.hasRemoval ? "held" : "idle");
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (distance >= width * REST_FRACTION) springTo(Math.sign(travel || 1) * width, "resting");
|
|
144
|
+
else springTo(0, "idle");
|
|
145
|
+
}
|
|
146
|
+
function onPointerUp(event) {
|
|
147
|
+
finish(event);
|
|
148
|
+
}
|
|
149
|
+
function onPointerCancel(event) {
|
|
150
|
+
if (event.pointerId !== pointerId) return;
|
|
151
|
+
stopTracking();
|
|
152
|
+
springTo(0, "idle");
|
|
153
|
+
}
|
|
154
|
+
function onPointerDown(event) {
|
|
155
|
+
if (!options.enabled.value || event.pointerType !== "touch" || phase.value === "held") return;
|
|
156
|
+
const target = event.target;
|
|
157
|
+
if (target instanceof Element && target.closest("button, a, input, textarea, select")) return;
|
|
158
|
+
pointerId = event.pointerId;
|
|
159
|
+
originX = event.clientX;
|
|
160
|
+
originY = event.clientY;
|
|
161
|
+
lastX = event.clientX;
|
|
162
|
+
lastTime = event.timeStamp;
|
|
163
|
+
velocity = 0;
|
|
164
|
+
claimed = null;
|
|
165
|
+
direction = getComputedStyle(options.root.value ?? document.documentElement).direction === "rtl" ? -1 : 1;
|
|
166
|
+
document.addEventListener("pointermove", onPointerMove);
|
|
167
|
+
document.addEventListener("pointerup", onPointerUp);
|
|
168
|
+
document.addEventListener("pointercancel", onPointerCancel);
|
|
169
|
+
}
|
|
170
|
+
function onClickCapture(event) {
|
|
171
|
+
if (!suppressClick) return;
|
|
172
|
+
const target = event.target;
|
|
173
|
+
if (target instanceof Element && target.closest(".astryx-item__swipe-action")) return;
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
event.stopPropagation();
|
|
176
|
+
}
|
|
177
|
+
function onKeyDown(event) {
|
|
178
|
+
if (event.key === "Escape" && (phase.value === "resting" || phase.value === "dragging")) springTo(0, "idle");
|
|
179
|
+
}
|
|
180
|
+
function activate(action) {
|
|
181
|
+
if (action.isDisabled) return;
|
|
182
|
+
action.onActivate();
|
|
183
|
+
if (action.hasRemoval) {
|
|
184
|
+
const rowWidth = options.root.value?.offsetWidth ?? 0;
|
|
185
|
+
const travel = currentTravel();
|
|
186
|
+
springTo(Math.sign(travel || 1) * (rowWidth + OVERSHOOT_PX), "held");
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
springTo(0, "idle");
|
|
190
|
+
}
|
|
191
|
+
onBeforeUnmount(() => {
|
|
192
|
+
stopTracking();
|
|
193
|
+
clearSettle();
|
|
194
|
+
});
|
|
195
|
+
return {
|
|
196
|
+
phase,
|
|
197
|
+
onPointerDown,
|
|
198
|
+
onClickCapture,
|
|
199
|
+
onKeyDown,
|
|
200
|
+
activate
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/List/Item.vue
|
|
205
|
+
const _hoisted_1 = ["inert"];
|
|
206
|
+
const _hoisted_2 = [
|
|
207
|
+
"data-variant",
|
|
208
|
+
"disabled",
|
|
209
|
+
"onClick"
|
|
210
|
+
];
|
|
211
|
+
const _hoisted_3 = ["inert"];
|
|
212
|
+
const _hoisted_4 = [
|
|
213
|
+
"data-variant",
|
|
214
|
+
"disabled",
|
|
215
|
+
"onClick"
|
|
216
|
+
];
|
|
217
|
+
const _hoisted_5 = {
|
|
218
|
+
key: 1,
|
|
219
|
+
class: "astryx-item__surface"
|
|
220
|
+
};
|
|
221
|
+
const _hoisted_6 = {
|
|
222
|
+
key: 0,
|
|
223
|
+
class: "astryx-item__start"
|
|
224
|
+
};
|
|
225
|
+
const _hoisted_7 = {
|
|
226
|
+
key: 1,
|
|
227
|
+
class: "astryx-item__end"
|
|
228
|
+
};
|
|
229
|
+
const _hoisted_8 = {
|
|
230
|
+
key: 0,
|
|
231
|
+
class: "astryx-item__start"
|
|
232
|
+
};
|
|
233
|
+
const _hoisted_9 = {
|
|
234
|
+
key: 1,
|
|
235
|
+
class: "astryx-item__end"
|
|
236
|
+
};
|
|
237
|
+
const NATIVE_CONTROL_SELECTOR = "button, a, input, select, textarea";
|
|
238
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
239
|
+
name: "AstryxItem",
|
|
240
|
+
inheritAttrs: false,
|
|
241
|
+
__name: "Item",
|
|
242
|
+
props: {
|
|
243
|
+
as: { default: "div" },
|
|
244
|
+
align: { default: "center" },
|
|
245
|
+
layout: { default: "stacked" },
|
|
246
|
+
labelLines: {},
|
|
247
|
+
descriptionLines: {},
|
|
248
|
+
isHighlighted: {
|
|
249
|
+
type: Boolean,
|
|
250
|
+
default: false
|
|
251
|
+
},
|
|
252
|
+
label: {},
|
|
253
|
+
description: {},
|
|
254
|
+
density: { default: "balanced" },
|
|
255
|
+
onClick: {},
|
|
256
|
+
interactiveRef: {},
|
|
257
|
+
href: {},
|
|
258
|
+
target: {},
|
|
259
|
+
rel: {},
|
|
260
|
+
isDisabled: {
|
|
261
|
+
type: Boolean,
|
|
262
|
+
default: false
|
|
263
|
+
},
|
|
264
|
+
isSelected: {
|
|
265
|
+
type: Boolean,
|
|
266
|
+
default: false
|
|
267
|
+
},
|
|
268
|
+
swipeActions: {},
|
|
269
|
+
swipeBehavior: {}
|
|
270
|
+
},
|
|
271
|
+
setup(__props, { expose: __expose }) {
|
|
272
|
+
const props = __props;
|
|
273
|
+
const ARIA_SELECTED_ROLES = /* @__PURE__ */ new Set([
|
|
274
|
+
"option",
|
|
275
|
+
"tab",
|
|
276
|
+
"row",
|
|
277
|
+
"gridcell",
|
|
278
|
+
"columnheader",
|
|
279
|
+
"rowheader",
|
|
280
|
+
"treeitem"
|
|
281
|
+
]);
|
|
282
|
+
const INTERACTIVE_SELECTOR = [
|
|
283
|
+
"button",
|
|
284
|
+
"a",
|
|
285
|
+
"input",
|
|
286
|
+
"select",
|
|
287
|
+
"textarea",
|
|
288
|
+
"[role=\"button\"]",
|
|
289
|
+
"[role=\"link\"]",
|
|
290
|
+
"[role=\"checkbox\"]",
|
|
291
|
+
"[role=\"radio\"]",
|
|
292
|
+
"[role=\"switch\"]",
|
|
293
|
+
"[role=\"tab\"]",
|
|
294
|
+
"[role=\"menuitem\"]",
|
|
295
|
+
"[role=\"option\"]",
|
|
296
|
+
"[role=\"combobox\"]",
|
|
297
|
+
"[role=\"listbox\"]",
|
|
298
|
+
"[role=\"slider\"]",
|
|
299
|
+
"[role=\"spinbutton\"]"
|
|
300
|
+
].join(",");
|
|
301
|
+
const CONTROLLED_ATTRS = /* @__PURE__ */ new Set([
|
|
302
|
+
"class",
|
|
303
|
+
"style",
|
|
304
|
+
"role",
|
|
305
|
+
"aria-current",
|
|
306
|
+
"aria-disabled",
|
|
307
|
+
"aria-selected"
|
|
308
|
+
]);
|
|
309
|
+
const attrs = useAttrs();
|
|
310
|
+
const slots = useSlots();
|
|
311
|
+
const root = useTemplateRef("root");
|
|
312
|
+
function isRenderable(value) {
|
|
313
|
+
return value != null && value !== "";
|
|
314
|
+
}
|
|
315
|
+
function isInteractiveElement(element) {
|
|
316
|
+
return element.matches(INTERACTIVE_SELECTOR) && !element.matches("[aria-readonly=\"true\"]");
|
|
317
|
+
}
|
|
318
|
+
function toElement(value) {
|
|
319
|
+
if (value == null) return null;
|
|
320
|
+
if (value instanceof HTMLElement) return value;
|
|
321
|
+
return value.$el instanceof HTMLElement ? value.$el : null;
|
|
322
|
+
}
|
|
323
|
+
const element = computed(() => toElement(root.value));
|
|
324
|
+
const descriptionIdBase = `astryx-item-description-${useId()}`;
|
|
325
|
+
const hasDescription = computed(() => slots.description != null || isRenderable(props.description));
|
|
326
|
+
const hasLabel = computed(() => slots.label != null || isRenderable(props.label));
|
|
327
|
+
provide(itemDescriptionContextKey, computed(() => hasDescription.value ? descriptionIdBase : null));
|
|
328
|
+
const role = computed(() => attrs.role);
|
|
329
|
+
const hasParentRole = computed(() => role.value != null);
|
|
330
|
+
const allowsAriaSelected = computed(() => role.value != null && ARIA_SELECTED_ROLES.has(role.value));
|
|
331
|
+
const ariaCurrent = computed(() => attrs["aria-current"] ?? (props.isSelected && !allowsAriaSelected.value ? true : void 0));
|
|
332
|
+
const isDelegate = computed(() => props.interactiveRef != null);
|
|
333
|
+
const isInteractive = computed(() => props.onClick != null || props.href != null || isDelegate.value);
|
|
334
|
+
const isLinkRoot = computed(() => typeof props.as !== "string" && props.href != null);
|
|
335
|
+
const resolvedTarget = computed(() => props.target);
|
|
336
|
+
const resolvedRel = computed(() => {
|
|
337
|
+
const tokens = new Set((props.rel ?? "").split(/\s+/).filter(Boolean));
|
|
338
|
+
if (resolvedTarget.value === "_blank") {
|
|
339
|
+
tokens.add("noopener");
|
|
340
|
+
tokens.add("noreferrer");
|
|
341
|
+
}
|
|
342
|
+
return tokens.size > 0 ? [...tokens].join(" ") : void 0;
|
|
343
|
+
});
|
|
344
|
+
const isInline = computed(() => props.layout === "inline" && hasDescription.value);
|
|
345
|
+
function clampClass(lines) {
|
|
346
|
+
if (lines === 1) return "astryx-item__ellipsis";
|
|
347
|
+
return lines > 1 ? "astryx-item__clamp" : void 0;
|
|
348
|
+
}
|
|
349
|
+
function clampStyle(lines) {
|
|
350
|
+
return lines > 1 ? { "--astryx-item-clamp-lines": String(lines) } : void 0;
|
|
351
|
+
}
|
|
352
|
+
const labelClamp = computed(() => props.labelLines ?? (typeof props.label === "string" ? 1 : 0));
|
|
353
|
+
const descriptionClamp = computed(() => {
|
|
354
|
+
if (props.descriptionLines != null) return props.descriptionLines;
|
|
355
|
+
return typeof props.description === "string" || isInline.value ? 1 : 0;
|
|
356
|
+
});
|
|
357
|
+
const labelClasses = computed(() => clampClass(labelClamp.value));
|
|
358
|
+
const labelStyle = computed(() => clampStyle(labelClamp.value));
|
|
359
|
+
const descriptionClasses = computed(() => clampClass(descriptionClamp.value));
|
|
360
|
+
const descriptionStyle = computed(() => clampStyle(descriptionClamp.value));
|
|
361
|
+
const contentTag = computed(() => {
|
|
362
|
+
if (hasParentRole.value || isDelegate.value) return "span";
|
|
363
|
+
if (props.href != null && !isLinkRoot.value) return "a";
|
|
364
|
+
return props.onClick != null ? "button" : "span";
|
|
365
|
+
});
|
|
366
|
+
function handleContentClick(event) {
|
|
367
|
+
props.onClick?.(event);
|
|
368
|
+
}
|
|
369
|
+
const contentAttrs = computed(() => {
|
|
370
|
+
if (contentTag.value === "a") return {
|
|
371
|
+
"href": props.href,
|
|
372
|
+
"rel": resolvedRel.value,
|
|
373
|
+
"target": resolvedTarget.value,
|
|
374
|
+
"aria-disabled": props.isDisabled || void 0,
|
|
375
|
+
"tabindex": props.isDisabled ? -1 : void 0
|
|
376
|
+
};
|
|
377
|
+
if (contentTag.value === "button") return {
|
|
378
|
+
type: "button",
|
|
379
|
+
disabled: props.isDisabled,
|
|
380
|
+
onClick: handleContentClick
|
|
381
|
+
};
|
|
382
|
+
return {};
|
|
383
|
+
});
|
|
384
|
+
function hasTextSelection(node) {
|
|
385
|
+
const selection = node.ownerDocument.getSelection?.();
|
|
386
|
+
return selection != null && !selection.isCollapsed && selection.anchorNode != null && node.contains(selection.anchorNode);
|
|
387
|
+
}
|
|
388
|
+
function hasInteractiveAncestor(target, container) {
|
|
389
|
+
let current = target;
|
|
390
|
+
while (current != null && current !== container && current !== container.ownerDocument.body) {
|
|
391
|
+
if (isInteractiveElement(current)) return true;
|
|
392
|
+
current = current.parentElement;
|
|
393
|
+
}
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
function handleContainerClick(event) {
|
|
397
|
+
if (props.isDisabled) return;
|
|
398
|
+
const target = event.target;
|
|
399
|
+
if (target instanceof HTMLElement && target.closest(NATIVE_CONTROL_SELECTOR) != null) return;
|
|
400
|
+
props.onClick?.(event);
|
|
401
|
+
}
|
|
402
|
+
function handleDelegatedClick(event) {
|
|
403
|
+
if (props.isDisabled) return;
|
|
404
|
+
const container = element.value;
|
|
405
|
+
const target = event.target;
|
|
406
|
+
if (container == null || !(target instanceof HTMLElement)) return;
|
|
407
|
+
if (hasTextSelection(container)) return;
|
|
408
|
+
if (target !== event.currentTarget && hasInteractiveAncestor(target, container)) return;
|
|
409
|
+
const control = toValue(props.interactiveRef);
|
|
410
|
+
if (control == null) return;
|
|
411
|
+
control.dispatchEvent(new MouseEvent("click", {
|
|
412
|
+
altKey: event.altKey,
|
|
413
|
+
bubbles: event.bubbles,
|
|
414
|
+
button: event.button,
|
|
415
|
+
cancelable: event.cancelable,
|
|
416
|
+
ctrlKey: event.ctrlKey,
|
|
417
|
+
metaKey: event.metaKey,
|
|
418
|
+
shiftKey: event.shiftKey
|
|
419
|
+
}));
|
|
420
|
+
event.stopPropagation();
|
|
421
|
+
}
|
|
422
|
+
const SWIPE_BLOCKED_ROLES = /* @__PURE__ */ new Set([
|
|
423
|
+
"option",
|
|
424
|
+
"menuitem",
|
|
425
|
+
"menuitemcheckbox",
|
|
426
|
+
"menuitemradio"
|
|
427
|
+
]);
|
|
428
|
+
const swipeBehavior = computed(() => props.swipeBehavior ?? "reveal");
|
|
429
|
+
const leadingActions = computed(() => {
|
|
430
|
+
const actions = props.swipeActions?.leading ?? [];
|
|
431
|
+
return swipeBehavior.value === "commit" ? actions.slice(-1) : actions;
|
|
432
|
+
});
|
|
433
|
+
const trailingActions = computed(() => {
|
|
434
|
+
const actions = props.swipeActions?.trailing ?? [];
|
|
435
|
+
return swipeBehavior.value === "commit" ? actions.slice(-1) : actions;
|
|
436
|
+
});
|
|
437
|
+
const swipeEnabled = computed(() => {
|
|
438
|
+
if (props.isDisabled || isDelegate.value) return false;
|
|
439
|
+
if (role.value != null && SWIPE_BLOCKED_ROLES.has(role.value)) return false;
|
|
440
|
+
return leadingActions.value.length + trailingActions.value.length > 0;
|
|
441
|
+
});
|
|
442
|
+
const swipe = useItemSwipe({
|
|
443
|
+
root: element,
|
|
444
|
+
enabled: swipeEnabled,
|
|
445
|
+
behavior: swipeBehavior,
|
|
446
|
+
leading: leadingActions,
|
|
447
|
+
trailing: trailingActions
|
|
448
|
+
});
|
|
449
|
+
const rootClick = computed(() => {
|
|
450
|
+
if (isDelegate.value) return handleDelegatedClick;
|
|
451
|
+
if (hasParentRole.value) return props.onClick;
|
|
452
|
+
return isInteractive.value ? handleContainerClick : void 0;
|
|
453
|
+
});
|
|
454
|
+
const rootClass = computed(() => [
|
|
455
|
+
"astryx-item",
|
|
456
|
+
swipeEnabled.value && "astryx-item--swipe",
|
|
457
|
+
attrs.class
|
|
458
|
+
]);
|
|
459
|
+
const forwardedAttrs = computed(() => Object.fromEntries(Object.entries(attrs).filter(([key]) => !CONTROLLED_ATTRS.has(key))));
|
|
460
|
+
function focus(options) {
|
|
461
|
+
(element.value?.querySelector("a[href], button:not([disabled])"))?.focus(options);
|
|
462
|
+
}
|
|
463
|
+
function blur() {
|
|
464
|
+
const active = element.value?.ownerDocument.activeElement;
|
|
465
|
+
if (active instanceof HTMLElement && element.value?.contains(active)) active.blur();
|
|
466
|
+
}
|
|
467
|
+
__expose({
|
|
468
|
+
element,
|
|
469
|
+
focus,
|
|
470
|
+
blur
|
|
471
|
+
});
|
|
472
|
+
return (_ctx, _cache) => {
|
|
473
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps({
|
|
474
|
+
ref_key: "root",
|
|
475
|
+
ref: root
|
|
476
|
+
}, forwardedAttrs.value, {
|
|
477
|
+
"aria-current": ariaCurrent.value,
|
|
478
|
+
"aria-disabled": __props.isDisabled || void 0,
|
|
479
|
+
"aria-selected": allowsAriaSelected.value && __props.isSelected ? true : void 0,
|
|
480
|
+
class: rootClass.value,
|
|
481
|
+
"data-align": __props.align,
|
|
482
|
+
"data-density": __props.density,
|
|
483
|
+
"data-disabled": __props.isDisabled || void 0,
|
|
484
|
+
"data-highlighted": __props.isHighlighted || void 0,
|
|
485
|
+
"data-inert": __props.isDisabled && !hasParentRole.value ? true : void 0,
|
|
486
|
+
"data-interactive": isInteractive.value || void 0,
|
|
487
|
+
"data-selected": __props.isSelected || void 0,
|
|
488
|
+
"data-swipe": swipeEnabled.value ? unref(swipe).phase.value : void 0,
|
|
489
|
+
role: role.value,
|
|
490
|
+
style: unref(attrs).style,
|
|
491
|
+
onPointerdown: unref(swipe).onPointerDown,
|
|
492
|
+
onClickCapture: unref(swipe).onClickCapture,
|
|
493
|
+
onKeydown: unref(swipe).onKeyDown,
|
|
494
|
+
onClick: rootClick.value
|
|
495
|
+
}), {
|
|
496
|
+
default: withCtx(() => [swipeEnabled.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [leadingActions.value.length ? (openBlock(), createElementBlock("div", {
|
|
497
|
+
key: 0,
|
|
498
|
+
class: "astryx-item__swipe-panel",
|
|
499
|
+
"data-side": "leading",
|
|
500
|
+
inert: unref(swipe).phase.value === "resting" ? void 0 : true
|
|
501
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(leadingActions.value, (action) => {
|
|
502
|
+
return openBlock(), createElementBlock("button", {
|
|
503
|
+
key: action.id ?? action.label,
|
|
504
|
+
type: "button",
|
|
505
|
+
class: "astryx-item__swipe-action",
|
|
506
|
+
"data-variant": action.variant ?? "neutral",
|
|
507
|
+
disabled: action.isDisabled,
|
|
508
|
+
onClick: withModifiers(($event) => unref(swipe).activate(action), ["stop"])
|
|
509
|
+
}, [action.icon ? (openBlock(), createBlock(resolveDynamicComponent(action.icon), {
|
|
510
|
+
key: 0,
|
|
511
|
+
"aria-hidden": "true"
|
|
512
|
+
})) : createCommentVNode("v-if", true), createElementVNode("span", null, toDisplayString(action.label), 1)], 8, _hoisted_2);
|
|
513
|
+
}), 128))], 8, _hoisted_1)) : createCommentVNode("v-if", true), trailingActions.value.length ? (openBlock(), createElementBlock("div", {
|
|
514
|
+
key: 1,
|
|
515
|
+
class: "astryx-item__swipe-panel",
|
|
516
|
+
"data-side": "trailing",
|
|
517
|
+
inert: unref(swipe).phase.value === "resting" ? void 0 : true
|
|
518
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(trailingActions.value, (action) => {
|
|
519
|
+
return openBlock(), createElementBlock("button", {
|
|
520
|
+
key: action.id ?? action.label,
|
|
521
|
+
type: "button",
|
|
522
|
+
class: "astryx-item__swipe-action",
|
|
523
|
+
"data-variant": action.variant ?? "neutral",
|
|
524
|
+
disabled: action.isDisabled,
|
|
525
|
+
onClick: withModifiers(($event) => unref(swipe).activate(action), ["stop"])
|
|
526
|
+
}, [action.icon ? (openBlock(), createBlock(resolveDynamicComponent(action.icon), {
|
|
527
|
+
key: 0,
|
|
528
|
+
"aria-hidden": "true"
|
|
529
|
+
})) : createCommentVNode("v-if", true), createElementVNode("span", null, toDisplayString(action.label), 1)], 8, _hoisted_4);
|
|
530
|
+
}), 128))], 8, _hoisted_3)) : createCommentVNode("v-if", true)], 64)) : createCommentVNode("v-if", true), swipeEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
531
|
+
renderSlot(_ctx.$slots, "marker"),
|
|
532
|
+
_ctx.$slots.startContent ? (openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "startContent")])) : createCommentVNode("v-if", true),
|
|
533
|
+
(openBlock(), createBlock(resolveDynamicComponent(contentTag.value), mergeProps(contentAttrs.value, { class: ["astryx-item__content", { "astryx-item__content--inline": isInline.value }] }), {
|
|
534
|
+
default: withCtx(() => [hasLabel.value ? (openBlock(), createElementBlock("span", {
|
|
535
|
+
key: 0,
|
|
536
|
+
class: normalizeClass(["astryx-item__label", labelClasses.value]),
|
|
537
|
+
style: normalizeStyle(labelStyle.value)
|
|
538
|
+
}, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 6)) : createCommentVNode("v-if", true), hasDescription.value ? (openBlock(), createElementBlock("span", {
|
|
539
|
+
key: 1,
|
|
540
|
+
id: descriptionIdBase,
|
|
541
|
+
class: normalizeClass(["astryx-item__description", descriptionClasses.value]),
|
|
542
|
+
style: normalizeStyle(descriptionStyle.value)
|
|
543
|
+
}, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])], 6)) : createCommentVNode("v-if", true)]),
|
|
544
|
+
_: 3
|
|
545
|
+
}, 16, ["class"])),
|
|
546
|
+
_ctx.$slots.endContent ? (openBlock(), createElementBlock("span", _hoisted_7, [renderSlot(_ctx.$slots, "endContent")])) : createCommentVNode("v-if", true)
|
|
547
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
548
|
+
renderSlot(_ctx.$slots, "marker"),
|
|
549
|
+
_ctx.$slots.startContent ? (openBlock(), createElementBlock("span", _hoisted_8, [renderSlot(_ctx.$slots, "startContent")])) : createCommentVNode("v-if", true),
|
|
550
|
+
(openBlock(), createBlock(resolveDynamicComponent(contentTag.value), mergeProps(contentAttrs.value, { class: ["astryx-item__content", { "astryx-item__content--inline": isInline.value }] }), {
|
|
551
|
+
default: withCtx(() => [hasLabel.value ? (openBlock(), createElementBlock("span", {
|
|
552
|
+
key: 0,
|
|
553
|
+
class: normalizeClass(["astryx-item__label", labelClasses.value]),
|
|
554
|
+
style: normalizeStyle(labelStyle.value)
|
|
555
|
+
}, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 6)) : createCommentVNode("v-if", true), hasDescription.value ? (openBlock(), createElementBlock("span", {
|
|
556
|
+
key: 1,
|
|
557
|
+
id: descriptionIdBase,
|
|
558
|
+
class: normalizeClass(["astryx-item__description", descriptionClasses.value]),
|
|
559
|
+
style: normalizeStyle(descriptionStyle.value)
|
|
560
|
+
}, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])], 6)) : createCommentVNode("v-if", true)]),
|
|
561
|
+
_: 3
|
|
562
|
+
}, 16, ["class"])),
|
|
563
|
+
_ctx.$slots.endContent ? (openBlock(), createElementBlock("span", _hoisted_9, [renderSlot(_ctx.$slots, "endContent")])) : createCommentVNode("v-if", true)
|
|
564
|
+
], 64))]),
|
|
565
|
+
_: 3
|
|
566
|
+
}, 16, [
|
|
567
|
+
"aria-current",
|
|
568
|
+
"aria-disabled",
|
|
569
|
+
"aria-selected",
|
|
570
|
+
"class",
|
|
571
|
+
"data-align",
|
|
572
|
+
"data-density",
|
|
573
|
+
"data-disabled",
|
|
574
|
+
"data-highlighted",
|
|
575
|
+
"data-inert",
|
|
576
|
+
"data-interactive",
|
|
577
|
+
"data-selected",
|
|
578
|
+
"data-swipe",
|
|
579
|
+
"role",
|
|
580
|
+
"style",
|
|
581
|
+
"onPointerdown",
|
|
582
|
+
"onClickCapture",
|
|
583
|
+
"onKeydown",
|
|
584
|
+
"onClick"
|
|
585
|
+
]);
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
//#endregion
|
|
590
|
+
export { useListContext as i, listContextKey as n, useItemDescriptionId as r, _sfc_main as t };
|
package/dist/Lightbox/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _sfc_main, t as useLightbox } from "../Lightbox-
|
|
1
|
+
import { n as _sfc_main, t as useLightbox } from "../Lightbox-Br3o0SyQ.js";
|
|
2
2
|
export { _sfc_main as Lightbox, useLightbox };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as useAnnounce } from "./announce-Cnio10Wk.js";
|
|
2
|
+
import { o as useAstryxMessages } from "./context-CPh7kE-a.js";
|
|
2
3
|
import { t as useScrollLock } from "./scrollLock-BzIvIimL.js";
|
|
3
|
-
import { a as useAstryxMessages } from "./context-DmOLCubj.js";
|
|
4
4
|
import { t as _sfc_main$1 } from "./IconButton-BNQuz9W_.js";
|
|
5
5
|
import { t as _sfc_main$2 } from "./Icon-bteSId7T.js";
|
|
6
6
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, toDisplayString, toRef, unref, useTemplateRef, watch, withCtx } from "vue";
|
package/dist/Link/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
1
|
+
import { a as LinkWeight, i as LinkSize, n as LinkProps, r as LinkRoot, t as LinkColor } from "../types-D_J66aPN.js";
|
|
2
|
+
import { t as _default } from "../index-BBtJt5_A.js";
|
|
3
|
+
export { _default as Link, type LinkColor, type LinkProps, type LinkRoot, type LinkSize, type LinkWeight };
|
package/dist/Link/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _sfc_main } from "../Link-
|
|
1
|
+
import { t as _sfc_main } from "../Link-DCZ6922-.js";
|
|
2
2
|
export { _sfc_main as Link };
|