@uxf/data-grid 11.11.0 → 11.11.2
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/body-cell/body-cell-boolean.js +1 -1
- package/data-grid.stories.js +1 -1
- package/filter-handler/bool-filter.js +1 -1
- package/filter-handler/boolean-filter.js +1 -1
- package/filter-handler/date.js +2 -2
- package/filter-handler/interval-filter.js +2 -2
- package/filter-handler/multi-select.js +1 -1
- package/filter-handler/select-filter.js +1 -1
- package/filter-handler/text-filter.js +1 -1
- package/fulltext-input/fulltext-input.js +1 -1
- package/hidden-columns/hidden-columns.js +1 -1
- package/package.json +2 -2
- package/rows-per-page-select/rows-per-page-select.js +1 -1
- package/table/components/select-row-checkbox.js +25 -4
|
@@ -12,6 +12,6 @@ const BodyCellBoolean = (props) => {
|
|
|
12
12
|
}
|
|
13
13
|
// TODO @vejvis: implement onChange
|
|
14
14
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__body-cell--boolean" },
|
|
15
|
-
react_1.default.createElement(checkbox_1.Checkbox, { value: props.value, onChange: () => void null, isDisabled: true })));
|
|
15
|
+
react_1.default.createElement(checkbox_1.Checkbox, { value: props.value, name: props.column.name, onChange: () => void null, isDisabled: true })));
|
|
16
16
|
};
|
|
17
17
|
exports.BodyCellBoolean = BodyCellBoolean;
|
package/data-grid.stories.js
CHANGED
|
@@ -54,7 +54,7 @@ function Default() {
|
|
|
54
54
|
state,
|
|
55
55
|
});
|
|
56
56
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
57
|
-
react_1.default.createElement(toggle_1.Toggle, { label: "No border", value: noBorder, onChange: (value) => setNoBorder(!!value) }),
|
|
57
|
+
react_1.default.createElement(toggle_1.Toggle, { label: "No border", value: noBorder, onChange: (value) => setNoBorder(!!value), name: "noBorder" }),
|
|
58
58
|
react_1.default.createElement(data_grid_1.DataGrid, { onReload: onReload, state: state, actions: actions, data: data, isLoading: isLoading, error: error, schema: schema_1.schema, onCsvDownload: console.log, noBorder: noBorder, isRowSelectable: true, actionCell: {
|
|
59
59
|
width: 100,
|
|
60
60
|
Component: () => {
|
|
@@ -11,7 +11,7 @@ const BoolFilterHandler = {
|
|
|
11
11
|
{ id: "", label: "Nerozhoduje" },
|
|
12
12
|
{ id: 1, label: "Ano" },
|
|
13
13
|
{ id: 0, label: "Ne" },
|
|
14
|
-
], label: props.filter.label, value: props.value.value, onChange: (value) => props.onFilter({ ...props.value, value }), isClearable: true })),
|
|
14
|
+
], label: props.filter.label, value: props.value.value, onChange: (value) => props.onFilter({ ...props.value, value }), isClearable: true, name: props.filter.name })),
|
|
15
15
|
listItem: (props) => (react_1.default.createElement(chip_1.Chip, { onClose: props.onClear },
|
|
16
16
|
props.filter.label,
|
|
17
17
|
":\u00A0",
|
|
@@ -7,7 +7,7 @@ const checkbox_input_1 = require("@uxf/ui/checkbox-input");
|
|
|
7
7
|
const chip_1 = require("@uxf/ui/chip");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const BooleanFilterHandler = {
|
|
10
|
-
input: (props) => (react_1.default.createElement(checkbox_input_1.CheckboxInput, { label: props.filter.label, value: props.value.value, onChange: (value) => props.onFilter({ ...props.value, value: value === true ? value : undefined }) })),
|
|
10
|
+
input: (props) => (react_1.default.createElement(checkbox_input_1.CheckboxInput, { label: props.filter.label, value: props.value.value, onChange: (value) => props.onFilter({ ...props.value, value: value === true ? value : undefined }), name: props.filter.name })),
|
|
11
11
|
listItem: (props) => (react_1.default.createElement(chip_1.Chip, { onClose: props.onClear },
|
|
12
12
|
props.filter.label,
|
|
13
13
|
":\u00A0",
|
package/filter-handler/date.js
CHANGED
|
@@ -19,8 +19,8 @@ const date = {
|
|
|
19
19
|
react_1.default.createElement(date_picker_input_1.DatePickerInput, { value: initializedValue.value.from, onChange: (changedValue) => props.onFilter({
|
|
20
20
|
...initializedValue,
|
|
21
21
|
value: { ...initializedValue.value, from: changedValue },
|
|
22
|
-
}), label: `${props.filter.label} (od)
|
|
23
|
-
react_1.default.createElement(date_picker_input_1.DatePickerInput, { value: initializedValue.value.to, onChange: (changedValue) => props.onFilter({ ...initializedValue, value: { ...initializedValue.value, to: changedValue } }), label: `${props.filter.label} (do)
|
|
22
|
+
}), label: `${props.filter.label} (od)`, name: props.filter.name }),
|
|
23
|
+
react_1.default.createElement(date_picker_input_1.DatePickerInput, { value: initializedValue.value.to, onChange: (changedValue) => props.onFilter({ ...initializedValue, value: { ...initializedValue.value, to: changedValue } }), label: `${props.filter.label} (do)`, name: props.filter.name })));
|
|
24
24
|
},
|
|
25
25
|
listItem: function (props) {
|
|
26
26
|
if ((0, is_nil_1.isNil)(props.value.value)) {
|
|
@@ -23,7 +23,7 @@ const IntervalFilterHandler = {
|
|
|
23
23
|
from: val ? parseInt(val, 10) : null,
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
|
-
} }),
|
|
26
|
+
}, name: props.filter.name }),
|
|
27
27
|
react_1.default.createElement("div", { className: "uxf-data-grid__filter-gap" }, "\u2013"),
|
|
28
28
|
react_1.default.createElement(text_input_1.TextInput, { label: `${props.filter.label} do:`, value: props.value.value ? props.value.value.to : "", onChange: (val) => {
|
|
29
29
|
return props.onFilter({
|
|
@@ -33,7 +33,7 @@ const IntervalFilterHandler = {
|
|
|
33
33
|
to: val ? parseInt(val, 10) : null,
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
|
-
} }))));
|
|
36
|
+
}, name: props.filter.name }))));
|
|
37
37
|
},
|
|
38
38
|
listItem: (props) => {
|
|
39
39
|
if (!props.value.value) {
|
|
@@ -15,7 +15,7 @@ const multiSelect = {
|
|
|
15
15
|
...props.value,
|
|
16
16
|
value: (0, is_nil_1.isNil)(value) || value.length === 0 ? null : value.map((item) => item.id),
|
|
17
17
|
});
|
|
18
|
-
} }));
|
|
18
|
+
}, name: props.filter.name }));
|
|
19
19
|
},
|
|
20
20
|
listItem: (props) => {
|
|
21
21
|
return (react_1.default.createElement(chip_1.Chip, { onClose: props.onClear },
|
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const SelectFilterHandler = {
|
|
10
10
|
input: (props) => {
|
|
11
11
|
var _a;
|
|
12
|
-
return (react_1.default.createElement(select_1.Select, { options: (_a = props.filter.options) !== null && _a !== void 0 ? _a : [], label: props.filter.label, value: props.value.value, onChange: (value) => props.onFilter({ ...props.value, value }), isClearable: true }));
|
|
12
|
+
return (react_1.default.createElement(select_1.Select, { options: (_a = props.filter.options) !== null && _a !== void 0 ? _a : [], label: props.filter.label, value: props.value.value, onChange: (value) => props.onFilter({ ...props.value, value }), isClearable: true, name: props.filter.name }));
|
|
13
13
|
},
|
|
14
14
|
listItem: (props) => {
|
|
15
15
|
var _a, _b, _c;
|
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const TextFilterHandler = {
|
|
10
10
|
input: (props) => {
|
|
11
11
|
var _a;
|
|
12
|
-
return (react_1.default.createElement(text_input_1.TextInput, { label: props.filter.label, value: (_a = props.value.value) !== null && _a !== void 0 ? _a : "", onChange: (value) => props.onFilter({ ...props.value, value }) }));
|
|
12
|
+
return (react_1.default.createElement(text_input_1.TextInput, { label: props.filter.label, value: (_a = props.value.value) !== null && _a !== void 0 ? _a : "", onChange: (value) => props.onFilter({ ...props.value, value }), name: props.filter.name }));
|
|
13
13
|
},
|
|
14
14
|
listItem: (props) => {
|
|
15
15
|
if (!props.value.value) {
|
|
@@ -8,6 +8,6 @@ const icon_1 = require("@uxf/ui/icon");
|
|
|
8
8
|
const text_input_1 = require("@uxf/ui/text-input");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
10
|
function FulltextInput(props) {
|
|
11
|
-
return (react_1.default.createElement(text_input_1.TextInput, { value: props.state.request.search, onChange: props.actions.search, 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 }));
|
|
11
|
+
return (react_1.default.createElement(text_input_1.TextInput, { value: props.state.request.search, onChange: props.actions.search, 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, name: "fulltext" }));
|
|
12
12
|
}
|
|
13
13
|
exports.FulltextInput = FulltextInput;
|
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
function HiddenColumns(props) {
|
|
10
10
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__toolbar-control-columns" }, props.schema.columns.map((column) => {
|
|
11
11
|
var _a, _b;
|
|
12
|
-
return (react_1.default.createElement(toggle_1.Toggle, { key: column.name, label: typeof column.label === "string" ? column.label : "", value: !((_b = (_a = props.state.userConfig.columns) === null || _a === void 0 ? void 0 : _a[column.name]) === null || _b === void 0 ? void 0 : _b.isHidden), onChange: (value) => value ? props.actions.showColumn(column.name) : props.actions.hideColumn(column.name) }));
|
|
12
|
+
return (react_1.default.createElement(toggle_1.Toggle, { key: column.name, label: typeof column.label === "string" ? column.label : "", value: !((_b = (_a = props.state.userConfig.columns) === null || _a === void 0 ? void 0 : _a[column.name]) === null || _b === void 0 ? void 0 : _b.isHidden), onChange: (value) => value ? props.actions.showColumn(column.name) : props.actions.hideColumn(column.name), name: column.name }));
|
|
13
13
|
})));
|
|
14
14
|
}
|
|
15
15
|
exports.HiddenColumns = HiddenColumns;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/data-grid",
|
|
3
|
-
"version": "11.11.
|
|
3
|
+
"version": "11.11.2",
|
|
4
4
|
"description": "UXF DataGrid",
|
|
5
5
|
"homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@uxf/ui": "11.11.
|
|
34
|
+
"@uxf/ui": "11.11.2",
|
|
35
35
|
"dayjs": "1.11.10",
|
|
36
36
|
"fast-glob": "3.3.2",
|
|
37
37
|
"qs": "6.11.2",
|
|
@@ -15,6 +15,6 @@ const PER_PAGE_OPTIONS = [
|
|
|
15
15
|
function RowsPerPageSelect(props) {
|
|
16
16
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__rows-per-page" },
|
|
17
17
|
react_1.default.createElement("label", { htmlFor: "uxf-data-grid--select-per-page" }, "Po\u010Det \u0159\u00E1dk\u016F"),
|
|
18
|
-
react_1.default.createElement(select_1.Select, { id: "uxf-data-grid--select-per-page", value: props.state.request.perPage, onChange: (value) => props.actions.changePerPage(value !== null && value !== void 0 ? value : 10), options: PER_PAGE_OPTIONS, size: "small", label: "Po\u010Det \u0159\u00E1dk\u016F", hiddenLabel: true })));
|
|
18
|
+
react_1.default.createElement(select_1.Select, { id: "uxf-data-grid--select-per-page", value: props.state.request.perPage, onChange: (value) => props.actions.changePerPage(value !== null && value !== void 0 ? value : 10), options: PER_PAGE_OPTIONS, size: "small", label: "Po\u010Det \u0159\u00E1dk\u016F", hiddenLabel: true, name: "rows-per-page" })));
|
|
19
19
|
}
|
|
20
20
|
exports.RowsPerPageSelect = RowsPerPageSelect;
|
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.SelectRowCheckbox = void 0;
|
|
7
27
|
const checkbox_1 = require("@uxf/ui/checkbox");
|
|
8
|
-
const react_1 =
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
9
29
|
function SelectRowCheckbox(props) {
|
|
10
30
|
var _a;
|
|
11
31
|
const handleChange = (value, e) => {
|
|
@@ -14,7 +34,8 @@ function SelectRowCheckbox(props) {
|
|
|
14
34
|
props.onChange(value, shiftKey);
|
|
15
35
|
}
|
|
16
36
|
};
|
|
37
|
+
const id = (0, react_1.useId)();
|
|
17
38
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__select-row-checkbox-wrapper" },
|
|
18
|
-
react_1.default.createElement(checkbox_1.Checkbox, { ...props, value: (_a = props.checked) !== null && _a !== void 0 ? _a : false, onChange: handleChange })));
|
|
39
|
+
react_1.default.createElement(checkbox_1.Checkbox, { ...props, value: (_a = props.checked) !== null && _a !== void 0 ? _a : false, onChange: handleChange, name: id })));
|
|
19
40
|
}
|
|
20
41
|
exports.SelectRowCheckbox = SelectRowCheckbox;
|