glib-web 3.4.1 → 3.4.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/_dropdownMenu.vue +11 -1
- package/components/fields/_select.vue +6 -5
- package/components/fields/autocomplete.vue +1 -1
- package/components/mixins/styles.js +1 -1
- package/components/panels/table.vue +2 -1
- package/nav/drawer.vue +19 -5
- package/nav/drawerButton.vue +43 -9
- package/package.json +1 -1
- package/templates/_menu.vue +10 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-menu left bottom>
|
|
3
3
|
<template v-slot:activator="{ props }">
|
|
4
|
-
<v-btn :icon="iconStyling" :text="textStyling || null" v-bind="props" style="color: inherit;"
|
|
4
|
+
<v-btn :size="size" :variant="variant" :icon="iconStyling" :text="textStyling || null" v-bind="props" style="color: inherit;"
|
|
5
5
|
@click.stop.prevent="">
|
|
6
6
|
<span v-if="spec.icon" :class="[textStyling ? 'padder' : '']"><common-icon :spec="spec.icon || {}" /></span>
|
|
7
7
|
{{ spec.text }}
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
|
+
import { determineColor, determineDensity, determineVariant, determineSize } from '../utils/constant'
|
|
21
|
+
|
|
20
22
|
export default {
|
|
21
23
|
props: {
|
|
22
24
|
spec: { type: Object, required: true }
|
|
@@ -27,6 +29,14 @@ export default {
|
|
|
27
29
|
textStyling: false
|
|
28
30
|
};
|
|
29
31
|
},
|
|
32
|
+
computed: {
|
|
33
|
+
size() {
|
|
34
|
+
return determineSize(this.spec.styleClasses)
|
|
35
|
+
},
|
|
36
|
+
variant() {
|
|
37
|
+
return determineVariant(this.spec.styleClasses, 'elevated')
|
|
38
|
+
}
|
|
39
|
+
},
|
|
30
40
|
methods: {
|
|
31
41
|
$ready() {
|
|
32
42
|
if (this.spec.text) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<div :style="$styles()" :class="classes()">
|
|
3
3
|
<v-autocomplete v-model="fieldModel" :label="spec.label" :items="options || []" :chips="spec.multiple"
|
|
4
4
|
:multiple="spec.multiple" :disabled="spec.readOnly" :clearable="!spec.readOnly" :hint="spec.hint"
|
|
5
|
-
:placeholder="spec.placeholder" :rules="rules" persistent-hint :
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
:placeholder="spec.placeholder" :rules="rules" persistent-hint :append-icon="append.icon" validate-on="blur"
|
|
6
|
+
item-title='text' :variant="variant" :closable-chips="spec.multiple" :density="density" persistent-placeholder
|
|
7
|
+
@update:modelValue="onChange" />
|
|
8
8
|
|
|
9
9
|
<input v-for="(item, index) in values" :key="index" type="hidden" :name="fieldName" :value="item" />
|
|
10
10
|
</div>
|
|
@@ -42,7 +42,7 @@ export default {
|
|
|
42
42
|
return [null];
|
|
43
43
|
},
|
|
44
44
|
density() {
|
|
45
|
-
return determineDensity(this.spec.styleClasses)
|
|
45
|
+
return determineDensity(this.spec.styleClasses);
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
methods: {
|
|
@@ -74,7 +74,8 @@ export default {
|
|
|
74
74
|
|
|
75
75
|
if (reinitValue) {
|
|
76
76
|
this.fieldModel = this.spec.value || this.defaultValue;
|
|
77
|
-
}
|
|
77
|
+
}
|
|
78
|
+
else if (this.defaultValue) {
|
|
78
79
|
// Don't execute if null because that will trigger an unnecessary update which will break
|
|
79
80
|
// select fields with `unspecified` value. See `/glib/json_ui_garage?path=forms%2Fselects`.
|
|
80
81
|
this.fieldModel = this.defaultValue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- TODO: Remove (deprecated) -->
|
|
2
2
|
<template>
|
|
3
3
|
<div :style="genericStyles()">
|
|
4
|
-
<v-combobox v-model="fieldModel" :label="spec.label" :items="options" :chips="spec.multiple"
|
|
4
|
+
<v-combobox v-model="fieldModel" :label="spec.label" :items="options || []" :chips="spec.multiple"
|
|
5
5
|
:deletable-chips="spec.multiple" :multiple="spec.multiple" :readonly="spec.readOnly" :disabled="spec.readOnly"
|
|
6
6
|
:hint="spec.hint" :placeholder="spec.placeholder" :outlined="$classes().includes('outlined') || null"
|
|
7
7
|
:append-icon="append.icon" validate-on="blur" :variant="variant" persistent-placeholder />
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
handler(spec, oldSpec) {
|
|
28
28
|
if (spec) {
|
|
29
29
|
let valueChanged = true;
|
|
30
|
-
if (oldSpec && oldSpec.value === spec.value) {
|
|
30
|
+
if (oldSpec && oldSpec.value === spec.value && oldSpec.name === spec.name) {
|
|
31
31
|
valueChanged = false;
|
|
32
32
|
}
|
|
33
33
|
this._linkFieldModels(valueChanged);
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
:style="colStyles(row, cellIndex)">
|
|
52
52
|
<!-- Prevent double links -->
|
|
53
53
|
<glib-component v-if="$href(cell)" :spec="cell" />
|
|
54
|
-
|
|
54
|
+
<!-- without "|| null" the browser will reload strangely -->
|
|
55
|
+
<a v-else :href="$href(row) || null" @click="$onClick($event, row)">
|
|
55
56
|
<glib-component :spec="cell" />
|
|
56
57
|
</a>
|
|
57
58
|
</td>
|
package/nav/drawer.vue
CHANGED
|
@@ -134,11 +134,25 @@ export default {
|
|
|
134
134
|
|
|
135
135
|
<style lang="scss">
|
|
136
136
|
// Move the padding to the badge to ensure that the item is middle-aligned.
|
|
137
|
-
.v-list--dense .nav-item .v-list-item .v-list-item__content {
|
|
138
|
-
|
|
137
|
+
// .v-list--dense .nav-item .v-list-item .v-list-item__content {
|
|
138
|
+
// padding: 0;
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
// // Prevent item badge from getting truncated.
|
|
141
|
+
// overflow: inherit;
|
|
142
|
+
|
|
143
|
+
// .v-badge {
|
|
144
|
+
// margin: 8px 0;
|
|
145
|
+
// }
|
|
146
|
+
// }
|
|
147
|
+
|
|
148
|
+
.v-list .nav-item .v-list-item .v-list-item__content {
|
|
149
|
+
// padding: 0;
|
|
150
|
+
|
|
151
|
+
// Prevent item badge from getting truncated.
|
|
152
|
+
overflow: inherit;
|
|
153
|
+
|
|
154
|
+
// .v-badge {
|
|
155
|
+
// margin: 8px 0;
|
|
156
|
+
// }
|
|
143
157
|
}
|
|
144
158
|
</style>
|
package/nav/drawerButton.vue
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-list-item
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
</v-list-item-action>
|
|
2
|
+
<!-- <v-list-item class="popover-menu-item"> -->
|
|
3
|
+
|
|
4
|
+
<v-list-item class="drawer-button">
|
|
6
5
|
|
|
6
|
+
<!-- <v-list-item :href="$href(spec)" @click="performAction($event)" class="popover-menu-item"> -->
|
|
7
|
+
<!-- <v-list-item :href="$href(spec)" @click="performAction($event)"> -->
|
|
8
|
+
<!-- <v-list-item-action v-if="spec.icon">
|
|
9
|
+
<common-icon :spec="spec.icon" />
|
|
10
|
+
</v-list-item-action> -->
|
|
11
|
+
<!--
|
|
7
12
|
<v-list-item-title>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
</v-list-item-title>
|
|
13
|
+
<common-badge :spec="spec">
|
|
14
|
+
{{ spec.text }}
|
|
15
|
+
</common-badge>
|
|
16
|
+
</v-list-item-title> -->
|
|
17
|
+
<common-button :spec="buttonSpec(spec)" />
|
|
12
18
|
</v-list-item>
|
|
13
19
|
</template>
|
|
14
20
|
|
|
@@ -22,9 +28,37 @@ export default {
|
|
|
22
28
|
// this.$el.dispatchEvent(new Event("drawers/clickButton", { bubbles: true }))
|
|
23
29
|
this.$dispatchEvent("drawers/clickButton", {});
|
|
24
30
|
this.$onClick(event);
|
|
31
|
+
},
|
|
32
|
+
buttonSpec(item) {
|
|
33
|
+
return Object.assign({}, item, {
|
|
34
|
+
view: "button-v1",
|
|
35
|
+
// width: "matchParent",
|
|
36
|
+
styleClasses: ["text"]
|
|
37
|
+
});
|
|
25
38
|
}
|
|
26
39
|
}
|
|
27
40
|
};
|
|
28
41
|
</script>
|
|
29
42
|
|
|
30
|
-
<style scoped
|
|
43
|
+
<style lang="scss" scoped>
|
|
44
|
+
</style>
|
|
45
|
+
|
|
46
|
+
<style lang="scss">
|
|
47
|
+
// .drawer-button {
|
|
48
|
+
// .v-list-item__content {
|
|
49
|
+
// text-align: left;
|
|
50
|
+
|
|
51
|
+
// .v-badge {
|
|
52
|
+
// width: 100%;
|
|
53
|
+
|
|
54
|
+
// .v-badge__wrapper {
|
|
55
|
+
// width: 100%;
|
|
56
|
+
// }
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
// .views-button {
|
|
60
|
+
// width: 100%;
|
|
61
|
+
// }
|
|
62
|
+
// }
|
|
63
|
+
// }
|
|
64
|
+
</style>
|
package/package.json
CHANGED
package/templates/_menu.vue
CHANGED
|
@@ -16,6 +16,8 @@ export default {
|
|
|
16
16
|
editMenu() {
|
|
17
17
|
if (this.editButtons.length > 0) {
|
|
18
18
|
return {
|
|
19
|
+
view: "button-v1",
|
|
20
|
+
styleClasses: ["text", "small"],
|
|
19
21
|
icon: { material: { name: "more_vert" } },
|
|
20
22
|
childButtons: this.editButtons
|
|
21
23
|
};
|
|
@@ -24,14 +26,14 @@ export default {
|
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
|
-
methods: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
29
|
+
// methods: {
|
|
30
|
+
// buttonSpec(item) {
|
|
31
|
+
// return Object.assign({}, item, {
|
|
32
|
+
// view: "button-v1",
|
|
33
|
+
// styleClasses: ["text"]
|
|
34
|
+
// });
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
35
37
|
};
|
|
36
38
|
</script>
|
|
37
39
|
|