@grafloria/element 0.4.31 → 0.4.33
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/package.json +1 -1
- package/src/lib/dashboard-kit/dashboard.d.ts +16 -2
- package/src/lib/dashboard-kit/dashboard.js +428 -114
- package/src/lib/dashboard-kit/grid-binder.d.ts +82 -2
- package/src/lib/dashboard-kit/grid-binder.js +708 -109
- package/src/lib/dashboard-kit/split-binder.js +2 -0
- package/src/lib/dashboard-kit/tabs.d.ts +1 -1
- package/src/lib/dashboard-kit/tabs.js +1 -1
- package/src/lib/load.js +9 -1
|
@@ -1254,6 +1254,8 @@ export function bindDashboardSplit(api, group, options = {}) {
|
|
|
1254
1254
|
// A split board has no cells to drop a torn-out page into: it refuses,
|
|
1255
1255
|
// and the press stays a plain tab click.
|
|
1256
1256
|
tearOutMember: (_pageId, _fromGroupId, _ev, _plan) => false,
|
|
1257
|
+
// …and it has no cells to move a section across: a strip press stays a selection.
|
|
1258
|
+
dragMember: () => false,
|
|
1257
1259
|
containsWorld: (x, y) => worldInsideBoard(x, y),
|
|
1258
1260
|
containsWorldExtended: (x, y) => worldInsideBoard(x, y),
|
|
1259
1261
|
frameArea: () => {
|
|
@@ -39,7 +39,7 @@ export declare function tabStripReserve(o: TabsOptions | undefined, pageCount: n
|
|
|
39
39
|
* rebuild — and so a `click` listener survives between switches.
|
|
40
40
|
*/
|
|
41
41
|
export declare function tabStripKey(pages: TabPage[], activeId: string, o: TabsOptions | undefined, rtl: boolean): string;
|
|
42
|
-
export declare function paintTabStrip(strip: HTMLElement, pages: TabPage[], activeId: string, o: TabsOptions | undefined, rtl: boolean, onPick: (id: string) => void, onSelectContainer?: () => void,
|
|
42
|
+
export declare function paintTabStrip(strip: HTMLElement, pages: TabPage[], activeId: string, o: TabsOptions | undefined, rtl: boolean, onPick: (id: string) => void, onSelectContainer?: (e: PointerEvent) => void,
|
|
43
43
|
/**
|
|
44
44
|
* The tab is the PAGE's drag handle, as it is in VS Code: press one and
|
|
45
45
|
* travel, and the whole page leaves — not the widget under the pointer,
|
|
@@ -61,7 +61,7 @@ onDrag) {
|
|
|
61
61
|
var _a;
|
|
62
62
|
if ((_a = e.target) === null || _a === void 0 ? void 0 : _a.closest('.axdb-tab'))
|
|
63
63
|
return;
|
|
64
|
-
onSelectContainer === null || onSelectContainer === void 0 ? void 0 : onSelectContainer();
|
|
64
|
+
onSelectContainer === null || onSelectContainer === void 0 ? void 0 : onSelectContainer(e);
|
|
65
65
|
};
|
|
66
66
|
for (const p of pages) {
|
|
67
67
|
const b = doc.createElement('button');
|
package/src/lib/load.js
CHANGED
|
@@ -151,7 +151,15 @@ export function fromDocument(document, options = {}) {
|
|
|
151
151
|
// the group's slab `gridItem`, its children in its own membership.
|
|
152
152
|
const meta = ((_b = childGroup.getMetadata('containerWidget')) !== null && _b !== void 0 ? _b : {});
|
|
153
153
|
const cell = cellFromGridItem(childGroup.getMetadata('gridItem'));
|
|
154
|
-
const
|
|
154
|
+
const inner = rebuildBoard(childGroup, viewId);
|
|
155
|
+
// A tab container's pages keep the order they were REORDERED into
|
|
156
|
+
// (`order` on the container), not the order they joined the group.
|
|
157
|
+
const order = meta.order;
|
|
158
|
+
if (Array.isArray(order)) {
|
|
159
|
+
const rank = (id) => (order.indexOf(id) < 0 ? Number.MAX_SAFE_INTEGER : order.indexOf(id));
|
|
160
|
+
inner.sort((p, q) => rank(p.id) - rank(q.id));
|
|
161
|
+
}
|
|
162
|
+
const ws = Object.assign(Object.assign(Object.assign({ id: childGroup.id }, meta), (cell ? { x: cell.x, y: cell.y, span: cell.w, rows: cell.h } : {})), { widgets: inner });
|
|
155
163
|
specById.set(ws.id, ws);
|
|
156
164
|
viewOfWidget.set(ws.id, g.id);
|
|
157
165
|
boardWidgets.set(ws.id, ws.widgets);
|