@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
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { useTeleportReady as e } from "./composables/useTeleportReady.composable.mjs";
|
|
2
|
+
import { usePhoneLayout as t } from "./composables/usePhoneLayout.composable.mjs";
|
|
3
|
+
import { t as n } from "./Toolbar.context-Bli1SqM3.js";
|
|
4
|
+
import { openModalSurfaces as r } from "./composables/useFocusTrap.composable.mjs";
|
|
5
|
+
import { Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createVNode as u, defineComponent as d, nextTick as f, normalizeClass as p, normalizeStyle as m, onBeforeUnmount as h, openBlock as g, provide as _, reactive as v, ref as y, renderSlot as b, unref as x, watch as S, withCtx as C } from "vue";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/components/Menu.vue
|
|
8
|
+
var w = /* @__PURE__ */ d({
|
|
9
|
+
__name: "Menu",
|
|
10
|
+
props: {
|
|
11
|
+
open: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
size: { default: "md" },
|
|
16
|
+
minWidth: { default: 160 },
|
|
17
|
+
maxWidth: { default: 288 },
|
|
18
|
+
align: { default: "start" }
|
|
19
|
+
},
|
|
20
|
+
emits: ["close", "update:open"],
|
|
21
|
+
setup(d, { expose: w, emit: T }) {
|
|
22
|
+
let E = e(), D = d, O = T, k = y(null), A = y(-1), j = v([]), { phone: M } = t();
|
|
23
|
+
function N(e) {
|
|
24
|
+
return M.value ? `min(${e}px, calc(100vw - 16px))` : `${e}px`;
|
|
25
|
+
}
|
|
26
|
+
let P = o(() => ({
|
|
27
|
+
position: "fixed",
|
|
28
|
+
top: `${F.top}px`,
|
|
29
|
+
left: `${F.left}px`,
|
|
30
|
+
minWidth: N(D.minWidth),
|
|
31
|
+
maxWidth: N(D.maxWidth),
|
|
32
|
+
zIndex: M.value ? "var(--nb-zindex-modal-dropdown)" : "var(--nb-zindex-menu)"
|
|
33
|
+
})), F = v({
|
|
34
|
+
top: 0,
|
|
35
|
+
left: 0
|
|
36
|
+
}), I = null;
|
|
37
|
+
function L(e) {
|
|
38
|
+
I = {
|
|
39
|
+
top: e.top,
|
|
40
|
+
bottom: e.bottom,
|
|
41
|
+
left: e.left,
|
|
42
|
+
right: e.right ?? e.left + e.width
|
|
43
|
+
}, F.top = e.bottom, F.left = e.left, z();
|
|
44
|
+
}
|
|
45
|
+
function R(e, t) {
|
|
46
|
+
I = null, F.top = t, F.left = e, z();
|
|
47
|
+
}
|
|
48
|
+
function z() {
|
|
49
|
+
D.open && f(X);
|
|
50
|
+
}
|
|
51
|
+
function B() {
|
|
52
|
+
O("close"), O("update:open", !1);
|
|
53
|
+
}
|
|
54
|
+
function V(e) {
|
|
55
|
+
return j.includes(e) || j.push(e), j.indexOf(e);
|
|
56
|
+
}
|
|
57
|
+
function H(e) {
|
|
58
|
+
let t = j.indexOf(e);
|
|
59
|
+
t >= 0 && j.splice(t, 1);
|
|
60
|
+
}
|
|
61
|
+
let U = /* @__PURE__ */ new Set();
|
|
62
|
+
function W(e) {
|
|
63
|
+
U.add(e);
|
|
64
|
+
}
|
|
65
|
+
function G(e) {
|
|
66
|
+
U.delete(e);
|
|
67
|
+
}
|
|
68
|
+
_(n, null), _("nb-menu", {
|
|
69
|
+
size: D.size,
|
|
70
|
+
close: B,
|
|
71
|
+
highlightedIndex: A.value,
|
|
72
|
+
registerItem: V,
|
|
73
|
+
unregisterItem: H,
|
|
74
|
+
registerSurface: W,
|
|
75
|
+
unregisterSurface: G
|
|
76
|
+
});
|
|
77
|
+
function K() {
|
|
78
|
+
return k.value ? Array.from(k.value.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]")).filter((e) => !e.closest(".nb-submenu")) : [];
|
|
79
|
+
}
|
|
80
|
+
function q(e) {
|
|
81
|
+
let t = K();
|
|
82
|
+
e >= 0 && e < t.length && (A.value = e, t[e].focus());
|
|
83
|
+
}
|
|
84
|
+
function J(e) {
|
|
85
|
+
if (e.key === "Escape") {
|
|
86
|
+
if (e.defaultPrevented) return;
|
|
87
|
+
e.preventDefault(), e.stopPropagation(), B();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
let t = K();
|
|
91
|
+
if (!t.length) return;
|
|
92
|
+
let n = t.indexOf(document.activeElement);
|
|
93
|
+
n >= 0 && (A.value = n);
|
|
94
|
+
let r = (e) => t[e]?.getAttribute("aria-disabled") !== "true" || t[e]?.hasAttribute("data-nb-explained");
|
|
95
|
+
function i(e, n) {
|
|
96
|
+
for (let i = 1; i <= t.length; i++) {
|
|
97
|
+
let a = (e + n * i + t.length * i) % t.length;
|
|
98
|
+
if (r(a)) return a;
|
|
99
|
+
}
|
|
100
|
+
return -1;
|
|
101
|
+
}
|
|
102
|
+
if (e.key === "ArrowDown") {
|
|
103
|
+
e.preventDefault(), e.stopPropagation();
|
|
104
|
+
let t = i(A.value, 1);
|
|
105
|
+
t >= 0 && q(t);
|
|
106
|
+
} else if (e.key === "ArrowUp") {
|
|
107
|
+
e.preventDefault(), e.stopPropagation();
|
|
108
|
+
let t = i(A.value < 0 ? 0 : A.value, -1);
|
|
109
|
+
t >= 0 && q(t);
|
|
110
|
+
} else if (e.key === "Home") {
|
|
111
|
+
e.preventDefault(), e.stopPropagation();
|
|
112
|
+
let t = i(-1, 1);
|
|
113
|
+
t >= 0 && q(t);
|
|
114
|
+
} else if (e.key === "End") {
|
|
115
|
+
e.preventDefault(), e.stopPropagation();
|
|
116
|
+
let n = i(t.length, -1);
|
|
117
|
+
n >= 0 && q(n);
|
|
118
|
+
} else if (e.key === "Tab") B();
|
|
119
|
+
else if (e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey && !e.target.closest("input, textarea, [contenteditable]")) {
|
|
120
|
+
let n = e.key.toLowerCase();
|
|
121
|
+
for (let i = 1; i <= t.length; i++) {
|
|
122
|
+
let a = (A.value + i + t.length) % t.length, o = (t[a].textContent ?? "").trim().toLowerCase();
|
|
123
|
+
if (r(a) && o.startsWith(n)) {
|
|
124
|
+
e.preventDefault(), e.stopPropagation(), q(a);
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function Y(e) {
|
|
131
|
+
let t = e.target;
|
|
132
|
+
if (!(!k.value || k.value.contains(t))) {
|
|
133
|
+
for (let e of U) if (e.contains(t)) return;
|
|
134
|
+
B();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function X() {
|
|
138
|
+
if (!k.value) return;
|
|
139
|
+
let e = k.value;
|
|
140
|
+
e.style.maxHeight = "";
|
|
141
|
+
let t = e.getBoundingClientRect();
|
|
142
|
+
if (I && D.align === "end" ? F.left = I.right - t.width : I && (F.left = I.left), F.left + t.width > window.innerWidth - 8 && (F.left = window.innerWidth - t.width - 8), F.left = Math.max(8, F.left), F.top + t.height > window.innerHeight - 8) {
|
|
143
|
+
let e = I ? I.top - 8 : 0, n = window.innerHeight - 8 - F.top;
|
|
144
|
+
I && t.height <= e ? F.top = I.top - t.height : I && e > n ? F.top = 8 : I || (F.top = Math.max(8, window.innerHeight - t.height - 8));
|
|
145
|
+
}
|
|
146
|
+
let n = I && F.top < I.top ? I.top : window.innerHeight - 8;
|
|
147
|
+
e.style.maxHeight = `${Math.max(0, n - F.top)}px`;
|
|
148
|
+
}
|
|
149
|
+
let Z = null;
|
|
150
|
+
function Q() {
|
|
151
|
+
Z = document.activeElement instanceof HTMLElement && document.activeElement !== document.body ? document.activeElement : null;
|
|
152
|
+
}
|
|
153
|
+
function $(e) {
|
|
154
|
+
if (!e || e === document.body || !e.isConnected || k.value?.contains(e)) return !0;
|
|
155
|
+
for (let t of U) if (t.contains(e)) return !0;
|
|
156
|
+
return !1;
|
|
157
|
+
}
|
|
158
|
+
function ee() {
|
|
159
|
+
let e = Z;
|
|
160
|
+
if (Z = null, !e?.isConnected) return;
|
|
161
|
+
let t = r(), n = t[t.length - 1];
|
|
162
|
+
n && !n.contains(e) || $(document.activeElement) && e.focus();
|
|
163
|
+
}
|
|
164
|
+
return S(() => D.open, (e) => {
|
|
165
|
+
e ? (Q(), A.value = -1, document.addEventListener("mousedown", Y), f(() => {
|
|
166
|
+
X(), K().length > 0 && q(0);
|
|
167
|
+
})) : (A.value = -1, document.removeEventListener("mousedown", Y), ee());
|
|
168
|
+
}), h(() => {
|
|
169
|
+
document.removeEventListener("mousedown", Y);
|
|
170
|
+
}), w({
|
|
171
|
+
setPosition: L,
|
|
172
|
+
setPositionXY: R,
|
|
173
|
+
close: B,
|
|
174
|
+
el: k
|
|
175
|
+
}), (e, t) => (g(), s(i, {
|
|
176
|
+
to: "body",
|
|
177
|
+
disabled: !x(E)
|
|
178
|
+
}, [u(a, { name: "nb-menu" }, {
|
|
179
|
+
default: C(() => [d.open ? (g(), l("ul", {
|
|
180
|
+
key: 0,
|
|
181
|
+
ref_key: "menuRef",
|
|
182
|
+
ref: k,
|
|
183
|
+
role: "menu",
|
|
184
|
+
class: p(["nb-menu", `nb-menu--${d.size}`]),
|
|
185
|
+
style: m(P.value),
|
|
186
|
+
onKeydown: J
|
|
187
|
+
}, [b(e.$slots, "default")], 38)) : c("", !0)]),
|
|
188
|
+
_: 3
|
|
189
|
+
})], 8, ["disabled"]));
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
//#endregion
|
|
193
|
+
export { w as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./composables/useTeleportReady.composable.cjs`),t=require(`./composables/usePhoneLayout.composable.cjs`),n=require(`./Toolbar.context-D3Uj5o0_.cjs`),r=require(`./composables/useFocusTrap.composable.cjs`);let i=require(`vue`);var a=(0,i.defineComponent)({__name:`Menu`,props:{open:{type:Boolean,default:!1},size:{default:`md`},minWidth:{default:160},maxWidth:{default:288},align:{default:`start`}},emits:[`close`,`update:open`],setup(a,{expose:o,emit:s}){let c=e.useTeleportReady(),l=a,u=s,d=(0,i.ref)(null),f=(0,i.ref)(-1),p=(0,i.reactive)([]),{phone:m}=t.usePhoneLayout();function h(e){return m.value?`min(${e}px, calc(100vw - 16px))`:`${e}px`}let g=(0,i.computed)(()=>({position:`fixed`,top:`${_.top}px`,left:`${_.left}px`,minWidth:h(l.minWidth),maxWidth:h(l.maxWidth),zIndex:m.value?`var(--nb-zindex-modal-dropdown)`:`var(--nb-zindex-menu)`})),_=(0,i.reactive)({top:0,left:0}),v=null;function y(e){v={top:e.top,bottom:e.bottom,left:e.left,right:e.right??e.left+e.width},_.top=e.bottom,_.left=e.left,x()}function b(e,t){v=null,_.top=t,_.left=e,x()}function x(){l.open&&(0,i.nextTick)(M)}function S(){u(`close`),u(`update:open`,!1)}function C(e){return p.includes(e)||p.push(e),p.indexOf(e)}function w(e){let t=p.indexOf(e);t>=0&&p.splice(t,1)}let T=new Set;function E(e){T.add(e)}function D(e){T.delete(e)}(0,i.provide)(n.t,null),(0,i.provide)(`nb-menu`,{size:l.size,close:S,highlightedIndex:f.value,registerItem:C,unregisterItem:w,registerSurface:E,unregisterSurface:D});function O(){return d.value?Array.from(d.value.querySelectorAll(`[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]`)).filter(e=>!e.closest(`.nb-submenu`)):[]}function k(e){let t=O();e>=0&&e<t.length&&(f.value=e,t[e].focus())}function A(e){if(e.key===`Escape`){if(e.defaultPrevented)return;e.preventDefault(),e.stopPropagation(),S();return}let t=O();if(!t.length)return;let n=t.indexOf(document.activeElement);n>=0&&(f.value=n);let r=e=>t[e]?.getAttribute(`aria-disabled`)!==`true`||t[e]?.hasAttribute(`data-nb-explained`);function i(e,n){for(let i=1;i<=t.length;i++){let a=(e+n*i+t.length*i)%t.length;if(r(a))return a}return-1}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation();let t=i(f.value,1);t>=0&&k(t)}else if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=i(f.value<0?0:f.value,-1);t>=0&&k(t)}else if(e.key===`Home`){e.preventDefault(),e.stopPropagation();let t=i(-1,1);t>=0&&k(t)}else if(e.key===`End`){e.preventDefault(),e.stopPropagation();let n=i(t.length,-1);n>=0&&k(n)}else if(e.key===`Tab`)S();else if(e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.target.closest(`input, textarea, [contenteditable]`)){let n=e.key.toLowerCase();for(let i=1;i<=t.length;i++){let a=(f.value+i+t.length)%t.length,o=(t[a].textContent??``).trim().toLowerCase();if(r(a)&&o.startsWith(n)){e.preventDefault(),e.stopPropagation(),k(a);break}}}}function j(e){let t=e.target;if(!(!d.value||d.value.contains(t))){for(let e of T)if(e.contains(t))return;S()}}function M(){if(!d.value)return;let e=d.value;e.style.maxHeight=``;let t=e.getBoundingClientRect();if(v&&l.align===`end`?_.left=v.right-t.width:v&&(_.left=v.left),_.left+t.width>window.innerWidth-8&&(_.left=window.innerWidth-t.width-8),_.left=Math.max(8,_.left),_.top+t.height>window.innerHeight-8){let e=v?v.top-8:0,n=window.innerHeight-8-_.top;v&&t.height<=e?_.top=v.top-t.height:v&&e>n?_.top=8:v||(_.top=Math.max(8,window.innerHeight-t.height-8))}let n=v&&_.top<v.top?v.top:window.innerHeight-8;e.style.maxHeight=`${Math.max(0,n-_.top)}px`}let N=null;function P(){N=document.activeElement instanceof HTMLElement&&document.activeElement!==document.body?document.activeElement:null}function F(e){if(!e||e===document.body||!e.isConnected||d.value?.contains(e))return!0;for(let t of T)if(t.contains(e))return!0;return!1}function I(){let e=N;if(N=null,!e?.isConnected)return;let t=r.openModalSurfaces(),n=t[t.length-1];n&&!n.contains(e)||F(document.activeElement)&&e.focus()}return(0,i.watch)(()=>l.open,e=>{e?(P(),f.value=-1,document.addEventListener(`mousedown`,j),(0,i.nextTick)(()=>{M(),O().length>0&&k(0)})):(f.value=-1,document.removeEventListener(`mousedown`,j),I())}),(0,i.onBeforeUnmount)(()=>{document.removeEventListener(`mousedown`,j)}),o({setPosition:y,setPositionXY:b,close:S,el:d}),(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{to:`body`,disabled:!(0,i.unref)(c)},[(0,i.createVNode)(i.Transition,{name:`nb-menu`},{default:(0,i.withCtx)(()=>[a.open?((0,i.openBlock)(),(0,i.createElementBlock)(`ul`,{key:0,ref_key:`menuRef`,ref:d,role:`menu`,class:(0,i.normalizeClass)([`nb-menu`,`nb-menu--${a.size}`]),style:(0,i.normalizeStyle)(g.value),onKeydown:A},[(0,i.renderSlot)(e.$slots,`default`)],38)):(0,i.createCommentVNode)(``,!0)]),_:3})],8,[`disabled`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Menu-
|
|
1
|
+
import { t as e } from "./Menu-CWxBEMC4.js";
|
|
2
2
|
import { Fragment as t, computed as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, inject as c, nextTick as l, normalizeClass as u, onBeforeUnmount as d, onMounted as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, useId as _, watch as v, withCtx as y } from "vue";
|
|
3
3
|
//#region src/components/MenuBarItem.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var b = ["aria-expanded"], x = /* @__PURE__ */ s({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Menu-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Menu-D0TerdRm.cjs`);let t=require(`vue`);var n=[`aria-expanded`],r=(0,t.defineComponent)({__name:`MenuBarItem`,props:{label:{},size:{default:`md`},minWidth:{default:160},maxWidth:{default:288}},setup(r){let i=`nb-menubar-item-${(0,t.useId)()}`,a=(0,t.ref)(null),o=(0,t.ref)(null),s=(0,t.inject)(`nb-menubar`,null),c=(0,t.computed)(()=>s?.activeMenu.value===i);function l(){(0,t.nextTick)(()=>{if(a.value&&o.value){let e=a.value.getBoundingClientRect();o.value.setPosition({top:e.top,left:e.left,bottom:e.bottom,width:e.width})}})}function u(){}function d(e){e.stopPropagation(),e.preventDefault(),c.value?s?.setActiveMenu(null):s?.setActiveMenu(i)}function f(){s?.anyOpen.value&&!c.value&&s.setActiveMenu(i)}function p(){c.value&&s?.setActiveMenu(null)}return(0,t.watch)(c,e=>{e&&l()}),(0,t.onMounted)(()=>{a.value&&s&&s.registerTrigger({id:i,el:a.value,open:l,close:u})}),(0,t.onBeforeUnmount)(()=>{s?.unregisterTrigger(i)}),(i,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`button`,{ref_key:`triggerRef`,ref:a,type:`button`,role:`menuitem`,class:(0,t.normalizeClass)([`nb-menubar-item`,{"nb-menubar-item--active":c.value}]),"aria-haspopup":`menu`,"aria-expanded":c.value,onMousedown:d,onMouseenter:f},[(0,t.renderSlot)(i.$slots,`trigger`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(r.label),1)])],42,n),(0,t.createVNode)(e.t,{ref_key:`menuRef`,ref:o,open:c.value,size:r.size,"min-width":r.minWidth,"max-width":r.maxWidth,onClose:p},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`default`)]),_:3},8,[`open`,`size`,`min-width`,`max-width`])],64))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.cjs`),t=require(`./composables/useTeleportReady.composable.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./composables/useSurfaceLayer.composable.cjs`),i=require(`./composables/useNbStrings.composable.cjs`),a=require(`./Size.d-BQ4_AVQe.cjs`),o=require(`./composables/useFocusTrap.composable.cjs`),s=require(`./composables/useScrollLock.composable.cjs`),c=require(`./CloseButton-Bdk7rJ8E.cjs`),l=require(`./ButtonSet-SziuuT6_.cjs`),u=require(`./composables/useVisualViewportVar.composable.cjs`);let d=require(`vue`);var f=e.c.short,p=[`[data-nb-confirm-floating]`,`.nb-select__dropdown`,`.nb-menu`,`.nb-date-picker__calendar`,`.nb-user-menu__panel`,`.nb-sidebar-menu-item__flyout`],m=new Set;function h(e){let t=e.trim();return t?(m.add(t),()=>{m.delete(t)}):()=>{}}function g(e=[]){return[...p,...m,...e].map(e=>e.trim()).filter(Boolean).join(`,`)}function _(e,t){if(!e)return;let n=`${t?0:f}ms`;e.style.transitionDuration=n;let r=e.parentElement;r instanceof HTMLElement&&(r.style.transitionDuration=n)}var v=[`role`,`aria-labelledby`,`aria-describedby`,`aria-busy`],y={key:0,class:`nb-modal--header`},b=[`tabindex`,`role`,`aria-labelledby`],x={key:1,class:`nb-modal--footer`},S=(0,d.defineComponent)({__name:`Modal`,props:{open:{type:Boolean,default:!1},title:{default:void 0},size:{default:a.r.Medium},closeOnOverlay:{type:Boolean,default:!0},role:{default:`dialog`},labelledBy:{default:void 0},describedBy:{default:void 0},busy:{type:Boolean,default:!1},closeDisabled:{type:Boolean,default:!1},closeAppearance:{default:`corner`},closeOnEscape:{type:Boolean,default:!0},trapFocus:{type:Boolean,default:!0},initialFocus:{type:[String,Function],default:void 0},floatingSelectors:{default:void 0}},emits:[`close`],setup(e,{expose:n,emit:a}){let f=t.useTeleportReady(),p=i.useNbStrings(),m=e,h=a,_=(0,d.useSlots)(),S=(0,d.computed)(()=>!!_.header||!!m.title),C=`nb-modal-title-${(0,d.useId)()}`,w=(0,d.ref)(null),T=(0,d.ref)(null),{layerProps:E}=r.useSurfaceLayer({overlay:!0});function D(){m.closeOnOverlay&&h(`close`)}function O(){let e=m.initialFocus;return e?typeof e==`function`?e():w.value?.querySelector(e)??null:k()}function k(){let e=o.focusablesWithin(w.value),t=e[0];return!t?.classList.contains(`nb-button--danger`)||t.classList.contains(`nb-button--outlined`)?null:e[1]??null}o.useFocusTrap({container:()=>w.value,active:()=>m.open&&m.trapFocus,initialFocus:O,floatingSelector:()=>g(m.floatingSelectors)}),u.useVisualViewportVar(()=>m.open);let A=!1;function j(){A||(A=!0,s.acquireScrollLock())}function M(){A&&(A=!1,s.releaseScrollLock())}let N=(0,d.ref)(!1);function P(){let e=T.value;if(!e)return;let t=e.scrollHeight-e.clientHeight;!N.value&&t>4?N.value=!0:N.value&&t<=0&&(N.value=!1)}let F=null,I=null;function L(){let e=T.value;e&&(R(),typeof ResizeObserver<`u`&&(F=new ResizeObserver(()=>P()),F.observe(e)),typeof MutationObserver<`u`&&(I=new MutationObserver(()=>P()),I.observe(e,{childList:!0,subtree:!0,characterData:!0})),P())}function R(){F?.disconnect(),F=null,I?.disconnect(),I=null}(0,d.watch)(()=>m.open,async e=>{e?j():M(),await(0,d.nextTick)(),e?L():(R(),N.value=!1)},{immediate:!0}),(0,d.onUnmounted)(()=>{M(),R()});function z(){let e=w.value;if(!e)return!1;let t=Array.from(document.querySelectorAll(`[aria-modal="true"]`));return t.length===0||t[t.length-1]===e}function B(e){e.key===`Escape`&&(e.defaultPrevented||!m.open||!m.closeOnEscape||m.closeDisabled||z()&&h(`close`))}return(0,d.onMounted)(()=>{document.addEventListener(`keydown`,B),m.open&&L()}),(0,d.onUnmounted)(()=>{document.removeEventListener(`keydown`,B)}),n({dialogEl:()=>w.value,bodyEl:()=>T.value}),(t,n)=>((0,d.openBlock)(),(0,d.createBlock)(d.Teleport,{to:`body`,disabled:!(0,d.unref)(f)},[(0,d.createVNode)(d.Transition,{name:`nb-modal`},{default:(0,d.withCtx)(()=>[e.open?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,{key:0,class:`nb-modal--overlay`,onClick:(0,d.withModifiers)(D,[`self`])},[(0,d.createElementVNode)(`div`,(0,d.mergeProps)({ref_key:`contentRef`,ref:w,class:[`nb-modal--content`,`nb-modal--content--${e.size}`]},(0,d.unref)(E),{role:e.role,"aria-modal":`true`,"aria-labelledby":e.labelledBy??(S.value?C:void 0),"aria-describedby":e.describedBy,"aria-busy":e.busy?`true`:void 0,tabindex:`-1`,onClick:n[1]||=(0,d.withModifiers)(()=>{},[`stop`])}),[S.value?((0,d.openBlock)(),(0,d.createElementBlock)(`header`,y,[(0,d.createElementVNode)(`span`,{id:C,class:`nb-modal--title`},[(0,d.renderSlot)(t.$slots,`header`,{},()=>[(0,d.createTextVNode)((0,d.toDisplayString)(e.title),1)],!0)])])):(0,d.createCommentVNode)(``,!0),(0,d.createElementVNode)(`main`,{ref_key:`bodyRef`,ref:T,class:`nb-modal--body`,tabindex:N.value?0:void 0,role:N.value?`region`:void 0,"aria-labelledby":N.value?e.labelledBy??(S.value?C:void 0):void 0},[(0,d.renderSlot)(t.$slots,`default`,{},void 0,!0)],8,b),t.$slots.footer?((0,d.openBlock)(),(0,d.createElementBlock)(`footer`,x,[(0,d.createVNode)(l.t,{fluid:``,size:`xl`,"focus-order":`rank`,align:`end`,class:`nb-modal--actions`},{default:(0,d.withCtx)(()=>[(0,d.renderSlot)(t.$slots,`footer`,{},void 0,!0)]),_:3})])):(0,d.createCommentVNode)(``,!0),S.value?((0,d.openBlock)(),(0,d.createBlock)(c.t,{key:2,class:`nb-modal--close`,size:`lg`,label:(0,d.unref)(p).modalClose,disabled:e.closeDisabled,"aria-disabled":e.closeDisabled?`true`:void 0,onClick:n[0]||=e=>h(`close`)},null,8,[`label`,`disabled`,`aria-disabled`])):(0,d.createCommentVNode)(``,!0)],16,v)])):(0,d.createCommentVNode)(``,!0)]),_:3})],8,[`disabled`]))}}),C=n.t(S,[[`__scopeId`,`data-v-d3d75758`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return C}});
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { c as e } from "./Button-DmJ_J3UO.js";
|
|
2
|
+
import { useTeleportReady as t } from "./composables/useTeleportReady.composable.mjs";
|
|
3
|
+
import { t as n } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
4
|
+
import { useSurfaceLayer as r } from "./composables/useSurfaceLayer.composable.mjs";
|
|
5
|
+
import { useNbStrings as i } from "./composables/useNbStrings.composable.mjs";
|
|
6
|
+
import { r as a } from "./Size.d-DY4ZHW3-.js";
|
|
7
|
+
import { focusablesWithin as ee, useFocusTrap as te } from "./composables/useFocusTrap.composable.mjs";
|
|
8
|
+
import { acquireScrollLock as o, releaseScrollLock as s } from "./composables/useScrollLock.composable.mjs";
|
|
9
|
+
import { t as c } from "./CloseButton-CAPfd6yf.js";
|
|
10
|
+
import { t as ne } from "./ButtonSet-Cg1ixzOK.js";
|
|
11
|
+
import { useVisualViewportVar as l } from "./composables/useVisualViewportVar.composable.mjs";
|
|
12
|
+
import { Teleport as u, Transition as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as re, createVNode as _, defineComponent as v, mergeProps as ie, nextTick as ae, onMounted as y, onUnmounted as b, openBlock as x, ref as S, renderSlot as C, toDisplayString as w, unref as T, useId as oe, useSlots as se, watch as ce, withCtx as E, withModifiers as D } from "vue";
|
|
12
13
|
//#region src/components/Confirm.env.ts
|
|
13
14
|
var O = e.short, k = [
|
|
14
15
|
"[data-nb-confirm-floating]",
|
|
@@ -55,7 +56,7 @@ var P = [
|
|
|
55
56
|
], L = {
|
|
56
57
|
key: 1,
|
|
57
58
|
class: "nb-modal--footer"
|
|
58
|
-
}, R = /* @__PURE__ */
|
|
59
|
+
}, R = /* @__PURE__ */ n(/* @__PURE__ */ v({
|
|
59
60
|
__name: "Modal",
|
|
60
61
|
props: {
|
|
61
62
|
open: {
|
|
@@ -63,7 +64,7 @@ var P = [
|
|
|
63
64
|
default: !1
|
|
64
65
|
},
|
|
65
66
|
title: { default: void 0 },
|
|
66
|
-
size: { default:
|
|
67
|
+
size: { default: a.Medium },
|
|
67
68
|
closeOnOverlay: {
|
|
68
69
|
type: Boolean,
|
|
69
70
|
default: !0
|
|
@@ -95,42 +96,42 @@ var P = [
|
|
|
95
96
|
floatingSelectors: { default: void 0 }
|
|
96
97
|
},
|
|
97
98
|
emits: ["close"],
|
|
98
|
-
setup(e, { expose:
|
|
99
|
-
let
|
|
100
|
-
function V() {
|
|
101
|
-
O.closeOnOverlay && k("close");
|
|
102
|
-
}
|
|
99
|
+
setup(e, { expose: n, emit: a }) {
|
|
100
|
+
let v = t(), O = i(), k = e, A = a, j = se(), N = f(() => !!j.header || !!k.title), R = `nb-modal-title-${oe()}`, z = S(null), B = S(null), { layerProps: V } = r({ overlay: !0 });
|
|
103
101
|
function H() {
|
|
104
|
-
|
|
105
|
-
return e ? typeof e == "function" ? e() : R.value?.querySelector(e) ?? null : U();
|
|
102
|
+
k.closeOnOverlay && A("close");
|
|
106
103
|
}
|
|
107
104
|
function U() {
|
|
108
|
-
let e =
|
|
105
|
+
let e = k.initialFocus;
|
|
106
|
+
return e ? typeof e == "function" ? e() : z.value?.querySelector(e) ?? null : W();
|
|
107
|
+
}
|
|
108
|
+
function W() {
|
|
109
|
+
let e = ee(z.value), t = e[0];
|
|
109
110
|
return !t?.classList.contains("nb-button--danger") || t.classList.contains("nb-button--outlined") ? null : e[1] ?? null;
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
-
container: () =>
|
|
113
|
-
active: () =>
|
|
114
|
-
initialFocus:
|
|
115
|
-
floatingSelector: () => M(
|
|
116
|
-
}),
|
|
117
|
-
let
|
|
118
|
-
function
|
|
119
|
-
|
|
112
|
+
te({
|
|
113
|
+
container: () => z.value,
|
|
114
|
+
active: () => k.open && k.trapFocus,
|
|
115
|
+
initialFocus: U,
|
|
116
|
+
floatingSelector: () => M(k.floatingSelectors)
|
|
117
|
+
}), l(() => k.open);
|
|
118
|
+
let G = !1;
|
|
119
|
+
function le() {
|
|
120
|
+
G || (G = !0, o());
|
|
120
121
|
}
|
|
121
122
|
function K() {
|
|
122
|
-
|
|
123
|
+
G && (G = !1, s());
|
|
123
124
|
}
|
|
124
|
-
let q =
|
|
125
|
+
let q = S(!1);
|
|
125
126
|
function J() {
|
|
126
|
-
let e =
|
|
127
|
+
let e = B.value;
|
|
127
128
|
if (!e) return;
|
|
128
129
|
let t = e.scrollHeight - e.clientHeight;
|
|
129
130
|
!q.value && t > 4 ? q.value = !0 : q.value && t <= 0 && (q.value = !1);
|
|
130
131
|
}
|
|
131
132
|
let Y = null, X = null;
|
|
132
133
|
function Z() {
|
|
133
|
-
let e =
|
|
134
|
+
let e = B.value;
|
|
134
135
|
e && (Q(), typeof ResizeObserver < "u" && (Y = new ResizeObserver(() => J()), Y.observe(e)), typeof MutationObserver < "u" && (X = new MutationObserver(() => J()), X.observe(e, {
|
|
135
136
|
childList: !0,
|
|
136
137
|
subtree: !0,
|
|
@@ -140,84 +141,87 @@ var P = [
|
|
|
140
141
|
function Q() {
|
|
141
142
|
Y?.disconnect(), Y = null, X?.disconnect(), X = null;
|
|
142
143
|
}
|
|
143
|
-
|
|
144
|
-
e ?
|
|
145
|
-
}, { immediate: !0 }),
|
|
144
|
+
ce(() => k.open, async (e) => {
|
|
145
|
+
e ? le() : K(), await ae(), e ? Z() : (Q(), q.value = !1);
|
|
146
|
+
}, { immediate: !0 }), b(() => {
|
|
146
147
|
K(), Q();
|
|
147
148
|
});
|
|
148
|
-
function
|
|
149
|
-
let e =
|
|
149
|
+
function ue() {
|
|
150
|
+
let e = z.value;
|
|
150
151
|
if (!e) return !1;
|
|
151
152
|
let t = Array.from(document.querySelectorAll("[aria-modal=\"true\"]"));
|
|
152
153
|
return t.length === 0 || t[t.length - 1] === e;
|
|
153
154
|
}
|
|
154
155
|
function $(e) {
|
|
155
|
-
e.key === "Escape" && (e.defaultPrevented || !
|
|
156
|
+
e.key === "Escape" && (e.defaultPrevented || !k.open || !k.closeOnEscape || k.closeDisabled || ue() && A("close"));
|
|
156
157
|
}
|
|
157
|
-
return
|
|
158
|
-
document.addEventListener("keydown", $),
|
|
159
|
-
}),
|
|
158
|
+
return y(() => {
|
|
159
|
+
document.addEventListener("keydown", $), k.open && Z();
|
|
160
|
+
}), b(() => {
|
|
160
161
|
document.removeEventListener("keydown", $);
|
|
161
|
-
}),
|
|
162
|
-
dialogEl: () =>
|
|
163
|
-
bodyEl: () =>
|
|
164
|
-
}), (t, n) => (
|
|
165
|
-
|
|
162
|
+
}), n({
|
|
163
|
+
dialogEl: () => z.value,
|
|
164
|
+
bodyEl: () => B.value
|
|
165
|
+
}), (t, n) => (x(), p(u, {
|
|
166
|
+
to: "body",
|
|
167
|
+
disabled: !T(v)
|
|
168
|
+
}, [_(d, { name: "nb-modal" }, {
|
|
169
|
+
default: E(() => [e.open ? (x(), h("div", {
|
|
166
170
|
key: 0,
|
|
167
171
|
class: "nb-modal--overlay",
|
|
168
|
-
onClick: D(
|
|
169
|
-
}, [
|
|
172
|
+
onClick: D(H, ["self"])
|
|
173
|
+
}, [g("div", ie({
|
|
170
174
|
ref_key: "contentRef",
|
|
171
|
-
ref:
|
|
175
|
+
ref: z,
|
|
172
176
|
class: ["nb-modal--content", `nb-modal--content--${e.size}`]
|
|
173
|
-
}, T(
|
|
177
|
+
}, T(V), {
|
|
174
178
|
role: e.role,
|
|
175
179
|
"aria-modal": "true",
|
|
176
|
-
"aria-labelledby": e.labelledBy ?? (
|
|
180
|
+
"aria-labelledby": e.labelledBy ?? (N.value ? R : void 0),
|
|
177
181
|
"aria-describedby": e.describedBy,
|
|
178
182
|
"aria-busy": e.busy ? "true" : void 0,
|
|
179
183
|
tabindex: "-1",
|
|
180
184
|
onClick: n[1] ||= D(() => {}, ["stop"])
|
|
181
185
|
}), [
|
|
182
|
-
|
|
183
|
-
id:
|
|
186
|
+
N.value ? (x(), h("header", F, [g("span", {
|
|
187
|
+
id: R,
|
|
184
188
|
class: "nb-modal--title"
|
|
185
|
-
}, [
|
|
186
|
-
|
|
189
|
+
}, [C(t.$slots, "header", {}, () => [re(w(e.title), 1)], !0)])])) : m("", !0),
|
|
190
|
+
g("main", {
|
|
187
191
|
ref_key: "bodyRef",
|
|
188
|
-
ref:
|
|
192
|
+
ref: B,
|
|
189
193
|
class: "nb-modal--body",
|
|
190
194
|
tabindex: q.value ? 0 : void 0,
|
|
191
195
|
role: q.value ? "region" : void 0,
|
|
192
|
-
"aria-labelledby": q.value ? e.labelledBy ?? (
|
|
193
|
-
}, [
|
|
194
|
-
t.$slots.footer ? (
|
|
196
|
+
"aria-labelledby": q.value ? e.labelledBy ?? (N.value ? R : void 0) : void 0
|
|
197
|
+
}, [C(t.$slots, "default", {}, void 0, !0)], 8, I),
|
|
198
|
+
t.$slots.footer ? (x(), h("footer", L, [_(ne, {
|
|
195
199
|
fluid: "",
|
|
196
200
|
size: "xl",
|
|
197
201
|
"focus-order": "rank",
|
|
198
202
|
align: "end",
|
|
199
203
|
class: "nb-modal--actions"
|
|
200
204
|
}, {
|
|
201
|
-
default: E(() => [
|
|
205
|
+
default: E(() => [C(t.$slots, "footer", {}, void 0, !0)]),
|
|
202
206
|
_: 3
|
|
203
|
-
})])) :
|
|
204
|
-
|
|
207
|
+
})])) : m("", !0),
|
|
208
|
+
N.value ? (x(), p(c, {
|
|
205
209
|
key: 2,
|
|
206
210
|
class: "nb-modal--close",
|
|
207
211
|
size: "lg",
|
|
208
|
-
label: T(
|
|
212
|
+
label: T(O).modalClose,
|
|
209
213
|
disabled: e.closeDisabled,
|
|
210
214
|
"aria-disabled": e.closeDisabled ? "true" : void 0,
|
|
211
|
-
onClick: n[0] ||= (e) =>
|
|
215
|
+
onClick: n[0] ||= (e) => A("close")
|
|
212
216
|
}, null, 8, [
|
|
213
217
|
"label",
|
|
214
218
|
"disabled",
|
|
215
219
|
"aria-disabled"
|
|
216
|
-
])) :
|
|
217
|
-
], 16, P)])) :
|
|
220
|
+
])) : m("", !0)
|
|
221
|
+
], 16, P)])) : m("", !0)]),
|
|
218
222
|
_: 3
|
|
219
|
-
})]));
|
|
223
|
+
})], 8, ["disabled"]));
|
|
220
224
|
}
|
|
221
|
-
}), [["__scopeId", "data-v-
|
|
225
|
+
}), [["__scopeId", "data-v-d3d75758"]]);
|
|
222
226
|
//#endregion
|
|
223
227
|
export { j as a, M as i, O as n, N as r, R as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-CGIbF1e-.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(`./Spinner-Bpfgl-mN.cjs`),s=require(`./EmptyState-1ZLgFpJO.cjs`),c=require(`./CloseButton-Bdk7rJ8E.cjs`),l=require(`./Skeleton-D46kzIzB.cjs`),u=require(`./NotificationCenterItem--0XKF1Bf.cjs`);let d=require(`vue`),f=require(`@nubisco/ui/icons/warning-circle`),p=require(`@nubisco/ui/icons/bell`);p=e.n(p);var m={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`},h=new Set,g=8,_=8,v=96,y=88,b=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-g-_>=r){let n=e.top+e.height,r=t===`end`?n-_:a.height-e.top-_,s=Math.max(y+v,r),c=Math.min(i+v,s),l=Math.max(y,Math.min(i,s-v));return t===`end`?{top:Math.max(_,n-c),bottom:Math.max(_,a.height-n),left:o+g,side:`right`,maxListHeight:l}:{top:Math.max(_,Math.min(e.top,a.height-_-c)),left:o+g,side:`right`,maxListHeight:l}}let s=t===`start`?e.left:e.left+e.width-r,c=Math.min(Math.max(s,_),Math.max(_,a.width-r-_)),l=e.top+e.height,u=a.height-l-g-_,d=e.top-g-_,f=u<b&&d>u?`top`:`bottom`,p=Math.max(y,f===`top`?d:u),m=Math.max(y,Math.min(i,p-v)),ee=Math.min(i+v,p);return{top:f===`top`?Math.max(_,e.top-g-ee):l+g,left:c,side:f,maxListHeight:m}}function le(e,t){return e.left<=t.width&&e.left+e.width>=0&&e.top<=t.height&&e.top+e.height>=0}var x=(0,d.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:g,emit:_}){let v=n.useTeleportReady(),y=a.useNbStrings(),b=e,x=(0,d.computed)(()=>b.icon??p),S=_,C=(0,d.useSlots)(),w=`nb-notification-center-${(0,d.useId)()}`,ue=`${w}-title`,de=`${w}-trigger`,T=`${w}-error`,E=(0,d.ref)(null),fe=(0,d.ref)(null),D=(0,d.ref)(null),O=(0,d.ref)(null),pe=(0,d.ref)(!1),k=(0,d.computed)(()=>b.open===void 0?pe.value:b.open),A=(0,d.computed)(()=>typeof b.unreadCount==`number`?Math.max(0,b.unreadCount):b.items.filter(e=>!e.read).length),me=(0,d.computed)(()=>A.value>b.maxCount?`${b.maxCount}+`:String(A.value)),he=(0,d.computed)(()=>A.value>0?`${b.label}, ${b.formatUnread(A.value)}`:b.label),j=(0,d.computed)(()=>{if(typeof b.itemCount==`number`)return Math.max(0,b.itemCount);if(!C.default)return b.items.length}),ge=(0,d.computed)(()=>(j.value??0)>0),M=(0,d.computed)(()=>{if(b.loading)return`loading`;let e=j.value;return b.error&&(e===void 0||e===0)?`error`:e===void 0||e>0?`list`:`empty`}),N=(0,d.computed)(()=>b.error&&!b.loading&&M.value===`list`&&ge.value);(0,d.ref)(!1),(0,d.watch)(()=>[k.value,!!C.default,b.itemCount],([e,t,n])=>{},{immediate:!0});function P(){S(`retry`)}let F=(0,d.computed)(()=>({id:de,"aria-haspopup":`dialog`,"aria-expanded":k.value?`true`:`false`,"aria-controls":k.value?w:void 0,"aria-label":he.value,disabled:b.disabled||void 0})),I=(0,d.computed)(()=>({type:`button`,disabled:A.value===0&&!b.markAllPending,"aria-disabled":b.markAllPending?`true`:void 0,"aria-busy":b.markAllPending?`true`:void 0,onClick:Ie})),_e=(0,d.computed)(()=>N.value||M.value===`error`?T:void 0);function L(e){if(!e){D.value=null;return}let t=e instanceof HTMLElement?e:e.$el;D.value=t instanceof HTMLElement?t:null}let R=(0,d.ref)({top:0,left:0,side:`bottom`,maxListHeight:b.maxHeight});function z(){return{width:window.innerWidth,height:window.innerHeight}}function B(){let e=E.value?.getBoundingClientRect();e&&(R.value=ce(e,{align:b.align,side:b.side,width:b.width,maxHeight:b.maxHeight,viewport:z()}))}let{phone:ve}=i.usePhoneLayout(),V=(0,d.computed)(()=>ve.value),ye=(0,d.computed)(()=>{if(!V.value)return R.value.bottom===void 0?{top:`${Math.round(R.value.top)}px`,left:`${Math.round(R.value.left)}px`,width:`${b.width}px`}:{bottom:`${Math.round(R.value.bottom)}px`,left:`${Math.round(R.value.left)}px`,width:`${b.width}px`}}),be=(0,d.computed)(()=>V.value?void 0:{maxHeight:`${Math.round(R.value.maxListHeight)}px`}),xe=(0,d.computed)(()=>({"nb-notification-center__panel--sheet":V.value,"nb-notification-center__panel--start":b.align===`start`,"nb-notification-center__panel--above":!V.value&&R.value.side===`top`,"nb-notification-center__panel--beside":!V.value&&R.value.side===`right`}));function Se(e){b.open===void 0&&(pe.value=e),S(`update:open`,e)}function H(){b.disabled||k.value||(B(),Se(!0),S(`open`))}function U(e={}){if(!k.value)return;let t=O.value?.contains(document.activeElement);Se(!1),S(`close`),(e.restoreFocus??t)&&(0,d.nextTick)(Ce)}function Ce(){let e=D.value;if(e?.isConnected){e.focus();return}(E.value?.querySelector(Y))?.focus()}function W(){k.value?U({restoreFocus:!0}):H()}let G=(0,d.ref)(0),we=new Set([`button`,`link`,`menuitem`,`option`]);function Te(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&&we.has(t)}function K(){return O.value?Array.from(O.value.querySelectorAll(`[data-nb-notification-item]`)).filter(e=>!!Te(e)):[]}let Ee=(0,d.ref)(void 0);function De(e){let t=fe.value;Ee.value=t&&t.childElementCount>0&&e.length===0?0:void 0}function q(e){let t=K();De(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 Oe(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 ke(e){return!!e?.closest?.(`input, textarea, select, [contenteditable=""], [contenteditable="true"]`)}function Ae(e){let t=K(),n=e.target?.closest(`[data-nb-notification-item]`),r=n?t.indexOf(n):-1;if(e.key===`Escape`){if(!je(e))return;e.preventDefault(),e.stopPropagation(),U({restoreFocus:!0});return}if(e.key===`Tab`){Me(e);return}if(!ke(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 je(e){if(e.defaultPrevented)return!1;let t=(e.target??document.activeElement)?.closest?.(`[aria-modal="true"]`);return!(t&&t!==O.value)}function Me(e){let t=O.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?D.value:Ne();U({restoreFocus:!1}),(0,d.nextTick)(()=>{c?.isConnected?c.focus():Ce()})}function Ne(){let e=D.value;if(!e)return null;let t=Array.from(document.querySelectorAll(Y)).filter(e=>!O.value?.contains(e)).filter(e=>e.tabIndex>=0),n=t.indexOf(e);return n<0?null:t[n+1]??null}function Pe(e,t){S(`select`,e,t),b.closeOnSelect&&U({restoreFocus:!1})}function Fe(e){if(!C.default)return;let t=e.target?.closest(`[data-nb-notification-item]`);if(t&&Te(t)){if(e.type===`keydown`){let n=e.key;if(n!==`Enter`&&n!==` `||t.tagName===`BUTTON`||t.tagName===`A`)return;e.preventDefault()}S(`select`,null,e),b.closeOnSelect&&U({restoreFocus:!1})}}function Ie(){b.markAllPending||S(`mark-all-read`)}function Le(e){let t=e.target;E.value?.contains(t)||O.value?.contains(t)||U({restoreFocus:!1})}function Re(e){e.key===`Escape`&&(O.value?.contains(document.activeElement)||je(e)&&U({restoreFocus:E.value?.contains(document.activeElement)??!1}))}let X=0;function Z(){!k.value||X||(X=requestAnimationFrame(()=>{X=0,Be()}))}function ze(){X&&=(cancelAnimationFrame(X),0)}function Be(){if(!k.value||V.value)return;let e=E.value?.getBoundingClientRect();if(e&&!le(e,z())){U({restoreFocus:!1});return}B()}function Q(){b.closeOnNavigate&&U({restoreFocus:!1})}function Ve(){return window.navigation}function He(){document.addEventListener(`mousedown`,Le),document.addEventListener(`keydown`,Re),window.addEventListener(`resize`,Z),window.addEventListener(`scroll`,Z,!0),window.addEventListener(`popstate`,Q),window.addEventListener(`hashchange`,Q),Ve()?.addEventListener(`navigate`,Q)}function Ue(){ze(),document.removeEventListener(`mousedown`,Le),document.removeEventListener(`keydown`,Re),window.removeEventListener(`resize`,Z),window.removeEventListener(`scroll`,Z,!0),window.removeEventListener(`popstate`,Q),window.removeEventListener(`hashchange`,Q),Ve()?.removeEventListener(`navigate`,Q)}let $=()=>U({restoreFocus:!1});return(0,d.watch)(k,e=>{if(e){for(let e of[...h])e!==$&&e();h.add($),He(),(0,d.nextTick)(()=>{B(),q(0),J(0)||O.value?.focus()})}else h.delete($),Ue(),G.value=0}),(0,d.watch)(()=>[b.items.length,M.value],()=>{k.value&&(0,d.nextTick)(()=>q(G.value))}),(0,d.onBeforeUnmount)(()=>{Ue(),h.delete($);let e=O.value;e?.isConnected&&e.remove()}),g({show:H,close:U,toggle:W,isOpen:k,unreadCount:A}),(n,i)=>((0,d.openBlock)(),(0,d.createElementBlock)(`div`,{ref_key:`rootRef`,ref:E,class:`nb-notification-center`},[(0,d.renderSlot)(n.$slots,`trigger`,{open:k.value,toggle:W,show:H,close:U,unreadCount:A.value,badge:me.value,panelId:w,triggerProps:F.value,setTriggerRef:L},()=>[(0,d.createVNode)(t.t,(0,d.mergeProps)({ref:L,class:[`nb-notification-center__trigger`,{"nb-notification-center__trigger--active":k.value}],variant:`ghost`,size:`sm`,icon:x.value,label:e.label},F.value,{onClick:W}),null,16,[`class`,`icon`,`label`]),A.value>0?((0,d.openBlock)(),(0,d.createElementBlock)(`span`,m,(0,d.toDisplayString)(me.value),1)):(0,d.createCommentVNode)(``,!0)]),((0,d.openBlock)(),(0,d.createBlock)(d.Teleport,{to:`body`,disabled:!(0,d.unref)(v)},[(0,d.createVNode)(d.Transition,{name:`nb-notification-center-pop`},{default:(0,d.withCtx)(()=>[k.value?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,{key:0,id:w,ref_key:`panelRef`,ref:O,class:(0,d.normalizeClass)([`nb-notification-center__panel`,xe.value]),style:(0,d.normalizeStyle)(ye.value),role:`dialog`,tabindex:`-1`,"aria-labelledby":ue,"aria-describedby":_e.value,"aria-busy":e.loading?`true`:void 0,onKeydown:Ae,onFocusin:Oe},[(0,d.createElementVNode)(`div`,te,[(0,d.createElementVNode)(`h2`,{id:ue,class:`nb-notification-center__title`},(0,d.toDisplayString)(e.label),1),(0,d.renderSlot)(n.$slots,`header-start`,{close:U,unreadCount:A.value}),(0,d.renderSlot)(n.$slots,`header-actions`,{close:U,unreadCount:A.value,markAllRead:Ie,markAllPending:e.markAllPending,markAllProps:I.value,markAllText:e.markAllPending?e.markAllPendingLabel:e.markAllLabel},()=>[e.showMarkAll?((0,d.openBlock)(),(0,d.createElementBlock)(`button`,(0,d.mergeProps)({key:0,class:`nb-notification-center__mark-all`},I.value),[e.markAllPending?((0,d.openBlock)(),(0,d.createBlock)(o.t,{key:0,size:`xs`,tone:`inherit`,decorative:``})):(0,d.createCommentVNode)(``,!0),(0,d.createTextVNode)(` `+(0,d.toDisplayString)(e.markAllPending?e.markAllPendingLabel:e.markAllLabel),1)],16)):(0,d.createCommentVNode)(``,!0)]),V.value?((0,d.openBlock)(),(0,d.createBlock)(c.t,{key:0,class:`nb-notification-center__close`,size:`lg`,label:e.closeLabel??(0,d.unref)(y).notificationCenterClose,onClick:i[0]||=e=>U()},null,8,[`label`])):(0,d.createCommentVNode)(``,!0)]),(0,d.createElementVNode)(`span`,ne,(0,d.toDisplayString)(e.markAllPending?e.markAllPendingLabel:``),1),N.value?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,{key:0,id:T,class:`nb-notification-center__stale`,role:`status`},[(0,d.createVNode)(r.t,{name:(0,d.unref)(f.regular),size:`sm`,"aria-hidden":`true`},null,8,[`name`]),(0,d.createElementVNode)(`span`,re,(0,d.toDisplayString)(e.errorStaleLabel),1),e.showRetry?((0,d.openBlock)(),(0,d.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-notification-center__retry`,onClick:P},(0,d.toDisplayString)(e.retryLabel),1)):(0,d.createCommentVNode)(``,!0)])):(0,d.createCommentVNode)(``,!0),M.value===`loading`?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,{key:1,class:`nb-notification-center__loading`,role:`status`,style:(0,d.normalizeStyle)(be.value)},[(0,d.createElementVNode)(`span`,ie,(0,d.toDisplayString)(e.loadingLabel),1),((0,d.openBlock)(),(0,d.createElementBlock)(d.Fragment,null,(0,d.renderList)(3,e=>(0,d.createVNode)(l.t,{key:e,variant:`text`,type:`body-sm`,lines:2,"last-line-width":`60%`})),64))],4)):M.value===`error`?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,{key:2,id:T,class:`nb-notification-center__error`,role:`alert`},[(0,d.renderSlot)(n.$slots,`error`,{retry:P},()=>[(0,d.createVNode)(s.t,{size:`sm`,kind:`error`,title:e.errorTitle,description:e.errorDescription},(0,d.createSlots)({_:2},[e.showRetry?{name:`actions`,fn:(0,d.withCtx)(()=>[(0,d.createVNode)(t.t,{size:`sm`,variant:`secondary`,onClick:P},{default:(0,d.withCtx)(()=>[(0,d.createTextVNode)((0,d.toDisplayString)(e.retryLabel),1)]),_:1})]),key:`0`}:void 0]),1032,[`title`,`description`])])])):M.value===`list`?((0,d.openBlock)(),(0,d.createElementBlock)(`ul`,{key:3,ref_key:`listRef`,ref:fe,class:`nb-notification-center__list`,role:`list`,tabindex:Ee.value,style:(0,d.normalizeStyle)(be.value),onClick:Fe,onKeydown:Fe},[(0,d.renderSlot)(n.$slots,`default`,{close:U,items:e.items},()=>[((0,d.openBlock)(!0),(0,d.createElementBlock)(d.Fragment,null,(0,d.renderList)(e.items,t=>((0,d.openBlock)(),(0,d.createBlock)(u.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=>Pe(t,e)},null,8,[`title`,`body`,`time`,`time-label`,`read`,`variant`,`icon`,`href`,`interactive`,`locale`,`unread-label`,`read-label`,`onSelect`]))),128))])],44,ae)):M.value===`empty`?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,oe,[(0,d.renderSlot)(n.$slots,`empty`,{},()=>[(0,d.createVNode)(s.t,{size:`sm`,icon:x.value,title:e.emptyTitle,description:e.emptyDescription},null,8,[`icon`,`title`,`description`])])])):(0,d.createCommentVNode)(``,!0),n.$slots.footer?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,se,[(0,d.renderSlot)(n.$slots,`footer`,{close:U})])):(0,d.createCommentVNode)(``,!0)],46,ee)):(0,d.createCommentVNode)(``,!0)]),_:3})],8,[`disabled`]))],512))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return x}});
|