glib-web 0.15.3 → 0.16.0
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/avatar.vue +5 -1
- package/components/fields/text.vue +8 -1
- package/components/mixins/styles.js +1 -20
- package/components/panels/list.vue +5 -0
- package/index.js +0 -7
- package/nav/drawer.vue +21 -12
- package/package.json +1 -1
package/components/avatar.vue
CHANGED
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
<common-badge :spec="spec">
|
|
11
11
|
<v-avatar :size="spec.size">
|
|
12
12
|
<!-- Use `img` instead of `v-img` otherwise the rounded border will not work. -->
|
|
13
|
-
<img
|
|
13
|
+
<img
|
|
14
|
+
:style="$styles()"
|
|
15
|
+
:src="spec.url || spec.base64Data"
|
|
16
|
+
@click="$onClick()"
|
|
17
|
+
/>
|
|
14
18
|
</v-avatar>
|
|
15
19
|
</common-badge>
|
|
16
20
|
</template>
|
|
@@ -129,7 +129,14 @@ export default {
|
|
|
129
129
|
onChange() {
|
|
130
130
|
Utils.type.ifObject(this.spec.onChange, onChange => {
|
|
131
131
|
this.$nextTick(() => {
|
|
132
|
-
|
|
132
|
+
const params = {
|
|
133
|
+
[this.spec.paramNameForFormData || "formData"]: {
|
|
134
|
+
[this.fieldName]: this.fieldModel
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const data = Object.assign({}, onChange, params);
|
|
139
|
+
GLib.action.execute(data, this);
|
|
133
140
|
});
|
|
134
141
|
});
|
|
135
142
|
}
|
|
@@ -40,6 +40,7 @@ export default {
|
|
|
40
40
|
if (val === this.vuetifyEmptyString) {
|
|
41
41
|
val = "";
|
|
42
42
|
}
|
|
43
|
+
|
|
43
44
|
// Make the field property observable for dynamic showing/hiding
|
|
44
45
|
Vue.set(
|
|
45
46
|
this.$data._fieldModels,
|
|
@@ -96,26 +97,6 @@ export default {
|
|
|
96
97
|
val => (styles["text-align"] = val)
|
|
97
98
|
);
|
|
98
99
|
|
|
99
|
-
// const padding = properties.padding;
|
|
100
|
-
// if (Utils.type.isObject(padding)) {
|
|
101
|
-
// Utils.type.ifNumber(
|
|
102
|
-
// padding.top,
|
|
103
|
-
// top => (styles["padding-top"] = `${top}px`)
|
|
104
|
-
// );
|
|
105
|
-
// Utils.type.ifNumber(
|
|
106
|
-
// padding.bottom,
|
|
107
|
-
// bottom => (styles["padding-bottom"] = `${bottom}px`)
|
|
108
|
-
// );
|
|
109
|
-
// Utils.type.ifNumber(
|
|
110
|
-
// padding.left,
|
|
111
|
-
// left => (styles["padding-left"] = `${left}px`)
|
|
112
|
-
// );
|
|
113
|
-
// Utils.type.ifNumber(
|
|
114
|
-
// padding.right,
|
|
115
|
-
// right => (styles["padding-right"] = `${right}px`)
|
|
116
|
-
// );
|
|
117
|
-
// }
|
|
118
|
-
|
|
119
100
|
Utils.type.ifObject(properties.padding, padding => {
|
|
120
101
|
Utils.type.ifNumber(
|
|
121
102
|
padding.top,
|
|
@@ -264,4 +264,9 @@ export default {
|
|
|
264
264
|
opacity: 0.5;
|
|
265
265
|
background: #dddddd;
|
|
266
266
|
}
|
|
267
|
+
|
|
268
|
+
.selected {
|
|
269
|
+
// TODO: Use lighter primary color: https://stackoverflow.com/questions/48280990/using-custom-theming-in-vuetify-and-pass-color-variables-to-components
|
|
270
|
+
background-color: lightblue;
|
|
271
|
+
}
|
|
267
272
|
</style>
|
package/index.js
CHANGED
|
@@ -182,13 +182,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
182
182
|
data: {
|
|
183
183
|
vueApp: window.vueApp
|
|
184
184
|
},
|
|
185
|
-
// data: {
|
|
186
|
-
// vuetify: vuetify,
|
|
187
|
-
// page: window.__page,
|
|
188
|
-
// indicator: false,
|
|
189
|
-
// isStale: false,
|
|
190
|
-
// webSocket: { channels: {}, header: {}, listWindow: null }
|
|
191
|
-
// },
|
|
192
185
|
render: function(createElement) {
|
|
193
186
|
return createElement(App, { props: { page: this.$data.vueApp.page } });
|
|
194
187
|
}
|
package/nav/drawer.vue
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
:permanent="cssClasses.includes('permanent')"
|
|
11
11
|
:style="style"
|
|
12
12
|
:expand-on-hover="expandOnHover()"
|
|
13
|
-
:mini-variant.sync="
|
|
13
|
+
:mini-variant.sync="shrunk"
|
|
14
14
|
@input="updateState"
|
|
15
15
|
>
|
|
16
|
-
<template v-if="mini
|
|
16
|
+
<template v-if="mini" v-slot:prepend>
|
|
17
17
|
<v-list-item>
|
|
18
18
|
<v-list-item-icon>
|
|
19
|
-
<v-icon v-if="!
|
|
20
|
-
<v-icon v-if="
|
|
19
|
+
<v-icon v-if="!shrunk">mdi-chevron-left</v-icon>
|
|
20
|
+
<v-icon v-if="shrunk">mdi-chevron-right</v-icon>
|
|
21
21
|
</v-list-item-icon>
|
|
22
22
|
</v-list-item>
|
|
23
23
|
</template>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<v-list-item>
|
|
40
40
|
<!-- Display the first line when the drawer is shrunk. Display the second line when the drawer is expanded -->
|
|
41
41
|
<div style="display: none">Show if expand</div>
|
|
42
|
-
<panels-responsive v-if="!
|
|
42
|
+
<panels-responsive v-if="!shrunk" :spec="spec.footer" />
|
|
43
43
|
</v-list-item>
|
|
44
44
|
</template>
|
|
45
45
|
</v-navigation-drawer>
|
|
@@ -135,7 +135,8 @@ export default {
|
|
|
135
135
|
// Using null as the starting value for its v-model will initialize the drawer as closed on mobile and as open on desktop.
|
|
136
136
|
// See https://vuetifyjs.com/en/components/navigation-drawers
|
|
137
137
|
state: null,
|
|
138
|
-
mini: true
|
|
138
|
+
mini: true,
|
|
139
|
+
shrunk: true
|
|
139
140
|
};
|
|
140
141
|
},
|
|
141
142
|
computed: {
|
|
@@ -167,7 +168,7 @@ export default {
|
|
|
167
168
|
},
|
|
168
169
|
methods: {
|
|
169
170
|
$ready() {
|
|
170
|
-
this.mini =
|
|
171
|
+
this.shrunk = this.mini = this.cssClasses.includes("mini");
|
|
171
172
|
this.updateNavigationStyle(window.location);
|
|
172
173
|
|
|
173
174
|
// this.$el.addEventListener('drawers/clickButton', () => { this.updateState(false) }, false)
|
|
@@ -181,10 +182,7 @@ export default {
|
|
|
181
182
|
this.state = state;
|
|
182
183
|
},
|
|
183
184
|
expandOnHover() {
|
|
184
|
-
return
|
|
185
|
-
this.cssClasses.includes("mini") ||
|
|
186
|
-
(this.cssClasses.includes("mini-lg-and-above") && this.lgAndAbove)
|
|
187
|
-
);
|
|
185
|
+
return this.mini;
|
|
188
186
|
},
|
|
189
187
|
updateNavigationStyle(urlObject) {
|
|
190
188
|
const navMap = navigationMap(this.$el, urlObject.pathname);
|
|
@@ -199,7 +197,7 @@ export default {
|
|
|
199
197
|
};
|
|
200
198
|
</script>
|
|
201
199
|
|
|
202
|
-
<style scoped>
|
|
200
|
+
<style lang="scss" scoped>
|
|
203
201
|
.nav-item {
|
|
204
202
|
position: relative;
|
|
205
203
|
}
|
|
@@ -215,3 +213,14 @@ export default {
|
|
|
215
213
|
background-color: white;
|
|
216
214
|
}
|
|
217
215
|
</style>
|
|
216
|
+
|
|
217
|
+
<style lang="scss">
|
|
218
|
+
// Move the padding to the badge to ensure that the item is middle-aligned.
|
|
219
|
+
.v-list--dense .nav-item .v-list-item .v-list-item__content {
|
|
220
|
+
padding: 0;
|
|
221
|
+
|
|
222
|
+
.v-badge {
|
|
223
|
+
margin: 8px 0;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
</style>
|