@conduction/nextcloud-vue 2.185.0 → 2.186.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/CnCalendarWidget/CnCalendarWidget.vue.js +1 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget2.vue.js +83 -2
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget2.vue.js.map +1 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget3.vue.js +147 -104
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget3.vue.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid2.vue.js +41 -16
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid2.vue.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid3.vue.js.map +1 -1
- package/dist/esm/components/CnDividerWidget/index.js +1 -0
- package/dist/esm/components/CnDividerWidget/index.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue.js +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget2.vue.js +158 -5
- package/dist/esm/components/CnFilesWidget/CnFilesWidget2.vue.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget3.vue.js +109 -45
- package/dist/esm/components/CnFilesWidget/CnFilesWidget3.vue.js.map +1 -1
- package/dist/esm/components/CnHeaderWidget/index.js +0 -1
- package/dist/esm/components/CnHeaderWidget/index.js.map +1 -1
- package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm.vue.js +1 -1
- package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm2.vue.js +17 -3
- package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm2.vue.js.map +1 -1
- package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm3.vue.js +3 -3
- package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm3.vue.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget2.vue.js +7 -0
- package/dist/esm/components/CnTabsWidget/CnTabsWidget2.vue.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget3.vue.js.map +1 -1
- package/dist/esm/components/CnVideoWidget/CnVideoWidget.vue.js +1 -1
- package/dist/esm/components/CnVideoWidget/CnVideoWidget2.vue.js +63 -1
- package/dist/esm/components/CnVideoWidget/CnVideoWidget2.vue.js.map +1 -1
- package/dist/esm/components/CnVideoWidget/CnVideoWidget3.vue.js +20 -10
- package/dist/esm/components/CnVideoWidget/CnVideoWidget3.vue.js.map +1 -1
- package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm.vue.js +1 -1
- package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm2.vue.js +15 -0
- package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm2.vue.js.map +1 -1
- package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm3.vue.js +17 -10
- package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm3.vue.js.map +1 -1
- package/dist/esm/components/CnWidgetGrid/dashboardWidgetRegistry.js +1 -0
- package/dist/esm/components/CnWidgetGrid/dashboardWidgetRegistry.js.map +1 -1
- package/dist/esm/dialogs/CnAddWidgetModal.vue.js +1 -1
- package/dist/esm/dialogs/CnAddWidgetModal2.vue.js +18 -4
- package/dist/esm/dialogs/CnAddWidgetModal2.vue.js.map +1 -1
- package/dist/esm/dialogs/CnAddWidgetModal3.vue.js +57 -39
- package/dist/esm/dialogs/CnAddWidgetModal3.vue.js.map +1 -1
- package/dist/esm/l10n/en.json.js +96 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +96 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +257 -140
- package/dist/nextcloud-vue.cjs.js +2305 -1603
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +257 -140
- package/l10n/en.json +96 -1
- package/l10n/nl.json +96 -1
- package/package.json +1 -1
- package/src/components/CnCalendarWidget/CnCalendarWidget.vue +217 -75
- package/src/components/CnDashboardGrid/CnDashboardGrid.md +1 -1
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +41 -16
- package/src/components/CnDividerWidget/index.js +1 -0
- package/src/components/CnFilesWidget/CnFilesWidget.vue +278 -5
- package/src/components/CnHeaderWidget/index.js +0 -1
- package/src/components/CnHeaderWidgetForm/CnHeaderWidgetForm.vue +20 -6
- package/src/components/CnTabsWidget/CnTabsWidget.vue +7 -0
- package/src/components/CnVideoWidget/CnVideoWidget.vue +84 -1
- package/src/components/CnVideoWidgetForm/CnVideoWidgetForm.vue +19 -1
- package/src/components/CnWidgetGrid/dashboardWidgetRegistry.js +1 -0
- package/src/dialogs/CnAddWidgetModal.vue +53 -14
|
@@ -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
|
|
676
|
-
*
|
|
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.
|
|
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
|
-
|
|
1169
|
+
grid.enable();
|
|
1154
1170
|
} else {
|
|
1155
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1655
|
-
|
|
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
|
|