@sheinx/base 3.6.5-beta.2 → 3.6.5-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.
@@ -1 +1 @@
1
- {"version":3,"file":"form-flow.d.ts","sourceRoot":"","sources":["form-flow.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoBrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"form-flow.d.ts","sourceRoot":"","sources":["form-flow.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAqBrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -8,6 +8,8 @@ var _react = require("react");
8
8
  var _hooks = require("@sheinx/hooks");
9
9
  var FormFlow = function FormFlow(props) {
10
10
  var _props$names;
11
+ var _props$strict = props.strict,
12
+ strict = _props$strict === void 0 ? true : _props$strict;
11
13
  var datum = (0, _hooks.useFormFlow)({
12
14
  names: props.names
13
15
  });
@@ -15,13 +17,13 @@ var FormFlow = function FormFlow(props) {
15
17
  return datum === null || datum === void 0 ? void 0 : datum.get(name);
16
18
  });
17
19
  var memoizedResult = (0, _react.useMemo)(function () {
18
- if (!props.strict) return null;
20
+ if (!strict) return null;
19
21
  if (_hooks.util.isFunc(props.children)) {
20
22
  return props.children(datum);
21
23
  }
22
24
  return props.children;
23
25
  }, [valueOfNames === null || valueOfNames === void 0 ? void 0 : valueOfNames.toString()]);
24
- if (props.strict) {
26
+ if (strict) {
25
27
  return memoizedResult;
26
28
  }
27
29
  if (_hooks.util.isFunc(props.children)) {
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["form.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,QAAA,MAAM,IAAI,wFA2HT,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["form.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,QAAA,MAAM,IAAI,wFA6HT,CAAC;AAEF,eAAe,IAAI,CAAC"}
package/cjs/form/form.js CHANGED
@@ -31,11 +31,12 @@ var Form = function Form(props) {
31
31
  rest = _objectWithoutProperties(props, _excluded);
32
32
  var formClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$form = jssStyle.form) === null || _jssStyle$form === void 0 ? void 0 : _jssStyle$form.call(jssStyle);
33
33
  var modalFormContext = (0, _formFooterContext.useFormFooter)();
34
+ var isControl = ('value' in props);
34
35
  var inputAbleParams = {
35
36
  value: props.value,
36
37
  onChange: props.onChange,
37
38
  defaultValue: props.defaultValue,
38
- control: 'value' in props,
39
+ control: isControl,
39
40
  beforeChange: undefined,
40
41
  reserveAble: false
41
42
  };
@@ -46,7 +47,8 @@ var Form = function Form(props) {
46
47
  var _useForm = (0, _hooks.useForm)(_objectSpread(_objectSpread({}, rest), {}, {
47
48
  value: value,
48
49
  onChange: onChange,
49
- formElRef: formElRef
50
+ formElRef: formElRef,
51
+ isControl: isControl
50
52
  })),
51
53
  Provider = _useForm.Provider,
52
54
  ProviderProps = _useForm.ProviderProps,
@@ -1 +1 @@
1
- {"version":3,"file":"form-flow.d.ts","sourceRoot":"","sources":["form-flow.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoBrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"form-flow.d.ts","sourceRoot":"","sources":["form-flow.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAqBrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -2,6 +2,8 @@ import { useMemo } from 'react';
2
2
  import { useFormFlow, util } from '@sheinx/hooks';
3
3
  var FormFlow = function FormFlow(props) {
4
4
  var _props$names;
5
+ var _props$strict = props.strict,
6
+ strict = _props$strict === void 0 ? true : _props$strict;
5
7
  var datum = useFormFlow({
6
8
  names: props.names
7
9
  });
@@ -9,13 +11,13 @@ var FormFlow = function FormFlow(props) {
9
11
  return datum === null || datum === void 0 ? void 0 : datum.get(name);
10
12
  });
11
13
  var memoizedResult = useMemo(function () {
12
- if (!props.strict) return null;
14
+ if (!strict) return null;
13
15
  if (util.isFunc(props.children)) {
14
16
  return props.children(datum);
15
17
  }
16
18
  return props.children;
17
19
  }, [valueOfNames === null || valueOfNames === void 0 ? void 0 : valueOfNames.toString()]);
18
- if (props.strict) {
20
+ if (strict) {
19
21
  return memoizedResult;
20
22
  }
21
23
  if (util.isFunc(props.children)) {
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["form.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,QAAA,MAAM,IAAI,wFA2HT,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["form.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,QAAA,MAAM,IAAI,wFA6HT,CAAC;AAEF,eAAe,IAAI,CAAC"}
package/esm/form/form.js CHANGED
@@ -22,11 +22,12 @@ var Form = function Form(props) {
22
22
  rest = _objectWithoutProperties(props, _excluded);
23
23
  var formClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$form = jssStyle.form) === null || _jssStyle$form === void 0 ? void 0 : _jssStyle$form.call(jssStyle);
24
24
  var modalFormContext = useFormFooter();
25
+ var isControl = ('value' in props);
25
26
  var inputAbleParams = {
26
27
  value: props.value,
27
28
  onChange: props.onChange,
28
29
  defaultValue: props.defaultValue,
29
- control: 'value' in props,
30
+ control: isControl,
30
31
  beforeChange: undefined,
31
32
  reserveAble: false
32
33
  };
@@ -37,7 +38,8 @@ var Form = function Form(props) {
37
38
  var _useForm = useForm(_objectSpread(_objectSpread({}, rest), {}, {
38
39
  value: value,
39
40
  onChange: onChange,
40
- formElRef: formElRef
41
+ formElRef: formElRef,
42
+ isControl: isControl
41
43
  })),
42
44
  Provider = _useForm.Provider,
43
45
  ProviderProps = _useForm.ProviderProps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.6.5-beta.2",
3
+ "version": "3.6.5-beta.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.6.5-beta.2",
13
+ "@sheinx/hooks": "3.6.5-beta.3",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"