@uxf/data-grid 11.72.3 → 11.74.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 (288) hide show
  1. package/README.md +4 -4
  2. package/package.json +3 -3
  3. package/translations/translations.d.ts +173 -0
  4. package/translations/translations.js +174 -0
  5. package/_api/index.d.ts +0 -8
  6. package/_api/index.js +0 -11
  7. package/_components/drawer.d.ts +0 -8
  8. package/_components/drawer.js +0 -19
  9. package/_store/reducer.d.ts +0 -8
  10. package/_store/reducer.js +0 -209
  11. package/_story-utils/data.d.ts +0 -34
  12. package/_story-utils/data.js +0 -229
  13. package/_story-utils/grid-type.d.ts +0 -32
  14. package/_story-utils/grid-type.js +0 -2
  15. package/_story-utils/json-renderer.d.ts +0 -7
  16. package/_story-utils/json-renderer.js +0 -12
  17. package/_story-utils/loader.d.ts +0 -2
  18. package/_story-utils/loader.js +0 -33
  19. package/_story-utils/schema.d.ts +0 -3
  20. package/_story-utils/schema.js +0 -76
  21. package/body-cell/body-cell-boolean.d.ts +0 -2
  22. package/body-cell/body-cell-boolean.js +0 -18
  23. package/body-cell/body-cell-chip.d.ts +0 -12
  24. package/body-cell/body-cell-chip.js +0 -21
  25. package/body-cell/body-cell-date.d.ts +0 -2
  26. package/body-cell/body-cell-date.js +0 -15
  27. package/body-cell/body-cell-datetime.d.ts +0 -2
  28. package/body-cell/body-cell-datetime.js +0 -15
  29. package/body-cell/body-cell-default.d.ts +0 -2
  30. package/body-cell/body-cell-default.js +0 -17
  31. package/body-cell/body-cell-email.d.ts +0 -2
  32. package/body-cell/body-cell-email.js +0 -16
  33. package/body-cell/body-cell-money.d.ts +0 -8
  34. package/body-cell/body-cell-money.js +0 -15
  35. package/body-cell/body-cell-phone.d.ts +0 -2
  36. package/body-cell/body-cell-phone.js +0 -16
  37. package/body-cell/body-cell-to-many.d.ts +0 -2
  38. package/body-cell/body-cell-to-many.js +0 -17
  39. package/body-cell/body-cell-to-one.d.ts +0 -2
  40. package/body-cell/body-cell-to-one.js +0 -14
  41. package/body-cell/body-cell-url.d.ts +0 -2
  42. package/body-cell/body-cell-url.js +0 -16
  43. package/body-cell/index.d.ts +0 -2
  44. package/body-cell/index.js +0 -33
  45. package/components.d.ts +0 -97
  46. package/components.js +0 -124
  47. package/data-grid-custom-example.stories.d.ts +0 -2
  48. package/data-grid-custom-example.stories.js +0 -58
  49. package/data-grid-v2.d.ts +0 -3
  50. package/data-grid-v2.js +0 -41
  51. package/data-grid-v2.stories.d.ts +0 -2
  52. package/data-grid-v2.stories.js +0 -99
  53. package/data-grid.d.ts +0 -3
  54. package/data-grid.js +0 -42
  55. package/data-grid.stories.d.ts +0 -2
  56. package/data-grid.stories.js +0 -106
  57. package/export-button/export-button.d.ts +0 -8
  58. package/export-button/export-button.js +0 -16
  59. package/export-button/export-button.stories.d.ts +0 -2
  60. package/export-button/export-button.stories.js +0 -17
  61. package/export-button/index.d.ts +0 -1
  62. package/export-button/index.js +0 -17
  63. package/filter-handler/boolean-select.d.ts +0 -4
  64. package/filter-handler/boolean-select.js +0 -24
  65. package/filter-handler/checkbox.d.ts +0 -4
  66. package/filter-handler/checkbox.js +0 -19
  67. package/filter-handler/date.d.ts +0 -7
  68. package/filter-handler/date.js +0 -96
  69. package/filter-handler/datetime.d.ts +0 -7
  70. package/filter-handler/datetime.js +0 -34
  71. package/filter-handler/entity-multi-select.d.ts +0 -5
  72. package/filter-handler/entity-multi-select.js +0 -27
  73. package/filter-handler/entity-select.d.ts +0 -5
  74. package/filter-handler/entity-select.js +0 -23
  75. package/filter-handler/index.d.ts +0 -4
  76. package/filter-handler/index.js +0 -41
  77. package/filter-handler/interval.d.ts +0 -7
  78. package/filter-handler/interval.js +0 -47
  79. package/filter-handler/multi-select.d.ts +0 -5
  80. package/filter-handler/multi-select.js +0 -27
  81. package/filter-handler/select.d.ts +0 -5
  82. package/filter-handler/select.js +0 -22
  83. package/filter-handler/string.d.ts +0 -4
  84. package/filter-handler/string.js +0 -26
  85. package/filter-handler/types.d.ts +0 -7
  86. package/filter-handler/types.js +0 -2
  87. package/filter-list/filter-list.d.ts +0 -10
  88. package/filter-list/filter-list.js +0 -31
  89. package/filter-list/filter-list.stories.d.ts +0 -2
  90. package/filter-list/filter-list.stories.js +0 -18
  91. package/filter-list/index.d.ts +0 -1
  92. package/filter-list/index.js +0 -17
  93. package/filters/filters.d.ts +0 -9
  94. package/filters/filters.js +0 -21
  95. package/filters/filters.stories.d.ts +0 -2
  96. package/filters/filters.stories.js +0 -18
  97. package/filters/index.d.ts +0 -1
  98. package/filters/index.js +0 -17
  99. package/filters-button/filters-button.d.ts +0 -10
  100. package/filters-button/filters-button.js +0 -45
  101. package/filters-button/filters-button.stories.d.ts +0 -2
  102. package/filters-button/filters-button.stories.js +0 -18
  103. package/filters-button/index.d.ts +0 -1
  104. package/filters-button/index.js +0 -17
  105. package/footer/footer.d.ts +0 -5
  106. package/footer/footer.js +0 -10
  107. package/footer/index.d.ts +0 -1
  108. package/footer/index.js +0 -17
  109. package/fulltext-input/fulltext-input.d.ts +0 -6
  110. package/fulltext-input/fulltext-input.js +0 -13
  111. package/fulltext-input/fulltext-input.stories.d.ts +0 -2
  112. package/fulltext-input/fulltext-input.stories.js +0 -17
  113. package/fulltext-input/index.d.ts +0 -1
  114. package/fulltext-input/index.js +0 -17
  115. package/hidden-columns/hidden-columns.d.ts +0 -8
  116. package/hidden-columns/hidden-columns.js +0 -35
  117. package/hidden-columns/hidden-columns.stories.d.ts +0 -2
  118. package/hidden-columns/hidden-columns.stories.js +0 -17
  119. package/hidden-columns/index.d.ts +0 -1
  120. package/hidden-columns/index.js +0 -17
  121. package/hidden-columns-button/hidden-columns-button.d.ts +0 -8
  122. package/hidden-columns-button/hidden-columns-button.js +0 -42
  123. package/hidden-columns-button/hidden-columns-button.stories.d.ts +0 -2
  124. package/hidden-columns-button/hidden-columns-button.stories.js +0 -17
  125. package/hidden-columns-button/index.d.ts +0 -1
  126. package/hidden-columns-button/index.js +0 -17
  127. package/hooks/useCallbackRef.d.ts +0 -2
  128. package/hooks/useCallbackRef.js +0 -6
  129. package/index.d.ts +0 -5
  130. package/index.js +0 -25
  131. package/linear-progress/index.d.ts +0 -1
  132. package/linear-progress/index.js +0 -17
  133. package/linear-progress/linear-progress.d.ts +0 -5
  134. package/linear-progress/linear-progress.js +0 -12
  135. package/pagination/index.d.ts +0 -1
  136. package/pagination/index.js +0 -17
  137. package/pagination/pagination.d.ts +0 -12
  138. package/pagination/pagination.js +0 -15
  139. package/pagination/pagination.stories.d.ts +0 -2
  140. package/pagination/pagination.stories.js +0 -17
  141. package/root/index.d.ts +0 -1
  142. package/root/index.js +0 -17
  143. package/root/root.d.ts +0 -6
  144. package/root/root.js +0 -11
  145. package/row-counts/index.d.ts +0 -1
  146. package/row-counts/index.js +0 -17
  147. package/row-counts/row-counts.d.ts +0 -8
  148. package/row-counts/row-counts.js +0 -23
  149. package/row-counts/row-counts.stories.d.ts +0 -2
  150. package/row-counts/row-counts.stories.js +0 -14
  151. package/rows-per-page-select/index.d.ts +0 -1
  152. package/rows-per-page-select/index.js +0 -17
  153. package/rows-per-page-select/rows-per-page-select.d.ts +0 -3
  154. package/rows-per-page-select/rows-per-page-select.js +0 -19
  155. package/rows-per-page-select/rows-per-page-select.stories.d.ts +0 -2
  156. package/rows-per-page-select/rows-per-page-select.stories.js +0 -17
  157. package/selected-rows-toolbar/index.d.ts +0 -1
  158. package/selected-rows-toolbar/index.js +0 -17
  159. package/selected-rows-toolbar/selected-rows-toolbar.d.ts +0 -11
  160. package/selected-rows-toolbar/selected-rows-toolbar.js +0 -31
  161. package/selected-rows-toolbar/selected-rows-toolbar.stories.d.ts +0 -2
  162. package/selected-rows-toolbar/selected-rows-toolbar.stories.js +0 -44
  163. package/table/components/action-cell-wrapper.d.ts +0 -6
  164. package/table/components/action-cell-wrapper.js +0 -57
  165. package/table/components/action-cell.d.ts +0 -7
  166. package/table/components/action-cell.js +0 -13
  167. package/table/components/select-row-checkbox.d.ts +0 -3
  168. package/table/components/select-row-checkbox.js +0 -40
  169. package/table/hooks/use-rdg-visuals.d.ts +0 -16
  170. package/table/hooks/use-rdg-visuals.js +0 -46
  171. package/table/hooks/use-react-data-grid-columns.d.ts +0 -4
  172. package/table/hooks/use-react-data-grid-columns.js +0 -86
  173. package/table/index.d.ts +0 -3
  174. package/table/index.js +0 -19
  175. package/table/no-rows-fallback.d.ts +0 -7
  176. package/table/no-rows-fallback.js +0 -14
  177. package/table/table.d.ts +0 -4
  178. package/table/table.js +0 -91
  179. package/table/table.stories.d.ts +0 -2
  180. package/table/table.stories.js +0 -20
  181. package/table/types.d.ts +0 -19
  182. package/table/types.js +0 -2
  183. package/table-v2/components/action-cell-wrapper.d.ts +0 -6
  184. package/table-v2/components/action-cell-wrapper.js +0 -10
  185. package/table-v2/components/action-cell.d.ts +0 -8
  186. package/table-v2/components/action-cell.js +0 -16
  187. package/table-v2/components/body.d.ts +0 -6
  188. package/table-v2/components/body.js +0 -10
  189. package/table-v2/components/cell.d.ts +0 -8
  190. package/table-v2/components/cell.js +0 -10
  191. package/table-v2/components/header-action-cell.d.ts +0 -2
  192. package/table-v2/components/header-action-cell.js +0 -10
  193. package/table-v2/components/header-cell.d.ts +0 -10
  194. package/table-v2/components/header-cell.js +0 -47
  195. package/table-v2/components/header-select-all-rows-checkbox.d.ts +0 -8
  196. package/table-v2/components/header-select-all-rows-checkbox.js +0 -22
  197. package/table-v2/components/header.d.ts +0 -6
  198. package/table-v2/components/header.js +0 -10
  199. package/table-v2/components/index.d.ts +0 -21
  200. package/table-v2/components/index.js +0 -26
  201. package/table-v2/components/root.d.ts +0 -7
  202. package/table-v2/components/root.js +0 -31
  203. package/table-v2/components/row.d.ts +0 -7
  204. package/table-v2/components/row.js +0 -11
  205. package/table-v2/components/select-row-checkbox.d.ts +0 -7
  206. package/table-v2/components/select-row-checkbox.js +0 -12
  207. package/table-v2/hooks/use-resizable-columns.d.ts +0 -9
  208. package/table-v2/hooks/use-resizable-columns.js +0 -69
  209. package/table-v2/index.d.ts +0 -1
  210. package/table-v2/index.js +0 -17
  211. package/table-v2/no-rows-fallback.d.ts +0 -7
  212. package/table-v2/no-rows-fallback.js +0 -14
  213. package/table-v2/table-v2.d.ts +0 -3
  214. package/table-v2/table-v2.js +0 -91
  215. package/table-v2/table-v2.stories.d.ts +0 -2
  216. package/table-v2/table-v2.stories.js +0 -23
  217. package/table-v2/types.d.ts +0 -23
  218. package/table-v2/types.js +0 -2
  219. package/table-v2/utils/get-grid-template-columns.d.ts +0 -9
  220. package/table-v2/utils/get-grid-template-columns.js +0 -23
  221. package/table-v2/utils/get-grid-template-rows.d.ts +0 -2
  222. package/table-v2/utils/get-grid-template-rows.js +0 -14
  223. package/toolbar/index.d.ts +0 -1
  224. package/toolbar/index.js +0 -17
  225. package/toolbar/toolbar.d.ts +0 -5
  226. package/toolbar/toolbar.js +0 -10
  227. package/toolbar-control/index.d.ts +0 -1
  228. package/toolbar-control/index.js +0 -17
  229. package/toolbar-control/toolbar-control.d.ts +0 -13
  230. package/toolbar-control/toolbar-control.js +0 -22
  231. package/toolbar-control/toolbar-control.stories.d.ts +0 -2
  232. package/toolbar-control/toolbar-control.stories.js +0 -19
  233. package/toolbar-customs/index.d.ts +0 -1
  234. package/toolbar-customs/index.js +0 -17
  235. package/toolbar-customs/toolbar-customs.d.ts +0 -13
  236. package/toolbar-customs/toolbar-customs.js +0 -20
  237. package/toolbar-customs/toolbar-customs.stories.d.ts +0 -2
  238. package/toolbar-customs/toolbar-customs.stories.js +0 -15
  239. package/toolbar-tabs/index.d.ts +0 -1
  240. package/toolbar-tabs/index.js +0 -17
  241. package/toolbar-tabs/toolbar-tabs.d.ts +0 -11
  242. package/toolbar-tabs/toolbar-tabs.js +0 -41
  243. package/toolbar-tabs/toolbar-tabs.stories.d.ts +0 -2
  244. package/toolbar-tabs/toolbar-tabs.stories.js +0 -17
  245. package/types/api.d.ts +0 -23
  246. package/types/api.js +0 -2
  247. package/types/components.d.ts +0 -32
  248. package/types/components.js +0 -2
  249. package/types/core.d.ts +0 -20
  250. package/types/core.js +0 -2
  251. package/types/data-grid-props.d.ts +0 -34
  252. package/types/data-grid-props.js +0 -2
  253. package/types/index.d.ts +0 -6
  254. package/types/index.js +0 -2
  255. package/types/schema.d.ts +0 -56
  256. package/types/schema.js +0 -2
  257. package/types/state.d.ts +0 -25
  258. package/types/state.js +0 -2
  259. package/types/user-config-storage-adapter.d.ts +0 -8
  260. package/types/user-config-storage-adapter.js +0 -2
  261. package/use-data-grid-control/action.d.ts +0 -47
  262. package/use-data-grid-control/action.js +0 -9
  263. package/use-data-grid-control/actions-factory.d.ts +0 -21
  264. package/use-data-grid-control/actions-factory.js +0 -21
  265. package/use-data-grid-control/index.d.ts +0 -1
  266. package/use-data-grid-control/index.js +0 -17
  267. package/use-data-grid-control/use-data-grid-control.d.ts +0 -32
  268. package/use-data-grid-control/use-data-grid-control.js +0 -12
  269. package/use-data-grid-control/use-middleware-reducer.d.ts +0 -3
  270. package/use-data-grid-control/use-middleware-reducer.js +0 -19
  271. package/use-data-grid-fetching/index.d.ts +0 -1
  272. package/use-data-grid-fetching/index.js +0 -17
  273. package/use-data-grid-fetching/loader.d.ts +0 -2
  274. package/use-data-grid-fetching/loader.js +0 -6
  275. package/use-data-grid-fetching/use-data-grid-fetching.d.ts +0 -24
  276. package/use-data-grid-fetching/use-data-grid-fetching.js +0 -40
  277. package/user-config-storage-adapters/local-storage.d.ts +0 -3
  278. package/user-config-storage-adapters/local-storage.js +0 -32
  279. package/utils/create-filter-component-props.d.ts +0 -4
  280. package/utils/create-filter-component-props.js +0 -15
  281. package/utils/get-config-key.d.ts +0 -2
  282. package/utils/get-config-key.js +0 -6
  283. package/utils/merge-schema-with-config.d.ts +0 -3
  284. package/utils/merge-schema-with-config.js +0 -30
  285. package/utils/merge-schema-with-config.test.d.ts +0 -1
  286. package/utils/merge-schema-with-config.test.js +0 -57
  287. package/utils.d.ts +0 -6
  288. package/utils.js +0 -37
