@nextcloud/vue 8.0.0-beta.6 → 8.0.0-beta.8
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 +17 -0
- package/dist/Components/NcActionButton.cjs +49 -1
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +48 -12
- package/dist/Components/NcActionButton.mjs.map +1 -1
- package/dist/Components/NcActionButtonGroup.cjs +30 -1
- package/dist/Components/NcActionButtonGroup.cjs.map +1 -1
- package/dist/Components/NcActionButtonGroup.mjs +30 -9
- package/dist/Components/NcActionButtonGroup.mjs.map +1 -1
- package/dist/Components/NcActionCaption.cjs +29 -1
- package/dist/Components/NcActionCaption.cjs.map +1 -1
- package/dist/Components/NcActionCaption.mjs +29 -9
- package/dist/Components/NcActionCaption.mjs.map +1 -1
- package/dist/Components/NcActionCheckbox.cjs +78 -1
- package/dist/Components/NcActionCheckbox.cjs.map +1 -1
- package/dist/Components/NcActionCheckbox.mjs +80 -19
- package/dist/Components/NcActionCheckbox.mjs.map +1 -1
- package/dist/Components/NcActionInput.cjs +226 -1
- package/dist/Components/NcActionInput.cjs.map +1 -1
- package/dist/Components/NcActionInput.mjs +227 -68
- package/dist/Components/NcActionInput.mjs.map +1 -1
- package/dist/Components/NcActionLink.cjs +69 -1
- package/dist/Components/NcActionLink.cjs.map +1 -1
- package/dist/Components/NcActionLink.mjs +65 -13
- package/dist/Components/NcActionLink.mjs.map +1 -1
- package/dist/Components/NcActionRadio.cjs +85 -1
- package/dist/Components/NcActionRadio.cjs.map +1 -1
- package/dist/Components/NcActionRadio.mjs +87 -19
- package/dist/Components/NcActionRadio.mjs.map +1 -1
- package/dist/Components/NcActionRouter.cjs +42 -1
- package/dist/Components/NcActionRouter.cjs.map +1 -1
- package/dist/Components/NcActionRouter.mjs +41 -12
- package/dist/Components/NcActionRouter.mjs.map +1 -1
- package/dist/Components/NcActionSeparator.cjs +20 -1
- package/dist/Components/NcActionSeparator.cjs.map +1 -1
- package/dist/Components/NcActionSeparator.mjs +20 -9
- package/dist/Components/NcActionSeparator.mjs.map +1 -1
- package/dist/Components/NcActionText.cjs +23 -1
- package/dist/Components/NcActionText.cjs.map +1 -1
- package/dist/Components/NcActionText.mjs +20 -8
- package/dist/Components/NcActionText.mjs.map +1 -1
- package/dist/Components/NcActionTextEditable.cjs +81 -1
- package/dist/Components/NcActionTextEditable.cjs.map +1 -1
- package/dist/Components/NcActionTextEditable.mjs +79 -22
- package/dist/Components/NcActionTextEditable.mjs.map +1 -1
- package/dist/Components/NcActions.cjs +455 -1
- package/dist/Components/NcActions.cjs.map +1 -1
- package/dist/Components/NcActions.mjs +459 -100
- package/dist/Components/NcActions.mjs.map +1 -1
- package/dist/Components/NcAppContent.cjs +218 -1
- package/dist/Components/NcAppContent.cjs.map +1 -1
- package/dist/Components/NcAppContent.mjs +220 -66
- package/dist/Components/NcAppContent.mjs.map +1 -1
- package/dist/Components/NcAppContentDetails.cjs +19 -1
- package/dist/Components/NcAppContentDetails.cjs.map +1 -1
- package/dist/Components/NcAppContentDetails.mjs +18 -7
- package/dist/Components/NcAppContentDetails.mjs.map +1 -1
- package/dist/Components/NcAppContentList.cjs +29 -1
- package/dist/Components/NcAppContentList.cjs.map +1 -1
- package/dist/Components/NcAppContentList.mjs +29 -8
- package/dist/Components/NcAppContentList.mjs.map +1 -1
- package/dist/Components/NcAppNavigation.cjs +66 -1
- package/dist/Components/NcAppNavigation.cjs.map +1 -1
- package/dist/Components/NcAppNavigation.mjs +67 -28
- package/dist/Components/NcAppNavigation.mjs.map +1 -1
- package/dist/Components/NcAppNavigationCaption.cjs +44 -1
- package/dist/Components/NcAppNavigationCaption.cjs.map +1 -1
- package/dist/Components/NcAppNavigationCaption.mjs +40 -9
- package/dist/Components/NcAppNavigationCaption.mjs.map +1 -1
- package/dist/Components/NcAppNavigationIconBullet.cjs +40 -1
- package/dist/Components/NcAppNavigationIconBullet.cjs.map +1 -1
- package/dist/Components/NcAppNavigationIconBullet.mjs +40 -15
- package/dist/Components/NcAppNavigationIconBullet.mjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.cjs +386 -1
- package/dist/Components/NcAppNavigationItem.cjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +382 -81
- package/dist/Components/NcAppNavigationItem.mjs.map +1 -1
- package/dist/Components/NcAppNavigationNew.cjs +50 -1
- package/dist/Components/NcAppNavigationNew.cjs.map +1 -1
- package/dist/Components/NcAppNavigationNew.mjs +51 -14
- package/dist/Components/NcAppNavigationNew.mjs.map +1 -1
- package/dist/Components/NcAppNavigationNewItem.cjs +87 -1
- package/dist/Components/NcAppNavigationNewItem.cjs.map +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +83 -17
- package/dist/Components/NcAppNavigationNewItem.mjs.map +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +69 -1
- package/dist/Components/NcAppNavigationSettings.cjs.map +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +60 -21
- package/dist/Components/NcAppNavigationSettings.mjs.map +1 -1
- package/dist/Components/NcAppNavigationSpacer.cjs +20 -1
- package/dist/Components/NcAppNavigationSpacer.cjs.map +1 -1
- package/dist/Components/NcAppNavigationSpacer.mjs +20 -9
- package/dist/Components/NcAppNavigationSpacer.mjs.map +1 -1
- package/dist/Components/NcAppNavigationToggle.cjs +25 -1
- package/dist/Components/NcAppNavigationToggle.cjs.map +1 -1
- package/dist/Components/NcAppNavigationToggle.mjs +21 -1
- package/dist/Components/NcAppNavigationToggle.mjs.map +1 -1
- package/dist/Components/NcAppSettingsDialog.cjs +207 -1
- package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +209 -48
- package/dist/Components/NcAppSettingsDialog.mjs.map +1 -1
- package/dist/Components/NcAppSettingsSection.cjs +39 -1
- package/dist/Components/NcAppSettingsSection.cjs.map +1 -1
- package/dist/Components/NcAppSettingsSection.mjs +39 -13
- package/dist/Components/NcAppSettingsSection.mjs.map +1 -1
- package/dist/Components/NcAppSidebar.cjs +443 -1
- package/dist/Components/NcAppSidebar.cjs.map +1 -1
- package/dist/Components/NcAppSidebar.mjs +409 -92
- package/dist/Components/NcAppSidebar.mjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.cjs +83 -1
- package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.mjs +83 -20
- package/dist/Components/NcAppSidebarTab.mjs.map +1 -1
- package/dist/Components/NcAvatar.cjs +3 -1
- package/dist/Components/NcAvatar.cjs.map +1 -1
- package/dist/Components/NcAvatar.mjs +1 -1
- package/dist/Components/NcBreadcrumb.cjs +175 -1
- package/dist/Components/NcBreadcrumb.cjs.map +1 -1
- package/dist/Components/NcBreadcrumb.mjs +175 -35
- package/dist/Components/NcBreadcrumb.mjs.map +1 -1
- package/dist/Components/NcBreadcrumbs.cjs +372 -1
- package/dist/Components/NcBreadcrumbs.cjs.map +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +373 -142
- package/dist/Components/NcBreadcrumbs.mjs.map +1 -1
- package/dist/Components/NcButton.cjs +226 -1
- package/dist/Components/NcButton.cjs.map +1 -1
- package/dist/Components/NcButton.mjs +226 -24
- package/dist/Components/NcButton.mjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +237 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +243 -57
- package/dist/Components/NcCheckboxRadioSwitch.mjs.map +1 -1
- package/dist/Components/NcColorPicker.cjs +118 -1
- package/dist/Components/NcColorPicker.cjs.map +1 -1
- package/dist/Components/NcColorPicker.mjs +124 -46
- package/dist/Components/NcColorPicker.mjs.map +1 -1
- package/dist/Components/NcContent.cjs +25 -1
- package/dist/Components/NcContent.cjs.map +1 -1
- package/dist/Components/NcContent.mjs +24 -8
- package/dist/Components/NcContent.mjs.map +1 -1
- package/dist/Components/NcCounterBubble.cjs +47 -1
- package/dist/Components/NcCounterBubble.cjs.map +1 -1
- package/dist/Components/NcCounterBubble.mjs +46 -12
- package/dist/Components/NcCounterBubble.mjs.map +1 -1
- package/dist/Components/NcDashboardWidget.cjs +133 -1
- package/dist/Components/NcDashboardWidget.cjs.map +1 -1
- package/dist/Components/NcDashboardWidget.mjs +128 -39
- package/dist/Components/NcDashboardWidget.mjs.map +1 -1
- package/dist/Components/NcDashboardWidgetItem.cjs +138 -1
- package/dist/Components/NcDashboardWidgetItem.cjs.map +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +129 -22
- package/dist/Components/NcDashboardWidgetItem.mjs.map +1 -1
- package/dist/Components/NcDateTime.cjs +125 -0
- package/dist/Components/{NcDatetime.mjs.map → NcDateTime.cjs.map} +1 -1
- package/dist/Components/NcDateTime.mjs +129 -0
- package/dist/Components/{NcDatetime.cjs.map → NcDateTime.mjs.map} +1 -1
- package/dist/Components/NcDateTimePicker.cjs +217 -0
- package/dist/Components/NcDateTimePicker.cjs.map +1 -0
- package/dist/Components/NcDateTimePicker.mjs +228 -0
- package/dist/Components/NcDateTimePicker.mjs.map +1 -0
- package/dist/Components/NcDateTimePickerNative.cjs +199 -1
- package/dist/Components/NcDateTimePickerNative.cjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +195 -58
- package/dist/Components/NcDateTimePickerNative.mjs.map +1 -1
- package/dist/Components/NcEllipsisedOption.cjs +74 -1
- package/dist/Components/NcEllipsisedOption.cjs.map +1 -1
- package/dist/Components/NcEllipsisedOption.mjs +73 -20
- package/dist/Components/NcEllipsisedOption.mjs.map +1 -1
- package/dist/Components/NcEmojiPicker.cjs +175 -1
- package/dist/Components/NcEmojiPicker.cjs.map +1 -1
- package/dist/Components/NcEmojiPicker.mjs +173 -53
- package/dist/Components/NcEmojiPicker.mjs.map +1 -1
- package/dist/Components/NcEmptyContent.cjs +54 -1
- package/dist/Components/NcEmptyContent.cjs.map +1 -1
- package/dist/Components/NcEmptyContent.mjs +46 -10
- package/dist/Components/NcEmptyContent.mjs.map +1 -1
- package/dist/Components/NcGuestContent.cjs +26 -1
- package/dist/Components/NcGuestContent.cjs.map +1 -1
- package/dist/Components/NcGuestContent.mjs +24 -11
- package/dist/Components/NcGuestContent.mjs.map +1 -1
- package/dist/Components/NcHeaderMenu.cjs +167 -1
- package/dist/Components/NcHeaderMenu.cjs.map +1 -1
- package/dist/Components/NcHeaderMenu.mjs +161 -49
- package/dist/Components/NcHeaderMenu.mjs.map +1 -1
- package/dist/Components/NcHighlight.cjs +3 -1
- package/dist/Components/NcHighlight.cjs.map +1 -1
- package/dist/Components/NcHighlight.mjs +1 -1
- package/dist/Components/NcIconSvgWrapper.cjs +44 -1
- package/dist/Components/NcIconSvgWrapper.cjs.map +1 -1
- package/dist/Components/NcIconSvgWrapper.mjs +45 -15
- package/dist/Components/NcIconSvgWrapper.mjs.map +1 -1
- package/dist/Components/NcInputField.cjs +210 -1
- package/dist/Components/NcInputField.cjs.map +1 -1
- package/dist/Components/NcInputField.mjs +211 -38
- package/dist/Components/NcInputField.mjs.map +1 -1
- package/dist/Components/NcListItem.cjs +237 -1
- package/dist/Components/NcListItem.cjs.map +1 -1
- package/dist/Components/NcListItem.mjs +233 -57
- package/dist/Components/NcListItem.mjs.map +1 -1
- package/dist/Components/NcListItemIcon.cjs +150 -1
- package/dist/Components/NcListItemIcon.cjs.map +1 -1
- package/dist/Components/NcListItemIcon.mjs +142 -26
- package/dist/Components/NcListItemIcon.mjs.map +1 -1
- package/dist/Components/NcLoadingIcon.cjs +54 -1
- package/dist/Components/NcLoadingIcon.cjs.map +1 -1
- package/dist/Components/NcLoadingIcon.mjs +54 -14
- package/dist/Components/NcLoadingIcon.mjs.map +1 -1
- package/dist/Components/NcModal.cjs +405 -1
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +401 -103
- package/dist/Components/NcModal.mjs.map +1 -1
- package/dist/Components/NcNoteCard.cjs +71 -1
- package/dist/Components/NcNoteCard.cjs.map +1 -1
- package/dist/Components/NcNoteCard.mjs +71 -37
- package/dist/Components/NcNoteCard.mjs.map +1 -1
- package/dist/Components/NcPasswordField.cjs +152 -1
- package/dist/Components/NcPasswordField.cjs.map +1 -1
- package/dist/Components/NcPasswordField.mjs +157 -53
- package/dist/Components/NcPasswordField.mjs.map +1 -1
- package/dist/Components/NcPopover.cjs +125 -1
- package/dist/Components/NcPopover.cjs.map +1 -1
- package/dist/Components/NcPopover.mjs +124 -41
- package/dist/Components/NcPopover.mjs.map +1 -1
- package/dist/Components/NcProgressBar.cjs +57 -1
- package/dist/Components/NcProgressBar.cjs.map +1 -1
- package/dist/Components/NcProgressBar.mjs +57 -15
- package/dist/Components/NcProgressBar.mjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +168 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +166 -60
- package/dist/Components/NcRelatedResourcesPanel.mjs.map +1 -1
- package/dist/Components/NcRichContenteditable.cjs +478 -1
- package/dist/Components/NcRichContenteditable.cjs.map +1 -1
- package/dist/Components/NcRichContenteditable.mjs +447 -127
- package/dist/Components/NcRichContenteditable.mjs.map +1 -1
- package/dist/Components/NcRichText.cjs +44 -1
- package/dist/Components/NcRichText.cjs.map +1 -1
- package/dist/Components/NcRichText.mjs +25 -4
- package/dist/Components/NcRichText.mjs.map +1 -1
- package/dist/Components/NcSavingIndicatorIcon.cjs +59 -1
- package/dist/Components/NcSavingIndicatorIcon.cjs.map +1 -1
- package/dist/Components/NcSavingIndicatorIcon.mjs +56 -9
- package/dist/Components/NcSavingIndicatorIcon.mjs.map +1 -1
- package/dist/Components/NcSelect.cjs +406 -1
- package/dist/Components/NcSelect.cjs.map +1 -1
- package/dist/Components/NcSelect.mjs +402 -49
- package/dist/Components/NcSelect.mjs.map +1 -1
- package/dist/Components/NcSelectTags.cjs +251 -2
- package/dist/Components/NcSelectTags.cjs.map +1 -1
- package/dist/Components/NcSelectTags.mjs +236 -73
- package/dist/Components/NcSelectTags.mjs.map +1 -1
- package/dist/Components/NcSettingsInputText.cjs +90 -1
- package/dist/Components/NcSettingsInputText.cjs.map +1 -1
- package/dist/Components/NcSettingsInputText.mjs +88 -19
- package/dist/Components/NcSettingsInputText.mjs.map +1 -1
- package/dist/Components/NcSettingsSection.cjs +62 -1
- package/dist/Components/NcSettingsSection.cjs.map +1 -1
- package/dist/Components/NcSettingsSection.mjs +62 -15
- package/dist/Components/NcSettingsSection.mjs.map +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +26 -1
- package/dist/Components/NcSettingsSelectGroup.cjs.map +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +24 -53
- package/dist/Components/NcSettingsSelectGroup.mjs.map +1 -1
- package/dist/Components/NcTextField.cjs +74 -1
- package/dist/Components/NcTextField.cjs.map +1 -1
- package/dist/Components/NcTextField.mjs +77 -21
- package/dist/Components/NcTextField.mjs.map +1 -1
- package/dist/Components/NcTimezonePicker.cjs +4387 -614
- package/dist/Components/NcTimezonePicker.cjs.map +1 -1
- package/dist/Components/NcTimezonePicker.mjs +4372 -663
- package/dist/Components/NcTimezonePicker.mjs.map +1 -1
- package/dist/Components/NcUserBubble.cjs +189 -1
- package/dist/Components/NcUserBubble.cjs.map +1 -1
- package/dist/Components/NcUserBubble.mjs +190 -47
- package/dist/Components/NcUserBubble.mjs.map +1 -1
- package/dist/Components/NcVNodes.cjs +35 -1
- package/dist/Components/NcVNodes.cjs.map +1 -1
- package/dist/Components/NcVNodes.mjs +35 -8
- package/dist/Components/NcVNodes.mjs.map +1 -1
- package/dist/Directives/Focus.cjs +30 -1
- package/dist/Directives/Focus.cjs.map +1 -1
- package/dist/Directives/Focus.mjs +28 -5
- package/dist/Directives/Focus.mjs.map +1 -1
- package/dist/Directives/Linkify.cjs +8 -1
- package/dist/Directives/Linkify.cjs.map +1 -1
- package/dist/Directives/Linkify.mjs +6 -6
- package/dist/Directives/Linkify.mjs.map +1 -1
- package/dist/Directives/Tooltip.cjs +37 -1
- package/dist/Directives/Tooltip.cjs.map +1 -1
- package/dist/Directives/Tooltip.mjs +29 -4
- package/dist/Directives/Tooltip.mjs.map +1 -1
- package/dist/Functions/emoji.cjs +36 -1
- package/dist/Functions/emoji.cjs.map +1 -1
- package/dist/Functions/emoji.mjs +32 -11
- package/dist/Functions/emoji.mjs.map +1 -1
- package/dist/Functions/usernameToColor.cjs +39 -1
- package/dist/Functions/usernameToColor.cjs.map +1 -1
- package/dist/Functions/usernameToColor.mjs +32 -11
- package/dist/Functions/usernameToColor.mjs.map +1 -1
- package/dist/Mixins/clickOutsideOptions.cjs +40 -1
- package/dist/Mixins/clickOutsideOptions.cjs.map +1 -1
- package/dist/Mixins/clickOutsideOptions.mjs +39 -4
- package/dist/Mixins/clickOutsideOptions.mjs.map +1 -1
- package/dist/Mixins/isFullscreen.cjs +44 -1
- package/dist/Mixins/isFullscreen.cjs.map +1 -1
- package/dist/Mixins/isFullscreen.mjs +42 -11
- package/dist/Mixins/isFullscreen.mjs.map +1 -1
- package/dist/Mixins/isMobile.cjs +87 -1
- package/dist/Mixins/isMobile.cjs.map +1 -1
- package/dist/Mixins/isMobile.mjs +86 -11
- package/dist/Mixins/isMobile.mjs.map +1 -1
- package/dist/Mixins/richEditor.cjs +10 -1
- package/dist/Mixins/richEditor.cjs.map +1 -1
- package/dist/Mixins/richEditor.mjs +2 -2
- package/dist/assets/{index28.css → NcAppNavigationToggle-2cc5b864.css} +16 -2
- package/dist/assets/NcInputConfirmCancel-2ba60a52.css +51 -0
- package/dist/assets/NcMentionBubble-6e887c5f.css +81 -0
- package/dist/assets/{index46.css → NcSettingsSelectGroup-0d38d76b.css} +15 -2
- package/dist/assets/index-01e5adf4.css +79 -0
- package/dist/assets/index-03ec5f40.css +60 -0
- package/dist/assets/{index.css → index-0557f12a.css} +26 -2
- package/dist/assets/index-0ab8e182.css +128 -0
- package/dist/assets/index-0adc989c.css +96 -0
- package/dist/assets/index-1151d229.css +41 -0
- package/dist/assets/index-165fce0e.css +82 -0
- package/dist/assets/index-194e9415.css +163 -0
- package/dist/assets/index-1beccc92.css +140 -0
- package/dist/assets/index-1cf8eeb4.css +97 -0
- package/dist/assets/index-23e64bbb.css +59 -0
- package/dist/assets/{index50.css → index-24f6c355.css} +67 -3
- package/dist/assets/index-294382c8.css +879 -0
- package/dist/assets/index-2a8e4ca1.css +540 -0
- package/dist/assets/index-2d4de2fc.css +38 -0
- package/dist/assets/{index2.css → index-30e099f7.css} +17 -2
- package/dist/assets/{NcInputConfirmCancel.css → index-33da80f0.css} +32 -2
- package/dist/assets/index-34dfc54e.css +88 -0
- package/dist/assets/index-3764a447.css +99 -0
- package/dist/assets/index-376d2dec.css +243 -0
- package/dist/assets/{index17.css → index-441b6552.css} +25 -2
- package/dist/assets/index-4a775ba1.css +204 -0
- package/dist/assets/index-4ebacc78.css +107 -0
- package/dist/assets/index-4ef32afd.css +128 -0
- package/dist/assets/{index47.css → index-5072b6ee.css} +77 -3
- package/dist/assets/index-50b0766d.css +202 -0
- package/dist/assets/index-5eff69c7.css +149 -0
- package/dist/assets/index-5fa0ac5a.css +46 -0
- package/dist/assets/index-61b63a8f.css +57 -0
- package/dist/assets/index-6405cd50.css +76 -0
- package/dist/assets/index-6416f636.css +83 -0
- package/dist/assets/index-6c47e88a.css +46 -0
- package/dist/assets/index-76a58945.css +68 -0
- package/dist/assets/index-76dd9f11.css +5 -0
- package/dist/assets/index-7768d5e5.css +148 -0
- package/dist/assets/index-7813bab3.css +66 -0
- package/dist/assets/index-793eae6b.css +234 -0
- package/dist/assets/index-8aa4712e.css +51 -0
- package/dist/assets/{index27.css → index-8f52a20f.css} +16 -2
- package/dist/assets/index-9354264c.css +80 -0
- package/dist/assets/index-93ad846c.css +259 -0
- package/dist/assets/index-a2b51bce.css +47 -0
- package/dist/assets/index-a2d55f92.css +204 -0
- package/dist/assets/{index13.css → index-a9e4fe04.css} +27 -2
- package/dist/assets/{NcAppNavigationToggle.css → index-b8f13a1f.css} +13 -2
- package/dist/assets/index-b991895f.css +87 -0
- package/dist/assets/{index48.css → index-baf8711a.css} +67 -3
- package/dist/assets/index-becfbea7.css +128 -0
- package/dist/assets/index-c6f0da2e.css +69 -0
- package/dist/assets/index-c7905a53.css +44 -0
- package/dist/assets/index-d211cae8.css +93 -0
- package/dist/assets/{index22.css → index-d646553d.css} +22 -2
- package/dist/assets/index-de0326c7.css +304 -0
- package/dist/assets/index-ed4adf1d.css +115 -0
- package/dist/assets/index-edee3304.css +52 -0
- package/dist/assets/index-fbdeb5ab.css +303 -0
- package/dist/assets/index-fc61f2d8.css +41 -0
- package/dist/assets/index-fec4bb7b.css +132 -0
- package/dist/assets/referencePickerModal-0acecb5e.css +482 -0
- package/dist/chunks/GenColors-38246c38.mjs +46 -0
- package/dist/chunks/{GenColors-8097de04.cjs.map → GenColors-38246c38.mjs.map} +1 -1
- package/dist/chunks/GenColors-eedcc70a.cjs +45 -0
- package/dist/chunks/{GenColors-85cb6194.mjs.map → GenColors-eedcc70a.cjs.map} +1 -1
- package/dist/{assets/index29.css → chunks/GenRandomId-c214d235.cjs} +8 -5
- package/dist/chunks/{GenRandomId-67df40eb.cjs.map → GenRandomId-c214d235.cjs.map} +1 -1
- package/dist/chunks/GenRandomId-cb9ccebe.mjs +25 -0
- package/dist/chunks/{GenRandomId-1e1b509a.mjs.map → GenRandomId-cb9ccebe.mjs.map} +1 -1
- package/dist/chunks/Linkify-39f20c9a.mjs +33 -0
- package/dist/chunks/{Linkify-a0faf443.mjs.map → Linkify-39f20c9a.mjs.map} +1 -1
- package/dist/chunks/Linkify-40cdd635.cjs +32 -0
- package/dist/chunks/{Linkify-a4db36a9.cjs.map → Linkify-40cdd635.cjs.map} +1 -1
- package/dist/chunks/NcAppNavigationToggle-960658a0.cjs +49 -0
- package/dist/chunks/NcAppNavigationToggle-960658a0.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationToggle-d868f651.mjs +55 -0
- package/dist/chunks/NcAppNavigationToggle-d868f651.mjs.map +1 -0
- package/dist/chunks/NcInputConfirmCancel-0c4bee9a.cjs +83 -0
- package/dist/chunks/NcInputConfirmCancel-0c4bee9a.cjs.map +1 -0
- package/dist/chunks/NcInputConfirmCancel-f881168d.mjs +89 -0
- package/dist/chunks/NcInputConfirmCancel-f881168d.mjs.map +1 -0
- package/dist/chunks/NcRichText-1c3d2654.mjs +302 -0
- package/dist/chunks/{NcRichText-13b09624.mjs.map → NcRichText-1c3d2654.mjs.map} +1 -1
- package/dist/chunks/NcRichText-d385dc10.cjs +289 -0
- package/dist/chunks/{NcRichText-1e8854a1.cjs.map → NcRichText-d385dc10.cjs.map} +1 -1
- package/dist/chunks/NcSettingsSelectGroup-0f4a0f94.mjs +192 -0
- package/dist/chunks/NcSettingsSelectGroup-0f4a0f94.mjs.map +1 -0
- package/dist/chunks/NcSettingsSelectGroup-47d9c113.cjs +183 -0
- package/dist/chunks/NcSettingsSelectGroup-47d9c113.cjs.map +1 -0
- package/dist/chunks/ScopeComponent-1c75ec38.cjs +28 -0
- package/dist/chunks/{ScopeComponent-f6122f5a.cjs.map → ScopeComponent-1c75ec38.cjs.map} +1 -1
- package/dist/chunks/ScopeComponent-97a014a1.mjs +29 -0
- package/dist/chunks/{ScopeComponent-dbcd0e07.mjs.map → ScopeComponent-97a014a1.mjs.map} +1 -1
- package/dist/chunks/_plugin-vue2_normalizer-71e2aa87.mjs +32 -0
- package/dist/chunks/_plugin-vue2_normalizer-71e2aa87.mjs.map +1 -0
- package/dist/chunks/_plugin-vue2_normalizer-7f9efb60.cjs +31 -0
- package/dist/chunks/_plugin-vue2_normalizer-7f9efb60.cjs.map +1 -0
- package/dist/chunks/actionGlobal-8c1c28c9.mjs +50 -0
- package/dist/chunks/{actionGlobal-cda46023.mjs.map → actionGlobal-8c1c28c9.mjs.map} +1 -1
- package/dist/chunks/actionGlobal-9e29e11b.cjs +49 -0
- package/dist/chunks/{actionGlobal-ec7003e8.cjs.map → actionGlobal-9e29e11b.cjs.map} +1 -1
- package/dist/chunks/actionText-9f5c55bd.mjs +121 -0
- package/dist/chunks/{actionText-6c35d3fc.mjs.map → actionText-9f5c55bd.mjs.map} +1 -1
- package/dist/chunks/actionText-b0bd6eb7.cjs +120 -0
- package/dist/chunks/{actionText-bef01778.cjs.map → actionText-b0bd6eb7.cjs.map} +1 -1
- package/dist/chunks/focusTrap-14985831.cjs +26 -0
- package/dist/chunks/{focusTrap-173aba65.mjs.map → focusTrap-14985831.cjs.map} +1 -1
- package/dist/chunks/focusTrap-5d0f71d4.mjs +27 -0
- package/dist/chunks/{focusTrap-139520e2.cjs.map → focusTrap-5d0f71d4.mjs.map} +1 -1
- package/dist/chunks/index-20a9ace9.mjs +149 -0
- package/dist/chunks/{index-cd3f1f8f.mjs.map → index-20a9ace9.mjs.map} +1 -1
- package/dist/chunks/index-2a5b8ace.cjs +434 -0
- package/dist/chunks/index-2a5b8ace.cjs.map +1 -0
- package/dist/chunks/index-4398f925.cjs +149 -0
- package/dist/chunks/{index-c4cd0463.cjs.map → index-4398f925.cjs.map} +1 -1
- package/dist/chunks/index-5f2a5f57.mjs +155 -0
- package/dist/chunks/{index-9c621303.mjs.map → index-5f2a5f57.mjs.map} +1 -1
- package/dist/chunks/index-6c221fa0.mjs +447 -0
- package/dist/chunks/index-6c221fa0.mjs.map +1 -0
- package/dist/chunks/index-e894376a.cjs +148 -0
- package/dist/chunks/{index-df3f51c6.cjs.map → index-e894376a.cjs.map} +1 -1
- package/dist/chunks/l10n-27a75c40.mjs +31 -0
- package/dist/chunks/l10n-27a75c40.mjs.map +1 -0
- package/dist/chunks/l10n-4326316a.cjs +8 -0
- package/dist/chunks/l10n-4326316a.cjs.map +1 -0
- package/dist/chunks/l10n-903083c4.cjs +29 -0
- package/dist/chunks/l10n-903083c4.cjs.map +1 -0
- package/dist/chunks/l10n-c5f5f001.mjs +10 -0
- package/dist/chunks/l10n-c5f5f001.mjs.map +1 -0
- package/dist/chunks/logger-3612e664.mjs +25 -0
- package/dist/chunks/{logger-01af1a78.cjs.map → logger-3612e664.mjs.map} +1 -1
- package/dist/chunks/logger-4998b668.cjs +24 -0
- package/dist/chunks/{logger-ccc7ee65.mjs.map → logger-4998b668.cjs.map} +1 -1
- package/dist/chunks/referencePickerModal-0fde503d.mjs +877 -0
- package/dist/chunks/referencePickerModal-0fde503d.mjs.map +1 -0
- package/dist/chunks/referencePickerModal-9b4ff88d.cjs +858 -0
- package/dist/chunks/referencePickerModal-9b4ff88d.cjs.map +1 -0
- package/dist/index.cjs +251 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +286 -140
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/Components/NcDatetime.cjs +0 -1
- package/dist/Components/NcDatetime.mjs +0 -44
- package/dist/Components/NcDatetimePicker.cjs +0 -1
- package/dist/Components/NcDatetimePicker.cjs.map +0 -1
- package/dist/Components/NcDatetimePicker.mjs +0 -69
- package/dist/Components/NcDatetimePicker.mjs.map +0 -1
- package/dist/assets/NcMentionBubble.css +0 -21
- package/dist/assets/index10.css +0 -21
- package/dist/assets/index11.css +0 -21
- package/dist/assets/index12.css +0 -21
- package/dist/assets/index14.css +0 -21
- package/dist/assets/index15.css +0 -21
- package/dist/assets/index16.css +0 -21
- package/dist/assets/index18.css +0 -21
- package/dist/assets/index19.css +0 -21
- package/dist/assets/index20.css +0 -21
- package/dist/assets/index21.css +0 -21
- package/dist/assets/index23.css +0 -21
- package/dist/assets/index24.css +0 -1
- package/dist/assets/index25.css +0 -21
- package/dist/assets/index26.css +0 -21
- package/dist/assets/index3.css +0 -21
- package/dist/assets/index30.css +0 -21
- package/dist/assets/index31.css +0 -21
- package/dist/assets/index32.css +0 -21
- package/dist/assets/index33.css +0 -21
- package/dist/assets/index34.css +0 -21
- package/dist/assets/index35.css +0 -21
- package/dist/assets/index36.css +0 -21
- package/dist/assets/index37.css +0 -21
- package/dist/assets/index38.css +0 -21
- package/dist/assets/index39.css +0 -21
- package/dist/assets/index4.css +0 -21
- package/dist/assets/index40.css +0 -21
- package/dist/assets/index41.css +0 -21
- package/dist/assets/index42.css +0 -21
- package/dist/assets/index43.css +0 -42
- package/dist/assets/index44.css +0 -21
- package/dist/assets/index45.css +0 -42
- package/dist/assets/index49.css +0 -42
- package/dist/assets/index5.css +0 -21
- package/dist/assets/index51.css +0 -21
- package/dist/assets/index52.css +0 -21
- package/dist/assets/index53.css +0 -42
- package/dist/assets/index54.css +0 -21
- package/dist/assets/index55.css +0 -21
- package/dist/assets/index56.css +0 -21
- package/dist/assets/index57.css +0 -21
- package/dist/assets/index58.css +0 -42
- package/dist/assets/index6.css +0 -21
- package/dist/assets/index7.css +0 -21
- package/dist/assets/index8.css +0 -21
- package/dist/assets/index9.css +0 -21
- package/dist/assets/referencePickerModal.css +0 -21
- package/dist/chunks/GenColors-8097de04.cjs +0 -1
- package/dist/chunks/GenColors-85cb6194.mjs +0 -25
- package/dist/chunks/GenRandomId-1e1b509a.mjs +0 -4
- package/dist/chunks/GenRandomId-67df40eb.cjs +0 -1
- package/dist/chunks/IsMobileState-151fc57d.cjs +0 -1
- package/dist/chunks/IsMobileState-151fc57d.cjs.map +0 -1
- package/dist/chunks/IsMobileState-e1fe5f58.mjs +0 -15
- package/dist/chunks/IsMobileState-e1fe5f58.mjs.map +0 -1
- package/dist/chunks/Linkify-a0faf443.mjs +0 -5
- package/dist/chunks/Linkify-a4db36a9.cjs +0 -1
- package/dist/chunks/NcAppNavigationToggle-5aa396d7.mjs +0 -23
- package/dist/chunks/NcAppNavigationToggle-5aa396d7.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationToggle-c566f66e.cjs +0 -1
- package/dist/chunks/NcAppNavigationToggle-c566f66e.cjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-77c2b04f.cjs +0 -1
- package/dist/chunks/NcInputConfirmCancel-77c2b04f.cjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-c440e1b1.mjs +0 -43
- package/dist/chunks/NcInputConfirmCancel-c440e1b1.mjs.map +0 -1
- package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_357e6d0e_lang-b35c2f97.cjs.map +0 -1
- package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_357e6d0e_lang-b99cdc21.mjs.map +0 -1
- package/dist/chunks/NcRichText-13b09624.mjs +0 -123
- package/dist/chunks/NcRichText-1e8854a1.cjs +0 -1
- package/dist/chunks/ScopeComponent-dbcd0e07.mjs +0 -8
- package/dist/chunks/ScopeComponent-f6122f5a.cjs +0 -1
- package/dist/chunks/_plugin-vue2_normalizer-5b4c43a4.mjs +0 -24
- package/dist/chunks/_plugin-vue2_normalizer-5b4c43a4.mjs.map +0 -1
- package/dist/chunks/_plugin-vue2_normalizer-764a4c12.cjs +0 -1
- package/dist/chunks/_plugin-vue2_normalizer-764a4c12.cjs.map +0 -1
- package/dist/chunks/actionGlobal-cda46023.mjs +0 -15
- package/dist/chunks/actionGlobal-ec7003e8.cjs +0 -1
- package/dist/chunks/actionText-6c35d3fc.mjs +0 -23
- package/dist/chunks/actionText-bef01778.cjs +0 -1
- package/dist/chunks/focusTrap-139520e2.cjs +0 -1
- package/dist/chunks/focusTrap-173aba65.mjs +0 -6
- package/dist/chunks/index-12fa9b26.cjs +0 -1
- package/dist/chunks/index-12fa9b26.cjs.map +0 -1
- package/dist/chunks/index-7aa3fc24.mjs +0 -171
- package/dist/chunks/index-7aa3fc24.mjs.map +0 -1
- package/dist/chunks/index-9c621303.mjs +0 -46
- package/dist/chunks/index-c4cd0463.cjs +0 -3
- package/dist/chunks/index-cd3f1f8f.mjs +0 -43
- package/dist/chunks/index-df3f51c6.cjs +0 -1
- package/dist/chunks/l10n-05baf7da.mjs +0 -5
- package/dist/chunks/l10n-05baf7da.mjs.map +0 -1
- package/dist/chunks/l10n-46d0c1c0.cjs +0 -1
- package/dist/chunks/l10n-46d0c1c0.cjs.map +0 -1
- package/dist/chunks/l10n-9a5a6afc.mjs +0 -18
- package/dist/chunks/l10n-9a5a6afc.mjs.map +0 -1
- package/dist/chunks/l10n-dacb6440.cjs +0 -1
- package/dist/chunks/l10n-dacb6440.cjs.map +0 -1
- package/dist/chunks/logger-01af1a78.cjs +0 -1
- package/dist/chunks/logger-ccc7ee65.mjs +0 -5
- package/dist/chunks/referencePickerModal-2b16b319.mjs +0 -428
- package/dist/chunks/referencePickerModal-2b16b319.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-44160fb3.cjs +0 -1
- package/dist/chunks/referencePickerModal-44160fb3.cjs.map +0 -1
|
@@ -1,63 +1,249 @@
|
|
|
1
|
-
import "../assets/
|
|
1
|
+
import "../assets/index-194e9415.css";
|
|
2
2
|
import s from "./NcLoadingIcon.mjs";
|
|
3
|
-
import { G as
|
|
4
|
-
import { l as
|
|
3
|
+
import { G as c } from "../chunks/GenRandomId-cb9ccebe.mjs";
|
|
4
|
+
import { l as d } from "../chunks/l10n-c5f5f001.mjs";
|
|
5
5
|
import h from "vue-material-design-icons/CheckboxBlankOutline.vue";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import l from "vue-material-design-icons/MinusBox.vue";
|
|
7
|
+
import u from "vue-material-design-icons/CheckboxMarked.vue";
|
|
8
|
+
import p from "vue-material-design-icons/RadioboxMarked.vue";
|
|
9
|
+
import f from "vue-material-design-icons/RadioboxBlank.vue";
|
|
10
10
|
import m from "vue-material-design-icons/ToggleSwitchOff.vue";
|
|
11
|
-
import
|
|
12
|
-
import { n as
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
11
|
+
import k from "vue-material-design-icons/ToggleSwitch.vue";
|
|
12
|
+
import { n as b } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
13
|
+
const r = "checkbox", n = "radio", a = "switch", o = "button", y = {
|
|
14
|
+
name: "NcCheckboxRadioSwitch",
|
|
15
|
+
components: {
|
|
16
|
+
NcLoadingIcon: s
|
|
17
|
+
},
|
|
18
|
+
mixins: [d],
|
|
19
|
+
props: {
|
|
20
|
+
/**
|
|
21
|
+
* Unique id attribute of the input
|
|
22
|
+
*/
|
|
23
|
+
id: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: () => "checkbox-radio-switch-" + c(),
|
|
26
|
+
validator: (t) => t.trim() !== ""
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Input name. Required for radio, optional for checkbox, and ignored
|
|
30
|
+
* for button.
|
|
31
|
+
*/
|
|
32
|
+
name: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: null
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* Type of the input. checkbox, radio, switch, or button.
|
|
38
|
+
*
|
|
39
|
+
* Only use button when used in a `tablist` container and the
|
|
40
|
+
* `tab` role is set.
|
|
41
|
+
*/
|
|
42
|
+
type: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "checkbox",
|
|
45
|
+
validator: (t) => [
|
|
46
|
+
r,
|
|
47
|
+
n,
|
|
48
|
+
a,
|
|
49
|
+
o
|
|
50
|
+
].includes(t)
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Toggle the alternative button style
|
|
54
|
+
*/
|
|
55
|
+
buttonVariant: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: !1
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Are the elements are all direct siblings?
|
|
61
|
+
* If so they will be grouped horizontally or vertically
|
|
62
|
+
* Possible values are `no`, `horizontal`, `vertical`.
|
|
63
|
+
*/
|
|
64
|
+
buttonVariantGrouped: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "no",
|
|
67
|
+
validator: (t) => ["no", "vertical", "horizontal"].includes(t)
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* Checked state. To be used with `:value.sync`
|
|
71
|
+
*/
|
|
72
|
+
checked: {
|
|
73
|
+
type: [Boolean, Array, String],
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Value to be synced on check
|
|
78
|
+
*/
|
|
79
|
+
value: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: null
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Disabled state
|
|
85
|
+
*/
|
|
86
|
+
disabled: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: !1
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* Indeterminate state
|
|
92
|
+
*/
|
|
93
|
+
indeterminate: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: !1
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Required state
|
|
99
|
+
*/
|
|
100
|
+
required: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: !1
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Loading state
|
|
106
|
+
*/
|
|
107
|
+
loading: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: !1
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* Wrapping element tag
|
|
113
|
+
*/
|
|
114
|
+
wrapperElement: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: "span"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
emits: ["update:checked"],
|
|
120
|
+
computed: {
|
|
121
|
+
inputProps() {
|
|
122
|
+
return this.type === o ? null : {
|
|
123
|
+
checked: this.isChecked,
|
|
124
|
+
indeterminate: this.indeterminate,
|
|
125
|
+
required: this.required,
|
|
126
|
+
name: this.name
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
inputListeners() {
|
|
130
|
+
return this.type === o ? {
|
|
131
|
+
click: this.onToggle
|
|
132
|
+
} : {
|
|
133
|
+
change: this.onToggle
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* Icon size
|
|
138
|
+
*
|
|
139
|
+
@return {number}
|
|
140
|
+
*/
|
|
141
|
+
size() {
|
|
142
|
+
return this.type === a ? 36 : 24;
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Css local variables for this component
|
|
146
|
+
*
|
|
147
|
+
* @return {object}
|
|
148
|
+
*/
|
|
149
|
+
cssVars() {
|
|
150
|
+
return {
|
|
151
|
+
"--icon-size": this.size + "px"
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Return the input type.
|
|
156
|
+
* Switch is not an official type
|
|
157
|
+
*
|
|
158
|
+
* @return {string}
|
|
159
|
+
*/
|
|
160
|
+
inputType() {
|
|
161
|
+
return [
|
|
162
|
+
r,
|
|
163
|
+
n,
|
|
164
|
+
o
|
|
165
|
+
].includes(this.type) ? this.type : r;
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* Check if that entry is checked
|
|
169
|
+
* If value is defined, we use that as the checked value
|
|
170
|
+
* If not, we expect true/false in this.checked
|
|
171
|
+
*
|
|
172
|
+
* @return {boolean}
|
|
173
|
+
*/
|
|
174
|
+
isChecked() {
|
|
175
|
+
return this.value !== null ? Array.isArray(this.checked) ? [...this.checked].indexOf(this.value) > -1 : this.checked === this.value : this.checked === !0;
|
|
176
|
+
},
|
|
177
|
+
/**
|
|
178
|
+
* Returns the proper Material icon depending on the select case
|
|
179
|
+
*
|
|
180
|
+
* @return {object}
|
|
181
|
+
*/
|
|
182
|
+
checkboxRadioIconElement() {
|
|
183
|
+
return this.type === n ? this.isChecked ? p : f : this.type === a ? this.isChecked ? k : m : this.indeterminate ? l : this.isChecked ? u : h;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
mounted() {
|
|
187
|
+
if (this.name && this.type === r && !Array.isArray(this.checked))
|
|
188
|
+
throw new Error("When using groups of checkboxes, the updated value will be an array.");
|
|
189
|
+
if (this.name && this.type === a)
|
|
190
|
+
throw new Error("Switches are not made to be used for data sets. Please use checkboxes instead.");
|
|
191
|
+
if (typeof this.checked != "boolean" && this.type === a)
|
|
192
|
+
throw new Error("Switches can only be used with boolean as checked prop.");
|
|
193
|
+
},
|
|
194
|
+
methods: {
|
|
195
|
+
onToggle() {
|
|
196
|
+
if (this.disabled)
|
|
197
|
+
return;
|
|
198
|
+
if (this.type === n) {
|
|
199
|
+
this.$emit("update:checked", this.value);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (this.type === a) {
|
|
203
|
+
this.$emit("update:checked", !this.isChecked);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (typeof this.checked == "boolean") {
|
|
207
|
+
this.$emit("update:checked", !this.isChecked);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const t = this.getInputsSet().filter((e) => e.checked).map((e) => e.value);
|
|
211
|
+
this.$emit("update:checked", t);
|
|
212
|
+
},
|
|
213
|
+
/**
|
|
214
|
+
* Get the input set based on this name
|
|
215
|
+
*
|
|
216
|
+
* @return {Node[]}
|
|
217
|
+
*/
|
|
218
|
+
getInputsSet() {
|
|
219
|
+
return [...document.getElementsByName(this.name)];
|
|
220
|
+
}
|
|
40
221
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
222
|
+
};
|
|
223
|
+
var _ = function() {
|
|
224
|
+
var e = this, i = e._self._c;
|
|
225
|
+
return i(e.wrapperElement, { tag: "component", staticClass: "checkbox-radio-switch", class: {
|
|
226
|
+
["checkbox-radio-switch-" + e.type]: e.type,
|
|
227
|
+
"checkbox-radio-switch--checked": e.isChecked,
|
|
228
|
+
"checkbox-radio-switch--disabled": e.disabled,
|
|
229
|
+
"checkbox-radio-switch--indeterminate": e.indeterminate,
|
|
230
|
+
"checkbox-radio-switch--button-variant": e.buttonVariant,
|
|
231
|
+
"checkbox-radio-switch--button-variant-v-grouped": e.buttonVariant && e.buttonVariantGrouped === "vertical",
|
|
232
|
+
"checkbox-radio-switch--button-variant-h-grouped": e.buttonVariant && e.buttonVariantGrouped === "horizontal"
|
|
233
|
+
}, style: e.cssVars }, [i("input", e._g(e._b({ staticClass: "checkbox-radio-switch__input", attrs: { id: e.id, disabled: e.disabled, type: e.inputType }, domProps: { value: e.value } }, "input", e.inputProps, !1), e.inputListeners)), i("label", { staticClass: "checkbox-radio-switch__label", attrs: { for: e.id } }, [i("div", { staticClass: "checkbox-radio-switch__icon" }, [e._t("icon", function() {
|
|
234
|
+
return [e.loading ? i("NcLoadingIcon") : e.buttonVariant ? e._e() : i(e.checkboxRadioIconElement, { tag: "component", attrs: { size: e.size } })];
|
|
235
|
+
}, { checked: e.isChecked, loading: e.loading })], 2), i("span", { staticClass: "checkbox-radio-switch__label-text" }, [e._t("default")], 2)])]);
|
|
236
|
+
}, g = [], x = /* @__PURE__ */ b(
|
|
237
|
+
y,
|
|
238
|
+
_,
|
|
239
|
+
g,
|
|
240
|
+
!1,
|
|
241
|
+
null,
|
|
242
|
+
"a6f82e18",
|
|
243
|
+
null,
|
|
244
|
+
null
|
|
245
|
+
);
|
|
246
|
+
const N = x.exports;
|
|
61
247
|
export {
|
|
62
|
-
|
|
248
|
+
N as default
|
|
63
249
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcCheckboxRadioSwitch.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcCheckboxRadioSwitch.mjs","sources":["../../src/components/NcCheckboxRadioSwitch/NcCheckboxRadioSwitch.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\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>\n\n### General description\n\nThis is a simple input checkbox, radio and switch design.\nPlease have a look at proper usage and recommendations: https://material.io/components/checkboxes\n\n### Standard checkbox\n```vue\n<template>\n\t<div>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"sharingEnabled\">Enable sharing</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"sharingEnabled\" :disabled=\"true\">Enable sharing (disabled)</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch :checked=\"sharingEnabled\" :loading=\"loading\" @update:checked=\"onToggle\">Enable sharing (with request loading)</NcCheckboxRadioSwitch>\n\t\t<br>\n\t\tsharingEnabled: {{ sharingEnabled }}\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tloading: false,\n\t\t\tsharingEnabled: false,\n\t\t}\n\t},\n\tmethods: {\n\t\tonToggle() {\n\t\t\tthis.loading = true\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.sharingEnabled = !this.sharingEnabled\n\t\t\t\tthis.loading = false\n\t\t\t}, 1000)\n\t\t}\n\t}\n}\n</script>\n```\n\n### Standard radio set\n```vue\n<template>\n\t<div>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"sharingPermission\" value=\"r\" name=\"sharing_permission_radio\" type=\"radio\">Default permission read</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"sharingPermission\" value=\"rw\" name=\"sharing_permission_radio\" type=\"radio\">Default permission read+write</NcCheckboxRadioSwitch>\n\t\t<br>\n\t\tsharingPermission: {{ sharingPermission }}\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tsharingPermission: 'r',\n\t\t\t}\n\t\t}\n\t}\n</script>\n```\n\n### Standard radio set with alternative button style\n```vue\n<template>\n\t<div>\n\t\t<h4>Horizontal</h4>\n\t\t<div style=\"display: flex\">\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:button-variant=\"true\"\n\t\t\t\t:checked.sync=\"sharingPermission\"\n\t\t\t\tvalue=\"r\"\n\t\t\t\tname=\"sharing_permission_radio\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tbutton-variant-grouped=\"horizontal\">\n\t\t\t\tDefault permission read\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:button-variant=\"true\"\n\t\t\t\t:checked.sync=\"sharingPermission\"\n\t\t\t\tvalue=\"rw\"\n\t\t\t\tname=\"sharing_permission_radio\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tbutton-variant-grouped=\"horizontal\">\n\t\t\t\tDefault permission read+write\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t</div>\n\t\t<h4>Vertically</h4>\n\t\t<div style=\"width: fit-content\">\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:button-variant=\"true\"\n\t\t\t\t:checked.sync=\"sharingPermission\"\n\t\t\t\tvalue=\"r\"\n\t\t\t\tname=\"sharing_permission_radio\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tbutton-variant-grouped=\"vertical\">\n\t\t\t\tDefault permission read\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:button-variant=\"true\"\n\t\t\t\t:checked.sync=\"sharingPermission\"\n\t\t\t\tvalue=\"rw\"\n\t\t\t\tname=\"sharing_permission_radio\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tbutton-variant-grouped=\"vertical\">\n\t\t\t\tDefault permission read+write\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t</div>\n\t\tsharingPermission: {{ sharingPermission }}\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsharingPermission: 'r',\n\t\t}\n\t}\n}\n</script>\n```\n\n### Radio set with button style and icons\n```vue\n<template>\n\t<div>\n\t\t<h4>Horizontal</h4>\n\t\t<div style=\"display: flex\">\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:button-variant=\"true\"\n\t\t\t\t:checked.sync=\"enableSettings\"\n\t\t\t\tvalue=\"y\"\n\t\t\t\tname=\"sharing_permission_radio\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tbutton-variant-grouped=\"horizontal\">\n\t\t\t\tEnable settings\n\t\t\t\t<template #icon><CheckIcon :size=\"20\"></template>\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:button-variant=\"true\"\n\t\t\t\t:checked.sync=\"enableSettings\"\n\t\t\t\tvalue=\"n\"\n\t\t\t\tname=\"sharing_permission_radio\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tbutton-variant-grouped=\"horizontal\">\n\t\t\t\tDisable settings\n\t\t\t\t<template #icon><CancelIcon :size=\"20\"></template>\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t</div>\n\t\t<h4>Vertically</h4>\n\t\t<div style=\"width: fit-content\">\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:button-variant=\"true\"\n\t\t\t\t:checked.sync=\"enableSettings\"\n\t\t\t\tvalue=\"y\"\n\t\t\t\tname=\"sharing_permission_radio\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tbutton-variant-grouped=\"vertical\">\n\t\t\t\tEnable settings\n\t\t\t\t<template #icon><CheckIcon :size=\"20\"></template>\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t:button-variant=\"true\"\n\t\t\t\t:checked.sync=\"enableSettings\"\n\t\t\t\tvalue=\"n\"\n\t\t\t\tname=\"sharing_permission_radio\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tbutton-variant-grouped=\"vertical\">\n\t\t\t\tDisable settings\n\t\t\t\t<template #icon><CancelIcon :size=\"20\"></template>\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t</div>\n\t\tSettings enabled: {{ enableSettings === 'y' ? 'yes' : 'no' }}\n\t</div>\n</template>\n<script>\nimport CheckIcon from 'vue-material-design-icons/Check.vue'\nimport CancelIcon from 'vue-material-design-icons/Cancel.vue'\nexport default {\n\tcomponents: {\n\t\tCheckIcon,\n\t\tCancelIcon,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tenableSettings: 'n',\n\t\t}\n\t}\n}\n</script>\n```\n\n### Standard checkbox set\n```vue\n<template>\n\t<div>\n\t\t<NcCheckboxRadioSwitch :disabled=\"true\" :checked.sync=\"sharingPermission\" value=\"r\" name=\"sharing_permission\">Permission read</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"sharingPermission\" value=\"w\" name=\"sharing_permission\">Permission write</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"sharingPermission\" value=\"d\" name=\"sharing_permission\">Permission delete</NcCheckboxRadioSwitch>\n\t\t<br>\n\t\tsharingPermission: {{ sharingPermission }}\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsharingPermission: ['r', 'd'],\n\t\t}\n\t}\n}\n</script>\n```\n\n### Standard switch\n```vue\n<template>\n\t<div>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"sharingEnabled\" type=\"switch\">Enable sharing</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"sharingEnabled\" type=\"switch\" :disabled=\"true\">Enable sharing (disabled)</NcCheckboxRadioSwitch>\n\t\t<br>\n\t\tsharingEnabled: {{ sharingEnabled }}\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsharingEnabled: true,\n\t\t}\n\t},\n}\n</script>\n```\n\n</docs>\n\n<template>\n\t<component :is=\"wrapperElement\"\n\t\t:class=\"{\n\t\t\t['checkbox-radio-switch-' + type]: type,\n\t\t\t'checkbox-radio-switch--checked': isChecked,\n\t\t\t'checkbox-radio-switch--disabled': disabled,\n\t\t\t'checkbox-radio-switch--indeterminate': indeterminate,\n\t\t\t'checkbox-radio-switch--button-variant': buttonVariant,\n\t\t\t'checkbox-radio-switch--button-variant-v-grouped': buttonVariant && buttonVariantGrouped === 'vertical',\n\t\t\t'checkbox-radio-switch--button-variant-h-grouped': buttonVariant && buttonVariantGrouped === 'horizontal',\n\t\t}\"\n\t\t:style=\"cssVars\"\n\t\tclass=\"checkbox-radio-switch\">\n\t\t<input :id=\"id\"\n\t\t\tclass=\"checkbox-radio-switch__input\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:type=\"inputType\"\n\t\t\t:value=\"value\"\n\t\t\tv-bind=\"inputProps\"\n\t\t\tv-on=\"inputListeners\">\n\t\t<label :for=\"id\" class=\"checkbox-radio-switch__label\">\n\t\t\t<div class=\"checkbox-radio-switch__icon\">\n\t\t\t\t<!-- @slot The checkbox/radio icon, you can use it for adding an icon to the button variant\n\t\t\t\t\t\t@binding {bool} checked The input checked state\n\t\t\t\t\t\t@binding {bool} loading The loading state\n\t\t\t\t-->\n\t\t\t\t<slot name=\"icon\"\n\t\t\t\t\t:checked=\"isChecked\"\n\t\t\t\t\t:loading=\"loading\">\n\t\t\t\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t\t\t\t<component :is=\"checkboxRadioIconElement\"\n\t\t\t\t\t\tv-else-if=\"!buttonVariant\"\n\t\t\t\t\t\t:size=\"size\" />\n\t\t\t\t</slot>\n\t\t\t</div>\n\n\t\t\t<!-- @slot The checkbox/radio label -->\n\t\t\t<span class=\"checkbox-radio-switch__label-text\"><slot /></span>\n\t\t</label>\n\t</component>\n</template>\n\n<script>\nimport NcLoadingIcon from '../NcLoadingIcon/index.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\nimport l10n from '../../mixins/l10n.js'\n\nimport CheckboxBlankOutline from 'vue-material-design-icons/CheckboxBlankOutline.vue'\nimport MinusBox from 'vue-material-design-icons/MinusBox.vue'\nimport CheckboxMarked from 'vue-material-design-icons/CheckboxMarked.vue'\nimport RadioboxMarked from 'vue-material-design-icons/RadioboxMarked.vue'\nimport RadioboxBlank from 'vue-material-design-icons/RadioboxBlank.vue'\nimport ToggleSwitchOff from 'vue-material-design-icons/ToggleSwitchOff.vue'\nimport ToggleSwitch from 'vue-material-design-icons/ToggleSwitch.vue'\n\nexport const TYPE_CHECKBOX = 'checkbox'\nexport const TYPE_RADIO = 'radio'\nexport const TYPE_SWITCH = 'switch'\nexport const TYPE_BUTTON = 'button'\n\nexport default {\n\tname: 'NcCheckboxRadioSwitch',\n\n\tcomponents: {\n\t\tNcLoadingIcon,\n\t},\n\n\tmixins: [l10n],\n\n\tprops: {\n\n\t\t/**\n\t\t * Unique id attribute of the input\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'checkbox-radio-switch-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * Input name. Required for radio, optional for checkbox, and ignored\n\t\t * for button.\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Type of the input. checkbox, radio, switch, or button.\n\t\t *\n\t\t * Only use button when used in a `tablist` container and the\n\t\t * `tab` role is set.\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'checkbox',\n\t\t\tvalidator: type => [\n\t\t\t\tTYPE_CHECKBOX,\n\t\t\t\tTYPE_RADIO,\n\t\t\t\tTYPE_SWITCH,\n\t\t\t\tTYPE_BUTTON,\n\t\t\t].includes(type),\n\t\t},\n\n\t\t/**\n\t\t * Toggle the alternative button style\n\t\t */\n\t\tbuttonVariant: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Are the elements are all direct siblings?\n\t\t * If so they will be grouped horizontally or vertically\n\t\t * Possible values are `no`, `horizontal`, `vertical`.\n\t\t */\n\t\tbuttonVariantGrouped: {\n\t\t\ttype: String,\n\t\t\tdefault: 'no',\n\t\t\tvalidator: v => ['no', 'vertical', 'horizontal'].includes(v),\n\t\t},\n\n\t\t/**\n\t\t * Checked state. To be used with `:value.sync`\n\t\t */\n\t\tchecked: {\n\t\t\ttype: [Boolean, Array, String],\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Value to be synced on check\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Disabled state\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 * Indeterminate state\n\t\t */\n\t\tindeterminate: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Required state\n\t\t */\n\t\trequired: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Loading state\n\t\t */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Wrapping element tag\n\t\t */\n\t\twrapperElement: {\n\t\t\ttype: String,\n\t\t\tdefault: 'span',\n\t\t},\n\t},\n\n\temits: ['update:checked'],\n\n\tcomputed: {\n\t\tinputProps() {\n\t\t\tif (this.type === TYPE_BUTTON) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tchecked: this.isChecked,\n\t\t\t\tindeterminate: this.indeterminate,\n\t\t\t\trequired: this.required,\n\t\t\t\tname: this.name,\n\t\t\t}\n\t\t},\n\n\t\tinputListeners() {\n\t\t\tif (this.type === TYPE_BUTTON) {\n\t\t\t\treturn {\n\t\t\t\t\tclick: this.onToggle,\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tchange: this.onToggle,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Icon size\n\t\t *\n\t\t @return {number}\n\t\t */\n\t\tsize() {\n\t\t\treturn this.type === TYPE_SWITCH\n\t\t\t\t? 36\n\t\t\t\t: 24\n\t\t},\n\n\t\t/**\n\t\t * Css local variables for this component\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tcssVars() {\n\t\t\treturn {\n\t\t\t\t'--icon-size': this.size + 'px',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Return the input type.\n\t\t * Switch is not an official type\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tinputType() {\n\t\t\tconst nativeTypes = [\n\t\t\t\tTYPE_CHECKBOX,\n\t\t\t\tTYPE_RADIO,\n\t\t\t\tTYPE_BUTTON,\n\t\t\t]\n\t\t\tif (nativeTypes.includes(this.type)) {\n\t\t\t\treturn this.type\n\t\t\t}\n\t\t\treturn TYPE_CHECKBOX\n\t\t},\n\n\t\t/**\n\t\t * Check if that entry is checked\n\t\t * If value is defined, we use that as the checked value\n\t\t * If not, we expect true/false in this.checked\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisChecked() {\n\t\t\tif (this.value !== null) {\n\t\t\t\tif (Array.isArray(this.checked)) {\n\t\t\t\t\treturn [...this.checked].indexOf(this.value) > -1\n\t\t\t\t}\n\t\t\t\treturn this.checked === this.value\n\t\t\t}\n\t\t\treturn this.checked === true\n\t\t},\n\n\t\t/**\n\t\t * Returns the proper Material icon depending on the select case\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tcheckboxRadioIconElement() {\n\t\t\tif (this.type === TYPE_RADIO) {\n\t\t\t\tif (this.isChecked) {\n\t\t\t\t\treturn RadioboxMarked\n\t\t\t\t}\n\t\t\t\treturn RadioboxBlank\n\t\t\t}\n\n\t\t\t// Switch\n\t\t\tif (this.type === TYPE_SWITCH) {\n\t\t\t\tif (this.isChecked) {\n\t\t\t\t\treturn ToggleSwitch\n\t\t\t\t}\n\t\t\t\treturn ToggleSwitchOff\n\t\t\t}\n\n\t\t\t// Checkbox\n\t\t\tif (this.indeterminate) {\n\t\t\t\treturn MinusBox\n\t\t\t}\n\t\t\tif (this.isChecked) {\n\t\t\t\treturn CheckboxMarked\n\t\t\t}\n\t\t\treturn CheckboxBlankOutline\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.name && this.type === TYPE_CHECKBOX) {\n\t\t\tif (!Array.isArray(this.checked)) {\n\t\t\t\tthrow new Error('When using groups of checkboxes, the updated value will be an array.')\n\t\t\t}\n\t\t}\n\n\t\t// https://material.io/components/checkboxes#usage\n\t\tif (this.name && this.type === TYPE_SWITCH) {\n\t\t\tthrow new Error('Switches are not made to be used for data sets. Please use checkboxes instead.')\n\t\t}\n\n\t\t// https://material.io/components/checkboxes#usage\n\t\tif (typeof this.checked !== 'boolean' && this.type === TYPE_SWITCH) {\n\t\t\tthrow new Error('Switches can only be used with boolean as checked prop.')\n\t\t}\n\t},\n\n\tmethods: {\n\t\tonToggle() {\n\t\t\tif (this.disabled) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If this is a radio, there can only be one value\n\t\t\tif (this.type === TYPE_RADIO) {\n\t\t\t\tthis.$emit('update:checked', this.value)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If this is a radio, there can only be one value\n\t\t\tif (this.type === TYPE_SWITCH) {\n\t\t\t\tthis.$emit('update:checked', !this.isChecked)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If the initial value was a boolean, let's keep it that way\n\t\t\tif (typeof this.checked === 'boolean') {\n\t\t\t\tthis.$emit('update:checked', !this.isChecked)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Dispatch the checked values as an array if multiple, or single value otherwise\n\t\t\tconst values = this.getInputsSet()\n\t\t\t\t.filter(input => input.checked)\n\t\t\t\t.map(input => input.value)\n\t\t\tthis.$emit('update:checked', values)\n\t\t},\n\n\t\t/**\n\t\t * Get the input set based on this name\n\t\t *\n\t\t * @return {Node[]}\n\t\t */\n\t\tgetInputsSet() {\n\t\t\treturn [...document.getElementsByName(this.name)]\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.checkbox-radio-switch {\n\tdisplay: flex;\n\talign-items: center;\n\n\t&__input {\n\t\tposition: absolute;\n\t\tz-index: -1;\n\t\topacity: 0 !important; // We need !important, or it gets overwritten by server style\n\t\twidth: var(--icon-size);\n\t\theight: var(--icon-size);\n\t\t// Same as label padding\n\t\tmargin: 4px $icon-margin;\n\t}\n\n\t&__input:focus-visible + label {\n\t\toutline: 2px solid var(--color-primary-element) !important;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-direction: row;\n\t\tgap: 4px;\n\t\tuser-select: none;\n\t\tmin-height: $clickable-area;\n\t\tborder-radius: $clickable-area;\n\t\tpadding: 4px $icon-margin;\n\t\t// Set to 100% to make text overflow work on button style\n\t\twidth: 100%;\n\t\t// but restrict to content so plain checkboxes / radio switches do not expand\n\t\tmax-width: fit-content;\n\n\t\t&, * {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t&-text:empty {\n\t\t\t// hide text if empty to ensure checkbox outline is a circle instead of oval\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&__icon > * {\n\t\tcolor: var(--color-primary-element);\n\t\twidth: var(--icon-size);\n\t\theight: var(--icon-size);\n\t}\n\n\t&--disabled &__label {\n\t\topacity: $opacity_disabled;\n\t\t.checkbox-radio-switch__icon > * {\n\t\t\tcolor: var(--color-main-text)\n\t\t}\n\t}\n\n\t&:not(&--disabled, &--checked):focus-within &__label,\n\t&:not(&--disabled, &--checked) &__label:hover {\n\t\tbackground-color: var(--color-background-hover);\n\t}\n\n\t&--checked:not(&--disabled):focus-within &__label,\n\t&--checked:not(&--disabled) &__label:hover {\n\t\tbackground-color: var(--color-primary-element-light-hover);\n\t}\n\n\t// Switch specific rules\n\t&-switch:not(&--checked) &__icon > * {\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t// If switch is checked AND disabled, use the fade primary colour\n\t&-switch.checkbox-radio-switch--disabled.checkbox-radio-switch--checked &__icon > * {\n\t\tcolor: var(--color-primary-element-light);\n\t}\n\n\t$border-radius: calc(var(--default-clickable-area) / 2);\n\t// keep inner border width in mind\n\t$border-radius-outer: calc($border-radius + 2px);\n\n\t&--button-variant.checkbox-radio-switch {\n\t\tborder: 2px solid var(--color-border-maxcontrast);\n\t\toverflow: hidden;\n\n\t\t&--checked {\n\t\t\tfont-weight: bold;\n\n\t\t\tlabel {\n\t\t\t\tbackground-color: var(--color-primary-element-light);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Text overflow of button style\n\t&--button-variant &__label-text {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\twidth: 100%;\n\t}\n\n\t// Set icon color for non active elements to main text color\n\t&--button-variant:not(&--checked) &__icon > * {\n\t\tcolor: var(--color-main-text);\n\t}\n\n\t// Hide icon container if empty to remove virtual padding\n\t&--button-variant &__icon:empty {\n\t\tdisplay: none;\n\t}\n\n\t&--button-variant:not(&--button-variant-v-grouped):not(&--button-variant-h-grouped),\n\t&--button-variant &__label {\n\t\tborder-radius: $border-radius;\n\t}\n\n\t/* Special rules for vertical button groups */\n\t&--button-variant-v-grouped &__label {\n\t\tflex-basis: 100%;\n\t\t// vertically grouped buttons should all have the same width\n\t\tmax-width: unset;\n\t}\n\t&--button-variant-v-grouped {\n\t\t&:first-of-type {\n\t\t\tborder-top-left-radius: $border-radius-outer;\n\t\t\tborder-top-right-radius: $border-radius-outer;\n\t\t}\n\t\t&:last-of-type {\n\t\t\tborder-bottom-left-radius: $border-radius-outer;\n\t\t\tborder-bottom-right-radius: $border-radius-outer;\n\t\t}\n\n\t\t// remove borders between elements\n\t\t&:not(:last-of-type) {\n\t\t\tborder-bottom: 0!important;\n\t\t\t.checkbox-radio-switch__label {\n\t\t\t\tmargin-bottom: 2px;\n\t\t\t}\n\t\t}\n\t\t&:not(:first-of-type) {\n\t\t\tborder-top: 0!important;\n\t\t}\n\t}\n\n\t/* Special rules for horizontal button groups */\n\t&--button-variant-h-grouped {\n\t\t&:first-of-type {\n\t\t\tborder-top-left-radius: $border-radius-outer;\n\t\t\tborder-bottom-left-radius: $border-radius-outer;\n\t\t}\n\t\t&:last-of-type {\n\t\t\tborder-top-right-radius: $border-radius-outer;\n\t\t\tborder-bottom-right-radius: $border-radius-outer;\n\t\t}\n\n\t\t// remove borders between elements\n\t\t&:not(:last-of-type) {\n\t\t\tborder-right: 0!important;\n\t\t\t.checkbox-radio-switch__label {\n\t\t\t\tmargin-right: 2px;\n\t\t\t}\n\t\t}\n\t\t&:not(:first-of-type) {\n\t\t\tborder-left: 0!important;\n\t\t}\n\t}\n\t&--button-variant-h-grouped &__label-text {\n\t\ttext-align: center;\n\t}\n\t&--button-variant-h-grouped &__label {\n\t\tflex-direction: column;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\tmargin: 0;\n\t\tgap: 0;\n\t}\n}\n</style>\n"],"names":["TYPE_CHECKBOX","TYPE_RADIO","TYPE_SWITCH","TYPE_BUTTON","_sfc_main","NcLoadingIcon","l10n","GenRandomId","id","type","v","RadioboxMarked","RadioboxBlank","ToggleSwitch","ToggleSwitchOff","MinusBox","CheckboxMarked","CheckboxBlankOutline","values","input"],"mappings":";;;;;;;;;;;;AA0TA,MAAAA,IAAA,YACAC,IAAA,SACAC,IAAA,UACAC,IAAA,UAEAC,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,eAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,2BAAAC,EAAA;AAAA,MACA,WAAA,CAAAC,MAAAA,EAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA;AAAA,QACAT;AAAA,QACAC;AAAA,QACAC;AAAA,QACAC;AAAA,MACA,EAAA,SAAAM,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,sBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,MAAA,YAAA,YAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA,CAAA,SAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;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,IAKA,eAAA;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,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA,CAAA,gBAAA;AAAA,EAEA,UAAA;AAAA,IACA,aAAA;AACA,aAAA,KAAA,SAAAP,IACA,OAEA;AAAA,QACA,SAAA,KAAA;AAAA,QACA,eAAA,KAAA;AAAA,QACA,UAAA,KAAA;AAAA,QACA,MAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,aAAA,KAAA,SAAAA,IACA;AAAA,QACA,OAAA,KAAA;AAAA,MACA,IAEA;AAAA,QACA,QAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,OAAA;AACA,aAAA,KAAA,SAAAD,IACA,KACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAA;AACA,aAAA;AAAA,QACA,eAAA,KAAA,OAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,YAAA;AAMA,aALA;AAAA,QACAF;AAAA,QACAC;AAAA,QACAE;AAAA,MACA,EACA,SAAA,KAAA,IAAA,IACA,KAAA,OAEAH;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAA;AACA,aAAA,KAAA,UAAA,OACA,MAAA,QAAA,KAAA,OAAA,IACA,CAAA,GAAA,KAAA,OAAA,EAAA,QAAA,KAAA,KAAA,IAAA,KAEA,KAAA,YAAA,KAAA,QAEA,KAAA,YAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,2BAAA;AACA,aAAA,KAAA,SAAAC,IACA,KAAA,YACAU,IAEAC,IAIA,KAAA,SAAAV,IACA,KAAA,YACAW,IAEAC,IAIA,KAAA,gBACAC,IAEA,KAAA,YACAC,IAEAC;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AACA,QAAA,KAAA,QAAA,KAAA,SAAAjB,KACA,CAAA,MAAA,QAAA,KAAA,OAAA;AACA,YAAA,IAAA,MAAA,sEAAA;AAKA,QAAA,KAAA,QAAA,KAAA,SAAAE;AACA,YAAA,IAAA,MAAA,gFAAA;AAIA,QAAA,OAAA,KAAA,WAAA,aAAA,KAAA,SAAAA;AACA,YAAA,IAAA,MAAA,yDAAA;AAAA,EAEA;AAAA,EAEA,SAAA;AAAA,IACA,WAAA;AACA,UAAA,KAAA;AACA;AAIA,UAAA,KAAA,SAAAD,GAAA;AACA,aAAA,MAAA,kBAAA,KAAA,KAAA;AACA;AAAA,MACA;AAGA,UAAA,KAAA,SAAAC,GAAA;AACA,aAAA,MAAA,kBAAA,CAAA,KAAA,SAAA;AACA;AAAA,MACA;AAGA,UAAA,OAAA,KAAA,WAAA,WAAA;AACA,aAAA,MAAA,kBAAA,CAAA,KAAA,SAAA;AACA;AAAA,MACA;AAGA,YAAAgB,IAAA,KAAA,aAAA,EACA,OAAA,CAAAC,MAAAA,EAAA,OAAA,EACA,IAAA,CAAAA,MAAAA,EAAA,KAAA;AACA,WAAA,MAAA,kBAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,eAAA;AACA,aAAA,CAAA,GAAA,SAAA,kBAAA,KAAA,IAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1,118 @@
|
|
|
1
|
-
var
|
|
1
|
+
var q = require("../assets/index-4ef32afd.css");
|
|
2
|
+
const i = require("./NcButton.cjs"), l = require("./NcPopover.cjs"), n = require("../chunks/l10n-903083c4.cjs"), u = require("../chunks/GenColors-eedcc70a.cjs"), d = require("vue-material-design-icons/ArrowLeft.vue"), p = require("vue-material-design-icons/Check.vue"), _ = require("vue-material-design-icons/DotsHorizontal.vue"), f = require("vue-color"), v = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), s = (t) => t && t.__esModule ? t : { default: t }, C = /* @__PURE__ */ s(d), h = /* @__PURE__ */ s(p), m = /* @__PURE__ */ s(_);
|
|
3
|
+
const a = function(t) {
|
|
4
|
+
const e = t.toString(16);
|
|
5
|
+
return e.length === 1 ? "0" + e : e;
|
|
6
|
+
}, k = {
|
|
7
|
+
name: "NcColorPicker",
|
|
8
|
+
components: {
|
|
9
|
+
ArrowLeft: C.default,
|
|
10
|
+
Check: h.default,
|
|
11
|
+
Chrome: f.Chrome,
|
|
12
|
+
DotsHorizontal: m.default,
|
|
13
|
+
NcButton: i,
|
|
14
|
+
NcPopover: l
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
/**
|
|
18
|
+
* A HEX color that represents the initial value of the picker
|
|
19
|
+
*/
|
|
20
|
+
value: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: !0
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Set to `true` to enable advanced fields including HEX, RGB, and HSL
|
|
26
|
+
*/
|
|
27
|
+
advancedFields: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Provide a custom array of hexadecimal colors to show
|
|
33
|
+
*/
|
|
34
|
+
palette: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default: () => u.GenColors(4).map((t) => "#" + a(t.r) + a(t.g) + a(t.b)),
|
|
37
|
+
validator(t) {
|
|
38
|
+
return t.every((e) => /^#([a-f0-9]{3}|[a-f0-9]{6})$/i.test(e));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
emits: [
|
|
43
|
+
"submit",
|
|
44
|
+
"close",
|
|
45
|
+
"update:open",
|
|
46
|
+
"update:value",
|
|
47
|
+
"input"
|
|
48
|
+
],
|
|
49
|
+
data() {
|
|
50
|
+
return {
|
|
51
|
+
currentColor: this.value,
|
|
52
|
+
advanced: !1,
|
|
53
|
+
ariaBack: n.t("Back"),
|
|
54
|
+
ariaMore: n.t("More options")
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
watch: {
|
|
58
|
+
value(t) {
|
|
59
|
+
this.currentColor = t;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
methods: {
|
|
63
|
+
t: n.t,
|
|
64
|
+
/**
|
|
65
|
+
* Submit a picked colour and close picker
|
|
66
|
+
*/
|
|
67
|
+
handleConfirm() {
|
|
68
|
+
this.$emit("submit", this.currentColor), this.handleClose(), this.advanced = !1;
|
|
69
|
+
},
|
|
70
|
+
handleClose() {
|
|
71
|
+
this.$emit("close"), this.$emit("update:open", !1);
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Inner navigations
|
|
75
|
+
*/
|
|
76
|
+
handleBack() {
|
|
77
|
+
this.advanced = !1;
|
|
78
|
+
},
|
|
79
|
+
handleMoreSettings() {
|
|
80
|
+
this.advanced = !0;
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* Pick a colour
|
|
84
|
+
*
|
|
85
|
+
* @param {string} color the picked color
|
|
86
|
+
*/
|
|
87
|
+
pickColor(t) {
|
|
88
|
+
typeof t != "string" && (t = this.currentColor.hex), this.currentColor = t, this.$emit("update:value", t), this.$emit("input", t);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
var y = function() {
|
|
93
|
+
var e = this, r = e._self._c;
|
|
94
|
+
return r("NcPopover", e._g(e._b({ on: { "apply-hide": e.handleClose }, scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
95
|
+
return [e._t("default")];
|
|
96
|
+
}, proxy: !0 }], null, !0) }, "NcPopover", e.$attrs, !1), e.$listeners), [r("div", { staticClass: "color-picker", class: { "color-picker--advanced-fields": e.advanced && e.advancedFields } }, [r("transition", { attrs: { name: "slide", mode: "out-in" } }, [e.advanced ? e._e() : r("div", { staticClass: "color-picker__simple" }, e._l(e.palette, function(o, c) {
|
|
97
|
+
return r("button", { key: c, staticClass: "color-picker__simple-color-circle", class: { "color-picker__simple-color-circle--active": o === e.currentColor }, style: { "background-color": o }, attrs: { type: "button" }, on: { click: function(B) {
|
|
98
|
+
return e.pickColor(o);
|
|
99
|
+
} } }, [o === e.currentColor ? r("Check", { attrs: { size: 20 } }) : e._e()], 1);
|
|
100
|
+
}), 0), e.advanced ? r("Chrome", { staticClass: "color-picker__advanced", attrs: { "disable-alpha": !0, "disable-fields": !e.advancedFields }, on: { input: e.pickColor }, model: { value: e.currentColor, callback: function(o) {
|
|
101
|
+
e.currentColor = o;
|
|
102
|
+
}, expression: "currentColor" } }) : e._e()], 1), r("div", { staticClass: "color-picker__navigation" }, [e.advanced ? r("NcButton", { attrs: { type: "tertiary", "aria-label": e.ariaBack }, on: { click: e.handleBack }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
103
|
+
return [r("ArrowLeft", { attrs: { size: 20 } })];
|
|
104
|
+
}, proxy: !0 }], null, !1, 1821202730) }) : e._e(), e.advanced ? e._e() : r("NcButton", { attrs: { type: "tertiary", "aria-label": e.ariaMore }, on: { click: e.handleMoreSettings }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
105
|
+
return [r("DotsHorizontal", { attrs: { size: 20 } })];
|
|
106
|
+
}, proxy: !0 }], null, !1, 1056868794) }), e.advanced ? r("NcButton", { attrs: { type: "primary" }, on: { click: e.handleConfirm } }, [e._v(" " + e._s(e.t("Choose")) + " ")]) : e._e()], 1)], 1)]);
|
|
107
|
+
}, g = [], b = /* @__PURE__ */ v.normalizeComponent(
|
|
108
|
+
k,
|
|
109
|
+
y,
|
|
110
|
+
g,
|
|
111
|
+
!1,
|
|
112
|
+
null,
|
|
113
|
+
"c959ec5a",
|
|
114
|
+
null,
|
|
115
|
+
null
|
|
116
|
+
);
|
|
117
|
+
const N = b.exports;
|
|
118
|
+
module.exports = N;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcColorPicker.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"NcColorPicker.cjs","sources":["../../src/components/NcColorPicker/NcColorPicker.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 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 -->\n\n<docs>\n\n### General description\n\nThis component allows the user to choose a color. It consists of 2\nactual pickers:\n\n- One simple picker with a predefined palette of colors;\n- One more advanced picker that provides the full color spectrum;\n\n### Usage\n\n* Using v-model and passing in an HTML element that will be treated as a trigger:\n\n```vue\n<template>\n\t<div class=\"container0\">\n\t\t<NcColorPicker v-model=\"color\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcColorPicker>\n\t\t<NcColorPicker v-model=\"color\" :palette=\"customPalette\">\n\t\t\t<NcButton> Click Me for a custom palette </NcButton>\n\t\t</NcColorPicker>\n\t\t<div :style=\"{'background-color': color}\" class=\"color0\" />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9',\n\t\t\tcustomPalette: [\n\t\t\t\t'#E40303',\n\t\t\t\t'#FF8C00',\n\t\t\t\t'#FFED00',\n\t\t\t\t'#008026',\n\t\t\t\t'#24408E',\n\t\t\t\t'#732982',\n\t\t\t\t'#5BCEFA',\n\t\t\t\t'#F5A9B8',\n\t\t\t\t'#FFFFFF',\n\t\t\t\t'#F5A9B8',\n\t\t\t\t'#5BCEFA',\n\t\t\t],\n\t\t}\n\t}\n}\n</script>\n<style>\n.container0 {\n\tdisplay: flex;\n\tgap: 20px;\n}\n\n.color0 {\n\twidth: 100px;\n\theight: 40px;\n\tborder-radius: 6px;\n}\n</style>\n```\n\n* Using v-bind for both color and open state and emitting an event that updates the color\n\n```vue\n<template>\n\t<div class=\"container1\">\n\t\t<NcButton @click=\"open = !open\"> Click Me </NcButton>\n\t\t<NcColorPicker :value=\"color\" @input=\"updateColor\" :shown.sync=\"open\">\n\t\t\t<div :style=\"{'background-color': color}\" class=\"color1\" />\n\t\t</NcColorPicker>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9',\n\t\t\topen: false\n\t\t}\n\t},\n\tmethods: {\n\t\tupdateColor(e) {\n\t\t\tthis.color = e\n\t\t}\n\t}\n}\n</script>\n<style>\n.container1 {\n\tdisplay: flex;\n}\n\n.color1 {\n\twidth: 100px;\n\theight: 40px;\n\tmargin-left: 20px;\n\tborder-radius: 6px;\n}\n</style>\n```\n\n* Using advanced fields including HEX, RGB, and HSL:\n\n```vue\n<template>\n\t<div class=\"container0\">\n\t\t<NcColorPicker v-model=\"color\"\n\t\t\t:advanced-fields=\"true\">\n\t\t\t<NcButton> Click Me </NcButton>\n\t\t</NcColorPicker>\n\t\t<div :style=\"{'background-color': color}\" class=\"color0\" />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tcolor: '#0082c9'\n\t\t}\n\t}\n}\n</script>\n<style>\n.container0 {\n\tdisplay: flex;\n}\n\n.color0 {\n\twidth: 100px;\n\theight: 40px;\n\tmargin-left: 20px;\n\tborder-radius: 6px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcPopover v-bind=\"$attrs\" v-on=\"$listeners\" @apply-hide=\"handleClose\">\n\t\t<template #trigger>\n\t\t\t<slot />\n\t\t</template>\n\t\t<div class=\"color-picker\"\n\t\t\t:class=\"{ 'color-picker--advanced-fields': advanced && advancedFields }\">\n\t\t\t<transition name=\"slide\" mode=\"out-in\">\n\t\t\t\t<div v-if=\"!advanced\" class=\"color-picker__simple\">\n\t\t\t\t\t<button v-for=\"(color, index) in palette\"\n\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t:style=\"{'background-color': color }\"\n\t\t\t\t\t\tclass=\"color-picker__simple-color-circle\"\n\t\t\t\t\t\t:class=\"{ 'color-picker__simple-color-circle--active' : color === currentColor }\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t@click=\"pickColor(color)\">\n\t\t\t\t\t\t<Check v-if=\"color === currentColor\"\n\t\t\t\t\t\t\t:size=\"20\" />\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<Chrome v-if=\"advanced\"\n\t\t\t\t\tv-model=\"currentColor\"\n\t\t\t\t\tclass=\"color-picker__advanced\"\n\t\t\t\t\t:disable-alpha=\"true\"\n\t\t\t\t\t:disable-fields=\"!advancedFields\"\n\t\t\t\t\t@input=\"pickColor\" />\n\t\t\t</transition>\n\t\t\t<div class=\"color-picker__navigation\">\n\t\t\t\t<NcButton v-if=\"advanced\"\n\t\t\t\t\ttype=\"tertiary\"\n\t\t\t\t\t:aria-label=\"ariaBack\"\n\t\t\t\t\t@click=\"handleBack\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<ArrowLeft :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"!advanced\"\n\t\t\t\t\ttype=\"tertiary\"\n\t\t\t\t\t:aria-label=\"ariaMore\"\n\t\t\t\t\t@click=\"handleMoreSettings\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<DotsHorizontal :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"advanced\"\n\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t@click=\"handleConfirm\">\n\t\t\t\t\t{{ t('Choose') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\t</NcPopover>\n</template>\n\n<script>\nimport NcButton from '../NcButton/index.js'\nimport NcPopover from '../NcPopover/index.js'\nimport { t } from '../../l10n.js'\nimport GenColors from '../../utils/GenColors.js'\n\nimport ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport DotsHorizontal from 'vue-material-design-icons/DotsHorizontal.vue'\n\nimport { Chrome } from 'vue-color'\n\nconst rgbToHex = function(color) {\n\tconst hex = color.toString(16)\n\treturn hex.length === 1 ? '0' + hex : hex\n}\n\nexport default {\n\tname: 'NcColorPicker',\n\n\tcomponents: {\n\t\tArrowLeft,\n\t\tCheck,\n\t\tChrome,\n\t\tDotsHorizontal,\n\t\tNcButton,\n\t\tNcPopover,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * A HEX color that represents the initial value of the picker\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Set to `true` to enable advanced fields including HEX, RGB, and HSL\n\t\t */\n\t\tadvancedFields: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Provide a custom array of hexadecimal colors to show\n\t\t */\n\t\tpalette: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => GenColors(4).map(color => {\n\t\t\t\treturn '#' + rgbToHex(color.r) + rgbToHex(color.g) + rgbToHex(color.b)\n\t\t\t}),\n\t\t\tvalidator(palette) {\n\t\t\t\treturn palette.every(color => /^#([a-f0-9]{3}|[a-f0-9]{6})$/i.test(color))\n\t\t\t},\n\t\t},\n\t},\n\n\temits: [\n\t\t'submit',\n\t\t'close',\n\t\t'update:open',\n\t\t'update:value',\n\t\t'input',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tcurrentColor: this.value,\n\t\t\tadvanced: false,\n\t\t\tariaBack: t('Back'),\n\t\t\tariaMore: t('More options'),\n\t\t}\n\t},\n\n\twatch: {\n\t\tvalue(color) {\n\t\t\tthis.currentColor = color\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Submit a picked colour and close picker\n\t\t */\n\t\thandleConfirm() {\n\t\t\t/**\n\t\t\t * Emits a hexadecimal string e.g. '#ffffff'\n\t\t\t */\n\t\t\tthis.$emit('submit', this.currentColor)\n\t\t\tthis.handleClose()\n\n\t\t\tthis.advanced = false\n\t\t},\n\t\thandleClose() {\n\t\t\t/**\n\t\t\t * Emitted after picker close\n\t\t\t */\n\t\t\tthis.$emit('close')\n\t\t\tthis.$emit('update:open', false)\n\t\t},\n\n\t\t/**\n\t\t * Inner navigations\n\t\t */\n\t\thandleBack() {\n\t\t\tthis.advanced = false\n\t\t},\n\t\thandleMoreSettings() {\n\t\t\tthis.advanced = true\n\t\t},\n\n\t\t/**\n\t\t * Pick a colour\n\t\t *\n\t\t * @param {string} color the picked color\n\t\t */\n\t\tpickColor(color) {\n\t\t\tif (typeof color !== 'string') {\n\t\t\t\tcolor = this.currentColor.hex\n\t\t\t}\n\t\t\tthis.currentColor = color\n\n\t\t\t/**\n\t\t\t * Emits a hexadecimal string e.g. '#ffffff'\n\t\t\t */\n\t\t\tthis.$emit('update:value', color)\n\n\t\t\t/**\n\t\t\t * Emits a hexadecimal string e.g. '#ffffff'\n\t\t\t */\n\t\t\tthis.$emit('input', color)\n\n\t\t},\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.color-picker {\n\tdisplay: flex;\n\toverflow: hidden;\n\talign-content: flex-end;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\tbox-sizing: content-box !important;\n\twidth: 176px;\n\tpadding: 8px;\n\tborder-radius: 3px;\n\n\t&--advanced-fields {\n\t\twidth: 264px;\n\t}\n\n\t&__simple {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, $clickable-area);\n\t\tgrid-auto-rows: $clickable-area;\n\n\t\t&-color-circle {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 34px;\n\t\t\theight: 34px;\n\t\t\tmin-height: 34px;\n\t\t\tmargin: auto;\n\t\t\tpadding: 0;\n\t\t\tcolor: white;\n\t\t\tborder: 1px solid rgba(0, 0, 0, 0.25);\n\t\t\tborder-radius: 50%;\n\t\t\tfont-size: 16px;\n\t\t\t&:hover {\n\t\t\t\topacity: .6;\n\t\t\t}\n\t\t\t&--active {\n\t\t\t\twidth: 38px;\n\t\t\t\theight: 38px;\n\t\t\t\tmin-height: 38px;\n\t\t\t\ttransition: all 100ms ease-in-out;\n\t\t\t\topacity: 1 !important;\n\t\t\t}\n\t\t}\n\t}\n\n\t&__advanced {\n\t\tbox-shadow: none !important;\n\t}\n\n\t&__navigation {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tjustify-content: space-between;\n\t\tmargin-top: 10px;\n\t}\n}\n\n:deep() .vc {\n\t&-chrome {\n\t\twidth: unset;\n\t\tbackground-color: var(--color-main-background);\n\n\t\t&-color-wrap {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\n\t\t&-active-color {\n\t\t\twidth: 34px;\n\t\t\theight: 34px;\n\t\t\tborder-radius: 17px;\n\t\t}\n\n\t\t&-body {\n\t\t\tpadding: 14px 0 0 0;\n\t\t\tbackground-color: var(--color-main-background);\n\t\t\t.vc-input__input {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t}\n\n\t\t&-toggle-btn {\n\t\t\tfilter: var(--background-invert-if-dark);\n\t\t}\n\n\t\t&-saturation {\n\t\t\t&-wrap {\n\t\t\t\tborder-radius: 3px;\n\t\t\t}\n\n\t\t\t&-circle {\n\t\t\t\twidth: 20px;\n\t\t\t\theight: 20px;\n\t\t\t}\n\t\t}\n\t}\n}\n\n.slide {\n\t&-enter {\n\t\ttransform: translateX(-50%);\n\t\topacity: 0;\n\t}\n\t&-enter-to {\n\t\ttransform: translateX(0);\n\t\topacity: 1;\n\t}\n\t&-leave {\n\t\ttransform: translateX(0);\n\t\topacity: 1;\n\t}\n\t&-leave-to {\n\t\ttransform: translateX(-50%);\n\t\topacity: 0;\n\t}\n\t&-enter-active,\n\t&-leave-active {\n\t\ttransition: all 50ms ease-in-out;\n\t}\n}\n\n</style>\n"],"names":["rgbToHex","color","hex","_sfc_main","ArrowLeftIcon__default","Check__default","vueColor","DotsHorizontal__default","Components_NcButton","Components_NcPopover","GenColors","palette","l10n"],"mappings":";;AAkOA,MAAAA,IAAA,SAAAC,GAAA;AACA,QAAAC,IAAAD,EAAA,SAAA,EAAA;AACA,SAAAC,EAAA,WAAA,IAAA,MAAAA,IAAAA;AACA,GAEAC,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,WAAAC,EAAA;AAAA,IACA,OAAAC,EAAA;AAAA,IACA,QAAAC,EAAA;AAAA,IACA,gBAAAC,EAAA;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAAC,EAAA,UAAA,CAAA,EAAA,IAAA,CAAAT,MACA,MAAAD,EAAAC,EAAA,CAAA,IAAAD,EAAAC,EAAA,CAAA,IAAAD,EAAAC,EAAA,CAAA,CACA;AAAA,MACA,UAAAU,GAAA;AACA,eAAAA,EAAA,MAAA,CAAAV,MAAA,gCAAA,KAAAA,CAAA,CAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,cAAA,KAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAAW,EAAA,EAAA,MAAA;AAAA,MACA,UAAAA,EAAA,EAAA,cAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAAX,GAAA;AACA,WAAA,eAAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,GAAAW,EAAA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAIA,WAAA,MAAA,UAAA,KAAA,YAAA,GACA,KAAA,YAAA,GAEA,KAAA,WAAA;AAAA,IACA;AAAA,IACA,cAAA;AAIA,WAAA,MAAA,OAAA,GACA,KAAA,MAAA,eAAA,EAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AACA,WAAA,WAAA;AAAA,IACA;AAAA,IACA,qBAAA;AACA,WAAA,WAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAAX,GAAA;AACA,MAAA,OAAAA,KAAA,aACAA,IAAA,KAAA,aAAA,MAEA,KAAA,eAAAA,GAKA,KAAA,MAAA,gBAAAA,CAAA,GAKA,KAAA,MAAA,SAAAA,CAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|