@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.
- package/README.md +4 -4
- package/package.json +3 -3
- package/translations/translations.d.ts +173 -0
- package/translations/translations.js +174 -0
- package/_api/index.d.ts +0 -8
- package/_api/index.js +0 -11
- package/_components/drawer.d.ts +0 -8
- package/_components/drawer.js +0 -19
- package/_store/reducer.d.ts +0 -8
- package/_store/reducer.js +0 -209
- package/_story-utils/data.d.ts +0 -34
- package/_story-utils/data.js +0 -229
- package/_story-utils/grid-type.d.ts +0 -32
- package/_story-utils/grid-type.js +0 -2
- package/_story-utils/json-renderer.d.ts +0 -7
- package/_story-utils/json-renderer.js +0 -12
- package/_story-utils/loader.d.ts +0 -2
- package/_story-utils/loader.js +0 -33
- package/_story-utils/schema.d.ts +0 -3
- package/_story-utils/schema.js +0 -76
- package/body-cell/body-cell-boolean.d.ts +0 -2
- package/body-cell/body-cell-boolean.js +0 -18
- package/body-cell/body-cell-chip.d.ts +0 -12
- package/body-cell/body-cell-chip.js +0 -21
- package/body-cell/body-cell-date.d.ts +0 -2
- package/body-cell/body-cell-date.js +0 -15
- package/body-cell/body-cell-datetime.d.ts +0 -2
- package/body-cell/body-cell-datetime.js +0 -15
- package/body-cell/body-cell-default.d.ts +0 -2
- package/body-cell/body-cell-default.js +0 -17
- package/body-cell/body-cell-email.d.ts +0 -2
- package/body-cell/body-cell-email.js +0 -16
- package/body-cell/body-cell-money.d.ts +0 -8
- package/body-cell/body-cell-money.js +0 -15
- package/body-cell/body-cell-phone.d.ts +0 -2
- package/body-cell/body-cell-phone.js +0 -16
- package/body-cell/body-cell-to-many.d.ts +0 -2
- package/body-cell/body-cell-to-many.js +0 -17
- package/body-cell/body-cell-to-one.d.ts +0 -2
- package/body-cell/body-cell-to-one.js +0 -14
- package/body-cell/body-cell-url.d.ts +0 -2
- package/body-cell/body-cell-url.js +0 -16
- package/body-cell/index.d.ts +0 -2
- package/body-cell/index.js +0 -33
- package/components.d.ts +0 -97
- package/components.js +0 -124
- package/data-grid-custom-example.stories.d.ts +0 -2
- package/data-grid-custom-example.stories.js +0 -58
- package/data-grid-v2.d.ts +0 -3
- package/data-grid-v2.js +0 -41
- package/data-grid-v2.stories.d.ts +0 -2
- package/data-grid-v2.stories.js +0 -99
- package/data-grid.d.ts +0 -3
- package/data-grid.js +0 -42
- package/data-grid.stories.d.ts +0 -2
- package/data-grid.stories.js +0 -106
- package/export-button/export-button.d.ts +0 -8
- package/export-button/export-button.js +0 -16
- package/export-button/export-button.stories.d.ts +0 -2
- package/export-button/export-button.stories.js +0 -17
- package/export-button/index.d.ts +0 -1
- package/export-button/index.js +0 -17
- package/filter-handler/boolean-select.d.ts +0 -4
- package/filter-handler/boolean-select.js +0 -24
- package/filter-handler/checkbox.d.ts +0 -4
- package/filter-handler/checkbox.js +0 -19
- package/filter-handler/date.d.ts +0 -7
- package/filter-handler/date.js +0 -96
- package/filter-handler/datetime.d.ts +0 -7
- package/filter-handler/datetime.js +0 -34
- package/filter-handler/entity-multi-select.d.ts +0 -5
- package/filter-handler/entity-multi-select.js +0 -27
- package/filter-handler/entity-select.d.ts +0 -5
- package/filter-handler/entity-select.js +0 -23
- package/filter-handler/index.d.ts +0 -4
- package/filter-handler/index.js +0 -41
- package/filter-handler/interval.d.ts +0 -7
- package/filter-handler/interval.js +0 -47
- package/filter-handler/multi-select.d.ts +0 -5
- package/filter-handler/multi-select.js +0 -27
- package/filter-handler/select.d.ts +0 -5
- package/filter-handler/select.js +0 -22
- package/filter-handler/string.d.ts +0 -4
- package/filter-handler/string.js +0 -26
- package/filter-handler/types.d.ts +0 -7
- package/filter-handler/types.js +0 -2
- package/filter-list/filter-list.d.ts +0 -10
- package/filter-list/filter-list.js +0 -31
- package/filter-list/filter-list.stories.d.ts +0 -2
- package/filter-list/filter-list.stories.js +0 -18
- package/filter-list/index.d.ts +0 -1
- package/filter-list/index.js +0 -17
- package/filters/filters.d.ts +0 -9
- package/filters/filters.js +0 -21
- package/filters/filters.stories.d.ts +0 -2
- package/filters/filters.stories.js +0 -18
- package/filters/index.d.ts +0 -1
- package/filters/index.js +0 -17
- package/filters-button/filters-button.d.ts +0 -10
- package/filters-button/filters-button.js +0 -45
- package/filters-button/filters-button.stories.d.ts +0 -2
- package/filters-button/filters-button.stories.js +0 -18
- package/filters-button/index.d.ts +0 -1
- package/filters-button/index.js +0 -17
- package/footer/footer.d.ts +0 -5
- package/footer/footer.js +0 -10
- package/footer/index.d.ts +0 -1
- package/footer/index.js +0 -17
- package/fulltext-input/fulltext-input.d.ts +0 -6
- package/fulltext-input/fulltext-input.js +0 -13
- package/fulltext-input/fulltext-input.stories.d.ts +0 -2
- package/fulltext-input/fulltext-input.stories.js +0 -17
- package/fulltext-input/index.d.ts +0 -1
- package/fulltext-input/index.js +0 -17
- package/hidden-columns/hidden-columns.d.ts +0 -8
- package/hidden-columns/hidden-columns.js +0 -35
- package/hidden-columns/hidden-columns.stories.d.ts +0 -2
- package/hidden-columns/hidden-columns.stories.js +0 -17
- package/hidden-columns/index.d.ts +0 -1
- package/hidden-columns/index.js +0 -17
- package/hidden-columns-button/hidden-columns-button.d.ts +0 -8
- package/hidden-columns-button/hidden-columns-button.js +0 -42
- package/hidden-columns-button/hidden-columns-button.stories.d.ts +0 -2
- package/hidden-columns-button/hidden-columns-button.stories.js +0 -17
- package/hidden-columns-button/index.d.ts +0 -1
- package/hidden-columns-button/index.js +0 -17
- package/hooks/useCallbackRef.d.ts +0 -2
- package/hooks/useCallbackRef.js +0 -6
- package/index.d.ts +0 -5
- package/index.js +0 -25
- package/linear-progress/index.d.ts +0 -1
- package/linear-progress/index.js +0 -17
- package/linear-progress/linear-progress.d.ts +0 -5
- package/linear-progress/linear-progress.js +0 -12
- package/pagination/index.d.ts +0 -1
- package/pagination/index.js +0 -17
- package/pagination/pagination.d.ts +0 -12
- package/pagination/pagination.js +0 -15
- package/pagination/pagination.stories.d.ts +0 -2
- package/pagination/pagination.stories.js +0 -17
- package/root/index.d.ts +0 -1
- package/root/index.js +0 -17
- package/root/root.d.ts +0 -6
- package/root/root.js +0 -11
- package/row-counts/index.d.ts +0 -1
- package/row-counts/index.js +0 -17
- package/row-counts/row-counts.d.ts +0 -8
- package/row-counts/row-counts.js +0 -23
- package/row-counts/row-counts.stories.d.ts +0 -2
- package/row-counts/row-counts.stories.js +0 -14
- package/rows-per-page-select/index.d.ts +0 -1
- package/rows-per-page-select/index.js +0 -17
- package/rows-per-page-select/rows-per-page-select.d.ts +0 -3
- package/rows-per-page-select/rows-per-page-select.js +0 -19
- package/rows-per-page-select/rows-per-page-select.stories.d.ts +0 -2
- package/rows-per-page-select/rows-per-page-select.stories.js +0 -17
- package/selected-rows-toolbar/index.d.ts +0 -1
- package/selected-rows-toolbar/index.js +0 -17
- package/selected-rows-toolbar/selected-rows-toolbar.d.ts +0 -11
- package/selected-rows-toolbar/selected-rows-toolbar.js +0 -31
- package/selected-rows-toolbar/selected-rows-toolbar.stories.d.ts +0 -2
- package/selected-rows-toolbar/selected-rows-toolbar.stories.js +0 -44
- package/table/components/action-cell-wrapper.d.ts +0 -6
- package/table/components/action-cell-wrapper.js +0 -57
- package/table/components/action-cell.d.ts +0 -7
- package/table/components/action-cell.js +0 -13
- package/table/components/select-row-checkbox.d.ts +0 -3
- package/table/components/select-row-checkbox.js +0 -40
- package/table/hooks/use-rdg-visuals.d.ts +0 -16
- package/table/hooks/use-rdg-visuals.js +0 -46
- package/table/hooks/use-react-data-grid-columns.d.ts +0 -4
- package/table/hooks/use-react-data-grid-columns.js +0 -86
- package/table/index.d.ts +0 -3
- package/table/index.js +0 -19
- package/table/no-rows-fallback.d.ts +0 -7
- package/table/no-rows-fallback.js +0 -14
- package/table/table.d.ts +0 -4
- package/table/table.js +0 -91
- package/table/table.stories.d.ts +0 -2
- package/table/table.stories.js +0 -20
- package/table/types.d.ts +0 -19
- package/table/types.js +0 -2
- package/table-v2/components/action-cell-wrapper.d.ts +0 -6
- package/table-v2/components/action-cell-wrapper.js +0 -10
- package/table-v2/components/action-cell.d.ts +0 -8
- package/table-v2/components/action-cell.js +0 -16
- package/table-v2/components/body.d.ts +0 -6
- package/table-v2/components/body.js +0 -10
- package/table-v2/components/cell.d.ts +0 -8
- package/table-v2/components/cell.js +0 -10
- package/table-v2/components/header-action-cell.d.ts +0 -2
- package/table-v2/components/header-action-cell.js +0 -10
- package/table-v2/components/header-cell.d.ts +0 -10
- package/table-v2/components/header-cell.js +0 -47
- package/table-v2/components/header-select-all-rows-checkbox.d.ts +0 -8
- package/table-v2/components/header-select-all-rows-checkbox.js +0 -22
- package/table-v2/components/header.d.ts +0 -6
- package/table-v2/components/header.js +0 -10
- package/table-v2/components/index.d.ts +0 -21
- package/table-v2/components/index.js +0 -26
- package/table-v2/components/root.d.ts +0 -7
- package/table-v2/components/root.js +0 -31
- package/table-v2/components/row.d.ts +0 -7
- package/table-v2/components/row.js +0 -11
- package/table-v2/components/select-row-checkbox.d.ts +0 -7
- package/table-v2/components/select-row-checkbox.js +0 -12
- package/table-v2/hooks/use-resizable-columns.d.ts +0 -9
- package/table-v2/hooks/use-resizable-columns.js +0 -69
- package/table-v2/index.d.ts +0 -1
- package/table-v2/index.js +0 -17
- package/table-v2/no-rows-fallback.d.ts +0 -7
- package/table-v2/no-rows-fallback.js +0 -14
- package/table-v2/table-v2.d.ts +0 -3
- package/table-v2/table-v2.js +0 -91
- package/table-v2/table-v2.stories.d.ts +0 -2
- package/table-v2/table-v2.stories.js +0 -23
- package/table-v2/types.d.ts +0 -23
- package/table-v2/types.js +0 -2
- package/table-v2/utils/get-grid-template-columns.d.ts +0 -9
- package/table-v2/utils/get-grid-template-columns.js +0 -23
- package/table-v2/utils/get-grid-template-rows.d.ts +0 -2
- package/table-v2/utils/get-grid-template-rows.js +0 -14
- package/toolbar/index.d.ts +0 -1
- package/toolbar/index.js +0 -17
- package/toolbar/toolbar.d.ts +0 -5
- package/toolbar/toolbar.js +0 -10
- package/toolbar-control/index.d.ts +0 -1
- package/toolbar-control/index.js +0 -17
- package/toolbar-control/toolbar-control.d.ts +0 -13
- package/toolbar-control/toolbar-control.js +0 -22
- package/toolbar-control/toolbar-control.stories.d.ts +0 -2
- package/toolbar-control/toolbar-control.stories.js +0 -19
- package/toolbar-customs/index.d.ts +0 -1
- package/toolbar-customs/index.js +0 -17
- package/toolbar-customs/toolbar-customs.d.ts +0 -13
- package/toolbar-customs/toolbar-customs.js +0 -20
- package/toolbar-customs/toolbar-customs.stories.d.ts +0 -2
- package/toolbar-customs/toolbar-customs.stories.js +0 -15
- package/toolbar-tabs/index.d.ts +0 -1
- package/toolbar-tabs/index.js +0 -17
- package/toolbar-tabs/toolbar-tabs.d.ts +0 -11
- package/toolbar-tabs/toolbar-tabs.js +0 -41
- package/toolbar-tabs/toolbar-tabs.stories.d.ts +0 -2
- package/toolbar-tabs/toolbar-tabs.stories.js +0 -17
- package/types/api.d.ts +0 -23
- package/types/api.js +0 -2
- package/types/components.d.ts +0 -32
- package/types/components.js +0 -2
- package/types/core.d.ts +0 -20
- package/types/core.js +0 -2
- package/types/data-grid-props.d.ts +0 -34
- package/types/data-grid-props.js +0 -2
- package/types/index.d.ts +0 -6
- package/types/index.js +0 -2
- package/types/schema.d.ts +0 -56
- package/types/schema.js +0 -2
- package/types/state.d.ts +0 -25
- package/types/state.js +0 -2
- package/types/user-config-storage-adapter.d.ts +0 -8
- package/types/user-config-storage-adapter.js +0 -2
- package/use-data-grid-control/action.d.ts +0 -47
- package/use-data-grid-control/action.js +0 -9
- package/use-data-grid-control/actions-factory.d.ts +0 -21
- package/use-data-grid-control/actions-factory.js +0 -21
- package/use-data-grid-control/index.d.ts +0 -1
- package/use-data-grid-control/index.js +0 -17
- package/use-data-grid-control/use-data-grid-control.d.ts +0 -32
- package/use-data-grid-control/use-data-grid-control.js +0 -12
- package/use-data-grid-control/use-middleware-reducer.d.ts +0 -3
- package/use-data-grid-control/use-middleware-reducer.js +0 -19
- package/use-data-grid-fetching/index.d.ts +0 -1
- package/use-data-grid-fetching/index.js +0 -17
- package/use-data-grid-fetching/loader.d.ts +0 -2
- package/use-data-grid-fetching/loader.js +0 -6
- package/use-data-grid-fetching/use-data-grid-fetching.d.ts +0 -24
- package/use-data-grid-fetching/use-data-grid-fetching.js +0 -40
- package/user-config-storage-adapters/local-storage.d.ts +0 -3
- package/user-config-storage-adapters/local-storage.js +0 -32
- package/utils/create-filter-component-props.d.ts +0 -4
- package/utils/create-filter-component-props.js +0 -15
- package/utils/get-config-key.d.ts +0 -2
- package/utils/get-config-key.js +0 -6
- package/utils/merge-schema-with-config.d.ts +0 -3
- package/utils/merge-schema-with-config.js +0 -30
- package/utils/merge-schema-with-config.test.d.ts +0 -1
- package/utils/merge-schema-with-config.test.js +0 -57
- package/utils.d.ts +0 -6
- package/utils.js +0 -37
|
@@ -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
|
-
}
|
package/utils/get-config-key.js
DELETED
|
@@ -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
|
-
}
|