@nextcloud/vue 9.3.1 → 9.3.2
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 +12 -0
- package/README.md +44 -44
- package/dist/assets/{NcCheckboxRadioSwitch-C_70VMQr.css → NcCheckboxRadioSwitch-DpYt0YbL.css} +13 -12
- package/dist/assets/{NcFormBoxSwitch-BmyNQCbA.css → NcFormBoxSwitch-DScgbxtv.css} +2 -8
- package/dist/assets/NcIconToggleSwitch-C29S_5Rp.css +30 -0
- package/dist/assets/{NcModal-DLWvQ8EA.css → NcModal-Du-f0B7Y.css} +61 -61
- package/dist/chunks/{NcActionButton-pKOSrlGE.mjs → NcActionButton-BHXE4UKQ.mjs} +4 -4
- package/dist/chunks/{NcActionButton-pKOSrlGE.mjs.map → NcActionButton-BHXE4UKQ.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-D1cYCNRq.mjs → NcActionButtonGroup-B2MGnwK_.mjs} +3 -3
- package/dist/chunks/{NcActionButtonGroup-D1cYCNRq.mjs.map → NcActionButtonGroup-B2MGnwK_.mjs.map} +1 -1
- package/dist/chunks/{NcActionCaption-Fumfjzxj.mjs → NcActionCaption-Cgd3J8jw.mjs} +2 -2
- package/dist/chunks/{NcActionCaption-Fumfjzxj.mjs.map → NcActionCaption-Cgd3J8jw.mjs.map} +1 -1
- package/dist/chunks/{NcActionCheckbox-CwrO3g3I.mjs → NcActionCheckbox-BTHrh-Mu.mjs} +2 -2
- package/dist/chunks/{NcActionCheckbox-CwrO3g3I.mjs.map → NcActionCheckbox-BTHrh-Mu.mjs.map} +1 -1
- package/dist/chunks/{NcActionInput-uL5aa-A2.mjs → NcActionInput-D1uLWx4N.mjs} +5 -5
- package/dist/chunks/{NcActionInput-uL5aa-A2.mjs.map → NcActionInput-D1uLWx4N.mjs.map} +1 -1
- package/dist/chunks/{NcActionLink-vEvKSV4N.mjs → NcActionLink-Cd69py4e.mjs} +3 -3
- package/dist/chunks/{NcActionLink-vEvKSV4N.mjs.map → NcActionLink-Cd69py4e.mjs.map} +1 -1
- package/dist/chunks/{NcActionRadio-ByCpOD0q.mjs → NcActionRadio-BM24rDbc.mjs} +2 -2
- package/dist/chunks/{NcActionRadio-ByCpOD0q.mjs.map → NcActionRadio-BM24rDbc.mjs.map} +1 -1
- package/dist/chunks/{NcActionRouter-oT-YU_jf.mjs → NcActionRouter-DtxPh20B.mjs} +3 -3
- package/dist/chunks/{NcActionRouter-oT-YU_jf.mjs.map → NcActionRouter-DtxPh20B.mjs.map} +1 -1
- package/dist/chunks/{NcActionText-uKvLcEY6.mjs → NcActionText-Bd1fgVqA.mjs} +3 -3
- package/dist/chunks/{NcActionText-uKvLcEY6.mjs.map → NcActionText-Bd1fgVqA.mjs.map} +1 -1
- package/dist/chunks/{NcActionTextEditable-CoYA6jeC.mjs → NcActionTextEditable-DAMWWXnR.mjs} +3 -3
- package/dist/chunks/{NcActionTextEditable-CoYA6jeC.mjs.map → NcActionTextEditable-DAMWWXnR.mjs.map} +1 -1
- package/dist/chunks/{NcActions-DWmvh7-Y.mjs → NcActions-4R7icatI.mjs} +4 -4
- package/dist/chunks/{NcActions-DWmvh7-Y.mjs.map → NcActions-4R7icatI.mjs.map} +1 -1
- package/dist/chunks/{NcAppContent-CTpYDkuT.mjs → NcAppContent-DFbY2ERd.mjs} +5 -5
- package/dist/chunks/{NcAppContent-CTpYDkuT.mjs.map → NcAppContent-DFbY2ERd.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-NSjIVdnb.mjs → NcAppNavigation-CjnufbC2.mjs} +6 -6
- package/dist/chunks/{NcAppNavigation-NSjIVdnb.mjs.map → NcAppNavigation-CjnufbC2.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-D4yUe1MX.mjs → NcAppNavigationCaption-DiLoiMN5.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationCaption-D4yUe1MX.mjs.map → NcAppNavigationCaption-DiLoiMN5.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-hKUS0nZj.mjs → NcAppNavigationItem-B307vBI9.mjs} +6 -6
- package/dist/chunks/{NcAppNavigationItem-hKUS0nZj.mjs.map → NcAppNavigationItem-B307vBI9.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNew-CuwqNksa.mjs → NcAppNavigationNew-WS0F9mau.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationNew-CuwqNksa.mjs.map → NcAppNavigationNew-WS0F9mau.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-IzXE-EEq.mjs → NcAppNavigationNewItem-DYH3Gimz.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationNewItem-IzXE-EEq.mjs.map → NcAppNavigationNewItem-DYH3Gimz.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-DCgwKEm9.mjs → NcAppNavigationSearch-Bi367hd4.mjs} +4 -4
- package/dist/chunks/{NcAppNavigationSearch-DCgwKEm9.mjs.map → NcAppNavigationSearch-Bi367hd4.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-T04pqKfn.mjs → NcAppNavigationSettings-CaTjgcVj.mjs} +5 -5
- package/dist/chunks/{NcAppNavigationSettings-T04pqKfn.mjs.map → NcAppNavigationSettings-CaTjgcVj.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-BCVofwA8.mjs → NcAppSettingsDialog-NlVP7Fo7.mjs} +5 -5
- package/dist/chunks/{NcAppSettingsDialog-BCVofwA8.mjs.map → NcAppSettingsDialog-NlVP7Fo7.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsSection-B9R7enkC.mjs → NcAppSettingsSection-B2pFK0UK.mjs} +2 -2
- package/dist/chunks/{NcAppSettingsSection-B9R7enkC.mjs.map → NcAppSettingsSection-B2pFK0UK.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsShortcutsSection-QPGGYtbC.mjs → NcAppSettingsShortcutsSection-DDmDMMsF.mjs} +4 -4
- package/dist/chunks/{NcAppSettingsShortcutsSection-QPGGYtbC.mjs.map → NcAppSettingsShortcutsSection-DDmDMMsF.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-BvBvQsXb.mjs → NcAppSidebar-as8lzUZp.mjs} +5 -5
- package/dist/chunks/{NcAppSidebar-BvBvQsXb.mjs.map → NcAppSidebar-as8lzUZp.mjs.map} +1 -1
- package/dist/chunks/{NcAssistantButton-CjpLsI1X.mjs → NcAssistantButton-DqXCpiMp.mjs} +4 -4
- package/dist/chunks/{NcAssistantButton-CjpLsI1X.mjs.map → NcAssistantButton-DqXCpiMp.mjs.map} +1 -1
- package/dist/chunks/{NcAssistantIcon-BMDc4udc.mjs → NcAssistantIcon-PMYKxGuH.mjs} +2 -2
- package/dist/chunks/{NcAssistantIcon-BMDc4udc.mjs.map → NcAssistantIcon-PMYKxGuH.mjs.map} +1 -1
- package/dist/chunks/{NcAvatar-DmUGApWA.mjs → NcAvatar-S8EJR2BK.mjs} +9 -9
- package/dist/chunks/{NcAvatar-DmUGApWA.mjs.map → NcAvatar-S8EJR2BK.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-Bwkn3eve.mjs → NcBreadcrumb-ChYVw5CP.mjs} +3 -3
- package/dist/chunks/{NcBreadcrumb-Bwkn3eve.mjs.map → NcBreadcrumb-ChYVw5CP.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-PN5_hHQn.mjs → NcBreadcrumbs-DHS31Ax7.mjs} +6 -6
- package/dist/chunks/{NcBreadcrumbs-PN5_hHQn.mjs.map → NcBreadcrumbs-DHS31Ax7.mjs.map} +1 -1
- package/dist/chunks/{NcButton-Dc8V4Urj.mjs → NcButton-CzpKEx4V.mjs} +2 -2
- package/dist/chunks/{NcButton-Dc8V4Urj.mjs.map → NcButton-CzpKEx4V.mjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-BCSKF7Tk.mjs → NcCheckboxRadioSwitch-DisCqPZK.mjs} +38 -119
- package/dist/chunks/NcCheckboxRadioSwitch-DisCqPZK.mjs.map +1 -0
- package/dist/chunks/{NcChip-D8tGFzRl.mjs → NcChip-QHPd3nMF.mjs} +6 -6
- package/dist/chunks/{NcChip-D8tGFzRl.mjs.map → NcChip-QHPd3nMF.mjs.map} +1 -1
- package/dist/chunks/{NcCollectionList-C-Zxsdgw.mjs → NcCollectionList-ByFl0-ca.mjs} +6 -6
- package/dist/chunks/{NcCollectionList-C-Zxsdgw.mjs.map → NcCollectionList-ByFl0-ca.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-Kc0JqRtp.mjs → NcColorPicker-DpSDaGrh.mjs} +6 -6
- package/dist/chunks/{NcColorPicker-Kc0JqRtp.mjs.map → NcColorPicker-DpSDaGrh.mjs.map} +1 -1
- package/dist/chunks/{NcContent-BR_nMwKN.mjs → NcContent-BrRHLO19.mjs} +5 -5
- package/dist/chunks/{NcContent-BR_nMwKN.mjs.map → NcContent-BrRHLO19.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-Bz1t6sj0.mjs → NcDashboardWidget-CIUrPOLo.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidget-Bz1t6sj0.mjs.map → NcDashboardWidget-CIUrPOLo.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-C_xl9X2u.mjs → NcDashboardWidgetItem-DdYM1QYk.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-C_xl9X2u.mjs.map → NcDashboardWidgetItem-DdYM1QYk.mjs.map} +1 -1
- package/dist/chunks/{NcDateTimePicker-DTf51PD8.mjs → NcDateTimePicker-DtQaoKbG.mjs} +6 -6
- package/dist/chunks/{NcDateTimePicker-DTf51PD8.mjs.map → NcDateTimePicker-DtQaoKbG.mjs.map} +1 -1
- package/dist/chunks/{NcDateTimePickerNative-DXF3-uR3.mjs → NcDateTimePickerNative-Dr8_mGlQ.mjs} +3 -3
- package/dist/chunks/{NcDateTimePickerNative-DXF3-uR3.mjs.map → NcDateTimePickerNative-Dr8_mGlQ.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-CM7SCS7Z.mjs → NcDialog-BTmnYNeo.mjs} +3 -3
- package/dist/chunks/{NcDialog-CM7SCS7Z.mjs.map → NcDialog-BTmnYNeo.mjs.map} +1 -1
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-BBumVVme.mjs → NcDialogButton.vue_vue_type_script_setup_true_lang-CYpktNKA.mjs} +4 -4
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-BBumVVme.mjs.map → NcDialogButton.vue_vue_type_script_setup_true_lang-CYpktNKA.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-pM4Pg2yq.mjs → NcEmojiPicker-U5k_zceS.mjs} +6 -6
- package/dist/chunks/{NcEmojiPicker-pM4Pg2yq.mjs.map → NcEmojiPicker-U5k_zceS.mjs.map} +1 -1
- package/dist/chunks/{NcFormBox-K2tCRm3B.mjs → NcFormBox-CkgY7Tif.mjs} +2 -2
- package/dist/chunks/{NcFormBox-K2tCRm3B.mjs.map → NcFormBox-CkgY7Tif.mjs.map} +1 -1
- package/dist/chunks/{NcFormBoxButton-7jokSLLb.mjs → NcFormBoxButton-Bptd324P.mjs} +3 -3
- package/dist/chunks/{NcFormBoxButton-7jokSLLb.mjs.map → NcFormBoxButton-Bptd324P.mjs.map} +1 -1
- package/dist/chunks/{NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-B7dsN2G5.mjs → NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-DhnfC18v.mjs} +3 -3
- package/dist/chunks/{NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-B7dsN2G5.mjs.map → NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-DhnfC18v.mjs.map} +1 -1
- package/dist/chunks/{NcFormBoxItem-BBP76Mkf.mjs → NcFormBoxItem-vnU0KmUL.mjs} +2 -2
- package/dist/chunks/{NcFormBoxItem-BBP76Mkf.mjs.map → NcFormBoxItem-vnU0KmUL.mjs.map} +1 -1
- package/dist/chunks/{NcFormBoxSwitch-UJwYMQPm.mjs → NcFormBoxSwitch-DGcRJH9Q.mjs} +10 -15
- package/dist/chunks/NcFormBoxSwitch-DGcRJH9Q.mjs.map +1 -0
- package/dist/chunks/{NcHeaderButton-CA17OV7l.mjs → NcHeaderButton-CIb5SvFk.mjs} +2 -2
- package/dist/chunks/{NcHeaderButton-CA17OV7l.mjs.map → NcHeaderButton-CIb5SvFk.mjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-CdlSBOyC.mjs → NcHeaderMenu-CeJZT5-m.mjs} +2 -2
- package/dist/chunks/{NcHeaderMenu-CdlSBOyC.mjs.map → NcHeaderMenu-CeJZT5-m.mjs.map} +1 -1
- package/dist/chunks/{NcHotkey-KGHPzHBJ.mjs → NcHotkey-BMbdzaIs.mjs} +2 -2
- package/dist/chunks/{NcHotkey-KGHPzHBJ.mjs.map → NcHotkey-BMbdzaIs.mjs.map} +1 -1
- package/dist/chunks/{NcHotkeyList-BBE5BqwB.mjs → NcHotkeyList-67NnF26Y.mjs} +3 -3
- package/dist/chunks/{NcHotkeyList-BBE5BqwB.mjs.map → NcHotkeyList-67NnF26Y.mjs.map} +1 -1
- package/dist/chunks/NcIconToggleSwitch-DNEYngCw.mjs +50 -0
- package/dist/chunks/NcIconToggleSwitch-DNEYngCw.mjs.map +1 -0
- package/dist/chunks/{NcInputConfirmCancel-CSO9hp4z.mjs → NcInputConfirmCancel-DjMO3Xyv.mjs} +3 -3
- package/dist/chunks/{NcInputConfirmCancel-CSO9hp4z.mjs.map → NcInputConfirmCancel-DjMO3Xyv.mjs.map} +1 -1
- package/dist/chunks/{NcInputField-Bwsh2aHY.mjs → NcInputField-D7Nv5QhT.mjs} +3 -3
- package/dist/chunks/{NcInputField-Bwsh2aHY.mjs.map → NcInputField-D7Nv5QhT.mjs.map} +1 -1
- package/dist/chunks/{NcKbd-D3YSTteg.mjs → NcKbd-CZdynD1d.mjs} +3 -3
- package/dist/chunks/{NcKbd-D3YSTteg.mjs.map → NcKbd-CZdynD1d.mjs.map} +1 -1
- package/dist/chunks/{NcListItem-BHmdTInS.mjs → NcListItem-Bx93C7tP.mjs} +2 -2
- package/dist/chunks/{NcListItem-BHmdTInS.mjs.map → NcListItem-Bx93C7tP.mjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-8fWhyS_R.mjs → NcListItemIcon-IJLXY-te.mjs} +2 -2
- package/dist/chunks/{NcListItemIcon-8fWhyS_R.mjs.map → NcListItemIcon-IJLXY-te.mjs.map} +1 -1
- package/dist/chunks/{NcModal-MC_HktJd.mjs → NcModal-DSCYMxfe.mjs} +9 -9
- package/dist/chunks/{NcModal-MC_HktJd.mjs.map → NcModal-DSCYMxfe.mjs.map} +1 -1
- package/dist/chunks/{NcNoteCard-CVhtNL04.mjs → NcNoteCard-BUg07N13.mjs} +2 -2
- package/dist/chunks/{NcNoteCard-CVhtNL04.mjs.map → NcNoteCard-BUg07N13.mjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-djttkA5Q.mjs → NcPasswordField-CTuWpUWd.mjs} +5 -5
- package/dist/chunks/{NcPasswordField-djttkA5Q.mjs.map → NcPasswordField-CTuWpUWd.mjs.map} +1 -1
- package/dist/chunks/{NcRadioGroup-CLtk-WPR.mjs → NcRadioGroup-HorQ2m39.mjs} +3 -3
- package/dist/chunks/{NcRadioGroup-CLtk-WPR.mjs.map → NcRadioGroup-HorQ2m39.mjs.map} +1 -1
- package/dist/chunks/{NcRadioGroupButton-CDA5i7Dq.mjs → NcRadioGroupButton-CAisx7g4.mjs} +3 -3
- package/dist/chunks/{NcRadioGroupButton-CDA5i7Dq.mjs.map → NcRadioGroupButton-CAisx7g4.mjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-BVGAmIja.mjs → NcRelatedResourcesPanel-Dtxd3-o1.mjs} +3 -3
- package/dist/chunks/{NcRelatedResourcesPanel-BVGAmIja.mjs.map → NcRelatedResourcesPanel-Dtxd3-o1.mjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-0w6dbJeG.mjs → NcRichContenteditable-Bq1NOBCE.mjs} +11 -11
- package/dist/chunks/{NcRichContenteditable-0w6dbJeG.mjs.map → NcRichContenteditable-Bq1NOBCE.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-CBMtJzE_.mjs → NcRichText-B6VwyPUp.mjs} +5 -5
- package/dist/chunks/{NcRichText-CBMtJzE_.mjs.map → NcRichText-B6VwyPUp.mjs.map} +1 -1
- package/dist/chunks/{NcSelect-Czzsi3P_.mjs → NcSelect-Cc9_a8nG.mjs} +2 -2
- package/dist/chunks/{NcSelect-Czzsi3P_.mjs.map → NcSelect-Cc9_a8nG.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-DJwqmQ7_.mjs → NcSelectTags-JyyA4W_e.mjs} +3 -3
- package/dist/chunks/{NcSelectTags-DJwqmQ7_.mjs.map → NcSelectTags-JyyA4W_e.mjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-DVTI1DIZ.mjs → NcSelectUsers-CiTKYuOb.mjs} +3 -3
- package/dist/chunks/{NcSelectUsers-DVTI1DIZ.mjs.map → NcSelectUsers-CiTKYuOb.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-DYXU4pOK.mjs → NcSettingsSection-BcLE6UnZ.mjs} +3 -3
- package/dist/chunks/{NcSettingsSection-DYXU4pOK.mjs.map → NcSettingsSection-BcLE6UnZ.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-CuRTrvVN.mjs → NcSettingsSelectGroup-CUU-GWYl.mjs} +3 -3
- package/dist/chunks/{NcSettingsSelectGroup-CuRTrvVN.mjs.map → NcSettingsSelectGroup-CUU-GWYl.mjs.map} +1 -1
- package/dist/chunks/{NcTextArea-CdtxX_QJ.mjs → NcTextArea-2CifgNom.mjs} +2 -2
- package/dist/chunks/{NcTextArea-CdtxX_QJ.mjs.map → NcTextArea-2CifgNom.mjs.map} +1 -1
- package/dist/chunks/{NcTextField.vue_vue_type_script_setup_true_lang-D1y_LfGJ.mjs → NcTextField.vue_vue_type_script_setup_true_lang-BfjSL2EJ.mjs} +5 -5
- package/dist/chunks/{NcTextField.vue_vue_type_script_setup_true_lang-D1y_LfGJ.mjs.map → NcTextField.vue_vue_type_script_setup_true_lang-BfjSL2EJ.mjs.map} +1 -1
- package/dist/chunks/{NcThemeProvider.vue_vue_type_script_setup_true_lang-nUDJsDGI.mjs → NcThemeProvider.vue_vue_type_script_setup_true_lang-DWn1DRTx.mjs} +2 -2
- package/dist/chunks/{NcThemeProvider.vue_vue_type_script_setup_true_lang-nUDJsDGI.mjs.map → NcThemeProvider.vue_vue_type_script_setup_true_lang-DWn1DRTx.mjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-CGFRZR-3.mjs → NcTimezonePicker.vue_vue_type_script_setup_true_lang-BffYEppS.mjs} +4 -4
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-CGFRZR-3.mjs.map → NcTimezonePicker.vue_vue_type_script_setup_true_lang-BffYEppS.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-DPAmU2_J.mjs → NcUserBubble-CiB-Lu5C.mjs} +2 -2
- package/dist/chunks/{NcUserBubble-DPAmU2_J.mjs.map → NcUserBubble-CiB-Lu5C.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-CGEf7fej.mjs → NcUserStatusIcon-BgElapLh.mjs} +3 -3
- package/dist/chunks/{NcUserStatusIcon-CGEf7fej.mjs.map → NcUserStatusIcon-BgElapLh.mjs.map} +1 -1
- package/dist/chunks/{_l10n-DrTiip5c.mjs → _l10n-CgsPi8nC.mjs} +76 -38
- package/dist/chunks/_l10n-CgsPi8nC.mjs.map +1 -0
- package/dist/chunks/{actionText-DYzDdbVe.mjs → actionText-BXR0sWNu.mjs} +2 -2
- package/dist/chunks/{actionText-DYzDdbVe.mjs.map → actionText-BXR0sWNu.mjs.map} +1 -1
- package/dist/chunks/{colors-Go3zmZRD.mjs → colors-CL_wvNtd.mjs} +2 -2
- package/dist/chunks/{colors-Go3zmZRD.mjs.map → colors-CL_wvNtd.mjs.map} +1 -1
- package/dist/chunks/constants-Ciwvl5xb.mjs +11 -0
- package/dist/chunks/{constants-DrSznhwy.mjs.map → constants-Ciwvl5xb.mjs.map} +1 -1
- package/dist/chunks/{constants-Bls5liKo.mjs → constants-wIEKSp2G.mjs} +2 -2
- package/dist/chunks/{constants-Bls5liKo.mjs.map → constants-wIEKSp2G.mjs.map} +1 -1
- package/dist/chunks/{mdi-XFJRiRqJ.mjs → mdi-DvQxv1t7.mjs} +20 -24
- package/dist/chunks/{mdi-XFJRiRqJ.mjs.map → mdi-DvQxv1t7.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-DmD3-xYB.mjs → referencePickerModal-CDHqLZC-.mjs} +8 -8
- package/dist/chunks/{referencePickerModal-DmD3-xYB.mjs.map → referencePickerModal-CDHqLZC-.mjs.map} +1 -1
- package/dist/chunks/useAppSettingsDialog-C73Wx6iQ.mjs +12 -0
- package/dist/chunks/{useAppSettingsDialog-DbtEkXa4.mjs.map → useAppSettingsDialog-C73Wx6iQ.mjs.map} +1 -1
- package/dist/chunks/{useCopy-7FVrniF_.mjs → useCopy-D3yAxBJi.mjs} +3 -3
- package/dist/chunks/{useCopy-7FVrniF_.mjs.map → useCopy-D3yAxBJi.mjs.map} +1 -1
- package/dist/chunks/useNcActions-BzPO2c4h.mjs +7 -0
- package/dist/chunks/{useNcActions-CiGWxAJE.mjs.map → useNcActions-BzPO2c4h.mjs.map} +1 -1
- package/dist/chunks/{useNcFormBox-DA9iwXWY.mjs → useNcFormBox-Djlh582y.mjs} +2 -2
- package/dist/chunks/{useNcFormBox-DA9iwXWY.mjs.map → useNcFormBox-Djlh582y.mjs.map} +1 -1
- package/dist/chunks/{useNcRadioGroup-DaZbEKbf.mjs → useNcRadioGroup-D6llQmAl.mjs} +2 -2
- package/dist/chunks/{useNcRadioGroup-DaZbEKbf.mjs.map → useNcRadioGroup-D6llQmAl.mjs.map} +1 -1
- package/dist/components/NcActionButton/index.mjs +1 -1
- package/dist/components/NcActionButtonGroup/index.mjs +1 -1
- package/dist/components/NcActionCaption/index.mjs +1 -1
- package/dist/components/NcActionCheckbox/index.mjs +1 -1
- 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/index.mjs +1 -1
- package/dist/components/NcAppNavigationNew/index.mjs +1 -1
- package/dist/components/NcAppNavigationNewItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationSearch/index.mjs +1 -1
- package/dist/components/NcAppNavigationSettings/index.mjs +1 -1
- package/dist/components/NcAppSettingsDialog/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/index.mjs +1 -1
- package/dist/components/NcAssistantButton/index.mjs +1 -1
- package/dist/components/NcAssistantIcon/index.mjs +1 -1
- package/dist/components/NcAvatar/index.mjs +1 -1
- package/dist/components/NcBreadcrumb/index.mjs +1 -1
- 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/NcDashboardWidget/index.mjs +1 -1
- package/dist/components/NcDashboardWidgetItem/index.mjs +1 -1
- package/dist/components/NcDateTimePicker/index.mjs +1 -1
- package/dist/components/NcDateTimePickerNative/index.mjs +1 -1
- package/dist/components/NcDialog/index.mjs +1 -1
- package/dist/components/NcDialogButton/index.mjs +1 -1
- package/dist/components/NcEmojiPicker/index.mjs +1 -1
- package/dist/components/NcFormBox/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/NcHeaderButton/index.mjs +1 -1
- package/dist/components/NcHeaderMenu/index.mjs +1 -1
- package/dist/components/NcHotkey/index.mjs +1 -1
- package/dist/components/NcHotkeyList/index.mjs +1 -1
- package/dist/components/NcIconToggleSwitch/NcIconToggleSwitch.vue.d.ts +16 -0
- package/dist/components/NcInputField/index.mjs +1 -1
- package/dist/components/NcKbd/index.mjs +1 -1
- package/dist/components/NcListItem/index.mjs +1 -1
- package/dist/components/NcListItemIcon/index.mjs +1 -1
- package/dist/components/NcModal/index.mjs +1 -1
- package/dist/components/NcNoteCard/index.mjs +1 -1
- package/dist/components/NcPasswordField/index.mjs +1 -1
- package/dist/components/NcRadioGroup/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/index.mjs +3 -3
- package/dist/components/NcSelect/index.mjs +1 -1
- package/dist/components/NcSelectTags/index.mjs +1 -1
- package/dist/components/NcSelectUsers/index.mjs +1 -1
- package/dist/components/NcSettingsSection/index.mjs +1 -1
- package/dist/components/NcSettingsSelectGroup/index.mjs +1 -1
- package/dist/components/NcTextArea/index.mjs +1 -1
- package/dist/components/NcTextField/index.mjs +1 -1
- package/dist/components/NcThemeProvider/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/composables/useIsDarkTheme/index.mjs +1 -1
- package/dist/functions/reference/index.mjs +1 -1
- package/dist/functions/usernameToColor/index.mjs +1 -1
- package/dist/index.mjs +73 -73
- package/package.json +16 -16
- package/dist/chunks/NcCheckboxRadioSwitch-BCSKF7Tk.mjs.map +0 -1
- package/dist/chunks/NcFormBoxSwitch-UJwYMQPm.mjs.map +0 -1
- package/dist/chunks/_l10n-DrTiip5c.mjs.map +0 -1
- package/dist/chunks/constants-DrSznhwy.mjs +0 -11
- package/dist/chunks/useAppSettingsDialog-DbtEkXa4.mjs +0 -12
- package/dist/chunks/useNcActions-CiGWxAJE.mjs +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcChip-
|
|
1
|
+
{"version":3,"file":"NcChip-QHPd3nMF.mjs","sources":["../../src/components/NcChip/NcChip.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<docs>\n### Basic usage\n\n```vue\n<template>\n\t<div style=\"display: flex; gap: 8px; flex-wrap: wrap;\">\n\t\t<NcChip text=\"Notes.txt\" />\n\t\t<NcChip text=\"Files\" :icon-path=\"mdiFileOutline\" />\n\t\t<NcChip text=\"Color\" :icon-path=\"mdiPaletteOutline\" variant=\"tertiary\" />\n\t\t<NcChip text=\"Current time\" :icon-path=\"mdiClock\" no-close variant=\"primary\" />\n\t\t<NcChip text=\"Canceled\" :icon-path=\"mdiCancel\" variant=\"error\" no-close />\n\t\t<NcChip text=\"Open\" :icon-path=\"mdiCircleOutline\" variant=\"success\" no-close />\n\t\t<NcChip text=\"Due tomorrow\" :icon-path=\"mdiAlertCircleOutline\" variant=\"warning\" no-close />\n\t</div>\n</template>\n<script>\nimport { mdiClock, mdiFileOutline, mdiPaletteOutline, mdiCancel, mdiCircleOutline, mdiAlertCircleOutline } from '@mdi/js'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmdiAlertCircleOutline,\n\t\t\tmdiCancel,\n\t\t\tmdiCircleOutline,\n\t\t\tmdiClock,\n\t\t\tmdiFileOutline,\n\t\t\tmdiPaletteOutline,\n\t\t}\n\t}\n}\n</script>\n```\n\n### Advanced usage\n\nIt is also possible to use custom components for the icon by using the `icon` slot.\nIn this example we are using the `NcAvatar` component to render the users avatar as the icon.\n\n*Hint: If you use round icons like avatars you should set their size to `24px` (or use CSS variable `--chip-size`) to make them fully fill and align with the the chip*\n\nAlso it is possible to pass custom actions.\n\n```vue\n<template>\n\t<NcChip>\n\t\t<!-- The icon slot allow to use custom components as the chip icon -->\n\t\t<template #icon>\n\t\t\t<NcAvatar :size=\"24\" user=\"jdoe\" display-name=\"J. Doe\" />\n\t\t</template>\n\t\t<!-- The actions slot allows to add custom actions -->\n\t\t<template #actions>\n\t\t\t<NcActionButton>\n\t\t\t\t<template #icon>\n\t\t\t\t\t<ContactsIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd to contacts\n\t\t\t</NcActionButton>\n\t\t</template>\n\t\t<!-- The default slot can be used for add content, just like the `text` prop -->\n\t\tJ. Doe\n\t</NcChip>\n</template>\n<script>\nimport ContactsIcon from 'vue-material-design-icons/Contacts.vue'\nexport default {\n\tcomponents: {\n\t\tContactsIcon,\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<div\n\t\tclass=\"nc-chip\"\n\t\t:class=\"{\n\t\t\t[`nc-chip--${variant}`]: true,\n\t\t\t'nc-chip--no-actions': noClose && !hasActions(),\n\t\t\t'nc-chip--no-icon': !hasIcon(),\n\t\t}\">\n\t\t<span v-if=\"hasIcon()\" class=\"nc-chip__icon\">\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- The default icon wrapper uses a size of 18px to ensure the icon is not clipped by the round chip style -->\n\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\tv-if=\"iconPath || iconSvg\"\n\t\t\t\t\tinline\n\t\t\t\t\t:path=\"iconPath\"\n\t\t\t\t\t:svg=\"iconPath ? undefined : iconSvg\"\n\t\t\t\t\t:size=\"18\" />\n\t\t\t</slot>\n\t\t</span>\n\t\t<span class=\"nc-chip__text\">\n\t\t\t<slot>{{ text }}</slot>\n\t\t</span>\n\t\t<NcActions\n\t\t\tv-if=\"canClose || hasActions()\"\n\t\t\tclass=\"nc-chip__actions\"\n\t\t\t:container=\"actionsContainer\"\n\t\t\t:force-menu=\"!canClose\"\n\t\t\tvariant=\"tertiary-no-background\">\n\t\t\t<NcActionButton\n\t\t\t\tv-if=\"canClose\"\n\t\t\t\tclose-after-click\n\t\t\t\t@click=\"emit('close')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiClose\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ ariaLabelClose }}\n\t\t\t</NcActionButton>\n\t\t\t<slot name=\"actions\" />\n\t\t</NcActions>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\n\nimport { mdiClose } from '@mdi/js'\nimport { computed } from 'vue'\nimport NcActionButton from '../NcActionButton/NcActionButton.vue'\nimport NcActions from '../NcActions/NcActions.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\nimport { t } from '../../l10n.ts'\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * aria label to set on the close button\n\t *\n\t * @default 'Close'\n\t */\n\tariaLabelClose?: string\n\n\t/**\n\t * Container for the actions\n\t */\n\tactionsContainer?: string\n\n\t/**\n\t * Main text of the chip.\n\t */\n\ttext?: string\n\n\t/**\n\t * SVG path of the icon to use, this takes precedence over `iconSVG`.\n\t * For example icon paths from `@mdi/js` can be used.\n\t */\n\ticonPath?: string\n\n\t/**\n\t * Inline SVG to use as the icon\n\t */\n\ticonSvg?: string\n\n\t/**\n\t * Set to true to prevent the close button to be shown\n\t */\n\tnoClose?: boolean\n\n\t/**\n\t * Set the chips design variant-\n\t *\n\t * This sets the background style of the chip, similar to NcButton's `variant`.\n\t *\n\t * @default 'secondary'\n\t * @since 8.23.0\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'warning' | 'success'\n}>(), {\n\tariaLabelClose: t('Close'),\n\tactionsContainer: 'body',\n\ticonPath: undefined,\n\ticonSvg: undefined,\n\ttext: '',\n\tvariant: 'secondary',\n})\n\nconst emit = defineEmits<{\n\t/**\n\t * Emitted when the close button is clicked\n\t */\n\tclose: []\n}>()\n\nconst slots = defineSlots<{\n\t/**\n\t * The actions slot can be used to add custom actions (`NcAction*`) to the chips actions.\n\t */\n\tactions?: Slot\n\n\t/**\n\t * The default slot can be used to set the text that is shown.\n\t */\n\tdefault?: Slot\n\n\t/**\n\t * The icon slot can be used to set the chip icon.\n\t * Make sure that the icon is not exceeding a height of `--chip-size`.\n\t * For round icons a exact size of `var(--chip-size)` is recommended.\n\t */\n\ticon?: Slot\n}>()\n\nconst canClose = computed(() => !props.noClose)\nconst hasActions = () => !!slots.actions\nconst hasIcon = () => Boolean(props.iconPath || props.iconSvg || !!slots.icon)\n</script>\n\n<style scoped lang=\"scss\">\n.nc-chip {\n\t--chip-size: 24px;\n\t--chip-radius: calc(var(--chip-size) / 2);\n\t// Setup size of wrapper\n\theight: var(--chip-size);\n\tmax-width: fit-content;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tborder-radius: var(--chip-radius);\n\tbackground-color: var(--color-background-hover);\n\n\t&--primary {\n\t\tbackground-color: var(--color-primary-element);\n\t\tcolor: var(--color-primary-element-text);\n\t}\n\n\t&--secondary {\n\t\tbackground-color: var(--color-primary-element-light);\n\t\tcolor: var(--color-primary-element-light-text);\n\t}\n\n\t&--error {\n\t\tbackground-color: var(--color-error);\n\t\tcolor: var(--color-error-text);\n\t}\n\n\t&--warning {\n\t\tbackground-color: var(--color-warning);\n\t\tcolor: var(--color-warning-text);\n\t}\n\n\t&--success {\n\t\tbackground-color: var(--color-success);\n\t\tcolor: var(--color-success-text);\n\t}\n\n\t&--no-actions &__text {\n\t\t// If there are no actions we need to add some padding to ensure the text is not cut-off\n\t\tpadding-inline-end: calc(2 * var(--default-grid-baseline));\n\t}\n\n\t&--no-icon &__text {\n\t\t// Add some more space to the border\n\t\tpadding-inline-start: calc(2 * var(--default-grid-baseline));\n\t}\n\n\t&__text {\n\t\t// Allow to grow the text\n\t\t// this is only used if an app forces a width of the chip\n\t\tflex: 1 auto;\n\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-wrap: nowrap;\n\t}\n\n\t&__icon {\n\t\t// Do neither grow nor shrink, size is fixed\n\t\tflex: 0 0 var(--chip-size);\n\t\tmargin-inline-end: var(--default-grid-baseline);\n\n\t\tline-height: 1;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t// Force size\n\t\toverflow: hidden;\n\t\theight: var(--chip-size);\n\t\twidth: var(--chip-size);\n\t}\n\n\t&__actions {\n\t\t// Do neither grow nor shrink, size is fixed\n\t\tflex: 0 0 var(--chip-size);\n\t\t// Adjust action size to match chip size\n\t\t--default-clickable-area: var(--chip-size);\n\t\t--border-radius-element: var(--chip-radius);\n\t}\n}\n</style>\n"],"names":["_useSlots","_createElementBlock","variant","noClose","_openBlock","_renderSlot","iconPath","iconSvg","_createBlock","_createElementVNode","text","actionsContainer","_createVNode","_unref","_createTextVNode","ariaLabelClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiIA,UAAM,QAAQ;AAoDd,UAAM,OAAO;AAOb,UAAM,QAAQA,SAAA;AAmBd,UAAM,WAAW,SAAS,MAAM,CAAC,MAAM,OAAO;AAC9C,UAAM,aAAa,MAAM,CAAC,CAAC,MAAM;AACjC,UAAM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ce";
|
|
3
3
|
import { resolveComponent, createElementBlock, openBlock, createVNode, createCommentVNode, toDisplayString, withModifiers, normalizeClass, withDirectives, createElementVNode, vModelText, Fragment, renderList, createBlock, resolveDynamicComponent, withCtx, createTextVNode, Transition, ref } from "vue";
|
|
4
|
-
import { r as register,
|
|
5
|
-
import { N as NcActionButton } from "./NcActionButton-
|
|
6
|
-
import { N as NcActions } from "./NcActions-
|
|
7
|
-
import { N as NcAvatar } from "./NcAvatar-
|
|
4
|
+
import { r as register, L as t28, a as t, M as t6 } from "./_l10n-CgsPi8nC.mjs";
|
|
5
|
+
import { N as NcActionButton } from "./NcActionButton-BHXE4UKQ.mjs";
|
|
6
|
+
import { N as NcActions } from "./NcActions-4R7icatI.mjs";
|
|
7
|
+
import { N as NcAvatar } from "./NcAvatar-S8EJR2BK.mjs";
|
|
8
8
|
import { g as getRoute } from "./autolink-U5pBzLgI.mjs";
|
|
9
9
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
10
10
|
import { l as logger } from "./logger-D3RVzcfQ.mjs";
|
|
11
|
-
import { N as NcSelect } from "./NcSelect-
|
|
11
|
+
import { N as NcSelect } from "./NcSelect-Cc9_a8nG.mjs";
|
|
12
12
|
import axios from "@nextcloud/axios";
|
|
13
13
|
import { generateOcsUrl } from "@nextcloud/router";
|
|
14
14
|
register(t28);
|
|
@@ -591,4 +591,4 @@ const NcCollectionList = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc
|
|
|
591
591
|
export {
|
|
592
592
|
NcCollectionList as N
|
|
593
593
|
};
|
|
594
|
-
//# sourceMappingURL=NcCollectionList-
|
|
594
|
+
//# sourceMappingURL=NcCollectionList-ByFl0-ca.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcCollectionList-C-Zxsdgw.mjs","sources":["../../src/components/NcCollectionList/NcCollectionListItem.vue","../../src/components/NcCollectionList/service.ts","../../src/components/NcCollectionList/useCollections.js","../../src/components/NcCollectionList/NcCollectionList.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<li class=\"collection-list-item\">\n\t\t<NcAvatar :display-name=\"collection.name\" allow-placeholder class=\"collection-avatar\" />\n\t\t<span\n\t\t\tv-if=\"newName === null\"\n\t\t\tclass=\"collection-item-name\"\n\t\t\ttitle=\"\"\n\t\t\t@click=\"showDetails\">{{ collection.name }}</span>\n\t\t<form v-else :class=\"{ 'should-shake': error }\" @submit.prevent=\"renameCollection\">\n\t\t\t<input\n\t\t\t\tv-model=\"newName\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\tautocapitalize=\"off\">\n\t\t\t<input type=\"submit\" value=\"\" class=\"icon-confirm\">\n\t\t</form>\n\t\t<div v-if=\"!detailsOpen && newName === null\" class=\"linked-icons\">\n\t\t\t<component\n\t\t\t\t:is=\"getComponent(resource).component\"\n\t\t\t\tv-for=\"resource in resources.slice(0, 2)\"\n\t\t\t\t:key=\"resource.type + '|' + resource.id\"\n\t\t\t\t:title=\"resource.name\"\n\t\t\t\t:to=\"getComponent(resource).to\"\n\t\t\t\t:href=\"getComponent(resource).href\"\n\t\t\t\t:class=\"typeClass(resource)\">\n\t\t\t\t<img :src=\"iconUrl(resource)\" :alt=\"resource.name\">\n\t\t\t</component>\n\t\t</div>\n\n\t\t<span v-if=\"newName === null\" class=\"sharingOptionsGroup\">\n\t\t\t<NcActions>\n\t\t\t\t<NcActionButton\n\t\t\t\t\ticon=\"icon-info\"\n\t\t\t\t\t@click.prevent=\"toggleDetails\">\n\t\t\t\t\t{{ detailsOpen ? t('Hide details') : t('Show details') }}\n\t\t\t\t</NcActionButton>\n\t\t\t\t<NcActionButton\n\t\t\t\t\ticon=\"icon-rename\"\n\t\t\t\t\t@click.prevent=\"openRename\">\n\t\t\t\t\t{{ t('Rename project') }}\n\t\t\t\t</NcActionButton>\n\t\t\t</NcActions>\n\t\t</span>\n\n\t\t<transition name=\"fade\">\n\t\t\t<div v-if=\"error\" class=\"error\">\n\t\t\t\t{{ error }}\n\t\t\t</div>\n\t\t</transition>\n\t\t<transition name=\"fade\">\n\t\t\t<ul v-if=\"detailsOpen\" class=\"resource-list-details\">\n\t\t\t\t<li\n\t\t\t\t\tv-for=\"resource in resources\"\n\t\t\t\t\t:key=\"resource.type + '|' + resource.id\"\n\t\t\t\t\t:class=\"typeClass(resource)\">\n\t\t\t\t\t<component\n\t\t\t\t\t\t:is=\"getComponent(resource).component\"\n\t\t\t\t\t\t:to=\"getComponent(resource).to\"\n\t\t\t\t\t\t:href=\"getComponent(resource).href\">\n\t\t\t\t\t\t<img :src=\"iconUrl(resource)\" :alt=\"resource.name\">\n\t\t\t\t\t\t<span class=\"resource-name\">{{ resource.name || '' }}</span>\n\t\t\t\t\t</component>\n\t\t\t\t\t<span class=\"icon-close\" @click=\"removeResource(collection, resource)\" />\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</transition>\n\t</li>\n</template>\n\n<script>\nimport { t } from '../../l10n.ts'\nimport NcActionButton from '../NcActionButton/index.js'\nimport NcActions from '../NcActions/index.js'\nimport NcAvatar from '../NcAvatar/index.js'\nimport { getRoute } from '../NcRichText/autolink.ts'\n\nexport default {\n\tname: 'NcCollectionListItem',\n\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcActions,\n\t\tNcActionButton,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The collection\n\t\t */\n\t\tcollection: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Current error if any\n\t\t */\n\t\terror: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\temits: [\n\t\t'removeResource',\n\t\t'renameCollection',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tdetailsOpen: false,\n\t\t\tnewName: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tgetIcon() {\n\t\t\treturn (resource) => [resource.iconClass]\n\t\t},\n\n\t\ttypeClass() {\n\t\t\treturn (resource) => 'resource-type-' + resource.type\n\t\t},\n\n\t\tresources() {\n\t\t\t// invalid resources come from server as empty array ([]) and not an object\n\t\t\treturn this.collection.resources?.filter((resource) => !Array.isArray(resource)) ?? []\n\t\t},\n\n\t\tgetComponent() {\n\t\t\treturn (resource) => {\n\t\t\t\tconst route = getRoute(this.$router, resource.link)\n\n\t\t\t\treturn route\n\t\t\t\t\t? { component: 'router-link', to: route, href: undefined }\n\t\t\t\t\t: { component: 'a', to: undefined, href: resource.link }\n\t\t\t}\n\t\t},\n\n\t\ticonUrl() {\n\t\t\treturn (resource) => {\n\t\t\t\tif (resource.mimetype) {\n\t\t\t\t\treturn OC.MimeType.getIconUrl(resource.mimetype)\n\t\t\t\t}\n\t\t\t\tif (resource.iconUrl) {\n\t\t\t\t\treturn resource.iconUrl\n\t\t\t\t}\n\t\t\t\treturn ''\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\ttoggleDetails() {\n\t\t\tthis.detailsOpen = !this.detailsOpen\n\t\t},\n\n\t\tshowDetails() {\n\t\t\tthis.detailsOpen = true\n\t\t},\n\n\t\tremoveResource(collection, resource) {\n\t\t\tthis.$emit('removeResource', {\n\t\t\t\tcollectionId: collection.id,\n\t\t\t\tresourceType: resource.type,\n\t\t\t\tresourceId: resource.id,\n\t\t\t})\n\t\t},\n\n\t\topenRename() {\n\t\t\tthis.newName = this.collection.name\n\t\t},\n\n\t\trenameCollection() {\n\t\t\tif (this.newName) {\n\t\t\t\tthis.$emit('renameCollection', {\n\t\t\t\t\tcollectionId: this.collection.id,\n\t\t\t\t\tname: this.newName,\n\t\t\t\t})\n\t\t\t}\n\t\t\tthis.newName = null\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.fade-enter-active, .fade-leave-active {\n\ttransition: opacity .3s ease;\n}\n\n.fade-enter, .fade-leave-to\n\t/* .fade-leave-active below version 2.1.8 */\n{\n\topacity: 0;\n}\n\n.linked-icons {\n\tdisplay: flex;\n\n\timg {\n\t\tpadding: 12px;\n\t\theight: var(--default-clickable-area);\n\t\tdisplay: block;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t\topacity: 0.7;\n\n\t\t&:hover {\n\t\t\topacity: 1;\n\t\t}\n\t}\n}\n\n.popovermenu {\n\tdisplay: none;\n\n\t&.open {\n\t\tdisplay: block;\n\t}\n}\n\nli.collection-list-item {\n\tflex-wrap: wrap;\n\theight: auto;\n\tcursor: pointer;\n\tmargin-bottom: 0 !important;\n\n\t.collection-avatar {\n\t\tmargin-top: 0;\n\t}\n\n\tform, .collection-item-name {\n\t\tflex-basis: 10%;\n\t\tflex-grow: 1;\n\t\tdisplay: flex;\n\t}\n\n\t.collection-item-name {\n\t\tpadding: 12px 9px;\n\t}\n\n\tinput {\n\t\tmargin-top: 4px;\n\t\tborder-color: var(--color-border-maxcontrast);\n\n\t\t&[type=text] {\n\t\t\tflex-grow: 1;\n\t\t}\n\t}\n\n\t.error {\n\t\tflex-basis: 100%;\n\t\twidth: 100%;\n\t}\n\n\t.resource-list-details {\n\t\tflex-basis: 100%;\n\t\twidth: 100%;\n\n\t\tli {\n\t\t\tdisplay: flex;\n\t\t\tmargin-inline-start: var(--default-clickable-area);\n\t\t\tborder-radius: 3px;\n\t\t\tcursor: pointer;\n\n\t\t\t&:hover {\n\t\t\t\tbackground-color: var(--color-background-dark);\n\t\t\t}\n\n\t\t\ta {\n\t\t\t\tflex-grow: 1;\n\t\t\t\tpadding: 3px;\n\t\t\t\tmax-width: calc(100% - 30px);\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\tspan {\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: top;\n\t\t\tmargin-inline-end: 10px;\n\t\t}\n\n\t\tspan.resource-name {\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\tposition: relative;\n\t\t\tvertical-align: top;\n\t\t\twhite-space: nowrap;\n\t\t\tflex-grow: 1;\n\t\t\tpadding: 4px;\n\t\t}\n\n\t\timg {\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t}\n\n\t\t.icon-close {\n\t\t\topacity: .7;\n\n\t\t\t&:hover, &:focus {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n.should-shake {\n\tanimation: shake 0.6s 1 linear;\n}\n\n@keyframes shake {\n\t0% {\n\t\ttransform: translate(15px);\n\t}\n\t20% {\n\t\ttransform: translate(-15px);\n\t}\n\t40% {\n\t\ttransform: translate(7px);\n\t}\n\t60% {\n\t\ttransform: translate(-7px);\n\t}\n\t80% {\n\t\ttransform: translate(3px);\n\t}\n\t100% {\n\t\ttransform: translate(0px);\n\t}\n}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { OCSResponse } from '@nextcloud/typings/ocs'\n\nimport axios, { type AxiosResponse } from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\n/**\n * Extracts the OCS data from a response\n *\n * @param response OCS response\n */\nfunction extractOcsData(response: AxiosResponse<OCSResponse>) {\n\treturn response.data.ocs.data\n}\n\n/**\n * Lists all collections\n *\n * @param collectionId Collection ID\n */\nexport function listCollectionService(collectionId: number) {\n\treturn axios.get(generateOcsUrl('collaboration/resources/collections/{collectionId}', { collectionId })).then(extractOcsData)\n}\n\n/**\n * Renames a collection\n *\n * @param collectionId Collection ID\n * @param collectionName New collection name\n */\nexport function renameCollectionService(collectionId: number, collectionName: string) {\n\treturn axios.put(generateOcsUrl('collaboration/resources/collections/{collectionId}', { collectionId }), { collectionName }).then(extractOcsData)\n}\n\n/**\n * Lists all collections for a resource\n *\n * @param resourceType Resource type\n * @param resourceId Resource ID\n */\nexport function getCollectionsByResourceService(resourceType: string, resourceId: string) {\n\treturn axios.get(generateOcsUrl('collaboration/resources/{resourceType}/{resourceId}', { resourceType, resourceId })).then(extractOcsData)\n}\n\n/**\n * Creates a collection\n *\n * @param resourceType Resource type\n * @param resourceId Resource ID\n * @param name Collection name\n */\nexport function createCollectionService(resourceType: string, resourceId: string, name: string) {\n\treturn axios.post(generateOcsUrl('collaboration/resources/{resourceType}/{resourceId}', { resourceType, resourceId }), { name }).then(extractOcsData)\n}\n\n/**\n * Adds a resource to a collection\n *\n * @param collectionId Collection ID\n * @param resourceType Resource type\n * @param resourceId Resource ID\n */\nexport function addResourceService(collectionId: number, resourceType: string, resourceId: string) {\n\treturn axios.post(generateOcsUrl('collaboration/resources/collections/{collectionId}', { collectionId }), { resourceType, resourceId }).then(extractOcsData)\n}\n\n/**\n * Removes a resource from a collection\n *\n * @param collectionId Collection ID\n * @param resourceType Resource type\n * @param resourceId Resource ID\n */\nexport function removeResourceService(collectionId: number, resourceType: string, resourceId: string) {\n\treturn axios.delete(generateOcsUrl('collaboration/resources/collections/{collectionId}', { collectionId }), { params: { resourceType, resourceId } }).then(extractOcsData)\n}\n\n/**\n * Searches for collections\n *\n * @param query Search query\n */\nexport function searchService(query: string) {\n\treturn axios.get(generateOcsUrl('collaboration/resources/collections/search/{query}', { query })).then(extractOcsData)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { ref } from 'vue'\nimport {\n\taddResourceService,\n\tcreateCollectionService,\n\tgetCollectionsByResourceService,\n\tremoveResourceService,\n\trenameCollectionService,\n} from './service.ts'\n\n/**\n * Use collections composable\n */\nexport function useCollections() {\n\t// State\n\tconst storedCollections = ref([])\n\n\t// Mutations\n\tconst addCollections = (collections) => {\n\t\tstoredCollections.value = collections\n\t}\n\n\tconst addCollection = (collection) => {\n\t\tstoredCollections.value.push(collection)\n\t}\n\n\tconst removeCollection = (collectionId) => {\n\t\tstoredCollections.value = storedCollections.value.filter((item) => item.id !== collectionId)\n\t}\n\n\tconst updateCollection = (collection) => {\n\t\tconst index = storedCollections.value.findIndex((item) => item.id === collection.id)\n\t\tif (index !== -1) {\n\t\t\tstoredCollections.value[index] = collection\n\t\t} else {\n\t\t\taddCollection(collection)\n\t\t}\n\t}\n\n\t// Actions\n\tconst fetchCollectionsByResource = async ({ resourceType, resourceId }) => {\n\t\tconst collections = await getCollectionsByResourceService(resourceType, resourceId)\n\n\t\taddCollections(collections)\n\t}\n\n\tconst createCollection = async ({ baseResourceType, baseResourceId, resourceType, resourceId, name }) => {\n\t\tconst collection = await createCollectionService(baseResourceType, baseResourceId, name)\n\n\t\taddCollection(collection)\n\t\tawait addResourceToCollection({\n\t\t\tcollectionId: collection.id,\n\t\t\tresourceType,\n\t\t\tresourceId,\n\t\t})\n\t}\n\n\tconst renameCollection = async ({ collectionId, name }) => {\n\t\tconst collection = await renameCollectionService(collectionId, name)\n\n\t\tupdateCollection(collection)\n\t}\n\n\t/**\n\t * @param {*} param0\n\t */\n\tasync function addResourceToCollection({ collectionId, resourceType, resourceId }) {\n\t\tconst collection = await addResourceService(collectionId, resourceType, String(resourceId))\n\n\t\tupdateCollection(collection)\n\t}\n\n\tconst removeResourceFromCollection = async ({ collectionId, resourceType, resourceId }) => {\n\t\tconst collection = await removeResourceService(collectionId, resourceType, String(resourceId))\n\n\t\tif (collection.resources.length > 0) {\n\t\t\tupdateCollection(collection)\n\t\t} else {\n\t\t\tremoveCollection(collectionId)\n\t\t}\n\t}\n\n\treturn {\n\t\tstoredCollections,\n\t\tfetchCollectionsByResource,\n\t\tcreateCollection,\n\t\trenameCollection,\n\t\taddResourceToCollection,\n\t\tremoveResourceFromCollection,\n\t}\n}\n","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\nProvides a Vue standalone component for Nextcloud Projects feature introduced in Nextcloud 16. Replaces deprecated `nextcloud-vue-collections` library.\n\nProjects feature is deprecated since Nextcloud 25, and superseded by Related resources. See [NcRelatedResourcesPanel](#/Components/NcRelatedResourcesPanel) documentation for more information.\n\n### Usage\n\nTo enable feature in Nextcloud, run following command:\n```sh\nocc config:system:set --value true 'projects.enabled'\n```\n</docs>\n\n<template>\n\t<ul v-if=\"collections && type && id\" id=\"collection-list\" class=\"collection-list\">\n\t\t<li @click=\"showSelect\">\n\t\t\t<div class=\"avatar\">\n\t\t\t\t<span class=\"icon-projects\" />\n\t\t\t</div>\n\t\t\t<div id=\"collection-select-container\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tref=\"select\"\n\t\t\t\t\tv-model=\"value\"\n\t\t\t\t\t:aria-label-combobox=\"t('Add to a project')\"\n\t\t\t\t\t:options=\"options\"\n\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\tlabel=\"title\"\n\t\t\t\t\t:limit=\"5\"\n\t\t\t\t\t@close=\"isSelectOpen = false\"\n\t\t\t\t\t@open=\"isSelectOpen = true\"\n\t\t\t\t\t@option:selected=\"select\"\n\t\t\t\t\t@search=\"search\">\n\t\t\t\t\t<template #selected-option=\"option\">\n\t\t\t\t\t\t<span class=\"option__desc\">\n\t\t\t\t\t\t\t<span class=\"option__title\">{{ option.title }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<template #option=\"option\">\n\t\t\t\t\t\t<span class=\"option__wrapper\">\n\t\t\t\t\t\t\t<span v-if=\"option.class\" :class=\"option.class\" class=\"avatar\" />\n\t\t\t\t\t\t\t<NcAvatar v-else-if=\"option.method !== 2\" allow-placeholder :display-name=\"option.title\" />\n\t\t\t\t\t\t\t<span class=\"option__title\">{{ option.title }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<p class=\"hint\">\n\t\t\t\t\t\t{{ t('Connect items to a project to make them easier to find') }}\n\t\t\t\t\t</p>\n\t\t\t\t</NcSelect>\n\t\t\t</div>\n\t\t</li>\n\t\t<transition name=\"fade\">\n\t\t\t<li v-if=\"error\" class=\"error\">\n\t\t\t\t{{ error }}\n\t\t\t</li>\n\t\t</transition>\n\t\t<NcCollectionListItem\n\t\t\tv-for=\"collection in collections\"\n\t\t\t:key=\"collection.id\"\n\t\t\t:collection=\"collection\"\n\t\t\t:error=\"collectionsError[collection.id]\"\n\t\t\t@rename-collection=\"renameCollectionFromItem\"\n\t\t\t@remove-resource=\"removeResourceFromCollection\" />\n\t</ul>\n</template>\n\n<script>\nimport debounce from 'debounce'\nimport { ref } from 'vue'\nimport NcCollectionListItem from './NcCollectionListItem.vue'\nimport { t } from '../../l10n.ts'\nimport { logger } from '../../utils/logger.ts'\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcSelect from '../NcSelect/index.js'\nimport { searchService } from './service.ts'\nimport { useCollections } from './useCollections.js'\n\nconst METHOD_CREATE_COLLECTION = 0\nconst METHOD_ADD_TO_COLLECTION = 1\n\nexport default {\n\tname: 'NcCollectionList',\n\n\tcomponents: {\n\t\tNcCollectionListItem,\n\t\tNcAvatar,\n\t\tNcSelect,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Resource type identifier\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Unique id of the resource\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Name of the resource\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Whether the component is active (to start fetch resources)\n\t\t */\n\t\tisActive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst {\n\t\t\tstoredCollections,\n\t\t\tfetchCollectionsByResource,\n\t\t\tcreateCollection,\n\t\t\taddResourceToCollection,\n\t\t\tremoveResourceFromCollection,\n\t\t\trenameCollection,\n\t\t} = useCollections()\n\n\t\tconst searchCollections = ref([])\n\t\tconst search = debounce(function(query, loading) {\n\t\t\tif (query !== '') {\n\t\t\t\tloading(true)\n\t\t\t\tsearchService(query).then((collections) => {\n\t\t\t\t\tsearchCollections.value = collections\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tlogger.error('Failed to search for collections', { error })\n\t\t\t\t}).finally(() => {\n\t\t\t\t\tloading(false)\n\t\t\t\t})\n\t\t\t}\n\t\t}, 500)\n\n\t\treturn {\n\t\t\tstoredCollections,\n\t\t\tfetchCollectionsByResource,\n\t\t\tcreateCollection,\n\t\t\taddResourceToCollection,\n\t\t\tremoveResourceFromCollection,\n\t\t\trenameCollection,\n\t\t\tsearchCollections,\n\t\t\tsearch,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tselectIsOpen: false,\n\t\t\tgeneratingCodes: false,\n\t\t\tcodes: undefined,\n\t\t\tvalue: null,\n\t\t\tmodel: {},\n\t\t\tcollectionsError: {},\n\t\t\terror: null,\n\t\t\tisSelectOpen: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcollections() {\n\t\t\treturn this.storedCollections.filter((collection) => collection.resources\n\t\t\t\t.some((resource) => resource && resource.id === String(this.id) && resource.type === this.type))\n\t\t},\n\n\t\tplaceholder() {\n\t\t\treturn this.isSelectOpen\n\t\t\t\t? t('Type to search for existing projects')\n\t\t\t\t: t('Add to a project')\n\t\t},\n\n\t\toptions() {\n\t\t\tconst options = []\n\t\t\twindow.OCP.Collaboration.getTypes().sort().forEach((type) => {\n\t\t\t\toptions.push({\n\t\t\t\t\tmethod: METHOD_CREATE_COLLECTION,\n\t\t\t\t\ttype,\n\t\t\t\t\ttitle: window.OCP.Collaboration.getLabel(type),\n\t\t\t\t\tclass: window.OCP.Collaboration.getIcon(type),\n\t\t\t\t\taction: () => window.OCP.Collaboration.trigger(type),\n\t\t\t\t})\n\t\t\t})\n\t\t\tfor (const index in this.searchCollections) {\n\t\t\t\tif (!this.collections.find((collection) => collection.id === this.searchCollections[index].id)) {\n\t\t\t\t\toptions.push({\n\t\t\t\t\t\tmethod: METHOD_ADD_TO_COLLECTION,\n\t\t\t\t\t\ttitle: this.searchCollections[index].name,\n\t\t\t\t\t\tcollectionId: this.searchCollections[index].id,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn options\n\t\t},\n\n\t\tresourceIdentifier() {\n\t\t\treturn {\n\t\t\t\tresourceType: this.type,\n\t\t\t\tresourceId: this.id,\n\t\t\t\tisActive: this.isActive,\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tresourceIdentifier: {\n\t\t\tdeep: true,\n\t\t\timmediate: true,\n\t\t\thandler(resourceIdentifier) {\n\t\t\t\tif (!resourceIdentifier.isActive || !resourceIdentifier.resourceId || !resourceIdentifier.resourceType) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.fetchCollectionsByResource(resourceIdentifier)\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\tselect(selectedOption) {\n\t\t\tif (selectedOption.method === METHOD_CREATE_COLLECTION) {\n\t\t\t\tselectedOption.action().then((resourceId) => {\n\t\t\t\t\tthis.createCollection({\n\t\t\t\t\t\tbaseResourceType: this.type,\n\t\t\t\t\t\tbaseResourceId: this.id,\n\t\t\t\t\t\tresourceType: selectedOption.type,\n\t\t\t\t\t\tresourceId,\n\t\t\t\t\t\tname: this.name,\n\t\t\t\t\t}).catch((e) => {\n\t\t\t\t\t\tthis.setError(t('Failed to create a project'), e)\n\t\t\t\t\t})\n\t\t\t\t}).catch((e) => {\n\t\t\t\t\tlogger.error('[NcCollectionList] No resource selected', e)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif (selectedOption.method === METHOD_ADD_TO_COLLECTION) {\n\t\t\t\tthis.addResourceToCollection({\n\t\t\t\t\tcollectionId: selectedOption.collectionId, resourceType: this.type, resourceId: this.id,\n\t\t\t\t}).catch((e) => {\n\t\t\t\t\tthis.setError(t('Failed to add the item to the project'), e)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tthis.value = null\n\t\t},\n\n\t\tshowSelect() {\n\t\t\tthis.selectIsOpen = true\n\t\t\tthis.$refs.select.$el.focus()\n\t\t},\n\n\t\tsetError(error, e) {\n\t\t\tlogger.error(error, { error: e })\n\t\t\tthis.error = error\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.error = null\n\t\t\t}, 5000)\n\t\t},\n\n\t\trenameCollectionFromItem({ collectionId, name }) {\n\t\t\tthis.renameCollection({ collectionId, name })\n\t\t\t\t.catch((e) => {\n\t\t\t\t\tlogger.error(t('Failed to rename the project'), { error: e })\n\t\t\t\t\tthis.collectionsError[collectionId] = t('Failed to rename the project')\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.collectionsError[collectionId] = null\n\t\t\t\t\t}, 5000)\n\t\t\t\t})\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.collection-list * {\n\tbox-sizing: border-box;\n}\n\n.collection-list > li {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\n\t& > .avatar {\n\t\tmargin-top: 0;\n\t}\n}\n\n#collection-select-container {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.v-select {\n\t// NcAvatar in the dropdown\n\tspan.avatar {\n\t\tdisplay: block;\n\t\tpadding: 16px;\n\t\topacity: .7;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\n\t\t&:hover {\n\t\t\topacity: 1;\n\t\t}\n\t}\n}\n\np.hint {\n\tz-index: 1;\n\t// fix alignment\n\tmargin-top: -16px;\n\tpadding: 8px 8px;\n\tcolor: var(--color-text-maxcontrast);\n\tline-height: normal;\n}\n\ndiv.avatar {\n\twidth: 32px;\n\theight: 32px;\n\tmargin: 0;\n\tpadding: 8px;\n\tbackground-color: var(--color-background-dark);\n\tmargin-top: 30px;\n}\n\n/** TODO provide white icon in core */\n.icon-projects {\n\tdisplay: block;\n\tpadding: 8px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: center;\n}\n\n.option__wrapper {\n\tdisplay: flex;\n\n\t.avatar {\n\t\tdisplay: block;\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tbackground-color: var(--color-background-darker) !important;\n\t}\n\n\t.option__title {\n\t\tpadding: 4px;\n\t}\n}\n\n.fade-enter-active, .fade-leave-active {\n\ttransition: opacity .5s;\n}\n\n.fade-enter, .fade-leave-to {\n\topacity: 0;\n}\n\n</style>\n"],"names":["_sfc_main","_hoisted_1","_hoisted_8","_openBlock","_createElementBlock","_createVNode","_toDisplayString","_createElementVNode","_hoisted_2","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_normalizeClass","_hoisted_4","_Transition","_hoisted_5","_hoisted_6","_withCtx"],"mappings":";;;;;;;;;;;;;AAiFA,MAAKA,cAAU;AAAA,EACd,MAAM;AAAA,EAEN,YAAY;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA;EAGD,OAAO;AAAA;AAAA;AAAA;AAAA,IAIN,YAAY;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMV,OAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA;;EAIX,OAAO;AAAA,IACN;AAAA,IACA;AAAA;EAGD,OAAO;AACN,WAAO;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACV;AAAA,EACD;AAAA,EAEA,UAAU;AAAA,IACT,UAAU;AACT,aAAO,CAAC,aAAa,CAAC,SAAS,SAAS;AAAA,IACzC;AAAA,IAEA,YAAY;AACX,aAAO,CAAC,aAAa,mBAAmB,SAAS;AAAA,IAClD;AAAA,IAEA,YAAY;AAEX,aAAO,KAAK,WAAW,WAAW,OAAO,CAAC,aAAa,CAAC,MAAM,QAAQ,QAAQ,CAAC,KAAK,CAAA;AAAA,IACrF;AAAA,IAEA,eAAe;AACd,aAAO,CAAC,aAAa;AACpB,cAAM,QAAQ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AqDD,gBAAtB,OAAO,KAAK,GAAA,CAAA;AAAA;;UAGlC,QAAMY,QAChB,CADkB,WAAM;AAAA,YACxBX,mBAIO,QAJP,YAIO;AAAA,cAHM,OAAO,sBAAnBH,mBAAiE,QAAA;AAAA;gBAAtC,OAAKS,eAAA,CAAE,OAAO,OAAa,QAAQ,CAAA;AAAA,6BACzC,OAAO,WAAM,kBAAlCF,YAA2F,qBAAA;AAAA;gBAAjD,qBAAA;AAAA,gBAAmB,gBAAc,OAAO;AAAA;cAClFJ,mBAAqD,QAArD,YAAqDD,gBAAtB,OAAO,KAAK,GAAA,CAAA;AAAA;;2BAG7C,MAEI;AAAA,YAFJC,mBAEI,KAFJ,YAEID,gBADA,SAAA,EAAC,wDAAA,CAAA,GAAA,CAAA;AAAA;;;;;IAKRD,YAIaU,YAAA,EAJD,MAAK,OAAM,GAAA;AAAA,uBACtB,MAEK;AAAA,QAFK,MAAA,sBAAVX,mBAEK,MAFL,YAEKE,gBADD,MAAA,KAAK,GAAA,CAAA;;;;sBAGVF,mBAMmDK,UAAA,MAAAC,WAL7B,SAAA,aAAW,CAAzB,eAAU;0BADlBC,YAMmD,iCAAA;AAAA,QAJjD,KAAK,WAAW;AAAA,QAChB;AAAA,QACA,OAAO,MAAA,iBAAiB,WAAW,EAAE;AAAA,QACrC,oBAAmB,SAAA;AAAA,QACnB,kBAAiB,OAAA;AAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcCollectionList-ByFl0-ca.mjs","sources":["../../src/components/NcCollectionList/NcCollectionListItem.vue","../../src/components/NcCollectionList/service.ts","../../src/components/NcCollectionList/useCollections.js","../../src/components/NcCollectionList/NcCollectionList.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<li class=\"collection-list-item\">\n\t\t<NcAvatar :display-name=\"collection.name\" allow-placeholder class=\"collection-avatar\" />\n\t\t<span\n\t\t\tv-if=\"newName === null\"\n\t\t\tclass=\"collection-item-name\"\n\t\t\ttitle=\"\"\n\t\t\t@click=\"showDetails\">{{ collection.name }}</span>\n\t\t<form v-else :class=\"{ 'should-shake': error }\" @submit.prevent=\"renameCollection\">\n\t\t\t<input\n\t\t\t\tv-model=\"newName\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\tautocapitalize=\"off\">\n\t\t\t<input type=\"submit\" value=\"\" class=\"icon-confirm\">\n\t\t</form>\n\t\t<div v-if=\"!detailsOpen && newName === null\" class=\"linked-icons\">\n\t\t\t<component\n\t\t\t\t:is=\"getComponent(resource).component\"\n\t\t\t\tv-for=\"resource in resources.slice(0, 2)\"\n\t\t\t\t:key=\"resource.type + '|' + resource.id\"\n\t\t\t\t:title=\"resource.name\"\n\t\t\t\t:to=\"getComponent(resource).to\"\n\t\t\t\t:href=\"getComponent(resource).href\"\n\t\t\t\t:class=\"typeClass(resource)\">\n\t\t\t\t<img :src=\"iconUrl(resource)\" :alt=\"resource.name\">\n\t\t\t</component>\n\t\t</div>\n\n\t\t<span v-if=\"newName === null\" class=\"sharingOptionsGroup\">\n\t\t\t<NcActions>\n\t\t\t\t<NcActionButton\n\t\t\t\t\ticon=\"icon-info\"\n\t\t\t\t\t@click.prevent=\"toggleDetails\">\n\t\t\t\t\t{{ detailsOpen ? t('Hide details') : t('Show details') }}\n\t\t\t\t</NcActionButton>\n\t\t\t\t<NcActionButton\n\t\t\t\t\ticon=\"icon-rename\"\n\t\t\t\t\t@click.prevent=\"openRename\">\n\t\t\t\t\t{{ t('Rename project') }}\n\t\t\t\t</NcActionButton>\n\t\t\t</NcActions>\n\t\t</span>\n\n\t\t<transition name=\"fade\">\n\t\t\t<div v-if=\"error\" class=\"error\">\n\t\t\t\t{{ error }}\n\t\t\t</div>\n\t\t</transition>\n\t\t<transition name=\"fade\">\n\t\t\t<ul v-if=\"detailsOpen\" class=\"resource-list-details\">\n\t\t\t\t<li\n\t\t\t\t\tv-for=\"resource in resources\"\n\t\t\t\t\t:key=\"resource.type + '|' + resource.id\"\n\t\t\t\t\t:class=\"typeClass(resource)\">\n\t\t\t\t\t<component\n\t\t\t\t\t\t:is=\"getComponent(resource).component\"\n\t\t\t\t\t\t:to=\"getComponent(resource).to\"\n\t\t\t\t\t\t:href=\"getComponent(resource).href\">\n\t\t\t\t\t\t<img :src=\"iconUrl(resource)\" :alt=\"resource.name\">\n\t\t\t\t\t\t<span class=\"resource-name\">{{ resource.name || '' }}</span>\n\t\t\t\t\t</component>\n\t\t\t\t\t<span class=\"icon-close\" @click=\"removeResource(collection, resource)\" />\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</transition>\n\t</li>\n</template>\n\n<script>\nimport { t } from '../../l10n.ts'\nimport NcActionButton from '../NcActionButton/index.js'\nimport NcActions from '../NcActions/index.js'\nimport NcAvatar from '../NcAvatar/index.js'\nimport { getRoute } from '../NcRichText/autolink.ts'\n\nexport default {\n\tname: 'NcCollectionListItem',\n\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcActions,\n\t\tNcActionButton,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The collection\n\t\t */\n\t\tcollection: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Current error if any\n\t\t */\n\t\terror: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\temits: [\n\t\t'removeResource',\n\t\t'renameCollection',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tdetailsOpen: false,\n\t\t\tnewName: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tgetIcon() {\n\t\t\treturn (resource) => [resource.iconClass]\n\t\t},\n\n\t\ttypeClass() {\n\t\t\treturn (resource) => 'resource-type-' + resource.type\n\t\t},\n\n\t\tresources() {\n\t\t\t// invalid resources come from server as empty array ([]) and not an object\n\t\t\treturn this.collection.resources?.filter((resource) => !Array.isArray(resource)) ?? []\n\t\t},\n\n\t\tgetComponent() {\n\t\t\treturn (resource) => {\n\t\t\t\tconst route = getRoute(this.$router, resource.link)\n\n\t\t\t\treturn route\n\t\t\t\t\t? { component: 'router-link', to: route, href: undefined }\n\t\t\t\t\t: { component: 'a', to: undefined, href: resource.link }\n\t\t\t}\n\t\t},\n\n\t\ticonUrl() {\n\t\t\treturn (resource) => {\n\t\t\t\tif (resource.mimetype) {\n\t\t\t\t\treturn OC.MimeType.getIconUrl(resource.mimetype)\n\t\t\t\t}\n\t\t\t\tif (resource.iconUrl) {\n\t\t\t\t\treturn resource.iconUrl\n\t\t\t\t}\n\t\t\t\treturn ''\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\ttoggleDetails() {\n\t\t\tthis.detailsOpen = !this.detailsOpen\n\t\t},\n\n\t\tshowDetails() {\n\t\t\tthis.detailsOpen = true\n\t\t},\n\n\t\tremoveResource(collection, resource) {\n\t\t\tthis.$emit('removeResource', {\n\t\t\t\tcollectionId: collection.id,\n\t\t\t\tresourceType: resource.type,\n\t\t\t\tresourceId: resource.id,\n\t\t\t})\n\t\t},\n\n\t\topenRename() {\n\t\t\tthis.newName = this.collection.name\n\t\t},\n\n\t\trenameCollection() {\n\t\t\tif (this.newName) {\n\t\t\t\tthis.$emit('renameCollection', {\n\t\t\t\t\tcollectionId: this.collection.id,\n\t\t\t\t\tname: this.newName,\n\t\t\t\t})\n\t\t\t}\n\t\t\tthis.newName = null\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.fade-enter-active, .fade-leave-active {\n\ttransition: opacity .3s ease;\n}\n\n.fade-enter, .fade-leave-to\n\t/* .fade-leave-active below version 2.1.8 */\n{\n\topacity: 0;\n}\n\n.linked-icons {\n\tdisplay: flex;\n\n\timg {\n\t\tpadding: 12px;\n\t\theight: var(--default-clickable-area);\n\t\tdisplay: block;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t\topacity: 0.7;\n\n\t\t&:hover {\n\t\t\topacity: 1;\n\t\t}\n\t}\n}\n\n.popovermenu {\n\tdisplay: none;\n\n\t&.open {\n\t\tdisplay: block;\n\t}\n}\n\nli.collection-list-item {\n\tflex-wrap: wrap;\n\theight: auto;\n\tcursor: pointer;\n\tmargin-bottom: 0 !important;\n\n\t.collection-avatar {\n\t\tmargin-top: 0;\n\t}\n\n\tform, .collection-item-name {\n\t\tflex-basis: 10%;\n\t\tflex-grow: 1;\n\t\tdisplay: flex;\n\t}\n\n\t.collection-item-name {\n\t\tpadding: 12px 9px;\n\t}\n\n\tinput {\n\t\tmargin-top: 4px;\n\t\tborder-color: var(--color-border-maxcontrast);\n\n\t\t&[type=text] {\n\t\t\tflex-grow: 1;\n\t\t}\n\t}\n\n\t.error {\n\t\tflex-basis: 100%;\n\t\twidth: 100%;\n\t}\n\n\t.resource-list-details {\n\t\tflex-basis: 100%;\n\t\twidth: 100%;\n\n\t\tli {\n\t\t\tdisplay: flex;\n\t\t\tmargin-inline-start: var(--default-clickable-area);\n\t\t\tborder-radius: 3px;\n\t\t\tcursor: pointer;\n\n\t\t\t&:hover {\n\t\t\t\tbackground-color: var(--color-background-dark);\n\t\t\t}\n\n\t\t\ta {\n\t\t\t\tflex-grow: 1;\n\t\t\t\tpadding: 3px;\n\t\t\t\tmax-width: calc(100% - 30px);\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\tspan {\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: top;\n\t\t\tmargin-inline-end: 10px;\n\t\t}\n\n\t\tspan.resource-name {\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\tposition: relative;\n\t\t\tvertical-align: top;\n\t\t\twhite-space: nowrap;\n\t\t\tflex-grow: 1;\n\t\t\tpadding: 4px;\n\t\t}\n\n\t\timg {\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t}\n\n\t\t.icon-close {\n\t\t\topacity: .7;\n\n\t\t\t&:hover, &:focus {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n.should-shake {\n\tanimation: shake 0.6s 1 linear;\n}\n\n@keyframes shake {\n\t0% {\n\t\ttransform: translate(15px);\n\t}\n\t20% {\n\t\ttransform: translate(-15px);\n\t}\n\t40% {\n\t\ttransform: translate(7px);\n\t}\n\t60% {\n\t\ttransform: translate(-7px);\n\t}\n\t80% {\n\t\ttransform: translate(3px);\n\t}\n\t100% {\n\t\ttransform: translate(0px);\n\t}\n}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { OCSResponse } from '@nextcloud/typings/ocs'\n\nimport axios, { type AxiosResponse } from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\n/**\n * Extracts the OCS data from a response\n *\n * @param response OCS response\n */\nfunction extractOcsData(response: AxiosResponse<OCSResponse>) {\n\treturn response.data.ocs.data\n}\n\n/**\n * Lists all collections\n *\n * @param collectionId Collection ID\n */\nexport function listCollectionService(collectionId: number) {\n\treturn axios.get(generateOcsUrl('collaboration/resources/collections/{collectionId}', { collectionId })).then(extractOcsData)\n}\n\n/**\n * Renames a collection\n *\n * @param collectionId Collection ID\n * @param collectionName New collection name\n */\nexport function renameCollectionService(collectionId: number, collectionName: string) {\n\treturn axios.put(generateOcsUrl('collaboration/resources/collections/{collectionId}', { collectionId }), { collectionName }).then(extractOcsData)\n}\n\n/**\n * Lists all collections for a resource\n *\n * @param resourceType Resource type\n * @param resourceId Resource ID\n */\nexport function getCollectionsByResourceService(resourceType: string, resourceId: string) {\n\treturn axios.get(generateOcsUrl('collaboration/resources/{resourceType}/{resourceId}', { resourceType, resourceId })).then(extractOcsData)\n}\n\n/**\n * Creates a collection\n *\n * @param resourceType Resource type\n * @param resourceId Resource ID\n * @param name Collection name\n */\nexport function createCollectionService(resourceType: string, resourceId: string, name: string) {\n\treturn axios.post(generateOcsUrl('collaboration/resources/{resourceType}/{resourceId}', { resourceType, resourceId }), { name }).then(extractOcsData)\n}\n\n/**\n * Adds a resource to a collection\n *\n * @param collectionId Collection ID\n * @param resourceType Resource type\n * @param resourceId Resource ID\n */\nexport function addResourceService(collectionId: number, resourceType: string, resourceId: string) {\n\treturn axios.post(generateOcsUrl('collaboration/resources/collections/{collectionId}', { collectionId }), { resourceType, resourceId }).then(extractOcsData)\n}\n\n/**\n * Removes a resource from a collection\n *\n * @param collectionId Collection ID\n * @param resourceType Resource type\n * @param resourceId Resource ID\n */\nexport function removeResourceService(collectionId: number, resourceType: string, resourceId: string) {\n\treturn axios.delete(generateOcsUrl('collaboration/resources/collections/{collectionId}', { collectionId }), { params: { resourceType, resourceId } }).then(extractOcsData)\n}\n\n/**\n * Searches for collections\n *\n * @param query Search query\n */\nexport function searchService(query: string) {\n\treturn axios.get(generateOcsUrl('collaboration/resources/collections/search/{query}', { query })).then(extractOcsData)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { ref } from 'vue'\nimport {\n\taddResourceService,\n\tcreateCollectionService,\n\tgetCollectionsByResourceService,\n\tremoveResourceService,\n\trenameCollectionService,\n} from './service.ts'\n\n/**\n * Use collections composable\n */\nexport function useCollections() {\n\t// State\n\tconst storedCollections = ref([])\n\n\t// Mutations\n\tconst addCollections = (collections) => {\n\t\tstoredCollections.value = collections\n\t}\n\n\tconst addCollection = (collection) => {\n\t\tstoredCollections.value.push(collection)\n\t}\n\n\tconst removeCollection = (collectionId) => {\n\t\tstoredCollections.value = storedCollections.value.filter((item) => item.id !== collectionId)\n\t}\n\n\tconst updateCollection = (collection) => {\n\t\tconst index = storedCollections.value.findIndex((item) => item.id === collection.id)\n\t\tif (index !== -1) {\n\t\t\tstoredCollections.value[index] = collection\n\t\t} else {\n\t\t\taddCollection(collection)\n\t\t}\n\t}\n\n\t// Actions\n\tconst fetchCollectionsByResource = async ({ resourceType, resourceId }) => {\n\t\tconst collections = await getCollectionsByResourceService(resourceType, resourceId)\n\n\t\taddCollections(collections)\n\t}\n\n\tconst createCollection = async ({ baseResourceType, baseResourceId, resourceType, resourceId, name }) => {\n\t\tconst collection = await createCollectionService(baseResourceType, baseResourceId, name)\n\n\t\taddCollection(collection)\n\t\tawait addResourceToCollection({\n\t\t\tcollectionId: collection.id,\n\t\t\tresourceType,\n\t\t\tresourceId,\n\t\t})\n\t}\n\n\tconst renameCollection = async ({ collectionId, name }) => {\n\t\tconst collection = await renameCollectionService(collectionId, name)\n\n\t\tupdateCollection(collection)\n\t}\n\n\t/**\n\t * @param {*} param0\n\t */\n\tasync function addResourceToCollection({ collectionId, resourceType, resourceId }) {\n\t\tconst collection = await addResourceService(collectionId, resourceType, String(resourceId))\n\n\t\tupdateCollection(collection)\n\t}\n\n\tconst removeResourceFromCollection = async ({ collectionId, resourceType, resourceId }) => {\n\t\tconst collection = await removeResourceService(collectionId, resourceType, String(resourceId))\n\n\t\tif (collection.resources.length > 0) {\n\t\t\tupdateCollection(collection)\n\t\t} else {\n\t\t\tremoveCollection(collectionId)\n\t\t}\n\t}\n\n\treturn {\n\t\tstoredCollections,\n\t\tfetchCollectionsByResource,\n\t\tcreateCollection,\n\t\trenameCollection,\n\t\taddResourceToCollection,\n\t\tremoveResourceFromCollection,\n\t}\n}\n","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\nProvides a Vue standalone component for Nextcloud Projects feature introduced in Nextcloud 16. Replaces deprecated `nextcloud-vue-collections` library.\n\nProjects feature is deprecated since Nextcloud 25, and superseded by Related resources. See [NcRelatedResourcesPanel](#/Components/NcRelatedResourcesPanel) documentation for more information.\n\n### Usage\n\nTo enable feature in Nextcloud, run following command:\n```sh\nocc config:system:set --value true 'projects.enabled'\n```\n</docs>\n\n<template>\n\t<ul v-if=\"collections && type && id\" id=\"collection-list\" class=\"collection-list\">\n\t\t<li @click=\"showSelect\">\n\t\t\t<div class=\"avatar\">\n\t\t\t\t<span class=\"icon-projects\" />\n\t\t\t</div>\n\t\t\t<div id=\"collection-select-container\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tref=\"select\"\n\t\t\t\t\tv-model=\"value\"\n\t\t\t\t\t:aria-label-combobox=\"t('Add to a project')\"\n\t\t\t\t\t:options=\"options\"\n\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\tlabel=\"title\"\n\t\t\t\t\t:limit=\"5\"\n\t\t\t\t\t@close=\"isSelectOpen = false\"\n\t\t\t\t\t@open=\"isSelectOpen = true\"\n\t\t\t\t\t@option:selected=\"select\"\n\t\t\t\t\t@search=\"search\">\n\t\t\t\t\t<template #selected-option=\"option\">\n\t\t\t\t\t\t<span class=\"option__desc\">\n\t\t\t\t\t\t\t<span class=\"option__title\">{{ option.title }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<template #option=\"option\">\n\t\t\t\t\t\t<span class=\"option__wrapper\">\n\t\t\t\t\t\t\t<span v-if=\"option.class\" :class=\"option.class\" class=\"avatar\" />\n\t\t\t\t\t\t\t<NcAvatar v-else-if=\"option.method !== 2\" allow-placeholder :display-name=\"option.title\" />\n\t\t\t\t\t\t\t<span class=\"option__title\">{{ option.title }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<p class=\"hint\">\n\t\t\t\t\t\t{{ t('Connect items to a project to make them easier to find') }}\n\t\t\t\t\t</p>\n\t\t\t\t</NcSelect>\n\t\t\t</div>\n\t\t</li>\n\t\t<transition name=\"fade\">\n\t\t\t<li v-if=\"error\" class=\"error\">\n\t\t\t\t{{ error }}\n\t\t\t</li>\n\t\t</transition>\n\t\t<NcCollectionListItem\n\t\t\tv-for=\"collection in collections\"\n\t\t\t:key=\"collection.id\"\n\t\t\t:collection=\"collection\"\n\t\t\t:error=\"collectionsError[collection.id]\"\n\t\t\t@rename-collection=\"renameCollectionFromItem\"\n\t\t\t@remove-resource=\"removeResourceFromCollection\" />\n\t</ul>\n</template>\n\n<script>\nimport debounce from 'debounce'\nimport { ref } from 'vue'\nimport NcCollectionListItem from './NcCollectionListItem.vue'\nimport { t } from '../../l10n.ts'\nimport { logger } from '../../utils/logger.ts'\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcSelect from '../NcSelect/index.js'\nimport { searchService } from './service.ts'\nimport { useCollections } from './useCollections.js'\n\nconst METHOD_CREATE_COLLECTION = 0\nconst METHOD_ADD_TO_COLLECTION = 1\n\nexport default {\n\tname: 'NcCollectionList',\n\n\tcomponents: {\n\t\tNcCollectionListItem,\n\t\tNcAvatar,\n\t\tNcSelect,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Resource type identifier\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Unique id of the resource\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Name of the resource\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Whether the component is active (to start fetch resources)\n\t\t */\n\t\tisActive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst {\n\t\t\tstoredCollections,\n\t\t\tfetchCollectionsByResource,\n\t\t\tcreateCollection,\n\t\t\taddResourceToCollection,\n\t\t\tremoveResourceFromCollection,\n\t\t\trenameCollection,\n\t\t} = useCollections()\n\n\t\tconst searchCollections = ref([])\n\t\tconst search = debounce(function(query, loading) {\n\t\t\tif (query !== '') {\n\t\t\t\tloading(true)\n\t\t\t\tsearchService(query).then((collections) => {\n\t\t\t\t\tsearchCollections.value = collections\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tlogger.error('Failed to search for collections', { error })\n\t\t\t\t}).finally(() => {\n\t\t\t\t\tloading(false)\n\t\t\t\t})\n\t\t\t}\n\t\t}, 500)\n\n\t\treturn {\n\t\t\tstoredCollections,\n\t\t\tfetchCollectionsByResource,\n\t\t\tcreateCollection,\n\t\t\taddResourceToCollection,\n\t\t\tremoveResourceFromCollection,\n\t\t\trenameCollection,\n\t\t\tsearchCollections,\n\t\t\tsearch,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tselectIsOpen: false,\n\t\t\tgeneratingCodes: false,\n\t\t\tcodes: undefined,\n\t\t\tvalue: null,\n\t\t\tmodel: {},\n\t\t\tcollectionsError: {},\n\t\t\terror: null,\n\t\t\tisSelectOpen: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcollections() {\n\t\t\treturn this.storedCollections.filter((collection) => collection.resources\n\t\t\t\t.some((resource) => resource && resource.id === String(this.id) && resource.type === this.type))\n\t\t},\n\n\t\tplaceholder() {\n\t\t\treturn this.isSelectOpen\n\t\t\t\t? t('Type to search for existing projects')\n\t\t\t\t: t('Add to a project')\n\t\t},\n\n\t\toptions() {\n\t\t\tconst options = []\n\t\t\twindow.OCP.Collaboration.getTypes().sort().forEach((type) => {\n\t\t\t\toptions.push({\n\t\t\t\t\tmethod: METHOD_CREATE_COLLECTION,\n\t\t\t\t\ttype,\n\t\t\t\t\ttitle: window.OCP.Collaboration.getLabel(type),\n\t\t\t\t\tclass: window.OCP.Collaboration.getIcon(type),\n\t\t\t\t\taction: () => window.OCP.Collaboration.trigger(type),\n\t\t\t\t})\n\t\t\t})\n\t\t\tfor (const index in this.searchCollections) {\n\t\t\t\tif (!this.collections.find((collection) => collection.id === this.searchCollections[index].id)) {\n\t\t\t\t\toptions.push({\n\t\t\t\t\t\tmethod: METHOD_ADD_TO_COLLECTION,\n\t\t\t\t\t\ttitle: this.searchCollections[index].name,\n\t\t\t\t\t\tcollectionId: this.searchCollections[index].id,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn options\n\t\t},\n\n\t\tresourceIdentifier() {\n\t\t\treturn {\n\t\t\t\tresourceType: this.type,\n\t\t\t\tresourceId: this.id,\n\t\t\t\tisActive: this.isActive,\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tresourceIdentifier: {\n\t\t\tdeep: true,\n\t\t\timmediate: true,\n\t\t\thandler(resourceIdentifier) {\n\t\t\t\tif (!resourceIdentifier.isActive || !resourceIdentifier.resourceId || !resourceIdentifier.resourceType) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.fetchCollectionsByResource(resourceIdentifier)\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\tselect(selectedOption) {\n\t\t\tif (selectedOption.method === METHOD_CREATE_COLLECTION) {\n\t\t\t\tselectedOption.action().then((resourceId) => {\n\t\t\t\t\tthis.createCollection({\n\t\t\t\t\t\tbaseResourceType: this.type,\n\t\t\t\t\t\tbaseResourceId: this.id,\n\t\t\t\t\t\tresourceType: selectedOption.type,\n\t\t\t\t\t\tresourceId,\n\t\t\t\t\t\tname: this.name,\n\t\t\t\t\t}).catch((e) => {\n\t\t\t\t\t\tthis.setError(t('Failed to create a project'), e)\n\t\t\t\t\t})\n\t\t\t\t}).catch((e) => {\n\t\t\t\t\tlogger.error('[NcCollectionList] No resource selected', e)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif (selectedOption.method === METHOD_ADD_TO_COLLECTION) {\n\t\t\t\tthis.addResourceToCollection({\n\t\t\t\t\tcollectionId: selectedOption.collectionId, resourceType: this.type, resourceId: this.id,\n\t\t\t\t}).catch((e) => {\n\t\t\t\t\tthis.setError(t('Failed to add the item to the project'), e)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tthis.value = null\n\t\t},\n\n\t\tshowSelect() {\n\t\t\tthis.selectIsOpen = true\n\t\t\tthis.$refs.select.$el.focus()\n\t\t},\n\n\t\tsetError(error, e) {\n\t\t\tlogger.error(error, { error: e })\n\t\t\tthis.error = error\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.error = null\n\t\t\t}, 5000)\n\t\t},\n\n\t\trenameCollectionFromItem({ collectionId, name }) {\n\t\t\tthis.renameCollection({ collectionId, name })\n\t\t\t\t.catch((e) => {\n\t\t\t\t\tlogger.error(t('Failed to rename the project'), { error: e })\n\t\t\t\t\tthis.collectionsError[collectionId] = t('Failed to rename the project')\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.collectionsError[collectionId] = null\n\t\t\t\t\t}, 5000)\n\t\t\t\t})\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.collection-list * {\n\tbox-sizing: border-box;\n}\n\n.collection-list > li {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\n\t& > .avatar {\n\t\tmargin-top: 0;\n\t}\n}\n\n#collection-select-container {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.v-select {\n\t// NcAvatar in the dropdown\n\tspan.avatar {\n\t\tdisplay: block;\n\t\tpadding: 16px;\n\t\topacity: .7;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\n\t\t&:hover {\n\t\t\topacity: 1;\n\t\t}\n\t}\n}\n\np.hint {\n\tz-index: 1;\n\t// fix alignment\n\tmargin-top: -16px;\n\tpadding: 8px 8px;\n\tcolor: var(--color-text-maxcontrast);\n\tline-height: normal;\n}\n\ndiv.avatar {\n\twidth: 32px;\n\theight: 32px;\n\tmargin: 0;\n\tpadding: 8px;\n\tbackground-color: var(--color-background-dark);\n\tmargin-top: 30px;\n}\n\n/** TODO provide white icon in core */\n.icon-projects {\n\tdisplay: block;\n\tpadding: 8px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: center;\n}\n\n.option__wrapper {\n\tdisplay: flex;\n\n\t.avatar {\n\t\tdisplay: block;\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tbackground-color: var(--color-background-darker) !important;\n\t}\n\n\t.option__title {\n\t\tpadding: 4px;\n\t}\n}\n\n.fade-enter-active, .fade-leave-active {\n\ttransition: opacity .5s;\n}\n\n.fade-enter, .fade-leave-to {\n\topacity: 0;\n}\n\n</style>\n"],"names":["_sfc_main","_hoisted_1","_hoisted_8","_openBlock","_createElementBlock","_createVNode","_toDisplayString","_createElementVNode","_hoisted_2","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_normalizeClass","_hoisted_4","_Transition","_hoisted_5","_hoisted_6","_withCtx"],"mappings":";;;;;;;;;;;;;AAiFA,MAAKA,cAAU;AAAA,EACd,MAAM;AAAA,EAEN,YAAY;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA;EAGD,OAAO;AAAA;AAAA;AAAA;AAAA,IAIN,YAAY;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMV,OAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA;;EAIX,OAAO;AAAA,IACN;AAAA,IACA;AAAA;EAGD,OAAO;AACN,WAAO;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACV;AAAA,EACD;AAAA,EAEA,UAAU;AAAA,IACT,UAAU;AACT,aAAO,CAAC,aAAa,CAAC,SAAS,SAAS;AAAA,IACzC;AAAA,IAEA,YAAY;AACX,aAAO,CAAC,aAAa,mBAAmB,SAAS;AAAA,IAClD;AAAA,IAEA,YAAY;AAEX,aAAO,KAAK,WAAW,WAAW,OAAO,CAAC,aAAa,CAAC,MAAM,QAAQ,QAAQ,CAAC,KAAK,CAAA;AAAA,IACrF;AAAA,IAEA,eAAe;AACd,aAAO,CAAC,aAAa;AACpB,cAAM,QAAQ,SAAS,KAAK,SAAS,SAAS,IAAI;AAElD,eAAO,QACJ,EAAE,WAAW,eAAe,IAAI,OAAO,MAAM,OAAQ,IACrD,EAAE,WAAW,KAAK,IAAI,QAAW,MAAM,SAAS,KAAG;AAAA,MACvD;AAAA,IACD;AAAA,IAEA,UAAU;AACT,aAAO,CAAC,aAAa;AACpB,YAAI,SA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OAAO,WAAM,kBAAlCF,YAA2F,qBAAA;AAAA;gBAAjD,qBAAA;AAAA,gBAAmB,gBAAc,OAAO;AAAA;cAClFJ,mBAAqD,QAArD,YAAqDD,gBAAtB,OAAO,KAAK,GAAA,CAAA;AAAA;;2BAG7C,MAEI;AAAA,YAFJC,mBAEI,KAFJ,YAEID,gBADA,SAAA,EAAC,wDAAA,CAAA,GAAA,CAAA;AAAA;;;;;IAKRD,YAIaU,YAAA,EAJD,MAAK,OAAM,GAAA;AAAA,uBACtB,MAEK;AAAA,QAFK,MAAA,sBAAVX,mBAEK,MAFL,YAEKE,gBADD,MAAA,KAAK,GAAA,CAAA;;;;sBAGVF,mBAMmDK,UAAA,MAAAC,WAL7B,SAAA,aAAW,CAAzB,eAAU;0BADlBC,YAMmD,iCAAA;AAAA,QAJjD,KAAK,WAAW;AAAA,QAChB;AAAA,QACA,OAAO,MAAA,iBAAiB,WAAW,EAAE;AAAA,QACrC,oBAAmB,SAAA;AAAA,QACnB,kBAAiB,OAAA;AAAA;;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import '../assets/NcColorPicker-CO_Jq2Ow.css';
|
|
2
2
|
import { defineComponent, mergeModels, useModel, ref, computed, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createVNode, createElementBlock, createCommentVNode, Transition, Fragment, renderList, normalizeStyle, createTextVNode, toDisplayString, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
3
3
|
import { Chrome } from "@ckpack/vue-color";
|
|
4
|
-
import { d as mdiCheck,
|
|
5
|
-
import { r as register, a as t } from "./_l10n-
|
|
6
|
-
import { d as defaultPalette, a as COLOR_BLACK, b as COLOR_WHITE } from "./colors-
|
|
4
|
+
import { d as mdiCheck, q as mdiCloseCircleOutline, r as mdiArrowLeft, s as mdiDotsHorizontal } from "./mdi-DvQxv1t7.mjs";
|
|
5
|
+
import { r as register, w as t1, a as t } from "./_l10n-CgsPi8nC.mjs";
|
|
6
|
+
import { d as defaultPalette, a as COLOR_BLACK, b as COLOR_WHITE } from "./colors-CL_wvNtd.mjs";
|
|
7
7
|
import { c as createElementId } from "./createElementId-DhjFt1I9.mjs";
|
|
8
8
|
import { l as logger } from "./logger-D3RVzcfQ.mjs";
|
|
9
|
-
import { N as NcButton } from "./NcButton-
|
|
9
|
+
import { N as NcButton } from "./NcButton-CzpKEx4V.mjs";
|
|
10
10
|
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-BvLanNaW.mjs";
|
|
11
11
|
import { N as NcPopover } from "./NcPopover-C-MTaPCs.mjs";
|
|
12
12
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
13
|
-
register();
|
|
13
|
+
register(t1);
|
|
14
14
|
const _hoisted_1 = ["aria-label"];
|
|
15
15
|
const _hoisted_2 = {
|
|
16
16
|
key: 0,
|
|
@@ -220,4 +220,4 @@ const NcColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "dat
|
|
|
220
220
|
export {
|
|
221
221
|
NcColorPicker as N
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=NcColorPicker-
|
|
223
|
+
//# sourceMappingURL=NcColorPicker-DpSDaGrh.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcColorPicker-Kc0JqRtp.mjs","sources":["../../src/components/NcColorPicker/NcColorPicker.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### General description\n\nThis component allows the user to choose a color. It consists of 2\nactual pickers:\n\n- One simple picker with a predefined palette of colors;\n- One more advanced picker that provides the full color spectrum;\n\n### Usage\n\n* Using v-model and passing in an HTML element that will be treated as a trigger:\n\n```vue\n<template>\n\t<div class=\"container0\">\n\t\t<NcColorPicker v-model=\"color\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcColorPicker>\n\t\t<NcColorPicker v-model=\"color\" :palette=\"customPalette\">\n\t\t\t<NcButton> Click Me for a custom palette </NcButton>\n\t\t</NcColorPicker>\n\t\t<div :style=\"{'background-color': color}\" class=\"color0\" />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9',\n\t\t\tcustomPalette: [\n\t\t\t\t'#E40303',\n\t\t\t\t'#FF8C00',\n\t\t\t\t'#FFED00',\n\t\t\t\t'#008026',\n\t\t\t\t'#24408E',\n\t\t\t\t'#732982',\n\t\t\t\t'#5BCEFA',\n\t\t\t\t'#F5A9B8',\n\t\t\t\t'#FFFFFF',\n\t\t\t\t'#F5A9B8',\n\t\t\t\t'#5BCEFA',\n\t\t\t],\n\t\t}\n\t}\n}\n</script>\n<style>\n.container0 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color0 {\n\twidth: 100px;\n\theight: 34px;\n\tborder-radius: 6px;\n}\n</style>\n```\n\n* Using v-model for both color and open state and emitting an event that updates the color\n\n```vue\n<template>\n\t<div class=\"container1\">\n\t\t<NcButton @click=\"open = !open\"> Click Me </NcButton>\n\t\t<NcColorPicker v-model=\"color\" v-model:open=\"open\" v-slot=\"{ attrs }\">\n\t\t\t<div v-bind=\"attrs\" :style=\"{'background-color': color}\" class=\"color1\" />\n\t\t</NcColorPicker>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9',\n\t\t\topen: false\n\t\t}\n\t}\n}\n</script>\n<style>\n.container1 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color1 {\n\twidth: 100px;\n\theight: 34px;\n\tborder-radius: 6px;\n}\n</style>\n```\n\n* Allowing to clear the selected color\n\n```vue\n<template>\n\t<div class=\"container1\">\n\t\t<NcColorPicker clearable v-model=\"color\">\n\t\t\t<NcButton>Click Me</NcButton>\n\t\t</NcColorPicker>\n\t\t<div :style=\"{'background-color': color}\" class=\"color-preview\" :class=\"{'color-preview--none': !color}\" />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9',\n\t\t\topen: false\n\t\t}\n\t}\n}\n</script>\n<style scoped>\n.container1 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color-preview {\n\twidth: 100px;\n\theight: 34px;\n\tborder: 1px solid black;\n\tborder-radius: 6px;\n}\n\n.color-preview--none {\n\tbackground: repeating-conic-gradient(#808080 0 25%, #0000 0 50%) 50% / 20px 20px;\n}\n</style>\n```\n\n* Using advanced fields including HEX, RGB, and HSL:\n\n```vue\n<template>\n\t<div class=\"container0\">\n\t\t<NcColorPicker v-model=\"color\"\n\t\t\t:advanced-fields=\"true\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcColorPicker>\n\t\t<div :style=\"{'background-color': color}\" class=\"color0\" />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9'\n\t\t}\n\t}\n}\n</script>\n<style>\n.container0 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color0 {\n\twidth: 100px;\n\theight: 34px;\n\tborder-radius: 6px;\n}\n</style>\n```\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Payload } from '@ckpack/vue-color'\nimport type { Color } from '../../utils/colors.ts'\n\nimport { Chrome as VueChrome } from '@ckpack/vue-color'\nimport { mdiArrowLeft, mdiCheck, mdiCloseCircleOutline, mdiDotsHorizontal } from '@mdi/js'\nimport { computed, ref } from 'vue'\nimport { t } from '../../l10n.ts'\nimport { COLOR_BLACK, COLOR_WHITE, defaultPalette } from '../../utils/colors.ts'\nimport { createElementId } from '../../utils/createElementId.ts'\nimport { logger } from '../../utils/logger.ts'\nimport NcButton from '../NcButton/index.ts'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/index.ts'\nimport NcPopover from '../NcPopover/index.js'\n\n/**\n * A HEX color that represents the initial value of the picker.\n *\n * If the `clearable` prop is set then also `undefined` might be given or emitted for when the color gets cleared.\n */\nconst currentColor = defineModel<string | undefined>({ required: true })\n\n/**\n * The open state of the color picker.\n */\nconst open = defineModel<boolean>('open')\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * Set to `true` to enable advanced fields including HEX, RGB, and HSL\n\t */\n\tadvancedFields?: boolean\n\n\t/**\n\t * Allow to clear the current color.\n\t * When set the `update:modelValue` and `submit` event might emit also `undefined`.\n\t */\n\tclearable?: boolean\n\n\t/**\n\t * Selector for the popover container\n\t */\n\tcontainer?: string | Element\n\n\t/**\n\t * Provide a custom array of colors to show.\n\t * Can be either an array of string hexadecimal colors,\n\t * or an array of object with a `color` property with hexadecimal color string,\n\t * and a `name` property for accessibility.\n\t *\n\t * @type {string[] | {color: string, name: string}[]}\n\t */\n\tpalette?: string[] | Color[]\n\n\t/**\n\t * Limit selectable colors to only the provided palette\n\t */\n\tpaletteOnly?: boolean\n}>(), {\n\tcontainer: 'body',\n\tpalette: () => [],\n})\n\nconst emit = defineEmits<{\n\t/**\n\t * Emitted when the submit button was pressed.\n\t * The payload is the same as the current modelValue.\n\t *\n\t * The value might be undefined if the `clearable` prop is set.\n\t */\n\tsubmit: [string | undefined]\n\n\t/**\n\t * The color picker was fully closed and all transitions are finished.\n\t */\n\tclosed: []\n}>()\n\nconst HEX_REGEX = /^#([a-f0-9]{3}|[a-f0-9]{6})$/i\n\n/**\n * Unique id used to identify different color pickers\n */\nconst id = createElementId()\n\n/**\n * Is the advanced picker is open\n */\nconst advanced = ref(false)\n\n/**\n * Normalized palette by converting array of hex colors to color objects.\n * This also ensures there is a default palette if needed (no palette passed).\n */\nconst normalizedPalette = computed(() => {\n\tlet palette = props.palette\n\tfor (const color of palette) {\n\t\tif ((typeof color === 'string' && !color.match(HEX_REGEX))\n\t\t\t|| (typeof color === 'object' && !color.color?.match(HEX_REGEX))) {\n\t\t\tlogger.error('[NcColorPicker] Invalid palette passed', { color })\n\t\t\tpalette = []\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (palette.length === 0) {\n\t\tpalette = props.clearable\n\t\t\t? [...defaultPalette, COLOR_BLACK, COLOR_WHITE]\n\t\t\t: [...defaultPalette]\n\t}\n\n\treturn palette.map((item: Color | string) => ({\n\t\tcolor: typeof item === 'object' ? item.color : item,\n\t\tname: typeof item === 'object' && item.name\n\t\t\t? item.name\n\t\t\t: t('A color with a HEX value {hex}', { hex: typeof item === 'string' ? item : item.color }),\n\t}))\n})\n\n/**\n * Submit a picked colour and close picker\n *\n * @param hideCallback - callback to close popover\n */\nfunction handleConfirm(hideCallback: () => void) {\n\temit('submit', currentColor.value)\n\thideCallback()\n\tadvanced.value = false\n}\n\n/**\n * Toggle the currently selected palette color.\n *\n * @param color - The color to toggle\n */\nfunction toggleColor(color: string | Color) {\n\tcolor = typeof color === 'string' ? color : color.color\n\n\tif (props.clearable && currentColor.value === color) {\n\t\tcurrentColor.value = undefined\n\t} else {\n\t\tcurrentColor.value = color\n\t}\n}\n\n/**\n * @param color - The picked color from the Chrome component\n */\nfunction pickCustomColor(color: Payload): void {\n\tcurrentColor.value = color.hex\n}\n\n/**\n * Get the text color with the most constrast for a given background color.\n *\n * @param color - The background color\n */\nfunction getContrastColor(color: string): string {\n\treturn calculateLuma(color) > 0.5\n\t\t? COLOR_BLACK.color\n\t\t: COLOR_WHITE.color\n}\n\n/**\n * Calculate luminance of provided hex color\n *\n * @param color - The hex color\n */\nfunction calculateLuma(color: string) {\n\tconst [red, green, blue] = hexToRGB(color)\n\treturn (0.2126 * red + 0.7152 * green + 0.0722 * blue) / 255\n}\n\n/**\n * Convert hex color to RGB\n *\n * @param hex - The hex color\n */\nfunction hexToRGB(hex: string): [number, number, number] {\n\tconst result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)\n\tif (!result) {\n\t\treturn [0, 0, 0]\n\t}\n\n\treturn [parseInt(result[1]!, 16), parseInt(result[2]!, 16), parseInt(result[3]!, 16)]\n}\n</script>\n\n<template>\n\t<NcPopover\n\t\tv-model:shown=\"open\"\n\t\t:container=\"container\"\n\t\tpopup-role=\"dialog\"\n\t\t@apply-hide=\"emit('closed')\">\n\t\t<template #trigger=\"slotProps\">\n\t\t\t<slot v-bind=\"slotProps\" />\n\t\t</template>\n\t\t<template #default=\"slotProps\">\n\t\t\t<div\n\t\t\t\trole=\"dialog\"\n\t\t\t\tclass=\"color-picker\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\t:aria-label=\"t('Color picker')\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'color-picker--advanced-fields': advanced && advancedFields,\n\t\t\t\t\t'color-picker--clearable': clearable,\n\t\t\t\t}\">\n\t\t\t\t<Transition name=\"slide\" mode=\"out-in\">\n\t\t\t\t\t<div v-if=\"!advanced\" class=\"color-picker__simple\">\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\tv-for=\"({ color, name }, index) in normalizedPalette\"\n\t\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t\tclass=\"color-picker__simple-color-circle\"\n\t\t\t\t\t\t\t:class=\"{ 'color-picker__simple-color-circle--active': color === currentColor }\"\n\t\t\t\t\t\t\t:style=\"{\n\t\t\t\t\t\t\t\tbackgroundColor: color,\n\t\t\t\t\t\t\t\tcolor: getContrastColor(color),\n\t\t\t\t\t\t\t}\">\n\t\t\t\t\t\t\t<NcIconSvgWrapper v-if=\"color === currentColor\" :path=\"mdiCheck\" />\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tclass=\"hidden-visually\"\n\t\t\t\t\t\t\t\t:aria-label=\"name\"\n\t\t\t\t\t\t\t\t:name=\"`color-picker-${id}`\"\n\t\t\t\t\t\t\t\t:checked=\"color === currentColor\"\n\t\t\t\t\t\t\t\t@click=\"toggleColor(color)\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<label v-if=\"clearable\" class=\"color-picker__clear\" :title=\"t('No color')\">\n\t\t\t\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\t\t\t\t:size=\"currentColor ? 28 : 34 /* size is adusted so that inner mdi icon aligns with color circles */\"\n\t\t\t\t\t\t\t\t:path=\"mdiCloseCircleOutline\" />\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tclass=\"hidden-visually\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('No color')\"\n\t\t\t\t\t\t\t\t:name=\"`color-picker-${id}`\"\n\t\t\t\t\t\t\t\t:checked=\"!currentColor\"\n\t\t\t\t\t\t\t\t@click=\"currentColor = undefined\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<VueChrome\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\tclass=\"color-picker__advanced\"\n\t\t\t\t\t\t:disable-alpha=\"true\"\n\t\t\t\t\t\t:disable-fields=\"!advancedFields\"\n\t\t\t\t\t\t:model-value=\"currentColor ?? '#000000'\"\n\t\t\t\t\t\t@update:model-value=\"pickCustomColor\" />\n\t\t\t\t</Transition>\n\t\t\t\t<div v-if=\"!paletteOnly\" class=\"color-picker__navigation\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"advanced\"\n\t\t\t\t\t\t:aria-label=\"t('Back')\"\n\t\t\t\t\t\t:title=\"t('Back')\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@click=\"advanced = false\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<NcIconSvgWrapper directional :path=\"mdiArrowLeft\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:aria-label=\"t('More options')\"\n\t\t\t\t\t\t:title=\"t('More options')\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@click=\"advanced = true\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiDotsHorizontal\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t@click=\"handleConfirm(slotProps.hide)\">\n\t\t\t\t\t\t{{ t('Choose') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</template>\n\t</NcPopover>\n</template>\n\n<style lang=\"scss\" scoped>\n.color-picker {\n\tdisplay: flex;\n\toverflow: hidden;\n\talign-content: flex-end;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\tpadding: var(--border-radius-element); // align with NcPopover border radius\n\tmin-width: calc(4 * var(--default-clickable-area) + 2 * var(--border-radius-element)); // space for 4 color circles\n\n\t&--clearable {\n\t\tmin-width: calc(5 * var(--default-clickable-area) + 2 * var(--border-radius-element));\n\t}\n\n\t&--advanced-fields {\n\t\tmin-width: 264px;\n\t}\n\n\t&__clear {\n\t\tcolor: var(--color-main-text);\n\n\t\t&:hover:not(:has(:checked)) {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\n\t&__simple {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, var(--default-clickable-area));\n\t\tgrid-auto-rows: var(--default-clickable-area);\n\n\t\t&-color-circle {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: calc(var(--default-clickable-area) - 10px);\n\t\t\theight: calc(var(--default-clickable-area) - 10px);\n\t\t\tmin-height: calc(var(--default-clickable-area) - 10px);\n\t\t\tmargin: auto;\n\t\t\tpadding: 0;\n\t\t\tcolor: white;\n\t\t\tborder: 1px solid rgba(0, 0, 0, 0.25);\n\t\t\tborder-radius: 50%;\n\t\t\tfont-size: 16px;\n\t\t\t&:focus-within {\n\t\t\t\toutline: 2px solid var(--color-main-text);\n\t\t\t}\n\t\t\t&:hover {\n\t\t\t\topacity: .6;\n\t\t\t}\n\t\t\t&--active {\n\t\t\t\twidth: calc(var(--default-clickable-area) - 6px);\n\t\t\t\theight: calc(var(--default-clickable-area) - 6px);\n\t\t\t\tmin-height: calc(var(--default-clickable-area) - 6px);\n\t\t\t\ttransition: all 100ms ease-in-out;\n\t\t\t\topacity: 1 !important;\n\t\t\t}\n\t\t}\n\t}\n\n\t&__advanced {\n\t\tbox-shadow: none !important;\n\t}\n\n\t&__navigation {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: var(--default-grid-baseline);\n\t\tjustify-content: space-between;\n\t\tmargin-top: calc(2 * var(--default-grid-baseline));\n\t}\n}\n\n:deep() .vc {\n\t&-chrome {\n\t\twidth: unset;\n\t\tbackground-color: var(--color-main-background);\n\n\t\t&-color-wrap {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\n\t\t&-active-color {\n\t\t\tborder-radius: 17px;\n\t\t}\n\n\t\t&-body {\n\t\t\tpadding: 14px 0 0 0;\n\t\t\tbackground-color: var(--color-main-background);\n\n\t\t\t.vc-input__input {\n\t\t\t\t--input-border-radius: var(--border-radius-element);\n\t\t\t\t--input-border-width-offset: calc(var(--border-width-input-focused, 2px) - var(--border-width-input, 2px));\n\t\t\t\twidth: 100%;\n\t\t\t\theight: var(--default-clickable-area);\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding-inline: calc(var(--border-radius-element) + var(--input-border-width-offset));\n\t\t\t\tpadding-block: var(--input-border-width-offset);\n\t\t\t\tborder: var(--border-width-input, 2px) solid var(--color-border-maxcontrast);\n\t\t\t\tborder-radius: var(--input-border-radius);\n\t\t\t\tfont-size: var(--default-font-size);\n\t\t\t\tcolor: var(--color-main-text);\n\t\t\t\tbox-shadow: none;\n\n\t\t\t\t&:active:not([disabled]),\n\t\t\t\t&:hover:not([disabled]),\n\t\t\t\t&:focus:not([disabled]) {\n\t\t\t\t\t// Reset padding offset when focused\n\t\t\t\t\t--input-border-width-offset: 0px;\n\t\t\t\t\tborder-color: var(--color-main-text);\n\t\t\t\t\tborder-width: var(--border-width-input-focused, 2px);\n\t\t\t\t\tbox-shadow: 0 0 0 2px var(--color-main-background) !important;\n\n\t\t\t\t\t& + .vc-input__label {\n\t\t\t\t\t\tcolor: var(--color-main-text);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vc-input__label {\n\t\t\t\tposition: absolute;\n\t\t\t\tinset-inline: var(--border-width-input-focused, 2px);\n\t\t\t\tinset-block-start: calc(-1.5 * var(--font-size-small, 13px) / 2);\n\t\t\t\tmax-width: fit-content;\n\t\t\t\tmargin-inline: calc(var(--border-radius-element) - var(--default-grid-baseline));\n\t\t\t\tmargin-block: 0;\n\t\t\t\tpadding-inline: var(--default-grid-baseline);\n\t\t\t\tfont-family: var(--font-face);\n\t\t\t\tfont-size: var(--font-size-small, 13px);\n\t\t\t\tline-height: 1.5;\n\t\t\t\tfont-weight: 500;\n\t\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\t\tbackground-color: var(--color-main-background);\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t}\n\n\t\t&-toggle-btn {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\twidth: var(--default-clickable-area);\n\t\t\theight: var(--default-clickable-area);\n\t\t\tmargin-inline-start: 6px;\n\t\t\tfilter: var(--background-invert-if-dark);\n\t\t}\n\n\t\t&-toggle-icon {\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t&-toggle-icon-highlight {\n\t\t\twidth: var(--default-clickable-area);\n\t\t\theight: var(--default-clickable-area);\n\t\t\tinset: 0;\n\t\t}\n\n\t\t&-saturation {\n\t\t\t&-wrap {\n\t\t\t\tborder-radius: 3px;\n\t\t\t}\n\n\t\t\t&-circle {\n\t\t\t\twidth: 20px;\n\t\t\t\theight: 20px;\n\t\t\t}\n\t\t}\n\t}\n}\n\n.slide {\n\t&-enter-from {\n\t\ttransform: translateX(-50%);\n\t\topacity: 0;\n\t}\n\t&-enter-to {\n\t\ttransform: translateX(0);\n\t\topacity: 1;\n\t}\n\t&-leave-from {\n\t\ttransform: translateX(0);\n\t\topacity: 1;\n\t}\n\t&-leave-to {\n\t\ttransform: translateX(-50%);\n\t\topacity: 0;\n\t}\n\t&-enter-active,\n\t&-leave-active {\n\t\ttransition: all 50ms ease-in-out;\n\t}\n}\n\n</style>\n"],"names":["_useModel","_createBlock","_unref","container","_withCtx","_renderSlot","_createElementVNode","advancedFields","clearable","_createVNode","_Transition","_openBlock","_createElementBlock","_Fragment","_normalizeClass","_normalizeStyle","VueChrome","paletteOnly"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsMA,UAAM,eAAeA,SAA+B,SAAA,YAAmB;AAKvE,UAAM,OAAOA,SAAoB,SAAC,MAAM;AAExC,UAAM,QAAQ;AAoCd,UAAM,OAAO;AAeb,UAAM,YAAY;AAKlB,UAAM,KAAK,gBAAA;AAKX,UAAM,WAAW,IAAI,KAAK;AAM1B,UAAM,oBAAoB,SAAS,MAAM;AACxC,UAAI,UAAU,MAAM;AACpB,iBAAW,SAAS,SAAS;AAC5B,YAAK,OAAO,UAAU,YAAY,CAAC,MAAM,MAAM,SAAS,KACnD,OAAO,UAAU,YAAY,CAAC,MAAM,OAAO,MAAM,SAAS,GAAI;AAClE,iBAAO,MAAM,0CAA0C,EAAE,MAAA,CAAO;AAChE,oBAAU,CAAA;AACV;AAAA,QACD;AAAA,MACD;AAEA,UAAI,QAAQ,WAAW,GAAG;AACzB,kBAAU,MAAM,YACb,CAAC,GAAG,gBAAgB,aAAa,WAAW,IAC5C,CAAC,GAAG,cAAc;AAAA,MACtB;AAEA,aAAO,QAAQ,IAAI,CAAC,UAA0B;AAAA,QAC7C,OAAO,OAAO,SAAS,WAAW,KAAK,QAAQ;AAAA,QAC/C,MAAM,OAAO,SAAS,YAAY,KAAK,OACpC,KAAK,OACL,EAAE,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AA,GAAA;AAAA,gBAHV,SAAQ;AAAA,gBACP,SAAK,CAAA,WAAE,cAAc,UAAU,IAAI;AAAA,cAAA;iCACpC,MAAiB;AAAA,kDAAdA,MAAA,CAAA,EAAC,QAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcColorPicker-DpSDaGrh.mjs","sources":["../../src/components/NcColorPicker/NcColorPicker.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### General description\n\nThis component allows the user to choose a color. It consists of 2\nactual pickers:\n\n- One simple picker with a predefined palette of colors;\n- One more advanced picker that provides the full color spectrum;\n\n### Usage\n\n* Using v-model and passing in an HTML element that will be treated as a trigger:\n\n```vue\n<template>\n\t<div class=\"container0\">\n\t\t<NcColorPicker v-model=\"color\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcColorPicker>\n\t\t<NcColorPicker v-model=\"color\" :palette=\"customPalette\">\n\t\t\t<NcButton> Click Me for a custom palette </NcButton>\n\t\t</NcColorPicker>\n\t\t<div :style=\"{'background-color': color}\" class=\"color0\" />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9',\n\t\t\tcustomPalette: [\n\t\t\t\t'#E40303',\n\t\t\t\t'#FF8C00',\n\t\t\t\t'#FFED00',\n\t\t\t\t'#008026',\n\t\t\t\t'#24408E',\n\t\t\t\t'#732982',\n\t\t\t\t'#5BCEFA',\n\t\t\t\t'#F5A9B8',\n\t\t\t\t'#FFFFFF',\n\t\t\t\t'#F5A9B8',\n\t\t\t\t'#5BCEFA',\n\t\t\t],\n\t\t}\n\t}\n}\n</script>\n<style>\n.container0 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color0 {\n\twidth: 100px;\n\theight: 34px;\n\tborder-radius: 6px;\n}\n</style>\n```\n\n* Using v-model for both color and open state and emitting an event that updates the color\n\n```vue\n<template>\n\t<div class=\"container1\">\n\t\t<NcButton @click=\"open = !open\"> Click Me </NcButton>\n\t\t<NcColorPicker v-model=\"color\" v-model:open=\"open\" v-slot=\"{ attrs }\">\n\t\t\t<div v-bind=\"attrs\" :style=\"{'background-color': color}\" class=\"color1\" />\n\t\t</NcColorPicker>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9',\n\t\t\topen: false\n\t\t}\n\t}\n}\n</script>\n<style>\n.container1 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color1 {\n\twidth: 100px;\n\theight: 34px;\n\tborder-radius: 6px;\n}\n</style>\n```\n\n* Allowing to clear the selected color\n\n```vue\n<template>\n\t<div class=\"container1\">\n\t\t<NcColorPicker clearable v-model=\"color\">\n\t\t\t<NcButton>Click Me</NcButton>\n\t\t</NcColorPicker>\n\t\t<div :style=\"{'background-color': color}\" class=\"color-preview\" :class=\"{'color-preview--none': !color}\" />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9',\n\t\t\topen: false\n\t\t}\n\t}\n}\n</script>\n<style scoped>\n.container1 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color-preview {\n\twidth: 100px;\n\theight: 34px;\n\tborder: 1px solid black;\n\tborder-radius: 6px;\n}\n\n.color-preview--none {\n\tbackground: repeating-conic-gradient(#808080 0 25%, #0000 0 50%) 50% / 20px 20px;\n}\n</style>\n```\n\n* Using advanced fields including HEX, RGB, and HSL:\n\n```vue\n<template>\n\t<div class=\"container0\">\n\t\t<NcColorPicker v-model=\"color\"\n\t\t\t:advanced-fields=\"true\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcColorPicker>\n\t\t<div :style=\"{'background-color': color}\" class=\"color0\" />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9'\n\t\t}\n\t}\n}\n</script>\n<style>\n.container0 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color0 {\n\twidth: 100px;\n\theight: 34px;\n\tborder-radius: 6px;\n}\n</style>\n```\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Payload } from '@ckpack/vue-color'\nimport type { Color } from '../../utils/colors.ts'\n\nimport { Chrome as VueChrome } from '@ckpack/vue-color'\nimport { mdiArrowLeft, mdiCheck, mdiCloseCircleOutline, mdiDotsHorizontal } from '@mdi/js'\nimport { computed, ref } from 'vue'\nimport { t } from '../../l10n.ts'\nimport { COLOR_BLACK, COLOR_WHITE, defaultPalette } from '../../utils/colors.ts'\nimport { createElementId } from '../../utils/createElementId.ts'\nimport { logger } from '../../utils/logger.ts'\nimport NcButton from '../NcButton/index.ts'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/index.ts'\nimport NcPopover from '../NcPopover/index.js'\n\n/**\n * A HEX color that represents the initial value of the picker.\n *\n * If the `clearable` prop is set then also `undefined` might be given or emitted for when the color gets cleared.\n */\nconst currentColor = defineModel<string | undefined>({ required: true })\n\n/**\n * The open state of the color picker.\n */\nconst open = defineModel<boolean>('open')\n\nconst props = withDefaults(defineProps<{\n\t/**\n\t * Set to `true` to enable advanced fields including HEX, RGB, and HSL\n\t */\n\tadvancedFields?: boolean\n\n\t/**\n\t * Allow to clear the current color.\n\t * When set the `update:modelValue` and `submit` event might emit also `undefined`.\n\t */\n\tclearable?: boolean\n\n\t/**\n\t * Selector for the popover container\n\t */\n\tcontainer?: string | Element\n\n\t/**\n\t * Provide a custom array of colors to show.\n\t * Can be either an array of string hexadecimal colors,\n\t * or an array of object with a `color` property with hexadecimal color string,\n\t * and a `name` property for accessibility.\n\t *\n\t * @type {string[] | {color: string, name: string}[]}\n\t */\n\tpalette?: string[] | Color[]\n\n\t/**\n\t * Limit selectable colors to only the provided palette\n\t */\n\tpaletteOnly?: boolean\n}>(), {\n\tcontainer: 'body',\n\tpalette: () => [],\n})\n\nconst emit = defineEmits<{\n\t/**\n\t * Emitted when the submit button was pressed.\n\t * The payload is the same as the current modelValue.\n\t *\n\t * The value might be undefined if the `clearable` prop is set.\n\t */\n\tsubmit: [string | undefined]\n\n\t/**\n\t * The color picker was fully closed and all transitions are finished.\n\t */\n\tclosed: []\n}>()\n\nconst HEX_REGEX = /^#([a-f0-9]{3}|[a-f0-9]{6})$/i\n\n/**\n * Unique id used to identify different color pickers\n */\nconst id = createElementId()\n\n/**\n * Is the advanced picker is open\n */\nconst advanced = ref(false)\n\n/**\n * Normalized palette by converting array of hex colors to color objects.\n * This also ensures there is a default palette if needed (no palette passed).\n */\nconst normalizedPalette = computed(() => {\n\tlet palette = props.palette\n\tfor (const color of palette) {\n\t\tif ((typeof color === 'string' && !color.match(HEX_REGEX))\n\t\t\t|| (typeof color === 'object' && !color.color?.match(HEX_REGEX))) {\n\t\t\tlogger.error('[NcColorPicker] Invalid palette passed', { color })\n\t\t\tpalette = []\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (palette.length === 0) {\n\t\tpalette = props.clearable\n\t\t\t? [...defaultPalette, COLOR_BLACK, COLOR_WHITE]\n\t\t\t: [...defaultPalette]\n\t}\n\n\treturn palette.map((item: Color | string) => ({\n\t\tcolor: typeof item === 'object' ? item.color : item,\n\t\tname: typeof item === 'object' && item.name\n\t\t\t? item.name\n\t\t\t: t('A color with a HEX value {hex}', { hex: typeof item === 'string' ? item : item.color }),\n\t}))\n})\n\n/**\n * Submit a picked colour and close picker\n *\n * @param hideCallback - callback to close popover\n */\nfunction handleConfirm(hideCallback: () => void) {\n\temit('submit', currentColor.value)\n\thideCallback()\n\tadvanced.value = false\n}\n\n/**\n * Toggle the currently selected palette color.\n *\n * @param color - The color to toggle\n */\nfunction toggleColor(color: string | Color) {\n\tcolor = typeof color === 'string' ? color : color.color\n\n\tif (props.clearable && currentColor.value === color) {\n\t\tcurrentColor.value = undefined\n\t} else {\n\t\tcurrentColor.value = color\n\t}\n}\n\n/**\n * @param color - The picked color from the Chrome component\n */\nfunction pickCustomColor(color: Payload): void {\n\tcurrentColor.value = color.hex\n}\n\n/**\n * Get the text color with the most constrast for a given background color.\n *\n * @param color - The background color\n */\nfunction getContrastColor(color: string): string {\n\treturn calculateLuma(color) > 0.5\n\t\t? COLOR_BLACK.color\n\t\t: COLOR_WHITE.color\n}\n\n/**\n * Calculate luminance of provided hex color\n *\n * @param color - The hex color\n */\nfunction calculateLuma(color: string) {\n\tconst [red, green, blue] = hexToRGB(color)\n\treturn (0.2126 * red + 0.7152 * green + 0.0722 * blue) / 255\n}\n\n/**\n * Convert hex color to RGB\n *\n * @param hex - The hex color\n */\nfunction hexToRGB(hex: string): [number, number, number] {\n\tconst result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)\n\tif (!result) {\n\t\treturn [0, 0, 0]\n\t}\n\n\treturn [parseInt(result[1]!, 16), parseInt(result[2]!, 16), parseInt(result[3]!, 16)]\n}\n</script>\n\n<template>\n\t<NcPopover\n\t\tv-model:shown=\"open\"\n\t\t:container=\"container\"\n\t\tpopup-role=\"dialog\"\n\t\t@apply-hide=\"emit('closed')\">\n\t\t<template #trigger=\"slotProps\">\n\t\t\t<slot v-bind=\"slotProps\" />\n\t\t</template>\n\t\t<template #default=\"slotProps\">\n\t\t\t<div\n\t\t\t\trole=\"dialog\"\n\t\t\t\tclass=\"color-picker\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\t:aria-label=\"t('Color picker')\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'color-picker--advanced-fields': advanced && advancedFields,\n\t\t\t\t\t'color-picker--clearable': clearable,\n\t\t\t\t}\">\n\t\t\t\t<Transition name=\"slide\" mode=\"out-in\">\n\t\t\t\t\t<div v-if=\"!advanced\" class=\"color-picker__simple\">\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\tv-for=\"({ color, name }, index) in normalizedPalette\"\n\t\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t\tclass=\"color-picker__simple-color-circle\"\n\t\t\t\t\t\t\t:class=\"{ 'color-picker__simple-color-circle--active': color === currentColor }\"\n\t\t\t\t\t\t\t:style=\"{\n\t\t\t\t\t\t\t\tbackgroundColor: color,\n\t\t\t\t\t\t\t\tcolor: getContrastColor(color),\n\t\t\t\t\t\t\t}\">\n\t\t\t\t\t\t\t<NcIconSvgWrapper v-if=\"color === currentColor\" :path=\"mdiCheck\" />\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tclass=\"hidden-visually\"\n\t\t\t\t\t\t\t\t:aria-label=\"name\"\n\t\t\t\t\t\t\t\t:name=\"`color-picker-${id}`\"\n\t\t\t\t\t\t\t\t:checked=\"color === currentColor\"\n\t\t\t\t\t\t\t\t@click=\"toggleColor(color)\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<label v-if=\"clearable\" class=\"color-picker__clear\" :title=\"t('No color')\">\n\t\t\t\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\t\t\t\t:size=\"currentColor ? 28 : 34 /* size is adusted so that inner mdi icon aligns with color circles */\"\n\t\t\t\t\t\t\t\t:path=\"mdiCloseCircleOutline\" />\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tclass=\"hidden-visually\"\n\t\t\t\t\t\t\t\t:aria-label=\"t('No color')\"\n\t\t\t\t\t\t\t\t:name=\"`color-picker-${id}`\"\n\t\t\t\t\t\t\t\t:checked=\"!currentColor\"\n\t\t\t\t\t\t\t\t@click=\"currentColor = undefined\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<VueChrome\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\tclass=\"color-picker__advanced\"\n\t\t\t\t\t\t:disable-alpha=\"true\"\n\t\t\t\t\t\t:disable-fields=\"!advancedFields\"\n\t\t\t\t\t\t:model-value=\"currentColor ?? '#000000'\"\n\t\t\t\t\t\t@update:model-value=\"pickCustomColor\" />\n\t\t\t\t</Transition>\n\t\t\t\t<div v-if=\"!paletteOnly\" class=\"color-picker__navigation\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"advanced\"\n\t\t\t\t\t\t:aria-label=\"t('Back')\"\n\t\t\t\t\t\t:title=\"t('Back')\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@click=\"advanced = false\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<NcIconSvgWrapper directional :path=\"mdiArrowLeft\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:aria-label=\"t('More options')\"\n\t\t\t\t\t\t:title=\"t('More options')\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@click=\"advanced = true\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<NcIconSvgWrapper :path=\"mdiDotsHorizontal\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t@click=\"handleConfirm(slotProps.hide)\">\n\t\t\t\t\t\t{{ t('Choose') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</template>\n\t</NcPopover>\n</template>\n\n<style lang=\"scss\" scoped>\n.color-picker {\n\tdisplay: flex;\n\toverflow: hidden;\n\talign-content: flex-end;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\tpadding: var(--border-radius-element); // align with NcPopover border radius\n\tmin-width: calc(4 * var(--default-clickable-area) + 2 * var(--border-radius-element)); // space for 4 color circles\n\n\t&--clearable {\n\t\tmin-width: calc(5 * var(--default-clickable-area) + 2 * var(--border-radius-element));\n\t}\n\n\t&--advanced-fields {\n\t\tmin-width: 264px;\n\t}\n\n\t&__clear {\n\t\tcolor: var(--color-main-text);\n\n\t\t&:hover:not(:has(:checked)) {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\n\t&__simple {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, var(--default-clickable-area));\n\t\tgrid-auto-rows: var(--default-clickable-area);\n\n\t\t&-color-circle {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: calc(var(--default-clickable-area) - 10px);\n\t\t\theight: calc(var(--default-clickable-area) - 10px);\n\t\t\tmin-height: calc(var(--default-clickable-area) - 10px);\n\t\t\tmargin: auto;\n\t\t\tpadding: 0;\n\t\t\tcolor: white;\n\t\t\tborder: 1px solid rgba(0, 0, 0, 0.25);\n\t\t\tborder-radius: 50%;\n\t\t\tfont-size: 16px;\n\t\t\t&:focus-within {\n\t\t\t\toutline: 2px solid var(--color-main-text);\n\t\t\t}\n\t\t\t&:hover {\n\t\t\t\topacity: .6;\n\t\t\t}\n\t\t\t&--active {\n\t\t\t\twidth: calc(var(--default-clickable-area) - 6px);\n\t\t\t\theight: calc(var(--default-clickable-area) - 6px);\n\t\t\t\tmin-height: calc(var(--default-clickable-area) - 6px);\n\t\t\t\ttransition: all 100ms ease-in-out;\n\t\t\t\topacity: 1 !important;\n\t\t\t}\n\t\t}\n\t}\n\n\t&__advanced {\n\t\tbox-shadow: none !important;\n\t}\n\n\t&__navigation {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: var(--default-grid-baseline);\n\t\tjustify-content: space-between;\n\t\tmargin-top: calc(2 * var(--default-grid-baseline));\n\t}\n}\n\n:deep() .vc {\n\t&-chrome {\n\t\twidth: unset;\n\t\tbackground-color: var(--color-main-background);\n\n\t\t&-color-wrap {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\n\t\t&-active-color {\n\t\t\tborder-radius: 17px;\n\t\t}\n\n\t\t&-body {\n\t\t\tpadding: 14px 0 0 0;\n\t\t\tbackground-color: var(--color-main-background);\n\n\t\t\t.vc-input__input {\n\t\t\t\t--input-border-radius: var(--border-radius-element);\n\t\t\t\t--input-border-width-offset: calc(var(--border-width-input-focused, 2px) - var(--border-width-input, 2px));\n\t\t\t\twidth: 100%;\n\t\t\t\theight: var(--default-clickable-area);\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding-inline: calc(var(--border-radius-element) + var(--input-border-width-offset));\n\t\t\t\tpadding-block: var(--input-border-width-offset);\n\t\t\t\tborder: var(--border-width-input, 2px) solid var(--color-border-maxcontrast);\n\t\t\t\tborder-radius: var(--input-border-radius);\n\t\t\t\tfont-size: var(--default-font-size);\n\t\t\t\tcolor: var(--color-main-text);\n\t\t\t\tbox-shadow: none;\n\n\t\t\t\t&:active:not([disabled]),\n\t\t\t\t&:hover:not([disabled]),\n\t\t\t\t&:focus:not([disabled]) {\n\t\t\t\t\t// Reset padding offset when focused\n\t\t\t\t\t--input-border-width-offset: 0px;\n\t\t\t\t\tborder-color: var(--color-main-text);\n\t\t\t\t\tborder-width: var(--border-width-input-focused, 2px);\n\t\t\t\t\tbox-shadow: 0 0 0 2px var(--color-main-background) !important;\n\n\t\t\t\t\t& + .vc-input__label {\n\t\t\t\t\t\tcolor: var(--color-main-text);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vc-input__label {\n\t\t\t\tposition: absolute;\n\t\t\t\tinset-inline: var(--border-width-input-focused, 2px);\n\t\t\t\tinset-block-start: calc(-1.5 * var(--font-size-small, 13px) / 2);\n\t\t\t\tmax-width: fit-content;\n\t\t\t\tmargin-inline: calc(var(--border-radius-element) - var(--default-grid-baseline));\n\t\t\t\tmargin-block: 0;\n\t\t\t\tpadding-inline: var(--default-grid-baseline);\n\t\t\t\tfont-family: var(--font-face);\n\t\t\t\tfont-size: var(--font-size-small, 13px);\n\t\t\t\tline-height: 1.5;\n\t\t\t\tfont-weight: 500;\n\t\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\t\tbackground-color: var(--color-main-background);\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t}\n\n\t\t&-toggle-btn {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\twidth: var(--default-clickable-area);\n\t\t\theight: var(--default-clickable-area);\n\t\t\tmargin-inline-start: 6px;\n\t\t\tfilter: var(--background-invert-if-dark);\n\t\t}\n\n\t\t&-toggle-icon {\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t&-toggle-icon-highlight {\n\t\t\twidth: var(--default-clickable-area);\n\t\t\theight: var(--default-clickable-area);\n\t\t\tinset: 0;\n\t\t}\n\n\t\t&-saturation {\n\t\t\t&-wrap {\n\t\t\t\tborder-radius: 3px;\n\t\t\t}\n\n\t\t\t&-circle {\n\t\t\t\twidth: 20px;\n\t\t\t\theight: 20px;\n\t\t\t}\n\t\t}\n\t}\n}\n\n.slide {\n\t&-enter-from {\n\t\ttransform: translateX(-50%);\n\t\topacity: 0;\n\t}\n\t&-enter-to {\n\t\ttransform: translateX(0);\n\t\topacity: 1;\n\t}\n\t&-leave-from {\n\t\ttransform: translateX(0);\n\t\topacity: 1;\n\t}\n\t&-leave-to {\n\t\ttransform: translateX(-50%);\n\t\topacity: 0;\n\t}\n\t&-enter-active,\n\t&-leave-active {\n\t\ttransition: all 50ms ease-in-out;\n\t}\n}\n\n</style>\n"],"names":["_useModel","_createBlock","_unref","container","_withCtx","_renderSlot","_createElementVNode","advancedFields","clearable","_createVNode","_Transition","_openBlock","_createElementBlock","_Fragment","_normalizeClass","_normalizeStyle","VueChrome","paletteOnly"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsMA,UAAM,eAAeA,SAA+B,SAAA,YAAmB;AAKvE,UAAM,OAAOA,SAAoB,SAAC,MAAM;AAExC,UAAM,QAAQ;AAoCd,UAAM,OAAO;A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QAAA,GAAA;AAAA;gBAPT,cAAYA,MAAA,CAAA,EAAC,MAAA;AAAA,gBACb,OAAOA,MAAA,CAAA,EAAC,MAAA;AAAA,gBACT,SAAQ;AAAA,gBACP,+CAAO,SAAA,QAAQ;AAAA,cAAA;gBACL,cACV,MAAqD;AAAA,kBAArDO,YAAqDP,MAAA,gBAAA,GAAA;AAAA,oBAAnC,aAAA;AAAA,oBAAa,MAAMA,MAAA,YAAA;AAAA,kBAAA;;;8DAGvCD,YASWC,MAAA,QAAA,GAAA;AAAA;gBAPT,cAAYA,MAAA,CAAA,EAAC,cAAA;AAAA,gBACb,OAAOA,MAAA,CAAA,EAAC,cAAA;AAAA,gBACT,SAAQ;AAAA,gBACP,+CAAO,SAAA,QAAQ;AAAA,cAAA;gBACL,cACV,MAA8C;AAAA,kBAA9CO,YAA8CP,MAAA,gBAAA,GAAA,EAA3B,MAAMA,MAAA,iBAAA,KAAiB,MAAA,GAAA,CAAA,MAAA,CAAA;AAAA,gBAAA;;;cAG5CO,YAIWP,MAAA,QAAA,GAAA;AAAA,gBAHV,SAAQ;AAAA,gBACP,SAAK,CAAA,WAAE,cAAc,UAAU,IAAI;AAAA,cAAA;iCACpC,MAAiB;AAAA,kDAAdA,MAAA,CAAA,EAAC,QAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import '../assets/NcContent-CVIwhwfc.css';
|
|
2
2
|
import { defineComponent, provide, computed, ref, onBeforeMount, createElementBlock, openBlock, normalizeClass, createBlock, renderSlot, Teleport, createElementVNode, withDirectives, toDisplayString, unref, createVNode, withModifiers, withCtx, createTextVNode, vShow, nextTick } from "vue";
|
|
3
3
|
import { emit } from "@nextcloud/event-bus";
|
|
4
|
-
import { N as NcButton } from "./NcButton-
|
|
4
|
+
import { N as NcButton } from "./NcButton-CzpKEx4V.mjs";
|
|
5
5
|
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-BvLanNaW.mjs";
|
|
6
6
|
import { useIsMobile } from "../composables/useIsMobile/index.mjs";
|
|
7
|
-
import { r as register, a as t } from "./_l10n-
|
|
8
|
-
import { H as HAS_APP_NAVIGATION_KEY, C as CONTENT_SELECTOR_KEY } from "./constants-
|
|
7
|
+
import { r as register, H as t30, a as t } from "./_l10n-CgsPi8nC.mjs";
|
|
8
|
+
import { H as HAS_APP_NAVIGATION_KEY, C as CONTENT_SELECTOR_KEY } from "./constants-Ciwvl5xb.mjs";
|
|
9
9
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
10
|
-
register();
|
|
10
|
+
register(t30);
|
|
11
11
|
const contentSvg = '<!--\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<svg width="395" height="314" viewBox="0 0 395 314" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect width="395" height="314" rx="11" fill="#439DCD"/>\n<rect x="13" y="51" width="366" height="248" rx="8" fill="white"/>\n<rect x="22" y="111" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="127" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="63" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="191" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="143" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="79" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="159" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="95" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="175" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<path d="M288 145C277.56 147.8 265.32 149 254 149C242.68 149 230.44 147.8 220 145L218 153C225.44 155 234 156.32 242 157V209H250V185H258V209H266V157C274 156.32 282.56 155 290 153L288 145ZM254 145C258.4 145 262 141.4 262 137C262 132.6 258.4 129 254 129C249.6 129 246 132.6 246 137C246 141.4 249.6 145 254 145Z" fill="#DEDEDE"/>\n<path d="M43.5358 13C38.6641 13 34.535 16.2415 33.2552 20.6333C32.143 18.3038 29.7327 16.6718 26.9564 16.6718C23.1385 16.6718 20 19.7521 20 23.4993C20 27.2465 23.1385 30.3282 26.9564 30.3282C29.7327 30.3282 32.1429 28.6952 33.2552 26.3653C34.535 30.7575 38.6641 34 43.5358 34C48.3715 34 52.4796 30.8064 53.7921 26.4637C54.9249 28.7407 57.3053 30.3282 60.0421 30.3282C63.8601 30.3282 67 27.2465 67 23.4993C67 19.7521 63.8601 16.6718 60.0421 16.6718C57.3053 16.6718 54.9249 18.2583 53.7921 20.5349C52.4796 16.1926 48.3715 13 43.5358 13ZM43.5358 17.0079C47.2134 17.0079 50.1512 19.8899 50.1512 23.4993C50.1512 27.1087 47.2134 29.9921 43.5358 29.9921C39.8583 29.9921 36.9218 27.1087 36.9218 23.4993C36.9218 19.8899 39.8583 17.0079 43.5358 17.0079ZM26.9564 20.6797C28.5677 20.6797 29.8307 21.9179 29.8307 23.4993C29.8307 25.0807 28.5677 26.3203 26.9564 26.3203C25.3452 26.3203 24.0836 25.0807 24.0836 23.4993C24.0836 21.9179 25.3452 20.6797 26.9564 20.6797ZM60.0421 20.6797C61.6534 20.6797 62.9164 21.9179 62.9164 23.4993C62.9164 25.0807 61.6534 26.3203 60.0421 26.3203C58.4309 26.3203 57.1693 25.0807 57.1693 23.4993C57.1693 21.9179 58.4309 20.6797 60.0421 20.6797Z" fill="white"/>\n<rect x="79" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="99" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="119" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="139" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="159" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="179" y="20" width="8" height="8" rx="4" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12 0C5.37258 0 0 5.37259 0 12V302C0 308.627 5.37259 314 12 314H383C389.627 314 395 308.627 395 302V12C395 5.37258 389.627 0 383 0H12ZM140 44C132.268 44 126 50.268 126 58V292C126 299.732 132.268 306 140 306H372C379.732 306 386 299.732 386 292V58C386 50.268 379.732 44 372 44H140Z" fill="black" fill-opacity="0.35"/>\n</svg>\n';
|
|
12
12
|
const navigationSvg = '<!--\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<svg width="395" height="314" viewBox="0 0 395 314" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect width="395" height="314" rx="11" fill="#439DCD"/>\n<rect x="13" y="51" width="366" height="248" rx="8" fill="white"/>\n<rect x="22" y="111" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="127" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="63" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="191" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="143" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="79" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="159" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="95" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<rect x="22" y="175" width="92" height="12" rx="6" fill="#DEDEDE"/>\n<path d="M288 145C277.56 147.8 265.32 149 254 149C242.68 149 230.44 147.8 220 145L218 153C225.44 155 234 156.32 242 157V209H250V185H258V209H266V157C274 156.32 282.56 155 290 153L288 145ZM254 145C258.4 145 262 141.4 262 137C262 132.6 258.4 129 254 129C249.6 129 246 132.6 246 137C246 141.4 249.6 145 254 145Z" fill="#DEDEDE"/>\n<path d="M43.5358 13C38.6641 13 34.535 16.2415 33.2552 20.6333C32.143 18.3038 29.7327 16.6718 26.9564 16.6718C23.1385 16.6718 20 19.7521 20 23.4993C20 27.2465 23.1385 30.3282 26.9564 30.3282C29.7327 30.3282 32.1429 28.6952 33.2552 26.3653C34.535 30.7575 38.6641 34 43.5358 34C48.3715 34 52.4796 30.8064 53.7921 26.4637C54.9249 28.7407 57.3053 30.3282 60.0421 30.3282C63.8601 30.3282 67 27.2465 67 23.4993C67 19.7521 63.8601 16.6718 60.0421 16.6718C57.3053 16.6718 54.9249 18.2583 53.7921 20.5349C52.4796 16.1926 48.3715 13 43.5358 13ZM43.5358 17.0079C47.2134 17.0079 50.1512 19.8899 50.1512 23.4993C50.1512 27.1087 47.2134 29.9921 43.5358 29.9921C39.8583 29.9921 36.9218 27.1087 36.9218 23.4993C36.9218 19.8899 39.8583 17.0079 43.5358 17.0079ZM26.9564 20.6797C28.5677 20.6797 29.8307 21.9179 29.8307 23.4993C29.8307 25.0807 28.5677 26.3203 26.9564 26.3203C25.3452 26.3203 24.0836 25.0807 24.0836 23.4993C24.0836 21.9179 25.3452 20.6797 26.9564 20.6797ZM60.0421 20.6797C61.6534 20.6797 62.9164 21.9179 62.9164 23.4993C62.9164 25.0807 61.6534 26.3203 60.0421 26.3203C58.4309 26.3203 57.1693 25.0807 57.1693 23.4993C57.1693 21.9179 58.4309 20.6797 60.0421 20.6797Z" fill="white"/>\n<rect x="79" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="99" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="119" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="139" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="159" y="20" width="8" height="8" rx="4" fill="white"/>\n<rect x="179" y="20" width="8" height="8" rx="4" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12 0C5.37258 0 0 5.37259 0 12V302C0 308.627 5.37259 314 12 314H383C389.627 314 395 308.627 395 302V12C395 5.37258 389.627 0 383 0H12ZM112 44C119.732 44 126 50.268 126 58V292C126 299.732 119.732 306 112 306H20C12.268 306 6 299.732 6 292V58C6 50.268 12.268 44 20 44H112Z" fill="black" fill-opacity="0.35"/>\n</svg>\n';
|
|
13
13
|
const _hoisted_1 = { class: "vue-skip-actions__container" };
|
|
@@ -100,4 +100,4 @@ const NcContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
|
100
100
|
export {
|
|
101
101
|
NcContent as N
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=NcContent-
|
|
103
|
+
//# sourceMappingURL=NcContent-BrRHLO19.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcContent-BR_nMwKN.mjs","sources":["../../src/components/NcContent/content-selected.svg?raw","../../src/components/NcContent/navigation-selected.svg?raw","../../src/components/NcContent/NcContent.vue"],"sourcesContent":["export default \"<!--\\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n - SPDX-License-Identifier: AGPL-3.0-or-later\\n-->\\n<svg width=\\\"395\\\" height=\\\"314\\\" viewBox=\\\"0 0 395 314\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n<rect width=\\\"395\\\" height=\\\"314\\\" rx=\\\"11\\\" fill=\\\"#439DCD\\\"/>\\n<rect x=\\\"13\\\" y=\\\"51\\\" width=\\\"366\\\" height=\\\"248\\\" rx=\\\"8\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"22\\\" y=\\\"111\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"127\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"63\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"191\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"143\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"79\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"159\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"95\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"175\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<path d=\\\"M288 145C277.56 147.8 265.32 149 254 149C242.68 149 230.44 147.8 220 145L218 153C225.44 155 234 156.32 242 157V209H250V185H258V209H266V157C274 156.32 282.56 155 290 153L288 145ZM254 145C258.4 145 262 141.4 262 137C262 132.6 258.4 129 254 129C249.6 129 246 132.6 246 137C246 141.4 249.6 145 254 145Z\\\" fill=\\\"#DEDEDE\\\"/>\\n<path d=\\\"M43.5358 13C38.6641 13 34.535 16.2415 33.2552 20.6333C32.143 18.3038 29.7327 16.6718 26.9564 16.6718C23.1385 16.6718 20 19.7521 20 23.4993C20 27.2465 23.1385 30.3282 26.9564 30.3282C29.7327 30.3282 32.1429 28.6952 33.2552 26.3653C34.535 30.7575 38.6641 34 43.5358 34C48.3715 34 52.4796 30.8064 53.7921 26.4637C54.9249 28.7407 57.3053 30.3282 60.0421 30.3282C63.8601 30.3282 67 27.2465 67 23.4993C67 19.7521 63.8601 16.6718 60.0421 16.6718C57.3053 16.6718 54.9249 18.2583 53.7921 20.5349C52.4796 16.1926 48.3715 13 43.5358 13ZM43.5358 17.0079C47.2134 17.0079 50.1512 19.8899 50.1512 23.4993C50.1512 27.1087 47.2134 29.9921 43.5358 29.9921C39.8583 29.9921 36.9218 27.1087 36.9218 23.4993C36.9218 19.8899 39.8583 17.0079 43.5358 17.0079ZM26.9564 20.6797C28.5677 20.6797 29.8307 21.9179 29.8307 23.4993C29.8307 25.0807 28.5677 26.3203 26.9564 26.3203C25.3452 26.3203 24.0836 25.0807 24.0836 23.4993C24.0836 21.9179 25.3452 20.6797 26.9564 20.6797ZM60.0421 20.6797C61.6534 20.6797 62.9164 21.9179 62.9164 23.4993C62.9164 25.0807 61.6534 26.3203 60.0421 26.3203C58.4309 26.3203 57.1693 25.0807 57.1693 23.4993C57.1693 21.9179 58.4309 20.6797 60.0421 20.6797Z\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"79\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"99\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"119\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"139\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"159\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"179\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" d=\\\"M12 0C5.37258 0 0 5.37259 0 12V302C0 308.627 5.37259 314 12 314H383C389.627 314 395 308.627 395 302V12C395 5.37258 389.627 0 383 0H12ZM140 44C132.268 44 126 50.268 126 58V292C126 299.732 132.268 306 140 306H372C379.732 306 386 299.732 386 292V58C386 50.268 379.732 44 372 44H140Z\\\" fill=\\\"black\\\" fill-opacity=\\\"0.35\\\"/>\\n</svg>\\n\"","export default \"<!--\\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n - SPDX-License-Identifier: AGPL-3.0-or-later\\n-->\\n<svg width=\\\"395\\\" height=\\\"314\\\" viewBox=\\\"0 0 395 314\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n<rect width=\\\"395\\\" height=\\\"314\\\" rx=\\\"11\\\" fill=\\\"#439DCD\\\"/>\\n<rect x=\\\"13\\\" y=\\\"51\\\" width=\\\"366\\\" height=\\\"248\\\" rx=\\\"8\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"22\\\" y=\\\"111\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"127\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"63\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"191\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"143\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"79\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"159\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"95\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"175\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<path d=\\\"M288 145C277.56 147.8 265.32 149 254 149C242.68 149 230.44 147.8 220 145L218 153C225.44 155 234 156.32 242 157V209H250V185H258V209H266V157C274 156.32 282.56 155 290 153L288 145ZM254 145C258.4 145 262 141.4 262 137C262 132.6 258.4 129 254 129C249.6 129 246 132.6 246 137C246 141.4 249.6 145 254 145Z\\\" fill=\\\"#DEDEDE\\\"/>\\n<path d=\\\"M43.5358 13C38.6641 13 34.535 16.2415 33.2552 20.6333C32.143 18.3038 29.7327 16.6718 26.9564 16.6718C23.1385 16.6718 20 19.7521 20 23.4993C20 27.2465 23.1385 30.3282 26.9564 30.3282C29.7327 30.3282 32.1429 28.6952 33.2552 26.3653C34.535 30.7575 38.6641 34 43.5358 34C48.3715 34 52.4796 30.8064 53.7921 26.4637C54.9249 28.7407 57.3053 30.3282 60.0421 30.3282C63.8601 30.3282 67 27.2465 67 23.4993C67 19.7521 63.8601 16.6718 60.0421 16.6718C57.3053 16.6718 54.9249 18.2583 53.7921 20.5349C52.4796 16.1926 48.3715 13 43.5358 13ZM43.5358 17.0079C47.2134 17.0079 50.1512 19.8899 50.1512 23.4993C50.1512 27.1087 47.2134 29.9921 43.5358 29.9921C39.8583 29.9921 36.9218 27.1087 36.9218 23.4993C36.9218 19.8899 39.8583 17.0079 43.5358 17.0079ZM26.9564 20.6797C28.5677 20.6797 29.8307 21.9179 29.8307 23.4993C29.8307 25.0807 28.5677 26.3203 26.9564 26.3203C25.3452 26.3203 24.0836 25.0807 24.0836 23.4993C24.0836 21.9179 25.3452 20.6797 26.9564 20.6797ZM60.0421 20.6797C61.6534 20.6797 62.9164 21.9179 62.9164 23.4993C62.9164 25.0807 61.6534 26.3203 60.0421 26.3203C58.4309 26.3203 57.1693 25.0807 57.1693 23.4993C57.1693 21.9179 58.4309 20.6797 60.0421 20.6797Z\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"79\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"99\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"119\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"139\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"159\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"179\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" d=\\\"M12 0C5.37258 0 0 5.37259 0 12V302C0 308.627 5.37259 314 12 314H383C389.627 314 395 308.627 395 302V12C395 5.37258 389.627 0 383 0H12ZM112 44C119.732 44 126 50.268 126 58V292C126 299.732 119.732 306 112 306H20C12.268 306 6 299.732 6 292V58C6 50.268 12.268 44 20 44H112Z\\\" fill=\\\"black\\\" fill-opacity=\\\"0.35\\\"/>\\n</svg>\\n\"","<!--\n - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### General description\n\nThis component provides the default container of all apps.\nIt _MUST_ be used as the main wrapper of your app.\nIt includes the Navigation, the App content and the Sidebar.\n\nIt also will set the skip content buttons needed for accessibility.\n\n### Standard usage\n\n```vue\n\t<template>\n\t\t<NcContent app-name=\"forms\">\n\t\t\t<NcAppNavigation>\n\t\t\t\t<template #list>\n\t\t\t\t\t<NcAppNavigationNew text=\"Create article\" />\n\t\t\t\t\t<NcAppNavigationItem name=\"My navigation\" title=\"My title\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Check :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcAppNavigationItem>\n\t\t\t\t</template>\n\t\t\t</NcAppNavigation>\n\t\t\t<NcAppContent>\n\t\t\t\t<h2>Your main app content here</h2>\n\t\t\t\t<NcButton @click=\"opened = !opened\">Toggle sidebar</NcButton>\n\t\t\t</NcAppContent>\n\t\t\t<NcAppSidebar v-if=\"opened\" name=\"cat-picture.jpg\" @close=\"opened=false\">\n\t\t\t\tSidebar content\n\t\t\t</NcAppSidebar>\n\t\t</NcContent>\n\t</template>\n\t<script>\n\timport Check from 'vue-material-design-icons/Check'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tCheck,\n\t\t},\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\topened: false,\n\t\t\t}\n\t\t}\n\t}\n\t</script>\n\t<style>\n\t\t#content-vue {\n\t\t\tposition: relative;\n\t\t\twidth: 800px;\n\t\t\theight: 400px;\n\t\t}\n\t</style>\n```\n\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\n\nimport { emit } from '@nextcloud/event-bus'\nimport { computed, nextTick, onBeforeMount, provide, ref } from 'vue'\nimport NcButton from '../NcButton/NcButton.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\nimport { useIsMobile } from '../../composables/useIsMobile/index.js'\nimport { t } from '../../l10n.ts'\nimport { CONTENT_SELECTOR_KEY, HAS_APP_NAVIGATION_KEY } from './constants.ts'\nimport contentSvg from './content-selected.svg?raw'\nimport navigationSvg from './navigation-selected.svg?raw'\n\nconst props = defineProps<{\n\t/**\n\t * The application name to use.\n\t * This is used to scope all content (content, sidebar, navigation) to the application.\n\t */\n\tappName: string\n}>()\n\ndefineSlots<{\n\t/**\n\t * The app content.\n\t */\n\tdefault?: Slot\n}>()\n\nprovide(HAS_APP_NAVIGATION_KEY, setAppNavigation)\nprovide(CONTENT_SELECTOR_KEY, '#content-vue')\nprovide('appName', computed(() => props.appName))\n\nconst isMobile = useIsMobile()\n\nconst hasAppNavigation = ref(false)\nconst currentFocus = ref<'navigation' | 'content'>()\n\nconst currentImage = computed(() => (\n\tcurrentFocus.value === 'navigation'\n\t\t? navigationSvg\n\t\t: contentSvg\n))\n\n// clear any native content of the skip actions container so we can teleport into it\nonBeforeMount(() => {\n\tconst container = document.getElementById('skip-actions')\n\tif (container) {\n\t\t// clear default buttons\n\t\tcontainer.innerHTML = ''\n\t\t// add class for scoping styles\n\t\tcontainer.classList.add('vue-skip-actions')\n\t}\n})\n\n/**\n * Open the app navigation.\n * Also sets the hash of the current location to its id and focus it on the next tick.\n */\nfunction openAppNavigation(): void {\n\t// eventbus emit\n\temit('toggle-navigation', { open: true })\n\tnextTick(() => {\n\t\twindow.location.hash = 'app-navigation-vue'\n\t\t// we need to manually focus if the window location is already set to the app-navigation then it will not focus again\n\t\tdocument.getElementById('app-navigation-vue')!.focus()\n\t})\n}\n\n/**\n * Set availability of an app navigation\n *\n * @param value - The new state\n */\nfunction setAppNavigation(value: boolean): void {\n\thasAppNavigation.value = value\n\t// If app navigation is available and no focus was set yet, set it to navigation as it is the first button\n\tif (!currentFocus.value) {\n\t\tcurrentFocus.value = 'navigation'\n\t}\n}\n</script>\n\n<template>\n\t<div id=\"content-vue\" class=\"content\" :class=\"`app-${appName.toLowerCase()}`\">\n\t\t<Teleport to=\"#skip-actions\">\n\t\t\t<div class=\"vue-skip-actions__container\">\n\t\t\t\t<div class=\"vue-skip-actions__headline\">\n\t\t\t\t\t{{ t('Keyboard navigation help') }}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"vue-skip-actions__buttons\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-show=\"hasAppNavigation\"\n\t\t\t\t\t\thref=\"#app-navigation-vue\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@click.prevent=\"openAppNavigation\"\n\t\t\t\t\t\t@focusin=\"currentFocus = 'navigation'\"\n\t\t\t\t\t\t@mouseover=\"currentFocus = 'navigation'\">\n\t\t\t\t\t\t{{ t('Skip to app navigation') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\thref=\"#app-content-vue\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@focusin=\"currentFocus = 'content'\"\n\t\t\t\t\t\t@mouseover=\"currentFocus = 'content'\">\n\t\t\t\t\t\t{{ t('Skip to main content') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\tv-show=\"!isMobile\"\n\t\t\t\t\tclass=\"vue-skip-actions__image\"\n\t\t\t\t\t:svg=\"currentImage\"\n\t\t\t\t\tsize=\"auto\" />\n\t\t\t</div>\n\t\t</Teleport>\n\t\t<slot />\n\t</div>\n</template>\n\n<style lang=\"scss\">\n// Remove server stylings and add a backdrop\n#skip-actions.vue-skip-actions:focus-within {\n\ttop: 0!important;\n\tinset-inline-start: 0!important;\n\twidth: 100vw;\n\theight: 100vh;\n\tpadding: var(--body-container-margin)!important;\n\tbackdrop-filter: brightness(50%);\n}\n</style>\n\n<style lang=\"scss\" scoped>\n.vue-skip-actions {\n\t&__container {\n\t\tbackground-color: var(--color-main-background);\n\t\tborder-radius: var(--border-radius-element);\n\t\tpadding: 22px;\n\t}\n\n\t&__headline {\n\t\tfont-weight: bold;\n\t\tfont-size: 20px;\n\t\tline-height: 30px;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t&__buttons {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 12px;\n\n\t\t> * {\n\t\t\t// Ensure buttons are same width on smaller screens (container wrapped)\n\t\t\tflex: 1 0 fit-content;\n\t\t}\n\t}\n\n\t&__image {\n\t\tmargin-top: 12px;\n\n\t\t// Flip the image in RTL mode\n\t\t&:dir(rtl) {\n\t\t\ttransform: rotateY(180deg);\n\t\t}\n\t}\n}\n\n.content {\n\tdisplay: flex;\n\twidth: calc(100% - var(--body-container-margin) * 2);\n\tborder-radius: var(--body-container-radius);\n\theight: var(--body-height);\n\toverflow: hidden;\n\tpadding: 0;\n\n\t&:not(.with-sidebar--full) {\n\t\tposition: fixed;\n\t}\n\n\t&,\n\t& * {\n\t\tbox-sizing: border-box;\n\t}\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","appName","_createBlock","_Teleport","_createElementVNode","_toDisplayString","_unref","_createVNode","_renderSlot"],"mappings":";;;;;;;;;AAAA,MAAA,aAAe;ACAf,MAAA,gBAAe;;;;;;;;;;AC6Ef,UAAM,QAAQ;AAed,YAAQ,wBAAwB,gBAAgB;AAChD,YAAQ,sBAAsB,cAAc;AAC5C,YAAQ,WAAW,SAAS,MAAM,MAAM,OAAO,CAAC;AAEhD,UAAM,WAAW,YAAA;AAEjB,UAAM,mBAAmB,IAAI,KAAK;AAClC,UAAM,eAAe,IAAA;AAErB,UAAM,eAAe,SAAS,MAC7B,aAAa,UAAU,eACpB,gBACA,UACH;AAGD,kBAAc,MAAM;AACnB,YAAM,YAAY,SAAS,eAAe,cAAc;AACxD,UAAI,WAAW;AAEd,kBAAU,YAAY;AAEtB,kBAAU,UAAU,IAAI,kBAAkB;AAAA,MAC3C;AAAA,IACD,CAAC;AAMD,aAAS,oBAA0B;AAElC,WAAK,qBAAqB,EAAE,MAAM,KAAA,CAAM;AACxC,eAAS,MAAM;AACd,eAAO,SAAS,OAAO;AAEvB,iBAAS,eAAe,oBAAoB,EAAG,MAAA;AAAA,MAChD,CAAC;AAAA,IACF;AAOA,aAAS,iBAAiB,OAAsB;AAC/C,uBAAiB,QAAQ;AAEzB,UAAI,CAAC,aAAa,OAAO;AACxB,qBAAa,QAAQ;AAAA,MACtB;AAAA,IACD;;0BAICA,mBAgCM,OAAA;AAAA,QAhCD,IAAG;AAAA,QAAc,OAAKC,eAAA,CAAC,WAAS,OAAgBC,KAAAA,QAAQ,YAAA,CAAW,EAAA,CAAA;AAAA,MAAA;sBACvEC,YA6BWC,UAAA,EA7BD,IAAG,mBAAe;AAAA,UAC3BC,mBA2BM,OA3BN,YA2BM;AAAA,YA1BLA,mBAEM,OAFN,YAEMC,gBADFC,MAAA,CAAA,EAAC,0BAAA,CAAA,GAAA,CAAA;AAAA,YAELF,mBAiBM,OAjBN,YAiBM;AAAA,6BAhBLG,YAQW,UAAA;AAAA,gBANV,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACP,uBAAe,mBAAiB,CAAA,SAAA,CAAA;AAAA,gBAChC,iDAAS,aAAA,QAAY;AAAA,gBACrB,mDAAW,aAAA,QAAY;AAAA,cAAA;iCACxB,MAAiC;AAAA,kDAA9BD,MAAA,CAAA,EAAC,wBAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;wBANI,iBAAA,KAAgB;AAAA,cAAA;cAQzBC,YAMW,UAAA;AAAA,gBALV,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACP,iDAAS,aAAA,QAAY;AAAA,gBACrB,mDAAW,aAAA,QAAY;AAAA,cAAA;iCACxB,MAA+B;AAAA,kDAA5BD,MAAA,CAAA,EAAC,sBAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;;2BAGNC,YAIe,kBAAA;AAAA,cAFd,OAAM;AAAA,cACL,KAAK,aAAA;AAAA,cACN,MAAK;AAAA,YAAA;uBAHID,MAAA,QAAA,CAAQ;AAAA,YAAA;;;QAMpBE,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA,MAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcContent-BrRHLO19.mjs","sources":["../../src/components/NcContent/content-selected.svg?raw","../../src/components/NcContent/navigation-selected.svg?raw","../../src/components/NcContent/NcContent.vue"],"sourcesContent":["export default \"<!--\\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n - SPDX-License-Identifier: AGPL-3.0-or-later\\n-->\\n<svg width=\\\"395\\\" height=\\\"314\\\" viewBox=\\\"0 0 395 314\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n<rect width=\\\"395\\\" height=\\\"314\\\" rx=\\\"11\\\" fill=\\\"#439DCD\\\"/>\\n<rect x=\\\"13\\\" y=\\\"51\\\" width=\\\"366\\\" height=\\\"248\\\" rx=\\\"8\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"22\\\" y=\\\"111\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"127\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"63\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"191\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"143\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"79\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"159\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"95\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"175\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<path d=\\\"M288 145C277.56 147.8 265.32 149 254 149C242.68 149 230.44 147.8 220 145L218 153C225.44 155 234 156.32 242 157V209H250V185H258V209H266V157C274 156.32 282.56 155 290 153L288 145ZM254 145C258.4 145 262 141.4 262 137C262 132.6 258.4 129 254 129C249.6 129 246 132.6 246 137C246 141.4 249.6 145 254 145Z\\\" fill=\\\"#DEDEDE\\\"/>\\n<path d=\\\"M43.5358 13C38.6641 13 34.535 16.2415 33.2552 20.6333C32.143 18.3038 29.7327 16.6718 26.9564 16.6718C23.1385 16.6718 20 19.7521 20 23.4993C20 27.2465 23.1385 30.3282 26.9564 30.3282C29.7327 30.3282 32.1429 28.6952 33.2552 26.3653C34.535 30.7575 38.6641 34 43.5358 34C48.3715 34 52.4796 30.8064 53.7921 26.4637C54.9249 28.7407 57.3053 30.3282 60.0421 30.3282C63.8601 30.3282 67 27.2465 67 23.4993C67 19.7521 63.8601 16.6718 60.0421 16.6718C57.3053 16.6718 54.9249 18.2583 53.7921 20.5349C52.4796 16.1926 48.3715 13 43.5358 13ZM43.5358 17.0079C47.2134 17.0079 50.1512 19.8899 50.1512 23.4993C50.1512 27.1087 47.2134 29.9921 43.5358 29.9921C39.8583 29.9921 36.9218 27.1087 36.9218 23.4993C36.9218 19.8899 39.8583 17.0079 43.5358 17.0079ZM26.9564 20.6797C28.5677 20.6797 29.8307 21.9179 29.8307 23.4993C29.8307 25.0807 28.5677 26.3203 26.9564 26.3203C25.3452 26.3203 24.0836 25.0807 24.0836 23.4993C24.0836 21.9179 25.3452 20.6797 26.9564 20.6797ZM60.0421 20.6797C61.6534 20.6797 62.9164 21.9179 62.9164 23.4993C62.9164 25.0807 61.6534 26.3203 60.0421 26.3203C58.4309 26.3203 57.1693 25.0807 57.1693 23.4993C57.1693 21.9179 58.4309 20.6797 60.0421 20.6797Z\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"79\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"99\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"119\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"139\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"159\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"179\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" d=\\\"M12 0C5.37258 0 0 5.37259 0 12V302C0 308.627 5.37259 314 12 314H383C389.627 314 395 308.627 395 302V12C395 5.37258 389.627 0 383 0H12ZM140 44C132.268 44 126 50.268 126 58V292C126 299.732 132.268 306 140 306H372C379.732 306 386 299.732 386 292V58C386 50.268 379.732 44 372 44H140Z\\\" fill=\\\"black\\\" fill-opacity=\\\"0.35\\\"/>\\n</svg>\\n\"","export default \"<!--\\n - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n - SPDX-License-Identifier: AGPL-3.0-or-later\\n-->\\n<svg width=\\\"395\\\" height=\\\"314\\\" viewBox=\\\"0 0 395 314\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n<rect width=\\\"395\\\" height=\\\"314\\\" rx=\\\"11\\\" fill=\\\"#439DCD\\\"/>\\n<rect x=\\\"13\\\" y=\\\"51\\\" width=\\\"366\\\" height=\\\"248\\\" rx=\\\"8\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"22\\\" y=\\\"111\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"127\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"63\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"191\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"143\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"79\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"159\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"95\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<rect x=\\\"22\\\" y=\\\"175\\\" width=\\\"92\\\" height=\\\"12\\\" rx=\\\"6\\\" fill=\\\"#DEDEDE\\\"/>\\n<path d=\\\"M288 145C277.56 147.8 265.32 149 254 149C242.68 149 230.44 147.8 220 145L218 153C225.44 155 234 156.32 242 157V209H250V185H258V209H266V157C274 156.32 282.56 155 290 153L288 145ZM254 145C258.4 145 262 141.4 262 137C262 132.6 258.4 129 254 129C249.6 129 246 132.6 246 137C246 141.4 249.6 145 254 145Z\\\" fill=\\\"#DEDEDE\\\"/>\\n<path d=\\\"M43.5358 13C38.6641 13 34.535 16.2415 33.2552 20.6333C32.143 18.3038 29.7327 16.6718 26.9564 16.6718C23.1385 16.6718 20 19.7521 20 23.4993C20 27.2465 23.1385 30.3282 26.9564 30.3282C29.7327 30.3282 32.1429 28.6952 33.2552 26.3653C34.535 30.7575 38.6641 34 43.5358 34C48.3715 34 52.4796 30.8064 53.7921 26.4637C54.9249 28.7407 57.3053 30.3282 60.0421 30.3282C63.8601 30.3282 67 27.2465 67 23.4993C67 19.7521 63.8601 16.6718 60.0421 16.6718C57.3053 16.6718 54.9249 18.2583 53.7921 20.5349C52.4796 16.1926 48.3715 13 43.5358 13ZM43.5358 17.0079C47.2134 17.0079 50.1512 19.8899 50.1512 23.4993C50.1512 27.1087 47.2134 29.9921 43.5358 29.9921C39.8583 29.9921 36.9218 27.1087 36.9218 23.4993C36.9218 19.8899 39.8583 17.0079 43.5358 17.0079ZM26.9564 20.6797C28.5677 20.6797 29.8307 21.9179 29.8307 23.4993C29.8307 25.0807 28.5677 26.3203 26.9564 26.3203C25.3452 26.3203 24.0836 25.0807 24.0836 23.4993C24.0836 21.9179 25.3452 20.6797 26.9564 20.6797ZM60.0421 20.6797C61.6534 20.6797 62.9164 21.9179 62.9164 23.4993C62.9164 25.0807 61.6534 26.3203 60.0421 26.3203C58.4309 26.3203 57.1693 25.0807 57.1693 23.4993C57.1693 21.9179 58.4309 20.6797 60.0421 20.6797Z\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"79\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"99\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"119\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"139\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"159\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<rect x=\\\"179\\\" y=\\\"20\\\" width=\\\"8\\\" height=\\\"8\\\" rx=\\\"4\\\" fill=\\\"white\\\"/>\\n<path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" d=\\\"M12 0C5.37258 0 0 5.37259 0 12V302C0 308.627 5.37259 314 12 314H383C389.627 314 395 308.627 395 302V12C395 5.37258 389.627 0 383 0H12ZM112 44C119.732 44 126 50.268 126 58V292C126 299.732 119.732 306 112 306H20C12.268 306 6 299.732 6 292V58C6 50.268 12.268 44 20 44H112Z\\\" fill=\\\"black\\\" fill-opacity=\\\"0.35\\\"/>\\n</svg>\\n\"","<!--\n - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### General description\n\nThis component provides the default container of all apps.\nIt _MUST_ be used as the main wrapper of your app.\nIt includes the Navigation, the App content and the Sidebar.\n\nIt also will set the skip content buttons needed for accessibility.\n\n### Standard usage\n\n```vue\n\t<template>\n\t\t<NcContent app-name=\"forms\">\n\t\t\t<NcAppNavigation>\n\t\t\t\t<template #list>\n\t\t\t\t\t<NcAppNavigationNew text=\"Create article\" />\n\t\t\t\t\t<NcAppNavigationItem name=\"My navigation\" title=\"My title\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Check :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcAppNavigationItem>\n\t\t\t\t</template>\n\t\t\t</NcAppNavigation>\n\t\t\t<NcAppContent>\n\t\t\t\t<h2>Your main app content here</h2>\n\t\t\t\t<NcButton @click=\"opened = !opened\">Toggle sidebar</NcButton>\n\t\t\t</NcAppContent>\n\t\t\t<NcAppSidebar v-if=\"opened\" name=\"cat-picture.jpg\" @close=\"opened=false\">\n\t\t\t\tSidebar content\n\t\t\t</NcAppSidebar>\n\t\t</NcContent>\n\t</template>\n\t<script>\n\timport Check from 'vue-material-design-icons/Check'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tCheck,\n\t\t},\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\topened: false,\n\t\t\t}\n\t\t}\n\t}\n\t</script>\n\t<style>\n\t\t#content-vue {\n\t\t\tposition: relative;\n\t\t\twidth: 800px;\n\t\t\theight: 400px;\n\t\t}\n\t</style>\n```\n\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\n\nimport { emit } from '@nextcloud/event-bus'\nimport { computed, nextTick, onBeforeMount, provide, ref } from 'vue'\nimport NcButton from '../NcButton/NcButton.vue'\nimport NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'\nimport { useIsMobile } from '../../composables/useIsMobile/index.js'\nimport { t } from '../../l10n.ts'\nimport { CONTENT_SELECTOR_KEY, HAS_APP_NAVIGATION_KEY } from './constants.ts'\nimport contentSvg from './content-selected.svg?raw'\nimport navigationSvg from './navigation-selected.svg?raw'\n\nconst props = defineProps<{\n\t/**\n\t * The application name to use.\n\t * This is used to scope all content (content, sidebar, navigation) to the application.\n\t */\n\tappName: string\n}>()\n\ndefineSlots<{\n\t/**\n\t * The app content.\n\t */\n\tdefault?: Slot\n}>()\n\nprovide(HAS_APP_NAVIGATION_KEY, setAppNavigation)\nprovide(CONTENT_SELECTOR_KEY, '#content-vue')\nprovide('appName', computed(() => props.appName))\n\nconst isMobile = useIsMobile()\n\nconst hasAppNavigation = ref(false)\nconst currentFocus = ref<'navigation' | 'content'>()\n\nconst currentImage = computed(() => (\n\tcurrentFocus.value === 'navigation'\n\t\t? navigationSvg\n\t\t: contentSvg\n))\n\n// clear any native content of the skip actions container so we can teleport into it\nonBeforeMount(() => {\n\tconst container = document.getElementById('skip-actions')\n\tif (container) {\n\t\t// clear default buttons\n\t\tcontainer.innerHTML = ''\n\t\t// add class for scoping styles\n\t\tcontainer.classList.add('vue-skip-actions')\n\t}\n})\n\n/**\n * Open the app navigation.\n * Also sets the hash of the current location to its id and focus it on the next tick.\n */\nfunction openAppNavigation(): void {\n\t// eventbus emit\n\temit('toggle-navigation', { open: true })\n\tnextTick(() => {\n\t\twindow.location.hash = 'app-navigation-vue'\n\t\t// we need to manually focus if the window location is already set to the app-navigation then it will not focus again\n\t\tdocument.getElementById('app-navigation-vue')!.focus()\n\t})\n}\n\n/**\n * Set availability of an app navigation\n *\n * @param value - The new state\n */\nfunction setAppNavigation(value: boolean): void {\n\thasAppNavigation.value = value\n\t// If app navigation is available and no focus was set yet, set it to navigation as it is the first button\n\tif (!currentFocus.value) {\n\t\tcurrentFocus.value = 'navigation'\n\t}\n}\n</script>\n\n<template>\n\t<div id=\"content-vue\" class=\"content\" :class=\"`app-${appName.toLowerCase()}`\">\n\t\t<Teleport to=\"#skip-actions\">\n\t\t\t<div class=\"vue-skip-actions__container\">\n\t\t\t\t<div class=\"vue-skip-actions__headline\">\n\t\t\t\t\t{{ t('Keyboard navigation help') }}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"vue-skip-actions__buttons\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-show=\"hasAppNavigation\"\n\t\t\t\t\t\thref=\"#app-navigation-vue\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@click.prevent=\"openAppNavigation\"\n\t\t\t\t\t\t@focusin=\"currentFocus = 'navigation'\"\n\t\t\t\t\t\t@mouseover=\"currentFocus = 'navigation'\">\n\t\t\t\t\t\t{{ t('Skip to app navigation') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\thref=\"#app-content-vue\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@focusin=\"currentFocus = 'content'\"\n\t\t\t\t\t\t@mouseover=\"currentFocus = 'content'\">\n\t\t\t\t\t\t{{ t('Skip to main content') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t\t<NcIconSvgWrapper\n\t\t\t\t\tv-show=\"!isMobile\"\n\t\t\t\t\tclass=\"vue-skip-actions__image\"\n\t\t\t\t\t:svg=\"currentImage\"\n\t\t\t\t\tsize=\"auto\" />\n\t\t\t</div>\n\t\t</Teleport>\n\t\t<slot />\n\t</div>\n</template>\n\n<style lang=\"scss\">\n// Remove server stylings and add a backdrop\n#skip-actions.vue-skip-actions:focus-within {\n\ttop: 0!important;\n\tinset-inline-start: 0!important;\n\twidth: 100vw;\n\theight: 100vh;\n\tpadding: var(--body-container-margin)!important;\n\tbackdrop-filter: brightness(50%);\n}\n</style>\n\n<style lang=\"scss\" scoped>\n.vue-skip-actions {\n\t&__container {\n\t\tbackground-color: var(--color-main-background);\n\t\tborder-radius: var(--border-radius-element);\n\t\tpadding: 22px;\n\t}\n\n\t&__headline {\n\t\tfont-weight: bold;\n\t\tfont-size: 20px;\n\t\tline-height: 30px;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t&__buttons {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 12px;\n\n\t\t> * {\n\t\t\t// Ensure buttons are same width on smaller screens (container wrapped)\n\t\t\tflex: 1 0 fit-content;\n\t\t}\n\t}\n\n\t&__image {\n\t\tmargin-top: 12px;\n\n\t\t// Flip the image in RTL mode\n\t\t&:dir(rtl) {\n\t\t\ttransform: rotateY(180deg);\n\t\t}\n\t}\n}\n\n.content {\n\tdisplay: flex;\n\twidth: calc(100% - var(--body-container-margin) * 2);\n\tborder-radius: var(--body-container-radius);\n\theight: var(--body-height);\n\toverflow: hidden;\n\tpadding: 0;\n\n\t&:not(.with-sidebar--full) {\n\t\tposition: fixed;\n\t}\n\n\t&,\n\t& * {\n\t\tbox-sizing: border-box;\n\t}\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","appName","_createBlock","_Teleport","_createElementVNode","_toDisplayString","_unref","_createVNode","_renderSlot"],"mappings":";;;;;;;;;AAAA,MAAA,aAAe;ACAf,MAAA,gBAAe;;;;;;;;;;AC6Ef,UAAM,QAAQ;AAed,YAAQ,wBAAwB,gBAAgB;AAChD,YAAQ,sBAAsB,cAAc;AAC5C,YAAQ,WAAW,SAAS,MAAM,MAAM,OAAO,CAAC;AAEhD,UAAM,WAAW,YAAA;AAEjB,UAAM,mBAAmB,IAAI,KAAK;AAClC,UAAM,eAAe,IAAA;AAErB,UAAM,eAAe,SAAS,MAC7B,a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ACrB,mDAAW,aAAA,QAAY;AAAA,cAAA;iCACxB,MAA+B;AAAA,kDAA5BD,MAAA,CAAA,EAAC,sBAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;;2BAGNC,YAIe,kBAAA;AAAA,cAFd,OAAM;AAAA,cACL,KAAK,aAAA;AAAA,cACN,MAAK;AAAA,YAAA;uBAHID,MAAA,QAAA,CAAQ;AAAA,YAAA;;;QAMpBE,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA,MAAA;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '../assets/NcDashboardWidget-DFY9GRrd.css';
|
|
2
2
|
import { createElementBlock, openBlock, mergeProps, createElementVNode, createCommentVNode, toDisplayString, resolveComponent, createBlock, renderSlot, withCtx, createVNode, Fragment, renderList, toHandlers } from "vue";
|
|
3
3
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
|
|
4
|
-
import { r as register,
|
|
5
|
-
import { N as NcAvatar } from "./NcAvatar-
|
|
6
|
-
import { N as NcDashboardWidgetItem } from "./NcDashboardWidgetItem-
|
|
4
|
+
import { r as register, z as t35, a as t } from "./_l10n-CgsPi8nC.mjs";
|
|
5
|
+
import { N as NcAvatar } from "./NcAvatar-S8EJR2BK.mjs";
|
|
6
|
+
import { N as NcDashboardWidgetItem } from "./NcDashboardWidgetItem-DdYM1QYk.mjs";
|
|
7
7
|
import { N as NcEmptyContent } from "./NcEmptyContent-B8-90BSI.mjs";
|
|
8
8
|
const _sfc_main$1 = {
|
|
9
9
|
name: "CheckIcon",
|
|
@@ -224,4 +224,4 @@ const NcDashboardWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sf
|
|
|
224
224
|
export {
|
|
225
225
|
NcDashboardWidget as N
|
|
226
226
|
};
|
|
227
|
-
//# sourceMappingURL=NcDashboardWidget-
|
|
227
|
+
//# sourceMappingURL=NcDashboardWidget-CIUrPOLo.mjs.map
|