@sheinx/hooks 3.8.8-beta.1 → 3.8.8-beta.3

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.
@@ -8,7 +8,7 @@ declare const useButton: (props?: BaseButtonProps) => {
8
8
  text?: boolean | undefined;
9
9
  outline?: boolean | undefined;
10
10
  type?: import("./use-button.type").ButtonType | undefined;
11
- size?: "small" | "default" | "large" | undefined;
11
+ size?: "small" | "large" | "default" | undefined;
12
12
  space?: boolean | undefined;
13
13
  shape?: import("./use-button.type").ButtonShape | undefined;
14
14
  buttonRef?: React.Ref<HTMLButtonElement> | undefined;
@@ -22,7 +22,7 @@ declare const useButton: (props?: BaseButtonProps) => {
22
22
  text?: boolean | undefined;
23
23
  outline?: boolean | undefined;
24
24
  type?: import("./use-button.type").ButtonType | undefined;
25
- size?: "small" | "default" | "large" | undefined;
25
+ size?: "small" | "large" | "default" | undefined;
26
26
  space?: boolean | undefined;
27
27
  shape?: import("./use-button.type").ButtonShape | undefined;
28
28
  buttonRef?: React.Ref<HTMLButtonElement> | undefined;
@@ -5,7 +5,7 @@ declare const useInputFormat: (props: InputFormatProps) => {
5
5
  onBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
6
6
  onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;
7
7
  value: string | undefined;
8
- type: "search" | (string & {}) | "color" | "button" | "time" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "hidden" | "checkbox" | "date" | "datetime-local" | "file" | "image" | "month" | "password" | "radio" | "text" | "week" | undefined;
8
+ type: "search" | (string & {}) | "color" | "button" | "time" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "hidden" | "image" | "checkbox" | "radio" | "text" | "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<HTMLInputElement, Element>) => void;
8
8
  onFocus: (e: React.FocusEvent<HTMLInputElement, Element>) => void;
9
9
  value: string | undefined;
10
- type: "search" | (string & {}) | "color" | "button" | "time" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "hidden" | "checkbox" | "date" | "datetime-local" | "file" | "image" | "month" | "password" | "radio" | "text" | "week" | undefined;
10
+ type: "search" | (string & {}) | "color" | "button" | "time" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "hidden" | "image" | "checkbox" | "radio" | "text" | "date" | "datetime-local" | "file" | "month" | "password" | "week" | undefined;
11
11
  };
12
12
  export default useNumberFormat;
13
13
  //# sourceMappingURL=use-input-number.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { MessageType } from './rule.type';
2
2
  declare const _default: ({ message }?: {
3
3
  message?: MessageType | undefined;
4
- }) => (regExp: string | RegExp, msg?: MessageType) => import("../..").ObjectType | null;
4
+ }) => (regExp: string | RegExp, msg?: MessageType) => import("@sheinx/base").ObjectType | null;
5
5
  export default _default;
6
6
  //# sourceMappingURL=regexp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"required.d.ts","sourceRoot":"","sources":["required.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,eAAO,MAAM,eAAe,UAAW,UAAU,WAGhD,CAAC;;;YAEM,WAAW;AADnB,wBASM"}
