@nextcloud/vue 8.0.0-beta.8 → 8.0.0
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 +64 -2
- package/dist/Components/NcActionButton.cjs +22 -11
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +24 -12
- package/dist/Components/NcActionButton.mjs.map +1 -1
- package/dist/Components/NcActionInput.cjs +23 -18
- package/dist/Components/NcActionInput.cjs.map +1 -1
- package/dist/Components/NcActionInput.mjs +20 -14
- package/dist/Components/NcActionInput.mjs.map +1 -1
- package/dist/Components/NcActionLink.cjs +7 -7
- package/dist/Components/NcActionLink.cjs.map +1 -1
- package/dist/Components/NcActionLink.mjs +4 -4
- package/dist/Components/NcActionLink.mjs.map +1 -1
- package/dist/Components/NcActionRouter.cjs +8 -8
- package/dist/Components/NcActionRouter.cjs.map +1 -1
- package/dist/Components/NcActionRouter.mjs +4 -4
- package/dist/Components/NcActionRouter.mjs.map +1 -1
- package/dist/Components/NcActionText.cjs +10 -10
- package/dist/Components/NcActionText.cjs.map +1 -1
- package/dist/Components/NcActionText.mjs +11 -11
- package/dist/Components/NcActionText.mjs.map +1 -1
- package/dist/Components/NcActionTextEditable.cjs +10 -10
- package/dist/Components/NcActionTextEditable.cjs.map +1 -1
- package/dist/Components/NcActionTextEditable.mjs +2 -2
- package/dist/Components/NcActions.cjs +64 -57
- package/dist/Components/NcActions.cjs.map +1 -1
- package/dist/Components/NcActions.mjs +76 -69
- package/dist/Components/NcActions.mjs.map +1 -1
- package/dist/Components/NcAppContent.cjs +19 -20
- package/dist/Components/NcAppContent.cjs.map +1 -1
- package/dist/Components/NcAppContent.mjs +8 -8
- package/dist/Components/NcAppContent.mjs.map +1 -1
- package/dist/Components/NcAppNavigation.cjs +58 -27
- package/dist/Components/NcAppNavigation.cjs.map +1 -1
- package/dist/Components/NcAppNavigation.mjs +67 -34
- package/dist/Components/NcAppNavigation.mjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.cjs +167 -63
- package/dist/Components/NcAppNavigationItem.cjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +142 -40
- package/dist/Components/NcAppNavigationItem.mjs.map +1 -1
- package/dist/Components/NcAppNavigationNew.cjs +6 -6
- package/dist/Components/NcAppNavigationNew.cjs.map +1 -1
- package/dist/Components/NcAppNavigationNew.mjs +17 -17
- package/dist/Components/NcAppNavigationNew.mjs.map +1 -1
- package/dist/Components/NcAppNavigationNewItem.cjs +7 -7
- package/dist/Components/NcAppNavigationNewItem.cjs.map +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +5 -5
- package/dist/Components/NcAppNavigationNewItem.mjs.map +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +46 -14
- package/dist/Components/NcAppNavigationSettings.cjs.map +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +48 -16
- package/dist/Components/NcAppNavigationSettings.mjs.map +1 -1
- package/dist/Components/NcAppNavigationToggle.cjs +1 -1
- package/dist/Components/NcAppNavigationToggle.mjs +1 -1
- package/dist/Components/NcAppSettingsDialog.cjs +87 -117
- package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +95 -124
- package/dist/Components/NcAppSettingsDialog.mjs.map +1 -1
- package/dist/Components/NcAppSettingsSection.cjs +29 -10
- package/dist/Components/NcAppSettingsSection.cjs.map +1 -1
- package/dist/Components/NcAppSettingsSection.mjs +29 -10
- package/dist/Components/NcAppSettingsSection.mjs.map +1 -1
- package/dist/Components/NcAppSidebar.cjs +100 -34
- package/dist/Components/NcAppSidebar.cjs.map +1 -1
- package/dist/Components/NcAppSidebar.mjs +157 -93
- package/dist/Components/NcAppSidebar.mjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.cjs +7 -7
- package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.mjs +4 -4
- package/dist/Components/NcAppSidebarTab.mjs.map +1 -1
- package/dist/Components/NcAvatar.cjs +1 -1
- package/dist/Components/NcAvatar.mjs +1 -1
- package/dist/Components/NcBreadcrumb.cjs +10 -10
- package/dist/Components/NcBreadcrumb.cjs.map +1 -1
- package/dist/Components/NcBreadcrumb.mjs +1 -1
- package/dist/Components/NcBreadcrumbs.cjs +86 -54
- package/dist/Components/NcBreadcrumbs.cjs.map +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +93 -62
- package/dist/Components/NcBreadcrumbs.mjs.map +1 -1
- package/dist/Components/NcButton.cjs +25 -25
- package/dist/Components/NcButton.cjs.map +1 -1
- package/dist/Components/NcButton.mjs +25 -25
- package/dist/Components/NcButton.mjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +400 -54
- package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +398 -58
- package/dist/Components/NcCheckboxRadioSwitch.mjs.map +1 -1
- package/dist/Components/NcColorPicker.cjs +18 -18
- package/dist/Components/NcColorPicker.cjs.map +1 -1
- package/dist/Components/NcColorPicker.mjs +17 -17
- package/dist/Components/NcColorPicker.mjs.map +1 -1
- package/dist/Components/NcDashboardWidget.cjs +30 -30
- package/dist/Components/NcDashboardWidget.cjs.map +1 -1
- package/dist/Components/NcDashboardWidget.mjs +3 -3
- package/dist/Components/NcDashboardWidgetItem.cjs +11 -11
- package/dist/Components/NcDashboardWidgetItem.cjs.map +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +9 -9
- package/dist/Components/NcDashboardWidgetItem.mjs.map +1 -1
- package/dist/Components/NcDateTime.cjs +1 -1
- package/dist/Components/NcDateTime.mjs +1 -1
- package/dist/Components/NcDateTimePicker.cjs +109 -44
- package/dist/Components/NcDateTimePicker.cjs.map +1 -1
- package/dist/Components/NcDateTimePicker.mjs +115 -52
- package/dist/Components/NcDateTimePicker.mjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.cjs +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +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/NcEmojiPicker.cjs +1 -1
- package/dist/Components/NcEmojiPicker.mjs +1 -1
- package/dist/Components/NcEmptyContent.cjs +14 -14
- package/dist/Components/NcEmptyContent.cjs.map +1 -1
- package/dist/Components/NcEmptyContent.mjs +7 -7
- package/dist/Components/NcEmptyContent.mjs.map +1 -1
- package/dist/Components/NcIconSvgWrapper.cjs +29 -14
- package/dist/Components/NcIconSvgWrapper.cjs.map +1 -1
- package/dist/Components/NcIconSvgWrapper.mjs +32 -17
- package/dist/Components/NcIconSvgWrapper.mjs.map +1 -1
- package/dist/Components/NcInputField.cjs +16 -16
- package/dist/Components/NcInputField.cjs.map +1 -1
- package/dist/Components/NcInputField.mjs +5 -5
- package/dist/Components/NcInputField.mjs.map +1 -1
- package/dist/Components/NcListItem.cjs +3 -3
- package/dist/Components/NcListItem.cjs.map +1 -1
- package/dist/Components/NcListItem.mjs +3 -3
- package/dist/Components/NcListItem.mjs.map +1 -1
- package/dist/Components/NcListItemIcon.cjs +20 -12
- package/dist/Components/NcListItemIcon.cjs.map +1 -1
- package/dist/Components/NcListItemIcon.mjs +21 -13
- package/dist/Components/NcListItemIcon.mjs.map +1 -1
- package/dist/Components/NcModal.cjs +167 -72
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +171 -79
- package/dist/Components/NcModal.mjs.map +1 -1
- package/dist/Components/NcNoteCard.cjs +147 -19
- package/dist/Components/NcNoteCard.cjs.map +1 -1
- package/dist/Components/NcNoteCard.mjs +148 -23
- package/dist/Components/NcNoteCard.mjs.map +1 -1
- package/dist/Components/NcPasswordField.cjs +114 -39
- package/dist/Components/NcPasswordField.cjs.map +1 -1
- package/dist/Components/NcPasswordField.mjs +125 -52
- package/dist/Components/NcPasswordField.mjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +70 -37
- package/dist/Components/NcRelatedResourcesPanel.cjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +60 -27
- package/dist/Components/NcRelatedResourcesPanel.mjs.map +1 -1
- package/dist/Components/NcRichContenteditable.cjs +22 -18
- package/dist/Components/NcRichContenteditable.cjs.map +1 -1
- package/dist/Components/NcRichContenteditable.mjs +32 -28
- package/dist/Components/NcRichContenteditable.mjs.map +1 -1
- package/dist/Components/NcRichText.cjs +1 -1
- package/dist/Components/NcRichText.mjs +3 -3
- package/dist/Components/NcSelect.cjs +82 -54
- package/dist/Components/NcSelect.cjs.map +1 -1
- package/dist/Components/NcSelect.mjs +77 -47
- package/dist/Components/NcSelect.mjs.map +1 -1
- package/dist/Components/NcSelectTags.cjs +2 -2
- package/dist/Components/NcSelectTags.cjs.map +1 -1
- package/dist/Components/NcSelectTags.mjs +4 -4
- package/dist/Components/NcSelectTags.mjs.map +1 -1
- package/dist/Components/NcSettingsInputText.cjs +1 -1
- package/dist/Components/NcSettingsInputText.mjs +1 -1
- package/dist/Components/NcSettingsSection.cjs +46 -14
- package/dist/Components/NcSettingsSection.cjs.map +1 -1
- package/dist/Components/NcSettingsSection.mjs +44 -12
- package/dist/Components/NcSettingsSection.mjs.map +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +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 +79 -23
- package/dist/Components/NcTextField.cjs.map +1 -1
- package/dist/Components/NcTextField.mjs +82 -27
- package/dist/Components/NcTextField.mjs.map +1 -1
- package/dist/Components/NcTimezonePicker.cjs +26 -19
- package/dist/Components/NcTimezonePicker.cjs.map +1 -1
- package/dist/Components/NcTimezonePicker.mjs +31 -23
- package/dist/Components/NcTimezonePicker.mjs.map +1 -1
- package/dist/Components/NcUserBubble.cjs +24 -20
- package/dist/Components/NcUserBubble.cjs.map +1 -1
- package/dist/Components/NcUserBubble.mjs +25 -20
- package/dist/Components/NcUserBubble.mjs.map +1 -1
- package/dist/assets/{NcAppNavigationToggle-2cc5b864.css → NcAppNavigationToggle-9e170630.css} +3 -2
- package/dist/assets/{NcInputConfirmCancel-2ba60a52.css → NcInputConfirmCancel-45d1d76b.css} +7 -7
- package/dist/assets/{index-5072b6ee.css → index-05760fea.css} +16 -11
- package/dist/assets/{index-30e099f7.css → index-0ac09203.css} +3 -3
- package/dist/assets/{index-0ab8e182.css → index-0e9b11c7.css} +27 -22
- package/dist/assets/{index-1151d229.css → index-1f25a3c0.css} +3 -3
- package/dist/assets/{index-5eff69c7.css → index-2e5e3b55.css} +32 -30
- package/dist/assets/{index-03ec5f40.css → index-400b48a6.css} +7 -7
- package/dist/assets/{index-ed4adf1d.css → index-4271da53.css} +18 -17
- package/dist/assets/{index-33da80f0.css → index-4611417f.css} +8 -9
- package/dist/assets/{index-01e5adf4.css → index-55600948.css} +11 -11
- package/dist/assets/{index-c7905a53.css → index-57b305d3.css} +3 -3
- package/dist/assets/{index-de0326c7.css → index-5ee8a575.css} +69 -78
- package/dist/assets/index-6899d75b.css +150 -0
- package/dist/assets/{index-9354264c.css → index-6f721577.css} +16 -16
- package/dist/assets/{index-1beccc92.css → index-750c02cc.css} +28 -10
- package/dist/assets/{index-0557f12a.css → index-77a548be.css} +4 -4
- package/dist/assets/{index-fbdeb5ab.css → index-7d211db9.css} +11 -11
- package/dist/assets/{index-becfbea7.css → index-802d2118.css} +28 -23
- package/dist/assets/{index-a2d55f92.css → index-9176105d.css} +41 -41
- package/dist/assets/index-93bc89ef.css +197 -0
- package/dist/assets/{index-50b0766d.css → index-a0532427.css} +55 -70
- package/dist/assets/{index-6405cd50.css → index-ab715d82.css} +4 -4
- package/dist/assets/index-abb90c97.css +164 -0
- package/dist/assets/{index-23e64bbb.css → index-c221fe05.css} +9 -9
- package/dist/assets/{index-c6f0da2e.css → index-c239a2fc.css} +14 -8
- package/dist/assets/{index-fec4bb7b.css → index-d3702c91.css} +22 -17
- package/dist/assets/{index-194e9415.css → index-d5716ef0.css} +74 -59
- package/dist/assets/{index-4a775ba1.css → index-d812ed9e.css} +43 -43
- package/dist/assets/{index-793eae6b.css → index-d9ae9479.css} +6 -6
- package/dist/assets/{index-1cf8eeb4.css → index-db5a8b1c.css} +26 -33
- package/dist/assets/index-dc612aa3.css +112 -0
- package/dist/assets/{index-294382c8.css → index-e1a7aa6f.css} +43 -38
- package/dist/assets/{index-376d2dec.css → index-e7c55791.css} +67 -67
- package/dist/assets/{index-165fce0e.css → index-e7eadba7.css} +13 -13
- package/dist/assets/{index-0adc989c.css → index-ebbb7829.css} +9 -13
- package/dist/assets/{referencePickerModal-0acecb5e.css → referencePickerModal-3a127978.css} +55 -55
- package/dist/chunks/AlertCircleOutline-7085c10f.cjs +35 -0
- package/dist/chunks/AlertCircleOutline-7085c10f.cjs.map +1 -0
- package/dist/chunks/AlertCircleOutline-b73838e0.mjs +37 -0
- package/dist/chunks/AlertCircleOutline-b73838e0.mjs.map +1 -0
- package/dist/chunks/ArrowLeft-2f9b9323.cjs +35 -0
- package/dist/chunks/ArrowLeft-2f9b9323.cjs.map +1 -0
- package/dist/chunks/ArrowLeft-3779ba88.mjs +37 -0
- package/dist/chunks/ArrowLeft-3779ba88.mjs.map +1 -0
- package/dist/chunks/ArrowRight-7315f6c1.cjs +35 -0
- package/dist/chunks/ArrowRight-7315f6c1.cjs.map +1 -0
- package/dist/chunks/ArrowRight-74a9fcb2.mjs +37 -0
- package/dist/chunks/ArrowRight-74a9fcb2.mjs.map +1 -0
- package/dist/chunks/Check-2ea0a88a.mjs +37 -0
- package/dist/chunks/Check-2ea0a88a.mjs.map +1 -0
- package/dist/chunks/Check-be8cd6af.cjs +35 -0
- package/dist/chunks/Check-be8cd6af.cjs.map +1 -0
- package/dist/chunks/ChevronDown-a72d365d.mjs +37 -0
- package/dist/chunks/ChevronDown-a72d365d.mjs.map +1 -0
- package/dist/chunks/ChevronDown-dc32e51d.cjs +35 -0
- package/dist/chunks/ChevronDown-dc32e51d.cjs.map +1 -0
- package/dist/chunks/ChevronRight-1a6a6cf2.mjs +37 -0
- package/dist/chunks/ChevronRight-1a6a6cf2.mjs.map +1 -0
- package/dist/chunks/ChevronRight-a4c1e0d3.cjs +35 -0
- package/dist/chunks/ChevronRight-a4c1e0d3.cjs.map +1 -0
- package/dist/chunks/Close-271f72e2.mjs +37 -0
- package/dist/chunks/Close-271f72e2.mjs.map +1 -0
- package/dist/chunks/Close-98cb6f12.cjs +35 -0
- package/dist/chunks/Close-98cb6f12.cjs.map +1 -0
- package/dist/chunks/DotsHorizontal-0ee7d901.mjs +37 -0
- package/dist/chunks/DotsHorizontal-0ee7d901.mjs.map +1 -0
- package/dist/chunks/DotsHorizontal-ac96129a.cjs +35 -0
- package/dist/chunks/DotsHorizontal-ac96129a.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationToggle-364eb664.cjs +113 -0
- package/dist/chunks/NcAppNavigationToggle-364eb664.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationToggle-cd2ef112.mjs +118 -0
- package/dist/chunks/NcAppNavigationToggle-cd2ef112.mjs.map +1 -0
- package/dist/chunks/{NcInputConfirmCancel-f881168d.mjs → NcInputConfirmCancel-304f0b74.mjs} +22 -15
- package/dist/chunks/NcInputConfirmCancel-304f0b74.mjs.map +1 -0
- package/dist/chunks/NcInputConfirmCancel-c873bb9b.cjs +90 -0
- package/dist/chunks/NcInputConfirmCancel-c873bb9b.cjs.map +1 -0
- package/dist/chunks/{NcRichText-1c3d2654.mjs → NcRichText-25edeb8e.mjs} +9 -9
- package/dist/chunks/{NcRichText-d385dc10.cjs.map → NcRichText-25edeb8e.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-d385dc10.cjs → NcRichText-dcb4fb97.cjs} +2 -2
- package/dist/chunks/{NcRichText-1c3d2654.mjs.map → NcRichText-dcb4fb97.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-47d9c113.cjs → NcSettingsSelectGroup-d639533d.cjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-47d9c113.cjs.map → NcSettingsSelectGroup-d639533d.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-0f4a0f94.mjs → NcSettingsSelectGroup-fd91d31a.mjs} +2 -2
- package/dist/chunks/{NcSettingsSelectGroup-0f4a0f94.mjs.map → NcSettingsSelectGroup-fd91d31a.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-97a014a1.mjs → ScopeComponent-5b9e60d8.mjs} +3 -3
- package/dist/chunks/{ScopeComponent-97a014a1.mjs.map → ScopeComponent-5b9e60d8.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-1c75ec38.cjs → ScopeComponent-dfa5ec75.cjs} +1 -1
- package/dist/chunks/{ScopeComponent-1c75ec38.cjs.map → ScopeComponent-dfa5ec75.cjs.map} +1 -1
- package/dist/chunks/{actionText-b0bd6eb7.cjs → actionText-54bc24a6.cjs} +1 -1
- package/dist/chunks/{actionText-9f5c55bd.mjs.map → actionText-54bc24a6.cjs.map} +1 -1
- package/dist/chunks/{actionText-9f5c55bd.mjs → actionText-a64be267.mjs} +1 -1
- package/dist/chunks/{actionText-b0bd6eb7.cjs.map → actionText-a64be267.mjs.map} +1 -1
- package/dist/chunks/{index-2a5b8ace.cjs → index-343ecbe5.cjs} +98 -55
- package/dist/chunks/index-343ecbe5.cjs.map +1 -0
- package/dist/chunks/{index-6c221fa0.mjs → index-a01ff595.mjs} +143 -100
- package/dist/chunks/index-a01ff595.mjs.map +1 -0
- package/dist/chunks/{l10n-4326316a.cjs → l10n-9321b50d.cjs} +1 -1
- package/dist/chunks/{l10n-4326316a.cjs.map → l10n-9321b50d.cjs.map} +1 -1
- package/dist/chunks/l10n-9f3afaf5.cjs +29 -0
- package/dist/chunks/l10n-9f3afaf5.cjs.map +1 -0
- package/dist/chunks/l10n-b6d21146.mjs +31 -0
- package/dist/chunks/l10n-b6d21146.mjs.map +1 -0
- package/dist/chunks/{l10n-c5f5f001.mjs → l10n-bef4ea85.mjs} +1 -1
- package/dist/chunks/{l10n-c5f5f001.mjs.map → l10n-bef4ea85.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-0fde503d.mjs → referencePickerModal-58498cac.mjs} +157 -125
- package/dist/chunks/referencePickerModal-58498cac.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-9b4ff88d.cjs → referencePickerModal-a739a17b.cjs} +145 -112
- package/dist/chunks/referencePickerModal-a739a17b.cjs.map +1 -0
- package/dist/index.cjs +105 -103
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +138 -133
- package/dist/index.mjs.map +1 -1
- package/dist/vendor.LICENSE.txt +5 -1
- package/package.json +8 -5
- package/dist/assets/index-7768d5e5.css +0 -148
- package/dist/assets/index-d646553d.css +0 -41
- package/dist/chunks/NcAppNavigationToggle-960658a0.cjs +0 -49
- package/dist/chunks/NcAppNavigationToggle-960658a0.cjs.map +0 -1
- package/dist/chunks/NcAppNavigationToggle-d868f651.mjs +0 -55
- package/dist/chunks/NcAppNavigationToggle-d868f651.mjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-0c4bee9a.cjs +0 -83
- package/dist/chunks/NcInputConfirmCancel-0c4bee9a.cjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-f881168d.mjs.map +0 -1
- package/dist/chunks/index-2a5b8ace.cjs.map +0 -1
- package/dist/chunks/index-6c221fa0.mjs.map +0 -1
- package/dist/chunks/l10n-27a75c40.mjs +0 -31
- package/dist/chunks/l10n-27a75c40.mjs.map +0 -1
- package/dist/chunks/l10n-903083c4.cjs +0 -29
- package/dist/chunks/l10n-903083c4.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-0fde503d.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-9b4ff88d.cjs.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { t as O } from "../chunks/l10n-
|
|
1
|
+
import { t as O } from "../chunks/l10n-b6d21146.mjs";
|
|
2
2
|
import { l as t } from "../chunks/logger-3612e664.mjs";
|
|
3
|
-
import { getTimezoneManager as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { getTimezoneManager as e } from "@nextcloud/calendar-js";
|
|
4
|
+
import { G as Z } from "../chunks/GenRandomId-cb9ccebe.mjs";
|
|
5
|
+
import Y from "./NcSelect.mjs";
|
|
6
|
+
import { n as M } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
6
7
|
/**
|
|
7
8
|
* @copyright Copyright (c) 2019 Georg Ehrke
|
|
8
9
|
*
|
|
@@ -24,7 +25,7 @@ import { n as Y } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
|
24
25
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
25
26
|
*
|
|
26
27
|
*/
|
|
27
|
-
function
|
|
28
|
+
function l(T = [], n = []) {
|
|
28
29
|
const A = {}, r = [];
|
|
29
30
|
for (const E of T) {
|
|
30
31
|
const D = E.split("/");
|
|
@@ -56,7 +57,7 @@ function M(T = [], n = []) {
|
|
|
56
57
|
function i(T) {
|
|
57
58
|
return T.split("_").join(" ").replace("St ", "St. ").split("/").join(" - ");
|
|
58
59
|
}
|
|
59
|
-
const
|
|
60
|
+
const B = "2.2019c", u = {
|
|
60
61
|
"AUS Central Standard Time": {
|
|
61
62
|
aliasTo: "Australia/Darwin"
|
|
62
63
|
},
|
|
@@ -459,7 +460,7 @@ const l = "2.2019c", B = {
|
|
|
459
460
|
utc: {
|
|
460
461
|
aliasTo: "UTC"
|
|
461
462
|
}
|
|
462
|
-
},
|
|
463
|
+
}, d = {
|
|
463
464
|
"Africa/Abidjan": {
|
|
464
465
|
ics: [
|
|
465
466
|
`BEGIN:STANDARD\r
|
|
@@ -7049,9 +7050,9 @@ END:STANDARD`
|
|
|
7049
7050
|
longitude: "-1761000"
|
|
7050
7051
|
}
|
|
7051
7052
|
}, R = {
|
|
7052
|
-
version:
|
|
7053
|
-
aliases:
|
|
7054
|
-
zones:
|
|
7053
|
+
version: B,
|
|
7054
|
+
aliases: u,
|
|
7055
|
+
zones: d
|
|
7055
7056
|
};
|
|
7056
7057
|
/**
|
|
7057
7058
|
* @copyright Copyright (c) 2019 Georg Ehrke
|
|
@@ -7074,12 +7075,12 @@ END:STANDARD`
|
|
|
7074
7075
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
7075
7076
|
*
|
|
7076
7077
|
*/
|
|
7077
|
-
const N =
|
|
7078
|
+
const N = e();
|
|
7078
7079
|
let a = !1;
|
|
7079
|
-
function d() {
|
|
7080
|
-
return a || o(), N;
|
|
7081
|
-
}
|
|
7082
7080
|
function o() {
|
|
7081
|
+
return a || s(), N;
|
|
7082
|
+
}
|
|
7083
|
+
function s() {
|
|
7083
7084
|
t.debug(`Using version ${R.version} of the timezone database`);
|
|
7084
7085
|
for (const T in R.zones)
|
|
7085
7086
|
if (Object.prototype.hasOwnProperty.call(R.zones, [T])) {
|
|
@@ -7096,10 +7097,10 @@ function o() {
|
|
|
7096
7097
|
Object.prototype.hasOwnProperty.call(R.aliases, [T]) && N.registerAlias(T, R.aliases[T].aliasTo);
|
|
7097
7098
|
a = !0;
|
|
7098
7099
|
}
|
|
7099
|
-
const
|
|
7100
|
+
const c = {
|
|
7100
7101
|
name: "NcTimezonePicker",
|
|
7101
7102
|
components: {
|
|
7102
|
-
NcSelect:
|
|
7103
|
+
NcSelect: Y
|
|
7103
7104
|
},
|
|
7104
7105
|
props: {
|
|
7105
7106
|
/**
|
|
@@ -7115,6 +7116,13 @@ const s = {
|
|
|
7115
7116
|
value: {
|
|
7116
7117
|
type: String,
|
|
7117
7118
|
default: "floating"
|
|
7119
|
+
},
|
|
7120
|
+
/**
|
|
7121
|
+
* ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`
|
|
7122
|
+
*/
|
|
7123
|
+
uid: {
|
|
7124
|
+
type: [String, Number],
|
|
7125
|
+
default: () => `tz-${Z(5)}`
|
|
7118
7126
|
}
|
|
7119
7127
|
},
|
|
7120
7128
|
emits: ["input"],
|
|
@@ -7132,7 +7140,7 @@ const s = {
|
|
|
7132
7140
|
};
|
|
7133
7141
|
},
|
|
7134
7142
|
options() {
|
|
7135
|
-
const T =
|
|
7143
|
+
const T = o(), n = l(T.listAllTimezones(), this.additionalTimezones);
|
|
7136
7144
|
let A = [];
|
|
7137
7145
|
return Object.values(n).forEach((r) => {
|
|
7138
7146
|
A.push({
|
|
@@ -7175,20 +7183,20 @@ const s = {
|
|
|
7175
7183
|
}
|
|
7176
7184
|
}
|
|
7177
7185
|
};
|
|
7178
|
-
var
|
|
7186
|
+
var I = function() {
|
|
7179
7187
|
var n = this, A = n._self._c;
|
|
7180
|
-
return A("NcSelect", { attrs: {
|
|
7181
|
-
},
|
|
7182
|
-
s,
|
|
7188
|
+
return A("NcSelect", { attrs: { "aria-label-combobox": n.t("Search for time zone"), clearable: !1, "filter-by": n.filterBy, multiple: !1, options: n.options, placeholder: n.placeholder, selectable: n.isSelectable, uid: n.uid, value: n.selectedTimezone, label: "label" }, on: { "option:selected": n.change } });
|
|
7189
|
+
}, G = [], L = /* @__PURE__ */ M(
|
|
7183
7190
|
c,
|
|
7184
7191
|
I,
|
|
7192
|
+
G,
|
|
7185
7193
|
!1,
|
|
7186
7194
|
null,
|
|
7187
7195
|
null,
|
|
7188
7196
|
null,
|
|
7189
7197
|
null
|
|
7190
7198
|
);
|
|
7191
|
-
const
|
|
7199
|
+
const f = L.exports;
|
|
7192
7200
|
export {
|
|
7193
|
-
|
|
7201
|
+
f as default
|
|
7194
7202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcTimezonePicker.mjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\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 */\nimport { t } from '../../l10n.js'\n\n/**\n *\n * @param {string[]} timezoneList List of Olsen timezones\n * @param {Array} additionalTimezones List of additional timezones\n * @return {Array}\n */\nexport function getSortedTimezoneList(timezoneList = [], additionalTimezones = []) {\n\tconst sortedByContinent = {}\n\tconst sortedList = []\n\n\tfor (const timezoneId of timezoneList) {\n\t\tconst components = timezoneId.split('/')\n\t\tlet [continent, name] = [components.shift(), components.join('/')]\n\t\tif (!name) {\n\t\t\tname = continent\n\t\t\t// TRANSLATORS This refers to global timezones in the timezone picker\n\t\t\tcontinent = t('Global')\n\t\t}\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel: getReadableTimezoneName(name),\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const additionalTimezone of additionalTimezones) {\n\t\tconst { continent, label, timezoneId } = additionalTimezone\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel,\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const continent in sortedByContinent) {\n\t\tif (!Object.prototype.hasOwnProperty.call(sortedByContinent, continent)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsortedByContinent[continent].regions.sort((a, b) => {\n\t\t\tif (a.label < b.label) {\n\t\t\t\treturn -1\n\t\t\t}\n\n\t\t\treturn 1\n\t\t})\n\t\tsortedList.push(sortedByContinent[continent])\n\t}\n\n\t// Sort continents by name\n\tsortedList.sort((a, b) => {\n\t\tif (a.continent < b.continent) {\n\t\t\treturn -1\n\t\t}\n\n\t\treturn 1\n\t})\n\n\treturn sortedList\n}\n\n/**\n * Get human-readable name for timezoneId\n *\n * @param {string} timezoneId TimezoneId to turn human-readable\n * @return {string}\n */\nexport function getReadableTimezoneName(timezoneId) {\n\treturn timezoneId\n\t\t.split('_')\n\t\t.join(' ')\n\t\t.replace('St ', 'St. ')\n\t\t.split('/')\n\t\t.join(' - ')\n}\n","/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\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 */\nimport tzData from '../../../resources/timezones/zones.json'\nimport logger from '../../utils/logger.js'\n\nimport { getTimezoneManager } from '@nextcloud/calendar-js'\n\nconst timezoneManager = getTimezoneManager()\nlet initialized = false\n\n/**\n * Gets the timezone-manager\n * initializes it if necessary\n *\n * @return {object}\n */\nexport default function() {\n\tif (!initialized) {\n\t\tinitialize()\n\t}\n\n\treturn timezoneManager\n}\n\n/**\n * Initializes the timezone-manager with all timezones shipped by the calendar app\n */\nfunction initialize() {\n\tlogger.debug(`Using version ${tzData.version} of the timezone database`)\n\n\tfor (const tzid in tzData.zones) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.zones, [tzid])) {\n\t\t\tconst ics = [\n\t\t\t\t'BEGIN:VTIMEZONE',\n\t\t\t\t'TZID:' + tzid,\n\t\t\t\t...tzData.zones[tzid].ics,\n\t\t\t\t'END:VTIMEZONE',\n\t\t\t].join('\\r\\n')\n\t\t\ttimezoneManager.registerTimezoneFromICS(tzid, ics)\n\t\t}\n\t}\n\n\tfor (const tzid in tzData.aliases) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.aliases, [tzid])) {\n\t\t\ttimezoneManager.registerAlias(tzid, tzData.aliases[tzid].aliasTo)\n\t\t}\n\t}\n\n\tinitialized = true\n}\n","<!--\n - @copyright Copyright (c) 2021 Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @author Christoph Wurst <christoph@winzerhof-wurst.at>\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### Example\n```vue\n<template>\n\t<span>\n\t\t<NcTimezonePicker v-model=\"tz\" />\n\t</span>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttz: 'Hawaiian Standard Time',\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcSelect :value=\"selectedTimezone\"\n\t\t:options=\"options\"\n\t\t:multiple=\"false\"\n\t\t:clearable=\"false\"\n\t\t:placeholder=\"placeholder\"\n\t\t:selectable=\"isSelectable\"\n\t\t:filter-by=\"filterBy\"\n\t\tlabel=\"label\"\n\t\t@option:selected=\"change\" />\n</template>\n\n<script>\nimport {\n\tgetReadableTimezoneName,\n\tgetSortedTimezoneList,\n} from './timezone.js'\nimport getTimezoneManager from './timezoneDataProviderService.js'\nimport NcSelect from '../NcSelect/index.js'\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tprops: {\n\t\t/**\n\t\t * An array of additional timezones to include with the standard database. Useful if there is a custom timezone, e.g. read from user data\n\t\t */\n\t\tadditionalTimezones: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t/**\n\t\t * The selected timezone. Use v-model for two-way binding. The default timezone is floating, which means a time independent of timezone. See https://icalendar.org/CalDAV-Access-RFC-4791/7-3-date-and-floating-time.html for details.\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: 'floating',\n\t\t},\n\t},\n\temits: ['input'],\n\tcomputed: {\n\t\tplaceholder() {\n\t\t\treturn t('Type to search time zone')\n\t\t},\n\t\tselectedTimezone() {\n\t\t\tfor (const additionalTimezone of this.additionalTimezones) {\n\t\t\t\tif (additionalTimezone.timezoneId === this.value) {\n\t\t\t\t\treturn additionalTimezone\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel: getReadableTimezoneName(this.value),\n\t\t\t\ttimezoneId: this.value,\n\t\t\t}\n\t\t},\n\t\toptions() {\n\t\t\tconst timezoneManager = getTimezoneManager()\n\t\t\tconst timezoneList = getSortedTimezoneList(timezoneManager.listAllTimezones(), this.additionalTimezones)\n\t\t\t/**\n\t\t\t * Since NcSelect does not support groups,\n\t\t\t * we create an object with the grouped timezones and continent labels.\n\t\t\t */\n\t\t\tlet timezonesGrouped = []\n\t\t\tObject.values(timezoneList).forEach(group => {\n\t\t\t\t// Add an entry as group label\n\t\t\t\ttimezonesGrouped.push({\n\t\t\t\t\tlabel: group.continent,\n\t\t\t\t\ttimezoneId: `tz-group__${group.continent}`,\n\t\t\t\t\tregions: group.regions,\n\t\t\t\t})\n\t\t\t\ttimezonesGrouped = timezonesGrouped.concat(group.regions)\n\t\t\t})\n\t\t\treturn timezonesGrouped\n\t\t},\n\t},\n\tmethods: {\n\t\tchange(newValue) {\n\t\t\tif (!newValue) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t\t */\n\t\t\tthis.$emit('input', newValue.timezoneId)\n\t\t},\n\n\t\t/**\n\t\t * Returns whether this is a continent label,\n\t\t * or an actual timezone. Continent labels are not selectable.\n\t\t *\n\t\t * @param {string} option The option\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelectable(option) {\n\t\t\treturn !option.timezoneId.startsWith('tz-group__')\n\t\t},\n\n\t\t/**\n\t\t * Function to filter the timezone list.\n\t\t * We search in the timezoneId, so both continent and region names can be matched.\n\t\t *\n\t\t * @param {object} option The timezone option\n\t\t * @param {string} label The label of the timezone\n\t\t * @param {string} search The search string\n\t\t * @return {boolean}\n\t\t */\n\t\tfilterBy(option, label, search) {\n\t\t\t// We split the search term in case one searches \"<continent> <region>\".\n\t\t\tconst terms = search.trim().split(' ')\n\n\t\t\t// For the continent labels, we have to check if one region matches every search term.\n\t\t\tif (option.timezoneId.startsWith('tz-group__')) {\n\t\t\t\treturn option.regions.some(region => {\n\t\t\t\t\treturn this.matchTimezoneId(region.timezoneId, terms)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// For a region, every search term must be found.\n\t\t\treturn this.matchTimezoneId(option.timezoneId, terms)\n\t\t},\n\n\t\tmatchTimezoneId(timezoneId, terms) {\n\t\t\treturn terms.every(term => timezoneId.toLowerCase().includes(term.toLowerCase()))\n\t\t},\n\t},\n}\n</script>\n"],"names":["getSortedTimezoneList","timezoneList","additionalTimezones","sortedByContinent","sortedList","timezoneId","components","continent","name","t","getReadableTimezoneName","additionalTimezone","label","a","b","timezoneManager","getTimezoneManager","initialized","initialize","logger","tzData","tzid","ics","_sfc_main","NcSelect","timezonesGrouped","group","newValue","option","search","terms","region","term"],"mappings":";;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,SAASA,EAAsBC,IAAe,IAAIC,IAAsB,CAAA,GAAI;AAClF,QAAMC,IAAoB,CAAE,GACtBC,IAAa,CAAE;AAErB,aAAWC,KAAcJ,GAAc;AACtC,UAAMK,IAAaD,EAAW,MAAM,GAAG;AACvC,QAAI,CAACE,GAAWC,CAAI,IAAI,CAACF,EAAW,MAAK,GAAIA,EAAW,KAAK,GAAG,CAAC;AACjE,IAAKE,MACJA,IAAOD,GAEPA,IAAYE,EAAE,QAAQ,IAGvBN,EAAkBI,CAAS,IAAIJ,EAAkBI,CAAS,KAAK;AAAA,MAC9D,WAAAA;AAAA,MACA,SAAS,CAAE;AAAA,IACX,GAEDJ,EAAkBI,CAAS,EAAE,QAAQ,KAAK;AAAA,MACzC,OAAOG,EAAwBF,CAAI;AAAA,MACnC,QAAQ,CAAE;AAAA,MACV,YAAAH;AAAA,IACH,CAAG;AAAA,EACD;AAED,aAAWM,KAAsBT,GAAqB;AACrD,UAAM,EAAE,WAAAK,GAAW,OAAAK,GAAO,YAAAP,EAAY,IAAGM;AAEzC,IAAAR,EAAkBI,CAAS,IAAIJ,EAAkBI,CAAS,KAAK;AAAA,MAC9D,WAAAA;AAAA,MACA,SAAS,CAAE;AAAA,IACX,GAEDJ,EAAkBI,CAAS,EAAE,QAAQ,KAAK;AAA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A,QAAA,KAAA,CAAAG,MACA,KAAA,gBAAAA,EAAA,YAAAD,CAAA,CACA,IAIA,KAAA,gBAAAF,EAAA,YAAAE,CAAA;AAAA,IACA;AAAA,IAEA,gBAAAzB,GAAAyB,GAAA;AACA,aAAAA,EAAA,MAAA,CAAAE,MAAA3B,EAAA,YAAA,EAAA,SAAA2B,EAAA,YAAA,CAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcTimezonePicker.mjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\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 */\nimport { t } from '../../l10n.js'\n\n/**\n *\n * @param {string[]} timezoneList List of Olsen timezones\n * @param {Array} additionalTimezones List of additional timezones\n * @return {Array}\n */\nexport function getSortedTimezoneList(timezoneList = [], additionalTimezones = []) {\n\tconst sortedByContinent = {}\n\tconst sortedList = []\n\n\tfor (const timezoneId of timezoneList) {\n\t\tconst components = timezoneId.split('/')\n\t\tlet [continent, name] = [components.shift(), components.join('/')]\n\t\tif (!name) {\n\t\t\tname = continent\n\t\t\t// TRANSLATORS This refers to global timezones in the timezone picker\n\t\t\tcontinent = t('Global')\n\t\t}\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel: getReadableTimezoneName(name),\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const additionalTimezone of additionalTimezones) {\n\t\tconst { continent, label, timezoneId } = additionalTimezone\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel,\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const continent in sortedByContinent) {\n\t\tif (!Object.prototype.hasOwnProperty.call(sortedByContinent, continent)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsortedByContinent[continent].regions.sort((a, b) => {\n\t\t\tif (a.label < b.label) {\n\t\t\t\treturn -1\n\t\t\t}\n\n\t\t\treturn 1\n\t\t})\n\t\tsortedList.push(sortedByContinent[continent])\n\t}\n\n\t// Sort continents by name\n\tsortedList.sort((a, b) => {\n\t\tif (a.continent < b.continent) {\n\t\t\treturn -1\n\t\t}\n\n\t\treturn 1\n\t})\n\n\treturn sortedList\n}\n\n/**\n * Get human-readable name for timezoneId\n *\n * @param {string} timezoneId TimezoneId to turn human-readable\n * @return {string}\n */\nexport function getReadableTimezoneName(timezoneId) {\n\treturn timezoneId\n\t\t.split('_')\n\t\t.join(' ')\n\t\t.replace('St ', 'St. ')\n\t\t.split('/')\n\t\t.join(' - ')\n}\n","/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\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 */\nimport tzData from '../../../resources/timezones/zones.json'\nimport logger from '../../utils/logger.js'\n\nimport { getTimezoneManager } from '@nextcloud/calendar-js'\n\nconst timezoneManager = getTimezoneManager()\nlet initialized = false\n\n/**\n * Gets the timezone-manager\n * initializes it if necessary\n *\n * @return {object}\n */\nexport default function() {\n\tif (!initialized) {\n\t\tinitialize()\n\t}\n\n\treturn timezoneManager\n}\n\n/**\n * Initializes the timezone-manager with all timezones shipped by the calendar app\n */\nfunction initialize() {\n\tlogger.debug(`Using version ${tzData.version} of the timezone database`)\n\n\tfor (const tzid in tzData.zones) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.zones, [tzid])) {\n\t\t\tconst ics = [\n\t\t\t\t'BEGIN:VTIMEZONE',\n\t\t\t\t'TZID:' + tzid,\n\t\t\t\t...tzData.zones[tzid].ics,\n\t\t\t\t'END:VTIMEZONE',\n\t\t\t].join('\\r\\n')\n\t\t\ttimezoneManager.registerTimezoneFromICS(tzid, ics)\n\t\t}\n\t}\n\n\tfor (const tzid in tzData.aliases) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.aliases, [tzid])) {\n\t\t\ttimezoneManager.registerAlias(tzid, tzData.aliases[tzid].aliasTo)\n\t\t}\n\t}\n\n\tinitialized = true\n}\n","<!--\n - @copyright Copyright (c) 2021 Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @author Christoph Wurst <christoph@winzerhof-wurst.at>\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### Example\n```vue\n<template>\n\t<span>\n\t\t<NcTimezonePicker v-model=\"tz\" />\n\t</span>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttz: 'Hawaiian Standard Time',\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcSelect :aria-label-combobox=\"t('Search for time zone')\"\n\t\t:clearable=\"false\"\n\t\t:filter-by=\"filterBy\"\n\t\t:multiple=\"false\"\n\t\t:options=\"options\"\n\t\t:placeholder=\"placeholder\"\n\t\t:selectable=\"isSelectable\"\n\t\t:uid=\"uid\"\n\t\t:value=\"selectedTimezone\"\n\t\tlabel=\"label\"\n\t\t@option:selected=\"change\" />\n</template>\n\n<script>\nimport {\n\tgetReadableTimezoneName,\n\tgetSortedTimezoneList,\n} from './timezone.js'\nimport getTimezoneManager from './timezoneDataProviderService.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\nimport NcSelect from '../NcSelect/index.js'\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tprops: {\n\t\t/**\n\t\t * An array of additional timezones to include with the standard database. Useful if there is a custom timezone, e.g. read from user data\n\t\t */\n\t\tadditionalTimezones: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t/**\n\t\t * The selected timezone. Use v-model for two-way binding. The default timezone is floating, which means a time independent of timezone. See https://icalendar.org/CalDAV-Access-RFC-4791/7-3-date-and-floating-time.html for details.\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: 'floating',\n\t\t},\n\t\t/**\n\t\t * ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`\n\t\t */\n\t\tuid: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: () => `tz-${GenRandomId(5)}`,\n\t\t},\n\t},\n\temits: ['input'],\n\tcomputed: {\n\t\tplaceholder() {\n\t\t\treturn t('Type to search time zone')\n\t\t},\n\t\tselectedTimezone() {\n\t\t\tfor (const additionalTimezone of this.additionalTimezones) {\n\t\t\t\tif (additionalTimezone.timezoneId === this.value) {\n\t\t\t\t\treturn additionalTimezone\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel: getReadableTimezoneName(this.value),\n\t\t\t\ttimezoneId: this.value,\n\t\t\t}\n\t\t},\n\t\toptions() {\n\t\t\tconst timezoneManager = getTimezoneManager()\n\t\t\tconst timezoneList = getSortedTimezoneList(timezoneManager.listAllTimezones(), this.additionalTimezones)\n\t\t\t/**\n\t\t\t * Since NcSelect does not support groups,\n\t\t\t * we create an object with the grouped timezones and continent labels.\n\t\t\t */\n\t\t\tlet timezonesGrouped = []\n\t\t\tObject.values(timezoneList).forEach(group => {\n\t\t\t\t// Add an entry as group label\n\t\t\t\ttimezonesGrouped.push({\n\t\t\t\t\tlabel: group.continent,\n\t\t\t\t\ttimezoneId: `tz-group__${group.continent}`,\n\t\t\t\t\tregions: group.regions,\n\t\t\t\t})\n\t\t\t\ttimezonesGrouped = timezonesGrouped.concat(group.regions)\n\t\t\t})\n\t\t\treturn timezonesGrouped\n\t\t},\n\t},\n\tmethods: {\n\t\tchange(newValue) {\n\t\t\tif (!newValue) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t\t */\n\t\t\tthis.$emit('input', newValue.timezoneId)\n\t\t},\n\n\t\t/**\n\t\t * Returns whether this is a continent label,\n\t\t * or an actual timezone. Continent labels are not selectable.\n\t\t *\n\t\t * @param {string} option The option\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelectable(option) {\n\t\t\treturn !option.timezoneId.startsWith('tz-group__')\n\t\t},\n\n\t\t/**\n\t\t * Function to filter the timezone list.\n\t\t * We search in the timezoneId, so both continent and region names can be matched.\n\t\t *\n\t\t * @param {object} option The timezone option\n\t\t * @param {string} label The label of the timezone\n\t\t * @param {string} search The search string\n\t\t * @return {boolean}\n\t\t */\n\t\tfilterBy(option, label, search) {\n\t\t\t// We split the search term in case one searches \"<continent> <region>\".\n\t\t\tconst terms = search.trim().split(' ')\n\n\t\t\t// For the continent labels, we have to check if one region matches every search term.\n\t\t\tif (option.timezoneId.startsWith('tz-group__')) {\n\t\t\t\treturn option.regions.some(region => {\n\t\t\t\t\treturn this.matchTimezoneId(region.timezoneId, terms)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// For a region, every search term must be found.\n\t\t\treturn this.matchTimezoneId(option.timezoneId, terms)\n\t\t},\n\n\t\tmatchTimezoneId(timezoneId, terms) {\n\t\t\treturn terms.every(term => timezoneId.toLowerCase().includes(term.toLowerCase()))\n\t\t},\n\t},\n}\n</script>\n"],"names":["getSortedTimezoneList","timezoneList","additionalTimezones","sortedByContinent","sortedList","timezoneId","components","continent","name","t","getReadableTimezoneName","additionalTimezone","label","a","b","timezoneManager","getTimezoneManager","initialized","initialize","logger","tzData","tzid","ics","_sfc_main","NcSelect","GenRandomId","timezonesGrouped","group","newValue","option","search","terms","region","term"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,SAASA,EAAsBC,IAAe,IAAIC,IAAsB,CAAA,GAAI;AAClF,QAAMC,IAAoB,CAAE,GACtBC,IAAa,CAAE;AAErB,aAAWC,KAAcJ,GAAc;AACtC,UAAMK,IAAaD,EAAW,MAAM,GAAG;AACvC,QAAI,CAACE,GAAWC,CAAI,IAAI,CAACF,EAAW,MAAK,GAAIA,EAAW,KAAK,GAAG,CAAC;AACjE,IAAKE,MACJA,IAAOD,GAEPA,IAAYE,EAAE,QAAQ,IAG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,MAAA;AAEA,QAAAD,EAAA,KAAA;AAAA,UACA,OAAAC,EAAA;AAAA,UACA,YAAA,aAAAA,EAAA,SAAA;AAAA,UACA,SAAAA,EAAA;AAAA,QACA,CAAA,GACAD,IAAAA,EAAA,OAAAC,EAAA,OAAA;AAAA,MACA,CAAA,GACAD;AAAA,IACA;AAAA,EACA;AAAA,EACA,SAAA;AAAA,IACA,OAAAE,GAAA;AACA,MAAAA,KAOA,KAAA,MAAA,SAAAA,EAAA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAAC,GAAA;AACA,aAAA,CAAAA,EAAA,WAAA,WAAA,YAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,SAAAA,GAAAjB,GAAAkB,GAAA;AAEA,YAAAC,IAAAD,EAAA,KAAA,EAAA,MAAA,GAAA;AAGA,aAAAD,EAAA,WAAA,WAAA,YAAA,IACAA,EAAA,QAAA,KAAA,CAAAG,MACA,KAAA,gBAAAA,EAAA,YAAAD,CAAA,CACA,IAIA,KAAA,gBAAAF,EAAA,YAAAE,CAAA;AAAA,IACA;AAAA,IAEA,gBAAA1B,GAAA0B,GAAA;AACA,aAAAA,EAAA,MAAA,CAAAE,MAAA5B,EAAA,YAAA,EAAA,SAAA4B,EAAA,YAAA,CAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var y = require("../assets/index-c221fe05.css");
|
|
2
|
+
const s = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), a = require("../chunks/index-343ecbe5.cjs"), n = require("./NcPopover.cjs"), i = require("vue"), o = (t) => t && t.__esModule ? t : { default: t }, u = /* @__PURE__ */ o(i), l = {
|
|
3
3
|
name: "NcUserBubbleDiv"
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var c = function() {
|
|
6
6
|
var e = this, r = e._self._c;
|
|
7
7
|
return r("div", [e._t("trigger")], 2);
|
|
8
|
-
},
|
|
9
|
-
i,
|
|
10
|
-
o,
|
|
8
|
+
}, p = [], _ = /* @__PURE__ */ s.normalizeComponent(
|
|
11
9
|
l,
|
|
10
|
+
c,
|
|
11
|
+
p,
|
|
12
12
|
!1,
|
|
13
13
|
null,
|
|
14
14
|
null,
|
|
15
15
|
null,
|
|
16
16
|
null
|
|
17
17
|
);
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const d = _.exports;
|
|
19
|
+
const m = {
|
|
20
20
|
name: "NcUserBubble",
|
|
21
21
|
components: {
|
|
22
|
-
NcAvatar:
|
|
22
|
+
NcAvatar: a.NcAvatar,
|
|
23
23
|
NcPopover: n,
|
|
24
|
-
NcUserBubbleDiv:
|
|
24
|
+
NcUserBubbleDiv: d
|
|
25
25
|
},
|
|
26
26
|
props: {
|
|
27
27
|
/**
|
|
@@ -43,7 +43,7 @@ const p = {
|
|
|
43
43
|
*/
|
|
44
44
|
displayName: {
|
|
45
45
|
type: String,
|
|
46
|
-
|
|
46
|
+
default: void 0
|
|
47
47
|
},
|
|
48
48
|
/**
|
|
49
49
|
* Whether or not to display the user-status
|
|
@@ -59,8 +59,9 @@ const p = {
|
|
|
59
59
|
type: String,
|
|
60
60
|
default: void 0,
|
|
61
61
|
validator: (t) => {
|
|
62
|
+
var e;
|
|
62
63
|
try {
|
|
63
|
-
return t = new URL(t),
|
|
64
|
+
return t = new URL(t, (e = t == null ? void 0 : t.startsWith) != null && e.call(t, "/") ? window.location.href : void 0), !0;
|
|
64
65
|
} catch {
|
|
65
66
|
return !1;
|
|
66
67
|
}
|
|
@@ -156,6 +157,9 @@ const p = {
|
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
159
|
},
|
|
160
|
+
mounted() {
|
|
161
|
+
!this.displayName && !this.user && u.default.util.warn("[NcUserBubble] At least `displayName` or `user` property should be set.");
|
|
162
|
+
},
|
|
159
163
|
methods: {
|
|
160
164
|
onOpenChange(t) {
|
|
161
165
|
this.$emit("update:open", t);
|
|
@@ -170,20 +174,20 @@ const p = {
|
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
176
|
};
|
|
173
|
-
var
|
|
177
|
+
var f = function() {
|
|
174
178
|
var e = this, r = e._self._c;
|
|
175
179
|
return r(e.isPopoverComponent, { tag: "component", staticClass: "user-bubble__wrapper", attrs: { trigger: "hover focus", shown: e.open }, on: { "update:open": e.onOpenChange }, scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
176
|
-
return [r(e.isLinkComponent, { tag: "component", staticClass: "user-bubble__content", class:
|
|
180
|
+
return [r(e.isLinkComponent, { tag: "component", staticClass: "user-bubble__content", class: { "user-bubble__content--primary": e.primary }, style: e.styles.content, attrs: { href: e.hasUrl ? e.url : null }, on: { click: e.onClick } }, [r("NcAvatar", { staticClass: "user-bubble__avatar", style: e.styles.avatar, attrs: { url: e.isCustomAvatar && e.isAvatarUrl ? e.avatarImage : void 0, "icon-class": e.isCustomAvatar && !e.isAvatarUrl ? e.avatarImage : void 0, user: e.user, "display-name": e.displayName, size: e.size - e.margin * 2, "disable-tooltip": !0, "disable-menu": !0, "show-user-status": e.showUserStatus } }), r("span", { staticClass: "user-bubble__name" }, [e._v(" " + e._s(e.displayName || e.user) + " ")]), e.$slots.name ? r("span", { staticClass: "user-bubble__secondary" }, [e._t("name")], 2) : e._e()], 1)];
|
|
177
181
|
}, proxy: !0 }], null, !0) }, [e._t("default")], 2);
|
|
178
|
-
},
|
|
179
|
-
p,
|
|
180
|
-
_,
|
|
182
|
+
}, v = [], b = /* @__PURE__ */ s.normalizeComponent(
|
|
181
183
|
m,
|
|
184
|
+
f,
|
|
185
|
+
v,
|
|
182
186
|
!1,
|
|
183
187
|
null,
|
|
184
|
-
"
|
|
188
|
+
"55ab76f1",
|
|
185
189
|
null,
|
|
186
190
|
null
|
|
187
191
|
);
|
|
188
|
-
const
|
|
189
|
-
module.exports =
|
|
192
|
+
const h = b.exports;
|
|
193
|
+
module.exports = h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcUserBubble.cjs","sources":["../../src/components/NcUserBubble/NcUserBubbleDiv.vue","../../src/components/NcUserBubble/NcUserBubble.vue"],"sourcesContent":["<!--\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<template>\n\t<div>\n\t\t<slot name=\"trigger\" />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcUserBubbleDiv',\n}\n</script>\n","<!--\n - @copyright Copyright (c) 2019 Jonas Sulzer <jonas@violoncello.ch>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Jonas Sulzer <jonas@violoncello.ch>\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<docs>\n\n### General description\n\nThis component displays a user together with a small avatar in a grey bubble.\nIt's possible to use an actual user's avatar, just an image/icon as a url or an icon-class,\nto link the bubble to e.g. a users profile\nand to show a popover on hover with e.g. the full user name handle / email address or something else.\n\nThis component has the following slot:\n* a default slot which is for the content of the popover (this is passed to the popover component directly).\n\n### Examples\n\n```vue\n<p>\n\tSome text before <NcUserBubble user=\"admin\" display-name=\"Admin Example\" :url=\"'/test'\">@admin@foreign-host.com</NcUserBubble> and after the bubble.\n\t<NcUserBubble avatar-image=\"icon-group\" display-name=\"test group xyz\" :primary=\"true\">Hey there!</NcUserBubble>\n</p>\n```\n\n### Example with name slot\n\n```vue\n<template>\n<NcUserBubble\n\t:margin=\"4\"\n\t:size=\"30\"\n\tdisplay-name=\"Administrator\"\n\tuser=\"admin\">\n\t<template #name>\n\t\t<a href=\"#\"\n\t\t\ttitle=\"Remove user\"\n\t\t\tclass=\"icon-close\"\n\t\t\t@click=\"alert\" />\n\t</template>\n</NcUserBubble>\n</template>\n\n<style>\n.icon-close {\n\tdisplay: block;\n\theight: 100%;\n}\n</style>\n```\n\n</docs>\n<template>\n\t<component :is=\"isPopoverComponent\"\n\t\ttrigger=\"hover focus\"\n\t\t:shown=\"open\"\n\t\tclass=\"user-bubble__wrapper\"\n\t\t@update:open=\"onOpenChange\">\n\t\t<!-- Main userbubble structure -->\n\t\t<template #trigger>\n\t\t\t<component :is=\"isLinkComponent\"\n\t\t\t\tclass=\"user-bubble__content\"\n\t\t\t\t:style=\"styles.content\"\n\t\t\t\t:href=\"hasUrl ? url : null\"\n\t\t\t\t:class=\"primary ? 'user-bubble__content--primary' : ''\"\n\t\t\t\t@click=\"onClick\">\n\t\t\t\t<!-- NcAvatar -->\n\t\t\t\t<NcAvatar :url=\"isCustomAvatar && isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:icon-class=\"isCustomAvatar && !isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:user=\"user\"\n\t\t\t\t\t:display-name=\"displayName\"\n\t\t\t\t\t:size=\"size - (margin * 2)\"\n\t\t\t\t\t:style=\"styles.avatar\"\n\t\t\t\t\t:disable-tooltip=\"true\"\n\t\t\t\t\t:disable-menu=\"true\"\n\t\t\t\t\tv-bind=\"$props\"\n\t\t\t\t\tclass=\"user-bubble__avatar\" />\n\n\t\t\t\t<!-- Name -->\n\t\t\t\t<span class=\"user-bubble__name\">\n\t\t\t\t\t{{ displayName || user }}\n\t\t\t\t</span>\n\n\t\t\t\t<!-- @slot Optional slot just after the name -->\n\t\t\t\t<span v-if=\"$slots.name\" class=\"user-bubble__secondary\">\n\t\t\t\t\t<slot name=\"name\" />\n\t\t\t\t</span>\n\t\t\t</component>\n\t\t</template>\n\n\t\t<!-- @slot Main Popover content on userbubble hover/focus -->\n\t\t<slot />\n\t</component>\n</template>\n\n<script>\nimport NcUserBubbleDiv from './NcUserBubbleDiv.vue'\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcPopover from '../NcPopover/index.js'\n\nexport default {\n\tname: 'NcUserBubble',\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcPopover,\n\t\tNcUserBubbleDiv,\n\t},\n\tprops: {\n\t\t/**\n\t\t * Override generated avatar, can be an url or an icon class\n\t\t */\n\t\tavatarImage: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Provide the user id if this is a user\n\t\t */\n\t\tuser: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Displayed label\n\t\t */\n\t\tdisplayName: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Whether or not to display the user-status\n\t\t */\n\t\tshowUserStatus: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Define the whole bubble as a link\n\t\t */\n\t\turl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: url => {\n\t\t\t\ttry {\n\t\t\t\t\turl = new URL(url)\n\t\t\t\t\treturn !!url\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t/**\n\t\t * Default popover state. Requires the UserBubble\n\t\t * to have some content to render inside the popover\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Use the primary colour\n\t\t */\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * This is the height of the component\n\t\t */\n\t\tsize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\t\t/**\n\t\t * This is the margin of the avatar (size - margin = avatar size)\n\t\t */\n\t\tmargin: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\temits: [\n\t\t'click',\n\t\t'update:open',\n\t],\n\tcomputed: {\n\t\t/**\n\t\t * If userbubble is empty, let's NOT\n\t\t * use the Popover component\n\t\t * We need a component instead of a simple div here,\n\t\t * because otherwise the trigger template will not be shown.\n\t\t *\n\t\t * @return {string} 'Popover' or 'UserBubbleDiv'\n\t\t */\n\t\tisPopoverComponent() {\n\t\t\treturn !this.popoverEmpty\n\t\t\t\t? 'NcPopover'\n\t\t\t\t: 'NcUserBubbleDiv'\n\t\t},\n\n\t\t/**\n\t\t * Is the provided avatar url valid or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisAvatarUrl() {\n\t\t\tif (!this.avatarImage) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst url = new URL(this.avatarImage)\n\t\t\t\treturn !!url\n\t\t\t} catch (error) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Do we have a custom avatar or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisCustomAvatar() {\n\t\t\treturn !!this.avatarImage\n\t\t},\n\n\t\thasUrl() {\n\t\t\treturn this.url && this.url.trim() !== ''\n\t\t},\n\n\t\tisLinkComponent() {\n\t\t\treturn this.hasUrl ? 'a' : 'div'\n\t\t},\n\n\t\tpopoverEmpty() {\n\t\t\tif ('default' in this.$slots) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\tstyles() {\n\t\t\treturn {\n\t\t\t\tcontent: {\n\t\t\t\t\theight: this.size + 'px',\n\t\t\t\t\tlineHeight: this.size + 'px',\n\t\t\t\t\tborderRadius: this.size / 2 + 'px',\n\t\t\t\t},\n\t\t\t\tavatar: {\n\t\t\t\t\tmarginLeft: this.margin + 'px',\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\tmethods: {\n\t\tonOpenChange(state) {\n\t\t\tthis.$emit('update:open', state)\n\t\t},\n\t\t/**\n\t\t * Catch and forward click event to parent\n\t\t *\n\t\t * @param {Event} event the click event\n\t\t */\n\t\tonClick(event) {\n\t\t\tthis.$emit('click', event)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.user-bubble {\n\t&__wrapper {\n\t\t// align inline with text\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t\t// shrink and allow grow to fit\n\t\tmin-width: 0;\n\t\tmax-width: 100%;\n\t}\n\n\t&__content {\n\t\tdisplay: inline-flex;\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-background-dark);\n\n\t\t&--primary {\n\t\t\tcolor: var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-primary-element);\n\t\t}\n\n\t\t> :last-child {\n\t\t\t// border radius left padding\n\t\t\tpadding-right: 8px;\n\t\t}\n\t}\n\n\t&__avatar {\n\t\talign-self: center;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__name,\n\t&__secondary {\n\t\t// proper spacing between avatar, name & slot\n\t\tpadding: 0;\n\t\tpadding-left: 4px;\n\t}\n}\n\n</style>\n"],"names":["_sfc_main$1","_sfc_main","Components_NcAvatar","Components_NcPopover","NcUserBubbleDiv","url","state","event"],"mappings":";kJA4BAA,IAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;;;;;;ACwFA,MAAAC,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC,EAAA;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,EACA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA;AACA,YAAA;AACA,iBAAAA,IAAA,IAAA,IAAAA,CAAA,GACA,CAAA,CAAAA;AAAA,QACA,QAAA;AACA,iBAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,qBAAA;AACA,aAAA,KAAA,eAEA,oBADA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AACA,UAAA,CAAA,KAAA;AACA,eAAA;AAGA,UAAA;AAEA,eAAA,CAAA,CADA,IAAA,IAAA,KAAA,WAAA;AAAA,MAEA,QAAA;AACA,eAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AACA,aAAA,CAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,aAAA,KAAA,OAAA,KAAA,IAAA,KAAA,MAAA;AAAA,IACA;AAAA,IAEA,kBAAA;AACA,aAAA,KAAA,SAAA,MAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,aAAA,eAAA,KAAA;AAAA,IAIA;AAAA,IAEA,SAAA;AACA,aAAA;AAAA,QACA,SAAA;AAAA,UACA,QAAA,KAAA,OAAA;AAAA,UACA,YAAA,KAAA,OAAA;AAAA,UACA,cAAA,KAAA,OAAA,IAAA;AAAA,QACA;AAAA,QACA,QAAA;AAAA,UACA,YAAA,KAAA,SAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,SAAA;AAAA,IACA,aAAAC,GAAA;AACA,WAAA,MAAA,eAAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAAC,GAAA;AACA,WAAA,MAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcUserBubble.cjs","sources":["../../src/components/NcUserBubble/NcUserBubbleDiv.vue","../../src/components/NcUserBubble/NcUserBubble.vue"],"sourcesContent":["<!--\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<template>\n\t<div>\n\t\t<slot name=\"trigger\" />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcUserBubbleDiv',\n}\n</script>\n","<!--\n - @copyright Copyright (c) 2019 Jonas Sulzer <jonas@violoncello.ch>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Jonas Sulzer <jonas@violoncello.ch>\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<docs>\n\n### General description\n\nThis component displays a user together with a small avatar in a grey bubble.\nIt's possible to use an actual user's avatar, just an image/icon as a url or an icon-class,\nto link the bubble to e.g. a users profile\nand to show a popover on hover with e.g. the full user name handle / email address or something else.\n\nThis component has the following slot:\n* a default slot which is for the content of the popover (this is passed to the popover component directly).\n\n### Examples\n\n```vue\n<p>\n\tSome text before <NcUserBubble user=\"admin\" display-name=\"Admin Example\" url=\"/test\">@admin@foreign-host.com</NcUserBubble> and after the bubble.\n\t<NcUserBubble avatar-image=\"icon-group\" display-name=\"test group xyz\" :primary=\"true\">Hey there!</NcUserBubble>\n</p>\n```\n\n### Example with name slot\n\n```vue\n<template>\n<NcUserBubble\n\t:margin=\"4\"\n\t:size=\"30\"\n\tdisplay-name=\"Administrator\"\n\tuser=\"admin\">\n\t<template #name>\n\t\t<a href=\"#\"\n\t\t\ttitle=\"Remove user\"\n\t\t\tclass=\"icon-close\"\n\t\t\t@click=\"alert\" />\n\t</template>\n</NcUserBubble>\n</template>\n<script>\nexport default {\n\tmethods: {\n\t\talert() {\n\t\t\talert('Removed')\n\t\t},\n\t},\n}\n</script>\n<style>\n.icon-close {\n\tdisplay: block;\n\theight: 100%;\n}\n</style>\n```\n\n</docs>\n<template>\n\t<component :is=\"isPopoverComponent\"\n\t\ttrigger=\"hover focus\"\n\t\t:shown=\"open\"\n\t\tclass=\"user-bubble__wrapper\"\n\t\t@update:open=\"onOpenChange\">\n\t\t<!-- Main userbubble structure -->\n\t\t<template #trigger>\n\t\t\t<component :is=\"isLinkComponent\"\n\t\t\t\tclass=\"user-bubble__content\"\n\t\t\t\t:style=\"styles.content\"\n\t\t\t\t:href=\"hasUrl ? url : null\"\n\t\t\t\t:class=\"{ 'user-bubble__content--primary': primary }\"\n\t\t\t\t@click=\"onClick\">\n\t\t\t\t<!-- NcAvatar -->\n\t\t\t\t<NcAvatar :url=\"isCustomAvatar && isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:icon-class=\"isCustomAvatar && !isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:user=\"user\"\n\t\t\t\t\t:display-name=\"displayName\"\n\t\t\t\t\t:size=\"size - (margin * 2)\"\n\t\t\t\t\t:style=\"styles.avatar\"\n\t\t\t\t\t:disable-tooltip=\"true\"\n\t\t\t\t\t:disable-menu=\"true\"\n\t\t\t\t\t:show-user-status=\"showUserStatus\"\n\t\t\t\t\tclass=\"user-bubble__avatar\" />\n\n\t\t\t\t<!-- Name -->\n\t\t\t\t<span class=\"user-bubble__name\">\n\t\t\t\t\t{{ displayName || user }}\n\t\t\t\t</span>\n\n\t\t\t\t<!-- @slot Optional slot just after the name -->\n\t\t\t\t<span v-if=\"$slots.name\" class=\"user-bubble__secondary\">\n\t\t\t\t\t<slot name=\"name\" />\n\t\t\t\t</span>\n\t\t\t</component>\n\t\t</template>\n\n\t\t<!-- @slot Main Popover content on userbubble hover/focus -->\n\t\t<slot />\n\t</component>\n</template>\n\n<script>\nimport NcUserBubbleDiv from './NcUserBubbleDiv.vue'\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcPopover from '../NcPopover/index.js'\nimport Vue from 'vue'\n\nexport default {\n\tname: 'NcUserBubble',\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcPopover,\n\t\tNcUserBubbleDiv,\n\t},\n\tprops: {\n\t\t/**\n\t\t * Override generated avatar, can be an url or an icon class\n\t\t */\n\t\tavatarImage: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Provide the user id if this is a user\n\t\t */\n\t\tuser: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Displayed label\n\t\t */\n\t\tdisplayName: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Whether or not to display the user-status\n\t\t */\n\t\tshowUserStatus: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Define the whole bubble as a link\n\t\t */\n\t\turl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: (url) => {\n\t\t\t\ttry {\n\t\t\t\t\turl = new URL(url, url?.startsWith?.('/') ? window.location.href : undefined)\n\t\t\t\t\treturn true\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t/**\n\t\t * Default popover state. Requires the UserBubble\n\t\t * to have some content to render inside the popover\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Use the primary colour\n\t\t */\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * This is the height of the component\n\t\t */\n\t\tsize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\t\t/**\n\t\t * This is the margin of the avatar (size - margin = avatar size)\n\t\t */\n\t\tmargin: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\temits: [\n\t\t'click',\n\t\t'update:open',\n\t],\n\tcomputed: {\n\t\t/**\n\t\t * If userbubble is empty, let's NOT\n\t\t * use the Popover component\n\t\t * We need a component instead of a simple div here,\n\t\t * because otherwise the trigger template will not be shown.\n\t\t *\n\t\t * @return {string} 'Popover' or 'UserBubbleDiv'\n\t\t */\n\t\tisPopoverComponent() {\n\t\t\treturn !this.popoverEmpty\n\t\t\t\t? 'NcPopover'\n\t\t\t\t: 'NcUserBubbleDiv'\n\t\t},\n\n\t\t/**\n\t\t * Is the provided avatar url valid or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisAvatarUrl() {\n\t\t\tif (!this.avatarImage) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst url = new URL(this.avatarImage)\n\t\t\t\treturn !!url\n\t\t\t} catch (error) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Do we have a custom avatar or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisCustomAvatar() {\n\t\t\treturn !!this.avatarImage\n\t\t},\n\n\t\thasUrl() {\n\t\t\treturn this.url && this.url.trim() !== ''\n\t\t},\n\n\t\tisLinkComponent() {\n\t\t\treturn this.hasUrl ? 'a' : 'div'\n\t\t},\n\n\t\tpopoverEmpty() {\n\t\t\tif ('default' in this.$slots) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\tstyles() {\n\t\t\treturn {\n\t\t\t\tcontent: {\n\t\t\t\t\theight: this.size + 'px',\n\t\t\t\t\tlineHeight: this.size + 'px',\n\t\t\t\t\tborderRadius: this.size / 2 + 'px',\n\t\t\t\t},\n\t\t\t\tavatar: {\n\t\t\t\t\tmarginLeft: this.margin + 'px',\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\tmounted() {\n\t\tif (!this.displayName && !this.user) {\n\t\t\tVue.util.warn('[NcUserBubble] At least `displayName` or `user` property should be set.')\n\t\t}\n\t},\n\tmethods: {\n\t\tonOpenChange(state) {\n\t\t\tthis.$emit('update:open', state)\n\t\t},\n\t\t/**\n\t\t * Catch and forward click event to parent\n\t\t *\n\t\t * @param {Event} event the click event\n\t\t */\n\t\tonClick(event) {\n\t\t\tthis.$emit('click', event)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.user-bubble {\n\t&__wrapper {\n\t\t// align inline with text\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t\t// shrink and allow grow to fit\n\t\tmin-width: 0;\n\t\tmax-width: 100%;\n\t}\n\n\t&__content {\n\t\tdisplay: inline-flex;\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-background-dark);\n\n\t\t&--primary {\n\t\t\tcolor: var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-primary-element);\n\t\t}\n\n\t\t> :last-child {\n\t\t\t// border radius left padding\n\t\t\tpadding-right: 8px;\n\t\t}\n\t}\n\n\t&__avatar {\n\t\talign-self: center;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__name,\n\t&__secondary {\n\t\t// proper spacing between avatar, name & slot\n\t\tpadding: 0;\n\t\tpadding-left: 4px;\n\t}\n}\n\n</style>\n"],"names":["_sfc_main$1","_sfc_main","Components_NcAvatar","Components_NcPopover","NcUserBubbleDiv","url","_a","Vue__default","state","event"],"mappings":";mPA4BAA,IA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/index-c221fe05.css";
|
|
2
|
+
import { n as s } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
3
|
+
import { N as a } from "../chunks/index-a01ff595.mjs";
|
|
4
4
|
import n from "./NcPopover.mjs";
|
|
5
|
-
|
|
5
|
+
import i from "vue";
|
|
6
|
+
const o = {
|
|
6
7
|
name: "NcUserBubbleDiv"
|
|
7
8
|
};
|
|
8
9
|
var l = function() {
|
|
9
10
|
var e = this, r = e._self._c;
|
|
10
11
|
return r("div", [e._t("trigger")], 2);
|
|
11
|
-
},
|
|
12
|
-
i,
|
|
13
|
-
l,
|
|
12
|
+
}, u = [], p = /* @__PURE__ */ s(
|
|
14
13
|
o,
|
|
14
|
+
l,
|
|
15
|
+
u,
|
|
15
16
|
!1,
|
|
16
17
|
null,
|
|
17
18
|
null,
|
|
18
19
|
null,
|
|
19
20
|
null
|
|
20
21
|
);
|
|
21
|
-
const
|
|
22
|
-
const
|
|
22
|
+
const c = p.exports;
|
|
23
|
+
const m = {
|
|
23
24
|
name: "NcUserBubble",
|
|
24
25
|
components: {
|
|
25
|
-
NcAvatar:
|
|
26
|
+
NcAvatar: a,
|
|
26
27
|
NcPopover: n,
|
|
27
|
-
NcUserBubbleDiv:
|
|
28
|
+
NcUserBubbleDiv: c
|
|
28
29
|
},
|
|
29
30
|
props: {
|
|
30
31
|
/**
|
|
@@ -46,7 +47,7 @@ const c = {
|
|
|
46
47
|
*/
|
|
47
48
|
displayName: {
|
|
48
49
|
type: String,
|
|
49
|
-
|
|
50
|
+
default: void 0
|
|
50
51
|
},
|
|
51
52
|
/**
|
|
52
53
|
* Whether or not to display the user-status
|
|
@@ -62,8 +63,9 @@ const c = {
|
|
|
62
63
|
type: String,
|
|
63
64
|
default: void 0,
|
|
64
65
|
validator: (t) => {
|
|
66
|
+
var e;
|
|
65
67
|
try {
|
|
66
|
-
return t = new URL(t),
|
|
68
|
+
return t = new URL(t, (e = t == null ? void 0 : t.startsWith) != null && e.call(t, "/") ? window.location.href : void 0), !0;
|
|
67
69
|
} catch {
|
|
68
70
|
return !1;
|
|
69
71
|
}
|
|
@@ -159,6 +161,9 @@ const c = {
|
|
|
159
161
|
};
|
|
160
162
|
}
|
|
161
163
|
},
|
|
164
|
+
mounted() {
|
|
165
|
+
!this.displayName && !this.user && i.util.warn("[NcUserBubble] At least `displayName` or `user` property should be set.");
|
|
166
|
+
},
|
|
162
167
|
methods: {
|
|
163
168
|
onOpenChange(t) {
|
|
164
169
|
this.$emit("update:open", t);
|
|
@@ -173,22 +178,22 @@ const c = {
|
|
|
173
178
|
}
|
|
174
179
|
}
|
|
175
180
|
};
|
|
176
|
-
var
|
|
181
|
+
var d = function() {
|
|
177
182
|
var e = this, r = e._self._c;
|
|
178
183
|
return r(e.isPopoverComponent, { tag: "component", staticClass: "user-bubble__wrapper", attrs: { trigger: "hover focus", shown: e.open }, on: { "update:open": e.onOpenChange }, scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
179
|
-
return [r(e.isLinkComponent, { tag: "component", staticClass: "user-bubble__content", class:
|
|
184
|
+
return [r(e.isLinkComponent, { tag: "component", staticClass: "user-bubble__content", class: { "user-bubble__content--primary": e.primary }, style: e.styles.content, attrs: { href: e.hasUrl ? e.url : null }, on: { click: e.onClick } }, [r("NcAvatar", { staticClass: "user-bubble__avatar", style: e.styles.avatar, attrs: { url: e.isCustomAvatar && e.isAvatarUrl ? e.avatarImage : void 0, "icon-class": e.isCustomAvatar && !e.isAvatarUrl ? e.avatarImage : void 0, user: e.user, "display-name": e.displayName, size: e.size - e.margin * 2, "disable-tooltip": !0, "disable-menu": !0, "show-user-status": e.showUserStatus } }), r("span", { staticClass: "user-bubble__name" }, [e._v(" " + e._s(e.displayName || e.user) + " ")]), e.$slots.name ? r("span", { staticClass: "user-bubble__secondary" }, [e._t("name")], 2) : e._e()], 1)];
|
|
180
185
|
}, proxy: !0 }], null, !0) }, [e._t("default")], 2);
|
|
181
|
-
}, _ = [],
|
|
182
|
-
c,
|
|
186
|
+
}, _ = [], f = /* @__PURE__ */ s(
|
|
183
187
|
m,
|
|
188
|
+
d,
|
|
184
189
|
_,
|
|
185
190
|
!1,
|
|
186
191
|
null,
|
|
187
|
-
"
|
|
192
|
+
"55ab76f1",
|
|
188
193
|
null,
|
|
189
194
|
null
|
|
190
195
|
);
|
|
191
|
-
const
|
|
196
|
+
const N = f.exports;
|
|
192
197
|
export {
|
|
193
|
-
|
|
198
|
+
N as default
|
|
194
199
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcUserBubble.mjs","sources":["../../src/components/NcUserBubble/NcUserBubbleDiv.vue","../../src/components/NcUserBubble/NcUserBubble.vue"],"sourcesContent":["<!--\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<template>\n\t<div>\n\t\t<slot name=\"trigger\" />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcUserBubbleDiv',\n}\n</script>\n","<!--\n - @copyright Copyright (c) 2019 Jonas Sulzer <jonas@violoncello.ch>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Jonas Sulzer <jonas@violoncello.ch>\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<docs>\n\n### General description\n\nThis component displays a user together with a small avatar in a grey bubble.\nIt's possible to use an actual user's avatar, just an image/icon as a url or an icon-class,\nto link the bubble to e.g. a users profile\nand to show a popover on hover with e.g. the full user name handle / email address or something else.\n\nThis component has the following slot:\n* a default slot which is for the content of the popover (this is passed to the popover component directly).\n\n### Examples\n\n```vue\n<p>\n\tSome text before <NcUserBubble user=\"admin\" display-name=\"Admin Example\" :url=\"'/test'\">@admin@foreign-host.com</NcUserBubble> and after the bubble.\n\t<NcUserBubble avatar-image=\"icon-group\" display-name=\"test group xyz\" :primary=\"true\">Hey there!</NcUserBubble>\n</p>\n```\n\n### Example with name slot\n\n```vue\n<template>\n<NcUserBubble\n\t:margin=\"4\"\n\t:size=\"30\"\n\tdisplay-name=\"Administrator\"\n\tuser=\"admin\">\n\t<template #name>\n\t\t<a href=\"#\"\n\t\t\ttitle=\"Remove user\"\n\t\t\tclass=\"icon-close\"\n\t\t\t@click=\"alert\" />\n\t</template>\n</NcUserBubble>\n</template>\n\n<style>\n.icon-close {\n\tdisplay: block;\n\theight: 100%;\n}\n</style>\n```\n\n</docs>\n<template>\n\t<component :is=\"isPopoverComponent\"\n\t\ttrigger=\"hover focus\"\n\t\t:shown=\"open\"\n\t\tclass=\"user-bubble__wrapper\"\n\t\t@update:open=\"onOpenChange\">\n\t\t<!-- Main userbubble structure -->\n\t\t<template #trigger>\n\t\t\t<component :is=\"isLinkComponent\"\n\t\t\t\tclass=\"user-bubble__content\"\n\t\t\t\t:style=\"styles.content\"\n\t\t\t\t:href=\"hasUrl ? url : null\"\n\t\t\t\t:class=\"primary ? 'user-bubble__content--primary' : ''\"\n\t\t\t\t@click=\"onClick\">\n\t\t\t\t<!-- NcAvatar -->\n\t\t\t\t<NcAvatar :url=\"isCustomAvatar && isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:icon-class=\"isCustomAvatar && !isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:user=\"user\"\n\t\t\t\t\t:display-name=\"displayName\"\n\t\t\t\t\t:size=\"size - (margin * 2)\"\n\t\t\t\t\t:style=\"styles.avatar\"\n\t\t\t\t\t:disable-tooltip=\"true\"\n\t\t\t\t\t:disable-menu=\"true\"\n\t\t\t\t\tv-bind=\"$props\"\n\t\t\t\t\tclass=\"user-bubble__avatar\" />\n\n\t\t\t\t<!-- Name -->\n\t\t\t\t<span class=\"user-bubble__name\">\n\t\t\t\t\t{{ displayName || user }}\n\t\t\t\t</span>\n\n\t\t\t\t<!-- @slot Optional slot just after the name -->\n\t\t\t\t<span v-if=\"$slots.name\" class=\"user-bubble__secondary\">\n\t\t\t\t\t<slot name=\"name\" />\n\t\t\t\t</span>\n\t\t\t</component>\n\t\t</template>\n\n\t\t<!-- @slot Main Popover content on userbubble hover/focus -->\n\t\t<slot />\n\t</component>\n</template>\n\n<script>\nimport NcUserBubbleDiv from './NcUserBubbleDiv.vue'\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcPopover from '../NcPopover/index.js'\n\nexport default {\n\tname: 'NcUserBubble',\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcPopover,\n\t\tNcUserBubbleDiv,\n\t},\n\tprops: {\n\t\t/**\n\t\t * Override generated avatar, can be an url or an icon class\n\t\t */\n\t\tavatarImage: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Provide the user id if this is a user\n\t\t */\n\t\tuser: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Displayed label\n\t\t */\n\t\tdisplayName: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Whether or not to display the user-status\n\t\t */\n\t\tshowUserStatus: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Define the whole bubble as a link\n\t\t */\n\t\turl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: url => {\n\t\t\t\ttry {\n\t\t\t\t\turl = new URL(url)\n\t\t\t\t\treturn !!url\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t/**\n\t\t * Default popover state. Requires the UserBubble\n\t\t * to have some content to render inside the popover\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Use the primary colour\n\t\t */\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * This is the height of the component\n\t\t */\n\t\tsize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\t\t/**\n\t\t * This is the margin of the avatar (size - margin = avatar size)\n\t\t */\n\t\tmargin: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\temits: [\n\t\t'click',\n\t\t'update:open',\n\t],\n\tcomputed: {\n\t\t/**\n\t\t * If userbubble is empty, let's NOT\n\t\t * use the Popover component\n\t\t * We need a component instead of a simple div here,\n\t\t * because otherwise the trigger template will not be shown.\n\t\t *\n\t\t * @return {string} 'Popover' or 'UserBubbleDiv'\n\t\t */\n\t\tisPopoverComponent() {\n\t\t\treturn !this.popoverEmpty\n\t\t\t\t? 'NcPopover'\n\t\t\t\t: 'NcUserBubbleDiv'\n\t\t},\n\n\t\t/**\n\t\t * Is the provided avatar url valid or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisAvatarUrl() {\n\t\t\tif (!this.avatarImage) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst url = new URL(this.avatarImage)\n\t\t\t\treturn !!url\n\t\t\t} catch (error) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Do we have a custom avatar or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisCustomAvatar() {\n\t\t\treturn !!this.avatarImage\n\t\t},\n\n\t\thasUrl() {\n\t\t\treturn this.url && this.url.trim() !== ''\n\t\t},\n\n\t\tisLinkComponent() {\n\t\t\treturn this.hasUrl ? 'a' : 'div'\n\t\t},\n\n\t\tpopoverEmpty() {\n\t\t\tif ('default' in this.$slots) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\tstyles() {\n\t\t\treturn {\n\t\t\t\tcontent: {\n\t\t\t\t\theight: this.size + 'px',\n\t\t\t\t\tlineHeight: this.size + 'px',\n\t\t\t\t\tborderRadius: this.size / 2 + 'px',\n\t\t\t\t},\n\t\t\t\tavatar: {\n\t\t\t\t\tmarginLeft: this.margin + 'px',\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\tmethods: {\n\t\tonOpenChange(state) {\n\t\t\tthis.$emit('update:open', state)\n\t\t},\n\t\t/**\n\t\t * Catch and forward click event to parent\n\t\t *\n\t\t * @param {Event} event the click event\n\t\t */\n\t\tonClick(event) {\n\t\t\tthis.$emit('click', event)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.user-bubble {\n\t&__wrapper {\n\t\t// align inline with text\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t\t// shrink and allow grow to fit\n\t\tmin-width: 0;\n\t\tmax-width: 100%;\n\t}\n\n\t&__content {\n\t\tdisplay: inline-flex;\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-background-dark);\n\n\t\t&--primary {\n\t\t\tcolor: var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-primary-element);\n\t\t}\n\n\t\t> :last-child {\n\t\t\t// border radius left padding\n\t\t\tpadding-right: 8px;\n\t\t}\n\t}\n\n\t&__avatar {\n\t\talign-self: center;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__name,\n\t&__secondary {\n\t\t// proper spacing between avatar, name & slot\n\t\tpadding: 0;\n\t\tpadding-left: 4px;\n\t}\n}\n\n</style>\n"],"names":["_sfc_main$1","_sfc_main","NcAvatar","NcPopover","NcUserBubbleDiv","url","state","event"],"mappings":";;;;AA4BA,MAAAA,IAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;;;;;;ACwFA,MAAAC,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,EACA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA;AACA,YAAA;AACA,iBAAAA,IAAA,IAAA,IAAAA,CAAA,GACA,CAAA,CAAAA;AAAA,QACA,QAAA;AACA,iBAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAA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
1
|
+
{"version":3,"file":"NcUserBubble.mjs","sources":["../../src/components/NcUserBubble/NcUserBubbleDiv.vue","../../src/components/NcUserBubble/NcUserBubble.vue"],"sourcesContent":["<!--\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<template>\n\t<div>\n\t\t<slot name=\"trigger\" />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcUserBubbleDiv',\n}\n</script>\n","<!--\n - @copyright Copyright (c) 2019 Jonas Sulzer <jonas@violoncello.ch>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Jonas Sulzer <jonas@violoncello.ch>\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<docs>\n\n### General description\n\nThis component displays a user together with a small avatar in a grey bubble.\nIt's possible to use an actual user's avatar, just an image/icon as a url or an icon-class,\nto link the bubble to e.g. a users profile\nand to show a popover on hover with e.g. the full user name handle / email address or something else.\n\nThis component has the following slot:\n* a default slot which is for the content of the popover (this is passed to the popover component directly).\n\n### Examples\n\n```vue\n<p>\n\tSome text before <NcUserBubble user=\"admin\" display-name=\"Admin Example\" url=\"/test\">@admin@foreign-host.com</NcUserBubble> and after the bubble.\n\t<NcUserBubble avatar-image=\"icon-group\" display-name=\"test group xyz\" :primary=\"true\">Hey there!</NcUserBubble>\n</p>\n```\n\n### Example with name slot\n\n```vue\n<template>\n<NcUserBubble\n\t:margin=\"4\"\n\t:size=\"30\"\n\tdisplay-name=\"Administrator\"\n\tuser=\"admin\">\n\t<template #name>\n\t\t<a href=\"#\"\n\t\t\ttitle=\"Remove user\"\n\t\t\tclass=\"icon-close\"\n\t\t\t@click=\"alert\" />\n\t</template>\n</NcUserBubble>\n</template>\n<script>\nexport default {\n\tmethods: {\n\t\talert() {\n\t\t\talert('Removed')\n\t\t},\n\t},\n}\n</script>\n<style>\n.icon-close {\n\tdisplay: block;\n\theight: 100%;\n}\n</style>\n```\n\n</docs>\n<template>\n\t<component :is=\"isPopoverComponent\"\n\t\ttrigger=\"hover focus\"\n\t\t:shown=\"open\"\n\t\tclass=\"user-bubble__wrapper\"\n\t\t@update:open=\"onOpenChange\">\n\t\t<!-- Main userbubble structure -->\n\t\t<template #trigger>\n\t\t\t<component :is=\"isLinkComponent\"\n\t\t\t\tclass=\"user-bubble__content\"\n\t\t\t\t:style=\"styles.content\"\n\t\t\t\t:href=\"hasUrl ? url : null\"\n\t\t\t\t:class=\"{ 'user-bubble__content--primary': primary }\"\n\t\t\t\t@click=\"onClick\">\n\t\t\t\t<!-- NcAvatar -->\n\t\t\t\t<NcAvatar :url=\"isCustomAvatar && isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:icon-class=\"isCustomAvatar && !isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:user=\"user\"\n\t\t\t\t\t:display-name=\"displayName\"\n\t\t\t\t\t:size=\"size - (margin * 2)\"\n\t\t\t\t\t:style=\"styles.avatar\"\n\t\t\t\t\t:disable-tooltip=\"true\"\n\t\t\t\t\t:disable-menu=\"true\"\n\t\t\t\t\t:show-user-status=\"showUserStatus\"\n\t\t\t\t\tclass=\"user-bubble__avatar\" />\n\n\t\t\t\t<!-- Name -->\n\t\t\t\t<span class=\"user-bubble__name\">\n\t\t\t\t\t{{ displayName || user }}\n\t\t\t\t</span>\n\n\t\t\t\t<!-- @slot Optional slot just after the name -->\n\t\t\t\t<span v-if=\"$slots.name\" class=\"user-bubble__secondary\">\n\t\t\t\t\t<slot name=\"name\" />\n\t\t\t\t</span>\n\t\t\t</component>\n\t\t</template>\n\n\t\t<!-- @slot Main Popover content on userbubble hover/focus -->\n\t\t<slot />\n\t</component>\n</template>\n\n<script>\nimport NcUserBubbleDiv from './NcUserBubbleDiv.vue'\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcPopover from '../NcPopover/index.js'\nimport Vue from 'vue'\n\nexport default {\n\tname: 'NcUserBubble',\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcPopover,\n\t\tNcUserBubbleDiv,\n\t},\n\tprops: {\n\t\t/**\n\t\t * Override generated avatar, can be an url or an icon class\n\t\t */\n\t\tavatarImage: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Provide the user id if this is a user\n\t\t */\n\t\tuser: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Displayed label\n\t\t */\n\t\tdisplayName: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Whether or not to display the user-status\n\t\t */\n\t\tshowUserStatus: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Define the whole bubble as a link\n\t\t */\n\t\turl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: (url) => {\n\t\t\t\ttry {\n\t\t\t\t\turl = new URL(url, url?.startsWith?.('/') ? window.location.href : undefined)\n\t\t\t\t\treturn true\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t/**\n\t\t * Default popover state. Requires the UserBubble\n\t\t * to have some content to render inside the popover\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Use the primary colour\n\t\t */\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * This is the height of the component\n\t\t */\n\t\tsize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\t\t/**\n\t\t * This is the margin of the avatar (size - margin = avatar size)\n\t\t */\n\t\tmargin: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\temits: [\n\t\t'click',\n\t\t'update:open',\n\t],\n\tcomputed: {\n\t\t/**\n\t\t * If userbubble is empty, let's NOT\n\t\t * use the Popover component\n\t\t * We need a component instead of a simple div here,\n\t\t * because otherwise the trigger template will not be shown.\n\t\t *\n\t\t * @return {string} 'Popover' or 'UserBubbleDiv'\n\t\t */\n\t\tisPopoverComponent() {\n\t\t\treturn !this.popoverEmpty\n\t\t\t\t? 'NcPopover'\n\t\t\t\t: 'NcUserBubbleDiv'\n\t\t},\n\n\t\t/**\n\t\t * Is the provided avatar url valid or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisAvatarUrl() {\n\t\t\tif (!this.avatarImage) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst url = new URL(this.avatarImage)\n\t\t\t\treturn !!url\n\t\t\t} catch (error) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Do we have a custom avatar or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisCustomAvatar() {\n\t\t\treturn !!this.avatarImage\n\t\t},\n\n\t\thasUrl() {\n\t\t\treturn this.url && this.url.trim() !== ''\n\t\t},\n\n\t\tisLinkComponent() {\n\t\t\treturn this.hasUrl ? 'a' : 'div'\n\t\t},\n\n\t\tpopoverEmpty() {\n\t\t\tif ('default' in this.$slots) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\tstyles() {\n\t\t\treturn {\n\t\t\t\tcontent: {\n\t\t\t\t\theight: this.size + 'px',\n\t\t\t\t\tlineHeight: this.size + 'px',\n\t\t\t\t\tborderRadius: this.size / 2 + 'px',\n\t\t\t\t},\n\t\t\t\tavatar: {\n\t\t\t\t\tmarginLeft: this.margin + 'px',\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\tmounted() {\n\t\tif (!this.displayName && !this.user) {\n\t\t\tVue.util.warn('[NcUserBubble] At least `displayName` or `user` property should be set.')\n\t\t}\n\t},\n\tmethods: {\n\t\tonOpenChange(state) {\n\t\t\tthis.$emit('update:open', state)\n\t\t},\n\t\t/**\n\t\t * Catch and forward click event to parent\n\t\t *\n\t\t * @param {Event} event the click event\n\t\t */\n\t\tonClick(event) {\n\t\t\tthis.$emit('click', event)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.user-bubble {\n\t&__wrapper {\n\t\t// align inline with text\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t\t// shrink and allow grow to fit\n\t\tmin-width: 0;\n\t\tmax-width: 100%;\n\t}\n\n\t&__content {\n\t\tdisplay: inline-flex;\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-background-dark);\n\n\t\t&--primary {\n\t\t\tcolor: var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-primary-element);\n\t\t}\n\n\t\t> :last-child {\n\t\t\t// border radius left padding\n\t\t\tpadding-right: 8px;\n\t\t}\n\t}\n\n\t&__avatar {\n\t\talign-self: center;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__name,\n\t&__secondary {\n\t\t// proper spacing between avatar, name & slot\n\t\tpadding: 0;\n\t\tpadding-left: 4px;\n\t}\n}\n\n</style>\n"],"names":["_sfc_main$1","_sfc_main","NcAvatar","NcPopover","NcUserBubbleDiv","url","_a","Vue","state","event"],"mappings":";;;;;AA4BA,MAAAA,IAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;;;;;;ACiGA,MAAAC,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,EACA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA;;AACA,YAAA;AACA,iBAAAA,IAAA,IAAA,IAAAA,IAAAC,IAAAD,KAAA,gBAAAA,EAAA,eAAA,QAAAC,EAAA,KAAAD,GAAA,OAAA,OAAA,SAAA,OAAA,MAAA,GACA;AAAA,QACA,QAAA;AACA,iBAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAA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AMA,QAAAC,GAAA;AACA,WAAA,MAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;"}
|
package/dist/assets/{NcAppNavigationToggle-2cc5b864.css → NcAppNavigationToggle-9e170630.css}
RENAMED
|
@@ -20,16 +20,17 @@
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
.material-design-icon[data-v-
|
|
23
|
+
.material-design-icon[data-v-13b4f13a] {
|
|
24
24
|
display: flex;
|
|
25
25
|
align-self: center;
|
|
26
26
|
justify-self: center;
|
|
27
27
|
align-items: center;
|
|
28
28
|
justify-content: center;
|
|
29
29
|
}
|
|
30
|
-
button.app-navigation-toggle[data-v-
|
|
30
|
+
button.app-navigation-toggle[data-v-13b4f13a] {
|
|
31
31
|
position: absolute;
|
|
32
32
|
top: var(--app-navigation-padding);
|
|
33
33
|
right: calc(0px - var(--app-navigation-padding));
|
|
34
34
|
margin-right: -44px;
|
|
35
|
+
background-color: var(--color-main-background);
|
|
35
36
|
}
|
|
@@ -20,30 +20,30 @@
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
.material-design-icon {
|
|
23
|
+
.material-design-icon[data-v-dcf0becf] {
|
|
24
24
|
display: flex;
|
|
25
25
|
align-self: center;
|
|
26
26
|
justify-self: center;
|
|
27
27
|
align-items: center;
|
|
28
28
|
justify-content: center;
|
|
29
29
|
}
|
|
30
|
-
.app-navigation-input-confirm {
|
|
30
|
+
.app-navigation-input-confirm[data-v-dcf0becf] {
|
|
31
31
|
flex: 1 0 100%;
|
|
32
32
|
width: 100%;
|
|
33
33
|
}
|
|
34
|
-
.app-navigation-input-confirm form {
|
|
34
|
+
.app-navigation-input-confirm form[data-v-dcf0becf] {
|
|
35
35
|
display: flex;
|
|
36
36
|
}
|
|
37
|
-
.app-navigation-input-confirm__input {
|
|
37
|
+
.app-navigation-input-confirm__input[data-v-dcf0becf] {
|
|
38
38
|
height: 34px;
|
|
39
39
|
flex: 1 1 100%;
|
|
40
40
|
font-size: 100% !important;
|
|
41
41
|
margin: 5px 5px 5px -8px !important;
|
|
42
42
|
padding: 7px !important;
|
|
43
43
|
}
|
|
44
|
-
.app-navigation-input-confirm__input:active,
|
|
45
|
-
.app-navigation-input-confirm__input:focus,
|
|
46
|
-
.app-navigation-input-confirm__input:hover {
|
|
44
|
+
.app-navigation-input-confirm__input[data-v-dcf0becf]:active,
|
|
45
|
+
.app-navigation-input-confirm__input[data-v-dcf0becf]:focus,
|
|
46
|
+
.app-navigation-input-confirm__input[data-v-dcf0becf]:hover {
|
|
47
47
|
outline: none;
|
|
48
48
|
background-color: var(--color-main-background);
|
|
49
49
|
color: var(--color-main-text);
|