@conduction/nextcloud-vue 2.111.0 → 2.112.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 (127) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +3 -2
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +4 -2
  5. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  6. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue.js +1 -1
  7. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js +3 -2
  8. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js.map +1 -1
  9. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js +2 -1
  10. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js.map +1 -1
  11. package/dist/esm/components/CnBoardView/CnBoardView.vue.js +1 -1
  12. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js +54 -5
  13. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js.map +1 -1
  14. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js +16 -2
  15. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js.map +1 -1
  16. package/dist/esm/components/CnCardGrid/CnCardGrid.vue.js +1 -1
  17. package/dist/esm/components/CnCardGrid/CnCardGrid.vue2.js +10 -0
  18. package/dist/esm/components/CnCardGrid/CnCardGrid.vue2.js.map +1 -1
  19. package/dist/esm/components/CnCardGrid/CnCardGrid.vue3.js +2 -1
  20. package/dist/esm/components/CnCardGrid/CnCardGrid.vue3.js.map +1 -1
  21. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
  22. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +22 -2
  23. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  24. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +17 -3
  25. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  26. package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
  27. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
  28. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
  29. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +32 -8
  30. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  31. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +31 -3
  32. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  33. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  34. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +48 -11
  35. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  36. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js +160 -97
  37. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  38. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  39. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  40. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +2 -2
  41. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  42. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +166 -2
  43. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  44. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +19 -4
  45. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  46. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue.js +1 -1
  47. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue2.js +21 -1
  48. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue2.js.map +1 -1
  49. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue3.js.map +1 -1
  50. package/dist/esm/components/CnObjectCard/CnObjectCard.vue.js +1 -1
  51. package/dist/esm/components/CnObjectCard/CnObjectCard.vue2.js +36 -2
  52. package/dist/esm/components/CnObjectCard/CnObjectCard.vue2.js.map +1 -1
  53. package/dist/esm/components/CnObjectCard/CnObjectCard.vue3.js +44 -5
  54. package/dist/esm/components/CnObjectCard/CnObjectCard.vue3.js.map +1 -1
  55. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js +1 -0
  56. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js.map +1 -1
  57. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js +22 -2
  58. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js.map +1 -1
  59. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js +36 -16
  60. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js.map +1 -1
  61. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue.js +1 -1
  62. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue2.js.map +1 -1
  63. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue3.js.map +1 -1
  64. package/dist/esm/composables/useRefLabels.js +26 -6
  65. package/dist/esm/composables/useRefLabels.js.map +1 -1
  66. package/dist/esm/integrations/registry.js +4 -0
  67. package/dist/esm/integrations/registry.js.map +1 -1
  68. package/dist/esm/l10n/en.json.js +3 -1
  69. package/dist/esm/l10n/en.json.js.map +1 -1
  70. package/dist/esm/l10n/nl.json.js +3 -1
  71. package/dist/esm/l10n/nl.json.js.map +1 -1
  72. package/dist/esm/library-style.js +1 -1
  73. package/dist/esm/nextcloud-vue.css +533 -273
  74. package/dist/esm/store/plugins/liveUpdates.js +3 -1
  75. package/dist/esm/store/plugins/liveUpdates.js.map +1 -1
  76. package/dist/esm/store/plugins/logs.js +2 -1
  77. package/dist/esm/store/plugins/logs.js.map +1 -1
  78. package/dist/esm/utils/detailActionModel.js +28 -1
  79. package/dist/esm/utils/detailActionModel.js.map +1 -1
  80. package/dist/esm/utils/fillTemplate.js +13 -5
  81. package/dist/esm/utils/fillTemplate.js.map +1 -1
  82. package/dist/esm/utils/headerFieldChips.js +21 -2
  83. package/dist/esm/utils/headerFieldChips.js.map +1 -1
  84. package/dist/esm/utils/mapList.js +26 -11
  85. package/dist/esm/utils/mapList.js.map +1 -1
  86. package/dist/esm/utils/savedViewMenu.js +12 -5
  87. package/dist/esm/utils/savedViewMenu.js.map +1 -1
  88. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  89. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  90. package/dist/nextcloud-vue.cjs.js +2562 -1886
  91. package/dist/nextcloud-vue.cjs.js.map +2 -2
  92. package/dist/nextcloud-vue.css +533 -273
  93. package/l10n/en.json +3 -1
  94. package/l10n/nl.json +3 -1
  95. package/package.json +1 -1
  96. package/src/components/CnActionDialog/CnActionDialog.vue +32 -9
  97. package/src/components/CnAssignDialog/CnAssignDialog.vue +4 -2
  98. package/src/components/CnBoardView/CnBoardView.vue +58 -5
  99. package/src/components/CnCardGrid/CnCardGrid.md +1 -0
  100. package/src/components/CnCardGrid/CnCardGrid.vue +11 -0
  101. package/src/components/CnCellRenderer/CnCellRenderer.vue +27 -3
  102. package/src/components/CnChartWidget/CnChartWidget.vue +6 -0
  103. package/src/components/CnDetailPage/CnDetailPage.vue +42 -9
  104. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +100 -5
  105. package/src/components/CnFormDialog/CnFormDialog.vue +1 -1
  106. package/src/components/CnIndexPage/CnIndexPage.vue +174 -4
  107. package/src/components/CnNcDashboardList/CnNcDashboardList.vue +21 -1
  108. package/src/components/CnObjectCard/CnObjectCard.md +1 -0
  109. package/src/components/CnObjectCard/CnObjectCard.vue +51 -5
  110. package/src/components/CnPartyPicker/CnPartyPicker.vue +62 -16
  111. package/src/components/CnSearchSelect/CnSearchSelect.vue +8 -0
  112. package/src/composables/useRefLabels.js +25 -5
  113. package/src/css/dialog.css +53 -3
  114. package/src/css/index-page.css +26 -1
  115. package/src/css/look-board-detail.css +36 -15
  116. package/src/css/look-board-index.css +69 -3
  117. package/src/css/look-board.css +30 -2
  118. package/src/integrations/registry.js +4 -0
  119. package/src/schemas/app-manifest-v2.schema.json +11 -5
  120. package/src/store/plugins/liveUpdates.js +3 -1
  121. package/src/store/plugins/logs.js +2 -1
  122. package/src/utils/detailActionModel.js +27 -0
  123. package/src/utils/fillTemplate.js +13 -5
  124. package/src/utils/headerFieldChips.js +21 -2
  125. package/src/utils/mapList.js +26 -11
  126. package/src/utils/savedViewMenu.js +12 -5
  127. package/src/utils/validateManifestV2.compiled.js +3 -3
