glib-web 4.15.2 → 4.15.3
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/fields/dynamicSelect.vue +16 -7
- package/nav/sheet.vue +1 -1
- package/package.json +1 -1
|
@@ -107,16 +107,25 @@ export default {
|
|
|
107
107
|
};
|
|
108
108
|
},
|
|
109
109
|
computed: {
|
|
110
|
-
|
|
110
|
+
cleanValues() {
|
|
111
111
|
if (this.model) {
|
|
112
112
|
// Depends on whether the field is single or multiple
|
|
113
|
-
|
|
113
|
+
if (this.$type.isArray(this.model)) {
|
|
114
|
+
return this.model
|
|
115
|
+
} else {
|
|
116
|
+
return [this.model];
|
|
117
|
+
}
|
|
114
118
|
}
|
|
115
|
-
// return [{ value: null }];
|
|
116
|
-
|
|
117
|
-
// To avoid empty param error
|
|
118
119
|
return [];
|
|
119
120
|
},
|
|
121
|
+
values() {
|
|
122
|
+
const array = this.cleanValues;
|
|
123
|
+
if (array.length > 0) {
|
|
124
|
+
return this.normalizedRows(array);
|
|
125
|
+
}
|
|
126
|
+
// So that the param gets submitted even when there is no selection.
|
|
127
|
+
return [{ value: null }];
|
|
128
|
+
},
|
|
120
129
|
density() {
|
|
121
130
|
return determineDensity(this.spec.styleClasses);
|
|
122
131
|
},
|
|
@@ -211,13 +220,13 @@ export default {
|
|
|
211
220
|
},
|
|
212
221
|
updateAllItems() {
|
|
213
222
|
// Make sure selected items/values are in the mix so they can be displayed in the select field.
|
|
214
|
-
this.allItems = this.
|
|
223
|
+
this.allItems = this.cleanValues.concat(this.items);
|
|
215
224
|
},
|
|
216
225
|
normalizedRows(rows) {
|
|
217
226
|
return rows.map(row => {
|
|
218
227
|
const extra = row.extra || {};
|
|
219
228
|
|
|
220
|
-
if (
|
|
229
|
+
if (Utils.type.isNull(row.value)) {
|
|
221
230
|
row.value = extra.value;
|
|
222
231
|
}
|
|
223
232
|
|
package/nav/sheet.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-bottom-sheet v-model="model" inset
|
|
2
|
+
<v-bottom-sheet v-model="model" inset>
|
|
3
3
|
<v-list>
|
|
4
4
|
<v-list-subheader v-if="spec.message">{{ spec.message }}</v-list-subheader>
|
|
5
5
|
<template v-for="(button, index) of spec.buttons" :key="index">
|