@nextcloud/vue 8.27.0 → 8.29.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 +99 -25
- package/dist/Components/NcActionButton.cjs +1 -1
- package/dist/Components/NcActionButton.mjs +1 -1
- 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/NcActionText.cjs +3 -3
- package/dist/Components/NcActionText.cjs.map +1 -1
- package/dist/Components/NcActionText.mjs +3 -3
- package/dist/Components/NcActionText.mjs.map +1 -1
- package/dist/Components/NcActionTextEditable.cjs +1 -1
- package/dist/Components/NcActionTextEditable.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/NcAppNavigationNewItem.cjs +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +1 -1
- package/dist/Components/NcAppNavigationSearch.cjs +1 -1
- package/dist/Components/NcAppNavigationSearch.mjs +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +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/NcButton.cjs +15 -2
- package/dist/Components/NcButton.cjs.map +1 -1
- package/dist/Components/NcButton.mjs +15 -2
- package/dist/Components/NcButton.mjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +1 -1
- package/dist/Components/NcChip.cjs +4 -4
- package/dist/Components/NcChip.mjs +4 -4
- package/dist/Components/NcCollectionList.cjs +1 -1
- package/dist/Components/NcCollectionList.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 +5 -5
- 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/NcGuestContent.cjs +2 -2
- package/dist/Components/NcGuestContent.cjs.map +1 -1
- package/dist/Components/NcGuestContent.mjs +2 -2
- package/dist/Components/NcGuestContent.mjs.map +1 -1
- package/dist/Components/NcHeaderButton.cjs +1 -1
- package/dist/Components/NcHeaderButton.mjs +1 -1
- package/dist/Components/NcHeaderMenu.cjs +1 -1
- package/dist/Components/NcHeaderMenu.mjs +1 -1
- package/dist/Components/NcInputField.cjs +1 -1
- package/dist/Components/NcInputField.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/NcLoadingIcon.cjs +2 -2
- package/dist/Components/NcLoadingIcon.cjs.map +1 -1
- package/dist/Components/NcLoadingIcon.mjs +2 -2
- package/dist/Components/NcLoadingIcon.mjs.map +1 -1
- package/dist/Components/NcModal.cjs +8 -17
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +8 -17
- package/dist/Components/NcModal.mjs.map +1 -1
- 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 +2 -2
- package/dist/Components/NcRichContenteditable.mjs +2 -2
- package/dist/Components/NcRichText.cjs +2 -2
- package/dist/Components/NcRichText.mjs +3 -3
- package/dist/Components/NcSavingIndicatorIcon.cjs +1 -1
- package/dist/Components/NcSavingIndicatorIcon.mjs +1 -1
- 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/NcSelectUsers.cjs +1 -1
- package/dist/Components/NcSelectUsers.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/NcTextArea.cjs +1 -1
- package/dist/Components/NcTextArea.mjs +1 -1
- package/dist/Components/NcTextField.cjs +1 -1
- package/dist/Components/NcTextField.mjs +1 -1
- package/dist/Components/NcThemeProvider.cjs +4 -0
- package/dist/Components/NcThemeProvider.cjs.map +1 -0
- package/dist/Components/NcThemeProvider.mjs +5 -0
- package/dist/Components/NcThemeProvider.mjs.map +1 -0
- 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/Composables/useFormatDateTime.cjs +68 -0
- package/dist/Composables/useFormatDateTime.cjs.map +1 -0
- package/dist/Composables/useFormatDateTime.mjs +68 -0
- package/dist/Composables/useFormatDateTime.mjs.map +1 -0
- package/dist/Composables/useHotKey.cjs +13 -1
- package/dist/Composables/useHotKey.cjs.map +1 -1
- package/dist/Composables/useHotKey.mjs +13 -1
- package/dist/Composables/useHotKey.mjs.map +1 -1
- package/dist/Composables/useIsDarkTheme.cjs +23 -6
- package/dist/Composables/useIsDarkTheme.cjs.map +1 -1
- package/dist/Composables/useIsDarkTheme.mjs +24 -7
- package/dist/Composables/useIsDarkTheme.mjs.map +1 -1
- package/dist/Functions/dialog.cjs +19 -7
- package/dist/Functions/dialog.cjs.map +1 -1
- package/dist/Functions/dialog.mjs +19 -7
- package/dist/Functions/dialog.mjs.map +1 -1
- package/dist/Functions/reference.cjs +1 -1
- package/dist/Functions/reference.mjs +1 -1
- package/dist/Functions/usernameToColor.cjs +28 -2
- package/dist/Functions/usernameToColor.cjs.map +1 -1
- package/dist/Functions/usernameToColor.mjs +25 -2
- package/dist/Functions/usernameToColor.mjs.map +1 -1
- package/dist/Mixins/richEditor.cjs +1 -1
- package/dist/Mixins/richEditor.mjs +1 -1
- package/dist/assets/{NcActionButton-CuV1ITDb.css → NcActionButton-D8Lyueq3.css} +20 -17
- package/dist/assets/{NcActionInput-gUagFGC5.css → NcActionInput-Q0DfTHVL.css} +62 -62
- package/dist/assets/{NcActionText-vT7nheBU.css → NcActionText-Rad4JSXq.css} +18 -18
- package/dist/assets/{NcActions-3STB3u9J.css → NcActions-C3F-rqxz.css} +11 -11
- package/dist/assets/{NcAppContent-DUkkgtHn.css → NcAppContent-Bb5hgGi3.css} +23 -23
- package/dist/assets/{NcAppNavigationItem-CdT6ce8-.css → NcAppNavigationItem-Ca2ekElv.css} +35 -31
- package/dist/assets/{NcAppNavigationNewItem-D7wroqrc.css → NcAppNavigationNewItem-PE-w8y-g.css} +5 -1
- package/dist/assets/{NcAppSidebar-BFg2HHh6.css → NcAppSidebar-u0G_qQMh.css} +44 -67
- package/dist/assets/NcAvatar-BqNcvkxP.css +134 -0
- package/dist/assets/{NcButton-DnNZaEy_.css → NcButton-Cjx-v-Qz.css} +84 -72
- package/dist/assets/{NcCheckboxRadioSwitch-DlEieXCj.css → NcCheckboxRadioSwitch-B-axx3m7.css} +45 -42
- package/dist/assets/{NcColorPicker-BayJGD4p.css → NcColorPicker-C-3wb1sk.css} +28 -28
- package/dist/assets/{NcContent-Bq-7EZQc.css → NcContent-DH4tX3N4.css} +12 -9
- package/dist/assets/{NcDateTimePicker-hcAowAbZ.css → NcDateTimePicker-Bx7XHFo7.css} +7 -7
- package/dist/assets/{NcDialog-BPI0CJvw.css → NcDialog-X7BRqUGJ.css} +15 -15
- package/dist/assets/{NcGuestContent-B0ivUQHg.css → NcGuestContent-ByAkjts7.css} +2 -2
- package/dist/assets/{NcHeaderButton-Dr6MgPDQ.css → NcHeaderButton-ByNXqS7x.css} +4 -0
- package/dist/assets/{NcHeaderMenu-DN-HfTkh.css → NcHeaderMenu-Dp_vJKTP.css} +4 -0
- package/dist/assets/{NcInputField-GxJ-rf2p.css → NcInputField-Cdd0B1OR.css} +38 -32
- package/dist/assets/{NcListItem-DfaWGP5A.css → NcListItem-CCu1OBiG.css} +44 -44
- package/dist/assets/{NcLoadingIcon-x1d284UU.css → NcLoadingIcon-DbbToJVp.css} +5 -2
- package/dist/assets/{NcMentionBubble-CB5c5ue2.css → NcMentionBubble-UsTMm5VD.css} +9 -9
- package/dist/assets/{NcModal-BS5vtogq.css → NcModal-Cy3UOuI2.css} +62 -62
- package/dist/assets/{NcPasswordField-whtKJFcB.css → NcPasswordField-DVK8tuPi.css} +2 -2
- package/dist/assets/{NcRichContenteditable-BbOjh6i7.css → NcRichContenteditable-CGRMNrie.css} +9 -9
- package/dist/assets/{NcRichText-li93TNBn.css → NcRichText-CWVHZl8s.css} +86 -83
- package/dist/assets/NcSelectUsers-BOwQNNMf.css +4 -0
- package/dist/assets/{NcSettingsSection-_mX6UqM_.css → NcSettingsSection-uKqWTbhb.css} +8 -8
- package/dist/assets/{NcTextArea-fzbciv3V.css → NcTextArea-DhttRTsL.css} +20 -20
- package/dist/assets/{NcUserStatusIcon-DAVSJFhS.css → NcUserStatusIcon-ChHaXPex.css} +7 -7
- package/dist/chunks/{GenColors-7bkY5Nwl.cjs → GenColors-BnYS3bvv.cjs} +2 -2
- package/dist/chunks/{GenColors-7bkY5Nwl.cjs.map → GenColors-BnYS3bvv.cjs.map} +1 -1
- package/dist/chunks/{GenColors-B49R8TGp.mjs → GenColors-DNN63dHB.mjs} +2 -2
- package/dist/chunks/{GenColors-B49R8TGp.mjs.map → GenColors-DNN63dHB.mjs.map} +1 -1
- package/dist/chunks/{NcActionButton-CD87AU6W.cjs → NcActionButton-2qh96K_i.cjs} +4 -4
- package/dist/chunks/{NcActionButton-CD87AU6W.cjs.map → NcActionButton-2qh96K_i.cjs.map} +1 -1
- package/dist/chunks/{NcActionButton-CuVNJJtW.mjs → NcActionButton-CHrE7amZ.mjs} +4 -4
- package/dist/chunks/{NcActionButton-CuVNJJtW.mjs.map → NcActionButton-CHrE7amZ.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-BMy3W9fG.cjs → NcActionButtonGroup-B8Bj-Qb3.cjs} +2 -2
- package/dist/chunks/{NcActionButtonGroup-BMy3W9fG.cjs.map → NcActionButtonGroup-B8Bj-Qb3.cjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-DEf00ge6.mjs → NcActionButtonGroup-_R4fp-bK.mjs} +2 -2
- package/dist/chunks/{NcActionButtonGroup-DEf00ge6.mjs.map → NcActionButtonGroup-_R4fp-bK.mjs.map} +1 -1
- package/dist/chunks/{NcActionInput-B4qGsF57.mjs → NcActionInput-BXOssTbe.mjs} +12 -11
- package/dist/chunks/NcActionInput-BXOssTbe.mjs.map +1 -0
- package/dist/chunks/{NcActionInput-BmERg0FB.cjs → NcActionInput-Bv4_2oYO.cjs} +13 -11
- package/dist/chunks/NcActionInput-Bv4_2oYO.cjs.map +1 -0
- package/dist/chunks/{NcActionTextEditable-Cceub6Yt.cjs → NcActionTextEditable-DqcHZqN5.cjs} +2 -2
- package/dist/chunks/{NcActionTextEditable-Cceub6Yt.cjs.map → NcActionTextEditable-DqcHZqN5.cjs.map} +1 -1
- package/dist/chunks/{NcActionTextEditable-DNweMXRJ.mjs → NcActionTextEditable-xrMV-kE8.mjs} +2 -2
- package/dist/chunks/{NcActionTextEditable-DNweMXRJ.mjs.map → NcActionTextEditable-xrMV-kE8.mjs.map} +1 -1
- package/dist/chunks/{NcActions-B4VZCD8B.mjs → NcActions-BANvgaMn.mjs} +42 -9
- package/dist/chunks/NcActions-BANvgaMn.mjs.map +1 -0
- package/dist/chunks/{NcActions-B7DbEbCo.cjs → NcActions-DV3CjPHr.cjs} +42 -9
- package/dist/chunks/NcActions-DV3CjPHr.cjs.map +1 -0
- package/dist/chunks/{NcAppContent-B7ER65tk.cjs → NcAppContent-BqR67yTH.cjs} +44 -36
- package/dist/chunks/NcAppContent-BqR67yTH.cjs.map +1 -0
- package/dist/chunks/{NcAppContent-DyXqBrOB.mjs → NcAppContent-twZJBrQv.mjs} +44 -36
- package/dist/chunks/NcAppContent-twZJBrQv.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigation-JyeZxhb6.cjs → NcAppNavigation-COge8_bn.cjs} +3 -3
- package/dist/chunks/{NcAppNavigation-JyeZxhb6.cjs.map → NcAppNavigation-COge8_bn.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-CqKWSnxO.mjs → NcAppNavigation-VSGTDckG.mjs} +3 -3
- package/dist/chunks/{NcAppNavigation-CqKWSnxO.mjs.map → NcAppNavigation-VSGTDckG.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-CMnWvBgA.cjs → NcAppNavigationCaption-ofy-JSGu.cjs} +2 -2
- package/dist/chunks/{NcAppNavigationCaption-CMnWvBgA.cjs.map → NcAppNavigationCaption-ofy-JSGu.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-DcgSwIOY.mjs → NcAppNavigationCaption-oxc7chGv.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationCaption-DcgSwIOY.mjs.map → NcAppNavigationCaption-oxc7chGv.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-B9Gs5p7m.cjs → NcAppNavigationItem-B-uv2tWu.cjs} +8 -8
- package/dist/chunks/NcAppNavigationItem-B-uv2tWu.cjs.map +1 -0
- package/dist/chunks/{NcAppNavigationItem-CrTVtqYV.mjs → NcAppNavigationItem-CbtPNTg_.mjs} +8 -8
- package/dist/chunks/NcAppNavigationItem-CbtPNTg_.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationNewItem-CcBvnQst.mjs → NcAppNavigationNewItem-Cz8VbLjN.mjs} +3 -3
- package/dist/chunks/{NcAppNavigationNewItem-CcBvnQst.mjs.map → NcAppNavigationNewItem-Cz8VbLjN.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-BLek0JRU.cjs → NcAppNavigationNewItem-DzpW6cIK.cjs} +3 -3
- package/dist/chunks/{NcAppNavigationNewItem-BLek0JRU.cjs.map → NcAppNavigationNewItem-DzpW6cIK.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-BC3kPnxr.mjs → NcAppNavigationSearch-BvCjwhyQ.mjs} +3 -3
- package/dist/chunks/{NcAppNavigationSearch-BC3kPnxr.mjs.map → NcAppNavigationSearch-BvCjwhyQ.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-BblolNaS.cjs → NcAppNavigationSearch-s1mEjjZM.cjs} +3 -3
- package/dist/chunks/{NcAppNavigationSearch-BblolNaS.cjs.map → NcAppNavigationSearch-s1mEjjZM.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-JruJ3cF1.mjs → NcAppNavigationSettings-DhQ5tXEJ.mjs} +5 -3
- package/dist/chunks/{NcAppNavigationSettings-JruJ3cF1.mjs.map → NcAppNavigationSettings-DhQ5tXEJ.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-ppse1A0c.cjs → NcAppNavigationSettings-DnvFbZyP.cjs} +5 -3
- package/dist/chunks/{NcAppNavigationSettings-ppse1A0c.cjs.map → NcAppNavigationSettings-DnvFbZyP.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-CUdNQwyN.mjs → NcAppNavigationToggle-CINjg2Mo.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationToggle-CUdNQwyN.mjs.map → NcAppNavigationToggle-CINjg2Mo.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-CUGOWggc.cjs → NcAppNavigationToggle-CbZem2gZ.cjs} +2 -2
- package/dist/chunks/{NcAppNavigationToggle-CUGOWggc.cjs.map → NcAppNavigationToggle-CbZem2gZ.cjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-6cTux_qA.cjs → NcAppSettingsDialog-C1m0QYAK.cjs} +3 -3
- package/dist/chunks/{NcAppSettingsDialog-6cTux_qA.cjs.map → NcAppSettingsDialog-C1m0QYAK.cjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-D98cLpyy.mjs → NcAppSettingsDialog-Duyfikm-.mjs} +3 -3
- package/dist/chunks/{NcAppSettingsDialog-D98cLpyy.mjs.map → NcAppSettingsDialog-Duyfikm-.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-BqMsSY-_.cjs → NcAppSidebar-C-7OzN3N.cjs} +7 -7
- package/dist/chunks/{NcAppSidebar-BdryV6wY.mjs.map → NcAppSidebar-C-7OzN3N.cjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-BdryV6wY.mjs → NcAppSidebar-ape8OSJ3.mjs} +7 -7
- package/dist/chunks/{NcAppSidebar-BqMsSY-_.cjs.map → NcAppSidebar-ape8OSJ3.mjs.map} +1 -1
- package/dist/chunks/{NcAvatar-YSp2ORHc.mjs → NcAvatar-BA6pHpbT.mjs} +37 -26
- package/dist/chunks/NcAvatar-BA6pHpbT.mjs.map +1 -0
- package/dist/chunks/{NcAvatar-D_1clyWB.cjs → NcAvatar-CdBMEKsO.cjs} +39 -28
- package/dist/chunks/NcAvatar-CdBMEKsO.cjs.map +1 -0
- package/dist/chunks/{NcBreadcrumb-BSRmcIIh.cjs → NcBreadcrumb-BiW4k0c_.cjs} +2 -2
- package/dist/chunks/{NcBreadcrumb-BSRmcIIh.cjs.map → NcBreadcrumb-BiW4k0c_.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-Cu1XtrUo.mjs → NcBreadcrumb-BjsavDr1.mjs} +2 -2
- package/dist/chunks/{NcBreadcrumb-Cu1XtrUo.mjs.map → NcBreadcrumb-BjsavDr1.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-B1LdRe5_.mjs → NcBreadcrumbs-Bc2obqjl.mjs} +4 -4
- package/dist/chunks/{NcBreadcrumbs-B1LdRe5_.mjs.map → NcBreadcrumbs-Bc2obqjl.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-B0m6jKER.cjs → NcBreadcrumbs-Dwnn6dKU.cjs} +4 -4
- package/dist/chunks/{NcBreadcrumbs-B0m6jKER.cjs.map → NcBreadcrumbs-Dwnn6dKU.cjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-DbK49DI7.cjs → NcCheckboxRadioSwitch-ewtyZP3Z.cjs} +5 -5
- package/dist/chunks/NcCheckboxRadioSwitch-ewtyZP3Z.cjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch-VeztTzpz.mjs → NcCheckboxRadioSwitch-qmvgRzxb.mjs} +5 -5
- package/dist/chunks/NcCheckboxRadioSwitch-qmvgRzxb.mjs.map +1 -0
- package/dist/chunks/{NcCollectionList-BStYmq4u.cjs → NcCollectionList-C5nw4svt.cjs} +6 -6
- package/dist/chunks/{NcCollectionList-BStYmq4u.cjs.map → NcCollectionList-C5nw4svt.cjs.map} +1 -1
- package/dist/chunks/{NcCollectionList-CFt-EZON.mjs → NcCollectionList-CXAtmdEZ.mjs} +6 -6
- package/dist/chunks/{NcCollectionList-CFt-EZON.mjs.map → NcCollectionList-CXAtmdEZ.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-D7aj2f61.mjs → NcColorPicker-CU2sbJKt.mjs} +63 -33
- package/dist/chunks/NcColorPicker-CU2sbJKt.mjs.map +1 -0
- package/dist/chunks/{NcColorPicker-T-ifFDNs.cjs → NcColorPicker-DkoxNQJS.cjs} +63 -33
- package/dist/chunks/NcColorPicker-DkoxNQJS.cjs.map +1 -0
- package/dist/chunks/{NcContent-Cfz3ytoh.mjs → NcContent-BkmB4vmh.mjs} +4 -4
- package/dist/chunks/{NcContent-DUUfYUtn.cjs.map → NcContent-BkmB4vmh.mjs.map} +1 -1
- package/dist/chunks/{NcContent-DUUfYUtn.cjs → NcContent-h4LUA1hj.cjs} +4 -4
- package/dist/chunks/{NcContent-Cfz3ytoh.mjs.map → NcContent-h4LUA1hj.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-eStjL-WD.mjs → NcDashboardWidget-B_Egc1Og.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidget-eStjL-WD.mjs.map → NcDashboardWidget-B_Egc1Og.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-BI_Z44sc.cjs → NcDashboardWidget-EsWoGPKV.cjs} +4 -4
- package/dist/chunks/{NcDashboardWidget-BI_Z44sc.cjs.map → NcDashboardWidget-EsWoGPKV.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-BRFj1-Ir.mjs → NcDashboardWidgetItem-3oirT6j6.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-BRFj1-Ir.mjs.map → NcDashboardWidgetItem-3oirT6j6.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-gMKHqbAo.cjs → NcDashboardWidgetItem-qibYWTLk.cjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-gMKHqbAo.cjs.map → NcDashboardWidgetItem-qibYWTLk.cjs.map} +1 -1
- package/dist/chunks/NcDateTime-Cl-PZpLN.cjs +76 -0
- package/dist/chunks/NcDateTime-Cl-PZpLN.cjs.map +1 -0
- package/dist/chunks/NcDateTime-kanSdMgW.mjs +77 -0
- package/dist/chunks/NcDateTime-kanSdMgW.mjs.map +1 -0
- package/dist/chunks/{NcDialog-CKgpZOiy.mjs → NcDialog-C_IHQciE.mjs} +5 -5
- package/dist/chunks/{NcDialog-CKgpZOiy.mjs.map → NcDialog-C_IHQciE.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-DvC6y1MC.cjs → NcDialog-Cqdo11BM.cjs} +5 -5
- package/dist/chunks/{NcDialog-DvC6y1MC.cjs.map → NcDialog-Cqdo11BM.cjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-CROAi1Ll.mjs → NcDialogButton-Cc3iWZH1.mjs} +2 -2
- package/dist/chunks/{NcDialogButton-CROAi1Ll.mjs.map → NcDialogButton-Cc3iWZH1.mjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-BFemrIUw.cjs → NcDialogButton-_biPxXPQ.cjs} +2 -2
- package/dist/chunks/{NcDialogButton-BFemrIUw.cjs.map → NcDialogButton-_biPxXPQ.cjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-Du-vbR5T.mjs → NcEmojiPicker-C3rhl7Xh.mjs} +7 -7
- package/dist/chunks/{NcEmojiPicker-Du-vbR5T.mjs.map → NcEmojiPicker-C3rhl7Xh.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-CtvRZuBW.cjs → NcEmojiPicker-Dynz_fRD.cjs} +7 -7
- package/dist/chunks/{NcEmojiPicker-CtvRZuBW.cjs.map → NcEmojiPicker-Dynz_fRD.cjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-Dj7jeq88.mjs → NcHeaderMenu--AvoyMeD.mjs} +6 -4
- package/dist/chunks/{NcHeaderMenu-Dj7jeq88.mjs.map → NcHeaderMenu--AvoyMeD.mjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-CCaYMhFb.cjs → NcHeaderMenu-B12nEFGc.cjs} +6 -4
- package/dist/chunks/{NcHeaderMenu-CCaYMhFb.cjs.map → NcHeaderMenu-B12nEFGc.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-lVLFwBA4.cjs → NcInputConfirmCancel-BpPXGiKs.cjs} +2 -2
- package/dist/chunks/{NcInputConfirmCancel-lVLFwBA4.cjs.map → NcInputConfirmCancel-BpPXGiKs.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-Dhbj3Gad.mjs → NcInputConfirmCancel-P1H1ymiB.mjs} +2 -2
- package/dist/chunks/{NcInputConfirmCancel-Dhbj3Gad.mjs.map → NcInputConfirmCancel-P1H1ymiB.mjs.map} +1 -1
- package/dist/chunks/{NcInputField-C61UUN46.cjs → NcInputField-CD_Jxnho.cjs} +11 -4
- package/dist/chunks/NcInputField-CD_Jxnho.cjs.map +1 -0
- package/dist/chunks/{NcInputField-DTtUueUZ.mjs → NcInputField-a50IXAHm.mjs} +11 -4
- package/dist/chunks/NcInputField-a50IXAHm.mjs.map +1 -0
- package/dist/chunks/{NcListItem-BVNMtN9D.cjs → NcListItem-BJLfBv4G.cjs} +10 -9
- package/dist/chunks/{NcListItem-BVNMtN9D.cjs.map → NcListItem-BJLfBv4G.cjs.map} +1 -1
- package/dist/chunks/{NcListItem-B4Uyn2AS.mjs → NcListItem-DIupNkcV.mjs} +10 -9
- package/dist/chunks/{NcListItem-B4Uyn2AS.mjs.map → NcListItem-DIupNkcV.mjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-C_sEE5Xw.cjs → NcListItemIcon-BGehR6IP.cjs} +5 -3
- package/dist/chunks/{NcListItemIcon-C_sEE5Xw.cjs.map → NcListItemIcon-BGehR6IP.cjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-0H1Pepui.mjs → NcListItemIcon-C2PVlvB7.mjs} +5 -3
- package/dist/chunks/{NcListItemIcon-0H1Pepui.mjs.map → NcListItemIcon-C2PVlvB7.mjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-BCzIotoB.cjs → NcPasswordField-Bci0EOiA.cjs} +35 -19
- package/dist/chunks/NcPasswordField-Bci0EOiA.cjs.map +1 -0
- package/dist/chunks/{NcPasswordField-DNjegDVj.mjs → NcPasswordField-CNUa4WOq.mjs} +35 -19
- package/dist/chunks/NcPasswordField-CNUa4WOq.mjs.map +1 -0
- package/dist/chunks/{NcPopover-kYsewfff.mjs → NcPopover-4-YxCZOD.mjs} +2 -2
- package/dist/chunks/{NcPopover-kYsewfff.mjs.map → NcPopover-4-YxCZOD.mjs.map} +1 -1
- package/dist/chunks/{NcPopover-B2z7TwNr.cjs → NcPopover-DH2oMHFe.cjs} +2 -2
- package/dist/chunks/{NcPopover-B2z7TwNr.cjs.map → NcPopover-DH2oMHFe.cjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-C9qkNtuo.cjs → NcRelatedResourcesPanel-D_4x0nYR.cjs} +2 -2
- package/dist/chunks/{NcRelatedResourcesPanel-C9qkNtuo.cjs.map → NcRelatedResourcesPanel-D_4x0nYR.cjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-Y38zaKtn.mjs → NcRelatedResourcesPanel-qQK3J_qe.mjs} +2 -2
- package/dist/chunks/{NcRelatedResourcesPanel-Y38zaKtn.mjs.map → NcRelatedResourcesPanel-qQK3J_qe.mjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-Df_eA-oc.cjs → NcRichContenteditable-BLXUzOmi.cjs} +20 -15
- package/dist/chunks/NcRichContenteditable-BLXUzOmi.cjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-B8UqleMX.mjs → NcRichContenteditable-C5Dfv3nk.mjs} +20 -15
- package/dist/chunks/NcRichContenteditable-C5Dfv3nk.mjs.map +1 -0
- package/dist/chunks/{NcRichText-CwXSzf21.mjs → NcRichText-BE5jQHKt.mjs} +10 -6
- package/dist/chunks/{NcRichText-BS22_NFb.cjs.map → NcRichText-BE5jQHKt.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-BS22_NFb.cjs → NcRichText-Blh7R46K.cjs} +10 -6
- package/dist/chunks/{NcRichText-CwXSzf21.mjs.map → NcRichText-Blh7R46K.cjs.map} +1 -1
- package/dist/chunks/{NcSavingIndicatorIcon-nv1147dk.mjs → NcSavingIndicatorIcon-BPlY5Y9p.mjs} +2 -2
- package/dist/chunks/{NcSavingIndicatorIcon-nv1147dk.mjs.map → NcSavingIndicatorIcon-BPlY5Y9p.mjs.map} +1 -1
- package/dist/chunks/{NcSavingIndicatorIcon-Bu-zt4pR.cjs → NcSavingIndicatorIcon-DmGFZsmS.cjs} +2 -2
- package/dist/chunks/{NcSavingIndicatorIcon-Bu-zt4pR.cjs.map → NcSavingIndicatorIcon-DmGFZsmS.cjs.map} +1 -1
- package/dist/chunks/{NcSelect-CjUzohn5.mjs → NcSelect-B3fxFbfG.mjs} +3 -3
- package/dist/chunks/{NcSelect-CjUzohn5.mjs.map → NcSelect-B3fxFbfG.mjs.map} +1 -1
- package/dist/chunks/{NcSelect-D2xnxw4_.cjs → NcSelect-R8bPyBFL.cjs} +3 -3
- package/dist/chunks/{NcSelect-D2xnxw4_.cjs.map → NcSelect-R8bPyBFL.cjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-wJN9J7_t.mjs → NcSelectTags-BxII3k6P.mjs} +3 -3
- package/dist/chunks/{NcSelectTags-wJN9J7_t.mjs.map → NcSelectTags-BxII3k6P.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags--3rrSgOf.cjs → NcSelectTags-CmOvIcGU.cjs} +3 -3
- package/dist/chunks/{NcSelectTags--3rrSgOf.cjs.map → NcSelectTags-CmOvIcGU.cjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-CtuVriGK.cjs → NcSelectUsers-4dbGg26c.cjs} +14 -8
- package/dist/chunks/{NcSelectUsers-CtuVriGK.cjs.map → NcSelectUsers-4dbGg26c.cjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-W17kOow7.mjs → NcSelectUsers-BlVsLFrq.mjs} +14 -8
- package/dist/chunks/{NcSelectUsers-W17kOow7.mjs.map → NcSelectUsers-BlVsLFrq.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-BU1_SHOq.cjs → NcSettingsInputText-Cf-juMyF.cjs} +2 -2
- package/dist/chunks/{NcSettingsInputText-BU1_SHOq.cjs.map → NcSettingsInputText-Cf-juMyF.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-YO053agL.mjs → NcSettingsInputText-DYN2i2d2.mjs} +2 -2
- package/dist/chunks/{NcSettingsInputText-YO053agL.mjs.map → NcSettingsInputText-DYN2i2d2.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-C76Kqeew.mjs → NcSettingsSection-DK0dtGcw.mjs} +8 -9
- package/dist/chunks/NcSettingsSection-DK0dtGcw.mjs.map +1 -0
- package/dist/chunks/{NcSettingsSection-Dcdxs1IN.cjs → NcSettingsSection-VrSMms0R.cjs} +8 -9
- package/dist/chunks/NcSettingsSection-VrSMms0R.cjs.map +1 -0
- package/dist/chunks/{NcSettingsSelectGroup-Dj0Cusng.cjs → NcSettingsSelectGroup-CutKYnV3.cjs} +3 -3
- package/dist/chunks/{NcSettingsSelectGroup-Dj0Cusng.cjs.map → NcSettingsSelectGroup-CutKYnV3.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-CH_kppKo.mjs → NcSettingsSelectGroup-buP5uEyf.mjs} +3 -3
- package/dist/chunks/{NcSettingsSelectGroup-CH_kppKo.mjs.map → NcSettingsSelectGroup-buP5uEyf.mjs.map} +1 -1
- package/dist/chunks/{NcTextArea-CYLGAGcO.cjs → NcTextArea-BUqxDVLX.cjs} +11 -4
- package/dist/chunks/NcTextArea-BUqxDVLX.cjs.map +1 -0
- package/dist/chunks/{NcTextArea-BHERsE_g.mjs → NcTextArea-C10S9llK.mjs} +11 -4
- package/dist/chunks/NcTextArea-C10S9llK.mjs.map +1 -0
- package/dist/chunks/{NcTextField-Uk5iD8o2.cjs → NcTextField-C24Y7Zzr.cjs} +30 -49
- package/dist/chunks/NcTextField-C24Y7Zzr.cjs.map +1 -0
- package/dist/chunks/{NcTextField-o_8gWurX.mjs → NcTextField-GdOVvMI8.mjs} +30 -49
- package/dist/chunks/NcTextField-GdOVvMI8.mjs.map +1 -0
- package/dist/chunks/NcThemeProvider-25ResoIv.mjs +53 -0
- package/dist/chunks/NcThemeProvider-25ResoIv.mjs.map +1 -0
- package/dist/chunks/NcThemeProvider-BqGPTeWg.cjs +52 -0
- package/dist/chunks/NcThemeProvider-BqGPTeWg.cjs.map +1 -0
- package/dist/chunks/{NcTimezonePicker-q46K1fSq.mjs → NcTimezonePicker-CHrv7H1J.mjs} +3 -3
- package/dist/chunks/{NcTimezonePicker-q46K1fSq.mjs.map → NcTimezonePicker-CHrv7H1J.mjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-BZhgUp10.cjs → NcTimezonePicker-DiYxhC2U.cjs} +3 -3
- package/dist/chunks/{NcTimezonePicker-BZhgUp10.cjs.map → NcTimezonePicker-DiYxhC2U.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-CQHrLJ0S.cjs → NcUserBubble-Bb2KMW2-.cjs} +3 -3
- package/dist/chunks/{NcUserBubble-CQHrLJ0S.cjs.map → NcUserBubble-Bb2KMW2-.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-B3-E-5F5.mjs → NcUserBubble-DMHgoLZr.mjs} +3 -3
- package/dist/chunks/{NcUserBubble-B3-E-5F5.mjs.map → NcUserBubble-DMHgoLZr.mjs.map} +1 -1
- package/dist/chunks/NcUserStatusIcon-4MmJE11d.cjs +147 -0
- package/dist/chunks/NcUserStatusIcon-4MmJE11d.cjs.map +1 -0
- package/dist/chunks/NcUserStatusIcon-C1nS9t71.mjs +146 -0
- package/dist/chunks/NcUserStatusIcon-C1nS9t71.mjs.map +1 -0
- package/dist/chunks/{ScopeComponent-CsLxtFTy.cjs → ScopeComponent-CB6JQj2P.cjs} +2 -2
- package/dist/chunks/{ScopeComponent-CsLxtFTy.cjs.map → ScopeComponent-CB6JQj2P.cjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-B1B5sM-c.mjs → ScopeComponent-DRKCxrLx.mjs} +2 -2
- package/dist/chunks/{ScopeComponent-B1B5sM-c.mjs.map → ScopeComponent-DRKCxrLx.mjs.map} +1 -1
- package/dist/chunks/_l10n-BU8-kQzN.mjs +145 -0
- package/dist/chunks/_l10n-BU8-kQzN.mjs.map +1 -0
- package/dist/chunks/_l10n-DpwcsAC3.cjs +144 -0
- package/dist/chunks/{_l10n-BiiXtYiP.cjs.map → _l10n-DpwcsAC3.cjs.map} +1 -1
- package/dist/chunks/constants-Bls5liKo.mjs +9 -0
- package/dist/chunks/constants-Bls5liKo.mjs.map +1 -0
- package/dist/chunks/constants-C_lA-vcp.cjs +8 -0
- package/dist/chunks/constants-C_lA-vcp.cjs.map +1 -0
- package/dist/chunks/{focusTrap-Vbgxe8ZX.cjs → focusTrap-DUTqW_IG.cjs} +6 -3
- package/dist/chunks/focusTrap-DUTqW_IG.cjs.map +1 -0
- package/dist/chunks/{focusTrap-DmkaYJTC.mjs → focusTrap-HJQ4pqHV.mjs} +6 -3
- package/dist/chunks/focusTrap-HJQ4pqHV.mjs.map +1 -0
- package/dist/chunks/getAvatarUrl-Du9Y3cPO.cjs +14 -0
- package/dist/chunks/getAvatarUrl-Du9Y3cPO.cjs.map +1 -0
- package/dist/chunks/getAvatarUrl-IhLacDEr.mjs +15 -0
- package/dist/chunks/getAvatarUrl-IhLacDEr.mjs.map +1 -0
- package/dist/chunks/{index-B0yHh7IW.cjs → index-AlIgEQXL.cjs} +12 -8
- package/dist/chunks/index-AlIgEQXL.cjs.map +1 -0
- package/dist/chunks/{index-Dpk-sL3D.mjs → index-B8gPNa8c.mjs} +12 -8
- package/dist/chunks/index-B8gPNa8c.mjs.map +1 -0
- package/dist/chunks/legacy-Brrs7mi9.cjs +4 -0
- package/dist/chunks/legacy-Brrs7mi9.cjs.map +1 -0
- package/dist/chunks/legacy-SvM_Of-C.mjs +5 -0
- package/dist/chunks/legacy-SvM_Of-C.mjs.map +1 -0
- package/dist/chunks/{mdi-YVKlPhQN.cjs → mdi-BqDPfc6J.cjs} +7 -1
- package/dist/chunks/{mdi-YVKlPhQN.cjs.map → mdi-BqDPfc6J.cjs.map} +1 -1
- package/dist/chunks/mdi-vLkDaZ9y.mjs +19 -0
- package/dist/chunks/{mdi-VRLMiqbd.mjs.map → mdi-vLkDaZ9y.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-4kExxHbR.mjs → referencePickerModal-C9Ot-OgO.mjs} +6 -6
- package/dist/chunks/{referencePickerModal-4kExxHbR.mjs.map → referencePickerModal-C9Ot-OgO.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-D4q4tELn.cjs → referencePickerModal-Yw2bZ96U.cjs} +6 -6
- package/dist/chunks/{referencePickerModal-D4q4tELn.cjs.map → referencePickerModal-Yw2bZ96U.cjs.map} +1 -1
- package/dist/chunks/{useTrapStackControl-BJmJdJak.cjs → useTrapStackControl-CTZTSUOt.cjs} +2 -2
- package/dist/chunks/{useTrapStackControl-BJmJdJak.cjs.map → useTrapStackControl-CTZTSUOt.cjs.map} +1 -1
- package/dist/chunks/{useTrapStackControl-b3A_383w.mjs → useTrapStackControl-yqM2SDEs.mjs} +2 -2
- package/dist/chunks/{useTrapStackControl-b3A_383w.mjs.map → useTrapStackControl-yqM2SDEs.mjs.map} +1 -1
- package/dist/composables/useFormatDateTime/index.d.ts +73 -0
- package/dist/composables/useIsDarkTheme/constants.d.ts +7 -0
- package/dist/composables/useIsDarkTheme/index.d.ts +7 -3
- package/dist/functions/dialog/index.d.ts +10 -14
- package/dist/functions/index.d.ts +1 -1
- package/dist/index.cjs +59 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +61 -56
- package/dist/index.mjs.map +1 -1
- package/dist/utils/focusTrap.d.ts +6 -0
- package/dist/utils/getAvatarUrl.d.ts +23 -1
- package/dist/utils/legacy.d.ts +1 -0
- package/package.json +44 -35
- package/dist/assets/NcAvatar-CRiCqAWQ.css +0 -132
- package/dist/assets/NcSelectUsers-CRH00RA2.css +0 -4
- package/dist/chunks/DotsHorizontal-BoI3vnhk.cjs +0 -37
- package/dist/chunks/DotsHorizontal-BoI3vnhk.cjs.map +0 -1
- package/dist/chunks/DotsHorizontal-C6LNsw4N.mjs +0 -38
- package/dist/chunks/DotsHorizontal-C6LNsw4N.mjs.map +0 -1
- package/dist/chunks/NcActionInput-B4qGsF57.mjs.map +0 -1
- package/dist/chunks/NcActionInput-BmERg0FB.cjs.map +0 -1
- package/dist/chunks/NcActions-B4VZCD8B.mjs.map +0 -1
- package/dist/chunks/NcActions-B7DbEbCo.cjs.map +0 -1
- package/dist/chunks/NcAppContent-B7ER65tk.cjs.map +0 -1
- package/dist/chunks/NcAppContent-DyXqBrOB.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationItem-B9Gs5p7m.cjs.map +0 -1
- package/dist/chunks/NcAppNavigationItem-CrTVtqYV.mjs.map +0 -1
- package/dist/chunks/NcAvatar-D_1clyWB.cjs.map +0 -1
- package/dist/chunks/NcAvatar-YSp2ORHc.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch-DbK49DI7.cjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch-VeztTzpz.mjs.map +0 -1
- package/dist/chunks/NcColorPicker-D7aj2f61.mjs.map +0 -1
- package/dist/chunks/NcColorPicker-T-ifFDNs.cjs.map +0 -1
- package/dist/chunks/NcDateTime-C-kLQayi.cjs +0 -158
- package/dist/chunks/NcDateTime-C-kLQayi.cjs.map +0 -1
- package/dist/chunks/NcDateTime-DshRFtUU.mjs +0 -159
- package/dist/chunks/NcDateTime-DshRFtUU.mjs.map +0 -1
- package/dist/chunks/NcInputField-C61UUN46.cjs.map +0 -1
- package/dist/chunks/NcInputField-DTtUueUZ.mjs.map +0 -1
- package/dist/chunks/NcPasswordField-BCzIotoB.cjs.map +0 -1
- package/dist/chunks/NcPasswordField-DNjegDVj.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-B8UqleMX.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-Df_eA-oc.cjs.map +0 -1
- package/dist/chunks/NcSettingsSection-C76Kqeew.mjs.map +0 -1
- package/dist/chunks/NcSettingsSection-Dcdxs1IN.cjs.map +0 -1
- package/dist/chunks/NcTextArea-BHERsE_g.mjs.map +0 -1
- package/dist/chunks/NcTextArea-CYLGAGcO.cjs.map +0 -1
- package/dist/chunks/NcTextField-Uk5iD8o2.cjs.map +0 -1
- package/dist/chunks/NcTextField-o_8gWurX.mjs.map +0 -1
- package/dist/chunks/NcUserStatusIcon-cs42Lzdd.cjs +0 -139
- package/dist/chunks/NcUserStatusIcon-cs42Lzdd.cjs.map +0 -1
- package/dist/chunks/NcUserStatusIcon-kbPFeJV6.mjs +0 -138
- package/dist/chunks/NcUserStatusIcon-kbPFeJV6.mjs.map +0 -1
- package/dist/chunks/_l10n-BiiXtYiP.cjs +0 -143
- package/dist/chunks/_l10n-DQgzdF9S.mjs +0 -144
- package/dist/chunks/_l10n-DQgzdF9S.mjs.map +0 -1
- package/dist/chunks/focusTrap-DmkaYJTC.mjs.map +0 -1
- package/dist/chunks/focusTrap-Vbgxe8ZX.cjs.map +0 -1
- package/dist/chunks/getAvatarUrl-6z9qRNH-.cjs +0 -11
- package/dist/chunks/getAvatarUrl-6z9qRNH-.cjs.map +0 -1
- package/dist/chunks/getAvatarUrl-DxvUjKMi.mjs +0 -12
- package/dist/chunks/getAvatarUrl-DxvUjKMi.mjs.map +0 -1
- package/dist/chunks/index-B0yHh7IW.cjs.map +0 -1
- package/dist/chunks/index-Dpk-sL3D.mjs.map +0 -1
- package/dist/chunks/mdi-VRLMiqbd.mjs +0 -13
- package/dist/chunks/usernameToColor-mqInDrGv.cjs +0 -28
- package/dist/chunks/usernameToColor-mqInDrGv.cjs.map +0 -1
- package/dist/chunks/usernameToColor-yoVXn0De.mjs +0 -27
- package/dist/chunks/usernameToColor-yoVXn0De.mjs.map +0 -1
- package/dist/composables/useFormatDateTime.d.ts +0 -56
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const l10n = require("@nextcloud/l10n");
|
|
4
|
+
const core = require("@vueuse/core");
|
|
5
|
+
const Vue = require("vue");
|
|
6
|
+
const _l10n = require("../chunks/_l10n-DpwcsAC3.cjs");
|
|
7
|
+
_l10n.register(_l10n.t2);
|
|
8
|
+
const FEW_SECONDS_AGO = {
|
|
9
|
+
long: _l10n.t("a few seconds ago"),
|
|
10
|
+
short: _l10n.t("seconds ago"),
|
|
11
|
+
// FOR TRANSLATORS: Shorter version of 'a few seconds ago'
|
|
12
|
+
narrow: _l10n.t("sec. ago")
|
|
13
|
+
// FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'
|
|
14
|
+
};
|
|
15
|
+
function useFormatRelativeTime(timestamp = Date.now(), opts = {}) {
|
|
16
|
+
let timeoutId;
|
|
17
|
+
const date = Vue.computed(() => new Date(core.toValue(timestamp)));
|
|
18
|
+
const options = Vue.computed(() => {
|
|
19
|
+
const { language, relativeTime: relativeTime2, ignoreSeconds } = core.toValue(opts);
|
|
20
|
+
return {
|
|
21
|
+
...language && { language },
|
|
22
|
+
...relativeTime2 && { relativeTime: relativeTime2 },
|
|
23
|
+
ignoreSeconds: ignoreSeconds ? FEW_SECONDS_AGO[relativeTime2 || "long"] : false
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
const relativeTime = Vue.ref("");
|
|
27
|
+
Vue.watchEffect(() => updateRelativeTime());
|
|
28
|
+
function updateRelativeTime() {
|
|
29
|
+
relativeTime.value = l10n.formatRelativeTime(date.value, options.value);
|
|
30
|
+
if (core.toValue(opts).update !== false) {
|
|
31
|
+
const diff = Math.abs(Date.now() - new Date(core.toValue(timestamp)).getTime());
|
|
32
|
+
const interval = diff > 12e4 || options.value.ignoreSeconds ? Math.min(diff / 60, 18e5) : 1e3;
|
|
33
|
+
timeoutId = window.setTimeout(updateRelativeTime, interval);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
Vue.onUnmounted(() => timeoutId && window.clearTimeout(timeoutId));
|
|
37
|
+
return Vue.readonly(relativeTime);
|
|
38
|
+
}
|
|
39
|
+
function useFormatTime(timestamp, opts) {
|
|
40
|
+
const options = Vue.computed(() => ({
|
|
41
|
+
locale: l10n.getCanonicalLocale(),
|
|
42
|
+
format: { dateStyle: "short", timeStyle: "medium" },
|
|
43
|
+
...core.toValue(opts)
|
|
44
|
+
}));
|
|
45
|
+
const formatter = Vue.computed(() => new Intl.DateTimeFormat(options.value.locale, options.value.format));
|
|
46
|
+
return Vue.computed(() => formatter.value.format(core.toValue(timestamp)));
|
|
47
|
+
}
|
|
48
|
+
function useFormatDateTime(timestamp = Date.now(), opts = {}) {
|
|
49
|
+
const formattedFullTime = useFormatTime(timestamp, opts);
|
|
50
|
+
const relativeTime = useFormatRelativeTime(timestamp, Vue.computed(() => {
|
|
51
|
+
const options = core.toValue(opts);
|
|
52
|
+
return {
|
|
53
|
+
...options,
|
|
54
|
+
relativeTime: typeof options.relativeTime === "string" ? options.relativeTime : "long"
|
|
55
|
+
};
|
|
56
|
+
}));
|
|
57
|
+
const formattedTime = Vue.computed(
|
|
58
|
+
() => core.toValue(opts).relativeTime !== false ? relativeTime.value : formattedFullTime.value
|
|
59
|
+
);
|
|
60
|
+
return {
|
|
61
|
+
formattedTime,
|
|
62
|
+
formattedFullTime
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
exports.useFormatDateTime = useFormatDateTime;
|
|
66
|
+
exports.useFormatRelativeTime = useFormatRelativeTime;
|
|
67
|
+
exports.useFormatTime = useFormatTime;
|
|
68
|
+
//# sourceMappingURL=useFormatDateTime.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormatDateTime.cjs","sources":["../../src/composables/useFormatDateTime/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FormatDateOptions } from '@nextcloud/l10n'\nimport type { MaybeRefOrGetter } from '@vueuse/core'\nimport type { Ref } from 'vue'\n\nimport { formatRelativeTime, getCanonicalLocale } from '@nextcloud/l10n'\nimport { toValue } from '@vueuse/core'\nimport { computed, onUnmounted, readonly, ref, watchEffect } from 'vue'\nimport { t } from '../../l10n.js'\n\ninterface FormatRelativeTimeOptions extends Partial<Omit<FormatDateOptions, 'ignoreSeconds'>> {\n\tignoreSeconds?: boolean\n\n\t/**\n\t * If set to false the relative time will not be updated anymore.\n\t * @default true - Meaning the relative time will be updated if needed\n\t */\n\tupdate?: boolean\n}\n\ninterface FormatTimeOptions {\n\t/**\n\t * Locale to use for formatting.\n\t * @default current locale\n\t */\n\tlocale?: string\n\n\t/**\n\t * The format used for displaying.\n\t *\n\t * @default { timeStyle: 'medium', dateStyle: 'short' }\n\t */\n\tformat?: Intl.DateTimeFormatOptions\n}\n\n/**\n * @deprecated\n */\ninterface LegacyFormatDateTimeOptions {\n\t/**\n\t * The format used for displaying, or if relative time is used the format used for the title\n\t */\n\tformat?: Intl.DateTimeFormatOptions\n\t/**\n\t * Ignore seconds when displaying the relative time and just show `a few seconds ago`\n\t */\n\tignoreSeconds?: boolean\n\t/**\n\t * Wether to display the timestamp as time from now\n\t */\n\trelativeTime?: false | 'long' | 'short' | 'narrow'\n}\n\nconst FEW_SECONDS_AGO = {\n\tlong: t('a few seconds ago'),\n\tshort: t('seconds ago'), // FOR TRANSLATORS: Shorter version of 'a few seconds ago'\n\tnarrow: t('sec. ago'), // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'\n}\n\n/**\n * Format a timestamp or date object as relative time.\n *\n * This is a composable wrapper around `formatRelativeTime` from `@nextcloud/l10n`.\n *\n * @param timestamp - The timestamp to format\n * @param opts - Formatting options\n */\nexport function useFormatRelativeTime(\n\ttimestamp: MaybeRefOrGetter<Date | number> = Date.now(),\n\topts: MaybeRefOrGetter<FormatRelativeTimeOptions> = {},\n): Readonly<Ref<string>> {\n\tlet timeoutId: number\n\n\t/**\n\t * ECMA Date object of the timestamp\n\t */\n\tconst date = computed(() => new Date(toValue(timestamp)))\n\n\t/**\n\t * Reactive options for `formatRelativeTime` method\n\t */\n\tconst options = computed<FormatDateOptions>(() => {\n\t\tconst { language, relativeTime, ignoreSeconds } = toValue(opts)\n\t\treturn {\n\t\t\t...language && { language },\n\t\t\t...relativeTime && { relativeTime },\n\t\t\tignoreSeconds: ignoreSeconds\n\t\t\t\t? FEW_SECONDS_AGO[relativeTime || 'long']\n\t\t\t\t: false,\n\t\t}\n\t})\n\n\t/**\n\t * The formatted relative time\n\t */\n\tconst relativeTime = ref('')\n\twatchEffect(() => updateRelativeTime())\n\n\t/**\n\t * Update the relative time string.\n\t * This is the callback for the interval.\n\t */\n\tfunction updateRelativeTime() {\n\t\trelativeTime.value = formatRelativeTime(date.value, options.value)\n\n\t\tif (toValue(opts).update !== false) {\n\t\t\tconst diff = Math.abs(Date.now() - new Date(toValue(timestamp)).getTime())\n\t\t\tconst interval = diff > 120000 || options.value.ignoreSeconds\n\t\t\t\t? Math.min(diff / 60, 1800000)\n\t\t\t\t: 1000\n\t\t\ttimeoutId = window.setTimeout(updateRelativeTime, interval)\n\t\t}\n\t}\n\n\t// when the component is unmounted we also clear the timeout\n\tonUnmounted(() => timeoutId && window.clearTimeout(timeoutId))\n\n\treturn readonly(relativeTime)\n}\n\n/**\n * Format a given timestamp or date object as a human readable string.\n *\n * @param timestamp - Timestamp or date object to format\n * @param opts - Formatting options\n */\nexport function useFormatTime(\n\ttimestamp: MaybeRefOrGetter<number | Date>,\n\topts: MaybeRefOrGetter<FormatTimeOptions>,\n): Readonly<Ref<string>> {\n\tconst options = computed<Required<FormatTimeOptions>>(() => ({\n\t\tlocale: getCanonicalLocale(),\n\t\tformat: { dateStyle: 'short', timeStyle: 'medium' },\n\t\t...toValue(opts),\n\t}))\n\n\tconst formatter = computed(() => new Intl.DateTimeFormat(options.value.locale, options.value.format))\n\n\treturn computed(() => formatter.value.format(toValue(timestamp)))\n}\n\n/**\n * Composable for formatting time stamps using current users locale and language\n *\n * @param {import('vue').MaybeRefOrGetter<Date | number>} timestamp Current timestamp\n * @param {object} opts Optional options\n * @param {Intl.DateTimeFormatOptions} opts.format The format used for displaying, or if relative time is used the format used for the title (optional)\n * @param {boolean} opts.ignoreSeconds Ignore seconds when displaying the relative time and just show `a few seconds ago`\n * @param {false | 'long' | 'short' | 'narrow'} opts.relativeTime Wether to display the timestamp as time from now (optional)\n *\n * @deprecated use `useFormatRelativeTime` or `useFormatTime` instead.\n */\nexport function useFormatDateTime(\n\ttimestamp: MaybeRefOrGetter<Date|number> = Date.now(),\n\topts: MaybeRefOrGetter<LegacyFormatDateTimeOptions> = {},\n) {\n\tconst formattedFullTime = useFormatTime(timestamp, opts)\n\tconst relativeTime = useFormatRelativeTime(timestamp, computed(() => {\n\t\tconst options = toValue(opts)\n\t\treturn {\n\t\t\t...options,\n\t\t\trelativeTime: typeof options.relativeTime === 'string'\n\t\t\t\t? options.relativeTime\n\t\t\t\t: 'long',\n\t\t}\n\t}))\n\n\tconst formattedTime = computed(() => toValue(opts).relativeTime !== false\n\t\t? relativeTime.value\n\t\t: formattedFullTime.value,\n\t)\n\n\treturn {\n\t\tformattedTime,\n\t\tformattedFullTime,\n\t}\n}\n"],"names":["t","computed","toValue","relativeTime","ref","watchEffect","formatRelativeTime","onUnmounted","readonly","getCanonicalLocale"],"mappings":";;;;;;;AAyDA,MAAM,kBAAkB;AAAA,EACvB,MAAMA,QAAE,mBAAmB;AAAA,EAC3B,OAAOA,QAAE,aAAa;AAAA;AAAA,EACtB,QAAQA,QAAE,UAAU;AAAA;AACrB;AAUO,SAAS,sBACf,YAA6C,KAAK,OAClD,OAAoD,CAAA,GAC5B;AACpB,MAAA;AAKE,QAAA,OAAOC,IAAAA,SAAS,MAAM,IAAI,KAAKC,KAAQ,QAAA,SAAS,CAAC,CAAC;AAKlD,QAAA,UAAUD,IAAAA,SAA4B,MAAM;AACjD,UAAM,EAAE,UAAU,cAAAE,eAAc,cAAc,IAAID,aAAQ,IAAI;AACvD,WAAA;AAAA,MACN,GAAG,YAAY,EAAE,SAAS;AAAA,MAC1B,GAAGC,iBAAgB,EAAE,cAAAA,cAAa;AAAA,MAClC,eAAe,gBACZ,gBAAgBA,iBAAgB,MAAM,IACtC;AAAA,IACJ;AAAA,EAAA,CACA;AAKK,QAAA,eAAeC,QAAI,EAAE;AACfC,MAAA,YAAA,MAAM,oBAAoB;AAMtC,WAAS,qBAAqB;AAC7B,iBAAa,QAAQC,KAAA,mBAAmB,KAAK,OAAO,QAAQ,KAAK;AAEjE,QAAIJ,aAAQ,IAAI,EAAE,WAAW,OAAO;AACnC,YAAM,OAAO,KAAK,IAAI,KAAK,IAAI,IAAI,IAAI,KAAKA,KAAAA,QAAQ,SAAS,CAAC,EAAE,SAAS;AACnE,YAAA,WAAW,OAAO,QAAU,QAAQ,MAAM,gBAC7C,KAAK,IAAI,OAAO,IAAI,IAAO,IAC3B;AACS,kBAAA,OAAO,WAAW,oBAAoB,QAAQ;AAAA,IAAA;AAAA,EAC3D;AAIDK,MAAAA,YAAY,MAAM,aAAa,OAAO,aAAa,SAAS,CAAC;AAE7D,SAAOC,IAAAA,SAAS,YAAY;AAC7B;AAQgB,SAAA,cACf,WACA,MACwB;AAClB,QAAA,UAAUP,IAAAA,SAAsC,OAAO;AAAA,IAC5D,QAAQQ,KAAAA,mBAAmB;AAAA,IAC3B,QAAQ,EAAE,WAAW,SAAS,WAAW,SAAS;AAAA,IAClD,GAAGP,aAAQ,IAAI;AAAA,EAAA,EACd;AAEF,QAAM,YAAYD,IAAAA,SAAS,MAAM,IAAI,KAAK,eAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,MAAM,CAAC;AAE7F,SAAAA,IAAAA,SAAS,MAAM,UAAU,MAAM,OAAOC,KAAQ,QAAA,SAAS,CAAC,CAAC;AACjE;AAaO,SAAS,kBACf,YAA2C,KAAK,OAChD,OAAsD,CAAA,GACrD;AACK,QAAA,oBAAoB,cAAc,WAAW,IAAI;AACvD,QAAM,eAAe,sBAAsB,WAAWD,IAAA,SAAS,MAAM;AAC9D,UAAA,UAAUC,aAAQ,IAAI;AACrB,WAAA;AAAA,MACN,GAAG;AAAA,MACH,cAAc,OAAO,QAAQ,iBAAiB,WAC3C,QAAQ,eACR;AAAA,IACJ;AAAA,EAAA,CACA,CAAC;AAEF,QAAM,gBAAgBD,IAAA;AAAA,IAAS,MAAMC,KAAAA,QAAQ,IAAI,EAAE,iBAAiB,QACjE,aAAa,QACb,kBAAkB;AAAA,EACrB;AAEO,SAAA;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;;;;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { formatRelativeTime, getCanonicalLocale } from "@nextcloud/l10n";
|
|
2
|
+
import { toValue } from "@vueuse/core";
|
|
3
|
+
import { computed, ref, watchEffect, onUnmounted, readonly } from "vue";
|
|
4
|
+
import { r as register, e as t2, a as t } from "../chunks/_l10n-BU8-kQzN.mjs";
|
|
5
|
+
register(t2);
|
|
6
|
+
const FEW_SECONDS_AGO = {
|
|
7
|
+
long: t("a few seconds ago"),
|
|
8
|
+
short: t("seconds ago"),
|
|
9
|
+
// FOR TRANSLATORS: Shorter version of 'a few seconds ago'
|
|
10
|
+
narrow: t("sec. ago")
|
|
11
|
+
// FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'
|
|
12
|
+
};
|
|
13
|
+
function useFormatRelativeTime(timestamp = Date.now(), opts = {}) {
|
|
14
|
+
let timeoutId;
|
|
15
|
+
const date = computed(() => new Date(toValue(timestamp)));
|
|
16
|
+
const options = computed(() => {
|
|
17
|
+
const { language, relativeTime: relativeTime2, ignoreSeconds } = toValue(opts);
|
|
18
|
+
return {
|
|
19
|
+
...language && { language },
|
|
20
|
+
...relativeTime2 && { relativeTime: relativeTime2 },
|
|
21
|
+
ignoreSeconds: ignoreSeconds ? FEW_SECONDS_AGO[relativeTime2 || "long"] : false
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
const relativeTime = ref("");
|
|
25
|
+
watchEffect(() => updateRelativeTime());
|
|
26
|
+
function updateRelativeTime() {
|
|
27
|
+
relativeTime.value = formatRelativeTime(date.value, options.value);
|
|
28
|
+
if (toValue(opts).update !== false) {
|
|
29
|
+
const diff = Math.abs(Date.now() - new Date(toValue(timestamp)).getTime());
|
|
30
|
+
const interval = diff > 12e4 || options.value.ignoreSeconds ? Math.min(diff / 60, 18e5) : 1e3;
|
|
31
|
+
timeoutId = window.setTimeout(updateRelativeTime, interval);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
onUnmounted(() => timeoutId && window.clearTimeout(timeoutId));
|
|
35
|
+
return readonly(relativeTime);
|
|
36
|
+
}
|
|
37
|
+
function useFormatTime(timestamp, opts) {
|
|
38
|
+
const options = computed(() => ({
|
|
39
|
+
locale: getCanonicalLocale(),
|
|
40
|
+
format: { dateStyle: "short", timeStyle: "medium" },
|
|
41
|
+
...toValue(opts)
|
|
42
|
+
}));
|
|
43
|
+
const formatter = computed(() => new Intl.DateTimeFormat(options.value.locale, options.value.format));
|
|
44
|
+
return computed(() => formatter.value.format(toValue(timestamp)));
|
|
45
|
+
}
|
|
46
|
+
function useFormatDateTime(timestamp = Date.now(), opts = {}) {
|
|
47
|
+
const formattedFullTime = useFormatTime(timestamp, opts);
|
|
48
|
+
const relativeTime = useFormatRelativeTime(timestamp, computed(() => {
|
|
49
|
+
const options = toValue(opts);
|
|
50
|
+
return {
|
|
51
|
+
...options,
|
|
52
|
+
relativeTime: typeof options.relativeTime === "string" ? options.relativeTime : "long"
|
|
53
|
+
};
|
|
54
|
+
}));
|
|
55
|
+
const formattedTime = computed(
|
|
56
|
+
() => toValue(opts).relativeTime !== false ? relativeTime.value : formattedFullTime.value
|
|
57
|
+
);
|
|
58
|
+
return {
|
|
59
|
+
formattedTime,
|
|
60
|
+
formattedFullTime
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
useFormatDateTime,
|
|
65
|
+
useFormatRelativeTime,
|
|
66
|
+
useFormatTime
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=useFormatDateTime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormatDateTime.mjs","sources":["../../src/composables/useFormatDateTime/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FormatDateOptions } from '@nextcloud/l10n'\nimport type { MaybeRefOrGetter } from '@vueuse/core'\nimport type { Ref } from 'vue'\n\nimport { formatRelativeTime, getCanonicalLocale } from '@nextcloud/l10n'\nimport { toValue } from '@vueuse/core'\nimport { computed, onUnmounted, readonly, ref, watchEffect } from 'vue'\nimport { t } from '../../l10n.js'\n\ninterface FormatRelativeTimeOptions extends Partial<Omit<FormatDateOptions, 'ignoreSeconds'>> {\n\tignoreSeconds?: boolean\n\n\t/**\n\t * If set to false the relative time will not be updated anymore.\n\t * @default true - Meaning the relative time will be updated if needed\n\t */\n\tupdate?: boolean\n}\n\ninterface FormatTimeOptions {\n\t/**\n\t * Locale to use for formatting.\n\t * @default current locale\n\t */\n\tlocale?: string\n\n\t/**\n\t * The format used for displaying.\n\t *\n\t * @default { timeStyle: 'medium', dateStyle: 'short' }\n\t */\n\tformat?: Intl.DateTimeFormatOptions\n}\n\n/**\n * @deprecated\n */\ninterface LegacyFormatDateTimeOptions {\n\t/**\n\t * The format used for displaying, or if relative time is used the format used for the title\n\t */\n\tformat?: Intl.DateTimeFormatOptions\n\t/**\n\t * Ignore seconds when displaying the relative time and just show `a few seconds ago`\n\t */\n\tignoreSeconds?: boolean\n\t/**\n\t * Wether to display the timestamp as time from now\n\t */\n\trelativeTime?: false | 'long' | 'short' | 'narrow'\n}\n\nconst FEW_SECONDS_AGO = {\n\tlong: t('a few seconds ago'),\n\tshort: t('seconds ago'), // FOR TRANSLATORS: Shorter version of 'a few seconds ago'\n\tnarrow: t('sec. ago'), // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'\n}\n\n/**\n * Format a timestamp or date object as relative time.\n *\n * This is a composable wrapper around `formatRelativeTime` from `@nextcloud/l10n`.\n *\n * @param timestamp - The timestamp to format\n * @param opts - Formatting options\n */\nexport function useFormatRelativeTime(\n\ttimestamp: MaybeRefOrGetter<Date | number> = Date.now(),\n\topts: MaybeRefOrGetter<FormatRelativeTimeOptions> = {},\n): Readonly<Ref<string>> {\n\tlet timeoutId: number\n\n\t/**\n\t * ECMA Date object of the timestamp\n\t */\n\tconst date = computed(() => new Date(toValue(timestamp)))\n\n\t/**\n\t * Reactive options for `formatRelativeTime` method\n\t */\n\tconst options = computed<FormatDateOptions>(() => {\n\t\tconst { language, relativeTime, ignoreSeconds } = toValue(opts)\n\t\treturn {\n\t\t\t...language && { language },\n\t\t\t...relativeTime && { relativeTime },\n\t\t\tignoreSeconds: ignoreSeconds\n\t\t\t\t? FEW_SECONDS_AGO[relativeTime || 'long']\n\t\t\t\t: false,\n\t\t}\n\t})\n\n\t/**\n\t * The formatted relative time\n\t */\n\tconst relativeTime = ref('')\n\twatchEffect(() => updateRelativeTime())\n\n\t/**\n\t * Update the relative time string.\n\t * This is the callback for the interval.\n\t */\n\tfunction updateRelativeTime() {\n\t\trelativeTime.value = formatRelativeTime(date.value, options.value)\n\n\t\tif (toValue(opts).update !== false) {\n\t\t\tconst diff = Math.abs(Date.now() - new Date(toValue(timestamp)).getTime())\n\t\t\tconst interval = diff > 120000 || options.value.ignoreSeconds\n\t\t\t\t? Math.min(diff / 60, 1800000)\n\t\t\t\t: 1000\n\t\t\ttimeoutId = window.setTimeout(updateRelativeTime, interval)\n\t\t}\n\t}\n\n\t// when the component is unmounted we also clear the timeout\n\tonUnmounted(() => timeoutId && window.clearTimeout(timeoutId))\n\n\treturn readonly(relativeTime)\n}\n\n/**\n * Format a given timestamp or date object as a human readable string.\n *\n * @param timestamp - Timestamp or date object to format\n * @param opts - Formatting options\n */\nexport function useFormatTime(\n\ttimestamp: MaybeRefOrGetter<number | Date>,\n\topts: MaybeRefOrGetter<FormatTimeOptions>,\n): Readonly<Ref<string>> {\n\tconst options = computed<Required<FormatTimeOptions>>(() => ({\n\t\tlocale: getCanonicalLocale(),\n\t\tformat: { dateStyle: 'short', timeStyle: 'medium' },\n\t\t...toValue(opts),\n\t}))\n\n\tconst formatter = computed(() => new Intl.DateTimeFormat(options.value.locale, options.value.format))\n\n\treturn computed(() => formatter.value.format(toValue(timestamp)))\n}\n\n/**\n * Composable for formatting time stamps using current users locale and language\n *\n * @param {import('vue').MaybeRefOrGetter<Date | number>} timestamp Current timestamp\n * @param {object} opts Optional options\n * @param {Intl.DateTimeFormatOptions} opts.format The format used for displaying, or if relative time is used the format used for the title (optional)\n * @param {boolean} opts.ignoreSeconds Ignore seconds when displaying the relative time and just show `a few seconds ago`\n * @param {false | 'long' | 'short' | 'narrow'} opts.relativeTime Wether to display the timestamp as time from now (optional)\n *\n * @deprecated use `useFormatRelativeTime` or `useFormatTime` instead.\n */\nexport function useFormatDateTime(\n\ttimestamp: MaybeRefOrGetter<Date|number> = Date.now(),\n\topts: MaybeRefOrGetter<LegacyFormatDateTimeOptions> = {},\n) {\n\tconst formattedFullTime = useFormatTime(timestamp, opts)\n\tconst relativeTime = useFormatRelativeTime(timestamp, computed(() => {\n\t\tconst options = toValue(opts)\n\t\treturn {\n\t\t\t...options,\n\t\t\trelativeTime: typeof options.relativeTime === 'string'\n\t\t\t\t? options.relativeTime\n\t\t\t\t: 'long',\n\t\t}\n\t}))\n\n\tconst formattedTime = computed(() => toValue(opts).relativeTime !== false\n\t\t? relativeTime.value\n\t\t: formattedFullTime.value,\n\t)\n\n\treturn {\n\t\tformattedTime,\n\t\tformattedFullTime,\n\t}\n}\n"],"names":["relativeTime"],"mappings":";;;;;AAyDA,MAAM,kBAAkB;AAAA,EACvB,MAAM,EAAE,mBAAmB;AAAA,EAC3B,OAAO,EAAE,aAAa;AAAA;AAAA,EACtB,QAAQ,EAAE,UAAU;AAAA;AACrB;AAUO,SAAS,sBACf,YAA6C,KAAK,OAClD,OAAoD,CAAA,GAC5B;AACpB,MAAA;AAKE,QAAA,OAAO,SAAS,MAAM,IAAI,KAAK,QAAQ,SAAS,CAAC,CAAC;AAKlD,QAAA,UAAU,SAA4B,MAAM;AACjD,UAAM,EAAE,UAAU,cAAAA,eAAc,cAAc,IAAI,QAAQ,IAAI;AACvD,WAAA;AAAA,MACN,GAAG,YAAY,EAAE,SAAS;AAAA,MAC1B,GAAGA,iBAAgB,EAAE,cAAAA,cAAa;AAAA,MAClC,eAAe,gBACZ,gBAAgBA,iBAAgB,MAAM,IACtC;AAAA,IACJ;AAAA,EAAA,CACA;AAKK,QAAA,eAAe,IAAI,EAAE;AACf,cAAA,MAAM,oBAAoB;AAMtC,WAAS,qBAAqB;AAC7B,iBAAa,QAAQ,mBAAmB,KAAK,OAAO,QAAQ,KAAK;AAEjE,QAAI,QAAQ,IAAI,EAAE,WAAW,OAAO;AACnC,YAAM,OAAO,KAAK,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,QAAQ,SAAS,CAAC,EAAE,SAAS;AACnE,YAAA,WAAW,OAAO,QAAU,QAAQ,MAAM,gBAC7C,KAAK,IAAI,OAAO,IAAI,IAAO,IAC3B;AACS,kBAAA,OAAO,WAAW,oBAAoB,QAAQ;AAAA,IAAA;AAAA,EAC3D;AAID,cAAY,MAAM,aAAa,OAAO,aAAa,SAAS,CAAC;AAE7D,SAAO,SAAS,YAAY;AAC7B;AAQgB,SAAA,cACf,WACA,MACwB;AAClB,QAAA,UAAU,SAAsC,OAAO;AAAA,IAC5D,QAAQ,mBAAmB;AAAA,IAC3B,QAAQ,EAAE,WAAW,SAAS,WAAW,SAAS;AAAA,IAClD,GAAG,QAAQ,IAAI;AAAA,EAAA,EACd;AAEF,QAAM,YAAY,SAAS,MAAM,IAAI,KAAK,eAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,MAAM,CAAC;AAE7F,SAAA,SAAS,MAAM,UAAU,MAAM,OAAO,QAAQ,SAAS,CAAC,CAAC;AACjE;AAaO,SAAS,kBACf,YAA2C,KAAK,OAChD,OAAsD,CAAA,GACrD;AACK,QAAA,oBAAoB,cAAc,WAAW,IAAI;AACvD,QAAM,eAAe,sBAAsB,WAAW,SAAS,MAAM;AAC9D,UAAA,UAAU,QAAQ,IAAI;AACrB,WAAA;AAAA,MACN,GAAG;AAAA,MACH,cAAc,OAAO,QAAQ,iBAAiB,WAC3C,QAAQ,eACR;AAAA,IACJ;AAAA,EAAA,CACA,CAAC;AAEF,QAAM,gBAAgB;AAAA,IAAS,MAAM,QAAQ,IAAI,EAAE,iBAAiB,QACjE,aAAa,QACb,kBAAkB;AAAA,EACrB;AAEO,SAAA;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const core = require("@vueuse/core");
|
|
4
4
|
const disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.();
|
|
5
5
|
const isMac = /mac|ipad|iphone|darwin/i.test(navigator.userAgent);
|
|
6
|
+
const derivedKeysRegex = /^[a-zA-Z0-9]$/;
|
|
7
|
+
const nonAsciiPrintableRegex = /^[^\x20-\x7F]$/;
|
|
6
8
|
function shouldIgnoreEvent(event) {
|
|
7
9
|
if (!(event.target instanceof HTMLElement) || event.target instanceof HTMLInputElement || event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLSelectElement || event.target.isContentEditable) {
|
|
8
10
|
return true;
|
|
@@ -37,8 +39,18 @@ function useHotKey(keysOrFilter, callback = () => {
|
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
41
|
const validateKeyEvent = (event, key) => {
|
|
42
|
+
if (event.key === key) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
40
45
|
if (options.caseSensitive) {
|
|
41
|
-
|
|
46
|
+
const isKeyInLowerCase = key === key.toLowerCase();
|
|
47
|
+
const isEventKeyInLowerCase = event.key === event.key.toLowerCase();
|
|
48
|
+
if (isKeyInLowerCase !== isEventKeyInLowerCase) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (derivedKeysRegex.test(key) && nonAsciiPrintableRegex.test(event.key)) {
|
|
53
|
+
return event.code.replace(/^(?:Key|Digit|Numpad)/, "") === key.toUpperCase();
|
|
42
54
|
}
|
|
43
55
|
return event.key.toLowerCase() === key.toLowerCase();
|
|
44
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHotKey.cjs","sources":["../../src/composables/useHotKey/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { onKeyStroke } from '@vueuse/core'\n\nconst disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.()\nconst isMac = /mac|ipad|iphone|darwin/i.test(navigator.userAgent)\n\nexport interface UseHotKeyOptions {\n\t/** Make key filter case sensitive */\n\tcaseSensitive?: boolean\n\n\t/** Prevent default behavior of key stroke */\n\tprevent?: boolean\n\n\t/** Stop the event bubbling */\n\tstop?: boolean\n\n\t/** Also listen for keyup event */\n\tpush?: boolean\n\n\t/**\n\t * If set then the callback is only called when the shift key is (not) pressed.\n\t * When left `undefined` a pressed shift key is ignored (callback is run with and without shift pressed).\n\t */\n\tshift?: boolean\n\n\t/**\n\t * Only run the callback if the control key is (not-)pressed.\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'ctrl' key is NOT pressed.\n\t */\n\tctrl?: boolean\n\n\t/**\n\t * If set the callback is only executed if the alt key is (not-)pressed\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'alt' key is NOT pressed.\n\t */\n\talt?: boolean\n}\n\n/**\n * Check if event target (active element) is editable (allows input from keyboard) or NcModal is open\n * If true, a hot key should not trigger the callback\n *\n * @todo Discuss if we should abort on another interactive elements (button, a, e.t.c)\n *\n * @param event keyboard event\n * @return Whether it should prevent callback\n */\nfunction shouldIgnoreEvent(event: KeyboardEvent): boolean {\n\tif (!(event.target instanceof HTMLElement)\n\t\t|| event.target instanceof HTMLInputElement\n\t\t|| event.target instanceof HTMLTextAreaElement\n\t\t|| event.target instanceof HTMLSelectElement\n\t\t|| event.target.isContentEditable) {\n\t\treturn true\n\t}\n\t/** Abort if any modal/dialog opened */\n\treturn document.getElementsByClassName('modal-mask').length !== 0\n}\n\ntype KeyboardEventHandler = (event: KeyboardEvent) => void\n\n/**\n * Implementation of the event handler.\n *\n * @param callback The callback to run\n * @param options hot key options\n */\nfunction eventHandler(callback: KeyboardEventHandler, options: UseHotKeyOptions): KeyboardEventHandler {\n\treturn (event: KeyboardEvent) => {\n\t\tconst ctrlKeyPressed = isMac ? event.metaKey : event.ctrlKey\n\t\tif (ctrlKeyPressed !== Boolean(options.ctrl)) {\n\t\t\t/**\n\t\t\t * Ctrl is required and not pressed, or the opposite\n\t\t\t * As on macOS 'cmd' key is used instead of 'ctrl' key for most key combinations,\n\t\t\t * 'event.metaKey' should be checked\n\t\t\t */\n\t\t\treturn\n\t\t} else if (event.altKey !== Boolean(options.alt)) {\n\t\t\t// Alt is required and not pressed, or the opposite\n\t\t\treturn\n\t\t} else if (options.shift !== undefined && event.shiftKey !== Boolean(options.shift)) {\n\t\t\t/**\n\t\t\t * Shift is required and not pressed, or the opposite\n\t\t\t * As shift key is used to type capital letters and alternate characters,\n\t\t\t * option should be explicitly defined\n\t\t\t */\n\t\t\treturn\n\t\t} else if (shouldIgnoreEvent(event)) {\n\t\t\t// Keyboard shortcuts are disabled, because active element assumes input\n\t\t\treturn\n\t\t}\n\n\t\tif (options.prevent) {\n\t\t\tevent.preventDefault()\n\t\t}\n\t\tif (options.stop) {\n\t\t\tevent.stopPropagation()\n\t\t}\n\t\tcallback(event)\n\t}\n}\n\n/**\n * Composable to use keyboard shortcuts in the application.\n * It respects the users accessibility configuration (opt-out shortcuts).\n *\n * @param keysOrFilter - keyboard key(s) to listen to, or filter function or pass `true` for listening to all keys\n * @param callback - callback function\n * @param options - composable options\n * @see docs/composables/usekeystroke.md\n */\nexport function useHotKey(\n\tkeysOrFilter: true | string | string[] | ((e: KeyboardEvent) => boolean),\n\tcallback = () => {},\n\toptions: UseHotKeyOptions = {},\n) {\n\tif (disableKeyboardShortcuts) {\n\t\t// Keyboard shortcuts are disabled\n\t\treturn () => {}\n\t}\n\n\t/**\n\t * Validates event key to expected key\n\t
|
|
1
|
+
{"version":3,"file":"useHotKey.cjs","sources":["../../src/composables/useHotKey/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { onKeyStroke } from '@vueuse/core'\n\nconst disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.()\nconst isMac = /mac|ipad|iphone|darwin/i.test(navigator.userAgent)\nconst derivedKeysRegex = /^[a-zA-Z0-9]$/\nconst nonAsciiPrintableRegex = /^[^\\x20-\\x7F]$/\n\nexport interface UseHotKeyOptions {\n\t/** Make key filter case sensitive */\n\tcaseSensitive?: boolean\n\n\t/** Prevent default behavior of key stroke */\n\tprevent?: boolean\n\n\t/** Stop the event bubbling */\n\tstop?: boolean\n\n\t/** Also listen for keyup event */\n\tpush?: boolean\n\n\t/**\n\t * If set then the callback is only called when the shift key is (not) pressed.\n\t * When left `undefined` a pressed shift key is ignored (callback is run with and without shift pressed).\n\t */\n\tshift?: boolean\n\n\t/**\n\t * Only run the callback if the control key is (not-)pressed.\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'ctrl' key is NOT pressed.\n\t */\n\tctrl?: boolean\n\n\t/**\n\t * If set the callback is only executed if the alt key is (not-)pressed\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'alt' key is NOT pressed.\n\t */\n\talt?: boolean\n}\n\n/**\n * Check if event target (active element) is editable (allows input from keyboard) or NcModal is open\n * If true, a hot key should not trigger the callback\n *\n * @todo Discuss if we should abort on another interactive elements (button, a, e.t.c)\n *\n * @param event keyboard event\n * @return Whether it should prevent callback\n */\nfunction shouldIgnoreEvent(event: KeyboardEvent): boolean {\n\tif (!(event.target instanceof HTMLElement)\n\t\t|| event.target instanceof HTMLInputElement\n\t\t|| event.target instanceof HTMLTextAreaElement\n\t\t|| event.target instanceof HTMLSelectElement\n\t\t|| event.target.isContentEditable) {\n\t\treturn true\n\t}\n\t/** Abort if any modal/dialog opened */\n\treturn document.getElementsByClassName('modal-mask').length !== 0\n}\n\ntype KeyboardEventHandler = (event: KeyboardEvent) => void\n\n/**\n * Implementation of the event handler.\n *\n * @param callback The callback to run\n * @param options hot key options\n */\nfunction eventHandler(callback: KeyboardEventHandler, options: UseHotKeyOptions): KeyboardEventHandler {\n\treturn (event: KeyboardEvent) => {\n\t\tconst ctrlKeyPressed = isMac ? event.metaKey : event.ctrlKey\n\t\tif (ctrlKeyPressed !== Boolean(options.ctrl)) {\n\t\t\t/**\n\t\t\t * Ctrl is required and not pressed, or the opposite\n\t\t\t * As on macOS 'cmd' key is used instead of 'ctrl' key for most key combinations,\n\t\t\t * 'event.metaKey' should be checked\n\t\t\t */\n\t\t\treturn\n\t\t} else if (event.altKey !== Boolean(options.alt)) {\n\t\t\t// Alt is required and not pressed, or the opposite\n\t\t\treturn\n\t\t} else if (options.shift !== undefined && event.shiftKey !== Boolean(options.shift)) {\n\t\t\t/**\n\t\t\t * Shift is required and not pressed, or the opposite\n\t\t\t * As shift key is used to type capital letters and alternate characters,\n\t\t\t * option should be explicitly defined\n\t\t\t */\n\t\t\treturn\n\t\t} else if (shouldIgnoreEvent(event)) {\n\t\t\t// Keyboard shortcuts are disabled, because active element assumes input\n\t\t\treturn\n\t\t}\n\n\t\tif (options.prevent) {\n\t\t\tevent.preventDefault()\n\t\t}\n\t\tif (options.stop) {\n\t\t\tevent.stopPropagation()\n\t\t}\n\t\tcallback(event)\n\t}\n}\n\n/**\n * Composable to use keyboard shortcuts in the application.\n * It respects the users accessibility configuration (opt-out shortcuts).\n *\n * @param keysOrFilter - keyboard key(s) to listen to, or filter function or pass `true` for listening to all keys\n * @param callback - callback function\n * @param options - composable options\n * @see docs/composables/usekeystroke.md\n */\nexport function useHotKey(\n\tkeysOrFilter: true | string | string[] | ((e: KeyboardEvent) => boolean),\n\tcallback = () => {},\n\toptions: UseHotKeyOptions = {},\n) {\n\tif (disableKeyboardShortcuts) {\n\t\t// Keyboard shortcuts are disabled\n\t\treturn () => {}\n\t}\n\n\t/**\n\t * Validates event key to expected key\n\t *\n\t * @param event keyboard event\n\t * @param key expected key\n\t * @return whether it satisfies expected value or not\n\t */\n\tconst validateKeyEvent = (event: KeyboardEvent, key: string): boolean => {\n\t\t// If key exactly matches event.key, valid with any caseSensitive option. Do not perform further checks\n\t\tif (event.key === key) {\n\t\t\treturn true\n\t\t}\n\n\t\t// If key and event.key are in different cases, invalid with caseSensitive = true. Do not perform further checks\n\t\tif (options.caseSensitive) {\n\t\t\tconst isKeyInLowerCase = key === key.toLowerCase()\n\t\t\tconst isEventKeyInLowerCase = event.key === event.key.toLowerCase()\n\t\t\tif (isKeyInLowerCase !== isEventKeyInLowerCase) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// If received event.key is not a printable ASCII character code (character code 32-127),\n\t\t// try to derive it from event.code and match with expected key\n\t\tif (derivedKeysRegex.test(key) && nonAsciiPrintableRegex.test(event.key)) {\n\t\t\treturn event.code.replace(/^(?:Key|Digit|Numpad)/, '') === key.toUpperCase()\n\t\t}\n\n\t\treturn event.key.toLowerCase() === key.toLowerCase()\n\t}\n\n\t/**\n\t * Filter function for the listener\n\t * see https://github.com/vueuse/vueuse/blob/v11.3.0/packages/core/onKeyStroke/index.ts#L21-L32\n\t *\n\t * @param event keyboard event\n\t * @return Whether it satisfies expected value or not\n\t */\n\tconst keyFilter = (event: KeyboardEvent): boolean => {\n\t\tif (typeof keysOrFilter === 'function') {\n\t\t\treturn keysOrFilter(event)\n\t\t} else if (typeof keysOrFilter === 'string') {\n\t\t\treturn validateKeyEvent(event, keysOrFilter)\n\t\t} else if (Array.isArray(keysOrFilter)) {\n\t\t\treturn keysOrFilter.some(key => validateKeyEvent(event, key))\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tconst stopKeyDown = onKeyStroke(keyFilter, eventHandler(callback, options), {\n\t\teventName: 'keydown',\n\t\tdedupe: true,\n\t\tpassive: !options.prevent,\n\t})\n\n\tconst stopKeyUp = options.push\n\t\t? onKeyStroke(keyFilter, eventHandler(callback, options), {\n\t\t\teventName: 'keyup',\n\t\t\tpassive: !options.prevent,\n\t\t})\n\t\t: () => {}\n\n\treturn () => {\n\t\tstopKeyDown()\n\t\tstopKeyUp()\n\t}\n}\n"],"names":["onKeyStroke"],"mappings":";;;AAMA,MAAM,2BAA2B,OAAO,KAAK,eAAe,2BAA2B;AACvF,MAAM,QAAQ,0BAA0B,KAAK,UAAU,SAAS;AAChE,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;AA2C/B,SAAS,kBAAkB,OAA+B;AACzD,MAAI,EAAE,MAAM,kBAAkB,gBAC1B,MAAM,kBAAkB,oBACxB,MAAM,kBAAkB,uBACxB,MAAM,kBAAkB,qBACxB,MAAM,OAAO,mBAAmB;AAC5B,WAAA;AAAA,EAAA;AAGR,SAAO,SAAS,uBAAuB,YAAY,EAAE,WAAW;AACjE;AAUA,SAAS,aAAa,UAAgC,SAAiD;AACtG,SAAO,CAAC,UAAyB;AAChC,UAAM,iBAAiB,QAAQ,MAAM,UAAU,MAAM;AACrD,QAAI,mBAAmB,QAAQ,QAAQ,IAAI,GAAG;AAM7C;AAAA,IAAA,WACU,MAAM,WAAW,QAAQ,QAAQ,GAAG,GAAG;AAEjD;AAAA,IAAA,WACU,QAAQ,UAAU,UAAa,MAAM,aAAa,QAAQ,QAAQ,KAAK,GAAG;AAMpF;AAAA,IAAA,WACU,kBAAkB,KAAK,GAAG;AAEpC;AAAA,IAAA;AAGD,QAAI,QAAQ,SAAS;AACpB,YAAM,eAAe;AAAA,IAAA;AAEtB,QAAI,QAAQ,MAAM;AACjB,YAAM,gBAAgB;AAAA,IAAA;AAEvB,aAAS,KAAK;AAAA,EACf;AACD;AAWgB,SAAA,UACf,cACA,WAAW,MAAM;AAAC,GAClB,UAA4B,CAAA,GAC3B;AACD,MAAI,0BAA0B;AAE7B,WAAO,MAAM;AAAA,IAAC;AAAA,EAAA;AAUT,QAAA,mBAAmB,CAAC,OAAsB,QAAyB;AAEpE,QAAA,MAAM,QAAQ,KAAK;AACf,aAAA;AAAA,IAAA;AAIR,QAAI,QAAQ,eAAe;AACpB,YAAA,mBAAmB,QAAQ,IAAI,YAAY;AACjD,YAAM,wBAAwB,MAAM,QAAQ,MAAM,IAAI,YAAY;AAClE,UAAI,qBAAqB,uBAAuB;AACxC,eAAA;AAAA,MAAA;AAAA,IACR;AAKG,QAAA,iBAAiB,KAAK,GAAG,KAAK,uBAAuB,KAAK,MAAM,GAAG,GAAG;AACzE,aAAO,MAAM,KAAK,QAAQ,yBAAyB,EAAE,MAAM,IAAI,YAAY;AAAA,IAAA;AAG5E,WAAO,MAAM,IAAI,YAAY,MAAM,IAAI,YAAY;AAAA,EACpD;AASM,QAAA,YAAY,CAAC,UAAkC;AAChD,QAAA,OAAO,iBAAiB,YAAY;AACvC,aAAO,aAAa,KAAK;AAAA,IAAA,WACf,OAAO,iBAAiB,UAAU;AACrC,aAAA,iBAAiB,OAAO,YAAY;AAAA,IACjC,WAAA,MAAM,QAAQ,YAAY,GAAG;AACvC,aAAO,aAAa,KAAK,CAAA,QAAO,iBAAiB,OAAO,GAAG,CAAC;AAAA,IAAA,OACtD;AACC,aAAA;AAAA,IAAA;AAAA,EAET;AAEA,QAAM,cAAcA,KAAAA,YAAY,WAAW,aAAa,UAAU,OAAO,GAAG;AAAA,IAC3E,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS,CAAC,QAAQ;AAAA,EAAA,CAClB;AAEK,QAAA,YAAY,QAAQ,OACvBA,KAAAA,YAAY,WAAW,aAAa,UAAU,OAAO,GAAG;AAAA,IACzD,WAAW;AAAA,IACX,SAAS,CAAC,QAAQ;AAAA,EAClB,CAAA,IACC,MAAM;AAAA,EAAC;AAEV,SAAO,MAAM;AACA,gBAAA;AACF,cAAA;AAAA,EACX;AACD;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { onKeyStroke } from "@vueuse/core";
|
|
2
2
|
const disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.();
|
|
3
3
|
const isMac = /mac|ipad|iphone|darwin/i.test(navigator.userAgent);
|
|
4
|
+
const derivedKeysRegex = /^[a-zA-Z0-9]$/;
|
|
5
|
+
const nonAsciiPrintableRegex = /^[^\x20-\x7F]$/;
|
|
4
6
|
function shouldIgnoreEvent(event) {
|
|
5
7
|
if (!(event.target instanceof HTMLElement) || event.target instanceof HTMLInputElement || event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLSelectElement || event.target.isContentEditable) {
|
|
6
8
|
return true;
|
|
@@ -35,8 +37,18 @@ function useHotKey(keysOrFilter, callback = () => {
|
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
const validateKeyEvent = (event, key) => {
|
|
40
|
+
if (event.key === key) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
38
43
|
if (options.caseSensitive) {
|
|
39
|
-
|
|
44
|
+
const isKeyInLowerCase = key === key.toLowerCase();
|
|
45
|
+
const isEventKeyInLowerCase = event.key === event.key.toLowerCase();
|
|
46
|
+
if (isKeyInLowerCase !== isEventKeyInLowerCase) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (derivedKeysRegex.test(key) && nonAsciiPrintableRegex.test(event.key)) {
|
|
51
|
+
return event.code.replace(/^(?:Key|Digit|Numpad)/, "") === key.toUpperCase();
|
|
40
52
|
}
|
|
41
53
|
return event.key.toLowerCase() === key.toLowerCase();
|
|
42
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHotKey.mjs","sources":["../../src/composables/useHotKey/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { onKeyStroke } from '@vueuse/core'\n\nconst disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.()\nconst isMac = /mac|ipad|iphone|darwin/i.test(navigator.userAgent)\n\nexport interface UseHotKeyOptions {\n\t/** Make key filter case sensitive */\n\tcaseSensitive?: boolean\n\n\t/** Prevent default behavior of key stroke */\n\tprevent?: boolean\n\n\t/** Stop the event bubbling */\n\tstop?: boolean\n\n\t/** Also listen for keyup event */\n\tpush?: boolean\n\n\t/**\n\t * If set then the callback is only called when the shift key is (not) pressed.\n\t * When left `undefined` a pressed shift key is ignored (callback is run with and without shift pressed).\n\t */\n\tshift?: boolean\n\n\t/**\n\t * Only run the callback if the control key is (not-)pressed.\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'ctrl' key is NOT pressed.\n\t */\n\tctrl?: boolean\n\n\t/**\n\t * If set the callback is only executed if the alt key is (not-)pressed\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'alt' key is NOT pressed.\n\t */\n\talt?: boolean\n}\n\n/**\n * Check if event target (active element) is editable (allows input from keyboard) or NcModal is open\n * If true, a hot key should not trigger the callback\n *\n * @todo Discuss if we should abort on another interactive elements (button, a, e.t.c)\n *\n * @param event keyboard event\n * @return Whether it should prevent callback\n */\nfunction shouldIgnoreEvent(event: KeyboardEvent): boolean {\n\tif (!(event.target instanceof HTMLElement)\n\t\t|| event.target instanceof HTMLInputElement\n\t\t|| event.target instanceof HTMLTextAreaElement\n\t\t|| event.target instanceof HTMLSelectElement\n\t\t|| event.target.isContentEditable) {\n\t\treturn true\n\t}\n\t/** Abort if any modal/dialog opened */\n\treturn document.getElementsByClassName('modal-mask').length !== 0\n}\n\ntype KeyboardEventHandler = (event: KeyboardEvent) => void\n\n/**\n * Implementation of the event handler.\n *\n * @param callback The callback to run\n * @param options hot key options\n */\nfunction eventHandler(callback: KeyboardEventHandler, options: UseHotKeyOptions): KeyboardEventHandler {\n\treturn (event: KeyboardEvent) => {\n\t\tconst ctrlKeyPressed = isMac ? event.metaKey : event.ctrlKey\n\t\tif (ctrlKeyPressed !== Boolean(options.ctrl)) {\n\t\t\t/**\n\t\t\t * Ctrl is required and not pressed, or the opposite\n\t\t\t * As on macOS 'cmd' key is used instead of 'ctrl' key for most key combinations,\n\t\t\t * 'event.metaKey' should be checked\n\t\t\t */\n\t\t\treturn\n\t\t} else if (event.altKey !== Boolean(options.alt)) {\n\t\t\t// Alt is required and not pressed, or the opposite\n\t\t\treturn\n\t\t} else if (options.shift !== undefined && event.shiftKey !== Boolean(options.shift)) {\n\t\t\t/**\n\t\t\t * Shift is required and not pressed, or the opposite\n\t\t\t * As shift key is used to type capital letters and alternate characters,\n\t\t\t * option should be explicitly defined\n\t\t\t */\n\t\t\treturn\n\t\t} else if (shouldIgnoreEvent(event)) {\n\t\t\t// Keyboard shortcuts are disabled, because active element assumes input\n\t\t\treturn\n\t\t}\n\n\t\tif (options.prevent) {\n\t\t\tevent.preventDefault()\n\t\t}\n\t\tif (options.stop) {\n\t\t\tevent.stopPropagation()\n\t\t}\n\t\tcallback(event)\n\t}\n}\n\n/**\n * Composable to use keyboard shortcuts in the application.\n * It respects the users accessibility configuration (opt-out shortcuts).\n *\n * @param keysOrFilter - keyboard key(s) to listen to, or filter function or pass `true` for listening to all keys\n * @param callback - callback function\n * @param options - composable options\n * @see docs/composables/usekeystroke.md\n */\nexport function useHotKey(\n\tkeysOrFilter: true | string | string[] | ((e: KeyboardEvent) => boolean),\n\tcallback = () => {},\n\toptions: UseHotKeyOptions = {},\n) {\n\tif (disableKeyboardShortcuts) {\n\t\t// Keyboard shortcuts are disabled\n\t\treturn () => {}\n\t}\n\n\t/**\n\t * Validates event key to expected key\n\t
|
|
1
|
+
{"version":3,"file":"useHotKey.mjs","sources":["../../src/composables/useHotKey/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { onKeyStroke } from '@vueuse/core'\n\nconst disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.()\nconst isMac = /mac|ipad|iphone|darwin/i.test(navigator.userAgent)\nconst derivedKeysRegex = /^[a-zA-Z0-9]$/\nconst nonAsciiPrintableRegex = /^[^\\x20-\\x7F]$/\n\nexport interface UseHotKeyOptions {\n\t/** Make key filter case sensitive */\n\tcaseSensitive?: boolean\n\n\t/** Prevent default behavior of key stroke */\n\tprevent?: boolean\n\n\t/** Stop the event bubbling */\n\tstop?: boolean\n\n\t/** Also listen for keyup event */\n\tpush?: boolean\n\n\t/**\n\t * If set then the callback is only called when the shift key is (not) pressed.\n\t * When left `undefined` a pressed shift key is ignored (callback is run with and without shift pressed).\n\t */\n\tshift?: boolean\n\n\t/**\n\t * Only run the callback if the control key is (not-)pressed.\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'ctrl' key is NOT pressed.\n\t */\n\tctrl?: boolean\n\n\t/**\n\t * If set the callback is only executed if the alt key is (not-)pressed\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'alt' key is NOT pressed.\n\t */\n\talt?: boolean\n}\n\n/**\n * Check if event target (active element) is editable (allows input from keyboard) or NcModal is open\n * If true, a hot key should not trigger the callback\n *\n * @todo Discuss if we should abort on another interactive elements (button, a, e.t.c)\n *\n * @param event keyboard event\n * @return Whether it should prevent callback\n */\nfunction shouldIgnoreEvent(event: KeyboardEvent): boolean {\n\tif (!(event.target instanceof HTMLElement)\n\t\t|| event.target instanceof HTMLInputElement\n\t\t|| event.target instanceof HTMLTextAreaElement\n\t\t|| event.target instanceof HTMLSelectElement\n\t\t|| event.target.isContentEditable) {\n\t\treturn true\n\t}\n\t/** Abort if any modal/dialog opened */\n\treturn document.getElementsByClassName('modal-mask').length !== 0\n}\n\ntype KeyboardEventHandler = (event: KeyboardEvent) => void\n\n/**\n * Implementation of the event handler.\n *\n * @param callback The callback to run\n * @param options hot key options\n */\nfunction eventHandler(callback: KeyboardEventHandler, options: UseHotKeyOptions): KeyboardEventHandler {\n\treturn (event: KeyboardEvent) => {\n\t\tconst ctrlKeyPressed = isMac ? event.metaKey : event.ctrlKey\n\t\tif (ctrlKeyPressed !== Boolean(options.ctrl)) {\n\t\t\t/**\n\t\t\t * Ctrl is required and not pressed, or the opposite\n\t\t\t * As on macOS 'cmd' key is used instead of 'ctrl' key for most key combinations,\n\t\t\t * 'event.metaKey' should be checked\n\t\t\t */\n\t\t\treturn\n\t\t} else if (event.altKey !== Boolean(options.alt)) {\n\t\t\t// Alt is required and not pressed, or the opposite\n\t\t\treturn\n\t\t} else if (options.shift !== undefined && event.shiftKey !== Boolean(options.shift)) {\n\t\t\t/**\n\t\t\t * Shift is required and not pressed, or the opposite\n\t\t\t * As shift key is used to type capital letters and alternate characters,\n\t\t\t * option should be explicitly defined\n\t\t\t */\n\t\t\treturn\n\t\t} else if (shouldIgnoreEvent(event)) {\n\t\t\t// Keyboard shortcuts are disabled, because active element assumes input\n\t\t\treturn\n\t\t}\n\n\t\tif (options.prevent) {\n\t\t\tevent.preventDefault()\n\t\t}\n\t\tif (options.stop) {\n\t\t\tevent.stopPropagation()\n\t\t}\n\t\tcallback(event)\n\t}\n}\n\n/**\n * Composable to use keyboard shortcuts in the application.\n * It respects the users accessibility configuration (opt-out shortcuts).\n *\n * @param keysOrFilter - keyboard key(s) to listen to, or filter function or pass `true` for listening to all keys\n * @param callback - callback function\n * @param options - composable options\n * @see docs/composables/usekeystroke.md\n */\nexport function useHotKey(\n\tkeysOrFilter: true | string | string[] | ((e: KeyboardEvent) => boolean),\n\tcallback = () => {},\n\toptions: UseHotKeyOptions = {},\n) {\n\tif (disableKeyboardShortcuts) {\n\t\t// Keyboard shortcuts are disabled\n\t\treturn () => {}\n\t}\n\n\t/**\n\t * Validates event key to expected key\n\t *\n\t * @param event keyboard event\n\t * @param key expected key\n\t * @return whether it satisfies expected value or not\n\t */\n\tconst validateKeyEvent = (event: KeyboardEvent, key: string): boolean => {\n\t\t// If key exactly matches event.key, valid with any caseSensitive option. Do not perform further checks\n\t\tif (event.key === key) {\n\t\t\treturn true\n\t\t}\n\n\t\t// If key and event.key are in different cases, invalid with caseSensitive = true. Do not perform further checks\n\t\tif (options.caseSensitive) {\n\t\t\tconst isKeyInLowerCase = key === key.toLowerCase()\n\t\t\tconst isEventKeyInLowerCase = event.key === event.key.toLowerCase()\n\t\t\tif (isKeyInLowerCase !== isEventKeyInLowerCase) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// If received event.key is not a printable ASCII character code (character code 32-127),\n\t\t// try to derive it from event.code and match with expected key\n\t\tif (derivedKeysRegex.test(key) && nonAsciiPrintableRegex.test(event.key)) {\n\t\t\treturn event.code.replace(/^(?:Key|Digit|Numpad)/, '') === key.toUpperCase()\n\t\t}\n\n\t\treturn event.key.toLowerCase() === key.toLowerCase()\n\t}\n\n\t/**\n\t * Filter function for the listener\n\t * see https://github.com/vueuse/vueuse/blob/v11.3.0/packages/core/onKeyStroke/index.ts#L21-L32\n\t *\n\t * @param event keyboard event\n\t * @return Whether it satisfies expected value or not\n\t */\n\tconst keyFilter = (event: KeyboardEvent): boolean => {\n\t\tif (typeof keysOrFilter === 'function') {\n\t\t\treturn keysOrFilter(event)\n\t\t} else if (typeof keysOrFilter === 'string') {\n\t\t\treturn validateKeyEvent(event, keysOrFilter)\n\t\t} else if (Array.isArray(keysOrFilter)) {\n\t\t\treturn keysOrFilter.some(key => validateKeyEvent(event, key))\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tconst stopKeyDown = onKeyStroke(keyFilter, eventHandler(callback, options), {\n\t\teventName: 'keydown',\n\t\tdedupe: true,\n\t\tpassive: !options.prevent,\n\t})\n\n\tconst stopKeyUp = options.push\n\t\t? onKeyStroke(keyFilter, eventHandler(callback, options), {\n\t\t\teventName: 'keyup',\n\t\t\tpassive: !options.prevent,\n\t\t})\n\t\t: () => {}\n\n\treturn () => {\n\t\tstopKeyDown()\n\t\tstopKeyUp()\n\t}\n}\n"],"names":[],"mappings":";AAMA,MAAM,2BAA2B,OAAO,KAAK,eAAe,2BAA2B;AACvF,MAAM,QAAQ,0BAA0B,KAAK,UAAU,SAAS;AAChE,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;AA2C/B,SAAS,kBAAkB,OAA+B;AACzD,MAAI,EAAE,MAAM,kBAAkB,gBAC1B,MAAM,kBAAkB,oBACxB,MAAM,kBAAkB,uBACxB,MAAM,kBAAkB,qBACxB,MAAM,OAAO,mBAAmB;AAC5B,WAAA;AAAA,EAAA;AAGR,SAAO,SAAS,uBAAuB,YAAY,EAAE,WAAW;AACjE;AAUA,SAAS,aAAa,UAAgC,SAAiD;AACtG,SAAO,CAAC,UAAyB;AAChC,UAAM,iBAAiB,QAAQ,MAAM,UAAU,MAAM;AACrD,QAAI,mBAAmB,QAAQ,QAAQ,IAAI,GAAG;AAM7C;AAAA,IAAA,WACU,MAAM,WAAW,QAAQ,QAAQ,GAAG,GAAG;AAEjD;AAAA,IAAA,WACU,QAAQ,UAAU,UAAa,MAAM,aAAa,QAAQ,QAAQ,KAAK,GAAG;AAMpF;AAAA,IAAA,WACU,kBAAkB,KAAK,GAAG;AAEpC;AAAA,IAAA;AAGD,QAAI,QAAQ,SAAS;AACpB,YAAM,eAAe;AAAA,IAAA;AAEtB,QAAI,QAAQ,MAAM;AACjB,YAAM,gBAAgB;AAAA,IAAA;AAEvB,aAAS,KAAK;AAAA,EACf;AACD;AAWgB,SAAA,UACf,cACA,WAAW,MAAM;AAAC,GAClB,UAA4B,CAAA,GAC3B;AACD,MAAI,0BAA0B;AAE7B,WAAO,MAAM;AAAA,IAAC;AAAA,EAAA;AAUT,QAAA,mBAAmB,CAAC,OAAsB,QAAyB;AAEpE,QAAA,MAAM,QAAQ,KAAK;AACf,aAAA;AAAA,IAAA;AAIR,QAAI,QAAQ,eAAe;AACpB,YAAA,mBAAmB,QAAQ,IAAI,YAAY;AACjD,YAAM,wBAAwB,MAAM,QAAQ,MAAM,IAAI,YAAY;AAClE,UAAI,qBAAqB,uBAAuB;AACxC,eAAA;AAAA,MAAA;AAAA,IACR;AAKG,QAAA,iBAAiB,KAAK,GAAG,KAAK,uBAAuB,KAAK,MAAM,GAAG,GAAG;AACzE,aAAO,MAAM,KAAK,QAAQ,yBAAyB,EAAE,MAAM,IAAI,YAAY;AAAA,IAAA;AAG5E,WAAO,MAAM,IAAI,YAAY,MAAM,IAAI,YAAY;AAAA,EACpD;AASM,QAAA,YAAY,CAAC,UAAkC;AAChD,QAAA,OAAO,iBAAiB,YAAY;AACvC,aAAO,aAAa,KAAK;AAAA,IAAA,WACf,OAAO,iBAAiB,UAAU;AACrC,aAAA,iBAAiB,OAAO,YAAY;AAAA,IACjC,WAAA,MAAM,QAAQ,YAAY,GAAG;AACvC,aAAO,aAAa,KAAK,CAAA,QAAO,iBAAiB,OAAO,GAAG,CAAC;AAAA,IAAA,OACtD;AACC,aAAA;AAAA,IAAA;AAAA,EAET;AAEA,QAAM,cAAc,YAAY,WAAW,aAAa,UAAU,OAAO,GAAG;AAAA,IAC3E,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS,CAAC,QAAQ;AAAA,EAAA,CAClB;AAEK,QAAA,YAAY,QAAQ,OACvB,YAAY,WAAW,aAAa,UAAU,OAAO,GAAG;AAAA,IACzD,WAAW;AAAA,IACX,SAAS,CAAC,QAAQ;AAAA,EAClB,CAAA,IACC,MAAM;AAAA,EAAC;AAEV,SAAO,MAAM;AACA,gBAAA;AACF,cAAA;AAAA,EACX;AACD;"}
|
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Vue = require("vue");
|
|
4
3
|
const core = require("@vueuse/core");
|
|
4
|
+
const Vue = require("vue");
|
|
5
5
|
const Functions_isDarkTheme = require("../Functions/isDarkTheme.cjs");
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const constants = require("../chunks/constants-C_lA-vcp.cjs");
|
|
7
|
+
/*!
|
|
8
|
+
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
9
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
10
|
+
*/
|
|
11
|
+
function useIsDarkThemeElement(el) {
|
|
12
|
+
const element = Vue.computed(() => core.toValue(el) ?? document.body);
|
|
13
|
+
const isDarkTheme = Vue.ref(Functions_isDarkTheme.checkIfDarkTheme(element.value));
|
|
8
14
|
const isDarkSystemTheme = core.usePreferredDark();
|
|
9
15
|
function updateIsDarkTheme() {
|
|
10
|
-
isDarkTheme.value = Functions_isDarkTheme.checkIfDarkTheme(
|
|
16
|
+
isDarkTheme.value = Functions_isDarkTheme.checkIfDarkTheme(element.value);
|
|
11
17
|
}
|
|
12
|
-
core.useMutationObserver(
|
|
18
|
+
core.useMutationObserver(element, updateIsDarkTheme, { attributes: true });
|
|
19
|
+
Vue.watch(element, updateIsDarkTheme);
|
|
13
20
|
Vue.watch(isDarkSystemTheme, updateIsDarkTheme, { immediate: true });
|
|
14
21
|
return Vue.readonly(isDarkTheme);
|
|
15
22
|
}
|
|
16
|
-
const
|
|
23
|
+
const useInternalIsDarkTheme = core.createSharedComposable(() => useIsDarkThemeElement());
|
|
24
|
+
function useIsDarkTheme() {
|
|
25
|
+
const isDarkTheme = useInternalIsDarkTheme();
|
|
26
|
+
const enforcedTheme = Vue.inject(constants.INJECTION_KEY_THEME, void 0);
|
|
27
|
+
return Vue.computed(() => {
|
|
28
|
+
if (enforcedTheme?.value) {
|
|
29
|
+
return enforcedTheme.value === "dark";
|
|
30
|
+
}
|
|
31
|
+
return isDarkTheme.value;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
17
34
|
exports.useIsDarkTheme = useIsDarkTheme;
|
|
18
35
|
exports.useIsDarkThemeElement = useIsDarkThemeElement;
|
|
19
36
|
//# sourceMappingURL=useIsDarkTheme.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsDarkTheme.cjs","sources":["../../src/composables/useIsDarkTheme/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useIsDarkTheme.cjs","sources":["../../src/composables/useIsDarkTheme/index.ts"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { MaybeRefOrGetter } from '@vueuse/core'\nimport type { DeepReadonly, Ref } from 'vue'\n\nimport { createSharedComposable, toValue, usePreferredDark, useMutationObserver } from '@vueuse/core'\nimport { computed, inject, ref, readonly, watch } from 'vue'\nimport { checkIfDarkTheme } from '../../functions/isDarkTheme/index.ts'\nimport { INJECTION_KEY_THEME } from './constants.ts'\n\n/**\n * Check whether the dark theme is enabled on a specific element.\n * If you need to check an entire page, use `useIsDarkTheme` instead for better performance.\n * Reacts on element attributes change and system theme change.\n * @param el - The element to check for the dark theme enabled on (default is `document.body`)\n * @return {DeepReadonly<Ref<boolean>>} - computed boolean whether the dark theme is enabled\n */\nexport function useIsDarkThemeElement(el?: MaybeRefOrGetter<HTMLElement>): DeepReadonly<Ref<boolean>> {\n\tconst element = computed(() => toValue(el) ?? document.body)\n\n\tconst isDarkTheme = ref(checkIfDarkTheme(element.value))\n\tconst isDarkSystemTheme = usePreferredDark()\n\n\t/** Update the isDarkTheme */\n\tfunction updateIsDarkTheme() {\n\t\tisDarkTheme.value = checkIfDarkTheme(element.value)\n\t}\n\n\t// Watch for element change to handle data-theme* attributes change\n\tuseMutationObserver(element, updateIsDarkTheme, { attributes: true })\n\t// Watch for ref changes\n\twatch(element, updateIsDarkTheme)\n\t// Watch for system theme change for the default theme\n\twatch(isDarkSystemTheme, updateIsDarkTheme, { immediate: true })\n\n\treturn readonly(isDarkTheme)\n}\n\n/**\n * The real shared composable of the dark theme state.\n * We need to wrap this to allow to react to injected theme changes.\n */\nconst useInternalIsDarkTheme = createSharedComposable(() => useIsDarkThemeElement())\n\n/**\n * Shared composable to check whether the dark theme is enabled on the page.\n *\n * Reacts on body data-theme-* attributes change and system theme change.\n * As well as any enforced theme by the `NcThemeProvider`.\n *\n * @return Computed boolean whether the dark theme is enabled\n */\nexport function useIsDarkTheme(): DeepReadonly<Ref<boolean>> {\n\tconst isDarkTheme = useInternalIsDarkTheme()\n\tconst enforcedTheme = inject(INJECTION_KEY_THEME, undefined)\n\n\treturn computed(() => {\n\t\tif (enforcedTheme?.value) {\n\t\t\treturn enforcedTheme.value === 'dark'\n\t\t}\n\t\treturn isDarkTheme.value\n\t})\n}\n"],"names":["computed","toValue","ref","checkIfDarkTheme","usePreferredDark","useMutationObserver","watch","readonly","createSharedComposable","inject","INJECTION_KEY_THEME"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,sBAAsB,IAAgE;AACrG,QAAM,UAAUA,IAAAA,SAAS,MAAMC,KAAAA,QAAQ,EAAE,KAAK,SAAS,IAAI;AAE3D,QAAM,cAAcC,IAAA,IAAIC,sBAAiB,iBAAA,QAAQ,KAAK,CAAC;AACvD,QAAM,oBAAoBC,KAAAA,iBAAiB;AAG3C,WAAS,oBAAoB;AAChB,gBAAA,QAAQD,uCAAiB,QAAQ,KAAK;AAAA,EAAA;AAInDE,OAAAA,oBAAoB,SAAS,mBAAmB,EAAE,YAAY,MAAM;AAEpEC,MAAA,MAAM,SAAS,iBAAiB;AAEhCA,MAAAA,MAAM,mBAAmB,mBAAmB,EAAE,WAAW,MAAM;AAE/D,SAAOC,IAAAA,SAAS,WAAW;AAC5B;AAMA,MAAM,yBAAyBC,KAAAA,uBAAuB,MAAM,uBAAuB;AAU5E,SAAS,iBAA6C;AAC5D,QAAM,cAAc,uBAAuB;AACrC,QAAA,gBAAgBC,IAAAA,OAAOC,UAAA,qBAAqB,MAAS;AAE3D,SAAOV,aAAS,MAAM;AACrB,QAAI,eAAe,OAAO;AACzB,aAAO,cAAc,UAAU;AAAA,IAAA;AAEhC,WAAO,YAAY;AAAA,EAAA,CACnB;AACF;;;"}
|
|
@@ -1,17 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createSharedComposable, toValue, usePreferredDark, useMutationObserver } from "@vueuse/core";
|
|
2
|
+
import { computed, ref, watch, readonly, inject } from "vue";
|
|
3
3
|
import { checkIfDarkTheme } from "../Functions/isDarkTheme.mjs";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { I as INJECTION_KEY_THEME } from "../chunks/constants-Bls5liKo.mjs";
|
|
5
|
+
/*!
|
|
6
|
+
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
7
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
8
|
+
*/
|
|
9
|
+
function useIsDarkThemeElement(el) {
|
|
10
|
+
const element = computed(() => toValue(el) ?? document.body);
|
|
11
|
+
const isDarkTheme = ref(checkIfDarkTheme(element.value));
|
|
6
12
|
const isDarkSystemTheme = usePreferredDark();
|
|
7
13
|
function updateIsDarkTheme() {
|
|
8
|
-
isDarkTheme.value = checkIfDarkTheme(
|
|
14
|
+
isDarkTheme.value = checkIfDarkTheme(element.value);
|
|
9
15
|
}
|
|
10
|
-
useMutationObserver(
|
|
16
|
+
useMutationObserver(element, updateIsDarkTheme, { attributes: true });
|
|
17
|
+
watch(element, updateIsDarkTheme);
|
|
11
18
|
watch(isDarkSystemTheme, updateIsDarkTheme, { immediate: true });
|
|
12
19
|
return readonly(isDarkTheme);
|
|
13
20
|
}
|
|
14
|
-
const
|
|
21
|
+
const useInternalIsDarkTheme = createSharedComposable(() => useIsDarkThemeElement());
|
|
22
|
+
function useIsDarkTheme() {
|
|
23
|
+
const isDarkTheme = useInternalIsDarkTheme();
|
|
24
|
+
const enforcedTheme = inject(INJECTION_KEY_THEME, void 0);
|
|
25
|
+
return computed(() => {
|
|
26
|
+
if (enforcedTheme?.value) {
|
|
27
|
+
return enforcedTheme.value === "dark";
|
|
28
|
+
}
|
|
29
|
+
return isDarkTheme.value;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
15
32
|
export {
|
|
16
33
|
useIsDarkTheme,
|
|
17
34
|
useIsDarkThemeElement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsDarkTheme.mjs","sources":["../../src/composables/useIsDarkTheme/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useIsDarkTheme.mjs","sources":["../../src/composables/useIsDarkTheme/index.ts"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { MaybeRefOrGetter } from '@vueuse/core'\nimport type { DeepReadonly, Ref } from 'vue'\n\nimport { createSharedComposable, toValue, usePreferredDark, useMutationObserver } from '@vueuse/core'\nimport { computed, inject, ref, readonly, watch } from 'vue'\nimport { checkIfDarkTheme } from '../../functions/isDarkTheme/index.ts'\nimport { INJECTION_KEY_THEME } from './constants.ts'\n\n/**\n * Check whether the dark theme is enabled on a specific element.\n * If you need to check an entire page, use `useIsDarkTheme` instead for better performance.\n * Reacts on element attributes change and system theme change.\n * @param el - The element to check for the dark theme enabled on (default is `document.body`)\n * @return {DeepReadonly<Ref<boolean>>} - computed boolean whether the dark theme is enabled\n */\nexport function useIsDarkThemeElement(el?: MaybeRefOrGetter<HTMLElement>): DeepReadonly<Ref<boolean>> {\n\tconst element = computed(() => toValue(el) ?? document.body)\n\n\tconst isDarkTheme = ref(checkIfDarkTheme(element.value))\n\tconst isDarkSystemTheme = usePreferredDark()\n\n\t/** Update the isDarkTheme */\n\tfunction updateIsDarkTheme() {\n\t\tisDarkTheme.value = checkIfDarkTheme(element.value)\n\t}\n\n\t// Watch for element change to handle data-theme* attributes change\n\tuseMutationObserver(element, updateIsDarkTheme, { attributes: true })\n\t// Watch for ref changes\n\twatch(element, updateIsDarkTheme)\n\t// Watch for system theme change for the default theme\n\twatch(isDarkSystemTheme, updateIsDarkTheme, { immediate: true })\n\n\treturn readonly(isDarkTheme)\n}\n\n/**\n * The real shared composable of the dark theme state.\n * We need to wrap this to allow to react to injected theme changes.\n */\nconst useInternalIsDarkTheme = createSharedComposable(() => useIsDarkThemeElement())\n\n/**\n * Shared composable to check whether the dark theme is enabled on the page.\n *\n * Reacts on body data-theme-* attributes change and system theme change.\n * As well as any enforced theme by the `NcThemeProvider`.\n *\n * @return Computed boolean whether the dark theme is enabled\n */\nexport function useIsDarkTheme(): DeepReadonly<Ref<boolean>> {\n\tconst isDarkTheme = useInternalIsDarkTheme()\n\tconst enforcedTheme = inject(INJECTION_KEY_THEME, undefined)\n\n\treturn computed(() => {\n\t\tif (enforcedTheme?.value) {\n\t\t\treturn enforcedTheme.value === 'dark'\n\t\t}\n\t\treturn isDarkTheme.value\n\t})\n}\n"],"names":[],"mappings":";;;;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,sBAAsB,IAAgE;AACrG,QAAM,UAAU,SAAS,MAAM,QAAQ,EAAE,KAAK,SAAS,IAAI;AAE3D,QAAM,cAAc,IAAI,iBAAiB,QAAQ,KAAK,CAAC;AACvD,QAAM,oBAAoB,iBAAiB;AAG3C,WAAS,oBAAoB;AAChB,gBAAA,QAAQ,iBAAiB,QAAQ,KAAK;AAAA,EAAA;AAInD,sBAAoB,SAAS,mBAAmB,EAAE,YAAY,MAAM;AAEpE,QAAM,SAAS,iBAAiB;AAEhC,QAAM,mBAAmB,mBAAmB,EAAE,WAAW,MAAM;AAE/D,SAAO,SAAS,WAAW;AAC5B;AAMA,MAAM,yBAAyB,uBAAuB,MAAM,uBAAuB;AAU5E,SAAS,iBAA6C;AAC5D,QAAM,cAAc,uBAAuB;AACrC,QAAA,gBAAgB,OAAO,qBAAqB,MAAS;AAE3D,SAAO,SAAS,MAAM;AACrB,QAAI,eAAe,OAAO;AACzB,aAAO,cAAc,UAAU;AAAA,IAAA;AAEhC,WAAO,YAAY;AAAA,EAAA,CACnB;AACF;"}
|
|
@@ -3,21 +3,33 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const Vue = require("vue");
|
|
4
4
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
5
5
|
const Vue__default = /* @__PURE__ */ _interopDefault(Vue);
|
|
6
|
-
function spawnDialog(dialog, props, onClose = () => {
|
|
6
|
+
function spawnDialog(dialog, props = {}, optionsOrOnClose = {}, onClose = () => {
|
|
7
7
|
}) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
if (typeof optionsOrOnClose === "function") {
|
|
9
|
+
onClose = optionsOrOnClose;
|
|
10
|
+
optionsOrOnClose = {};
|
|
11
|
+
}
|
|
12
|
+
let { container } = optionsOrOnClose;
|
|
13
|
+
if ("container" in props && typeof props.container === "string") {
|
|
14
|
+
container ??= props.container;
|
|
15
|
+
}
|
|
16
|
+
const resolvedContainer = typeof container === "string" && document.querySelector(container) || document.body;
|
|
17
|
+
const element = resolvedContainer.appendChild(document.createElement("div"));
|
|
11
18
|
const vm = new Vue__default.default({
|
|
12
|
-
el,
|
|
19
|
+
el: element,
|
|
13
20
|
name: "VueDialogHelper",
|
|
14
21
|
render: (h) => h(dialog, {
|
|
15
|
-
props
|
|
22
|
+
props: {
|
|
23
|
+
// If dialog has no `container` prop passing a falsy value does nothing
|
|
24
|
+
// Otherwise it is expected that `null` disables teleport and mounts dialog in place like NcDialog/NcModal
|
|
25
|
+
container: null,
|
|
26
|
+
...props
|
|
27
|
+
},
|
|
16
28
|
on: {
|
|
17
29
|
close: (...rest) => {
|
|
18
30
|
onClose(...rest.map((v) => Vue.toRaw(v)));
|
|
19
31
|
vm.$destroy();
|
|
20
|
-
|
|
32
|
+
element.remove();
|
|
21
33
|
}
|
|
22
34
|
}
|
|
23
35
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.cjs","sources":["../../src/functions/dialog/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { AsyncComponent, Component } from 'vue'\n\nimport Vue, { toRaw } from 'vue'\n\
|
|
1
|
+
{"version":3,"file":"dialog.cjs","sources":["../../src/functions/dialog/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { AsyncComponent, Component } from 'vue'\n\nimport Vue, { toRaw } from 'vue'\n\ntype SpawnDialogOptions = {\n\t/**\n\t * Container to mount the dialog to\n\t * @default document.body\n\t */\n\tcontainer?: Element | string\n}\n\nexport function spawnDialog(\n\tdialog: Component,\n\tprops?: object,\n\tonClose?: (...rest: unknown[]) => void,\n): void\n\nexport function spawnDialog(\n\tdialog: Component,\n\tprops?: object,\n\toptions?: SpawnDialogOptions,\n\tonClose?: (...rest: unknown[]) => void,\n): void\n\n/**\n * Spawn a single-use Vue dialog instance to get the result when it is closed\n *\n * @param dialog - Dialog component to spawn\n * @param props - Props to pass to the dialog instance\n * @param optionsOrOnClose - Spawning options or a callback when the dialog is closed\n * @param onClose - Callback when the dialog is closed\n */\nexport function spawnDialog(\n\tdialog: Component,\n\tprops: object = {},\n\toptionsOrOnClose: SpawnDialogOptions | ((...rest: unknown[]) => void) = {},\n\tonClose: (...rest: unknown[]) => void = () => {},\n): Vue {\n\tif (typeof optionsOrOnClose === 'function') {\n\t\tonClose = optionsOrOnClose\n\t\toptionsOrOnClose = {}\n\t}\n\n\tlet { container } = optionsOrOnClose\n\n\t// For backwards compatibility try to use container from props\n\tif ('container' in props && typeof props.container === 'string') {\n\t\tcontainer ??= props.container\n\t}\n\n\t// Resolve container to an Element or fallback to document.body\n\tconst resolvedContainer = (typeof container === 'string' && document.querySelector(container)) || document.body\n\n\t// Create root container element for the dialog\n\tconst element = resolvedContainer.appendChild(document.createElement('div'))\n\n\tconst vm = new Vue({\n\t\tel: element,\n\t\tname: 'VueDialogHelper',\n\t\trender: (h) =>\n\t\t\th(dialog, {\n\t\t\t\tprops: {\n\t\t\t\t\t// If dialog has no `container` prop passing a falsy value does nothing\n\t\t\t\t\t// Otherwise it is expected that `null` disables teleport and mounts dialog in place like NcDialog/NcModal\n\t\t\t\t\tcontainer: null,\n\t\t\t\t\t...props,\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tclose: (...rest: unknown[]) => {\n\t\t\t\t\t\tonClose(...rest.map(v => toRaw(v)))\n\t\t\t\t\t\tvm.$destroy()\n\t\t\t\t\t\telement.remove()\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t})\n\treturn vm\n}\n"],"names":["Vue","toRaw"],"mappings":";;;;;AAqCgB,SAAA,YACf,QACA,QAAgB,CAAA,GAChB,mBAAwE,CAAA,GACxE,UAAwC,MAAM;AAAC,GACzC;AACF,MAAA,OAAO,qBAAqB,YAAY;AACjC,cAAA;AACV,uBAAmB,CAAC;AAAA,EAAA;AAGjB,MAAA,EAAE,cAAc;AAGpB,MAAI,eAAe,SAAS,OAAO,MAAM,cAAc,UAAU;AAChE,kBAAc,MAAM;AAAA,EAAA;AAIf,QAAA,oBAAqB,OAAO,cAAc,YAAY,SAAS,cAAc,SAAS,KAAM,SAAS;AAG3G,QAAM,UAAU,kBAAkB,YAAY,SAAS,cAAc,KAAK,CAAC;AAErE,QAAA,KAAK,IAAIA,qBAAI;AAAA,IAClB,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ,CAAC,MACR,EAAE,QAAQ;AAAA,MACT,OAAO;AAAA;AAAA;AAAA,QAGN,WAAW;AAAA,QACX,GAAG;AAAA,MACJ;AAAA,MACA,IAAI;AAAA,QACH,OAAO,IAAI,SAAoB;AAC9B,kBAAQ,GAAG,KAAK,IAAI,OAAKC,IAAM,MAAA,CAAC,CAAC,CAAC;AAClC,aAAG,SAAS;AACZ,kBAAQ,OAAO;AAAA,QAAA;AAAA,MAChB;AAAA,IAED,CAAA;AAAA,EAAA,CACF;AACM,SAAA;AACR;;"}
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import Vue, { toRaw } from "vue";
|
|
2
|
-
function spawnDialog(dialog, props, onClose = () => {
|
|
2
|
+
function spawnDialog(dialog, props = {}, optionsOrOnClose = {}, onClose = () => {
|
|
3
3
|
}) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
if (typeof optionsOrOnClose === "function") {
|
|
5
|
+
onClose = optionsOrOnClose;
|
|
6
|
+
optionsOrOnClose = {};
|
|
7
|
+
}
|
|
8
|
+
let { container } = optionsOrOnClose;
|
|
9
|
+
if ("container" in props && typeof props.container === "string") {
|
|
10
|
+
container ??= props.container;
|
|
11
|
+
}
|
|
12
|
+
const resolvedContainer = typeof container === "string" && document.querySelector(container) || document.body;
|
|
13
|
+
const element = resolvedContainer.appendChild(document.createElement("div"));
|
|
7
14
|
const vm = new Vue({
|
|
8
|
-
el,
|
|
15
|
+
el: element,
|
|
9
16
|
name: "VueDialogHelper",
|
|
10
17
|
render: (h) => h(dialog, {
|
|
11
|
-
props
|
|
18
|
+
props: {
|
|
19
|
+
// If dialog has no `container` prop passing a falsy value does nothing
|
|
20
|
+
// Otherwise it is expected that `null` disables teleport and mounts dialog in place like NcDialog/NcModal
|
|
21
|
+
container: null,
|
|
22
|
+
...props
|
|
23
|
+
},
|
|
12
24
|
on: {
|
|
13
25
|
close: (...rest) => {
|
|
14
26
|
onClose(...rest.map((v) => toRaw(v)));
|
|
15
27
|
vm.$destroy();
|
|
16
|
-
|
|
28
|
+
element.remove();
|
|
17
29
|
}
|
|
18
30
|
}
|
|
19
31
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.mjs","sources":["../../src/functions/dialog/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { AsyncComponent, Component } from 'vue'\n\nimport Vue, { toRaw } from 'vue'\n\
|
|
1
|
+
{"version":3,"file":"dialog.mjs","sources":["../../src/functions/dialog/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { AsyncComponent, Component } from 'vue'\n\nimport Vue, { toRaw } from 'vue'\n\ntype SpawnDialogOptions = {\n\t/**\n\t * Container to mount the dialog to\n\t * @default document.body\n\t */\n\tcontainer?: Element | string\n}\n\nexport function spawnDialog(\n\tdialog: Component,\n\tprops?: object,\n\tonClose?: (...rest: unknown[]) => void,\n): void\n\nexport function spawnDialog(\n\tdialog: Component,\n\tprops?: object,\n\toptions?: SpawnDialogOptions,\n\tonClose?: (...rest: unknown[]) => void,\n): void\n\n/**\n * Spawn a single-use Vue dialog instance to get the result when it is closed\n *\n * @param dialog - Dialog component to spawn\n * @param props - Props to pass to the dialog instance\n * @param optionsOrOnClose - Spawning options or a callback when the dialog is closed\n * @param onClose - Callback when the dialog is closed\n */\nexport function spawnDialog(\n\tdialog: Component,\n\tprops: object = {},\n\toptionsOrOnClose: SpawnDialogOptions | ((...rest: unknown[]) => void) = {},\n\tonClose: (...rest: unknown[]) => void = () => {},\n): Vue {\n\tif (typeof optionsOrOnClose === 'function') {\n\t\tonClose = optionsOrOnClose\n\t\toptionsOrOnClose = {}\n\t}\n\n\tlet { container } = optionsOrOnClose\n\n\t// For backwards compatibility try to use container from props\n\tif ('container' in props && typeof props.container === 'string') {\n\t\tcontainer ??= props.container\n\t}\n\n\t// Resolve container to an Element or fallback to document.body\n\tconst resolvedContainer = (typeof container === 'string' && document.querySelector(container)) || document.body\n\n\t// Create root container element for the dialog\n\tconst element = resolvedContainer.appendChild(document.createElement('div'))\n\n\tconst vm = new Vue({\n\t\tel: element,\n\t\tname: 'VueDialogHelper',\n\t\trender: (h) =>\n\t\t\th(dialog, {\n\t\t\t\tprops: {\n\t\t\t\t\t// If dialog has no `container` prop passing a falsy value does nothing\n\t\t\t\t\t// Otherwise it is expected that `null` disables teleport and mounts dialog in place like NcDialog/NcModal\n\t\t\t\t\tcontainer: null,\n\t\t\t\t\t...props,\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tclose: (...rest: unknown[]) => {\n\t\t\t\t\t\tonClose(...rest.map(v => toRaw(v)))\n\t\t\t\t\t\tvm.$destroy()\n\t\t\t\t\t\telement.remove()\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t})\n\treturn vm\n}\n"],"names":[],"mappings":";AAqCgB,SAAA,YACf,QACA,QAAgB,CAAA,GAChB,mBAAwE,CAAA,GACxE,UAAwC,MAAM;AAAC,GACzC;AACF,MAAA,OAAO,qBAAqB,YAAY;AACjC,cAAA;AACV,uBAAmB,CAAC;AAAA,EAAA;AAGjB,MAAA,EAAE,cAAc;AAGpB,MAAI,eAAe,SAAS,OAAO,MAAM,cAAc,UAAU;AAChE,kBAAc,MAAM;AAAA,EAAA;AAIf,QAAA,oBAAqB,OAAO,cAAc,YAAY,SAAS,cAAc,SAAS,KAAM,SAAS;AAG3G,QAAM,UAAU,kBAAkB,YAAY,SAAS,cAAc,KAAK,CAAC;AAErE,QAAA,KAAK,IAAI,IAAI;AAAA,IAClB,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ,CAAC,MACR,EAAE,QAAQ;AAAA,MACT,OAAO;AAAA;AAAA;AAAA,QAGN,WAAW;AAAA,QACX,GAAG;AAAA,MACJ;AAAA,MACA,IAAI;AAAA,QACH,OAAO,IAAI,SAAoB;AAC9B,kBAAQ,GAAG,KAAK,IAAI,OAAK,MAAM,CAAC,CAAC,CAAC;AAClC,aAAG,SAAS;AACZ,kBAAQ,OAAO;AAAA,QAAA;AAAA,MAChB;AAAA,IAED,CAAA;AAAA,EAAA,CACF;AACM,SAAA;AACR;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const Functions_registerReference = require("../chunks/index-BV85rPB7.cjs");
|
|
4
|
-
const referencePickerModal = require("../chunks/referencePickerModal-
|
|
4
|
+
const referencePickerModal = require("../chunks/referencePickerModal-Yw2bZ96U.cjs");
|
|
5
5
|
exports.NcCustomPickerRenderResult = Functions_registerReference.NcCustomPickerRenderResult;
|
|
6
6
|
exports.hasInteractiveView = Functions_registerReference.hasInteractiveView;
|
|
7
7
|
exports.isCustomPickerElementRegistered = Functions_registerReference.isCustomPickerElementRegistered;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { N, h, d, i, b, r, c, a } from "../chunks/index-56SXuvlv.mjs";
|
|
2
|
-
import { a as a2, g, b as b2, c as c2, d as d2, s } from "../chunks/referencePickerModal-
|
|
2
|
+
import { a as a2, g, b as b2, c as c2, d as d2, s } from "../chunks/referencePickerModal-C9Ot-OgO.mjs";
|
|
3
3
|
export {
|
|
4
4
|
N as NcCustomPickerRenderResult,
|
|
5
5
|
a2 as anyLinkProviderId,
|
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const GenColors = require("../chunks/GenColors-BnYS3bvv.cjs");
|
|
4
|
+
const md5 = require("md5");
|
|
5
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
6
|
+
const md5__default = /* @__PURE__ */ _interopDefault(md5);
|
|
7
|
+
function usernameToColor(username) {
|
|
8
|
+
let hash = username.toLowerCase();
|
|
9
|
+
if (hash.match(/^([0-9a-f]{4}-?){8}$/) === null) {
|
|
10
|
+
hash = md5__default.default(hash);
|
|
11
|
+
}
|
|
12
|
+
hash = hash.replace(/[^0-9a-f]/g, "");
|
|
13
|
+
const steps = 6;
|
|
14
|
+
const finalPalette = GenColors.GenColors(steps);
|
|
15
|
+
function hashToInt(hash2, maximum) {
|
|
16
|
+
let finalInt = 0;
|
|
17
|
+
const result = [];
|
|
18
|
+
for (let i = 0; i < hash2.length; i++) {
|
|
19
|
+
result.push(parseInt(hash2.charAt(i), 16) % 16);
|
|
20
|
+
}
|
|
21
|
+
for (const j in result) {
|
|
22
|
+
finalInt += result[j];
|
|
23
|
+
}
|
|
24
|
+
return parseInt(parseInt(finalInt, 10) % maximum, 10);
|
|
25
|
+
}
|
|
26
|
+
return finalPalette[hashToInt(hash, steps * 3)];
|
|
27
|
+
}
|
|
28
|
+
exports.default = usernameToColor;
|
|
29
|
+
exports.usernameToColor = usernameToColor;
|
|
4
30
|
//# sourceMappingURL=usernameToColor.cjs.map
|