File tree Expand file tree Collapse file tree 3 files changed +22
-24
lines changed
frontend/packages/pydantic-forms/src Expand file tree Collapse file tree 3 files changed +22
-24
lines changed Original file line number Diff line number Diff line change 44 * We will search for the first field that returns a positive match
55 */
66import {
7+ CheckboxField ,
78 DividerField ,
89 HiddenField ,
910 IntegerField ,
1011 LabelField ,
1112 TextAreaField ,
12- CheckboxField
1313} from '@/components/fields' ;
1414import {
1515 PydanticComponentMatcher ,
@@ -91,10 +91,8 @@ const defaultComponentMatchers: PydanticComponentMatcher[] = [
9191 isControlledElement : true ,
9292 } ,
9393 matcher ( field ) {
94- return (
95- field . type === PydanticFormFieldType . BOOLEAN
96- ) ;
97- }
94+ return field . type === PydanticFormFieldType . BOOLEAN ;
95+ } ,
9896 } ,
9997] ;
10098
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
13import { PydanticFormControlledElementProps } from '@/types' ;
24
3- export const CheckboxField = ( {
4- onChange,
5- onBlur,
6- value,
7- name,
8- pydanticFormField
5+ export const CheckboxField = ( {
6+ onChange,
7+ onBlur,
8+ value,
9+ name,
10+ disabled ,
911} : PydanticFormControlledElementProps ) => {
10- console . log ( pydanticFormField ) ;
11- return (
12- < input
13- type = "checkbox"
14- checked = { value }
15- onChange = { ( ) => onChange ( ! value ) }
16- onBlur = { onBlur }
17- name = { name }
18- />
19- ) ;
20- } ;
12+ return (
13+ < input
14+ type = "checkbox"
15+ checked = { value }
16+ onChange = { ( ) => onChange ( ! value ) }
17+ onBlur = { onBlur }
18+ name = { name }
19+ disabled = { disabled }
20+ />
21+ ) ;
22+ } ;
Original file line number Diff line number Diff line change @@ -84,11 +84,9 @@ export const getComponentMatcher = (
8484 return matcher ( field ) ;
8585 } ) ;
8686
87- console . log ( 'Matched component __' + matchedComponent ?. matcher )
8887 if ( matchedComponent ) return matchedComponent ;
8988
9089 // Defaults to textField when there are no matches
91- console . log ( 'No match found for field ' + field . id ) ;
9290 return {
9391 id : 'textfield' ,
9492 ElementMatch : {
You can’t perform that action at this time.
0 commit comments