@uxf/data-grid 11.21.5 → 11.22.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/filter-handler/interval.d.ts +1 -5
- package/filter-handler/interval.js +5 -26
- package/package.json +4 -4
- package/styles.css +0 -12
- package/table-v2/components/cell.d.ts +8 -2
- package/table-v2/components/cell.js +1 -1
- package/table-v2/components/header-cell.js +1 -1
- package/table-v2/table-v2.js +1 -1
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { FilterHandler } from "./types";
|
|
2
|
-
|
|
3
|
-
from?: number | null;
|
|
4
|
-
to?: number | null;
|
|
5
|
-
} | undefined;
|
|
6
|
-
declare const filterHandler: FilterHandler<StateValue>;
|
|
2
|
+
declare const filterHandler: FilterHandler<string>;
|
|
7
3
|
export default filterHandler;
|
|
@@ -3,43 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const filter_nullish_1 = require("@uxf/core/utils/filter-nullish");
|
|
7
|
-
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
8
6
|
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
|
9
|
-
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
10
7
|
const chip_1 = require("@uxf/ui/chip");
|
|
11
|
-
const
|
|
8
|
+
const date_range_picker_input_1 = require("@uxf/ui/date-range-picker-input");
|
|
12
9
|
const react_1 = __importDefault(require("react"));
|
|
13
10
|
const filterHandler = {
|
|
14
11
|
Input(props) {
|
|
15
|
-
|
|
16
|
-
const onChangeFrom = (value) => props.onChange({
|
|
17
|
-
...props.value,
|
|
18
|
-
from: (0, is_not_nil_1.isNotNil)(value) && !(0, is_empty_1.isEmpty)(value) ? parseInt(value, 10) : null,
|
|
19
|
-
});
|
|
20
|
-
const onChangeTo = (value) => props.onChange({
|
|
21
|
-
...props.value,
|
|
22
|
-
to: (0, is_not_nil_1.isNotNil)(value) && !(0, is_empty_1.isEmpty)(value) ? parseInt(value, 10) : null,
|
|
23
|
-
});
|
|
12
|
+
const onChange = (value) => props.onChange(value !== null && value !== void 0 ? value : "");
|
|
24
13
|
return (react_1.default.createElement("div", { key: props.filter.name },
|
|
25
14
|
react_1.default.createElement("div", { className: "uxf-data-grid__filter uxf-data-grid__filter--interval" },
|
|
26
|
-
react_1.default.createElement(
|
|
27
|
-
react_1.default.createElement("div", { className: "uxf-data-grid__filter-gap" }, "\u2013"),
|
|
28
|
-
react_1.default.createElement(text_input_1.TextInput, { label: `${props.filter.label} do:`, value: (_f = (_e = (_d = props.value) === null || _d === void 0 ? void 0 : _d.to) === null || _e === void 0 ? void 0 : _e.toString()) !== null && _f !== void 0 ? _f : "", onChange: onChangeTo, name: props.filter.name }))));
|
|
15
|
+
react_1.default.createElement(date_range_picker_input_1.DateRangePickerInput, { label: props.filter.label, name: props.filter.name, onChange: onChange, value: props.value }))));
|
|
29
16
|
},
|
|
30
17
|
ListItem(props) {
|
|
31
|
-
|
|
32
|
-
if ((0, is_nil_1.isNil)((_a = props.value) === null || _a === void 0 ? void 0 : _a.from) && (0, is_nil_1.isNil)((_b = props.value) === null || _b === void 0 ? void 0 : _b.to)) {
|
|
18
|
+
if ((0, is_nil_1.isNil)(props.value)) {
|
|
33
19
|
return null;
|
|
34
20
|
}
|
|
35
|
-
|
|
36
|
-
props.value.from ? "od " + props.value.from : null,
|
|
37
|
-
props.value.to ? "do " + props.value.to : null,
|
|
38
|
-
];
|
|
39
|
-
return (react_1.default.createElement(chip_1.Chip, { onClose: props.onClear },
|
|
40
|
-
props.filter.label,
|
|
41
|
-
" ",
|
|
42
|
-
(0, filter_nullish_1.filterNullish)(formatInterval).join(" ")));
|
|
21
|
+
return react_1.default.createElement(chip_1.Chip, { onClose: props.onClear }, props.value);
|
|
43
22
|
},
|
|
44
23
|
};
|
|
45
24
|
exports.default = filterHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/data-grid",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.22.1",
|
|
4
4
|
"description": "UXF DataGrid",
|
|
5
5
|
"homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@uxf/core": "11.
|
|
35
|
-
"@uxf/core-react": "11.
|
|
36
|
-
"@uxf/ui": "11.
|
|
34
|
+
"@uxf/core": "11.22.0",
|
|
35
|
+
"@uxf/core-react": "11.22.0",
|
|
36
|
+
"@uxf/ui": "11.22.1",
|
|
37
37
|
"dayjs": "1.11.10",
|
|
38
38
|
"deepmerge": "4.3.1",
|
|
39
39
|
"fast-glob": "3.3.2",
|
package/styles.css
CHANGED
|
@@ -172,18 +172,6 @@
|
|
|
172
172
|
gap: theme("spacing.4");
|
|
173
173
|
grid-template-columns: repeat(2, 1fr);
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
&--interval {
|
|
177
|
-
display: grid;
|
|
178
|
-
gap: theme("spacing.4");
|
|
179
|
-
grid-template-columns: 1fr min-content 1fr;
|
|
180
|
-
|
|
181
|
-
.uxf-data-grid__filter-gap {
|
|
182
|
-
align-items: center;
|
|
183
|
-
display: flex;
|
|
184
|
-
padding-top: theme("spacing.5");
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
175
|
}
|
|
188
176
|
|
|
189
177
|
&__filters {
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Column } from "../../types";
|
|
3
|
+
interface CellProps {
|
|
4
|
+
column: Column<any, any>;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function Cell(props: CellProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Cell = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function Cell(props) {
|
|
9
|
-
return react_1.default.createElement("div", { className:
|
|
9
|
+
return react_1.default.createElement("div", { className: `uxf-dg-table__cell uxf-dg-table__cell--type-${props.column.type}` }, props.children);
|
|
10
10
|
}
|
|
11
11
|
exports.Cell = Cell;
|
|
@@ -38,7 +38,7 @@ function HeaderCellComponent(props, ref) {
|
|
|
38
38
|
: "sort";
|
|
39
39
|
return (
|
|
40
40
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
41
|
-
react_1.default.createElement("div", { ref: ref, className: (0, cx_1.cx)(
|
|
41
|
+
react_1.default.createElement("div", { ref: ref, className: (0, cx_1.cx)(`uxf-dg-table__cell uxf-dg-table__cell--header uxf-dg-table__cell--type-${props.column.type}`, props.column.sort && "is-sortable"), onClick: props.onClick },
|
|
42
42
|
props.column.label,
|
|
43
43
|
iconName && react_1.default.createElement(icon_1.Icon, { name: iconName, className: "ml-auto" }),
|
|
44
44
|
react_1.default.createElement("button", { className: "uxf-dg-table__column-resize-handle", onMouseDown: props.onResizeStart, onClick: (event) => event.stopPropagation() })));
|
package/table-v2/table-v2.js
CHANGED
|
@@ -43,7 +43,7 @@ function TableV2(props) {
|
|
|
43
43
|
const BodyCell =
|
|
44
44
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
45
45
|
(_d = (_b = (_a = props.bodyCells) === null || _a === void 0 ? void 0 : _a[column.type]) !== null && _b !== void 0 ? _b : (_c = props.bodyCells) === null || _c === void 0 ? void 0 : _c.default) !== null && _d !== void 0 ? _d : DefaultBodyCell;
|
|
46
|
-
return (react_1.default.createElement(components_1.Table.Cell, { key: column.name },
|
|
46
|
+
return (react_1.default.createElement(components_1.Table.Cell, { key: column.name, column: column },
|
|
47
47
|
react_1.default.createElement(BodyCell, { column: column, row: row, value: row[column.name], reload: () => { var _a; return (_a = props.onReload) === null || _a === void 0 ? void 0 : _a.call(props); } })));
|
|
48
48
|
}),
|
|
49
49
|
(0, is_not_nil_1.isNotNil)(props.actionCell) && (react_1.default.createElement(components_1.Table.ActionCell, null,
|