@nextcloud/vue 8.0.0-beta.7 → 8.0.0-beta.9
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 +36 -0
- package/dist/Components/NcActionButton.cjs +49 -1
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +49 -13
- 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 +231 -1
- package/dist/Components/NcActionInput.cjs.map +1 -1
- package/dist/Components/NcActionInput.mjs +235 -70
- 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 +66 -14
- 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 +21 -9
- 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 +459 -1
- package/dist/Components/NcActions.cjs.map +1 -1
- package/dist/Components/NcActions.mjs +463 -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 +156 -1
- package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +160 -50
- 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 +352 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +360 -59
- 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 +130 -23
- package/dist/Components/NcDashboardWidgetItem.mjs.map +1 -1
- package/dist/Components/NcDateTime.cjs +125 -1
- package/dist/Components/NcDateTime.cjs.map +1 -1
- package/dist/Components/NcDateTime.mjs +126 -41
- package/dist/Components/NcDateTime.mjs.map +1 -1
- package/dist/Components/NcDateTimePicker.cjs +217 -1
- package/dist/Components/NcDateTimePicker.cjs.map +1 -1
- package/dist/Components/NcDateTimePicker.mjs +212 -53
- package/dist/Components/NcDateTimePicker.mjs.map +1 -1
- 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/NcDialog.cjs +171 -0
- package/dist/Components/NcDialog.cjs.map +1 -0
- package/dist/Components/NcDialog.mjs +177 -0
- package/dist/Components/NcDialog.mjs.map +1 -0
- package/dist/Components/NcDialogButton.cjs +69 -0
- package/dist/Components/NcDialogButton.cjs.map +1 -0
- package/dist/Components/NcDialogButton.mjs +74 -0
- package/dist/Components/NcDialogButton.mjs.map +1 -0
- 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 +172 -52
- 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 +59 -1
- package/dist/Components/NcIconSvgWrapper.cjs.map +1 -1
- package/dist/Components/NcIconSvgWrapper.mjs +60 -12
- 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 +158 -1
- package/dist/Components/NcListItemIcon.cjs.map +1 -1
- package/dist/Components/NcListItemIcon.mjs +154 -30
- 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 +403 -1
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +392 -96
- 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 +72 -38
- package/dist/Components/NcNoteCard.mjs.map +1 -1
- package/dist/Components/NcPasswordField.cjs +163 -1
- package/dist/Components/NcPasswordField.cjs.map +1 -1
- package/dist/Components/NcPasswordField.mjs +169 -54
- 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 +184 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +183 -61
- 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 +411 -1
- package/dist/Components/NcSelect.cjs.map +1 -1
- package/dist/Components/NcSelect.mjs +405 -47
- 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 +22 -1
- package/dist/Components/NcSettingsSelectGroup.mjs.map +1 -1
- package/dist/Components/NcTextArea.cjs +167 -0
- package/dist/Components/NcTextArea.cjs.map +1 -0
- package/dist/Components/NcTextArea.mjs +172 -0
- package/dist/Components/NcTextArea.mjs.map +1 -0
- package/dist/Components/NcTextField.cjs +98 -1
- package/dist/Components/NcTextField.cjs.map +1 -1
- package/dist/Components/NcTextField.mjs +102 -22
- 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/NcAppNavigationToggle-2cc5b864.css +35 -0
- package/dist/assets/NcInputConfirmCancel-2ba60a52.css +51 -0
- package/dist/assets/NcMentionBubble-6e887c5f.css +81 -0
- package/dist/assets/{index-23405a74.css → NcSettingsSelectGroup-0d38d76b.css} +15 -2
- package/dist/assets/index-0adc989c.css +96 -0
- package/dist/assets/index-1151d229.css +41 -0
- package/dist/assets/index-1beccc92.css +140 -0
- package/dist/assets/index-236620b0.css +150 -0
- package/dist/assets/{index-823ec431.css → index-24f6c355.css} +67 -3
- package/dist/assets/index-2a8e4ca1.css +540 -0
- package/dist/assets/{index-29421a2e.css → index-2d4de2fc.css} +19 -2
- package/dist/assets/{NcSettingsSelectGroup-e88cbf1a.css → index-30e099f7.css} +17 -2
- package/dist/assets/index-34dfc54e.css +88 -0
- package/dist/assets/index-3764a447.css +99 -0
- package/dist/assets/index-400b48a6.css +60 -0
- package/dist/assets/{index-1d28ce70.css → index-441b6552.css} +25 -2
- package/dist/assets/{NcInputConfirmCancel-c1d05dd9.css → index-4611417f.css} +31 -2
- package/dist/assets/index-4a775ba1.css +204 -0
- package/dist/assets/index-4b75fe20.css +79 -0
- package/dist/assets/index-4ebacc78.css +107 -0
- package/dist/assets/index-4ef32afd.css +128 -0
- package/dist/assets/index-50b0766d.css +202 -0
- package/dist/assets/index-574438d6.css +884 -0
- package/dist/assets/index-57b305d3.css +44 -0
- package/dist/assets/index-5ee8a575.css +295 -0
- package/dist/assets/index-5fa0ac5a.css +46 -0
- package/dist/assets/index-61b63a8f.css +57 -0
- package/dist/assets/index-6416f636.css +83 -0
- package/dist/assets/index-6c47e88a.css +46 -0
- package/dist/assets/index-6f721577.css +80 -0
- package/dist/assets/index-73867d38.css +133 -0
- package/dist/assets/index-76a58945.css +68 -0
- package/dist/assets/index-76dd9f11.css +5 -0
- package/dist/assets/index-7813bab3.css +66 -0
- package/dist/assets/index-793eae6b.css +234 -0
- package/dist/assets/index-8304db49.css +129 -0
- package/dist/assets/index-8aa4712e.css +51 -0
- package/dist/assets/{index-3e8ea1d6.css → index-8f52a20f.css} +16 -2
- package/dist/assets/index-93ad846c.css +259 -0
- package/dist/assets/index-9dcf6260.css +151 -0
- package/dist/assets/index-9e44e336.css +59 -0
- package/dist/assets/index-9e9587e1.css +45 -0
- package/dist/assets/index-a2b51bce.css +47 -0
- package/dist/assets/index-a2d55f92.css +204 -0
- package/dist/assets/index-a9e4fe04.css +46 -0
- package/dist/assets/index-abb90c97.css +164 -0
- package/dist/assets/{index-3b76db9b.css → index-af72a30b.css} +78 -3
- package/dist/assets/{NcAppNavigationToggle-110970cd.css → index-b8f13a1f.css} +13 -2
- package/dist/assets/index-b991895f.css +87 -0
- package/dist/assets/{index-25b448e3.css → index-baf8711a.css} +67 -3
- package/dist/assets/index-c06ad941.css +175 -0
- package/dist/assets/index-c5ae3bc4.css +303 -0
- package/dist/assets/index-c6f0da2e.css +69 -0
- package/dist/assets/index-d211cae8.css +93 -0
- package/dist/assets/index-d646553d.css +41 -0
- package/dist/assets/index-dc612aa3.css +112 -0
- package/dist/assets/index-e7c55791.css +243 -0
- package/dist/assets/index-e7eadba7.css +82 -0
- package/dist/assets/index-e828b286.css +76 -0
- package/dist/assets/index-ed4adf1d.css +115 -0
- package/dist/assets/{index-19f059f6.css → index-edee3304.css} +33 -2
- package/dist/assets/index-eea65531.css +129 -0
- package/dist/assets/index-f85aa003.css +78 -0
- package/dist/assets/index-fc61f2d8.css +41 -0
- package/dist/assets/referencePickerModal-3a127978.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/index-cb18d6f3.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-841d3015.cjs +49 -0
- package/dist/chunks/NcAppNavigationToggle-841d3015.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationToggle-e358aa47.mjs +55 -0
- package/dist/chunks/NcAppNavigationToggle-e358aa47.mjs.map +1 -0
- package/dist/chunks/NcInputConfirmCancel-44052477.mjs +96 -0
- package/dist/chunks/NcInputConfirmCancel-44052477.mjs.map +1 -0
- package/dist/chunks/NcInputConfirmCancel-6bea0fdc.cjs +90 -0
- package/dist/chunks/NcInputConfirmCancel-6bea0fdc.cjs.map +1 -0
- package/dist/chunks/NcRichText-332fe454.cjs +289 -0
- package/dist/chunks/{NcRichText-bb9d3893.mjs.map → NcRichText-332fe454.cjs.map} +1 -1
- package/dist/chunks/NcRichText-8fda53c8.mjs +302 -0
- package/dist/chunks/{NcRichText-3c54a3cc.cjs.map → NcRichText-8fda53c8.mjs.map} +1 -1
- package/dist/chunks/NcSettingsSelectGroup-a5ff8c36.cjs +183 -0
- package/dist/chunks/NcSettingsSelectGroup-a5ff8c36.cjs.map +1 -0
- package/dist/chunks/NcSettingsSelectGroup-fdd3309c.mjs +192 -0
- package/dist/chunks/NcSettingsSelectGroup-fdd3309c.mjs.map +1 -0
- package/dist/chunks/ScopeComponent-9519afcc.mjs +29 -0
- package/dist/chunks/{ScopeComponent-1f3a7612.mjs.map → ScopeComponent-9519afcc.mjs.map} +1 -1
- package/dist/chunks/ScopeComponent-e060526a.cjs +28 -0
- package/dist/chunks/{ScopeComponent-4b8bd1ee.cjs.map → ScopeComponent-e060526a.cjs.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-54bc24a6.cjs +120 -0
- package/dist/chunks/{actionText-bef01778.cjs.map → actionText-54bc24a6.cjs.map} +1 -1
- package/dist/chunks/actionText-a64be267.mjs +121 -0
- package/dist/chunks/{actionText-6c35d3fc.mjs.map → actionText-a64be267.mjs.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-032137a6.cjs +468 -0
- package/dist/chunks/index-032137a6.cjs.map +1 -0
- 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-4398f925.cjs +149 -0
- package/dist/chunks/{index-858938bd.cjs.map → index-4398f925.cjs.map} +1 -1
- package/dist/chunks/index-5f2a5f57.mjs +155 -0
- package/dist/chunks/{index-377488aa.mjs.map → index-5f2a5f57.mjs.map} +1 -1
- package/dist/chunks/index-e894376a.cjs +148 -0
- package/dist/chunks/{index-df3f51c6.cjs.map → index-e894376a.cjs.map} +1 -1
- package/dist/chunks/index-fb2ee22c.mjs +481 -0
- package/dist/chunks/index-fb2ee22c.mjs.map +1 -0
- package/dist/chunks/l10n-05a09c66.mjs +31 -0
- package/dist/chunks/l10n-05a09c66.mjs.map +1 -0
- package/dist/chunks/l10n-9aa6482d.mjs +10 -0
- package/dist/chunks/l10n-9aa6482d.mjs.map +1 -0
- package/dist/chunks/l10n-b1d264c7.cjs +29 -0
- package/dist/chunks/l10n-b1d264c7.cjs.map +1 -0
- package/dist/chunks/l10n-c7bd0ea6.cjs +8 -0
- package/dist/chunks/l10n-c7bd0ea6.cjs.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-279a483d.cjs +858 -0
- package/dist/chunks/referencePickerModal-279a483d.cjs.map +1 -0
- package/dist/chunks/referencePickerModal-443a4c57.mjs +877 -0
- package/dist/chunks/referencePickerModal-443a4c57.mjs.map +1 -0
- package/dist/index.cjs +257 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +301 -150
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -4
- package/dist/assets/NcMentionBubble-67378a12.css +0 -21
- package/dist/assets/index-2cedaf24.css +0 -21
- package/dist/assets/index-30d74459.css +0 -42
- package/dist/assets/index-317f55be.css +0 -21
- package/dist/assets/index-34f6bb3f.css +0 -21
- package/dist/assets/index-37970f20.css +0 -21
- package/dist/assets/index-3aba62de.css +0 -21
- package/dist/assets/index-47fab7bf.css +0 -21
- package/dist/assets/index-49a0d570.css +0 -21
- package/dist/assets/index-4a4c1700.css +0 -21
- package/dist/assets/index-4a4c2637.css +0 -21
- package/dist/assets/index-4efbac36.css +0 -21
- package/dist/assets/index-6140ff62.css +0 -21
- package/dist/assets/index-66b19339.css +0 -21
- package/dist/assets/index-6cb0dc4a.css +0 -21
- package/dist/assets/index-6f63d18f.css +0 -42
- package/dist/assets/index-76287c8f.css +0 -21
- package/dist/assets/index-7a7195d0.css +0 -21
- package/dist/assets/index-7e084b52.css +0 -21
- package/dist/assets/index-7f55fed2.css +0 -21
- package/dist/assets/index-7ffde264.css +0 -21
- package/dist/assets/index-81f5e4c8.css +0 -21
- package/dist/assets/index-82b5969a.css +0 -21
- package/dist/assets/index-852d8576.css +0 -21
- package/dist/assets/index-8f58dd75.css +0 -21
- package/dist/assets/index-935fa6f9.css +0 -42
- package/dist/assets/index-939ba6f0.css +0 -21
- package/dist/assets/index-a17dfbc4.css +0 -21
- package/dist/assets/index-a4a40fa3.css +0 -21
- package/dist/assets/index-a50a8de6.css +0 -1
- package/dist/assets/index-a513dcd5.css +0 -21
- package/dist/assets/index-a8c5cf75.css +0 -21
- package/dist/assets/index-a999ba9f.css +0 -21
- package/dist/assets/index-afc15e11.css +0 -21
- package/dist/assets/index-b814f5fa.css +0 -21
- package/dist/assets/index-ba6ad1b4.css +0 -21
- package/dist/assets/index-bf10e8e1.css +0 -21
- package/dist/assets/index-bf46edd7.css +0 -21
- package/dist/assets/index-c6d7f3b0.css +0 -21
- package/dist/assets/index-c736204a.css +0 -21
- package/dist/assets/index-cb76ef23.css +0 -21
- package/dist/assets/index-cc70a006.css +0 -21
- package/dist/assets/index-dd464a52.css +0 -21
- package/dist/assets/index-e0ceef85.css +0 -21
- package/dist/assets/index-ecdb616f.css +0 -42
- package/dist/assets/index-ee410fad.css +0 -21
- package/dist/assets/index-ef0bca81.css +0 -42
- package/dist/assets/index-f1030e54.css +0 -21
- package/dist/assets/index-f6ca40ca.css +0 -21
- package/dist/assets/index-f8466b88.css +0 -21
- package/dist/assets/referencePickerModal-41e4705a.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-5f3b9b9a.cjs +0 -1
- package/dist/chunks/NcAppNavigationToggle-5f3b9b9a.cjs.map +0 -1
- package/dist/chunks/NcAppNavigationToggle-86cc2542.mjs +0 -23
- package/dist/chunks/NcAppNavigationToggle-86cc2542.mjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-0cd93e0e.mjs +0 -43
- package/dist/chunks/NcInputConfirmCancel-0cd93e0e.mjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-17c8ddfb.cjs +0 -1
- package/dist/chunks/NcInputConfirmCancel-17c8ddfb.cjs.map +0 -1
- package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_357e6d0e_lang-072bbb05.cjs.map +0 -1
- package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_357e6d0e_lang-55016398.mjs.map +0 -1
- package/dist/chunks/NcRichText-3c54a3cc.cjs +0 -1
- package/dist/chunks/NcRichText-bb9d3893.mjs +0 -123
- package/dist/chunks/NcSettingsSelectGroup-0be1fe91.mjs +0 -58
- package/dist/chunks/NcSettingsSelectGroup-0be1fe91.mjs.map +0 -1
- package/dist/chunks/NcSettingsSelectGroup-62ca94a9.cjs +0 -1
- package/dist/chunks/NcSettingsSelectGroup-62ca94a9.cjs.map +0 -1
- package/dist/chunks/ScopeComponent-1f3a7612.mjs +0 -8
- package/dist/chunks/ScopeComponent-4b8bd1ee.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-197226c7.mjs +0 -171
- package/dist/chunks/index-197226c7.mjs.map +0 -1
- package/dist/chunks/index-377488aa.mjs +0 -46
- package/dist/chunks/index-858938bd.cjs +0 -3
- package/dist/chunks/index-cd3f1f8f.mjs +0 -43
- package/dist/chunks/index-cebd6e80.cjs +0 -1
- package/dist/chunks/index-cebd6e80.cjs.map +0 -1
- 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-6120a321.cjs +0 -1
- package/dist/chunks/referencePickerModal-6120a321.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-d0573462.mjs +0 -428
- package/dist/chunks/referencePickerModal-d0573462.mjs.map +0 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const l = require("./_plugin-vue2_normalizer-7f9efb60.cjs");
|
|
3
|
+
/**
|
|
4
|
+
* @copyright Copyright (c) 2020 Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
|
5
|
+
*
|
|
6
|
+
* @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
|
7
|
+
*
|
|
8
|
+
* @license AGPL-3.0-or-later
|
|
9
|
+
*
|
|
10
|
+
* This program is free software: you can redistribute it and/or modify
|
|
11
|
+
* it under the terms of the GNU Affero General Public License as
|
|
12
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
13
|
+
* License, or (at your option) any later version.
|
|
14
|
+
*
|
|
15
|
+
* This program is distributed in the hope that it will be useful,
|
|
16
|
+
* but WITHOUT ANY WARRANTY without even the implied warranty of
|
|
17
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
* GNU Affero General Public License for more details.
|
|
19
|
+
*
|
|
20
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
21
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
const r = (e, t) => {
|
|
25
|
+
const s = [];
|
|
26
|
+
let h = 0, n = e.toLowerCase().indexOf(t.toLowerCase(), h), i = 0;
|
|
27
|
+
for (; n > -1 && i < e.length; )
|
|
28
|
+
h = n + t.length, s.push({ start: n, end: h }), n = e.toLowerCase().indexOf(t.toLowerCase(), h), i++;
|
|
29
|
+
return s;
|
|
30
|
+
}, u = {
|
|
31
|
+
name: "NcHighlight",
|
|
32
|
+
props: {
|
|
33
|
+
/**
|
|
34
|
+
* The string to display
|
|
35
|
+
*/
|
|
36
|
+
text: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* The string to match and highlight
|
|
42
|
+
*/
|
|
43
|
+
search: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* The ranges to highlight, takes precedence over the search prop.
|
|
49
|
+
*/
|
|
50
|
+
highlight: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: () => []
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
/**
|
|
57
|
+
* The indice ranges which should be highlighted.
|
|
58
|
+
* If an array with ranges is provided, we use it. Otherwise
|
|
59
|
+
* we calculate it based on the provided substring to highlight.
|
|
60
|
+
*
|
|
61
|
+
* @return {Array} The array of ranges to highlight
|
|
62
|
+
*/
|
|
63
|
+
ranges() {
|
|
64
|
+
let e = [];
|
|
65
|
+
return !this.search && this.highlight.length === 0 || (this.highlight.length > 0 ? e = this.highlight : e = r(this.text, this.search), e.forEach((t, s) => {
|
|
66
|
+
t.end < t.start && (e[s] = {
|
|
67
|
+
start: t.end,
|
|
68
|
+
end: t.start
|
|
69
|
+
});
|
|
70
|
+
}), e = e.reduce((t, s) => (s.start < this.text.length && s.end > 0 && t.push({
|
|
71
|
+
start: s.start < 0 ? 0 : s.start,
|
|
72
|
+
end: s.end > this.text.length ? this.text.length : s.end
|
|
73
|
+
}), t), []), e.sort((t, s) => t.start - s.start), e = e.reduce((t, s) => {
|
|
74
|
+
if (!t.length)
|
|
75
|
+
t.push(s);
|
|
76
|
+
else {
|
|
77
|
+
const h = t.length - 1;
|
|
78
|
+
t[h].end >= s.start ? t[h] = {
|
|
79
|
+
start: t[h].start,
|
|
80
|
+
end: Math.max(t[h].end, s.end)
|
|
81
|
+
} : t.push(s);
|
|
82
|
+
}
|
|
83
|
+
return t;
|
|
84
|
+
}, [])), e;
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* Calculate the different chunks to show based on the ranges to highlight.
|
|
88
|
+
*
|
|
89
|
+
* @return {Array} The chunks
|
|
90
|
+
*/
|
|
91
|
+
chunks() {
|
|
92
|
+
if (this.ranges.length === 0)
|
|
93
|
+
return [{
|
|
94
|
+
start: 0,
|
|
95
|
+
end: this.text.length,
|
|
96
|
+
highlight: !1,
|
|
97
|
+
text: this.text
|
|
98
|
+
}];
|
|
99
|
+
const e = [];
|
|
100
|
+
let t = 0, s = 0;
|
|
101
|
+
for (; t < this.text.length; ) {
|
|
102
|
+
const h = this.ranges[s];
|
|
103
|
+
if (h.start === t) {
|
|
104
|
+
e.push({
|
|
105
|
+
...h,
|
|
106
|
+
highlight: !0,
|
|
107
|
+
text: this.text.slice(h.start, h.end)
|
|
108
|
+
}), s++, t = h.end, s >= this.ranges.length && t < this.text.length && (e.push({
|
|
109
|
+
start: t,
|
|
110
|
+
end: this.text.length,
|
|
111
|
+
highlight: !1,
|
|
112
|
+
text: this.text.slice(t)
|
|
113
|
+
}), t = this.text.length);
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
e.push({
|
|
117
|
+
start: t,
|
|
118
|
+
end: h.start,
|
|
119
|
+
highlight: !1,
|
|
120
|
+
text: this.text.slice(t, h.start)
|
|
121
|
+
}), t = h.start;
|
|
122
|
+
}
|
|
123
|
+
return e;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* The render function to display the component
|
|
128
|
+
*
|
|
129
|
+
* @param {Function} h The function to create VNodes
|
|
130
|
+
* @return {object} The created VNode
|
|
131
|
+
*/
|
|
132
|
+
render(e) {
|
|
133
|
+
return this.ranges.length ? e("span", {}, this.chunks.map((t) => t.highlight ? e("strong", {}, t.text) : t.text)) : e("span", {}, this.text);
|
|
134
|
+
}
|
|
135
|
+
}, a = null, c = null;
|
|
136
|
+
var o = /* @__PURE__ */ l.normalizeComponent(
|
|
137
|
+
u,
|
|
138
|
+
a,
|
|
139
|
+
c,
|
|
140
|
+
!1,
|
|
141
|
+
null,
|
|
142
|
+
null,
|
|
143
|
+
null,
|
|
144
|
+
null
|
|
145
|
+
);
|
|
146
|
+
const g = o.exports;
|
|
147
|
+
exports.FindRanges = r;
|
|
148
|
+
exports.NcHighlight = g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-df3f51c6.cjs","sources":["../../src/utils/FindRanges.js","../../src/components/NcHighlight/NcHighlight.vue"],"sourcesContent":["/**\n * @copyright Copyright (c) 2020 Raimund Schlüßler <raimund.schluessler@mailbox.org>\n *\n * @author Raimund Schlüßler <raimund.schluessler@mailbox.org>\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/**\n * Find the ranges of a substr in a given string\n *\n * @param {string} text The text to search in\n * @param {string} search The text to search for\n * @return {Array} The array of ranges to highlight\n */\nconst FindRanges = (text, search) => {\n\tconst ranges = []\n\tlet currentIndex = 0\n\tlet index = text.toLowerCase().indexOf(search.toLowerCase(), currentIndex)\n\t// Variable to track that we don't iterate more often than the length of the text.\n\t// Shouldn't happen anyway, but just to be sure to not hang the browser for some reason.\n\tlet i = 0\n\twhile (index > -1 && i < text.length) {\n\t\tcurrentIndex = index + search.length\n\t\tranges.push({ start: index, end: currentIndex })\n\n\t\tindex = text.toLowerCase().indexOf(search.toLowerCase(), currentIndex)\n\t\ti++\n\t}\n\treturn ranges\n}\n\nexport default FindRanges\n","<!--\n - @copyright Copyright (c) 2021 Raimund Schlüßler <raimund.schluessler@mailbox.org>\n -\n - @author Raimund Schlüßler <raimund.schluessler@mailbox.org>\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\nHighlight a string with html <strong>. Accepts a substring to highlight or an array with ranges.\n\n### Usage\n\n```vue\n<template>\n\t<div>\n\t\t<NcHighlight text=\"Highlight me please!\" search=\"me\" />\n\t\t<br />\n\t\t<NcHighlight text=\"Highlight me please!\" :highlight=\"[{ start: 4, end: 12 }]\" />\n\t</div>\n</template>\n```\n</docs>\n\n<script>\nimport FindRanges from '../../utils/FindRanges.js'\n\nexport default {\n\tname: 'NcHighlight',\n\tprops: {\n\t\t/**\n\t\t * The string to display\n\t\t */\n\t\ttext: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * The string to match and highlight\n\t\t */\n\t\tsearch: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * The ranges to highlight, takes precedence over the search prop.\n\t\t */\n\t\thighlight: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t},\n\tcomputed: {\n\t\t/**\n\t\t * The indice ranges which should be highlighted.\n\t\t * If an array with ranges is provided, we use it. Otherwise\n\t\t * we calculate it based on the provided substring to highlight.\n\t\t *\n\t\t * @return {Array} The array of ranges to highlight\n\t\t */\n\t\tranges() {\n\t\t\tlet ranges = []\n\t\t\t// If the search term and the highlight array is empty, return early with empty array\n\t\t\tif (!this.search && this.highlight.length === 0) {\n\t\t\t\treturn ranges\n\t\t\t}\n\n\t\t\t// If there are ranges to highlight provided, we use this array.\n\t\t\tif (this.highlight.length > 0) {\n\t\t\t\tranges = this.highlight\n\t\t\t// Otherwise we check the text to highlight for matches of the search term.\n\t\t\t} else {\n\t\t\t\tranges = FindRanges(this.text, this.search)\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Ensure that the start of each range is equal to or smaller than the end\n\t\t\t */\n\t\t\tranges.forEach((range, i) => {\n\t\t\t\tif (range.end < range.start) {\n\t\t\t\t\tranges[i] = {\n\t\t\t\t\t\tstart: range.end,\n\t\t\t\t\t\tend: range.start,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t/**\n\t\t\t * Validate the ranges array to be within the string length\n\t\t\t * and discard ranges which are completely out of bonds.\n\t\t\t */\n\t\t\tranges = ranges.reduce((validRanges, range) => {\n\t\t\t\tif (range.start < this.text.length && range.end > 0) {\n\t\t\t\t\tvalidRanges.push({\n\t\t\t\t\t\tstart: (range.start < 0) ? 0 : range.start,\n\t\t\t\t\t\tend: (range.end > this.text.length) ? this.text.length : range.end,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn validRanges\n\t\t\t}, [])\n\n\t\t\t/**\n\t\t\t * Sort ranges ascendingly (necessary for next step)\n\t\t\t */\n\t\t\tranges.sort((a, b) => {\n\t\t\t\treturn a.start - b.start\n\t\t\t})\n\n\t\t\t/**\n\t\t\t * Merge overlapping or adjacent ranges\n\t\t\t */\n\t\t\tranges = ranges.reduce((mergedRanges, range) => {\n\t\t\t\t// If there are no ranges, just add the range\n\t\t\t\tif (!mergedRanges.length) {\n\t\t\t\t\tmergedRanges.push(range)\n\t\t\t\t} else {\n\t\t\t\t\t// If the range overlaps the last range, merge them\n\t\t\t\t\tconst idx = mergedRanges.length - 1\n\t\t\t\t\tif (mergedRanges[idx].end >= range.start) {\n\t\t\t\t\t\tmergedRanges[idx] = {\n\t\t\t\t\t\t\tstart: mergedRanges[idx].start,\n\t\t\t\t\t\t\tend: Math.max(mergedRanges[idx].end, range.end),\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmergedRanges.push(range)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn mergedRanges\n\t\t\t}, [])\n\n\t\t\treturn ranges\n\t\t},\n\t\t/**\n\t\t * Calculate the different chunks to show based on the ranges to highlight.\n\t\t *\n\t\t * @return {Array} The chunks\n\t\t */\n\t\tchunks() {\n\t\t\t// If the ranges array is empty, show only one chunk with all text\n\t\t\tif (this.ranges.length === 0) {\n\t\t\t\treturn [{\n\t\t\t\t\tstart: 0,\n\t\t\t\t\tend: this.text.length,\n\t\t\t\t\thighlight: false,\n\t\t\t\t\ttext: this.text,\n\t\t\t\t}]\n\t\t\t}\n\t\t\t// Calculate the chunks\n\t\t\tconst chunks = []\n\t\t\tlet currentIndex = 0\n\t\t\tlet currentRange = 0\n\t\t\t// Iterate over all characters in the text\n\t\t\twhile (currentIndex < this.text.length) {\n\t\t\t\t// Get the first range to highlight\n\t\t\t\tconst range = this.ranges[currentRange]\n\t\t\t\t// If the range starts at the current index, construct a chunk to highlight,\n\t\t\t\t// set the next range and continue with the next iteration.\n\t\t\t\tif (range.start === currentIndex) {\n\t\t\t\t\tchunks.push({\n\t\t\t\t\t\t...range,\n\t\t\t\t\t\thighlight: true,\n\t\t\t\t\t\ttext: this.text.slice(range.start, range.end),\n\t\t\t\t\t})\n\t\t\t\t\tcurrentRange++\n\t\t\t\t\tcurrentIndex = range.end\n\t\t\t\t\t// If this was the last range to highlight and we haven't reached the end of the text,\n\t\t\t\t\t// add the rest of the text without highlighting.\n\t\t\t\t\tif (currentRange >= this.ranges.length && currentIndex < this.text.length) {\n\t\t\t\t\t\tchunks.push({\n\t\t\t\t\t\t\tstart: currentIndex,\n\t\t\t\t\t\t\tend: this.text.length,\n\t\t\t\t\t\t\thighlight: false,\n\t\t\t\t\t\t\ttext: this.text.slice(currentIndex),\n\t\t\t\t\t\t})\n\t\t\t\t\t\t// Set the current index so the while loop ends.\n\t\t\t\t\t\tcurrentIndex = this.text.length\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// If the current range does start after the current index, construct a chunk without\n\t\t\t\t// highlighting and set the current index to the start of the current range.\n\t\t\t\tchunks.push({\n\t\t\t\t\tstart: currentIndex,\n\t\t\t\t\tend: range.start,\n\t\t\t\t\thighlight: false,\n\t\t\t\t\ttext: this.text.slice(currentIndex, range.start),\n\t\t\t\t})\n\t\t\t\tcurrentIndex = range.start\n\t\t\t}\n\t\t\treturn chunks\n\t\t},\n\t},\n\t/**\n\t * The render function to display the component\n\t *\n\t * @param {Function} h The function to create VNodes\n\t * @return {object} The created VNode\n\t */\n\trender(h) {\n\t\tif (!this.ranges.length) {\n\t\t\treturn h('span', {}, this.text)\n\t\t}\n\n\t\treturn h('span', {}, this.chunks.map(chunk => {\n\t\t\treturn chunk.highlight ? h('strong', {}, chunk.text) : chunk.text\n\t\t}))\n\t},\n}\n</script>\n"],"names":["FindRanges","text","search","ranges","currentIndex","index","i","_sfc_main","range","validRanges","a","b","mergedRanges","idx","chunks","currentRange","h","chunk"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index-e894376a.cjs","sources":["../../src/utils/FindRanges.js","../../src/components/NcHighlight/NcHighlight.vue"],"sourcesContent":["/**\n * @copyright Copyright (c) 2020 Raimund Schlüßler <raimund.schluessler@mailbox.org>\n *\n * @author Raimund Schlüßler <raimund.schluessler@mailbox.org>\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/**\n * Find the ranges of a substr in a given string\n *\n * @param {string} text The text to search in\n * @param {string} search The text to search for\n * @return {Array} The array of ranges to highlight\n */\nconst FindRanges = (text, search) => {\n\tconst ranges = []\n\tlet currentIndex = 0\n\tlet index = text.toLowerCase().indexOf(search.toLowerCase(), currentIndex)\n\t// Variable to track that we don't iterate more often than the length of the text.\n\t// Shouldn't happen anyway, but just to be sure to not hang the browser for some reason.\n\tlet i = 0\n\twhile (index > -1 && i < text.length) {\n\t\tcurrentIndex = index + search.length\n\t\tranges.push({ start: index, end: currentIndex })\n\n\t\tindex = text.toLowerCase().indexOf(search.toLowerCase(), currentIndex)\n\t\ti++\n\t}\n\treturn ranges\n}\n\nexport default FindRanges\n","<!--\n - @copyright Copyright (c) 2021 Raimund Schlüßler <raimund.schluessler@mailbox.org>\n -\n - @author Raimund Schlüßler <raimund.schluessler@mailbox.org>\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\nHighlight a string with html <strong>. Accepts a substring to highlight or an array with ranges.\n\n### Usage\n\n```vue\n<template>\n\t<div>\n\t\t<NcHighlight text=\"Highlight me please!\" search=\"me\" />\n\t\t<br />\n\t\t<NcHighlight text=\"Highlight me please!\" :highlight=\"[{ start: 4, end: 12 }]\" />\n\t</div>\n</template>\n```\n</docs>\n\n<script>\nimport FindRanges from '../../utils/FindRanges.js'\n\nexport default {\n\tname: 'NcHighlight',\n\tprops: {\n\t\t/**\n\t\t * The string to display\n\t\t */\n\t\ttext: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * The string to match and highlight\n\t\t */\n\t\tsearch: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * The ranges to highlight, takes precedence over the search prop.\n\t\t */\n\t\thighlight: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t},\n\tcomputed: {\n\t\t/**\n\t\t * The indice ranges which should be highlighted.\n\t\t * If an array with ranges is provided, we use it. Otherwise\n\t\t * we calculate it based on the provided substring to highlight.\n\t\t *\n\t\t * @return {Array} The array of ranges to highlight\n\t\t */\n\t\tranges() {\n\t\t\tlet ranges = []\n\t\t\t// If the search term and the highlight array is empty, return early with empty array\n\t\t\tif (!this.search && this.highlight.length === 0) {\n\t\t\t\treturn ranges\n\t\t\t}\n\n\t\t\t// If there are ranges to highlight provided, we use this array.\n\t\t\tif (this.highlight.length > 0) {\n\t\t\t\tranges = this.highlight\n\t\t\t// Otherwise we check the text to highlight for matches of the search term.\n\t\t\t} else {\n\t\t\t\tranges = FindRanges(this.text, this.search)\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Ensure that the start of each range is equal to or smaller than the end\n\t\t\t */\n\t\t\tranges.forEach((range, i) => {\n\t\t\t\tif (range.end < range.start) {\n\t\t\t\t\tranges[i] = {\n\t\t\t\t\t\tstart: range.end,\n\t\t\t\t\t\tend: range.start,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t/**\n\t\t\t * Validate the ranges array to be within the string length\n\t\t\t * and discard ranges which are completely out of bonds.\n\t\t\t */\n\t\t\tranges = ranges.reduce((validRanges, range) => {\n\t\t\t\tif (range.start < this.text.length && range.end > 0) {\n\t\t\t\t\tvalidRanges.push({\n\t\t\t\t\t\tstart: (range.start < 0) ? 0 : range.start,\n\t\t\t\t\t\tend: (range.end > this.text.length) ? this.text.length : range.end,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn validRanges\n\t\t\t}, [])\n\n\t\t\t/**\n\t\t\t * Sort ranges ascendingly (necessary for next step)\n\t\t\t */\n\t\t\tranges.sort((a, b) => {\n\t\t\t\treturn a.start - b.start\n\t\t\t})\n\n\t\t\t/**\n\t\t\t * Merge overlapping or adjacent ranges\n\t\t\t */\n\t\t\tranges = ranges.reduce((mergedRanges, range) => {\n\t\t\t\t// If there are no ranges, just add the range\n\t\t\t\tif (!mergedRanges.length) {\n\t\t\t\t\tmergedRanges.push(range)\n\t\t\t\t} else {\n\t\t\t\t\t// If the range overlaps the last range, merge them\n\t\t\t\t\tconst idx = mergedRanges.length - 1\n\t\t\t\t\tif (mergedRanges[idx].end >= range.start) {\n\t\t\t\t\t\tmergedRanges[idx] = {\n\t\t\t\t\t\t\tstart: mergedRanges[idx].start,\n\t\t\t\t\t\t\tend: Math.max(mergedRanges[idx].end, range.end),\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmergedRanges.push(range)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn mergedRanges\n\t\t\t}, [])\n\n\t\t\treturn ranges\n\t\t},\n\t\t/**\n\t\t * Calculate the different chunks to show based on the ranges to highlight.\n\t\t *\n\t\t * @return {Array} The chunks\n\t\t */\n\t\tchunks() {\n\t\t\t// If the ranges array is empty, show only one chunk with all text\n\t\t\tif (this.ranges.length === 0) {\n\t\t\t\treturn [{\n\t\t\t\t\tstart: 0,\n\t\t\t\t\tend: this.text.length,\n\t\t\t\t\thighlight: false,\n\t\t\t\t\ttext: this.text,\n\t\t\t\t}]\n\t\t\t}\n\t\t\t// Calculate the chunks\n\t\t\tconst chunks = []\n\t\t\tlet currentIndex = 0\n\t\t\tlet currentRange = 0\n\t\t\t// Iterate over all characters in the text\n\t\t\twhile (currentIndex < this.text.length) {\n\t\t\t\t// Get the first range to highlight\n\t\t\t\tconst range = this.ranges[currentRange]\n\t\t\t\t// If the range starts at the current index, construct a chunk to highlight,\n\t\t\t\t// set the next range and continue with the next iteration.\n\t\t\t\tif (range.start === currentIndex) {\n\t\t\t\t\tchunks.push({\n\t\t\t\t\t\t...range,\n\t\t\t\t\t\thighlight: true,\n\t\t\t\t\t\ttext: this.text.slice(range.start, range.end),\n\t\t\t\t\t})\n\t\t\t\t\tcurrentRange++\n\t\t\t\t\tcurrentIndex = range.end\n\t\t\t\t\t// If this was the last range to highlight and we haven't reached the end of the text,\n\t\t\t\t\t// add the rest of the text without highlighting.\n\t\t\t\t\tif (currentRange >= this.ranges.length && currentIndex < this.text.length) {\n\t\t\t\t\t\tchunks.push({\n\t\t\t\t\t\t\tstart: currentIndex,\n\t\t\t\t\t\t\tend: this.text.length,\n\t\t\t\t\t\t\thighlight: false,\n\t\t\t\t\t\t\ttext: this.text.slice(currentIndex),\n\t\t\t\t\t\t})\n\t\t\t\t\t\t// Set the current index so the while loop ends.\n\t\t\t\t\t\tcurrentIndex = this.text.length\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// If the current range does start after the current index, construct a chunk without\n\t\t\t\t// highlighting and set the current index to the start of the current range.\n\t\t\t\tchunks.push({\n\t\t\t\t\tstart: currentIndex,\n\t\t\t\t\tend: range.start,\n\t\t\t\t\thighlight: false,\n\t\t\t\t\ttext: this.text.slice(currentIndex, range.start),\n\t\t\t\t})\n\t\t\t\tcurrentIndex = range.start\n\t\t\t}\n\t\t\treturn chunks\n\t\t},\n\t},\n\t/**\n\t * The render function to display the component\n\t *\n\t * @param {Function} h The function to create VNodes\n\t * @return {object} The created VNode\n\t */\n\trender(h) {\n\t\tif (!this.ranges.length) {\n\t\t\treturn h('span', {}, this.text)\n\t\t}\n\n\t\treturn h('span', {}, this.chunks.map(chunk => {\n\t\t\treturn chunk.highlight ? h('strong', {}, chunk.text) : chunk.text\n\t\t}))\n\t},\n}\n</script>\n"],"names":["FindRanges","text","search","ranges","currentIndex","index","_sfc_main","range","i","validRanges","a","b","mergedRanges","idx","chunks","currentRange","h","chunk"],"mappings":"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"}
|
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import "../assets/index-9dcf6260.css";
|
|
2
|
+
import S from "../Components/NcActions.mjs";
|
|
3
|
+
import g from "../Components/NcActionLink.mjs";
|
|
4
|
+
import y from "../Components/NcButton.mjs";
|
|
5
|
+
import U from "../Components/NcLoadingIcon.mjs";
|
|
6
|
+
import d from "../Functions/usernameToColor.mjs";
|
|
7
|
+
import "vue";
|
|
8
|
+
import { generateOcsUrl as _, generateUrl as c } from "@nextcloud/router";
|
|
9
|
+
/* empty css */import { n as M } from "./_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
10
|
+
import "linkify-string";
|
|
11
|
+
import "escape-html";
|
|
12
|
+
import "striptags";
|
|
13
|
+
import { getCurrentUser as l } from "@nextcloud/auth";
|
|
14
|
+
import f from "@nextcloud/axios";
|
|
15
|
+
import { getCapabilities as N } from "@nextcloud/capabilities";
|
|
16
|
+
import { t as i } from "./l10n-05a09c66.mjs";
|
|
17
|
+
import b from "vue-material-design-icons/DotsHorizontal.vue";
|
|
18
|
+
import { subscribe as o, unsubscribe as u } from "@nextcloud/event-bus";
|
|
19
|
+
import { getBuilder as w } from "@nextcloud/browser-storage";
|
|
20
|
+
import { vOnClickOutside as x } from "@vueuse/components";
|
|
21
|
+
/**
|
|
22
|
+
* @copyright Copyright (c) 2020 Georg Ehrke <georg-nextcloud@ehrke.email>
|
|
23
|
+
*
|
|
24
|
+
* @author Georg Ehrke <georg-nextcloud@ehrke.email>
|
|
25
|
+
*
|
|
26
|
+
* @license AGPL-3.0-or-later
|
|
27
|
+
*
|
|
28
|
+
* This program is free software: you can redistribute it and/or modify
|
|
29
|
+
* it under the terms of the GNU Affero General Public License as
|
|
30
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
31
|
+
* License, or (at your option) any later version.
|
|
32
|
+
*
|
|
33
|
+
* This program is distributed in the hope that it will be useful,
|
|
34
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
35
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
36
|
+
* GNU Affero General Public License for more details.
|
|
37
|
+
*
|
|
38
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
39
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
const A = {
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
hasStatus: !1,
|
|
46
|
+
userStatus: {
|
|
47
|
+
status: null,
|
|
48
|
+
message: null,
|
|
49
|
+
icon: null
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
methods: {
|
|
54
|
+
/**
|
|
55
|
+
* Fetches the user-status from the server
|
|
56
|
+
*
|
|
57
|
+
* @param {string} userId UserId of the user to fetch the status for
|
|
58
|
+
*
|
|
59
|
+
* @return {Promise<void>}
|
|
60
|
+
*/
|
|
61
|
+
async fetchUserStatus(e) {
|
|
62
|
+
var s, a;
|
|
63
|
+
if (!e)
|
|
64
|
+
return;
|
|
65
|
+
const t = N();
|
|
66
|
+
if (!(!Object.prototype.hasOwnProperty.call(t, "user_status") || !t.user_status.enabled) && l())
|
|
67
|
+
try {
|
|
68
|
+
const { data: r } = await f.get(_("apps/user_status/api/v1/statuses/{userId}", { userId: e })), {
|
|
69
|
+
status: n,
|
|
70
|
+
message: m,
|
|
71
|
+
icon: v
|
|
72
|
+
} = r.ocs.data;
|
|
73
|
+
this.userStatus.status = n, this.userStatus.message = m || "", this.userStatus.icon = v || "", this.hasStatus = !0;
|
|
74
|
+
} catch (r) {
|
|
75
|
+
if (r.response.status === 404 && ((a = (s = r.response.data.ocs) == null ? void 0 : s.data) == null ? void 0 : a.length) === 0)
|
|
76
|
+
return;
|
|
77
|
+
console.error(r);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const p = w("nextcloud").persist().build();
|
|
83
|
+
function L(e) {
|
|
84
|
+
const t = p.getItem("user-has-avatar." + e);
|
|
85
|
+
return typeof t == "string" ? !!t : null;
|
|
86
|
+
}
|
|
87
|
+
function h(e, t) {
|
|
88
|
+
e && p.setItem("user-has-avatar." + e, t);
|
|
89
|
+
}
|
|
90
|
+
const C = {
|
|
91
|
+
name: "NcAvatar",
|
|
92
|
+
directives: {
|
|
93
|
+
ClickOutside: x
|
|
94
|
+
},
|
|
95
|
+
components: {
|
|
96
|
+
DotsHorizontal: b,
|
|
97
|
+
NcActions: S,
|
|
98
|
+
NcActionLink: g,
|
|
99
|
+
NcButton: y,
|
|
100
|
+
NcLoadingIcon: U
|
|
101
|
+
},
|
|
102
|
+
mixins: [A],
|
|
103
|
+
props: {
|
|
104
|
+
/**
|
|
105
|
+
* Set a custom url to the avatar image
|
|
106
|
+
* either the url, user or displayName property must be defined
|
|
107
|
+
*/
|
|
108
|
+
url: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: void 0
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Set a css icon-class for an icon to be used instead of the avatar.
|
|
114
|
+
*/
|
|
115
|
+
iconClass: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: void 0
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Set the user id to fetch the avatar
|
|
121
|
+
* either the url, user or displayName property must be defined
|
|
122
|
+
*/
|
|
123
|
+
user: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: void 0
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* Whether or not to display the user-status
|
|
129
|
+
*/
|
|
130
|
+
showUserStatus: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: !0
|
|
133
|
+
},
|
|
134
|
+
/**
|
|
135
|
+
* Whether or not to the status-icon should be used instead of online/away
|
|
136
|
+
*/
|
|
137
|
+
showUserStatusCompact: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
default: !0
|
|
140
|
+
},
|
|
141
|
+
/**
|
|
142
|
+
* When the user status was preloaded via another source it can be handed in with this property to save the request.
|
|
143
|
+
* If this property is not set the status will be fetched automatically.
|
|
144
|
+
* If a preloaded no-status is available provide this object with properties "status", "icon" and "message" set to null.
|
|
145
|
+
*/
|
|
146
|
+
preloadedUserStatus: {
|
|
147
|
+
type: Object,
|
|
148
|
+
default: void 0
|
|
149
|
+
},
|
|
150
|
+
/**
|
|
151
|
+
* Is the user a guest user (then we have to user a different endpoint)
|
|
152
|
+
*/
|
|
153
|
+
isGuest: {
|
|
154
|
+
type: Boolean,
|
|
155
|
+
default: !1
|
|
156
|
+
},
|
|
157
|
+
/**
|
|
158
|
+
* Set a display name that will be rendered as a tooltip
|
|
159
|
+
* either the url, user or displayName property must be defined
|
|
160
|
+
* specify just the displayname to generate a placeholder avatar without
|
|
161
|
+
* trying to fetch the avatar based on the user id
|
|
162
|
+
*/
|
|
163
|
+
displayName: {
|
|
164
|
+
type: String,
|
|
165
|
+
default: void 0
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* Set a size in px for the rendered avatar
|
|
169
|
+
*/
|
|
170
|
+
size: {
|
|
171
|
+
type: Number,
|
|
172
|
+
default: 32
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* Placeholder avatars will be automatically generated when this is set to true
|
|
176
|
+
*/
|
|
177
|
+
allowPlaceholder: {
|
|
178
|
+
type: Boolean,
|
|
179
|
+
default: !0
|
|
180
|
+
},
|
|
181
|
+
/**
|
|
182
|
+
* Disable the tooltip
|
|
183
|
+
*/
|
|
184
|
+
disableTooltip: {
|
|
185
|
+
type: Boolean,
|
|
186
|
+
default: !1
|
|
187
|
+
},
|
|
188
|
+
/**
|
|
189
|
+
* Disable the menu
|
|
190
|
+
*/
|
|
191
|
+
disableMenu: {
|
|
192
|
+
type: Boolean,
|
|
193
|
+
default: !1
|
|
194
|
+
},
|
|
195
|
+
/**
|
|
196
|
+
* Declares a custom tooltip when not null
|
|
197
|
+
* Fallback will be the displayName
|
|
198
|
+
*
|
|
199
|
+
* requires disableTooltip not to be set to true
|
|
200
|
+
*/
|
|
201
|
+
tooltipMessage: {
|
|
202
|
+
type: String,
|
|
203
|
+
default: null
|
|
204
|
+
},
|
|
205
|
+
/**
|
|
206
|
+
* Declares username is not a user's name, when true.
|
|
207
|
+
* Prevents loading user's avatar from server and forces generating colored initials,
|
|
208
|
+
* i.e. if the user is a group
|
|
209
|
+
*/
|
|
210
|
+
isNoUser: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
default: !1
|
|
213
|
+
},
|
|
214
|
+
/**
|
|
215
|
+
* Selector for the popover menu container
|
|
216
|
+
*/
|
|
217
|
+
menuContainer: {
|
|
218
|
+
type: [String, Object, Element, Boolean],
|
|
219
|
+
default: "body"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
data() {
|
|
223
|
+
return {
|
|
224
|
+
avatarUrlLoaded: null,
|
|
225
|
+
avatarSrcSetLoaded: null,
|
|
226
|
+
userDoesNotExist: !1,
|
|
227
|
+
isAvatarLoaded: !1,
|
|
228
|
+
isMenuLoaded: !1,
|
|
229
|
+
contactsMenuLoading: !1,
|
|
230
|
+
contactsMenuActions: [],
|
|
231
|
+
contactsMenuOpenState: !1
|
|
232
|
+
};
|
|
233
|
+
},
|
|
234
|
+
computed: {
|
|
235
|
+
avatarAriaLabel() {
|
|
236
|
+
var e, t;
|
|
237
|
+
if (this.hasMenu)
|
|
238
|
+
return this.canDisplayUserStatus || this.showUserStatusIconOnAvatar ? i("Avatar of {displayName}, {status}", { displayName: (e = this.displayName) != null ? e : this.user, status: this.userStatusText }) : i("Avatar of {displayName}", { displayName: (t = this.displayName) != null ? t : this.user });
|
|
239
|
+
},
|
|
240
|
+
/** Translated current user status */
|
|
241
|
+
userStatusText() {
|
|
242
|
+
switch (this.userStatus.status) {
|
|
243
|
+
case "away":
|
|
244
|
+
return i("away");
|
|
245
|
+
case "dnd":
|
|
246
|
+
return i("do not disturb");
|
|
247
|
+
case "online":
|
|
248
|
+
return i("online");
|
|
249
|
+
case "offline":
|
|
250
|
+
return i("offline");
|
|
251
|
+
default:
|
|
252
|
+
return this.userStatus.status;
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
/**
|
|
256
|
+
* If the avatar has no menu no aria-label is assigned, but for accessibility we still need the status to be accessible
|
|
257
|
+
* So this sets `role=img` on the status indicator (span with background) and the required `alt` and `aria-label` attributes.
|
|
258
|
+
*/
|
|
259
|
+
userStatusRole() {
|
|
260
|
+
if (this.hasMenu)
|
|
261
|
+
return;
|
|
262
|
+
const e = i("User status: {status}", { status: this.userStatusText });
|
|
263
|
+
return {
|
|
264
|
+
role: "img",
|
|
265
|
+
"aria-label": e,
|
|
266
|
+
alt: e
|
|
267
|
+
};
|
|
268
|
+
},
|
|
269
|
+
canDisplayUserStatus() {
|
|
270
|
+
return this.showUserStatus && this.hasStatus && ["online", "away", "dnd"].includes(this.userStatus.status);
|
|
271
|
+
},
|
|
272
|
+
showUserStatusIconOnAvatar() {
|
|
273
|
+
return this.showUserStatus && this.showUserStatusCompact && this.hasStatus && this.userStatus.status !== "dnd" && this.userStatus.icon;
|
|
274
|
+
},
|
|
275
|
+
getUserIdentifier() {
|
|
276
|
+
return this.isDisplayNameDefined ? this.displayName : this.isUserDefined ? this.user : "";
|
|
277
|
+
},
|
|
278
|
+
isUserDefined() {
|
|
279
|
+
return typeof this.user < "u";
|
|
280
|
+
},
|
|
281
|
+
isDisplayNameDefined() {
|
|
282
|
+
return typeof this.displayName < "u";
|
|
283
|
+
},
|
|
284
|
+
isUrlDefined() {
|
|
285
|
+
return typeof this.url < "u";
|
|
286
|
+
},
|
|
287
|
+
hasMenu() {
|
|
288
|
+
var e;
|
|
289
|
+
return this.disableMenu ? !1 : this.isMenuLoaded ? this.menu.length > 0 : !(this.user === ((e = l()) == null ? void 0 : e.uid) || this.userDoesNotExist || this.url);
|
|
290
|
+
},
|
|
291
|
+
shouldShowPlaceholder() {
|
|
292
|
+
return this.allowPlaceholder && this.userDoesNotExist;
|
|
293
|
+
},
|
|
294
|
+
avatarStyle() {
|
|
295
|
+
return {
|
|
296
|
+
"--size": this.size + "px",
|
|
297
|
+
lineHeight: this.size + "px",
|
|
298
|
+
fontSize: Math.round(this.size * 0.45) + "px"
|
|
299
|
+
};
|
|
300
|
+
},
|
|
301
|
+
initialsWrapperStyle() {
|
|
302
|
+
const { r: e, g: t, b: s } = d(this.getUserIdentifier);
|
|
303
|
+
return {
|
|
304
|
+
backgroundColor: `rgba(${e}, ${t}, ${s}, 0.1)`
|
|
305
|
+
};
|
|
306
|
+
},
|
|
307
|
+
initialsStyle() {
|
|
308
|
+
const { r: e, g: t, b: s } = d(this.getUserIdentifier);
|
|
309
|
+
return {
|
|
310
|
+
color: `rgb(${e}, ${t}, ${s})`
|
|
311
|
+
};
|
|
312
|
+
},
|
|
313
|
+
tooltip() {
|
|
314
|
+
return this.disableTooltip ? !1 : this.tooltipMessage ? this.tooltipMessage : this.displayName;
|
|
315
|
+
},
|
|
316
|
+
initials() {
|
|
317
|
+
let e;
|
|
318
|
+
if (this.shouldShowPlaceholder) {
|
|
319
|
+
const t = this.getUserIdentifier, s = t.indexOf(" ");
|
|
320
|
+
t === "" ? e = "?" : (e = String.fromCodePoint(t.codePointAt(0)), s !== -1 && (e = e.concat(String.fromCodePoint(t.codePointAt(s + 1)))));
|
|
321
|
+
}
|
|
322
|
+
return e.toUpperCase();
|
|
323
|
+
},
|
|
324
|
+
menu() {
|
|
325
|
+
const e = this.contactsMenuActions.map((s) => ({
|
|
326
|
+
href: s.hyperlink,
|
|
327
|
+
icon: s.icon,
|
|
328
|
+
text: s.title
|
|
329
|
+
}));
|
|
330
|
+
function t(s) {
|
|
331
|
+
const a = document.createTextNode(s), r = document.createElement("p");
|
|
332
|
+
return r.appendChild(a), r.innerHTML;
|
|
333
|
+
}
|
|
334
|
+
return this.showUserStatus && (this.userStatus.icon || this.userStatus.message) ? [{
|
|
335
|
+
href: "#",
|
|
336
|
+
icon: `data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><text x='0' y='14' font-size='14'>${t(this.userStatus.icon)}</text></svg>`,
|
|
337
|
+
text: `${this.userStatus.message}`
|
|
338
|
+
}].concat(e) : e;
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
watch: {
|
|
342
|
+
url() {
|
|
343
|
+
this.userDoesNotExist = !1, this.loadAvatarUrl();
|
|
344
|
+
},
|
|
345
|
+
user() {
|
|
346
|
+
this.userDoesNotExist = !1, this.isMenuLoaded = !1, this.loadAvatarUrl();
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
mounted() {
|
|
350
|
+
this.loadAvatarUrl(), o("settings:avatar:updated", this.loadAvatarUrl), o("settings:display-name:updated", this.loadAvatarUrl), this.showUserStatus && this.user && !this.isNoUser && (this.preloadedUserStatus ? (this.userStatus.status = this.preloadedUserStatus.status || "", this.userStatus.message = this.preloadedUserStatus.message || "", this.userStatus.icon = this.preloadedUserStatus.icon || "", this.hasStatus = this.preloadedUserStatus.status !== null) : this.fetchUserStatus(this.user), o("user_status:status.updated", this.handleUserStatusUpdated));
|
|
351
|
+
},
|
|
352
|
+
beforeDestroy() {
|
|
353
|
+
u("settings:avatar:updated", this.loadAvatarUrl), u("settings:display-name:updated", this.loadAvatarUrl), this.showUserStatus && this.user && !this.isNoUser && u("user_status:status.updated", this.handleUserStatusUpdated);
|
|
354
|
+
},
|
|
355
|
+
methods: {
|
|
356
|
+
t: i,
|
|
357
|
+
handleUserStatusUpdated(e) {
|
|
358
|
+
this.user === e.userId && (this.userStatus = {
|
|
359
|
+
status: e.status,
|
|
360
|
+
icon: e.icon,
|
|
361
|
+
message: e.message
|
|
362
|
+
});
|
|
363
|
+
},
|
|
364
|
+
/**
|
|
365
|
+
* Toggle the popover menu on click or enter
|
|
366
|
+
* @param {KeyboardEvent|MouseEvent} event the UI event
|
|
367
|
+
*/
|
|
368
|
+
async toggleMenu(e) {
|
|
369
|
+
e.type === "keydown" && e.key !== "Enter" || (this.contactsMenuOpenState || await this.fetchContactsMenu(), this.contactsMenuOpenState = !this.contactsMenuOpenState);
|
|
370
|
+
},
|
|
371
|
+
closeMenu() {
|
|
372
|
+
this.contactsMenuOpenState = !1;
|
|
373
|
+
},
|
|
374
|
+
async fetchContactsMenu() {
|
|
375
|
+
this.contactsMenuLoading = !0;
|
|
376
|
+
try {
|
|
377
|
+
const e = encodeURIComponent(this.user), { data: t } = await f.post(c("contactsmenu/findOne"), `shareType=0&shareWith=${e}`);
|
|
378
|
+
this.contactsMenuActions = t.topAction ? [t.topAction].concat(t.actions) : t.actions;
|
|
379
|
+
} catch {
|
|
380
|
+
this.contactsMenuOpenState = !1;
|
|
381
|
+
}
|
|
382
|
+
this.contactsMenuLoading = !1, this.isMenuLoaded = !0;
|
|
383
|
+
},
|
|
384
|
+
/**
|
|
385
|
+
* Handle avatar loading if user or url defined
|
|
386
|
+
*/
|
|
387
|
+
loadAvatarUrl() {
|
|
388
|
+
if (this.isAvatarLoaded = !1, !this.isUrlDefined && (!this.isUserDefined || this.isNoUser)) {
|
|
389
|
+
this.isAvatarLoaded = !0, this.userDoesNotExist = !0;
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (this.isUrlDefined) {
|
|
393
|
+
this.updateImageIfValid(this.url);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
if (this.size <= 64) {
|
|
397
|
+
const e = this.avatarUrlGenerator(this.user, 64), t = [
|
|
398
|
+
e + " 1x",
|
|
399
|
+
this.avatarUrlGenerator(this.user, 512) + " 8x"
|
|
400
|
+
].join(", ");
|
|
401
|
+
this.updateImageIfValid(e, t);
|
|
402
|
+
} else {
|
|
403
|
+
const e = this.avatarUrlGenerator(this.user, 512);
|
|
404
|
+
this.updateImageIfValid(e);
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
/**
|
|
408
|
+
* Generate an avatar url from the server's avatar endpoint
|
|
409
|
+
*
|
|
410
|
+
* @param {string} user the user id
|
|
411
|
+
* @param {number} size the desired size
|
|
412
|
+
* @return {string}
|
|
413
|
+
*/
|
|
414
|
+
avatarUrlGenerator(e, t) {
|
|
415
|
+
var n;
|
|
416
|
+
const s = window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark") === "invert(100%)";
|
|
417
|
+
let a = "/avatar/{user}/{size}" + (s ? "/dark" : "");
|
|
418
|
+
this.isGuest && (a = "/avatar/guest/{user}/{size}" + (s ? "/dark" : ""));
|
|
419
|
+
let r = c(
|
|
420
|
+
a,
|
|
421
|
+
{
|
|
422
|
+
user: e,
|
|
423
|
+
size: t
|
|
424
|
+
}
|
|
425
|
+
);
|
|
426
|
+
return e === ((n = l()) == null ? void 0 : n.uid) && typeof oc_userconfig < "u" && (r += "?v=" + oc_userconfig.avatar.version), r;
|
|
427
|
+
},
|
|
428
|
+
/**
|
|
429
|
+
* Check if the provided url is valid and update Avatar if so
|
|
430
|
+
*
|
|
431
|
+
* @param {string} url the avatar url
|
|
432
|
+
* @param {Array} srcset the avatar srcset
|
|
433
|
+
*/
|
|
434
|
+
updateImageIfValid(e, t = null) {
|
|
435
|
+
const s = L(this.user);
|
|
436
|
+
if (this.isUserDefined && typeof s == "boolean") {
|
|
437
|
+
this.isAvatarLoaded = !0, this.avatarUrlLoaded = e, t && (this.avatarSrcSetLoaded = t), s === !1 && (this.userDoesNotExist = !0);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
const a = new Image();
|
|
441
|
+
a.onload = () => {
|
|
442
|
+
this.avatarUrlLoaded = e, t && (this.avatarSrcSetLoaded = t), this.isAvatarLoaded = !0, h(this.user, !0);
|
|
443
|
+
}, a.onerror = () => {
|
|
444
|
+
console.debug("Invalid avatar url", e), this.avatarUrlLoaded = null, this.avatarSrcSetLoaded = null, this.userDoesNotExist = !0, this.isAvatarLoaded = !1, h(this.user, !1);
|
|
445
|
+
}, t && (a.srcset = t), a.src = e;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
var D = function() {
|
|
450
|
+
var t = this, s = t._self._c;
|
|
451
|
+
return s("span", t._g({ directives: [{ name: "click-outside", rawName: "v-click-outside", value: t.closeMenu, expression: "closeMenu" }], ref: "main", staticClass: "avatardiv popovermenu-wrapper", class: {
|
|
452
|
+
"avatardiv--unknown": t.userDoesNotExist,
|
|
453
|
+
"avatardiv--with-menu": t.hasMenu,
|
|
454
|
+
"avatardiv--with-menu-loading": t.contactsMenuLoading
|
|
455
|
+
}, style: t.avatarStyle, attrs: { title: t.tooltip, tabindex: t.hasMenu ? "0" : void 0, "aria-label": t.avatarAriaLabel, role: t.hasMenu ? "button" : void 0 } }, t.hasMenu ? {
|
|
456
|
+
click: t.toggleMenu,
|
|
457
|
+
keydown: t.toggleMenu
|
|
458
|
+
} : null), [t._t("icon", function() {
|
|
459
|
+
return [t.iconClass ? s("span", { staticClass: "avatar-class-icon", class: t.iconClass }) : t.isAvatarLoaded && !t.userDoesNotExist ? s("img", { attrs: { src: t.avatarUrlLoaded, srcset: t.avatarSrcSetLoaded, alt: "" } }) : t._e()];
|
|
460
|
+
}), t.hasMenu && !t.menu.length ? s("NcButton", { staticClass: "action-item action-item__menutoggle", attrs: { "aria-label": t.t("Open contact menu"), type: "tertiary-no-background" }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
461
|
+
return [t.contactsMenuLoading ? s("NcLoadingIcon") : s("DotsHorizontal", { attrs: { size: 20 } })];
|
|
462
|
+
}, proxy: !0 }], null, !1, 2617833509) }) : t.hasMenu ? s("NcActions", { attrs: { "force-menu": "", "manual-open": "", type: "tertiary-no-background", container: t.menuContainer, open: t.contactsMenuOpenState }, scopedSlots: t._u([t.contactsMenuLoading ? { key: "icon", fn: function() {
|
|
463
|
+
return [s("NcLoadingIcon")];
|
|
464
|
+
}, proxy: !0 } : null], null, !0) }, t._l(t.menu, function(a, r) {
|
|
465
|
+
return s("NcActionLink", { key: r, attrs: { href: a.href, icon: a.icon } }, [t._v(" " + t._s(a.text) + " ")]);
|
|
466
|
+
}), 1) : t._e(), t.showUserStatusIconOnAvatar ? s("span", { staticClass: "avatardiv__user-status avatardiv__user-status--icon" }, [t._v(" " + t._s(t.userStatus.icon) + " ")]) : t.canDisplayUserStatus ? s("span", t._b({ staticClass: "avatardiv__user-status", class: "avatardiv__user-status--" + t.userStatus.status }, "span", t.userStatusRole, !1)) : t._e(), t.userDoesNotExist && !(t.iconClass || t.$slots.icon) ? s("span", { staticClass: "avatardiv__initials-wrapper", style: t.initialsWrapperStyle }, [s("span", { staticClass: "unknown", style: t.initialsStyle }, [t._v(" " + t._s(t.initials) + " ")])]) : t._e()], 2);
|
|
467
|
+
}, k = [], I = /* @__PURE__ */ M(
|
|
468
|
+
C,
|
|
469
|
+
D,
|
|
470
|
+
k,
|
|
471
|
+
!1,
|
|
472
|
+
null,
|
|
473
|
+
"538ddb41",
|
|
474
|
+
null,
|
|
475
|
+
null
|
|
476
|
+
);
|
|
477
|
+
const tt = I.exports;
|
|
478
|
+
export {
|
|
479
|
+
tt as N,
|
|
480
|
+
A as u
|
|
481
|
+
};
|