File tree Expand file tree Collapse file tree 5 files changed +15
-5
lines changed
Expand file tree Collapse file tree 5 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ export const CheckboxField = makeFieldComponent({
1616} ) ;
1717
1818export interface CheckboxInputOptions
19- extends FormInputProps < HTMLInputElement , boolean > { }
19+ extends FormInputProps < HTMLInputElement , boolean > {
20+ disabled ?: boolean ;
21+ }
2022
2123export type CheckboxInputProps = WithOverride <
2224 ComponentProps < 'div' > ,
@@ -30,6 +32,7 @@ export function CheckboxInput(props: CheckboxInputProps) {
3032 < _Checkbox
3133 checked = { props . value }
3234 onChange = { value => props . onChange ?.( value ) }
35+ disabled = { props . disabled }
3336 { ...rest }
3437 >
3538 < _Checkbox . Input
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export function FormLabel(props: FormLabelProps) {
115115 return (
116116 < label
117117 { ...others }
118- data-disabled = { props . disabled }
118+ data-disabled = { props . disabled || null }
119119 class = { cn ( labelVariants ( ) , others . class ) }
120120 for = { props . for }
121121 >
@@ -135,7 +135,7 @@ export function FormError(props: FormErrorProps) {
135135 return (
136136 < small
137137 { ...others }
138- data-disabled = { props . disabled }
138+ data-disabled = { props . disabled || null }
139139 class = { cn ( labelVariants ( { error : true } ) , others . class ) }
140140 >
141141 { props . children }
@@ -154,7 +154,7 @@ export function FormDescription(props: FormDescriptionProps) {
154154 return (
155155 < small
156156 { ...others }
157- data-disabled = { props . disabled }
157+ data-disabled = { props . disabled || null }
158158 class = { cn (
159159 labelVariants ( { description : true , label : false } ) ,
160160 'mt-1' ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export const NumberField = makeFieldComponent({
2323interface NumberInputOptions
2424 extends FormInputProps < HTMLInputElement , number > {
2525 placeholder ?: string ;
26+ disabled ?: boolean ;
2627}
2728
2829export type NumberInputProps = WithOverride <
@@ -42,6 +43,7 @@ export function NumberInput(props: NumberInputProps) {
4243 return (
4344 < _NumberField
4445 rawValue = { local . value }
46+ disabled = { local . disabled }
4547 class = { cn (
4648 'relative rounded-md transition-shadow focus-within:outline-none focus-within:ring-[1.5px] focus-within:ring-ring' ,
4749 local . class ,
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ interface SelectInputOptions<T>
5151 placeholder ?: string ;
5252 options : SelectOption < T > [ ] ;
5353 required ?: boolean ;
54+ disabled ?: boolean ;
5455}
5556
5657export type SelectInputProps < T > = WithOverride <
@@ -73,6 +74,7 @@ export function SelectInput<T>(props: SelectInputProps<T>) {
7374 return (
7475 < _Select
7576 { ...rest }
77+ disabled = { props . disabled }
7678 options = { props . options }
7779 optionValue = "value"
7880 optionTextValue = { option =>
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ export const SwitchField = makeFieldComponent({
1616} ) ;
1717
1818export interface SwitchInputOptions
19- extends FormInputProps < HTMLInputElement , boolean > { }
19+ extends FormInputProps < HTMLInputElement , boolean > {
20+ disabled ?: boolean ;
21+ }
2022
2123export type SwitchInputProps = WithOverride <
2224 ComponentProps < 'div' > ,
@@ -30,6 +32,7 @@ export function SwitchInput(props: SwitchInputProps) {
3032 < _Switch
3133 checked = { local . value }
3234 onChange = { val => local . onChange ?.( val ) }
35+ disabled = { local . disabled }
3336 { ...rest }
3437 >
3538 < _Switch . Input
You can’t perform that action at this time.
0 commit comments