glib-web 2.4.1 → 3.0.0-beta1
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/LICENSE +0 -0
- package/action.js +6 -1
- package/actions/auth/restart.js +0 -0
- package/actions/commands/enqueue.js +17 -0
- package/actions/components/update.js +13 -14
- package/actions/dialogs/oauth.js +0 -0
- package/actions/dialogs/options.js +0 -0
- package/app.vue +25 -26
- package/components/_button.vue +21 -28
- package/components/_chip.vue +14 -19
- package/components/_dropdownMenu.vue +10 -23
- package/components/_icon.vue +5 -5
- package/components/_message.vue +0 -0
- package/components/_responsive.vue +7 -21
- package/components/avatar.vue +11 -15
- package/components/banners/alert.vue +2 -7
- package/components/banners/select.vue +18 -30
- package/components/button.vue +5 -5
- package/components/component.vue +97 -100
- package/components/datetime.vue +0 -0
- package/components/fab.vue +0 -0
- package/components/fields/_patternText.vue +5 -19
- package/components/fields/_select.vue +7 -28
- package/components/fields/autocomplete.vue +5 -21
- package/components/fields/check.vue +19 -11
- package/components/fields/country/countries.js +0 -0
- package/components/fields/country/field.vue +9 -27
- package/components/fields/country/regions.js +0 -0
- package/components/fields/date.vue +5 -5
- package/components/fields/datetime.vue +5 -5
- package/components/fields/dynamicSelect.vue +8 -29
- package/components/fields/newRichText.vue +66 -53
- package/components/fields/otpField.vue +90 -0
- package/components/fields/phone/field.vue +60 -78
- package/components/fields/radio.vue +16 -23
- package/components/fields/rating.vue +9 -16
- package/components/fields/richText.vue +8 -28
- package/components/fields/select.vue +10 -7
- package/components/fields/stripeExternalAccount.vue +10 -24
- package/components/fields/text.vue +24 -40
- package/components/fields/textarea.vue +13 -27
- package/components/fields/timeZone.vue +9 -6
- package/components/fields/timer.vue +3 -10
- package/components/hr.vue +0 -0
- package/components/html.vue +0 -0
- package/components/image.vue +13 -20
- package/components/map.vue +115 -29
- package/components/markdown.vue +15 -8
- package/components/mixins/events.js +17 -6
- package/components/mixins/longClick.js +0 -0
- package/components/mixins/scrolling.js +0 -0
- package/components/mixins/styles.js +18 -15
- package/components/mixins/table/export.js +0 -0
- package/components/mixins/table/import.js +0 -0
- package/components/p.vue +0 -0
- package/components/panels/column.vue +5 -5
- package/components/panels/custom.vue +15 -15
- package/components/panels/flow.vue +19 -13
- package/components/panels/form.vue +17 -28
- package/components/panels/grid.vue +15 -9
- package/components/panels/horizontal.vue +149 -18
- package/components/panels/list.vue +63 -70
- package/components/panels/responsive.vue +13 -33
- package/components/panels/split.vue +2 -2
- package/components/panels/table.vue +27 -61
- package/components/panels/timeline.vue +20 -30
- package/components/panels/vertical.vue +9 -14
- package/components/tabBar.vue +27 -19
- package/index.js +68 -72
- package/keys.js +0 -0
- package/nav/appbar.vue +4 -4
- package/nav/dialog.vue +24 -34
- package/nav/drawer.vue +39 -51
- package/nav/drawerButton.vue +5 -7
- package/nav/drawerLabel.vue +2 -3
- package/nav/sheet.vue +18 -24
- package/nav/snackbar.vue +16 -26
- package/package.json +10 -11
- package/plugins/driverCustomBehavior.js +1 -1
- package/plugins/updatableComponent.js +1 -7
- package/plugins/vuetify.js +27 -0
- package/settings.json.example +0 -0
- package/styles/test.sass +0 -0
- package/styles/test.scss +0 -0
- package/templates/comment.vue +42 -19
- package/templates/featured.vue +8 -9
- package/templates/thumbnail-old.vue +188 -0
- package/templates/thumbnail.vue +5 -188
- package/templates/unsupported.vue +0 -0
- package/tsconfig.json +1 -1
- package/utils/dom.js +0 -0
- package/utils/eventBus.js +9 -2
- package/utils/history.js +7 -4
- package/utils/http.js +7 -2
- package/utils/launch.js +43 -51
- package/utils/public.js +6 -0
- package/utils/queue.js +110 -0
- package/utils/settings.js +3 -1
- package/utils/storage.js +0 -0
- package/utils/url.js +0 -0
package/index.js
CHANGED
|
@@ -1,26 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { createApp, h } from "vue";
|
|
2
|
+
import vuetify from "./plugins/vuetify";
|
|
4
3
|
import App from "./app.vue";
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
window.vueApp = {
|
|
6
|
+
vuetify: vuetify,
|
|
7
|
+
page: window.__page,
|
|
8
|
+
indicator: false,
|
|
9
|
+
// Rename to isPageStale
|
|
10
|
+
isStale: false,
|
|
11
|
+
/// Dirty form handling
|
|
12
|
+
isFormSubmitted: false,
|
|
13
|
+
isFormDirty: false,
|
|
14
|
+
///
|
|
15
|
+
stateUpdatedAt: null,
|
|
16
|
+
webSocket: { channels: {}, header: {} },
|
|
17
|
+
actionCable: { channels: {} },
|
|
18
|
+
registeredComponents: [],
|
|
19
|
+
temp: {}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Vue = createApp({
|
|
23
|
+
vuetify: window.vueApp.vuetify,
|
|
24
|
+
data: {
|
|
25
|
+
vueApp: window.vueApp,
|
|
26
|
+
},
|
|
27
|
+
mounted() {
|
|
28
|
+
eventBus.$on('app/updatePage', page => this.vueApp = Object.assign({}, this.vueApp, { page: page }))
|
|
29
|
+
},
|
|
30
|
+
render: function () {
|
|
31
|
+
return h(App, { page: this.$data.vueApp.page });
|
|
11
32
|
}
|
|
12
|
-
})
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
Vue.use(vuetify)
|
|
37
|
+
|
|
38
|
+
// import * as VueGoogleMaps from "vue2-google-maps";
|
|
39
|
+
// Vue.use(VueGoogleMaps, {
|
|
40
|
+
// load: {
|
|
41
|
+
// key: process.env.GMAPS_API_KEY,
|
|
42
|
+
// libraries: "places"
|
|
43
|
+
// }
|
|
44
|
+
// });
|
|
13
45
|
|
|
14
46
|
import "./styles/test.scss";
|
|
15
47
|
import "./styles/test.sass";
|
|
16
48
|
|
|
17
|
-
import Vuetify from "vuetify";
|
|
18
|
-
import "vuetify/dist/vuetify.min.css";
|
|
19
49
|
// Only used for social media icons
|
|
20
|
-
import "@fortawesome/fontawesome-free/css/all.css";
|
|
50
|
+
// import "@fortawesome/fontawesome-free/css/all.css";
|
|
21
51
|
// import "material-design-icons-iconfont/dist/material-design-icons.css";
|
|
22
52
|
// import "@mdi/font/css/materialdesignicons.css";
|
|
23
|
-
Vue.use(Vuetify);
|
|
24
53
|
|
|
25
54
|
import Chartkick from "vue-chartkick";
|
|
26
55
|
import Chart from "chart.js";
|
|
@@ -29,8 +58,8 @@ Chart.plugins.register(annotationPlugin);
|
|
|
29
58
|
Vue.use(Chartkick.use(Chart));
|
|
30
59
|
|
|
31
60
|
// TODO: make this opt-in
|
|
32
|
-
import VueYoutube from "vue-youtube";
|
|
33
|
-
Vue.use(VueYoutube);
|
|
61
|
+
// import VueYoutube from "vue-youtube";
|
|
62
|
+
// Vue.use(VueYoutube);
|
|
34
63
|
|
|
35
64
|
// import VueAnalytics from 'vue-analytics'
|
|
36
65
|
// // TODO: Avoid hardcoding
|
|
@@ -38,32 +67,32 @@ Vue.use(VueYoutube);
|
|
|
38
67
|
// id: 'UA-146876849-1'
|
|
39
68
|
// })
|
|
40
69
|
|
|
41
|
-
import VueSocialSharing from "vue-social-sharing";
|
|
42
|
-
Vue.use(VueSocialSharing, { networks: { copy: "" } });
|
|
70
|
+
// import VueSocialSharing from "vue-social-sharing";
|
|
71
|
+
// Vue.use(VueSocialSharing, { networks: { copy: "" } });
|
|
43
72
|
|
|
44
73
|
import "./extensions/string.js";
|
|
45
74
|
import "./extensions/array.js";
|
|
46
75
|
|
|
47
76
|
// Recursive components must be global
|
|
48
|
-
import VerticalPanel from "./components/panels/vertical";
|
|
49
|
-
import ResponsivePanel from "./components/panels/responsive";
|
|
50
|
-
import Component from "./components/component";
|
|
51
|
-
import CommonIcon from "./components/_icon";
|
|
52
|
-
import CommonBadge from "./components/_badge";
|
|
53
|
-
import CommonTooltip from "./components/_tooltip";
|
|
54
|
-
import CommonButton from "./components/_button";
|
|
55
|
-
import CommonChip from "./components/_chip";
|
|
56
|
-
import CommonMessage from "./components/_message";
|
|
57
|
-
import CommonDropdownMenu from "./components/_dropdownMenu";
|
|
58
|
-
import CommonResponsive from "./components/_responsive";
|
|
59
|
-
import CommonTemplateMenu from "./templates/_menu";
|
|
60
|
-
import RichButton from "./components/button";
|
|
77
|
+
import VerticalPanel from "./components/panels/vertical.vue";
|
|
78
|
+
import ResponsivePanel from "./components/panels/responsive.vue";
|
|
79
|
+
import Component from "./components/component.vue";
|
|
80
|
+
import CommonIcon from "./components/_icon.vue";
|
|
81
|
+
// import CommonBadge from "./components/_badge.vue";
|
|
82
|
+
// import CommonTooltip from "./components/_tooltip.vue";
|
|
83
|
+
import CommonButton from "./components/_button.vue";
|
|
84
|
+
import CommonChip from "./components/_chip.vue";
|
|
85
|
+
import CommonMessage from "./components/_message.vue";
|
|
86
|
+
import CommonDropdownMenu from "./components/_dropdownMenu.vue";
|
|
87
|
+
import CommonResponsive from "./components/_responsive.vue";
|
|
88
|
+
import CommonTemplateMenu from "./templates/_menu.vue";
|
|
89
|
+
import RichButton from "./components/button.vue";
|
|
61
90
|
Vue.component("panels-vertical", VerticalPanel);
|
|
62
91
|
Vue.component("panels-responsive", ResponsivePanel);
|
|
63
92
|
Vue.component("common-button", CommonButton);
|
|
64
93
|
Vue.component("common-icon", CommonIcon);
|
|
65
|
-
Vue.component("common-badge", CommonBadge);
|
|
66
|
-
Vue.component("common-tooltip", CommonTooltip);
|
|
94
|
+
// Vue.component("common-badge", CommonBadge);
|
|
95
|
+
// Vue.component("common-tooltip", CommonTooltip);
|
|
67
96
|
Vue.component("common-chip", CommonChip);
|
|
68
97
|
Vue.component("common-message", CommonMessage);
|
|
69
98
|
Vue.component("common-dropdownMenu", CommonDropdownMenu);
|
|
@@ -91,7 +120,7 @@ Vue.mixin(scrollingMixin);
|
|
|
91
120
|
import datasetMixins from "./components/mixins/dataset.js";
|
|
92
121
|
Vue.mixin(datasetMixins);
|
|
93
122
|
|
|
94
|
-
Vue.
|
|
123
|
+
Vue.config.globalProperties.extension = {};
|
|
95
124
|
import extension from "./components/mixins/extension.js";
|
|
96
125
|
Vue.mixin(extension);
|
|
97
126
|
|
|
@@ -102,8 +131,8 @@ Vue.directive("longclick", window.longClickInstance);
|
|
|
102
131
|
// TODO: Deprecate
|
|
103
132
|
import TypeUtils from "./utils/type";
|
|
104
133
|
Vue.use({
|
|
105
|
-
install: function(Vue, options) {
|
|
106
|
-
Vue.
|
|
134
|
+
install: function (Vue, options) {
|
|
135
|
+
Vue.config.globalProperties.$type = {
|
|
107
136
|
isObject: TypeUtils.isObject,
|
|
108
137
|
isString: TypeUtils.isString,
|
|
109
138
|
isNumber: TypeUtils.isNumber,
|
|
@@ -124,7 +153,6 @@ import Framework from "./utils/public";
|
|
|
124
153
|
window.GLib = Framework;
|
|
125
154
|
|
|
126
155
|
import { settings } from "./utils/settings";
|
|
127
|
-
export { settings };
|
|
128
156
|
|
|
129
157
|
import driverCustomBehavior from "./plugins/driverCustomBehavior";
|
|
130
158
|
Vue.use(driverCustomBehavior);
|
|
@@ -141,6 +169,7 @@ Vue.use(updatableComponent);
|
|
|
141
169
|
// })
|
|
142
170
|
|
|
143
171
|
import VueGtag from "vue-gtag";
|
|
172
|
+
import eventBus from "./utils/eventBus";
|
|
144
173
|
|
|
145
174
|
document.addEventListener("DOMContentLoaded", () => {
|
|
146
175
|
const gtagId = settings.gtagId;
|
|
@@ -155,44 +184,11 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
155
184
|
});
|
|
156
185
|
}
|
|
157
186
|
|
|
158
|
-
|
|
159
|
-
vuetify: new Vuetify({
|
|
160
|
-
icons: {
|
|
161
|
-
iconfont: "md"
|
|
162
|
-
},
|
|
163
|
-
theme: {
|
|
164
|
-
themes: Utils.settings.themes
|
|
165
|
-
},
|
|
166
|
-
breakpoint: {
|
|
167
|
-
smAndDown: true
|
|
168
|
-
}
|
|
169
|
-
}),
|
|
170
|
-
page: window.__page,
|
|
171
|
-
indicator: false,
|
|
172
|
-
// Rename to isPageStale
|
|
173
|
-
isStale: false,
|
|
174
|
-
/// Dirty form handling
|
|
175
|
-
isFormSubmitted: false,
|
|
176
|
-
isFormDirty: false,
|
|
177
|
-
///
|
|
178
|
-
stateUpdatedAt: null,
|
|
179
|
-
webSocket: { channels: {}, header: {} },
|
|
180
|
-
actionCable: { channels: {} },
|
|
181
|
-
registeredComponents: [],
|
|
182
|
-
temp: {}
|
|
183
|
-
};
|
|
184
|
-
new Vue({
|
|
185
|
-
el: "#app",
|
|
186
|
-
vuetify: window.vueApp.vuetify,
|
|
187
|
-
data: {
|
|
188
|
-
vueApp: window.vueApp
|
|
189
|
-
},
|
|
190
|
-
render: function(createElement) {
|
|
191
|
-
return createElement(App, { props: { page: this.$data.vueApp.page } });
|
|
192
|
-
}
|
|
193
|
-
});
|
|
187
|
+
Vue.mount("#app")
|
|
194
188
|
});
|
|
195
189
|
|
|
190
|
+
export { Vue, settings }
|
|
191
|
+
|
|
196
192
|
// The above code uses Vue without the compiler, which means you cannot
|
|
197
193
|
// use Vue to target elements in your existing html templates. You would
|
|
198
194
|
// need to always use single file components.
|
package/keys.js
CHANGED
|
File without changes
|
package/nav/appbar.vue
CHANGED
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script>
|
|
37
|
-
import NavDrawer from "./drawer";
|
|
38
|
-
import ViewsAvatar from "../components/avatar";
|
|
37
|
+
import NavDrawer from "./drawer.vue";
|
|
38
|
+
import ViewsAvatar from "../components/avatar.vue";
|
|
39
39
|
|
|
40
40
|
export default {
|
|
41
41
|
components: {
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
},
|
|
60
60
|
// We could've used the `app` attribute on `v-toolbar` if it didn't conflict with our header-footer css.
|
|
61
61
|
leftPadding: function () {
|
|
62
|
-
switch (this.$vuetify.
|
|
62
|
+
switch (this.$vuetify.display.name) {
|
|
63
63
|
case "lg":
|
|
64
64
|
case "xl":
|
|
65
65
|
return { "padding-left": "270px" };
|
|
@@ -71,7 +71,7 @@ export default {
|
|
|
71
71
|
return this.leftPadding !== null;
|
|
72
72
|
},
|
|
73
73
|
showMobileMenu() {
|
|
74
|
-
return this.rightButtons.length > 0 && this.$vuetify.
|
|
74
|
+
return this.rightButtons.length > 0 && this.$vuetify.display.smAndDown;
|
|
75
75
|
},
|
|
76
76
|
mobileMenu() {
|
|
77
77
|
return {
|
package/nav/dialog.vue
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-dialog
|
|
3
|
-
v-model="model"
|
|
4
|
-
:width="spec.width || 600"
|
|
5
|
-
:dark="false"
|
|
6
|
-
:fullscreen="fullscreen"
|
|
7
|
-
:sm-and-down="false"
|
|
8
|
-
:persistent="true"
|
|
9
|
-
>
|
|
2
|
+
<v-dialog :width="spec.width || 600" v-model="model" :fullscreen="fullscreen" :persistent="true">
|
|
10
3
|
<v-card>
|
|
11
4
|
<v-card-title v-if="title || showClose" class="text-h5" primary-title>
|
|
12
5
|
{{ title }}
|
|
13
|
-
<v-btn v-if="showClose"
|
|
14
|
-
<v-icon>close</v-icon>
|
|
15
|
-
</v-btn>
|
|
6
|
+
<v-btn v-if="showClose" icon="close" size="small" :flat="true" class="dialog-close" @click.native="close" />
|
|
16
7
|
</v-card-title>
|
|
17
8
|
|
|
18
9
|
<component :is="containerComponent" :spec="formSpec">
|
|
@@ -27,13 +18,7 @@
|
|
|
27
18
|
<v-card-actions v-if="spec.buttons">
|
|
28
19
|
<v-spacer></v-spacer>
|
|
29
20
|
|
|
30
|
-
<v-btn
|
|
31
|
-
v-for="(button, index) in spec.buttons"
|
|
32
|
-
:key="index"
|
|
33
|
-
color="primary"
|
|
34
|
-
text
|
|
35
|
-
@click="click(button, $event)"
|
|
36
|
-
>
|
|
21
|
+
<v-btn v-for="(button, index) in spec.buttons" :key="index" color="primary" text @click="click(button, $event)">
|
|
37
22
|
{{ button.text }}
|
|
38
23
|
</v-btn>
|
|
39
24
|
|
|
@@ -46,18 +31,20 @@
|
|
|
46
31
|
<script>
|
|
47
32
|
import Http from "../utils/http";
|
|
48
33
|
import Action from "../action";
|
|
49
|
-
import FormPanel from "../components/panels/form";
|
|
34
|
+
import FormPanel from "../components/panels/form.vue";
|
|
35
|
+
import { getCurrentInstance } from "vue";
|
|
36
|
+
|
|
50
37
|
|
|
51
38
|
export default {
|
|
52
39
|
components: {
|
|
53
|
-
"panels-form": FormPanel
|
|
40
|
+
"panels-form": FormPanel,
|
|
54
41
|
},
|
|
55
42
|
props: {
|
|
56
43
|
spec: { type: Object, required: true }, // Original spec. It might be different from the latest spec (after reloading).
|
|
57
44
|
stack: { type: Array, required: true },
|
|
58
|
-
vueApp: { type: Object, required: true }
|
|
45
|
+
vueApp: { type: Object, required: true },
|
|
59
46
|
},
|
|
60
|
-
data: function() {
|
|
47
|
+
data: function () {
|
|
61
48
|
return {
|
|
62
49
|
title: null,
|
|
63
50
|
message: null,
|
|
@@ -70,7 +57,7 @@ export default {
|
|
|
70
57
|
isFormDirty: false,
|
|
71
58
|
isFormSubmitted: false,
|
|
72
59
|
isMobile: false,
|
|
73
|
-
formSpec: null
|
|
60
|
+
formSpec: null,
|
|
74
61
|
};
|
|
75
62
|
},
|
|
76
63
|
computed: {
|
|
@@ -88,15 +75,16 @@ export default {
|
|
|
88
75
|
} else {
|
|
89
76
|
return false;
|
|
90
77
|
}
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
watch: {
|
|
94
|
-
model: function(val, oldVal) {
|
|
95
|
-
if (!val) {
|
|
96
|
-
this.$destroy();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
78
|
+
},
|
|
99
79
|
},
|
|
80
|
+
// watch: {
|
|
81
|
+
// model: function (val, oldVal) {
|
|
82
|
+
// if (!val) {
|
|
83
|
+
// // this.$destroy();
|
|
84
|
+
// this.$.appContext.app.unmount()
|
|
85
|
+
// }
|
|
86
|
+
// },
|
|
87
|
+
// },
|
|
100
88
|
methods: {
|
|
101
89
|
$ready() {
|
|
102
90
|
this.$root.vueApp = this.vueApp;
|
|
@@ -140,7 +128,7 @@ export default {
|
|
|
140
128
|
this.message = "Loading...";
|
|
141
129
|
}
|
|
142
130
|
const url = Utils.url.appendParams(this.url, { _dialog: "v1" });
|
|
143
|
-
Http.execute({ url: url }, "GET", this, response => {
|
|
131
|
+
Http.execute({ url: url }, "GET", this, (response) => {
|
|
144
132
|
Utils.http.forceComponentUpdate(() => {
|
|
145
133
|
this.urlLoaded = true;
|
|
146
134
|
this.title = response.title;
|
|
@@ -161,8 +149,8 @@ export default {
|
|
|
161
149
|
}
|
|
162
150
|
|
|
163
151
|
this.model = true;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
152
|
+
},
|
|
153
|
+
},
|
|
166
154
|
};
|
|
167
155
|
</script>
|
|
168
156
|
|
|
@@ -171,11 +159,13 @@ export default {
|
|
|
171
159
|
padding: 16px 16px 20px 16px;
|
|
172
160
|
/* white-space: pre-wrap; */
|
|
173
161
|
}
|
|
162
|
+
|
|
174
163
|
.dialog-close {
|
|
175
164
|
right: 16px;
|
|
176
165
|
top: 12px;
|
|
177
166
|
position: absolute;
|
|
178
167
|
}
|
|
168
|
+
|
|
179
169
|
.v-card__text {
|
|
180
170
|
padding: 0 !important;
|
|
181
171
|
}
|
package/nav/drawer.vue
CHANGED
|
@@ -2,75 +2,62 @@
|
|
|
2
2
|
<!-- <v-navigation-drawer app fixed v-model="state" @input="updateState"> -->
|
|
3
3
|
<!-- <v-navigation-drawer mini-variant app v-model="state" @input="updateState"> -->
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
v-model="state"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
:dark="cssClasses.includes('dark')"
|
|
10
|
-
:permanent="cssClasses.includes('permanent')"
|
|
11
|
-
:style="style"
|
|
12
|
-
:expand-on-hover="expandOnHover()"
|
|
13
|
-
:mini-variant.sync="shrunk"
|
|
14
|
-
@input="updateState"
|
|
15
|
-
>
|
|
16
|
-
<template v-if="mini" v-slot:prepend>
|
|
17
|
-
<v-list-item>
|
|
18
|
-
<v-list-item-icon>
|
|
19
|
-
<v-icon v-if="!shrunk">mdi-chevron-left</v-icon>
|
|
20
|
-
<v-icon v-if="shrunk">mdi-chevron-right</v-icon>
|
|
21
|
-
</v-list-item-icon>
|
|
22
|
-
</v-list-item>
|
|
23
|
-
</template>
|
|
5
|
+
<div :class="cssClasses" :style="style">
|
|
6
|
+
<v-navigation-drawer v-model="state" app :dark="cssClasses.includes('dark') || null"
|
|
7
|
+
:permanent="cssClasses.includes('permanent')" :expand-on-hover="expandOnHover()" v-model:mini-variant="shrunk"
|
|
8
|
+
@input="updateState">
|
|
24
9
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
<template v-if="spec.header">
|
|
11
|
+
<panels-responsive :spec="spec.header" />
|
|
12
|
+
</template>
|
|
28
13
|
|
|
29
|
-
|
|
14
|
+
<glib-component v-if="spec.body" :spec="spec.body" />
|
|
30
15
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
16
|
+
<v-list :dense="true" class="pt-0">
|
|
17
|
+
<div v-for="(item, index) in spec.rows" :key="index" class="nav-item">
|
|
18
|
+
<div v-if="item.type == 'button'" class="indicator"></div>
|
|
19
|
+
<v-divider v-if="item.type == 'divider'" />
|
|
20
|
+
<nav-drawerLabel v-else-if="item.type == 'label'" :spec="item" />
|
|
21
|
+
<nav-drawerButton v-else :spec="item" />
|
|
22
|
+
</div>
|
|
23
|
+
</v-list>
|
|
39
24
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
25
|
+
<template v-if="spec.footer" v-slot:append>
|
|
26
|
+
<v-list-item>
|
|
27
|
+
<!-- Display the first line when the drawer is shrunk. Display the second line when the drawer is expanded -->
|
|
28
|
+
<div style="display: none">Show if expand</div>
|
|
29
|
+
<panels-responsive v-if="!shrunk" :spec="spec.footer" />
|
|
30
|
+
</v-list-item>
|
|
31
|
+
</template>
|
|
32
|
+
</v-navigation-drawer>
|
|
33
|
+
</div>
|
|
48
34
|
</template>
|
|
49
35
|
|
|
36
|
+
|
|
50
37
|
<script>
|
|
51
38
|
// import UrlUtils from "../utils/url";
|
|
52
|
-
import NavDrawerButton from "./drawerButton";
|
|
53
|
-
import NavDrawerLabel from "./drawerLabel";
|
|
39
|
+
import NavDrawerButton from "./drawerButton.vue";
|
|
40
|
+
import NavDrawerLabel from "./drawerLabel.vue";
|
|
54
41
|
import bus from "../utils/eventBus";
|
|
55
42
|
|
|
56
43
|
export default {
|
|
57
44
|
components: {
|
|
58
45
|
"nav-drawerButton": NavDrawerButton,
|
|
59
|
-
"nav-drawerLabel": NavDrawerLabel
|
|
46
|
+
"nav-drawerLabel": NavDrawerLabel,
|
|
60
47
|
},
|
|
61
48
|
// props: ["spec", "trigger", "permanent"],
|
|
62
49
|
props: {
|
|
63
50
|
spec: { type: Object, required: true },
|
|
64
51
|
trigger: { type: [Object, Date], default: null },
|
|
65
|
-
permanent: { type: Boolean, required: true }
|
|
52
|
+
permanent: { type: Boolean, required: true },
|
|
66
53
|
},
|
|
67
|
-
data: function() {
|
|
54
|
+
data: function () {
|
|
68
55
|
return {
|
|
69
56
|
// Using null as the starting value for its v-model will initialize the drawer as closed on mobile and as open on desktop.
|
|
70
57
|
// See https://vuetifyjs.com/en/components/navigation-drawers
|
|
71
58
|
state: null,
|
|
72
59
|
mini: true,
|
|
73
|
-
shrunk: true
|
|
60
|
+
shrunk: true,
|
|
74
61
|
};
|
|
75
62
|
},
|
|
76
63
|
computed: {
|
|
@@ -87,7 +74,7 @@ export default {
|
|
|
87
74
|
return this.$styles();
|
|
88
75
|
},
|
|
89
76
|
lgAndAbove() {
|
|
90
|
-
switch (this.$vuetify.
|
|
77
|
+
switch (this.$vuetify.display.name) {
|
|
91
78
|
case "xs":
|
|
92
79
|
case "sm":
|
|
93
80
|
case "md":
|
|
@@ -95,12 +82,12 @@ export default {
|
|
|
95
82
|
default:
|
|
96
83
|
return true;
|
|
97
84
|
}
|
|
98
|
-
}
|
|
85
|
+
},
|
|
99
86
|
},
|
|
100
87
|
watch: {
|
|
101
|
-
trigger: function(val, oldVal) {
|
|
88
|
+
trigger: function (val, oldVal) {
|
|
102
89
|
this.state = !this.state;
|
|
103
|
-
}
|
|
90
|
+
},
|
|
104
91
|
},
|
|
105
92
|
methods: {
|
|
106
93
|
$ready() {
|
|
@@ -116,8 +103,8 @@ export default {
|
|
|
116
103
|
},
|
|
117
104
|
expandOnHover() {
|
|
118
105
|
return this.mini;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
106
|
+
},
|
|
107
|
+
},
|
|
121
108
|
};
|
|
122
109
|
</script>
|
|
123
110
|
|
|
@@ -125,6 +112,7 @@ export default {
|
|
|
125
112
|
.nav-item {
|
|
126
113
|
position: relative;
|
|
127
114
|
}
|
|
115
|
+
|
|
128
116
|
.nav-item:hover .indicator,
|
|
129
117
|
.nav-item .indicator.active {
|
|
130
118
|
display: flex;
|
package/nav/drawerButton.vue
CHANGED
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
<common-icon :spec="spec.icon" />
|
|
5
5
|
</v-list-item-action>
|
|
6
6
|
|
|
7
|
-
<v-list-item-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</v-list-item-title>
|
|
13
|
-
</v-list-item-content>
|
|
7
|
+
<v-list-item-title>
|
|
8
|
+
<!-- <common-badge :spec="spec"> -->
|
|
9
|
+
{{ spec.text }}
|
|
10
|
+
<!-- </common-badge> -->
|
|
11
|
+
</v-list-item-title>
|
|
14
12
|
</v-list-item>
|
|
15
13
|
</template>
|
|
16
14
|
|
package/nav/drawerLabel.vue
CHANGED
package/nav/sheet.vue
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-
|
|
2
|
+
<v-dialog :width="600" v-model="model">
|
|
3
3
|
<v-list>
|
|
4
|
-
<v-subheader v-if="spec.message">{{ spec.message }}</v-subheader>
|
|
5
|
-
<template v-for="(button, index) of spec.buttons">
|
|
6
|
-
<v-list-item
|
|
7
|
-
:key="index"
|
|
8
|
-
color="primary"
|
|
9
|
-
@click="onClick(button, $event)"
|
|
10
|
-
>
|
|
4
|
+
<v-list-subheader v-if="spec.message">{{ spec.message }}</v-list-subheader>
|
|
5
|
+
<template v-for="(button, index) of spec.buttons" :key="index">
|
|
6
|
+
<v-list-item color="primary" @click="onClick(button, $event)">
|
|
11
7
|
<v-list-item-action v-if="button.icon">
|
|
12
8
|
<common-icon :spec="button.icon" />
|
|
13
9
|
</v-list-item-action>
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
|
|
12
|
+
<v-list-item-title>{{ button.text }}</v-list-item-title>
|
|
13
|
+
|
|
18
14
|
<!-- <v-list-item-title>{{ button.text }}</v-list-item-title> -->
|
|
19
15
|
</v-list-item>
|
|
20
16
|
</template>
|
|
21
17
|
</v-list>
|
|
22
|
-
|
|
23
|
-
<v-sheet height="60px"></v-sheet>
|
|
24
|
-
</v-bottom-sheet>
|
|
18
|
+
</v-dialog>
|
|
25
19
|
</template>
|
|
26
20
|
|
|
27
21
|
<script>
|
|
@@ -29,23 +23,23 @@ export default {
|
|
|
29
23
|
props: {
|
|
30
24
|
spec: { type: Object, required: true }
|
|
31
25
|
},
|
|
32
|
-
data: function() {
|
|
26
|
+
data: function () {
|
|
33
27
|
return {
|
|
34
|
-
model:
|
|
28
|
+
model: true
|
|
35
29
|
};
|
|
36
30
|
},
|
|
37
|
-
watch: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
31
|
+
// watch: {
|
|
32
|
+
// model: function (val, oldVal) {
|
|
33
|
+
// if (!val) {
|
|
34
|
+
// this.$destroy();
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
37
|
+
// },
|
|
44
38
|
methods: {
|
|
45
39
|
$ready() {
|
|
46
40
|
this.model = true;
|
|
47
41
|
},
|
|
48
|
-
onClick: function(spec, event) {
|
|
42
|
+
onClick: function (spec, event) {
|
|
49
43
|
this.model = false;
|
|
50
44
|
|
|
51
45
|
Utils.type.ifFunction(spec.onClickFunction, f => f());
|