@sme.up/ketchup2 2.0.0-SNAPSHOT-20250808075018 → 2.0.0-SNAPSHOT-20250811082532
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/components/tab-bar/tab-bar-types.d.ts +11 -0
- package/dist/components/tab-bar/tab-bar-types.d.ts.map +1 -1
- package/dist/components/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/toolbar/assets/data.d.ts +7 -0
- package/dist/components/toolbar/assets/data.d.ts.map +1 -0
- package/dist/components/toolbar/toolbar-types.d.ts +51 -0
- package/dist/components/toolbar/toolbar-types.d.ts.map +1 -0
- package/dist/components/toolbar/toolbar-utils/useKeyboardNavigation.d.ts +12 -0
- package/dist/components/toolbar/toolbar-utils/useKeyboardNavigation.d.ts.map +1 -0
- package/dist/components/toolbar/toolbar-utils/useToolbarInteractions.d.ts +8 -0
- package/dist/components/toolbar/toolbar-utils/useToolbarInteractions.d.ts.map +1 -0
- package/dist/components/toolbar/toolbar-utils/utils.d.ts +11 -0
- package/dist/components/toolbar/toolbar-utils/utils.d.ts.map +1 -0
- package/dist/components/toolbar/toolbar.d.ts +3 -0
- package/dist/components/toolbar/toolbar.d.ts.map +1 -0
- package/dist/ketchup2.cjs.js +13 -13
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +2850 -2576
- package/dist/types/data-structures.d.ts +2 -0
- package/dist/types/data-structures.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DataCell, DataTree } from '../../types/data-structures';
|
|
2
2
|
import { Sizing } from '../../types/global';
|
|
3
|
+
import { ToolbarLeafClickHandler, ToolbarLoadNodeHandler, ToolbarInitialDataLoadHandler } from '../toolbar/toolbar-types';
|
|
3
4
|
export interface TabBarProps {
|
|
4
5
|
/**
|
|
5
6
|
* Tab-bar data is a dataTree
|
|
@@ -21,5 +22,15 @@ export interface TabBarProps {
|
|
|
21
22
|
variant?: "base" | "contained";
|
|
22
23
|
selectedIndex?: number;
|
|
23
24
|
onTabChange?: (index: number, cell: DataCell) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Handlers for toolbar interaction
|
|
27
|
+
* - Leaf node click
|
|
28
|
+
* - Dynamic node children loading
|
|
29
|
+
* - Load the initial data with a callback
|
|
30
|
+
* without the need of the data-prop
|
|
31
|
+
*/
|
|
32
|
+
onToolbarLeafNodeClick?: ToolbarLeafClickHandler;
|
|
33
|
+
onToolbarLoadNodeData?: ToolbarLoadNodeHandler;
|
|
34
|
+
onToolbarLoadInitialData?: ToolbarInitialDataLoadHandler;
|
|
24
35
|
}
|
|
25
36
|
//# sourceMappingURL=tab-bar-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar-types.d.ts","sourceRoot":"","sources":["../../../src/components/tab-bar/tab-bar-types.tsx"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"tab-bar-types.d.ts","sourceRoot":"","sources":["../../../src/components/tab-bar/tab-bar-types.tsx"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,0BAA0B,CAAA;AAEjC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAA;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAE9B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IACrD;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,uBAAuB,CAAA;IAChD,qBAAqB,CAAC,EAAE,sBAAsB,CAAA;IAC9C,wBAAwB,CAAC,EAAE,6BAA6B,CAAA;CACzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar.d.ts","sourceRoot":"","sources":["../../../src/components/tab-bar/tab-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"tab-bar.d.ts","sourceRoot":"","sources":["../../../src/components/tab-bar/tab-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAU7C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyKxC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DataNode, DataTree } from '../../../types/data-structures';
|
|
2
|
+
export declare const empty_node: DataNode;
|
|
3
|
+
export declare const empty_radio_node: (node: DataNode) => DataNode;
|
|
4
|
+
export declare const toolbarData_nested_children: DataTree;
|
|
5
|
+
export declare const dynamic_toolbar_data: DataTree;
|
|
6
|
+
export declare const toolbar_with_radio_node: DataTree;
|
|
7
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/assets/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,QAAQ,EACT,MAAM,gCAAgC,CAAA;AAEvC,eAAO,MAAM,UAAU,EAAE,QAOxB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,MAAM,QAAQ,KAAG,QAOhD,CAAA;AAEF,eAAO,MAAM,2BAA2B,EAAE,QAmFzC,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,QA4ClC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,QA0HrC,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { DataNode, DataTree } from '../../types/data-structures';
|
|
3
|
+
export interface ToolbarProps {
|
|
4
|
+
/**
|
|
5
|
+
* Toolbar data passing
|
|
6
|
+
*/
|
|
7
|
+
data?: DataTree;
|
|
8
|
+
/**
|
|
9
|
+
* Optional ref assign to wrapper div
|
|
10
|
+
*/
|
|
11
|
+
ref?: Ref<HTMLDivElement | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Handlers for toolbar interaction
|
|
14
|
+
* - Leaf node click
|
|
15
|
+
* - Dynamic node children loading
|
|
16
|
+
* - Load the initial data with a callback
|
|
17
|
+
* without the need of the data-prop
|
|
18
|
+
*/
|
|
19
|
+
onToolbarLeafNodeClick: ToolbarLeafClickHandler;
|
|
20
|
+
onToolbarLoadNodeData: ToolbarLoadNodeHandler;
|
|
21
|
+
onToolbarLoadInitialData?: ToolbarInitialDataLoadHandler;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reusable Toolbar callbacks types
|
|
25
|
+
*/
|
|
26
|
+
export type ToolbarLeafClickHandler = (node: DataNode) => void;
|
|
27
|
+
export type ToolbarLoadNodeHandler = (node: DataNode) => Promise<DataTree>;
|
|
28
|
+
export type ToolbarInitialDataLoadHandler = () => Promise<DataTree>;
|
|
29
|
+
/**
|
|
30
|
+
* Toolbar nodes id prefix
|
|
31
|
+
*/
|
|
32
|
+
export declare const TOOLBAR_PREFIX = "smp-toolbar";
|
|
33
|
+
/**
|
|
34
|
+
* Custom toolbar DataTree extension
|
|
35
|
+
*/
|
|
36
|
+
export interface ToolbarDataTree extends DataTree {
|
|
37
|
+
children?: ToolbarDataNode[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Custom toolbar DataNode extension to allow state
|
|
41
|
+
*/
|
|
42
|
+
export interface ToolbarDataNode extends DataNode {
|
|
43
|
+
children?: ToolbarDataNode[];
|
|
44
|
+
isLoading?: boolean;
|
|
45
|
+
isExpanded?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Managed keys in toolbar navigation
|
|
49
|
+
*/
|
|
50
|
+
export declare const ToolbarKeysToHandle: string[];
|
|
51
|
+
//# sourceMappingURL=toolbar-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-types.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/toolbar-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEhE,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAChC;;;;;;OAMG;IACH,sBAAsB,EAAE,uBAAuB,CAAA;IAC/C,qBAAqB,EAAE,sBAAsB,CAAA;IAC7C,wBAAwB,CAAC,EAAE,6BAA6B,CAAA;CACzD;AACD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;AAC9D,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAC1E,MAAM,MAAM,6BAA6B,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,cAAc,gBAAgB,CAAA;AAC3C;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AACD;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AACD;;GAEG;AACH,eAAO,MAAM,mBAAmB,UAQ/B,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ToolbarDataNode, ToolbarDataTree } from '../toolbar-types';
|
|
2
|
+
import { DataNode } from '../../../types/data-structures';
|
|
3
|
+
/**
|
|
4
|
+
* Hook for managing keyboard interactions with toolbar
|
|
5
|
+
* @param refs
|
|
6
|
+
* @param expandNode
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function useKeyboardNavigation(setState: React.Dispatch<React.SetStateAction<ToolbarDataTree | undefined>>, refs: React.RefObject<Map<string, HTMLDivElement>>, handleNodeExpand: (node: ToolbarDataNode, nodeId: string) => Promise<void>): {
|
|
10
|
+
handleKeyDown: (e: React.KeyboardEvent, node: DataNode, nodeId: string) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useKeyboardNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-utils/useKeyboardNavigation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AASnE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAEzD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC,EAC3E,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EAClD,gBAAgB,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;uBAG9D,KAAK,CAAC,aAAa,QAAQ,QAAQ,UAAU,MAAM;EAuDhE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DataCell, DataNode } from '../../../types/data-structures';
|
|
2
|
+
import { ToolbarDataNode, ToolbarDataTree, ToolbarLeafClickHandler, ToolbarLoadNodeHandler } from '../toolbar-types';
|
|
3
|
+
export declare function useToolbarInteractions(setState: React.Dispatch<React.SetStateAction<ToolbarDataTree | undefined>>, onToolbarLoadNodeData: ToolbarLoadNodeHandler, onToolbarLeafNodeClick: ToolbarLeafClickHandler): {
|
|
4
|
+
handleNodeExpand: (node: ToolbarDataNode, nodeId: string) => Promise<void>;
|
|
5
|
+
handleMouseLeave: (nodeId: string) => void;
|
|
6
|
+
onToolbarRadioLeafNodeClick: (node: DataNode, nodeId: string, selectedOption: DataCell) => void;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useToolbarInteractions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToolbarInteractions.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-utils/useToolbarInteractions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAEnE,OAAO,EACL,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,kBAAkB,CAAA;AAGzB,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC,EAC3E,qBAAqB,EAAE,sBAAsB,EAC7C,sBAAsB,EAAE,uBAAuB;6BAET,eAAe,UAAU,MAAM;+BAqBnC,MAAM;wCA6BhC,QAAQ,UACN,MAAM,kBACE,QAAQ;EA4B3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataNode } from '../../../types/data-structures';
|
|
2
|
+
import { ToolbarDataNode, ToolbarDataTree } from '../toolbar-types';
|
|
3
|
+
export declare const parseNodeIdIntoPath: (nodeId: string) => number[];
|
|
4
|
+
export declare const parsePathIntoNodeId: (path: number[]) => string;
|
|
5
|
+
export declare const getNodeId: (index: number, parentPath?: string) => string;
|
|
6
|
+
export declare const hasDynamicData: (node: DataNode) => node is DataNode & {
|
|
7
|
+
fun: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const updateNodeAtPath: (tree: ToolbarDataTree, path: number[], updater: (node: ToolbarDataNode) => ToolbarDataNode, siblingsUpdater?: (node: ToolbarDataNode) => ToolbarDataNode) => ToolbarDataTree;
|
|
10
|
+
export declare const focusNode: (refs: React.RefObject<Map<string, HTMLDivElement>>, id: string) => void;
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAEL,eAAe,EACf,eAAe,EAChB,MAAM,kBAAkB,CAAA;AAGzB,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,MAAM,EAM1D,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,EAAE,KAAG,MAEpD,CAAA;AAGD,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,EAAE,aAAa,MAAM,WAE3D,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,MAAM,QAAQ,KACb,IAAI,IAAI,QAAQ,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAMlC,CAAA;AAED,eAAO,MAAM,gBAAgB,GAC3B,MAAM,eAAe,EACrB,MAAM,MAAM,EAAE,EACd,SAAS,CAAC,IAAI,EAAE,eAAe,KAAK,eAAe,EACnD,kBAAkB,CAAC,IAAI,EAAE,eAAe,KAAK,eAAe,KAC3D,eAuDF,CAAA;AAED,eAAO,MAAM,SAAS,GACpB,MAAM,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EAClD,IAAI,MAAM,SAOX,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/toolbar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAoC,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAShF,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAmK1C,CAAA"}
|