@modelforms/fontawesome-vuetify 3.8.0 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/form/Form.vue +7 -3
- package/components/form/complete/Complete.vue +6 -6
- package/components/form/helpers/resources.ts +2 -0
- package/dist/index.amd.ts +14 -14
- package/dist/index.esm.ts +2023 -2020
- package/package.json +1 -1
package/components/form/Form.vue
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
:label="col.label"
|
|
52
52
|
:rules="col.rules"
|
|
53
53
|
:title="col.complete?.title"
|
|
54
|
-
v-on:value="
|
|
54
|
+
v-on:value="complete($event, col.name)"/>
|
|
55
55
|
|
|
56
56
|
<Area
|
|
57
57
|
v-if="col.type == 'area'"
|
|
@@ -101,7 +101,7 @@ import Date from './../form/date/Date.vue';
|
|
|
101
101
|
import Complete from './../form/complete/Complete.vue';
|
|
102
102
|
import Area from './../form/area/Area.vue';
|
|
103
103
|
import { GridModel } from './models/formModels';
|
|
104
|
-
import { button, event } from './helpers/resources';
|
|
104
|
+
import { button, completeChangeEvent, event } from './helpers/resources';
|
|
105
105
|
import { Validation } from './models/formModels';
|
|
106
106
|
import { initForm } from './helpers/init';
|
|
107
107
|
import File from './file/File.vue';
|
|
@@ -136,7 +136,7 @@ export default{
|
|
|
136
136
|
offset: this.titlePosition(this.form.title)
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
|
-
emits: [event],
|
|
139
|
+
emits: [event, completeChangeEvent],
|
|
140
140
|
methods: {
|
|
141
141
|
submit(e: any) {
|
|
142
142
|
this.$emit(event, this.model)
|
|
@@ -144,6 +144,10 @@ export default{
|
|
|
144
144
|
value(event: any, name: string) {
|
|
145
145
|
this.model[name] = event;
|
|
146
146
|
},
|
|
147
|
+
complete(event: any, name: string) {
|
|
148
|
+
this.model[name] = event;
|
|
149
|
+
this.$emit(completeChangeEvent, { name, value: event });
|
|
150
|
+
},
|
|
147
151
|
init(form: GridModel<any>) {
|
|
148
152
|
initForm(form);
|
|
149
153
|
this.validation.form = form;
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
|
|
38
38
|
<script lang="ts">
|
|
39
39
|
import { faArrowAltCircleDown, faSquare } from '@fortawesome/free-regular-svg-icons';
|
|
40
|
-
import { faCheck } from '@fortawesome/free-solid-svg-icons';
|
|
40
|
+
import { faCheck, faChevronDown } from '@fortawesome/free-solid-svg-icons';
|
|
41
41
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
42
|
-
import { empty, defaultIcon, valueEvent, searchError, validationEvent } from '../helpers/resources';
|
|
42
|
+
import { empty, defaultIcon, valueEvent, searchError, validationEvent, completeEvent } from '../helpers/resources';
|
|
43
43
|
import { FilterOptions } from '../models/formModels';
|
|
44
44
|
import { initComponent } from '../helpers/init';
|
|
45
45
|
import { isEqual } from '../helpers/equal';
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
components: {
|
|
86
86
|
FontAwesomeIcon: FontAwesomeIcon,
|
|
87
87
|
},
|
|
88
|
-
emits: [valueEvent, validationEvent],
|
|
88
|
+
emits: [valueEvent, validationEvent, completeEvent],
|
|
89
89
|
mounted() {
|
|
90
90
|
if(this.multiple){
|
|
91
91
|
this.initAriaRows();
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
rule: this.rule.rules,
|
|
106
106
|
value: this.value,
|
|
107
107
|
itemValue: this.itemValue,
|
|
108
|
-
arrowDown:
|
|
108
|
+
arrowDown: faChevronDown,
|
|
109
109
|
square: faSquare,
|
|
110
110
|
check: faCheck,
|
|
111
111
|
items: this.items,
|
|
@@ -121,12 +121,12 @@
|
|
|
121
121
|
if(event.length!) {
|
|
122
122
|
this.value = event;
|
|
123
123
|
this.selected = [this.items.find(item => item[this.title!] == event)!];
|
|
124
|
-
this.$emit(
|
|
124
|
+
this.$emit(completeEvent, [this.selected]);
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
blur(event) {
|
|
128
128
|
if(this.isValid){
|
|
129
|
-
this.$emit(
|
|
129
|
+
this.$emit(completeEvent, this.selected);
|
|
130
130
|
}else{
|
|
131
131
|
this.$emit(validationEvent, this.isValid)
|
|
132
132
|
}
|
|
@@ -2,6 +2,8 @@ export const button = 'SUBMIT';
|
|
|
2
2
|
export const event = 'submit';
|
|
3
3
|
export const valueEvent = 'value';
|
|
4
4
|
export const validationEvent = 'validation';
|
|
5
|
+
export const completeEvent = 'complete';
|
|
6
|
+
export const completeChangeEvent = 'completeChange';
|
|
5
7
|
|
|
6
8
|
export const searchError = 'Wrong search parameter type!';
|
|
7
9
|
export const ruleError = 'Wrong rule parameter type! ';
|