@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,587 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./Button-CxJMKPpw.js";
|
|
2
|
-
import { t } from "./Icon-B2tiGiqZ.js";
|
|
3
|
-
import { usePhoneLayout as n } from "./composables/usePhoneLayout.composable.mjs";
|
|
4
|
-
import { useNbStrings as r } from "./composables/useNbStrings.composable.mjs";
|
|
5
|
-
import { t as i } from "./Spinner-DYFhiTB1.js";
|
|
6
|
-
import { t as a } from "./EmptyState-DE1pPuw-.js";
|
|
7
|
-
import { t as o } from "./CloseButton-BMJBwHvG.js";
|
|
8
|
-
import { t as s } from "./Skeleton-DFi5DNiP.js";
|
|
9
|
-
import { t as c } from "./NotificationCenterItem-Hf0S6Jls.js";
|
|
10
|
-
import { Fragment as l, Teleport as u, Transition as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createSlots as ee, createTextVNode as te, createVNode as _, defineComponent as v, mergeProps as ne, nextTick as y, normalizeClass as re, normalizeStyle as b, onBeforeUnmount as ie, openBlock as x, ref as S, renderList as ae, renderSlot as C, toDisplayString as w, unref as oe, useId as se, useSlots as ce, watch as le, withCtx as ue } from "vue";
|
|
11
|
-
import { regular as de } from "@nubisco/ui/icons/warning-circle";
|
|
12
|
-
import * as fe from "@nubisco/ui/icons/bell";
|
|
13
|
-
//#region src/components/NotificationCenter.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var pe = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "nb-notification-center__badge",
|
|
17
|
-
"aria-hidden": "true"
|
|
18
|
-
}, me = ["aria-describedby", "aria-busy"], he = { class: "nb-notification-center__header" }, ge = {
|
|
19
|
-
class: "nb-notification-center__sr",
|
|
20
|
-
role: "status"
|
|
21
|
-
}, _e = { class: "nb-notification-center__stale-text" }, ve = { class: "nb-notification-center__sr" }, ye = ["tabindex"], be = {
|
|
22
|
-
key: 4,
|
|
23
|
-
class: "nb-notification-center__empty"
|
|
24
|
-
}, xe = {
|
|
25
|
-
key: 5,
|
|
26
|
-
class: "nb-notification-center__footer"
|
|
27
|
-
}, T = /* @__PURE__ */ new Set(), E = 8, D = 8, O = 96, k = 88, A = 200;
|
|
28
|
-
function Se(e, { align: t, side: n, width: r, maxHeight: i, viewport: a }) {
|
|
29
|
-
let o = e.left + e.width;
|
|
30
|
-
if (n === "right" && a.width - o - E - D >= r) {
|
|
31
|
-
let n = e.top + e.height, r = t === "end" ? n - D : a.height - e.top - D, s = Math.max(k + O, r), c = Math.min(i + O, s), l = Math.max(k, Math.min(i, s - O));
|
|
32
|
-
return t === "end" ? {
|
|
33
|
-
top: Math.max(D, n - c),
|
|
34
|
-
bottom: Math.max(D, a.height - n),
|
|
35
|
-
left: o + E,
|
|
36
|
-
side: "right",
|
|
37
|
-
maxListHeight: l
|
|
38
|
-
} : {
|
|
39
|
-
top: Math.max(D, Math.min(e.top, a.height - D - c)),
|
|
40
|
-
left: o + E,
|
|
41
|
-
side: "right",
|
|
42
|
-
maxListHeight: l
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
let s = t === "start" ? e.left : e.left + e.width - r, c = Math.min(Math.max(s, D), Math.max(D, a.width - r - D)), l = e.top + e.height, u = a.height - l - E - D, d = e.top - E - D, f = u < A && d > u ? "top" : "bottom", p = Math.max(k, f === "top" ? d : u), m = Math.max(k, Math.min(i, p - O)), h = Math.min(i + O, p);
|
|
46
|
-
return {
|
|
47
|
-
top: f === "top" ? Math.max(D, e.top - E - h) : l + E,
|
|
48
|
-
left: c,
|
|
49
|
-
side: f,
|
|
50
|
-
maxListHeight: m
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function Ce(e, t) {
|
|
54
|
-
return e.left <= t.width && e.left + e.width >= 0 && e.top <= t.height && e.top + e.height >= 0;
|
|
55
|
-
}
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/components/NotificationCenter.vue
|
|
58
|
-
var j = /* @__PURE__ */ v({
|
|
59
|
-
__name: "NotificationCenter",
|
|
60
|
-
props: {
|
|
61
|
-
items: { default: () => [] },
|
|
62
|
-
unreadCount: { default: void 0 },
|
|
63
|
-
itemCount: { default: void 0 },
|
|
64
|
-
open: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
default: void 0
|
|
67
|
-
},
|
|
68
|
-
label: { default: "Notifications" },
|
|
69
|
-
markAllLabel: { default: "Mark all as read" },
|
|
70
|
-
markAllPendingLabel: { default: "Marking all as read" },
|
|
71
|
-
markAllPending: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: !1
|
|
74
|
-
},
|
|
75
|
-
emptyTitle: { default: "No notifications" },
|
|
76
|
-
emptyDescription: { default: "New activity shows up here." },
|
|
77
|
-
loadingLabel: { default: "Loading notifications" },
|
|
78
|
-
loading: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: !1
|
|
81
|
-
},
|
|
82
|
-
error: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
default: !1
|
|
85
|
-
},
|
|
86
|
-
errorTitle: { default: "Could not load notifications" },
|
|
87
|
-
errorDescription: { default: "The request failed. Nothing has been lost." },
|
|
88
|
-
errorStaleLabel: { default: "These may be out of date." },
|
|
89
|
-
retryLabel: { default: "Try again" },
|
|
90
|
-
showRetry: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
default: !0
|
|
93
|
-
},
|
|
94
|
-
maxCount: { default: 99 },
|
|
95
|
-
width: { default: 360 },
|
|
96
|
-
closeLabel: { default: void 0 },
|
|
97
|
-
maxHeight: { default: 384 },
|
|
98
|
-
align: { default: "end" },
|
|
99
|
-
side: { default: "vertical" },
|
|
100
|
-
showMarkAll: {
|
|
101
|
-
type: Boolean,
|
|
102
|
-
default: !0
|
|
103
|
-
},
|
|
104
|
-
interactive: {
|
|
105
|
-
type: Boolean,
|
|
106
|
-
default: !0
|
|
107
|
-
},
|
|
108
|
-
closeOnSelect: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
default: !0
|
|
111
|
-
},
|
|
112
|
-
closeOnNavigate: {
|
|
113
|
-
type: Boolean,
|
|
114
|
-
default: !0
|
|
115
|
-
},
|
|
116
|
-
disabled: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
default: !1
|
|
119
|
-
},
|
|
120
|
-
icon: { default: void 0 },
|
|
121
|
-
locale: { default: void 0 },
|
|
122
|
-
unreadLabel: { default: "Unread" },
|
|
123
|
-
readLabel: { default: "Read" },
|
|
124
|
-
formatUnread: {
|
|
125
|
-
type: Function,
|
|
126
|
-
default: (e) => `${e} unread`
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
emits: [
|
|
130
|
-
"update:open",
|
|
131
|
-
"open",
|
|
132
|
-
"close",
|
|
133
|
-
"select",
|
|
134
|
-
"mark-all-read",
|
|
135
|
-
"retry"
|
|
136
|
-
],
|
|
137
|
-
setup(v, { expose: E, emit: D }) {
|
|
138
|
-
let O = r(), k = v, A = f(() => k.icon ?? fe), j = D, M = ce(), N = `nb-notification-center-${se()}`, we = `${N}-title`, Te = `${N}-trigger`, Ee = `${N}-error`, P = S(null), De = S(null), F = S(null), I = S(null), Oe = S(!1), L = f(() => k.open === void 0 ? Oe.value : k.open), R = f(() => typeof k.unreadCount == "number" ? Math.max(0, k.unreadCount) : k.items.filter((e) => !e.read).length), ke = f(() => R.value > k.maxCount ? `${k.maxCount}+` : String(R.value)), Ae = f(() => R.value > 0 ? `${k.label}, ${k.formatUnread(R.value)}` : k.label), je = f(() => {
|
|
139
|
-
if (typeof k.itemCount == "number") return Math.max(0, k.itemCount);
|
|
140
|
-
if (!M.default) return k.items.length;
|
|
141
|
-
}), Me = f(() => (je.value ?? 0) > 0), z = f(() => {
|
|
142
|
-
if (k.loading) return "loading";
|
|
143
|
-
let e = je.value;
|
|
144
|
-
return k.error && (e === void 0 || e === 0) ? "error" : e === void 0 || e > 0 ? "list" : "empty";
|
|
145
|
-
}), Ne = f(() => k.error && !k.loading && z.value === "list" && Me.value);
|
|
146
|
-
S(!1), le(() => [
|
|
147
|
-
L.value,
|
|
148
|
-
!!M.default,
|
|
149
|
-
k.itemCount
|
|
150
|
-
], ([e, t, n]) => {}, { immediate: !0 });
|
|
151
|
-
function B() {
|
|
152
|
-
j("retry");
|
|
153
|
-
}
|
|
154
|
-
let Pe = f(() => ({
|
|
155
|
-
id: Te,
|
|
156
|
-
"aria-haspopup": "dialog",
|
|
157
|
-
"aria-expanded": L.value ? "true" : "false",
|
|
158
|
-
"aria-controls": L.value ? N : void 0,
|
|
159
|
-
"aria-label": Ae.value,
|
|
160
|
-
disabled: k.disabled || void 0
|
|
161
|
-
})), Fe = f(() => ({
|
|
162
|
-
type: "button",
|
|
163
|
-
disabled: R.value === 0 && !k.markAllPending,
|
|
164
|
-
"aria-disabled": k.markAllPending ? "true" : void 0,
|
|
165
|
-
"aria-busy": k.markAllPending ? "true" : void 0,
|
|
166
|
-
onClick: at
|
|
167
|
-
})), Ie = f(() => Ne.value || z.value === "error" ? Ee : void 0);
|
|
168
|
-
function Le(e) {
|
|
169
|
-
if (!e) {
|
|
170
|
-
F.value = null;
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
let t = e instanceof HTMLElement ? e : e.$el;
|
|
174
|
-
F.value = t instanceof HTMLElement ? t : null;
|
|
175
|
-
}
|
|
176
|
-
let V = S({
|
|
177
|
-
top: 0,
|
|
178
|
-
left: 0,
|
|
179
|
-
side: "bottom",
|
|
180
|
-
maxListHeight: k.maxHeight
|
|
181
|
-
});
|
|
182
|
-
function Re() {
|
|
183
|
-
return {
|
|
184
|
-
width: window.innerWidth,
|
|
185
|
-
height: window.innerHeight
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
function H() {
|
|
189
|
-
let e = P.value?.getBoundingClientRect();
|
|
190
|
-
e && (V.value = Se(e, {
|
|
191
|
-
align: k.align,
|
|
192
|
-
side: k.side,
|
|
193
|
-
width: k.width,
|
|
194
|
-
maxHeight: k.maxHeight,
|
|
195
|
-
viewport: Re()
|
|
196
|
-
}));
|
|
197
|
-
}
|
|
198
|
-
let { phone: ze } = n(), U = f(() => ze.value), Be = f(() => {
|
|
199
|
-
if (!U.value) return V.value.bottom === void 0 ? {
|
|
200
|
-
top: `${Math.round(V.value.top)}px`,
|
|
201
|
-
left: `${Math.round(V.value.left)}px`,
|
|
202
|
-
width: `${k.width}px`
|
|
203
|
-
} : {
|
|
204
|
-
bottom: `${Math.round(V.value.bottom)}px`,
|
|
205
|
-
left: `${Math.round(V.value.left)}px`,
|
|
206
|
-
width: `${k.width}px`
|
|
207
|
-
};
|
|
208
|
-
}), Ve = f(() => U.value ? void 0 : { maxHeight: `${Math.round(V.value.maxListHeight)}px` }), He = f(() => ({
|
|
209
|
-
"nb-notification-center__panel--sheet": U.value,
|
|
210
|
-
"nb-notification-center__panel--start": k.align === "start",
|
|
211
|
-
"nb-notification-center__panel--above": !U.value && V.value.side === "top",
|
|
212
|
-
"nb-notification-center__panel--beside": !U.value && V.value.side === "right"
|
|
213
|
-
}));
|
|
214
|
-
function Ue(e) {
|
|
215
|
-
k.open === void 0 && (Oe.value = e), j("update:open", e);
|
|
216
|
-
}
|
|
217
|
-
function W() {
|
|
218
|
-
k.disabled || L.value || (H(), Ue(!0), j("open"));
|
|
219
|
-
}
|
|
220
|
-
function G(e = {}) {
|
|
221
|
-
if (!L.value) return;
|
|
222
|
-
let t = I.value?.contains(document.activeElement);
|
|
223
|
-
Ue(!1), j("close"), (e.restoreFocus ?? t) && y(We);
|
|
224
|
-
}
|
|
225
|
-
function We() {
|
|
226
|
-
let e = F.value;
|
|
227
|
-
if (e?.isConnected) {
|
|
228
|
-
e.focus();
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
(P.value?.querySelector(Ze))?.focus();
|
|
232
|
-
}
|
|
233
|
-
function Ge() {
|
|
234
|
-
L.value ? G({ restoreFocus: !0 }) : W();
|
|
235
|
-
}
|
|
236
|
-
let K = S(0), Ke = new Set([
|
|
237
|
-
"button",
|
|
238
|
-
"link",
|
|
239
|
-
"menuitem",
|
|
240
|
-
"option"
|
|
241
|
-
]);
|
|
242
|
-
function qe(e) {
|
|
243
|
-
if (e.tagName === "BUTTON") return !e.hasAttribute("disabled");
|
|
244
|
-
if (e.tagName === "A") return e.hasAttribute("href");
|
|
245
|
-
let t = e.getAttribute("role");
|
|
246
|
-
return t !== null && Ke.has(t);
|
|
247
|
-
}
|
|
248
|
-
function q() {
|
|
249
|
-
return I.value ? Array.from(I.value.querySelectorAll("[data-nb-notification-item]")).filter((e) => !!qe(e)) : [];
|
|
250
|
-
}
|
|
251
|
-
let Je = S(void 0);
|
|
252
|
-
function Ye(e) {
|
|
253
|
-
let t = De.value;
|
|
254
|
-
Je.value = t && t.childElementCount > 0 && e.length === 0 ? 0 : void 0;
|
|
255
|
-
}
|
|
256
|
-
function J(e) {
|
|
257
|
-
let t = q();
|
|
258
|
-
Ye(t), t.length && (K.value = Math.min(Math.max(e, 0), t.length - 1), t.forEach((e, t) => {
|
|
259
|
-
e.setAttribute("tabindex", t === K.value ? "0" : "-1");
|
|
260
|
-
}));
|
|
261
|
-
}
|
|
262
|
-
function Y(e) {
|
|
263
|
-
let t = q();
|
|
264
|
-
if (!t.length) return !1;
|
|
265
|
-
let n = Math.min(Math.max(e, 0), t.length - 1);
|
|
266
|
-
return J(n), t[n]?.focus(), !0;
|
|
267
|
-
}
|
|
268
|
-
function Xe(e) {
|
|
269
|
-
let t = e.target?.closest("[data-nb-notification-item]");
|
|
270
|
-
if (!t) return;
|
|
271
|
-
let n = q().indexOf(t);
|
|
272
|
-
n >= 0 && J(n);
|
|
273
|
-
}
|
|
274
|
-
let Ze = "a[href]:not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex=\"0\"]";
|
|
275
|
-
function Qe(e) {
|
|
276
|
-
return !!e?.closest?.("input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]");
|
|
277
|
-
}
|
|
278
|
-
function $e(e) {
|
|
279
|
-
let t = q(), n = e.target?.closest("[data-nb-notification-item]"), r = n ? t.indexOf(n) : -1;
|
|
280
|
-
if (e.key === "Escape") {
|
|
281
|
-
if (!et(e)) return;
|
|
282
|
-
e.preventDefault(), e.stopPropagation(), G({ restoreFocus: !0 });
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
if (e.key === "Tab") {
|
|
286
|
-
tt(e);
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
if (!Qe(e.target)) switch (e.key) {
|
|
290
|
-
case "ArrowDown":
|
|
291
|
-
Y(r < 0 ? 0 : r + 1) && e.preventDefault();
|
|
292
|
-
break;
|
|
293
|
-
case "ArrowUp":
|
|
294
|
-
Y(r < 0 ? t.length - 1 : r - 1) && e.preventDefault();
|
|
295
|
-
break;
|
|
296
|
-
case "Home":
|
|
297
|
-
r >= 0 && (e.preventDefault(), Y(0));
|
|
298
|
-
break;
|
|
299
|
-
case "End":
|
|
300
|
-
r >= 0 && (e.preventDefault(), Y(t.length - 1));
|
|
301
|
-
break;
|
|
302
|
-
default: break;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
function et(e) {
|
|
306
|
-
if (e.defaultPrevented) return !1;
|
|
307
|
-
let t = (e.target ?? document.activeElement)?.closest?.("[aria-modal=\"true\"]");
|
|
308
|
-
return !(t && t !== I.value);
|
|
309
|
-
}
|
|
310
|
-
function tt(e) {
|
|
311
|
-
let t = I.value;
|
|
312
|
-
if (!t) return;
|
|
313
|
-
let n = Array.from(t.querySelectorAll(Ze)), r = document.activeElement, i = n[0], a = n[n.length - 1], o = !n.length || r === i || !t.contains(r), s = !n.length || r === a;
|
|
314
|
-
if (e.shiftKey ? !o : !s) return;
|
|
315
|
-
e.preventDefault();
|
|
316
|
-
let c = e.shiftKey ? F.value : nt();
|
|
317
|
-
G({ restoreFocus: !1 }), y(() => {
|
|
318
|
-
c?.isConnected ? c.focus() : We();
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
function nt() {
|
|
322
|
-
let e = F.value;
|
|
323
|
-
if (!e) return null;
|
|
324
|
-
let t = Array.from(document.querySelectorAll(Ze)).filter((e) => !I.value?.contains(e)).filter((e) => e.tabIndex >= 0), n = t.indexOf(e);
|
|
325
|
-
return n < 0 ? null : t[n + 1] ?? null;
|
|
326
|
-
}
|
|
327
|
-
function rt(e, t) {
|
|
328
|
-
j("select", e, t), k.closeOnSelect && G({ restoreFocus: !1 });
|
|
329
|
-
}
|
|
330
|
-
function it(e) {
|
|
331
|
-
if (!M.default) return;
|
|
332
|
-
let t = e.target?.closest("[data-nb-notification-item]");
|
|
333
|
-
if (t && qe(t)) {
|
|
334
|
-
if (e.type === "keydown") {
|
|
335
|
-
let n = e.key;
|
|
336
|
-
if (n !== "Enter" && n !== " " || t.tagName === "BUTTON" || t.tagName === "A") return;
|
|
337
|
-
e.preventDefault();
|
|
338
|
-
}
|
|
339
|
-
j("select", null, e), k.closeOnSelect && G({ restoreFocus: !1 });
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
function at() {
|
|
343
|
-
k.markAllPending || j("mark-all-read");
|
|
344
|
-
}
|
|
345
|
-
function ot(e) {
|
|
346
|
-
let t = e.target;
|
|
347
|
-
P.value?.contains(t) || I.value?.contains(t) || G({ restoreFocus: !1 });
|
|
348
|
-
}
|
|
349
|
-
function st(e) {
|
|
350
|
-
e.key === "Escape" && (I.value?.contains(document.activeElement) || et(e) && G({ restoreFocus: P.value?.contains(document.activeElement) ?? !1 }));
|
|
351
|
-
}
|
|
352
|
-
let X = 0;
|
|
353
|
-
function Z() {
|
|
354
|
-
!L.value || X || (X = requestAnimationFrame(() => {
|
|
355
|
-
X = 0, lt();
|
|
356
|
-
}));
|
|
357
|
-
}
|
|
358
|
-
function ct() {
|
|
359
|
-
X &&= (cancelAnimationFrame(X), 0);
|
|
360
|
-
}
|
|
361
|
-
function lt() {
|
|
362
|
-
if (!L.value || U.value) return;
|
|
363
|
-
let e = P.value?.getBoundingClientRect();
|
|
364
|
-
if (e && !Ce(e, Re())) {
|
|
365
|
-
G({ restoreFocus: !1 });
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
H();
|
|
369
|
-
}
|
|
370
|
-
function Q() {
|
|
371
|
-
k.closeOnNavigate && G({ restoreFocus: !1 });
|
|
372
|
-
}
|
|
373
|
-
function ut() {
|
|
374
|
-
return window.navigation;
|
|
375
|
-
}
|
|
376
|
-
function dt() {
|
|
377
|
-
document.addEventListener("mousedown", ot), document.addEventListener("keydown", st), window.addEventListener("resize", Z), window.addEventListener("scroll", Z, !0), window.addEventListener("popstate", Q), window.addEventListener("hashchange", Q), ut()?.addEventListener("navigate", Q);
|
|
378
|
-
}
|
|
379
|
-
function ft() {
|
|
380
|
-
ct(), document.removeEventListener("mousedown", ot), document.removeEventListener("keydown", st), window.removeEventListener("resize", Z), window.removeEventListener("scroll", Z, !0), window.removeEventListener("popstate", Q), window.removeEventListener("hashchange", Q), ut()?.removeEventListener("navigate", Q);
|
|
381
|
-
}
|
|
382
|
-
let $ = () => G({ restoreFocus: !1 });
|
|
383
|
-
return le(L, (e) => {
|
|
384
|
-
if (e) {
|
|
385
|
-
for (let e of [...T]) e !== $ && e();
|
|
386
|
-
T.add($), dt(), y(() => {
|
|
387
|
-
H(), J(0), Y(0) || I.value?.focus();
|
|
388
|
-
});
|
|
389
|
-
} else T.delete($), ft(), K.value = 0;
|
|
390
|
-
}), le(() => [k.items.length, z.value], () => {
|
|
391
|
-
L.value && y(() => J(K.value));
|
|
392
|
-
}), ie(() => {
|
|
393
|
-
ft(), T.delete($);
|
|
394
|
-
let e = I.value;
|
|
395
|
-
e?.isConnected && e.remove();
|
|
396
|
-
}), E({
|
|
397
|
-
show: W,
|
|
398
|
-
close: G,
|
|
399
|
-
toggle: Ge,
|
|
400
|
-
isOpen: L,
|
|
401
|
-
unreadCount: R
|
|
402
|
-
}), (n, r) => (x(), h("div", {
|
|
403
|
-
ref_key: "rootRef",
|
|
404
|
-
ref: P,
|
|
405
|
-
class: "nb-notification-center"
|
|
406
|
-
}, [C(n.$slots, "trigger", {
|
|
407
|
-
open: L.value,
|
|
408
|
-
toggle: Ge,
|
|
409
|
-
show: W,
|
|
410
|
-
close: G,
|
|
411
|
-
unreadCount: R.value,
|
|
412
|
-
badge: ke.value,
|
|
413
|
-
panelId: N,
|
|
414
|
-
triggerProps: Pe.value,
|
|
415
|
-
setTriggerRef: Le
|
|
416
|
-
}, () => [_(e, ne({
|
|
417
|
-
ref: Le,
|
|
418
|
-
class: ["nb-notification-center__trigger", { "nb-notification-center__trigger--active": L.value }],
|
|
419
|
-
variant: "ghost",
|
|
420
|
-
size: "sm",
|
|
421
|
-
icon: A.value,
|
|
422
|
-
label: v.label
|
|
423
|
-
}, Pe.value, { onClick: Ge }), null, 16, [
|
|
424
|
-
"class",
|
|
425
|
-
"icon",
|
|
426
|
-
"label"
|
|
427
|
-
]), R.value > 0 ? (x(), h("span", pe, w(ke.value), 1)) : m("", !0)]), (x(), p(u, { to: "body" }, [_(d, { name: "nb-notification-center-pop" }, {
|
|
428
|
-
default: ue(() => [L.value ? (x(), h("div", {
|
|
429
|
-
key: 0,
|
|
430
|
-
id: N,
|
|
431
|
-
ref_key: "panelRef",
|
|
432
|
-
ref: I,
|
|
433
|
-
class: re(["nb-notification-center__panel", He.value]),
|
|
434
|
-
style: b(Be.value),
|
|
435
|
-
role: "dialog",
|
|
436
|
-
tabindex: "-1",
|
|
437
|
-
"aria-labelledby": we,
|
|
438
|
-
"aria-describedby": Ie.value,
|
|
439
|
-
"aria-busy": v.loading ? "true" : void 0,
|
|
440
|
-
onKeydown: $e,
|
|
441
|
-
onFocusin: Xe
|
|
442
|
-
}, [
|
|
443
|
-
g("div", he, [
|
|
444
|
-
g("h2", {
|
|
445
|
-
id: we,
|
|
446
|
-
class: "nb-notification-center__title"
|
|
447
|
-
}, w(v.label), 1),
|
|
448
|
-
C(n.$slots, "header-start", {
|
|
449
|
-
close: G,
|
|
450
|
-
unreadCount: R.value
|
|
451
|
-
}),
|
|
452
|
-
C(n.$slots, "header-actions", {
|
|
453
|
-
close: G,
|
|
454
|
-
unreadCount: R.value,
|
|
455
|
-
markAllRead: at,
|
|
456
|
-
markAllPending: v.markAllPending,
|
|
457
|
-
markAllProps: Fe.value,
|
|
458
|
-
markAllText: v.markAllPending ? v.markAllPendingLabel : v.markAllLabel
|
|
459
|
-
}, () => [v.showMarkAll ? (x(), h("button", ne({
|
|
460
|
-
key: 0,
|
|
461
|
-
class: "nb-notification-center__mark-all"
|
|
462
|
-
}, Fe.value), [v.markAllPending ? (x(), p(i, {
|
|
463
|
-
key: 0,
|
|
464
|
-
size: "xs",
|
|
465
|
-
tone: "inherit",
|
|
466
|
-
decorative: ""
|
|
467
|
-
})) : m("", !0), te(" " + w(v.markAllPending ? v.markAllPendingLabel : v.markAllLabel), 1)], 16)) : m("", !0)]),
|
|
468
|
-
U.value ? (x(), p(o, {
|
|
469
|
-
key: 0,
|
|
470
|
-
class: "nb-notification-center__close",
|
|
471
|
-
size: "lg",
|
|
472
|
-
label: v.closeLabel ?? oe(O).notificationCenterClose,
|
|
473
|
-
onClick: r[0] ||= (e) => G()
|
|
474
|
-
}, null, 8, ["label"])) : m("", !0)
|
|
475
|
-
]),
|
|
476
|
-
g("span", ge, w(v.markAllPending ? v.markAllPendingLabel : ""), 1),
|
|
477
|
-
Ne.value ? (x(), h("div", {
|
|
478
|
-
key: 0,
|
|
479
|
-
id: Ee,
|
|
480
|
-
class: "nb-notification-center__stale",
|
|
481
|
-
role: "status"
|
|
482
|
-
}, [
|
|
483
|
-
_(t, {
|
|
484
|
-
name: oe(de),
|
|
485
|
-
size: "sm",
|
|
486
|
-
"aria-hidden": "true"
|
|
487
|
-
}, null, 8, ["name"]),
|
|
488
|
-
g("span", _e, w(v.errorStaleLabel), 1),
|
|
489
|
-
v.showRetry ? (x(), h("button", {
|
|
490
|
-
key: 0,
|
|
491
|
-
type: "button",
|
|
492
|
-
class: "nb-notification-center__retry",
|
|
493
|
-
onClick: B
|
|
494
|
-
}, w(v.retryLabel), 1)) : m("", !0)
|
|
495
|
-
])) : m("", !0),
|
|
496
|
-
z.value === "loading" ? (x(), h("div", {
|
|
497
|
-
key: 1,
|
|
498
|
-
class: "nb-notification-center__loading",
|
|
499
|
-
role: "status",
|
|
500
|
-
style: b(Ve.value)
|
|
501
|
-
}, [g("span", ve, w(v.loadingLabel), 1), (x(), h(l, null, ae(3, (e) => _(s, {
|
|
502
|
-
key: e,
|
|
503
|
-
variant: "text",
|
|
504
|
-
type: "body-sm",
|
|
505
|
-
lines: 2,
|
|
506
|
-
"last-line-width": "60%"
|
|
507
|
-
})), 64))], 4)) : z.value === "error" ? (x(), h("div", {
|
|
508
|
-
key: 2,
|
|
509
|
-
id: Ee,
|
|
510
|
-
class: "nb-notification-center__error",
|
|
511
|
-
role: "alert"
|
|
512
|
-
}, [C(n.$slots, "error", { retry: B }, () => [_(a, {
|
|
513
|
-
size: "sm",
|
|
514
|
-
kind: "error",
|
|
515
|
-
title: v.errorTitle,
|
|
516
|
-
description: v.errorDescription
|
|
517
|
-
}, ee({ _: 2 }, [v.showRetry ? {
|
|
518
|
-
name: "actions",
|
|
519
|
-
fn: ue(() => [_(e, {
|
|
520
|
-
size: "sm",
|
|
521
|
-
variant: "secondary",
|
|
522
|
-
onClick: B
|
|
523
|
-
}, {
|
|
524
|
-
default: ue(() => [te(w(v.retryLabel), 1)]),
|
|
525
|
-
_: 1
|
|
526
|
-
})]),
|
|
527
|
-
key: "0"
|
|
528
|
-
} : void 0]), 1032, ["title", "description"])])])) : z.value === "list" ? (x(), h("ul", {
|
|
529
|
-
key: 3,
|
|
530
|
-
ref_key: "listRef",
|
|
531
|
-
ref: De,
|
|
532
|
-
class: "nb-notification-center__list",
|
|
533
|
-
role: "list",
|
|
534
|
-
tabindex: Je.value,
|
|
535
|
-
style: b(Ve.value),
|
|
536
|
-
onClick: it,
|
|
537
|
-
onKeydown: it
|
|
538
|
-
}, [C(n.$slots, "default", {
|
|
539
|
-
close: G,
|
|
540
|
-
items: v.items
|
|
541
|
-
}, () => [(x(!0), h(l, null, ae(v.items, (e) => (x(), p(c, {
|
|
542
|
-
key: e.id,
|
|
543
|
-
title: e.title,
|
|
544
|
-
body: e.body,
|
|
545
|
-
time: e.time,
|
|
546
|
-
"time-label": e.timeLabel,
|
|
547
|
-
read: e.read,
|
|
548
|
-
variant: e.variant ?? "neutral",
|
|
549
|
-
icon: e.icon,
|
|
550
|
-
href: e.href,
|
|
551
|
-
interactive: e.interactive ?? v.interactive,
|
|
552
|
-
locale: v.locale,
|
|
553
|
-
"unread-label": v.unreadLabel,
|
|
554
|
-
"read-label": v.readLabel,
|
|
555
|
-
onSelect: (t) => rt(e, t)
|
|
556
|
-
}, null, 8, [
|
|
557
|
-
"title",
|
|
558
|
-
"body",
|
|
559
|
-
"time",
|
|
560
|
-
"time-label",
|
|
561
|
-
"read",
|
|
562
|
-
"variant",
|
|
563
|
-
"icon",
|
|
564
|
-
"href",
|
|
565
|
-
"interactive",
|
|
566
|
-
"locale",
|
|
567
|
-
"unread-label",
|
|
568
|
-
"read-label",
|
|
569
|
-
"onSelect"
|
|
570
|
-
]))), 128))])], 44, ye)) : z.value === "empty" ? (x(), h("div", be, [C(n.$slots, "empty", {}, () => [_(a, {
|
|
571
|
-
size: "sm",
|
|
572
|
-
icon: A.value,
|
|
573
|
-
title: v.emptyTitle,
|
|
574
|
-
description: v.emptyDescription
|
|
575
|
-
}, null, 8, [
|
|
576
|
-
"icon",
|
|
577
|
-
"title",
|
|
578
|
-
"description"
|
|
579
|
-
])])])) : m("", !0),
|
|
580
|
-
n.$slots.footer ? (x(), h("div", xe, [C(n.$slots, "footer", { close: G })])) : m("", !0)
|
|
581
|
-
], 46, me)) : m("", !0)]),
|
|
582
|
-
_: 3
|
|
583
|
-
})]))], 512));
|
|
584
|
-
}
|
|
585
|
-
});
|
|
586
|
-
//#endregion
|
|
587
|
-
export { j as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-5ClGtoaz.cjs`),n=require(`./Icon-CssV4E2-.cjs`),r=require(`./composables/usePhoneLayout.composable.cjs`),i=require(`./composables/useNbStrings.composable.cjs`),a=require(`./Spinner-j13gRoUF.cjs`),o=require(`./EmptyState-1ZLgFpJO.cjs`),s=require(`./CloseButton-F7W1E8oX.cjs`),c=require(`./Skeleton-D46kzIzB.cjs`),l=require(`./NotificationCenterItem--0XKF1Bf.cjs`);let u=require(`vue`),d=require(`@nubisco/ui/icons/warning-circle`),f=require(`@nubisco/ui/icons/bell`);f=e.n(f);var p={key:0,class:`nb-notification-center__badge`,"aria-hidden":`true`},ee=[`aria-describedby`,`aria-busy`],te={class:`nb-notification-center__header`},ne={class:`nb-notification-center__sr`,role:`status`},re={class:`nb-notification-center__stale-text`},ie={class:`nb-notification-center__sr`},ae=[`tabindex`],oe={key:4,class:`nb-notification-center__empty`},se={key:5,class:`nb-notification-center__footer`},m=new Set,h=8,g=8,_=96,v=88,y=200;function ce(e,{align:t,side:n,width:r,maxHeight:i,viewport:a}){let o=e.left+e.width;if(n===`right`&&a.width-o-h-g>=r){let n=e.top+e.height,r=t===`end`?n-g:a.height-e.top-g,s=Math.max(v+_,r),c=Math.min(i+_,s),l=Math.max(v,Math.min(i,s-_));return t===`end`?{top:Math.max(g,n-c),bottom:Math.max(g,a.height-n),left:o+h,side:`right`,maxListHeight:l}:{top:Math.max(g,Math.min(e.top,a.height-g-c)),left:o+h,side:`right`,maxListHeight:l}}let s=t===`start`?e.left:e.left+e.width-r,c=Math.min(Math.max(s,g),Math.max(g,a.width-r-g)),l=e.top+e.height,u=a.height-l-h-g,d=e.top-h-g,f=u<y&&d>u?`top`:`bottom`,p=Math.max(v,f===`top`?d:u),ee=Math.max(v,Math.min(i,p-_)),te=Math.min(i+_,p);return{top:f===`top`?Math.max(g,e.top-h-te):l+h,left:c,side:f,maxListHeight:ee}}function le(e,t){return e.left<=t.width&&e.left+e.width>=0&&e.top<=t.height&&e.top+e.height>=0}var b=(0,u.defineComponent)({__name:`NotificationCenter`,props:{items:{default:()=>[]},unreadCount:{default:void 0},itemCount:{default:void 0},open:{type:Boolean,default:void 0},label:{default:`Notifications`},markAllLabel:{default:`Mark all as read`},markAllPendingLabel:{default:`Marking all as read`},markAllPending:{type:Boolean,default:!1},emptyTitle:{default:`No notifications`},emptyDescription:{default:`New activity shows up here.`},loadingLabel:{default:`Loading notifications`},loading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},errorTitle:{default:`Could not load notifications`},errorDescription:{default:`The request failed. Nothing has been lost.`},errorStaleLabel:{default:`These may be out of date.`},retryLabel:{default:`Try again`},showRetry:{type:Boolean,default:!0},maxCount:{default:99},width:{default:360},closeLabel:{default:void 0},maxHeight:{default:384},align:{default:`end`},side:{default:`vertical`},showMarkAll:{type:Boolean,default:!0},interactive:{type:Boolean,default:!0},closeOnSelect:{type:Boolean,default:!0},closeOnNavigate:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},icon:{default:void 0},locale:{default:void 0},unreadLabel:{default:`Unread`},readLabel:{default:`Read`},formatUnread:{type:Function,default:e=>`${e} unread`}},emits:[`update:open`,`open`,`close`,`select`,`mark-all-read`,`retry`],setup(e,{expose:h,emit:g}){let _=i.useNbStrings(),v=e,y=(0,u.computed)(()=>v.icon??f),b=g,x=(0,u.useSlots)(),S=`nb-notification-center-${(0,u.useId)()}`,C=`${S}-title`,ue=`${S}-trigger`,w=`${S}-error`,T=(0,u.ref)(null),de=(0,u.ref)(null),E=(0,u.ref)(null),D=(0,u.ref)(null),O=(0,u.ref)(!1),k=(0,u.computed)(()=>v.open===void 0?O.value:v.open),A=(0,u.computed)(()=>typeof v.unreadCount==`number`?Math.max(0,v.unreadCount):v.items.filter(e=>!e.read).length),fe=(0,u.computed)(()=>A.value>v.maxCount?`${v.maxCount}+`:String(A.value)),pe=(0,u.computed)(()=>A.value>0?`${v.label}, ${v.formatUnread(A.value)}`:v.label),me=(0,u.computed)(()=>{if(typeof v.itemCount==`number`)return Math.max(0,v.itemCount);if(!x.default)return v.items.length}),he=(0,u.computed)(()=>(me.value??0)>0),j=(0,u.computed)(()=>{if(v.loading)return`loading`;let e=me.value;return v.error&&(e===void 0||e===0)?`error`:e===void 0||e>0?`list`:`empty`}),M=(0,u.computed)(()=>v.error&&!v.loading&&j.value===`list`&&he.value);(0,u.ref)(!1),(0,u.watch)(()=>[k.value,!!x.default,v.itemCount],([e,t,n])=>{},{immediate:!0});function N(){b(`retry`)}let P=(0,u.computed)(()=>({id:ue,"aria-haspopup":`dialog`,"aria-expanded":k.value?`true`:`false`,"aria-controls":k.value?S:void 0,"aria-label":pe.value,disabled:v.disabled||void 0})),F=(0,u.computed)(()=>({type:`button`,disabled:A.value===0&&!v.markAllPending,"aria-disabled":v.markAllPending?`true`:void 0,"aria-busy":v.markAllPending?`true`:void 0,onClick:Pe})),ge=(0,u.computed)(()=>M.value||j.value===`error`?w:void 0);function I(e){if(!e){E.value=null;return}let t=e instanceof HTMLElement?e:e.$el;E.value=t instanceof HTMLElement?t:null}let L=(0,u.ref)({top:0,left:0,side:`bottom`,maxListHeight:v.maxHeight});function R(){return{width:window.innerWidth,height:window.innerHeight}}function z(){let e=T.value?.getBoundingClientRect();e&&(L.value=ce(e,{align:v.align,side:v.side,width:v.width,maxHeight:v.maxHeight,viewport:R()}))}let{phone:_e}=r.usePhoneLayout(),B=(0,u.computed)(()=>_e.value),ve=(0,u.computed)(()=>{if(!B.value)return L.value.bottom===void 0?{top:`${Math.round(L.value.top)}px`,left:`${Math.round(L.value.left)}px`,width:`${v.width}px`}:{bottom:`${Math.round(L.value.bottom)}px`,left:`${Math.round(L.value.left)}px`,width:`${v.width}px`}}),ye=(0,u.computed)(()=>B.value?void 0:{maxHeight:`${Math.round(L.value.maxListHeight)}px`}),be=(0,u.computed)(()=>({"nb-notification-center__panel--sheet":B.value,"nb-notification-center__panel--start":v.align===`start`,"nb-notification-center__panel--above":!B.value&&L.value.side===`top`,"nb-notification-center__panel--beside":!B.value&&L.value.side===`right`}));function xe(e){v.open===void 0&&(O.value=e),b(`update:open`,e)}function V(){v.disabled||k.value||(z(),xe(!0),b(`open`))}function H(e={}){if(!k.value)return;let t=D.value?.contains(document.activeElement);xe(!1),b(`close`),(e.restoreFocus??t)&&(0,u.nextTick)(U)}function U(){let e=E.value;if(e?.isConnected){e.focus();return}(T.value?.querySelector(Y))?.focus()}function W(){k.value?H({restoreFocus:!0}):V()}let G=(0,u.ref)(0),Se=new Set([`button`,`link`,`menuitem`,`option`]);function Ce(e){if(e.tagName===`BUTTON`)return!e.hasAttribute(`disabled`);if(e.tagName===`A`)return e.hasAttribute(`href`);let t=e.getAttribute(`role`);return t!==null&&Se.has(t)}function K(){return D.value?Array.from(D.value.querySelectorAll(`[data-nb-notification-item]`)).filter(e=>!!Ce(e)):[]}let we=(0,u.ref)(void 0);function Te(e){let t=de.value;we.value=t&&t.childElementCount>0&&e.length===0?0:void 0}function q(e){let t=K();Te(t),t.length&&(G.value=Math.min(Math.max(e,0),t.length-1),t.forEach((e,t)=>{e.setAttribute(`tabindex`,t===G.value?`0`:`-1`)}))}function J(e){let t=K();if(!t.length)return!1;let n=Math.min(Math.max(e,0),t.length-1);return q(n),t[n]?.focus(),!0}function Ee(e){let t=e.target?.closest(`[data-nb-notification-item]`);if(!t)return;let n=K().indexOf(t);n>=0&&q(n)}let Y=`a[href]:not([tabindex="-1"]), button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex="0"]`;function De(e){return!!e?.closest?.(`input, textarea, select, [contenteditable=""], [contenteditable="true"]`)}function Oe(e){let t=K(),n=e.target?.closest(`[data-nb-notification-item]`),r=n?t.indexOf(n):-1;if(e.key===`Escape`){if(!ke(e))return;e.preventDefault(),e.stopPropagation(),H({restoreFocus:!0});return}if(e.key===`Tab`){Ae(e);return}if(!De(e.target))switch(e.key){case`ArrowDown`:J(r<0?0:r+1)&&e.preventDefault();break;case`ArrowUp`:J(r<0?t.length-1:r-1)&&e.preventDefault();break;case`Home`:r>=0&&(e.preventDefault(),J(0));break;case`End`:r>=0&&(e.preventDefault(),J(t.length-1));break;default:break}}function ke(e){if(e.defaultPrevented)return!1;let t=(e.target??document.activeElement)?.closest?.(`[aria-modal="true"]`);return!(t&&t!==D.value)}function Ae(e){let t=D.value;if(!t)return;let n=Array.from(t.querySelectorAll(Y)),r=document.activeElement,i=n[0],a=n[n.length-1],o=!n.length||r===i||!t.contains(r),s=!n.length||r===a;if(e.shiftKey?!o:!s)return;e.preventDefault();let c=e.shiftKey?E.value:je();H({restoreFocus:!1}),(0,u.nextTick)(()=>{c?.isConnected?c.focus():U()})}function je(){let e=E.value;if(!e)return null;let t=Array.from(document.querySelectorAll(Y)).filter(e=>!D.value?.contains(e)).filter(e=>e.tabIndex>=0),n=t.indexOf(e);return n<0?null:t[n+1]??null}function Me(e,t){b(`select`,e,t),v.closeOnSelect&&H({restoreFocus:!1})}function Ne(e){if(!x.default)return;let t=e.target?.closest(`[data-nb-notification-item]`);if(t&&Ce(t)){if(e.type===`keydown`){let n=e.key;if(n!==`Enter`&&n!==` `||t.tagName===`BUTTON`||t.tagName===`A`)return;e.preventDefault()}b(`select`,null,e),v.closeOnSelect&&H({restoreFocus:!1})}}function Pe(){v.markAllPending||b(`mark-all-read`)}function Fe(e){let t=e.target;T.value?.contains(t)||D.value?.contains(t)||H({restoreFocus:!1})}function Ie(e){e.key===`Escape`&&(D.value?.contains(document.activeElement)||ke(e)&&H({restoreFocus:T.value?.contains(document.activeElement)??!1}))}let X=0;function Z(){!k.value||X||(X=requestAnimationFrame(()=>{X=0,Re()}))}function Le(){X&&=(cancelAnimationFrame(X),0)}function Re(){if(!k.value||B.value)return;let e=T.value?.getBoundingClientRect();if(e&&!le(e,R())){H({restoreFocus:!1});return}z()}function Q(){v.closeOnNavigate&&H({restoreFocus:!1})}function ze(){return window.navigation}function Be(){document.addEventListener(`mousedown`,Fe),document.addEventListener(`keydown`,Ie),window.addEventListener(`resize`,Z),window.addEventListener(`scroll`,Z,!0),window.addEventListener(`popstate`,Q),window.addEventListener(`hashchange`,Q),ze()?.addEventListener(`navigate`,Q)}function Ve(){Le(),document.removeEventListener(`mousedown`,Fe),document.removeEventListener(`keydown`,Ie),window.removeEventListener(`resize`,Z),window.removeEventListener(`scroll`,Z,!0),window.removeEventListener(`popstate`,Q),window.removeEventListener(`hashchange`,Q),ze()?.removeEventListener(`navigate`,Q)}let $=()=>H({restoreFocus:!1});return(0,u.watch)(k,e=>{if(e){for(let e of[...m])e!==$&&e();m.add($),Be(),(0,u.nextTick)(()=>{z(),q(0),J(0)||D.value?.focus()})}else m.delete($),Ve(),G.value=0}),(0,u.watch)(()=>[v.items.length,j.value],()=>{k.value&&(0,u.nextTick)(()=>q(G.value))}),(0,u.onBeforeUnmount)(()=>{Ve(),m.delete($);let e=D.value;e?.isConnected&&e.remove()}),h({show:V,close:H,toggle:W,isOpen:k,unreadCount:A}),(r,i)=>((0,u.openBlock)(),(0,u.createElementBlock)(`div`,{ref_key:`rootRef`,ref:T,class:`nb-notification-center`},[(0,u.renderSlot)(r.$slots,`trigger`,{open:k.value,toggle:W,show:V,close:H,unreadCount:A.value,badge:fe.value,panelId:S,triggerProps:P.value,setTriggerRef:I},()=>[(0,u.createVNode)(t.t,(0,u.mergeProps)({ref:I,class:[`nb-notification-center__trigger`,{"nb-notification-center__trigger--active":k.value}],variant:`ghost`,size:`sm`,icon:y.value,label:e.label},P.value,{onClick:W}),null,16,[`class`,`icon`,`label`]),A.value>0?((0,u.openBlock)(),(0,u.createElementBlock)(`span`,p,(0,u.toDisplayString)(fe.value),1)):(0,u.createCommentVNode)(``,!0)]),((0,u.openBlock)(),(0,u.createBlock)(u.Teleport,{to:`body`},[(0,u.createVNode)(u.Transition,{name:`nb-notification-center-pop`},{default:(0,u.withCtx)(()=>[k.value?((0,u.openBlock)(),(0,u.createElementBlock)(`div`,{key:0,id:S,ref_key:`panelRef`,ref:D,class:(0,u.normalizeClass)([`nb-notification-center__panel`,be.value]),style:(0,u.normalizeStyle)(ve.value),role:`dialog`,tabindex:`-1`,"aria-labelledby":C,"aria-describedby":ge.value,"aria-busy":e.loading?`true`:void 0,onKeydown:Oe,onFocusin:Ee},[(0,u.createElementVNode)(`div`,te,[(0,u.createElementVNode)(`h2`,{id:C,class:`nb-notification-center__title`},(0,u.toDisplayString)(e.label),1),(0,u.renderSlot)(r.$slots,`header-start`,{close:H,unreadCount:A.value}),(0,u.renderSlot)(r.$slots,`header-actions`,{close:H,unreadCount:A.value,markAllRead:Pe,markAllPending:e.markAllPending,markAllProps:F.value,markAllText:e.markAllPending?e.markAllPendingLabel:e.markAllLabel},()=>[e.showMarkAll?((0,u.openBlock)(),(0,u.createElementBlock)(`button`,(0,u.mergeProps)({key:0,class:`nb-notification-center__mark-all`},F.value),[e.markAllPending?((0,u.openBlock)(),(0,u.createBlock)(a.t,{key:0,size:`xs`,tone:`inherit`,decorative:``})):(0,u.createCommentVNode)(``,!0),(0,u.createTextVNode)(` `+(0,u.toDisplayString)(e.markAllPending?e.markAllPendingLabel:e.markAllLabel),1)],16)):(0,u.createCommentVNode)(``,!0)]),B.value?((0,u.openBlock)(),(0,u.createBlock)(s.t,{key:0,class:`nb-notification-center__close`,size:`lg`,label:e.closeLabel??(0,u.unref)(_).notificationCenterClose,onClick:i[0]||=e=>H()},null,8,[`label`])):(0,u.createCommentVNode)(``,!0)]),(0,u.createElementVNode)(`span`,ne,(0,u.toDisplayString)(e.markAllPending?e.markAllPendingLabel:``),1),M.value?((0,u.openBlock)(),(0,u.createElementBlock)(`div`,{key:0,id:w,class:`nb-notification-center__stale`,role:`status`},[(0,u.createVNode)(n.t,{name:(0,u.unref)(d.regular),size:`sm`,"aria-hidden":`true`},null,8,[`name`]),(0,u.createElementVNode)(`span`,re,(0,u.toDisplayString)(e.errorStaleLabel),1),e.showRetry?((0,u.openBlock)(),(0,u.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-notification-center__retry`,onClick:N},(0,u.toDisplayString)(e.retryLabel),1)):(0,u.createCommentVNode)(``,!0)])):(0,u.createCommentVNode)(``,!0),j.value===`loading`?((0,u.openBlock)(),(0,u.createElementBlock)(`div`,{key:1,class:`nb-notification-center__loading`,role:`status`,style:(0,u.normalizeStyle)(ye.value)},[(0,u.createElementVNode)(`span`,ie,(0,u.toDisplayString)(e.loadingLabel),1),((0,u.openBlock)(),(0,u.createElementBlock)(u.Fragment,null,(0,u.renderList)(3,e=>(0,u.createVNode)(c.t,{key:e,variant:`text`,type:`body-sm`,lines:2,"last-line-width":`60%`})),64))],4)):j.value===`error`?((0,u.openBlock)(),(0,u.createElementBlock)(`div`,{key:2,id:w,class:`nb-notification-center__error`,role:`alert`},[(0,u.renderSlot)(r.$slots,`error`,{retry:N},()=>[(0,u.createVNode)(o.t,{size:`sm`,kind:`error`,title:e.errorTitle,description:e.errorDescription},(0,u.createSlots)({_:2},[e.showRetry?{name:`actions`,fn:(0,u.withCtx)(()=>[(0,u.createVNode)(t.t,{size:`sm`,variant:`secondary`,onClick:N},{default:(0,u.withCtx)(()=>[(0,u.createTextVNode)((0,u.toDisplayString)(e.retryLabel),1)]),_:1})]),key:`0`}:void 0]),1032,[`title`,`description`])])])):j.value===`list`?((0,u.openBlock)(),(0,u.createElementBlock)(`ul`,{key:3,ref_key:`listRef`,ref:de,class:`nb-notification-center__list`,role:`list`,tabindex:we.value,style:(0,u.normalizeStyle)(ye.value),onClick:Ne,onKeydown:Ne},[(0,u.renderSlot)(r.$slots,`default`,{close:H,items:e.items},()=>[((0,u.openBlock)(!0),(0,u.createElementBlock)(u.Fragment,null,(0,u.renderList)(e.items,t=>((0,u.openBlock)(),(0,u.createBlock)(l.t,{key:t.id,title:t.title,body:t.body,time:t.time,"time-label":t.timeLabel,read:t.read,variant:t.variant??`neutral`,icon:t.icon,href:t.href,interactive:t.interactive??e.interactive,locale:e.locale,"unread-label":e.unreadLabel,"read-label":e.readLabel,onSelect:e=>Me(t,e)},null,8,[`title`,`body`,`time`,`time-label`,`read`,`variant`,`icon`,`href`,`interactive`,`locale`,`unread-label`,`read-label`,`onSelect`]))),128))])],44,ae)):j.value===`empty`?((0,u.openBlock)(),(0,u.createElementBlock)(`div`,oe,[(0,u.renderSlot)(r.$slots,`empty`,{},()=>[(0,u.createVNode)(o.t,{size:`sm`,icon:y.value,title:e.emptyTitle,description:e.emptyDescription},null,8,[`icon`,`title`,`description`])])])):(0,u.createCommentVNode)(``,!0),r.$slots.footer?((0,u.openBlock)(),(0,u.createElementBlock)(`div`,se,[(0,u.renderSlot)(r.$slots,`footer`,{close:H})])):(0,u.createCommentVNode)(``,!0)],46,ee)):(0,u.createCommentVNode)(``,!0)]),_:3})]))],512))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});
|
package/dist/Select-CPztC5IV.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-5ClGtoaz.cjs`),t=require(`./Icon-CssV4E2-.cjs`),n=require(`./composables/useNbStrings.composable.cjs`),r=require(`./Grid-tn5_R2fP.cjs`),ee=require(`./Label-CjxnZgNy.cjs`),i=require(`./Message-B1CQ0Bcf.cjs`),a=require(`./InputGroup.context-BHj-IvcT.cjs`),o=require(`./composables/useFieldMessage.composable.cjs`),te=require(`./composables/useMenuSurface.composable.cjs`);let s=require(`vue`),ne=require(`@nubisco/ui/icons/caret-down`),re=require(`@nubisco/ui/icons/x`),ie=require(`@nubisco/ui/icons/caret-up`);var ae=[`id`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`aria-disabled`,`aria-required`,`aria-invalid`,`aria-describedby`,`disabled`],oe={key:2,class:`nb-select__clear-space`,"aria-hidden":`true`},se=[`id`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`aria-disabled`,`aria-required`,`aria-invalid`,`aria-describedby`,`disabled`],ce={key:1,class:`nb-select__inner-label`},le={key:0,class:`nb-select__asterisk`,"aria-hidden":`true`},ue={key:0,class:`nb-select__clear-space`,"aria-hidden":`true`},de=[`id`,`aria-multiselectable`],fe={key:0,class:`nb-select__search`},pe=[`placeholder`,`aria-label`,`aria-controls`,`aria-activedescendant`],me=[`aria-labelledby`],he=[`id`],ge=[`id`,`data-index`,`aria-selected`,`aria-disabled`,`onMouseenter`,`onClick`],_e={key:0,class:`nb-select__option-check`,"aria-hidden":`true`},ve={key:0,viewBox:`0 0 10 8`,fill:`none`,width:`10`,height:`8`},ye={class:`nb-select__option-label`},be={key:1,class:`nb-select__empty`},xe={key:2,class:`nb-select__empty`},Se=[`placeholder`,`onKeydown`],c=(0,s.defineComponent)({inheritAttrs:!1,__name:`Select`,props:{modelValue:{default:null},options:{default:()=>[]},multiple:{type:Boolean,default:!1},creatable:{type:Boolean,default:!1},createPlaceholder:{default:``},clearable:{type:Boolean,default:!1},clearLabel:{default:void 0},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:`Search`},noResultsLabel:{default:`No results`},anchor:{type:[Function,null],default:null},selectedMark:{default:`fill`},placeholder:{default:`Select…`},name:{default:``},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{default:void 0},label:{default:``},error:{default:``},warning:{default:``},helper:{default:``},variant:{default:`default`},size:{default:`md`}},emits:[`update:modelValue`,`change`,`create`],setup(c,{expose:Ce,emit:we}){let l=c,u=we,d=(e,{slots:t})=>e.wrap?(0,s.h)(`div`,{class:`nb-select__control`},t.default?.()):t.default?.();d.props=[`wrap`];let f=(0,s.ref)(``),p=(0,s.ref)(``),m=(0,s.ref)(null);function Te(){let e=f.value.trim();e&&(u(`create`,e),f.value=``)}let h=(0,s.ref)(!1),g=(0,s.ref)(!1),_=(0,s.ref)(-1),v=(0,s.ref)(null),y=(0,s.ref)(null),b=(0,s.useSlots)(),Ee=()=>(typeof l.anchor==`function`?l.anchor():l.anchor)??y.value??v.value;function x(){(y.value??v.value?.querySelector(`button, [tabindex]`))?.focus()}let S=(0,s.ref)(null);te.useMenuSurface(S);let C=(0,s.ref)({position:`fixed`,top:`0px`,left:`0px`,width:`0px`,zIndex:`9999`}),w=a.n(l,`nb-select-${(0,s.useId)()}`),T=w.id,E=w.disabled,D=w.grouped,{ids:O,messageId:De,invalid:k,live:A,key:j}=o.useFieldMessage(l,T),M=(0,s.computed)(()=>o.joinDescribedBy(D?void 0:De.value,w.describedBy.value)),N=(0,s.computed)(()=>k.value??(w.status.value===`error`?`true`:void 0)),P=(0,s.computed)(()=>!D&&!!l.error||w.status.value===`error`),F=(0,s.computed)(()=>`${T.value}-listbox`),I=e=>`${T.value}-option-${e}`,L=(0,s.computed)(()=>h.value&&!l.searchable&&_.value>=0?I(_.value):void 0),R=(0,s.computed)(()=>l.modelValue==null?[]:Array.isArray(l.modelValue)?l.modelValue:[l.modelValue]),z=(0,s.computed)(()=>{if(!(l.multiple||R.value.length!==1))return(l.options??[]).find(e=>e.value===R.value[0])?.icon}),B=(0,s.computed)(()=>{if(R.value.length===0)return``;let e=l.options??[];return l.multiple?R.value.length===1?e.find(e=>e.value===R.value[0])?.label??String(R.value[0]):R.value.length===2?R.value.map(t=>e.find(e=>e.value===t)?.label??String(t)).join(`, `):`${R.value.length} selected`:e.find(e=>e.value===R.value[0])?.label??String(R.value[0])});function V(e){return R.value.includes(e)}let H=e=>e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase(),U=(0,s.computed)(()=>{let e=l.options??[],t=l.searchable?H(p.value.trim()):``,n=new Set;return e.forEach((e,r)=>{(!t||H(e.label).includes(t))&&n.add(r)}),n}),Oe=(0,s.computed)(()=>{let e=[];return(l.options??[]).forEach((t,n)=>{if(!U.value.has(n))return;let r=e[e.length-1];(!r||r.name!==t.group)&&e.push({key:`${e.length}:${t.group??``}`,name:t.group,labelId:`${T.value}-group-${e.length}`,entries:[]}),e[e.length-1].entries.push({option:t,index:n})}),e});function W(e,t){let n=l.options??[];for(let r=e+t;r>=0&&r<n.length;r+=t)if(!n[r].disabled&&U.value.has(r))return r;return e}function ke(e){if(e.disabled)return;let t;if(l.multiple){let n=[...R.value],r=n.indexOf(e.value);r>=0?n.splice(r,1):n.push(e.value),t=n}else t=e.value,q();u(`update:modelValue`,t),u(`change`,t)}function G(){let e=Ee();if(!e)return;let t=e.getBoundingClientRect(),n=S.value?.offsetHeight??0,r=window.innerHeight-t.bottom,ee=t.top,i=n>0&&r<n&&ee>r,a=b.trigger?Math.max(t.width,240):t.width,o=b.trigger?Math.max(8,Math.min(t.left,window.innerWidth-a-8)):t.left;C.value={position:`fixed`,top:i?`${t.top-n}px`:`${t.bottom}px`,left:`${o}px`,width:`${a}px`,zIndex:`9999`}}function K(){if(E.value)return;h.value=!0,G();let e=l.options??[];_.value=R.value.length>0?Math.max(0,e.findIndex(e=>e.value===R.value[0])):-1,(0,s.nextTick)(()=>{G(),Z(),m.value?.focus({preventScroll:!0})})}function q(){let e=!!S.value?.contains(document.activeElement);h.value=!1,_.value=-1,p.value=``,e&&x()}function J(){h.value?q():K()}function Y(e){let t=e.target,n=v.value?.contains(t)??!1,r=S.value?.contains(t)??!1;!n&&!r&&q()}function X(){h.value&&G()}(0,s.watch)(h,e=>{e?(document.addEventListener(`mousedown`,Y),window.addEventListener(`scroll`,X,!0),window.addEventListener(`resize`,X)):(document.removeEventListener(`mousedown`,Y),window.removeEventListener(`scroll`,X,!0),window.removeEventListener(`resize`,X))}),(0,s.onBeforeUnmount)(()=>{document.removeEventListener(`mousedown`,Y),window.removeEventListener(`scroll`,X,!0),window.removeEventListener(`resize`,X)});function Ae(e){let t=l.options??[];if(!h.value){(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),K());return}e.key===`Escape`?(q(),e.preventDefault()):e.key===`Tab`?q():e.key===`ArrowDown`?(e.preventDefault(),_.value=W(_.value,1),Z()):e.key===`ArrowUp`?(e.preventDefault(),_.value>0&&(_.value=W(_.value,-1)),Z()):(e.key===`Enter`||e.key===` `)&&_.value>=0&&(e.preventDefault(),ke(t[_.value]))}function Z(){(0,s.nextTick)(()=>{!S.value||_.value<0||S.value.querySelector(`[data-index="${_.value}"]`)?.scrollIntoView({block:`nearest`})})}(0,s.watch)(p,()=>{if(!h.value)return;let e=W(-1,1);_.value=e===-1?-1:e,Z()});function je(e){if(e.key===` `){e.stopPropagation();return}if(e.key===`Home`||e.key===`End`){e.stopPropagation();return}Ae(e)}let Me=(0,s.computed)(()=>({isOpen:h.value,toggle:J,open:K,close:q,attrs:{"aria-expanded":h.value,"aria-haspopup":`listbox`,"aria-controls":h.value?F.value:void 0,"aria-activedescendant":L.value,"aria-invalid":k.value,onClick:J}})),Ne=n.useNbStrings(),Pe=(0,s.computed)(()=>l.clearLabel??Ne.value.selectClear),Q=(0,s.computed)(()=>l.clearable&&!E.value&&R.value.length>0);function $(){let e=l.multiple?[]:null;q(),u(`update:modelValue`,e),u(`change`,e),x()}let Fe=(0,s.computed)(()=>[`nb-select`,`nb-select--${l.variant}`,`nb-select--${w.size.value}`,{"nb-select--open":h.value,"nb-select--focused":g.value&&!h.value,"nb-select--error":P.value,"nb-select--warning":!P.value&&(!D&&!!l.warning||w.status.value===`warning`),"nb-select--multiple":l.multiple,"nb-select--bare":!!b.trigger}]);return Ce({open:K,close:q}),(n,a)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createElementVNode)(`div`,(0,s.mergeProps)({ref_key:`rootRef`,ref:v},n.$attrs,{class:Fe.value,onKeydown:Ae}),[n.$slots.trigger?(0,s.renderSlot)(n.$slots,`trigger`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},Me.value))):c.variant===`default`?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:1},[n.$slots.label&&!(0,s.unref)(D)?(0,s.renderSlot)(n.$slots,`label`,{key:0}):c.label&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(ee.t,{key:1,for:(0,s.unref)(T),required:c.required,disabled:(0,s.unref)(E)},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.label),1)]),_:1},8,[`for`,`required`,`disabled`])):(0,s.createCommentVNode)(``,!0),(0,s.createVNode)(d,{wrap:c.clearable},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`button`,{id:(0,s.unref)(T),ref_key:`triggerRef`,ref:y,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":h.value,"aria-haspopup":`listbox`,"aria-controls":h.value?F.value:void 0,"aria-activedescendant":L.value,"aria-disabled":(0,s.unref)(E)||void 0,"aria-required":c.required||void 0,"aria-invalid":N.value,"aria-describedby":M.value,disabled:(0,s.unref)(E)||void 0,onClick:J,onFocus:a[0]||=e=>g.value=!0,onBlur:a[1]||=e=>g.value=!1},[(0,s.createElementVNode)(`span`,{class:(0,s.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!B.value,"nb-select__value--with-icon":!!z.value}])},[z.value?((0,s.openBlock)(),(0,s.createBlock)(t.t,{key:0,class:`nb-select__value-icon`,name:z.value,size:16},null,8,[`name`])):(0,s.createCommentVNode)(``,!0),B.value?(0,s.renderSlot)(n.$slots,`value`,{key:1,values:R.value},()=>[(0,s.createTextVNode)((0,s.toDisplayString)(B.value),1)]):((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:2},[(0,s.createTextVNode)((0,s.toDisplayString)(c.placeholder),1)],64))],2),c.error&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(i.t,{key:0,variant:`error`,"icon-only":!0,live:`off`,"aria-hidden":`true`,class:`nb-select__status-icon`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.error),1)]),_:1})):c.warning&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(i.t,{key:1,variant:`warning`,"icon-only":!0,live:`off`,"aria-hidden":`true`,class:`nb-select__status-icon`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.warning),1)]),_:1})):(0,s.createCommentVNode)(``,!0),Q.value?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,oe)):(0,s.createCommentVNode)(``,!0),(0,s.createVNode)(r.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(t.t,{name:h.value?(0,s.unref)(ie.regular):(0,s.unref)(ne.regular),size:16},null,8,[`name`])]),_:1})],40,ae),Q.value?((0,s.openBlock)(),(0,s.createBlock)(e.t,{key:0,variant:`ghost`,icon:(0,s.unref)(re.regular),size:`xs`,label:Pe.value,class:`nb-select__clear`,onClick:$,onKeydown:[a[2]||=(0,s.withKeys)((0,s.withModifiers)(()=>{},[`stop`]),[`enter`]),a[3]||=(0,s.withKeys)((0,s.withModifiers)(()=>{},[`stop`]),[`space`])]},null,8,[`icon`,`label`])):(0,s.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),c.error&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(i.t,{id:(0,s.unref)(O).error,key:(0,s.unref)(j),variant:`error`,live:(0,s.unref)(A),class:`nb-select__message`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.error),1)]),_:1},8,[`id`,`live`])):c.warning&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(i.t,{id:(0,s.unref)(O).warning,key:(0,s.unref)(j),variant:`warning`,live:(0,s.unref)(A),class:`nb-select__message`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.warning),1)]),_:1},8,[`id`,`live`])):c.helper&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(i.t,{id:(0,s.unref)(O).helper,key:(0,s.unref)(j),variant:`helper`,live:(0,s.unref)(A),class:`nb-select__message`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.helper),1)]),_:1},8,[`id`,`live`])):(0,s.createCommentVNode)(``,!0)],64)):c.variant===`fluid`?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:2},[(0,s.createVNode)(d,{wrap:c.clearable},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`button`,{id:(0,s.unref)(T),ref_key:`triggerRef`,ref:y,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":h.value,"aria-haspopup":`listbox`,"aria-controls":h.value?F.value:void 0,"aria-activedescendant":L.value,"aria-disabled":(0,s.unref)(E)||void 0,"aria-required":c.required||void 0,"aria-invalid":N.value,"aria-describedby":M.value,disabled:(0,s.unref)(E)||void 0,onClick:J,onFocus:a[4]||=e=>g.value=!0,onBlur:a[5]||=e=>g.value=!1},[(c.label||n.$slots.label)&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(r.t,{key:0,dir:`row`,align:`center`,gap:`xs`,class:`nb-select__inner-header`},{default:(0,s.withCtx)(()=>[n.$slots.label?(0,s.renderSlot)(n.$slots,`label`,{key:0}):((0,s.openBlock)(),(0,s.createElementBlock)(`label`,ce,[(0,s.createTextVNode)((0,s.toDisplayString)(c.label)+` `,1),c.required?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,le,`*`)):(0,s.createCommentVNode)(``,!0)])),c.helper&&!c.error&&!c.warning?((0,s.openBlock)(),(0,s.createBlock)(i.t,{key:2,id:(0,s.unref)(O).helper,variant:`helper`,"icon-only":!0,live:`off`,"aria-hidden":`true`,class:`nb-select__inner-message`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.helper),1)]),_:1},8,[`id`])):(0,s.createCommentVNode)(``,!0)]),_:3})):(0,s.createCommentVNode)(``,!0),(0,s.createVNode)(r.t,{dir:`row`,align:`end`,flex:``,class:`nb-select__value-row`},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`span`,{class:(0,s.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!B.value,"nb-select__value--with-icon":!!z.value}])},[z.value?((0,s.openBlock)(),(0,s.createBlock)(t.t,{key:0,class:`nb-select__value-icon`,name:z.value,size:16},null,8,[`name`])):(0,s.createCommentVNode)(``,!0),B.value?(0,s.renderSlot)(n.$slots,`value`,{key:1,values:R.value},()=>[(0,s.createTextVNode)((0,s.toDisplayString)(B.value),1)]):((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:2},[(0,s.createTextVNode)((0,s.toDisplayString)(c.placeholder),1)],64))],2),Q.value?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,ue)):(0,s.createCommentVNode)(``,!0),(0,s.createVNode)(r.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(t.t,{name:h.value?(0,s.unref)(ie.regular):(0,s.unref)(ne.regular),size:16},null,8,[`name`])]),_:1})]),_:3})],40,se),Q.value?((0,s.openBlock)(),(0,s.createBlock)(e.t,{key:0,variant:`ghost`,icon:(0,s.unref)(re.regular),size:`xs`,label:Pe.value,class:`nb-select__clear`,onClick:$,onKeydown:[a[6]||=(0,s.withKeys)((0,s.withModifiers)(()=>{},[`stop`]),[`enter`]),a[7]||=(0,s.withKeys)((0,s.withModifiers)(()=>{},[`stop`]),[`space`])]},null,8,[`icon`,`label`])):(0,s.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),c.error&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(i.t,{id:(0,s.unref)(O).error,key:(0,s.unref)(j),variant:`error`,live:(0,s.unref)(A),class:`nb-select__fluid-message`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.error),1)]),_:1},8,[`id`,`live`])):c.warning&&!(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)(i.t,{id:(0,s.unref)(O).warning,key:(0,s.unref)(j),variant:`warning`,live:(0,s.unref)(A),class:`nb-select__fluid-message`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(c.warning),1)]),_:1},8,[`id`,`live`])):(0,s.createCommentVNode)(``,!0)],64)):(0,s.createCommentVNode)(``,!0)],16),((0,s.openBlock)(),(0,s.createBlock)(s.Teleport,{to:`body`},[(0,s.createVNode)(s.Transition,{name:`nb-select-pop`},{default:(0,s.withCtx)(()=>[h.value?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:0,id:F.value,ref_key:`dropdownRef`,ref:S,class:(0,s.normalizeClass)([`nb-select__dropdown`,{"nb-select__dropdown--check":c.selectedMark===`check`,"nb-select__dropdown--anchored":!!n.$slots.trigger}]),style:(0,s.normalizeStyle)(C.value),role:`listbox`,"aria-multiselectable":c.multiple||void 0},[c.searchable?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,fe,[(0,s.withDirectives)((0,s.createElementVNode)(`input`,{ref_key:`searchRef`,ref:m,"onUpdate:modelValue":a[8]||=e=>p.value=e,type:`search`,class:`nb-select__search-input`,autocomplete:`off`,spellcheck:`false`,placeholder:c.searchPlaceholder,"aria-label":c.searchPlaceholder,"aria-controls":F.value,"aria-activedescendant":_.value>=0?I(_.value):void 0,onKeydown:je},null,40,pe),[[s.vModelText,p.value]])])):(0,s.createCommentVNode)(``,!0),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(Oe.value,e=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:e.key,class:`nb-select__group`,role:`group`,"aria-labelledby":e.name?e.labelId:void 0},[e.name?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:0,id:e.labelId,class:`nb-select__group-label`},(0,s.toDisplayString)(e.name),9,he)):(0,s.createCommentVNode)(``,!0),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.entries,e=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{id:I(e.index),key:e.option.value,"data-index":e.index,class:(0,s.normalizeClass)([`nb-select__option`,{"nb-select__option--selected":V(e.option.value),"nb-select__option--highlighted":_.value===e.index,"nb-select__option--disabled":e.option.disabled}]),role:`option`,"aria-selected":V(e.option.value),"aria-disabled":e.option.disabled||void 0,onMouseenter:t=>_.value=e.index,onClick:t=>ke(e.option)},[c.multiple||c.selectedMark===`check`?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,_e,[V(e.option.value)?((0,s.openBlock)(),(0,s.createElementBlock)(`svg`,ve,[...a[12]||=[(0,s.createElementVNode)(`path`,{d:`M1 4l3 3 5-6`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])):(0,s.createCommentVNode)(``,!0)])):(0,s.createCommentVNode)(``,!0),e.option.icon?((0,s.openBlock)(),(0,s.createBlock)(t.t,{key:1,class:`nb-select__option-icon`,name:e.option.icon,size:16},null,8,[`name`])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`span`,ye,[(0,s.renderSlot)(n.$slots,`option`,{option:e.option},()=>[(0,s.createTextVNode)((0,s.toDisplayString)(e.option.label),1)])])],42,ge))),128))],8,me))),128)),!c.options||c.options.length===0?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,be,` No options `)):c.searchable&&U.value.size===0?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,xe,(0,s.toDisplayString)(c.noResultsLabel),1)):(0,s.createCommentVNode)(``,!0),c.creatable?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:3,class:`nb-select__create`,onMousedown:a[11]||=(0,s.withModifiers)(()=>{},[`prevent`])},[(0,s.withDirectives)((0,s.createElementVNode)(`input`,{"onUpdate:modelValue":a[9]||=e=>f.value=e,type:`text`,class:`nb-select__create-input`,placeholder:c.createPlaceholder||`Add new…`,onKeydown:[(0,s.withKeys)((0,s.withModifiers)(Te,[`prevent`]),[`enter`]),a[10]||=(0,s.withModifiers)(()=>{},[`stop`])]},null,40,Se),[[s.vModelText,f.value]])],32)):(0,s.createCommentVNode)(``,!0)],14,de)):(0,s.createCommentVNode)(``,!0)]),_:3})]))],64))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|