This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ import {
5858 InputBase ,
5959 email ,
6060 pattern ,
61+ ColorInput ,
6162} from ' ../../src' ;
6263
6364export default defineComponent ({
@@ -142,6 +143,11 @@ export default defineComponent({
142143 label: ' Custom Field' ,
143144 name: ' customField1' ,
144145 }),
146+ new ColorInput ({
147+ label: ' Color' ,
148+ name: ' color' ,
149+ value: ' #4DBA87' ,
150+ }),
145151 ],
146152 });
147153 function handleSubmit(values ) {
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ import App from './App.vue';
44import './styles/main.scss' ;
55
66import { createDynamicForms } from '../../src' ;
7- //import { createDynamicForms } from '../../dist/as-dynamic-forms.esm';
7+
8+ // import { createDynamicForms } from '../../dist/as-dynamic-forms.esm';
89
910const VueDynamicForms = createDynamicForms ( {
1011 autoValidate : true ,
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
3737 email ,
3838 pattern ,
3939 TextAreaInput ,
40+ ColorInput ,
4041} from ' ../../src' ;
4142
4243export default defineComponent ({
@@ -89,6 +90,10 @@ export default defineComponent({
8990 cols: 20 ,
9091 rows: 5 ,
9192 }),
93+ new ColorInput ({
94+ label: ' Color' ,
95+ value: ' #4DBA87' ,
96+ }),
9297 ],
9398 });
9499 function handleSubmit(values ) {
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ export default defineComponent({
135135 case ' email' :
136136 case ' password' :
137137 case ' url' :
138+ case ' color' :
138139 component = h (TextInput , attributes .value );
139140 break ;
140141 case ' select' :
Original file line number Diff line number Diff line change @@ -91,6 +91,10 @@ export class RadioInput extends InputBase<boolean> {
9191 type = 'radio' ;
9292}
9393
94+ export class ColorInput extends InputBase < string > {
95+ type = 'color' ;
96+ }
97+
9498export class FormControl < T > extends InputBase < T > {
9599 valid = true ;
96100 invalid = false ;
You can’t perform that action at this time.
0 commit comments