@conduction/nextcloud-vue 2.185.1 → 2.186.1

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 (69) hide show
  1. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue.js +1 -1
  2. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget2.vue.js +83 -2
  3. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget2.vue.js.map +1 -1
  4. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget3.vue.js +147 -104
  5. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget3.vue.js.map +1 -1
  6. package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
  7. package/dist/esm/components/CnChartWidget/CnChartWidget2.vue.js +58 -0
  8. package/dist/esm/components/CnChartWidget/CnChartWidget2.vue.js.map +1 -1
  9. package/dist/esm/components/CnChartWidget/CnChartWidget3.vue.js +2 -2
  10. package/dist/esm/components/CnChartWidget/CnChartWidget3.vue.js.map +1 -1
  11. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  12. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid2.vue.js +41 -16
  13. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid2.vue.js.map +1 -1
  14. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid3.vue.js.map +1 -1
  15. package/dist/esm/components/CnDividerWidget/index.js +1 -0
  16. package/dist/esm/components/CnDividerWidget/index.js.map +1 -1
  17. package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue.js +1 -1
  18. package/dist/esm/components/CnFilesWidget/CnFilesWidget2.vue.js +158 -5
  19. package/dist/esm/components/CnFilesWidget/CnFilesWidget2.vue.js.map +1 -1
  20. package/dist/esm/components/CnFilesWidget/CnFilesWidget3.vue.js +109 -45
  21. package/dist/esm/components/CnFilesWidget/CnFilesWidget3.vue.js.map +1 -1
  22. package/dist/esm/components/CnHeaderWidget/index.js +0 -1
  23. package/dist/esm/components/CnHeaderWidget/index.js.map +1 -1
  24. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm.vue.js +1 -1
  25. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm2.vue.js +17 -3
  26. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm2.vue.js.map +1 -1
  27. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm3.vue.js +3 -3
  28. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm3.vue.js.map +1 -1
  29. package/dist/esm/components/CnVideoWidget/CnVideoWidget.vue.js +1 -1
  30. package/dist/esm/components/CnVideoWidget/CnVideoWidget2.vue.js +63 -1
  31. package/dist/esm/components/CnVideoWidget/CnVideoWidget2.vue.js.map +1 -1
  32. package/dist/esm/components/CnVideoWidget/CnVideoWidget3.vue.js +20 -10
  33. package/dist/esm/components/CnVideoWidget/CnVideoWidget3.vue.js.map +1 -1
  34. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm.vue.js +1 -1
  35. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm2.vue.js +15 -0
  36. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm2.vue.js.map +1 -1
  37. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm3.vue.js +17 -10
  38. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm3.vue.js.map +1 -1
  39. package/dist/esm/components/CnWidgetGrid/dashboardWidgetRegistry.js +1 -0
  40. package/dist/esm/components/CnWidgetGrid/dashboardWidgetRegistry.js.map +1 -1
  41. package/dist/esm/dialogs/CnAddWidgetModal.vue.js +1 -1
  42. package/dist/esm/dialogs/CnAddWidgetModal2.vue.js +18 -4
  43. package/dist/esm/dialogs/CnAddWidgetModal2.vue.js.map +1 -1
  44. package/dist/esm/dialogs/CnAddWidgetModal3.vue.js +57 -39
  45. package/dist/esm/dialogs/CnAddWidgetModal3.vue.js.map +1 -1
  46. package/dist/esm/l10n/en.json.js +96 -1
  47. package/dist/esm/l10n/en.json.js.map +1 -1
  48. package/dist/esm/l10n/nl.json.js +96 -1
  49. package/dist/esm/l10n/nl.json.js.map +1 -1
  50. package/dist/esm/library-style.js +1 -1
  51. package/dist/esm/nextcloud-vue.css +309 -192
  52. package/dist/nextcloud-vue.cjs.js +2359 -1605
  53. package/dist/nextcloud-vue.cjs.js.map +2 -2
  54. package/dist/nextcloud-vue.css +309 -192
  55. package/l10n/en.json +96 -1
  56. package/l10n/nl.json +96 -1
  57. package/package.json +1 -1
  58. package/src/components/CnCalendarWidget/CnCalendarWidget.vue +217 -75
  59. package/src/components/CnChartWidget/CnChartWidget.vue +60 -2
  60. package/src/components/CnDashboardGrid/CnDashboardGrid.md +1 -1
  61. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +41 -16
  62. package/src/components/CnDividerWidget/index.js +1 -0
  63. package/src/components/CnFilesWidget/CnFilesWidget.vue +278 -5
  64. package/src/components/CnHeaderWidget/index.js +0 -1
  65. package/src/components/CnHeaderWidgetForm/CnHeaderWidgetForm.vue +20 -6
  66. package/src/components/CnVideoWidget/CnVideoWidget.vue +84 -1
  67. package/src/components/CnVideoWidgetForm/CnVideoWidgetForm.vue +19 -1
  68. package/src/components/CnWidgetGrid/dashboardWidgetRegistry.js +1 -0
  69. package/src/dialogs/CnAddWidgetModal.vue +53 -14
