@uxf/data-grid 11.0.0-beta.13 → 11.0.0-beta.14

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.
@@ -19,5 +19,6 @@ export type GridType = {
19
19
  link: "string";
20
20
  sele: "select";
21
21
  seleBool: "select";
22
+ multiSelect: "multiSelect";
22
23
  };
23
24
  };
@@ -31,6 +31,17 @@ exports.schema = {
31
31
  { id: 2, label: "B" },
32
32
  ],
33
33
  },
34
+ {
35
+ name: "multiSelect",
36
+ label: "Multi select",
37
+ type: "multiSelect",
38
+ options: [
39
+ { label: "Option 1", id: "option-1" },
40
+ { label: "Option 2", id: "option-2" },
41
+ { label: "Option 3", id: "option-3" },
42
+ { label: "Option 4", id: "option-4" },
43
+ ],
44
+ },
34
45
  {
35
46
  name: "seleBool",
36
47
  type: "select",
@@ -22,6 +22,7 @@ const bool_filter_1 = __importDefault(require("./bool-filter"));
22
22
  const boolean_filter_1 = __importDefault(require("./boolean-filter"));
23
23
  const date_1 = __importDefault(require("./date"));
24
24
  const interval_filter_1 = __importDefault(require("./interval-filter"));
25
+ const multi_select_1 = __importDefault(require("./multi-select"));
25
26
  const select_filter_1 = __importDefault(require("./select-filter"));
26
27
  const text_filter_1 = __importDefault(require("./text-filter"));
27
28
  __exportStar(require("./types"), exports);
@@ -33,5 +34,6 @@ exports.defaultFilterHandlers = {
33
34
  boolean: boolean_filter_1.default,
34
35
  checkbox: boolean_filter_1.default,
35
36
  interval: interval_filter_1.default,
37
+ multiSelect: multi_select_1.default,
36
38
  select: select_filter_1.default,
37
39
  };
@@ -0,0 +1,3 @@
1
+ import { FilterHandler } from "./types";
2
+ declare const multiSelect: FilterHandler;
3
+ export default multiSelect;
@@ -0,0 +1,29 @@
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
+ const is_nil_1 = require("@uxf/core/utils/is-nil");
7
+ const chip_1 = require("@uxf/ui/chip");
8
+ const multi_select_1 = require("@uxf/ui/multi-select");
9
+ const react_1 = __importDefault(require("react"));
10
+ const multiSelect = {
11
+ input: (props) => {
12
+ var _a, _b;
13
+ return (react_1.default.createElement(multi_select_1.MultiSelect, { options: (_a = props.filter.options) !== null && _a !== void 0 ? _a : [], label: props.filter.label, value: (_b = props.value.value) === null || _b === void 0 ? void 0 : _b.map((id) => { var _a; return (_a = props.filter.options) === null || _a === void 0 ? void 0 : _a.find((option) => option.id === id); }), onChange: (value) => {
14
+ props.onFilter({
15
+ ...props.value,
16
+ value: (0, is_nil_1.isNil)(value) || value.length === 0 ? null : value.map((item) => item.id),
17
+ });
18
+ } }));
19
+ },
20
+ listItem: (props) => {
21
+ return (react_1.default.createElement(chip_1.Chip, { onClose: props.onClear },
22
+ props.filter.label,
23
+ ":\u00A0",
24
+ props.value.value
25
+ .map((id) => { var _a, _b; return (_b = (_a = props.filter.options) === null || _a === void 0 ? void 0 : _a.find((option) => option.id === id)) === null || _b === void 0 ? void 0 : _b.label; })
26
+ .join(", ")));
27
+ },
28
+ };
29
+ exports.default = multiSelect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/data-grid",
3
- "version": "11.0.0-beta.13",
3
+ "version": "11.0.0-beta.14",
4
4
  "description": "UXF DataGrid",
5
5
  "homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
6
6
  "main": "index.js",