@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.
- package/cjs/common/use-input-able/use-Input-able.js +2 -2
- package/cjs/common/use-position-style/index.d.ts +4 -1
- package/cjs/common/use-position-style/index.d.ts.map +1 -1
- package/cjs/common/use-position-style/index.js +98 -11
- package/cjs/components/use-datepicker/use-date.d.ts +2 -2
- package/cjs/components/use-datepicker/use-date.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-date.js +2 -2
- package/cjs/components/use-datepicker/use-date.type.d.ts +1 -1
- package/cjs/components/use-datepicker/use-date.type.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.d.ts +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.js +4 -2
- package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts +1 -0
- package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-month.d.ts +2 -2
- package/cjs/components/use-datepicker/use-month.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-month.js +2 -2
- package/cjs/components/use-datepicker/use-month.type.d.ts +1 -1
- package/cjs/components/use-datepicker/use-month.type.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-quarter.d.ts +2 -2
- package/cjs/components/use-datepicker/use-quarter.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-quarter.js +2 -2
- package/cjs/components/use-datepicker/use-year.d.ts +2 -2
- package/cjs/components/use-datepicker/use-year.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-year.js +2 -2
- package/cjs/components/use-datepicker/use-year.type.d.ts +1 -1
- package/cjs/components/use-datepicker/use-year.type.d.ts.map +1 -1
- package/cjs/components/use-datepicker/util.d.ts +1 -1
- package/cjs/components/use-datepicker/util.d.ts.map +1 -1
- package/cjs/components/use-datepicker/util.js +2 -1
- package/cjs/components/use-form/use-form-control/use-form-control.js +2 -2
- package/cjs/components/use-form/use-form.d.ts.map +1 -1
- package/cjs/components/use-form/use-form.js +40 -19
- package/cjs/components/use-form/use-form.type.d.ts +11 -6
- package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-format.d.ts +1 -1
- package/cjs/components/use-input/use-input-number.d.ts +1 -1
- package/cjs/components/use-input/use-input-number.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-number.js +37 -5
- package/cjs/components/use-popup/use-popup.d.ts +1 -0
- package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
- package/cjs/components/use-popup/use-popup.js +7 -4
- package/cjs/components/use-table/use-table-virtual.d.ts +1 -1
- package/cjs/components/use-table/use-table-virtual.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-virtual.js +34 -4
- package/cjs/components/use-transfer/use-transfer.d.ts +1 -1
- package/cjs/components/use-transfer/use-transfer.d.ts.map +1 -1
- package/cjs/components/use-transfer/use-transfer.js +8 -17
- package/cjs/utils/dom/element.js +1 -1
- package/cjs/utils/is.d.ts +1 -0
- package/cjs/utils/is.d.ts.map +1 -1
- package/cjs/utils/is.js +6 -1
- package/cjs/utils/position.d.ts +1 -1
- package/cjs/utils/position.d.ts.map +1 -1
- package/cjs/utils/position.js +20 -5
- package/esm/common/use-input-able/use-Input-able.js +2 -2
- package/esm/common/use-position-style/index.d.ts +4 -1
- package/esm/common/use-position-style/index.d.ts.map +1 -1
- package/esm/common/use-position-style/index.js +99 -12
- package/esm/components/use-datepicker/use-date.d.ts +2 -2
- package/esm/components/use-datepicker/use-date.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-date.js +2 -2
- package/esm/components/use-datepicker/use-date.type.d.ts +1 -1
- package/esm/components/use-datepicker/use-date.type.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.d.ts +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.js +4 -2
- package/esm/components/use-datepicker/use-datepicker-format.type.d.ts +1 -0
- package/esm/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-month.d.ts +2 -2
- package/esm/components/use-datepicker/use-month.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-month.js +2 -2
- package/esm/components/use-datepicker/use-month.type.d.ts +1 -1
- package/esm/components/use-datepicker/use-month.type.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-quarter.d.ts +2 -2
- package/esm/components/use-datepicker/use-quarter.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-quarter.js +2 -2
- package/esm/components/use-datepicker/use-year.d.ts +2 -2
- package/esm/components/use-datepicker/use-year.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-year.js +2 -2
- package/esm/components/use-datepicker/use-year.type.d.ts +1 -1
- package/esm/components/use-datepicker/use-year.type.d.ts.map +1 -1
- package/esm/components/use-datepicker/util.d.ts +1 -1
- package/esm/components/use-datepicker/util.d.ts.map +1 -1
- package/esm/components/use-datepicker/util.js +2 -1
- package/esm/components/use-form/use-form-control/use-form-control.js +2 -2
- package/esm/components/use-form/use-form.d.ts.map +1 -1
- package/esm/components/use-form/use-form.js +40 -19
- package/esm/components/use-form/use-form.type.d.ts +11 -6
- package/esm/components/use-form/use-form.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-format.d.ts +1 -1
- package/esm/components/use-input/use-input-number.d.ts +1 -1
- package/esm/components/use-input/use-input-number.d.ts.map +1 -1
- package/esm/components/use-input/use-input-number.js +34 -4
- package/esm/components/use-popup/use-popup.d.ts +1 -0
- package/esm/components/use-popup/use-popup.d.ts.map +1 -1
- package/esm/components/use-popup/use-popup.js +7 -4
- package/esm/components/use-table/use-table-virtual.d.ts +1 -1
- package/esm/components/use-table/use-table-virtual.d.ts.map +1 -1
- package/esm/components/use-table/use-table-virtual.js +34 -4
- package/esm/components/use-transfer/use-transfer.d.ts +1 -1
- package/esm/components/use-transfer/use-transfer.d.ts.map +1 -1
- package/esm/components/use-transfer/use-transfer.js +8 -17
- package/esm/utils/dom/element.js +1 -1
- package/esm/utils/is.d.ts +1 -0
- package/esm/utils/is.d.ts.map +1 -1
- package/esm/utils/is.js +3 -0
- package/esm/utils/position.d.ts +1 -1
- package/esm/utils/position.d.ts.map +1 -1
- package/esm/utils/position.js +20 -5
- package/package.json +1 -1
package/cjs/utils/position.js
CHANGED
@@ -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
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
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
|
-
|
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
|
};
|
@@ -43,10 +43,10 @@ export default function useInputAble(props) {
|
|
43
43
|
clearTimeout(context.timer);
|
44
44
|
context.timer = null;
|
45
45
|
}
|
46
|
-
if (delay && props.value !== stateValue) {
|
46
|
+
if (delay && control && props.value !== stateValue) {
|
47
47
|
changeStateValue(props.value);
|
48
48
|
}
|
49
|
-
}, [props.value, delay]);
|
49
|
+
}, [props.value, delay, control]);
|
50
50
|
var forceDelayChange = usePersistFn(function () {
|
51
51
|
if (context.timer && context.delayChange) {
|
52
52
|
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) =>
|
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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E,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"}
|
@@ -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
|
-
|
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
|
242
|
+
return {
|
243
|
+
style: style,
|
244
|
+
arrayStyle: arrayStyle
|
245
|
+
};
|
206
246
|
};
|
207
247
|
var getAbsoluteStyle = function getAbsoluteStyle(position) {
|
208
|
-
if (!parentElRef.current) return
|
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
|
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
|
-
|
218
|
-
|
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
|
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
|
-
|
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
|
324
|
+
return {
|
325
|
+
newStyle: newStyle,
|
326
|
+
newArrayStyle: newArrayStyle
|
327
|
+
};
|
247
328
|
};
|
248
329
|
var updateStyle = usePersistFn(function () {
|
249
|
-
var
|
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
|
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 | "
|
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;
|
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;
|
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
|
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;;;;;;;;;;;;;;;;
|
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"}
|
@@ -208,7 +208,7 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
|
|
208
208
|
var handleClear = usePersistFn(function (e) {
|
209
209
|
var _props$onClear;
|
210
210
|
if (!clearable) return;
|
211
|
-
e.stopPropagation();
|
211
|
+
e === null || e === void 0 || e.stopPropagation();
|
212
212
|
if (disabledStatus === 'all') return;
|
213
213
|
if (edit) {
|
214
214
|
if (range) {
|
@@ -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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,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 | "
|
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;
|
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"}
|
@@ -76,11 +76,11 @@ var useMonth = function useMonth(props) {
|
|
76
76
|
var getMonthStr = function getMonthStr(date) {
|
77
77
|
return utils.getDateInfo(date, 'month', options) + 1;
|
78
78
|
};
|
79
|
-
var handleMonthClick = function handleMonthClick(date) {
|
79
|
+
var handleMonthClick = function handleMonthClick(date, onClose) {
|
80
80
|
var _props$onChange;
|
81
81
|
if (isDisabled(date)) return;
|
82
82
|
var newDate = utils.toDate(date);
|
83
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
|
83
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, onClose);
|
84
84
|
setCurrent(newDate);
|
85
85
|
};
|
86
86
|
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;
|
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 | "
|
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;
|
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"}
|
@@ -75,11 +75,11 @@ var useQuarter = function useQuarter(props) {
|
|
75
75
|
var getQuarterStr = function getQuarterStr(date) {
|
76
76
|
return utils.getDateInfo(date, 'quarter', options);
|
77
77
|
};
|
78
|
-
var handleQuarterClick = function handleQuarterClick(date) {
|
78
|
+
var handleQuarterClick = function handleQuarterClick(date, noClose) {
|
79
79
|
var _props$onChange;
|
80
80
|
if (isDisabled(date)) return;
|
81
81
|
var newDate = utils.toDate(date);
|
82
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
|
82
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, noClose);
|
83
83
|
setCurrent(newDate);
|
84
84
|
};
|
85
85
|
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 | "
|
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;
|
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"}
|
@@ -74,11 +74,11 @@ var useYear = function useYear(props) {
|
|
74
74
|
var getYearStr = function getYearStr(date) {
|
75
75
|
return utils.getDateInfo(date, 'year', options);
|
76
76
|
};
|
77
|
-
var handleYearClick = function handleYearClick(date) {
|
77
|
+
var handleYearClick = function handleYearClick(date, noClose) {
|
78
78
|
var _props$onChange;
|
79
79
|
if (isDisabled(date)) return;
|
80
80
|
var newDate = utils.toDate(date);
|
81
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
|
81
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, noClose);
|
82
82
|
setCurrent(newDate);
|
83
83
|
};
|
84
84
|
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;
|
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,EAA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AI,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) {
|
@@ -183,11 +183,11 @@ export default function useFormControl(props) {
|
|
183
183
|
if (inForm && controlFunc) {
|
184
184
|
if (isArray(name)) {
|
185
185
|
name.forEach(function (n) {
|
186
|
-
controlFunc.unbind(n, reserveAble);
|
186
|
+
controlFunc.unbind(n, reserveAble, validateFiled, update);
|
187
187
|
updateError(n, undefined);
|
188
188
|
});
|
189
189
|
} else {
|
190
|
-
controlFunc.unbind(name, reserveAble);
|
190
|
+
controlFunc.unbind(name, reserveAble, validateFiled, update);
|
191
191
|
updateError(name, undefined);
|
192
192
|
}
|
193
193
|
}
|