glib-web 2.5.1 → 2.6.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/LICENSE +0 -0
- package/actions/auth/restart.js +0 -0
- package/actions/components/update.js +0 -15
- package/actions/dialogs/oauth.js +0 -0
- package/actions/dialogs/options.js +0 -0
- package/app.vue +24 -3
- package/components/_button.vue +7 -3
- package/components/_message.vue +0 -0
- package/components/_responsive.vue +14 -14
- package/components/component.vue +43 -12
- package/components/datetime.vue +0 -0
- package/components/fab.vue +0 -0
- package/components/fields/check.vue +0 -6
- package/components/fields/country/countries.js +0 -0
- package/components/fields/country/field.vue +0 -0
- package/components/fields/country/regions.js +0 -0
- package/components/fields/datetime.vue +0 -0
- package/components/fields/dynamicSelect.vue +0 -0
- package/components/fields/timeZone.vue +0 -0
- package/components/hr.vue +0 -0
- package/components/html.vue +0 -0
- package/components/mixins/events.js +37 -19
- package/components/mixins/longClick.js +0 -0
- package/components/mixins/scrolling.js +0 -0
- 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/form.vue +13 -12
- package/components/panels/horizontal.vue +26 -22
- package/components/panels/list.vue +7 -3
- package/components/panels/split.vue +1 -1
- package/components/panels/vertical.vue +14 -14
- package/extensions/string.js +18 -0
- package/keys.js +0 -0
- package/nav/drawerButton.vue +0 -0
- package/package.json +1 -1
- package/plugins/updatableComponent.js +7 -1
- package/settings.json.example +0 -0
- package/styles/test.sass +0 -0
- package/styles/test.scss +0 -0
- package/templates/thumbnail.vue +83 -80
- package/templates/unsupported.vue +0 -0
- package/utils/component.js +12 -0
- package/utils/dom.js +0 -0
- package/utils/http.js +5 -2
- package/utils/queue.js +0 -8
- package/utils/settings.js +0 -0
- package/utils/storage.js +0 -0
- package/utils/url.js +0 -0
package/LICENSE
CHANGED
|
File without changes
|
package/actions/auth/restart.js
CHANGED
|
File without changes
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import Vue from "vue";
|
|
2
|
-
|
|
3
1
|
export default class {
|
|
4
2
|
execute(spec, component) {
|
|
5
3
|
if (!spec.views.length > 1) {
|
|
@@ -12,17 +10,4 @@ export default class {
|
|
|
12
10
|
target.$recursiveUpdate();
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
// // TODO: Use $recursiveUpdate(). See mixins/events
|
|
17
|
-
// updateComponent(component) {
|
|
18
|
-
// component.$ready();
|
|
19
|
-
// component.$forceUpdate();
|
|
20
|
-
|
|
21
|
-
// // Execute on next tick to ensure that the child has received the updated spec.
|
|
22
|
-
// Vue.nextTick(() => {
|
|
23
|
-
// component.$children.find(child => {
|
|
24
|
-
// this.updateComponent(child);
|
|
25
|
-
// });
|
|
26
|
-
// });
|
|
27
|
-
// }
|
|
28
13
|
}
|
package/actions/dialogs/oauth.js
CHANGED
|
File without changes
|
|
File without changes
|
package/app.vue
CHANGED
|
@@ -125,15 +125,15 @@ export default {
|
|
|
125
125
|
console.warn("Analytics not setup. Set `settings.gtagId`.");
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
// Use setTimeout() to wait until page is rendered. Don't use nextTick() because
|
|
129
|
+
// it would execute much earlier (before all components finish initializing).
|
|
128
130
|
if (Utils.history.isPoppedState(this.page)) {
|
|
129
131
|
setTimeout(() => {
|
|
130
|
-
// Wait until page is rendered
|
|
131
132
|
GLib.action.execute(this.page.onRefocus, this);
|
|
132
133
|
GLib.action.execute(this.page.replayGetResponse, this);
|
|
133
134
|
});
|
|
134
135
|
} else {
|
|
135
136
|
setTimeout(() => {
|
|
136
|
-
// Wait until page is rendered
|
|
137
137
|
GLib.action.execute(this.page.onLoad, this);
|
|
138
138
|
});
|
|
139
139
|
}
|
|
@@ -194,8 +194,29 @@ body,
|
|
|
194
194
|
.glib-scrollto--highlighted {
|
|
195
195
|
background: yellow !important;
|
|
196
196
|
}
|
|
197
|
-
.
|
|
197
|
+
// Don't override the default button's effect.
|
|
198
|
+
.glib-clickable:not(.v-btn) {
|
|
198
199
|
cursor: pointer;
|
|
200
|
+
|
|
201
|
+
// // So that we can display a semi-transparent layer on hover (see below)
|
|
202
|
+
position: relative;
|
|
203
|
+
|
|
204
|
+
&:hover:before {
|
|
205
|
+
content: "\A";
|
|
206
|
+
width: 100%;
|
|
207
|
+
height: 100%;
|
|
208
|
+
background: rgba(100, 100, 100, 0.1);
|
|
209
|
+
position: absolute;
|
|
210
|
+
top: 0;
|
|
211
|
+
left: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&:active:before {
|
|
215
|
+
background: rgba(100, 100, 100, 0.2);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
.glib-clickable.theme--light.v-list-item:hover:before {
|
|
219
|
+
opacity: 1; // Override Vuetify
|
|
199
220
|
}
|
|
200
221
|
/******/
|
|
201
222
|
</style>
|
package/components/_button.vue
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
:type="type"
|
|
7
7
|
:disabled="disabled || $isBusy || spec.disabled"
|
|
8
8
|
:style="styles()"
|
|
9
|
-
:class="
|
|
9
|
+
:class="classes()"
|
|
10
10
|
:href="$href()"
|
|
11
11
|
:rel="$rel()"
|
|
12
12
|
:text="linkStyling || $classes().includes('text')"
|
|
13
|
-
:small="linkStyling"
|
|
13
|
+
:small="linkStyling || $classes().includes('small')"
|
|
14
14
|
:icon="$classes().includes('icon')"
|
|
15
15
|
:outlined="$classes().includes('outlined')"
|
|
16
16
|
:tile="$classes().includes('tile')"
|
|
@@ -50,12 +50,16 @@ export default {
|
|
|
50
50
|
});
|
|
51
51
|
},
|
|
52
52
|
styles() {
|
|
53
|
-
const styles = this
|
|
53
|
+
const styles = this.$styles();
|
|
54
54
|
if (this.linkStyling) {
|
|
55
55
|
styles["color"] = styles["color"] || "#1976d2";
|
|
56
56
|
}
|
|
57
57
|
return styles;
|
|
58
58
|
},
|
|
59
|
+
classes() {
|
|
60
|
+
const classes = this.$classes();
|
|
61
|
+
return classes;
|
|
62
|
+
},
|
|
59
63
|
$registryEnabled() {
|
|
60
64
|
return false;
|
|
61
65
|
}
|
package/components/_message.vue
CHANGED
|
File without changes
|
|
@@ -94,21 +94,21 @@ a.panels-responsive {
|
|
|
94
94
|
color: inherit;
|
|
95
95
|
text-decoration: inherit;
|
|
96
96
|
|
|
97
|
-
// So that we can display a semi-transparent layer on hover (see below)
|
|
98
|
-
position: relative;
|
|
97
|
+
// // So that we can display a semi-transparent layer on hover (see below)
|
|
98
|
+
// position: relative;
|
|
99
99
|
|
|
100
|
-
&:hover:after {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
100
|
+
// &:hover:after {
|
|
101
|
+
// content: "\A";
|
|
102
|
+
// width: 100%;
|
|
103
|
+
// height: 100%;
|
|
104
|
+
// background: rgba(0, 0, 0, 0.1);
|
|
105
|
+
// position: absolute;
|
|
106
|
+
// top: 0;
|
|
107
|
+
// left: 0;
|
|
108
|
+
// }
|
|
109
109
|
|
|
110
|
-
&:active:after {
|
|
111
|
-
|
|
112
|
-
}
|
|
110
|
+
// &:active:after {
|
|
111
|
+
// background: rgba(0, 0, 0, 0.4);
|
|
112
|
+
// }
|
|
113
113
|
}
|
|
114
114
|
</style>
|
package/components/component.vue
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<fields-text
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<fields-text
|
|
3
|
+
v-if="name == 'fields-text'"
|
|
4
|
+
ref="delegate"
|
|
5
|
+
:spec="spec"
|
|
6
|
+
type="text"
|
|
7
|
+
/>
|
|
8
|
+
<fields-text
|
|
9
|
+
v-else-if="name == 'fields-number'"
|
|
10
|
+
ref="delegate"
|
|
11
|
+
:spec="spec"
|
|
12
|
+
type="number"
|
|
13
|
+
/>
|
|
14
|
+
<fields-text
|
|
15
|
+
v-else-if="name == 'fields-email'"
|
|
16
|
+
ref="delegate"
|
|
17
|
+
:spec="spec"
|
|
18
|
+
type="email"
|
|
19
|
+
/>
|
|
20
|
+
<fields-text
|
|
21
|
+
v-else-if="name == 'fields-url'"
|
|
22
|
+
ref="delegate"
|
|
23
|
+
:spec="spec"
|
|
24
|
+
type="url"
|
|
25
|
+
/>
|
|
6
26
|
<fields-text
|
|
7
27
|
v-else-if="name == 'fields-password'"
|
|
28
|
+
ref="delegate"
|
|
8
29
|
:spec="spec"
|
|
9
30
|
type="password"
|
|
10
31
|
/>
|
|
@@ -21,12 +42,19 @@
|
|
|
21
42
|
<!-- <fields-latLong v-else-if="spec.view == 'fields/latLong-v1'" :spec="spec" /> -->
|
|
22
43
|
<fields-googlePlace
|
|
23
44
|
v-else-if="spec.view == 'fields/googlePlace-v1'"
|
|
45
|
+
ref="delegate"
|
|
24
46
|
:spec="spec"
|
|
25
47
|
/>
|
|
26
48
|
|
|
27
49
|
<!-- <panels-responsive v-else-if="spec.view == 'panels/scroll-v1'" :spec="spec" /> -->
|
|
28
50
|
|
|
29
|
-
<component
|
|
51
|
+
<component
|
|
52
|
+
:is="name"
|
|
53
|
+
v-else-if="name"
|
|
54
|
+
:id="spec.id"
|
|
55
|
+
ref="delegate"
|
|
56
|
+
:spec="spec"
|
|
57
|
+
/>
|
|
30
58
|
|
|
31
59
|
<div v-else>Unsupported view: {{ spec.view }}</div>
|
|
32
60
|
</template>
|
|
@@ -216,13 +244,13 @@ export default {
|
|
|
216
244
|
name: null
|
|
217
245
|
};
|
|
218
246
|
},
|
|
219
|
-
beforeUpdate() {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
},
|
|
247
|
+
// beforeUpdate() {
|
|
248
|
+
// // NOTE: Not sure what this is for
|
|
249
|
+
// // Make sure vuejs will not attempt to render old data.
|
|
250
|
+
// // if (this._mountedUrl !== window.location.href) {
|
|
251
|
+
// // this.name = null;
|
|
252
|
+
// // }
|
|
253
|
+
// },
|
|
226
254
|
methods: {
|
|
227
255
|
$ready() {
|
|
228
256
|
const name = Utils.app.componentName(this.spec.view);
|
|
@@ -235,6 +263,9 @@ export default {
|
|
|
235
263
|
}
|
|
236
264
|
}
|
|
237
265
|
},
|
|
266
|
+
$update() {
|
|
267
|
+
this.$refs.delegate.$update();
|
|
268
|
+
},
|
|
238
269
|
$registryEnabled() {
|
|
239
270
|
return false;
|
|
240
271
|
}
|
package/components/datetime.vue
CHANGED
|
File without changes
|
package/components/fab.vue
CHANGED
|
File without changes
|
|
@@ -58,12 +58,6 @@ export default {
|
|
|
58
58
|
);
|
|
59
59
|
}, 100);
|
|
60
60
|
|
|
61
|
-
// if (this.spec.submitOnChange) {
|
|
62
|
-
// setTimeout(() => {
|
|
63
|
-
// this.$dispatchEvent("forms/submit");
|
|
64
|
-
// }, 200);
|
|
65
|
-
// }
|
|
66
|
-
|
|
67
61
|
Utils.type.ifObject(this.spec.onChange, onChange => {
|
|
68
62
|
this.$nextTick(() => {
|
|
69
63
|
GLib.action.execute(onChange, this);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/components/hr.vue
CHANGED
|
File without changes
|
package/components/html.vue
CHANGED
|
File without changes
|
|
@@ -29,21 +29,38 @@ export default {
|
|
|
29
29
|
this.$created();
|
|
30
30
|
},
|
|
31
31
|
mounted() {
|
|
32
|
-
this._executeIfReady(false);
|
|
32
|
+
// this._executeIfReady(false);
|
|
33
|
+
this._ready();
|
|
33
34
|
this.$mounted();
|
|
34
35
|
},
|
|
35
36
|
updated() {
|
|
36
|
-
this.
|
|
37
|
+
if (!this._renderingTheSamePage()) {
|
|
38
|
+
this.$tearDown();
|
|
39
|
+
this._ready();
|
|
40
|
+
}
|
|
41
|
+
// this._executeIfReady(true);
|
|
37
42
|
this.$updated();
|
|
38
43
|
},
|
|
44
|
+
// _executeIfReady(updated) {
|
|
45
|
+
// if (updated) {
|
|
46
|
+
// if (!this._renderingTheSamePage()) {
|
|
47
|
+
// this.$tearDown();
|
|
48
|
+
// this._ready();
|
|
49
|
+
// }
|
|
50
|
+
// } else {
|
|
51
|
+
// this._ready();
|
|
52
|
+
// }
|
|
53
|
+
// },
|
|
39
54
|
destroyed() {
|
|
40
55
|
this.$tearDown();
|
|
41
56
|
},
|
|
42
57
|
watch: {
|
|
43
58
|
// See Utils.http
|
|
44
59
|
"$root.vueApp.isStale": function(val, oldVal) {
|
|
45
|
-
|
|
46
|
-
|
|
60
|
+
if (val === true) {
|
|
61
|
+
// Make sure $ready() will be called in the next update
|
|
62
|
+
this._mountedUrl = null;
|
|
63
|
+
}
|
|
47
64
|
}
|
|
48
65
|
},
|
|
49
66
|
methods: {
|
|
@@ -102,16 +119,6 @@ export default {
|
|
|
102
119
|
window.removeEventListener("resize", handler);
|
|
103
120
|
this._pageBody.removeEventListener("scroll", handler);
|
|
104
121
|
},
|
|
105
|
-
_executeIfReady(updated) {
|
|
106
|
-
if (updated) {
|
|
107
|
-
if (!this._renderingTheSamePage()) {
|
|
108
|
-
this.$tearDown();
|
|
109
|
-
this._ready();
|
|
110
|
-
}
|
|
111
|
-
} else {
|
|
112
|
-
this._ready();
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
122
|
_renderingTheSamePage() {
|
|
116
123
|
return this._mountedUrl === window.location.href;
|
|
117
124
|
},
|
|
@@ -152,8 +159,15 @@ export default {
|
|
|
152
159
|
$updated() {
|
|
153
160
|
// To be overridden
|
|
154
161
|
},
|
|
155
|
-
|
|
162
|
+
// Override to provide customization
|
|
163
|
+
$update() {
|
|
164
|
+
// This causes user input getting removed which is not what we want in some situations.
|
|
165
|
+
// // This is so that the field's value gets updated to the new `value` property.
|
|
166
|
+
// this._linkFieldModels();
|
|
156
167
|
this.$ready();
|
|
168
|
+
},
|
|
169
|
+
$recursiveUpdate() {
|
|
170
|
+
this.$update();
|
|
157
171
|
this.$forceUpdate();
|
|
158
172
|
|
|
159
173
|
// Execute on next tick to ensure that the child has received the updated spec.
|
|
@@ -193,11 +207,15 @@ export default {
|
|
|
193
207
|
Utils.type.ifObject(this.spec.onChange, onChange => {
|
|
194
208
|
this.$nextTick(() => {
|
|
195
209
|
const value = newValue || this.fieldModel;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
210
|
+
|
|
211
|
+
const formData = {
|
|
212
|
+
[this.fieldName]: value
|
|
200
213
|
};
|
|
214
|
+
const params = this.spec.paramNameForFormData
|
|
215
|
+
? {
|
|
216
|
+
[this.spec.paramNameForFormData]: formData
|
|
217
|
+
}
|
|
218
|
+
: formData;
|
|
201
219
|
const data = Object.assign({}, onChange, params);
|
|
202
220
|
GLib.action.execute(data, this);
|
|
203
221
|
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/components/p.vue
CHANGED
|
File without changes
|
|
@@ -78,20 +78,21 @@ export default {
|
|
|
78
78
|
this.url = url;
|
|
79
79
|
this.params = params;
|
|
80
80
|
|
|
81
|
-
let firstAutoFocus = false;
|
|
82
81
|
this.modifiedSpec = this.spec;
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
childView.view.startsWith("fields/") &&
|
|
86
|
-
childView.view !== "fields/hidden-v1" &&
|
|
87
|
-
!firstAutoFocus
|
|
88
|
-
) {
|
|
89
|
-
childView.autoFocus = true;
|
|
90
|
-
firstAutoFocus = true;
|
|
91
|
-
}
|
|
82
|
+
if (this.spec.autoFocus) {
|
|
83
|
+
let firstAutoFocus = false;
|
|
92
84
|
|
|
93
|
-
|
|
94
|
-
|
|
85
|
+
this.modifiedSpec.childViews.forEach(childView => {
|
|
86
|
+
if (
|
|
87
|
+
childView.view.startsWith("fields/") &&
|
|
88
|
+
childView.view !== "fields/hidden-v1" &&
|
|
89
|
+
!firstAutoFocus
|
|
90
|
+
) {
|
|
91
|
+
childView.autoFocus = true;
|
|
92
|
+
firstAutoFocus = true;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
95
96
|
},
|
|
96
97
|
onSubmit(event) {
|
|
97
98
|
event.preventDefault();
|
|
@@ -92,7 +92,10 @@ export default {
|
|
|
92
92
|
return styles;
|
|
93
93
|
},
|
|
94
94
|
childStyles() {
|
|
95
|
-
const styles = {
|
|
95
|
+
const styles = {
|
|
96
|
+
width: "100%",
|
|
97
|
+
height: "100%"
|
|
98
|
+
};
|
|
96
99
|
|
|
97
100
|
switch (this.spec.align) {
|
|
98
101
|
case "middle":
|
|
@@ -114,7 +117,7 @@ export default {
|
|
|
114
117
|
methods: {
|
|
115
118
|
$ready() {
|
|
116
119
|
this.dragSupport = this.spec.dragSupport;
|
|
117
|
-
this.childViews = this.spec.childViews;
|
|
120
|
+
this.childViews = this.spec.childViews || [];
|
|
118
121
|
},
|
|
119
122
|
$displayValue() {
|
|
120
123
|
return "flex";
|
|
@@ -132,7 +135,8 @@ export default {
|
|
|
132
135
|
return;
|
|
133
136
|
}
|
|
134
137
|
|
|
135
|
-
|
|
138
|
+
// Ensure $ready() of its children gets called.
|
|
139
|
+
this.$recursiveUpdate();
|
|
136
140
|
|
|
137
141
|
const itemId = event.clone.dataset.dragitemid; // The item that got dragged/dropped
|
|
138
142
|
const oldPanelId = event.from.dataset.dragpanelid;
|
|
@@ -148,11 +152,11 @@ export default {
|
|
|
148
152
|
}
|
|
149
153
|
});
|
|
150
154
|
|
|
151
|
-
console.log("DRAG2", mergedSpec, event.clone, event);
|
|
152
|
-
|
|
153
155
|
GLib.action.execute(mergedSpec, this);
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
},
|
|
157
|
+
action_merge(mergedSpec) {
|
|
158
|
+
Object.assign(this.spec, mergedSpec);
|
|
159
|
+
this.$ready();
|
|
156
160
|
}
|
|
157
161
|
}
|
|
158
162
|
};
|
|
@@ -173,22 +177,22 @@ a.panels-horizontal {
|
|
|
173
177
|
color: inherit;
|
|
174
178
|
text-decoration: inherit;
|
|
175
179
|
|
|
176
|
-
// So that we can display a semi-transparent layer on hover (see below)
|
|
177
|
-
position: relative;
|
|
178
|
-
|
|
179
|
-
&:hover:after {
|
|
180
|
-
content: "\A";
|
|
181
|
-
width: 100%;
|
|
182
|
-
height: 100%;
|
|
183
|
-
background: rgba(0, 0, 0, 0.2);
|
|
184
|
-
position: absolute;
|
|
185
|
-
top: 0;
|
|
186
|
-
left: 0;
|
|
187
|
-
}
|
|
180
|
+
// // So that we can display a semi-transparent layer on hover (see below)
|
|
181
|
+
// position: relative;
|
|
188
182
|
|
|
189
|
-
&:
|
|
190
|
-
|
|
191
|
-
|
|
183
|
+
// &:hover:after {
|
|
184
|
+
// content: "\A";
|
|
185
|
+
// width: 100%;
|
|
186
|
+
// height: 100%;
|
|
187
|
+
// background: rgba(0, 0, 0, 0.2);
|
|
188
|
+
// position: absolute;
|
|
189
|
+
// top: 0;
|
|
190
|
+
// left: 0;
|
|
191
|
+
// }
|
|
192
|
+
|
|
193
|
+
// &:active:after {
|
|
194
|
+
// background: rgba(0, 0, 0, 0.4);
|
|
195
|
+
// }
|
|
192
196
|
}
|
|
193
197
|
</style>
|
|
194
198
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
:ref="`row_${sectionIndex}_${rowIndex}`"
|
|
33
33
|
:data-dragRowId="row.id"
|
|
34
34
|
>
|
|
35
|
-
<v-divider v-if="!spec.responsiveCols && rowIndex == 0" />
|
|
35
|
+
<!-- <v-divider v-if="!spec.responsiveCols && rowIndex == 0" /> -->
|
|
36
36
|
|
|
37
37
|
<component
|
|
38
38
|
:is="template(row)"
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
:responsive-cols="spec.responsiveCols"
|
|
41
41
|
:index="rowIndex"
|
|
42
42
|
/>
|
|
43
|
-
<v-divider
|
|
43
|
+
<!-- <v-divider
|
|
44
44
|
v-if="
|
|
45
45
|
!spec.responsiveCols &&
|
|
46
46
|
(rowIndex != section.rows.length - 1 ||
|
|
47
47
|
sectionIndex != sections.length - 1)
|
|
48
48
|
"
|
|
49
|
-
/>
|
|
49
|
+
/> -->
|
|
50
50
|
</div>
|
|
51
51
|
</draggable>
|
|
52
52
|
|
|
@@ -230,6 +230,10 @@ export default {
|
|
|
230
230
|
console.log("Reordering canceled");
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
|
+
|
|
234
|
+
// Ensure $ready() of its children gets called.
|
|
235
|
+
this.$recursiveUpdate();
|
|
236
|
+
|
|
233
237
|
const targetSectionIndex = this.getSectionIndex(event.to);
|
|
234
238
|
// const targetSection = this.getSection(targetSectionIndex);
|
|
235
239
|
|
|
@@ -72,22 +72,22 @@ a.panels-vertical {
|
|
|
72
72
|
color: inherit;
|
|
73
73
|
text-decoration: inherit;
|
|
74
74
|
|
|
75
|
-
// So that we can display a semi-transparent layer on hover (see below)
|
|
76
|
-
position: relative;
|
|
75
|
+
// // So that we can display a semi-transparent layer on hover (see below)
|
|
76
|
+
// position: relative;
|
|
77
77
|
|
|
78
|
-
&:hover:after {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
78
|
+
// &:hover:after {
|
|
79
|
+
// content: "\A";
|
|
80
|
+
// width: 100%;
|
|
81
|
+
// height: 100%;
|
|
82
|
+
// background: rgba(0, 0, 0, 0.2);
|
|
83
|
+
// position: absolute;
|
|
84
|
+
// top: 0;
|
|
85
|
+
// left: 0;
|
|
86
|
+
// }
|
|
87
87
|
|
|
88
|
-
&:active:after {
|
|
89
|
-
|
|
90
|
-
}
|
|
88
|
+
// &:active:after {
|
|
89
|
+
// background: rgba(0, 0, 0, 0.4);
|
|
90
|
+
// }
|
|
91
91
|
}
|
|
92
92
|
</style>
|
|
93
93
|
|
package/extensions/string.js
CHANGED
|
@@ -23,3 +23,21 @@ String.prototype.presence = function() {
|
|
|
23
23
|
String.prototype.truncate = function(n) {
|
|
24
24
|
return this.length > n ? this.slice(0, n - 1) + "..." : this.toString();
|
|
25
25
|
};
|
|
26
|
+
|
|
27
|
+
// See https://stackoverflow.com/questions/3586775/what-is-the-correct-way-to-check-for-string-equality-in-javascript
|
|
28
|
+
String.prototype.equals = function(str) {
|
|
29
|
+
// Perform comparison on the primitive string values
|
|
30
|
+
return this.valueOf() == str.valueOf();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
String.prototype.compare = function(str) {
|
|
34
|
+
const str1 = this.valueOf();
|
|
35
|
+
const str2 = str.valueOf();
|
|
36
|
+
if (str1 < str2) {
|
|
37
|
+
return -1;
|
|
38
|
+
}
|
|
39
|
+
if (str1 > str2) {
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
return 0;
|
|
43
|
+
};
|
package/keys.js
CHANGED
|
File without changes
|
package/nav/drawerButton.vue
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
install: (Vue, options) => {
|
|
3
3
|
Vue.mixin({
|
|
4
|
-
|
|
4
|
+
mounted: function() {
|
|
5
5
|
let spec = this.spec;
|
|
6
6
|
if (spec && spec.id && this.$registryEnabled()) {
|
|
7
7
|
GLib.component.register(spec.id, this);
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
+
destroyed: function() {
|
|
11
|
+
let spec = this.spec;
|
|
12
|
+
if (spec && spec.id && this.$registryEnabled()) {
|
|
13
|
+
GLib.component.deregister(spec.id);
|
|
14
|
+
}
|
|
15
|
+
},
|
|
10
16
|
methods: {
|
|
11
17
|
$registryEnabled() {
|
|
12
18
|
// Common classes such as `_select` need to return false so that it doesn't override its parent (e.g. `select`).
|
package/settings.json.example
CHANGED
|
File without changes
|
package/styles/test.sass
CHANGED
|
File without changes
|
package/styles/test.scss
CHANGED
|
File without changes
|
package/templates/thumbnail.vue
CHANGED
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<template v-for="(item, index) in spec.leftOuterButtons">
|
|
9
|
-
<common-button
|
|
10
|
-
:key="index"
|
|
11
|
-
:spec="buttonSpec(item)"
|
|
12
|
-
:disabled="$isBusy"
|
|
13
|
-
/>
|
|
14
|
-
</template>
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<v-list-item
|
|
18
|
-
v-longclick="$onLongPress"
|
|
19
|
-
:href="$href()"
|
|
20
|
-
class="item-content"
|
|
21
|
-
:style="columnStyles()"
|
|
22
|
-
@[clickCondition]="$onClick()"
|
|
23
|
-
>
|
|
24
|
-
<!-- <v-icon v-if="spec.onReorder" class="handle">drag_indicator</v-icon> -->
|
|
25
|
-
|
|
26
|
-
<!-- Specify a key to prevent reuse which causes an issue where the checkbox would use the previous name. -->
|
|
27
|
-
<fields-check v-if="checkSpec" :key="checkSpec.name" :spec="checkSpec" />
|
|
28
|
-
|
|
29
|
-
<div v-if="spec.leftButtons" class="left-universal">
|
|
30
|
-
<template v-for="(item, index) in spec.leftButtons">
|
|
31
|
-
<rich-button
|
|
2
|
+
<div class="thumbnail" :class="cssClasses" @[clickCondition]="$onClick()">
|
|
3
|
+
<panels-responsive :spec="spec.header" />
|
|
4
|
+
<div style="display:flex;">
|
|
5
|
+
<div v-if="spec.leftOuterButtons" style="display:flex; margin-top:10px;">
|
|
6
|
+
<template v-for="(item, index) in spec.leftOuterButtons">
|
|
7
|
+
<common-button
|
|
32
8
|
:key="index"
|
|
33
9
|
:spec="buttonSpec(item)"
|
|
34
10
|
:disabled="$isBusy"
|
|
@@ -36,59 +12,83 @@
|
|
|
36
12
|
</template>
|
|
37
13
|
</div>
|
|
38
14
|
|
|
39
|
-
<v-list-item
|
|
40
|
-
v-
|
|
41
|
-
:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
:size="spec.imageSize"
|
|
15
|
+
<v-list-item
|
|
16
|
+
v-longclick="$onLongPress"
|
|
17
|
+
:href="$href()"
|
|
18
|
+
class="item-content"
|
|
19
|
+
:style="columnStyles()"
|
|
45
20
|
>
|
|
46
|
-
<
|
|
47
|
-
</v-list-item-avatar>
|
|
48
|
-
<!-- <v-list-item-avatar v-else-if="$type.isObject(spec.icon)">
|
|
49
|
-
<common-icon :spec="spec.icon" />
|
|
50
|
-
</v-list-item-avatar> -->
|
|
51
|
-
<div v-else class="left-icon">
|
|
52
|
-
<v-list-item-avatar v-if="$type.isObject(spec.icon)">
|
|
53
|
-
<common-icon :spec="spec.icon" />
|
|
54
|
-
</v-list-item-avatar>
|
|
55
|
-
</div>
|
|
21
|
+
<!-- <v-icon v-if="spec.onReorder" class="handle">drag_indicator</v-icon> -->
|
|
56
22
|
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
v-if="
|
|
60
|
-
:
|
|
61
|
-
:
|
|
23
|
+
<!-- Specify a key to prevent reuse which causes an issue where the checkbox would use the previous name. -->
|
|
24
|
+
<fields-check
|
|
25
|
+
v-if="checkSpec"
|
|
26
|
+
:key="checkSpec.name"
|
|
27
|
+
:spec="checkSpec"
|
|
62
28
|
/>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<div class="chips">
|
|
73
|
-
<template v-for="(item, index) in chips">
|
|
74
|
-
<common-chip :key="index" :spec="item" />
|
|
29
|
+
|
|
30
|
+
<div v-if="spec.leftButtons">
|
|
31
|
+
<template v-for="(item, index) in spec.leftButtons">
|
|
32
|
+
<rich-button
|
|
33
|
+
:key="index"
|
|
34
|
+
:spec="buttonSpec(item)"
|
|
35
|
+
:disabled="$isBusy"
|
|
36
|
+
/>
|
|
75
37
|
</template>
|
|
76
38
|
</div>
|
|
77
39
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
40
|
+
<v-list-item-avatar
|
|
41
|
+
v-if="$type.isString(spec.imageUrl)"
|
|
42
|
+
:tile="!spec.avatar"
|
|
43
|
+
style="display:flex;"
|
|
44
|
+
class="left-thumbnail"
|
|
45
|
+
:size="spec.imageSize"
|
|
46
|
+
>
|
|
47
|
+
<img :src="spec.imageUrl" />
|
|
48
|
+
</v-list-item-avatar>
|
|
81
49
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
50
|
+
<div v-else class="left-icon">
|
|
51
|
+
<v-list-item-avatar v-if="$type.isObject(spec.icon)">
|
|
52
|
+
<common-icon :spec="spec.icon" />
|
|
53
|
+
</v-list-item-avatar>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<v-list-item-content style="display:flex;">
|
|
57
|
+
<v-text-field
|
|
58
|
+
v-if="spec.fieldTitleName"
|
|
59
|
+
:name="spec.fieldTitleName"
|
|
60
|
+
:value="spec.title"
|
|
61
|
+
/>
|
|
62
|
+
<v-list-item-title v-else>{{ spec.title }}</v-list-item-title>
|
|
89
63
|
|
|
90
|
-
|
|
91
|
-
|
|
64
|
+
<v-list-item-subtitle v-if="spec.subtitle">{{
|
|
65
|
+
spec.subtitle
|
|
66
|
+
}}</v-list-item-subtitle>
|
|
67
|
+
<v-list-item-subtitle v-if="spec.subsubtitle">{{
|
|
68
|
+
spec.subsubtitle
|
|
69
|
+
}}</v-list-item-subtitle>
|
|
70
|
+
|
|
71
|
+
<div class="chips">
|
|
72
|
+
<template v-for="(item, index) in chips">
|
|
73
|
+
<common-chip :key="index" :spec="item" />
|
|
74
|
+
</template>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<panels-responsive :spec="spec.body" />
|
|
78
|
+
</v-list-item-content>
|
|
79
|
+
|
|
80
|
+
<template v-for="(item, index) in spec.rightButtons">
|
|
81
|
+
<rich-button
|
|
82
|
+
:key="index"
|
|
83
|
+
:spec="buttonSpec(item)"
|
|
84
|
+
:disabled="$isBusy"
|
|
85
|
+
/>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<templates-menu :edit-buttons="editButtons" />
|
|
89
|
+
</v-list-item>
|
|
90
|
+
</div>
|
|
91
|
+
<panels-responsive :spec="spec.footer" />
|
|
92
92
|
</div>
|
|
93
93
|
</template>
|
|
94
94
|
|
|
@@ -169,9 +169,12 @@ export default {
|
|
|
169
169
|
this.editButtons = this.spec.editButtons || [];
|
|
170
170
|
},
|
|
171
171
|
buttonSpec(item) {
|
|
172
|
+
// return Object.assign({}, item, {
|
|
173
|
+
// view: "button-v1",
|
|
174
|
+
// styleClasses: item.text ? ["text"] : ["icon"]
|
|
175
|
+
// });
|
|
172
176
|
return Object.assign({}, item, {
|
|
173
|
-
view: "button-v1"
|
|
174
|
-
styleClasses: item.text ? ["text"] : ["icon"]
|
|
177
|
+
view: "button-v1"
|
|
175
178
|
});
|
|
176
179
|
},
|
|
177
180
|
columnStyles() {
|
|
@@ -206,9 +209,9 @@ export default {
|
|
|
206
209
|
// margin-left: 16px;
|
|
207
210
|
margin-left: 4px;
|
|
208
211
|
}
|
|
209
|
-
.left-universal {
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
+
// .left-universal {
|
|
213
|
+
// padding-left: 16px;
|
|
214
|
+
// }
|
|
212
215
|
// .handle {
|
|
213
216
|
// // margin-left: 10px;
|
|
214
217
|
// cursor: move;
|
|
File without changes
|
package/utils/component.js
CHANGED
|
@@ -2,6 +2,7 @@ export default class {
|
|
|
2
2
|
static get _registry() {
|
|
3
3
|
return window.vueApp.registeredComponents;
|
|
4
4
|
}
|
|
5
|
+
|
|
5
6
|
static findById(id) {
|
|
6
7
|
const component = this._registry[id];
|
|
7
8
|
if (component) {
|
|
@@ -9,6 +10,11 @@ export default class {
|
|
|
9
10
|
}
|
|
10
11
|
console.error("Component not found: " + id);
|
|
11
12
|
}
|
|
13
|
+
|
|
14
|
+
// static clearRegistry() {
|
|
15
|
+
// window.vueApp.registeredComponents = {};
|
|
16
|
+
// }
|
|
17
|
+
|
|
12
18
|
static register(id, component) {
|
|
13
19
|
if (this._registry[id]) {
|
|
14
20
|
console.warn(
|
|
@@ -20,8 +26,14 @@ export default class {
|
|
|
20
26
|
this.vueName(component)
|
|
21
27
|
);
|
|
22
28
|
}
|
|
29
|
+
|
|
23
30
|
this._registry[id] = component;
|
|
24
31
|
}
|
|
32
|
+
|
|
33
|
+
static deregister(id) {
|
|
34
|
+
delete this._registry[id];
|
|
35
|
+
}
|
|
36
|
+
|
|
25
37
|
static vueName(component) {
|
|
26
38
|
return component.$options._componentTag;
|
|
27
39
|
}
|
package/utils/dom.js
CHANGED
|
File without changes
|
package/utils/http.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Type from "./type";
|
|
2
2
|
import Action from "../action";
|
|
3
|
+
import Vue from "vue";
|
|
3
4
|
|
|
4
5
|
let loading = false;
|
|
5
6
|
const dirtyPrompt = "Changes you made have not been saved. Are you sure?";
|
|
@@ -206,17 +207,19 @@ export default class {
|
|
|
206
207
|
|
|
207
208
|
// See generic.js
|
|
208
209
|
static forceComponentUpdate(handler) {
|
|
210
|
+
// GLib.component.clearRegistry();
|
|
211
|
+
|
|
209
212
|
const dirtyContext = this.dirtyContext();
|
|
210
213
|
|
|
211
214
|
window.vueApp.isStale = true;
|
|
212
215
|
|
|
213
216
|
// Queue the execution so the first isStale has time to resets state before handler gets executed
|
|
214
|
-
|
|
217
|
+
Vue.nextTick(() => {
|
|
215
218
|
dirtyContext.isFormSubmitted = false;
|
|
216
219
|
dirtyContext.isFormDirty = false;
|
|
217
220
|
handler();
|
|
218
221
|
window.vueApp.isStale = false;
|
|
219
|
-
}
|
|
222
|
+
});
|
|
220
223
|
}
|
|
221
224
|
|
|
222
225
|
static promptIfDirtyOnUnload() {
|
package/utils/queue.js
CHANGED
|
@@ -54,14 +54,6 @@ export default class {
|
|
|
54
54
|
console.log("Waiting for next job2...");
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
// console.log("JOB1");
|
|
58
|
-
// const job = this.dequeue();
|
|
59
|
-
// console.log("JOB2", job);
|
|
60
|
-
// job();
|
|
61
|
-
// Vue.nextTick(() => {
|
|
62
|
-
// this.start();
|
|
63
|
-
// });
|
|
64
|
-
// await this.next();
|
|
65
57
|
}
|
|
66
58
|
[Symbol.asyncIterator]() {
|
|
67
59
|
// Todo: Use AsyncIterator.from()
|
package/utils/settings.js
CHANGED
|
File without changes
|
package/utils/storage.js
CHANGED
|
File without changes
|
package/utils/url.js
CHANGED
|
File without changes
|