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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/cjs/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  2. package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  3. package/cjs/components/use-datepicker/use-datepicker-format.js +1 -1
  4. package/cjs/components/use-datepicker/use-month.d.ts +1 -1
  5. package/cjs/components/use-datepicker/use-month.d.ts.map +1 -1
  6. package/cjs/components/use-datepicker/use-month.js +2 -2
  7. package/cjs/components/use-datepicker/use-month.type.d.ts +1 -1
  8. package/cjs/components/use-datepicker/use-month.type.d.ts.map +1 -1
  9. package/cjs/components/use-datepicker/use-quarter.d.ts +1 -1
  10. package/cjs/components/use-datepicker/use-quarter.d.ts.map +1 -1
  11. package/cjs/components/use-datepicker/use-quarter.js +2 -2
  12. package/cjs/components/use-datepicker/use-year.d.ts +1 -1
  13. package/cjs/components/use-datepicker/use-year.d.ts.map +1 -1
  14. package/cjs/components/use-datepicker/use-year.js +2 -2
  15. package/cjs/components/use-datepicker/use-year.type.d.ts +1 -1
  16. package/cjs/components/use-datepicker/use-year.type.d.ts.map +1 -1
  17. package/esm/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  18. package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  19. package/esm/components/use-datepicker/use-datepicker-format.js +1 -1
  20. package/esm/components/use-datepicker/use-month.d.ts +1 -1
  21. package/esm/components/use-datepicker/use-month.d.ts.map +1 -1
  22. package/esm/components/use-datepicker/use-month.js +2 -2
  23. package/esm/components/use-datepicker/use-month.type.d.ts +1 -1
  24. package/esm/components/use-datepicker/use-month.type.d.ts.map +1 -1
  25. package/esm/components/use-datepicker/use-quarter.d.ts +1 -1
  26. package/esm/components/use-datepicker/use-quarter.d.ts.map +1 -1
  27. package/esm/components/use-datepicker/use-quarter.js +2 -2
  28. package/esm/components/use-datepicker/use-year.d.ts +1 -1
  29. package/esm/components/use-datepicker/use-year.d.ts.map +1 -1
  30. package/esm/components/use-datepicker/use-year.js +2 -2
  31. package/esm/components/use-datepicker/use-year.type.d.ts +1 -1
  32. package/esm/components/use-datepicker/use-year.type.d.ts.map +1 -1
  33. package/package.json +1 -1
