@opengov/form-utils
Advanced tools
+9
-9
@@ -137,6 +137,6 @@ import { FieldValues, Control, RegisterOptions, Validate } from 'react-hook-form'; | ||
| /** FIELD CONFIGURATION TYPES */ | ||
| export type FieldRules<T extends FieldValues = FieldValues> = Omit<RegisterOptions, 'validate'> & { | ||
| validate?: Record<string, Validate<any, T>>; | ||
| export type FieldRules<TFieldValues extends FieldValues = FieldValues> = Omit<RegisterOptions, 'validate'> & { | ||
| validate?: Record<string, Validate<any, TFieldValues>>; | ||
| }; | ||
| export type FieldConfiguration<T extends FieldValues = FieldValues> = { | ||
| export type FieldConfiguration<TFieldValues extends FieldValues = FieldValues> = { | ||
| type: string; | ||
@@ -146,8 +146,7 @@ name: string; | ||
| icon?: string; | ||
| groups: ConfigurationGroup<T>[]; | ||
| groups: ConfigurationGroup<TFieldValues>[]; | ||
| label?: LabelConfiguration; | ||
| fullWidth?: boolean; | ||
| rules?: FieldRules<T>; | ||
| }; | ||
| export type FieldInstanceState = { | ||
| export type FieldInstanceState<TFieldValues extends FieldValues = FieldValues> = { | ||
| disabled?: boolean; | ||
@@ -157,6 +156,7 @@ readonly?: boolean; | ||
| icons?: React.ReactNode; | ||
| rules?: FieldRules<TFieldValues>; | ||
| }; | ||
| export type RenderField<T extends FieldConfiguration = FieldConfiguration> = (template: FieldTemplate, config: T, state: FieldInstanceState) => JSX.Element; | ||
| export type TypeConfig<T extends FieldConfiguration = FieldConfiguration> = T & { | ||
| renderField: RenderField<T>; | ||
| export type RenderField<TConfig extends FieldConfiguration = FieldConfiguration> = (template: FieldTemplate, config: TConfig, state: FieldInstanceState) => JSX.Element; | ||
| export type TypeConfig<TConfig extends FieldConfiguration = FieldConfiguration> = TConfig & { | ||
| renderField: RenderField<TConfig>; | ||
| }; | ||
@@ -163,0 +163,0 @@ export type TextConfiguration = FieldConfiguration & { |
+1
-1
| { | ||
| "name": "@opengov/form-utils", | ||
| "version": "0.7.0-rules-beta.1", | ||
| "version": "0.7.0-rules-beta.2", | ||
| "description": "OpenGov Smart Forms form utils", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
9279
1.45%