@@ -443,6 +443,8 @@ var script = {
443
443
 
444
444
  inject: {
445
445
  cnCustomComponents: { default: () => ({}) },
446
+ /** The app's named formatters, provided by CnAppRoot, for the map list's pills and template tokens. */
447
+ cnFormatters: { default: () => ({}) },
446
448
  /** The permissions the user holds, provided by CnAppRoot; for gated page tabs. */
447
449
  cnPermissions: { default: () => [] },
448
450
  /** The app config an ancestor provides, for `@config.<key>` in quick-filter labels. */
@@ -2801,6 +2803,8 @@ var script = {
2801
2803
  boardPrevPageSize: this.viewMode === 'board' ? ((this.pagination && this.pagination.limit) || 20) : null,
2802
2804
  /** Resolved labels of reference columns: `{ [columnKey]: { [id]: label|null } }`. */
2803
2805
  refLabels: {},
2806
+ /** Colour and icon names of the records badge columns point at: `{ [columnKey]: { [id]: { color, icon } } }`. */
2807
+ refLooks: {},
2804
2808
  /** Count per tab-strip index, for the entries that asked for one; null = none. */
2805
2809
  tabCounts: null,
2806
2810
  // The counts of the `filterStrip` pills, by pill key ('all', 'v0', ...).
@@ -4715,6 +4719,12 @@ var script = {
4715
4719
  */
4716
4720
  renderedColumns() {
4717
4721
  let cols = this.tableColumns;
4722
+ if (this.refLookSpecs.length > 0) {
4723
+ const lookKeys = new Set(this.refLookSpecs.map((spec) => spec.key));
4724
+ cols = cols.map((col) => (col && typeof col === 'object' && lookKeys.has(col.key)
4725
+ ? { ...col, widgetProps: { ...(col.widgetProps || {}), looks: this.refLooks[col.key] || {} } }
4726
+ : col));
4727
+ }
4718
4728
  if (this.refLabelSpecs.length > 0) {
4719
4729
  const byKey = new Map(this.refLabelSpecs.map((s) => [s.key, s]));
4720
4730
  cols = cols.map((col) => {
@@ -4785,6 +4795,108 @@ var script = {
4785
4795
  *
4786
4796
  * @return {Object<string, string[]>} Distinct ids per column key.
4787
4797
  */
4798
+ /**
4799
+ * The pills that take their tone and icon from the record they point at
4800
+ * (`resolve: { colorField?, iconField?, register?, schema? }`): badge
4801
+ * columns and the list view's leading and trailing cells
4802
+ * (`widgetProps.resolve`), the board card's pill (`board.card.resolve`)
4803
+ * and the record card's pills (`cardLayout` headPill, footerPill, chips).
4804
+ * Register and schema default to the field's reference in the schema.
4805
+ *
4806
+ * @return {Array<{key: string, register: string, schema: string, colorField: string, iconField: string}>} The specs.
4807
+ * @spec openspec/changes/pill-color-field/specs/pill-color-field/spec.md#requirement-a-badge-cell-takes-its-tone-and-icon-from-the-referenced-record
4808
+ */
4809
+ refLookSpecs() {
4810
+ const list = this.listConfig || {};
4811
+ const listCells = [list.leading, ...(Array.isArray(list.trailing) ? list.trailing : [list.trailing])];
4812
+ const badgeSources = [...this.tableColumns, ...listCells]
4813
+ .filter((c) => c && typeof c === 'object' && c.widget === 'badge' && c.widgetProps)
4814
+ .map((c) => ({ key: c.key, resolve: c.widgetProps.resolve }));
4815
+ // The board card's pill (`board.card.pill` with `board.card.resolve`)
4816
+ // and the record card's pills (`cardLayout` headPill, footerPill,
4817
+ // chips, each with its own `resolve`).
4818
+ const card = this.board && this.board.card && typeof this.board.card === 'object' ? this.board.card : {};
4819
+ const layout = this.cardLayout && typeof this.cardLayout === 'object' ? this.cardLayout : {};
4820
+ const layoutPills = [layout.headPill, layout.footerPill, ...(Array.isArray(layout.chips) ? layout.chips : [])]
4821
+ .filter((def) => def && typeof def === 'object')
4822
+ .map((def) => ({ key: def.field, resolve: def.resolve }));
4823
+ // The map list's pills (`mapConfig.list.pills`, each with its own `resolve`).
4824
+ const mapListPills = (this.mapListEnabled && Array.isArray(this.mapConfig.list.pills) ? this.mapConfig.list.pills : [])
4825
+ .filter((def) => def && typeof def === 'object')
4826
+ .map((def) => ({ key: def.path, resolve: def.resolve }));
4827
+ const seen = new Set();
4828
+ const cols = [...badgeSources, { key: card.pill, resolve: card.resolve }, ...layoutPills, ...mapListPills].filter((c) => {
4829
+ const wanted = typeof c.key === 'string' && c.key !== '' && c.resolve && typeof c.resolve === 'object'
4830
+ && (c.resolve.colorField || c.resolve.iconField) && !seen.has(c.key);
4831
+ if (wanted) {
4832
+ seen.add(c.key);
4833
+ }
4834
+ return wanted
4835
+ });
4836
+ if (cols.length === 0) {
4837
+ return []
4838
+ }
4839
+ const fields = this.effectiveSchema ? fieldsFromSchema(this.effectiveSchema, { includeReadOnly: true }) : [];
4840
+ const specs = [];
4841
+ for (const col of cols) {
4842
+ const resolve = col.resolve;
4843
+ const field = fields.find((f) => f.key === col.key);
4844
+ const ref = (field && field.reference) || {};
4845
+ const register = resolve.register || ref.register || (typeof this.register === 'string' ? this.register : '');
4846
+ const schema = resolve.schema || (ref.schema !== undefined && ref.schema !== null ? String(ref.schema) : '');
4847
+ if (!register || !schema) {
4848
+ continue
4849
+ }
4850
+ specs.push({ key: col.key, register, schema, colorField: resolve.colorField || '', iconField: resolve.iconField || '' });
4851
+ }
4852
+ return specs
4853
+ },
4854
+
4855
+ /**
4856
+ * `listConfig` with the referenced records' looks on its badge cells,
4857
+ * as `renderedColumns` does for the table.
4858
+ *
4859
+ * @return {object} The list view's config.
4860
+ * @spec openspec/changes/pill-color-field/specs/pill-color-field/spec.md#requirement-a-badge-cell-takes-its-tone-and-icon-from-the-referenced-record
4861
+ */
4862
+ renderedListConfig() {
4863
+ const list = this.listConfig;
4864
+ if (!list || this.refLookSpecs.length === 0) {
4865
+ return list
4866
+ }
4867
+ const lookKeys = new Set(this.refLookSpecs.map((spec) => spec.key));
4868
+ const withLooks = (cell) => (cell && typeof cell === 'object' && lookKeys.has(cell.key)
4869
+ ? { ...cell, widgetProps: { ...(cell.widgetProps || {}), looks: this.refLooks[cell.key] || {} } }
4870
+ : cell);
4871
+ return {
4872
+ ...list,
4873
+ ...(list.leading ? { leading: withLooks(list.leading) } : {}),
4874
+ ...(list.trailing ? { trailing: Array.isArray(list.trailing) ? list.trailing.map(withLooks) : withLooks(list.trailing) } : {}),
4875
+ }
4876
+ },
4877
+
4878
+ /**
4879
+ * The ids each `refLookSpecs` column shows on screen.
4880
+ *
4881
+ * @return {{[key: string]: Array<string>}} Sorted ids by column key.
4882
+ */
4883
+ refLookIds() {
4884
+ const out = {};
4885
+ for (const spec of this.refLookSpecs) {
4886
+ const ids = new Set();
4887
+ for (const row of this.displayObjects) {
4888
+ const v = row ? row[spec.key] : undefined
4889
+ ;(Array.isArray(v) ? v : [v]).forEach((id) => {
4890
+ if (id !== null && id !== undefined && id !== '' && typeof id !== 'object') {
4891
+ ids.add(String(id));
4892
+ }
4893
+ });
4894
+ }
4895
+ out[spec.key] = [...ids].sort();
4896
+ }
4897
+ return out
4898
+ },
4899
+
4788
4900
  refLabelIds() {
4789
4901
  const out = {};
4790
4902
  const facets = this.storeFacets || this.resolvedSidebar.facets || {};
@@ -5052,13 +5164,15 @@ var script = {
5052
5164
  const translated = {
5053
5165
  ...list,
5054
5166
  title: this.cnTranslate(list.title),
5055
- sub: list.sub ? this.cnTranslate(list.sub) : '',
5167
+ sub: Array.isArray(list.sub) ? list.sub.map((s) => this.cnTranslate(s)) : (list.sub ? this.cnTranslate(list.sub) : ''),
5056
5168
  due: list.due ? this.cnTranslate(list.due) : '',
5057
5169
  };
5058
5170
  return mapListItems(this.displayObjects, translated, {
5059
5171
  rowKey: this.rowKey,
5060
5172
  located: (row) => Boolean(this.resolveRowGeometry(row)),
5061
5173
  translate: (text) => this.cnTranslate(text),
5174
+ formatters: this.cnFormatters,
5175
+ looks: this.refLooks,
5062
5176
  })
5063
5177
  },
5064
5178
 
@@ -6682,6 +6796,15 @@ var script = {
6682
6796
  },
6683
6797
  },
6684
6798
 
6799
+ // Read the colour and icon of the records badge columns point at.
6800
+ refLookIds: {
6801
+ immediate: true,
6802
+ deep: true,
6803
+ handler() {
6804
+ this.loadRefLooks();
6805
+ },
6806
+ },
6807
+
6685
6808
  // The Active line names a referenced value, not its id.
6686
6809
  activeFilterRefIds: {
6687
6810
  deep: true,
@@ -7133,6 +7256,45 @@ var script = {
7133
7256
  }));
7134
7257
  },
7135
7258
 
7259
+ /**
7260
+ * Read the colour and icon names `refLookSpecs` columns need, for the
7261
+ * rows on screen, with the same resolver as the labels. A failure
7262
+ * leaves the badge as declared.
7263
+ *
7264
+ * @return {Promise<void>}
7265
+ * @spec openspec/changes/pill-color-field/specs/pill-color-field/spec.md#requirement-a-badge-cell-takes-its-tone-and-icon-from-the-referenced-record
7266
+ */
7267
+ async loadRefLooks() {
7268
+ if (this.refLookSpecs.length === 0) {
7269
+ return
7270
+ }
7271
+ if (!this._refLabelResolver) {
7272
+ this._refLabelResolver = createRefLabelResolver(() => {
7273
+ try {
7274
+ return (this.list && this.list.objectStore) || useObjectStore()
7275
+ } catch {
7276
+ return null
7277
+ }
7278
+ });
7279
+ }
7280
+ const read = (spec, ids, name) => (name
7281
+ ? this._refLabelResolver.resolve(spec.register, spec.schema, ids, name, { strict: true }).catch(() => ({}))
7282
+ : Promise.resolve({}));
7283
+ await Promise.all(this.refLookSpecs.map(async (spec) => {
7284
+ const known = this.refLooks[spec.key] || {};
7285
+ const ids = (this.refLookIds[spec.key] || []).filter((id) => !Object.hasOwn(known, id));
7286
+ if (ids.length === 0) {
7287
+ return
7288
+ }
7289
+ const [colors, icons] = await Promise.all([read(spec, ids, spec.colorField), read(spec, ids, spec.iconField)]);
7290
+ const found = {};
7291
+ ids.forEach((id) => {
7292
+ found[id] = { color: (colors && colors[id]) || null, icon: (icons && icons[id]) || null };
7293
+ });
7294
+ this.refLooks = { ...this.refLooks, [spec.key]: { ...(this.refLooks[spec.key] || {}), ...found } };
7295
+ }));
7296
+ },
7297
+
7136
7298
  /**
7137
7299
  * Whether a saved view shows its record count (`viewCounts`).
7138
7300
  *
@@ -10294,7 +10456,7 @@ var script = {
10294
10456
  return
10295
10457
  }
10296
10458
  const badge = this.savedViewMenuBadge(view);
10297
- menu.toggle({ id: String(view.id || view.slug), page: this.savedViewPage, name: view.name, ...(badge ? { badge } : {}) });
10459
+ menu.toggle({ id: String(view.id || view.slug), page: this.savedViewPage, name: view.name, ...(typeof view.icon === 'string' && view.icon !== '' ? { icon: view.icon } : {}), ...(badge ? { badge } : {}) });
10298
10460
  },
10299
10461
 
10300
10462
  /**
@@ -10829,7 +10991,9 @@ var script = {
10829
10991
  if (resultData && resultData.success && this._refLabelResolver) {
10830
10992
  this._refLabelResolver.invalidate();
10831
10993
  this.refLabels = {};
10994
+ this.refLooks = {};
10832
10995
  this.loadRefLabels();
10996
+ this.loadRefLooks();
10833
10997
  }
10834
10998
  },
10835
10999