@@ -16,7 +16,7 @@ declare const useDatePickerFormat: <Value extends DatePickerValueType>(props: Us
16
16
  finishEdit: () => void;
17
17
  setCurrentArr: React.Dispatch<React.SetStateAction<Date[]>>;
18
18
  setTargetArr: React.Dispatch<React.SetStateAction<(Date | undefined)[]>>;
19
- handleClear: (e: React.MouseEvent) => void;
19
+ handleClear: (e?: React.MouseEvent) => void;
20
20
  handleInputChange: (str: string, index: number) => void;
21
21
  registerModeDisabled: (position: 'start' | 'end' | undefined, mode: string, fn: (d: Date) => boolean) => void;
22
22
  setCurrentArrWithParams: (arg: React.SetStateAction<Date[]>, type: string, quick: {
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBA4Ic,gBAAgB;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"}
1
+ {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;0BA4Ie,gBAAgB;iCAgCT,MAAM,SAAS,MAAM;yCA/HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAQH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CA0KvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -215,7 +215,7 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
215
215
  var handleClear = (0, _usePersistFn.usePersistFn)(function (e) {
216
216
  var _props$onClear;
217
217
  if (!clearable) return;
218
- e.stopPropagation();
218
+ e === null || e === void 0 || e.stopPropagation();
219
219
  if (disabledStatus === 'all') return;
220
220
  if (edit) {
221
221
  if (range) {
@@ -10,7 +10,7 @@ declare const useMonth: (props: UseMonthProps) => {
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
12
  isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
13
- handleMonthClick: (date: Date) => void;
13
+ handleMonthClick: (date: Date, onClose?: boolean) => void;
14
14
  getMonthStr: (date: Date) => number;
15
15
  };
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-month.d.ts","sourceRoot":"","sources":["use-month.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,QAAQ,UAAW,aAAa;;;;;;;sBAuBf,IAAI;2BAkCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;iCAPG,IAAI;4BAJT,IAAI;;CAwChC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-month.d.ts","sourceRoot":"","sources":["use-month.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,QAAQ,UAAW,aAAa;;;;;;;sBAuBf,IAAI;2BAkCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;iCAPG,IAAI,YAAW,OAAO;4BAJ3B,IAAI;;CAwChC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -82,11 +82,11 @@ var useMonth = function useMonth(props) {
82
82
  var getMonthStr = function getMonthStr(date) {
83
83
  return _util.default.getDateInfo(date, 'month', options) + 1;
84
84
  };
85
- var handleMonthClick = function handleMonthClick(date) {
85
+ var handleMonthClick = function handleMonthClick(date, onClose) {
86
86
  var _props$onChange;
87
87
  if (isDisabled(date)) return;
88
88
  var newDate = _util.default.toDate(date);
89
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
89
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, onClose);
90
90
  setCurrent(newDate);
91
91
  };
92
92
  var isInRange = function isInRange(date) {
@@ -4,7 +4,7 @@ export interface UseMonthProps {
4
4
  defaultCurrent?: Date;
5
5
  onCurrentChange?: (date: Date) => void;
6
6
  value?: Date;
7
- onChange?: (date: Date) => void;
7
+ onChange?: (date: Date, onClose?: boolean) => void;
8
8
  min?: Date;
9
9
  max?: Date;
10
10
  disabled?: boolean | ((date: Date) => boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"use-month.type.d.ts","sourceRoot":"","sources":["use-month.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
1
+ {"version":3,"file":"use-month.type.d.ts","sourceRoot":"","sources":["use-month.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
@@ -10,7 +10,7 @@ declare const useQuarter: (props: UseMonthProps) => {
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
12
  isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
13
- handleQuarterClick: (date: Date) => void;
13
+ handleQuarterClick: (date: Date, noClose?: boolean) => void;
14
14
  getQuarterStr: (date: Date) => number;
15
15
  };
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-quarter.d.ts","sourceRoot":"","sources":["use-quarter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,UAAU,UAAW,aAAa;;;;;;;sBAuBjB,IAAI;2BAiCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;mCAPK,IAAI;8BAJT,IAAI;;CAwClC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"use-quarter.d.ts","sourceRoot":"","sources":["use-quarter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,UAAU,UAAW,aAAa;;;;;;;sBAuBjB,IAAI;2BAiCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;mCAPK,IAAI,YAAY,OAAO;8BAJ5B,IAAI;;CAwClC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -81,11 +81,11 @@ var useQuarter = function useQuarter(props) {
81
81
  var getQuarterStr = function getQuarterStr(date) {
82
82
  return _util.default.getDateInfo(date, 'quarter', options);
83
83
  };
84
- var handleQuarterClick = function handleQuarterClick(date) {
84
+ var handleQuarterClick = function handleQuarterClick(date, noClose) {
85
85
  var _props$onChange;
86
86
  if (isDisabled(date)) return;
87
87
  var newDate = _util.default.toDate(date);
88
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
88
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, noClose);
89
89
  setCurrent(newDate);
90
90
  };
91
91
  var isInRange = function isInRange(date) {
@@ -12,7 +12,7 @@ declare const useYear: (props: UseYearProps) => {
12
12
  isDisabled: (date: Date) => boolean;
13
13
  isActive: (date: Date) => boolean;
14
14
  isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
15
- handleYearClick: (date: Date) => void;
15
+ handleYearClick: (date: Date, noClose?: boolean) => void;
16
16
  getYearStr: (date: Date) => number;
17
17
  };
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-year.d.ts","sourceRoot":"","sources":["use-year.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAW/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;sBAsBb,IAAI;2BA8BC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;gCAPE,IAAI;2BAJT,IAAI;;CA4C/B,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-year.d.ts","sourceRoot":"","sources":["use-year.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAW/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;sBAsBb,IAAI;2BA8BC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;gCAPE,IAAI,YAAY,OAAO;2BAJ5B,IAAI;;CA4C/B,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -80,11 +80,11 @@ var useYear = function useYear(props) {
80
80
  var getYearStr = function getYearStr(date) {
81
81
  return _util.default.getDateInfo(date, 'year', options);
82
82
  };
83
- var handleYearClick = function handleYearClick(date) {
83
+ var handleYearClick = function handleYearClick(date, noClose) {
84
84
  var _props$onChange;
85
85
  if (isDisabled(date)) return;
86
86
  var newDate = _util.default.toDate(date);
87
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate);
87
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newDate, noClose);
88
88
  setCurrent(newDate);
89
89
  };
90
90
  var isInRange = function isInRange(date) {
@@ -4,7 +4,7 @@ export interface UseYearProps {
4
4
  defaultCurrent?: Date;
5
5
  onCurrentChange?: (date: Date) => void;
6
6
  value?: Date;
7
- onChange?: (date: Date) => void;
7
+ onChange?: (date: Date, noClose?: boolean) => void;
8
8
  min?: Date;
9
9
  max?: Date;
10
10
  disabled?: boolean | ((date: Date) => boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"use-year.type.d.ts","sourceRoot":"","sources":["use-year.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IAEX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
1
+ {"version":3,"file":"use-year.type.d.ts","sourceRoot":"","sources":["use-year.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IAEX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
@@ -16,7 +16,7 @@ declare const useDatePickerFormat: <Value extends DatePickerValueType>(props: Us
16
16
  finishEdit: () => void;
17
17
  setCurrentArr: React.Dispatch<React.SetStateAction<Date[]>>;
18
18
  setTargetArr: React.Dispatch<React.SetStateAction<(Date | undefined)[]>>;
19
- handleClear: (e: React.MouseEvent) => void;
19
+ handleClear: (e?: React.MouseEvent) => void;
20
20
  handleInputChange: (str: string, index: number) => void;
21
21
  registerModeDisabled: (position: 'start' | 'end' | undefined, mode: string, fn: (d: Date) => boolean) => void;
22
22
  setCurrentArrWithParams: (arg: React.SetStateAction<Date[]>, type: string, quick: {
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBA4Ic,gBAAgB;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"}
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) {
@@ -10,7 +10,7 @@ declare const useMonth: (props: UseMonthProps) => {
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
12
  isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
13
- handleMonthClick: (date: Date) => void;
13
+ handleMonthClick: (date: Date, onClose?: boolean) => void;
14
14
  getMonthStr: (date: Date) => number;
15
15
  };
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-month.d.ts","sourceRoot":"","sources":["use-month.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,QAAQ,UAAW,aAAa;;;;;;;sBAuBf,IAAI;2BAkCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;iCAPG,IAAI;4BAJT,IAAI;;CAwChC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-month.d.ts","sourceRoot":"","sources":["use-month.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,QAAQ,UAAW,aAAa;;;;;;;sBAuBf,IAAI;2BAkCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;iCAPG,IAAI,YAAW,OAAO;4BAJ3B,IAAI;;CAwChC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -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;IAChC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
1
+ {"version":3,"file":"use-month.type.d.ts","sourceRoot":"","sources":["use-month.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
@@ -10,7 +10,7 @@ declare const useQuarter: (props: UseMonthProps) => {
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
12
  isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
13
- handleQuarterClick: (date: Date) => void;
13
+ handleQuarterClick: (date: Date, noClose?: boolean) => void;
14
14
  getQuarterStr: (date: Date) => number;
15
15
  };
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-quarter.d.ts","sourceRoot":"","sources":["use-quarter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,UAAU,UAAW,aAAa;;;;;;;sBAuBjB,IAAI;2BAiCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;mCAPK,IAAI;8BAJT,IAAI;;CAwClC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"use-quarter.d.ts","sourceRoot":"","sources":["use-quarter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAajD,QAAA,MAAM,UAAU,UAAW,aAAa;;;;;;;sBAuBjB,IAAI;2BAiCC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;mCAPK,IAAI,YAAY,OAAO;8BAJ5B,IAAI;;CAwClC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -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) {
@@ -12,7 +12,7 @@ declare const useYear: (props: UseYearProps) => {
12
12
  isDisabled: (date: Date) => boolean;
13
13
  isActive: (date: Date) => boolean;
14
14
  isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
15
- handleYearClick: (date: Date) => void;
15
+ handleYearClick: (date: Date, noClose?: boolean) => void;
16
16
  getYearStr: (date: Date) => number;
17
17
  };
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-year.d.ts","sourceRoot":"","sources":["use-year.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAW/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;sBAsBb,IAAI;2BA8BC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;gCAPE,IAAI;2BAJT,IAAI;;CA4C/B,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-year.d.ts","sourceRoot":"","sources":["use-year.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAW/C,QAAA,MAAM,OAAO,UAAW,YAAY;;;;;;;;;sBAsBb,IAAI;2BA8BC,IAAI;yBAQN,IAAI;0BAgBH,IAAI;gCAPE,IAAI,YAAY,OAAO;2BAJ5B,IAAI;;CA4C/B,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -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;IAChC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IAEX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
1
+ {"version":3,"file":"use-year.type.d.ts","sourceRoot":"","sources":["use-year.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IAEX,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.4.0-beta.5",
3
+ "version": "3.4.0-beta.7",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",