@conduction/nextcloud-vue 2.68.0 → 2.69.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.
Files changed (43) hide show
  1. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +21 -35
  2. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  3. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +17 -0
  4. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  5. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +40 -3
  6. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  7. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +58 -16
  8. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  9. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +2 -2
  10. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  11. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  12. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js +70 -1
  13. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js.map +1 -1
  14. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js +23 -3
  15. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js.map +1 -1
  16. package/dist/esm/l10n/en.json.js +3 -0
  17. package/dist/esm/l10n/en.json.js.map +1 -1
  18. package/dist/esm/l10n/nl.json.js +3 -0
  19. package/dist/esm/l10n/nl.json.js.map +1 -1
  20. package/dist/esm/mixins/pageViews.js +278 -11
  21. package/dist/esm/mixins/pageViews.js.map +1 -1
  22. package/dist/esm/store/plugins/dashboardLayouts.js +35 -1
  23. package/dist/esm/store/plugins/dashboardLayouts.js.map +1 -1
  24. package/dist/esm/utils/formatMetric.js +137 -16
  25. package/dist/esm/utils/formatMetric.js.map +1 -1
  26. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  27. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  28. package/dist/nextcloud-vue.cjs.js +678 -83
  29. package/dist/nextcloud-vue.cjs.js.map +2 -2
  30. package/l10n/en.json +3 -0
  31. package/l10n/nl.json +3 -0
  32. package/package.json +1 -1
  33. package/src/components/CnDashboardPage/CnDashboardPage.md +2 -0
  34. package/src/components/CnDashboardPage/CnDashboardPage.vue +34 -35
  35. package/src/components/CnDetailPage/CnDetailPage.md +6 -0
  36. package/src/components/CnDetailPage/CnDetailPage.vue +67 -5
  37. package/src/components/CnStatWidget/CnStatWidget.vue +2 -2
  38. package/src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue +82 -3
  39. package/src/mixins/pageViews.js +277 -10
  40. package/src/schemas/app-manifest-v2.schema.json +28 -2
  41. package/src/store/plugins/dashboardLayouts.js +34 -0
  42. package/src/utils/formatMetric.js +143 -15
  43. package/src/utils/validateManifestV2.compiled.js +2 -2
@@ -6,6 +6,7 @@ import Check from 'vue-material-design-icons/Check.vue';
6
6
  import Cog from 'vue-material-design-icons/Cog.vue';
7
7
  import Download from 'vue-material-design-icons/Download.vue';
8
8
  import Pencil from 'vue-material-design-icons/Pencil.vue';
9
+ import Restore from 'vue-material-design-icons/Restore.vue';
9
10
  import ViewDashboardOutline from 'vue-material-design-icons/ViewDashboardOutline.vue';
10
11
  import __sfc_main$c from '../../dialogs/CnWidgetStyleEditorModal.vue.js';
11
12
  import __sfc_main$7 from '../CnBodySections/CnBodySections.vue.js';
@@ -20,9 +21,8 @@ import __sfc_main$6 from '../CnWidgetRefItem/CnWidgetRefItem.vue.js';
20
21
  import __sfc_main$2 from '../CnWidgetRenderer/CnWidgetRenderer.vue.js';
21
22
  import __sfc_main$1 from '../CnWidgetWrapper/CnWidgetWrapper.vue.js';
