@sheinx/hooks 3.0.0-alpha.21 → 3.0.0-alpha.23

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.
@@ -1,11 +1,12 @@
1
1
  interface ListPaginationProps {
2
2
  data: any[];
3
3
  current: number | undefined;
4
- pageSize?: number | undefined;
4
+ pageSize: number | undefined;
5
5
  defaultCurrent: number | undefined;
6
6
  onChange: ((current: number, pageSize: number) => void) | undefined;
7
7
  shouldPage: boolean;
8
8
  loading: boolean;
9
+ total: number | undefined;
9
10
  }
10
11
  declare const usePaginationList: (props: ListPaginationProps) => {
11
12
  data: any[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,iBAAiB,UAAW,mBAAmB;;;;;;;;;;;;;wBAKP,MAAM,YAAY,MAAM;CAmCrE,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,iBAAiB,UAAW,mBAAmB;;;;;;;;;;;;;wBAKP,MAAM,YAAY,MAAM;CAmCrE,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -33,8 +33,9 @@ var usePaginationList = function usePaginationList(props) {
33
33
  if (props.onChange) props.onChange(current, pageSize);
34
34
  });
35
35
  var getPager = function getPager(data) {
36
+ var _props$total;
36
37
  if (!shouldPage) return {};
37
- var total = Array.isArray(data) ? data.length : 0;
38
+ var total = (_props$total = props.total) !== null && _props$total !== void 0 ? _props$total : Array.isArray(data) ? data.length : 0;
38
39
  return {
39
40
  current: props.current || current,
40
41
  pageSize: props.pageSize || pageSize,
@@ -12,7 +12,7 @@ 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 | "end" | "start" | "start-end" | "in";
15
+ isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
16
16
  isCurrentMonth: (date: Date) => boolean;
17
17
  handleDayClick: (date: Date) => void;
18
18
  getDayStr: (date: Date) => number;
@@ -9,7 +9,7 @@ declare const useMonth: (props: UseMonthProps) => {
9
9
  isNow: (date: Date) => boolean;
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
- isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
12
+ isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
13
13
  handleMonthClick: (date: Date) => void;
14
14
  getMonthStr: (date: Date) => number;
15
15
  };
@@ -9,7 +9,7 @@ declare const useQuarter: (props: UseMonthProps) => {
9
9
  isNow: (date: Date) => boolean;
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
- isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
12
+ isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
13
13
  handleQuarterClick: (date: Date) => void;
14
14
  getQuarterStr: (date: Date) => number;
15
15
  };
@@ -11,7 +11,7 @@ declare const useYear: (props: UseYearProps) => {
11
11
  isNow: (date: Date) => boolean;
12
12
  isDisabled: (date: Date) => boolean;
13
13
  isActive: (date: Date) => boolean;
14
- isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
14
+ isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
15
15
  handleYearClick: (date: Date) => void;
16
16
  getYearStr: (date: Date) => number;
17
17
  };
@@ -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: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "checkbox" | "radio" | "hidden" | "month" | "week" | "date" | "datetime-local" | "file" | "password" | undefined;
8
+ type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "month" | "week" | "date" | "hidden" | "checkbox" | "datetime-local" | "file" | "password" | "radio" | 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: (string & {}) | "search" | "color" | "button" | "time" | "image" | "text" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "checkbox" | "radio" | "hidden" | "date" | "datetime-local" | "file" | "month" | "password" | "week" | undefined;
10
+ type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "month" | "week" | "date" | "hidden" | "checkbox" | "datetime-local" | "file" | "password" | "radio" | undefined;
11
11
  };
12
12
  export default useNumberFormat;
13
13
  //# sourceMappingURL=use-input-number.d.ts.map
@@ -1,11 +1,12 @@
1
1
  interface ListPaginationProps {
2
2
  data: any[];
3
3
  current: number | undefined;
4
- pageSize?: number | undefined;
4
+ pageSize: number | undefined;
5
5
  defaultCurrent: number | undefined;
6
6
  onChange: ((current: number, pageSize: number) => void) | undefined;
7
7
  shouldPage: boolean;
8
8
  loading: boolean;
9
+ total: number | undefined;
9
10
  }
10
11
  declare const usePaginationList: (props: ListPaginationProps) => {
11
12
  data: any[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,iBAAiB,UAAW,mBAAmB;;;;;;;;;;;;;wBAKP,MAAM,YAAY,MAAM;CAmCrE,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,iBAAiB,UAAW,mBAAmB;;;;;;;;;;;;;wBAKP,MAAM,YAAY,MAAM;CAmCrE,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -33,8 +33,9 @@ var usePaginationList = function usePaginationList(props) {
33
33
  if (props.onChange) props.onChange(current, pageSize);
34
34
  });
35
35
  var getPager = function getPager(data) {
36
+ var _props$total;
36
37
  if (!shouldPage) return {};
37
- var total = Array.isArray(data) ? data.length : 0;
38
+ var total = (_props$total = props.total) !== null && _props$total !== void 0 ? _props$total : Array.isArray(data) ? data.length : 0;
38
39
  return {
39
40
  current: props.current || current,
40
41
  pageSize: props.pageSize || pageSize,
@@ -12,7 +12,7 @@ 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 | "end" | "start" | "start-end" | "in";
15
+ isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
16
16
  isCurrentMonth: (date: Date) => boolean;
17
17
  handleDayClick: (date: Date) => void;
18
18
  getDayStr: (date: Date) => number;
@@ -9,7 +9,7 @@ declare const useMonth: (props: UseMonthProps) => {
9
9
  isNow: (date: Date) => boolean;
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
- isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
12
+ isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
13
13
  handleMonthClick: (date: Date) => void;
14
14
  getMonthStr: (date: Date) => number;
15
15
  };
@@ -9,7 +9,7 @@ declare const useQuarter: (props: UseMonthProps) => {
9
9
  isNow: (date: Date) => boolean;
10
10
  isDisabled: (date: Date) => boolean;
11
11
  isActive: (date: Date) => boolean;
12
- isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
12
+ isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
13
13
  handleQuarterClick: (date: Date) => void;
14
14
  getQuarterStr: (date: Date) => number;
15
15
  };
@@ -11,7 +11,7 @@ declare const useYear: (props: UseYearProps) => {
11
11
  isNow: (date: Date) => boolean;
12
12
  isDisabled: (date: Date) => boolean;
13
13
  isActive: (date: Date) => boolean;
14
- isInRange: (date: Date) => false | "end" | "start" | "start-end" | "in";
14
+ isInRange: (date: Date) => false | "start" | "end" | "start-end" | "in";
15
15
  handleYearClick: (date: Date) => void;
16
16
  getYearStr: (date: Date) => number;
17
17
  };
@@ -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: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "checkbox" | "radio" | "hidden" | "month" | "week" | "date" | "datetime-local" | "file" | "password" | undefined;
8
+ type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "month" | "week" | "date" | "hidden" | "checkbox" | "datetime-local" | "file" | "password" | "radio" | 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: (string & {}) | "search" | "color" | "button" | "time" | "image" | "text" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "checkbox" | "radio" | "hidden" | "date" | "datetime-local" | "file" | "month" | "password" | "week" | undefined;
10
+ type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "month" | "week" | "date" | "hidden" | "checkbox" | "datetime-local" | "file" | "password" | "radio" | undefined;
11
11
  };
12
12
  export default useNumberFormat;
13
13
  //# sourceMappingURL=use-input-number.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.0.0-alpha.21",
3
+ "version": "3.0.0-alpha.23",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "ISC",