@uxf/data-grid 10.0.0-beta.69 → 10.0.0-beta.70
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/data-grid.js +11 -19
- package/hooks/use-rdg-visuals.d.ts +18 -0
- package/hooks/use-rdg-visuals.js +47 -0
- package/hooks/useColumns.js +2 -2
- package/package.json +2 -2
- package/tailwindui/components/toolbar-control.js +3 -2
- package/tailwindui/styles.css +348 -105
- package/types/components.d.ts +2 -2
package/data-grid.js
CHANGED
|
@@ -35,20 +35,15 @@ const useColumns_1 = require("./hooks/useColumns");
|
|
|
35
35
|
const footer_1 = require("./tailwindui/components/footer");
|
|
36
36
|
const show_1 = require("./tailwindui/show");
|
|
37
37
|
const actions_1 = require("./store/actions");
|
|
38
|
+
const use_rdg_visuals_1 = require("./hooks/use-rdg-visuals");
|
|
38
39
|
const defaultKeyExtractor = (r) => {
|
|
39
40
|
return r.id;
|
|
40
41
|
};
|
|
41
42
|
// eslint-disable-next-line react/require-optimization
|
|
42
43
|
const DataGrid = (props) => {
|
|
43
|
-
var _a, _b, _c
|
|
44
|
-
const rowHeight = (_a = props.rowHeight) !== null && _a !== void 0 ? _a : 44;
|
|
45
|
-
const headerRowHeight = (_b = props.headerRowHeight) !== null && _b !== void 0 ? _b : 36;
|
|
44
|
+
var _a, _b, _c;
|
|
46
45
|
const { LinearProgress, Container, FilterList, Pagination, PaginationCounts, PaginationRowsPerPageSelect, SelectedRowsToolbar, NoRowsFallback, SelectRowCheckbox, Toolbar, ToolbarControl, ToolbarCustoms, ToolbarTabs, } = props.ui;
|
|
47
46
|
const [state, dispatch] = (0, react_1.useReducer)(props.debug ? reducer_1.debugReducer : reducer_1.reducer, (0, reducer_1.getInitialState)(props.schema, props.initialState));
|
|
48
|
-
const [mounted, setMounted] = (0, react_1.useState)(false);
|
|
49
|
-
(0, react_1.useEffect)(() => {
|
|
50
|
-
setMounted(true);
|
|
51
|
-
}, []);
|
|
52
47
|
// TODO @vejvis - tady vyřešit problém se závislostma v useCallbacku
|
|
53
48
|
const schema = props.schema;
|
|
54
49
|
const gridName = props.gridName;
|
|
@@ -86,11 +81,8 @@ const DataGrid = (props) => {
|
|
|
86
81
|
const onFilter = (0, react_1.useCallback)((value) => {
|
|
87
82
|
dispatch(actions_1.dataGridActions.filter(value));
|
|
88
83
|
}, [dispatch]);
|
|
89
|
-
const rows = (
|
|
84
|
+
const rows = (_b = (_a = state.response) === null || _a === void 0 ? void 0 : _a.result) !== null && _b !== void 0 ? _b : [];
|
|
90
85
|
const columns = (0, useColumns_1.useColumns)(props, onReload);
|
|
91
|
-
const contentHeight = typeof rowHeight === "function"
|
|
92
|
-
? rows.reduce((prev, curr) => prev + rowHeight({ type: "ROW", row: curr }))
|
|
93
|
-
: (rowHeight + 1) * rows.length;
|
|
94
86
|
const components = (0, react_1.useMemo)(() => {
|
|
95
87
|
return {
|
|
96
88
|
checkboxFormatter: SelectRowCheckbox,
|
|
@@ -111,12 +103,12 @@ const DataGrid = (props) => {
|
|
|
111
103
|
dispatch(actions_1.dataGridActions.sortClear());
|
|
112
104
|
}
|
|
113
105
|
};
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
};
|
|
106
|
+
const rdgVisuals = (0, use_rdg_visuals_1.useRdgVisuals)({
|
|
107
|
+
headerRowHeight: props.headerRowHeight,
|
|
108
|
+
mode: props.mode,
|
|
109
|
+
rowHeight: props.rowHeight,
|
|
110
|
+
rows,
|
|
111
|
+
});
|
|
120
112
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
121
113
|
react_1.default.createElement(Container, { noBorder: props.noBorder, className: props.className },
|
|
122
114
|
react_1.default.createElement(Toolbar, { noBorder: props.noBorder },
|
|
@@ -125,8 +117,8 @@ const DataGrid = (props) => {
|
|
|
125
117
|
react_1.default.createElement(ToolbarCustoms, { buttons: props.customActions })),
|
|
126
118
|
react_1.default.createElement(LinearProgress, { loading: !!state.loading }),
|
|
127
119
|
react_1.default.createElement(FilterList, { gridName: props.gridName, onFilter: onFilter, filters: props.schema.filters, filtersData: state.request.f, filterHandlers: props.ui.FilterHandlers, noBorder: props.noBorder }),
|
|
128
|
-
react_1.default.createElement(show_1.Show, { when:
|
|
129
|
-
react_1.default.createElement(react_data_grid_1.default, {
|
|
120
|
+
react_1.default.createElement(show_1.Show, { when: rdgVisuals.ready },
|
|
121
|
+
react_1.default.createElement(react_data_grid_1.default, { className: rdgVisuals.className, columns: columns, enableVirtualization: false, headerRowHeight: rdgVisuals.headerRowHeight, onSelectedRowsChange: props.onChangeSelectedRows, onSortColumnsChange: onSortColumnChange, ref: rdgVisuals.ref, renderers: components, rowClass: props.rowClass, rowHeight: rdgVisuals.rowHeight, rowKeyGetter: (_c = props.keyExtractor) !== null && _c !== void 0 ? _c : defaultKeyExtractor, rows: rows, selectedRows: props.selectedRows, sortColumns: sortColumns, style: rdgVisuals.style })),
|
|
130
122
|
react_1.default.createElement(footer_1.Footer, { noBorder: props.noBorder },
|
|
131
123
|
react_1.default.createElement(PaginationRowsPerPageSelect, { value: state.request.perPage, onChange: (value) => dispatch(actions_1.dataGridActions.changePerPage(value)) }),
|
|
132
124
|
react_1.default.createElement(PaginationCounts, { page: state.request.page, perPage: state.request.perPage, response: state.response }),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DataGridHandle } from "react-data-grid";
|
|
3
|
+
import { BaseGridType, DataGridBaseProps } from "../types";
|
|
4
|
+
export declare function useRdgVisuals(props: {
|
|
5
|
+
headerRowHeight?: DataGridBaseProps<BaseGridType, any>["headerRowHeight"];
|
|
6
|
+
mode?: DataGridBaseProps<BaseGridType, any>["mode"];
|
|
7
|
+
rowHeight?: DataGridBaseProps<BaseGridType, any>["rowHeight"];
|
|
8
|
+
rows: any[];
|
|
9
|
+
}): {
|
|
10
|
+
className: string;
|
|
11
|
+
headerRowHeight: number;
|
|
12
|
+
ready: boolean;
|
|
13
|
+
ref: import("react").RefObject<DataGridHandle>;
|
|
14
|
+
rowHeight: number | ((row: any) => number);
|
|
15
|
+
style: {
|
|
16
|
+
height: number | undefined;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRdgVisuals = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useRdgVisuals(props) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const [mounted, setMounted] = (0, react_1.useState)(false);
|
|
8
|
+
(0, react_1.useEffect)(() => setMounted(true), []);
|
|
9
|
+
const rowHeight = (_a = props.rowHeight) !== null && _a !== void 0 ? _a : 44;
|
|
10
|
+
const headerRowHeight = (_b = props.headerRowHeight) !== null && _b !== void 0 ? _b : 36;
|
|
11
|
+
const contentHeight = typeof rowHeight === "function"
|
|
12
|
+
? props.rows.reduce((prev, curr) => prev + rowHeight({ type: "ROW", row: curr }))
|
|
13
|
+
: rowHeight * props.rows.length;
|
|
14
|
+
const ref = (0, react_1.useRef)(null);
|
|
15
|
+
const size = {
|
|
16
|
+
contentHeight,
|
|
17
|
+
headerRowHeight,
|
|
18
|
+
rowsCount: props.rows.length,
|
|
19
|
+
};
|
|
20
|
+
const storedSize = (0, react_1.useRef)(size);
|
|
21
|
+
storedSize.current = size;
|
|
22
|
+
const [height, setHeight] = (0, react_1.useState)();
|
|
23
|
+
(0, react_1.useEffect)(() => {
|
|
24
|
+
var _a;
|
|
25
|
+
const node = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.element;
|
|
26
|
+
if (!(mounted && node)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const observer = new MutationObserver((mutations) => mutations.forEach(() => {
|
|
30
|
+
const currentSize = storedSize.current;
|
|
31
|
+
const scrollbarHeight = node.scrollWidth > node.clientWidth ? 8 : 0;
|
|
32
|
+
const emptyRowHeight = currentSize.rowsCount === 0 ? 44 : 0;
|
|
33
|
+
setHeight(currentSize.headerRowHeight + currentSize.contentHeight + emptyRowHeight + scrollbarHeight);
|
|
34
|
+
}));
|
|
35
|
+
observer.observe(node, { attributes: true, attributeFilter: ["style"] });
|
|
36
|
+
return () => observer.disconnect();
|
|
37
|
+
}, [mounted, storedSize]);
|
|
38
|
+
return {
|
|
39
|
+
className: `uxf-data-grid__table ${props.mode === "light" ? "rdg-light" : props.mode === "dark" ? "rdg-dark" : ""}`,
|
|
40
|
+
headerRowHeight,
|
|
41
|
+
ready: mounted,
|
|
42
|
+
ref,
|
|
43
|
+
rowHeight,
|
|
44
|
+
style: { height },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
exports.useRdgVisuals = useRdgVisuals;
|
package/hooks/useColumns.js
CHANGED
|
@@ -47,7 +47,7 @@ const useColumns = (props, reload) => {
|
|
|
47
47
|
width: props.ui.ActionCell !== action_cell_base_1.ActionCellBase
|
|
48
48
|
? actionCellWidth
|
|
49
49
|
: [onRemove, onEdit !== null && onEdit !== void 0 ? onEdit : getEditUrl, onOpen !== null && onOpen !== void 0 ? onOpen : getOpenUrl].filter((i) => i).length * 40 + 8 * 2,
|
|
50
|
-
|
|
50
|
+
renderCell: (p) => {
|
|
51
51
|
if (!props.ui.ActionCell) {
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
@@ -71,7 +71,7 @@ const useColumns = (props, reload) => {
|
|
|
71
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
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
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
|
-
|
|
74
|
+
renderCell: (p) => {
|
|
75
75
|
var _a;
|
|
76
76
|
const columnType = c.type;
|
|
77
77
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/data-grid",
|
|
3
|
-
"version": "10.0.0-beta.
|
|
3
|
+
"version": "10.0.0-beta.70",
|
|
4
4
|
"description": "UXF DataGrid",
|
|
5
5
|
"homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dayjs": "^1.11.7"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"react-data-grid": "7.0.0-beta.
|
|
39
|
+
"react-data-grid": "7.0.0-beta.39"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {},
|
|
42
42
|
"gitHead": "e4f21a15c3d50fb6614d70cdaf36685232de87e7"
|
|
@@ -69,8 +69,9 @@ const ToolbarControl = (props) => {
|
|
|
69
69
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__toolbar-control" },
|
|
70
70
|
react_1.default.createElement(show_1.Show, { when: props.showFulltext },
|
|
71
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(
|
|
73
|
-
react_1.default.createElement(
|
|
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" }))),
|
|
74
75
|
react_1.default.createElement(show_1.Show, { when: props.onChangeHiddenColumns && props.hiddenColumns },
|
|
75
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" },
|
|
76
77
|
react_1.default.createElement(icon_1.Icon, { name: "table-columns" }))),
|
package/tailwindui/styles.css
CHANGED
|
@@ -1,86 +1,179 @@
|
|
|
1
|
+
@import url("react-data-grid/lib/styles.css");
|
|
2
|
+
|
|
3
|
+
@layer rdg.Root {
|
|
4
|
+
.uxf-data-grid__table {
|
|
5
|
+
--rdg-color-scheme: light;
|
|
6
|
+
--rdg-color: theme("colors.lightHigh");
|
|
7
|
+
--rdg-border-color: theme("colors.lightBorder");
|
|
8
|
+
--rdg-summary-border-color: theme("colors.lightBorder");
|
|
9
|
+
--rdg-background-color: theme("colors.white");
|
|
10
|
+
--rdg-header-background-color: theme("colors.gray.50");
|
|
11
|
+
--rdg-row-hover-background-color: theme("colors.gray.50");
|
|
12
|
+
--rdg-row-selected-background-color: theme("colors.gray.100/.75");
|
|
13
|
+
--row-selected-hover-background-color: theme("colors.gray.200/.75");
|
|
14
|
+
--rdg-selection-color: theme("colors.lightBorder");
|
|
15
|
+
--rdg-font-size: 14px;
|
|
16
|
+
|
|
17
|
+
:root .dark & {
|
|
18
|
+
--rdg-color-scheme: dark;
|
|
19
|
+
--rdg-color: theme("colors.darkHigh");
|
|
20
|
+
--rdg-border-color: theme("colors.darkBorder");
|
|
21
|
+
--rdg-summary-border-color: theme("colors.darkBorder");
|
|
22
|
+
--rdg-background-color: theme("colors.gray.950");
|
|
23
|
+
--rdg-header-background-color: theme("colors.gray.900");
|
|
24
|
+
--rdg-row-hover-background-color: theme("colors.gray.950");
|
|
25
|
+
--rdg-row-selected-background-color: theme("colors.gray.900/.75");
|
|
26
|
+
--row-selected-hover-background-color: theme("colors.gray.800/.75");
|
|
27
|
+
--rdg-selection-color: theme("colors.darkBorder");
|
|
28
|
+
--rdg-font-size: 14px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
1
33
|
.uxf-data-grid {
|
|
2
|
-
|
|
34
|
+
border: 1px solid var(--rdg-border-color);
|
|
35
|
+
border-radius: theme("borderRadius.DEFAULT");
|
|
3
36
|
|
|
4
37
|
&.no-border {
|
|
5
|
-
|
|
38
|
+
border-style: none;
|
|
6
39
|
}
|
|
7
40
|
|
|
8
41
|
&__action-cell {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
:root .dark & {
|
|
14
|
-
border-inline-start: 1px solid theme("colors.gray.700");
|
|
15
|
-
}
|
|
42
|
+
background-color: var(--rdg-background-color);
|
|
43
|
+
border-inline-start: 1px solid var(--rdg-border-color);
|
|
44
|
+
position: sticky;
|
|
45
|
+
right: 0;
|
|
16
46
|
}
|
|
17
47
|
|
|
18
48
|
&__action-cell-wrapper {
|
|
19
|
-
@apply
|
|
49
|
+
@apply space-x-2;
|
|
50
|
+
|
|
51
|
+
align-items: center;
|
|
52
|
+
display: flex;
|
|
53
|
+
height: 100%;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
text-align: center;
|
|
56
|
+
width: 100%;
|
|
20
57
|
|
|
21
58
|
.uxf-icon {
|
|
22
|
-
|
|
59
|
+
color: theme("colors.lightMedium");
|
|
60
|
+
|
|
61
|
+
:root .dark & {
|
|
62
|
+
color: theme("colors.darkMedium");
|
|
63
|
+
}
|
|
23
64
|
}
|
|
24
65
|
}
|
|
25
66
|
|
|
26
67
|
&__body-cell {
|
|
27
68
|
&--boolean {
|
|
28
|
-
|
|
69
|
+
align-items: center;
|
|
70
|
+
display: flex;
|
|
71
|
+
height: 100%;
|
|
72
|
+
width: 100%;
|
|
29
73
|
}
|
|
30
74
|
}
|
|
31
75
|
|
|
32
76
|
&__drawer {
|
|
33
|
-
@apply
|
|
77
|
+
@apply ease-in-out;
|
|
78
|
+
|
|
79
|
+
background-color: theme("colors.gray.900/.25");
|
|
80
|
+
inset: 0;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
position: fixed;
|
|
83
|
+
z-index: theme("zIndex.modal");
|
|
84
|
+
|
|
85
|
+
:root .dark & {
|
|
86
|
+
background-color: theme("colors.gray.900/.75");
|
|
87
|
+
}
|
|
34
88
|
|
|
35
89
|
&--open {
|
|
36
|
-
@apply
|
|
90
|
+
@apply transition-opacity duration-500;
|
|
91
|
+
|
|
92
|
+
opacity: 100;
|
|
93
|
+
transform: translateX(0);
|
|
37
94
|
}
|
|
38
95
|
|
|
39
96
|
&--closed {
|
|
40
|
-
@apply
|
|
97
|
+
@apply transition-all delay-500;
|
|
98
|
+
|
|
99
|
+
opacity: 0;
|
|
100
|
+
transform: translateX(100%);
|
|
41
101
|
}
|
|
42
102
|
|
|
43
103
|
&-body-wrapper {
|
|
44
|
-
@apply
|
|
104
|
+
@apply transition-all duration-500 ease-in-out;
|
|
105
|
+
|
|
106
|
+
background-color: theme("colors.white");
|
|
107
|
+
box-shadow: theme("boxShadow.xl");
|
|
108
|
+
height: 100%;
|
|
109
|
+
max-width: theme("maxWidth.sm");
|
|
110
|
+
position: absolute;
|
|
111
|
+
right: 0;
|
|
112
|
+
transform: translateX(100%);
|
|
113
|
+
width: theme("width.11/12");
|
|
45
114
|
|
|
46
115
|
&--open {
|
|
47
|
-
|
|
116
|
+
transform: translateX(0);
|
|
48
117
|
}
|
|
49
118
|
}
|
|
50
119
|
|
|
51
120
|
&-body {
|
|
52
|
-
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
height: 100%;
|
|
124
|
+
max-width: theme("maxWidth.sm");
|
|
125
|
+
overflow-y: scroll;
|
|
126
|
+
padding-bottom: theme("spacing.10");
|
|
127
|
+
position: relative;
|
|
128
|
+
width: 100%;
|
|
129
|
+
|
|
130
|
+
:root .dark & {
|
|
131
|
+
background-color: theme("colors.gray.950");
|
|
132
|
+
color: theme("colors.gray.100");
|
|
133
|
+
}
|
|
53
134
|
}
|
|
54
135
|
|
|
55
136
|
&-close-button {
|
|
56
|
-
|
|
137
|
+
margin-left: auto;
|
|
138
|
+
margin-right: theme("spacing.4");
|
|
139
|
+
margin-top: theme("spacing.4") !important;
|
|
57
140
|
}
|
|
58
141
|
|
|
59
142
|
&-header {
|
|
60
|
-
|
|
143
|
+
font-weight: theme("fontWeight.bold");
|
|
144
|
+
padding: theme("spacing.8") theme("spacing.4") theme("spacing.4");
|
|
61
145
|
}
|
|
62
146
|
|
|
63
147
|
&-content {
|
|
64
|
-
|
|
148
|
+
padding: theme("spacing.4");
|
|
65
149
|
}
|
|
66
150
|
|
|
67
151
|
&-backdrop {
|
|
68
|
-
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
height: 100%;
|
|
154
|
+
width: 100vw;
|
|
69
155
|
}
|
|
70
156
|
}
|
|
71
157
|
|
|
72
158
|
&__fallback {
|
|
159
|
+
align-items: center;
|
|
160
|
+
color: theme("colors.gray.600"); /* ?? */
|
|
161
|
+
display: flex;
|
|
73
162
|
grid-column: 1/-1;
|
|
74
|
-
|
|
75
|
-
|
|
163
|
+
justify-content: center;
|
|
164
|
+
text-align: center;
|
|
76
165
|
}
|
|
77
166
|
|
|
78
167
|
&__filter {
|
|
79
168
|
&--interval {
|
|
80
|
-
|
|
169
|
+
display: grid;
|
|
170
|
+
gap: theme("spacing.4");
|
|
171
|
+
grid-template-columns: 1fr min-content 1fr;
|
|
81
172
|
|
|
82
173
|
.uxf-data-grid__filter-gap {
|
|
83
|
-
|
|
174
|
+
align-items: center;
|
|
175
|
+
display: flex;
|
|
176
|
+
padding-top: theme("spacing.5");
|
|
84
177
|
}
|
|
85
178
|
}
|
|
86
179
|
}
|
|
@@ -90,14 +183,21 @@
|
|
|
90
183
|
}
|
|
91
184
|
|
|
92
185
|
&__filter-list {
|
|
93
|
-
@apply space-x-2
|
|
186
|
+
@apply space-x-2;
|
|
187
|
+
|
|
188
|
+
padding: theme("spacing.2");
|
|
94
189
|
}
|
|
95
190
|
|
|
96
191
|
&__footer {
|
|
97
|
-
|
|
192
|
+
align-items: center;
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-wrap: wrap;
|
|
195
|
+
gap: theme("spacing.4");
|
|
196
|
+
justify-content: flex-end;
|
|
197
|
+
padding: theme("spacing.2");
|
|
98
198
|
|
|
99
199
|
&.no-border {
|
|
100
|
-
|
|
200
|
+
padding-inline: 0;
|
|
101
201
|
}
|
|
102
202
|
}
|
|
103
203
|
|
|
@@ -113,7 +213,7 @@
|
|
|
113
213
|
&.is-loading::before {
|
|
114
214
|
animation: datagridlineanim 1s linear infinite;
|
|
115
215
|
background-color: theme("colors.dataGridSecondary");
|
|
116
|
-
border-radius:
|
|
216
|
+
border-radius: inherit;
|
|
117
217
|
content: "";
|
|
118
218
|
height: 3px;
|
|
119
219
|
left: -50%;
|
|
@@ -123,132 +223,304 @@
|
|
|
123
223
|
}
|
|
124
224
|
|
|
125
225
|
&__linear-progress-wrapper {
|
|
126
|
-
|
|
226
|
+
position: relative;
|
|
127
227
|
}
|
|
128
228
|
|
|
129
229
|
&__pagination-counts {
|
|
130
|
-
@apply text-sm
|
|
230
|
+
@apply text-sm;
|
|
231
|
+
|
|
232
|
+
color: theme("colors.lightLow");
|
|
131
233
|
}
|
|
132
234
|
|
|
133
235
|
&__plugin-fulltext {
|
|
134
|
-
|
|
236
|
+
color: theme("colors.gray.400");
|
|
237
|
+
margin: theme("spacing.2") 0;
|
|
238
|
+
width: 100%;
|
|
239
|
+
|
|
240
|
+
@screen sm {
|
|
241
|
+
width: auto;
|
|
242
|
+
}
|
|
135
243
|
|
|
136
244
|
.uxf-icon {
|
|
137
|
-
|
|
245
|
+
color: theme("colors.lightMedium");
|
|
246
|
+
|
|
247
|
+
:root .dark & {
|
|
248
|
+
color: theme("colors.darkMedium");
|
|
249
|
+
}
|
|
138
250
|
}
|
|
139
251
|
}
|
|
140
252
|
|
|
141
253
|
&__plugin-button {
|
|
142
|
-
|
|
254
|
+
flex-shrink: 0;
|
|
255
|
+
margin: theme("spacing.2") 0;
|
|
143
256
|
|
|
144
257
|
.uxf-icon {
|
|
145
|
-
|
|
258
|
+
color: theme("colors.lightMedium");
|
|
259
|
+
|
|
260
|
+
:root .dark & {
|
|
261
|
+
color: theme("colors.darkMedium");
|
|
262
|
+
}
|
|
146
263
|
}
|
|
147
264
|
}
|
|
148
265
|
|
|
149
266
|
&__rows-per-page {
|
|
150
|
-
@apply
|
|
267
|
+
@apply text-sm;
|
|
268
|
+
|
|
269
|
+
align-items: center;
|
|
270
|
+
color: theme("colors.lightLow");
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-wrap: wrap;
|
|
273
|
+
gap: theme("spacing.2");
|
|
151
274
|
|
|
152
275
|
.uxf-select {
|
|
153
|
-
|
|
276
|
+
width: theme("width.28");
|
|
154
277
|
}
|
|
155
278
|
}
|
|
156
279
|
|
|
157
280
|
&__select-row-checkbox-wrapper {
|
|
158
|
-
|
|
281
|
+
align-items: center;
|
|
282
|
+
color: theme("colors.white");
|
|
283
|
+
display: flex;
|
|
284
|
+
height: 100%;
|
|
285
|
+
justify-content: center;
|
|
286
|
+
width: 100%;
|
|
159
287
|
}
|
|
160
288
|
|
|
161
289
|
&__selected-rows-toolbar-wrapper {
|
|
162
|
-
|
|
290
|
+
align-items: center;
|
|
291
|
+
bottom: theme("spacing.8");
|
|
292
|
+
display: flex;
|
|
293
|
+
justify-content: center;
|
|
294
|
+
position: fixed;
|
|
295
|
+
right: 0;
|
|
163
296
|
}
|
|
164
297
|
|
|
165
298
|
&__selected-rows-toolbar {
|
|
166
|
-
@apply
|
|
299
|
+
@apply text-sm drop-shadow-xl;
|
|
300
|
+
|
|
301
|
+
align-items: center;
|
|
302
|
+
background-color: theme("colors.dataGridPrimary");
|
|
303
|
+
border: 1px solid theme("colors.lightBorder");
|
|
304
|
+
border-radius: 999px;
|
|
305
|
+
color: theme("colors.white");
|
|
306
|
+
display: flex;
|
|
307
|
+
justify-content: center;
|
|
308
|
+
padding: theme("spacing.2") theme("spacing.6");
|
|
309
|
+
|
|
310
|
+
:root .dark & {
|
|
311
|
+
border-color: theme("colors.darkBorder");
|
|
312
|
+
}
|
|
167
313
|
}
|
|
168
314
|
|
|
169
315
|
&__selected-rows-toolbar-actions {
|
|
170
|
-
@apply space-x-2
|
|
316
|
+
@apply space-x-2;
|
|
317
|
+
|
|
318
|
+
padding-left: theme("spacing.4");
|
|
171
319
|
}
|
|
172
320
|
|
|
173
321
|
&__table {
|
|
174
|
-
|
|
322
|
+
overflow-y: hidden;
|
|
323
|
+
|
|
324
|
+
&::-webkit-scrollbar {
|
|
325
|
+
height: 8px;
|
|
326
|
+
width: 8px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
&::-webkit-scrollbar-track {
|
|
330
|
+
background-color: transparent;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
&::-webkit-scrollbar-thumb,
|
|
334
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
335
|
+
background-color: theme("colors.lightLow");
|
|
336
|
+
border-radius: 999px;
|
|
337
|
+
|
|
338
|
+
:root .dark & {
|
|
339
|
+
background-color: theme("colors.darkLow");
|
|
340
|
+
}
|
|
341
|
+
}
|
|
175
342
|
}
|
|
176
343
|
|
|
177
344
|
&__toolbar {
|
|
178
|
-
|
|
345
|
+
align-items: center;
|
|
346
|
+
border-bottom: 1px solid theme("colors.lightBorder");
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-wrap: wrap;
|
|
349
|
+
gap: theme("spacing.2");
|
|
350
|
+
justify-content: flex-end;
|
|
351
|
+
padding: theme("spacing.2");
|
|
352
|
+
|
|
353
|
+
:root .dark & {
|
|
354
|
+
border-bottom-color: theme("colors.darkBorder");
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
@screen md {
|
|
358
|
+
padding-block: 0;
|
|
359
|
+
padding-left: 0;
|
|
360
|
+
}
|
|
179
361
|
}
|
|
180
362
|
|
|
181
363
|
&__toolbar-tab {
|
|
182
|
-
@apply
|
|
364
|
+
@apply text-sm;
|
|
365
|
+
|
|
366
|
+
align-items: center;
|
|
367
|
+
border-bottom: 2px solid transparent;
|
|
368
|
+
color: theme("colors.lightMedium");
|
|
369
|
+
display: inline-flex;
|
|
370
|
+
font-weight: theme("fontWeight.medium");
|
|
371
|
+
padding: theme("spacing.4");
|
|
372
|
+
white-space: nowrap;
|
|
373
|
+
|
|
374
|
+
:root .dark & {
|
|
375
|
+
color: theme("colors.darkMedium");
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
&:hover {
|
|
379
|
+
color: theme("colors.lightHigh");
|
|
380
|
+
|
|
381
|
+
:root .dark & {
|
|
382
|
+
color: theme("colors.darkHigh");
|
|
383
|
+
}
|
|
384
|
+
}
|
|
183
385
|
|
|
184
386
|
&.is-active {
|
|
185
|
-
|
|
387
|
+
border-bottom-color: currentcolor;
|
|
388
|
+
color: theme("colors.dataGridPrimary");
|
|
186
389
|
}
|
|
187
390
|
}
|
|
188
391
|
|
|
189
392
|
&__toolbar-tabs {
|
|
190
|
-
|
|
393
|
+
align-self: stretch;
|
|
394
|
+
display: flex;
|
|
395
|
+
flex: 1;
|
|
191
396
|
|
|
192
397
|
&-nav {
|
|
193
398
|
&--desktop {
|
|
194
|
-
@apply
|
|
399
|
+
@apply space-x-4;
|
|
400
|
+
|
|
401
|
+
display: none;
|
|
402
|
+
margin-bottom: -1px;
|
|
195
403
|
|
|
196
404
|
@screen md {
|
|
197
|
-
|
|
405
|
+
display: flex;
|
|
198
406
|
}
|
|
199
407
|
}
|
|
200
408
|
|
|
201
409
|
&--mobile {
|
|
202
|
-
|
|
410
|
+
align-items: center;
|
|
411
|
+
display: flex;
|
|
412
|
+
width: max-content;
|
|
413
|
+
z-index: theme("zIndex.10");
|
|
203
414
|
|
|
204
415
|
@screen md {
|
|
205
|
-
|
|
416
|
+
display: none;
|
|
206
417
|
}
|
|
207
418
|
|
|
208
419
|
.uxf-data-grid__toolbar-tabs-button {
|
|
209
|
-
|
|
420
|
+
align-items: center;
|
|
421
|
+
display: flex;
|
|
422
|
+
margin: 0;
|
|
210
423
|
|
|
211
424
|
&-icon {
|
|
212
|
-
|
|
425
|
+
color: theme("colors.lightHigh");
|
|
426
|
+
margin-left: theme("spacing.1");
|
|
427
|
+
|
|
428
|
+
:root .dark & {
|
|
429
|
+
color: theme("colors.darkHigh");
|
|
430
|
+
}
|
|
213
431
|
}
|
|
214
432
|
}
|
|
215
433
|
}
|
|
216
434
|
|
|
217
435
|
&-text {
|
|
218
|
-
|
|
436
|
+
color: theme("colors.lightHigh");
|
|
437
|
+
|
|
438
|
+
:root .dark & {
|
|
439
|
+
color: theme("colors.darkHigh");
|
|
440
|
+
}
|
|
219
441
|
}
|
|
220
442
|
}
|
|
221
443
|
|
|
222
444
|
&-modal-content {
|
|
223
|
-
@apply
|
|
445
|
+
@apply divide-y divide-lightBorder dark:divide-darkBorder;
|
|
446
|
+
|
|
447
|
+
align-items: flex-start;
|
|
448
|
+
display: flex;
|
|
449
|
+
flex-direction: column;
|
|
450
|
+
padding-bottom: theme("spacing.4");
|
|
451
|
+
padding-top: theme("spacing.1");
|
|
452
|
+
text-align: left;
|
|
224
453
|
}
|
|
225
454
|
|
|
226
455
|
&-modal-button {
|
|
227
|
-
|
|
456
|
+
border-radius: 0;
|
|
457
|
+
justify-content: flex-start;
|
|
458
|
+
width: 100%;
|
|
228
459
|
}
|
|
229
460
|
|
|
230
461
|
&-modal-button-text {
|
|
231
|
-
|
|
462
|
+
color: theme("colors.lightHigh");
|
|
463
|
+
|
|
464
|
+
:root .dark & {
|
|
465
|
+
color: theme("colors.darkHigh");
|
|
466
|
+
}
|
|
232
467
|
}
|
|
233
468
|
|
|
234
469
|
&-modal-active-tab-icon {
|
|
235
|
-
|
|
470
|
+
color: theme("colors.lightMedium");
|
|
471
|
+
margin-right: theme("spacing.3");
|
|
472
|
+
|
|
473
|
+
:root .dark & {
|
|
474
|
+
color: theme("colors.darkMedium");
|
|
475
|
+
}
|
|
236
476
|
}
|
|
237
477
|
}
|
|
238
478
|
|
|
239
479
|
&__toolbar-control {
|
|
240
|
-
|
|
480
|
+
align-items: center;
|
|
481
|
+
display: flex;
|
|
482
|
+
flex-direction: row;
|
|
483
|
+
gap: theme("spacing.2");
|
|
484
|
+
justify-content: space-between;
|
|
485
|
+
order: 3;
|
|
486
|
+
width: 100%;
|
|
487
|
+
|
|
488
|
+
@screen xs {
|
|
489
|
+
order: 2;
|
|
490
|
+
width: auto;
|
|
491
|
+
}
|
|
241
492
|
}
|
|
242
493
|
|
|
243
494
|
&__toolbar-customs {
|
|
244
|
-
|
|
495
|
+
align-items: center;
|
|
496
|
+
display: flex;
|
|
497
|
+
flex-direction: row;
|
|
498
|
+
gap: theme("spacing.2");
|
|
499
|
+
order: 2;
|
|
500
|
+
|
|
501
|
+
@screen xs {
|
|
502
|
+
order: 2;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
@screen md {
|
|
506
|
+
margin-block: theme("spacing.2");
|
|
507
|
+
}
|
|
245
508
|
|
|
246
509
|
&-mobile {
|
|
247
|
-
|
|
510
|
+
display: flex;
|
|
511
|
+
|
|
512
|
+
@screen md {
|
|
513
|
+
display: none;
|
|
514
|
+
}
|
|
248
515
|
}
|
|
249
516
|
|
|
250
517
|
&-desktop {
|
|
251
|
-
|
|
518
|
+
display: none;
|
|
519
|
+
|
|
520
|
+
@screen md {
|
|
521
|
+
display: flex;
|
|
522
|
+
gap: theme("spacing.2");
|
|
523
|
+
}
|
|
252
524
|
}
|
|
253
525
|
}
|
|
254
526
|
}
|
|
@@ -265,17 +537,22 @@
|
|
|
265
537
|
}
|
|
266
538
|
|
|
267
539
|
.rdg-header-row {
|
|
268
|
-
|
|
540
|
+
color: theme("colors.lightLow");
|
|
541
|
+
font-weight: theme("fontWeight.normal");
|
|
542
|
+
|
|
543
|
+
:root .dark & {
|
|
544
|
+
color: theme("colors.darkLow");
|
|
545
|
+
}
|
|
269
546
|
|
|
270
547
|
.rdg-cell {
|
|
271
|
-
|
|
548
|
+
background-color: var(--rdg-header-background-color);
|
|
272
549
|
|
|
273
|
-
|
|
274
|
-
|
|
550
|
+
:root .dark & {
|
|
551
|
+
color: theme("colors.darkMedium");
|
|
552
|
+
}
|
|
275
553
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
554
|
+
&:not(:first-child) {
|
|
555
|
+
border-inline-start: 1px solid var(--rdg-border-color);
|
|
279
556
|
}
|
|
280
557
|
}
|
|
281
558
|
}
|
|
@@ -286,47 +563,13 @@
|
|
|
286
563
|
}
|
|
287
564
|
|
|
288
565
|
.rdg-cell {
|
|
566
|
+
border-block-end-width: 1px;
|
|
567
|
+
border-color: var(--rdg-border-color);
|
|
289
568
|
border-inline-end: none;
|
|
290
569
|
|
|
291
570
|
&.rdg-cell-frozen {
|
|
292
571
|
box-shadow: none;
|
|
293
572
|
}
|
|
294
|
-
|
|
295
|
-
&[aria-selected="true"] {
|
|
296
|
-
outline-color: theme("colors.gray.300");
|
|
297
|
-
|
|
298
|
-
:root .dark & {
|
|
299
|
-
outline-color: theme("colors.gray.700");
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.rdg-row[aria-selected="true"] {
|
|
305
|
-
@apply bg-gray-100/75 dark:bg-gray-900/75;
|
|
306
|
-
|
|
307
|
-
.uxf-data-grid__action-cell {
|
|
308
|
-
background-color: white;
|
|
309
|
-
|
|
310
|
-
:root .dark & {
|
|
311
|
-
background-color: theme("colors.gray.900");
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.rdg-row:hover {
|
|
317
|
-
@apply bg-gray-50 dark:bg-gray-950;
|
|
318
|
-
|
|
319
|
-
.uxf-data-grid__action-cell {
|
|
320
|
-
background-color: white;
|
|
321
|
-
|
|
322
|
-
:root .dark & {
|
|
323
|
-
background-color: theme("colors.gray.950");
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.rdg-row[aria-selected="true"]:hover {
|
|
329
|
-
@apply bg-gray-200/75 dark:bg-gray-800/75;
|
|
330
573
|
}
|
|
331
574
|
|
|
332
575
|
@keyframes datagridlineanim {
|
package/types/components.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { ComponentType, FC, ReactElement, ReactNode } from "react";
|
|
|
2
2
|
import { BaseGridType, Columns, Filter, Filters, Schema } from "./schema";
|
|
3
3
|
import { RequestFilter, Response } from "./api";
|
|
4
4
|
import { PaginationProps } from "@uxf/ui/pagination/pagination";
|
|
5
|
-
import {
|
|
5
|
+
import { RenderCheckboxProps } from "react-data-grid";
|
|
6
6
|
import { ChangeHiddenColumnsHandler, CsvDownloadHandler } from "./core";
|
|
7
7
|
import { DataGridState } from "./state";
|
|
8
8
|
/**
|
|
@@ -128,7 +128,7 @@ export type SelectedRowsToolbarComponent = FC<SelectedRowsToolbarProps>;
|
|
|
128
128
|
/**
|
|
129
129
|
* Select row checkbox
|
|
130
130
|
*/
|
|
131
|
-
export type SelectRowCheckboxComponent = React.FC<
|
|
131
|
+
export type SelectRowCheckboxComponent = React.FC<RenderCheckboxProps>;
|
|
132
132
|
/**
|
|
133
133
|
* Selected rows toolbar actions
|
|
134
134
|
*/
|