@sheinx/hooks 3.4.0-beta.4 → 3.4.0-beta.5

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 (67) hide show
  1. package/cjs/common/use-position-style/index.d.ts +4 -1
  2. package/cjs/common/use-position-style/index.d.ts.map +1 -1
  3. package/cjs/common/use-position-style/index.js +98 -11
  4. package/cjs/components/use-datepicker/use-date.d.ts +2 -2
  5. package/cjs/components/use-datepicker/use-date.d.ts.map +1 -1
  6. package/cjs/components/use-datepicker/use-date.js +2 -2
  7. package/cjs/components/use-datepicker/use-date.type.d.ts +1 -1
  8. package/cjs/components/use-datepicker/use-date.type.d.ts.map +1 -1
  9. package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  10. package/cjs/components/use-datepicker/use-datepicker-format.js +3 -1
  11. package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts +1 -0
  12. package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
  13. package/cjs/components/use-datepicker/use-month.d.ts +1 -1
  14. package/cjs/components/use-datepicker/use-quarter.d.ts +1 -1
  15. package/cjs/components/use-datepicker/use-year.d.ts +1 -1
  16. package/cjs/components/use-datepicker/util.d.ts +1 -1
  17. package/cjs/components/use-datepicker/util.d.ts.map +1 -1
  18. package/cjs/components/use-datepicker/util.js +2 -1
  19. package/cjs/components/use-form/use-form-control/use-form-control.js +2 -2
  20. package/cjs/components/use-form/use-form.d.ts.map +1 -1
  21. package/cjs/components/use-form/use-form.js +40 -19
  22. package/cjs/components/use-form/use-form.type.d.ts +11 -6
  23. package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
  24. package/cjs/components/use-input/use-input-format.d.ts +1 -1
  25. package/cjs/components/use-input/use-input-number.d.ts +1 -1
  26. package/cjs/components/use-popup/use-popup.d.ts +1 -0
  27. package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
  28. package/cjs/components/use-popup/use-popup.js +7 -4
  29. package/cjs/components/use-table/use-table-virtual.d.ts.map +1 -1
  30. package/cjs/components/use-table/use-table-virtual.js +28 -3
  31. package/cjs/utils/position.d.ts +1 -1
  32. package/cjs/utils/position.d.ts.map +1 -1
  33. package/cjs/utils/position.js +20 -5
  34. package/esm/common/use-position-style/index.d.ts +4 -1
  35. package/esm/common/use-position-style/index.d.ts.map +1 -1
  36. package/esm/common/use-position-style/index.js +99 -12
  37. package/esm/components/use-datepicker/use-date.d.ts +2 -2
  38. package/esm/components/use-datepicker/use-date.d.ts.map +1 -1
  39. package/esm/components/use-datepicker/use-date.js +2 -2
  40. package/esm/components/use-datepicker/use-date.type.d.ts +1 -1
  41. package/esm/components/use-datepicker/use-date.type.d.ts.map +1 -1
  42. package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  43. package/esm/components/use-datepicker/use-datepicker-format.js +3 -1
  44. package/esm/components/use-datepicker/use-datepicker-format.type.d.ts +1 -0
  45. package/esm/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
  46. package/esm/components/use-datepicker/use-month.d.ts +1 -1
  47. package/esm/components/use-datepicker/use-quarter.d.ts +1 -1
  48. package/esm/components/use-datepicker/use-year.d.ts +1 -1
  49. package/esm/components/use-datepicker/util.d.ts +1 -1
  50. package/esm/components/use-datepicker/util.d.ts.map +1 -1
  51. package/esm/components/use-datepicker/util.js +2 -1
  52. package/esm/components/use-form/use-form-control/use-form-control.js +2 -2
  53. package/esm/components/use-form/use-form.d.ts.map +1 -1
  54. package/esm/components/use-form/use-form.js +40 -19
  55. package/esm/components/use-form/use-form.type.d.ts +11 -6
  56. package/esm/components/use-form/use-form.type.d.ts.map +1 -1
  57. package/esm/components/use-input/use-input-format.d.ts +1 -1
  58. package/esm/components/use-input/use-input-number.d.ts +1 -1
  59. package/esm/components/use-popup/use-popup.d.ts +1 -0
  60. package/esm/components/use-popup/use-popup.d.ts.map +1 -1
  61. package/esm/components/use-popup/use-popup.js +7 -4
  62. package/esm/components/use-table/use-table-virtual.d.ts.map +1 -1
  63. package/esm/components/use-table/use-table-virtual.js +28 -3
  64. package/esm/utils/position.d.ts +1 -1
  65. package/esm/utils/position.d.ts.map +1 -1
  66. package/esm/utils/position.js +20 -5
  67. package/package.json +1 -1
