@nextcloud/vue 8.26.1 → 8.28.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 +83 -8
- 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/NcActionLink.cjs +1 -1
- package/dist/Components/NcActionLink.mjs +1 -1
- package/dist/Components/NcActionRouter.cjs +1 -1
- package/dist/Components/NcActionRouter.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/NcCheckboxRadioSwitch.cjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +1 -1
- package/dist/Components/NcChip.cjs +15 -8
- package/dist/Components/NcChip.cjs.map +1 -1
- package/dist/Components/NcChip.mjs +15 -8
- package/dist/Components/NcChip.mjs.map +1 -1
- 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 +4 -4
- package/dist/Components/NcDateTimePicker.mjs +4 -4
- package/dist/Components/NcDateTimePickerNative.cjs +4 -5
- package/dist/Components/NcDateTimePickerNative.cjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +4 -5
- package/dist/Components/NcDateTimePickerNative.mjs.map +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/NcEmptyContent.cjs +2 -2
- package/dist/Components/NcEmptyContent.cjs.map +1 -1
- package/dist/Components/NcEmptyContent.mjs +2 -2
- package/dist/Components/NcEmptyContent.mjs.map +1 -1
- package/dist/Components/NcListItem.cjs +1 -1
- package/dist/Components/NcListItem.mjs +1 -1
- package/dist/Components/NcListItemIcon.cjs +1 -1
- package/dist/Components/NcListItemIcon.mjs +1 -1
- package/dist/Components/NcModal.cjs +4 -4
- package/dist/Components/NcModal.mjs +4 -4
- package/dist/Components/NcPasswordField.cjs +1 -1
- package/dist/Components/NcPasswordField.mjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +1 -1
- package/dist/Components/NcRichContenteditable.cjs +1 -1
- package/dist/Components/NcRichContenteditable.mjs +1 -1
- package/dist/Components/NcRichText.cjs +2 -2
- package/dist/Components/NcRichText.mjs +3 -3
- package/dist/Components/NcSelect.cjs +1 -1
- package/dist/Components/NcSelect.mjs +1 -1
- package/dist/Components/NcSelectTags.cjs +1 -1
- package/dist/Components/NcSelectTags.mjs +1 -1
- package/dist/Components/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/NcTextField.cjs +1 -1
- package/dist/Components/NcTextField.mjs +1 -1
- package/dist/Components/NcTimezonePicker.cjs +1 -1
- package/dist/Components/NcTimezonePicker.mjs +1 -1
- package/dist/Components/NcUserBubble.cjs +1 -1
- package/dist/Components/NcUserBubble.mjs +1 -1
- package/dist/Components/NcUserStatusIcon.cjs +1 -1
- package/dist/Components/NcUserStatusIcon.mjs +1 -1
- package/dist/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 +35 -21
- package/dist/Composables/useHotKey.cjs.map +1 -1
- package/dist/Composables/useHotKey.mjs +35 -21
- package/dist/Composables/useHotKey.mjs.map +1 -1
- package/dist/Composables/useIsFullscreen.cjs +3 -1
- package/dist/Composables/useIsFullscreen.cjs.map +1 -1
- package/dist/Composables/useIsFullscreen.mjs +3 -1
- package/dist/Composables/useIsFullscreen.mjs.map +1 -1
- package/dist/Directives/Focus.cjs +1 -3
- package/dist/Directives/Focus.cjs.map +1 -1
- package/dist/Directives/Focus.mjs +1 -2
- package/dist/Directives/Focus.mjs.map +1 -1
- package/dist/Functions/reference.cjs +1 -1
- package/dist/Functions/reference.mjs +1 -1
- package/dist/Functions/usernameToColor.cjs +1 -1
- package/dist/Functions/usernameToColor.mjs +1 -1
- package/dist/Mixins/isFullscreen.cjs.map +1 -1
- package/dist/Mixins/isFullscreen.mjs.map +1 -1
- package/dist/assets/{NcActionButton-BqMeBMdA.css → NcActionButton-D8Lyueq3.css} +28 -17
- package/dist/assets/{NcActionLink-DA3ebr8W.css → NcActionLink-CNMaob5P.css} +9 -1
- package/dist/assets/{NcActionRouter-DlqXQ6ai.css → NcActionRouter-zXuKLsvi.css} +9 -1
- package/dist/assets/{NcActionText-Cvug6qMa.css → NcActionText-Rad4JSXq.css} +26 -18
- package/dist/assets/{NcActionTextEditable-CasTVqIo.css → NcActionTextEditable-BflqGcjc.css} +60 -60
- 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/{NcAppNavigation-DfTQlVGB.css → NcAppNavigation-WhHdkLQF.css} +12 -12
- package/dist/assets/{NcAppNavigationItem-CdT6ce8-.css → NcAppNavigationItem-BKKHzMYw.css} +5 -1
- package/dist/assets/{NcAppNavigationNewItem-D7wroqrc.css → NcAppNavigationNewItem-PE-w8y-g.css} +5 -1
- package/dist/assets/{NcAppSidebar-DVDDtSbA.css → NcAppSidebar-BFg2HHh6.css} +44 -50
- package/dist/assets/{NcAvatar-CRiCqAWQ.css → NcAvatar-BgjB8atT.css} +24 -24
- package/dist/assets/{NcCheckboxRadioSwitch-DlEieXCj.css → NcCheckboxRadioSwitch-B-axx3m7.css} +45 -42
- package/dist/assets/{NcChip-BNLuZgd6.css → NcChip-CF4Q149V.css} +9 -9
- package/dist/assets/{NcColorPicker-BayJGD4p.css → NcColorPicker-TIE_tTqD.css} +28 -28
- package/dist/assets/{NcDateTimePicker-BX_lZB2F.css → NcDateTimePicker-DGkOwO8l.css} +7 -7
- package/dist/assets/{NcDateTimePickerNative-DVGEymgr.css → NcDateTimePickerNative-CYS2ORfo.css} +13 -13
- package/dist/assets/{NcDialog-BPI0CJvw.css → NcDialog-X7BRqUGJ.css} +15 -15
- package/dist/assets/{NcEmptyContent-CSsXYYcn.css → NcEmptyContent-CHVEJoER.css} +12 -9
- package/dist/assets/{NcListItem-DfaWGP5A.css → NcListItem-B2yvEdWx.css} +44 -44
- package/dist/assets/{NcPasswordField-whtKJFcB.css → NcPasswordField-DVK8tuPi.css} +2 -2
- package/dist/assets/{NcRichText-CzCM9V1U.css → NcRichText-CWVHZl8s.css} +86 -83
- package/dist/assets/NcSelectUsers-BOwQNNMf.css +4 -0
- package/dist/chunks/{GenColors-S7frO84b.mjs → GenColors-BowX0SaQ.mjs} +2 -2
- package/dist/chunks/{GenColors-S7frO84b.mjs.map → GenColors-BowX0SaQ.mjs.map} +1 -1
- package/dist/chunks/{GenColors-7bkY5Nwl.cjs → GenColors-DAxlN2KL.cjs} +2 -2
- package/dist/chunks/{GenColors-7bkY5Nwl.cjs.map → GenColors-DAxlN2KL.cjs.map} +1 -1
- package/dist/chunks/{NcActionButton-Gpv56vuS.mjs → NcActionButton-CpGK6gSX.mjs} +18 -46
- package/dist/chunks/NcActionButton-CpGK6gSX.mjs.map +1 -0
- package/dist/chunks/{NcActionButton-CXeEXQLT.cjs → NcActionButton-DBh812gJ.cjs} +18 -46
- package/dist/chunks/NcActionButton-DBh812gJ.cjs.map +1 -0
- package/dist/chunks/{NcActionButtonGroup-BteTNhIn.mjs → NcActionButtonGroup-BkU5oOmB.mjs} +2 -2
- package/dist/chunks/{NcActionButtonGroup-BteTNhIn.mjs.map → NcActionButtonGroup-BkU5oOmB.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-BMy3W9fG.cjs → NcActionButtonGroup-qRIt-It4.cjs} +2 -2
- package/dist/chunks/{NcActionButtonGroup-BMy3W9fG.cjs.map → NcActionButtonGroup-qRIt-It4.cjs.map} +1 -1
- package/dist/chunks/{NcActionInput-BXOo5jPS.cjs → NcActionInput-CtkE6Hny.cjs} +5 -5
- package/dist/chunks/{NcActionInput-BXOo5jPS.cjs.map → NcActionInput-CtkE6Hny.cjs.map} +1 -1
- package/dist/chunks/{NcActionInput-DuwAyOU-.mjs → NcActionInput-D3FN751M.mjs} +5 -5
- package/dist/chunks/{NcActionInput-DuwAyOU-.mjs.map → NcActionInput-D3FN751M.mjs.map} +1 -1
- package/dist/chunks/{NcActionTextEditable-s1Xqpg6x.cjs → NcActionTextEditable-Du_71yLe.cjs} +8 -10
- package/dist/chunks/NcActionTextEditable-Du_71yLe.cjs.map +1 -0
- package/dist/chunks/{NcActionTextEditable-BYqqHPj2.mjs → NcActionTextEditable-a_607PST.mjs} +8 -10
- package/dist/chunks/NcActionTextEditable-a_607PST.mjs.map +1 -0
- package/dist/chunks/{NcActions-DEZO46mP.mjs → NcActions-CzpbMJoY.mjs} +5 -5
- package/dist/chunks/{NcActions-DEZO46mP.mjs.map → NcActions-CzpbMJoY.mjs.map} +1 -1
- package/dist/chunks/{NcActions-B7DbEbCo.cjs → NcActions-DvZOLPjX.cjs} +5 -5
- package/dist/chunks/{NcActions-B7DbEbCo.cjs.map → NcActions-DvZOLPjX.cjs.map} +1 -1
- package/dist/chunks/{NcAppContent-CiYhQ9r8.cjs → NcAppContent-CItX43vM.cjs} +48 -39
- package/dist/chunks/NcAppContent-CItX43vM.cjs.map +1 -0
- package/dist/chunks/{NcAppContent-LEyo6v0_.mjs → NcAppContent-CP6G4fZX.mjs} +46 -37
- package/dist/chunks/NcAppContent-CP6G4fZX.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigation-DBfTz6qV.cjs → NcAppNavigation-C86dBexT.cjs} +4 -4
- package/dist/chunks/{NcAppNavigation-DBfTz6qV.cjs.map → NcAppNavigation-C86dBexT.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-H8Gvbq5E.mjs → NcAppNavigation-sCuN3OZe.mjs} +4 -4
- package/dist/chunks/{NcAppNavigation-H8Gvbq5E.mjs.map → NcAppNavigation-sCuN3OZe.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-CkIBHQGQ.mjs → NcAppNavigationCaption-B-5VHm-a.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationCaption-CkIBHQGQ.mjs.map → NcAppNavigationCaption-B-5VHm-a.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-CMnWvBgA.cjs → NcAppNavigationCaption-B53sg-pO.cjs} +2 -2
- package/dist/chunks/{NcAppNavigationCaption-CMnWvBgA.cjs.map → NcAppNavigationCaption-B53sg-pO.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-CjhP63uG.mjs → NcAppNavigationItem-D7Y5mGGC.mjs} +6 -6
- package/dist/chunks/{NcAppNavigationItem-CjhP63uG.mjs.map → NcAppNavigationItem-D7Y5mGGC.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-BXAslQdH.cjs → NcAppNavigationItem-huCt6Fb0.cjs} +6 -6
- package/dist/chunks/{NcAppNavigationItem-BXAslQdH.cjs.map → NcAppNavigationItem-huCt6Fb0.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-BLek0JRU.cjs → NcAppNavigationNewItem-CQB6KhNm.cjs} +3 -3
- package/dist/chunks/{NcAppNavigationNewItem-BLek0JRU.cjs.map → NcAppNavigationNewItem-CQB6KhNm.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-DGjgp78o.mjs → NcAppNavigationNewItem-DgTuysCV.mjs} +3 -3
- package/dist/chunks/{NcAppNavigationNewItem-DGjgp78o.mjs.map → NcAppNavigationNewItem-DgTuysCV.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-DTW6CtnU.mjs → NcAppNavigationSearch-9NTDoHar.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationSearch-DTW6CtnU.mjs.map → NcAppNavigationSearch-9NTDoHar.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-BblolNaS.cjs → NcAppNavigationSearch-BxhJ30Ai.cjs} +2 -2
- package/dist/chunks/{NcAppNavigationSearch-BblolNaS.cjs.map → NcAppNavigationSearch-BxhJ30Ai.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-t9JntjoG.mjs → NcAppNavigationSettings-CS36ibjM.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationSettings-t9JntjoG.mjs.map → NcAppNavigationSettings-CS36ibjM.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-ppse1A0c.cjs → NcAppNavigationSettings-x3sCPjbc.cjs} +2 -2
- package/dist/chunks/{NcAppNavigationSettings-ppse1A0c.cjs.map → NcAppNavigationSettings-x3sCPjbc.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-CjPJB2s3.mjs → NcAppNavigationToggle-5vSrAnr1.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationToggle-CjPJB2s3.mjs.map → NcAppNavigationToggle-5vSrAnr1.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-CUGOWggc.cjs → NcAppNavigationToggle-BesLZbAe.cjs} +2 -2
- package/dist/chunks/{NcAppNavigationToggle-CUGOWggc.cjs.map → NcAppNavigationToggle-BesLZbAe.cjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-6cTux_qA.cjs → NcAppSettingsDialog-B6CvUEz6.cjs} +3 -3
- package/dist/chunks/{NcAppSettingsDialog-6cTux_qA.cjs.map → NcAppSettingsDialog-B6CvUEz6.cjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-C5uE1lh5.mjs → NcAppSettingsDialog-DBViVlqo.mjs} +3 -3
- package/dist/chunks/{NcAppSettingsDialog-C5uE1lh5.mjs.map → NcAppSettingsDialog-DBViVlqo.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-C_C76E_8.mjs → NcAppSidebar-6PtLRD0F.mjs} +7 -7
- package/dist/chunks/{NcAppSidebar-C8jffFJX.cjs.map → NcAppSidebar-6PtLRD0F.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-C8jffFJX.cjs → NcAppSidebar-BtJnp-19.cjs} +7 -7
- package/dist/chunks/{NcAppSidebar-C_C76E_8.mjs.map → NcAppSidebar-BtJnp-19.cjs.map} +1 -1
- package/dist/chunks/{NcAvatar-B8FOIz7P.cjs → NcAvatar-CbUnw3_c.cjs} +9 -8
- package/dist/chunks/{NcAvatar-B8FOIz7P.cjs.map → NcAvatar-CbUnw3_c.cjs.map} +1 -1
- package/dist/chunks/{NcAvatar-CTzwxkvv.mjs → NcAvatar-DC7NtEPz.mjs} +9 -8
- package/dist/chunks/{NcAvatar-CTzwxkvv.mjs.map → NcAvatar-DC7NtEPz.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-BExltxiq.cjs → NcBreadcrumb-K0ol_C7l.cjs} +37 -5
- package/dist/chunks/NcBreadcrumb-K0ol_C7l.cjs.map +1 -0
- package/dist/chunks/{NcBreadcrumb-c6GeY5FH.mjs → NcBreadcrumb-WO64bNkF.mjs} +36 -4
- package/dist/chunks/NcBreadcrumb-WO64bNkF.mjs.map +1 -0
- package/dist/chunks/{NcBreadcrumbs-CPmhYEn-.mjs → NcBreadcrumbs-DrTlt5X4.mjs} +4 -4
- package/dist/chunks/{NcBreadcrumbs-CPmhYEn-.mjs.map → NcBreadcrumbs-DrTlt5X4.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-Q3JgS6gv.cjs → NcBreadcrumbs-Ds40ClR-.cjs} +4 -4
- package/dist/chunks/{NcBreadcrumbs-Q3JgS6gv.cjs.map → NcBreadcrumbs-Ds40ClR-.cjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-Di9rSADK.mjs → NcCheckboxRadioSwitch-BIEYfWtF.mjs} +5 -5
- package/dist/chunks/NcCheckboxRadioSwitch-BIEYfWtF.mjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch-DbK49DI7.cjs → NcCheckboxRadioSwitch-IOUKKqSP.cjs} +5 -5
- package/dist/chunks/NcCheckboxRadioSwitch-IOUKKqSP.cjs.map +1 -0
- package/dist/chunks/{NcCollectionList-0Jx-DWg2.cjs → NcCollectionList-B7SKtsie.cjs} +6 -6
- package/dist/chunks/{NcCollectionList-0Jx-DWg2.cjs.map → NcCollectionList-B7SKtsie.cjs.map} +1 -1
- package/dist/chunks/{NcCollectionList-e-iLLNzl.mjs → NcCollectionList-CdqFiw6Z.mjs} +6 -6
- package/dist/chunks/{NcCollectionList-e-iLLNzl.mjs.map → NcCollectionList-CdqFiw6Z.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-C0sDksCi.mjs → NcColorPicker-CtcS-XMk.mjs} +5 -5
- package/dist/chunks/{NcColorPicker-C0sDksCi.mjs.map → NcColorPicker-CtcS-XMk.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-T-ifFDNs.cjs → NcColorPicker-HzfzrrTt.cjs} +5 -5
- package/dist/chunks/{NcColorPicker-T-ifFDNs.cjs.map → NcColorPicker-HzfzrrTt.cjs.map} +1 -1
- package/dist/chunks/{NcContent-DUUfYUtn.cjs → NcContent-B2Uvy01y.cjs} +2 -2
- package/dist/chunks/{NcContent-DUUfYUtn.cjs.map → NcContent-B2Uvy01y.cjs.map} +1 -1
- package/dist/chunks/{NcContent-zoa5Bvb_.mjs → NcContent-BOBFr3nn.mjs} +2 -2
- package/dist/chunks/{NcContent-zoa5Bvb_.mjs.map → NcContent-BOBFr3nn.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-C-hYC14S.mjs → NcDashboardWidget-C3FrsWrR.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidget-C-hYC14S.mjs.map → NcDashboardWidget-C3FrsWrR.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-DQHEu1R5.cjs → NcDashboardWidget-CJMYBSOl.cjs} +4 -4
- package/dist/chunks/{NcDashboardWidget-DQHEu1R5.cjs.map → NcDashboardWidget-CJMYBSOl.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-jNmJHCzO.mjs → NcDashboardWidgetItem-D83T9o2C.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-jNmJHCzO.mjs.map → NcDashboardWidgetItem-D83T9o2C.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-DgPiK40s.cjs → NcDashboardWidgetItem-EVIAYLsi.cjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-DgPiK40s.cjs.map → NcDashboardWidgetItem-EVIAYLsi.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-DvC6y1MC.cjs → NcDialog-D4gfqrqn.cjs} +5 -5
- package/dist/chunks/{NcDialog-DvC6y1MC.cjs.map → NcDialog-D4gfqrqn.cjs.map} +1 -1
- package/dist/chunks/{NcDialog-Bg9U6bnj.mjs → NcDialog-OV8kfc5o.mjs} +5 -5
- package/dist/chunks/{NcDialog-Bg9U6bnj.mjs.map → NcDialog-OV8kfc5o.mjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-BWYKv9fM.mjs → NcDialogButton-BhuiKGmE.mjs} +2 -2
- package/dist/chunks/{NcDialogButton-BWYKv9fM.mjs.map → NcDialogButton-BhuiKGmE.mjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-BFemrIUw.cjs → NcDialogButton-SPofxC7K.cjs} +2 -2
- package/dist/chunks/{NcDialogButton-BFemrIUw.cjs.map → NcDialogButton-SPofxC7K.cjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-B7hMntv4.mjs → NcEmojiPicker-BJSfoews.mjs} +5 -5
- package/dist/chunks/{NcEmojiPicker-B7hMntv4.mjs.map → NcEmojiPicker-BJSfoews.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-CtvRZuBW.cjs → NcEmojiPicker-LpRAYAZU.cjs} +5 -5
- package/dist/chunks/{NcEmojiPicker-CtvRZuBW.cjs.map → NcEmojiPicker-LpRAYAZU.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-CacBXLGS.mjs → NcInputConfirmCancel-B4xEFita.mjs} +2 -2
- package/dist/chunks/{NcInputConfirmCancel-CacBXLGS.mjs.map → NcInputConfirmCancel-B4xEFita.mjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-lVLFwBA4.cjs → NcInputConfirmCancel-DiMrwB9r.cjs} +2 -2
- package/dist/chunks/{NcInputConfirmCancel-lVLFwBA4.cjs.map → NcInputConfirmCancel-DiMrwB9r.cjs.map} +1 -1
- package/dist/chunks/{NcListItem-CM-2Sxu0.mjs → NcListItem-BHhlE1Sb.mjs} +7 -7
- package/dist/chunks/{NcListItem-BVNMtN9D.cjs.map → NcListItem-BHhlE1Sb.mjs.map} +1 -1
- package/dist/chunks/{NcListItem-BVNMtN9D.cjs → NcListItem-Bs-sl-hH.cjs} +7 -7
- package/dist/chunks/{NcListItem-CM-2Sxu0.mjs.map → NcListItem-Bs-sl-hH.cjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-NVu4D1gV.mjs → NcListItemIcon-BDq6PIUq.mjs} +2 -2
- package/dist/chunks/{NcListItemIcon-NVu4D1gV.mjs.map → NcListItemIcon-BDq6PIUq.mjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-Dn98VepV.cjs → NcListItemIcon-DQn2njGl.cjs} +2 -2
- package/dist/chunks/{NcListItemIcon-Dn98VepV.cjs.map → NcListItemIcon-DQn2njGl.cjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-CTKHRVC4.mjs → NcPasswordField-5oXVlA4T.mjs} +35 -19
- package/dist/chunks/NcPasswordField-5oXVlA4T.mjs.map +1 -0
- package/dist/chunks/{NcPasswordField-BCzIotoB.cjs → NcPasswordField-B_d4oTF9.cjs} +35 -19
- package/dist/chunks/NcPasswordField-B_d4oTF9.cjs.map +1 -0
- package/dist/chunks/{NcRelatedResourcesPanel-C9qkNtuo.cjs → NcRelatedResourcesPanel-DDKi2A47.cjs} +2 -2
- package/dist/chunks/{NcRelatedResourcesPanel-C9qkNtuo.cjs.map → NcRelatedResourcesPanel-DDKi2A47.cjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-BtfnMS2U.mjs → NcRelatedResourcesPanel-w0cVgK_u.mjs} +2 -2
- package/dist/chunks/{NcRelatedResourcesPanel-BtfnMS2U.mjs.map → NcRelatedResourcesPanel-w0cVgK_u.mjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-BQcBCaz-.cjs → NcRichContenteditable-CbF4935r.cjs} +7 -7
- package/dist/chunks/{NcRichContenteditable-BQcBCaz-.cjs.map → NcRichContenteditable-CbF4935r.cjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-nJL0Ml6f.mjs → NcRichContenteditable-Cqt-neS3.mjs} +7 -7
- package/dist/chunks/{NcRichContenteditable-nJL0Ml6f.mjs.map → NcRichContenteditable-Cqt-neS3.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-Br5t5ga_.mjs → NcRichText-BWY0OxW9.mjs} +13 -7
- package/dist/chunks/{NcRichText-BzJv-N1n.cjs.map → NcRichText-BWY0OxW9.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-BzJv-N1n.cjs → NcRichText-DxDK1G5d.cjs} +14 -7
- package/dist/chunks/{NcRichText-Br5t5ga_.mjs.map → NcRichText-DxDK1G5d.cjs.map} +1 -1
- package/dist/chunks/{NcSelect-ByaW3kG-.cjs → NcSelect-CvN1DuY2.cjs} +3 -3
- package/dist/chunks/{NcSelect-ByaW3kG-.cjs.map → NcSelect-CvN1DuY2.cjs.map} +1 -1
- package/dist/chunks/{NcSelect-DVUm4oCe.mjs → NcSelect-DmIaznJY.mjs} +3 -3
- package/dist/chunks/{NcSelect-DVUm4oCe.mjs.map → NcSelect-DmIaznJY.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-Bv44W43g.cjs → NcSelectTags-DJoDzrZl.cjs} +3 -3
- package/dist/chunks/{NcSelectTags-Bv44W43g.cjs.map → NcSelectTags-DJoDzrZl.cjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-BcBE70eK.mjs → NcSelectTags-MsqvY1l4.mjs} +3 -3
- package/dist/chunks/{NcSelectTags-BcBE70eK.mjs.map → NcSelectTags-MsqvY1l4.mjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-BQGjCB8x.mjs → NcSelectUsers-BYynRS17.mjs} +14 -8
- package/dist/chunks/{NcSelectUsers-BQGjCB8x.mjs.map → NcSelectUsers-BYynRS17.mjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-CMnFliv_.cjs → NcSelectUsers-IoPgizBH.cjs} +14 -8
- package/dist/chunks/{NcSelectUsers-CMnFliv_.cjs.map → NcSelectUsers-IoPgizBH.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-t1FMnLKA.mjs → NcSettingsInputText-BXbSSC7N.mjs} +2 -2
- package/dist/chunks/{NcSettingsInputText-t1FMnLKA.mjs.map → NcSettingsInputText-BXbSSC7N.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-BU1_SHOq.cjs → NcSettingsInputText-BknU0gbE.cjs} +2 -2
- package/dist/chunks/{NcSettingsInputText-BU1_SHOq.cjs.map → NcSettingsInputText-BknU0gbE.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-EC3SmiDX.mjs → NcSettingsSection-BNefU-yk.mjs} +2 -2
- package/dist/chunks/{NcSettingsSection-EC3SmiDX.mjs.map → NcSettingsSection-BNefU-yk.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-Dcdxs1IN.cjs → NcSettingsSection-dlDi9oLJ.cjs} +2 -2
- package/dist/chunks/{NcSettingsSection-Dcdxs1IN.cjs.map → NcSettingsSection-dlDi9oLJ.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-LMFSKor_.cjs → NcSettingsSelectGroup-Bm8naUVk.cjs} +3 -3
- package/dist/chunks/{NcSettingsSelectGroup-LMFSKor_.cjs.map → NcSettingsSelectGroup-Bm8naUVk.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-BaxnrQ1h.mjs → NcSettingsSelectGroup-DWEorw2V.mjs} +3 -3
- package/dist/chunks/{NcSettingsSelectGroup-BaxnrQ1h.mjs.map → NcSettingsSelectGroup-DWEorw2V.mjs.map} +1 -1
- package/dist/chunks/{NcTextField-Uk5iD8o2.cjs → NcTextField-CMxmd2Wn.cjs} +29 -48
- package/dist/chunks/NcTextField-CMxmd2Wn.cjs.map +1 -0
- package/dist/chunks/{NcTextField-DRANdaIf.mjs → NcTextField-Cd_RjGj6.mjs} +29 -48
- package/dist/chunks/NcTextField-Cd_RjGj6.mjs.map +1 -0
- package/dist/chunks/{NcTimezonePicker-t60uHoNB.mjs → NcTimezonePicker-BjUmYLVj.mjs} +3 -3
- package/dist/chunks/{NcTimezonePicker-t60uHoNB.mjs.map → NcTimezonePicker-BjUmYLVj.mjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-CcFJQMX9.cjs → NcTimezonePicker-Ds_yZJVZ.cjs} +3 -3
- package/dist/chunks/{NcTimezonePicker-CcFJQMX9.cjs.map → NcTimezonePicker-Ds_yZJVZ.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-Dvxdr2ee.cjs → NcUserBubble-B5MtyQce.cjs} +2 -2
- package/dist/chunks/{NcUserBubble-Dvxdr2ee.cjs.map → NcUserBubble-B5MtyQce.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-W_wjP2lY.mjs → NcUserBubble-DH2UiUfH.mjs} +2 -2
- package/dist/chunks/{NcUserBubble-W_wjP2lY.mjs.map → NcUserBubble-DH2UiUfH.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-cs42Lzdd.cjs → NcUserStatusIcon-B_-V1MDZ.cjs} +2 -2
- package/dist/chunks/{NcUserStatusIcon-cs42Lzdd.cjs.map → NcUserStatusIcon-B_-V1MDZ.cjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-WEKmuaoU.mjs → NcUserStatusIcon-Bya1v9qo.mjs} +2 -2
- package/dist/chunks/{NcUserStatusIcon-WEKmuaoU.mjs.map → NcUserStatusIcon-Bya1v9qo.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-FtC2zEqX.mjs → ScopeComponent-CC0LPlVx.mjs} +2 -2
- package/dist/chunks/{ScopeComponent-FtC2zEqX.mjs.map → ScopeComponent-CC0LPlVx.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-BccjTlJa.cjs → ScopeComponent-SIPKHdQy.cjs} +2 -2
- package/dist/chunks/{ScopeComponent-BccjTlJa.cjs.map → ScopeComponent-SIPKHdQy.cjs.map} +1 -1
- package/dist/chunks/{_l10n-BiiXtYiP.cjs → _l10n-CXXSIoEf.cjs} +5 -9
- package/dist/chunks/{_l10n-BiiXtYiP.cjs.map → _l10n-CXXSIoEf.cjs.map} +1 -1
- package/dist/chunks/{_l10n-Dt0m9Fxw.mjs → _l10n-DIOHNc85.mjs} +20 -24
- package/dist/chunks/_l10n-DIOHNc85.mjs.map +1 -0
- package/dist/chunks/mdi-BflUJIiB.cjs +14 -0
- package/dist/chunks/{mdi-CZJxQPz6.mjs.map → mdi-BflUJIiB.cjs.map} +1 -1
- package/dist/chunks/mdi-C1L0jZ1V.mjs +15 -0
- package/dist/chunks/{mdi-Da9VuUVq.cjs.map → mdi-C1L0jZ1V.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-qWVMGb2m.cjs → referencePickerModal-DbrHVDKS.cjs} +4 -4
- package/dist/chunks/{referencePickerModal-qWVMGb2m.cjs.map → referencePickerModal-DbrHVDKS.cjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-DN7C4An4.mjs → referencePickerModal-sscttPbK.mjs} +4 -4
- package/dist/chunks/{referencePickerModal-DN7C4An4.mjs.map → referencePickerModal-sscttPbK.mjs.map} +1 -1
- package/dist/chunks/{usernameToColor-DJfepfog.mjs → usernameToColor-BPaEECqs.mjs} +2 -2
- package/dist/chunks/{usernameToColor-DJfepfog.mjs.map → usernameToColor-BPaEECqs.mjs.map} +1 -1
- package/dist/chunks/{usernameToColor-mqInDrGv.cjs → usernameToColor-Bu43-l7c.cjs} +2 -2
- package/dist/chunks/{usernameToColor-mqInDrGv.cjs.map → usernameToColor-Bu43-l7c.cjs.map} +1 -1
- package/dist/composables/useFormatDateTime/index.d.ts +73 -0
- package/dist/composables/useHotKey/index.d.ts +35 -0
- package/dist/composables/useIsFullscreen/index.d.ts +11 -0
- package/dist/directives/Focus/index.d.ts +3 -0
- package/dist/index.cjs +56 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +54 -52
- package/package.json +5 -4
- package/dist/assets/NcSelectUsers-CRH00RA2.css +0 -4
- package/dist/chunks/ChevronRight-BUv-PtHh.mjs +0 -38
- package/dist/chunks/ChevronRight-BUv-PtHh.mjs.map +0 -1
- package/dist/chunks/ChevronRight-ZCKVg9OI.cjs +0 -37
- package/dist/chunks/ChevronRight-ZCKVg9OI.cjs.map +0 -1
- package/dist/chunks/NcActionButton-CXeEXQLT.cjs.map +0 -1
- package/dist/chunks/NcActionButton-Gpv56vuS.mjs.map +0 -1
- package/dist/chunks/NcActionTextEditable-BYqqHPj2.mjs.map +0 -1
- package/dist/chunks/NcActionTextEditable-s1Xqpg6x.cjs.map +0 -1
- package/dist/chunks/NcAppContent-CiYhQ9r8.cjs.map +0 -1
- package/dist/chunks/NcAppContent-LEyo6v0_.mjs.map +0 -1
- package/dist/chunks/NcBreadcrumb-BExltxiq.cjs.map +0 -1
- package/dist/chunks/NcBreadcrumb-c6GeY5FH.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch-DbK49DI7.cjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch-Di9rSADK.mjs.map +0 -1
- package/dist/chunks/NcDateTime-BR6BBvML.mjs +0 -159
- package/dist/chunks/NcDateTime-BR6BBvML.mjs.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/NcPasswordField-BCzIotoB.cjs.map +0 -1
- package/dist/chunks/NcPasswordField-CTKHRVC4.mjs.map +0 -1
- package/dist/chunks/NcTextField-DRANdaIf.mjs.map +0 -1
- package/dist/chunks/NcTextField-Uk5iD8o2.cjs.map +0 -1
- package/dist/chunks/_l10n-Dt0m9Fxw.mjs.map +0 -1
- package/dist/chunks/mdi-CZJxQPz6.mjs +0 -9
- package/dist/chunks/mdi-Da9VuUVq.cjs +0 -8
- package/dist/chunks/rtl-DLuwcTlm.cjs +0 -5
- package/dist/chunks/rtl-DLuwcTlm.cjs.map +0 -1
- package/dist/chunks/rtl-v0UOPAM7.mjs +0 -6
- package/dist/chunks/rtl-v0UOPAM7.mjs.map +0 -1
- package/dist/composables/useFormatDateTime.d.ts +0 -56
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { ref, unref, computed, watch, onMounted, onUnmounted } from "vue";
|
|
2
|
-
import { getCanonicalLocale, getLanguage } from "@nextcloud/l10n";
|
|
3
|
-
import { r as register, l as t2, a as t } from "./_l10n-Dt0m9Fxw.mjs";
|
|
4
|
-
import { n as normalizeComponent } from "./_plugin-vue2_normalizer-DU4iP6Vu.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 useFormatDateTime(timestamp = Date.now(), opts = {}) {
|
|
14
|
-
const currentTime = ref(Date.now());
|
|
15
|
-
let intervalId;
|
|
16
|
-
const options = ref({
|
|
17
|
-
format: {
|
|
18
|
-
timeStyle: "medium",
|
|
19
|
-
dateStyle: "short"
|
|
20
|
-
},
|
|
21
|
-
relativeTime: "long",
|
|
22
|
-
ignoreSeconds: false,
|
|
23
|
-
...unref(opts)
|
|
24
|
-
});
|
|
25
|
-
const wrappedOptions = computed(() => ({ ...unref(opts), ...options.value }));
|
|
26
|
-
const date = computed(() => new Date(unref(timestamp)));
|
|
27
|
-
const formattedFullTime = computed(() => {
|
|
28
|
-
const formatter = new Intl.DateTimeFormat(getCanonicalLocale(), wrappedOptions.value.format);
|
|
29
|
-
return formatter.format(date.value);
|
|
30
|
-
});
|
|
31
|
-
const formattedTime = computed(() => {
|
|
32
|
-
if (wrappedOptions.value.relativeTime !== false) {
|
|
33
|
-
const formatter = new Intl.RelativeTimeFormat(getLanguage(), { numeric: "auto", style: wrappedOptions.value.relativeTime });
|
|
34
|
-
const diff = date.value.getTime() - currentTime.value;
|
|
35
|
-
const seconds = diff / 1e3;
|
|
36
|
-
if (Math.abs(seconds) < 59.5) {
|
|
37
|
-
if (wrappedOptions.value.ignoreSeconds) {
|
|
38
|
-
return FEW_SECONDS_AGO[wrappedOptions.value.relativeTime];
|
|
39
|
-
} else {
|
|
40
|
-
return formatter.format(Math.round(seconds), "second");
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const minutes = seconds / 60;
|
|
44
|
-
if (Math.abs(minutes) <= 59) {
|
|
45
|
-
return formatter.format(Math.round(minutes), "minute");
|
|
46
|
-
}
|
|
47
|
-
const hours = minutes / 60;
|
|
48
|
-
if (Math.abs(hours) < 23.5) {
|
|
49
|
-
return formatter.format(Math.round(hours), "hour");
|
|
50
|
-
}
|
|
51
|
-
const days = hours / 24;
|
|
52
|
-
if (Math.abs(days) < 6.5) {
|
|
53
|
-
return formatter.format(Math.round(days), "day");
|
|
54
|
-
}
|
|
55
|
-
if (Math.abs(days) < 27.5) {
|
|
56
|
-
const weeks = days / 7;
|
|
57
|
-
return formatter.format(Math.round(weeks), "week");
|
|
58
|
-
}
|
|
59
|
-
const months = days / 30;
|
|
60
|
-
if (Math.abs(months) < 11.5) {
|
|
61
|
-
return formatter.format(Math.round(months), "month");
|
|
62
|
-
}
|
|
63
|
-
return formatter.format(Math.round(days / 365), "year");
|
|
64
|
-
}
|
|
65
|
-
return formattedFullTime.value;
|
|
66
|
-
});
|
|
67
|
-
watch([wrappedOptions], () => {
|
|
68
|
-
window.clearInterval(intervalId);
|
|
69
|
-
intervalId = void 0;
|
|
70
|
-
if (wrappedOptions.value.relativeTime) {
|
|
71
|
-
intervalId = window.setInterval(() => {
|
|
72
|
-
currentTime.value = Date.now();
|
|
73
|
-
}, 1e3);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
onMounted(() => {
|
|
77
|
-
if (wrappedOptions.value.relativeTime !== false) {
|
|
78
|
-
intervalId = window.setInterval(() => {
|
|
79
|
-
currentTime.value = Date.now();
|
|
80
|
-
}, 1e3);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
onUnmounted(() => {
|
|
84
|
-
window.clearInterval(intervalId);
|
|
85
|
-
});
|
|
86
|
-
return {
|
|
87
|
-
formattedTime,
|
|
88
|
-
formattedFullTime,
|
|
89
|
-
options
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
const _sfc_main = {
|
|
93
|
-
name: "NcDateTime",
|
|
94
|
-
props: {
|
|
95
|
-
/**
|
|
96
|
-
* The timestamp to display, either an unix timestamp (in milliseconds) or a Date object
|
|
97
|
-
*/
|
|
98
|
-
timestamp: {
|
|
99
|
-
type: [Date, Number],
|
|
100
|
-
required: true
|
|
101
|
-
},
|
|
102
|
-
/**
|
|
103
|
-
* The format used for displaying, or if relative time is used the format used for the title (optional)
|
|
104
|
-
*
|
|
105
|
-
* @type {Intl.DateTimeFormatOptions}
|
|
106
|
-
*/
|
|
107
|
-
format: {
|
|
108
|
-
type: Object,
|
|
109
|
-
default: () => ({ timeStyle: "medium", dateStyle: "short" })
|
|
110
|
-
},
|
|
111
|
-
/**
|
|
112
|
-
* Wether to display the timestamp as time from now (optional)
|
|
113
|
-
*
|
|
114
|
-
* - `false`: Disable relative time
|
|
115
|
-
* - `'long'`: Long text, like *2 seconds ago* (default)
|
|
116
|
-
* - `'short'`: Short text, like *2 sec. ago*
|
|
117
|
-
* - `'narrow'`: Even shorter text (same as `'short'` on some languages)
|
|
118
|
-
*/
|
|
119
|
-
relativeTime: {
|
|
120
|
-
type: [Boolean, String],
|
|
121
|
-
default: "long",
|
|
122
|
-
validator: (v) => v === false || ["long", "short", "narrow"].includes(v)
|
|
123
|
-
},
|
|
124
|
-
/**
|
|
125
|
-
* Ignore seconds when displaying the relative time and just show `a few seconds ago`
|
|
126
|
-
*/
|
|
127
|
-
ignoreSeconds: {
|
|
128
|
-
type: Boolean,
|
|
129
|
-
default: false
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
setup(props) {
|
|
133
|
-
const timestamp = computed(() => props.timestamp);
|
|
134
|
-
const { formattedTime, formattedFullTime } = useFormatDateTime(timestamp, props);
|
|
135
|
-
return {
|
|
136
|
-
formattedTime,
|
|
137
|
-
formattedFullTime
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
var _sfc_render = function render() {
|
|
142
|
-
var _vm = this, _c = _vm._self._c;
|
|
143
|
-
return _c("span", { staticClass: "nc-datetime", attrs: { "data-timestamp": _vm.timestamp, "title": _vm.formattedFullTime }, domProps: { "textContent": _vm._s(_vm.formattedTime) } });
|
|
144
|
-
};
|
|
145
|
-
var _sfc_staticRenderFns = [];
|
|
146
|
-
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
147
|
-
_sfc_main,
|
|
148
|
-
_sfc_render,
|
|
149
|
-
_sfc_staticRenderFns,
|
|
150
|
-
false,
|
|
151
|
-
null,
|
|
152
|
-
null
|
|
153
|
-
);
|
|
154
|
-
const NcDateTime = __component__.exports;
|
|
155
|
-
export {
|
|
156
|
-
NcDateTime as N,
|
|
157
|
-
useFormatDateTime as u
|
|
158
|
-
};
|
|
159
|
-
//# sourceMappingURL=NcDateTime-BR6BBvML.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NcDateTime-BR6BBvML.mjs","sources":["../../src/composables/useFormatDateTime.ts","../../src/components/NcDateTime/NcDateTime.vue"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCanonicalLocale, getLanguage } from '@nextcloud/l10n'\nimport { computed, onUnmounted, ref, onMounted, watch, unref, type Ref } from 'vue'\nimport { t } from '../l10n.js'\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\ninterface FormatDateOptions {\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\ntype MaybeRef<T> = T | Ref<T>\n\n/**\n * Composable for formatting time stamps using current users locale and language\n *\n * @param {Date | number | import('vue').Ref<Date> | import('vue').Ref<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 */\nexport function useFormatDateTime(\n\ttimestamp: MaybeRef<Date|number> = Date.now(),\n\topts: MaybeRef<FormatDateOptions> = {},\n) {\n\t// Current time as Date.now is not reactive\n\tconst currentTime = ref(Date.now())\n\t// The interval ID for the window\n\tlet intervalId: number|undefined\n\n\tconst options = ref({\n\t\tformat: {\n\t\t\ttimeStyle: 'medium',\n\t\t\tdateStyle: 'short',\n\t\t} as Intl.DateTimeFormatOptions,\n\t\trelativeTime: 'long' as const,\n\t\tignoreSeconds: false,\n\t\t...unref(opts),\n\t})\n\tconst wrappedOptions = computed<Required<FormatDateOptions>>(() => ({ ...unref(opts), ...options.value }))\n\n\t/** ECMA Date object of the timestamp */\n\tconst date = computed(() => new Date(unref(timestamp)))\n\n\tconst formattedFullTime = computed<string>(() => {\n\t\tconst formatter = new Intl.DateTimeFormat(getCanonicalLocale(), wrappedOptions.value.format)\n\t\treturn formatter.format(date.value)\n\t})\n\n\t/** Time string formatted for main text */\n\tconst formattedTime = computed<string>(() => {\n\t\tif (wrappedOptions.value.relativeTime !== false) {\n\t\t\tconst formatter = new Intl.RelativeTimeFormat(getLanguage(), { numeric: 'auto', style: wrappedOptions.value.relativeTime })\n\n\t\t\tconst diff = date.value.getTime() - currentTime.value\n\t\t\tconst seconds = diff / 1000\n\t\t\tif (Math.abs(seconds) < 59.5) {\n\t\t\t\tif (wrappedOptions.value.ignoreSeconds) {\n\t\t\t\t\treturn FEW_SECONDS_AGO[wrappedOptions.value.relativeTime]\n\t\t\t\t} else {\n\t\t\t\t\treturn formatter.format(Math.round(seconds), 'second')\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst minutes = seconds / 60\n\t\t\tif (Math.abs(minutes) <= 59) {\n\t\t\t\treturn formatter.format(Math.round(minutes), 'minute')\n\t\t\t}\n\t\t\tconst hours = minutes / 60\n\t\t\tif (Math.abs(hours) < 23.5) {\n\t\t\t\treturn formatter.format(Math.round(hours), 'hour')\n\t\t\t}\n\t\t\tconst days = hours / 24\n\t\t\tif (Math.abs(days) < 6.5) {\n\t\t\t\treturn formatter.format(Math.round(days), 'day')\n\t\t\t}\n\t\t\tif (Math.abs(days) < 27.5) {\n\t\t\t\tconst weeks = days / 7\n\t\t\t\treturn formatter.format(Math.round(weeks), 'week')\n\t\t\t}\n\t\t\tconst months = days / 30\n\t\t\tif (Math.abs(months) < 11.5) {\n\t\t\t\treturn formatter.format(Math.round(months), 'month')\n\t\t\t}\n\t\t\treturn formatter.format(Math.round(days / 365), 'year')\n\t\t}\n\t\treturn formattedFullTime.value\n\t})\n\n\t// Set or clear interval if relative time is dis/enabled\n\twatch([wrappedOptions], () => {\n\t\twindow.clearInterval(intervalId)\n\t\tintervalId = undefined\n\t\tif (wrappedOptions.value.relativeTime) {\n\t\t\tintervalId = window.setInterval(() => { currentTime.value = Date.now() }, 1000)\n\t\t}\n\t})\n\n\t// Start the interval for setting the current time if relative time is enabled\n\tonMounted(() => {\n\t\tif (wrappedOptions.value.relativeTime !== false) {\n\t\t\tintervalId = window.setInterval(() => { currentTime.value = Date.now() }, 1000)\n\t\t}\n\t})\n\n\t// ensure interval is cleared\n\tonUnmounted(() => {\n\t\twindow.clearInterval(intervalId)\n\t})\n\n\treturn {\n\t\tformattedTime,\n\t\tformattedFullTime,\n\t\toptions,\n\t}\n}\n","<!--\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### General description\n\nThis components purpose is to display a timestamp in the users local time format.\nIt also supports relative time, for examples *6 seconds ago*.\n\n#### Standard usage\n\nWithout any optional parameters the timestamp is displayed as a relative datetime and a title with the full date is added.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Ignore seconds\n\nIf you do not want the seconds to be counted up until minutes are reached you can simply use the `ignore-seconds` property.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" :ignore-seconds=\"true\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Custom date or time format\n\nThe component allows to format the full date for the title by settings the `format` property.\nIt is also possible to disable relative time by setting the `relativeTime` property to `false`.\n\n```vue\n<template>\n\t<div>\n\t\t<h4>Short relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" relative-time=\"short\" />\n\n\t\t<h4>Custom title format</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" />\n\n\t\t<h4>Without relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" :relative-time=\"false\" />\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t/** For allowed formats see the Intl.DateTimeFormat options */\n\t\t\t\ttimeFormat: {\n\t\t\t\t\tdateStyle: 'short',\n\t\t\t\t\ttimeStyle: 'full'\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style>\nh4 {\n\tfont-weight: bold;\n\tmargin-top: 12px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<span class=\"nc-datetime\"\n\t\t:data-timestamp=\"timestamp\"\n\t\t:title=\"formattedFullTime\"\n\t\tv-text=\"formattedTime\" />\n</template>\n\n<script>\nimport { computed } from 'vue'\nimport { useFormatDateTime } from '../../composables/useFormatDateTime.ts'\n\nexport default {\n\tname: 'NcDateTime',\n\n\tprops: {\n\t\t/**\n\t\t * The timestamp to display, either an unix timestamp (in milliseconds) or a Date object\n\t\t */\n\t\ttimestamp: {\n\t\t\ttype: [Date, Number],\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * The format used for displaying, or if relative time is used the format used for the title (optional)\n\t\t *\n\t\t * @type {Intl.DateTimeFormatOptions}\n\t\t */\n\t\tformat: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ timeStyle: 'medium', dateStyle: 'short' }),\n\t\t},\n\t\t/**\n\t\t * Wether to display the timestamp as time from now (optional)\n\t\t *\n\t\t * - `false`: Disable relative time\n\t\t * - `'long'`: Long text, like *2 seconds ago* (default)\n\t\t * - `'short'`: Short text, like *2 sec. ago*\n\t\t * - `'narrow'`: Even shorter text (same as `'short'` on some languages)\n\t\t */\n\t\trelativeTime: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: 'long',\n\t\t\tvalidator: (v) => v === false || ['long', 'short', 'narrow'].includes(v),\n\t\t},\n\t\t/**\n\t\t * Ignore seconds when displaying the relative time and just show `a few seconds ago`\n\t\t */\n\t\tignoreSeconds: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tsetup(props) {\n\t\tconst timestamp = computed(() => props.timestamp)\n\t\tconst { formattedTime, formattedFullT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MAAM;AACjB,WAAO,cAAc,UAAU;AAAA,EAAA,CAC/B;AAEM,SAAA;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AChCA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAA,MACA,MAAA,CAAA,MAAA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,OAAA,EAAA,WAAA,UAAA,WAAA,QAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,cAAA;AAAA,MACA,MAAA,CAAA,SAAA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,MAAA,MAAA,SAAA,CAAA,QAAA,SAAA,QAAA,EAAA,SAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,MAAA,OAAA;AACA,UAAA,YAAA,SAAA,MAAA,MAAA,SAAA;AACA,UAAA,EAAA,eAAA,kBAAA,IAAA,kBAAA,WAAA,KAAA;AACA,WAAA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const Vue = require("vue");
|
|
3
|
-
const l10n = require("@nextcloud/l10n");
|
|
4
|
-
const _l10n = require("./_l10n-BiiXtYiP.cjs");
|
|
5
|
-
const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
|
|
6
|
-
_l10n.register(_l10n.t2);
|
|
7
|
-
const FEW_SECONDS_AGO = {
|
|
8
|
-
long: _l10n.t("a few seconds ago"),
|
|
9
|
-
short: _l10n.t("seconds ago"),
|
|
10
|
-
// FOR TRANSLATORS: Shorter version of 'a few seconds ago'
|
|
11
|
-
narrow: _l10n.t("sec. ago")
|
|
12
|
-
// FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'
|
|
13
|
-
};
|
|
14
|
-
function useFormatDateTime(timestamp = Date.now(), opts = {}) {
|
|
15
|
-
const currentTime = Vue.ref(Date.now());
|
|
16
|
-
let intervalId;
|
|
17
|
-
const options = Vue.ref({
|
|
18
|
-
format: {
|
|
19
|
-
timeStyle: "medium",
|
|
20
|
-
dateStyle: "short"
|
|
21
|
-
},
|
|
22
|
-
relativeTime: "long",
|
|
23
|
-
ignoreSeconds: false,
|
|
24
|
-
...Vue.unref(opts)
|
|
25
|
-
});
|
|
26
|
-
const wrappedOptions = Vue.computed(() => ({ ...Vue.unref(opts), ...options.value }));
|
|
27
|
-
const date = Vue.computed(() => new Date(Vue.unref(timestamp)));
|
|
28
|
-
const formattedFullTime = Vue.computed(() => {
|
|
29
|
-
const formatter = new Intl.DateTimeFormat(l10n.getCanonicalLocale(), wrappedOptions.value.format);
|
|
30
|
-
return formatter.format(date.value);
|
|
31
|
-
});
|
|
32
|
-
const formattedTime = Vue.computed(() => {
|
|
33
|
-
if (wrappedOptions.value.relativeTime !== false) {
|
|
34
|
-
const formatter = new Intl.RelativeTimeFormat(l10n.getLanguage(), { numeric: "auto", style: wrappedOptions.value.relativeTime });
|
|
35
|
-
const diff = date.value.getTime() - currentTime.value;
|
|
36
|
-
const seconds = diff / 1e3;
|
|
37
|
-
if (Math.abs(seconds) < 59.5) {
|
|
38
|
-
if (wrappedOptions.value.ignoreSeconds) {
|
|
39
|
-
return FEW_SECONDS_AGO[wrappedOptions.value.relativeTime];
|
|
40
|
-
} else {
|
|
41
|
-
return formatter.format(Math.round(seconds), "second");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const minutes = seconds / 60;
|
|
45
|
-
if (Math.abs(minutes) <= 59) {
|
|
46
|
-
return formatter.format(Math.round(minutes), "minute");
|
|
47
|
-
}
|
|
48
|
-
const hours = minutes / 60;
|
|
49
|
-
if (Math.abs(hours) < 23.5) {
|
|
50
|
-
return formatter.format(Math.round(hours), "hour");
|
|
51
|
-
}
|
|
52
|
-
const days = hours / 24;
|
|
53
|
-
if (Math.abs(days) < 6.5) {
|
|
54
|
-
return formatter.format(Math.round(days), "day");
|
|
55
|
-
}
|
|
56
|
-
if (Math.abs(days) < 27.5) {
|
|
57
|
-
const weeks = days / 7;
|
|
58
|
-
return formatter.format(Math.round(weeks), "week");
|
|
59
|
-
}
|
|
60
|
-
const months = days / 30;
|
|
61
|
-
if (Math.abs(months) < 11.5) {
|
|
62
|
-
return formatter.format(Math.round(months), "month");
|
|
63
|
-
}
|
|
64
|
-
return formatter.format(Math.round(days / 365), "year");
|
|
65
|
-
}
|
|
66
|
-
return formattedFullTime.value;
|
|
67
|
-
});
|
|
68
|
-
Vue.watch([wrappedOptions], () => {
|
|
69
|
-
window.clearInterval(intervalId);
|
|
70
|
-
intervalId = void 0;
|
|
71
|
-
if (wrappedOptions.value.relativeTime) {
|
|
72
|
-
intervalId = window.setInterval(() => {
|
|
73
|
-
currentTime.value = Date.now();
|
|
74
|
-
}, 1e3);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
Vue.onMounted(() => {
|
|
78
|
-
if (wrappedOptions.value.relativeTime !== false) {
|
|
79
|
-
intervalId = window.setInterval(() => {
|
|
80
|
-
currentTime.value = Date.now();
|
|
81
|
-
}, 1e3);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Vue.onUnmounted(() => {
|
|
85
|
-
window.clearInterval(intervalId);
|
|
86
|
-
});
|
|
87
|
-
return {
|
|
88
|
-
formattedTime,
|
|
89
|
-
formattedFullTime,
|
|
90
|
-
options
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
const _sfc_main = {
|
|
94
|
-
name: "NcDateTime",
|
|
95
|
-
props: {
|
|
96
|
-
/**
|
|
97
|
-
* The timestamp to display, either an unix timestamp (in milliseconds) or a Date object
|
|
98
|
-
*/
|
|
99
|
-
timestamp: {
|
|
100
|
-
type: [Date, Number],
|
|
101
|
-
required: true
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* The format used for displaying, or if relative time is used the format used for the title (optional)
|
|
105
|
-
*
|
|
106
|
-
* @type {Intl.DateTimeFormatOptions}
|
|
107
|
-
*/
|
|
108
|
-
format: {
|
|
109
|
-
type: Object,
|
|
110
|
-
default: () => ({ timeStyle: "medium", dateStyle: "short" })
|
|
111
|
-
},
|
|
112
|
-
/**
|
|
113
|
-
* Wether to display the timestamp as time from now (optional)
|
|
114
|
-
*
|
|
115
|
-
* - `false`: Disable relative time
|
|
116
|
-
* - `'long'`: Long text, like *2 seconds ago* (default)
|
|
117
|
-
* - `'short'`: Short text, like *2 sec. ago*
|
|
118
|
-
* - `'narrow'`: Even shorter text (same as `'short'` on some languages)
|
|
119
|
-
*/
|
|
120
|
-
relativeTime: {
|
|
121
|
-
type: [Boolean, String],
|
|
122
|
-
default: "long",
|
|
123
|
-
validator: (v) => v === false || ["long", "short", "narrow"].includes(v)
|
|
124
|
-
},
|
|
125
|
-
/**
|
|
126
|
-
* Ignore seconds when displaying the relative time and just show `a few seconds ago`
|
|
127
|
-
*/
|
|
128
|
-
ignoreSeconds: {
|
|
129
|
-
type: Boolean,
|
|
130
|
-
default: false
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
setup(props) {
|
|
134
|
-
const timestamp = Vue.computed(() => props.timestamp);
|
|
135
|
-
const { formattedTime, formattedFullTime } = useFormatDateTime(timestamp, props);
|
|
136
|
-
return {
|
|
137
|
-
formattedTime,
|
|
138
|
-
formattedFullTime
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
var _sfc_render = function render() {
|
|
143
|
-
var _vm = this, _c = _vm._self._c;
|
|
144
|
-
return _c("span", { staticClass: "nc-datetime", attrs: { "data-timestamp": _vm.timestamp, "title": _vm.formattedFullTime }, domProps: { "textContent": _vm._s(_vm.formattedTime) } });
|
|
145
|
-
};
|
|
146
|
-
var _sfc_staticRenderFns = [];
|
|
147
|
-
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
148
|
-
_sfc_main,
|
|
149
|
-
_sfc_render,
|
|
150
|
-
_sfc_staticRenderFns,
|
|
151
|
-
false,
|
|
152
|
-
null,
|
|
153
|
-
null
|
|
154
|
-
);
|
|
155
|
-
const NcDateTime = __component__.exports;
|
|
156
|
-
exports.NcDateTime = NcDateTime;
|
|
157
|
-
exports.useFormatDateTime = useFormatDateTime;
|
|
158
|
-
//# sourceMappingURL=NcDateTime-C-kLQayi.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NcDateTime-C-kLQayi.cjs","sources":["../../src/composables/useFormatDateTime.ts","../../src/components/NcDateTime/NcDateTime.vue"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCanonicalLocale, getLanguage } from '@nextcloud/l10n'\nimport { computed, onUnmounted, ref, onMounted, watch, unref, type Ref } from 'vue'\nimport { t } from '../l10n.js'\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\ninterface FormatDateOptions {\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\ntype MaybeRef<T> = T | Ref<T>\n\n/**\n * Composable for formatting time stamps using current users locale and language\n *\n * @param {Date | number | import('vue').Ref<Date> | import('vue').Ref<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 */\nexport function useFormatDateTime(\n\ttimestamp: MaybeRef<Date|number> = Date.now(),\n\topts: MaybeRef<FormatDateOptions> = {},\n) {\n\t// Current time as Date.now is not reactive\n\tconst currentTime = ref(Date.now())\n\t// The interval ID for the window\n\tlet intervalId: number|undefined\n\n\tconst options = ref({\n\t\tformat: {\n\t\t\ttimeStyle: 'medium',\n\t\t\tdateStyle: 'short',\n\t\t} as Intl.DateTimeFormatOptions,\n\t\trelativeTime: 'long' as const,\n\t\tignoreSeconds: false,\n\t\t...unref(opts),\n\t})\n\tconst wrappedOptions = computed<Required<FormatDateOptions>>(() => ({ ...unref(opts), ...options.value }))\n\n\t/** ECMA Date object of the timestamp */\n\tconst date = computed(() => new Date(unref(timestamp)))\n\n\tconst formattedFullTime = computed<string>(() => {\n\t\tconst formatter = new Intl.DateTimeFormat(getCanonicalLocale(), wrappedOptions.value.format)\n\t\treturn formatter.format(date.value)\n\t})\n\n\t/** Time string formatted for main text */\n\tconst formattedTime = computed<string>(() => {\n\t\tif (wrappedOptions.value.relativeTime !== false) {\n\t\t\tconst formatter = new Intl.RelativeTimeFormat(getLanguage(), { numeric: 'auto', style: wrappedOptions.value.relativeTime })\n\n\t\t\tconst diff = date.value.getTime() - currentTime.value\n\t\t\tconst seconds = diff / 1000\n\t\t\tif (Math.abs(seconds) < 59.5) {\n\t\t\t\tif (wrappedOptions.value.ignoreSeconds) {\n\t\t\t\t\treturn FEW_SECONDS_AGO[wrappedOptions.value.relativeTime]\n\t\t\t\t} else {\n\t\t\t\t\treturn formatter.format(Math.round(seconds), 'second')\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst minutes = seconds / 60\n\t\t\tif (Math.abs(minutes) <= 59) {\n\t\t\t\treturn formatter.format(Math.round(minutes), 'minute')\n\t\t\t}\n\t\t\tconst hours = minutes / 60\n\t\t\tif (Math.abs(hours) < 23.5) {\n\t\t\t\treturn formatter.format(Math.round(hours), 'hour')\n\t\t\t}\n\t\t\tconst days = hours / 24\n\t\t\tif (Math.abs(days) < 6.5) {\n\t\t\t\treturn formatter.format(Math.round(days), 'day')\n\t\t\t}\n\t\t\tif (Math.abs(days) < 27.5) {\n\t\t\t\tconst weeks = days / 7\n\t\t\t\treturn formatter.format(Math.round(weeks), 'week')\n\t\t\t}\n\t\t\tconst months = days / 30\n\t\t\tif (Math.abs(months) < 11.5) {\n\t\t\t\treturn formatter.format(Math.round(months), 'month')\n\t\t\t}\n\t\t\treturn formatter.format(Math.round(days / 365), 'year')\n\t\t}\n\t\treturn formattedFullTime.value\n\t})\n\n\t// Set or clear interval if relative time is dis/enabled\n\twatch([wrappedOptions], () => {\n\t\twindow.clearInterval(intervalId)\n\t\tintervalId = undefined\n\t\tif (wrappedOptions.value.relativeTime) {\n\t\t\tintervalId = window.setInterval(() => { currentTime.value = Date.now() }, 1000)\n\t\t}\n\t})\n\n\t// Start the interval for setting the current time if relative time is enabled\n\tonMounted(() => {\n\t\tif (wrappedOptions.value.relativeTime !== false) {\n\t\t\tintervalId = window.setInterval(() => { currentTime.value = Date.now() }, 1000)\n\t\t}\n\t})\n\n\t// ensure interval is cleared\n\tonUnmounted(() => {\n\t\twindow.clearInterval(intervalId)\n\t})\n\n\treturn {\n\t\tformattedTime,\n\t\tformattedFullTime,\n\t\toptions,\n\t}\n}\n","<!--\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### General description\n\nThis components purpose is to display a timestamp in the users local time format.\nIt also supports relative time, for examples *6 seconds ago*.\n\n#### Standard usage\n\nWithout any optional parameters the timestamp is displayed as a relative datetime and a title with the full date is added.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Ignore seconds\n\nIf you do not want the seconds to be counted up until minutes are reached you can simply use the `ignore-seconds` property.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" :ignore-seconds=\"true\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Custom date or time format\n\nThe component allows to format the full date for the title by settings the `format` property.\nIt is also possible to disable relative time by setting the `relativeTime` property to `false`.\n\n```vue\n<template>\n\t<div>\n\t\t<h4>Short relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" relative-time=\"short\" />\n\n\t\t<h4>Custom title format</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" />\n\n\t\t<h4>Without relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" :relative-time=\"false\" />\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t/** For allowed formats see the Intl.DateTimeFormat options */\n\t\t\t\ttimeFormat: {\n\t\t\t\t\tdateStyle: 'short',\n\t\t\t\t\ttimeStyle: 'full'\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style>\nh4 {\n\tfont-weight: bold;\n\tmargin-top: 12px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<span class=\"nc-datetime\"\n\t\t:data-timestamp=\"timestamp\"\n\t\t:title=\"formattedFullTime\"\n\t\tv-text=\"formattedTime\" />\n</template>\n\n<script>\nimport { computed } from 'vue'\nimport { useFormatDateTime } from '../../composables/useFormatDateTime.ts'\n\nexport default {\n\tname: 'NcDateTime',\n\n\tprops: {\n\t\t/**\n\t\t * The timestamp to display, either an unix timestamp (in milliseconds) or a Date object\n\t\t */\n\t\ttimestamp: {\n\t\t\ttype: [Date, Number],\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * The format used for displaying, or if relative time is used the format used for the title (optional)\n\t\t *\n\t\t * @type {Intl.DateTimeFormatOptions}\n\t\t */\n\t\tformat: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ timeStyle: 'medium', dateStyle: 'short' }),\n\t\t},\n\t\t/**\n\t\t * Wether to display the timestamp as time from now (optional)\n\t\t *\n\t\t * - `false`: Disable relative time\n\t\t * - `'long'`: Long text, like *2 seconds ago* (default)\n\t\t * - `'short'`: Short text, like *2 sec. ago*\n\t\t * - `'narrow'`: Even shorter text (same as `'short'` on some languages)\n\t\t */\n\t\trelativeTime: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: 'long',\n\t\t\tvalidator: (v) => v === false || ['long', 'short', 'narrow'].includes(v),\n\t\t},\n\t\t/**\n\t\t * Ignore seconds when displaying the relative time and just show `a few seconds ago`\n\t\t */\n\t\tignoreSeconds: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tsetup(props) {\n\t\tconst timestamp = computed(() => props.timestamp)\n\t\tconst { formattedTime, formattedFullTime } = useFormatDateTime(timestamp, props)\n\t\treturn {\n\t\t\tformattedTime,\n\t\t\tformattedFullTime,\n\t\t}\n\t},\n}\n</script>\n"],"names":["t","ref","unref","computed","getCanonicalLocale","getLanguage","watch","onMounted","onUnmounted"],"mappings":";;;;;;AASA,MAAM,kBAAkB;AAAA,EACvB,MAAMA,QAAE,mBAAmB;AAAA,EAC3B,OAAOA,QAAE,aAAa;AAAA;AAAA,EACtB,QAAQA,QAAE,UAAU;AAAA;AACrB;AA4BO,SAAS,kBACf,YAAmC,KAAK,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AA;AAAA,MACA,MAAA,CAAA,MAAA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,OAAA,EAAA,WAAA,UAAA,WAAA,QAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,cAAA;AAAA,MACA,MAAA,CAAA,SAAA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,MAAA,MAAA,SAAA,CAAA,QAAA,SAAA,QAAA,EAAA,SAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,MAAA,OAAA;AACA,UAAA,YAAAL,IAAAA,SAAA,MAAA,MAAA,SAAA;AACA,UAAA,EAAA,eAAA,kBAAA,IAAA,kBAAA,WAAA,KAAA;AACA,WAAA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NcPasswordField-BCzIotoB.cjs","sources":["../../node_modules/vue-material-design-icons/Eye.vue","../../node_modules/vue-material-design-icons/EyeOff.vue","../../src/components/NcPasswordField/NcPasswordField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-off-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeOffIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose password field component.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcPasswordField v-model=\"text1\"\n\t\t\tlabel=\"Old password\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">New password</label>\n\t\t\t<NcPasswordField id=\"textField\"\n\t\t\t\tv-model=\"text2\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\" />\n\t\t</div>\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField2\">New password</label>\n\t\t\t<NcPasswordField id=\"textField2\"\n\t\t\t\tv-model=\"text3\"\n\t\t\t\t:error=\"true\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\thelper-text=\"Password is insecure\" />\n\t\t</div>\n\n\t\t<NcPasswordField v-model=\"text4\"\n\t\t\tlabel=\"Good new password\"\n\t\t\t:success=\"true\"\n\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\thelper-text=\"Password is secure\" />\n\n\t\t<NcPasswordField v-model=\"text5\"\n\t\t\t:disabled=\"true\"\n\t\t\tlabel=\"Disabled\" />\n\n\t\t<NcPasswordField v-model=\"text6\"\n\t\t\tlabel=\"Secret token\"\n\t\t\tas-text />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: 'hunter',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t\ttext6: 'secret-token',\n\t\t}\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\t:type=\"isPasswordHidden && !asText ? 'password' : 'text'\"\n\t\t:trailing-button-label=\"trailingButtonLabelPassword\"\n\t\t:helper-text=\"computedHelperText\"\n\t\t:error=\"computedError\"\n\t\t:success=\"computedSuccess\"\n\t\t:minlength=\"rules.minlength\"\n\t\t:input-class=\"{ 'password-field__input--secure-text': isPasswordHidden && asText }\"\n\t\tv-on=\"$listeners\"\n\t\t@trailing-button-click=\"togglePasswordVisibility\"\n\t\t@input=\"handleInput\">\n\t\t<template v-if=\"!!$scopedSlots.icon || !!$slots.default || !!$scopedSlots.default\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- @slot Deprecated, removed in v9: use #icon slot instead. -->\n\t\t\t\t<slot />\n\t\t\t</slot>\n\t\t</template>\n\n\t\t<template #trailing-button-icon>\n\t\t\t<Eye v-if=\"isPasswordHidden\" :size=\"18\" />\n\t\t\t<EyeOff v-else :size=\"18\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { loadState } from '@nextcloud/initial-state'\nimport axios from '@nextcloud/axios'\nimport debounce from 'debounce'\n\nimport Eye from 'vue-material-design-icons/Eye.vue'\nimport EyeOff from 'vue-material-design-icons/EyeOff.vue'\n\nimport { logger } from '../../utils/logger.ts'\nimport { t } from '../../l10n.js'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\n/**\n * @typedef PasswordPolicy\n * @property {object} api - The URLs to the password_policy app methods\n * @property {string} api.generate - The URL to the password generator\n * @property {string} api.validate - The URL to the password validator\n * @property {boolean} enforceNonCommonPassword - Whether to enforce non common passwords\n * @property {boolean} enforceNumericCharacters - Whether to enforce numeric characters\n * @property {boolean} enforceSpecialCharacters - Whether to enforce special characters\n * @property {boolean} enforceUpperLowerCase - Whether to enforce upper and lower case\n * @property {number} minLength - The minimum length of the password\n */\n\n/** @type {PasswordPolicy|null} */\nconst passwordPolicy = loadState('core', 'capabilities', {}).password_policy || null\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcPasswordField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tEye,\n\t\tEyeOff,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t// Redefined props\n\n\t\t/**\n\t\t * Controls whether to display the trailing button.\n\t\t */\n\t\t showTrailingButton: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t// Removed NcInputField props, defined only by this component\n\n\t\ttrailingButtonLabel: undefined,\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Check if the user entered a valid password using the password_policy\n\t\t * app if available.\n\t\t *\n\t\t * Warning: this doesn't replace server side checking and will do nothing\n\t\t * if the password_policy app is disabled.\n\t\t */\n\t\tcheckPasswordStrength: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The minlength property defines the minimum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tminlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * The maxlength property defines the maximum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tmaxlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Render as input[type=text] that looks like password field.\n\t\t * Allows to avoid unwanted password-specific browser behavior,\n\t\t * such as save or generate password prompt.\n\t\t * Useful for secret token fields.\n\t\t * Note: autocomplete=\"off\" is ignored by browsers.\n\t\t */\n\t\tasText: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'valid',\n\t\t'invalid',\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'update:value',\n\t\t/**\n\t\t * Triggers when the value inside the password field is\n\t\t * updated.\n\t\t *\n\t\t * @property {string} The new value\n\t\t */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t],\n\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'update:value')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tisPasswordHidden: true,\n\t\t\tinternalHelpMessage: '',\n\t\t\tisValid: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcomputedError() {\n\t\t\treturn this.error || this.isValid === false\n\t\t},\n\t\tcomputedSuccess() {\n\t\t\treturn this.success || this.isValid === true\n\t\t},\n\t\tcomputedHelperText() {\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\treturn this.helperText\n\t\t\t}\n\t\t\treturn this.internalHelpMessage\n\t\t},\n\n\t\trules() {\n\t\t\tconst { minlength } = this\n\t\t\treturn {\n\t\t\t\tminlength: minlength ?? passwordPolicy?.minLength,\n\t\t\t}\n\t\t},\n\n\t\ttrailingButtonLabelPassword() {\n\t\t\treturn this.isPasswordHidden ? t('Show password') : t('Hide password')\n\t\t},\n\n\t\tpropsAndAttrsToForward() {\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\tObject.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)),\n\t\t\t\t),\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodel(newValue) {\n\t\t\tif (this.checkPasswordStrength) {\n\t\t\t\tif (passwordPolicy === null) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.checkPassword(newValue)\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.model = event.target.value\n\t\t},\n\t\ttogglePasswordVisibility() {\n\t\t\tthis.isPasswordHidden = !this.isPasswordHidden\n\t\t},\n\t\tcheckPassword: debounce(async function(password) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.post(generateOcsUrl('apps/password_policy/api/v1/validate'), { password })\n\t\t\t\tthis.isValid = data.ocs.data.passed\n\t\t\t\tif (data.ocs.data.passed) {\n\t\t\t\t\tthis.internalHelpMessage = t('Password is secure')\n\t\t\t\t\t/**\n\t\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t\t * password entered is valid.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('valid')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.internalHelpMessage = data.ocs.data.reason\n\t\t\t\t/**\n\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t * password entered is invalid.\n\t\t\t\t */\n\t\t\t\tthis.$emit('invalid')\n\t\t\t} catch (e) {\n\t\t\t\tlogger.error('Password policy returned an error', e)\n\t\t\t}\n\t\t}, 500),\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n:deep(.password-field__input--secure-text) {\n\t// Emulate password field look\n\t// This is not a part of the standard but well supported\n\t-webkit-text-security: disc;\n}\n</style>\n"],"names":["_sfc_main","loadState","NcInputField","useModelMigration","t","debounce","axios","generateOcsUrl","logger"],"mappings":";;;;;;;;;;;;;AAoBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;AChBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;ACwGA,MAAA,iBAAAC,aAAA,UAAA,QAAA,gBAAA,CAAA,CAAA,EAAA,mBAAA;AAEA,MAAA,oBAAA,IAAA,IAAA,OAAA,KAAAC,aAAAA,aAAA,KAAA,CAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAA,aAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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SAAA,GAAA;AACAI,sBAAA,MAAA,qCAAA,CAAA;AAAA,MACA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NcPasswordField-CTKHRVC4.mjs","sources":["../../node_modules/vue-material-design-icons/Eye.vue","../../node_modules/vue-material-design-icons/EyeOff.vue","../../src/components/NcPasswordField/NcPasswordField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-off-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeOffIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose password field component.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcPasswordField v-model=\"text1\"\n\t\t\tlabel=\"Old password\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">New password</label>\n\t\t\t<NcPasswordField id=\"textField\"\n\t\t\t\tv-model=\"text2\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\" />\n\t\t</div>\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField2\">New password</label>\n\t\t\t<NcPasswordField id=\"textField2\"\n\t\t\t\tv-model=\"text3\"\n\t\t\t\t:error=\"true\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\thelper-text=\"Password is insecure\" />\n\t\t</div>\n\n\t\t<NcPasswordField v-model=\"text4\"\n\t\t\tlabel=\"Good new password\"\n\t\t\t:success=\"true\"\n\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\thelper-text=\"Password is secure\" />\n\n\t\t<NcPasswordField v-model=\"text5\"\n\t\t\t:disabled=\"true\"\n\t\t\tlabel=\"Disabled\" />\n\n\t\t<NcPasswordField v-model=\"text6\"\n\t\t\tlabel=\"Secret token\"\n\t\t\tas-text />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: 'hunter',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t\ttext6: 'secret-token',\n\t\t}\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\t:type=\"isPasswordHidden && !asText ? 'password' : 'text'\"\n\t\t:trailing-button-label=\"trailingButtonLabelPassword\"\n\t\t:helper-text=\"computedHelperText\"\n\t\t:error=\"computedError\"\n\t\t:success=\"computedSuccess\"\n\t\t:minlength=\"rules.minlength\"\n\t\t:input-class=\"{ 'password-field__input--secure-text': isPasswordHidden && asText }\"\n\t\tv-on=\"$listeners\"\n\t\t@trailing-button-click=\"togglePasswordVisibility\"\n\t\t@input=\"handleInput\">\n\t\t<template v-if=\"!!$scopedSlots.icon || !!$slots.default || !!$scopedSlots.default\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- @slot Deprecated, removed in v9: use #icon slot instead. -->\n\t\t\t\t<slot />\n\t\t\t</slot>\n\t\t</template>\n\n\t\t<template #trailing-button-icon>\n\t\t\t<Eye v-if=\"isPasswordHidden\" :size=\"18\" />\n\t\t\t<EyeOff v-else :size=\"18\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { loadState } from '@nextcloud/initial-state'\nimport axios from '@nextcloud/axios'\nimport debounce from 'debounce'\n\nimport Eye from 'vue-material-design-icons/Eye.vue'\nimport EyeOff from 'vue-material-design-icons/EyeOff.vue'\n\nimport { logger } from '../../utils/logger.ts'\nimport { t } from '../../l10n.js'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\n/**\n * @typedef PasswordPolicy\n * @property {object} api - The URLs to the password_policy app methods\n * @property {string} api.generate - The URL to the password generator\n * @property {string} api.validate - The URL to the password validator\n * @property {boolean} enforceNonCommonPassword - Whether to enforce non common passwords\n * @property {boolean} enforceNumericCharacters - Whether to enforce numeric characters\n * @property {boolean} enforceSpecialCharacters - Whether to enforce special characters\n * @property {boolean} enforceUpperLowerCase - Whether to enforce upper and lower case\n * @property {number} minLength - The minimum length of the password\n */\n\n/** @type {PasswordPolicy|null} */\nconst passwordPolicy = loadState('core', 'capabilities', {}).password_policy || null\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcPasswordField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tEye,\n\t\tEyeOff,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t// Redefined props\n\n\t\t/**\n\t\t * Controls whether to display the trailing button.\n\t\t */\n\t\t showTrailingButton: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t// Removed NcInputField props, defined only by this component\n\n\t\ttrailingButtonLabel: undefined,\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Check if the user entered a valid password using the password_policy\n\t\t * app if available.\n\t\t *\n\t\t * Warning: this doesn't replace server side checking and will do nothing\n\t\t * if the password_policy app is disabled.\n\t\t */\n\t\tcheckPasswordStrength: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The minlength property defines the minimum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tminlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * The maxlength property defines the maximum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tmaxlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Render as input[type=text] that looks like password field.\n\t\t * Allows to avoid unwanted password-specific browser behavior,\n\t\t * such as save or generate password prompt.\n\t\t * Useful for secret token fields.\n\t\t * Note: autocomplete=\"off\" is ignored by browsers.\n\t\t */\n\t\tasText: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'valid',\n\t\t'invalid',\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'update:value',\n\t\t/**\n\t\t * Triggers when the value inside the password field is\n\t\t * updated.\n\t\t *\n\t\t * @property {string} The new value\n\t\t */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t],\n\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'update:value')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tisPasswordHidden: true,\n\t\t\tinternalHelpMessage: '',\n\t\t\tisValid: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcomputedError() {\n\t\t\treturn this.error || this.isValid === false\n\t\t},\n\t\tcomputedSuccess() {\n\t\t\treturn this.success || this.isValid === true\n\t\t},\n\t\tcomputedHelperText() {\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\treturn this.helperText\n\t\t\t}\n\t\t\treturn this.internalHelpMessage\n\t\t},\n\n\t\trules() {\n\t\t\tconst { minlength } = this\n\t\t\treturn {\n\t\t\t\tminlength: minlength ?? passwordPolicy?.minLength,\n\t\t\t}\n\t\t},\n\n\t\ttrailingButtonLabelPassword() {\n\t\t\treturn this.isPasswordHidden ? t('Show password') : t('Hide password')\n\t\t},\n\n\t\tpropsAndAttrsToForward() {\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\tObject.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)),\n\t\t\t\t),\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodel(newValue) {\n\t\t\tif (this.checkPasswordStrength) {\n\t\t\t\tif (passwordPolicy === null) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.checkPassword(newValue)\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.model = event.target.value\n\t\t},\n\t\ttogglePasswordVisibility() {\n\t\t\tthis.isPasswordHidden = !this.isPasswordHidden\n\t\t},\n\t\tcheckPassword: debounce(async function(password) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.post(generateOcsUrl('apps/password_policy/api/v1/validate'), { password })\n\t\t\t\tthis.isValid = data.ocs.data.passed\n\t\t\t\tif (data.ocs.data.passed) {\n\t\t\t\t\tthis.internalHelpMessage = t('Password is secure')\n\t\t\t\t\t/**\n\t\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t\t * password entered is valid.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('valid')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.internalHelpMessage = data.ocs.data.reason\n\t\t\t\t/**\n\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t * password entered is invalid.\n\t\t\t\t */\n\t\t\t\tthis.$emit('invalid')\n\t\t\t} catch (e) {\n\t\t\t\tlogger.error('Password policy returned an error', e)\n\t\t\t}\n\t\t}, 500),\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n:deep(.password-field__input--secure-text) {\n\t// Emulate password field look\n\t// This is not a part of the standard but well supported\n\t-webkit-text-security: disc;\n}\n</style>\n"],"names":["_sfc_main"],"mappings":";;;;;;;;;AAoBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;AChBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,O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AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAA,OAAA;AACA,WAAA,QAAA,MAAA,OAAA;AAAA,IACA;AAAA,IACA,2BAAA;AACA,WAAA,mBAAA,CAAA,KAAA;AAAA,IACA;AAAA,IACA,eAAA,SAAA,eAAA,UAAA;AACA,UAAA;AACA,cAAA,EAAA,KAAA,IAAA,MAAA,MAAA,KAAA,eAAA,sCAAA,GAAA,EAAA,SAAA,CAAA;AACA,aAAA,UAAA,KAAA,IAAA,KAAA;AACA,YAAA,KAAA,IAAA,KAAA,QAAA;AACA,eAAA,sBAAA,EAAA,oBAAA;AAKA,eAAA,MAAA,OAAA;AACA;AAAA,QACA;AAEA,aAAA,sBAAA,KAAA,IAAA,KAAA;AAKA,aAAA,MAAA,SAAA;AAAA,MACA,SAAA,GAAA;AACA,eAAA,MAAA,qCAAA,CAAA;AAAA,MACA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NcTextField-DRANdaIf.mjs","sources":["../../node_modules/vue-material-design-icons/UndoVariant.vue","../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon undo-variant-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UndoVariantIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField v-model=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<template #icon>\n\t\t\t\t<Magnify :size=\"20\" />\n\t\t\t</template>\n\t\t</NcTextField>\n\t\t<NcTextField v-model=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<template #icon>\n\t\t\t\t<Lock :size=\"20\" />\n\t\t\t</template>\n\t\t</NcTextField>\n\t\t<NcTextField v-model=\"text2\"\n\t\t\tlabel=\"With helper text\"\n\t\t\thelper-text=\"This is an optional message to show e.g. validation errors.\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField v-model=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField v-model=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:value=\"text1\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:value=\"text2\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField v-model=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\tv-on=\"$listeners\">\n\t\t<template v-if=\"!!$scopedSlots.icon || !!$slots.default || !!$scopedSlots.default\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- @slot Deprecated, removed in v9: use #icon slot instead. -->\n\t\t\t\t<slot />\n\t\t\t</slot>\n\t\t</template>\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t/**\n\t\t * The `aria-label` to set on the trailing button\n\t\t * If no explicit value is set it will default to the one matching the `trailingButtonIcon`:\n\t\t * @default 'Clear text'|'Save changes'|'Undo changes'\n\t\t */\n\t\ttrailingButtonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Specifies which material design icon should be used for the trailing\n\t\t * button.\n\t\t * @type {'close'|'arrowRight'|'undo'}\n\t\t */\n\t\ttrailingButtonIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'close',\n\t\t\tvalidator: (value) => [\n\t\t\t\t'close',\n\t\t\t\t'arrowRight',\n\t\t\t\t'undo',\n\t\t\t].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'update:value',\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t],\n\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'update:value')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tpropsAndAttrsToForward() {\n\t\t\tconst predefinedLabels = {\n\t\t\t\tundo: t('Undo changes'),\n\t\t\t\tclose: t('Clear text'),\n\t\t\t\tarrowRight: t('Save changes'),\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\tObject.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)),\n\t\t\t\t),\n\t\t\t\t// Adjust aria-label for predefined trailing buttons\n\t\t\t\ttrailingButtonLabel: this.trailingButtonLabel || predefinedLabels[this.trailingButtonIcon],\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\t},\n}\n</script>\n"],"names":["_sfc_main"],"mappings":";;;;;;AAoBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;AC0HA,MAAA,oBAAA,IAAA,IAAA,OAAA,KAAA,aAAA,KAAA,CAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KAAA,CAAA;AAAA;AAAA,IAGA,GAAA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,UAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACA,EAAA,SAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,EACA;AAAA,EAEA,QAAA;AACA,UAAA,QAAA,kBAAA,SAAA,cAAA;AACA,WAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,yBAAA;AACA,YAAA,mBAAA;AAAA,QACA,MAAA,EAAA,cAAA;AAAA,QACA,OAAA,EAAA,YAAA;AAAA,QACA,YAAA,EAAA,cAAA;AAAA,MACA;AAEA,aAAA;AAAA;AAAA,QAEA,GAAA,KAAA;AAAA;AAAA,QAEA,GAAA,OAAA;AAAA,UACA,OAAA,QAAA,KAAA,MAAA,EAAA,OAAA,CAAA,CAAA,GAAA,MAAA,kBAAA,IAAA,GAAA,CAAA;AAAA,QACA;AAAA;AAAA,QAEA,qBAAA,KAAA,uBAAA,iBAAA,KAAA,kBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,WAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NcTextField-Uk5iD8o2.cjs","sources":["../../node_modules/vue-material-design-icons/UndoVariant.vue","../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon undo-variant-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UndoVariantIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField v-model=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<template #icon>\n\t\t\t\t<Magnify :size=\"20\" />\n\t\t\t</template>\n\t\t</NcTextField>\n\t\t<NcTextField v-model=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<template #icon>\n\t\t\t\t<Lock :size=\"20\" />\n\t\t\t</template>\n\t\t</NcTextField>\n\t\t<NcTextField v-model=\"text2\"\n\t\t\tlabel=\"With helper text\"\n\t\t\thelper-text=\"This is an optional message to show e.g. validation errors.\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField v-model=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField v-model=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:value=\"text1\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:value=\"text2\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField v-model=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\tv-on=\"$listeners\">\n\t\t<template v-if=\"!!$scopedSlots.icon || !!$slots.default || !!$scopedSlots.default\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- @slot Deprecated, removed in v9: use #icon slot instead. -->\n\t\t\t\t<slot />\n\t\t\t</slot>\n\t\t</template>\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t/**\n\t\t * The `aria-label` to set on the trailing button\n\t\t * If no explicit value is set it will default to the one matching the `trailingButtonIcon`:\n\t\t * @default 'Clear text'|'Save changes'|'Undo changes'\n\t\t */\n\t\ttrailingButtonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Specifies which material design icon should be used for the trailing\n\t\t * button.\n\t\t * @type {'close'|'arrowRight'|'undo'}\n\t\t */\n\t\ttrailingButtonIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'close',\n\t\t\tvalidator: (value) => [\n\t\t\t\t'close',\n\t\t\t\t'arrowRight',\n\t\t\t\t'undo',\n\t\t\t].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'update:value',\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t],\n\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'update:value')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tpropsAndAttrsToForward() {\n\t\t\tconst predefinedLabels = {\n\t\t\t\tundo: t('Undo changes'),\n\t\t\t\tclose: t('Clear text'),\n\t\t\t\tarrowRight: t('Save changes'),\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\tObject.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)),\n\t\t\t\t),\n\t\t\t\t// Adjust aria-label for predefined trailing buttons\n\t\t\t\ttrailingButtonLabel: this.trailingButtonLabel || predefinedLabels[this.trailingButtonIcon],\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\t},\n}\n</script>\n"],"names":["_sfc_main","NcInputField","Close","ArrowRight","useModelMigration","t"],"mappings":";;;;;;;AAoBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;AC0HA,MAAA,oBAAA,IAAA,IAAA,OAAA,KAAAC,aAAAA,aAAA,KAAA,CAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAA,aAAA;AAAA,IACA,OAAAC,MAAA;AAAA,IACA,YAAAC,WAAA;AAAA,IACA;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KAAA,CAAA;AAAA;AAAA,IAGA,GAAAF,aAAA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,UAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACA,EAAA,SAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,EACA;AAAA,EAEA,QAAA;AACA,UAAA,QAAAG,oCAAA,SAAA,cAAA;AACA,WAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,yBAAA;AACA,YAAA,mBAAA;AAAA,QACA,MAAAC,MAAA,EAAA,cAAA;AAAA,QACA,OAAAA,MAAA,EAAA,YAAA;AAAA,QACA,YAAAA,MAAA,EAAA,cAAA;AAAA,MACA;AAEA,aAAA;AAAA;AAAA,QAEA,GAAA,KAAA;AAAA;AAAA,QAEA,GAAA,OAAA;AAAA,UACA,OAAA,QAAA,KAAA,MAAA,EAAA,OAAA,CAAA,CAAA,GAAA,MAAA,kBAAA,IAAA,GAAA,CAAA;AAAA,QACA;AAAA;AAAA,QAEA,qBAAA,KAAA,uBAAA,iBAAA,KAAA,kBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,WAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_l10n-Dt0m9Fxw.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var mdiChevronLeft = "M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z";
|
|
2
|
-
var mdiChevronRight = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";
|
|
3
|
-
var mdiClose = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";
|
|
4
|
-
export {
|
|
5
|
-
mdiChevronRight as a,
|
|
6
|
-
mdiChevronLeft as b,
|
|
7
|
-
mdiClose as m
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=mdi-CZJxQPz6.mjs.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var mdiChevronLeft = "M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z";
|
|
3
|
-
var mdiChevronRight = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";
|
|
4
|
-
var mdiClose = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";
|
|
5
|
-
exports.mdiChevronLeft = mdiChevronLeft;
|
|
6
|
-
exports.mdiChevronRight = mdiChevronRight;
|
|
7
|
-
exports.mdiClose = mdiClose;
|
|
8
|
-
//# sourceMappingURL=mdi-Da9VuUVq.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rtl-DLuwcTlm.cjs","sources":["../../src/utils/rtl.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { isRTL } from '@nextcloud/l10n'\n\nexport const isRtl = isRTL()\n"],"names":["isRTL"],"mappings":";;AAOO,MAAM,QAAQA,KAAM,MAAA;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rtl-v0UOPAM7.mjs","sources":["../../src/utils/rtl.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { isRTL } from '@nextcloud/l10n'\n\nexport const isRtl = isRTL()\n"],"names":[],"mappings":";AAOO,MAAM,QAAQ,MAAM;"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
interface FormatDateOptions {
|
|
3
|
-
/**
|
|
4
|
-
* The format used for displaying, or if relative time is used the format used for the title
|
|
5
|
-
*/
|
|
6
|
-
format?: Intl.DateTimeFormatOptions;
|
|
7
|
-
/**
|
|
8
|
-
* Ignore seconds when displaying the relative time and just show `a few seconds ago`
|
|
9
|
-
*/
|
|
10
|
-
ignoreSeconds?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Wether to display the timestamp as time from now
|
|
13
|
-
*/
|
|
14
|
-
relativeTime?: false | 'long' | 'short' | 'narrow';
|
|
15
|
-
}
|
|
16
|
-
type MaybeRef<T> = T | Ref<T>;
|
|
17
|
-
/**
|
|
18
|
-
* Composable for formatting time stamps using current users locale and language
|
|
19
|
-
*
|
|
20
|
-
* @param {Date | number | import('vue').Ref<Date> | import('vue').Ref<number>} timestamp Current timestamp
|
|
21
|
-
* @param {object} opts Optional options
|
|
22
|
-
* @param {Intl.DateTimeFormatOptions} opts.format The format used for displaying, or if relative time is used the format used for the title (optional)
|
|
23
|
-
* @param {boolean} opts.ignoreSeconds Ignore seconds when displaying the relative time and just show `a few seconds ago`
|
|
24
|
-
* @param {false | 'long' | 'short' | 'narrow'} opts.relativeTime Wether to display the timestamp as time from now (optional)
|
|
25
|
-
*/
|
|
26
|
-
export declare function useFormatDateTime(timestamp?: MaybeRef<Date | number>, opts?: MaybeRef<FormatDateOptions>): {
|
|
27
|
-
formattedTime: import('vue').ComputedRef<string>;
|
|
28
|
-
formattedFullTime: import('vue').ComputedRef<string>;
|
|
29
|
-
options: Ref<{
|
|
30
|
-
format: {
|
|
31
|
-
localeMatcher?: "best fit" | "lookup" | undefined | undefined;
|
|
32
|
-
weekday?: "long" | "short" | "narrow" | undefined | undefined;
|
|
33
|
-
era?: "long" | "short" | "narrow" | undefined | undefined;
|
|
34
|
-
year?: "numeric" | "2-digit" | undefined | undefined;
|
|
35
|
-
month?: "numeric" | "2-digit" | "long" | "short" | "narrow" | undefined | undefined;
|
|
36
|
-
day?: "numeric" | "2-digit" | undefined | undefined;
|
|
37
|
-
hour?: "numeric" | "2-digit" | undefined | undefined;
|
|
38
|
-
minute?: "numeric" | "2-digit" | undefined | undefined;
|
|
39
|
-
second?: "numeric" | "2-digit" | undefined | undefined;
|
|
40
|
-
timeZoneName?: "short" | "long" | "shortOffset" | "longOffset" | "shortGeneric" | "longGeneric" | undefined | undefined;
|
|
41
|
-
formatMatcher?: "best fit" | "basic" | undefined | undefined;
|
|
42
|
-
hour12?: boolean | undefined | undefined;
|
|
43
|
-
timeZone?: string | undefined | undefined;
|
|
44
|
-
calendar?: string | undefined | undefined;
|
|
45
|
-
dayPeriod?: "narrow" | "short" | "long" | undefined | undefined;
|
|
46
|
-
numberingSystem?: string | undefined | undefined;
|
|
47
|
-
dateStyle?: "full" | "long" | "medium" | "short" | undefined | undefined;
|
|
48
|
-
timeStyle?: "full" | "long" | "medium" | "short" | undefined | undefined;
|
|
49
|
-
hourCycle?: "h11" | "h12" | "h23" | "h24" | undefined | undefined;
|
|
50
|
-
fractionalSecondDigits?: 1 | 2 | 3 | undefined | undefined;
|
|
51
|
-
};
|
|
52
|
-
ignoreSeconds: boolean;
|
|
53
|
-
relativeTime: false | "long" | "short" | "narrow";
|
|
54
|
-
}>;
|
|
55
|
-
};
|
|
56
|
-
export {};
|