@nextcloud/vue 8.5.1 → 8.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/Components/NcActionButton.cjs +10 -7
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +16 -14
- package/dist/Components/NcActionButton.mjs.map +1 -1
- package/dist/Components/NcActionButtonGroup.cjs +1 -1
- package/dist/Components/NcActionButtonGroup.mjs +1 -1
- package/dist/Components/NcActionCaption.cjs +2 -1
- package/dist/Components/NcActionCaption.mjs +7 -7
- package/dist/Components/NcActionCaption.mjs.map +1 -1
- package/dist/Components/NcActionCheckbox.cjs +3 -2
- package/dist/Components/NcActionCheckbox.cjs.map +1 -1
- package/dist/Components/NcActionCheckbox.mjs +10 -10
- package/dist/Components/NcActionCheckbox.mjs.map +1 -1
- package/dist/Components/NcActionInput.cjs +1 -1
- package/dist/Components/NcActionInput.mjs +1 -1
- package/dist/Components/NcActionLink.cjs +3 -2
- package/dist/Components/NcActionLink.cjs.map +1 -1
- package/dist/Components/NcActionLink.mjs +4 -4
- package/dist/Components/NcActionLink.mjs.map +1 -1
- package/dist/Components/NcActionRadio.cjs +3 -2
- package/dist/Components/NcActionRadio.cjs.map +1 -1
- package/dist/Components/NcActionRadio.mjs +4 -4
- package/dist/Components/NcActionRadio.mjs.map +1 -1
- package/dist/Components/NcActionRouter.cjs +5 -4
- package/dist/Components/NcActionRouter.cjs.map +1 -1
- package/dist/Components/NcActionRouter.mjs +4 -4
- package/dist/Components/NcActionRouter.mjs.map +1 -1
- package/dist/Components/NcActionSeparator.cjs +7 -6
- package/dist/Components/NcActionSeparator.mjs +3 -3
- package/dist/Components/NcActionSeparator.mjs.map +1 -1
- package/dist/Components/NcActionText.cjs +3 -2
- package/dist/Components/NcActionText.cjs.map +1 -1
- package/dist/Components/NcActionText.mjs +6 -6
- package/dist/Components/NcActionText.mjs.map +1 -1
- package/dist/Components/NcActionTextEditable.cjs +5 -4
- package/dist/Components/NcActionTextEditable.cjs.map +1 -1
- package/dist/Components/NcActionTextEditable.mjs +5 -5
- package/dist/Components/NcActionTextEditable.mjs.map +1 -1
- package/dist/Components/NcActions.cjs +1 -1
- package/dist/Components/NcActions.mjs +1 -1
- package/dist/Components/NcAppContent.cjs +1 -1
- package/dist/Components/NcAppContent.mjs +1 -1
- package/dist/Components/NcAppNavigation.cjs +1 -1
- package/dist/Components/NcAppNavigation.mjs +1 -1
- package/dist/Components/NcAppNavigationCaption.cjs +1 -1
- package/dist/Components/NcAppNavigationCaption.mjs +1 -1
- package/dist/Components/NcAppNavigationIconBullet.cjs +2 -1
- package/dist/Components/NcAppNavigationIconBullet.mjs +3 -3
- package/dist/Components/NcAppNavigationIconBullet.mjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.cjs +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +1 -1
- package/dist/Components/NcAppNavigationNew.cjs +2 -1
- package/dist/Components/NcAppNavigationNew.cjs.map +1 -1
- package/dist/Components/NcAppNavigationNew.mjs +6 -6
- package/dist/Components/NcAppNavigationNew.mjs.map +1 -1
- package/dist/Components/NcAppNavigationNewItem.cjs +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +1 -1
- package/dist/Components/NcAppNavigationSpacer.cjs +7 -6
- package/dist/Components/NcAppNavigationSpacer.mjs +6 -6
- package/dist/Components/NcAppNavigationSpacer.mjs.map +1 -1
- package/dist/Components/NcAppNavigationToggle.cjs +1 -1
- package/dist/Components/NcAppNavigationToggle.mjs +1 -1
- package/dist/Components/NcAppSettingsDialog.cjs +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +1 -1
- package/dist/Components/NcAppSettingsSection.cjs +2 -1
- package/dist/Components/NcAppSettingsSection.mjs +3 -3
- package/dist/Components/NcAppSettingsSection.mjs.map +1 -1
- package/dist/Components/NcAppSidebar.cjs +1 -1
- package/dist/Components/NcAppSidebar.mjs +1 -1
- package/dist/Components/NcAppSidebarTab.cjs +5 -4
- package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.mjs +3 -3
- package/dist/Components/NcAppSidebarTab.mjs.map +1 -1
- package/dist/Components/NcAvatar.cjs +1 -1
- package/dist/Components/NcAvatar.mjs +1 -1
- package/dist/Components/NcBreadcrumb.cjs +1 -1
- package/dist/Components/NcBreadcrumb.mjs +1 -1
- package/dist/Components/NcBreadcrumbs.cjs +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +1 -1
- package/dist/Components/NcButton.cjs +5 -4
- package/dist/Components/NcButton.cjs.map +1 -1
- package/dist/Components/NcButton.mjs +3 -3
- package/dist/Components/NcButton.mjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +1 -1
- package/dist/Components/NcColorPicker.cjs +1 -1
- package/dist/Components/NcColorPicker.mjs +1 -1
- package/dist/Components/NcContent.cjs +1 -1
- package/dist/Components/NcContent.mjs +1 -1
- package/dist/Components/NcCounterBubble.cjs +5 -4
- package/dist/Components/NcCounterBubble.mjs +1 -1
- package/dist/Components/NcCounterBubble.mjs.map +1 -1
- package/dist/Components/NcDashboardWidget.cjs +1 -1
- package/dist/Components/NcDashboardWidget.mjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.cjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +1 -1
- package/dist/Components/NcDateTime.cjs +1 -1
- package/dist/Components/NcDateTime.mjs +1 -1
- package/dist/Components/NcDateTimePicker.cjs +16 -15
- package/dist/Components/NcDateTimePicker.cjs.map +1 -1
- package/dist/Components/NcDateTimePicker.mjs +16 -16
- package/dist/Components/NcDateTimePicker.mjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.cjs +9 -8
- package/dist/Components/NcDateTimePickerNative.cjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +8 -8
- package/dist/Components/NcDateTimePickerNative.mjs.map +1 -1
- package/dist/Components/NcDialog.cjs +1 -1
- package/dist/Components/NcDialog.mjs +1 -1
- package/dist/Components/NcDialogButton.cjs +1 -1
- package/dist/Components/NcDialogButton.mjs +1 -1
- package/dist/Components/NcEllipsisedOption.cjs +5 -4
- package/dist/Components/NcEllipsisedOption.cjs.map +1 -1
- package/dist/Components/NcEllipsisedOption.mjs +3 -3
- package/dist/Components/NcEllipsisedOption.mjs.map +1 -1
- package/dist/Components/NcEmojiPicker.cjs +1 -1
- package/dist/Components/NcEmojiPicker.mjs +1 -1
- package/dist/Components/NcEmptyContent.cjs +2 -1
- package/dist/Components/NcEmptyContent.mjs +3 -3
- package/dist/Components/NcEmptyContent.mjs.map +1 -1
- package/dist/Components/NcGuestContent.cjs +4 -3
- package/dist/Components/NcGuestContent.mjs +6 -6
- package/dist/Components/NcGuestContent.mjs.map +1 -1
- package/dist/Components/NcHeaderMenu.cjs +1 -1
- package/dist/Components/NcHeaderMenu.mjs +1 -1
- package/dist/Components/NcIconSvgWrapper.cjs +1 -1
- package/dist/Components/NcIconSvgWrapper.mjs +1 -1
- package/dist/Components/NcInputField.cjs +3 -2
- package/dist/Components/NcInputField.cjs.map +1 -1
- package/dist/Components/NcInputField.mjs +5 -5
- package/dist/Components/NcInputField.mjs.map +1 -1
- package/dist/Components/NcListItem.cjs +1 -1
- package/dist/Components/NcListItem.mjs +1 -1
- package/dist/Components/NcListItemIcon.cjs +1 -1
- package/dist/Components/NcListItemIcon.mjs +1 -1
- package/dist/Components/NcLoadingIcon.cjs +2 -1
- package/dist/Components/NcLoadingIcon.mjs +3 -3
- package/dist/Components/NcLoadingIcon.mjs.map +1 -1
- package/dist/Components/NcModal.cjs +7 -6
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +15 -15
- package/dist/Components/NcModal.mjs.map +1 -1
- package/dist/Components/NcNoteCard.cjs +10 -7
- package/dist/Components/NcNoteCard.cjs.map +1 -1
- package/dist/Components/NcNoteCard.mjs +21 -19
- package/dist/Components/NcNoteCard.mjs.map +1 -1
- package/dist/Components/NcPasswordField.cjs +1 -1
- package/dist/Components/NcPasswordField.mjs +1 -1
- package/dist/Components/NcPopover.cjs +1 -1
- package/dist/Components/NcPopover.mjs +1 -1
- package/dist/Components/NcProgressBar.cjs +1 -1
- package/dist/Components/NcProgressBar.mjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +1 -1
- package/dist/Components/NcRichContenteditable.cjs +1 -1
- package/dist/Components/NcRichContenteditable.mjs +2 -2
- package/dist/Components/NcRichText.cjs +1 -1
- package/dist/Components/NcRichText.mjs +3 -3
- package/dist/Components/NcSelect.cjs +1 -1
- package/dist/Components/NcSelect.mjs +1 -1
- package/dist/Components/NcSelectTags.cjs +1 -1
- package/dist/Components/NcSelectTags.mjs +1 -1
- package/dist/Components/NcSettingsInputText.cjs +1 -1
- package/dist/Components/NcSettingsInputText.mjs +1 -1
- package/dist/Components/NcSettingsSection.cjs +1 -1
- package/dist/Components/NcSettingsSection.mjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
- package/dist/Components/NcTextArea.cjs +3 -2
- package/dist/Components/NcTextArea.cjs.map +1 -1
- package/dist/Components/NcTextArea.mjs +5 -5
- package/dist/Components/NcTextArea.mjs.map +1 -1
- package/dist/Components/NcTextField.cjs +1 -1
- package/dist/Components/NcTextField.mjs +1 -1
- package/dist/Components/NcTimezonePicker.cjs +1 -1
- package/dist/Components/NcTimezonePicker.mjs +1 -1
- package/dist/Components/NcUserBubble.cjs +1 -1
- package/dist/Components/NcUserBubble.mjs +1 -1
- package/dist/Components/NcUserStatusIcon.cjs +1 -1
- package/dist/Components/NcUserStatusIcon.mjs +1 -1
- package/dist/Directives/Tooltip.cjs +2 -1
- package/dist/Directives/Tooltip.cjs.map +1 -1
- package/dist/Directives/Tooltip.mjs +4 -4
- package/dist/Directives/Tooltip.mjs.map +1 -1
- package/dist/Functions/usernameToColor.cjs +1 -1
- package/dist/Functions/usernameToColor.mjs +1 -1
- package/dist/Mixins/richEditor.cjs +1 -1
- package/dist/Mixins/richEditor.mjs +1 -1
- package/dist/assets/{NcActionButton-YVkNHN_x.css → NcActionButton-1Z9lN7ar.css} +17 -17
- package/dist/assets/{NcActions-vgT9ak04.css → NcActions-mSL9fcPO.css} +12 -12
- package/dist/assets/{NcAppNavigationItem-n-wauJE7.css → NcAppNavigationItem-caMsw_N_.css} +14 -7
- package/dist/assets/{NcAppNavigationNewItem-MQBvffq9.css → NcAppNavigationNewItem-ue-H4LQY.css} +14 -7
- package/dist/assets/{NcAppNavigationToggle-upUgYNtL.css → NcAppNavigationToggle-3vMKtCQL.css} +3 -3
- package/dist/assets/{NcColorPicker-CNX9fj56.css → NcColorPicker-PzIRM1j1.css} +24 -24
- package/dist/assets/{NcDateTimePicker-amYL2HzW.css → NcDateTimePicker-vivOLt2Q.css} +10 -10
- package/dist/assets/{NcDateTimePickerNative-2pQS5L0H.css → NcDateTimePickerNative-5yybtvfx.css} +19 -7
- package/dist/assets/{NcEmojiPicker-lBXbC6Jd.css → NcEmojiPicker-wTIbvcrG.css} +5 -5
- package/dist/assets/{NcListItem-xcW2PRrk.css → NcListItem-6sL-frKJ.css} +49 -49
- package/dist/assets/{NcNoteCard-OTfZqVvP.css → NcNoteCard-f0NZpwjL.css} +7 -7
- package/dist/assets/{referencePickerModal-VxSowpb5.css → referencePickerModal-iy5QSWj6.css} +2 -2
- package/dist/chunks/{AlertCircleOutline-VgVvRWpm.cjs → AlertCircleOutline-HYz1lvHU.cjs} +4 -4
- package/dist/chunks/AlertCircleOutline-HYz1lvHU.cjs.map +1 -0
- package/dist/chunks/{AlertCircleOutline-lwSRucNO.mjs → AlertCircleOutline-XY0EPUmQ.mjs} +4 -4
- package/dist/chunks/AlertCircleOutline-XY0EPUmQ.mjs.map +1 -0
- package/dist/chunks/{ArrowLeft-3KC2k3tR.cjs → ArrowLeft-fC5aEWWu.cjs} +1 -1
- package/dist/chunks/ArrowLeft-fC5aEWWu.cjs.map +1 -0
- package/dist/chunks/{ArrowLeft-buaCjhfr.mjs → ArrowLeft-uW5eNVkY.mjs} +4 -4
- package/dist/chunks/ArrowLeft-uW5eNVkY.mjs.map +1 -0
- package/dist/chunks/{ArrowRight-4p6gv-9o.mjs → ArrowRight-16bLxoZc.mjs} +1 -1
- package/dist/chunks/ArrowRight-16bLxoZc.mjs.map +1 -0
- package/dist/chunks/{ArrowRight-uEMed4kl.cjs → ArrowRight-uUC8qW2c.cjs} +1 -1
- package/dist/chunks/ArrowRight-uUC8qW2c.cjs.map +1 -0
- package/dist/chunks/{Check-5uKO4aXx.cjs → Check-QBzDcHpr.cjs} +1 -1
- package/dist/chunks/Check-QBzDcHpr.cjs.map +1 -0
- package/dist/chunks/{Check-FObi_cEO.mjs → Check-qy5XrF1J.mjs} +1 -1
- package/dist/chunks/Check-qy5XrF1J.mjs.map +1 -0
- package/dist/chunks/{ChevronDown-rdCNNu7u.cjs → ChevronDown-Hc_DTRav.cjs} +4 -4
- package/dist/chunks/ChevronDown-Hc_DTRav.cjs.map +1 -0
- package/dist/chunks/{ChevronDown-TbRvziNU.mjs → ChevronDown-suAKKmeb.mjs} +1 -1
- package/dist/chunks/ChevronDown-suAKKmeb.mjs.map +1 -0
- package/dist/chunks/{ChevronRight-XOmSMmxA.mjs → ChevronRight-9owhU_17.mjs} +6 -6
- package/dist/chunks/ChevronRight-9owhU_17.mjs.map +1 -0
- package/dist/chunks/{ChevronRight-bp7fT1r7.cjs → ChevronRight-MdQC55Yq.cjs} +1 -1
- package/dist/chunks/ChevronRight-MdQC55Yq.cjs.map +1 -0
- package/dist/chunks/{Close-5Hzp7J3v.mjs → Close-QtH6_3PP.mjs} +4 -4
- package/dist/chunks/Close-QtH6_3PP.mjs.map +1 -0
- package/dist/chunks/{Close-QFLrdRdG.cjs → Close-dotk0707.cjs} +4 -4
- package/dist/chunks/Close-dotk0707.cjs.map +1 -0
- package/dist/chunks/{DotsHorizontal-dlN1WvqM.cjs → DotsHorizontal-6hepLUSS.cjs} +1 -1
- package/dist/chunks/DotsHorizontal-6hepLUSS.cjs.map +1 -0
- package/dist/chunks/{DotsHorizontal-NssXDZGM.mjs → DotsHorizontal-IbmXTXRA.mjs} +1 -1
- package/dist/chunks/DotsHorizontal-IbmXTXRA.mjs.map +1 -0
- package/dist/chunks/{GenColors-OwQiytMp.mjs → GenColors-wNwbCHuq.mjs} +1 -1
- package/dist/chunks/{GenColors-OwQiytMp.mjs.map → GenColors-wNwbCHuq.mjs.map} +1 -1
- package/dist/chunks/{GenColors-6ePwbl4k.cjs → GenColors-zPMSiY0e.cjs} +1 -1
- package/dist/chunks/{GenColors-6ePwbl4k.cjs.map → GenColors-zPMSiY0e.cjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-qXVHIy0a.mjs → NcActionButtonGroup-A5Ixaw5n.mjs} +6 -6
- package/dist/chunks/{NcActionButtonGroup-qXVHIy0a.mjs.map → NcActionButtonGroup-A5Ixaw5n.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-wvQESxxh.cjs → NcActionButtonGroup-HIUn669C.cjs} +3 -2
- package/dist/chunks/{NcActionButtonGroup-wvQESxxh.cjs.map → NcActionButtonGroup-HIUn669C.cjs.map} +1 -1
- package/dist/chunks/{NcActionInput-2mvb7ZnC.cjs → NcActionInput--MiyWKmE.cjs} +3 -2
- package/dist/chunks/{NcActionInput-2mvb7ZnC.cjs.map → NcActionInput--MiyWKmE.cjs.map} +1 -1
- package/dist/chunks/{NcActionInput-Vdsm4Jt5.mjs → NcActionInput-jQFZLsoe.mjs} +8 -8
- package/dist/chunks/{NcActionInput-Vdsm4Jt5.mjs.map → NcActionInput-jQFZLsoe.mjs.map} +1 -1
- package/dist/chunks/{NcActions-4ml5sv6P.cjs → NcActions-SlBohqiI.cjs} +176 -142
- package/dist/chunks/NcActions-SlBohqiI.cjs.map +1 -0
- package/dist/chunks/{NcActions-5K-qjttC.mjs → NcActions-qCVw08zV.mjs} +181 -147
- package/dist/chunks/NcActions-qCVw08zV.mjs.map +1 -0
- package/dist/chunks/{NcAppContent-kSymH_mo.cjs → NcAppContent-Kq5fJ7_W.cjs} +4 -3
- package/dist/chunks/{NcAppContent-kSymH_mo.cjs.map → NcAppContent-Kq5fJ7_W.cjs.map} +1 -1
- package/dist/chunks/{NcAppContent-agTfSSHS.mjs → NcAppContent-WBzZJh-y.mjs} +9 -9
- package/dist/chunks/{NcAppContent-agTfSSHS.mjs.map → NcAppContent-WBzZJh-y.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-rSC0k8c6.cjs → NcAppNavigation-U6yaDk7k.cjs} +13 -12
- package/dist/chunks/{NcAppNavigation-biQcPFmk.mjs.map → NcAppNavigation-U6yaDk7k.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-biQcPFmk.mjs → NcAppNavigation-n6P3oVZv.mjs} +4 -4
- package/dist/chunks/{NcAppNavigation-rSC0k8c6.cjs.map → NcAppNavigation-n6P3oVZv.mjs.map} +1 -1
- package/dist/chunks/NcAppNavigationCaption-0lGP-5CR.mjs +47 -0
- package/dist/chunks/{NcAppNavigationCaption-E3tdVsYJ.mjs.map → NcAppNavigationCaption-0lGP-5CR.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-Mugp6fsR.cjs → NcAppNavigationCaption-nEKQXQYr.cjs} +3 -2
- package/dist/chunks/{NcAppNavigationCaption-Mugp6fsR.cjs.map → NcAppNavigationCaption-nEKQXQYr.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-r0MUwPP7.cjs → NcAppNavigationItem-AdLvgSbV.cjs} +6 -5
- package/dist/chunks/NcAppNavigationItem-AdLvgSbV.cjs.map +1 -0
- package/dist/chunks/{NcAppNavigationItem-CzK_gg7C.mjs → NcAppNavigationItem-g_XncGxL.mjs} +10 -10
- package/dist/chunks/NcAppNavigationItem-g_XncGxL.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationNewItem-IYhRBzud.cjs → NcAppNavigationNewItem-TyGHutbG.cjs} +3 -2
- package/dist/chunks/{NcAppNavigationNewItem-X4Ac8vym.mjs.map → NcAppNavigationNewItem-TyGHutbG.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-X4Ac8vym.mjs → NcAppNavigationNewItem-t1ST1cif.mjs} +7 -7
- package/dist/chunks/{NcAppNavigationNewItem-IYhRBzud.cjs.map → NcAppNavigationNewItem-t1ST1cif.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-0hLCj-s5.mjs → NcAppNavigationSettings-DQHPDc4X.mjs} +10 -9
- package/dist/chunks/NcAppNavigationSettings-DQHPDc4X.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationSettings-tvlinWey.cjs → NcAppNavigationSettings-UKQnGAEz.cjs} +8 -6
- package/dist/chunks/NcAppNavigationSettings-UKQnGAEz.cjs.map +1 -0
- package/dist/chunks/{NcAppNavigationToggle-RXyDbzmn.mjs → NcAppNavigationToggle-KT8eqw6r.mjs} +22 -13
- package/dist/chunks/NcAppNavigationToggle-KT8eqw6r.mjs.map +1 -0
- package/dist/chunks/NcAppNavigationToggle-Wz0s35Rd.cjs +119 -0
- package/dist/chunks/NcAppNavigationToggle-Wz0s35Rd.cjs.map +1 -0
- package/dist/chunks/{NcAppSettingsDialog-8HAKz-0l.mjs → NcAppSettingsDialog-5t3vGpRF.mjs} +8 -8
- package/dist/chunks/{NcAppSettingsDialog-2tyARsR0.cjs.map → NcAppSettingsDialog-5t3vGpRF.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-2tyARsR0.cjs → NcAppSettingsDialog-h22q7l_7.cjs} +3 -2
- package/dist/chunks/{NcAppSettingsDialog-8HAKz-0l.mjs.map → NcAppSettingsDialog-h22q7l_7.cjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-qaRnOe4Y.mjs → NcAppSidebar-Wo8-p3nm.mjs} +10 -10
- package/dist/chunks/NcAppSidebar-Wo8-p3nm.mjs.map +1 -0
- package/dist/chunks/{NcAppSidebar-PMmg9vsl.cjs → NcAppSidebar-WyDtlgwP.cjs} +6 -5
- package/dist/chunks/NcAppSidebar-WyDtlgwP.cjs.map +1 -0
- package/dist/chunks/{NcAvatar-5DJP61Ka.mjs → NcAvatar-c9ryo-7h.mjs} +9 -8
- package/dist/chunks/{NcAvatar-5DJP61Ka.mjs.map → NcAvatar-c9ryo-7h.mjs.map} +1 -1
- package/dist/chunks/{NcAvatar-YQujzmop.cjs → NcAvatar-khVnYpF2.cjs} +5 -3
- package/dist/chunks/{NcAvatar-YQujzmop.cjs.map → NcAvatar-khVnYpF2.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-C2oZ_vji.mjs → NcBreadcrumb-Ac0G-oky.mjs} +8 -8
- package/dist/chunks/{NcBreadcrumb-C2oZ_vji.mjs.map → NcBreadcrumb-Ac0G-oky.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-3Ez2uWmp.cjs → NcBreadcrumb-SEyo99to.cjs} +6 -5
- package/dist/chunks/{NcBreadcrumb-3Ez2uWmp.cjs.map → NcBreadcrumb-SEyo99to.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-H8ec0ouN.cjs → NcBreadcrumbs-DXpOwLNx.cjs} +4 -3
- package/dist/chunks/NcBreadcrumbs-DXpOwLNx.cjs.map +1 -0
- package/dist/chunks/{NcBreadcrumbs-tq1eD4Hk.mjs → NcBreadcrumbs-YOANgGCY.mjs} +6 -6
- package/dist/chunks/NcBreadcrumbs-YOANgGCY.mjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch-xEweFZs1.cjs → NcCheckboxRadioSwitch-7pZp_rWo.cjs} +21 -21
- package/dist/chunks/NcCheckboxRadioSwitch-7pZp_rWo.cjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch-BiREcGAk.mjs → NcCheckboxRadioSwitch-PlgK1zWr.mjs} +22 -22
- package/dist/chunks/NcCheckboxRadioSwitch-PlgK1zWr.mjs.map +1 -0
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-kOW4T17e.cjs +4 -0
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-kOW4T17e.cjs.map +1 -0
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-rJ3UZLGm.mjs +3 -0
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-rJ3UZLGm.mjs.map +1 -0
- package/dist/chunks/{NcColorPicker-H0rZhQxw.mjs → NcColorPicker-rPobPO3M.mjs} +27 -20
- package/dist/chunks/NcColorPicker-rPobPO3M.mjs.map +1 -0
- package/dist/chunks/{NcColorPicker-2IJNZMe-.cjs → NcColorPicker-yr9Pfeem.cjs} +16 -8
- package/dist/chunks/NcColorPicker-yr9Pfeem.cjs.map +1 -0
- package/dist/chunks/{NcContent-ZgOMyq2k.cjs → NcContent-BdekB7Zr.cjs} +5 -4
- package/dist/chunks/{NcContent-ZgOMyq2k.cjs.map → NcContent-BdekB7Zr.cjs.map} +1 -1
- package/dist/chunks/{NcContent-lWYIO3gy.mjs → NcContent-EGBAB5sy.mjs} +8 -8
- package/dist/chunks/{NcContent-lWYIO3gy.mjs.map → NcContent-EGBAB5sy.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-hQn58Jv6.mjs → NcDashboardWidget-bEnoXtKm.mjs} +7 -7
- package/dist/chunks/{NcDashboardWidget-hQn58Jv6.mjs.map → NcDashboardWidget-bEnoXtKm.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-j44iStpo.cjs → NcDashboardWidget-zBrcpL_E.cjs} +3 -2
- package/dist/chunks/{NcDashboardWidget-j44iStpo.cjs.map → NcDashboardWidget-zBrcpL_E.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-f4Y_DBsU.cjs → NcDashboardWidgetItem-LcxIx2-S.cjs} +10 -9
- package/dist/chunks/{NcDashboardWidgetItem-Yp4ii3At.mjs.map → NcDashboardWidgetItem-LcxIx2-S.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-Yp4ii3At.mjs → NcDashboardWidgetItem-p7yyFX-b.mjs} +5 -5
- package/dist/chunks/{NcDashboardWidgetItem-f4Y_DBsU.cjs.map → NcDashboardWidgetItem-p7yyFX-b.mjs.map} +1 -1
- package/dist/chunks/{NcDateTime-sBcbqRB6.mjs → NcDateTime-UCw1o96E.mjs} +1 -1
- package/dist/chunks/{NcDateTime-sBcbqRB6.mjs.map → NcDateTime-UCw1o96E.mjs.map} +1 -1
- package/dist/chunks/{NcDateTime-1ZGz6Hwu.cjs → NcDateTime-hyWStpUj.cjs} +1 -1
- package/dist/chunks/{NcDateTime-1ZGz6Hwu.cjs.map → NcDateTime-hyWStpUj.cjs.map} +1 -1
- package/dist/chunks/{NcDialog-1Nrs9x8z.mjs → NcDialog-652A8lMI.mjs} +8 -8
- package/dist/chunks/{NcDialog-1Nrs9x8z.mjs.map → NcDialog-652A8lMI.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-k6iHgTGm.cjs → NcDialog-dPYf81Dr.cjs} +3 -2
- package/dist/chunks/{NcDialog-k6iHgTGm.cjs.map → NcDialog-dPYf81Dr.cjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-O4JZ53Dj.mjs → NcDialogButton-QuoJDLGH.mjs} +1 -1
- package/dist/chunks/{NcDialogButton-O4JZ53Dj.mjs.map → NcDialogButton-QuoJDLGH.mjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-37xKCh_l.cjs → NcDialogButton-V3nj_xwS.cjs} +1 -1
- package/dist/chunks/{NcDialogButton-37xKCh_l.cjs.map → NcDialogButton-V3nj_xwS.cjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker--8moif3g.mjs → NcEmojiPicker-O0EAGlkS.mjs} +43 -43
- package/dist/chunks/NcEmojiPicker-O0EAGlkS.mjs.map +1 -0
- package/dist/chunks/{NcEmojiPicker-gGgrlLAJ.cjs → NcEmojiPicker-xzt2RvDK.cjs} +11 -10
- package/dist/chunks/NcEmojiPicker-xzt2RvDK.cjs.map +1 -0
- package/dist/chunks/{NcHeaderMenu-5dnFFhRA.cjs → NcHeaderMenu-BSi8E43v.cjs} +6 -4
- package/dist/chunks/{NcHeaderMenu-5dnFFhRA.cjs.map → NcHeaderMenu-BSi8E43v.cjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-ePmuT5Kz.mjs → NcHeaderMenu-Vytc8Eqg.mjs} +4 -3
- package/dist/chunks/{NcHeaderMenu-ePmuT5Kz.mjs.map → NcHeaderMenu-Vytc8Eqg.mjs.map} +1 -1
- package/dist/chunks/{NcIconSvgWrapper-_lgitSfS.cjs → NcIconSvgWrapper-R7a7dIg4.cjs} +11 -10
- package/dist/chunks/{NcIconSvgWrapper-P-GkSjTH.mjs.map → NcIconSvgWrapper-R7a7dIg4.cjs.map} +1 -1
- package/dist/chunks/{NcIconSvgWrapper-P-GkSjTH.mjs → NcIconSvgWrapper-n3MnAe1S.mjs} +6 -6
- package/dist/chunks/{NcIconSvgWrapper-_lgitSfS.cjs.map → NcIconSvgWrapper-n3MnAe1S.mjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-q4IYDSKH.cjs → NcInputConfirmCancel-tvpFnpKT.cjs} +18 -17
- package/dist/chunks/{NcInputConfirmCancel-q4IYDSKH.cjs.map → NcInputConfirmCancel-tvpFnpKT.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-HrSwS4LK.mjs → NcInputConfirmCancel-z3ANO-1N.mjs} +11 -11
- package/dist/chunks/{NcInputConfirmCancel-HrSwS4LK.mjs.map → NcInputConfirmCancel-z3ANO-1N.mjs.map} +1 -1
- package/dist/chunks/{NcListItem-_P2bxfeP.mjs → NcListItem-90hXqC4C.mjs} +13 -13
- package/dist/chunks/NcListItem-90hXqC4C.mjs.map +1 -0
- package/dist/chunks/{NcListItem-wsOnBEF3.cjs → NcListItem-lqYZQhuZ.cjs} +11 -10
- package/dist/chunks/NcListItem-lqYZQhuZ.cjs.map +1 -0
- package/dist/chunks/{NcListItemIcon-65Rgi-AZ.cjs → NcListItemIcon-ccke4gpg.cjs} +4 -2
- package/dist/chunks/{NcListItemIcon-65Rgi-AZ.cjs.map → NcListItemIcon-ccke4gpg.cjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-IXrbZUKU.mjs → NcListItemIcon-hTbMo3-O.mjs} +12 -11
- package/dist/chunks/{NcListItemIcon-IXrbZUKU.mjs.map → NcListItemIcon-hTbMo3-O.mjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-kJ1PZotd.mjs → NcPasswordField-EbKN3MlL.mjs} +10 -10
- package/dist/chunks/NcPasswordField-EbKN3MlL.mjs.map +1 -0
- package/dist/chunks/{NcPasswordField-XvXblBeQ.cjs → NcPasswordField-IkBZCjOy.cjs} +9 -9
- package/dist/chunks/NcPasswordField-IkBZCjOy.cjs.map +1 -0
- package/dist/chunks/{NcPopover-yyItaFC6.mjs → NcPopover-T4GMXmKV.mjs} +3 -3
- package/dist/chunks/{NcPopover-yyItaFC6.mjs.map → NcPopover-T4GMXmKV.mjs.map} +1 -1
- package/dist/chunks/{NcPopover--SjyNre9.cjs → NcPopover-judBGW5r.cjs} +2 -1
- package/dist/chunks/{NcPopover--SjyNre9.cjs.map → NcPopover-judBGW5r.cjs.map} +1 -1
- package/dist/chunks/{NcProgressBar-yrdD1jxU.cjs → NcProgressBar-BthaVVHU.cjs} +2 -1
- package/dist/chunks/{NcProgressBar-yrdD1jxU.cjs.map → NcProgressBar-BthaVVHU.cjs.map} +1 -1
- package/dist/chunks/{NcProgressBar-hQCFE5H3.mjs → NcProgressBar-h2ufKS6c.mjs} +1 -1
- package/dist/chunks/{NcProgressBar-hQCFE5H3.mjs.map → NcProgressBar-h2ufKS6c.mjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-1nj1tk0J.mjs → NcRelatedResourcesPanel-EDvgZgjQ.mjs} +9 -9
- package/dist/chunks/{NcRelatedResourcesPanel-1nj1tk0J.mjs.map → NcRelatedResourcesPanel-EDvgZgjQ.mjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-KxXrRko3.cjs → NcRelatedResourcesPanel-f2UeB_6X.cjs} +3 -2
- package/dist/chunks/{NcRelatedResourcesPanel-KxXrRko3.cjs.map → NcRelatedResourcesPanel-f2UeB_6X.cjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-A0FFbptl.cjs → NcRichContenteditable-WxSgSNot.cjs} +7 -6
- package/dist/chunks/{NcRichContenteditable-VzFXqSYH.mjs.map → NcRichContenteditable-WxSgSNot.cjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-VzFXqSYH.mjs → NcRichContenteditable-gQh2HFSV.mjs} +10 -10
- package/dist/chunks/{NcRichContenteditable-A0FFbptl.cjs.map → NcRichContenteditable-gQh2HFSV.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-YSUTWw6M.mjs → NcRichText-RSAcESV2.mjs} +20 -13
- package/dist/chunks/NcRichText-RSAcESV2.mjs.map +1 -0
- package/dist/chunks/{NcRichText-N44WJqzt.cjs → NcRichText-fHn-j5sa.cjs} +41 -34
- package/dist/chunks/NcRichText-fHn-j5sa.cjs.map +1 -0
- package/dist/chunks/{NcSelect-H-xyiCqP.cjs → NcSelect-rMSul72R.cjs} +22 -20
- package/dist/chunks/{NcSelect-roYZ16y8.mjs.map → NcSelect-rMSul72R.cjs.map} +1 -1
- package/dist/chunks/{NcSelect-roYZ16y8.mjs → NcSelect-vSPKKiyt.mjs} +16 -15
- package/dist/chunks/{NcSelect-H-xyiCqP.cjs.map → NcSelect-vSPKKiyt.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-3BfQQNLj.mjs → NcSelectTags-MwCs_QbM.mjs} +2 -2
- package/dist/chunks/{NcSelectTags-3BfQQNLj.mjs.map → NcSelectTags-MwCs_QbM.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-iuvfaq_W.cjs → NcSelectTags-beMN3ZsT.cjs} +1 -1
- package/dist/chunks/{NcSelectTags-iuvfaq_W.cjs.map → NcSelectTags-beMN3ZsT.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-JHuxEb64.cjs → NcSettingsInputText-0K3HYGJr.cjs} +3 -2
- package/dist/chunks/{NcSettingsInputText-JHuxEb64.cjs.map → NcSettingsInputText-0K3HYGJr.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-RH5qyxcD.mjs → NcSettingsInputText-Pz6fV7At.mjs} +4 -4
- package/dist/chunks/{NcSettingsInputText-RH5qyxcD.mjs.map → NcSettingsInputText-Pz6fV7At.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-u3WizmVu.mjs → NcSettingsSection-CRmU7GLC.mjs} +5 -5
- package/dist/chunks/NcSettingsSection-CRmU7GLC.mjs.map +1 -0
- package/dist/chunks/{NcSettingsSection-dsoWc5to.cjs → NcSettingsSection-IbUOeZ-e.cjs} +11 -10
- package/dist/chunks/NcSettingsSection-IbUOeZ-e.cjs.map +1 -0
- package/dist/chunks/{NcSettingsSelectGroup-l7ImtXiI.mjs → NcSettingsSelectGroup-HkS2QpZS.mjs} +5 -5
- package/dist/chunks/{NcSettingsSelectGroup-l7ImtXiI.mjs.map → NcSettingsSelectGroup-HkS2QpZS.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-obOOSE0Z.cjs → NcSettingsSelectGroup-msn3aYsn.cjs} +3 -2
- package/dist/chunks/{NcSettingsSelectGroup-obOOSE0Z.cjs.map → NcSettingsSelectGroup-msn3aYsn.cjs.map} +1 -1
- package/dist/chunks/{NcTextField-JlIIeRJa.mjs → NcTextField-NnW31cA4.mjs} +6 -6
- package/dist/chunks/NcTextField-NnW31cA4.mjs.map +1 -0
- package/dist/chunks/{NcTextField-5nK-T1Xg.cjs → NcTextField-eclRKl_B.cjs} +2 -2
- package/dist/chunks/NcTextField-eclRKl_B.cjs.map +1 -0
- package/dist/chunks/{NcTimezonePicker-1NMfD5lj.cjs → NcTimezonePicker-Cp479kFL.cjs} +1 -1
- package/dist/chunks/{NcTimezonePicker-1NMfD5lj.cjs.map → NcTimezonePicker-Cp479kFL.cjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-GDJZ0IwA.mjs → NcTimezonePicker-I6wF2jeF.mjs} +2 -2
- package/dist/chunks/{NcTimezonePicker-GDJZ0IwA.mjs.map → NcTimezonePicker-I6wF2jeF.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-ADV-rrgN.cjs → NcUserBubble-6AbwSr2B.cjs} +6 -5
- package/dist/chunks/{NcUserBubble-HoPxl8_o.mjs.map → NcUserBubble-6AbwSr2B.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-HoPxl8_o.mjs → NcUserBubble-imSUw-aP.mjs} +5 -5
- package/dist/chunks/{NcUserBubble-ADV-rrgN.cjs.map → NcUserBubble-imSUw-aP.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-WSxqK-Ix.cjs → NcUserStatusIcon-79RsINrv.cjs} +6 -5
- package/dist/chunks/{NcUserStatusIcon-dgPMbNYQ.mjs.map → NcUserStatusIcon-79RsINrv.cjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-dgPMbNYQ.mjs → NcUserStatusIcon-pRUzQidI.mjs} +4 -4
- package/dist/chunks/{NcUserStatusIcon-WSxqK-Ix.cjs.map → NcUserStatusIcon-pRUzQidI.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-8lJfv9VF.mjs → ScopeComponent-CjAOgGnx.mjs} +4 -4
- package/dist/chunks/{ScopeComponent-8lJfv9VF.mjs.map → ScopeComponent-CjAOgGnx.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-d_TBKnQk.cjs → ScopeComponent-V9SPec9g.cjs} +4 -4
- package/dist/chunks/{ScopeComponent-d_TBKnQk.cjs.map → ScopeComponent-V9SPec9g.cjs.map} +1 -1
- package/dist/chunks/_l10n-FmsZpnE4.mjs +66 -0
- package/dist/chunks/_l10n-FmsZpnE4.mjs.map +1 -0
- package/dist/chunks/_l10n-Od-4xzJA.cjs +64 -0
- package/dist/chunks/_l10n-Od-4xzJA.cjs.map +1 -0
- package/dist/chunks/{actionGlobal-_f-PhW84.cjs → actionGlobal-SGFis4LZ.cjs} +1 -1
- package/dist/chunks/{actionGlobal-ejpd0zqm.mjs.map → actionGlobal-SGFis4LZ.cjs.map} +1 -1
- package/dist/chunks/{actionGlobal-ejpd0zqm.mjs → actionGlobal-fRayfdEK.mjs} +1 -1
- package/dist/chunks/{actionGlobal-_f-PhW84.cjs.map → actionGlobal-fRayfdEK.mjs.map} +1 -1
- package/dist/chunks/{actionText-AoAs4kqP.mjs → actionText-bMy_49i8.mjs} +1 -1
- package/dist/chunks/{actionText-AoAs4kqP.mjs.map → actionText-bMy_49i8.mjs.map} +1 -1
- package/dist/chunks/{actionText-pGrMQtZ3.cjs → actionText-nj1gFMEY.cjs} +1 -1
- package/dist/chunks/{actionText-pGrMQtZ3.cjs.map → actionText-nj1gFMEY.cjs.map} +1 -1
- package/dist/chunks/{index-AX_b-FPF.cjs → index-U21dQVa7.cjs} +1 -0
- package/dist/chunks/{index-AX_b-FPF.cjs.map → index-U21dQVa7.cjs.map} +1 -1
- package/dist/chunks/{index-KrMGGc7j.mjs → index-n2q3iT69.mjs} +1 -0
- package/dist/chunks/{index-KrMGGc7j.mjs.map → index-n2q3iT69.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-tEVbhwha.mjs → referencePickerModal-FeA-PRqB.mjs} +14 -14
- package/dist/chunks/referencePickerModal-FeA-PRqB.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-byTgSeys.cjs → referencePickerModal-GXRJ351Q.cjs} +6 -5
- package/dist/chunks/referencePickerModal-GXRJ351Q.cjs.map +1 -0
- package/dist/chunks/{usernameToColor-ty7b2Xom.cjs → usernameToColor-D5bplyWJ.cjs} +1 -1
- package/dist/chunks/{usernameToColor-ty7b2Xom.cjs.map → usernameToColor-D5bplyWJ.cjs.map} +1 -1
- package/dist/chunks/{usernameToColor-LY-6e04n.mjs → usernameToColor-xm3MLiw4.mjs} +1 -1
- package/dist/chunks/{usernameToColor-LY-6e04n.mjs.map → usernameToColor-xm3MLiw4.mjs.map} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +48 -48
- package/dist/vendor.LICENSE.txt +1 -1
- package/package.json +3 -3
- package/dist/chunks/AlertCircleOutline-VgVvRWpm.cjs.map +0 -1
- package/dist/chunks/AlertCircleOutline-lwSRucNO.mjs.map +0 -1
- package/dist/chunks/ArrowLeft-3KC2k3tR.cjs.map +0 -1
- package/dist/chunks/ArrowLeft-buaCjhfr.mjs.map +0 -1
- package/dist/chunks/ArrowRight-4p6gv-9o.mjs.map +0 -1
- package/dist/chunks/ArrowRight-uEMed4kl.cjs.map +0 -1
- package/dist/chunks/Check-5uKO4aXx.cjs.map +0 -1
- package/dist/chunks/Check-FObi_cEO.mjs.map +0 -1
- package/dist/chunks/ChevronDown-TbRvziNU.mjs.map +0 -1
- package/dist/chunks/ChevronDown-rdCNNu7u.cjs.map +0 -1
- package/dist/chunks/ChevronRight-XOmSMmxA.mjs.map +0 -1
- package/dist/chunks/ChevronRight-bp7fT1r7.cjs.map +0 -1
- package/dist/chunks/Close-5Hzp7J3v.mjs.map +0 -1
- package/dist/chunks/Close-QFLrdRdG.cjs.map +0 -1
- package/dist/chunks/DotsHorizontal-NssXDZGM.mjs.map +0 -1
- package/dist/chunks/DotsHorizontal-dlN1WvqM.cjs.map +0 -1
- package/dist/chunks/NcActions-4ml5sv6P.cjs.map +0 -1
- package/dist/chunks/NcActions-5K-qjttC.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationCaption-E3tdVsYJ.mjs +0 -47
- package/dist/chunks/NcAppNavigationItem-CzK_gg7C.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationItem-r0MUwPP7.cjs.map +0 -1
- package/dist/chunks/NcAppNavigationSettings-0hLCj-s5.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationSettings-tvlinWey.cjs.map +0 -1
- package/dist/chunks/NcAppNavigationToggle-RXyDbzmn.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationToggle-ZTz_EO18.cjs +0 -109
- package/dist/chunks/NcAppNavigationToggle-ZTz_EO18.cjs.map +0 -1
- package/dist/chunks/NcAppSidebar-PMmg9vsl.cjs.map +0 -1
- package/dist/chunks/NcAppSidebar-qaRnOe4Y.mjs.map +0 -1
- package/dist/chunks/NcBreadcrumbs-H8ec0ouN.cjs.map +0 -1
- package/dist/chunks/NcBreadcrumbs-tq1eD4Hk.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch-BiREcGAk.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch-xEweFZs1.cjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-MzKjkB0t.mjs +0 -3
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-MzKjkB0t.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-hGgZcPUX.cjs +0 -3
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-hGgZcPUX.cjs.map +0 -1
- package/dist/chunks/NcColorPicker-2IJNZMe-.cjs.map +0 -1
- package/dist/chunks/NcColorPicker-H0rZhQxw.mjs.map +0 -1
- package/dist/chunks/NcEmojiPicker--8moif3g.mjs.map +0 -1
- package/dist/chunks/NcEmojiPicker-gGgrlLAJ.cjs.map +0 -1
- package/dist/chunks/NcListItem-_P2bxfeP.mjs.map +0 -1
- package/dist/chunks/NcListItem-wsOnBEF3.cjs.map +0 -1
- package/dist/chunks/NcPasswordField-XvXblBeQ.cjs.map +0 -1
- package/dist/chunks/NcPasswordField-kJ1PZotd.mjs.map +0 -1
- package/dist/chunks/NcRichText-N44WJqzt.cjs.map +0 -1
- package/dist/chunks/NcRichText-YSUTWw6M.mjs.map +0 -1
- package/dist/chunks/NcSettingsSection-dsoWc5to.cjs.map +0 -1
- package/dist/chunks/NcSettingsSection-u3WizmVu.mjs.map +0 -1
- package/dist/chunks/NcTextField-5nK-T1Xg.cjs.map +0 -1
- package/dist/chunks/NcTextField-JlIIeRJa.mjs.map +0 -1
- package/dist/chunks/_l10n-RVZyA63y.cjs +0 -64
- package/dist/chunks/_l10n-RVZyA63y.cjs.map +0 -1
- package/dist/chunks/_l10n-gZppkly8.mjs +0 -66
- package/dist/chunks/_l10n-gZppkly8.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-byTgSeys.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-tEVbhwha.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [v8.6.1](https://github.com/nextcloud-libraries/nextcloud-vue/tree/v8.6.1) (2024-02-01)
|
|
6
|
+
[Full Changelog](https://github.com/nextcloud-libraries/nextcloud-vue/compare/v8.6.0...v8.6.1)
|
|
7
|
+
|
|
8
|
+
### 🐛 Fixed bugs
|
|
9
|
+
* fix(NcAppNavigationNewItem): bring back correct CSS class [\#5194](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5194) \([raimund-schluessler](https://github.com/raimund-schluessler)\)
|
|
10
|
+
* revert: fix(NcActions): use new slots api [\#5196](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5196) \([ShGKme](https://github.com/ShGKme)\)
|
|
11
|
+
|
|
12
|
+
### Other Changes
|
|
13
|
+
* Updated translations
|
|
14
|
+
* fix(CI): Adjust npm-publish to work with GPR [\#5183](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5183) \([susnux](https://github.com/susnux)\)
|
|
15
|
+
* chore(CHANGELOG): Add missing entry for 8.6.0 release [\#5192](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5192) \([susnux](https://github.com/susnux)\)
|
|
16
|
+
|
|
17
|
+
## [v8.6.0](https://github.com/nextcloud-libraries/nextcloud-vue/tree/v8.6.0) (2024-01-30)
|
|
18
|
+
[Full Changelog](https://github.com/nextcloud-libraries/nextcloud-vue/compare/v8.5.1...v8.6.0)
|
|
19
|
+
|
|
20
|
+
### 🚀 Enhancements
|
|
21
|
+
* feat: Implement widget flag for requesting interactive view by @juliushaertl in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5144
|
|
22
|
+
* feat(NcListItem): introduce 'details' slot by @Antreesy in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5146
|
|
23
|
+
* feat(NcNoteCard): provide a slot for inserting a custom icon instead of default by @Antreesy in https://github.com/nextcloud-libraries/nextcloud-vue/pull/4894
|
|
24
|
+
* feat(NcActionButton): support boolean value for radio type by @ShGKme in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5134
|
|
25
|
+
|
|
26
|
+
### 🐛 Fixed bugs
|
|
27
|
+
* fix(NcActions): keyboard navigation by @ShGKme in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5153
|
|
28
|
+
* fix(NcSelect): list width on page scaling by @ShGKme in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5162
|
|
29
|
+
* fix(NcColorPicker): define a container prop by @Antreesy in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5172
|
|
30
|
+
* fix(NcActions): intercept into current focus trap stack by @ShGKme in https://github.com/nextcloud-libraries/nextcloud-vue/pull/4953
|
|
31
|
+
* fix(NcRichText): Make URL_PATTERN match localhost and URLs with ports by @mejo- in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5176
|
|
32
|
+
* fix(NcActions): hotfix for custom children by @ShGKme in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5178
|
|
33
|
+
* fix(NcDateTimePickerNative): create possibility to change a color theme on system default by @JuliaKirschenheuter in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5182
|
|
34
|
+
|
|
35
|
+
### Other Changes
|
|
36
|
+
* Updates for project Nextcloud vue library by @transifex-integration in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5157
|
|
37
|
+
* chore: Fix missing PR from changelog by @Pytal in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5175
|
|
38
|
+
* chore(NcAppNavigationToggle): add comments by @emoral435 in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5148
|
|
39
|
+
* chore: Update workflows by @susnux in https://github.com/nextcloud-libraries/nextcloud-vue/pull/5148
|
|
40
|
+
|
|
5
41
|
## [v8.5.1](https://github.com/nextcloud-libraries/nextcloud-vue/tree/v8.5.1) (2024-01-24)
|
|
6
42
|
[Full Changelog](https://github.com/nextcloud-libraries/nextcloud-vue/compare/v8.5.0...v8.5.1)
|
|
7
43
|
|
|
@@ -13,6 +49,7 @@ All notable changes to this project will be documented in this file.
|
|
|
13
49
|
* fix(header): width regression fixed [\#5129](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5129) \([emoral435](https://github.com/emoral435)\)
|
|
14
50
|
* fix(NcCheckboxRadioSwitch): Make sure to include current value in checked array [\#5150](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5150) \([susnux](https://github.com/susnux)\)
|
|
15
51
|
* fix: Ensure no double scrollbars for NcDialog and NcAppNavigationSettings [\#5139](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5139) \([susnux](https://github.com/susnux)\)
|
|
52
|
+
* fix(NcAvatar): Remove span wrapper button semantics in favour of internal button components [\#5131](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5131) \([Pytal](https://github.com/Pytal)\)
|
|
16
53
|
|
|
17
54
|
### Other Changes
|
|
18
55
|
* Updated translation
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
require('../assets/NcActionButton-1Z9lN7ar.css');
|
|
2
|
+
"use strict";
|
|
3
|
+
const n = require("../chunks/Check-QBzDcHpr.cjs"), s = require("../chunks/ChevronRight-MdQC55Yq.cjs"), a = require("../chunks/actionText-nj1gFMEY.cjs"), o = require("../chunks/_plugin-vue2_normalizer-DCfUPqga.cjs"), l = {
|
|
3
4
|
name: "NcActionButton",
|
|
4
5
|
components: {
|
|
5
6
|
CheckIcon: n.Check,
|
|
@@ -48,8 +49,10 @@ const n = require("../chunks/Check-5uKO4aXx.cjs"), s = require("../chunks/Chevro
|
|
|
48
49
|
validator: (e) => ["button", "checkbox", "radio", "reset", "submit"].includes(e)
|
|
49
50
|
},
|
|
50
51
|
/**
|
|
51
|
-
* The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected)
|
|
52
|
-
*
|
|
52
|
+
* The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected).
|
|
53
|
+
* For checkbox and toggle button behavior - boolean value.
|
|
54
|
+
* For radio button behavior - could be a boolean checked or a string with the value of the button.
|
|
55
|
+
* Note: Unlike native radio buttons, NcActionButton are not grouped by name, so you need to connect them by bind correct modelValue.
|
|
53
56
|
*
|
|
54
57
|
* **This is not availabe for `type='submit'` or `type='reset'`**
|
|
55
58
|
*
|
|
@@ -82,7 +85,7 @@ const n = require("../chunks/Check-5uKO4aXx.cjs"), s = require("../chunks/Chevro
|
|
|
82
85
|
* The current "checked" or "pressed" state for the model behavior
|
|
83
86
|
*/
|
|
84
87
|
isChecked() {
|
|
85
|
-
return this.type === "radio" ? this.modelValue === this.value : this.modelValue;
|
|
88
|
+
return this.type === "radio" && typeof this.modelValue != "boolean" ? this.modelValue === this.value : this.modelValue;
|
|
86
89
|
},
|
|
87
90
|
/**
|
|
88
91
|
* The native HTML type to set on the button
|
|
@@ -104,7 +107,7 @@ const n = require("../chunks/Check-5uKO4aXx.cjs"), s = require("../chunks/Chevro
|
|
|
104
107
|
* @param {MouseEvent} event The click event
|
|
105
108
|
*/
|
|
106
109
|
handleClick(e) {
|
|
107
|
-
this.onClick(e), (this.modelValue !== null || this.type !== "button") && (this.type === "radio" ? this.isChecked || this.$emit("update:modelValue", this.value) : this.$emit("update:modelValue", !this.isChecked));
|
|
110
|
+
this.onClick(e), (this.modelValue !== null || this.type !== "button") && (this.type === "radio" ? typeof this.modelValue != "boolean" ? this.isChecked || this.$emit("update:modelValue", this.value) : this.$emit("update:modelValue", !this.isChecked) : this.$emit("update:modelValue", !this.isChecked));
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
};
|
|
@@ -122,7 +125,7 @@ var c = function() {
|
|
|
122
125
|
u,
|
|
123
126
|
!1,
|
|
124
127
|
null,
|
|
125
|
-
"
|
|
128
|
+
"04ec546c",
|
|
126
129
|
null,
|
|
127
130
|
null
|
|
128
131
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcActionButton.cjs","sources":["../../src/components/NcActionButton/NcActionButton.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Delete')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDelete\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :close-after-click=\"true\" @click=\"showMessage('Delete and close menu')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDelete and close\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :is-menu=\"true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tCreate\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :disabled=\"true\" @click=\"showMessage('Disabled')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDisabled button\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Delete from 'vue-material-design-icons/Delete'\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tDelete,\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\nIf you're using a long text you can specify a name\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Add')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd new\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton name=\"Long button\" @click=\"showMessage('Delete')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tThis button is associated with a very long text.\\nAnd with new lines too.\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Delete from 'vue-material-design-icons/Delete'\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tDelete,\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n\n```\n\nAction icon attribute with a single action\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Add')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd new\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n\n```\n\nYou can also use a custom icon, for example from the vue-material-design-icons library:\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton>\n\t\t\t<template #icon>\n\t\t\t\t<HandBackLeft :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise left hand\n\t\t</NcActionButton>\n\t\t<NcActionButton>\n\t\t\t<template #icon>\n\t\t\t\t<HandBackRight :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise right hand\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport HandBackLeft from 'vue-material-design-icons/HandBackLeft'\nimport HandBackRight from 'vue-material-design-icons/HandBackRight'\n\nexport default {\n\tcomponents: {\n\t\tHandBackLeft,\n\t\tHandBackRight,\n\t},\n}\n</script>\n```\n\n### With different model behavior\nBy default the button will act like a normal button, but it is also possible to change the behavior to a toggle button, checkbox button or radio button.\n\nFor example to have the button act like a toggle button just set the `modelValue` property to the toggle state:\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"fullscreen\">\n\t\t\t<template #icon>\n\t\t\t\t<Fullscreen :size=\"20\" />\n\t\t\t</template>\n\t\t\tFullscreen\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport Fullscreen from 'vue-material-design-icons/Fullscreen.vue'\n\nexport default {\n\tcomponents: {\n\t\tFullscreen,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfullscreen: true,\n\t\t}\n\t},\n}\n</script>\n```\n\nAnother example would be using it with checkbox semantics, to enable or disable features.\nThis also allows tri-state behavior (`true`, `false`, `null`) in which case `aria-checked` will be either `true`, `false` or `mixed`.\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"handRaised\" type=\"checkbox\">\n\t\t\t<template #icon>\n\t\t\t\t<HandBackLeft :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise hand\n\t\t</NcActionButton>\n\t\t<NcActionButton :model-value.sync=\"fullscreen\" type=\"checkbox\">\n\t\t\t<template #icon>\n\t\t\t\t<Fullscreen :size=\"20\" />\n\t\t\t</template>\n\t\t\tFullscreen\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport HandBackLeft from 'vue-material-design-icons/HandBackLeft.vue'\nimport Fullscreen from 'vue-material-design-icons/Fullscreen.vue'\n\nexport default {\n\tcomponents: {\n\t\tHandBackLeft,\n\t\tFullscreen,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfullscreen: true,\n\t\t\thandRaised: false,\n\t\t}\n\t},\n}\n</script>\n```\n\nIt is also possible to use the button with radio semantics, this is only possible in menus and not for inline actions!\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"payment\" type=\"radio\" value=\"cash\">\n\t\t\t<template #icon>\n\t\t\t\t<Cash :size=\"20\" />\n\t\t\t</template>\n\t\t\tPay with cash\n\t\t</NcActionButton>\n\t\t<NcActionButton :model-value.sync=\"payment\" type=\"radio\" value=\"card\">\n\t\t\t<template #icon>\n\t\t\t\t<CreditCard :size=\"20\" />\n\t\t\t</template>\n\t\t\tPay by card\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport Cash from 'vue-material-design-icons/Cash.vue'\nimport CreditCard from 'vue-material-design-icons/CreditCard.vue'\n\nexport default {\n\tcomponents: {\n\t\tCash,\n\t\tCreditCard,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tpayment: 'card',\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<li class=\"action\" :class=\"{ 'action--disabled': disabled }\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t<button :aria-label=\"ariaLabel\"\n\t\t\t:class=\"['action-button button-vue', {\n\t\t\t\t'action-button--active': isChecked,\n\t\t\t\tfocusable: isFocusable,\n\t\t\t}]\"\n\t\t\t:title=\"title\"\n\t\t\t:type=\"nativeType\"\n\t\t\tv-bind=\"buttonAttributes\"\n\t\t\t@click=\"handleClick\">\n\t\t\t<!-- @slot Manually provide icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<span :class=\"[isIconUrl ? 'action-button__icon--url' : icon]\"\n\t\t\t\t\t:style=\"{ backgroundImage: isIconUrl ? `url(${icon})` : null }\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"action-button__icon\" />\n\t\t\t</slot>\n\n\t\t\t<!-- long text with name -->\n\t\t\t<span v-if=\"name\"\n\t\t\t\tclass=\"action-button__longtext-wrapper\">\n\t\t\t\t<strong class=\"action-button__name\">\n\t\t\t\t\t{{ name }}\n\t\t\t\t</strong>\n\t\t\t\t<br>\n\t\t\t\t<!-- white space is shown on longtext, so we can't\n\t\t\t\t\tput {{ text }} on a new line for code readability -->\n\t\t\t\t<span class=\"action-button__longtext\" v-text=\"text\" />\n\t\t\t</span>\n\n\t\t\t<!-- long text only -->\n\t\t\t<!-- white space is shown on longtext, so we can't\n\t\t\t\tput {{ text }} on a new line for code readability -->\n\t\t\t<span v-else-if=\"isLongText\"\n\t\t\t\tclass=\"action-button__longtext\"\n\t\t\t\tv-text=\"text\" />\n\n\t\t\t<!-- default text display -->\n\t\t\t<span v-else class=\"action-button__text\">{{ text }}</span>\n\n\t\t\t<!-- right arrow icon when there is a sub-menu -->\n\t\t\t<ChevronRightIcon v-if=\"isMenu\" :size=\"20\" class=\"action-button__menu-icon\" />\n\t\t\t<CheckIcon v-else-if=\"isChecked === true\" :size=\"20\" class=\"action-button__pressed-icon\" />\n\t\t\t<span v-else-if=\"isChecked === false\" class=\"action-button__pressed-icon material-design-icon\" />\n\n\t\t\t<!-- fake slot to gather inner text -->\n\t\t\t<slot v-if=\"false\" />\n\t\t</button>\n\t</li>\n</template>\n\n<script>\nimport CheckIcon from 'vue-material-design-icons/Check.vue'\nimport ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'\nimport ActionTextMixin from '../../mixins/actionText.js'\n\n/**\n * Button component to be used in Actions\n */\nexport default {\n\tname: 'NcActionButton',\n\n\tcomponents: {\n\t\tCheckIcon,\n\t\tChevronRightIcon,\n\t},\n\tmixins: [ActionTextMixin],\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * @deprecated To be removed in @nextcloud/vue 9. Migration guide: remove ariaHidden prop from NcAction* components.\n\t\t * @todo Add a check in @nextcloud/vue 9 that this prop is not provided,\n\t\t * otherwise root element will inherit incorrect aria-hidden.\n\t\t */\n\t\tariaHidden: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the action button\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * If this is a menu, a chevron icon will\n\t\t * be added at the end of the line\n\t\t */\n\t\tisMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The button's behavior, by default the button acts like a normal button with optional toggle button behavior if `modelValue` is `true` or `false`.\n\t\t * But you can also set to checkbox button behavior with tri-state or radio button like behavior.\n\t\t * This extends the native HTML button type attribute.\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'button',\n\t\t\tvalidator: (behavior) => ['button', 'checkbox', 'radio', 'reset', 'submit'].includes(behavior),\n\t\t},\n\n\t\t/**\n\t\t * The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected)\n\t\t * Either boolean for checkbox and toggle button behavior or `value` for radio behavior.\n\t\t *\n\t\t * **This is not availabe for `type='submit'` or `type='reset'`**\n\t\t *\n\t\t * If using `type='checkbox'` a `model-value` of `true` means checked, `false` means unchecked and `null` means indeterminate (tri-state)\n\t\t * For `type='radio'` `null` is equal to `false`\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The value used for the `modelValue` when this component is used with radio behavior\n\t\t * Similar to the `value` attribute of `<input type=\"radio\">`\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * determines if the action is focusable\n\t\t *\n\t\t * @return {boolean} is the action focusable ?\n\t\t */\n\t\tisFocusable() {\n\t\t\treturn !this.disabled\n\t\t},\n\n\t\t/**\n\t\t * The current \"checked\" or \"pressed\" state for the model behavior\n\t\t */\n\t\tisChecked() {\n\t\t\tif (this.type === 'radio') {\n\t\t\t\treturn this.modelValue === this.value\n\t\t\t}\n\t\t\treturn this.modelValue\n\t\t},\n\n\t\t/**\n\t\t * The native HTML type to set on the button\n\t\t */\n\t\tnativeType() {\n\t\t\tif (this.type === 'submit' || this.type === 'reset') {\n\t\t\t\treturn this.type\n\t\t\t}\n\t\t\treturn 'button'\n\t\t},\n\n\t\t/**\n\t\t * HTML attributes to bind to the <button>\n\t\t */\n\t\tbuttonAttributes() {\n\t\t\tconst attributes = {}\n\n\t\t\tif (this.isInSemanticMenu) {\n\t\t\t\t// By default it needs to be a menu item in semantic menus\n\t\t\t\tattributes.role = 'menuitem'\n\n\t\t\t\tif (this.type === 'radio') {\n\t\t\t\t\tattributes.role = 'menuitemradio'\n\t\t\t\t\tattributes['aria-checked'] = this.isChecked ? 'true' : 'false'\n\t\t\t\t} else if (this.type === 'checkbox' || (this.nativeType === 'button' && this.modelValue !== null)) {\n\t\t\t\t\t// either if checkbox behavior was set or the model value is not unset\n\t\t\t\t\tattributes.role = 'menuitemcheckbox'\n\t\t\t\t\tattributes['aria-checked'] = this.modelValue === null ? 'mixed' : (this.modelValue ? 'true' : 'false')\n\t\t\t\t}\n\t\t\t} else if (this.modelValue !== null && this.nativeType === 'button') {\n\t\t\t\t// In case this has a modelValue it is considered a toggle button, so we need to set the aria-pressed\n\t\t\t\tattributes['aria-pressed'] = this.modelValue ? 'true' : 'false'\n\t\t\t}\n\n\t\t\treturn attributes\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Forward click event, let mixin handle the close-after-click and emit new modelValue if needed\n\t\t * @param {MouseEvent} event The click event\n\t\t */\n\t\thandleClick(event) {\n\t\t\tthis.onClick(event)\n\t\t\t// If modelValue or type is set (so modelValue might be null for tri-state) we need to update it\n\t\t\tif (this.modelValue !== null || this.type !== 'button') {\n\t\t\t\tif (this.type === 'radio') {\n\t\t\t\t\tif (!this.isChecked) {\n\t\t\t\t\t\tthis.$emit('update:modelValue', this.value)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.$emit('update:modelValue', !this.isChecked)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../../assets/action';\n@include action-active;\n@include action--disabled;\n@include action-item('button');\n\n.action-button__pressed-icon {\n\tmargin-left: auto;\n\tmargin-right: -$icon-margin;\n}\n</style>\n"],"names":["_sfc_main","Check","ChevronRight","actionText","behavior","attributes","event"],"mappings":";wNAsVAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,WAAAC,EAAA;AAAA,IACA,kBAAAC,EAAA;AAAA,EACA;AAAA,EACA,QAAA,CAAAC,EAAA,eAAA;AAAA,EAEA,QAAA;AAAA,IACA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,UAAA,YAAA,SAAA,SAAA,QAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,YAAA;AAAA,MACA,MAAA,CAAA,SAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AACA,aAAA,CAAA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AACA,aAAA,KAAA,SAAA,UACA,KAAA,eAAA,KAAA,QAEA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AACA,aAAA,KAAA,SAAA,YAAA,KAAA,SAAA,UACA,KAAA,OAEA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAA;AACA,YAAAC,IAAA,CAAA;AAEA,aAAA,KAAA,oBAEAA,EAAA,OAAA,YAEA,KAAA,SAAA,WACAA,EAAA,OAAA,iBACAA,EAAA,cAAA,IAAA,KAAA,YAAA,SAAA,YACA,KAAA,SAAA,cAAA,KAAA,eAAA,YAAA,KAAA,eAAA,UAEAA,EAAA,OAAA,oBACAA,EAAA,cAAA,IAAA,KAAA,eAAA,OAAA,UAAA,KAAA,aAAA,SAAA,YAEA,KAAA,eAAA,QAAA,KAAA,eAAA,aAEAA,EAAA,cAAA,IAAA,KAAA,aAAA,SAAA,UAGAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAAC,GAAA;AACA,WAAA,QAAAA,CAAA,IAEA,KAAA,eAAA,QAAA,KAAA,SAAA,cACA,KAAA,SAAA,UACA,KAAA,aACA,KAAA,MAAA,qBAAA,KAAA,KAAA,IAGA,KAAA,MAAA,qBAAA,CAAA,KAAA,SAAA;AAAA,IAGA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcActionButton.cjs","sources":["../../src/components/NcActionButton/NcActionButton.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Delete')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDelete\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :close-after-click=\"true\" @click=\"showMessage('Delete and close menu')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDelete and close\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :is-menu=\"true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tCreate\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :disabled=\"true\" @click=\"showMessage('Disabled')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDisabled button\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Delete from 'vue-material-design-icons/Delete'\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tDelete,\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\nIf you're using a long text you can specify a name\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Add')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd new\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton name=\"Long button\" @click=\"showMessage('Delete')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tThis button is associated with a very long text.\\nAnd with new lines too.\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Delete from 'vue-material-design-icons/Delete'\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tDelete,\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n\n```\n\nAction icon attribute with a single action\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Add')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd new\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n\n```\n\nYou can also use a custom icon, for example from the vue-material-design-icons library:\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton>\n\t\t\t<template #icon>\n\t\t\t\t<HandBackLeft :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise left hand\n\t\t</NcActionButton>\n\t\t<NcActionButton>\n\t\t\t<template #icon>\n\t\t\t\t<HandBackRight :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise right hand\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport HandBackLeft from 'vue-material-design-icons/HandBackLeft'\nimport HandBackRight from 'vue-material-design-icons/HandBackRight'\n\nexport default {\n\tcomponents: {\n\t\tHandBackLeft,\n\t\tHandBackRight,\n\t},\n}\n</script>\n```\n\n### With different model behavior\nBy default the button will act like a normal button, but it is also possible to change the behavior to a toggle button, checkbox button or radio button.\n\nFor example to have the button act like a toggle button just set the `modelValue` property to the toggle state:\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"fullscreen\">\n\t\t\t<template #icon>\n\t\t\t\t<Fullscreen :size=\"20\" />\n\t\t\t</template>\n\t\t\tFullscreen\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport Fullscreen from 'vue-material-design-icons/Fullscreen.vue'\n\nexport default {\n\tcomponents: {\n\t\tFullscreen,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfullscreen: true,\n\t\t}\n\t},\n}\n</script>\n```\n\nAnother example would be using it with checkbox semantics, to enable or disable features.\nThis also allows tri-state behavior (`true`, `false`, `null`) in which case `aria-checked` will be either `true`, `false` or `mixed`.\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"handRaised\" type=\"checkbox\">\n\t\t\t<template #icon>\n\t\t\t\t<HandBackLeft :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise hand\n\t\t</NcActionButton>\n\t\t<NcActionButton :model-value.sync=\"fullscreen\" type=\"checkbox\">\n\t\t\t<template #icon>\n\t\t\t\t<Fullscreen :size=\"20\" />\n\t\t\t</template>\n\t\t\tFullscreen\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport HandBackLeft from 'vue-material-design-icons/HandBackLeft.vue'\nimport Fullscreen from 'vue-material-design-icons/Fullscreen.vue'\n\nexport default {\n\tcomponents: {\n\t\tHandBackLeft,\n\t\tFullscreen,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfullscreen: true,\n\t\t\thandRaised: false,\n\t\t}\n\t},\n}\n</script>\n```\n\nIt is also possible to use the button with radio semantics, this is only possible in menus and not for inline actions!\n\nWith a string `modelValue`, checked state is determined by the `value` property and updates `modelValue` with the new `value` string.\n\nWith a boolean `modelValue`, checked state is determined by `modelValue` and updates to `true` on check.\n\nNote: unlike native radio buttons, `NcActionButton` are not grouped by name, so you need to connect them by bind correct `modelValue``.\n\n```vue\n<template>\n\t<div>\n\t\t<NcActions>\n\t\t\t<NcActionButton :model-value.sync=\"payment\" type=\"radio\" value=\"cash\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Cash :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tPay with cash\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :model-value.sync=\"payment\" type=\"radio\" value=\"card\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CreditCard :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tPay by card\n\t\t\t</NcActionButton>\n\t\t\t<NcActionSeparator />\n\t\t\t<NcActionButton type=\"radio\" :model-value=\"align.isLeft\" @update:modelValue=\"setAlign('Left', $event)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FormatAlignLeft :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tLeft\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton type=\"radio\" :model-value=\"align.isCenter\" @update:modelValue=\"setAlign('Center', $event)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FormatAlignCenter :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tCenter\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton type=\"radio\" :model-value=\"align.isRight\" @update:modelValue=\"setAlign('Right', $event)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FormatAlignRight :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tRight\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t\t<p>payment = \"{{ payment }}\"</p>\n\t\t<p>align.isLeft = {{ align.isLeft }}</p>\n\t\t<p>align.isCenter = {{ align.isCenter }}</p>\n\t\t<p>align.isRight = {{ align.isRight }}</p>\n\t</div>\n</template>\n<script>\nimport Cash from 'vue-material-design-icons/Cash.vue'\nimport CreditCard from 'vue-material-design-icons/CreditCard.vue'\nimport FormatAlignLeft from 'vue-material-design-icons/FormatAlignLeft.vue'\nimport FormatAlignCenter from 'vue-material-design-icons/FormatAlignCenter.vue'\nimport FormatAlignRight from 'vue-material-design-icons/FormatAlignRight.vue'\n\nexport default {\n\tcomponents: {\n\t\tCash,\n\t\tCreditCard,\n\t\tFormatAlignLeft,\n\t\tFormatAlignCenter,\n\t\tFormatAlignRight,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tpayment: 'card',\n\t\t\talign: {\n\t\t\t\tisLeft: false,\n\t\t\t\tisCenter: true,\n\t\t\t\tisRight: false,\n\t\t\t},\n\t\t}\n\t},\n\tmethods: {\n\t\tsetAlign(direction, value) {\n\t\t\tthis.align.isLeft = false\n\t\t\tthis.align.isCenter = false\n\t\t\tthis.align.isRight = false\n\t\t\tthis.align[`is${direction}`] = value\n\t\t},\n\t}\n}\n</script>\n```\n</docs>\n\n<template>\n\t<li class=\"action\" :class=\"{ 'action--disabled': disabled }\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t<button :aria-label=\"ariaLabel\"\n\t\t\t:class=\"['action-button button-vue', {\n\t\t\t\t'action-button--active': isChecked,\n\t\t\t\tfocusable: isFocusable,\n\t\t\t}]\"\n\t\t\t:title=\"title\"\n\t\t\t:type=\"nativeType\"\n\t\t\tv-bind=\"buttonAttributes\"\n\t\t\t@click=\"handleClick\">\n\t\t\t<!-- @slot Manually provide icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<span :class=\"[isIconUrl ? 'action-button__icon--url' : icon]\"\n\t\t\t\t\t:style=\"{ backgroundImage: isIconUrl ? `url(${icon})` : null }\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"action-button__icon\" />\n\t\t\t</slot>\n\n\t\t\t<!-- long text with name -->\n\t\t\t<span v-if=\"name\"\n\t\t\t\tclass=\"action-button__longtext-wrapper\">\n\t\t\t\t<strong class=\"action-button__name\">\n\t\t\t\t\t{{ name }}\n\t\t\t\t</strong>\n\t\t\t\t<br>\n\t\t\t\t<!-- white space is shown on longtext, so we can't\n\t\t\t\t\tput {{ text }} on a new line for code readability -->\n\t\t\t\t<span class=\"action-button__longtext\" v-text=\"text\" />\n\t\t\t</span>\n\n\t\t\t<!-- long text only -->\n\t\t\t<!-- white space is shown on longtext, so we can't\n\t\t\t\tput {{ text }} on a new line for code readability -->\n\t\t\t<span v-else-if=\"isLongText\"\n\t\t\t\tclass=\"action-button__longtext\"\n\t\t\t\tv-text=\"text\" />\n\n\t\t\t<!-- default text display -->\n\t\t\t<span v-else class=\"action-button__text\">{{ text }}</span>\n\n\t\t\t<!-- right arrow icon when there is a sub-menu -->\n\t\t\t<ChevronRightIcon v-if=\"isMenu\" :size=\"20\" class=\"action-button__menu-icon\" />\n\t\t\t<CheckIcon v-else-if=\"isChecked === true\" :size=\"20\" class=\"action-button__pressed-icon\" />\n\t\t\t<span v-else-if=\"isChecked === false\" class=\"action-button__pressed-icon material-design-icon\" />\n\n\t\t\t<!-- fake slot to gather inner text -->\n\t\t\t<slot v-if=\"false\" />\n\t\t</button>\n\t</li>\n</template>\n\n<script>\nimport CheckIcon from 'vue-material-design-icons/Check.vue'\nimport ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'\nimport ActionTextMixin from '../../mixins/actionText.js'\n\n/**\n * Button component to be used in Actions\n */\nexport default {\n\tname: 'NcActionButton',\n\n\tcomponents: {\n\t\tCheckIcon,\n\t\tChevronRightIcon,\n\t},\n\tmixins: [ActionTextMixin],\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * @deprecated To be removed in @nextcloud/vue 9. Migration guide: remove ariaHidden prop from NcAction* components.\n\t\t * @todo Add a check in @nextcloud/vue 9 that this prop is not provided,\n\t\t * otherwise root element will inherit incorrect aria-hidden.\n\t\t */\n\t\tariaHidden: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the action button\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * If this is a menu, a chevron icon will\n\t\t * be added at the end of the line\n\t\t */\n\t\tisMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The button's behavior, by default the button acts like a normal button with optional toggle button behavior if `modelValue` is `true` or `false`.\n\t\t * But you can also set to checkbox button behavior with tri-state or radio button like behavior.\n\t\t * This extends the native HTML button type attribute.\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'button',\n\t\t\tvalidator: (behavior) => ['button', 'checkbox', 'radio', 'reset', 'submit'].includes(behavior),\n\t\t},\n\n\t\t/**\n\t\t * The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected).\n\t\t * For checkbox and toggle button behavior - boolean value.\n\t\t * For radio button behavior - could be a boolean checked or a string with the value of the button.\n\t\t * Note: Unlike native radio buttons, NcActionButton are not grouped by name, so you need to connect them by bind correct modelValue.\n\t\t *\n\t\t * **This is not availabe for `type='submit'` or `type='reset'`**\n\t\t *\n\t\t * If using `type='checkbox'` a `model-value` of `true` means checked, `false` means unchecked and `null` means indeterminate (tri-state)\n\t\t * For `type='radio'` `null` is equal to `false`\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The value used for the `modelValue` when this component is used with radio behavior\n\t\t * Similar to the `value` attribute of `<input type=\"radio\">`\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * determines if the action is focusable\n\t\t *\n\t\t * @return {boolean} is the action focusable ?\n\t\t */\n\t\tisFocusable() {\n\t\t\treturn !this.disabled\n\t\t},\n\n\t\t/**\n\t\t * The current \"checked\" or \"pressed\" state for the model behavior\n\t\t */\n\t\tisChecked() {\n\t\t\tif (this.type === 'radio' && typeof this.modelValue !== 'boolean') {\n\t\t\t\treturn this.modelValue === this.value\n\t\t\t}\n\t\t\treturn this.modelValue\n\t\t},\n\n\t\t/**\n\t\t * The native HTML type to set on the button\n\t\t */\n\t\tnativeType() {\n\t\t\tif (this.type === 'submit' || this.type === 'reset') {\n\t\t\t\treturn this.type\n\t\t\t}\n\t\t\treturn 'button'\n\t\t},\n\n\t\t/**\n\t\t * HTML attributes to bind to the <button>\n\t\t */\n\t\tbuttonAttributes() {\n\t\t\tconst attributes = {}\n\n\t\t\tif (this.isInSemanticMenu) {\n\t\t\t\t// By default it needs to be a menu item in semantic menus\n\t\t\t\tattributes.role = 'menuitem'\n\n\t\t\t\tif (this.type === 'radio') {\n\t\t\t\t\tattributes.role = 'menuitemradio'\n\t\t\t\t\tattributes['aria-checked'] = this.isChecked ? 'true' : 'false'\n\t\t\t\t} else if (this.type === 'checkbox' || (this.nativeType === 'button' && this.modelValue !== null)) {\n\t\t\t\t\t// either if checkbox behavior was set or the model value is not unset\n\t\t\t\t\tattributes.role = 'menuitemcheckbox'\n\t\t\t\t\tattributes['aria-checked'] = this.modelValue === null ? 'mixed' : (this.modelValue ? 'true' : 'false')\n\t\t\t\t}\n\t\t\t} else if (this.modelValue !== null && this.nativeType === 'button') {\n\t\t\t\t// In case this has a modelValue it is considered a toggle button, so we need to set the aria-pressed\n\t\t\t\tattributes['aria-pressed'] = this.modelValue ? 'true' : 'false'\n\t\t\t}\n\n\t\t\treturn attributes\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Forward click event, let mixin handle the close-after-click and emit new modelValue if needed\n\t\t * @param {MouseEvent} event The click event\n\t\t */\n\t\thandleClick(event) {\n\t\t\tthis.onClick(event)\n\t\t\t// If modelValue or type is set (so modelValue might be null for tri-state) we need to update it\n\t\t\tif (this.modelValue !== null || this.type !== 'button') {\n\t\t\t\tif (this.type === 'radio') {\n\t\t\t\t\tif (typeof this.modelValue !== 'boolean') {\n\t\t\t\t\t\t// String-value radios behavior is similar to native - click on checked radio does nothing\n\t\t\t\t\t\tif (!this.isChecked) {\n\t\t\t\t\t\t\tthis.$emit('update:modelValue', this.value)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Boolean radio allows to uncheck\n\t\t\t\t\t\tthis.$emit('update:modelValue', !this.isChecked)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Checkbox toggles value\n\t\t\t\t\tthis.$emit('update:modelValue', !this.isChecked)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../../assets/action';\n@include action-active;\n@include action--disabled;\n@include action-item('button');\n\n.action-button__pressed-icon {\n\tmargin-left: auto;\n\tmargin-right: -$icon-margin;\n}\n</style>\n"],"names":["_sfc_main","CheckIcon","ChevronRightIcon","ActionTextMixin","behavior","attributes","event"],"mappings":";wNAwYAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,WAAAC,EAAA;AAAA,IACA,kBAAAC,EAAA;AAAA,EACA;AAAA,EACA,QAAA,CAAAC,EAAAA,eAAA;AAAA,EAEA,QAAA;AAAA,IACA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,UAAA,YAAA,SAAA,SAAA,QAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA,YAAA;AAAA,MACA,MAAA,CAAA,SAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AACA,aAAA,CAAA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AACA,aAAA,KAAA,SAAA,WAAA,OAAA,KAAA,cAAA,YACA,KAAA,eAAA,KAAA,QAEA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AACA,aAAA,KAAA,SAAA,YAAA,KAAA,SAAA,UACA,KAAA,OAEA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAA;AACA,YAAAC,IAAA,CAAA;AAEA,aAAA,KAAA,oBAEAA,EAAA,OAAA,YAEA,KAAA,SAAA,WACAA,EAAA,OAAA,iBACAA,EAAA,cAAA,IAAA,KAAA,YAAA,SAAA,YACA,KAAA,SAAA,cAAA,KAAA,eAAA,YAAA,KAAA,eAAA,UAEAA,EAAA,OAAA,oBACAA,EAAA,cAAA,IAAA,KAAA,eAAA,OAAA,UAAA,KAAA,aAAA,SAAA,YAEA,KAAA,eAAA,QAAA,KAAA,eAAA,aAEAA,EAAA,cAAA,IAAA,KAAA,aAAA,SAAA,UAGAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAAC,GAAA;AACA,WAAA,QAAAA,CAAA,IAEA,KAAA,eAAA,QAAA,KAAA,SAAA,cACA,KAAA,SAAA,UACA,OAAA,KAAA,cAAA,YAEA,KAAA,aACA,KAAA,MAAA,qBAAA,KAAA,KAAA,IAIA,KAAA,MAAA,qBAAA,CAAA,KAAA,SAAA,IAIA,KAAA,MAAA,qBAAA,CAAA,KAAA,SAAA;AAAA,IAGA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { C as
|
|
3
|
-
import { C as
|
|
4
|
-
import { A as a } from "../chunks/actionText-
|
|
1
|
+
import '../assets/NcActionButton-1Z9lN7ar.css';
|
|
2
|
+
import { C as s } from "../chunks/Check-qy5XrF1J.mjs";
|
|
3
|
+
import { C as n } from "../chunks/ChevronRight-9owhU_17.mjs";
|
|
4
|
+
import { A as a } from "../chunks/actionText-bMy_49i8.mjs";
|
|
5
5
|
import { n as o } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.mjs";
|
|
6
6
|
const l = {
|
|
7
7
|
name: "NcActionButton",
|
|
8
8
|
components: {
|
|
9
|
-
CheckIcon:
|
|
10
|
-
ChevronRightIcon:
|
|
9
|
+
CheckIcon: s,
|
|
10
|
+
ChevronRightIcon: n
|
|
11
11
|
},
|
|
12
12
|
mixins: [a],
|
|
13
13
|
inject: {
|
|
@@ -52,8 +52,10 @@ const l = {
|
|
|
52
52
|
validator: (e) => ["button", "checkbox", "radio", "reset", "submit"].includes(e)
|
|
53
53
|
},
|
|
54
54
|
/**
|
|
55
|
-
* The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected)
|
|
56
|
-
*
|
|
55
|
+
* The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected).
|
|
56
|
+
* For checkbox and toggle button behavior - boolean value.
|
|
57
|
+
* For radio button behavior - could be a boolean checked or a string with the value of the button.
|
|
58
|
+
* Note: Unlike native radio buttons, NcActionButton are not grouped by name, so you need to connect them by bind correct modelValue.
|
|
57
59
|
*
|
|
58
60
|
* **This is not availabe for `type='submit'` or `type='reset'`**
|
|
59
61
|
*
|
|
@@ -86,7 +88,7 @@ const l = {
|
|
|
86
88
|
* The current "checked" or "pressed" state for the model behavior
|
|
87
89
|
*/
|
|
88
90
|
isChecked() {
|
|
89
|
-
return this.type === "radio" ? this.modelValue === this.value : this.modelValue;
|
|
91
|
+
return this.type === "radio" && typeof this.modelValue != "boolean" ? this.modelValue === this.value : this.modelValue;
|
|
90
92
|
},
|
|
91
93
|
/**
|
|
92
94
|
* The native HTML type to set on the button
|
|
@@ -108,11 +110,11 @@ const l = {
|
|
|
108
110
|
* @param {MouseEvent} event The click event
|
|
109
111
|
*/
|
|
110
112
|
handleClick(e) {
|
|
111
|
-
this.onClick(e), (this.modelValue !== null || this.type !== "button") && (this.type === "radio" ? this.isChecked || this.$emit("update:modelValue", this.value) : this.$emit("update:modelValue", !this.isChecked));
|
|
113
|
+
this.onClick(e), (this.modelValue !== null || this.type !== "button") && (this.type === "radio" ? typeof this.modelValue != "boolean" ? this.isChecked || this.$emit("update:modelValue", this.value) : this.$emit("update:modelValue", !this.isChecked) : this.$emit("update:modelValue", !this.isChecked));
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
};
|
|
115
|
-
var
|
|
117
|
+
var u = function() {
|
|
116
118
|
var t = this, i = t._self._c;
|
|
117
119
|
return i("li", { staticClass: "action", class: { "action--disabled": t.disabled }, attrs: { role: t.isInSemanticMenu && "presentation" } }, [i("button", t._b({ class: ["action-button button-vue", {
|
|
118
120
|
"action-button--active": t.isChecked,
|
|
@@ -120,13 +122,13 @@ var c = function() {
|
|
|
120
122
|
}], attrs: { "aria-label": t.ariaLabel, title: t.title, type: t.nativeType }, on: { click: t.handleClick } }, "button", t.buttonAttributes, !1), [t._t("icon", function() {
|
|
121
123
|
return [i("span", { staticClass: "action-button__icon", class: [t.isIconUrl ? "action-button__icon--url" : t.icon], style: { backgroundImage: t.isIconUrl ? `url(${t.icon})` : null }, attrs: { "aria-hidden": "true" } })];
|
|
122
124
|
}), t.name ? i("span", { staticClass: "action-button__longtext-wrapper" }, [i("strong", { staticClass: "action-button__name" }, [t._v(" " + t._s(t.name) + " ")]), i("br"), i("span", { staticClass: "action-button__longtext", domProps: { textContent: t._s(t.text) } })]) : t.isLongText ? i("span", { staticClass: "action-button__longtext", domProps: { textContent: t._s(t.text) } }) : i("span", { staticClass: "action-button__text" }, [t._v(t._s(t.text))]), t.isMenu ? i("ChevronRightIcon", { staticClass: "action-button__menu-icon", attrs: { size: 20 } }) : t.isChecked === !0 ? i("CheckIcon", { staticClass: "action-button__pressed-icon", attrs: { size: 20 } }) : t.isChecked === !1 ? i("span", { staticClass: "action-button__pressed-icon material-design-icon" }) : t._e(), t._e()], 2)]);
|
|
123
|
-
},
|
|
125
|
+
}, c = [], r = /* @__PURE__ */ o(
|
|
124
126
|
l,
|
|
125
|
-
c,
|
|
126
127
|
u,
|
|
128
|
+
c,
|
|
127
129
|
!1,
|
|
128
130
|
null,
|
|
129
|
-
"
|
|
131
|
+
"04ec546c",
|
|
130
132
|
null,
|
|
131
133
|
null
|
|
132
134
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcActionButton.mjs","sources":["../../src/components/NcActionButton/NcActionButton.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Delete')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDelete\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :close-after-click=\"true\" @click=\"showMessage('Delete and close menu')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDelete and close\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :is-menu=\"true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tCreate\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :disabled=\"true\" @click=\"showMessage('Disabled')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDisabled button\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Delete from 'vue-material-design-icons/Delete'\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tDelete,\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\nIf you're using a long text you can specify a name\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Add')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd new\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton name=\"Long button\" @click=\"showMessage('Delete')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tThis button is associated with a very long text.\\nAnd with new lines too.\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Delete from 'vue-material-design-icons/Delete'\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tDelete,\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n\n```\n\nAction icon attribute with a single action\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Add')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd new\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n\n```\n\nYou can also use a custom icon, for example from the vue-material-design-icons library:\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton>\n\t\t\t<template #icon>\n\t\t\t\t<HandBackLeft :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise left hand\n\t\t</NcActionButton>\n\t\t<NcActionButton>\n\t\t\t<template #icon>\n\t\t\t\t<HandBackRight :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise right hand\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport HandBackLeft from 'vue-material-design-icons/HandBackLeft'\nimport HandBackRight from 'vue-material-design-icons/HandBackRight'\n\nexport default {\n\tcomponents: {\n\t\tHandBackLeft,\n\t\tHandBackRight,\n\t},\n}\n</script>\n```\n\n### With different model behavior\nBy default the button will act like a normal button, but it is also possible to change the behavior to a toggle button, checkbox button or radio button.\n\nFor example to have the button act like a toggle button just set the `modelValue` property to the toggle state:\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"fullscreen\">\n\t\t\t<template #icon>\n\t\t\t\t<Fullscreen :size=\"20\" />\n\t\t\t</template>\n\t\t\tFullscreen\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport Fullscreen from 'vue-material-design-icons/Fullscreen.vue'\n\nexport default {\n\tcomponents: {\n\t\tFullscreen,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfullscreen: true,\n\t\t}\n\t},\n}\n</script>\n```\n\nAnother example would be using it with checkbox semantics, to enable or disable features.\nThis also allows tri-state behavior (`true`, `false`, `null`) in which case `aria-checked` will be either `true`, `false` or `mixed`.\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"handRaised\" type=\"checkbox\">\n\t\t\t<template #icon>\n\t\t\t\t<HandBackLeft :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise hand\n\t\t</NcActionButton>\n\t\t<NcActionButton :model-value.sync=\"fullscreen\" type=\"checkbox\">\n\t\t\t<template #icon>\n\t\t\t\t<Fullscreen :size=\"20\" />\n\t\t\t</template>\n\t\t\tFullscreen\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport HandBackLeft from 'vue-material-design-icons/HandBackLeft.vue'\nimport Fullscreen from 'vue-material-design-icons/Fullscreen.vue'\n\nexport default {\n\tcomponents: {\n\t\tHandBackLeft,\n\t\tFullscreen,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfullscreen: true,\n\t\t\thandRaised: false,\n\t\t}\n\t},\n}\n</script>\n```\n\nIt is also possible to use the button with radio semantics, this is only possible in menus and not for inline actions!\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"payment\" type=\"radio\" value=\"cash\">\n\t\t\t<template #icon>\n\t\t\t\t<Cash :size=\"20\" />\n\t\t\t</template>\n\t\t\tPay with cash\n\t\t</NcActionButton>\n\t\t<NcActionButton :model-value.sync=\"payment\" type=\"radio\" value=\"card\">\n\t\t\t<template #icon>\n\t\t\t\t<CreditCard :size=\"20\" />\n\t\t\t</template>\n\t\t\tPay by card\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport Cash from 'vue-material-design-icons/Cash.vue'\nimport CreditCard from 'vue-material-design-icons/CreditCard.vue'\n\nexport default {\n\tcomponents: {\n\t\tCash,\n\t\tCreditCard,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tpayment: 'card',\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<li class=\"action\" :class=\"{ 'action--disabled': disabled }\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t<button :aria-label=\"ariaLabel\"\n\t\t\t:class=\"['action-button button-vue', {\n\t\t\t\t'action-button--active': isChecked,\n\t\t\t\tfocusable: isFocusable,\n\t\t\t}]\"\n\t\t\t:title=\"title\"\n\t\t\t:type=\"nativeType\"\n\t\t\tv-bind=\"buttonAttributes\"\n\t\t\t@click=\"handleClick\">\n\t\t\t<!-- @slot Manually provide icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<span :class=\"[isIconUrl ? 'action-button__icon--url' : icon]\"\n\t\t\t\t\t:style=\"{ backgroundImage: isIconUrl ? `url(${icon})` : null }\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"action-button__icon\" />\n\t\t\t</slot>\n\n\t\t\t<!-- long text with name -->\n\t\t\t<span v-if=\"name\"\n\t\t\t\tclass=\"action-button__longtext-wrapper\">\n\t\t\t\t<strong class=\"action-button__name\">\n\t\t\t\t\t{{ name }}\n\t\t\t\t</strong>\n\t\t\t\t<br>\n\t\t\t\t<!-- white space is shown on longtext, so we can't\n\t\t\t\t\tput {{ text }} on a new line for code readability -->\n\t\t\t\t<span class=\"action-button__longtext\" v-text=\"text\" />\n\t\t\t</span>\n\n\t\t\t<!-- long text only -->\n\t\t\t<!-- white space is shown on longtext, so we can't\n\t\t\t\tput {{ text }} on a new line for code readability -->\n\t\t\t<span v-else-if=\"isLongText\"\n\t\t\t\tclass=\"action-button__longtext\"\n\t\t\t\tv-text=\"text\" />\n\n\t\t\t<!-- default text display -->\n\t\t\t<span v-else class=\"action-button__text\">{{ text }}</span>\n\n\t\t\t<!-- right arrow icon when there is a sub-menu -->\n\t\t\t<ChevronRightIcon v-if=\"isMenu\" :size=\"20\" class=\"action-button__menu-icon\" />\n\t\t\t<CheckIcon v-else-if=\"isChecked === true\" :size=\"20\" class=\"action-button__pressed-icon\" />\n\t\t\t<span v-else-if=\"isChecked === false\" class=\"action-button__pressed-icon material-design-icon\" />\n\n\t\t\t<!-- fake slot to gather inner text -->\n\t\t\t<slot v-if=\"false\" />\n\t\t</button>\n\t</li>\n</template>\n\n<script>\nimport CheckIcon from 'vue-material-design-icons/Check.vue'\nimport ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'\nimport ActionTextMixin from '../../mixins/actionText.js'\n\n/**\n * Button component to be used in Actions\n */\nexport default {\n\tname: 'NcActionButton',\n\n\tcomponents: {\n\t\tCheckIcon,\n\t\tChevronRightIcon,\n\t},\n\tmixins: [ActionTextMixin],\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * @deprecated To be removed in @nextcloud/vue 9. Migration guide: remove ariaHidden prop from NcAction* components.\n\t\t * @todo Add a check in @nextcloud/vue 9 that this prop is not provided,\n\t\t * otherwise root element will inherit incorrect aria-hidden.\n\t\t */\n\t\tariaHidden: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the action button\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * If this is a menu, a chevron icon will\n\t\t * be added at the end of the line\n\t\t */\n\t\tisMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The button's behavior, by default the button acts like a normal button with optional toggle button behavior if `modelValue` is `true` or `false`.\n\t\t * But you can also set to checkbox button behavior with tri-state or radio button like behavior.\n\t\t * This extends the native HTML button type attribute.\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'button',\n\t\t\tvalidator: (behavior) => ['button', 'checkbox', 'radio', 'reset', 'submit'].includes(behavior),\n\t\t},\n\n\t\t/**\n\t\t * The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected)\n\t\t * Either boolean for checkbox and toggle button behavior or `value` for radio behavior.\n\t\t *\n\t\t * **This is not availabe for `type='submit'` or `type='reset'`**\n\t\t *\n\t\t * If using `type='checkbox'` a `model-value` of `true` means checked, `false` means unchecked and `null` means indeterminate (tri-state)\n\t\t * For `type='radio'` `null` is equal to `false`\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The value used for the `modelValue` when this component is used with radio behavior\n\t\t * Similar to the `value` attribute of `<input type=\"radio\">`\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * determines if the action is focusable\n\t\t *\n\t\t * @return {boolean} is the action focusable ?\n\t\t */\n\t\tisFocusable() {\n\t\t\treturn !this.disabled\n\t\t},\n\n\t\t/**\n\t\t * The current \"checked\" or \"pressed\" state for the model behavior\n\t\t */\n\t\tisChecked() {\n\t\t\tif (this.type === 'radio') {\n\t\t\t\treturn this.modelValue === this.value\n\t\t\t}\n\t\t\treturn this.modelValue\n\t\t},\n\n\t\t/**\n\t\t * The native HTML type to set on the button\n\t\t */\n\t\tnativeType() {\n\t\t\tif (this.type === 'submit' || this.type === 'reset') {\n\t\t\t\treturn this.type\n\t\t\t}\n\t\t\treturn 'button'\n\t\t},\n\n\t\t/**\n\t\t * HTML attributes to bind to the <button>\n\t\t */\n\t\tbuttonAttributes() {\n\t\t\tconst attributes = {}\n\n\t\t\tif (this.isInSemanticMenu) {\n\t\t\t\t// By default it needs to be a menu item in semantic menus\n\t\t\t\tattributes.role = 'menuitem'\n\n\t\t\t\tif (this.type === 'radio') {\n\t\t\t\t\tattributes.role = 'menuitemradio'\n\t\t\t\t\tattributes['aria-checked'] = this.isChecked ? 'true' : 'false'\n\t\t\t\t} else if (this.type === 'checkbox' || (this.nativeType === 'button' && this.modelValue !== null)) {\n\t\t\t\t\t// either if checkbox behavior was set or the model value is not unset\n\t\t\t\t\tattributes.role = 'menuitemcheckbox'\n\t\t\t\t\tattributes['aria-checked'] = this.modelValue === null ? 'mixed' : (this.modelValue ? 'true' : 'false')\n\t\t\t\t}\n\t\t\t} else if (this.modelValue !== null && this.nativeType === 'button') {\n\t\t\t\t// In case this has a modelValue it is considered a toggle button, so we need to set the aria-pressed\n\t\t\t\tattributes['aria-pressed'] = this.modelValue ? 'true' : 'false'\n\t\t\t}\n\n\t\t\treturn attributes\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Forward click event, let mixin handle the close-after-click and emit new modelValue if needed\n\t\t * @param {MouseEvent} event The click event\n\t\t */\n\t\thandleClick(event) {\n\t\t\tthis.onClick(event)\n\t\t\t// If modelValue or type is set (so modelValue might be null for tri-state) we need to update it\n\t\t\tif (this.modelValue !== null || this.type !== 'button') {\n\t\t\t\tif (this.type === 'radio') {\n\t\t\t\t\tif (!this.isChecked) {\n\t\t\t\t\t\tthis.$emit('update:modelValue', this.value)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.$emit('update:modelValue', !this.isChecked)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../../assets/action';\n@include action-active;\n@include action--disabled;\n@include action-item('button');\n\n.action-button__pressed-icon {\n\tmargin-left: auto;\n\tmargin-right: -$icon-margin;\n}\n</style>\n"],"names":["_sfc_main","Check","ChevronRight","ActionTextMixin","behavior","attributes","event"],"mappings":";;;;;AAsVA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,WAAAC;AAAA,IACA,kBAAAC;AAAA,EACA;AAAA,EACA,QAAA,CAAAC,CAAA;AAAA,EAEA,QAAA;AAAA,IACA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,UAAA,YAAA,SAAA,SAAA,QAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,YAAA;AAAA,MACA,MAAA,CAAA,SAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AACA,aAAA,CAAA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AACA,aAAA,KAAA,SAAA,UACA,KAAA,eAAA,KAAA,QAEA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AACA,aAAA,KAAA,SAAA,YAAA,KAAA,SAAA,UACA,KAAA,OAEA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAA;AACA,YAAAC,IAAA,CAAA;AAEA,aAAA,KAAA,oBAEAA,EAAA,OAAA,YAEA,KAAA,SAAA,WACAA,EAAA,OAAA,iBACAA,EAAA,cAAA,IAAA,KAAA,YAAA,SAAA,YACA,KAAA,SAAA,cAAA,KAAA,eAAA,YAAA,KAAA,eAAA,UAEAA,EAAA,OAAA,oBACAA,EAAA,cAAA,IAAA,KAAA,eAAA,OAAA,UAAA,KAAA,aAAA,SAAA,YAEA,KAAA,eAAA,QAAA,KAAA,eAAA,aAEAA,EAAA,cAAA,IAAA,KAAA,aAAA,SAAA,UAGAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAAC,GAAA;AACA,WAAA,QAAAA,CAAA,IAEA,KAAA,eAAA,QAAA,KAAA,SAAA,cACA,KAAA,SAAA,UACA,KAAA,aACA,KAAA,MAAA,qBAAA,KAAA,KAAA,IAGA,KAAA,MAAA,qBAAA,CAAA,KAAA,SAAA;AAAA,IAGA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcActionButton.mjs","sources":["../../src/components/NcActionButton/NcActionButton.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Delete')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDelete\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :close-after-click=\"true\" @click=\"showMessage('Delete and close menu')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDelete and close\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :is-menu=\"true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tCreate\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :disabled=\"true\" @click=\"showMessage('Disabled')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tDisabled button\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Delete from 'vue-material-design-icons/Delete'\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tDelete,\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\nIf you're using a long text you can specify a name\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Add')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd new\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton name=\"Long button\" @click=\"showMessage('Delete')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tThis button is associated with a very long text.\\nAnd with new lines too.\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Delete from 'vue-material-design-icons/Delete'\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tDelete,\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n\n```\n\nAction icon attribute with a single action\n\n```vue\n\t<template>\n\t\t<NcActions>\n\t\t\t<NcActionButton @click=\"showMessage('Add')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tAdd new\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t</template>\n\t<script>\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tPlus,\n\t\t},\n\t\tmethods: {\n\t\t\tshowMessage(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n\n```\n\nYou can also use a custom icon, for example from the vue-material-design-icons library:\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton>\n\t\t\t<template #icon>\n\t\t\t\t<HandBackLeft :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise left hand\n\t\t</NcActionButton>\n\t\t<NcActionButton>\n\t\t\t<template #icon>\n\t\t\t\t<HandBackRight :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise right hand\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport HandBackLeft from 'vue-material-design-icons/HandBackLeft'\nimport HandBackRight from 'vue-material-design-icons/HandBackRight'\n\nexport default {\n\tcomponents: {\n\t\tHandBackLeft,\n\t\tHandBackRight,\n\t},\n}\n</script>\n```\n\n### With different model behavior\nBy default the button will act like a normal button, but it is also possible to change the behavior to a toggle button, checkbox button or radio button.\n\nFor example to have the button act like a toggle button just set the `modelValue` property to the toggle state:\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"fullscreen\">\n\t\t\t<template #icon>\n\t\t\t\t<Fullscreen :size=\"20\" />\n\t\t\t</template>\n\t\t\tFullscreen\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport Fullscreen from 'vue-material-design-icons/Fullscreen.vue'\n\nexport default {\n\tcomponents: {\n\t\tFullscreen,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfullscreen: true,\n\t\t}\n\t},\n}\n</script>\n```\n\nAnother example would be using it with checkbox semantics, to enable or disable features.\nThis also allows tri-state behavior (`true`, `false`, `null`) in which case `aria-checked` will be either `true`, `false` or `mixed`.\n\n```vue\n<template>\n\t<NcActions>\n\t\t<NcActionButton :model-value.sync=\"handRaised\" type=\"checkbox\">\n\t\t\t<template #icon>\n\t\t\t\t<HandBackLeft :size=\"20\" />\n\t\t\t</template>\n\t\t\tRaise hand\n\t\t</NcActionButton>\n\t\t<NcActionButton :model-value.sync=\"fullscreen\" type=\"checkbox\">\n\t\t\t<template #icon>\n\t\t\t\t<Fullscreen :size=\"20\" />\n\t\t\t</template>\n\t\t\tFullscreen\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n<script>\nimport HandBackLeft from 'vue-material-design-icons/HandBackLeft.vue'\nimport Fullscreen from 'vue-material-design-icons/Fullscreen.vue'\n\nexport default {\n\tcomponents: {\n\t\tHandBackLeft,\n\t\tFullscreen,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfullscreen: true,\n\t\t\thandRaised: false,\n\t\t}\n\t},\n}\n</script>\n```\n\nIt is also possible to use the button with radio semantics, this is only possible in menus and not for inline actions!\n\nWith a string `modelValue`, checked state is determined by the `value` property and updates `modelValue` with the new `value` string.\n\nWith a boolean `modelValue`, checked state is determined by `modelValue` and updates to `true` on check.\n\nNote: unlike native radio buttons, `NcActionButton` are not grouped by name, so you need to connect them by bind correct `modelValue``.\n\n```vue\n<template>\n\t<div>\n\t\t<NcActions>\n\t\t\t<NcActionButton :model-value.sync=\"payment\" type=\"radio\" value=\"cash\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Cash :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tPay with cash\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton :model-value.sync=\"payment\" type=\"radio\" value=\"card\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CreditCard :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tPay by card\n\t\t\t</NcActionButton>\n\t\t\t<NcActionSeparator />\n\t\t\t<NcActionButton type=\"radio\" :model-value=\"align.isLeft\" @update:modelValue=\"setAlign('Left', $event)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FormatAlignLeft :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tLeft\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton type=\"radio\" :model-value=\"align.isCenter\" @update:modelValue=\"setAlign('Center', $event)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FormatAlignCenter :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tCenter\n\t\t\t</NcActionButton>\n\t\t\t<NcActionButton type=\"radio\" :model-value=\"align.isRight\" @update:modelValue=\"setAlign('Right', $event)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FormatAlignRight :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tRight\n\t\t\t</NcActionButton>\n\t\t</NcActions>\n\t\t<p>payment = \"{{ payment }}\"</p>\n\t\t<p>align.isLeft = {{ align.isLeft }}</p>\n\t\t<p>align.isCenter = {{ align.isCenter }}</p>\n\t\t<p>align.isRight = {{ align.isRight }}</p>\n\t</div>\n</template>\n<script>\nimport Cash from 'vue-material-design-icons/Cash.vue'\nimport CreditCard from 'vue-material-design-icons/CreditCard.vue'\nimport FormatAlignLeft from 'vue-material-design-icons/FormatAlignLeft.vue'\nimport FormatAlignCenter from 'vue-material-design-icons/FormatAlignCenter.vue'\nimport FormatAlignRight from 'vue-material-design-icons/FormatAlignRight.vue'\n\nexport default {\n\tcomponents: {\n\t\tCash,\n\t\tCreditCard,\n\t\tFormatAlignLeft,\n\t\tFormatAlignCenter,\n\t\tFormatAlignRight,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tpayment: 'card',\n\t\t\talign: {\n\t\t\t\tisLeft: false,\n\t\t\t\tisCenter: true,\n\t\t\t\tisRight: false,\n\t\t\t},\n\t\t}\n\t},\n\tmethods: {\n\t\tsetAlign(direction, value) {\n\t\t\tthis.align.isLeft = false\n\t\t\tthis.align.isCenter = false\n\t\t\tthis.align.isRight = false\n\t\t\tthis.align[`is${direction}`] = value\n\t\t},\n\t}\n}\n</script>\n```\n</docs>\n\n<template>\n\t<li class=\"action\" :class=\"{ 'action--disabled': disabled }\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t<button :aria-label=\"ariaLabel\"\n\t\t\t:class=\"['action-button button-vue', {\n\t\t\t\t'action-button--active': isChecked,\n\t\t\t\tfocusable: isFocusable,\n\t\t\t}]\"\n\t\t\t:title=\"title\"\n\t\t\t:type=\"nativeType\"\n\t\t\tv-bind=\"buttonAttributes\"\n\t\t\t@click=\"handleClick\">\n\t\t\t<!-- @slot Manually provide icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<span :class=\"[isIconUrl ? 'action-button__icon--url' : icon]\"\n\t\t\t\t\t:style=\"{ backgroundImage: isIconUrl ? `url(${icon})` : null }\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"action-button__icon\" />\n\t\t\t</slot>\n\n\t\t\t<!-- long text with name -->\n\t\t\t<span v-if=\"name\"\n\t\t\t\tclass=\"action-button__longtext-wrapper\">\n\t\t\t\t<strong class=\"action-button__name\">\n\t\t\t\t\t{{ name }}\n\t\t\t\t</strong>\n\t\t\t\t<br>\n\t\t\t\t<!-- white space is shown on longtext, so we can't\n\t\t\t\t\tput {{ text }} on a new line for code readability -->\n\t\t\t\t<span class=\"action-button__longtext\" v-text=\"text\" />\n\t\t\t</span>\n\n\t\t\t<!-- long text only -->\n\t\t\t<!-- white space is shown on longtext, so we can't\n\t\t\t\tput {{ text }} on a new line for code readability -->\n\t\t\t<span v-else-if=\"isLongText\"\n\t\t\t\tclass=\"action-button__longtext\"\n\t\t\t\tv-text=\"text\" />\n\n\t\t\t<!-- default text display -->\n\t\t\t<span v-else class=\"action-button__text\">{{ text }}</span>\n\n\t\t\t<!-- right arrow icon when there is a sub-menu -->\n\t\t\t<ChevronRightIcon v-if=\"isMenu\" :size=\"20\" class=\"action-button__menu-icon\" />\n\t\t\t<CheckIcon v-else-if=\"isChecked === true\" :size=\"20\" class=\"action-button__pressed-icon\" />\n\t\t\t<span v-else-if=\"isChecked === false\" class=\"action-button__pressed-icon material-design-icon\" />\n\n\t\t\t<!-- fake slot to gather inner text -->\n\t\t\t<slot v-if=\"false\" />\n\t\t</button>\n\t</li>\n</template>\n\n<script>\nimport CheckIcon from 'vue-material-design-icons/Check.vue'\nimport ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'\nimport ActionTextMixin from '../../mixins/actionText.js'\n\n/**\n * Button component to be used in Actions\n */\nexport default {\n\tname: 'NcActionButton',\n\n\tcomponents: {\n\t\tCheckIcon,\n\t\tChevronRightIcon,\n\t},\n\tmixins: [ActionTextMixin],\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * @deprecated To be removed in @nextcloud/vue 9. Migration guide: remove ariaHidden prop from NcAction* components.\n\t\t * @todo Add a check in @nextcloud/vue 9 that this prop is not provided,\n\t\t * otherwise root element will inherit incorrect aria-hidden.\n\t\t */\n\t\tariaHidden: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the action button\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * If this is a menu, a chevron icon will\n\t\t * be added at the end of the line\n\t\t */\n\t\tisMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The button's behavior, by default the button acts like a normal button with optional toggle button behavior if `modelValue` is `true` or `false`.\n\t\t * But you can also set to checkbox button behavior with tri-state or radio button like behavior.\n\t\t * This extends the native HTML button type attribute.\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'button',\n\t\t\tvalidator: (behavior) => ['button', 'checkbox', 'radio', 'reset', 'submit'].includes(behavior),\n\t\t},\n\n\t\t/**\n\t\t * The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected).\n\t\t * For checkbox and toggle button behavior - boolean value.\n\t\t * For radio button behavior - could be a boolean checked or a string with the value of the button.\n\t\t * Note: Unlike native radio buttons, NcActionButton are not grouped by name, so you need to connect them by bind correct modelValue.\n\t\t *\n\t\t * **This is not availabe for `type='submit'` or `type='reset'`**\n\t\t *\n\t\t * If using `type='checkbox'` a `model-value` of `true` means checked, `false` means unchecked and `null` means indeterminate (tri-state)\n\t\t * For `type='radio'` `null` is equal to `false`\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The value used for the `modelValue` when this component is used with radio behavior\n\t\t * Similar to the `value` attribute of `<input type=\"radio\">`\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * determines if the action is focusable\n\t\t *\n\t\t * @return {boolean} is the action focusable ?\n\t\t */\n\t\tisFocusable() {\n\t\t\treturn !this.disabled\n\t\t},\n\n\t\t/**\n\t\t * The current \"checked\" or \"pressed\" state for the model behavior\n\t\t */\n\t\tisChecked() {\n\t\t\tif (this.type === 'radio' && typeof this.modelValue !== 'boolean') {\n\t\t\t\treturn this.modelValue === this.value\n\t\t\t}\n\t\t\treturn this.modelValue\n\t\t},\n\n\t\t/**\n\t\t * The native HTML type to set on the button\n\t\t */\n\t\tnativeType() {\n\t\t\tif (this.type === 'submit' || this.type === 'reset') {\n\t\t\t\treturn this.type\n\t\t\t}\n\t\t\treturn 'button'\n\t\t},\n\n\t\t/**\n\t\t * HTML attributes to bind to the <button>\n\t\t */\n\t\tbuttonAttributes() {\n\t\t\tconst attributes = {}\n\n\t\t\tif (this.isInSemanticMenu) {\n\t\t\t\t// By default it needs to be a menu item in semantic menus\n\t\t\t\tattributes.role = 'menuitem'\n\n\t\t\t\tif (this.type === 'radio') {\n\t\t\t\t\tattributes.role = 'menuitemradio'\n\t\t\t\t\tattributes['aria-checked'] = this.isChecked ? 'true' : 'false'\n\t\t\t\t} else if (this.type === 'checkbox' || (this.nativeType === 'button' && this.modelValue !== null)) {\n\t\t\t\t\t// either if checkbox behavior was set or the model value is not unset\n\t\t\t\t\tattributes.role = 'menuitemcheckbox'\n\t\t\t\t\tattributes['aria-checked'] = this.modelValue === null ? 'mixed' : (this.modelValue ? 'true' : 'false')\n\t\t\t\t}\n\t\t\t} else if (this.modelValue !== null && this.nativeType === 'button') {\n\t\t\t\t// In case this has a modelValue it is considered a toggle button, so we need to set the aria-pressed\n\t\t\t\tattributes['aria-pressed'] = this.modelValue ? 'true' : 'false'\n\t\t\t}\n\n\t\t\treturn attributes\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Forward click event, let mixin handle the close-after-click and emit new modelValue if needed\n\t\t * @param {MouseEvent} event The click event\n\t\t */\n\t\thandleClick(event) {\n\t\t\tthis.onClick(event)\n\t\t\t// If modelValue or type is set (so modelValue might be null for tri-state) we need to update it\n\t\t\tif (this.modelValue !== null || this.type !== 'button') {\n\t\t\t\tif (this.type === 'radio') {\n\t\t\t\t\tif (typeof this.modelValue !== 'boolean') {\n\t\t\t\t\t\t// String-value radios behavior is similar to native - click on checked radio does nothing\n\t\t\t\t\t\tif (!this.isChecked) {\n\t\t\t\t\t\t\tthis.$emit('update:modelValue', this.value)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Boolean radio allows to uncheck\n\t\t\t\t\t\tthis.$emit('update:modelValue', !this.isChecked)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Checkbox toggles value\n\t\t\t\t\tthis.$emit('update:modelValue', !this.isChecked)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../../assets/action';\n@include action-active;\n@include action--disabled;\n@include action-item('button');\n\n.action-button__pressed-icon {\n\tmargin-left: auto;\n\tmargin-right: -$icon-margin;\n}\n</style>\n"],"names":["_sfc_main","CheckIcon","ChevronRightIcon","ActionTextMixin","behavior","attributes","event"],"mappings":";;;;AAwYA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,WAAAC;AAAAA,IACA,kBAAAC;AAAAA,EACA;AAAA,EACA,QAAA,CAAAC,CAAA;AAAA,EAEA,QAAA;AAAA,IACA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,UAAA,YAAA,SAAA,SAAA,QAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA,YAAA;AAAA,MACA,MAAA,CAAA,SAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AACA,aAAA,CAAA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AACA,aAAA,KAAA,SAAA,WAAA,OAAA,KAAA,cAAA,YACA,KAAA,eAAA,KAAA,QAEA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AACA,aAAA,KAAA,SAAA,YAAA,KAAA,SAAA,UACA,KAAA,OAEA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAA;AACA,YAAAC,IAAA,CAAA;AAEA,aAAA,KAAA,oBAEAA,EAAA,OAAA,YAEA,KAAA,SAAA,WACAA,EAAA,OAAA,iBACAA,EAAA,cAAA,IAAA,KAAA,YAAA,SAAA,YACA,KAAA,SAAA,cAAA,KAAA,eAAA,YAAA,KAAA,eAAA,UAEAA,EAAA,OAAA,oBACAA,EAAA,cAAA,IAAA,KAAA,eAAA,OAAA,UAAA,KAAA,aAAA,SAAA,YAEA,KAAA,eAAA,QAAA,KAAA,eAAA,aAEAA,EAAA,cAAA,IAAA,KAAA,aAAA,SAAA,UAGAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAAC,GAAA;AACA,WAAA,QAAAA,CAAA,IAEA,KAAA,eAAA,QAAA,KAAA,SAAA,cACA,KAAA,SAAA,UACA,OAAA,KAAA,cAAA,YAEA,KAAA,aACA,KAAA,MAAA,qBAAA,KAAA,KAAA,IAIA,KAAA,MAAA,qBAAA,CAAA,KAAA,SAAA,IAIA,KAAA,MAAA,qBAAA,CAAA,KAAA,SAAA;AAAA,IAGA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { n as
|
|
1
|
+
import '../assets/NcActionCaption-afJqyJO6.css';
|
|
2
|
+
import { n as t } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.mjs";
|
|
3
3
|
const a = {
|
|
4
4
|
name: "NcActionCaption",
|
|
5
5
|
inject: {
|
|
@@ -19,9 +19,9 @@ const a = {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
var i = function() {
|
|
22
|
-
var n = this,
|
|
23
|
-
return
|
|
24
|
-
}, r = [], s = /* @__PURE__ */
|
|
22
|
+
var n = this, e = n._self._c;
|
|
23
|
+
return e("li", { staticClass: "app-navigation-caption", attrs: { role: n.isInSemanticMenu && "presentation" } }, [n._v(" " + n._s(n.name) + " ")]);
|
|
24
|
+
}, r = [], s = /* @__PURE__ */ t(
|
|
25
25
|
a,
|
|
26
26
|
i,
|
|
27
27
|
r,
|
|
@@ -31,7 +31,7 @@ var i = function() {
|
|
|
31
31
|
null,
|
|
32
32
|
null
|
|
33
33
|
);
|
|
34
|
-
const
|
|
34
|
+
const _ = s.exports;
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
_ as default
|
|
37
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcActionCaption.mjs","sources":["../../src/components/NcActionCaption/NcActionCaption.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2021 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<NcActions>\n\t\t<NcActionCaption name=\"Test caption\" />\n\t\t<NcActionCaption name=\"Test caption 2\" />\n\t</NcActions>\n```\n</docs>\n\n<template>\n\t<li class=\"app-navigation-caption\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t{{ name }}\n\t</li>\n</template>\n\n<script>\nexport default {\n\tname: 'NcActionCaption',\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The caption's text\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\t.app-navigation-caption {\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tline-height: $clickable-area;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tbox-shadow: none !important;\n\t\tuser-select: none;\n\t\tpointer-events: none;\n\t\tmargin-left: 12px;\n\t\tpadding-right: 14px;\n\t\theight: $clickable-area;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n</style>\n"],"names":["_sfc_main"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NcActionCaption.mjs","sources":["../../src/components/NcActionCaption/NcActionCaption.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2021 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<NcActions>\n\t\t<NcActionCaption name=\"Test caption\" />\n\t\t<NcActionCaption name=\"Test caption 2\" />\n\t</NcActions>\n```\n</docs>\n\n<template>\n\t<li class=\"app-navigation-caption\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t{{ name }}\n\t</li>\n</template>\n\n<script>\nexport default {\n\tname: 'NcActionCaption',\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The caption's text\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\t.app-navigation-caption {\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tline-height: $clickable-area;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tbox-shadow: none !important;\n\t\tuser-select: none;\n\t\tpointer-events: none;\n\t\tmargin-left: 12px;\n\t\tpadding-right: 14px;\n\t\theight: $clickable-area;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n</style>\n"],"names":["_sfc_main"],"mappings":";AAsCA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,QAAA;AAAA,IACA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
require('../assets/NcActionCheckbox-6Pvlr1E7.css');
|
|
2
|
+
"use strict";
|
|
3
|
+
const a = require("../chunks/actionGlobal-SGFis4LZ.cjs"), i = require("../chunks/GenRandomId-ULxaMkkr.cjs"), s = require("../chunks/_plugin-vue2_normalizer-DCfUPqga.cjs"), l = {
|
|
3
4
|
name: "NcActionCheckbox",
|
|
4
5
|
mixins: [a.ActionGlobalMixin],
|
|
5
6
|
inject: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcActionCheckbox.cjs","sources":["../../src/components/NcActionCheckbox/NcActionCheckbox.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<NcActions>\n\t\t<NcActionCheckbox @change=\"alert('(un)checked !')\">First choice</NcActionCheckbox>\n\t\t<NcActionCheckbox value=\"second\" @change=\"alert('(un)checked !')\">Second choice</NcActionCheckbox>\n\t\t<NcActionCheckbox :checked=\"true\" @change=\"alert('(un)checked !')\">Third choice (checked)</NcActionCheckbox>\n\t\t<NcActionCheckbox :disabled=\"true\" @change=\"alert('(un)checked !')\">Second choice (disabled)</NcActionCheckbox>\n\t</NcActions>\n```\n</docs>\n\n<template>\n\t<li class=\"action\" :class=\"{ 'action--disabled': disabled }\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t<span class=\"action-checkbox\" :role=\"isInSemanticMenu && 'menuitemcheckbox'\" :aria-checked=\"ariaChecked\">\n\t\t\t<input :id=\"id\"\n\t\t\t\tref=\"checkbox\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:checked=\"checked\"\n\t\t\t\t:value=\"value\"\n\t\t\t\t:class=\"{ focusable: isFocusable }\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tclass=\"checkbox action-checkbox__checkbox\"\n\t\t\t\t@keydown.enter.exact.prevent=\"checkInput\"\n\t\t\t\t@change=\"onChange\">\n\t\t\t<label ref=\"label\" :for=\"id\" class=\"action-checkbox__label\">{{ text }}</label>\n\n\t\t\t<!-- fake slot to gather inner text -->\n\t\t\t<slot v-if=\"false\" />\n\t\t</span>\n\t</li>\n</template>\n\n<script>\nimport ActionGlobalMixin from '../../mixins/actionGlobal.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nexport default {\n\tname: 'NcActionCheckbox',\n\n\tmixins: [ActionGlobalMixin],\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * id attribute of the checkbox element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'action-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * checked state of the the checkbox element\n\t\t */\n\t\tchecked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * value of the checkbox input\n\t\t */\n\t\tvalue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the checkbox element\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'change',\n\t\t'check',\n\t\t'uncheck',\n\t\t'update:checked',\n\t],\n\n\tcomputed: {\n\t\t/**\n\t\t * determines if the action is focusable\n\t\t *\n\t\t * @return {boolean} is the action focusable ?\n\t\t */\n\t\tisFocusable() {\n\t\t\treturn !this.disabled\n\t\t},\n\n\t\t/**\n\t\t * aria-checked attribute for role=\"menuitemcheckbox\"\n\t\t *\n\t\t * @return {'true'|'false'|undefined} aria-checked value if needed\n\t\t */\n\t\tariaChecked() {\n\t\t\tif (this.isInSemanticMenu) {\n\t\t\t\treturn this.checked ? 'true' : 'false'\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t},\n\n\tmethods: {\n\t\tcheckInput(event) {\n\t\t\t// by clicking we also trigger the change event\n\t\t\tthis.$refs.label.click()\n\t\t},\n\t\tonChange(event) {\n\t\t\t/**\n\t\t\t * Emitted when the checkbox state is changed\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tthis.$emit('update:checked', this.$refs.checkbox.checked)\n\n\t\t\t/**\n\t\t\t * Emitted when the checkbox state is changed\n\t\t\t *\n\t\t\t * @type {Event}\n\t\t\t */\n\t\t\tthis.$emit('change', event)\n\n\t\t\tif (this.$refs.checkbox.checked) {\n\t\t\t\t/**\n\t\t\t\t * Emitted when the checkbox is checked\n\t\t\t\t *\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.$emit('check')\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Emitted when the checkbox is unchecked\n\t\t\t\t *\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.$emit('uncheck')\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../../assets/action';\n@include action-active;\n@include action--disabled;\n\n.action-checkbox {\n\tdisplay: flex;\n\talign-items: flex-start;\n\n\twidth: 100%;\n\theight: auto;\n\tmargin: 0;\n\tpadding: 0;\n\n\tcursor: pointer;\n\twhite-space: nowrap;\n\n\tcolor: var(--color-main-text);\n\tborder: 0;\n\tborder-radius: 0; // otherwise Safari will cut the border-radius area\n\tbackground-color: transparent;\n\tbox-shadow: none;\n\n\tfont-weight: normal;\n\tline-height: $clickable-area;\n\n\t/* checkbox/radio fixes */\n\t&__checkbox {\n\t\tposition: absolute;\n\t\ttop: auto;\n\t\tleft: -10000px;\n\n\t\toverflow: hidden;\n\n\t\twidth: 1px;\n\t\theight: 1px;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\talign-items: center; // align checkbox to text\n\n\t\twidth: 100%;\n\t\tpadding: 0 !important;\n\t\tpadding-right: $icon-margin !important;\n\n\t\t// checkbox-width is 12px, border is 2\n\t\t// (44 - 14 - 2) / 2 = 14\n\t\t&::before {\n\t\t\tmargin: 0 14px 0 !important;\n\t\t}\n\t}\n\n\t&--disabled {\n\t\t&,\n\t\t.action-checkbox__label {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","
|
|
1
|
+
{"version":3,"file":"NcActionCheckbox.cjs","sources":["../../src/components/NcActionCheckbox/NcActionCheckbox.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<NcActions>\n\t\t<NcActionCheckbox @change=\"alert('(un)checked !')\">First choice</NcActionCheckbox>\n\t\t<NcActionCheckbox value=\"second\" @change=\"alert('(un)checked !')\">Second choice</NcActionCheckbox>\n\t\t<NcActionCheckbox :checked=\"true\" @change=\"alert('(un)checked !')\">Third choice (checked)</NcActionCheckbox>\n\t\t<NcActionCheckbox :disabled=\"true\" @change=\"alert('(un)checked !')\">Second choice (disabled)</NcActionCheckbox>\n\t</NcActions>\n```\n</docs>\n\n<template>\n\t<li class=\"action\" :class=\"{ 'action--disabled': disabled }\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t<span class=\"action-checkbox\" :role=\"isInSemanticMenu && 'menuitemcheckbox'\" :aria-checked=\"ariaChecked\">\n\t\t\t<input :id=\"id\"\n\t\t\t\tref=\"checkbox\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:checked=\"checked\"\n\t\t\t\t:value=\"value\"\n\t\t\t\t:class=\"{ focusable: isFocusable }\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tclass=\"checkbox action-checkbox__checkbox\"\n\t\t\t\t@keydown.enter.exact.prevent=\"checkInput\"\n\t\t\t\t@change=\"onChange\">\n\t\t\t<label ref=\"label\" :for=\"id\" class=\"action-checkbox__label\">{{ text }}</label>\n\n\t\t\t<!-- fake slot to gather inner text -->\n\t\t\t<slot v-if=\"false\" />\n\t\t</span>\n\t</li>\n</template>\n\n<script>\nimport ActionGlobalMixin from '../../mixins/actionGlobal.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nexport default {\n\tname: 'NcActionCheckbox',\n\n\tmixins: [ActionGlobalMixin],\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * id attribute of the checkbox element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'action-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * checked state of the the checkbox element\n\t\t */\n\t\tchecked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * value of the checkbox input\n\t\t */\n\t\tvalue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the checkbox element\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'change',\n\t\t'check',\n\t\t'uncheck',\n\t\t'update:checked',\n\t],\n\n\tcomputed: {\n\t\t/**\n\t\t * determines if the action is focusable\n\t\t *\n\t\t * @return {boolean} is the action focusable ?\n\t\t */\n\t\tisFocusable() {\n\t\t\treturn !this.disabled\n\t\t},\n\n\t\t/**\n\t\t * aria-checked attribute for role=\"menuitemcheckbox\"\n\t\t *\n\t\t * @return {'true'|'false'|undefined} aria-checked value if needed\n\t\t */\n\t\tariaChecked() {\n\t\t\tif (this.isInSemanticMenu) {\n\t\t\t\treturn this.checked ? 'true' : 'false'\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t},\n\n\tmethods: {\n\t\tcheckInput(event) {\n\t\t\t// by clicking we also trigger the change event\n\t\t\tthis.$refs.label.click()\n\t\t},\n\t\tonChange(event) {\n\t\t\t/**\n\t\t\t * Emitted when the checkbox state is changed\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tthis.$emit('update:checked', this.$refs.checkbox.checked)\n\n\t\t\t/**\n\t\t\t * Emitted when the checkbox state is changed\n\t\t\t *\n\t\t\t * @type {Event}\n\t\t\t */\n\t\t\tthis.$emit('change', event)\n\n\t\t\tif (this.$refs.checkbox.checked) {\n\t\t\t\t/**\n\t\t\t\t * Emitted when the checkbox is checked\n\t\t\t\t *\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.$emit('check')\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Emitted when the checkbox is unchecked\n\t\t\t\t *\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.$emit('uncheck')\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../../assets/action';\n@include action-active;\n@include action--disabled;\n\n.action-checkbox {\n\tdisplay: flex;\n\talign-items: flex-start;\n\n\twidth: 100%;\n\theight: auto;\n\tmargin: 0;\n\tpadding: 0;\n\n\tcursor: pointer;\n\twhite-space: nowrap;\n\n\tcolor: var(--color-main-text);\n\tborder: 0;\n\tborder-radius: 0; // otherwise Safari will cut the border-radius area\n\tbackground-color: transparent;\n\tbox-shadow: none;\n\n\tfont-weight: normal;\n\tline-height: $clickable-area;\n\n\t/* checkbox/radio fixes */\n\t&__checkbox {\n\t\tposition: absolute;\n\t\ttop: auto;\n\t\tleft: -10000px;\n\n\t\toverflow: hidden;\n\n\t\twidth: 1px;\n\t\theight: 1px;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\talign-items: center; // align checkbox to text\n\n\t\twidth: 100%;\n\t\tpadding: 0 !important;\n\t\tpadding-right: $icon-margin !important;\n\n\t\t// checkbox-width is 12px, border is 2\n\t\t// (44 - 14 - 2) / 2 = 14\n\t\t&::before {\n\t\t\tmargin: 0 14px 0 !important;\n\t\t}\n\t}\n\n\t&--disabled {\n\t\t&,\n\t\t.action-checkbox__label {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","ActionGlobalMixin","GenRandomId","id","event"],"mappings":";4KA6DAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,QAAA,CAAAC,EAAAA,iBAAA;AAAA,EAEA,QAAA;AAAA,IACA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,YAAAC,cAAA;AAAA,MACA,WAAA,CAAAC,MAAAA,EAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AACA,aAAA,CAAA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AACA,UAAA,KAAA;AACA,eAAA,KAAA,UAAA,SAAA;AAAA,IAGA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAAC,GAAA;AAEA,WAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA,IACA,SAAAA,GAAA;AAMA,WAAA,MAAA,kBAAA,KAAA,MAAA,SAAA,OAAA,GAOA,KAAA,MAAA,UAAAA,CAAA,GAEA,KAAA,MAAA,SAAA,UAMA,KAAA,MAAA,OAAA,IAOA,KAAA,MAAA,SAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { A as i } from "../chunks/actionGlobal-
|
|
1
|
+
import '../assets/NcActionCheckbox-6Pvlr1E7.css';
|
|
2
|
+
import { A as i } from "../chunks/actionGlobal-fRayfdEK.mjs";
|
|
3
3
|
import { G as n } from "../chunks/GenRandomId-VodkdWbp.mjs";
|
|
4
4
|
import { n as s } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.mjs";
|
|
5
5
|
const l = {
|
|
@@ -18,7 +18,7 @@ const l = {
|
|
|
18
18
|
id: {
|
|
19
19
|
type: String,
|
|
20
20
|
default: () => "action-" + n(),
|
|
21
|
-
validator: (
|
|
21
|
+
validator: (t) => t.trim() !== ""
|
|
22
22
|
},
|
|
23
23
|
/**
|
|
24
24
|
* checked state of the the checkbox element
|
|
@@ -68,18 +68,18 @@ const l = {
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
methods: {
|
|
71
|
-
checkInput(
|
|
71
|
+
checkInput(t) {
|
|
72
72
|
this.$refs.label.click();
|
|
73
73
|
},
|
|
74
|
-
onChange(
|
|
75
|
-
this.$emit("update:checked", this.$refs.checkbox.checked), this.$emit("change",
|
|
74
|
+
onChange(t) {
|
|
75
|
+
this.$emit("update:checked", this.$refs.checkbox.checked), this.$emit("change", t), this.$refs.checkbox.checked ? this.$emit("check") : this.$emit("uncheck");
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
var o = function() {
|
|
80
80
|
var e = this, a = e._self._c;
|
|
81
|
-
return a("li", { staticClass: "action", class: { "action--disabled": e.disabled }, attrs: { role: e.isInSemanticMenu && "presentation" } }, [a("span", { staticClass: "action-checkbox", attrs: { role: e.isInSemanticMenu && "menuitemcheckbox", "aria-checked": e.ariaChecked } }, [a("input", { ref: "checkbox", staticClass: "checkbox action-checkbox__checkbox", class: { focusable: e.isFocusable }, attrs: { id: e.id, disabled: e.disabled, type: "checkbox" }, domProps: { checked: e.checked, value: e.value }, on: { keydown: function(
|
|
82
|
-
return !
|
|
81
|
+
return a("li", { staticClass: "action", class: { "action--disabled": e.disabled }, attrs: { role: e.isInSemanticMenu && "presentation" } }, [a("span", { staticClass: "action-checkbox", attrs: { role: e.isInSemanticMenu && "menuitemcheckbox", "aria-checked": e.ariaChecked } }, [a("input", { ref: "checkbox", staticClass: "checkbox action-checkbox__checkbox", class: { focusable: e.isFocusable }, attrs: { id: e.id, disabled: e.disabled, type: "checkbox" }, domProps: { checked: e.checked, value: e.value }, on: { keydown: function(c) {
|
|
82
|
+
return !c.type.indexOf("key") && e._k(c.keyCode, "enter", 13, c.key, "Enter") || c.ctrlKey || c.shiftKey || c.altKey || c.metaKey ? null : (c.preventDefault(), e.checkInput.apply(null, arguments));
|
|
83
83
|
}, change: e.onChange } }), a("label", { ref: "label", staticClass: "action-checkbox__label", attrs: { for: e.id } }, [e._v(e._s(e.text))]), e._e()], 2)]);
|
|
84
84
|
}, r = [], d = /* @__PURE__ */ s(
|
|
85
85
|
l,
|
|
@@ -91,7 +91,7 @@ var o = function() {
|
|
|
91
91
|
null,
|
|
92
92
|
null
|
|
93
93
|
);
|
|
94
|
-
const
|
|
94
|
+
const k = d.exports;
|
|
95
95
|
export {
|
|
96
|
-
|
|
96
|
+
k as default
|
|
97
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcActionCheckbox.mjs","sources":["../../src/components/NcActionCheckbox/NcActionCheckbox.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<NcActions>\n\t\t<NcActionCheckbox @change=\"alert('(un)checked !')\">First choice</NcActionCheckbox>\n\t\t<NcActionCheckbox value=\"second\" @change=\"alert('(un)checked !')\">Second choice</NcActionCheckbox>\n\t\t<NcActionCheckbox :checked=\"true\" @change=\"alert('(un)checked !')\">Third choice (checked)</NcActionCheckbox>\n\t\t<NcActionCheckbox :disabled=\"true\" @change=\"alert('(un)checked !')\">Second choice (disabled)</NcActionCheckbox>\n\t</NcActions>\n```\n</docs>\n\n<template>\n\t<li class=\"action\" :class=\"{ 'action--disabled': disabled }\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t<span class=\"action-checkbox\" :role=\"isInSemanticMenu && 'menuitemcheckbox'\" :aria-checked=\"ariaChecked\">\n\t\t\t<input :id=\"id\"\n\t\t\t\tref=\"checkbox\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:checked=\"checked\"\n\t\t\t\t:value=\"value\"\n\t\t\t\t:class=\"{ focusable: isFocusable }\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tclass=\"checkbox action-checkbox__checkbox\"\n\t\t\t\t@keydown.enter.exact.prevent=\"checkInput\"\n\t\t\t\t@change=\"onChange\">\n\t\t\t<label ref=\"label\" :for=\"id\" class=\"action-checkbox__label\">{{ text }}</label>\n\n\t\t\t<!-- fake slot to gather inner text -->\n\t\t\t<slot v-if=\"false\" />\n\t\t</span>\n\t</li>\n</template>\n\n<script>\nimport ActionGlobalMixin from '../../mixins/actionGlobal.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nexport default {\n\tname: 'NcActionCheckbox',\n\n\tmixins: [ActionGlobalMixin],\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * id attribute of the checkbox element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'action-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * checked state of the the checkbox element\n\t\t */\n\t\tchecked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * value of the checkbox input\n\t\t */\n\t\tvalue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the checkbox element\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'change',\n\t\t'check',\n\t\t'uncheck',\n\t\t'update:checked',\n\t],\n\n\tcomputed: {\n\t\t/**\n\t\t * determines if the action is focusable\n\t\t *\n\t\t * @return {boolean} is the action focusable ?\n\t\t */\n\t\tisFocusable() {\n\t\t\treturn !this.disabled\n\t\t},\n\n\t\t/**\n\t\t * aria-checked attribute for role=\"menuitemcheckbox\"\n\t\t *\n\t\t * @return {'true'|'false'|undefined} aria-checked value if needed\n\t\t */\n\t\tariaChecked() {\n\t\t\tif (this.isInSemanticMenu) {\n\t\t\t\treturn this.checked ? 'true' : 'false'\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t},\n\n\tmethods: {\n\t\tcheckInput(event) {\n\t\t\t// by clicking we also trigger the change event\n\t\t\tthis.$refs.label.click()\n\t\t},\n\t\tonChange(event) {\n\t\t\t/**\n\t\t\t * Emitted when the checkbox state is changed\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tthis.$emit('update:checked', this.$refs.checkbox.checked)\n\n\t\t\t/**\n\t\t\t * Emitted when the checkbox state is changed\n\t\t\t *\n\t\t\t * @type {Event}\n\t\t\t */\n\t\t\tthis.$emit('change', event)\n\n\t\t\tif (this.$refs.checkbox.checked) {\n\t\t\t\t/**\n\t\t\t\t * Emitted when the checkbox is checked\n\t\t\t\t *\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.$emit('check')\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Emitted when the checkbox is unchecked\n\t\t\t\t *\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.$emit('uncheck')\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../../assets/action';\n@include action-active;\n@include action--disabled;\n\n.action-checkbox {\n\tdisplay: flex;\n\talign-items: flex-start;\n\n\twidth: 100%;\n\theight: auto;\n\tmargin: 0;\n\tpadding: 0;\n\n\tcursor: pointer;\n\twhite-space: nowrap;\n\n\tcolor: var(--color-main-text);\n\tborder: 0;\n\tborder-radius: 0; // otherwise Safari will cut the border-radius area\n\tbackground-color: transparent;\n\tbox-shadow: none;\n\n\tfont-weight: normal;\n\tline-height: $clickable-area;\n\n\t/* checkbox/radio fixes */\n\t&__checkbox {\n\t\tposition: absolute;\n\t\ttop: auto;\n\t\tleft: -10000px;\n\n\t\toverflow: hidden;\n\n\t\twidth: 1px;\n\t\theight: 1px;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\talign-items: center; // align checkbox to text\n\n\t\twidth: 100%;\n\t\tpadding: 0 !important;\n\t\tpadding-right: $icon-margin !important;\n\n\t\t// checkbox-width is 12px, border is 2\n\t\t// (44 - 14 - 2) / 2 = 14\n\t\t&::before {\n\t\t\tmargin: 0 14px 0 !important;\n\t\t}\n\t}\n\n\t&--disabled {\n\t\t&,\n\t\t.action-checkbox__label {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","ActionGlobalMixin","GenRandomId","id","event"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NcActionCheckbox.mjs","sources":["../../src/components/NcActionCheckbox/NcActionCheckbox.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\nThis component is made to be used inside of the [NcActions](#NcActions) component slots.\n\n```vue\n\t<NcActions>\n\t\t<NcActionCheckbox @change=\"alert('(un)checked !')\">First choice</NcActionCheckbox>\n\t\t<NcActionCheckbox value=\"second\" @change=\"alert('(un)checked !')\">Second choice</NcActionCheckbox>\n\t\t<NcActionCheckbox :checked=\"true\" @change=\"alert('(un)checked !')\">Third choice (checked)</NcActionCheckbox>\n\t\t<NcActionCheckbox :disabled=\"true\" @change=\"alert('(un)checked !')\">Second choice (disabled)</NcActionCheckbox>\n\t</NcActions>\n```\n</docs>\n\n<template>\n\t<li class=\"action\" :class=\"{ 'action--disabled': disabled }\" :role=\"isInSemanticMenu && 'presentation'\">\n\t\t<span class=\"action-checkbox\" :role=\"isInSemanticMenu && 'menuitemcheckbox'\" :aria-checked=\"ariaChecked\">\n\t\t\t<input :id=\"id\"\n\t\t\t\tref=\"checkbox\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:checked=\"checked\"\n\t\t\t\t:value=\"value\"\n\t\t\t\t:class=\"{ focusable: isFocusable }\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tclass=\"checkbox action-checkbox__checkbox\"\n\t\t\t\t@keydown.enter.exact.prevent=\"checkInput\"\n\t\t\t\t@change=\"onChange\">\n\t\t\t<label ref=\"label\" :for=\"id\" class=\"action-checkbox__label\">{{ text }}</label>\n\n\t\t\t<!-- fake slot to gather inner text -->\n\t\t\t<slot v-if=\"false\" />\n\t\t</span>\n\t</li>\n</template>\n\n<script>\nimport ActionGlobalMixin from '../../mixins/actionGlobal.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nexport default {\n\tname: 'NcActionCheckbox',\n\n\tmixins: [ActionGlobalMixin],\n\n\tinject: {\n\t\tisInSemanticMenu: {\n\t\t\tfrom: 'NcActions:isSemanticMenu',\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * id attribute of the checkbox element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'action-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * checked state of the the checkbox element\n\t\t */\n\t\tchecked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * value of the checkbox input\n\t\t */\n\t\tvalue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the checkbox element\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'change',\n\t\t'check',\n\t\t'uncheck',\n\t\t'update:checked',\n\t],\n\n\tcomputed: {\n\t\t/**\n\t\t * determines if the action is focusable\n\t\t *\n\t\t * @return {boolean} is the action focusable ?\n\t\t */\n\t\tisFocusable() {\n\t\t\treturn !this.disabled\n\t\t},\n\n\t\t/**\n\t\t * aria-checked attribute for role=\"menuitemcheckbox\"\n\t\t *\n\t\t * @return {'true'|'false'|undefined} aria-checked value if needed\n\t\t */\n\t\tariaChecked() {\n\t\t\tif (this.isInSemanticMenu) {\n\t\t\t\treturn this.checked ? 'true' : 'false'\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t},\n\n\tmethods: {\n\t\tcheckInput(event) {\n\t\t\t// by clicking we also trigger the change event\n\t\t\tthis.$refs.label.click()\n\t\t},\n\t\tonChange(event) {\n\t\t\t/**\n\t\t\t * Emitted when the checkbox state is changed\n\t\t\t *\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tthis.$emit('update:checked', this.$refs.checkbox.checked)\n\n\t\t\t/**\n\t\t\t * Emitted when the checkbox state is changed\n\t\t\t *\n\t\t\t * @type {Event}\n\t\t\t */\n\t\t\tthis.$emit('change', event)\n\n\t\t\tif (this.$refs.checkbox.checked) {\n\t\t\t\t/**\n\t\t\t\t * Emitted when the checkbox is checked\n\t\t\t\t *\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.$emit('check')\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Emitted when the checkbox is unchecked\n\t\t\t\t *\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.$emit('uncheck')\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../../assets/action';\n@include action-active;\n@include action--disabled;\n\n.action-checkbox {\n\tdisplay: flex;\n\talign-items: flex-start;\n\n\twidth: 100%;\n\theight: auto;\n\tmargin: 0;\n\tpadding: 0;\n\n\tcursor: pointer;\n\twhite-space: nowrap;\n\n\tcolor: var(--color-main-text);\n\tborder: 0;\n\tborder-radius: 0; // otherwise Safari will cut the border-radius area\n\tbackground-color: transparent;\n\tbox-shadow: none;\n\n\tfont-weight: normal;\n\tline-height: $clickable-area;\n\n\t/* checkbox/radio fixes */\n\t&__checkbox {\n\t\tposition: absolute;\n\t\ttop: auto;\n\t\tleft: -10000px;\n\n\t\toverflow: hidden;\n\n\t\twidth: 1px;\n\t\theight: 1px;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\talign-items: center; // align checkbox to text\n\n\t\twidth: 100%;\n\t\tpadding: 0 !important;\n\t\tpadding-right: $icon-margin !important;\n\n\t\t// checkbox-width is 12px, border is 2\n\t\t// (44 - 14 - 2) / 2 = 14\n\t\t&::before {\n\t\t\tmargin: 0 14px 0 !important;\n\t\t}\n\t}\n\n\t&--disabled {\n\t\t&,\n\t\t.action-checkbox__label {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","ActionGlobalMixin","GenRandomId","id","event"],"mappings":";;;AA6DA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,QAAA;AAAA,IACA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,YAAAC,EAAA;AAAA,MACA,WAAA,CAAAC,MAAAA,EAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AACA,aAAA,CAAA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AACA,UAAA,KAAA;AACA,eAAA,KAAA,UAAA,SAAA;AAAA,IAGA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAAC,GAAA;AAEA,WAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA,IACA,SAAAA,GAAA;AAMA,WAAA,MAAA,kBAAA,KAAA,MAAA,SAAA,OAAA,GAOA,KAAA,MAAA,UAAAA,CAAA,GAEA,KAAA,MAAA,SAAA,UAMA,KAAA,MAAA,OAAA,IAOA,KAAA,MAAA,SAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;"}
|