Skip to content

Commit 160f08a

Browse files
committed
remove debug statements
add react to scope implement disabled
1 parent d2333a2 commit 160f08a

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

frontend/packages/pydantic-forms/src/components/defaultComponentMatchers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
* We will search for the first field that returns a positive match
55
*/
66
import {
7+
CheckboxField,
78
DividerField,
89
DropdownField,
910
HiddenField,
1011
IntegerField,
1112
LabelField,
1213
RadioField,
1314
TextAreaField,
14-
CheckboxField
1515
} from '@/components/fields';
1616
import {
1717
PydanticComponentMatcher,
Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1+
import React from 'react';
2+
13
import { 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+
};

frontend/packages/pydantic-forms/src/core/mapFieldToComponent.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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: {

0 commit comments

Comments
 (0)