@sheinx/hooks 3.4.0-beta.1 → 3.4.0-beta.10

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 (111) hide show
  1. package/cjs/common/use-input-able/use-Input-able.js +2 -2
  2. package/cjs/common/use-position-style/index.d.ts +4 -1
  3. package/cjs/common/use-position-style/index.d.ts.map +1 -1
  4. package/cjs/common/use-position-style/index.js +98 -11
  5. package/cjs/components/use-datepicker/use-date.d.ts +2 -2
  6. package/cjs/components/use-datepicker/use-date.d.ts.map +1 -1
  7. package/cjs/components/use-datepicker/use-date.js +2 -2
  8. package/cjs/components/use-datepicker/use-date.type.d.ts +1 -1
  9. package/cjs/components/use-datepicker/use-date.type.d.ts.map +1 -1
  10. package/cjs/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  11. package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  12. package/cjs/components/use-datepicker/use-datepicker-format.js +4 -2
  13. package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts +1 -0
  14. package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
  15. package/cjs/components/use-datepicker/use-month.d.ts +2 -2
  16. package/cjs/components/use-datepicker/use-month.d.ts.map +1 -1
  17. package/cjs/components/use-datepicker/use-month.js +2 -2
  18. package/cjs/components/use-datepicker/use-month.type.d.ts +1 -1
  19. package/cjs/components/use-datepicker/use-month.type.d.ts.map +1 -1
  20. package/cjs/components/use-datepicker/use-quarter.d.ts +2 -2
  21. package/cjs/components/use-datepicker/use-quarter.d.ts.map +1 -1
  22. package/cjs/components/use-datepicker/use-quarter.js +2 -2
  23. package/cjs/components/use-datepicker/use-year.d.ts +2 -2
  24. package/cjs/components/use-datepicker/use-year.d.ts.map +1 -1
  25. package/cjs/components/use-datepicker/use-year.js +2 -2
  26. package/cjs/components/use-datepicker/use-year.type.d.ts +1 -1
  27. package/cjs/components/use-datepicker/use-year.type.d.ts.map +1 -1
  28. package/cjs/components/use-datepicker/util.d.ts +1 -1
  29. package/cjs/components/use-datepicker/util.d.ts.map +1 -1
  30. package/cjs/components/use-datepicker/util.js +2 -1
  31. package/cjs/components/use-form/use-form-control/use-form-control.js +2 -2
  32. package/cjs/components/use-form/use-form.d.ts.map +1 -1
  33. package/cjs/components/use-form/use-form.js +40 -19
  34. package/cjs/components/use-form/use-form.type.d.ts +11 -6
  35. package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
  36. package/cjs/components/use-input/use-input-format.d.ts +1 -1
  37. package/cjs/components/use-input/use-input-number.d.ts +1 -1
  38. package/cjs/components/use-input/use-input-number.d.ts.map +1 -1
  39. package/cjs/components/use-input/use-input-number.js +37 -5
  40. package/cjs/components/use-popup/use-popup.d.ts +1 -0
  41. package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
  42. package/cjs/components/use-popup/use-popup.js +7 -4
  43. package/cjs/components/use-table/use-table-virtual.d.ts +1 -1
  44. package/cjs/components/use-table/use-table-virtual.d.ts.map +1 -1
  45. package/cjs/components/use-table/use-table-virtual.js +34 -4
  46. package/cjs/components/use-transfer/use-transfer.d.ts +1 -1
  47. package/cjs/components/use-transfer/use-transfer.d.ts.map +1 -1
  48. package/cjs/components/use-transfer/use-transfer.js +8 -17
  49. package/cjs/utils/dom/element.js +1 -1
  50. package/cjs/utils/is.d.ts +1 -0
  51. package/cjs/utils/is.d.ts.map +1 -1
  52. package/cjs/utils/is.js +6 -1
  53. package/cjs/utils/position.d.ts +1 -1
  54. package/cjs/utils/position.d.ts.map +1 -1
  55. package/cjs/utils/position.js +20 -5
  56. package/esm/common/use-input-able/use-Input-able.js +2 -2
  57. package/esm/common/use-position-style/index.d.ts +4 -1
  58. package/esm/common/use-position-style/index.d.ts.map +1 -1
  59. package/esm/common/use-position-style/index.js +99 -12
  60. package/esm/components/use-datepicker/use-date.d.ts +2 -2
  61. package/esm/components/use-datepicker/use-date.d.ts.map +1 -1
  62. package/esm/components/use-datepicker/use-date.js +2 -2
  63. package/esm/components/use-datepicker/use-date.type.d.ts +1 -1
  64. package/esm/components/use-datepicker/use-date.type.d.ts.map +1 -1
  65. package/esm/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  66. package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  67. package/esm/components/use-datepicker/use-datepicker-format.js +4 -2
  68. package/esm/components/use-datepicker/use-datepicker-format.type.d.ts +1 -0
  69. package/esm/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
  70. package/esm/components/use-datepicker/use-month.d.ts +2 -2
  71. package/esm/components/use-datepicker/use-month.d.ts.map +1 -1
  72. package/esm/components/use-datepicker/use-month.js +2 -2
  73. package/esm/components/use-datepicker/use-month.type.d.ts +1 -1
  74. package/esm/components/use-datepicker/use-month.type.d.ts.map +1 -1
  75. package/esm/components/use-datepicker/use-quarter.d.ts +2 -2
  76. package/esm/components/use-datepicker/use-quarter.d.ts.map +1 -1
  77. package/esm/components/use-datepicker/use-quarter.js +2 -2
  78. package/esm/components/use-datepicker/use-year.d.ts +2 -2
  79. package/esm/components/use-datepicker/use-year.d.ts.map +1 -1
  80. package/esm/components/use-datepicker/use-year.js +2 -2
  81. package/esm/components/use-datepicker/use-year.type.d.ts +1 -1
  82. package/esm/components/use-datepicker/use-year.type.d.ts.map +1 -1
  83. package/esm/components/use-datepicker/util.d.ts +1 -1
  84. package/esm/components/use-datepicker/util.d.ts.map +1 -1
  85. package/esm/components/use-datepicker/util.js +2 -1
  86. package/esm/components/use-form/use-form-control/use-form-control.js +2 -2
  87. package/esm/components/use-form/use-form.d.ts.map +1 -1
  88. package/esm/components/use-form/use-form.js +40 -19
  89. package/esm/components/use-form/use-form.type.d.ts +11 -6
  90. package/esm/components/use-form/use-form.type.d.ts.map +1 -1
  91. package/esm/components/use-input/use-input-format.d.ts +1 -1
  92. package/esm/components/use-input/use-input-number.d.ts +1 -1
  93. package/esm/components/use-input/use-input-number.d.ts.map +1 -1
  94. package/esm/components/use-input/use-input-number.js +34 -4
  95. package/esm/components/use-popup/use-popup.d.ts +1 -0
  96. package/esm/components/use-popup/use-popup.d.ts.map +1 -1
  97. package/esm/components/use-popup/use-popup.js +7 -4
  98. package/esm/components/use-table/use-table-virtual.d.ts +1 -1
  99. package/esm/components/use-table/use-table-virtual.d.ts.map +1 -1
  100. package/esm/components/use-table/use-table-virtual.js +34 -4
  101. package/esm/components/use-transfer/use-transfer.d.ts +1 -1
  102. package/esm/components/use-transfer/use-transfer.d.ts.map +1 -1
  103. package/esm/components/use-transfer/use-transfer.js +8 -17
  104. package/esm/utils/dom/element.js +1 -1
  105. package/esm/utils/is.d.ts +1 -0
  106. package/esm/utils/is.d.ts.map +1 -1
  107. package/esm/utils/is.js +3 -0
  108. package/esm/utils/position.d.ts +1 -1
  109. package/esm/utils/position.d.ts.map +1 -1
  110. package/esm/utils/position.js +20 -5
  111. package/package.json +1 -1
