@sheinx/hooks 3.3.0-beta.5 → 3.3.0-beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/cjs/common/use-position-style/index.js +1 -1
  2. package/cjs/components/use-button/use-button.d.ts +1 -1
  3. package/cjs/components/use-datepicker/use-date.d.ts.map +1 -1
  4. package/cjs/components/use-datepicker/use-date.js +1 -11
  5. package/cjs/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  6. package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  7. package/cjs/components/use-datepicker/use-datepicker-format.js +1 -0
  8. package/cjs/components/use-datepicker/use-datepicker-range.d.ts +2 -0
  9. package/cjs/components/use-datepicker/use-datepicker-range.d.ts.map +1 -1
  10. package/cjs/components/use-datepicker/use-datepicker-range.js +12 -2
  11. package/cjs/components/use-datepicker/util.d.ts +1 -0
  12. package/cjs/components/use-datepicker/util.d.ts.map +1 -1
  13. package/cjs/components/use-datepicker/util.js +15 -1
  14. package/cjs/components/use-form/use-form.d.ts.map +1 -1
  15. package/cjs/components/use-form/use-form.js +4 -3
  16. package/cjs/components/use-image/use-image.d.ts +1 -1
  17. package/cjs/components/use-pagination/use-pagination.d.ts +1 -1
  18. package/cjs/components/use-pagination/use-pagination.d.ts.map +1 -1
  19. package/cjs/components/use-pagination/use-pagination.js +7 -5
  20. package/cjs/components/use-table/use-table.type.d.ts +2 -2
  21. package/esm/common/use-position-style/index.js +1 -1
  22. package/esm/components/use-button/use-button.d.ts +1 -1
  23. package/esm/components/use-datepicker/use-date.d.ts.map +1 -1
  24. package/esm/components/use-datepicker/use-date.js +1 -11
  25. package/esm/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  26. package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  27. package/esm/components/use-datepicker/use-datepicker-format.js +1 -0
  28. package/esm/components/use-datepicker/use-datepicker-range.d.ts +2 -0
  29. package/esm/components/use-datepicker/use-datepicker-range.d.ts.map +1 -1
  30. package/esm/components/use-datepicker/use-datepicker-range.js +12 -2
  31. package/esm/components/use-datepicker/util.d.ts +1 -0
  32. package/esm/components/use-datepicker/util.d.ts.map +1 -1
  33. package/esm/components/use-datepicker/util.js +15 -1
  34. package/esm/components/use-form/use-form.d.ts.map +1 -1
  35. package/esm/components/use-form/use-form.js +4 -3
  36. package/esm/components/use-image/use-image.d.ts +1 -1
  37. package/esm/components/use-pagination/use-pagination.d.ts +1 -1
  38. package/esm/components/use-pagination/use-pagination.d.ts.map +1 -1
  39. package/esm/components/use-pagination/use-pagination.js +7 -5
  40. package/esm/components/use-table/use-table.type.d.ts +2 -2
  41. package/package.json +1 -1
@@ -24,7 +24,7 @@ var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top'
24
24
  var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
25
25
  var hideStyle = {
26
26
  pointerEvents: 'none',
27
- position: 'absolute',
27
+ position: 'fixed',
28
28
  zIndex: -1000,
29
29
  opacity: 0
30
30
  };
@@ -28,7 +28,7 @@ declare const useButton: (props?: BaseButtonProps) => {
28
28
  buttonRef?: React.Ref<HTMLButtonElement> | undefined;
29
29
  } & TOther_1 & {
30
30
  disabled: boolean | undefined;
31
- htmlType: "button" | "reset" | "submit" | undefined;
31
+ htmlType: "button" | "submit" | "reset" | undefined;
32
32
  onClick: (event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLAnchorElement>) => void;
33
33
  };
