akanjs 3.0.0-alpha.26 → 3.0.0-alpha.27
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.
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -18,6 +18,9 @@ interface AdminPanelProps<T extends string, State, Input, Full extends {
|
|
|
18
18
|
[key: string]: any;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
+
template?: any;
|
|
22
|
+
unit?: any;
|
|
23
|
+
view?: any;
|
|
21
24
|
/** Summary column to query descriptor. Only a column this map names becomes a link to its filtered listing. */
|
|
22
25
|
queryMap?: {
|
|
23
26
|
[key: string]: unknown;
|
|
@@ -31,5 +34,5 @@ export default function AdminPanel<RefName extends string, State, Input, Full ex
|
|
|
31
34
|
id: string;
|
|
32
35
|
}, Light extends {
|
|
33
36
|
id: string;
|
|
34
|
-
}>({ slice, components, queryMap, summaryColumns, insightColumns, renderInsight, renderDashboard, ...props }: AdminPanelProps<RefName, State, Input, Full, Light>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
}>({ slice, components, queryMap, template, unit, view, summaryColumns, insightColumns, renderInsight, renderDashboard, ...props }: AdminPanelProps<RefName, State, Input, Full, Light>): import("react/jsx-runtime").JSX.Element;
|
|
35
38
|
export {};
|
package/ui/Model/AdminPanel.tsx
CHANGED
|
@@ -14,6 +14,9 @@ interface AdminPanelProps<T extends string, State, Input, Full extends { id: str
|
|
|
14
14
|
Unit: { [key: string]: any };
|
|
15
15
|
View: { [key: string]: any };
|
|
16
16
|
};
|
|
17
|
+
template?: any;
|
|
18
|
+
unit?: any;
|
|
19
|
+
view?: any;
|
|
17
20
|
/** Summary column to query descriptor. Only a column this map names becomes a link to its filtered listing. */
|
|
18
21
|
queryMap?: { [key: string]: unknown };
|
|
19
22
|
/** Keys of the app's `summary` state shown as dashboard tiles above the list. */
|
|
@@ -32,6 +35,9 @@ export default function AdminPanel<
|
|
|
32
35
|
slice,
|
|
33
36
|
components,
|
|
34
37
|
queryMap,
|
|
38
|
+
template,
|
|
39
|
+
unit,
|
|
40
|
+
view,
|
|
35
41
|
summaryColumns,
|
|
36
42
|
insightColumns = [],
|
|
37
43
|
renderInsight = ({ insight }) => (
|
|
@@ -52,9 +58,15 @@ export default function AdminPanel<
|
|
|
52
58
|
...props
|
|
53
59
|
}: AdminPanelProps<RefName, State, Input, Full, Light>) {
|
|
54
60
|
const { sliceName } = slice;
|
|
55
|
-
const Unit = components.Unit.General
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
const Unit = (unit ?? components.Unit.General ?? components.Unit.Card ?? Object.values(components.Unit).at(0)) as
|
|
62
|
+
| ((props: ModelProps<any, any>) => ReactNode)
|
|
63
|
+
| undefined;
|
|
64
|
+
const Template = (template ?? components.Template.General ?? Object.values(components.Template).at(0)) as
|
|
65
|
+
| ((props: { [key in RefName]: Full }) => ReactNode)
|
|
66
|
+
| undefined;
|
|
67
|
+
const View = (view ?? components.View.General ?? Object.values(components.View).at(0)) as
|
|
68
|
+
| ComponentType<{ [key in RefName]: Full }>
|
|
69
|
+
| undefined;
|
|
58
70
|
return (
|
|
59
71
|
<Data.ListContainer
|
|
60
72
|
slice={slice}
|