@@ -7,7 +7,7 @@ declare const useNumberFormat: (props: InputNumberProps) => {
7
7
  onBlur: (e: React.FocusEvent<Element, Element>) => void;
8
8
  onFocus: (e: React.FocusEvent<Element, Element>) => void;
9
9
  value: string | undefined;
10
- type: "search" | "color" | "button" | "time" | "image" | "text" | "reset" | "submit" | "email" | "url" | "range" | "tel" | (string & {}) | "hidden" | "checkbox" | "date" | "datetime-local" | "file" | "month" | "password" | "radio" | "week" | undefined;
10
+ type: "search" | "color" | "button" | "time" | "image" | "text" | "reset" | "submit" | "email" | "url" | "range" | "tel" | (string & {}) | "checkbox" | "radio" | "hidden" | "date" | "datetime-local" | "file" | "month" | "password" | "week" | undefined;
11
11
  };
12
12
  export default useNumberFormat;
13
13
  //# sourceMappingURL=use-input-number.d.ts.map
@@ -5,6 +5,7 @@ declare const usePopup: (props: BasePopupProps) => {
5
5
  position: PositionType;
6
6
  targetRef: React.MutableRefObject<HTMLDivElement | null>;
7
7
  popupRef: React.MutableRefObject<HTMLDivElement | null>;
8
+ arrowRef: React.MutableRefObject<HTMLSpanElement | null>;
8
9
  getTargetProps: () => {
9
10
  onMouseEnter: (e: {
10
11
  target: EventTarget | null;
@@ -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;AAMhE,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;;0BAoHK;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,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMhE,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;;;0BA2HK;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;;CAsBpE,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -37,6 +37,7 @@ var usePopup = function usePopup(props) {
37
37
  removeChild = _useContext.removeChild;
38
38
  var targetRef = (0, _react.useRef)(null);
39
39
  var popupRef = (0, _react.useRef)(null);
40
+ var arrowRef = (0, _react.useRef)(null);
40
41
  (0, _react.useEffect)(function () {
41
42
  bindChild(popupRef);
42
43
  return function () {
@@ -68,11 +69,12 @@ var usePopup = function usePopup(props) {
68
69
  setPositionState = _useState4[1];
69
70
  var position = isPositionControl ? props.position : positionState;
70
71
  var updatePosition = (0, _usePersistFn.default)(function () {
71
- if (isPositionControl) return;
72
- if (props.position === 'auto' || !props.position) {
73
- var newPosition = (0, _position.getPosition)(targetRef.current, props.priorityDirection, autoMode);
72
+ // if (isPositionControl) return;
73
+ // if (props.position === 'auto' || !props.position) {
74
+ setTimeout(function () {
75
+ var newPosition = (0, _position.getPosition)(targetRef.current, props.priorityDirection, autoMode, popupRef.current || undefined);
74
76
  if (newPosition !== position) setPositionState(newPosition);
75
- }
77
+ }, 10);
76
78
  });
77
79
  (0, _react.useEffect)(function () {
78
80
  if (props.open) {
@@ -201,6 +203,7 @@ var usePopup = function usePopup(props) {
201
203
  position: position,
202
204
  targetRef: targetRef,
203
205
  popupRef: popupRef,
206
+ arrowRef: arrowRef,
204
207
  getTargetProps: getTargetProps,
205
208
  openPop: openPop,
206
209
  closePop: closePop,
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-virtual.d.ts","sourceRoot":"","sources":["use-table-virtual.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;CACnC;AACD,QAAA,MAAM,eAAe,UAAW,oBAAoB;;;;;;;oBAiLpC,MAAM;mBACP,MAAM;WACd,MAAM;gBACD,MAAM;kBACJ,OAAO;;0BAnFuB,MAAM,UAAU,MAAM;0BAxBtB,MAAM,QAAQ,MAAM;2BA+InB,MAAM;CAmElD,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"use-table-virtual.d.ts","sourceRoot":"","sources":["use-table-virtual.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;CACnC;AACD,QAAA,MAAM,eAAe,UAAW,oBAAoB;;;;;;;oBAsLpC,MAAM;mBACP,MAAM;WACd,MAAM;gBACD,MAAM;kBACJ,OAAO;;0BAtFuB,MAAM,UAAU,MAAM;0BAxBtB,MAAM,QAAQ,MAAM;2BAkJnB,MAAM;CAwFlD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -16,6 +16,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
16
16
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
17
17
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
18
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+ var MAX_ROW_SPAN = 200;
19
20
  var useTableVirtual = function useTableVirtual(props) {
20
21
  var _useState = (0, _react.useState)(0),
21
22
  _useState2 = _slicedToArray(_useState, 2),
@@ -98,7 +99,9 @@ var useTableVirtual = function useTableVirtual(props) {
98
99
  topTimer: null,
99
100
  controlScrollRate: null,
100
101
  heightCallback: null,
101
- preIndex: null
102
+ preIndex: null,
103
+ rowSpanRows: 0,
104
+ autoAddRows: 0
102
105
  }),
103
106
  context = _useRef.current;
104
107
  var getTranslate = (0, _usePersistFn.usePersistFn)(function (left, top) {
@@ -149,17 +152,20 @@ var useTableVirtual = function useTableVirtual(props) {
149
152
  var top = 0;
150
153
  var maxIndex = Math.max(props.data.length - rowsInView, 0);
151
154
  for (var i = 0; i <= maxIndex; i++) {
155
+ context.rowSpanRows = 0;
152
156
  sum += context.cachedHeight[i] || props.rowHeight;
153
157
  var rowSpanHeight = 0;
154
158
  if (rowSpanInfos) {
159
+ var maxRowSpanLenth = Math.min(rowSpanInfos.length, props.rowsInView > MAX_ROW_SPAN ? props.rowsInView : props.rowsInView || MAX_ROW_SPAN);
155
160
  var siblingsIndexs = [];
156
- for (var k = 0; k < rowSpanInfos.length; k++) {
161
+ for (var k = 0; k < maxRowSpanLenth; k++) {
157
162
  if (rowSpanInfos[k] <= i && k > i) {
158
163
  siblingsIndexs.push(k);
159
164
  }
160
165
  }
161
166
  for (var j = 0; j < siblingsIndexs.length; j++) {
162
167
  var index = siblingsIndexs[j];
168
+ context.rowSpanRows += 1;
163
169
  rowSpanHeight += context.cachedHeight[index] || props.rowHeight;
164
170
  }
165
171
  }
@@ -250,6 +256,24 @@ var useTableVirtual = function useTableVirtual(props) {
250
256
  props.scrollRef.current.scrollTop = beforeHeight;
251
257
  }
252
258
  });
259
+ (0, _react.useEffect)(function () {
260
+ var scrollRefHeight = props.scrollRef.current ? props.scrollRef.current.clientHeight : 0;
261
+ var tableRefHeight = props.innerRef.current ? props.innerRef.current.clientHeight : 0;
262
+ var remainHeight = scrollRefHeight - tableRefHeight;
263
+ if (remainHeight > 0) {
264
+ var addonHeight = 0;
265
+ var addonCount = 0;
266
+ for (var i = startIndex + rowsInView; i < props.data.length; i++) {
267
+ var height = context.cachedHeight[i] || props.rowHeight;
268
+ addonHeight += height;
269
+ addonCount += 1;
270
+ if (addonHeight >= remainHeight + context.cachedHeight[0]) break;
271
+ }
272
+ if (addonCount > 0) {
273
+ context.autoAddRows = addonCount;
274
+ }
275
+ }
276
+ }, []);
253
277
  (0, _react.useEffect)(function () {
254
278
  // 记录preIndex
255
279
  context.preIndex = startIndex;
@@ -284,7 +308,8 @@ var useTableVirtual = function useTableVirtual(props) {
284
308
  cb();
285
309
  }
286
310
  }, [scrollHeight]);
287
- var renderData = props.disabled ? props.data : _toConsumableArray(props.data).slice(startIndex, startIndex + rowsInView);
311
+ var finalRowsInView = rowsInView + context.rowSpanRows + context.autoAddRows;
312
+ var renderData = props.disabled ? props.data : _toConsumableArray(props.data).slice(startIndex, startIndex + finalRowsInView);
288
313
  return {
289
314
  scrollHeight: scrollHeight,
290
315
  startIndex: startIndex,
@@ -1,2 +1,2 @@
1
- export declare const getPosition: (target: HTMLElement | null, priorityDirection: "vertical" | "horizontal" | "auto" | undefined, mode: 'popover' | 'menu' | 'list') => "bottom" | "left" | "right" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom" | "right-top" | "right-bottom";
1
+ export declare const getPosition: (target: HTMLElement | null, priorityDirection: "vertical" | "horizontal" | "auto" | undefined, mode: 'popover' | 'menu' | 'list', popup?: HTMLElement) => "bottom" | "left" | "right" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom" | "right-top" | "right-bottom";
2
2
  //# sourceMappingURL=position.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":"AAgFA,eAAO,MAAM,WAAW,WACd,WAAW,GAAG,IAAI,2EAEpB,SAAS,GAAG,MAAM,GAAG,MAAM,gKAKlC,CAAC"}
1
+ {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":"AAiGA,eAAO,MAAM,WAAW,WACd,WAAW,GAAG,IAAI,2EAEpB,SAAS,GAAG,MAAM,GAAG,MAAM,UACzB,WAAW,gKAKpB,CAAC"}
@@ -41,6 +41,7 @@ var getMenuPosition = function getMenuPosition(target) {
41
41
  };
42
42
  var getPopoverPosition = function getPopoverPosition(target) {
43
43
  var priorityDirection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'vertical';
44
+ var popup = arguments.length > 2 ? arguments[2] : undefined;
44
45
  var position = 'bottom-left';
45
46
  if (!target) return position;
46
47
  var rect = target.getBoundingClientRect();
@@ -62,11 +63,24 @@ var getPopoverPosition = function getPopoverPosition(target) {
62
63
  position += '-top';
63
64
  }
64
65
  } else {
66
+ var popupRect = popup === null || popup === void 0 ? void 0 : popup.getBoundingClientRect();
65
67
  if (verticalPoint > windowHeight / 2) position = 'top';else position = 'bottom';
66
- if (horizontalPoint > windowWidth * 0.6) {
67
- position += '-right';
68
- } else if (horizontalPoint < windowWidth * 0.4) {
69
- position += '-left';
68
+
69
+ // 如果渲染了弹出内容,则根据弹出内容宽度计算是否自动调整位置
70
+ if (popupRect) {
71
+ if ((popupRect === null || popupRect === void 0 ? void 0 : popupRect.width) / 2 > rect.left) {
72
+ position += '-left';
73
+ }
74
+ if ((popupRect === null || popupRect === void 0 ? void 0 : popupRect.width) / 2 > windowWidth - rect.right) {
75
+ position += '-right';
76
+ }
77
+ } else {
78
+ // 兜底计算
79
+ if (horizontalPoint > windowWidth * 0.6) {
80
+ position += '-right';
81
+ } else if (horizontalPoint < windowWidth * 0.4) {
82
+ position += '-left';
83
+ }
70
84
  }
71
85
  }
72
86
  return position;
@@ -74,7 +88,8 @@ var getPopoverPosition = function getPopoverPosition(target) {
74
88
  var getPosition = exports.getPosition = function getPosition(target) {
75
89
  var priorityDirection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'vertical';
76
90
  var mode = arguments.length > 2 ? arguments[2] : undefined;
77
- if (mode === 'popover') return getPopoverPosition(target, priorityDirection);
91
+ var popup = arguments.length > 3 ? arguments[3] : undefined;
92
+ if (mode === 'popover') return getPopoverPosition(target, priorityDirection, popup);
78
93
  if (mode === 'menu') return getMenuPosition(target, priorityDirection);
79
94
  return 'bottom-left';
80
95
  };
@@ -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,GAC1B,aAAa,GACb,UAAU,GACV,cAAc,GACd,WAAW,GACX,MAAM,GACN,OAAO,CAAC;AACZ,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,KAAK,GACL,QAAQ,CAAC;AAYb,KAAK,YAAY,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;IAC3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AAS,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"}
@@ -9,7 +9,7 @@ import React, { useEffect, useState } from 'react';
9
9
  import { getPositionStyle } from "./get-position-style";
10
10
  import shallowEqual from "../../utils/shallow-equal";
11
11
  import usePersistFn from "../use-persist-fn";
12
- import { docSize } from "../../utils";
12
+ import { docSize, isChromeLowerThan } from "../../utils";
13
13
  var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top', 'left', 'right'];
14
14
  var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
15
15
  var hideStyle = {
@@ -39,6 +39,10 @@ export var usePositionStyle = function usePositionStyle(config) {
39
39
  _useState2 = _slicedToArray(_useState, 2),
40
40
  style = _useState2[0],
41
41
  setStyle = _useState2[1];
42
+ var _useState3 = useState({}),
43
+ _useState4 = _slicedToArray(_useState3, 2),
44
+ arrayStyle = _useState4[0],
45
+ setArrayStyle = _useState4[1];
42
46
  var _React$useRef = React.useRef({
43
47
  element: null,
44
48
  containerRect: {
@@ -112,10 +116,12 @@ export var usePositionStyle = function usePositionStyle(config) {
112
116
  };
113
117
  };
114
118
  var getAbsolutePositionStyle = function getAbsolutePositionStyle(rect, position) {
119
+ var _popupElRef$current;
115
120
  var style = {
116
121
  position: 'absolute',
117
122
  zIndex: zIndex
118
123
  };
124
+ var arrayStyle = {};
119
125
  if (fixedWidth) {
120
126
  var widthKey = fixedWidth === 'min' ? 'minWidth' : 'width';
121
127
  style[widthKey] = rect.width;
@@ -125,6 +131,7 @@ export var usePositionStyle = function usePositionStyle(config) {
125
131
  var containerRect = rootContainer.getBoundingClientRect();
126
132
  var bodyRect = (document.documentElement || document.body).getBoundingClientRect();
127
133
  var containerScrollBarWidth = rootContainer.offsetWidth - rootContainer.clientWidth;
134
+ var targetRect = (_popupElRef$current = popupElRef.current) === null || _popupElRef$current === void 0 ? void 0 : _popupElRef$current.getBoundingClientRect();
128
135
  var containerScroll = {
129
136
  left: rootContainer.scrollLeft,
130
137
  top: rootContainer.scrollTop
@@ -141,14 +148,25 @@ export var usePositionStyle = function usePositionStyle(config) {
141
148
  if (h === 'left') {
142
149
  style.left = rect.left - containerRect.left + containerScroll.left;
143
150
  style.transform = '';
151
+ arrayStyle.left = "8px";
144
152
  if (adjust) {
145
153
  overRight = rect.left + context.popUpWidth - bodyRect.right + containerScrollBarWidth;
154
+ if (style.left < 0 && targetRect) {
155
+ style.left = 'auto';
156
+ }
146
157
  }
147
158
  } else if (h === 'right') {
148
159
  style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left;
149
160
  style.left = 'auto';
150
161
  style.transform = '';
151
- if (adjust) overLeft = bodyRect.left - (rect.right - context.popUpWidth);
162
+ arrayStyle.right = "8px";
163
+ if (adjust) {
164
+ overLeft = bodyRect.left - (rect.right - context.popUpWidth);
165
+ if (style.right < 0 && targetRect) {
166
+ style.left = bodyRect.width - targetRect.width;
167
+ style.right = 'auto';
168
+ }
169
+ }
152
170
  } else {
153
171
  // 居中对齐
154
172
  style.left = rect.left + rect.width / 2 - containerRect.left + containerScroll.left;
@@ -157,6 +175,9 @@ export var usePositionStyle = function usePositionStyle(config) {
157
175
  overRight = rect.left + rect.width / 2 + context.popUpWidth / 2 - bodyRect.width + containerScrollBarWidth;
158
176
  overLeft = bodyRect.left - (rect.left + rect.width / 2 - context.popUpWidth / 2);
159
177
  }
178
+ if (targetRect) {
179
+ arrayStyle.left = "".concat(targetRect.width / 2 - 5.9, "px");
180
+ }
160
181
  }
161
182
  if (adjust) {
162
183
  // 调节左右溢出
@@ -165,16 +186,26 @@ export var usePositionStyle = function usePositionStyle(config) {
165
186
  style.left -= overRight;
166
187
  // 扣除触发器距离页面右侧的距离,以保证从右侧弹出的窗口最右边对齐触发器最右边
167
188
  style.left -= toRightDistance;
189
+ if (targetRect) {
190
+ arrayStyle.left = "".concat((targetRect === null || targetRect === void 0 ? void 0 : targetRect.width) - context.parentRect.width / 2 - 5.9, "px");
191
+ }
168
192
  }
169
193
  if (overLeft > 0) {
170
194
  style.left += overLeft;
195
+ arrayStyle.left = "".concat(rect.width / 2 - 5.9, "px");
171
196
  }
172
197
  }
173
198
  if (v === 'bottom') {
174
199
  style.top = rect.bottom - containerRect.top + containerScroll.top + popupGap;
200
+ if (targetRect) {
201
+ arrayStyle.top = "".concat(0, "px");
202
+ }
175
203
  } else {
176
204
  style.top = rect.top - containerRect.top + containerScroll.top - popupGap;
177
205
  style.transform += 'translateY(-100%)';
206
+ if (targetRect) {
207
+ arrayStyle.top = "".concat(targetRect.height - 5.9 - 4, "px");
208
+ }
178
209
  }
179
210
  } else if (horizontalPosition.includes(targetPosition)) {
180
211
  var _targetPosition$split3 = targetPosition.split('-'),
@@ -184,45 +215,88 @@ export var usePositionStyle = function usePositionStyle(config) {
184
215
  if (_v === 'top') {
185
216
  style.top = rect.top - containerRect.top + containerScroll.top;
186
217
  style.transform = '';
218
+ arrayStyle.top = "8px";
187
219
  } else if (_v === 'bottom') {
188
220
  style.top = rect.bottom - containerRect.top + containerScroll.top;
221
+ arrayStyle.bottom = "8px";
189
222
  style.transform = 'translateY(-100%)';
190
223
  } else {
191
224
  // 居中对齐
192
225
  style.top = rect.top - containerRect.top + containerScroll.top + rect.height / 2;
226
+ if (targetRect) {
227
+ arrayStyle.top = "".concat(targetRect.height / 2 - 5.9 / 2, "px");
228
+ }
193
229
  style.transform = 'translateY(-50%)';
194
230
  }
195
231
  if (_h === 'right') {
196
232
  style.left = rect.right - containerRect.left + containerScroll.left + popupGap;
197
233
  } else {
198
234
  style.left = rect.left - containerRect.left + containerScroll.left - popupGap;
235
+ arrayStyle.right = "0px";
199
236
  style.transform += ' translateX(-100%)';
200
237
  }
201
238
  } else if (position === 'cover') {
202
239
  style.top = rect.top - containerRect.top + containerScroll.top;
203
240
  style.left = rect.left - containerRect.left + containerScroll.left;
204
241
  }
205
- return style;
242
+ return {
243
+ style: style,
244
+ arrayStyle: arrayStyle
245
+ };
206
246
  };
207
247
  var getAbsoluteStyle = function getAbsoluteStyle(position) {
208
- if (!parentElRef.current) return hideStyle;
248
+ if (!parentElRef.current) return {
249
+ style: hideStyle
250
+ };
209
251
  var rect = context.parentRect;
210
252
  if (scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current) {
211
253
  var _scrollElRef$current;
212
254
  var visibleRect = ((_scrollElRef$current = scrollElRef.current) === null || _scrollElRef$current === void 0 ? void 0 : _scrollElRef$current.getBoundingClientRect()) || {};
213
255
  if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom || rect.right < visibleRect.left || rect.left > visibleRect.right) {
214
- return hideStyle;
256
+ return {
257
+ style: hideStyle
258
+ };
259
+ }
260
+ }
261
+ var _getAbsolutePositionS = getAbsolutePositionStyle(rect, position),
262
+ style = _getAbsolutePositionS.style,
263
+ arrayStyle = _getAbsolutePositionS.arrayStyle;
264
+
265
+ // TODO: 如果是版本大于chrome128,需要根据currentCSSZoom处理chrome的bug
266
+ if (!isChromeLowerThan(128)) {
267
+ // @ts-ignore currentCSSZoom
268
+ var currentCSSZoom = document.body.currentCSSZoom;
269
+ if (currentCSSZoom === 1 || !currentCSSZoom) return {
270
+ style: style,
271
+ arrayStyle: arrayStyle
272
+ };
273
+ if (style.left && typeof style.left === 'number') {
274
+ style.left = style.left * (1 / currentCSSZoom);
275
+ }
276
+ if (style.top && typeof style.top === 'number') {
277
+ style.top = style.top * (1 / currentCSSZoom);
278
+ }
279
+ if (style.right && typeof style.right === 'number') {
280
+ style.right = style.right * (1 / currentCSSZoom);
281
+ }
282
+ if (style.bottom && typeof style.bottom === 'number') {
283
+ style.bottom = style.bottom * (1 / currentCSSZoom);
215
284
  }
216
285
  }
217
- var style = getAbsolutePositionStyle(rect, position);
218
- return style;
286
+ return {
287
+ style: style,
288
+ arrayStyle: arrayStyle
289
+ };
219
290
  };
220
291
  var getStyle = function getStyle() {
221
292
  var newStyle = {};
293
+ var newArrayStyle = {};
222
294
  var _ref2 = config || {},
223
295
  position = _ref2.position,
224
296
  absolute = _ref2.absolute;
225
- if (!position || !show || !parentElRef.current) return style;
297
+ if (!position || !show || !parentElRef.current) return {
298
+ newStyle: style
299
+ };
226
300
  context.parentRect = parentElRef.current.getBoundingClientRect();
227
301
  if (adjust) {
228
302
  var popupInfo = getPopUpInfo(context.parentRect);
@@ -237,21 +311,34 @@ export var usePositionStyle = function usePositionStyle(config) {
237
311
  fixedWidth: fixedWidth
238
312
  });
239
313
  } else {
240
- newStyle = getAbsoluteStyle(realPosition);
314
+ var _ref3 = getAbsoluteStyle(realPosition),
315
+ nextStyle = _ref3.style,
316
+ nextArrayStyle = _ref3.arrayStyle;
317
+ newStyle = nextStyle;
318
+ newArrayStyle = nextArrayStyle;
241
319
  }
242
320
  // for animation
243
321
  if (realPosition.indexOf('top') === 0) {
244
322
  newStyle.transformOrigin = 'center bottom';
245
323
  }
246
- return newStyle;
324
+ return {
325
+ newStyle: newStyle,
326
+ newArrayStyle: newArrayStyle
327
+ };
247
328
  };
248
329
  var updateStyle = usePersistFn(function () {
249
- var newStyle = getStyle();
330
+ var _getStyle = getStyle(),
331
+ newStyle = _getStyle.newStyle,
332
+ newArrayStyle = _getStyle.newArrayStyle;
250
333
  if (newStyle && !shallowEqual(style, newStyle)) {
251
334
  setStyle(newStyle);
335
+ setArrayStyle(newArrayStyle || {});
252
336
  }
253
337
  });
254
338
  useEffect(updateStyle, [show, position, absolute, updateKey, fixedWidth]);
255
- return style;
339
+ return {
340
+ style: style,
341
+ arrayStyle: arrayStyle
342
+ };
256
343
  };
257
344
  export 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"}
@@ -95,11 +95,11 @@ var useDate = function useDate(props) {
95
95
  var getDateWithTime = function getDateWithTime(date) {
96
96
  return utils.getDateWithTime(date, props.value, props.defaultTime, props.min, props.max, options);
97
97
  };
98
- var handleDayClick = function handleDayClick(date) {
98
+ var handleDayClick = function handleDayClick(date, noClose) {
99
99
  var _props$onChange;
100
100
  if (isDisabled(date)) return;
101
101
  var newDate = getDateWithTime(date);
102
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
102
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, noClose);
103
103
  setCurrent(newDate);
104
104
  };
105
105
  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":"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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;;;;;;;;;;;;;;;;yBA4Ic,gBAAgB;iCAgCR,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"}
@@ -222,7 +222,7 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
222
222
  }
223
223
  } else {
224
224
  var _props$onChange;
225
- var emptyValue = props.clearWithUndefined ? undefined : '';
225
+ var emptyValue = props.clearWithUndefined || props.clearToUndefined ? undefined : '';
226
226
  var v = emptyValue;
227
227
  if (range) {
228
228
  v = [emptyValue, emptyValue];
@@ -231,6 +231,8 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
231
231
  v = [props.value[0], emptyValue];
232
232
  } else if (props.value[1] && disabledStatus === 'right') {
233
233
  v = [emptyValue, props.value[1]];
234
+ } else if (props.clearToUndefined) {
235
+ v = undefined;
234
236
  }
235
237
  }
236
238
  }
@@ -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,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,YAAY,EAAE,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAClG,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;AAC/E,MAAM,WAAW,wBAAwB,CAAC,KAAK,SAAS,mBAAmB;IACzE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3E,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;IAC5D,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,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,OA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,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,GAC1C,SAAS,CAAC;CACf"}
@@ -9,7 +9,7 @@ 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";
12
+ isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
13
13
  handleMonthClick: (date: Date) => void;
14
14
  getMonthStr: (date: Date) => number;
15
15
  };
@@ -9,7 +9,7 @@ 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";
12
+ isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
13
13
  handleQuarterClick: (date: Date) => void;
14
14
  getQuarterStr: (date: Date) => number;
15
15
  };
@@ -11,7 +11,7 @@ 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";
14
+ isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
15
15
  handleYearClick: (date: Date) => void;
16
16
  getYearStr: (date: Date) => number;
17
17
  };
@@ -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,IAAI,EAAE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AE,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"}
@@ -321,11 +321,12 @@ function clearHMS(date, options) {
321
321
  function compareDateArray(arr1, arr2) {
322
322
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'date';
323
323
  var options = arguments.length > 3 ? arguments[3] : undefined;
324
+ var fmt = arguments.length > 4 ? arguments[4] : undefined;
324
325
  if (!arr1 || !arr2 || arr1.length !== arr2.length) return false;
325
326
  return arr1.every(function (v, i) {
326
327
  if (!v || !arr2[i]) return false;
327
328
  if (type === 'week') return format(v, 'gggg ww', options) === format(arr2[i], 'gggg ww', options);
328
- return v.getTime() === arr2[i].getTime();
329
+ return toDateWithFormat(v, fmt).getTime() === toDateWithFormat(arr2[i], fmt).getTime();
329
330
  });
330
331
  }
331
332
  function getFormat(fo) {