@sheinx/hooks 3.8.0-beta.45 → 3.8.0-beta.47

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 +1 @@
1
- {"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,yBAAyB,CAAC;AA4BnF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBA0JpC,CAAC,YAAY,GAAG,EAAE;;;;;EA4DrD"}
1
+ {"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,yBAAyB,CAAC;AA4BnF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBA4JpC,CAAC,YAAY,GAAG,EAAE;;;;;EA4DrD"}
@@ -105,7 +105,9 @@ function useFormControl(props) {
105
105
  var errors = arguments.length > 1 ? arguments[1] : undefined;
106
106
  var severErrors = arguments.length > 2 ? arguments[2] : undefined;
107
107
  if (!name) return;
108
- if ((0, _is.isArray)(name)) {
108
+ // 加入defaultValue的判断,让其只对 https://github.com/sheinsight/shineout-next/pull/742 的场景生效
109
+ // 如果不加入defaultValue的判断,会导致 8ea43144-36a5-403a-9147-59d54087a110 的问题
110
+ if ((0, _is.isArray)(name) && defaultValue !== undefined) {
109
111
  var _value = getValue(name, formValue);
110
112
  var _error = getError(name, errors, severErrors);
111
113
  if (_error !== errorState) {
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-number.d.ts","sourceRoot":"","sources":["use-input-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,QAAA,MAAM,eAAe,UAAW,gBAAgB;;;;;;;;CAwJ/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"use-input-number.d.ts","sourceRoot":"","sources":["use-input-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,QAAA,MAAM,eAAe,UAAW,gBAAgB;;;;;;;;CA0J/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -37,7 +37,8 @@ var useNumberFormat = function useNumberFormat(props) {
37
37
  _props$step = props.step,
38
38
  step = _props$step === void 0 ? 1 : _props$step,
39
39
  cancelBlurChange = props.cancelBlurChange,
40
- disabled = props.disabled;
40
+ disabled = props.disabled,
41
+ coin = props.coin;
41
42
  var getStringValue = function getStringValue(value) {
42
43
  if (value === undefined) return value;
43
44
  if (typeof value === 'number') {
@@ -156,6 +157,7 @@ var useNumberFormat = function useNumberFormat(props) {
156
157
  numType: numType,
157
158
  integerLimit: integerLimit,
158
159
  digits: digits,
160
+ coin: coin,
159
161
  onChange: onNumberChange,
160
162
  onBlur: onNumberBlur,
161
163
  onFocus: props.onFocus,
@@ -1,6 +1,6 @@
1
1
  import { InputFormatProps } from './use-input-format.type';
2
2
  export type NumberValue = string | number | undefined | null;
3
- export interface InputNumberProps extends Omit<InputFormatProps, 'value' | 'onChange' | 'autoFix' | 'trim' | 'coin' | 'type'> {
3
+ export interface InputNumberProps extends Omit<InputFormatProps, 'value' | 'onChange' | 'autoFix' | 'trim' | 'type'> {
4
4
  value: NumberValue;
5
5
  onChange: (value: NumberValue) => void | undefined;
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-number.type.d.ts","sourceRoot":"","sources":["use-input-number.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,WAAW,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use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,yBAAyB,CAAC;AA4BnF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBA0JpC,CAAC,YAAY,GAAG,EAAE;;;;;EA4DrD"}
1
+ {"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,yBAAyB,CAAC;AA4BnF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBA4JpC,CAAC,YAAY,GAAG,EAAE;;;;;EA4DrD"}
@@ -96,7 +96,9 @@ export default function useFormControl(props) {
96
96
  var errors = arguments.length > 1 ? arguments[1] : undefined;
97
97
  var severErrors = arguments.length > 2 ? arguments[2] : undefined;
98
98
  if (!name) return;
99
- if (isArray(name)) {
99
+ // 加入defaultValue的判断,让其只对 https://github.com/sheinsight/shineout-next/pull/742 的场景生效
100
+ // 如果不加入defaultValue的判断,会导致 8ea43144-36a5-403a-9147-59d54087a110 的问题
101
+ if (isArray(name) && defaultValue !== undefined) {
100
102
  var _value = getValue(name, formValue);
101
103
  var _error = getError(name, errors, severErrors);
102
104
  if (_error !== errorState) {
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-number.d.ts","sourceRoot":"","sources":["use-input-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,QAAA,MAAM,eAAe,UAAW,gBAAgB;;;;;;;;CAwJ/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"use-input-number.d.ts","sourceRoot":"","sources":["use-input-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,QAAA,MAAM,eAAe,UAAW,gBAAgB;;;;;;;;CA0J/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -28,7 +28,8 @@ var useNumberFormat = function useNumberFormat(props) {
28
28
  _props$step = props.step,
29
29
  step = _props$step === void 0 ? 1 : _props$step,
30
30
  cancelBlurChange = props.cancelBlurChange,
31
- disabled = props.disabled;
31
+ disabled = props.disabled,
32
+ coin = props.coin;
32
33
  var getStringValue = function getStringValue(value) {
33
34
  if (value === undefined) return value;
34
35
  if (typeof value === 'number') {
@@ -147,6 +148,7 @@ var useNumberFormat = function useNumberFormat(props) {
147
148
  numType: numType,
148
149
  integerLimit: integerLimit,
149
150
  digits: digits,
151
+ coin: coin,
150
152
  onChange: onNumberChange,
151
153
  onBlur: onNumberBlur,
152
154
  onFocus: props.onFocus,
@@ -1,6 +1,6 @@
1
1
  import { InputFormatProps } from './use-input-format.type';
2
2
  export type NumberValue = string | number | undefined | null;
3
- export interface InputNumberProps extends Omit<InputFormatProps, 'value' | 'onChange' | 'autoFix' | 'trim' | 'coin' | 'type'> {
3
+ export interface InputNumberProps extends Omit<InputFormatProps, 'value' | 'onChange' | 'autoFix' | 'trim' | 'type'> {
4
4
  value: NumberValue;
5
5
  onChange: (value: NumberValue) => void | undefined;
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-number.type.d.ts","sourceRoot":"","sources":["use-input-number.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3F,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,SAAS,CAAC;IACnD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
1
+ {"version":3,"file":"use-input-number.type.d.ts","sourceRoot":"","sources":["use-input-number.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAClF,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,SAAS,CAAC;IACnD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.8.0-beta.45",
3
+ "version": "3.8.0-beta.47",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",