@arim-aisdc/public-components 0.0.2 → 0.0.4
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/dist/components/Foo/index.d.ts +6 -0
- package/dist/{Foo → components/Foo}/index.js +6 -0
- package/dist/components/Foo/index.less +3 -0
- package/dist/components/TableMax/TableBody/Row.d.ts +38 -0
- package/dist/{TableMax → components/TableMax}/TableBody/Row.js +0 -1
- package/dist/components/TableMax/TableBody/index.d.ts +49 -0
- package/dist/{TableMax → components/TableMax}/TableBody/index.js +6 -12
- package/dist/components/TableMax/TableHeader/Cell.d.ts +13 -0
- package/dist/{TableMax → components/TableMax}/TableHeader/Cell.js +32 -17
- package/dist/components/TableMax/TableHeader/index.d.ts +16 -0
- package/dist/{TableMax → components/TableMax}/TableHeader/index.js +8 -15
- package/dist/{TableMax → components/TableMax}/TableHeader/index.less +23 -17
- package/dist/components/TableMax/TableHeader/utils.d.ts +1 -0
- package/dist/components/TableMax/TableMax.d.ts +18 -0
- package/dist/{TableMax/index.js → components/TableMax/TableMax.js} +170 -201
- package/dist/components/TableMax/components/ColumnEdit/components/numberRange/index.d.ts +8 -0
- package/dist/{TableMax → components/TableMax}/components/ColumnEdit/components/numberRange/index.js +4 -3
- package/dist/components/TableMax/components/ColumnEdit/index.d.ts +28 -0
- package/dist/{TableMax → components/TableMax}/components/ColumnEdit/index.js +31 -12
- package/dist/{TableMax → components/TableMax}/components/ColumnEdit/index.less +9 -4
- package/dist/components/TableMax/components/ColumnFilter/FilterDateRange/index.d.ts +16 -0
- package/dist/{TableMax → components/TableMax}/components/ColumnFilter/FilterDateRange/index.js +5 -4
- package/dist/components/TableMax/components/ColumnFilter/MultipleSelect/index.d.ts +8 -0
- package/dist/{TableMax → components/TableMax}/components/ColumnFilter/MultipleSelect/index.js +3 -2
- package/dist/components/TableMax/components/ColumnFilter/SingleSelect/index.d.ts +8 -0
- package/dist/{TableMax → components/TableMax}/components/ColumnFilter/SingleSelect/index.js +3 -2
- package/dist/components/TableMax/components/ColumnFilter/customFilterFns.d.ts +6 -0
- package/dist/{TableMax → components/TableMax}/components/ColumnFilter/customFilterFns.js +6 -1
- package/dist/components/TableMax/components/ColumnFilter/index.d.ts +21 -0
- package/dist/{TableMax → components/TableMax}/components/ColumnFilter/index.js +39 -36
- package/dist/components/TableMax/components/ColumnSetting/index.d.ts +18 -0
- package/dist/{TableMax → components/TableMax}/components/ColumnSetting/index.js +16 -29
- package/dist/components/TableMax/components/CustomDragerLayer/index.d.ts +2 -0
- package/dist/{TableMax → components/TableMax}/components/CustomDragerLayer/index.js +49 -9
- package/dist/{TableMax → components/TableMax}/components/CustomDragerLayer/index.less +9 -5
- package/dist/components/TableMax/index.d.ts +7 -0
- package/dist/components/TableMax/index.js +5 -0
- package/dist/{TableMax/index.less → components/TableMax/tableMax.less} +3 -7
- package/dist/components/TableMax/type.d.ts +250 -0
- package/dist/components/TableMax/type.js +1 -0
- package/dist/components/TableMax/utils.d.ts +6 -0
- package/dist/{TableMax → components/TableMax}/utils.js +1 -1
- package/dist/constants/index.d.ts +0 -0
- package/dist/constants/index.js +0 -0
- package/dist/hooks/usePageCacheState/config.d.ts +5 -0
- package/dist/hooks/usePageCacheState/config.js +1 -0
- package/dist/hooks/usePageCacheState/index.d.ts +25 -0
- package/dist/hooks/usePageCacheState/index.js +210 -0
- package/dist/hooks/usePageCacheState/tableDemoConfig.d.ts +3 -0
- package/dist/hooks/usePageCacheState/tableDemoConfig.js +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -2
- package/dist/themes/ThemeContext.d.ts +6 -0
- package/dist/themes/ThemeContext.js +51 -0
- package/dist/themes/custom-dark.css +28466 -0
- package/dist/themes/custom-light.css +28092 -0
- package/dist/themes/theme.d.ts +75 -0
- package/dist/themes/theme.js +147 -0
- package/dist/themes/variables.less +70 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +92 -89
- package/dist/Foo/index.less +0 -3
- package/dist/TableMax/type.d.ts +0 -216
- /package/dist/{TableMax → components/TableMax}/TableBody/index.less +0 -0
- /package/dist/{TableMax → components/TableMax}/TableHeader/utils.js +0 -0
- /package/dist/{TableMax → components/TableMax}/components/ColumnEdit/components/numberRange/index.less +0 -0
- /package/dist/{TableMax → components/TableMax}/components/ColumnFilter/FilterDateRange/index.less +0 -0
- /package/dist/{TableMax → components/TableMax}/components/ColumnFilter/MultipleSelect/index.less +0 -0
- /package/dist/{TableMax → components/TableMax}/components/ColumnFilter/SingleSelect/index.less +0 -0
- /package/dist/{TableMax → components/TableMax}/components/ColumnSetting/index.less +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
type IProps = {
|
|
3
|
+
precision: number | undefined;
|
|
4
|
+
value?: any[];
|
|
5
|
+
onChange?: (args: any[]) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const NumberRange: ({ precision, value, onChange }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default NumberRange;
|
package/dist/{TableMax → components/TableMax}/components/ColumnEdit/components/numberRange/index.js
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "antd/es/input-number/style";
|
|
2
|
+
import _InputNumber from "antd/es/input-number";
|
|
2
3
|
import "./index.less";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -8,7 +9,7 @@ var NumberRange = function NumberRange(_ref) {
|
|
|
8
9
|
_onChange = _ref.onChange;
|
|
9
10
|
return /*#__PURE__*/_jsxs("div", {
|
|
10
11
|
className: "tableMax-edit-numberRangeWrapper",
|
|
11
|
-
children: [/*#__PURE__*/_jsx(
|
|
12
|
+
children: [/*#__PURE__*/_jsx(_InputNumber, {
|
|
12
13
|
precision: precision,
|
|
13
14
|
min: 0,
|
|
14
15
|
max: value === null || value === void 0 ? void 0 : value[1],
|
|
@@ -16,7 +17,7 @@ var NumberRange = function NumberRange(_ref) {
|
|
|
16
17
|
onChange: function onChange(newValue) {
|
|
17
18
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange([newValue, value === null || value === void 0 ? void 0 : value[1]]);
|
|
18
19
|
}
|
|
19
|
-
}), /*#__PURE__*/_jsx(
|
|
20
|
+
}), /*#__PURE__*/_jsx(_InputNumber, {
|
|
20
21
|
precision: precision,
|
|
21
22
|
min: value === null || value === void 0 ? void 0 : value[0],
|
|
22
23
|
value: value === null || value === void 0 ? void 0 : value[1],
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare enum InputType {
|
|
4
|
+
InputNumber = "InputNumber",
|
|
5
|
+
NumberRange = "NumberRange",
|
|
6
|
+
Input = "Input",
|
|
7
|
+
DatePicker = "DatePicker",
|
|
8
|
+
Select = "Select"
|
|
9
|
+
}
|
|
10
|
+
interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
|
|
11
|
+
editing: boolean;
|
|
12
|
+
dataIndex: string;
|
|
13
|
+
title: any;
|
|
14
|
+
required: boolean;
|
|
15
|
+
editComType: InputType;
|
|
16
|
+
editOptions?: {
|
|
17
|
+
value: any;
|
|
18
|
+
label: any;
|
|
19
|
+
}[];
|
|
20
|
+
record: any;
|
|
21
|
+
index: number;
|
|
22
|
+
numberMin: number;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
precision: number | undefined;
|
|
25
|
+
ellipsis: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const EditableCell: React.FC<EditableCellProps>;
|
|
28
|
+
export {};
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import "antd/es/tooltip/style";
|
|
2
|
+
import _Tooltip from "antd/es/tooltip";
|
|
3
|
+
import "antd/es/form/style";
|
|
4
|
+
import _Form from "antd/es/form";
|
|
5
|
+
import "antd/es/input/style";
|
|
6
|
+
import _Input from "antd/es/input";
|
|
7
|
+
import "antd/es/select/style";
|
|
8
|
+
import _Select from "antd/es/select";
|
|
9
|
+
import "antd/es/date-picker/style";
|
|
10
|
+
import _DatePicker from "antd/es/date-picker";
|
|
11
|
+
import "antd/es/input-number/style";
|
|
12
|
+
import _InputNumber from "antd/es/input-number";
|
|
13
|
+
var _excluded = ["editing", "dataIndex", "title", "required", "editComType", "record", "index", "children", "precision", "numberMin", "editOptions", "ellipsis"];
|
|
2
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
15
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
-
import { DatePicker, Form, Input, InputNumber, Select } from 'antd';
|
|
5
16
|
import NumberRange from "./components/numberRange";
|
|
6
17
|
import "./index.less";
|
|
7
18
|
|
|
@@ -28,11 +39,12 @@ export var EditableCell = function EditableCell(_ref) {
|
|
|
28
39
|
numberMin = _ref.numberMin,
|
|
29
40
|
_ref$editOptions = _ref.editOptions,
|
|
30
41
|
editOptions = _ref$editOptions === void 0 ? [] : _ref$editOptions,
|
|
42
|
+
ellipsis = _ref.ellipsis,
|
|
31
43
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
44
|
var getEditComponent = function getEditComponent() {
|
|
33
45
|
switch (editComType) {
|
|
34
46
|
case InputType.InputNumber:
|
|
35
|
-
return /*#__PURE__*/_jsx(
|
|
47
|
+
return /*#__PURE__*/_jsx(_InputNumber, {
|
|
36
48
|
precision: precision,
|
|
37
49
|
placeholder: title,
|
|
38
50
|
min: numberMin ? numberMin : 0,
|
|
@@ -45,7 +57,7 @@ export var EditableCell = function EditableCell(_ref) {
|
|
|
45
57
|
precision: precision
|
|
46
58
|
});
|
|
47
59
|
case InputType.DatePicker:
|
|
48
|
-
return /*#__PURE__*/_jsx(
|
|
60
|
+
return /*#__PURE__*/_jsx(_DatePicker, {
|
|
49
61
|
showTime: true,
|
|
50
62
|
format: "YYYY-MM-DD HH:mm:ss",
|
|
51
63
|
allowClear: true,
|
|
@@ -55,11 +67,11 @@ export var EditableCell = function EditableCell(_ref) {
|
|
|
55
67
|
})
|
|
56
68
|
});
|
|
57
69
|
case InputType.Select:
|
|
58
|
-
return /*#__PURE__*/_jsx(
|
|
70
|
+
return /*#__PURE__*/_jsx(_Select, {
|
|
59
71
|
placeholder: title,
|
|
60
72
|
allowClear: true,
|
|
61
73
|
children: editOptions.map(function (item, index) {
|
|
62
|
-
return /*#__PURE__*/_jsx(
|
|
74
|
+
return /*#__PURE__*/_jsx(_Select.Option, {
|
|
63
75
|
value: item.value,
|
|
64
76
|
children: item.label
|
|
65
77
|
}, item.value || index);
|
|
@@ -67,7 +79,7 @@ export var EditableCell = function EditableCell(_ref) {
|
|
|
67
79
|
});
|
|
68
80
|
case InputType.Input:
|
|
69
81
|
default:
|
|
70
|
-
return /*#__PURE__*/_jsx(
|
|
82
|
+
return /*#__PURE__*/_jsx(_Input, {
|
|
71
83
|
placeholder: title,
|
|
72
84
|
allowClear: true
|
|
73
85
|
});
|
|
@@ -75,7 +87,7 @@ export var EditableCell = function EditableCell(_ref) {
|
|
|
75
87
|
};
|
|
76
88
|
return /*#__PURE__*/_jsx("div", {
|
|
77
89
|
className: "tableMax-cell-wrapper",
|
|
78
|
-
children: editing ? /*#__PURE__*/_jsx(
|
|
90
|
+
children: editing ? /*#__PURE__*/_jsx(_Form.Item, {
|
|
79
91
|
name: dataIndex,
|
|
80
92
|
style: {
|
|
81
93
|
margin: 0
|
|
@@ -83,11 +95,18 @@ export var EditableCell = function EditableCell(_ref) {
|
|
|
83
95
|
rules: [{
|
|
84
96
|
required: required,
|
|
85
97
|
message: "\u8BF7\u8F93\u5165".concat(title)
|
|
86
|
-
}]
|
|
87
|
-
onClick
|
|
88
|
-
|
|
89
|
-
},
|
|
98
|
+
}]
|
|
99
|
+
// onClick={e => e.stopPropagation()}
|
|
100
|
+
,
|
|
90
101
|
children: getEditComponent()
|
|
102
|
+
}) : ellipsis ? /*#__PURE__*/_jsx(_Tooltip, {
|
|
103
|
+
placement: "topLeft",
|
|
104
|
+
title: children,
|
|
105
|
+
mouseEnterDelay: 0.5,
|
|
106
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
107
|
+
className: "ellipsis",
|
|
108
|
+
children: children
|
|
109
|
+
})
|
|
91
110
|
}) : children
|
|
92
111
|
});
|
|
93
112
|
};
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
width: 100%;
|
|
4
4
|
padding: 0 8px;
|
|
5
5
|
|
|
6
|
+
.ellipsis {
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
text-overflow: ellipsis;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
.numberRangeWrapper {
|
|
7
13
|
display: flex;
|
|
8
14
|
flex-direction: column;
|
|
@@ -14,7 +20,7 @@
|
|
|
14
20
|
.custom-dark-input,
|
|
15
21
|
.custom-dark-input-affix-wrapper,
|
|
16
22
|
.custom-dark-switch {
|
|
17
|
-
background-color: #
|
|
23
|
+
background-color: #494c5dff;
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
.custom-dark-switch-checked {
|
|
@@ -23,7 +29,6 @@
|
|
|
23
29
|
|
|
24
30
|
.custom-dark-picker-clear,
|
|
25
31
|
.custom-dark-select-clear {
|
|
26
|
-
background-color: #
|
|
32
|
+
background-color: #494c5dff;
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TableMaxColumnType } from "../../../type";
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface IProps {
|
|
4
|
+
onChange: ({ startDate, endDate }?: {
|
|
5
|
+
startDate: number | string | null;
|
|
6
|
+
endDate: number | string | null;
|
|
7
|
+
}) => void;
|
|
8
|
+
value: {
|
|
9
|
+
startDate: number | null;
|
|
10
|
+
endDate: number | null;
|
|
11
|
+
} | undefined;
|
|
12
|
+
columnDef: TableMaxColumnType;
|
|
13
|
+
}
|
|
14
|
+
export declare const FilterDateRange: ({ onChange, value, columnDef }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const timeRangeFilter: (row: any, columnId: any, filterValue: any) => boolean;
|
|
16
|
+
export {};
|
package/dist/{TableMax → components/TableMax}/components/ColumnFilter/FilterDateRange/index.js
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "antd/es/date-picker/style";
|
|
2
|
+
import _DatePicker from "antd/es/date-picker";
|
|
2
3
|
import moment from 'moment';
|
|
3
4
|
import { useContext } from 'react';
|
|
4
|
-
import { TableContext } from "../../../
|
|
5
|
+
import { TableContext } from "../../../TableMax";
|
|
5
6
|
import { defaultDateFormat } from "../index";
|
|
6
7
|
import "./index.less";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -53,7 +54,7 @@ export var FilterDateRange = function FilterDateRange(_ref) {
|
|
|
53
54
|
};
|
|
54
55
|
return /*#__PURE__*/_jsxs("div", {
|
|
55
56
|
className: "date-range-filter-wapper",
|
|
56
|
-
children: [/*#__PURE__*/_jsx(
|
|
57
|
+
children: [/*#__PURE__*/_jsx(_DatePicker, {
|
|
57
58
|
value: value !== null && value !== void 0 && value.startDate ? moment(value === null || value === void 0 ? void 0 : value.startDate) : undefined,
|
|
58
59
|
disabledDate: disabledStartDate,
|
|
59
60
|
showTime: (_columnDef$filterComP3 = columnDef.filterComProps) === null || _columnDef$filterComP3 === void 0 ? void 0 : _columnDef$filterComP3.showTime,
|
|
@@ -66,7 +67,7 @@ export var FilterDateRange = function FilterDateRange(_ref) {
|
|
|
66
67
|
children: /*#__PURE__*/_jsx("span", {
|
|
67
68
|
className: "horizontal-line"
|
|
68
69
|
})
|
|
69
|
-
}), /*#__PURE__*/_jsx(
|
|
70
|
+
}), /*#__PURE__*/_jsx(_DatePicker, {
|
|
70
71
|
value: value !== null && value !== void 0 && value.endDate ? moment(value === null || value === void 0 ? void 0 : value.endDate) : undefined,
|
|
71
72
|
disabledDate: disabledEndDate,
|
|
72
73
|
className: "end-time",
|
package/dist/{TableMax → components/TableMax}/components/ColumnFilter/MultipleSelect/index.js
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "antd/es/select/style";
|
|
2
|
+
import _Select from "antd/es/select";
|
|
1
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -5,7 +7,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
7
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
9
|
import { useUpdateEffect } from 'ahooks';
|
|
8
|
-
import { Select } from 'antd';
|
|
9
10
|
import { useState } from 'react';
|
|
10
11
|
import "./index.less";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -32,7 +33,7 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
32
33
|
// console.log('value :>> ', value);
|
|
33
34
|
setInnerValue(Array.isArray(value) ? value : [value]);
|
|
34
35
|
}, [value.toString()]);
|
|
35
|
-
return /*#__PURE__*/_jsx(
|
|
36
|
+
return /*#__PURE__*/_jsx(_Select, {
|
|
36
37
|
mode: "multiple",
|
|
37
38
|
options: options,
|
|
38
39
|
allowClear: true,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "antd/es/select/style";
|
|
2
|
+
import _Select from "antd/es/select";
|
|
2
3
|
import "./index.less";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
var SingleSelect = function SingleSelect(_ref) {
|
|
@@ -8,7 +9,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
8
9
|
var handleClear = function handleClear() {
|
|
9
10
|
onChange('');
|
|
10
11
|
};
|
|
11
|
-
return /*#__PURE__*/_jsx(
|
|
12
|
+
return /*#__PURE__*/_jsx(_Select, {
|
|
12
13
|
showSearch: true,
|
|
13
14
|
allowClear: true,
|
|
14
15
|
value: value,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const customFilterFns: {
|
|
2
|
+
timeRangeFilter: (row: any, columnId: any, filterValue: any) => boolean;
|
|
3
|
+
fuzzyFilter: (row: any, columnId: any, filterValue: any) => boolean;
|
|
4
|
+
multiSelectFilter: (row: any, columnId: any, filterValue: any) => any;
|
|
5
|
+
};
|
|
6
|
+
export default customFilterFns;
|
|
@@ -8,10 +8,15 @@ var fuzzyFilter = function fuzzyFilter(row, columnId, filterValue) {
|
|
|
8
8
|
// console.log('object :>> ', rowStringValue, filterStringValue);
|
|
9
9
|
return rowStringValue.toUpperCase().indexOf(filterStringValue.toUpperCase().trim()) !== -1;
|
|
10
10
|
};
|
|
11
|
+
var multiSelectFilter = function multiSelectFilter(row, columnId, filterValue) {
|
|
12
|
+
var rowValue = row.getValue(columnId);
|
|
13
|
+
return filterValue.includes(rowValue + '');
|
|
14
|
+
};
|
|
11
15
|
|
|
12
16
|
// 自定义的过滤函数,后续都加在这里
|
|
13
17
|
var customFilterFns = {
|
|
14
18
|
timeRangeFilter: timeRangeFilter,
|
|
15
|
-
fuzzyFilter: fuzzyFilter
|
|
19
|
+
fuzzyFilter: fuzzyFilter,
|
|
20
|
+
multiSelectFilter: multiSelectFilter
|
|
16
21
|
};
|
|
17
22
|
export default customFilterFns;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BuiltInFilterFn, Column } from '@tanstack/react-table';
|
|
2
|
+
import { TableMaxColumnType } from "../../type";
|
|
3
|
+
import customFilterFns from './customFilterFns';
|
|
4
|
+
export declare const defaultDateFormat = "YYYY-MM-DD";
|
|
5
|
+
export declare enum FilterType {
|
|
6
|
+
Date = "date",
|
|
7
|
+
SingleDate = "singleDate",
|
|
8
|
+
Integer = "integer",
|
|
9
|
+
SingleInteger = "singleInteger",
|
|
10
|
+
SingleSelect = "singleSelect",
|
|
11
|
+
MultiSelect = "multiSelect",
|
|
12
|
+
AutoComplete = "autoComplete"
|
|
13
|
+
}
|
|
14
|
+
export type FilterFnType = keyof typeof customFilterFns | BuiltInFilterFn | undefined;
|
|
15
|
+
export type IFilterFnEnum = {
|
|
16
|
+
[key in FilterType]: FilterFnType;
|
|
17
|
+
};
|
|
18
|
+
export declare function setDefaultFilterFn(columns: TableMaxColumnType[]): TableMaxColumnType[];
|
|
19
|
+
export declare function Filter({ column }: {
|
|
20
|
+
column: Column<any, unknown>;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import "antd/es/auto-complete/style";
|
|
2
|
+
import _AutoComplete from "antd/es/auto-complete";
|
|
3
|
+
import "antd/es/input-number/style";
|
|
4
|
+
import _InputNumber from "antd/es/input-number";
|
|
5
|
+
import "antd/es/date-picker/style";
|
|
6
|
+
import _DatePicker from "antd/es/date-picker";
|
|
1
7
|
var _FILTER_FN_ENUM;
|
|
2
8
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
10
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
11
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
-
import { AutoComplete, DatePicker, InputNumber } from 'antd';
|
|
7
12
|
import moment from 'moment';
|
|
8
13
|
import { useMemo } from 'react';
|
|
9
14
|
import { FilterDateRange } from "./FilterDateRange";
|
|
10
15
|
import MultipleSelect from "./MultipleSelect";
|
|
11
16
|
import SingleSelect from "./SingleSelect";
|
|
12
17
|
import { useContext } from 'react';
|
|
13
|
-
import { TableContext } from "../../
|
|
18
|
+
import { TableContext } from "../../TableMax";
|
|
14
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
21
|
export var defaultDateFormat = 'YYYY-MM-DD';
|
|
@@ -23,10 +28,11 @@ export var FilterType = /*#__PURE__*/function (FilterType) {
|
|
|
23
28
|
FilterType["SingleInteger"] = "singleInteger";
|
|
24
29
|
FilterType["SingleSelect"] = "singleSelect";
|
|
25
30
|
FilterType["MultiSelect"] = "multiSelect";
|
|
31
|
+
FilterType["AutoComplete"] = "autoComplete";
|
|
26
32
|
return FilterType;
|
|
27
|
-
}({}); //
|
|
33
|
+
}({}); // 自动补全
|
|
28
34
|
// 不同筛选类型需要特定的过滤函数
|
|
29
|
-
var FILTER_FN_ENUM = (_FILTER_FN_ENUM = {}, _defineProperty(_FILTER_FN_ENUM, FilterType.Date, 'timeRangeFilter'), _defineProperty(_FILTER_FN_ENUM, FilterType.SingleDate, 'fuzzyFilter'), _defineProperty(_FILTER_FN_ENUM, FilterType.MultiSelect, '
|
|
35
|
+
var FILTER_FN_ENUM = (_FILTER_FN_ENUM = {}, _defineProperty(_FILTER_FN_ENUM, FilterType.Date, 'timeRangeFilter'), _defineProperty(_FILTER_FN_ENUM, FilterType.SingleDate, 'fuzzyFilter'), _defineProperty(_FILTER_FN_ENUM, FilterType.MultiSelect, 'multiSelectFilter'), _defineProperty(_FILTER_FN_ENUM, FilterType.Integer, 'inNumberRange'), _defineProperty(_FILTER_FN_ENUM, FilterType.SingleInteger, 'fuzzyFilter'), _defineProperty(_FILTER_FN_ENUM, FilterType.SingleSelect, 'fuzzyFilter'), _defineProperty(_FILTER_FN_ENUM, FilterType.AutoComplete, 'fuzzyFilter'), _FILTER_FN_ENUM);
|
|
30
36
|
|
|
31
37
|
// 给columns配置填充默认的过滤函数
|
|
32
38
|
export function setDefaultFilterFn(columns) {
|
|
@@ -35,20 +41,18 @@ export function setDefaultFilterFn(columns) {
|
|
|
35
41
|
// 当前列指定了过滤组件,但是没有指定过滤函数,在这里自动补上
|
|
36
42
|
column.filterFn = FILTER_FN_ENUM[column.filterType];
|
|
37
43
|
} else if (!column.filterType && !column.filterFn) {
|
|
38
|
-
// 默认使用
|
|
39
|
-
column.filterFn =
|
|
44
|
+
// 默认使用MultiSelect组件的场景,加上过滤函数
|
|
45
|
+
column.filterFn = FILTER_FN_ENUM[FilterType.MultiSelect];
|
|
40
46
|
}
|
|
41
47
|
column.columns && setDefaultFilterFn(column.columns);
|
|
42
48
|
});
|
|
43
49
|
return columns;
|
|
44
50
|
}
|
|
45
51
|
export function Filter(_ref) {
|
|
46
|
-
var column = _ref.column
|
|
47
|
-
table = _ref.table,
|
|
48
|
-
filterFn = _ref.filterFn;
|
|
52
|
+
var column = _ref.column;
|
|
49
53
|
var _useContext = useContext(TableContext),
|
|
50
54
|
manualFiltering = _useContext.manualFiltering;
|
|
51
|
-
var columnDef =
|
|
55
|
+
var columnDef = column === null || column === void 0 ? void 0 : column.columnDef;
|
|
52
56
|
// 筛选组件类型
|
|
53
57
|
var filterType = columnDef.filterType,
|
|
54
58
|
filterOptions = columnDef.filterOptions;
|
|
@@ -102,7 +106,7 @@ export function Filter(_ref) {
|
|
|
102
106
|
columnDef: columnDef
|
|
103
107
|
});
|
|
104
108
|
case FilterType.SingleDate:
|
|
105
|
-
return /*#__PURE__*/_jsx(
|
|
109
|
+
return /*#__PURE__*/_jsx(_DatePicker, {
|
|
106
110
|
value: columnFilterValue ? moment(columnFilterValue) : undefined,
|
|
107
111
|
showTime: (_columnDef$filterComP = columnDef.filterComProps) === null || _columnDef$filterComP === void 0 ? void 0 : _columnDef$filterComP.showTime,
|
|
108
112
|
format: ((_columnDef$filterComP2 = columnDef.filterComProps) === null || _columnDef$filterComP2 === void 0 ? void 0 : _columnDef$filterComP2.format) || defaultDateFormat,
|
|
@@ -118,11 +122,10 @@ export function Filter(_ref) {
|
|
|
118
122
|
display: 'flex'
|
|
119
123
|
},
|
|
120
124
|
children: [/*#__PURE__*/_jsx("div", {
|
|
121
|
-
children: /*#__PURE__*/_jsx(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
, {
|
|
125
|
+
children: /*#__PURE__*/_jsx(_InputNumber, {
|
|
126
|
+
// min={Number(column.getFacetedMinMaxValues()?.[0] ?? '')}
|
|
127
|
+
// max={Number(column.getFacetedMinMaxValues()?.[1] ?? '')}
|
|
128
|
+
// value={(columnFilterValue as [number, number])?.[0] ?? ''}
|
|
126
129
|
placeholder: "".concat((_column$getFacetedMin = column.getFacetedMinMaxValues()) !== null && _column$getFacetedMin !== void 0 && _column$getFacetedMin[0] ? "(".concat((_column$getFacetedMin2 = column.getFacetedMinMaxValues()) === null || _column$getFacetedMin2 === void 0 ? void 0 : _column$getFacetedMin2[0], ")") : ''),
|
|
127
130
|
controls: false,
|
|
128
131
|
onChange: function onChange(value) {
|
|
@@ -138,11 +141,10 @@ export function Filter(_ref) {
|
|
|
138
141
|
}) : columnFilterValue === null || columnFilterValue === void 0 ? void 0 : columnFilterValue[0]
|
|
139
142
|
})
|
|
140
143
|
}), /*#__PURE__*/_jsx("div", {
|
|
141
|
-
children: /*#__PURE__*/_jsx(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
, {
|
|
144
|
+
children: /*#__PURE__*/_jsx(_InputNumber, {
|
|
145
|
+
// min={Number(column.getFacetedMinMaxValues()?.[0] ?? '')}
|
|
146
|
+
// max={Number(column.getFacetedMinMaxValues()?.[1] ?? '')}
|
|
147
|
+
// value={(columnFilterValue as [number, number])?.[1] ?? ''}
|
|
146
148
|
placeholder: "".concat((_column$getFacetedMin3 = column.getFacetedMinMaxValues()) !== null && _column$getFacetedMin3 !== void 0 && _column$getFacetedMin3[1] ? "(".concat((_column$getFacetedMin4 = column.getFacetedMinMaxValues()) === null || _column$getFacetedMin4 === void 0 ? void 0 : _column$getFacetedMin4[1], ")") : ''),
|
|
147
149
|
controls: false,
|
|
148
150
|
onChange: function onChange(value) {
|
|
@@ -160,7 +162,7 @@ export function Filter(_ref) {
|
|
|
160
162
|
})]
|
|
161
163
|
});
|
|
162
164
|
case FilterType.SingleInteger:
|
|
163
|
-
return /*#__PURE__*/_jsx(
|
|
165
|
+
return /*#__PURE__*/_jsx(_InputNumber, {
|
|
164
166
|
controls: false,
|
|
165
167
|
style: {
|
|
166
168
|
width: '100%',
|
|
@@ -177,20 +179,8 @@ export function Filter(_ref) {
|
|
|
177
179
|
}
|
|
178
180
|
}) : columnFilterValue
|
|
179
181
|
});
|
|
180
|
-
case FilterType.
|
|
181
|
-
return /*#__PURE__*/_jsx(
|
|
182
|
-
value: columnFilterValue,
|
|
183
|
-
onChange: handleChangeFilterValue,
|
|
184
|
-
options: sortedUniqueValues
|
|
185
|
-
});
|
|
186
|
-
case FilterType.SingleSelect:
|
|
187
|
-
return /*#__PURE__*/_jsx(SingleSelect, {
|
|
188
|
-
value: columnFilterValue,
|
|
189
|
-
onChange: handleChangeFilterValue,
|
|
190
|
-
options: sortedUniqueValues
|
|
191
|
-
});
|
|
192
|
-
default:
|
|
193
|
-
return /*#__PURE__*/_jsx(AutoComplete, {
|
|
182
|
+
case FilterType.AutoComplete:
|
|
183
|
+
return /*#__PURE__*/_jsx(_AutoComplete, {
|
|
194
184
|
options: sortedUniqueValues,
|
|
195
185
|
placeholder: "",
|
|
196
186
|
filterOption: function filterOption(inputValue, option) {
|
|
@@ -209,6 +199,19 @@ export function Filter(_ref) {
|
|
|
209
199
|
allowClear: true,
|
|
210
200
|
value: columnFilterValue
|
|
211
201
|
});
|
|
202
|
+
case FilterType.SingleSelect:
|
|
203
|
+
return /*#__PURE__*/_jsx(SingleSelect, {
|
|
204
|
+
value: columnFilterValue,
|
|
205
|
+
onChange: handleChangeFilterValue,
|
|
206
|
+
options: sortedUniqueValues
|
|
207
|
+
});
|
|
208
|
+
case FilterType.MultiSelect:
|
|
209
|
+
default:
|
|
210
|
+
return /*#__PURE__*/_jsx(MultipleSelect, {
|
|
211
|
+
value: columnFilterValue,
|
|
212
|
+
onChange: handleChangeFilterValue,
|
|
213
|
+
options: sortedUniqueValues
|
|
214
|
+
});
|
|
212
215
|
}
|
|
213
216
|
};
|
|
214
217
|
return filterComponent(columnDef.filterType);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ColumnPinningConfigType, ColumnVisibleConfigType } from "../../type";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
type ColumnSettingProps = {
|
|
5
|
+
table: any;
|
|
6
|
+
initColumnOrder: string[];
|
|
7
|
+
canSelection?: boolean;
|
|
8
|
+
canRowDrag?: boolean;
|
|
9
|
+
columnVisibleConfig?: ColumnVisibleConfigType;
|
|
10
|
+
columnPinningConfig?: ColumnPinningConfigType;
|
|
11
|
+
tableId: string;
|
|
12
|
+
onFilterSwitchChange: (checked: boolean) => void;
|
|
13
|
+
canFilter: boolean;
|
|
14
|
+
enableFilters: boolean;
|
|
15
|
+
getRowCanExpand?: () => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: React.NamedExoticComponent<ColumnSettingProps>;
|
|
18
|
+
export default _default;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import "antd/es/tooltip/style";
|
|
2
|
+
import _Tooltip from "antd/es/tooltip";
|
|
3
|
+
import "antd/es/checkbox/style";
|
|
4
|
+
import _Checkbox from "antd/es/checkbox";
|
|
5
|
+
import "antd/es/switch/style";
|
|
6
|
+
import _Switch from "antd/es/switch";
|
|
1
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
8
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
9
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -8,28 +14,17 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
15
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import { Checkbox, Switch, Tooltip } from 'antd';
|
|
12
17
|
import { cloneDeep } from 'lodash';
|
|
13
18
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
14
19
|
import { useDrag, useDrop } from 'react-dnd';
|
|
15
20
|
import { createPortal } from 'react-dom';
|
|
16
21
|
import { ColumnType } from "../../index";
|
|
17
22
|
import "./index.less";
|
|
18
|
-
|
|
19
|
-
// 主题存localstorage名称
|
|
20
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
24
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
export var tgPoiFrontendTheme = 'tg-poi-frontend-theme';
|
|
23
|
-
|
|
24
|
-
// 主题类型
|
|
25
|
-
export var themeType = {
|
|
26
|
-
light: 'light',
|
|
27
|
-
dark: 'dark'
|
|
28
|
-
};
|
|
29
25
|
var ColumnSetting = function ColumnSetting(_ref) {
|
|
30
26
|
var table = _ref.table,
|
|
31
27
|
initColumnOrder = _ref.initColumnOrder,
|
|
32
|
-
isSplit = _ref.isSplit,
|
|
33
28
|
canFilter = _ref.canFilter,
|
|
34
29
|
canSelection = _ref.canSelection,
|
|
35
30
|
canRowDrag = _ref.canRowDrag,
|
|
@@ -39,7 +34,6 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
39
34
|
onFilterSwitchChange = _ref.onFilterSwitchChange,
|
|
40
35
|
enableFilters = _ref.enableFilters,
|
|
41
36
|
getRowCanExpand = _ref.getRowCanExpand;
|
|
42
|
-
var isDark = localStorage.getItem(tgPoiFrontendTheme) === themeType.dark;
|
|
43
37
|
var _useState = useState(false),
|
|
44
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
39
|
settingVisible = _useState2[0],
|
|
@@ -91,13 +85,6 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
91
85
|
setSettingVisible(!settingVisible);
|
|
92
86
|
};
|
|
93
87
|
var columnPinningGroup = useMemo(function () {
|
|
94
|
-
// if (!isSplit)
|
|
95
|
-
// return [
|
|
96
|
-
// {
|
|
97
|
-
// groupList: table.getAllLeafColumns(),
|
|
98
|
-
// groupName: '',
|
|
99
|
-
// },
|
|
100
|
-
// ];
|
|
101
88
|
var arr = [];
|
|
102
89
|
var leftLength = 0;
|
|
103
90
|
// canSelection && leftLength++;
|
|
@@ -116,7 +103,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
116
103
|
// console.log('columnPinningGroup===============', arr);
|
|
117
104
|
|
|
118
105
|
return arr;
|
|
119
|
-
}, [
|
|
106
|
+
}, [columnOrder, columnPinning, table.getState().columnPinning]);
|
|
120
107
|
return /*#__PURE__*/_jsxs("div", {
|
|
121
108
|
id: tableId,
|
|
122
109
|
className: "column-setting-container",
|
|
@@ -133,7 +120,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
133
120
|
className: "column-filtering",
|
|
134
121
|
children: [/*#__PURE__*/_jsx("span", {
|
|
135
122
|
children: "\u663E\u793A\u7B5B\u9009"
|
|
136
|
-
}), /*#__PURE__*/_jsx(
|
|
123
|
+
}), /*#__PURE__*/_jsx(_Switch, {
|
|
137
124
|
className: "switch-button",
|
|
138
125
|
defaultChecked: enableFilters,
|
|
139
126
|
onChange: onFilterSwitchChange
|
|
@@ -142,7 +129,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
142
129
|
className: "column-setting-wapper",
|
|
143
130
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
144
131
|
className: "column-setting-header",
|
|
145
|
-
children: [/*#__PURE__*/_jsx(
|
|
132
|
+
children: [/*#__PURE__*/_jsx(_Checkbox, {
|
|
146
133
|
checked: table.getIsAllColumnsVisible(),
|
|
147
134
|
onChange: table.getToggleAllColumnsVisibilityHandler(),
|
|
148
135
|
children: "\u5168\u9009"
|
|
@@ -179,6 +166,10 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
179
166
|
}), document.body) : null]
|
|
180
167
|
});
|
|
181
168
|
};
|
|
169
|
+
var reorderColumn = function reorderColumn(draggedColumnId, targetColumnId, columnOrder) {
|
|
170
|
+
columnOrder.splice(columnOrder.indexOf(targetColumnId), 0, columnOrder.splice(columnOrder === null || columnOrder === void 0 ? void 0 : columnOrder.indexOf(draggedColumnId), 1)[0]);
|
|
171
|
+
return _toConsumableArray(columnOrder);
|
|
172
|
+
};
|
|
182
173
|
var SettingItem = function SettingItem(_ref3) {
|
|
183
174
|
var _column$columnDef, _column$columnDef2;
|
|
184
175
|
var table = _ref3.table,
|
|
@@ -314,14 +305,14 @@ var SettingItem = function SettingItem(_ref3) {
|
|
|
314
305
|
className: "content-left",
|
|
315
306
|
children: [/*#__PURE__*/_jsx("i", {
|
|
316
307
|
className: "icon iconfont-other icon-other-drag drag-handle"
|
|
317
|
-
}), /*#__PURE__*/_jsx(
|
|
308
|
+
}), /*#__PURE__*/_jsx(_Checkbox, {
|
|
318
309
|
checked: column.getIsVisible(),
|
|
319
310
|
onChange: column.getToggleVisibilityHandler(),
|
|
320
|
-
children: typeof (column === null || column === void 0 || (_column$columnDef = column.columnDef) === null || _column$columnDef === void 0 ? void 0 : _column$columnDef.header)
|
|
311
|
+
children: typeof (column === null || column === void 0 || (_column$columnDef = column.columnDef) === null || _column$columnDef === void 0 ? void 0 : _column$columnDef.header) === 'function' ? column.columnDef.header() : column === null || column === void 0 || (_column$columnDef2 = column.columnDef) === null || _column$columnDef2 === void 0 ? void 0 : _column$columnDef2.header
|
|
321
312
|
})]
|
|
322
313
|
}), /*#__PURE__*/_jsx("span", {
|
|
323
314
|
children: getPinningButton().map(function (item) {
|
|
324
|
-
return /*#__PURE__*/_jsx(
|
|
315
|
+
return /*#__PURE__*/_jsx(_Tooltip, {
|
|
325
316
|
placement: "top",
|
|
326
317
|
title: item.tooltip,
|
|
327
318
|
children: /*#__PURE__*/_jsx("i", {
|
|
@@ -337,8 +328,4 @@ var SettingItem = function SettingItem(_ref3) {
|
|
|
337
328
|
})
|
|
338
329
|
});
|
|
339
330
|
};
|
|
340
|
-
var reorderColumn = function reorderColumn(draggedColumnId, targetColumnId, columnOrder) {
|
|
341
|
-
columnOrder.splice(columnOrder.indexOf(targetColumnId), 0, columnOrder.splice(columnOrder === null || columnOrder === void 0 ? void 0 : columnOrder.indexOf(draggedColumnId), 1)[0]);
|
|
342
|
-
return _toConsumableArray(columnOrder);
|
|
343
|
-
};
|
|
344
331
|
export default /*#__PURE__*/React.memo(ColumnSetting);
|