@uxf/data-grid 10.0.2 → 11.0.0-beta.1
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/_store/reducer.d.ts +8 -0
- package/{store → _store}/reducer.js +33 -19
- package/_story-utils/data.d.ts +12 -0
- package/_story-utils/data.js +115 -0
- package/_story-utils/grid-type.d.ts +22 -0
- package/_story-utils/grid-type.js +2 -0
- package/_story-utils/loader.d.ts +2 -0
- package/_story-utils/loader.js +36 -0
- package/_story-utils/schema.d.ts +3 -0
- package/_story-utils/schema.js +53 -0
- package/{tailwindui/body-cell → body-cell}/body-cell-boolean.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/body-cell-date.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/body-cell-datetime.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/body-cell-default.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/body-cell-email.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/body-cell-phone.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/body-cell-to-many.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/body-cell-to-one.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/body-cell-url.d.ts +1 -1
- package/{tailwindui/body-cell → body-cell}/index.d.ts +1 -1
- package/data-grid.d.ts +1 -1
- package/data-grid.js +34 -120
- package/data-grid.stories.d.ts +0 -5
- package/data-grid.stories.js +14 -216
- package/export-button/export-button.d.ts +10 -0
- package/export-button/export-button.js +15 -0
- package/export-button/export-button.stories.d.ts +2 -0
- package/export-button/export-button.stories.js +18 -0
- package/export-button/index.d.ts +1 -0
- package/{tailwindui → export-button}/index.js +1 -3
- package/{tailwindui/filter-handler → filter-handler}/bool-filter.d.ts +1 -1
- package/{tailwindui/filter-handler → filter-handler}/boolean-filter.d.ts +1 -1
- package/filter-handler/index.d.ts +4 -0
- package/{tailwindui/filter-handler → filter-handler}/index.js +15 -0
- package/{tailwindui/filter-handler → filter-handler}/interval-filter.d.ts +1 -1
- package/{tailwindui/filter-handler → filter-handler}/interval-filter.js +2 -2
- package/{tailwindui/filter-handler → filter-handler}/select-filter.d.ts +1 -1
- package/{tailwindui/filter-handler → filter-handler}/text-filter.d.ts +1 -1
- package/filter-handler/types.d.ts +8 -0
- package/filter-handler/types.js +2 -0
- package/filter-list/filter-list.d.ts +11 -0
- package/{tailwindui/components → filter-list}/filter-list.js +7 -6
- package/filter-list/filter-list.stories.d.ts +2 -0
- package/filter-list/filter-list.stories.js +19 -0
- package/filter-list/index.d.ts +1 -0
- package/filter-list/index.js +17 -0
- package/filters/filters.d.ts +11 -0
- package/filters/filters.js +25 -0
- package/filters/filters.stories.d.ts +2 -0
- package/filters/filters.stories.js +19 -0
- package/filters/index.d.ts +1 -0
- package/filters/index.js +17 -0
- package/filters-button/filters-button.d.ts +11 -0
- package/{tailwindui/show.js → filters-button/filters-button.js} +15 -6
- package/filters-button/filters-button.stories.d.ts +2 -0
- package/filters-button/filters-button.stories.js +19 -0
- package/filters-button/index.d.ts +1 -0
- package/filters-button/index.js +17 -0
- package/fulltext-input/fulltext-input.d.ts +5 -0
- package/fulltext-input/fulltext-input.js +13 -0
- package/fulltext-input/fulltext-input.stories.d.ts +2 -0
- package/fulltext-input/fulltext-input.stories.js +18 -0
- package/fulltext-input/index.d.ts +1 -0
- package/fulltext-input/index.js +17 -0
- package/hidden-columns/hidden-columns.d.ts +8 -0
- package/hidden-columns/hidden-columns.js +17 -0
- package/hidden-columns/hidden-columns.stories.d.ts +2 -0
- package/hidden-columns/hidden-columns.stories.js +18 -0
- package/hidden-columns/index.d.ts +1 -0
- package/hidden-columns/index.js +17 -0
- package/hidden-columns-button/hidden-columns-button.d.ts +8 -0
- package/{tailwindui/data-grid.js → hidden-columns-button/hidden-columns-button.js} +14 -10
- package/hidden-columns-button/hidden-columns-button.stories.d.ts +2 -0
- package/hidden-columns-button/hidden-columns-button.stories.js +18 -0
- package/hidden-columns-button/index.d.ts +1 -0
- package/hidden-columns-button/index.js +17 -0
- package/linear-progress/index.d.ts +1 -0
- package/linear-progress/index.js +17 -0
- package/linear-progress/linear-progress.d.ts +5 -0
- package/{tailwindui/components → linear-progress}/linear-progress.js +4 -4
- package/package.json +2 -2
- package/pagination/index.d.ts +1 -0
- package/pagination/index.js +17 -0
- package/pagination/pagination.d.ts +8 -0
- package/pagination/pagination.js +16 -0
- package/pagination/pagination.stories.d.ts +2 -0
- package/pagination/pagination.stories.js +18 -0
- package/row-counts/index.d.ts +1 -0
- package/row-counts/index.js +17 -0
- package/row-counts/row-counts.d.ts +7 -0
- package/row-counts/row-counts.js +18 -0
- package/row-counts/row-counts.stories.d.ts +2 -0
- package/row-counts/row-counts.stories.js +15 -0
- package/rows-per-page-select/index.d.ts +1 -0
- package/rows-per-page-select/index.js +17 -0
- package/rows-per-page-select/rows-per-page-select.d.ts +3 -0
- package/{tailwindui/components/pagination-rows-per-page-select.js → rows-per-page-select/rows-per-page-select.js} +5 -5
- package/rows-per-page-select/rows-per-page-select.stories.d.ts +2 -0
- package/rows-per-page-select/rows-per-page-select.stories.js +18 -0
- package/selected-rows-toolbar/index.d.ts +1 -0
- package/selected-rows-toolbar/index.js +17 -0
- package/selected-rows-toolbar/selected-rows-toolbar.d.ts +11 -0
- package/{tailwindui/components → selected-rows-toolbar}/selected-rows-toolbar.js +9 -6
- package/selected-rows-toolbar/selected-rows-toolbar.stories.d.ts +2 -0
- package/{tailwindui/components/select-row-checkbox.js → selected-rows-toolbar/selected-rows-toolbar.stories.js} +15 -14
- package/table/components/select-row-checkbox.d.ts +3 -0
- package/table/components/select-row-checkbox.js +20 -0
- package/table/hooks/use-react-data-grid-columns.d.ts +3 -0
- package/table/hooks/use-react-data-grid-columns.js +92 -0
- package/table/index.d.ts +1 -0
- package/table/index.js +17 -0
- package/table/no-rows-fallback.d.ts +7 -0
- package/{tailwindui/components → table}/no-rows-fallback.js +4 -4
- package/table/table.d.ts +3 -0
- package/table/table.js +80 -0
- package/table/table.stories.d.ts +2 -0
- package/table/table.stories.js +20 -0
- package/table/types.d.ts +26 -0
- package/table/types.js +2 -0
- package/toolbar-control/index.d.ts +1 -0
- package/toolbar-control/index.js +17 -0
- package/toolbar-control/toolbar-control.d.ts +13 -0
- package/toolbar-control/toolbar-control.js +22 -0
- package/toolbar-control/toolbar-control.stories.d.ts +2 -0
- package/toolbar-control/toolbar-control.stories.js +20 -0
- package/toolbar-customs/index.d.ts +1 -0
- package/toolbar-customs/index.js +17 -0
- package/toolbar-customs/toolbar-customs.d.ts +10 -0
- package/{tailwindui/components → toolbar-customs}/toolbar-customs.js +2 -2
- package/toolbar-customs/toolbar-customs.stories.d.ts +2 -0
- package/toolbar-customs/toolbar-customs.stories.js +16 -0
- package/toolbar-tabs/index.d.ts +1 -0
- package/toolbar-tabs/index.js +17 -0
- package/toolbar-tabs/toolbar-tabs.d.ts +7 -0
- package/{tailwindui/components → toolbar-tabs}/toolbar-tabs.js +10 -10
- package/toolbar-tabs/toolbar-tabs.stories.d.ts +2 -0
- package/toolbar-tabs/toolbar-tabs.stories.js +18 -0
- package/types/components.d.ts +5 -160
- package/types/data-grid-props.d.ts +16 -23
- package/types/state.d.ts +7 -3
- package/types/ui-components.d.ts +7 -16
- package/use-data-grid-control/actions-factory.d.ts +14 -0
- package/use-data-grid-control/actions-factory.js +18 -0
- package/use-data-grid-control/index.d.ts +1 -0
- package/use-data-grid-control/index.js +17 -0
- package/use-data-grid-control/use-data-grid-control.d.ts +19 -0
- package/use-data-grid-control/use-data-grid-control.js +12 -0
- package/use-data-grid-fetching/index.d.ts +1 -0
- package/use-data-grid-fetching/index.js +17 -0
- package/use-data-grid-fetching/use-data-grid-fetching.d.ts +16 -0
- package/use-data-grid-fetching/use-data-grid-fetching.js +37 -0
- package/utils/classes.d.ts +1 -0
- package/utils/classes.js +4 -0
- package/utils.d.ts +4 -5
- package/utils.js +9 -60
- package/hooks/useColumns.d.ts +0 -3
- package/hooks/useColumns.js +0 -97
- package/store/reducer.d.ts +0 -5
- package/tailwindui/components/container.d.ts +0 -2
- package/tailwindui/components/container.js +0 -13
- package/tailwindui/components/filter-list.d.ts +0 -2
- package/tailwindui/components/footer.d.ts +0 -2
- package/tailwindui/components/footer.js +0 -12
- package/tailwindui/components/linear-progress.d.ts +0 -2
- package/tailwindui/components/no-rows-fallback.d.ts +0 -2
- package/tailwindui/components/pagination-counts.d.ts +0 -2
- package/tailwindui/components/pagination-counts.js +0 -18
- package/tailwindui/components/pagination-rows-per-page-select.d.ts +0 -2
- package/tailwindui/components/select-row-checkbox.d.ts +0 -2
- package/tailwindui/components/selected-rows-toolbar.d.ts +0 -2
- package/tailwindui/components/toolbar-control.d.ts +0 -2
- package/tailwindui/components/toolbar-control.js +0 -86
- package/tailwindui/components/toolbar-customs.d.ts +0 -2
- package/tailwindui/components/toolbar-tabs.d.ts +0 -2
- package/tailwindui/components/toolbar.d.ts +0 -2
- package/tailwindui/components/toolbar.js +0 -12
- package/tailwindui/data-grid.d.ts +0 -6
- package/tailwindui/filter-handler/index.d.ts +0 -2
- package/tailwindui/index.d.ts +0 -3
- package/tailwindui/show.d.ts +0 -7
- package/tailwindui/styles.css +0 -592
- package/tailwindui/ui.d.ts +0 -2
- package/tailwindui/ui.js +0 -38
- /package/{tailwindui/components → _components}/drawer.d.ts +0 -0
- /package/{tailwindui/components → _components}/drawer.js +0 -0
- /package/{store → _store}/actions.d.ts +0 -0
- /package/{store → _store}/actions.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-boolean.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-date.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-datetime.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-default.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-email.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-phone.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-to-many.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-to-one.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/body-cell-url.js +0 -0
- /package/{tailwindui/body-cell → body-cell}/index.js +0 -0
- /package/{tailwindui/filter-handler → filter-handler}/bool-filter.js +0 -0
- /package/{tailwindui/filter-handler → filter-handler}/boolean-filter.js +0 -0
- /package/{tailwindui/filter-handler → filter-handler}/select-filter.js +0 -0
- /package/{tailwindui/filter-handler → filter-handler}/text-filter.js +0 -0
- /package/{tailwindui → table}/components/action-cell-base.d.ts +0 -0
- /package/{tailwindui → table}/components/action-cell-base.js +0 -0
package/hooks/useColumns.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.useColumns = void 0;
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
28
|
-
const react_data_grid_1 = require("react-data-grid");
|
|
29
|
-
const action_cell_base_1 = require("../tailwindui/components/action-cell-base");
|
|
30
|
-
const utils_1 = require("../utils");
|
|
31
|
-
const useColumns = (props, reload) => {
|
|
32
|
-
const { onChangeSelectedRows, schema, hiddenColumns, defaultConfig, ui, onOpen, onEdit, getOpenUrl, getEditUrl, onRemove, } = props;
|
|
33
|
-
const { actionCellWidth, BodyCells } = ui;
|
|
34
|
-
const rdgActionColumn = (0, react_1.useMemo)(() => {
|
|
35
|
-
return (props.ui.ActionCell && props.ui.ActionCell !== action_cell_base_1.ActionCellBase) ||
|
|
36
|
-
onOpen ||
|
|
37
|
-
onEdit ||
|
|
38
|
-
getOpenUrl ||
|
|
39
|
-
getEditUrl ||
|
|
40
|
-
onRemove
|
|
41
|
-
? {
|
|
42
|
-
key: "__action_column",
|
|
43
|
-
name: "",
|
|
44
|
-
resizable: false,
|
|
45
|
-
headerCellClass: "uxf-data-grid__action-cell",
|
|
46
|
-
cellClass: "uxf-data-grid__action-cell",
|
|
47
|
-
width: props.ui.ActionCell !== action_cell_base_1.ActionCellBase
|
|
48
|
-
? actionCellWidth
|
|
49
|
-
: [onRemove, onEdit !== null && onEdit !== void 0 ? onEdit : getEditUrl, onOpen !== null && onOpen !== void 0 ? onOpen : getOpenUrl].filter((i) => i).length * 40 + 8 * 2,
|
|
50
|
-
renderCell: (p) => {
|
|
51
|
-
if (!props.ui.ActionCell) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
return (react_1.default.createElement(props.ui.ActionCell, { row: p.row, reload: reload, onRemove: onRemove, onEdit: onEdit, getEditUrl: getEditUrl, onOpen: onOpen, getOpenUrl: getOpenUrl }));
|
|
55
|
-
},
|
|
56
|
-
}
|
|
57
|
-
: null;
|
|
58
|
-
}, [actionCellWidth, getEditUrl, getOpenUrl, onEdit, onOpen, onRemove, props, reload]);
|
|
59
|
-
const rdgColumns = (0, react_1.useMemo)(() => {
|
|
60
|
-
return schema.columns
|
|
61
|
-
.filter((c) => { var _a; return !(hiddenColumns === null || hiddenColumns === void 0 ? void 0 : hiddenColumns.includes(c.name)) && !((_a = defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.columns[c.name]) === null || _a === void 0 ? void 0 : _a.hidden); })
|
|
62
|
-
.map((c) => {
|
|
63
|
-
var _a, _b, _c, _d, _e, _f;
|
|
64
|
-
return ({
|
|
65
|
-
key: c.name,
|
|
66
|
-
name: c.label,
|
|
67
|
-
headerCellClass: (0, utils_1.cx)("uxf-data-grid__cell", "uxf-data-grid__cell--header", `uxf-data-grid__cell--type-${c.type}`, `uxf-data-grid__cell--name-${c.name}`),
|
|
68
|
-
resizable: true,
|
|
69
|
-
sortable: c.sort,
|
|
70
|
-
width: (_a = c.width) !== null && _a !== void 0 ? _a : (_b = defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.columns[c.name]) === null || _b === void 0 ? void 0 : _b.width,
|
|
71
|
-
minWidth: (_c = c.minWidth) !== null && _c !== void 0 ? _c : (_d = defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.columns[c.name]) === null || _d === void 0 ? void 0 : _d.minWidth,
|
|
72
|
-
maxWidth: (_e = c.maxWidth) !== null && _e !== void 0 ? _e : (_f = defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.columns[c.name]) === null || _f === void 0 ? void 0 : _f.maxWidth,
|
|
73
|
-
cellClass: (0, utils_1.cx)("uxf-data-grid__cell", `uxf-data-grid__cell--type-${c.type}`, `uxf-data-grid__cell--name-${c.name}`),
|
|
74
|
-
renderCell: (p) => {
|
|
75
|
-
var _a;
|
|
76
|
-
const columnType = c.type;
|
|
77
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
78
|
-
const BodyCell = (_a = BodyCells[columnType]) !== null && _a !== void 0 ? _a : BodyCells.default;
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
80
|
-
if (!BodyCell) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
return (react_1.default.createElement(BodyCell, { column: {
|
|
84
|
-
name: p.column.key,
|
|
85
|
-
label: p.column.name,
|
|
86
|
-
sort: p.column.sortable,
|
|
87
|
-
type: columnType,
|
|
88
|
-
}, reload: reload, row: p.row, value: p.row[p.column.key] }));
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
}, [BodyCells, defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.columns, hiddenColumns, reload, schema.columns]);
|
|
93
|
-
return (0, react_1.useMemo)(() => {
|
|
94
|
-
return [onChangeSelectedRows ? react_data_grid_1.SelectColumn : null, ...rdgColumns, rdgActionColumn].filter((c) => c !== null);
|
|
95
|
-
}, [onChangeSelectedRows, rdgActionColumn, rdgColumns]);
|
|
96
|
-
};
|
|
97
|
-
exports.useColumns = useColumns;
|
package/store/reducer.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Reducer } from "react";
|
|
2
|
-
import { DataGridState, Request, Schema } from "../types";
|
|
3
|
-
export declare const getInitialState: (schema: Schema<any>, init?: Request | string) => DataGridState;
|
|
4
|
-
export declare const reducer: Reducer<DataGridState, any>;
|
|
5
|
-
export declare const debugReducer: Reducer<DataGridState, any>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Container = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const utils_1 = require("../../utils");
|
|
9
|
-
const Container = (props) => {
|
|
10
|
-
const className = (0, utils_1.cx)("uxf-data-grid", props.noBorder && `no-border`, props.className);
|
|
11
|
-
return react_1.default.createElement("div", { className: className }, props.children);
|
|
12
|
-
};
|
|
13
|
-
exports.Container = Container;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Footer = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const utils_1 = require("../../utils");
|
|
9
|
-
const Footer = (props) => {
|
|
10
|
-
return react_1.default.createElement("div", { className: (0, utils_1.cx)("uxf-data-grid__footer", props.noBorder && "no-border") }, props.children);
|
|
11
|
-
};
|
|
12
|
-
exports.Footer = Footer;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PaginationCounts = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const PaginationCounts = (props) => {
|
|
9
|
-
var _a, _b, _c, _d;
|
|
10
|
-
const fromNumber = props.page * props.perPage + 1;
|
|
11
|
-
const toNumber = Math.min(props.page * props.perPage + props.perPage, (_b = (_a = props.response) === null || _a === void 0 ? void 0 : _a.count) !== null && _b !== void 0 ? _b : 0);
|
|
12
|
-
return (react_1.default.createElement("p", { className: "uxf-data-grid__pagination-counts" },
|
|
13
|
-
fromNumber,
|
|
14
|
-
"-",
|
|
15
|
-
toNumber,
|
|
16
|
-
" z ", (_d = (_c = props.response) === null || _c === void 0 ? void 0 : _c.count) !== null && _d !== void 0 ? _d : 0));
|
|
17
|
-
};
|
|
18
|
-
exports.PaginationCounts = PaginationCounts;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ToolbarControl = void 0;
|
|
27
|
-
const button_1 = require("@uxf/ui/button");
|
|
28
|
-
const icon_1 = require("@uxf/ui/icon");
|
|
29
|
-
const text_input_1 = require("@uxf/ui/text-input");
|
|
30
|
-
const toggle_1 = require("@uxf/ui/toggle");
|
|
31
|
-
const react_1 = __importStar(require("react"));
|
|
32
|
-
const actions_1 = require("../../store/actions");
|
|
33
|
-
const utils_1 = require("../../utils");
|
|
34
|
-
const show_1 = require("../show");
|
|
35
|
-
const drawer_1 = require("./drawer");
|
|
36
|
-
function Filters(props) {
|
|
37
|
-
return (react_1.default.createElement("div", { className: "uxf-data-grid__filters" }, props.schema.filters.map((filter) => {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
40
|
-
const FilterInput = (_a = props.filterHandlers[filter.type]) === null || _a === void 0 ? void 0 : _a.input;
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
42
|
-
if (!FilterInput) {
|
|
43
|
-
// eslint-disable-next-line no-console
|
|
44
|
-
console.warn(`Unknown filter "${filter.type}".`);
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
return (react_1.default.createElement(FilterInput, { key: filter.name, gridName: props.gridName, filter: filter, value: (_b = props.filtersData.find((f) => f.name === filter.name)) !== null && _b !== void 0 ? _b : { name: filter.name, value: null }, onFilter: (requestFilter) => props.dispatch(actions_1.dataGridActions.filter(requestFilter)), onClear: () => props.dispatch(actions_1.dataGridActions.filter({ name: filter.name, value: null })) }));
|
|
48
|
-
})));
|
|
49
|
-
}
|
|
50
|
-
function Columns(props) {
|
|
51
|
-
const onHideColumn = (columnName) => {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
(_a = props.onChangeHiddenColumns) === null || _a === void 0 ? void 0 : _a.call(props, [...((_b = props.hiddenColumns) !== null && _b !== void 0 ? _b : []), columnName]);
|
|
54
|
-
};
|
|
55
|
-
const onShowColumn = (columnName) => {
|
|
56
|
-
var _a, _b;
|
|
57
|
-
(_a = props.onChangeHiddenColumns) === null || _a === void 0 ? void 0 : _a.call(props, [...((_b = props.hiddenColumns) !== null && _b !== void 0 ? _b : [])].filter((v) => v !== columnName));
|
|
58
|
-
};
|
|
59
|
-
return (react_1.default.createElement("div", { className: "uxf-data-grid__toolbar-control-columns" }, props.schema.columns.map((column) => {
|
|
60
|
-
var _a;
|
|
61
|
-
return (react_1.default.createElement(toggle_1.Toggle, { key: column.name, label: typeof column.label === "string" ? column.label : "", value: !((_a = props.hiddenColumns) === null || _a === void 0 ? void 0 : _a.includes(column.name)), onChange: (value) => (value ? onShowColumn(column.name) : onHideColumn(column.name)) }));
|
|
62
|
-
})));
|
|
63
|
-
}
|
|
64
|
-
const ToolbarControl = (props) => {
|
|
65
|
-
const [isFiltersOpen, setFiltersOpen] = (0, react_1.useState)(false);
|
|
66
|
-
const [isColumnsOpen, setColumnsOpen] = (0, react_1.useState)(false);
|
|
67
|
-
const fulltextValue = props.state.request.search;
|
|
68
|
-
const filtersData = props.state.request.f;
|
|
69
|
-
return (react_1.default.createElement("div", { className: "uxf-data-grid__toolbar-control" },
|
|
70
|
-
react_1.default.createElement(show_1.Show, { when: props.showFulltext },
|
|
71
|
-
react_1.default.createElement(text_input_1.TextInput, { value: fulltextValue, onChange: props.onFulltextChange, placeholder: "Pi\u0161te pro hled\u00E1n\u00ED", className: "uxf-data-grid__plugin-fulltext", size: "small", leftElement: react_1.default.createElement(icon_1.Icon, { name: "search", size: 16 }), label: "Vyhled\u00E1v\u00E1n\u00ED", hiddenLabel: true })),
|
|
72
|
-
react_1.default.createElement(show_1.Show, { when: props.schema.filters.length !== 0 },
|
|
73
|
-
react_1.default.createElement(button_1.Button, { isIconButton: true, variant: "white", size: "sm", onClick: () => setFiltersOpen(true), title: "Filtrovat", className: "uxf-data-grid__plugin-button" },
|
|
74
|
-
react_1.default.createElement(icon_1.Icon, { name: "filter" }))),
|
|
75
|
-
react_1.default.createElement(show_1.Show, { when: props.onChangeHiddenColumns && props.hiddenColumns },
|
|
76
|
-
react_1.default.createElement(button_1.Button, { isIconButton: true, variant: "white", size: "sm", onClick: () => setColumnsOpen(true), title: "Nastaven\u00ED sloupc\u016F", className: "uxf-data-grid__plugin-button" },
|
|
77
|
-
react_1.default.createElement(icon_1.Icon, { name: "table-columns" }))),
|
|
78
|
-
react_1.default.createElement(show_1.Show, { when: props.onCsvDownload },
|
|
79
|
-
react_1.default.createElement(button_1.Button, { isIconButton: true, variant: "white", size: "sm", onClick: () => { var _a; return (_a = props.onCsvDownload) === null || _a === void 0 ? void 0 : _a.call(props, (0, utils_1.createRequest)(props.state, props.schema.sort, props.schema.dir)); }, title: "St\u00E1hnout CSV", className: "uxf-data-grid__plugin-button" },
|
|
80
|
-
react_1.default.createElement(icon_1.Icon, { name: "file-arrow-down" }))),
|
|
81
|
-
react_1.default.createElement(drawer_1.Drawer, { open: isFiltersOpen, onClose: () => setFiltersOpen(false), title: "Filtry" },
|
|
82
|
-
react_1.default.createElement(Filters, { gridName: props.gridName, schema: props.schema, dispatch: props.dispatch, filtersData: filtersData, filterHandlers: props.filterHandlers, noBorder: props.noBorder })),
|
|
83
|
-
react_1.default.createElement(drawer_1.Drawer, { open: isColumnsOpen, onClose: () => setColumnsOpen(false), title: "Nastaven\u00ED sloupc\u016F" },
|
|
84
|
-
react_1.default.createElement(Columns, { schema: props.schema, onChangeHiddenColumns: props.onChangeHiddenColumns, hiddenColumns: props.hiddenColumns }))));
|
|
85
|
-
};
|
|
86
|
-
exports.ToolbarControl = ToolbarControl;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Toolbar = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const utils_1 = require("../../utils");
|
|
9
|
-
const Toolbar = (props) => {
|
|
10
|
-
return react_1.default.createElement("div", { className: (0, utils_1.cx)("uxf-data-grid__toolbar", props.noBorder && "no-border") }, props.children);
|
|
11
|
-
};
|
|
12
|
-
exports.Toolbar = Toolbar;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BaseGridType, DataGridBaseProps, UIComponents } from "../types";
|
|
3
|
-
export type DataGridProps<GridType extends BaseGridType, R> = DataGridBaseProps<GridType, R> & {
|
|
4
|
-
ui?: Partial<UIComponents<GridType, R>>;
|
|
5
|
-
};
|
|
6
|
-
export declare const DataGrid: <GridType extends BaseGridType, R = any>(props: DataGridProps<GridType, R>) => React.JSX.Element;
|
package/tailwindui/index.d.ts
DELETED