22
23
  import { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js';
23
- import { readUserPreference, writeUserPreference } from '../../composables/useUserPreferences.js';
24
24
  import { pageViews } from '../../mixins/pageViews.js';
25
- import { mergeUserLayout, dashboardLayoutKey } from '../../store/plugins/dashboardLayouts.js';
25
+ import { mergeUserLayout, resolveUserLayoutApi } from '../../store/plugins/dashboardLayouts.js';
26
26
  import { isAppInstalled } from '../../utils/appInstalled.js';
27
27
  import { readVisibleWhenValue, compareVisibleWhen } from '../../utils/visibleWhen.js';
28
28
  import { canonicalWidgetType } from '../../utils/widgetTypeAliases.js';
@@ -158,6 +158,7 @@ var script = {
158
158
  NcLoadingIcon,
159
159
  NcSelect,
160
160
  Pencil,
161
+ Restore,
161
162
  Check,
162
163
  Cog,
163
164
  CalendarRange,
@@ -1211,7 +1212,7 @@ var script = {
1211
1212
  * @spec openspec/changes/view-switch-containers/specs/view-switch-containers/spec.md#requirement-a-view-with-nothing-to-draw-says-so
1212
1213
  */
1213
1214
  viewDisplayLayout() {
1214
- const items = this.activeView ? this.activeView.layout : [];
1215
+ const items = this.activeViewLayout;
1215
1216
  if (this.gridEditable) {
1216
1217
  return items
1217
1218
  }
@@ -1253,8 +1254,9 @@ var script = {
1253
1254
  key: `view-${this.activeViewId}`,
1254
1255
  view: true,
1255
1256
  layout: this.viewDisplayLayout,
1256
- // A user arrangement covers the page's own layout only.
1257
- editable: this.gridEditable && !this.userLayout,
1257
+ // With `userLayout` the user arranges the view too; the
1258
+ // arrangement is kept per view (pageViews mixin).
1259
+ editable: this.gridEditable,
1258
1260
  attrs: {
1259
1261
  id: this.viewRegionId,
1260
1262
  role: 'region',
@@ -1974,6 +1976,7 @@ var script = {
1974
1976
  // the user's arrangement is finished when they say it is.
1975
1977
  if (leaving) {
1976
1978
  this.saveUserLayout();
1979
+ this.saveViewUserLayouts();
1977
1980
  }
1978
1981
 
1979
1982
  /**
@@ -2033,6 +2036,17 @@ var script = {
2033
2036
  }
2034
2037
  },
2035
2038
 
2039
+ /**
2040
+ * The edit-mode reset: the page's own grid and the chosen view return
2041
+ * to the manifest layout. Other views keep this user's arrangement.
2042
+ *
2043
+ * @return {Promise<void>}
2044
+ * @spec openspec/changes/page-view-user-layouts/specs/view-switch-containers/spec.md#requirement-resetting-a-view-restores-its-manifest-layout
2045
+ */
2046
+ async resetLayout() {
2047
+ await Promise.all([this.resetUserLayout(), this.resetViewUserLayout()]);
2048
+ },
2049
+
2036
2050
  /**
2037
2051
  * Drop this user's arrangement and return to the manifest.
2038
2052
  *
@@ -2085,35 +2099,7 @@ var script = {
2085
2099
  * @return {{ load: (appId: string, pageId: string) => Promise<object|null>, save: (appId: string, pageId: string, layout: Array<object>) => Promise<boolean>, reset: (appId: string, pageId: string) => Promise<boolean> }} The api.
2086
2100
  */
2087
2101
  userLayoutApi() {
2088
- const store = this.userLayoutStore;
2089
- if (store && typeof store.loadDashboardLayout === 'function') {
2090
- return {
2091
- load: (...a) => store.loadDashboardLayout(...a),
2092
- save: (...a) => store.saveDashboardLayout(...a),
2093
- reset: (...a) => store.resetDashboardLayout(...a),
2094
- }
2095
- }
2096
-
2097
- return {
2098
- load: (appId, pageId) => readUserPreference(appId, dashboardLayoutKey(pageId), null),
2099
- save: (appId, pageId, layout) => writeUserPreference(
2100
- appId,
2101
- dashboardLayoutKey(pageId),
2102
- { items: (layout || []).map((i) => ({
2103
- widgetId: i.widgetId,
2104
- gridX: i.gridX,
2105
- gridY: i.gridY,
2106
- gridWidth: i.gridWidth,
2107
- gridHeight: i.gridHeight,
2108
- })) },
2109
- ),
2110
-
2111
- reset: (appId, pageId) => writeUserPreference(
2112
- appId,
2113
- dashboardLayoutKey(pageId),
2114
- { items: [] },
2115
- ),
2116
- }
2102
+ return resolveUserLayoutApi(this.userLayoutStore)
2117
2103
  },
2118
2104
 
2119
2105
  onLayoutChange(updated) {
@@ -3159,7 +3145,7 @@ var script = {
3159
3145
  // library's own defaults, so a manifest need not set them — but a
3160
3146
  // manifest that DOES set them must reach the component, or the
3161
3147
  // declaration is a silent no-op that reads like configuration.
3162
- for (const key of ['countLabel', 'variant', 'showZeroCount', 'horizontal', 'vertical', 'filled', 'route', 'iconClass']) {
3148
+ for (const key of ['countLabel', 'variant', 'showZeroCount', 'horizontal', 'vertical', 'filled', 'route', 'iconClass', 'format']) {
3163
3149
  if (props[key] !== undefined) {
3164
3150
  out[key] = props[key];
3165
3151
  }