@conduction/nextcloud-vue 2.75.0 → 2.77.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/dist/esm/components/CnAppNav/CnAppNav.vue2.js +18 -3
- package/dist/esm/components/CnAppNav/CnAppNav.vue2.js.map +1 -1
- package/dist/esm/components/CnAppNav/CnAppNav.vue3.js +49 -3
- package/dist/esm/components/CnAppNav/CnAppNav.vue3.js.map +1 -1
- package/dist/esm/components/CnCardGrid/CnCardGrid.vue2.js +6 -0
- package/dist/esm/components/CnCardGrid/CnCardGrid.vue2.js.map +1 -1
- package/dist/esm/components/CnCardGrid/CnCardGrid.vue3.js +3 -2
- package/dist/esm/components/CnCardGrid/CnCardGrid.vue3.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +42 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +228 -203
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue.js +9 -0
- package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue.js.map +1 -0
- package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue2.js +50 -0
- package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue2.js.map +1 -0
- package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue3.js +13 -0
- package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue3.js.map +1 -0
- package/dist/esm/components/CnCredentials/CnCredentials.vue2.js +11 -10
- package/dist/esm/components/CnCredentials/CnCredentials.vue2.js.map +1 -1
- package/dist/esm/components/CnCredentials/CnCredentials.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +41 -4
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +90 -51
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +24 -33
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +12 -24
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnFavouriteToggle/CnFavouriteToggle.vue2.js +7 -2
- package/dist/esm/components/CnFavouriteToggle/CnFavouriteToggle.vue2.js.map +1 -1
- package/dist/esm/components/CnFavouriteToggle/CnFavouriteToggle.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +114 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +115 -62
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue2.js +89 -7
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue2.js.map +1 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue3.js +62 -30
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +242 -19
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +25 -20
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/selfModeActions.js +90 -14
- package/dist/esm/components/CnIndexPage/selfModeActions.js.map +1 -1
- package/dist/esm/components/CnIndexPage/useSelfFetchList.js +15 -3
- package/dist/esm/components/CnIndexPage/useSelfFetchList.js.map +1 -1
- package/dist/esm/components/CnObjectCard/CnObjectCard.vue2.js +26 -0
- package/dist/esm/components/CnObjectCard/CnObjectCard.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectCard/CnObjectCard.vue3.js +26 -9
- package/dist/esm/components/CnObjectCard/CnObjectCard.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +199 -7
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +155 -119
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +19 -3
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +6 -0
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +4 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
- package/dist/esm/components/CnRelatedObjectsWidget/CnRelatedObjectsWidget.vue2.js +153 -38
- package/dist/esm/components/CnRelatedObjectsWidget/CnRelatedObjectsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRelatedObjectsWidget/CnRelatedObjectsWidget.vue3.js +74 -56
- package/dist/esm/components/CnRelatedObjectsWidget/CnRelatedObjectsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +13 -0
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
- package/dist/esm/composables/useListView.js +4 -0
- package/dist/esm/composables/useListView.js.map +1 -1
- package/dist/esm/composables/useObjectLock.js +41 -10
- package/dist/esm/composables/useObjectLock.js.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +31 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +32 -2
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/nextcloud-vue.css +376 -75
- package/dist/esm/store/plugins/interactions.js +20 -10
- package/dist/esm/store/plugins/interactions.js.map +1 -1
- package/dist/esm/store/useObjectStore.js +54 -9
- package/dist/esm/store/useObjectStore.js.map +1 -1
- package/dist/esm/utils/builtInFormatters.js +15 -7
- package/dist/esm/utils/builtInFormatters.js.map +1 -1
- package/dist/esm/utils/groupAutocomplete.js +63 -1
- package/dist/esm/utils/groupAutocomplete.js.map +1 -1
- package/dist/esm/utils/lensAvailability.js +90 -0
- package/dist/esm/utils/lensAvailability.js.map +1 -0
- package/dist/esm/utils/objectSignals.js +44 -0
- package/dist/esm/utils/objectSignals.js.map +1 -0
- package/dist/esm/utils/personalLenses.js +13 -6
- package/dist/esm/utils/personalLenses.js.map +1 -1
- package/dist/esm/utils/recordInteractions.js +31 -13
- package/dist/esm/utils/recordInteractions.js.map +1 -1
- package/dist/esm/utils/resolveFilterTokens.js +46 -3
- package/dist/esm/utils/resolveFilterTokens.js.map +1 -1
- package/dist/esm/utils/schema.js +1 -1
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/sentinelTokens.js +4 -4
- package/dist/esm/utils/sentinelTokens.js.map +1 -1
- package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/esm/utils/widgetVisibility.js +46 -1
- package/dist/esm/utils/widgetVisibility.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +4732 -2990
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +376 -75
- package/l10n/en.json +31 -1
- package/l10n/nl.json +32 -2
- package/package.json +1 -1
- package/src/components/CnAppNav/CnAppNav.vue +44 -5
- package/src/components/CnCardGrid/CnCardGrid.md +1 -0
- package/src/components/CnCardGrid/CnCardGrid.vue +7 -0
- package/src/components/CnCellRenderer/CnCellRenderer.vue +56 -1
- package/src/components/CnCellRenderer/CnGroupNameCell.vue +61 -0
- package/src/components/CnCredentials/CnCredentials.vue +17 -16
- package/src/components/CnDataTable/CnDataTable.md +9 -0
- package/src/components/CnDataTable/CnDataTable.vue +80 -20
- package/src/components/CnDetailPage/CnDetailPage.vue +18 -32
- package/src/components/CnFavouriteToggle/CnFavouriteToggle.vue +7 -2
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +204 -5
- package/src/components/CnFollowToggle/CnFollowToggle.vue +118 -13
- package/src/components/CnIndexPage/CnIndexPage.md +51 -0
- package/src/components/CnIndexPage/CnIndexPage.vue +261 -35
- package/src/components/CnIndexPage/selfModeActions.js +89 -13
- package/src/components/CnIndexPage/useSelfFetchList.js +15 -3
- package/src/components/CnObjectCard/CnObjectCard.md +1 -0
- package/src/components/CnObjectCard/CnObjectCard.vue +89 -1
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +226 -2
- package/src/components/CnObjectListWidget/CnObjectListWidget.vue +19 -3
- package/src/components/CnObjectSidebar/CnFilesTab.vue +9 -0
- package/src/components/CnRelatedObjectsWidget/CnRelatedObjectsWidget.vue +181 -38
- package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +13 -0
- package/src/composables/__tests__/useObjectLock.endpoints.spec.js +83 -0
- package/src/composables/useListView.js +4 -0
- package/src/composables/useObjectLock.js +41 -10
- package/src/css/look-board-detail.css +40 -2
- package/src/css/look-board-index.css +35 -1
- package/src/css/table.css +82 -17
- package/src/index.js +3 -1
- package/src/schemas/app-manifest-v2.schema.json +11 -7
- package/src/store/plugins/interactions.js +20 -10
- package/src/store/useObjectStore.js +54 -9
- package/src/utils/builtInFormatters.js +15 -7
- package/src/utils/groupAutocomplete.js +75 -0
- package/src/utils/index.js +2 -1
- package/src/utils/lensAvailability.js +86 -0
- package/src/utils/objectSignals.js +41 -0
- package/src/utils/personalLenses.js +13 -6
- package/src/utils/recordInteractions.js +31 -13
- package/src/utils/resolveFilterTokens.js +45 -2
- package/src/utils/schema.js +1 -1
- package/src/utils/sentinelTokens.js +4 -4
- package/src/utils/validateManifestV2.compiled.js +2 -2
- package/src/utils/widgetVisibility.js +45 -0
|
@@ -8,12 +8,17 @@ import { setFavourite } from '../../utils/recordInteractions.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.
|
|
10
10
|
*
|
|
11
|
+
* @deprecated Following and favourites are one feature since OpenRegister's
|
|
12
|
+
* `merge-follow-and-favourites`: a favourite is a follow with notifications
|
|
13
|
+
* off. Use `CnFollowToggle`. Neither `CnDetailPage` nor `CnIndexPage` renders
|
|
14
|
+
* this star any more; it stays exported for one minor line so an app that
|
|
15
|
+
* placed it itself keeps working (the server answers it as a quiet follow).
|
|
16
|
+
*
|
|
11
17
|
* A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)
|
|
12
18
|
* `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on
|
|
13
19
|
* failure it flips back and shows the server's message. The server's answer is
|
|
14
20
|
* written into the stored object's `@self`, so a list showing the same record
|
|
15
|
-
* agrees.
|
|
16
|
-
* per row for `showFavouriteColumn`.
|
|
21
|
+
* agrees.
|
|
17
22
|
*
|
|
18
23
|
* Example:
|
|
19
24
|
* ```vue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnFavouriteToggle.vue2.js","sources":["../../../../src/components/CnFavouriteToggle/CnFavouriteToggle.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcButton\n\t\tclass=\"cn-favourite-toggle\"\n\t\t:class=\"{ 'cn-favourite-toggle--on': state }\"\n\t\tvariant=\"tertiary\"\n\t\t:aria-pressed=\"state ? 'true' : 'false'\"\n\t\t:aria-label=\"label\"\n\t\t:title=\"label\"\n\t\t:disabled=\"busy\"\n\t\tdata-testid=\"cn-favourite-toggle\"\n\t\t@click.stop=\"toggle\">\n\t\t<template #icon>\n\t\t\t<Star v-if=\"state\" :size=\"20\" class=\"cn-favourite-toggle__star\" />\n\t\t\t<StarOutline v-else :size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton } from '@nextcloud/vue'\nimport Star from 'vue-material-design-icons/Star.vue'\nimport StarOutline from 'vue-material-design-icons/StarOutline.vue'\nimport { patchStoredSelf } from '../../utils/patchStoredSelf.js'\nimport { setFavourite } from '../../utils/recordInteractions.js'\n\n/**\n * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.\n *\n * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)\n * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on\n * failure it flips back and shows the server's message. The server's answer is\n * written into the stored object's `@self`, so a list showing the same record\n * agrees
|
|
1
|
+
{"version":3,"file":"CnFavouriteToggle.vue2.js","sources":["../../../../src/components/CnFavouriteToggle/CnFavouriteToggle.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcButton\n\t\tclass=\"cn-favourite-toggle\"\n\t\t:class=\"{ 'cn-favourite-toggle--on': state }\"\n\t\tvariant=\"tertiary\"\n\t\t:aria-pressed=\"state ? 'true' : 'false'\"\n\t\t:aria-label=\"label\"\n\t\t:title=\"label\"\n\t\t:disabled=\"busy\"\n\t\tdata-testid=\"cn-favourite-toggle\"\n\t\t@click.stop=\"toggle\">\n\t\t<template #icon>\n\t\t\t<Star v-if=\"state\" :size=\"20\" class=\"cn-favourite-toggle__star\" />\n\t\t\t<StarOutline v-else :size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton } from '@nextcloud/vue'\nimport Star from 'vue-material-design-icons/Star.vue'\nimport StarOutline from 'vue-material-design-icons/StarOutline.vue'\nimport { patchStoredSelf } from '../../utils/patchStoredSelf.js'\nimport { setFavourite } from '../../utils/recordInteractions.js'\n\n/**\n * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.\n *\n * @deprecated Following and favourites are one feature since OpenRegister's\n * `merge-follow-and-favourites`: a favourite is a follow with notifications\n * off. Use `CnFollowToggle`. Neither `CnDetailPage` nor `CnIndexPage` renders\n * this star any more; it stays exported for one minor line so an app that\n * placed it itself keeps working (the server answers it as a quiet follow).\n *\n * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)\n * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on\n * failure it flips back and shows the server's message. The server's answer is\n * written into the stored object's `@self`, so a list showing the same record\n * agrees.\n *\n * Example:\n * ```vue\n * <CnFavouriteToggle register=\"pipelinq\" schema=\"ticket\" :object-id=\"id\"\n * :favourite=\"object['@self'].favourite\" />\n * ```\n */\nexport default {\n\tname: 'CnFavouriteToggle',\n\n\tcomponents: { NcButton, Star, StarOutline },\n\n\tprops: {\n\t\t/** Register slug of the record. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Schema slug of the record. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Id of the record. */\n\t\tobjectId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Whether the record is currently starred (`@self.favourite`). */\n\t\tfavourite: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Accessible label when the record is not starred. */\n\t\taddLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Add to favourites'),\n\t\t},\n\n\t\t/** Accessible label when the record is starred. */\n\t\tremoveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Remove from favourites'),\n\t\t},\n\t},\n\n\temits: ['change', 'error', 'not-found', 'update:favourite'],\n\n\tdata() {\n\t\treturn { state: this.favourite, busy: false }\n\t},\n\n\tcomputed: {\n\t\tlabel() {\n\t\t\treturn this.state ? this.removeLabel : this.addLabel\n\t\t},\n\t},\n\n\twatch: {\n\t\tfavourite(value) {\n\t\t\tthis.state = value\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync toggle() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = this.state\n\t\t\tthis.state = !previous\n\t\t\tthis.busy = true\n\t\t\tconst result = await setFavourite(this.register, this.schema, this.objectId, this.state)\n\t\t\tthis.busy = false\n\t\t\tif (!result.ok) {\n\t\t\t\tthis.state = previous\n\t\t\t\tconst message = result.status === 404\n\t\t\t\t\t? t('nextcloud-vue', 'You can no longer see this record.')\n\t\t\t\t\t: (result.message || t('nextcloud-vue', 'Could not change the favourite.'))\n\t\t\t\timport('@nextcloud/dialogs').then(({ showError }) => showError(message)).catch(() => {})\n\t\t\t\t/** @event error Emitted when the call failed; payload is the message shown. */\n\t\t\t\tthis.$emit('error', message)\n\t\t\t\tif (result.status === 404) {\n\t\t\t\t\t/** @event not-found Emitted on a 404: the record went away or access was withdrawn. */\n\t\t\t\t\tthis.$emit('not-found')\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpatchStoredSelf(this.register, this.schema, this.objectId, { favourite: this.state })\n\t\t\t/** @event change Emitted after a successful call. Payload: `{ favourite }`. */\n\t\t\tthis.$emit('change', { favourite: this.state })\n\t\t\t/** @event update:favourite Emitted with the new state, for `v-model:favourite`. */\n\t\t\tthis.$emit('update:favourite', this.state)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-favourite-toggle__star {\n\tcolor: var(--color-warning);\n}\n</style>\n"],"names":["t"],"mappings":";;;;;;;AA8BA;AACC;AACA;AACA;AACA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ACA,GAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC,KAAK,EAAA;GACzC;EACD;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnFavouriteToggle.vue3.js","sources":["../../../../src/components/CnFavouriteToggle/CnFavouriteToggle.vue?vue&type=template&id=836dad16&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcButton\n\t\tclass=\"cn-favourite-toggle\"\n\t\t:class=\"{ 'cn-favourite-toggle--on': state }\"\n\t\tvariant=\"tertiary\"\n\t\t:aria-pressed=\"state ? 'true' : 'false'\"\n\t\t:aria-label=\"label\"\n\t\t:title=\"label\"\n\t\t:disabled=\"busy\"\n\t\tdata-testid=\"cn-favourite-toggle\"\n\t\t@click.stop=\"toggle\">\n\t\t<template #icon>\n\t\t\t<Star v-if=\"state\" :size=\"20\" class=\"cn-favourite-toggle__star\" />\n\t\t\t<StarOutline v-else :size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton } from '@nextcloud/vue'\nimport Star from 'vue-material-design-icons/Star.vue'\nimport StarOutline from 'vue-material-design-icons/StarOutline.vue'\nimport { patchStoredSelf } from '../../utils/patchStoredSelf.js'\nimport { setFavourite } from '../../utils/recordInteractions.js'\n\n/**\n * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.\n *\n * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)\n * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on\n * failure it flips back and shows the server's message. The server's answer is\n * written into the stored object's `@self`, so a list showing the same record\n * agrees
|
|
1
|
+
{"version":3,"file":"CnFavouriteToggle.vue3.js","sources":["../../../../src/components/CnFavouriteToggle/CnFavouriteToggle.vue?vue&type=template&id=836dad16&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcButton\n\t\tclass=\"cn-favourite-toggle\"\n\t\t:class=\"{ 'cn-favourite-toggle--on': state }\"\n\t\tvariant=\"tertiary\"\n\t\t:aria-pressed=\"state ? 'true' : 'false'\"\n\t\t:aria-label=\"label\"\n\t\t:title=\"label\"\n\t\t:disabled=\"busy\"\n\t\tdata-testid=\"cn-favourite-toggle\"\n\t\t@click.stop=\"toggle\">\n\t\t<template #icon>\n\t\t\t<Star v-if=\"state\" :size=\"20\" class=\"cn-favourite-toggle__star\" />\n\t\t\t<StarOutline v-else :size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton } from '@nextcloud/vue'\nimport Star from 'vue-material-design-icons/Star.vue'\nimport StarOutline from 'vue-material-design-icons/StarOutline.vue'\nimport { patchStoredSelf } from '../../utils/patchStoredSelf.js'\nimport { setFavourite } from '../../utils/recordInteractions.js'\n\n/**\n * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.\n *\n * @deprecated Following and favourites are one feature since OpenRegister's\n * `merge-follow-and-favourites`: a favourite is a follow with notifications\n * off. Use `CnFollowToggle`. Neither `CnDetailPage` nor `CnIndexPage` renders\n * this star any more; it stays exported for one minor line so an app that\n * placed it itself keeps working (the server answers it as a quiet follow).\n *\n * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)\n * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on\n * failure it flips back and shows the server's message. The server's answer is\n * written into the stored object's `@self`, so a list showing the same record\n * agrees.\n *\n * Example:\n * ```vue\n * <CnFavouriteToggle register=\"pipelinq\" schema=\"ticket\" :object-id=\"id\"\n * :favourite=\"object['@self'].favourite\" />\n * ```\n */\nexport default {\n\tname: 'CnFavouriteToggle',\n\n\tcomponents: { NcButton, Star, StarOutline },\n\n\tprops: {\n\t\t/** Register slug of the record. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Schema slug of the record. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Id of the record. */\n\t\tobjectId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Whether the record is currently starred (`@self.favourite`). */\n\t\tfavourite: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Accessible label when the record is not starred. */\n\t\taddLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Add to favourites'),\n\t\t},\n\n\t\t/** Accessible label when the record is starred. */\n\t\tremoveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Remove from favourites'),\n\t\t},\n\t},\n\n\temits: ['change', 'error', 'not-found', 'update:favourite'],\n\n\tdata() {\n\t\treturn { state: this.favourite, busy: false }\n\t},\n\n\tcomputed: {\n\t\tlabel() {\n\t\t\treturn this.state ? this.removeLabel : this.addLabel\n\t\t},\n\t},\n\n\twatch: {\n\t\tfavourite(value) {\n\t\t\tthis.state = value\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync toggle() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = this.state\n\t\t\tthis.state = !previous\n\t\t\tthis.busy = true\n\t\t\tconst result = await setFavourite(this.register, this.schema, this.objectId, this.state)\n\t\t\tthis.busy = false\n\t\t\tif (!result.ok) {\n\t\t\t\tthis.state = previous\n\t\t\t\tconst message = result.status === 404\n\t\t\t\t\t? t('nextcloud-vue', 'You can no longer see this record.')\n\t\t\t\t\t: (result.message || t('nextcloud-vue', 'Could not change the favourite.'))\n\t\t\t\timport('@nextcloud/dialogs').then(({ showError }) => showError(message)).catch(() => {})\n\t\t\t\t/** @event error Emitted when the call failed; payload is the message shown. */\n\t\t\t\tthis.$emit('error', message)\n\t\t\t\tif (result.status === 404) {\n\t\t\t\t\t/** @event not-found Emitted on a 404: the record went away or access was withdrawn. */\n\t\t\t\t\tthis.$emit('not-found')\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpatchStoredSelf(this.register, this.schema, this.objectId, { favourite: this.state })\n\t\t\t/** @event change Emitted after a successful call. Payload: `{ favourite }`. */\n\t\t\tthis.$emit('change', { favourite: this.state })\n\t\t\t/** @event update:favourite Emitted with the new state, for `v-model:favourite`. */\n\t\t\tthis.$emit('update:favourite', this.state)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-favourite-toggle__star {\n\tcolor: var(--color-warning);\n}\n</style>\n"],"names":["_createBlock","_normalizeClass"],"mappings":";;;;;;;uBASEA;IACA,KAAK,EAAAC,cAAA,CAAA,CAAC,qBAAY,EAAA,EAAA,yBAAA,EACL,KAAA,CAAA,KAAA,EAAA,CAAA,CAAA;AACb,IAAA,OAAO,EAAC,UAAO;AACd,IAAA,cAAY,EAAE,KAAK,CAAA,KAAA,GAAA,MAAA,GAAA,OAAA;AACnB,IAAA,YAAU,EAAE,QAAK,CAAA,KAAA;AACjB,IAAA,KAAK,EAAE,QAAK,CAAA,KAAA;AACZ,IAAA,QAAQ,EAAE,KAAI,CAAA,IAAA;iBACJ,EAAC,qBAAqB;AAChC,IAAA,OAAK,gBAAI,QAAA,CAAA,MAAA,EAAA,CAAA,MAAA,CAAA,CAAA;;AACD,IAAA,IAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { getCurrentUser } from '@nextcloud/auth';
|
|
|
2
2
|
import axios__default from '@nextcloud/axios';
|
|
3
3
|
import { View, sortNodes, getNewFileMenuEntries, FileType, getFileActions, formatFileSize } from '@nextcloud/files';
|
|
4
4
|
import { getRootPath, getClient, resultToNode, getRemoteURL, getDefaultPropfind } from '@nextcloud/files/dav';
|
|
5
|
-
import { translate } from '@nextcloud/l10n';
|
|
5
|
+
import { translate, translatePlural } from '@nextcloud/l10n';
|
|
6
6
|
import { generateUrl } from '@nextcloud/router';
|
|
7
7
|
import { NcActionButton, NcActionCheckbox, NcActionLink, NcActionSeparator, NcActions, NcBreadcrumb, NcBreadcrumbs, NcButton, NcDateTime, NcDialog, NcIconSvgWrapper, NcLoadingIcon, NcProgressBar, NcTextField } from '@nextcloud/vue';
|
|
8
8
|
import AlertCircleOutline from 'vue-material-design-icons/AlertCircleOutline.vue';
|
|
@@ -177,6 +177,51 @@ var script = {
|
|
|
177
177
|
default: () => translate('nextcloud-vue', 'Show in Files'),
|
|
178
178
|
},
|
|
179
179
|
|
|
180
|
+
/**
|
|
181
|
+
* Show a primary upload button beside the New menu, which then steps
|
|
182
|
+
* back to a secondary button. Off (the default) keeps the upload
|
|
183
|
+
* inside the New menu only.
|
|
184
|
+
*/
|
|
185
|
+
uploadButton: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
default: false,
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
/** Label of the upload button `uploadButton` shows. */
|
|
191
|
+
uploadButtonLabel: {
|
|
192
|
+
type: String,
|
|
193
|
+
default: () => translate('nextcloud-vue', 'Add files'),
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Draw the drop state over the browser while files are dragged onto
|
|
198
|
+
* it (a dashed frame and `dropLabel`, centred) and announce it to
|
|
199
|
+
* screen readers. Off (the default) keeps the plain dashed outline and
|
|
200
|
+
* announces nothing.
|
|
201
|
+
*/
|
|
202
|
+
dropOverlay: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
default: false,
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
/** The line `dropOverlay` draws and announces. */
|
|
208
|
+
dropLabel: {
|
|
209
|
+
type: String,
|
|
210
|
+
default: () => translate('nextcloud-vue', 'Drop to add'),
|
|
211
|
+
},
|
|
212
|
+
|
|
213
|
+
/** Show a line under the list saying files can be dropped on it. */
|
|
214
|
+
dropHint: {
|
|
215
|
+
type: Boolean,
|
|
216
|
+
default: false,
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
/** The line `dropHint` shows. */
|
|
220
|
+
dropHintLabel: {
|
|
221
|
+
type: String,
|
|
222
|
+
default: () => translate('nextcloud-vue', 'Or drag files onto this list.'),
|
|
223
|
+
},
|
|
224
|
+
|
|
180
225
|
/** Title of the empty state. */
|
|
181
226
|
emptyLabel: {
|
|
182
227
|
type: String,
|
|
@@ -279,6 +324,10 @@ var script = {
|
|
|
279
324
|
*/
|
|
280
325
|
visibleColumnKeys: null,
|
|
281
326
|
dragging: false,
|
|
327
|
+
/** Nested dragenter/dragleave pairs, so a child does not end the drag. */
|
|
328
|
+
dragDepth: 0,
|
|
329
|
+
/** What the live region says: the drop label, then what was added. */
|
|
330
|
+
dropStatus: '',
|
|
282
331
|
uploads: [],
|
|
283
332
|
previewFailed: {},
|
|
284
333
|
newFolderOpen: false,
|
|
@@ -818,10 +867,74 @@ var script = {
|
|
|
818
867
|
*/
|
|
819
868
|
async onDrop(event) {
|
|
820
869
|
this.dragging = false;
|
|
870
|
+
this.dragDepth = 0;
|
|
871
|
+
this.dropStatus = '';
|
|
821
872
|
const files = event.dataTransfer?.files;
|
|
822
873
|
if (files?.length) {
|
|
823
874
|
await this.uploadFiles(files);
|
|
875
|
+
if (this.dropOverlay) {
|
|
876
|
+
this.dropStatus = translatePlural('nextcloud-vue', '%n file added', '%n files added', files.length);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Something is dragged into the browser: show the drop state when it
|
|
883
|
+
* carries files, and say so once.
|
|
884
|
+
*
|
|
885
|
+
* @param {DragEvent} event The drag.
|
|
886
|
+
* @return {void}
|
|
887
|
+
*/
|
|
888
|
+
onDragEnter(event) {
|
|
889
|
+
if (!this.carriesFiles(event)) {
|
|
890
|
+
return
|
|
891
|
+
}
|
|
892
|
+
this.dragDepth++;
|
|
893
|
+
if (!this.dragging) {
|
|
894
|
+
this.dragging = true;
|
|
895
|
+
this.dropStatus = this.dropOverlay ? this.dropLabel : '';
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Keep the drop state while files move over the browser.
|
|
901
|
+
*
|
|
902
|
+
* @param {DragEvent} event The drag.
|
|
903
|
+
* @return {void}
|
|
904
|
+
*/
|
|
905
|
+
onDragOver(event) {
|
|
906
|
+
if (this.carriesFiles(event)) {
|
|
907
|
+
this.dragging = true;
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Something left the browser, or one of its children. The drop state
|
|
913
|
+
* ends only when the drag has left the browser itself.
|
|
914
|
+
*
|
|
915
|
+
* @return {void}
|
|
916
|
+
*/
|
|
917
|
+
onDragLeave() {
|
|
918
|
+
this.dragDepth = Math.max(0, this.dragDepth - 1);
|
|
919
|
+
if (this.dragDepth === 0) {
|
|
920
|
+
this.dragging = false;
|
|
921
|
+
this.dropStatus = '';
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Whether a drag carries files (not text or a link from the page).
|
|
927
|
+
* A drag whose types cannot be read counts as files, as before.
|
|
928
|
+
*
|
|
929
|
+
* @param {DragEvent} event The drag.
|
|
930
|
+
* @return {boolean}
|
|
931
|
+
*/
|
|
932
|
+
carriesFiles(event) {
|
|
933
|
+
const types = event?.dataTransfer?.types;
|
|
934
|
+
if (!types) {
|
|
935
|
+
return true
|
|
824
936
|
}
|
|
937
|
+
return Array.from(types).includes('Files')
|
|
825
938
|
},
|
|
826
939
|
|
|
827
940
|
/**
|