@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.
@@ -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
- var _iterator = _createForOfIteratorHelper(entries),
217
- _step;
218
- try {
219
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
220
- var entrie = _step.value;
221
- //@ts-ignore
222
- var offsetWidth = entrie.target.offsetWidth;
223
- setWidth(offsetWidth);
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
- } catch (err) {
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>
@@ -10,7 +10,7 @@
10
10
 
11
11
  .filter-panel-wrapper {
12
12
  position: fixed;
13
- z-index: 1000;
13
+ z-index: 2000;
14
14
  border-radius: 2px;
15
15
  width: fit-content;
16
16
  height: fit-content;
@@ -1,13 +1,13 @@
1
1
  import { TableMaxColumnType } from "../../type";
2
- export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
3
- export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
4
- export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
5
- export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
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) => 1 | -1 | 0;
8
- stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
9
- timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
10
- numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
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
- var _entries$, _entries$2;
326
- var newWidth = (_entries$ = entries[0]) === null || _entries$ === void 0 ? void 0 : _entries$.contentRect.width;
327
- var height = (_entries$2 = entries[0]) === null || _entries$2 === void 0 ? void 0 : _entries$2.contentRect.height;
328
- if (newWidth || height) {
329
- var _tableContentRef$curr, _tableContentRef$curr2;
330
- debouncedHandleResizeRef.current(newWidth);
331
- (_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"));
332
- (_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"));
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 () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "2.3.76",
3
+ "version": "2.3.78",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",