@kdcloudjs/table 1.1.2 → 1.1.3-canary.10
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/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +611 -207
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +6 -6
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/table/base/helpers/TableDOMUtils.d.ts +2 -0
- package/es/table/base/helpers/TableDOMUtils.js +48 -12
- package/es/table/base/helpers/getRichVisibleRectsStream.js +1 -1
- package/es/table/base/html-table.js +1 -1
- package/es/table/base/styles.d.ts +2 -0
- package/es/table/base/styles.js +4 -2
- package/es/table/base/table.d.ts +0 -1
- package/es/table/base/table.js +22 -29
- package/es/table/pipeline/features/columnDrag.js +27 -16
- package/es/table/pipeline/features/columnFilter.d.ts +2 -2
- package/es/table/pipeline/features/columnFilter.js +33 -12
- package/es/table/pipeline/features/contextMenu.js +1 -0
- package/es/table/pipeline/features/filter/DefaultFilterIcon.d.ts +5 -0
- package/es/table/pipeline/features/filter/DefaultFilterIcon.js +20 -0
- package/es/table/pipeline/features/filter/Filter.d.ts +1 -1
- package/es/table/pipeline/features/filter/Filter.js +16 -20
- package/es/table/pipeline/features/filter/FilterPanel.js +25 -16
- package/es/table/pipeline/features/filter/util.js +4 -4
- package/es/table/pipeline/features/footerDataSource.d.ts +9 -0
- package/es/table/pipeline/features/footerDataSource.js +25 -0
- package/es/table/pipeline/features/index.d.ts +2 -0
- package/es/table/pipeline/features/index.js +3 -1
- package/es/table/pipeline/features/mergeCellHover.d.ts +2 -0
- package/es/table/pipeline/features/mergeCellHover.js +32 -0
- package/es/table/pipeline/features/multiSelect.js +7 -2
- package/es/table/pipeline/features/rangeSelection.d.ts +1 -1
- package/es/table/pipeline/features/rangeSelection.js +156 -28
- package/es/table/pipeline/features/singleSelect.js +4 -0
- package/es/table/pipeline/features/treeMode.d.ts +2 -0
- package/es/table/pipeline/features/treeMode.js +18 -20
- package/es/table/pipeline/pipeline.d.ts +5 -1
- package/es/table/pipeline/pipeline.js +11 -10
- package/lib/table/base/helpers/TableDOMUtils.d.ts +2 -0
- package/lib/table/base/helpers/TableDOMUtils.js +51 -12
- package/lib/table/base/helpers/getRichVisibleRectsStream.js +1 -1
- package/lib/table/base/html-table.js +1 -1
- package/lib/table/base/styles.d.ts +2 -0
- package/lib/table/base/styles.js +4 -2
- package/lib/table/base/table.d.ts +0 -1
- package/lib/table/base/table.js +22 -29
- package/lib/table/pipeline/features/columnDrag.js +27 -16
- package/lib/table/pipeline/features/columnFilter.d.ts +2 -2
- package/lib/table/pipeline/features/columnFilter.js +31 -12
- package/lib/table/pipeline/features/contextMenu.js +1 -0
- package/lib/table/pipeline/features/filter/DefaultFilterIcon.d.ts +5 -0
- package/lib/table/pipeline/features/filter/DefaultFilterIcon.js +30 -0
- package/lib/table/pipeline/features/filter/Filter.d.ts +1 -1
- package/lib/table/pipeline/features/filter/Filter.js +17 -20
- package/lib/table/pipeline/features/filter/FilterPanel.js +25 -15
- package/lib/table/pipeline/features/filter/util.js +4 -4
- package/lib/table/pipeline/features/footerDataSource.d.ts +9 -0
- package/lib/table/pipeline/features/footerDataSource.js +41 -0
- package/lib/table/pipeline/features/index.d.ts +2 -0
- package/lib/table/pipeline/features/index.js +23 -1
- package/lib/table/pipeline/features/mergeCellHover.d.ts +2 -0
- package/lib/table/pipeline/features/mergeCellHover.js +43 -0
- package/lib/table/pipeline/features/multiSelect.js +6 -1
- package/lib/table/pipeline/features/rangeSelection.d.ts +1 -1
- package/lib/table/pipeline/features/rangeSelection.js +158 -30
- package/lib/table/pipeline/features/singleSelect.js +4 -0
- package/lib/table/pipeline/features/treeMode.d.ts +2 -0
- package/lib/table/pipeline/features/treeMode.js +19 -22
- package/lib/table/pipeline/pipeline.d.ts +5 -1
- package/lib/table/pipeline/pipeline.js +12 -10
- package/package.json +2 -2
|
@@ -18,4 +18,6 @@ export declare class TableDOMHelper {
|
|
|
18
18
|
getRightLockShadow(): HTMLDivElement;
|
|
19
19
|
getLoadingIndicator(): HTMLDivElement;
|
|
20
20
|
getRowTop(rowIndex: number): number;
|
|
21
|
+
getRowNodeListByEvent: (e: React.MouseEvent<HTMLTableRowElement, MouseEvent>) => HTMLElement[];
|
|
22
|
+
getInRangeRowByCellEvent: (e: React.MouseEvent<HTMLTableCellElement, MouseEvent>) => unknown[];
|
|
21
23
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
3
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
4
|
+
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
3
5
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
4
6
|
import { Classes } from '../styles'; // 表格 DOM 结构
|
|
5
7
|
// div.art-table-wrapper
|
|
@@ -41,10 +43,44 @@ import { Classes } from '../styles'; // 表格 DOM 结构
|
|
|
41
43
|
|
|
42
44
|
export var TableDOMHelper = /*#__PURE__*/function () {
|
|
43
45
|
function TableDOMHelper(artTableWrapper) {
|
|
44
|
-
var
|
|
46
|
+
var _this = this,
|
|
47
|
+
_context2;
|
|
45
48
|
|
|
46
49
|
_classCallCheck(this, TableDOMHelper);
|
|
47
50
|
|
|
51
|
+
this.getRowNodeListByEvent = function (e) {
|
|
52
|
+
var nodeList = null;
|
|
53
|
+
var rowIndex = e.currentTarget.dataset.rowindex;
|
|
54
|
+
|
|
55
|
+
if (rowIndex !== undefined) {
|
|
56
|
+
var targetParent = _this.tableBody.contains(e.currentTarget) ? _this.tableBody : _this.tableFooter;
|
|
57
|
+
nodeList = targetParent.querySelectorAll("tr[data-rowindex=\"".concat(rowIndex, "\"]"));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return nodeList;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
this.getInRangeRowByCellEvent = function (e) {
|
|
64
|
+
var _context;
|
|
65
|
+
|
|
66
|
+
var _a;
|
|
67
|
+
|
|
68
|
+
var getParentNode = function getParentNode(ele, target) {
|
|
69
|
+
if (ele.parentNode.nodeName === target) {
|
|
70
|
+
return ele.parentNode;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return getParentNode(ele.parentNode, target);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
e = e instanceof Array ? e[0] : e;
|
|
77
|
+
var curCell = e === null || e === void 0 ? void 0 : e.currentTarget;
|
|
78
|
+
var curRow = getParentNode(curCell, 'TR');
|
|
79
|
+
var curRowSpan = parseInt(e.currentTarget.getAttribute('rowspan')) || 1;
|
|
80
|
+
var rows = (_a = getParentNode(curCell, 'TABLE')) === null || _a === void 0 ? void 0 : _a.rows;
|
|
81
|
+
return _sliceInstanceProperty(_context = _Array$from(rows)).call(_context, curRow.rowIndex, curRow.rowIndex + curRowSpan);
|
|
82
|
+
};
|
|
83
|
+
|
|
48
84
|
this.artTableWrapper = artTableWrapper;
|
|
49
85
|
this.artTable = artTableWrapper.querySelector(".".concat(Classes.artTable));
|
|
50
86
|
this.tableHeader = this.artTable.querySelector(".".concat(Classes.tableHeader));
|
|
@@ -55,7 +91,7 @@ export var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
55
91
|
this.tableFooter = this.artTable.querySelector(".".concat(Classes.tableFooter));
|
|
56
92
|
this.tableFooterMain = this.artTable.querySelector(".".concat(Classes.tableFooterMain));
|
|
57
93
|
|
|
58
|
-
var stickyScrollSelector = _concatInstanceProperty(
|
|
94
|
+
var stickyScrollSelector = _concatInstanceProperty(_context2 = ".".concat(Classes.artTable, " + .")).call(_context2, Classes.stickyScroll);
|
|
59
95
|
|
|
60
96
|
this.stickyScroll = artTableWrapper.querySelector(stickyScrollSelector);
|
|
61
97
|
this.stickyScrollItem = this.stickyScroll.querySelector(".".concat(Classes.stickyScrollItem));
|
|
@@ -69,33 +105,33 @@ export var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
69
105
|
}, {
|
|
70
106
|
key: "getTableRows",
|
|
71
107
|
value: function getTableRows() {
|
|
72
|
-
var
|
|
108
|
+
var _context3;
|
|
73
109
|
|
|
74
|
-
var tbody = this.artTable.querySelector(_concatInstanceProperty(
|
|
110
|
+
var tbody = this.artTable.querySelector(_concatInstanceProperty(_context3 = ".".concat(Classes.tableBody, " .")).call(_context3, Classes.virtual, " table tbody"));
|
|
75
111
|
return tbody.childNodes;
|
|
76
112
|
}
|
|
77
113
|
}, {
|
|
78
114
|
key: "getTableBodyHtmlTable",
|
|
79
115
|
value: function getTableBodyHtmlTable() {
|
|
80
|
-
var
|
|
116
|
+
var _context4;
|
|
81
117
|
|
|
82
|
-
return this.artTable.querySelector(_concatInstanceProperty(
|
|
118
|
+
return this.artTable.querySelector(_concatInstanceProperty(_context4 = ".".concat(Classes.tableBody, " .")).call(_context4, Classes.virtual, " table"));
|
|
83
119
|
}
|
|
84
120
|
}, {
|
|
85
121
|
key: "getLeftLockShadow",
|
|
86
122
|
value: function getLeftLockShadow() {
|
|
87
|
-
var
|
|
123
|
+
var _context5;
|
|
88
124
|
|
|
89
|
-
var selector = _concatInstanceProperty(
|
|
125
|
+
var selector = _concatInstanceProperty(_context5 = ".".concat(Classes.lockShadowMask, " .")).call(_context5, Classes.leftLockShadow);
|
|
90
126
|
|
|
91
127
|
return this.artTable.querySelector(selector);
|
|
92
128
|
}
|
|
93
129
|
}, {
|
|
94
130
|
key: "getRightLockShadow",
|
|
95
131
|
value: function getRightLockShadow() {
|
|
96
|
-
var
|
|
132
|
+
var _context6;
|
|
97
133
|
|
|
98
|
-
var selector = _concatInstanceProperty(
|
|
134
|
+
var selector = _concatInstanceProperty(_context6 = ".".concat(Classes.lockShadowMask, " .")).call(_context6, Classes.rightLockShadow);
|
|
99
135
|
|
|
100
136
|
return this.artTable.querySelector(selector);
|
|
101
137
|
}
|
|
@@ -107,11 +143,11 @@ export var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
107
143
|
}, {
|
|
108
144
|
key: "getRowTop",
|
|
109
145
|
value: function getRowTop(rowIndex) {
|
|
110
|
-
var
|
|
146
|
+
var _context7, _context8;
|
|
111
147
|
|
|
112
148
|
if (rowIndex === 0) return 0;
|
|
113
149
|
|
|
114
|
-
var selector = _concatInstanceProperty(
|
|
150
|
+
var selector = _concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = ".".concat(Classes.tableBody, " .")).call(_context8, Classes.tableRow, "[data-rowindex=\"")).call(_context7, rowIndex, "\"]");
|
|
115
151
|
|
|
116
152
|
var row = this.artTable.querySelector(selector);
|
|
117
153
|
var rowOffsetTop = row && row.offsetTop || 0;
|
|
@@ -12,7 +12,7 @@ import * as op from 'rxjs/operators';
|
|
|
12
12
|
import { shallowEqual } from '../utils';
|
|
13
13
|
|
|
14
14
|
function isWindow(arg) {
|
|
15
|
-
return arg.toString() === '[object Window]';
|
|
15
|
+
return arg.toString() === '[object Window]' || arg.toString() === '[object global]';
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function isBody(arg) {
|
|
@@ -124,7 +124,7 @@ export function HtmlTable(_ref) {
|
|
|
124
124
|
positionStyle.left = hozInfo.stickyLeftMap.get(colIndex);
|
|
125
125
|
} else if (colIndex >= fullFlatCount - rightFlatCount) {
|
|
126
126
|
positionStyle.position = 'sticky';
|
|
127
|
-
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) - stickyRightOffset;
|
|
127
|
+
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) - (typeof stickyRightOffset === 'number' ? stickyRightOffset : 0);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
return /*#__PURE__*/React.createElement('td', _extends(_extends(_extends(_extends({
|
|
@@ -40,6 +40,8 @@ export declare const Classes: {
|
|
|
40
40
|
readonly button: string;
|
|
41
41
|
readonly buttonPrimary: string;
|
|
42
42
|
readonly filterIcon: string;
|
|
43
|
+
readonly rangeSelection: string;
|
|
44
|
+
readonly tableCellRangeSingleCell: string;
|
|
43
45
|
readonly tableCellRangeSelected: string;
|
|
44
46
|
readonly tableCellRangeTop: string;
|
|
45
47
|
readonly tableCellRangeLeft: string;
|
package/es/table/base/styles.js
CHANGED
|
@@ -53,6 +53,8 @@ export var Classes = {
|
|
|
53
53
|
button: "".concat(prefix, "btn"),
|
|
54
54
|
buttonPrimary: "".concat(prefix, "btn-primary"),
|
|
55
55
|
filterIcon: "".concat(prefix, "filter-icon"),
|
|
56
|
+
rangeSelection: "".concat(prefix, "range-selection"),
|
|
57
|
+
tableCellRangeSingleCell: "".concat(prefix, "table-cell-range-single-cell"),
|
|
56
58
|
tableCellRangeSelected: "".concat(prefix, "table-cell-range-selected"),
|
|
57
59
|
tableCellRangeTop: "".concat(prefix, "table-cell-range-top"),
|
|
58
60
|
tableCellRangeLeft: "".concat(prefix, "table-cell-range-left"),
|
|
@@ -101,7 +103,7 @@ export var defaultCSSVariables = {
|
|
|
101
103
|
'--primary-color': '#5582F3',
|
|
102
104
|
'--primary-color-level1': 'rgb(242, 248, 255)',
|
|
103
105
|
'--primary-color-level2': 'rgb(135, 173, 255)',
|
|
104
|
-
'--icon-color': '#
|
|
106
|
+
'--icon-color': '#666666',
|
|
105
107
|
'--strong-border-color': '#d9d9d9',
|
|
106
108
|
'--header-row-height': '32px',
|
|
107
109
|
'--header-color': '#333',
|
|
@@ -120,7 +122,7 @@ export var defaultCSSVariables = {
|
|
|
120
122
|
'--header-cell-border-horizontal': '1px solid #dfe3e8'
|
|
121
123
|
};
|
|
122
124
|
export var variableConst = getCssVariableText(defaultCSSVariables);
|
|
123
|
-
export var StyledArtTableWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n :root {\n ", "\n }\n ", "\n\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n cursor: default;\n color: var(--color);\n font-size: var(--font-size);\n line-height: var(--line-height);\n position: relative;\n\n // \u8868\u683C\u5916\u8FB9\u6846\u7531 art-table-wrapper \u63D0\u4F9B\uFF0C\u800C\u4E0D\u662F\u7531\u5355\u5143\u683C\u63D0\u4F9B\n &.use-outer-border {\n ", ";\n }\n\n .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n
|
|
125
|
+
export var StyledArtTableWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n :root {\n ", "\n }\n ", "\n\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n cursor: default;\n color: var(--color);\n font-size: var(--font-size);\n line-height: var(--line-height);\n position: relative;\n\n // \u8868\u683C\u5916\u8FB9\u6846\u7531 art-table-wrapper \u63D0\u4F9B\uFF0C\u800C\u4E0D\u662F\u7531\u5355\u5143\u683C\u63D0\u4F9B\n &.use-outer-border {\n ", ";\n }\n\n .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n }\n\n .", " {\n overflow: hidden;\n background: var(--header-bgcolor);\n display: flex;\n flex-shrink: 0;\n border-bottom: var(--header-cell-border-horizontal);\n }\n\n .", " {\n display: flex;\n // justify-content: flex-start;\n align-items: center;\n height: inherit;\n }\n\n .", " {\n overflow-x:auto;\n flex-shrink: 0;\n flex-grow: 0;\n scrollbar-width: none; // \u517C\u5BB9\u706B\u72D0\n & {\n ::-webkit-scrollbar {\n display:none;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: none;\n }\n .", ", .", " {\n background: var(--bgcolor);\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n position:relative;\n &.empty {\n position: relative;\n }\n }\n\n .", " {\n position: relative;\n }\n .", ", .", " {\n .", "{\n background-color: #e6effb !important;\n }\n .", "{\n border-top: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-left: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-bottom: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-right: 1px solid #0E5FD8 !important;\n }\n }\n \n .", " {\n user-select:none;\n }\n\n\n &.sticky-header .", " {\n position: sticky;\n top: 0;\n z-index: ", ";\n }\n\n &.sticky-footer .", " {\n position: sticky;\n bottom: 0;\n z-index: ", ";\n }\n\n table {\n width: 0;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n display: table;\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n flex-grow: 0;\n position:relative;\n }\n\n // \u5728 tr \u4E0A\u8BBE\u7F6E .no-hover \u53EF\u4EE5\u7981\u7528\u9F20\u6807\u60AC\u505C\u6548\u679C\n tr:not(.no-hover):hover > td {\n background: var(--hover-bgcolor);\n }\n // \u4F7F\u7528 js \u6DFB\u52A0\u60AC\u6D6E\u6548\u679C\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n // \u5728 tr \u8BBE\u7F6E highlight \u53EF\u4EE5\u4E3A\u5E95\u4E0B\u7684 td \u8BBE\u7F6E\u4E3A\u9AD8\u4EAE\u8272\n // \u800C\u8BBE\u7F6E .no-highlight \u7684\u8BDD\u5219\u53EF\u4EE5\u7981\u7528\u9AD8\u4EAE\u6548\u679C\uFF1B\n tr:not(.no-highlight).highlight > td {\n background: var(--highlight-bgcolor);\n }\n\n th {\n font-weight: normal;\n text-align: left;\n padding: var(--cell-padding);\n height: var(--header-row-height);\n color: var(--header-color);\n background: var(--header-bgcolor);\n border:1px solid transparent;\n border-right: var(--header-cell-border-vertical);\n border-bottom: var(--header-cell-border-horizontal);\n position: relative;\n }\n\n th.resizeable{\n border-right:none\n }\n\n th.", " {\n border-right: none;\n border-bottom: none;\n }\n\n tr.", " th {\n border-top: var(--header-cell-border-horizontal);\n }\n th.", " {\n border-left: var(--header-cell-border-vertical);\n }\n\n td {\n padding: var(--cell-padding);\n background: var(--bgcolor);\n height: var(--row-height);\n border:1px solid transparent;\n border-right: var(--cell-border-vertical);\n border-bottom: var(--cell-border-horizontal);\n word-break: break-all;\n }\n td.", " {\n border-left: var(--cell-border-vertical);\n }\n tr.", " td {\n border-top: var(--cell-border-horizontal);\n }\n &.has-header tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tbody tr.", " td {\n border-bottom: none;\n }\n\n .", ",\n .", " {\n z-index: ", ";\n }\n\n //#region \u9501\u5217\u9634\u5F71\n .", " {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: ", ";\n pointer-events: none;\n overflow: hidden;\n\n .", " {\n height: 100%;\n }\n\n .", " {\n margin-right: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-right: var(--cell-border-vertical);\n }\n }\n\n .", " {\n margin-left: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-left: var(--cell-border-vertical);\n }\n }\n }\n //#endregion\n\n //#region \u7A7A\u8868\u683C\u5C55\u73B0\n .", " {\n pointer-events: none;\n color: #99a3b3;\n font-size: 12px;\n text-align: center;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n .empty-image {\n width: 50px;\n height: 50px;\n }\n\n .empty-tips {\n margin-top: 16px;\n line-height: 1.5;\n }\n }\n //#endregion\n\n //#region IE\u517C\u5BB9\n &.ie-polyfill-wrapper {\n //\u9501\u5B9A\u5217\u517C\u5BB9 \u4EC5\u5728\u9501\u5B9A\u5217\u7684\u60C5\u51B5\u4E0B\u751F\u6548\n .", " {\n overflow-x: hidden;\n }\n .", ", .", " {\n position:relative;\n }\n .", " {\n overflow: hidden;\n }\n .", " {\n position: relative;\n }\n\n .", " {\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n }\n\n .", ", .", "{\n position: absolute;\n z-index: ", ";\n top: 0;\n }\n .", "{\n left:0;\n }\n .", "{\n right:0;\n }\n\n .", "{\n .", "{\n position: absolute;\n top: 0;\n width: 100%;\n z-index: ", ";\n }\n }\n\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n }\n //#endregion\n\n //#region \u7C98\u6027\u6EDA\u52A8\u6761\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 0;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\n background: var(--bgcolor);\n }\n\n .", " {\n // \u5FC5\u987B\u6709\u9AD8\u5EA6\u624D\u80FD\u51FA\u73B0\u6EDA\u52A8\u6761\n height: 1px;\n visibility: hidden;\n }\n //#endregion\n\n //#region \u52A0\u8F7D\u6837\u5F0F\n .", " {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: auto;\n\n .", " {\n filter: none;\n width: 100%;\n height: 100%;\n overflow: hidden;//\u5217\u5168\u90E8\u56FA\u5B9A\u65F6\uFF0C\u5B58\u5728\u53CC\u6A2A\u5411\u6EDA\u52A8\u6761\n display: flex;\n position: relative;\n flex-direction: column;\n }\n\n .", " {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .", " {\n position: sticky;\n z-index: ", ";\n transform: translateY(-50%);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u8FC7\u6EE4\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n padding: 6px 4px;\n &:hover{\n background-color: #e5e5e5;\n }\n }\n .", " {\n display: flex\n }\n //#endregion\n\n //#region \u8868\u683C\u6392\u5E8F\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u6EDA\u52A8\u6761\u5360\u4F4D\n .", " {\n visibility: hidden;\n flex-shrink: 0;\n }\n .", " .", " {\n border-top: var(--cell-border-horizontal);\n }\n //#endregion\n "])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableFooter, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.rangeSelection, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, Classes.leaf, Classes.first, Classes.first, Classes.first, Classes.first, Classes.first, Classes.last, Classes.lockLeft, Classes.lockRight, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, LOCK_SHADOW_PADDING, Classes.rightLockShadow, LOCK_SHADOW_PADDING, Classes.emptyWrapper, Classes.virtual, Classes.tableBody, Classes.tableFooter, Classes.tableHeaderMain, Classes.tableHeader, Classes.tableFooterMain, Classes.fixedLeft, Classes.fixedRight, Z.lock, Classes.fixedLeft, Classes.fixedRight, Classes.rowDetailContainer, Classes.rowDetailItem, Z.rowDetail, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.filterIcon, Classes.tableSortIcon, Classes.verticalScrollPlaceholder, Classes.tableFooter, Classes.verticalScrollPlaceholder);
|
|
124
126
|
export var ButtonCSS = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n //#region \u6309\u94AE\n .", "{\n color: var(--color);\n background:#ffffff;\n border:1px solid var(--strong-border-color);\n border-radius: 2px;\n cursor: pointer;\n &:hover{\n color: var(--primary-color);\n border:1px solid var(--primary-color);\n }\n }\n .", " {\n color:#ffffff;\n background-color: var(--primary-color);\n border:none;\n &:hover{\n color:#ffffff;\n background-color: var(--primary-color-level2);\n border:none;\n }\n }\n//#endregion\n"])), variableConst, Classes.button, Classes.buttonPrimary);
|
|
125
127
|
|
|
126
128
|
function getCssVariableText(obj) {
|
package/es/table/base/table.d.ts
CHANGED
|
@@ -145,7 +145,6 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
145
145
|
/** 同步横向滚动偏移量 */
|
|
146
146
|
private syncHorizontalScroll;
|
|
147
147
|
getVerticalRenderRange(useVirtual: ResolvedUseVirtual): VerticalRenderRange;
|
|
148
|
-
private getRowNodeListByEvent;
|
|
149
148
|
private handleRowMouseEnter;
|
|
150
149
|
private handleRowMouseLeave;
|
|
151
150
|
private renderTableBody;
|
package/es/table/base/table.js
CHANGED
|
@@ -95,23 +95,8 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
95
95
|
_this.resizeSubject = new Subject();
|
|
96
96
|
_this.offsetY = 0;
|
|
97
97
|
|
|
98
|
-
_this.getRowNodeListByEvent = function (e) {
|
|
99
|
-
var nodeList = null;
|
|
100
|
-
var rowIndex = e.currentTarget.dataset.rowindex;
|
|
101
|
-
|
|
102
|
-
if (rowIndex !== undefined) {
|
|
103
|
-
var _this$domHelper = _this.domHelper,
|
|
104
|
-
tableBody = _this$domHelper.tableBody,
|
|
105
|
-
tableFooter = _this$domHelper.tableFooter;
|
|
106
|
-
var targetParent = tableBody.contains(e.currentTarget) ? tableBody : tableFooter;
|
|
107
|
-
nodeList = targetParent.querySelectorAll("tr[data-rowindex=\"".concat(rowIndex, "\"]"));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return nodeList;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
98
|
_this.handleRowMouseEnter = function (e) {
|
|
114
|
-
var nodeList = _this.getRowNodeListByEvent(e);
|
|
99
|
+
var nodeList = _this.domHelper.getRowNodeListByEvent(e);
|
|
115
100
|
|
|
116
101
|
nodeList && nodeList.forEach(function (node) {
|
|
117
102
|
node.classList.add('row-hover');
|
|
@@ -119,7 +104,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
119
104
|
};
|
|
120
105
|
|
|
121
106
|
_this.handleRowMouseLeave = function (e) {
|
|
122
|
-
var nodeList = _this.getRowNodeListByEvent(e);
|
|
107
|
+
var nodeList = _this.domHelper.getRowNodeListByEvent(e);
|
|
123
108
|
|
|
124
109
|
nodeList && nodeList.forEach(function (node) {
|
|
125
110
|
node.classList.remove('row-hover');
|
|
@@ -251,10 +236,10 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
251
236
|
value: function updateStickyScroll() {
|
|
252
237
|
var _a, _b;
|
|
253
238
|
|
|
254
|
-
var _this$
|
|
255
|
-
stickyScroll = _this$
|
|
256
|
-
artTable = _this$
|
|
257
|
-
stickyScrollItem = _this$
|
|
239
|
+
var _this$domHelper = this.domHelper,
|
|
240
|
+
stickyScroll = _this$domHelper.stickyScroll,
|
|
241
|
+
artTable = _this$domHelper.artTable,
|
|
242
|
+
stickyScrollItem = _this$domHelper.stickyScrollItem;
|
|
258
243
|
var _lastHasScrollY = this.hasScrollY;
|
|
259
244
|
|
|
260
245
|
if (!artTable) {
|
|
@@ -524,13 +509,14 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
524
509
|
style: style
|
|
525
510
|
}, STYLED_REF_PROP, this.artTableWrapperRef);
|
|
526
511
|
|
|
512
|
+
var tableProps = getTableProps() || {};
|
|
527
513
|
return /*#__PURE__*/React.createElement(StyledArtTableWrapper, _extends({}, artTableWrapperProps), /*#__PURE__*/React.createElement(Loading, {
|
|
528
514
|
visible: isLoading,
|
|
529
515
|
LoadingIcon: components.LoadingIcon,
|
|
530
516
|
LoadingContentWrapper: components.LoadingContentWrapper
|
|
531
|
-
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
532
|
-
className: Classes.artTable
|
|
533
|
-
}
|
|
517
|
+
}, /*#__PURE__*/React.createElement("div", _extends({}, tableProps, {
|
|
518
|
+
className: cx(Classes.artTable, tableProps.className)
|
|
519
|
+
}), this.renderTableHeader(info), this.renderTableBody(info), this.renderTableFooter(info), this.renderLockShadows(info)), this.renderStickyScroll(info)));
|
|
534
520
|
}
|
|
535
521
|
}, {
|
|
536
522
|
key: "componentDidMount",
|
|
@@ -595,9 +581,9 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
595
581
|
value: function initSubscriptions() {
|
|
596
582
|
var _this2 = this;
|
|
597
583
|
|
|
598
|
-
var _this$
|
|
599
|
-
virtual = _this$
|
|
600
|
-
stickyScroll = _this$
|
|
584
|
+
var _this$domHelper2 = this.domHelper,
|
|
585
|
+
virtual = _this$domHelper2.virtual,
|
|
586
|
+
stickyScroll = _this$domHelper2.stickyScroll;
|
|
601
587
|
this.rootSubscription.add(throttledWindowResize$.subscribe(function () {
|
|
602
588
|
_this2.updateStickyScroll();
|
|
603
589
|
|
|
@@ -658,7 +644,12 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
658
644
|
offsetY: offsetY
|
|
659
645
|
};
|
|
660
646
|
}), op.distinctUntilChanged(function (x, y) {
|
|
661
|
-
//
|
|
647
|
+
// 如果表格区域被隐藏, 不需要触发组件重渲染
|
|
648
|
+
if (y.maxRenderHeight === 0 && y.maxRenderWidth === 0) {
|
|
649
|
+
return true;
|
|
650
|
+
} // 因为 overscan 的存在,滚动较小的距离时不需要触发组件重渲染
|
|
651
|
+
|
|
652
|
+
|
|
662
653
|
return Math.abs(x.maxRenderWidth - y.maxRenderWidth) < OVERSCAN_SIZE / 2 && Math.abs(x.maxRenderHeight - y.maxRenderHeight) < OVERSCAN_SIZE / 2 && Math.abs(x.offsetY - y.offsetY) < OVERSCAN_SIZE / 2;
|
|
663
654
|
})).subscribe(function (sizeAndOffset) {
|
|
664
655
|
_this2.setState(sizeAndOffset);
|
|
@@ -750,10 +741,12 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
750
741
|
|
|
751
742
|
if (size === 0) {
|
|
752
743
|
zeroHeightRowCount += 1;
|
|
744
|
+
} else {
|
|
745
|
+
// 渲染出来的行高度为0,说明是display=none情况,行高不存在该种异常情况,不保存当前的高度
|
|
746
|
+
this.rowHeightManager.updateRow(rowIndex, offset, size);
|
|
753
747
|
}
|
|
754
748
|
|
|
755
749
|
maxTrBottom = Math.max(maxTrBottom, offset + size);
|
|
756
|
-
this.rowHeightManager.updateRow(rowIndex, offset, size);
|
|
757
750
|
} // 当 estimatedRowHeight 过大时,可能出现「渲染行数过少,无法覆盖可视范围」的情况
|
|
758
751
|
// 出现这种情况时,我们判断「下一次渲染能够渲染更多行」是否满足,满足的话就直接调用 forceUpdate
|
|
759
752
|
// zeroHeightRowCount === 0 用于确保当前没有 display=none 的情况
|
|
@@ -7,6 +7,10 @@ import { FILL_COLUMN_CODE } from './autoFill';
|
|
|
7
7
|
var stateKey = 'columnDrag';
|
|
8
8
|
var SCROLL_SIZE = 30;
|
|
9
9
|
|
|
10
|
+
function disableSelect(event) {
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
function sortColumns(columns, sort) {
|
|
11
15
|
var res = new Array(columns.length);
|
|
12
16
|
|
|
@@ -61,9 +65,11 @@ export function columnDrag() {
|
|
|
61
65
|
},
|
|
62
66
|
headerCellProps: mergeCellProps(col.headerCellProps, {
|
|
63
67
|
onMouseDown: !isLeaf || path.length > 1 ? undefined : function (e) {
|
|
64
|
-
if (e.button !== 0) {
|
|
68
|
+
if (e.button !== 0 || !e.currentTarget.contains(e.target)) {
|
|
65
69
|
return;
|
|
66
|
-
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
window.addEventListener('selectstart', disableSelect); // const cx = e.clientX
|
|
67
73
|
// const width = col.width
|
|
68
74
|
// const a = startIndex
|
|
69
75
|
// const b = endIndex
|
|
@@ -72,7 +78,6 @@ export function columnDrag() {
|
|
|
72
78
|
// let newStartIndex = startIndex
|
|
73
79
|
// let endIdx = endIndex
|
|
74
80
|
|
|
75
|
-
|
|
76
81
|
var columnMoved = false;
|
|
77
82
|
var columns = pipeline.getColumns();
|
|
78
83
|
|
|
@@ -86,6 +91,8 @@ export function columnDrag() {
|
|
|
86
91
|
var currentTarget = e.currentTarget;
|
|
87
92
|
var rect = e.currentTarget.parentElement.getClientRects()[0];
|
|
88
93
|
var startX = rect.left;
|
|
94
|
+
var mouseDownClientX = e.clientX;
|
|
95
|
+
var mouseDownClientY = e.clientY;
|
|
89
96
|
var moveData = [];
|
|
90
97
|
var allColumns = collectNodes(columns);
|
|
91
98
|
var tableBodyClientRect = tableBody.getBoundingClientRect();
|
|
@@ -105,8 +112,6 @@ export function columnDrag() {
|
|
|
105
112
|
}
|
|
106
113
|
};
|
|
107
114
|
|
|
108
|
-
var stopClickPropagationFlag = false;
|
|
109
|
-
|
|
110
115
|
function handleMouseMove(e) {
|
|
111
116
|
var client = {
|
|
112
117
|
clientX: e.clientX,
|
|
@@ -120,12 +125,6 @@ export function columnDrag() {
|
|
|
120
125
|
if (e.clientX - leftPosition < 20) {
|
|
121
126
|
return;
|
|
122
127
|
} else {
|
|
123
|
-
// 阻止列头点击事件,防止拖动后触发列头过滤事件
|
|
124
|
-
if (stopClickPropagationFlag === false) {
|
|
125
|
-
stopClickPropagationFlag = true;
|
|
126
|
-
currentTarget.addEventListener('click', stopClickPropagation);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
128
|
e.stopPropagation();
|
|
130
129
|
}
|
|
131
130
|
|
|
@@ -245,10 +244,15 @@ export function columnDrag() {
|
|
|
245
244
|
e.stopPropagation();
|
|
246
245
|
document.body.removeEventListener('mousemove', handleMouseMove);
|
|
247
246
|
document.body.removeEventListener('mouseup', handleMouseUp);
|
|
247
|
+
window.removeEventListener('selectstart', disableSelect); // 阻止列头点击事件,防止拖动后触发列头过滤事件
|
|
248
|
+
|
|
249
|
+
if (_isMoveWhenClicking(mouseDownClientX, mouseDownClientY, e.clientX, e.clientY)) {
|
|
250
|
+
currentTarget.addEventListener('click', stopClickPropagation);
|
|
251
|
+
}
|
|
252
|
+
|
|
248
253
|
window.requestAnimationFrame(function () {
|
|
249
254
|
// 取消阻止列头点击事件
|
|
250
255
|
currentTarget.removeEventListener('click', stopClickPropagation);
|
|
251
|
-
stopClickPropagationFlag = false;
|
|
252
256
|
currentTarget = null;
|
|
253
257
|
|
|
254
258
|
var _moveData = moveData,
|
|
@@ -330,10 +334,6 @@ export function columnDrag() {
|
|
|
330
334
|
|
|
331
335
|
document.body.addEventListener('mousemove', handleMouseMove);
|
|
332
336
|
document.body.addEventListener('mouseup', handleMouseUp);
|
|
333
|
-
|
|
334
|
-
document.body.onselectstart = function () {
|
|
335
|
-
return false;
|
|
336
|
-
};
|
|
337
337
|
},
|
|
338
338
|
style: style
|
|
339
339
|
})
|
|
@@ -371,4 +371,15 @@ function moveAllChildren(cols, cloumnsTranslateData, width, isMinus) {
|
|
|
371
371
|
moveAllChildren(children, cloumnsTranslateData, width);
|
|
372
372
|
}
|
|
373
373
|
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function _isMoveWhenClicking(mouseDownClientX, mouseDownClientY, mouseUpClientX, mouseUpClientY) {
|
|
377
|
+
var xDiff = mouseUpClientX - mouseDownClientX;
|
|
378
|
+
var yDiff = mouseUpClientY - mouseDownClientY; // 鼠标点按和松开的偏移量大于5px,认为存在移动
|
|
379
|
+
|
|
380
|
+
if (Math.sqrt(xDiff * xDiff + yDiff * yDiff) > 5) {
|
|
381
|
+
return true;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return false;
|
|
374
385
|
}
|
|
@@ -12,8 +12,8 @@ export interface FilterFeatureOptions {
|
|
|
12
12
|
keepDataSource?: boolean;
|
|
13
13
|
/** 过滤模式。单列过滤 single,多列过滤 multiple,默认为多选 */
|
|
14
14
|
mode?: 'single' | 'multiple';
|
|
15
|
-
|
|
16
|
-
filterIcon?: ReactNode;
|
|
15
|
+
/** 过滤图标 */
|
|
16
|
+
filterIcon?: ReactNode | ((filtered: boolean) => ReactNode);
|
|
17
17
|
/** 是否对触发弹出过滤面板 的 click 事件调用 event.stopPropagation() */
|
|
18
18
|
stopClickEventPropagation?: boolean;
|
|
19
19
|
}
|
|
@@ -39,7 +39,7 @@ export function filter() {
|
|
|
39
39
|
return _mapInstanceProperty(columns).call(columns, dfs);
|
|
40
40
|
|
|
41
41
|
function dfs(col) {
|
|
42
|
-
var _a, _b, _c, _d, _e;
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
43
43
|
|
|
44
44
|
var result = _extends({}, col);
|
|
45
45
|
|
|
@@ -81,12 +81,13 @@ export function filter() {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
var filterPanel = (_d = col.features) === null || _d === void 0 ? void 0 : _d.filterPanel;
|
|
84
|
-
|
|
84
|
+
var colFilterIcon = (_f = (_e = col.features) === null || _e === void 0 ? void 0 : _e.filterIcon) !== null && _f !== void 0 ? _f : filterIcon;
|
|
85
|
+
result.title = _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(_concatInstanceProperty(_context2 = []).call(_context2, (_g = result.title) !== null && _g !== void 0 ? _g : [internals.safeRenderHeader(_extends(_extends({}, col), {
|
|
85
86
|
title: null
|
|
86
87
|
}))])), [/*#__PURE__*/React.createElement(Filter, {
|
|
87
88
|
key: "filter",
|
|
88
89
|
FilterPanelContent: filterPanel,
|
|
89
|
-
filterIcon:
|
|
90
|
+
filterIcon: colFilterIcon,
|
|
90
91
|
filterModel: inputFiltersMap.get(col.code),
|
|
91
92
|
setFilterModel: handleFilterChanged,
|
|
92
93
|
setFilter: setFilter,
|
|
@@ -135,7 +136,7 @@ export function filter() {
|
|
|
135
136
|
}));
|
|
136
137
|
|
|
137
138
|
function isMatchedFilterCondition(record) {
|
|
138
|
-
return
|
|
139
|
+
return filtersKeys.every(function (key) {
|
|
139
140
|
var _a, _b;
|
|
140
141
|
|
|
141
142
|
var filterItem = inputFiltersMap.get(key);
|
|
@@ -151,21 +152,41 @@ export function filter() {
|
|
|
151
152
|
comparisonFn = _filterInstanceProperty(defaultFilterOptionsMap.get('contain'));
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
return
|
|
155
|
+
return comparisonFn(_filterInstanceProperty(filterItem), filterItem)(internals.safeGetValue(columnsMap.get(key), record, -1), record);
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
158
|
|
|
158
|
-
return dataSource
|
|
159
|
-
if (isMatchedFilterCondition(record)) {
|
|
160
|
-
return _concatInstanceProperty(pre).call(pre, [record]);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return pre;
|
|
164
|
-
}, []);
|
|
159
|
+
return layeredFilter(dataSource, isMatchedFilterCondition);
|
|
165
160
|
}
|
|
166
161
|
|
|
167
162
|
pipeline.dataSource(processDataSource(dataSource));
|
|
168
163
|
pipeline.columns(processColumns(columns));
|
|
169
164
|
return pipeline;
|
|
170
165
|
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function layeredFilter(array, matchFn) {
|
|
169
|
+
return dfs(array);
|
|
170
|
+
|
|
171
|
+
function dfs(rows) {
|
|
172
|
+
var _context6;
|
|
173
|
+
|
|
174
|
+
var parentMatched = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
175
|
+
return _filterInstanceProperty(_context6 = _mapInstanceProperty(rows).call(rows, function (row) {
|
|
176
|
+
var currentMatched = matchFn(row);
|
|
177
|
+
|
|
178
|
+
if (isLeafNode(row)) {
|
|
179
|
+
return (parentMatched || currentMatched) && _extends({}, row);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var children = row.children;
|
|
183
|
+
|
|
184
|
+
var rowAfterFilterChildren = _extends(_extends({}, row), {
|
|
185
|
+
children: dfs(children, parentMatched || currentMatched)
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
var matchedByChildren = !isLeafNode(rowAfterFilterChildren);
|
|
189
|
+
return (parentMatched || currentMatched || matchedByChildren) && rowAfterFilterChildren;
|
|
190
|
+
})).call(_context6, Boolean);
|
|
191
|
+
}
|
|
171
192
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function DefaultFilterIcon(_ref) {
|
|
3
|
+
var width = _ref.width,
|
|
4
|
+
height = _ref.height;
|
|
5
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
6
|
+
width: width,
|
|
7
|
+
height: height,
|
|
8
|
+
style: {
|
|
9
|
+
verticalAlign: 'middle'
|
|
10
|
+
},
|
|
11
|
+
viewBox: "0 0 1024 1024",
|
|
12
|
+
focusable: "false",
|
|
13
|
+
"data-icon": "filter",
|
|
14
|
+
fill: "currentColor",
|
|
15
|
+
version: "1.1",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
17
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
18
|
+
d: "M891.448889 159.573333L626.460444 460.231111v443.221333c0 32.881778-25.429333 63.658667-55.864888 63.658667l-170.268445-172.942222V456.419556L132.266667 159.857778A59.619556 59.619556 0 0 1 173.511111 56.888889h676.977778c32.995556 0 59.733333 26.680889 59.733333 59.562667 0 17.066667-7.224889 32.312889-18.773333 43.121777z"
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
@@ -6,7 +6,7 @@ interface FilterProps {
|
|
|
6
6
|
size?: number;
|
|
7
7
|
isFilterActive: boolean;
|
|
8
8
|
FilterPanelContent?: FilterPanelType;
|
|
9
|
-
filterIcon?: ReactNode;
|
|
9
|
+
filterIcon?: ReactNode | ((filtered: boolean) => ReactNode);
|
|
10
10
|
setFilterModel: DefaultFilterPanelProps['setFilterModel'];
|
|
11
11
|
filterModel: DefaultFilterPanelProps['filterModel'];
|
|
12
12
|
setFilter: CustomeFilterPanelProps['setFilter'];
|