@nextcloud/vue 9.7.0 → 9.8.1
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 +23 -0
- package/dist/assets/{NcActionButton-Bb0ihLdt.css → NcActionButton-DLer-aUY.css} +3 -2
- package/dist/assets/{NcActionCheckbox-DLJQfCUI.css → NcActionCheckbox-wD8m_a8-.css} +3 -2
- package/dist/assets/{NcActionInput-BO4gR6sg.css → NcActionInput-t9WvlgV0.css} +66 -66
- package/dist/assets/{NcActionLink-DAEr-vmd.css → NcActionLink-b4Ph5q10.css} +3 -2
- package/dist/assets/{NcActionRadio-Bd4RFH-l.css → NcActionRadio-D2rLM1ci.css} +3 -2
- package/dist/assets/{NcActionRouter-DeYzeM5W.css → NcActionRouter-BWXfCfxM.css} +3 -2
- package/dist/assets/{NcActionText-D9InmayH.css → NcActionText-Dzegj6AY.css} +3 -2
- package/dist/assets/{NcActionTextEditable-TPYz4ma-.css → NcActionTextEditable-BlZeHZ7J.css} +66 -66
- package/dist/assets/{NcAppNavigation-BSo8jV19.css → NcAppNavigation-2b1jxOXM.css} +18 -14
- package/dist/assets/{NcAppNavigationCaption-HUg9fMCm.css → NcAppNavigationCaption-ggcWspH2.css} +8 -8
- package/dist/assets/{NcAppNavigationItem-qicc4X_c.css → NcAppNavigationItem-BsuZoJAq.css} +78 -40
- package/dist/assets/{NcAppNavigationNewItem-e_CtdnzP.css → NcAppNavigationNewItem-MaYQVcKF.css} +42 -4
- package/dist/assets/{NcAppNavigationSettings-BmfpoWXN.css → NcAppNavigationSettings-HQEDobBQ.css} +1 -1
- package/dist/assets/NcAppSettingsDialog-HsZoLuDy.css +221 -0
- package/dist/assets/{NcAppSettingsSection-ObwpPdgW.css → NcAppSettingsSection-DIw8GLHR.css} +7 -7
- package/dist/assets/{NcAppSidebar-Ci7hXMpX.css → NcAppSidebar-dHtSShIl.css} +116 -70
- package/dist/assets/{NcAssistantIcon-CxXrcBfu.css → NcAssistantIcon-CsBmzIxJ.css} +4 -4
- package/dist/assets/{NcAvatar-CuPj3fbb.css → NcAvatar-Bs7qEhkA.css} +25 -25
- package/dist/assets/{NcBreadcrumb-D9N_qB_o.css → NcBreadcrumb-BxhZKQlW.css} +16 -16
- package/dist/assets/{NcButton-CCY9S6Db.css → NcButton-Bf9wuDV-.css} +53 -50
- package/dist/assets/{NcCheckboxRadioSwitch-DRqOiQON.css → NcCheckboxRadioSwitch-BlQSZVW0.css} +51 -49
- package/dist/assets/{NcColorPicker-CCanY5eB.css → NcColorPicker-DVYGs8R3.css} +32 -32
- package/dist/assets/{NcContent-CVIwhwfc.css → NcContent-DX4Rs6Pc.css} +22 -11
- package/dist/assets/{NcEmptyContent-CLjlZ-UT.css → NcEmptyContent-DJMDuGVz.css} +10 -10
- package/dist/assets/{NcFormBoxItem-CATNOTQx.css → NcFormBoxItem-Bjbi17-B.css} +4 -0
- package/dist/assets/{NcFormGroup-BjWhd5Ky.css → NcFormGroup-qFucmL8a.css} +1 -1
- package/dist/assets/{NcHotkeyList-Braxeyah.css → NcHotkeyList-BfrEkKmK.css} +1 -1
- package/dist/assets/{NcIconToggleSwitch-saytabt5.css → NcIconToggleSwitch-V-AKJgPA.css} +2 -2
- package/dist/assets/NcInputConfirmCancel-BEmwC87z.css +53 -0
- package/dist/assets/{NcInputField-DR0FULeu.css → NcInputField-DpyFJ1xw.css} +44 -44
- package/dist/assets/NcListItem-1uR7AJIf.css +219 -0
- package/dist/assets/{NcModal-RDmyJqvC.css → NcModal-D81luiuU.css} +59 -59
- package/dist/assets/{NcNoteCard-DZSuYX4-.css → NcNoteCard-DfescGKl.css} +11 -11
- package/dist/assets/{NcProgressBar-D1DYRrCN.css → NcProgressBar-B6wveIA1.css} +2 -2
- package/dist/assets/{NcRadioGroupButton-xGU7fVa3.css → NcRadioGroupButton-DUF_3DDU.css} +1 -1
- package/dist/assets/{NcRelatedResourcesPanel-Bx4CA8ph.css → NcRelatedResourcesPanel-CiG_Ixb6.css} +30 -30
- package/dist/assets/{NcRichContenteditable-BXRR0rmI.css → NcRichContenteditable-DNABzVif.css} +12 -12
- package/dist/assets/{NcRichText-9e40m1to.css → NcRichText-BTu-LT3p.css} +93 -93
- package/dist/assets/{NcTextArea-DF9NgPUa.css → NcTextArea-BxGe3Lqn.css} +28 -28
- package/dist/assets/{referencePickerModal-CpzDUJ5f.css → referencePickerModal-Dod7nzta.css} +18 -18
- package/dist/chunks/{NcActionButton-BuRnYpJX.mjs → NcActionButton-BO5T5ePT.mjs} +3 -3
- package/dist/chunks/{NcActionButton-BuRnYpJX.mjs.map → NcActionButton-BO5T5ePT.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-CgYSlRXJ.mjs → NcActionButtonGroup-B9LfyE-G.mjs} +2 -2
- package/dist/chunks/{NcActionButtonGroup-CgYSlRXJ.mjs.map → NcActionButtonGroup-B9LfyE-G.mjs.map} +1 -1
- package/dist/chunks/{NcActionCheckbox-CjawS972.mjs → NcActionCheckbox-DBqiK-AZ.mjs} +3 -3
- package/dist/chunks/{NcActionCheckbox-CjawS972.mjs.map → NcActionCheckbox-DBqiK-AZ.mjs.map} +1 -1
- package/dist/chunks/{NcActionInput-CKbFgbxQ.mjs → NcActionInput-BO0lB4VP.mjs} +7 -7
- package/dist/chunks/{NcActionInput-CKbFgbxQ.mjs.map → NcActionInput-BO0lB4VP.mjs.map} +1 -1
- package/dist/chunks/{NcActionLink-CCszAEdZ.mjs → NcActionLink-BFiaYt9A.mjs} +2 -2
- package/dist/chunks/{NcActionLink-CCszAEdZ.mjs.map → NcActionLink-BFiaYt9A.mjs.map} +1 -1
- package/dist/chunks/{NcActionRadio-BV9Ra5tq.mjs → NcActionRadio-BA08CAtA.mjs} +3 -3
- package/dist/chunks/{NcActionRadio-BV9Ra5tq.mjs.map → NcActionRadio-BA08CAtA.mjs.map} +1 -1
- package/dist/chunks/{NcActionRouter-CvDVCQiQ.mjs → NcActionRouter-vYFtIOzD.mjs} +2 -2
- package/dist/chunks/{NcActionRouter-CvDVCQiQ.mjs.map → NcActionRouter-vYFtIOzD.mjs.map} +1 -1
- package/dist/chunks/{NcActionText-SU4ghOlw.mjs → NcActionText-CQ9qwJ0p.mjs} +2 -2
- package/dist/chunks/{NcActionText-SU4ghOlw.mjs.map → NcActionText-CQ9qwJ0p.mjs.map} +1 -1
- package/dist/chunks/{NcActionTextEditable-BC66QDvV.mjs → NcActionTextEditable-B8y_GEre.mjs} +4 -4
- package/dist/chunks/NcActionTextEditable-B8y_GEre.mjs.map +1 -0
- package/dist/chunks/{NcActions-CeP_c9MH.mjs → NcActions-CUmcZ3C3.mjs} +3 -3
- package/dist/chunks/{NcActions-CeP_c9MH.mjs.map → NcActions-CUmcZ3C3.mjs.map} +1 -1
- package/dist/chunks/{NcAppContent-CdEdgX3o.mjs → NcAppContent--92JdjRr.mjs} +4 -4
- package/dist/chunks/{NcAppContent-CdEdgX3o.mjs.map → NcAppContent--92JdjRr.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-C2njwnqV.mjs → NcAppNavigation-Bb9-C2eO.mjs} +13 -9
- package/dist/chunks/NcAppNavigation-Bb9-C2eO.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationCaption-C7cl2M2w.mjs → NcAppNavigationCaption-E9iJtiQt.mjs} +4 -4
- package/dist/chunks/{NcAppNavigationCaption-C7cl2M2w.mjs.map → NcAppNavigationCaption-E9iJtiQt.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-Csh8IBIf.mjs → NcAppNavigationItem-BFAIHyTL.mjs} +21 -15
- package/dist/chunks/NcAppNavigationItem-BFAIHyTL.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationNew-BkybFzV0.mjs → NcAppNavigationNew-Dspn3-4i.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationNew-BkybFzV0.mjs.map → NcAppNavigationNew-Dspn3-4i.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-DsLct9Bj.mjs → NcAppNavigationNewItem-Cg8IJ6ZV.mjs} +4 -4
- package/dist/chunks/{NcAppNavigationNewItem-DsLct9Bj.mjs.map → NcAppNavigationNewItem-Cg8IJ6ZV.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-C5XwT74Z.mjs → NcAppNavigationSearch-CiOKjV3M.mjs} +3 -3
- package/dist/chunks/{NcAppNavigationSearch-C5XwT74Z.mjs.map → NcAppNavigationSearch-CiOKjV3M.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-Drwi5qgh.mjs → NcAppNavigationSettings-fbuQmy-q.mjs} +7 -7
- package/dist/chunks/{NcAppNavigationSettings-Drwi5qgh.mjs.map → NcAppNavigationSettings-fbuQmy-q.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-CjOvPWbc.mjs → NcAppSettingsDialog-DByPnndK.mjs} +24 -18
- package/dist/chunks/NcAppSettingsDialog-DByPnndK.mjs.map +1 -0
- package/dist/chunks/{NcAppSettingsSection-B-ak1kbx.mjs → NcAppSettingsSection-BosSmisT.mjs} +5 -5
- package/dist/chunks/{NcAppSettingsSection-B-ak1kbx.mjs.map → NcAppSettingsSection-BosSmisT.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsShortcutsSection-yDWzNzFB.mjs → NcAppSettingsShortcutsSection-DgqVuZGx.mjs} +3 -3
- package/dist/chunks/{NcAppSettingsShortcutsSection-yDWzNzFB.mjs.map → NcAppSettingsShortcutsSection-DgqVuZGx.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-BvXH4I-d.mjs → NcAppSidebar-Ch7Vp7q5.mjs} +23 -18
- package/dist/chunks/NcAppSidebar-Ch7Vp7q5.mjs.map +1 -0
- package/dist/chunks/{NcAppSidebarHeader.vue_vue_type_script_setup_true_lang-Bk4yFBHY.mjs → NcAppSidebarHeader.vue_vue_type_script_setup_true_lang-C-QhdyiN.mjs} +4 -4
- package/dist/chunks/{NcAppSidebarHeader.vue_vue_type_script_setup_true_lang-Bk4yFBHY.mjs.map → NcAppSidebarHeader.vue_vue_type_script_setup_true_lang-C-QhdyiN.mjs.map} +1 -1
- package/dist/chunks/{NcAssistantButton-DxNbEbqt.mjs → NcAssistantButton-CTrCv4CO.mjs} +10 -10
- package/dist/chunks/NcAssistantButton-CTrCv4CO.mjs.map +1 -0
- package/dist/chunks/{NcAssistantContent-DWv2sak_.mjs → NcAssistantContent-CeuwcdMY.mjs} +2 -2
- package/dist/chunks/{NcAssistantContent-DWv2sak_.mjs.map → NcAssistantContent-CeuwcdMY.mjs.map} +1 -1
- package/dist/chunks/{NcAssistantIcon-Cf0B3EsL.mjs → NcAssistantIcon-Dpp9_LUg.mjs} +4 -4
- package/dist/chunks/{NcAssistantIcon-Cf0B3EsL.mjs.map → NcAssistantIcon-Dpp9_LUg.mjs.map} +1 -1
- package/dist/chunks/{NcAvatar-D9yNUkjq.mjs → NcAvatar-M3-CbKbq.mjs} +14 -14
- package/dist/chunks/{NcAvatar-D9yNUkjq.mjs.map → NcAvatar-M3-CbKbq.mjs.map} +1 -1
- package/dist/chunks/{NcBlurHash-B3MufoB_.mjs → NcBlurHash-yPfSKY7W.mjs} +6 -6
- package/dist/chunks/{NcBlurHash-B3MufoB_.mjs.map → NcBlurHash-yPfSKY7W.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-CfFsCTmn.mjs → NcBreadcrumb-BeDMWE_b.mjs} +5 -5
- package/dist/chunks/{NcBreadcrumb-CfFsCTmn.mjs.map → NcBreadcrumb-BeDMWE_b.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-bX1x_cye.mjs → NcBreadcrumbs-CuQDDvin.mjs} +6 -6
- package/dist/chunks/{NcBreadcrumbs-bX1x_cye.mjs.map → NcBreadcrumbs-CuQDDvin.mjs.map} +1 -1
- package/dist/chunks/{NcButton-lQra4n2g.mjs → NcButton-QbPBynlU.mjs} +10 -9
- package/dist/chunks/NcButton-QbPBynlU.mjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch-VV_Err2A.mjs → NcCheckboxRadioSwitch-D8Dfv4iw.mjs} +9 -9
- package/dist/chunks/NcCheckboxRadioSwitch-D8Dfv4iw.mjs.map +1 -0
- package/dist/chunks/{NcChip-JjodlHFu.mjs → NcChip-nVHnbjaY.mjs} +13 -13
- package/dist/chunks/{NcChip-JjodlHFu.mjs.map → NcChip-nVHnbjaY.mjs.map} +1 -1
- package/dist/chunks/{NcCollectionList-DK050qCv.mjs → NcCollectionList-CO-iHqi6.mjs} +7 -7
- package/dist/chunks/{NcCollectionList-DK050qCv.mjs.map → NcCollectionList-CO-iHqi6.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-B1FEzC_4.mjs → NcColorPicker-D6NbBOX3.mjs} +15 -15
- package/dist/chunks/{NcColorPicker-B1FEzC_4.mjs.map → NcColorPicker-D6NbBOX3.mjs.map} +1 -1
- package/dist/chunks/{NcContent-bQ5c_Pwd.mjs → NcContent-BhMoPROW.mjs} +9 -8
- package/dist/chunks/{NcContent-bQ5c_Pwd.mjs.map → NcContent-BhMoPROW.mjs.map} +1 -1
- package/dist/chunks/{NcCounterBubble-VUNXKsnk.mjs → NcCounterBubble-CV0YMrXW.mjs} +4 -4
- package/dist/chunks/{NcCounterBubble-VUNXKsnk.mjs.map → NcCounterBubble-CV0YMrXW.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-CCeqnB6g.mjs → NcDashboardWidget-ftOfMTzx.mjs} +5 -5
- package/dist/chunks/{NcDashboardWidget-CCeqnB6g.mjs.map → NcDashboardWidget-ftOfMTzx.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-i7xArH0I.mjs → NcDashboardWidgetItem-BwwFiNOL.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-i7xArH0I.mjs.map → NcDashboardWidgetItem-BwwFiNOL.mjs.map} +1 -1
- package/dist/chunks/{NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL.mjs → NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7.mjs} +2 -2
- package/dist/chunks/NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7.mjs.map +1 -0
- package/dist/chunks/{NcDateTimePicker-4-6ux1S_.mjs → NcDateTimePicker-CK4rhfEB.mjs} +18 -18
- package/dist/chunks/{NcDateTimePicker-4-6ux1S_.mjs.map → NcDateTimePicker-CK4rhfEB.mjs.map} +1 -1
- package/dist/chunks/{NcDateTimePickerNative-XO_O44n2.mjs → NcDateTimePickerNative-BeM4WOA4.mjs} +8 -8
- package/dist/chunks/{NcDateTimePickerNative-XO_O44n2.mjs.map → NcDateTimePickerNative-BeM4WOA4.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-DnJfLwGR.mjs → NcDialog-kwzJ3A4X.mjs} +9 -9
- package/dist/chunks/{NcDialog-DnJfLwGR.mjs.map → NcDialog-kwzJ3A4X.mjs.map} +1 -1
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-DMoLf2ll.mjs → NcDialogButton.vue_vue_type_script_setup_true_lang-Cn-8O9iZ.mjs} +12 -12
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-DMoLf2ll.mjs.map → NcDialogButton.vue_vue_type_script_setup_true_lang-Cn-8O9iZ.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-Cuy9A4DP.mjs → NcEmojiPicker-Bpw-68QP.mjs} +6 -6
- package/dist/chunks/{NcEmojiPicker-Cuy9A4DP.mjs.map → NcEmojiPicker-Bpw-68QP.mjs.map} +1 -1
- package/dist/chunks/{NcEmptyContent-CDgWCt_m.mjs → NcEmptyContent-CGAPqk4S.mjs} +7 -7
- package/dist/chunks/{NcEmptyContent-CDgWCt_m.mjs.map → NcEmptyContent-CGAPqk4S.mjs.map} +1 -1
- package/dist/chunks/{NcFilePicker-CrHd83Bv.mjs → NcFilePicker-nPCwHMqj.mjs} +18 -18
- package/dist/chunks/{NcFilePicker-CrHd83Bv.mjs.map → NcFilePicker-nPCwHMqj.mjs.map} +1 -1
- package/dist/chunks/{NcFormBox-wP5mpW88.mjs → NcFormBox-ClWfuBWz.mjs} +2 -2
- package/dist/chunks/{NcFormBox-wP5mpW88.mjs.map → NcFormBox-ClWfuBWz.mjs.map} +1 -1
- package/dist/chunks/{NcFormBoxButton-JvZ6_2E3.mjs → NcFormBoxButton-i4i3Lt_Q.mjs} +8 -8
- package/dist/chunks/{NcFormBoxButton-JvZ6_2E3.mjs.map → NcFormBoxButton-i4i3Lt_Q.mjs.map} +1 -1
- package/dist/chunks/{NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-DhKiWUS8.mjs → NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-NfKiRrIn.mjs} +8 -8
- package/dist/chunks/{NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-DhKiWUS8.mjs.map → NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-NfKiRrIn.mjs.map} +1 -1
- package/dist/chunks/{NcFormBoxItem-B7YVodqN.mjs → NcFormBoxItem-BTB68AEB.mjs} +10 -10
- package/dist/chunks/{NcFormBoxItem-B7YVodqN.mjs.map → NcFormBoxItem-BTB68AEB.mjs.map} +1 -1
- package/dist/chunks/{NcFormBoxSwitch-DP4dD4xe.mjs → NcFormBoxSwitch-DlNcJ1q7.mjs} +8 -8
- package/dist/chunks/{NcFormBoxSwitch-DP4dD4xe.mjs.map → NcFormBoxSwitch-DlNcJ1q7.mjs.map} +1 -1
- package/dist/chunks/{NcFormGroup-B3a2iUnT.mjs → NcFormGroup-DvLGFMdb.mjs} +7 -7
- package/dist/chunks/{NcFormGroup-B3a2iUnT.mjs.map → NcFormGroup-DvLGFMdb.mjs.map} +1 -1
- package/dist/chunks/{NcHeaderButton-CXu9xIQP.mjs → NcHeaderButton-m4oAOSTa.mjs} +6 -6
- package/dist/chunks/{NcHeaderButton-CXu9xIQP.mjs.map → NcHeaderButton-m4oAOSTa.mjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-CYU4Y3h5.mjs → NcHeaderMenu-DRxcyWNX.mjs} +10 -10
- package/dist/chunks/{NcHeaderMenu-CYU4Y3h5.mjs.map → NcHeaderMenu-DRxcyWNX.mjs.map} +1 -1
- package/dist/chunks/{NcHotkey-B0qDRy1t.mjs → NcHotkey-C-TYyC8X.mjs} +3 -3
- package/dist/chunks/{NcHotkey-B0qDRy1t.mjs.map → NcHotkey-C-TYyC8X.mjs.map} +1 -1
- package/dist/chunks/{NcHotkeyList-lslhX0EJ.mjs → NcHotkeyList-CmMgGhMr.mjs} +5 -5
- package/dist/chunks/NcHotkeyList-CmMgGhMr.mjs.map +1 -0
- package/dist/chunks/{NcIconSvgWrapper-De-2-ukl.mjs → NcIconSvgWrapper-g8ubWhoz.mjs} +6 -6
- package/dist/chunks/{NcIconSvgWrapper-De-2-ukl.mjs.map → NcIconSvgWrapper-g8ubWhoz.mjs.map} +1 -1
- package/dist/chunks/{NcIconToggleSwitch-B7kfYo0B.mjs → NcIconToggleSwitch-CbfRwb67.mjs} +7 -7
- package/dist/chunks/{NcIconToggleSwitch-B7kfYo0B.mjs.map → NcIconToggleSwitch-CbfRwb67.mjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-xoQuby4k.mjs → NcInputConfirmCancel-B6qC3s63.mjs} +16 -11
- package/dist/chunks/NcInputConfirmCancel-B6qC3s63.mjs.map +1 -0
- package/dist/chunks/{NcInputField-CPL-a_MM.mjs → NcInputField-B1bGxYHt.mjs} +28 -28
- package/dist/chunks/{NcInputField-CPL-a_MM.mjs.map → NcInputField-B1bGxYHt.mjs.map} +1 -1
- package/dist/chunks/{NcKbd-Caeq706M.mjs → NcKbd-Iyp0KDp4.mjs} +2 -2
- package/dist/chunks/{NcKbd-Caeq706M.mjs.map → NcKbd-Iyp0KDp4.mjs.map} +1 -1
- package/dist/chunks/{NcListItem-C0y1LfQx.mjs → NcListItem-Y5a098Cw.mjs} +15 -8
- package/dist/chunks/NcListItem-Y5a098Cw.mjs.map +1 -0
- package/dist/chunks/{NcListItemIcon-ByoiA9YZ.mjs → NcListItemIcon-D_f5AGrh.mjs} +3 -3
- package/dist/chunks/{NcListItemIcon-ByoiA9YZ.mjs.map → NcListItemIcon-D_f5AGrh.mjs.map} +1 -1
- package/dist/chunks/{NcLoadingIcon-CInLzPtA.mjs → NcLoadingIcon-BOVpFVQz.mjs} +5 -5
- package/dist/chunks/{NcLoadingIcon-CInLzPtA.mjs.map → NcLoadingIcon-BOVpFVQz.mjs.map} +1 -1
- package/dist/chunks/{NcModal-CDj4hQx7.mjs → NcModal-DUWLRm_F.mjs} +28 -28
- package/dist/chunks/{NcModal-CDj4hQx7.mjs.map → NcModal-DUWLRm_F.mjs.map} +1 -1
- package/dist/chunks/{NcNoteCard-CWiO3Dse.mjs → NcNoteCard-mI7qVZ9j.mjs} +9 -9
- package/dist/chunks/{NcNoteCard-CWiO3Dse.mjs.map → NcNoteCard-mI7qVZ9j.mjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-C7yuRADA.mjs → NcPasswordField-Be5_qcfm.mjs} +9 -9
- package/dist/chunks/{NcPasswordField-C7yuRADA.mjs.map → NcPasswordField-Be5_qcfm.mjs.map} +1 -1
- package/dist/chunks/{NcProgressBar-JyXXoHLT.mjs → NcProgressBar-C-ane-Ni.mjs} +10 -10
- package/dist/chunks/{NcProgressBar-JyXXoHLT.mjs.map → NcProgressBar-C-ane-Ni.mjs.map} +1 -1
- package/dist/chunks/{NcRadioGroup-LkOsE5Mc.mjs → NcRadioGroup-BzW4XHoK.mjs} +6 -6
- package/dist/chunks/{NcRadioGroup-LkOsE5Mc.mjs.map → NcRadioGroup-BzW4XHoK.mjs.map} +1 -1
- package/dist/chunks/{NcRadioGroupButton-BtE_SLVd.mjs → NcRadioGroupButton-CXKQMID9.mjs} +9 -9
- package/dist/chunks/{NcRadioGroupButton-BtE_SLVd.mjs.map → NcRadioGroupButton-CXKQMID9.mjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-B01Lid3d.mjs → NcRelatedResourcesPanel-C0j0Fs4r.mjs} +11 -11
- package/dist/chunks/NcRelatedResourcesPanel-C0j0Fs4r.mjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-DeN1H5pQ.mjs → NcRichContenteditable-DO3_WniI.mjs} +17 -17
- package/dist/chunks/NcRichContenteditable-DO3_WniI.mjs.map +1 -0
- package/dist/chunks/{NcRichText-DGV7OHFb.mjs → NcRichText-BOBQq7Od.mjs} +19 -12
- package/dist/chunks/NcRichText-BOBQq7Od.mjs.map +1 -0
- package/dist/chunks/{NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-CA0r_04W.mjs → NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-DbQnMYZm.mjs} +5 -5
- package/dist/chunks/{NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-CA0r_04W.mjs.map → NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-DbQnMYZm.mjs.map} +1 -1
- package/dist/chunks/{NcSelect-Ba-lsVsl.mjs → NcSelect-BOFzoCwK.mjs} +4 -4
- package/dist/chunks/{NcSelect-Ba-lsVsl.mjs.map → NcSelect-BOFzoCwK.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-cNBPJ5FM.mjs → NcSelectTags-D7qWNjXa.mjs} +3 -3
- package/dist/chunks/{NcSelectTags-cNBPJ5FM.mjs.map → NcSelectTags-D7qWNjXa.mjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-LqSEQ2A_.mjs → NcSelectUsers-CI8twLn9.mjs} +3 -3
- package/dist/chunks/{NcSelectUsers-LqSEQ2A_.mjs.map → NcSelectUsers-CI8twLn9.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-DnzR8DRc.mjs → NcSettingsSection-DmfxX2se.mjs} +6 -6
- package/dist/chunks/{NcSettingsSection-DnzR8DRc.mjs.map → NcSettingsSection-DmfxX2se.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-C15v3EvD.mjs → NcSettingsSelectGroup-TN64yH4k.mjs} +3 -3
- package/dist/chunks/{NcSettingsSelectGroup-C15v3EvD.mjs.map → NcSettingsSelectGroup-TN64yH4k.mjs.map} +1 -1
- package/dist/chunks/{NcTextArea-CseOD9aM.mjs → NcTextArea-Dxzj4zdb.mjs} +23 -23
- package/dist/chunks/{NcTextArea-CseOD9aM.mjs.map → NcTextArea-Dxzj4zdb.mjs.map} +1 -1
- package/dist/chunks/{NcTextField.vue_vue_type_script_setup_true_lang-1ABbHJ0f.mjs → NcTextField.vue_vue_type_script_setup_true_lang-BQHjkK8r.mjs} +7 -7
- package/dist/chunks/{NcTextField.vue_vue_type_script_setup_true_lang-1ABbHJ0f.mjs.map → NcTextField.vue_vue_type_script_setup_true_lang-BQHjkK8r.mjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-lGMjb2u1.mjs → NcTimezonePicker.vue_vue_type_script_setup_true_lang-Csd1JQe6.mjs} +4 -4
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-lGMjb2u1.mjs.map → NcTimezonePicker.vue_vue_type_script_setup_true_lang-Csd1JQe6.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-D00m2qmd.mjs → NcUserBubble-CDQa0hGy.mjs} +13 -13
- package/dist/chunks/{NcUserBubble-D00m2qmd.mjs.map → NcUserBubble-CDQa0hGy.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-CNh1vXUF.mjs → NcUserStatusIcon-DsviB2Cr.mjs} +2 -2
- package/dist/chunks/{NcUserStatusIcon-CNh1vXUF.mjs.map → NcUserStatusIcon-DsviB2Cr.mjs.map} +1 -1
- package/dist/chunks/{_l10n-BCg4udFv.mjs → _l10n-CG4CuN3H.mjs} +3 -3
- package/dist/chunks/_l10n-CG4CuN3H.mjs.map +1 -0
- package/dist/chunks/{autolink-_k1FETYm.mjs → autolink-BT8u-IL-.mjs} +4 -4
- package/dist/chunks/{autolink-_k1FETYm.mjs.map → autolink-BT8u-IL-.mjs.map} +1 -1
- package/dist/chunks/{colors-CSua0q55.mjs → colors-BDeMBgfq.mjs} +6 -2
- package/dist/chunks/{colors-CSua0q55.mjs.map → colors-BDeMBgfq.mjs.map} +1 -1
- package/dist/chunks/legacy-BoqDmOCa.mjs +9 -0
- package/dist/chunks/legacy-BoqDmOCa.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-Bsq4XIcs.mjs → referencePickerModal-B4bsiMOy.mjs} +19 -19
- package/dist/chunks/referencePickerModal-B4bsiMOy.mjs.map +1 -0
- package/dist/chunks/{useCopy--plF8q1P.mjs → useCopy-PckLYUAU.mjs} +2 -2
- package/dist/chunks/{useCopy--plF8q1P.mjs.map → useCopy-PckLYUAU.mjs.map} +1 -1
- package/dist/components/NcActionButton/index.mjs +1 -1
- package/dist/components/NcActionButtonGroup/index.mjs +1 -1
- package/dist/components/NcActionCheckbox/index.mjs +1 -1
- package/dist/components/NcActionInput/NcActionInput.vue.d.ts +10 -18
- package/dist/components/NcActionInput/index.mjs +1 -1
- package/dist/components/NcActionLink/index.mjs +1 -1
- package/dist/components/NcActionRadio/index.mjs +1 -1
- package/dist/components/NcActionRouter/index.mjs +1 -1
- package/dist/components/NcActionText/index.mjs +1 -1
- package/dist/components/NcActionTextEditable/index.mjs +1 -1
- 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/index.mjs +1 -1
- package/dist/components/NcAppNavigationItem/NcAppNavigationIconCollapsible.vue.d.ts +3 -1
- package/dist/components/NcAppNavigationItem/NcAppNavigationItem.vue.d.ts +7 -2
- package/dist/components/NcAppNavigationItem/NcInputConfirmCancel.vue.d.ts +3 -1
- package/dist/components/NcAppNavigationItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationNew/index.mjs +1 -1
- package/dist/components/NcAppNavigationNewItem/NcAppNavigationNewItem.vue.d.ts +3 -1
- package/dist/components/NcAppNavigationNewItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationSearch/NcAppNavigationSearch.vue.d.ts +6 -10
- package/dist/components/NcAppNavigationSearch/index.mjs +1 -1
- package/dist/components/NcAppNavigationSettings/index.mjs +1 -1
- package/dist/components/NcAppSettingsDialog/index.mjs +1 -1
- package/dist/components/NcAppSettingsSection/index.mjs +1 -1
- package/dist/components/NcAppSettingsSectionShortcuts/index.mjs +1 -1
- package/dist/components/NcAppSettingsShortcutsSection/index.mjs +1 -1
- package/dist/components/NcAppSidebar/NcAppSidebar.vue.d.ts +2 -1
- package/dist/components/NcAppSidebar/NcAppSidebarTabs.vue.d.ts +3 -2
- package/dist/components/NcAppSidebar/index.mjs +1 -1
- package/dist/components/NcAppSidebarHeader/index.mjs +1 -1
- package/dist/components/NcAssistantButton/index.mjs +1 -1
- package/dist/components/NcAssistantContent/index.mjs +1 -1
- package/dist/components/NcAssistantIcon/index.mjs +1 -1
- package/dist/components/NcAvatar/index.mjs +1 -1
- package/dist/components/NcBlurHash/index.mjs +1 -1
- package/dist/components/NcBreadcrumb/NcBreadcrumb.vue.d.ts +1 -3
- package/dist/components/NcBreadcrumb/index.mjs +1 -1
- package/dist/components/NcBreadcrumbs/NcBreadcrumbs.vue.d.ts +1 -3
- 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/index.mjs +1 -1
- package/dist/components/NcColorPicker/index.mjs +1 -1
- package/dist/components/NcContent/index.mjs +1 -1
- package/dist/components/NcCounterBubble/index.mjs +1 -1
- package/dist/components/NcDashboardWidget/index.mjs +1 -1
- package/dist/components/NcDashboardWidgetItem/index.mjs +1 -1
- package/dist/components/NcDateTime/index.mjs +1 -1
- package/dist/components/NcDateTimePicker/NcDateTimePicker.vue.d.ts +4 -8
- 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/NcEmojiPicker.vue.d.ts +3 -5
- package/dist/components/NcEmojiPicker/index.mjs +1 -1
- package/dist/components/NcEmptyContent/index.mjs +1 -1
- package/dist/components/NcFilePicker/index.mjs +1 -1
- package/dist/components/NcFormBox/index.mjs +1 -1
- package/dist/components/NcFormBoxButton/index.mjs +1 -1
- package/dist/components/NcFormBoxCopyButton/index.mjs +1 -1
- package/dist/components/NcFormBoxSwitch/index.mjs +1 -1
- package/dist/components/NcFormGroup/index.mjs +1 -1
- package/dist/components/NcHeaderButton/index.mjs +1 -1
- package/dist/components/NcHeaderMenu/NcHeaderMenu.vue.d.ts +4 -8
- 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 +3 -1
- package/dist/components/NcListItem/index.mjs +1 -1
- package/dist/components/NcListItemIcon/index.mjs +1 -1
- package/dist/components/NcLoadingIcon/index.mjs +1 -1
- package/dist/components/NcModal/index.mjs +1 -1
- package/dist/components/NcNoteCard/index.mjs +1 -1
- package/dist/components/NcPasswordField/NcPasswordField.vue.d.ts +6 -10
- package/dist/components/NcPasswordField/index.mjs +1 -1
- package/dist/components/NcProgressBar/index.mjs +1 -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/index.mjs +1 -1
- package/dist/components/NcRichText/NcReferencePicker/NcRawLinkInput.vue.d.ts +3 -5
- package/dist/components/NcRichText/NcReferencePicker/NcReferencePicker.vue.d.ts +3 -5
- package/dist/components/NcRichText/NcReferencePicker/NcReferencePickerModal.vue.d.ts +3 -5
- package/dist/components/NcRichText/index.mjs +3 -3
- package/dist/components/NcSavingIndicatorIcon/index.mjs +1 -1
- 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/index.mjs +1 -1
- package/dist/components/NcTextArea/index.mjs +1 -1
- package/dist/components/NcTextField/NcTextField.vue.d.ts +6 -10
- 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/composables/useFormatDateTime/index.mjs +1 -1
- package/dist/functions/reference/index.mjs +1 -1
- package/dist/functions/usernameToColor/index.mjs +1 -1
- package/dist/index.mjs +83 -83
- package/dist/utils/legacy.d.ts +1 -0
- package/package.json +15 -15
- package/dist/assets/NcAppSettingsDialog-Ckc0OWTs.css +0 -98
- package/dist/assets/NcInputConfirmCancel-BrdZEfr2.css +0 -39
- package/dist/assets/NcListItem-Cat18cSx.css +0 -177
- package/dist/chunks/NcActionTextEditable-BC66QDvV.mjs.map +0 -1
- package/dist/chunks/NcAppNavigation-C2njwnqV.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationItem-Csh8IBIf.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsDialog-CjOvPWbc.mjs.map +0 -1
- package/dist/chunks/NcAppSidebar-BvXH4I-d.mjs.map +0 -1
- package/dist/chunks/NcAssistantButton-DxNbEbqt.mjs.map +0 -1
- package/dist/chunks/NcButton-lQra4n2g.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch-VV_Err2A.mjs.map +0 -1
- package/dist/chunks/NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL.mjs.map +0 -1
- package/dist/chunks/NcHotkeyList-lslhX0EJ.mjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-xoQuby4k.mjs.map +0 -1
- package/dist/chunks/NcListItem-C0y1LfQx.mjs.map +0 -1
- package/dist/chunks/NcRelatedResourcesPanel-B01Lid3d.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-DeN1H5pQ.mjs.map +0 -1
- package/dist/chunks/NcRichText-DGV7OHFb.mjs.map +0 -1
- package/dist/chunks/_l10n-BCg4udFv.mjs.map +0 -1
- package/dist/chunks/legacy-DcjXBL_t.mjs +0 -6
- package/dist/chunks/legacy-DcjXBL_t.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-Bsq4XIcs.mjs.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import '../assets/NcModal-
|
|
1
|
+
import '../assets/NcModal-D81luiuU.css';
|
|
2
2
|
import { getCurrentInstance, warn, defineComponent, useCssVars, useModel, useTemplateRef, onUnmounted, watch, toRef, ref, watchEffect, computed, useSlots, onMounted, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementVNode, mergeProps, unref, createElementBlock, toDisplayString, createCommentVNode, normalizeClass, renderSlot, withModifiers, vShow, mergeModels, nextTick } from "vue";
|
|
3
3
|
import { E as mdiPause, F as mdiPlay, b as mdiClose, z as mdiChevronLeft, c as mdiChevronRight } from "./mdi-CpchYUUV.mjs";
|
|
4
4
|
import { useIntervalFn, useSwipe } from "@vueuse/core";
|
|
5
5
|
import { createFocusTrap } from "focus-trap";
|
|
6
|
-
import { N as NcActions } from "./NcActions-
|
|
7
|
-
import { N as NcButton } from "./NcButton-
|
|
8
|
-
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-
|
|
6
|
+
import { N as NcActions } from "./NcActions-CUmcZ3C3.mjs";
|
|
7
|
+
import { N as NcButton } from "./NcButton-QbPBynlU.mjs";
|
|
8
|
+
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-g8ubWhoz.mjs";
|
|
9
9
|
import "../composables/useFormatDateTime/index.mjs";
|
|
10
10
|
import { useHotKey } from "../composables/useHotKey/index.mjs";
|
|
11
11
|
import "../composables/useIsDarkTheme/index.mjs";
|
|
12
12
|
import "../composables/useIsFullscreen/index.mjs";
|
|
13
13
|
import "../composables/useIsMobile/index.mjs";
|
|
14
|
-
import { r as register, D as t36, A as t19, a as t } from "./_l10n-
|
|
14
|
+
import { r as register, D as t36, A as t19, a as t } from "./_l10n-CG4CuN3H.mjs";
|
|
15
15
|
import { c as createElementId } from "./createElementId-DhjFt1I9.mjs";
|
|
16
16
|
import { g as getTrapStack } from "./focusTrap-HJQ4pqHV.mjs";
|
|
17
17
|
import { i as isRtl } from "./rtl-v0UOPAM7.mjs";
|
|
@@ -91,8 +91,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
91
91
|
emits: /* @__PURE__ */ mergeModels(["next", "previous", "close", "update:show"], ["update:show"]),
|
|
92
92
|
setup(__props, { emit: __emit }) {
|
|
93
93
|
useCssVars((_ctx) => ({
|
|
94
|
-
"
|
|
95
|
-
"
|
|
94
|
+
"v046d2bb2": numHeaderActions.value,
|
|
95
|
+
"v71f7c020": cssSlideshowDelay.value
|
|
96
96
|
}));
|
|
97
97
|
const showModal = useModel(__props, "show");
|
|
98
98
|
const props = __props;
|
|
@@ -237,8 +237,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
237
237
|
}
|
|
238
238
|
return (_ctx, _cache) => {
|
|
239
239
|
return openBlock(), createBlock(Teleport, {
|
|
240
|
-
disabled:
|
|
241
|
-
to:
|
|
240
|
+
disabled: __props.container === null,
|
|
241
|
+
to: __props.container
|
|
242
242
|
}, [
|
|
243
243
|
createVNode(Transition, {
|
|
244
244
|
name: "fade",
|
|
@@ -250,12 +250,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
250
250
|
withDirectives(createElementVNode("div", mergeProps({ ..._ctx.$attrs, ...unref(scopeIdAttrs) }, {
|
|
251
251
|
ref: "mask",
|
|
252
252
|
class: ["modal-mask", {
|
|
253
|
-
"modal-mask--opaque":
|
|
254
|
-
"modal-mask--light":
|
|
253
|
+
"modal-mask--opaque": __props.dark || __props.closeButtonOutside || __props.hasPrevious || __props.hasNext,
|
|
254
|
+
"modal-mask--light": __props.lightBackdrop
|
|
255
255
|
}],
|
|
256
256
|
role: "dialog",
|
|
257
257
|
"aria-modal": "true",
|
|
258
|
-
"aria-labelledby":
|
|
258
|
+
"aria-labelledby": __props.labelId || `modal-name-${unref(modalId)}`,
|
|
259
259
|
"aria-describedby": "modal-description-" + unref(modalId),
|
|
260
260
|
tabindex: "-1"
|
|
261
261
|
}), [
|
|
@@ -266,18 +266,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
266
266
|
default: withCtx(() => [
|
|
267
267
|
createElementVNode("div", {
|
|
268
268
|
class: "modal-header",
|
|
269
|
-
"data-theme-light":
|
|
270
|
-
"data-theme-dark": !
|
|
269
|
+
"data-theme-light": __props.lightBackdrop,
|
|
270
|
+
"data-theme-dark": !__props.lightBackdrop
|
|
271
271
|
}, [
|
|
272
|
-
|
|
272
|
+
__props.name.trim() !== "" ? (openBlock(), createElementBlock("h2", {
|
|
273
273
|
key: 0,
|
|
274
274
|
id: "modal-name-" + unref(modalId),
|
|
275
275
|
class: "modal-header__name"
|
|
276
|
-
}, toDisplayString(
|
|
276
|
+
}, toDisplayString(__props.name), 9, _hoisted_3)) : createCommentVNode("", true),
|
|
277
277
|
createElementVNode("div", _hoisted_4, [
|
|
278
|
-
|
|
278
|
+
__props.hasNext && __props.enableSlideshow ? (openBlock(), createElementBlock("button", {
|
|
279
279
|
key: 0,
|
|
280
|
-
class: normalizeClass(["play-pause-icons", { "play-pause-icons--paused":
|
|
280
|
+
class: normalizeClass(["play-pause-icons", { "play-pause-icons--paused": __props.slideshowPaused }]),
|
|
281
281
|
title: unref(isPlaying) ? unref(t)("Pause slideshow") : unref(t)("Start slideshow"),
|
|
282
282
|
type: "button",
|
|
283
283
|
onClick: _cache[0] || (_cache[0] = ($event) => runSlideshow.value = !runSlideshow.value)
|
|
@@ -307,14 +307,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
307
307
|
], 10, _hoisted_5)) : createCommentVNode("", true),
|
|
308
308
|
createVNode(NcActions, {
|
|
309
309
|
class: "header-actions",
|
|
310
|
-
inline:
|
|
310
|
+
inline: __props.inlineActions
|
|
311
311
|
}, {
|
|
312
312
|
default: withCtx(() => [
|
|
313
313
|
renderSlot(_ctx.$slots, "actions", {}, void 0, true)
|
|
314
314
|
]),
|
|
315
315
|
_: 3
|
|
316
316
|
}, 8, ["inline"]),
|
|
317
|
-
!
|
|
317
|
+
!__props.noClose && __props.closeButtonOutside ? (openBlock(), createBlock(NcButton, {
|
|
318
318
|
key: 1,
|
|
319
319
|
"aria-label": unref(t)("Close"),
|
|
320
320
|
class: "header-close",
|
|
@@ -332,14 +332,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
332
332
|
_: 3
|
|
333
333
|
}),
|
|
334
334
|
createVNode(Transition, {
|
|
335
|
-
name: `modal-${
|
|
335
|
+
name: `modal-${__props.outTransition ? "out" : "in"}`,
|
|
336
336
|
appear: ""
|
|
337
337
|
}, {
|
|
338
338
|
default: withCtx(() => [
|
|
339
339
|
withDirectives(createElementVNode("div", {
|
|
340
340
|
class: normalizeClass(["modal-wrapper", [
|
|
341
|
-
`modal-wrapper--${
|
|
342
|
-
{ "modal-wrapper--spread-navigation":
|
|
341
|
+
`modal-wrapper--${__props.size}`,
|
|
342
|
+
{ "modal-wrapper--spread-navigation": __props.spreadNavigation }
|
|
343
343
|
]]),
|
|
344
344
|
onMousedown: withModifiers(handleClickModalWrapper, ["self"])
|
|
345
345
|
}, [
|
|
@@ -363,7 +363,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
363
363
|
]),
|
|
364
364
|
_: 1
|
|
365
365
|
}, 8, ["aria-label"]), [
|
|
366
|
-
[vShow,
|
|
366
|
+
[vShow, __props.hasPrevious]
|
|
367
367
|
])
|
|
368
368
|
]),
|
|
369
369
|
_: 1
|
|
@@ -375,7 +375,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
375
375
|
createElementVNode("div", _hoisted_7, [
|
|
376
376
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
377
377
|
]),
|
|
378
|
-
!
|
|
378
|
+
!__props.noClose && !__props.closeButtonOutside ? (openBlock(), createBlock(NcButton, {
|
|
379
379
|
key: 0,
|
|
380
380
|
"aria-label": unref(t)("Close"),
|
|
381
381
|
class: "modal-container__close",
|
|
@@ -408,7 +408,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
408
408
|
]),
|
|
409
409
|
_: 1
|
|
410
410
|
}, 8, ["aria-label"]), [
|
|
411
|
-
[vShow,
|
|
411
|
+
[vShow, __props.hasNext]
|
|
412
412
|
])
|
|
413
413
|
]),
|
|
414
414
|
_: 1
|
|
@@ -429,8 +429,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
431
|
});
|
|
432
|
-
const NcModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
432
|
+
const NcModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3c357e2d"]]);
|
|
433
433
|
export {
|
|
434
434
|
NcModal as N
|
|
435
435
|
};
|
|
436
|
-
//# sourceMappingURL=NcModal-
|
|
436
|
+
//# sourceMappingURL=NcModal-DUWLRm_F.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcModal-CDj4hQx7.mjs","sources":["../../src/composables/useScopeIdAttrs.ts","../../src/components/NcModal/NcModal.vue"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { ComponentInternalInstance } from 'vue'\n\nimport { getCurrentInstance, warn } from 'vue'\n\n/**\n * Get the parent instance of the instance only if the instance is the root node of the parent\n * - Parent > Child - same root node\n * - Parent > div > Child - different root node\n * - Parent > WrapperWithSlot > Child - different root node\n *\n * @param instance - Current instance (internal)\n */\nfunction getSameNodeParent(instance: ComponentInternalInstance): ComponentInternalInstance | null {\n\tif (!instance.parent) {\n\t\treturn null\n\t}\n\n\tif ('vapor' in instance || 'vapor' in instance.parent) {\n\t\twarn('Vapor instances are not supported in useScopeIdAttrs :(')\n\t\treturn null\n\t}\n\n\tif (instance.parent.subTree !== instance.vnode) {\n\t\treturn null\n\t}\n\n\treturn instance.parent\n}\n\n/**\n * Get all ancestor instances of the instance that are on the same root node\n *\n * @param instance - Current instance (internal)\n */\nfunction getSameNodeAncestors(instance: ComponentInternalInstance): ComponentInternalInstance[] {\n\tconst ancestors: ComponentInternalInstance[] = [instance]\n\tlet parent = getSameNodeParent(instance)\n\twhile (parent) {\n\t\tancestors.push(parent)\n\t\tparent = getSameNodeParent(parent)\n\t}\n\treturn ancestors\n}\n\n/**\n * Get a binding object for all data-v-scopeid attributes that are supposed to be on the root node.\n * It allows to have scoped styles from parents in edge cases not covered by Vue:\n * - Teleport on the root\n * - Fragments\n *\n * @todo Do we need to support slotScopeIds for `:slotted()`?\n *\n * @example\n * ```ts\n * <script setup>\n * import { useScopeIdAttrs } from './useScopeIdAttrs.ts'\n * const scopeIdAttrs = useScopeIdAttrs()\n * </script>\n * <template>\n * <teleport to=\"body\">\n * <div v-bind=\"scopeIdAttrs\" />\n * </teleport>\n * </template>\n * ```\n */\nexport function useScopeIdAttrs() {\n\tconst instance = getCurrentInstance()\n\n\tif (!instance) {\n\t\tthrow new Error('useScopeId must be called within a setup context')\n\t}\n\n\tconst sameNodeAncestors = getSameNodeAncestors(instance)\n\tconst scopeIds = sameNodeAncestors.map((instance) => instance.vnode.scopeId).filter(Boolean)\n\tconst scopeIdAttrs = Object.fromEntries(scopeIds.map((scopeId) => [scopeId, '']))\n\treturn scopeIdAttrs\n}\n","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<script setup lang=\"ts\">\nimport type { UseSwipeDirection } from '@vueuse/core'\nimport type { FocusTargetValueOrFalse, FocusTrap, Options as FocusTrapOptions } from 'focus-trap'\nimport type { Slot } from 'vue'\n\nimport { mdiChevronLeft, mdiChevronRight, mdiClose, mdiPause, mdiPlay } from '@mdi/js'\nimport { useIntervalFn, useSwipe } from '@vueuse/core'\nimport { createFocusTrap } from 'focus-trap'\nimport { computed, nextTick, onMounted, onUnmounted, ref, toRef, useSlots, useTemplateRef, warn, watch, watchEffect } from 'vue'\nimport NcActions from '../NcActions/NcActions.vue'\nimport NcButton from '../NcButton/NcButton.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\nimport { useHotKey } from '../../composables/index.ts'\nimport { useScopeIdAttrs } from '../../composables/useScopeIdAttrs.ts'\nimport { t } from '../../l10n.ts'\nimport { createElementId } from '../../utils/createElementId.ts'\nimport { getTrapStack } from '../../utils/focusTrap.ts'\nimport { isRtl } from '../../utils/rtl.ts'\n\ndefineOptions({ inheritAttrs: false })\n\n/**\n * The show-state of the modal.\n */\nconst showModal = defineModel<boolean>('show', { default: true })\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * Name to be shown with the modal\n\t */\n\tname?: string\n\n\t/**\n\t * Declare if a previous slide is available\n\t */\n\thasPrevious?: boolean\n\n\t/**\n\t * Declare if a next slide is available\n\t */\n\thasNext?: boolean\n\n\t/**\n\t * Declare if hiding the modal should be animated\n\t */\n\toutTransition?: boolean\n\n\t/**\n\t * Declare if the slideshow functionality should be enabled\n\t */\n\tenableSlideshow?: boolean\n\n\t/**\n\t * Declare the slide interval\n\t */\n\tslideshowDelay?: number\n\n\t/**\n\t * Allow to pause an ongoing slideshow\n\t */\n\tslideshowPaused?: boolean\n\n\t/**\n\t * Disable swipe between slides\n\t */\n\tdisableSwipe?: boolean\n\n\t/**\n\t * Enable spread navigation\n\t */\n\tspreadNavigation?: boolean\n\n\t/**\n\t * Defines the modal size.\n\t * All sizes except 'small' change automatically to full-screen on mobile.\n\t */\n\tsize?: 'small' | 'normal' | 'large' | 'full'\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 modal if the user clicked outside the modal\n\t * Only relevant if `noClose` is not set.\n\t */\n\tcloseOnClickOutside?: boolean\n\n\t/**\n\t * Makes the modal backdrop opaque if true\n\t * Will be overwritten if some buttons are shown outside\n\t */\n\tdark?: boolean\n\n\t/**\n\t * Set light backdrop. Makes the modal header appear light.\n\t */\n\tlightBackdrop?: boolean\n\n\t/**\n\t * Selector for the modal container, pass `null` to prevent automatic container mounting\n\t */\n\tcontainer?: string | null\n\n\t/**\n\t * Pass in `true` if you want the modal 'close' button to be displayed\n\t * outside the modal boundaries, in the top right corner of the window.\n\t *\n\t * @since 8.25.0\n\t */\n\tcloseButtonOutside?: boolean\n\n\t/**\n\t * Additional elements to add to the focus trap\n\t */\n\tadditionalTrapElements?: (string | HTMLElement)[]\n\n\t/**\n\t * Display x items inline\n\t *\n\t * @see NcActions component usage\n\t */\n\tinlineActions?: number\n\n\t/**\n\t * Id of the element that labels the dialog (the name)\n\t * Not needed if the `name` prop is set, but if no name is set you need to provide the ID of an element to label the dialog for accessibility.\n\t */\n\tlabelId?: string\n\n\t/**\n\t * Set element to return focus to after focus trap deactivation\n\t */\n\tsetReturnFocus?: FocusTargetValueOrFalse\n}>(), {\n\tadditionalTrapElements: () => [],\n\tcontainer: 'body',\n\tinlineActions: 0,\n\tlabelId: '',\n\tslideshowDelay: 5000,\n\tsize: 'normal',\n\tname: '',\n\tsetReturnFocus: undefined,\n})\n\nconst emit = defineEmits<{\n\t/**\n\t * Trigger showing the next slide.\n\t *\n\t * @param payload - The event that triggered showing the next slide\n\t */\n\tnext: [payload?: Event]\n\n\t/**\n\t * Trigger showing the previous slide.\n\t *\n\t * @param payload - The event that triggered showing the previous slide\n\t */\n\tprevious: [payload?: Event]\n\n\t/**\n\t * Emitted when the closing animation is finished\n\t *\n\t * @param payload - The event that triggered the close\n\t */\n\tclose: [payload?: Event]\n\n\t/**\n\t * @param payload - The new show-state\n\t */\n\t'update:show': [payload: boolean]\n}>()\n\ndefineSlots<{\n\t/**\n\t * Actions to show (one or more NcAction* components)\n\t */\n\tactions?: Slot\n\n\t/**\n\t * The modal content to show.\n\t */\n\tdefault?: Slot\n}>()\n\nconst scopeIdAttrs = useScopeIdAttrs()\n\nconst modalId = createElementId()\nconst maskElement = useTemplateRef('mask')\n\n// Set up the focus trap (handled by transition event listeners)\nlet focusTrap: FocusTrap | undefined\n// Ensure focus trap is cleared when the component is unmounted\nonUnmounted(() => clearFocusTrap())\n// and update the focus trap container elements when props change\nwatch(() => props.additionalTrapElements, (elements) => {\n\tif (focusTrap) {\n\t\tfocusTrap.updateContainerElements([maskElement.value!, ...elements])\n\t}\n})\n\n// Set up the slideshow\nconst {\n\tisActive: isPlaying,\n\tpause: stopSlideshow,\n\tresume: startSlideshow,\n} = useIntervalFn(nextSlide, toRef(() => props.slideshowDelay), { immediate: false })\n\nconst animationKey = ref(0)\nconst runSlideshow = ref(false)\nwatchEffect(() => {\n\tif (runSlideshow.value && !props.slideshowPaused) {\n\t\tstartSlideshow()\n\t} else if (isPlaying.value) {\n\t\tstopSlideshow()\n\t}\n})\n\nconst cssSlideshowDelay = computed(() => `${props.slideshowDelay}ms`)\n\n// Setup swipe navigation\nconst { stop: stopSwipe } = useSwipe(maskElement, {\n\tonSwipeEnd: handleSwipe,\n})\nonUnmounted(stopSwipe)\n\n// Setup hotkeys (keyboard navigation)\nuseHotKey('Escape', () => {\n\tconst trapStack = getTrapStack()\n\t// Only close the most recent focus trap modal\n\tif (trapStack.at(-1) === focusTrap) {\n\t\tclose()\n\t}\n}, { allowInModal: true })\n\nuseHotKey(['ArrowLeft', 'ArrowRight'], (event) => {\n\t// Ignore arrow navigation, if there is a current focus outside the modal.\n\t// For example, when the focus is in Sidebar or NcActions' items,\n\t// arrow navigation should not be intercepted by modal slider\n\tif (document.activeElement && !maskElement.value!.contains(document.activeElement)) {\n\t\treturn\n\t}\n\n\tif ((event.key === 'ArrowLeft') !== isRtl) {\n\t\tpreviousSlide()\n\t} else {\n\t\tnextSlide()\n\t}\n}, { allowInModal: true })\n\nconst slots = useSlots()\nconst numHeaderActions = computed(() => {\n\tlet actions = 0\n\tif (props.hasNext && props.enableSlideshow) {\n\t\tactions++\n\t}\n\tif (!props.noClose && props.closeButtonOutside) {\n\t\tactions++\n\t}\n\tif (slots.actions) {\n\t\tactions++\n\t}\n\n\treturn actions\n})\n\n// for developers we should add a warning if used with invalid props combination\nonMounted(() => {\n\tif (!props.name && !props.labelId) {\n\t\twarn('[NcModal] You need either set the name or set a `labelId` for accessibility.')\n\t}\n})\n\n/**\n * Trigger showing the next slide\n *\n * @param event - The mouse click event if triggered by user\n */\nfunction nextSlide(event?: Event) {\n\tif (!props.hasNext) {\n\t\trunSlideshow.value = false\n\t\t// do not send the event if nothing is available\n\t\treturn\n\t}\n\n\tif (event && isPlaying.value) {\n\t\trestartSlideshow()\n\t}\n\temit('next', event)\n}\n\n/**\n * Trigger showing the previous slide\n *\n * @param event - The mouse click event if triggered by user\n */\nfunction previousSlide(event?: Event) {\n\tif (!props.hasPrevious) {\n\t\t// do not send the event if nothing is available\n\t\treturn\n\t}\n\n\tif (event && isPlaying.value) {\n\t\trestartSlideshow()\n\t}\n\temit('previous', event)\n}\n\n/**\n * handle the swipe event\n *\n * @param e - The touch event\n * @param direction - Swipe direction\n */\nfunction handleSwipe(e: TouchEvent, direction: UseSwipeDirection) {\n\tif (!props.disableSwipe) {\n\t\tif (direction !== 'left' && direction !== 'right') {\n\t\t\treturn\n\t\t}\n\n\t\tif ((direction === 'left') !== isRtl) {\n\t\t\tnextSlide(e)\n\t\t} else {\n\t\t\tpreviousSlide(e)\n\t\t}\n\t}\n}\n\n/**\n * Reset the slideshow interval and animation\n */\nfunction restartSlideshow() {\n\tstopSlideshow()\n\tstartSlideshow()\n\tanimationKey.value++\n}\n\n/**\n * Handle closing the modal.\n *\n * @param event - The event that triggered closing the modal\n */\nfunction close(event?: Event) {\n\t// do not fire event if forbidden\n\tif (props.noClose) {\n\t\treturn\n\t}\n\n\tshowModal.value = false\n\n\t// delay closing for animation\n\tsetTimeout(() => {\n\t\temit('close', event)\n\t}, 300)\n}\n\n/**\n * Handle click on modal wrapper\n * If `closeOnClickOutside` is set the modal will be closed\n *\n * @param event - The click event\n */\nfunction handleClickModalWrapper(event: MouseEvent) {\n\tif (props.closeOnClickOutside) {\n\t\tclose(event)\n\t}\n}\n\n/**\n * Add focus trap for accessibility.\n */\nasync function useFocusTrap() {\n\t// Don't do anything if we have a focus trap already\n\tif (focusTrap) {\n\t\treturn\n\t}\n\n\t// wait until all children are mounted and available in the DOM before focusTrap can be added\n\tawait nextTick()\n\n\tconst options: FocusTrapOptions = {\n\t\tallowOutsideClick: true,\n\t\tfallbackFocus: maskElement.value!,\n\t\ttrapStack: getTrapStack(),\n\t\t// Esc can be used without stop in content or additionalTrapElements where it should not deactivate modal's focus trap.\n\t\t// Focus trap is deactivated on modal close anyway.\n\t\tescapeDeactivates: false,\n\t\tsetReturnFocus: props.setReturnFocus,\n\t}\n\t// Init focus trap\n\tfocusTrap = createFocusTrap([maskElement.value!, ...props.additionalTrapElements], options)\n\tfocusTrap.activate()\n}\n\n/**\n * Deactivate the active focus trap - if any.\n */\nfunction clearFocusTrap() {\n\tif (!focusTrap) {\n\t\treturn\n\t}\n\tfocusTrap?.deactivate()\n\tfocusTrap = undefined\n}\n</script>\n\n<template>\n\t<Teleport :disabled=\"container === null\" :to=\"container\">\n\t\t<transition\n\t\t\tname=\"fade\"\n\t\t\tappear\n\t\t\t@afterEnter=\"useFocusTrap\"\n\t\t\t@beforeLeave=\"clearFocusTrap\">\n\t\t\t<div\n\t\t\t\tv-show=\"showModal\"\n\t\t\t\tv-bind=\"{ ...$attrs, ...scopeIdAttrs }\"\n\t\t\t\tref=\"mask\"\n\t\t\t\tclass=\"modal-mask\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'modal-mask--opaque': dark || closeButtonOutside || hasPrevious || hasNext,\n\t\t\t\t\t'modal-mask--light': lightBackdrop,\n\t\t\t\t}\"\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\t:aria-labelledby=\"labelId || `modal-name-${modalId}`\"\n\t\t\t\t:aria-describedby=\"'modal-description-' + modalId\"\n\t\t\t\ttabindex=\"-1\">\n\t\t\t\t<!-- Header -->\n\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"modal-header\"\n\t\t\t\t\t\t:data-theme-light=\"lightBackdrop\"\n\t\t\t\t\t\t:data-theme-dark=\"!lightBackdrop\">\n\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\tv-if=\"name.trim() !== ''\"\n\t\t\t\t\t\t\t:id=\"'modal-name-' + modalId\"\n\t\t\t\t\t\t\tclass=\"modal-header__name\">\n\t\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<div class=\"icons-menu\">\n\t\t\t\t\t\t\t<!-- Play-pause toggle -->\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tv-if=\"hasNext && enableSlideshow\"\n\t\t\t\t\t\t\t\tclass=\"play-pause-icons\"\n\t\t\t\t\t\t\t\t:class=\"{ 'play-pause-icons--paused': slideshowPaused }\"\n\t\t\t\t\t\t\t\t:title=\"isPlaying ? t('Pause slideshow') : t('Start slideshow')\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t@click=\"runSlideshow = !runSlideshow\">\n\t\t\t\t\t\t\t\t<!-- Play/pause icons -->\n\t\t\t\t\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\t\t\t\t\tclass=\"play-pause-icons__icon\"\n\t\t\t\t\t\t\t\t\tinline\n\t\t\t\t\t\t\t\t\t:name=\"isPlaying ? t('Pause slideshow') : t('Start slideshow')\"\n\t\t\t\t\t\t\t\t\t:path=\"isPlaying ? mdiPause : mdiPlay\" />\n\n\t\t\t\t\t\t\t\t<!-- Progress circle, css animated -->\n\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\tv-if=\"isPlaying\"\n\t\t\t\t\t\t\t\t\t:key=\"`${modalId}-animation-${animationKey}`\"\n\t\t\t\t\t\t\t\t\tclass=\"progress-ring\"\n\t\t\t\t\t\t\t\t\theight=\"50\"\n\t\t\t\t\t\t\t\t\twidth=\"50\">\n\t\t\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\t\t\tclass=\"progress-ring__circle\"\n\t\t\t\t\t\t\t\t\t\tstroke=\"white\"\n\t\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\t\tfill=\"transparent\"\n\t\t\t\t\t\t\t\t\t\tr=\"15\"\n\t\t\t\t\t\t\t\t\t\tcx=\"25\"\n\t\t\t\t\t\t\t\t\t\tcy=\"25\" />\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t<!-- Actions menu -->\n\t\t\t\t\t\t\t<NcActions class=\"header-actions\" :inline=\"inlineActions\">\n\t\t\t\t\t\t\t\t<slot name=\"actions\" />\n\t\t\t\t\t\t\t</NcActions>\n\n\t\t\t\t\t\t\t<!-- Close modal -->\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tv-if=\"!noClose && closeButtonOutside\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('Close')\"\n\t\t\t\t\t\t\t\tclass=\"header-close\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t@click=\"close\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" />\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</div>\n\t\t\t\t\t</div>\n\t\t\t\t</transition>\n\n\t\t\t\t<!-- Content wrapper -->\n\t\t\t\t<transition :name=\"`modal-${outTransition ? 'out' : 'in'}`\" appear>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-show=\"showModal\"\n\t\t\t\t\t\tclass=\"modal-wrapper\"\n\t\t\t\t\t\t:class=\"[\n\t\t\t\t\t\t\t`modal-wrapper--${size}`,\n\t\t\t\t\t\t\t{ 'modal-wrapper--spread-navigation': spreadNavigation },\n\t\t\t\t\t\t]\"\n\t\t\t\t\t\t@mousedown.self=\"handleClickModalWrapper\">\n\t\t\t\t\t\t<!-- Navigation button -->\n\t\t\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tv-show=\"hasPrevious\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('Previous')\"\n\t\t\t\t\t\t\t\tclass=\"prev\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary-no-background\"\n\t\t\t\t\t\t\t\t@click=\"previousSlide\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\t\t\t\t\t\tdirectional\n\t\t\t\t\t\t\t\t\t\t:path=\"mdiChevronLeft\"\n\t\t\t\t\t\t\t\t\t\t:size=\"40\" />\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</transition>\n\n\t\t\t\t\t\t<!-- Content -->\n\t\t\t\t\t\t<div :id=\"'modal-description-' + modalId\" class=\"modal-container\">\n\t\t\t\t\t\t\t<div class=\"modal-container__content\">\n\t\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- Close modal -->\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tv-if=\"!noClose && !closeButtonOutside\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('Close')\"\n\t\t\t\t\t\t\t\tclass=\"modal-container__close\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t@click=\"close\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" />\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</div>\n\n\t\t\t\t\t\t<!-- Navigation button -->\n\t\t\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tv-show=\"hasNext\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('Next')\"\n\t\t\t\t\t\t\t\tclass=\"next\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary-no-background\"\n\t\t\t\t\t\t\t\t@click=\"nextSlide\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\t\t\t\t\t\tdirectional\n\t\t\t\t\t\t\t\t\t\t:path=\"mdiChevronRight\"\n\t\t\t\t\t\t\t\t\t\t:size=\"40\" />\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</transition>\n\t\t\t\t\t</div>\n\t\t\t\t</transition>\n\t\t\t</div>\n\t\t</transition>\n\t</Teleport>\n</template>\n\n<style lang=\"scss\" scoped>\n\n.modal-mask {\n\tposition: fixed;\n\tz-index: 9998;\n\ttop: 0;\n\tinset-inline-start: 0;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\t--backdrop-color: 0, 0, 0;\n\tbackground-color: rgba(var(--backdrop-color), .5);\n\n\t&,\n\t& * {\n\t\tbox-sizing: border-box;\n\t}\n\n\t&--opaque {\n\t\tbackground-color: rgba(var(--backdrop-color), .92);\n\t}\n\t&--light {\n\t\t--backdrop-color: 255, 255, 255;\n\t}\n}\n\n.modal-header {\n\tposition: absolute;\n\tz-index: 10001;\n\ttop: 0;\n\tinset-inline: 0 0;\n\t// prevent vue show to use display:none and resetting\n\t// the circle animation loop\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: space-between;\n\twidth: 100%;\n\theight: var(--header-height);\n\toverflow: hidden;\n\ttransition: opacity 250ms, visibility 250ms;\n\n\t&__name {\n\t\toverflow-x: hidden;\n\t\twidth: 100%;\n\t\tpadding-inline: 12px 0;\n\t\ttransition: padding ease 100ms;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tfont-size: $icon-size;\n\t\tmargin-block: 0;\n\t}\n\n\t// On wider screens the name can be centered\n\t@media only screen and (min-width: $breakpoint-mobile) {\n\t\t&__name {\n\t\t\t// On wider screens the name is centered, so we need to compensate for the actions to make the name really centered\n\t\t\tpadding-inline-start: calc(var(--header-height) * v-bind('numHeaderActions'));\n\t\t\ttext-align: center;\n\t\t}\n\t}\n\n\t.icons-menu {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\talign-self: flex-end;\n\n\t\t.header-close {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmargin: calc((var(--header-height) - var(--default-clickable-area)) / 2);\n\t\t\tpadding: 0;\n\t\t}\n\n\t\t.play-pause-icons {\n\t\t\tposition: relative;\n\t\t\twidth: var(--header-height);\n\t\t\theight: var(--header-height);\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tcursor: pointer;\n\t\t\tborder: none;\n\t\t\tbackground-color: transparent;\n\t\t\t&:hover,\n\t\t\t&:focus {\n\t\t\t\t.play-pause-icons__icon {\n\t\t\t\t\topacity: $opacity_full;\n\t\t\t\t\tborder-radius: calc(var(--default-clickable-area) / 2);\n\t\t\t\t\tbackground-color: $icon-focus-bg;\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__icon {\n\t\t\t\twidth: var(--default-clickable-area);\n\t\t\t\theight: var(--default-clickable-area);\n\t\t\t\tmargin: calc((var(--header-height) - var(--default-clickable-area)) / 2);\n\t\t\t\tcursor: pointer;\n\t\t\t\topacity: $opacity_normal;\n\t\t\t}\n\t\t}\n\n\t\t&:deep() .action-item {\n\t\t\tmargin: calc((var(--header-height) - var(--default-clickable-area)) / 2);\n\n\t\t\t&--single {\n\t\t\t\twidth: var(--default-clickable-area);\n\t\t\t\theight: var(--default-clickable-area);\n\t\t\t\tcursor: pointer;\n\t\t\t\tbackground-position: center;\n\t\t\t\tbackground-size: 22px;\n\t\t\t}\n\t\t}\n\n\t\t// The modal ignores the color theme and adds a black backdrop\n\t\t// so we need to add custom color of the actions toggle\n\t\t.header-actions :deep(button:focus-visible) {\n\t\t\tbox-shadow: none !important;\n\t\t\toutline: 2px solid #fff !important;\n\t\t}\n\t}\n}\n\n.modal-wrapper {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 100%;\n\theight: 100%;\n\n\t/* Navigation buttons */\n\t.prev,\n\t.next {\n\t\tz-index: 10000;\n\t\theight: 35vh;\n\t\tmin-height: 300px;\n\t\tposition: absolute;\n\t\ttransition: opacity 250ms;\n\t\t// hover the mask\n\t\tcolor: white;\n\n\t\t&:focus-visible {\n\t\t\t// Override NcButton focus styles\n\t\t\tbox-shadow: 0 0 0 2px var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-box-shadow);\n\t\t}\n\t}\n\n\t.prev {\n\t\tinset-inline-start: 2px;\n\t}\n\t.next {\n\t\tinset-inline-end: 2px;\n\t}\n\n\t/* Content */\n\t.modal-container {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tpadding: 0;\n\t\ttransition: transform 300ms ease;\n\t\tborder-radius: var(--border-radius-container);\n\t\tbackground-color: var(--color-main-background);\n\t\tcolor: var(--color-main-text);\n\t\tbox-shadow: 0 0 40px rgba(0, 0, 0, .2);\n\t\toverflow: auto;\n\n\t\t&__close {\n\t\t\t// Ensure the close button is always on top of the content\n\t\t\tz-index: 1;\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tinset-inline-end: var(--default-grid-baseline);\n\t\t}\n\n\t\t&__content {\n\t\t\twidth: 100%;\n\t\t\tmin-height: 52px; // At least the close button shall fit in\n\t\t\toverflow: auto; // avoids unnecessary hacks if the content should be bigger than the modal\n\t\t}\n\t}\n\n\t// We allow 90% max-height, but we need to ensure the header does not overlap the modal\n\t// as the modal is centered, we need the space on top and bottom\n\t$max-modal-height: min(90%, calc(100% - 2 * var(--header-height) - 2 * var(--body-container-margin)));\n\n\t// Sizing\n\t&--small {\n\t\t& > .modal-container {\n\t\t\twidth: 400px;\n\t\t\tmax-width: 90%;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--normal {\n\t\t& > .modal-container {\n\t\t\tmax-width: 90%;\n\t\t\twidth: 600px;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--large {\n\t\t& > .modal-container {\n\t\t\tmax-width: 90%;\n\t\t\twidth: 900px;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--full {\n\t\t& > .modal-container {\n\t\t\twidth: 100%;\n\t\t\theight: calc(100% - var(--header-height));\n\t\t\tposition: absolute;\n\t\t\ttop: var(--header-height);\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n\n\t// Make modal full screen on mobile\n\t@media only screen and ((max-width: $breakpoint-small-mobile) or (max-height: 400px)) {\n\t\t.modal-container {\n\t\t\tmax-width: initial;\n\t\t\twidth: 100%;\n\t\t\tmax-height: initial;\n\t\t\theight: calc(100% - var(--header-height));\n\t\t\tposition: absolute;\n\t\t\ttop: var(--header-height);\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n}\n\n/* TRANSITIONS */\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 250ms;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.fade-visibility-enter-from,\n.fade-visibility-leave-to {\n\tvisibility: hidden;\n\topacity: 0;\n}\n\n.modal-in-enter-active,\n.modal-in-leave-active,\n.modal-out-enter-active,\n.modal-out-leave-active {\n\ttransition: opacity 250ms;\n}\n\n.modal-in-enter-from,\n.modal-in-leave-to,\n.modal-out-enter-from,\n.modal-out-leave-to {\n\topacity: 0;\n}\n\n.modal-in-enter .modal-container,\n.modal-in-leave-to .modal-container {\n\ttransform: scale(.9);\n}\n\n.modal-out-enter .modal-container,\n.modal-out-leave-to .modal-container {\n\ttransform: scale(1.1);\n}\n\n// animated circle\n$radius: 15;\n$pi: 3.14159265358979;\n\n.modal-mask .play-pause-icons {\n\t.progress-ring {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tinset-inline-start: 0;\n\t\ttransform: rotate(-90deg);\n\t\t.progress-ring__circle {\n\t\t\ttransition: 100ms stroke-dashoffset;\n\t\t\ttransform-origin: 50% 50%; // axis compensation\n\t\t\tanimation: progressring linear v-bind('cssSlideshowDelay') infinite;\n\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-dashoffset: $radius * 2 * $pi; // radius * 2 * PI\n\t\t\tstroke-dasharray: $radius * 2 * $pi; // radius * 2 * PI\n\t\t}\n\t}\n\t&--paused {\n\t\t.play-pause-icons__icon {\n\t\t\tanimation: breath 2s cubic-bezier(.4, 0, .2, 1) infinite;\n\t\t}\n\t\t.progress-ring__circle {\n\t\t\tanimation-play-state: paused !important;\n\t\t}\n\t}\n}\n\n// keyframes get scoped too and break the animation name, we need them unscoped\n@keyframes progressring {\n\tfrom {\n\t\tstroke-dashoffset: $radius * 2 * $pi; // radius * 2 * PI\n\t}\n\tto {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes breath {\n\t0% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n</style>\n\n<docs>\nThe `NcModel` is the base component used for modals and dialogs.\nWhile `NcDialog` should be used for general dialogs like confirmations or forms,\n`NcModal` allows for custom content like showing image multimedia.\n\nFor showing the modal you can use either `v-model:show=\"showModal\"` or `v-if` on the `NcModal`,\ndepending on whether you require the Modal to stay within the DOM or not. Do not mix both, as this will break the out transition animation.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal</NcButton>\n\t\t<NcModal\n\t\t\tv-model:show=\"modal\"\n\t\t\t@close=\"closeModal\"\n\t\t\tsize=\"small\"\n\t\t\tname=\"Name\"\n\t\t\tout-transition>\n\t\t\t<template #actions>\n\t\t\t\t<NcActionCaption name=\"Some action\" />\n\t\t\t</template>\n\t\t\t<div class=\"modal__content\">Hello world</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tmodal: false\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t}\n\t}\n}\n</script>\n<style scoped>\n.modal__content {\n\tmargin: 50px;\n\ttext-align: center;\n}\n</style>\n```\n\n### Modal with slideshow\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"isOpen = true\">Show Modal</NcButton>\n\t\t<NcModal\n\t\t\tv-if=\"isOpen\"\n\t\t\tclose-button-outside\n\t\t\tenable-slideshow\n\t\t\t:has-next=\"page < lastPage\"\n\t\t\t:has-previous=\"page > 0\"\n\t\t\tname=\"Modal with slideshow\"\n\t\t\t@next=\"page++\"\n\t\t\t@previous=\"page--\"\n\t\t\t@close=\"isOpen = false\">\n\t\t\t<div class=\"modal__content\" :style=\"{ background: currentPage.background }\">\n\t\t\t\t<p class=\"model__content-text\">{{ currentPage.text }}</p>\n\t\t\t</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nconst PAGES = [\n\t{ text: 'First page', background: 'linear-gradient(#e66465, #9198e5)' },\n\t{ text: 'Second page', background: 'linear-gradient(0.25turn, #3f87a6, #ebf8e1, #f69d3c)' },\n\t{ text: 'Third page', background: 'lightblue' },\n\t{ text: 'Last page', background: 'lightgrey' },\n]\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tisOpen: false,\n\t\t\tpage: 0,\n\t\t\tlastPage: PAGES.length - 1,\n\t\t}\n\t},\n\tcomputed: {\n\t\tcurrentPage() {\n\t\t\treturn PAGES[this.page]\n\t\t},\n\t}\n}\n</script>\n<style scoped>\n.modal__content {\n\theight: 100%;\n\tmin-height: 30vh;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.model__content-text {\n\tfont-size: 16px;\n\tfont-weight: bold;\n}\n</style>\n```\n\n### Usage of popover in modal\n\n* Set container property to .modal-mask to inject popover context of the modal:\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal</NcButton>\n\t\t<NcModal\n\t\t\tv-model:show=\"modal\"\n\t\t\tclass=\"emoji-modal\"\n\t\t\tname=\"Modal with popover\"\n\t\t\tsize=\"small\"\n\t\t\t@close=\"closeModal\">\n\t\t\t<div class=\"emoji-modal__content\">\n\t\t\t\t<NcEmojiPicker container=\".emoji-modal\" @select=\"select\">\n\t\t\t\t\t<NcButton>Select emoji {{ emoji }}</NcButton>\n\t\t\t\t</NcEmojiPicker>\n\t\t\t</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\temoji: '😛',\n\t\t\tmodal: false\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t},\n\t\tselect(emoji) {\n\t\t\tthis.emoji = emoji\n\t\t},\n\t},\n}\n</script>\n<style scoped>\n.emoji-modal__content {\n\tdisplay: flex;\n\tjustify-content: center;\n\tmargin: 20px 0px 100px;\n}\n</style>\n```\n</docs>\n"],"names":["instance","_useModel","_createBlock","_Teleport","container","_createVNode","_Transition","_withDirectives","_createElementVNode","_mergeProps","$attrs","_unref","dark","closeButtonOutside","hasPrevious","hasNext","lightBackdrop","labelId","name","_createElementBlock","enableSlideshow","_normalizeClass","slideshowPaused","inlineActions","_renderSlot","noClose","outTransition","size","spreadNavigation"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAiBA,SAAS,kBAAkB,UAAuE;AACjG,MAAI,CAAC,SAAS,QAAQ;AACrB,WAAO;AAAA,EACR;AAEA,MAAI,WAAW,YAAY,WAAW,SAAS,QAAQ;AACtD,SAAK,yDAAyD;AAC9D,WAAO;AAAA,EACR;AAEA,MAAI,SAAS,OAAO,YAAY,SAAS,OAAO;AAC/C,WAAO;AAAA,EACR;AAEA,SAAO,SAAS;AACjB;AAOA,SAAS,qBAAqB,UAAkE;AAC/F,QAAM,YAAyC,CAAC,QAAQ;AACxD,MAAI,SAAS,kBAAkB,QAAQ;AACvC,SAAO,QAAQ;AACd,cAAU,KAAK,MAAM;AACrB,aAAS,kBAAkB,MAAM;AAAA,EAClC;AACA,SAAO;AACR;AAuBO,SAAS,kBAAkB;AACjC,QAAM,WAAW,mBAAA;AAEjB,MAAI,CAAC,UAAU;AACd,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACnE;AAEA,QAAM,oBAAoB,qBAAqB,QAAQ;AACvD,QAAM,WAAW,kBAAkB,IAAI,CAACA,cAAaA,UAAS,MAAM,OAAO,EAAE,OAAO,OAAO;AAC3F,QAAM,eAAe,OAAO,YAAY,SAAS,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC;AAChF,SAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpDA,UAAM,YAAYC,kBAAqB,MAAyB;AAEhE,UAAM,QAAQ;AAwHd,UAAM,OAAO;AAwCb,UAAM,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AEM,OAFN,YAEM;AAAA,wBADLgB,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA,sBAAA;sBAIDC,CAAAA,KAAAA,YAAYZ,KAAAA,mCADpBX,YASW,UAAA;AAAA;wBAPT,cAAYS,MAAA,CAAA,EAAC,OAAA;AAAA,wBACd,OAAM;AAAA,wBACN,SAAQ;AAAA,wBACP,SAAO;AAAA,sBAAA;wBACG,cACV,MAAqC;AAAA,0BAArCN,YAAqC,kBAAA,EAAlB,MAAMM,MAAA,QAAA,EAAA,GAAQ,MAAA,GAAA,CAAA,MAAA,CAAA;AAAA,wBAAA;;;;oBAMpCN,YAcaC,YAAA;AAAA,sBAdD,MAAK;AAAA,sBAAkB,QAAA;AAAA,oBAAA;uCAClC,MAYW;AAAA,uCAZXD,YAYW,UAAA;AAAA,0BAVT,cAAYM,MAAA,CAAA,EAAC,MAAA;AAAA,0BACd,OAAM;AAAA,0BACN,SAAQ;AAAA,0BACP,SAAO;AAAA,wBAAA;0BACG,cACV,MAGc;AAAA,4BAHdN,YAGc,kBAAA;AAAA,8BAFb,aAAA;AAAA,8BACC,MAAMM,MAAA,eAAA;AAAA,8BACN,MAAM;AAAA,4BAAA;;;;kCATDI,KAAAA,OAAO;AAAA,wBAAA;;;;;4BA7CT,UAAA,KAAS;AAAA,kBAAA;;;;;sBAlFX,UAAA,KAAS;AAAA,YAAA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcModal-DUWLRm_F.mjs","sources":["../../src/composables/useScopeIdAttrs.ts","../../src/components/NcModal/NcModal.vue"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { ComponentInternalInstance } from 'vue'\n\nimport { getCurrentInstance, warn } from 'vue'\n\n/**\n * Get the parent instance of the instance only if the instance is the root node of the parent\n * - Parent > Child - same root node\n * - Parent > div > Child - different root node\n * - Parent > WrapperWithSlot > Child - different root node\n *\n * @param instance - Current instance (internal)\n */\nfunction getSameNodeParent(instance: ComponentInternalInstance): ComponentInternalInstance | null {\n\tif (!instance.parent) {\n\t\treturn null\n\t}\n\n\tif ('vapor' in instance || 'vapor' in instance.parent) {\n\t\twarn('Vapor instances are not supported in useScopeIdAttrs :(')\n\t\treturn null\n\t}\n\n\tif (instance.parent.subTree !== instance.vnode) {\n\t\treturn null\n\t}\n\n\treturn instance.parent\n}\n\n/**\n * Get all ancestor instances of the instance that are on the same root node\n *\n * @param instance - Current instance (internal)\n */\nfunction getSameNodeAncestors(instance: ComponentInternalInstance): ComponentInternalInstance[] {\n\tconst ancestors: ComponentInternalInstance[] = [instance]\n\tlet parent = getSameNodeParent(instance)\n\twhile (parent) {\n\t\tancestors.push(parent)\n\t\tparent = getSameNodeParent(parent)\n\t}\n\treturn ancestors\n}\n\n/**\n * Get a binding object for all data-v-scopeid attributes that are supposed to be on the root node.\n * It allows to have scoped styles from parents in edge cases not covered by Vue:\n * - Teleport on the root\n * - Fragments\n *\n * @todo Do we need to support slotScopeIds for `:slotted()`?\n *\n * @example\n * ```ts\n * <script setup>\n * import { useScopeIdAttrs } from './useScopeIdAttrs.ts'\n * const scopeIdAttrs = useScopeIdAttrs()\n * </script>\n * <template>\n * <teleport to=\"body\">\n * <div v-bind=\"scopeIdAttrs\" />\n * </teleport>\n * </template>\n * ```\n */\nexport function useScopeIdAttrs() {\n\tconst instance = getCurrentInstance()\n\n\tif (!instance) {\n\t\tthrow new Error('useScopeId must be called within a setup context')\n\t}\n\n\tconst sameNodeAncestors = getSameNodeAncestors(instance)\n\tconst scopeIds = sameNodeAncestors.map((instance) => instance.vnode.scopeId).filter(Boolean)\n\tconst scopeIdAttrs = Object.fromEntries(scopeIds.map((scopeId) => [scopeId, '']))\n\treturn scopeIdAttrs\n}\n","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<script setup lang=\"ts\">\nimport type { UseSwipeDirection } from '@vueuse/core'\nimport type { FocusTargetValueOrFalse, FocusTrap, Options as FocusTrapOptions } from 'focus-trap'\nimport type { Slot } from 'vue'\n\nimport { mdiChevronLeft, mdiChevronRight, mdiClose, mdiPause, mdiPlay } from '@mdi/js'\nimport { useIntervalFn, useSwipe } from '@vueuse/core'\nimport { createFocusTrap } from 'focus-trap'\nimport { computed, nextTick, onMounted, onUnmounted, ref, toRef, useSlots, useTemplateRef, warn, watch, watchEffect } from 'vue'\nimport NcActions from '../NcActions/NcActions.vue'\nimport NcButton from '../NcButton/NcButton.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\nimport { useHotKey } from '../../composables/index.ts'\nimport { useScopeIdAttrs } from '../../composables/useScopeIdAttrs.ts'\nimport { t } from '../../l10n.ts'\nimport { createElementId } from '../../utils/createElementId.ts'\nimport { getTrapStack } from '../../utils/focusTrap.ts'\nimport { isRtl } from '../../utils/rtl.ts'\n\ndefineOptions({ inheritAttrs: false })\n\n/**\n * The show-state of the modal.\n */\nconst showModal = defineModel<boolean>('show', { default: true })\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * Name to be shown with the modal\n\t */\n\tname?: string\n\n\t/**\n\t * Declare if a previous slide is available\n\t */\n\thasPrevious?: boolean\n\n\t/**\n\t * Declare if a next slide is available\n\t */\n\thasNext?: boolean\n\n\t/**\n\t * Declare if hiding the modal should be animated\n\t */\n\toutTransition?: boolean\n\n\t/**\n\t * Declare if the slideshow functionality should be enabled\n\t */\n\tenableSlideshow?: boolean\n\n\t/**\n\t * Declare the slide interval\n\t */\n\tslideshowDelay?: number\n\n\t/**\n\t * Allow to pause an ongoing slideshow\n\t */\n\tslideshowPaused?: boolean\n\n\t/**\n\t * Disable swipe between slides\n\t */\n\tdisableSwipe?: boolean\n\n\t/**\n\t * Enable spread navigation\n\t */\n\tspreadNavigation?: boolean\n\n\t/**\n\t * Defines the modal size.\n\t * All sizes except 'small' change automatically to full-screen on mobile.\n\t */\n\tsize?: 'small' | 'normal' | 'large' | 'full'\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 modal if the user clicked outside the modal\n\t * Only relevant if `noClose` is not set.\n\t */\n\tcloseOnClickOutside?: boolean\n\n\t/**\n\t * Makes the modal backdrop opaque if true\n\t * Will be overwritten if some buttons are shown outside\n\t */\n\tdark?: boolean\n\n\t/**\n\t * Set light backdrop. Makes the modal header appear light.\n\t */\n\tlightBackdrop?: boolean\n\n\t/**\n\t * Selector for the modal container, pass `null` to prevent automatic container mounting\n\t */\n\tcontainer?: string | null\n\n\t/**\n\t * Pass in `true` if you want the modal 'close' button to be displayed\n\t * outside the modal boundaries, in the top right corner of the window.\n\t *\n\t * @since 8.25.0\n\t */\n\tcloseButtonOutside?: boolean\n\n\t/**\n\t * Additional elements to add to the focus trap\n\t */\n\tadditionalTrapElements?: (string | HTMLElement)[]\n\n\t/**\n\t * Display x items inline\n\t *\n\t * @see NcActions component usage\n\t */\n\tinlineActions?: number\n\n\t/**\n\t * Id of the element that labels the dialog (the name)\n\t * Not needed if the `name` prop is set, but if no name is set you need to provide the ID of an element to label the dialog for accessibility.\n\t */\n\tlabelId?: string\n\n\t/**\n\t * Set element to return focus to after focus trap deactivation\n\t */\n\tsetReturnFocus?: FocusTargetValueOrFalse\n}>(), {\n\tadditionalTrapElements: () => [],\n\tcontainer: 'body',\n\tinlineActions: 0,\n\tlabelId: '',\n\tslideshowDelay: 5000,\n\tsize: 'normal',\n\tname: '',\n\tsetReturnFocus: undefined,\n})\n\nconst emit = defineEmits<{\n\t/**\n\t * Trigger showing the next slide.\n\t *\n\t * @param payload - The event that triggered showing the next slide\n\t */\n\tnext: [payload?: Event]\n\n\t/**\n\t * Trigger showing the previous slide.\n\t *\n\t * @param payload - The event that triggered showing the previous slide\n\t */\n\tprevious: [payload?: Event]\n\n\t/**\n\t * Emitted when the closing animation is finished\n\t *\n\t * @param payload - The event that triggered the close\n\t */\n\tclose: [payload?: Event]\n\n\t/**\n\t * @param payload - The new show-state\n\t */\n\t'update:show': [payload: boolean]\n}>()\n\ndefineSlots<{\n\t/**\n\t * Actions to show (one or more NcAction* components)\n\t */\n\tactions?: Slot\n\n\t/**\n\t * The modal content to show.\n\t */\n\tdefault?: Slot\n}>()\n\nconst scopeIdAttrs = useScopeIdAttrs()\n\nconst modalId = createElementId()\nconst maskElement = useTemplateRef('mask')\n\n// Set up the focus trap (handled by transition event listeners)\nlet focusTrap: FocusTrap | undefined\n// Ensure focus trap is cleared when the component is unmounted\nonUnmounted(() => clearFocusTrap())\n// and update the focus trap container elements when props change\nwatch(() => props.additionalTrapElements, (elements) => {\n\tif (focusTrap) {\n\t\tfocusTrap.updateContainerElements([maskElement.value!, ...elements])\n\t}\n})\n\n// Set up the slideshow\nconst {\n\tisActive: isPlaying,\n\tpause: stopSlideshow,\n\tresume: startSlideshow,\n} = useIntervalFn(nextSlide, toRef(() => props.slideshowDelay), { immediate: false })\n\nconst animationKey = ref(0)\nconst runSlideshow = ref(false)\nwatchEffect(() => {\n\tif (runSlideshow.value && !props.slideshowPaused) {\n\t\tstartSlideshow()\n\t} else if (isPlaying.value) {\n\t\tstopSlideshow()\n\t}\n})\n\nconst cssSlideshowDelay = computed(() => `${props.slideshowDelay}ms`)\n\n// Setup swipe navigation\nconst { stop: stopSwipe } = useSwipe(maskElement, {\n\tonSwipeEnd: handleSwipe,\n})\nonUnmounted(stopSwipe)\n\n// Setup hotkeys (keyboard navigation)\nuseHotKey('Escape', () => {\n\tconst trapStack = getTrapStack()\n\t// Only close the most recent focus trap modal\n\tif (trapStack.at(-1) === focusTrap) {\n\t\tclose()\n\t}\n}, { allowInModal: true })\n\nuseHotKey(['ArrowLeft', 'ArrowRight'], (event) => {\n\t// Ignore arrow navigation, if there is a current focus outside the modal.\n\t// For example, when the focus is in Sidebar or NcActions' items,\n\t// arrow navigation should not be intercepted by modal slider\n\tif (document.activeElement && !maskElement.value!.contains(document.activeElement)) {\n\t\treturn\n\t}\n\n\tif ((event.key === 'ArrowLeft') !== isRtl) {\n\t\tpreviousSlide()\n\t} else {\n\t\tnextSlide()\n\t}\n}, { allowInModal: true })\n\nconst slots = useSlots()\nconst numHeaderActions = computed(() => {\n\tlet actions = 0\n\tif (props.hasNext && props.enableSlideshow) {\n\t\tactions++\n\t}\n\tif (!props.noClose && props.closeButtonOutside) {\n\t\tactions++\n\t}\n\tif (slots.actions) {\n\t\tactions++\n\t}\n\n\treturn actions\n})\n\n// for developers we should add a warning if used with invalid props combination\nonMounted(() => {\n\tif (!props.name && !props.labelId) {\n\t\twarn('[NcModal] You need either set the name or set a `labelId` for accessibility.')\n\t}\n})\n\n/**\n * Trigger showing the next slide\n *\n * @param event - The mouse click event if triggered by user\n */\nfunction nextSlide(event?: Event) {\n\tif (!props.hasNext) {\n\t\trunSlideshow.value = false\n\t\t// do not send the event if nothing is available\n\t\treturn\n\t}\n\n\tif (event && isPlaying.value) {\n\t\trestartSlideshow()\n\t}\n\temit('next', event)\n}\n\n/**\n * Trigger showing the previous slide\n *\n * @param event - The mouse click event if triggered by user\n */\nfunction previousSlide(event?: Event) {\n\tif (!props.hasPrevious) {\n\t\t// do not send the event if nothing is available\n\t\treturn\n\t}\n\n\tif (event && isPlaying.value) {\n\t\trestartSlideshow()\n\t}\n\temit('previous', event)\n}\n\n/**\n * handle the swipe event\n *\n * @param e - The touch event\n * @param direction - Swipe direction\n */\nfunction handleSwipe(e: TouchEvent, direction: UseSwipeDirection) {\n\tif (!props.disableSwipe) {\n\t\tif (direction !== 'left' && direction !== 'right') {\n\t\t\treturn\n\t\t}\n\n\t\tif ((direction === 'left') !== isRtl) {\n\t\t\tnextSlide(e)\n\t\t} else {\n\t\t\tpreviousSlide(e)\n\t\t}\n\t}\n}\n\n/**\n * Reset the slideshow interval and animation\n */\nfunction restartSlideshow() {\n\tstopSlideshow()\n\tstartSlideshow()\n\tanimationKey.value++\n}\n\n/**\n * Handle closing the modal.\n *\n * @param event - The event that triggered closing the modal\n */\nfunction close(event?: Event) {\n\t// do not fire event if forbidden\n\tif (props.noClose) {\n\t\treturn\n\t}\n\n\tshowModal.value = false\n\n\t// delay closing for animation\n\tsetTimeout(() => {\n\t\temit('close', event)\n\t}, 300)\n}\n\n/**\n * Handle click on modal wrapper\n * If `closeOnClickOutside` is set the modal will be closed\n *\n * @param event - The click event\n */\nfunction handleClickModalWrapper(event: MouseEvent) {\n\tif (props.closeOnClickOutside) {\n\t\tclose(event)\n\t}\n}\n\n/**\n * Add focus trap for accessibility.\n */\nasync function useFocusTrap() {\n\t// Don't do anything if we have a focus trap already\n\tif (focusTrap) {\n\t\treturn\n\t}\n\n\t// wait until all children are mounted and available in the DOM before focusTrap can be added\n\tawait nextTick()\n\n\tconst options: FocusTrapOptions = {\n\t\tallowOutsideClick: true,\n\t\tfallbackFocus: maskElement.value!,\n\t\ttrapStack: getTrapStack(),\n\t\t// Esc can be used without stop in content or additionalTrapElements where it should not deactivate modal's focus trap.\n\t\t// Focus trap is deactivated on modal close anyway.\n\t\tescapeDeactivates: false,\n\t\tsetReturnFocus: props.setReturnFocus,\n\t}\n\t// Init focus trap\n\tfocusTrap = createFocusTrap([maskElement.value!, ...props.additionalTrapElements], options)\n\tfocusTrap.activate()\n}\n\n/**\n * Deactivate the active focus trap - if any.\n */\nfunction clearFocusTrap() {\n\tif (!focusTrap) {\n\t\treturn\n\t}\n\tfocusTrap?.deactivate()\n\tfocusTrap = undefined\n}\n</script>\n\n<template>\n\t<Teleport :disabled=\"container === null\" :to=\"container\">\n\t\t<transition\n\t\t\tname=\"fade\"\n\t\t\tappear\n\t\t\t@afterEnter=\"useFocusTrap\"\n\t\t\t@beforeLeave=\"clearFocusTrap\">\n\t\t\t<div\n\t\t\t\tv-show=\"showModal\"\n\t\t\t\tv-bind=\"{ ...$attrs, ...scopeIdAttrs }\"\n\t\t\t\tref=\"mask\"\n\t\t\t\tclass=\"modal-mask\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'modal-mask--opaque': dark || closeButtonOutside || hasPrevious || hasNext,\n\t\t\t\t\t'modal-mask--light': lightBackdrop,\n\t\t\t\t}\"\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\t:aria-labelledby=\"labelId || `modal-name-${modalId}`\"\n\t\t\t\t:aria-describedby=\"'modal-description-' + modalId\"\n\t\t\t\ttabindex=\"-1\">\n\t\t\t\t<!-- Header -->\n\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"modal-header\"\n\t\t\t\t\t\t:data-theme-light=\"lightBackdrop\"\n\t\t\t\t\t\t:data-theme-dark=\"!lightBackdrop\">\n\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\tv-if=\"name.trim() !== ''\"\n\t\t\t\t\t\t\t:id=\"'modal-name-' + modalId\"\n\t\t\t\t\t\t\tclass=\"modal-header__name\">\n\t\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<div class=\"icons-menu\">\n\t\t\t\t\t\t\t<!-- Play-pause toggle -->\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tv-if=\"hasNext && enableSlideshow\"\n\t\t\t\t\t\t\t\tclass=\"play-pause-icons\"\n\t\t\t\t\t\t\t\t:class=\"{ 'play-pause-icons--paused': slideshowPaused }\"\n\t\t\t\t\t\t\t\t:title=\"isPlaying ? t('Pause slideshow') : t('Start slideshow')\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t@click=\"runSlideshow = !runSlideshow\">\n\t\t\t\t\t\t\t\t<!-- Play/pause icons -->\n\t\t\t\t\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\t\t\t\t\tclass=\"play-pause-icons__icon\"\n\t\t\t\t\t\t\t\t\tinline\n\t\t\t\t\t\t\t\t\t:name=\"isPlaying ? t('Pause slideshow') : t('Start slideshow')\"\n\t\t\t\t\t\t\t\t\t:path=\"isPlaying ? mdiPause : mdiPlay\" />\n\n\t\t\t\t\t\t\t\t<!-- Progress circle, css animated -->\n\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\tv-if=\"isPlaying\"\n\t\t\t\t\t\t\t\t\t:key=\"`${modalId}-animation-${animationKey}`\"\n\t\t\t\t\t\t\t\t\tclass=\"progress-ring\"\n\t\t\t\t\t\t\t\t\theight=\"50\"\n\t\t\t\t\t\t\t\t\twidth=\"50\">\n\t\t\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\t\t\tclass=\"progress-ring__circle\"\n\t\t\t\t\t\t\t\t\t\tstroke=\"white\"\n\t\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\t\tfill=\"transparent\"\n\t\t\t\t\t\t\t\t\t\tr=\"15\"\n\t\t\t\t\t\t\t\t\t\tcx=\"25\"\n\t\t\t\t\t\t\t\t\t\tcy=\"25\" />\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t<!-- Actions menu -->\n\t\t\t\t\t\t\t<NcActions class=\"header-actions\" :inline=\"inlineActions\">\n\t\t\t\t\t\t\t\t<slot name=\"actions\" />\n\t\t\t\t\t\t\t</NcActions>\n\n\t\t\t\t\t\t\t<!-- Close modal -->\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tv-if=\"!noClose && closeButtonOutside\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('Close')\"\n\t\t\t\t\t\t\t\tclass=\"header-close\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t@click=\"close\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" />\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</div>\n\t\t\t\t\t</div>\n\t\t\t\t</transition>\n\n\t\t\t\t<!-- Content wrapper -->\n\t\t\t\t<transition :name=\"`modal-${outTransition ? 'out' : 'in'}`\" appear>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-show=\"showModal\"\n\t\t\t\t\t\tclass=\"modal-wrapper\"\n\t\t\t\t\t\t:class=\"[\n\t\t\t\t\t\t\t`modal-wrapper--${size}`,\n\t\t\t\t\t\t\t{ 'modal-wrapper--spread-navigation': spreadNavigation },\n\t\t\t\t\t\t]\"\n\t\t\t\t\t\t@mousedown.self=\"handleClickModalWrapper\">\n\t\t\t\t\t\t<!-- Navigation button -->\n\t\t\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tv-show=\"hasPrevious\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('Previous')\"\n\t\t\t\t\t\t\t\tclass=\"prev\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary-no-background\"\n\t\t\t\t\t\t\t\t@click=\"previousSlide\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\t\t\t\t\t\tdirectional\n\t\t\t\t\t\t\t\t\t\t:path=\"mdiChevronLeft\"\n\t\t\t\t\t\t\t\t\t\t:size=\"40\" />\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</transition>\n\n\t\t\t\t\t\t<!-- Content -->\n\t\t\t\t\t\t<div :id=\"'modal-description-' + modalId\" class=\"modal-container\">\n\t\t\t\t\t\t\t<div class=\"modal-container__content\">\n\t\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- Close modal -->\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tv-if=\"!noClose && !closeButtonOutside\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('Close')\"\n\t\t\t\t\t\t\t\tclass=\"modal-container__close\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t@click=\"close\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" />\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</div>\n\n\t\t\t\t\t\t<!-- Navigation button -->\n\t\t\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tv-show=\"hasNext\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('Next')\"\n\t\t\t\t\t\t\t\tclass=\"next\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary-no-background\"\n\t\t\t\t\t\t\t\t@click=\"nextSlide\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\t\t\t\t\t\tdirectional\n\t\t\t\t\t\t\t\t\t\t:path=\"mdiChevronRight\"\n\t\t\t\t\t\t\t\t\t\t:size=\"40\" />\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</transition>\n\t\t\t\t\t</div>\n\t\t\t\t</transition>\n\t\t\t</div>\n\t\t</transition>\n\t</Teleport>\n</template>\n\n<style lang=\"scss\" scoped>\n\n.modal-mask {\n\tposition: fixed;\n\tz-index: 9998;\n\ttop: 0;\n\tinset-inline-start: 0;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\t--backdrop-color: 0, 0, 0;\n\tbackground-color: rgba(var(--backdrop-color), .5);\n\n\t&,\n\t& * {\n\t\tbox-sizing: border-box;\n\t}\n\n\t&--opaque {\n\t\tbackground-color: rgba(var(--backdrop-color), .92);\n\t}\n\t&--light {\n\t\t--backdrop-color: 255, 255, 255;\n\t}\n}\n\n.modal-header {\n\tposition: absolute;\n\tz-index: 10001;\n\ttop: 0;\n\tinset-inline: 0 0;\n\t// prevent vue show to use display:none and resetting\n\t// the circle animation loop\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: space-between;\n\twidth: 100%;\n\theight: var(--header-height);\n\toverflow: hidden;\n\ttransition: opacity 250ms, visibility 250ms;\n\n\t&__name {\n\t\toverflow-x: hidden;\n\t\twidth: 100%;\n\t\tpadding-inline: 12px 0;\n\t\ttransition: padding ease 100ms;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tfont-size: $icon-size;\n\t\tmargin-block: 0;\n\t}\n\n\t// On wider screens the name can be centered\n\t@media only screen and (min-width: $breakpoint-mobile) {\n\t\t&__name {\n\t\t\t// On wider screens the name is centered, so we need to compensate for the actions to make the name really centered\n\t\t\tpadding-inline-start: calc(var(--header-height) * v-bind('numHeaderActions'));\n\t\t\ttext-align: center;\n\t\t}\n\t}\n\n\t.icons-menu {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\talign-self: flex-end;\n\n\t\t.header-close {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmargin: calc((var(--header-height) - var(--default-clickable-area)) / 2);\n\t\t\tpadding: 0;\n\t\t}\n\n\t\t.play-pause-icons {\n\t\t\tposition: relative;\n\t\t\twidth: var(--header-height);\n\t\t\theight: var(--header-height);\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tcursor: pointer;\n\t\t\tborder: none;\n\t\t\tbackground-color: transparent;\n\t\t\t&:hover,\n\t\t\t&:focus {\n\t\t\t\t.play-pause-icons__icon {\n\t\t\t\t\topacity: $opacity_full;\n\t\t\t\t\tborder-radius: calc(var(--default-clickable-area) / 2);\n\t\t\t\t\tbackground-color: $icon-focus-bg;\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__icon {\n\t\t\t\twidth: var(--default-clickable-area);\n\t\t\t\theight: var(--default-clickable-area);\n\t\t\t\tmargin: calc((var(--header-height) - var(--default-clickable-area)) / 2);\n\t\t\t\tcursor: pointer;\n\t\t\t\topacity: $opacity_normal;\n\t\t\t}\n\t\t}\n\n\t\t&:deep() .action-item {\n\t\t\tmargin: calc((var(--header-height) - var(--default-clickable-area)) / 2);\n\n\t\t\t&--single {\n\t\t\t\twidth: var(--default-clickable-area);\n\t\t\t\theight: var(--default-clickable-area);\n\t\t\t\tcursor: pointer;\n\t\t\t\tbackground-position: center;\n\t\t\t\tbackground-size: 22px;\n\t\t\t}\n\t\t}\n\n\t\t// The modal ignores the color theme and adds a black backdrop\n\t\t// so we need to add custom color of the actions toggle\n\t\t.header-actions :deep(button:focus-visible) {\n\t\t\tbox-shadow: none !important;\n\t\t\toutline: 2px solid #fff !important;\n\t\t}\n\t}\n}\n\n.modal-wrapper {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 100%;\n\theight: 100%;\n\n\t/* Navigation buttons */\n\t.prev,\n\t.next {\n\t\tz-index: 10000;\n\t\theight: 35vh;\n\t\tmin-height: 300px;\n\t\tposition: absolute;\n\t\ttransition: opacity 250ms;\n\t\t// hover the mask\n\t\tcolor: white;\n\n\t\t&:focus-visible {\n\t\t\t// Override NcButton focus styles\n\t\t\tbox-shadow: 0 0 0 2px var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-box-shadow);\n\t\t}\n\t}\n\n\t.prev {\n\t\tinset-inline-start: 2px;\n\t}\n\t.next {\n\t\tinset-inline-end: 2px;\n\t}\n\n\t/* Content */\n\t.modal-container {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tpadding: 0;\n\t\ttransition: transform 300ms ease;\n\t\tborder-radius: var(--border-radius-container);\n\t\tbackground-color: var(--color-main-background);\n\t\tcolor: var(--color-main-text);\n\t\tbox-shadow: 0 0 40px rgba(0, 0, 0, .2);\n\t\toverflow: auto;\n\n\t\t&__close {\n\t\t\t// Ensure the close button is always on top of the content\n\t\t\tz-index: 1;\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tinset-inline-end: var(--default-grid-baseline);\n\t\t}\n\n\t\t&__content {\n\t\t\twidth: 100%;\n\t\t\tmin-height: 52px; // At least the close button shall fit in\n\t\t\toverflow: auto; // avoids unnecessary hacks if the content should be bigger than the modal\n\t\t}\n\t}\n\n\t// We allow 90% max-height, but we need to ensure the header does not overlap the modal\n\t// as the modal is centered, we need the space on top and bottom\n\t$max-modal-height: min(90%, calc(100% - 2 * var(--header-height) - 2 * var(--body-container-margin)));\n\n\t// Sizing\n\t&--small {\n\t\t& > .modal-container {\n\t\t\twidth: 400px;\n\t\t\tmax-width: 90%;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--normal {\n\t\t& > .modal-container {\n\t\t\tmax-width: 90%;\n\t\t\twidth: 600px;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--large {\n\t\t& > .modal-container {\n\t\t\tmax-width: 90%;\n\t\t\twidth: 900px;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--full {\n\t\t& > .modal-container {\n\t\t\twidth: 100%;\n\t\t\theight: calc(100% - var(--header-height));\n\t\t\tposition: absolute;\n\t\t\ttop: var(--header-height);\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n\n\t// Make modal full screen on mobile\n\t@media only screen and ((max-width: $breakpoint-small-mobile) or (max-height: 400px)) {\n\t\t.modal-container {\n\t\t\tmax-width: initial;\n\t\t\twidth: 100%;\n\t\t\tmax-height: initial;\n\t\t\theight: calc(100% - var(--header-height));\n\t\t\tposition: absolute;\n\t\t\ttop: var(--header-height);\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n}\n\n/* TRANSITIONS */\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 250ms;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.fade-visibility-enter-from,\n.fade-visibility-leave-to {\n\tvisibility: hidden;\n\topacity: 0;\n}\n\n.modal-in-enter-active,\n.modal-in-leave-active,\n.modal-out-enter-active,\n.modal-out-leave-active {\n\ttransition: opacity 250ms;\n}\n\n.modal-in-enter-from,\n.modal-in-leave-to,\n.modal-out-enter-from,\n.modal-out-leave-to {\n\topacity: 0;\n}\n\n.modal-in-enter .modal-container,\n.modal-in-leave-to .modal-container {\n\ttransform: scale(.9);\n}\n\n.modal-out-enter .modal-container,\n.modal-out-leave-to .modal-container {\n\ttransform: scale(1.1);\n}\n\n// animated circle\n$radius: 15;\n$pi: 3.14159265358979;\n\n.modal-mask .play-pause-icons {\n\t.progress-ring {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tinset-inline-start: 0;\n\t\ttransform: rotate(-90deg);\n\t\t.progress-ring__circle {\n\t\t\ttransition: 100ms stroke-dashoffset;\n\t\t\ttransform-origin: 50% 50%; // axis compensation\n\t\t\tanimation: progressring linear v-bind('cssSlideshowDelay') infinite;\n\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-dashoffset: $radius * 2 * $pi; // radius * 2 * PI\n\t\t\tstroke-dasharray: $radius * 2 * $pi; // radius * 2 * PI\n\t\t}\n\t}\n\t&--paused {\n\t\t.play-pause-icons__icon {\n\t\t\tanimation: breath 2s cubic-bezier(.4, 0, .2, 1) infinite;\n\t\t}\n\t\t.progress-ring__circle {\n\t\t\tanimation-play-state: paused !important;\n\t\t}\n\t}\n}\n\n// keyframes get scoped too and break the animation name, we need them unscoped\n@keyframes progressring {\n\tfrom {\n\t\tstroke-dashoffset: $radius * 2 * $pi; // radius * 2 * PI\n\t}\n\tto {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes breath {\n\t0% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n</style>\n\n<docs>\nThe `NcModel` is the base component used for modals and dialogs.\nWhile `NcDialog` should be used for general dialogs like confirmations or forms,\n`NcModal` allows for custom content like showing image multimedia.\n\nFor showing the modal you can use either `v-model:show=\"showModal\"` or `v-if` on the `NcModal`,\ndepending on whether you require the Modal to stay within the DOM or not. Do not mix both, as this will break the out transition animation.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal</NcButton>\n\t\t<NcModal\n\t\t\tv-model:show=\"modal\"\n\t\t\t@close=\"closeModal\"\n\t\t\tsize=\"small\"\n\t\t\tname=\"Name\"\n\t\t\tout-transition>\n\t\t\t<template #actions>\n\t\t\t\t<NcActionCaption name=\"Some action\" />\n\t\t\t</template>\n\t\t\t<div class=\"modal__content\">Hello world</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tmodal: false\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t}\n\t}\n}\n</script>\n<style scoped>\n.modal__content {\n\tmargin: 50px;\n\ttext-align: center;\n}\n</style>\n```\n\n### Modal with slideshow\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"isOpen = true\">Show Modal</NcButton>\n\t\t<NcModal\n\t\t\tv-if=\"isOpen\"\n\t\t\tclose-button-outside\n\t\t\tenable-slideshow\n\t\t\t:has-next=\"page < lastPage\"\n\t\t\t:has-previous=\"page > 0\"\n\t\t\tname=\"Modal with slideshow\"\n\t\t\t@next=\"page++\"\n\t\t\t@previous=\"page--\"\n\t\t\t@close=\"isOpen = false\">\n\t\t\t<div class=\"modal__content\" :style=\"{ background: currentPage.background }\">\n\t\t\t\t<p class=\"model__content-text\">{{ currentPage.text }}</p>\n\t\t\t</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nconst PAGES = [\n\t{ text: 'First page', background: 'linear-gradient(#e66465, #9198e5)' },\n\t{ text: 'Second page', background: 'linear-gradient(0.25turn, #3f87a6, #ebf8e1, #f69d3c)' },\n\t{ text: 'Third page', background: 'lightblue' },\n\t{ text: 'Last page', background: 'lightgrey' },\n]\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tisOpen: false,\n\t\t\tpage: 0,\n\t\t\tlastPage: PAGES.length - 1,\n\t\t}\n\t},\n\tcomputed: {\n\t\tcurrentPage() {\n\t\t\treturn PAGES[this.page]\n\t\t},\n\t}\n}\n</script>\n<style scoped>\n.modal__content {\n\theight: 100%;\n\tmin-height: 30vh;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.model__content-text {\n\tfont-size: 16px;\n\tfont-weight: var(--font-weight-heading, bold);\n}\n</style>\n```\n\n### Usage of popover in modal\n\n* Set container property to .modal-mask to inject popover context of the modal:\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal</NcButton>\n\t\t<NcModal\n\t\t\tv-model:show=\"modal\"\n\t\t\tclass=\"emoji-modal\"\n\t\t\tname=\"Modal with popover\"\n\t\t\tsize=\"small\"\n\t\t\t@close=\"closeModal\">\n\t\t\t<div class=\"emoji-modal__content\">\n\t\t\t\t<NcEmojiPicker container=\".emoji-modal\" @select=\"select\">\n\t\t\t\t\t<NcButton>Select emoji {{ emoji }}</NcButton>\n\t\t\t\t</NcEmojiPicker>\n\t\t\t</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\temoji: '😛',\n\t\t\tmodal: false\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t},\n\t\tselect(emoji) {\n\t\t\tthis.emoji = emoji\n\t\t},\n\t},\n}\n</script>\n<style scoped>\n.emoji-modal__content {\n\tdisplay: flex;\n\tjustify-content: center;\n\tmargin: 20px 0px 100px;\n}\n</style>\n```\n</docs>\n"],"names":["instance","_useModel","_createBlock","_Teleport","_createVNode","_Transition","_withDirectives","_createElementVNode","_mergeProps","$attrs","_unref","_createElementBlock","_normalizeClass","_renderSlot"],"mappings":";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AAQ,MAAA,GAAA,CAAA,MAAA,CAAA;AAAA,wBAAA;;;;oBAMpCN,YAcaC,YAAA;AAAA,sBAdD,MAAK;AAAA,sBAAkB,QAAA;AAAA,oBAAA;uCAClC,MAYW;AAAA,uCAZXD,YAYW,UAAA;AAAA,0BAVT,cAAYM,MAAA,CAAA,EAAC,MAAA;AAAA,0BACd,OAAM;AAAA,0BACN,SAAQ;AAAA,0BACP,SAAO;AAAA,wBAAA;0BACG,cACV,MAGc;AAAA,4BAHdN,YAGc,kBAAA;AAAA,8BAFb,aAAA;AAAA,8BACC,MAAMM,MAAA,eAAA;AAAA,8BACN,MAAM;AAAA,4BAAA;;;;kCATD,QAAA,OAAO;AAAA,wBAAA;;;;;4BA7CT,UAAA,KAAS;AAAA,kBAAA;;;;;sBAlFX,UAAA,KAAS;AAAA,YAAA;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '../assets/NcNoteCard-
|
|
1
|
+
import '../assets/NcNoteCard-DfescGKl.css';
|
|
2
2
|
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createVNode, createElementVNode, toDisplayString, createCommentVNode } from "vue";
|
|
3
3
|
import { k as mdiAlert, l as mdiInformation, n as mdiCheckboxMarkedCircle, o as mdiAlertDecagram } from "./mdi-CpchYUUV.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-
|
|
4
|
+
import { a as isLegacy } from "./legacy-BoqDmOCa.mjs";
|
|
5
|
+
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-g8ubWhoz.mjs";
|
|
6
6
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
7
7
|
const _hoisted_1 = ["role"];
|
|
8
8
|
const _hoisted_2 = {
|
|
@@ -37,7 +37,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
return (_ctx, _cache) => {
|
|
38
38
|
return openBlock(), createElementBlock("div", {
|
|
39
39
|
class: normalizeClass(["notecard", {
|
|
40
|
-
[`notecard--${
|
|
40
|
+
[`notecard--${__props.type}`]: __props.type,
|
|
41
41
|
"notecard--legacy": unref(isLegacy)
|
|
42
42
|
}]),
|
|
43
43
|
role: shouldShowAlert.value ? "alert" : "note"
|
|
@@ -45,22 +45,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
46
46
|
createVNode(unref(NcIconSvgWrapper), {
|
|
47
47
|
path: iconPath.value,
|
|
48
|
-
class: normalizeClass(["notecard__icon", { "notecard__icon--heading":
|
|
48
|
+
class: normalizeClass(["notecard__icon", { "notecard__icon--heading": __props.heading }]),
|
|
49
49
|
inline: ""
|
|
50
50
|
}, null, 8, ["path", "class"])
|
|
51
51
|
], true),
|
|
52
52
|
createElementVNode("div", null, [
|
|
53
|
-
|
|
53
|
+
__props.heading ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(__props.heading), 1)) : createCommentVNode("", true),
|
|
54
54
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
55
|
-
createElementVNode("p", _hoisted_3, toDisplayString(
|
|
55
|
+
createElementVNode("p", _hoisted_3, toDisplayString(__props.text), 1)
|
|
56
56
|
], true)
|
|
57
57
|
])
|
|
58
58
|
], 10, _hoisted_1);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
const NcNoteCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
62
|
+
const NcNoteCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6be9fa31"]]);
|
|
63
63
|
export {
|
|
64
64
|
NcNoteCard as N
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=NcNoteCard-
|
|
66
|
+
//# sourceMappingURL=NcNoteCard-mI7qVZ9j.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcNoteCard-
|
|
1
|
+
{"version":3,"file":"NcNoteCard-mI7qVZ9j.mjs","sources":["../../src/components/NcNoteCard/NcNoteCard.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\nThis component is made to display additional information to the user. It is\navailable in four versions:\n\n- **success**: Display a successful message.<br>\n Should be used to show success of an operation or optional information to help a user be more successful.\n- **info**: Display an informational message.<br>\n Should be used to highlight information that users should take into account.\n- **warning**: Display a warning to the user.<br>\n Should be used for critical content demanding user attention due to potential risks.\n- **error**: Display an error message.<br>\n Should be used for negative potential consequences of an action.\n\n### Usage\n\n```vue\n<template>\n\t<div>\n\t\t<NcNoteCard type=\"warning\" text=\"This is dangerous\" />\n\n\t\t<NcNoteCard type=\"error\"\n\t\t\theading=\"Error\"\n\t\t\ttext=\"The server is not happy and reported the following error\" />\n\n\t\t<NcNoteCard type=\"success\" text=\"You won\" />\n\n\t\t<NcNoteCard type=\"info\" text=\"For your information\" />\n\n\t\t<h4>Custom icon</h4>\n\t\t<NcNoteCard type=\"warning\" text=\"Custom icon usage\">\n\t\t\t<template #icon>\n\t\t\t\t<IconCogOutline :size=\"20\"/>\n\t\t\t</template>\n\t\t</NcNoteCard>\n\n\t\t<h4>Custom content using the default slot</h4>\n\t\t<NcNoteCard type=\"info\">\n\t\t\tPress <kbd>CTRL</kbd>+<kbd>C</kbd>\n\t\t</NcNoteCard>\n\t</div>\n</template>\n\n<script>\n\timport IconCogOutline from 'vue-material-design-icons/CogOutline.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tIconCogOutline,\n\t\t},\n\t}\n</script>\n```\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\n\nimport { mdiAlert, mdiAlertDecagram, mdiCheckboxMarkedCircle, mdiInformation } from '@mdi/js'\nimport { computed } from 'vue'\nimport { isLegacy } from '../../utils/legacy.ts'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/index.ts'\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * Optional text to show as a heading of the note card\n\t */\n\theading?: string\n\n\t/**\n\t * Enforce the `alert` role on the note card.\n\t *\n\t * The alert role should only be used for information that requires the user's immediate attention.\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/alert_role\n\t */\n\tshowAlert?: boolean\n\n\t/**\n\t * The message text of the note card\n\t */\n\ttext?: string\n\n\t/**\n\t * Type or severity of the message\n\t */\n\ttype?: 'success' | 'info' | 'warning' | 'error'\n}>(), {\n\theading: undefined,\n\ttext: undefined,\n\ttype: 'warning',\n})\n\ndefineSlots<{\n\t/** The main content (overwrites the `text` prop) */\n\tdefault?: Slot\n\t/** Manually provided icon */\n\ticon?: Slot\n}>()\n\nconst shouldShowAlert = computed(() => props.showAlert || props.type === 'error')\n\nconst iconPath = computed(() => {\n\tswitch (props.type) {\n\t\tcase 'error':\n\t\t\treturn mdiAlertDecagram\n\t\tcase 'success':\n\t\t\treturn mdiCheckboxMarkedCircle\n\t\tcase 'info':\n\t\t\treturn mdiInformation\n\t\tcase 'warning':\n\t\tdefault:\n\t\t\treturn mdiAlert\n\t}\n})\n</script>\n\n<template>\n\t<div\n\t\tclass=\"notecard\"\n\t\t:class=\"{\n\t\t\t[`notecard--${type}`]: type,\n\t\t\t'notecard--legacy': isLegacy,\n\t\t}\"\n\t\t:role=\"shouldShowAlert ? 'alert' : 'note'\">\n\t\t<slot name=\"icon\">\n\t\t\t<NcIconSvgWrapper\n\t\t\t\t:path=\"iconPath\"\n\t\t\t\tclass=\"notecard__icon\"\n\t\t\t\t:class=\"{ 'notecard__icon--heading': heading }\"\n\t\t\t\tinline />\n\t\t</slot>\n\t\t<div>\n\t\t\t<p v-if=\"heading\" class=\"notecard__heading\">\n\t\t\t\t{{ heading }}\n\t\t\t</p>\n\t\t\t<slot>\n\t\t\t\t<p class=\"notecard__text\">\n\t\t\t\t\t{{ text }}\n\t\t\t\t</p>\n\t\t\t</slot>\n\t\t</div>\n\t</div>\n</template>\n\n<style lang=\"scss\" scoped>\n.notecard {\n\t--note-card-icon-size: 20px;\n\t--note-card-padding: calc(2 * var(--default-grid-baseline));\n\tcolor: var(--color-main-text) !important;\n\tbackground-color: var(--note-background) !important;\n\tborder-inline-start: var(--default-grid-baseline) solid var(--note-theme);\n\tborder-radius: var(--border-radius-small);\n\tmargin: 1rem 0;\n\tpadding: var(--note-card-padding);\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: var(--note-card-padding);\n\n\t&__heading {\n\t\tfont-size: var(--note-card-icon-size); // Same as icon\n\t\tfont-weight: var(--font-weight-heading, 600);\n\t}\n\n\t&__icon {\n\t\tcolor: var(--note-theme);\n\n\t\t&--heading {\n\t\t\tfont-size: var(--note-card-icon-size);\n\t\t\t// Ensure icon is on the same height as the heading\n\t\t\tmargin-block: calc((1lh - 1em) / 2) auto;\n\t\t}\n\t}\n\n\t&--success {\n\t\t--note-background: var(--color-success);\n\t\t--note-theme: var(--color-success-text);\n\t}\n\n\t&--info {\n\t\t--note-background: var(--color-info);\n\t\t--note-theme: var(--color-info-text);\n\t}\n\n\t&--error {\n\t\t--note-background: var(--color-error);\n\t\t--note-theme: var(--color-error-text);\n\t}\n\n\t&--warning {\n\t\t--note-background: var(--color-warning);\n\t\t--note-theme: var(--color-warning-text);\n\t}\n\n\t&--legacy {\n\t\tbackground-color: color-mix(in srgb, var(--note-background), var(--color-main-background) 80%) !important;\n\t\tcolor: var(--color-main-text) !important;\n\t}\n}\n</style>\n"],"names":["_createElementBlock","_unref","_renderSlot","_createVNode","_normalizeClass","_createElementVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmEA,UAAM,QAAQ;AAqCd,UAAM,kBAAkB,SAAS,MAAM,MAAM,aAAa,MAAM,SAAS,OAAO;AAEhF,UAAM,WAAW,SAAS,MAAM;AAC/B,cAAQ,MAAM,MAAA;AAAA,QACb,KAAK;AACJ,iBAAO;AAAA,QACR,KAAK;AACJ,iBAAO;AAAA,QACR,KAAK;AACJ,iBAAO;AAAA,QACR,KAAK;AAAA,QACL;AACC,iBAAO;AAAA,MAAA;AAAA,IAEV,CAAC;;0BAIAA,mBAwBM,OAAA;AAAA,QAvBL,uBAAM,YAAU;AAAA,UACW,CAAA,aAAA,QAAA,IAAI,KAAK,QAAA;AAAA,8BAA6BC,MAAA,QAAA;AAAA,QAAA;QAIhE,MAAM,gBAAA,QAAe,UAAA;AAAA,MAAA;QACtBC,WAMO,yBANP,MAMO;AAAA,UALNC,YAIUF,MAAA,gBAAA,GAAA;AAAA,YAHR,MAAM,SAAA;AAAA,YACP,OAAKG,eAAA,CAAC,kBAAgB,EAAA,2BACe,QAAA,QAAA,CAAO,CAAA;AAAA,YAC5C,QAAA;AAAA,UAAA;;QAEFC,mBASM,OAAA,MAAA;AAAA,UARI,QAAA,wBAATL,mBAEI,KAFJ,YAEIM,gBADA,QAAA,OAAO,GAAA,CAAA;UAEXJ,WAIO,4BAJP,MAIO;AAAA,YAHNG,mBAEI,KAFJ,YAEIC,gBADA,QAAA,IAAI,GAAA,CAAA;AAAA,UAAA;;;;;;;"}
|
|
@@ -5,9 +5,9 @@ import axios from "@nextcloud/axios";
|
|
|
5
5
|
import { getCapabilities } from "@nextcloud/capabilities";
|
|
6
6
|
import { generateOcsUrl } from "@nextcloud/router";
|
|
7
7
|
import debounce from "debounce";
|
|
8
|
-
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-
|
|
9
|
-
import { N as NcInputField } from "./NcInputField-
|
|
10
|
-
import { r as register, n as t29, a as t } from "./_l10n-
|
|
8
|
+
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-g8ubWhoz.mjs";
|
|
9
|
+
import { N as NcInputField } from "./NcInputField-B1bGxYHt.mjs";
|
|
10
|
+
import { r as register, n as t29, a as t } from "./_l10n-CG4CuN3H.mjs";
|
|
11
11
|
import { l as logger } from "./logger-D3RVzcfQ.mjs";
|
|
12
12
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
13
13
|
register(t29);
|
|
@@ -100,13 +100,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
100
100
|
ref: "inputField",
|
|
101
101
|
modelValue: modelValue.value,
|
|
102
102
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
103
|
-
error:
|
|
104
|
-
helperText:
|
|
105
|
-
inputClass: [
|
|
103
|
+
error: __props.error || isValid.value === false,
|
|
104
|
+
helperText: __props.helperText || internalHelpMessage.value,
|
|
105
|
+
inputClass: [__props.inputClass, { "password-field__input--secure-text": !visible.value && __props.asText }],
|
|
106
106
|
minlength: minLengthWithPolicy.value,
|
|
107
|
-
success:
|
|
107
|
+
success: __props.success || isValid.value === true,
|
|
108
108
|
trailingButtonLabel: visible.value ? unref(t)("Hide password") : unref(t)("Show password"),
|
|
109
|
-
type: visible.value ||
|
|
109
|
+
type: visible.value || __props.asText ? "text" : "password",
|
|
110
110
|
onTrailingButtonClick: toggleVisibility
|
|
111
111
|
}), createSlots({
|
|
112
112
|
"trailing-button-icon": withCtx(() => [
|
|
@@ -131,4 +131,4 @@ const NcPasswordField = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "d
|
|
|
131
131
|
export {
|
|
132
132
|
NcPasswordField as N
|
|
133
133
|
};
|
|
134
|
-
//# sourceMappingURL=NcPasswordField-
|
|
134
|
+
//# sourceMappingURL=NcPasswordField-Be5_qcfm.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcPasswordField-C7yuRADA.mjs","sources":["../../src/components/NcPasswordField/NcPasswordField.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### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose password field component.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcPasswordField v-model=\"text1\"\n\t\t\tlabel=\"Old password\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">New password</label>\n\t\t\t<NcPasswordField v-model=\"text2\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\t:success=\"true\"\n\t\t\t\thelper-text=\"Password is secure\" />\n\t\t</div>\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField2\">New password</label>\n\t\t\t<NcPasswordField v-model=\"text3\"\n\t\t\t\tid=\"textField2\"\n\t\t\t\t:error=\"true\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\thelper-text=\"Password is insecure\" />\n\t\t</div>\n\n\t\t<NcPasswordField v-model=\"text4\"\n\t\t\tlabel=\"Validate new password\"\n\t\t\tcheck-password-strength\n\t\t\tplaceholder=\"Min. 12 characters\">\n\t\t\t<template #icon>\n\t\t\t\t<IconLockOutline :size=\"20\" />\n\t\t\t</template>\n\t\t</NcPasswordField>\n\n\t\t<NcPasswordField v-model=\"text5\"\n\t\t\t:disabled=\"true\"\n\t\t\tlabel=\"Disabled\" />\n\n\t\t<NcPasswordField :value.sync=\"text6\"\n\t\t\tlabel=\"Secret token\"\n\t\t\tas-text />\n\t</div>\n</template>\n<script>\nimport IconLockOutline from 'vue-material-design-icons/LockOutline'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: 'FWZxt29XEoTQfnBEa',\n\t\t\ttext3: 'hunter',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t\ttext6: 'secret-token',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tIconLockOutline,\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Writable } from '../../utils/VueTypes.ts'\nimport type { NcInputFieldProps } from '../NcInputField/NcInputField.vue'\n\nimport { mdiEye, mdiEyeOff } from '@mdi/js'\nimport axios from '@nextcloud/axios'\nimport { getCapabilities } from '@nextcloud/capabilities'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport debounce from 'debounce'\nimport { computed, ref, useTemplateRef, watch } from 'vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\nimport NcInputField from '../NcInputField/NcInputField.vue'\nimport { t } from '../../l10n.ts'\nimport { logger } from '../../utils/logger.ts'\n\nconst modelValue = defineModel<string>({ default: '' })\n\n/**\n * The visibility of the password.\n * If this is set to true then the password will not be obfuscated by the browser.\n */\nconst visible = defineModel<boolean>('visible', { default: false })\n\nconst props = withDefaults(defineProps<Omit<NcInputFieldProps, 'trailingButtonLabel' | 'type'> & {\n\t/**\n\t * Check if the user entered a valid password using the password_policy\n\t * app if available.\n\t *\n\t * Warning: this doesn't replace server side checking and will do nothing\n\t * if the password_policy app is disabled.\n\t */\n\tcheckPasswordStrength?: boolean\n\n\t/**\n\t * The minlength property defines the minimum number of characters\n\t * (as UTF-16 code units) the user can enter.\n\t */\n\tminlength?: number\n\n\t/**\n\t * Render as input[type=text] that looks like password field.\n\t * Allows to avoid unwanted password-specific browser behavior,\n\t * such as save or generate password prompt.\n\t * Useful for secret token fields.\n\t * Note: autocomplete=\"off\" is ignored by most browsers.\n\t */\n\tasText?: boolean\n}>(), {\n\tinputClass: '',\n\tminlength: undefined,\n\t// overwrite default\n\tshowTrailingButton: true,\n})\n\nconst emit = defineEmits<{\n\tvalid: []\n\tinvalid: []\n}>()\n\n// public API\ndefineExpose({\n\tfocus,\n\tselect,\n})\n\n// password policy\ninterface PasswordPolicy {\n\t/**\n\t * The URLs to the password_policy app methods\n\t */\n\tapi: {\n\t\t/**\n\t\t * The URL to the password generator\n\t\t */\n\t\tgenerate: string\n\n\t\t/**\n\t\t * The URL to the password validator\n\t\t */\n\t\tvalidate: string\n\t}\n\n\t/**\n\t * Whether to enforce non common passwords\n\t */\n\tenforceNonCommonPassword: boolean\n\n\t/**\n\t * Whether to enforce numeric characters\n\t */\n\tenforceNumericCharacters: boolean\n\n\t/**\n\t * Whether to enforce special characters\n\t */\n\tenforceSpecialCharacters: boolean\n\n\t/**\n\t * Whether to enforce upper and lower case\n\t */\n\tenforceUpperLowerCase: boolean\n\n\t/**\n\t * The minimum length of the password\n\t */\n\tminLength: number\n}\n\nconst { password_policy: passwordPolicy } = getCapabilities() as { password_policy?: PasswordPolicy }\n\n// internal state\nconst inputFieldInstance = useTemplateRef('inputField')\n\nconst internalHelpMessage = ref('')\nconst isValid = ref<boolean>()\n\nconst propsToForward = computed<Partial<NcInputFieldProps>>(() => {\n\tconst all = { ...props } as Partial<Writable<typeof props>>\n\t// our props\n\tdelete all.checkPasswordStrength\n\tdelete all.minlength\n\tdelete all.asText\n\t// other props already set in template\n\tdelete all.error\n\tdelete all.helperText\n\tdelete all.inputClass\n\tdelete all.success\n\n\treturn all satisfies Partial<NcInputFieldProps>\n})\n\nconst minLengthWithPolicy = computed(() => {\n\treturn props.minlength\n\t\t?? (props.checkPasswordStrength ? passwordPolicy?.minLength : undefined)\n\t\t?? undefined\n})\n\nwatch(modelValue, () => {\n\t// Reset internal validation state on value change, before debounced checkPassword() is called\n\tisValid.value = undefined\n\tinternalHelpMessage.value = ''\n})\nwatch(modelValue, debounce(checkPassword, 500))\n\n/**\n * Validate the entered password.\n * If available this method will use the password-policy app API to validate the password.\n */\nasync function checkPassword() {\n\tif (!props.checkPasswordStrength || !modelValue.value) {\n\t\treturn\n\t}\n\n\ttry {\n\t\tconst { data } = await axios.post(generateOcsUrl('apps/password_policy/api/v1/validate'), { password: modelValue.value })\n\t\tisValid.value = data.ocs.data.passed\n\t\tif (data.ocs.data.passed) {\n\t\t\tinternalHelpMessage.value = t('Password is secure')\n\t\t\t/**\n\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t * password entered is valid.\n\t\t\t */\n\t\t\temit('valid')\n\t\t\treturn\n\t\t}\n\n\t\tinternalHelpMessage.value = data.ocs.data.reason\n\t\t/**\n\t\t * Triggers when the internal password_policy detect that the\n\t\t * password entered is invalid.\n\t\t */\n\t\temit('invalid')\n\t} catch (error) {\n\t\tlogger.error('Password policy returned an error', { error })\n\t}\n}\n\n/**\n * Toggle the visibility of the password\n */\nfunction toggleVisibility() {\n\tvisible.value = !visible.value\n}\n\n/**\n * Focus the input element\n *\n * @param options - Focus options\n * @public\n */\nfunction focus(options?: FocusOptions) {\n\tinputFieldInstance.value!.focus(options)\n}\n\n/**\n * Select all the text in the input\n *\n * @public\n */\nfunction select() {\n\tinputFieldInstance.value!.select()\n}\n</script>\n\n<template>\n\t<NcInputField\n\t\tv-bind=\"propsToForward\"\n\t\tref=\"inputField\"\n\t\tv-model=\"modelValue\"\n\t\t:error=\"error || isValid === false\"\n\t\t:helperText=\"helperText || internalHelpMessage\"\n\t\t:inputClass=\"[inputClass, { 'password-field__input--secure-text': !visible && asText }]\"\n\t\t:minlength=\"minLengthWithPolicy\"\n\t\t:success=\"success || isValid === true\"\n\t\t:trailingButtonLabel=\"visible ? t('Hide password') : t('Show password')\"\n\t\t:type=\"visible || asText ? 'text' : 'password'\"\n\t\t@trailingButtonClick=\"toggleVisibility\">\n\t\t<template v-if=\"!!$slots.icon\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\" />\n\t\t</template>\n\t\t<template #trailing-button-icon>\n\t\t\t<NcIconSvgWrapper :path=\"visible ? mdiEyeOff : mdiEye\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<style lang=\"scss\" scoped>\n:deep(.password-field__input--secure-text) {\n\t// Emulate password field look\n\t// This is not a part of the standard but well supported\n\t-webkit-text-security: disc;\n}\n</style>\n"],"names":["_useModel","_createBlock","_mergeProps","error","helperText","inputClass","asText","success","_unref","_createVNode","$slots","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,UAAM,aAAaA,SAAmB,SAAA,YAAgB;AAMtD,UAAM,UAAUA,SAAoB,SAAC,SAA6B;AAElE,UAAM,QAAQ;AA+Bd,UAAM,OAAO;AAMb,aAAa;AAAA,MACZ;AAAA,MACA;AAAA,IAAA,CACA;AA6CD,UAAM,EAAE,iBAAiB,eAAA,IAAmB,gBAAA;AAG5C,UAAM,qBAAqB,eAAe,YAAY;AAEtD,UAAM,sBAAsB,IAAI,EAAE;AAClC,UAAM,UAAU,IAAA;AAEhB,UAAM,iBAAiB,SAAqC,MAAM;AACjE,YAAM,MAAM,EAAE,GAAG,MAAA;AAEjB,aAAO,IAAI;AACX,aAAO,IAAI;AACX,aAAO,IAAI;AAEX,aAAO,IAAI;AACX,aAAO,IAAI;AACX,aAAO,IAAI;AACX,aAAO,IAAI;AAEX,aAAO;AAAA,IACR,CAAC;AAED,UAAM,sBAAsB,SAAS,MAAM;AAC1C,aAAO,MAAM,cACR,MAAM,wBAAwB,gBAAgB,YAAY,WAC3D;AAAA,IACL,CAAC;AAED,UAAM,YAAY,MAAM;AAEvB,cAAQ,QAAQ;AAChB,0BAAoB,QAAQ;AAAA,IAC7B,CAAC;AACD,UAAM,YAAY,SAAS,eAAe,GAAG,CAAC;AAM9C,mBAAe,gBAAgB;AAC9B,UAAI,CAAC,MAAM,yBAAyB,CAAC,WAAW,OAAO;AACtD;AAAA,MACD;AAEA,UAAI;AACH,cAAM,EAAE,KAAA,IAAS,MAAM,MAAM,KAAK,eAAe,sCAAsC,GAAG,EAAE,UAAU,WAAW,OAAO;AACxH,gBAAQ,QAAQ,KAAK,IAAI,KAAK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;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcPasswordField-Be5_qcfm.mjs","sources":["../../src/components/NcPasswordField/NcPasswordField.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### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose password field component.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcPasswordField v-model=\"text1\"\n\t\t\tlabel=\"Old password\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">New password</label>\n\t\t\t<NcPasswordField v-model=\"text2\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\t:success=\"true\"\n\t\t\t\thelper-text=\"Password is secure\" />\n\t\t</div>\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField2\">New password</label>\n\t\t\t<NcPasswordField v-model=\"text3\"\n\t\t\t\tid=\"textField2\"\n\t\t\t\t:error=\"true\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\thelper-text=\"Password is insecure\" />\n\t\t</div>\n\n\t\t<NcPasswordField v-model=\"text4\"\n\t\t\tlabel=\"Validate new password\"\n\t\t\tcheck-password-strength\n\t\t\tplaceholder=\"Min. 12 characters\">\n\t\t\t<template #icon>\n\t\t\t\t<IconLockOutline :size=\"20\" />\n\t\t\t</template>\n\t\t</NcPasswordField>\n\n\t\t<NcPasswordField v-model=\"text5\"\n\t\t\t:disabled=\"true\"\n\t\t\tlabel=\"Disabled\" />\n\n\t\t<NcPasswordField :value.sync=\"text6\"\n\t\t\tlabel=\"Secret token\"\n\t\t\tas-text />\n\t</div>\n</template>\n<script>\nimport IconLockOutline from 'vue-material-design-icons/LockOutline'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: 'FWZxt29XEoTQfnBEa',\n\t\t\ttext3: 'hunter',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t\ttext6: 'secret-token',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tIconLockOutline,\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Writable } from '../../utils/VueTypes.ts'\nimport type { NcInputFieldProps } from '../NcInputField/NcInputField.vue'\n\nimport { mdiEye, mdiEyeOff } from '@mdi/js'\nimport axios from '@nextcloud/axios'\nimport { getCapabilities } from '@nextcloud/capabilities'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport debounce from 'debounce'\nimport { computed, ref, useTemplateRef, watch } from 'vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\nimport NcInputField from '../NcInputField/NcInputField.vue'\nimport { t } from '../../l10n.ts'\nimport { logger } from '../../utils/logger.ts'\n\nconst modelValue = defineModel<string>({ default: '' })\n\n/**\n * The visibility of the password.\n * If this is set to true then the password will not be obfuscated by the browser.\n */\nconst visible = defineModel<boolean>('visible', { default: false })\n\nconst props = withDefaults(defineProps<Omit<NcInputFieldProps, 'trailingButtonLabel' | 'type'> & {\n\t/**\n\t * Check if the user entered a valid password using the password_policy\n\t * app if available.\n\t *\n\t * Warning: this doesn't replace server side checking and will do nothing\n\t * if the password_policy app is disabled.\n\t */\n\tcheckPasswordStrength?: boolean\n\n\t/**\n\t * The minlength property defines the minimum number of characters\n\t * (as UTF-16 code units) the user can enter.\n\t */\n\tminlength?: number\n\n\t/**\n\t * Render as input[type=text] that looks like password field.\n\t * Allows to avoid unwanted password-specific browser behavior,\n\t * such as save or generate password prompt.\n\t * Useful for secret token fields.\n\t * Note: autocomplete=\"off\" is ignored by most browsers.\n\t */\n\tasText?: boolean\n}>(), {\n\tinputClass: '',\n\tminlength: undefined,\n\t// overwrite default\n\tshowTrailingButton: true,\n})\n\nconst emit = defineEmits<{\n\tvalid: []\n\tinvalid: []\n}>()\n\n// public API\ndefineExpose({\n\tfocus,\n\tselect,\n})\n\n// password policy\ninterface PasswordPolicy {\n\t/**\n\t * The URLs to the password_policy app methods\n\t */\n\tapi: {\n\t\t/**\n\t\t * The URL to the password generator\n\t\t */\n\t\tgenerate: string\n\n\t\t/**\n\t\t * The URL to the password validator\n\t\t */\n\t\tvalidate: string\n\t}\n\n\t/**\n\t * Whether to enforce non common passwords\n\t */\n\tenforceNonCommonPassword: boolean\n\n\t/**\n\t * Whether to enforce numeric characters\n\t */\n\tenforceNumericCharacters: boolean\n\n\t/**\n\t * Whether to enforce special characters\n\t */\n\tenforceSpecialCharacters: boolean\n\n\t/**\n\t * Whether to enforce upper and lower case\n\t */\n\tenforceUpperLowerCase: boolean\n\n\t/**\n\t * The minimum length of the password\n\t */\n\tminLength: number\n}\n\nconst { password_policy: passwordPolicy } = getCapabilities() as { password_policy?: PasswordPolicy }\n\n// internal state\nconst inputFieldInstance = useTemplateRef('inputField')\n\nconst internalHelpMessage = ref('')\nconst isValid = ref<boolean>()\n\nconst propsToForward = computed<Partial<NcInputFieldProps>>(() => {\n\tconst all = { ...props } as Partial<Writable<typeof props>>\n\t// our props\n\tdelete all.checkPasswordStrength\n\tdelete all.minlength\n\tdelete all.asText\n\t// other props already set in template\n\tdelete all.error\n\tdelete all.helperText\n\tdelete all.inputClass\n\tdelete all.success\n\n\treturn all satisfies Partial<NcInputFieldProps>\n})\n\nconst minLengthWithPolicy = computed(() => {\n\treturn props.minlength\n\t\t?? (props.checkPasswordStrength ? passwordPolicy?.minLength : undefined)\n\t\t?? undefined\n})\n\nwatch(modelValue, () => {\n\t// Reset internal validation state on value change, before debounced checkPassword() is called\n\tisValid.value = undefined\n\tinternalHelpMessage.value = ''\n})\nwatch(modelValue, debounce(checkPassword, 500))\n\n/**\n * Validate the entered password.\n * If available this method will use the password-policy app API to validate the password.\n */\nasync function checkPassword() {\n\tif (!props.checkPasswordStrength || !modelValue.value) {\n\t\treturn\n\t}\n\n\ttry {\n\t\tconst { data } = await axios.post(generateOcsUrl('apps/password_policy/api/v1/validate'), { password: modelValue.value })\n\t\tisValid.value = data.ocs.data.passed\n\t\tif (data.ocs.data.passed) {\n\t\t\tinternalHelpMessage.value = t('Password is secure')\n\t\t\t/**\n\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t * password entered is valid.\n\t\t\t */\n\t\t\temit('valid')\n\t\t\treturn\n\t\t}\n\n\t\tinternalHelpMessage.value = data.ocs.data.reason\n\t\t/**\n\t\t * Triggers when the internal password_policy detect that the\n\t\t * password entered is invalid.\n\t\t */\n\t\temit('invalid')\n\t} catch (error) {\n\t\tlogger.error('Password policy returned an error', { error })\n\t}\n}\n\n/**\n * Toggle the visibility of the password\n */\nfunction toggleVisibility() {\n\tvisible.value = !visible.value\n}\n\n/**\n * Focus the input element\n *\n * @param options - Focus options\n * @public\n */\nfunction focus(options?: FocusOptions) {\n\tinputFieldInstance.value!.focus(options)\n}\n\n/**\n * Select all the text in the input\n *\n * @public\n */\nfunction select() {\n\tinputFieldInstance.value!.select()\n}\n</script>\n\n<template>\n\t<NcInputField\n\t\tv-bind=\"propsToForward\"\n\t\tref=\"inputField\"\n\t\tv-model=\"modelValue\"\n\t\t:error=\"error || isValid === false\"\n\t\t:helperText=\"helperText || internalHelpMessage\"\n\t\t:inputClass=\"[inputClass, { 'password-field__input--secure-text': !visible && asText }]\"\n\t\t:minlength=\"minLengthWithPolicy\"\n\t\t:success=\"success || isValid === true\"\n\t\t:trailingButtonLabel=\"visible ? t('Hide password') : t('Show password')\"\n\t\t:type=\"visible || asText ? 'text' : 'password'\"\n\t\t@trailingButtonClick=\"toggleVisibility\">\n\t\t<template v-if=\"!!$slots.icon\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\" />\n\t\t</template>\n\t\t<template #trailing-button-icon>\n\t\t\t<NcIconSvgWrapper :path=\"visible ? mdiEyeOff : mdiEye\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<style lang=\"scss\" scoped>\n:deep(.password-field__input--secure-text) {\n\t// Emulate password field look\n\t// This is not a part of the standard but well supported\n\t-webkit-text-security: disc;\n}\n</style>\n"],"names":["_useModel","_createBlock","_mergeProps","_unref","_createVNode","$slots","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,UAAM,aAAaA,SAAmB,SAAA,YAAgB;AAMtD,UAAM,UAAUA,SAAoB,SAAC,SAA6B;AAElE,UAAM,QAAQ;AA+Bd,UAAM,OAAO;AAMb,aAAa;AAAA,MACZ;AAAA,MACA;AAAA,IAAA,CACA;AA6CD,UAAM,EAAE,iBAAiB,eAAA,IAAmB,gBAAA;AAG5C,UAAM,qBAAqB,eAAe,YAAY;AAEtD,UAAM,sBAAsB,IAAI,EAAE;AAClC,UAAM,UAAU,IAAA;AAEhB,UAAM,iBAAiB,SAAqC,MAAM;AACjE,YAAM,MAAM,EAAE,GAAG,MAAA;AAEjB,aAAO,IAAI;AACX,aAAO,IAAI;AACX,aAAO,IAAI;AAEX,aAAO,IAAI;AACX,aAAO,IAAI;AACX,aAAO,IAAI;AACX,aAAO,IAAI;AAEX,aAAO;AAAA,IACR,CAAC;AAED,UAAM,sBAAsB,SAAS,MAAM;AAC1C,aAAO,MAAM,cACR,MAAM,wBAAwB,gBAAgB,YAAY,WAC3D;AAAA,IACL,CAAC;AAED,UAAM,YAAY,MAAM;AAEvB,cAAQ,QAAQ;AAChB,0BAAoB,QAAQ;AAAA,IAC7B,CAAC;AACD,UAAM,YAAY,SAAS,eAAe,GAAG,C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kBAAA;AAAA,YAAtC,MAAM,QAAA,QAAUD,MAAA,SAAA,IAAYA,MAAA,MAAA;AAAA,UAAA;;;;QAL9BE,CAAAA,CAAAA,KAAAA,OAAO;gBAAO;AAAA,sBAE/B,MAAoB;AAAA,YAApBC,WAAoB,KAAA,QAAA,QAAA,CAAA,GAAA,QAAA,IAAA;AAAA,UAAA;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../assets/NcProgressBar-
|
|
1
|
+
import '../assets/NcProgressBar-B6wveIA1.css';
|
|
2
2
|
import { defineComponent, useCssVars, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode } from "vue";
|
|
3
3
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
4
4
|
const _hoisted_1 = ["aria-valuenow"];
|
|
@@ -29,8 +29,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
},
|
|
30
30
|
setup(__props) {
|
|
31
31
|
useCssVars((_ctx) => ({
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"v3a86fec2": _ctx.color,
|
|
33
|
+
"v57442460": heightPx.value
|
|
34
34
|
}));
|
|
35
35
|
const props = __props;
|
|
36
36
|
const normalizedProgress = computed(() => Math.max(0, Math.min(100, props.value)) / 100);
|
|
@@ -56,11 +56,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
56
56
|
const circleRadius = computed(() => height.value / 2 - strokeWidth.value);
|
|
57
57
|
const circumference = computed(() => circleRadius.value * 2 * Math.PI);
|
|
58
58
|
return (_ctx, _cache) => {
|
|
59
|
-
return
|
|
59
|
+
return __props.type === "circular" ? (openBlock(), createElementBlock("span", {
|
|
60
60
|
key: 0,
|
|
61
61
|
role: "progressbar",
|
|
62
|
-
"aria-valuenow":
|
|
63
|
-
class: normalizeClass([{ "progress-bar--error":
|
|
62
|
+
"aria-valuenow": __props.value,
|
|
63
|
+
class: normalizeClass([{ "progress-bar--error": __props.error }, "progress-bar progress-bar--circular"])
|
|
64
64
|
}, [
|
|
65
65
|
(openBlock(), createElementBlock("svg", {
|
|
66
66
|
height: height.value,
|
|
@@ -89,11 +89,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
89
|
], 8, _hoisted_2))
|
|
90
90
|
], 10, _hoisted_1)) : (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
91
91
|
createElementVNode("progress", {
|
|
92
|
-
class: normalizeClass(["progress-bar progress-bar--linear vue", { "progress-bar--error":
|
|
93
|
-
value:
|
|
92
|
+
class: normalizeClass(["progress-bar progress-bar--linear vue", { "progress-bar--error": __props.error }]),
|
|
93
|
+
value: __props.value,
|
|
94
94
|
max: "100"
|
|
95
95
|
}, null, 10, _hoisted_6),
|
|
96
|
-
|
|
96
|
+
__props.showValue ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(__props.value) + "%", 1)) : createCommentVNode("", true)
|
|
97
97
|
]));
|
|
98
98
|
};
|
|
99
99
|
}
|
|
@@ -102,4 +102,4 @@ const NcProgressBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "dat
|
|
|
102
102
|
export {
|
|
103
103
|
NcProgressBar as N
|
|
104
104
|
};
|
|
105
|
-
//# sourceMappingURL=NcProgressBar-
|
|
105
|
+
//# sourceMappingURL=NcProgressBar-C-ane-Ni.mjs.map
|