@arim-aisdc/public-components 2.3.76 → 2.3.78
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/CustomForm/CustomForm.js +15 -13
- package/dist/components/TableMax/TableHeader/OriginalTableHeader.js +0 -16
- package/dist/components/TableMax/components/ColumnFilterV2/index.less +1 -1
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/dist/components/TableMax/hooks/useColumnWidth.js +11 -9
- package/package.json +1 -1
|
@@ -213,20 +213,22 @@ var CustomForm = function CustomForm(_ref, ref) {
|
|
|
213
213
|
}, [data, spanSize.span, span]);
|
|
214
214
|
useEffect(function () {
|
|
215
215
|
var myObserver = new ResizeObserver(function (entries) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
216
|
+
requestAnimationFrame(function () {
|
|
217
|
+
var _iterator = _createForOfIteratorHelper(entries),
|
|
218
|
+
_step;
|
|
219
|
+
try {
|
|
220
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
221
|
+
var entrie = _step.value;
|
|
222
|
+
//@ts-ignore
|
|
223
|
+
var offsetWidth = entrie.target.offsetWidth;
|
|
224
|
+
setWidth(offsetWidth);
|
|
225
|
+
}
|
|
226
|
+
} catch (err) {
|
|
227
|
+
_iterator.e(err);
|
|
228
|
+
} finally {
|
|
229
|
+
_iterator.f();
|
|
224
230
|
}
|
|
225
|
-
}
|
|
226
|
-
_iterator.e(err);
|
|
227
|
-
} finally {
|
|
228
|
-
_iterator.f();
|
|
229
|
-
}
|
|
231
|
+
});
|
|
230
232
|
});
|
|
231
233
|
// 监听
|
|
232
234
|
var dom = document.getElementById('CustomForm');
|
|
@@ -7,7 +7,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import Cell from "./Cell";
|
|
8
8
|
import "./index.less";
|
|
9
9
|
import { getPinningStyle } from "./utils";
|
|
10
|
-
import { useWhyDidYouUpdate } from 'ahooks';
|
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
11
|
var OriginalTableHeader = function OriginalTableHeader(_ref) {
|
|
13
12
|
var _headerGroups;
|
|
@@ -27,21 +26,6 @@ var OriginalTableHeader = function OriginalTableHeader(_ref) {
|
|
|
27
26
|
openNullValueFilter = _ref.openNullValueFilter;
|
|
28
27
|
var headerGroups = table.getHeaderGroups();
|
|
29
28
|
var headers = (headerGroups === null || headerGroups === void 0 || (_headerGroups = headerGroups[headerGroups.length - 1]) === null || _headerGroups === void 0 ? void 0 : _headerGroups.headers) || [];
|
|
30
|
-
useWhyDidYouUpdate('useWhyDidYouUpdate', {
|
|
31
|
-
tableContentRef: tableContentRef,
|
|
32
|
-
table: table,
|
|
33
|
-
canFilter: canFilter,
|
|
34
|
-
enableFilters: enableFilters,
|
|
35
|
-
canSorting: canSorting,
|
|
36
|
-
hasGroup: hasGroup,
|
|
37
|
-
getHeaderCellProps: getHeaderCellProps,
|
|
38
|
-
columnResizeMode: columnResizeMode,
|
|
39
|
-
disableColumnDrag: disableColumnDrag,
|
|
40
|
-
rowHeight: rowHeight,
|
|
41
|
-
headerRowNum: headerRowNum,
|
|
42
|
-
manualFiltering: manualFiltering
|
|
43
|
-
});
|
|
44
|
-
console.log(openNullValueFilter, 'openNullValueFilter');
|
|
45
29
|
return (
|
|
46
30
|
/*#__PURE__*/
|
|
47
31
|
// <table>
|
|
@@ -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) => 0 | 1 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -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) => 0 | 1 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|
|
@@ -322,15 +322,17 @@ export var useColumnWidth = function useColumnWidth(_ref) {
|
|
|
322
322
|
useEffect(function () {
|
|
323
323
|
if (!tableContentRef.current) return;
|
|
324
324
|
var observer = new ResizeObserver(function (entries) {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
325
|
+
requestAnimationFrame(function () {
|
|
326
|
+
var _entries$, _entries$2;
|
|
327
|
+
var newWidth = (_entries$ = entries[0]) === null || _entries$ === void 0 ? void 0 : _entries$.contentRect.width;
|
|
328
|
+
var height = (_entries$2 = entries[0]) === null || _entries$2 === void 0 ? void 0 : _entries$2.contentRect.height;
|
|
329
|
+
if (newWidth || height) {
|
|
330
|
+
var _tableContentRef$curr, _tableContentRef$curr2;
|
|
331
|
+
debouncedHandleResizeRef.current(newWidth);
|
|
332
|
+
(_tableContentRef$curr = tableContentRef.current) === null || _tableContentRef$curr === void 0 || (_tableContentRef$curr = _tableContentRef$curr.style) === null || _tableContentRef$curr === void 0 || _tableContentRef$curr.setProperty('--table-body-width', "".concat(newWidth - 12, "px"));
|
|
333
|
+
(_tableContentRef$curr2 = tableContentRef.current) === null || _tableContentRef$curr2 === void 0 || (_tableContentRef$curr2 = _tableContentRef$curr2.style) === null || _tableContentRef$curr2 === void 0 || _tableContentRef$curr2.setProperty('--table-body-height', "".concat(height - 54, "px"));
|
|
334
|
+
}
|
|
335
|
+
});
|
|
334
336
|
});
|
|
335
337
|
observer.observe(tableContentRef.current);
|
|
336
338
|
return function () {
|