@modelforms/fontawesome-vuetify 3.0.0 → 3.1.1

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.
@@ -116,17 +116,19 @@ export default{
116
116
  },
117
117
  props: {
118
118
  form: {
119
- type: Object as () => GridModel<any>,
120
- required: true
119
+ type: GridModel<Object>,
120
+ readonly: false,
121
+ default: () => new GridModel<Object>(),
121
122
  },
122
123
  validation: {
123
- type: Object as () => Validation<any>,
124
- default: () => new Validation<any>
124
+ type: Object as () => Validation<Object>,
125
+ default: () => new Validation<Object>
125
126
  }
126
127
  },
127
128
  data() {
128
129
  return {
129
130
  model: {} as any,
131
+ form: this.form,
130
132
  Button: button,
131
133
  validation: this.validation,
132
134
  valid: false,
@@ -134,15 +136,6 @@ export default{
134
136
  }
135
137
  },
136
138
  emits: [event],
137
- watch: {
138
- form(newValue, oldValue){
139
- this.form = newValue;
140
- this.initForm(newValue);
141
- },
142
- model(newValue, oldValue){
143
- this.model = newValue;
144
- }
145
- },
146
139
  methods: {
147
140
  submit(e: any) {
148
141
  this.$emit(event, this.model)
@@ -41,18 +41,12 @@ export default{
41
41
  setup(data){
42
42
  initComponent(data, name);
43
43
  },
44
- watch:{
45
- value(newValue, oldValue){
46
- this.value = newValue;
47
- },
48
- model(newValue, oldValue){
49
- this.model = newValue;
50
- }
51
- },
52
44
  data() {
53
45
  return {
54
46
  rule: this.rules.rules!,
55
- isValid: true
47
+ isValid: true,
48
+ value: this.value,
49
+ model: this.model,
56
50
  }
57
51
  },
58
52
  methods: {
@@ -2,7 +2,7 @@
2
2
  <v-container fluid>
3
3
  <v-autocomplete
4
4
  :v-model="model"
5
- :items="listItems"
5
+ :items="items"
6
6
  :item-title="title"
7
7
  :label="label"
8
8
  :rules="rule"
@@ -74,8 +74,8 @@
74
74
  label: {
75
75
  type: String
76
76
  },
77
- rules: {
78
- type: Object,
77
+ rule: {
78
+ type: Rule,
79
79
  default: () => []
80
80
  },
81
81
  filterKeys: {
@@ -100,37 +100,32 @@
100
100
  selected: [] as Object[],
101
101
  unSelected: [] as Object[],
102
102
  rows: [] as RowItem[],
103
- rule: this.rules.rules!,
103
+ rule: this.rule.rules,
104
104
  value: this.value,
105
105
  arrowDown: faArrowAltCircleDown,
106
106
  square: faSquare,
107
107
  check: faCheck,
108
+ items: this.items,
108
109
  search: empty,
109
110
  defaultIcon: defaultIcon,
110
111
  controlKeys: this.getFilterKeys(this.filterKeys),
111
112
  title: this.filterKeys.title,
112
- isValid: true,
113
- listItems: [] as Object[]
113
+ isValid: true
114
114
  }
115
115
  },
116
116
  methods: {
117
117
  select(event) {
118
118
  if(event.length!) {
119
119
  this.value = event;
120
- if(!this.multiple)
121
- this.$emit(valueEvent, this.items.find(item => item[this.title!] == event));
122
- else
123
- this.$emit(valueEvent, this.selected)
120
+ this.$emit(valueEvent, this.items.find(item => item[this.title!] == event));
124
121
  }
125
122
  },
126
123
  blur(event) {
127
124
  if(this.isValid){
128
- if(!this.multiple)
129
- this.$emit(valueEvent, this.items.find(item => item[this.title!] == event));
130
- else
131
- this.$emit(valueEvent, this.selected)
125
+ this.$emit(valueEvent, this.selected);
126
+ }else{
127
+ this.$emit(validationEvent, this.isValid)
132
128
  }
133
- this.$emit(validationEvent, this.isValid);
134
129
  },
135
130
  multiSelect(value: Object) {
136
131
  this.unSelected = [];
@@ -153,7 +148,6 @@
153
148
  },
154
149
  initAriaRows(){
155
150
  this.value = empty;
156
- this.listItems = this.items;
157
151
  this.ariaRows(this.items);
158
152
 
159
153
  if(this.itemValue.length){
@@ -244,11 +238,6 @@
244
238
  return value[this.filterKeys.title];
245
239
  },
246
240
  keyup(event){
247
- this.listItems = this.listItems.filter((item) => {
248
- if(this.controlKeys.find(key => item[key].indexOf(event) != -1)){
249
- return item;
250
- }
251
- })
252
241
  }
253
242
 
254
243
  }
@@ -54,17 +54,11 @@ export default {
54
54
  rule: this.rules.rules!,
55
55
  faCalendar: faCalendar,
56
56
  defaultIcon: defaultIcon,
57
- isValid: true
57
+ isValid: true,
58
+ value: this.value,
59
+ model: this.model
58
60
  }
59
61
  },
60
- watch:{
61
- value(newValue, oldValue){
62
- this.value = newValue;
63
- },
64
- model(newValue, oldValue){
65
- this.model = newValue;
66
- }
67
- },
68
62
  methods: {
69
63
  select(event: any) {
70
64
  if(this.isValid){
@@ -53,6 +53,11 @@
53
53
  isValid: true
54
54
  }
55
55
  },
56
+ watch:{
57
+ value(newValue, oldValue){
58
+ this.isValid = newValue;
59
+ },
60
+ },
56
61
  methods: {
57
62
  blur(event: any) {
58
63
  if(this.isValid){
@@ -19,6 +19,19 @@ export class GridModelHelper<T> {
19
19
  return gridModel;
20
20
  }
21
21
 
22
+ clearGrid(gridModel: GridModel<T>) {
23
+ for(let row of gridModel.rows){
24
+ for(let col of row.cols){
25
+ if(col.type == 'complete' && col.complete != undefined){
26
+ col.complete.itemValue = [];
27
+ continue;
28
+ }
29
+
30
+ col.value = null;
31
+ }
32
+ }
33
+ }
34
+
22
35
  populateCompletes<T, U>(gridModel: GridModel<T>, completeModel: CompleteModels<U>) {
23
36
  for(let row of gridModel.rows){
24
37
  var col = row.cols.find(col => col.type == 'complete' && col.name == completeModel.name);
@@ -46,15 +46,10 @@ export default {
46
46
  return {
47
47
  rule: this.rules.rules!,
48
48
  controlVariant: controlVariant,
49
- isValid: true
50
- }
51
- },
52
- watch:{
53
- value(newValue, oldValue){
54
- this.value = newValue;
55
- },
56
- model(newValue, oldValue){
57
- this.model = newValue;
49
+ isValid: true,
50
+ value: this.value,
51
+ model: this.model,
52
+
58
53
  }
59
54
  },
60
55
  methods: {
@@ -65,14 +65,8 @@ export default {
65
65
  typo: this.type,
66
66
  text: faLock,
67
67
  hashed: faUnlock,
68
- }
69
- },
70
- watch:{
71
- value(newValue, oldValue){
72
- this.value = newValue;
73
- },
74
- model(newValue, oldValue){
75
- this.model = newValue;
68
+ value: this.value,
69
+ model: this.model
76
70
  }
77
71
  },
78
72
  methods: {