@@ -3,7 +3,7 @@ export { fillRowTracks } from './CnDashboardGrid2.vue.js';
3
3
  import { render } from './CnDashboardGrid3.vue.js';
4
4
 
5
5
  script.render = render;
6
- script.__scopeId = "data-v-e21b7108";
6
+ script.__scopeId = "data-v-2a81b4c1";
7
7
  const __sfc_main = script;
8
8
 
9
9
  export { __sfc_main as default };
@@ -117,7 +117,7 @@ var script = {
117
117
  name: 'CnDashboardGrid',
118
118
 
119
119
  props: {
120
- /** Array of layout items: { id, gridX, gridY, gridWidth, gridHeight, ...extra } */
120
+ /** Array of layout items: { id, gridX, gridY, gridWidth, gridHeight, minHeight?, ...extra }. An item's `minHeight` (layout rows) replaces the grid's own for that item. */
121
121
  layout: {
122
122
  type: Array,
123
123
  required: true,
@@ -672,8 +672,20 @@ var script = {
672
672
  },
673
673
 
674
674
  /**
675
- * The smallest height an item may take, in grid rows: `minHeight`
676
- * layout rows, except for a size-to-content cell on split rows, which
675
+ * The smallest height an item may take, in layout rows: the item's own
676
+ * `minHeight` (a divider may be one row), else the grid's.
677
+ *
678
+ * @param {object} item The layout item.
679
+ * @return {number} The minimum height in layout rows.
680
+ */
681
+ itemMinHeight(item) {
682
+ const own = item && item.minHeight;
683
+ return Number.isFinite(own) && own >= 1 ? Math.floor(own) : this.minHeight
684
+ },
685
+
686
+ /**
687
+ * The smallest height an item may take, in grid rows: its minimum
688
+ * height in layout rows, except for a size-to-content cell on split rows, which
677
689
  * may shrink to its content down to one grid row. The minimum is for
678
690
  * resizing by hand, and that only happens on whole rows in edit mode.
679
691
  *
@@ -685,7 +697,7 @@ var script = {
685
697
  if (this.rowSplit !== 1 && this.sizeToContentAttr(item) !== undefined) {
686
698
  return 1
687
699
  }
688
- return this.minHeight * this.rowSplit
700
+ return this.itemMinHeight(item) * this.rowSplit
689
701
  },
690
702
 
691
703
  /**
@@ -1149,10 +1161,14 @@ var script = {
1149
1161
  if (!this.grid || typeof this.grid.enable !== 'function') {
1150
1162
  return
1151
1163
  }
1164
+ // On the raw grid: enabled through Vue's proxy, GridStack binds its
1165
+ // drag handlers to the proxy and a drop never ends, so the move is
1166
+ // shown but no `change` follows.
1167
+ const grid = toRaw(this.grid);
1152
1168
  if (this.editable && !this.reflowed) {
1153
- this.grid.enable();
1169
+ grid.enable();
1154
1170
  } else {
1155
- this.grid.disable();
1171
+ grid.disable();
1156
1172
  }
1157
1173
  },
1158
1174
 
@@ -1337,12 +1353,13 @@ var script = {
1337
1353
  * edge instead of pushing it into negative coordinates.
1338
1354
  *
1339
1355
  * @param {{x: number, y: number, w: number, h: number}} rect the candidate.
1356
+ * @param {object} [item] the layout item, whose own `minHeight` applies.
1340
1357
  * @return {{x: number, y: number, w: number, h: number}} the clamped rectangle.
1341
1358
  */
1342
- clampRect(rect) {
1359
+ clampRect(rect, item) {
1343
1360
  const cols = this.effectiveColumns;
1344
1361
  const w = Math.min(Math.max(rect.w, this.minWidth), cols);
1345
- const h = Math.max(rect.h, this.minHeight);
1362
+ const h = Math.max(rect.h, item ? this.itemMinHeight(item) : this.minHeight);
1346
1363
  return {
1347
1364
  x: Math.min(Math.max(rect.x, 0), Math.max(cols - w, 0)),
1348
1365
  y: Math.max(rect.y, 0),
@@ -1375,7 +1392,7 @@ var script = {
1375
1392
  }
1376
1393
 
1377
1394
  const current = this.currentRect(item);
1378
- const next = this.clampRect({ ...current, ...patch });
1395
+ const next = this.clampRect({ ...current, ...patch }, item);
1379
1396
 
1380
1397
  if (next.x === current.x && next.y === current.y
1381
1398
  && next.w === current.w && next.h === current.h) {
@@ -1385,7 +1402,7 @@ var script = {
1385
1402
  return true
1386
1403
  }
1387
1404
 
1388
- this.grid.update(el, next);
1405
+ toRaw(this.grid).update(el, next);
1389
1406
 
1390
1407
  this.announce(kind === 'resize'
1391
1408
  ? translate('nextcloud-vue', '{label} resized to {width} columns by {height} rows', {
@@ -1617,13 +1634,14 @@ var script = {
1617
1634
  if (!this.grid || !this.$refs.gridContainer) {
1618
1635
  return
1619
1636
  }
1637
+ const grid = toRaw(this.grid);
1620
1638
  const added = [];
1621
1639
  for (const item of this.itemsInRowOrder) {
1622
1640
  const el = this.$refs.gridContainer.querySelector(`[gs-id="${item.id}"]`);
1623
1641
  if (!el) {
1624
1642
  continue
1625
1643
  }
1626
- const node = this.grid.engine.nodes.find((n) => String(n.id) === String(item.id));
1644
+ const node = grid.engine.nodes.find((n) => String(n.id) === String(item.id));
1627
1645
  if (!node) {
1628
1646
  added.push(el);
1629
1647
  } else if (node.el === el) {
@@ -1634,16 +1652,23 @@ var script = {
1634
1652
  // where the hidden widget had been. A drag reports the
1635
1653
  // grid's own position back, which matches and does
1636
1654
  // nothing here.
1655
+ // A width or height the layout changed (a form, an
1656
+ // undo) is synced the same way. A size-to-content cell
1657
+ // keeps the height its content gave it.
1637
1658
  const x = item.gridX ?? node.x;
1638
1659
  const y = Number.isFinite(item.gridY) ? item.gridY * this.rowSplit : node.y;
1639
- if (x !== node.x || y !== node.y) {
1660
+ const w = Number.isFinite(item.gridWidth) ? item.gridWidth : node.w;
1661
+ const h = Number.isFinite(item.gridHeight) && this.sizeToContentAttr(item) === undefined
1662
+ ? item.gridHeight * this.rowSplit
1663
+ : node.h;
1664
+ if (x !== node.x || y !== node.y || w !== node.w || h !== node.h) {
1640
1665
  // The layout said where it goes; GridStack's `change`
1641
1666
  // for it is not a user's arrangement and is not
1642
1667
  // reported back (it would write the display-only
1643
1668
  // compaction into the authored layout).
1644
1669
  this.applyingLayout = true;
1645
1670
  try {
1646
- this.grid.update(el, { x, y });
1671
+ grid.update(el, { x, y, w, h });
1647
1672
  } finally {
1648
1673
  this.applyingLayout = false;
1649
1674
  }
@@ -1651,8 +1676,8 @@ var script = {
1651
1676
  } else {
1652
1677
  // Drop the stale node without touching its detached DOM,
1653
1678
  // then adopt the new element so GridStack sizes/places it.
1654
- this.grid.removeWidget(node.el, false, false);
1655
- this.grid.makeWidget(el);
1679
+ grid.removeWidget(node.el, false, false);
1680
+ grid.makeWidget(el);
1656
1681
  }
1657
1682
  }
1658
1683
  this.addWidgetsInOrder(added);
@@ -1664,7 +1689,7 @@ var script = {
1664
1689
  for (const node of toRemove) {
1665
1690
  const el = this.$refs.gridContainer.querySelector(`[gs-id="${node.id}"]`);
1666
1691
  if (el) {
1667
- this.grid.removeWidget(el, false);
1692
+ toRaw(this.grid).removeWidget(el, false);
1668
1693
  }
1669
1694
  }
1670
1695