glib-web 2.5.0 → 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/.eslintrc.js +0 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/action.js +6 -1
- package/actions/analytics/logEvent.js +0 -0
- package/actions/auth/creditCard.js +0 -0
- package/actions/auth/restart.js +0 -0
- package/actions/auth/saveCsrfToken.js +0 -0
- package/actions/cables/push.js +0 -0
- package/actions/commands/copy.js +0 -0
- package/actions/commands/enqueue.js +17 -0
- package/actions/components/update.js +13 -14
- package/actions/dialogs/alert.js +0 -0
- package/actions/dialogs/close.js +0 -0
- package/actions/dialogs/notification.js +0 -0
- package/actions/dialogs/oauth.js +0 -0
- package/actions/dialogs/open.js +0 -0
- package/actions/dialogs/options.js +0 -0
- package/actions/dialogs/reload.js +0 -0
- package/actions/dialogs/show.js +0 -0
- package/actions/http/delete.js +0 -0
- package/actions/http/patch.js +0 -0
- package/actions/http/post.js +0 -0
- package/actions/http/put.js +0 -0
- package/actions/panels/scrollTo.js +0 -0
- package/actions/panels/scrollToBottom.js +0 -0
- package/actions/runMultiple.js +0 -0
- package/actions/sheets/select.js +0 -0
- package/actions/snackbars/alert.js +0 -0
- package/actions/snackbars/select.js +0 -0
- package/actions/timeouts/set.js +0 -0
- package/actions/tours/start.js +0 -0
- package/actions/windows/close.js +0 -0
- package/actions/windows/closeAll.js +0 -0
- package/actions/windows/closeWithReload.js +0 -0
- package/actions/windows/open.js +0 -0
- package/actions/windows/openWeb.js +0 -0
- package/actions/windows/print.js +0 -0
- package/actions/windows/refreshState.js +0 -0
- package/actions/windows/reload.js +0 -0
- package/actions/ws/push.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/calendar.vue +0 -0
- package/components/component.vue +96 -101
- 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/creditCard.vue +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/file.vue +0 -0
- package/components/fields/googlePlace.vue +0 -0
- package/components/fields/hidden.vue +0 -0
- package/components/fields/location.vue +0 -0
- package/components/fields/newRichText.vue +66 -53
- package/components/fields/otpField.vue +6 -14
- package/components/fields/phone/countries.js +0 -0
- package/components/fields/phone/field.vue +60 -78
- package/components/fields/phone/sprite.css +0 -0
- 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/stripe/stripeFields.vue +0 -0
- package/components/fields/stripe/stripeIndividualFields.vue +0 -0
- package/components/fields/stripeExternalAccount.vue +10 -24
- package/components/fields/stripeToken.vue +0 -0
- package/components/fields/submit.vue +0 -0
- 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/h1.vue +0 -0
- package/components/h2.vue +0 -0
- package/components/h3.vue +0 -0
- package/components/h5.vue +0 -0
- package/components/h6.vue +0 -0
- package/components/hr.vue +0 -0
- package/components/html.vue +0 -0
- package/components/icon.vue +0 -0
- package/components/image.vue +13 -20
- package/components/label.vue +0 -0
- package/components/markdown.vue +15 -8
- package/components/mixins/chart/annotation.js +0 -0
- package/components/mixins/chart/tooltip.js +0 -0
- package/components/mixins/dataset.js +0 -0
- package/components/mixins/events.js +17 -6
- package/components/mixins/extension.js +0 -0
- package/components/mixins/list/autoload.js +0 -0
- 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/autoload.js +0 -0
- package/components/mixins/table/export.js +0 -0
- package/components/mixins/table/import.js +0 -0
- package/components/mixins/text.js +0 -0
- package/components/mixins/ws/actionCable.js +0 -0
- package/components/mixins/ws/phoenixSocket.js +0 -0
- package/components/multimedia/video.vue +0 -0
- package/components/p.vue +0 -0
- package/components/panels/carousel.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/scroll.vue +0 -0
- 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/panels/web.vue +0 -0
- package/components/progressbar.vue +0 -0
- package/components/spacer.vue +0 -0
- package/components/switch.vue +0 -0
- 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/static/plugins/alignment/alignment.js +0 -0
- package/static/plugins/alignment/alignment.min.js +0 -0
- package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
- package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
- package/static/plugins/blockcode/blockcode.js +0 -0
- package/static/plugins/blockcode/blockcode.min.js +0 -0
- package/static/plugins/clips/clips.js +0 -0
- package/static/plugins/clips/clips.min.js +0 -0
- package/static/plugins/counter/counter.js +0 -0
- package/static/plugins/counter/counter.min.js +0 -0
- package/static/plugins/definedlinks/definedlinks.js +0 -0
- package/static/plugins/definedlinks/definedlinks.min.js +0 -0
- package/static/plugins/handle/handle.js +0 -0
- package/static/plugins/handle/handle.min.js +0 -0
- package/static/plugins/icons/icons.js +0 -0
- package/static/plugins/icons/icons.min.js +0 -0
- package/static/plugins/imageposition/imageposition.js +0 -0
- package/static/plugins/imageposition/imageposition.min.js +0 -0
- package/static/plugins/inlineformat/inlineformat.js +0 -0
- package/static/plugins/inlineformat/inlineformat.min.js +0 -0
- package/static/plugins/removeformat/removeformat.js +0 -0
- package/static/plugins/removeformat/removeformat.min.js +0 -0
- package/static/plugins/selector/selector.js +0 -0
- package/static/plugins/selector/selector.min.js +0 -0
- package/static/plugins/specialchars/specialchars.js +0 -0
- package/static/plugins/specialchars/specialchars.min.js +0 -0
- package/static/plugins/textdirection/textdirection.js +0 -0
- package/static/plugins/textdirection/textdirection.min.js +0 -0
- package/static/plugins/textexpander/textexpander.js +0 -0
- package/static/plugins/textexpander/textexpander.min.js +0 -0
- package/static/plugins/underline/underline.js +0 -0
- package/static/plugins/underline/underline.min.js +0 -0
- package/static/redactorx.css +0 -0
- package/static/redactorx.js +0 -0
- package/static/redactorx.min.css +0 -0
- package/static/redactorx.min.js +0 -0
- package/static/redactorx.usm.min.js +0 -0
- package/styles/test.sass +0 -0
- package/styles/test.scss +0 -0
- package/templates/_menu.vue +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/helper.js +0 -0
- package/utils/history.js +7 -4
- package/utils/http.js +7 -2
- package/utils/launch.js +43 -51
- package/utils/mime_type.js +0 -0
- package/utils/private/ws.js +0 -0
- package/utils/public.js +6 -0
- package/utils/queue.js +110 -0
- package/utils/settings.js +3 -1
- package/utils/type.js +0 -0
- package/utils/uploader.js +0 -0
|
@@ -1,25 +1,55 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component
|
|
2
|
+
<!-- <component
|
|
3
3
|
:is="componentName"
|
|
4
4
|
:class="cssClasses"
|
|
5
5
|
:style="cssStyles"
|
|
6
6
|
:href="$href()"
|
|
7
7
|
@click="$onClick()"
|
|
8
8
|
>
|
|
9
|
-
<template
|
|
10
|
-
|
|
9
|
+
<template
|
|
10
|
+
v-for="(item, index) in spec.childViews"
|
|
11
|
+
:key="index"
|
|
12
|
+
>
|
|
13
|
+
<glib-component :spec="item" />
|
|
11
14
|
</template>
|
|
15
|
+
</component> -->
|
|
16
|
+
<component :is="componentName" :style="parentStyles" :class="parentClasses" :href="$href()" @click="$onClick()">
|
|
17
|
+
<!-- <draggable :style="childStyles" :class="childClasses" ghost-class="ghost" -->
|
|
18
|
+
<!-- :group="dragSupport ? dragSupport.groupId || 'common' : 'common'" :data-dragPanelId="spec.id"
|
|
19
|
+
:disabled="!$type.isObject(spec.dragSupport)" @start="onDragStart" @end="onDragEnd"> -->
|
|
20
|
+
<!-- Using `item.id` as key is important to make sure the item gets updated
|
|
21
|
+
when dragging ends. -->
|
|
22
|
+
<div :style="childStyles" :class="childClasses">
|
|
23
|
+
<template v-for="(item, index) in childViews" :key="item.id || index">
|
|
24
|
+
<glib-component :spec="item" />
|
|
25
|
+
</template>
|
|
26
|
+
</div>
|
|
27
|
+
<!-- </draggable> -->
|
|
12
28
|
</component>
|
|
13
29
|
</template>
|
|
14
30
|
|
|
15
31
|
<script>
|
|
32
|
+
// import draggable from "vuedraggable";
|
|
33
|
+
|
|
16
34
|
export default {
|
|
35
|
+
components: {
|
|
36
|
+
// draggable
|
|
37
|
+
},
|
|
17
38
|
props: {
|
|
18
|
-
spec: { type: Object, required: true }
|
|
39
|
+
spec: { type: Object, required: true },
|
|
40
|
+
},
|
|
41
|
+
data: function () {
|
|
42
|
+
return {
|
|
43
|
+
dragSupport: null,
|
|
44
|
+
childViews: []
|
|
45
|
+
};
|
|
19
46
|
},
|
|
20
47
|
computed: {
|
|
21
|
-
|
|
22
|
-
|
|
48
|
+
parentClasses: function () {
|
|
49
|
+
return this.$classes();
|
|
50
|
+
},
|
|
51
|
+
childClasses() {
|
|
52
|
+
const classes = ["layouts-horizontal"];
|
|
23
53
|
const distribution = this.spec.distribution;
|
|
24
54
|
switch (distribution) {
|
|
25
55
|
case "fillEqually":
|
|
@@ -29,9 +59,12 @@ export default {
|
|
|
29
59
|
classes.push("layouts-horizontal--space-equally");
|
|
30
60
|
break;
|
|
31
61
|
default:
|
|
32
|
-
Utils.type.ifString(distribution, distribution => {
|
|
62
|
+
Utils.type.ifString(distribution, (distribution) => {
|
|
33
63
|
// Uses Material Design spacings: https://vuetifyjs.com/en/styles/spacing/#how-it-works
|
|
34
|
-
if (
|
|
64
|
+
if (
|
|
65
|
+
distribution.startsWith("overlap-") ||
|
|
66
|
+
distribution.startsWith("space-")
|
|
67
|
+
) {
|
|
35
68
|
classes.push(`layouts-horizontal--${distribution}`);
|
|
36
69
|
}
|
|
37
70
|
});
|
|
@@ -39,8 +72,16 @@ export default {
|
|
|
39
72
|
}
|
|
40
73
|
return classes;
|
|
41
74
|
},
|
|
42
|
-
|
|
43
|
-
const styles = this
|
|
75
|
+
parentStyles() {
|
|
76
|
+
const styles = this.$styles();
|
|
77
|
+
if (this.spec.width == "matchParent") {
|
|
78
|
+
styles["width"] = "100%";
|
|
79
|
+
}
|
|
80
|
+
return styles;
|
|
81
|
+
},
|
|
82
|
+
childStyles() {
|
|
83
|
+
const styles = {};
|
|
84
|
+
|
|
44
85
|
switch (this.spec.align) {
|
|
45
86
|
case "middle":
|
|
46
87
|
styles["align-items"] = "center";
|
|
@@ -51,15 +92,55 @@ export default {
|
|
|
51
92
|
default:
|
|
52
93
|
styles["align-items"] = "flex-start";
|
|
53
94
|
}
|
|
95
|
+
|
|
54
96
|
return styles;
|
|
55
97
|
},
|
|
56
98
|
componentName() {
|
|
57
|
-
return this
|
|
99
|
+
return this.spec.onClick ? "a" : "div";
|
|
58
100
|
}
|
|
59
101
|
},
|
|
60
102
|
methods: {
|
|
103
|
+
$ready() {
|
|
104
|
+
this.dragSupport = this.spec.dragSupport;
|
|
105
|
+
this.childViews = this.spec.childViews;
|
|
106
|
+
},
|
|
61
107
|
$displayValue() {
|
|
62
108
|
return "flex";
|
|
109
|
+
},
|
|
110
|
+
onDragStart(event) {
|
|
111
|
+
// This allows custom components to detect if something is being dragged.
|
|
112
|
+
window.vueApp.draggedComponent = this;
|
|
113
|
+
},
|
|
114
|
+
onDragEnd(event) {
|
|
115
|
+
window.vueApp.draggedComponent = null;
|
|
116
|
+
|
|
117
|
+
const targetRowIndex = event.newIndex;
|
|
118
|
+
if (event.from == event.to && event.oldIndex == targetRowIndex) {
|
|
119
|
+
console.log("Reordering canceled");
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
console.log("DRAG1", this.childViews);
|
|
124
|
+
|
|
125
|
+
const itemId = event.clone.dataset.dragitemid; // The item that got dragged/dropped
|
|
126
|
+
const oldPanelId = event.from.dataset.dragpanelid;
|
|
127
|
+
const newPanelId = event.to.dataset.dragpanelid;
|
|
128
|
+
|
|
129
|
+
const dragSpec = this.spec.dragSupport;
|
|
130
|
+
const mergedSpec = Object.assign(dragSpec.onDrop, {
|
|
131
|
+
[dragSpec.paramNameForFormData || "formData"]: {
|
|
132
|
+
[dragSpec.paramNameForNewAbsoluteIndex || "newIndex"]: targetRowIndex,
|
|
133
|
+
[dragSpec.paramNameForItemId || "itemId"]: itemId,
|
|
134
|
+
[dragSpec.paramNameForOldPanelId || "oldPanelId"]: oldPanelId,
|
|
135
|
+
[dragSpec.paramNameForNewPanelId || "newPanelId"]: newPanelId
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
console.log("DRAG2", mergedSpec, event.clone, event);
|
|
140
|
+
|
|
141
|
+
GLib.action.execute(mergedSpec, this);
|
|
142
|
+
|
|
143
|
+
console.log("DRAG3", this.childViews);
|
|
63
144
|
}
|
|
64
145
|
}
|
|
65
146
|
};
|
|
@@ -100,26 +181,76 @@ a.panels-horizontal {
|
|
|
100
181
|
</style>
|
|
101
182
|
|
|
102
183
|
<style>
|
|
103
|
-
.layouts-horizontal--fill-equally
|
|
184
|
+
.layouts-horizontal--fill-equally>* {
|
|
104
185
|
flex: initial;
|
|
105
186
|
width: 100%;
|
|
106
187
|
}
|
|
107
|
-
|
|
188
|
+
|
|
189
|
+
.layouts-horizontal--space-equally>* {
|
|
108
190
|
flex: initial;
|
|
109
191
|
}
|
|
110
|
-
|
|
192
|
+
|
|
193
|
+
.layouts-horizontal--overlap-1>*:not(:first-child) {
|
|
111
194
|
margin-left: -4px;
|
|
112
195
|
}
|
|
113
|
-
|
|
196
|
+
|
|
197
|
+
.layouts-horizontal--overlap-2>*:not(:first-child) {
|
|
114
198
|
margin-left: -8px;
|
|
115
199
|
}
|
|
116
|
-
|
|
200
|
+
|
|
201
|
+
.layouts-horizontal--overlap-3>*:not(:first-child) {
|
|
117
202
|
margin-left: -12px;
|
|
118
203
|
}
|
|
119
|
-
|
|
204
|
+
|
|
205
|
+
.layouts-horizontal--overlap-4>*:not(:first-child) {
|
|
120
206
|
margin-left: -16px;
|
|
121
207
|
}
|
|
122
|
-
|
|
208
|
+
|
|
209
|
+
.layouts-horizontal--overlap-5>*:not(:first-child) {
|
|
123
210
|
margin-left: -20px;
|
|
124
211
|
}
|
|
212
|
+
|
|
213
|
+
.layouts-horizontal--overlap-6>*:not(:first-child) {
|
|
214
|
+
margin-left: -24px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.layouts-horizontal--overlap-7>*:not(:first-child) {
|
|
218
|
+
margin-left: -28px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.layouts-horizontal--overlap-8>*:not(:first-child) {
|
|
222
|
+
margin-left: -32px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.layouts-horizontal--space-1>*:not(:first-child) {
|
|
226
|
+
margin-left: 4px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.layouts-horizontal--space-2>*:not(:first-child) {
|
|
230
|
+
margin-left: 8px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.layouts-horizontal--space-3>*:not(:first-child) {
|
|
234
|
+
margin-left: 12px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.layouts-horizontal--space-4>*:not(:first-child) {
|
|
238
|
+
margin-left: 16px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.layouts-horizontal--space-5>*:not(:first-child) {
|
|
242
|
+
margin-left: 20px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.layouts-horizontal--space-6>*:not(:first-child) {
|
|
246
|
+
margin-left: 24px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.layouts-horizontal--space-7>*:not(:first-child) {
|
|
250
|
+
margin-left: 28px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.layouts-horizontal--space-8>*:not(:first-child) {
|
|
254
|
+
margin-left: 32px;
|
|
255
|
+
}
|
|
125
256
|
</style>
|
|
@@ -1,51 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-list
|
|
3
|
-
:two-line="twoLine"
|
|
4
|
-
:three-line="threeLine"
|
|
5
|
-
class="py-0"
|
|
6
|
-
:style="genericStyles()"
|
|
7
|
-
>
|
|
2
|
+
<v-list :two-line="twoLine || null" :three-line="threeLine || null" class="py-0" :class="$classes()" :style="$styles()">
|
|
8
3
|
<div ref="topAnchor">
|
|
9
4
|
<div v-if="prevPageUrl" class="py-3 px-4">
|
|
10
5
|
Loading...
|
|
11
6
|
</div>
|
|
12
7
|
</div>
|
|
13
8
|
|
|
14
|
-
<template v-for="(section, sectionIndex) in sections">
|
|
15
|
-
<div
|
|
9
|
+
<template v-for="(section, sectionIndex) in sections" :key="`section${sectionIndex}`">
|
|
10
|
+
<div>
|
|
16
11
|
<panels-responsive v-if="section.header" :spec="section.header" />
|
|
17
12
|
|
|
18
|
-
<draggable
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
:data-
|
|
24
|
-
|
|
25
|
-
>
|
|
26
|
-
<div
|
|
27
|
-
v-for="(row, rowIndex) in section.rows"
|
|
28
|
-
:key="`${sectionIndex}_${rowIndex}`"
|
|
29
|
-
:ref="`row_${sectionIndex}_${rowIndex}`"
|
|
30
|
-
:class="row.styleClasses"
|
|
31
|
-
>
|
|
32
|
-
<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" />
|
|
33
20
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
!spec.responsiveCols &&
|
|
43
|
-
(rowIndex != section.rows.length - 1 ||
|
|
44
|
-
sectionIndex != sections.length - 1)
|
|
45
|
-
"
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
</draggable>
|
|
21
|
+
<component :is="template(row)" :spec="rowSpec(row)" :responsive-cols="spec.responsiveCols" :index="rowIndex" />
|
|
22
|
+
<v-divider v-if="
|
|
23
|
+
!spec.responsiveCols &&
|
|
24
|
+
(rowIndex != section.rows.length - 1 ||
|
|
25
|
+
sectionIndex != sections.length - 1)
|
|
26
|
+
" />
|
|
27
|
+
</div>
|
|
28
|
+
<!-- </draggable> -->
|
|
49
29
|
|
|
50
30
|
<panels-responsive v-if="section.footer" :spec="section.footer" />
|
|
51
31
|
</div>
|
|
@@ -60,28 +40,29 @@
|
|
|
60
40
|
</template>
|
|
61
41
|
|
|
62
42
|
<script>
|
|
63
|
-
import draggable from "vuedraggable";
|
|
43
|
+
// import draggable from "vuedraggable";
|
|
64
44
|
import autoloadMixin from "../mixins/list/autoload.js";
|
|
65
|
-
import ThumbnailTemplate from "../../templates/thumbnail";
|
|
66
|
-
import FeaturedTemplate from "../../templates/featured";
|
|
67
|
-
import CommentTemplate from "../../templates/comment";
|
|
45
|
+
import ThumbnailTemplate from "../../templates/thumbnail.vue";
|
|
46
|
+
import FeaturedTemplate from "../../templates/featured.vue";
|
|
47
|
+
import CommentTemplate from "../../templates/comment.vue";
|
|
68
48
|
import actionCableMixin from "../mixins/ws/actionCable.js";
|
|
69
49
|
|
|
70
50
|
export default {
|
|
71
51
|
components: {
|
|
72
|
-
draggable,
|
|
52
|
+
// draggable,
|
|
73
53
|
"template-thumbnail": ThumbnailTemplate,
|
|
74
54
|
"template-featured": FeaturedTemplate,
|
|
75
55
|
"template-commentOutgoing": CommentTemplate,
|
|
76
|
-
"template-commentIncoming": CommentTemplate
|
|
56
|
+
"template-commentIncoming": CommentTemplate,
|
|
77
57
|
},
|
|
78
58
|
mixins: [autoloadMixin, actionCableMixin],
|
|
79
59
|
props: {
|
|
80
|
-
spec: { type: Object, required: true }
|
|
60
|
+
spec: { type: Object, required: true },
|
|
81
61
|
},
|
|
82
|
-
data: function() {
|
|
62
|
+
data: function () {
|
|
83
63
|
return {
|
|
84
|
-
sections: []
|
|
64
|
+
sections: [],
|
|
65
|
+
dragSupport: null
|
|
85
66
|
};
|
|
86
67
|
},
|
|
87
68
|
computed: {
|
|
@@ -106,11 +87,12 @@ export default {
|
|
|
106
87
|
}
|
|
107
88
|
}
|
|
108
89
|
return false;
|
|
109
|
-
}
|
|
90
|
+
},
|
|
110
91
|
},
|
|
111
92
|
methods: {
|
|
112
93
|
$ready() {
|
|
113
94
|
this.sections = this.spec.sections || [];
|
|
95
|
+
this.dragSupport = this.spec.dragSupport;
|
|
114
96
|
this.autoloadAll(this.spec.nextPage);
|
|
115
97
|
this.enableInfiniteScrollIfApplicable();
|
|
116
98
|
this.$wsSubscribeEvents(this.spec.phoenixSocket);
|
|
@@ -128,7 +110,7 @@ export default {
|
|
|
128
110
|
fieldTitleName: this.spec.fieldTitleName
|
|
129
111
|
? `${prefix}[${this.spec.fieldTitleName}]`
|
|
130
112
|
: null,
|
|
131
|
-
fieldCheckValueIf: this.spec.fieldCheckValueIf
|
|
113
|
+
fieldCheckValueIf: this.spec.fieldCheckValueIf,
|
|
132
114
|
});
|
|
133
115
|
}
|
|
134
116
|
return row;
|
|
@@ -151,7 +133,7 @@ export default {
|
|
|
151
133
|
this.$set(section, "rows", []);
|
|
152
134
|
}
|
|
153
135
|
|
|
154
|
-
Utils.type.ifArray(appendedSection.rows, rows => {
|
|
136
|
+
Utils.type.ifArray(appendedSection.rows, (rows) => {
|
|
155
137
|
for (const row of rows) {
|
|
156
138
|
section.rows.push(row);
|
|
157
139
|
}
|
|
@@ -161,14 +143,14 @@ export default {
|
|
|
161
143
|
action_update(spec) {
|
|
162
144
|
const updatedRows = {};
|
|
163
145
|
|
|
164
|
-
Utils.type.ifArray(spec.rows, rows => {
|
|
146
|
+
Utils.type.ifArray(spec.rows, (rows) => {
|
|
165
147
|
for (const row of rows) {
|
|
166
148
|
updatedRows[row.id] = row;
|
|
167
149
|
}
|
|
168
150
|
});
|
|
169
151
|
|
|
170
152
|
for (const section of this.sections) {
|
|
171
|
-
section.rows = section.rows.map(row => {
|
|
153
|
+
section.rows = section.rows.map((row) => {
|
|
172
154
|
const updatedRow = updatedRows[row.id];
|
|
173
155
|
if (updatedRow) {
|
|
174
156
|
return updatedRow;
|
|
@@ -180,14 +162,14 @@ export default {
|
|
|
180
162
|
},
|
|
181
163
|
action_delete(spec) {
|
|
182
164
|
const deletedRows = {};
|
|
183
|
-
Utils.type.ifArray(spec.rows, rows => {
|
|
165
|
+
Utils.type.ifArray(spec.rows, (rows) => {
|
|
184
166
|
for (const row of rows) {
|
|
185
167
|
deletedRows[row.id] = row;
|
|
186
168
|
}
|
|
187
169
|
});
|
|
188
170
|
|
|
189
171
|
for (const section of this.sections) {
|
|
190
|
-
section.rows = section.rows.filter(row => {
|
|
172
|
+
section.rows = section.rows.filter((row) => {
|
|
191
173
|
// return !rows.includes(row.id);
|
|
192
174
|
return !deletedRows[row.id];
|
|
193
175
|
});
|
|
@@ -212,37 +194,48 @@ export default {
|
|
|
212
194
|
serializedSpec(row) {
|
|
213
195
|
return JSON.stringify(row);
|
|
214
196
|
},
|
|
197
|
+
onDragStart(event) {
|
|
198
|
+
// This allows custom components to detect if something is being dragged.
|
|
199
|
+
window.vueApp.draggedComponent = this;
|
|
200
|
+
},
|
|
215
201
|
onDragEnd(event) {
|
|
202
|
+
window.vueApp.draggedComponent = null;
|
|
203
|
+
|
|
216
204
|
const targetSectionedRowIndex = event.newIndex;
|
|
205
|
+
// const sourceSectionedRowIndex = event.oldIndex;
|
|
217
206
|
if (event.from == event.to && event.oldIndex == targetSectionedRowIndex) {
|
|
218
207
|
console.log("Reordering canceled");
|
|
219
208
|
return;
|
|
220
209
|
}
|
|
221
|
-
|
|
222
210
|
const targetSectionIndex = this.getSectionIndex(event.to);
|
|
223
|
-
const targetSection = this.getSection(targetSectionIndex);
|
|
224
|
-
// The dragged row is now on the new index
|
|
225
|
-
const draggedRow = targetSection.rows[targetSectionedRowIndex];
|
|
211
|
+
// const targetSection = this.getSection(targetSectionIndex);
|
|
226
212
|
|
|
227
213
|
const targetAbsoluteIndex =
|
|
228
214
|
this.previousSectionsRowCount(event.to) + targetSectionedRowIndex;
|
|
229
215
|
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
[
|
|
238
|
-
|
|
216
|
+
const rowId = event.clone.dataset.dragrowid; // The item that got dragged/dropped
|
|
217
|
+
const oldListId = event.from.dataset.draglistid;
|
|
218
|
+
const newListId = event.to.dataset.draglistid;
|
|
219
|
+
|
|
220
|
+
const dragSpec = this.dragSupport;
|
|
221
|
+
const mergedSpec = Object.assign(dragSpec.onDrop, {
|
|
222
|
+
[dragSpec.paramNameForFormData || "formData"]: {
|
|
223
|
+
[dragSpec.paramNameForNewAbsoluteIndex ||
|
|
224
|
+
"newAbsoluteIndex"]: targetAbsoluteIndex,
|
|
225
|
+
[dragSpec.paramNameForNewSectionIndex ||
|
|
226
|
+
"newSectionIndex"]: targetSectionIndex,
|
|
227
|
+
[dragSpec.paramNameForNewSectionedRowIndex ||
|
|
228
|
+
"newSectionedRowIndex"]: targetSectionedRowIndex,
|
|
229
|
+
[dragSpec.paramNameForRowId || "rowId"]: rowId,
|
|
230
|
+
[dragSpec.paramNameForOldListId || "oldListId"]: oldListId,
|
|
231
|
+
[dragSpec.paramNameForNewListId || "newListId"]: newListId
|
|
239
232
|
}
|
|
240
233
|
});
|
|
241
234
|
|
|
242
235
|
GLib.action.execute(mergedSpec, this);
|
|
243
236
|
},
|
|
244
237
|
getSectionIndex(element) {
|
|
245
|
-
return element.dataset.
|
|
238
|
+
return element.dataset.dragsectionindex;
|
|
246
239
|
},
|
|
247
240
|
getSection(sectionIndex) {
|
|
248
241
|
return this.sections[sectionIndex];
|
|
@@ -254,8 +247,8 @@ export default {
|
|
|
254
247
|
count += this.getSection(i).rows.length;
|
|
255
248
|
}
|
|
256
249
|
return count;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
250
|
+
},
|
|
251
|
+
},
|
|
259
252
|
};
|
|
260
253
|
</script>
|
|
261
254
|
|
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<!-- <common-responsive v-if="!hoverViewsSpec" :spec="spec" /> -->
|
|
4
|
-
<v-menu
|
|
5
|
-
v-if="hoverViewsSpec"
|
|
6
|
-
:close-on-content-click="false"
|
|
7
|
-
open-on-hover
|
|
8
|
-
offset-x
|
|
9
|
-
transition="scale-transition"
|
|
10
|
-
content-class="hover"
|
|
11
|
-
>
|
|
12
|
-
<template v-slot:activator="{ on, attrs }">
|
|
13
|
-
<div v-bind="attrs" v-on="on">
|
|
14
|
-
<common-responsive :spec="spec" />
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
<v-card>
|
|
18
|
-
<common-responsive :spec="hoverViewsSpec" />
|
|
19
|
-
</v-card>
|
|
20
|
-
</v-menu>
|
|
21
|
-
<common-tooltip v-else :spec="spec">
|
|
22
|
-
<template v-slot:activator="{ on }">
|
|
23
|
-
<common-responsive :spec="spec" :event-handlers="on" />
|
|
24
|
-
<!-- <common-button :spec="spec" :disabled="$isBusy" :event-handlers="on" /> -->
|
|
25
|
-
</template>
|
|
26
|
-
</common-tooltip>
|
|
27
|
-
</div>
|
|
2
|
+
<common-responsive :spec="spec" />
|
|
28
3
|
</template>
|
|
29
4
|
|
|
30
5
|
<script>
|
|
@@ -33,20 +8,25 @@ 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
|
}
|
|
40
15
|
},
|
|
41
16
|
data() {
|
|
42
17
|
return {
|
|
43
|
-
hoverViewsSpec:
|
|
44
|
-
? {
|
|
45
|
-
childViews: this.spec.hoverViews,
|
|
46
|
-
align: this.spec.align
|
|
47
|
-
}
|
|
48
|
-
: false
|
|
18
|
+
hoverViewsSpec: null
|
|
49
19
|
};
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
$ready() {
|
|
23
|
+
this.hoverViewsSpec = this.spec.hoverViews
|
|
24
|
+
? {
|
|
25
|
+
childViews: this.spec.hoverViews,
|
|
26
|
+
align: this.spec.align
|
|
27
|
+
}
|
|
28
|
+
: null;
|
|
29
|
+
}
|
|
50
30
|
}
|
|
51
31
|
};
|
|
52
32
|
</script>
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template v-if="content">
|
|
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
|
}
|