@@ -50,10 +50,10 @@ function useInputAble(props) {
50
50
  clearTimeout(context.timer);
51
51
  context.timer = null;
52
52
  }
53
- if (delay && props.value !== stateValue) {
53
+ if (delay && control && props.value !== stateValue) {
54
54
  changeStateValue(props.value);
55
55
  }
56
- }, [props.value, delay]);
56
+ }, [props.value, delay, control]);
57
57
  var forceDelayChange = (0, _usePersistFn.default)(function () {
58
58
  if (context.timer && context.delayChange) {
59
59
  clearTimeout(context.timer);
@@ -16,6 +16,9 @@ export interface PositionStyleConfig {
16
16
  updateKey?: number | string;
17
17
  adjust?: boolean;
18
18
  }
19
- export declare const usePositionStyle: (config: PositionStyleConfig) => React.CSSProperties;
19
+ export declare const usePositionStyle: (config: PositionStyleConfig) => {
20
+ style: React.CSSProperties;
21
+ arrayStyle: React.CSSProperties;
22
+ };
20
23
  export default usePositionStyle;
21
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,MAAM,MAAM,kBAAkB,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AAY,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,OAAO,CAAC;AACpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IAEd,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAE1C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAEzC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAQD,eAAO,MAAM,gBAAgB,WAAY,mBAAmB;;;CAmS3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -49,6 +49,10 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
49
49
  _useState2 = _slicedToArray(_useState, 2),
50
50
  style = _useState2[0],
51
51
  setStyle = _useState2[1];
52
+ var _useState3 = (0, _react.useState)({}),
53
+ _useState4 = _slicedToArray(_useState3, 2),
54
+ arrayStyle = _useState4[0],
55
+ setArrayStyle = _useState4[1];
52
56
  var _React$useRef = _react.default.useRef({
53
57
  element: null,
54
58
  containerRect: {
@@ -122,10 +126,12 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
122
126
  };
123
127
  };
124
128
  var getAbsolutePositionStyle = function getAbsolutePositionStyle(rect, position) {
129
+ var _popupElRef$current;
125
130
  var style = {
126
131
  position: 'absolute',
127
132
  zIndex: zIndex
128
133
  };
134
+ var arrayStyle = {};
129
135
  if (fixedWidth) {
130
136
  var widthKey = fixedWidth === 'min' ? 'minWidth' : 'width';
131
137
  style[widthKey] = rect.width;
@@ -135,6 +141,7 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
135
141
  var containerRect = rootContainer.getBoundingClientRect();
136
142
  var bodyRect = (document.documentElement || document.body).getBoundingClientRect();
137
143
  var containerScrollBarWidth = rootContainer.offsetWidth - rootContainer.clientWidth;
144
+ var targetRect = (_popupElRef$current = popupElRef.current) === null || _popupElRef$current === void 0 ? void 0 : _popupElRef$current.getBoundingClientRect();
138
145
  var containerScroll = {
139
146
  left: rootContainer.scrollLeft,
140
147
  top: rootContainer.scrollTop
@@ -151,14 +158,25 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
151
158
  if (h === 'left') {
152
159
  style.left = rect.left - containerRect.left + containerScroll.left;
153
160
  style.transform = '';
161
+ arrayStyle.left = "8px";
154
162
  if (adjust) {
155
163
  overRight = rect.left + context.popUpWidth - bodyRect.right + containerScrollBarWidth;
164
+ if (style.left < 0 && targetRect) {
165
+ style.left = 'auto';
166
+ }
156
167
  }
157
168
  } else if (h === 'right') {
158
169
  style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left;
159
170
  style.left = 'auto';
160
171
  style.transform = '';
161
- if (adjust) overLeft = bodyRect.left - (rect.right - context.popUpWidth);
172
+ arrayStyle.right = "8px";
173
+ if (adjust) {
174
+ overLeft = bodyRect.left - (rect.right - context.popUpWidth);
175
+ if (style.right < 0 && targetRect) {
176
+ style.left = bodyRect.width - targetRect.width;
177
+ style.right = 'auto';
178
+ }
179
+ }
162
180
  } else {
163
181
  // 居中对齐
164
182
  style.left = rect.left + rect.width / 2 - containerRect.left + containerScroll.left;
@@ -167,6 +185,9 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
167
185
  overRight = rect.left + rect.width / 2 + context.popUpWidth / 2 - bodyRect.width + containerScrollBarWidth;
168
186
  overLeft = bodyRect.left - (rect.left + rect.width / 2 - context.popUpWidth / 2);
169
187
  }
188
+ if (targetRect) {
189
+ arrayStyle.left = "".concat(targetRect.width / 2 - 5.9, "px");
190
+ }
170
191
  }
171
192
  if (adjust) {
172
193
  // 调节左右溢出
@@ -175,16 +196,26 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
175
196
  style.left -= overRight;
176
197
  // 扣除触发器距离页面右侧的距离,以保证从右侧弹出的窗口最右边对齐触发器最右边
177
198
  style.left -= toRightDistance;
199
+ if (targetRect) {
200
+ arrayStyle.left = "".concat((targetRect === null || targetRect === void 0 ? void 0 : targetRect.width) - context.parentRect.width / 2 - 5.9, "px");
201
+ }
178
202
  }
179
203
  if (overLeft > 0) {
180
204
  style.left += overLeft;
205
+ arrayStyle.left = "".concat(rect.width / 2 - 5.9, "px");
181
206
  }
182
207
  }
183
208
  if (v === 'bottom') {
184
209
  style.top = rect.bottom - containerRect.top + containerScroll.top + popupGap;
210
+ if (targetRect) {
211
+ arrayStyle.top = "".concat(0, "px");
212
+ }
185
213
  } else {
186
214
  style.top = rect.top - containerRect.top + containerScroll.top - popupGap;
187
215
  style.transform += 'translateY(-100%)';
216
+ if (targetRect) {
217
+ arrayStyle.top = "".concat(targetRect.height - 5.9 - 4, "px");
218
+ }
188
219
  }
189
220
  } else if (horizontalPosition.includes(targetPosition)) {
190
221
  var _targetPosition$split3 = targetPosition.split('-'),
@@ -194,45 +225,88 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
194
225
  if (_v === 'top') {
195
226
  style.top = rect.top - containerRect.top + containerScroll.top;
196
227
  style.transform = '';
228
+ arrayStyle.top = "8px";
197
229
  } else if (_v === 'bottom') {
198
230
  style.top = rect.bottom - containerRect.top + containerScroll.top;
231
+ arrayStyle.bottom = "8px";
199
232
  style.transform = 'translateY(-100%)';
200
233
  } else {
201
234
  // 居中对齐
202
235
  style.top = rect.top - containerRect.top + containerScroll.top + rect.height / 2;
236
+ if (targetRect) {
237
+ arrayStyle.top = "".concat(targetRect.height / 2 - 5.9 / 2, "px");
238
+ }
203
239
  style.transform = 'translateY(-50%)';
204
240
  }
205
241
  if (_h === 'right') {
206
242
  style.left = rect.right - containerRect.left + containerScroll.left + popupGap;
207
243
  } else {
208
244
  style.left = rect.left - containerRect.left + containerScroll.left - popupGap;
245
+ arrayStyle.right = "0px";
209
246
  style.transform += ' translateX(-100%)';
210
247
  }
211
248
  } else if (position === 'cover') {
212
249
  style.top = rect.top - containerRect.top + containerScroll.top;
213
250
  style.left = rect.left - containerRect.left + containerScroll.left;
214
251
  }
215
- return style;
252
+ return {
253
+ style: style,
254
+ arrayStyle: arrayStyle
255
+ };
216
256
  };
217
257
  var getAbsoluteStyle = function getAbsoluteStyle(position) {
218
- if (!parentElRef.current) return hideStyle;
258
+ if (!parentElRef.current) return {
259
+ style: hideStyle
260
+ };
219
261
  var rect = context.parentRect;
220
262
  if (scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current) {
221
263
  var _scrollElRef$current;
222
264
  var visibleRect = ((_scrollElRef$current = scrollElRef.current) === null || _scrollElRef$current === void 0 ? void 0 : _scrollElRef$current.getBoundingClientRect()) || {};
223
265
  if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom || rect.right < visibleRect.left || rect.left > visibleRect.right) {
224
- return hideStyle;
266
+ return {
267
+ style: hideStyle
268
+ };
225
269
  }
226
270
  }
227
- var style = getAbsolutePositionStyle(rect, position);
228
- return style;
271
+ var _getAbsolutePositionS = getAbsolutePositionStyle(rect, position),
272
+ style = _getAbsolutePositionS.style,
273
+ arrayStyle = _getAbsolutePositionS.arrayStyle;
274
+
275
+ // TODO: 如果是版本大于chrome128,需要根据currentCSSZoom处理chrome的bug
276
+ if (!(0, _utils.isChromeLowerThan)(128)) {
277
+ // @ts-ignore currentCSSZoom
278
+ var currentCSSZoom = document.body.currentCSSZoom;
279
+ if (currentCSSZoom === 1 || !currentCSSZoom) return {
280
+ style: style,
281
+ arrayStyle: arrayStyle
282
+ };
283
+ if (style.left && typeof style.left === 'number') {
284
+ style.left = style.left * (1 / currentCSSZoom);
285
+ }
286
+ if (style.top && typeof style.top === 'number') {
287
+ style.top = style.top * (1 / currentCSSZoom);
288
+ }
289
+ if (style.right && typeof style.right === 'number') {
290
+ style.right = style.right * (1 / currentCSSZoom);
291
+ }
292
+ if (style.bottom && typeof style.bottom === 'number') {
293
+ style.bottom = style.bottom * (1 / currentCSSZoom);
294
+ }
295
+ }
296
+ return {
297
+ style: style,
298
+ arrayStyle: arrayStyle
299
+ };
229
300
  };
230
301
  var getStyle = function getStyle() {
231
302
  var newStyle = {};
303
+ var newArrayStyle = {};
232
304
  var _ref2 = config || {},
233
305
  position = _ref2.position,
234
306
  absolute = _ref2.absolute;
235
- if (!position || !show || !parentElRef.current) return style;
307
+ if (!position || !show || !parentElRef.current) return {
308
+ newStyle: style
309
+ };
236
310
  context.parentRect = parentElRef.current.getBoundingClientRect();
237
311
  if (adjust) {
238
312
  var popupInfo = getPopUpInfo(context.parentRect);
@@ -247,21 +321,34 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
247
321
  fixedWidth: fixedWidth
248
322
  });
249
323
  } else {
250
- newStyle = getAbsoluteStyle(realPosition);
324
+ var _ref3 = getAbsoluteStyle(realPosition),
325
+ nextStyle = _ref3.style,
326
+ nextArrayStyle = _ref3.arrayStyle;
327
+ newStyle = nextStyle;
328
+ newArrayStyle = nextArrayStyle;
251
329
  }
252
330
  // for animation
253
331
  if (realPosition.indexOf('top') === 0) {
254
332
  newStyle.transformOrigin = 'center bottom';
255
333
  }
256
- return newStyle;
334
+ return {
335
+ newStyle: newStyle,
336
+ newArrayStyle: newArrayStyle
337
+ };
257
338
  };
