@webiny/app-aco 6.4.5 → 6.6.0-alpha.0

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.
Files changed (170) hide show
  1. package/components/Actions/DeleteFolder/DeleteFolder.js +1 -1
  2. package/components/Actions/DeleteFolder/DeleteFolder.js.map +1 -1
  3. package/components/AdvancedSearch/domain/Filter.d.ts +1 -1
  4. package/components/AdvancedSearch/domain/FilterRepositoryFactory.d.ts +2 -2
  5. package/components/AdvancedSearch/domain/FilterRepositoryFactory.js.map +1 -1
  6. package/components/AdvancedSearch/gateways/FiltersGraphQLGateway.d.ts +2 -2
  7. package/components/AdvancedSearch/gateways/FiltersGraphQLGateway.js +9 -10
  8. package/components/AdvancedSearch/gateways/FiltersGraphQLGateway.js.map +1 -1
  9. package/components/AdvancedSearch/gateways/filters.gql.d.ts +5 -5
  10. package/components/AdvancedSearch/gateways/filters.gql.js +5 -6
  11. package/components/AdvancedSearch/gateways/filters.gql.js.map +1 -1
  12. package/components/AdvancedSearch/useFilterRepository.js +7 -2
  13. package/components/AdvancedSearch/useFilterRepository.js.map +1 -1
  14. package/components/Table/cells/CellAuthor.d.ts +2 -0
  15. package/components/Table/cells/CellAuthor.js +10 -0
  16. package/components/Table/cells/CellAuthor.js.map +1 -0
  17. package/components/Table/cells/CellCreated.d.ts +2 -0
  18. package/components/Table/cells/CellCreated.js +13 -0
  19. package/components/Table/cells/CellCreated.js.map +1 -0
  20. package/components/Table/cells/CellModified.d.ts +2 -0
  21. package/components/Table/cells/CellModified.js +13 -0
  22. package/components/Table/cells/CellModified.js.map +1 -0
  23. package/components/Table/cells/index.d.ts +3 -0
  24. package/components/Table/cells/index.js +3 -0
  25. package/components/Table/createTableData.d.ts +7 -5
  26. package/components/Table/createTableData.js +22 -7
  27. package/components/Table/createTableData.js.map +1 -1
  28. package/components/Table/index.d.ts +2 -2
  29. package/components/Table/index.js +2 -2
  30. package/components/index.d.ts +0 -1
  31. package/components/index.js +0 -1
  32. package/config/AcoConfig.d.ts +8 -12
  33. package/config/advanced-search/FieldRenderer.d.ts +3 -1
  34. package/config/folder/Action.d.ts +1 -1
  35. package/config/folder/index.d.ts +3 -2
  36. package/config/index.d.ts +0 -1
  37. package/config/index.js +0 -1
  38. package/config/record/Action.d.ts +1 -1
  39. package/config/record/index.d.ts +1 -1
  40. package/config/table/Column.d.ts +8 -39
  41. package/config/table/Column.js +4 -67
  42. package/config/table/Column.js.map +1 -1
  43. package/config/table/Sorting.d.ts +2 -11
  44. package/config/table/Sorting.js +1 -28
  45. package/config/table/index.d.ts +5 -9
  46. package/contexts/index.d.ts +0 -3
  47. package/contexts/index.js +0 -3
  48. package/dialogs/DialogSetPermissions/graphql.d.ts +1 -1
  49. package/dialogs/DialogSetPermissions/graphql.js +1 -2
  50. package/dialogs/DialogSetPermissions/graphql.js.map +1 -1
  51. package/dialogs/useCreateDialog.js +2 -2
  52. package/dialogs/useCreateDialog.js.map +1 -1
  53. package/dialogs/useEditDialog.js +2 -2
  54. package/dialogs/useEditDialog.js.map +1 -1
  55. package/dialogs/useSetPermissionsDialog.js +16 -4
  56. package/dialogs/useSetPermissionsDialog.js.map +1 -1
  57. package/domain/folder/Folder.d.ts +2 -1
  58. package/domain/folder/Folder.js.map +1 -1
  59. package/features/folders/createFolder/CreateFolderGqlGateway.d.ts +3 -3
  60. package/features/folders/createFolder/CreateFolderGqlGateway.js +15 -16
  61. package/features/folders/createFolder/CreateFolderGqlGateway.js.map +1 -1
  62. package/features/folders/deleteFolder/DeleteFolderGqlGateway.d.ts +3 -3
  63. package/features/folders/deleteFolder/DeleteFolderGqlGateway.js +5 -6
  64. package/features/folders/deleteFolder/DeleteFolderGqlGateway.js.map +1 -1
  65. package/features/folders/folderModelProvider/FolderModelProvider.js +29 -31
  66. package/features/folders/folderModelProvider/FolderModelProvider.js.map +1 -1
  67. package/features/folders/folderModelProvider/GetFolderModelGqlGateway.d.ts +3 -3
  68. package/features/folders/folderModelProvider/GetFolderModelGqlGateway.js +5 -7
  69. package/features/folders/folderModelProvider/GetFolderModelGqlGateway.js.map +1 -1
  70. package/features/folders/getFolder/GetFolderGqlGateway.d.ts +3 -3
  71. package/features/folders/getFolder/GetFolderGqlGateway.js +5 -7
  72. package/features/folders/getFolder/GetFolderGqlGateway.js.map +1 -1
  73. package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCase.d.ts +3 -3
  74. package/features/folders/getFolderExtensionsFields/useFolderExtensionsFields.d.ts +3 -3
  75. package/features/folders/listFolders/ListFoldersGqlGateway.d.ts +1 -1
  76. package/features/folders/listFolders/ListFoldersGqlGateway.js +1 -2
  77. package/features/folders/listFolders/ListFoldersGqlGateway.js.map +1 -1
  78. package/features/folders/listFolders/useListFolders.d.ts +1 -1
  79. package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsGqlGateway.d.ts +3 -3
  80. package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsGqlGateway.js +5 -7
  81. package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsGqlGateway.js.map +1 -1
  82. package/features/folders/listFoldersByParentIds/useListFoldersByParentIds.d.ts +2 -2
  83. package/features/folders/loadFolderHierarchy/useLoadFolderHierarchy.d.ts +2 -2
  84. package/features/folders/updateFolder/UpdateFolderGqlGateway.d.ts +3 -3
  85. package/features/folders/updateFolder/UpdateFolderGqlGateway.js +5 -6
  86. package/features/folders/updateFolder/UpdateFolderGqlGateway.js.map +1 -1
  87. package/hooks/index.d.ts +0 -6
  88. package/hooks/index.js +0 -6
  89. package/index.d.ts +3 -2
  90. package/index.js +2 -2
  91. package/package.json +16 -23
  92. package/presentation/folderTree/FolderTreePresenter.js +8 -8
  93. package/presentation/folderTree/FolderTreePresenter.js.map +1 -1
  94. package/presentation/folderTree/FolderTreePresenter.test.js +4 -2
  95. package/presentation/folderTree/FolderTreePresenter.test.js.map +1 -1
  96. package/table.types.d.ts +2 -9
  97. package/types.d.ts +5 -26
  98. package/types.js.map +1 -1
  99. package/components/Extensions/Extensions.d.ts +0 -2
  100. package/components/Extensions/Extensions.js +0 -30
  101. package/components/Extensions/Extensions.js.map +0 -1
  102. package/components/Extensions/index.d.ts +0 -1
  103. package/components/Extensions/index.js +0 -1
  104. package/config/folder/createFolderFieldDecoratorFactory.d.ts +0 -13
  105. package/config/folder/createFolderFieldDecoratorFactory.js +0 -17
  106. package/config/folder/createFolderFieldDecoratorFactory.js.map +0 -1
  107. package/config/table/Sorting.js.map +0 -1
  108. package/contexts/acoList.d.ts +0 -49
  109. package/contexts/acoList.js +0 -303
  110. package/contexts/acoList.js.map +0 -1
  111. package/contexts/app.d.ts +0 -33
  112. package/contexts/app.js +0 -47
  113. package/contexts/app.js.map +0 -1
  114. package/contexts/folders.d.ts +0 -12
  115. package/contexts/folders.js +0 -32
  116. package/contexts/folders.js.map +0 -1
  117. package/contexts/navigateFolder.d.ts +0 -17
  118. package/contexts/navigateFolder.js +0 -54
  119. package/contexts/navigateFolder.js.map +0 -1
  120. package/contexts/records.d.ts +0 -31
  121. package/contexts/records.js +0 -316
  122. package/contexts/records.js.map +0 -1
  123. package/exports/admin/aco.d.ts +0 -2
  124. package/exports/admin/aco.js +0 -2
  125. package/graphql/app.gql.d.ts +0 -17
  126. package/graphql/app.gql.js +0 -22
  127. package/graphql/app.gql.js.map +0 -1
  128. package/graphql/records/common.d.ts +0 -4
  129. package/graphql/records/common.js +0 -57
  130. package/graphql/records/common.js.map +0 -1
  131. package/graphql/records/getRecord.d.ts +0 -2
  132. package/graphql/records/getRecord.js +0 -5
  133. package/graphql/records/getRecord.js.map +0 -1
  134. package/graphql/records/listRecords.d.ts +0 -2
  135. package/graphql/records/listRecords.js +0 -26
  136. package/graphql/records/listRecords.js.map +0 -1
  137. package/graphql/records/moveRecord.d.ts +0 -2
  138. package/graphql/records/moveRecord.js +0 -16
  139. package/graphql/records/moveRecord.js.map +0 -1
  140. package/graphql/records/types.d.ts +0 -108
  141. package/graphql/records/types.js +0 -0
  142. package/graphql/records.gql.d.ts +0 -3
  143. package/graphql/records.gql.js +0 -3
  144. package/handlers.d.ts +0 -23
  145. package/handlers.js +0 -22
  146. package/handlers.js.map +0 -1
  147. package/hooks/useAcoApp.d.ts +0 -2
  148. package/hooks/useAcoApp.js +0 -16
  149. package/hooks/useAcoApp.js.map +0 -1
  150. package/hooks/useAcoList.d.ts +0 -3
  151. package/hooks/useAcoList.js +0 -10
  152. package/hooks/useAcoList.js.map +0 -1
  153. package/hooks/useFolderModel.d.ts +0 -2
  154. package/hooks/useFolderModel.js +0 -16
  155. package/hooks/useFolderModel.js.map +0 -1
  156. package/hooks/useFoldersType.d.ts +0 -1
  157. package/hooks/useFoldersType.js +0 -12
  158. package/hooks/useFoldersType.js.map +0 -1
  159. package/hooks/useNavigateFolder.d.ts +0 -2
  160. package/hooks/useNavigateFolder.js +0 -10
  161. package/hooks/useNavigateFolder.js.map +0 -1
  162. package/hooks/useRecords.d.ts +0 -62
  163. package/hooks/useRecords.js +0 -64
  164. package/hooks/useRecords.js.map +0 -1
  165. package/hooks/useTags.d.ts +0 -14
  166. package/hooks/useTags.js +0 -27
  167. package/hooks/useTags.js.map +0 -1
  168. package/sorting.d.ts +0 -9
  169. package/sorting.js +0 -31
  170. package/sorting.js.map +0 -1
