@itera-web/react-ui-form 1.26.3 → 1.30.0

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/es/Form.d.ts CHANGED
@@ -1,50 +1,50 @@
1
- import * as React from 'react';
2
- import { type ControllerProps, type FieldPath, type FieldValues, UseFormReturn } from 'react-hook-form';
3
- import * as LabelPrimitive from '@radix-ui/react-label';
4
- type FormLayout = 'horizontal' | 'vertical';
5
- type LabelWidth = number | string;
6
- interface FormProps {
7
- children: React.ReactNode;
8
- layout?: FormLayout;
9
- labelLayout?: FormLayout;
10
- labelWidth?: LabelWidth;
11
- messageBottom?: LabelWidth;
12
- form: UseFormReturn<any>;
13
- className?: string;
14
- style?: React.CSSProperties;
15
- onSubmit?: (data: any) => void;
16
- }
17
- interface FormLayoutContextValue {
18
- layout: FormLayout;
19
- labelLayout: FormLayout;
20
- labelWidth?: LabelWidth;
21
- messageBottom?: LabelWidth;
22
- }
23
- export declare const useFormLayout: () => FormLayoutContextValue;
24
- declare const Form: ({ children, layout, labelLayout, labelWidth, messageBottom, form, className, style, onSubmit, }: FormProps) => React.JSX.Element;
25
- declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
26
- declare const useFormField: () => {
27
- invalid: boolean;
28
- isDirty: boolean;
29
- isTouched: boolean;
30
- isValidating: boolean;
31
- error?: import("react-hook-form").FieldError;
32
- id: string;
33
- name: string;
34
- formItemId: string;
35
- formDescriptionId: string;
36
- formMessageId: string;
37
- };
38
- declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
39
- interface FormLabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
40
- width?: number | string;
41
- required?: boolean;
42
- }
43
- declare const FormLabel: React.ForwardRefExoticComponent<FormLabelProps & React.RefAttributes<HTMLLabelElement>>;
44
- declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
45
- declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
46
- interface FormMessageProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
47
- bottom?: number | string;
48
- }
49
- declare const FormMessage: React.ForwardRefExoticComponent<FormMessageProps & React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
50
- export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
1
+ import * as React from 'react';
2
+ import { type ControllerProps, type FieldPath, type FieldValues, UseFormReturn } from 'react-hook-form';
3
+ import * as LabelPrimitive from '@radix-ui/react-label';
4
+ type FormLayout = 'horizontal' | 'vertical';
5
+ type LabelWidth = number | string;
6
+ interface FormProps {
7
+ children: React.ReactNode;
8
+ layout?: FormLayout;
9
+ labelLayout?: FormLayout;
10
+ labelWidth?: LabelWidth;
11
+ messageBottom?: LabelWidth;
12
+ form: UseFormReturn<any>;
13
+ className?: string;
14
+ style?: React.CSSProperties;
15
+ onSubmit?: (data: any) => void;
16
+ }
17
+ interface FormLayoutContextValue {
18
+ layout: FormLayout;
19
+ labelLayout: FormLayout;
20
+ labelWidth?: LabelWidth;
21
+ messageBottom?: LabelWidth;
22
+ }
23
+ export declare const useFormLayout: () => FormLayoutContextValue;
24
+ declare const Form: ({ children, layout, labelLayout, labelWidth, messageBottom, form, className, style, onSubmit, }: FormProps) => React.JSX.Element;
25
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
26
+ declare const useFormField: () => {
27
+ invalid: boolean;
28
+ isDirty: boolean;
29
+ isTouched: boolean;
30
+ isValidating: boolean;
31
+ error?: import("react-hook-form").FieldError;
32
+ id: string;
33
+ name: string;
34
+ formItemId: string;
35
+ formDescriptionId: string;
36
+ formMessageId: string;
37
+ };
38
+ declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
39
+ interface FormLabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
40
+ width?: number | string;
41
+ required?: boolean;
42
+ }
43
+ declare const FormLabel: React.ForwardRefExoticComponent<FormLabelProps & React.RefAttributes<HTMLLabelElement>>;
44
+ declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
45
+ declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
46
+ interface FormMessageProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
47
+ bottom?: number | string;
48
+ }
49
+ declare const FormMessage: React.ForwardRefExoticComponent<FormMessageProps & React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
50
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
package/es/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField } from './Form';
1
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField } from './Form';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@itera-web/react-ui-form",
3
3
  "description": "表单",
4
- "version": "1.26.3",
4
+ "version": "1.30.0",
5
5
  "main": "es/index.js",
6
6
  "types": "es/index.d.ts",
7
7
  "publishConfig": {
@@ -13,8 +13,8 @@
13
13
  "up": "npm publish"
14
14
  },
15
15
  "dependencies": {
16
- "@itera-web/react-ui-label": "^1.21.0",
17
- "@itera-web/utils-cn": "^1.22.0",
16
+ "@itera-web/react-ui-label": "^1.25.0",
17
+ "@itera-web/utils-cn": "^1.26.0",
18
18
  "@radix-ui/react-label": "^2.1.3",
19
19
  "@radix-ui/react-slot": "^1.2.0",
20
20
  "react-hook-form": "^7.55.0"
@@ -24,7 +24,7 @@
24
24
  "react-dom": ">=17.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@itera-web/cli": "^1.1.54"
27
+ "@itera-web/cli": "^1.1.70"
28
28
  },
29
- "gitHead": "f6881ff2bb7d1bfa4e8c25c2b9c175303037543e"
29
+ "gitHead": "ed385657bd5f002b9339de322c08659ae5ce6fc1"
30
30
  }