@sheinx/hooks 3.4.0-beta.4 → 3.4.0-beta.6
Sign up to get free protection for your applications and to get access to all the features.
- 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-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.map +1 -1
- package/cjs/components/use-table/use-table-virtual.js +28 -3
- 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-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-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.map +1 -1
- package/esm/components/use-table/use-table-virtual.js +28 -3
- 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
@@ -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,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isabled: (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;
|
@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BAAS,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
|
}
|
@@ -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,
|
1
|
+
{"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["use-form.ts"],"names":[],"mappings":";AAyBA,OAAO,EAAe,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAwB,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI5D,QAAA,MAAM,OAAO;;;;;;;;;wBAuK8B;gBAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;aAAE;8BARzB,MAAM;oCAyDD,OAAO;;6BAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;oCAdrB,MAAM,EAAE;sCAvEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;qCAmI5D,MAAM;gCAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;gCAKpC,MAAM,SAAS,MAAM;;;;;;oBA5CpB;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE;0BARzB,MAAM;gCAyDD,OAAO;;yBAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;gCAdrB,MAAM,EAAE;kCAvEN,MAAM,GAAG,MAAM,EAAE,mBAAgB,QAAQ,IAAI,CAAC;iCAmI5D,MAAM;4BAzCE,MAAM,SAAS,MAAM,UAAU,KAAK;4BAKpC,MAAM,SAAS,MAAM;;CAoQ9D,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
@@ -65,8 +65,10 @@ var useForm = function useForm(props) {
|
|
65
65
|
var _context$flowMap$glob;
|
66
66
|
if (!name) {
|
67
67
|
Object.keys(context.updateMap).forEach(function (key) {
|
68
|
-
var _context$updateMap$ke
|
69
|
-
(_context$updateMap$ke =
|
68
|
+
var _context$updateMap$ke;
|
69
|
+
(_context$updateMap$ke = context.updateMap[key]) === null || _context$updateMap$ke === void 0 || _context$updateMap$ke.forEach(function (update) {
|
70
|
+
update(context.value, context.errors, context.serverErrors);
|
71
|
+
});
|
70
72
|
});
|
71
73
|
Object.keys(context.flowMap).forEach(function (key) {
|
72
74
|
context.flowMap[key].forEach(function (update) {
|
@@ -76,8 +78,10 @@ var useForm = function useForm(props) {
|
|
76
78
|
} else {
|
77
79
|
var names = isArray(name) ? name : [name];
|
78
80
|
names.forEach(function (key) {
|
79
|
-
var _context$updateMap$ke2, _context$
|
80
|
-
(_context$updateMap$ke2 =
|
81
|
+
var _context$updateMap$ke2, _context$flowMap$key;
|
82
|
+
(_context$updateMap$ke2 = context.updateMap[key]) === null || _context$updateMap$ke2 === void 0 || _context$updateMap$ke2.forEach(function (update) {
|
83
|
+
update(context.value, context.errors, context.serverErrors);
|
84
|
+
});
|
81
85
|
(_context$flowMap$key = context.flowMap[key]) === null || _context$flowMap$key === void 0 || _context$flowMap$key.forEach(function (update) {
|
82
86
|
update();
|
83
87
|
});
|
@@ -133,9 +137,11 @@ var useForm = function useForm(props) {
|
|
133
137
|
}) : Object.keys(context.validateMap);
|
134
138
|
var validates = files2.map(function (key) {
|
135
139
|
var validateField = context.validateMap[key];
|
136
|
-
return validateField(
|
140
|
+
return Array.from(validateField).map(function (validate) {
|
141
|
+
return validate(key, deepGet(context.value, key), context.value, config);
|
142
|
+
});
|
137
143
|
});
|
138
|
-
Promise.all(validates).then(function (results) {
|
144
|
+
Promise.all(validates.flat()).then(function (results) {
|
139
145
|
var error = results.find(function (n) {
|
140
146
|
return n !== true;
|
141
147
|
});
|
@@ -180,8 +186,10 @@ var useForm = function useForm(props) {
|
|
180
186
|
Object.keys(vals).forEach(function (key) {
|
181
187
|
deepSet(draft, key, vals[key], deepSetOptions);
|
182
188
|
if (option.validate) {
|
183
|
-
var _context$validateMap
|
184
|
-
(_context$validateMap$ =
|
189
|
+
var _context$validateMap$;
|
190
|
+
(_context$validateMap$ = context.validateMap[key]) === null || _context$validateMap$ === void 0 || _context$validateMap$.forEach(function (validate) {
|
191
|
+
validate(key, vals[key], current(draft));
|
192
|
+
});
|
185
193
|
}
|
186
194
|
});
|
187
195
|
});
|
@@ -325,12 +333,17 @@ var useForm = function useForm(props) {
|
|
325
333
|
var controlFunc = useLatestObj({
|
326
334
|
bind: function bind(n, df, validate, updateFn) {
|
327
335
|
if (context.names.has(n)) {
|
328
|
-
console.
|
329
|
-
return;
|
336
|
+
console.warn("name \"".concat(n, "\" already exist"));
|
330
337
|
}
|
331
338
|
context.names.add(n);
|
332
|
-
context.validateMap[n]
|
333
|
-
|
339
|
+
if (!context.validateMap[n]) {
|
340
|
+
context.validateMap[n] = new Set();
|
341
|
+
}
|
342
|
+
context.validateMap[n].add(validate);
|
343
|
+
if (!context.updateMap[n]) {
|
344
|
+
context.updateMap[n] = new Set();
|
345
|
+
}
|
346
|
+
context.updateMap[n].add(updateFn);
|
334
347
|
context.removeArr.delete(n);
|
335
348
|
if (df !== undefined && deepGet(context.value, n) === undefined) {
|
336
349
|
if (!context.mounted) context.defaultValues[n] = df;
|
@@ -340,11 +353,19 @@ var useForm = function useForm(props) {
|
|
340
353
|
}
|
341
354
|
update(n);
|
342
355
|
},
|
343
|
-
unbind: function unbind(n, reserveAble) {
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
356
|
+
unbind: function unbind(n, reserveAble, validateFiled, update) {
|
357
|
+
var validateFieldSet = context.validateMap[n];
|
358
|
+
if (validateFiled && validateFieldSet.has(validateFiled)) {
|
359
|
+
validateFieldSet.delete(validateFiled);
|
360
|
+
}
|
361
|
+
var updateFieldSet = context.updateMap[n];
|
362
|
+
if (update && updateFieldSet.has(update)) {
|
363
|
+
updateFieldSet.delete(update);
|
364
|
+
}
|
365
|
+
if (validateFieldSet.size === 0 && updateFieldSet.size === 0) {
|
366
|
+
context.names.delete(n);
|
367
|
+
delete context.defaultValues[n];
|
368
|
+
}
|
348
369
|
if (!reserveAble && !context.removeLock) {
|
349
370
|
addRemove(n);
|
350
371
|
}
|
@@ -419,12 +440,12 @@ var useForm = function useForm(props) {
|
|
419
440
|
React.useEffect(function () {
|
420
441
|
// 服务端错误更新
|
421
442
|
if (!props.error) context.serverErrors = {};else {
|
422
|
-
var
|
443
|
+
var errors = Object.keys(props.error).reduce(function (prev, cur) {
|
423
444
|
var item = props.error[cur];
|
424
445
|
var error = item instanceof Error ? item : new Error(item);
|
425
446
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, cur, error));
|
426
447
|
}, {});
|
427
|
-
context.serverErrors =
|
448
|
+
context.serverErrors = errors;
|
428
449
|
}
|
429
450
|
update();
|
430
451
|
}, [props.error]);
|
@@ -2,12 +2,15 @@
|
|
2
2
|
import { ReactNode } from 'react';
|
3
3
|
import { AddNoProps, ObjectType } from '../../common/type';
|
4
4
|
import { FormItemRule } from '../../utils/rule/rule.type';
|
5
|
+
import { FormError } from '../../utils';
|
6
|
+
export type ValidateFn = (name: string, value: any, formData: ObjectType, config?: {
|
7
|
+
ignoreBind?: boolean;
|
8
|
+
}) => Promise<boolean | FormError>;
|
9
|
+
export type UpdateFn = (formValue: ObjectType, errors: ObjectType<Error | undefined>, serverErrors: ObjectType<Error | undefined>) => void;
|
5
10
|
export interface FormContextValueType {
|
6
11
|
func?: {
|
7
|
-
unbind: (n: string, reserveAble?: boolean) => void;
|
8
|
-
bind: (n: string, df: any, validate:
|
9
|
-
ignoreBind?: boolean;
|
10
|
-
}) => void, update: (formValue: ObjectType, errors: ObjectType<Error>, serverErrors: ObjectType<Error>) => void) => void;
|
12
|
+
unbind: (n: string, reserveAble?: boolean, validate?: ValidateFn, update?: UpdateFn) => void;
|
13
|
+
bind: (n: string, df: any, validate: ValidateFn, update: UpdateFn) => void;
|
11
14
|
combineRules: <ValueItem>(name: string, propRules: FormItemRule<ValueItem>) => FormItemRule<ValueItem>;
|
12
15
|
watch: (names: string[] | undefined, update: () => void) => void;
|
13
16
|
unWatch: (names: string[] | undefined, update: () => void) => void;
|
@@ -149,7 +152,9 @@ export interface BaseFormProps<T> extends FormCommonConfig {
|
|
149
152
|
export type UseFormProps<T> = BaseFormProps<T>;
|
150
153
|
export type FormContext = {
|
151
154
|
defaultValues: ObjectType;
|
152
|
-
validateMap: ObjectType
|
155
|
+
validateMap: ObjectType<Set<(name: string, v: any, formValue: ObjectType, config?: {
|
156
|
+
ignoreBind?: boolean;
|
157
|
+
}) => Promise<boolean | FormError>>>;
|
153
158
|
removeArr: Set<string>;
|
154
159
|
removeTimer?: number | NodeJS.Timeout;
|
155
160
|
names: Set<string>;
|
@@ -157,7 +162,7 @@ export type FormContext = {
|
|
157
162
|
lastValue: ObjectType | undefined;
|
158
163
|
resetTime: number;
|
159
164
|
mounted: boolean;
|
160
|
-
updateMap: ObjectType
|
165
|
+
updateMap: ObjectType<Set<(formValue: ObjectType, errors: ObjectType<Error | undefined>, serverErrors: ObjectType<Error | undefined>) => void>>;
|
161
166
|
flowMap: ObjectType<Set<() => void>>;
|
162
167
|
value: ObjectType;
|
163
168
|
errors: ObjectType<Error | undefined>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-form.type.d.ts","sourceRoot":"","sources":["use-form.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
1
|
+
{"version":3,"file":"use-form.type.d.ts","sourceRoot":"","sources":["use-form.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,CACvB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,EACV,QAAQ,EAA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F,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,UAAU,CACzE,mBAAmB,EACnB,MAAM,CACP,CAAC"}
|
@@ -5,7 +5,7 @@ declare const useInputFormat: (props: InputFormatProps) => {
|
|
5
5
|
onBlur: (e: React.FocusEvent) => void;
|
6
6
|
onFocus: (e: React.FocusEvent) => void;
|
7
7
|
value: string | undefined;
|
8
|
-
type: "search" | "color" | "button" | "time" | "image" | "text" | "reset" | "submit" | "email" | "url" | "range" | "tel" | (string & {}) | "
|
8
|
+
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;
|
9
9
|
};
|
10
10
|
export default useInputFormat;
|
11
11
|
//# sourceMappingURL=use-input-format.d.ts.map
|
@@ -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 & {}) | "
|
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
|
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"}
|
@@ -30,6 +30,7 @@ var usePopup = function usePopup(props) {
|
|
30
30
|
removeChild = _useContext.removeChild;
|
31
31
|
var targetRef = useRef(null);
|
32
32
|
var popupRef = useRef(null);
|
33
|
+
var arrowRef = useRef(null);
|
33
34
|
useEffect(function () {
|
34
35
|
bindChild(popupRef);
|
35
36
|
return function () {
|
@@ -61,11 +62,12 @@ var usePopup = function usePopup(props) {
|
|
61
62
|
setPositionState = _useState4[1];
|
62
63
|
var position = isPositionControl ? props.position : positionState;
|
63
64
|
var updatePosition = usePersistFn(function () {
|
64
|
-
if (isPositionControl) return;
|
65
|
-
if (props.position === 'auto' || !props.position) {
|
66
|
-
|
65
|
+
// if (isPositionControl) return;
|
66
|
+
// if (props.position === 'auto' || !props.position) {
|
67
|
+
setTimeout(function () {
|
68
|
+
var newPosition = getPosition(targetRef.current, props.priorityDirection, autoMode, popupRef.current || undefined);
|
67
69
|
if (newPosition !== position) setPositionState(newPosition);
|
68
|
-
}
|
70
|
+
}, 10);
|
69
71
|
});
|
70
72
|
useEffect(function () {
|
71
73
|
if (props.open) {
|
@@ -194,6 +196,7 @@ var usePopup = function usePopup(props) {
|
|
194
196
|
position: position,
|
195
197
|
targetRef: targetRef,
|
196
198
|
popupRef: popupRef,
|
199
|
+
arrowRef: arrowRef,
|
197
200
|
getTargetProps: getTargetProps,
|
198
201
|
openPop: openPop,
|
199
202
|
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;
|
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"}
|