@@ -20,7 +20,7 @@ const DeleteFolder = ()=>{
20
20
  label: "Delete",
21
21
  onAction: onAction,
22
22
  "data-testid": "aco.actions.folder.delete",
23
- className: "text-destructive-primary! [&_svg]:fill-destructive"
23
+ variant: "destructive"
24
24
  });
25
25
  };
26
26
  export { DeleteFolder };
@@ -1 +1 @@
1
- {"version":3,"file":"components/Actions/DeleteFolder/DeleteFolder.js","sources":["../../../../src/components/Actions/DeleteFolder/DeleteFolder.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\n\nimport { AcoConfig } from \"~/config/index.js\";\nimport { useDeleteDialog } from \"~/dialogs/index.js\";\nimport { useFolder } from \"~/hooks/index.js\";\n\nexport const DeleteFolder = () => {\n const { folder } = useFolder();\n const { showDialog } = useDeleteDialog();\n const { OptionsMenuItem } = AcoConfig.Folder.Action;\n\n const onAction = useCallback(() => {\n showDialog({\n folder\n });\n }, [folder]);\n\n if (!folder) {\n return null;\n }\n\n return (\n <OptionsMenuItem\n icon={<DeleteIcon />}\n label={\"Delete\"}\n onAction={onAction}\n data-testid={\"aco.actions.folder.delete\"}\n className={\"text-destructive-primary! [&_svg]:fill-destructive\"}\n />\n );\n};\n"],"names":["DeleteFolder","folder","useFolder","showDialog","useDeleteDialog","OptionsMenuItem","AcoConfig","onAction","useCallback","DeleteIcon"],"mappings":";;;;;AAOO,MAAMA,eAAe;IACxB,MAAM,EAAEC,MAAM,EAAE,GAAGC;IACnB,MAAM,EAAEC,UAAU,EAAE,GAAGC;IACvB,MAAM,EAAEC,eAAe,EAAE,GAAGC,UAAU,MAAM,CAAC,MAAM;IAEnD,MAAMC,WAAWC,YAAY;QACzBL,WAAW;YACPF;QACJ;IACJ,GAAG;QAACA;KAAO;IAEX,IAAI,CAACA,QACD,OAAO;IAGX,OAAO,WAAP,GACI,oBAACI,iBAAAA;QACG,oBAAM,oBAACI,gBAAUA;QACjB,OAAO;QACP,UAAUF;QACV,eAAa;QACb,WAAW;;AAGvB"}
1
+ {"version":3,"file":"components/Actions/DeleteFolder/DeleteFolder.js","sources":["../../../../src/components/Actions/DeleteFolder/DeleteFolder.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\n\nimport { AcoConfig } from \"~/config/index.js\";\nimport { useDeleteDialog } from \"~/dialogs/index.js\";\nimport { useFolder } from \"~/hooks/index.js\";\n\nexport const DeleteFolder = () => {\n const { folder } = useFolder();\n const { showDialog } = useDeleteDialog();\n const { OptionsMenuItem } = AcoConfig.Folder.Action;\n\n const onAction = useCallback(() => {\n showDialog({\n folder\n });\n }, [folder]);\n\n if (!folder) {\n return null;\n }\n\n return (\n <OptionsMenuItem\n icon={<DeleteIcon />}\n label={\"Delete\"}\n onAction={onAction}\n data-testid={\"aco.actions.folder.delete\"}\n variant={\"destructive\"}\n />\n );\n};\n"],"names":["DeleteFolder","folder","useFolder","showDialog","useDeleteDialog","OptionsMenuItem","AcoConfig","onAction","useCallback","DeleteIcon"],"mappings":";;;;;AAOO,MAAMA,eAAe;IACxB,MAAM,EAAEC,MAAM,EAAE,GAAGC;IACnB,MAAM,EAAEC,UAAU,EAAE,GAAGC;IACvB,MAAM,EAAEC,eAAe,EAAE,GAAGC,UAAU,MAAM,CAAC,MAAM;IAEnD,MAAMC,WAAWC,YAAY;QACzBL,WAAW;YACPF;QACJ;IACJ,GAAG;QAACA;KAAO;IAEX,IAAI,CAACA,QACD,OAAO;IAGX,OAAO,WAAP,GACI,oBAACI,iBAAAA;QACG,oBAAM,oBAACI,gBAAUA;QACjB,OAAO;QACP,UAAUF;QACV,eAAa;QACb,SAAS;;AAGrB"}
@@ -49,6 +49,7 @@ export declare class Filter {
49
49
  static createEmpty(): Filter;
50
50
  static create(data: FilterDTO): Filter;
51
51
  static validate(data: FilterDTO): zod.ZodSafeParseResult<{
52
+ id?: string | null | undefined;
52
53
  name: string;
53
54
  description: string;
54
55
  operation: Operation;
@@ -60,7 +61,6 @@ export declare class Filter {
60
61
  value: string | number | boolean | (string | number | boolean)[];
61
62
  }[];
62
63
  }[];
63
- id?: string | null | undefined;
64
64
  }>;
