File tree Expand file tree Collapse file tree
ui/src/components/SchemaForm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ interface Props {
2929 onChange ?: ( fd : Type . FormDataType ) => void ;
3030 formData : Type . FormDataType ;
3131 readOnly : boolean ;
32- minValue ?: number ;
32+ min ?: number ;
33+ max ?: number ;
3334 inputMode ?:
3435 | 'text'
3536 | 'search'
@@ -48,7 +49,8 @@ const Index: FC<Props> = ({
4849 onChange,
4950 formData,
5051 readOnly = false ,
51- minValue = 0 ,
52+ min = 0 ,
53+ max = 65355 ,
5254 inputMode = 'text' ,
5355} ) => {
5456 const fieldObject = formData [ fieldName ] ;
@@ -73,7 +75,8 @@ const Index: FC<Props> = ({
7375 placeholder = { placeholder }
7476 type = { type }
7577 value = { fieldObject ?. value || '' }
76- min = { minValue }
78+ min = { min }
79+ max = { max }
7780 inputMode = { inputMode }
7881 onChange = { handleChange }
7982 disabled = { readOnly }
Original file line number Diff line number Diff line change @@ -260,6 +260,8 @@ const SchemaForm: ForwardRefRenderFunction<FormRef, FormProps> = (
260260 enum : enumValues = [ ] ,
261261 enumNames = [ ] ,
262262 max_length = 0 ,
263+ max = 65355 ,
264+ min = 0 ,
263265 } = properties [ key ] ;
264266 const { 'ui:widget' : widget = 'input' , 'ui:options' : uiOpt } =
265267 uiSchema ?. [ key ] || { } ;
@@ -374,6 +376,8 @@ const SchemaForm: ForwardRefRenderFunction<FormRef, FormProps> = (
374376 placeholder = {
375377 uiOpt && 'placeholder' in uiOpt ? uiOpt . placeholder : ''
376378 }
379+ min = { min }
380+ max = { max }
377381 fieldName = { key }
378382 onChange = { onChange }
379383 formData = { formData }
@@ -408,9 +412,14 @@ const SchemaForm: ForwardRefRenderFunction<FormRef, FormProps> = (
408412 type = {
409413 uiOpt && 'inputType' in uiOpt ? uiOpt . inputType : 'text'
410414 }
415+ inputMode = {
416+ uiOpt && 'inputMode' in uiOpt ? uiOpt . inputMode : 'text'
417+ }
411418 placeholder = {
412419 uiOpt && 'placeholder' in uiOpt ? uiOpt . placeholder : ''
413420 }
421+ min = { min }
422+ max = { max }
414423 fieldName = { key }
415424 onChange = { onChange }
416425 formData = { formData }
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ export interface JSONSchema {
4949 description ?: string ;
5050 enum ?: Array < string | boolean | number > ;
5151 enumNames ?: string [ ] ;
52+ min ?: number ;
53+ max ?: number ;
5254 default ?: string | boolean | number | any [ ] ;
5355 max_length ?: number ;
5456 } ;
You can’t perform that action at this time.
0 commit comments