@faasjs/react 3.7.0-beta.8 → 3.7.0-beta.9
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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -451,7 +451,7 @@ type FormInputProps<FormElements extends FormElementTypes = FormElementTypes> =
|
|
|
451
451
|
type FormItemName = string;
|
|
452
452
|
type FormItemProps<FormElements extends FormElementTypes = FormElementTypes, FormRulesOptions extends Record<string, any> = FormDefaultRulesOptions> = {
|
|
453
453
|
name: FormItemName;
|
|
454
|
-
label?: Omit<FormLabelElementProps, 'name'> & {
|
|
454
|
+
label?: Omit<FormLabelElementProps, 'name' | 'children'> & {
|
|
455
455
|
Label?: ComponentType<FormLabelElementProps>;
|
|
456
456
|
};
|
|
457
457
|
input?: FormInputProps<FormElements>;
|
package/dist/index.d.ts
CHANGED
|
@@ -451,7 +451,7 @@ type FormInputProps<FormElements extends FormElementTypes = FormElementTypes> =
|
|
|
451
451
|
type FormItemName = string;
|
|
452
452
|
type FormItemProps<FormElements extends FormElementTypes = FormElementTypes, FormRulesOptions extends Record<string, any> = FormDefaultRulesOptions> = {
|
|
453
453
|
name: FormItemName;
|
|
454
|
-
label?: Omit<FormLabelElementProps, 'name'> & {
|
|
454
|
+
label?: Omit<FormLabelElementProps, 'name' | 'children'> & {
|
|
455
455
|
Label?: ComponentType<FormLabelElementProps>;
|
|
456
456
|
};
|
|
457
457
|
input?: FormInputProps<FormElements>;
|
package/dist/index.js
CHANGED
|
@@ -360,10 +360,10 @@ var FormContext = createSplittingContext([
|
|
|
360
360
|
var FormContextProvider = FormContext.Provider;
|
|
361
361
|
var useFormContext = FormContext.use;
|
|
362
362
|
function FormItem(props) {
|
|
363
|
-
const { Elements, values, setValues } = useFormContext();
|
|
363
|
+
const { Elements, values, setValues, errors } = useFormContext();
|
|
364
364
|
const Label = props.label?.Label ?? Elements.Label;
|
|
365
365
|
const Input = props.input?.Input ?? Elements.Input;
|
|
366
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Label, { name: props.name, ...props.label, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
366
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Label, { name: props.name, ...props.label, error: errors[props.name], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
367
367
|
Input,
|
|
368
368
|
{
|
|
369
369
|
name: props.name,
|
package/dist/index.mjs
CHANGED
|
@@ -358,10 +358,10 @@ var FormContext = createSplittingContext([
|
|
|
358
358
|
var FormContextProvider = FormContext.Provider;
|
|
359
359
|
var useFormContext = FormContext.use;
|
|
360
360
|
function FormItem(props) {
|
|
361
|
-
const { Elements, values, setValues } = useFormContext();
|
|
361
|
+
const { Elements, values, setValues, errors } = useFormContext();
|
|
362
362
|
const Label = props.label?.Label ?? Elements.Label;
|
|
363
363
|
const Input = props.input?.Input ?? Elements.Input;
|
|
364
|
-
return /* @__PURE__ */ jsx(Label, { name: props.name, ...props.label, children: /* @__PURE__ */ jsx(
|
|
364
|
+
return /* @__PURE__ */ jsx(Label, { name: props.name, ...props.label, error: errors[props.name], children: /* @__PURE__ */ jsx(
|
|
365
365
|
Input,
|
|
366
366
|
{
|
|
367
367
|
name: props.name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/react",
|
|
3
|
-
"version": "3.7.0-beta.
|
|
3
|
+
"version": "3.7.0-beta.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@faasjs/browser": "3.7.0-beta.
|
|
37
|
+
"@faasjs/browser": "3.7.0-beta.9"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@faasjs/browser": "3.7.0-beta.
|
|
40
|
+
"@faasjs/browser": "3.7.0-beta.9",
|
|
41
41
|
"@types/react": "*",
|
|
42
42
|
"react": "*"
|
|
43
43
|
},
|