@nubisco/ui 5.53.0 → 5.55.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--XeLRz2P.js → AccordionItem-BY-p8UkV.js} +1 -1
- package/dist/{AccordionItem-BYSH6dZK.cjs → AccordionItem-p0mYXIj8.cjs} +1 -1
- package/dist/{ActionGroup-CkwZEnUN.js → ActionGroup-CjRSKyOa.js} +2 -2
- package/dist/{ActionGroup-McCtSDV8.cjs → ActionGroup-DIMZhC7N.cjs} +1 -1
- package/dist/AiLabel-BDccQ2iQ.js +242 -0
- package/dist/AiLabel-jRrBTu6c.cjs +1 -0
- package/dist/{AiProvider-DN3DecBN.cjs → AiProvider-CGB9EiSf.cjs} +1 -1
- package/dist/{AiProvider-lGUifyvk.js → AiProvider-CMbPWtU-.js} +4 -4
- package/dist/{BackToTop-BWj2PURK.js → BackToTop-BDFb1y3c.js} +1 -1
- package/dist/{BackToTop-CbGWaDiv.cjs → BackToTop-R6yiw3lt.cjs} +1 -1
- package/dist/{Banner-DksCkGVd.js → Banner-BjnbX4C3.js} +1 -1
- package/dist/{Banner-DsiuPzPh.cjs → Banner-C-mikJ5n.cjs} +1 -1
- package/dist/{BatchActions-iHu14Sfz.js → BatchActions-Kr2S6CJI.js} +2 -2
- package/dist/{BatchActions-xnTXMU6B.cjs → BatchActions-jfvfpZeT.cjs} +1 -1
- package/dist/{BlueprintControls-COcm1KWW.js → BlueprintControls-Bt4KoDp5.js} +1 -1
- package/dist/{BlueprintControls-3Lc3BcAk.cjs → BlueprintControls-zX5yxOB1.cjs} +1 -1
- package/dist/{Board-B2v-oPUr.js → Board-C3_cXRl6.js} +177 -176
- package/dist/Board-D6A-irdx.cjs +1 -0
- package/dist/{BottomPanel-cNzWs1-8.cjs → BottomPanel-C_u39INJ.cjs} +1 -1
- package/dist/{BottomPanel-C6r_9aLy.js → BottomPanel-CkEc9gvb.js} +1 -1
- package/dist/{Breadcrumbs-D1pYElI6.cjs → Breadcrumbs-0rRFiO31.cjs} +1 -1
- package/dist/{Breadcrumbs-B2SMDfCA.js → Breadcrumbs-DqagVknq.js} +2 -2
- package/dist/{Briefing-Cqw3zBQO.cjs → Briefing-B-O-9bhN.cjs} +1 -1
- package/dist/{Briefing-W7gtZwdT.js → Briefing-DNH-707q.js} +1 -1
- package/dist/{BriefingDestination-CeClIu61.js → BriefingDestination-BjNteNgh.js} +1 -1
- package/dist/{BriefingDestination-CtsWFs9U.cjs → BriefingDestination-Cs1y3z_5.cjs} +1 -1
- package/dist/Button-CGIbF1e-.cjs +1 -0
- package/dist/{Button-CxJMKPpw.js → Button-DmJ_J3UO.js} +55 -53
- package/dist/{ButtonSet-D7ieqb8C.js → ButtonSet-Cg1ixzOK.js} +1 -1
- package/dist/{ButtonSet-C2Z5sYSv.cjs → ButtonSet-SziuuT6_.cjs} +1 -1
- package/dist/{Calendar-BmC3wBlS.js → Calendar-fVDg_EgD.js} +1 -1
- package/dist/{Calendar-EO2vU4ls.cjs → Calendar-fsZN4OIr.cjs} +1 -1
- package/dist/{ChatMessage-DYv7Vniv.cjs → ChatMessage-B45Xhl8x.cjs} +1 -1
- package/dist/{ChatMessage-DSeGKAOq.js → ChatMessage-BDOdvI4h.js} +1 -1
- package/dist/{ChatThread-CCtckadF.cjs → ChatThread-B7F1r4t4.cjs} +1 -1
- package/dist/{ChatThread-D70zpB0f.js → ChatThread-DqvsnVOr.js} +3 -3
- package/dist/{CloseButton-F7W1E8oX.cjs → CloseButton-Bdk7rJ8E.cjs} +1 -1
- package/dist/{CloseButton-BMJBwHvG.js → CloseButton-CAPfd6yf.js} +1 -1
- package/dist/CommandPalette-BaRqoURY.cjs +1 -0
- package/dist/CommandPalette-DWv1UV8r.js +294 -0
- package/dist/{Confirm-Sl4LWoSK.cjs → Confirm-B5vMzPbN.cjs} +1 -1
- package/dist/{Confirm-BLXSK-OZ.js → Confirm-C4lT-6HD.js} +3 -3
- package/dist/{ContentSwitcher-CQvxg6RC.cjs → ContentSwitcher-DYxJZdcm.cjs} +1 -1
- package/dist/{ContentSwitcher-DuHRX4Y6.js → ContentSwitcher-NpFxiGbz.js} +1 -1
- package/dist/{CopyButton-DMuuBwJc.cjs → CopyButton-D-cnpfOJ.cjs} +1 -1
- package/dist/{CopyButton-CfEOWedU.js → CopyButton-MOJj3pS0.js} +1 -1
- package/dist/{DataTable-7GkgyPz9.js → DataTable-CcwD0PSJ.js} +3 -3
- package/dist/{DataTable-D8y7LUof.cjs → DataTable-xEw-NvHM.cjs} +1 -1
- package/dist/{DatePicker-BkHd2fJW.js → DatePicker-3pCNky8d.js} +235 -231
- package/dist/DatePicker-BrMicYUx.cjs +1 -0
- package/dist/{FileUploader-VBJtI2xh.js → FileUploader-CcGdRBxp.js} +1 -1
- package/dist/{FileUploader-CPTj5s_M.cjs → FileUploader-CcieVEGZ.cjs} +1 -1
- package/dist/FloatingToolbar-BV-iGNxe.js +120 -0
- package/dist/FloatingToolbar-C8xB4BzH.cjs +1 -0
- package/dist/{ImagePicker-D8qyyjVv.cjs → ImagePicker-5qPI77Jo.cjs} +1 -1
- package/dist/{ImagePicker-BkZVENEg.js → ImagePicker-BnHg403Q.js} +2 -2
- package/dist/InfoHint-CdluaJqE.cjs +1 -0
- package/dist/InfoHint-zMuSw_99.js +182 -0
- package/dist/{InlineLoading-CA0_IT29.cjs → InlineLoading-CqGrNWHf.cjs} +1 -1
- package/dist/{InlineLoading-Cknqq0vv.js → InlineLoading-_j2KKhNQ.js} +1 -1
- package/dist/{LogView-u_QhvV__.js → LogView-BLa9W5S7.js} +2 -2
- package/dist/{LogView-JjJVH_NA.cjs → LogView-BNztzJri.cjs} +1 -1
- package/dist/Menu-CWxBEMC4.js +193 -0
- package/dist/Menu-D0TerdRm.cjs +1 -0
- package/dist/{MenuBarItem-yr5aizl3.js → MenuBarItem-BYh4YWR4.js} +1 -1
- package/dist/{MenuBarItem-DlnIAhRw.cjs → MenuBarItem-DTOqacvg.cjs} +1 -1
- package/dist/Modal-CmGFLEo4.cjs +1 -0
- package/dist/{Modal-DaXgWyZN.js → Modal-DwL90AoV.js} +74 -70
- package/dist/NotificationCenter-EMlV-oPh.cjs +1 -0
- package/dist/NotificationCenter-YZnPMH7c.js +591 -0
- package/dist/{NumberInput-B7_EP2yg.js → NumberInput-B91ahziS.js} +1 -1
- package/dist/{NumberInput-CHWFFpDv.cjs → NumberInput-DLPSNgsr.cjs} +1 -1
- package/dist/{OverflowMenu-DXJ8waZo.js → OverflowMenu-DliuDrTK.js} +2 -2
- package/dist/{OverflowMenu-CWgdicDN.cjs → OverflowMenu-DuRgj1DU.cjs} +1 -1
- package/dist/{PageHeader-KKxiyfqh.cjs → PageHeader-BoEdR_T5.cjs} +1 -1
- package/dist/{PageHeader-Bypc30sW.js → PageHeader-c6117xYf.js} +1 -1
- package/dist/{Pagination-DTsfPCOs.cjs → Pagination-B3lmxggo.cjs} +1 -1
- package/dist/{Pagination-CjOtISav.js → Pagination-DwAc-4d9.js} +2 -2
- package/dist/{Search-xsC4Tm0d.js → Search-Bwdxxe29.js} +2 -2
- package/dist/{Search-CKXtAyrU.cjs → Search-DIZ1Ea45.cjs} +1 -1
- package/dist/Select-CDs-7QtW.js +619 -0
- package/dist/Select-CJqwMI69.cjs +1 -0
- package/dist/{Shell-BWLjIdD0.cjs → Shell-BZslT2aj.cjs} +1 -1
- package/dist/{Shell-DZfaTUo3.js → Shell-CRmhoU2H.js} +2 -2
- package/dist/{ShellPanel-K4vyQYQM.js → ShellPanel-C4vQJmRI.js} +1 -1
- package/dist/{ShellPanel-ColJQNUK.cjs → ShellPanel-DUBq5BL6.cjs} +1 -1
- package/dist/{SidebarCollapseToggle-DraqbhwM.js → SidebarCollapseToggle-C38R19gG.js} +1 -1
- package/dist/{SidebarCollapseToggle-CABmF-PC.cjs → SidebarCollapseToggle-DOck3Txy.cjs} +1 -1
- package/dist/SidebarMenuItem-DzJ_R2__.cjs +1 -0
- package/dist/SidebarMenuItem-E410HTei.js +302 -0
- package/dist/{Slider-BLkYlDHi.js → Slider-B6QXQMqb.js} +1 -1
- package/dist/{Slider-DGTE-3wW.cjs → Slider-B7m_luyq.cjs} +1 -1
- package/dist/Spinner-BlzVODzE.js +161 -0
- package/dist/Spinner-Bpfgl-mN.cjs +1 -0
- package/dist/{Stat-BCvXYr-z.cjs → Stat-BByeMKkT.cjs} +1 -1
- package/dist/{Stat-No3RhGB3.js → Stat-DWliDbWE.js} +1 -1
- package/dist/Submenu-BkHGYo7X.js +168 -0
- package/dist/Submenu-CCQnBpln.cjs +1 -0
- package/dist/{SuggestionList-Cxy4jjjd.cjs → SuggestionList-C61Dj6en.cjs} +1 -1
- package/dist/{SuggestionList-Dv4yQAi-.js → SuggestionList-D48Ojcf3.js} +1 -1
- package/dist/{TableOfContents-WDCjtpK6.js → TableOfContents-CeZX4dH0.js} +1 -1
- package/dist/{TableOfContents-BzG-BsKk.cjs → TableOfContents-D9FCu6gN.cjs} +1 -1
- package/dist/{TextInput-HEjIGR6p.js → TextInput-BeqDf1R7.js} +1 -1
- package/dist/{TextInput-CKSRFb0q.cjs → TextInput-SJ34hD2Y.cjs} +1 -1
- package/dist/{Toast-DHjc9WQU.cjs → Toast-CN5Jzkr5.cjs} +1 -1
- package/dist/{Toast-DxZ2xjeq.js → Toast-DIf2XRCa.js} +2 -2
- package/dist/Toaster-Dwjm0bsR.js +285 -0
- package/dist/Toaster-aJJvxlEr.cjs +1 -0
- package/dist/{UserMenu-C54sf0xb.js → UserMenu-BTihjCKC.js} +95 -91
- package/dist/UserMenu-CHkbByFS.cjs +1 -0
- package/dist/{Video-BFik9HZq.js → Video-Agby8uRA.js} +1 -1
- package/dist/{Video-Cnqsjo4n.cjs → Video-B93sRbBU.cjs} +1 -1
- package/dist/{Walkthrough-JqWDEe00.js → Walkthrough-BqGB1yaX.js} +64 -60
- package/dist/Walkthrough-sGAypY5d.cjs +1 -0
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +212 -211
- package/dist/components/AccordionItem.cjs +1 -1
- package/dist/components/AccordionItem.mjs +1 -1
- package/dist/components/ActionGroup.cjs +1 -1
- package/dist/components/ActionGroup.mjs +1 -1
- package/dist/components/AiLabel.cjs +1 -1
- package/dist/components/AiLabel.mjs +1 -1
- package/dist/components/AiLabel.vue.d.ts.map +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/BatchActions.cjs +1 -1
- package/dist/components/BatchActions.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/Board.vue.d.ts.map +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.context.d.ts +21 -0
- package/dist/components/Button.context.d.ts.map +1 -0
- package/dist/components/Button.d.ts +10 -0
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Button.vue.d.ts +1 -0
- package/dist/components/Button.vue.d.ts.map +1 -1
- package/dist/components/ButtonSet.cjs +1 -1
- package/dist/components/ButtonSet.mjs +1 -1
- package/dist/components/Calendar.cjs +1 -1
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/ChatMessage.cjs +1 -1
- package/dist/components/ChatMessage.mjs +1 -1
- package/dist/components/ChatThread.cjs +1 -1
- package/dist/components/ChatThread.mjs +1 -1
- package/dist/components/CloseButton.cjs +1 -1
- package/dist/components/CloseButton.mjs +1 -1
- package/dist/components/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette.mjs +1 -1
- package/dist/components/CommandPalette.vue.d.ts.map +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/ContentSwitcher.cjs +1 -1
- package/dist/components/ContentSwitcher.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/DatePicker.vue.d.ts.map +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/FloatingToolbar.vue.d.ts.map +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/InlineLoading.cjs +1 -1
- package/dist/components/InlineLoading.mjs +1 -1
- package/dist/components/LogView.cjs +1 -1
- package/dist/components/LogView.mjs +1 -1
- package/dist/components/Menu.cjs +1 -1
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/Menu.vue.d.ts.map +1 -1
- package/dist/components/MenuBarItem.cjs +1 -1
- package/dist/components/MenuBarItem.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/OverflowMenu.cjs +1 -1
- package/dist/components/OverflowMenu.mjs +1 -1
- package/dist/components/PageHeader.cjs +1 -1
- package/dist/components/PageHeader.mjs +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Search.cjs +1 -1
- package/dist/components/Search.mjs +1 -1
- package/dist/components/Select.cjs +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Select.vue.d.ts.map +1 -1
- package/dist/components/Shell.cjs +1 -1
- package/dist/components/Shell.mjs +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/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/Spinner.cjs +1 -1
- package/dist/components/Spinner.mjs +1 -1
- package/dist/components/Spinner.vue.d.ts.map +1 -1
- package/dist/components/Stat.cjs +1 -1
- package/dist/components/Stat.mjs +1 -1
- package/dist/components/Submenu.cjs +1 -1
- package/dist/components/Submenu.mjs +1 -1
- package/dist/components/Submenu.vue.d.ts.map +1 -1
- package/dist/components/SuggestionList.cjs +1 -1
- package/dist/components/SuggestionList.mjs +1 -1
- package/dist/components/TableOfContents.cjs +1 -1
- package/dist/components/TableOfContents.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/Toaster.vue.d.ts.map +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/components/Walkthrough.vue.d.ts.map +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +2 -2
- package/dist/composables/useTeleportReady.composable.cjs +1 -0
- package/dist/composables/useTeleportReady.composable.d.ts +30 -0
- package/dist/composables/useTeleportReady.composable.d.ts.map +1 -0
- package/dist/composables/useTeleportReady.composable.mjs +11 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +156 -155
- package/dist/main-BMIeIxGV.cjs +4 -0
- package/dist/{main-hHSQ2Z9E.js → main-BXz7vG2i.js} +203 -193
- package/dist/main.d.ts +19 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/AiLabel.css +1 -1
- package/dist/styles/Button.css +1 -1
- package/dist/styles/FloatingToolbar.css +1 -1
- package/dist/styles/InfoHint.css +1 -1
- package/dist/styles/Modal.css +1 -1
- package/dist/styles/SidebarMenuItem.css +1 -1
- package/dist/styles/Spinner.css +1 -1
- package/dist/styles/Toaster.css +1 -1
- package/dist/styles/Walkthrough.css +1 -1
- package/dist/ui.css +9 -9
- package/package.json +1 -1
- package/dist/AiLabel-BwGuSf92.cjs +0 -1
- package/dist/AiLabel-CT7tpXv4.js +0 -240
- package/dist/Board-C43JjSsH.cjs +0 -1
- package/dist/Button-5ClGtoaz.cjs +0 -1
- package/dist/CommandPalette-DSE40a5L.cjs +0 -1
- package/dist/CommandPalette-DjkNy4l7.js +0 -290
- package/dist/DatePicker-CeDO01NZ.cjs +0 -1
- package/dist/FloatingToolbar-BikX_AsP.js +0 -116
- package/dist/FloatingToolbar-DWVY8Fxo.cjs +0 -1
- package/dist/InfoHint-BEzkNQTM.cjs +0 -1
- package/dist/InfoHint-BlHxrTw6.js +0 -178
- package/dist/Menu-7EgnchVu.js +0 -189
- package/dist/Menu-Bs2Co1sl.cjs +0 -1
- package/dist/Modal-CRbvPpfy.cjs +0 -1
- package/dist/NotificationCenter-D0PKt3fk.js +0 -587
- package/dist/NotificationCenter-fmSEnZDX.cjs +0 -1
- package/dist/Select-CPztC5IV.cjs +0 -1
- package/dist/Select-CqLa55kO.js +0 -615
- package/dist/SidebarMenuItem-DQRQtqrp.js +0 -300
- package/dist/SidebarMenuItem-Dwk7vKN5.cjs +0 -1
- package/dist/Spinner-DYFhiTB1.js +0 -160
- package/dist/Spinner-j13gRoUF.cjs +0 -1
- package/dist/Submenu-BDs-yAqv.js +0 -164
- package/dist/Submenu-BLjx2kWl.cjs +0 -1
- package/dist/Toaster-C227oHXu.js +0 -284
- package/dist/Toaster-IS3DUaZt.cjs +0 -1
- package/dist/UserMenu-BnGiKwDE.cjs +0 -1
- package/dist/Walkthrough-DHgb972k.cjs +0 -1
- package/dist/main-Dr-OZ97R.cjs +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-CGIbF1e-.cjs`),n=require(`./composables/useNbStrings.composable.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/x`);i=e.n(i);var a=(0,r.defineComponent)({__name:`CloseButton`,props:{label:{default:void 0},size:{default:`sm`},disabled:{type:Boolean,default:!1},tooltipPosition:{default:`bottom`}},emits:[`click`],setup(e,{expose:a,emit:o}){let s=e,c=o,l=n.useNbStrings(),u=(0,r.computed)(()=>s.label??l.value.close),d=(0,r.ref)(null);function f(){let e=d.value?.$el;return e instanceof HTMLElement?e:null}return a({focus:()=>f()?.focus(),el:f}),(n,a)=>((0,r.openBlock)(),(0,r.createBlock)(t.t,{ref_key:`buttonRef`,ref:d,class:`nb-close-button`,variant:`ghost`,size:e.size,icon:i,label:u.value,"tooltip-position":e.tooltipPosition,disabled:e.disabled,onClick:a[0]||=e=>c(`click`,e)},null,8,[`size`,`label`,`tooltip-position`,`disabled`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { useNbStrings as t } from "./composables/useNbStrings.composable.mjs";
|
|
3
3
|
import { computed as n, createBlock as r, defineComponent as i, openBlock as a, ref as o } from "vue";
|
|
4
4
|
import * as s from "@nubisco/ui/icons/x";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.cjs`),t=require(`./composables/useCommandPalette.composable.cjs`),n=require(`./composables/useTeleportReady.composable.cjs`),r=require(`./Icon-CssV4E2-.cjs`),i=require(`./composables/usePhoneLayout.composable.cjs`),a=require(`./composables/useNbStrings.composable.cjs`),o=require(`./composables/useFocusTrap.composable.cjs`),s=require(`./composables/useScrollLock.composable.cjs`);let c=require(`vue`),l=require(`@nubisco/ui/icons/x`),u=require(`@nubisco/ui/icons/magnifying-glass`);var d=[`aria-label`],f={class:`nb-command-palette__input-row`},p=[`aria-label`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`placeholder`],m=[`aria-label`],ee=[`role`,`aria-labelledby`],h=[`id`],g=[`id`,`aria-selected`,`onClick`,`onMouseenter`],_=[`title`],v={key:1,class:`nb-command-palette__item-shortcut`},y={key:1,class:`nb-command-palette__empty`,role:`status`},b={key:2,class:`nb-command-palette__empty`,role:`status`},x={key:3,class:`nb-command-palette__empty`},S=(0,c.defineComponent)({__name:`CommandPalette`,props:{openShortcut:{default:`Meta+k`},placeholder:{default:void 0},maxResults:{default:50},suggest:{type:Function,default:void 0},suggestDebounce:{default:150},label:{default:void 0}},setup(S){let C=n.useTeleportReady(),{lock:w,unlock:T}=s.useScrollLock(),E=S,D=a.useNbStrings(),O=(0,c.computed)(()=>E.label??D.value.commandPaletteLabel),{phone:k}=i.usePhoneLayout(),A=(0,c.inject)(t.NB_COMMAND_PALETTE_KEY),j=(0,c.ref)(null),M=(0,c.ref)(null),N=`nb-command-palette-${(0,c.useId)()}`,P=new Map;function F(e){let t=P.get(e);return t||(t=`${N}-option-${P.size}`,P.set(e,t)),t}o.useFocusTrap({container:()=>M.value,active:()=>A.isOpen,initialFocus:()=>j.value});let I=(0,c.ref)(``),L=(0,c.ref)(null),R=(0,c.ref)([]),z=(0,c.ref)(!1),B=null,V=0;function H(){B!==null&&(clearTimeout(B),B=null)}function U(){H(),V++,R.value=[],z.value=!1}async function W(e){let t=E.suggest;if(!t)return;let n=++V;z.value=!0;try{let r=await t(e);if(n!==V)return;R.value=r}catch{n===V&&(R.value=[])}finally{n===V&&(z.value=!1)}}(0,c.watch)(I,e=>{if(!E.suggest)return;H();let t=e.trim();if(!t){U();return}z.value=!0,B=setTimeout(()=>void W(t),E.suggestDebounce)});function G(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(n.startsWith(r))return 1e3+r.length/n.length*100;if(n.split(/[\s\-_./]+/).some(e=>e.startsWith(r)))return 500;let i=n.indexOf(r);if(i>=0)return 300-i;let a=0,o=0;for(let e=0;e<n.length&&a<r.length;e++)n[e]===r[a]&&(o+=10,e>0&&n[e-1]===(a>0?r[a-1]:``)&&(o+=5),a++);return a===r.length?o:-1}function K(e,t){let n=G(e.label,t);if(e.namespace&&(n=Math.max(n,G(e.namespace,t)*.8)),e.keywords)for(let r of e.keywords)n=Math.max(n,G(r,t)*.7);return n}let q=(0,c.computed)(()=>{let e=Array.from(A.commands.values()).filter(e=>!e.context||e.context===A.activeContext);return I.value?e.map(e=>({cmd:e,score:K(e,I.value)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,E.maxResults).map(e=>e.cmd):e.slice(0,E.maxResults)}),J=(0,c.computed)(()=>{let e=new Map;for(let t of q.value){let n=t.namespace??``;e.has(n)||e.set(n,[]),e.get(n).push(t)}let t=Array.from(e.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({namespace:e,commands:t.sort((e,t)=>e.label.localeCompare(t.label))}));if(R.value.length===0)return t;let n=new Map;for(let e of R.value.slice(0,E.maxResults)){let t=e.namespace??``;n.has(t)||n.set(t,[]),n.get(t).push(e)}return[...Array.from(n.entries()).map(([e,t])=>({namespace:e,commands:t})),...t]}),Y=(0,c.computed)(()=>J.value.flatMap(e=>e.commands));function X(e){A.close(),I.value=``,U(),e.handler()}function Z(e){if(e.key===`Escape`){e.preventDefault(),A.close(),I.value=``,U();return}let t=Y.value;if(!t.length)return;let n=t.findIndex(e=>e.id===L.value);if(e.key===`ArrowDown`)e.preventDefault(),L.value=t[n<t.length-1?n+1:0].id,Q();else if(e.key===`ArrowUp`)e.preventDefault(),L.value=t[n>0?n-1:t.length-1].id,Q();else if(e.key===`Enter`&&L.value){e.preventDefault();let n=t.find(e=>e.id===L.value);n&&X(n)}}function Q(){(0,c.nextTick)(()=>{document.querySelector(`.nb-command-palette__item--highlighted`)?.scrollIntoView({block:`nearest`})})}(0,c.watch)(()=>A.isOpen,e=>{e?(I.value=A.searchFilter??``,L.value=null,(0,c.nextTick)(()=>{(0,c.nextTick)(()=>{Y.value.length>0&&(L.value=Y.value[0].id)})}),w()):(I.value=``,U(),T())}),(0,c.watch)(Y,e=>{e.length>0&&!e.find(e=>e.id===L.value)?L.value=e[0].id:e.length===0&&(L.value=null)});let te={cmd:`⌘`,meta:`⌘`,shift:`⇧`,alt:`⌥`,option:`⌥`,ctrl:`⌃`,control:`⌃`};function ne(e){return e.split(`+`).map(e=>te[e.trim().toLowerCase()]||e.trim())}function re(e){let t=e.toLowerCase().split(`+`);return{key:t[t.length-1],meta:t.includes(`meta`)||t.includes(`cmd`),ctrl:t.includes(`ctrl`)||t.includes(`control`),shift:t.includes(`shift`),alt:t.includes(`alt`)}}function $(e){if(e.key===`Escape`&&A.isOpen){e.preventDefault(),A.close(),I.value=``;return}let t=re(E.openShortcut),n=e.key.toLowerCase()===t.key,r=t.meta?e.metaKey:!e.metaKey,i=t.ctrl?e.ctrlKey:!e.ctrlKey,a=t.shift?e.shiftKey:!e.shiftKey,o=t.alt?e.altKey:!e.altKey;n&&r&&i&&a&&o&&(e.preventDefault(),A.isOpen?A.close():A.open())}return(0,c.onMounted)(()=>{document.addEventListener(`keydown`,$)}),(0,c.onBeforeUnmount)(()=>{document.removeEventListener(`keydown`,$),H(),T()}),(t,n)=>((0,c.openBlock)(),(0,c.createBlock)(c.Teleport,{to:`body`,disabled:!(0,c.unref)(C)},[(0,c.createVNode)(c.Transition,{name:`nb-command-palette`},{default:(0,c.withCtx)(()=>[(0,c.unref)(A).isOpen?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:0,class:`nb-command-palette__overlay`,onClick:n[2]||=(0,c.withModifiers)(e=>(0,c.unref)(A).close(),[`self`])},[(0,c.createElementVNode)(`div`,{ref_key:`paletteRef`,ref:M,class:`nb-command-palette`,role:`dialog`,"aria-modal":`true`,"aria-label":O.value,tabindex:`-1`,onKeydown:Z},[(0,c.createElementVNode)(`div`,f,[(0,c.createVNode)(r.t,{name:(0,c.unref)(u.regular),size:20,class:`nb-command-palette__search-icon`},null,8,[`name`]),(0,c.withDirectives)((0,c.createElementVNode)(`input`,{ref_key:`inputRef`,ref:j,"onUpdate:modelValue":n[0]||=e=>I.value=e,type:`text`,class:`nb-command-palette__input`,role:`combobox`,"aria-autocomplete":`list`,"aria-label":O.value,"aria-expanded":Y.value.length>0,"aria-controls":Y.value.length>0?N:void 0,"aria-activedescendant":L.value===null?void 0:F(L.value),placeholder:S.placeholder??(0,c.unref)(D).commandPalettePlaceholder,autocomplete:`off`,spellcheck:`false`},null,8,p),[[c.vModelText,I.value]]),(0,c.unref)(k)?((0,c.openBlock)(),(0,c.createBlock)(e.t,{key:0,class:`nb-command-palette__close`,variant:`ghost`,icon:(0,c.unref)(l.regular),label:(0,c.unref)(D).commandPaletteClose,onClick:n[1]||=e=>(0,c.unref)(A).close()},null,8,[`icon`,`label`])):(0,c.createCommentVNode)(``,!0)]),J.value.length>0?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:0,id:N,class:`nb-command-palette__results`,role:`listbox`,"aria-label":O.value},[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(J.value,(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:e.namespace,role:e.namespace?`group`:`presentation`,"aria-labelledby":e.namespace?`${N}-group-${t}`:void 0},[e.namespace?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:0,id:`${N}-group-${t}`,class:`nb-command-palette__group-header`,role:`presentation`},(0,c.toDisplayString)(e.namespace),9,h)):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(e.commands,e=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{id:F(e.id),key:e.id,role:`option`,"aria-selected":e.id===L.value,class:(0,c.normalizeClass)([`nb-command-palette__item`,{"nb-command-palette__item--highlighted":e.id===L.value}]),onClick:t=>X(e),onMouseenter:t=>L.value=e.id},[e.icon?((0,c.openBlock)(),(0,c.createBlock)(r.t,{key:0,name:e.icon,size:16,class:`nb-command-palette__item-icon`},null,8,[`name`])):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`span`,{class:`nb-command-palette__item-label`,title:e.label},(0,c.toDisplayString)(e.label),9,_),e.shortcut?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,v,[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(ne(e.shortcut),(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`kbd`,{key:t,class:`nb-command-palette__key`},(0,c.toDisplayString)(e),1))),128))])):(0,c.createCommentVNode)(``,!0)],42,g))),128))],8,ee))),128))],8,m)):z.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,y,(0,c.toDisplayString)((0,c.unref)(D).commandPaletteSearching),1)):I.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,b,(0,c.toDisplayString)((0,c.unref)(D).commandPaletteNoMatches),1)):((0,c.openBlock)(),(0,c.createElementBlock)(`div`,x,(0,c.toDisplayString)((0,c.unref)(D).commandPaletteHint),1))],40,d)])):(0,c.createCommentVNode)(``,!0)]),_:1})],8,[`disabled`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return S}});
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
|
+
import { NB_COMMAND_PALETTE_KEY as t } from "./composables/useCommandPalette.composable.mjs";
|
|
3
|
+
import { useTeleportReady as n } from "./composables/useTeleportReady.composable.mjs";
|
|
4
|
+
import { t as r } from "./Icon-B2tiGiqZ.js";
|
|
5
|
+
import { usePhoneLayout as i } from "./composables/usePhoneLayout.composable.mjs";
|
|
6
|
+
import { useNbStrings as a } from "./composables/useNbStrings.composable.mjs";
|
|
7
|
+
import { useFocusTrap as o } from "./composables/useFocusTrap.composable.mjs";
|
|
8
|
+
import { useScrollLock as ee } from "./composables/useScrollLock.composable.mjs";
|
|
9
|
+
import { Fragment as s, Teleport as te, Transition as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, inject as ne, nextTick as g, normalizeClass as re, onBeforeUnmount as ie, onMounted as ae, openBlock as _, ref as v, renderList as y, toDisplayString as b, unref as x, useId as S, vModelText as oe, watch as C, withCtx as w, withDirectives as se, withModifiers as T } from "vue";
|
|
10
|
+
import { regular as ce } from "@nubisco/ui/icons/x";
|
|
11
|
+
import { regular as le } from "@nubisco/ui/icons/magnifying-glass";
|
|
12
|
+
//#region src/components/CommandPalette.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
+
var ue = ["aria-label"], de = { class: "nb-command-palette__input-row" }, fe = [
|
|
14
|
+
"aria-label",
|
|
15
|
+
"aria-expanded",
|
|
16
|
+
"aria-controls",
|
|
17
|
+
"aria-activedescendant",
|
|
18
|
+
"placeholder"
|
|
19
|
+
], pe = ["aria-label"], me = ["role", "aria-labelledby"], he = ["id"], E = [
|
|
20
|
+
"id",
|
|
21
|
+
"aria-selected",
|
|
22
|
+
"onClick",
|
|
23
|
+
"onMouseenter"
|
|
24
|
+
], ge = ["title"], _e = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "nb-command-palette__item-shortcut"
|
|
27
|
+
}, ve = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "nb-command-palette__empty",
|
|
30
|
+
role: "status"
|
|
31
|
+
}, ye = {
|
|
32
|
+
key: 2,
|
|
33
|
+
class: "nb-command-palette__empty",
|
|
34
|
+
role: "status"
|
|
35
|
+
}, be = {
|
|
36
|
+
key: 3,
|
|
37
|
+
class: "nb-command-palette__empty"
|
|
38
|
+
}, D = /* @__PURE__ */ h({
|
|
39
|
+
__name: "CommandPalette",
|
|
40
|
+
props: {
|
|
41
|
+
openShortcut: { default: "Meta+k" },
|
|
42
|
+
placeholder: { default: void 0 },
|
|
43
|
+
maxResults: { default: 50 },
|
|
44
|
+
suggest: {
|
|
45
|
+
type: Function,
|
|
46
|
+
default: void 0
|
|
47
|
+
},
|
|
48
|
+
suggestDebounce: { default: 150 },
|
|
49
|
+
label: { default: void 0 }
|
|
50
|
+
},
|
|
51
|
+
setup(h) {
|
|
52
|
+
let D = n(), { lock: O, unlock: k } = ee(), A = h, j = a(), M = l(() => A.label ?? j.value.commandPaletteLabel), { phone: N } = i(), P = ne(t), F = v(null), I = v(null), L = `nb-command-palette-${S()}`, R = /* @__PURE__ */ new Map();
|
|
53
|
+
function z(e) {
|
|
54
|
+
let t = R.get(e);
|
|
55
|
+
return t || (t = `${L}-option-${R.size}`, R.set(e, t)), t;
|
|
56
|
+
}
|
|
57
|
+
o({
|
|
58
|
+
container: () => I.value,
|
|
59
|
+
active: () => P.isOpen,
|
|
60
|
+
initialFocus: () => F.value
|
|
61
|
+
});
|
|
62
|
+
let B = v(""), V = v(null), H = v([]), U = v(!1), W = null, G = 0;
|
|
63
|
+
function K() {
|
|
64
|
+
W !== null && (clearTimeout(W), W = null);
|
|
65
|
+
}
|
|
66
|
+
function q() {
|
|
67
|
+
K(), G++, H.value = [], U.value = !1;
|
|
68
|
+
}
|
|
69
|
+
async function xe(e) {
|
|
70
|
+
let t = A.suggest;
|
|
71
|
+
if (!t) return;
|
|
72
|
+
let n = ++G;
|
|
73
|
+
U.value = !0;
|
|
74
|
+
try {
|
|
75
|
+
let r = await t(e);
|
|
76
|
+
if (n !== G) return;
|
|
77
|
+
H.value = r;
|
|
78
|
+
} catch {
|
|
79
|
+
n === G && (H.value = []);
|
|
80
|
+
} finally {
|
|
81
|
+
n === G && (U.value = !1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
C(B, (e) => {
|
|
85
|
+
if (!A.suggest) return;
|
|
86
|
+
K();
|
|
87
|
+
let t = e.trim();
|
|
88
|
+
if (!t) {
|
|
89
|
+
q();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
U.value = !0, W = setTimeout(() => void xe(t), A.suggestDebounce);
|
|
93
|
+
});
|
|
94
|
+
function J(e, t) {
|
|
95
|
+
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
96
|
+
if (n.startsWith(r)) return 1e3 + r.length / n.length * 100;
|
|
97
|
+
if (n.split(/[\s\-_./]+/).some((e) => e.startsWith(r))) return 500;
|
|
98
|
+
let i = n.indexOf(r);
|
|
99
|
+
if (i >= 0) return 300 - i;
|
|
100
|
+
let a = 0, o = 0;
|
|
101
|
+
for (let e = 0; e < n.length && a < r.length; e++) n[e] === r[a] && (o += 10, e > 0 && n[e - 1] === (a > 0 ? r[a - 1] : "") && (o += 5), a++);
|
|
102
|
+
return a === r.length ? o : -1;
|
|
103
|
+
}
|
|
104
|
+
function Se(e, t) {
|
|
105
|
+
let n = J(e.label, t);
|
|
106
|
+
if (e.namespace && (n = Math.max(n, J(e.namespace, t) * .8)), e.keywords) for (let r of e.keywords) n = Math.max(n, J(r, t) * .7);
|
|
107
|
+
return n;
|
|
108
|
+
}
|
|
109
|
+
let Ce = l(() => {
|
|
110
|
+
let e = Array.from(P.commands.values()).filter((e) => !e.context || e.context === P.activeContext);
|
|
111
|
+
return B.value ? e.map((e) => ({
|
|
112
|
+
cmd: e,
|
|
113
|
+
score: Se(e, B.value)
|
|
114
|
+
})).filter((e) => e.score > 0).sort((e, t) => t.score - e.score).slice(0, A.maxResults).map((e) => e.cmd) : e.slice(0, A.maxResults);
|
|
115
|
+
}), Y = l(() => {
|
|
116
|
+
let e = /* @__PURE__ */ new Map();
|
|
117
|
+
for (let t of Ce.value) {
|
|
118
|
+
let n = t.namespace ?? "";
|
|
119
|
+
e.has(n) || e.set(n, []), e.get(n).push(t);
|
|
120
|
+
}
|
|
121
|
+
let t = Array.from(e.entries()).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => ({
|
|
122
|
+
namespace: e,
|
|
123
|
+
commands: t.sort((e, t) => e.label.localeCompare(t.label))
|
|
124
|
+
}));
|
|
125
|
+
if (H.value.length === 0) return t;
|
|
126
|
+
let n = /* @__PURE__ */ new Map();
|
|
127
|
+
for (let e of H.value.slice(0, A.maxResults)) {
|
|
128
|
+
let t = e.namespace ?? "";
|
|
129
|
+
n.has(t) || n.set(t, []), n.get(t).push(e);
|
|
130
|
+
}
|
|
131
|
+
return [...Array.from(n.entries()).map(([e, t]) => ({
|
|
132
|
+
namespace: e,
|
|
133
|
+
commands: t
|
|
134
|
+
})), ...t];
|
|
135
|
+
}), X = l(() => Y.value.flatMap((e) => e.commands));
|
|
136
|
+
function Z(e) {
|
|
137
|
+
P.close(), B.value = "", q(), e.handler();
|
|
138
|
+
}
|
|
139
|
+
function we(e) {
|
|
140
|
+
if (e.key === "Escape") {
|
|
141
|
+
e.preventDefault(), P.close(), B.value = "", q();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
let t = X.value;
|
|
145
|
+
if (!t.length) return;
|
|
146
|
+
let n = t.findIndex((e) => e.id === V.value);
|
|
147
|
+
if (e.key === "ArrowDown") e.preventDefault(), V.value = t[n < t.length - 1 ? n + 1 : 0].id, Q();
|
|
148
|
+
else if (e.key === "ArrowUp") e.preventDefault(), V.value = t[n > 0 ? n - 1 : t.length - 1].id, Q();
|
|
149
|
+
else if (e.key === "Enter" && V.value) {
|
|
150
|
+
e.preventDefault();
|
|
151
|
+
let n = t.find((e) => e.id === V.value);
|
|
152
|
+
n && Z(n);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function Q() {
|
|
156
|
+
g(() => {
|
|
157
|
+
document.querySelector(".nb-command-palette__item--highlighted")?.scrollIntoView({ block: "nearest" });
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
C(() => P.isOpen, (e) => {
|
|
161
|
+
e ? (B.value = P.searchFilter ?? "", V.value = null, g(() => {
|
|
162
|
+
g(() => {
|
|
163
|
+
X.value.length > 0 && (V.value = X.value[0].id);
|
|
164
|
+
});
|
|
165
|
+
}), O()) : (B.value = "", q(), k());
|
|
166
|
+
}), C(X, (e) => {
|
|
167
|
+
e.length > 0 && !e.find((e) => e.id === V.value) ? V.value = e[0].id : e.length === 0 && (V.value = null);
|
|
168
|
+
});
|
|
169
|
+
let Te = {
|
|
170
|
+
cmd: "⌘",
|
|
171
|
+
meta: "⌘",
|
|
172
|
+
shift: "⇧",
|
|
173
|
+
alt: "⌥",
|
|
174
|
+
option: "⌥",
|
|
175
|
+
ctrl: "⌃",
|
|
176
|
+
control: "⌃"
|
|
177
|
+
};
|
|
178
|
+
function Ee(e) {
|
|
179
|
+
return e.split("+").map((e) => Te[e.trim().toLowerCase()] || e.trim());
|
|
180
|
+
}
|
|
181
|
+
function De(e) {
|
|
182
|
+
let t = e.toLowerCase().split("+");
|
|
183
|
+
return {
|
|
184
|
+
key: t[t.length - 1],
|
|
185
|
+
meta: t.includes("meta") || t.includes("cmd"),
|
|
186
|
+
ctrl: t.includes("ctrl") || t.includes("control"),
|
|
187
|
+
shift: t.includes("shift"),
|
|
188
|
+
alt: t.includes("alt")
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function $(e) {
|
|
192
|
+
if (e.key === "Escape" && P.isOpen) {
|
|
193
|
+
e.preventDefault(), P.close(), B.value = "";
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
let t = De(A.openShortcut), n = e.key.toLowerCase() === t.key, r = t.meta ? e.metaKey : !e.metaKey, i = t.ctrl ? e.ctrlKey : !e.ctrlKey, a = t.shift ? e.shiftKey : !e.shiftKey, o = t.alt ? e.altKey : !e.altKey;
|
|
197
|
+
n && r && i && a && o && (e.preventDefault(), P.isOpen ? P.close() : P.open());
|
|
198
|
+
}
|
|
199
|
+
return ae(() => {
|
|
200
|
+
document.addEventListener("keydown", $);
|
|
201
|
+
}), ie(() => {
|
|
202
|
+
document.removeEventListener("keydown", $), K(), k();
|
|
203
|
+
}), (t, n) => (_(), u(te, {
|
|
204
|
+
to: "body",
|
|
205
|
+
disabled: !x(D)
|
|
206
|
+
}, [m(c, { name: "nb-command-palette" }, {
|
|
207
|
+
default: w(() => [x(P).isOpen ? (_(), f("div", {
|
|
208
|
+
key: 0,
|
|
209
|
+
class: "nb-command-palette__overlay",
|
|
210
|
+
onClick: n[2] ||= T((e) => x(P).close(), ["self"])
|
|
211
|
+
}, [p("div", {
|
|
212
|
+
ref_key: "paletteRef",
|
|
213
|
+
ref: I,
|
|
214
|
+
class: "nb-command-palette",
|
|
215
|
+
role: "dialog",
|
|
216
|
+
"aria-modal": "true",
|
|
217
|
+
"aria-label": M.value,
|
|
218
|
+
tabindex: "-1",
|
|
219
|
+
onKeydown: we
|
|
220
|
+
}, [p("div", de, [
|
|
221
|
+
m(r, {
|
|
222
|
+
name: x(le),
|
|
223
|
+
size: 20,
|
|
224
|
+
class: "nb-command-palette__search-icon"
|
|
225
|
+
}, null, 8, ["name"]),
|
|
226
|
+
se(p("input", {
|
|
227
|
+
ref_key: "inputRef",
|
|
228
|
+
ref: F,
|
|
229
|
+
"onUpdate:modelValue": n[0] ||= (e) => B.value = e,
|
|
230
|
+
type: "text",
|
|
231
|
+
class: "nb-command-palette__input",
|
|
232
|
+
role: "combobox",
|
|
233
|
+
"aria-autocomplete": "list",
|
|
234
|
+
"aria-label": M.value,
|
|
235
|
+
"aria-expanded": X.value.length > 0,
|
|
236
|
+
"aria-controls": X.value.length > 0 ? L : void 0,
|
|
237
|
+
"aria-activedescendant": V.value === null ? void 0 : z(V.value),
|
|
238
|
+
placeholder: h.placeholder ?? x(j).commandPalettePlaceholder,
|
|
239
|
+
autocomplete: "off",
|
|
240
|
+
spellcheck: "false"
|
|
241
|
+
}, null, 8, fe), [[oe, B.value]]),
|
|
242
|
+
x(N) ? (_(), u(e, {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: "nb-command-palette__close",
|
|
245
|
+
variant: "ghost",
|
|
246
|
+
icon: x(ce),
|
|
247
|
+
label: x(j).commandPaletteClose,
|
|
248
|
+
onClick: n[1] ||= (e) => x(P).close()
|
|
249
|
+
}, null, 8, ["icon", "label"])) : d("", !0)
|
|
250
|
+
]), Y.value.length > 0 ? (_(), f("div", {
|
|
251
|
+
key: 0,
|
|
252
|
+
id: L,
|
|
253
|
+
class: "nb-command-palette__results",
|
|
254
|
+
role: "listbox",
|
|
255
|
+
"aria-label": M.value
|
|
256
|
+
}, [(_(!0), f(s, null, y(Y.value, (e, t) => (_(), f("div", {
|
|
257
|
+
key: e.namespace,
|
|
258
|
+
role: e.namespace ? "group" : "presentation",
|
|
259
|
+
"aria-labelledby": e.namespace ? `${L}-group-${t}` : void 0
|
|
260
|
+
}, [e.namespace ? (_(), f("div", {
|
|
261
|
+
key: 0,
|
|
262
|
+
id: `${L}-group-${t}`,
|
|
263
|
+
class: "nb-command-palette__group-header",
|
|
264
|
+
role: "presentation"
|
|
265
|
+
}, b(e.namespace), 9, he)) : d("", !0), (_(!0), f(s, null, y(e.commands, (e) => (_(), f("div", {
|
|
266
|
+
id: z(e.id),
|
|
267
|
+
key: e.id,
|
|
268
|
+
role: "option",
|
|
269
|
+
"aria-selected": e.id === V.value,
|
|
270
|
+
class: re(["nb-command-palette__item", { "nb-command-palette__item--highlighted": e.id === V.value }]),
|
|
271
|
+
onClick: (t) => Z(e),
|
|
272
|
+
onMouseenter: (t) => V.value = e.id
|
|
273
|
+
}, [
|
|
274
|
+
e.icon ? (_(), u(r, {
|
|
275
|
+
key: 0,
|
|
276
|
+
name: e.icon,
|
|
277
|
+
size: 16,
|
|
278
|
+
class: "nb-command-palette__item-icon"
|
|
279
|
+
}, null, 8, ["name"])) : d("", !0),
|
|
280
|
+
p("span", {
|
|
281
|
+
class: "nb-command-palette__item-label",
|
|
282
|
+
title: e.label
|
|
283
|
+
}, b(e.label), 9, ge),
|
|
284
|
+
e.shortcut ? (_(), f("span", _e, [(_(!0), f(s, null, y(Ee(e.shortcut), (e, t) => (_(), f("kbd", {
|
|
285
|
+
key: t,
|
|
286
|
+
class: "nb-command-palette__key"
|
|
287
|
+
}, b(e), 1))), 128))])) : d("", !0)
|
|
288
|
+
], 42, E))), 128))], 8, me))), 128))], 8, pe)) : U.value ? (_(), f("div", ve, b(x(j).commandPaletteSearching), 1)) : B.value ? (_(), f("div", ye, b(x(j).commandPaletteNoMatches), 1)) : (_(), f("div", be, b(x(j).commandPaletteHint), 1))], 40, ue)])) : d("", !0)]),
|
|
289
|
+
_: 1
|
|
290
|
+
})], 8, ["disabled"]));
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
//#endregion
|
|
294
|
+
export { D as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.cjs`),t=require(`./composables/useReducedMotion.composable.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./Icon-CssV4E2-.cjs`),i=require(`./composables/useNbStrings.composable.cjs`),a=require(`./Message-B1CQ0Bcf.cjs`),ee=require(`./TextInput-SJ34hD2Y.cjs`),o=require(`./Modal-CmGFLEo4.cjs`);let s=require(`vue`),te=require(`@nubisco/ui/icons/check`),ne=require(`@nubisco/ui/icons/warning`);var c={key:0,class:`nb-confirm__message`},l={key:0,class:`nb-confirm__subject-kind`},u={class:`nb-confirm__subject-name`},re={key:1,class:`nb-confirm__gate`},ie={class:`nb-confirm__live`},d={key:0,class:`nb-confirm__status`,role:`status`},ae={key:1,class:`nb-confirm__status nb-confirm__status--success`,role:`status`},f=(0,s.defineComponent)({__name:`Confirm`,props:{open:{type:Boolean,default:!1},title:{},message:{default:void 0},subject:{default:void 0},subjectLabel:{default:void 0},confirmLabel:{default:void 0},cancelLabel:{default:void 0},tone:{default:`danger`},typeToConfirm:{default:void 0},typeToConfirmLabel:{default:void 0},typeToConfirmHelper:{default:void 0},busy:{type:Boolean,default:!1},busyLabel:{default:void 0},succeeded:{type:Boolean,default:!1},successLabel:{default:void 0},error:{default:void 0},size:{default:`sm`},floatingSelectors:{default:()=>[]},contentClass:{default:void 0}},emits:[`confirm`,`cancel`],setup(n,{expose:f,emit:p}){let m=n,h=p,g=(0,s.useId)(),_=`nb-confirm-title-${g}`,v=`nb-confirm-body-${g}`,y=(0,s.useSlots)(),b=(0,s.ref)(null),x=(0,s.ref)(null),S=(0,s.ref)(null),C=(0,s.ref)(null),w=(0,s.ref)(``),T=t.useReducedMotion(),E=(0,s.computed)(()=>m.busy||m.succeeded);function D(){return!!m.message||!!m.subject||!!y.default}let oe=(0,s.computed)(()=>m.tone===`danger`?`danger`:`primary`),O=i.useNbStrings(),se=(0,s.computed)(()=>m.confirmLabel??O.value.confirmConfirm),ce=(0,s.computed)(()=>m.cancelLabel??O.value.confirmCancel),le=(0,s.computed)(()=>m.busyLabel??O.value.confirmBusy),ue=(0,s.computed)(()=>m.typeToConfirmLabel??O.value.confirmTypeToConfirm(m.typeToConfirm??``)),de=(0,s.computed)(()=>!m.typeToConfirm||w.value.trim()===m.typeToConfirm),k=(0,s.computed)(()=>de.value&&!E.value);function fe(){k.value&&h(`confirm`)}function A(){let e=S.value?.$el;return e instanceof HTMLElement?e:null}function pe(){let e=C.value?.$el;return e instanceof HTMLElement?e:null}function j(){return b.value?.querySelector(`[data-nb-confirm="gate"] input, input[data-nb-confirm="gate"]`)??null}function M(){if(m.tone===`danger`)return A();if(m.typeToConfirm)return j()??A();let e=pe();return e&&!e.disabled?e:A()}function N(){let e=M();e?e.focus():H()}function P(){return b.value?.closest(`[role="dialog"],[role="alertdialog"]`)??null}function F(){return typeof document>`u`?[]:Array.from(document.querySelectorAll(`[aria-modal="true"]`))}function I(){let e=P();if(!e)return!1;let t=F();return t.length===0||t[t.length-1]===e}let L=[`a[href]:not([tabindex="-1"])`,`area[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`summary:not([tabindex="-1"])`,`audio[controls]:not([tabindex="-1"])`,`video[controls]:not([tabindex="-1"])`,`iframe:not([tabindex="-1"])`,`[contenteditable]:not([contenteditable="false"]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].map(e=>`${e}:not([hidden]):not([aria-hidden="true"])`).join(`,`);function R(){return o.i(m.floatingSelectors)}function z(e){return e instanceof Element?!!e.closest(R()):!1}function B(e){let t=P();return!!t&&!!e&&t.contains(e)}function V(){let e=P();return e?Array.from(e.querySelectorAll(L)).filter(e=>e.getAttribute(`aria-disabled`)!==`true`):[]}function H(){let e=P();return e?(e.focus(),!0):!1}function U(){let e=V()[0];e?e.focus():H()}let W=null;function G(){let e=W;W=null,e?.isConnected&&e.focus()}function K(){o.r(P(),T.value)}(0,s.watch)(T,()=>{m.open&&K()}),(0,s.watch)(()=>[m.busy,m.error],async(e,t)=>{if(!m.open)return;let[n,r]=e,i=t?.[0]??!1;if(await(0,s.nextTick)(),n){V().length===0&&H();return}if(i&&r){let e=x.value;e?e.focus():U();return}let a=document.activeElement;!B(a)&&!z(a)&&U()}),(0,s.watch)(()=>m.open,async e=>{e?(W=document.activeElement instanceof HTMLElement?document.activeElement:null,w.value=``,await(0,s.nextTick)(),K(),N()):G()},{immediate:!0});function q(){E.value||h(`cancel`)}let J=!1,Y=!1;function X(e){let t=e.target;J=B(t)||z(t)}function Z(e){Y=B(e.target)}function me(){let e=J&&!Y;J=!1,!e&&q()}function Q(e){if(!m.open||z(document.activeElement))return;if(e.key===`Escape`){if(!I())return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),q();return}if(e.key!==`Tab`||!I())return;let t=V();if(t.length===0){e.preventDefault(),B(document.activeElement)||H();return}let n=t[0],r=t[t.length-1],i=document.activeElement;e.shiftKey&&(i===n||!B(i))?(e.preventDefault(),r.focus()):!e.shiftKey&&i===r?(e.preventDefault(),n.focus()):B(i)||(e.preventDefault(),n.focus())}function $(e){if(!m.open)return;let t=e.relatedTarget;if(t instanceof Element){if(B(t)||z(t))return}else if(t!==null)return;requestAnimationFrame(()=>{if(!m.open)return;let e=document.activeElement;B(e)||z(e)||e&&e!==document.body&&!e.isConnected||I()&&U()})}return typeof document<`u`&&(document.addEventListener(`keydown`,Q,!0),document.addEventListener(`focusout`,$,!0),document.addEventListener(`mousedown`,X,!0),document.addEventListener(`touchstart`,X,!0),document.addEventListener(`click`,Z,!0)),(0,s.onMounted)(()=>{m.open&&(K(),N())}),(0,s.onUnmounted)(()=>{typeof document<`u`&&(document.removeEventListener(`keydown`,Q,!0),document.removeEventListener(`focusout`,$,!0),document.removeEventListener(`mousedown`,X,!0),document.removeEventListener(`touchstart`,X,!0),document.removeEventListener(`click`,Z,!0)),G()}),f({focusCancel:()=>A()?.focus(),restoreFocus:G,isTopmost:I}),(t,i)=>((0,s.openBlock)(),(0,s.createBlock)(o.t,{open:n.open,size:n.size,role:n.tone===`danger`?`alertdialog`:`dialog`,"labelled-by":_,"described-by":D()?v:void 0,busy:n.busy,"close-on-overlay":!E.value,"close-disabled":E.value,"close-on-escape":!1,"trap-focus":!1,onClose:me},{header:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`span`,{id:_,class:(0,s.normalizeClass)([`nb-confirm__heading`,`nb-confirm__heading--${n.tone}`])},[n.tone===`danger`?((0,s.openBlock)(),(0,s.createBlock)(r.t,{key:0,name:(0,s.unref)(ne.regular),size:16,"aria-hidden":`true`},null,8,[`name`])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`span`,null,(0,s.toDisplayString)(n.title),1)],2)]),footer:(0,s.withCtx)(()=>[(0,s.createVNode)(e.t,{ref_key:`cancelRef`,ref:S,class:`nb-confirm__action nb-confirm__action--cancel`,variant:`secondary`,disabled:E.value,"data-nb-confirm":`cancel`,onClick:q},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(ce.value),1)]),_:1},8,[`disabled`]),(0,s.createVNode)(e.t,{ref_key:`confirmRef`,ref:C,class:`nb-confirm__action nb-confirm__action--confirm`,variant:oe.value,disabled:!k.value,loading:n.busy,"data-nb-confirm":`confirm`,onClick:fe},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(se.value),1)]),_:1},8,[`variant`,`disabled`,`loading`])]),default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{ref_key:`rootRef`,ref:b,class:(0,s.normalizeClass)([`nb-confirm`,n.contentClass])},[D()?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:0,id:v,class:`nb-confirm__body`},[(0,s.renderSlot)(t.$slots,`default`,{},()=>[n.message?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,c,(0,s.toDisplayString)(n.message),1)):(0,s.createCommentVNode)(``,!0)],!0),n.subject?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,{key:0,class:(0,s.normalizeClass)([`nb-confirm__subject`,`nb-confirm__subject--${n.tone}`])},[n.subjectLabel?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,l,(0,s.toDisplayString)(n.subjectLabel),1)):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`span`,u,(0,s.toDisplayString)(n.subject),1)],2)):(0,s.createCommentVNode)(``,!0)])):(0,s.createCommentVNode)(``,!0),n.typeToConfirm?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,re,[(0,s.createVNode)(ee.t,{modelValue:w.value,"onUpdate:modelValue":i[0]||=e=>w.value=e,class:`nb-confirm__gate-field`,label:ue.value,helper:n.typeToConfirmHelper,disabled:E.value,autocomplete:`off`,spellcheck:`false`,"data-nb-confirm":`gate`,onKeydown:i[1]||=(0,s.withKeys)((0,s.withModifiers)(()=>{},[`prevent`]),[`enter`])},null,8,[`modelValue`,`label`,`helper`,`disabled`])])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`div`,ie,[n.busy?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,d,(0,s.toDisplayString)(le.value),1)):(0,s.createCommentVNode)(``,!0),n.succeeded&&n.successLabel?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,ae,[(0,s.createVNode)(r.t,{name:(0,s.unref)(te.regular),size:`sm`,"aria-hidden":`true`},null,8,[`name`]),(0,s.createElementVNode)(`span`,null,(0,s.toDisplayString)(n.successLabel),1)])):(0,s.createCommentVNode)(``,!0),n.error?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:2,ref_key:`errorRef`,ref:x,class:`nb-confirm__error`,tabindex:`-1`},[(0,s.createVNode)(a.t,{variant:`error`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(n.error),1)]),_:1})],512)):(0,s.createCommentVNode)(``,!0)])],2)]),_:3},8,[`open`,`size`,`role`,`described-by`,`busy`,`close-on-overlay`,`close-disabled`]))}}),p=n.t(f,[[`__scopeId`,`data-v-52687d15`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { useReducedMotion as t } from "./composables/useReducedMotion.composable.mjs";
|
|
3
3
|
import { t as n } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
4
4
|
import { t as r } from "./Icon-B2tiGiqZ.js";
|
|
5
5
|
import { useNbStrings as i } from "./composables/useNbStrings.composable.mjs";
|
|
6
6
|
import { t as a } from "./Message-Bi70NgGd.js";
|
|
7
|
-
import { t as ee } from "./TextInput-
|
|
8
|
-
import { i as te, r as ne, t as re } from "./Modal-
|
|
7
|
+
import { t as ee } from "./TextInput-BeqDf1R7.js";
|
|
8
|
+
import { i as te, r as ne, t as re } from "./Modal-DwL90AoV.js";
|
|
9
9
|
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, nextTick as m, normalizeClass as h, onMounted as ie, onUnmounted as ae, openBlock as g, ref as _, renderSlot as oe, toDisplayString as v, unref as y, useId as se, useSlots as ce, watch as b, withCtx as x, withKeys as le, withModifiers as ue } from "vue";
|
|
10
10
|
import { regular as de } from "@nubisco/ui/icons/check";
|
|
11
11
|
import { regular as fe } from "@nubisco/ui/icons/warning";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.cjs`);let t=require(`vue`);var n=[`aria-label`],r=(0,t.defineComponent)({__name:`ContentSwitcher`,props:{modelValue:{default:void 0},items:{},label:{},iconOnly:{type:Boolean,default:!1},size:{default:`md`}},emits:[`update:modelValue`],setup(r,{emit:i}){let a=r,o=i,s=(0,t.ref)(null),c=(0,t.computed)(()=>a.items.filter(e=>!e.disabled)),l=(0,t.computed)(()=>(c.value.find(e=>e.id===a.modelValue)??c.value[0])?.id);function u(e){return[`nb-content-switcher__item`,{"nb-content-switcher__item--selected":e.id===a.modelValue}]}function d(e){e.disabled||e.id===a.modelValue||o(`update:modelValue`,e.id)}function f(e){(0,t.nextTick)(()=>{let t=s.value?.querySelectorAll(`[data-id]`);Array.from(t??[]).find(t=>t.dataset.id===e)?.focus()})}function p(e){let t=c.value;if(!t.length)return;let n=t.findIndex(e=>e.id===l.value),r=-1;e.key===`ArrowRight`||e.key===`ArrowDown`?r=(n+1)%t.length:e.key===`ArrowLeft`||e.key===`ArrowUp`?r=(n-1+t.length)%t.length:e.key===`Home`?r=0:e.key===`End`&&(r=t.length-1),!(r<0)&&(e.preventDefault(),d(t[r]),f(t[r].id))}return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`rootRef`,ref:s,class:(0,t.normalizeClass)([`nb-content-switcher`,`nb-content-switcher--${r.size}`,{"nb-content-switcher--icon-only":r.iconOnly}]),role:`radiogroup`,"aria-label":r.label,onKeydown:p},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.items,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[r.iconOnly&&n.icon?((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:0,class:(0,t.normalizeClass)(u(n)),variant:`ghost`,size:r.size,icon:n.icon,label:n.label,disabled:n.disabled,role:`radio`,"aria-checked":n.id===r.modelValue,tabindex:l.value===n.id?0:-1,"data-id":n.id,onClick:e=>d(n)},null,8,[`class`,`size`,`icon`,`label`,`disabled`,`aria-checked`,`tabindex`,`data-id`,`onClick`])):((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:1,class:(0,t.normalizeClass)(u(n)),variant:`ghost`,size:r.size,icon:n.icon,disabled:n.disabled,role:`radio`,"aria-checked":n.id===r.modelValue,tabindex:l.value===n.id?0:-1,"data-id":n.id,onClick:e=>d(n)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(n.label),1)]),_:2},1032,[`class`,`size`,`icon`,`disabled`,`aria-checked`,`tabindex`,`data-id`,`onClick`]))],64))),128))],42,n))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { Fragment as t, computed as n, createBlock as r, createElementBlock as i, createTextVNode as a, defineComponent as o, nextTick as s, normalizeClass as c, openBlock as l, ref as u, renderList as d, toDisplayString as f, withCtx as p } from "vue";
|
|
3
3
|
//#region src/components/ContentSwitcher.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var m = ["aria-label"], h = /* @__PURE__ */ o({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-CGIbF1e-.cjs`),n=require(`./composables/useNbStrings.composable.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/check`);i=e.n(i);let a=require(`@nubisco/ui/icons/copy`);a=e.n(a);var o={class:`nb-copy-button`},s={class:`nb-copy-button__status`,role:`status`},c=(0,r.defineComponent)({__name:`CopyButton`,props:{text:{},label:{default:void 0},copiedLabel:{default:void 0},size:{default:`xs`},duration:{default:1500}},emits:[`copied`,`error`],setup(e,{emit:c}){let l=e,u=n.useNbStrings(),d=(0,r.computed)(()=>l.label??u.value.copyButtonCopy),f=(0,r.computed)(()=>l.copiedLabel??u.value.copyButtonCopied),p=c,m=(0,r.ref)(!1),h;async function g(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand?.(`copy`)??!1;if(t.remove(),!n)throw Error(`The browser did not allow copying.`)}async function _(){try{await g(l.text)}catch(e){p(`error`,e);return}m.value=!0,p(`copied`,l.text),clearTimeout(h),h=setTimeout(()=>m.value=!1,l.duration)}return(0,r.onBeforeUnmount)(()=>clearTimeout(h)),(n,c)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,o,[(0,r.createVNode)(t.t,{label:m.value?f.value:d.value,class:(0,r.normalizeClass)([`nb-copy-button__button`,{"nb-copy-button__button--copied":m.value}]),variant:`ghost`,size:e.size,icon:m.value?i:a,onClick:(0,r.withModifiers)(_,[`stop`,`prevent`]),onPointerdown:c[0]||=(0,r.withModifiers)(()=>{},[`stop`]),onMousedown:c[1]||=(0,r.withModifiers)(()=>{},[`stop`]),onDblclick:c[2]||=(0,r.withModifiers)(()=>{},[`stop`])},null,8,[`label`,`class`,`size`,`icon`]),(0,r.createElementVNode)(`span`,s,(0,r.toDisplayString)(m.value?f.value:``),1)]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { useNbStrings as t } from "./composables/useNbStrings.composable.mjs";
|
|
3
3
|
import { computed as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, onBeforeUnmount as c, openBlock as l, ref as u, toDisplayString as d, withModifiers as f } from "vue";
|
|
4
4
|
import * as p from "@nubisco/ui/icons/check";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { t } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
3
3
|
import { t as n } from "./Icon-B2tiGiqZ.js";
|
|
4
4
|
import { useSurfaceLayer as r } from "./composables/useSurfaceLayer.composable.mjs";
|
|
5
5
|
import { usePhoneLayout as i } from "./composables/usePhoneLayout.composable.mjs";
|
|
6
6
|
import { useNbStrings as a } from "./composables/useNbStrings.composable.mjs";
|
|
7
|
-
import { t as o } from "./OverflowMenu-
|
|
7
|
+
import { t as o } from "./OverflowMenu-DliuDrTK.js";
|
|
8
8
|
import { t as s } from "./Grid-BVIhOyQ1.js";
|
|
9
|
-
import { t as ee } from "./BatchActions-
|
|
9
|
+
import { t as ee } from "./BatchActions-Kr2S6CJI.js";
|
|
10
10
|
import { t as c } from "./Checkbox-U1tS47Qx.js";
|
|
11
11
|
import { t as te } from "./Toolbar-DX2l8FUL.js";
|
|
12
12
|
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as ne, createTextVNode as h, createVNode as g, defineComponent as re, getCurrentInstance as ie, mergeProps as ae, normalizeClass as _, normalizeStyle as oe, openBlock as v, ref as se, renderList as y, renderSlot as b, toDisplayString as x, unref as S, useId as ce, useSlots as le, watch as ue, withCtx as C, withModifiers as w } from "vue";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-5ClGtoaz.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./Icon-CssV4E2-.cjs`),i=require(`./composables/useSurfaceLayer.composable.cjs`),a=require(`./composables/usePhoneLayout.composable.cjs`),o=require(`./composables/useNbStrings.composable.cjs`),ee=require(`./OverflowMenu-CWgdicDN.cjs`),te=require(`./Grid-tn5_R2fP.cjs`),ne=require(`./BatchActions-xnTXMU6B.cjs`),s=require(`./Checkbox-B2O4tB6x.cjs`),re=require(`./Toolbar-0yonvSaQ.cjs`);let c=require(`vue`),l=require(`@nubisco/ui/icons/arrow-down`);l=e.n(l);let u=require(`@nubisco/ui/icons/arrow-up`);u=e.n(u);let d=require(`@nubisco/ui/icons/caret-right`);d=e.n(d);let f=require(`@nubisco/ui/icons/arrows-down-up`);f=e.n(f);var ie={key:0,class:`nb-data-table__toolbar`},ae={key:0,class:`nb-data-table__toolbar-heading`},oe={key:0,class:`nb-data-table__title`},se={key:1,class:`nb-data-table__description`},ce={key:1,class:`nb-data-table__toolbar-row`},le={class:`nb-data-table__scroll`},ue=[`role`,`aria-label`,`aria-busy`],de={key:0,class:`nb-data-table__col-expand`},fe={key:1,class:`nb-data-table__col-select`},pe={key:2,class:`nb-data-table__col-actions`},me=[`role`],he=[`role`],ge={key:0,scope:`col`,class:`nb-data-table__th nb-data-table__expand-cell`},_e={key:1,scope:`col`,class:`nb-data-table__th nb-data-table__select-cell`},ve=[`aria-sort`],ye=[`onClick`],be={class:`nb-data-table__th-label`},xe={key:1,class:`nb-data-table__th-label`},Se={key:2,scope:`col`,class:`nb-data-table__th nb-data-table__actions-cell`},Ce={class:`nb-sr-only`},we=[`role`],Te={key:0,class:`nb-data-table__td`},Ee={key:1,class:`nb-data-table__td`},De={key:2,class:`nb-data-table__td`},Oe={key:1,class:`nb-data-table__state-row`},ke=[`colspan`],Ae={key:2,class:`nb-data-table__state-row`},je=[`colspan`],Me=[`role`,`aria-selected`,`tabindex`,`onClick`,`onKeydown`,`onKeyup`],Ne=[`role`],Pe=[`aria-expanded`,`aria-controls`,`aria-label`,`onClick`],Fe=[`checked`,`aria-label`,`onChange`],Ie=[`role`,`data-label`],Le={key:0,class:`nb-data-table__row-actions`},p=[`role`],m=[`colspan`,`role`],h=[`id`,`aria-label`],g={key:1,class:`nb-data-table__footer`},_=(0,c.defineComponent)({__name:`DataTable`,props:{columns:{},rows:{},rowKey:{},size:{default:`lg`},sortState:{default:null},selectable:{default:`none`},selected:{default:()=>[]},loading:{type:Boolean,default:!1},skeletonRows:{default:5},error:{type:[String,Boolean],default:void 0},emptyMessage:{default:void 0},stickyHeader:{type:Boolean,default:!0},zebra:{type:Boolean,default:!1},fill:{type:Boolean,default:!1},title:{default:void 0},description:{default:void 0},ariaLabel:{default:void 0},stackOnPhone:{type:Boolean,default:!1},expanded:{default:()=>[]},rowActions:{type:Function,default:void 0}},emits:[`sort`,`update:selected`,`row-click`,`update:expanded`],setup(e,{emit:n}){let _=o.useNbStrings(),v=e,{layerProps:Re}=i.useSurfaceLayer(),y=n,b=(0,c.useSlots)(),ze=`nb-data-table-select-${(0,c.useId)()}`,x=(0,c.computed)(()=>v.size===`xl`?`lg`:v.size===`xs`?`sm`:v.size),S=(0,c.computed)(()=>v.columns.filter(e=>!e.hidden)),C=(0,c.computed)(()=>v.selectable!==`none`),w=(0,c.computed)(()=>!!v.rowActions||!!b[`row-actions`]),T=(0,c.computed)(()=>!!b[`row-detail`]),E=(0,c.computed)(()=>S.value.length+(T.value?1:0)+(C.value?1:0)+(w.value?1:0)),{phone:Be}=a.usePhoneLayout(),D=(0,c.computed)(()=>v.stackOnPhone&&Be.value),O=(0,c.computed)(()=>(S.value.find(e=>e.primary)??S.value.find(e=>!e.phoneHidden&&!e.phoneMeta))?.key);function Ve(e){return e.phoneHidden?`nb-data-table__td--phone-hidden`:e.key===O.value?`nb-data-table__td--primary`:e.phoneMeta?`nb-data-table__td--meta`:`nb-data-table__td--field`}let k=(0,c.computed)(()=>!v.loading&&!v.error&&v.rows.length>0&&(v.selectable===`multiple`||S.value.some(e=>e.sortable&&!e.phoneHidden)));function He(e){if(e.width!=null)return{width:typeof e.width==`number`?`${e.width}px`:e.width}}function A(e,t){return t[e.key]}function j(e){return e==null?``:String(e)}let M=e=>e.column.render?.(e.row,A(e.column,e.row),e.rowIndex)??null;M.props=[`column`,`row`,`rowIndex`];function N(e){let t=v.rowKey;return typeof t==`function`?t(e):e[t]}let P=(0,c.computed)(()=>new Set(v.selected)),Ue=(0,c.computed)(()=>v.selected),F=(0,c.computed)(()=>v.selected.length);function I(e){return P.value.has(N(e))}let L=(0,c.computed)(()=>v.rows.map(e=>N(e))),R=(0,c.computed)(()=>L.value.length>0&&L.value.every(e=>P.value.has(e))),We=(0,c.computed)(()=>!R.value&&L.value.some(e=>P.value.has(e))),z=(0,c.ref)(null),B=!1;function V(e){B=e.shiftKey}(0,c.watch)(L,()=>{z.value=null});function Ge(e,t){let n=N(e),r=new Set(v.selected),i=!r.has(n),a=z.value,o=e=>{i?r.add(e):r.delete(e)};if(B&&a!==null&&a!==t){let e=Math.min(a,t),n=Math.max(a,t);for(let t=e;t<=n;t++){let e=v.rows[t];e&&o(N(e))}}else o(n),z.value=t;B=!1,y(`update:selected`,[...r])}function Ke(e){y(`update:selected`,[N(e)])}function qe(){let e=new Set(v.selected);R.value?L.value.forEach(t=>e.delete(t)):L.value.forEach(t=>e.add(t)),y(`update:selected`,[...e])}function H(){y(`update:selected`,[])}let U=(0,c.computed)(()=>v.selectable!==`none`&&!!b[`batch-actions`]),W=(0,c.computed)(()=>U.value&&F.value>0);function Je(e){let t=v.rowActions?.(e)??[];return t.length<=3?{inline:t,more:[]}:{inline:t.slice(0,2),more:t.slice(2)}}function Ye(e){e.disabled||e.loading||W.value||e.onSelect?.()}let Xe=`nb-data-table-detail-${(0,c.useId)()}`,Ze=(0,c.computed)(()=>new Set(v.expanded));function G(e){return T.value&&Ze.value.has(N(e))}function Qe(e){let t=N(e),n=v.expanded.filter(e=>e!==t);n.length===v.expanded.length&&n.push(t),y(`update:expanded`,n)}function K(e){return`${Xe}-${e}`}function q(e,t){let n=S.value.find(e=>e.key===O.value);return`Details for ${(n?j(A(n,e)).trim():``)||`row ${t+1}`}`}let J=(0,c.computed)(()=>!!v.title||!!v.description||!!b.toolbar),Y=(0,c.computed)(()=>!!b.search||!!b[`toolbar-actions`]||U.value),$e=(0,c.computed)(()=>J.value||Y.value);function X(e){return!!v.sortState&&v.sortState.key===e.key&&v.sortState.direction!==`none`}function et(e){return X(e)?v.sortState.direction===`asc`?`ascending`:`descending`:`none`}function tt(e){return X(e)?v.sortState.direction===`asc`?u:l:f}function nt(e){return e===`asc`?`desc`:e===`desc`?`none`:`asc`}function rt(e){let t=v.sortState&&v.sortState.key===e.key?v.sortState.direction:`none`;y(`sort`,{key:e.key,direction:nt(t)})}let it=(0,c.getCurrentInstance)(),Z=(0,c.computed)(()=>!!it?.vnode.props?.onRowClick);function Q(e,t){y(`row-click`,e,t)}function $(e){return Z.value&&e.target===e.currentTarget&&!e.altKey&&!e.ctrlKey&&!e.metaKey}function at(e,t,n){$(e)&&(e.key===`Enter`?(e.preventDefault(),e.repeat||Q(t,n)):e.key===` `&&e.preventDefault())}function ot(e,t,n){!$(e)||e.key!==` `||(e.preventDefault(),Q(t,n))}return(n,i)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,(0,c.mergeProps)({class:[`nb-data-table`,`nb-data-table--${e.size}`,{"nb-data-table--zebra":e.zebra},{"nb-data-table--sticky":e.stickyHeader},{"nb-data-table--fill":e.fill},{"nb-data-table--stacked":D.value},{"nb-data-table--stacked-headless":D.value&&!k.value},{"nb-data-table--expandable":T.value}]},(0,c.unref)(Re)),[$e.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,ie,[J.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,ae,[(0,c.renderSlot)(n.$slots,`toolbar`,{selectedCount:F.value},()=>[e.title?((0,c.openBlock)(),(0,c.createElementBlock)(`h2`,oe,(0,c.toDisplayString)(e.title),1)):(0,c.createCommentVNode)(``,!0),e.description?((0,c.openBlock)(),(0,c.createElementBlock)(`p`,se,(0,c.toDisplayString)(e.description),1)):(0,c.createCommentVNode)(``,!0)],!0)])):(0,c.createCommentVNode)(``,!0),Y.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,ce,[n.$slots.search||n.$slots[`toolbar-actions`]?((0,c.openBlock)(),(0,c.createBlock)(re.t,{key:0,class:(0,c.normalizeClass)([`nb-data-table__toolbar-tools`,{"nb-data-table__toolbar-tools--search":!!n.$slots.search}]),label:(0,c.unref)(_).dataTableToolbar,size:x.value,flush:``,inert:W.value||void 0,"aria-hidden":W.value||void 0},(0,c.createSlots)({default:(0,c.withCtx)(()=>[(0,c.renderSlot)(n.$slots,`toolbar-actions`,{},void 0,!0)]),_:2},[n.$slots.search?{name:`start`,fn:(0,c.withCtx)(()=>[(0,c.renderSlot)(n.$slots,`search`,{},void 0,!0)]),key:`0`}:void 0]),1032,[`class`,`label`,`size`,`inert`,`aria-hidden`])):(0,c.createCommentVNode)(``,!0),W.value?((0,c.openBlock)(),(0,c.createBlock)(ne.t,{key:1,class:`nb-data-table__batch`,variant:`overlay`,count:F.value,size:x.value,label:(0,c.unref)(_).dataTableBatchActions,onCancel:H},{default:(0,c.withCtx)(()=>[(0,c.renderSlot)(n.$slots,`batch-actions`,{selectedKeys:Ue.value,clear:H},void 0,!0)]),_:3},8,[`count`,`size`,`label`])):(0,c.createCommentVNode)(``,!0)])):(0,c.createCommentVNode)(``,!0)])):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,le,[(0,c.createElementVNode)(`table`,{class:`nb-data-table__table`,role:D.value?`table`:void 0,"aria-label":e.ariaLabel||e.title||void 0,"aria-busy":e.loading||void 0},[(0,c.createElementVNode)(`colgroup`,null,[T.value?((0,c.openBlock)(),(0,c.createElementBlock)(`col`,de)):(0,c.createCommentVNode)(``,!0),C.value?((0,c.openBlock)(),(0,c.createElementBlock)(`col`,fe)):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(S.value,e=>((0,c.openBlock)(),(0,c.createElementBlock)(`col`,{key:`col-${e.key}`,style:(0,c.normalizeStyle)(He(e))},null,4))),128)),w.value?((0,c.openBlock)(),(0,c.createElementBlock)(`col`,pe)):(0,c.createCommentVNode)(``,!0)]),(0,c.createElementVNode)(`thead`,{class:`nb-data-table__head`,role:D.value?`rowgroup`:void 0},[(0,c.createElementVNode)(`tr`,{role:D.value?`row`:void 0},[T.value?((0,c.openBlock)(),(0,c.createElementBlock)(`th`,ge,[...i[3]||=[(0,c.createElementVNode)(`span`,{class:`nb-sr-only`},`Row details`,-1)]])):(0,c.createCommentVNode)(``,!0),C.value?((0,c.openBlock)(),(0,c.createElementBlock)(`th`,_e,[e.selectable===`multiple`?((0,c.openBlock)(),(0,c.createBlock)(s.t,{key:0,"model-value":R.value,indeterminate:We.value,"aria-label":(0,c.unref)(_).dataTableSelectAll,"onUpdate:modelValue":qe},null,8,[`model-value`,`indeterminate`,`aria-label`])):(0,c.createCommentVNode)(``,!0)])):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(S.value,e=>((0,c.openBlock)(),(0,c.createElementBlock)(`th`,{key:`th-${e.key}`,scope:`col`,class:(0,c.normalizeClass)([`nb-data-table__th`,`nb-data-table__th--${e.align||`left`}`,{"nb-data-table__th--sortable":e.sortable},{"nb-data-table__th--sorted":X(e)},D.value&&e.phoneHidden&&`nb-data-table__th--phone-hidden`]),"aria-sort":e.sortable?et(e):void 0},[e.sortable?((0,c.openBlock)(),(0,c.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-data-table__sort`,onClick:t=>rt(e)},[(0,c.createElementVNode)(`span`,be,[(0,c.renderSlot)(n.$slots,`header-${e.key}`,{column:e},()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.header),1)],!0)]),(0,c.createVNode)(r.t,{name:tt(e),class:`nb-data-table__sort-icon`,"aria-hidden":`true`},null,8,[`name`])],8,ye)):((0,c.openBlock)(),(0,c.createElementBlock)(`span`,xe,[(0,c.renderSlot)(n.$slots,`header-${e.key}`,{column:e},()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.header),1)],!0)]))],10,ve))),128)),w.value?((0,c.openBlock)(),(0,c.createElementBlock)(`th`,Se,[(0,c.createElementVNode)(`span`,Ce,(0,c.toDisplayString)((0,c.unref)(_).dataTableRowActions),1)])):(0,c.createCommentVNode)(``,!0)],8,he)],8,me),(0,c.createElementVNode)(`tbody`,{class:`nb-data-table__body`,role:D.value?`rowgroup`:void 0},[e.loading?((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,{key:0},(0,c.renderList)(e.skeletonRows,e=>((0,c.openBlock)(),(0,c.createElementBlock)(`tr`,{key:`skeleton-${e}`,class:`nb-data-table__row nb-data-table__row--skeleton`},[T.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,Te)):(0,c.createCommentVNode)(``,!0),C.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,Ee,[...i[4]||=[(0,c.createElementVNode)(`span`,{class:`nb-data-table__skeleton nb-data-table__skeleton--box`},null,-1)]])):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(S.value,t=>((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:`sk-${e}-${t.key}`,class:`nb-data-table__td`},[...i[5]||=[(0,c.createElementVNode)(`span`,{class:`nb-data-table__skeleton`},null,-1)]]))),128)),w.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,De,[...i[6]||=[(0,c.createElementVNode)(`span`,{class:`nb-data-table__skeleton nb-data-table__skeleton--box`},null,-1)]])):(0,c.createCommentVNode)(``,!0)]))),128)):e.error?((0,c.openBlock)(),(0,c.createElementBlock)(`tr`,Oe,[(0,c.createElementVNode)(`td`,{colspan:E.value,class:`nb-data-table__state nb-data-table__state--error`},[(0,c.renderSlot)(n.$slots,`error`,{error:e.error},()=>[(0,c.createVNode)(te.t,{is:`span`,align:`center`,justify:`center`,gap:`xs`,class:`nb-data-table__state-inner`},{default:(0,c.withCtx)(()=>[(0,c.createVNode)(r.t,{name:`warning-circle-fill`,"aria-hidden":`true`}),(0,c.createElementVNode)(`span`,null,(0,c.toDisplayString)(e.error===!0?(0,c.unref)(_).dataTableError:e.error),1)]),_:1})],!0)],8,ke)])):e.rows.length?((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,{key:3},(0,c.renderList)(e.rows,(a,o)=>((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:N(a)},[(0,c.createElementVNode)(`tr`,{class:(0,c.normalizeClass)([`nb-data-table__row`,{"nb-data-table__row--selected":I(a)},{"nb-data-table__row--clickable":Z.value},T.value&&{"nb-data-table__row--expanded":G(a),"nb-data-table__row--even":o%2==1}]),role:D.value?`row`:void 0,"aria-selected":e.selectable===`none`?void 0:I(a),tabindex:Z.value?0:void 0,onClick:e=>Q(a,o),onKeydown:e=>at(e,a,o),onKeyup:e=>ot(e,a,o)},[T.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:0,class:`nb-data-table__td nb-data-table__expand-cell`,role:D.value?`cell`:void 0,onClick:i[0]||=(0,c.withModifiers)(()=>{},[`stop`])},[(0,c.createElementVNode)(`button`,{type:`button`,class:`nb-data-table__expand`,"aria-expanded":G(a),"aria-controls":G(a)?K(o):void 0,"aria-label":q(a,o),onClick:e=>Qe(a)},[(0,c.createVNode)(r.t,{name:d,class:`nb-data-table__expand-icon`,"aria-hidden":`true`})],8,Pe)],8,Ne)):(0,c.createCommentVNode)(``,!0),C.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:1,class:`nb-data-table__td nb-data-table__select-cell`,onClick:i[1]||=(0,c.withModifiers)(()=>{},[`stop`]),onMousedown:V,onKeydown:V},[e.selectable===`multiple`?((0,c.openBlock)(),(0,c.createBlock)(s.t,{key:0,"model-value":I(a),"aria-label":(0,c.unref)(_).dataTableSelectRow(o+1),"onUpdate:modelValue":e=>Ge(a,o)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])):((0,c.openBlock)(),(0,c.createElementBlock)(`input`,{key:1,type:`radio`,class:`nb-data-table__radio`,name:ze,checked:I(a),"aria-label":(0,c.unref)(_).dataTableSelectRow(o+1),onChange:e=>Ke(a)},null,40,Fe))],32)):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(S.value,t=>((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:`td-${N(a)}-${t.key}`,class:(0,c.normalizeClass)([`nb-data-table__td`,`nb-data-table__td--${t.align||`left`}`,t.cellClass,D.value&&Ve(t)]),role:D.value?`cell`:void 0,"data-label":e.stackOnPhone?t.header:void 0},[(0,c.renderSlot)(n.$slots,`cell-${t.key}`,{row:a,value:A(t,a),column:t,rowIndex:o},()=>[t.render?((0,c.openBlock)(),(0,c.createBlock)(M,{key:0,column:t,row:a,"row-index":o},null,8,[`column`,`row`,`row-index`])):((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:1},[(0,c.createTextVNode)((0,c.toDisplayString)(j(A(t,a))),1)],64))],!0)],10,Ie))),128)),w.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:2,class:`nb-data-table__td nb-data-table__actions-cell`,onClick:i[2]||=(0,c.withModifiers)(()=>{},[`stop`])},[e.rowActions?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,Le,[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)([Je(a)],(e,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:n},[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(e.inline,e=>((0,c.openBlock)(),(0,c.createBlock)(t.t,{key:e.id,variant:`ghost`,size:`sm`,icon:e.icon,label:e.label,"disabled-reason":W.value?void 0:e.disabledReason,disabled:e.disabled||e.loading||W.value,loading:e.loading,"tooltip-position":`left`,onClick:t=>Ye(e)},null,8,[`icon`,`label`,`disabled-reason`,`disabled`,`loading`,`onClick`]))),128)),e.more.length?((0,c.openBlock)(),(0,c.createBlock)(ee.t,{key:0,size:`sm`,items:e.more,disabled:W.value},null,8,[`items`,`disabled`])):(0,c.createCommentVNode)(``,!0)],64))),128))])):(0,c.renderSlot)(n.$slots,`row-actions`,{key:1,row:a,rowIndex:o,disabled:W.value},void 0,!0)])):(0,c.createCommentVNode)(``,!0)],42,Me),G(a)?((0,c.openBlock)(),(0,c.createElementBlock)(`tr`,{key:0,class:`nb-data-table__detail-row`,role:D.value?`row`:void 0},[(0,c.createElementVNode)(`td`,{colspan:E.value,class:`nb-data-table__detail-cell`,role:D.value?`cell`:void 0},[(0,c.createElementVNode)(`div`,{id:K(o),class:`nb-data-table__detail`,role:`region`,"aria-label":q(a,o)},[(0,c.renderSlot)(n.$slots,`row-detail`,{row:a,rowIndex:o},void 0,!0)],8,h)],8,m)],8,p)):(0,c.createCommentVNode)(``,!0)],64))),128)):((0,c.openBlock)(),(0,c.createElementBlock)(`tr`,Ae,[(0,c.createElementVNode)(`td`,{colspan:E.value,class:`nb-data-table__state nb-data-table__state--empty`},[(0,c.renderSlot)(n.$slots,`empty`,{},()=>[(0,c.createElementVNode)(`span`,null,(0,c.toDisplayString)(e.emptyMessage||(0,c.unref)(_).dataTableEmpty),1)],!0)],8,je)]))],8,we)],8,ue)]),n.$slots.footer?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,g,[(0,c.renderSlot)(n.$slots,`footer`,{},void 0,!0)])):(0,c.createCommentVNode)(``,!0)],16))}}),v=n.t(_,[[`__scopeId`,`data-v-3abe6474`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-CGIbF1e-.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./Icon-CssV4E2-.cjs`),i=require(`./composables/useSurfaceLayer.composable.cjs`),a=require(`./composables/usePhoneLayout.composable.cjs`),o=require(`./composables/useNbStrings.composable.cjs`),ee=require(`./OverflowMenu-DuRgj1DU.cjs`),te=require(`./Grid-tn5_R2fP.cjs`),ne=require(`./BatchActions-jfvfpZeT.cjs`),s=require(`./Checkbox-B2O4tB6x.cjs`),re=require(`./Toolbar-0yonvSaQ.cjs`);let c=require(`vue`),l=require(`@nubisco/ui/icons/arrow-down`);l=e.n(l);let u=require(`@nubisco/ui/icons/arrow-up`);u=e.n(u);let d=require(`@nubisco/ui/icons/caret-right`);d=e.n(d);let f=require(`@nubisco/ui/icons/arrows-down-up`);f=e.n(f);var ie={key:0,class:`nb-data-table__toolbar`},ae={key:0,class:`nb-data-table__toolbar-heading`},oe={key:0,class:`nb-data-table__title`},se={key:1,class:`nb-data-table__description`},ce={key:1,class:`nb-data-table__toolbar-row`},le={class:`nb-data-table__scroll`},ue=[`role`,`aria-label`,`aria-busy`],de={key:0,class:`nb-data-table__col-expand`},fe={key:1,class:`nb-data-table__col-select`},pe={key:2,class:`nb-data-table__col-actions`},me=[`role`],he=[`role`],ge={key:0,scope:`col`,class:`nb-data-table__th nb-data-table__expand-cell`},_e={key:1,scope:`col`,class:`nb-data-table__th nb-data-table__select-cell`},ve=[`aria-sort`],ye=[`onClick`],be={class:`nb-data-table__th-label`},xe={key:1,class:`nb-data-table__th-label`},Se={key:2,scope:`col`,class:`nb-data-table__th nb-data-table__actions-cell`},Ce={class:`nb-sr-only`},we=[`role`],Te={key:0,class:`nb-data-table__td`},Ee={key:1,class:`nb-data-table__td`},De={key:2,class:`nb-data-table__td`},Oe={key:1,class:`nb-data-table__state-row`},ke=[`colspan`],Ae={key:2,class:`nb-data-table__state-row`},je=[`colspan`],Me=[`role`,`aria-selected`,`tabindex`,`onClick`,`onKeydown`,`onKeyup`],Ne=[`role`],Pe=[`aria-expanded`,`aria-controls`,`aria-label`,`onClick`],Fe=[`checked`,`aria-label`,`onChange`],Ie=[`role`,`data-label`],Le={key:0,class:`nb-data-table__row-actions`},p=[`role`],m=[`colspan`,`role`],h=[`id`,`aria-label`],g={key:1,class:`nb-data-table__footer`},_=(0,c.defineComponent)({__name:`DataTable`,props:{columns:{},rows:{},rowKey:{},size:{default:`lg`},sortState:{default:null},selectable:{default:`none`},selected:{default:()=>[]},loading:{type:Boolean,default:!1},skeletonRows:{default:5},error:{type:[String,Boolean],default:void 0},emptyMessage:{default:void 0},stickyHeader:{type:Boolean,default:!0},zebra:{type:Boolean,default:!1},fill:{type:Boolean,default:!1},title:{default:void 0},description:{default:void 0},ariaLabel:{default:void 0},stackOnPhone:{type:Boolean,default:!1},expanded:{default:()=>[]},rowActions:{type:Function,default:void 0}},emits:[`sort`,`update:selected`,`row-click`,`update:expanded`],setup(e,{emit:n}){let _=o.useNbStrings(),v=e,{layerProps:Re}=i.useSurfaceLayer(),y=n,b=(0,c.useSlots)(),ze=`nb-data-table-select-${(0,c.useId)()}`,x=(0,c.computed)(()=>v.size===`xl`?`lg`:v.size===`xs`?`sm`:v.size),S=(0,c.computed)(()=>v.columns.filter(e=>!e.hidden)),C=(0,c.computed)(()=>v.selectable!==`none`),w=(0,c.computed)(()=>!!v.rowActions||!!b[`row-actions`]),T=(0,c.computed)(()=>!!b[`row-detail`]),E=(0,c.computed)(()=>S.value.length+(T.value?1:0)+(C.value?1:0)+(w.value?1:0)),{phone:Be}=a.usePhoneLayout(),D=(0,c.computed)(()=>v.stackOnPhone&&Be.value),O=(0,c.computed)(()=>(S.value.find(e=>e.primary)??S.value.find(e=>!e.phoneHidden&&!e.phoneMeta))?.key);function Ve(e){return e.phoneHidden?`nb-data-table__td--phone-hidden`:e.key===O.value?`nb-data-table__td--primary`:e.phoneMeta?`nb-data-table__td--meta`:`nb-data-table__td--field`}let k=(0,c.computed)(()=>!v.loading&&!v.error&&v.rows.length>0&&(v.selectable===`multiple`||S.value.some(e=>e.sortable&&!e.phoneHidden)));function He(e){if(e.width!=null)return{width:typeof e.width==`number`?`${e.width}px`:e.width}}function A(e,t){return t[e.key]}function j(e){return e==null?``:String(e)}let M=e=>e.column.render?.(e.row,A(e.column,e.row),e.rowIndex)??null;M.props=[`column`,`row`,`rowIndex`];function N(e){let t=v.rowKey;return typeof t==`function`?t(e):e[t]}let P=(0,c.computed)(()=>new Set(v.selected)),Ue=(0,c.computed)(()=>v.selected),F=(0,c.computed)(()=>v.selected.length);function I(e){return P.value.has(N(e))}let L=(0,c.computed)(()=>v.rows.map(e=>N(e))),R=(0,c.computed)(()=>L.value.length>0&&L.value.every(e=>P.value.has(e))),We=(0,c.computed)(()=>!R.value&&L.value.some(e=>P.value.has(e))),z=(0,c.ref)(null),B=!1;function V(e){B=e.shiftKey}(0,c.watch)(L,()=>{z.value=null});function Ge(e,t){let n=N(e),r=new Set(v.selected),i=!r.has(n),a=z.value,o=e=>{i?r.add(e):r.delete(e)};if(B&&a!==null&&a!==t){let e=Math.min(a,t),n=Math.max(a,t);for(let t=e;t<=n;t++){let e=v.rows[t];e&&o(N(e))}}else o(n),z.value=t;B=!1,y(`update:selected`,[...r])}function Ke(e){y(`update:selected`,[N(e)])}function qe(){let e=new Set(v.selected);R.value?L.value.forEach(t=>e.delete(t)):L.value.forEach(t=>e.add(t)),y(`update:selected`,[...e])}function H(){y(`update:selected`,[])}let U=(0,c.computed)(()=>v.selectable!==`none`&&!!b[`batch-actions`]),W=(0,c.computed)(()=>U.value&&F.value>0);function Je(e){let t=v.rowActions?.(e)??[];return t.length<=3?{inline:t,more:[]}:{inline:t.slice(0,2),more:t.slice(2)}}function Ye(e){e.disabled||e.loading||W.value||e.onSelect?.()}let Xe=`nb-data-table-detail-${(0,c.useId)()}`,Ze=(0,c.computed)(()=>new Set(v.expanded));function G(e){return T.value&&Ze.value.has(N(e))}function Qe(e){let t=N(e),n=v.expanded.filter(e=>e!==t);n.length===v.expanded.length&&n.push(t),y(`update:expanded`,n)}function K(e){return`${Xe}-${e}`}function q(e,t){let n=S.value.find(e=>e.key===O.value);return`Details for ${(n?j(A(n,e)).trim():``)||`row ${t+1}`}`}let J=(0,c.computed)(()=>!!v.title||!!v.description||!!b.toolbar),Y=(0,c.computed)(()=>!!b.search||!!b[`toolbar-actions`]||U.value),$e=(0,c.computed)(()=>J.value||Y.value);function X(e){return!!v.sortState&&v.sortState.key===e.key&&v.sortState.direction!==`none`}function et(e){return X(e)?v.sortState.direction===`asc`?`ascending`:`descending`:`none`}function tt(e){return X(e)?v.sortState.direction===`asc`?u:l:f}function nt(e){return e===`asc`?`desc`:e===`desc`?`none`:`asc`}function rt(e){let t=v.sortState&&v.sortState.key===e.key?v.sortState.direction:`none`;y(`sort`,{key:e.key,direction:nt(t)})}let it=(0,c.getCurrentInstance)(),Z=(0,c.computed)(()=>!!it?.vnode.props?.onRowClick);function Q(e,t){y(`row-click`,e,t)}function $(e){return Z.value&&e.target===e.currentTarget&&!e.altKey&&!e.ctrlKey&&!e.metaKey}function at(e,t,n){$(e)&&(e.key===`Enter`?(e.preventDefault(),e.repeat||Q(t,n)):e.key===` `&&e.preventDefault())}function ot(e,t,n){!$(e)||e.key!==` `||(e.preventDefault(),Q(t,n))}return(n,i)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,(0,c.mergeProps)({class:[`nb-data-table`,`nb-data-table--${e.size}`,{"nb-data-table--zebra":e.zebra},{"nb-data-table--sticky":e.stickyHeader},{"nb-data-table--fill":e.fill},{"nb-data-table--stacked":D.value},{"nb-data-table--stacked-headless":D.value&&!k.value},{"nb-data-table--expandable":T.value}]},(0,c.unref)(Re)),[$e.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,ie,[J.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,ae,[(0,c.renderSlot)(n.$slots,`toolbar`,{selectedCount:F.value},()=>[e.title?((0,c.openBlock)(),(0,c.createElementBlock)(`h2`,oe,(0,c.toDisplayString)(e.title),1)):(0,c.createCommentVNode)(``,!0),e.description?((0,c.openBlock)(),(0,c.createElementBlock)(`p`,se,(0,c.toDisplayString)(e.description),1)):(0,c.createCommentVNode)(``,!0)],!0)])):(0,c.createCommentVNode)(``,!0),Y.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,ce,[n.$slots.search||n.$slots[`toolbar-actions`]?((0,c.openBlock)(),(0,c.createBlock)(re.t,{key:0,class:(0,c.normalizeClass)([`nb-data-table__toolbar-tools`,{"nb-data-table__toolbar-tools--search":!!n.$slots.search}]),label:(0,c.unref)(_).dataTableToolbar,size:x.value,flush:``,inert:W.value||void 0,"aria-hidden":W.value||void 0},(0,c.createSlots)({default:(0,c.withCtx)(()=>[(0,c.renderSlot)(n.$slots,`toolbar-actions`,{},void 0,!0)]),_:2},[n.$slots.search?{name:`start`,fn:(0,c.withCtx)(()=>[(0,c.renderSlot)(n.$slots,`search`,{},void 0,!0)]),key:`0`}:void 0]),1032,[`class`,`label`,`size`,`inert`,`aria-hidden`])):(0,c.createCommentVNode)(``,!0),W.value?((0,c.openBlock)(),(0,c.createBlock)(ne.t,{key:1,class:`nb-data-table__batch`,variant:`overlay`,count:F.value,size:x.value,label:(0,c.unref)(_).dataTableBatchActions,onCancel:H},{default:(0,c.withCtx)(()=>[(0,c.renderSlot)(n.$slots,`batch-actions`,{selectedKeys:Ue.value,clear:H},void 0,!0)]),_:3},8,[`count`,`size`,`label`])):(0,c.createCommentVNode)(``,!0)])):(0,c.createCommentVNode)(``,!0)])):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,le,[(0,c.createElementVNode)(`table`,{class:`nb-data-table__table`,role:D.value?`table`:void 0,"aria-label":e.ariaLabel||e.title||void 0,"aria-busy":e.loading||void 0},[(0,c.createElementVNode)(`colgroup`,null,[T.value?((0,c.openBlock)(),(0,c.createElementBlock)(`col`,de)):(0,c.createCommentVNode)(``,!0),C.value?((0,c.openBlock)(),(0,c.createElementBlock)(`col`,fe)):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(S.value,e=>((0,c.openBlock)(),(0,c.createElementBlock)(`col`,{key:`col-${e.key}`,style:(0,c.normalizeStyle)(He(e))},null,4))),128)),w.value?((0,c.openBlock)(),(0,c.createElementBlock)(`col`,pe)):(0,c.createCommentVNode)(``,!0)]),(0,c.createElementVNode)(`thead`,{class:`nb-data-table__head`,role:D.value?`rowgroup`:void 0},[(0,c.createElementVNode)(`tr`,{role:D.value?`row`:void 0},[T.value?((0,c.openBlock)(),(0,c.createElementBlock)(`th`,ge,[...i[3]||=[(0,c.createElementVNode)(`span`,{class:`nb-sr-only`},`Row details`,-1)]])):(0,c.createCommentVNode)(``,!0),C.value?((0,c.openBlock)(),(0,c.createElementBlock)(`th`,_e,[e.selectable===`multiple`?((0,c.openBlock)(),(0,c.createBlock)(s.t,{key:0,"model-value":R.value,indeterminate:We.value,"aria-label":(0,c.unref)(_).dataTableSelectAll,"onUpdate:modelValue":qe},null,8,[`model-value`,`indeterminate`,`aria-label`])):(0,c.createCommentVNode)(``,!0)])):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(S.value,e=>((0,c.openBlock)(),(0,c.createElementBlock)(`th`,{key:`th-${e.key}`,scope:`col`,class:(0,c.normalizeClass)([`nb-data-table__th`,`nb-data-table__th--${e.align||`left`}`,{"nb-data-table__th--sortable":e.sortable},{"nb-data-table__th--sorted":X(e)},D.value&&e.phoneHidden&&`nb-data-table__th--phone-hidden`]),"aria-sort":e.sortable?et(e):void 0},[e.sortable?((0,c.openBlock)(),(0,c.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-data-table__sort`,onClick:t=>rt(e)},[(0,c.createElementVNode)(`span`,be,[(0,c.renderSlot)(n.$slots,`header-${e.key}`,{column:e},()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.header),1)],!0)]),(0,c.createVNode)(r.t,{name:tt(e),class:`nb-data-table__sort-icon`,"aria-hidden":`true`},null,8,[`name`])],8,ye)):((0,c.openBlock)(),(0,c.createElementBlock)(`span`,xe,[(0,c.renderSlot)(n.$slots,`header-${e.key}`,{column:e},()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.header),1)],!0)]))],10,ve))),128)),w.value?((0,c.openBlock)(),(0,c.createElementBlock)(`th`,Se,[(0,c.createElementVNode)(`span`,Ce,(0,c.toDisplayString)((0,c.unref)(_).dataTableRowActions),1)])):(0,c.createCommentVNode)(``,!0)],8,he)],8,me),(0,c.createElementVNode)(`tbody`,{class:`nb-data-table__body`,role:D.value?`rowgroup`:void 0},[e.loading?((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,{key:0},(0,c.renderList)(e.skeletonRows,e=>((0,c.openBlock)(),(0,c.createElementBlock)(`tr`,{key:`skeleton-${e}`,class:`nb-data-table__row nb-data-table__row--skeleton`},[T.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,Te)):(0,c.createCommentVNode)(``,!0),C.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,Ee,[...i[4]||=[(0,c.createElementVNode)(`span`,{class:`nb-data-table__skeleton nb-data-table__skeleton--box`},null,-1)]])):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(S.value,t=>((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:`sk-${e}-${t.key}`,class:`nb-data-table__td`},[...i[5]||=[(0,c.createElementVNode)(`span`,{class:`nb-data-table__skeleton`},null,-1)]]))),128)),w.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,De,[...i[6]||=[(0,c.createElementVNode)(`span`,{class:`nb-data-table__skeleton nb-data-table__skeleton--box`},null,-1)]])):(0,c.createCommentVNode)(``,!0)]))),128)):e.error?((0,c.openBlock)(),(0,c.createElementBlock)(`tr`,Oe,[(0,c.createElementVNode)(`td`,{colspan:E.value,class:`nb-data-table__state nb-data-table__state--error`},[(0,c.renderSlot)(n.$slots,`error`,{error:e.error},()=>[(0,c.createVNode)(te.t,{is:`span`,align:`center`,justify:`center`,gap:`xs`,class:`nb-data-table__state-inner`},{default:(0,c.withCtx)(()=>[(0,c.createVNode)(r.t,{name:`warning-circle-fill`,"aria-hidden":`true`}),(0,c.createElementVNode)(`span`,null,(0,c.toDisplayString)(e.error===!0?(0,c.unref)(_).dataTableError:e.error),1)]),_:1})],!0)],8,ke)])):e.rows.length?((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,{key:3},(0,c.renderList)(e.rows,(a,o)=>((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:N(a)},[(0,c.createElementVNode)(`tr`,{class:(0,c.normalizeClass)([`nb-data-table__row`,{"nb-data-table__row--selected":I(a)},{"nb-data-table__row--clickable":Z.value},T.value&&{"nb-data-table__row--expanded":G(a),"nb-data-table__row--even":o%2==1}]),role:D.value?`row`:void 0,"aria-selected":e.selectable===`none`?void 0:I(a),tabindex:Z.value?0:void 0,onClick:e=>Q(a,o),onKeydown:e=>at(e,a,o),onKeyup:e=>ot(e,a,o)},[T.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:0,class:`nb-data-table__td nb-data-table__expand-cell`,role:D.value?`cell`:void 0,onClick:i[0]||=(0,c.withModifiers)(()=>{},[`stop`])},[(0,c.createElementVNode)(`button`,{type:`button`,class:`nb-data-table__expand`,"aria-expanded":G(a),"aria-controls":G(a)?K(o):void 0,"aria-label":q(a,o),onClick:e=>Qe(a)},[(0,c.createVNode)(r.t,{name:d,class:`nb-data-table__expand-icon`,"aria-hidden":`true`})],8,Pe)],8,Ne)):(0,c.createCommentVNode)(``,!0),C.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:1,class:`nb-data-table__td nb-data-table__select-cell`,onClick:i[1]||=(0,c.withModifiers)(()=>{},[`stop`]),onMousedown:V,onKeydown:V},[e.selectable===`multiple`?((0,c.openBlock)(),(0,c.createBlock)(s.t,{key:0,"model-value":I(a),"aria-label":(0,c.unref)(_).dataTableSelectRow(o+1),"onUpdate:modelValue":e=>Ge(a,o)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])):((0,c.openBlock)(),(0,c.createElementBlock)(`input`,{key:1,type:`radio`,class:`nb-data-table__radio`,name:ze,checked:I(a),"aria-label":(0,c.unref)(_).dataTableSelectRow(o+1),onChange:e=>Ke(a)},null,40,Fe))],32)):(0,c.createCommentVNode)(``,!0),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(S.value,t=>((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:`td-${N(a)}-${t.key}`,class:(0,c.normalizeClass)([`nb-data-table__td`,`nb-data-table__td--${t.align||`left`}`,t.cellClass,D.value&&Ve(t)]),role:D.value?`cell`:void 0,"data-label":e.stackOnPhone?t.header:void 0},[(0,c.renderSlot)(n.$slots,`cell-${t.key}`,{row:a,value:A(t,a),column:t,rowIndex:o},()=>[t.render?((0,c.openBlock)(),(0,c.createBlock)(M,{key:0,column:t,row:a,"row-index":o},null,8,[`column`,`row`,`row-index`])):((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:1},[(0,c.createTextVNode)((0,c.toDisplayString)(j(A(t,a))),1)],64))],!0)],10,Ie))),128)),w.value?((0,c.openBlock)(),(0,c.createElementBlock)(`td`,{key:2,class:`nb-data-table__td nb-data-table__actions-cell`,onClick:i[2]||=(0,c.withModifiers)(()=>{},[`stop`])},[e.rowActions?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,Le,[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)([Je(a)],(e,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:n},[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(e.inline,e=>((0,c.openBlock)(),(0,c.createBlock)(t.t,{key:e.id,variant:`ghost`,size:`sm`,icon:e.icon,label:e.label,"disabled-reason":W.value?void 0:e.disabledReason,disabled:e.disabled||e.loading||W.value,loading:e.loading,"tooltip-position":`left`,onClick:t=>Ye(e)},null,8,[`icon`,`label`,`disabled-reason`,`disabled`,`loading`,`onClick`]))),128)),e.more.length?((0,c.openBlock)(),(0,c.createBlock)(ee.t,{key:0,size:`sm`,items:e.more,disabled:W.value},null,8,[`items`,`disabled`])):(0,c.createCommentVNode)(``,!0)],64))),128))])):(0,c.renderSlot)(n.$slots,`row-actions`,{key:1,row:a,rowIndex:o,disabled:W.value},void 0,!0)])):(0,c.createCommentVNode)(``,!0)],42,Me),G(a)?((0,c.openBlock)(),(0,c.createElementBlock)(`tr`,{key:0,class:`nb-data-table__detail-row`,role:D.value?`row`:void 0},[(0,c.createElementVNode)(`td`,{colspan:E.value,class:`nb-data-table__detail-cell`,role:D.value?`cell`:void 0},[(0,c.createElementVNode)(`div`,{id:K(o),class:`nb-data-table__detail`,role:`region`,"aria-label":q(a,o)},[(0,c.renderSlot)(n.$slots,`row-detail`,{row:a,rowIndex:o},void 0,!0)],8,h)],8,m)],8,p)):(0,c.createCommentVNode)(``,!0)],64))),128)):((0,c.openBlock)(),(0,c.createElementBlock)(`tr`,Ae,[(0,c.createElementVNode)(`td`,{colspan:E.value,class:`nb-data-table__state nb-data-table__state--empty`},[(0,c.renderSlot)(n.$slots,`empty`,{},()=>[(0,c.createElementVNode)(`span`,null,(0,c.toDisplayString)(e.emptyMessage||(0,c.unref)(_).dataTableEmpty),1)],!0)],8,je)]))],8,we)],8,ue)]),n.$slots.footer?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,g,[(0,c.renderSlot)(n.$slots,`footer`,{},void 0,!0)])):(0,c.createCommentVNode)(``,!0)],16))}}),v=n.t(_,[[`__scopeId`,`data-v-3abe6474`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
|