@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,1456 @@
|
|
|
1
|
+
import { n as useButtonTooltip } from "./Button-ONOoHdkg.js";
|
|
2
|
+
import { t as _sfc_main$2 } from "./ButtonTooltip-CNKOQHYR.js";
|
|
3
|
+
import { t as useAnnounce } from "./announce-B210eJVf.js";
|
|
4
|
+
import { t as useCombobox } from "./useCombobox-CTo5C-gc.js";
|
|
5
|
+
import { n as useDevWarning } from "./useDevWarning-DznOpOHT.js";
|
|
6
|
+
import { t as useDisclosureHandle } from "./useDisclosureHandle-Df3HhAfC.js";
|
|
7
|
+
import { a as isImeKeyEvent } from "./layerDepth-CNDh-IHb.js";
|
|
8
|
+
import { t as useFieldControlState } from "./useFieldControlState-voICDrys.js";
|
|
9
|
+
import { n as focusElement } from "./focus-l8jVTcqd.js";
|
|
10
|
+
import { n as isKeyboardModality, r as trackInteractionModality } from "./interactionModality-ACpTMhak.js";
|
|
11
|
+
import { s as useAstryxMessages } from "./context-DWfi56sq.js";
|
|
12
|
+
import { n as useOverflow } from "./useOverflow-VrwF5oek.js";
|
|
13
|
+
import { t as useScrollbars } from "./useScrollbars-C2NJ6Qwq.js";
|
|
14
|
+
import { t as _sfc_main$3 } from "./BottomSheet-B4sc3F1S.js";
|
|
15
|
+
import { t as _sfc_main$4 } from "./Icon-KDnUyY7f.js";
|
|
16
|
+
import { t as _sfc_main$5 } from "./Spinner-DdVUadii.js";
|
|
17
|
+
import { t as useIndicator } from "./useIndicator-MZmfBWid.js";
|
|
18
|
+
import { t as _sfc_main$6 } from "./Field--OEsLBfE.js";
|
|
19
|
+
import { n as useInputGroupContext } from "./context-IvbU9c3T.js";
|
|
20
|
+
import { t as useFieldPartStyling } from "./fieldParts--SyRZVQG.js";
|
|
21
|
+
import { n as fieldStatusPlacement, t as normalizeTriggerVariant } from "./triggerVariant-BsL8jMHs.js";
|
|
22
|
+
import { n as _sfc_main$7, t as searchResultMessage } from "./searchResultMessage-mCpJBvra.js";
|
|
23
|
+
import { t as _sfc_main$8 } from "./Token-BfS4vi__.js";
|
|
24
|
+
import { n as useAnchoredListbox, t as scrollOptionIntoView } from "./useAnchoredListbox-DGxxKHZb.js";
|
|
25
|
+
import { n as OptionAction, r as isOptionAction, t as useOptionActionGrid } from "./useOptionActionGrid-CkJcuvaU.js";
|
|
26
|
+
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, shallowRef, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
27
|
+
import "../styles/layer.css";
|
|
28
|
+
import "../styles/button.css";
|
|
29
|
+
import "../styles/visually-hidden-utility.css";
|
|
30
|
+
import "../styles/multi-selector.css";
|
|
31
|
+
//#region src/MultiSelector/options.ts
|
|
32
|
+
const SELECT_ALL_VALUE = "__astryx_select_all__";
|
|
33
|
+
function isDivider(option) {
|
|
34
|
+
return typeof option === "object" && option !== null && "type" in option && option.type === "divider";
|
|
35
|
+
}
|
|
36
|
+
function isSection(option) {
|
|
37
|
+
return typeof option === "object" && option !== null && "type" in option && option.type === "section";
|
|
38
|
+
}
|
|
39
|
+
function normalizeOption(option) {
|
|
40
|
+
if (typeof option === "string") return {
|
|
41
|
+
value: option,
|
|
42
|
+
label: option
|
|
43
|
+
};
|
|
44
|
+
return option;
|
|
45
|
+
}
|
|
46
|
+
function matches(option, query) {
|
|
47
|
+
if (query === "") return true;
|
|
48
|
+
return option.label.toLowerCase().includes(query) || (option.description?.toLowerCase().includes(query) ?? false);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 把字符串、对象、分隔线和分组收成渲染行。搜索时丢掉对不上的选项和因此变空的分组。
|
|
52
|
+
*/
|
|
53
|
+
function flattenOptions(options, query) {
|
|
54
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
55
|
+
const rows = [];
|
|
56
|
+
let pendingDivider = false;
|
|
57
|
+
function pushDivider() {
|
|
58
|
+
if (!pendingDivider || rows.length === 0) return;
|
|
59
|
+
rows.push({
|
|
60
|
+
kind: "divider",
|
|
61
|
+
key: `divider-${rows.length}`
|
|
62
|
+
});
|
|
63
|
+
pendingDivider = false;
|
|
64
|
+
}
|
|
65
|
+
function pushOption(option, key) {
|
|
66
|
+
if (!matches(option, normalizedQuery)) return;
|
|
67
|
+
pushDivider();
|
|
68
|
+
rows.push({
|
|
69
|
+
kind: "option",
|
|
70
|
+
key,
|
|
71
|
+
option
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
options.forEach((option, index) => {
|
|
75
|
+
if (typeof option === "string") {
|
|
76
|
+
pushOption(normalizeOption(option), `option-${option}`);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (isDivider(option)) {
|
|
80
|
+
pendingDivider = true;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (isSection(option)) {
|
|
84
|
+
const children = option.options.map(normalizeOption).filter((item) => matches(item, normalizedQuery));
|
|
85
|
+
if (children.length === 0) return;
|
|
86
|
+
pendingDivider = rows.length > 0;
|
|
87
|
+
pushDivider();
|
|
88
|
+
rows.push({
|
|
89
|
+
kind: "heading",
|
|
90
|
+
key: `heading-${option.label}-${index}`,
|
|
91
|
+
label: option.label
|
|
92
|
+
});
|
|
93
|
+
for (const child of children) rows.push({
|
|
94
|
+
kind: "option",
|
|
95
|
+
key: `${option.label}-${String(child.value)}`,
|
|
96
|
+
option: child
|
|
97
|
+
});
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
pushOption(option, `option-${String(option.value)}`);
|
|
101
|
+
});
|
|
102
|
+
return rows;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/MultiSelector/MultiSelectorPanel.vue
|
|
106
|
+
const _hoisted_1$1 = ["data-keyboard-focus"];
|
|
107
|
+
const _hoisted_2$1 = [
|
|
108
|
+
"id",
|
|
109
|
+
"aria-label",
|
|
110
|
+
"aria-controls",
|
|
111
|
+
"aria-activedescendant",
|
|
112
|
+
"placeholder",
|
|
113
|
+
"value"
|
|
114
|
+
];
|
|
115
|
+
const _hoisted_3$1 = ["aria-label"];
|
|
116
|
+
const _hoisted_4$1 = ["id", "data-option-id"];
|
|
117
|
+
const _hoisted_5$1 = { class: "astryx-multi-selector-option-label" };
|
|
118
|
+
const _hoisted_6$1 = ["id", "data-option-id"];
|
|
119
|
+
const _hoisted_7$1 = { class: "astryx-multi-selector-option-label" };
|
|
120
|
+
const _hoisted_8$1 = ["id"];
|
|
121
|
+
const _hoisted_9$1 = [
|
|
122
|
+
"id",
|
|
123
|
+
"aria-selected",
|
|
124
|
+
"data-option-id"
|
|
125
|
+
];
|
|
126
|
+
const _hoisted_10$1 = { class: "astryx-multi-selector-option-label" };
|
|
127
|
+
const _hoisted_11$1 = ["aria-selected"];
|
|
128
|
+
const _hoisted_12$1 = ["id", "data-option-id"];
|
|
129
|
+
const _hoisted_13 = { class: "astryx-multi-selector-option-label" };
|
|
130
|
+
const _hoisted_14 = ["id"];
|
|
131
|
+
const _hoisted_15 = {
|
|
132
|
+
key: 0,
|
|
133
|
+
class: "astryx-multi-selector-divider",
|
|
134
|
+
role: "separator"
|
|
135
|
+
};
|
|
136
|
+
const _hoisted_16 = {
|
|
137
|
+
key: 1,
|
|
138
|
+
class: "astryx-multi-selector-heading",
|
|
139
|
+
role: "presentation"
|
|
140
|
+
};
|
|
141
|
+
const _hoisted_17 = ["aria-label"];
|
|
142
|
+
const _hoisted_18 = { "aria-hidden": "true" };
|
|
143
|
+
const _hoisted_19 = [
|
|
144
|
+
"id",
|
|
145
|
+
"aria-selected",
|
|
146
|
+
"aria-disabled",
|
|
147
|
+
"data-option-id",
|
|
148
|
+
"onMouseenter",
|
|
149
|
+
"onClick"
|
|
150
|
+
];
|
|
151
|
+
const _hoisted_20 = { class: "astryx-multi-selector-option-copy" };
|
|
152
|
+
const _hoisted_21 = { class: "astryx-multi-selector-option-label" };
|
|
153
|
+
const _hoisted_22 = {
|
|
154
|
+
key: 0,
|
|
155
|
+
class: "astryx-multi-selector-option-description"
|
|
156
|
+
};
|
|
157
|
+
const _hoisted_23 = ["aria-selected", "aria-disabled"];
|
|
158
|
+
const _hoisted_24 = [
|
|
159
|
+
"id",
|
|
160
|
+
"data-option-id",
|
|
161
|
+
"onMouseenter",
|
|
162
|
+
"onClick"
|
|
163
|
+
];
|
|
164
|
+
const _hoisted_25 = { class: "astryx-multi-selector-option-copy" };
|
|
165
|
+
const _hoisted_26 = { class: "astryx-multi-selector-option-label" };
|
|
166
|
+
const _hoisted_27 = {
|
|
167
|
+
key: 0,
|
|
168
|
+
class: "astryx-multi-selector-option-description"
|
|
169
|
+
};
|
|
170
|
+
const _hoisted_28 = ["id"];
|
|
171
|
+
const _hoisted_29 = {
|
|
172
|
+
key: 6,
|
|
173
|
+
class: "astryx-multi-selector-empty",
|
|
174
|
+
role: "presentation"
|
|
175
|
+
};
|
|
176
|
+
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
177
|
+
name: "AstryxMultiSelectorPanel",
|
|
178
|
+
__name: "MultiSelectorPanel",
|
|
179
|
+
props: {
|
|
180
|
+
searchable: { type: Boolean },
|
|
181
|
+
query: {},
|
|
182
|
+
searchId: {},
|
|
183
|
+
searchPlaceholder: {},
|
|
184
|
+
clearLabel: {},
|
|
185
|
+
listboxId: {},
|
|
186
|
+
activeIndex: {},
|
|
187
|
+
activeDescendant: {},
|
|
188
|
+
grid: { type: Boolean },
|
|
189
|
+
actionIndex: {},
|
|
190
|
+
createOption: {},
|
|
191
|
+
selectAll: { type: Boolean },
|
|
192
|
+
selectAllIndex: {},
|
|
193
|
+
selectAllLabel: {},
|
|
194
|
+
selectAllState: {},
|
|
195
|
+
checkboxPosition: {},
|
|
196
|
+
size: {},
|
|
197
|
+
loading: { type: Boolean },
|
|
198
|
+
realMatchCount: {},
|
|
199
|
+
rows: {},
|
|
200
|
+
showEmpty: { type: Boolean },
|
|
201
|
+
emptyText: {},
|
|
202
|
+
emptySearchText: {},
|
|
203
|
+
searchKeyboardFocus: { type: Boolean },
|
|
204
|
+
mark: {},
|
|
205
|
+
isSelected: { type: Function },
|
|
206
|
+
checkboxState: { type: Function },
|
|
207
|
+
optionIndex: { type: Function },
|
|
208
|
+
optionDomId: { type: Function },
|
|
209
|
+
actionDomId: { type: Function }
|
|
210
|
+
},
|
|
211
|
+
emits: [
|
|
212
|
+
"query",
|
|
213
|
+
"keydown",
|
|
214
|
+
"clearQuery",
|
|
215
|
+
"searchFocus",
|
|
216
|
+
"searchBlur",
|
|
217
|
+
"toggle",
|
|
218
|
+
"highlight"
|
|
219
|
+
],
|
|
220
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
221
|
+
const props = __props;
|
|
222
|
+
const emit = __emit;
|
|
223
|
+
const searchRef = useTemplateRef("searchRef");
|
|
224
|
+
const markSize = computed(() => props.size === "lg" ? "md" : "sm");
|
|
225
|
+
__expose({
|
|
226
|
+
focusSearch: () => searchRef.value?.focus(),
|
|
227
|
+
searchInput: searchRef
|
|
228
|
+
});
|
|
229
|
+
function actionOf(option) {
|
|
230
|
+
return option?.action;
|
|
231
|
+
}
|
|
232
|
+
return (_ctx, _cache) => {
|
|
233
|
+
return openBlock(), createElementBlock("div", null, [
|
|
234
|
+
__props.searchable ? (openBlock(), createElementBlock("div", {
|
|
235
|
+
key: 0,
|
|
236
|
+
class: "astryx-multi-selector-search",
|
|
237
|
+
"data-keyboard-focus": __props.searchKeyboardFocus ? "true" : void 0
|
|
238
|
+
}, [
|
|
239
|
+
createVNode(_sfc_main$4, {
|
|
240
|
+
class: "astryx-multi-selector-search-icon",
|
|
241
|
+
icon: "search",
|
|
242
|
+
size: "sm"
|
|
243
|
+
}),
|
|
244
|
+
createElementVNode("input", {
|
|
245
|
+
id: __props.searchId,
|
|
246
|
+
ref_key: "searchRef",
|
|
247
|
+
ref: searchRef,
|
|
248
|
+
class: "astryx-multi-selector-search-input",
|
|
249
|
+
type: "text",
|
|
250
|
+
role: "combobox",
|
|
251
|
+
autocomplete: "off",
|
|
252
|
+
"aria-label": __props.searchPlaceholder,
|
|
253
|
+
"aria-expanded": "true",
|
|
254
|
+
"aria-controls": __props.listboxId,
|
|
255
|
+
"aria-autocomplete": "list",
|
|
256
|
+
"aria-activedescendant": __props.activeDescendant,
|
|
257
|
+
placeholder: __props.searchPlaceholder,
|
|
258
|
+
value: __props.query,
|
|
259
|
+
onInput: _cache[0] || (_cache[0] = ($event) => emit("query", $event)),
|
|
260
|
+
onFocus: _cache[1] || (_cache[1] = ($event) => emit("searchFocus")),
|
|
261
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => emit("searchBlur")),
|
|
262
|
+
onKeydown: _cache[3] || (_cache[3] = ($event) => emit("keydown", $event))
|
|
263
|
+
}, null, 40, _hoisted_2$1),
|
|
264
|
+
__props.query ? (openBlock(), createElementBlock("button", {
|
|
265
|
+
key: 0,
|
|
266
|
+
type: "button",
|
|
267
|
+
class: "astryx-multi-selector-search-clear",
|
|
268
|
+
"aria-label": __props.clearLabel,
|
|
269
|
+
onClick: _cache[4] || (_cache[4] = withModifiers(($event) => emit("clearQuery"), ["stop"]))
|
|
270
|
+
}, [createVNode(_sfc_main$4, {
|
|
271
|
+
icon: "close",
|
|
272
|
+
size: "sm"
|
|
273
|
+
})], 8, _hoisted_3$1)) : createCommentVNode("v-if", true)
|
|
274
|
+
], 8, _hoisted_1$1)) : createCommentVNode("v-if", true),
|
|
275
|
+
createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/mouse-events-have-key-events -- 创建行不进 Tab 序,方向键和回车由组合框处理。 "),
|
|
276
|
+
__props.createOption && !__props.grid ? (openBlock(), createElementBlock("div", {
|
|
277
|
+
key: 1,
|
|
278
|
+
id: __props.optionDomId(0),
|
|
279
|
+
class: normalizeClass(["astryx-multi-selector-option is-create", { "is-active": __props.activeIndex === 0 }]),
|
|
280
|
+
role: "option",
|
|
281
|
+
"aria-selected": false,
|
|
282
|
+
"data-option-id": String(__props.createOption.value),
|
|
283
|
+
tabindex: "-1",
|
|
284
|
+
onMousedown: _cache[5] || (_cache[5] = withModifiers(() => {}, ["prevent"])),
|
|
285
|
+
onMouseenter: _cache[6] || (_cache[6] = ($event) => emit("highlight", 0)),
|
|
286
|
+
onClick: _cache[7] || (_cache[7] = ($event) => emit("toggle", __props.createOption.value))
|
|
287
|
+
}, [createElementVNode("span", _hoisted_5$1, toDisplayString(__props.createOption.label), 1)], 42, _hoisted_4$1)) : __props.createOption ? (openBlock(), createElementBlock("div", {
|
|
288
|
+
key: 2,
|
|
289
|
+
class: normalizeClass(["astryx-multi-selector-option is-create", { "is-active": __props.activeIndex === 0 }]),
|
|
290
|
+
role: "row",
|
|
291
|
+
"aria-selected": false
|
|
292
|
+
}, [
|
|
293
|
+
createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/mouse-events-have-key-events -- 创建行不进 Tab 序,方向键和回车由组合框处理。 "),
|
|
294
|
+
createElementVNode("div", {
|
|
295
|
+
id: __props.optionDomId(0),
|
|
296
|
+
class: "astryx-multi-selector-option-main",
|
|
297
|
+
role: "gridcell",
|
|
298
|
+
tabindex: "-1",
|
|
299
|
+
"data-option-id": String(__props.createOption.value),
|
|
300
|
+
onMousedown: _cache[8] || (_cache[8] = withModifiers(() => {}, ["prevent"])),
|
|
301
|
+
onMouseenter: _cache[9] || (_cache[9] = ($event) => emit("highlight", 0)),
|
|
302
|
+
onClick: _cache[10] || (_cache[10] = ($event) => emit("toggle", __props.createOption.value))
|
|
303
|
+
}, [createElementVNode("span", _hoisted_7$1, toDisplayString(__props.createOption.label), 1)], 40, _hoisted_6$1),
|
|
304
|
+
createElementVNode("div", {
|
|
305
|
+
id: __props.actionDomId(0),
|
|
306
|
+
class: "astryx-multi-selector-option-action",
|
|
307
|
+
role: "gridcell"
|
|
308
|
+
}, null, 8, _hoisted_8$1)
|
|
309
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
310
|
+
createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/mouse-events-have-key-events -- 全选行不进 Tab 序,方向键和空格由组合框处理。 "),
|
|
311
|
+
__props.selectAll && !__props.loading && __props.realMatchCount > 0 && !__props.grid ? (openBlock(), createElementBlock("div", {
|
|
312
|
+
key: 3,
|
|
313
|
+
id: __props.optionDomId(__props.selectAllIndex),
|
|
314
|
+
class: normalizeClass(["astryx-multi-selector-option is-select-all", { "is-active": __props.activeIndex === __props.selectAllIndex }]),
|
|
315
|
+
role: "option",
|
|
316
|
+
"aria-selected": __props.selectAllState === "checked",
|
|
317
|
+
"data-option-id": unref(SELECT_ALL_VALUE),
|
|
318
|
+
tabindex: "-1",
|
|
319
|
+
onMousedown: _cache[11] || (_cache[11] = withModifiers(() => {}, ["prevent"])),
|
|
320
|
+
onMouseenter: _cache[12] || (_cache[12] = ($event) => emit("highlight", __props.selectAllIndex)),
|
|
321
|
+
onClick: _cache[13] || (_cache[13] = ($event) => emit("toggle", unref("__astryx_select_all__")))
|
|
322
|
+
}, [
|
|
323
|
+
__props.checkboxPosition === "start" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
324
|
+
key: 0,
|
|
325
|
+
state: __props.selectAllState,
|
|
326
|
+
size: markSize.value
|
|
327
|
+
}, null, 8, ["state", "size"])) : createCommentVNode("v-if", true),
|
|
328
|
+
createElementVNode("span", _hoisted_10$1, toDisplayString(__props.selectAllLabel), 1),
|
|
329
|
+
__props.checkboxPosition === "end" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
330
|
+
key: 1,
|
|
331
|
+
state: __props.selectAllState,
|
|
332
|
+
size: markSize.value
|
|
333
|
+
}, null, 8, ["state", "size"])) : createCommentVNode("v-if", true)
|
|
334
|
+
], 42, _hoisted_9$1)) : __props.selectAll && !__props.loading && __props.realMatchCount > 0 ? (openBlock(), createElementBlock("div", {
|
|
335
|
+
key: 4,
|
|
336
|
+
class: normalizeClass(["astryx-multi-selector-option is-select-all", { "is-active": __props.activeIndex === __props.selectAllIndex }]),
|
|
337
|
+
role: "row",
|
|
338
|
+
"aria-selected": __props.selectAllState === "checked"
|
|
339
|
+
}, [
|
|
340
|
+
createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/mouse-events-have-key-events -- 全选行不进 Tab 序,方向键和空格由组合框处理。 "),
|
|
341
|
+
createElementVNode("div", {
|
|
342
|
+
id: __props.optionDomId(__props.selectAllIndex),
|
|
343
|
+
class: "astryx-multi-selector-option-main",
|
|
344
|
+
role: "gridcell",
|
|
345
|
+
tabindex: "-1",
|
|
346
|
+
"data-option-id": unref(SELECT_ALL_VALUE),
|
|
347
|
+
onMousedown: _cache[14] || (_cache[14] = withModifiers(() => {}, ["prevent"])),
|
|
348
|
+
onMouseenter: _cache[15] || (_cache[15] = ($event) => emit("highlight", __props.selectAllIndex)),
|
|
349
|
+
onClick: _cache[16] || (_cache[16] = ($event) => emit("toggle", unref("__astryx_select_all__")))
|
|
350
|
+
}, [
|
|
351
|
+
__props.checkboxPosition === "start" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
352
|
+
key: 0,
|
|
353
|
+
state: __props.selectAllState,
|
|
354
|
+
size: markSize.value
|
|
355
|
+
}, null, 8, ["state", "size"])) : createCommentVNode("v-if", true),
|
|
356
|
+
createElementVNode("span", _hoisted_13, toDisplayString(__props.selectAllLabel), 1),
|
|
357
|
+
__props.checkboxPosition === "end" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
358
|
+
key: 1,
|
|
359
|
+
state: __props.selectAllState,
|
|
360
|
+
size: markSize.value
|
|
361
|
+
}, null, 8, ["state", "size"])) : createCommentVNode("v-if", true)
|
|
362
|
+
], 40, _hoisted_12$1),
|
|
363
|
+
createElementVNode("div", {
|
|
364
|
+
id: __props.actionDomId(__props.selectAllIndex),
|
|
365
|
+
class: "astryx-multi-selector-option-action",
|
|
366
|
+
role: "gridcell"
|
|
367
|
+
}, null, 8, _hoisted_14)
|
|
368
|
+
], 10, _hoisted_11$1)) : createCommentVNode("v-if", true),
|
|
369
|
+
!__props.loading ? (openBlock(true), createElementBlock(Fragment, { key: 5 }, renderList(__props.rows, (row) => {
|
|
370
|
+
return openBlock(), createElementBlock(Fragment, { key: row.key }, [row.kind === "divider" ? (openBlock(), createElementBlock("div", _hoisted_15)) : row.kind === "heading" && !__props.grid ? (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(row.label), 1)) : row.kind === "heading" ? (openBlock(), createElementBlock("div", {
|
|
371
|
+
key: 2,
|
|
372
|
+
class: "astryx-multi-selector-heading",
|
|
373
|
+
role: "rowgroup",
|
|
374
|
+
"aria-label": row.label
|
|
375
|
+
}, [createElementVNode("span", _hoisted_18, toDisplayString(row.label), 1)], 8, _hoisted_17)) : row.option && !__props.grid ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/mouse-events-have-key-events -- 选项不进 Tab 序,方向键和空格由组合框处理。 "), createElementVNode("div", {
|
|
376
|
+
id: __props.optionDomId(__props.optionIndex(row.option.value)),
|
|
377
|
+
class: normalizeClass(["astryx-multi-selector-option", {
|
|
378
|
+
"is-active": __props.optionIndex(row.option.value) === __props.activeIndex,
|
|
379
|
+
"is-disabled": row.option.disabled
|
|
380
|
+
}]),
|
|
381
|
+
role: "option",
|
|
382
|
+
"aria-selected": __props.isSelected(row.option.value),
|
|
383
|
+
"aria-disabled": row.option.disabled || void 0,
|
|
384
|
+
"data-option-id": String(row.option.value),
|
|
385
|
+
tabindex: "-1",
|
|
386
|
+
onMousedown: _cache[17] || (_cache[17] = withModifiers(() => {}, ["prevent"])),
|
|
387
|
+
onMouseenter: ($event) => emit("highlight", __props.optionIndex(row.option.value)),
|
|
388
|
+
onClick: ($event) => emit("toggle", row.option.value)
|
|
389
|
+
}, [
|
|
390
|
+
__props.checkboxPosition === "start" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
391
|
+
key: 0,
|
|
392
|
+
state: __props.checkboxState(row.option),
|
|
393
|
+
size: markSize.value,
|
|
394
|
+
"is-disabled": row.option.disabled
|
|
395
|
+
}, null, 8, [
|
|
396
|
+
"state",
|
|
397
|
+
"size",
|
|
398
|
+
"is-disabled"
|
|
399
|
+
])) : createCommentVNode("v-if", true),
|
|
400
|
+
createElementVNode("span", _hoisted_20, [_ctx.$slots.option ? renderSlot(_ctx.$slots, "option", {
|
|
401
|
+
option: row.option,
|
|
402
|
+
selected: __props.isSelected(row.option.value),
|
|
403
|
+
active: __props.optionIndex(row.option.value) === __props.activeIndex
|
|
404
|
+
}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_21, toDisplayString(row.option.label), 1), row.option.description ? (openBlock(), createElementBlock("span", _hoisted_22, toDisplayString(row.option.description), 1)) : createCommentVNode("v-if", true)], 64))]),
|
|
405
|
+
__props.checkboxPosition === "end" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
406
|
+
key: 1,
|
|
407
|
+
state: __props.checkboxState(row.option),
|
|
408
|
+
size: markSize.value,
|
|
409
|
+
"is-disabled": row.option.disabled
|
|
410
|
+
}, null, 8, [
|
|
411
|
+
"state",
|
|
412
|
+
"size",
|
|
413
|
+
"is-disabled"
|
|
414
|
+
])) : createCommentVNode("v-if", true)
|
|
415
|
+
], 42, _hoisted_19)], 2112)) : row.option ? (openBlock(), createElementBlock("div", {
|
|
416
|
+
key: 4,
|
|
417
|
+
class: normalizeClass(["astryx-multi-selector-option", {
|
|
418
|
+
"is-active": __props.optionIndex(row.option.value) === __props.activeIndex,
|
|
419
|
+
"is-disabled": row.option.disabled
|
|
420
|
+
}]),
|
|
421
|
+
role: "row",
|
|
422
|
+
"aria-selected": __props.isSelected(row.option.value),
|
|
423
|
+
"aria-disabled": row.option.disabled || void 0
|
|
424
|
+
}, [
|
|
425
|
+
createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/mouse-events-have-key-events -- 选项不进 Tab 序,方向键和空格由组合框处理。 "),
|
|
426
|
+
createElementVNode("div", {
|
|
427
|
+
id: __props.optionDomId(__props.optionIndex(row.option.value)),
|
|
428
|
+
class: "astryx-multi-selector-option-main",
|
|
429
|
+
role: "gridcell",
|
|
430
|
+
tabindex: "-1",
|
|
431
|
+
"data-option-id": String(row.option.value),
|
|
432
|
+
onMousedown: _cache[18] || (_cache[18] = withModifiers(() => {}, ["prevent"])),
|
|
433
|
+
onMouseenter: ($event) => emit("highlight", __props.optionIndex(row.option.value)),
|
|
434
|
+
onClick: ($event) => emit("toggle", row.option.value)
|
|
435
|
+
}, [
|
|
436
|
+
__props.checkboxPosition === "start" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
437
|
+
key: 0,
|
|
438
|
+
state: __props.checkboxState(row.option),
|
|
439
|
+
size: markSize.value,
|
|
440
|
+
"is-disabled": row.option.disabled
|
|
441
|
+
}, null, 8, [
|
|
442
|
+
"state",
|
|
443
|
+
"size",
|
|
444
|
+
"is-disabled"
|
|
445
|
+
])) : createCommentVNode("v-if", true),
|
|
446
|
+
createElementVNode("span", _hoisted_25, [_ctx.$slots.option ? renderSlot(_ctx.$slots, "option", {
|
|
447
|
+
option: row.option,
|
|
448
|
+
selected: __props.isSelected(row.option.value),
|
|
449
|
+
active: __props.optionIndex(row.option.value) === __props.activeIndex
|
|
450
|
+
}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_26, toDisplayString(row.option.label), 1), row.option.description ? (openBlock(), createElementBlock("span", _hoisted_27, toDisplayString(row.option.description), 1)) : createCommentVNode("v-if", true)], 64))]),
|
|
451
|
+
__props.checkboxPosition === "end" ? (openBlock(), createBlock(resolveDynamicComponent(__props.mark), {
|
|
452
|
+
key: 1,
|
|
453
|
+
state: __props.checkboxState(row.option),
|
|
454
|
+
size: markSize.value,
|
|
455
|
+
"is-disabled": row.option.disabled
|
|
456
|
+
}, null, 8, [
|
|
457
|
+
"state",
|
|
458
|
+
"size",
|
|
459
|
+
"is-disabled"
|
|
460
|
+
])) : createCommentVNode("v-if", true)
|
|
461
|
+
], 40, _hoisted_24),
|
|
462
|
+
createElementVNode("div", {
|
|
463
|
+
id: unref(isOptionAction)(actionOf(row.option)) ? void 0 : __props.actionDomId(__props.optionIndex(row.option.value)),
|
|
464
|
+
class: normalizeClass(["astryx-multi-selector-option-action", { "is-active": __props.actionIndex === __props.optionIndex(row.option.value) }]),
|
|
465
|
+
role: "gridcell",
|
|
466
|
+
onMousedown: _cache[19] || (_cache[19] = withModifiers(() => {}, ["stop"])),
|
|
467
|
+
onClick: _cache[20] || (_cache[20] = withModifiers(() => {}, ["stop"]))
|
|
468
|
+
}, [unref(isOptionAction)(actionOf(row.option)) ? (openBlock(), createBlock(unref(OptionAction), {
|
|
469
|
+
key: 0,
|
|
470
|
+
node: actionOf(row.option),
|
|
471
|
+
"dom-id": __props.actionDomId(__props.optionIndex(row.option.value))
|
|
472
|
+
}, null, 8, ["node", "dom-id"])) : createCommentVNode("v-if", true)], 42, _hoisted_28)
|
|
473
|
+
], 10, _hoisted_23)) : createCommentVNode("v-if", true)], 64);
|
|
474
|
+
}), 128)) : createCommentVNode("v-if", true),
|
|
475
|
+
__props.showEmpty ? (openBlock(), createElementBlock("div", _hoisted_29, [!__props.query.trim() ? renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText), 1)], void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(__props.emptySearchText), 1)], 64))])) : createCommentVNode("v-if", true)
|
|
476
|
+
]);
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region src/MultiSelector/createOption.ts
|
|
482
|
+
/** 创建行的值永远不是真实选项。选中它会走创建,而不是切换勾选。 */
|
|
483
|
+
const CREATE_VALUE_PREFIX = "__astryx_multi_selector_create__";
|
|
484
|
+
function createOptionValue(query) {
|
|
485
|
+
return `${CREATE_VALUE_PREFIX}${query}`;
|
|
486
|
+
}
|
|
487
|
+
function readCreateQuery(value) {
|
|
488
|
+
if (typeof value !== "string" || !value.startsWith("__astryx_multi_selector_create__")) return null;
|
|
489
|
+
return value.slice(32);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* 输入去掉首尾空白后,和任何选项标签都不相同(忽略大小写)时,返回可以创建的文本。
|
|
493
|
+
* 空字符串、加载中、没开搜索,都不提供创建行。
|
|
494
|
+
*/
|
|
495
|
+
function resolveCreateQuery(input) {
|
|
496
|
+
if (!input.enabled) return null;
|
|
497
|
+
const trimmed = input.query.trim();
|
|
498
|
+
if (trimmed === "") return null;
|
|
499
|
+
const wanted = trimmed.toLowerCase();
|
|
500
|
+
return input.labels.some((label) => label.toLowerCase() === wanted) ? null : trimmed;
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/MultiSelector/multiSelectorKeyboard.ts
|
|
504
|
+
/** 多选面板的按键。输入法组合期间不处理。调用方要先放行选项操作那一列。 */
|
|
505
|
+
function applyMultiSelectorKey(event, ctx) {
|
|
506
|
+
if (!ctx.canActivate) return;
|
|
507
|
+
const searchInput = ctx.searchable && event.target instanceof HTMLInputElement;
|
|
508
|
+
switch (event.key) {
|
|
509
|
+
case "ArrowDown":
|
|
510
|
+
event.preventDefault();
|
|
511
|
+
if (!ctx.isOpen) ctx.open();
|
|
512
|
+
else ctx.highlightNext();
|
|
513
|
+
break;
|
|
514
|
+
case "ArrowUp":
|
|
515
|
+
event.preventDefault();
|
|
516
|
+
if (!ctx.isOpen) {
|
|
517
|
+
ctx.open();
|
|
518
|
+
ctx.highlightLast();
|
|
519
|
+
} else ctx.highlightPrevious();
|
|
520
|
+
break;
|
|
521
|
+
case "Home":
|
|
522
|
+
if (!searchInput && ctx.isOpen) {
|
|
523
|
+
event.preventDefault();
|
|
524
|
+
ctx.highlightFirst();
|
|
525
|
+
}
|
|
526
|
+
break;
|
|
527
|
+
case "End":
|
|
528
|
+
if (!searchInput && ctx.isOpen) {
|
|
529
|
+
event.preventDefault();
|
|
530
|
+
ctx.highlightLast();
|
|
531
|
+
}
|
|
532
|
+
break;
|
|
533
|
+
case "PageUp":
|
|
534
|
+
if (ctx.isOpen) {
|
|
535
|
+
event.preventDefault();
|
|
536
|
+
ctx.highlightFirst();
|
|
537
|
+
}
|
|
538
|
+
break;
|
|
539
|
+
case "PageDown":
|
|
540
|
+
if (ctx.isOpen) {
|
|
541
|
+
event.preventDefault();
|
|
542
|
+
ctx.highlightLast();
|
|
543
|
+
}
|
|
544
|
+
break;
|
|
545
|
+
case "Enter":
|
|
546
|
+
case " ":
|
|
547
|
+
if (event.key === " " && searchInput) break;
|
|
548
|
+
event.preventDefault();
|
|
549
|
+
if (ctx.isOpen && ctx.activeIndex >= 0) {
|
|
550
|
+
const option = ctx.optionAt(ctx.activeIndex);
|
|
551
|
+
if (option && !option.disabled) ctx.toggleValue(option.value);
|
|
552
|
+
} else if (ctx.isOpen && ctx.createQuery != null) ctx.commitCreate(ctx.createQuery);
|
|
553
|
+
else if (!ctx.isOpen) ctx.open();
|
|
554
|
+
break;
|
|
555
|
+
case "Escape":
|
|
556
|
+
if (ctx.isOpen) {
|
|
557
|
+
event.preventDefault();
|
|
558
|
+
ctx.close();
|
|
559
|
+
ctx.focusTrigger();
|
|
560
|
+
}
|
|
561
|
+
break;
|
|
562
|
+
case "Tab":
|
|
563
|
+
if (ctx.isOpen) ctx.close();
|
|
564
|
+
break;
|
|
565
|
+
case "Backspace":
|
|
566
|
+
case "Delete":
|
|
567
|
+
if (!searchInput && !ctx.isOpen && ctx.selectedCount > 0) {
|
|
568
|
+
event.preventDefault();
|
|
569
|
+
ctx.clearSelection();
|
|
570
|
+
}
|
|
571
|
+
break;
|
|
572
|
+
default: if (!searchInput && event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
573
|
+
event.preventDefault();
|
|
574
|
+
if (!ctx.isOpen) ctx.open();
|
|
575
|
+
ctx.jumpToMatch(event.key);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/MultiSelector/useMultiSelectorMenu.ts
|
|
581
|
+
/** 多选面板的列表、创建行和选项操作。触发器自己的展示留在组件里。 */
|
|
582
|
+
function useMultiSelectorMenu(host) {
|
|
583
|
+
const query = ref("");
|
|
584
|
+
const selectedValues = computed(() => host.props.modelValue ?? []);
|
|
585
|
+
const searchPlaceholder = computed(() => host.props.searchPlaceholder ?? host.messages.value.multiSelector.search);
|
|
586
|
+
const selectAllLabel = computed(() => host.props.selectAllLabel ?? host.messages.value.multiSelector.selectAll);
|
|
587
|
+
const emptyText = computed(() => host.props.emptyText ?? host.messages.value.multiSelector.empty);
|
|
588
|
+
const emptySearchText = computed(() => host.props.emptySearchText ?? host.messages.value.multiSelector.emptySearch);
|
|
589
|
+
const rows = computed(() => flattenOptions(host.props.options, query.value));
|
|
590
|
+
const optionByValue = computed(() => {
|
|
591
|
+
const map = /* @__PURE__ */ new Map();
|
|
592
|
+
for (const row of flattenOptions(host.props.options, "")) if (row.kind === "option" && row.option) map.set(row.option.value, row.option);
|
|
593
|
+
return map;
|
|
594
|
+
});
|
|
595
|
+
const createQuery = computed(() => resolveCreateQuery({
|
|
596
|
+
enabled: host.props.hasCreate === true && host.props.searchable === true && !host.isLoading.value,
|
|
597
|
+
query: query.value,
|
|
598
|
+
labels: [...optionByValue.value.values()].map((option) => option.label)
|
|
599
|
+
}));
|
|
600
|
+
const createOption = computed(() => {
|
|
601
|
+
if (createQuery.value == null) return null;
|
|
602
|
+
return {
|
|
603
|
+
value: createOptionValue(createQuery.value),
|
|
604
|
+
label: host.messages.value.multiSelector.create(createQuery.value)
|
|
605
|
+
};
|
|
606
|
+
});
|
|
607
|
+
const selectable = computed(() => {
|
|
608
|
+
const items = rows.value.flatMap((row) => row.kind === "option" && row.option ? [row.option] : []);
|
|
609
|
+
const head = [];
|
|
610
|
+
if (createOption.value) head.push(createOption.value);
|
|
611
|
+
if (host.props.selectAll) head.push({
|
|
612
|
+
value: SELECT_ALL_VALUE,
|
|
613
|
+
label: selectAllLabel.value
|
|
614
|
+
});
|
|
615
|
+
return [...head, ...items];
|
|
616
|
+
});
|
|
617
|
+
const comboboxOptions = computed(() => selectable.value.map((option) => ({
|
|
618
|
+
value: option.value,
|
|
619
|
+
label: option.label,
|
|
620
|
+
disabled: option.disabled ?? false,
|
|
621
|
+
description: option.description
|
|
622
|
+
})));
|
|
623
|
+
const dummyValue = ref(null);
|
|
624
|
+
let openingFromMount = false;
|
|
625
|
+
const selectAllIndex = computed(() => host.props.selectAll ? createOption.value ? 1 : 0 : -1);
|
|
626
|
+
const combobox = useCombobox({
|
|
627
|
+
options: comboboxOptions,
|
|
628
|
+
modelValue: dummyValue,
|
|
629
|
+
isEnabled: host.canActivate,
|
|
630
|
+
isSearchable: ref(false),
|
|
631
|
+
onChange: () => {},
|
|
632
|
+
onOpenChange: (isOpen) => {
|
|
633
|
+
host.emitOpenChange(isOpen);
|
|
634
|
+
if (isOpen && host.props.searchable && !openingFromMount) nextTick(() => host.getSearchInput()?.focus());
|
|
635
|
+
if (!isOpen) query.value = "";
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
const selectedOptions = computed(() => selectedValues.value.flatMap((value) => {
|
|
639
|
+
const option = optionByValue.value.get(value);
|
|
640
|
+
return option ? [option] : [];
|
|
641
|
+
}));
|
|
642
|
+
const enabledValues = computed(() => selectable.value.filter((option) => option.value !== "__astryx_select_all__" && readCreateQuery(option.value) == null && !option.disabled).map((option) => option.value));
|
|
643
|
+
const selectedEnabledCount = computed(() => enabledValues.value.filter((value) => selectedValues.value.includes(value)).length);
|
|
644
|
+
const selectAllState = computed(() => {
|
|
645
|
+
if (selectedEnabledCount.value === 0) return "unchecked";
|
|
646
|
+
if (selectedEnabledCount.value === enabledValues.value.length) return "checked";
|
|
647
|
+
return "indeterminate";
|
|
648
|
+
});
|
|
649
|
+
const realMatchCount = computed(() => rows.value.filter((row) => row.kind === "option").length);
|
|
650
|
+
const showEmpty = computed(() => !host.isLoading.value && realMatchCount.value === 0 && createOption.value == null);
|
|
651
|
+
const announcement = computed(() => searchResultMessage({
|
|
652
|
+
isOpen: combobox.isOpen.value,
|
|
653
|
+
isLoading: host.isLoading.value,
|
|
654
|
+
query: query.value,
|
|
655
|
+
matchCount: realMatchCount.value,
|
|
656
|
+
hasCreateRow: createOption.value != null,
|
|
657
|
+
emptyText: emptyText.value,
|
|
658
|
+
emptySearchText: emptySearchText.value,
|
|
659
|
+
resultCount: host.messages.value.multiSelector.resultCount
|
|
660
|
+
}));
|
|
661
|
+
const gridLatched = ref(false);
|
|
662
|
+
watch(optionByValue, (map) => {
|
|
663
|
+
if ([...map.values()].some((option) => isOptionAction(option.action))) gridLatched.value = true;
|
|
664
|
+
}, { immediate: true });
|
|
665
|
+
const gridMode = computed(() => gridLatched.value);
|
|
666
|
+
function optionDomId(index) {
|
|
667
|
+
return `${host.listboxId}-option-${index}`;
|
|
668
|
+
}
|
|
669
|
+
function actionDomId(index) {
|
|
670
|
+
return `${host.listboxId}-action-${index}`;
|
|
671
|
+
}
|
|
672
|
+
function rowHasAction(index) {
|
|
673
|
+
const option = selectable.value[index];
|
|
674
|
+
if (option == null) return false;
|
|
675
|
+
return isOptionAction(optionByValue.value.get(option.value)?.action);
|
|
676
|
+
}
|
|
677
|
+
const actionGrid = useOptionActionGrid({
|
|
678
|
+
enabled: () => gridMode.value,
|
|
679
|
+
isOpen: () => combobox.isOpen.value,
|
|
680
|
+
activeIndex: combobox.activeIndex,
|
|
681
|
+
rowHasAction,
|
|
682
|
+
getListbox: () => host.listboxRef.value,
|
|
683
|
+
optionId: optionDomId,
|
|
684
|
+
actionId: actionDomId
|
|
685
|
+
});
|
|
686
|
+
const popupKind = computed(() => {
|
|
687
|
+
if (host.props.presentation === "bottom-sheet") return "dialog";
|
|
688
|
+
return gridMode.value ? "grid" : "listbox";
|
|
689
|
+
});
|
|
690
|
+
watch(query, (value) => {
|
|
691
|
+
host.emitSearch(value);
|
|
692
|
+
if (combobox.isOpen.value) combobox.highlightFirst();
|
|
693
|
+
});
|
|
694
|
+
watch(announcement, (message) => {
|
|
695
|
+
if (message) host.announce(message);
|
|
696
|
+
});
|
|
697
|
+
watch(() => [host.props.hasCreate, host.props.searchable], ([create, search]) => {
|
|
698
|
+
const dev = import.meta.env?.DEV === true;
|
|
699
|
+
if (create && !search && dev) console.warn("[MultiSelector] hasCreate 需要同时开启 searchable,否则不会出现创建行。");
|
|
700
|
+
}, { immediate: true });
|
|
701
|
+
watch(() => combobox.activeIndex.value, (index) => {
|
|
702
|
+
if (!combobox.isOpen.value || index < 0) return;
|
|
703
|
+
const option = selectable.value[index];
|
|
704
|
+
nextTick(() => scrollOptionIntoView(host.listboxRef.value, option ? String(option.value) : void 0));
|
|
705
|
+
});
|
|
706
|
+
function commit(next, change) {
|
|
707
|
+
host.emitUpdate(next);
|
|
708
|
+
host.emitChange(next, change);
|
|
709
|
+
}
|
|
710
|
+
function commitCreate(created) {
|
|
711
|
+
commit([...selectedValues.value, created], {
|
|
712
|
+
type: "create",
|
|
713
|
+
query: created
|
|
714
|
+
});
|
|
715
|
+
host.announce(host.messages.value.multiSelector.created(created));
|
|
716
|
+
query.value = "";
|
|
717
|
+
}
|
|
718
|
+
function isSelected(value) {
|
|
719
|
+
return selectedValues.value.includes(value);
|
|
720
|
+
}
|
|
721
|
+
function toggleValue(value) {
|
|
722
|
+
if (!host.canActivate.value || host.isLoading.value) return;
|
|
723
|
+
const created = readCreateQuery(value);
|
|
724
|
+
if (created != null) {
|
|
725
|
+
commitCreate(created);
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
if (value === "__astryx_select_all__") {
|
|
729
|
+
const allOn = selectAllState.value === "checked";
|
|
730
|
+
const enabled = new Set(enabledValues.value);
|
|
731
|
+
commit(allOn ? selectedValues.value.filter((item) => !enabled.has(item)) : [.../* @__PURE__ */ new Set([...selectedValues.value, ...enabledValues.value])]);
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
if (optionByValue.value.get(value)?.disabled) return;
|
|
735
|
+
commit(isSelected(value) ? selectedValues.value.filter((item) => item !== value) : [...selectedValues.value, value]);
|
|
736
|
+
}
|
|
737
|
+
function optionIndex(value) {
|
|
738
|
+
return selectable.value.findIndex((option) => option.value === value);
|
|
739
|
+
}
|
|
740
|
+
function highlight(index) {
|
|
741
|
+
const option = selectable.value[index];
|
|
742
|
+
if (option && !option.disabled) combobox.activeIndex.value = index;
|
|
743
|
+
}
|
|
744
|
+
function checkboxState(option) {
|
|
745
|
+
if (option.value === "__astryx_select_all__") return selectAllState.value;
|
|
746
|
+
return isSelected(option.value) ? "checked" : "unchecked";
|
|
747
|
+
}
|
|
748
|
+
function onKeyDown(event) {
|
|
749
|
+
if (isImeKeyEvent(event) || event.isComposing) return;
|
|
750
|
+
if (actionGrid.onKeyDown(event)) return;
|
|
751
|
+
applyMultiSelectorKey(event, {
|
|
752
|
+
canActivate: host.canActivate.value,
|
|
753
|
+
searchable: host.props.searchable === true,
|
|
754
|
+
isOpen: combobox.isOpen.value,
|
|
755
|
+
activeIndex: combobox.activeIndex.value,
|
|
756
|
+
createQuery: createQuery.value,
|
|
757
|
+
selectedCount: selectedValues.value.length,
|
|
758
|
+
optionAt: (index) => selectable.value[index],
|
|
759
|
+
open: () => combobox.open(),
|
|
760
|
+
close: () => combobox.close(),
|
|
761
|
+
highlightNext: () => combobox.highlightNext(),
|
|
762
|
+
highlightPrevious: () => combobox.highlightPrevious(),
|
|
763
|
+
highlightFirst: () => combobox.highlightFirst(),
|
|
764
|
+
highlightLast: () => combobox.highlightLast(),
|
|
765
|
+
jumpToMatch: (char) => combobox.jumpToMatch(char),
|
|
766
|
+
toggleValue,
|
|
767
|
+
commitCreate,
|
|
768
|
+
clearSelection: () => commit([]),
|
|
769
|
+
focusTrigger: host.focusTrigger
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
function openFromMount() {
|
|
773
|
+
openingFromMount = true;
|
|
774
|
+
if (host.canActivate.value) combobox.open();
|
|
775
|
+
openingFromMount = false;
|
|
776
|
+
}
|
|
777
|
+
function onSearchInput(event) {
|
|
778
|
+
query.value = event.target.value;
|
|
779
|
+
}
|
|
780
|
+
return {
|
|
781
|
+
query,
|
|
782
|
+
combobox,
|
|
783
|
+
rows,
|
|
784
|
+
createOption,
|
|
785
|
+
selectAllIndex,
|
|
786
|
+
selectAllLabel,
|
|
787
|
+
selectAllState,
|
|
788
|
+
selectedValues,
|
|
789
|
+
selectedOptions,
|
|
790
|
+
realMatchCount,
|
|
791
|
+
showEmpty,
|
|
792
|
+
emptyText,
|
|
793
|
+
emptySearchText,
|
|
794
|
+
searchPlaceholder,
|
|
795
|
+
gridMode,
|
|
796
|
+
actionGrid,
|
|
797
|
+
popupKind,
|
|
798
|
+
optionDomId,
|
|
799
|
+
optionIndex,
|
|
800
|
+
isSelected,
|
|
801
|
+
toggleValue,
|
|
802
|
+
highlight,
|
|
803
|
+
checkboxState,
|
|
804
|
+
commit,
|
|
805
|
+
onKeyDown,
|
|
806
|
+
onSearchInput,
|
|
807
|
+
openFromMount,
|
|
808
|
+
open: () => {
|
|
809
|
+
if (host.canActivate.value) combobox.open();
|
|
810
|
+
},
|
|
811
|
+
close: () => combobox.close()
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
//#endregion
|
|
815
|
+
//#region src/MultiSelector/MultiSelector.vue
|
|
816
|
+
const _hoisted_1 = ["data-variant"];
|
|
817
|
+
const _hoisted_2 = {
|
|
818
|
+
key: 0,
|
|
819
|
+
class: "astryx-multi-selector-icon",
|
|
820
|
+
"aria-hidden": "true"
|
|
821
|
+
};
|
|
822
|
+
const _hoisted_3 = [
|
|
823
|
+
"disabled",
|
|
824
|
+
"aria-disabled",
|
|
825
|
+
"aria-readonly",
|
|
826
|
+
"aria-busy",
|
|
827
|
+
"role",
|
|
828
|
+
"aria-haspopup",
|
|
829
|
+
"aria-expanded",
|
|
830
|
+
"aria-controls",
|
|
831
|
+
"aria-autocomplete",
|
|
832
|
+
"aria-activedescendant",
|
|
833
|
+
"aria-describedby"
|
|
834
|
+
];
|
|
835
|
+
const _hoisted_4 = {
|
|
836
|
+
key: 0,
|
|
837
|
+
class: "astryx-multi-selector-placeholder"
|
|
838
|
+
};
|
|
839
|
+
const _hoisted_5 = {
|
|
840
|
+
key: 1,
|
|
841
|
+
class: "astryx-multi-selector-value"
|
|
842
|
+
};
|
|
843
|
+
const _hoisted_6 = {
|
|
844
|
+
key: 2,
|
|
845
|
+
class: "astryx-multi-selector-value"
|
|
846
|
+
};
|
|
847
|
+
const _hoisted_7 = {
|
|
848
|
+
key: 0,
|
|
849
|
+
class: "astryx-multi-selector-more"
|
|
850
|
+
};
|
|
851
|
+
const _hoisted_8 = ["aria-label"];
|
|
852
|
+
const _hoisted_9 = {
|
|
853
|
+
class: "astryx-multi-selector-more",
|
|
854
|
+
"data-overflow-indicator": ""
|
|
855
|
+
};
|
|
856
|
+
const _hoisted_10 = [
|
|
857
|
+
"name",
|
|
858
|
+
"value",
|
|
859
|
+
"disabled"
|
|
860
|
+
];
|
|
861
|
+
const _hoisted_11 = { class: "astryx-multi-selector-sheet-title" };
|
|
862
|
+
const _hoisted_12 = [
|
|
863
|
+
"role",
|
|
864
|
+
"aria-label",
|
|
865
|
+
"data-placement"
|
|
866
|
+
];
|
|
867
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
868
|
+
name: "AstryxMultiSelector",
|
|
869
|
+
inheritAttrs: false,
|
|
870
|
+
__name: "MultiSelector",
|
|
871
|
+
props: {
|
|
872
|
+
modelValue: { default: () => [] },
|
|
873
|
+
options: {},
|
|
874
|
+
label: {},
|
|
875
|
+
isLabelHidden: { type: Boolean },
|
|
876
|
+
labelHidden: {
|
|
877
|
+
type: Boolean,
|
|
878
|
+
default: false
|
|
879
|
+
},
|
|
880
|
+
description: {},
|
|
881
|
+
placeholder: {},
|
|
882
|
+
disabled: {
|
|
883
|
+
type: Boolean,
|
|
884
|
+
default: false
|
|
885
|
+
},
|
|
886
|
+
disabledMessage: {},
|
|
887
|
+
disabledReason: {},
|
|
888
|
+
status: { default: "default" },
|
|
889
|
+
statusMessage: {},
|
|
890
|
+
statusVariant: { default: "attached" },
|
|
891
|
+
size: { default: "md" },
|
|
892
|
+
variant: { default: "input" },
|
|
893
|
+
presentation: { default: "popover" },
|
|
894
|
+
clearable: {
|
|
895
|
+
type: Boolean,
|
|
896
|
+
default: false
|
|
897
|
+
},
|
|
898
|
+
hasClear: { type: Boolean },
|
|
899
|
+
isDefaultOpen: { type: Boolean },
|
|
900
|
+
searchable: {
|
|
901
|
+
type: Boolean,
|
|
902
|
+
default: false
|
|
903
|
+
},
|
|
904
|
+
searchPlaceholder: {},
|
|
905
|
+
selectAll: {
|
|
906
|
+
type: Boolean,
|
|
907
|
+
default: false
|
|
908
|
+
},
|
|
909
|
+
selectAllLabel: {},
|
|
910
|
+
triggerDisplay: { default: "count" },
|
|
911
|
+
maxBadges: { default: 3 },
|
|
912
|
+
checkboxPosition: { default: "start" },
|
|
913
|
+
required: {
|
|
914
|
+
type: Boolean,
|
|
915
|
+
default: false
|
|
916
|
+
},
|
|
917
|
+
optional: {
|
|
918
|
+
type: Boolean,
|
|
919
|
+
default: false
|
|
920
|
+
},
|
|
921
|
+
name: {},
|
|
922
|
+
width: {},
|
|
923
|
+
isReadOnly: {
|
|
924
|
+
type: Boolean,
|
|
925
|
+
default: false
|
|
926
|
+
},
|
|
927
|
+
isLoading: {
|
|
928
|
+
type: Boolean,
|
|
929
|
+
default: false
|
|
930
|
+
},
|
|
931
|
+
formatValue: {},
|
|
932
|
+
hasCreate: {
|
|
933
|
+
type: Boolean,
|
|
934
|
+
default: false
|
|
935
|
+
},
|
|
936
|
+
handleRef: {},
|
|
937
|
+
emptyText: {},
|
|
938
|
+
emptySearchText: {},
|
|
939
|
+
containerClass: { type: [
|
|
940
|
+
Boolean,
|
|
941
|
+
null,
|
|
942
|
+
String,
|
|
943
|
+
Object,
|
|
944
|
+
Array
|
|
945
|
+
] },
|
|
946
|
+
containerStyle: { type: [
|
|
947
|
+
Boolean,
|
|
948
|
+
null,
|
|
949
|
+
String,
|
|
950
|
+
Object,
|
|
951
|
+
Array
|
|
952
|
+
] },
|
|
953
|
+
controlClass: { type: [
|
|
954
|
+
Boolean,
|
|
955
|
+
null,
|
|
956
|
+
String,
|
|
957
|
+
Object,
|
|
958
|
+
Array
|
|
959
|
+
] },
|
|
960
|
+
controlStyle: { type: [
|
|
961
|
+
Boolean,
|
|
962
|
+
null,
|
|
963
|
+
String,
|
|
964
|
+
Object,
|
|
965
|
+
Array
|
|
966
|
+
] }
|
|
967
|
+
},
|
|
968
|
+
emits: [
|
|
969
|
+
"update:modelValue",
|
|
970
|
+
"change",
|
|
971
|
+
"search",
|
|
972
|
+
"openChange",
|
|
973
|
+
"click",
|
|
974
|
+
"focus",
|
|
975
|
+
"keydown"
|
|
976
|
+
],
|
|
977
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
978
|
+
const props = __props;
|
|
979
|
+
const emit = __emit;
|
|
980
|
+
const slots = useSlots();
|
|
981
|
+
const attrs = useAttrs();
|
|
982
|
+
const parts = useFieldPartStyling({
|
|
983
|
+
component: "MultiSelector",
|
|
984
|
+
props,
|
|
985
|
+
attrs,
|
|
986
|
+
reservedAttrs: [
|
|
987
|
+
"id",
|
|
988
|
+
"role",
|
|
989
|
+
"aria-label",
|
|
990
|
+
"aria-labelledby",
|
|
991
|
+
"aria-describedby",
|
|
992
|
+
"aria-expanded",
|
|
993
|
+
"aria-controls",
|
|
994
|
+
"aria-haspopup",
|
|
995
|
+
"aria-activedescendant",
|
|
996
|
+
"aria-autocomplete",
|
|
997
|
+
"aria-disabled",
|
|
998
|
+
"aria-required",
|
|
999
|
+
"aria-busy",
|
|
1000
|
+
"aria-readonly"
|
|
1001
|
+
]
|
|
1002
|
+
});
|
|
1003
|
+
const triggerVariant = computed(() => normalizeTriggerVariant(props.variant));
|
|
1004
|
+
const CheckboxMark = useIndicator("checkbox");
|
|
1005
|
+
const messages = useAstryxMessages();
|
|
1006
|
+
const announce = useAnnounce();
|
|
1007
|
+
const inputGroup = useInputGroupContext();
|
|
1008
|
+
const inGroup = computed(() => inputGroup != null);
|
|
1009
|
+
const control = useFieldControlState({
|
|
1010
|
+
disabled: () => props.disabled || (inputGroup?.disabled.value ?? false),
|
|
1011
|
+
readOnly: () => props.isReadOnly,
|
|
1012
|
+
loading: () => props.isLoading
|
|
1013
|
+
});
|
|
1014
|
+
const triggerId = `astryx-multi-selector-${useId()}`;
|
|
1015
|
+
const listboxId = `${triggerId}-listbox`;
|
|
1016
|
+
const searchId = `${triggerId}-search`;
|
|
1017
|
+
const disabledId = `${triggerId}-disabled`;
|
|
1018
|
+
const anchorRef = useTemplateRef("anchorRef");
|
|
1019
|
+
const listboxRef = useTemplateRef("listboxRef");
|
|
1020
|
+
const triggerRef = useTemplateRef("triggerRef");
|
|
1021
|
+
useScrollbars(listboxRef);
|
|
1022
|
+
const readOnlyId = `${triggerId}-readonly`;
|
|
1023
|
+
const disabledTooltipId = `${triggerId}-disabled-tooltip`;
|
|
1024
|
+
/** 旧名 disabledReason 和新名 disabledMessage 等价。 */
|
|
1025
|
+
const resolvedDisabledMessage = computed(() => props.disabledMessage?.trim() || props.disabledReason?.trim());
|
|
1026
|
+
const showsDisabledMessage = computed(() => control.isDisabled.value && !!resolvedDisabledMessage.value);
|
|
1027
|
+
const disabledTooltip = useButtonTooltip(showsDisabledMessage);
|
|
1028
|
+
const hasClear = computed(() => props.hasClear || props.clearable);
|
|
1029
|
+
const hasCustomTrigger = computed(() => slots.trigger != null);
|
|
1030
|
+
const customAnchor = shallowRef(null);
|
|
1031
|
+
const anchor = computed(() => customAnchor.value ?? anchorRef.value);
|
|
1032
|
+
function setCustomTrigger(element) {
|
|
1033
|
+
customAnchor.value = element instanceof HTMLElement ? element : null;
|
|
1034
|
+
}
|
|
1035
|
+
const placeholder = computed(() => props.placeholder ?? messages.value.multiSelector.placeholder);
|
|
1036
|
+
const fieldStatus = computed(() => {
|
|
1037
|
+
if (!props.statusMessage || props.status === "default") return void 0;
|
|
1038
|
+
return {
|
|
1039
|
+
type: props.status,
|
|
1040
|
+
message: props.statusMessage
|
|
1041
|
+
};
|
|
1042
|
+
});
|
|
1043
|
+
const effectiveStatusVariant = computed(() => fieldStatusPlacement(props.variant, props.statusVariant));
|
|
1044
|
+
const statusGlyph = computed(() => {
|
|
1045
|
+
if (props.status === "default" || effectiveStatusVariant.value === "detached") return void 0;
|
|
1046
|
+
return props.status;
|
|
1047
|
+
});
|
|
1048
|
+
const panelRef = useTemplateRef("panelRef");
|
|
1049
|
+
const menu = useMultiSelectorMenu({
|
|
1050
|
+
props,
|
|
1051
|
+
emitUpdate: (value) => emit("update:modelValue", value),
|
|
1052
|
+
emitChange: (value, change) => emit("change", value, change),
|
|
1053
|
+
emitSearch: (value) => emit("search", value),
|
|
1054
|
+
emitOpenChange: (isOpen) => emit("openChange", isOpen),
|
|
1055
|
+
canActivate: control.canActivate,
|
|
1056
|
+
isLoading: control.isLoading,
|
|
1057
|
+
messages,
|
|
1058
|
+
announce,
|
|
1059
|
+
listboxRef,
|
|
1060
|
+
getSearchInput: () => panelRef.value ? panelRef.value.searchInput ?? null : null,
|
|
1061
|
+
focusTrigger: () => {
|
|
1062
|
+
const trigger = triggerRef.value ?? customAnchor.value;
|
|
1063
|
+
if (trigger != null) nextTick(() => focusElement(trigger));
|
|
1064
|
+
},
|
|
1065
|
+
listboxId
|
|
1066
|
+
});
|
|
1067
|
+
const { combobox, selectedValues, selectedOptions } = menu;
|
|
1068
|
+
trackInteractionModality();
|
|
1069
|
+
const searchKeyboardFocus = ref(false);
|
|
1070
|
+
const sheetSlot = useTemplateRef("sheetSlot");
|
|
1071
|
+
const isSheet = computed(() => props.presentation === "bottom-sheet");
|
|
1072
|
+
const sheetOpen = computed({
|
|
1073
|
+
get: () => isSheet.value && combobox.isOpen.value,
|
|
1074
|
+
set: (open) => {
|
|
1075
|
+
if (!open && combobox.isOpen.value) combobox.close();
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
const listboxTarget = computed(() => isSheet.value && sheetSlot.value ? sheetSlot.value : "body");
|
|
1079
|
+
function onSearchFocus() {
|
|
1080
|
+
searchKeyboardFocus.value = isKeyboardModality();
|
|
1081
|
+
}
|
|
1082
|
+
function onSearchBlur() {
|
|
1083
|
+
searchKeyboardFocus.value = false;
|
|
1084
|
+
}
|
|
1085
|
+
const anchored = useAnchoredListbox({
|
|
1086
|
+
anchor,
|
|
1087
|
+
layer: listboxRef,
|
|
1088
|
+
isOpen: computed(() => combobox.isOpen.value && !isSheet.value),
|
|
1089
|
+
onDismiss: () => {
|
|
1090
|
+
combobox.close();
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
const badgeCount = computed(() => selectedOptions.value.length);
|
|
1094
|
+
const overflow = useOverflow(badgeCount, { gap: 4 });
|
|
1095
|
+
const visibleBadgeCount = computed(() => Math.min(overflow.visibleCount.value, props.maxBadges, badgeCount.value));
|
|
1096
|
+
const hiddenBadgeCount = computed(() => Math.max(0, badgeCount.value - visibleBadgeCount.value));
|
|
1097
|
+
const measureMoreLabel = computed(() => messages.value.multiSelector.more(Math.max(hiddenBadgeCount.value, 1)));
|
|
1098
|
+
const labelText = computed(() => {
|
|
1099
|
+
const labels = selectedOptions.value.map((option) => option.label);
|
|
1100
|
+
const shown = labels.slice(0, props.maxBadges);
|
|
1101
|
+
const extra = labels.length - shown.length;
|
|
1102
|
+
if (shown.length === 0) return "";
|
|
1103
|
+
return extra > 0 ? `${shown.join(", ")} ${messages.value.multiSelector.more(extra)}` : shown.join(", ");
|
|
1104
|
+
});
|
|
1105
|
+
const formattedValue = computed(() => {
|
|
1106
|
+
if (selectedOptions.value.length === 0 || props.formatValue == null || props.triggerDisplay === "badges") return void 0;
|
|
1107
|
+
return props.formatValue(selectedOptions.value.map((option) => ({
|
|
1108
|
+
value: option.value,
|
|
1109
|
+
label: option.label
|
|
1110
|
+
})));
|
|
1111
|
+
});
|
|
1112
|
+
const describedBy = computed(() => {
|
|
1113
|
+
return [
|
|
1114
|
+
inGroup.value ? inputGroup?.describedBy.value : void 0,
|
|
1115
|
+
!inGroup.value && props.description ? `${triggerId}-description` : void 0,
|
|
1116
|
+
!inGroup.value && props.statusMessage ? `${triggerId}-status` : void 0,
|
|
1117
|
+
showsDisabledMessage.value ? disabledId : void 0
|
|
1118
|
+
].filter(Boolean).join(" ") || void 0;
|
|
1119
|
+
});
|
|
1120
|
+
useDevWarning("MultiSelector", "`containerClass`/`containerStyle` have no effect on a custom trigger.", () => hasCustomTrigger.value && (props.containerClass != null || props.containerStyle != null));
|
|
1121
|
+
useDevWarning("MultiSelector", "`controlClass`/`controlStyle` have no effect on a custom trigger.", () => hasCustomTrigger.value && (props.controlClass != null || props.controlStyle != null));
|
|
1122
|
+
function onTriggerClick(event) {
|
|
1123
|
+
if (control.canActivate.value) combobox.toggle();
|
|
1124
|
+
emit("click", event);
|
|
1125
|
+
}
|
|
1126
|
+
function onTriggerFocus(event) {
|
|
1127
|
+
emit("focus", event);
|
|
1128
|
+
disabledTooltip.onFocus(event);
|
|
1129
|
+
}
|
|
1130
|
+
function onTriggerKeyDown(event) {
|
|
1131
|
+
menu.onKeyDown(event);
|
|
1132
|
+
if (!event.defaultPrevented) emit("keydown", event);
|
|
1133
|
+
}
|
|
1134
|
+
/** 选项和操作按钮上的 Escape 不会经过搜索框,在列表根上接住并回到触发器。 */
|
|
1135
|
+
function onListboxEscape(event) {
|
|
1136
|
+
if (event.key !== "Escape" || event.defaultPrevented || event.isComposing) return;
|
|
1137
|
+
menu.onKeyDown(event);
|
|
1138
|
+
}
|
|
1139
|
+
watch(listboxRef, (el, prev) => {
|
|
1140
|
+
prev?.removeEventListener("keydown", onListboxEscape);
|
|
1141
|
+
el?.addEventListener("keydown", onListboxEscape);
|
|
1142
|
+
}, { flush: "sync" });
|
|
1143
|
+
onScopeDispose(() => listboxRef.value?.removeEventListener("keydown", onListboxEscape));
|
|
1144
|
+
const triggerProps = computed(() => ({
|
|
1145
|
+
"id": triggerId,
|
|
1146
|
+
"onClick": onTriggerClick,
|
|
1147
|
+
"onKeyDown": onTriggerKeyDown,
|
|
1148
|
+
"onFocus": onTriggerFocus,
|
|
1149
|
+
"aria-haspopup": menu.popupKind.value,
|
|
1150
|
+
"aria-expanded": combobox.isOpen.value,
|
|
1151
|
+
"aria-controls": listboxId,
|
|
1152
|
+
"aria-busy": control.isLoading.value ? true : void 0,
|
|
1153
|
+
"triggerRef": setCustomTrigger
|
|
1154
|
+
}));
|
|
1155
|
+
onMounted(() => {
|
|
1156
|
+
if (!props.isDefaultOpen) return;
|
|
1157
|
+
menu.openFromMount();
|
|
1158
|
+
});
|
|
1159
|
+
const handle = {
|
|
1160
|
+
open: () => menu.open(),
|
|
1161
|
+
close: () => menu.close(),
|
|
1162
|
+
toggle: () => {
|
|
1163
|
+
if (combobox.isOpen.value) menu.close();
|
|
1164
|
+
else menu.open();
|
|
1165
|
+
},
|
|
1166
|
+
isOpen: () => combobox.isOpen.value
|
|
1167
|
+
};
|
|
1168
|
+
useDisclosureHandle(() => props.handleRef, handle);
|
|
1169
|
+
__expose({
|
|
1170
|
+
focus: () => {
|
|
1171
|
+
if (props.searchable && combobox.isOpen.value) panelRef.value?.focusSearch();
|
|
1172
|
+
else anchor.value?.focus();
|
|
1173
|
+
},
|
|
1174
|
+
blur: () => anchor.value?.blur(),
|
|
1175
|
+
...handle
|
|
1176
|
+
});
|
|
1177
|
+
return (_ctx, _cache) => {
|
|
1178
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1179
|
+
hasCustomTrigger.value ? renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(triggerProps.value)), void 0, void 0, 0) : (openBlock(), createBlock(_sfc_main$6, {
|
|
1180
|
+
key: 1,
|
|
1181
|
+
class: normalizeClass(["astryx-multi-selector", [
|
|
1182
|
+
unref(parts).containerClass.value,
|
|
1183
|
+
`size-${props.size}`,
|
|
1184
|
+
`variant-${triggerVariant.value}`
|
|
1185
|
+
]]),
|
|
1186
|
+
style: normalizeStyle(unref(parts).containerStyle.value),
|
|
1187
|
+
label: props.label,
|
|
1188
|
+
"input-id": props.searchable && unref(combobox).isOpen.value ? searchId : triggerId,
|
|
1189
|
+
"is-label-hidden": inGroup.value || props.isLabelHidden || props.labelHidden,
|
|
1190
|
+
"is-disabled": unref(control).isDisabled.value,
|
|
1191
|
+
"is-required": inGroup.value ? false : props.required,
|
|
1192
|
+
"is-optional": inGroup.value ? false : props.optional,
|
|
1193
|
+
description: inGroup.value ? void 0 : props.description,
|
|
1194
|
+
status: inGroup.value ? void 0 : fieldStatus.value,
|
|
1195
|
+
"status-variant": effectiveStatusVariant.value,
|
|
1196
|
+
width: props.width
|
|
1197
|
+
}, {
|
|
1198
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
1199
|
+
ref_key: "anchorRef",
|
|
1200
|
+
ref: anchorRef,
|
|
1201
|
+
class: normalizeClass(["astryx-multi-selector-control", [
|
|
1202
|
+
unref(parts).controlClass(),
|
|
1203
|
+
`status-${props.status}`,
|
|
1204
|
+
{
|
|
1205
|
+
"is-open": unref(combobox).isOpen.value,
|
|
1206
|
+
"is-disabled": unref(control).isDisabled.value,
|
|
1207
|
+
"is-readonly": unref(control).isReadOnly.value,
|
|
1208
|
+
"is-loading": unref(control).isLoading.value,
|
|
1209
|
+
"is-ghost": triggerVariant.value === "ghost"
|
|
1210
|
+
}
|
|
1211
|
+
]]),
|
|
1212
|
+
style: normalizeStyle(unref(parts).controlStyle()),
|
|
1213
|
+
"data-variant": triggerVariant.value,
|
|
1214
|
+
onPointerenter: _cache[2] || (_cache[2] = (...args) => unref(disabledTooltip).onPointerEnter && unref(disabledTooltip).onPointerEnter(...args)),
|
|
1215
|
+
onPointerleave: _cache[3] || (_cache[3] = (...args) => unref(disabledTooltip).onPointerLeave && unref(disabledTooltip).onPointerLeave(...args))
|
|
1216
|
+
}, [
|
|
1217
|
+
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("v-if", true),
|
|
1218
|
+
createElementVNode("button", mergeProps(unref(parts).forwardedAttrs(), {
|
|
1219
|
+
id: triggerId,
|
|
1220
|
+
ref_key: "triggerRef",
|
|
1221
|
+
ref: triggerRef,
|
|
1222
|
+
type: "button",
|
|
1223
|
+
class: "astryx-multi-selector-trigger",
|
|
1224
|
+
disabled: unref(control).isDisabled.value && !showsDisabledMessage.value,
|
|
1225
|
+
"aria-disabled": showsDisabledMessage.value ? "true" : void 0,
|
|
1226
|
+
"aria-readonly": unref(control).isReadOnly.value || void 0,
|
|
1227
|
+
"aria-busy": unref(control).isLoading.value || void 0,
|
|
1228
|
+
role: props.searchable && !unref(control).isReadOnly.value ? void 0 : "combobox",
|
|
1229
|
+
"aria-haspopup": unref(control).isReadOnly.value ? void 0 : unref(menu).popupKind.value,
|
|
1230
|
+
"aria-expanded": unref(control).isReadOnly.value ? false : unref(combobox).isOpen.value,
|
|
1231
|
+
"aria-controls": unref(control).isReadOnly.value ? void 0 : listboxId,
|
|
1232
|
+
"aria-autocomplete": props.searchable ? void 0 : "none",
|
|
1233
|
+
"aria-activedescendant": !props.searchable ? unref(menu).actionGrid.activeDescendant.value : void 0,
|
|
1234
|
+
"aria-describedby": [describedBy.value, unref(control).isReadOnly.value ? readOnlyId : void 0].filter(Boolean).join(" ") || void 0,
|
|
1235
|
+
onClick: onTriggerClick,
|
|
1236
|
+
onFocus: onTriggerFocus,
|
|
1237
|
+
onBlur: _cache[0] || (_cache[0] = (...args) => unref(disabledTooltip).onBlur && unref(disabledTooltip).onBlur(...args)),
|
|
1238
|
+
onKeydown: onTriggerKeyDown
|
|
1239
|
+
}), [unref(selectedOptions).length === 0 ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(placeholder.value), 1)) : props.triggerDisplay === "count" ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(formattedValue.value ?? unref(messages).multiSelector.selected(unref(selectedOptions).length)), 1)) : props.triggerDisplay === "labels" ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(formattedValue.value ?? labelText.value), 1)) : (openBlock(), createElementBlock("span", {
|
|
1240
|
+
key: 3,
|
|
1241
|
+
ref: unref(overflow).containerRef,
|
|
1242
|
+
class: "astryx-multi-selector-badges"
|
|
1243
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedOptions).slice(0, visibleBadgeCount.value), (option) => {
|
|
1244
|
+
return openBlock(), createBlock(_sfc_main$8, {
|
|
1245
|
+
key: option.value,
|
|
1246
|
+
label: option.label,
|
|
1247
|
+
size: props.size === "lg" ? "md" : "sm"
|
|
1248
|
+
}, null, 8, ["label", "size"]);
|
|
1249
|
+
}), 128)), hiddenBadgeCount.value > 0 ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(unref(messages).multiSelector.more(hiddenBadgeCount.value)), 1)) : createCommentVNode("v-if", true)], 512))], 16, _hoisted_3),
|
|
1250
|
+
unref(control).isLoading.value ? (openBlock(), createBlock(_sfc_main$5, {
|
|
1251
|
+
key: 1,
|
|
1252
|
+
class: "astryx-multi-selector-spinner",
|
|
1253
|
+
size: "sm",
|
|
1254
|
+
"aria-label": unref(messages).multiSelector.loading
|
|
1255
|
+
}, null, 8, ["aria-label"])) : createCommentVNode("v-if", true),
|
|
1256
|
+
hasClear.value && unref(selectedValues).length > 0 && unref(control).canActivate.value ? (openBlock(), createElementBlock("button", {
|
|
1257
|
+
key: 2,
|
|
1258
|
+
type: "button",
|
|
1259
|
+
class: "astryx-multi-selector-clear",
|
|
1260
|
+
"aria-label": unref(messages).multiSelector.clearAll(props.label),
|
|
1261
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => unref(menu).commit([]), ["stop"]))
|
|
1262
|
+
}, [createVNode(_sfc_main$4, {
|
|
1263
|
+
icon: "close",
|
|
1264
|
+
size: "sm"
|
|
1265
|
+
})], 8, _hoisted_8)) : createCommentVNode("v-if", true),
|
|
1266
|
+
statusGlyph.value ? (openBlock(), createBlock(_sfc_main$7, {
|
|
1267
|
+
key: 3,
|
|
1268
|
+
type: statusGlyph.value,
|
|
1269
|
+
message: fieldStatus.value?.message,
|
|
1270
|
+
tooltip: effectiveStatusVariant.value === "tooltip"
|
|
1271
|
+
}, null, 8, [
|
|
1272
|
+
"type",
|
|
1273
|
+
"message",
|
|
1274
|
+
"tooltip"
|
|
1275
|
+
])) : unref(control).canActivate.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
1276
|
+
key: 4,
|
|
1277
|
+
class: normalizeClass(["astryx-multi-selector-chevron", { "is-open": unref(combobox).isOpen.value }]),
|
|
1278
|
+
icon: "chevronDown",
|
|
1279
|
+
size: "sm"
|
|
1280
|
+
}, null, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
1281
|
+
unref(control).isReadOnly.value ? (openBlock(), createElementBlock("span", {
|
|
1282
|
+
key: 5,
|
|
1283
|
+
id: readOnlyId,
|
|
1284
|
+
class: "astryx-visually-hidden"
|
|
1285
|
+
}, toDisplayString(unref(messages).multiSelector.readOnly), 1)) : createCommentVNode("v-if", true),
|
|
1286
|
+
props.triggerDisplay === "badges" ? (openBlock(), createElementBlock("span", {
|
|
1287
|
+
key: 6,
|
|
1288
|
+
ref: unref(overflow).measureRef,
|
|
1289
|
+
class: "astryx-multi-selector-measure",
|
|
1290
|
+
"aria-hidden": "true"
|
|
1291
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedOptions), (option) => {
|
|
1292
|
+
return openBlock(), createBlock(_sfc_main$8, {
|
|
1293
|
+
key: option.value,
|
|
1294
|
+
label: option.label,
|
|
1295
|
+
size: props.size === "lg" ? "md" : "sm"
|
|
1296
|
+
}, null, 8, ["label", "size"]);
|
|
1297
|
+
}), 128)), createElementVNode("span", _hoisted_9, toDisplayString(measureMoreLabel.value), 1)], 512)) : createCommentVNode("v-if", true),
|
|
1298
|
+
showsDisabledMessage.value ? (openBlock(), createElementBlock("span", {
|
|
1299
|
+
key: 7,
|
|
1300
|
+
id: disabledId,
|
|
1301
|
+
class: "astryx-visually-hidden"
|
|
1302
|
+
}, toDisplayString(resolvedDisabledMessage.value), 1)) : createCommentVNode("v-if", true),
|
|
1303
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedValues), (value) => {
|
|
1304
|
+
return openBlock(), createElementBlock("input", {
|
|
1305
|
+
key: value,
|
|
1306
|
+
type: "hidden",
|
|
1307
|
+
name: props.name,
|
|
1308
|
+
value,
|
|
1309
|
+
disabled: !props.name
|
|
1310
|
+
}, null, 8, _hoisted_10);
|
|
1311
|
+
}), 128))
|
|
1312
|
+
], 46, _hoisted_1)]),
|
|
1313
|
+
_: 3
|
|
1314
|
+
}, 8, [
|
|
1315
|
+
"class",
|
|
1316
|
+
"style",
|
|
1317
|
+
"label",
|
|
1318
|
+
"input-id",
|
|
1319
|
+
"is-label-hidden",
|
|
1320
|
+
"is-disabled",
|
|
1321
|
+
"is-required",
|
|
1322
|
+
"is-optional",
|
|
1323
|
+
"description",
|
|
1324
|
+
"status",
|
|
1325
|
+
"status-variant",
|
|
1326
|
+
"width"
|
|
1327
|
+
])),
|
|
1328
|
+
isSheet.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
1329
|
+
key: 2,
|
|
1330
|
+
"is-open": sheetOpen.value,
|
|
1331
|
+
"onUpdate:isOpen": _cache[4] || (_cache[4] = ($event) => sheetOpen.value = $event),
|
|
1332
|
+
height: "hug",
|
|
1333
|
+
label: props.label,
|
|
1334
|
+
padding: 2
|
|
1335
|
+
}, {
|
|
1336
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
1337
|
+
ref_key: "sheetSlot",
|
|
1338
|
+
ref: sheetSlot,
|
|
1339
|
+
class: "astryx-multi-selector-sheet"
|
|
1340
|
+
}, [createElementVNode("div", _hoisted_11, toDisplayString(props.label), 1)], 512)]),
|
|
1341
|
+
_: 1
|
|
1342
|
+
}, 8, ["is-open", "label"])) : createCommentVNode("v-if", true),
|
|
1343
|
+
(openBlock(), createBlock(Teleport, { to: listboxTarget.value }, [withDirectives(createElementVNode("div", {
|
|
1344
|
+
id: listboxId,
|
|
1345
|
+
ref_key: "listboxRef",
|
|
1346
|
+
ref: listboxRef,
|
|
1347
|
+
class: normalizeClass(["astryx-multi-selector-listbox astryx-layer", { "is-sheet": isSheet.value }]),
|
|
1348
|
+
role: unref(menu).gridMode.value ? "grid" : "listbox",
|
|
1349
|
+
"aria-multiselectable": "true",
|
|
1350
|
+
"aria-label": props.label,
|
|
1351
|
+
"data-placement": isSheet.value ? void 0 : unref(anchored).position.value.placement,
|
|
1352
|
+
style: normalizeStyle(isSheet.value ? void 0 : unref(anchored).style.value),
|
|
1353
|
+
tabindex: "-1"
|
|
1354
|
+
}, [createVNode(_sfc_main$1, {
|
|
1355
|
+
ref_key: "panelRef",
|
|
1356
|
+
ref: panelRef,
|
|
1357
|
+
searchable: Boolean(props.searchable),
|
|
1358
|
+
query: unref(menu).query.value,
|
|
1359
|
+
"search-id": searchId,
|
|
1360
|
+
"search-placeholder": unref(menu).searchPlaceholder.value,
|
|
1361
|
+
"clear-label": unref(messages).multiSelector.clear,
|
|
1362
|
+
"listbox-id": listboxId,
|
|
1363
|
+
"active-index": unref(combobox).activeIndex.value,
|
|
1364
|
+
"active-descendant": unref(menu).actionGrid.activeDescendant.value,
|
|
1365
|
+
grid: unref(menu).gridMode.value,
|
|
1366
|
+
"action-index": unref(menu).actionGrid.column.value === "action" ? unref(combobox).activeIndex.value : -1,
|
|
1367
|
+
"create-option": unref(menu).createOption.value,
|
|
1368
|
+
"select-all": Boolean(props.selectAll),
|
|
1369
|
+
"select-all-index": unref(menu).selectAllIndex.value,
|
|
1370
|
+
"select-all-label": unref(menu).selectAllLabel.value,
|
|
1371
|
+
"select-all-state": unref(menu).selectAllState.value,
|
|
1372
|
+
"checkbox-position": props.checkboxPosition,
|
|
1373
|
+
size: props.size,
|
|
1374
|
+
loading: unref(control).isLoading.value,
|
|
1375
|
+
"real-match-count": unref(menu).realMatchCount.value,
|
|
1376
|
+
rows: unref(menu).rows.value,
|
|
1377
|
+
"show-empty": unref(menu).showEmpty.value,
|
|
1378
|
+
"empty-text": unref(menu).emptyText.value,
|
|
1379
|
+
"empty-search-text": unref(menu).emptySearchText.value,
|
|
1380
|
+
"search-keyboard-focus": searchKeyboardFocus.value,
|
|
1381
|
+
mark: unref(CheckboxMark),
|
|
1382
|
+
"is-selected": unref(menu).isSelected,
|
|
1383
|
+
"checkbox-state": unref(menu).checkboxState,
|
|
1384
|
+
"option-index": unref(menu).optionIndex,
|
|
1385
|
+
"option-dom-id": unref(menu).optionDomId,
|
|
1386
|
+
"action-dom-id": (index) => `${listboxId}-action-${index}`,
|
|
1387
|
+
onQuery: unref(menu).onSearchInput,
|
|
1388
|
+
onKeydown: unref(menu).onKeyDown,
|
|
1389
|
+
onClearQuery: _cache[5] || (_cache[5] = ($event) => unref(menu).query.value = ""),
|
|
1390
|
+
onSearchFocus,
|
|
1391
|
+
onSearchBlur,
|
|
1392
|
+
onToggle: unref(menu).toggleValue,
|
|
1393
|
+
onHighlight: unref(menu).highlight
|
|
1394
|
+
}, createSlots({ _: 2 }, [_ctx.$slots.option ? {
|
|
1395
|
+
name: "option",
|
|
1396
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps(slotProps)))]),
|
|
1397
|
+
key: "0"
|
|
1398
|
+
} : void 0, _ctx.$slots.empty ? {
|
|
1399
|
+
name: "empty",
|
|
1400
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
|
|
1401
|
+
key: "1"
|
|
1402
|
+
} : void 0]), 1032, [
|
|
1403
|
+
"searchable",
|
|
1404
|
+
"query",
|
|
1405
|
+
"search-placeholder",
|
|
1406
|
+
"clear-label",
|
|
1407
|
+
"active-index",
|
|
1408
|
+
"active-descendant",
|
|
1409
|
+
"grid",
|
|
1410
|
+
"action-index",
|
|
1411
|
+
"create-option",
|
|
1412
|
+
"select-all",
|
|
1413
|
+
"select-all-index",
|
|
1414
|
+
"select-all-label",
|
|
1415
|
+
"select-all-state",
|
|
1416
|
+
"checkbox-position",
|
|
1417
|
+
"size",
|
|
1418
|
+
"loading",
|
|
1419
|
+
"real-match-count",
|
|
1420
|
+
"rows",
|
|
1421
|
+
"show-empty",
|
|
1422
|
+
"empty-text",
|
|
1423
|
+
"empty-search-text",
|
|
1424
|
+
"search-keyboard-focus",
|
|
1425
|
+
"mark",
|
|
1426
|
+
"is-selected",
|
|
1427
|
+
"checkbox-state",
|
|
1428
|
+
"option-index",
|
|
1429
|
+
"option-dom-id",
|
|
1430
|
+
"action-dom-id",
|
|
1431
|
+
"onQuery",
|
|
1432
|
+
"onKeydown",
|
|
1433
|
+
"onToggle",
|
|
1434
|
+
"onHighlight"
|
|
1435
|
+
])], 14, _hoisted_12), [[vShow, unref(combobox).isOpen.value]])], 8, ["to"])),
|
|
1436
|
+
showsDisabledMessage.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
1437
|
+
key: 3,
|
|
1438
|
+
id: disabledTooltipId,
|
|
1439
|
+
anchor: anchor.value,
|
|
1440
|
+
open: unref(disabledTooltip).isOpen.value,
|
|
1441
|
+
text: resolvedDisabledMessage.value ?? "",
|
|
1442
|
+
onPointerEnter: unref(disabledTooltip).onTooltipPointerEnter,
|
|
1443
|
+
onPointerLeave: unref(disabledTooltip).onTooltipPointerLeave
|
|
1444
|
+
}, null, 8, [
|
|
1445
|
+
"anchor",
|
|
1446
|
+
"open",
|
|
1447
|
+
"text",
|
|
1448
|
+
"onPointerEnter",
|
|
1449
|
+
"onPointerLeave"
|
|
1450
|
+
])) : createCommentVNode("v-if", true)
|
|
1451
|
+
], 64);
|
|
1452
|
+
};
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1455
|
+
//#endregion
|
|
1456
|
+
export { SELECT_ALL_VALUE as n, flattenOptions as r, _sfc_main as t };
|