@kosdev-code/base-ui-components 0.1.0-dev.5385 → 0.1.0-dev.5605
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/components/atoms/button/index.d.ts +1 -1
- package/components/atoms/button/index.d.ts.map +1 -1
- package/components/atoms/button-group/button-group-item.d.ts +42 -0
- package/components/atoms/button-group/button-group-item.d.ts.map +1 -0
- package/components/atoms/button-group/button-group.d.ts +40 -0
- package/components/atoms/button-group/button-group.d.ts.map +1 -0
- package/components/atoms/button-group/hooks/use-button-group-context.d.ts +8 -0
- package/components/atoms/button-group/hooks/use-button-group-context.d.ts.map +1 -0
- package/components/atoms/button-group/index.d.ts +4 -0
- package/components/atoms/button-group/index.d.ts.map +1 -0
- package/components/atoms/icon/common/types.d.ts +2 -2
- package/components/atoms/icon/common/types.d.ts.map +1 -1
- package/components/atoms/index.d.ts +2 -0
- package/components/atoms/index.d.ts.map +1 -1
- package/components/atoms/resizable-panel-group/common/hooks/use-resizable-panel-group-context/helpers/get-resize-panel-element.d.ts +6 -1
- package/components/atoms/resizable-panel-group/common/hooks/use-resizable-panel-group-context/helpers/get-resize-panel-element.d.ts.map +1 -1
- package/components/atoms/resizable-panel-group/common/hooks/use-resizable-panel-group-context/use-resizable-panel-group-context.d.ts +6 -2
- package/components/atoms/resizable-panel-group/common/hooks/use-resizable-panel-group-context/use-resizable-panel-group-context.d.ts.map +1 -1
- package/components/atoms/resizable-panel-group/common/types.d.ts +6 -0
- package/components/atoms/resizable-panel-group/common/types.d.ts.map +1 -1
- package/components/atoms/resizable-panel-group/index.d.ts +1 -0
- package/components/atoms/resizable-panel-group/index.d.ts.map +1 -1
- package/components/atoms/resizable-panel-group/resizable-panel-group.d.ts +8 -4
- package/components/atoms/resizable-panel-group/resizable-panel-group.d.ts.map +1 -1
- package/components/molecules/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/components/molecules/form/components/form-input.d.ts +2 -2
- package/components/molecules/form/components/form-input.d.ts.map +1 -1
- package/components/molecules/form/components/form-submit.d.ts.map +1 -1
- package/components/molecules/index.d.ts +2 -0
- package/components/molecules/index.d.ts.map +1 -1
- package/components/molecules/item-selection-list/item-selection-list.d.ts +1 -1
- package/components/molecules/item-selection-list/item-selection-list.d.ts.map +1 -1
- package/components/molecules/list/async-list/async-list-group-header.d.ts +12 -0
- package/components/molecules/list/async-list/async-list-group-header.d.ts.map +1 -0
- package/components/molecules/list/async-list/async-list.d.ts +139 -0
- package/components/molecules/list/async-list/async-list.d.ts.map +1 -0
- package/components/molecules/list/async-list/helpers/is-item-template-factory.d.ts +19 -0
- package/components/molecules/list/async-list/helpers/is-item-template-factory.d.ts.map +1 -0
- package/components/molecules/list/async-list/index.d.ts +9 -0
- package/components/molecules/list/async-list/index.d.ts.map +1 -0
- package/components/molecules/list/async-list/item-action-bar.d.ts +31 -0
- package/components/molecules/list/async-list/item-action-bar.d.ts.map +1 -0
- package/components/molecules/list/async-list/templates/studio-named-list-item.d.ts +41 -0
- package/components/molecules/list/async-list/templates/studio-named-list-item.d.ts.map +1 -0
- package/components/molecules/list/async-list/types.d.ts +286 -0
- package/components/molecules/list/async-list/types.d.ts.map +1 -0
- package/components/molecules/list/common/data-providers/base-async-tree-data-provider.d.ts +117 -56
- package/components/molecules/list/common/data-providers/base-async-tree-data-provider.d.ts.map +1 -1
- package/components/molecules/list/common/types.d.ts +111 -0
- package/components/molecules/list/common/types.d.ts.map +1 -1
- package/components/molecules/list/index.d.ts +1 -0
- package/components/molecules/list/index.d.ts.map +1 -1
- package/components/molecules/list/select-list/select-list.d.ts +1 -0
- package/components/molecules/list/select-list/select-list.d.ts.map +1 -1
- package/components/molecules/list/tree-list/async-tree-list.d.ts +253 -30
- package/components/molecules/list/tree-list/async-tree-list.d.ts.map +1 -1
- package/components/molecules/list/tree-list/helpers/is-item-template-factory.d.ts +19 -0
- package/components/molecules/list/tree-list/helpers/is-item-template-factory.d.ts.map +1 -0
- package/components/molecules/list/tree-list/templates/async-named-collapsible-branch.d.ts.map +1 -1
- package/components/molecules/table/table.d.ts.map +1 -1
- package/components/molecules/table/virtual-table.d.ts.map +1 -1
- package/components/molecules/view/action-bar.d.ts +27 -0
- package/components/molecules/view/action-bar.d.ts.map +1 -0
- package/components/molecules/view/index.d.ts +9 -0
- package/components/molecules/view/index.d.ts.map +1 -0
- package/components/molecules/view/types.d.ts +103 -0
- package/components/molecules/view/types.d.ts.map +1 -0
- package/components/molecules/view/view-header.d.ts +32 -0
- package/components/molecules/view/view-header.d.ts.map +1 -0
- package/components/molecules/view/view.d.ts +60 -0
- package/components/molecules/view/view.d.ts.map +1 -0
- package/components/molecules/view-container/index.d.ts +6 -0
- package/components/molecules/view-container/index.d.ts.map +1 -0
- package/components/molecules/view-container/types.d.ts +28 -0
- package/components/molecules/view-container/types.d.ts.map +1 -0
- package/components/molecules/view-container/view-container.d.ts +52 -0
- package/components/molecules/view-container/view-container.d.ts.map +1 -0
- package/index.cjs +1058 -824
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +6531 -4648
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/providers/data-providers/create-observable-list-provider.d.ts +116 -0
- package/providers/data-providers/create-observable-list-provider.d.ts.map +1 -0
- package/providers/data-providers/index.d.ts +86 -0
- package/providers/data-providers/index.d.ts.map +1 -0
- package/providers/data-providers/lifecycle-aware-list-provider.d.ts +206 -0
- package/providers/data-providers/lifecycle-aware-list-provider.d.ts.map +1 -0
- package/providers/data-providers/lifecycle-aware-tree-provider.d.ts +187 -0
- package/providers/data-providers/lifecycle-aware-tree-provider.d.ts.map +1 -0
- package/providers/data-providers/types.d.ts +124 -0
- package/providers/data-providers/types.d.ts.map +1 -0
- package/providers/index.d.ts +13 -0
- package/providers/index.d.ts.map +1 -0
- package/styles/tokens/component-tokens/button-group/index.d.ts +18 -0
- package/styles/tokens/component-tokens/button-group/index.d.ts.map +1 -0
- package/styles/tokens/component-tokens/icon/index.d.ts +1 -0
- package/styles/tokens/component-tokens/icon/index.d.ts.map +1 -1
- package/styles/tokens/component-tokens/index.d.ts +80 -0
- package/styles/tokens/component-tokens/index.d.ts.map +1 -1
- package/styles/tokens/component-tokens/notification/index.d.ts +37 -0
- package/styles/tokens/component-tokens/notification/index.d.ts.map +1 -0
- package/styles/tokens/component-tokens/studio-list-item/index.d.ts +13 -0
- package/styles/tokens/component-tokens/studio-list-item/index.d.ts.map +1 -0
- package/styles/tokens/component-tokens/view/index.d.ts +24 -0
- package/styles/tokens/component-tokens/view/index.d.ts.map +1 -0
- package/styles/tokens/component-tokens/view-container/index.d.ts +12 -0
- package/styles/tokens/component-tokens/view-container/index.d.ts.map +1 -0
- package/styles/tokens/index.d.ts +81 -1
- package/styles/tokens/index.d.ts.map +1 -1
|
@@ -4,8 +4,119 @@ import { FunctionComponent, ReactNode } from 'react';
|
|
|
4
4
|
export interface ListItem {
|
|
5
5
|
id: string;
|
|
6
6
|
name: string;
|
|
7
|
+
type?: string;
|
|
7
8
|
onListItemAction?: (itemId: string, actionId: string) => void;
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Symbol used to attach original source object to transformed ListItems.
|
|
12
|
+
* This allows expression evaluation to access original model properties
|
|
13
|
+
* without requiring the transformer to copy every property.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const listItem = {
|
|
18
|
+
* id: artifact.id,
|
|
19
|
+
* name: artifact.name,
|
|
20
|
+
* [SOURCE_SYMBOL]: artifact, // Attach original for expression access
|
|
21
|
+
* };
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const SOURCE_SYMBOL: unique symbol;
|
|
25
|
+
/**
|
|
26
|
+
* String-based fallback key for the source object.
|
|
27
|
+
* React's JSX runtime uses for...in to copy props, which skips symbol keys.
|
|
28
|
+
* This string key ensures the source survives through JSX spread into
|
|
29
|
+
* template component props, making getSource() work in item templates.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare const SOURCE_PROP_KEY = "__kos_source__";
|
|
34
|
+
/**
|
|
35
|
+
* Type for a ListItem with an attached source object.
|
|
36
|
+
* The source is stored via symbol to avoid property collision.
|
|
37
|
+
*
|
|
38
|
+
* @typeParam T - The ListItem type
|
|
39
|
+
* @typeParam S - The source object type
|
|
40
|
+
*/
|
|
41
|
+
export type WithSource<T extends ListItem, S = any> = T & {
|
|
42
|
+
[SOURCE_SYMBOL]?: S;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Attach a source object to a ListItem using the transparent source pattern.
|
|
46
|
+
* This allows expressions to access original model properties via the symbol.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const transformer = (artifact: Artifact) => attachSource({
|
|
51
|
+
* id: artifact.id,
|
|
52
|
+
* name: artifact.name,
|
|
53
|
+
* }, artifact);
|
|
54
|
+
*
|
|
55
|
+
* // Later in expression evaluation:
|
|
56
|
+
* // item.locked will check: item.locked ?? item[SOURCE_SYMBOL]?.locked
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @param item - The transformed ListItem
|
|
60
|
+
* @param source - The original source object
|
|
61
|
+
* @returns The ListItem with source attached
|
|
62
|
+
*/
|
|
63
|
+
export declare function attachSource<T extends ListItem, S>(item: T, source: S): WithSource<T, S>;
|
|
64
|
+
/**
|
|
65
|
+
* Get the source object from a ListItem if one was attached.
|
|
66
|
+
*
|
|
67
|
+
* @param item - The ListItem that may have a source attached
|
|
68
|
+
* @returns The source object or undefined
|
|
69
|
+
*/
|
|
70
|
+
export declare function getSource<S = any>(item: ListItem): S | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Get a property value from a ListItem, falling back to the source if not found.
|
|
73
|
+
* This is the core of the transparent source pattern.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* // Gets item.locked, or falls back to source.locked
|
|
78
|
+
* const isLocked = getPropertyWithFallback(item, 'locked');
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @param item - The ListItem
|
|
82
|
+
* @param key - The property key to get
|
|
83
|
+
* @returns The property value from item or source
|
|
84
|
+
*/
|
|
85
|
+
export declare function getPropertyWithFallback<T extends ListItem>(item: T, key: string): any;
|
|
86
|
+
/**
|
|
87
|
+
* Interface for items that support lockability.
|
|
88
|
+
* Implement this interface to indicate an item can be locked,
|
|
89
|
+
* which affects UI enablement and actions.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* interface Artifact extends LockedAware {
|
|
94
|
+
* id: string;
|
|
95
|
+
* name: string;
|
|
96
|
+
* locked?: boolean; // From LockedAware
|
|
97
|
+
* }
|
|
98
|
+
*
|
|
99
|
+
* // In action config:
|
|
100
|
+
* {
|
|
101
|
+
* id: 'edit',
|
|
102
|
+
* enablementExpression: 'not item.locked'
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export interface LockedAware {
|
|
107
|
+
/**
|
|
108
|
+
* Whether the item is locked.
|
|
109
|
+
* Locked items typically cannot be edited or deleted.
|
|
110
|
+
*/
|
|
111
|
+
locked?: boolean;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Type guard to check if an item is LockedAware.
|
|
115
|
+
*
|
|
116
|
+
* @param item - The item to check
|
|
117
|
+
* @returns True if the item has a locked property
|
|
118
|
+
*/
|
|
119
|
+
export declare function isLockedAware(item: unknown): item is LockedAware;
|
|
9
120
|
export interface ListItemTemplateFactory<T extends ListItem> {
|
|
10
121
|
build: (item: T) => FunctionComponent<T>;
|
|
11
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/common/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE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,KAAK,OAAO,CAAC;CAC3E;AAED,MAAM,WAAW,iBAAiB,CAChC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAC7B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEnD,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;CACpE;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IAC5D,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3D,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;CACzC;AAGD,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/common/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/D;AAMD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,a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AAqB,EACrB,kBAAkB,GACnB,MAAM,2CAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC"}
|
|
@@ -8,6 +8,7 @@ export interface SelectListProps<T extends ListItem = ListItem> {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
autoSelectFirstItem?: boolean;
|
|
10
10
|
getFirstItem?: (items: T[]) => T | undefined;
|
|
11
|
+
className?: string;
|
|
11
12
|
}
|
|
12
13
|
export declare const SelectList: <T extends ListItem = ListItem, P extends ListDataProvider<T> = ListDataProvider<T>>(props: ListProps<T, P> & SelectListProps<T>) => ReactElement | null;
|
|
13
14
|
//# sourceMappingURL=select-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-list.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/select-list/select-list.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG7E,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IAC5D,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,YAAY,KAAK,IAAI,CAAC;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"select-list.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/select-list/select-list.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG7E,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IAC5D,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,YAAY,KAAK,IAAI,CAAC;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,EAAE,CACvB,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAC7B,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,EAEnD,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,KACxC,YAAY,GAAG,IA6FnB,CAAC"}
|
|
@@ -1,43 +1,95 @@
|
|
|
1
1
|
import { ListItem } from '../common/types';
|
|
2
2
|
import { BaseAsyncTreeDataProvider } from '../common/data-providers/base-async-tree-data-provider';
|
|
3
3
|
import { AsyncTreeBranch } from '../common/data-providers/async-tree-data-provider';
|
|
4
|
+
import { IconConfig, ResolvedAction, ResolvedDecorator } from '../async-list/types';
|
|
4
5
|
import { IconColors, IconIds } from '../../../atoms/icon';
|
|
5
6
|
import { FunctionComponent, ReactElement, ReactNode } from 'react';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
* Configuration for an icon
|
|
9
|
-
*/
|
|
10
|
-
export interface IconConfig {
|
|
11
|
-
iconId: IconIds;
|
|
12
|
-
color?: IconColors;
|
|
13
|
-
}
|
|
8
|
+
export type { IconConfig, ResolvedAction, ResolvedDecorator };
|
|
14
9
|
/**
|
|
15
10
|
* Maps node types to icons - can be static map or dynamic function
|
|
16
11
|
*/
|
|
17
12
|
export type NodeIconMap<T extends ListItem = ListItem> = Record<string, IconConfig> | ((node: T) => IconConfig | undefined);
|
|
18
13
|
/**
|
|
19
14
|
* Configuration for a node action button
|
|
15
|
+
*
|
|
16
|
+
* DUAL VISIBILITY PATTERN:
|
|
17
|
+
* - visibilityExpression: Context-level visibility (when clause evaluation)
|
|
18
|
+
* - visibleFor: Per-node visibility check (item-specific logic)
|
|
19
|
+
*
|
|
20
|
+
* Both filters work together:
|
|
21
|
+
* 1. visibilityExpression evaluated first (removes action entirely if false)
|
|
22
|
+
* 2. visibleFor called per-node for remaining actions
|
|
20
23
|
*/
|
|
21
24
|
export interface NodeActionConfig<I extends Record<string, any>, T extends ListItem = ListItem> {
|
|
22
25
|
id: string;
|
|
23
26
|
iconId: IconIds;
|
|
24
27
|
tooltip?: string;
|
|
28
|
+
/** Label text for the action (shown in overflow menu) */
|
|
29
|
+
label?: string;
|
|
25
30
|
color?: IconColors;
|
|
31
|
+
/**
|
|
32
|
+
* Whether this is a primary action displayed inline.
|
|
33
|
+
* Primary actions appear as icon buttons; secondary actions
|
|
34
|
+
* (isPrimary=false or undefined) appear in the overflow menu.
|
|
35
|
+
* Max 3 primary actions are shown; extras overflow with a separator.
|
|
36
|
+
*/
|
|
37
|
+
isPrimary?: boolean;
|
|
26
38
|
onClick: (nodeId: string, originalItem: I) => void;
|
|
27
39
|
visibleFor?: (node: T) => boolean;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Optional visibility expression (when clause).
|
|
42
|
+
* Evaluated against global studio context to determine if action should appear at all.
|
|
43
|
+
* Only evaluated once - does not depend on individual node data.
|
|
44
|
+
*/
|
|
45
|
+
visibilityExpression?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Enablement expression for disabling action while keeping it visible.
|
|
48
|
+
*
|
|
49
|
+
* Evaluated with both studio context AND node context merged.
|
|
50
|
+
* When the expression evaluates to false, the action is shown but disabled.
|
|
51
|
+
*
|
|
52
|
+
* **Node context access:**
|
|
53
|
+
* - `node` - The tree node ListItem (id, name, etc.)
|
|
54
|
+
* - `item` - Alias for node (for consistency with item actions)
|
|
55
|
+
* Note: To access properties like `locked`, ensure your transformer
|
|
56
|
+
* includes them in the ListItem output.
|
|
57
|
+
*
|
|
58
|
+
* **Studio context access:**
|
|
59
|
+
* - `offline` - Whether app is offline
|
|
60
|
+
* - `user.isAdmin` - Whether user is an admin
|
|
61
|
+
* - `orgState.mutable` - Whether org data can be modified
|
|
62
|
+
* - All other studio context variables
|
|
63
|
+
*
|
|
64
|
+
* @example Disable for locked nodes (requires transformer to include `locked`)
|
|
65
|
+
* ```typescript
|
|
66
|
+
* // Transformer: (item) => ({ id: item.id, name: item.name, locked: item.locked })
|
|
67
|
+
* enablementExpression: "not node.locked"
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example Admin can edit locked nodes
|
|
71
|
+
* ```typescript
|
|
72
|
+
* enablementExpression: "user.isAdmin or not node.locked"
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
enablementExpression?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Node-specific enabled function (evaluated per-node during rendering).
|
|
78
|
+
* If false, action is shown but disabled for that specific node.
|
|
79
|
+
* Example: (node) => !node.locked
|
|
80
|
+
*/
|
|
81
|
+
enabledFor?: (node: T) => boolean;
|
|
38
82
|
}
|
|
39
83
|
/**
|
|
40
84
|
* Configuration for a node decorator (icon or badge)
|
|
85
|
+
*
|
|
86
|
+
* DUAL VISIBILITY PATTERN:
|
|
87
|
+
* - visibilityExpression: Context-level visibility (when clause evaluation)
|
|
88
|
+
* - visibleFor: Per-node visibility check (item-specific logic)
|
|
89
|
+
*
|
|
90
|
+
* Both filters work together:
|
|
91
|
+
* 1. visibilityExpression evaluated first (removes decorator entirely if false)
|
|
92
|
+
* 2. visibleFor called per-node for remaining decorators
|
|
41
93
|
*/
|
|
42
94
|
export interface NodeDecoratorConfig<T extends ListItem = ListItem> {
|
|
43
95
|
id: string;
|
|
@@ -45,16 +97,40 @@ export interface NodeDecoratorConfig<T extends ListItem = ListItem> {
|
|
|
45
97
|
color?: IconColors;
|
|
46
98
|
tooltip?: string;
|
|
47
99
|
visibleFor?: (node: T) => boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Optional visibility expression (when clause).
|
|
102
|
+
* Evaluated against global studio context to determine if decorator should appear at all.
|
|
103
|
+
* Only evaluated once - does not depend on individual node data.
|
|
104
|
+
*/
|
|
105
|
+
visibilityExpression?: string;
|
|
48
106
|
}
|
|
49
107
|
/**
|
|
50
|
-
*
|
|
108
|
+
* Content renderer function for custom node content in tree views.
|
|
109
|
+
* Allows using standard templates (like AsyncNamedCollapsibleBranch or StudioNamedListItem)
|
|
110
|
+
* while providing custom content to render inside them.
|
|
111
|
+
*
|
|
112
|
+
* @param node - The tree node data
|
|
113
|
+
* @param isSelected - Whether the node is currently selected
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```tsx
|
|
117
|
+
* // Custom branch content showing artifact details with selection awareness
|
|
118
|
+
* const branchContentRenderer: NodeContentRenderer<ArtifactListItem> = (node, isSelected) => (
|
|
119
|
+
* <div className={isSelected ? 'selected' : ''}>
|
|
120
|
+
* <span>{node.name}</span>
|
|
121
|
+
* <span className="version">{node.version}</span>
|
|
122
|
+
* </div>
|
|
123
|
+
* );
|
|
124
|
+
*
|
|
125
|
+
* // Custom item content showing VM status
|
|
126
|
+
* const itemContentRenderer: NodeContentRenderer<VMListItem> = (node, isSelected) => (
|
|
127
|
+
* <span className={`${node.status} ${isSelected ? 'selected' : ''}`}>
|
|
128
|
+
* {node.name} - {node.status}
|
|
129
|
+
* </span>
|
|
130
|
+
* );
|
|
131
|
+
* ```
|
|
51
132
|
*/
|
|
52
|
-
export
|
|
53
|
-
id: string;
|
|
54
|
-
iconId: IconIds;
|
|
55
|
-
color?: IconColors;
|
|
56
|
-
tooltip?: string;
|
|
57
|
-
}
|
|
133
|
+
export type NodeContentRenderer<T extends ListItem = ListItem> = (node: T, isSelected: boolean) => ReactNode;
|
|
58
134
|
/**
|
|
59
135
|
* Props for rendering an async tree branch.
|
|
60
136
|
*
|
|
@@ -78,6 +154,34 @@ export type AsyncBranchTemplateProps<T extends ListItem = ListItem> = T & {
|
|
|
78
154
|
"data-open"?: boolean;
|
|
79
155
|
/** Selected state indicator */
|
|
80
156
|
"data-selected"?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Expanded mode indicator - when true, tree is always expanded with no toggle UI.
|
|
159
|
+
* Branch templates should hide the expand/collapse chevron in this mode.
|
|
160
|
+
*/
|
|
161
|
+
"data-expanded-mode"?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Nesting depth of this branch (0 = root level).
|
|
164
|
+
* Branch templates can use this to apply appropriate indentation.
|
|
165
|
+
*/
|
|
166
|
+
"data-depth"?: number;
|
|
167
|
+
/**
|
|
168
|
+
* Indentation size per depth level in pixels.
|
|
169
|
+
* Branch templates use this to calculate margin/padding.
|
|
170
|
+
* @default 20
|
|
171
|
+
*/
|
|
172
|
+
"data-indent-size"?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Whether this node is selectable.
|
|
175
|
+
* When false, clicking the node should not update selection state.
|
|
176
|
+
* @default true
|
|
177
|
+
*/
|
|
178
|
+
"data-selectable"?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* When true, disables the default selection styling (blue background, white text).
|
|
181
|
+
* Selection state is still tracked but visual styling is suppressed.
|
|
182
|
+
* @default false
|
|
183
|
+
*/
|
|
184
|
+
"data-disable-selection-styling"?: boolean;
|
|
81
185
|
/** Resolved icon ID for this branch */
|
|
82
186
|
iconId?: IconIds;
|
|
83
187
|
/** Resolved icon color for this branch */
|
|
@@ -86,6 +190,11 @@ export type AsyncBranchTemplateProps<T extends ListItem = ListItem> = T & {
|
|
|
86
190
|
actions?: ResolvedAction[];
|
|
87
191
|
/** Resolved decorators for this branch */
|
|
88
192
|
decorators?: ResolvedDecorator[];
|
|
193
|
+
/**
|
|
194
|
+
* Custom content to render instead of the default name.
|
|
195
|
+
* When provided, templates should render this content instead of `branch.name`.
|
|
196
|
+
*/
|
|
197
|
+
content?: ReactNode;
|
|
89
198
|
};
|
|
90
199
|
/**
|
|
91
200
|
* Factory for creating branch templates.
|
|
@@ -103,7 +212,41 @@ export interface AsyncBranchTemplateFactory<T extends ListItem = ListItem> {
|
|
|
103
212
|
* @category Components
|
|
104
213
|
* @typeParam T - The ListItem type for this branch
|
|
105
214
|
*/
|
|
106
|
-
export type AsyncBranchTemplateType<T extends ListItem = ListItem> = AsyncBranchTemplateFactory<T> | FunctionComponent<AsyncBranchTemplateProps<T>>;
|
|
215
|
+
export type AsyncBranchTemplateType<T extends ListItem = ListItem> = AsyncBranchTemplateFactory<T> | FunctionComponent<AsyncBranchTemplateProps<T>> | FunctionComponent<AsyncBranchTemplateProps<ListItem>>;
|
|
216
|
+
/**
|
|
217
|
+
* Factory for creating item templates based on item data.
|
|
218
|
+
* Enables dynamic template selection for different item types in tree structures.
|
|
219
|
+
*
|
|
220
|
+
* @category Components
|
|
221
|
+
* @typeParam T - The ListItem type for this factory
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```tsx
|
|
225
|
+
* const itemFactory: AsyncTreeItemTemplateFactory<MyTreeItem> = {
|
|
226
|
+
* build: (item) => {
|
|
227
|
+
* if (item.type === 'file') return FileItemTemplate;
|
|
228
|
+
* return DefaultItemTemplate;
|
|
229
|
+
* }
|
|
230
|
+
* };
|
|
231
|
+
*
|
|
232
|
+
* <AsyncTreeList
|
|
233
|
+
* dataProvider={provider}
|
|
234
|
+
* BranchTemplate={BranchTemplate}
|
|
235
|
+
* ItemTemplate={itemFactory}
|
|
236
|
+
* />
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
export interface AsyncTreeItemTemplateFactory<T extends ListItem = ListItem> {
|
|
240
|
+
/** Build an item component based on item data */
|
|
241
|
+
build: (item: T) => FunctionComponent<T>;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Item template type for tree leaf nodes - can be a static component or a factory.
|
|
245
|
+
*
|
|
246
|
+
* @category Components
|
|
247
|
+
* @typeParam T - The ListItem type for this template
|
|
248
|
+
*/
|
|
249
|
+
export type AsyncTreeItemTemplateType<T extends ListItem = ListItem> = FunctionComponent<T> | FunctionComponent<ListItem> | AsyncTreeItemTemplateFactory<T>;
|
|
107
250
|
/**
|
|
108
251
|
* Props for AsyncTreeList component.
|
|
109
252
|
*
|
|
@@ -116,10 +259,31 @@ export interface AsyncTreeListProps<I extends Record<string, any>, T extends Lis
|
|
|
116
259
|
dataProvider: BaseAsyncTreeDataProvider<any, I, T> | null;
|
|
117
260
|
/** Template for rendering branch nodes */
|
|
118
261
|
BranchTemplate: AsyncBranchTemplateType<T>;
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Template for rendering leaf nodes.
|
|
264
|
+
* Can be a static component or a factory that returns different components based on item data.
|
|
265
|
+
*
|
|
266
|
+
* @example Static component
|
|
267
|
+
* ```tsx
|
|
268
|
+
* ItemTemplate={MyLeafItemTemplate}
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* @example Factory for dynamic template selection
|
|
272
|
+
* ```tsx
|
|
273
|
+
* ItemTemplate={{
|
|
274
|
+
* build: (item) => item.type === 'file' ? FileTemplate : FolderTemplate
|
|
275
|
+
* }}
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
ItemTemplate: AsyncTreeItemTemplateType<T>;
|
|
279
|
+
/**
|
|
280
|
+
* Callback when a branch is expanded.
|
|
281
|
+
* Called BEFORE loading children - use this to activate the model
|
|
282
|
+
* so its children are populated when the tree fetches them.
|
|
283
|
+
*
|
|
284
|
+
* Can be async - the tree will wait for it to complete before loading children.
|
|
285
|
+
*/
|
|
286
|
+
onBranchExpand?: (itemId: string, item: I) => void | Promise<void>;
|
|
123
287
|
/** Callback when a branch is collapsed */
|
|
124
288
|
onBranchCollapse?: (itemId: string) => void;
|
|
125
289
|
/** Callback for list item actions */
|
|
@@ -146,6 +310,65 @@ export interface AsyncTreeListProps<I extends Record<string, any>, T extends Lis
|
|
|
146
310
|
nodeActions?: NodeActionConfig<I, T>[];
|
|
147
311
|
/** Decorator configurations - presentation icons without actions */
|
|
148
312
|
nodeDecorators?: NodeDecoratorConfig<T>[];
|
|
313
|
+
/**
|
|
314
|
+
* When true, renders the tree as a flat indented list with all branches expanded.
|
|
315
|
+
* No collapse/expand toggles are shown - the full hierarchy is always visible.
|
|
316
|
+
* Useful for displaying tree data in a compact, scannable format.
|
|
317
|
+
* @default false
|
|
318
|
+
*/
|
|
319
|
+
expandedMode?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* Indentation size per depth level in pixels.
|
|
322
|
+
* Controls how much child nodes are indented relative to their parents.
|
|
323
|
+
* @default 20
|
|
324
|
+
*/
|
|
325
|
+
indentSize?: number;
|
|
326
|
+
/**
|
|
327
|
+
* Callback to determine if a node is selectable.
|
|
328
|
+
* When a node is not selectable, clicking it will only expand/collapse (for branches)
|
|
329
|
+
* without updating the selection context.
|
|
330
|
+
*
|
|
331
|
+
* @param node - The transformed ListItem for the node
|
|
332
|
+
* @returns true if the node can be selected, false otherwise
|
|
333
|
+
* @default All nodes are selectable (returns true)
|
|
334
|
+
*/
|
|
335
|
+
isNodeSelectable?: (node: T) => boolean;
|
|
336
|
+
/**
|
|
337
|
+
* Custom content renderer for branch nodes.
|
|
338
|
+
* Allows using standard branch templates while providing custom content.
|
|
339
|
+
* The rendered content is passed as `children` to the BranchTemplate.
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```tsx
|
|
343
|
+
* branchContentRenderer={(node) => (
|
|
344
|
+
* <span>{node.name} <Badge>{node.count}</Badge></span>
|
|
345
|
+
* )}
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
branchContentRenderer?: NodeContentRenderer<T>;
|
|
349
|
+
/**
|
|
350
|
+
* Custom content renderer for leaf item nodes.
|
|
351
|
+
* Allows using standard item templates while providing custom content.
|
|
352
|
+
* The rendered content is passed as `children` to the ItemTemplate.
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* ```tsx
|
|
356
|
+
* itemContentRenderer={(node, isSelected) => (
|
|
357
|
+
* <span className={isSelected ? 'selected' : ''}>{node.name}</span>
|
|
358
|
+
* )}
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
itemContentRenderer?: NodeContentRenderer<T>;
|
|
362
|
+
/**
|
|
363
|
+
* When true, disables the default selection styling (blue background, white text)
|
|
364
|
+
* on tree nodes. Selection state is still tracked and passed to content renderers,
|
|
365
|
+
* allowing custom selection rendering via branchContentRenderer/itemContentRenderer.
|
|
366
|
+
*
|
|
367
|
+
* Use this when you want to handle selection styling yourself within the content renderer.
|
|
368
|
+
*
|
|
369
|
+
* @default false
|
|
370
|
+
*/
|
|
371
|
+
disableSelectionStyling?: boolean;
|
|
149
372
|
}
|
|
150
373
|
/**
|
|
151
374
|
* Async tree list component with lazy loading support.
|
|
@@ -177,7 +400,7 @@ export interface AsyncTreeListProps<I extends Record<string, any>, T extends Lis
|
|
|
177
400
|
* @author TBD
|
|
178
401
|
* @version 2.1.1
|
|
179
402
|
*/
|
|
180
|
-
export declare const AsyncTreeList: (<I extends Record<string, any>, T extends ListItem>({ dataProvider, BranchTemplate, ItemTemplate, onBranchExpand, onBranchCollapse, onListItemAction, onBranchSelect, selectedBranchId, emptyState, branchEmptyState, className, singleBranchOnly, openedBranches: controlledOpenedBranches, setOpenedBranches: controlledSetOpenedBranches, nodeIconMap, nodeActions, nodeDecorators, }: AsyncTreeListProps<I, T>) => ReactElement | null) & {
|
|
403
|
+
export declare const AsyncTreeList: (<I extends Record<string, any>, T extends ListItem>({ dataProvider, BranchTemplate, ItemTemplate, onBranchExpand, onBranchCollapse, onListItemAction, onBranchSelect, selectedBranchId, emptyState, branchEmptyState, className, singleBranchOnly, openedBranches: controlledOpenedBranches, setOpenedBranches: controlledSetOpenedBranches, nodeIconMap, nodeActions, nodeDecorators, expandedMode, indentSize, isNodeSelectable, branchContentRenderer, itemContentRenderer, disableSelectionStyling, }: AsyncTreeListProps<I, T>) => ReactElement | null) & {
|
|
181
404
|
displayName: string;
|
|
182
405
|
};
|
|
183
406
|
//# sourceMappingURL=async-tree-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-tree-list.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/tree-list/async-tree-list.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASxE,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACxG,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"async-tree-list.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/tree-list/async-tree-list.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASxE,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACxG,OAAO,EAA8B,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAM5E,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;AAE9D;;GAEG;AACH,MAAM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M,CAAC;IAEpB;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAExC;;;;;;;;;;;OAWG;IACH,qBAAqB,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAE/C;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAE7C;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAyTD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,aAAa,8eAyBrB,mBAAmB,CAAC,EAAE,CAAC,CAAC,KAAG,YAAY,GAAG,IAAI;;CA2HlD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AsyncTreeItemTemplateFactory, AsyncTreeItemTemplateType } from '../async-tree-list';
|
|
2
|
+
import { ListItem } from '../../common/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Type guard to determine if a template is a factory (has build method)
|
|
6
|
+
* or a static component.
|
|
7
|
+
*
|
|
8
|
+
* @category Utilities
|
|
9
|
+
* @typeParam T - The ListItem type
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const LeafComponent = isItemTemplateFactory(template)
|
|
14
|
+
* ? template.build(item) // Call build method
|
|
15
|
+
* : template; // Use static component
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function isItemTemplateFactory<T extends ListItem>(template: AsyncTreeItemTemplateType<T>): template is AsyncTreeItemTemplateFactory<T>;
|
|
19
|
+
//# sourceMappingURL=is-item-template-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-item-template-factory.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/tree-list/helpers/is-item-template-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,QAAQ,EACtD,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACrC,QAAQ,IAAI,4BAA4B,CAAC,CAAC,CAAC,CAG7C"}
|
package/components/molecules/list/tree-list/templates/async-named-collapsible-branch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-named-collapsible-branch.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/tree-list/templates/async-named-collapsible-branch.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"async-named-collapsible-branch.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/libraries/base-ui-components/src/components/molecules/list/tree-list/templates/async-named-collapsible-branch.tsx"],"names":[],"mappings":";AASA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAOnE,eAAO,MAAM,2BAA2B,6DAsHrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/table/table.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/table/table.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,UAAU,EAGX,MAAM,gBAAgB,CAAC;AAyIxB,eAAO,MAAM,KAAK,EAAE,CAClB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,iBAAiB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAErD,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,KACpB,SA6CJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-table.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/table/virtual-table.tsx"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,KAAK,EACV,aAAa,EAEb,iBAAiB,EACjB,UAAU,EAEX,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"virtual-table.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/table/virtual-table.tsx"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,KAAK,EACV,aAAa,EAEb,iBAAiB,EACjB,UAAU,EAEX,MAAM,gBAAgB,CAAC;AA6HxB,eAAO,MAAM,YAAY,EAAE,CACzB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,iBAAiB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAErD,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,KAC7C,SA2CJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ViewHeaderAction } from './types';
|
|
2
|
+
|
|
3
|
+
export interface ActionBarProps {
|
|
4
|
+
/** Actions to render */
|
|
5
|
+
actions: ViewHeaderAction[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* ActionBar renders actions with primary/secondary/overflow behavior.
|
|
9
|
+
*
|
|
10
|
+
* - Primary actions (isPrimary=true) are rendered inline as icon buttons (max 3)
|
|
11
|
+
* - Secondary actions (isPrimary=false or undefined) appear in the overflow menu
|
|
12
|
+
* - If more than 3 primary actions exist, extras are shown at the top of the
|
|
13
|
+
* overflow menu with a separator below them
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <ActionBar
|
|
18
|
+
* actions={[
|
|
19
|
+
* { id: 'save', iconId: 'Save', tooltip: 'Save', isPrimary: true, onClick: handleSave },
|
|
20
|
+
* { id: 'edit', iconId: 'Edit', tooltip: 'Edit', isPrimary: true, onClick: handleEdit },
|
|
21
|
+
* { id: 'delete', iconId: 'Delete', tooltip: 'Delete', label: 'Delete', onClick: handleDelete },
|
|
22
|
+
* ]}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const ActionBar: import('react').NamedExoticComponent<ActionBarProps>;
|
|
27
|
+
//# sourceMappingURL=action-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-bar.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/view/action-bar.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;;AASH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAWhD,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,SAAS,sDAgIpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (C) Copyright 2025, TCCC, All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
export { View } from './view';
|
|
5
|
+
export { ViewHeader } from './view-header';
|
|
6
|
+
export { ActionBar } from './action-bar';
|
|
7
|
+
export type { ViewProps, ViewHeaderProps, ViewHeaderAction, ViewIconConfig, } from './types';
|
|
8
|
+
export type { ActionBarProps } from './action-bar';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/libraries/base-ui-components/src/components/molecules/view/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EACV,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|