@arim-aisdc/public-components 2.3.77 → 2.3.79

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>
@@ -40,7 +40,7 @@ export var DateRange = function DateRange(_ref) {
40
40
  var _useTranslation = useTranslation(),
41
41
  _useTranslation2 = _slicedToArray(_useTranslation, 1),
42
42
  t = _useTranslation2[0];
43
- var _ref2 = columnDef.filterComProps || {},
43
+ var _ref2 = (columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterComProps) || {},
44
44
  _ref2$format = _ref2.format,
45
45
  format = _ref2$format === void 0 ? defaultDateFormat : _ref2$format,
46
46
  _ref2$rangePresets = _ref2.rangePresets,
@@ -273,12 +273,12 @@ var Filter = function Filter(_ref) {
273
273
  className: "single-com-wrapper",
274
274
  children: /*#__PURE__*/_jsx(DatePicker, {
275
275
  value: columnFilterValue ? dayjs(columnFilterValue) : undefined,
276
- showTime: (_columnDef$filterComP = columnDef.filterComProps) === null || _columnDef$filterComP === void 0 ? void 0 : _columnDef$filterComP.showTime,
277
- format: ((_columnDef$filterComP2 = columnDef.filterComProps) === null || _columnDef$filterComP2 === void 0 ? void 0 : _columnDef$filterComP2.format) || defaultDateFormat,
278
- picker: ((_columnDef$filterComP3 = columnDef.filterComProps) === null || _columnDef$filterComP3 === void 0 ? void 0 : _columnDef$filterComP3.picker) || 'date',
276
+ showTime: columnDef === null || columnDef === void 0 || (_columnDef$filterComP = columnDef.filterComProps) === null || _columnDef$filterComP === void 0 ? void 0 : _columnDef$filterComP.showTime,
277
+ format: (columnDef === null || columnDef === void 0 || (_columnDef$filterComP2 = columnDef.filterComProps) === null || _columnDef$filterComP2 === void 0 ? void 0 : _columnDef$filterComP2.format) || defaultDateFormat,
278
+ picker: (columnDef === null || columnDef === void 0 || (_columnDef$filterComP3 = columnDef.filterComProps) === null || _columnDef$filterComP3 === void 0 ? void 0 : _columnDef$filterComP3.picker) || 'date',
279
279
  onChange: function onChange(date) {
280
280
  var _columnDef$filterComP4;
281
- return handleChangeFilterValue(date ? date.format(((_columnDef$filterComP4 = columnDef.filterComProps) === null || _columnDef$filterComP4 === void 0 ? void 0 : _columnDef$filterComP4.format) || defaultDateFormat) : undefined);
281
+ return handleChangeFilterValue(date ? date.format((columnDef === null || columnDef === void 0 || (_columnDef$filterComP4 = columnDef.filterComProps) === null || _columnDef$filterComP4 === void 0 ? void 0 : _columnDef$filterComP4.format) || defaultDateFormat) : undefined);
282
282
  },
283
283
  style: {
284
284
  width: 188
@@ -1,13 +1,13 @@
1
1
  import { TableMaxColumnType } from "../../type";
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;
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;
6
6
  declare const customSortFns: {
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;
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;
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 () {
@@ -111,7 +111,7 @@ export var getFormatFilters = function getFormatFilters(columns, originFilters)
111
111
  var _ref4 = curColumn || {},
112
112
  filterType = _ref4.filterType,
113
113
  filterKey = _ref4.filterKey;
114
- var _ref5 = curColumn.filterComProps || {},
114
+ var _ref5 = (curColumn === null || curColumn === void 0 ? void 0 : curColumn.filterComProps) || {},
115
115
  _ref5$format = _ref5.format,
116
116
  format = _ref5$format === void 0 ? defaultDateFormat : _ref5$format;
117
117
  // 优先取formattedFilterKey作为key
@@ -163,7 +163,7 @@ export var getFormatFiltersV2 = function getFormatFiltersV2(columns, originFilte
163
163
  var _ref6 = curColumn || {},
164
164
  filterType = _ref6.filterType,
165
165
  filterKey = _ref6.filterKey;
166
- // const { format = defaultDateFormat } = curColumn.filterComProps || {};
166
+ // const { format = defaultDateFormat } = curColumn?.filterComProps || {};
167
167
  // 优先取formattedFilterKey作为key
168
168
  var formatKey = filterKey || id;
169
169
  var res = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "2.3.77",
3
+ "version": "2.3.79",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",