@sheinx/base 3.5.7-beta.1 → 3.5.7-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.
- package/cjs/form/form-fieldset.d.ts.map +1 -1
- package/cjs/form/form-fieldset.js +6 -4
- package/cjs/form/form-footer-context.d.ts +1 -1
- package/cjs/form/form-footer-context.d.ts.map +1 -1
- package/cjs/form/form-footer-context.js +2 -0
- package/cjs/form/form.d.ts.map +1 -1
- package/cjs/form/form.js +9 -2
- package/esm/form/form-fieldset.d.ts.map +1 -1
- package/esm/form/form-fieldset.js +6 -4
- package/esm/form/form-footer-context.d.ts +1 -1
- package/esm/form/form-footer-context.d.ts.map +1 -1
- package/esm/form/form-footer-context.js +2 -0
- package/esm/form/form.d.ts.map +1 -1
- package/esm/form/form.js +9 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-fieldset.d.ts","sourceRoot":"","sources":["form-fieldset.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"form-fieldset.d.ts","sourceRoot":"","sources":["form-fieldset.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,QAAA,MAAM,YAAY,yCA6FjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -22,7 +22,9 @@ var FormFieldSet = function FormFieldSet(props) {
|
|
|
22
22
|
|
|
23
23
|
var formFunc = (0, _hooks.useFormFunc)();
|
|
24
24
|
var validateFieldSet = function validateFieldSet() {
|
|
25
|
-
formFunc === null || formFunc === void 0 || formFunc.validateFields(props.name
|
|
25
|
+
formFunc === null || formFunc === void 0 || formFunc.validateFields(props.name, {
|
|
26
|
+
ignoreChildren: true
|
|
27
|
+
}).catch(function (e) {
|
|
26
28
|
return e;
|
|
27
29
|
});
|
|
28
30
|
};
|
|
@@ -86,9 +88,9 @@ var FormFieldSet = function FormFieldSet(props) {
|
|
|
86
88
|
draft[i] = val;
|
|
87
89
|
});
|
|
88
90
|
_onChange(newValue);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
91
|
+
formFunc === null || formFunc === void 0 || formFunc.validateFieldset("".concat(name, "[").concat(i, "]"), {
|
|
92
|
+
ignoreChildren: (options === null || options === void 0 ? void 0 : options.validate) === false
|
|
93
|
+
});
|
|
92
94
|
},
|
|
93
95
|
onInsert: function onInsert(val) {
|
|
94
96
|
var oldValue = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
|
|
@@ -3,7 +3,7 @@ export interface FormFooterContextValue {
|
|
|
3
3
|
setFormStats: (disabled?: 'disabled' | 'pending') => void;
|
|
4
4
|
setFormInfo: (info: {
|
|
5
5
|
submit: () => void;
|
|
6
|
-
}) =>
|
|
6
|
+
}) => boolean;
|
|
7
7
|
deleteFormInfo: () => void;
|
|
8
8
|
formStats: 'disabled' | 'pending' | undefined;
|
|
9
9
|
func: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-footer-context.d.ts","sourceRoot":"","sources":["form-footer-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAEpF,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"form-footer-context.d.ts","sourceRoot":"","sources":["form-footer-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAEpF,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,OAAO,CAAC;IACvD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IAC9C,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,IAAI,CAAC;KACpB,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,8CAAqD,CAAC;AAEpF,eAAO,MAAM,kBAAkB,UAAW;IAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;CAAE,gBA6BtE,CAAC;AAEF,eAAO,MAAM,aAAa,qCAGzB,CAAC"}
|
|
@@ -32,7 +32,9 @@ var FormFooterProvider = exports.FormFooterProvider = function FormFooterProvide
|
|
|
32
32
|
if (!context.hasSubmit) {
|
|
33
33
|
context.submit = info.submit;
|
|
34
34
|
context.hasSubmit = true;
|
|
35
|
+
return true;
|
|
35
36
|
}
|
|
37
|
+
return false;
|
|
36
38
|
});
|
|
37
39
|
var deleteFormInfo = (0, _hooks.usePersistFn)(function () {
|
|
38
40
|
context.hasSubmit = false;
|
package/cjs/form/form.d.ts.map
CHANGED
|
@@ -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,
|
|
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,4DA0HT,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/cjs/form/form.js
CHANGED
|
@@ -85,6 +85,10 @@ var Form = function Form(props) {
|
|
|
85
85
|
props.setForm(formRefObj);
|
|
86
86
|
}
|
|
87
87
|
}, [formRefObj]);
|
|
88
|
+
var _React$useRef = _react.default.useRef({
|
|
89
|
+
bindindModalFormContextSuccess: false
|
|
90
|
+
}),
|
|
91
|
+
context = _React$useRef.current;
|
|
88
92
|
var handleFormModalInfo = function handleFormModalInfo() {
|
|
89
93
|
var status = undefined;
|
|
90
94
|
if (props.disabled) {
|
|
@@ -97,13 +101,16 @@ var Form = function Form(props) {
|
|
|
97
101
|
modalFormContext === null || modalFormContext === void 0 || modalFormContext.setFormStats(status);
|
|
98
102
|
}
|
|
99
103
|
if (props.onSubmit) {
|
|
100
|
-
modalFormContext === null || modalFormContext === void 0
|
|
104
|
+
var ok = modalFormContext === null || modalFormContext === void 0 ? void 0 : modalFormContext.setFormInfo(formRefObj);
|
|
105
|
+
context.bindindModalFormContextSuccess = !!ok;
|
|
101
106
|
}
|
|
102
107
|
};
|
|
103
108
|
(0, _react.useEffect)(function () {
|
|
104
109
|
handleFormModalInfo();
|
|
105
110
|
return function () {
|
|
106
|
-
|
|
111
|
+
if (context.bindindModalFormContextSuccess) {
|
|
112
|
+
modalFormContext === null || modalFormContext === void 0 || modalFormContext.deleteFormInfo();
|
|
113
|
+
}
|
|
107
114
|
};
|
|
108
115
|
}, [props.disabled, props.pending]);
|
|
109
116
|
var rootClass = (0, _classnames.default)([formClasses === null || formClasses === void 0 ? void 0 : formClasses.rootClass, formClasses === null || formClasses === void 0 ? void 0 : formClasses.wrapper, className, props.inline && (formClasses === null || formClasses === void 0 ? void 0 : formClasses.wrapperInline)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-fieldset.d.ts","sourceRoot":"","sources":["form-fieldset.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"form-fieldset.d.ts","sourceRoot":"","sources":["form-fieldset.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,QAAA,MAAM,YAAY,yCA6FjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -15,7 +15,9 @@ var FormFieldSet = function FormFieldSet(props) {
|
|
|
15
15
|
|
|
16
16
|
var formFunc = useFormFunc();
|
|
17
17
|
var validateFieldSet = function validateFieldSet() {
|
|
18
|
-
formFunc === null || formFunc === void 0 || formFunc.validateFields(props.name
|
|
18
|
+
formFunc === null || formFunc === void 0 || formFunc.validateFields(props.name, {
|
|
19
|
+
ignoreChildren: true
|
|
20
|
+
}).catch(function (e) {
|
|
19
21
|
return e;
|
|
20
22
|
});
|
|
21
23
|
};
|
|
@@ -79,9 +81,9 @@ var FormFieldSet = function FormFieldSet(props) {
|
|
|
79
81
|
draft[i] = val;
|
|
80
82
|
});
|
|
81
83
|
_onChange(newValue);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
84
|
+
formFunc === null || formFunc === void 0 || formFunc.validateFieldset("".concat(name, "[").concat(i, "]"), {
|
|
85
|
+
ignoreChildren: (options === null || options === void 0 ? void 0 : options.validate) === false
|
|
86
|
+
});
|
|
85
87
|
},
|
|
86
88
|
onInsert: function onInsert(val) {
|
|
87
89
|
var oldValue = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
|
|
@@ -3,7 +3,7 @@ export interface FormFooterContextValue {
|
|
|
3
3
|
setFormStats: (disabled?: 'disabled' | 'pending') => void;
|
|
4
4
|
setFormInfo: (info: {
|
|
5
5
|
submit: () => void;
|
|
6
|
-
}) =>
|
|
6
|
+
}) => boolean;
|
|
7
7
|
deleteFormInfo: () => void;
|
|
8
8
|
formStats: 'disabled' | 'pending' | undefined;
|
|
9
9
|
func: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-footer-context.d.ts","sourceRoot":"","sources":["form-footer-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAEpF,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"form-footer-context.d.ts","sourceRoot":"","sources":["form-footer-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAEpF,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,OAAO,CAAC;IACvD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IAC9C,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,IAAI,CAAC;KACpB,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,8CAAqD,CAAC;AAEpF,eAAO,MAAM,kBAAkB,UAAW;IAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;CAAE,gBA6BtE,CAAC;AAEF,eAAO,MAAM,aAAa,qCAGzB,CAAC"}
|
|
@@ -24,7 +24,9 @@ export var FormFooterProvider = function FormFooterProvider(props) {
|
|
|
24
24
|
if (!context.hasSubmit) {
|
|
25
25
|
context.submit = info.submit;
|
|
26
26
|
context.hasSubmit = true;
|
|
27
|
+
return true;
|
|
27
28
|
}
|
|
29
|
+
return false;
|
|
28
30
|
});
|
|
29
31
|
var deleteFormInfo = usePersistFn(function () {
|
|
30
32
|
context.hasSubmit = false;
|
package/esm/form/form.d.ts.map
CHANGED
|
@@ -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,
|
|
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,4DA0HT,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/esm/form/form.js
CHANGED
|
@@ -76,6 +76,10 @@ var Form = function Form(props) {
|
|
|
76
76
|
props.setForm(formRefObj);
|
|
77
77
|
}
|
|
78
78
|
}, [formRefObj]);
|
|
79
|
+
var _React$useRef = React.useRef({
|
|
80
|
+
bindindModalFormContextSuccess: false
|
|
81
|
+
}),
|
|
82
|
+
context = _React$useRef.current;
|
|
79
83
|
var handleFormModalInfo = function handleFormModalInfo() {
|
|
80
84
|
var status = undefined;
|
|
81
85
|
if (props.disabled) {
|
|
@@ -88,13 +92,16 @@ var Form = function Form(props) {
|
|
|
88
92
|
modalFormContext === null || modalFormContext === void 0 || modalFormContext.setFormStats(status);
|
|
89
93
|
}
|
|
90
94
|
if (props.onSubmit) {
|
|
91
|
-
modalFormContext === null || modalFormContext === void 0
|
|
95
|
+
var ok = modalFormContext === null || modalFormContext === void 0 ? void 0 : modalFormContext.setFormInfo(formRefObj);
|
|
96
|
+
context.bindindModalFormContextSuccess = !!ok;
|
|
92
97
|
}
|
|
93
98
|
};
|
|
94
99
|
useEffect(function () {
|
|
95
100
|
handleFormModalInfo();
|
|
96
101
|
return function () {
|
|
97
|
-
|
|
102
|
+
if (context.bindindModalFormContextSuccess) {
|
|
103
|
+
modalFormContext === null || modalFormContext === void 0 || modalFormContext.deleteFormInfo();
|
|
104
|
+
}
|
|
98
105
|
};
|
|
99
106
|
}, [props.disabled, props.pending]);
|
|
100
107
|
var rootClass = classNames([formClasses === null || formClasses === void 0 ? void 0 : formClasses.rootClass, formClasses === null || formClasses === void 0 ? void 0 : formClasses.wrapper, className, props.inline && (formClasses === null || formClasses === void 0 ? void 0 : formClasses.wrapperInline)]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheinx/base",
|
|
3
|
-
"version": "3.5.7-beta.
|
|
3
|
+
"version": "3.5.7-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.5.7-beta.
|
|
13
|
+
"@sheinx/hooks": "3.5.7-beta.3",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|