@nextcloud/vue 9.1.0 → 9.3.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 +90 -0
- package/dist/assets/{NcActions-Bqx-6r2h.css → NcActions-DneK-9R2.css} +11 -11
- package/dist/assets/{NcAppContent-r_MkL84m.css → NcAppContent-HF21N7dO.css} +19 -19
- package/dist/assets/{NcAppNavigation-Br6xragy.css → NcAppNavigation-f2zUqaiQ.css} +12 -12
- package/dist/assets/{NcAppNavigationItem-6ZUh2hMu.css → NcAppNavigationItem-D97Onpd9.css} +36 -36
- package/dist/assets/{NcAppNavigationSearch-CUSlFbdJ.css → NcAppNavigationSearch-BH8hBjGe.css} +5 -5
- package/dist/assets/{NcAppSettingsDialog-Dcv235GW.css → NcAppSettingsDialog-Dz8uBPgu.css} +36 -10
- package/dist/assets/NcAppSettingsSection-ObwpPdgW.css +46 -0
- package/dist/assets/{NcAppSidebar-aGrIJ9f6.css → NcAppSidebar-krHtMwId.css} +44 -44
- package/dist/assets/{NcAvatar-BvgSFJqT.css → NcAvatar-f8SJKMDw.css} +24 -24
- package/dist/assets/{NcButton-BjcEkfk2.css → NcButton-DtYLJgG8.css} +48 -48
- package/dist/assets/{NcChip-T6s7HqeL.css → NcChip-DZ8dUSFy.css} +12 -12
- package/dist/assets/{NcDashboardWidget-DD06i7ws.css → NcDashboardWidget-DFY9GRrd.css} +12 -12
- package/dist/assets/{NcDateTimePicker-DW0b4W9D.css → NcDateTimePicker-DL6-rWSN.css} +8 -4
- package/dist/assets/NcFormBox-D-kcijXp.css +54 -0
- package/dist/assets/{NcAppSettingsSection-DIVdlb0g.css → NcFormBoxButton-C6EvdLK4.css} +13 -11
- package/dist/assets/NcFormBoxItem-BfXKp9xJ.css +88 -0
- package/dist/assets/NcFormBoxSwitch-BmyNQCbA.css +37 -0
- package/dist/assets/NcFormGroup-BrD0Scm7.css +43 -0
- package/dist/assets/{NcHotkey-QklVKSyr.css → NcHotkey-4yi1Hobg.css} +10 -9
- package/dist/assets/NcHotkeyList-gAZN0WIu.css +8 -0
- package/dist/assets/{NcIconSvgWrapper-D6qXQDNo.css → NcIconSvgWrapper-N3OwSN9O.css} +10 -10
- package/dist/assets/{NcInputField-D5SEE7D0.css → NcInputField-DCpslX7k.css} +40 -40
- package/dist/assets/{NcListItem-BRTO5Id3.css → NcListItem-CZnKmy9X.css} +41 -41
- package/dist/assets/{NcListItemIcon-OOjV0jWx.css → NcListItemIcon-aquns6B7.css} +13 -13
- package/dist/assets/{NcNoteCard-l5nIN9Hg.css → NcNoteCard-DZSuYX4-.css} +10 -10
- package/dist/assets/{NcPasswordField-CMuvrdVC.css → NcPasswordField-BCJ0LHSS.css} +2 -2
- package/dist/assets/NcRadioGroup-1zpSX8V5.css +21 -0
- package/dist/assets/{NcRadioGroupButton-qxDfssOp.css → NcRadioGroupButton-DRZ1_-yY.css} +11 -19
- package/dist/assets/{NcRelatedResourcesPanel-CZDNe7DZ.css → NcRelatedResourcesPanel-Bun35PUF.css} +7 -7
- package/dist/assets/{NcRichContenteditable-CPbTS8xJ.css → NcRichContenteditable-BuaWt3Xn.css} +11 -11
- package/dist/assets/{NcRichText-Bx--sR58.css → NcRichText-BwHm-gXR.css} +111 -88
- package/dist/assets/{NcTextArea-7C2JBozT.css → NcTextArea-BKVszZmQ.css} +25 -25
- package/dist/chunks/{NcActionButton-BAaRMesp.mjs → NcActionButton-DCWUru2b.mjs} +3 -3
- package/dist/chunks/{NcActionButton-BAaRMesp.mjs.map → NcActionButton-DCWUru2b.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-EyWT8pe-.mjs → NcActionButtonGroup-QgGuZcPA.mjs} +2 -2
- package/dist/chunks/{NcActionButtonGroup-EyWT8pe-.mjs.map → NcActionButtonGroup-QgGuZcPA.mjs.map} +1 -1
- package/dist/chunks/{NcActionInput-BaHXAvFo.mjs → NcActionInput-Bw4UxfFB.mjs} +6 -6
- package/dist/chunks/{NcActionInput-BaHXAvFo.mjs.map → NcActionInput-Bw4UxfFB.mjs.map} +1 -1
- package/dist/chunks/{NcActionTextEditable-CzI0V4-P.mjs → NcActionTextEditable-BQXCci7D.mjs} +3 -3
- package/dist/chunks/{NcActionTextEditable-CzI0V4-P.mjs.map → NcActionTextEditable-BQXCci7D.mjs.map} +1 -1
- package/dist/chunks/{NcActions-C-E6BGfZ.mjs → NcActions-B0kM6AYb.mjs} +23 -57
- package/dist/chunks/NcActions-B0kM6AYb.mjs.map +1 -0
- package/dist/chunks/{NcAppContent-Qg8YBJa7.mjs → NcAppContent-BbtKZp6w.mjs} +9 -18
- package/dist/chunks/NcAppContent-BbtKZp6w.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigation-BWd7-5H0.mjs → NcAppNavigation-CROkGlDE.mjs} +7 -7
- package/dist/chunks/NcAppNavigation-CROkGlDE.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationCaption-wzGkHPZs.mjs → NcAppNavigationCaption-CuGe5Mev.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationCaption-wzGkHPZs.mjs.map → NcAppNavigationCaption-CuGe5Mev.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-Cz_lEp5a.mjs → NcAppNavigationItem-DU-pLjwa.mjs} +9 -9
- package/dist/chunks/NcAppNavigationItem-DU-pLjwa.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationNew-Y50s6jTC.mjs → NcAppNavigationNew-DJbq5wr_.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationNew-Y50s6jTC.mjs.map → NcAppNavigationNew-DJbq5wr_.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-D-JsQf87.mjs → NcAppNavigationNewItem-CoRu6Q9O.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationNewItem-D-JsQf87.mjs.map → NcAppNavigationNewItem-CoRu6Q9O.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-BbXky-Un.mjs → NcAppNavigationSearch-DaIFceYy.mjs} +5 -5
- package/dist/chunks/NcAppNavigationSearch-DaIFceYy.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationSettings-CgRg-AbU.mjs → NcAppNavigationSettings-45tEbBBm.mjs} +5 -5
- package/dist/chunks/{NcAppNavigationSettings-CgRg-AbU.mjs.map → NcAppNavigationSettings-45tEbBBm.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-BZzj8jNU.mjs → NcAppSettingsDialog-lTULgn3p.mjs} +40 -12
- package/dist/chunks/NcAppSettingsDialog-lTULgn3p.mjs.map +1 -0
- package/dist/chunks/{NcAppSettingsSection-urZiy9aH.mjs → NcAppSettingsSection-B9R7enkC.mjs} +15 -8
- package/dist/chunks/NcAppSettingsSection-B9R7enkC.mjs.map +1 -0
- package/dist/chunks/{NcAppSettingsSectionShortcuts-CK8lXUxx.mjs → NcAppSettingsShortcutsSection-DIIuKYzs.mjs} +7 -7
- package/dist/chunks/{NcAppSettingsSectionShortcuts-CK8lXUxx.mjs.map → NcAppSettingsShortcutsSection-DIIuKYzs.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-Du9lcG-G.mjs → NcAppSidebar-X9ktYY0p.mjs} +6 -6
- package/dist/chunks/NcAppSidebar-X9ktYY0p.mjs.map +1 -0
- package/dist/chunks/{NcAssistantButton-BdYyxDoX.mjs → NcAssistantButton-BID8rRE5.mjs} +5 -5
- package/dist/chunks/{NcAssistantButton-BdYyxDoX.mjs.map → NcAssistantButton-BID8rRE5.mjs.map} +1 -1
- package/dist/chunks/{NcAssistantIcon-ClJKOiGi.mjs → NcAssistantIcon-BUvb4WNg.mjs} +2 -2
- package/dist/chunks/{NcAssistantIcon-ClJKOiGi.mjs.map → NcAssistantIcon-BUvb4WNg.mjs.map} +1 -1
- package/dist/chunks/{NcAvatar-CZVJYWdr.mjs → NcAvatar-Dxm05R6e.mjs} +27 -23
- package/dist/chunks/NcAvatar-Dxm05R6e.mjs.map +1 -0
- package/dist/chunks/{NcBreadcrumb-CkUvC1g0.mjs → NcBreadcrumb-CiM9xAAS.mjs} +3 -3
- package/dist/chunks/{NcBreadcrumb-CkUvC1g0.mjs.map → NcBreadcrumb-CiM9xAAS.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-Dx6ylWcp.mjs → NcBreadcrumbs-geMiBPkk.mjs} +4 -4
- package/dist/chunks/{NcBreadcrumbs-Dx6ylWcp.mjs.map → NcBreadcrumbs-geMiBPkk.mjs.map} +1 -1
- package/dist/chunks/{NcButton-DkC5k3Lb.mjs → NcButton-ZNHdqKQl.mjs} +3 -3
- package/dist/chunks/NcButton-ZNHdqKQl.mjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch-Da3UT5om.mjs → NcCheckboxRadioSwitch-6ty3DxEG.mjs} +2 -2
- package/dist/chunks/{NcCheckboxRadioSwitch-Da3UT5om.mjs.map → NcCheckboxRadioSwitch-6ty3DxEG.mjs.map} +1 -1
- package/dist/chunks/{NcChip-CIjgDRrf.mjs → NcChip-CFf0KxGk.mjs} +8 -8
- package/dist/chunks/NcChip-CFf0KxGk.mjs.map +1 -0
- package/dist/chunks/{NcCollectionList-DqNsOT7P.mjs → NcCollectionList-Ds-tmckn.mjs} +7 -7
- package/dist/chunks/{NcCollectionList-DqNsOT7P.mjs.map → NcCollectionList-Ds-tmckn.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-yoZ5ZWC3.mjs → NcColorPicker-BFcR9_1o.mjs} +6 -6
- package/dist/chunks/{NcColorPicker-yoZ5ZWC3.mjs.map → NcColorPicker-BFcR9_1o.mjs.map} +1 -1
- package/dist/chunks/{NcContent-DxKYTMfp.mjs → NcContent-BKKnoxxu.mjs} +4 -4
- package/dist/chunks/{NcContent-DxKYTMfp.mjs.map → NcContent-BKKnoxxu.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-Bu7bWoUK.mjs → NcDashboardWidget-cclUqUde.mjs} +7 -7
- package/dist/chunks/NcDashboardWidget-cclUqUde.mjs.map +1 -0
- package/dist/chunks/{NcDashboardWidgetItem-CJg0lrlx.mjs → NcDashboardWidgetItem-DM96gJkD.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-CJg0lrlx.mjs.map → NcDashboardWidgetItem-DM96gJkD.mjs.map} +1 -1
- package/dist/chunks/{NcDateTimePicker-DOwSKf9T.mjs → NcDateTimePicker-CYRbEpfY.mjs} +7 -7
- package/dist/chunks/{NcDateTimePicker-DOwSKf9T.mjs.map → NcDateTimePicker-CYRbEpfY.mjs.map} +1 -1
- package/dist/chunks/{NcDateTimePickerNative-BSKXbwuA.mjs → NcDateTimePickerNative-CR1Yx5Qp.mjs} +2 -2
- package/dist/chunks/{NcDateTimePickerNative-BSKXbwuA.mjs.map → NcDateTimePickerNative-CR1Yx5Qp.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-BgzJN2XT.mjs → NcDialog-BY-1v8yi.mjs} +3 -3
- package/dist/chunks/{NcDialog-BgzJN2XT.mjs.map → NcDialog-BY-1v8yi.mjs.map} +1 -1
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-D9ClaBcS.mjs → NcDialogButton.vue_vue_type_script_setup_true_lang-CF6LnBe7.mjs} +4 -4
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-D9ClaBcS.mjs.map → NcDialogButton.vue_vue_type_script_setup_true_lang-CF6LnBe7.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-CwR_8bCR.mjs → NcEmojiPicker-DMiiRPm1.mjs} +7 -7
- package/dist/chunks/{NcEmojiPicker-CwR_8bCR.mjs.map → NcEmojiPicker-DMiiRPm1.mjs.map} +1 -1
- package/dist/chunks/NcFormBox-K2tCRm3B.mjs +45 -0
- package/dist/chunks/NcFormBox-K2tCRm3B.mjs.map +1 -0
- package/dist/chunks/NcFormBoxButton-4XaQUTOS.mjs +145 -0
- package/dist/chunks/NcFormBoxButton-4XaQUTOS.mjs.map +1 -0
- package/dist/chunks/NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-DTWd7b52.mjs +53 -0
- package/dist/chunks/NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-DTWd7b52.mjs.map +1 -0
- package/dist/chunks/NcFormBoxItem-BBP76Mkf.mjs +97 -0
- package/dist/chunks/NcFormBoxItem-BBP76Mkf.mjs.map +1 -0
- package/dist/chunks/NcFormBoxSwitch-E6Ei7MFo.mjs +97 -0
- package/dist/chunks/NcFormBoxSwitch-E6Ei7MFo.mjs.map +1 -0
- package/dist/chunks/NcFormGroup-CnSfPFey.mjs +74 -0
- package/dist/chunks/NcFormGroup-CnSfPFey.mjs.map +1 -0
- package/dist/chunks/{NcHeaderButton-DafXYbXB.mjs → NcHeaderButton-tLfDELGu.mjs} +2 -2
- package/dist/chunks/{NcHeaderButton-DafXYbXB.mjs.map → NcHeaderButton-tLfDELGu.mjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-DfO7ghiM.mjs → NcHeaderMenu-ClRw0Xc5.mjs} +2 -2
- package/dist/chunks/{NcHeaderMenu-DfO7ghiM.mjs.map → NcHeaderMenu-ClRw0Xc5.mjs.map} +1 -1
- package/dist/chunks/{NcHotkey-V6s3DXUs.mjs → NcHotkey-Cya0WRKL.mjs} +7 -7
- package/dist/chunks/NcHotkey-Cya0WRKL.mjs.map +1 -0
- package/dist/chunks/{NcHotkeyList-Ck87UwvW.mjs → NcHotkeyList-B9C--U6a.mjs} +5 -5
- package/dist/chunks/NcHotkeyList-B9C--U6a.mjs.map +1 -0
- package/dist/chunks/{NcIconSvgWrapper-5AA93z-F.mjs → NcIconSvgWrapper-BvLanNaW.mjs} +4 -4
- package/dist/chunks/NcIconSvgWrapper-BvLanNaW.mjs.map +1 -0
- package/dist/chunks/{NcInputConfirmCancel-Zkh97f-3.mjs → NcInputConfirmCancel-Brw2dsPI.mjs} +3 -3
- package/dist/chunks/{NcInputConfirmCancel-Zkh97f-3.mjs.map → NcInputConfirmCancel-Brw2dsPI.mjs.map} +1 -1
- package/dist/chunks/{NcInputField-By_D1kDJ.mjs → NcInputField-z8wpYKt2.mjs} +11 -9
- package/dist/chunks/NcInputField-z8wpYKt2.mjs.map +1 -0
- package/dist/chunks/{NcKbd-CyqxbpJJ.mjs → NcKbd-D6pM7aJM.mjs} +2 -2
- package/dist/chunks/{NcKbd-CyqxbpJJ.mjs.map → NcKbd-D6pM7aJM.mjs.map} +1 -1
- package/dist/chunks/{NcListItem-z4qAtAqe.mjs → NcListItem-D5AkAxDh.mjs} +9 -10
- package/dist/chunks/NcListItem-D5AkAxDh.mjs.map +1 -0
- package/dist/chunks/{NcListItemIcon-BVr_U7S4.mjs → NcListItemIcon-D_ReDycv.mjs} +5 -5
- package/dist/chunks/NcListItemIcon-D_ReDycv.mjs.map +1 -0
- package/dist/chunks/{NcModal-CvHjwuUy.mjs → NcModal-DZtBQM1y.mjs} +7 -7
- package/dist/chunks/{NcModal-CvHjwuUy.mjs.map → NcModal-DZtBQM1y.mjs.map} +1 -1
- package/dist/chunks/{NcNoteCard-BomepG0z.mjs → NcNoteCard-C6JdnZUp.mjs} +5 -5
- package/dist/chunks/NcNoteCard-C6JdnZUp.mjs.map +1 -0
- package/dist/chunks/{NcPasswordField-DroBJzYE.mjs → NcPasswordField-BquWP0Di.mjs} +11 -8
- package/dist/chunks/NcPasswordField-BquWP0Di.mjs.map +1 -0
- package/dist/chunks/NcRadioGroup-CLtk-WPR.mjs +75 -0
- package/dist/chunks/NcRadioGroup-CLtk-WPR.mjs.map +1 -0
- package/dist/chunks/{NcRadioGroupButton-BNydXurR.mjs → NcRadioGroupButton-CDA5i7Dq.mjs} +11 -9
- package/dist/chunks/NcRadioGroupButton-CDA5i7Dq.mjs.map +1 -0
- package/dist/chunks/{NcRelatedResourcesPanel-1oVpr5Oh.mjs → NcRelatedResourcesPanel-DPwZ4SSu.mjs} +8 -8
- package/dist/chunks/NcRelatedResourcesPanel-DPwZ4SSu.mjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-D-GPJR9c.mjs → NcRichContenteditable-ClUiBH9B.mjs} +18 -15
- package/dist/chunks/{NcRichContenteditable-D-GPJR9c.mjs.map → NcRichContenteditable-ClUiBH9B.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-CETsOVBU.mjs → NcRichText-DamxfqDV.mjs} +47 -8
- package/dist/chunks/NcRichText-DamxfqDV.mjs.map +1 -0
- package/dist/chunks/{NcSelect-BUPzYWtk.mjs → NcSelect-Ba00b95n.mjs} +2 -2
- package/dist/chunks/{NcSelect-BUPzYWtk.mjs.map → NcSelect-Ba00b95n.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-Cu7fqEPC.mjs → NcSelectTags-DAxQe-10.mjs} +3 -3
- package/dist/chunks/{NcSelectTags-Cu7fqEPC.mjs.map → NcSelectTags-DAxQe-10.mjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-C3w6sjP5.mjs → NcSelectUsers-DlE8EHdq.mjs} +3 -3
- package/dist/chunks/{NcSelectUsers-C3w6sjP5.mjs.map → NcSelectUsers-DlE8EHdq.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-DFav6ob5.mjs → NcSettingsSection-BfK7eHNT.mjs} +2 -2
- package/dist/chunks/{NcSettingsSection-DFav6ob5.mjs.map → NcSettingsSection-BfK7eHNT.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-DOiWF5XH.mjs → NcSettingsSelectGroup-CO8dnQ6q.mjs} +4 -4
- package/dist/chunks/{NcSettingsSelectGroup-DOiWF5XH.mjs.map → NcSettingsSelectGroup-CO8dnQ6q.mjs.map} +1 -1
- package/dist/chunks/{NcTextArea-CKK_gfIE.mjs → NcTextArea-Cr27-KiU.mjs} +9 -7
- package/dist/chunks/NcTextArea-Cr27-KiU.mjs.map +1 -0
- package/dist/chunks/{NcTextField.vue_vue_type_script_setup_true_lang-DVAnIMOA.mjs → NcTextField.vue_vue_type_script_setup_true_lang-BNSMSqMx.mjs} +5 -5
- package/dist/chunks/NcTextField.vue_vue_type_script_setup_true_lang-BNSMSqMx.mjs.map +1 -0
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-C2YnFWvf.mjs → NcTimezonePicker.vue_vue_type_script_setup_true_lang-CVehmrmz.mjs} +3 -3
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-C2YnFWvf.mjs.map → NcTimezonePicker.vue_vue_type_script_setup_true_lang-CVehmrmz.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-CM66IyhS.mjs → NcUserBubble-DEW575GR.mjs} +2 -2
- package/dist/chunks/{NcUserBubble-CM66IyhS.mjs.map → NcUserBubble-DEW575GR.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-DWB8QUZh.mjs → NcUserStatusIcon-DHHqIgRK.mjs} +2 -2
- package/dist/chunks/{NcUserStatusIcon-DWB8QUZh.mjs.map → NcUserStatusIcon-DHHqIgRK.mjs.map} +1 -1
- package/dist/chunks/{_l10n-YZMLsK4O.mjs → _l10n-CWKr1fUH.mjs} +51 -49
- package/dist/chunks/_l10n-CWKr1fUH.mjs.map +1 -0
- package/dist/chunks/appName-DtnLUijR.mjs +41 -0
- package/dist/chunks/appName-DtnLUijR.mjs.map +1 -0
- package/dist/chunks/{colors-DhEYXS0_.mjs → colors-BM9KkzNS.mjs} +2 -2
- package/dist/chunks/{colors-DhEYXS0_.mjs.map → colors-BM9KkzNS.mjs.map} +1 -1
- package/dist/chunks/{mdi-Cjx8NyEs.mjs → mdi-HQ-WBPmL.mjs} +32 -22
- package/dist/chunks/{mdi-Cjx8NyEs.mjs.map → mdi-HQ-WBPmL.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-CseuhGwX.mjs → referencePickerModal-f8STnNvS.mjs} +10 -10
- package/dist/chunks/{referencePickerModal-CseuhGwX.mjs.map → referencePickerModal-f8STnNvS.mjs.map} +1 -1
- package/dist/chunks/{useAppSettingsDialog-Dn48dw1k.mjs → useAppSettingsDialog-DbtEkXa4.mjs} +4 -2
- package/dist/chunks/useAppSettingsDialog-DbtEkXa4.mjs.map +1 -0
- package/dist/chunks/useCopy-pTWmSjcP.mjs +39 -0
- package/dist/chunks/useCopy-pTWmSjcP.mjs.map +1 -0
- package/dist/chunks/useNcFormBox-DA9iwXWY.mjs +13 -0
- package/dist/chunks/useNcFormBox-DA9iwXWY.mjs.map +1 -0
- package/dist/chunks/useTrapStackControl-B6cEicto.mjs.map +1 -1
- package/dist/components/NcActionButton/index.mjs +1 -1
- package/dist/components/NcActionButtonGroup/index.mjs +1 -1
- package/dist/components/NcActionInput/NcActionInput.vue.d.ts +2 -2
- package/dist/components/NcActionInput/index.mjs +1 -1
- package/dist/components/NcActionTextEditable/index.mjs +1 -1
- package/dist/components/NcActions/NcActions.vue.d.ts +21 -9
- package/dist/components/NcActions/index.mjs +1 -1
- package/dist/components/NcAppContent/index.mjs +1 -1
- package/dist/components/NcAppNavigation/index.mjs +1 -1
- package/dist/components/NcAppNavigationCaption/NcAppNavigationCaption.vue.d.ts +11 -4
- package/dist/components/NcAppNavigationCaption/index.mjs +1 -1
- package/dist/components/NcAppNavigationItem/NcAppNavigationItem.vue.d.ts +11 -4
- package/dist/components/NcAppNavigationItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationNew/index.mjs +1 -1
- package/dist/components/NcAppNavigationNewItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationSearch/index.mjs +1 -1
- package/dist/components/NcAppNavigationSettings/index.mjs +1 -1
- package/dist/components/NcAppSettingsDialog/NcAppSettingsDialog.vue.d.ts +12 -0
- package/dist/components/NcAppSettingsDialog/NcAppSettingsDialogVersion.vue.d.ts +2 -0
- package/dist/components/NcAppSettingsDialog/index.mjs +1 -1
- package/dist/components/NcAppSettingsDialog/useAppSettingsDialog.d.ts +2 -1
- package/dist/components/NcAppSettingsSection/NcAppSettingsSection.vue.d.ts +2 -0
- package/dist/components/NcAppSettingsSection/index.mjs +1 -1
- package/dist/components/NcAppSettingsSectionShortcuts/index.d.ts +8 -1
- package/dist/components/NcAppSettingsSectionShortcuts/index.mjs +1 -1
- package/dist/components/NcAppSettingsShortcutsSection/index.d.ts +5 -0
- package/dist/components/NcAppSettingsShortcutsSection/index.mjs +5 -0
- package/dist/components/NcAppSettingsShortcutsSection/index.mjs.map +1 -0
- package/dist/components/NcAppSidebar/NcAppSidebar.vue.d.ts +11 -4
- package/dist/components/NcAppSidebar/index.mjs +1 -1
- package/dist/components/NcAssistantButton/index.mjs +1 -1
- package/dist/components/NcAssistantIcon/index.mjs +1 -1
- package/dist/components/NcAvatar/NcAvatar.vue.d.ts +12 -4
- package/dist/components/NcAvatar/index.mjs +1 -1
- package/dist/components/NcBreadcrumb/NcBreadcrumb.vue.d.ts +11 -4
- package/dist/components/NcBreadcrumb/index.mjs +1 -1
- package/dist/components/NcBreadcrumbs/NcBreadcrumbs.vue.d.ts +22 -8
- package/dist/components/NcBreadcrumbs/index.mjs +1 -1
- package/dist/components/NcButton/index.mjs +1 -1
- package/dist/components/NcCheckboxRadioSwitch/index.mjs +1 -1
- package/dist/components/NcChip/index.mjs +1 -1
- package/dist/components/NcCollectionList/NcCollectionList.vue.d.ts +36 -14
- package/dist/components/NcCollectionList/NcCollectionListItem.vue.d.ts +23 -8
- package/dist/components/NcCollectionList/index.mjs +1 -1
- package/dist/components/NcColorPicker/index.mjs +1 -1
- package/dist/components/NcContent/index.mjs +1 -1
- package/dist/components/NcDashboardWidget/NcDashboardWidget.vue.d.ts +35 -12
- package/dist/components/NcDashboardWidget/index.mjs +1 -1
- package/dist/components/NcDashboardWidgetItem/NcDashboardWidgetItem.vue.d.ts +23 -8
- package/dist/components/NcDashboardWidgetItem/index.mjs +1 -1
- package/dist/components/NcDateTimePicker/NcDateTimePicker.vue.d.ts +2 -2
- package/dist/components/NcDateTimePicker/index.mjs +1 -1
- package/dist/components/NcDateTimePickerNative/index.mjs +1 -1
- package/dist/components/NcDialog/index.mjs +1 -1
- package/dist/components/NcDialogButton/index.mjs +1 -1
- package/dist/components/NcEmojiPicker/index.mjs +1 -1
- package/dist/components/NcFormBox/NcFormBox.vue.d.ts +42 -0
- package/dist/components/NcFormBox/NcFormBoxItem.vue.d.ts +61 -0
- package/dist/components/NcFormBox/index.d.ts +1 -0
- package/dist/components/NcFormBox/index.mjs +5 -0
- package/dist/components/NcFormBox/index.mjs.map +1 -0
- package/dist/components/NcFormBox/useNcFormBox.d.ts +19 -0
- package/dist/components/NcFormBoxButton/NcFormBoxButton.vue.d.ts +51 -0
- package/dist/components/NcFormBoxButton/index.d.ts +5 -0
- package/dist/components/NcFormBoxButton/index.mjs +5 -0
- package/dist/components/NcFormBoxButton/index.mjs.map +1 -0
- package/dist/components/NcFormBoxCopyButton/NcFormBoxCopyButton.vue.d.ts +34 -0
- package/dist/components/NcFormBoxCopyButton/index.d.ts +5 -0
- package/dist/components/NcFormBoxCopyButton/index.mjs +5 -0
- package/dist/components/NcFormBoxCopyButton/index.mjs.map +1 -0
- package/dist/components/NcFormBoxSwitch/NcFormBoxSwitch.vue.d.ts +45 -0
- package/dist/components/NcFormBoxSwitch/index.d.ts +5 -0
- package/dist/components/NcFormBoxSwitch/index.mjs +5 -0
- package/dist/components/NcFormBoxSwitch/index.mjs.map +1 -0
- package/dist/components/NcFormGroup/NcFormGroup.vue.d.ts +64 -0
- package/dist/components/NcFormGroup/index.d.ts +5 -0
- package/dist/components/NcFormGroup/index.mjs +5 -0
- package/dist/components/NcFormGroup/index.mjs.map +1 -0
- package/dist/components/NcHeaderButton/index.mjs +1 -1
- package/dist/components/NcHeaderMenu/index.mjs +1 -1
- package/dist/components/NcHotkey/index.mjs +1 -1
- package/dist/components/NcHotkeyList/index.mjs +1 -1
- package/dist/components/NcIconSvgWrapper/index.mjs +1 -1
- package/dist/components/NcInputField/index.mjs +1 -1
- package/dist/components/NcKbd/index.mjs +1 -1
- package/dist/components/NcListItem/NcListItem.vue.d.ts +11 -4
- package/dist/components/NcListItem/index.mjs +1 -1
- package/dist/components/NcListItemIcon/NcListItemIcon.vue.d.ts +13 -4
- package/dist/components/NcListItemIcon/index.mjs +1 -1
- package/dist/components/NcModal/index.mjs +1 -1
- package/dist/components/NcNoteCard/index.mjs +1 -1
- package/dist/components/NcPasswordField/index.mjs +1 -1
- package/dist/components/NcRadioGroup/NcRadioGroup.vue.d.ts +7 -1
- package/dist/components/NcRadioGroup/index.mjs +1 -1
- package/dist/components/NcRadioGroupButton/index.mjs +1 -1
- package/dist/components/NcRelatedResourcesPanel/index.mjs +1 -1
- package/dist/components/NcRichContenteditable/NcRichContenteditable.vue.d.ts +1 -2
- package/dist/components/NcRichContenteditable/index.mjs +1 -1
- package/dist/components/NcRichText/NcReferencePicker/NcRawLinkInput.vue.d.ts +1 -2
- package/dist/components/NcRichText/NcReferencePicker/NcSearch.vue.d.ts +1 -2
- package/dist/components/NcRichText/NcRichTextCopyButton.vue.d.ts +6 -0
- package/dist/components/NcRichText/index.mjs +3 -3
- package/dist/components/NcSelect/index.mjs +1 -1
- package/dist/components/NcSelectTags/index.mjs +1 -1
- package/dist/components/NcSelectUsers/index.mjs +1 -1
- package/dist/components/NcSettingsSection/index.mjs +1 -1
- package/dist/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue.d.ts +1 -2
- package/dist/components/NcSettingsSelectGroup/index.mjs +1 -1
- package/dist/components/NcTextArea/index.mjs +1 -1
- package/dist/components/NcTextField/index.mjs +1 -1
- package/dist/components/NcTimezonePicker/index.mjs +1 -1
- package/dist/components/NcUserBubble/index.mjs +1 -1
- package/dist/components/NcUserStatusIcon/index.mjs +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/composables/useButtonLink.d.ts +78 -0
- package/dist/composables/useCopy.d.ts +12 -0
- package/dist/composables/useFormatDateTime/index.mjs +1 -1
- package/dist/composables/useTrapStackControl.d.ts +1 -2
- package/dist/functions/reference/index.mjs +1 -1
- package/dist/functions/usernameToColor/index.mjs +1 -1
- package/dist/index.mjs +149 -138
- package/dist/index.mjs.map +1 -1
- package/dist/mixins/userStatus.d.ts +8 -0
- package/dist/utils/appName.d.ts +5 -0
- package/dist/utils/utils.d.ts +10 -0
- package/package.json +24 -24
- package/dist/assets/NcHotkeyList-B42a0d8Z.css +0 -9
- package/dist/assets/NcRadioGroup-CNgjqqiP.css +0 -49
- package/dist/chunks/NcActions-C-E6BGfZ.mjs.map +0 -1
- package/dist/chunks/NcAppContent-Qg8YBJa7.mjs.map +0 -1
- package/dist/chunks/NcAppNavigation-BWd7-5H0.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationItem-Cz_lEp5a.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationSearch-BbXky-Un.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsDialog-BZzj8jNU.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsSection-urZiy9aH.mjs.map +0 -1
- package/dist/chunks/NcAppSidebar-Du9lcG-G.mjs.map +0 -1
- package/dist/chunks/NcAvatar-CZVJYWdr.mjs.map +0 -1
- package/dist/chunks/NcButton-DkC5k3Lb.mjs.map +0 -1
- package/dist/chunks/NcChip-CIjgDRrf.mjs.map +0 -1
- package/dist/chunks/NcDashboardWidget-Bu7bWoUK.mjs.map +0 -1
- package/dist/chunks/NcHotkey-V6s3DXUs.mjs.map +0 -1
- package/dist/chunks/NcHotkeyList-Ck87UwvW.mjs.map +0 -1
- package/dist/chunks/NcIconSvgWrapper-5AA93z-F.mjs.map +0 -1
- package/dist/chunks/NcInputField-By_D1kDJ.mjs.map +0 -1
- package/dist/chunks/NcListItem-z4qAtAqe.mjs.map +0 -1
- package/dist/chunks/NcListItemIcon-BVr_U7S4.mjs.map +0 -1
- package/dist/chunks/NcNoteCard-BomepG0z.mjs.map +0 -1
- package/dist/chunks/NcPasswordField-DroBJzYE.mjs.map +0 -1
- package/dist/chunks/NcRadioGroup-B_BNFM6V.mjs +0 -81
- package/dist/chunks/NcRadioGroup-B_BNFM6V.mjs.map +0 -1
- package/dist/chunks/NcRadioGroupButton-BNydXurR.mjs.map +0 -1
- package/dist/chunks/NcRelatedResourcesPanel-1oVpr5Oh.mjs.map +0 -1
- package/dist/chunks/NcRichText-CETsOVBU.mjs.map +0 -1
- package/dist/chunks/NcTextArea-CKK_gfIE.mjs.map +0 -1
- package/dist/chunks/NcTextField.vue_vue_type_script_setup_true_lang-DVAnIMOA.mjs.map +0 -1
- package/dist/chunks/_l10n-YZMLsK4O.mjs.map +0 -1
- package/dist/chunks/useAppSettingsDialog-Dn48dw1k.mjs.map +0 -1
- /package/dist/assets/{NcAppSettingsSectionShortcuts-CRO4RakN.css → NcAppSettingsShortcutsSection-CRO4RakN.css} +0 -0
- /package/dist/components/{NcAppSettingsSectionShortcuts/NcAppSettingsSectionShortcuts.vue.d.ts → NcAppSettingsShortcutsSection/NcAppSettingsShortcutsSection.vue.d.ts} +0 -0
package/dist/chunks/{NcDateTimePickerNative-BSKXbwuA.mjs → NcDateTimePickerNative-CR1Yx5Qp.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../assets/NcDateTimePickerNative-BP6eg8aU.css';
|
|
2
2
|
import { defineComponent, mergeModels, useModel, computed, createElementBlock, openBlock, normalizeClass, createElementVNode, toDisplayString, mergeProps } from "vue";
|
|
3
|
-
import { r as register, a as t } from "./_l10n-
|
|
3
|
+
import { r as register, a as t } from "./_l10n-CWKr1fUH.mjs";
|
|
4
4
|
import { c as createElementId } from "./createElementId-DhjFt1I9.mjs";
|
|
5
5
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
6
6
|
register();
|
|
@@ -97,4 +97,4 @@ const NcDateTimePickerNative = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scope
|
|
|
97
97
|
export {
|
|
98
98
|
NcDateTimePickerNative as N
|
|
99
99
|
};
|
|
100
|
-
//# sourceMappingURL=NcDateTimePickerNative-
|
|
100
|
+
//# sourceMappingURL=NcDateTimePickerNative-CR1Yx5Qp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcDateTimePickerNative-BSKXbwuA.mjs","sources":["../../src/components/NcDateTimePickerNative/NcDateTimePickerNative.vue"],"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\n</docs>\n\n<script setup lang=\"ts\">\nimport type { VueClassType } from '../../utils/VueTypes.ts'\n\nimport { computed } from 'vue'\nimport { t } from '../../l10n.ts'\nimport { createElementId } from '../../utils/createElementId.ts'\n\ndefineOptions({ inheritAttrs: false })\n\n/**\n * The date is – like the `Date` object in JavaScript – tied to UTC.\n * The selected time zone does not have an influence of the selected time and date value.\n * You have to translate the time yourself when you want to factor in time zones.\n * Pass null to clear the input field.\n */\nconst modelValue = defineModel<Date | null>({ default: null })\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * HTML class of the element\n\t */\n\tclass?: VueClassType\n\n\t/**\n\t * ID of the input element\n\t */\n\tid?: string\n\n\t/**\n\t * Class to add to the input field.\n\t * Necessary to use NcDateTimePickerNative in the NcActionInput component.\n\t */\n\tinputClass?: VueClassType\n\n\t/**\n\t * type attribute of the input field\n\t * default type: String\n\t * The type of the input element, it can be `date`, `datetime-local`, `month`, `time`, `week`\n\t */\n\ttype?: 'date' | 'datetime-local' | 'month' | 'time' | 'week'\n\n\t/**\n\t * Visual label of the input\n\t */\n\tlabel?: string\n\n\t/**\n\t * min attribute of the input field\n\t */\n\tmin?: Date | null\n\n\t/**\n\t * max attribute of the input field\n\t */\n\tmax?: Date | null\n\n\t/**\n\t * Flag to hide the label.\n\t * The hidden input label for accessibility purposes.\n\t */\n\thideLabel?: boolean\n}>(), {\n\tclass: undefined,\n\tid: () => createElementId(),\n\tinputClass: '',\n\tlabel: () => t('Please choose a date'),\n\tmax: null,\n\tmin: null,\n\tmodelValue: null,\n\ttype: 'date',\n})\n\nconst formattedValue = computed(() => modelValue.value ? formatValue(modelValue.value) : '')\nconst formattedMax = computed(() => props.max ? formatValue(props.max) : undefined)\nconst formattedMin = computed(() => props.min ? formatValue(props.min) : undefined)\n\n/**\n * Returns Object with string values of a Date\n *\n * @param value - The selected value\n */\nfunction getReadableDate(value: Date) {\n\tconst yyyy = value.getFullYear().toString().padStart(4, '0')\n\tconst MM = (value.getMonth() + 1).toString().padStart(2, '0')\n\tconst dd = value.getDate().toString().padStart(2, '0')\n\tconst hh = value.getHours().toString().padStart(2, '0')\n\tconst mm = value.getMinutes().toString().padStart(2, '0')\n\n\treturn { yyyy, MM, dd, hh, mm }\n}\n\n/**\n * Returns preformatted value for the input field\n *\n * @param value - The selected value\n */\nfunction formatValue(value: Date): string {\n\tconst { yyyy, MM, dd, hh, mm } = getReadableDate(value)\n\tif (props.type === 'datetime-local') {\n\t\treturn `${yyyy}-${MM}-${dd}T${hh}:${mm}`\n\t} else if (props.type === 'date') {\n\t\treturn `${yyyy}-${MM}-${dd}`\n\t} else if (props.type === 'month') {\n\t\treturn `${yyyy}-${MM}`\n\t} else if (props.type === 'time') {\n\t\treturn `${hh}:${mm}`\n\t} else if (props.type === 'week') {\n\t\tconst startDate = new Date(Number.parseInt(yyyy), 0, 1)\n\t\tconst daysSinceBeginningOfYear = Math.floor((value.getTime() - startDate.getTime())\n\t\t\t/ (24 * 60 * 60 * 1000))\n\t\tconst weekNumber = Math.ceil(daysSinceBeginningOfYear / 7)\n\t\treturn `${yyyy}-W${weekNumber}`\n\t}\n\treturn ''\n}\n\n/**\n * Handle the input event\n *\n * @param event - The input event payload\n */\nfunction onInput(event: Event): void {\n\tconst input = event.target as HTMLInputElement\n\tif (!input || isNaN(input.valueAsNumber)) {\n\t\tmodelValue.value = null\n\t} else if (props.type === 'time') {\n\t\tconst time = input.value\n\n\t\tconst { yyyy, MM, dd } = getReadableDate(modelValue.value || new Date())\n\t\tmodelValue.value = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t} else if (props.type === 'month') {\n\t\tconst MM = (new Date(input.value).getMonth() + 1).toString().padStart(2, '0')\n\t\tconst { yyyy, dd, hh, mm } = getReadableDate(modelValue.value || new Date())\n\t\tmodelValue.value = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t} else {\n\t\tconst timezoneOffsetSeconds = new Date(input.valueAsNumber).getTimezoneOffset() * 1000 * 60\n\t\tconst inputDateWithTimezone = input.valueAsNumber + timezoneOffsetSeconds\n\t\tmodelValue.value = new Date(inputDateWithTimezone)\n\t}\n}\n</script>\n\n<template>\n\t<div class=\"native-datetime-picker\" :class=\"$props.class\">\n\t\t<label\n\t\t\tclass=\"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\n\t\t\t:id\n\t\t\tclass=\"native-datetime-picker__input\"\n\t\t\t:class=\"inputClass\"\n\t\t\t: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\t@input=\"onInput\">\n\t</div>\n</template>\n\n<style lang=\"scss\" scoped>\n.native-datetime-picker {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t.native-datetime-picker__label {\n\t\tmargin-block-end: 2px;\n\t}\n\n\t.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-element) + 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\n[data-theme-light],\n[data-themes*=light] {\n\t.native-datetime-picker__input {\n\t\tcolor-scheme: light;\n\t}\n}\n\n[data-theme-dark],\n[data-themes*=dark] {\n\t.native-datetime-picker__input {\n\t\tcolor-scheme: dark;\n\t}\n}\n\n[data-theme-default],\n[data-themes*=default] {\n\t@media (prefers-color-scheme: light) {\n\t\t.native-datetime-picker__input {\n\t\t\tcolor-scheme: light;\n\t\t}\n\t}\n\t@media (prefers-color-scheme: dark) {\n\t\t.native-datetime-picker__input {\n\t\t\tcolor-scheme: dark;\n\t\t}\n\t}\n}\n</style>\n"],"names":["_useModel","_createElementBlock","_normalizeClass","$props","_createElementVNode","hideLabel","id","label","_mergeProps","inputClass","type","$attrs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,UAAM,aAAaA,SAAwB,SAAA,YAAkB;AAE7D,UAAM,QAAQ;AAuDd,UAAM,iBAAiB,SAAS,MAAM,WAAW,QAAQ,YAAY,WAAW,KAAK,IAAI,EAAE;AAC3F,UAAM,eAAe,SAAS,MAAM,MAAM,MAAM,YAAY,MAAM,GAAG,IAAI,MAAS;AAClF,UAAM,eAAe,SAAS,MAAM,MAAM,MAAM,YAAY,MAAM,GAAG,IAAI,MAAS;AAOlF,aAAS,gBAAgB,OAAa;AACrC,YAAM,OAAO,MAAM,YAAA,EAAc,WAAW,SAAS,GAAG,GAAG;AAC3D,YAAM,MAAM,MAAM,SAAA,IAAa,GAAG,WAAW,SAAS,GAAG,GAAG;AAC5D,YAAM,KAAK,MAAM,QAAA,EAAU,WAAW,SAAS,GAAG,GAAG;AACrD,YAA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AAI,EAAE,IAAI,IAAI,EAAE;AAAA,MAC1D,WAAW,MAAM,SAAS,SAAS;AAClC,cAAM,MAAM,IAAI,KAAK,MAAM,KAAK,EAAE,SAAA,IAAa,GAAG,SAAA,EAAW,SAAS,GAAG,GAAG;AAC5E,cAAM,EAAE,MAAM,IAAI,IAAI,GAAA,IAAO,gBAAgB,WAAW,SAAS,oBAAI,MAAM;AAC3E,mBAAW,QAAQ,oBAAI,KAAK,GAAG,IAAI,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;AAAA,MAC9D,OAAO;AACN,cAAM,wBAAwB,IAAI,KAAK,MAAM,aAAa,EAAE,kBAAA,IAAsB,MAAO;AACzF,cAAM,wBAAwB,MAAM,gBAAgB;AACpD,mBAAW,QAAQ,IAAI,KAAK,qBAAqB;AAAA,MAClD;AAAA,IACD;;0BAICC,mBAiBM,OAAA;AAAA,QAjBD,OAAKC,eAAA,CAAC,0BAAiCC,KAAAA,OAAO,KAAK,CAAA;AAAA,MAAA;QACvDC,mBAKQ,SAAA;AAAA,UAJP,OAAKF,eAAA,CAAC,iCAA+B,EAAA,mBACRG,KAAAA,UAAAA,CAAS,CAAA;AAAA,UACrC,KAAKC,KAAAA;AAAAA,QAAAA,mBACHC,KAAAA,KAAK,GAAA,IAAA,UAAA;AAAA,QAETH,mBASkB,SATlBI,WASkB;AAAA,UARhB,IAAAF,KAAAA;AAAAA,UACD,OAAK,CAAC,iCACEG,KAAAA,UAAU;AAAA,UACjB,MAAAC,KAAAA;AAAAA,UACA,OAAO,eAAA;AAAA,UACP,KAAK,aAAA;AAAA,UACL,KAAK,aAAA;AAAA,QAAA,GACEC,KAAAA,QAAM,EACb,SAAc,GAAA,MAAA,IAAA,UAAA;AAAA,MAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcDateTimePickerNative-CR1Yx5Qp.mjs","sources":["../../src/components/NcDateTimePickerNative/NcDateTimePickerNative.vue"],"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\n</docs>\n\n<script setup lang=\"ts\">\nimport type { VueClassType } from '../../utils/VueTypes.ts'\n\nimport { computed } from 'vue'\nimport { t } from '../../l10n.ts'\nimport { createElementId } from '../../utils/createElementId.ts'\n\ndefineOptions({ inheritAttrs: false })\n\n/**\n * The date is – like the `Date` object in JavaScript – tied to UTC.\n * The selected time zone does not have an influence of the selected time and date value.\n * You have to translate the time yourself when you want to factor in time zones.\n * Pass null to clear the input field.\n */\nconst modelValue = defineModel<Date | null>({ default: null })\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * HTML class of the element\n\t */\n\tclass?: VueClassType\n\n\t/**\n\t * ID of the input element\n\t */\n\tid?: string\n\n\t/**\n\t * Class to add to the input field.\n\t * Necessary to use NcDateTimePickerNative in the NcActionInput component.\n\t */\n\tinputClass?: VueClassType\n\n\t/**\n\t * type attribute of the input field\n\t * default type: String\n\t * The type of the input element, it can be `date`, `datetime-local`, `month`, `time`, `week`\n\t */\n\ttype?: 'date' | 'datetime-local' | 'month' | 'time' | 'week'\n\n\t/**\n\t * Visual label of the input\n\t */\n\tlabel?: string\n\n\t/**\n\t * min attribute of the input field\n\t */\n\tmin?: Date | null\n\n\t/**\n\t * max attribute of the input field\n\t */\n\tmax?: Date | null\n\n\t/**\n\t * Flag to hide the label.\n\t * The hidden input label for accessibility purposes.\n\t */\n\thideLabel?: boolean\n}>(), {\n\tclass: undefined,\n\tid: () => createElementId(),\n\tinputClass: '',\n\tlabel: () => t('Please choose a date'),\n\tmax: null,\n\tmin: null,\n\tmodelValue: null,\n\ttype: 'date',\n})\n\nconst formattedValue = computed(() => modelValue.value ? formatValue(modelValue.value) : '')\nconst formattedMax = computed(() => props.max ? formatValue(props.max) : undefined)\nconst formattedMin = computed(() => props.min ? formatValue(props.min) : undefined)\n\n/**\n * Returns Object with string values of a Date\n *\n * @param value - The selected value\n */\nfunction getReadableDate(value: Date) {\n\tconst yyyy = value.getFullYear().toString().padStart(4, '0')\n\tconst MM = (value.getMonth() + 1).toString().padStart(2, '0')\n\tconst dd = value.getDate().toString().padStart(2, '0')\n\tconst hh = value.getHours().toString().padStart(2, '0')\n\tconst mm = value.getMinutes().toString().padStart(2, '0')\n\n\treturn { yyyy, MM, dd, hh, mm }\n}\n\n/**\n * Returns preformatted value for the input field\n *\n * @param value - The selected value\n */\nfunction formatValue(value: Date): string {\n\tconst { yyyy, MM, dd, hh, mm } = getReadableDate(value)\n\tif (props.type === 'datetime-local') {\n\t\treturn `${yyyy}-${MM}-${dd}T${hh}:${mm}`\n\t} else if (props.type === 'date') {\n\t\treturn `${yyyy}-${MM}-${dd}`\n\t} else if (props.type === 'month') {\n\t\treturn `${yyyy}-${MM}`\n\t} else if (props.type === 'time') {\n\t\treturn `${hh}:${mm}`\n\t} else if (props.type === 'week') {\n\t\tconst startDate = new Date(Number.parseInt(yyyy), 0, 1)\n\t\tconst daysSinceBeginningOfYear = Math.floor((value.getTime() - startDate.getTime())\n\t\t\t/ (24 * 60 * 60 * 1000))\n\t\tconst weekNumber = Math.ceil(daysSinceBeginningOfYear / 7)\n\t\treturn `${yyyy}-W${weekNumber}`\n\t}\n\treturn ''\n}\n\n/**\n * Handle the input event\n *\n * @param event - The input event payload\n */\nfunction onInput(event: Event): void {\n\tconst input = event.target as HTMLInputElement\n\tif (!input || isNaN(input.valueAsNumber)) {\n\t\tmodelValue.value = null\n\t} else if (props.type === 'time') {\n\t\tconst time = input.value\n\n\t\tconst { yyyy, MM, dd } = getReadableDate(modelValue.value || new Date())\n\t\tmodelValue.value = new Date(`${yyyy}-${MM}-${dd}T${time}`)\n\t} else if (props.type === 'month') {\n\t\tconst MM = (new Date(input.value).getMonth() + 1).toString().padStart(2, '0')\n\t\tconst { yyyy, dd, hh, mm } = getReadableDate(modelValue.value || new Date())\n\t\tmodelValue.value = new Date(`${yyyy}-${MM}-${dd}T${hh}:${mm}`)\n\t} else {\n\t\tconst timezoneOffsetSeconds = new Date(input.valueAsNumber).getTimezoneOffset() * 1000 * 60\n\t\tconst inputDateWithTimezone = input.valueAsNumber + timezoneOffsetSeconds\n\t\tmodelValue.value = new Date(inputDateWithTimezone)\n\t}\n}\n</script>\n\n<template>\n\t<div class=\"native-datetime-picker\" :class=\"$props.class\">\n\t\t<label\n\t\t\tclass=\"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\n\t\t\t:id\n\t\t\tclass=\"native-datetime-picker__input\"\n\t\t\t:class=\"inputClass\"\n\t\t\t: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\t@input=\"onInput\">\n\t</div>\n</template>\n\n<style lang=\"scss\" scoped>\n.native-datetime-picker {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t.native-datetime-picker__label {\n\t\tmargin-block-end: 2px;\n\t}\n\n\t.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-element) + 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\n[data-theme-light],\n[data-themes*=light] {\n\t.native-datetime-picker__input {\n\t\tcolor-scheme: light;\n\t}\n}\n\n[data-theme-dark],\n[data-themes*=dark] {\n\t.native-datetime-picker__input {\n\t\tcolor-scheme: dark;\n\t}\n}\n\n[data-theme-default],\n[data-themes*=default] {\n\t@media (prefers-color-scheme: light) {\n\t\t.native-datetime-picker__input {\n\t\t\tcolor-scheme: light;\n\t\t}\n\t}\n\t@media (prefers-color-scheme: dark) {\n\t\t.native-datetime-picker__input {\n\t\t\tcolor-scheme: dark;\n\t\t}\n\t}\n}\n</style>\n"],"names":["_useModel","_createElementBlock","_normalizeClass","$props","_createElementVNode","hideLabel","id","label","_mergeProps","inputClass","type","$attrs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,UAAM,aAAaA,SAAwB,SAAA,YAAkB;AAE7D,UAAM,QAAQ;AAuDd,UAAM,iBAAiB,SAAS,MAAM,WAAW,QAAQ,YAAY,WAAW,KAAK,IAAI,EAAE;AAC3F,UAAM,eAAe,SAAS,MAAM,MAAM,MAAM,YAAY,MAAM,GAAG,IAAI,MAAS;AAClF,UAAM,eAAe,SAAS,MAAM,MAAM,MAAM,YAAY,MAAM,GAAG,IAAI,MAAS;AAOlF,aAAS,gBAAgB,OAAa;AACrC,YAAM,OAAO,MAAM,YAAA,EAAc,WAAW,SAAS,GAAG,GAAG;AAC3D,YAAM,MAAM,MAAM,SAAA,IAAa,GAAG,WAAW,SAAS,GAAG,GAAG;AAC5D,YAAM,KAAK,MAAM,QAAA,EAAU,WAAW,SAAS,GAAG,GAAG;AACrD,YAAM,KAAK,MAAM,SAAA,EAAW,WAAW,SAAS,GAAG,GAAG;AACtD,YAAM,KAAK,MAAM,WAAA,EAAa,WAAW,SAAS,GAAG,GA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,EAAE,SAAA,IAAa,GAAG,SAAA,EAAW,SAAS,GAAG,GAAG;AAC5E,cAAM,EAAE,MAAM,IAAI,IAAI,GAAA,IAAO,gBAAgB,WAAW,SAAS,oBAAI,MAAM;AAC3E,mBAAW,QAAQ,oBAAI,KAAK,GAAG,IAAI,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;AAAA,MAC9D,OAAO;AACN,cAAM,wBAAwB,IAAI,KAAK,MAAM,aAAa,EAAE,kBAAA,IAAsB,MAAO;AACzF,cAAM,wBAAwB,MAAM,gBAAgB;AACpD,mBAAW,QAAQ,IAAI,KAAK,qBAAqB;AAAA,MAClD;AAAA,IACD;;0BAICC,mBAiBM,OAAA;AAAA,QAjBD,OAAKC,eAAA,CAAC,0BAAiCC,KAAAA,OAAO,KAAK,CAAA;AAAA,MAAA;QACvDC,mBAKQ,SAAA;AAAA,UAJP,OAAKF,eAAA,CAAC,iCAA+B,EAAA,mBACRG,KAAAA,UAAAA,CAAS,CAAA;AAAA,UACrC,KAAKC,KAAAA;AAAAA,QAAAA,mBACHC,KAAAA,KAAK,GAAA,IAAA,UAAA;AAAA,QAETH,mBASkB,SATlBI,WASkB;AAAA,UARhB,IAAAF,KAAAA;AAAAA,UACD,OAAK,CAAC,iCACEG,KAAAA,UAAU;AAAA,UACjB,MAAAC,KAAAA;AAAAA,UACA,OAAO,eAAA;AAAA,UACP,KAAK,aAAA;AAAA,UACL,KAAK,aAAA;AAAA,QAAA,GACEC,KAAAA,QAAM,EACb,SAAc,GAAA,MAAA,IAAA,UAAA;AAAA,MAAA;;;;;"}
|
|
@@ -2,8 +2,8 @@ import '../assets/NcDialog-D3fAX1Fs.css';
|
|
|
2
2
|
import { defineComponent, mergeModels, useModel, useSlots, useTemplateRef, computed, ref, createBlock, createCommentVNode, openBlock, unref, mergeProps, withCtx, createElementVNode, toDisplayString, resolveDynamicComponent, toHandlers, normalizeClass, createElementBlock, renderSlot, Fragment, renderList } from "vue";
|
|
3
3
|
import { useElementSize } from "@vueuse/core";
|
|
4
4
|
import { c as createElementId } from "./createElementId-DhjFt1I9.mjs";
|
|
5
|
-
import { _ as _sfc_main$1 } from "./NcDialogButton.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { N as NcModal } from "./NcModal-
|
|
5
|
+
import { _ as _sfc_main$1 } from "./NcDialogButton.vue_vue_type_script_setup_true_lang-CF6LnBe7.mjs";
|
|
6
|
+
import { N as NcModal } from "./NcModal-DZtBQM1y.mjs";
|
|
7
7
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
8
8
|
const _hoisted_1 = ["id", "textContent"];
|
|
9
9
|
const _hoisted_2 = ["aria-label", "aria-labelledby"];
|
|
@@ -164,4 +164,4 @@ const NcDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c
|
|
|
164
164
|
export {
|
|
165
165
|
NcDialog as N
|
|
166
166
|
};
|
|
167
|
-
//# sourceMappingURL=NcDialog-
|
|
167
|
+
//# sourceMappingURL=NcDialog-BY-1v8yi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcDialog-BgzJN2XT.mjs","sources":["../../src/components/NcDialog/NcDialog.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### General description\n\nThis component uses the `NcModal` under the hood for allowing users to create generic dialogs.\n\n### Basic example\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcDialog v-model:open=\"showDialog\" name=\"Confirmation\" message=\"Are you sure to proceed?\" :buttons=\"buttons\" />\n\t\t<p>Last response: {{ lastResponse }}</p>\n\t</div>\n</template>\n<script>\nimport IconCancel from '@mdi/svg/svg/cancel.svg?raw'\nimport IconCheck from '@mdi/svg/svg/check.svg?raw'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tlastResponse: 'None',\n\t\t\tbuttons: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Cancel',\n\t\t\t\t\ticon: IconCancel,\n\t\t\t\t\tcallback: () => { this.lastResponse = 'Pressed \"Cancel\"' },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Ok',\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\ticon: IconCheck,\n\t\t\t\t\tcallback: () => { this.lastResponse = 'Pressed \"Ok\"' },\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t},\n}\n</script>\n```\n\n### Use custom actions and content\nInstead of using the buttons property, you can also inject your custom actions using a named slot.\nYou can also use the default slot to inject custom content.\n\n```vue\n<template>\n\t<div style=\"display: flex; gap: 12px;\">\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcButton @click=\"showLongDialog = true\">Show long dialog</NcButton>\n\t\t<NcDialog v-if=\"showDialog\" name=\"Warning\" no-close>\n\t\t\t<template #actions>\n\t\t\t\t<NcButton @click=\"showDialog = false\">Ok</NcButton>\n\t\t\t</template>\n\t\t\t<div style=\"color: red; font-weight: bold;\">This is serious</div>\n\t\t</NcDialog>\n\t\t<NcDialog v-model:open=\"showLongDialog\" name=\"Lorem Ipsum\">\n\t\t\t<p v-for=\"i in new Array(63)\" :key=\"i\">Lorem ipsum dolor sit amet.</p>\n\t\t</NcDialog>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tshowLongDialog: false,\n\t\t}\n\t},\n}\n</script>\n```\n\n### Form example\nIt is also possible to use the dialog for small forms.\nThis can be used when asking for a password, a name or similar to have native form validation.\n\nTo make the dialog a form the `is-form` prop needs to be set.\nWhen using the form variant you can also pass buttons with `nativeType` prop to add a native `submit` button.\n\nNote that this is not possible if the dialog contains a navigation!\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcDialog is-form\n\t\t\t:buttons=\"buttons\"\n\t\t\tname=\"Choose a name\"\n\t\t\tv-model:open=\"showDialog\"\n\t\t\t@submit=\"currentName = newName\"\n\t\t\t@reset=\"newName = ''\"\n\t\t\t@closing=\"newName = ''\">\n\t\t\t<NcTextField v-model=\"newName\"\n\t\t\t\tlabel=\"New name\"\n\t\t\t\tminlength=\"6\"\n\t\t\t\tplaceholder=\"Min. 6 characters\"\n\t\t\t\trequired />\n\t\t</NcDialog>\n\t\t<p>New name: {{ currentName }}</p>\n\t</div>\n</template>\n<script>\nimport IconCheck from '@mdi/svg/svg/check.svg?raw'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tnewName: '',\n\t\t\tcurrentName: 'none yet.',\n\t\t\tbuttons: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Reset',\n\t\t\t\t\tnativeType: 'reset',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Submit',\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\tnativeType: 'submit',\n\t\t\t\t\ticon: IconCheck,\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t},\n}\n</script>\n```\n\n### Loading buttons\nSometimes a dialog ends with a request and this request might fail due to server-side-validation.\nIn this case it is often desired to keep the dialog open, this can be done by returning `false` from the button callback,\nto not block this callback should return a `Promise<false>`.\n\nIt is also possible to get the result of the callback from the dialog, as the result is passed as the payload of the `closing` event.\n\nWhile the promise is awaited the button will have a loading state,\nthis means, as long as no custom `icon`-slot is used, a loading icon will be shown.\nPlease note that the **button will not be disabled or accessibility reasons**,\nbecause disabled elements cannot be focused and so the loading state could not be communicated e.g. via screen readers.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"openDialog\">Show dialog</NcButton>\n\t\t<NcDialog :buttons=\"buttons\"\n\t\t\tname=\"Create user\"\n\t\t\t:message=\"message\"\n\t\t\t:open.sync=\"showDialog\"\n\t\t\t@closing=\"response = $event\"\n\t\t\t@update:open=\"clickClosesDialog = false\" />\n\t\t<div style=\"margin-top: 8px;\">Dialog response: {{ response }}</div>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tclickClosesDialog: false,\n\t\t\tresponse: 'none',\n\t\t}\n\t},\n\n\tmethods: {\n\t\tasync callback() {\n\t\t\t// wait 3 seconds\n\t\t\tawait new Promise((resolve) => window.setTimeout(resolve, 3000))\n\t\t\tthis.clickClosesDialog = !this.clickClosesDialog\n\t\t\t// Do not close the dialog on first and then every second button click\n\t\t\tif (this.clickClosesDialog) {\n\t\t\t\t// return false means the dialog stays open\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn '✅'\n\t\t},\n\n\t\topenDialog() {\n\t\t\tthis.response = 'none'\n\t\t\tthis.showDialog = true\n\t\t},\n\t},\n\n\tcomputed: {\n\t\tbuttons() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Create user',\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\tcallback: this.callback,\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tmessage() {\n\t\t\tif (this.clickClosesDialog) {\n\t\t\t\treturn 'Next button click will work and close the dialog.'\n\t\t\t} else {\n\t\t\t\treturn 'Clicking the button will load but not close the dialog.'\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n```\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\nimport type { ComponentProps, VueClassType } from '../../utils/VueTypes.ts'\n\nimport { useElementSize } from '@vueuse/core'\nimport { computed, ref, useTemplateRef } from 'vue'\nimport { createElementId } from '../../utils/createElementId.ts'\nimport NcDialogButton from '../NcDialogButton/index.ts'\nimport NcModal from '../NcModal/index.js'\n\ntype NcDialogButtonProps = ComponentProps<typeof NcDialogButton>\n\n/**\n * Whether the dialog should be shown\n */\nconst open = defineModel<boolean>('open', { default: true })\n\nconst props = withDefaults(defineProps<{\n\t/** Name of the dialog (the heading) */\n\tname: string\n\n\t/** Text of the dialog */\n\tmessage?: string\n\n\t/** Additional elements to add to the focus trap */\n\tadditionalTrapElements?: Array<string | HTMLElement>\n\n\t/**\n\t * The element where to mount the dialog, if `null` is passed the dialog is mounted in place.\n\t */\n\tcontainer?: string\n\n\t/**\n\t * Size of the underlying NcModal\n\t */\n\tsize?: 'small' | 'normal' | 'large' | 'full'\n\n\t/**\n\t * Buttons to display\n\t */\n\tbuttons?: NcDialogButtonProps[]\n\n\t/**\n\t * Make the dialog wrapper a HTML form element.\n\t * The buttons will be wrapped within the form so they can be used as submit / reset buttons.\n\t * Please note that when using the property the `navigation` should not be used.\n\t */\n\tisForm?: boolean\n\n\t/**\n\t * Do not show the close button for the dialog.\n\t */\n\tnoClose?: boolean\n\n\t/**\n\t * Close the dialog if the user clicked outside of the dialog\n\t * Only relevant if `noClose` is not set.\n\t */\n\tcloseOnClickOutside?: boolean\n\n\t/**\n\t * Declare if hiding the modal should be animated\n\t */\n\toutTransition?: boolean\n\n\t/**\n\t * aria-label for the dialog navigation.\n\t * Use it when you want to provide a more meaningful label than the dialog name.\n\t *\n\t * By default, navigation is labeled by the dialog name.\n\t */\n\tnavigationAriaLabel?: string\n\n\t/**\n\t * aria-labelledby for the dialog navigation.\n\t * Use it when you have an implicit navigation label (e.g. a heading).\n\t *\n\t * By default, navigation is labeled by the dialog name.\n\t */\n\tnavigationAriaLabelledby?: string\n\n\t/**\n\t * Optionally pass additional classes which will be set on the content wrapper for custom styling\n\t */\n\tcontentClasses?: VueClassType\n\n\t/**\n\t * Optionally pass additional classes which will be set on the dialog itself\n\t * (the default `class` attribute will be set on the modal wrapper)\n\t */\n\tdialogClasses?: VueClassType\n\n\t/**\n\t * Optionally pass additional classes which will be set on the navigation for custom styling\n\t *\n\t * @example\n\t * ```html\n\t * <DialogBase :navigation-classes=\"['mydialog-navigation']\"><!-- --></DialogBase>\n\t * <!-- ... -->\n\t * <style lang=\"scss\">\n\t * :deep(.mydialog-navigation) {\n\t * flex-direction: row-reverse;\n\t * }\n\t * </style>\n\t * ```\n\t */\n\tnavigationClasses?: VueClassType\n}>(), {\n\tadditionalTrapElements: () => [],\n\tbuttons: () => [],\n\tcontainer: 'body',\n\tcontentClasses: '',\n\tdialogClasses: '',\n\tmessage: '',\n\tnavigationAriaLabel: '',\n\tnavigationAriaLabelledby: '',\n\tnavigationClasses: '',\n\tsize: 'small',\n})\n\nconst emit = defineEmits<{\n\t/**\n\t * Emitted when the dialog is closing, so the out transition did not finish yet.\n\t *\n\t * @param result - The result of the button callback (`undefined` if closing because of clicking the 'close'-button)\n\t */\n\tclosing: [result?: unknown]\n\t/**\n\t * Forwarded HTMLFormElement reset event (only if `is-form` is set).\n\t *\n\t * @param event - The forwarded form event\n\t */\n\treset: [event: Event]\n\t/**\n\t * Forwarded HTMLFormElement submit event (only if `is-form` is set)\n\t *\n\t * @param event - The submit event\n\t */\n\tsubmit: [event: SubmitEvent]\n}>()\n\nconst slots = defineSlots<{\n\tactions?: Slot\n\tdefault?: Slot\n\tnavigation?: Slot\n}>()\n\n/**\n * The dialog wrapper element\n */\nconst wrapperElement = useTemplateRef('wrapper')\n\n/**\n * We use the dialog width to decide if we collapse the navigation (flex direction row)\n */\nconst { width: dialogWidth } = useElementSize(wrapperElement, { width: 900, height: 0 })\n\n/**\n * Whether the navigation is collapsed due to dialog and window size\n * (collapses when modal is below: 900px modal width - 2x 12px margin)\n */\nconst isNavigationCollapsed = computed(() => dialogWidth.value < 876)\n\n/**\n * Whether a navigation was passed and the element should be displayed\n */\nconst hasNavigation = computed(() => slots?.navigation !== undefined)\n\n/**\n * The unique id of the nav element\n */\nconst navigationId = createElementId()\n\n/**\n * aria-label attribute for the nav element\n */\nconst navigationAriaLabelAttr = computed(() => props.navigationAriaLabel || undefined)\n\n/**\n * aria-labelledby attribute for the nav element\n */\nconst navigationAriaLabelledbyAttr = computed(() => {\n\tif (props.navigationAriaLabel) {\n\t\t// Not needed, already labelled by aria-label\n\t\treturn undefined\n\t}\n\t// Use dialog name as a fallback label for navigation\n\treturn props.navigationAriaLabelledby || navigationId\n})\n\nconst dialogRootElement = useTemplateRef<HTMLDivElement | HTMLFormElement>('dialogElement')\n/**\n * The HTML element to use for the dialog wrapper - either form or plain div\n */\nconst dialogTagName = computed(() => props.isForm && !hasNavigation.value ? 'form' : 'div')\n/**\n * Listener to assign to the dialog element\n * This only sets the `@submit` listener if the dialog element is a form\n */\nconst dialogListeners = computed(() => {\n\tif (dialogTagName.value !== 'form') {\n\t\treturn {}\n\t}\n\n\treturn {\n\t\t/**\n\t\t * @param event - Form submit event\n\t\t */\n\t\tsubmit(event: SubmitEvent) {\n\t\t\tevent.preventDefault()\n\t\t\temit('submit', event)\n\t\t},\n\n\t\t/**\n\t\t * @param event - Form submit event\n\t\t */\n\t\treset(event: Event) {\n\t\t\tevent.preventDefault()\n\t\t\temit('reset', event)\n\t\t},\n\t}\n})\n\n/**\n * If the underlying modal is shown\n */\nconst showModal = ref(true)\n\n// Because NcModal does not emit `close` when show prop is changed\n/**\n * Handle clicking a dialog button -> should close\n *\n * @param button - The button that was clicked\n * @param result - Result of the callback function\n */\nfunction handleButtonClose(button: NcDialogButtonProps, result: unknown) {\n\t// Skip close on submit if invalid dialog\n\tif (button.type === 'submit'\n\t\t&& dialogTagName.value === 'form'\n\t\t&& 'reportValidity' in dialogRootElement.value!\n\t\t&& !dialogRootElement.value.reportValidity()) {\n\t\treturn\n\t}\n\thandleClosing(result)\n\twindow.setTimeout(() => handleClosed(), 300)\n}\n\n/**\n * Handle closing the dialog, optional out transition did not run yet\n *\n * @param result - The result of the callback\n */\nfunction handleClosing(result?: unknown): void {\n\tshowModal.value = false\n\temit('closing', result)\n}\n\n/**\n * Handle dialog closed (out transition finished)\n */\nfunction handleClosed() {\n\tshowModal.value = true\n\topen.value = false\n}\n\n/**\n * Properties to pass to the underlying NcModal\n */\nconst modalProps = computed(() => ({\n\tnoClose: props.noClose,\n\tcontainer: props.container === undefined ? 'body' : props.container,\n\t// we do not pass the name as we already have the name as the headline\n\t// name: props.name,\n\t// But we need to set the correct label id so the dialog is labelled\n\tlabelId: navigationId,\n\tsize: props.size,\n\tshow: open.value && showModal.value,\n\toutTransition: props.outTransition,\n\tcloseOnClickOutside: props.closeOnClickOutside,\n\tadditionalTrapElements: props.additionalTrapElements,\n}))\n</script>\n\n<template>\n\t<NcModal\n\t\tv-if=\"open\"\n\t\tclass=\"dialog__modal\"\n\t\t:enable-slideshow=\"false\"\n\t\tdisable-swipe\n\t\tv-bind=\"modalProps\"\n\t\t@close=\"handleClosed\"\n\t\t@update:show=\"handleClosing()\">\n\t\t<!-- The dialog name / header -->\n\t\t<h2 :id=\"navigationId\" class=\"dialog__name\" v-text=\"name\" />\n\t\t<component\n\t\t\t:is=\"dialogTagName\"\n\t\t\tref=\"dialogElement\"\n\t\t\tclass=\"dialog\"\n\t\t\t:class=\"dialogClasses\"\n\t\t\tv-on=\"dialogListeners\">\n\t\t\t<div ref=\"wrapper\" class=\"dialog__wrapper\" :class=\"[{ 'dialog__wrapper--collapsed': isNavigationCollapsed }]\">\n\t\t\t\t<!-- When the navigation is collapsed (too small dialog) it is displayed above the main content, otherwise on the inline start -->\n\t\t\t\t<nav\n\t\t\t\t\tv-if=\"hasNavigation\"\n\t\t\t\t\tclass=\"dialog__navigation\"\n\t\t\t\t\t:class=\"navigationClasses\"\n\t\t\t\t\t:aria-label=\"navigationAriaLabelAttr\"\n\t\t\t\t\t:aria-labelledby=\"navigationAriaLabelledbyAttr\">\n\t\t\t\t\t<slot name=\"navigation\" :is-collapsed=\"isNavigationCollapsed\" />\n\t\t\t\t</nav>\n\t\t\t\t<!-- Main dialog content -->\n\t\t\t\t<div class=\"dialog__content\" :class=\"contentClasses\">\n\t\t\t\t\t<slot>\n\t\t\t\t\t\t<p class=\"dialog__text\">\n\t\t\t\t\t\t\t{{ message }}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!-- The dialog actions aka the buttons -->\n\t\t\t<div class=\"dialog__actions\">\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<NcDialogButton\n\t\t\t\t\t\tv-for=\"(button, idx) in buttons\"\n\t\t\t\t\t\t:key=\"idx\"\n\t\t\t\t\t\tv-bind=\"button\"\n\t\t\t\t\t\t@click=\"(_, result) => handleButtonClose(button, result)\" />\n\t\t\t\t</slot>\n\t\t\t</div>\n\t\t</component>\n\t</NcModal>\n</template>\n\n<style lang=\"scss\">\n/** When having the small dialog style we override the modal styling so dialogs look more dialog like */\n@media only screen and (max-width: $breakpoint-small-mobile) {\n\t.dialog__modal .modal-wrapper--small .modal-container {\n\t\twidth: fit-content;\n\t\theight: unset;\n\t\tmax-height: 90%;\n\t\tposition: relative;\n\t\ttop: unset;\n\t\tborder-radius: var(--border-radius-element);\n\t}\n}\n</style>\n\n<style lang=\"scss\" scoped>\n.dialog {\n\theight: 100%;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\toverflow: hidden;\n\n\t&__modal {\n\t\t:deep(.modal-wrapper .modal-container) {\n\t\t\tdisplay: flex !important;\n\t\t\tpadding-block: 4px 0; // 4px to align with close button, 0 block-end to make overflowing content on scroll look nice\n\t\t\tpadding-inline: 12px 0; // Same as with padding-block, we need the actions to have a margin of 4px for the button outline\n\t\t}\n\t\t:deep(.modal-wrapper .modal-container__content) {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\toverflow: hidden; // Only overflow on the .dialog__content\n\t\t}\n\t}\n\n\t&__wrapper {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\t// Auto scale to fit\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: hidden;\n\n\t\t&--collapsed {\n\t\t\tflex-direction: column;\n\t\t}\n\t}\n\n\t&__navigation {\n\t\tdisplay: flex;\n\t\tflex-shrink: 0;\n\t}\n\n\t// Navigation styling when side-by-side with content\n\t&__wrapper:not(&__wrapper--collapsed) &__navigation {\n\t\tflex-direction: column;\n\n\t\toverflow: hidden auto;\n\t\theight: 100%;\n\t\tmin-width: 200px;\n\t\tmargin-inline-end: 20px;\n\t}\n\n\t// Navigation styling when on top of content\n\t&__wrapper#{&}__wrapper--collapsed &__navigation {\n\t\tflex-direction: row;\n\t\tjustify-content: space-between;\n\n\t\toverflow: auto hidden;\n\t\twidth: 100%;\n\t\tmin-width: 100%;\n\t}\n\n\t&__name {\n\t\tfont-size: 21px;\n\n\t\ttext-align: center;\n\t\theight: fit-content;\n\t\tmin-height: var(--default-clickable-area);\n\t\tline-height: var(--default-clickable-area);\n\t\toverflow-wrap: break-word;\n\t\tmargin-block: 0 12px;\n\t}\n\n\t&__content {\n\t\t// Auto fit\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t\t// see .dialog__modal, we can not set the padding there to prevent floating scroll bars\n\t\tpadding-inline-end: 12px;\n\t}\n\n\t// In case only text content is show\n\t&__text {\n\t\t// Also add padding to the bottom to make it more readable\n\t\tpadding-block-end: 6px;\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t\talign-content: center;\n\t\tjustify-content: end;\n\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t\tpadding-inline: 0 12px; // 12px to align with the overall modal padding\n\t\tmargin-inline: 0;\n\t\tmargin-block: 0;\n\n\t\t&:not(:empty) {\n\t\t\tmargin-block: 6px 12px; // only if there are actions, we add margin so if it is empty scroll content looks nice\n\t\t}\n\t}\n}\n\n@media only screen and (max-width: $breakpoint-small-mobile) {\n\t// Ensure the dialog name does not interfere with the close button\n\t.dialog__name {\n\t\ttext-align: start;\n\t\tmargin-inline-end: var(--default-clickable-area);\n\t}\n}\n</style>\n"],"names":["_useModel","_useSlots","_openBlock","_createBlock","_unref","_mergeProps","_createElementVNode","_toDisplayString","name","_resolveDynamicComponent","dialogClasses","_toHandlers","_normalizeCl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A;AAAA,cAAA;gBAGjG,cAAA,sBADPC,mBAOM,OAAA;AAAA;kBALL,OAAKD,eAAA,CAAC,sBACEE,KAAAA,iBAAiB,CAAA;AAAA,kBACxB,cAAY,wBAAA;AAAA,kBACZ,mBAAiB,6BAAA;AAAA,gBAAA;kBAClBC,WAAgE,KAAA,QAAA,cAAA,EAAvC,aAAc,sBAAA,SAAqB,QAAA,IAAA;AAAA,gBAAA;gBAG7DT,mBAMM,OAAA;AAAA,kBAND,OAAKM,eAAA,CAAC,mBAA0BI,KAAAA,cAAc,CAAA;AAAA,gBAAA;kBAClDD,WAIO,4BAJP,MAIO;AAAA,oBAHNT,mBAEI,KAFJ,YAEIC,gBADAU,KAAAA,OAAO,GAAA,CAAA;AAAA,kBAAA;;;cAMdX,mBAQM,OARN,YAQM;AAAA,gBAPLS,WAMO,4BANP,MAMO;AAAA,mBALNb,UAAA,IAAA,GAAAW,mBAI6DK,UAAA,MAAAC,WAHpCC,KAAAA,SAAO,CAAvB,QAAQ,QAAG;AADpB,2BAAAlB,UAAA,GAAAC,YAI6DC,oBAJ7DC,WAI6D,EAF3D,KAAK,0BACE,QAAM;AAAA,sBACb,SAAK,CAAG,GAAG,WAAW,kBAAkB,QAAQ,MAAM;AAAA,oBAAA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcDialog-BY-1v8yi.mjs","sources":["../../src/components/NcDialog/NcDialog.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### General description\n\nThis component uses the `NcModal` under the hood for allowing users to create generic dialogs.\n\n### Basic example\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcDialog v-model:open=\"showDialog\" name=\"Confirmation\" message=\"Are you sure to proceed?\" :buttons=\"buttons\" />\n\t\t<p>Last response: {{ lastResponse }}</p>\n\t</div>\n</template>\n<script>\nimport IconCancel from '@mdi/svg/svg/cancel.svg?raw'\nimport IconCheck from '@mdi/svg/svg/check.svg?raw'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tlastResponse: 'None',\n\t\t\tbuttons: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Cancel',\n\t\t\t\t\ticon: IconCancel,\n\t\t\t\t\tcallback: () => { this.lastResponse = 'Pressed \"Cancel\"' },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Ok',\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\ticon: IconCheck,\n\t\t\t\t\tcallback: () => { this.lastResponse = 'Pressed \"Ok\"' },\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t},\n}\n</script>\n```\n\n### Use custom actions and content\nInstead of using the buttons property, you can also inject your custom actions using a named slot.\nYou can also use the default slot to inject custom content.\n\n```vue\n<template>\n\t<div style=\"display: flex; gap: 12px;\">\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcButton @click=\"showLongDialog = true\">Show long dialog</NcButton>\n\t\t<NcDialog v-if=\"showDialog\" name=\"Warning\" no-close>\n\t\t\t<template #actions>\n\t\t\t\t<NcButton @click=\"showDialog = false\">Ok</NcButton>\n\t\t\t</template>\n\t\t\t<div style=\"color: red; font-weight: bold;\">This is serious</div>\n\t\t</NcDialog>\n\t\t<NcDialog v-model:open=\"showLongDialog\" name=\"Lorem Ipsum\">\n\t\t\t<p v-for=\"i in new Array(63)\" :key=\"i\">Lorem ipsum dolor sit amet.</p>\n\t\t</NcDialog>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tshowLongDialog: false,\n\t\t}\n\t},\n}\n</script>\n```\n\n### Form example\nIt is also possible to use the dialog for small forms.\nThis can be used when asking for a password, a name or similar to have native form validation.\n\nTo make the dialog a form the `is-form` prop needs to be set.\nWhen using the form variant you can also pass buttons with `nativeType` prop to add a native `submit` button.\n\nNote that this is not possible if the dialog contains a navigation!\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcDialog is-form\n\t\t\t:buttons=\"buttons\"\n\t\t\tname=\"Choose a name\"\n\t\t\tv-model:open=\"showDialog\"\n\t\t\t@submit=\"currentName = newName\"\n\t\t\t@reset=\"newName = ''\"\n\t\t\t@closing=\"newName = ''\">\n\t\t\t<NcTextField v-model=\"newName\"\n\t\t\t\tlabel=\"New name\"\n\t\t\t\tminlength=\"6\"\n\t\t\t\tplaceholder=\"Min. 6 characters\"\n\t\t\t\trequired />\n\t\t</NcDialog>\n\t\t<p>New name: {{ currentName }}</p>\n\t</div>\n</template>\n<script>\nimport IconCheck from '@mdi/svg/svg/check.svg?raw'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tnewName: '',\n\t\t\tcurrentName: 'none yet.',\n\t\t\tbuttons: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Reset',\n\t\t\t\t\tnativeType: 'reset',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Submit',\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\tnativeType: 'submit',\n\t\t\t\t\ticon: IconCheck,\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t},\n}\n</script>\n```\n\n### Loading buttons\nSometimes a dialog ends with a request and this request might fail due to server-side-validation.\nIn this case it is often desired to keep the dialog open, this can be done by returning `false` from the button callback,\nto not block this callback should return a `Promise<false>`.\n\nIt is also possible to get the result of the callback from the dialog, as the result is passed as the payload of the `closing` event.\n\nWhile the promise is awaited the button will have a loading state,\nthis means, as long as no custom `icon`-slot is used, a loading icon will be shown.\nPlease note that the **button will not be disabled or accessibility reasons**,\nbecause disabled elements cannot be focused and so the loading state could not be communicated e.g. via screen readers.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"openDialog\">Show dialog</NcButton>\n\t\t<NcDialog :buttons=\"buttons\"\n\t\t\tname=\"Create user\"\n\t\t\t:message=\"message\"\n\t\t\t:open.sync=\"showDialog\"\n\t\t\t@closing=\"response = $event\"\n\t\t\t@update:open=\"clickClosesDialog = false\" />\n\t\t<div style=\"margin-top: 8px;\">Dialog response: {{ response }}</div>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tclickClosesDialog: false,\n\t\t\tresponse: 'none',\n\t\t}\n\t},\n\n\tmethods: {\n\t\tasync callback() {\n\t\t\t// wait 3 seconds\n\t\t\tawait new Promise((resolve) => window.setTimeout(resolve, 3000))\n\t\t\tthis.clickClosesDialog = !this.clickClosesDialog\n\t\t\t// Do not close the dialog on first and then every second button click\n\t\t\tif (this.clickClosesDialog) {\n\t\t\t\t// return false means the dialog stays open\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn '✅'\n\t\t},\n\n\t\topenDialog() {\n\t\t\tthis.response = 'none'\n\t\t\tthis.showDialog = true\n\t\t},\n\t},\n\n\tcomputed: {\n\t\tbuttons() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Create user',\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\tcallback: this.callback,\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tmessage() {\n\t\t\tif (this.clickClosesDialog) {\n\t\t\t\treturn 'Next button click will work and close the dialog.'\n\t\t\t} else {\n\t\t\t\treturn 'Clicking the button will load but not close the dialog.'\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n```\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\nimport type { ComponentProps, VueClassType } from '../../utils/VueTypes.ts'\n\nimport { useElementSize } from '@vueuse/core'\nimport { computed, ref, useTemplateRef } from 'vue'\nimport { createElementId } from '../../utils/createElementId.ts'\nimport NcDialogButton from '../NcDialogButton/index.ts'\nimport NcModal from '../NcModal/index.js'\n\ntype NcDialogButtonProps = ComponentProps<typeof NcDialogButton>\n\n/**\n * Whether the dialog should be shown\n */\nconst open = defineModel<boolean>('open', { default: true })\n\nconst props = withDefaults(defineProps<{\n\t/** Name of the dialog (the heading) */\n\tname: string\n\n\t/** Text of the dialog */\n\tmessage?: string\n\n\t/** Additional elements to add to the focus trap */\n\tadditionalTrapElements?: Array<string | HTMLElement>\n\n\t/**\n\t * The element where to mount the dialog, if `null` is passed the dialog is mounted in place.\n\t */\n\tcontainer?: string\n\n\t/**\n\t * Size of the underlying NcModal\n\t */\n\tsize?: 'small' | 'normal' | 'large' | 'full'\n\n\t/**\n\t * Buttons to display\n\t */\n\tbuttons?: NcDialogButtonProps[]\n\n\t/**\n\t * Make the dialog wrapper a HTML form element.\n\t * The buttons will be wrapped within the form so they can be used as submit / reset buttons.\n\t * Please note that when using the property the `navigation` should not be used.\n\t */\n\tisForm?: boolean\n\n\t/**\n\t * Do not show the close button for the dialog.\n\t */\n\tnoClose?: boolean\n\n\t/**\n\t * Close the dialog if the user clicked outside of the dialog\n\t * Only relevant if `noClose` is not set.\n\t */\n\tcloseOnClickOutside?: boolean\n\n\t/**\n\t * Declare if hiding the modal should be animated\n\t */\n\toutTransition?: boolean\n\n\t/**\n\t * aria-label for the dialog navigation.\n\t * Use it when you want to provide a more meaningful label than the dialog name.\n\t *\n\t * By default, navigation is labeled by the dialog name.\n\t */\n\tnavigationAriaLabel?: string\n\n\t/**\n\t * aria-labelledby for the dialog navigation.\n\t * Use it when you have an implicit navigation label (e.g. a heading).\n\t *\n\t * By default, navigation is labeled by the dialog name.\n\t */\n\tnavigationAriaLabelledby?: string\n\n\t/**\n\t * Optionally pass additional classes which will be set on the content wrapper for custom styling\n\t */\n\tcontentClasses?: VueClassType\n\n\t/**\n\t * Optionally pass additional classes which will be set on the dialog itself\n\t * (the default `class` attribute will be set on the modal wrapper)\n\t */\n\tdialogClasses?: VueClassType\n\n\t/**\n\t * Optionally pass additional classes which will be set on the navigation for custom styling\n\t *\n\t * @example\n\t * ```html\n\t * <DialogBase :navigation-classes=\"['mydialog-navigation']\"><!-- --></DialogBase>\n\t * <!-- ... -->\n\t * <style lang=\"scss\">\n\t * :deep(.mydialog-navigation) {\n\t * flex-direction: row-reverse;\n\t * }\n\t * </style>\n\t * ```\n\t */\n\tnavigationClasses?: VueClassType\n}>(), {\n\tadditionalTrapElements: () => [],\n\tbuttons: () => [],\n\tcontainer: 'body',\n\tcontentClasses: '',\n\tdialogClasses: '',\n\tmessage: '',\n\tnavigationAriaLabel: '',\n\tnavigationAriaLabelledby: '',\n\tnavigationClasses: '',\n\tsize: 'small',\n})\n\nconst emit = defineEmits<{\n\t/**\n\t * Emitted when the dialog is closing, so the out transition did not finish yet.\n\t *\n\t * @param result - The result of the button callback (`undefined` if closing because of clicking the 'close'-button)\n\t */\n\tclosing: [result?: unknown]\n\t/**\n\t * Forwarded HTMLFormElement reset event (only if `is-form` is set).\n\t *\n\t * @param event - The forwarded form event\n\t */\n\treset: [event: Event]\n\t/**\n\t * Forwarded HTMLFormElement submit event (only if `is-form` is set)\n\t *\n\t * @param event - The submit event\n\t */\n\tsubmit: [event: SubmitEvent]\n}>()\n\nconst slots = defineSlots<{\n\tactions?: Slot\n\tdefault?: Slot\n\tnavigation?: Slot\n}>()\n\n/**\n * The dialog wrapper element\n */\nconst wrapperElement = useTemplateRef('wrapper')\n\n/**\n * We use the dialog width to decide if we collapse the navigation (flex direction row)\n */\nconst { width: dialogWidth } = useElementSize(wrapperElement, { width: 900, height: 0 })\n\n/**\n * Whether the navigation is collapsed due to dialog and window size\n * (collapses when modal is below: 900px modal width - 2x 12px margin)\n */\nconst isNavigationCollapsed = computed(() => dialogWidth.value < 876)\n\n/**\n * Whether a navigation was passed and the element should be displayed\n */\nconst hasNavigation = computed(() => slots?.navigation !== undefined)\n\n/**\n * The unique id of the nav element\n */\nconst navigationId = createElementId()\n\n/**\n * aria-label attribute for the nav element\n */\nconst navigationAriaLabelAttr = computed(() => props.navigationAriaLabel || undefined)\n\n/**\n * aria-labelledby attribute for the nav element\n */\nconst navigationAriaLabelledbyAttr = computed(() => {\n\tif (props.navigationAriaLabel) {\n\t\t// Not needed, already labelled by aria-label\n\t\treturn undefined\n\t}\n\t// Use dialog name as a fallback label for navigation\n\treturn props.navigationAriaLabelledby || navigationId\n})\n\nconst dialogRootElement = useTemplateRef<HTMLDivElement | HTMLFormElement>('dialogElement')\n/**\n * The HTML element to use for the dialog wrapper - either form or plain div\n */\nconst dialogTagName = computed(() => props.isForm && !hasNavigation.value ? 'form' : 'div')\n/**\n * Listener to assign to the dialog element\n * This only sets the `@submit` listener if the dialog element is a form\n */\nconst dialogListeners = computed(() => {\n\tif (dialogTagName.value !== 'form') {\n\t\treturn {}\n\t}\n\n\treturn {\n\t\t/**\n\t\t * @param event - Form submit event\n\t\t */\n\t\tsubmit(event: SubmitEvent) {\n\t\t\tevent.preventDefault()\n\t\t\temit('submit', event)\n\t\t},\n\n\t\t/**\n\t\t * @param event - Form submit event\n\t\t */\n\t\treset(event: Event) {\n\t\t\tevent.preventDefault()\n\t\t\temit('reset', event)\n\t\t},\n\t}\n})\n\n/**\n * If the underlying modal is shown\n */\nconst showModal = ref(true)\n\n// Because NcModal does not emit `close` when show prop is changed\n/**\n * Handle clicking a dialog button -> should close\n *\n * @param button - The button that was clicked\n * @param result - Result of the callback function\n */\nfunction handleButtonClose(button: NcDialogButtonProps, result: unknown) {\n\t// Skip close on submit if invalid dialog\n\tif (button.type === 'submit'\n\t\t&& dialogTagName.value === 'form'\n\t\t&& 'reportValidity' in dialogRootElement.value!\n\t\t&& !dialogRootElement.value.reportValidity()) {\n\t\treturn\n\t}\n\thandleClosing(result)\n\twindow.setTimeout(() => handleClosed(), 300)\n}\n\n/**\n * Handle closing the dialog, optional out transition did not run yet\n *\n * @param result - The result of the callback\n */\nfunction handleClosing(result?: unknown): void {\n\tshowModal.value = false\n\temit('closing', result)\n}\n\n/**\n * Handle dialog closed (out transition finished)\n */\nfunction handleClosed() {\n\tshowModal.value = true\n\topen.value = false\n}\n\n/**\n * Properties to pass to the underlying NcModal\n */\nconst modalProps = computed(() => ({\n\tnoClose: props.noClose,\n\tcontainer: props.container === undefined ? 'body' : props.container,\n\t// we do not pass the name as we already have the name as the headline\n\t// name: props.name,\n\t// But we need to set the correct label id so the dialog is labelled\n\tlabelId: navigationId,\n\tsize: props.size,\n\tshow: open.value && showModal.value,\n\toutTransition: props.outTransition,\n\tcloseOnClickOutside: props.closeOnClickOutside,\n\tadditionalTrapElements: props.additionalTrapElements,\n}))\n</script>\n\n<template>\n\t<NcModal\n\t\tv-if=\"open\"\n\t\tclass=\"dialog__modal\"\n\t\t:enable-slideshow=\"false\"\n\t\tdisable-swipe\n\t\tv-bind=\"modalProps\"\n\t\t@close=\"handleClosed\"\n\t\t@update:show=\"handleClosing()\">\n\t\t<!-- The dialog name / header -->\n\t\t<h2 :id=\"navigationId\" class=\"dialog__name\" v-text=\"name\" />\n\t\t<component\n\t\t\t:is=\"dialogTagName\"\n\t\t\tref=\"dialogElement\"\n\t\t\tclass=\"dialog\"\n\t\t\t:class=\"dialogClasses\"\n\t\t\tv-on=\"dialogListeners\">\n\t\t\t<div ref=\"wrapper\" class=\"dialog__wrapper\" :class=\"[{ 'dialog__wrapper--collapsed': isNavigationCollapsed }]\">\n\t\t\t\t<!-- When the navigation is collapsed (too small dialog) it is displayed above the main content, otherwise on the inline start -->\n\t\t\t\t<nav\n\t\t\t\t\tv-if=\"hasNavigation\"\n\t\t\t\t\tclass=\"dialog__navigation\"\n\t\t\t\t\t:class=\"navigationClasses\"\n\t\t\t\t\t:aria-label=\"navigationAriaLabelAttr\"\n\t\t\t\t\t:aria-labelledby=\"navigationAriaLabelledbyAttr\">\n\t\t\t\t\t<slot name=\"navigation\" :is-collapsed=\"isNavigationCollapsed\" />\n\t\t\t\t</nav>\n\t\t\t\t<!-- Main dialog content -->\n\t\t\t\t<div class=\"dialog__content\" :class=\"contentClasses\">\n\t\t\t\t\t<slot>\n\t\t\t\t\t\t<p class=\"dialog__text\">\n\t\t\t\t\t\t\t{{ message }}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!-- The dialog actions aka the buttons -->\n\t\t\t<div class=\"dialog__actions\">\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<NcDialogButton\n\t\t\t\t\t\tv-for=\"(button, idx) in buttons\"\n\t\t\t\t\t\t:key=\"idx\"\n\t\t\t\t\t\tv-bind=\"button\"\n\t\t\t\t\t\t@click=\"(_, result) => handleButtonClose(button, result)\" />\n\t\t\t\t</slot>\n\t\t\t</div>\n\t\t</component>\n\t</NcModal>\n</template>\n\n<style lang=\"scss\">\n/** When having the small dialog style we override the modal styling so dialogs look more dialog like */\n@media only screen and (max-width: $breakpoint-small-mobile) {\n\t.dialog__modal .modal-wrapper--small .modal-container {\n\t\twidth: fit-content;\n\t\theight: unset;\n\t\tmax-height: 90%;\n\t\tposition: relative;\n\t\ttop: unset;\n\t\tborder-radius: var(--border-radius-element);\n\t}\n}\n</style>\n\n<style lang=\"scss\" scoped>\n.dialog {\n\theight: 100%;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\toverflow: hidden;\n\n\t&__modal {\n\t\t:deep(.modal-wrapper .modal-container) {\n\t\t\tdisplay: flex !important;\n\t\t\tpadding-block: 4px 0; // 4px to align with close button, 0 block-end to make overflowing content on scroll look nice\n\t\t\tpadding-inline: 12px 0; // Same as with padding-block, we need the actions to have a margin of 4px for the button outline\n\t\t}\n\t\t:deep(.modal-wrapper .modal-container__content) {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\toverflow: hidden; // Only overflow on the .dialog__content\n\t\t}\n\t}\n\n\t&__wrapper {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\t// Auto scale to fit\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: hidden;\n\n\t\t&--collapsed {\n\t\t\tflex-direction: column;\n\t\t}\n\t}\n\n\t&__navigation {\n\t\tdisplay: flex;\n\t\tflex-shrink: 0;\n\t}\n\n\t// Navigation styling when side-by-side with content\n\t&__wrapper:not(&__wrapper--collapsed) &__navigation {\n\t\tflex-direction: column;\n\n\t\toverflow: hidden auto;\n\t\theight: 100%;\n\t\tmin-width: 200px;\n\t\tmargin-inline-end: 20px;\n\t}\n\n\t// Navigation styling when on top of content\n\t&__wrapper#{&}__wrapper--collapsed &__navigation {\n\t\tflex-direction: row;\n\t\tjustify-content: space-between;\n\n\t\toverflow: auto hidden;\n\t\twidth: 100%;\n\t\tmin-width: 100%;\n\t}\n\n\t&__name {\n\t\tfont-size: 21px;\n\n\t\ttext-align: center;\n\t\theight: fit-content;\n\t\tmin-height: var(--default-clickable-area);\n\t\tline-height: var(--default-clickable-area);\n\t\toverflow-wrap: break-word;\n\t\tmargin-block: 0 12px;\n\t}\n\n\t&__content {\n\t\t// Auto fit\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t\t// see .dialog__modal, we can not set the padding there to prevent floating scroll bars\n\t\tpadding-inline-end: 12px;\n\t}\n\n\t// In case only text content is show\n\t&__text {\n\t\t// Also add padding to the bottom to make it more readable\n\t\tpadding-block-end: 6px;\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t\talign-content: center;\n\t\tjustify-content: end;\n\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t\tpadding-inline: 0 12px; // 12px to align with the overall modal padding\n\t\tmargin-inline: 0;\n\t\tmargin-block: 0;\n\n\t\t&:not(:empty) {\n\t\t\tmargin-block: 6px 12px; // only if there are actions, we add margin so if it is empty scroll content looks nice\n\t\t}\n\t}\n}\n\n@media only screen and (max-width: $breakpoint-small-mobile) {\n\t// Ensure the dialog name does not interfere with the close button\n\t.dialog__name {\n\t\ttext-align: start;\n\t\tmargin-inline-end: var(--default-clickable-area);\n\t}\n}\n</style>\n"],"names":["_useModel","_useSlots","_openBlock","_createBlock","_unref","_mergeProps","_createElementVNode","_toDisplayString","name","_resolveDynamicComponent","dialogClasses","_toHandlers","_normalizeClass","_createElementBlock","navigationClasses","_renderSlot","contentClasses","message","_Fragment","_renderList","buttons"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmOA,UAAM,OAAOA,SAAoB,SAAC,MAAyB;AAE3D,UAAM,QAAQ;AAuGd,UAAM,OAAO;AAqBb,UAAM,QAAQC,SAAA;AASd,UAAM,iBAAiB,eAAe,SAAS;AAK/C,UAAM,EAAE,OAAO,YAAA,IAAgB,eAAe,gBAAgB,EAAE,OAAO,KAAK,QAAQ,GAAG;AAMvF,UAAM,wBAAwB,SAAS,MAAM,YAAY,QAAQ,GAAG;AAKpE,UAAM,gBAAgB,SAAS,MAAM,OAAO,eAAe,MAAS;AAKpE,UAAM,eAAe,gBAAA;AAKrB,UAAM,0BAA0B,SAAS,MAAM,MAAM,uBAAuB,MAAS;AAKrF,UAAM,+BAA+B,SAAS,MAAM;AACnD,UAAI,MAAM,qBAAqB;AAE9B,eAAO;AAAA,MACR;AAEA,aAAO,MAAM,4BAA4B;AAAA,IAC1C,CAAC;AAED,UAAM,oBAAoB,eAAiD,eAAe;AAI1F,UAAM,gBAAgB,SAAS,MAAM,MAAM,UAAU,CAAC,cAAc,QAAQ,SAAS,KAAK;AAK1F,UAAM,kBAAkB,SAAS,MAAM;AACtC,UAAI,cAAc,UAAU,QAAQ;AACnC,eAAO,CAAA;AAAA,MACR;AAEA,aAAO;AAAA;AAAA;AAAA;AAAA,QAIN,OAAO,OAAoB;AAC1B,gBAAM,eAAA;AACN,eAAK,UAAU,KAAK;AAAA,QACrB;AAAA;AAAA;AAAA;AAAA,QAKA,MAAM,OAAc;AACnB,gBAAM,eAAA;AACN,eAAK,SAAS,KAAK;AAAA,QACpB;AAAA,MAAA;AAAA,IAEF,CAAC;AAKD,UAAM,YAAY,IAAI,IAAI;AAS1B,aAAS,kBA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lBD,KAAI;AAAA,gBAAU,OAAKM,eAAA,CAAC,mBAAiB,CAAA,EAAA,8BAA0C,sBAAA,MAAA,CAAqB,CAAA,CAAA;AAAA,cAAA;gBAGjG,cAAA,sBADPC,mBAOM,OAAA;AAAA;kBALL,OAAKD,eAAA,CAAC,sBACEE,KAAAA,iBAAiB,CAAA;AAAA,kBACxB,cAAY,wBAAA;AAAA,kBACZ,mBAAiB,6BAAA;AAAA,gBAAA;kBAClBC,WAAgE,KAAA,QAAA,cAAA,EAAvC,aAAc,sBAAA,SAAqB,QAAA,IAAA;AAAA,gBAAA;gBAG7DT,mBAMM,OAAA;AAAA,kBAND,OAAKM,eAAA,CAAC,mBAA0BI,KAAAA,cAAc,CAAA;AAAA,gBAAA;kBAClDD,WAIO,4BAJP,MAIO;AAAA,oBAHNT,mBAEI,KAFJ,YAEIC,gBADAU,KAAAA,OAAO,GAAA,CAAA;AAAA,kBAAA;;;cAMdX,mBAQM,OARN,YAQM;AAAA,gBAPLS,WAMO,4BANP,MAMO;AAAA,mBALNb,UAAA,IAAA,GAAAW,mBAI6DK,UAAA,MAAAC,WAHpCC,KAAAA,SAAO,CAAvB,QAAQ,QAAG;AADpB,2BAAAlB,UAAA,GAAAC,YAI6DC,oBAJ7DC,WAI6D,EAF3D,KAAK,0BACE,QAAM;AAAA,sBACb,SAAK,CAAG,GAAG,WAAW,kBAAkB,QAAQ,MAAM;AAAA,oBAAA;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, createBlock, openBlock, unref, withCtx, createTextVNode, toDisplayString, renderSlot, createCommentVNode } from "vue";
|
|
2
|
-
import { r as register, a as t } from "./_l10n-
|
|
3
|
-
import { N as NcButton } from "./NcButton-
|
|
4
|
-
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-
|
|
2
|
+
import { r as register, a as t } from "./_l10n-CWKr1fUH.mjs";
|
|
3
|
+
import { N as NcButton } from "./NcButton-ZNHdqKQl.mjs";
|
|
4
|
+
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-BvLanNaW.mjs";
|
|
5
5
|
import { N as NcLoadingIcon } from "./NcLoadingIcon-b_ajZ_nQ.mjs";
|
|
6
6
|
register();
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -66,4 +66,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
66
66
|
export {
|
|
67
67
|
_sfc_main as _
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=NcDialogButton.vue_vue_type_script_setup_true_lang-
|
|
69
|
+
//# sourceMappingURL=NcDialogButton.vue_vue_type_script_setup_true_lang-CF6LnBe7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcDialogButton.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"NcDialogButton.vue_vue_type_script_setup_true_lang-CF6LnBe7.mjs","sources":["../../src/components/NcDialogButton/NcDialogButton.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\nDialog button component used by NcDialog in the actions slot to display the buttons passed by the `buttons` prop.\n</docs>\n\n<template>\n\t<NcButton\n\t\t:aria-label=\"label\"\n\t\t:disabled\n\t\t:type\n\t\t:variant\n\t\t@click=\"handleClick\">\n\t\t{{ label }}\n\t\t<template #icon>\n\t\t\t<!-- @slot Allow to set a custom icon for the button -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- The loading state is an information that must be accessible -->\n\t\t\t\t<NcLoadingIcon v-if=\"isLoading\" :name=\"t('Loading …') /* TRANSLATORS: The button is in a loading state*/\" />\n\t\t\t\t<NcIconSvgWrapper v-else-if=\"icon !== undefined\" :svg=\"icon\" />\n\t\t\t</slot>\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script setup lang=\"ts\">\nimport type { ButtonType, ButtonVariant } from '../NcButton/index.ts'\n\nimport { ref } from 'vue'\nimport { t } from '../../l10n.ts'\nimport NcButton from '../NcButton/index.ts'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/index.ts'\nimport NcLoadingIcon from '../NcLoadingIcon/index.ts'\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * The function that will be called when the button is pressed.\n\t * If the function returns `false` the click is ignored and the dialog will not be closed,\n\t * which is the default behavior of \"reset\"-buttons.\n\t *\n\t * @default '() => {}'\n\t */\n\tcallback?: () => unknown | false\n\n\t/**\n\t * If the button should be shown as disabled.\n\t *\n\t * @default false\n\t */\n\tdisabled?: boolean\n\n\t/**\n\t * Optional inline SVG icon for the button.\n\t *\n\t * @default undefined\n\t */\n\ticon?: string\n\n\t/**\n\t * The label of the button.\n\t */\n\tlabel: string\n\n\t/**\n\t * The button type, see `NcButton`.\n\t *\n\t * @default 'button'\n\t */\n\ttype?: ButtonType\n\n\t/**\n\t * The button variant, see `NcButton`.\n\t *\n\t * @default 'tertiary'\n\t * @since 8.24.0\n\t */\n\tvariant?: ButtonVariant\n}>(), {\n\tcallback: () => {},\n\tdisabled: false,\n\ticon: undefined,\n\ttype: 'button',\n\tvariant: 'tertiary',\n})\n\nconst emit = defineEmits<{\n\t/**\n\t * The click event (`MouseEvent`) and the value returned by the callback\n\t */\n\tclick: [event: MouseEvent, payload: unknown]\n}>()\n\nconst isLoading = ref(false)\n\n/**\n * Handle clicking the button\n *\n * @param e The click event\n */\nasync function handleClick(e: MouseEvent) {\n\t// Do not re-emit while loading\n\tif (isLoading.value) {\n\t\treturn\n\t}\n\n\tisLoading.value = true\n\ttry {\n\t\t// for reset buttons the default is \"false\"\n\t\tconst fallback = props.type === 'reset' ? false : undefined\n\t\tconst result = await props.callback?.() ?? fallback\n\t\tif (result !== false) {\n\t\t\temit('click', e, result)\n\t\t}\n\t} finally {\n\t\tisLoading.value = false\n\t}\n}\n</script>\n"],"names":["_createBlock","_unref","label","disabled","type","variant","_renderSlot","icon"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,UAAM,QAAQ;AAmDd,UAAM,OAAO;AAOb,UAAM,YAAY,IAAI,KAAK;AAO3B,mBAAe,YAAY,GAAe;AAEzC,UAAI,UAAU,OAAO;AACpB;AAAA,MACD;AAEA,gBAAU,QAAQ;AAClB,UAAI;AAEH,cAAM,WAAW,MAAM,SAAS,UAAU,QAAQ;AAClD,cAAM,SAAS,MAAM,MAAM,WAAA,KAAgB;AAC3C,YAAI,WAAW,OAAO;AACrB,eAAK,SAAS,GAAG,MAAM;AAAA,QACxB;AAAA,MACD,UAAA;AACC,kBAAU,QAAQ;AAAA,MACnB;AAAA,IACD;;0BA7GCA,YAeWC,MAAA,QAAA,GAAA;AAAA,QAdT,cAAYC,KAAAA;AAAAA,QACZ,UAAAC,KAAAA;AAAAA,QACA,MAAAC,KAAAA;AAAAA,QACA,SAAAC,KAAAA;AAAAA,QACA,SAAO;AAAA,MAAA;QAEG,cAEV,MAIO;AAAA,UAJPC,WAIO,yBAJP,MAIO;AAAA,YAFe,UAAA,sBAArBN,YAA4GC,MAAA,aAAA,GAAA;AAAA;cAA3E,MAAMA,MAAA,CAAA,EAAC,WAAA;AAAA;AAAA,YAAA,yBACXM,KAAAA,SAAS,uBAAtCP,YAA+DC,MAAA,gBAAA,GAAA;AAAA;cAAb,KAAKM,KAAAA;AAAAA,YAAAA;;;yBANzD,MAAW;AAAA,UAARL,gBAAAA,gBAAAA,KAAAA,KAAK,IAAG,KACX,CAAA;AAAA,QAAA;;;;;;"}
|
|
@@ -4,14 +4,14 @@ import { Picker, Emoji, EmojiIndex } from "emoji-mart-vue-fast/src/index.js";
|
|
|
4
4
|
import { isFocusable } from "tabbable";
|
|
5
5
|
import { createElementBlock, openBlock, mergeProps, createElementVNode, createCommentVNode, toDisplayString, resolveComponent, createBlock, withCtx, createVNode, withKeys, withModifiers, createSlots, normalizeStyle, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
6
6
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
7
|
-
import { N as NcColorPicker } from "./NcColorPicker-
|
|
7
|
+
import { N as NcColorPicker } from "./NcColorPicker-BFcR9_1o.mjs";
|
|
8
8
|
import { u as useTrapStackControl } from "./useTrapStackControl-B6cEicto.mjs";
|
|
9
9
|
import { s as setCurrentSkinTone, g as getCurrentSkinTone } from "./emoji-BY_D0V5K.mjs";
|
|
10
|
-
import { r as register,
|
|
11
|
-
import { C as Color } from "./colors-
|
|
12
|
-
import { N as NcButton } from "./NcButton-
|
|
10
|
+
import { r as register, j as t42, k as t37, l as t16, m as t5, a as t } from "./_l10n-CWKr1fUH.mjs";
|
|
11
|
+
import { C as Color } from "./colors-BM9KkzNS.mjs";
|
|
12
|
+
import { N as NcButton } from "./NcButton-ZNHdqKQl.mjs";
|
|
13
13
|
import { N as NcPopover } from "./NcPopover-C-MTaPCs.mjs";
|
|
14
|
-
import { _ as _sfc_main$2 } from "./NcTextField.vue_vue_type_script_setup_true_lang-
|
|
14
|
+
import { _ as _sfc_main$2 } from "./NcTextField.vue_vue_type_script_setup_true_lang-BNSMSqMx.mjs";
|
|
15
15
|
const _sfc_main$1 = {
|
|
16
16
|
name: "CircleIcon",
|
|
17
17
|
emits: ["click"],
|
|
@@ -55,7 +55,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
55
55
|
], 16, _hoisted_1$1);
|
|
56
56
|
}
|
|
57
57
|
const IconCircle = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
58
|
-
register(t5, t16,
|
|
58
|
+
register(t5, t16, t37, t42);
|
|
59
59
|
let emojiIndex;
|
|
60
60
|
const i18n = {
|
|
61
61
|
search: t("Search emoji"),
|
|
@@ -403,4 +403,4 @@ const NcEmojiPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_re
|
|
|
403
403
|
export {
|
|
404
404
|
NcEmojiPicker as N
|
|
405
405
|
};
|
|
406
|
-
//# sourceMappingURL=NcEmojiPicker-
|
|
406
|
+
//# sourceMappingURL=NcEmojiPicker-DMiiRPm1.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcEmojiPicker-CwR_8bCR.mjs","sources":["../../node_modules/vue-material-design-icons/Circle.vue","../../src/components/NcEmojiPicker/NcEmojiPicker.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon circle-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"CircleIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### General description\n\nThis component allows the user to pick an emoji.\n\n### Usage\n\n* Listen to the select event and pass in an HTML element that will be treated as a trigger:\n\n```vue\n<template>\n\t<div>\n\t\t<NcEmojiPicker @select=\"select\" style=\"display: inline-block\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcEmojiPicker>\n\t\t<span>selected emoji: {{ emoji }}</span>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\temoji: '',\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tselect(emoji) {\n\t\t\t\tthis.emoji = emoji\n\t\t\t},\n\t\t},\n\t}\n</script>\n```\n\n* Showing a preview and keeping it open after a user selected an emoji\n\n```vue\n<template>\n\t<div>\n\t\t<NcEmojiPicker\n\t\t\t:close-on-select=\"false\"\n\t\t\t:show-preview=\"true\"\n\t\t\t@select=\"select\"\n\t\t\tstyle=\"display: inline-block\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcEmojiPicker>\n\t\t<span>selected emoji: {{ emoji }}</span>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\temoji: '',\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tselect(emoji) {\n\t\t\t\tthis.emoji = emoji\n\t\t\t},\n\t\t},\n\t}\n</script>\n```\n\n* Allow unselecting a previously set emoji.\n\n```vue\n<template>\n\t<div>\n\t\t<NcEmojiPicker\n\t\t\t:show-preview=\"true\"\n\t\t\t:allow-unselect=\"true\"\n\t\t\t:selected-emoji=\"emoji\"\n\t\t\t@select=\"select\"\n\t\t\t@unselect=\"unselect\"\n\t\t\tstyle=\"display: inline-block\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcEmojiPicker>\n\t\t<span>selected emoji: {{ emoji }}</span>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\temoji: '',\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tselect(emoji) {\n\t\t\t\tthis.emoji = emoji\n\t\t\t},\n\t\t\tunselect() {\n\t\t\t\tthis.emoji = ''\n\t\t\t},\n\t\t},\n\t}\n</script>\n```\n\n</docs>\n\n<template>\n\t<NcPopover\n\t\tref=\"popover\"\n\t\tv-model:shown=\"open\"\n\t\t:container=\"container\"\n\t\tpopup-role=\"dialog\"\n\t\t:no-focus-trap=\"true /* Handled manually to remove emoji buttons from TAB sequence */\"\n\t\t@after-show=\"afterShow\"\n\t\t@after-hide=\"afterHide\">\n\t\t<template #trigger=\"slotProps\">\n\t\t\t<slot v-bind=\"slotProps\" />\n\t\t</template>\n\t\t<div class=\"nc-emoji-picker-container\">\n\t\t\t<Picker\n\t\t\t\tref=\"picker\"\n\t\t\t\tcolor=\"var(--color-primary-element)\"\n\t\t\t\t:data=\"emojiIndex\"\n\t\t\t\t:emoji=\"previewFallbackEmoji\"\n\t\t\t\t:i18n\n\t\t\t\t:native\n\t\t\t\t:emoji-size=\"20\"\n\t\t\t\t:per-line=\"8\"\n\t\t\t\t:picker-styles=\"{ width: '320px' }\"\n\t\t\t\t:show-preview\n\t\t\t\t:skin=\"currentSkinTone\"\n\t\t\t\t:show-skin-tones=\"false\"\n\t\t\t\t:title=\"previewFallbackName\"\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\t:aria-label=\"t('Emoji picker')\"\n\t\t\t\tv-bind=\"$attrs\"\n\t\t\t\t@keydown.tab.prevent=\"handleTabNavigationSkippingEmojis\"\n\t\t\t\t@select=\"select\">\n\t\t\t\t<template #searchTemplate=\"{ onSearch }\">\n\t\t\t\t\t<div class=\"search__wrapper\">\n\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\tref=\"search\"\n\t\t\t\t\t\t\tv-model=\"search\"\n\t\t\t\t\t\t\tclass=\"search\"\n\t\t\t\t\t\t\t:label=\"t('Search')\"\n\t\t\t\t\t\t\t:label-visible=\"true\"\n\t\t\t\t\t\t\t:placeholder=\"i18n.search\"\n\t\t\t\t\t\t\ttrailing-button-icon=\"close\"\n\t\t\t\t\t\t\t:trailing-button-label=\"t('Clear search')\"\n\t\t\t\t\t\t\t:show-trailing-button=\"search !== ''\"\n\t\t\t\t\t\t\t@keydown.left=\"callPickerArrowHandlerWithScrollFix('onArrowLeft', $event)\"\n\t\t\t\t\t\t\t@keydown.right=\"callPickerArrowHandlerWithScrollFix('onArrowRight', $event)\"\n\t\t\t\t\t\t\t@keydown.down=\"callPickerArrowHandlerWithScrollFix('onArrowDown', $event)\"\n\t\t\t\t\t\t\t@keydown.up=\"callPickerArrowHandlerWithScrollFix('onArrowUp', $event)\"\n\t\t\t\t\t\t\t@keydown.enter=\"$refs.picker.onEnter($event)\"\n\t\t\t\t\t\t\t@trailing-button-click=\"clearSearch(); onSearch('');\"\n\t\t\t\t\t\t\t@update:model-value=\"onSearch(search)\" />\n\t\t\t\t\t\t<NcColorPicker\n\t\t\t\t\t\t\tpalette-only\n\t\t\t\t\t\t\t:container\n\t\t\t\t\t\t\t:palette=\"skinTonePalette\"\n\t\t\t\t\t\t\t:model-value=\"currentColor.color\"\n\t\t\t\t\t\t\t@update:model-value=\"onChangeSkinTone\">\n\t\t\t\t\t\t\t<NcButton :aria-label=\"t('Skin tone')\" variant=\"tertiary-no-background\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<IconCircle :style=\"{ color: currentColor.color }\" :title=\"currentColor.name\" :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t</NcColorPicker>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"allowUnselect && selectedEmoji\" #customCategory>\n\t\t\t\t\t<div class=\"emoji-mart-category-label\">\n\t\t\t\t\t\t<h3 class=\"emoji-mart-category-label\">\n\t\t\t\t\t\t\t{{ t('Selected') }}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Emoji\n\t\t\t\t\t\tclass=\"emoji-selected\"\n\t\t\t\t\t\t:data=\"emojiIndex\"\n\t\t\t\t\t\t:emoji=\"selectedEmoji\"\n\t\t\t\t\t\tnative\n\t\t\t\t\t\t:size=\"32\"\n\t\t\t\t\t\t@click=\"unselect\" />\n\t\t\t\t\t<Emoji\n\t\t\t\t\t\tclass=\"emoji-delete\"\n\t\t\t\t\t\t:data=\"emojiIndex\"\n\t\t\t\t\t\temoji=\":x:\"\n\t\t\t\t\t\tnative\n\t\t\t\t\t\t:size=\"10\"\n\t\t\t\t\t\t@click=\"unselect\" />\n\t\t\t\t</template>\n\t\t\t</Picker>\n\t\t</div>\n\t</NcPopover>\n</template>\n\n<script>\nimport data from 'emoji-mart-vue-fast/data/all.json'\nimport { Emoji, EmojiIndex, Picker } from 'emoji-mart-vue-fast/src/index.js'\nimport { isFocusable } from 'tabbable'\nimport IconCircle from 'vue-material-design-icons/Circle.vue'\nimport NcColorPicker from '../NcColorPicker/NcColorPicker.vue'\nimport { useTrapStackControl } from '../../composables/useTrapStackControl.ts'\nimport { getCurrentSkinTone, setCurrentSkinTone } from '../../functions/emoji/emoji.ts'\nimport { t } from '../../l10n.ts'\nimport { Color } from '../../utils/colors.ts'\nimport NcButton from '../NcButton/index.ts'\nimport NcPopover from '../NcPopover/index.js'\nimport NcTextField from '../NcTextField/index.ts'\n\n// Shared emoji index and skinTone for all NcEmojiPicker instances\n// Will be initialized on the first NcEmojiPicker creating\nlet emojiIndex\n\nconst i18n = {\n\tsearch: t('Search emoji'),\n\tnotfound: t('No emoji found'),\n\tcategories: {\n\t\tsearch: t('Search results'),\n\t\trecent: t('Frequently used'),\n\t\tsmileys: t('Smileys & Emotion'),\n\t\tpeople: t('People & Body'),\n\t\tnature: t('Animals & Nature'),\n\t\tfoods: t('Food & Drink'),\n\t\tactivity: t('Activities'),\n\t\tplaces: t('Travel & Places'),\n\t\tobjects: t('Objects'),\n\t\tsymbols: t('Symbols'),\n\t\tflags: t('Flags'),\n\t\tcustom: t('Custom'),\n\t},\n}\n\nconst skinTonePalette = [\n\tnew Color(255, 222, 52, t('Neutral skin color')),\n\tnew Color(228, 205, 166, t('Light skin tone')),\n\tnew Color(250, 221, 192, t('Medium light skin tone')),\n\tnew Color(174, 129, 87, t('Medium skin tone')),\n\tnew Color(158, 113, 88, t('Medium dark skin tone')),\n\tnew Color(96, 79, 69, t('Dark skin tone')),\n]\n\nexport default {\n\tname: 'NcEmojiPicker',\n\n\tcomponents: {\n\t\tIconCircle,\n\t\tNcButton,\n\t\tNcColorPicker,\n\t\tNcPopover,\n\t\tNcTextField,\n\t\tEmoji,\n\t\tPicker,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The emoji-set\n\t\t */\n\t\tactiveSet: {\n\t\t\ttype: String,\n\t\t\tdefault: 'native',\n\t\t},\n\n\t\t/**\n\t\t * Show preview section when hovering emoji\n\t\t */\n\t\tshowPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Allow unselecting the selected emoji\n\t\t */\n\t\tallowUnselect: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selected emoji to allow unselecting\n\t\t */\n\t\tselectedEmoji: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The fallback emoji in the preview section\n\t\t */\n\t\tpreviewFallbackEmoji: {\n\t\t\ttype: String,\n\t\t\tdefault: 'grinning',\n\t\t},\n\n\t\t/**\n\t\t * The fallback text in the preview section\n\t\t */\n\t\tpreviewFallbackName: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Pick an emoji'),\n\t\t},\n\n\t\t/**\n\t\t * Whether to close the emoji picker after picking one\n\t\t */\n\t\tcloseOnSelect: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: [Boolean, String, Object, Element],\n\t\t\tdefault: 'body',\n\t\t},\n\t},\n\n\temits: [\n\t\t'select',\n\t\t'selectData',\n\t\t'unselect',\n\t],\n\n\tsetup() {\n\t\t// If this is the first instance of NcEmojiPicker - setup EmojiIndex\n\t\tif (!emojiIndex) {\n\t\t\temojiIndex = new EmojiIndex(data)\n\t\t}\n\n\t\treturn {\n\t\t\t// Non-reactive constants\n\t\t\temojiIndex,\n\t\t\tskinTonePalette,\n\t\t\ti18n,\n\t\t}\n\t},\n\n\tdata() {\n\t\tconst currentSkinTone = getCurrentSkinTone()\n\n\t\treturn {\n\t\t\t/**\n\t\t\t * The current active color from the skin tone palette\n\t\t\t */\n\t\t\tcurrentColor: skinTonePalette[currentSkinTone - 1],\n\t\t\t/**\n\t\t\t * The current active skin tone\n\t\t\t *\n\t\t\t * @type {1|2|3|4|5|6}\n\t\t\t */\n\t\t\tcurrentSkinTone,\n\t\t\tsearch: '',\n\t\t\topen: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tnative() {\n\t\t\treturn this.activeSet === 'native'\n\t\t},\n\t},\n\n\tcreated() {\n\t\t// Component has its own custom focus management\n\t\t// The global focus trap stack should be paused\n\t\tuseTrapStackControl(() => this.open)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\tclearSearch() {\n\t\t\tthis.search = ''\n\t\t\tthis.$refs.search.focus()\n\t\t},\n\n\t\t/**\n\t\t * Update the current skin tone by the result of the color picker\n\t\t *\n\t\t * @param {string} color Color set\n\t\t */\n\t\tonChangeSkinTone(color) {\n\t\t\tconst index = this.skinTonePalette.findIndex((tone) => tone.color.toLowerCase() === color.toLowerCase())\n\t\t\tif (index > -1) {\n\t\t\t\tthis.currentSkinTone = index + 1\n\t\t\t\tthis.currentColor = this.skinTonePalette[index]\n\t\t\t\tsetCurrentSkinTone(this.currentSkinTone)\n\t\t\t}\n\t\t},\n\n\t\tselect(emojiObject) {\n\t\t\t/**\n\t\t\t * Emits a string containing the emoji e.g. '👩🏿💻'\n\t\t\t */\n\t\t\tthis.$emit('select', emojiObject.native)\n\n\t\t\t/**\n\t\t\t * Emits a object with more data about the picked emoji\n\t\t\t */\n\t\t\tthis.$emit('selectData', emojiObject)\n\n\t\t\tif (this.closeOnSelect) {\n\t\t\t\tthis.open = false\n\t\t\t}\n\t\t},\n\n\t\tunselect() {\n\t\t\tthis.$emit('unselect')\n\t\t},\n\n\t\tafterShow() {\n\t\t\tthis.$refs.search.focus()\n\t\t},\n\n\t\tafterHide() {\n\t\t\t// Manually return focus to the trigger button, as we disabled focus-trap\n\t\t\t// But only if there is no focus target outside the picker, for example, input element that received focus by click closing the emoji picker\n\t\t\tif (!document.activeElement || this.$refs.picker.$el.contains(document.activeElement) || !isFocusable(document.activeElement)) {\n\t\t\t\tthis.$refs.popover.$el.querySelector('button, [role=\"button\"]')?.focus()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Manually handle Tab navigation skipping emoji buttons.\n\t\t * Navigation over emojis is handled by Arrow keys.\n\t\t *\n\t\t * @param {KeyboardEvent} event - Keyboard event\n\t\t */\n\t\thandleTabNavigationSkippingEmojis(event) {\n\t\t\tconst current = event.target\n\t\t\tconst focusable = Array.from(this.$refs.picker.$el.querySelectorAll('button:not(.emoji-mart-emoji), input'))\n\t\t\tif (!event.shiftKey) {\n\t\t\t\tconst nextNode = focusable.find((node) => current.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING) || focusable[0]\n\t\t\t\tnextNode.focus()\n\t\t\t} else {\n\t\t\t\tconst prevNode = focusable.findLast((node) => current.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_PRECEDING) || focusable.at(-1)\n\t\t\t\tprevNode.focus()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle arrow navigation via <Picker>'s handlers with scroll bug fix\n\t\t *\n\t\t * @param {'onArrowLeft' | 'onArrowRight' | 'onArrowDown' | 'onArrowUp'} originalHandlerName - Picker's arrow keydown handler name\n\t\t * @param {KeyboardEvent} event - Keyboard event\n\t\t */\n\t\tasync callPickerArrowHandlerWithScrollFix(originalHandlerName, event) {\n\t\t\t// Call the original handler\n\t\t\t// See: https://github.com/serebrov/emoji-mart-vue/blob/a1ea72673a111cce78dc8caad8bc9ea3e02ad5bd/src/components/Picker.vue#L29\n\t\t\t// TODO: expose these methods via slot props in upstream library\n\t\t\tthis.$refs.picker[originalHandlerName](event)\n\n\t\t\t// Wait until emoji-mart-vue-fast scrolls\n\t\t\tawait this.$nextTick()\n\n\t\t\t// Scroll position is incorrect after emoji-mart-vue-fast scrolls...\n\t\t\t// It calculates scroll incorrectly.\n\t\t\t// It doesn't take into account, that emojis are wrapped into categories sections\n\t\t\t// See: https://github.com/serebrov/emoji-mart-vue/blob/a1ea72673a111cce78dc8caad8bc9ea3e02ad5bd/src/utils/picker.js#L244\n\t\t\t// Now scroll to the correct position\n\t\t\t// TODO: fix in upstream\n\t\t\tconst selectedEmoji = this.$refs.picker.$el.querySelector('.emoji-mart-emoji-selected')\n\t\t\tselectedEmoji?.scrollIntoView({\n\t\t\t\tblock: 'center',\n\t\t\t\tinline: 'center',\n\t\t\t})\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n@use \"sass:meta\";\n\n.nc-emoji-picker-container :deep() {\n\t@include meta.load-css('emoji-mart-vue-fast/css/emoji-mart.css');\n}\n\n.nc-emoji-picker-container :deep(.emoji-mart) {\n\tbackground-color: var(--color-main-background) !important;\n\tborder: 0;\n\tcolor: var(--color-main-text) !important;\n\tdisplay: flex !important;\n\n\t// Reset emoji-mart styles\n\tbutton {\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tfont-size: inherit;\n\t}\n\n\t.emoji-mart-bar,\n\t.emoji-mart-anchors,\n\t.emoji-mart-search,\n\t.emoji-mart-search input,\n\t.emoji-mart-category,\n\t.emoji-mart-category-label,\n\t.emoji-mart-category-label span,\n\t.emoji-mart-skin-swatches {\n\t\tbackground-color: transparent !important;\n\t\tborder-color: var(--color-border) !important;\n\t\tcolor: inherit !important;\n\t}\n\n\t.emoji-mart-anchors {\n\t\tpadding-block: 0;\n\t\tpadding-inline: calc(2 * var(--default-grid-baseline));\n\t}\n\n\t.emoji-mart-anchor {\n\t\tborder-radius: 0;\n\t\tmargin: 0 !important;\n\t\tpadding: 0 !important;\n\t\theight: var(--clickable-area-small);\n\t\tmin-width: var(--clickable-area-small);\n\n\t\t&:hover {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\toutline: 2px solid var(--color-primary-element) !important;\n\t\t\toutline-offset: -2px;\n\t\t}\n\n\t\t// Icon\n\t\tdiv {\n\t\t\tdisplay: grid;\n\t\t\tplace-content: center;\n\t\t}\n\t}\n\n\t.emoji-mart-scroll {\n\t\tpadding-inline: calc(2 * var(--default-grid-baseline));\n\t\tpadding-block: 0 calc(2 * var(--default-grid-baseline));\n\t}\n\n\t.emoji-mart-category {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(8, 1fr);\n\t\tjustify-items: stretch;\n\n\t\t&.emoji-mart-no-results {\n\t\t\tgrid-template-columns: 1fr;\n\t\t\tfont-size: inherit;\n\t\t\tcolor: var(--color-text-maxcontrast) !important;\n\t\t}\n\t}\n\n\t/* Label element in the section grid */\n\tdiv.emoji-mart-category-label {\n\t\tgrid-column: span 8;\n\t\tjustify-self: stretch;\n\t}\n\n\t/* An actual heading inside the element */\n\th3.emoji-mart-category-label {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t// Inline with buttons\n\t\theight: var(--default-clickable-area);\n\t\tmargin: 0;\n\t\t// Inline with input\n\t\tpadding-inline: calc(2 * var(--default-grid-baseline));\n\t\tpadding-block: 0;\n\t\tuser-select: none;\n\t}\n\n\t.emoji-mart-emoji {\n\t\taspect-ratio: 1 / 1;\n\t\ttext-align: center;\n\t\tmargin: 0 !important;\n\t\tpadding: 0 !important;\n\n\t\t&:hover,\n\t\t&:focus-visible,\n\t\t&.emoji-mart-emoji-selected {\n\t\t\tbackground-color: var(--color-background-hover) !important;\n\t\t\tborder: none;\n\t\t\tborder-radius: var(--border-radius-element);\n\t\t\tbox-shadow: none !important;\n\t\t\toutline: 2px solid var(--color-primary-element) !important;\n\t\t\toutline-offset: -2px;\n\t\t}\n\n\t\t&::before {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\tspan {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n}\n\n.search__wrapper {\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: var(--default-grid-baseline);\n\talign-items: end;\n\tpadding-block: var(--default-grid-baseline);\n\tpadding-inline: calc(2 * var(--default-grid-baseline));\n}\n\n.row-selected {\n\tbutton, span {\n\t\tvertical-align: middle;\n\t}\n}\n\n.emoji-delete {\n\tvertical-align: top;\n\tmargin-inline-start: -21px;\n\tmargin-top: -3px;\n}\n</style>\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_createElementVNode","_openBlock","NcTextField","_createBlock","_withCtx","_renderSlot","_createVNode","_withKeys","_normalizeStyle","_toDisplayString"],"mappings":";;;;;;;;;;;;;AAoBA,MAAKA,cAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO,CAAC,OAAO;AAAA,EACf,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA;IAER,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AACF;;;AAxBY,MAAAC,eAAA,EAAA,GAAE,+EAA8E;;;sBAX1FC,mBAeO,QAfPC,WAAc,KAAA,QAAM;AAAA,IACb,eAAa,OAAA,QAAK,OAAA;AAAA,IAClB,cAAY,OAAA;AAAA,IACb,OAAM;AAAA,IACN,MAAK;AAAA,IACJ,SAAK,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA,YAAE,KAAA,MAAK,SAAU,MAAM;AAAA;kBACjCD,mBAQM,OAAA;AAAA,MARA,MAAM,OAAA;AAAA,MACP,OAAM;AAAA,MACL,OAAO,OAAA;AAAA,MACP,QAAQ,OAAA;AAAA,MACT,SAAQ;AAAA;MACXE,mBAEO,QAFPH,cAEO;AAAA,QADQ,OAAA,SAAbI,UAAA,GAAAH,mBAAuC,uCAAhB,OAAA,KAAK,GAAA,CAAA;;;;;;;AC2MpC,IAAI;AAEJ,MAAM,OAAO;AAAA,EACZ,QAAQ,EAAE,cAAc;AAAA,EACxB,UAAU,EAAE,gBAAgB;AAAA,EAC5B,YAAY;AAAA,IACX,QAAQ,EAAE,gBAAgB;AAAA,IAC1B,QAAQ,EAAE,i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AAA;;;;;;;;;;;UAM1E,OAAA,iBAAiB,OAAA;kBAAgB;AAAA,wBAChD,MAIM;AAAA,cAJNR,mBAIM,OAJN,YAIM;AAAA,gBAHLA,mBAEK,MAFL,YAEKS,gBADD,SAAA,EAAC,UAAA,CAAA,GAAA,CAAA;AAAA;cAGNH,YAMqB,kBAAA;AAAA,gBALpB,OAAM;AAAA,gBACL,MAAM,OAAA;AAAA,gBACN,OAAO,OAAA;AAAA,gBACR,QAAA;AAAA,gBACC,MAAM;AAAA,gBACN,SAAO,SAAA;AAAA;cACTA,YAMqB,kBAAA;AAAA,gBALpB,OAAM;AAAA,gBACL,MAAM,OAAA;AAAA,gBACP,OAAM;AAAA,gBACN,QAAA;AAAA,gBACC,MAAM;AAAA,gBACN,SAAO,SAAA;AAAA;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"NcEmojiPicker-DMiiRPm1.mjs","sources":["../../node_modules/vue-material-design-icons/Circle.vue","../../src/components/NcEmojiPicker/NcEmojiPicker.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon circle-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"CircleIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### General description\n\nThis component allows the user to pick an emoji.\n\n### Usage\n\n* Listen to the select event and pass in an HTML element that will be treated as a trigger:\n\n```vue\n<template>\n\t<div>\n\t\t<NcEmojiPicker @select=\"select\" style=\"display: inline-block\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcEmojiPicker>\n\t\t<span>selected emoji: {{ emoji }}</span>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\temoji: '',\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tselect(emoji) {\n\t\t\t\tthis.emoji = emoji\n\t\t\t},\n\t\t},\n\t}\n</script>\n```\n\n* Showing a preview and keeping it open after a user selected an emoji\n\n```vue\n<template>\n\t<div>\n\t\t<NcEmojiPicker\n\t\t\t:close-on-select=\"false\"\n\t\t\t:show-preview=\"true\"\n\t\t\t@select=\"select\"\n\t\t\tstyle=\"display: inline-block\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcEmojiPicker>\n\t\t<span>selected emoji: {{ emoji }}</span>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\temoji: '',\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tselect(emoji) {\n\t\t\t\tthis.emoji = emoji\n\t\t\t},\n\t\t},\n\t}\n</script>\n```\n\n* Allow unselecting a previously set emoji.\n\n```vue\n<template>\n\t<div>\n\t\t<NcEmojiPicker\n\t\t\t:show-preview=\"true\"\n\t\t\t:allow-unselect=\"true\"\n\t\t\t:selected-emoji=\"emoji\"\n\t\t\t@select=\"select\"\n\t\t\t@unselect=\"unselect\"\n\t\t\tstyle=\"display: inline-block\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcEmojiPicker>\n\t\t<span>selected emoji: {{ emoji }}</span>\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\temoji: '',\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tselect(emoji) {\n\t\t\t\tthis.emoji = emoji\n\t\t\t},\n\t\t\tunselect() {\n\t\t\t\tthis.emoji = ''\n\t\t\t},\n\t\t},\n\t}\n</script>\n```\n\n</docs>\n\n<template>\n\t<NcPopover\n\t\tref=\"popover\"\n\t\tv-model:shown=\"open\"\n\t\t:container=\"container\"\n\t\tpopup-role=\"dialog\"\n\t\t:no-focus-trap=\"true /* Handled manually to remove emoji buttons from TAB sequence */\"\n\t\t@after-show=\"afterShow\"\n\t\t@after-hide=\"afterHide\">\n\t\t<template #trigger=\"slotProps\">\n\t\t\t<slot v-bind=\"slotProps\" />\n\t\t</template>\n\t\t<div class=\"nc-emoji-picker-container\">\n\t\t\t<Picker\n\t\t\t\tref=\"picker\"\n\t\t\t\tcolor=\"var(--color-primary-element)\"\n\t\t\t\t:data=\"emojiIndex\"\n\t\t\t\t:emoji=\"previewFallbackEmoji\"\n\t\t\t\t:i18n\n\t\t\t\t:native\n\t\t\t\t:emoji-size=\"20\"\n\t\t\t\t:per-line=\"8\"\n\t\t\t\t:picker-styles=\"{ width: '320px' }\"\n\t\t\t\t:show-preview\n\t\t\t\t:skin=\"currentSkinTone\"\n\t\t\t\t:show-skin-tones=\"false\"\n\t\t\t\t:title=\"previewFallbackName\"\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\t:aria-label=\"t('Emoji picker')\"\n\t\t\t\tv-bind=\"$attrs\"\n\t\t\t\t@keydown.tab.prevent=\"handleTabNavigationSkippingEmojis\"\n\t\t\t\t@select=\"select\">\n\t\t\t\t<template #searchTemplate=\"{ onSearch }\">\n\t\t\t\t\t<div class=\"search__wrapper\">\n\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\tref=\"search\"\n\t\t\t\t\t\t\tv-model=\"search\"\n\t\t\t\t\t\t\tclass=\"search\"\n\t\t\t\t\t\t\t:label=\"t('Search')\"\n\t\t\t\t\t\t\t:label-visible=\"true\"\n\t\t\t\t\t\t\t:placeholder=\"i18n.search\"\n\t\t\t\t\t\t\ttrailing-button-icon=\"close\"\n\t\t\t\t\t\t\t:trailing-button-label=\"t('Clear search')\"\n\t\t\t\t\t\t\t:show-trailing-button=\"search !== ''\"\n\t\t\t\t\t\t\t@keydown.left=\"callPickerArrowHandlerWithScrollFix('onArrowLeft', $event)\"\n\t\t\t\t\t\t\t@keydown.right=\"callPickerArrowHandlerWithScrollFix('onArrowRight', $event)\"\n\t\t\t\t\t\t\t@keydown.down=\"callPickerArrowHandlerWithScrollFix('onArrowDown', $event)\"\n\t\t\t\t\t\t\t@keydown.up=\"callPickerArrowHandlerWithScrollFix('onArrowUp', $event)\"\n\t\t\t\t\t\t\t@keydown.enter=\"$refs.picker.onEnter($event)\"\n\t\t\t\t\t\t\t@trailing-button-click=\"clearSearch(); onSearch('');\"\n\t\t\t\t\t\t\t@update:model-value=\"onSearch(search)\" />\n\t\t\t\t\t\t<NcColorPicker\n\t\t\t\t\t\t\tpalette-only\n\t\t\t\t\t\t\t:container\n\t\t\t\t\t\t\t:palette=\"skinTonePalette\"\n\t\t\t\t\t\t\t:model-value=\"currentColor.color\"\n\t\t\t\t\t\t\t@update:model-value=\"onChangeSkinTone\">\n\t\t\t\t\t\t\t<NcButton :aria-label=\"t('Skin tone')\" variant=\"tertiary-no-background\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<IconCircle :style=\"{ color: currentColor.color }\" :title=\"currentColor.name\" :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t</NcColorPicker>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"allowUnselect && selectedEmoji\" #customCategory>\n\t\t\t\t\t<div class=\"emoji-mart-category-label\">\n\t\t\t\t\t\t<h3 class=\"emoji-mart-category-label\">\n\t\t\t\t\t\t\t{{ t('Selected') }}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Emoji\n\t\t\t\t\t\tclass=\"emoji-selected\"\n\t\t\t\t\t\t:data=\"emojiIndex\"\n\t\t\t\t\t\t:emoji=\"selectedEmoji\"\n\t\t\t\t\t\tnative\n\t\t\t\t\t\t:size=\"32\"\n\t\t\t\t\t\t@click=\"unselect\" />\n\t\t\t\t\t<Emoji\n\t\t\t\t\t\tclass=\"emoji-delete\"\n\t\t\t\t\t\t:data=\"emojiIndex\"\n\t\t\t\t\t\temoji=\":x:\"\n\t\t\t\t\t\tnative\n\t\t\t\t\t\t:size=\"10\"\n\t\t\t\t\t\t@click=\"unselect\" />\n\t\t\t\t</template>\n\t\t\t</Picker>\n\t\t</div>\n\t</NcPopover>\n</template>\n\n<script>\nimport data from 'emoji-mart-vue-fast/data/all.json'\nimport { Emoji, EmojiIndex, Picker } from 'emoji-mart-vue-fast/src/index.js'\nimport { isFocusable } from 'tabbable'\nimport IconCircle from 'vue-material-design-icons/Circle.vue'\nimport NcColorPicker from '../NcColorPicker/NcColorPicker.vue'\nimport { useTrapStackControl } from '../../composables/useTrapStackControl.ts'\nimport { getCurrentSkinTone, setCurrentSkinTone } from '../../functions/emoji/emoji.ts'\nimport { t } from '../../l10n.ts'\nimport { Color } from '../../utils/colors.ts'\nimport NcButton from '../NcButton/index.ts'\nimport NcPopover from '../NcPopover/index.js'\nimport NcTextField from '../NcTextField/index.ts'\n\n// Shared emoji index and skinTone for all NcEmojiPicker instances\n// Will be initialized on the first NcEmojiPicker creating\nlet emojiIndex\n\nconst i18n = {\n\tsearch: t('Search emoji'),\n\tnotfound: t('No emoji found'),\n\tcategories: {\n\t\tsearch: t('Search results'),\n\t\trecent: t('Frequently used'),\n\t\tsmileys: t('Smileys & Emotion'),\n\t\tpeople: t('People & Body'),\n\t\tnature: t('Animals & Nature'),\n\t\tfoods: t('Food & Drink'),\n\t\tactivity: t('Activities'),\n\t\tplaces: t('Travel & Places'),\n\t\tobjects: t('Objects'),\n\t\tsymbols: t('Symbols'),\n\t\tflags: t('Flags'),\n\t\tcustom: t('Custom'),\n\t},\n}\n\nconst skinTonePalette = [\n\tnew Color(255, 222, 52, t('Neutral skin color')),\n\tnew Color(228, 205, 166, t('Light skin tone')),\n\tnew Color(250, 221, 192, t('Medium light skin tone')),\n\tnew Color(174, 129, 87, t('Medium skin tone')),\n\tnew Color(158, 113, 88, t('Medium dark skin tone')),\n\tnew Color(96, 79, 69, t('Dark skin tone')),\n]\n\nexport default {\n\tname: 'NcEmojiPicker',\n\n\tcomponents: {\n\t\tIconCircle,\n\t\tNcButton,\n\t\tNcColorPicker,\n\t\tNcPopover,\n\t\tNcTextField,\n\t\tEmoji,\n\t\tPicker,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The emoji-set\n\t\t */\n\t\tactiveSet: {\n\t\t\ttype: String,\n\t\t\tdefault: 'native',\n\t\t},\n\n\t\t/**\n\t\t * Show preview section when hovering emoji\n\t\t */\n\t\tshowPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Allow unselecting the selected emoji\n\t\t */\n\t\tallowUnselect: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selected emoji to allow unselecting\n\t\t */\n\t\tselectedEmoji: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The fallback emoji in the preview section\n\t\t */\n\t\tpreviewFallbackEmoji: {\n\t\t\ttype: String,\n\t\t\tdefault: 'grinning',\n\t\t},\n\n\t\t/**\n\t\t * The fallback text in the preview section\n\t\t */\n\t\tpreviewFallbackName: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Pick an emoji'),\n\t\t},\n\n\t\t/**\n\t\t * Whether to close the emoji picker after picking one\n\t\t */\n\t\tcloseOnSelect: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: [Boolean, String, Object, Element],\n\t\t\tdefault: 'body',\n\t\t},\n\t},\n\n\temits: [\n\t\t'select',\n\t\t'selectData',\n\t\t'unselect',\n\t],\n\n\tsetup() {\n\t\t// If this is the first instance of NcEmojiPicker - setup EmojiIndex\n\t\tif (!emojiIndex) {\n\t\t\temojiIndex = new EmojiIndex(data)\n\t\t}\n\n\t\treturn {\n\t\t\t// Non-reactive constants\n\t\t\temojiIndex,\n\t\t\tskinTonePalette,\n\t\t\ti18n,\n\t\t}\n\t},\n\n\tdata() {\n\t\tconst currentSkinTone = getCurrentSkinTone()\n\n\t\treturn {\n\t\t\t/**\n\t\t\t * The current active color from the skin tone palette\n\t\t\t */\n\t\t\tcurrentColor: skinTonePalette[currentSkinTone - 1],\n\t\t\t/**\n\t\t\t * The current active skin tone\n\t\t\t *\n\t\t\t * @type {1|2|3|4|5|6}\n\t\t\t */\n\t\t\tcurrentSkinTone,\n\t\t\tsearch: '',\n\t\t\topen: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tnative() {\n\t\t\treturn this.activeSet === 'native'\n\t\t},\n\t},\n\n\tcreated() {\n\t\t// Component has its own custom focus management\n\t\t// The global focus trap stack should be paused\n\t\tuseTrapStackControl(() => this.open)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\tclearSearch() {\n\t\t\tthis.search = ''\n\t\t\tthis.$refs.search.focus()\n\t\t},\n\n\t\t/**\n\t\t * Update the current skin tone by the result of the color picker\n\t\t *\n\t\t * @param {string} color Color set\n\t\t */\n\t\tonChangeSkinTone(color) {\n\t\t\tconst index = this.skinTonePalette.findIndex((tone) => tone.color.toLowerCase() === color.toLowerCase())\n\t\t\tif (index > -1) {\n\t\t\t\tthis.currentSkinTone = index + 1\n\t\t\t\tthis.currentColor = this.skinTonePalette[index]\n\t\t\t\tsetCurrentSkinTone(this.currentSkinTone)\n\t\t\t}\n\t\t},\n\n\t\tselect(emojiObject) {\n\t\t\t/**\n\t\t\t * Emits a string containing the emoji e.g. '👩🏿💻'\n\t\t\t */\n\t\t\tthis.$emit('select', emojiObject.native)\n\n\t\t\t/**\n\t\t\t * Emits a object with more data about the picked emoji\n\t\t\t */\n\t\t\tthis.$emit('selectData', emojiObject)\n\n\t\t\tif (this.closeOnSelect) {\n\t\t\t\tthis.open = false\n\t\t\t}\n\t\t},\n\n\t\tunselect() {\n\t\t\tthis.$emit('unselect')\n\t\t},\n\n\t\tafterShow() {\n\t\t\tthis.$refs.search.focus()\n\t\t},\n\n\t\tafterHide() {\n\t\t\t// Manually return focus to the trigger button, as we disabled focus-trap\n\t\t\t// But only if there is no focus target outside the picker, for example, input element that received focus by click closing the emoji picker\n\t\t\tif (!document.activeElement || this.$refs.picker.$el.contains(document.activeElement) || !isFocusable(document.activeElement)) {\n\t\t\t\tthis.$refs.popover.$el.querySelector('button, [role=\"button\"]')?.focus()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Manually handle Tab navigation skipping emoji buttons.\n\t\t * Navigation over emojis is handled by Arrow keys.\n\t\t *\n\t\t * @param {KeyboardEvent} event - Keyboard event\n\t\t */\n\t\thandleTabNavigationSkippingEmojis(event) {\n\t\t\tconst current = event.target\n\t\t\tconst focusable = Array.from(this.$refs.picker.$el.querySelectorAll('button:not(.emoji-mart-emoji), input'))\n\t\t\tif (!event.shiftKey) {\n\t\t\t\tconst nextNode = focusable.find((node) => current.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING) || focusable[0]\n\t\t\t\tnextNode.focus()\n\t\t\t} else {\n\t\t\t\tconst prevNode = focusable.findLast((node) => current.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_PRECEDING) || focusable.at(-1)\n\t\t\t\tprevNode.focus()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle arrow navigation via <Picker>'s handlers with scroll bug fix\n\t\t *\n\t\t * @param {'onArrowLeft' | 'onArrowRight' | 'onArrowDown' | 'onArrowUp'} originalHandlerName - Picker's arrow keydown handler name\n\t\t * @param {KeyboardEvent} event - Keyboard event\n\t\t */\n\t\tasync callPickerArrowHandlerWithScrollFix(originalHandlerName, event) {\n\t\t\t// Call the original handler\n\t\t\t// See: https://github.com/serebrov/emoji-mart-vue/blob/a1ea72673a111cce78dc8caad8bc9ea3e02ad5bd/src/components/Picker.vue#L29\n\t\t\t// TODO: expose these methods via slot props in upstream library\n\t\t\tthis.$refs.picker[originalHandlerName](event)\n\n\t\t\t// Wait until emoji-mart-vue-fast scrolls\n\t\t\tawait this.$nextTick()\n\n\t\t\t// Scroll position is incorrect after emoji-mart-vue-fast scrolls...\n\t\t\t// It calculates scroll incorrectly.\n\t\t\t// It doesn't take into account, that emojis are wrapped into categories sections\n\t\t\t// See: https://github.com/serebrov/emoji-mart-vue/blob/a1ea72673a111cce78dc8caad8bc9ea3e02ad5bd/src/utils/picker.js#L244\n\t\t\t// Now scroll to the correct position\n\t\t\t// TODO: fix in upstream\n\t\t\tconst selectedEmoji = this.$refs.picker.$el.querySelector('.emoji-mart-emoji-selected')\n\t\t\tselectedEmoji?.scrollIntoView({\n\t\t\t\tblock: 'center',\n\t\t\t\tinline: 'center',\n\t\t\t})\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n@use \"sass:meta\";\n\n.nc-emoji-picker-container :deep() {\n\t@include meta.load-css('emoji-mart-vue-fast/css/emoji-mart.css');\n}\n\n.nc-emoji-picker-container :deep(.emoji-mart) {\n\tbackground-color: var(--color-main-background) !important;\n\tborder: 0;\n\tcolor: var(--color-main-text) !important;\n\tdisplay: flex !important;\n\n\t// Reset emoji-mart styles\n\tbutton {\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tfont-size: inherit;\n\t}\n\n\t.emoji-mart-bar,\n\t.emoji-mart-anchors,\n\t.emoji-mart-search,\n\t.emoji-mart-search input,\n\t.emoji-mart-category,\n\t.emoji-mart-category-label,\n\t.emoji-mart-category-label span,\n\t.emoji-mart-skin-swatches {\n\t\tbackground-color: transparent !important;\n\t\tborder-color: var(--color-border) !important;\n\t\tcolor: inherit !important;\n\t}\n\n\t.emoji-mart-anchors {\n\t\tpadding-block: 0;\n\t\tpadding-inline: calc(2 * var(--default-grid-baseline));\n\t}\n\n\t.emoji-mart-anchor {\n\t\tborder-radius: 0;\n\t\tmargin: 0 !important;\n\t\tpadding: 0 !important;\n\t\theight: var(--clickable-area-small);\n\t\tmin-width: var(--clickable-area-small);\n\n\t\t&:hover {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\toutline: 2px solid var(--color-primary-element) !important;\n\t\t\toutline-offset: -2px;\n\t\t}\n\n\t\t// Icon\n\t\tdiv {\n\t\t\tdisplay: grid;\n\t\t\tplace-content: center;\n\t\t}\n\t}\n\n\t.emoji-mart-scroll {\n\t\tpadding-inline: calc(2 * var(--default-grid-baseline));\n\t\tpadding-block: 0 calc(2 * var(--default-grid-baseline));\n\t}\n\n\t.emoji-mart-category {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(8, 1fr);\n\t\tjustify-items: stretch;\n\n\t\t&.emoji-mart-no-results {\n\t\t\tgrid-template-columns: 1fr;\n\t\t\tfont-size: inherit;\n\t\t\tcolor: var(--color-text-maxcontrast) !important;\n\t\t}\n\t}\n\n\t/* Label element in the section grid */\n\tdiv.emoji-mart-category-label {\n\t\tgrid-column: span 8;\n\t\tjustify-self: stretch;\n\t}\n\n\t/* An actual heading inside the element */\n\th3.emoji-mart-category-label {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t// Inline with buttons\n\t\theight: var(--default-clickable-area);\n\t\tmargin: 0;\n\t\t// Inline with input\n\t\tpadding-inline: calc(2 * var(--default-grid-baseline));\n\t\tpadding-block: 0;\n\t\tuser-select: none;\n\t}\n\n\t.emoji-mart-emoji {\n\t\taspect-ratio: 1 / 1;\n\t\ttext-align: center;\n\t\tmargin: 0 !important;\n\t\tpadding: 0 !important;\n\n\t\t&:hover,\n\t\t&:focus-visible,\n\t\t&.emoji-mart-emoji-selected {\n\t\t\tbackground-color: var(--color-background-hover) !important;\n\t\t\tborder: none;\n\t\t\tborder-radius: var(--border-radius-element);\n\t\t\tbox-shadow: none !important;\n\t\t\toutline: 2px solid var(--color-primary-element) !important;\n\t\t\toutline-offset: -2px;\n\t\t}\n\n\t\t&::before {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\tspan {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n}\n\n.search__wrapper {\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: var(--default-grid-baseline);\n\talign-items: end;\n\tpadding-block: var(--default-grid-baseline);\n\tpadding-inline: calc(2 * var(--default-grid-baseline));\n}\n\n.row-selected {\n\tbutton, span {\n\t\tvertical-align: middle;\n\t}\n}\n\n.emoji-delete {\n\tvertical-align: top;\n\tmargin-inline-start: -21px;\n\tmargin-top: -3px;\n}\n</style>\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_createElementVNode","_openBlock","NcTextField","_createBlock","_withCtx","_renderSlot","_createVNode","_withKeys","_normalizeStyle","_toDisplayString"],"mappings":";;;;;;;;;;;;;AAoBA,MAAKA,cAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO,CAAC,OAAO;AAAA,EACf,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA;IAER,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AACF;;;AAxBY,MAAAC,eAAA,EAAA,GAAE,+EAA8E;;;sBAX1FC,mBAeO,QAfPC,WAAc,KAAA,QAAM;AAAA,IACb,eAAa,OAAA,QAAK,OAAA;AAAA,IAClB,cAAY,OAAA;AAAA,IACb,OAAM;AAAA,IACN,MAAK;AAAA,IACJ,SAAK,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA,YAAE,KAAA,MAAK,SAAU,MAAM;AAAA;kBACjCD,mB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YAWgB,0BAAA;AAAA,gBAVf,gBAAA;AAAA,gBACC,WAAA,OAAA;AAAA,gBACA,SAAS,OAAA;AAAA,gBACT,eAAa,MAAA,aAAa;AAAA,gBAC1B,uBAAoB,SAAA;AAAA;iCACrB,MAIW;AAAA,kBAJXA,YAIW,qBAAA;AAAA,oBAJA,cAAY,SAAA,EAAC,WAAA;AAAA,oBAAe,SAAQ;AAAA;oBACnC,cACV,MAA2F;AAAA,sBAA3FA,YAA2F,uBAAA;AAAA,wBAA9E,OAAKE,eAAA,EAAA,OAAW,MAAA,aAAa,OAAK;AAAA,wBAAK,OAAO,MAAA,aAAa;AAAA,wBAAO,MAAM;AAAA;;;;;;;;;;;UAM1E,OAAA,iBAAiB,OAAA;kBAAgB;AAAA,wBAChD,MAIM;AAAA,cAJNR,mBAIM,OAJN,YAIM;AAAA,gBAHLA,mBAEK,MAFL,YAEKS,gBADD,SAAA,EAAC,UAAA,CAAA,GAAA,CAAA;AAAA;cAGNH,YAMqB,kBAAA;AAAA,gBALpB,OAAM;AAAA,gBACL,MAAM,OAAA;AAAA,gBACN,OAAO,OAAA;AAAA,gBACR,QAAA;AAAA,gBACC,MAAM;AAAA,gBACN,SAAO,SAAA;AAAA;cACTA,YAMqB,kBAAA;AAAA,gBALpB,OAAM;AAAA,gBACL,MAAM,OAAA;AAAA,gBACP,OAAM;AAAA,gBACN,QAAA;AAAA,gBACC,MAAM;AAAA,gBACN,SAAO,SAAA;AAAA;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import '../assets/NcFormBox-D-kcijXp.css';
|
|
2
|
+
import { defineComponent, useCssModule, provide, createElementBlock, openBlock, normalizeClass, renderSlot } from "vue";
|
|
3
|
+
import { N as NC_FORM_BOX_CONTEXT_KEY } from "./useNcFormBox-DA9iwXWY.mjs";
|
|
4
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "NcFormBox",
|
|
7
|
+
props: {
|
|
8
|
+
row: { type: Boolean }
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const style = useCssModule();
|
|
12
|
+
provide(NC_FORM_BOX_CONTEXT_KEY, {
|
|
13
|
+
isInFormBox: true,
|
|
14
|
+
formBoxItemClass: style.ncFormBox__item
|
|
15
|
+
});
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return openBlock(), createElementBlock("div", {
|
|
18
|
+
class: normalizeClass([_ctx.$style.ncFormBox, _ctx.row ? _ctx.$style.ncFormBox_row : _ctx.$style.ncFormBox_col])
|
|
19
|
+
}, [
|
|
20
|
+
renderSlot(_ctx.$slots, "default", {
|
|
21
|
+
itemClass: _ctx.$style.ncFormBox__item
|
|
22
|
+
})
|
|
23
|
+
], 2);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const ncFormBox = "_ncFormBox_1u9di_20";
|
|
28
|
+
const ncFormBox_row = "_ncFormBox_row_1u9di_25";
|
|
29
|
+
const ncFormBox__item = "_ncFormBox__item_1u9di_29";
|
|
30
|
+
const ncFormBox_col = "_ncFormBox_col_1u9di_33";
|
|
31
|
+
const style0 = {
|
|
32
|
+
"material-design-icon": "_material-design-icon_1u9di_12",
|
|
33
|
+
ncFormBox,
|
|
34
|
+
ncFormBox_row,
|
|
35
|
+
ncFormBox__item,
|
|
36
|
+
ncFormBox_col
|
|
37
|
+
};
|
|
38
|
+
const cssModules = {
|
|
39
|
+
"$style": style0
|
|
40
|
+
};
|
|
41
|
+
const NcFormBox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
|
|
42
|
+
export {
|
|
43
|
+
NcFormBox as N
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=NcFormBox-K2tCRm3B.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NcFormBox-K2tCRm3B.mjs","sources":["../../src/components/NcFormBox/NcFormBox.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\n\nimport { provide, useCssModule } from 'vue'\nimport { NC_FORM_BOX_CONTEXT_KEY } from './useNcFormBox.ts'\n\ndefineProps<{\n\t/**\n\t * Display the group as a row instead of a column\n\t */\n\trow?: boolean\n}>()\n\ndefineSlots<{\n\t/**\n\t * Grouped content\n\t */\n\tdefault?: Slot<{\n\t\t/**\n\t\t * Class to add on a custom item to apply the border radius effect\n\t\t */\n\t\titemClass: string\n\t}>\n}>()\n\nconst style = useCssModule()\n\nprovide(NC_FORM_BOX_CONTEXT_KEY, {\n\tisInFormBox: true,\n\tformBoxItemClass: style.ncFormBox__item,\n})\n</script>\n\n<template>\n\t<div :class=\"[$style.ncFormBox, row ? $style.ncFormBox_row : $style.ncFormBox_col]\">\n\t\t<slot :item-class=\"$style.ncFormBox__item\" />\n\t</div>\n</template>\n\n<style lang=\"scss\" module>\n.ncFormBox {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: calc(1 * var(--default-grid-baseline));\n\n\t&.ncFormBox_row {\n\t\tflex-direction: row;\n\t}\n}\n\n.ncFormBox__item {\n\tborder-radius: var(--border-radius-small) !important;\n}\n\n.ncFormBox_col {\n\tflex-direction: column;\n\n\t.ncFormBox__item {\n\t\t&:first-child {\n\t\t\tborder-start-start-radius: var(--border-radius-element) !important;\n\t\t\tborder-start-end-radius: var(--border-radius-element) !important;\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder-end-start-radius: var(--border-radius-element) !important;\n\t\t\tborder-end-end-radius: var(--border-radius-element) !important;\n\t\t}\n\t}\n}\n\n.ncFormBox_row {\n\tflex-direction: row;\n\n\t.ncFormBox__item {\n\t\tflex: 1 1;\n\n\t\t&:first-child {\n\t\t\tborder-start-start-radius: var(--border-radius-element) !important;\n\t\t\tborder-end-start-radius: var(--border-radius-element) !important;\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder-end-end-radius: var(--border-radius-element) !important;\n\t\t\tborder-start-end-radius: var(--border-radius-element) !important;\n\t\t}\n\t}\n}\n</style>\n\n<docs>\n### General\n\nVisually group form elements with a small gap and rounded corners forming a solid group for supported components.\n\n**Note**: if the group has a semantic meaning, consider using the `<NcFormGroup>` component.\n\n```vue\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext: 'Text',\n\t\t\toption: 'One'\n\t\t}\n\t}\n}\n</script>\n\n<template>\n\t<NcFormBox>\n\t\t<NcTextField v-model=\"text\" label=\"Text Field\" />\n\t\t<NcTextField v-model=\"text\" label=\"Text Field\" />\n\t\t<NcTextField v-model=\"text\" label=\"Text Field\" />\n\t\t<NcSelect v-model=\"option\" input-label=\"Select Field\" :options=\"['One', 'Two', 'Three']\" />\n\t</NcFormBox>\n</template>\n```\n\n### Advanced usage\n\nUse scoped slots params to apply the item class to custom items.\n\n```vue\n<template>\n\t<div>\n\t\t<h4>NcButton without a group</h4>\n\t\t<div>\n\t\t\t<NcButton wide>\n\t\t\t\tFirst button\n\t\t\t</NcButton>\n\t\t\t<NcButton wide>\n\t\t\t\tSecond button\n\t\t\t</NcButton>\n\t\t\t<NcButton wide>\n\t\t\t\tThird button\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<h4>NcButton inside NcFormBox with scoped-slot</h4>\n\t\t<NcFormBox v-slot=\"{ itemClass }\">\n\t\t\t<NcButton :class=\"itemClass\" wide>\n\t\t\t\tFirst button\n\t\t\t</NcButton>\n\t\t\t<NcButton :class=\"itemClass\" wide>\n\t\t\t\tSecond button\n\t\t\t</NcButton>\n\t\t\t<NcButton :class=\"itemClass\" wide>\n\t\t\t\tThird button\n\t\t\t</NcButton>\n\t\t</NcFormBox>\n\t</div>\n</template>\n```\n</docs>\n"],"names":["_createElementBlock","_normalizeClass","$style","row","_renderSlot"],"mappings":";;;;;;;;;AA8BA,UAAM,QAAQ,aAAA;AAEd,YAAQ,yBAAyB;AAAA,MAChC,aAAa;AAAA,MACb,kBAAkB,MAAM;AAAA,IAAA,CACxB;;0BAIAA,mBAEM,OAAA;AAAA,QAFA,OAAKC,eAAA,CAAGC,KAAAA,OAAO,WAAWC,KAAAA,MAAMD,KAAAA,OAAO,gBAAgBA,KAAAA,OAAO,aAAa,CAAA;AAAA,MAAA;QAChFE,WAA6C,KAAA,QAAA,WAAA;AAAA,UAAtC,WAAYF,KAAAA,OAAO;AAAA,QAAA;;;;;;;;;;;;;;;;;;;;"}
|