glib-web 2.6.7 → 3.0.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/action.js +39 -17
- package/actions/analytics/logEvent.js +2 -2
- package/actions/auth/saveCsrfToken.js +6 -0
- package/actions/cables/push.js +4 -4
- package/actions/commands/enqueue.js +17 -0
- package/actions/fields/reset.js +2 -2
- package/actions/http/get.js +15 -27
- package/actions/panels/scrollTo.js +1 -1
- package/actions/panels/scrollToBottom.js +1 -1
- package/actions/popovers/close.js +5 -0
- package/actions/popovers/open.js +9 -0
- package/actions/windows/closeWithReload.js +1 -1
- package/actions/windows/refreshState.js +3 -1
- package/actions/ws/push.js +5 -3
- package/app.vue +59 -27
- package/components/_badge.vue +1 -6
- package/components/_button.vue +30 -30
- package/components/_chip.vue +27 -29
- package/components/_dropdownMenu.vue +10 -23
- package/components/_icon.vue +5 -5
- 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 +4 -5
- package/components/component.vue +112 -133
- package/components/datetime.vue +2 -0
- package/components/fields/_patternText.vue +8 -19
- package/components/fields/_select.vue +9 -27
- package/components/fields/autocomplete.vue +8 -21
- package/components/fields/check.vue +5 -12
- package/components/fields/checkGroup.vue +3 -13
- package/components/fields/country/field.vue +9 -27
- package/components/fields/date.vue +5 -5
- package/components/fields/datetime.vue +6 -11
- package/components/fields/dynamicSelect.vue +8 -29
- package/components/fields/file.vue +10 -29
- package/components/fields/newRichText.vue +67 -54
- package/components/fields/otpField.vue +11 -31
- package/components/fields/phone/field.vue +60 -78
- package/components/fields/radio.vue +8 -44
- package/components/fields/radioGroup.vue +17 -19
- package/components/fields/rating.vue +9 -16
- package/components/fields/richText.vue +27 -45
- package/components/fields/select.vue +10 -7
- package/components/fields/stripe/stripeFields.vue +9 -2
- package/components/fields/stripe/stripeIndividualFields.vue +9 -7
- package/components/fields/stripeExternalAccount.vue +10 -24
- package/components/fields/text.vue +26 -50
- package/components/fields/textarea.vue +14 -27
- package/components/fields/timeZone.vue +9 -6
- package/components/fields/timer.vue +5 -11
- package/components/image.vue +12 -23
- package/components/label.vue +10 -18
- package/components/markdown.vue +45 -23
- package/components/mixins/events.js +24 -25
- package/components/mixins/generic.js +7 -4
- package/components/mixins/inputVariant.js +16 -0
- package/components/mixins/list/autoload.js +7 -5
- package/components/mixins/styles.js +16 -16
- package/components/mixins/table/autoload.js +6 -4
- package/components/mixins/ws/actionCable.js +6 -5
- package/components/mixins/ws/phoenixSocket.js +11 -9
- package/components/p.vue +10 -0
- package/components/panels/column.vue +8 -19
- package/components/panels/custom.vue +9 -13
- package/components/panels/flow.vue +19 -13
- package/components/panels/form.vue +26 -34
- package/components/panels/grid.vue +15 -9
- package/components/panels/horizontal.vue +58 -54
- package/components/panels/list.vue +37 -72
- package/components/panels/responsive.vue +2 -33
- package/components/panels/scroll.vue +3 -0
- package/components/panels/split.vue +2 -2
- package/components/panels/table.vue +32 -63
- package/components/panels/timeline.vue +20 -30
- package/components/panels/vertical.vue +8 -13
- package/components/popover.vue +39 -0
- package/components/progressCircle.vue +2 -8
- package/components/progressbar.vue +4 -14
- package/components/shareButton.vue +24 -30
- package/components/tabBar.vue +29 -28
- package/index.js +60 -94
- package/nav/appbar.vue +8 -6
- package/nav/dialog.vue +30 -49
- package/nav/drawer.vue +39 -51
- package/nav/drawerButton.vue +5 -7
- package/nav/drawerLabel.vue +2 -3
- package/nav/sheet.vue +21 -22
- package/nav/snackbar.vue +19 -30
- package/package.json +13 -16
- package/plugins/driverCustomBehavior.js +1 -1
- package/plugins/updatableComponent.js +2 -2
- package/plugins/vuetify.js +26 -0
- package/store.js +16 -0
- package/templates/comment.vue +42 -19
- package/templates/featured.vue +8 -9
- package/templates/thumbnail-old.vue +188 -0
- package/templates/thumbnail.vue +3 -208
- package/tsconfig.json +1 -1
- package/utils/component.js +18 -18
- package/utils/constant.js +4 -0
- package/utils/eventBus.js +9 -2
- package/utils/history.js +12 -8
- package/utils/http.js +29 -71
- package/utils/launch.js +89 -52
- package/utils/private/ws.js +5 -3
- package/utils/public.js +6 -0
- package/utils/queue.js +102 -0
- package/utils/settings.js +3 -9
|
@@ -6,44 +6,28 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
<template v-for="(section, sectionIndex) in sections">
|
|
10
|
-
<div
|
|
9
|
+
<template v-for="(section, sectionIndex) in sections" :key="`section${sectionIndex}`">
|
|
10
|
+
<div>
|
|
11
11
|
<panels-responsive v-if="section.header" :spec="section.header" />
|
|
12
12
|
|
|
13
|
-
<draggable
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
:data-
|
|
19
|
-
|
|
20
|
-
@start="onDragStart"
|
|
21
|
-
@end="onDragEnd"
|
|
22
|
-
>
|
|
23
|
-
<div
|
|
24
|
-
v-for="(row, rowIndex) in section.rows"
|
|
25
|
-
:key="row.id || `${sectionIndex}_${rowIndex}`"
|
|
26
|
-
:ref="`row_${sectionIndex}_${rowIndex}`"
|
|
27
|
-
:data-dragRowId="row.id"
|
|
28
|
-
class="row_container"
|
|
29
|
-
>
|
|
30
|
-
<!-- <v-divider v-if="!spec.responsiveCols && rowIndex == 0" /> -->
|
|
13
|
+
<!-- <draggable v-model="section.rows" ghost-class="ghost"
|
|
14
|
+
:group="dragSupport ? dragSupport.groupId || 'common' : 'common'" :data-dragListId="spec.id"
|
|
15
|
+
:data-dragSectionIndex="sectionIndex" :disabled="!$type.isObject(dragSupport)" @start="onDragStart"
|
|
16
|
+
@end="onDragEnd"> -->
|
|
17
|
+
<div v-for="(row, rowIndex) in section.rows" :key="`${sectionIndex}_${rowIndex}`"
|
|
18
|
+
:ref="`row_${sectionIndex}_${rowIndex}`" :data-dragRowId="row.id">
|
|
19
|
+
<!-- <v-divider v-if="!spec.responsiveCols && rowIndex == 0" /> -->
|
|
31
20
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
:spec="rowSpec(row)"
|
|
35
|
-
:responsive-cols="spec.responsiveCols"
|
|
36
|
-
:index="rowIndex"
|
|
37
|
-
/>
|
|
38
|
-
<!-- <v-divider
|
|
21
|
+
<component :is="template(row)" :spec="rowSpec(row)" :responsive-cols="spec.responsiveCols" :index="rowIndex" />
|
|
22
|
+
<!-- <v-divider
|
|
39
23
|
v-if="
|
|
40
24
|
!spec.responsiveCols &&
|
|
41
25
|
(rowIndex != section.rows.length - 1 ||
|
|
42
26
|
sectionIndex != sections.length - 1)
|
|
43
27
|
"
|
|
44
28
|
/> -->
|
|
45
|
-
|
|
46
|
-
</draggable>
|
|
29
|
+
</div>
|
|
30
|
+
<!-- </draggable> -->
|
|
47
31
|
|
|
48
32
|
<panels-responsive v-if="section.footer" :spec="section.footer" />
|
|
49
33
|
</div>
|
|
@@ -58,26 +42,26 @@
|
|
|
58
42
|
</template>
|
|
59
43
|
|
|
60
44
|
<script>
|
|
61
|
-
import draggable from "vuedraggable";
|
|
45
|
+
// import draggable from "vuedraggable";
|
|
62
46
|
import autoloadMixin from "../mixins/list/autoload.js";
|
|
63
|
-
import ThumbnailTemplate from "../../templates/thumbnail";
|
|
64
|
-
import FeaturedTemplate from "../../templates/featured";
|
|
65
|
-
import CommentTemplate from "../../templates/comment";
|
|
47
|
+
import ThumbnailTemplate from "../../templates/thumbnail.vue";
|
|
48
|
+
import FeaturedTemplate from "../../templates/featured.vue";
|
|
49
|
+
import CommentTemplate from "../../templates/comment.vue";
|
|
66
50
|
import actionCableMixin from "../mixins/ws/actionCable.js";
|
|
67
51
|
|
|
68
52
|
export default {
|
|
69
53
|
components: {
|
|
70
|
-
draggable,
|
|
54
|
+
// draggable,
|
|
71
55
|
"template-thumbnail": ThumbnailTemplate,
|
|
72
56
|
"template-featured": FeaturedTemplate,
|
|
73
57
|
"template-commentOutgoing": CommentTemplate,
|
|
74
|
-
"template-commentIncoming": CommentTemplate
|
|
58
|
+
"template-commentIncoming": CommentTemplate,
|
|
75
59
|
},
|
|
76
60
|
mixins: [autoloadMixin, actionCableMixin],
|
|
77
61
|
props: {
|
|
78
|
-
spec: { type: Object, required: true }
|
|
62
|
+
spec: { type: Object, required: true },
|
|
79
63
|
},
|
|
80
|
-
data: function() {
|
|
64
|
+
data: function () {
|
|
81
65
|
return {
|
|
82
66
|
sections: [],
|
|
83
67
|
dragSupport: null
|
|
@@ -104,12 +88,13 @@ export default {
|
|
|
104
88
|
fieldTitleName: this.spec.fieldTitleName
|
|
105
89
|
? `${prefix}[${this.spec.fieldTitleName}]`
|
|
106
90
|
: null,
|
|
107
|
-
fieldCheckValueIf: this.spec.fieldCheckValueIf
|
|
91
|
+
fieldCheckValueIf: this.spec.fieldCheckValueIf,
|
|
108
92
|
});
|
|
109
93
|
}
|
|
110
94
|
return row;
|
|
111
95
|
},
|
|
112
96
|
action_loadNext(spec) {
|
|
97
|
+
console.log("TODO: load new comments and append to this list", spec);
|
|
113
98
|
// TODO
|
|
114
99
|
// - Load next rows/items from the Rails server
|
|
115
100
|
// - You can pass some parameters (e.g. currentItemId) for pagination
|
|
@@ -126,7 +111,7 @@ export default {
|
|
|
126
111
|
this.$set(section, "rows", []);
|
|
127
112
|
}
|
|
128
113
|
|
|
129
|
-
Utils.type.ifArray(appendedSection.rows, rows => {
|
|
114
|
+
Utils.type.ifArray(appendedSection.rows, (rows) => {
|
|
130
115
|
for (const row of rows) {
|
|
131
116
|
section.rows.push(row);
|
|
132
117
|
}
|
|
@@ -136,14 +121,14 @@ export default {
|
|
|
136
121
|
action_update(spec) {
|
|
137
122
|
const updatedRows = {};
|
|
138
123
|
|
|
139
|
-
Utils.type.ifArray(spec.rows, rows => {
|
|
124
|
+
Utils.type.ifArray(spec.rows, (rows) => {
|
|
140
125
|
for (const row of rows) {
|
|
141
126
|
updatedRows[row.id] = row;
|
|
142
127
|
}
|
|
143
128
|
});
|
|
144
129
|
|
|
145
130
|
for (const section of this.sections) {
|
|
146
|
-
section.rows = section.rows.map(row => {
|
|
131
|
+
section.rows = section.rows.map((row) => {
|
|
147
132
|
const updatedRow = updatedRows[row.id];
|
|
148
133
|
if (updatedRow) {
|
|
149
134
|
return updatedRow;
|
|
@@ -155,14 +140,14 @@ export default {
|
|
|
155
140
|
},
|
|
156
141
|
action_delete(spec) {
|
|
157
142
|
const deletedRows = {};
|
|
158
|
-
Utils.type.ifArray(spec.rows, rows => {
|
|
143
|
+
Utils.type.ifArray(spec.rows, (rows) => {
|
|
159
144
|
for (const row of rows) {
|
|
160
145
|
deletedRows[row.id] = row;
|
|
161
146
|
}
|
|
162
147
|
});
|
|
163
148
|
|
|
164
149
|
for (const section of this.sections) {
|
|
165
|
-
section.rows = section.rows.filter(row => {
|
|
150
|
+
section.rows = section.rows.filter((row) => {
|
|
166
151
|
// return !rows.includes(row.id);
|
|
167
152
|
return !deletedRows[row.id];
|
|
168
153
|
});
|
|
@@ -189,15 +174,15 @@ export default {
|
|
|
189
174
|
},
|
|
190
175
|
onDragStart(event) {
|
|
191
176
|
// This allows custom components to detect if something is being dragged.
|
|
192
|
-
|
|
177
|
+
vueApp.draggedComponent = this;
|
|
193
178
|
},
|
|
194
179
|
onDragEnd(event) {
|
|
195
|
-
|
|
180
|
+
vueApp.draggedComponent = null;
|
|
196
181
|
|
|
197
182
|
const targetSectionedRowIndex = event.newIndex;
|
|
198
183
|
// const sourceSectionedRowIndex = event.oldIndex;
|
|
199
184
|
if (event.from == event.to && event.oldIndex == targetSectionedRowIndex) {
|
|
200
|
-
console.
|
|
185
|
+
console.log("Reordering canceled");
|
|
201
186
|
return;
|
|
202
187
|
}
|
|
203
188
|
|
|
@@ -205,6 +190,7 @@ export default {
|
|
|
205
190
|
this.$recursiveUpdate();
|
|
206
191
|
|
|
207
192
|
const targetSectionIndex = this.getSectionIndex(event.to);
|
|
193
|
+
// const targetSection = this.getSection(targetSectionIndex);
|
|
208
194
|
|
|
209
195
|
const targetAbsoluteIndex =
|
|
210
196
|
this.previousSectionsRowCount(event.to) + targetSectionedRowIndex;
|
|
@@ -217,11 +203,11 @@ export default {
|
|
|
217
203
|
const mergedSpec = Object.assign(dragSpec.onDrop, {
|
|
218
204
|
[dragSpec.paramNameForFormData || "formData"]: {
|
|
219
205
|
[dragSpec.paramNameForNewAbsoluteIndex ||
|
|
220
|
-
|
|
206
|
+
"newAbsoluteIndex"]: targetAbsoluteIndex,
|
|
221
207
|
[dragSpec.paramNameForNewSectionIndex ||
|
|
222
|
-
|
|
208
|
+
"newSectionIndex"]: targetSectionIndex,
|
|
223
209
|
[dragSpec.paramNameForNewSectionedRowIndex ||
|
|
224
|
-
|
|
210
|
+
"newSectionedRowIndex"]: targetSectionedRowIndex,
|
|
225
211
|
[dragSpec.paramNameForRowId || "rowId"]: rowId,
|
|
226
212
|
[dragSpec.paramNameForOldListId || "oldListId"]: oldListId,
|
|
227
213
|
[dragSpec.paramNameForNewListId || "newListId"]: newListId
|
|
@@ -229,27 +215,6 @@ export default {
|
|
|
229
215
|
});
|
|
230
216
|
|
|
231
217
|
GLib.action.execute(mergedSpec, this);
|
|
232
|
-
|
|
233
|
-
this.hackLingeringHighlight();
|
|
234
|
-
},
|
|
235
|
-
hackLingeringHighlight() {
|
|
236
|
-
// After a row finished dragging, the row below it will automatically be
|
|
237
|
-
// "active&hover" for some reason, which will cause it to be incorrectly
|
|
238
|
-
// highlighted
|
|
239
|
-
// This seems to be a browser/library bug, so as a workaround, we temporarily
|
|
240
|
-
// apply the "disabled" class so the highlighting doesn't happen.
|
|
241
|
-
this.$el
|
|
242
|
-
.querySelectorAll(":active .row_container > .glib-clickable:hover")
|
|
243
|
-
.forEach(activeRow => {
|
|
244
|
-
activeRow.classList.add("disabled");
|
|
245
|
-
document.addEventListener(
|
|
246
|
-
"mousemove",
|
|
247
|
-
function() {
|
|
248
|
-
activeRow.classList.remove("disabled");
|
|
249
|
-
},
|
|
250
|
-
{ once: true }
|
|
251
|
-
);
|
|
252
|
-
});
|
|
253
218
|
},
|
|
254
219
|
getSectionIndex(element) {
|
|
255
220
|
return element.dataset.dragsectionindex;
|
|
@@ -264,8 +229,8 @@ export default {
|
|
|
264
229
|
count += this.getSection(i).rows.length;
|
|
265
230
|
}
|
|
266
231
|
return count;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
232
|
+
},
|
|
233
|
+
},
|
|
269
234
|
};
|
|
270
235
|
</script>
|
|
271
236
|
|
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
<div style="display: contents;">
|
|
4
|
-
<!-- <common-responsive v-if="!hoverViewsSpec" :spec="spec" /> -->
|
|
5
|
-
<v-menu
|
|
6
|
-
v-if="hoverViewsSpec"
|
|
7
|
-
:close-on-content-click="false"
|
|
8
|
-
open-on-hover
|
|
9
|
-
top
|
|
10
|
-
offset-y
|
|
11
|
-
content-class="hover"
|
|
12
|
-
>
|
|
13
|
-
<template v-slot:activator="{ on, attrs }">
|
|
14
|
-
<div v-bind="attrs" v-on="on">
|
|
15
|
-
<common-responsive :spec="spec" />
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
<v-card>
|
|
19
|
-
<common-responsive :spec="hoverViewsSpec" />
|
|
20
|
-
</v-card>
|
|
21
|
-
</v-menu>
|
|
22
|
-
<common-tooltip v-else :spec="spec">
|
|
23
|
-
<template v-slot:activator="{ on }">
|
|
24
|
-
<common-responsive :spec="spec" :event-handlers="on" />
|
|
25
|
-
</template>
|
|
26
|
-
</common-tooltip>
|
|
27
|
-
</div>
|
|
2
|
+
<common-responsive :spec="spec" />
|
|
28
3
|
</template>
|
|
29
4
|
|
|
30
5
|
<script>
|
|
@@ -33,7 +8,7 @@ export default {
|
|
|
33
8
|
spec: {
|
|
34
9
|
type: Object,
|
|
35
10
|
required: true,
|
|
36
|
-
default: function() {
|
|
11
|
+
default: function () {
|
|
37
12
|
return {};
|
|
38
13
|
}
|
|
39
14
|
}
|
|
@@ -45,12 +20,6 @@ export default {
|
|
|
45
20
|
},
|
|
46
21
|
methods: {
|
|
47
22
|
$ready() {
|
|
48
|
-
this.hoverViewsSpec = this.spec.hoverViews
|
|
49
|
-
? {
|
|
50
|
-
childViews: this.spec.hoverViews,
|
|
51
|
-
align: this.spec.align
|
|
52
|
-
}
|
|
53
|
-
: null;
|
|
54
23
|
}
|
|
55
24
|
}
|
|
56
25
|
};
|
|
@@ -23,6 +23,7 @@ export default {
|
|
|
23
23
|
// // Let the styles be handled by the child panel.
|
|
24
24
|
// const outerSpec = {};
|
|
25
25
|
// outerSpec["padding"] = this.spec["outerPadding"];
|
|
26
|
+
// console.log("outerSpec", outerSpec);
|
|
26
27
|
// const styles = this.$styles(outerSpec);
|
|
27
28
|
//
|
|
28
29
|
// const styles = this.genericStyles();
|
|
@@ -35,6 +36,8 @@ export default {
|
|
|
35
36
|
// width: this.spec.width,
|
|
36
37
|
// height: this.spec.height
|
|
37
38
|
// });
|
|
39
|
+
//
|
|
40
|
+
// console.log("styles", styles);
|
|
38
41
|
|
|
39
42
|
// Let the specified styles be handled by the child panel.
|
|
40
43
|
const styles = this.$styles({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="classes()" :style="genericStyles()">
|
|
3
3
|
<div v-if="spec.left" class="layouts-split__side">
|
|
4
|
-
<panels-responsive :spec="spec.left" />
|
|
4
|
+
<panels-responsive :spec="spec.left" v-if="spec.left" class="layouts-split__side" />
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<div class="layouts-split__expand">
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
spec: { type: Object, required: true }
|
|
24
24
|
},
|
|
25
25
|
methods: {
|
|
26
|
-
classes: function() {
|
|
26
|
+
classes: function () {
|
|
27
27
|
return this.$classes().concat("layouts-split");
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -3,45 +3,25 @@
|
|
|
3
3
|
<div ref="topAnchor"></div>
|
|
4
4
|
|
|
5
5
|
<table :style="$styles()" :class="$classes()">
|
|
6
|
-
<template v-for="(section, sectionIndex) in sections">
|
|
7
|
-
<thead
|
|
6
|
+
<template v-for="(section, sectionIndex) in sections" :key="`head_${sectionIndex}`">
|
|
7
|
+
<thead>
|
|
8
8
|
<tr v-if="importable || exportable">
|
|
9
9
|
<td colspan="10">
|
|
10
10
|
<div class="pa-3">
|
|
11
11
|
<template v-if="importable">
|
|
12
|
-
<span
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<input
|
|
19
|
-
ref="fileInput"
|
|
20
|
-
style="display: none;"
|
|
21
|
-
type="file"
|
|
22
|
-
accept=".csv"
|
|
23
|
-
@change="loadFile($event, section)"
|
|
24
|
-
/>
|
|
12
|
+
<span>{{
|
|
13
|
+
rows(section).length + section.dataRows.length
|
|
14
|
+
}}
|
|
15
|
+
rows</span>
|
|
16
|
+
<input ref="fileInput" style="display: none;" type="file" accept=".csv"
|
|
17
|
+
@change="loadFile($event, section)" />
|
|
25
18
|
<v-btn @click="triggerImport(sectionIndex)">Import</v-btn>
|
|
26
|
-
<v-btn
|
|
27
|
-
|
|
28
|
-
@click="submitRows($event, section)"
|
|
29
|
-
>Save</v-btn
|
|
30
|
-
>
|
|
31
|
-
<v-btn
|
|
32
|
-
:disabled="totalRows(section) <= 0"
|
|
33
|
-
@click="clear(section)"
|
|
34
|
-
>Clear</v-btn
|
|
35
|
-
>
|
|
19
|
+
<v-btn :disabled="totalRows(section) <= 0" @click="submitRows($event, section)">Save</v-btn>
|
|
20
|
+
<v-btn :disabled="totalRows(section) <= 0" @click="clear(section)">Clear</v-btn>
|
|
36
21
|
</template>
|
|
37
22
|
|
|
38
23
|
<div class="float-right">
|
|
39
|
-
<v-btn
|
|
40
|
-
v-if="exportable"
|
|
41
|
-
:download="exportFile"
|
|
42
|
-
:href="exportCsv(section)"
|
|
43
|
-
>{{ exportLabel }}</v-btn
|
|
44
|
-
>
|
|
24
|
+
<v-btn v-if="exportable" :download="exportFile" :href="exportCsv(section)">{{ exportLabel }}</v-btn>
|
|
45
25
|
</div>
|
|
46
26
|
</div>
|
|
47
27
|
|
|
@@ -53,36 +33,22 @@
|
|
|
53
33
|
|
|
54
34
|
<tr v-if="section.header" :style="genericStyles(section.header)">
|
|
55
35
|
<template v-if="section.header.dataCells">
|
|
56
|
-
<th
|
|
57
|
-
v-for="(cell, index) in section.header.dataCells"
|
|
58
|
-
:key="index"
|
|
59
|
-
>
|
|
36
|
+
<th v-for="(cell, index) in section.header.dataCells" :key="index">
|
|
60
37
|
{{ cell }}
|
|
61
38
|
</th>
|
|
62
39
|
</template>
|
|
63
|
-
<th
|
|
64
|
-
v-for="(cell, index) in section.header.cellViews"
|
|
65
|
-
v-else
|
|
66
|
-
:key="index"
|
|
67
|
-
>
|
|
40
|
+
<th v-for="(cell, index) in section.header.cellViews" v-else :key="index">
|
|
68
41
|
<glib-component :spec="cell" />
|
|
69
42
|
</th>
|
|
70
43
|
</tr>
|
|
71
44
|
</thead>
|
|
72
45
|
|
|
73
|
-
<tbody
|
|
46
|
+
<tbody>
|
|
74
47
|
<!-- <tr v-for="(row, index) in section.rows" :key="`row_${index}`"> -->
|
|
75
|
-
<template v-for="(row, rowIndex) in section.rows">
|
|
76
|
-
<tr
|
|
77
|
-
:key="`
|
|
78
|
-
|
|
79
|
-
>
|
|
80
|
-
<td
|
|
81
|
-
v-for="(cell, cellIndex) in row.cellViews"
|
|
82
|
-
:key="`cell_${cellIndex}`"
|
|
83
|
-
:colSpan="colSpan(row, cellIndex)"
|
|
84
|
-
:style="colStyles(row, cellIndex)"
|
|
85
|
-
>
|
|
48
|
+
<template v-for="(row, rowIndex) in section.rows" :key="`row_${rowIndex}`">
|
|
49
|
+
<tr :class="row.onClick ? 'clickable' : ''">
|
|
50
|
+
<td v-for="(cell, cellIndex) in row.cellViews" :key="`cell_${cellIndex}`" :colSpan="colSpan(row, cellIndex)"
|
|
51
|
+
:style="colStyles(row, cellIndex)">
|
|
86
52
|
<!-- Prevent double links -->
|
|
87
53
|
<glib-component v-if="$href(cell)" :spec="cell" />
|
|
88
54
|
<a v-else :href="$href(row)" @click="$onClick($event, row)">
|
|
@@ -92,14 +58,8 @@
|
|
|
92
58
|
</tr>
|
|
93
59
|
</template>
|
|
94
60
|
|
|
95
|
-
<tr
|
|
96
|
-
v-for="(
|
|
97
|
-
:key="`data_row_${rowIndex}`"
|
|
98
|
-
>
|
|
99
|
-
<td
|
|
100
|
-
v-for="(cell, cellIndex) in row"
|
|
101
|
-
:key="`data_cell_${cellIndex}`"
|
|
102
|
-
>
|
|
61
|
+
<tr v-for="(row, rowIndex) in section.dataRows" :key="`data_row_${rowIndex}`">
|
|
62
|
+
<td v-for="(cell, cellIndex) in row" :key="`data_cell_${cellIndex}`">
|
|
103
63
|
<a class="data-cell">{{ cell }}</a>
|
|
104
64
|
</td>
|
|
105
65
|
</tr>
|
|
@@ -139,6 +99,9 @@ export default {
|
|
|
139
99
|
// const createdAt = row[5]
|
|
140
100
|
// const activationState = row[14] ? 'active' : 'pending'
|
|
141
101
|
// count += 1
|
|
102
|
+
// if (email.includes("'")) {
|
|
103
|
+
// console.log("INVALID NAME", name)
|
|
104
|
+
// }
|
|
142
105
|
// str += `{ name: "${name}".to_s, email: '${email}'.to_s, created_at: '${createdAt}', activation_state: '${activationState}'},\n`
|
|
143
106
|
// }
|
|
144
107
|
// }
|
|
@@ -151,8 +114,8 @@ export default {
|
|
|
151
114
|
this.sections = this.spec.sections;
|
|
152
115
|
for (const section of this.sections) {
|
|
153
116
|
section.header = section.header || {};
|
|
154
|
-
// Use
|
|
155
|
-
|
|
117
|
+
// Use Object.assign() to bind the nested property
|
|
118
|
+
Object.assign(section, { dataRows: [] });
|
|
156
119
|
}
|
|
157
120
|
this.autoloadAll(this.spec.nextPage);
|
|
158
121
|
this.initCsvExport();
|
|
@@ -192,6 +155,7 @@ export default {
|
|
|
192
155
|
table {
|
|
193
156
|
border-spacing: 0;
|
|
194
157
|
}
|
|
158
|
+
|
|
195
159
|
thead {
|
|
196
160
|
th {
|
|
197
161
|
padding: 10px 4px;
|
|
@@ -199,11 +163,13 @@ thead {
|
|
|
199
163
|
// border-left: 1px solid rgba(0, 0, 0, 0.12);
|
|
200
164
|
}
|
|
201
165
|
}
|
|
166
|
+
|
|
202
167
|
tbody {
|
|
203
168
|
tr.clickable {
|
|
204
|
-
td
|
|
169
|
+
td>a {
|
|
205
170
|
cursor: pointer;
|
|
206
171
|
}
|
|
172
|
+
|
|
207
173
|
&:hover {
|
|
208
174
|
background: #eee;
|
|
209
175
|
}
|
|
@@ -221,13 +187,16 @@ tbody {
|
|
|
221
187
|
}
|
|
222
188
|
}
|
|
223
189
|
}
|
|
190
|
+
|
|
224
191
|
.scrollable {
|
|
225
192
|
width: 100%;
|
|
226
193
|
overflow: auto;
|
|
227
194
|
}
|
|
195
|
+
|
|
228
196
|
.data-cell {
|
|
229
197
|
white-space: pre-line;
|
|
230
198
|
}
|
|
199
|
+
|
|
231
200
|
table.table--grid {
|
|
232
201
|
tbody {
|
|
233
202
|
td {
|
|
@@ -1,43 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- Paddings cannot be applied to v-timeline directly -->
|
|
3
3
|
<div :style="$styles()" :class="$classes()">
|
|
4
|
-
<v-timeline v-if="events" dense align-top>
|
|
5
|
-
<v-timeline-item
|
|
6
|
-
|
|
7
|
-
:
|
|
8
|
-
:color="item.backgroundColor || 'white'"
|
|
9
|
-
:small="itemClasses(item).includes('small')"
|
|
10
|
-
:large="itemClasses(item).includes('large')"
|
|
11
|
-
:hide-dot="item.hide_dot"
|
|
12
|
-
fill-dot
|
|
13
|
-
>
|
|
4
|
+
<v-timeline v-if="events" :dense="true" align-top>
|
|
5
|
+
<v-timeline-item v-for="(item, index) in events" :key="index" :color="item.backgroundColor || 'white'"
|
|
6
|
+
:small="itemClasses(item).includes('small') || null" :large="itemClasses(item).includes('large')"
|
|
7
|
+
:hide-dot="item.hide_dot" fill-dot>
|
|
14
8
|
<template v-slot:icon>
|
|
15
|
-
<div
|
|
16
|
-
:
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
>
|
|
20
|
-
<div
|
|
21
|
-
v-if="item.text"
|
|
22
|
-
class="number-circle"
|
|
23
|
-
:style="{ color: item.color }"
|
|
24
|
-
>
|
|
9
|
+
<div :class="
|
|
10
|
+
itemClasses(item).includes('outlined') ? 'outlined-dots' : ''
|
|
11
|
+
">
|
|
12
|
+
<div v-if="item.text" class="number-circle" :style="{ color: item.color }">
|
|
25
13
|
{{ item.text }}
|
|
26
14
|
</div>
|
|
27
15
|
<div v-else class="icon">
|
|
28
|
-
<common-icon
|
|
29
|
-
:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}"
|
|
33
|
-
/>
|
|
16
|
+
<common-icon :spec="{
|
|
17
|
+
material: { name: item.icon, size: iconSize(item) },
|
|
18
|
+
color: item.color
|
|
19
|
+
}" />
|
|
34
20
|
</div>
|
|
35
21
|
</div>
|
|
36
22
|
</template>
|
|
37
|
-
<panels-responsive
|
|
38
|
-
v-if="childViews"
|
|
39
|
-
:spec="{ childViews: [childViews[index]] }"
|
|
40
|
-
/>
|
|
23
|
+
<panels-responsive v-if="childViews" :spec="{ childViews: [childViews[index]] }" />
|
|
41
24
|
</v-timeline-item>
|
|
42
25
|
</v-timeline>
|
|
43
26
|
</div>
|
|
@@ -78,6 +61,7 @@ export default {
|
|
|
78
61
|
height: 36px;
|
|
79
62
|
width: 36px;
|
|
80
63
|
}
|
|
64
|
+
|
|
81
65
|
.v-timeline-item__dot--small {
|
|
82
66
|
height: 20px;
|
|
83
67
|
width: 20px;
|
|
@@ -88,13 +72,16 @@ export default {
|
|
|
88
72
|
.v-timeline {
|
|
89
73
|
padding-top: 0px;
|
|
90
74
|
}
|
|
75
|
+
|
|
91
76
|
.v-timeline-item {
|
|
92
77
|
// Minimum line distance
|
|
93
78
|
padding-bottom: 10px;
|
|
94
79
|
}
|
|
80
|
+
|
|
95
81
|
.container {
|
|
96
82
|
padding-top: 0px;
|
|
97
83
|
}
|
|
84
|
+
|
|
98
85
|
.outlined-dots {
|
|
99
86
|
border-radius: 50%;
|
|
100
87
|
width: 100%;
|
|
@@ -106,11 +93,13 @@ export default {
|
|
|
106
93
|
padding: 4px 0;
|
|
107
94
|
// font-size: 22px;
|
|
108
95
|
}
|
|
96
|
+
|
|
109
97
|
.outlined .v-timeline-item {
|
|
110
98
|
::v-deep .v-timeline-item__dot {
|
|
111
99
|
box-shadow: none;
|
|
112
100
|
}
|
|
113
101
|
}
|
|
102
|
+
|
|
114
103
|
.icon {
|
|
115
104
|
display: inline-flex;
|
|
116
105
|
vertical-align: middle;
|
|
@@ -120,6 +109,7 @@ export default {
|
|
|
120
109
|
.number-circle {
|
|
121
110
|
font-size: 16px;
|
|
122
111
|
}
|
|
112
|
+
|
|
123
113
|
.small {
|
|
124
114
|
.number-circle {
|
|
125
115
|
font-size: 14px;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component
|
|
3
|
-
:
|
|
4
|
-
:class="cssClasses"
|
|
5
|
-
:style="cssStyles"
|
|
6
|
-
:href="$href()"
|
|
7
|
-
@click="$onClick()"
|
|
8
|
-
>
|
|
9
|
-
<template v-for="(item, index) in spec.childViews">
|
|
2
|
+
<component :is="componentName" :class="cssClasses" :style="cssStyles" :href="$href()" @click="$onClick()">
|
|
3
|
+
<template v-for="(item, index) in spec.childViews" :key="`${index}_${item.view}`">
|
|
10
4
|
<!-- Use view name for key to avoid component reuse issue -->
|
|
11
|
-
<glib-component :
|
|
5
|
+
<glib-component :spec="item" />
|
|
12
6
|
</template>
|
|
13
7
|
</component>
|
|
14
8
|
</template>
|
|
@@ -19,7 +13,7 @@ export default {
|
|
|
19
13
|
spec: { type: Object, required: true }
|
|
20
14
|
},
|
|
21
15
|
computed: {
|
|
22
|
-
cssClasses: function() {
|
|
16
|
+
cssClasses: function () {
|
|
23
17
|
// TODO: Remove this after migrating to `panels/responsive`
|
|
24
18
|
// Vertical panels are nameless when used in predefined layout (e.g. page.body, list.header, etc.)
|
|
25
19
|
this.spec.view = this.spec.view || "panels/vertical";
|
|
@@ -35,7 +29,7 @@ export default {
|
|
|
35
29
|
}
|
|
36
30
|
return classes;
|
|
37
31
|
},
|
|
38
|
-
cssStyles: function() {
|
|
32
|
+
cssStyles: function () {
|
|
39
33
|
const styles = this.genericStyles();
|
|
40
34
|
switch (this.spec.align) {
|
|
41
35
|
case "center":
|
|
@@ -92,11 +86,12 @@ a.panels-vertical {
|
|
|
92
86
|
</style>
|
|
93
87
|
|
|
94
88
|
<style>
|
|
95
|
-
.layouts-vertical--fill-equally
|
|
89
|
+
.layouts-vertical--fill-equally>* {
|
|
96
90
|
flex: initial;
|
|
97
91
|
height: 100% !important;
|
|
98
92
|
}
|
|
99
|
-
|
|
93
|
+
|
|
94
|
+
.layouts-vertical--space-equally>* {
|
|
100
95
|
flex: initial;
|
|
101
96
|
}
|
|
102
97
|
</style>
|