Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #182 from asigloo/feature/custom-styles-attr-next
Browse files Browse the repository at this point in the history
feat(forms): added CustomStyles attr for forms and inputs
  • Loading branch information
alvarosabu authored Oct 17, 2020
2 parents c4c6049 + 21a22c5 commit 7d7fd1c
Show file tree
Hide file tree
Showing 6 changed files with 770 additions and 646 deletions.
21 changes: 20 additions & 1 deletion dev/typescript/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ import {
ColorInput,
NumberInput,
CustomInput,
BindingObject,
} from '../../src';
/* } from '../../dist/as-dynamic-forms.esm'; */
export default defineComponent({
name: 'app',
setup() {
const title = ref('Vue Dynamic Forms');
const formValues = reactive({});
const emailValidator: FormValidation = {
validator: email,
text: 'Email format is incorrect',
Expand Down Expand Up @@ -96,6 +96,7 @@ export default defineComponent({
'awesomeness',
'color',
'customField1',
'customStyles',
],
fields: {
name: {
Expand All @@ -108,6 +109,16 @@ export default defineComponent({
label: 'Email',
type: 'email',
validations: [emailValidator],
/* customClass: 'active text-red', */
customClass: {
active: true,
'text-blue': true,
},
/* customClass: {
active: true,
'text-blue': true,
}, */
/* customClass: ['active', 'text-red'], */
} as EmailInput,
password: {
label: 'Password',
Expand Down Expand Up @@ -189,6 +200,14 @@ export default defineComponent({
type: 'color',
value: '#4DBA87',
} as ColorInput,
customStyles: {
label: 'Custom Styles',
type: 'text',
required: true,
customStyles: {
border: '1px solid teal',
},
} as TextInput,
},
});
Expand Down
4 changes: 4 additions & 0 deletions dev/typescript/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const VueDynamicForms = createDynamicForms({
autoValidate: true,
form: {
customClass: 'plugin-options-class-added',
customStyles: {
display: 'flex',
flexDirection: 'column',
},
method: 'POST',
netlify: false,
netlifyHoneypot: null,
Expand Down
Loading

0 comments on commit 7d7fd1c

Please sign in to comment.