@webiny/app-aco 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.eb196ccd2f
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/AdvancedSearch/domain/Filter.d.ts +24 -24
- package/components/FolderTree/List/List.js +15 -1
- package/components/FolderTree/List/List.js.map +1 -1
- package/components/Table/components/Table/Table.d.ts +4 -3
- package/components/Table/components/Table/Table.js.map +1 -1
- package/components/Table/components/Table/TableInner.d.ts +3 -2
- package/components/Table/components/Table/TableInner.js.map +1 -1
- package/components/Table/createTableData.d.ts +5 -5
- package/components/Table/createTableData.js +8 -8
- package/components/Table/createTableData.js.map +1 -1
- package/components/Table/useTableRow.d.ts +6 -2
- package/components/Table/useTableRow.js +10 -3
- package/components/Table/useTableRow.js.map +1 -1
- package/config/AcoConfig.d.ts +12 -7
- package/config/AcoConfig.js +0 -5
- package/config/AcoConfig.js.map +1 -1
- package/config/table/Column.d.ts +8 -3
- package/config/table/Column.js.map +1 -1
- package/config/table/index.d.ts +7 -2
- package/contexts/index.d.ts +1 -1
- package/contexts/index.js +1 -1
- package/contexts/index.js.map +1 -1
- package/features/folders/getFolderAncestors/FolderDto.d.ts +9 -0
- package/features/folders/getFolderAncestors/FolderDto.js +3 -0
- package/features/folders/getFolderAncestors/FolderDto.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.d.ts +4 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.js +12 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.d.ts +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.js +97 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.d.ts +7 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.js +25 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.d.ts +14 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.js +18 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.js.map +1 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.d.ts +4 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.js +3 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.js.map +1 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.d.ts +7 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.js +3 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.js.map +1 -0
- package/features/folders/getFolderAncestors/index.d.ts +1 -0
- package/features/folders/getFolderAncestors/index.js +3 -0
- package/features/folders/getFolderAncestors/index.js.map +1 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.d.ts +3 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.js +17 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsRepository.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCase.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespace.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespaceAndModelId.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/useGetFolderExtensionsFields.d.ts +1 -1
- package/features/folders/index.d.ts +1 -0
- package/features/folders/index.js +1 -0
- package/features/folders/index.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +18 -18
- package/table.types.d.ts +5 -3
- package/table.types.js.map +1 -1
- package/types.d.ts +1 -1
- package/types.js +0 -1
- package/types.js.map +1 -1
|
@@ -30,54 +30,54 @@ export declare const filterValidationSchema: zod.ZodObject<{
|
|
|
30
30
|
condition: zod.ZodString;
|
|
31
31
|
value: zod.ZodUnion<[zod.ZodBoolean, zod.ZodNumber, zod.ZodString, zod.ZodArray<zod.ZodUnion<[zod.ZodBoolean, zod.ZodNumber, zod.ZodString]>, "atleastone">]>;
|
|
32
32
|
}, "strip", zod.ZodTypeAny, {
|
|
33
|
-
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
34
33
|
field: string;
|
|
35
34
|
condition: string;
|
|
36
|
-
}, {
|
|
37
35
|
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
36
|
+
}, {
|
|
38
37
|
field: string;
|
|
39
38
|
condition: string;
|
|
39
|
+
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
40
40
|
}>, "many">;
|
|
41
41
|
}, "strip", zod.ZodTypeAny, {
|
|
42
|
+
operation: Operation;
|
|
42
43
|
filters: {
|
|
43
|
-
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
44
44
|
field: string;
|
|
45
45
|
condition: string;
|
|
46
|
+
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
46
47
|
}[];
|
|
47
|
-
operation: Operation;
|
|
48
48
|
}, {
|
|
49
|
+
operation: Operation;
|
|
49
50
|
filters: {
|
|
50
|
-
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
51
51
|
field: string;
|
|
52
52
|
condition: string;
|
|
53
|
+
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
53
54
|
}[];
|
|
54
|
-
operation: Operation;
|
|
55
55
|
}>, "many">;
|
|
56
56
|
}, "strip", zod.ZodTypeAny, {
|
|
57
|
+
name: string;
|
|
58
|
+
description: string;
|
|
59
|
+
operation: Operation;
|
|
57
60
|
groups: {
|
|
61
|
+
operation: Operation;
|
|
58
62
|
filters: {
|
|
59
|
-
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
60
63
|
field: string;
|
|
61
64
|
condition: string;
|
|
65
|
+
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
62
66
|
}[];
|
|
63
|
-
operation: Operation;
|
|
64
67
|
}[];
|
|
68
|
+
id?: string | null | undefined;
|
|
69
|
+
}, {
|
|
65
70
|
name: string;
|
|
66
71
|
description: string;
|
|
67
72
|
operation: Operation;
|
|
68
|
-
id?: string | null | undefined;
|
|
69
|
-
}, {
|
|
70
73
|
groups: {
|
|
74
|
+
operation: Operation;
|
|
71
75
|
filters: {
|
|
72
|
-
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
73
76
|
field: string;
|
|
74
77
|
condition: string;
|
|
78
|
+
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
75
79
|
}[];
|
|
76
|
-
operation: Operation;
|
|
77
80
|
}[];
|
|
78
|
-
name: string;
|
|
79
|
-
description: string;
|
|
80
|
-
operation: Operation;
|
|
81
81
|
id?: string | null | undefined;
|
|
82
82
|
}>;
|
|
83
83
|
export declare class Filter {
|
|
@@ -91,30 +91,30 @@ export declare class Filter {
|
|
|
91
91
|
static createEmpty(): Filter;
|
|
92
92
|
static create(data: FilterDTO): Filter;
|
|
93
93
|
static validate(data: FilterDTO): zod.SafeParseReturnType<{
|
|
94
|
+
name: string;
|
|
95
|
+
description: string;
|
|
96
|
+
operation: Operation;
|
|
94
97
|
groups: {
|
|
98
|
+
operation: Operation;
|
|
95
99
|
filters: {
|
|
96
|
-
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
97
100
|
field: string;
|
|
98
101
|
condition: string;
|
|
102
|
+
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
99
103
|
}[];
|
|
100
|
-
operation: Operation;
|
|
101
104
|
}[];
|
|
105
|
+
id?: string | null | undefined;
|
|
106
|
+
}, {
|
|
102
107
|
name: string;
|
|
103
108
|
description: string;
|
|
104
109
|
operation: Operation;
|
|
105
|
-
id?: string | null | undefined;
|
|
106
|
-
}, {
|
|
107
110
|
groups: {
|
|
111
|
+
operation: Operation;
|
|
108
112
|
filters: {
|
|
109
|
-
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
110
113
|
field: string;
|
|
111
114
|
condition: string;
|
|
115
|
+
value: string | number | boolean | [string | number | boolean, ...(string | number | boolean)[]];
|
|
112
116
|
}[];
|
|
113
|
-
operation: Operation;
|
|
114
117
|
}[];
|
|
115
|
-
name: string;
|
|
116
|
-
description: string;
|
|
117
|
-
operation: Operation;
|
|
118
118
|
id?: string | null | undefined;
|
|
119
119
|
}>;
|
|
120
120
|
protected constructor(data: {
|
|
@@ -3,7 +3,7 @@ import { Tree } from "@webiny/admin-ui";
|
|
|
3
3
|
import { useSnackbar } from "@webiny/app-admin";
|
|
4
4
|
import { Node } from "../Node";
|
|
5
5
|
import { createInitialOpenList, createTreeData } from "./utils";
|
|
6
|
-
import { useGetFolderLevelPermission, useListFoldersByParentIds, useUpdateFolder } from "../../../features";
|
|
6
|
+
import { useGetFolderAncestors, useGetFolderLevelPermission, useListFoldersByParentIds, useUpdateFolder } from "../../../features";
|
|
7
7
|
import { ROOT_FOLDER } from "../../../constants";
|
|
8
8
|
import { FolderProvider } from "../../../contexts/folder";
|
|
9
9
|
export const List = ({
|
|
@@ -23,6 +23,9 @@ export const List = ({
|
|
|
23
23
|
const {
|
|
24
24
|
getFolderLevelPermission: canManageStructure
|
|
25
25
|
} = useGetFolderLevelPermission("canManageStructure");
|
|
26
|
+
const {
|
|
27
|
+
getFolderAncestors
|
|
28
|
+
} = useGetFolderAncestors();
|
|
26
29
|
const {
|
|
27
30
|
showSnackbar
|
|
28
31
|
} = useSnackbar();
|
|
@@ -70,6 +73,16 @@ export const List = ({
|
|
|
70
73
|
});
|
|
71
74
|
}, []);
|
|
72
75
|
const canDrag = useCallback(node => node.id !== ROOT_FOLDER && canManageStructure(node.id), [canManageStructure]);
|
|
76
|
+
const canDrop = (_, options) => {
|
|
77
|
+
const {
|
|
78
|
+
dragSourceId,
|
|
79
|
+
dropTargetId
|
|
80
|
+
} = options;
|
|
81
|
+
const dropTagetAncestorIds = getFolderAncestors(dropTargetId).map(item => item.id);
|
|
82
|
+
|
|
83
|
+
// Prevent dropping a folder into itself or its descendants
|
|
84
|
+
return !(dragSourceId && dropTagetAncestorIds.includes(dragSourceId));
|
|
85
|
+
};
|
|
73
86
|
const nodeRenderer = node => {
|
|
74
87
|
const folder = folders.find(folder => folder.id === node.id);
|
|
75
88
|
return /*#__PURE__*/React.createElement(FolderProvider, {
|
|
@@ -90,6 +103,7 @@ export const List = ({
|
|
|
90
103
|
onNodeClick: handleNodeClick,
|
|
91
104
|
sort: sort,
|
|
92
105
|
canDrag: canDrag,
|
|
106
|
+
canDrop: canDrop,
|
|
93
107
|
renderer: nodeRenderer,
|
|
94
108
|
defaultLockedOpenNodeIds: [ROOT_FOLDER],
|
|
95
109
|
loadingNodeIds: loading
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","Tree","useSnackbar","Node","createInitialOpenList","createTreeData","useGetFolderLevelPermission","useListFoldersByParentIds","useUpdateFolder","ROOT_FOLDER","FolderProvider","List","folders","onFolderClick","focusedFolderId","hiddenFolderIds","enableActions","listFoldersByParentIds","loading","updateFolder","getFolderLevelPermission","canManageStructure","showSnackbar","treeData","setTreeData","openFolderIds","setOpenFolderIds","prev","expanded","Set","handleChangeOpen","nodes","folderIds","map","node","id","updatedOpenIds","fetchableIds","filter","handleDrop","_","dragSourceId","dropTargetId","item","find","folder","Error","parentId","error","message","sort","a","b","label","localeCompare","undefined","numeric","canDrag","nodeRenderer","createElement","handleNodeClick","rootId","defaultOpenNodeIds","onChangeOpen","onDrop","onNodeClick","renderer","defaultLockedOpenNodeIds","loadingNodeIds"],"sources":["List.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","Tree","useSnackbar","Node","createInitialOpenList","createTreeData","useGetFolderAncestors","useGetFolderLevelPermission","useListFoldersByParentIds","useUpdateFolder","ROOT_FOLDER","FolderProvider","List","folders","onFolderClick","focusedFolderId","hiddenFolderIds","enableActions","listFoldersByParentIds","loading","updateFolder","getFolderLevelPermission","canManageStructure","getFolderAncestors","showSnackbar","treeData","setTreeData","openFolderIds","setOpenFolderIds","prev","expanded","Set","handleChangeOpen","nodes","folderIds","map","node","id","updatedOpenIds","fetchableIds","filter","handleDrop","_","dragSourceId","dropTargetId","item","find","folder","Error","parentId","error","message","sort","a","b","label","localeCompare","undefined","numeric","canDrag","canDrop","options","dropTagetAncestorIds","includes","nodeRenderer","createElement","handleNodeClick","rootId","defaultOpenNodeIds","onChangeOpen","onDrop","onNodeClick","renderer","defaultLockedOpenNodeIds","loadingNodeIds"],"sources":["List.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport {\n Tree,\n type NodeDto,\n type TreeProps,\n type WithDefaultNodeData,\n type DropOptions\n} from \"@webiny/admin-ui\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { Node } from \"../Node\";\nimport { createInitialOpenList, createTreeData } from \"./utils\";\nimport {\n useGetFolderAncestors,\n useGetFolderLevelPermission,\n useListFoldersByParentIds,\n useUpdateFolder\n} from \"~/features\";\nimport { ROOT_FOLDER } from \"~/constants\";\nimport type { FolderItem } from \"~/types\";\nimport { FolderProvider } from \"~/contexts/folder\";\n\ninterface ListProps {\n folders: FolderItem[];\n focusedFolderId?: string;\n hiddenFolderIds?: string[];\n enableActions?: boolean;\n onFolderClick: (data: FolderItem) => void;\n}\n\nexport const List = ({\n folders,\n onFolderClick,\n focusedFolderId,\n hiddenFolderIds,\n enableActions\n}: ListProps) => {\n const { listFoldersByParentIds, loading } = useListFoldersByParentIds();\n const { updateFolder } = useUpdateFolder();\n const { getFolderLevelPermission: canManageStructure } =\n useGetFolderLevelPermission(\"canManageStructure\");\n const { getFolderAncestors } = useGetFolderAncestors();\n const { showSnackbar } = useSnackbar();\n\n const [treeData, setTreeData] = useState<NodeDto<FolderItem>[]>([]);\n const [openFolderIds, setOpenFolderIds] = useState<string[]>([ROOT_FOLDER]);\n\n useEffect(() => {\n setTreeData(createTreeData(folders, focusedFolderId, hiddenFolderIds));\n }, [folders, focusedFolderId, hiddenFolderIds]);\n\n useEffect(() => {\n setOpenFolderIds(prev => {\n const expanded = createInitialOpenList(folders, prev, focusedFolderId);\n return [...new Set([ROOT_FOLDER, ...expanded])];\n });\n }, [focusedFolderId, folders, setOpenFolderIds]);\n\n const handleChangeOpen: TreeProps[\"onChangeOpen\"] = async nodes => {\n const folderIds = nodes.map(node => node.id);\n const updatedOpenIds = [...new Set([ROOT_FOLDER, ...folderIds])];\n setOpenFolderIds(updatedOpenIds);\n\n const fetchableIds = folderIds.filter(id => id !== ROOT_FOLDER && id !== \"0\");\n await listFoldersByParentIds(fetchableIds);\n };\n\n const handleDrop: TreeProps[\"onDrop\"] = async (_, { dragSourceId, dropTargetId }) => {\n try {\n const item = folders.find(folder => folder.id === dragSourceId);\n if (!item) {\n throw new Error(\"Folder not found!\");\n }\n\n await updateFolder({\n ...item,\n parentId: dropTargetId !== ROOT_FOLDER ? (dropTargetId as string) : null\n });\n } catch (error) {\n showSnackbar(error.message);\n }\n };\n\n const sort = useMemo(\n () => (a: NodeDto<any>, b: NodeDto<any>) => {\n if (a.id === ROOT_FOLDER || b.id === ROOT_FOLDER) {\n return 1;\n }\n return a.label.localeCompare(b.label, undefined, { numeric: true });\n },\n []\n );\n\n const canDrag: TreeProps<FolderItem>[\"canDrag\"] = useCallback(\n (node: NodeDto<FolderItem>) => node.id !== ROOT_FOLDER && canManageStructure(node.id),\n [canManageStructure]\n );\n\n const canDrop: TreeProps<FolderItem>[\"canDrop\"] = (_, options: DropOptions<FolderItem>) => {\n const { dragSourceId, dropTargetId } = options;\n const dropTagetAncestorIds = getFolderAncestors(dropTargetId).map(item => item.id);\n\n // Prevent dropping a folder into itself or its descendants\n return !(dragSourceId && dropTagetAncestorIds.includes(dragSourceId));\n };\n\n const nodeRenderer: TreeProps<FolderItem>[\"renderer\"] = node => {\n const folder = folders.find(folder => folder.id === node.id);\n return (\n <FolderProvider folder={folder}>\n <Node enableActions={enableActions} />\n </FolderProvider>\n );\n };\n\n const handleNodeClick = useCallback(\n (node: WithDefaultNodeData<FolderItem>) => {\n onFolderClick(node);\n },\n [onFolderClick]\n );\n\n return (\n <Tree<FolderItem>\n nodes={treeData}\n rootId={\"0\"}\n defaultOpenNodeIds={openFolderIds}\n onChangeOpen={handleChangeOpen}\n onDrop={handleDrop}\n onNodeClick={handleNodeClick}\n sort={sort}\n canDrag={canDrag}\n canDrop={canDrop}\n renderer={nodeRenderer}\n defaultLockedOpenNodeIds={[ROOT_FOLDER]}\n loadingNodeIds={loading}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,SACIC,IAAI,QAKD,kBAAkB;AACzB,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,IAAI;AACb,SAASC,qBAAqB,EAAEC,cAAc;AAC9C,SACIC,qBAAqB,EACrBC,2BAA2B,EAC3BC,yBAAyB,EACzBC,eAAe;AAEnB,SAASC,WAAW;AAEpB,SAASC,cAAc;AAUvB,OAAO,MAAMC,IAAI,GAAGA,CAAC;EACjBC,OAAO;EACPC,aAAa;EACbC,eAAe;EACfC,eAAe;EACfC;AACO,CAAC,KAAK;EACb,MAAM;IAAEC,sBAAsB;IAAEC;EAAQ,CAAC,GAAGX,yBAAyB,CAAC,CAAC;EACvE,MAAM;IAAEY;EAAa,CAAC,GAAGX,eAAe,CAAC,CAAC;EAC1C,MAAM;IAAEY,wBAAwB,EAAEC;EAAmB,CAAC,GAClDf,2BAA2B,CAAC,oBAAoB,C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AY,CAAC,CAACT,GAAG,CAACU,IAAI,IAAIA,IAAI,CAACR,EAAE,CAAC;;IAElF;IACA,OAAO,EAAEM,YAAY,IAAImB,oBAAoB,CAACC,QAAQ,CAACpB,YAAY,CAAC,CAAC;EACzE,CAAC;EAED,MAAMqB,YAA+C,GAAG5B,IAAI,IAAI;IAC5D,MAAMW,MAAM,GAAGlC,OAAO,CAACiC,IAAI,CAACC,MAAM,IAAIA,MAAM,CAACV,EAAE,KAAKD,IAAI,CAACC,EAAE,CAAC;IAC5D,oBACIzC,KAAA,CAAAqE,aAAA,CAACtD,cAAc;MAACoC,MAAM,EAAEA;IAAO,gBAC3BnD,KAAA,CAAAqE,aAAA,CAAC9D,IAAI;MAACc,aAAa,EAAEA;IAAc,CAAE,CACzB,CAAC;EAEzB,CAAC;EAED,MAAMiD,eAAe,GAAGrE,WAAW,CAC9BuC,IAAqC,IAAK;IACvCtB,aAAa,CAACsB,IAAI,CAAC;EACvB,CAAC,EACD,CAACtB,aAAa,CAClB,CAAC;EAED,oBACIlB,KAAA,CAAAqE,aAAA,CAAChE,IAAI;IACDgC,KAAK,EAAER,QAAS;IAChB0C,MAAM,EAAE,GAAI;IACZC,kBAAkB,EAAEzC,aAAc;IAClC0C,YAAY,EAAErC,gBAAiB;IAC/BsC,MAAM,EAAE7B,UAAW;IACnB8B,WAAW,EAAEL,eAAgB;IAC7Bd,IAAI,EAAEA,IAAK;IACXO,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBY,QAAQ,EAAER,YAAa;IACvBS,wBAAwB,EAAE,CAAC/D,WAAW,CAAE;IACxCgE,cAAc,EAAEvD;EAAQ,CAC3B,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DataTableSorting, OnDataTableSortingChange } from "@webiny/admin-ui";
|
|
3
|
+
import type { TableRow } from "../../../../types";
|
|
3
4
|
export interface TableProps<T> {
|
|
4
5
|
data: T[];
|
|
5
6
|
loading?: boolean;
|
|
@@ -8,7 +9,7 @@ export interface TableProps<T> {
|
|
|
8
9
|
onSelectRow?: (rows: T[] | []) => void;
|
|
9
10
|
onSortingChange: OnDataTableSortingChange;
|
|
10
11
|
onToggleRow?: (row: T) => void;
|
|
11
|
-
selected:
|
|
12
|
+
selected: TableRow[];
|
|
12
13
|
sorting: DataTableSorting;
|
|
13
14
|
}
|
|
14
|
-
export declare const Table: <T extends
|
|
15
|
+
export declare const Table: <T extends TableRow<unknown>>({ namespace, ...props }: TableProps<T>) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","Column","ColumnsPresenter","columnsRepositoryFactory","ColumnsVisibilityDecorator","ColumnsVisibilityPresenter","ColumnsVisibilityUpdater","columnsVisibilityRepositoryFactory","ColumnsVisibilityLocalStorageGateway","TablePresenter","TableInner","useAcoConfig","Table","namespace","props","table","columnsRepo","getRepository","columns","map","column","createFromConfig","visibilityRepo","columnsVisibilityLocalStorage","repo","columnsVisibilityUpdater","columnsPresenter","columnsVisibilityPresenter","tablePresenter","init","createElement","Object","assign"],"sources":["Table.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport type {
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","Column","ColumnsPresenter","columnsRepositoryFactory","ColumnsVisibilityDecorator","ColumnsVisibilityPresenter","ColumnsVisibilityUpdater","columnsVisibilityRepositoryFactory","ColumnsVisibilityLocalStorageGateway","TablePresenter","TableInner","useAcoConfig","Table","namespace","props","table","columnsRepo","getRepository","columns","map","column","createFromConfig","visibilityRepo","columnsVisibilityLocalStorage","repo","columnsVisibilityUpdater","columnsPresenter","columnsVisibilityPresenter","tablePresenter","init","createElement","Object","assign"],"sources":["Table.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport type { DataTableSorting, OnDataTableSortingChange } from \"@webiny/admin-ui\";\nimport { Column, ColumnsPresenter, columnsRepositoryFactory } from \"./Columns\";\nimport {\n ColumnsVisibilityDecorator,\n ColumnsVisibilityPresenter,\n ColumnsVisibilityUpdater,\n columnsVisibilityRepositoryFactory\n} from \"./ColumnVisibility\";\nimport { ColumnsVisibilityLocalStorageGateway } from \"./gateways\";\nimport { TablePresenter } from \"./TablePresenter\";\nimport { TableInner } from \"./TableInner\";\nimport { useAcoConfig } from \"~/config\";\nimport type { TableRow } from \"~/types\";\n\nexport interface TableProps<T> {\n data: T[];\n loading?: boolean;\n nameColumnId?: string;\n namespace: string;\n onSelectRow?: (rows: T[] | []) => void;\n onSortingChange: OnDataTableSortingChange;\n onToggleRow?: (row: T) => void;\n selected: TableRow[];\n sorting: DataTableSorting;\n}\n\nexport const Table = <T extends TableRow>({ namespace, ...props }: TableProps<T>) => {\n const { table } = useAcoConfig();\n\n const columnsRepo = useMemo(() => {\n return columnsRepositoryFactory.getRepository(\n namespace,\n table.columns.map(column => Column.createFromConfig(column))\n );\n }, [namespace, table.columns]);\n\n const visibilityRepo = useMemo(() => {\n const columnsVisibilityLocalStorage = new ColumnsVisibilityLocalStorageGateway(namespace);\n\n return columnsVisibilityRepositoryFactory.getRepository(\n namespace,\n columnsVisibilityLocalStorage\n );\n }, [namespace]);\n\n const repo = useMemo(() => {\n return new ColumnsVisibilityDecorator(visibilityRepo, columnsRepo);\n }, [visibilityRepo, columnsRepo]);\n\n const columnsVisibilityUpdater = new ColumnsVisibilityUpdater(visibilityRepo);\n\n const columnsPresenter = useMemo(() => new ColumnsPresenter(repo), [repo]);\n\n const columnsVisibilityPresenter = useMemo(\n () => new ColumnsVisibilityPresenter(columnsPresenter),\n [columnsPresenter]\n );\n\n const tablePresenter = useMemo<TablePresenter>(() => {\n return new TablePresenter();\n }, []);\n\n useEffect(() => {\n columnsPresenter.init();\n }, [columnsPresenter]);\n\n return (\n <TableInner\n {...props}\n columnsPresenter={columnsPresenter}\n columnsVisibilityPresenter={columnsVisibilityPresenter}\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AAM,IAAIE,gBAAgB,CAACsB,IAAI,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EAE1E,MAAMG,0BAA0B,GAAG3B,OAAO,CACtC,MAAM,IAAIK,0BAA0B,CAACqB,gBAAgB,CAAC,EACtD,CAACA,gBAAgB,CACrB,CAAC;EAED,MAAME,cAAc,GAAG5B,OAAO,CAAiB,MAAM;IACjD,OAAO,IAAIS,cAAc,CAAC,CAAC;EAC/B,CAAC,EAAE,EAAE,CAAC;EAENV,SAAS,CAAC,MAAM;IACZ2B,gBAAgB,CAACG,IAAI,CAAC,CAAC;EAC3B,CAAC,EAAE,CAACH,gBAAgB,CAAC,CAAC;EAEtB,oBACI5B,KAAA,CAAAgC,aAAA,CAACpB,UAAU,EAAAqB,MAAA,CAAAC,MAAA,KACHlB,KAAK;IACTY,gBAAgB,EAAEA,gBAAiB;IACnCC,0BAA0B,EAAEA,0BAA2B;IACvDC,cAAc,EAAEA,cAAe;IAC/BH,wBAAwB,EAAEA;EAAyB,EACtD,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -4,7 +4,8 @@ import { type DataTableDefaultData, type DataTableSorting } from "@webiny/admin-
|
|
|
4
4
|
import type { ColumnsPresenter } from "./Columns";
|
|
5
5
|
import type { ColumnsVisibilityPresenter, ColumnsVisibilityUpdater } from "./ColumnVisibility";
|
|
6
6
|
import type { TablePresenter } from "./TablePresenter";
|
|
7
|
-
|
|
7
|
+
import type { TableRow } from "../../../../types";
|
|
8
|
+
export interface TableInnerProps<T extends TableRow> {
|
|
8
9
|
columnsPresenter: ColumnsPresenter;
|
|
9
10
|
columnsVisibilityPresenter: ColumnsVisibilityPresenter;
|
|
10
11
|
columnsVisibilityUpdater: ColumnsVisibilityUpdater;
|
|
@@ -18,6 +19,6 @@ export interface TableInnerProps<T> {
|
|
|
18
19
|
sorting: DataTableSorting;
|
|
19
20
|
tablePresenter: TablePresenter;
|
|
20
21
|
}
|
|
21
|
-
export declare const TableInner: (<T extends
|
|
22
|
+
export declare const TableInner: (<T extends TableRow<unknown>>(props: TableInnerProps<T>) => React.JSX.Element) & {
|
|
22
23
|
displayName: string;
|
|
23
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","observer","DataTable","ColumnMapper","TableRowProvider","TableInner","props","cellRenderer","row","cell","createElement","columns","columnsPresenter","vm","reduce","result","column","nameColumnId","name","defaultName","toDataTable","columnVisibility","columnsVisibilityPresenter","columnsVisibility","onColumnVisibilityChange","columnsVisibilityUpdater","update","data","initialSorting","tablePresenter","isRowSelectable","original","$selectable","loading","onSelectRow","onSortingChange","onToggleRow","selectedRows","filter","selected","find","item","id","sorting","stickyHeader"],"sources":["TableInner.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport type { OnDataTableSortingChange } from \"@webiny/admin-ui\";\nimport {\n DataTable,\n type DataTableColumns,\n type DataTableDefaultData,\n type DataTableSorting\n} from \"@webiny/admin-ui\";\nimport type { ColumnsPresenter } from \"./Columns\";\nimport { ColumnMapper } from \"./Columns\";\nimport type { ColumnsVisibilityPresenter, ColumnsVisibilityUpdater } from \"./ColumnVisibility\";\nimport type { TablePresenter } from \"./TablePresenter\";\nimport { TableRowProvider } from \"~/components\";\n\nexport interface TableInnerProps<T> {\n columnsPresenter: ColumnsPresenter;\n columnsVisibilityPresenter: ColumnsVisibilityPresenter;\n columnsVisibilityUpdater: ColumnsVisibilityUpdater;\n data: T[];\n loading?: boolean;\n nameColumnId?: string;\n onSelectRow?: (rows: T[] | []) => void;\n onSortingChange: OnDataTableSortingChange;\n onToggleRow?: (row: T) => void;\n selected: DataTableDefaultData[];\n sorting: DataTableSorting;\n tablePresenter: TablePresenter;\n}\n\nexport const TableInner = observer(
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","observer","DataTable","ColumnMapper","TableRowProvider","TableInner","props","cellRenderer","row","cell","createElement","columns","columnsPresenter","vm","reduce","result","column","nameColumnId","name","defaultName","toDataTable","columnVisibility","columnsVisibilityPresenter","columnsVisibility","onColumnVisibilityChange","columnsVisibilityUpdater","update","data","initialSorting","tablePresenter","isRowSelectable","original","$selectable","loading","onSelectRow","onSortingChange","onToggleRow","selectedRows","filter","selected","find","item","id","sorting","stickyHeader"],"sources":["TableInner.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport type { OnDataTableSortingChange } from \"@webiny/admin-ui\";\nimport {\n DataTable,\n type DataTableColumns,\n type DataTableDefaultData,\n type DataTableSorting\n} from \"@webiny/admin-ui\";\nimport type { ColumnsPresenter } from \"./Columns\";\nimport { ColumnMapper } from \"./Columns\";\nimport type { ColumnsVisibilityPresenter, ColumnsVisibilityUpdater } from \"./ColumnVisibility\";\nimport type { TablePresenter } from \"./TablePresenter\";\nimport { TableRowProvider } from \"~/components\";\nimport type { TableRow } from \"~/types\";\n\nexport interface TableInnerProps<T extends TableRow> {\n columnsPresenter: ColumnsPresenter;\n columnsVisibilityPresenter: ColumnsVisibilityPresenter;\n columnsVisibilityUpdater: ColumnsVisibilityUpdater;\n data: T[];\n loading?: boolean;\n nameColumnId?: string;\n onSelectRow?: (rows: T[] | []) => void;\n onSortingChange: OnDataTableSortingChange;\n onToggleRow?: (row: T) => void;\n selected: DataTableDefaultData[];\n sorting: DataTableSorting;\n tablePresenter: TablePresenter;\n}\n\nexport const TableInner = observer(<T extends TableRow>(props: TableInnerProps<T>) => {\n const cellRenderer = useCallback(\n (row: T, cell: string | React.ReactElement): string | number | JSX.Element | null => {\n if (typeof cell === \"string\") {\n return cell;\n }\n\n return <TableRowProvider row={row}>{cell}</TableRowProvider>;\n },\n []\n );\n\n const columns = useMemo(() => {\n return props.columnsPresenter.vm.columns.reduce((result, column) => {\n const { nameColumnId = \"name\" } = props;\n const { name: defaultName } = column;\n\n // Determine the column name, using the provided `nameColumnId` if the default is 'name'\n const name = defaultName === \"name\" ? nameColumnId : defaultName;\n\n result[name as keyof DataTableColumns<T>] = ColumnMapper.toDataTable(\n column,\n cellRenderer\n );\n\n return result;\n }, {} as DataTableColumns<T>);\n }, [props.columnsPresenter.vm.columns]);\n\n return (\n <DataTable\n columns={columns}\n columnVisibility={props.columnsVisibilityPresenter.vm.columnsVisibility}\n onColumnVisibilityChange={props.columnsVisibilityUpdater.update}\n data={props.data}\n initialSorting={props.tablePresenter.vm.initialSorting}\n isRowSelectable={row => row.original.$selectable ?? false}\n loading={props.loading}\n onSelectRow={props.onSelectRow}\n onSortingChange={props.onSortingChange}\n onToggleRow={props.onToggleRow}\n selectedRows={props.data.filter(row => props.selected.find(item => row.id === item.id))}\n sorting={props.sorting}\n stickyHeader={true}\n />\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SACIC,SAAS,QAIN,kBAAkB;AAEzB,SAASC,YAAY;AAGrB,SAASC,gBAAgB;AAkBzB,OAAO,MAAMC,UAAU,GAAGJ,QAAQ,CAAsBK,KAAyB,IAAK;EAClF,MAAMC,YAAY,GAAGR,WAAW,CAC5B,CAACS,GAAM,EAAEC,IAAiC,KAA2C;IACjF,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MAC1B,OAAOA,IAAI;IACf;IAEA,oBAAOX,KAAA,CAAAY,aAAA,CAACN,gBAAgB;MAACI,GAAG,EAAEA;IAAI,GAAEC,IAAuB,CAAC;EAChE,CAAC,EACD,EACJ,CAAC;EAED,MAAME,OAAO,GAAGX,OAAO,CAAC,MAAM;IAC1B,OAAOM,KAAK,CAACM,gBAAgB,CAACC,EAAE,CAACF,OAAO,CAACG,MAAM,CAAC,CAACC,MAAM,EAAEC,MAAM,KAAK;MAChE,MAAM;QAAEC,YAAY,GAAG;MAAO,CAAC,GAAGX,KAAK;MACvC,MAAM;QAAEY,IAAI,EAAEC;MAAY,CAAC,GAAGH,MAAM;;MAEpC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"../../table.types";
|
|
2
2
|
import type { FolderItem } from "../../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
3
|
+
export declare const createRecordsData: <T extends {
|
|
4
|
+
id: string;
|
|
5
|
+
}>(items: T[]) => RecordTableRow<T>[];
|
|
6
|
+
export declare const createFoldersData: (items: FolderItem[]) => FolderTableRow[];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export const createRecordsData = items => {
|
|
2
|
-
return items.map(item => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
2
|
+
return items.map(item => ({
|
|
3
|
+
id: item.id,
|
|
4
|
+
$type: "RECORD",
|
|
5
|
+
$selectable: true,
|
|
6
|
+
data: item
|
|
7
|
+
}));
|
|
9
8
|
};
|
|
10
9
|
export const createFoldersData = items => {
|
|
11
10
|
return items.map(item => ({
|
|
11
|
+
id: item.id,
|
|
12
12
|
$type: "FOLDER",
|
|
13
13
|
$selectable: false,
|
|
14
|
-
|
|
14
|
+
data: item
|
|
15
15
|
}));
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createRecordsData","items","map","item","$type","$selectable","createFoldersData"],"sources":["createTableData.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":["createRecordsData","items","map","item","id","$type","$selectable","data","createFoldersData"],"sources":["createTableData.ts"],"sourcesContent":["import type { FolderTableRow, RecordTableRow } from \"~/table.types\";\nimport type { FolderItem } from \"~/types\";\n\nexport const createRecordsData = <T extends { id: string }>(items: T[]): RecordTableRow<T>[] => {\n return items.map(item => ({\n id: item.id,\n $type: \"RECORD\",\n $selectable: true,\n data: item\n }));\n};\n\nexport const createFoldersData = (items: FolderItem[]): FolderTableRow[] => {\n return items.map(item => ({\n id: item.id,\n $type: \"FOLDER\",\n $selectable: false,\n data: item\n }));\n};\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,GAA8BC,KAAU,IAA0B;EAC5F,OAAOA,KAAK,CAACC,GAAG,CAACC,IAAI,KAAK;IACtBC,EAAE,EAAED,IAAI,CAACC,EAAE;IACXC,KAAK,EAAE,QAAQ;IACfC,WAAW,EAAE,IAAI;IACjBC,IAAI,EAAEJ;EACV,CAAC,CAAC,CAAC;AACP,CAAC;AAED,OAAO,MAAMK,iBAAiB,GAAIP,KAAmB,IAAuB;EACxE,OAAOA,KAAK,CAACC,GAAG,CAACC,IAAI,KAAK;IACtBC,EAAE,EAAED,IAAI,CAACC,EAAE;IACXC,KAAK,EAAE,QAAQ;IACfC,WAAW,EAAE,KAAK;IAClBC,IAAI,EAAEJ;EACV,CAAC,CAAC,CAAC;AACP,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Context, ReactNode } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import type { DataTableDefaultData } from "@webiny/admin-ui";
|
|
4
3
|
export interface TableRowContextData<T> {
|
|
5
4
|
row: T;
|
|
6
5
|
}
|
|
@@ -10,5 +9,10 @@ interface TableRowProviderProps<T> {
|
|
|
10
9
|
children: ReactNode;
|
|
11
10
|
}
|
|
12
11
|
export declare const TableRowProvider: <T>({ row, children }: TableRowProviderProps<T>) => React.JSX.Element | null;
|
|
13
|
-
export declare const createUseTableRow: <TBaseRow = Record<string, any>>() =>
|
|
12
|
+
export declare const createUseTableRow: <TBaseRow = Record<string, any>>() => {
|
|
13
|
+
(): TableRowContextData<TBaseRow>;
|
|
14
|
+
<TUserRow>(): TableRowContextData<TBaseRow & {
|
|
15
|
+
data: TUserRow;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
14
18
|
export {};
|
|
@@ -15,13 +15,20 @@ export const TableRowProvider = ({
|
|
|
15
15
|
}, children);
|
|
16
16
|
};
|
|
17
17
|
export const createUseTableRow = () => {
|
|
18
|
-
|
|
18
|
+
// function useTableRow(): TableRowContextData<TBaseRow>;
|
|
19
|
+
// ➜ Handles calls with no generic.
|
|
20
|
+
|
|
21
|
+
// function useTableRow<TUserRow>(): TableRowContextData<TBaseRow & { data: TUserRow }>;
|
|
22
|
+
// ➜ Handles calls with a generic.
|
|
23
|
+
|
|
24
|
+
function useTableRow() {
|
|
19
25
|
const context = useContext(TableRowContext);
|
|
20
26
|
if (!context) {
|
|
21
|
-
throw Error(`TableRowContext is missing in the component tree. Are you using "useTableRow()" hook in the right place?`);
|
|
27
|
+
throw new Error(`TableRowContext is missing in the component tree. Are you using "useTableRow()" hook in the right place?`);
|
|
22
28
|
}
|
|
23
29
|
return context;
|
|
24
|
-
}
|
|
30
|
+
}
|
|
31
|
+
return useTableRow;
|
|
25
32
|
};
|
|
26
33
|
|
|
27
34
|
//# sourceMappingURL=useTableRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","TableRowContext","undefined","TableRowProvider","row","children","value","createElement","Provider","createUseTableRow","context","Error"],"sources":["useTableRow.tsx"],"sourcesContent":["import type { Context, ReactNode } from \"react\";\nimport React, { createContext, useContext } from \"react\";\
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","TableRowContext","undefined","TableRowProvider","row","children","value","createElement","Provider","createUseTableRow","useTableRow","context","Error"],"sources":["useTableRow.tsx"],"sourcesContent":["import type { Context, ReactNode } from \"react\";\nimport React, { createContext, useContext } from \"react\";\n\nexport interface TableRowContextData<T> {\n row: T;\n}\n\nexport const TableRowContext = createContext<TableRowContextData<any> | undefined>(undefined);\n\ninterface TableRowProviderProps<T> {\n row: T | undefined;\n children: ReactNode;\n}\n\nexport const TableRowProvider = <T,>({ row, children }: TableRowProviderProps<T>) => {\n if (!row) {\n return null;\n }\n\n const value: TableRowContextData<T> = { row };\n\n return <TableRowContext.Provider value={value}>{children}</TableRowContext.Provider>;\n};\n\nexport const createUseTableRow = <TBaseRow = Record<string, any>,>() => {\n function useTableRow(): TableRowContextData<TBaseRow>;\n\n // \tfunction useTableRow(): TableRowContextData<TBaseRow>;\n // ➜ Handles calls with no generic.\n\n // \tfunction useTableRow<TUserRow>(): TableRowContextData<TBaseRow & { data: TUserRow }>;\n // ➜ Handles calls with a generic.\n\n function useTableRow<TUserRow>(): TableRowContextData<TBaseRow & { data: TUserRow }>;\n\n function useTableRow<TUserRow = never>(): TableRowContextData<\n TUserRow extends never ? TBaseRow : TBaseRow & { data: TUserRow }\n > {\n type Combined = TUserRow extends never ? TBaseRow : TBaseRow & { data: TUserRow };\n\n const context = useContext<TableRowContextData<Combined>>(\n TableRowContext as unknown as Context<TableRowContextData<Combined>>\n );\n\n if (!context) {\n throw new Error(\n `TableRowContext is missing in the component tree. Are you using \"useTableRow()\" hook in the right place?`\n );\n }\n\n return context;\n }\n\n return useTableRow;\n};\n"],"mappings":"AACA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAMxD,OAAO,MAAMC,eAAe,gBAAGF,aAAa,CAAuCG,SAAS,CAAC;AAO7F,OAAO,MAAMC,gBAAgB,GAAGA,CAAK;EAAEC,GAAG;EAAEC;AAAmC,CAAC,KAAK;EACjF,IAAI,CAACD,GAAG,EAAE;IACN,OAAO,IAAI;EACf;EAEA,MAAME,KAA6B,GAAG;IAAEF;EAAI,CAAC;EAE7C,oBAAON,KAAA,CAAAS,aAAA,CAACN,eAAe,CAACO,QAAQ;IAACF,KAAK,EAAEA;EAAM,GAAED,QAAmC,CAAC;AACxF,CAAC;AAED,OAAO,MAAMI,iBAAiB,GAAGA,CAAA,KAAuC;EAGpE;EACA;;EAEA;EACA;;EAIA,SAASC,WAAWA,CAAA,EAElB;IAGE,MAAMC,OAAO,GAAGX,UAAU,CACtBC,eACJ,CAAC;IAED,IAAI,CAACU,OAAO,EAAE;MACV,MAAM,IAAIC,KAAK,CACX,0GACJ,CAAC;IACL;IAEA,OAAOD,OAAO;EAClB;EAEA,OAAOD,WAAW;AACtB,CAAC","ignoreList":[]}
|
package/config/AcoConfig.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export { FieldRendererConfig as AdvancedSearchFieldRendererConfig } from "./advanced-search/FieldRenderer";
|
|
3
|
-
export { ActionConfig as RecordActionConfig } from "./record/Action";
|
|
4
|
-
export { ActionConfig as FolderActionConfig } from "./folder/Action";
|
|
5
|
-
export { ColumnConfig as TableColumnConfig } from "./table/Column";
|
|
6
|
-
export { SortingConfig as TableSortingConfig } from "./table/Sorting";
|
|
2
|
+
export type { FieldRendererConfig as AdvancedSearchFieldRendererConfig } from "./advanced-search/FieldRenderer";
|
|
3
|
+
export type { ActionConfig as RecordActionConfig } from "./record/Action";
|
|
4
|
+
export type { ActionConfig as FolderActionConfig } from "./folder/Action";
|
|
5
|
+
export type { ColumnConfig as TableColumnConfig } from "./table/Column";
|
|
6
|
+
export type { SortingConfig as TableSortingConfig } from "./table/Sorting";
|
|
7
7
|
export declare const AcoConfig: (({ priority, children }: import("@webiny/react-properties").ConfigProps) => import("react").JSX.Element) & {
|
|
8
8
|
AdvancedSearch: {
|
|
9
9
|
FieldRenderer: (({ name, type, element }: import("./advanced-search/FieldRenderer").FieldRendererProps) => import("react").JSX.Element) & {
|
|
@@ -24,8 +24,13 @@ export declare const AcoConfig: (({ priority, children }: import("@webiny/react-
|
|
|
24
24
|
};
|
|
25
25
|
Table: {
|
|
26
26
|
Column: import("react").FC<import("./table/Column").ColumnProps> & {
|
|
27
|
-
isFolderRow: (row: import("
|
|
28
|
-
createUseTableRow: <TBaseRow = Record<string, any>>() =>
|
|
27
|
+
isFolderRow: (row: import("..").TableRow<unknown>) => row is import("..").FolderTableRow;
|
|
28
|
+
createUseTableRow: <TBaseRow = Record<string, any>>() => {
|
|
29
|
+
(): import("..").TableRowContextData<TBaseRow>;
|
|
30
|
+
<TUserRow>(): import("..").TableRowContextData<TBaseRow & {
|
|
31
|
+
data: TUserRow;
|
|
32
|
+
}>;
|
|
33
|
+
};
|
|
29
34
|
};
|
|
30
35
|
Sorting: ({ name, field, order }: import("./table/Sorting").SortingProps) => import("react").JSX.Element;
|
|
31
36
|
};
|
package/config/AcoConfig.js
CHANGED
|
@@ -4,11 +4,6 @@ import { AdvancedSearch } from "./advanced-search";
|
|
|
4
4
|
import { Record } from "./record";
|
|
5
5
|
import { Folder } from "./folder";
|
|
6
6
|
import { Table } from "./table";
|
|
7
|
-
export { FieldRendererConfig as AdvancedSearchFieldRendererConfig } from "./advanced-search/FieldRenderer";
|
|
8
|
-
export { ActionConfig as RecordActionConfig } from "./record/Action";
|
|
9
|
-
export { ActionConfig as FolderActionConfig } from "./folder/Action";
|
|
10
|
-
export { ColumnConfig as TableColumnConfig } from "./table/Column";
|
|
11
|
-
export { SortingConfig as TableSortingConfig } from "./table/Sorting";
|
|
12
7
|
const base = createConfigurableComponent("AcoConfig");
|
|
13
8
|
export const AcoConfig = Object.assign(base.Config, {
|
|
14
9
|
AdvancedSearch,
|
package/config/AcoConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","createConfigurableComponent","AdvancedSearch","Record","Folder","Table","
|
|
1
|
+
{"version":3,"names":["useMemo","createConfigurableComponent","AdvancedSearch","Record","Folder","Table","base","AcoConfig","Object","assign","Config","AcoWithConfig","WithConfig","useAcoConfig","config","useConfig","advancedSearch","folder","record","table","fieldRenderers","actions","columns","sorting"],"sources":["AcoConfig.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { createConfigurableComponent } from \"@webiny/react-properties\";\nimport type { AdvancedSearchConfig } from \"./advanced-search\";\nimport { AdvancedSearch } from \"./advanced-search\";\nimport type { RecordConfig } from \"./record\";\nimport { Record } from \"./record\";\nimport type { FolderConfig } from \"./folder\";\nimport { Folder } from \"./folder\";\nimport type { TableConfig } from \"~/config/table\";\nimport { Table } from \"~/config/table\";\n\nexport type { FieldRendererConfig as AdvancedSearchFieldRendererConfig } from \"./advanced-search/FieldRenderer\";\nexport type { ActionConfig as RecordActionConfig } from \"./record/Action\";\nexport type { ActionConfig as FolderActionConfig } from \"./folder/Action\";\nexport type { ColumnConfig as TableColumnConfig } from \"./table/Column\";\nexport type { SortingConfig as TableSortingConfig } from \"./table/Sorting\";\n\nconst base = createConfigurableComponent<AcoConfig>(\"AcoConfig\");\n\nexport const AcoConfig = Object.assign(base.Config, { AdvancedSearch, Folder, Record, Table });\nexport const AcoWithConfig = base.WithConfig;\n\ninterface AcoConfig {\n advancedSearch: AdvancedSearchConfig;\n record: RecordConfig;\n folder: FolderConfig;\n table: TableConfig;\n}\n\nexport function useAcoConfig() {\n const config = base.useConfig();\n\n const advancedSearch = config.advancedSearch || {};\n const folder = config.folder || {};\n const record = config.record || {};\n const table = config.table || {};\n\n return useMemo(\n () => ({\n advancedSearch: {\n ...advancedSearch,\n fieldRenderers: [...(advancedSearch.fieldRenderers || [])]\n },\n folder: {\n ...folder,\n actions: [...(folder.actions || [])]\n },\n record: {\n ...record,\n actions: [...(record.actions || [])]\n },\n table: {\n ...table,\n columns: [...(table.columns || [])],\n sorting: [...(table.sorting || [])]\n }\n }),\n [config]\n );\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,2BAA2B,QAAQ,0BAA0B;AAEtE,SAASC,cAAc;AAEvB,SAASC,MAAM;AAEf,SAASC,MAAM;AAEf,SAASC,KAAK;AAQd,MAAMC,IAAI,GAAGL,2BAA2B,CAAY,WAAW,CAAC;AAEhE,OAAO,MAAMM,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACH,IAAI,CAACI,MAAM,EAAE;EAAER,cAAc;EAAEE,MAAM;EAAED,MAAM;EAAEE;AAAM,CAAC,CAAC;AAC9F,OAAO,MAAMM,aAAa,GAAGL,IAAI,CAACM,UAAU;AAS5C,OAAO,SAASC,YAAYA,CAAA,EAAG;EAC3B,MAAMC,MAAM,GAAGR,IAAI,CAACS,SAAS,CAAC,CAAC;EAE/B,MAAMC,cAAc,GAAGF,MAAM,CAACE,cAAc,IAAI,CAAC,CAAC;EAClD,MAAMC,MAAM,GAAGH,MAAM,CAACG,MAAM,IAAI,CAAC,CAAC;EAClC,MAAMC,MAAM,GAAGJ,MAAM,CAACI,MAAM,IAAI,CAAC,CAAC;EAClC,MAAMC,KAAK,GAAGL,MAAM,CAACK,KAAK,IAAI,CAAC,CAAC;EAEhC,OAAOnB,OAAO,CACV,OAAO;IACHgB,cAAc,EAAE;MACZ,GAAGA,cAAc;MACjBI,cAAc,EAAE,CAAC,IAAIJ,cAAc,CAACI,cAAc,IAAI,EAAE,CAAC;IAC7D,CAAC;IACDH,MAAM,EAAE;MACJ,GAAGA,MAAM;MACTI,OAAO,EAAE,CAAC,IAAIJ,MAAM,CAACI,OAAO,IAAI,EAAE,CAAC;IACvC,CAAC;IACDH,MAAM,EAAE;MACJ,GAAGA,MAAM;MACTG,OAAO,EAAE,CAAC,IAAIH,MAAM,CAACG,OAAO,IAAI,EAAE,CAAC;IACvC,CAAC;IACDF,KAAK,EAAE;MACH,GAAGA,KAAK;MACRG,OAAO,EAAE,CAAC,IAAIH,KAAK,CAACG,OAAO,IAAI,EAAE,CAAC,CAAC;MACnCC,OAAO,EAAE,CAAC,IAAIJ,KAAK,CAACI,OAAO,IAAI,EAAE,CAAC;IACtC;EACJ,CAAC,CAAC,EACF,CAACT,MAAM,CACX,CAAC;AACL","ignoreList":[]}
|
package/config/table/Column.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import type {
|
|
3
|
+
import type { FolderTableRow, TableRow } from "../../table.types";
|
|
4
4
|
export interface ColumnConfig {
|
|
5
5
|
cell: string | ReactElement;
|
|
6
6
|
className: string;
|
|
@@ -27,6 +27,11 @@ export interface ColumnProps {
|
|
|
27
27
|
visible?: boolean;
|
|
28
28
|
}
|
|
29
29
|
export declare const Column: React.FC<ColumnProps> & {
|
|
30
|
-
isFolderRow: (row:
|
|
31
|
-
createUseTableRow: <TBaseRow = Record<string, any>>() =>
|
|
30
|
+
isFolderRow: (row: TableRow) => row is FolderTableRow;
|
|
31
|
+
createUseTableRow: <TBaseRow = Record<string, any>>() => {
|
|
32
|
+
(): import("../../components/Table/useTableRow").TableRowContextData<TBaseRow>;
|
|
33
|
+
<TUserRow>(): import("../../components/Table/useTableRow").TableRowContextData<TBaseRow & {
|
|
34
|
+
data: TUserRow;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
32
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Property","useIdGenerator","createUseTableRow","BaseColumn","after","undefined","before","cell","className","header","hideable","name","remove","resizable","size","sortable","visible","getId","placeAfter","placeBefore","createElement","id","array","value","isFolderRow","row","$type","Column","Object","assign"],"sources":["Column.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport React from \"react\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { createUseTableRow } from \"~/components/Table/useTableRow\";\nimport type {
|
|
1
|
+
{"version":3,"names":["React","Property","useIdGenerator","createUseTableRow","BaseColumn","after","undefined","before","cell","className","header","hideable","name","remove","resizable","size","sortable","visible","getId","placeAfter","placeBefore","createElement","id","array","value","isFolderRow","row","$type","Column","Object","assign"],"sources":["Column.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport React from \"react\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { createUseTableRow } from \"~/components/Table/useTableRow\";\nimport type { FolderTableRow, TableRow } from \"~/table.types\";\n\nexport interface ColumnConfig {\n cell: string | ReactElement;\n className: string;\n header: string | ReactElement;\n hideable: boolean;\n name: string;\n resizable: boolean;\n size: number;\n sortable: boolean;\n visible: boolean;\n}\n\nexport interface ColumnProps {\n after?: string;\n before?: string;\n cell?: string | ReactElement;\n className?: string;\n header?: string | ReactElement;\n hideable?: boolean;\n name: string;\n remove?: boolean;\n resizable?: boolean;\n size?: number;\n sortable?: boolean;\n visible?: boolean;\n}\n\nconst BaseColumn: React.FC<ColumnProps> = ({\n after = undefined,\n before = undefined,\n cell,\n className = undefined,\n header = undefined,\n hideable = true,\n name,\n remove = false,\n resizable = true,\n size = 100,\n sortable = false,\n visible = true\n}) => {\n const getId = useIdGenerator(\"tableColumn\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property id=\"table\" name={\"table\"}>\n <Property\n id={getId(name)}\n name={\"columns\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"name\")} name={\"name\"} value={name} />\n <Property id={getId(name, \"sortable\")} name={\"sortable\"} value={sortable} />\n <Property id={getId(name, \"resizable\")} name={\"resizable\"} value={resizable} />\n <Property id={getId(name, \"hideable\")} name={\"hideable\"} value={hideable} />\n <Property id={getId(name, \"size\")} name={\"size\"} value={size} />\n <Property id={getId(name, \"visible\")} name={\"visible\"} value={visible} />\n {header ? (\n <Property id={getId(name, \"header\")} name={\"header\"} value={header} />\n ) : null}\n {cell ? <Property id={getId(name, \"cell\")} name={\"cell\"} value={cell} /> : null}\n {className ? (\n <Property id={getId(name, \"className\")} name={\"className\"} value={className} />\n ) : null}\n </Property>\n </Property>\n );\n};\n\nconst isFolderRow = (row: TableRow): row is FolderTableRow => {\n return row.$type === \"FOLDER\";\n};\n\nexport const Column = Object.assign(BaseColumn, { isFolderRow, createUseTableRow });\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,cAAc,QAAQ,0BAA0B;AACnE,SAASC,iBAAiB;AA8B1B,MAAMC,UAAiC,GAAGA,CAAC;EACvCC,KAAK,GAAGC,SAAS;EACjBC,MAAM,GAAGD,SAAS;EAClBE,IAAI;EACJC,SAAS,GAAGH,SAAS;EACrBI,MAAM,GAAGJ,SAAS;EAClBK,QAAQ,GAAG,IAAI;EACfC,IAAI;EACJC,MAAM,GAAG,KAAK;EACdC,SAAS,GAAG,IAAI;EAChBC,IAAI,GA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Config {
|
|
|
7
7
|
}
|
|
8
8
|
export declare const Table: {
|
|
9
9
|
Column: import("react").FC<import("./Column").ColumnProps> & {
|
|
10
|
-
isFolderRow: (row: import("
|
|
11
|
-
createUseTableRow: <TBaseRow = Record<string, any>>() =>
|
|
10
|
+
isFolderRow: (row: import("../..").TableRow<unknown>) => row is import("../..").FolderTableRow;
|
|
11
|
+
createUseTableRow: <TBaseRow = Record<string, any>>() => {
|
|
12
|
+
(): import("../..").TableRowContextData<TBaseRow>;
|
|
13
|
+
<TUserRow>(): import("../..").TableRowContextData<TBaseRow & {
|
|
14
|
+
data: TUserRow;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
12
17
|
};
|
|
13
18
|
Sorting: ({ name, field, order }: import("./Sorting").SortingProps) => import("react").JSX.Element;
|
|
14
19
|
};
|
package/contexts/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AcoAppProvider as AcoProvider, AcoAppProviderProps } from "./app";
|
|
1
|
+
export { AcoAppProvider as AcoProvider, type AcoAppProviderProps } from "./app";
|
|
2
2
|
export * from "./folder";
|
package/contexts/index.js
CHANGED
package/contexts/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AcoAppProvider","AcoProvider"
|
|
1
|
+
{"version":3,"names":["AcoAppProvider","AcoProvider"],"sources":["index.tsx"],"sourcesContent":["export { AcoAppProvider as AcoProvider, type AcoAppProviderProps } from \"~/contexts/app\";\nexport * from \"./folder\";\n"],"mappings":"AAAA,SAASA,cAAc,IAAIC,WAAW;AACtC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["FolderDto.ts"],"sourcesContent":["import type { FolderPermission } from \"@webiny/shared-aco/flp/flp.types.js\";\n\nexport interface FolderDto {\n id: string;\n title: string;\n slug: string;\n permissions: FolderPermission[];\n type: string;\n parentId: string | null;\n}\n"],"mappings":"","ignoreList":[]}
|