65
65
  protected constructor(data: {
66
66
  operation: Operation;
@@ -1,9 +1,9 @@
1
- import type { ApolloClient } from "apollo-client";
1
+ import type { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
2
2
  import { FilterRepository } from "./FilterRepository.js";
3
3
  declare class FilterRepositoryFactory {
4
4
  private gateway;
5
5
  private cache;
6
- getRepository(client: ApolloClient<any>, namespace: string): FilterRepository;
6
+ getRepository(client: MainGraphQLClient.Interface, namespace: string): FilterRepository;
7
7
  }
8
8
  export declare const filterRepositoryFactory: FilterRepositoryFactory;
9
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"components/AdvancedSearch/domain/FilterRepositoryFactory.js","sources":["../../../../src/components/AdvancedSearch/domain/FilterRepositoryFactory.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport type { FiltersGatewayInterface } from \"~/components/AdvancedSearch/gateways/index.js\";\nimport { FiltersGraphQLGateway } from \"~/components/AdvancedSearch/gateways/index.js\";\nimport { FilterRepository } from \"./FilterRepository.js\";\n\nclass FilterRepositoryFactory {\n private gateway: FiltersGatewayInterface | undefined;\n private cache: Map<string, FilterRepository> = new Map();\n\n getRepository(client: ApolloClient<any>, namespace: string) {\n if (!this.gateway) {\n this.gateway = new FiltersGraphQLGateway(client);\n }\n\n if (!this.cache.has(namespace)) {\n this.cache.set(namespace, new FilterRepository(this.gateway, namespace));\n }\n\n return this.cache.get(namespace) as FilterRepository;\n }\n}\n\nexport const filterRepositoryFactory = new FilterRepositoryFactory();\n"],"names":["FilterRepositoryFactory","client","namespace","FiltersGraphQLGateway","FilterRepository","Map","filterRepositoryFactory"],"mappings":";;AAKA,MAAMA;IAIF,cAAcC,MAAyB,EAAEC,SAAiB,EAAE;QACxD,IAAI,CAAC,IAAI,CAAC,OAAO,EACb,IAAI,CAAC,OAAO,GAAG,IAAIC,sBAAsBF;QAG7C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACC,YAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,WAAW,IAAIE,iBAAiB,IAAI,CAAC,OAAO,EAAEF;QAGjE,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA;IAC1B;;aAZQ,KAAK,GAAkC,IAAIG;;AAavD;AAEO,MAAMC,0BAA0B,IAAIN"}
1
+ {"version":3,"file":"components/AdvancedSearch/domain/FilterRepositoryFactory.js","sources":["../../../../src/components/AdvancedSearch/domain/FilterRepositoryFactory.ts"],"sourcesContent":["import type { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport type { FiltersGatewayInterface } from \"~/components/AdvancedSearch/gateways/index.js\";\nimport { FiltersGraphQLGateway } from \"~/components/AdvancedSearch/gateways/index.js\";\nimport { FilterRepository } from \"./FilterRepository.js\";\n\nclass FilterRepositoryFactory {\n private gateway: FiltersGatewayInterface | undefined;\n private cache: Map<string, FilterRepository> = new Map();\n\n getRepository(client: MainGraphQLClient.Interface, namespace: string) {\n if (!this.gateway) {\n this.gateway = new FiltersGraphQLGateway(client);\n }\n\n if (!this.cache.has(namespace)) {\n this.cache.set(namespace, new FilterRepository(this.gateway, namespace));\n }\n\n return this.cache.get(namespace) as FilterRepository;\n }\n}\n\nexport const filterRepositoryFactory = new FilterRepositoryFactory();\n"],"names":["FilterRepositoryFactory","client","namespace","FiltersGraphQLGateway","FilterRepository","Map","filterRepositoryFactory"],"mappings":";;AAKA,MAAMA;IAIF,cAAcC,MAAmC,EAAEC,SAAiB,EAAE;QAClE,IAAI,CAAC,IAAI,CAAC,OAAO,EACb,IAAI,CAAC,OAAO,GAAG,IAAIC,sBAAsBF;QAG7C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACC,YAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,WAAW,IAAIE,iBAAiB,IAAI,CAAC,OAAO,EAAEF;QAGjE,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA;IAC1B;;aAZQ,KAAK,GAAkC,IAAIG;;AAavD;AAEO,MAAMC,0BAA0B,IAAIN"}
@@ -1,9 +1,9 @@
1
- import type { ApolloClient } from "apollo-client";
1
+ import type { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
2
2
  import type { CreateFilterPayload, UpdateFilterPayload } from "./filters.types.js";
3
3
  import type { FiltersGatewayInterface } from "./FiltersGatewayInterface.js";
4
4
  export declare class FiltersGraphQLGateway implements FiltersGatewayInterface {
5
5
  private client;
6
- constructor(client: ApolloClient<any>);
6
+ constructor(client: MainGraphQLClient.Interface);
7
7
  list(namespace: string): Promise<import("../domain/Filter.js").FilterDTO[]>;
8
8
  get(id: string): Promise<import("../domain/Filter.js").FilterDTO>;
9
9
  create(filter: CreateFilterPayload): Promise<import("../domain/Filter.js").FilterDTO>;
@@ -4,13 +4,12 @@ class FiltersGraphQLGateway {
4
4
  this.client = client;
5
5
  }
6
6
  async list(namespace) {
7
- const { data: response } = await this.client.query({
7
+ const response = await this.client.execute({
8
8
  query: LIST_FILTERS,
9
9
  variables: {
10
10
  namespace,
11
11
  limit: 10000
12
- },
13
- fetchPolicy: "network-only"
12
+ }
14
13
  });
15
14
  if (!response) throw new Error("Network error while listing filters.");
16
15
  const { data, error } = response.aco.listFilters;
@@ -18,7 +17,7 @@ class FiltersGraphQLGateway {
18
17
  return data;
19
18
  }
20
19
  async get(id) {
21
- const { data: response } = await this.client.query({
20
+ const response = await this.client.execute({
22
21
  query: GET_FILTER,
23
22
  variables: {
24
23
  id
@@ -30,8 +29,8 @@ class FiltersGraphQLGateway {
30
29
  return data;
31
30
  }
32
31
  async create(filter) {
33
- const { data: response } = await this.client.mutate({
34
- mutation: CREATE_FILTER,
32
+ const response = await this.client.execute({
33
+ query: CREATE_FILTER,
35
34
  variables: {
36
35
  data: filter
37
36
  }
@@ -44,8 +43,8 @@ class FiltersGraphQLGateway {
44
43
  async update(filter) {
45
44
  const { id, name, description, operation, groups } = filter;
46
45
  if (!id) throw new Error("Error while updating filter, missing id.");
47
- const { data: response } = await this.client.mutate({
48
- mutation: UPDATE_FILTER,
46
+ const response = await this.client.execute({
47
+ query: UPDATE_FILTER,
49
48
  variables: {
50
49
  id,
51
50
  data: {
@@ -62,8 +61,8 @@ class FiltersGraphQLGateway {
62
61
  return data;
63
62
  }
64
63
  async delete(id) {
65
- const { data: response } = await this.client.mutate({
66
- mutation: DELETE_FILTER,
64
+ const response = await this.client.execute({
65
+ query: DELETE_FILTER,
67
66
  variables: {
68
67
  id
69
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"components/AdvancedSearch/gateways/FiltersGraphQLGateway.js","sources":["../../../../src/components/AdvancedSearch/gateways/FiltersGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\n\nimport type {\n CreateFilterPayload,\n CreateFilterResponse,\n CreateFilterVariables,\n DeleteFilterResponse,\n DeleteFilterVariables,\n GetFilterQueryVariables,\n GetFilterResponse,\n ListFiltersQueryVariables,\n ListFiltersResponse,\n UpdateFilterPayload,\n UpdateFilterResponse,\n UpdateFilterVariables\n} from \"./filters.types.js\";\nimport type { FiltersGatewayInterface } from \"./FiltersGatewayInterface.js\";\nimport {\n CREATE_FILTER,\n DELETE_FILTER,\n GET_FILTER,\n LIST_FILTERS,\n UPDATE_FILTER\n} from \"./filters.gql.js\";\n\nexport class FiltersGraphQLGateway implements FiltersGatewayInterface {\n private client: ApolloClient<any>;\n\n constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n async list(namespace: string) {\n const { data: response } = await this.client.query<\n ListFiltersResponse,\n ListFiltersQueryVariables\n >({\n query: LIST_FILTERS,\n variables: {\n namespace,\n limit: 10000\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while listing filters.\");\n }\n\n const { data, error } = response.aco.listFilters;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch filters.\");\n }\n\n return data;\n }\n\n async get(id: string) {\n const { data: response } = await this.client.query<\n GetFilterResponse,\n GetFilterQueryVariables\n >({\n query: GET_FILTER,\n variables: { id }\n });\n\n if (!response) {\n throw new Error(\"Network error while fetch filter.\");\n }\n\n const { data, error } = response.aco.getFilter;\n\n if (!data) {\n throw new Error(error?.message || `Could not fetch filter with id: ${id}`);\n }\n\n return data;\n }\n\n async create(filter: CreateFilterPayload) {\n const { data: response } = await this.client.mutate<\n CreateFilterResponse,\n CreateFilterVariables\n >({\n mutation: CREATE_FILTER,\n variables: {\n data: filter\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while creating filter.\");\n }\n\n const { data, error } = response.aco.createFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not create filter.\");\n }\n\n return data;\n }\n\n async update(filter: UpdateFilterPayload) {\n const { id, name, description, operation, groups } = filter;\n\n if (!id) {\n throw new Error(\"Error while updating filter, missing id.\");\n }\n\n const { data: response } = await this.client.mutate<\n UpdateFilterResponse,\n UpdateFilterVariables\n >({\n mutation: UPDATE_FILTER,\n variables: {\n id,\n data: {\n name,\n description,\n operation,\n groups\n }\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while updating filter.\");\n }\n\n const { data, error } = response.aco.updateFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not update filter.\");\n }\n\n return data;\n }\n\n async delete(id: string) {\n const { data: response } = await this.client.mutate<\n DeleteFilterResponse,\n DeleteFilterVariables\n >({\n mutation: DELETE_FILTER,\n variables: {\n id\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while deleting filter.\");\n }\n\n const { data, error } = response.aco.deleteFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not delete filter.\");\n }\n\n return true;\n }\n}\n"],"names":["FiltersGraphQLGateway","client","namespace","response","LIST_FILTERS","Error","data","error","id","GET_FILTER","filter","CREATE_FILTER","name","description","operation","groups","UPDATE_FILTER","DELETE_FILTER"],"mappings":";AAyBO,MAAMA;IAGT,YAAYC,MAAyB,CAAE;QACnC,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEA,MAAM,KAAKC,SAAiB,EAAE;QAC1B,MAAM,EAAE,MAAMC,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAGhD;YACE,OAAOC;YACP,WAAW;gBACPF;gBACA,OAAO;YACX;YACA,aAAa;QACjB;QAEA,IAAI,CAACC,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,WAAW;QAEhD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,IAAIE,EAAU,EAAE;QAClB,MAAM,EAAE,MAAML,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAGhD;YACE,OAAOM;YACP,WAAW;gBAAED;YAAG;QACpB;QAEA,IAAI,CAACL,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,SAAS;QAE9C,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW,CAAC,gCAAgC,EAAEC,IAAI;QAG7E,OAAOF;IACX;IAEA,MAAM,OAAOI,MAA2B,EAAE;QACtC,MAAM,EAAE,MAAMP,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAGjD;YACE,UAAUQ;YACV,WAAW;gBACP,MAAMD;YACV;QACJ;QAEA,IAAI,CAACP,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,OAAOI,MAA2B,EAAE;QACtC,MAAM,EAAEF,EAAE,EAAEI,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAE,GAAGL;QAErD,IAAI,CAACF,IACD,MAAM,IAAIH,MAAM;QAGpB,MAAM,EAAE,MAAMF,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAGjD;YACE,UAAUa;YACV,WAAW;gBACPR;gBACA,MAAM;oBACFI;oBACAC;oBACAC;oBACAC;gBACJ;YACJ;QACJ;QAEA,IAAI,CAACZ,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,OAAOE,EAAU,EAAE;QACrB,MAAM,EAAE,MAAML,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAGjD;YACE,UAAUc;YACV,WAAW;gBACPT;YACJ;QACJ;QAEA,IAAI,CAACL,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAO;IACX;AACJ"}
1
+ {"version":3,"file":"components/AdvancedSearch/gateways/FiltersGraphQLGateway.js","sources":["../../../../src/components/AdvancedSearch/gateways/FiltersGraphQLGateway.ts"],"sourcesContent":["import type { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\n\nimport type {\n CreateFilterPayload,\n CreateFilterResponse,\n DeleteFilterResponse,\n GetFilterResponse,\n GetFilterQueryVariables,\n CreateFilterVariables,\n UpdateFilterVariables,\n DeleteFilterVariables,\n ListFiltersResponse,\n ListFiltersQueryVariables,\n UpdateFilterPayload,\n UpdateFilterResponse\n} from \"./filters.types.js\";\nimport type { FiltersGatewayInterface } from \"./FiltersGatewayInterface.js\";\nimport {\n CREATE_FILTER,\n DELETE_FILTER,\n GET_FILTER,\n LIST_FILTERS,\n UPDATE_FILTER\n} from \"./filters.gql.js\";\n\nexport class FiltersGraphQLGateway implements FiltersGatewayInterface {\n private client: MainGraphQLClient.Interface;\n\n constructor(client: MainGraphQLClient.Interface) {\n this.client = client;\n }\n\n async list(namespace: string) {\n const response = await this.client.execute<ListFiltersResponse, ListFiltersQueryVariables>({\n query: LIST_FILTERS,\n variables: {\n namespace,\n limit: 10000\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while listing filters.\");\n }\n\n const { data, error } = response.aco.listFilters;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch filters.\");\n }\n\n return data;\n }\n\n async get(id: string) {\n const response = await this.client.execute<GetFilterResponse, GetFilterQueryVariables>({\n query: GET_FILTER,\n variables: { id }\n });\n\n if (!response) {\n throw new Error(\"Network error while fetch filter.\");\n }\n\n const { data, error } = response.aco.getFilter;\n\n if (!data) {\n throw new Error(error?.message || `Could not fetch filter with id: ${id}`);\n }\n\n return data;\n }\n\n async create(filter: CreateFilterPayload) {\n const response = await this.client.execute<CreateFilterResponse, CreateFilterVariables>({\n query: CREATE_FILTER,\n variables: {\n data: filter\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while creating filter.\");\n }\n\n const { data, error } = response.aco.createFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not create filter.\");\n }\n\n return data;\n }\n\n async update(filter: UpdateFilterPayload) {\n const { id, name, description, operation, groups } = filter;\n\n if (!id) {\n throw new Error(\"Error while updating filter, missing id.\");\n }\n\n const response = await this.client.execute<UpdateFilterResponse, UpdateFilterVariables>({\n query: UPDATE_FILTER,\n variables: {\n id,\n data: {\n name,\n description,\n operation,\n groups\n }\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while updating filter.\");\n }\n\n const { data, error } = response.aco.updateFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not update filter.\");\n }\n\n return data;\n }\n\n async delete(id: string) {\n const response = await this.client.execute<DeleteFilterResponse, DeleteFilterVariables>({\n query: DELETE_FILTER,\n variables: {\n id\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while deleting filter.\");\n }\n\n const { data, error } = response.aco.deleteFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not delete filter.\");\n }\n\n return true;\n }\n}\n"],"names":["FiltersGraphQLGateway","client","namespace","response","LIST_FILTERS","Error","data","error","id","GET_FILTER","filter","CREATE_FILTER","name","description","operation","groups","UPDATE_FILTER","DELETE_FILTER"],"mappings":";AAyBO,MAAMA;IAGT,YAAYC,MAAmC,CAAE;QAC7C,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEA,MAAM,KAAKC,SAAiB,EAAE;QAC1B,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAiD;YACvF,OAAOC;YACP,WAAW;gBACPF;gBACA,OAAO;YACX;QACJ;QAEA,IAAI,CAACC,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,WAAW;QAEhD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,IAAIE,EAAU,EAAE;QAClB,MAAML,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA6C;YACnF,OAAOM;YACP,WAAW;gBAAED;YAAG;QACpB;QAEA,IAAI,CAACL,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,SAAS;QAE9C,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW,CAAC,gCAAgC,EAAEC,IAAI;QAG7E,OAAOF;IACX;IAEA,MAAM,OAAOI,MAA2B,EAAE;QACtC,MAAMP,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8C;YACpF,OAAOQ;YACP,WAAW;gBACP,MAAMD;YACV;QACJ;QAEA,IAAI,CAACP,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,OAAOI,MAA2B,EAAE;QACtC,MAAM,EAAEF,EAAE,EAAEI,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAE,GAAGL;QAErD,IAAI,CAACF,IACD,MAAM,IAAIH,MAAM;QAGpB,MAAMF,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8C;YACpF,OAAOa;YACP,WAAW;gBACPR;gBACA,MAAM;oBACFI;oBACAC;oBACAC;oBACAC;gBACJ;YACJ;QACJ;QAEA,IAAI,CAACZ,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,OAAOE,EAAU,EAAE;QACrB,MAAML,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8C;YACpF,OAAOc;YACP,WAAW;gBACPT;YACJ;QACJ;QAEA,IAAI,CAACL,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAO;IACX;AACJ"}
@@ -1,5 +1,5 @@
1
- export declare const CREATE_FILTER: import("graphql").DocumentNode;
2
- export declare const LIST_FILTERS: import("graphql").DocumentNode;
3
- export declare const GET_FILTER: import("graphql").DocumentNode;
4
- export declare const UPDATE_FILTER: import("graphql").DocumentNode;
5
- export declare const DELETE_FILTER: import("graphql").DocumentNode;
1
+ export declare const CREATE_FILTER = "\n mutation CreateFilter($data: FilterCreateInput!) {\n aco {\n createFilter(data: $data) {\n data \n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
2
+ export declare const LIST_FILTERS = "\n query ListFilters($namespace: String!, $limit: Int!) {\n aco {\n listFilters(where: { namespace: $namespace }, limit: $limit) {\n data \n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
3
+ export declare const GET_FILTER = "\n query GetFilters($id: ID!) {\n aco {\n getFilter(id: $id) {\n data \n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
4
+ export declare const UPDATE_FILTER = "\n mutation UpdateFilter($id: ID!, $data: FilterUpdateInput!) {\n aco {\n updateFilter(id: $id, data: $data) {\n data \n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
5
+ export declare const DELETE_FILTER = "\n mutation DeleteFilter($id: ID!) {\n aco {\n deleteFilter(id: $id) {\n data\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
@@ -1,4 +1,3 @@
1
- import graphql_tag from "graphql-tag";
2
1
  const ERROR_FIELD = `
3
2
  {
4
3
  code
@@ -23,7 +22,7 @@ const DATA_FIELD = `
23
22
  createdOn
24
23
  }
25
24
  `;
26
- const CREATE_FILTER = graphql_tag`
25
+ const CREATE_FILTER = `
27
26
  mutation CreateFilter($data: FilterCreateInput!) {
28
27
  aco {
29
28
  createFilter(data: $data) {
@@ -33,7 +32,7 @@ const CREATE_FILTER = graphql_tag`
33
32
  }
34
33
  }
35
34
  `;
36
- const LIST_FILTERS = graphql_tag`
35
+ const LIST_FILTERS = `
37
36
  query ListFilters($namespace: String!, $limit: Int!) {
38
37
  aco {
39
38
  listFilters(where: { namespace: $namespace }, limit: $limit) {
@@ -43,7 +42,7 @@ const LIST_FILTERS = graphql_tag`
43
42
  }
44
43
  }
45
44
  `;
46
- const GET_FILTER = graphql_tag`
45
+ const GET_FILTER = `
47
46
  query GetFilters($id: ID!) {
48
47
  aco {
49
48
  getFilter(id: $id) {
@@ -53,7 +52,7 @@ const GET_FILTER = graphql_tag`
53
52
  }
54
53
  }
55
54
  `;
56
- const UPDATE_FILTER = graphql_tag`
55
+ const UPDATE_FILTER = `
57
56
  mutation UpdateFilter($id: ID!, $data: FilterUpdateInput!) {
58
57
  aco {
59
58
  updateFilter(id: $id, data: $data) {
@@ -63,7 +62,7 @@ const UPDATE_FILTER = graphql_tag`
63
62
  }
64
63
  }
65
64
  `;
66
- const DELETE_FILTER = graphql_tag`
65
+ const DELETE_FILTER = `
67
66
  mutation DeleteFilter($id: ID!) {
68
67
  aco {
69
68
  deleteFilter(id: $id) {
@@ -1 +1 @@
1
- {"version":3,"file":"components/AdvancedSearch/gateways/filters.gql.js","sources":["../../../../src/components/AdvancedSearch/gateways/filters.gql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nconst ERROR_FIELD = /* GraphQL */ `\n {\n code\n data\n message\n }\n`;\n\nconst DATA_FIELD = /* GraphQL */ `\n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n`;\n\nexport const CREATE_FILTER = gql`\n mutation CreateFilter($data: FilterCreateInput!) {\n aco {\n createFilter(data: $data) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const LIST_FILTERS = gql`\n query ListFilters($namespace: String!, $limit: Int!) {\n aco {\n listFilters(where: { namespace: $namespace }, limit: $limit) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const GET_FILTER = gql`\n query GetFilters($id: ID!) {\n aco {\n getFilter(id: $id) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const UPDATE_FILTER = gql`\n mutation UpdateFilter($id: ID!, $data: FilterUpdateInput!) {\n aco {\n updateFilter(id: $id, data: $data) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const DELETE_FILTER = gql`\n mutation DeleteFilter($id: ID!) {\n aco {\n deleteFilter(id: $id) {\n data\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n"],"names":["ERROR_FIELD","DATA_FIELD","CREATE_FILTER","gql","LIST_FILTERS","GET_FILTER","UPDATE_FILTER","DELETE_FILTER"],"mappings":";AAEA,MAAMA,cAA4B,CAAC;;;;;;AAMnC,CAAC;AAED,MAAMC,aAA2B,CAAC;;;;;;;;;;;;;;;;AAgBlC,CAAC;AAEM,MAAMC,gBAAgBC,WAAG,CAAC;;;;qBAIZ,EAAEF,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMI,eAAeD,WAAG,CAAC;;;;qBAIX,EAAEF,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMK,aAAaF,WAAG,CAAC;;;;qBAIT,EAAEF,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMM,gBAAgBH,WAAG,CAAC;;;;qBAIZ,EAAEF,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMO,gBAAgBJ,WAAG,CAAC;;;;;sBAKX,EAAEH,YAAY;;;;AAIpC,CAAC"}
1
+ {"version":3,"file":"components/AdvancedSearch/gateways/filters.gql.js","sources":["../../../../src/components/AdvancedSearch/gateways/filters.gql.ts"],"sourcesContent":["const ERROR_FIELD = /* GraphQL */ `\n {\n code\n data\n message\n }\n`;\n\nconst DATA_FIELD = /* GraphQL */ `\n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n`;\n\nexport const CREATE_FILTER = /* GraphQL */ `\n mutation CreateFilter($data: FilterCreateInput!) {\n aco {\n createFilter(data: $data) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const LIST_FILTERS = /* GraphQL */ `\n query ListFilters($namespace: String!, $limit: Int!) {\n aco {\n listFilters(where: { namespace: $namespace }, limit: $limit) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const GET_FILTER = /* GraphQL */ `\n query GetFilters($id: ID!) {\n aco {\n getFilter(id: $id) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const UPDATE_FILTER = /* GraphQL */ `\n mutation UpdateFilter($id: ID!, $data: FilterUpdateInput!) {\n aco {\n updateFilter(id: $id, data: $data) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const DELETE_FILTER = /* GraphQL */ `\n mutation DeleteFilter($id: ID!) {\n aco {\n deleteFilter(id: $id) {\n data\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n"],"names":["ERROR_FIELD","DATA_FIELD","CREATE_FILTER","LIST_FILTERS","GET_FILTER","UPDATE_FILTER","DELETE_FILTER"],"mappings":"AAAA,MAAMA,cAA4B,CAAC;;;;;;AAMnC,CAAC;AAED,MAAMC,aAA2B,CAAC;;;;;;;;;;;;;;;;AAgBlC,CAAC;AAEM,MAAMC,gBAA8B,CAAC;;;;qBAIvB,EAAED,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMG,eAA6B,CAAC;;;;qBAItB,EAAEF,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMI,aAA2B,CAAC;;;;qBAIpB,EAAEH,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMK,gBAA8B,CAAC;;;;qBAIvB,EAAEJ,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMM,gBAA8B,CAAC;;;;;sBAKtB,EAAEN,YAAY;;;;AAIpC,CAAC"}
@@ -1,7 +1,12 @@
1
- import { useApolloClient } from "@apollo/react-hooks";
1
+ import { useMemo } from "react";
2
+ import { useContainer } from "@webiny/app";
3
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
2
4
  import { filterRepositoryFactory } from "./domain/index.js";
3
5
  const useFilterRepository = (namespace)=>{
4
- const client = useApolloClient();
6
+ const container = useContainer();
7
+ const client = useMemo(()=>container.resolve(MainGraphQLClient), [
8
+ container
9
+ ]);
5
10
  return filterRepositoryFactory.getRepository(client, namespace);
6
11
  };
7
12
  export { useFilterRepository };
@@ -1 +1 @@
1
- {"version":3,"file":"components/AdvancedSearch/useFilterRepository.js","sources":["../../../src/components/AdvancedSearch/useFilterRepository.tsx"],"sourcesContent":["import { useApolloClient } from \"@apollo/react-hooks\";\nimport { filterRepositoryFactory } from \"~/components/AdvancedSearch/domain/index.js\";\n\nexport const useFilterRepository = (namespace: string) => {\n const client = useApolloClient();\n\n return filterRepositoryFactory.getRepository(client, namespace);\n};\n"],"names":["useFilterRepository","namespace","client","useApolloClient","filterRepositoryFactory"],"mappings":";;AAGO,MAAMA,sBAAsB,CAACC;IAChC,MAAMC,SAASC;IAEf,OAAOC,wBAAwB,aAAa,CAACF,QAAQD;AACzD"}
1
+ {"version":3,"file":"components/AdvancedSearch/useFilterRepository.js","sources":["../../../src/components/AdvancedSearch/useFilterRepository.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useContainer } from \"@webiny/app\";\nimport { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport { filterRepositoryFactory } from \"~/components/AdvancedSearch/domain/index.js\";\n\nexport const useFilterRepository = (namespace: string) => {\n const container = useContainer();\n const client = useMemo(() => container.resolve(MainGraphQLClient), [container]);\n\n return filterRepositoryFactory.getRepository(client, namespace);\n};\n"],"names":["useFilterRepository","namespace","container","useContainer","client","useMemo","MainGraphQLClient","filterRepositoryFactory"],"mappings":";;;;AAKO,MAAMA,sBAAsB,CAACC;IAChC,MAAMC,YAAYC;IAClB,MAAMC,SAASC,QAAQ,IAAMH,UAAU,OAAO,CAACI,oBAAoB;QAACJ;KAAU;IAE9E,OAAOK,wBAAwB,aAAa,CAACH,QAAQH;AACzD"}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const CellAuthor: () => React.JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import react, { useContext } from "react";
2
+ import { TableRowContext } from "../useTableRow.js";
3
+ const CellAuthor = ()=>{
4
+ const context = useContext(TableRowContext);
5
+ if (!context) return null;
6
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, context.row.data.createdBy.displayName);
7
+ };
8
+ export { CellAuthor };
9
+
10
+ //# sourceMappingURL=CellAuthor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/Table/cells/CellAuthor.js","sources":["../../../../src/components/Table/cells/CellAuthor.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { TableRowContext } from \"../useTableRow.js\";\n\nexport const CellAuthor = () => {\n const context = useContext(TableRowContext);\n if (!context) {\n return null;\n }\n return <>{context.row.data.createdBy.displayName}</>;\n};\n"],"names":["CellAuthor","context","useContext","TableRowContext"],"mappings":";;AAGO,MAAMA,aAAa;IACtB,MAAMC,UAAUC,WAAWC;IAC3B,IAAI,CAACF,SACD,OAAO;IAEX,OAAO,WAAP,GAAO,0CAAGA,QAAQ,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW;AACpD"}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const CellCreated: () => React.JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import react, { useContext } from "react";
2
+ import { TimeAgo } from "@webiny/admin-ui";
3
+ import { TableRowContext } from "../useTableRow.js";
4
+ const CellCreated = ()=>{
5
+ const context = useContext(TableRowContext);
6
+ if (!context) return null;
7
+ return /*#__PURE__*/ react.createElement(TimeAgo, {
8
+ datetime: context.row.data.createdOn
9
+ });
10
+ };
11
+ export { CellCreated };
12
+
13
+ //# sourceMappingURL=CellCreated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/Table/cells/CellCreated.js","sources":["../../../../src/components/Table/cells/CellCreated.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { TimeAgo } from \"@webiny/admin-ui\";\nimport { TableRowContext } from \"../useTableRow.js\";\n\nexport const CellCreated = () => {\n const context = useContext(TableRowContext);\n if (!context) {\n return null;\n }\n return <TimeAgo datetime={context.row.data.createdOn} />;\n};\n"],"names":["CellCreated","context","useContext","TableRowContext","TimeAgo"],"mappings":";;;AAIO,MAAMA,cAAc;IACvB,MAAMC,UAAUC,WAAWC;IAC3B,IAAI,CAACF,SACD,OAAO;IAEX,OAAO,WAAP,GAAO,oBAACG,SAAOA;QAAC,UAAUH,QAAQ,GAAG,CAAC,IAAI,CAAC,SAAS;;AACxD"}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const CellModified: () => React.JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import react, { useContext } from "react";
2
+ import { TimeAgo } from "@webiny/admin-ui";
3
+ import { TableRowContext } from "../useTableRow.js";
4
+ const CellModified = ()=>{
5
+ const context = useContext(TableRowContext);
6
+ if (!context) return null;
7
+ return /*#__PURE__*/ react.createElement(TimeAgo, {
8
+ datetime: context.row.data.savedOn
9
+ });
10
+ };
11
+ export { CellModified };
12
+
13
+ //# sourceMappingURL=CellModified.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/Table/cells/CellModified.js","sources":["../../../../src/components/Table/cells/CellModified.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { TimeAgo } from \"@webiny/admin-ui\";\nimport { TableRowContext } from \"../useTableRow.js\";\n\nexport const CellModified = () => {\n const context = useContext(TableRowContext);\n if (!context) {\n return null;\n }\n return <TimeAgo datetime={context.row.data.savedOn} />;\n};\n"],"names":["CellModified","context","useContext","TableRowContext","TimeAgo"],"mappings":";;;AAIO,MAAMA,eAAe;IACxB,MAAMC,UAAUC,WAAWC;IAC3B,IAAI,CAACF,SACD,OAAO;IAEX,OAAO,WAAP,GAAO,oBAACG,SAAOA;QAAC,UAAUH,QAAQ,GAAG,CAAC,IAAI,CAAC,OAAO;;AACtD"}
@@ -0,0 +1,3 @@
1
+ export { CellAuthor } from "./CellAuthor.js";
2
+ export { CellCreated } from "./CellCreated.js";
3
+ export { CellModified } from "./CellModified.js";
@@ -0,0 +1,3 @@
1
+ export { CellAuthor } from "./CellAuthor.js";
2
+ export { CellCreated } from "./CellCreated.js";
3
+ export { CellModified } from "./CellModified.js";
@@ -1,7 +1,9 @@
1
+ export { createRecordsData } from "@webiny/app-admin/components/Table/createTableData.js";
1
2
  import type { FolderDto } from "../../domain/folder/FolderDto.js";
2
- import type { FolderTableRow, RecordTableRow } from "../../table.types.js";
3
- export declare const createRecordsData: <T extends {
4
- id: string;
5
- $selectable?: boolean;
6
- }>(items: T[]) => RecordTableRow<T>[];
3
+ import type { FolderTableRow } from "../../table.types.js";
7
4
  export declare const createFoldersData: (items: FolderDto[]) => FolderTableRow[];
5
+ export interface FolderSortConfig {
6
+ field: string;
7
+ direction: "ASC" | "DESC";
8
+ }
9
+ export declare function sortFolders(folders: FolderDto[], sort: FolderSortConfig | undefined): FolderDto[];
@@ -1,15 +1,30 @@
1
- const createRecordsData = (items)=>items.map((item)=>({
2
- id: item.id,
3
- $type: "RECORD",
4
- $selectable: void 0 !== item.$selectable ? item.$selectable : true,
5
- data: item
6
- }));
7
1
  const createFoldersData = (items)=>items.map((item)=>({
8
2
  id: item.id,
9
3
  $type: "FOLDER",
10
4
  $selectable: false,
11
5
  data: item
12
6
  }));
13
- export { createFoldersData, createRecordsData };
7
+ const FOLDER_SORT_FIELDS = {
8
+ name: (f)=>f.title,
9
+ title: (f)=>f.title,
10
+ createdOn: (f)=>f.createdOn,
11
+ savedOn: (f)=>f.savedOn,
12
+ modifiedOn: (f)=>f.modifiedOn ?? f.savedOn,
13
+ createdBy: (f)=>f.createdBy.displayName,
14
+ savedBy: (f)=>f.savedBy.displayName,
15
+ modifiedBy: (f)=>f.modifiedBy ? f.modifiedBy.displayName : f.savedBy.displayName
16
+ };
17
+ function sortFolders(folders, sort) {
18
+ if (!sort || 0 === folders.length) return folders;
19
+ const accessor = FOLDER_SORT_FIELDS[sort.field];
20
+ if (!accessor) return folders;
21
+ const desc = "DESC" === sort.direction;
22
+ return folders.slice().sort((a, b)=>{
23
+ const cmp = accessor(a).localeCompare(accessor(b));
24
+ return desc ? -cmp : cmp;
25
+ });
26
+ }
27
+ export { createRecordsData } from "@webiny/app-admin/components/Table/createTableData.js";
28
+ export { createFoldersData, sortFolders };
14
29
 
15
30
  //# sourceMappingURL=createTableData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/Table/createTableData.js","sources":["../../../src/components/Table/createTableData.ts"],"sourcesContent":["import type { FolderDto } from \"~/domain/folder/FolderDto.js\";\nimport type { FolderTableRow, RecordTableRow } from \"~/table.types.js\";\n\nexport const createRecordsData = <T extends { id: string; $selectable?: boolean }>(\n items: T[]\n): RecordTableRow<T>[] => {\n return items.map(item => ({\n id: item.id,\n $type: \"RECORD\",\n $selectable: item.$selectable !== undefined ? item.$selectable : true,\n data: item\n }));\n};\n\nexport const createFoldersData = (items: FolderDto[]): FolderTableRow[] => {\n return items.map(item => ({\n id: item.id,\n $type: \"FOLDER\",\n $selectable: false,\n data: item\n }));\n};\n"],"names":["createRecordsData","items","item","undefined","createFoldersData"],"mappings":"AAGO,MAAMA,oBAAoB,CAC7BC,QAEOA,MAAM,GAAG,CAACC,CAAAA,OAAS;YACtB,IAAIA,KAAK,EAAE;YACX,OAAO;YACP,aAAaA,AAAqBC,WAArBD,KAAK,WAAW,GAAiBA,KAAK,WAAW,GAAG;YACjE,MAAMA;QACV;AAGG,MAAME,oBAAoB,CAACH,QACvBA,MAAM,GAAG,CAACC,CAAAA,OAAS;YACtB,IAAIA,KAAK,EAAE;YACX,OAAO;YACP,aAAa;YACb,MAAMA;QACV"}
1
+ {"version":3,"file":"components/Table/createTableData.js","sources":["../../../src/components/Table/createTableData.ts"],"sourcesContent":["export { createRecordsData } from \"@webiny/app-admin/components/Table/createTableData.js\";\n\nimport type { FolderDto } from \"~/domain/folder/FolderDto.js\";\nimport type { FolderTableRow } from \"~/table.types.js\";\n\nexport const createFoldersData = (items: FolderDto[]): FolderTableRow[] => {\n return items.map(item => ({\n id: item.id,\n $type: \"FOLDER\",\n $selectable: false,\n data: item\n }));\n};\n\nexport interface FolderSortConfig {\n field: string;\n direction: \"ASC\" | \"DESC\";\n}\n\nconst FOLDER_SORT_FIELDS: Record<string, (folder: FolderDto) => string> = {\n name: f => f.title,\n title: f => f.title,\n createdOn: f => f.createdOn,\n savedOn: f => f.savedOn,\n modifiedOn: f => f.modifiedOn ?? f.savedOn,\n createdBy: f => f.createdBy.displayName,\n savedBy: f => f.savedBy.displayName,\n modifiedBy: f => (f.modifiedBy ? f.modifiedBy.displayName : f.savedBy.displayName)\n};\n\nexport function sortFolders(folders: FolderDto[], sort: FolderSortConfig | undefined): FolderDto[] {\n if (!sort || folders.length === 0) {\n return folders;\n }\n\n const accessor = FOLDER_SORT_FIELDS[sort.field];\n if (!accessor) {\n return folders;\n }\n\n const desc = sort.direction === \"DESC\";\n\n return folders.slice().sort((a, b) => {\n const cmp = accessor(a).localeCompare(accessor(b));\n return desc ? -cmp : cmp;\n });\n}\n"],"names":["createFoldersData","items","item","FOLDER_SORT_FIELDS","f","sortFolders","folders","sort","accessor","desc","a","b","cmp"],"mappings":"AAKO,MAAMA,oBAAoB,CAACC,QACvBA,MAAM,GAAG,CAACC,CAAAA,OAAS;YACtB,IAAIA,KAAK,EAAE;YACX,OAAO;YACP,aAAa;YACb,MAAMA;QACV;AAQJ,MAAMC,qBAAoE;IACtE,MAAMC,CAAAA,IAAKA,EAAE,KAAK;IAClB,OAAOA,CAAAA,IAAKA,EAAE,KAAK;IACnB,WAAWA,CAAAA,IAAKA,EAAE,SAAS;IAC3B,SAASA,CAAAA,IAAKA,EAAE,OAAO;IACvB,YAAYA,CAAAA,IAAKA,EAAE,UAAU,IAAIA,EAAE,OAAO;IAC1C,WAAWA,CAAAA,IAAKA,EAAE,SAAS,CAAC,WAAW;IACvC,SAASA,CAAAA,IAAKA,EAAE,OAAO,CAAC,WAAW;IACnC,YAAYA,CAAAA,IAAMA,EAAE,UAAU,GAAGA,EAAE,UAAU,CAAC,WAAW,GAAGA,EAAE,OAAO,CAAC,WAAW;AACrF;AAEO,SAASC,YAAYC,OAAoB,EAAEC,IAAkC;IAChF,IAAI,CAACA,QAAQD,AAAmB,MAAnBA,QAAQ,MAAM,EACvB,OAAOA;IAGX,MAAME,WAAWL,kBAAkB,CAACI,KAAK,KAAK,CAAC;IAC/C,IAAI,CAACC,UACD,OAAOF;IAGX,MAAMG,OAAOF,AAAmB,WAAnBA,KAAK,SAAS;IAE3B,OAAOD,QAAQ,KAAK,GAAG,IAAI,CAAC,CAACI,GAAGC;QAC5B,MAAMC,MAAMJ,SAASE,GAAG,aAAa,CAACF,SAASG;QAC/C,OAAOF,OAAO,CAACG,MAAMA;IACzB;AACJ"}
@@ -1,3 +1,3 @@
1
- export * from "./components/index.js";
1
+ export { Table, createUseTableRow, TableRowProvider, TableRowContext } from "@webiny/app-admin/components/Table/index.js";
2
+ export { CellAuthor, CellCreated, CellModified } from "@webiny/app-admin/components/Table/cells/index.js";
2
3
  export * from "./createTableData.js";
3
- export * from "./useTableRow.js";
@@ -1,3 +1,3 @@
1
- export * from "./components/index.js";
2
1
  export * from "./createTableData.js";
3
- export * from "./useTableRow.js";
2
+ export { Table, TableRowContext, TableRowProvider, createUseTableRow } from "@webiny/app-admin/components/Table/index.js";
3
+ export { CellAuthor, CellCreated, CellModified } from "@webiny/app-admin/components/Table/cells/index.js";
@@ -1,6 +1,5 @@
1
1
  export * from "./Actions/index.js";
2
2
  export * from "./AdvancedSearch/index.js";
3
- export * from "./Extensions/index.js";
4
3
  export * from "./FolderGrid/index.js";
5
4
  export * from "./FolderIcons/index.js";
6
5
  export * from "./FolderTree/index.js";
@@ -1,6 +1,5 @@
1
1
  export * from "./Actions/index.js";
2
2
  export * from "./AdvancedSearch/index.js";
3
- export * from "./Extensions/index.js";
4
3
  export * from "./FolderGrid/index.js";
5
4
  export * from "./FolderIcons/index.js";
6
5
  export * from "./FolderTree/index.js";
@@ -15,28 +15,24 @@ export declare const AcoConfig: (({ priority, children }: import("@webiny/react-
15
15
  };
16
16
  };
17
17
  Folder: {
18
- Action: (({ name, after, before, remove, element }: import("./folder/Action.js").ActionProps) => import("react").JSX.Element) & {
18
+ Action: typeof import("./folder/Action.js").BaseAction & {
19
19
  OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
20
20
  };
21
- DropConfirmation: ({ value }: import("./folder/DropConfirmation.js").DropConfirmationProps) => import("react").JSX.Element;
21
+ DropConfirmation: typeof import("./folder/DropConfirmation.js").DropConfirmation;
22
22
  };
23
23
  Record: {
24
- Action: (({ name, after, before, remove, element }: import("./record/Action.js").ActionProps) => import("react").JSX.Element) & {
24
+ Action: typeof import("./record/Action.js").BaseAction & {
25
25
  OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
26
26
  OptionsMenuLink: (props: import("@webiny/app-admin/index.js").OptionsMenuLinkProps) => React.JSX.Element;
27
27
  };
28
28
  };
29
29
  Table: {
30
- Column: import("react").FC<import("./table/Column.js").ColumnProps> & {
31
- isFolderRow: (row: import("../table.types.js").TableRow) => row is import("../table.types.js").FolderTableRow;
32
- createUseTableRow: <TBaseRow = Record<string, any>>() => {
33
- (): import("../index.js").TableRowContextData<TBaseRow>;
34
- <TUserRow>(): import("../index.js").TableRowContextData<TBaseRow & {
35
- data: TUserRow;
36
- }>;
37
- };
30
+ Column: import("react").FC<import("@webiny/app-admin/config/table/Column.js").ColumnProps> & {
31
+ createUseTableRow: typeof import("@webiny/app-admin/index.js").createUseTableRow;
32
+ } & {
33
+ isFolderRow: (row: import("@webiny/app-admin/index.js").TableRow) => row is import("../table.types.js").FolderTableRow;
38
34
  };
39
- Sorting: ({ name, field, order }: import("./table/Sorting.js").SortingProps) => import("react").JSX.Element;
35
+ Sorting: ({ name, field, order }: import("@webiny/app-admin/config/table/Sorting.js").SortingProps) => React.JSX.Element;
40
36
  };
41
37
  };
42
38
  export interface AcoConfig {
@@ -10,7 +10,9 @@ export interface FieldRendererProps {
10
10
  element: React.ReactElement;
11
11
  type: FieldType;
12
12
  }
13
- export declare const FieldRenderer: (({ name, type, element }: FieldRendererProps) => React.JSX.Element) & {
13
+ declare const BaseFieldRenderer: ({ name, type, element }: FieldRendererProps) => React.JSX.Element;
14
+ export declare const FieldRenderer: typeof BaseFieldRenderer & {
14
15
  useInputField: () => import("~/components/AdvancedSearch/useInputField.js").InputFieldContext;
15
16
  FieldType: typeof FieldType;
16
17
  };
18
+ export {};
@@ -11,6 +11,6 @@ export interface ActionProps {
11
11
  after?: string;
12
12
  }
13
13
  export declare const BaseAction: ({ name, after, before, remove, element }: ActionProps) => React.JSX.Element;
14
- export declare const Action: (({ name, after, before, remove, element }: ActionProps) => React.JSX.Element) & {
14
+ export declare const Action: typeof BaseAction & {
15
15
  OptionsMenuItem: (props: import("@webiny/app-admin").OptionsMenuItemProps) => React.JSX.Element;
16
16
  };
@@ -1,11 +1,12 @@
1
1
  import type { ActionConfig } from "./Action.js";
2
+ import { DropConfirmation } from "./DropConfirmation.js";
2
3
  export interface FolderConfig {
3
4
  actions: ActionConfig[];
4
5
  dropConfirmation: boolean;
5
6
  }
6
7
  export declare const Folder: {
7
- Action: (({ name, after, before, remove, element }: import("./Action.js").ActionProps) => import("react").JSX.Element) & {
8
+ Action: typeof import("./Action.js").BaseAction & {
8
9
  OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
9
10
  };
10
- DropConfirmation: ({ value }: import("./DropConfirmation.js").DropConfirmationProps) => import("react").JSX.Element;
11
+ DropConfirmation: typeof DropConfirmation;
11
12
  };
package/config/index.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export * from "./AcoConfig.js";
2
- export * from "./folder/createFolderFieldDecoratorFactory.js";
package/config/index.js CHANGED
@@ -1,2 +1 @@
1
1
  export * from "./AcoConfig.js";
2
- export * from "./folder/createFolderFieldDecoratorFactory.js";
@@ -11,7 +11,7 @@ export interface ActionProps {
11
11
  after?: string;
12
12
  }
13
13
  export declare const BaseAction: ({ name, after, before, remove, element }: ActionProps) => React.JSX.Element;
14
- export declare const Action: (({ name, after, before, remove, element }: ActionProps) => React.JSX.Element) & {
14
+ export declare const Action: typeof BaseAction & {
15
15
  OptionsMenuItem: (props: import("@webiny/app-admin").OptionsMenuItemProps) => React.JSX.Element;
16
16
  OptionsMenuLink: (props: import("@webiny/app-admin").OptionsMenuLinkProps) => React.JSX.Element;
17
17
  };
@@ -3,7 +3,7 @@ export interface RecordConfig {
3
3
  actions: ActionConfig[];
4
4
  }
5
5
  export declare const Record: {
6
- Action: (({ name, after, before, remove, element }: import("./Action.js").ActionProps) => import("react").JSX.Element) & {
6
+ Action: typeof import("./Action.js").BaseAction & {
7
7
  OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
8
8
  OptionsMenuLink: (props: import("@webiny/app-admin/index.js").OptionsMenuLinkProps) => React.JSX.Element;
9
9
  };
@@ -1,40 +1,9 @@
1
- import type { ReactElement } from "react";
2
- import React from "react";
3
- import type { FolderTableRow, TableRow } from "../../table.types.js";
4
- export interface ColumnConfig {
5
- cell: string | ReactElement;
6
- className: string;
7
- header: string | ReactElement;
8
- hideable: boolean;
9
- name: string;
10
- resizable: boolean;
11
- size: number;
12
- sortable: boolean;
13
- truncate: boolean;
14
- visible: boolean;
15
- }
16
- export interface ColumnProps {
17
- after?: string;
18
- before?: string;
19
- cell?: string | ReactElement;
20
- className?: string;
21
- truncate?: boolean;
22
- header?: string | ReactElement;
23
- hideable?: boolean;
24
- name: string;
25
- path?: string;
26
- remove?: boolean;
27
- resizable?: boolean;
28
- size?: number;
29
- sortable?: boolean;
30
- visible?: boolean;
31
- }
32
- export declare const Column: React.FC<ColumnProps> & {
33
- isFolderRow: (row: TableRow) => row is FolderTableRow;
34
- createUseTableRow: <TBaseRow = Record<string, any>>() => {
35
- (): import("~/components/Table/useTableRow.js").TableRowContextData<TBaseRow>;
36
- <TUserRow>(): import("~/components/Table/useTableRow.js").TableRowContextData<TBaseRow & {
37
- data: TUserRow;
38
- }>;
39
- };
1
+ import type { TableRow } from "../../table.types.js";
2
+ import type { FolderTableRow } from "../../table.types.js";
3
+ export type { ColumnConfig, ColumnProps } from "@webiny/app-admin/config/table/Column.js";
4
+ declare const isFolderRow: (row: TableRow) => row is FolderTableRow;
5
+ export declare const Column: import("react").FC<import("@webiny/app-admin/config/table/Column.js").ColumnProps> & {
6
+ createUseTableRow: typeof import("@webiny/app-admin/components").createUseTableRow;
7
+ } & {
8
+ isFolderRow: typeof isFolderRow;
40
9
  };