@astryx-vue/core 0.2.6 → 0.4.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/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-BBhl5P1X.js → AlertDialog-C2inDZWG.js} +13 -7
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-mrflO0Uy.js → AppShell-CumzH-8z.js} +3 -3
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-pPZ4dI_s.js → Avatar-BW0TE8t9.js} +47 -34
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-B--NQSB3.js → AvatarGroup-DLC_FFR5.js} +57 -13
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-GbGxrqQO.js → Banner-C5VAwo4D.js} +68 -34
- package/dist/Blockquote/index.js +1 -1
- package/dist/Blockquote-DRoKdcxZ.js +27 -0
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-eJ3FzTBD.js → BottomSheet-B4sc3F1S.js} +288 -140
- package/dist/{BottomSheet-DIVwbGr3.js → BottomSheet-m54uCMJN.js} +20 -4
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/Breadcrumbs-CTaz7Kh4.js +223 -0
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-B6Hj_O_s.js → Button-ONOoHdkg.js} +25 -15
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/ButtonGroup-DnkSZ9a5.js +87 -0
- package/dist/{ButtonTooltip-nWWrth8j.js → ButtonTooltip-CNKOQHYR.js} +7 -4
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-B7vIowKq.js → Calendar-BAqzzQm2.js} +5 -5
- package/dist/Card/index.d.ts +2 -2
- package/dist/Card/index.js +1 -1
- package/dist/{Card-HAjZQg2s.js → Card-B-I24X9S.js} +2 -0
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-DAkOa7KK.js → Carousel-DXC22UWq.js} +50 -33
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-DVoI6UOA.js → Chat-BdJW6IX5.js} +152 -83
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/{CheckboxIndicator-D37cm2Rh.js → CheckboxIndicator-fH4d-JE1.js} +9 -3
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-BS9J6edf.js → CheckboxInput-DJHCbwgC.js} +19 -11
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-CX1i_jVP.js → CheckboxList-BdZIP4_J.js} +155 -38
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-Djgwa0ko.js → Citation-DbZn2vms.js} +8 -3
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-Bhds4RRe.js → ClickableCard-ChAfiw9T.js} +10 -7
- package/dist/Code/index.d.ts +1 -1
- package/dist/Code/index.js +3 -3
- package/dist/{Code-XnPuGxey.js → Code-Bg7GBdxy.js} +2 -1
- package/dist/{CodeBlock-BUM3czCS.js → CodeBlock-Caaflp7C.js} +7 -3
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Cov3Pyq5.js → Collapsible-Bdj0WYpb.js} +13 -11
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-D6wYS30d.js → CommandPalette-C_MClfAg.js} +146 -62
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-Bil81sfq.js → ComplexSelector-BeVQaqRf.js} +94 -22
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-DdLJnxNN.js → ContextMenu-C6hPYvYz.js} +299 -179
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-u2XKccpK.js → DateInput-BjLdmYor.js} +567 -76
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-u7LhH6up.js → DateRangeInput-Br3wVEfD.js} +99 -28
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/DateTimeInput-CAZBwoRe.js +562 -0
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +2 -2
- package/dist/{Dialog-BiOSKQso.js → Dialog-Dce4Y97V.js} +28 -11
- package/dist/{Dialog-FGHfDu5M.js → Dialog-fhyxB00e.js} +32 -5
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +1 -1
- package/dist/{Divider-BtwnL18I.js → Divider-mOZ6vIQw.js} +5 -1
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-SM_BEOgM.js → DropdownMenu-BdGmQVb1.js} +85 -57
- package/dist/{DropdownMenu-BEasdJ6R.js → DropdownMenu-BzQrNV9C.js} +481 -264
- package/dist/{DropdownMenuRadioItem.vue-CXEURBcq.d.ts → DropdownMenuRadioItem.vue-Qd-8Rg4Q.d.ts} +236 -230
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-C_GH7IV5.js → EmptyState-CmOQf2SH.js} +2 -2
- package/dist/Field/index.d.ts +4 -3
- package/dist/Field/index.js +4 -3
- package/dist/{Field-D5gUEGw4.js → Field--OEsLBfE.js} +4 -3
- package/dist/{FieldInfoTip-Ds-sW_jY.js → FieldInfoTip-gxsnfkZw.js} +3 -3
- package/dist/{FieldLabel-BNeXRuGH.js → FieldLabel-jxIiWgLw.js} +12 -7
- package/dist/FieldStatus/index.d.ts +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BpdiO1V8.js → FileInput-B_pUxB0Y.js} +106 -29
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.js +1 -1
- package/dist/{FormLayout-D47FjiOq.js → FormLayout-B9dUB6Ps.js} +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BnwWEWkp.js → Heading-BzBunfN7.js} +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-ycY50pRN.js → HoverCard-BpJhT0sn.js} +35 -22
- package/dist/Icon/index.d.ts +4 -4
- package/dist/Icon/index.js +1 -1
- package/dist/{Icon-bteSId7T.js → Icon-KDnUyY7f.js} +12 -20
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-DDNgNl7B.js → IconButton-DI-XBbtV.js} +1 -1
- package/dist/Indicator/index.d.ts +2 -2
- package/dist/Indicator/index.js +2 -1
- package/dist/InputClearButton-CwXPan8c.js +40 -0
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/InputGroup/index.js +2 -2
- package/dist/{InputGroup-CA03Smrs.js → InputGroup-DiiocoIW.js} +2 -2
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-DJay_w3B.js → InternationalizationProvider-kBapgKAQ.js} +5 -9
- package/dist/{Item-KhFKX9St.js → Item-DWMIjN8n.js} +34 -9
- package/dist/Kbd/index.js +1 -1
- package/dist/{Kbd-BB-Dw6zE.js → Kbd-CV3LO2Ge.js} +18 -2
- package/dist/LayerContentBoundary-CvsKxwwm.js +27 -0
- package/dist/LayerProvider/index.js +1 -1
- package/dist/{LayerProvider-D9NsQFzL.js → LayerProvider-B6zpMBWC.js} +15 -3
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-9X6eCUoY.js → Layout-JJRCG7Mf.js} +1 -1
- package/dist/{LayoutPanel-DeOh00p5.js → LayoutPanel-zM5vjrKS.js} +15 -8
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-DTF9EdTG.js → Lightbox-D8wyPgMK.js} +8 -6
- package/dist/Link/index.d.ts +2 -2
- package/dist/Link/index.js +1 -1
- package/dist/{Link-BqHCtiyt.js → Link-DweIpOtN.js} +29 -12
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-8RWT8XAG.js → ListItem-BQXMu1Tb.js} +1 -1
- package/dist/Markdown/index.d.ts +5 -2
- package/dist/Markdown/index.js +5 -2
- package/dist/Markdown/parser/index.d.ts +4 -0
- package/dist/Markdown/parser/index.js +3 -0
- package/dist/Markdown/plugin-protocol/index.d.ts +35 -0
- package/dist/Markdown/plugin-protocol/index.js +107 -0
- package/dist/Markdown/plugin-renderer/index.d.ts +31 -0
- package/dist/Markdown/plugin-renderer/index.js +42 -0
- package/dist/{Markdown-2CVyZDuB.js → Markdown-DhVfOvXk.js} +195 -484
- package/dist/MediaTheme-DlLqYhDy.js +433 -0
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-B-OelQlt.js → MetadataList-CEYceIlN.js} +15 -7
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-C3dkrM98.js → MobileNavToggle-pdoJFZHx.js} +60 -19
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-D1WFGqGU.js → MoreMenu-CFNqSRev.js} +87 -67
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/MultiSelector-DuVatmq5.js +1456 -0
- package/dist/{NavDisclosure-C_fugrQ3.js → NavDisclosure-Bq9DTZLO.js} +29 -7
- package/dist/{NavHeadingSurface-B3yJspSN.js → NavHeadingSurface-C4v_MtkX.js} +29 -26
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +2 -2
- package/dist/{NavItem-BBIGSvDj.js → NavItem-BPb3yfgz.js} +17 -4
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-ThXguZAz.js → NavMenu-BYIDzjix.js} +42 -15
- package/dist/{NavMenuItem-BvJNsDFC.js → NavMenuItem-D3FO90GR.js} +14 -12
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput-B0vzOg3N.js +727 -0
- package/dist/Outline/index.d.ts +2 -2
- package/dist/Outline/index.js +2 -2
- package/dist/{Outline-755h-lMP.js → Outline-CfGv2F1o.js} +91 -6
- package/dist/OverflowList/index.d.ts +2 -2
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-NmrSMbxb.js → OverflowList-BgRLZ3dh.js} +23 -6
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-Cc4BrjQg.js → Pagination-Bfe12018.js} +2 -2
- package/dist/PickerWheel-CSwUYfes.js +69 -0
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CtoBfVlD.js → Popover-78dFjTb9.js} +28 -17
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-DHoiObLn.js → PowerSearch-BoAMdFaT.js} +776 -586
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-CVLzdoBK.js → ProgressBar-VP4JS7vm.js} +10 -7
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-Bfu6JSNV.js → RadioGroup-BIipql-L.js} +94 -26
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-xY1cwLdZ.js → RadioList-GyhgBg4j.js} +57 -8
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-q4nD_586.js → ResizeHandle-TPlUCAHD.js} +103 -50
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/ScrollableArea/index.js +1 -1
- package/dist/{ScrollableArea-CJiaALHm.js → ScrollableArea-0u6RWtGG.js} +14 -3
- package/dist/Scrollbars/index.d.ts +2 -0
- package/dist/Scrollbars/index.js +3 -0
- package/dist/Scrollbars-D_93hJYK.js +75 -0
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-ChHmFrrC.js → SegmentedControl-D1wWGBZo.js} +11 -5
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-Bj5s_tIN.js → SelectableCard-BEqnhPaX.js} +17 -12
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-CPISLzp7.js +1049 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-Dtv8eA2j.js → SideNav-CN2QeAtY.js} +64 -41
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DWobsPgm.js → Slider-pdC0jpHu.js} +172 -46
- package/dist/Spinner/index.js +1 -1
- package/dist/Spinner-DdVUadii.js +200 -0
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stack/index.js +2 -2
- package/dist/{Stack-CjQEavuq.js → Stack-Bb_h60t3.js} +10 -3
- package/dist/{Stack-D_Bhs-3r.js → Stack-Bp-XN9J4.js} +20 -9
- package/dist/StatusDot/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-BPUhMOff.js → StatusDot-BS_ohXhd.js} +8 -4
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CE8dHysu.js → Stepper-CyaSRSdu.js} +101 -79
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DaVPRxvN.js → Switch-Z2Vfiiic.js} +38 -22
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-DIkK9sgK.js → TabList-DRqP0Hrv.js} +205 -63
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +1 -1
- package/dist/{Table-hqZMmzfU.js → Table-BcrrylMX.js} +727 -448
- package/dist/Text/index.d.ts +2 -2
- package/dist/Text/index.js +1 -1
- package/dist/{Text-CV3LmscH.js → Text-CmTOgYXf.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Ab5Sw60T.js → TextArea-DA9CCG_J.js} +104 -50
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-zFT1_qgI.js → TextInput-CI96einV.js} +71 -38
- package/dist/Theme/index.d.ts +3 -3
- package/dist/Theme/index.js +3 -2
- package/dist/Theme-BbDT8B_C.js +2125 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-C3NnJUFG.js → Thumbnail-B2ZAY59J.js} +13 -10
- package/dist/{TimeField-ByiJKBRM.js → TimeField-CpAgja9D.js} +299 -40
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-S8n946tp.js → TimeInput-Bw_lHS4M.js} +78 -9
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-avMQk5DN.js → Timer-CH7GsEVu.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-xpQKCk0d.js → Timestamp-BFNuoTZ0.js} +5 -5
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/Toast-DwnPjx6j.js +685 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-B-C-Q7XP.js → ToggleButton-cLjh9W-x.js} +5 -4
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-DsntTYhQ.js → Token-BfS4vi__.js} +32 -17
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-41p035dX.js → Tokenizer-Ci3E5bvP.js} +109 -23
- package/dist/Toolbar/index.d.ts +2 -2
- package/dist/Toolbar/index.js +1 -1
- package/dist/{Toolbar-BrgvvTCk.js → Toolbar-C0pMWL4S.js} +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-C4Vaqd3G.js → Tooltip-sAM8i1eO.js} +23 -19
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CeSeEMX3.js → TopNav-gW59zp1o.js} +16 -15
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-BUz-KZJd.js → TreeList-DaoI7zaH.js} +124 -41
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-k3xhFxkr.js → Typeahead-D4JjvjK4.js} +125 -26
- package/dist/{TypeaheadMenu-DBW6rHeO.js → TypeaheadMenu-BQlMrfqX.js} +141 -51
- package/dist/{announce-Cnio10Wk.js → announce-B210eJVf.js} +17 -2
- package/dist/characterReferences-BJ-jLhsR.js +65 -0
- package/dist/characters-rcDbGt71.d.ts +29 -0
- package/dist/characters-wTnzjkkR.js +58 -0
- package/dist/{colorMode-CBgdgDSn.js → colorMode-BxqfDP4P.js} +1 -4
- package/dist/composables/index.d.ts +5 -4
- package/dist/composables/index.js +23 -18
- package/dist/{composables-CbKx9C1Y.js → composables-Bc02zKAO.js} +167 -197
- package/dist/context-B6UElI5X.js +5 -0
- package/dist/{context-Cfjh8te1.js → context-Cfml4jaK.js} +5 -3
- package/dist/{context-iABt_ueM.js → context-DWfi56sq.js} +451 -122
- package/dist/context-IvbU9c3T.js +8 -0
- package/dist/context-pjBxaMSh.js +28 -0
- package/dist/fieldParts--SyRZVQG.js +44 -0
- package/dist/fieldParts-LXpQMKE8.d.ts +27 -0
- package/dist/{focus-CpficIgf.js → focus-l8jVTcqd.js} +1 -1
- package/dist/hoverIntent-DMHGb85c.js +115 -0
- package/dist/{index-Cde5JvtX.d.ts → index-B-nESNam.d.ts} +8 -7
- package/dist/{index-CsNi1I8j.d.ts → index-B08-Uxhv.d.ts} +4 -2
- package/dist/{index-Cn-sSds-.d.ts → index-B56j4eI2.d.ts} +24 -1
- package/dist/{index-BJMJ09K-.d.ts → index-BEZ4ezJk.d.ts} +1 -1
- package/dist/{index-DeQwYJbg.d.ts → index-BNaRK-s5.d.ts} +10 -1
- package/dist/{index-CQCTKjIO.d.ts → index-BO9TY87G.d.ts} +5 -4
- package/dist/{index-BJSxFVXH.d.ts → index-BQEJj72c.d.ts} +21 -8
- package/dist/{index-BXk7Wng7.d.ts → index-BULhhnGf.d.ts} +1 -1
- package/dist/{index-D97pQbua.d.ts → index-BV2D2x_u.d.ts} +1 -1
- package/dist/{index-BPYzIIYn.d.ts → index-BZKgbyN9.d.ts} +2 -2
- package/dist/index-BkUkm6Al.d.ts +11 -0
- package/dist/{index-ClNU2Th8.d.ts → index-Bn-v89Vt.d.ts} +10 -6
- package/dist/{index-Bu8NA2SD.d.ts → index-BnEhvmdR.d.ts} +16 -7
- package/dist/index-Bo-ofFyg.d.ts +166 -0
- package/dist/{index-i0tNFWfz.d.ts → index-BqhgeAT4.d.ts} +2 -0
- package/dist/{index-DWh2WC8W.d.ts → index-C4Cjz6OK.d.ts} +2 -2
- package/dist/{index-B7yhzGUT.d.ts → index-C7sam-SB.d.ts} +2 -2
- package/dist/{index-BrJzFA5X.d.ts → index-C90l2rH1.d.ts} +1 -1
- package/dist/{index-vP0EtrJJ.d.ts → index-C9gAlDt_.d.ts} +6 -3
- package/dist/{index-csA1lH_0.d.ts → index-CJ6ajsUC.d.ts} +2 -2
- package/dist/{index-CY-KvZ9B.d.ts → index-CK-Dbh0f.d.ts} +1 -1
- package/dist/index-CKUfpmFL.d.ts +375 -0
- package/dist/{index-DXpSFlPG.d.ts → index-CKgBTAzC.d.ts} +4 -4
- package/dist/{index-EFqQF2Bx.d.ts → index-CPtDjmcX.d.ts} +4 -4
- package/dist/{index-12QYAbiz.d.ts → index-CRrSHbok.d.ts} +3 -2
- package/dist/{index-DG52Bg0W.d.ts → index-CTf3SK0b.d.ts} +6 -0
- package/dist/{index-BNy3SW4S.d.ts → index-CTjkJP4x.d.ts} +32 -3
- package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
- package/dist/{index-YKCx03zD.d.ts → index-CdvmnNMH.d.ts} +1 -1
- package/dist/{index-BUEPz7BL.d.ts → index-CikMzeab.d.ts} +3 -3
- package/dist/{index-CdtZjkmG.d.ts → index-CpNlPLBF.d.ts} +183 -129
- package/dist/{index-N7OVZ38M.d.ts → index-Cs1xsHKi.d.ts} +28 -16
- package/dist/{index-Cyb9Du5Z.d.ts → index-CtTGt6Dv.d.ts} +1 -1
- package/dist/{index-HV6W3xCx.d.ts → index-D05JGsT3.d.ts} +5 -2
- package/dist/{index-CsTbMVDS.d.ts → index-D0_HsuC3.d.ts} +4 -4
- package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
- package/dist/{index-CkKPMIeX.d.ts → index-D7XRtUTY.d.ts} +9 -0
- package/dist/{index-TntQsADQ.d.ts → index-DEm3kRBO.d.ts} +4 -3
- package/dist/{index-DamRHh1i.d.ts → index-DLAG3m9W.d.ts} +11 -1
- package/dist/{index-DUnDGFQE.d.ts → index-DNA2l1RN.d.ts} +1 -1
- package/dist/{index-WnUY4Kxu.d.ts → index-DRJZ-v1E.d.ts} +4 -4
- package/dist/{index-DYp2RWkM.d.ts → index-DY8Wph-A.d.ts} +3 -3
- package/dist/{index-B1WJxt-n.d.ts → index-DfC05uKG.d.ts} +17 -7
- package/dist/{index-C5e-7Obr.d.ts → index-Dj1_1t3j.d.ts} +19 -6
- package/dist/{index-jW-mP58D.d.ts → index-Dr4b_oji.d.ts} +22 -15
- package/dist/{index-uKnRGtzi.d.ts → index-Ds201-d2.d.ts} +18 -4
- package/dist/{index-DIXAzTKL.d.ts → index-DxxudRgB.d.ts} +1 -1
- package/dist/{index-DQmK3Lq_.d.ts → index-IfsSCj8J.d.ts} +19 -6
- package/dist/{index-B1eCxBCY.d.ts → index-TXcNH86P.d.ts} +1 -1
- package/dist/{index-XuAAcYiP.d.ts → index-f3d9cVtj.d.ts} +1 -1
- package/dist/index-fAZaRruV.d.ts +125 -0
- package/dist/{index-D5N9ikrS.d.ts → index-hCpxKePE.d.ts} +1 -1
- package/dist/{index-T2FOcOuI.d.ts → index-jOwU3YoR.d.ts} +400 -90
- package/dist/{index-DdGck82Y.d.ts → index-pNtfr-RW.d.ts} +2 -2
- package/dist/{index-BhpAUzUr.d.ts → index-unAZVFGz.d.ts} +2 -2
- package/dist/index.d.ts +84 -77
- package/dist/index.js +151 -134
- package/dist/inlineSize-BNe8wggI.js +66 -0
- package/dist/inputPresentation-BOyHkCDr.js +62 -0
- package/dist/interactionModality-ACpTMhak.js +44 -0
- package/dist/isApplePlatform-B1ju6F5B.js +27 -0
- package/dist/isRenderable-BnKHIqfd.js +21 -0
- package/dist/layerDepth-CNDh-IHb.js +181 -0
- package/dist/link-DuuA2eCL.js +30 -0
- package/dist/{loadCatalog-BGHKG_9N.d.ts → loadCatalog-DlLFZreI.d.ts} +281 -7
- package/dist/loadCatalog-eopw74qb.js +424 -0
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +4 -3
- package/dist/locale-CabGJlGp.js +343 -0
- package/dist/modalOutlet-CUOcrhIu.js +56 -0
- package/dist/optionAction-Cg7xQLUA.d.ts +6 -0
- package/dist/{power-search-DrDfcoL1.d.ts → power-search-gHLIYXs5.d.ts} +2 -0
- package/dist/protocol-DHxY0NI8.js +113 -0
- package/dist/protocol-RSeMzAN1.d.ts +238 -0
- package/dist/publicParser-B0MRoikr.d.ts +141 -0
- package/dist/publicParser-uHC_T0Fo.js +895 -0
- package/dist/resizableChannel-3vivrEcT.js +20 -0
- package/dist/safeUrl-CsvfcZ9m.js +54 -0
- package/dist/scopedProvide-C-Df7c15.js +30 -0
- package/dist/scrollKeyboardDelegation-D7cumnOl.js +238 -0
- package/dist/scrollLock-C3aT4-0z.js +102 -0
- package/dist/{searchResultMessage-hXXNOFJP.js → searchResultMessage-mCpJBvra.js} +5 -14
- package/dist/{semantic-CKH9XVqa.d.ts → semantic-BF_AjLvk.d.ts} +6 -3
- package/dist/slug-C65CUsf9.js +32 -0
- package/dist/syntaxContext-DmIfNNtb.js +4 -0
- package/dist/triggerVariant-BsL8jMHs.js +16 -0
- package/dist/{types-0Q_SJv_F.d.ts → types-Bb7OGivY.d.ts} +6 -1
- package/dist/{types-H4Bbbxiw.d.ts → types-BnNTzEnd.d.ts} +1 -1
- package/dist/{types-CwyibrRB.d.ts → types-C5GQ2KCK.d.ts} +23 -3
- package/dist/{types-BBWrcHMD.d.ts → types-Ckih2YJi.d.ts} +3 -2
- package/dist/{types-gKsEkk2g.d.ts → types-CsqwQkf1.d.ts} +143 -10
- package/dist/upstreamMap-xr3gvREu.js +731 -0
- package/dist/{useAnchoredListbox-DwztMNjP.js → useAnchoredListbox-DGxxKHZb.js} +2 -2
- package/dist/{useAsyncSource-xpQovjV_.d.ts → useAsyncSource-aGzrvRkI.d.ts} +3 -0
- package/dist/{useClickableContainer-DyNpnSEa.js → useClickableContainer-CdGp_Cev.js} +1 -1
- package/dist/{useClipboard-BDfbEsWd.js → useClipboard-Dk8cS810.js} +1 -1
- package/dist/useHoverLayerDismiss-kYJ_NqL4.js +27 -0
- package/dist/{useIndicator-i1NORM7W.js → useIndicator-MZmfBWid.js} +5 -23
- package/dist/{useInputContainer-CpgDe2-4.js → useInputContainer-CLcYrby4.js} +1 -1
- package/dist/{useInputStatusIcon-DBOwxV4x.js → useInputStatusIcon-DAE7PExr.js} +1 -1
- package/dist/useLayerMountTarget-BmZyeKWE.js +156 -0
- package/dist/{useListFocus-D0iOJl39.js → useListFocus-ChxLg0b4.js} +3 -2
- package/dist/{useMenuDrillIn-DzKGkTho.js → useMenuDrillIn-DhUnPvKs.js} +6 -5
- package/dist/useMenuHover-Djreu23i.js +170 -0
- package/dist/useMenuPress-8foxY8z4.js +764 -0
- package/dist/{useMergedRefs-CfHHlCsn.js → useMergedRefs-Cb6_w93m.js} +24 -4
- package/dist/{useNumberField-4-dIGVed.js → useNumberField-Dk1BE3-K.js} +3 -3
- package/dist/useOptionActionGrid-CkJcuvaU.js +97 -0
- package/dist/{usePositionedLayer-Cru9_00b.js → usePositionedLayer-B7cvG-_v.js} +43 -49
- package/dist/usePressFeedback-BJCpjEpv.js +319 -0
- package/dist/{useResizable-DDwPpPe6.d.ts → useResizable-1MHPNaRD.d.ts} +19 -1
- package/dist/{useResizable-B3ahKLoZ.js → useResizable-I3BCiLSL.js} +72 -40
- package/dist/useResolvedLabelHidden-B2rlWiaI.js +30 -0
- package/dist/{useRestoreFocus-Djw9RUIf.js → useRestoreFocus-XEKs5-gp.js} +49 -7
- package/dist/useScrollOverflow-DuMoGXmm.js +67 -0
- package/dist/useScrollableArea-BE8b3qm7.js +222 -0
- package/dist/useScrollbars-C2NJ6Qwq.js +43 -0
- package/dist/{useTimeValue-6ufHM15W.js → useTimeValue-BJd0xBhG.js} +4 -22
- package/dist/useTranslator-BmWt2BBt.js +35 -0
- package/dist/{useTypeahead-PAK8lMYz.js → useTypeahead-BvtflkRk.js} +4 -5
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +5 -0
- package/dist/{utils-D33VQDnk.js → utils-ClVseK2w.js} +29 -2
- package/dist/utils-z3Q6BGIJ.js +819 -0
- package/locales/SOURCE.json +1 -1
- package/package.json +24 -3
- package/reset.css +364 -1
- package/styles/avatar-group.css +9 -1
- package/styles/badge.css +8 -5
- package/styles/banner.css +124 -26
- package/styles/blockquote.css +1 -0
- package/styles/bordered-control.css +1 -1
- package/styles/bottom-sheet.css +74 -6
- package/styles/breadcrumbs.css +16 -2
- package/styles/button-group.css +3 -1
- package/styles/button.css +53 -11
- package/styles/card.css +1 -1
- package/styles/chat.css +16 -6
- package/styles/checkbox-input.css +10 -0
- package/styles/clickable-card.css +10 -3
- package/styles/collapsible.css +12 -5
- package/styles/command-palette.css +29 -14
- package/styles/complex-selector.css +22 -5
- package/styles/context-menu.css +3 -3
- package/styles/date-input.css +111 -1
- package/styles/dialog-header.css +4 -1
- package/styles/dialog.css +7 -0
- package/styles/dropdown-menu.css +12 -3
- package/styles/field.css +5 -0
- package/styles/form-layout.css +1 -0
- package/styles/heading.css +18 -8
- package/styles/icon.css +4 -0
- package/styles/kbd.css +1 -1
- package/styles/layer.css +72 -0
- package/styles/list.css +9 -2
- package/styles/metadata-list.css +1 -0
- package/styles/mobile-nav.css +4 -1
- package/styles/multi-selector.css +48 -1
- package/styles/nav-item.css +9 -2
- package/styles/nav-menu.css +12 -2
- package/styles/number-input.css +9 -1
- package/styles/overflow-list.css +1 -1
- package/styles/popover.css +2 -1
- package/styles/power-search.css +5 -3
- package/styles/pressable.css +63 -22
- package/styles/progress-bar.css +15 -3
- package/styles/radio.css +16 -0
- package/styles/resize-handle.css +42 -0
- package/styles/scrollbars.css +28 -0
- package/styles/segmented-control.css +12 -4
- package/styles/selector.css +53 -1
- package/styles/side-nav.css +19 -0
- package/styles/slider.css +4 -3
- package/styles/spinner.css +48 -42
- package/styles/stepper.css +58 -4
- package/styles/switch.css +26 -0
- package/styles/tab-list.css +132 -3
- package/styles/table.css +88 -10
- package/styles/text-area.css +1 -1
- package/styles/text-input.css +1 -1
- package/styles/text.css +6 -6
- package/styles/thumbnail.css +11 -3
- package/styles/time-input.css +8 -0
- package/styles/toast.css +37 -3
- package/styles/token.css +2 -2
- package/styles/tokenizer.css +1 -1
- package/styles/toolbar.css +4 -1
- package/styles/tree-list.css +1 -1
- package/styles/typeahead.css +34 -1
- package/styles.css +1 -0
- package/dist/Blockquote-DFqBv_oJ.js +0 -18
- package/dist/Breadcrumbs-DPVaziH4.js +0 -141
- package/dist/ButtonGroup-ySQWanDP.js +0 -125
- package/dist/DateTimeInput-DHp683jZ.js +0 -268
- package/dist/MultiSelector-BeV98x7X.js +0 -988
- package/dist/NumberInput-AZ9x3oja.js +0 -473
- package/dist/Selector-DuVozKNq.js +0 -675
- package/dist/Spinner-9cYUCnDy.js +0 -84
- package/dist/Theme-CtaUWo4g.js +0 -1246
- package/dist/Toast-BuqIZV5z.js +0 -322
- package/dist/context-4PuqD1Ic.js +0 -4
- package/dist/context-D5-MwxnN.js +0 -4
- package/dist/index-BH9PzQ1F.d.ts +0 -87
- package/dist/link-C4_WogdF.js +0 -18
- package/dist/loadCatalog-CXKqEB9s.js +0 -877
- package/dist/locale-DgkZEMTn.js +0 -105
- package/dist/platform-B_9W_aHW.js +0 -33
- package/dist/scrollLock-BzIvIimL.js +0 -42
- package/dist/useMenuPress-D-FRNrBW.js +0 -573
- package/dist/useScrollableArea-DDk_CluT.js +0 -172
- /package/dist/{index-lgvUFSCO.d.ts → index-CryFtTT6.d.ts} +0 -0
|
@@ -0,0 +1,1049 @@
|
|
|
1
|
+
import { t as _sfc_main$2 } from "./VisuallyHidden-C7NN3VEP.js";
|
|
2
|
+
import { n as useButtonTooltip } from "./Button-ONOoHdkg.js";
|
|
3
|
+
import { t as _sfc_main$3 } from "./ButtonTooltip-CNKOQHYR.js";
|
|
4
|
+
import { t as useAnnounce } from "./announce-B210eJVf.js";
|
|
5
|
+
import { t as useCombobox } from "./useCombobox-CTo5C-gc.js";
|
|
6
|
+
import { a as isImeKeyEvent } from "./layerDepth-CNDh-IHb.js";
|
|
7
|
+
import { n as useDismiss, t as usePositionedLayer } from "./usePositionedLayer-B7cvG-_v.js";
|
|
8
|
+
import { t as useFieldControlState } from "./useFieldControlState-voICDrys.js";
|
|
9
|
+
import { n as focusElement } from "./focus-l8jVTcqd.js";
|
|
10
|
+
import { s as useAstryxMessages } from "./context-DWfi56sq.js";
|
|
11
|
+
import { t as useScrollbars } from "./useScrollbars-C2NJ6Qwq.js";
|
|
12
|
+
import { t as _sfc_main$4 } from "./BottomSheet-B4sc3F1S.js";
|
|
13
|
+
import { t as _sfc_main$5 } from "./Icon-KDnUyY7f.js";
|
|
14
|
+
import { t as _sfc_main$6 } from "./Spinner-DdVUadii.js";
|
|
15
|
+
import { t as useIndicator } from "./useIndicator-MZmfBWid.js";
|
|
16
|
+
import { t as _sfc_main$7 } from "./Field--OEsLBfE.js";
|
|
17
|
+
import { n as useInputGroupContext } from "./context-IvbU9c3T.js";
|
|
18
|
+
import { t as useFieldPartStyling } from "./fieldParts--SyRZVQG.js";
|
|
19
|
+
import { n as fieldStatusPlacement, t as normalizeTriggerVariant } from "./triggerVariant-BsL8jMHs.js";
|
|
20
|
+
import { n as _sfc_main$8, t as searchResultMessage } from "./searchResultMessage-mCpJBvra.js";
|
|
21
|
+
import { n as OptionAction, r as isOptionAction, t as useOptionActionGrid } from "./useOptionActionGrid-CkJcuvaU.js";
|
|
22
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, onScopeDispose, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
23
|
+
import "../styles/layer.css";
|
|
24
|
+
import "../styles/button.css";
|
|
25
|
+
import "../styles/visually-hidden-utility.css";
|
|
26
|
+
import "../styles/selector.css";
|
|
27
|
+
//#region src/Selector/selectorEscape.ts
|
|
28
|
+
/** 弹出层关掉后,焦点回到触发按钮,而不是掉到 body。 */
|
|
29
|
+
function focusSelectorTrigger(field) {
|
|
30
|
+
const trigger = field?.querySelector(".astryx-selector-trigger");
|
|
31
|
+
if (trigger) nextTick(() => focusElement(trigger));
|
|
32
|
+
}
|
|
33
|
+
function focusInside(layer) {
|
|
34
|
+
const active = document.activeElement;
|
|
35
|
+
return layer != null && active instanceof Node && layer.contains(active);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 搜索框已经处理过的 Escape 会带 preventDefault,这里接选项和操作按钮。
|
|
39
|
+
* 焦点在弹出层里才送回触发器,免得抢走外面已经拿到焦点的控件。
|
|
40
|
+
*/
|
|
41
|
+
function onSelectorListboxEscape(event, options) {
|
|
42
|
+
if (event.key !== "Escape" || event.defaultPrevented || isImeKeyEvent(event) || !options.isOpen) return;
|
|
43
|
+
if (!focusInside(options.layer)) return;
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
options.close();
|
|
46
|
+
options.focusTrigger();
|
|
47
|
+
}
|
|
48
|
+
/** 文档级 Escape。焦点还在层里才送回触发器,点外面关掉时不动焦点。 */
|
|
49
|
+
function dismissSelectorEscape(layer, close, focusTrigger) {
|
|
50
|
+
const inside = focusInside(layer);
|
|
51
|
+
close();
|
|
52
|
+
if (inside) focusTrigger();
|
|
53
|
+
}
|
|
54
|
+
function bindListboxEscape(layer, onKeyDown) {
|
|
55
|
+
watch(layer, (el, prev) => {
|
|
56
|
+
prev?.removeEventListener("keydown", onKeyDown);
|
|
57
|
+
el?.addEventListener("keydown", onKeyDown);
|
|
58
|
+
}, { flush: "sync" });
|
|
59
|
+
onScopeDispose(() => layer.value?.removeEventListener("keydown", onKeyDown));
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/Selector/selectorOptions.ts
|
|
63
|
+
function isSelectorSection(entry) {
|
|
64
|
+
return typeof entry === "object" && entry !== null && "type" in entry && entry.type === "section";
|
|
65
|
+
}
|
|
66
|
+
function asSelectorOption(entry) {
|
|
67
|
+
if (typeof entry === "string") return {
|
|
68
|
+
value: entry,
|
|
69
|
+
label: entry
|
|
70
|
+
};
|
|
71
|
+
return entry;
|
|
72
|
+
}
|
|
73
|
+
function normalizeSelectorEntries(options) {
|
|
74
|
+
return options.map((entry) => {
|
|
75
|
+
if (isSelectorSection(entry)) return {
|
|
76
|
+
...entry,
|
|
77
|
+
options: entry.options.map(asSelectorOption)
|
|
78
|
+
};
|
|
79
|
+
return asSelectorOption(entry);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function flattenSelectorOptions(entries) {
|
|
83
|
+
return entries.flatMap((entry) => isSelectorSection(entry) ? [...entry.options] : [entry]);
|
|
84
|
+
}
|
|
85
|
+
function buildSelectorRows(entries, filtered) {
|
|
86
|
+
const indexByValue = new Map(filtered.map((option, index) => [option.value, index]));
|
|
87
|
+
const rows = [];
|
|
88
|
+
for (const entry of entries) {
|
|
89
|
+
if (isSelectorSection(entry)) {
|
|
90
|
+
const children = entry.options.filter((option) => indexByValue.has(option.value));
|
|
91
|
+
if (children.length === 0) continue;
|
|
92
|
+
rows.push({
|
|
93
|
+
kind: "section",
|
|
94
|
+
title: entry.title
|
|
95
|
+
});
|
|
96
|
+
for (const option of children) rows.push({
|
|
97
|
+
kind: "option",
|
|
98
|
+
option,
|
|
99
|
+
index: indexByValue.get(option.value)
|
|
100
|
+
});
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (!indexByValue.has(entry.value)) continue;
|
|
104
|
+
rows.push({
|
|
105
|
+
kind: "option",
|
|
106
|
+
option: entry,
|
|
107
|
+
index: indexByValue.get(entry.value)
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return rows;
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/Selector/SelectorPanel.vue
|
|
114
|
+
const _hoisted_1$1 = {
|
|
115
|
+
key: 0,
|
|
116
|
+
class: "astryx-selector-search"
|
|
117
|
+
};
|
|
118
|
+
const _hoisted_2$1 = [
|
|
119
|
+
"id",
|
|
120
|
+
"aria-label",
|
|
121
|
+
"aria-expanded",
|
|
122
|
+
"aria-controls",
|
|
123
|
+
"aria-activedescendant",
|
|
124
|
+
"placeholder",
|
|
125
|
+
"value"
|
|
126
|
+
];
|
|
127
|
+
const _hoisted_3$1 = ["aria-label"];
|
|
128
|
+
const _hoisted_4$1 = {
|
|
129
|
+
key: 1,
|
|
130
|
+
class: "astryx-selector-options"
|
|
131
|
+
};
|
|
132
|
+
const _hoisted_5$1 = {
|
|
133
|
+
key: 0,
|
|
134
|
+
class: "astryx-selector-section",
|
|
135
|
+
role: "presentation"
|
|
136
|
+
};
|
|
137
|
+
const _hoisted_6$1 = ["aria-label"];
|
|
138
|
+
const _hoisted_7$1 = { "aria-hidden": "true" };
|
|
139
|
+
const _hoisted_8$1 = [
|
|
140
|
+
"id",
|
|
141
|
+
"aria-selected",
|
|
142
|
+
"aria-disabled",
|
|
143
|
+
"onClick",
|
|
144
|
+
"onKeydown"
|
|
145
|
+
];
|
|
146
|
+
const _hoisted_9$1 = {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: "astryx-selector-option-mark"
|
|
149
|
+
};
|
|
150
|
+
const _hoisted_10 = { class: "astryx-selector-option-body" };
|
|
151
|
+
const _hoisted_11 = { class: "astryx-selector-option-copy" };
|
|
152
|
+
const _hoisted_12 = { class: "astryx-selector-option-label" };
|
|
153
|
+
const _hoisted_13 = {
|
|
154
|
+
key: 0,
|
|
155
|
+
class: "astryx-selector-option-description"
|
|
156
|
+
};
|
|
157
|
+
const _hoisted_14 = {
|
|
158
|
+
key: 1,
|
|
159
|
+
class: "astryx-selector-option-mark"
|
|
160
|
+
};
|
|
161
|
+
const _hoisted_15 = ["aria-selected", "aria-disabled"];
|
|
162
|
+
const _hoisted_16 = ["id", "onClick"];
|
|
163
|
+
const _hoisted_17 = {
|
|
164
|
+
key: 0,
|
|
165
|
+
class: "astryx-selector-option-mark"
|
|
166
|
+
};
|
|
167
|
+
const _hoisted_18 = { class: "astryx-selector-option-body" };
|
|
168
|
+
const _hoisted_19 = { class: "astryx-selector-option-copy" };
|
|
169
|
+
const _hoisted_20 = { class: "astryx-selector-option-label" };
|
|
170
|
+
const _hoisted_21 = {
|
|
171
|
+
key: 0,
|
|
172
|
+
class: "astryx-selector-option-description"
|
|
173
|
+
};
|
|
174
|
+
const _hoisted_22 = {
|
|
175
|
+
key: 1,
|
|
176
|
+
class: "astryx-selector-option-mark"
|
|
177
|
+
};
|
|
178
|
+
const _hoisted_23 = ["id"];
|
|
179
|
+
const _hoisted_24 = {
|
|
180
|
+
key: 2,
|
|
181
|
+
class: "astryx-selector-empty",
|
|
182
|
+
role: "presentation"
|
|
183
|
+
};
|
|
184
|
+
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
185
|
+
name: "AstryxSelectorPanel",
|
|
186
|
+
__name: "SelectorPanel",
|
|
187
|
+
props: {
|
|
188
|
+
searchable: { type: Boolean },
|
|
189
|
+
query: {},
|
|
190
|
+
placeholder: {},
|
|
191
|
+
clearLabel: {},
|
|
192
|
+
rows: {},
|
|
193
|
+
activeIndex: {},
|
|
194
|
+
modelValue: {},
|
|
195
|
+
indicatorPosition: {},
|
|
196
|
+
grid: { type: Boolean },
|
|
197
|
+
actionIndex: {},
|
|
198
|
+
loading: { type: Boolean },
|
|
199
|
+
showEmpty: { type: Boolean },
|
|
200
|
+
searching: { type: Boolean },
|
|
201
|
+
emptyText: {},
|
|
202
|
+
listboxId: {},
|
|
203
|
+
isOpen: { type: Boolean },
|
|
204
|
+
activeDescendant: {},
|
|
205
|
+
mark: {}
|
|
206
|
+
},
|
|
207
|
+
emits: [
|
|
208
|
+
"query",
|
|
209
|
+
"keydown",
|
|
210
|
+
"select"
|
|
211
|
+
],
|
|
212
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
213
|
+
const props = __props;
|
|
214
|
+
const emit = __emit;
|
|
215
|
+
const root = useTemplateRef("root");
|
|
216
|
+
const searchInput = useTemplateRef("searchInput");
|
|
217
|
+
function optionId(index) {
|
|
218
|
+
return `${props.listboxId}-option-${index}`;
|
|
219
|
+
}
|
|
220
|
+
function actionId(index) {
|
|
221
|
+
return `${props.listboxId}-action-${index}`;
|
|
222
|
+
}
|
|
223
|
+
function selected(option) {
|
|
224
|
+
return option.value === props.modelValue;
|
|
225
|
+
}
|
|
226
|
+
function active(index) {
|
|
227
|
+
return index === props.activeIndex;
|
|
228
|
+
}
|
|
229
|
+
__expose({ focusSearch: () => searchInput.value?.focus() });
|
|
230
|
+
function clearQuery(event) {
|
|
231
|
+
event.stopPropagation();
|
|
232
|
+
emit("query", "");
|
|
233
|
+
searchInput.value?.focus();
|
|
234
|
+
}
|
|
235
|
+
watch(() => [props.activeIndex, props.isOpen], ([index, open]) => {
|
|
236
|
+
if (!open || index < 0) return;
|
|
237
|
+
nextTick(() => {
|
|
238
|
+
const listbox = root.value?.parentElement;
|
|
239
|
+
const optionEl = listbox?.querySelector(`#${CSS.escape(optionId(index))}`);
|
|
240
|
+
if (!listbox || !optionEl) return;
|
|
241
|
+
const listboxRect = listbox.getBoundingClientRect();
|
|
242
|
+
const optionRect = optionEl.getBoundingClientRect();
|
|
243
|
+
if (optionRect.top < listboxRect.top) listbox.scrollTop -= listboxRect.top - optionRect.top;
|
|
244
|
+
else if (optionRect.bottom > listboxRect.bottom) listbox.scrollTop += optionRect.bottom - listboxRect.bottom;
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
return (_ctx, _cache) => {
|
|
248
|
+
return openBlock(), createElementBlock("div", {
|
|
249
|
+
ref_key: "root",
|
|
250
|
+
ref: root
|
|
251
|
+
}, [__props.searchable ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
252
|
+
createVNode(_sfc_main$5, {
|
|
253
|
+
class: "astryx-selector-search-icon",
|
|
254
|
+
icon: "search",
|
|
255
|
+
size: "sm"
|
|
256
|
+
}),
|
|
257
|
+
createElementVNode("input", {
|
|
258
|
+
id: `${__props.listboxId}-search`,
|
|
259
|
+
ref_key: "searchInput",
|
|
260
|
+
ref: searchInput,
|
|
261
|
+
type: "text",
|
|
262
|
+
class: "astryx-selector-search-input",
|
|
263
|
+
role: "combobox",
|
|
264
|
+
autocomplete: "off",
|
|
265
|
+
"aria-label": __props.placeholder,
|
|
266
|
+
"aria-expanded": __props.isOpen,
|
|
267
|
+
"aria-controls": __props.listboxId,
|
|
268
|
+
"aria-autocomplete": "list",
|
|
269
|
+
"aria-activedescendant": __props.activeDescendant,
|
|
270
|
+
placeholder: __props.placeholder,
|
|
271
|
+
value: __props.query,
|
|
272
|
+
onInput: _cache[0] || (_cache[0] = ($event) => emit("query", $event.target.value)),
|
|
273
|
+
onKeydown: _cache[1] || (_cache[1] = ($event) => emit("keydown", $event))
|
|
274
|
+
}, null, 40, _hoisted_2$1),
|
|
275
|
+
__props.query ? (openBlock(), createElementBlock("button", {
|
|
276
|
+
key: 0,
|
|
277
|
+
type: "button",
|
|
278
|
+
class: "astryx-selector-search-clear",
|
|
279
|
+
"aria-label": __props.clearLabel,
|
|
280
|
+
onClick: withModifiers(clearQuery, ["stop"])
|
|
281
|
+
}, [createVNode(_sfc_main$5, {
|
|
282
|
+
icon: "close",
|
|
283
|
+
size: "sm"
|
|
284
|
+
})], 8, _hoisted_3$1)) : createCommentVNode("v-if", true)
|
|
285
|
+
])) : createCommentVNode("v-if", true), !__props.loading && __props.rows.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_4$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (row, rowIndex) => {
|
|
286
|
+
return openBlock(), createElementBlock(Fragment, { key: row.kind === "section" ? `section-${rowIndex}` : row.option?.value }, [row.kind === "section" && !__props.grid ? (openBlock(), createElementBlock("div", _hoisted_5$1, toDisplayString(row.title), 1)) : row.kind === "section" ? (openBlock(), createElementBlock("div", {
|
|
287
|
+
key: 1,
|
|
288
|
+
class: "astryx-selector-section",
|
|
289
|
+
role: "rowgroup",
|
|
290
|
+
"aria-label": row.title
|
|
291
|
+
}, [createElementVNode("span", _hoisted_7$1, toDisplayString(row.title), 1)], 8, _hoisted_6$1)) : row.option && row.index != null && !__props.grid ? (openBlock(), createElementBlock("div", {
|
|
292
|
+
key: 2,
|
|
293
|
+
id: optionId(row.index),
|
|
294
|
+
role: "option",
|
|
295
|
+
tabindex: "-1",
|
|
296
|
+
class: normalizeClass(["astryx-selector-option", {
|
|
297
|
+
"is-active": active(row.index),
|
|
298
|
+
"is-selected": selected(row.option),
|
|
299
|
+
"is-disabled": row.option.disabled
|
|
300
|
+
}]),
|
|
301
|
+
"aria-selected": selected(row.option),
|
|
302
|
+
"aria-disabled": row.option.disabled,
|
|
303
|
+
onClick: ($event) => emit("select", row.option),
|
|
304
|
+
onKeydown: [withKeys(($event) => emit("select", row.option), ["enter"]), withKeys(withModifiers(($event) => emit("select", row.option), ["prevent"]), ["space"])]
|
|
305
|
+
}, [
|
|
306
|
+
__props.indicatorPosition === "start" ? (openBlock(), createElementBlock("span", _hoisted_9$1, [(openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
307
|
+
class: "astryx-selector-check",
|
|
308
|
+
state: selected(row.option) ? "checked" : "unchecked",
|
|
309
|
+
size: "sm",
|
|
310
|
+
"is-disabled": row.option.disabled
|
|
311
|
+
}, null, 8, ["state", "is-disabled"]))])) : createCommentVNode("v-if", true),
|
|
312
|
+
createElementVNode("span", _hoisted_10, [_ctx.$slots.option ? renderSlot(_ctx.$slots, "option", {
|
|
313
|
+
option: row.option,
|
|
314
|
+
isActive: active(row.index),
|
|
315
|
+
isSelected: selected(row.option)
|
|
316
|
+
}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [row.option.icon ? (openBlock(), createBlock(_sfc_main$5, {
|
|
317
|
+
key: 0,
|
|
318
|
+
class: "astryx-selector-option-icon",
|
|
319
|
+
icon: row.option.icon,
|
|
320
|
+
size: "sm"
|
|
321
|
+
}, null, 8, ["icon"])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_11, [createElementVNode("span", _hoisted_12, toDisplayString(row.option.label), 1), row.option.description ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(row.option.description), 1)) : createCommentVNode("v-if", true)])], 64))]),
|
|
322
|
+
__props.indicatorPosition === "end" ? (openBlock(), createElementBlock("span", _hoisted_14, [(openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
323
|
+
class: "astryx-selector-check",
|
|
324
|
+
state: selected(row.option) ? "checked" : "unchecked",
|
|
325
|
+
size: "sm",
|
|
326
|
+
"is-disabled": row.option.disabled
|
|
327
|
+
}, null, 8, ["state", "is-disabled"]))])) : createCommentVNode("v-if", true)
|
|
328
|
+
], 42, _hoisted_8$1)) : row.option && row.index != null ? (openBlock(), createElementBlock("div", {
|
|
329
|
+
key: 3,
|
|
330
|
+
class: normalizeClass(["astryx-selector-option", {
|
|
331
|
+
"is-active": active(row.index),
|
|
332
|
+
"is-selected": selected(row.option),
|
|
333
|
+
"is-disabled": row.option.disabled
|
|
334
|
+
}]),
|
|
335
|
+
role: "row",
|
|
336
|
+
"aria-selected": selected(row.option),
|
|
337
|
+
"aria-disabled": row.option.disabled || void 0
|
|
338
|
+
}, [
|
|
339
|
+
createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events -- 选项格不进 Tab 序,方向键和回车由组合框处理。 "),
|
|
340
|
+
createElementVNode("div", {
|
|
341
|
+
id: optionId(row.index),
|
|
342
|
+
class: "astryx-selector-option-main",
|
|
343
|
+
role: "gridcell",
|
|
344
|
+
tabindex: "-1",
|
|
345
|
+
onClick: ($event) => emit("select", row.option)
|
|
346
|
+
}, [
|
|
347
|
+
__props.indicatorPosition === "start" ? (openBlock(), createElementBlock("span", _hoisted_17, [(openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
348
|
+
class: "astryx-selector-check",
|
|
349
|
+
state: selected(row.option) ? "checked" : "unchecked",
|
|
350
|
+
size: "sm",
|
|
351
|
+
"is-disabled": row.option.disabled
|
|
352
|
+
}, null, 8, ["state", "is-disabled"]))])) : createCommentVNode("v-if", true),
|
|
353
|
+
createElementVNode("span", _hoisted_18, [_ctx.$slots.option ? renderSlot(_ctx.$slots, "option", {
|
|
354
|
+
option: row.option,
|
|
355
|
+
isActive: active(row.index),
|
|
356
|
+
isSelected: selected(row.option)
|
|
357
|
+
}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [row.option.icon ? (openBlock(), createBlock(_sfc_main$5, {
|
|
358
|
+
key: 0,
|
|
359
|
+
class: "astryx-selector-option-icon",
|
|
360
|
+
icon: row.option.icon,
|
|
361
|
+
size: "sm"
|
|
362
|
+
}, null, 8, ["icon"])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_19, [createElementVNode("span", _hoisted_20, toDisplayString(row.option.label), 1), row.option.description ? (openBlock(), createElementBlock("span", _hoisted_21, toDisplayString(row.option.description), 1)) : createCommentVNode("v-if", true)])], 64))]),
|
|
363
|
+
__props.indicatorPosition === "end" ? (openBlock(), createElementBlock("span", _hoisted_22, [(openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
364
|
+
class: "astryx-selector-check",
|
|
365
|
+
state: selected(row.option) ? "checked" : "unchecked",
|
|
366
|
+
size: "sm",
|
|
367
|
+
"is-disabled": row.option.disabled
|
|
368
|
+
}, null, 8, ["state", "is-disabled"]))])) : createCommentVNode("v-if", true)
|
|
369
|
+
], 8, _hoisted_16),
|
|
370
|
+
createElementVNode("div", {
|
|
371
|
+
id: unref(isOptionAction)(row.option.action) ? void 0 : actionId(row.index),
|
|
372
|
+
class: normalizeClass(["astryx-selector-option-action", { "is-active": __props.actionIndex === row.index }]),
|
|
373
|
+
role: "gridcell",
|
|
374
|
+
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"])),
|
|
375
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"]))
|
|
376
|
+
}, [unref(isOptionAction)(row.option.action) ? (openBlock(), createBlock(unref(OptionAction), {
|
|
377
|
+
key: 0,
|
|
378
|
+
node: row.option.action,
|
|
379
|
+
"dom-id": actionId(row.index)
|
|
380
|
+
}, null, 8, ["node", "dom-id"])) : createCommentVNode("v-if", true)], 42, _hoisted_23)
|
|
381
|
+
], 10, _hoisted_15)) : createCommentVNode("v-if", true)], 64);
|
|
382
|
+
}), 128))])) : __props.showEmpty ? (openBlock(), createElementBlock("div", _hoisted_24, [!__props.searching && _ctx.$slots.empty ? renderSlot(_ctx.$slots, "empty", {}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(__props.emptyText), 1)], 64))])) : createCommentVNode("v-if", true)], 512);
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/Selector/useSelectorPopup.ts
|
|
388
|
+
/** 选项操作把弹出层锁成网格,并拦下行末方向键。 */
|
|
389
|
+
function useSelectorPopup(options) {
|
|
390
|
+
const gridLatched = ref(false);
|
|
391
|
+
watch(options.flatOptions, (list) => {
|
|
392
|
+
if (list.some((option) => isOptionAction(option.action))) gridLatched.value = true;
|
|
393
|
+
}, { immediate: true });
|
|
394
|
+
const gridMode = computed(() => gridLatched.value);
|
|
395
|
+
function optionDomId(index) {
|
|
396
|
+
return `${options.listboxId.value}-option-${index}`;
|
|
397
|
+
}
|
|
398
|
+
function actionDomId(index) {
|
|
399
|
+
return `${options.listboxId.value}-action-${index}`;
|
|
400
|
+
}
|
|
401
|
+
function rowHasAction(index) {
|
|
402
|
+
const value = options.filteredValues.value[index]?.value;
|
|
403
|
+
return isOptionAction(options.flatOptions.value.find((option) => option.value === value)?.action);
|
|
404
|
+
}
|
|
405
|
+
const actionGrid = useOptionActionGrid({
|
|
406
|
+
enabled: () => gridMode.value,
|
|
407
|
+
isOpen: () => options.isOpen.value,
|
|
408
|
+
activeIndex: options.activeIndex,
|
|
409
|
+
rowHasAction,
|
|
410
|
+
getListbox: () => options.listboxRef.value,
|
|
411
|
+
optionId: optionDomId,
|
|
412
|
+
actionId: actionDomId
|
|
413
|
+
});
|
|
414
|
+
const popupKind = computed(() => {
|
|
415
|
+
if (options.isReadOnly()) return void 0;
|
|
416
|
+
if (options.isSheet()) return "dialog";
|
|
417
|
+
return gridMode.value ? "grid" : "listbox";
|
|
418
|
+
});
|
|
419
|
+
function onTriggerKeyDown(event) {
|
|
420
|
+
if (isImeKeyEvent(event)) {
|
|
421
|
+
if (!event.defaultPrevented) options.emitKeydown(event);
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
if (!actionGrid.onKeyDown(event)) options.onListKeyDown(event);
|
|
425
|
+
if (!event.defaultPrevented) options.emitKeydown(event);
|
|
426
|
+
}
|
|
427
|
+
function onSearchKeyDown(event) {
|
|
428
|
+
if (isImeKeyEvent(event)) return;
|
|
429
|
+
if (!actionGrid.onKeyDown(event)) options.onListKeyDown(event);
|
|
430
|
+
}
|
|
431
|
+
return {
|
|
432
|
+
gridMode,
|
|
433
|
+
actionGrid,
|
|
434
|
+
popupKind,
|
|
435
|
+
onTriggerKeyDown,
|
|
436
|
+
onSearchKeyDown
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/Selector/Selector.vue
|
|
441
|
+
const _hoisted_1 = ["data-variant"];
|
|
442
|
+
const _hoisted_2 = [
|
|
443
|
+
"id",
|
|
444
|
+
"disabled",
|
|
445
|
+
"role",
|
|
446
|
+
"aria-haspopup",
|
|
447
|
+
"aria-expanded",
|
|
448
|
+
"aria-controls",
|
|
449
|
+
"aria-readonly",
|
|
450
|
+
"aria-disabled",
|
|
451
|
+
"aria-busy",
|
|
452
|
+
"aria-required",
|
|
453
|
+
"aria-label",
|
|
454
|
+
"aria-describedby",
|
|
455
|
+
"aria-autocomplete",
|
|
456
|
+
"aria-activedescendant"
|
|
457
|
+
];
|
|
458
|
+
const _hoisted_3 = { class: "astryx-selector-value-label" };
|
|
459
|
+
const _hoisted_4 = ["aria-label"];
|
|
460
|
+
const _hoisted_5 = ["id"];
|
|
461
|
+
const _hoisted_6 = { class: "astryx-selector-sheet-title" };
|
|
462
|
+
const _hoisted_7 = [
|
|
463
|
+
"id",
|
|
464
|
+
"role",
|
|
465
|
+
"data-placement"
|
|
466
|
+
];
|
|
467
|
+
const _hoisted_8 = [
|
|
468
|
+
"id",
|
|
469
|
+
"name",
|
|
470
|
+
"value",
|
|
471
|
+
"disabled",
|
|
472
|
+
"aria-label"
|
|
473
|
+
];
|
|
474
|
+
const _hoisted_9 = ["value"];
|
|
475
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
476
|
+
name: "AstryxSelector",
|
|
477
|
+
inheritAttrs: false,
|
|
478
|
+
__name: "Selector",
|
|
479
|
+
props: {
|
|
480
|
+
modelValue: { default: null },
|
|
481
|
+
options: {},
|
|
482
|
+
placeholder: {},
|
|
483
|
+
disabled: {
|
|
484
|
+
type: Boolean,
|
|
485
|
+
default: false
|
|
486
|
+
},
|
|
487
|
+
disabledMessage: {},
|
|
488
|
+
disabledReason: {},
|
|
489
|
+
status: { default: "default" },
|
|
490
|
+
statusMessage: {},
|
|
491
|
+
statusVariant: { default: "attached" },
|
|
492
|
+
size: { default: "md" },
|
|
493
|
+
variant: { default: "default" },
|
|
494
|
+
presentation: { default: "popover" },
|
|
495
|
+
searchable: {
|
|
496
|
+
type: Boolean,
|
|
497
|
+
default: false
|
|
498
|
+
},
|
|
499
|
+
searchPlaceholder: {},
|
|
500
|
+
clearable: {
|
|
501
|
+
type: Boolean,
|
|
502
|
+
default: false
|
|
503
|
+
},
|
|
504
|
+
hasClear: { type: Boolean },
|
|
505
|
+
clearLabel: {},
|
|
506
|
+
emptyText: {},
|
|
507
|
+
emptySearchText: {},
|
|
508
|
+
label: {},
|
|
509
|
+
isLabelHidden: {
|
|
510
|
+
type: Boolean,
|
|
511
|
+
default: false
|
|
512
|
+
},
|
|
513
|
+
description: {},
|
|
514
|
+
width: {},
|
|
515
|
+
name: {},
|
|
516
|
+
isReadOnly: {
|
|
517
|
+
type: Boolean,
|
|
518
|
+
default: false
|
|
519
|
+
},
|
|
520
|
+
isLoading: {
|
|
521
|
+
type: Boolean,
|
|
522
|
+
default: false
|
|
523
|
+
},
|
|
524
|
+
isOptional: {
|
|
525
|
+
type: Boolean,
|
|
526
|
+
default: false
|
|
527
|
+
},
|
|
528
|
+
isRequired: {
|
|
529
|
+
type: Boolean,
|
|
530
|
+
default: false
|
|
531
|
+
},
|
|
532
|
+
indicatorPosition: { default: "end" },
|
|
533
|
+
containerClass: { type: [
|
|
534
|
+
Boolean,
|
|
535
|
+
null,
|
|
536
|
+
String,
|
|
537
|
+
Object,
|
|
538
|
+
Array
|
|
539
|
+
] },
|
|
540
|
+
containerStyle: { type: [
|
|
541
|
+
Boolean,
|
|
542
|
+
null,
|
|
543
|
+
String,
|
|
544
|
+
Object,
|
|
545
|
+
Array
|
|
546
|
+
] },
|
|
547
|
+
controlClass: { type: [
|
|
548
|
+
Boolean,
|
|
549
|
+
null,
|
|
550
|
+
String,
|
|
551
|
+
Object,
|
|
552
|
+
Array
|
|
553
|
+
] },
|
|
554
|
+
controlStyle: { type: [
|
|
555
|
+
Boolean,
|
|
556
|
+
null,
|
|
557
|
+
String,
|
|
558
|
+
Object,
|
|
559
|
+
Array
|
|
560
|
+
] }
|
|
561
|
+
},
|
|
562
|
+
emits: [
|
|
563
|
+
"update:modelValue",
|
|
564
|
+
"change",
|
|
565
|
+
"search",
|
|
566
|
+
"click",
|
|
567
|
+
"focus",
|
|
568
|
+
"keydown"
|
|
569
|
+
],
|
|
570
|
+
setup(__props, { emit: __emit }) {
|
|
571
|
+
const props = __props;
|
|
572
|
+
const emit = __emit;
|
|
573
|
+
const slots = useSlots();
|
|
574
|
+
const attrs = useAttrs();
|
|
575
|
+
const SelectionMark = useIndicator("check");
|
|
576
|
+
const parts = useFieldPartStyling({
|
|
577
|
+
component: "Selector",
|
|
578
|
+
props,
|
|
579
|
+
attrs,
|
|
580
|
+
reservedAttrs: [
|
|
581
|
+
"id",
|
|
582
|
+
"role",
|
|
583
|
+
"aria-label",
|
|
584
|
+
"aria-labelledby",
|
|
585
|
+
"aria-describedby",
|
|
586
|
+
"aria-expanded",
|
|
587
|
+
"aria-controls",
|
|
588
|
+
"aria-haspopup",
|
|
589
|
+
"aria-activedescendant",
|
|
590
|
+
"aria-autocomplete",
|
|
591
|
+
"aria-disabled",
|
|
592
|
+
"aria-required",
|
|
593
|
+
"aria-busy",
|
|
594
|
+
"aria-readonly"
|
|
595
|
+
]
|
|
596
|
+
});
|
|
597
|
+
const triggerVariant = computed(() => normalizeTriggerVariant(props.variant));
|
|
598
|
+
const generatedId = `astryx-selector-${useId()}`;
|
|
599
|
+
const selectorId = computed(() => typeof attrs.id === "string" && attrs.id !== "" ? attrs.id : generatedId);
|
|
600
|
+
const listboxId = computed(() => `${selectorId.value}-listbox`);
|
|
601
|
+
const messages = useAstryxMessages();
|
|
602
|
+
const resolvedPlaceholder = computed(() => props.placeholder ?? messages.value.selector.placeholder);
|
|
603
|
+
const resolvedSearchPlaceholder = computed(() => props.searchPlaceholder ?? messages.value.selector.search);
|
|
604
|
+
const resolvedClearLabel = computed(() => props.clearLabel ?? messages.value.selector.clear);
|
|
605
|
+
/** 值上的清除按钮带着字段名,读屏能听出清的是哪一项。 */
|
|
606
|
+
const valueClearLabel = computed(() => props.clearLabel ?? messages.value.selector.clearField(props.label));
|
|
607
|
+
const resolvedEmptyText = computed(() => props.emptyText ?? messages.value.selector.empty);
|
|
608
|
+
const resolvedEmptySearchText = computed(() => props.emptySearchText ?? messages.value.selector.emptySearch);
|
|
609
|
+
const inputGroup = useInputGroupContext();
|
|
610
|
+
const inGroup = computed(() => inputGroup != null);
|
|
611
|
+
const control = useFieldControlState({
|
|
612
|
+
disabled: () => props.disabled || (inputGroup?.disabled.value ?? false),
|
|
613
|
+
readOnly: () => props.isReadOnly,
|
|
614
|
+
loading: () => props.isLoading
|
|
615
|
+
});
|
|
616
|
+
const announce = useAnnounce();
|
|
617
|
+
const readOnlyId = computed(() => `${selectorId.value}-readonly`);
|
|
618
|
+
const disabledMessageId = computed(() => `${selectorId.value}-disabled-message`);
|
|
619
|
+
const disabledTooltipId = computed(() => `${selectorId.value}-disabled-tooltip`);
|
|
620
|
+
/** 旧名 disabledReason 和新名 disabledMessage 等价。 */
|
|
621
|
+
const resolvedDisabledMessage = computed(() => props.disabledMessage?.trim() || props.disabledReason?.trim());
|
|
622
|
+
const showsDisabledMessage = computed(() => control.isDisabled.value && !!resolvedDisabledMessage.value);
|
|
623
|
+
const disabledTooltip = useButtonTooltip(showsDisabledMessage);
|
|
624
|
+
const hasClear = computed(() => props.hasClear || props.clearable);
|
|
625
|
+
const fieldRef = useTemplateRef("fieldRef");
|
|
626
|
+
const listboxRef = useTemplateRef("listboxRef");
|
|
627
|
+
const panelRef = useTemplateRef("panelRef");
|
|
628
|
+
const sheetSlot = useTemplateRef("sheetSlot");
|
|
629
|
+
useScrollbars(listboxRef);
|
|
630
|
+
const isSheet = computed(() => props.presentation === "bottom-sheet");
|
|
631
|
+
const sheetLabel = computed(() => props.label || resolvedPlaceholder.value);
|
|
632
|
+
const isEnabled = control.canActivate;
|
|
633
|
+
const isSearchable = computed(() => props.searchable && control.canActivate.value);
|
|
634
|
+
const normalizedEntries = computed(() => normalizeSelectorEntries(props.options));
|
|
635
|
+
const flatOptions = computed(() => flattenSelectorOptions(normalizedEntries.value));
|
|
636
|
+
const comboboxOptions = computed(() => flatOptions.value.map((opt) => ({
|
|
637
|
+
value: opt.value,
|
|
638
|
+
label: opt.label,
|
|
639
|
+
disabled: opt.disabled ?? false
|
|
640
|
+
})));
|
|
641
|
+
const modelValueRef = computed({
|
|
642
|
+
get: () => props.modelValue,
|
|
643
|
+
set: (value) => {
|
|
644
|
+
emit("update:modelValue", value);
|
|
645
|
+
emit("change", value);
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
const combobox = useCombobox({
|
|
649
|
+
options: comboboxOptions,
|
|
650
|
+
modelValue: modelValueRef,
|
|
651
|
+
isEnabled,
|
|
652
|
+
isSearchable,
|
|
653
|
+
onChange: (value) => {
|
|
654
|
+
modelValueRef.value = value;
|
|
655
|
+
},
|
|
656
|
+
onOpenChange: (isOpen) => {
|
|
657
|
+
if (isOpen && props.searchable) nextTick(() => {
|
|
658
|
+
panelRef.value?.focusSearch();
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
const sheetOpen = computed({
|
|
663
|
+
get: () => isSheet.value && combobox.isOpen.value,
|
|
664
|
+
set: (open) => {
|
|
665
|
+
if (!open && combobox.isOpen.value) combobox.close();
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
const popoverOpen = computed(() => combobox.isOpen.value && !isSheet.value);
|
|
669
|
+
const { position, teleportTarget } = usePositionedLayer({
|
|
670
|
+
anchor: fieldRef,
|
|
671
|
+
layer: listboxRef,
|
|
672
|
+
isOpen: popoverOpen,
|
|
673
|
+
placement: computed(() => "below"),
|
|
674
|
+
alignment: computed(() => "start"),
|
|
675
|
+
gap: 4
|
|
676
|
+
});
|
|
677
|
+
function focusTrigger() {
|
|
678
|
+
focusSelectorTrigger(fieldRef.value);
|
|
679
|
+
}
|
|
680
|
+
bindListboxEscape(listboxRef, (event) => {
|
|
681
|
+
onSelectorListboxEscape(event, {
|
|
682
|
+
isOpen: combobox.isOpen.value,
|
|
683
|
+
layer: listboxRef.value,
|
|
684
|
+
close: () => combobox.close(),
|
|
685
|
+
focusTrigger
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
useDismiss({
|
|
689
|
+
container: listboxRef,
|
|
690
|
+
trigger: fieldRef,
|
|
691
|
+
isEnabled: popoverOpen,
|
|
692
|
+
dismissOnEscape: "close",
|
|
693
|
+
onEscape: () => dismissSelectorEscape(listboxRef.value, () => combobox.close(), focusTrigger),
|
|
694
|
+
onDismiss: () => combobox.close()
|
|
695
|
+
});
|
|
696
|
+
const selectedOption = computed(() => {
|
|
697
|
+
if (props.modelValue == null) return null;
|
|
698
|
+
return flatOptions.value.find((opt) => opt.value === props.modelValue) ?? null;
|
|
699
|
+
});
|
|
700
|
+
const fieldLabel = computed(() => props.label || resolvedPlaceholder.value);
|
|
701
|
+
const hideLabel = computed(() => props.isLabelHidden || !props.label);
|
|
702
|
+
const statusType = computed(() => {
|
|
703
|
+
const status = props.status;
|
|
704
|
+
if (status == null || status === "default") return "default";
|
|
705
|
+
if (typeof status === "string") return status;
|
|
706
|
+
return status.type;
|
|
707
|
+
});
|
|
708
|
+
const fieldStatus = computed(() => {
|
|
709
|
+
const status = props.status;
|
|
710
|
+
if (status && typeof status === "object") return status;
|
|
711
|
+
if (!props.statusMessage || statusType.value === "default") return void 0;
|
|
712
|
+
return {
|
|
713
|
+
type: statusType.value,
|
|
714
|
+
message: props.statusMessage
|
|
715
|
+
};
|
|
716
|
+
});
|
|
717
|
+
const effectiveStatusVariant = computed(() => fieldStatusPlacement(props.variant, props.statusVariant));
|
|
718
|
+
const statusGlyph = computed(() => {
|
|
719
|
+
const type = statusType.value;
|
|
720
|
+
if (type !== "error" && type !== "warning" && type !== "success" || effectiveStatusVariant.value === "detached") return void 0;
|
|
721
|
+
return type;
|
|
722
|
+
});
|
|
723
|
+
const displayRows = computed(() => buildSelectorRows(normalizedEntries.value, combobox.filteredOptions.value));
|
|
724
|
+
const displayText = computed(() => {
|
|
725
|
+
return selectedOption.value?.label ?? resolvedPlaceholder.value;
|
|
726
|
+
});
|
|
727
|
+
const isEmpty = computed(() => {
|
|
728
|
+
return combobox.filteredOptions.value.length === 0;
|
|
729
|
+
});
|
|
730
|
+
const isSearching = computed(() => props.searchable && combobox.searchQuery.value.trim() !== "");
|
|
731
|
+
const showEmpty = computed(() => isEmpty.value && !control.isLoading.value);
|
|
732
|
+
const describedBy = computed(() => {
|
|
733
|
+
return [
|
|
734
|
+
inGroup.value ? inputGroup?.describedBy.value : void 0,
|
|
735
|
+
control.isReadOnly.value ? readOnlyId.value : void 0,
|
|
736
|
+
showsDisabledMessage.value ? disabledMessageId.value : void 0
|
|
737
|
+
].filter(Boolean).join(" ") || void 0;
|
|
738
|
+
});
|
|
739
|
+
const announcement = computed(() => searchResultMessage({
|
|
740
|
+
isOpen: combobox.isOpen.value,
|
|
741
|
+
isLoading: control.isLoading.value,
|
|
742
|
+
query: combobox.searchQuery.value,
|
|
743
|
+
matchCount: combobox.filteredOptions.value.length,
|
|
744
|
+
emptyText: resolvedEmptyText.value,
|
|
745
|
+
emptySearchText: resolvedEmptySearchText.value,
|
|
746
|
+
resultCount: messages.value.selector.resultCount
|
|
747
|
+
}));
|
|
748
|
+
watch(announcement, (message) => {
|
|
749
|
+
if (message) announce(message);
|
|
750
|
+
});
|
|
751
|
+
function onTriggerClick(event) {
|
|
752
|
+
emit("click", event);
|
|
753
|
+
if (control.canActivate.value) combobox.toggle();
|
|
754
|
+
}
|
|
755
|
+
function onTriggerFocus(event) {
|
|
756
|
+
emit("focus", event);
|
|
757
|
+
disabledTooltip.onFocus(event);
|
|
758
|
+
}
|
|
759
|
+
const popup = useSelectorPopup({
|
|
760
|
+
flatOptions,
|
|
761
|
+
filteredValues: computed(() => combobox.filteredOptions.value),
|
|
762
|
+
listboxId,
|
|
763
|
+
listboxRef,
|
|
764
|
+
isOpen: combobox.isOpen,
|
|
765
|
+
activeIndex: combobox.activeIndex,
|
|
766
|
+
onListKeyDown: (event) => {
|
|
767
|
+
const wasOpen = combobox.isOpen.value;
|
|
768
|
+
combobox.onKeyDown(event);
|
|
769
|
+
if (event.key === "Escape" && wasOpen) focusTrigger();
|
|
770
|
+
},
|
|
771
|
+
isReadOnly: () => control.isReadOnly.value,
|
|
772
|
+
isSheet: () => isSheet.value,
|
|
773
|
+
emitKeydown: (event) => emit("keydown", event)
|
|
774
|
+
});
|
|
775
|
+
const { gridMode, actionGrid, popupKind } = popup;
|
|
776
|
+
function onOptionClick(option) {
|
|
777
|
+
if (!option.disabled) combobox.select(option.value);
|
|
778
|
+
}
|
|
779
|
+
function onClear(event) {
|
|
780
|
+
event.stopPropagation();
|
|
781
|
+
if (!control.canActivate.value) return;
|
|
782
|
+
modelValueRef.value = null;
|
|
783
|
+
combobox.close();
|
|
784
|
+
}
|
|
785
|
+
function onPanelQuery(value) {
|
|
786
|
+
combobox.setSearchQuery(value);
|
|
787
|
+
emit("search", value);
|
|
788
|
+
}
|
|
789
|
+
const anchorWidth = ref(0);
|
|
790
|
+
function syncAnchorWidth() {
|
|
791
|
+
anchorWidth.value = fieldRef.value?.getBoundingClientRect().width ?? 0;
|
|
792
|
+
}
|
|
793
|
+
const listboxStyle = computed(() => isSheet.value ? void 0 : {
|
|
794
|
+
top: `${position.value.top}px`,
|
|
795
|
+
left: `${position.value.left}px`,
|
|
796
|
+
minWidth: anchorWidth.value > 0 ? `${anchorWidth.value}px` : void 0
|
|
797
|
+
});
|
|
798
|
+
watch(combobox.isOpen, (open) => {
|
|
799
|
+
if (open) syncAnchorWidth();
|
|
800
|
+
}, { flush: "pre" });
|
|
801
|
+
onMounted(syncAnchorWidth);
|
|
802
|
+
return (_ctx, _cache) => {
|
|
803
|
+
return openBlock(), createBlock(_sfc_main$7, {
|
|
804
|
+
class: normalizeClass(["astryx-selector", [
|
|
805
|
+
unref(parts).containerClass.value,
|
|
806
|
+
`size-${props.size}`,
|
|
807
|
+
`status-${statusType.value}`,
|
|
808
|
+
`variant-${triggerVariant.value}`
|
|
809
|
+
]]),
|
|
810
|
+
style: normalizeStyle(unref(parts).containerStyle.value),
|
|
811
|
+
label: fieldLabel.value,
|
|
812
|
+
"input-id": selectorId.value,
|
|
813
|
+
"is-label-hidden": inGroup.value || hideLabel.value,
|
|
814
|
+
"is-disabled": unref(control).isDisabled.value,
|
|
815
|
+
"is-optional": inGroup.value ? false : props.isOptional,
|
|
816
|
+
"is-required": inGroup.value ? false : props.isRequired,
|
|
817
|
+
description: inGroup.value ? void 0 : props.description,
|
|
818
|
+
status: inGroup.value ? void 0 : fieldStatus.value,
|
|
819
|
+
"status-variant": effectiveStatusVariant.value,
|
|
820
|
+
width: props.width
|
|
821
|
+
}, {
|
|
822
|
+
default: withCtx(() => [
|
|
823
|
+
createElementVNode("div", {
|
|
824
|
+
ref_key: "fieldRef",
|
|
825
|
+
ref: fieldRef,
|
|
826
|
+
class: normalizeClass(["astryx-selector-field", [unref(parts).controlClass(), {
|
|
827
|
+
"is-open": unref(combobox).isOpen.value,
|
|
828
|
+
"is-disabled": unref(control).isDisabled.value,
|
|
829
|
+
"is-readonly": unref(control).isReadOnly.value,
|
|
830
|
+
"is-loading": unref(control).isLoading.value,
|
|
831
|
+
"is-ghost": triggerVariant.value === "ghost"
|
|
832
|
+
}]]),
|
|
833
|
+
style: normalizeStyle(unref(parts).controlStyle()),
|
|
834
|
+
"data-variant": triggerVariant.value,
|
|
835
|
+
onPointerenter: _cache[2] || (_cache[2] = (...args) => unref(disabledTooltip).onPointerEnter && unref(disabledTooltip).onPointerEnter(...args)),
|
|
836
|
+
onPointerleave: _cache[3] || (_cache[3] = (...args) => unref(disabledTooltip).onPointerLeave && unref(disabledTooltip).onPointerLeave(...args))
|
|
837
|
+
}, [
|
|
838
|
+
createElementVNode("button", mergeProps(unref(parts).forwardedAttrs(), {
|
|
839
|
+
id: selectorId.value,
|
|
840
|
+
type: "button",
|
|
841
|
+
class: ["astryx-selector-trigger", {
|
|
842
|
+
"is-open": unref(combobox).isOpen.value,
|
|
843
|
+
"is-disabled": unref(control).isDisabled.value
|
|
844
|
+
}],
|
|
845
|
+
disabled: unref(control).isDisabled.value && !showsDisabledMessage.value,
|
|
846
|
+
role: unref(control).isReadOnly.value || !props.searchable ? "combobox" : void 0,
|
|
847
|
+
"aria-haspopup": unref(popupKind),
|
|
848
|
+
"aria-expanded": unref(control).isReadOnly.value ? false : unref(combobox).isOpen.value,
|
|
849
|
+
"aria-controls": unref(control).isReadOnly.value ? void 0 : listboxId.value,
|
|
850
|
+
"aria-readonly": unref(control).isReadOnly.value || void 0,
|
|
851
|
+
"aria-disabled": showsDisabledMessage.value || void 0,
|
|
852
|
+
"aria-busy": unref(control).isLoading.value || void 0,
|
|
853
|
+
"aria-required": props.isRequired || void 0,
|
|
854
|
+
"aria-label": props.label,
|
|
855
|
+
"aria-describedby": describedBy.value,
|
|
856
|
+
"aria-autocomplete": props.searchable ? void 0 : "none",
|
|
857
|
+
"aria-activedescendant": !props.searchable && !unref(control).isReadOnly.value ? unref(actionGrid).activeDescendant.value : void 0,
|
|
858
|
+
onClick: onTriggerClick,
|
|
859
|
+
onFocus: onTriggerFocus,
|
|
860
|
+
onBlur: _cache[0] || (_cache[0] = (...args) => unref(disabledTooltip).onBlur && unref(disabledTooltip).onBlur(...args)),
|
|
861
|
+
onKeydown: _cache[1] || (_cache[1] = (...args) => unref(popup).onTriggerKeyDown && unref(popup).onTriggerKeyDown(...args))
|
|
862
|
+
}), [createElementVNode("span", { class: normalizeClass(["astryx-selector-value", {
|
|
863
|
+
"is-placeholder": !selectedOption.value,
|
|
864
|
+
"is-rich": unref(slots).selected,
|
|
865
|
+
"is-grouped": inGroup.value
|
|
866
|
+
}]) }, [unref(slots).selected ? renderSlot(_ctx.$slots, "selected", { option: selectedOption.value }, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [selectedOption.value?.icon ? (openBlock(), createBlock(_sfc_main$5, {
|
|
867
|
+
key: 0,
|
|
868
|
+
class: "astryx-selector-value-icon",
|
|
869
|
+
icon: selectedOption.value.icon,
|
|
870
|
+
size: "sm"
|
|
871
|
+
}, null, 8, ["icon"])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_3, toDisplayString(displayText.value), 1)], 64))], 2)], 16, _hoisted_2),
|
|
872
|
+
unref(control).isLoading.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
873
|
+
key: 0,
|
|
874
|
+
class: "astryx-selector-spinner",
|
|
875
|
+
size: "sm",
|
|
876
|
+
"aria-label": unref(messages).selector.loading
|
|
877
|
+
}, null, 8, ["aria-label"])) : createCommentVNode("v-if", true),
|
|
878
|
+
hasClear.value && selectedOption.value && unref(control).canActivate.value ? (openBlock(), createElementBlock("button", {
|
|
879
|
+
key: 1,
|
|
880
|
+
type: "button",
|
|
881
|
+
class: "astryx-selector-clear",
|
|
882
|
+
"aria-label": valueClearLabel.value,
|
|
883
|
+
onClick: onClear
|
|
884
|
+
}, [createVNode(_sfc_main$5, {
|
|
885
|
+
icon: "close",
|
|
886
|
+
size: "sm"
|
|
887
|
+
})], 8, _hoisted_4)) : createCommentVNode("v-if", true),
|
|
888
|
+
statusGlyph.value ? (openBlock(), createBlock(_sfc_main$8, {
|
|
889
|
+
key: 2,
|
|
890
|
+
type: statusGlyph.value,
|
|
891
|
+
message: fieldStatus.value?.message,
|
|
892
|
+
tooltip: effectiveStatusVariant.value === "tooltip"
|
|
893
|
+
}, null, 8, [
|
|
894
|
+
"type",
|
|
895
|
+
"message",
|
|
896
|
+
"tooltip"
|
|
897
|
+
])) : unref(control).canActivate.value ? (openBlock(), createBlock(_sfc_main$5, {
|
|
898
|
+
key: 3,
|
|
899
|
+
class: "astryx-selector-icon",
|
|
900
|
+
icon: "chevronDown",
|
|
901
|
+
size: "sm"
|
|
902
|
+
})) : createCommentVNode("v-if", true),
|
|
903
|
+
unref(control).isReadOnly.value ? (openBlock(), createElementBlock("span", {
|
|
904
|
+
key: 4,
|
|
905
|
+
id: readOnlyId.value,
|
|
906
|
+
class: "astryx-visually-hidden"
|
|
907
|
+
}, toDisplayString(unref(messages).selector.readOnly), 9, _hoisted_5)) : createCommentVNode("v-if", true)
|
|
908
|
+
], 46, _hoisted_1),
|
|
909
|
+
showsDisabledMessage.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
910
|
+
key: 0,
|
|
911
|
+
id: disabledMessageId.value
|
|
912
|
+
}, {
|
|
913
|
+
default: withCtx(() => [createTextVNode(toDisplayString(resolvedDisabledMessage.value), 1)]),
|
|
914
|
+
_: 1
|
|
915
|
+
}, 8, ["id"])) : createCommentVNode("v-if", true),
|
|
916
|
+
showsDisabledMessage.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
917
|
+
key: 1,
|
|
918
|
+
id: disabledTooltipId.value,
|
|
919
|
+
anchor: fieldRef.value,
|
|
920
|
+
open: unref(disabledTooltip).isOpen.value,
|
|
921
|
+
text: resolvedDisabledMessage.value ?? "",
|
|
922
|
+
onPointerEnter: unref(disabledTooltip).onTooltipPointerEnter,
|
|
923
|
+
onPointerLeave: unref(disabledTooltip).onTooltipPointerLeave
|
|
924
|
+
}, null, 8, [
|
|
925
|
+
"id",
|
|
926
|
+
"anchor",
|
|
927
|
+
"open",
|
|
928
|
+
"text",
|
|
929
|
+
"onPointerEnter",
|
|
930
|
+
"onPointerLeave"
|
|
931
|
+
])) : createCommentVNode("v-if", true),
|
|
932
|
+
isSheet.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
933
|
+
key: 2,
|
|
934
|
+
"is-open": sheetOpen.value,
|
|
935
|
+
"onUpdate:isOpen": _cache[4] || (_cache[4] = ($event) => sheetOpen.value = $event),
|
|
936
|
+
height: "hug",
|
|
937
|
+
label: sheetLabel.value,
|
|
938
|
+
padding: 2
|
|
939
|
+
}, {
|
|
940
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
941
|
+
ref_key: "sheetSlot",
|
|
942
|
+
ref: sheetSlot,
|
|
943
|
+
class: "astryx-selector-sheet"
|
|
944
|
+
}, [createElementVNode("div", _hoisted_6, toDisplayString(sheetLabel.value), 1)], 512)]),
|
|
945
|
+
_: 1
|
|
946
|
+
}, 8, ["is-open", "label"])) : createCommentVNode("v-if", true),
|
|
947
|
+
(openBlock(), createBlock(Teleport, { to: isSheet.value && sheetSlot.value ? sheetSlot.value : unref(teleportTarget) }, [withDirectives(createElementVNode("div", {
|
|
948
|
+
id: listboxId.value,
|
|
949
|
+
ref_key: "listboxRef",
|
|
950
|
+
ref: listboxRef,
|
|
951
|
+
role: unref(gridMode) ? "grid" : "listbox",
|
|
952
|
+
class: normalizeClass(["astryx-selector-listbox astryx-layer", { "is-sheet": isSheet.value }]),
|
|
953
|
+
"data-placement": isSheet.value ? void 0 : unref(position).placement,
|
|
954
|
+
style: normalizeStyle(listboxStyle.value),
|
|
955
|
+
tabindex: "-1"
|
|
956
|
+
}, [createVNode(_sfc_main$1, {
|
|
957
|
+
ref_key: "panelRef",
|
|
958
|
+
ref: panelRef,
|
|
959
|
+
searchable: props.searchable,
|
|
960
|
+
query: unref(combobox).searchQuery.value,
|
|
961
|
+
placeholder: resolvedSearchPlaceholder.value,
|
|
962
|
+
"clear-label": resolvedClearLabel.value,
|
|
963
|
+
rows: displayRows.value,
|
|
964
|
+
"active-index": unref(combobox).activeIndex.value,
|
|
965
|
+
"model-value": props.modelValue,
|
|
966
|
+
"indicator-position": props.indicatorPosition,
|
|
967
|
+
grid: unref(gridMode),
|
|
968
|
+
"action-index": unref(actionGrid).column.value === "action" ? unref(combobox).activeIndex.value : -1,
|
|
969
|
+
loading: unref(control).isLoading.value,
|
|
970
|
+
"show-empty": showEmpty.value,
|
|
971
|
+
searching: isSearching.value,
|
|
972
|
+
"empty-text": isSearching.value ? resolvedEmptySearchText.value : resolvedEmptyText.value,
|
|
973
|
+
"listbox-id": listboxId.value,
|
|
974
|
+
"is-open": unref(combobox).isOpen.value,
|
|
975
|
+
"active-descendant": unref(actionGrid).activeDescendant.value,
|
|
976
|
+
mark: unref(SelectionMark),
|
|
977
|
+
onQuery: onPanelQuery,
|
|
978
|
+
onKeydown: unref(popup).onSearchKeyDown,
|
|
979
|
+
onSelect: onOptionClick
|
|
980
|
+
}, createSlots({ _: 2 }, [unref(slots).option ? {
|
|
981
|
+
name: "option",
|
|
982
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps(slotProps)))]),
|
|
983
|
+
key: "0"
|
|
984
|
+
} : void 0, unref(slots).empty ? {
|
|
985
|
+
name: "empty",
|
|
986
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
|
|
987
|
+
key: "1"
|
|
988
|
+
} : void 0]), 1032, [
|
|
989
|
+
"searchable",
|
|
990
|
+
"query",
|
|
991
|
+
"placeholder",
|
|
992
|
+
"clear-label",
|
|
993
|
+
"rows",
|
|
994
|
+
"active-index",
|
|
995
|
+
"model-value",
|
|
996
|
+
"indicator-position",
|
|
997
|
+
"grid",
|
|
998
|
+
"action-index",
|
|
999
|
+
"loading",
|
|
1000
|
+
"show-empty",
|
|
1001
|
+
"searching",
|
|
1002
|
+
"empty-text",
|
|
1003
|
+
"listbox-id",
|
|
1004
|
+
"is-open",
|
|
1005
|
+
"active-descendant",
|
|
1006
|
+
"mark",
|
|
1007
|
+
"onKeydown"
|
|
1008
|
+
])], 14, _hoisted_7), [[vShow, unref(combobox).isOpen.value]])], 8, ["to"])),
|
|
1009
|
+
props.name ? (openBlock(), createElementBlock("select", {
|
|
1010
|
+
key: 3,
|
|
1011
|
+
id: `${selectorId.value}-hidden-select`,
|
|
1012
|
+
name: props.name,
|
|
1013
|
+
value: props.modelValue ?? "",
|
|
1014
|
+
disabled: unref(control).isDisabled.value,
|
|
1015
|
+
"aria-label": props.label || resolvedPlaceholder.value,
|
|
1016
|
+
tabindex: "-1",
|
|
1017
|
+
style: {
|
|
1018
|
+
"position": "absolute",
|
|
1019
|
+
"left": "-9999px",
|
|
1020
|
+
"width": "1px",
|
|
1021
|
+
"height": "1px"
|
|
1022
|
+
}
|
|
1023
|
+
}, [_cache[5] || (_cache[5] = createElementVNode("option", { value: "" }, null, -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(flatOptions.value, (option) => {
|
|
1024
|
+
return openBlock(), createElementBlock("option", {
|
|
1025
|
+
key: option.value,
|
|
1026
|
+
value: option.value
|
|
1027
|
+
}, toDisplayString(option.label), 9, _hoisted_9);
|
|
1028
|
+
}), 128))], 8, _hoisted_8)) : createCommentVNode("v-if", true)
|
|
1029
|
+
]),
|
|
1030
|
+
_: 3
|
|
1031
|
+
}, 8, [
|
|
1032
|
+
"class",
|
|
1033
|
+
"style",
|
|
1034
|
+
"label",
|
|
1035
|
+
"input-id",
|
|
1036
|
+
"is-label-hidden",
|
|
1037
|
+
"is-disabled",
|
|
1038
|
+
"is-optional",
|
|
1039
|
+
"is-required",
|
|
1040
|
+
"description",
|
|
1041
|
+
"status",
|
|
1042
|
+
"status-variant",
|
|
1043
|
+
"width"
|
|
1044
|
+
]);
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
//#endregion
|
|
1049
|
+
export { _sfc_main as t };
|