@nubisco/ui 5.44.0 → 5.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AccordionItem-DYTMtfdV.cjs +1 -0
- package/dist/{AccordionItem-Cg4m1SfF.js → AccordionItem-Dwt7yH5V.js} +6 -4
- package/dist/{ActionGroup-D7M9uaEp.js → ActionGroup-DVzC7pb-.js} +1 -1
- package/dist/{ActionGroup-BZ6YpjJO.cjs → ActionGroup-PgnAwRgJ.cjs} +1 -1
- package/dist/{AiProvider-PuA_dYYu.cjs → AiProvider-Dfl-y2Wy.cjs} +1 -1
- package/dist/{AiProvider-BwX0fWR4.js → AiProvider-rvV85R7w.js} +3 -3
- package/dist/{BackToTop-yDcNNu1c.js → BackToTop-Bgq4txNz.js} +1 -1
- package/dist/{BackToTop-MiNmxj8y.cjs → BackToTop-FeQ4kykw.cjs} +1 -1
- package/dist/{Banner-S8WqTTYP.cjs → Banner-C6t1fbs0.cjs} +1 -1
- package/dist/{Banner-Czz07yca.js → Banner-Cb3GrxMM.js} +1 -1
- package/dist/{Blueprint-Bv8EweAy.cjs → Blueprint-BBRar8Vu.cjs} +1 -1
- package/dist/{Blueprint-C8VbPuw9.js → Blueprint-lTBswuCE.js} +1 -1
- package/dist/{BlueprintCard-WaIQcsDQ.cjs → BlueprintCard-BISElEk0.cjs} +1 -1
- package/dist/{BlueprintCard-jJjQydFH.js → BlueprintCard-CsOQhmxj.js} +1 -1
- package/dist/{BlueprintControls-CdvlOBtV.js → BlueprintControls-B9TveRQm.js} +1 -1
- package/dist/{BlueprintControls-BYa7Phal.cjs → BlueprintControls-HuvP3JgD.cjs} +1 -1
- package/dist/{Board-DxbzneAu.cjs → Board-CpSPRwYK.cjs} +1 -1
- package/dist/{Board-Jr8RJ7R1.js → Board-m5s6Dtby.js} +1 -1
- package/dist/{BottomPanel-D8z92-SS.cjs → BottomPanel-9wXoX7C0.cjs} +1 -1
- package/dist/{BottomPanel-xfSCWeN2.js → BottomPanel-COy4nW-t.js} +1 -1
- package/dist/{Breadcrumbs-iw63sE1V.js → Breadcrumbs-Cmr5dHB3.js} +2 -2
- package/dist/{Breadcrumbs-BHsQ9DWz.cjs → Breadcrumbs-DGJEdKOS.cjs} +1 -1
- package/dist/{Briefing-BhnZ6WVQ.js → Briefing-DH_mh7fN.js} +1 -1
- package/dist/{Briefing-CZ2bGU7N.cjs → Briefing-DUhMbdSV.cjs} +1 -1
- package/dist/{BriefingDestination-DY6Om2tX.js → BriefingDestination-D2_W_n7J.js} +1 -1
- package/dist/{BriefingDestination-CJHuxQnL.cjs → BriefingDestination-LfgeTUzh.cjs} +1 -1
- package/dist/{Button-D81Efqjg.js → Button-C-OsrbBY.js} +1 -1
- package/dist/{Button-B-8ikYRN.cjs → Button-Cjtw1CkB.cjs} +1 -1
- package/dist/{Card-BFF-wPpB.cjs → Card-B1Snkf7r.cjs} +1 -1
- package/dist/{Card-m0pPg2DV.js → Card-__tew6aW.js} +1 -1
- package/dist/{Checkbox-5ANAIFrb.js → Checkbox-B_nSNoZ0.js} +1 -1
- package/dist/{Checkbox-CtUFfX3m.cjs → Checkbox-DHjkrPUP.cjs} +1 -1
- package/dist/{CheckboxGroup-CORB_666.js → CheckboxGroup-CUIlWTqZ.js} +1 -1
- package/dist/{CheckboxGroup-DUwsVYmt.cjs → CheckboxGroup-DZYMcUYF.cjs} +1 -1
- package/dist/{ColorStrip-Cvg8SDbi.js → ColorStrip-ms8u4-on.js} +1 -1
- package/dist/{ColorStrip-D9Y0q4F3.cjs → ColorStrip-oYITobr0.cjs} +1 -1
- package/dist/{Confirm-7uLqv38W.cjs → Confirm-19CDmfES.cjs} +1 -1
- package/dist/{Confirm-c2Ss3_hy.js → Confirm-BVTBZR2b.js} +4 -4
- package/dist/{CopyButton-D_DwMgrr.cjs → CopyButton-CetR7hHC.cjs} +1 -1
- package/dist/{CopyButton-BaJmS3TN.js → CopyButton-Dgt2DbUH.js} +1 -1
- package/dist/{DataTable-JG2gCpgz.cjs → DataTable-6Z8IZeHf.cjs} +1 -1
- package/dist/{DataTable-C44scor6.js → DataTable-CaJYOtLk.js} +3 -3
- package/dist/{DatePicker-BtQGKawo.cjs → DatePicker-BXZaGWsS.cjs} +1 -1
- package/dist/{DatePicker-D-V0rt-j.js → DatePicker-DN_5RDB8.js} +1 -1
- package/dist/{DragHandle-DX3qexW0.cjs → DragHandle-B673DaN2.cjs} +1 -1
- package/dist/{DragHandle-CBfcSRsL.js → DragHandle-CaK-4YhE.js} +1 -1
- package/dist/{FileUploader-yF9oG9am.cjs → FileUploader-3vqReJ1p.cjs} +1 -1
- package/dist/{FileUploader-0N1aSLeq.js → FileUploader-DbkSKQbb.js} +2 -2
- package/dist/{FloatingToolbar-Bfe38At4.js → FloatingToolbar-CLQOPq4x.js} +1 -1
- package/dist/{FloatingToolbar-Bdwzxebh.cjs → FloatingToolbar-D7PkAjS7.cjs} +1 -1
- package/dist/{ImagePicker-D6udeZN0.cjs → ImagePicker-BGSGBibF.cjs} +1 -1
- package/dist/{ImagePicker-C2Kz4U4G.js → ImagePicker-BX28wROp.js} +1 -1
- package/dist/{InfoHint-ieo2S-YE.js → InfoHint-CC4cvFsD.js} +1 -1
- package/dist/{InfoHint-D35B8g96.cjs → InfoHint-CyuBCIgq.cjs} +1 -1
- package/dist/{Message-vFr_gB2V.cjs → Message-BpDOzu5W.cjs} +1 -1
- package/dist/{Message-DPv6St5M.js → Message-CqVP4y4Y.js} +1 -1
- package/dist/{Modal-x4RAvBHZ.cjs → Modal-CMF77gQX.cjs} +1 -1
- package/dist/{Modal-BCWixlOG.js → Modal-wtlHUSSo.js} +4 -4
- package/dist/{NotificationCenter-DLeWxnQl.cjs → NotificationCenter-CGNa7MoB.cjs} +1 -1
- package/dist/{NotificationCenter-BkgLzD2x.js → NotificationCenter-DtsfXKrM.js} +1 -1
- package/dist/{NumberInput-DgjZDq0n.js → NumberInput-ggLG8zsa.js} +2 -2
- package/dist/{NumberInput-DpPVxENr.cjs → NumberInput-x1lY-01L.cjs} +1 -1
- package/dist/{Pagination-XOtOT86P.cjs → Pagination-6FLCG39u.cjs} +1 -1
- package/dist/{Pagination-Dk2C7ktz.js → Pagination-gc-SNeLt.js} +2 -2
- package/dist/{ProgressBar-CnVdi3l4.cjs → ProgressBar-CHyFQlL4.cjs} +1 -1
- package/dist/{ProgressBar-DFtOp3I-.js → ProgressBar-RCt7Y6mi.js} +2 -2
- package/dist/{Radio-DYXyO8tN.cjs → Radio-BSl4W12s.cjs} +1 -1
- package/dist/{Radio-CgsnwzDy.js → Radio-DHmTMvjM.js} +2 -2
- package/dist/{ReorderList-BuUYPJMK.js → ReorderList-BgowtiZj.js} +1 -1
- package/dist/{ReorderList-bFHn97rx.cjs → ReorderList-JLX01ViS.cjs} +1 -1
- package/dist/Select-DPrncZll.js +576 -0
- package/dist/{Select-CnieTPOL.cjs → Select-cRjKYI2t.cjs} +1 -1
- package/dist/Shell-B-kBO9pJ.cjs +1 -0
- package/dist/Shell-Da_Updzh.js +520 -0
- package/dist/{ShellPanel-CaThNh0w.cjs → ShellPanel-BaJQxg3h.cjs} +1 -1
- package/dist/{ShellPanel-Di6orfq4.js → ShellPanel-CoP2tWLo.js} +1 -1
- package/dist/{SidebarCollapseToggle-UzGP4TzC.js → SidebarCollapseToggle-CX6Ay_PC.js} +1 -1
- package/dist/{SidebarCollapseToggle-CX4_V0Ts.cjs → SidebarCollapseToggle-dgx4SPB5.cjs} +1 -1
- package/dist/{SidebarHeaderToggle-CHkcVjY7.cjs → SidebarHeaderToggle-BeLPv1dU.cjs} +1 -1
- package/dist/{SidebarHeaderToggle-BFxmHAl9.js → SidebarHeaderToggle-BwnXdcrB.js} +1 -1
- package/dist/{SidebarLink-DaZrlrLZ.cjs → SidebarLink-BeuUiOLd.cjs} +1 -1
- package/dist/{SidebarLink-CXCdVrWM.js → SidebarLink-m9WhGcc2.js} +1 -1
- package/dist/{SidebarMenuGroup-kEwoJus9.js → SidebarMenuGroup-BTVsBDts.js} +1 -1
- package/dist/{SidebarMenuGroup-BUy6LXoB.cjs → SidebarMenuGroup-ByeTvkHJ.cjs} +1 -1
- package/dist/{SidebarMenuItem-Bh_2pd3f.js → SidebarMenuItem-BFdCve25.js} +1 -1
- package/dist/{SidebarMenuItem-BEWYdzfa.cjs → SidebarMenuItem-C46vbCOy.cjs} +1 -1
- package/dist/{Slider-CUonOhgJ.js → Slider-56pPcL_E.js} +2 -2
- package/dist/{Slider-CojrFGb_.cjs → Slider-TlwhliL1.cjs} +1 -1
- package/dist/{Stat-UpbLQlEY.js → Stat-BfDK9HRp.js} +1 -1
- package/dist/{Stat-BSdnUOwK.cjs → Stat-x01dwM0g.cjs} +1 -1
- package/dist/{StepperStep-CjxVhsbr.cjs → StepperStep-C-uCJroV.cjs} +1 -1
- package/dist/{StepperStep-Co1KKj9h.js → StepperStep-CsrrJfwu.js} +1 -1
- package/dist/{Switch-8zEBXjF9.js → Switch-B40hMlXu.js} +1 -1
- package/dist/{Switch-D6Yh4B_9.cjs → Switch-D7eHiXw1.cjs} +1 -1
- package/dist/{TableOfContents-BPw_ilXl.js → TableOfContents-B72I_ReR.js} +1 -1
- package/dist/{TableOfContents-Dg1rE8d6.cjs → TableOfContents-CNxzC_6Z.cjs} +1 -1
- package/dist/{Tabs-C-vp8-s1.js → Tabs-C_sm66Xi.js} +1 -1
- package/dist/{Tabs-CNZ3LlV1.cjs → Tabs-RbPvDC7u.cjs} +1 -1
- package/dist/{TextInput-Cxnxq2F6.js → TextInput-DssK3wB2.js} +2 -2
- package/dist/{TextInput-D6YChZsO.cjs → TextInput-gA5Fp8Y7.cjs} +2 -2
- package/dist/{Toast-WMeps0Sy.js → Toast-CkZ1teg6.js} +1 -1
- package/dist/{Toast-DJ4m7ct6.cjs → Toast-DNtON_wR.cjs} +1 -1
- package/dist/{Toaster-BHcDHheK.js → Toaster-B1SyGLyl.js} +2 -2
- package/dist/{Toaster-BkxXz6XR.cjs → Toaster-C6GwLIeR.cjs} +1 -1
- package/dist/{TreeNode-CyJM0bOD.js → TreeNode-4bbso5nG.js} +1 -1
- package/dist/{TreeNode-BDCrTAs_.cjs → TreeNode-CSHd1PSy.cjs} +1 -1
- package/dist/{UserMenu-zLh3PXSg.js → UserMenu-BD6uLDXp.js} +1 -1
- package/dist/{UserMenu-ZaUmKXsQ.cjs → UserMenu-Cn_zwZyJ.cjs} +1 -1
- package/dist/{Video-CG0jZjAZ.cjs → Video-B8TFsoLx.cjs} +1 -1
- package/dist/{Video-BnajNYWZ.js → Video-CTeSlgd1.js} +1 -1
- package/dist/{Walkthrough-CV9RAizC.cjs → Walkthrough-BIN8ZCbA.cjs} +1 -1
- package/dist/{Walkthrough-BmSzAV_b.js → Walkthrough-Cy136LvZ.js} +2 -2
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +57 -57
- package/dist/components/AccordionItem.cjs +1 -1
- package/dist/components/AccordionItem.mjs +1 -1
- package/dist/components/AccordionItem.vue.d.ts.map +1 -1
- package/dist/components/ActionGroup.cjs +1 -1
- package/dist/components/ActionGroup.mjs +1 -1
- package/dist/components/AiProvider.cjs +1 -1
- package/dist/components/AiProvider.mjs +1 -1
- package/dist/components/BackToTop.cjs +1 -1
- package/dist/components/BackToTop.mjs +1 -1
- package/dist/components/Banner.cjs +1 -1
- package/dist/components/Banner.mjs +1 -1
- package/dist/components/Blueprint.cjs +1 -1
- package/dist/components/Blueprint.mjs +1 -1
- package/dist/components/BlueprintCard.cjs +1 -1
- package/dist/components/BlueprintCard.mjs +1 -1
- package/dist/components/BlueprintControls.cjs +1 -1
- package/dist/components/BlueprintControls.mjs +1 -1
- package/dist/components/Board.cjs +1 -1
- package/dist/components/Board.mjs +1 -1
- package/dist/components/BottomPanel.cjs +1 -1
- package/dist/components/BottomPanel.mjs +1 -1
- package/dist/components/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs.mjs +1 -1
- package/dist/components/Briefing.cjs +1 -1
- package/dist/components/Briefing.mjs +1 -1
- package/dist/components/BriefingDestination.cjs +1 -1
- package/dist/components/BriefingDestination.mjs +1 -1
- package/dist/components/Button.cjs +1 -1
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Card.cjs +1 -1
- package/dist/components/Card.mjs +1 -1
- package/dist/components/Checkbox.cjs +1 -1
- package/dist/components/Checkbox.mjs +1 -1
- package/dist/components/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup.cjs +1 -1
- package/dist/components/CheckboxGroup.mjs +1 -1
- package/dist/components/ColorStrip.cjs +1 -1
- package/dist/components/ColorStrip.mjs +1 -1
- package/dist/components/CommandPalette.vue.d.ts.map +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.env.d.ts +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/CopyButton.cjs +1 -1
- package/dist/components/CopyButton.mjs +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/DatePicker.cjs +1 -1
- package/dist/components/DatePicker.mjs +1 -1
- package/dist/components/DragHandle.cjs +1 -1
- package/dist/components/DragHandle.mjs +1 -1
- package/dist/components/FileUploader.cjs +1 -1
- package/dist/components/FileUploader.mjs +1 -1
- package/dist/components/FloatingToolbar.cjs +1 -1
- package/dist/components/FloatingToolbar.mjs +1 -1
- package/dist/components/ImagePicker.cjs +1 -1
- package/dist/components/ImagePicker.mjs +1 -1
- package/dist/components/InfoHint.cjs +1 -1
- package/dist/components/InfoHint.mjs +1 -1
- package/dist/components/InfoHint.vue.d.ts.map +1 -1
- package/dist/components/Menu.vue.d.ts.map +1 -1
- package/dist/components/Message.cjs +1 -1
- package/dist/components/Message.mjs +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NotificationCenter.vue.d.ts.map +1 -1
- package/dist/components/NumberInput.cjs +1 -1
- package/dist/components/NumberInput.mjs +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/ProgressBar.cjs +1 -1
- package/dist/components/ProgressBar.mjs +1 -1
- package/dist/components/Radio.cjs +1 -1
- package/dist/components/Radio.mjs +1 -1
- package/dist/components/Radio.vue.d.ts.map +1 -1
- package/dist/components/ReorderList.cjs +1 -1
- package/dist/components/ReorderList.mjs +1 -1
- package/dist/components/Select.cjs +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Select.vue.d.ts +2 -2
- package/dist/components/Select.vue.d.ts.map +1 -1
- package/dist/components/Shell.cjs +1 -1
- package/dist/components/Shell.d.ts +23 -0
- package/dist/components/Shell.mjs +1 -1
- package/dist/components/Shell.vue.d.ts +12 -11
- package/dist/components/Shell.vue.d.ts.map +1 -1
- package/dist/components/ShellPanel.cjs +1 -1
- package/dist/components/ShellPanel.mjs +1 -1
- package/dist/components/SidebarCollapseToggle.cjs +1 -1
- package/dist/components/SidebarCollapseToggle.mjs +1 -1
- package/dist/components/SidebarHeaderToggle.cjs +1 -1
- package/dist/components/SidebarHeaderToggle.mjs +1 -1
- package/dist/components/SidebarLink.cjs +1 -1
- package/dist/components/SidebarLink.mjs +1 -1
- package/dist/components/SidebarMenuGroup.cjs +1 -1
- package/dist/components/SidebarMenuGroup.mjs +1 -1
- package/dist/components/SidebarMenuItem.cjs +1 -1
- package/dist/components/SidebarMenuItem.mjs +1 -1
- package/dist/components/SidebarMenuItem.vue.d.ts.map +1 -1
- package/dist/components/Slider.cjs +1 -1
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Stat.cjs +1 -1
- package/dist/components/Stat.mjs +1 -1
- package/dist/components/StepperStep.cjs +1 -1
- package/dist/components/StepperStep.mjs +1 -1
- package/dist/components/Submenu.vue.d.ts.map +1 -1
- package/dist/components/Switch.cjs +1 -1
- package/dist/components/Switch.mjs +1 -1
- package/dist/components/Switch.vue.d.ts.map +1 -1
- package/dist/components/TableOfContents.cjs +1 -1
- package/dist/components/TableOfContents.mjs +1 -1
- package/dist/components/Tabs.cjs +1 -1
- package/dist/components/Tabs.mjs +1 -1
- package/dist/components/TextInput.cjs +1 -1
- package/dist/components/TextInput.mjs +1 -1
- package/dist/components/Toast.cjs +1 -1
- package/dist/components/Toast.mjs +1 -1
- package/dist/components/Toaster.cjs +1 -1
- package/dist/components/Toaster.mjs +1 -1
- package/dist/components/TreeNode.cjs +1 -1
- package/dist/components/TreeNode.mjs +1 -1
- package/dist/components/UserMenu.cjs +1 -1
- package/dist/components/UserMenu.mjs +1 -1
- package/dist/components/UserMenu.vue.d.ts.map +1 -1
- package/dist/components/Video.cjs +1 -1
- package/dist/components/Video.mjs +1 -1
- package/dist/components/Walkthrough.cjs +1 -1
- package/dist/components/Walkthrough.mjs +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +57 -57
- package/dist/{main-B7CVGoiq.js → main-Bp4F8LhP.js} +4 -4
- package/dist/main-Dw1kBHgQ.cjs +4 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/AccordionItem.css +1 -1
- package/dist/styles/BackToTop.css +1 -1
- package/dist/styles/Banner.css +1 -1
- package/dist/styles/Blueprint.css +1 -1
- package/dist/styles/BlueprintCard.css +1 -1
- package/dist/styles/Board.css +1 -1
- package/dist/styles/BottomPanel.css +1 -1
- package/dist/styles/Button.css +1 -1
- package/dist/styles/Calendar.css +1 -1
- package/dist/styles/Card.css +1 -1
- package/dist/styles/Checkbox.css +1 -1
- package/dist/styles/ColorStrip.css +1 -1
- package/dist/styles/CommandPalette.css +1 -1
- package/dist/styles/DataTable.css +1 -1
- package/dist/styles/DatePicker.css +1 -1
- package/dist/styles/DragHandle.css +1 -1
- package/dist/styles/FileUploader.css +1 -1
- package/dist/styles/FloatingToolbar.css +1 -1
- package/dist/styles/ImagePicker.css +1 -1
- package/dist/styles/InfoHint.css +1 -1
- package/dist/styles/Menu.css +1 -1
- package/dist/styles/MenuBarItem.css +1 -1
- package/dist/styles/MenuItem.css +1 -1
- package/dist/styles/Message.css +1 -1
- package/dist/styles/Modal.css +1 -1
- package/dist/styles/NotificationCenter.css +1 -1
- package/dist/styles/NumberInput.css +1 -1
- package/dist/styles/ProgressBar.css +1 -1
- package/dist/styles/Radio.css +1 -1
- package/dist/styles/ReorderList.css +1 -1
- package/dist/styles/Select.css +1 -1
- package/dist/styles/Shell.css +1 -1
- package/dist/styles/ShellPanel.css +1 -1
- package/dist/styles/SidebarHeaderToggle.css +1 -1
- package/dist/styles/SidebarLink.css +1 -1
- package/dist/styles/SidebarMenuGroup.css +1 -1
- package/dist/styles/SidebarMenuItem.css +1 -1
- package/dist/styles/Stat.css +1 -1
- package/dist/styles/StepperStep.css +1 -1
- package/dist/styles/Submenu.css +1 -1
- package/dist/styles/Switch.css +1 -1
- package/dist/styles/Tabs.css +1 -1
- package/dist/styles/TextInput.css +1 -1
- package/dist/styles/Toast.css +1 -1
- package/dist/styles/Toaster.css +1 -1
- package/dist/styles/TreeNode.css +1 -1
- package/dist/styles/UserMenu.css +1 -1
- package/dist/styles/Walkthrough.css +1 -1
- package/dist/ui.css +48 -48
- package/package.json +1 -1
- package/src/styles/_theme.scss +19 -0
- package/src/styles/logic/_motion.scss +32 -0
- package/src/styles/variables/_animations.scss +45 -3
- package/dist/AccordionItem-BOIL14KX.cjs +0 -1
- package/dist/Select-cEKAoY4x.js +0 -573
- package/dist/Shell-BUqkz67b.js +0 -497
- package/dist/Shell-CixU-_Lh.cjs +0 -1
- package/dist/main-8_dE3Ta1.cjs +0 -4
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import { t as e } from "./Icon-rREAqsu0.js";
|
|
2
|
+
import { t } from "./Grid-CJFQvcko.js";
|
|
3
|
+
import { t as n } from "./Label-BEW_5nYq.js";
|
|
4
|
+
import { t as r } from "./Message-CqVP4y4Y.js";
|
|
5
|
+
import { useMenuSurface as i } from "./composables/useMenuSurface.composable.mjs";
|
|
6
|
+
import { Fragment as a, Teleport as o, Transition as ee, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, h as te, mergeProps as ne, nextTick as re, normalizeClass as h, normalizeProps as ie, normalizeStyle as ae, onBeforeUnmount as oe, openBlock as g, ref as _, renderList as se, renderSlot as v, toDisplayString as y, unref as b, useId as ce, useSlots as le, vModelText as ue, watch as de, withCtx as x, withDirectives as fe, withKeys as S, withModifiers as C } from "vue";
|
|
7
|
+
import { regular as pe } from "@nubisco/ui/icons/caret-down";
|
|
8
|
+
import { regular as me } from "@nubisco/ui/icons/caret-up";
|
|
9
|
+
import { regular as he } from "@nubisco/ui/icons/x";
|
|
10
|
+
//#region src/components/Select.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var ge = [
|
|
12
|
+
"id",
|
|
13
|
+
"aria-expanded",
|
|
14
|
+
"aria-disabled",
|
|
15
|
+
"aria-required",
|
|
16
|
+
"disabled"
|
|
17
|
+
], _e = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "nb-select__clear-space",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}, ve = ["aria-label"], ye = [
|
|
22
|
+
"id",
|
|
23
|
+
"aria-expanded",
|
|
24
|
+
"aria-disabled",
|
|
25
|
+
"aria-required",
|
|
26
|
+
"disabled"
|
|
27
|
+
], be = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "nb-select__inner-label"
|
|
30
|
+
}, xe = {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "nb-select__asterisk",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, Se = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "nb-select__clear-space",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}, Ce = ["aria-label"], we = ["id", "aria-multiselectable"], Te = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "nb-select__search"
|
|
41
|
+
}, Ee = [
|
|
42
|
+
"placeholder",
|
|
43
|
+
"aria-label",
|
|
44
|
+
"aria-controls",
|
|
45
|
+
"aria-activedescendant"
|
|
46
|
+
], De = ["aria-labelledby"], Oe = ["id"], ke = [
|
|
47
|
+
"id",
|
|
48
|
+
"data-index",
|
|
49
|
+
"aria-selected",
|
|
50
|
+
"aria-disabled",
|
|
51
|
+
"onMouseenter",
|
|
52
|
+
"onClick"
|
|
53
|
+
], Ae = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "nb-select__option-check",
|
|
56
|
+
"aria-hidden": "true"
|
|
57
|
+
}, je = {
|
|
58
|
+
key: 0,
|
|
59
|
+
viewBox: "0 0 10 8",
|
|
60
|
+
fill: "none",
|
|
61
|
+
width: "10",
|
|
62
|
+
height: "8"
|
|
63
|
+
}, Me = { class: "nb-select__option-label" }, Ne = {
|
|
64
|
+
key: 1,
|
|
65
|
+
class: "nb-select__empty"
|
|
66
|
+
}, Pe = {
|
|
67
|
+
key: 2,
|
|
68
|
+
class: "nb-select__empty"
|
|
69
|
+
}, Fe = ["placeholder", "onKeydown"], Ie = /* @__PURE__ */ m({
|
|
70
|
+
__name: "Select",
|
|
71
|
+
props: {
|
|
72
|
+
modelValue: { default: null },
|
|
73
|
+
options: { default: () => [] },
|
|
74
|
+
multiple: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !1
|
|
77
|
+
},
|
|
78
|
+
creatable: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: !1
|
|
81
|
+
},
|
|
82
|
+
createPlaceholder: { default: "" },
|
|
83
|
+
clearable: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: !1
|
|
86
|
+
},
|
|
87
|
+
clearLabel: { default: "Clear selection" },
|
|
88
|
+
searchable: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: !1
|
|
91
|
+
},
|
|
92
|
+
searchPlaceholder: { default: "Search…" },
|
|
93
|
+
noResultsLabel: { default: "No results" },
|
|
94
|
+
anchor: {
|
|
95
|
+
type: [Function, null],
|
|
96
|
+
default: null
|
|
97
|
+
},
|
|
98
|
+
selectedMark: { default: "fill" },
|
|
99
|
+
placeholder: { default: "Select…" },
|
|
100
|
+
name: { default: "" },
|
|
101
|
+
disabled: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: !1
|
|
104
|
+
},
|
|
105
|
+
required: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: !1
|
|
108
|
+
},
|
|
109
|
+
id: { default: void 0 },
|
|
110
|
+
label: { default: "" },
|
|
111
|
+
error: { default: "" },
|
|
112
|
+
warning: { default: "" },
|
|
113
|
+
helper: { default: "" },
|
|
114
|
+
variant: { default: "default" },
|
|
115
|
+
size: { default: "md" }
|
|
116
|
+
},
|
|
117
|
+
emits: [
|
|
118
|
+
"update:modelValue",
|
|
119
|
+
"change",
|
|
120
|
+
"create"
|
|
121
|
+
],
|
|
122
|
+
setup(m, { expose: Ie, emit: Le }) {
|
|
123
|
+
let w = m, T = Le, E = (e, { slots: t }) => e.wrap ? te("div", { class: "nb-select__control" }, t.default?.()) : t.default?.();
|
|
124
|
+
E.props = ["wrap"];
|
|
125
|
+
let D = _(""), O = _(""), Re = _(null);
|
|
126
|
+
function ze() {
|
|
127
|
+
let e = D.value.trim();
|
|
128
|
+
e && (T("create", e), D.value = "");
|
|
129
|
+
}
|
|
130
|
+
let k = _(!1), A = _(!1), j = _(-1), M = _(null), N = _(null), P = le(), Be = () => (typeof w.anchor == "function" ? w.anchor() : w.anchor) ?? N.value ?? M.value;
|
|
131
|
+
function Ve() {
|
|
132
|
+
(N.value ?? M.value?.querySelector("button, [tabindex]"))?.focus();
|
|
133
|
+
}
|
|
134
|
+
let F = _(null);
|
|
135
|
+
i(F);
|
|
136
|
+
let He = _({
|
|
137
|
+
position: "fixed",
|
|
138
|
+
top: "0px",
|
|
139
|
+
left: "0px",
|
|
140
|
+
width: "0px",
|
|
141
|
+
zIndex: "9999"
|
|
142
|
+
}), Ue = `nb-select-${ce()}`, I = s(() => w.id ?? Ue), L = s(() => `${I.value}-listbox`), We = (e) => `${I.value}-option-${e}`, R = s(() => w.modelValue == null ? [] : Array.isArray(w.modelValue) ? w.modelValue : [w.modelValue]), z = s(() => {
|
|
143
|
+
if (!(w.multiple || R.value.length !== 1)) return (w.options ?? []).find((e) => e.value === R.value[0])?.icon;
|
|
144
|
+
}), B = s(() => {
|
|
145
|
+
if (R.value.length === 0) return "";
|
|
146
|
+
let e = w.options ?? [];
|
|
147
|
+
return w.multiple ? R.value.length === 1 ? e.find((e) => e.value === R.value[0])?.label ?? String(R.value[0]) : R.value.length === 2 ? R.value.map((t) => e.find((e) => e.value === t)?.label ?? String(t)).join(", ") : `${R.value.length} selected` : e.find((e) => e.value === R.value[0])?.label ?? String(R.value[0]);
|
|
148
|
+
});
|
|
149
|
+
function V(e) {
|
|
150
|
+
return R.value.includes(e);
|
|
151
|
+
}
|
|
152
|
+
let Ge = (e) => e.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase(), H = s(() => {
|
|
153
|
+
let e = w.options ?? [], t = w.searchable ? Ge(O.value.trim()) : "", n = /* @__PURE__ */ new Set();
|
|
154
|
+
return e.forEach((e, r) => {
|
|
155
|
+
(!t || Ge(e.label).includes(t)) && n.add(r);
|
|
156
|
+
}), n;
|
|
157
|
+
}), Ke = s(() => {
|
|
158
|
+
let e = [];
|
|
159
|
+
return (w.options ?? []).forEach((t, n) => {
|
|
160
|
+
if (!H.value.has(n)) return;
|
|
161
|
+
let r = e[e.length - 1];
|
|
162
|
+
(!r || r.name !== t.group) && e.push({
|
|
163
|
+
key: `${e.length}:${t.group ?? ""}`,
|
|
164
|
+
name: t.group,
|
|
165
|
+
labelId: `${I.value}-group-${e.length}`,
|
|
166
|
+
entries: []
|
|
167
|
+
}), e[e.length - 1].entries.push({
|
|
168
|
+
option: t,
|
|
169
|
+
index: n
|
|
170
|
+
});
|
|
171
|
+
}), e;
|
|
172
|
+
});
|
|
173
|
+
function U(e, t) {
|
|
174
|
+
let n = w.options ?? [];
|
|
175
|
+
for (let r = e + t; r >= 0 && r < n.length; r += t) if (!n[r].disabled && H.value.has(r)) return r;
|
|
176
|
+
return e;
|
|
177
|
+
}
|
|
178
|
+
function qe(e) {
|
|
179
|
+
if (e.disabled) return;
|
|
180
|
+
let t;
|
|
181
|
+
if (w.multiple) {
|
|
182
|
+
let n = [...R.value], r = n.indexOf(e.value);
|
|
183
|
+
r >= 0 ? n.splice(r, 1) : n.push(e.value), t = n;
|
|
184
|
+
} else t = e.value, K();
|
|
185
|
+
T("update:modelValue", t), T("change", t);
|
|
186
|
+
}
|
|
187
|
+
function W() {
|
|
188
|
+
let e = Be();
|
|
189
|
+
if (!e) return;
|
|
190
|
+
let t = e.getBoundingClientRect(), n = F.value?.offsetHeight ?? 0, r = window.innerHeight - t.bottom, i = t.top, a = n > 0 && r < n && i > r, o = P.trigger ? Math.max(t.width, 240) : t.width, ee = P.trigger ? Math.max(8, Math.min(t.left, window.innerWidth - o - 8)) : t.left;
|
|
191
|
+
He.value = {
|
|
192
|
+
position: "fixed",
|
|
193
|
+
top: a ? `${t.top - n}px` : `${t.bottom}px`,
|
|
194
|
+
left: `${ee}px`,
|
|
195
|
+
width: `${o}px`,
|
|
196
|
+
zIndex: "9999"
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function G() {
|
|
200
|
+
if (w.disabled) return;
|
|
201
|
+
k.value = !0, W();
|
|
202
|
+
let e = w.options ?? [];
|
|
203
|
+
j.value = R.value.length > 0 ? Math.max(0, e.findIndex((e) => e.value === R.value[0])) : -1, re(() => {
|
|
204
|
+
W(), Z(), Re.value?.focus({ preventScroll: !0 });
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function K() {
|
|
208
|
+
let e = !!F.value?.contains(document.activeElement);
|
|
209
|
+
k.value = !1, j.value = -1, O.value = "", e && Ve();
|
|
210
|
+
}
|
|
211
|
+
function q() {
|
|
212
|
+
k.value ? K() : G();
|
|
213
|
+
}
|
|
214
|
+
function J(e) {
|
|
215
|
+
let t = e.target, n = M.value?.contains(t) ?? !1, r = F.value?.contains(t) ?? !1;
|
|
216
|
+
!n && !r && K();
|
|
217
|
+
}
|
|
218
|
+
function Y() {
|
|
219
|
+
k.value && W();
|
|
220
|
+
}
|
|
221
|
+
de(k, (e) => {
|
|
222
|
+
e ? (document.addEventListener("mousedown", J), window.addEventListener("scroll", Y, !0), window.addEventListener("resize", Y)) : (document.removeEventListener("mousedown", J), window.removeEventListener("scroll", Y, !0), window.removeEventListener("resize", Y));
|
|
223
|
+
}), oe(() => {
|
|
224
|
+
document.removeEventListener("mousedown", J), window.removeEventListener("scroll", Y, !0), window.removeEventListener("resize", Y);
|
|
225
|
+
});
|
|
226
|
+
function X(e) {
|
|
227
|
+
let t = w.options ?? [];
|
|
228
|
+
if (!k.value) {
|
|
229
|
+
(e.key === "Enter" || e.key === " " || e.key === "ArrowDown") && (e.preventDefault(), G());
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
e.key === "Escape" ? (K(), e.preventDefault()) : e.key === "Tab" ? K() : e.key === "ArrowDown" ? (e.preventDefault(), j.value = U(j.value, 1), Z()) : e.key === "ArrowUp" ? (e.preventDefault(), j.value > 0 && (j.value = U(j.value, -1)), Z()) : (e.key === "Enter" || e.key === " ") && j.value >= 0 && (e.preventDefault(), qe(t[j.value]));
|
|
233
|
+
}
|
|
234
|
+
function Z() {
|
|
235
|
+
re(() => {
|
|
236
|
+
!F.value || j.value < 0 || F.value.querySelector(`[data-index="${j.value}"]`)?.scrollIntoView({ block: "nearest" });
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
de(O, () => {
|
|
240
|
+
if (!k.value) return;
|
|
241
|
+
let e = U(-1, 1);
|
|
242
|
+
j.value = e === -1 ? -1 : e, Z();
|
|
243
|
+
});
|
|
244
|
+
function Je(e) {
|
|
245
|
+
if (e.key === " ") {
|
|
246
|
+
e.stopPropagation();
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (e.key === "Home" || e.key === "End") {
|
|
250
|
+
e.stopPropagation();
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
X(e);
|
|
254
|
+
}
|
|
255
|
+
let Ye = s(() => ({
|
|
256
|
+
isOpen: k.value,
|
|
257
|
+
toggle: q,
|
|
258
|
+
open: G,
|
|
259
|
+
close: K,
|
|
260
|
+
attrs: {
|
|
261
|
+
"aria-expanded": k.value,
|
|
262
|
+
"aria-haspopup": "listbox",
|
|
263
|
+
"aria-controls": k.value ? L.value : void 0,
|
|
264
|
+
onClick: q
|
|
265
|
+
}
|
|
266
|
+
})), Q = s(() => w.clearable && !w.disabled && R.value.length > 0);
|
|
267
|
+
function $() {
|
|
268
|
+
let e = w.multiple ? [] : null;
|
|
269
|
+
K(), T("update:modelValue", e), T("change", e), Ve();
|
|
270
|
+
}
|
|
271
|
+
let Xe = s(() => [
|
|
272
|
+
"nb-select",
|
|
273
|
+
`nb-select--${w.variant}`,
|
|
274
|
+
`nb-select--${w.size}`,
|
|
275
|
+
{
|
|
276
|
+
"nb-select--open": k.value,
|
|
277
|
+
"nb-select--focused": A.value && !k.value,
|
|
278
|
+
"nb-select--error": !!w.error,
|
|
279
|
+
"nb-select--warning": !w.error && !!w.warning,
|
|
280
|
+
"nb-select--multiple": w.multiple,
|
|
281
|
+
"nb-select--bare": !!P.trigger
|
|
282
|
+
}
|
|
283
|
+
]);
|
|
284
|
+
return Ie({
|
|
285
|
+
open: G,
|
|
286
|
+
close: K
|
|
287
|
+
}), (i, s) => (g(), u(a, null, [d("div", {
|
|
288
|
+
ref_key: "rootRef",
|
|
289
|
+
ref: M,
|
|
290
|
+
class: h(Xe.value),
|
|
291
|
+
onKeydown: X
|
|
292
|
+
}, [i.$slots.trigger ? v(i.$slots, "trigger", ie(ne({ key: 0 }, Ye.value))) : m.variant === "default" ? (g(), u(a, { key: 1 }, [
|
|
293
|
+
i.$slots.label ? v(i.$slots, "label", { key: 0 }) : m.label ? (g(), c(n, {
|
|
294
|
+
key: 1,
|
|
295
|
+
for: I.value,
|
|
296
|
+
required: m.required,
|
|
297
|
+
disabled: m.disabled
|
|
298
|
+
}, {
|
|
299
|
+
default: x(() => [f(y(m.label), 1)]),
|
|
300
|
+
_: 1
|
|
301
|
+
}, 8, [
|
|
302
|
+
"for",
|
|
303
|
+
"required",
|
|
304
|
+
"disabled"
|
|
305
|
+
])) : l("", !0),
|
|
306
|
+
p(E, { wrap: m.clearable }, {
|
|
307
|
+
default: x(() => [d("button", {
|
|
308
|
+
id: I.value,
|
|
309
|
+
ref_key: "triggerRef",
|
|
310
|
+
ref: N,
|
|
311
|
+
type: "button",
|
|
312
|
+
class: "nb-select__trigger",
|
|
313
|
+
role: "combobox",
|
|
314
|
+
"aria-expanded": k.value,
|
|
315
|
+
"aria-haspopup": "listbox",
|
|
316
|
+
"aria-disabled": m.disabled || void 0,
|
|
317
|
+
"aria-required": m.required || void 0,
|
|
318
|
+
disabled: m.disabled || void 0,
|
|
319
|
+
onClick: q,
|
|
320
|
+
onFocus: s[0] ||= (e) => A.value = !0,
|
|
321
|
+
onBlur: s[1] ||= (e) => A.value = !1
|
|
322
|
+
}, [
|
|
323
|
+
d("span", { class: h(["nb-select__value", {
|
|
324
|
+
"nb-select__value--placeholder": !B.value,
|
|
325
|
+
"nb-select__value--with-icon": !!z.value
|
|
326
|
+
}]) }, [z.value ? (g(), c(e, {
|
|
327
|
+
key: 0,
|
|
328
|
+
class: "nb-select__value-icon",
|
|
329
|
+
name: z.value,
|
|
330
|
+
size: 16
|
|
331
|
+
}, null, 8, ["name"])) : l("", !0), B.value ? v(i.$slots, "value", {
|
|
332
|
+
key: 1,
|
|
333
|
+
values: R.value
|
|
334
|
+
}, () => [f(y(B.value), 1)]) : (g(), u(a, { key: 2 }, [f(y(m.placeholder), 1)], 64))], 2),
|
|
335
|
+
m.error ? (g(), c(r, {
|
|
336
|
+
key: 0,
|
|
337
|
+
variant: "error",
|
|
338
|
+
"icon-only": !0,
|
|
339
|
+
class: "nb-select__status-icon"
|
|
340
|
+
}, {
|
|
341
|
+
default: x(() => [f(y(m.error), 1)]),
|
|
342
|
+
_: 1
|
|
343
|
+
})) : m.warning ? (g(), c(r, {
|
|
344
|
+
key: 1,
|
|
345
|
+
variant: "warning",
|
|
346
|
+
"icon-only": !0,
|
|
347
|
+
class: "nb-select__status-icon"
|
|
348
|
+
}, {
|
|
349
|
+
default: x(() => [f(y(m.warning), 1)]),
|
|
350
|
+
_: 1
|
|
351
|
+
})) : l("", !0),
|
|
352
|
+
Q.value ? (g(), u("span", _e)) : l("", !0),
|
|
353
|
+
p(t, {
|
|
354
|
+
align: "center",
|
|
355
|
+
justify: "center",
|
|
356
|
+
class: "nb-select__caret"
|
|
357
|
+
}, {
|
|
358
|
+
default: x(() => [p(e, {
|
|
359
|
+
name: k.value ? b(me) : b(pe),
|
|
360
|
+
size: 16
|
|
361
|
+
}, null, 8, ["name"])]),
|
|
362
|
+
_: 1
|
|
363
|
+
})
|
|
364
|
+
], 40, ge), Q.value ? (g(), u("button", {
|
|
365
|
+
key: 0,
|
|
366
|
+
type: "button",
|
|
367
|
+
class: "nb-select__clear",
|
|
368
|
+
"aria-label": m.clearLabel,
|
|
369
|
+
onClick: $,
|
|
370
|
+
onKeydown: [s[2] ||= S(C(() => {}, ["stop"]), ["enter"]), s[3] ||= S(C(() => {}, ["stop"]), ["space"])]
|
|
371
|
+
}, [p(e, {
|
|
372
|
+
name: b(he),
|
|
373
|
+
size: 16
|
|
374
|
+
}, null, 8, ["name"])], 40, ve)) : l("", !0)]),
|
|
375
|
+
_: 3
|
|
376
|
+
}, 8, ["wrap"]),
|
|
377
|
+
m.error ? (g(), c(r, {
|
|
378
|
+
key: 2,
|
|
379
|
+
variant: "error",
|
|
380
|
+
class: "nb-select__message"
|
|
381
|
+
}, {
|
|
382
|
+
default: x(() => [f(y(m.error), 1)]),
|
|
383
|
+
_: 1
|
|
384
|
+
})) : m.warning ? (g(), c(r, {
|
|
385
|
+
key: 3,
|
|
386
|
+
variant: "warning",
|
|
387
|
+
class: "nb-select__message"
|
|
388
|
+
}, {
|
|
389
|
+
default: x(() => [f(y(m.warning), 1)]),
|
|
390
|
+
_: 1
|
|
391
|
+
})) : m.helper ? (g(), c(r, {
|
|
392
|
+
key: 4,
|
|
393
|
+
variant: "helper",
|
|
394
|
+
class: "nb-select__message"
|
|
395
|
+
}, {
|
|
396
|
+
default: x(() => [f(y(m.helper), 1)]),
|
|
397
|
+
_: 1
|
|
398
|
+
})) : l("", !0)
|
|
399
|
+
], 64)) : m.variant === "fluid" ? (g(), u(a, { key: 2 }, [p(E, { wrap: m.clearable }, {
|
|
400
|
+
default: x(() => [d("button", {
|
|
401
|
+
id: I.value,
|
|
402
|
+
ref_key: "triggerRef",
|
|
403
|
+
ref: N,
|
|
404
|
+
type: "button",
|
|
405
|
+
class: "nb-select__trigger",
|
|
406
|
+
role: "combobox",
|
|
407
|
+
"aria-expanded": k.value,
|
|
408
|
+
"aria-haspopup": "listbox",
|
|
409
|
+
"aria-disabled": m.disabled || void 0,
|
|
410
|
+
"aria-required": m.required || void 0,
|
|
411
|
+
disabled: m.disabled || void 0,
|
|
412
|
+
onClick: q,
|
|
413
|
+
onFocus: s[4] ||= (e) => A.value = !0,
|
|
414
|
+
onBlur: s[5] ||= (e) => A.value = !1
|
|
415
|
+
}, [m.label || i.$slots.label ? (g(), c(t, {
|
|
416
|
+
key: 0,
|
|
417
|
+
dir: "row",
|
|
418
|
+
align: "center",
|
|
419
|
+
gap: "xs",
|
|
420
|
+
class: "nb-select__inner-header"
|
|
421
|
+
}, {
|
|
422
|
+
default: x(() => [i.$slots.label ? v(i.$slots, "label", { key: 0 }) : (g(), u("label", be, [f(y(m.label) + " ", 1), m.required ? (g(), u("span", xe, "*")) : l("", !0)])), m.helper && !m.error && !m.warning ? (g(), c(r, {
|
|
423
|
+
key: 2,
|
|
424
|
+
variant: "helper",
|
|
425
|
+
"icon-only": !0,
|
|
426
|
+
class: "nb-select__inner-message"
|
|
427
|
+
}, {
|
|
428
|
+
default: x(() => [f(y(m.helper), 1)]),
|
|
429
|
+
_: 1
|
|
430
|
+
})) : l("", !0)]),
|
|
431
|
+
_: 3
|
|
432
|
+
})) : l("", !0), p(t, {
|
|
433
|
+
dir: "row",
|
|
434
|
+
align: "end",
|
|
435
|
+
flex: "",
|
|
436
|
+
class: "nb-select__value-row"
|
|
437
|
+
}, {
|
|
438
|
+
default: x(() => [
|
|
439
|
+
d("span", { class: h(["nb-select__value", {
|
|
440
|
+
"nb-select__value--placeholder": !B.value,
|
|
441
|
+
"nb-select__value--with-icon": !!z.value
|
|
442
|
+
}]) }, [z.value ? (g(), c(e, {
|
|
443
|
+
key: 0,
|
|
444
|
+
class: "nb-select__value-icon",
|
|
445
|
+
name: z.value,
|
|
446
|
+
size: 16
|
|
447
|
+
}, null, 8, ["name"])) : l("", !0), B.value ? v(i.$slots, "value", {
|
|
448
|
+
key: 1,
|
|
449
|
+
values: R.value
|
|
450
|
+
}, () => [f(y(B.value), 1)]) : (g(), u(a, { key: 2 }, [f(y(m.placeholder), 1)], 64))], 2),
|
|
451
|
+
Q.value ? (g(), u("span", Se)) : l("", !0),
|
|
452
|
+
p(t, {
|
|
453
|
+
align: "center",
|
|
454
|
+
justify: "center",
|
|
455
|
+
class: "nb-select__caret"
|
|
456
|
+
}, {
|
|
457
|
+
default: x(() => [p(e, {
|
|
458
|
+
name: k.value ? b(me) : b(pe),
|
|
459
|
+
size: 16
|
|
460
|
+
}, null, 8, ["name"])]),
|
|
461
|
+
_: 1
|
|
462
|
+
})
|
|
463
|
+
]),
|
|
464
|
+
_: 3
|
|
465
|
+
})], 40, ye), Q.value ? (g(), u("button", {
|
|
466
|
+
key: 0,
|
|
467
|
+
type: "button",
|
|
468
|
+
class: "nb-select__clear",
|
|
469
|
+
"aria-label": m.clearLabel,
|
|
470
|
+
onClick: $,
|
|
471
|
+
onKeydown: [s[6] ||= S(C(() => {}, ["stop"]), ["enter"]), s[7] ||= S(C(() => {}, ["stop"]), ["space"])]
|
|
472
|
+
}, [p(e, {
|
|
473
|
+
name: b(he),
|
|
474
|
+
size: 16
|
|
475
|
+
}, null, 8, ["name"])], 40, Ce)) : l("", !0)]),
|
|
476
|
+
_: 3
|
|
477
|
+
}, 8, ["wrap"]), m.error ? (g(), c(r, {
|
|
478
|
+
key: 0,
|
|
479
|
+
variant: "error",
|
|
480
|
+
class: "nb-select__fluid-message"
|
|
481
|
+
}, {
|
|
482
|
+
default: x(() => [f(y(m.error), 1)]),
|
|
483
|
+
_: 1
|
|
484
|
+
})) : m.warning ? (g(), c(r, {
|
|
485
|
+
key: 1,
|
|
486
|
+
variant: "warning",
|
|
487
|
+
class: "nb-select__fluid-message"
|
|
488
|
+
}, {
|
|
489
|
+
default: x(() => [f(y(m.warning), 1)]),
|
|
490
|
+
_: 1
|
|
491
|
+
})) : l("", !0)], 64)) : l("", !0)], 34), (g(), c(o, { to: "body" }, [p(ee, { name: "nb-select-pop" }, {
|
|
492
|
+
default: x(() => [k.value ? (g(), u("div", {
|
|
493
|
+
key: 0,
|
|
494
|
+
id: L.value,
|
|
495
|
+
ref_key: "dropdownRef",
|
|
496
|
+
ref: F,
|
|
497
|
+
class: h(["nb-select__dropdown", {
|
|
498
|
+
"nb-select__dropdown--check": m.selectedMark === "check",
|
|
499
|
+
"nb-select__dropdown--anchored": !!i.$slots.trigger
|
|
500
|
+
}]),
|
|
501
|
+
style: ae(He.value),
|
|
502
|
+
role: "listbox",
|
|
503
|
+
"aria-multiselectable": m.multiple || void 0
|
|
504
|
+
}, [
|
|
505
|
+
m.searchable ? (g(), u("div", Te, [fe(d("input", {
|
|
506
|
+
ref_key: "searchRef",
|
|
507
|
+
ref: Re,
|
|
508
|
+
"onUpdate:modelValue": s[8] ||= (e) => O.value = e,
|
|
509
|
+
type: "search",
|
|
510
|
+
class: "nb-select__search-input",
|
|
511
|
+
autocomplete: "off",
|
|
512
|
+
spellcheck: "false",
|
|
513
|
+
placeholder: m.searchPlaceholder,
|
|
514
|
+
"aria-label": m.searchPlaceholder,
|
|
515
|
+
"aria-controls": L.value,
|
|
516
|
+
"aria-activedescendant": j.value >= 0 ? We(j.value) : void 0,
|
|
517
|
+
onKeydown: Je
|
|
518
|
+
}, null, 40, Ee), [[ue, O.value]])])) : l("", !0),
|
|
519
|
+
(g(!0), u(a, null, se(Ke.value, (t) => (g(), u("div", {
|
|
520
|
+
key: t.key,
|
|
521
|
+
class: "nb-select__group",
|
|
522
|
+
role: "group",
|
|
523
|
+
"aria-labelledby": t.name ? t.labelId : void 0
|
|
524
|
+
}, [t.name ? (g(), u("div", {
|
|
525
|
+
key: 0,
|
|
526
|
+
id: t.labelId,
|
|
527
|
+
class: "nb-select__group-label"
|
|
528
|
+
}, y(t.name), 9, Oe)) : l("", !0), (g(!0), u(a, null, se(t.entries, (t) => (g(), u("div", {
|
|
529
|
+
id: We(t.index),
|
|
530
|
+
key: t.option.value,
|
|
531
|
+
"data-index": t.index,
|
|
532
|
+
class: h(["nb-select__option", {
|
|
533
|
+
"nb-select__option--selected": V(t.option.value),
|
|
534
|
+
"nb-select__option--highlighted": j.value === t.index,
|
|
535
|
+
"nb-select__option--disabled": t.option.disabled
|
|
536
|
+
}]),
|
|
537
|
+
role: "option",
|
|
538
|
+
"aria-selected": V(t.option.value),
|
|
539
|
+
"aria-disabled": t.option.disabled || void 0,
|
|
540
|
+
onMouseenter: (e) => j.value = t.index,
|
|
541
|
+
onClick: (e) => qe(t.option)
|
|
542
|
+
}, [
|
|
543
|
+
m.multiple || m.selectedMark === "check" ? (g(), u("span", Ae, [V(t.option.value) ? (g(), u("svg", je, [...s[12] ||= [d("path", {
|
|
544
|
+
d: "M1 4l3 3 5-6",
|
|
545
|
+
stroke: "currentColor",
|
|
546
|
+
"stroke-width": "1.5",
|
|
547
|
+
"stroke-linecap": "round",
|
|
548
|
+
"stroke-linejoin": "round"
|
|
549
|
+
}, null, -1)]])) : l("", !0)])) : l("", !0),
|
|
550
|
+
t.option.icon ? (g(), c(e, {
|
|
551
|
+
key: 1,
|
|
552
|
+
class: "nb-select__option-icon",
|
|
553
|
+
name: t.option.icon,
|
|
554
|
+
size: 16
|
|
555
|
+
}, null, 8, ["name"])) : l("", !0),
|
|
556
|
+
d("span", Me, [v(i.$slots, "option", { option: t.option }, () => [f(y(t.option.label), 1)])])
|
|
557
|
+
], 42, ke))), 128))], 8, De))), 128)),
|
|
558
|
+
!m.options || m.options.length === 0 ? (g(), u("div", Ne, " No options ")) : m.searchable && H.value.size === 0 ? (g(), u("div", Pe, y(m.noResultsLabel), 1)) : l("", !0),
|
|
559
|
+
m.creatable ? (g(), u("div", {
|
|
560
|
+
key: 3,
|
|
561
|
+
class: "nb-select__create",
|
|
562
|
+
onMousedown: s[11] ||= C(() => {}, ["prevent"])
|
|
563
|
+
}, [fe(d("input", {
|
|
564
|
+
"onUpdate:modelValue": s[9] ||= (e) => D.value = e,
|
|
565
|
+
type: "text",
|
|
566
|
+
class: "nb-select__create-input",
|
|
567
|
+
placeholder: m.createPlaceholder || "Add new…",
|
|
568
|
+
onKeydown: [S(C(ze, ["prevent"]), ["enter"]), s[10] ||= C(() => {}, ["stop"])]
|
|
569
|
+
}, null, 40, Fe), [[ue, D.value]])], 32)) : l("", !0)
|
|
570
|
+
], 14, we)) : l("", !0)]),
|
|
571
|
+
_: 3
|
|
572
|
+
})]))], 64));
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
//#endregion
|
|
576
|
+
export { Ie as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Icon-C8R_r_In.cjs`),t=require(`./Grid-CXE0B85G.cjs`),n=require(`./Label-71QAuWf4.cjs`),r=require(`./Message-vFr_gB2V.cjs`),i=require(`./composables/useMenuSurface.composable.cjs`);let a=require(`vue`),o=require(`@nubisco/ui/icons/caret-down`),s=require(`@nubisco/ui/icons/caret-up`),c=require(`@nubisco/ui/icons/x`);var ee=[`id`,`aria-expanded`,`aria-disabled`,`aria-required`,`disabled`],te={key:2,class:`nb-select__clear-space`,"aria-hidden":`true`},ne=[`aria-label`],l=[`id`,`aria-expanded`,`aria-disabled`,`aria-required`,`disabled`],u={key:1,class:`nb-select__inner-label`},d={key:0,class:`nb-select__asterisk`,"aria-hidden":`true`},re={key:0,class:`nb-select__clear-space`,"aria-hidden":`true`},ie=[`aria-label`],ae=[`id`,`aria-multiselectable`],oe={key:0,class:`nb-select__search`},se=[`placeholder`,`aria-label`,`aria-controls`,`aria-activedescendant`],f=[`aria-labelledby`],ce=[`id`],le=[`id`,`data-index`,`aria-selected`,`aria-disabled`,`onMouseenter`,`onClick`],ue={key:0,class:`nb-select__option-check`,"aria-hidden":`true`},de={key:0,viewBox:`0 0 10 8`,fill:`none`,width:`10`,height:`8`},p={class:`nb-select__option-label`},m={key:1,class:`nb-select__empty`},fe={key:2,class:`nb-select__empty`},pe=[`placeholder`,`onKeydown`],h=(0,a.defineComponent)({__name:`Select`,props:{modelValue:{default:null},options:{default:()=>[]},multiple:{type:Boolean,default:!1},creatable:{type:Boolean,default:!1},createPlaceholder:{default:``},clearable:{type:Boolean,default:!1},clearLabel:{default:`Clear selection`},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:`Search…`},noResultsLabel:{default:`No results`},anchor:{type:[Function,null],default:null},selectedMark:{default:`fill`},placeholder:{default:`Select…`},name:{default:``},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{default:void 0},label:{default:``},error:{default:``},warning:{default:``},helper:{default:``},variant:{default:`default`},size:{default:`md`}},emits:[`update:modelValue`,`change`,`create`],setup(h,{expose:g,emit:me}){let _=h,v=me,y=(e,{slots:t})=>e.wrap?(0,a.h)(`div`,{class:`nb-select__control`},t.default?.()):t.default?.();y.props=[`wrap`];let b=(0,a.ref)(``),x=(0,a.ref)(``),S=(0,a.ref)(null);function he(){let e=b.value.trim();e&&(v(`create`,e),b.value=``)}let C=(0,a.ref)(!1),w=(0,a.ref)(!1),T=(0,a.ref)(-1),E=(0,a.ref)(null),D=(0,a.ref)(null),O=(0,a.useSlots)(),ge=()=>(typeof _.anchor==`function`?_.anchor():_.anchor)??D.value??E.value;function k(){(D.value??E.value?.querySelector(`button, [tabindex]`))?.focus()}let A=(0,a.ref)(null);i.useMenuSurface(A);let j=(0,a.ref)({position:`fixed`,top:`0px`,left:`0px`,width:`0px`,zIndex:`9999`}),M=`nb-select-${(0,a.useId)()}`,N=(0,a.computed)(()=>_.id??M),P=(0,a.computed)(()=>`${N.value}-listbox`),F=e=>`${N.value}-option-${e}`,I=(0,a.computed)(()=>_.modelValue==null?[]:Array.isArray(_.modelValue)?_.modelValue:[_.modelValue]),L=(0,a.computed)(()=>{if(!(_.multiple||I.value.length!==1))return(_.options??[]).find(e=>e.value===I.value[0])?.icon}),R=(0,a.computed)(()=>{if(I.value.length===0)return``;let e=_.options??[];return _.multiple?I.value.length===1?e.find(e=>e.value===I.value[0])?.label??String(I.value[0]):I.value.length===2?I.value.map(t=>e.find(e=>e.value===t)?.label??String(t)).join(`, `):`${I.value.length} selected`:e.find(e=>e.value===I.value[0])?.label??String(I.value[0])});function z(e){return I.value.includes(e)}let B=e=>e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase(),V=(0,a.computed)(()=>{let e=_.options??[],t=_.searchable?B(x.value.trim()):``,n=new Set;return e.forEach((e,r)=>{(!t||B(e.label).includes(t))&&n.add(r)}),n}),_e=(0,a.computed)(()=>{let e=[];return(_.options??[]).forEach((t,n)=>{if(!V.value.has(n))return;let r=e[e.length-1];(!r||r.name!==t.group)&&e.push({key:`${e.length}:${t.group??``}`,name:t.group,labelId:`${N.value}-group-${e.length}`,entries:[]}),e[e.length-1].entries.push({option:t,index:n})}),e});function H(e,t){let n=_.options??[];for(let r=e+t;r>=0&&r<n.length;r+=t)if(!n[r].disabled&&V.value.has(r))return r;return e}function U(e){if(e.disabled)return;let t;if(_.multiple){let n=[...I.value],r=n.indexOf(e.value);r>=0?n.splice(r,1):n.push(e.value),t=n}else t=e.value,K();v(`update:modelValue`,t),v(`change`,t)}function W(){let e=ge();if(!e)return;let t=e.getBoundingClientRect(),n=A.value?.offsetHeight??0,r=window.innerHeight-t.bottom,i=t.top,a=n>0&&r<n&&i>r,o=O.trigger?Math.max(t.width,240):t.width,s=O.trigger?Math.max(8,Math.min(t.left,window.innerWidth-o-8)):t.left;j.value={position:`fixed`,top:a?`${t.top-n}px`:`${t.bottom}px`,left:`${s}px`,width:`${o}px`,zIndex:`9999`}}function G(){if(_.disabled)return;C.value=!0,W();let e=_.options??[];T.value=I.value.length>0?Math.max(0,e.findIndex(e=>e.value===I.value[0])):-1,(0,a.nextTick)(()=>{W(),Z(),S.value?.focus({preventScroll:!0})})}function K(){let e=!!A.value?.contains(document.activeElement);C.value=!1,T.value=-1,x.value=``,e&&k()}function q(){C.value?K():G()}function J(e){let t=e.target,n=E.value?.contains(t)??!1,r=A.value?.contains(t)??!1;!n&&!r&&K()}function Y(){C.value&&W()}(0,a.watch)(C,e=>{e?(document.addEventListener(`mousedown`,J),window.addEventListener(`scroll`,Y,!0),window.addEventListener(`resize`,Y)):(document.removeEventListener(`mousedown`,J),window.removeEventListener(`scroll`,Y,!0),window.removeEventListener(`resize`,Y))}),(0,a.onBeforeUnmount)(()=>{document.removeEventListener(`mousedown`,J),window.removeEventListener(`scroll`,Y,!0),window.removeEventListener(`resize`,Y)});function X(e){let t=_.options??[];if(!C.value){(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),G());return}e.key===`Escape`?(K(),e.preventDefault()):e.key===`Tab`?K():e.key===`ArrowDown`?(e.preventDefault(),T.value=H(T.value,1),Z()):e.key===`ArrowUp`?(e.preventDefault(),T.value>0&&(T.value=H(T.value,-1)),Z()):(e.key===`Enter`||e.key===` `)&&T.value>=0&&(e.preventDefault(),U(t[T.value]))}function Z(){(0,a.nextTick)(()=>{!A.value||T.value<0||A.value.querySelector(`[data-index="${T.value}"]`)?.scrollIntoView({block:`nearest`})})}(0,a.watch)(x,()=>{if(!C.value)return;let e=H(-1,1);T.value=e===-1?-1:e,Z()});function ve(e){if(e.key===` `){e.stopPropagation();return}if(e.key===`Home`||e.key===`End`){e.stopPropagation();return}X(e)}let ye=(0,a.computed)(()=>({isOpen:C.value,toggle:q,open:G,close:K,attrs:{"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-controls":C.value?P.value:void 0,onClick:q}})),Q=(0,a.computed)(()=>_.clearable&&!_.disabled&&I.value.length>0);function $(){let e=_.multiple?[]:null;K(),v(`update:modelValue`,e),v(`change`,e),k()}let be=(0,a.computed)(()=>[`nb-select`,`nb-select--${_.variant}`,`nb-select--${_.size}`,{"nb-select--open":C.value,"nb-select--focused":w.value&&!C.value,"nb-select--error":!!_.error,"nb-select--warning":!_.error&&!!_.warning,"nb-select--multiple":_.multiple,"nb-select--bare":!!O.trigger}]);return g({open:G,close:K}),(i,g)=>((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,null,[(0,a.createElementVNode)(`div`,{ref_key:`rootRef`,ref:E,class:(0,a.normalizeClass)(be.value),onKeydown:X},[i.$slots.trigger?(0,a.renderSlot)(i.$slots,`trigger`,(0,a.normalizeProps)((0,a.mergeProps)({key:0},ye.value))):h.variant===`default`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[i.$slots.label?(0,a.renderSlot)(i.$slots,`label`,{key:0}):h.label?((0,a.openBlock)(),(0,a.createBlock)(n.t,{key:1,for:N.value,required:h.required,disabled:h.disabled},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.label),1)]),_:1},8,[`for`,`required`,`disabled`])):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(y,{wrap:h.clearable},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`button`,{id:N.value,ref_key:`triggerRef`,ref:D,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-disabled":h.disabled||void 0,"aria-required":h.required||void 0,disabled:h.disabled||void 0,onClick:q,onFocus:g[0]||=e=>w.value=!0,onBlur:g[1]||=e=>w.value=!1},[(0,a.createElementVNode)(`span`,{class:(0,a.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!R.value,"nb-select__value--with-icon":!!L.value}])},[L.value?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:0,class:`nb-select__value-icon`,name:L.value,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),R.value?(0,a.renderSlot)(i.$slots,`value`,{key:1,values:I.value},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(R.value),1)]):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createTextVNode)((0,a.toDisplayString)(h.placeholder),1)],64))],2),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:0,variant:`error`,"icon-only":!0,class:`nb-select__status-icon`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:1,variant:`warning`,"icon-only":!0,class:`nb-select__status-icon`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):(0,a.createCommentVNode)(``,!0),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,te)):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:C.value?(0,a.unref)(s.regular):(0,a.unref)(o.regular),size:16},null,8,[`name`])]),_:1})],40,ee),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-select__clear`,"aria-label":h.clearLabel,onClick:$,onKeydown:[g[2]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`enter`]),g[3]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`space`])]},[(0,a.createVNode)(e.t,{name:(0,a.unref)(c.regular),size:16},null,8,[`name`])],40,ne)):(0,a.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:2,variant:`error`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:3,variant:`warning`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):h.helper?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:4,variant:`helper`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.helper),1)]),_:1})):(0,a.createCommentVNode)(``,!0)],64)):h.variant===`fluid`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createVNode)(y,{wrap:h.clearable},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`button`,{id:N.value,ref_key:`triggerRef`,ref:D,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-disabled":h.disabled||void 0,"aria-required":h.required||void 0,disabled:h.disabled||void 0,onClick:q,onFocus:g[4]||=e=>w.value=!0,onBlur:g[5]||=e=>w.value=!1},[h.label||i.$slots.label?((0,a.openBlock)(),(0,a.createBlock)(t.t,{key:0,dir:`row`,align:`center`,gap:`xs`,class:`nb-select__inner-header`},{default:(0,a.withCtx)(()=>[i.$slots.label?(0,a.renderSlot)(i.$slots,`label`,{key:0}):((0,a.openBlock)(),(0,a.createElementBlock)(`label`,u,[(0,a.createTextVNode)((0,a.toDisplayString)(h.label)+` `,1),h.required?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,d,`*`)):(0,a.createCommentVNode)(``,!0)])),h.helper&&!h.error&&!h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:2,variant:`helper`,"icon-only":!0,class:`nb-select__inner-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.helper),1)]),_:1})):(0,a.createCommentVNode)(``,!0)]),_:3})):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{dir:`row`,align:`end`,flex:``,class:`nb-select__value-row`},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`span`,{class:(0,a.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!R.value,"nb-select__value--with-icon":!!L.value}])},[L.value?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:0,class:`nb-select__value-icon`,name:L.value,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),R.value?(0,a.renderSlot)(i.$slots,`value`,{key:1,values:I.value},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(R.value),1)]):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createTextVNode)((0,a.toDisplayString)(h.placeholder),1)],64))],2),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,re)):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:C.value?(0,a.unref)(s.regular):(0,a.unref)(o.regular),size:16},null,8,[`name`])]),_:1})]),_:3})],40,l),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-select__clear`,"aria-label":h.clearLabel,onClick:$,onKeydown:[g[6]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`enter`]),g[7]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`space`])]},[(0,a.createVNode)(e.t,{name:(0,a.unref)(c.regular),size:16},null,8,[`name`])],40,ie)):(0,a.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:0,variant:`error`,class:`nb-select__fluid-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:1,variant:`warning`,class:`nb-select__fluid-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):(0,a.createCommentVNode)(``,!0)],64)):(0,a.createCommentVNode)(``,!0)],34),((0,a.openBlock)(),(0,a.createBlock)(a.Teleport,{to:`body`},[C.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,id:P.value,ref_key:`dropdownRef`,ref:A,class:(0,a.normalizeClass)([`nb-select__dropdown`,{"nb-select__dropdown--check":h.selectedMark===`check`,"nb-select__dropdown--anchored":!!i.$slots.trigger}]),style:(0,a.normalizeStyle)(j.value),role:`listbox`,"aria-multiselectable":h.multiple||void 0},[h.searchable?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,oe,[(0,a.withDirectives)((0,a.createElementVNode)(`input`,{ref_key:`searchRef`,ref:S,"onUpdate:modelValue":g[8]||=e=>x.value=e,type:`search`,class:`nb-select__search-input`,autocomplete:`off`,spellcheck:`false`,placeholder:h.searchPlaceholder,"aria-label":h.searchPlaceholder,"aria-controls":P.value,"aria-activedescendant":T.value>=0?F(T.value):void 0,onKeydown:ve},null,40,se),[[a.vModelText,x.value]])])):(0,a.createCommentVNode)(``,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(_e.value,t=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:t.key,class:`nb-select__group`,role:`group`,"aria-labelledby":t.name?t.labelId:void 0},[t.name?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,id:t.labelId,class:`nb-select__group-label`},(0,a.toDisplayString)(t.name),9,ce)):(0,a.createCommentVNode)(``,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(t.entries,t=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{id:F(t.index),key:t.option.value,"data-index":t.index,class:(0,a.normalizeClass)([`nb-select__option`,{"nb-select__option--selected":z(t.option.value),"nb-select__option--highlighted":T.value===t.index,"nb-select__option--disabled":t.option.disabled}]),role:`option`,"aria-selected":z(t.option.value),"aria-disabled":t.option.disabled||void 0,onMouseenter:e=>T.value=t.index,onClick:e=>U(t.option)},[h.multiple||h.selectedMark===`check`?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,ue,[z(t.option.value)?((0,a.openBlock)(),(0,a.createElementBlock)(`svg`,de,[...g[12]||=[(0,a.createElementVNode)(`path`,{d:`M1 4l3 3 5-6`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])):(0,a.createCommentVNode)(``,!0)])):(0,a.createCommentVNode)(``,!0),t.option.icon?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:1,class:`nb-select__option-icon`,name:t.option.icon,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`span`,p,[(0,a.renderSlot)(i.$slots,`option`,{option:t.option},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(t.option.label),1)])])],42,le))),128))],8,f))),128)),!h.options||h.options.length===0?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,m,` No options `)):h.searchable&&V.value.size===0?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,fe,(0,a.toDisplayString)(h.noResultsLabel),1)):(0,a.createCommentVNode)(``,!0),h.creatable?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:3,class:`nb-select__create`,onMousedown:g[11]||=(0,a.withModifiers)(()=>{},[`prevent`])},[(0,a.withDirectives)((0,a.createElementVNode)(`input`,{"onUpdate:modelValue":g[9]||=e=>b.value=e,type:`text`,class:`nb-select__create-input`,placeholder:h.createPlaceholder||`Add new…`,onKeydown:[(0,a.withKeys)((0,a.withModifiers)(he,[`prevent`]),[`enter`]),g[10]||=(0,a.withModifiers)(()=>{},[`stop`])]},null,40,pe),[[a.vModelText,b.value]])],32)):(0,a.createCommentVNode)(``,!0)],14,ae)):(0,a.createCommentVNode)(``,!0)]))],64))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Icon-C8R_r_In.cjs`),t=require(`./Grid-CXE0B85G.cjs`),n=require(`./Label-71QAuWf4.cjs`),r=require(`./Message-BpDOzu5W.cjs`),i=require(`./composables/useMenuSurface.composable.cjs`);let a=require(`vue`),o=require(`@nubisco/ui/icons/caret-down`),s=require(`@nubisco/ui/icons/caret-up`),c=require(`@nubisco/ui/icons/x`);var ee=[`id`,`aria-expanded`,`aria-disabled`,`aria-required`,`disabled`],te={key:2,class:`nb-select__clear-space`,"aria-hidden":`true`},ne=[`aria-label`],l=[`id`,`aria-expanded`,`aria-disabled`,`aria-required`,`disabled`],u={key:1,class:`nb-select__inner-label`},d={key:0,class:`nb-select__asterisk`,"aria-hidden":`true`},re={key:0,class:`nb-select__clear-space`,"aria-hidden":`true`},ie=[`aria-label`],ae=[`id`,`aria-multiselectable`],oe={key:0,class:`nb-select__search`},se=[`placeholder`,`aria-label`,`aria-controls`,`aria-activedescendant`],f=[`aria-labelledby`],ce=[`id`],le=[`id`,`data-index`,`aria-selected`,`aria-disabled`,`onMouseenter`,`onClick`],ue={key:0,class:`nb-select__option-check`,"aria-hidden":`true`},de={key:0,viewBox:`0 0 10 8`,fill:`none`,width:`10`,height:`8`},p={class:`nb-select__option-label`},m={key:1,class:`nb-select__empty`},fe={key:2,class:`nb-select__empty`},pe=[`placeholder`,`onKeydown`],h=(0,a.defineComponent)({__name:`Select`,props:{modelValue:{default:null},options:{default:()=>[]},multiple:{type:Boolean,default:!1},creatable:{type:Boolean,default:!1},createPlaceholder:{default:``},clearable:{type:Boolean,default:!1},clearLabel:{default:`Clear selection`},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:`Search…`},noResultsLabel:{default:`No results`},anchor:{type:[Function,null],default:null},selectedMark:{default:`fill`},placeholder:{default:`Select…`},name:{default:``},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{default:void 0},label:{default:``},error:{default:``},warning:{default:``},helper:{default:``},variant:{default:`default`},size:{default:`md`}},emits:[`update:modelValue`,`change`,`create`],setup(h,{expose:g,emit:me}){let _=h,v=me,y=(e,{slots:t})=>e.wrap?(0,a.h)(`div`,{class:`nb-select__control`},t.default?.()):t.default?.();y.props=[`wrap`];let b=(0,a.ref)(``),x=(0,a.ref)(``),S=(0,a.ref)(null);function he(){let e=b.value.trim();e&&(v(`create`,e),b.value=``)}let C=(0,a.ref)(!1),w=(0,a.ref)(!1),T=(0,a.ref)(-1),E=(0,a.ref)(null),D=(0,a.ref)(null),O=(0,a.useSlots)(),ge=()=>(typeof _.anchor==`function`?_.anchor():_.anchor)??D.value??E.value;function k(){(D.value??E.value?.querySelector(`button, [tabindex]`))?.focus()}let A=(0,a.ref)(null);i.useMenuSurface(A);let j=(0,a.ref)({position:`fixed`,top:`0px`,left:`0px`,width:`0px`,zIndex:`9999`}),M=`nb-select-${(0,a.useId)()}`,N=(0,a.computed)(()=>_.id??M),P=(0,a.computed)(()=>`${N.value}-listbox`),F=e=>`${N.value}-option-${e}`,I=(0,a.computed)(()=>_.modelValue==null?[]:Array.isArray(_.modelValue)?_.modelValue:[_.modelValue]),L=(0,a.computed)(()=>{if(!(_.multiple||I.value.length!==1))return(_.options??[]).find(e=>e.value===I.value[0])?.icon}),R=(0,a.computed)(()=>{if(I.value.length===0)return``;let e=_.options??[];return _.multiple?I.value.length===1?e.find(e=>e.value===I.value[0])?.label??String(I.value[0]):I.value.length===2?I.value.map(t=>e.find(e=>e.value===t)?.label??String(t)).join(`, `):`${I.value.length} selected`:e.find(e=>e.value===I.value[0])?.label??String(I.value[0])});function z(e){return I.value.includes(e)}let B=e=>e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase(),V=(0,a.computed)(()=>{let e=_.options??[],t=_.searchable?B(x.value.trim()):``,n=new Set;return e.forEach((e,r)=>{(!t||B(e.label).includes(t))&&n.add(r)}),n}),_e=(0,a.computed)(()=>{let e=[];return(_.options??[]).forEach((t,n)=>{if(!V.value.has(n))return;let r=e[e.length-1];(!r||r.name!==t.group)&&e.push({key:`${e.length}:${t.group??``}`,name:t.group,labelId:`${N.value}-group-${e.length}`,entries:[]}),e[e.length-1].entries.push({option:t,index:n})}),e});function H(e,t){let n=_.options??[];for(let r=e+t;r>=0&&r<n.length;r+=t)if(!n[r].disabled&&V.value.has(r))return r;return e}function U(e){if(e.disabled)return;let t;if(_.multiple){let n=[...I.value],r=n.indexOf(e.value);r>=0?n.splice(r,1):n.push(e.value),t=n}else t=e.value,K();v(`update:modelValue`,t),v(`change`,t)}function W(){let e=ge();if(!e)return;let t=e.getBoundingClientRect(),n=A.value?.offsetHeight??0,r=window.innerHeight-t.bottom,i=t.top,a=n>0&&r<n&&i>r,o=O.trigger?Math.max(t.width,240):t.width,s=O.trigger?Math.max(8,Math.min(t.left,window.innerWidth-o-8)):t.left;j.value={position:`fixed`,top:a?`${t.top-n}px`:`${t.bottom}px`,left:`${s}px`,width:`${o}px`,zIndex:`9999`}}function G(){if(_.disabled)return;C.value=!0,W();let e=_.options??[];T.value=I.value.length>0?Math.max(0,e.findIndex(e=>e.value===I.value[0])):-1,(0,a.nextTick)(()=>{W(),Z(),S.value?.focus({preventScroll:!0})})}function K(){let e=!!A.value?.contains(document.activeElement);C.value=!1,T.value=-1,x.value=``,e&&k()}function q(){C.value?K():G()}function J(e){let t=e.target,n=E.value?.contains(t)??!1,r=A.value?.contains(t)??!1;!n&&!r&&K()}function Y(){C.value&&W()}(0,a.watch)(C,e=>{e?(document.addEventListener(`mousedown`,J),window.addEventListener(`scroll`,Y,!0),window.addEventListener(`resize`,Y)):(document.removeEventListener(`mousedown`,J),window.removeEventListener(`scroll`,Y,!0),window.removeEventListener(`resize`,Y))}),(0,a.onBeforeUnmount)(()=>{document.removeEventListener(`mousedown`,J),window.removeEventListener(`scroll`,Y,!0),window.removeEventListener(`resize`,Y)});function X(e){let t=_.options??[];if(!C.value){(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),G());return}e.key===`Escape`?(K(),e.preventDefault()):e.key===`Tab`?K():e.key===`ArrowDown`?(e.preventDefault(),T.value=H(T.value,1),Z()):e.key===`ArrowUp`?(e.preventDefault(),T.value>0&&(T.value=H(T.value,-1)),Z()):(e.key===`Enter`||e.key===` `)&&T.value>=0&&(e.preventDefault(),U(t[T.value]))}function Z(){(0,a.nextTick)(()=>{!A.value||T.value<0||A.value.querySelector(`[data-index="${T.value}"]`)?.scrollIntoView({block:`nearest`})})}(0,a.watch)(x,()=>{if(!C.value)return;let e=H(-1,1);T.value=e===-1?-1:e,Z()});function ve(e){if(e.key===` `){e.stopPropagation();return}if(e.key===`Home`||e.key===`End`){e.stopPropagation();return}X(e)}let ye=(0,a.computed)(()=>({isOpen:C.value,toggle:q,open:G,close:K,attrs:{"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-controls":C.value?P.value:void 0,onClick:q}})),Q=(0,a.computed)(()=>_.clearable&&!_.disabled&&I.value.length>0);function $(){let e=_.multiple?[]:null;K(),v(`update:modelValue`,e),v(`change`,e),k()}let be=(0,a.computed)(()=>[`nb-select`,`nb-select--${_.variant}`,`nb-select--${_.size}`,{"nb-select--open":C.value,"nb-select--focused":w.value&&!C.value,"nb-select--error":!!_.error,"nb-select--warning":!_.error&&!!_.warning,"nb-select--multiple":_.multiple,"nb-select--bare":!!O.trigger}]);return g({open:G,close:K}),(i,g)=>((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,null,[(0,a.createElementVNode)(`div`,{ref_key:`rootRef`,ref:E,class:(0,a.normalizeClass)(be.value),onKeydown:X},[i.$slots.trigger?(0,a.renderSlot)(i.$slots,`trigger`,(0,a.normalizeProps)((0,a.mergeProps)({key:0},ye.value))):h.variant===`default`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[i.$slots.label?(0,a.renderSlot)(i.$slots,`label`,{key:0}):h.label?((0,a.openBlock)(),(0,a.createBlock)(n.t,{key:1,for:N.value,required:h.required,disabled:h.disabled},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.label),1)]),_:1},8,[`for`,`required`,`disabled`])):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(y,{wrap:h.clearable},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`button`,{id:N.value,ref_key:`triggerRef`,ref:D,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-disabled":h.disabled||void 0,"aria-required":h.required||void 0,disabled:h.disabled||void 0,onClick:q,onFocus:g[0]||=e=>w.value=!0,onBlur:g[1]||=e=>w.value=!1},[(0,a.createElementVNode)(`span`,{class:(0,a.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!R.value,"nb-select__value--with-icon":!!L.value}])},[L.value?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:0,class:`nb-select__value-icon`,name:L.value,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),R.value?(0,a.renderSlot)(i.$slots,`value`,{key:1,values:I.value},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(R.value),1)]):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createTextVNode)((0,a.toDisplayString)(h.placeholder),1)],64))],2),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:0,variant:`error`,"icon-only":!0,class:`nb-select__status-icon`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:1,variant:`warning`,"icon-only":!0,class:`nb-select__status-icon`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):(0,a.createCommentVNode)(``,!0),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,te)):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:C.value?(0,a.unref)(s.regular):(0,a.unref)(o.regular),size:16},null,8,[`name`])]),_:1})],40,ee),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-select__clear`,"aria-label":h.clearLabel,onClick:$,onKeydown:[g[2]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`enter`]),g[3]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`space`])]},[(0,a.createVNode)(e.t,{name:(0,a.unref)(c.regular),size:16},null,8,[`name`])],40,ne)):(0,a.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:2,variant:`error`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:3,variant:`warning`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):h.helper?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:4,variant:`helper`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.helper),1)]),_:1})):(0,a.createCommentVNode)(``,!0)],64)):h.variant===`fluid`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createVNode)(y,{wrap:h.clearable},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`button`,{id:N.value,ref_key:`triggerRef`,ref:D,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-disabled":h.disabled||void 0,"aria-required":h.required||void 0,disabled:h.disabled||void 0,onClick:q,onFocus:g[4]||=e=>w.value=!0,onBlur:g[5]||=e=>w.value=!1},[h.label||i.$slots.label?((0,a.openBlock)(),(0,a.createBlock)(t.t,{key:0,dir:`row`,align:`center`,gap:`xs`,class:`nb-select__inner-header`},{default:(0,a.withCtx)(()=>[i.$slots.label?(0,a.renderSlot)(i.$slots,`label`,{key:0}):((0,a.openBlock)(),(0,a.createElementBlock)(`label`,u,[(0,a.createTextVNode)((0,a.toDisplayString)(h.label)+` `,1),h.required?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,d,`*`)):(0,a.createCommentVNode)(``,!0)])),h.helper&&!h.error&&!h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:2,variant:`helper`,"icon-only":!0,class:`nb-select__inner-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.helper),1)]),_:1})):(0,a.createCommentVNode)(``,!0)]),_:3})):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{dir:`row`,align:`end`,flex:``,class:`nb-select__value-row`},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`span`,{class:(0,a.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!R.value,"nb-select__value--with-icon":!!L.value}])},[L.value?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:0,class:`nb-select__value-icon`,name:L.value,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),R.value?(0,a.renderSlot)(i.$slots,`value`,{key:1,values:I.value},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(R.value),1)]):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createTextVNode)((0,a.toDisplayString)(h.placeholder),1)],64))],2),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,re)):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:C.value?(0,a.unref)(s.regular):(0,a.unref)(o.regular),size:16},null,8,[`name`])]),_:1})]),_:3})],40,l),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-select__clear`,"aria-label":h.clearLabel,onClick:$,onKeydown:[g[6]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`enter`]),g[7]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`space`])]},[(0,a.createVNode)(e.t,{name:(0,a.unref)(c.regular),size:16},null,8,[`name`])],40,ie)):(0,a.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:0,variant:`error`,class:`nb-select__fluid-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:1,variant:`warning`,class:`nb-select__fluid-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):(0,a.createCommentVNode)(``,!0)],64)):(0,a.createCommentVNode)(``,!0)],34),((0,a.openBlock)(),(0,a.createBlock)(a.Teleport,{to:`body`},[(0,a.createVNode)(a.Transition,{name:`nb-select-pop`},{default:(0,a.withCtx)(()=>[C.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,id:P.value,ref_key:`dropdownRef`,ref:A,class:(0,a.normalizeClass)([`nb-select__dropdown`,{"nb-select__dropdown--check":h.selectedMark===`check`,"nb-select__dropdown--anchored":!!i.$slots.trigger}]),style:(0,a.normalizeStyle)(j.value),role:`listbox`,"aria-multiselectable":h.multiple||void 0},[h.searchable?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,oe,[(0,a.withDirectives)((0,a.createElementVNode)(`input`,{ref_key:`searchRef`,ref:S,"onUpdate:modelValue":g[8]||=e=>x.value=e,type:`search`,class:`nb-select__search-input`,autocomplete:`off`,spellcheck:`false`,placeholder:h.searchPlaceholder,"aria-label":h.searchPlaceholder,"aria-controls":P.value,"aria-activedescendant":T.value>=0?F(T.value):void 0,onKeydown:ve},null,40,se),[[a.vModelText,x.value]])])):(0,a.createCommentVNode)(``,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(_e.value,t=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:t.key,class:`nb-select__group`,role:`group`,"aria-labelledby":t.name?t.labelId:void 0},[t.name?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,id:t.labelId,class:`nb-select__group-label`},(0,a.toDisplayString)(t.name),9,ce)):(0,a.createCommentVNode)(``,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(t.entries,t=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{id:F(t.index),key:t.option.value,"data-index":t.index,class:(0,a.normalizeClass)([`nb-select__option`,{"nb-select__option--selected":z(t.option.value),"nb-select__option--highlighted":T.value===t.index,"nb-select__option--disabled":t.option.disabled}]),role:`option`,"aria-selected":z(t.option.value),"aria-disabled":t.option.disabled||void 0,onMouseenter:e=>T.value=t.index,onClick:e=>U(t.option)},[h.multiple||h.selectedMark===`check`?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,ue,[z(t.option.value)?((0,a.openBlock)(),(0,a.createElementBlock)(`svg`,de,[...g[12]||=[(0,a.createElementVNode)(`path`,{d:`M1 4l3 3 5-6`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])):(0,a.createCommentVNode)(``,!0)])):(0,a.createCommentVNode)(``,!0),t.option.icon?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:1,class:`nb-select__option-icon`,name:t.option.icon,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`span`,p,[(0,a.renderSlot)(i.$slots,`option`,{option:t.option},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(t.option.label),1)])])],42,le))),128))],8,f))),128)),!h.options||h.options.length===0?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,m,` No options `)):h.searchable&&V.value.size===0?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,fe,(0,a.toDisplayString)(h.noResultsLabel),1)):(0,a.createCommentVNode)(``,!0),h.creatable?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:3,class:`nb-select__create`,onMousedown:g[11]||=(0,a.withModifiers)(()=>{},[`prevent`])},[(0,a.withDirectives)((0,a.createElementVNode)(`input`,{"onUpdate:modelValue":g[9]||=e=>b.value=e,type:`text`,class:`nb-select__create-input`,placeholder:h.createPlaceholder||`Add new…`,onKeydown:[(0,a.withKeys)((0,a.withModifiers)(he,[`prevent`]),[`enter`]),g[10]||=(0,a.withModifiers)(()=>{},[`stop`])]},null,40,pe),[[a.vModelText,b.value]])],32)):(0,a.createCommentVNode)(``,!0)],14,ae)):(0,a.createCommentVNode)(``,!0)]),_:3})]))],64))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
|