1
+ {"version":3,"file":"required.d.ts","sourceRoot":"","sources":["required.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,eAAO,MAAM,eAAe,UAAW,UAAU,WAGhD,CAAC;;;YAEM,WAAW;AADnB,wBASM"}
@@ -4,13 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.requiredMessage = exports.default = void 0;
7
+ var _base = require("@sheinx/base");
7
8
  var _object = require("../object");
9
+ var _string = require("../string");
8
10
  var options = {
9
11
  skipUndefined: true
10
12
  };
11
13
  var requiredMessage = exports.requiredMessage = function requiredMessage(props) {
12
14
  var type = props.type === 'array' ? 'array' : 'string';
13
- return "$rules.required.".concat(type);
15
+ return (0, _string.substitute)((0, _base.getLocale)(_base.config.locale, "rules.required.".concat(type)), props);
14
16
  };
15
17
  var _default = exports.default = function _default() {
16
18
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -8,7 +8,7 @@ declare const useButton: (props?: BaseButtonProps) => {
8
8
  text?: boolean | undefined;
9
9
  outline?: boolean | undefined;
10
10
  type?: import("./use-button.type").ButtonType | undefined;
11
- size?: "small" | "default" | "large" | undefined;
11
+ size?: "small" | "large" | "default" | undefined;
12
12
  space?: boolean | undefined;
13
13
  shape?: import("./use-button.type").ButtonShape | undefined;
14
14
  buttonRef?: React.Ref<HTMLButtonElement> | undefined;
@@ -22,7 +22,7 @@ declare const useButton: (props?: BaseButtonProps) => {
22
22
  text?: boolean | undefined;
23
23
  outline?: boolean | undefined;
24
24
  type?: import("./use-button.type").ButtonType | undefined;
25
- size?: "small" | "default" | "large" | undefined;
25
+ size?: "small" | "large" | "default" | undefined;
26
26
  space?: boolean | undefined;
27
27
  shape?: import("./use-button.type").ButtonShape | undefined;
28
28
  buttonRef?: React.Ref<HTMLButtonElement> | undefined;
@@ -5,7 +5,7 @@ declare const useInputFormat: (props: InputFormatProps) => {
5
5
  onBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
6
6
  onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;
7
7
  value: string | undefined;
8
- type: "search" | (string & {}) | "color" | "button" | "time" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "hidden" | "checkbox" | "date" | "datetime-local" | "file" | "image" | "month" | "password" | "radio" | "text" | "week" | undefined;
8
+ type: "search" | (string & {}) | "color" | "button" | "time" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "hidden" | "image" | "checkbox" | "radio" | "text" | "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<HTMLInputElement, Element>) => void;
8
8
  onFocus: (e: React.FocusEvent<HTMLInputElement, Element>) => void;
9
9
  value: string | undefined;
10
- type: "search" | (string & {}) | "color" | "button" | "time" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "hidden" | "checkbox" | "date" | "datetime-local" | "file" | "image" | "month" | "password" | "radio" | "text" | "week" | undefined;
10
+ type: "search" | (string & {}) | "color" | "button" | "time" | "reset" | "submit" | "email" | "url" | "range" | "tel" | "hidden" | "image" | "checkbox" | "radio" | "text" | "date" | "datetime-local" | "file" | "month" | "password" | "week" | undefined;
11
11
  };
12
12
  export default useNumberFormat;
13
13
  //# sourceMappingURL=use-input-number.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { MessageType } from './rule.type';
2
2
  declare const _default: ({ message }?: {
3
3
  message?: MessageType | undefined;
4
- }) => (regExp: string | RegExp, msg?: MessageType) => import("../..").ObjectType | null;
4
+ }) => (regExp: string | RegExp, msg?: MessageType) => import("@sheinx/base").ObjectType | null;
5
5
  export default _default;
6
6
  //# sourceMappingURL=regexp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"required.d.ts","sourceRoot":"","sources":["required.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,eAAO,MAAM,eAAe,UAAW,UAAU,WAGhD,CAAC;;;YAEM,WAAW;AADnB,wBASM"}
1
+ {"version":3,"file":"required.d.ts","sourceRoot":"","sources":["required.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,eAAO,MAAM,eAAe,UAAW,UAAU,WAGhD,CAAC;;;YAEM,WAAW;AADnB,wBASM"}
@@ -1,10 +1,12 @@
1
+ import { getLocale, config } from '@sheinx/base';
1
2
  import { deepMerge } from "../object";
3
+ import { substitute } from "../string";
2
4
  var options = {
3
5
  skipUndefined: true
4
6
  };
5
7
  export var requiredMessage = function requiredMessage(props) {
6
8
  var type = props.type === 'array' ? 'array' : 'string';
7
- return "$rules.required.".concat(type);
9
+ return substitute(getLocale(config.locale, "rules.required.".concat(type)), props);
8
10
  };
9
11
  export default (function () {
10
12
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.8.8-beta.1",
3
+ "version": "3.8.8-beta.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",