258
339
  var updateStyle = (0, _usePersistFn.default)(function () {
259
- var newStyle = getStyle();
340
+ var _getStyle = getStyle(),
341
+ newStyle = _getStyle.newStyle,
342
+ newArrayStyle = _getStyle.newArrayStyle;
260
343
  if (newStyle && !(0, _shallowEqual.default)(style, newStyle)) {
261
344
  setStyle(newStyle);
345
+ setArrayStyle(newArrayStyle || {});
262
346
  }
263
347
  });
264
348
  (0, _react.useEffect)(updateStyle, [show, position, absolute, updateKey, fixedWidth]);
265
- return style;
349
+ return {
350
+ style: style,
351
+ arrayStyle: arrayStyle
352
+ };
266
353
  };
267
354
  var _default = exports.default = usePositionStyle;
@@ -12,9 +12,9 @@ declare const useDate: (props: UseDateProps) => {
12
12
  isToday: (date: Date) => boolean;
13
13
  isDisabled: (date: Date) => boolean;
14
14
  isActive: (date: Date) => boolean;
15
- isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
15
+ isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
16
16
  isCurrentMonth: (date: Date) => boolean;
17
- handleDayClick: (date: Date) => void;
17
+ handleDayClick: (date: Date, noClose?: boolean) => void;
18
18
  getDayStr: (date: Date) => number;
19
19
  getWeekStr: (date: Date) => number;
20
20
  getTimeStr: () => string;
@@ -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;0BAiDH,IAAI;+BArEC,IAAI;+BA+CJ,IAAI;0BAnBT,IAAI;2BAIH,IAAI;;gCAIC,IAAI;;CAgFpC,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,YAAY,OAAO;0BAnB5B,IAAI;2BAIH,IAAI;;gCAIC,IAAI;;CAgFpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -101,11 +101,11 @@ var useDate = function useDate(props) {
101
101
  var getDateWithTime = function getDateWithTime(date) {
102
102
  return _util.default.getDateWithTime(date, props.value, props.defaultTime, props.min, props.max, options);
103
103
  };
104
- var handleDayClick = function handleDayClick(date) {
104
+ var handleDayClick = function handleDayClick(date, noClose) {
105
105
  var _props$onChange;
106
106
  if (isDisabled(date)) return;
107
107
  var newDate = getDateWithTime(date);
108
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
108
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, noClose);
109
109
  setCurrent(newDate);
110
110
  };
111
111
  var getTimeStr = function getTimeStr() {
@@ -4,7 +4,7 @@ export interface UseDateProps {
4
4
  defaultCurrent?: Date;
5
5
  onCurrentChange?: (date: Date) => void;
6
6
  value?: Date;
7
- onChange?: (date: Date) => void;
7
+ onChange?: (date: Date, noClose?: boolean) => void;
8
8
  min?: Date;
9
9
  max?: Date;
10
10
  type?: 'date' | 'week' | 'datetime';
@@ -1 +1 @@
1
- {"version":3,"file":"use-date.type.d.ts","sourceRoot":"","sources":["use-date.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACrC,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
1
+ {"version":3,"file":"use-date.type.d.ts","sourceRoot":"","sources":["use-date.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACrC,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
@@ -16,7 +16,7 @@ declare const useDatePickerFormat: <Value extends DatePickerValueType>(props: Us
16
16
  finishEdit: () => void;
17
17
  setCurrentArr: React.Dispatch<React.SetStateAction<Date[]>>;
18
18
  setTargetArr: React.Dispatch<React.SetStateAction<(Date | undefined)[]>>;
19
- handleClear: (e: React.MouseEvent) => void;
19
+ handleClear: (e?: React.MouseEvent) => void;
20
20
  handleInputChange: (str: string, index: number) => void;
21
21
  registerModeDisabled: (position: 'start' | 'end' | undefined, mode: string, fn: (d: Date) => boolean) => void;
22
22
  setCurrentArrWithParams: (arg: React.SetStateAction<Date[]>, type: string, quick: {
@@ -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;;;;;;;;;;;;;;;;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"}
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;;;;;;;;;;;;;;;;0BA4Ie,gBAAgB;iCAgCT,MAAM,SAAS,MAAM;yCA/HrD,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;;CA0KvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -215,7 +215,7 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
215
215
  var handleClear = (0, _usePersistFn.usePersistFn)(function (e) {
216
216
  var _props$onClear;
217
217
  if (!clearable) return;
218
- e.stopPropagation();
218
+ e === null || e === void 0 || e.stopPropagation();
219
219
  if (disabledStatus === 'all') return;
220
220
  if (edit) {
221
221
  if (range) {
@@ -229,7 +229,7 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
229
229
  }
230
230
  } else {
231
231
  var _props$onChange;
232
- var emptyValue = props.clearWithUndefined ? undefined : '';
232
+ var emptyValue = props.clearWithUndefined || props.clearToUndefined ? undefined : '';
233
233
  var v = emptyValue;
234
234
  if (range) {
235
235
  v = [emptyValue, emptyValue];
@@ -238,6 +238,8 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
238
238
  v = [props.value[0], emptyValue];
239
239
  } else if (props.value[1] && disabledStatus === 'right') {
240
240
  v = [emptyValue, props.value[1]];
241
+ } else if (props.clearToUndefined) {
242
+ v = undefined;
241
243
  }
242
244
  }
243
245
  }
@@ -15,6 +15,7 @@ export interface UseDatePickerFormatProps<Value extends DatePickerValueType> {
15
15
  } | undefined;
16
16
  clearable: boolean | undefined;
17
17
  clearWithUndefined: boolean | undefined;
18
+ clearToUndefined?: boolean;
18
19
  onClear: (() => void) | undefined;
19
20
  allowSingle: boolean | undefined;
20
21
  defaultCurrent: DatePickerValueType;
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-format.type.d.ts","sourceRoot":"","sources":["use-datepicker-format.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,GAA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AG,MAAM,CAAC;IACpC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC/F,OAAO,EACH;QACE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GACD,SAAS,CAAC;IACd,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,kBAAkB,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAClC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,cAAc,EAAE,mBAAmB,CAAC;IACpC,cAAc,EACV,CAAC,CACC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EACvB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,EACnC,IAAI,EAAE,kBAAkB,KACrB,IAAI,CAAC,GACV,SAAS,CAAC;IACd,QAAQ,EACJ,OAAO,GACP,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC,GACvF,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,GAC1C,SAAS,CAAC;CACf"}
@@ -9,8 +9,8 @@ declare const useMonth: (props: UseMonthProps) => {
9
9
  isNow: (date: Date) => boolean;
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
- isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
13
- handleMonthClick: (date: Date) => void;
12
+ isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
13
+ handleMonthClick: (date: Date, onClose?: boolean) => void;
14
14
  getMonthStr: (date: Date) => number;
15
15
  };
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-month.d.ts","sourceRoot":"","sources":["use-month.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,QAAQ,UAAW,aAAa;;;;;;;sBAuBf,IAAI;2BAkCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;iCAPG,IAAI;4BAJT,IAAI;;CAwChC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-month.d.ts","sourceRoot":"","sources":["use-month.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,QAAQ,UAAW,aAAa;;;;;;;sBAuBf,IAAI;2BAkCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;iCAPG,IAAI,YAAW,OAAO;4BAJ3B,IAAI;;CAwChC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -82,11 +82,11 @@ var useMonth = function useMonth(props) {
82
82
  var getMonthStr = function getMonthStr(date) {
83
83
  return _util.default.getDateInfo(date, 'month', options) + 1;
84
84
  };
85
- var handleMonthClick = function handleMonthClick(date) {
85
+ var handleMonthClick = function handleMonthClick(date, onClose) {
86
86
  var _props$onChange;
87
87
  if (isDisabled(date)) return;
88
88
  var newDate = _util.default.toDate(date);
89
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
89
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, onClose);
90
90
  setCurrent(newDate);
91
91
  };
92
92
  var isInRange = function isInRange(date) {
@@ -4,7 +4,7 @@ export interface UseMonthProps {
4
4
  defaultCurrent?: Date;
5
5
  onCurrentChange?: (date: Date) => void;
6
6
  value?: Date;
7
- onChange?: (date: Date) => void;
7
+ onChange?: (date: Date, onClose?: boolean) => void;
8
8
  min?: Date;
9
9
  max?: Date;
10
10
  disabled?: boolean | ((date: Date) => boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"use-month.type.d.ts","sourceRoot":"","sources":["use-month.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
1
+ {"version":3,"file":"use-month.type.d.ts","sourceRoot":"","sources":["use-month.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
@@ -9,8 +9,8 @@ declare const useQuarter: (props: UseMonthProps) => {
9
9
  isNow: (date: Date) => boolean;
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
- isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
13
- handleQuarterClick: (date: Date) => void;
12
+ isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
13
+ handleQuarterClick: (date: Date, noClose?: boolean) => void;
14
14
  getQuarterStr: (date: Date) => number;
15
15
  };
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-quarter.d.ts","sourceRoot":"","sources":["use-quarter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,UAAU,UAAW,aAAa;;;;;;;sBAuBjB,IAAI;2BAiCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;mCAPK,IAAI;8BAJT,IAAI;;CAwClC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"use-quarter.d.ts","sourceRoot":"","sources":["use-quarter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,UAAU,UAAW,aAAa;;;;;;;sBAuBjB,IAAI;2BAiCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;mCAPK,IAAI,YAAY,OAAO;8BAJ5B,IAAI;;CAwClC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -81,11 +81,11 @@ var useQuarter = function useQuarter(props) {
81
81
  var getQuarterStr = function getQuarterStr(date) {
82
82
  return _util.default.getDateInfo(date, 'quarter', options);
83
83
  };
84
- var handleQuarterClick = function handleQuarterClick(date) {
84
+ var handleQuarterClick = function handleQuarterClick(date, noClose) {
85
85
  var _props$onChange;
86
86
  if (isDisabled(date)) return;
87
87
  var newDate = _util.default.toDate(date);
88
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
88
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, noClose);
89
89
  setCurrent(newDate);
90
90
  };
91
91
  var isInRange = function isInRange(date) {
@@ -11,8 +11,8 @@ declare const useYear: (props: UseYearProps) => {
11
11
  isNow: (date: Date) => boolean;
12
12
  isDisabled: (date: Date) => boolean;
13
13
  isActive: (date: Date) => boolean;
14
- isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
15
- handleYearClick: (date: Date) => void;
14
+ isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
15
+ handleYearClick: (date: Date, noClose?: boolean) => void;
16
16
  getYearStr: (date: Date) => number;
17
17
  };
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-year.d.ts","sourceRoot":"","sources":["use-year.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAW/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;sBAsBb,IAAI;2BA8BC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;gCAPE,IAAI;2BAJT,IAAI;;CA4C/B,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-year.d.ts","sourceRoot":"","sources":["use-year.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAW/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;sBAsBb,IAAI;2BA8BC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;gCAPE,IAAI,YAAY,OAAO;2BAJ5B,IAAI;;CA4C/B,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -80,11 +80,11 @@ var useYear = function useYear(props) {
80
80
  var getYearStr = function getYearStr(date) {
81
81
  return _util.default.getDateInfo(date, 'year', options);
82
82
  };
83
- var handleYearClick = function handleYearClick(date) {
83
+ var handleYearClick = function handleYearClick(date, noClose) {
84
84
  var _props$onChange;
85
85
  if (isDisabled(date)) return;
86
86
  var newDate = _util.default.toDate(date);
87
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
87
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, noClose);
88
88
  setCurrent(newDate);
89
89
  };
90
90
  var isInRange = function isInRange(date) {
@@ -4,7 +4,7 @@ export interface UseYearProps {
4
4
  defaultCurrent?: Date;
5
5
  onCurrentChange?: (date: Date) => void;
6
6
  value?: Date;
7
- onChange?: (date: Date) => void;
7
+ onChange?: (date: Date, noClose?: boolean) => void;
8
8
  min?: Date;
9
9
  max?: Date;
10
10
  disabled?: boolean | ((date: Date) => boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"use-year.type.d.ts","sourceRoot":"","sources":["use-year.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IAEX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
1
+ {"version":3,"file":"use-year.type.d.ts","sourceRoot":"","sources":["use-year.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IAEX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
@@ -36,7 +36,7 @@ declare function setTime(date: Date, old: Date, options?: DateOptions): Date;
36
36
  declare function cloneTime(date: Date, old: DateTimeType, fmt?: string, options?: DateOptions): Date;
37
37
  declare function formatDateWithDefaultTime(date: Date, value: Date | undefined, defaultTime: Date | undefined, fmt: string, options: DateOptions): string | Date;
38
38
  declare function clearHMS(date: Date, options: DateOptions): Date;
39
- declare function compareDateArray(arr1: Date[], arr2: Date[], type: string | undefined, options: DateOptions): boolean;
39
+ declare function compareDateArray(arr1: Date[], arr2: Date[], type: string | undefined, options: DateOptions, fmt?: string): boolean;
40
40
  declare function resetTimeByFormat(value: Date | undefined, fo: string, options: DateOptions): Date | null;
41
41
  declare function formatted(date: Date, fmt: string | ((date: Date, offsetDate: Date) => string), options: DateOptions): string;
42
42
  declare function getStartYear(date: Date, options: DateOptions): number;
@@ -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,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C,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,WAAW,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,CACvB,IAAI,EAAE,IAAI,EAAE,EACZ,IAAI,EAAE,IAAI,EAAE,EACZ,IAAI,oBAAS,EACb,OAAO,EAAE,WAAW,EACpB,GAAG,CAAC,EAAE,MAAM,WASb;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"}
@@ -327,11 +327,12 @@ function clearHMS(date, options) {
327
327
  function compareDateArray(arr1, arr2) {
328
328
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'date';
329
329
  var options = arguments.length > 3 ? arguments[3] : undefined;
330
+ var fmt = arguments.length > 4 ? arguments[4] : undefined;
330
331
  if (!arr1 || !arr2 || arr1.length !== arr2.length) return false;
331
332
  return arr1.every(function (v, i) {
332
333
  if (!v || !arr2[i]) return false;
333
334
  if (type === 'week') return format(v, 'gggg ww', options) === format(arr2[i], 'gggg ww', options);
334
- return v.getTime() === arr2[i].getTime();
335
+ return toDateWithFormat(v, fmt).getTime() === toDateWithFormat(arr2[i], fmt).getTime();
335
336
  });
336
337
  }
337
338
  function getFormat(fo) {
@@ -192,11 +192,11 @@ function useFormControl(props) {
192
192
  if (inForm && controlFunc) {
193
193
  if ((0, _is.isArray)(name)) {
194
194
  name.forEach(function (n) {
195
- controlFunc.unbind(n, reserveAble);
195
+ controlFunc.unbind(n, reserveAble, validateFiled, update);
196
196
  updateError(n, undefined);
197
197
  });
198
198
  } else {
199
- controlFunc.unbind(name, reserveAble);
199
+ controlFunc.unbind(name, reserveAble, validateFiled, update);
200
200
  updateError(name, undefined);
201
201
  }
202
202
  }
@@ -1 +1 @@
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;;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