@sheinx/hooks 3.7.0-beta.9 → 3.7.0-fix.1

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.
Files changed (151) hide show
  1. package/cjs/common/use-component-memo/index.d.ts +1 -1
  2. package/cjs/common/use-component-memo/index.d.ts.map +1 -1
  3. package/cjs/common/use-component-memo/index.js +2 -9
  4. package/cjs/common/use-component-memo/use-memo.d.ts +1 -1
  5. package/cjs/common/use-component-memo/use-memo.d.ts.map +1 -1
  6. package/cjs/common/use-component-memo/use-memo.js +2 -2
  7. package/cjs/common/use-filter/index.d.ts +1 -0
  8. package/cjs/common/use-filter/index.d.ts.map +1 -1
  9. package/cjs/common/use-filter/index.js +7 -0
  10. package/cjs/common/use-filter/use-filter-context.d.ts +7 -0
  11. package/cjs/common/use-filter/use-filter-context.d.ts.map +1 -0
  12. package/cjs/common/use-filter/use-filter-context.js +10 -0
  13. package/cjs/common/use-filter/use-filter.d.ts +1 -0
  14. package/cjs/common/use-filter/use-filter.d.ts.map +1 -1
  15. package/cjs/common/use-filter/use-filter.js +2 -0
  16. package/cjs/common/use-input-able/use-Input-able.d.ts.map +1 -1
  17. package/cjs/common/use-input-able/use-Input-able.js +6 -7
  18. package/cjs/common/use-position-style/check-element-size.d.ts +10 -0
  19. package/cjs/common/use-position-style/check-element-size.d.ts.map +1 -0
  20. package/cjs/common/use-position-style/check-element-size.js +65 -0
  21. package/cjs/common/use-position-style/index.d.ts.map +1 -1
  22. package/cjs/common/use-position-style/index.js +5 -1
  23. package/cjs/components/use-datepicker/index.d.ts +1 -1
  24. package/cjs/components/use-datepicker/index.d.ts.map +1 -1
  25. package/cjs/components/use-datepicker/index.js +23 -2
  26. package/cjs/components/use-datepicker/use-datepicker-format.d.ts +17 -0
  27. package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  28. package/cjs/components/use-datepicker/use-datepicker-format.js +15 -3
  29. package/cjs/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
  30. package/cjs/components/use-form/use-form-control/use-form-control.js +9 -4
  31. package/cjs/components/use-form/use-form.d.ts +4 -4
  32. package/cjs/components/use-form/use-form.d.ts.map +1 -1
  33. package/cjs/components/use-form/use-form.js +31 -25
  34. package/cjs/components/use-form/use-form.type.d.ts +8 -0
  35. package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
  36. package/cjs/components/use-image/use-image.d.ts +2 -0
  37. package/cjs/components/use-image/use-image.d.ts.map +1 -1
  38. package/cjs/components/use-image/use-image.js +40 -2
  39. package/cjs/components/use-popup/popup-context.d.ts +2 -0
  40. package/cjs/components/use-popup/popup-context.d.ts.map +1 -1
  41. package/cjs/components/use-popup/popup-context.js +2 -0
  42. package/cjs/components/use-popup/use-popup.d.ts +4 -0
  43. package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
  44. package/cjs/components/use-popup/use-popup.js +33 -13
  45. package/cjs/components/use-table/index.d.ts +1 -1
  46. package/cjs/components/use-table/index.d.ts.map +1 -1
  47. package/cjs/components/use-table/use-table-filter.d.ts.map +1 -1
  48. package/cjs/components/use-table/use-table-filter.js +2 -1
  49. package/cjs/components/use-table/use-table-group.d.ts.map +1 -1
  50. package/cjs/components/use-table/use-table-group.js +3 -1
  51. package/cjs/components/use-table/use-table-layout.d.ts.map +1 -1
  52. package/cjs/components/use-table/use-table-layout.js +0 -1
  53. package/cjs/components/use-table/use-table-virtual.js +1 -1
  54. package/cjs/components/use-table/use-table.type.d.ts +13 -21
  55. package/cjs/components/use-table/use-table.type.d.ts.map +1 -1
  56. package/cjs/components/use-tree/use-tree.d.ts.map +1 -1
  57. package/cjs/components/use-tree/use-tree.js +25 -7
  58. package/cjs/components/use-tree/use-tree.type.d.ts +1 -0
  59. package/cjs/components/use-tree/use-tree.type.d.ts.map +1 -1
  60. package/cjs/components/use-upload/use-upload.d.ts.map +1 -1
  61. package/cjs/components/use-upload/use-upload.js +54 -34
  62. package/cjs/components/use-upload/use-upload.type.d.ts +7 -0
  63. package/cjs/components/use-upload/use-upload.type.d.ts.map +1 -1
  64. package/cjs/utils/clean-props.d.ts +11 -0
  65. package/cjs/utils/clean-props.d.ts.map +1 -0
  66. package/cjs/utils/clean-props.js +21 -0
  67. package/cjs/utils/highlight.d.ts +7 -0
  68. package/cjs/utils/highlight.d.ts.map +1 -0
  69. package/cjs/utils/highlight.js +67 -0
  70. package/cjs/utils/index.d.ts +2 -0
  71. package/cjs/utils/index.d.ts.map +1 -1
  72. package/cjs/utils/index.js +24 -0
  73. package/cjs/utils/string.d.ts +1 -0
  74. package/cjs/utils/string.d.ts.map +1 -1
  75. package/cjs/utils/string.js +13 -0
  76. package/esm/common/use-component-memo/index.d.ts +1 -1
  77. package/esm/common/use-component-memo/index.d.ts.map +1 -1
  78. package/esm/common/use-component-memo/index.js +1 -1
  79. package/esm/common/use-component-memo/use-memo.d.ts +1 -1
  80. package/esm/common/use-component-memo/use-memo.d.ts.map +1 -1
  81. package/esm/common/use-component-memo/use-memo.js +1 -1
  82. package/esm/common/use-filter/index.d.ts +1 -0
  83. package/esm/common/use-filter/index.d.ts.map +1 -1
  84. package/esm/common/use-filter/index.js +2 -1
  85. package/esm/common/use-filter/use-filter-context.d.ts +7 -0
  86. package/esm/common/use-filter/use-filter-context.d.ts.map +1 -0
  87. package/esm/common/use-filter/use-filter-context.js +3 -0
  88. package/esm/common/use-filter/use-filter.d.ts +1 -0
  89. package/esm/common/use-filter/use-filter.d.ts.map +1 -1
  90. package/esm/common/use-filter/use-filter.js +2 -0
  91. package/esm/common/use-input-able/use-Input-able.d.ts.map +1 -1
  92. package/esm/common/use-input-able/use-Input-able.js +7 -8
  93. package/esm/common/use-position-style/check-element-size.d.ts +10 -0
  94. package/esm/common/use-position-style/check-element-size.d.ts.map +1 -0
  95. package/esm/common/use-position-style/check-element-size.js +59 -0
  96. package/esm/common/use-position-style/index.d.ts.map +1 -1
  97. package/esm/common/use-position-style/index.js +5 -1
  98. package/esm/components/use-datepicker/index.d.ts +1 -1
  99. package/esm/components/use-datepicker/index.d.ts.map +1 -1
  100. package/esm/components/use-datepicker/index.js +1 -1
  101. package/esm/components/use-datepicker/use-datepicker-format.d.ts +17 -0
  102. package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  103. package/esm/components/use-datepicker/use-datepicker-format.js +14 -2
  104. package/esm/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
  105. package/esm/components/use-form/use-form-control/use-form-control.js +9 -4
  106. package/esm/components/use-form/use-form.d.ts +4 -4
  107. package/esm/components/use-form/use-form.d.ts.map +1 -1
  108. package/esm/components/use-form/use-form.js +31 -25
  109. package/esm/components/use-form/use-form.type.d.ts +8 -0
  110. package/esm/components/use-form/use-form.type.d.ts.map +1 -1
  111. package/esm/components/use-image/use-image.d.ts +2 -0
  112. package/esm/components/use-image/use-image.d.ts.map +1 -1
  113. package/esm/components/use-image/use-image.js +40 -2
  114. package/esm/components/use-popup/popup-context.d.ts +2 -0
  115. package/esm/components/use-popup/popup-context.d.ts.map +1 -1
  116. package/esm/components/use-popup/popup-context.js +2 -0
  117. package/esm/components/use-popup/use-popup.d.ts +4 -0
  118. package/esm/components/use-popup/use-popup.d.ts.map +1 -1
  119. package/esm/components/use-popup/use-popup.js +34 -14
  120. package/esm/components/use-table/index.d.ts +1 -1
  121. package/esm/components/use-table/index.d.ts.map +1 -1
  122. package/esm/components/use-table/use-table-filter.d.ts.map +1 -1
  123. package/esm/components/use-table/use-table-filter.js +2 -1
  124. package/esm/components/use-table/use-table-group.d.ts.map +1 -1
  125. package/esm/components/use-table/use-table-group.js +3 -1
  126. package/esm/components/use-table/use-table-layout.d.ts.map +1 -1
  127. package/esm/components/use-table/use-table-layout.js +0 -1
  128. package/esm/components/use-table/use-table-virtual.js +1 -1
  129. package/esm/components/use-table/use-table.type.d.ts +13 -21
  130. package/esm/components/use-table/use-table.type.d.ts.map +1 -1
  131. package/esm/components/use-tree/use-tree.d.ts.map +1 -1
  132. package/esm/components/use-tree/use-tree.js +26 -8
  133. package/esm/components/use-tree/use-tree.type.d.ts +1 -0
  134. package/esm/components/use-tree/use-tree.type.d.ts.map +1 -1
  135. package/esm/components/use-upload/use-upload.d.ts.map +1 -1
  136. package/esm/components/use-upload/use-upload.js +54 -34
  137. package/esm/components/use-upload/use-upload.type.d.ts +7 -0
  138. package/esm/components/use-upload/use-upload.type.d.ts.map +1 -1
  139. package/esm/utils/clean-props.d.ts +11 -0
  140. package/esm/utils/clean-props.d.ts.map +1 -0
  141. package/esm/utils/clean-props.js +15 -0
  142. package/esm/utils/highlight.d.ts +7 -0
  143. package/esm/utils/highlight.d.ts.map +1 -0
  144. package/esm/utils/highlight.js +59 -0
  145. package/esm/utils/index.d.ts +2 -0
  146. package/esm/utils/index.d.ts.map +1 -1
  147. package/esm/utils/index.js +3 -1
  148. package/esm/utils/string.d.ts +1 -0
  149. package/esm/utils/string.d.ts.map +1 -1
  150. package/esm/utils/string.js +12 -0
  151. package/package.json +1 -1