34
34
  getSpaceChildren: (children: React.ReactNode, space?: boolean, className?: string) => React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"use-date.d.ts","sourceRoot":"","sources":["use-date.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;;wBAmBX,IAAI;2BA6CD,IAAI;yBAgBN,IAAI;0BAqDH,IAAI;+BAzEC,IAAI;+BAmDJ,IAAI;0BAvBT,IAAI;2BAIH,IAAI;;gCAIC,IAAI;;CAoFpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-date.d.ts","sourceRoot":"","sources":["use-date.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;;wBAmBX,IAAI;2BA6CD,IAAI;yBAgBN,IAAI;0BAiDH,IAAI;+BArEC,IAAI;+BA+CJ,IAAI;0BAnBT,IAAI;2BAIH,IAAI;;gCAIC,IAAI;;CAgFpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -99,17 +99,7 @@ var useDate = function useDate(props) {
99
99
  return _util.default.getDateInfo(date, 'week', options);
100
100
  };
101
101
  var getDateWithTime = function getDateWithTime(date) {
102
- var min = props.min,
103
- max = props.max;
104
- var timeDate = props.value || props.defaultTime && _util.default.cloneTime(date, props.defaultTime, _util.default.TIME_FORMAT, options);
105
- var newDate = _util.default.toDate(date);
106
- if (timeDate) {
107
- newDate = _util.default.setTime(newDate, timeDate, options);
108
- }
109
- // only can select day with the same day of min/max
110
- if (min && _util.default.compareAsc(newDate, min) < 0) newDate = _util.default.setTime(newDate, min, options);
111
- if (max && _util.default.compareAsc(newDate, max) > 0) newDate = _util.default.setTime(newDate, max, options);
112
- return newDate;
102
+ return _util.default.getDateWithTime(date, props.value, props.defaultTime, props.min, props.max, options);
113
103
  };
114
104
  var handleDayClick = function handleDayClick(date) {
115
105
  var _props$onChange;
@@ -4,7 +4,7 @@ declare const useDatePickerFormat: <Value extends DatePickerValueType>(props: Us
4
4
  resultArr: (string | undefined)[];
5
5
  targetResultArr: (string | undefined)[];
6
6
  dateArr: (Date | undefined)[];
7
- disabledStatus: "all" | "left" | "right" | undefined;
7
+ disabledStatus: "left" | "right" | "all" | undefined;
8
8
  currentArr: Date[];
9
9
  mode: DatePickerModeType[];
10
10
  isEmpty: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBA2Ic,gBAAgB;iCA8BR,MAAM,SAAS,MAAM;yCA5HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAOH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CAwKvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBA4Ic,gBAAgB;iCA8BR,MAAM,SAAS,MAAM;yCA7HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAQH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CAwKvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -141,6 +141,7 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
141
141
  });
142
142
  var setCurrentArrWithParams = (0, _usePersistFn.usePersistFn)(function (arg, type, quick) {
143
143
  setCurrentArr(arg);
144
+ if (!type && !quick) return;
144
145
  setParams({
145
146
  type: type,
146
147
  quick: quick
@@ -16,6 +16,8 @@ declare const useRangePick: (props: useRangeProps) => {
16
16
  setTargetEnd: (date?: Date) => void;
17
17
  startDisabled: (date: Date) => boolean;
18
18
  endDisabled: (date: Date) => boolean;
19
+ getStartDobule: (date: Date) => Date;
20
+ getEndDobule: (date: Date) => Date;
19
21
  };
20
22
  };
21
23
  export default useRangePick;
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-range.d.ts","sourceRoot":"","sources":["use-datepicker-range.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAK5D,QAAA,MAAM,YAAY,UAAW,aAAa;;;;;;;;;6BAqFC,IAAI,YAAY,OAAO;2BAKzB,IAAI,YAAY,OAAO;gCAblB,IAAI,WAAW,GAAG,EAAE;8BAItB,IAAI,WAAW,GAAG,EAAE;gCAclB,IAAI;8BAIN,IAAI;8BAqBJ,IAAI;4BAeN,IAAI;;CAqE7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"use-datepicker-range.d.ts","sourceRoot":"","sources":["use-datepicker-range.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAK5D,QAAA,MAAM,YAAY,UAAW,aAAa;;;;;;;;;6BA0FC,IAAI,YAAY,OAAO;2BAKzB,IAAI,YAAY,OAAO;gCAblB,IAAI,WAAW,GAAG,EAAE;8BAItB,IAAI,WAAW,GAAG,EAAE;gCAclB,IAAI;8BA4BN,IAAI;8BAqBJ,IAAI;4BAeN,IAAI;+BA5DD,IAAI;6BAYN,IAAI;;CAuH9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -44,7 +44,7 @@ var useRangePick = function useRangePick(props) {
44
44
  newArr[1] = rangeMax;
45
45
  }
46
46
  } else if (date.getTime() > newArr[1].getTime()) {
47
- var a = _util.default.cloneTime(new Date(date), defaultTimeArr[1], 'HH:mm:ss', options);
47
+ var a = _util.default.cloneTime(new Date(date), arr[1] || defaultTimeArr[1], 'HH:mm:ss', options);
48
48
  newArr[1] = a.getTime() > date.getTime() ? a : new Date(date);
49
49
  }
50
50
  }
@@ -112,6 +112,14 @@ var useRangePick = function useRangePick(props) {
112
112
  var setTargetStart = (0, _usePersistFn.usePersistFn)(function (date) {
113
113
  setTargetArr([date, undefined]);
114
114
  });
115
+ var getStartDobule = (0, _usePersistFn.usePersistFn)(function (date) {
116
+ var end = _util.default.getDateWithTime(date, props.dateArr[1], defaultTimeArr[1], endMin, endMax, options);
117
+ return end;
118
+ });
119
+ var getEndDobule = (0, _usePersistFn.usePersistFn)(function (date) {
120
+ var start = _util.default.getDateWithTime(date, props.dateArr[1], defaultTimeArr[1], startMin, startMax, options);
121
+ return start;
122
+ });
115
123
  var setTargetEnd = (0, _usePersistFn.usePersistFn)(function (date) {
116
124
  setTargetArr([undefined, date]);
117
125
  });
@@ -168,7 +176,9 @@ var useRangePick = function useRangePick(props) {
168
176
  setTargetStart: setTargetStart,
169
177
  setTargetEnd: setTargetEnd,
170
178
  startDisabled: startDisabled,
171
- endDisabled: endDisabled
179
+ endDisabled: endDisabled,
180
+ getStartDobule: getStartDobule,
181
+ getEndDobule: getEndDobule
172
182
  });
173
183
  var minDate = min ? _util.default.toDate(min, options) : undefined;
174
184
  var maxDate = max ? _util.default.toDate(max, options) : undefined;
@@ -77,6 +77,7 @@ declare const _default: {
77
77
  transDateWithZone: typeof transDateWithZone;
78
78
  getStartYear: typeof getStartYear;
79
79
  isValidString: typeof isValidString;
80
+ getDateWithTime: (date: Date, value: Date | undefined, defaultTime: string | number | Date | undefined, min: Date | undefined, max: Date | undefined, options: DateOptions) => Date;
80
81
  };
81
82
  export default _default;
82
83
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AAaA,MAAM,MA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AE,IAAI,GAAG,SAAS,EAC7B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,iBAWrB;AAED,iBAAS,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,QAMjD;AAED,iBAAS,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,oBAAS,EAAE,OAAO,EAAE,WAAW,WAQxF;AAcD,iBAAS,iBAAiB,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,eAInF;AAED,iBAAS,SAAS,CAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,KAAK,MAAM,CAAC,EACxD,OAAO,EAAE,WAAW,UAKrB;AAED,iBAAS,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,UAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBD,wBAsCE"}
@@ -358,6 +358,19 @@ function formatted(date, fmt, options) {
358
358
  function getStartYear(date, options) {
359
359
  return Math.floor(getDateInfo(date, 'year', options) / 10) * 10;
360
360
  }
361
+
362
+ // 如果有 value 取 value 的 time 否则取 defaultTime
363
+ var getDateWithTime = function getDateWithTime(date, value, defaultTime, min, max, options) {
364
+ var timeDate = value || defaultTime && cloneTime(date, defaultTime, TIME_FORMAT, options);
365
+ var newDate = toDate(date);
366
+ if (timeDate) {
367
+ newDate = setTime(newDate, timeDate, options);
368
+ }
369
+ // only can select day with the same day of min/max
370
+ if (min && compareAsc(newDate, min) < 0) newDate = setTime(newDate, min, options);
371
+ if (max && compareAsc(newDate, max) > 0) newDate = setTime(newDate, max, options);
372
+ return newDate;
373
+ };
361
374
  var _default = exports.default = {
362
375
  clearHMS: clearHMS,
363
376
  addDays: addDays,
@@ -394,5 +407,6 @@ var _default = exports.default = {
394
407
  compatibleFmt: compatibleFmt,
395
408
  transDateWithZone: transDateWithZone,
396
409
  getStartYear: getStartYear,
397
- isValidString: isValidString
410
+ isValidString: isValidString,
411
+ getDateWithTime: getDateWithTime
398
412
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["use-form.ts"],"names":[],"mappings":";AAwBA,OAAO,EAAe,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI5D,QAAA,MAAM,OAAO;;;;;;;;;wBAgK8B;gBAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;aAAE;8BARzB,MAAM;oCAuDD,OAAO;;6BAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;oCAdrB,MAAM,EAAE;sCArEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;qCAiI5D,MAAM;gCAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;gCAKpC,MAAM,SAAS,MAAM;;;;;;oBA1CpB;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE;0BARzB,MAAM;gCAuDD,OAAO;;yBAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;gCAdrB,MAAM,EAAE;kCArEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;iCAiI5D,MAAM;4BAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;4BAKpC,MAAM,SAAS,MAAM;;CA6P9D,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["use-form.ts"],"names":[],"mappings":";AAyBA,OAAO,EAAe,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI5D,QAAA,MAAM,OAAO;;;;;;;;;wBAmK8B;gBAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;aAAE;8BARzB,MAAM;oCAuDD,OAAO;;6BAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;oCAdrB,MAAM,EAAE;sCArEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;qCAiI5D,MAAM;gCAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;gCAKpC,MAAM,SAAS,MAAM;;;;;;oBA1CpB;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE;0BARzB,MAAM;gCAuDD,OAAO;;yBAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;gCAdrB,MAAM,EAAE;kCArEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;iCAiI5D,MAAM;4BAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;4BAKpC,MAAM,SAAS,MAAM;;CA4P9D,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -11,6 +11,7 @@ var _useLatestObj = _interopRequireDefault(require("../../common/use-latest-obj"
11
11
  var _usePersistFn = _interopRequireDefault(require("../../common/use-persist-fn"));
12
12
  var _attribute = require("../../utils/attribute");
13
13
  var _flat = require("../../utils/flat");
14
+ var _useDefaultValue = require("../../common/use-default-value");
14
15
  var _immer = require("../../utils/immer");
15
16
  var _utils = require("../../utils");
16
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -49,6 +50,7 @@ var useForm = function useForm(props) {
49
50
  removeUndefined: removeUndefined,
50
51
  forceSet: true
51
52
  };
53
+ var preValue = (0, _useDefaultValue.usePrevious)(props.value);
52
54
  var formRef = React.useRef();
53
55
  var _React$useRef = React.useRef({
54
56
  defaultValues: {},
@@ -419,8 +421,8 @@ var useForm = function useForm(props) {
419
421
  var updateValue = function updateValue() {
420
422
  if (props.value !== context.lastValue && props.value !== context.value) {
421
423
  context.value = (0, _utils.deepClone)(props.value) || emptyObj;
422
- context.lastValue = props.value;
423
424
  }
425
+ context.lastValue = props.value;
424
426
  };
425
427
  updateValue();
426
428
  React.useEffect(function () {
@@ -443,14 +445,13 @@ var useForm = function useForm(props) {
443
445
  if (props.value === context.value) return;
444
446
  if (initValidate && !context.resetTime) {
445
447
  var keys = Object.keys(context.validateMap).filter(function (key) {
446
- var oldValue = (0, _utils.deepGet)(context.lastValue || emptyObj, key);
448
+ var oldValue = (0, _utils.deepGet)(preValue || emptyObj, key);
447
449
  var newValue = (0, _utils.deepGet)(context.value || emptyObj, key);
448
450
  return !(0, _utils.shallowEqual)(oldValue, newValue);
449
451
  });
450
452
  validateFields(keys).catch(function () {});
451
453
  }
452
454
  update();
453
- context.lastValue = props.value;
454
455
  context.resetTime = 0;
455
456
  }, [props.value]);
456
457
  React.useEffect(function () {
@@ -10,7 +10,7 @@ declare const useImage: (props?: BaseImageProps) => {
10
10
  getRootProps: <TOther extends ObjectType = ObjectType>(externalProps?: TOther) => {
11
11
  [x: string]: (event: any) => void;
12
12
  } & TOther & {
13
- ref: React.RefObject<HTMLDivElement | HTMLAnchorElement>;
13
+ ref: React.RefObject<HTMLAnchorElement | HTMLDivElement>;
14
14
  onClick: (event: React.MouseEvent<HTMLImageElement | HTMLDivElement>) => void;
15
15
  };
16
16
  getImageProps: <TOther_1 extends ObjectType = ObjectType>(externalProps?: TOther_1) => {
@@ -4,7 +4,7 @@ declare const usePagination: (props: BasePaginationProps) => {
4
4
  current: number | undefined;
5
5
  pageSize: number;
6
6
  total: number;
7
- onChange: (current: number, size?: number) => void;
7
+ onChange: (c: number, size?: number) => void;
8
8
  getRootProps: <TOther extends ObjectType = ObjectType>(externalProps?: TOther) => {
9
9
  [x: string]: (event: any) => void;
10
10
  } & TOther & {
@@ -1 +1 @@
1
- {"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;wBAiBhB,MAAM,SAAS,MAAM;;;;;;;CAiCrD,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;kBAiBT,MAAM,SAAS,MAAM;;;;;;;CAiC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var _utils = require("../../utils");
10
+ var _usePersistFn = require("../../common/use-persist-fn");
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
13
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -38,14 +39,15 @@ var usePagination = function usePagination(props) {
38
39
  (0, _react.useEffect)(function () {
39
40
  if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
40
41
  }, [pageSizeProp]);
41
- var handleChange = function handleChange(current, size) {
42
- setCurrent(current);
42
+ var handleChange = (0, _usePersistFn.usePersistFn)(function (c, size) {
43
+ if (c === current && size === undefined) return;
44
+ setCurrent(c);
43
45
  setPageSize(size || pageSizeProp);
44
46
  if (onChange) {
45
- var sizeChange = pageSize !== size;
46
- onChange(current, size || pageSize, sizeChange);
47
+ var sizeChange = size !== undefined && pageSize !== size;
48
+ onChange(c, size || pageSize, sizeChange);
47
49
  }
48
- };
50
+ });
49
51
  var getRootProps = function getRootProps() {
50
52
  var externalProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
51
53
  var externalEventHandlers = (0, _utils.extractEventHandlers)(externalProps);
@@ -239,8 +239,8 @@ export interface TableColumnItem<DataItem> {
239
239
  */
240
240
  style?: React.CSSProperties;
241
241
  /**
242
- * @cn 列点击事件
243
- * @en Click event of column
242
+ * @cn 可展开元素点击事件仅当(仅该列为行展开列,并且传入 expandKeys 的时候生效)
243
+ * @en Click event of expandable element only when (only this column is row-expand column and expandKeys is passed in)
244
244
  */
245
245
  onClick?: (d: DataItem, isExpand: boolean) => void;
246
246
  /**
@@ -14,7 +14,7 @@ var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top'
14
14
  var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
15
15
  var hideStyle = {
16
16
  pointerEvents: 'none',
17
- position: 'absolute',
17
+ position: 'fixed',
18
18
  zIndex: -1000,
19
19
  opacity: 0
20
20
  };
@@ -28,7 +28,7 @@ declare const useButton: (props?: BaseButtonProps) => {
28
28
  buttonRef?: React.Ref<HTMLButtonElement> | undefined;
29
29
  } & TOther_1 & {
30
30
  disabled: boolean | undefined;
31
- htmlType: "button" | "reset" | "submit" | undefined;
31
+ htmlType: "button" | "submit" | "reset" | undefined;
32
32
  onClick: (event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLAnchorElement>) => void;
33
33
  };
34
34
  getSpaceChildren: (children: React.ReactNode, space?: boolean, className?: string) => React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"use-date.d.ts","sourceRoot":"","sources":["use-date.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;;wBAmBX,IAAI;2BA6CD,IAAI;yBAgBN,IAAI;0BAqDH,IAAI;+BAzEC,IAAI;+BAmDJ,IAAI;0BAvBT,IAAI;2BAIH,IAAI;;gCAIC,IAAI;;CAoFpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-date.d.ts","sourceRoot":"","sources":["use-date.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;;wBAmBX,IAAI;2BA6CD,IAAI;yBAgBN,IAAI;0BAiDH,IAAI;+BArEC,IAAI;+BA+CJ,IAAI;0BAnBT,IAAI;2BAIH,IAAI;;gCAIC,IAAI;;CAgFpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -93,17 +93,7 @@ var useDate = function useDate(props) {
93
93
  return utils.getDateInfo(date, 'week', options);
94
94
  };
95
95
  var getDateWithTime = function getDateWithTime(date) {
96
- var min = props.min,
97
- max = props.max;
98
- var timeDate = props.value || props.defaultTime && utils.cloneTime(date, props.defaultTime, utils.TIME_FORMAT, options);
99
- var newDate = utils.toDate(date);
100
- if (timeDate) {
101
- newDate = utils.setTime(newDate, timeDate, options);
102
- }
103
- // only can select day with the same day of min/max
104
- if (min && utils.compareAsc(newDate, min) < 0) newDate = utils.setTime(newDate, min, options);
105
- if (max && utils.compareAsc(newDate, max) > 0) newDate = utils.setTime(newDate, max, options);
106
- return newDate;
96
+ return utils.getDateWithTime(date, props.value, props.defaultTime, props.min, props.max, options);
107
97
  };
108
98
  var handleDayClick = function handleDayClick(date) {
109
99
  var _props$onChange;
@@ -4,7 +4,7 @@ declare const useDatePickerFormat: <Value extends DatePickerValueType>(props: Us
4
4
  resultArr: (string | undefined)[];
5
5
  targetResultArr: (string | undefined)[];
6
6
  dateArr: (Date | undefined)[];
7
- disabledStatus: "all" | "left" | "right" | undefined;
7
+ disabledStatus: "left" | "right" | "all" | undefined;
8
8
  currentArr: Date[];
9
9
  mode: DatePickerModeType[];
10
10
  isEmpty: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBA2Ic,gBAAgB;iCA8BR,MAAM,SAAS,MAAM;yCA5HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAOH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CAwKvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBA4Ic,gBAAgB;iCA8BR,MAAM,SAAS,MAAM;yCA7HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAQH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CAwKvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -134,6 +134,7 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
134
134
  });
135
135
  var setCurrentArrWithParams = usePersistFn(function (arg, type, quick) {
136
136
  setCurrentArr(arg);
137
+ if (!type && !quick) return;
137
138
  setParams({
138
139
  type: type,
139
140
  quick: quick
@@ -16,6 +16,8 @@ declare const useRangePick: (props: useRangeProps) => {
16
16
  setTargetEnd: (date?: Date) => void;
17
17
  startDisabled: (date: Date) => boolean;
18
18
  endDisabled: (date: Date) => boolean;
19
+ getStartDobule: (date: Date) => Date;
20
+ getEndDobule: (date: Date) => Date;
19
21
  };
20
22
  };
21
23
  export default useRangePick;
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-range.d.ts","sourceRoot":"","sources":["use-datepicker-range.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAK5D,QAAA,MAAM,YAAY,UAAW,aAAa;;;;;;;;;6BAqFC,IAAI,YAAY,OAAO;2BAKzB,IAAI,YAAY,OAAO;gCAblB,IAAI,WAAW,GAAG,EAAE;8BAItB,IAAI,WAAW,GAAG,EAAE;gCAclB,IAAI;8BAIN,IAAI;8BAqBJ,IAAI;4BAeN,IAAI;;CAqE7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"use-datepicker-range.d.ts","sourceRoot":"","sources":["use-datepicker-range.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAK5D,QAAA,MAAM,YAAY,UAAW,aAAa;;;;;;;;;6BA0FC,IAAI,YAAY,OAAO;2BAKzB,IAAI,YAAY,OAAO;gCAblB,IAAI,WAAW,GAAG,EAAE;8BAItB,IAAI,WAAW,GAAG,EAAE;gCAclB,IAAI;8BA4BN,IAAI;8BAqBJ,IAAI;4BAeN,IAAI;+BA5DD,IAAI;6BAYN,IAAI;;CAuH9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -37,7 +37,7 @@ var useRangePick = function useRangePick(props) {
37
37
  newArr[1] = rangeMax;
38
38
  }
39
39
  } else if (date.getTime() > newArr[1].getTime()) {
40
- var a = utils.cloneTime(new Date(date), defaultTimeArr[1], 'HH:mm:ss', options);
40
+ var a = utils.cloneTime(new Date(date), arr[1] || defaultTimeArr[1], 'HH:mm:ss', options);
41
41
  newArr[1] = a.getTime() > date.getTime() ? a : new Date(date);
42
42
  }
43
43
  }
@@ -105,6 +105,14 @@ var useRangePick = function useRangePick(props) {
105
105
  var setTargetStart = usePersistFn(function (date) {
106
106
  setTargetArr([date, undefined]);
107
107
  });
108
+ var getStartDobule = usePersistFn(function (date) {
109
+ var end = utils.getDateWithTime(date, props.dateArr[1], defaultTimeArr[1], endMin, endMax, options);
110
+ return end;
111
+ });
112
+ var getEndDobule = usePersistFn(function (date) {
113
+ var start = utils.getDateWithTime(date, props.dateArr[1], defaultTimeArr[1], startMin, startMax, options);
114
+ return start;
115
+ });
108
116
  var setTargetEnd = usePersistFn(function (date) {
109
117
  setTargetArr([undefined, date]);
110
118
  });
@@ -161,7 +169,9 @@ var useRangePick = function useRangePick(props) {
161
169
  setTargetStart: setTargetStart,
162
170
  setTargetEnd: setTargetEnd,
163
171
  startDisabled: startDisabled,
164
- endDisabled: endDisabled
172
+ endDisabled: endDisabled,
173
+ getStartDobule: getStartDobule,
174
+ getEndDobule: getEndDobule
165
175
  });
166
176
  var minDate = min ? utils.toDate(min, options) : undefined;
167
177
  var maxDate = max ? utils.toDate(max, options) : undefined;
@@ -77,6 +77,7 @@ declare const _default: {
77
77
  transDateWithZone: typeof transDateWithZone;
78
78
  getStartYear: typeof getStartYear;
79
79
  isValidString: typeof isValidString;
80
+ getDateWithTime: (date: Date, value: Date | undefined, defaultTime: string | number | Date | undefined, min: Date | undefined, max: Date | undefined, options: DateOptions) => Date;
80
81
  };
81
82
  export default _default;
82
83
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,IAAI,GACZ,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAKjD,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAqBD,eAAO,MAAM,aAAa,SAAU,MAAM,uBAmBzC,CAAC;AAOF,iBAAS,iBAAiB,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,GAAE,WAAgB,EAAE,IAAI,UAAQ,QAa3E;AAED,iBAAS,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,QAKhE;AAED,iBAAS,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,QAKlE;AAED,iBAAS,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,QAKnE;AAED,iBAAS,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,QAKjE;AAED,iBAAS,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EA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,QAS5D;AAED,iBAAS,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,QAKpF;AAED,iBAAS,yBAAyB,CAChC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,GAAG,SAAS,EACvB,WAAW,EAAE,IAAI,GAAG,SAAS,EAC7B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,iBAWrB;AAED,iBAAS,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,QAMjD;AAED,iBAAS,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,oBAAS,EAAE,OAAO,EAAE,WAAW,WAQxF;AAcD,iBAAS,iBAAiB,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,eAInF;AAED,iBAAS,SAAS,CAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,KAAK,MAAM,CAAC,EACxD,OAAO,EAAE,WAAW,UAKrB;AAED,iBAAS,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,UAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBD,wBAsCE"}
@@ -352,6 +352,19 @@ function formatted(date, fmt, options) {
352
352
  function getStartYear(date, options) {
353
353
  return Math.floor(getDateInfo(date, 'year', options) / 10) * 10;
354
354
  }
355
+
356
+ // 如果有 value 取 value 的 time 否则取 defaultTime
357
+ var getDateWithTime = function getDateWithTime(date, value, defaultTime, min, max, options) {
358
+ var timeDate = value || defaultTime && cloneTime(date, defaultTime, TIME_FORMAT, options);
359
+ var newDate = toDate(date);
360
+ if (timeDate) {
361
+ newDate = setTime(newDate, timeDate, options);
362
+ }
363
+ // only can select day with the same day of min/max
364
+ if (min && compareAsc(newDate, min) < 0) newDate = setTime(newDate, min, options);
365
+ if (max && compareAsc(newDate, max) > 0) newDate = setTime(newDate, max, options);
366
+ return newDate;
367
+ };
355
368
  export default {
356
369
  clearHMS: clearHMS,
357
370
  addDays: addDays,
@@ -388,5 +401,6 @@ export default {
388
401
  compatibleFmt: compatibleFmt,
389
402
  transDateWithZone: transDateWithZone,
390
403
  getStartYear: getStartYear,
391
- isValidString: isValidString
404
+ isValidString: isValidString,
405
+ getDateWithTime: getDateWithTime
392
406
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["use-form.ts"],"names":[],"mappings":";AAwBA,OAAO,EAAe,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI5D,QAAA,MAAM,OAAO;;;;;;;;;wBAgK8B;gBAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;aAAE;8BARzB,MAAM;oCAuDD,OAAO;;6BAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;oCAdrB,MAAM,EAAE;sCArEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;qCAiI5D,MAAM;gCAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;gCAKpC,MAAM,SAAS,MAAM;;;;;;oBA1CpB;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE;0BARzB,MAAM;gCAuDD,OAAO;;yBAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;gCAdrB,MAAM,EAAE;kCArEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;iCAiI5D,MAAM;4BAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;4BAKpC,MAAM,SAAS,MAAM;;CA6P9D,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["use-form.ts"],"names":[],"mappings":";AAyBA,OAAO,EAAe,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI5D,QAAA,MAAM,OAAO;;;;;;;;;wBAmK8B;gBAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;aAAE;8BARzB,MAAM;oCAuDD,OAAO;;6BAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;oCAdrB,MAAM,EAAE;sCArEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;qCAiI5D,MAAM;gCAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;gCAKpC,MAAM,SAAS,MAAM;;;;;;oBA1CpB;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE;0BARzB,MAAM;gCAuDD,OAAO;;yBAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;gCAdrB,MAAM,EAAE;kCArEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;iCAiI5D,MAAM;4BAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;4BAKpC,MAAM,SAAS,MAAM;;CA4P9D,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -13,6 +13,7 @@ import useLatestObj from "../../common/use-latest-obj";
13
13
  import usePersistFn from "../../common/use-persist-fn";
14
14
  import { getDataAttributeName } from "../../utils/attribute";
15
15
  import { insertValue, spliceValue } from "../../utils/flat";
16
+ import { usePrevious } from "../../common/use-default-value";
16
17
  var globalKey = '__global__&&@@';
17
18
  import { current, produce } from "../../utils/immer";
18
19
  import { deepGet, deepRemove, deepSet, docScroll, extractEventHandlers, isArray, isObject, shallowEqual, wrapFormError, deepClone } from "../../utils";
@@ -40,6 +41,7 @@ var useForm = function useForm(props) {
40
41
  removeUndefined: removeUndefined,
41
42
  forceSet: true
42
43
  };
44
+ var preValue = usePrevious(props.value);
43
45
  var formRef = React.useRef();
44
46
  var _React$useRef = React.useRef({
45
47
  defaultValues: {},
@@ -410,8 +412,8 @@ var useForm = function useForm(props) {
410
412
  var updateValue = function updateValue() {
411
413
  if (props.value !== context.lastValue && props.value !== context.value) {
412
414
  context.value = deepClone(props.value) || emptyObj;
413
- context.lastValue = props.value;
414
415
  }
416
+ context.lastValue = props.value;
415
417
  };
416
418
  updateValue();
417
419
  React.useEffect(function () {
@@ -434,14 +436,13 @@ var useForm = function useForm(props) {
434
436
  if (props.value === context.value) return;
435
437
  if (initValidate && !context.resetTime) {
436
438
  var keys = Object.keys(context.validateMap).filter(function (key) {
437
- var oldValue = deepGet(context.lastValue || emptyObj, key);
439
+ var oldValue = deepGet(preValue || emptyObj, key);
438
440
  var newValue = deepGet(context.value || emptyObj, key);
439
441
  return !shallowEqual(oldValue, newValue);
440
442
  });
441
443
  validateFields(keys).catch(function () {});
442
444
  }
443
445
  update();
444
- context.lastValue = props.value;
445
446
  context.resetTime = 0;
446
447
  }, [props.value]);
447
448
  React.useEffect(function () {
@@ -10,7 +10,7 @@ declare const useImage: (props?: BaseImageProps) => {
10
10
  getRootProps: <TOther extends ObjectType = ObjectType>(externalProps?: TOther) => {
11
11
  [x: string]: (event: any) => void;
12
12
  } & TOther & {
13
- ref: React.RefObject<HTMLDivElement | HTMLAnchorElement>;
13
+ ref: React.RefObject<HTMLAnchorElement | HTMLDivElement>;
14
14
  onClick: (event: React.MouseEvent<HTMLImageElement | HTMLDivElement>) => void;
15
15
  };
16
16
  getImageProps: <TOther_1 extends ObjectType = ObjectType>(externalProps?: TOther_1) => {
@@ -4,7 +4,7 @@ declare const usePagination: (props: BasePaginationProps) => {
4
4
  current: number | undefined;
5
5
  pageSize: number;
6
6
  total: number;
7
- onChange: (current: number, size?: number) => void;
7
+ onChange: (c: number, size?: number) => void;
8
8
  getRootProps: <TOther extends ObjectType = ObjectType>(externalProps?: TOther) => {
9
9
  [x: string]: (event: any) => void;
10
10
  } & TOther & {
@@ -1 +1 @@
1
- {"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;wBAiBhB,MAAM,SAAS,MAAM;;;;;;;CAiCrD,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;kBAiBT,MAAM,SAAS,MAAM;;;;;;;CAiC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -12,6 +12,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { useEffect, useState } from 'react';
14
14
  import { extractEventHandlers } from "../../utils";
15
+ import { usePersistFn } from "../../common/use-persist-fn";
15
16
  var usePagination = function usePagination(props) {
16
17
  var totalProp = props.total,
17
18
  pageSizeProp = props.pageSize,
@@ -32,14 +33,15 @@ var usePagination = function usePagination(props) {
32
33
  useEffect(function () {
33
34
  if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
34
35
  }, [pageSizeProp]);
35
- var handleChange = function handleChange(current, size) {
36
- setCurrent(current);
36
+ var handleChange = usePersistFn(function (c, size) {
37
+ if (c === current && size === undefined) return;
38
+ setCurrent(c);
37
39
  setPageSize(size || pageSizeProp);
38
40
  if (onChange) {
39
- var sizeChange = pageSize !== size;
40
- onChange(current, size || pageSize, sizeChange);
41
+ var sizeChange = size !== undefined && pageSize !== size;
42
+ onChange(c, size || pageSize, sizeChange);
41
43
  }
42
- };
44
+ });
43
45
  var getRootProps = function getRootProps() {
44
46
  var externalProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
45
47
  var externalEventHandlers = extractEventHandlers(externalProps);
@@ -239,8 +239,8 @@ export interface TableColumnItem<DataItem> {
239
239
  */
240
240
  style?: React.CSSProperties;
241
241
  /**
242
- * @cn 列点击事件
243
- * @en Click event of column
242
+ * @cn 可展开元素点击事件仅当(仅该列为行展开列,并且传入 expandKeys 的时候生效)
243
+ * @en Click event of expandable element only when (only this column is row-expand column and expandKeys is passed in)
244
244
  */
245
245
  onClick?: (d: DataItem, isExpand: boolean) => void;
246
246
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.3.0-beta.5",
3
+ "version": "3.3.0-beta.7",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",