glib-web 0.5.95 → 0.5.99
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/check.vue +12 -29
- package/components/fields/checkGroup.vue +0 -11
- package/components/fields/location.vue +198 -223
- package/components/fields/radio.vue +0 -48
- package/components/fields/radioGroup.vue +42 -93
- package/components/h2.vue +9 -1
- package/components/h3.vue +8 -1
- package/components/h4.vue +9 -1
- package/components/h5.vue +9 -1
- package/components/h6.vue +9 -1
- package/components/panels/form.vue +4 -0
- package/components/panels/responsive.vue +94 -88
- package/nav/appbar.vue +18 -2
- package/nav/drawer.vue +18 -2
- package/package.json +1 -1
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="$classes()">
|
|
2
|
+
<div :class="$classes()" :style="$styles()">
|
|
3
3
|
<fields-hidden v-if="uncheckSpec" :spec="uncheckSpec" />
|
|
4
4
|
<v-checkbox
|
|
5
5
|
v-model="fieldModel"
|
|
6
6
|
:name="fieldName"
|
|
7
7
|
:value="spec.checkValue"
|
|
8
|
-
:label="spec.label"
|
|
8
|
+
:label="fieldModel ? spec.onLabel || spec.label : spec.label"
|
|
9
|
+
:on-icon="spec.onIcon"
|
|
10
|
+
:off-icon="spec.offIcon"
|
|
9
11
|
hide-details
|
|
10
12
|
@change="changed"
|
|
11
13
|
></v-checkbox>
|
|
12
|
-
<!-- <v-switch
|
|
13
|
-
v-if="fieldType == 'switch'"
|
|
14
|
-
v-model="fieldModel"
|
|
15
|
-
:name="fieldName"
|
|
16
|
-
:value="spec.checkValue"
|
|
17
|
-
:label="spec.label"
|
|
18
|
-
hide-details
|
|
19
|
-
@change="changed"
|
|
20
|
-
>
|
|
21
|
-
</v-switch> -->
|
|
22
14
|
</div>
|
|
23
15
|
</template>
|
|
24
16
|
|
|
@@ -34,25 +26,11 @@ export default {
|
|
|
34
26
|
},
|
|
35
27
|
data() {
|
|
36
28
|
return {
|
|
37
|
-
// groupElement: null,
|
|
38
29
|
groupName: null,
|
|
39
30
|
fieldType: null,
|
|
40
31
|
uncheckSpec: null
|
|
41
32
|
};
|
|
42
33
|
},
|
|
43
|
-
// mounted() {
|
|
44
|
-
// // // TODO: probably need fixing
|
|
45
|
-
// // this.groupElement = this.$el.closest("[data-component=checkGroup]");
|
|
46
|
-
// // console.log(
|
|
47
|
-
// // `groupElement: ${this.groupElement} -- ${this.groupElement.getAttribute(
|
|
48
|
-
// // "name"
|
|
49
|
-
// // )}`
|
|
50
|
-
// // );
|
|
51
|
-
// // this.$type.ifObject(
|
|
52
|
-
// // this.groupElement,
|
|
53
|
-
// // val => (this.groupName = val.getAttribute("name"))
|
|
54
|
-
// // );
|
|
55
|
-
// },
|
|
56
34
|
methods: {
|
|
57
35
|
$ready() {
|
|
58
36
|
this.groupElement = this.$el.closest("[data-component=checkGroup]");
|
|
@@ -80,12 +58,17 @@ export default {
|
|
|
80
58
|
},
|
|
81
59
|
changed(event) {
|
|
82
60
|
// Execute later to ensure the checkbox's checked state has been updated.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
vm.$type.ifObject(vm.groupElement, val =>
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
this.$type.ifObject(this.groupElement, val =>
|
|
86
63
|
val.dispatchEvent(new Event("change"))
|
|
87
64
|
);
|
|
88
65
|
}, 100);
|
|
66
|
+
|
|
67
|
+
if (this.spec.submitOnChange) {
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
this.$dispatchEvent("forms/submit");
|
|
70
|
+
}, 200);
|
|
71
|
+
}
|
|
89
72
|
}
|
|
90
73
|
}
|
|
91
74
|
};
|
|
@@ -28,17 +28,6 @@ export default {
|
|
|
28
28
|
return { name: this.spec.name, value: this.spec.uncheckValue };
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
// mounted() {
|
|
32
|
-
// this.detectChecked();
|
|
33
|
-
// const vm = this;
|
|
34
|
-
// this.$el.addEventListener(
|
|
35
|
-
// "change",
|
|
36
|
-
// function(e) {
|
|
37
|
-
// vm.detectChecked();
|
|
38
|
-
// },
|
|
39
|
-
// false
|
|
40
|
-
// );
|
|
41
|
-
// },
|
|
42
31
|
methods: {
|
|
43
32
|
$ready() {
|
|
44
33
|
this.detectChecked();
|
|
@@ -1,223 +1,198 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-container fluid class="pa-0" :style="$styles()">
|
|
3
|
-
<!--
|
|
4
|
-
It's safer to manually implement styling than adding another dependency such as vuetify-google-autocomplete,
|
|
5
|
-
which behaves differently and needs to be actively maintained.
|
|
6
|
-
-->
|
|
7
|
-
<div
|
|
8
|
-
class="v-input theme--light v-text-field v-text-field--enclosed v-text-field--outlined"
|
|
9
|
-
>
|
|
10
|
-
<div class="v-input__control">
|
|
11
|
-
<div class="v-input__slot">
|
|
12
|
-
<fieldset aria-hidden="true">
|
|
13
|
-
<legend :style="`width: ${labelWidth}px;`"><span></span></legend>
|
|
14
|
-
</fieldset>
|
|
15
|
-
<div class="v-text-field__slot">
|
|
16
|
-
<label
|
|
17
|
-
ref="label"
|
|
18
|
-
class="v-label v-label--active theme--light"
|
|
19
|
-
style="left: 0px; right: auto; position: absolute; font-size: 16px;"
|
|
20
|
-
>{{ spec.label }}</label
|
|
21
|
-
>
|
|
22
|
-
<!-- See https://developers.google.com/places/web-service/autocomplete#place_types for autocompleteOptions -->
|
|
23
|
-
<gmap-autocomplete
|
|
24
|
-
:name="spec.name"
|
|
25
|
-
:placeholder="spec.placeholder"
|
|
26
|
-
:value="address"
|
|
27
|
-
:options="spec.autocompleteOptions"
|
|
28
|
-
@input="onAddressChanged"
|
|
29
|
-
@place_changed="onPlaceChanged"
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<gmap-map
|
|
37
|
-
ref="map"
|
|
38
|
-
:center="{ lat: 0, lng: 0 }"
|
|
39
|
-
:zoom="13"
|
|
40
|
-
class="mt-3 mb-3"
|
|
41
|
-
map-type-id="roadmap"
|
|
42
|
-
:style="mapStyles"
|
|
43
|
-
@idle="onActionCompleted"
|
|
44
|
-
>
|
|
45
|
-
<gmap-marker
|
|
46
|
-
:position="markerPos"
|
|
47
|
-
:clickable="true"
|
|
48
|
-
:draggable="true"
|
|
49
|
-
@drag="onDrag"
|
|
50
|
-
@dragend="onDrag"
|
|
51
|
-
/>
|
|
52
|
-
</gmap-map>
|
|
53
|
-
<ui-component
|
|
54
|
-
v-if="latitudeField"
|
|
55
|
-
ref="latitudeView"
|
|
56
|
-
:spec="latitudeField"
|
|
57
|
-
/>
|
|
58
|
-
<ui-component
|
|
59
|
-
v-if="longitudeField"
|
|
60
|
-
ref="longitudeView"
|
|
61
|
-
:spec="longitudeField"
|
|
62
|
-
/>
|
|
63
|
-
<ui-component v-if="zoomField" ref="zoomView" :spec="zoomField" />
|
|
64
|
-
</v-container>
|
|
65
|
-
</template>
|
|
66
|
-
|
|
67
|
-
<script>
|
|
68
|
-
export default {
|
|
69
|
-
props: {
|
|
70
|
-
spec: { type: Object, required: true }
|
|
71
|
-
},
|
|
72
|
-
data() {
|
|
73
|
-
return {
|
|
74
|
-
infoOptions: {
|
|
75
|
-
pixelOffset: {
|
|
76
|
-
width: 0,
|
|
77
|
-
height: -35
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
// markerPos: { lat: null, lng: null },
|
|
81
|
-
address: null,
|
|
82
|
-
longitude: null,
|
|
83
|
-
latitude: null,
|
|
84
|
-
longitudeField: null,
|
|
85
|
-
latitudeField: null,
|
|
86
|
-
zoomField: null,
|
|
87
|
-
longitudeView: null,
|
|
88
|
-
latitudeView: null,
|
|
89
|
-
zoomView: null,
|
|
90
|
-
labelWidth: 0
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
computed: {
|
|
94
|
-
markerPos() {
|
|
95
|
-
return { lat: this.latitude || 0, lng: this.longitude || 0 };
|
|
96
|
-
},
|
|
97
|
-
mapStyles() {
|
|
98
|
-
return this.longitude != null && this.latitude != null
|
|
99
|
-
? {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.
|
|
109
|
-
this.
|
|
110
|
-
this.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
this.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (this.address === "") {
|
|
200
|
-
this.address = null;
|
|
201
|
-
this.longitude = null;
|
|
202
|
-
this.latitude = null;
|
|
203
|
-
|
|
204
|
-
this.latitudeView.fieldModel = null;
|
|
205
|
-
this.longitudeView.fieldModel = null;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
</script>
|
|
211
|
-
|
|
212
|
-
<style scoped>
|
|
213
|
-
/* #loading-container {
|
|
214
|
-
position: absolute;
|
|
215
|
-
width: 100%;
|
|
216
|
-
height: 300px;
|
|
217
|
-
top: 0;
|
|
218
|
-
z-index: 100;
|
|
219
|
-
background: rgba(196, 154, 154, 0.1);
|
|
220
|
-
align-items: center;
|
|
221
|
-
justify-content: center;
|
|
222
|
-
} */
|
|
223
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<v-container fluid class="pa-0" :style="$styles()">
|
|
3
|
+
<!--
|
|
4
|
+
It's safer to manually implement styling than adding another dependency such as vuetify-google-autocomplete,
|
|
5
|
+
which behaves differently and needs to be actively maintained.
|
|
6
|
+
-->
|
|
7
|
+
<div
|
|
8
|
+
class="v-input theme--light v-text-field v-text-field--enclosed v-text-field--outlined"
|
|
9
|
+
>
|
|
10
|
+
<div class="v-input__control">
|
|
11
|
+
<div class="v-input__slot">
|
|
12
|
+
<fieldset aria-hidden="true">
|
|
13
|
+
<legend :style="`width: ${labelWidth}px;`"><span></span></legend>
|
|
14
|
+
</fieldset>
|
|
15
|
+
<div class="v-text-field__slot">
|
|
16
|
+
<label
|
|
17
|
+
ref="label"
|
|
18
|
+
class="v-label v-label--active theme--light"
|
|
19
|
+
style="left: 0px; right: auto; position: absolute; font-size: 16px;"
|
|
20
|
+
>{{ spec.label }}</label
|
|
21
|
+
>
|
|
22
|
+
<!-- See https://developers.google.com/places/web-service/autocomplete#place_types for autocompleteOptions -->
|
|
23
|
+
<gmap-autocomplete
|
|
24
|
+
:name="spec.name"
|
|
25
|
+
:placeholder="spec.placeholder"
|
|
26
|
+
:value="address"
|
|
27
|
+
:options="spec.autocompleteOptions"
|
|
28
|
+
@input="onAddressChanged"
|
|
29
|
+
@place_changed="onPlaceChanged"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<gmap-map
|
|
37
|
+
ref="map"
|
|
38
|
+
:center="{ lat: 0, lng: 0 }"
|
|
39
|
+
:zoom="13"
|
|
40
|
+
class="mt-3 mb-3 map"
|
|
41
|
+
map-type-id="roadmap"
|
|
42
|
+
:style="mapStyles"
|
|
43
|
+
@idle="onActionCompleted"
|
|
44
|
+
>
|
|
45
|
+
<gmap-marker
|
|
46
|
+
:position="markerPos"
|
|
47
|
+
:clickable="true"
|
|
48
|
+
:draggable="true"
|
|
49
|
+
@drag="onDrag"
|
|
50
|
+
@dragend="onDrag"
|
|
51
|
+
/>
|
|
52
|
+
</gmap-map>
|
|
53
|
+
<ui-component
|
|
54
|
+
v-if="latitudeField"
|
|
55
|
+
ref="latitudeView"
|
|
56
|
+
:spec="latitudeField"
|
|
57
|
+
/>
|
|
58
|
+
<ui-component
|
|
59
|
+
v-if="longitudeField"
|
|
60
|
+
ref="longitudeView"
|
|
61
|
+
:spec="longitudeField"
|
|
62
|
+
/>
|
|
63
|
+
<ui-component v-if="zoomField" ref="zoomView" :spec="zoomField" />
|
|
64
|
+
</v-container>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
export default {
|
|
69
|
+
props: {
|
|
70
|
+
spec: { type: Object, required: true }
|
|
71
|
+
},
|
|
72
|
+
data() {
|
|
73
|
+
return {
|
|
74
|
+
infoOptions: {
|
|
75
|
+
pixelOffset: {
|
|
76
|
+
width: 0,
|
|
77
|
+
height: -35
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
// markerPos: { lat: null, lng: null },
|
|
81
|
+
address: null,
|
|
82
|
+
longitude: null,
|
|
83
|
+
latitude: null,
|
|
84
|
+
longitudeField: null,
|
|
85
|
+
latitudeField: null,
|
|
86
|
+
zoomField: null,
|
|
87
|
+
longitudeView: null,
|
|
88
|
+
latitudeView: null,
|
|
89
|
+
zoomView: null,
|
|
90
|
+
labelWidth: 0
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
computed: {
|
|
94
|
+
markerPos() {
|
|
95
|
+
return { lat: this.latitude || 0, lng: this.longitude || 0 };
|
|
96
|
+
},
|
|
97
|
+
mapStyles() {
|
|
98
|
+
return this.longitude != null && this.latitude != null
|
|
99
|
+
? {
|
|
100
|
+
display: "block"
|
|
101
|
+
}
|
|
102
|
+
: { display: "none" };
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
$ready() {
|
|
107
|
+
this.address = this.spec.value;
|
|
108
|
+
this.longitudeField = this.spec.longitudeField;
|
|
109
|
+
this.latitudeField = this.spec.latitudeField;
|
|
110
|
+
this.zoomField = this.spec.zoomField;
|
|
111
|
+
|
|
112
|
+
this.centerInitial();
|
|
113
|
+
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
this.latitudeView = this.$refs.latitudeView.$children[0];
|
|
116
|
+
this.longitudeView = this.$refs.longitudeView.$children[0];
|
|
117
|
+
|
|
118
|
+
if (this.$refs.zoomView) {
|
|
119
|
+
this.zoomView = this.$refs.zoomView.$children[0];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const labelView = this.$refs.label;
|
|
123
|
+
this.labelWidth = labelView.getBoundingClientRect().width + 6;
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
centerInitial() {
|
|
127
|
+
const latitudeValue = Utils.type.floatValue(this.latitudeField.value);
|
|
128
|
+
const longitudeValue = Utils.type.floatValue(this.longitudeField.value);
|
|
129
|
+
|
|
130
|
+
if (latitudeValue !== 0 && longitudeValue !== 0) {
|
|
131
|
+
this.setLocation(latitudeValue, longitudeValue, true);
|
|
132
|
+
|
|
133
|
+
// Avoid asking for user location right away for now
|
|
134
|
+
// } else {
|
|
135
|
+
// navigator.geolocation.getCurrentPosition(position => {
|
|
136
|
+
// const coordinate = position.coords;
|
|
137
|
+
// this.setLocation(coordinate.latitude, coordinate.longitude, false);
|
|
138
|
+
// });
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
setLocation(latitudeValue, longitudeValue, dropPin) {
|
|
142
|
+
this.$refs.map.$gmapApiPromiseLazy().then(() => {
|
|
143
|
+
// eslint-disable-next-line no-undef
|
|
144
|
+
const location = new google.maps.LatLng(latitudeValue, longitudeValue);
|
|
145
|
+
this.$refs.map.$mapObject.setCenter(location);
|
|
146
|
+
|
|
147
|
+
if (dropPin) {
|
|
148
|
+
this.setMarkerPosition(location);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
setMarkerPosition(location) {
|
|
153
|
+
this.latitude = location.lat();
|
|
154
|
+
this.longitude = location.lng();
|
|
155
|
+
|
|
156
|
+
this.latitudeView.fieldModel = location.lat();
|
|
157
|
+
this.longitudeView.fieldModel = location.lng();
|
|
158
|
+
},
|
|
159
|
+
onPlaceChanged(place) {
|
|
160
|
+
this.address = place.formatted_address;
|
|
161
|
+
|
|
162
|
+
const location = place.geometry.location;
|
|
163
|
+
this.setMarkerPosition(location);
|
|
164
|
+
this.$refs.map.$mapObject.setCenter(location);
|
|
165
|
+
},
|
|
166
|
+
onDrag(e) {
|
|
167
|
+
this.setMarkerPosition(e.latLng);
|
|
168
|
+
},
|
|
169
|
+
onActionCompleted() {
|
|
170
|
+
if (this.zoomView) {
|
|
171
|
+
this.zoomView.fieldModel = this.$refs.map.$mapObject.zoom;
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
onAddressChanged(e) {
|
|
175
|
+
this.address = e.target.value;
|
|
176
|
+
if (this.address === "") {
|
|
177
|
+
this.address = null;
|
|
178
|
+
this.longitude = null;
|
|
179
|
+
this.latitude = null;
|
|
180
|
+
|
|
181
|
+
this.latitudeView.fieldModel = null;
|
|
182
|
+
this.longitudeView.fieldModel = null;
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
// Override
|
|
186
|
+
$displayValue() {
|
|
187
|
+
return "block";
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
</script>
|
|
192
|
+
|
|
193
|
+
<style scoped>
|
|
194
|
+
.map {
|
|
195
|
+
width: 100%;
|
|
196
|
+
height: 300px;
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
<v-radio
|
|
3
3
|
:label="spec.label"
|
|
4
4
|
:value="spec.value.presence() || vuetifyEmptyString"
|
|
5
|
-
:off-icon="data.icon || '$vuetify.icons.radioOff'"
|
|
6
|
-
:on-icon="data.icon || '$vuetify.icons.radioOn'"
|
|
7
5
|
:class="$classes()"
|
|
8
6
|
:disabled="spec.readOnly"
|
|
9
|
-
@change="changed"
|
|
10
7
|
></v-radio>
|
|
11
8
|
</template>
|
|
12
9
|
|
|
@@ -14,51 +11,6 @@
|
|
|
14
11
|
export default {
|
|
15
12
|
props: {
|
|
16
13
|
spec: { type: Object, required: true }
|
|
17
|
-
},
|
|
18
|
-
data() {
|
|
19
|
-
return {
|
|
20
|
-
groupElement: null,
|
|
21
|
-
data: { value: this.spec.value, icon: null }
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
methods: {
|
|
25
|
-
$ready() {
|
|
26
|
-
this.groupElement = this.$el.closest("[data-component=radioGroup]");
|
|
27
|
-
|
|
28
|
-
// Execute later to ensure the radioGroup has registered its event listener
|
|
29
|
-
const vm = this;
|
|
30
|
-
setTimeout(function() {
|
|
31
|
-
const ev = new Event("add");
|
|
32
|
-
ev.spec = vm.data;
|
|
33
|
-
vm.$type.ifObject(vm.groupElement, val => val.dispatchEvent(ev));
|
|
34
|
-
}, 100);
|
|
35
|
-
},
|
|
36
|
-
changed(event) {
|
|
37
|
-
// Execute later to ensure the checkbox's checked state has been updated.
|
|
38
|
-
const vm = this;
|
|
39
|
-
setTimeout(function() {
|
|
40
|
-
vm.$type.ifObject(vm.groupElement, val =>
|
|
41
|
-
val.dispatchEvent(new Event("change"))
|
|
42
|
-
);
|
|
43
|
-
}, 100);
|
|
44
|
-
}
|
|
45
14
|
}
|
|
46
15
|
};
|
|
47
16
|
</script>
|
|
48
|
-
|
|
49
|
-
<style lang="scss">
|
|
50
|
-
.v-input--selection-controls {
|
|
51
|
-
.v-radio.vertical {
|
|
52
|
-
display: inline-block;
|
|
53
|
-
text-align: center;
|
|
54
|
-
|
|
55
|
-
.v-input--selection-controls__input {
|
|
56
|
-
margin-right: 0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
label {
|
|
60
|
-
display: block;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
@@ -1,93 +1,42 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-radio-group
|
|
3
|
-
v-model="fieldModel"
|
|
4
|
-
|
|
5
|
-
:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
44
|
-
this.$el.addEventListener(
|
|
45
|
-
"add",
|
|
46
|
-
function(e) {
|
|
47
|
-
vm.radioAdded(e.spec);
|
|
48
|
-
},
|
|
49
|
-
false
|
|
50
|
-
);
|
|
51
|
-
},
|
|
52
|
-
radioChanged() {
|
|
53
|
-
if (
|
|
54
|
-
this.$type.isString(this.spec.iconOfBeforeSelected) &&
|
|
55
|
-
this.$type.isString(this.spec.iconOfSelected) &&
|
|
56
|
-
this.$type.isString(this.spec.iconOfAfterSelected)
|
|
57
|
-
) {
|
|
58
|
-
let icon = this.value
|
|
59
|
-
? this.spec.iconOfBeforeSelected
|
|
60
|
-
: this.spec.iconOfAfterSelected;
|
|
61
|
-
for (const radio of this.radios) {
|
|
62
|
-
if (this.value === radio.value) {
|
|
63
|
-
radio.icon = this.spec.iconOfSelected;
|
|
64
|
-
icon = this.spec.iconOfAfterSelected;
|
|
65
|
-
} else {
|
|
66
|
-
radio.icon = icon;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
radioAdded(spec) {
|
|
72
|
-
this.radios.push(spec);
|
|
73
|
-
this.radioChanged();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
</script>
|
|
78
|
-
|
|
79
|
-
<style scoped>
|
|
80
|
-
/* TODO: Review this after upgrading to vuetify 2.0 */
|
|
81
|
-
div.v-input--radio-group {
|
|
82
|
-
margin-top: 0;
|
|
83
|
-
}
|
|
84
|
-
</style>
|
|
85
|
-
|
|
86
|
-
<style>
|
|
87
|
-
div.v-input--radio-group .v-messages {
|
|
88
|
-
min-height: 0;
|
|
89
|
-
}
|
|
90
|
-
div.v-input--radio-group.v-input--selection-controls .v-input__slot {
|
|
91
|
-
margin-bottom: 0;
|
|
92
|
-
}
|
|
93
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<v-radio-group
|
|
3
|
+
v-model="fieldModel"
|
|
4
|
+
:name="fieldName"
|
|
5
|
+
:disabled="spec.readOnly"
|
|
6
|
+
>
|
|
7
|
+
<div v-for="(item, index) in spec.childViews" :key="index">
|
|
8
|
+
<ui-component :spec="item" />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<input
|
|
12
|
+
v-if="spec.readOnly"
|
|
13
|
+
type="hidden"
|
|
14
|
+
:name="fieldName"
|
|
15
|
+
:value="fieldModel"
|
|
16
|
+
/>
|
|
17
|
+
</v-radio-group>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
props: {
|
|
23
|
+
spec: { type: Object, required: true }
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style scoped>
|
|
29
|
+
/* TODO: Review this after upgrading to vuetify 2.0 */
|
|
30
|
+
div.v-input--radio-group {
|
|
31
|
+
margin-top: 0;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
34
|
+
|
|
35
|
+
<style>
|
|
36
|
+
div.v-input--radio-group .v-messages {
|
|
37
|
+
min-height: 0;
|
|
38
|
+
}
|
|
39
|
+
div.v-input--radio-group.v-input--selection-controls .v-input__slot {
|
|
40
|
+
margin-bottom: 0;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
package/components/h2.vue
CHANGED
package/components/h3.vue
CHANGED
package/components/h4.vue
CHANGED
package/components/h5.vue
CHANGED
package/components/h6.vue
CHANGED
|
@@ -1,88 +1,94 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="cssClasses"
|
|
4
|
-
:style="$styles()"
|
|
5
|
-
:href="$href()"
|
|
6
|
-
@click="$onClick()"
|
|
7
|
-
>
|
|
8
|
-
<v-row no-gutters class="full-height">
|
|
9
|
-
<template v-for="(item, index) in spec.childViews">
|
|
10
|
-
<ui-component
|
|
11
|
-
v-if="isColumn(item)"
|
|
12
|
-
:key="viewKey(item, index)"
|
|
13
|
-
:spec="item"
|
|
14
|
-
/>
|
|
15
|
-
<div
|
|
16
|
-
v-else
|
|
17
|
-
:key="viewKey(item, index)"
|
|
18
|
-
class="full-width"
|
|
19
|
-
:style="innerStyles"
|
|
20
|
-
>
|
|
21
|
-
<ui-component :spec="item" />
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
</v-row>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
import Vue from "vue";
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
props: {
|
|
33
|
-
spec: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
align = "
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="cssClasses"
|
|
4
|
+
:style="$styles()"
|
|
5
|
+
:href="$href()"
|
|
6
|
+
@click="$onClick()"
|
|
7
|
+
>
|
|
8
|
+
<v-row no-gutters class="full-height">
|
|
9
|
+
<template v-for="(item, index) in spec.childViews">
|
|
10
|
+
<ui-component
|
|
11
|
+
v-if="isColumn(item)"
|
|
12
|
+
:key="viewKey(item, index)"
|
|
13
|
+
:spec="item"
|
|
14
|
+
/>
|
|
15
|
+
<div
|
|
16
|
+
v-else
|
|
17
|
+
:key="viewKey(item, index)"
|
|
18
|
+
class="full-width"
|
|
19
|
+
:style="innerStyles"
|
|
20
|
+
>
|
|
21
|
+
<ui-component :spec="item" />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
</v-row>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import Vue from "vue";
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
props: {
|
|
33
|
+
spec: {
|
|
34
|
+
type: Object,
|
|
35
|
+
required: true,
|
|
36
|
+
default: function() {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
innerStyles: {}
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
computed: {
|
|
47
|
+
cssClasses() {
|
|
48
|
+
// This panel will be nameless when used in predefined layout (e.g. page.body, list.header, etc.)
|
|
49
|
+
this.spec.view = this.spec.view || "panels/responsive";
|
|
50
|
+
return this.$classes();
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
methods: {
|
|
54
|
+
$ready() {
|
|
55
|
+
let align = null;
|
|
56
|
+
switch (this.spec.align) {
|
|
57
|
+
case "center":
|
|
58
|
+
align = "center";
|
|
59
|
+
break;
|
|
60
|
+
case "right":
|
|
61
|
+
align = "flex-end";
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
align = "flex-start";
|
|
65
|
+
}
|
|
66
|
+
Vue.set(this.innerStyles, "align-items", align);
|
|
67
|
+
},
|
|
68
|
+
isColumn(item) {
|
|
69
|
+
return item.view == "panels/column-v1";
|
|
70
|
+
},
|
|
71
|
+
viewKey(item, index) {
|
|
72
|
+
// Use view name for key to avoid component reuse issue
|
|
73
|
+
return `view${index}_${item.view}`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style scoped>
|
|
80
|
+
.row {
|
|
81
|
+
margin-left: 0;
|
|
82
|
+
margin-right: 0;
|
|
83
|
+
}
|
|
84
|
+
.full-width {
|
|
85
|
+
width: 100%;
|
|
86
|
+
flex: 0 0 100%;
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
}
|
|
90
|
+
/* Needed to ensure that split's sub panels have the same height */
|
|
91
|
+
.full-height {
|
|
92
|
+
height: 100%;
|
|
93
|
+
}
|
|
94
|
+
</style>
|
package/nav/appbar.vue
CHANGED
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
></v-progress-circular>
|
|
20
20
|
<div v-else>
|
|
21
21
|
<panels-responsive v-if="navBar.logo" :spec="navBar.logo" />
|
|
22
|
-
<v-toolbar-title v-else>{{
|
|
22
|
+
<v-toolbar-title v-else-if="navBar.showTitle">{{
|
|
23
|
+
page.title
|
|
24
|
+
}}</v-toolbar-title>
|
|
23
25
|
</div>
|
|
24
26
|
<v-spacer></v-spacer>
|
|
25
27
|
|
|
@@ -38,6 +40,8 @@
|
|
|
38
40
|
/>
|
|
39
41
|
</template>
|
|
40
42
|
|
|
43
|
+
<views-avatar v-if="navBar.imageUrl" :spec="avatarSpec(navBar)" />
|
|
44
|
+
|
|
41
45
|
<v-btn
|
|
42
46
|
v-if="viewSourceEnabled()"
|
|
43
47
|
icon
|
|
@@ -53,10 +57,12 @@
|
|
|
53
57
|
<script>
|
|
54
58
|
import NavDrawer from "./drawer";
|
|
55
59
|
import Launch from "../utils/launch";
|
|
60
|
+
import ViewsAvatar from "../components/avatar";
|
|
56
61
|
|
|
57
62
|
export default {
|
|
58
63
|
components: {
|
|
59
|
-
"nav-drawer": NavDrawer
|
|
64
|
+
"nav-drawer": NavDrawer,
|
|
65
|
+
"views-avatar": ViewsAvatar
|
|
60
66
|
},
|
|
61
67
|
props: {
|
|
62
68
|
page: { type: Object, required: true }
|
|
@@ -103,6 +109,13 @@ export default {
|
|
|
103
109
|
viewSource: function() {
|
|
104
110
|
const properties = { message: this.page };
|
|
105
111
|
Launch.dialog(Object.assign({}, properties));
|
|
112
|
+
},
|
|
113
|
+
avatarSpec(spec) {
|
|
114
|
+
return {
|
|
115
|
+
view: "avatar-v1",
|
|
116
|
+
url: spec["imageUrl"],
|
|
117
|
+
onClick: spec["onCLick"]
|
|
118
|
+
};
|
|
106
119
|
}
|
|
107
120
|
}
|
|
108
121
|
};
|
|
@@ -117,4 +130,7 @@ export default {
|
|
|
117
130
|
color: inherit;
|
|
118
131
|
}
|
|
119
132
|
}
|
|
133
|
+
.pages-navBar {
|
|
134
|
+
box-shadow: none !important;
|
|
135
|
+
}
|
|
120
136
|
</style>
|
package/nav/drawer.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
app
|
|
8
8
|
:class="cssClasses"
|
|
9
9
|
:dark="cssClasses.includes('dark')"
|
|
10
|
-
:expand-on-hover="
|
|
10
|
+
:expand-on-hover="expandOnHover()"
|
|
11
11
|
:permanent="cssClasses.includes('permanent')"
|
|
12
12
|
:style="style"
|
|
13
13
|
@input="updateState"
|
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
// props: ["spec", "trigger", "permanent"],
|
|
44
44
|
props: {
|
|
45
45
|
spec: { type: Object, required: true },
|
|
46
|
-
trigger: { type: Object, default: null },
|
|
46
|
+
trigger: { type: [Object, Date], default: null },
|
|
47
47
|
permanent: { type: Boolean, required: true }
|
|
48
48
|
},
|
|
49
49
|
data: function() {
|
|
@@ -63,6 +63,16 @@ export default {
|
|
|
63
63
|
// Increase z-index so that the drawer is above the page header.
|
|
64
64
|
// return { zIndex: 11 };
|
|
65
65
|
return this.$styles();
|
|
66
|
+
},
|
|
67
|
+
lgAndAbove() {
|
|
68
|
+
switch (this.$vuetify.breakpoint.name) {
|
|
69
|
+
case "xs":
|
|
70
|
+
case "sm":
|
|
71
|
+
case "md":
|
|
72
|
+
return false;
|
|
73
|
+
default:
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
66
76
|
}
|
|
67
77
|
},
|
|
68
78
|
watch: {
|
|
@@ -81,6 +91,12 @@ export default {
|
|
|
81
91
|
},
|
|
82
92
|
updateState(state) {
|
|
83
93
|
this.state = state;
|
|
94
|
+
},
|
|
95
|
+
expandOnHover() {
|
|
96
|
+
return (
|
|
97
|
+
this.cssClasses.includes("mini") ||
|
|
98
|
+
(this.cssClasses.includes("mini-lg-and-above") && this.lgAndAbove)
|
|
99
|
+
);
|
|
84
100
|
}
|
|
85
101
|
}
|
|
86
102
|
};
|