@@ -47,7 +47,8 @@ var useForm = function useForm(props) {
47
47
  size = props.size,
48
48
  colon = props.colon,
49
49
  formName = props.name,
50
- scrollParent = props.scrollParent;
50
+ scrollParent = props.scrollParent,
51
+ isControl = props.isControl;
51
52
  var deepSetOptions = {
52
53
  removeUndefined: removeUndefined,
53
54
  forceSet: true
@@ -201,7 +202,7 @@ var useForm = function useForm(props) {
201
202
  if (errors.length > 0) {
202
203
  var errorFields = [];
203
204
  for (var _key in context.errors) {
204
- if (context.errors[_key]) {
205
+ if (context.errors[_key] && context.names.has(_key)) {
205
206
  var _context$errors$_key;
206
207
  errorFields.push({
207
208
  name: _key,
@@ -303,13 +304,16 @@ var useForm = function useForm(props) {
303
304
  var values = Object.keys(vals);
304
305
  // 针对 name 为数组模式,如 datepicker 的 name={['startTime', 'endTime']} 时,前者校验可能需要依赖后者,因此需要提前将后者数据整合至 draft 用于多字段整合校验
305
306
  values.forEach(function (key) {
306
- (0, _utils.deepSet)(draft, key, vals[key], deepSetOptions);
307
+ // upload组件返回的可能是函数: (prev) => [...prev, file]
308
+ var valueOfKey = typeof vals[key] === 'function' ? vals[key](getValue(key)) : vals[key];
309
+ (0, _utils.deepSet)(draft, key, valueOfKey, deepSetOptions);
307
310
  });
308
311
  values.forEach(function (key) {
309
312
  if (option.validate) {
310
313
  var _context$validateMap$;
311
314
  (_context$validateMap$ = context.validateMap[key]) === null || _context$validateMap$ === void 0 || _context$validateMap$.forEach(function (validate) {
312
- validate(key, vals[key], (0, _immer.current)(draft));
315
+ var valueOfKey = typeof vals[key] === 'function' ? vals[key](getValue(key)) : vals[key];
316
+ validate(key, valueOfKey, (0, _immer.current)(draft));
313
317
  });
314
318
  }
315
319
  });
@@ -320,7 +324,11 @@ var useForm = function useForm(props) {
320
324
  fullKeyPaths.forEach(function (key) {
321
325
  delete context.serverErrors[key];
322
326
  });
323
- update(fullKeyPaths);
327
+ if (option.forceUpdate) {
328
+ update();
329
+ } else {
330
+ update(fullKeyPaths);
331
+ }
324
332
  });
325
333
  var updateDefaultValue = function updateDefaultValue() {
326
334
  if (!context.mounted) return;
@@ -365,6 +373,7 @@ var useForm = function useForm(props) {
365
373
  });
366
374
  var submit = (0, _usePersistFn.default)(function () {
367
375
  var withValidate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
376
+ var callback = arguments.length > 1 ? arguments[1] : undefined;
368
377
  if (disabled) return;
369
378
  if (context.submitLock) {
370
379
  return;
@@ -382,32 +391,29 @@ var useForm = function useForm(props) {
382
391
  while (1) switch (_context.prev = _context.next) {
383
392
  case 0:
384
393
  if (withValidate) {
385
- _context.next = 3;
394
+ _context.next = 4;
386
395
  break;
387
396
  }
388
397
  (_props$onSubmit = props.onSubmit) === null || _props$onSubmit === void 0 || _props$onSubmit.call(props, (_context$value = context.value) !== null && _context$value !== void 0 ? _context$value : {});
398
+ callback === null || callback === void 0 || callback();
389
399
  return _context.abrupt("return");
390
- case 3:
391
- _context.next = 5;
400
+ case 4:
401
+ _context.next = 6;
392
402
  return validateFields(undefined, {
393
403
  ignoreBind: true
394
404
  }).catch(function (e) {
395
405
  return e;
396
406
  });
397
- case 5:
407
+ case 6:
398
408
  result = _context.sent;
399
- if (!(result === true)) {
400
- _context.next = 11;
401
- break;
409
+ if (result === true) {
410
+ (_props$onSubmit2 = props.onSubmit) === null || _props$onSubmit2 === void 0 || _props$onSubmit2.call(props, (_context$value2 = context.value) !== null && _context$value2 !== void 0 ? _context$value2 : {});
411
+ if (activeEl) activeEl.focus();
412
+ } else {
413
+ handleSubmitError(result);
402
414
  }
403
- (_props$onSubmit2 = props.onSubmit) === null || _props$onSubmit2 === void 0 || _props$onSubmit2.call(props, (_context$value2 = context.value) !== null && _context$value2 !== void 0 ? _context$value2 : {});
404
- if (activeEl) activeEl.focus();
405
- _context.next = 13;
406
- break;
407
- case 11:
408
- handleSubmitError(result);
409
- return _context.abrupt("return");
410
- case 13:
415
+ callback === null || callback === void 0 || callback();
416
+ case 9:
411
417
  case "end":
412
418
  return _context.stop();
413
419
  }
@@ -491,10 +497,8 @@ var useForm = function useForm(props) {
491
497
  context.updateMap[n] = new Set();
492
498
  }
493
499
  context.updateMap[n].add(updateFn);
494
- var shouldTriggerResetChange = context.removeArr.has(n);
495
500
  context.removeArr.delete(n);
496
- var shouldTriggerDefaultChange = df !== undefined && (0, _utils.deepGet)(context.value, n) === undefined;
497
- if (shouldTriggerDefaultChange || shouldTriggerResetChange) {
501
+ if (df !== undefined && (0, _utils.deepGet)(context.value, n) === undefined) {
498
502
  if (!context.mounted) context.defaultValues[n] = df;
499
503
  onChange(function (v) {
500
504
  (0, _utils.deepSet)(v, n, df, deepSetOptions);
@@ -514,7 +518,6 @@ var useForm = function useForm(props) {
514
518
  }
515
519
  if (validateFieldSet.size === 0 && updateFieldSet.size === 0) {
516
520
  context.names.delete(n);
517
- delete context.errors[n];
518
521
  delete context.defaultValues[n];
519
522
  }
520
523
  var finalReserveAble = (_props$reserveAble = props.reserveAble) !== null && _props$reserveAble !== void 0 ? _props$reserveAble : reserveAble;
@@ -609,7 +612,10 @@ var useForm = function useForm(props) {
609
612
  React.useEffect(function () {
610
613
  context.removeLock = false;
611
614
  // 内部 onChange 改的 value, 不需要更新
612
- if (props.value === context.value) return;
615
+ if (props.value === context.value) {
616
+ if (!isControl) update();
617
+ return;
618
+ }
613
619
  if (initValidate && !context.resetTime) {
614
620
  var keys = Object.keys(context.validateMap).filter(function (key) {
615
621
  var oldValue = (0, _utils.deepGet)(preValue || emptyObj, key);
@@ -58,6 +58,13 @@ export interface FormLabelConfig {
58
58
  * @default false
59
59
  */
60
60
  keepErrorHeight?: boolean;
61
+ /**
62
+ * @en Whether to keep the error message below the form item, the default is false
63
+ * @cn 是否保持错误信息在提示信息下方
64
+ * @default false
65
+ * @version 3.7.0
66
+ */
67
+ keepErrorBelow?: boolean;
61
68
  /**
62
69
  * @en When inline is true, the form is horizontal layout
63
70
  * @cn 是否水平布局
@@ -187,6 +194,7 @@ export interface BaseFormProps<T> extends Omit<FormCommonConfig, 'formName'> {
187
194
  }
188
195
  export type UseFormProps<T> = BaseFormProps<T> & {
189
196
  formElRef: React.RefObject<HTMLFormElement>;
197
+ isControl: boolean;
190
198
  };
191
199
  export type FormContext = {
192
200
  defaultValues: ObjectType;
@@ -1 +1 @@
1
- {"version":3,"file":"use-form.type.d.ts","sourceRoot":"","sources":["use-form.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,MAAM,EAAE,CAAC,CAAC;IACV,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MA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React.MouseEvent<HTMLImageElement | HTMLDivElement>) => void;
15
15
  };
16
16
  getImageProps: <TOther_1 extends ObjectType = ObjectType>(externalProps?: TOther_1) => {
17
+ style: React.CSSProperties;
18
+ } & {
17
19
  [x: string]: (event: any) => void;
18
20
  } & TOther_1 & {
19
21
  alt: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"use-image.d.ts","sourceRoot":"","sources":["use-image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAWlD,QAAA,MAAM,QAAQ,WAAW,cAAc;;;;;;;;;;yBA6D3B,gBAAgB,CAAC,gBAAgB,GAAG,cAAc,CAAC;;;;;;;;;;;CAmF9D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-image.d.ts","sourceRoot":"","sources":["use-image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAWlD,QAAA,MAAM,QAAQ,WAAW,cAAc;;;;;;;;;;yBAiG3B,gBAAgB,CAAC,gBAAgB,GAAG,cAAc,CAAC;;;;;;;;;;;;;CAoF9D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -43,6 +43,10 @@ var useImage = function useImage() {
43
43
  _React$useState2 = _slicedToArray(_React$useState, 2),
44
44
  status = _React$useState2[0],
45
45
  setStatus = _React$useState2[1];
46
+ var _React$useState3 = _react.default.useState({}),
47
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
48
+ imgCoverStyle = _React$useState4[0],
49
+ setImgCoverStyle = _React$useState4[1];
46
50
  var elementRef = _react.default.useRef(null);
47
51
  var getUrl = function getUrl(url) {
48
52
  var auto = 'autoSSL' in props ? autoSSL : config.autoSSL;
@@ -77,6 +81,35 @@ var useImage = function useImage() {
77
81
  };
78
82
  img.src = getUrl(alt);
79
83
  };
84
+ var handleCoverStyle = function handleCoverStyle(img) {
85
+ var container = elementRef === null || elementRef === void 0 ? void 0 : elementRef.current;
86
+ if (!container) return;
87
+
88
+ // 根据容器的宽高获取宽高比
89
+ var containerWidth = container.clientWidth;
90
+ var containerHeight = container.clientHeight;
91
+ var containerRatio = containerWidth / containerHeight;
92
+
93
+ // 根据图片的自然尺寸获取宽高比
94
+ var imageWidth = img.naturalWidth;
95
+ var imageHeight = img.naturalHeight;
96
+ var imageRatio = imageWidth / imageHeight;
97
+
98
+ // 判断宽高比,决定图片填充策略
99
+ if (imageRatio > containerRatio) {
100
+ // 图片更宽,宽度占满容器,高度自适应
101
+ setImgCoverStyle({
102
+ height: '100%',
103
+ width: 'auto'
104
+ });
105
+ } else {
106
+ // 图片更高,填满容器高度
107
+ setImgCoverStyle({
108
+ width: '100%',
109
+ height: 'auto'
110
+ });
111
+ }
112
+ };
80
113
  var markToRender = function markToRender() {
81
114
  if (!src) {
82
115
  handleAlt();
@@ -84,7 +117,10 @@ var useImage = function useImage() {
84
117
  }
85
118
  var img = new window.Image();
86
119
  img.onload = function () {
87
- return setStatus(SRC);
120
+ setStatus(SRC);
121
+ if (props.fit === 'fill') {
122
+ handleCoverStyle(img);
123
+ }
88
124
  };
89
125
  img.onerror = function (e) {
90
126
  return handleError(SRC, e);
@@ -113,7 +149,9 @@ var useImage = function useImage() {
113
149
  alt: alt,
114
150
  draggable: !noImgDrag
115
151
  });
116
- return _objectSpread({}, mergedEventHandlers);
152
+ return _objectSpread({
153
+ style: imgCoverStyle
154
+ }, mergedEventHandlers);
117
155
  };
118
156
  var getImageDivProps = function getImageDivProps() {
119
157
  var externalProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  declare const context: React.Context<{
3
+ addParent: (_ref: React.MutableRefObject<HTMLElement | null>) => void;
4
+ removeParent: (_ref: React.MutableRefObject<HTMLElement | null>) => void;
3
5
  bindChild: (_ref: React.MutableRefObject<HTMLElement | null>) => void;
4
6
  removeChild: (_ref: React.MutableRefObject<HTMLElement | null>) => void;
5
7
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"popup-context.d.ts","sourceRoot":"","sources":["popup-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAO7C,QAAA,MAAM,OAAO;sBAJO,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;wBACxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;EAGnB,CAAC;AAE9C,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"popup-context.d.ts","sourceRoot":"","sources":["popup-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAS7C,QAAA,MAAM,OAAO;sBANO,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;yBACvC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;sBAC7C,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;wBACxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;EAGnB,CAAC;AAE9C,eAAe,OAAO,CAAC"}
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var defaultContext = {
10
+ addParent: function addParent(_ref) {},
11
+ removeParent: function removeParent(_ref) {},
10
12
  bindChild: function bindChild(_ref) {},
11
13
  removeChild: function removeChild(_ref) {}
12
14
  };
@@ -39,10 +39,14 @@ declare const usePopup: (props: BasePopupProps) => {
39
39
  openPop: () => void;
40
40
  closePop: () => void;
41
41
  Provider: React.Provider<{
42
+ addParent: (_ref: React.MutableRefObject<HTMLElement | null>) => void;
43
+ removeParent: (_ref: React.MutableRefObject<HTMLElement | null>) => void;
42
44
  bindChild: (_ref: React.MutableRefObject<HTMLElement | null>) => void;
43
45
  removeChild: (_ref: React.MutableRefObject<HTMLElement | null>) => void;
44
46
  }>;
45
47
  providerValue: {
48
+ addParent: (elRef: React.MutableRefObject<HTMLElement | null>) => void;
49
+ removeParent: (elRef: React.MutableRefObject<HTMLElement | null>) => void;
46
50
  bindChild: (elRef: React.MutableRefObject<HTMLElement | null>) => void;
47
51
  removeChild: (elRef: React.MutableRefObject<HTMLElement | null>) => void;
48
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-popup.d.ts","sourceRoot":"","sources":["use-popup.ts"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAOhE,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;;0BA6HK;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;0BAM9B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;qBA5B7B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;2BA6ElD,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;6BAGxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;;CAqBpE,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-popup.d.ts","sourceRoot":"","sources":["use-popup.ts"],"names":[],"mappings":"AAAA,OAAO,KAA4E,MAAM,OAAO,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAOhE,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;;0BAkIK;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;0BAM9B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;qBA5B7B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;2BApFzC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;8BAOvC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;2BA2JxD,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;6BAMxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;;CA8BlE,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -34,21 +34,32 @@ var usePopup = function usePopup(props) {
34
34
  setOpenState = _useState2[1];
35
35
  var _useContext = (0, _react.useContext)(_popupContext.default),
36
36
  bindChild = _useContext.bindChild,
37
- removeChild = _useContext.removeChild;
37
+ removeChild = _useContext.removeChild,
38
+ addParent = _useContext.addParent,
39
+ removeParent = _useContext.removeParent;
38
40
  var targetRef = (0, _react.useRef)(null);
39
41
  var popupRef = (0, _react.useRef)(null);
40
- (0, _react.useEffect)(function () {
41
- bindChild(popupRef);
42
- return function () {
43
- removeChild(popupRef);
44
- };
45
- }, []);
46
42
  var _useRef = (0, _react.useRef)({
47
43
  triggerTimer: null,
48
44
  // 记录所有的子popup 点击子 popup 不关闭弹窗
49
45
  chain: [targetRef, popupRef]
50
46
  }),
51
47
  context = _useRef.current;
48
+ var handleAddParent = function handleAddParent(elRef) {
49
+ context.chain.push(elRef);
50
+
51
+ // 继续向上添加当前的 popupRef 到父级
52
+ addParent(elRef);
53
+ };
54
+ var handleRemoveParent = function handleRemoveParent(elRef) {
55
+ var index = context.chain.findIndex(function (item) {
56
+ return item === elRef;
57
+ });
58
+ if (index > -1) {
59
+ context.chain.splice(index, 1);
60
+ removeParent(elRef);
61
+ }
62
+ };
52
63
  var open = openState;
53
64
  var changeOpen = function changeOpen(openIn, delay) {
54
65
  if (context.triggerTimer) clearTimeout(context.triggerTimer);
@@ -78,11 +89,6 @@ var usePopup = function usePopup(props) {
78
89
  updatePosition();
79
90
  }
80
91
  setOpenState(!!props.open);
81
-
82
- // 外部传了open时,需要正常的触发onCollapse;触发了onCollapse才能让组件内部的edit状态正确,否则可能会出现弹出层打开了但是用户却无法选择的情况
83
- if (props.open !== undefined) {
84
- changeOpen(!!props.open);
85
- }
86
92
  }, [props.open]);
87
93
 
88
94
  // const getPopUpHeight = () => {
@@ -187,8 +193,13 @@ var usePopup = function usePopup(props) {
187
193
  });
188
194
  var providerValue = (0, _react.useMemo)(function () {
189
195
  return {
196
+ addParent: handleAddParent,
197
+ removeParent: handleRemoveParent,
190
198
  bindChild: function bindChild(elRef) {
191
- context.chain.push(elRef);
199
+ if (elRef.current) {
200
+ addParent(elRef);
201
+ context.chain.push(elRef);
202
+ }
192
203
  },
193
204
  removeChild: function removeChild(elRef) {
194
205
  var index = context.chain.findIndex(function (item) {
@@ -196,10 +207,19 @@ var usePopup = function usePopup(props) {
196
207
  });
197
208
  if (index > -1) {
198
209
  context.chain.splice(index, 1);
210
+ removeParent(elRef);
199
211
  }
200
212
  }
201
213
  };
202
214
  }, []);
215
+ (0, _react.useLayoutEffect)(function () {
216
+ if (open) {
217
+ bindChild(popupRef);
218
+ }
219
+ return function () {
220
+ removeChild(popupRef);
221
+ };
222
+ }, [open]);
203
223
  return {
204
224
  open: open,
205
225
  position: position,
@@ -7,5 +7,5 @@ export { default as useTableRow } from './use-table-row';
7
7
  export { default as useTableExpand } from './use-table-expand';
8
8
  export { default as useTableTree } from './use-table-tree';
9
9
  export { default as useTableVirtual } from './use-table-virtual';
10
- export type { TableFormatColumn, TableColumnItem, TableHeadColumn, TableGroupColumn, TableSorterInfo, BaseTableProps, TableColumnFilter, TableFilterData, shouldCellUpdate, } from './use-table.type';
10
+ export type { TableFormatColumn, TableColumnItem, TableHeadColumn, TableGroupColumn, TableSorterInfo, BaseTableProps, TableColumnFilter, TableFilterData, } from './use-table.type';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEjE,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEjE,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-filter.d.ts","sourceRoot":"","sources":["use-table-filter.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,mBAAmB,CAAC,IAAI,GAAG,GAAG,CAC7C,SAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;IACtE,OAAO,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;CACnC;AACD,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;CAC5C;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5D,QAAA,MAAM,cAAc;;;;gCA6BH,YAAY,SAAS,GAAG;CAyDxC,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"use-table-filter.d.ts","sourceRoot":"","sources":["use-table-filter.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,mBAAmB,CAAC,IAAI,GAAG,GAAG,CAC7C,SAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;IACtE,OAAO,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;CACnC;AACD,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;CAC5C;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5D,QAAA,MAAM,cAAc;;;;gCA8BH,YAAY,SAAS,GAAG;CAyDxC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -33,7 +33,8 @@ var useTableFilter = function useTableFilter(props) {
33
33
  }, [filterInfo]);
34
34
  var filteredData = (0, _react.useMemo)(function () {
35
35
  var _props$data;
36
- if (activeFilters.length === 0) return props.data;
36
+ // why use slice: props.data引用不改变会导致后续的useMemo无法重新计算
37
+ if (activeFilters.length === 0) return (props.data || []).slice();
37
38
  return (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.filter(function (item) {
38
39
  return activeFilters.every(function (key) {
39
40
  var filter = filterInfo.get(key);
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-group.d.ts","sourceRoot":"","sources":["use-table-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAoB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKxF,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,QAAA,MAAM,aAAa,UAAW,kBAAkB;;;CAsE/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"use-table-group.d.ts","sourceRoot":"","sources":["use-table-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAoB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKxF,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,QAAA,MAAM,aAAa,UAAW,kBAAkB;;;CAwE/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -33,6 +33,7 @@ var useTableGroup = function useTableGroup(props) {
33
33
  last.colSpan += colSpan;
34
34
  if (col.fixed) last.fixed = col.fixed;
35
35
  if (col.lastFixed) last.lastFixed = true;
36
+ if (col.groupProps) last.groupProps = col.groupProps;
36
37
  } else {
37
38
  var sub = [];
38
39
  colSpan = setColumns(sub, col, level + 1, index);
@@ -45,7 +46,8 @@ var useTableGroup = function useTableGroup(props) {
45
46
  fixed: col.fixed,
46
47
  firstFixed: col.firstFixed,
47
48
  index: index,
48
- columns: sub
49
+ columns: sub,
50
+ groupProps: col.groupProps
49
51
  };
50
52
  columns.push(groupCol);
51
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA0CrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA+CX,MAAM,UAAU,MAAM;;;;;;;CA+O5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA0CrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA+CX,MAAM,UAAU,MAAM;;;;;;;CA8O5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -396,7 +396,6 @@ var useTableLayout = function useTableLayout(props) {
396
396
  width: tableWidth,
397
397
  shouldLastColAuto: props.columnResizable && !adjust,
398
398
  scrollWidth: scrollWidth,
399
- // maxScrollLeft: scrollWidth - context.clientWidth,
400
399
  resizeFlag: resizeFlag
401
400
  };
402
401
  };
@@ -364,7 +364,7 @@ var useTableVirtual = function useTableVirtual(props) {
364
364
  var renderData = (0, _react.useMemo)(function () {
365
365
  if (props.disabled) return props.data;
366
366
  return _toConsumableArray(props.data).slice(startIndex, startIndex + finalRowsInView);
367
- }, [props.data, startIndex, finalRowsInView]);
367
+ }, [props.data, props.disabled, startIndex, finalRowsInView]);
368
368
  var translateStyle = (0, _react.useMemo)(function () {
369
369
  var t = innerTop + offsetY;
370
370
  if (t < 0) {
@@ -116,12 +116,6 @@ export interface BaseTableProps<Item> {
116
116
  * When it is a string,ues the value of the string.For example, 'id' is the same thing as (d) => d.id .
117
117
  */
118
118
  keygen: StructKeygenType<Item>;
119
- /**
120
- * @en The function to determine whether a cell needs to be updated. The return value should be a boolean indicating whether the cell should re-render.
121
- * @cn 控制单元格是否需要更新的函数。返回值应为布尔值,指示单元格是否需要重新渲染
122
- * @version 3.7.0
123
- */
124
- shouldCellUpdate?: shouldCellUpdate<Item>;
125
119
  }
126
120
  export interface TableSorterInfo {
127
121
  order: TableColumnOrder;
@@ -203,11 +197,6 @@ export interface SelectModeColumnFilter<DataItem> extends TableColumnFilterBase<
203
197
  * @en Whether to open the top search box
204
198
  */
205
199
  search?: boolean;
206
- /**
207
- * @cn 是否高亮命中的关键词,仅当 search 为 true 时有效
208
- * @en Whether to highlight the hit keywords
209
- */
210
- highlight?: boolean;
211
200
  };
212
201
  /**
213
202
  * @cn 筛选数据的函数
@@ -263,6 +252,15 @@ export interface TableColumnItem<DataItem> {
263
252
  * @cn 表头分组,相邻的相同 group 会生成一个新的表头
264
253
  */
265
254
  group?: string | React.ReactNode | Array<string | React.ReactNode>;
255
+ /**
256
+ * @en The group of header column, the extra props
257
+ * @cn 表头分组的额外属性
258
+ * @version 3.7.0
259
+ */
260
+ groupProps?: {
261
+ className?: string;
262
+ style?: React.CSSProperties;
263
+ };
266
264
  /**
267
265
  * @en hide the column, only work on row-expand column
268
266
  * @cn 只针对行展开列有效,表示是否隐藏该列
@@ -379,17 +377,7 @@ export interface TableColumnItem<DataItem> {
379
377
  * @en Separately set a column not to be draggable
380
378
  */
381
379
  columnResizable?: false;
382
- /**
383
- * @cn 是否需要更新单元格,dependencies是外部更新依赖项
384
- * @en Whether the cell needs to be updated, the third parameter is the external dependency
385
- * @version 3.7.0
386
- */
387
- shouldCellUpdate?: shouldCellUpdate<DataItem>;
388
380
  }
389
- export type shouldCellUpdate<T> = ((prev: T, next: T) => boolean) | {
390
- update: (prev: T, next: T) => boolean;
391
- dependencies: any[];
392
- };
393
381
  export interface TableFormatColumn<DataItem> extends TableColumnItem<DataItem> {
394
382
  index: number;
395
383
  key: string | number;
@@ -406,6 +394,10 @@ export interface TableGroupColumn {
406
394
  columns: TableHeadColumn[];
407
395
  lastFixed?: boolean;
408
396
  index: number;
397
+ groupProps?: {
398
+ className?: string;
399
+ style?: React.CSSProperties;
400
+ };
409
401
  }
410
402
  export type TableHeadColumn = TableGroupColumn | TableFormatColumn<any>;
411
403
  //# sourceMappingURL=use-table.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-table.type.d.ts","sourceRoot":"","sources":["use-table.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnE,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,YAAY,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AACD,MAAM,WAAW,cAAc,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UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["use-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,SAAS,EAGV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBjD,eAAO,MAAM,IAAI;IACf;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEJ,CAAC;AAEF,QAAA,MAAM,OAAO;;;;;CAurBZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["use-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,SAAS,EAGV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBjD,eAAO,MAAM,IAAI;IACf;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEJ,CAAC;AAEF,QAAA,MAAM,OAAO;;;;;CA4sBZ,CAAC;AAEF,eAAe,OAAO,CAAC"}