@astryx-vue/core 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +2 -0
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-Cb41gIAj.js → AppShell-Dd-D4bA2.js} +2 -2
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.d.ts +3 -2
- package/dist/Breadcrumbs/index.js +3 -2
- package/dist/{Breadcrumbs-CTQ7fjDn.js → Breadcrumbs-CWGfgLNK.js} +13 -8
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +2 -2
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar-CnOsSjMY.js +656 -0
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-X0cuQkvg.js → Carousel-JA7ilqI_.js} +2 -2
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-M0tiGrNT.js → Chat-C7WrCOE4.js} +3 -3
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/CheckboxIndicator-D37cm2Rh.js +68 -0
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-CMsEE1_4.js → CheckboxInput-25Q8ItH-.js} +10 -9
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-BbCPiend.js → CheckboxList-CnCGnkZk.js} +77 -24
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-C1veUk5p.js → Citation-CtwrU33I.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.d.ts +1 -1
- package/dist/Code/index.js +2 -2
- package/dist/{Code-yb_KOFtJ.js → Code-BvefYRpx.js} +2 -1
- package/dist/{CodeBlock-DesTJAkm.js → CodeBlock-BZGzYeoL.js} +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-BestK35V.js → Collapsible-3YerR-FO.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BArt97V8.js → CommandPalette-BNbM9T9y.js} +1 -1
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-CAoig1RK.js → ComplexSelector-LtbLlrcj.js} +3 -3
- package/dist/ContextMenu/index.d.ts +3 -2
- package/dist/ContextMenu/index.js +3 -2
- package/dist/{ContextMenu-9Im6i43E.js → ContextMenu-DVQl0xL5.js} +204 -56
- package/dist/DateInput/index.d.ts +2 -2
- package/dist/DateInput/index.js +1 -1
- package/dist/DateInput-zm8sNc0t.js +743 -0
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-DwDy3eRo.js → DateRangeInput-DlVFzrf7.js} +54 -19
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-BYiaC9bn.js → DateTimeInput-C7Z-p6Yd.js} +54 -15
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +3 -3
- package/dist/DropdownMenu/index.js +4 -3
- package/dist/{DropdownMenu-Dh-WAHKb.js → DropdownMenu-BoZChdev.js} +308 -63
- package/dist/DropdownMenu-u1psFjis.js +325 -0
- package/dist/DropdownMenuRadioItem.vue-uVM0FD2f.d.ts +564 -0
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-DLO6V12n.js → FileInput-QdlZn7qK.js} +2 -2
- package/dist/Icon/index.d.ts +4 -3
- package/dist/Icon/index.js +2 -2
- package/dist/{Icon-CJKjdJy-.js → Icon-bteSId7T.js} +113 -18
- package/dist/Indicator/index.d.ts +3 -0
- package/dist/Indicator/index.js +2 -0
- package/dist/InputGroup/index.d.ts +2 -2
- package/dist/InputGroup/index.js +3 -2
- package/dist/InputGroup-BzR6JRZb.js +129 -0
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-CdFCS_EA.js → Lightbox-BSzfqZ-u.js} +2 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-BqKloI3w.js → Markdown-B6tSqenv.js} +8 -5
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-CvZkmisf.js → MetadataList-aN1tRn6W.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-Bwi0qXXM.js → MobileNavToggle-fqcSafkc.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BwJaJrkB.js → MoreMenu-B3brqdK_.js} +1 -1
- package/dist/MultiSelector/index.d.ts +2 -2
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-C-ETfFy_.js → MultiSelector-BD5PMgez.js} +303 -121
- package/dist/{NavDisclosure-DHrSNRDR.js → NavDisclosure-DbYLDXK0.js} +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavMenu/index.js +2 -2
- package/dist/{NavMenuItem-B-k7olt5.js → NavMenuItem-DrwIMHKO.js} +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DjetVB8O.js → NumberInput-CBeU4lEl.js} +1 -1
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-Bz9c-u5y.js → Outline--HVMSB6i.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-ED-KN9Y5.js → OverflowList-FMh7r-r_.js} +3 -3
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-Cb66HMEf.js → Pagination-DlIvESjx.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-Crhk9PNP.js → Popover-D7zqpFwU.js} +1 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-CjU8y4mi.js → PowerSearch-CMG7Rb69.js} +14 -14
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-BqjdSCfJ.js → RadioGroup-CBqUPq_L.js} +16 -8
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-DI8ujXcT.js → RadioList-CPOJn9Th.js} +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-D-TBCg0Y.js → Resizable-CXpvj1TZ.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +2 -2
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-BpPnuWH3.js +618 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-DonEfiAx.js → SideNav-D4TupqgE.js} +3 -3
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-D2ZIcUNx.js → Stepper-H-6-T5Ps.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-D3F-stq-.js → TabList-BlzkrObv.js} +2 -2
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CrP2Uffq.js → Table-nqA_njNz.js} +6 -6
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Theme/index.d.ts +2 -1
- package/dist/Theme/index.js +1 -1
- package/dist/{Theme-BuUiiJNr.js → Theme-CejS9MHm.js} +21 -3
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-BC5JGPGZ.js → Thumbnail-CXb3m_Hv.js} +2 -2
- package/dist/{TimeField-DpHFrNv0.js → TimeField-B3cndWb0.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-DJLV0_4z.js → TimeInput-BHQ_LKGm.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-GKNjjt5g.js → Timestamp-Cfuxbb3i.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-Chu_eCVs.js → Token-CdVLH0_H.js} +2 -2
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-DRDpvQ_l.js → Tokenizer-DlD-S_8-.js} +3 -3
- 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-CEyWddtA.js → TopNav-DzV874G7.js} +5 -5
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-COS8US8e.js → TreeList-DEwvlZRV.js} +2 -2
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-P7cCqtaQ.js → Typeahead-DQ3tmqYe.js} +3 -3
- package/dist/{context-O2Vb8cJl.js → colorMode-CBgdgDSn.js} +1 -7
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +10 -5
- package/dist/{composables-CVfjp9h4.js → composables-DDI08XFF.js} +98 -1
- package/dist/context-Cws_tXTr.js +7 -0
- package/dist/context-D5-MwxnN.js +4 -0
- package/dist/{context-CiKncNSH.js → context-DmOLCubj.js} +82 -8
- package/dist/{index-DimuSES0.d.ts → index-B1x05arQ.d.ts} +3 -1
- package/dist/index-B9f1rUEv.d.ts +77 -0
- package/dist/{index-D-ZuubCK.d.ts → index-BB5yVIN-.d.ts} +2 -2
- package/dist/{index-Bu0Zd1uw.d.ts → index-BMn9ghAX.d.ts} +3 -3
- package/dist/{index-CJlBAXwj.d.ts → index-BRfR0lhb.d.ts} +41 -4
- package/dist/{index-DNRBbwp_.d.ts → index-BTAgQRP0.d.ts} +758 -111
- package/dist/{index-DA52oIdw.d.ts → index-BcJBLWJ0.d.ts} +2 -2
- package/dist/{index-jdjcb3Js.d.ts → index-Bqb_Fyju.d.ts} +2 -2
- package/dist/{index-CNjbOgty.d.ts → index-C-QpeUlQ.d.ts} +2 -2
- package/dist/{index-DGXviOlp.d.ts → index-C2sfHfBw.d.ts} +31 -5
- package/dist/{index-By2mSzUA.d.ts → index-CA6RbRWx.d.ts} +1 -1
- package/dist/{index-gW0HW02U.d.ts → index-COxy6LEW.d.ts} +1 -1
- package/dist/{index-CVn0GBdB.d.ts → index-Ca8VIE4l.d.ts} +1 -1
- package/dist/{index-CRizexSC.d.ts → index-Ch6BbxCP.d.ts} +2 -67
- package/dist/{index-DWH_HzXi.d.ts → index-ChWlKHjc.d.ts} +1 -1
- package/dist/{index-kVhSuA9t.d.ts → index-Ctu32CLv.d.ts} +4 -4
- package/dist/{index-DOUEn7V0.d.ts → index-D1Twv_fL.d.ts} +65 -6
- package/dist/{index-D_nYxnNv.d.ts → index-D7-WTV6I.d.ts} +1 -1
- package/dist/{index-c_TaW8mM.d.ts → index-D8o50qOE.d.ts} +1 -1
- package/dist/{index-D4I_obqR.d.ts → index-DAiGhkNZ.d.ts} +1 -1
- package/dist/{index-Cs5pcwY3.d.ts → index-DMQG6kdM.d.ts} +3 -3
- package/dist/index-D_UEJIU5.d.ts +83 -0
- package/dist/{index-fa72tWIU.d.ts → index-DkVEBdWa.d.ts} +2 -2
- package/dist/{index-B1TG2GPS.d.ts → index-DxsKyAxq.d.ts} +116 -44
- package/dist/{index-BHqRH7QW.d.ts → index-FEy8qFSD.d.ts} +2 -2
- package/dist/{index-qiZtHnGK.d.ts → index-LIyvJTW3.d.ts} +39 -0
- package/dist/{index-BKr7yvVv.d.ts → index-MPcg1Pm4.d.ts} +1 -1
- package/dist/{index-cGagYM1g.d.ts → index-ViSV0RBx.d.ts} +1 -1
- package/dist/{index-C7mxUcDR.d.ts → index-f4NGT-e2.d.ts} +4 -4
- package/dist/{index-DsyKhauk.d.ts → index-foQMNKZO.d.ts} +1 -1
- package/dist/{index-u5ozu0G7.d.ts → index-vP0EtrJJ.d.ts} +13 -3
- package/dist/{index-CZeoAr0a.d.ts → index-xfkEuGLY.d.ts} +2 -2
- package/dist/index.d.ts +76 -75
- package/dist/index.js +115 -107
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +2 -2
- package/dist/{locale-Cpk_nrLA.js → locale-CCwVnyMZ.js} +25 -1
- package/dist/searchResultMessage-DN0HeRRB.js +94 -0
- package/dist/semantic-CKH9XVqa.d.ts +54 -0
- package/dist/{types-pnljWjEE.d.ts → types-CwyibrRB.d.ts} +12 -11
- package/dist/types-jmqqnkKA.d.ts +163 -0
- package/dist/{useAnchoredListbox-7W90Ny-9.js → useAnchoredListbox-BN9LQnon.js} +1 -1
- package/dist/useDatePresentation-C07PnOCw.js +21 -0
- package/dist/{useMonthGrid-CmJsZTcB.js → useDateRange-CIXoE_8k.js} +1 -42
- package/dist/useDisclosureHandle-Df3HhAfC.js +24 -0
- package/dist/{useDismiss-CAiHU6QD.js → useDismiss-Cj8x_51F.js} +8 -4
- package/dist/useFieldControlState-voICDrys.js +18 -0
- package/dist/useHandleRef-6cdKugm8.js +17 -0
- package/dist/useIndicator-i1NORM7W.js +147 -0
- package/dist/useMenuDrillIn-OaEwjK44.js +520 -0
- package/dist/useMonthGrid-fGHSSrFc.js +43 -0
- package/dist/usePendingChange-ib-h8FZK.js +25 -0
- package/dist/useSubmenuMode-CZN9qrUo.js +37 -0
- package/package.json +5 -1
- package/styles/calendar.css +38 -3
- package/styles/check-indicator.css +17 -0
- package/styles/checkbox-indicator.css +29 -10
- package/styles/checkbox-input.css +0 -11
- package/styles/date-input.css +48 -0
- package/styles/dropdown-menu.css +163 -0
- package/styles/field.css +48 -0
- package/styles/icon.css +51 -3
- package/styles/input-group.css +32 -3
- package/styles/multi-selector.css +26 -0
- package/styles/radio-indicator.css +90 -0
- package/styles/radio.css +9 -42
- package/styles/selector.css +112 -14
- package/styles.css +2 -0
- package/dist/Calendar-BFaI5AMv.js +0 -352
- package/dist/CheckboxIndicator-DdJmksHt.js +0 -52
- package/dist/DateInput-BLocxqC3.js +0 -376
- package/dist/DropdownMenu-Ddfr-aEC.js +0 -164
- package/dist/InputGroup-ChrFVxzV.js +0 -42
- package/dist/Selector-DE2IEFML.js +0 -468
- package/dist/index-Bgv4ZmBl.d.ts +0 -72
- package/dist/index-DN7MXPHM.d.ts +0 -398
- package/dist/index-IbUN4M8V.d.ts +0 -40
- package/dist/types-DDAAT1Xd.d.ts +0 -285
- package/dist/useGridRovingFocus-DQQAOYH5.js +0 -99
- /package/dist/{index-BUXNRekN.d.ts → index-BXkNZF3q.d.ts} +0 -0
package/dist/types-DDAAT1Xd.d.ts
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import { a as ButtonProps } from "./types-WlmsNL1I.js";
|
|
2
|
-
import { n as LayerPlacement, t as LayerAlignment } from "./position-DFW5ymAF.js";
|
|
3
|
-
import { c as ItemTarget } from "./types-CAZY4Xua.js";
|
|
4
|
-
import { Component, VNodeChild } from "vue";
|
|
5
|
-
//#region src/DropdownMenu/types.d.ts
|
|
6
|
-
/** Size of the menu, derived from the trigger button's size. */
|
|
7
|
-
type DropdownMenuSize = 'sm' | 'md' | 'lg';
|
|
8
|
-
/**
|
|
9
|
-
* Where the menu opens.
|
|
10
|
-
*
|
|
11
|
-
* `popover` hangs off the trigger. `bottom-sheet` rises from the bottom edge.
|
|
12
|
-
* `adaptive` uses the sheet only on a compact touch surface.
|
|
13
|
-
*/
|
|
14
|
-
type DropdownMenuPresentation = 'adaptive' | 'bottom-sheet' | 'popover';
|
|
15
|
-
/** Visual variant of one menu row. */
|
|
16
|
-
type DropdownMenuItemVariant = 'default' | 'destructive';
|
|
17
|
-
/**
|
|
18
|
-
* The trigger button's properties.
|
|
19
|
-
*
|
|
20
|
-
* Every `Button` prop is accepted except `clickAction`, which would compete
|
|
21
|
-
* with the menu for the trigger's click. Hover and pressed paint stay the
|
|
22
|
-
* Button's own; the open state is exposed to CSS as `[data-open='true']` on the
|
|
23
|
-
* trigger wrapper.
|
|
24
|
-
*/
|
|
25
|
-
type DropdownMenuButtonProps = Omit<ButtonProps, 'clickAction'>;
|
|
26
|
-
/**
|
|
27
|
-
* The wiring a custom trigger spreads onto the control that opens the menu.
|
|
28
|
-
*
|
|
29
|
-
* These keys are already written in the attribute form the DOM wants, so
|
|
30
|
-
* `v-bind` them wholesale onto the control. The menu is then named by that
|
|
31
|
-
* control through `aria-labelledby`.
|
|
32
|
-
*/
|
|
33
|
-
interface DropdownMenuTriggerProps {
|
|
34
|
-
/** The control's id; the menu points at it with `aria-labelledby`. */
|
|
35
|
-
'id': string;
|
|
36
|
-
'aria-haspopup': 'menu';
|
|
37
|
-
'aria-expanded': boolean;
|
|
38
|
-
'aria-controls': string;
|
|
39
|
-
/** Toggles the menu. */
|
|
40
|
-
'onClick': (event: MouseEvent) => void;
|
|
41
|
-
/** Opens on Enter, Space, ArrowDown and ArrowUp; while open, ArrowDown walks into the menu. */
|
|
42
|
-
'onKeyDown': (event: KeyboardEvent) => void;
|
|
43
|
-
}
|
|
44
|
-
/** One action row of the `items` data API. */
|
|
45
|
-
interface DropdownMenuItemData {
|
|
46
|
-
/**
|
|
47
|
-
* Stable identity for the row. Omit it and the row is keyed by position,
|
|
48
|
-
* which is correct for a fixed menu; set it when `items` can reorder,
|
|
49
|
-
* filter, or grow, so a row keeps its DOM node — and therefore keyboard
|
|
50
|
-
* focus — as the array changes around it.
|
|
51
|
-
*/
|
|
52
|
-
id?: string;
|
|
53
|
-
/** Primary label content. */
|
|
54
|
-
label: string | number;
|
|
55
|
-
/**
|
|
56
|
-
* Icon shown before the label.
|
|
57
|
-
*
|
|
58
|
-
* Pass a CSS icon class — for example an UnoCSS class such as
|
|
59
|
-
* `'i-carbon-copy'` — or a Vue component that draws the SVG. astryx-vue ships
|
|
60
|
-
* no icons of its own.
|
|
61
|
-
*/
|
|
62
|
-
icon?: string | Component;
|
|
63
|
-
/** Secondary line below the label. */
|
|
64
|
-
description?: string | number;
|
|
65
|
-
/**
|
|
66
|
-
* Whether the row is disabled.
|
|
67
|
-
* @default false
|
|
68
|
-
*/
|
|
69
|
-
isDisabled?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Visual variant. `destructive` renders the label, description, and icon in
|
|
72
|
-
* the error color for dangerous actions.
|
|
73
|
-
* @default 'default'
|
|
74
|
-
*/
|
|
75
|
-
variant?: DropdownMenuItemVariant;
|
|
76
|
-
/** Trailing content, such as a keyboard-shortcut hint. */
|
|
77
|
-
endContent?: VNodeChild;
|
|
78
|
-
/**
|
|
79
|
-
* Whether activating the row closes the menu. Set `false` for an action that
|
|
80
|
-
* reports its result on the row itself.
|
|
81
|
-
* @default true
|
|
82
|
-
*/
|
|
83
|
-
hasCloseOnSelect?: boolean;
|
|
84
|
-
/** Address the row navigates to; the row then renders as a link. */
|
|
85
|
-
href?: string;
|
|
86
|
-
/** Link target. Only used with `href`. */
|
|
87
|
-
target?: ItemTarget;
|
|
88
|
-
/** Link relationship. Only used with `href`. */
|
|
89
|
-
rel?: string;
|
|
90
|
-
/** Called when the row is activated. */
|
|
91
|
-
onClick?: (event: MouseEvent) => void;
|
|
92
|
-
}
|
|
93
|
-
/** A divider row of the `items` data API. */
|
|
94
|
-
interface DropdownMenuDividerData {
|
|
95
|
-
type: 'divider';
|
|
96
|
-
}
|
|
97
|
-
/** A titled group of rows of the `items` data API. */
|
|
98
|
-
interface DropdownMenuSection {
|
|
99
|
-
type: 'section';
|
|
100
|
-
/** Stable identity for the group. */
|
|
101
|
-
id?: string;
|
|
102
|
-
/** Heading shown above the group's rows and used as its accessible name. */
|
|
103
|
-
title?: string;
|
|
104
|
-
items: DropdownMenuItemData[];
|
|
105
|
-
}
|
|
106
|
-
/** One entry of the `items` data API. */
|
|
107
|
-
type DropdownMenuOption = DropdownMenuItemData | DropdownMenuDividerData | DropdownMenuSection;
|
|
108
|
-
interface DropdownMenuProps {
|
|
109
|
-
/**
|
|
110
|
-
* The design system's own button as the trigger. Ignored when the `trigger`
|
|
111
|
-
* slot renders a control instead.
|
|
112
|
-
* @default { label: 'Menu' }
|
|
113
|
-
*/
|
|
114
|
-
button?: DropdownMenuButtonProps;
|
|
115
|
-
/**
|
|
116
|
-
* Data-mode menu entries: action items, `{ type: 'divider' }`, and
|
|
117
|
-
* `{ type: 'section', title, items }`. Provide either `items` or the default
|
|
118
|
-
* slot; `items` wins when both are present.
|
|
119
|
-
*/
|
|
120
|
-
items?: DropdownMenuOption[];
|
|
121
|
-
/**
|
|
122
|
-
* Controlled open state. Pair it with `v-model:is-menu-open`. Left out, the
|
|
123
|
-
* menu manages its own open state.
|
|
124
|
-
*/
|
|
125
|
-
isMenuOpen?: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Minimum width of the menu. A length grows for its content; an intrinsic
|
|
128
|
-
* keyword such as `max-content` becomes the preferred width instead. Every
|
|
129
|
-
* form is capped to the viewport. Defaults to the trigger's width, capped.
|
|
130
|
-
*/
|
|
131
|
-
menuWidth?: number | string;
|
|
132
|
-
/**
|
|
133
|
-
* Maximum height of the menu in pixels, for a menu that must fit its rows.
|
|
134
|
-
* Lifts the default 300px cap; the viewport still bounds it.
|
|
135
|
-
*/
|
|
136
|
-
menuMaxHeight?: number;
|
|
137
|
-
/**
|
|
138
|
-
* Where the menu opens relative to the trigger. Flips when there is no room.
|
|
139
|
-
* @default 'below'
|
|
140
|
-
*/
|
|
141
|
-
placement?: LayerPlacement;
|
|
142
|
-
/**
|
|
143
|
-
* `popover` anchors to the trigger. `bottom-sheet` uses a bottom sheet.
|
|
144
|
-
* `adaptive` chooses the sheet on a compact touch surface and a popover
|
|
145
|
-
* otherwise.
|
|
146
|
-
* @default 'popover'
|
|
147
|
-
*/
|
|
148
|
-
presentation?: DropdownMenuPresentation;
|
|
149
|
-
/**
|
|
150
|
-
* How the menu aligns with the trigger along the placement axis.
|
|
151
|
-
* @default 'start'
|
|
152
|
-
*/
|
|
153
|
-
alignment?: LayerAlignment;
|
|
154
|
-
/**
|
|
155
|
-
* Whether the trigger button shows a trailing chevron. Hidden by default on
|
|
156
|
-
* an icon-only trigger.
|
|
157
|
-
* @default true
|
|
158
|
-
*/
|
|
159
|
-
hasChevron?: boolean;
|
|
160
|
-
}
|
|
161
|
-
interface DropdownMenuEmits {
|
|
162
|
-
'update:isMenuOpen': [isOpen: boolean];
|
|
163
|
-
/** Fired when the open state changes. */
|
|
164
|
-
'openChange': [isOpen: boolean];
|
|
165
|
-
/** Fired when the trigger is activated. */
|
|
166
|
-
'click': [];
|
|
167
|
-
}
|
|
168
|
-
interface DropdownMenuSlots {
|
|
169
|
-
/**
|
|
170
|
-
* Compound menu content: `DropdownMenuItem`, `DropdownMenuDivider` and
|
|
171
|
-
* `DropdownMenuGroup`. Mutually exclusive with `items`.
|
|
172
|
-
*/
|
|
173
|
-
default?: () => VNodeChild;
|
|
174
|
-
/**
|
|
175
|
-
* The control the menu hangs off — an icon button, a chip, an avatar, a list
|
|
176
|
-
* row. Spread the given props onto it.
|
|
177
|
-
*/
|
|
178
|
-
trigger?: (props: DropdownMenuTriggerProps) => VNodeChild;
|
|
179
|
-
}
|
|
180
|
-
interface DropdownMenuItemProps {
|
|
181
|
-
/**
|
|
182
|
-
* Primary label content. Use the `label` slot for rich content.
|
|
183
|
-
*/
|
|
184
|
-
label?: string | number;
|
|
185
|
-
/**
|
|
186
|
-
* Secondary line below the label. Use the `description` slot for rich
|
|
187
|
-
* content.
|
|
188
|
-
*/
|
|
189
|
-
description?: string | number;
|
|
190
|
-
/**
|
|
191
|
-
* Icon shown before the label.
|
|
192
|
-
*
|
|
193
|
-
* Pass a CSS icon class — for example an UnoCSS class such as
|
|
194
|
-
* `'i-carbon-copy'` — or a Vue component that draws the SVG. astryx-vue ships
|
|
195
|
-
* no icons of its own. Use the `icon` slot for arbitrary content.
|
|
196
|
-
*/
|
|
197
|
-
icon?: string | Component;
|
|
198
|
-
/**
|
|
199
|
-
* Whether the row is disabled. A disabled row is skipped by the arrow keys
|
|
200
|
-
* and by typeahead.
|
|
201
|
-
* @default false
|
|
202
|
-
*/
|
|
203
|
-
isDisabled?: boolean;
|
|
204
|
-
/**
|
|
205
|
-
* Visual variant. `destructive` renders the label, description, and icon in
|
|
206
|
-
* the error color for dangerous actions.
|
|
207
|
-
* @default 'default'
|
|
208
|
-
*/
|
|
209
|
-
variant?: DropdownMenuItemVariant;
|
|
210
|
-
/**
|
|
211
|
-
* Whether activating the row closes the menu. Set `false` for an action that
|
|
212
|
-
* reports its result on the row itself.
|
|
213
|
-
* @default true
|
|
214
|
-
*/
|
|
215
|
-
hasCloseOnSelect?: boolean;
|
|
216
|
-
/**
|
|
217
|
-
* Address the row navigates to. The row then renders as one anchor carrying
|
|
218
|
-
* `role="menuitem"`, so a modified click and a middle click keep the
|
|
219
|
-
* browser's meaning.
|
|
220
|
-
*/
|
|
221
|
-
href?: string;
|
|
222
|
-
/**
|
|
223
|
-
* Link target. Only used with `href`.
|
|
224
|
-
*/
|
|
225
|
-
target?: ItemTarget;
|
|
226
|
-
/**
|
|
227
|
-
* Link relationship. `noopener` and `noreferrer` are merged in for
|
|
228
|
-
* `target="_blank"`. Only used with `href`.
|
|
229
|
-
*/
|
|
230
|
-
rel?: string;
|
|
231
|
-
/**
|
|
232
|
-
* Called when the row is activated. On a link row it runs before the browser
|
|
233
|
-
* navigates, and is skipped for a modified click, which the browser owns.
|
|
234
|
-
*/
|
|
235
|
-
onClick?: (event: MouseEvent) => void;
|
|
236
|
-
}
|
|
237
|
-
interface DropdownMenuItemEmits {
|
|
238
|
-
/** Fired when the row is activated. */
|
|
239
|
-
click: [event: MouseEvent];
|
|
240
|
-
}
|
|
241
|
-
interface DropdownMenuItemSlots {
|
|
242
|
-
/** Rich content replacing the `icon` prop. */
|
|
243
|
-
icon?: () => VNodeChild;
|
|
244
|
-
/** Rich content replacing the `label` prop. */
|
|
245
|
-
label?: () => VNodeChild;
|
|
246
|
-
/** Rich content replacing the `description` prop. */
|
|
247
|
-
description?: () => VNodeChild;
|
|
248
|
-
/** Trailing content, such as a keyboard-shortcut hint. */
|
|
249
|
-
endContent?: () => VNodeChild;
|
|
250
|
-
}
|
|
251
|
-
interface DropdownMenuGroupProps {
|
|
252
|
-
/**
|
|
253
|
-
* Heading shown above the group's rows and used as the group's accessible
|
|
254
|
-
* name. Omit it for an unnamed group.
|
|
255
|
-
*/
|
|
256
|
-
title?: string | number;
|
|
257
|
-
}
|
|
258
|
-
interface DropdownMenuGroupSlots {
|
|
259
|
-
/** The rows of the group. */
|
|
260
|
-
default?: () => VNodeChild;
|
|
261
|
-
/** Rich content replacing the `title` prop, still used as the group's name. */
|
|
262
|
-
title?: () => VNodeChild;
|
|
263
|
-
}
|
|
264
|
-
interface DropdownMenuSubMenuProps {
|
|
265
|
-
/** Row label. */
|
|
266
|
-
label?: string | number;
|
|
267
|
-
/** Icon before the label. A CSS class or a component. */
|
|
268
|
-
icon?: string | Component;
|
|
269
|
-
/** Secondary line under the label. */
|
|
270
|
-
description?: string | number;
|
|
271
|
-
/**
|
|
272
|
-
* Whether the row can open its flyout.
|
|
273
|
-
* @default false
|
|
274
|
-
*/
|
|
275
|
-
isDisabled?: boolean;
|
|
276
|
-
}
|
|
277
|
-
interface DropdownMenuSubMenuSlots {
|
|
278
|
-
/** The rows of the nested menu. */
|
|
279
|
-
default?: () => VNodeChild;
|
|
280
|
-
icon?: () => VNodeChild;
|
|
281
|
-
label?: () => VNodeChild;
|
|
282
|
-
description?: () => VNodeChild;
|
|
283
|
-
}
|
|
284
|
-
//#endregion
|
|
285
|
-
export { DropdownMenuSubMenuProps as _, DropdownMenuGroupSlots as a, DropdownMenuItemProps as c, DropdownMenuOption as d, DropdownMenuPresentation as f, DropdownMenuSlots as g, DropdownMenuSize as h, DropdownMenuGroupProps as i, DropdownMenuItemSlots as l, DropdownMenuSection as m, DropdownMenuDividerData as n, DropdownMenuItemData as o, DropdownMenuProps as p, DropdownMenuEmits as r, DropdownMenuItemEmits as s, DropdownMenuButtonProps as t, DropdownMenuItemVariant as u, DropdownMenuSubMenuSlots as v, DropdownMenuTriggerProps as y };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ref, watch } from "vue";
|
|
2
|
-
//#region src/composables/useGridRovingFocus.ts
|
|
3
|
-
/**
|
|
4
|
-
* 网格式导航(roving tabindex):用方向键在二维网格中移动焦点。
|
|
5
|
-
* 供 Calendar、Pagination(如果需要)等组件复用。
|
|
6
|
-
*/
|
|
7
|
-
function useGridRovingFocus(options) {
|
|
8
|
-
const { rows, columns, activeIndex, isEnabled = ref(true), isDisabled, onChange } = options;
|
|
9
|
-
const row = ref(0);
|
|
10
|
-
const column = ref(0);
|
|
11
|
-
watch(activeIndex, (index) => {
|
|
12
|
-
const cols = columns.value;
|
|
13
|
-
if (cols > 0) {
|
|
14
|
-
row.value = Math.floor(index / cols);
|
|
15
|
-
column.value = index % cols;
|
|
16
|
-
}
|
|
17
|
-
}, { immediate: true });
|
|
18
|
-
function indexFromRowCol(r, c) {
|
|
19
|
-
return r * columns.value + c;
|
|
20
|
-
}
|
|
21
|
-
function moveTo(targetRow, targetCol) {
|
|
22
|
-
if (!isEnabled.value) return;
|
|
23
|
-
const r = Math.max(0, Math.min(targetRow, rows.value - 1));
|
|
24
|
-
const c = Math.max(0, Math.min(targetCol, columns.value - 1));
|
|
25
|
-
if (isDisabled?.(r, c)) return;
|
|
26
|
-
const index = indexFromRowCol(r, c);
|
|
27
|
-
onChange(index);
|
|
28
|
-
}
|
|
29
|
-
function moveUp() {
|
|
30
|
-
moveTo(row.value - 1, column.value);
|
|
31
|
-
}
|
|
32
|
-
function moveDown() {
|
|
33
|
-
moveTo(row.value + 1, column.value);
|
|
34
|
-
}
|
|
35
|
-
function moveLeft() {
|
|
36
|
-
moveTo(row.value, column.value - 1);
|
|
37
|
-
}
|
|
38
|
-
function moveRight() {
|
|
39
|
-
moveTo(row.value, column.value + 1);
|
|
40
|
-
}
|
|
41
|
-
function moveToFirstInRow() {
|
|
42
|
-
moveTo(row.value, 0);
|
|
43
|
-
}
|
|
44
|
-
function moveToLastInRow() {
|
|
45
|
-
moveTo(row.value, columns.value - 1);
|
|
46
|
-
}
|
|
47
|
-
function moveToFirstInColumn() {
|
|
48
|
-
moveTo(0, column.value);
|
|
49
|
-
}
|
|
50
|
-
function moveToLastInColumn() {
|
|
51
|
-
moveTo(rows.value - 1, column.value);
|
|
52
|
-
}
|
|
53
|
-
function onKeyDown(event) {
|
|
54
|
-
if (!isEnabled.value) return;
|
|
55
|
-
switch (event.key) {
|
|
56
|
-
case "ArrowUp":
|
|
57
|
-
event.preventDefault();
|
|
58
|
-
moveUp();
|
|
59
|
-
break;
|
|
60
|
-
case "ArrowDown":
|
|
61
|
-
event.preventDefault();
|
|
62
|
-
moveDown();
|
|
63
|
-
break;
|
|
64
|
-
case "ArrowLeft":
|
|
65
|
-
event.preventDefault();
|
|
66
|
-
moveLeft();
|
|
67
|
-
break;
|
|
68
|
-
case "ArrowRight":
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
moveRight();
|
|
71
|
-
break;
|
|
72
|
-
case "Home":
|
|
73
|
-
event.preventDefault();
|
|
74
|
-
if (event.ctrlKey) moveTo(0, 0);
|
|
75
|
-
else moveToFirstInRow();
|
|
76
|
-
break;
|
|
77
|
-
case "End":
|
|
78
|
-
event.preventDefault();
|
|
79
|
-
if (event.ctrlKey) moveTo(rows.value - 1, columns.value - 1);
|
|
80
|
-
else moveToLastInRow();
|
|
81
|
-
break;
|
|
82
|
-
case "PageUp":
|
|
83
|
-
event.preventDefault();
|
|
84
|
-
moveToFirstInColumn();
|
|
85
|
-
break;
|
|
86
|
-
case "PageDown":
|
|
87
|
-
event.preventDefault();
|
|
88
|
-
moveToLastInColumn();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
row,
|
|
93
|
-
column,
|
|
94
|
-
onKeyDown,
|
|
95
|
-
moveTo
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
export { useGridRovingFocus as t };
|
|
File without changes
|