@grafloria/element 0.4.31 → 0.4.32
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 +427 -114
- package/src/lib/dashboard-kit/grid-binder.d.ts +61 -0
- package/src/lib/dashboard-kit/grid-binder.js +275 -46
- 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
package/package.json
CHANGED
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
* Cells are the truth and live in the existing `GridItemConfig`, so save/load
|
|
43
43
|
* round-trips with no extra work — same as every other kit.
|
|
44
44
|
*/
|
|
45
|
-
import { GroupModel, NodeModel, type GridColumnLayout } from '@grafloria/engine';
|
|
46
|
-
import { type DashboardGridHandle, type TearOutPlan, type DashboardGridOptions, type DashboardResponsiveOptions } from './grid-binder.js';
|
|
45
|
+
import { Command, GroupModel, NodeModel, type GridColumnLayout } from '@grafloria/engine';
|
|
46
|
+
import { type DashboardGridHandle, type TabDropHooks, type TearOutPlan, type DashboardGridOptions, type DashboardResponsiveOptions } from './grid-binder.js';
|
|
47
47
|
import type { DragHandleOption } from './grid-binder.js';
|
|
48
48
|
import type { SplitNode } from './split-layout.js';
|
|
49
49
|
import type { SectionCaption } from './caption.js';
|
|
@@ -373,6 +373,16 @@ export interface DashboardHandle {
|
|
|
373
373
|
activateTab(containerId: string, pageId: string): boolean;
|
|
374
374
|
/** The page showing in a tab container. */
|
|
375
375
|
getActiveTab(containerId: string): string | undefined;
|
|
376
|
+
/**
|
|
377
|
+
* Move a WIDGET into `containerId` as a NEW TAB at `index` (default: the
|
|
378
|
+
* end): the widget becomes the only member of a fresh page named by its
|
|
379
|
+
* title, and that page the active tab — what dropping a widget on a strip
|
|
380
|
+
* does. One undoable step; the board it left re-packs, and a page it
|
|
381
|
+
* emptied closes.
|
|
382
|
+
*/
|
|
383
|
+
moveToTab(widgetId: string, containerId: string, index?: number): Promise<boolean>;
|
|
384
|
+
/** Reorder a page along its container's strip. One undoable step; the order is saved with the container. */
|
|
385
|
+
moveTab(containerId: string, pageId: string, index: number): boolean;
|
|
376
386
|
/** Live sizing/float switches — the two prototype toggles. */
|
|
377
387
|
setSizing(mode: 'fit' | 'grow'): void;
|
|
378
388
|
getSizing(): 'fit' | 'grow';
|
|
@@ -597,6 +607,10 @@ export interface DashboardHandleContext {
|
|
|
597
607
|
detachTabsContainer?: (containerId: string) => void;
|
|
598
608
|
/** The plan that makes a torn-out page a one-tab group of its own (the handle builder owns the specs and the registry). */
|
|
599
609
|
tearOutPlan?: (containerId: string, pageId: string) => TearOutPlan | null;
|
|
610
|
+
/** The commands that close `boardId` when it is a tab PAGE about to lose its last member `leaving` — and its container when that was its last page. */
|
|
611
|
+
closePageIfEmptied?: (boardId: string, leaving: string) => Command[];
|
|
612
|
+
/** A widget dragged over a strip: hit-test, marks, and the drop that makes it a new tab. Handed to every binder. */
|
|
613
|
+
tabDrop?: TabDropHooks;
|
|
600
614
|
/** Set by finalize: the user's `onTabChange`, so the handle can fire it. */
|
|
601
615
|
onTabChange?: (containerId: string, pageId: string, viewId: string) => void;
|
|
602
616
|
/** Set by finalize: re-bind a VIEW's board under the given layout (setLayout). */
|