@arim-aisdc/public-components 2.3.69 → 2.3.71
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/ConfigProvider/context.d.ts +1 -0
- package/dist/components/TableMax/TableHeader/Cell.d.ts +2 -1
- package/dist/components/TableMax/TableHeader/Cell.js +4 -2
- package/dist/components/TableMax/TableHeader/OriginalTableHeader.d.ts +2 -1
- package/dist/components/TableMax/TableHeader/OriginalTableHeader.js +5 -2
- package/dist/components/TableMax/TableMax.js +11 -11
- package/dist/components/TableMax/components/ColumnFilterV2/Filter.d.ts +1 -0
- package/dist/components/TableMax/components/ColumnFilterV2/Filter.js +28 -38
- package/dist/components/TableMax/components/ColumnFilterV2/MultipleSelect/index.d.ts +2 -1
- package/dist/components/TableMax/components/ColumnFilterV2/MultipleSelect/index.js +17 -14
- package/dist/components/TableMax/components/ColumnFilterV2/SingleSelect/index.d.ts +2 -1
- package/dist/components/TableMax/components/ColumnFilterV2/SingleSelect/index.js +4 -3
- package/dist/components/TableMax/components/ColumnFilterV2/index.d.ts +2 -1
- package/dist/components/TableMax/components/ColumnFilterV2/index.js +4 -2
- package/dist/components/TableMax/components/ColumnFilterV2/index.less +13 -0
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/dist/components/TableMax/type.d.ts +2 -0
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ type ICellType = {
|
|
|
15
15
|
canFilter?: boolean;
|
|
16
16
|
manualFiltering: boolean;
|
|
17
17
|
getDynamicFilterOptionsFn?: Function;
|
|
18
|
+
openNullValueFilter?: boolean;
|
|
18
19
|
};
|
|
19
|
-
declare const Cell: ({ tableContentRef, header, table, hasGroup, canSorting, getHeaderCellProps, disableColumnDrag, headerRowNum, canFilter, manualFiltering, getDynamicFilterOptionsFn }: ICellType) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const Cell: ({ tableContentRef, header, table, hasGroup, canSorting, getHeaderCellProps, disableColumnDrag, headerRowNum, canFilter, manualFiltering, getDynamicFilterOptionsFn, openNullValueFilter }: ICellType) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export default Cell;
|
|
@@ -42,7 +42,8 @@ var Cell = function Cell(_ref) {
|
|
|
42
42
|
headerRowNum = _ref.headerRowNum,
|
|
43
43
|
canFilter = _ref.canFilter,
|
|
44
44
|
manualFiltering = _ref.manualFiltering,
|
|
45
|
-
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn
|
|
45
|
+
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn,
|
|
46
|
+
openNullValueFilter = _ref.openNullValueFilter;
|
|
46
47
|
var _useConfig = useConfig(),
|
|
47
48
|
root = _useConfig.root;
|
|
48
49
|
var cannotDragColumn = [ColumnType.Darg, ColumnType.Selection, ColumnType.Expander, ColumnType.PlaceHolder];
|
|
@@ -133,7 +134,8 @@ var Cell = function Cell(_ref) {
|
|
|
133
134
|
}) : null, canFilter && columnDef.enableColumnFilter !== false ? /*#__PURE__*/_jsx(ColumnFilter, {
|
|
134
135
|
column: header.column,
|
|
135
136
|
manualFiltering: manualFiltering,
|
|
136
|
-
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn
|
|
137
|
+
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn,
|
|
138
|
+
openNullValueFilter: openNullValueFilter
|
|
137
139
|
}) : null]
|
|
138
140
|
}) : null, /*#__PURE__*/_jsx("div", {
|
|
139
141
|
className: "cell-resize-handler ".concat(header.column.getIsResizing() ? 'column-is-resizing' : ''),
|
|
@@ -16,6 +16,7 @@ export type TableHeaderProps = {
|
|
|
16
16
|
headerRowNum: number;
|
|
17
17
|
manualFiltering: boolean;
|
|
18
18
|
getDynamicFilterOptionsFn?: Function;
|
|
19
|
+
openNullValueFilter?: boolean;
|
|
19
20
|
};
|
|
20
|
-
declare const OriginalTableHeader: ({ tableContentRef, table, canFilter, enableFilters, canSorting, hasGroup, getHeaderCellProps, columnResizeMode, disableColumnDrag, rowHeight, headerRowNum, manualFiltering, getDynamicFilterOptionsFn }: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const OriginalTableHeader: ({ tableContentRef, table, canFilter, enableFilters, canSorting, hasGroup, getHeaderCellProps, columnResizeMode, disableColumnDrag, rowHeight, headerRowNum, manualFiltering, getDynamicFilterOptionsFn, openNullValueFilter }: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export { OriginalTableHeader };
|
|
@@ -23,7 +23,8 @@ var OriginalTableHeader = function OriginalTableHeader(_ref) {
|
|
|
23
23
|
rowHeight = _ref.rowHeight,
|
|
24
24
|
headerRowNum = _ref.headerRowNum,
|
|
25
25
|
manualFiltering = _ref.manualFiltering,
|
|
26
|
-
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn
|
|
26
|
+
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn,
|
|
27
|
+
openNullValueFilter = _ref.openNullValueFilter;
|
|
27
28
|
var headerGroups = table.getHeaderGroups();
|
|
28
29
|
var headers = (headerGroups === null || headerGroups === void 0 || (_headerGroups = headerGroups[headerGroups.length - 1]) === null || _headerGroups === void 0 ? void 0 : _headerGroups.headers) || [];
|
|
29
30
|
useWhyDidYouUpdate('useWhyDidYouUpdate', {
|
|
@@ -40,6 +41,7 @@ var OriginalTableHeader = function OriginalTableHeader(_ref) {
|
|
|
40
41
|
headerRowNum: headerRowNum,
|
|
41
42
|
manualFiltering: manualFiltering
|
|
42
43
|
});
|
|
44
|
+
console.log(openNullValueFilter, 'openNullValueFilter');
|
|
43
45
|
return (
|
|
44
46
|
/*#__PURE__*/
|
|
45
47
|
// <table>
|
|
@@ -73,7 +75,8 @@ var OriginalTableHeader = function OriginalTableHeader(_ref) {
|
|
|
73
75
|
headerRowNum: headerRowNum,
|
|
74
76
|
canFilter: canFilter,
|
|
75
77
|
manualFiltering: manualFiltering,
|
|
76
|
-
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn
|
|
78
|
+
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn,
|
|
79
|
+
openNullValueFilter: openNullValueFilter
|
|
77
80
|
}, header.id)
|
|
78
81
|
}, header.id);
|
|
79
82
|
})
|
|
@@ -207,7 +207,8 @@ var TableMax = function TableMax(_ref) {
|
|
|
207
207
|
_ref$openVirtualColum = _ref.openVirtualColumns,
|
|
208
208
|
openVirtualColumns = _ref$openVirtualColum === void 0 ? false : _ref$openVirtualColum,
|
|
209
209
|
_ref$openVirtualRows = _ref.openVirtualRows,
|
|
210
|
-
openVirtualRows = _ref$openVirtualRows === void 0 ? false : _ref$openVirtualRows
|
|
210
|
+
openVirtualRows = _ref$openVirtualRows === void 0 ? false : _ref$openVirtualRows,
|
|
211
|
+
openNullValueFilter = _ref.openNullValueFilter;
|
|
211
212
|
var tableMaxRef = useRef(null);
|
|
212
213
|
// 表格元素
|
|
213
214
|
var tableContentRef = useRef(null);
|
|
@@ -232,13 +233,15 @@ var TableMax = function TableMax(_ref) {
|
|
|
232
233
|
cacheMaxAge = _ref2.cacheMaxAge,
|
|
233
234
|
openMemo = _ref2.openMemo,
|
|
234
235
|
globalCanExport = _ref2.canExport,
|
|
235
|
-
canSelectionUseShift = _ref2.canSelectionUseShift
|
|
236
|
+
canSelectionUseShift = _ref2.canSelectionUseShift,
|
|
237
|
+
openNullValueFilter = _ref2.openNullValueFilter;
|
|
236
238
|
return {
|
|
237
239
|
globalCanExport: globalCanExport,
|
|
238
240
|
globalPageSizeOptions: globalPageSizeOptions,
|
|
239
241
|
canSelectionUseShift: canSelectionUseShift,
|
|
240
242
|
cacheMaxAge: cacheMaxAge,
|
|
241
|
-
openMemo: openMemo
|
|
243
|
+
openMemo: openMemo,
|
|
244
|
+
openNullValueFilter: openNullValueFilter
|
|
242
245
|
};
|
|
243
246
|
}, [JSON.stringify(tableMax)]);
|
|
244
247
|
|
|
@@ -416,7 +419,6 @@ var TableMax = function TableMax(_ref) {
|
|
|
416
419
|
});
|
|
417
420
|
}
|
|
418
421
|
};
|
|
419
|
-
console.log(tableDatas, 'tableDatas');
|
|
420
422
|
|
|
421
423
|
// table
|
|
422
424
|
var table = useReactTable({
|
|
@@ -719,9 +721,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
719
721
|
|
|
720
722
|
// 初始化列
|
|
721
723
|
useEffect(function () {
|
|
722
|
-
var _tableContentRef$curr;
|
|
723
724
|
if (!tableMaxRef.current || !tableContentRef.current) return;
|
|
724
|
-
console.log((_tableContentRef$curr = tableContentRef.current) === null || _tableContentRef$curr === void 0 ? void 0 : _tableContentRef$curr.offsetWidth, 'tableContentRef.current');
|
|
725
725
|
// 根据props,自动增加勾选列/展开列
|
|
726
726
|
var newColumns = setColumnsByProps().concat(columns);
|
|
727
727
|
initializeColumnSizing(newColumns);
|
|
@@ -1062,9 +1062,9 @@ var TableMax = function TableMax(_ref) {
|
|
|
1062
1062
|
disableColumnDrag: disableColumnDrag,
|
|
1063
1063
|
manualFiltering: manualFiltering,
|
|
1064
1064
|
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn,
|
|
1065
|
-
tableHeaderRef: tableHeaderRef
|
|
1065
|
+
tableHeaderRef: tableHeaderRef,
|
|
1066
|
+
openNullValueFilter: openNullValueFilter !== null && openNullValueFilter !== void 0 ? openNullValueFilter : tableMaxConfig === null || tableMaxConfig === void 0 ? void 0 : tableMaxConfig.openNullValueFilter
|
|
1066
1067
|
};
|
|
1067
|
-
console.log(table.getRowModel().rows, 'table.getRowModel().rows');
|
|
1068
1068
|
var tableBodyProps = {
|
|
1069
1069
|
tableContentRef: tableContentRef,
|
|
1070
1070
|
tableBodyRef: tableBodyRef,
|
|
@@ -1125,11 +1125,11 @@ var TableMax = function TableMax(_ref) {
|
|
|
1125
1125
|
changeCompactModeStyle(!compactMode);
|
|
1126
1126
|
};
|
|
1127
1127
|
var changeCompactModeStyle = function changeCompactModeStyle(compactMode) {
|
|
1128
|
-
var _tableContentRef$
|
|
1128
|
+
var _tableContentRef$curr, _tableContentRef$curr2;
|
|
1129
1129
|
var newHeight = compactMode ? compactModeRowHeight : propsRowHeight;
|
|
1130
1130
|
var newPadding = compactMode ? compactModeCellPadding : cellPadding;
|
|
1131
|
-
(_tableContentRef$
|
|
1132
|
-
(_tableContentRef$
|
|
1131
|
+
(_tableContentRef$curr = tableContentRef.current) === null || _tableContentRef$curr === void 0 || (_tableContentRef$curr = _tableContentRef$curr.style) === null || _tableContentRef$curr === void 0 || _tableContentRef$curr.setProperty('--cell-height', "".concat(newHeight, "px"));
|
|
1132
|
+
(_tableContentRef$curr2 = tableContentRef.current) === null || _tableContentRef$curr2 === void 0 || (_tableContentRef$curr2 = _tableContentRef$curr2.style) === null || _tableContentRef$curr2 === void 0 || _tableContentRef$curr2.setProperty('--cell-padding', newPadding);
|
|
1133
1133
|
setCompactMode(compactMode);
|
|
1134
1134
|
setRowHeight(newHeight);
|
|
1135
1135
|
};
|
|
@@ -25,7 +25,8 @@ var Filter = function Filter(_ref) {
|
|
|
25
25
|
var getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn,
|
|
26
26
|
column = _ref.column,
|
|
27
27
|
onCloseFilterPanel = _ref.onCloseFilterPanel,
|
|
28
|
-
manualFiltering = _ref.manualFiltering
|
|
28
|
+
manualFiltering = _ref.manualFiltering,
|
|
29
|
+
openNullValueFilter = _ref.openNullValueFilter;
|
|
29
30
|
var columnDef = column === null || column === void 0 ? void 0 : column.columnDef;
|
|
30
31
|
// 筛选组件类型
|
|
31
32
|
var id = columnDef.id,
|
|
@@ -235,10 +236,29 @@ var Filter = function Filter(_ref) {
|
|
|
235
236
|
}
|
|
236
237
|
}, []);
|
|
237
238
|
var filterComponent = function filterComponent(type) {
|
|
238
|
-
var _columnDef$filterComP, _columnDef$filterComP2, _columnDef$filterComP3;
|
|
239
|
+
var _columnFilterValue$to, _columnFilterValue$to2, _columnFilterValue$to3, _columnDef$filterComP, _columnDef$filterComP2, _columnDef$filterComP3;
|
|
239
240
|
var _useTranslation = useTranslation(),
|
|
240
241
|
_useTranslation2 = _slicedToArray(_useTranslation, 1),
|
|
241
242
|
t = _useTranslation2[0];
|
|
243
|
+
var quickInput = openNullValueFilter && /*#__PURE__*/_jsxs("div", {
|
|
244
|
+
className: "quickly-input",
|
|
245
|
+
children: [/*#__PURE__*/_jsx("p", {
|
|
246
|
+
className: "quickly-input-title",
|
|
247
|
+
children: "\u5FEB\u6377\u8F93\u5165"
|
|
248
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
249
|
+
className: "quickly-input-item ".concat(typeof columnFilterValue === 'string' && (columnFilterValue === null || columnFilterValue === void 0 || (_columnFilterValue$to = columnFilterValue.toUpperCase()) === null || _columnFilterValue$to === void 0 ? void 0 : _columnFilterValue$to.trim()) === 'NULL' ? 'quickly-input-item-selected' : null),
|
|
250
|
+
onClick: function onClick() {
|
|
251
|
+
handleChangeFilterValueWithDebounce('NULL');
|
|
252
|
+
},
|
|
253
|
+
children: "\u7A7A\u503C(NULL)"
|
|
254
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
255
|
+
className: "quickly-input-item ".concat(typeof columnFilterValue === 'string' && ((columnFilterValue === null || columnFilterValue === void 0 || (_columnFilterValue$to2 = columnFilterValue.toUpperCase()) === null || _columnFilterValue$to2 === void 0 ? void 0 : _columnFilterValue$to2.trim()) === 'NOT NULL' || (columnFilterValue === null || columnFilterValue === void 0 || (_columnFilterValue$to3 = columnFilterValue.toUpperCase()) === null || _columnFilterValue$to3 === void 0 ? void 0 : _columnFilterValue$to3.trim()) === 'NOTNULL') ? 'quickly-input-item-selected' : null),
|
|
256
|
+
onClick: function onClick() {
|
|
257
|
+
handleChangeFilterValueWithDebounce('NOT NULL');
|
|
258
|
+
},
|
|
259
|
+
children: "\u975E\u7A7A\u503C(NOT NULL)"
|
|
260
|
+
})]
|
|
261
|
+
});
|
|
242
262
|
switch (type) {
|
|
243
263
|
case FilterType.Date:
|
|
244
264
|
case FilterType.DateRange:
|
|
@@ -315,23 +335,7 @@ var Filter = function Filter(_ref) {
|
|
|
315
335
|
},
|
|
316
336
|
allowClear: true,
|
|
317
337
|
value: columnFilterValue
|
|
318
|
-
}),
|
|
319
|
-
className: "quickly-input",
|
|
320
|
-
children: [/*#__PURE__*/_jsx("p", {
|
|
321
|
-
className: "quickly-input-title",
|
|
322
|
-
children: "\u5FEB\u6377\u8F93\u5165"
|
|
323
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
324
|
-
onClick: function onClick() {
|
|
325
|
-
handleChangeFilterValueWithDebounce('NULL');
|
|
326
|
-
},
|
|
327
|
-
children: "\u7A7A\u503C(NULL)"
|
|
328
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
329
|
-
onClick: function onClick() {
|
|
330
|
-
handleChangeFilterValueWithDebounce('NOT NULL');
|
|
331
|
-
},
|
|
332
|
-
children: "\u975E\u7A7A\u503C(NOT NULL)"
|
|
333
|
-
})]
|
|
334
|
-
})]
|
|
338
|
+
}), quickInput]
|
|
335
339
|
});
|
|
336
340
|
case FilterType.Input:
|
|
337
341
|
return /*#__PURE__*/_jsxs("div", {
|
|
@@ -346,23 +350,7 @@ var Filter = function Filter(_ref) {
|
|
|
346
350
|
allowClear: true,
|
|
347
351
|
value: columnFilterValue,
|
|
348
352
|
placeholder: t('global.placeholder.input')
|
|
349
|
-
}),
|
|
350
|
-
className: "quickly-input",
|
|
351
|
-
children: [/*#__PURE__*/_jsx("p", {
|
|
352
|
-
className: "quickly-input-title",
|
|
353
|
-
children: "\u5FEB\u6377\u8F93\u5165"
|
|
354
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
355
|
-
onClick: function onClick() {
|
|
356
|
-
handleChangeFilterValueWithDebounce('NULL');
|
|
357
|
-
},
|
|
358
|
-
children: "\u7A7A\u503C(NULL)"
|
|
359
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
360
|
-
onClick: function onClick() {
|
|
361
|
-
handleChangeFilterValueWithDebounce('NOT NULL');
|
|
362
|
-
},
|
|
363
|
-
children: "\u975E\u7A7A\u503C(NOT NULL)"
|
|
364
|
-
})]
|
|
365
|
-
})]
|
|
353
|
+
}), quickInput]
|
|
366
354
|
});
|
|
367
355
|
case FilterType.SingleSelect:
|
|
368
356
|
return /*#__PURE__*/_jsx(SingleSelect, {
|
|
@@ -372,7 +360,8 @@ var Filter = function Filter(_ref) {
|
|
|
372
360
|
options: options,
|
|
373
361
|
isFrontSearch: isFilterOptionsFrontSearch,
|
|
374
362
|
onCloseFilterPanel: onCloseFilterPanel,
|
|
375
|
-
loading: loading
|
|
363
|
+
loading: loading,
|
|
364
|
+
openNullValueFilter: openNullValueFilter
|
|
376
365
|
});
|
|
377
366
|
case FilterType.MultiSelect:
|
|
378
367
|
default:
|
|
@@ -383,7 +372,8 @@ var Filter = function Filter(_ref) {
|
|
|
383
372
|
options: options,
|
|
384
373
|
loading: loading,
|
|
385
374
|
isFrontSearch: isFilterOptionsFrontSearch,
|
|
386
|
-
onCloseFilterPanel: onCloseFilterPanel
|
|
375
|
+
onCloseFilterPanel: onCloseFilterPanel,
|
|
376
|
+
openNullValueFilter: openNullValueFilter
|
|
387
377
|
});
|
|
388
378
|
}
|
|
389
379
|
};
|
|
@@ -10,6 +10,7 @@ interface IProps {
|
|
|
10
10
|
isFrontSearch: boolean;
|
|
11
11
|
loading: boolean;
|
|
12
12
|
onCloseFilterPanel: () => void;
|
|
13
|
+
openNullValueFilter?: boolean;
|
|
13
14
|
}
|
|
14
|
-
declare const MultipleSelect: ({ value, onChange, options, onSearch, isFrontSearch, loading, onCloseFilterPanel, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const MultipleSelect: ({ value, onChange, options, onSearch, isFrontSearch, loading, onCloseFilterPanel, openNullValueFilter }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default MultipleSelect;
|
|
@@ -24,7 +24,8 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
24
24
|
onSearch = _ref.onSearch,
|
|
25
25
|
isFrontSearch = _ref.isFrontSearch,
|
|
26
26
|
loading = _ref.loading,
|
|
27
|
-
onCloseFilterPanel = _ref.onCloseFilterPanel
|
|
27
|
+
onCloseFilterPanel = _ref.onCloseFilterPanel,
|
|
28
|
+
openNullValueFilter = _ref.openNullValueFilter;
|
|
28
29
|
// 内部state
|
|
29
30
|
// const [innerValue, setInnerValue] = useState(Array.isArray(value) ? value : [value]);
|
|
30
31
|
var _useTranslation = useTranslation(),
|
|
@@ -147,19 +148,21 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
147
148
|
className: "loading",
|
|
148
149
|
children: /*#__PURE__*/_jsx(Spin, {})
|
|
149
150
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
150
|
-
children: [/*#__PURE__*/
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
151
|
+
children: [openNullValueFilter && /*#__PURE__*/_jsxs(_Fragment, {
|
|
152
|
+
children: [/*#__PURE__*/_jsx(Checkbox, {
|
|
153
|
+
checked: JSON.stringify(innerValue) === '["NULL"]',
|
|
154
|
+
onChange: function onChange(e) {
|
|
155
|
+
var _e$target;
|
|
156
|
+
console.log(innerValue);
|
|
157
|
+
if (e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.checked) {
|
|
158
|
+
setInnerValue(['NULL']);
|
|
159
|
+
} else {
|
|
160
|
+
setInnerValue([]);
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
children: "\u7A7A\u503C(NULL)"
|
|
164
|
+
}), /*#__PURE__*/_jsx("br", {})]
|
|
165
|
+
}), /*#__PURE__*/_jsx(Checkbox, {
|
|
163
166
|
indeterminate: indeterminate,
|
|
164
167
|
onChange: onCheckAllChange,
|
|
165
168
|
checked: checkAll,
|
|
@@ -10,6 +10,7 @@ interface IProps {
|
|
|
10
10
|
isFrontSearch: boolean;
|
|
11
11
|
loading: boolean;
|
|
12
12
|
onCloseFilterPanel: () => void;
|
|
13
|
+
openNullValueFilter?: boolean;
|
|
13
14
|
}
|
|
14
|
-
declare const SingleSelect: ({ value, onChange, options, onSearch, isFrontSearch, loading, onCloseFilterPanel, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const SingleSelect: ({ value, onChange, options, onSearch, isFrontSearch, loading, onCloseFilterPanel, openNullValueFilter }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default SingleSelect;
|
|
@@ -20,7 +20,8 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
20
20
|
onSearch = _ref.onSearch,
|
|
21
21
|
isFrontSearch = _ref.isFrontSearch,
|
|
22
22
|
loading = _ref.loading,
|
|
23
|
-
onCloseFilterPanel = _ref.onCloseFilterPanel
|
|
23
|
+
onCloseFilterPanel = _ref.onCloseFilterPanel,
|
|
24
|
+
openNullValueFilter = _ref.openNullValueFilter;
|
|
24
25
|
var _useTranslation = useTranslation(),
|
|
25
26
|
_useTranslation2 = _slicedToArray(_useTranslation, 1),
|
|
26
27
|
t = _useTranslation2[0];
|
|
@@ -106,7 +107,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
106
107
|
|
|
107
108
|
// 最终的可选值
|
|
108
109
|
var finalOptions = useMemo(function () {
|
|
109
|
-
var nullValueOptions = [{
|
|
110
|
+
var nullValueOptions = openNullValueFilter ? [{
|
|
110
111
|
label: '空值(NULL)',
|
|
111
112
|
value: 'NULL',
|
|
112
113
|
children: []
|
|
@@ -114,7 +115,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
114
115
|
label: '非空值(NOT NULL)',
|
|
115
116
|
value: 'NOT NULL',
|
|
116
117
|
children: []
|
|
117
|
-
}].concat(options);
|
|
118
|
+
}].concat(options) : options;
|
|
118
119
|
if (!isFrontSearch) {
|
|
119
120
|
return nullValueOptions;
|
|
120
121
|
}
|
|
@@ -30,10 +30,11 @@ export type IFilterFnEnum = {
|
|
|
30
30
|
[key in FilterType]: FilterFnType;
|
|
31
31
|
};
|
|
32
32
|
export declare function setDefaultFilterFn(columns: TableMaxColumnType[]): TableMaxColumnType[];
|
|
33
|
-
export declare function ColumnFilter({ column, manualFiltering, getDynamicFilterOptionsFn }: {
|
|
33
|
+
export declare function ColumnFilter({ column, manualFiltering, getDynamicFilterOptionsFn, openNullValueFilter }: {
|
|
34
34
|
column: Column<any, unknown>;
|
|
35
35
|
manualFiltering: boolean;
|
|
36
36
|
getDynamicFilterOptionsFn: Function;
|
|
37
|
+
openNullValueFilter?: boolean;
|
|
37
38
|
}): import("react/jsx-runtime").JSX.Element;
|
|
38
39
|
export declare function isEmpty(value: any): boolean;
|
|
39
40
|
export declare function uniqueByField(arr: any, field: any): any;
|
|
@@ -65,7 +65,8 @@ export function setDefaultFilterFn(columns) {
|
|
|
65
65
|
export function ColumnFilter(_ref) {
|
|
66
66
|
var column = _ref.column,
|
|
67
67
|
manualFiltering = _ref.manualFiltering,
|
|
68
|
-
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn
|
|
68
|
+
getDynamicFilterOptionsFn = _ref.getDynamicFilterOptionsFn,
|
|
69
|
+
openNullValueFilter = _ref.openNullValueFilter;
|
|
69
70
|
var _useConfig = useConfig(),
|
|
70
71
|
root = _useConfig.root;
|
|
71
72
|
var _useState = useState(false),
|
|
@@ -156,7 +157,8 @@ export function ColumnFilter(_ref) {
|
|
|
156
157
|
getDynamicFilterOptionsFn: getDynamicFilterOptionsFn,
|
|
157
158
|
column: column,
|
|
158
159
|
onCloseFilterPanel: handleClosePanel,
|
|
159
|
-
manualFiltering: manualFiltering
|
|
160
|
+
manualFiltering: manualFiltering,
|
|
161
|
+
openNullValueFilter: openNullValueFilter
|
|
160
162
|
})
|
|
161
163
|
}), root ? document.querySelector(root) : document.body) : null]
|
|
162
164
|
});
|
|
@@ -40,7 +40,20 @@
|
|
|
40
40
|
|
|
41
41
|
.quickly-input {
|
|
42
42
|
font-size: 12px;
|
|
43
|
+
|
|
43
44
|
.quickly-input-title {
|
|
44
45
|
color: @global-desc-text-disabled-color;
|
|
46
|
+
margin: 12px 0 0 0;
|
|
47
|
+
padding: 4px;
|
|
48
|
+
}
|
|
49
|
+
.quickly-input-item {
|
|
50
|
+
padding: 4px;
|
|
51
|
+
margin: 0;
|
|
52
|
+
}
|
|
53
|
+
.quickly-input-item:hover {
|
|
54
|
+
background-color: @global-hover-background-color;
|
|
55
|
+
}
|
|
56
|
+
.quickly-input-item-selected {
|
|
57
|
+
background-color: @global-hover-background-color;
|
|
45
58
|
}
|
|
46
59
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableMaxColumnType } from "../../type";
|
|
2
|
-
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
3
|
-
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
4
|
-
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
5
|
-
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
2
|
+
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
6
6
|
declare const customSortFns: {
|
|
7
|
-
numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
8
|
-
stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
9
|
-
timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
10
|
-
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
7
|
+
numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|