@nextcloud/vue 8.7.0 → 8.8.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/CHANGELOG.md +36 -0
- package/dist/Components/NcActionButtonGroup.cjs +1 -1
- package/dist/Components/NcActionButtonGroup.mjs +1 -1
- package/dist/Components/NcActionInput.cjs +1 -1
- package/dist/Components/NcActionInput.mjs +1 -1
- package/dist/Components/NcActions.cjs +1 -1
- package/dist/Components/NcActions.mjs +1 -1
- package/dist/Components/NcAppContent.cjs +1 -1
- package/dist/Components/NcAppContent.mjs +1 -1
- package/dist/Components/NcAppNavigation.cjs +1 -1
- package/dist/Components/NcAppNavigation.mjs +1 -1
- package/dist/Components/NcAppNavigationCaption.cjs +1 -1
- package/dist/Components/NcAppNavigationCaption.mjs +1 -1
- package/dist/Components/NcAppNavigationItem.cjs +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +1 -1
- package/dist/Components/NcAppNavigationList.cjs +20 -0
- package/dist/Components/NcAppNavigationList.cjs.map +1 -0
- package/dist/Components/NcAppNavigationList.mjs +22 -0
- package/dist/Components/NcAppNavigationList.mjs.map +1 -0
- package/dist/Components/NcAppNavigationNewItem.cjs +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +1 -1
- package/dist/Components/NcAppNavigationSpacer.cjs +2 -2
- package/dist/Components/NcAppNavigationSpacer.cjs.map +1 -1
- package/dist/Components/NcAppNavigationSpacer.mjs +5 -5
- package/dist/Components/NcAppNavigationSpacer.mjs.map +1 -1
- package/dist/Components/NcAppNavigationToggle.cjs +1 -1
- package/dist/Components/NcAppNavigationToggle.mjs +1 -1
- package/dist/Components/NcAppSettingsDialog.cjs +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +1 -1
- package/dist/Components/NcAppSidebar.cjs +1 -1
- package/dist/Components/NcAppSidebar.mjs +1 -1
- package/dist/Components/NcAvatar.cjs +1 -1
- package/dist/Components/NcAvatar.mjs +1 -1
- package/dist/Components/NcBreadcrumb.cjs +1 -1
- package/dist/Components/NcBreadcrumb.mjs +1 -1
- package/dist/Components/NcBreadcrumbs.cjs +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +1 -1
- package/dist/Components/NcColorPicker.cjs +1 -1
- package/dist/Components/NcColorPicker.mjs +1 -1
- package/dist/Components/NcContent.cjs +1 -1
- package/dist/Components/NcContent.mjs +1 -1
- package/dist/Components/NcDashboardWidget.cjs +1 -1
- package/dist/Components/NcDashboardWidget.mjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.cjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +1 -1
- package/dist/Components/NcDateTime.cjs +1 -1
- package/dist/Components/NcDateTime.mjs +1 -1
- package/dist/Components/NcDateTimePicker.cjs +2 -2
- package/dist/Components/NcDateTimePicker.mjs +5 -5
- package/dist/Components/NcDateTimePickerNative.cjs +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +1 -1
- package/dist/Components/NcDialog.cjs +1 -1
- package/dist/Components/NcDialog.mjs +1 -1
- package/dist/Components/NcDialogButton.cjs +1 -1
- package/dist/Components/NcDialogButton.mjs +1 -1
- package/dist/Components/NcEmojiPicker.cjs +1 -1
- package/dist/Components/NcEmojiPicker.mjs +1 -1
- package/dist/Components/NcIconSvgWrapper.cjs +1 -1
- package/dist/Components/NcIconSvgWrapper.mjs +1 -1
- package/dist/Components/NcListItem.cjs +1 -1
- package/dist/Components/NcListItem.mjs +1 -1
- package/dist/Components/NcListItemIcon.cjs +1 -1
- package/dist/Components/NcListItemIcon.mjs +1 -1
- package/dist/Components/NcModal.cjs +1 -1
- package/dist/Components/NcModal.mjs +3 -3
- package/dist/Components/NcPasswordField.cjs +1 -1
- package/dist/Components/NcPasswordField.mjs +1 -1
- package/dist/Components/NcPopover.cjs +1 -1
- package/dist/Components/NcPopover.mjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +1 -1
- package/dist/Components/NcRichContenteditable.cjs +1 -1
- package/dist/Components/NcRichContenteditable.mjs +2 -2
- package/dist/Components/NcRichText.cjs +1 -1
- package/dist/Components/NcRichText.mjs +3 -3
- package/dist/Components/NcSelect.cjs +1 -1
- package/dist/Components/NcSelect.mjs +1 -1
- package/dist/Components/NcSelectTags.cjs +1 -1
- package/dist/Components/NcSelectTags.mjs +1 -1
- package/dist/Components/NcSettingsInputText.cjs +1 -1
- package/dist/Components/NcSettingsInputText.mjs +1 -1
- package/dist/Components/NcSettingsSection.cjs +1 -1
- package/dist/Components/NcSettingsSection.mjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
- package/dist/Components/NcTextField.cjs +1 -1
- package/dist/Components/NcTextField.mjs +1 -1
- package/dist/Components/NcTimezonePicker.cjs +1 -1
- package/dist/Components/NcTimezonePicker.mjs +1 -1
- package/dist/Components/NcUserBubble.cjs +1 -1
- package/dist/Components/NcUserBubble.mjs +1 -1
- package/dist/Components/NcUserStatusIcon.cjs +1 -1
- package/dist/Components/NcUserStatusIcon.mjs +1 -1
- package/dist/Functions/reference.cjs +1 -1
- package/dist/Functions/reference.mjs +1 -1
- package/dist/Functions/usernameToColor.cjs +1 -1
- package/dist/Functions/usernameToColor.mjs +1 -1
- package/dist/Mixins/richEditor.cjs +1 -1
- package/dist/Mixins/richEditor.mjs +1 -1
- package/dist/assets/{NcActions-4Gq5bZLW.css → NcActions-mt8BQ_bn.css} +12 -12
- package/dist/assets/{NcAppNavigation-vjqOL-kR.css → NcAppNavigation-9nlYnuUQ.css} +8 -8
- package/dist/assets/{NcAppNavigationCaption-l5yRGXZx.css → NcAppNavigationCaption-I1dcvB0N.css} +11 -5
- package/dist/assets/NcAppNavigationList-RooPPg4w.css +44 -0
- package/dist/assets/NcAppNavigationSpacer-uaft91Uz.css +4 -0
- package/dist/assets/{NcAppSidebar-YHd7DpMW.css → NcAppSidebar-RkF-tqKy.css} +49 -46
- package/dist/assets/{NcColorPicker-PzIRM1j1.css → NcColorPicker-jW6HOxWA.css} +24 -24
- package/dist/assets/{NcDashboardWidgetItem-S7fELANA.css → NcDashboardWidgetItem-OL--xR_P.css} +15 -13
- package/dist/assets/{NcDateTimePicker-w8SEtYvQ.css → NcDateTimePicker-l-C3PwHK.css} +10 -10
- package/dist/assets/{NcEmojiPicker-wTIbvcrG.css → NcEmojiPicker-hTlSVIq0.css} +5 -5
- package/dist/assets/{NcIconSvgWrapper-arqrq5Bj.css → NcIconSvgWrapper-KLotijwU.css} +13 -7
- package/dist/assets/{NcRelatedResourcesPanel-m3uf_nvH.css → NcRelatedResourcesPanel-oq5eMIoh.css} +7 -7
- package/dist/assets/{NcRichContenteditable-N1TxeACO.css → NcRichContenteditable-rW6l0h3m.css} +33 -31
- package/dist/chunks/{GenColors-zPMSiY0e.cjs → GenColors-LzmNxRE8.cjs} +1 -1
- package/dist/chunks/{GenColors-zPMSiY0e.cjs.map → GenColors-LzmNxRE8.cjs.map} +1 -1
- package/dist/chunks/{GenColors-wNwbCHuq.mjs → GenColors-MjG_SfWn.mjs} +1 -1
- package/dist/chunks/{GenColors-wNwbCHuq.mjs.map → GenColors-MjG_SfWn.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-HIUn669C.cjs → NcActionButtonGroup-6TAtQFtq.cjs} +1 -1
- package/dist/chunks/{NcActionButtonGroup-HIUn669C.cjs.map → NcActionButtonGroup-6TAtQFtq.cjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-A5Ixaw5n.mjs → NcActionButtonGroup-w6A9Fw2n.mjs} +1 -1
- package/dist/chunks/{NcActionButtonGroup-A5Ixaw5n.mjs.map → NcActionButtonGroup-w6A9Fw2n.mjs.map} +1 -1
- package/dist/chunks/{NcActionInput-f1Oq2O71.cjs → NcActionInput-Fl2UyuVW.cjs} +1 -1
- package/dist/chunks/{NcActionInput-f1Oq2O71.cjs.map → NcActionInput-Fl2UyuVW.cjs.map} +1 -1
- package/dist/chunks/{NcActionInput-XHMzOL_h.mjs → NcActionInput-yvhGpEsS.mjs} +4 -4
- package/dist/chunks/{NcActionInput-XHMzOL_h.mjs.map → NcActionInput-yvhGpEsS.mjs.map} +1 -1
- package/dist/chunks/{NcActions-JXnhQhum.cjs → NcActions-iACO4laf.cjs} +143 -70
- package/dist/chunks/NcActions-iACO4laf.cjs.map +1 -0
- package/dist/chunks/{NcActions-5_igU-CH.mjs → NcActions-rHzi4RcQ.mjs} +153 -80
- package/dist/chunks/NcActions-rHzi4RcQ.mjs.map +1 -0
- package/dist/chunks/{NcAppContent-Kq5fJ7_W.cjs → NcAppContent--JRFOyLe.cjs} +1 -1
- package/dist/chunks/{NcAppContent-Kq5fJ7_W.cjs.map → NcAppContent--JRFOyLe.cjs.map} +1 -1
- package/dist/chunks/{NcAppContent-WBzZJh-y.mjs → NcAppContent-c0KjHkMb.mjs} +1 -1
- package/dist/chunks/{NcAppContent-WBzZJh-y.mjs.map → NcAppContent-c0KjHkMb.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-n6P3oVZv.mjs → NcAppNavigation-7U8buuT7.mjs} +8 -8
- package/dist/chunks/NcAppNavigation-7U8buuT7.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigation-U6yaDk7k.cjs → NcAppNavigation-AcPesLHq.cjs} +4 -4
- package/dist/chunks/NcAppNavigation-AcPesLHq.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationCaption-Iuzt-yzb.cjs +58 -0
- package/dist/chunks/NcAppNavigationCaption-Iuzt-yzb.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationCaption-UJ7iY1q5.mjs +61 -0
- package/dist/chunks/NcAppNavigationCaption-UJ7iY1q5.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationItem-A1yAdDNN.mjs → NcAppNavigationItem-9n2uXjvj.mjs} +3 -3
- package/dist/chunks/{NcAppNavigationItem-A1yAdDNN.mjs.map → NcAppNavigationItem-9n2uXjvj.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-Wb8gX-Ln.cjs → NcAppNavigationItem-pvFIrGQv.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationItem-Wb8gX-Ln.cjs.map → NcAppNavigationItem-pvFIrGQv.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-TyGHutbG.cjs → NcAppNavigationNewItem-CXGDvuMl.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-TyGHutbG.cjs.map → NcAppNavigationNewItem-CXGDvuMl.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-t1ST1cif.mjs → NcAppNavigationNewItem-jr12p6VL.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-t1ST1cif.mjs.map → NcAppNavigationNewItem-jr12p6VL.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-gwL_FqLN.mjs → NcAppNavigationSettings-NRqRmMXw.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-gwL_FqLN.mjs.map → NcAppNavigationSettings-NRqRmMXw.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-VLa79G7w.cjs → NcAppNavigationSettings-Nd8RJnYL.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-VLa79G7w.cjs.map → NcAppNavigationSettings-Nd8RJnYL.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-Wz0s35Rd.cjs → NcAppNavigationToggle-KZ_xHLv9.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-Wz0s35Rd.cjs.map → NcAppNavigationToggle-KZ_xHLv9.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-KT8eqw6r.mjs → NcAppNavigationToggle-kL5XkG2J.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-KT8eqw6r.mjs.map → NcAppNavigationToggle-kL5XkG2J.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-h22q7l_7.cjs → NcAppSettingsDialog-8l-aNNFq.cjs} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-h22q7l_7.cjs.map → NcAppSettingsDialog-8l-aNNFq.cjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-5t3vGpRF.mjs → NcAppSettingsDialog-S9pm_eoJ.mjs} +2 -2
- package/dist/chunks/{NcAppSettingsDialog-5t3vGpRF.mjs.map → NcAppSettingsDialog-S9pm_eoJ.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-tnHBPGbL.mjs → NcAppSidebar-kN5SMxgh.mjs} +8 -6
- package/dist/chunks/NcAppSidebar-kN5SMxgh.mjs.map +1 -0
- package/dist/chunks/{NcAppSidebar-rRNJnN-k.cjs → NcAppSidebar-l6rV-lnp.cjs} +7 -5
- package/dist/chunks/NcAppSidebar-l6rV-lnp.cjs.map +1 -0
- package/dist/chunks/{NcAvatar-zTS9P1lK.cjs → NcAvatar-CVj9XTPL.cjs} +2 -2
- package/dist/chunks/{NcAvatar-zTS9P1lK.cjs.map → NcAvatar-CVj9XTPL.cjs.map} +1 -1
- package/dist/chunks/{NcAvatar-xT3kz6mU.mjs → NcAvatar-MI8_N7U1.mjs} +4 -4
- package/dist/chunks/{NcAvatar-xT3kz6mU.mjs.map → NcAvatar-MI8_N7U1.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-DEWk7wO9.cjs → NcBreadcrumb-EhfhBqAL.cjs} +1 -1
- package/dist/chunks/{NcBreadcrumb-DEWk7wO9.cjs.map → NcBreadcrumb-EhfhBqAL.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-w1UX2NR-.mjs → NcBreadcrumb-LpXeIBcG.mjs} +1 -1
- package/dist/chunks/{NcBreadcrumb-w1UX2NR-.mjs.map → NcBreadcrumb-LpXeIBcG.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-tRR9CjKD.mjs → NcBreadcrumbs--4xgDVR7.mjs} +2 -2
- package/dist/chunks/{NcBreadcrumbs-tRR9CjKD.mjs.map → NcBreadcrumbs--4xgDVR7.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-VuaG3ex5.cjs → NcBreadcrumbs-zYhyJxEY.cjs} +1 -1
- package/dist/chunks/{NcBreadcrumbs-VuaG3ex5.cjs.map → NcBreadcrumbs-zYhyJxEY.cjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-7pZp_rWo.cjs → NcCheckboxRadioSwitch-Ox3J2r7t.cjs} +2 -2
- package/dist/chunks/{NcCheckboxRadioSwitch-7pZp_rWo.cjs.map → NcCheckboxRadioSwitch-Ox3J2r7t.cjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-PlgK1zWr.mjs → NcCheckboxRadioSwitch-ymUA5BIs.mjs} +2 -2
- package/dist/chunks/{NcCheckboxRadioSwitch-PlgK1zWr.mjs.map → NcCheckboxRadioSwitch-ymUA5BIs.mjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-rJ3UZLGm.mjs → NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-0EjSdGnM.mjs} +1 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-0EjSdGnM.mjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-kOW4T17e.cjs → NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-0FNcC7Nt.cjs} +1 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-0FNcC7Nt.cjs.map +1 -0
- package/dist/chunks/{NcColorPicker-rPobPO3M.mjs → NcColorPicker-1m1Xv5fE.mjs} +6 -6
- package/dist/chunks/NcColorPicker-1m1Xv5fE.mjs.map +1 -0
- package/dist/chunks/{NcColorPicker-yr9Pfeem.cjs → NcColorPicker-7PNp6DUg.cjs} +4 -4
- package/dist/chunks/NcColorPicker-7PNp6DUg.cjs.map +1 -0
- package/dist/chunks/{NcContent-BdekB7Zr.cjs → NcContent-L5DDeJmE.cjs} +1 -1
- package/dist/chunks/{NcContent-BdekB7Zr.cjs.map → NcContent-L5DDeJmE.cjs.map} +1 -1
- package/dist/chunks/{NcContent-EGBAB5sy.mjs → NcContent-YJfqE5Kv.mjs} +2 -2
- package/dist/chunks/{NcContent-EGBAB5sy.mjs.map → NcContent-YJfqE5Kv.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-QciRRvL4.cjs → NcDashboardWidget-KPADyPUh.cjs} +1 -1
- package/dist/chunks/{NcDashboardWidget-QciRRvL4.cjs.map → NcDashboardWidget-KPADyPUh.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-ogqyHahY.mjs → NcDashboardWidget-oUPY199x.mjs} +3 -3
- package/dist/chunks/{NcDashboardWidget-ogqyHahY.mjs.map → NcDashboardWidget-oUPY199x.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-mIPkPR7r.cjs → NcDashboardWidgetItem-KpDnCM7Y.cjs} +4 -4
- package/dist/chunks/NcDashboardWidgetItem-KpDnCM7Y.cjs.map +1 -0
- package/dist/chunks/{NcDashboardWidgetItem-wuUHTeLl.mjs → NcDashboardWidgetItem-iZA9aHuL.mjs} +7 -7
- package/dist/chunks/NcDashboardWidgetItem-iZA9aHuL.mjs.map +1 -0
- package/dist/chunks/{NcDateTime-UCw1o96E.mjs → NcDateTime-EqdvmXRa.mjs} +1 -1
- package/dist/chunks/{NcDateTime-UCw1o96E.mjs.map → NcDateTime-EqdvmXRa.mjs.map} +1 -1
- package/dist/chunks/{NcDateTime-hyWStpUj.cjs → NcDateTime-ez2Mc6Ut.cjs} +1 -1
- package/dist/chunks/{NcDateTime-hyWStpUj.cjs.map → NcDateTime-ez2Mc6Ut.cjs.map} +1 -1
- package/dist/chunks/{NcDialog-652A8lMI.mjs → NcDialog-_HZnlBi4.mjs} +1 -1
- package/dist/chunks/{NcDialog-652A8lMI.mjs.map → NcDialog-_HZnlBi4.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-dPYf81Dr.cjs → NcDialog-f6KwlaqC.cjs} +1 -1
- package/dist/chunks/{NcDialog-dPYf81Dr.cjs.map → NcDialog-f6KwlaqC.cjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-V3nj_xwS.cjs → NcDialogButton-CtdP0-DO.cjs} +1 -1
- package/dist/chunks/{NcDialogButton-V3nj_xwS.cjs.map → NcDialogButton-CtdP0-DO.cjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-QuoJDLGH.mjs → NcDialogButton-xDZQrfsw.mjs} +1 -1
- package/dist/chunks/{NcDialogButton-QuoJDLGH.mjs.map → NcDialogButton-xDZQrfsw.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-O0EAGlkS.mjs → NcEmojiPicker-Qi10uLHB.mjs} +8 -8
- package/dist/chunks/NcEmojiPicker-Qi10uLHB.mjs.map +1 -0
- package/dist/chunks/{NcEmojiPicker-xzt2RvDK.cjs → NcEmojiPicker-gZaqE1rk.cjs} +13 -13
- package/dist/chunks/NcEmojiPicker-gZaqE1rk.cjs.map +1 -0
- package/dist/chunks/{NcIconSvgWrapper-n3MnAe1S.mjs → NcIconSvgWrapper-CvnWKK7h.mjs} +23 -15
- package/dist/chunks/NcIconSvgWrapper-CvnWKK7h.mjs.map +1 -0
- package/dist/chunks/{NcIconSvgWrapper-R7a7dIg4.cjs → NcIconSvgWrapper-RwagV5P9.cjs} +20 -12
- package/dist/chunks/NcIconSvgWrapper-RwagV5P9.cjs.map +1 -0
- package/dist/chunks/{NcInputConfirmCancel-z3ANO-1N.mjs → NcInputConfirmCancel-EgnZwbmj.mjs} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-z3ANO-1N.mjs.map → NcInputConfirmCancel-EgnZwbmj.mjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-tvpFnpKT.cjs → NcInputConfirmCancel-wK1KES_K.cjs} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-tvpFnpKT.cjs.map → NcInputConfirmCancel-wK1KES_K.cjs.map} +1 -1
- package/dist/chunks/{NcListItem--_PCqetA.cjs → NcListItem-7wde4DHX.cjs} +1 -1
- package/dist/chunks/{NcListItem--_PCqetA.cjs.map → NcListItem-7wde4DHX.cjs.map} +1 -1
- package/dist/chunks/{NcListItem-AMcc69jK.mjs → NcListItem-DwAhV_Om.mjs} +2 -2
- package/dist/chunks/{NcListItem-AMcc69jK.mjs.map → NcListItem-DwAhV_Om.mjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-BnoIbVbD.cjs → NcListItemIcon-1qPc7NDv.cjs} +1 -1
- package/dist/chunks/{NcListItemIcon-BnoIbVbD.cjs.map → NcListItemIcon-1qPc7NDv.cjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-rqgXledP.mjs → NcListItemIcon-S06TFU1A.mjs} +2 -2
- package/dist/chunks/{NcListItemIcon-rqgXledP.mjs.map → NcListItemIcon-S06TFU1A.mjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-EbKN3MlL.mjs → NcPasswordField-F30zJsph.mjs} +1 -1
- package/dist/chunks/{NcPasswordField-EbKN3MlL.mjs.map → NcPasswordField-F30zJsph.mjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-IkBZCjOy.cjs → NcPasswordField-hngMvgyo.cjs} +1 -1
- package/dist/chunks/{NcPasswordField-IkBZCjOy.cjs.map → NcPasswordField-hngMvgyo.cjs.map} +1 -1
- package/dist/chunks/{NcPopover-T4GMXmKV.mjs → NcPopover-93ns_0K4.mjs} +38 -23
- package/dist/chunks/NcPopover-93ns_0K4.mjs.map +1 -0
- package/dist/chunks/{NcPopover-judBGW5r.cjs → NcPopover-fv7OFtxM.cjs} +33 -18
- package/dist/chunks/NcPopover-fv7OFtxM.cjs.map +1 -0
- package/dist/chunks/{NcRelatedResourcesPanel-f2UeB_6X.cjs → NcRelatedResourcesPanel-f1Up3M7Q.cjs} +22 -17
- package/dist/chunks/NcRelatedResourcesPanel-f1Up3M7Q.cjs.map +1 -0
- package/dist/chunks/{NcRelatedResourcesPanel-EDvgZgjQ.mjs → NcRelatedResourcesPanel-zXNE9qiS.mjs} +27 -21
- package/dist/chunks/NcRelatedResourcesPanel-zXNE9qiS.mjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-jReu2l-M.cjs → NcRichContenteditable--pSQfJW9.cjs} +45 -46
- package/dist/chunks/NcRichContenteditable--pSQfJW9.cjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-eG8Fyo-M.mjs → NcRichContenteditable-lE_j-Gfc.mjs} +36 -37
- package/dist/chunks/NcRichContenteditable-lE_j-Gfc.mjs.map +1 -0
- package/dist/chunks/{NcRichText-Yo5pFnd0.cjs → NcRichText-0eMrB-8S.cjs} +38 -38
- package/dist/chunks/{NcRichText-Yo5pFnd0.cjs.map → NcRichText-0eMrB-8S.cjs.map} +1 -1
- package/dist/chunks/{NcRichText-qID66jAy.mjs → NcRichText-Vm0d22pV.mjs} +9 -8
- package/dist/chunks/{NcRichText-qID66jAy.mjs.map → NcRichText-Vm0d22pV.mjs.map} +1 -1
- package/dist/chunks/{NcSelect-b2H-YQsK.mjs → NcSelect-75KHhmKy.mjs} +2 -2
- package/dist/chunks/{NcSelect-b2H-YQsK.mjs.map → NcSelect-75KHhmKy.mjs.map} +1 -1
- package/dist/chunks/{NcSelect-U9LJcdIo.cjs → NcSelect-DmqYvkx5.cjs} +1 -1
- package/dist/chunks/{NcSelect-U9LJcdIo.cjs.map → NcSelect-DmqYvkx5.cjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-MlILya2b.mjs → NcSelectTags--fJnxT3p.mjs} +2 -2
- package/dist/chunks/{NcSelectTags-MlILya2b.mjs.map → NcSelectTags--fJnxT3p.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-rO88Pk-1.cjs → NcSelectTags-hNbQxoKD.cjs} +1 -1
- package/dist/chunks/{NcSelectTags-rO88Pk-1.cjs.map → NcSelectTags-hNbQxoKD.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-0K3HYGJr.cjs → NcSettingsInputText-TsKBeDLR.cjs} +1 -1
- package/dist/chunks/{NcSettingsInputText-0K3HYGJr.cjs.map → NcSettingsInputText-TsKBeDLR.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-Pz6fV7At.mjs → NcSettingsInputText-UaZCytJK.mjs} +1 -1
- package/dist/chunks/{NcSettingsInputText-Pz6fV7At.mjs.map → NcSettingsInputText-UaZCytJK.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-CRmU7GLC.mjs → NcSettingsSection-bupJ6Jna.mjs} +1 -1
- package/dist/chunks/{NcSettingsSection-CRmU7GLC.mjs.map → NcSettingsSection-bupJ6Jna.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-IbUOeZ-e.cjs → NcSettingsSection-m79BAMzc.cjs} +1 -1
- package/dist/chunks/{NcSettingsSection-IbUOeZ-e.cjs.map → NcSettingsSection-m79BAMzc.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-rfeDPLCg.cjs → NcSettingsSelectGroup--i1OpaqD.cjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-rfeDPLCg.cjs.map → NcSettingsSelectGroup--i1OpaqD.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-xhnDBg8a.mjs → NcSettingsSelectGroup-OBtXPYek.mjs} +2 -2
- package/dist/chunks/{NcSettingsSelectGroup-xhnDBg8a.mjs.map → NcSettingsSelectGroup-OBtXPYek.mjs.map} +1 -1
- package/dist/chunks/{NcTextField-NnW31cA4.mjs → NcTextField-J7CSrszM.mjs} +1 -1
- package/dist/chunks/{NcTextField-NnW31cA4.mjs.map → NcTextField-J7CSrszM.mjs.map} +1 -1
- package/dist/chunks/{NcTextField-eclRKl_B.cjs → NcTextField-_LseQJYw.cjs} +1 -1
- package/dist/chunks/{NcTextField-eclRKl_B.cjs.map → NcTextField-_LseQJYw.cjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-KG0dvgUv.cjs → NcTimezonePicker-3_GbgBdk.cjs} +1 -1
- package/dist/chunks/{NcTimezonePicker-KG0dvgUv.cjs.map → NcTimezonePicker-3_GbgBdk.cjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-jJeiI-Ff.mjs → NcTimezonePicker-WyBb1HGy.mjs} +2 -2
- package/dist/chunks/{NcTimezonePicker-jJeiI-Ff.mjs.map → NcTimezonePicker-WyBb1HGy.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-9StjszDh.mjs → NcUserBubble-GvPAfzyX.mjs} +2 -2
- package/dist/chunks/{NcUserBubble-9StjszDh.mjs.map → NcUserBubble-GvPAfzyX.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-027_C0cM.cjs → NcUserBubble-dk-rgek6.cjs} +1 -1
- package/dist/chunks/{NcUserBubble-027_C0cM.cjs.map → NcUserBubble-dk-rgek6.cjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-pRUzQidI.mjs → NcUserStatusIcon-Y1esUu9e.mjs} +1 -1
- package/dist/chunks/{NcUserStatusIcon-pRUzQidI.mjs.map → NcUserStatusIcon-Y1esUu9e.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-79RsINrv.cjs → NcUserStatusIcon-vElqf2Lx.cjs} +1 -1
- package/dist/chunks/{NcUserStatusIcon-79RsINrv.cjs.map → NcUserStatusIcon-vElqf2Lx.cjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-R0tAsT2f.cjs → ScopeComponent-Cswoc9a6.cjs} +1 -1
- package/dist/chunks/{ScopeComponent-R0tAsT2f.cjs.map → ScopeComponent-Cswoc9a6.cjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-9fOoDGYa.mjs → ScopeComponent-_g3nK3Vt.mjs} +1 -1
- package/dist/chunks/{ScopeComponent-9fOoDGYa.mjs.map → ScopeComponent-_g3nK3Vt.mjs.map} +1 -1
- package/dist/chunks/_l10n-AmjncLyn.cjs +64 -0
- package/dist/chunks/_l10n-AmjncLyn.cjs.map +1 -0
- package/dist/chunks/_l10n-Y2fvkVoK.mjs +66 -0
- package/dist/chunks/_l10n-Y2fvkVoK.mjs.map +1 -0
- package/dist/chunks/autolink-gVCgJtXh.cjs +55 -0
- package/dist/chunks/autolink-gVCgJtXh.cjs.map +1 -0
- package/dist/chunks/autolink-oKM43mOC.mjs +59 -0
- package/dist/chunks/autolink-oKM43mOC.mjs.map +1 -0
- package/dist/chunks/{index-xnq0-IMW.mjs → index-05Rfhge1.mjs} +1 -1
- package/dist/chunks/index-05Rfhge1.mjs.map +1 -0
- package/dist/chunks/{index-5TyVc_TT.cjs → index-XRGLuo0a.cjs} +1 -1
- package/dist/chunks/index-XRGLuo0a.cjs.map +1 -0
- package/dist/chunks/{referencePickerModal-gDBkGfNV.mjs → referencePickerModal-TxU49swn.mjs} +474 -528
- package/dist/chunks/referencePickerModal-TxU49swn.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-cPBjsn4r.cjs → referencePickerModal-bKXpgb2c.cjs} +464 -517
- package/dist/chunks/referencePickerModal-bKXpgb2c.cjs.map +1 -0
- package/dist/chunks/{usernameToColor-D5bplyWJ.cjs → usernameToColor-AinK73Yf.cjs} +1 -1
- package/dist/chunks/{usernameToColor-D5bplyWJ.cjs.map → usernameToColor-AinK73Yf.cjs.map} +1 -1
- package/dist/chunks/{usernameToColor-xm3MLiw4.mjs → usernameToColor-CgFQ3CLQ.mjs} +1 -1
- package/dist/chunks/{usernameToColor-xm3MLiw4.mjs.map → usernameToColor-CgFQ3CLQ.mjs.map} +1 -1
- package/dist/index.cjs +125 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +231 -228
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/assets/NcAppNavigationSpacer-MfL8GeCN.css +0 -5
- package/dist/chunks/NcActions-5_igU-CH.mjs.map +0 -1
- package/dist/chunks/NcActions-JXnhQhum.cjs.map +0 -1
- package/dist/chunks/NcAppNavigation-U6yaDk7k.cjs.map +0 -1
- package/dist/chunks/NcAppNavigation-n6P3oVZv.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationCaption-2rUO5Mns.mjs +0 -47
- package/dist/chunks/NcAppNavigationCaption-2rUO5Mns.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationCaption-JQWbmgdy.cjs +0 -44
- package/dist/chunks/NcAppNavigationCaption-JQWbmgdy.cjs.map +0 -1
- package/dist/chunks/NcAppSidebar-rRNJnN-k.cjs.map +0 -1
- package/dist/chunks/NcAppSidebar-tnHBPGbL.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-kOW4T17e.cjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-rJ3UZLGm.mjs.map +0 -1
- package/dist/chunks/NcColorPicker-rPobPO3M.mjs.map +0 -1
- package/dist/chunks/NcColorPicker-yr9Pfeem.cjs.map +0 -1
- package/dist/chunks/NcDashboardWidgetItem-mIPkPR7r.cjs.map +0 -1
- package/dist/chunks/NcDashboardWidgetItem-wuUHTeLl.mjs.map +0 -1
- package/dist/chunks/NcEmojiPicker-O0EAGlkS.mjs.map +0 -1
- package/dist/chunks/NcEmojiPicker-xzt2RvDK.cjs.map +0 -1
- package/dist/chunks/NcIconSvgWrapper-R7a7dIg4.cjs.map +0 -1
- package/dist/chunks/NcIconSvgWrapper-n3MnAe1S.mjs.map +0 -1
- package/dist/chunks/NcPopover-T4GMXmKV.mjs.map +0 -1
- package/dist/chunks/NcPopover-judBGW5r.cjs.map +0 -1
- package/dist/chunks/NcRelatedResourcesPanel-EDvgZgjQ.mjs.map +0 -1
- package/dist/chunks/NcRelatedResourcesPanel-f2UeB_6X.cjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-eG8Fyo-M.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-jReu2l-M.cjs.map +0 -1
- package/dist/chunks/_l10n-FmsZpnE4.mjs +0 -66
- package/dist/chunks/_l10n-FmsZpnE4.mjs.map +0 -1
- package/dist/chunks/_l10n-Od-4xzJA.cjs +0 -64
- package/dist/chunks/_l10n-Od-4xzJA.cjs.map +0 -1
- package/dist/chunks/index-5TyVc_TT.cjs.map +0 -1
- package/dist/chunks/index-xnq0-IMW.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-cPBjsn4r.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-gDBkGfNV.mjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../assets/NcPopover-MK4GcuPY.css';
|
|
2
2
|
import s, { defineComponent as a } from "vue";
|
|
3
|
-
import { Dropdown as
|
|
4
|
-
import { createFocusTrap as
|
|
5
|
-
import { g as
|
|
3
|
+
import { Dropdown as i } from "floating-vue";
|
|
4
|
+
import { createFocusTrap as p } from "focus-trap";
|
|
5
|
+
import { g as l } from "./focusTrap-Py2bQ9-r.mjs";
|
|
6
6
|
import { n } from "./_plugin-vue2_normalizer-u6G_3nkj.mjs";
|
|
7
|
-
const
|
|
7
|
+
const u = a({
|
|
8
8
|
name: "NcPopoverTriggerProvider",
|
|
9
9
|
provide() {
|
|
10
10
|
return {
|
|
@@ -19,7 +19,7 @@ const l = a({
|
|
|
19
19
|
},
|
|
20
20
|
popupRole: {
|
|
21
21
|
type: String,
|
|
22
|
-
|
|
22
|
+
default: void 0
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
computed: {
|
|
@@ -36,8 +36,8 @@ const l = a({
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}), c = null, d = null;
|
|
39
|
-
var
|
|
40
|
-
|
|
39
|
+
var g = /* @__PURE__ */ n(
|
|
40
|
+
u,
|
|
41
41
|
c,
|
|
42
42
|
d,
|
|
43
43
|
!1,
|
|
@@ -46,11 +46,11 @@ var h = /* @__PURE__ */ n(
|
|
|
46
46
|
null,
|
|
47
47
|
null
|
|
48
48
|
);
|
|
49
|
-
const
|
|
49
|
+
const h = g.exports, f = {
|
|
50
50
|
name: "NcPopover",
|
|
51
51
|
components: {
|
|
52
|
-
Dropdown:
|
|
53
|
-
NcPopoverTriggerProvider:
|
|
52
|
+
Dropdown: i,
|
|
53
|
+
NcPopoverTriggerProvider: h
|
|
54
54
|
},
|
|
55
55
|
inheritAttrs: !1,
|
|
56
56
|
props: {
|
|
@@ -68,7 +68,7 @@ const f = h.exports, g = {
|
|
|
68
68
|
*/
|
|
69
69
|
popupRole: {
|
|
70
70
|
type: String,
|
|
71
|
-
default:
|
|
71
|
+
default: void 0,
|
|
72
72
|
validator: (t) => ["menu", "listbox", "tree", "grid", "dialog", "true"].includes(t)
|
|
73
73
|
},
|
|
74
74
|
popoverBaseClass: {
|
|
@@ -125,7 +125,16 @@ const f = h.exports, g = {
|
|
|
125
125
|
* Important to check custom trigger button.
|
|
126
126
|
*/
|
|
127
127
|
checkTriggerA11y() {
|
|
128
|
-
window.OC?.debug && (this
|
|
128
|
+
window.OC?.debug && (this.getPopoverTriggerContainerElement().querySelector("[aria-expanded]") || s.util.warn("It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example."));
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* Remove incorrect aria-describedby attribute from the trigger.
|
|
132
|
+
* @see https://github.com/Akryum/floating-vue/blob/8d4f7125aae0e3ea00ba4093d6d2001ab15058f1/packages/floating-vue/src/components/Popper.ts#L734
|
|
133
|
+
*/
|
|
134
|
+
removeFloatingVueAriaDescribedBy() {
|
|
135
|
+
const e = this.getPopoverTriggerContainerElement().querySelectorAll("[data-popper-shown]");
|
|
136
|
+
for (const r of e)
|
|
137
|
+
r.removeAttribute("aria-describedby");
|
|
129
138
|
},
|
|
130
139
|
/**
|
|
131
140
|
* @return {HTMLElement|undefined}
|
|
@@ -133,6 +142,12 @@ const f = h.exports, g = {
|
|
|
133
142
|
getPopoverContentElement() {
|
|
134
143
|
return this.$refs.popover?.$refs.popperContent?.$el;
|
|
135
144
|
},
|
|
145
|
+
/**
|
|
146
|
+
* @return {HTMLElement|undefined}
|
|
147
|
+
*/
|
|
148
|
+
getPopoverTriggerContainerElement() {
|
|
149
|
+
return this.$refs.popover.$refs.reference;
|
|
150
|
+
},
|
|
136
151
|
/**
|
|
137
152
|
* Add focus trap for accessibility.
|
|
138
153
|
*/
|
|
@@ -140,13 +155,13 @@ const f = h.exports, g = {
|
|
|
140
155
|
if (await this.$nextTick(), !this.focusTrap)
|
|
141
156
|
return;
|
|
142
157
|
const t = this.getPopoverContentElement();
|
|
143
|
-
t && (this.$focusTrap =
|
|
158
|
+
t && (this.$focusTrap = p(t, {
|
|
144
159
|
// Prevents to lose focus using esc key
|
|
145
160
|
// Focus will be release when popover be hide
|
|
146
161
|
escapeDeactivates: !1,
|
|
147
162
|
allowOutsideClick: !0,
|
|
148
163
|
setReturnFocus: this.setReturnFocus,
|
|
149
|
-
trapStack:
|
|
164
|
+
trapStack: l()
|
|
150
165
|
}), this.$focusTrap.activate());
|
|
151
166
|
},
|
|
152
167
|
/**
|
|
@@ -184,7 +199,7 @@ const f = h.exports, g = {
|
|
|
184
199
|
t.type === "keydown" && t.key === "Escape" && t.stopPropagation();
|
|
185
200
|
},
|
|
186
201
|
afterShow() {
|
|
187
|
-
this.$nextTick(() => {
|
|
202
|
+
this.removeFloatingVueAriaDescribedBy(), this.$nextTick(() => {
|
|
188
203
|
this.$emit("after-show"), this.useFocusTrap(), this.addEscapeStopPropagation();
|
|
189
204
|
});
|
|
190
205
|
},
|
|
@@ -194,16 +209,16 @@ const f = h.exports, g = {
|
|
|
194
209
|
}
|
|
195
210
|
};
|
|
196
211
|
var m = function() {
|
|
197
|
-
var e = this,
|
|
198
|
-
return
|
|
199
|
-
e.internalShown =
|
|
212
|
+
var e = this, r = e._self._c;
|
|
213
|
+
return r("Dropdown", e._g(e._b({ ref: "popover", attrs: { distance: 10, "arrow-padding": 10, "no-auto-focus": !0, "popper-class": e.popoverBaseClass, shown: e.internalShown }, on: { "update:shown": function(o) {
|
|
214
|
+
e.internalShown = o;
|
|
200
215
|
}, "apply-show": e.afterShow, "apply-hide": e.afterHide }, scopedSlots: e._u([{ key: "popper", fn: function() {
|
|
201
216
|
return [e._t("default")];
|
|
202
|
-
}, proxy: !0 }], null, !0) }, "Dropdown", e.$attrs, !1), e.$listeners), [
|
|
203
|
-
return [e._t("trigger", null, null,
|
|
217
|
+
}, proxy: !0 }], null, !0) }, "Dropdown", e.$attrs, !1), e.$listeners), [r("NcPopoverTriggerProvider", { attrs: { shown: e.internalShown, "popup-role": e.popupRole }, scopedSlots: e._u([{ key: "default", fn: function(o) {
|
|
218
|
+
return [e._t("trigger", null, null, o)];
|
|
204
219
|
} }], null, !0) })], 1);
|
|
205
220
|
}, w = [], v = /* @__PURE__ */ n(
|
|
206
|
-
|
|
221
|
+
f,
|
|
207
222
|
m,
|
|
208
223
|
w,
|
|
209
224
|
!1,
|
|
@@ -212,7 +227,7 @@ var m = function() {
|
|
|
212
227
|
null,
|
|
213
228
|
null
|
|
214
229
|
);
|
|
215
|
-
const
|
|
230
|
+
const E = v.exports;
|
|
216
231
|
export {
|
|
217
|
-
|
|
232
|
+
E as N
|
|
218
233
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NcPopover-93ns_0K4.mjs","sources":["../../src/components/NcPopover/NcPopoverTriggerProvider.vue","../../src/components/NcPopover/NcPopover.vue"],"sourcesContent":["<script>\nimport { defineComponent } from 'vue'\n\nexport default defineComponent({\n\tname: 'NcPopoverTriggerProvider',\n\n\tprovide() {\n\t\treturn {\n\t\t\t'NcPopover:trigger:shown': () => this.shown,\n\t\t\t'NcPopover:trigger:attrs': () => this.triggerAttrs,\n\t\t}\n\t},\n\n\tprops: {\n\t\tshown: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\tpopupRole: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\ttriggerAttrs() {\n\t\t\treturn {\n\t\t\t\t'aria-haspopup': this.popupRole,\n\t\t\t\t'aria-expanded': this.shown.toString(),\n\t\t\t}\n\t\t},\n\t},\n\n\trender() {\n\t\t// TODO: Vue 3 - replace with $slots\n\t\treturn this.$scopedSlots.default?.({\n\t\t\tattrs: this.triggerAttrs,\n\t\t})\n\t},\n})\n</script>\n","<!--\n - @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n\n### General description\n\nThis component is just a wrapper for the floating-vue plugin by Akryum,\nplease refer to this documentation for customization:\nhttps://github.com/Akryum/floating-vue\n\nThis components has two slots:\n* 'trigger' which can be any html element and it will trigger the popover\nthis slot is optional since you can toggle the popover also by updating the\nopen prop on this component;\n\n* a default slot that is for the content of the popover.\n\n### Examples\n\n#### With a `<NcButton>` as a trigger:\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>I am the trigger</NcButton>\n\t\t\t</template>\n\t\t\t<template>\n\t\t\t\t<form tabindex=\"0\" role=\"dialog\" aria-labelledby=\"popover-example-dialog-header-1\" @submit.prevent>\n\t\t\t\t\t<h2 id=\"popover-example-dialog-header-1\">this is some content</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. <br/>\n\t\t\t\t\t\tVestibulum eget placerat velit.\n\t\t\t\t\t</p>\n\t\t\t\t\t<label>\n\t\t\t\t\t\tLabel element\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"input element\"/>\n\t\t\t\t\t</label>\n\t\t\t\t</form>\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### Without focus trap:\n\nThe [`focus-trap`](https://github.com/focus-trap/focus-trap) emits an error when used in a non-focusable element tree.\n\nThe prop `:focus-trap=\"false\"` help to prevent it when the default behavior is not relevant.\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover :focus-trap=\"false\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>Click me!</NcButton>\n\t\t\t</template>\n\t\t\t<template>\n\t\t\t\tHi! 🚀\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### With passing props to `floating-vue`'s `Dropdown`:\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover container=\"body\" :popper-hide-triggers=\"(triggers) => [...triggers, 'click']\" popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>I am the trigger</NcButton>\n\t\t\t</template>\n\t\t\t<template #default>\n\t\t\t\t<NcButton>Click on the button will close NcPopover</NcButton>\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### With a custom button in as a trigger:\n\nWhen `<NcButton>` is used as a `<NcPopover>` trigger, it injects required for a11y attributes to the button.\n\nIf you are using your own custom button as a trigger make sure to bind `attrs` from the trigger slot props.\nSee code example below.\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover>\n\t\t\t<!-- Take \"attrs\" from the slot props -->\n\t\t\t<template #trigger=\"{ attrs }\">\n\t\t\t\t<!-- Bind attrs as the button attrs -->\n\t\t\t\t<button v-bind=\"attrs\">\n\t\t\t\t\tI am a custom button in the trigger\n\t\t\t\t</button>\n\t\t\t</template>\n\n\t\t\tHi! 🚀\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### Provide role for the popover content\n\nFor accessibility reasons, popover should have a role. Provide it to the `popup-role` and make sure that the popover content is an element with the same role.\n\nSee: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<!-- Provide popup role -->\n\t\t<NcPopover popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>Delete</NcButton>\n\t\t\t</template>\n\n\t\t\t<!-- Popover content should has the same role -->\n\t\t\t<div role=\"dialog\" aria-labelledby=\"popover-example-custom-role-1\" aria-modal=\"true\">\n\t\t\t\t<!-- This is not required but better to provide a label -->\n\t\t\t\t<header id=\"popover-example-custom-role-1\">\n\t\t\t\t\t<strong>Confirm remove</strong>\n\t\t\t\t</header>\n\t\t\t\t<NcButton type=\"danger\">Delete</NcButton>\n\t\t\t</div>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n</docs>\n\n<template>\n\t<Dropdown ref=\"popover\"\n\t\t:distance=\"10\"\n\t\t:arrow-padding=\"10\"\n\t\tv-bind=\"$attrs\"\n\t\t:no-auto-focus=\"true /* Handled by the focus trap */\"\n\t\t:popper-class=\"popoverBaseClass\"\n\t\t:shown=\"internalShown\"\n\t\tv-on=\"$listeners\"\n\t\t@update:shown=\"internalShown = $event\"\n\t\t@apply-show=\"afterShow\"\n\t\t@apply-hide=\"afterHide\">\n\t\t<NcPopoverTriggerProvider v-slot=\"slotProps\" :shown=\"internalShown\" :popup-role=\"popupRole\">\n\t\t\t<!-- This will be the popover target (for the events and position) -->\n\t\t\t<slot name=\"trigger\" v-bind=\"slotProps\" />\n\t\t</NcPopoverTriggerProvider>\n\n\t\t<!-- This will be the content of the popover -->\n\t\t<template #popper>\n\t\t\t<slot />\n\t\t</template>\n\t</Dropdown>\n</template>\n\n<script>\nimport Vue from 'vue'\nimport { Dropdown } from 'floating-vue'\nimport { createFocusTrap } from 'focus-trap'\nimport { getTrapStack } from '../../utils/focusTrap.js'\nimport NcPopoverTriggerProvider from './NcPopoverTriggerProvider.vue'\n\nexport default {\n\tname: 'NcPopover',\n\n\tcomponents: {\n\t\tDropdown,\n\t\tNcPopoverTriggerProvider,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Show or hide the popper\n\t\t * @see https://floating-vue.starpad.dev/api/#shown\n\t\t */\n\t\tshown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Popup role\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#values\n\t\t */\n\t\tpopupRole: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: (value) => ['menu', 'listbox', 'tree', 'grid', 'dialog', 'true'].includes(value),\n\t\t},\n\n\t\tpopoverBaseClass: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * Enable popover focus trap\n\t\t */\n\t\tfocusTrap: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\t/**\n\t\t * Set element to return focus to after focus trap deactivation\n\t\t *\n\t\t * @type {import('focus-trap').FocusTargetValueOrFalse}\n\t\t */\n\t\tsetReturnFocus: {\n\t\t\tdefault: undefined,\n\t\t\ttype: [HTMLElement, SVGElement, String, Boolean],\n\t\t},\n\t},\n\n\temits: [\n\t\t'after-show',\n\t\t'after-hide',\n\t\t/**\n\t\t * @see https://floating-vue.starpad.dev/api/#update-shown\n\t\t */\n\t\t'update:shown',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tinternalShown: this.shown,\n\t\t}\n\t},\n\n\twatch: {\n\t\tshown(value) {\n\t\t\tthis.internalShown = value\n\t\t},\n\n\t\tinternalShown(value) {\n\t\t\tthis.$emit('update:shown', value)\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.checkTriggerA11y()\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.clearFocusTrap()\n\t\tthis.clearEscapeStopPropagation()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Check if the trigger has all required a11y attributes.\n\t\t * Important to check custom trigger button.\n\t\t */\n\t\tcheckTriggerA11y() {\n\t\t\tif (window.OC?.debug) {\n\t\t\t\tconst triggerContainer = this.getPopoverTriggerContainerElement()\n\t\t\t\tconst requiredTriggerButton = triggerContainer.querySelector('[aria-expanded]')\n\t\t\t\tif (!requiredTriggerButton) {\n\t\t\t\t\tVue.util.warn('It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example.')\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove incorrect aria-describedby attribute from the trigger.\n\t\t * @see https://github.com/Akryum/floating-vue/blob/8d4f7125aae0e3ea00ba4093d6d2001ab15058f1/packages/floating-vue/src/components/Popper.ts#L734\n\t\t */\n\t\tremoveFloatingVueAriaDescribedBy() {\n\t\t\t// When the popover is shown, floating-vue mutates the root elements of the trigger adding data-popper-shown and incorrect aria-describedby attributes.\n\t\t\tconst triggerContainer = this.getPopoverTriggerContainerElement()\n\t\t\tconst triggerElements = triggerContainer.querySelectorAll('[data-popper-shown]')\n\t\t\tfor (const el of triggerElements) {\n\t\t\t\tel.removeAttribute('aria-describedby')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverContentElement() {\n\t\t\treturn this.$refs.popover?.$refs.popperContent?.$el\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverTriggerContainerElement() {\n\t\t\t// TODO: Vue 3: should be\n\t\t\t// this.$refs.popover.$refs.popper.$refs.reference\n\t\t\treturn this.$refs.popover.$refs.reference\n\t\t},\n\n\t\t/**\n\t\t * Add focus trap for accessibility.\n\t\t */\n\t\tasync useFocusTrap() {\n\t\t\tawait this.$nextTick()\n\n\t\t\tif (!this.focusTrap) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst el = this.getPopoverContentElement()\n\n\t\t\tif (!el) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Init focus trap\n\t\t\tthis.$focusTrap = createFocusTrap(el, {\n\t\t\t\t// Prevents to lose focus using esc key\n\t\t\t\t// Focus will be release when popover be hide\n\t\t\t\tescapeDeactivates: false,\n\t\t\t\tallowOutsideClick: true,\n\t\t\t\tsetReturnFocus: this.setReturnFocus,\n\t\t\t\ttrapStack: getTrapStack(),\n\t\t\t})\n\t\t\tthis.$focusTrap.activate()\n\t\t},\n\n\t\t/**\n\t\t * Remove focus trap\n\t\t *\n\t\t * @param {object} options The configuration options for focusTrap\n\t\t */\n\t\tclearFocusTrap(options = {}) {\n\t\t\ttry {\n\t\t\t\tthis.$focusTrap?.deactivate(options)\n\t\t\t\tthis.$focusTrap = null\n\t\t\t} catch (err) {\n\t\t\t\tconsole.warn(err)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Add stopPropagation for Escape.\n\t\t * It prevents global Escape handling after closing popover.\n\t\t *\n\t\t * Manual event handling is used here instead of v-on because there is no direct access to the node.\n\t\t * Alternative - wrap <template #popover> in a div wrapper.\n\t\t */\n\t\taddEscapeStopPropagation() {\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel?.addEventListener('keydown', this.stopKeydownEscapeHandler)\n\t\t},\n\n\t\t/**\n\t\t * Remove stop Escape handler\n\t\t */\n\t\tclearEscapeStopPropagation() {\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel?.removeEventListener('keydown', this.stopKeydownEscapeHandler)\n\t\t},\n\n\t\t/**\n\t\t * @param {KeyboardEvent} event - native keydown event\n\t\t */\n\t\tstopKeydownEscapeHandler(event) {\n\t\t\tif (event.type === 'keydown' && event.key === 'Escape') {\n\t\t\t\tevent.stopPropagation()\n\t\t\t}\n\t\t},\n\n\t\tafterShow() {\n\t\t\tthis.removeFloatingVueAriaDescribedBy()\n\n\t\t\tthis.$nextTick(() => {\n\t\t\t\t/**\n\t\t\t\t * Triggered after the tooltip was visually displayed.\n\t\t\t\t *\n\t\t\t\t * This is different from the 'show' and 'apply-show' which\n\t\t\t\t * run earlier than this where there is no guarantee that the\n\t\t\t\t * tooltip is already visible and in the DOM.\n\t\t\t\t */\n\t\t\t\tthis.$emit('after-show')\n\t\t\t\tthis.useFocusTrap()\n\t\t\t\tthis.addEscapeStopPropagation()\n\t\t\t})\n\t\t},\n\t\tafterHide() {\n\t\t\t/**\n\t\t\t * Triggered after the tooltip was visually hidden.\n\t\t\t */\n\t\t\tthis.$emit('after-hide')\n\t\t\tthis.clearFocusTrap()\n\t\t\tthis.clearEscapeStopPropagation()\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n\n.resize-observer {\n\tposition:absolute;\n\ttop:0;\n\tleft:0;\n\tz-index:-1;\n\twidth:100%;\n\theight:100%;\n\tborder:none;\n\tbackground-color:transparent;\n\tpointer-events:none;\n\tdisplay:block;\n\toverflow:hidden;\n\topacity:0\n}\n\n.resize-observer object {\n\tdisplay:block;\n\tposition:absolute;\n\ttop:0;\n\tleft:0;\n\theight:100%;\n\twidth:100%;\n\toverflow:hidden;\n\tpointer-events:none;\n\tz-index:-1\n}\n\n$arrow-width: 10px;\n\n.v-popper--theme-dropdown {\n\t&.v-popper__popper {\n\t\tz-index: 100000;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tdisplay: block !important;\n\n\t\tfilter: drop-shadow(0 1px 10px var(--color-box-shadow));\n\n\t\t.v-popper__inner {\n\t\t\tpadding: 0;\n\t\t\tcolor: var(--color-main-text);\n\t\t\tborder-radius: var(--border-radius-large);\n\t\t\toverflow: hidden;\n\t\t\tbackground: var(--color-main-background);\n\t\t}\n\n\t\t.v-popper__arrow-container {\n\t\t\tposition: absolute;\n\t\t\tz-index: 1;\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder-style: solid;\n\t\t\tborder-color: transparent;\n\t\t\tborder-width: $arrow-width;\n\t\t}\n\n\t\t&[data-popper-placement^='top'] .v-popper__arrow-container {\n\t\t\tbottom: -$arrow-width;\n\t\t\tborder-bottom-width: 0;\n\t\t\tborder-top-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='bottom'] .v-popper__arrow-container {\n\t\t\ttop: -$arrow-width;\n\t\t\tborder-top-width: 0;\n\t\t\tborder-bottom-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='right'] .v-popper__arrow-container {\n\t\t\tleft: -$arrow-width;\n\t\t\tborder-left-width: 0;\n\t\t\tborder-right-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='left'] .v-popper__arrow-container {\n\t\t\tright: -$arrow-width;\n\t\t\tborder-right-width: 0;\n\t\t\tborder-left-color: var(--color-main-background);\n\t\t}\n\n\t\t&[aria-hidden='true'] {\n\t\t\tvisibility: hidden;\n\t\t\ttransition: opacity var(--animation-quick), visibility var(--animation-quick);\n\t\t\topacity: 0;\n\t\t}\n\n\t\t&[aria-hidden='false'] {\n\t\t\tvisibility: visible;\n\t\t\ttransition: opacity var(--animation-quick);\n\t\t\topacity: 1;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","defineComponent","Dropdown","NcPopoverTriggerProvider","value","Vue","triggerElements","el","createFocusTrap","getTrapStack","options","err","event"],"mappings":";;;;;AAGA,MAAAA,IAAAC,EAAA;AAAA,EACA,MAAA;AAAA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A,IAOA,eAAAC,IAAA,IAAA;AACA,UAAA;AACA,aAAA,YAAA,WAAAA,CAAA,GACA,KAAA,aAAA;AAAA,MACA,SAAAC,GAAA;AACA,gBAAA,KAAAA,CAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,2BAAA;AAEA,MADA,KAAA,yBAAA,GACA,iBAAA,WAAA,KAAA,wBAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,6BAAA;AAEA,MADA,KAAA,yBAAA,GACA,oBAAA,WAAA,KAAA,wBAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,yBAAAC,GAAA;AACA,MAAAA,EAAA,SAAA,aAAAA,EAAA,QAAA,YACAA,EAAA,gBAAA;AAAA,IAEA;AAAA,IAEA,YAAA;AACA,WAAA,iCAAA,GAEA,KAAA,UAAA,MAAA;AAQA,aAAA,MAAA,YAAA,GACA,KAAA,aAAA,GACA,KAAA,yBAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IACA,YAAA;AAIA,WAAA,MAAA,YAAA,GACA,KAAA,eAAA,GACA,KAAA,2BAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -15,7 +15,7 @@ const n = require("vue"), a = require("floating-vue"), i = require("focus-trap")
|
|
|
15
15
|
},
|
|
16
16
|
popupRole: {
|
|
17
17
|
type: String,
|
|
18
|
-
|
|
18
|
+
default: void 0
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
computed: {
|
|
@@ -31,22 +31,22 @@ const n = require("vue"), a = require("floating-vue"), i = require("focus-trap")
|
|
|
31
31
|
attrs: this.triggerAttrs
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
}), d = null,
|
|
35
|
-
var
|
|
34
|
+
}), d = null, g = null;
|
|
35
|
+
var h = /* @__PURE__ */ s.normalizeComponent(
|
|
36
36
|
c,
|
|
37
37
|
d,
|
|
38
|
-
|
|
38
|
+
g,
|
|
39
39
|
!1,
|
|
40
40
|
null,
|
|
41
41
|
null,
|
|
42
42
|
null,
|
|
43
43
|
null
|
|
44
44
|
);
|
|
45
|
-
const
|
|
45
|
+
const f = h.exports, w = {
|
|
46
46
|
name: "NcPopover",
|
|
47
47
|
components: {
|
|
48
48
|
Dropdown: a.Dropdown,
|
|
49
|
-
NcPopoverTriggerProvider:
|
|
49
|
+
NcPopoverTriggerProvider: f
|
|
50
50
|
},
|
|
51
51
|
inheritAttrs: !1,
|
|
52
52
|
props: {
|
|
@@ -64,7 +64,7 @@ const g = f.exports, w = {
|
|
|
64
64
|
*/
|
|
65
65
|
popupRole: {
|
|
66
66
|
type: String,
|
|
67
|
-
default:
|
|
67
|
+
default: void 0,
|
|
68
68
|
validator: (e) => ["menu", "listbox", "tree", "grid", "dialog", "true"].includes(e)
|
|
69
69
|
},
|
|
70
70
|
popoverBaseClass: {
|
|
@@ -121,7 +121,16 @@ const g = f.exports, w = {
|
|
|
121
121
|
* Important to check custom trigger button.
|
|
122
122
|
*/
|
|
123
123
|
checkTriggerA11y() {
|
|
124
|
-
window.OC?.debug && (this
|
|
124
|
+
window.OC?.debug && (this.getPopoverTriggerContainerElement().querySelector("[aria-expanded]") || l.default.util.warn("It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example."));
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Remove incorrect aria-describedby attribute from the trigger.
|
|
128
|
+
* @see https://github.com/Akryum/floating-vue/blob/8d4f7125aae0e3ea00ba4093d6d2001ab15058f1/packages/floating-vue/src/components/Popper.ts#L734
|
|
129
|
+
*/
|
|
130
|
+
removeFloatingVueAriaDescribedBy() {
|
|
131
|
+
const t = this.getPopoverTriggerContainerElement().querySelectorAll("[data-popper-shown]");
|
|
132
|
+
for (const r of t)
|
|
133
|
+
r.removeAttribute("aria-describedby");
|
|
125
134
|
},
|
|
126
135
|
/**
|
|
127
136
|
* @return {HTMLElement|undefined}
|
|
@@ -129,6 +138,12 @@ const g = f.exports, w = {
|
|
|
129
138
|
getPopoverContentElement() {
|
|
130
139
|
return this.$refs.popover?.$refs.popperContent?.$el;
|
|
131
140
|
},
|
|
141
|
+
/**
|
|
142
|
+
* @return {HTMLElement|undefined}
|
|
143
|
+
*/
|
|
144
|
+
getPopoverTriggerContainerElement() {
|
|
145
|
+
return this.$refs.popover.$refs.reference;
|
|
146
|
+
},
|
|
132
147
|
/**
|
|
133
148
|
* Add focus trap for accessibility.
|
|
134
149
|
*/
|
|
@@ -180,7 +195,7 @@ const g = f.exports, w = {
|
|
|
180
195
|
e.type === "keydown" && e.key === "Escape" && e.stopPropagation();
|
|
181
196
|
},
|
|
182
197
|
afterShow() {
|
|
183
|
-
this.$nextTick(() => {
|
|
198
|
+
this.removeFloatingVueAriaDescribedBy(), this.$nextTick(() => {
|
|
184
199
|
this.$emit("after-show"), this.useFocusTrap(), this.addEscapeStopPropagation();
|
|
185
200
|
});
|
|
186
201
|
},
|
|
@@ -189,24 +204,24 @@ const g = f.exports, w = {
|
|
|
189
204
|
}
|
|
190
205
|
}
|
|
191
206
|
};
|
|
192
|
-
var
|
|
193
|
-
var t = this,
|
|
194
|
-
return
|
|
195
|
-
t.internalShown =
|
|
207
|
+
var v = function() {
|
|
208
|
+
var t = this, r = t._self._c;
|
|
209
|
+
return r("Dropdown", t._g(t._b({ ref: "popover", attrs: { distance: 10, "arrow-padding": 10, "no-auto-focus": !0, "popper-class": t.popoverBaseClass, shown: t.internalShown }, on: { "update:shown": function(o) {
|
|
210
|
+
t.internalShown = o;
|
|
196
211
|
}, "apply-show": t.afterShow, "apply-hide": t.afterHide }, scopedSlots: t._u([{ key: "popper", fn: function() {
|
|
197
212
|
return [t._t("default")];
|
|
198
|
-
}, proxy: !0 }], null, !0) }, "Dropdown", t.$attrs, !1), t.$listeners), [
|
|
199
|
-
return [t._t("trigger", null, null,
|
|
213
|
+
}, proxy: !0 }], null, !0) }, "Dropdown", t.$attrs, !1), t.$listeners), [r("NcPopoverTriggerProvider", { attrs: { shown: t.internalShown, "popup-role": t.popupRole }, scopedSlots: t._u([{ key: "default", fn: function(o) {
|
|
214
|
+
return [t._t("trigger", null, null, o)];
|
|
200
215
|
} }], null, !0) })], 1);
|
|
201
|
-
},
|
|
216
|
+
}, m = [], _ = /* @__PURE__ */ s.normalizeComponent(
|
|
202
217
|
w,
|
|
203
|
-
_,
|
|
204
218
|
v,
|
|
219
|
+
m,
|
|
205
220
|
!1,
|
|
206
221
|
null,
|
|
207
222
|
null,
|
|
208
223
|
null,
|
|
209
224
|
null
|
|
210
225
|
);
|
|
211
|
-
const y =
|
|
226
|
+
const y = _.exports;
|
|
212
227
|
exports.NcPopover = y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NcPopover-fv7OFtxM.cjs","sources":["../../src/components/NcPopover/NcPopoverTriggerProvider.vue","../../src/components/NcPopover/NcPopover.vue"],"sourcesContent":["<script>\nimport { defineComponent } from 'vue'\n\nexport default defineComponent({\n\tname: 'NcPopoverTriggerProvider',\n\n\tprovide() {\n\t\treturn {\n\t\t\t'NcPopover:trigger:shown': () => this.shown,\n\t\t\t'NcPopover:trigger:attrs': () => this.triggerAttrs,\n\t\t}\n\t},\n\n\tprops: {\n\t\tshown: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\tpopupRole: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\ttriggerAttrs() {\n\t\t\treturn {\n\t\t\t\t'aria-haspopup': this.popupRole,\n\t\t\t\t'aria-expanded': this.shown.toString(),\n\t\t\t}\n\t\t},\n\t},\n\n\trender() {\n\t\t// TODO: Vue 3 - replace with $slots\n\t\treturn this.$scopedSlots.default?.({\n\t\t\tattrs: this.triggerAttrs,\n\t\t})\n\t},\n})\n</script>\n","<!--\n - @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n\n### General description\n\nThis component is just a wrapper for the floating-vue plugin by Akryum,\nplease refer to this documentation for customization:\nhttps://github.com/Akryum/floating-vue\n\nThis components has two slots:\n* 'trigger' which can be any html element and it will trigger the popover\nthis slot is optional since you can toggle the popover also by updating the\nopen prop on this component;\n\n* a default slot that is for the content of the popover.\n\n### Examples\n\n#### With a `<NcButton>` as a trigger:\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>I am the trigger</NcButton>\n\t\t\t</template>\n\t\t\t<template>\n\t\t\t\t<form tabindex=\"0\" role=\"dialog\" aria-labelledby=\"popover-example-dialog-header-1\" @submit.prevent>\n\t\t\t\t\t<h2 id=\"popover-example-dialog-header-1\">this is some content</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. <br/>\n\t\t\t\t\t\tVestibulum eget placerat velit.\n\t\t\t\t\t</p>\n\t\t\t\t\t<label>\n\t\t\t\t\t\tLabel element\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"input element\"/>\n\t\t\t\t\t</label>\n\t\t\t\t</form>\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### Without focus trap:\n\nThe [`focus-trap`](https://github.com/focus-trap/focus-trap) emits an error when used in a non-focusable element tree.\n\nThe prop `:focus-trap=\"false\"` help to prevent it when the default behavior is not relevant.\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover :focus-trap=\"false\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>Click me!</NcButton>\n\t\t\t</template>\n\t\t\t<template>\n\t\t\t\tHi! 🚀\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### With passing props to `floating-vue`'s `Dropdown`:\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover container=\"body\" :popper-hide-triggers=\"(triggers) => [...triggers, 'click']\" popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>I am the trigger</NcButton>\n\t\t\t</template>\n\t\t\t<template #default>\n\t\t\t\t<NcButton>Click on the button will close NcPopover</NcButton>\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### With a custom button in as a trigger:\n\nWhen `<NcButton>` is used as a `<NcPopover>` trigger, it injects required for a11y attributes to the button.\n\nIf you are using your own custom button as a trigger make sure to bind `attrs` from the trigger slot props.\nSee code example below.\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover>\n\t\t\t<!-- Take \"attrs\" from the slot props -->\n\t\t\t<template #trigger=\"{ attrs }\">\n\t\t\t\t<!-- Bind attrs as the button attrs -->\n\t\t\t\t<button v-bind=\"attrs\">\n\t\t\t\t\tI am a custom button in the trigger\n\t\t\t\t</button>\n\t\t\t</template>\n\n\t\t\tHi! 🚀\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### Provide role for the popover content\n\nFor accessibility reasons, popover should have a role. Provide it to the `popup-role` and make sure that the popover content is an element with the same role.\n\nSee: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<!-- Provide popup role -->\n\t\t<NcPopover popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>Delete</NcButton>\n\t\t\t</template>\n\n\t\t\t<!-- Popover content should has the same role -->\n\t\t\t<div role=\"dialog\" aria-labelledby=\"popover-example-custom-role-1\" aria-modal=\"true\">\n\t\t\t\t<!-- This is not required but better to provide a label -->\n\t\t\t\t<header id=\"popover-example-custom-role-1\">\n\t\t\t\t\t<strong>Confirm remove</strong>\n\t\t\t\t</header>\n\t\t\t\t<NcButton type=\"danger\">Delete</NcButton>\n\t\t\t</div>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n</docs>\n\n<template>\n\t<Dropdown ref=\"popover\"\n\t\t:distance=\"10\"\n\t\t:arrow-padding=\"10\"\n\t\tv-bind=\"$attrs\"\n\t\t:no-auto-focus=\"true /* Handled by the focus trap */\"\n\t\t:popper-class=\"popoverBaseClass\"\n\t\t:shown=\"internalShown\"\n\t\tv-on=\"$listeners\"\n\t\t@update:shown=\"internalShown = $event\"\n\t\t@apply-show=\"afterShow\"\n\t\t@apply-hide=\"afterHide\">\n\t\t<NcPopoverTriggerProvider v-slot=\"slotProps\" :shown=\"internalShown\" :popup-role=\"popupRole\">\n\t\t\t<!-- This will be the popover target (for the events and position) -->\n\t\t\t<slot name=\"trigger\" v-bind=\"slotProps\" />\n\t\t</NcPopoverTriggerProvider>\n\n\t\t<!-- This will be the content of the popover -->\n\t\t<template #popper>\n\t\t\t<slot />\n\t\t</template>\n\t</Dropdown>\n</template>\n\n<script>\nimport Vue from 'vue'\nimport { Dropdown } from 'floating-vue'\nimport { createFocusTrap } from 'focus-trap'\nimport { getTrapStack } from '../../utils/focusTrap.js'\nimport NcPopoverTriggerProvider from './NcPopoverTriggerProvider.vue'\n\nexport default {\n\tname: 'NcPopover',\n\n\tcomponents: {\n\t\tDropdown,\n\t\tNcPopoverTriggerProvider,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Show or hide the popper\n\t\t * @see https://floating-vue.starpad.dev/api/#shown\n\t\t */\n\t\tshown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Popup role\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#values\n\t\t */\n\t\tpopupRole: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: (value) => ['menu', 'listbox', 'tree', 'grid', 'dialog', 'true'].includes(value),\n\t\t},\n\n\t\tpopoverBaseClass: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * Enable popover focus trap\n\t\t */\n\t\tfocusTrap: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\t/**\n\t\t * Set element to return focus to after focus trap deactivation\n\t\t *\n\t\t * @type {import('focus-trap').FocusTargetValueOrFalse}\n\t\t */\n\t\tsetReturnFocus: {\n\t\t\tdefault: undefined,\n\t\t\ttype: [HTMLElement, SVGElement, String, Boolean],\n\t\t},\n\t},\n\n\temits: [\n\t\t'after-show',\n\t\t'after-hide',\n\t\t/**\n\t\t * @see https://floating-vue.starpad.dev/api/#update-shown\n\t\t */\n\t\t'update:shown',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tinternalShown: this.shown,\n\t\t}\n\t},\n\n\twatch: {\n\t\tshown(value) {\n\t\t\tthis.internalShown = value\n\t\t},\n\n\t\tinternalShown(value) {\n\t\t\tthis.$emit('update:shown', value)\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.checkTriggerA11y()\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.clearFocusTrap()\n\t\tthis.clearEscapeStopPropagation()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Check if the trigger has all required a11y attributes.\n\t\t * Important to check custom trigger button.\n\t\t */\n\t\tcheckTriggerA11y() {\n\t\t\tif (window.OC?.debug) {\n\t\t\t\tconst triggerContainer = this.getPopoverTriggerContainerElement()\n\t\t\t\tconst requiredTriggerButton = triggerContainer.querySelector('[aria-expanded]')\n\t\t\t\tif (!requiredTriggerButton) {\n\t\t\t\t\tVue.util.warn('It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example.')\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove incorrect aria-describedby attribute from the trigger.\n\t\t * @see https://github.com/Akryum/floating-vue/blob/8d4f7125aae0e3ea00ba4093d6d2001ab15058f1/packages/floating-vue/src/components/Popper.ts#L734\n\t\t */\n\t\tremoveFloatingVueAriaDescribedBy() {\n\t\t\t// When the popover is shown, floating-vue mutates the root elements of the trigger adding data-popper-shown and incorrect aria-describedby attributes.\n\t\t\tconst triggerContainer = this.getPopoverTriggerContainerElement()\n\t\t\tconst triggerElements = triggerContainer.querySelectorAll('[data-popper-shown]')\n\t\t\tfor (const el of triggerElements) {\n\t\t\t\tel.removeAttribute('aria-describedby')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverContentElement() {\n\t\t\treturn this.$refs.popover?.$refs.popperContent?.$el\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverTriggerContainerElement() {\n\t\t\t// TODO: Vue 3: should be\n\t\t\t// this.$refs.popover.$refs.popper.$refs.reference\n\t\t\treturn this.$refs.popover.$refs.reference\n\t\t},\n\n\t\t/**\n\t\t * Add focus trap for accessibility.\n\t\t */\n\t\tasync useFocusTrap() {\n\t\t\tawait this.$nextTick()\n\n\t\t\tif (!this.focusTrap) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst el = this.getPopoverContentElement()\n\n\t\t\tif (!el) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Init focus trap\n\t\t\tthis.$focusTrap = createFocusTrap(el, {\n\t\t\t\t// Prevents to lose focus using esc key\n\t\t\t\t// Focus will be release when popover be hide\n\t\t\t\tescapeDeactivates: false,\n\t\t\t\tallowOutsideClick: true,\n\t\t\t\tsetReturnFocus: this.setReturnFocus,\n\t\t\t\ttrapStack: getTrapStack(),\n\t\t\t})\n\t\t\tthis.$focusTrap.activate()\n\t\t},\n\n\t\t/**\n\t\t * Remove focus trap\n\t\t *\n\t\t * @param {object} options The configuration options for focusTrap\n\t\t */\n\t\tclearFocusTrap(options = {}) {\n\t\t\ttry {\n\t\t\t\tthis.$focusTrap?.deactivate(options)\n\t\t\t\tthis.$focusTrap = null\n\t\t\t} catch (err) {\n\t\t\t\tconsole.warn(err)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Add stopPropagation for Escape.\n\t\t * It prevents global Escape handling after closing popover.\n\t\t *\n\t\t * Manual event handling is used here instead of v-on because there is no direct access to the node.\n\t\t * Alternative - wrap <template #popover> in a div wrapper.\n\t\t */\n\t\taddEscapeStopPropagation() {\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel?.addEventListener('keydown', this.stopKeydownEscapeHandler)\n\t\t},\n\n\t\t/**\n\t\t * Remove stop Escape handler\n\t\t */\n\t\tclearEscapeStopPropagation() {\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel?.removeEventListener('keydown', this.stopKeydownEscapeHandler)\n\t\t},\n\n\t\t/**\n\t\t * @param {KeyboardEvent} event - native keydown event\n\t\t */\n\t\tstopKeydownEscapeHandler(event) {\n\t\t\tif (event.type === 'keydown' && event.key === 'Escape') {\n\t\t\t\tevent.stopPropagation()\n\t\t\t}\n\t\t},\n\n\t\tafterShow() {\n\t\t\tthis.removeFloatingVueAriaDescribedBy()\n\n\t\t\tthis.$nextTick(() => {\n\t\t\t\t/**\n\t\t\t\t * Triggered after the tooltip was visually displayed.\n\t\t\t\t *\n\t\t\t\t * This is different from the 'show' and 'apply-show' which\n\t\t\t\t * run earlier than this where there is no guarantee that the\n\t\t\t\t * tooltip is already visible and in the DOM.\n\t\t\t\t */\n\t\t\t\tthis.$emit('after-show')\n\t\t\t\tthis.useFocusTrap()\n\t\t\t\tthis.addEscapeStopPropagation()\n\t\t\t})\n\t\t},\n\t\tafterHide() {\n\t\t\t/**\n\t\t\t * Triggered after the tooltip was visually hidden.\n\t\t\t */\n\t\t\tthis.$emit('after-hide')\n\t\t\tthis.clearFocusTrap()\n\t\t\tthis.clearEscapeStopPropagation()\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n\n.resize-observer {\n\tposition:absolute;\n\ttop:0;\n\tleft:0;\n\tz-index:-1;\n\twidth:100%;\n\theight:100%;\n\tborder:none;\n\tbackground-color:transparent;\n\tpointer-events:none;\n\tdisplay:block;\n\toverflow:hidden;\n\topacity:0\n}\n\n.resize-observer object {\n\tdisplay:block;\n\tposition:absolute;\n\ttop:0;\n\tleft:0;\n\theight:100%;\n\twidth:100%;\n\toverflow:hidden;\n\tpointer-events:none;\n\tz-index:-1\n}\n\n$arrow-width: 10px;\n\n.v-popper--theme-dropdown {\n\t&.v-popper__popper {\n\t\tz-index: 100000;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tdisplay: block !important;\n\n\t\tfilter: drop-shadow(0 1px 10px var(--color-box-shadow));\n\n\t\t.v-popper__inner {\n\t\t\tpadding: 0;\n\t\t\tcolor: var(--color-main-text);\n\t\t\tborder-radius: var(--border-radius-large);\n\t\t\toverflow: hidden;\n\t\t\tbackground: var(--color-main-background);\n\t\t}\n\n\t\t.v-popper__arrow-container {\n\t\t\tposition: absolute;\n\t\t\tz-index: 1;\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder-style: solid;\n\t\t\tborder-color: transparent;\n\t\t\tborder-width: $arrow-width;\n\t\t}\n\n\t\t&[data-popper-placement^='top'] .v-popper__arrow-container {\n\t\t\tbottom: -$arrow-width;\n\t\t\tborder-bottom-width: 0;\n\t\t\tborder-top-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='bottom'] .v-popper__arrow-container {\n\t\t\ttop: -$arrow-width;\n\t\t\tborder-top-width: 0;\n\t\t\tborder-bottom-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='right'] .v-popper__arrow-container {\n\t\t\tleft: -$arrow-width;\n\t\t\tborder-left-width: 0;\n\t\t\tborder-right-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='left'] .v-popper__arrow-container {\n\t\t\tright: -$arrow-width;\n\t\t\tborder-right-width: 0;\n\t\t\tborder-left-color: var(--color-main-background);\n\t\t}\n\n\t\t&[aria-hidden='true'] {\n\t\t\tvisibility: hidden;\n\t\t\ttransition: opacity var(--animation-quick), visibility var(--animation-quick);\n\t\t\topacity: 0;\n\t\t}\n\n\t\t&[aria-hidden='false'] {\n\t\t\tvisibility: visible;\n\t\t\ttransition: opacity var(--animation-quick);\n\t\t\topacity: 1;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","defineComponent","Dropdown","NcPopoverTriggerProvider","value","Vue","triggerElements","el","createFocusTrap","getTrapStack","options","err","event"],"mappings":";+PAGAA,IAAAC,EAAAA,gBAAA;AAAA,EACA,MAAA;AAAA,EAEA,UAAA;AACA,WAAA;AAAA,MACA,2BAAA,MAAA,KAAA;AAAA,MACA,2BAAA,MAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,eAAA;AACA,aAAA;AAAA,QACA,iBAAA,KAAA;AAAA,QACA,iBAAA,KAAA,MAAA,SAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAEA,WAAA,KAAA,aAAA,UAAA;AAAA,MACA,OAAA,KAAA;AAAA,IACA,CAAA;AAAA,EACA;AAC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AA,EAAA,gBAAA;AAAA,IAEA;AAAA,IAEA,YAAA;AACA,WAAA,iCAAA,GAEA,KAAA,UAAA,MAAA;AAQA,aAAA,MAAA,YAAA,GACA,KAAA,aAAA,GACA,KAAA,yBAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IACA,YAAA;AAIA,WAAA,MAAA,YAAA,GACA,KAAA,eAAA,GACA,KAAA,2BAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/chunks/{NcRelatedResourcesPanel-f2UeB_6X.cjs → NcRelatedResourcesPanel-f1Up3M7Q.cjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
require('../assets/NcRelatedResourcesPanel-
|
|
1
|
+
require('../assets/NcRelatedResourcesPanel-oq5eMIoh.css');
|
|
2
2
|
"use strict";
|
|
3
|
-
const o = require("@nextcloud/axios"), l = require("@nextcloud/router"), a = require("../Components/NcButton.cjs"), s = require("./_l10n-
|
|
3
|
+
const o = require("@nextcloud/axios"), l = require("@nextcloud/router"), a = require("../Components/NcButton.cjs"), u = require("./autolink-gVCgJtXh.cjs"), s = require("./_l10n-AmjncLyn.cjs"), n = require("./_plugin-vue2_normalizer-DCfUPqga.cjs"), c = (r) => r && r.__esModule ? r : { default: r }, d = /* @__PURE__ */ c(o);
|
|
4
4
|
s.register(s.t31);
|
|
5
|
-
const
|
|
5
|
+
const h = {
|
|
6
6
|
name: "NcResource",
|
|
7
7
|
components: {
|
|
8
8
|
NcButton: a
|
|
@@ -26,31 +26,36 @@ const d = {
|
|
|
26
26
|
labelTranslated: s.t('Open link to "{resourceName}"', { resourceName: this.name })
|
|
27
27
|
};
|
|
28
28
|
},
|
|
29
|
+
computed: {
|
|
30
|
+
route() {
|
|
31
|
+
return u.getRoute(this.$router, this.url);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
29
34
|
methods: {
|
|
30
35
|
t: s.t
|
|
31
36
|
}
|
|
32
37
|
};
|
|
33
38
|
var f = function() {
|
|
34
39
|
var e = this, t = e._self._c;
|
|
35
|
-
return t("li", { staticClass: "resource" }, [t("NcButton", { staticClass: "resource__button", attrs: { "aria-label": e.labelTranslated, type: "tertiary", href: e.url }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
40
|
+
return t("li", { staticClass: "resource" }, [t("NcButton", { staticClass: "resource__button", attrs: { "aria-label": e.labelTranslated, type: "tertiary", to: e.route, href: e.route ? null : e.url }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
36
41
|
return [t("div", { staticClass: "resource__icon" }, [t("img", { attrs: { src: e.icon } })])];
|
|
37
42
|
}, proxy: !0 }]) }, [e._v(" " + e._s(e.name) + " ")])], 1);
|
|
38
|
-
},
|
|
39
|
-
d,
|
|
40
|
-
f,
|
|
43
|
+
}, p = [], _ = /* @__PURE__ */ n.normalizeComponent(
|
|
41
44
|
h,
|
|
45
|
+
f,
|
|
46
|
+
p,
|
|
42
47
|
!1,
|
|
43
48
|
null,
|
|
44
|
-
"
|
|
49
|
+
"dd53e5b9",
|
|
45
50
|
null,
|
|
46
51
|
null
|
|
47
52
|
);
|
|
48
|
-
const
|
|
53
|
+
const m = _.exports;
|
|
49
54
|
s.register(s.t8);
|
|
50
|
-
const
|
|
55
|
+
const y = {
|
|
51
56
|
name: "NcRelatedResourcesPanel",
|
|
52
57
|
components: {
|
|
53
|
-
NcResource:
|
|
58
|
+
NcResource: m
|
|
54
59
|
},
|
|
55
60
|
props: {
|
|
56
61
|
/**
|
|
@@ -170,7 +175,7 @@ const m = {
|
|
|
170
175
|
if (!(!this.appEnabled || !this.hasResourceInfo)) {
|
|
171
176
|
this.loading = !0, this.error = null, this.resources = [];
|
|
172
177
|
try {
|
|
173
|
-
const r = await
|
|
178
|
+
const r = await d.default.get(this.url);
|
|
174
179
|
this.resources = r.data.ocs?.data;
|
|
175
180
|
} catch (r) {
|
|
176
181
|
this.error = r, console.error(r);
|
|
@@ -181,20 +186,20 @@ const m = {
|
|
|
181
186
|
}
|
|
182
187
|
}
|
|
183
188
|
};
|
|
184
|
-
var
|
|
189
|
+
var g = function() {
|
|
185
190
|
var e = this, t = e._self._c;
|
|
186
191
|
return e.appEnabled && e.isVisible ? t("div", { staticClass: "related-resources" }, [t("div", { staticClass: "related-resources__header" }, [t("h5", [e._v(e._s(e.header))]), t("p", [e._v(e._s(e.subline))])]), e._l(e.resources, function(i) {
|
|
187
192
|
return t("NcResource", { key: i.itemId, staticClass: "related-resources__entry", attrs: { icon: i.icon, name: i.title, url: i.url } });
|
|
188
193
|
})], 2) : e._e();
|
|
189
|
-
},
|
|
190
|
-
m,
|
|
194
|
+
}, R = [], v = /* @__PURE__ */ n.normalizeComponent(
|
|
191
195
|
y,
|
|
192
196
|
g,
|
|
197
|
+
R,
|
|
193
198
|
!1,
|
|
194
199
|
null,
|
|
195
200
|
"dc5c8227",
|
|
196
201
|
null,
|
|
197
202
|
null
|
|
198
203
|
);
|
|
199
|
-
const
|
|
200
|
-
exports.NcRelatedResourcesPanel =
|
|
204
|
+
const I = v.exports;
|
|
205
|
+
exports.NcRelatedResourcesPanel = I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NcRelatedResourcesPanel-f1Up3M7Q.cjs","sources":["../../src/components/NcRelatedResourcesPanel/NcResource.vue","../../src/components/NcRelatedResourcesPanel/NcRelatedResourcesPanel.vue"],"sourcesContent":["<!--\n - @copyright 2022 Christopher Ng <chrng8@gmail.com>\n -\n - @author Christopher Ng <chrng8@gmail.com>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n-->\n\n<template>\n\t<li class=\"resource\">\n\t\t<NcButton class=\"resource__button\"\n\t\t\t:aria-label=\"labelTranslated\"\n\t\t\ttype=\"tertiary\"\n\t\t\t:to=\"route\"\n\t\t\t:href=\"route ? null : url\">\n\t\t\t<template #icon>\n\t\t\t\t<div class=\"resource__icon\">\n\t\t\t\t\t<img :src=\"icon\">\n\t\t\t\t</div>\n\t\t\t</template>\n\t\t\t{{ name }}\n\t\t</NcButton>\n\t</li>\n</template>\n\n<script>\nimport NcButton from '../NcButton/index.js'\n\nimport { getRoute } from '../NcRichText/autolink.js'\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcResource',\n\n\tcomponents: {\n\t\tNcButton,\n\t},\n\n\tprops: {\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\turl: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tlabelTranslated: t('Open link to \"{resourceName}\"', { resourceName: this.name }),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\troute() {\n\t\t\treturn getRoute(this.$router, this.url)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.resource {\n\tdisplay: flex;\n\talign-items: center;\n\theight: 44px;\n\n\t// Override default NcButton styles\n\t&__button {\n\t\twidth: 100% !important;\n\t\tjustify-content: flex-start !important;\n\t\tpadding: 0 !important;\n\n\t\t&:deep {\n\t\t\t.button-vue__wrapper {\n\t\t\t\tjustify-content: flex-start !important;\n\n\t\t\t\t.button-vue__text {\n\t\t\t\t\tfont-weight: normal !important;\n\t\t\t\t\tmargin-left: 2px !important;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&__icon {\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tbackground-color: var(--color-text-maxcontrast);\n\t\tborder-radius: 50%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\timg {\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tfilter: var(--background-invert-if-dark);\n\t\t}\n\t}\n}\n</style>\n","<!--\n - @copyright 2022 Christopher Ng <chrng8@gmail.com>\n -\n - @author Christopher Ng <chrng8@gmail.com>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n-->\n\n<docs>\n### Usage\n\nUse this component to display the related resources of a given item.\n\n```\n<template>\n\t<NcRelatedResourcesPanel provider-id=\"talk\"\n\t\theader=\"Related resources for talk\"\n\t\t:item-id=\"conversationId\" />\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tconversationId: 1,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div v-if=\"appEnabled && isVisible\" class=\"related-resources\">\n\t\t<div class=\"related-resources__header\">\n\t\t\t<h5>{{ header }}</h5>\n\t\t\t<p>{{ subline }}</p>\n\t\t</div>\n\n\t\t<NcResource v-for=\"resource in resources\"\n\t\t\t:key=\"resource.itemId\"\n\t\t\tclass=\"related-resources__entry\"\n\t\t\t:icon=\"resource.icon\"\n\t\t\t:name=\"resource.title\"\n\t\t\t:url=\"resource.url\" />\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\nimport NcResource from './NcResource.vue'\n\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcRelatedResourcesPanel',\n\n\tcomponents: {\n\t\tNcResource,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The provider id implemented with `\\OCA\\RelatedResources\\IRelatedResourceProvider::getProviderId()`\n\t\t */\n\t\tproviderId: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * The item id which uniquely identities the e.g. Calendar event, Deck board, file, Talk room, etc.\n\t\t */\n\t\titemId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * Limits to specific resource type. i.e. any provider id implemented with `\\OCA\\RelatedResources\\IRelatedResourceProvider::getProviderId()`\n\t\t */\n\t\tresourceType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * Set the maximum number of resources to load\n\t\t */\n\t\tlimit: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t\t/**\n\t\t * Only used by the files sidebar\n\t\t *\n\t\t * File info is passed when registered with `OCA.Sharing.ShareTabSections.registerSection()`\n\t\t */\n\t\tfileInfo: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * Make the header name dynamic\n\t\t */\n\t\theader: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Related resources'),\n\t\t},\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Anything shared with the same group of people will show up here'),\n\t\t},\n\t\t/**\n\t\t * If this element is used on a primary element set to true for primary styling.\n\t\t */\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'has-error',\n\t\t'has-resources',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tappEnabled: OC?.appswebroots?.related_resources !== undefined,\n\t\t\tloading: false,\n\t\t\terror: null,\n\t\t\tresources: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisVisible() {\n\t\t\tif (this.loading) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn this.error ?? this.resources.length > 0\n\t\t},\n\t\tsubline() {\n\t\t\tif (this.error) {\n\t\t\t\treturn t('Error getting related resources. Please contact your system administrator if you have any questions.')\n\t\t\t}\n\t\t\treturn this.description\n\t\t},\n\n\t\thasResourceInfo() {\n\t\t\tif (this.providerId !== null && this.itemId !== null) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (this.fileInfo !== null) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\tisFiles() {\n\t\t\treturn this.fileInfo?.id !== undefined\n\t\t},\n\n\t\turl() {\n\t\t\tlet providerId = null\n\t\t\tlet itemId = null\n\n\t\t\tif (this.isFiles) {\n\t\t\t\tproviderId = 'files'\n\t\t\t\titemId = this.fileInfo.id\n\t\t\t} else {\n\t\t\t\tproviderId = this.providerId\n\t\t\t\titemId = this.itemId\n\t\t\t}\n\n\t\t\treturn generateOcsUrl('/apps/related_resources/related/{providerId}?itemId={itemId}&resourceType={resourceType}&limit={limit}&format=json', {\n\t\t\t\tproviderId,\n\t\t\t\titemId,\n\t\t\t\tresourceType: this.resourceType,\n\t\t\t\tlimit: this.limit,\n\t\t\t})\n\t\t},\n\t},\n\n\twatch: {\n\t\tproviderId() {\n\t\t\tthis.fetchRelatedResources()\n\t\t},\n\t\titemId() {\n\t\t\tthis.fetchRelatedResources()\n\t\t},\n\t\tfileInfo() {\n\t\t\tthis.fetchRelatedResources()\n\t\t},\n\t\terror(error) {\n\t\t\t/**\n\t\t\t * Emitted when the error value changes\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tthis.$emit('has-error', Boolean(error))\n\t\t},\n\t\tresources(resources) {\n\t\t\t/**\n\t\t\t * Emitted when the resources value changes\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tthis.$emit('has-resources', resources.length > 0)\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.fetchRelatedResources()\n\t},\n\n\tmethods: {\n\t\tt,\n\t\tasync fetchRelatedResources() {\n\t\t\tif (!this.appEnabled || !this.hasResourceInfo) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.loading = true\n\t\t\tthis.error = null\n\t\t\tthis.resources = []\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(this.url)\n\t\t\t\tthis.resources = response.data.ocs?.data\n\t\t\t} catch (e) {\n\t\t\t\tthis.error = e\n\t\t\t\tconsole.error(e)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.related-resources {\n\t&__header {\n\t\tmargin: 0 0 10px 46px;\n\n\t\th5 {\n\t\t\tfont-weight: bold;\n\t\t}\n\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n}\n</style>\n"],"names":["_sfc_main","NcButton","t","getRoute","NcResource","providerId","itemId","generateOcsUrl","error","resources","response","axios","e"],"mappings":";;;AA6CA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IACA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,iBAAAC,EAAA,EAAA,iCAAA,EAAA,cAAA,KAAA,MAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,QAAA;AACA,aAAAC,EAAA,SAAA,KAAA,SAAA,KAAA,GAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,GAAAD,EAAA;AAAA,EACA;AACA;;;;;;;;;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elatedResourcesPanel-EDvgZgjQ.mjs → NcRelatedResourcesPanel-zXNE9qiS.mjs}
RENAMED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import '../assets/NcRelatedResourcesPanel-
|
|
2
|
-
import
|
|
1
|
+
import '../assets/NcRelatedResourcesPanel-oq5eMIoh.css';
|
|
2
|
+
import a from "@nextcloud/axios";
|
|
3
3
|
import { generateOcsUrl as l } from "@nextcloud/router";
|
|
4
4
|
import u from "../Components/NcButton.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
n
|
|
8
|
-
|
|
5
|
+
import { g as c } from "./autolink-oKM43mOC.mjs";
|
|
6
|
+
import { r as o, C as d, a as s, D as f } from "./_l10n-Y2fvkVoK.mjs";
|
|
7
|
+
import { n } from "./_plugin-vue2_normalizer-u6G_3nkj.mjs";
|
|
8
|
+
o(d);
|
|
9
|
+
const p = {
|
|
9
10
|
name: "NcResource",
|
|
10
11
|
components: {
|
|
11
12
|
NcButton: u
|
|
@@ -29,31 +30,36 @@ const f = {
|
|
|
29
30
|
labelTranslated: s('Open link to "{resourceName}"', { resourceName: this.name })
|
|
30
31
|
};
|
|
31
32
|
},
|
|
33
|
+
computed: {
|
|
34
|
+
route() {
|
|
35
|
+
return c(this.$router, this.url);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
32
38
|
methods: {
|
|
33
39
|
t: s
|
|
34
40
|
}
|
|
35
41
|
};
|
|
36
|
-
var
|
|
42
|
+
var h = function() {
|
|
37
43
|
var e = this, t = e._self._c;
|
|
38
|
-
return t("li", { staticClass: "resource" }, [t("NcButton", { staticClass: "resource__button", attrs: { "aria-label": e.labelTranslated, type: "tertiary", href: e.url }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
44
|
+
return t("li", { staticClass: "resource" }, [t("NcButton", { staticClass: "resource__button", attrs: { "aria-label": e.labelTranslated, type: "tertiary", to: e.route, href: e.route ? null : e.url }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
39
45
|
return [t("div", { staticClass: "resource__icon" }, [t("img", { attrs: { src: e.icon } })])];
|
|
40
46
|
}, proxy: !0 }]) }, [e._v(" " + e._s(e.name) + " ")])], 1);
|
|
41
|
-
},
|
|
42
|
-
f,
|
|
47
|
+
}, m = [], _ = /* @__PURE__ */ n(
|
|
43
48
|
p,
|
|
44
49
|
h,
|
|
50
|
+
m,
|
|
45
51
|
!1,
|
|
46
52
|
null,
|
|
47
|
-
"
|
|
53
|
+
"dd53e5b9",
|
|
48
54
|
null,
|
|
49
55
|
null
|
|
50
56
|
);
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const
|
|
57
|
+
const y = _.exports;
|
|
58
|
+
o(f);
|
|
59
|
+
const g = {
|
|
54
60
|
name: "NcRelatedResourcesPanel",
|
|
55
61
|
components: {
|
|
56
|
-
NcResource:
|
|
62
|
+
NcResource: y
|
|
57
63
|
},
|
|
58
64
|
props: {
|
|
59
65
|
/**
|
|
@@ -173,7 +179,7 @@ const y = {
|
|
|
173
179
|
if (!(!this.appEnabled || !this.hasResourceInfo)) {
|
|
174
180
|
this.loading = !0, this.error = null, this.resources = [];
|
|
175
181
|
try {
|
|
176
|
-
const r = await
|
|
182
|
+
const r = await a.get(this.url);
|
|
177
183
|
this.resources = r.data.ocs?.data;
|
|
178
184
|
} catch (r) {
|
|
179
185
|
this.error = r, console.error(r);
|
|
@@ -189,17 +195,17 @@ var v = function() {
|
|
|
189
195
|
return e.appEnabled && e.isVisible ? t("div", { staticClass: "related-resources" }, [t("div", { staticClass: "related-resources__header" }, [t("h5", [e._v(e._s(e.header))]), t("p", [e._v(e._s(e.subline))])]), e._l(e.resources, function(i) {
|
|
190
196
|
return t("NcResource", { key: i.itemId, staticClass: "related-resources__entry", attrs: { icon: i.icon, name: i.title, url: i.url } });
|
|
191
197
|
})], 2) : e._e();
|
|
192
|
-
},
|
|
193
|
-
y,
|
|
194
|
-
v,
|
|
198
|
+
}, R = [], I = /* @__PURE__ */ n(
|
|
195
199
|
g,
|
|
200
|
+
v,
|
|
201
|
+
R,
|
|
196
202
|
!1,
|
|
197
203
|
null,
|
|
198
204
|
"dc5c8227",
|
|
199
205
|
null,
|
|
200
206
|
null
|
|
201
207
|
);
|
|
202
|
-
const
|
|
208
|
+
const w = I.exports;
|
|
203
209
|
export {
|
|
204
|
-
|
|
210
|
+
w as N
|
|
205
211
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NcRelatedResourcesPanel-zXNE9qiS.mjs","sources":["../../src/components/NcRelatedResourcesPanel/NcResource.vue","../../src/components/NcRelatedResourcesPanel/NcRelatedResourcesPanel.vue"],"sourcesContent":["<!--\n - @copyright 2022 Christopher Ng <chrng8@gmail.com>\n -\n - @author Christopher Ng <chrng8@gmail.com>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n-->\n\n<template>\n\t<li class=\"resource\">\n\t\t<NcButton class=\"resource__button\"\n\t\t\t:aria-label=\"labelTranslated\"\n\t\t\ttype=\"tertiary\"\n\t\t\t:to=\"route\"\n\t\t\t:href=\"route ? null : url\">\n\t\t\t<template #icon>\n\t\t\t\t<div class=\"resource__icon\">\n\t\t\t\t\t<img :src=\"icon\">\n\t\t\t\t</div>\n\t\t\t</template>\n\t\t\t{{ name }}\n\t\t</NcButton>\n\t</li>\n</template>\n\n<script>\nimport NcButton from '../NcButton/index.js'\n\nimport { getRoute } from '../NcRichText/autolink.js'\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcResource',\n\n\tcomponents: {\n\t\tNcButton,\n\t},\n\n\tprops: {\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\turl: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tlabelTranslated: t('Open link to \"{resourceName}\"', { resourceName: this.name }),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\troute() {\n\t\t\treturn getRoute(this.$router, this.url)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.resource {\n\tdisplay: flex;\n\talign-items: center;\n\theight: 44px;\n\n\t// Override default NcButton styles\n\t&__button {\n\t\twidth: 100% !important;\n\t\tjustify-content: flex-start !important;\n\t\tpadding: 0 !important;\n\n\t\t&:deep {\n\t\t\t.button-vue__wrapper {\n\t\t\t\tjustify-content: flex-start !important;\n\n\t\t\t\t.button-vue__text {\n\t\t\t\t\tfont-weight: normal !important;\n\t\t\t\t\tmargin-left: 2px !important;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&__icon {\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tbackground-color: var(--color-text-maxcontrast);\n\t\tborder-radius: 50%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\timg {\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tfilter: var(--background-invert-if-dark);\n\t\t}\n\t}\n}\n</style>\n","<!--\n - @copyright 2022 Christopher Ng <chrng8@gmail.com>\n -\n - @author Christopher Ng <chrng8@gmail.com>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n-->\n\n<docs>\n### Usage\n\nUse this component to display the related resources of a given item.\n\n```\n<template>\n\t<NcRelatedResourcesPanel provider-id=\"talk\"\n\t\theader=\"Related resources for talk\"\n\t\t:item-id=\"conversationId\" />\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tconversationId: 1,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div v-if=\"appEnabled && isVisible\" class=\"related-resources\">\n\t\t<div class=\"related-resources__header\">\n\t\t\t<h5>{{ header }}</h5>\n\t\t\t<p>{{ subline }}</p>\n\t\t</div>\n\n\t\t<NcResource v-for=\"resource in resources\"\n\t\t\t:key=\"resource.itemId\"\n\t\t\tclass=\"related-resources__entry\"\n\t\t\t:icon=\"resource.icon\"\n\t\t\t:name=\"resource.title\"\n\t\t\t:url=\"resource.url\" />\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\nimport NcResource from './NcResource.vue'\n\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcRelatedResourcesPanel',\n\n\tcomponents: {\n\t\tNcResource,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The provider id implemented with `\\OCA\\RelatedResources\\IRelatedResourceProvider::getProviderId()`\n\t\t */\n\t\tproviderId: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * The item id which uniquely identities the e.g. Calendar event, Deck board, file, Talk room, etc.\n\t\t */\n\t\titemId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * Limits to specific resource type. i.e. any provider id implemented with `\\OCA\\RelatedResources\\IRelatedResourceProvider::getProviderId()`\n\t\t */\n\t\tresourceType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * Set the maximum number of resources to load\n\t\t */\n\t\tlimit: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t\t/**\n\t\t * Only used by the files sidebar\n\t\t *\n\t\t * File info is passed when registered with `OCA.Sharing.ShareTabSections.registerSection()`\n\t\t */\n\t\tfileInfo: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * Make the header name dynamic\n\t\t */\n\t\theader: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Related resources'),\n\t\t},\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Anything shared with the same group of people will show up here'),\n\t\t},\n\t\t/**\n\t\t * If this element is used on a primary element set to true for primary styling.\n\t\t */\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'has-error',\n\t\t'has-resources',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tappEnabled: OC?.appswebroots?.related_resources !== undefined,\n\t\t\tloading: false,\n\t\t\terror: null,\n\t\t\tresources: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisVisible() {\n\t\t\tif (this.loading) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn this.error ?? this.resources.length > 0\n\t\t},\n\t\tsubline() {\n\t\t\tif (this.error) {\n\t\t\t\treturn t('Error getting related resources. Please contact your system administrator if you have any questions.')\n\t\t\t}\n\t\t\treturn this.description\n\t\t},\n\n\t\thasResourceInfo() {\n\t\t\tif (this.providerId !== null && this.itemId !== null) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (this.fileInfo !== null) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\tisFiles() {\n\t\t\treturn this.fileInfo?.id !== undefined\n\t\t},\n\n\t\turl() {\n\t\t\tlet providerId = null\n\t\t\tlet itemId = null\n\n\t\t\tif (this.isFiles) {\n\t\t\t\tproviderId = 'files'\n\t\t\t\titemId = this.fileInfo.id\n\t\t\t} else {\n\t\t\t\tproviderId = this.providerId\n\t\t\t\titemId = this.itemId\n\t\t\t}\n\n\t\t\treturn generateOcsUrl('/apps/related_resources/related/{providerId}?itemId={itemId}&resourceType={resourceType}&limit={limit}&format=json', {\n\t\t\t\tproviderId,\n\t\t\t\titemId,\n\t\t\t\tresourceType: this.resourceType,\n\t\t\t\tlimit: this.limit,\n\t\t\t})\n\t\t},\n\t},\n\n\twatch: {\n\t\tproviderId() {\n\t\t\tthis.fetchRelatedResources()\n\t\t},\n\t\titemId() {\n\t\t\tthis.fetchRelatedResources()\n\t\t},\n\t\tfileInfo() {\n\t\t\tthis.fetchRelatedResources()\n\t\t},\n\t\terror(error) {\n\t\t\t/**\n\t\t\t * Emitted when the error value changes\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tthis.$emit('has-error', Boolean(error))\n\t\t},\n\t\tresources(resources) {\n\t\t\t/**\n\t\t\t * Emitted when the resources value changes\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tthis.$emit('has-resources', resources.length > 0)\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.fetchRelatedResources()\n\t},\n\n\tmethods: {\n\t\tt,\n\t\tasync fetchRelatedResources() {\n\t\t\tif (!this.appEnabled || !this.hasResourceInfo) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.loading = true\n\t\t\tthis.error = null\n\t\t\tthis.resources = []\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(this.url)\n\t\t\t\tthis.resources = response.data.ocs?.data\n\t\t\t} catch (e) {\n\t\t\t\tthis.error = e\n\t\t\t\tconsole.error(e)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.related-resources {\n\t&__header {\n\t\tmargin: 0 0 10px 46px;\n\n\t\th5 {\n\t\t\tfont-weight: bold;\n\t\t}\n\n\t\tp {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n}\n</style>\n"],"names":["_sfc_main","NcButton","t","getRoute","NcResource","providerId","itemId","generateOcsUrl","error","resources","response","axios","e"],"mappings":";;;;;;;AA6CA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IACA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,iBAAAC,EAAA,iCAAA,EAAA,cAAA,KAAA,MAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,QAAA;AACA,aAAAC,EAAA,KAAA,SAAA,KAAA,GAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,GAAAD;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;ACZA,MAAAF,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,YAAAI;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,QAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAA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