@@ -1,3 +0,0 @@
1
- import { Schema } from "../types";
2
- import { UserConfigStorageAdapter } from "../types/user-config-storage-adapter";
3
- export declare function useUserConfigLocalStorageAdapter(schema: Schema<any>): UserConfigStorageAdapter;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useUserConfigLocalStorageAdapter = useUserConfigLocalStorageAdapter;
4
- const react_1 = require("react");
5
- const action_1 = require("../use-data-grid-control/action");
6
- const get_config_key_1 = require("../utils/get-config-key");
7
- const isObject = (value) => typeof value === "function" || (typeof value === "object" && Boolean(value));
8
- function useUserConfigLocalStorageAdapter(schema) {
9
- const configKey = (0, get_config_key_1.getConfigKey)(schema);
10
- return (0, react_1.useMemo)(() => ({
11
- middleware: (newState, action) => {
12
- if (action_1.ACTIONS_CHANGING_USER_CONFIG.includes(action.type)) {
13
- window.localStorage.setItem(configKey, JSON.stringify(newState.userConfig));
14
- }
15
- },
16
- useUserConfig: (actions) => {
17
- (0, react_1.useEffect)(() => {
18
- var _a;
19
- let config = null;
20
- try {
21
- config = JSON.parse((_a = window.localStorage.getItem(configKey)) !== null && _a !== void 0 ? _a : "{}");
22
- }
23
- catch {
24
- // ignore
25
- }
26
- if (isObject(config) && config !== null) {
27
- actions.reinitializeUserConfig(config);
28
- }
29
- }, [actions]);
30
- },
31
- }), [configKey]);
32
- }
@@ -1,4 +0,0 @@
1
- import { FilterProps } from "../types/components";
2
- import { Filter } from "../types/schema";
3
- import { DataGridControl } from "../use-data-grid-control";
4
- export declare function createFilterComponentProps(gridName: string | undefined, filter: Filter, state: DataGridControl["state"], actions: DataGridControl["actions"]): FilterProps<any>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFilterComponentProps = createFilterComponentProps;
4
- const is_nil_1 = require("@uxf/core/utils/is-nil");
5
- function createFilterComponentProps(gridName, filter, state, actions) {
6
- const requestFilter = state.request.f.find((f) => f.name === filter.name);
7
- return {
8
- filter,
9
- value: requestFilter === null || requestFilter === void 0 ? void 0 : requestFilter.value,
10
- op: requestFilter === null || requestFilter === void 0 ? void 0 : requestFilter.op,
11
- gridName,
12
- onChange: (value, op) => (0, is_nil_1.isNil)(value) ? actions.filterClear(filter.name) : actions.filter(filter.name, value, op),
13
- onClear: () => actions.filterClear(filter.name),
14
- };
15
- }
@@ -1,2 +0,0 @@
1
- import { Schema } from "../types";
2
- export declare function getConfigKey(schema: Schema<any>): string;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfigKey = getConfigKey;
4
- function getConfigKey(schema) {
5
- return `data-grid-config__v2__${schema.name}`;
6
- }
@@ -1,3 +0,0 @@
1
- import { BaseGridType, Schema } from "../types/schema";
2
- import { DataGridFrontendConfig } from "../types/state";
3
- export declare function mergeSchemaWithConfig<GridType extends BaseGridType>(schema: Schema<GridType>, frontendConfig: DataGridFrontendConfig<GridType>): Schema<GridType>;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mergeSchemaWithConfig = mergeSchemaWithConfig;
4
- function mergeSchemaWithConfig(schema, frontendConfig) {
5
- var _a;
6
- return {
7
- ...schema,
8
- perPage: (_a = frontendConfig.perPage) !== null && _a !== void 0 ? _a : schema.perPage,
9
- columns: schema.columns.map((column) => {
10
- var _a;
11
- return ({
12
- ...column,
13
- config: {
14
- ...column.config,
15
- ...(_a = frontendConfig.columns) === null || _a === void 0 ? void 0 : _a[column.name],
16
- },
17
- });
18
- }),
19
- filters: schema.filters.map((filter) => {
20
- var _a;
21
- return ({
22
- ...filter,
23
- config: {
24
- ...filter.config,
25
- ...(_a = frontendConfig.filters) === null || _a === void 0 ? void 0 : _a[filter.name],
26
- },
27
- });
28
- }),
29
- };
30
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const merge_schema_with_config_1 = require("./merge-schema-with-config");
4
- const schema = {
5
- name: "test",
6
- columns: [
7
- { name: "id", type: "integer", label: "ID", config: { width: 50, isHidden: true } },
8
- { name: "name", type: "string", label: "Name", config: {} },
9
- ],
10
- filters: [{ name: "id", type: "integer", label: "ID", config: { placeholder: "Placeholder" } }],
11
- tabs: [],
12
- s: { name: "id", dir: "asc" },
13
- fullText: false,
14
- perPage: 10,
15
- };
16
- test("merge perPage", () => {
17
- expect((0, merge_schema_with_config_1.mergeSchemaWithConfig)(schema, { perPage: 100 })).toStrictEqual({
18
- name: "test",
19
- columns: [
20
- { name: "id", type: "integer", label: "ID", config: { width: 50, isHidden: true } },
21
- { name: "name", type: "string", label: "Name", config: {} },
22
- ],
23
- filters: [{ name: "id", type: "integer", label: "ID", config: { placeholder: "Placeholder" } }],
24
- tabs: [],
25
- s: { name: "id", dir: "asc" },
26
- fullText: false,
27
- perPage: 100,
28
- });
29
- });
30
- test("merge columns", () => {
31
- expect((0, merge_schema_with_config_1.mergeSchemaWithConfig)(schema, { columns: { id: { width: 100 } } })).toStrictEqual({
32
- name: "test",
33
- columns: [
34
- { name: "id", type: "integer", label: "ID", config: { width: 100, isHidden: true } },
35
- { name: "name", type: "string", label: "Name", config: {} },
36
- ],
37
- filters: [{ name: "id", type: "integer", label: "ID", config: { placeholder: "Placeholder" } }],
38
- tabs: [],
39
- s: { name: "id", dir: "asc" },
40
- fullText: false,
41
- perPage: 10,
42
- });
43
- });
44
- test("merge filters", () => {
45
- expect((0, merge_schema_with_config_1.mergeSchemaWithConfig)(schema, { filters: { id: { placeholder: "CHANGED Placeholder" } } })).toStrictEqual({
46
- name: "test",
47
- columns: [
48
- { name: "id", type: "integer", label: "ID", config: { width: 50, isHidden: true } },
49
- { name: "name", type: "string", label: "Name", config: {} },
50
- ],
51
- filters: [{ name: "id", type: "integer", label: "ID", config: { placeholder: "CHANGED Placeholder" } }],
52
- tabs: [],
53
- s: { name: "id", dir: "asc" },
54
- fullText: false,
55
- perPage: 10,
56
- });
57
- });
package/utils.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { GridRequest, Request } from "./types";
2
- export declare function decodeFilter(filterString: string): null | Request;
3
- export declare function encodeFilter(request: Request): string;
4
- export declare function createRequest(request: GridRequest, config?: {
5
- isWithTabCounts?: true;
6
- } | undefined): Request;
package/utils.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decodeFilter = decodeFilter;
4
- exports.encodeFilter = encodeFilter;
5
- exports.createRequest = createRequest;
6
- function decodeFilter(filterString) {
7
- var _a, _b;
8
- try {
9
- const filter = JSON.parse(decodeURIComponent(escape(atob(filterString))));
10
- return {
11
- f: filter.f || [],
12
- perPage: filter.perPage || 10,
13
- page: filter.page || 0,
14
- s: filter.s,
15
- tab: (_a = filter.tab) !== null && _a !== void 0 ? _a : null,
16
- search: (_b = filter.search) !== null && _b !== void 0 ? _b : "",
17
- };
18
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
19
- }
20
- catch (e) {
21
- return null;
22
- }
23
- }
24
- function encodeFilter(request) {
25
- return btoa(unescape(encodeURIComponent(JSON.stringify(request))));
26
- }
27
- function createRequest(request, config = undefined) {
28
- return {
29
- perPage: request.perPage,
30
- page: request.page,
31
- f: request.f.filter((f) => f.value !== undefined && f.value !== null && f.value !== ""),
32
- s: request.s || undefined,
33
- search: request.search,
34
- tab: request.tab,
35
- withTabCounts: config === null || config === void 0 ? void 0 : config.isWithTabCounts,
36
- };
37
- }