@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcChip.cjs","sources":["../../src/components/NcChip/NcChip.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<docs>\n### Basic usage\n\n```vue\n<template>\n\t<div style=\"display: flex; gap: 8px; flex-wrap: wrap;\">\n\t\t<NcChip text=\"Notes.txt\" />\n\t\t<NcChip text=\"Files\" :icon-path=\"mdiFile\" />\n\t\t<NcChip text=\"Color\" :icon-path=\"mdiPalette\" variant=\"tertiary\" />\n\t\t<NcChip text=\"Current time\" :icon-path=\"mdiClock\" no-close variant=\"primary\" />\n\t</div>\n</template>\n<script>\nimport { mdiClock, mdiFile, mdiPalette } from '@mdi/js'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmdiClock,\n\t\t\tmdiFile,\n\t\t\tmdiPalette,\n\t\t}\n\t}\n}\n</script>\n```\n\n### Advanced usage\n\nIt is also possible to use custom components for the icon by using the `icon` slot.\nIn this example we are using the `NcAvatar` component to render the users avatar as the icon.\n\n*Hint: If you use round icons like avatars you should set their size to `24px` (or use CSS variable `--chip-size`) to make them fully fill and align with the the chip*\n\nAlso it is possible to pass custom actions.\n\n```vue\n<template>\n\t<NcChip>\n\t\t<!-- The icon slot allow to use custom components as the chip icon -->\n\t\t<template #icon>\n\t\t\t<NcAvatar :size=\"24\" user=\"jdoe\" display-name=\"J. Doe\" />\n\t\t</template>\n\t\t<!-- The actions slot allows to add custom actions -->\n\t\t<template #actions>\n\t\t\t<NcActionButton>\n\t\t\t\t<template #icon>\n\t\t\t\t\t<ContactsIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd to contacts\n\t\t\t</NcActionButton>\n\t\t</template>\n\t\t<!-- The default slot can be used for add content, just like the `text` prop -->\n\t\tJ. Doe\n\t</NcChip>\n</template>\n<script>\nimport ContactsIcon from 'vue-material-design-icons/Contacts.vue'\nexport default {\n\tcomponents: {\n\t\tContactsIcon,\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"nc-chip\"\n\t\t:class=\"{\n\t\t\t[`nc-chip--${realVariant}`]: true,\n\t\t\t'nc-chip--no-actions': noClose && !hasActions(),\n\t\t\t'nc-chip--no-icon': !hasIcon(),\n\t\t}\">\n\t\t<span v-if=\"hasIcon()\" class=\"nc-chip__icon\">\n\t\t\t<!-- @slot The icon slot can be used to set the chip icon. Make sure that the icon is not exceeding a height of `24px`. For round icons a exact size of `24px` is recommended. -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- The default icon wrapper uses a size of 18px to ensure the icon is not clipped by the round chip style -->\n\t\t\t\t<NcIconSvgWrapper v-if=\"iconPath || iconSvg\"\n\t\t\t\t\tinline\n\t\t\t\t\t:path=\"iconPath\"\n\t\t\t\t\t:svg=\"iconPath ? undefined : iconSvg\"\n\t\t\t\t\t:size=\"18\" />\n\t\t\t</slot>\n\t\t</span>\n\t\t<span class=\"nc-chip__text\">\n\t\t\t<!-- @slot The default slot can be used to set the text that is shown -->\n\t\t\t<slot>{{ text }}</slot>\n\t\t</span>\n\t\t<NcActions v-if=\"canClose || hasActions()\"\n\t\t\tclass=\"nc-chip__actions\"\n\t\t\t:force-menu=\"!canClose\"\n\t\t\tvariant=\"tertiary-no-background\">\n\t\t\t<NcActionButton v-if=\"canClose\"\n\t\t\t\tclose-after-click\n\t\t\t\t@click=\"onClose\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ ariaLabelClose }}\n\t\t\t</NcActionButton>\n\t\t\t<!-- @slot The actions slot can be used to add custom actions to the chips actions -->\n\t\t\t<slot name=\"actions\" />\n\t\t</NcActions>\n\t</div>\n</template>\n\n<script setup>\nimport { mdiClose } from '@mdi/js'\nimport { computed, useSlots } from 'vue'\nimport { t } from '../../l10n.js'\n\nimport NcActions from '../NcActions/NcActions.vue'\nimport NcActionButton from '../NcActionButton/NcActionButton.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\n\nconst props = defineProps({\n\t/**\n\t * aria label to set on the close button\n\t * @default 'Close'\n\t */\n\tariaLabelClose: {\n\t\ttype: String,\n\t\tdefault: t('Close'),\n\t},\n\n\t/**\n\t * Main text of the chip
|
|
1
|
+
{"version":3,"file":"NcChip.cjs","sources":["../../src/components/NcChip/NcChip.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<docs>\n### Basic usage\n\n```vue\n<template>\n\t<div style=\"display: flex; gap: 8px; flex-wrap: wrap;\">\n\t\t<NcChip text=\"Notes.txt\" />\n\t\t<NcChip text=\"Files\" :icon-path=\"mdiFile\" />\n\t\t<NcChip text=\"Color\" :icon-path=\"mdiPalette\" variant=\"tertiary\" />\n\t\t<NcChip text=\"Current time\" :icon-path=\"mdiClock\" no-close variant=\"primary\" />\n\t</div>\n</template>\n<script>\nimport { mdiClock, mdiFile, mdiPalette } from '@mdi/js'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmdiClock,\n\t\t\tmdiFile,\n\t\t\tmdiPalette,\n\t\t}\n\t}\n}\n</script>\n```\n\n### Advanced usage\n\nIt is also possible to use custom components for the icon by using the `icon` slot.\nIn this example we are using the `NcAvatar` component to render the users avatar as the icon.\n\n*Hint: If you use round icons like avatars you should set their size to `24px` (or use CSS variable `--chip-size`) to make them fully fill and align with the the chip*\n\nAlso it is possible to pass custom actions.\n\n```vue\n<template>\n\t<NcChip>\n\t\t<!-- The icon slot allow to use custom components as the chip icon -->\n\t\t<template #icon>\n\t\t\t<NcAvatar :size=\"24\" user=\"jdoe\" display-name=\"J. Doe\" />\n\t\t</template>\n\t\t<!-- The actions slot allows to add custom actions -->\n\t\t<template #actions>\n\t\t\t<NcActionButton>\n\t\t\t\t<template #icon>\n\t\t\t\t\t<ContactsIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd to contacts\n\t\t\t</NcActionButton>\n\t\t</template>\n\t\t<!-- The default slot can be used for add content, just like the `text` prop -->\n\t\tJ. Doe\n\t</NcChip>\n</template>\n<script>\nimport ContactsIcon from 'vue-material-design-icons/Contacts.vue'\nexport default {\n\tcomponents: {\n\t\tContactsIcon,\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"nc-chip\"\n\t\t:class=\"{\n\t\t\t[`nc-chip--${realVariant}`]: true,\n\t\t\t'nc-chip--no-actions': noClose && !hasActions(),\n\t\t\t'nc-chip--no-icon': !hasIcon(),\n\t\t}\">\n\t\t<span v-if=\"hasIcon()\" class=\"nc-chip__icon\">\n\t\t\t<!-- @slot The icon slot can be used to set the chip icon. Make sure that the icon is not exceeding a height of `24px`. For round icons a exact size of `24px` is recommended. -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- The default icon wrapper uses a size of 18px to ensure the icon is not clipped by the round chip style -->\n\t\t\t\t<NcIconSvgWrapper v-if=\"iconPath || iconSvg\"\n\t\t\t\t\tinline\n\t\t\t\t\t:path=\"iconPath\"\n\t\t\t\t\t:svg=\"iconPath ? undefined : iconSvg\"\n\t\t\t\t\t:size=\"18\" />\n\t\t\t</slot>\n\t\t</span>\n\t\t<span class=\"nc-chip__text\">\n\t\t\t<!-- @slot The default slot can be used to set the text that is shown -->\n\t\t\t<slot>{{ text }}</slot>\n\t\t</span>\n\t\t<NcActions v-if=\"canClose || hasActions()\"\n\t\t\tclass=\"nc-chip__actions\"\n\t\t\t:container=\"actionsContainer\"\n\t\t\t:force-menu=\"!canClose\"\n\t\t\tvariant=\"tertiary-no-background\">\n\t\t\t<NcActionButton v-if=\"canClose\"\n\t\t\t\tclose-after-click\n\t\t\t\t@click=\"onClose\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ ariaLabelClose }}\n\t\t\t</NcActionButton>\n\t\t\t<!-- @slot The actions slot can be used to add custom actions to the chips actions -->\n\t\t\t<slot name=\"actions\" />\n\t\t</NcActions>\n\t</div>\n</template>\n\n<script setup>\nimport { mdiClose } from '@mdi/js'\nimport { computed, useSlots } from 'vue'\nimport { t } from '../../l10n.js'\n\nimport NcActions from '../NcActions/NcActions.vue'\nimport NcActionButton from '../NcActionButton/NcActionButton.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\n\nconst props = defineProps({\n\t/**\n\t * aria label to set on the close button\n\t * @default 'Close'\n\t */\n\tariaLabelClose: {\n\t\ttype: String,\n\t\tdefault: t('Close'),\n\t},\n\n\t/**\n\t * Container for the actions\n\t */\n\tactionsContainer: {\n\t\ttype: String,\n\t\tdefault: 'body',\n\t},\n\n\t/**\n\t * Main text of the chip.\n\t */\n\ttext: {\n\t\ttype: String,\n\t\tdefault: '',\n\t},\n\n\t/**\n\t * Set the chips design variant-\n\t *\n\t * This sets the background style of the chip, similar to NcButton's `variant`.\n\t * @deprecated will be removed with v9 - use `variant` instead.\n\t */\n\ttype: {\n\t\ttype: String,\n\t\tdefault: 'secondary',\n\t\tvalidator: (value) => ['primary', 'secondary', 'tertiary'].includes(value),\n\t},\n\n\t/**\n\t * SVG path of the icon to use, this takes precedence over `iconSVG`.\n\t * For example icon paths from `@mdi/js` can be used.\n\t */\n\ticonPath: {\n\t\ttype: String,\n\t\tdefault: null,\n\t},\n\n\t/**\n\t * Inline SVG to use as the icon\n\t */\n\ticonSvg: {\n\t\ttype: String,\n\t\tdefault: null,\n\t},\n\n\t/**\n\t * Set to true to prevent the close button to be shown\n\t */\n\tnoClose: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Set the chips design variant-\n\t *\n\t * This sets the background style of the chip, similar to NcButton's `variant`.\n\t * @since 8.24.0\n\t */\n\tvariant: {\n\t\ttype: String,\n\t\tdefault: 'secondary',\n\t\tvalidator: (value) => ['primary', 'secondary', 'tertiary'].includes(value),\n\t},\n})\n\nconst emit = defineEmits(['close'])\nconst slots = useSlots()\n\n// TODO: Replace with just `variant` in v9\nconst realVariant = computed(() => props.type !== 'secondary' ? props.type : props.variant)\n\nconst canClose = computed(() => !props.noClose)\nconst hasActions = () => Boolean(slots.actions?.())\nconst hasIcon = () => Boolean(props.iconPath || props.iconSvg || !!slots.icon?.())\n\nconst onClose = () => {\n\t/**\n\t * Emitted when the close button is clicked\n\t */\n\temit('close')\n}\n</script>\n\n<style scoped lang=\"scss\">\n.nc-chip {\n\t--chip-size: 24px;\n\t--chip-radius: calc(var(--chip-size) / 2);\n\t// Setup size of wrapper\n\theight: var(--chip-size);\n\tmax-width: fit-content;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tborder-radius: var(--chip-radius);\n\tbackground-color: var(--color-background-hover);\n\n\t&--primary {\n\t\tbackground-color: var(--color-primary-element);\n\t\tcolor: var(--color-primary-element-text);\n\t}\n\n\t&--secondary {\n\t\tbackground-color: var(--color-primary-element-light);\n\t\tcolor: var(--color-primary-element-light-text);\n\t}\n\n\t&--no-actions &__text {\n\t\t// If there are no actions we need to add some padding to ensure the text is not cut-off\n\t\tpadding-inline-end: calc(1.5 * var(--default-grid-baseline));\n\t}\n\n\t&--no-icon &__text {\n\t\t// Add some more space to the border\n\t\tpadding-inline-start: calc(1.5 * var(--default-grid-baseline));\n\t}\n\n\t&__text {\n\t\t// Allow to grow the text\n\t\t// this is only used if an app forces a width of the chip\n\t\tflex: 1 auto;\n\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-wrap: nowrap;\n\t}\n\n\t&__icon {\n\t\t// Do neither grow nor shrink, size is fixed\n\t\tflex: 0 0 var(--chip-size);\n\t\tmargin-inline-end: var(--default-grid-baseline);\n\n\t\tline-height: 1;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t// Force size\n\t\toverflow: hidden;\n\t\theight: var(--chip-size);\n\t\twidth: var(--chip-size);\n\t}\n\n\t&__actions {\n\t\t// Do neither grow nor shrink, size is fixed\n\t\tflex: 0 0 var(--chip-size);\n\t\t// Adjust action size to match chip size\n\t\t--default-clickable-area: var(--chip-size);\n\t\t--border-radius-element: var(--chip-radius);\n\t}\n}\n</style>\n"],"names":["useSlots","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsMA,UAAM,QAAQA,IAAQ,SAAA;AAGtB,UAAM,cAAcC,IAAAA,SAAS,MAAM,MAAM,SAAS,cAAc,MAAM,OAAO,MAAM,OAAO;AAE1F,UAAM,WAAWA,IAAQ,SAAC,MAAM,CAAC,MAAM,OAAO;AAC9C,UAAM,aAAa,MAAM,QAAQ,MAAM,UAAW,CAAA;AAClD,UAAM,UAAU,MAAM,QAAQ,MAAM,YAAY,MAAM,WAAW,CAAC,CAAC,MAAM,OAAQ,CAAA;AAEjF,UAAM,UAAU,MAAM;AAIrB,WAAK,OAAO;AAAA,IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import '../assets/NcChip-
|
|
2
|
-
import {
|
|
1
|
+
import '../assets/NcChip-CF4Q149V.css';
|
|
2
|
+
import { c as mdiClose } from "../chunks/mdi-C1L0jZ1V.mjs";
|
|
3
3
|
import { useSlots, computed } from "vue";
|
|
4
|
-
import { r as register, n as t17, a as t } from "../chunks/_l10n-
|
|
5
|
-
import { N as NcActions } from "../chunks/NcActions-
|
|
6
|
-
import { N as NcActionButton } from "../chunks/NcActionButton-
|
|
4
|
+
import { r as register, n as t17, a as t } from "../chunks/_l10n-DIOHNc85.mjs";
|
|
5
|
+
import { N as NcActions } from "../chunks/NcActions-CzpbMJoY.mjs";
|
|
6
|
+
import { N as NcActionButton } from "../chunks/NcActionButton-CpGK6gSX.mjs";
|
|
7
7
|
import { N as NcIconSvgWrapper } from "../chunks/NcIconSvgWrapper-Cb-cPj1R.mjs";
|
|
8
8
|
import { n as normalizeComponent } from "../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs";
|
|
9
9
|
register(t17);
|
|
@@ -19,7 +19,14 @@ const _sfc_main = {
|
|
|
19
19
|
default: t("Close")
|
|
20
20
|
},
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Container for the actions
|
|
23
|
+
*/
|
|
24
|
+
actionsContainer: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "body"
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Main text of the chip.
|
|
23
30
|
*/
|
|
24
31
|
text: {
|
|
25
32
|
type: String,
|
|
@@ -94,7 +101,7 @@ var _sfc_render = function render() {
|
|
|
94
101
|
return [_vm.iconPath || _vm.iconSvg ? _c(_setup.NcIconSvgWrapper, { attrs: { "inline": "", "path": _vm.iconPath, "svg": _vm.iconPath ? void 0 : _vm.iconSvg, "size": 18 } }) : _vm._e()];
|
|
95
102
|
})], 2) : _vm._e(), _c("span", { staticClass: "nc-chip__text" }, [_vm._t("default", function() {
|
|
96
103
|
return [_vm._v(_vm._s(_vm.text))];
|
|
97
|
-
})], 2), _setup.canClose || _setup.hasActions() ? _c(_setup.NcActions, { staticClass: "nc-chip__actions", attrs: { "force-menu": !_setup.canClose, "variant": "tertiary-no-background" } }, [_setup.canClose ? _c(_setup.NcActionButton, { attrs: { "close-after-click": "" }, on: { "click": _setup.onClose }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
104
|
+
})], 2), _setup.canClose || _setup.hasActions() ? _c(_setup.NcActions, { staticClass: "nc-chip__actions", attrs: { "container": _vm.actionsContainer, "force-menu": !_setup.canClose, "variant": "tertiary-no-background" } }, [_setup.canClose ? _c(_setup.NcActionButton, { attrs: { "close-after-click": "" }, on: { "click": _setup.onClose }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
98
105
|
return [_c(_setup.NcIconSvgWrapper, { attrs: { "path": _setup.mdiClose, "size": 20 } })];
|
|
99
106
|
}, proxy: true }], null, false, 2547223506) }, [_vm._v(" " + _vm._s(_vm.ariaLabelClose) + " ")]) : _vm._e(), _vm._t("actions")], 2) : _vm._e()], 1);
|
|
100
107
|
};
|
|
@@ -105,7 +112,7 @@ var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
|
105
112
|
_sfc_staticRenderFns,
|
|
106
113
|
false,
|
|
107
114
|
null,
|
|
108
|
-
"
|
|
115
|
+
"a7b8715a"
|
|
109
116
|
);
|
|
110
117
|
const NcChip = __component__.exports;
|
|
111
118
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcChip.mjs","sources":["../../src/components/NcChip/NcChip.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<docs>\n### Basic usage\n\n```vue\n<template>\n\t<div style=\"display: flex; gap: 8px; flex-wrap: wrap;\">\n\t\t<NcChip text=\"Notes.txt\" />\n\t\t<NcChip text=\"Files\" :icon-path=\"mdiFile\" />\n\t\t<NcChip text=\"Color\" :icon-path=\"mdiPalette\" variant=\"tertiary\" />\n\t\t<NcChip text=\"Current time\" :icon-path=\"mdiClock\" no-close variant=\"primary\" />\n\t</div>\n</template>\n<script>\nimport { mdiClock, mdiFile, mdiPalette } from '@mdi/js'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmdiClock,\n\t\t\tmdiFile,\n\t\t\tmdiPalette,\n\t\t}\n\t}\n}\n</script>\n```\n\n### Advanced usage\n\nIt is also possible to use custom components for the icon by using the `icon` slot.\nIn this example we are using the `NcAvatar` component to render the users avatar as the icon.\n\n*Hint: If you use round icons like avatars you should set their size to `24px` (or use CSS variable `--chip-size`) to make them fully fill and align with the the chip*\n\nAlso it is possible to pass custom actions.\n\n```vue\n<template>\n\t<NcChip>\n\t\t<!-- The icon slot allow to use custom components as the chip icon -->\n\t\t<template #icon>\n\t\t\t<NcAvatar :size=\"24\" user=\"jdoe\" display-name=\"J. Doe\" />\n\t\t</template>\n\t\t<!-- The actions slot allows to add custom actions -->\n\t\t<template #actions>\n\t\t\t<NcActionButton>\n\t\t\t\t<template #icon>\n\t\t\t\t\t<ContactsIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd to contacts\n\t\t\t</NcActionButton>\n\t\t</template>\n\t\t<!-- The default slot can be used for add content, just like the `text` prop -->\n\t\tJ. Doe\n\t</NcChip>\n</template>\n<script>\nimport ContactsIcon from 'vue-material-design-icons/Contacts.vue'\nexport default {\n\tcomponents: {\n\t\tContactsIcon,\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"nc-chip\"\n\t\t:class=\"{\n\t\t\t[`nc-chip--${realVariant}`]: true,\n\t\t\t'nc-chip--no-actions': noClose && !hasActions(),\n\t\t\t'nc-chip--no-icon': !hasIcon(),\n\t\t}\">\n\t\t<span v-if=\"hasIcon()\" class=\"nc-chip__icon\">\n\t\t\t<!-- @slot The icon slot can be used to set the chip icon. Make sure that the icon is not exceeding a height of `24px`. For round icons a exact size of `24px` is recommended. -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- The default icon wrapper uses a size of 18px to ensure the icon is not clipped by the round chip style -->\n\t\t\t\t<NcIconSvgWrapper v-if=\"iconPath || iconSvg\"\n\t\t\t\t\tinline\n\t\t\t\t\t:path=\"iconPath\"\n\t\t\t\t\t:svg=\"iconPath ? undefined : iconSvg\"\n\t\t\t\t\t:size=\"18\" />\n\t\t\t</slot>\n\t\t</span>\n\t\t<span class=\"nc-chip__text\">\n\t\t\t<!-- @slot The default slot can be used to set the text that is shown -->\n\t\t\t<slot>{{ text }}</slot>\n\t\t</span>\n\t\t<NcActions v-if=\"canClose || hasActions()\"\n\t\t\tclass=\"nc-chip__actions\"\n\t\t\t:force-menu=\"!canClose\"\n\t\t\tvariant=\"tertiary-no-background\">\n\t\t\t<NcActionButton v-if=\"canClose\"\n\t\t\t\tclose-after-click\n\t\t\t\t@click=\"onClose\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ ariaLabelClose }}\n\t\t\t</NcActionButton>\n\t\t\t<!-- @slot The actions slot can be used to add custom actions to the chips actions -->\n\t\t\t<slot name=\"actions\" />\n\t\t</NcActions>\n\t</div>\n</template>\n\n<script setup>\nimport { mdiClose } from '@mdi/js'\nimport { computed, useSlots } from 'vue'\nimport { t } from '../../l10n.js'\n\nimport NcActions from '../NcActions/NcActions.vue'\nimport NcActionButton from '../NcActionButton/NcActionButton.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\n\nconst props = defineProps({\n\t/**\n\t * aria label to set on the close button\n\t * @default 'Close'\n\t */\n\tariaLabelClose: {\n\t\ttype: String,\n\t\tdefault: t('Close'),\n\t},\n\n\t/**\n\t * Main text of the chip
|
|
1
|
+
{"version":3,"file":"NcChip.mjs","sources":["../../src/components/NcChip/NcChip.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<docs>\n### Basic usage\n\n```vue\n<template>\n\t<div style=\"display: flex; gap: 8px; flex-wrap: wrap;\">\n\t\t<NcChip text=\"Notes.txt\" />\n\t\t<NcChip text=\"Files\" :icon-path=\"mdiFile\" />\n\t\t<NcChip text=\"Color\" :icon-path=\"mdiPalette\" variant=\"tertiary\" />\n\t\t<NcChip text=\"Current time\" :icon-path=\"mdiClock\" no-close variant=\"primary\" />\n\t</div>\n</template>\n<script>\nimport { mdiClock, mdiFile, mdiPalette } from '@mdi/js'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmdiClock,\n\t\t\tmdiFile,\n\t\t\tmdiPalette,\n\t\t}\n\t}\n}\n</script>\n```\n\n### Advanced usage\n\nIt is also possible to use custom components for the icon by using the `icon` slot.\nIn this example we are using the `NcAvatar` component to render the users avatar as the icon.\n\n*Hint: If you use round icons like avatars you should set their size to `24px` (or use CSS variable `--chip-size`) to make them fully fill and align with the the chip*\n\nAlso it is possible to pass custom actions.\n\n```vue\n<template>\n\t<NcChip>\n\t\t<!-- The icon slot allow to use custom components as the chip icon -->\n\t\t<template #icon>\n\t\t\t<NcAvatar :size=\"24\" user=\"jdoe\" display-name=\"J. Doe\" />\n\t\t</template>\n\t\t<!-- The actions slot allows to add custom actions -->\n\t\t<template #actions>\n\t\t\t<NcActionButton>\n\t\t\t\t<template #icon>\n\t\t\t\t\t<ContactsIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd to contacts\n\t\t\t</NcActionButton>\n\t\t</template>\n\t\t<!-- The default slot can be used for add content, just like the `text` prop -->\n\t\tJ. Doe\n\t</NcChip>\n</template>\n<script>\nimport ContactsIcon from 'vue-material-design-icons/Contacts.vue'\nexport default {\n\tcomponents: {\n\t\tContactsIcon,\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"nc-chip\"\n\t\t:class=\"{\n\t\t\t[`nc-chip--${realVariant}`]: true,\n\t\t\t'nc-chip--no-actions': noClose && !hasActions(),\n\t\t\t'nc-chip--no-icon': !hasIcon(),\n\t\t}\">\n\t\t<span v-if=\"hasIcon()\" class=\"nc-chip__icon\">\n\t\t\t<!-- @slot The icon slot can be used to set the chip icon. Make sure that the icon is not exceeding a height of `24px`. For round icons a exact size of `24px` is recommended. -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- The default icon wrapper uses a size of 18px to ensure the icon is not clipped by the round chip style -->\n\t\t\t\t<NcIconSvgWrapper v-if=\"iconPath || iconSvg\"\n\t\t\t\t\tinline\n\t\t\t\t\t:path=\"iconPath\"\n\t\t\t\t\t:svg=\"iconPath ? undefined : iconSvg\"\n\t\t\t\t\t:size=\"18\" />\n\t\t\t</slot>\n\t\t</span>\n\t\t<span class=\"nc-chip__text\">\n\t\t\t<!-- @slot The default slot can be used to set the text that is shown -->\n\t\t\t<slot>{{ text }}</slot>\n\t\t</span>\n\t\t<NcActions v-if=\"canClose || hasActions()\"\n\t\t\tclass=\"nc-chip__actions\"\n\t\t\t:container=\"actionsContainer\"\n\t\t\t:force-menu=\"!canClose\"\n\t\t\tvariant=\"tertiary-no-background\">\n\t\t\t<NcActionButton v-if=\"canClose\"\n\t\t\t\tclose-after-click\n\t\t\t\t@click=\"onClose\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ ariaLabelClose }}\n\t\t\t</NcActionButton>\n\t\t\t<!-- @slot The actions slot can be used to add custom actions to the chips actions -->\n\t\t\t<slot name=\"actions\" />\n\t\t</NcActions>\n\t</div>\n</template>\n\n<script setup>\nimport { mdiClose } from '@mdi/js'\nimport { computed, useSlots } from 'vue'\nimport { t } from '../../l10n.js'\n\nimport NcActions from '../NcActions/NcActions.vue'\nimport NcActionButton from '../NcActionButton/NcActionButton.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\n\nconst props = defineProps({\n\t/**\n\t * aria label to set on the close button\n\t * @default 'Close'\n\t */\n\tariaLabelClose: {\n\t\ttype: String,\n\t\tdefault: t('Close'),\n\t},\n\n\t/**\n\t * Container for the actions\n\t */\n\tactionsContainer: {\n\t\ttype: String,\n\t\tdefault: 'body',\n\t},\n\n\t/**\n\t * Main text of the chip.\n\t */\n\ttext: {\n\t\ttype: String,\n\t\tdefault: '',\n\t},\n\n\t/**\n\t * Set the chips design variant-\n\t *\n\t * This sets the background style of the chip, similar to NcButton's `variant`.\n\t * @deprecated will be removed with v9 - use `variant` instead.\n\t */\n\ttype: {\n\t\ttype: String,\n\t\tdefault: 'secondary',\n\t\tvalidator: (value) => ['primary', 'secondary', 'tertiary'].includes(value),\n\t},\n\n\t/**\n\t * SVG path of the icon to use, this takes precedence over `iconSVG`.\n\t * For example icon paths from `@mdi/js` can be used.\n\t */\n\ticonPath: {\n\t\ttype: String,\n\t\tdefault: null,\n\t},\n\n\t/**\n\t * Inline SVG to use as the icon\n\t */\n\ticonSvg: {\n\t\ttype: String,\n\t\tdefault: null,\n\t},\n\n\t/**\n\t * Set to true to prevent the close button to be shown\n\t */\n\tnoClose: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Set the chips design variant-\n\t *\n\t * This sets the background style of the chip, similar to NcButton's `variant`.\n\t * @since 8.24.0\n\t */\n\tvariant: {\n\t\ttype: String,\n\t\tdefault: 'secondary',\n\t\tvalidator: (value) => ['primary', 'secondary', 'tertiary'].includes(value),\n\t},\n})\n\nconst emit = defineEmits(['close'])\nconst slots = useSlots()\n\n// TODO: Replace with just `variant` in v9\nconst realVariant = computed(() => props.type !== 'secondary' ? props.type : props.variant)\n\nconst canClose = computed(() => !props.noClose)\nconst hasActions = () => Boolean(slots.actions?.())\nconst hasIcon = () => Boolean(props.iconPath || props.iconSvg || !!slots.icon?.())\n\nconst onClose = () => {\n\t/**\n\t * Emitted when the close button is clicked\n\t */\n\temit('close')\n}\n</script>\n\n<style scoped lang=\"scss\">\n.nc-chip {\n\t--chip-size: 24px;\n\t--chip-radius: calc(var(--chip-size) / 2);\n\t// Setup size of wrapper\n\theight: var(--chip-size);\n\tmax-width: fit-content;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tborder-radius: var(--chip-radius);\n\tbackground-color: var(--color-background-hover);\n\n\t&--primary {\n\t\tbackground-color: var(--color-primary-element);\n\t\tcolor: var(--color-primary-element-text);\n\t}\n\n\t&--secondary {\n\t\tbackground-color: var(--color-primary-element-light);\n\t\tcolor: var(--color-primary-element-light-text);\n\t}\n\n\t&--no-actions &__text {\n\t\t// If there are no actions we need to add some padding to ensure the text is not cut-off\n\t\tpadding-inline-end: calc(1.5 * var(--default-grid-baseline));\n\t}\n\n\t&--no-icon &__text {\n\t\t// Add some more space to the border\n\t\tpadding-inline-start: calc(1.5 * var(--default-grid-baseline));\n\t}\n\n\t&__text {\n\t\t// Allow to grow the text\n\t\t// this is only used if an app forces a width of the chip\n\t\tflex: 1 auto;\n\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-wrap: nowrap;\n\t}\n\n\t&__icon {\n\t\t// Do neither grow nor shrink, size is fixed\n\t\tflex: 0 0 var(--chip-size);\n\t\tmargin-inline-end: var(--default-grid-baseline);\n\n\t\tline-height: 1;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t// Force size\n\t\toverflow: hidden;\n\t\theight: var(--chip-size);\n\t\twidth: var(--chip-size);\n\t}\n\n\t&__actions {\n\t\t// Do neither grow nor shrink, size is fixed\n\t\tflex: 0 0 var(--chip-size);\n\t\t// Adjust action size to match chip size\n\t\t--default-clickable-area: var(--chip-size);\n\t\t--border-radius-element: var(--chip-radius);\n\t}\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsMA,UAAM,QAAQ,SAAQ;AAGtB,UAAM,cAAc,SAAS,MAAM,MAAM,SAAS,cAAc,MAAM,OAAO,MAAM,OAAO;AAE1F,UAAM,WAAW,SAAS,MAAM,CAAC,MAAM,OAAO;AAC9C,UAAM,aAAa,MAAM,QAAQ,MAAM,UAAW,CAAA;AAClD,UAAM,UAAU,MAAM,QAAQ,MAAM,YAAY,MAAM,WAAW,CAAC,CAAC,MAAM,OAAQ,CAAA;AAEjF,UAAM,UAAU,MAAM;AAIrB,WAAK,OAAO;AAAA,IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const NcCollectionList = require("../chunks/NcCollectionList-
|
|
2
|
+
const NcCollectionList = require("../chunks/NcCollectionList-B7SKtsie.cjs");
|
|
3
3
|
module.exports = NcCollectionList.NcCollectionList;
|
|
4
4
|
//# sourceMappingURL=NcCollectionList.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const NcDashboardWidget = require("../chunks/NcDashboardWidget-
|
|
2
|
+
const NcDashboardWidget = require("../chunks/NcDashboardWidget-CJMYBSOl.cjs");
|
|
3
3
|
module.exports = NcDashboardWidget.NcDashboardWidget;
|
|
4
4
|
//# sourceMappingURL=NcDashboardWidget.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const NcDashboardWidgetItem = require("../chunks/NcDashboardWidgetItem-
|
|
2
|
+
const NcDashboardWidgetItem = require("../chunks/NcDashboardWidgetItem-EVIAYLsi.cjs");
|
|
3
3
|
module.exports = NcDashboardWidgetItem.NcDashboardWidgetItem;
|
|
4
4
|
//# sourceMappingURL=NcDashboardWidgetItem.cjs.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
require('../assets/NcDateTimePicker-
|
|
1
|
+
require('../assets/NcDateTimePicker-DGkOwO8l.css');
|
|
2
2
|
"use strict";
|
|
3
|
-
const _l10n = require("../chunks/_l10n-
|
|
3
|
+
const _l10n = require("../chunks/_l10n-CXXSIoEf.cjs");
|
|
4
4
|
const GenRandomId = require("../chunks/GenRandomId-BQDud3d4.cjs");
|
|
5
5
|
const useModelMigration = require("../chunks/useModelMigration-D5zhrNXr.cjs");
|
|
6
|
-
const NcTimezonePicker = require("../chunks/NcTimezonePicker-
|
|
6
|
+
const NcTimezonePicker = require("../chunks/NcTimezonePicker-Ds_yZJVZ.cjs");
|
|
7
7
|
const NcPopover = require("../chunks/NcPopover-B2z7TwNr.cjs");
|
|
8
8
|
const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-V0q-tHlQ.cjs");
|
|
9
9
|
const l10n = require("@nextcloud/l10n");
|
|
10
10
|
const DatePicker = require("vue2-datepicker");
|
|
11
|
-
const ScopeComponent = require("../chunks/ScopeComponent-
|
|
11
|
+
const ScopeComponent = require("../chunks/ScopeComponent-SIPKHdQy.cjs");
|
|
12
12
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
13
13
|
const DatePicker__default = /* @__PURE__ */ _interopDefault(DatePicker);
|
|
14
14
|
_l10n.register(_l10n.t37);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import '../assets/NcDateTimePicker-
|
|
2
|
-
import { r as register, K as t37, a as t } from "../chunks/_l10n-
|
|
1
|
+
import '../assets/NcDateTimePicker-DGkOwO8l.css';
|
|
2
|
+
import { r as register, K as t37, a as t } from "../chunks/_l10n-DIOHNc85.mjs";
|
|
3
3
|
import { G as GenRandomId } from "../chunks/GenRandomId-CMooMQt0.mjs";
|
|
4
4
|
import { u as useModelMigration } from "../chunks/useModelMigration-EhAWvqDD.mjs";
|
|
5
|
-
import { N as NcTimezonePicker } from "../chunks/NcTimezonePicker-
|
|
5
|
+
import { N as NcTimezonePicker } from "../chunks/NcTimezonePicker-BjUmYLVj.mjs";
|
|
6
6
|
import { N as NcPopover } from "../chunks/NcPopover-kYsewfff.mjs";
|
|
7
7
|
import { n as normalizeComponent } from "../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs";
|
|
8
8
|
import { getFirstDay, getDayNamesMin, getDayNamesShort, getDayNames, getMonthNamesShort, getMonthNames } from "@nextcloud/l10n";
|
|
9
9
|
import DatePicker from "vue2-datepicker";
|
|
10
|
-
import { S as ScopeComponent } from "../chunks/ScopeComponent-
|
|
10
|
+
import { S as ScopeComponent } from "../chunks/ScopeComponent-CC0LPlVx.mjs";
|
|
11
11
|
register(t37);
|
|
12
12
|
const _sfc_main$2 = {
|
|
13
13
|
name: "CalendarBlankIcon",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
require('../assets/NcDateTimePickerNative-
|
|
1
|
+
require('../assets/NcDateTimePickerNative-CYS2ORfo.css');
|
|
2
2
|
"use strict";
|
|
3
3
|
const useModelMigration = require("../chunks/useModelMigration-D5zhrNXr.cjs");
|
|
4
4
|
const GenRandomId = require("../chunks/GenRandomId-BQDud3d4.cjs");
|
|
5
5
|
const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-V0q-tHlQ.cjs");
|
|
6
|
-
const ScopeComponent = require("../chunks/ScopeComponent-
|
|
6
|
+
const ScopeComponent = require("../chunks/ScopeComponent-SIPKHdQy.cjs");
|
|
7
7
|
const inputDateTypes = ["date", "datetime-local", "month", "time", "week"];
|
|
8
8
|
const _sfc_main = {
|
|
9
9
|
name: "NcDateTimePickerNative",
|
|
@@ -134,8 +134,7 @@ const _sfc_main = {
|
|
|
134
134
|
/**
|
|
135
135
|
* Handle the input event
|
|
136
136
|
*
|
|
137
|
-
* @param {InputEvent} $event input event
|
|
138
|
-
* @return {Date|string} new chosen Date() or an empty string
|
|
137
|
+
* @param {InputEvent} $event input event payloads
|
|
139
138
|
*/
|
|
140
139
|
input: ($event) => {
|
|
141
140
|
if (isNaN($event.target.valueAsNumber)) {
|
|
@@ -224,7 +223,7 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
|
224
223
|
_sfc_staticRenderFns,
|
|
225
224
|
false,
|
|
226
225
|
null,
|
|
227
|
-
"
|
|
226
|
+
"9e776556"
|
|
228
227
|
);
|
|
229
228
|
const NcDateTimePickerNative = __component__.exports;
|
|
230
229
|
ScopeComponent.ScopeComponent(NcDateTimePickerNative);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcDateTimePickerNative.cjs","sources":["../../src/components/NcDateTimePickerNative/NcDateTimePickerNative.vue","../../src/components/NcDateTimePickerNative/index.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 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 provides a wrapper around the native browser datetime picker. <br>\nThis is an input with some type of date e.g. https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type=datetime-local). <br>\nAll available types are: 'date', 'datetime-local', 'month', 'time' and 'week', please check them here: https://html.spec.whatwg.org/multipage/input.html# <br>\n\n### Examples\n\n```vue\n<template>\n\t<div>\n\t\t<span>Picked date: {{ value || 'null' }}</span>\n\t\t<hr/>\n\t\t<div class=\"flex\">\n\t\t\t<NcSelect v-bind=\"props\" v-model=\"type\" />\n\t\t\t<NcDateTimePickerNative\n\t\t\t\tv-model=\"value\"\n\t\t\t\t:label=\"label\"\n\t\t\t\t:type=\"type\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tprops: {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tinputLabel: 'Picker type',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t'date',\n\t\t\t\t\t\t'datetime-local',\n\t\t\t\t\t\t'month',\n\t\t\t\t\t\t'time',\n\t\t\t\t\t\t'week',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\ttype: 'datetime-local',\n\t\t\t\tvalue: new Date(),\n\t\t\t\tlabel: 'Select a new date or time',\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style scoped>\n.flex {\n\tdisplay: flex;\n\tgap: 4px;\n}\n</style>\n```\n\n#### Usage: type='datetime-local' with min date and max date\n```vue\n<template>\n\t<div>\n\t\t<span>Picked date: {{ value || 'null' }}</span>\n\t\t<NcDateTimePickerNative\n\t\t\tv-model=\"value\"\n\t\t\t:min=\"yesterdayDate\"\n\t\t\t:max=\"someDate\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"datetime-local\" />\n\t</div>\n</template>\n\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tvalue: new Date(),\n\t\t\t\tlabel: 'please select a new date',\n\t\t\t\tyesterdayDate: new Date(new Date().setDate(new Date().getDate() - 1)),\n\t\t\t\tsomeDate: new Date(new Date().setDate(new Date().getDate() + 7)),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"native-datetime-picker\">\n\t\t<label class=\"native-datetime-picker--label\"\n\t\t\t:class=\"{ 'hidden-visually': hideLabel }\"\n\t\t\t:for=\"id\">\n\t\t\t{{ label }}\n\t\t</label>\n\t\t<input :id=\"id\"\n\t\t\tclass=\"native-datetime-picker--input\"\n\t\t\t:class=\"inputClass\"\n\t\t\t:type=\"type\"\n\t\t\t:value=\"formattedValue\"\n\t\t\t:min=\"formattedMin\"\n\t\t\t:max=\"formattedMax\"\n\t\t\tv-bind=\"$attrs\"\n\t\t\tv-on=\"listeners\">\n\t</div>\n</template>\n\n<script>\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nconst inputDateTypes = ['date', 'datetime-local', 'month', 'time', 'week']\n\nexport default {\n\tname: 'NcDateTimePickerNative',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Date,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * The date is – like the `Date` object in JavaScript – tied to UTC.\n\t\t * The selected time zone does not have an influence of the selected time and date value.\n\t\t * You have to translate the time yourself when you want to factor in time zones.\n\t\t * Pass null to clear the input field.\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: Date,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the input field\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'date-time-picker-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\t\t/**\n\t\t * type attribute of the input field\n\t\t * default type: String\n\t\t * The type of the input element, it can be `date`, `datetime-local`, `month`, `time`, `week`\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'date',\n\t\t\tvalidate: (name) => inputDateTypes.includes(name),\n\t\t},\n\t\t/**\n\t\t * text inside the label element\n\t\t * default type: String\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: 'Please choose a date',\n\t\t},\n\t\t/**\n\t\t * min attribute of the input field\n\t\t * default type: null\n\t\t */\n\t\tmin: {\n\t\t\ttype: [Date, Boolean],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * max attribute of the input field\n\t\t * default type: null\n\t\t */\n\t\tmax: {\n\t\t\ttype: [Date, Boolean],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * Flag to hide the label\n\t\t * default type: String\n\t\t * The hidden input label for accessibility purposes.\n\t\t */\n\t\thideLabel: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Class to add to the input field.\n\t\t * Necessary to use NcDateTimePickerNative in the NcActionInput component.\n\t\t */\n\t\tinputClass: {\n\t\t\ttype: [Object, String],\n\t\t\tdefault: '',\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'input',\n\t\t/**\n\t\t * Emitted when the input value changes\n\t\t *\n\t\t * @return {Date} new chosen Date()\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', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tformattedValue() {\n\t\t\treturn this.formatValue(this.model)\n\t\t},\n\t\tformattedMin() {\n\t\t\tif (this.min) {\n\t\t\t\treturn this.formatValue(this.min)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tformattedMax() {\n\t\t\tif (this.max) {\n\t\t\t\treturn this.formatValue(this.max)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tlisteners() {\n\t\t\treturn {\n\t\t\t\t...this.$listeners,\n\t\t\t\t/**\n\t\t\t\t * Handle the input event\n\t\t\t\t *\n\t\t\t\t * @param {InputEvent} $event input event payload\n\t\t\t\t * @return {Date|string} new chosen Date() or an empty string\n\t\t\t\t */\n\t\t\t\tinput: ($event) => {\n\t\t\t\t\tif (isNaN($event.target.valueAsNumber)) {\n\t\t\t\t\t\tthis.model = null\n\t\t\t\t\t} else if (this.type === 'time') {\n\t\t\t\t\t\tconst time = $event.target.value\n\t\t\t\t\t\tif (this.model === '') {\n\t\t\t\t\t\t\t// this case is because of Chrome bug\n\t\t\t\t\t\t\tconst { yyyy, MM, dd } = this.getReadableDate(new Date())\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Emitted when the input value changes\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @return {Date} new chosen Date()\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst { yyyy, MM, dd } = this.getReadableDate(this.model)\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this.type === 'month') {\n\t\t\t\t\t\tconst MM = (new Date($event.target.value).getMonth() + 1).toString().padStart(2, '0')\n\t\t\t\t\t\tif (this.model === '') {\n\t\t\t\t\t\t\tconst { yyyy, dd, hh, mm } = this.getReadableDate(new Date())\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst { yyyy, dd, hh, mm } = this.getReadableDate(this.model)\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst timezoneOffsetSeconds = new Date($event.target.valueAsNumber).getTimezoneOffset() * 1000 * 60\n\t\t\t\t\t\tconst inputDateWithTimezone = $event.target.valueAsNumber + timezoneOffsetSeconds\n\t\t\t\t\t\tthis.model = new Date(inputDateWithTimezone)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Returns Object with string values of a Date\n\t\t *\n\t\t * @param {Date} value The selected value\n\t\t * @return {object|undefined}\n\t\t */\n\t\tgetReadableDate(value) {\n\t\t\tif (value instanceof Date) {\n\t\t\t\tconst yyyy = value.getFullYear().toString().padStart(4, '0')\n\t\t\t\tconst MM = (value.getMonth() + 1).toString().padStart(2, '0')\n\t\t\t\tconst dd = value.getDate().toString().padStart(2, '0')\n\t\t\t\tconst hh = value.getHours().toString().padStart(2, '0')\n\t\t\t\tconst mm = value.getMinutes().toString().padStart(2, '0')\n\n\t\t\t\treturn { yyyy, MM, dd, hh, mm }\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Returns preformatted value for the input field\n\t\t *\n\t\t * @param {Date} value The selected value\n\t\t * @return {string|undefined}\n\t\t */\n\t\tformatValue(value) {\n\t\t\tif (value instanceof Date) {\n\t\t\t\tconst { yyyy, MM, dd, hh, mm } = this.getReadableDate(value)\n\t\t\t\tif (this.type === 'datetime-local') {\n\t\t\t\t\treturn `${yyyy}-${MM}-${dd}T${hh}:${mm}`\n\t\t\t\t} else if (this.type === 'date') {\n\t\t\t\t\treturn `${yyyy}-${MM}-${dd}`\n\t\t\t\t} else if (this.type === 'month') {\n\t\t\t\t\treturn `${yyyy}-${MM}`\n\t\t\t\t} else if (this.type === 'time') {\n\t\t\t\t\treturn `${hh}:${mm}`\n\t\t\t\t} else if (this.type === 'week') {\n\t\t\t\t\tconst startDate = new Date(yyyy, 0, 1)\n\t\t\t\t\tconst daysSinceBeginningOfYear = Math.floor((value - startDate)\n\t\t\t\t\t\t/ (24 * 60 * 60 * 1000))\n\t\t\t\t\tconst weekNumber = Math.ceil(daysSinceBeginningOfYear / 7)\n\t\t\t\t\treturn `${yyyy}-W${weekNumber}`\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\t.native-datetime-picker {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t.native-datetime-picker .native-datetime-picker--label {\n\t\tmargin-block-end: 2px;\n\t}\n\n\t.native-datetime-picker .native-datetime-picker--input {\n\t\t// If border width differs between focused and unfocused we need to compensate to prevent jumping\n\t\t--input-border-width-offset: calc(var(--border-width-input-focused, 2px) - var(--border-width-input, 2px));\n\t\twidth: 100%;\n\t\tflex: 0 0 auto;\n\t\tmargin: 0;\n\t\tpadding-inline-start: calc(var(--border-radius-large) + var(--input-border-width-offset));\n\t\tpadding-inline-end: calc(var(--default-grid-baseline) + var(--input-border-width-offset));\n\t\tborder: var(--border-width-input, 2px) solid var(--color-border-maxcontrast);\n\n\t\t&:active:not([disabled]),\n\t\t&:hover:not([disabled]),\n\t\t&:focus:not([disabled]),\n\t\t&:focus-within:not([disabled]) {\n\t\t\tborder-color: var(--color-main-text);\n\t\t\tborder-width: var(--border-width-input-focused, 2px);\n\t\t\tbox-shadow: 0 0 0 2px var(--color-main-background) !important;\n\t\t\t// Reset padding offset when focused\n\t\t\t--input-border-width-offset: 0px;\n\t\t}\n\t}\n\n\t[data-theme-light],\n\t[data-themes*=light] {\n\t\t.native-datetime-picker--input {\n\t\t\tcolor-scheme: light;\n\t\t}\n\t}\n\n\t[data-theme-dark],\n\t[data-themes*=dark] {\n\t\t.native-datetime-picker--input {\n\t\t\tcolor-scheme: dark;\n\t\t}\n\t}\n\n\t[data-theme-default],\n\t[data-themes*=default] {\n\t\t@media (prefers-color-scheme: light) {\n\t\t\t.native-datetime-picker--input {\n\t\t\t\tcolor-scheme: light;\n\t\t\t}\n\t\t}\n\t\t@media (prefers-color-scheme: dark) {\n\t\t\t.native-datetime-picker--input {\n\t\t\t\tcolor-scheme: dark;\n\t\t\t}\n\t\t}\n\t}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport NcDateTimePickerNative from './NcDateTimePickerNative.vue'\nimport ScopeComponent from '../../utils/ScopeComponent.js'\n\nScopeComponent(NcDateTimePickerNative)\n\nexport default NcDateTimePickerNative\n"],"names":["GenRandomId","useModelMigration","ScopeComponent"],"mappings":";;;;;AA+GA,MAAA,iBAAA,CAAA,QAAA,kBAAA,SAAA,QAAA,MAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,sBAAAA,wBAAA;AAAA,MACA,WAAA,QAAA,GAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA,CAAA,SAAA,eAAA,SAAA,IAAA;AAA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ACxUAC,eAAAA,eAAe,sBAAsB;;"}
|
|
1
|
+
{"version":3,"file":"NcDateTimePickerNative.cjs","sources":["../../src/components/NcDateTimePickerNative/NcDateTimePickerNative.vue","../../src/components/NcDateTimePickerNative/index.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 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 provides a wrapper around the native browser datetime picker. <br>\nThis is an input with some type of date e.g. https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type=datetime-local). <br>\nAll available types are: 'date', 'datetime-local', 'month', 'time' and 'week', please check them here: https://html.spec.whatwg.org/multipage/input.html# <br>\n\n### Examples\n\n```vue\n<template>\n\t<div>\n\t\t<span>Picked date: {{ value || 'null' }}</span>\n\t\t<hr/>\n\t\t<div class=\"flex\">\n\t\t\t<NcSelect v-bind=\"props\" v-model=\"type\" />\n\t\t\t<NcDateTimePickerNative\n\t\t\t\tv-model=\"value\"\n\t\t\t\t:label=\"label\"\n\t\t\t\t:type=\"type\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tprops: {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tinputLabel: 'Picker type',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t'date',\n\t\t\t\t\t\t'datetime-local',\n\t\t\t\t\t\t'month',\n\t\t\t\t\t\t'time',\n\t\t\t\t\t\t'week',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\ttype: 'datetime-local',\n\t\t\t\tvalue: new Date(),\n\t\t\t\tlabel: 'Select a new date or time',\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style scoped>\n.flex {\n\tdisplay: flex;\n\tgap: 4px;\n}\n</style>\n```\n\n#### Usage: type='datetime-local' with min date and max date\n```vue\n<template>\n\t<div>\n\t\t<span>Picked date: {{ value || 'null' }}</span>\n\t\t<NcDateTimePickerNative\n\t\t\tv-model=\"value\"\n\t\t\t:min=\"yesterdayDate\"\n\t\t\t:max=\"someDate\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"datetime-local\" />\n\t</div>\n</template>\n\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tvalue: new Date(),\n\t\t\t\tlabel: 'please select a new date',\n\t\t\t\tyesterdayDate: new Date(new Date().setDate(new Date().getDate() - 1)),\n\t\t\t\tsomeDate: new Date(new Date().setDate(new Date().getDate() + 7)),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"native-datetime-picker\">\n\t\t<label class=\"native-datetime-picker--label\"\n\t\t\t:class=\"{ 'hidden-visually': hideLabel }\"\n\t\t\t:for=\"id\">\n\t\t\t{{ label }}\n\t\t</label>\n\t\t<input :id=\"id\"\n\t\t\tclass=\"native-datetime-picker--input\"\n\t\t\t:class=\"inputClass\"\n\t\t\t:type=\"type\"\n\t\t\t:value=\"formattedValue\"\n\t\t\t:min=\"formattedMin\"\n\t\t\t:max=\"formattedMax\"\n\t\t\tv-bind=\"$attrs\"\n\t\t\tv-on=\"listeners\">\n\t</div>\n</template>\n\n<script>\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nconst inputDateTypes = ['date', 'datetime-local', 'month', 'time', 'week']\n\nexport default {\n\tname: 'NcDateTimePickerNative',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Date,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * The date is – like the `Date` object in JavaScript – tied to UTC.\n\t\t * The selected time zone does not have an influence of the selected time and date value.\n\t\t * You have to translate the time yourself when you want to factor in time zones.\n\t\t * Pass null to clear the input field.\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: Date,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the input field\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'date-time-picker-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\t\t/**\n\t\t * type attribute of the input field\n\t\t * default type: String\n\t\t * The type of the input element, it can be `date`, `datetime-local`, `month`, `time`, `week`\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'date',\n\t\t\tvalidate: (name) => inputDateTypes.includes(name),\n\t\t},\n\t\t/**\n\t\t * text inside the label element\n\t\t * default type: String\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: 'Please choose a date',\n\t\t},\n\t\t/**\n\t\t * min attribute of the input field\n\t\t * default type: null\n\t\t */\n\t\tmin: {\n\t\t\ttype: [Date, Boolean],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * max attribute of the input field\n\t\t * default type: null\n\t\t */\n\t\tmax: {\n\t\t\ttype: [Date, Boolean],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * Flag to hide the label\n\t\t * default type: String\n\t\t * The hidden input label for accessibility purposes.\n\t\t */\n\t\thideLabel: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Class to add to the input field.\n\t\t * Necessary to use NcDateTimePickerNative in the NcActionInput component.\n\t\t */\n\t\tinputClass: {\n\t\t\ttype: [Object, String],\n\t\t\tdefault: '',\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'input',\n\t\t/**\n\t\t * Emitted when the input value changes\n\t\t *\n\t\t * @return {Date} new chosen Date()\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', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tformattedValue() {\n\t\t\treturn this.formatValue(this.model)\n\t\t},\n\t\tformattedMin() {\n\t\t\tif (this.min) {\n\t\t\t\treturn this.formatValue(this.min)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tformattedMax() {\n\t\t\tif (this.max) {\n\t\t\t\treturn this.formatValue(this.max)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tlisteners() {\n\t\t\treturn {\n\t\t\t\t...this.$listeners,\n\t\t\t\t/**\n\t\t\t\t * Handle the input event\n\t\t\t\t *\n\t\t\t\t * @param {InputEvent} $event input event payloads\n\t\t\t\t */\n\t\t\t\tinput: ($event) => {\n\t\t\t\t\tif (isNaN($event.target.valueAsNumber)) {\n\t\t\t\t\t\tthis.model = null\n\t\t\t\t\t} else if (this.type === 'time') {\n\t\t\t\t\t\tconst time = $event.target.value\n\t\t\t\t\t\tif (this.model === '') {\n\t\t\t\t\t\t\t// this case is because of Chrome bug\n\t\t\t\t\t\t\tconst { yyyy, MM, dd } = this.getReadableDate(new Date())\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Emitted when the input value changes\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @return {Date} new chosen Date()\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst { yyyy, MM, dd } = this.getReadableDate(this.model)\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this.type === 'month') {\n\t\t\t\t\t\tconst MM = (new Date($event.target.value).getMonth() + 1).toString().padStart(2, '0')\n\t\t\t\t\t\tif (this.model === '') {\n\t\t\t\t\t\t\tconst { yyyy, dd, hh, mm } = this.getReadableDate(new Date())\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst { yyyy, dd, hh, mm } = this.getReadableDate(this.model)\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst timezoneOffsetSeconds = new Date($event.target.valueAsNumber).getTimezoneOffset() * 1000 * 60\n\t\t\t\t\t\tconst inputDateWithTimezone = $event.target.valueAsNumber + timezoneOffsetSeconds\n\t\t\t\t\t\tthis.model = new Date(inputDateWithTimezone)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Returns Object with string values of a Date\n\t\t *\n\t\t * @param {Date} value The selected value\n\t\t * @return {object|undefined}\n\t\t */\n\t\tgetReadableDate(value) {\n\t\t\tif (value instanceof Date) {\n\t\t\t\tconst yyyy = value.getFullYear().toString().padStart(4, '0')\n\t\t\t\tconst MM = (value.getMonth() + 1).toString().padStart(2, '0')\n\t\t\t\tconst dd = value.getDate().toString().padStart(2, '0')\n\t\t\t\tconst hh = value.getHours().toString().padStart(2, '0')\n\t\t\t\tconst mm = value.getMinutes().toString().padStart(2, '0')\n\n\t\t\t\treturn { yyyy, MM, dd, hh, mm }\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Returns preformatted value for the input field\n\t\t *\n\t\t * @param {Date} value The selected value\n\t\t * @return {string|undefined}\n\t\t */\n\t\tformatValue(value) {\n\t\t\tif (value instanceof Date) {\n\t\t\t\tconst { yyyy, MM, dd, hh, mm } = this.getReadableDate(value)\n\t\t\t\tif (this.type === 'datetime-local') {\n\t\t\t\t\treturn `${yyyy}-${MM}-${dd}T${hh}:${mm}`\n\t\t\t\t} else if (this.type === 'date') {\n\t\t\t\t\treturn `${yyyy}-${MM}-${dd}`\n\t\t\t\t} else if (this.type === 'month') {\n\t\t\t\t\treturn `${yyyy}-${MM}`\n\t\t\t\t} else if (this.type === 'time') {\n\t\t\t\t\treturn `${hh}:${mm}`\n\t\t\t\t} else if (this.type === 'week') {\n\t\t\t\t\tconst startDate = new Date(yyyy, 0, 1)\n\t\t\t\t\tconst daysSinceBeginningOfYear = Math.floor((value - startDate)\n\t\t\t\t\t\t/ (24 * 60 * 60 * 1000))\n\t\t\t\t\tconst weekNumber = Math.ceil(daysSinceBeginningOfYear / 7)\n\t\t\t\t\treturn `${yyyy}-W${weekNumber}`\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\t.native-datetime-picker {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t.native-datetime-picker .native-datetime-picker--label {\n\t\tmargin-block-end: 2px;\n\t}\n\n\t.native-datetime-picker .native-datetime-picker--input {\n\t\t// If border width differs between focused and unfocused we need to compensate to prevent jumping\n\t\t--input-border-width-offset: calc(var(--border-width-input-focused, 2px) - var(--border-width-input, 2px));\n\t\twidth: 100%;\n\t\tflex: 0 0 auto;\n\t\tmargin: 0;\n\t\tpadding-inline-start: calc(var(--border-radius-large) + var(--input-border-width-offset));\n\t\tpadding-inline-end: calc(var(--default-grid-baseline) + var(--input-border-width-offset));\n\t\tborder: var(--border-width-input, 2px) solid var(--color-border-maxcontrast);\n\n\t\t&:active:not([disabled]),\n\t\t&:hover:not([disabled]),\n\t\t&:focus:not([disabled]),\n\t\t&:focus-within:not([disabled]) {\n\t\t\tborder-color: var(--color-main-text);\n\t\t\tborder-width: var(--border-width-input-focused, 2px);\n\t\t\tbox-shadow: 0 0 0 2px var(--color-main-background) !important;\n\t\t\t// Reset padding offset when focused\n\t\t\t--input-border-width-offset: 0px;\n\t\t}\n\t}\n\n\t[data-theme-light],\n\t[data-themes*=light] {\n\t\t.native-datetime-picker--input {\n\t\t\tcolor-scheme: light;\n\t\t}\n\t}\n\n\t[data-theme-dark],\n\t[data-themes*=dark] {\n\t\t.native-datetime-picker--input {\n\t\t\tcolor-scheme: dark;\n\t\t}\n\t}\n\n\t[data-theme-default],\n\t[data-themes*=default] {\n\t\t@media (prefers-color-scheme: light) {\n\t\t\t.native-datetime-picker--input {\n\t\t\t\tcolor-scheme: light;\n\t\t\t}\n\t\t}\n\t\t@media (prefers-color-scheme: dark) {\n\t\t\t.native-datetime-picker--input {\n\t\t\t\tcolor-scheme: dark;\n\t\t\t}\n\t\t}\n\t}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport NcDateTimePickerNative from './NcDateTimePickerNative.vue'\nimport ScopeComponent from '../../utils/ScopeComponent.js'\n\nScopeComponent(NcDateTimePickerNative)\n\nexport default NcDateTimePickerNative\n"],"names":["GenRandomId","useModelMigration","ScopeComponent"],"mappings":";;;;;AA+GA,MAAA,iBAAA,CAAA,QAAA,kBAAA,SAAA,QAAA,MAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,sBAAAA,wBAAA;AAAA,MACA,WAAA,QAAA,GAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;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,MACA,OAAA;AACA,eAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;ACvUAC,eAAAA,eAAe,sBAAsB;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '../assets/NcDateTimePickerNative-
|
|
1
|
+
import '../assets/NcDateTimePickerNative-CYS2ORfo.css';
|
|
2
2
|
import { u as useModelMigration } from "../chunks/useModelMigration-EhAWvqDD.mjs";
|
|
3
3
|
import { G as GenRandomId } from "../chunks/GenRandomId-CMooMQt0.mjs";
|
|
4
4
|
import { n as normalizeComponent } from "../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs";
|
|
5
|
-
import { S as ScopeComponent } from "../chunks/ScopeComponent-
|
|
5
|
+
import { S as ScopeComponent } from "../chunks/ScopeComponent-CC0LPlVx.mjs";
|
|
6
6
|
const inputDateTypes = ["date", "datetime-local", "month", "time", "week"];
|
|
7
7
|
const _sfc_main = {
|
|
8
8
|
name: "NcDateTimePickerNative",
|
|
@@ -133,8 +133,7 @@ const _sfc_main = {
|
|
|
133
133
|
/**
|
|
134
134
|
* Handle the input event
|
|
135
135
|
*
|
|
136
|
-
* @param {InputEvent} $event input event
|
|
137
|
-
* @return {Date|string} new chosen Date() or an empty string
|
|
136
|
+
* @param {InputEvent} $event input event payloads
|
|
138
137
|
*/
|
|
139
138
|
input: ($event) => {
|
|
140
139
|
if (isNaN($event.target.valueAsNumber)) {
|
|
@@ -223,7 +222,7 @@ var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
|
223
222
|
_sfc_staticRenderFns,
|
|
224
223
|
false,
|
|
225
224
|
null,
|
|
226
|
-
"
|
|
225
|
+
"9e776556"
|
|
227
226
|
);
|
|
228
227
|
const NcDateTimePickerNative = __component__.exports;
|
|
229
228
|
ScopeComponent(NcDateTimePickerNative);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcDateTimePickerNative.mjs","sources":["../../src/components/NcDateTimePickerNative/NcDateTimePickerNative.vue","../../src/components/NcDateTimePickerNative/index.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 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 provides a wrapper around the native browser datetime picker. <br>\nThis is an input with some type of date e.g. https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type=datetime-local). <br>\nAll available types are: 'date', 'datetime-local', 'month', 'time' and 'week', please check them here: https://html.spec.whatwg.org/multipage/input.html# <br>\n\n### Examples\n\n```vue\n<template>\n\t<div>\n\t\t<span>Picked date: {{ value || 'null' }}</span>\n\t\t<hr/>\n\t\t<div class=\"flex\">\n\t\t\t<NcSelect v-bind=\"props\" v-model=\"type\" />\n\t\t\t<NcDateTimePickerNative\n\t\t\t\tv-model=\"value\"\n\t\t\t\t:label=\"label\"\n\t\t\t\t:type=\"type\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tprops: {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tinputLabel: 'Picker type',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t'date',\n\t\t\t\t\t\t'datetime-local',\n\t\t\t\t\t\t'month',\n\t\t\t\t\t\t'time',\n\t\t\t\t\t\t'week',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\ttype: 'datetime-local',\n\t\t\t\tvalue: new Date(),\n\t\t\t\tlabel: 'Select a new date or time',\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style scoped>\n.flex {\n\tdisplay: flex;\n\tgap: 4px;\n}\n</style>\n```\n\n#### Usage: type='datetime-local' with min date and max date\n```vue\n<template>\n\t<div>\n\t\t<span>Picked date: {{ value || 'null' }}</span>\n\t\t<NcDateTimePickerNative\n\t\t\tv-model=\"value\"\n\t\t\t:min=\"yesterdayDate\"\n\t\t\t:max=\"someDate\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"datetime-local\" />\n\t</div>\n</template>\n\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tvalue: new Date(),\n\t\t\t\tlabel: 'please select a new date',\n\t\t\t\tyesterdayDate: new Date(new Date().setDate(new Date().getDate() - 1)),\n\t\t\t\tsomeDate: new Date(new Date().setDate(new Date().getDate() + 7)),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"native-datetime-picker\">\n\t\t<label class=\"native-datetime-picker--label\"\n\t\t\t:class=\"{ 'hidden-visually': hideLabel }\"\n\t\t\t:for=\"id\">\n\t\t\t{{ label }}\n\t\t</label>\n\t\t<input :id=\"id\"\n\t\t\tclass=\"native-datetime-picker--input\"\n\t\t\t:class=\"inputClass\"\n\t\t\t:type=\"type\"\n\t\t\t:value=\"formattedValue\"\n\t\t\t:min=\"formattedMin\"\n\t\t\t:max=\"formattedMax\"\n\t\t\tv-bind=\"$attrs\"\n\t\t\tv-on=\"listeners\">\n\t</div>\n</template>\n\n<script>\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nconst inputDateTypes = ['date', 'datetime-local', 'month', 'time', 'week']\n\nexport default {\n\tname: 'NcDateTimePickerNative',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Date,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * The date is – like the `Date` object in JavaScript – tied to UTC.\n\t\t * The selected time zone does not have an influence of the selected time and date value.\n\t\t * You have to translate the time yourself when you want to factor in time zones.\n\t\t * Pass null to clear the input field.\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: Date,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the input field\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'date-time-picker-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\t\t/**\n\t\t * type attribute of the input field\n\t\t * default type: String\n\t\t * The type of the input element, it can be `date`, `datetime-local`, `month`, `time`, `week`\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'date',\n\t\t\tvalidate: (name) => inputDateTypes.includes(name),\n\t\t},\n\t\t/**\n\t\t * text inside the label element\n\t\t * default type: String\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: 'Please choose a date',\n\t\t},\n\t\t/**\n\t\t * min attribute of the input field\n\t\t * default type: null\n\t\t */\n\t\tmin: {\n\t\t\ttype: [Date, Boolean],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * max attribute of the input field\n\t\t * default type: null\n\t\t */\n\t\tmax: {\n\t\t\ttype: [Date, Boolean],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * Flag to hide the label\n\t\t * default type: String\n\t\t * The hidden input label for accessibility purposes.\n\t\t */\n\t\thideLabel: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Class to add to the input field.\n\t\t * Necessary to use NcDateTimePickerNative in the NcActionInput component.\n\t\t */\n\t\tinputClass: {\n\t\t\ttype: [Object, String],\n\t\t\tdefault: '',\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'input',\n\t\t/**\n\t\t * Emitted when the input value changes\n\t\t *\n\t\t * @return {Date} new chosen Date()\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', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tformattedValue() {\n\t\t\treturn this.formatValue(this.model)\n\t\t},\n\t\tformattedMin() {\n\t\t\tif (this.min) {\n\t\t\t\treturn this.formatValue(this.min)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tformattedMax() {\n\t\t\tif (this.max) {\n\t\t\t\treturn this.formatValue(this.max)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tlisteners() {\n\t\t\treturn {\n\t\t\t\t...this.$listeners,\n\t\t\t\t/**\n\t\t\t\t * Handle the input event\n\t\t\t\t *\n\t\t\t\t * @param {InputEvent} $event input event payload\n\t\t\t\t * @return {Date|string} new chosen Date() or an empty string\n\t\t\t\t */\n\t\t\t\tinput: ($event) => {\n\t\t\t\t\tif (isNaN($event.target.valueAsNumber)) {\n\t\t\t\t\t\tthis.model = null\n\t\t\t\t\t} else if (this.type === 'time') {\n\t\t\t\t\t\tconst time = $event.target.value\n\t\t\t\t\t\tif (this.model === '') {\n\t\t\t\t\t\t\t// this case is because of Chrome bug\n\t\t\t\t\t\t\tconst { yyyy, MM, dd } = this.getReadableDate(new Date())\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Emitted when the input value changes\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @return {Date} new chosen Date()\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst { yyyy, MM, dd } = this.getReadableDate(this.model)\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this.type === 'month') {\n\t\t\t\t\t\tconst MM = (new Date($event.target.value).getMonth() + 1).toString().padStart(2, '0')\n\t\t\t\t\t\tif (this.model === '') {\n\t\t\t\t\t\t\tconst { yyyy, dd, hh, mm } = this.getReadableDate(new Date())\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst { yyyy, dd, hh, mm } = this.getReadableDate(this.model)\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst timezoneOffsetSeconds = new Date($event.target.valueAsNumber).getTimezoneOffset() * 1000 * 60\n\t\t\t\t\t\tconst inputDateWithTimezone = $event.target.valueAsNumber + timezoneOffsetSeconds\n\t\t\t\t\t\tthis.model = new Date(inputDateWithTimezone)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Returns Object with string values of a Date\n\t\t *\n\t\t * @param {Date} value The selected value\n\t\t * @return {object|undefined}\n\t\t */\n\t\tgetReadableDate(value) {\n\t\t\tif (value instanceof Date) {\n\t\t\t\tconst yyyy = value.getFullYear().toString().padStart(4, '0')\n\t\t\t\tconst MM = (value.getMonth() + 1).toString().padStart(2, '0')\n\t\t\t\tconst dd = value.getDate().toString().padStart(2, '0')\n\t\t\t\tconst hh = value.getHours().toString().padStart(2, '0')\n\t\t\t\tconst mm = value.getMinutes().toString().padStart(2, '0')\n\n\t\t\t\treturn { yyyy, MM, dd, hh, mm }\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Returns preformatted value for the input field\n\t\t *\n\t\t * @param {Date} value The selected value\n\t\t * @return {string|undefined}\n\t\t */\n\t\tformatValue(value) {\n\t\t\tif (value instanceof Date) {\n\t\t\t\tconst { yyyy, MM, dd, hh, mm } = this.getReadableDate(value)\n\t\t\t\tif (this.type === 'datetime-local') {\n\t\t\t\t\treturn `${yyyy}-${MM}-${dd}T${hh}:${mm}`\n\t\t\t\t} else if (this.type === 'date') {\n\t\t\t\t\treturn `${yyyy}-${MM}-${dd}`\n\t\t\t\t} else if (this.type === 'month') {\n\t\t\t\t\treturn `${yyyy}-${MM}`\n\t\t\t\t} else if (this.type === 'time') {\n\t\t\t\t\treturn `${hh}:${mm}`\n\t\t\t\t} else if (this.type === 'week') {\n\t\t\t\t\tconst startDate = new Date(yyyy, 0, 1)\n\t\t\t\t\tconst daysSinceBeginningOfYear = Math.floor((value - startDate)\n\t\t\t\t\t\t/ (24 * 60 * 60 * 1000))\n\t\t\t\t\tconst weekNumber = Math.ceil(daysSinceBeginningOfYear / 7)\n\t\t\t\t\treturn `${yyyy}-W${weekNumber}`\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\t.native-datetime-picker {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t.native-datetime-picker .native-datetime-picker--label {\n\t\tmargin-block-end: 2px;\n\t}\n\n\t.native-datetime-picker .native-datetime-picker--input {\n\t\t// If border width differs between focused and unfocused we need to compensate to prevent jumping\n\t\t--input-border-width-offset: calc(var(--border-width-input-focused, 2px) - var(--border-width-input, 2px));\n\t\twidth: 100%;\n\t\tflex: 0 0 auto;\n\t\tmargin: 0;\n\t\tpadding-inline-start: calc(var(--border-radius-large) + var(--input-border-width-offset));\n\t\tpadding-inline-end: calc(var(--default-grid-baseline) + var(--input-border-width-offset));\n\t\tborder: var(--border-width-input, 2px) solid var(--color-border-maxcontrast);\n\n\t\t&:active:not([disabled]),\n\t\t&:hover:not([disabled]),\n\t\t&:focus:not([disabled]),\n\t\t&:focus-within:not([disabled]) {\n\t\t\tborder-color: var(--color-main-text);\n\t\t\tborder-width: var(--border-width-input-focused, 2px);\n\t\t\tbox-shadow: 0 0 0 2px var(--color-main-background) !important;\n\t\t\t// Reset padding offset when focused\n\t\t\t--input-border-width-offset: 0px;\n\t\t}\n\t}\n\n\t[data-theme-light],\n\t[data-themes*=light] {\n\t\t.native-datetime-picker--input {\n\t\t\tcolor-scheme: light;\n\t\t}\n\t}\n\n\t[data-theme-dark],\n\t[data-themes*=dark] {\n\t\t.native-datetime-picker--input {\n\t\t\tcolor-scheme: dark;\n\t\t}\n\t}\n\n\t[data-theme-default],\n\t[data-themes*=default] {\n\t\t@media (prefers-color-scheme: light) {\n\t\t\t.native-datetime-picker--input {\n\t\t\t\tcolor-scheme: light;\n\t\t\t}\n\t\t}\n\t\t@media (prefers-color-scheme: dark) {\n\t\t\t.native-datetime-picker--input {\n\t\t\t\tcolor-scheme: dark;\n\t\t\t}\n\t\t}\n\t}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport NcDateTimePickerNative from './NcDateTimePickerNative.vue'\nimport ScopeComponent from '../../utils/ScopeComponent.js'\n\nScopeComponent(NcDateTimePickerNative)\n\nexport default NcDateTimePickerNative\n"],"names":[],"mappings":";;;;AA+GA,MAAA,iBAAA,CAAA,QAAA,kBAAA,SAAA,QAAA,MAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,sBAAA,YAAA;AAAA,MACA,WAAA,QAAA,GAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA,CAAA,SAAA,eAAA,SAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAA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|
|
1
|
+
{"version":3,"file":"NcDateTimePickerNative.mjs","sources":["../../src/components/NcDateTimePickerNative/NcDateTimePickerNative.vue","../../src/components/NcDateTimePickerNative/index.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 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 provides a wrapper around the native browser datetime picker. <br>\nThis is an input with some type of date e.g. https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type=datetime-local). <br>\nAll available types are: 'date', 'datetime-local', 'month', 'time' and 'week', please check them here: https://html.spec.whatwg.org/multipage/input.html# <br>\n\n### Examples\n\n```vue\n<template>\n\t<div>\n\t\t<span>Picked date: {{ value || 'null' }}</span>\n\t\t<hr/>\n\t\t<div class=\"flex\">\n\t\t\t<NcSelect v-bind=\"props\" v-model=\"type\" />\n\t\t\t<NcDateTimePickerNative\n\t\t\t\tv-model=\"value\"\n\t\t\t\t:label=\"label\"\n\t\t\t\t:type=\"type\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tprops: {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tinputLabel: 'Picker type',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t'date',\n\t\t\t\t\t\t'datetime-local',\n\t\t\t\t\t\t'month',\n\t\t\t\t\t\t'time',\n\t\t\t\t\t\t'week',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\ttype: 'datetime-local',\n\t\t\t\tvalue: new Date(),\n\t\t\t\tlabel: 'Select a new date or time',\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style scoped>\n.flex {\n\tdisplay: flex;\n\tgap: 4px;\n}\n</style>\n```\n\n#### Usage: type='datetime-local' with min date and max date\n```vue\n<template>\n\t<div>\n\t\t<span>Picked date: {{ value || 'null' }}</span>\n\t\t<NcDateTimePickerNative\n\t\t\tv-model=\"value\"\n\t\t\t:min=\"yesterdayDate\"\n\t\t\t:max=\"someDate\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"datetime-local\" />\n\t</div>\n</template>\n\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tvalue: new Date(),\n\t\t\t\tlabel: 'please select a new date',\n\t\t\t\tyesterdayDate: new Date(new Date().setDate(new Date().getDate() - 1)),\n\t\t\t\tsomeDate: new Date(new Date().setDate(new Date().getDate() + 7)),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"native-datetime-picker\">\n\t\t<label class=\"native-datetime-picker--label\"\n\t\t\t:class=\"{ 'hidden-visually': hideLabel }\"\n\t\t\t:for=\"id\">\n\t\t\t{{ label }}\n\t\t</label>\n\t\t<input :id=\"id\"\n\t\t\tclass=\"native-datetime-picker--input\"\n\t\t\t:class=\"inputClass\"\n\t\t\t:type=\"type\"\n\t\t\t:value=\"formattedValue\"\n\t\t\t:min=\"formattedMin\"\n\t\t\t:max=\"formattedMax\"\n\t\t\tv-bind=\"$attrs\"\n\t\t\tv-on=\"listeners\">\n\t</div>\n</template>\n\n<script>\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nconst inputDateTypes = ['date', 'datetime-local', 'month', 'time', 'week']\n\nexport default {\n\tname: 'NcDateTimePickerNative',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Date,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * The date is – like the `Date` object in JavaScript – tied to UTC.\n\t\t * The selected time zone does not have an influence of the selected time and date value.\n\t\t * You have to translate the time yourself when you want to factor in time zones.\n\t\t * Pass null to clear the input field.\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: Date,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the input field\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'date-time-picker-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\t\t/**\n\t\t * type attribute of the input field\n\t\t * default type: String\n\t\t * The type of the input element, it can be `date`, `datetime-local`, `month`, `time`, `week`\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'date',\n\t\t\tvalidate: (name) => inputDateTypes.includes(name),\n\t\t},\n\t\t/**\n\t\t * text inside the label element\n\t\t * default type: String\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: 'Please choose a date',\n\t\t},\n\t\t/**\n\t\t * min attribute of the input field\n\t\t * default type: null\n\t\t */\n\t\tmin: {\n\t\t\ttype: [Date, Boolean],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * max attribute of the input field\n\t\t * default type: null\n\t\t */\n\t\tmax: {\n\t\t\ttype: [Date, Boolean],\n\t\t\tdefault: null,\n\t\t},\n\t\t/**\n\t\t * Flag to hide the label\n\t\t * default type: String\n\t\t * The hidden input label for accessibility purposes.\n\t\t */\n\t\thideLabel: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Class to add to the input field.\n\t\t * Necessary to use NcDateTimePickerNative in the NcActionInput component.\n\t\t */\n\t\tinputClass: {\n\t\t\ttype: [Object, String],\n\t\t\tdefault: '',\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'input',\n\t\t/**\n\t\t * Emitted when the input value changes\n\t\t *\n\t\t * @return {Date} new chosen Date()\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', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tformattedValue() {\n\t\t\treturn this.formatValue(this.model)\n\t\t},\n\t\tformattedMin() {\n\t\t\tif (this.min) {\n\t\t\t\treturn this.formatValue(this.min)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tformattedMax() {\n\t\t\tif (this.max) {\n\t\t\t\treturn this.formatValue(this.max)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tlisteners() {\n\t\t\treturn {\n\t\t\t\t...this.$listeners,\n\t\t\t\t/**\n\t\t\t\t * Handle the input event\n\t\t\t\t *\n\t\t\t\t * @param {InputEvent} $event input event payloads\n\t\t\t\t */\n\t\t\t\tinput: ($event) => {\n\t\t\t\t\tif (isNaN($event.target.valueAsNumber)) {\n\t\t\t\t\t\tthis.model = null\n\t\t\t\t\t} else if (this.type === 'time') {\n\t\t\t\t\t\tconst time = $event.target.value\n\t\t\t\t\t\tif (this.model === '') {\n\t\t\t\t\t\t\t// this case is because of Chrome bug\n\t\t\t\t\t\t\tconst { yyyy, MM, dd } = this.getReadableDate(new Date())\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Emitted when the input value changes\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @return {Date} new chosen Date()\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst { yyyy, MM, dd } = this.getReadableDate(this.model)\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this.type === 'month') {\n\t\t\t\t\t\tconst MM = (new Date($event.target.value).getMonth() + 1).toString().padStart(2, '0')\n\t\t\t\t\t\tif (this.model === '') {\n\t\t\t\t\t\t\tconst { yyyy, dd, hh, mm } = this.getReadableDate(new Date())\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst { yyyy, dd, hh, mm } = this.getReadableDate(this.model)\n\t\t\t\t\t\t\tthis.model = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst timezoneOffsetSeconds = new Date($event.target.valueAsNumber).getTimezoneOffset() * 1000 * 60\n\t\t\t\t\t\tconst inputDateWithTimezone = $event.target.valueAsNumber + timezoneOffsetSeconds\n\t\t\t\t\t\tthis.model = new Date(inputDateWithTimezone)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Returns Object with string values of a Date\n\t\t *\n\t\t * @param {Date} value The selected value\n\t\t * @return {object|undefined}\n\t\t */\n\t\tgetReadableDate(value) {\n\t\t\tif (value instanceof Date) {\n\t\t\t\tconst yyyy = value.getFullYear().toString().padStart(4, '0')\n\t\t\t\tconst MM = (value.getMonth() + 1).toString().padStart(2, '0')\n\t\t\t\tconst dd = value.getDate().toString().padStart(2, '0')\n\t\t\t\tconst hh = value.getHours().toString().padStart(2, '0')\n\t\t\t\tconst mm = value.getMinutes().toString().padStart(2, '0')\n\n\t\t\t\treturn { yyyy, MM, dd, hh, mm }\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Returns preformatted value for the input field\n\t\t *\n\t\t * @param {Date} value The selected value\n\t\t * @return {string|undefined}\n\t\t */\n\t\tformatValue(value) {\n\t\t\tif (value instanceof Date) {\n\t\t\t\tconst { yyyy, MM, dd, hh, mm } = this.getReadableDate(value)\n\t\t\t\tif (this.type === 'datetime-local') {\n\t\t\t\t\treturn `${yyyy}-${MM}-${dd}T${hh}:${mm}`\n\t\t\t\t} else if (this.type === 'date') {\n\t\t\t\t\treturn `${yyyy}-${MM}-${dd}`\n\t\t\t\t} else if (this.type === 'month') {\n\t\t\t\t\treturn `${yyyy}-${MM}`\n\t\t\t\t} else if (this.type === 'time') {\n\t\t\t\t\treturn `${hh}:${mm}`\n\t\t\t\t} else if (this.type === 'week') {\n\t\t\t\t\tconst startDate = new Date(yyyy, 0, 1)\n\t\t\t\t\tconst daysSinceBeginningOfYear = Math.floor((value - startDate)\n\t\t\t\t\t\t/ (24 * 60 * 60 * 1000))\n\t\t\t\t\tconst weekNumber = Math.ceil(daysSinceBeginningOfYear / 7)\n\t\t\t\t\treturn `${yyyy}-W${weekNumber}`\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\t.native-datetime-picker {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t.native-datetime-picker .native-datetime-picker--label {\n\t\tmargin-block-end: 2px;\n\t}\n\n\t.native-datetime-picker .native-datetime-picker--input {\n\t\t// If border width differs between focused and unfocused we need to compensate to prevent jumping\n\t\t--input-border-width-offset: calc(var(--border-width-input-focused, 2px) - var(--border-width-input, 2px));\n\t\twidth: 100%;\n\t\tflex: 0 0 auto;\n\t\tmargin: 0;\n\t\tpadding-inline-start: calc(var(--border-radius-large) + var(--input-border-width-offset));\n\t\tpadding-inline-end: calc(var(--default-grid-baseline) + var(--input-border-width-offset));\n\t\tborder: var(--border-width-input, 2px) solid var(--color-border-maxcontrast);\n\n\t\t&:active:not([disabled]),\n\t\t&:hover:not([disabled]),\n\t\t&:focus:not([disabled]),\n\t\t&:focus-within:not([disabled]) {\n\t\t\tborder-color: var(--color-main-text);\n\t\t\tborder-width: var(--border-width-input-focused, 2px);\n\t\t\tbox-shadow: 0 0 0 2px var(--color-main-background) !important;\n\t\t\t// Reset padding offset when focused\n\t\t\t--input-border-width-offset: 0px;\n\t\t}\n\t}\n\n\t[data-theme-light],\n\t[data-themes*=light] {\n\t\t.native-datetime-picker--input {\n\t\t\tcolor-scheme: light;\n\t\t}\n\t}\n\n\t[data-theme-dark],\n\t[data-themes*=dark] {\n\t\t.native-datetime-picker--input {\n\t\t\tcolor-scheme: dark;\n\t\t}\n\t}\n\n\t[data-theme-default],\n\t[data-themes*=default] {\n\t\t@media (prefers-color-scheme: light) {\n\t\t\t.native-datetime-picker--input {\n\t\t\t\tcolor-scheme: light;\n\t\t\t}\n\t\t}\n\t\t@media (prefers-color-scheme: dark) {\n\t\t\t.native-datetime-picker--input {\n\t\t\t\tcolor-scheme: dark;\n\t\t\t}\n\t\t}\n\t}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport NcDateTimePickerNative from './NcDateTimePickerNative.vue'\nimport ScopeComponent from '../../utils/ScopeComponent.js'\n\nScopeComponent(NcDateTimePickerNative)\n\nexport default NcDateTimePickerNative\n"],"names":[],"mappings":";;;;AA+GA,MAAA,iBAAA,CAAA,QAAA,kBAAA,SAAA,QAAA,MAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,sBAAA,YAAA;AAAA,MACA,WAAA,QAAA,GAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA,CAAA,SAAA,e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;;;;;;;;;;ACvUA,eAAe,sBAAsB;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require('../assets/NcEmptyContent-
|
|
1
|
+
require('../assets/NcEmptyContent-CHVEJoER.css');
|
|
2
2
|
"use strict";
|
|
3
3
|
const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-V0q-tHlQ.cjs");
|
|
4
4
|
const _sfc_main = {
|
|
@@ -48,7 +48,7 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
|
48
48
|
_sfc_staticRenderFns,
|
|
49
49
|
false,
|
|
50
50
|
null,
|
|
51
|
-
"
|
|
51
|
+
"8aaa3146"
|
|
52
52
|
);
|
|
53
53
|
const NcEmptyContent = __component__.exports;
|
|
54
54
|
module.exports = NcEmptyContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcEmptyContent.cjs","sources":["../../src/components/NcEmptyContent/NcEmptyContent.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Basic use\n\nUse this component to display a message about an empty content.\nProviding an icon, name, and a description is strongly advised.\n\n```\n<template>\n\t<NcEmptyContent name=\"No comments\"\n\t\tdescription=\"Start writing comments and they will appear here.\">\n\t\t<template #icon>\n\t\t\t<Comment />\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script>\nimport Comment from 'vue-material-design-icons/Comment.vue'\n\nexport default {\n\tcomponents: {\n\t\tComment,\n\t},\n}\n</script>\n```\n#### With custom svg\n\n```\n<template>\n\t<NcEmptyContent\n\t\tname=\"No files in here\">\n\t\t<template #icon>\n\t\t\t<NcIconSvgWrapper :svg=\"folderSvg\" />\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script>\nimport folderSvg from '@mdi/svg/svg/folder.svg?raw'\n\nexport default {\n\tcomponents: {\n\t\tComment,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfolderSvg,\n\t\t}\n\t},\n}\n</script>\n```\n\nYou can also customize the name using the `#name` slot\nand add actions. But to keep the style consistent across Nextcloud\nconsider only using header elements as the root elements for the name slot.\n\n```\n<template>\n\t<NcEmptyContent\n\t\tdescription=\"No comments in here\">\n\t\t<template #icon>\n\t\t\t<Comment />\n\t\t</template>\n\t\t<template #name>\n\t\t\t<h1 class=\"empty-content__name\">\n\t\t\t\tNo comments\n\t\t\t</h1>\n\t\t</template>\n\t\t<template #action>\n\t\t\t<NcButton variant=\"primary\">\n\t\t\t\tAdd a comment!\n\t\t\t</NcButton>\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script>\nimport Comment from 'vue-material-design-icons/Comment.vue'\n\nexport default {\n\tcomponents: {\n\t\tComment,\n\t},\n}\n</script>\n```\n\nSimilar to the `#name` slot, you could also use the `#description` slot.\nThe content will be rendered within a paragraph so you can use any inline element,\nlike a link.\n\n```\n<template>\n\t<NcEmptyContent\n\t\tname=\"No comments\">\n\t\t<template #icon>\n\t\t\t<Comment />\n\t\t</template>\n\t\t<template #description>\n\t\t\t<a href=\"https://en.wikipedia.org/wiki/Comment\">What is even a comment?</a>\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script>\nimport Comment from 'vue-material-design-icons/Comment.vue'\n\nexport default {\n\tcomponents: {\n\t\tComment,\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"empty-content\" role=\"note\">\n\t\t<div v-if=\"$slots.icon\" class=\"empty-content__icon\" aria-hidden=\"true\">\n\t\t\t<!-- @slot Optional material design icon -->\n\t\t\t<slot name=\"icon\" />\n\t\t</div>\n\t\t<!-- @slot Optional name if not set as property, shall be enclosed by a header element -->\n\t\t<slot name=\"name\">\n\t\t\t<span v-if=\"hasName\" class=\"empty-content__name\">\n\t\t\t\t{{ name }}\n\t\t\t</span>\n\t\t</slot>\n\t\t<p v-if=\"hasDescription\" class=\"empty-content__description\">\n\t\t\t<!-- @slot Optional formatted description rendered inside a paragraph -->\n\t\t\t<slot name=\"description\">\n\t\t\t\t{{ description }}\n\t\t\t</slot>\n\t\t</p>\n\t\t<div v-if=\"$slots.action\" class=\"empty-content__action\">\n\t\t\t<!-- @slot Optional slot for a button or the like -->\n\t\t\t<slot name=\"action\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcEmptyContent',\n\n\tprops: {\n\t\t/**\n\t\t * A header message about an empty content shown\n\t\t * @example 'No comments'\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Desription of the empty content\n\t\t * @example 'No comments yet, start the conversation!'\n\t\t */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tcomputed: {\n\t\thasName() {\n\t\t\treturn this.name !== ''\n\t\t},\n\t\t/**\n\t\t * Check if a description is given as either property or slot\n\t\t */\n\t\thasDescription() {\n\t\t\treturn this.description !== '' || this.$slots.description?.[0]\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.empty-content {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-direction: column;\n\tjustify-content: center;\n\t/* In case of using in a flex container - flex in advance */\n\tflex-grow: 1;\n\n\t.modal-wrapper & {\n\t\tmargin-top: 5vh;\n\t\tmargin-bottom: 5vh;\n\t}\n\n\t&__icon {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: 64px;\n\t\theight: 64px;\n\t\tmargin: 0 auto 15px;\n\t\topacity: .4;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t\tbackground-size: 64px;\n\n\t\t:deep(svg) {\n\t\t\twidth: 64px !important;\n\t\t\theight: 64px !important;\n\t\t\tmax-width: 64px !important;\n\t\t\tmax-height: 64px !important;\n\t\t}\n\t}\n\n\t&__name {\n\t\tmargin-bottom: 10px;\n\t\ttext-align: center;\n\t\tfont-weight: bold;\n\t\tfont-size: 20px;\n\t\tline-height: 30px;\n\t}\n\n\t&__description {\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t&__action {\n\t\tmargin-top: 8px;\n\n\t\t.modal-wrapper & {\n\t\t\tmargin-top: 20px;\n\t\t\tdisplay: flex;\n\t\t}\n\t}\n}\n</style>\n"],"names":[],"mappings":";;AAqJA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,UAAA;AACA,aAAA,KAAA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,iBAAA;AACA,aAAA,KAAA,gBAAA,MAAA,KAAA,OAAA,cAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcEmptyContent.cjs","sources":["../../src/components/NcEmptyContent/NcEmptyContent.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Basic use\n\nUse this component to display a message about an empty content.\nProviding an icon, name, and a description is strongly advised.\n\n```\n<template>\n\t<NcEmptyContent name=\"No comments\"\n\t\tdescription=\"Start writing comments and they will appear here.\">\n\t\t<template #icon>\n\t\t\t<Comment />\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script>\nimport Comment from 'vue-material-design-icons/Comment.vue'\n\nexport default {\n\tcomponents: {\n\t\tComment,\n\t},\n}\n</script>\n```\n#### With custom svg\n\n```\n<template>\n\t<NcEmptyContent\n\t\tname=\"No files in here\">\n\t\t<template #icon>\n\t\t\t<NcIconSvgWrapper :svg=\"folderSvg\" />\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script>\nimport folderSvg from '@mdi/svg/svg/folder.svg?raw'\n\nexport default {\n\tcomponents: {\n\t\tComment,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfolderSvg,\n\t\t}\n\t},\n}\n</script>\n```\n\nYou can also customize the name using the `#name` slot\nand add actions. But to keep the style consistent across Nextcloud\nconsider only using header elements as the root elements for the name slot.\n\n```\n<template>\n\t<NcEmptyContent\n\t\tdescription=\"No comments in here\">\n\t\t<template #icon>\n\t\t\t<Comment />\n\t\t</template>\n\t\t<template #name>\n\t\t\t<h1 class=\"empty-content__name\">\n\t\t\t\tNo comments\n\t\t\t</h1>\n\t\t</template>\n\t\t<template #action>\n\t\t\t<NcButton variant=\"primary\">\n\t\t\t\tAdd a comment!\n\t\t\t</NcButton>\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script>\nimport Comment from 'vue-material-design-icons/Comment.vue'\n\nexport default {\n\tcomponents: {\n\t\tComment,\n\t},\n}\n</script>\n```\n\nSimilar to the `#name` slot, you could also use the `#description` slot.\nThe content will be rendered within a paragraph so you can use any inline element,\nlike a link.\n\n```\n<template>\n\t<NcEmptyContent\n\t\tname=\"No comments\">\n\t\t<template #icon>\n\t\t\t<Comment />\n\t\t</template>\n\t\t<template #description>\n\t\t\t<a href=\"https://en.wikipedia.org/wiki/Comment\">What is even a comment?</a>\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script>\nimport Comment from 'vue-material-design-icons/Comment.vue'\n\nexport default {\n\tcomponents: {\n\t\tComment,\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div class=\"empty-content\" role=\"note\">\n\t\t<div v-if=\"$slots.icon\" class=\"empty-content__icon\" aria-hidden=\"true\">\n\t\t\t<!-- @slot Optional material design icon -->\n\t\t\t<slot name=\"icon\" />\n\t\t</div>\n\t\t<!-- @slot Optional name if not set as property, shall be enclosed by a header element -->\n\t\t<slot name=\"name\">\n\t\t\t<span v-if=\"hasName\" class=\"empty-content__name\">\n\t\t\t\t{{ name }}\n\t\t\t</span>\n\t\t</slot>\n\t\t<p v-if=\"hasDescription\" class=\"empty-content__description\">\n\t\t\t<!-- @slot Optional formatted description rendered inside a paragraph -->\n\t\t\t<slot name=\"description\">\n\t\t\t\t{{ description }}\n\t\t\t</slot>\n\t\t</p>\n\t\t<div v-if=\"$slots.action\" class=\"empty-content__action\">\n\t\t\t<!-- @slot Optional slot for a button or the like -->\n\t\t\t<slot name=\"action\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcEmptyContent',\n\n\tprops: {\n\t\t/**\n\t\t * A header message about an empty content shown\n\t\t * @example 'No comments'\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Desription of the empty content\n\t\t * @example 'No comments yet, start the conversation!'\n\t\t */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tcomputed: {\n\t\thasName() {\n\t\t\treturn this.name !== ''\n\t\t},\n\t\t/**\n\t\t * Check if a description is given as either property or slot\n\t\t */\n\t\thasDescription() {\n\t\t\treturn this.description !== '' || this.$slots.description?.[0]\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.empty-content {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-direction: column;\n\tjustify-content: center;\n\t/* In case of using in a flex container - flex in advance */\n\tflex-grow: 1;\n\tpadding: var(--default-grid-baseline);\n\n\t.modal-wrapper & {\n\t\tmargin-top: 5vh;\n\t\tmargin-bottom: 5vh;\n\t}\n\n\t&__icon {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: 64px;\n\t\theight: 64px;\n\t\tmargin: 0 auto 15px;\n\t\topacity: .4;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t\tbackground-size: 64px;\n\n\t\t:deep(svg) {\n\t\t\twidth: 64px !important;\n\t\t\theight: 64px !important;\n\t\t\tmax-width: 64px !important;\n\t\t\tmax-height: 64px !important;\n\t\t}\n\t}\n\n\t&__name {\n\t\tmargin-bottom: 10px;\n\t\ttext-align: center;\n\t\tfont-weight: bold;\n\t\tfont-size: 20px;\n\t\tline-height: 30px;\n\t}\n\n\t&__description {\n\t\tcolor: var(--color-text-maxcontrast);\n\t\ttext-align: center;\n\t\ttext-wrap-style: balance;\n\t}\n\n\t&__action {\n\t\tmargin-top: 8px;\n\n\t\t.modal-wrapper & {\n\t\t\tmargin-top: 20px;\n\t\t\tdisplay: flex;\n\t\t}\n\t}\n}\n</style>\n"],"names":[],"mappings":";;AAqJA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,UAAA;AACA,aAAA,KAAA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,iBAAA;AACA,aAAA,KAAA,gBAAA,MAAA,KAAA,OAAA,cAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;"}
|