glib-web 0.5.77 → 0.5.78
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/README.md +0 -0
- package/action.js +167 -167
- package/actions/analytics/logEvent.js +0 -0
- package/actions/cables/push.js +0 -0
- package/actions/dialogs/notification.js +0 -0
- package/actions/http/patch.js +0 -0
- package/actions/panels/scrollTo.js +18 -18
- package/actions/panels/scrollToBottom.js +0 -0
- package/actions/timeouts/set.js +20 -20
- package/actions/windows/close.js +0 -0
- package/actions/windows/closeAll.js +0 -0
- package/actions/windows/closeWithReload.js +0 -0
- package/actions/windows/refreshState.js +5 -5
- package/actions/windows/reload.js +0 -0
- package/actions/ws/push.js +0 -0
- package/app.vue +180 -180
- package/components/_button.vue +101 -101
- package/components/_dropdownMenu.vue +76 -76
- package/components/_icon.vue +50 -50
- package/components/avatar.vue +16 -16
- package/components/banners/alert.vue +0 -0
- package/components/banners/select.vue +82 -82
- package/components/component.vue +222 -222
- package/components/fields/_patternText.vue +61 -61
- package/components/fields/_select.vue +86 -86
- package/components/fields/autocomplete.vue +73 -73
- package/components/fields/check.vue +104 -104
- package/components/fields/creditCard.vue +0 -0
- package/components/fields/dynamicGroup.vue +0 -0
- package/components/fields/hidden.vue +0 -0
- package/components/fields/location.vue +0 -0
- package/components/fields/newRichText.vue +0 -0
- package/components/fields/phone/countries.js +315 -315
- package/components/fields/phone/field.vue +348 -348
- package/components/fields/phone/sprite.css +1071 -1071
- package/components/fields/radio.vue +64 -64
- package/components/fields/radioGroup.vue +0 -0
- package/components/fields/rating.vue +0 -0
- package/components/fields/richText.vue +0 -0
- package/components/fields/select.vue +17 -17
- package/components/fields/stripe/stripeFields.vue +93 -93
- package/components/fields/stripe/stripeIndividualFields.vue +207 -207
- package/components/fields/stripeExternalAccount.vue +135 -135
- package/components/fields/text.vue +0 -0
- package/components/fields/textarea.vue +0 -0
- package/components/fields/timeZone.vue +22 -22
- package/components/fields/timer.vue +83 -83
- package/components/h1.vue +28 -28
- package/components/h2.vue +20 -20
- package/components/h3.vue +22 -22
- package/components/h4.vue +20 -20
- package/components/h5.vue +20 -20
- package/components/h6.vue +20 -20
- package/components/icon.vue +25 -25
- package/components/label.vue +62 -62
- package/components/map.vue +0 -0
- package/components/mixins/events.js +178 -178
- package/components/mixins/generic.js +0 -0
- package/components/mixins/list/autoload.js +0 -0
- package/components/mixins/styles.js +221 -221
- package/components/mixins/table/autoload.js +0 -0
- package/components/mixins/text.js +20 -20
- package/components/mixins/ws/actionCable.js +48 -48
- package/components/mixins/ws/phoenixSocket.js +0 -0
- package/components/panels/carousel.vue +55 -55
- package/components/panels/flow.vue +81 -81
- package/components/panels/form.vue +126 -126
- package/components/panels/list.vue +0 -0
- package/components/panels/scroll.vue +0 -0
- package/components/panels/table.vue +0 -0
- package/components/panels/ul.vue +34 -34
- package/components/panels/vertical.vue +0 -0
- package/components/panels/web.vue +11 -11
- package/components/spacer.vue +0 -0
- package/components/switch.vue +42 -42
- package/extensions/string.js +21 -21
- package/index.js +195 -195
- package/nav/content.vue +0 -0
- package/nav/dialog.vue +127 -127
- package/nav/snackbar.vue +0 -0
- package/package.json +42 -42
- 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/templates/_menu.vue +38 -38
- package/templates/comment.vue +202 -202
- package/templates/featured.vue +32 -32
- package/templates/thumbnail.vue +138 -138
- package/templates/unsupported.vue +12 -12
- package/utils/app.js +0 -0
- package/utils/hash.js +0 -0
- package/utils/helper.js +0 -0
- package/utils/history.js +70 -70
- package/utils/http.js +209 -209
- package/utils/launch.js +135 -135
- package/utils/private/ws.js +0 -0
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-card flat tile :style="$styles()">
|
|
3
|
-
<v-window v-model="selectedIndex">
|
|
4
|
-
<v-window-item v-for="(item, index) in spec.childViews" :key="index">
|
|
5
|
-
<ui-component :spec="item" />
|
|
6
|
-
</v-window-item>
|
|
7
|
-
</v-window>
|
|
8
|
-
|
|
9
|
-
<v-card-actions class="justify-space-between">
|
|
10
|
-
<v-btn text @click="prev">
|
|
11
|
-
<v-icon>chevron_left</v-icon>
|
|
12
|
-
</v-btn>
|
|
13
|
-
<v-item-group v-model="selectedIndex" class="text-center" mandatory>
|
|
14
|
-
<v-item v-for="(item, index) in spec.childViews" :key="index">
|
|
15
|
-
<v-btn
|
|
16
|
-
slot-scope="{ active, toggle }"
|
|
17
|
-
:input-value="active"
|
|
18
|
-
icon
|
|
19
|
-
@click="toggle"
|
|
20
|
-
>
|
|
21
|
-
<v-icon size="8">lens</v-icon>
|
|
22
|
-
</v-btn>
|
|
23
|
-
</v-item>
|
|
24
|
-
</v-item-group>
|
|
25
|
-
<v-btn text @click="next">
|
|
26
|
-
<v-icon>chevron_right</v-icon>
|
|
27
|
-
</v-btn>
|
|
28
|
-
</v-card-actions>
|
|
29
|
-
</v-card>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
export default {
|
|
34
|
-
props: {
|
|
35
|
-
spec: { type: Object, required: true }
|
|
36
|
-
},
|
|
37
|
-
data: () => ({
|
|
38
|
-
selectedIndex: 0
|
|
39
|
-
}),
|
|
40
|
-
methods: {
|
|
41
|
-
next() {
|
|
42
|
-
const length = this.spec.childViews.length;
|
|
43
|
-
this.selectedIndex =
|
|
44
|
-
this.selectedIndex + 1 === length ? 0 : this.selectedIndex + 1;
|
|
45
|
-
},
|
|
46
|
-
prev() {
|
|
47
|
-
const length = this.spec.childViews.length;
|
|
48
|
-
this.selectedIndex =
|
|
49
|
-
this.selectedIndex - 1 < 0 ? length - 1 : this.selectedIndex - 1;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<style scoped></style>
|
|
1
|
+
<template>
|
|
2
|
+
<v-card flat tile :style="$styles()">
|
|
3
|
+
<v-window v-model="selectedIndex">
|
|
4
|
+
<v-window-item v-for="(item, index) in spec.childViews" :key="index">
|
|
5
|
+
<ui-component :spec="item" />
|
|
6
|
+
</v-window-item>
|
|
7
|
+
</v-window>
|
|
8
|
+
|
|
9
|
+
<v-card-actions class="justify-space-between">
|
|
10
|
+
<v-btn text @click="prev">
|
|
11
|
+
<v-icon>chevron_left</v-icon>
|
|
12
|
+
</v-btn>
|
|
13
|
+
<v-item-group v-model="selectedIndex" class="text-center" mandatory>
|
|
14
|
+
<v-item v-for="(item, index) in spec.childViews" :key="index">
|
|
15
|
+
<v-btn
|
|
16
|
+
slot-scope="{ active, toggle }"
|
|
17
|
+
:input-value="active"
|
|
18
|
+
icon
|
|
19
|
+
@click="toggle"
|
|
20
|
+
>
|
|
21
|
+
<v-icon size="8">lens</v-icon>
|
|
22
|
+
</v-btn>
|
|
23
|
+
</v-item>
|
|
24
|
+
</v-item-group>
|
|
25
|
+
<v-btn text @click="next">
|
|
26
|
+
<v-icon>chevron_right</v-icon>
|
|
27
|
+
</v-btn>
|
|
28
|
+
</v-card-actions>
|
|
29
|
+
</v-card>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
export default {
|
|
34
|
+
props: {
|
|
35
|
+
spec: { type: Object, required: true }
|
|
36
|
+
},
|
|
37
|
+
data: () => ({
|
|
38
|
+
selectedIndex: 0
|
|
39
|
+
}),
|
|
40
|
+
methods: {
|
|
41
|
+
next() {
|
|
42
|
+
const length = this.spec.childViews.length;
|
|
43
|
+
this.selectedIndex =
|
|
44
|
+
this.selectedIndex + 1 === length ? 0 : this.selectedIndex + 1;
|
|
45
|
+
},
|
|
46
|
+
prev() {
|
|
47
|
+
const length = this.spec.childViews.length;
|
|
48
|
+
this.selectedIndex =
|
|
49
|
+
this.selectedIndex - 1 < 0 ? length - 1 : this.selectedIndex - 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<style scoped></style>
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="cssClasses" :style="cssStyles">
|
|
3
|
-
<template v-for="(item, index) in spec.childViews">
|
|
4
|
-
<!--
|
|
5
|
-
The wrapper prevents its content (e.g. image component) from getting stretched to fill
|
|
6
|
-
remaining space on the new line.
|
|
7
|
-
-->
|
|
8
|
-
<div :key="index" :style="innerStyles">
|
|
9
|
-
<ui-component :spec="item" />
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
props: {
|
|
18
|
-
spec: { type: Object, required: true }
|
|
19
|
-
},
|
|
20
|
-
computed: {
|
|
21
|
-
cssClasses: function() {
|
|
22
|
-
const classes = this.$classes().concat("layouts-flow");
|
|
23
|
-
// switch(this.spec.distribution) {
|
|
24
|
-
// case 'fillEqually':
|
|
25
|
-
// classes.push('layouts-horizontal--fill-equally')
|
|
26
|
-
// break
|
|
27
|
-
// case 'spaceEqually':
|
|
28
|
-
// classes.push('layouts-horizontal--space-equally')
|
|
29
|
-
// break
|
|
30
|
-
// }
|
|
31
|
-
return classes;
|
|
32
|
-
},
|
|
33
|
-
cssStyles: function() {
|
|
34
|
-
const styles = this.$styles();
|
|
35
|
-
// switch(this.spec.align) {
|
|
36
|
-
// case 'middle':
|
|
37
|
-
// styles['align-items'] = 'center'
|
|
38
|
-
// break
|
|
39
|
-
// case 'bottom':
|
|
40
|
-
// styles['align-items'] = 'flex-end'
|
|
41
|
-
// break
|
|
42
|
-
// default:
|
|
43
|
-
// styles['align-items'] = 'flex-start'
|
|
44
|
-
// }
|
|
45
|
-
return styles;
|
|
46
|
-
},
|
|
47
|
-
innerStyles() {
|
|
48
|
-
const styles = {};
|
|
49
|
-
Utils.type.ifObject(this.spec.innerPadding, padding => {
|
|
50
|
-
Utils.type.ifNumber(
|
|
51
|
-
padding.top,
|
|
52
|
-
top => (styles["padding-top"] = `${top}px`)
|
|
53
|
-
);
|
|
54
|
-
Utils.type.ifNumber(
|
|
55
|
-
padding.bottom,
|
|
56
|
-
bottom => (styles["padding-bottom"] = `${bottom}px`)
|
|
57
|
-
);
|
|
58
|
-
Utils.type.ifNumber(
|
|
59
|
-
padding.left,
|
|
60
|
-
left => (styles["padding-left"] = `${left}px`)
|
|
61
|
-
);
|
|
62
|
-
Utils.type.ifNumber(
|
|
63
|
-
padding.right,
|
|
64
|
-
right => (styles["padding-right"] = `${right}px`)
|
|
65
|
-
);
|
|
66
|
-
});
|
|
67
|
-
return styles;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
</script>
|
|
72
|
-
|
|
73
|
-
<style lang="scss" scoped>
|
|
74
|
-
.layouts-flow {
|
|
75
|
-
display: flex;
|
|
76
|
-
flex-wrap: wrap;
|
|
77
|
-
}
|
|
78
|
-
/* .layouts-horizontal > div {
|
|
79
|
-
display: inline-block;
|
|
80
|
-
} */
|
|
81
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="cssClasses" :style="cssStyles">
|
|
3
|
+
<template v-for="(item, index) in spec.childViews">
|
|
4
|
+
<!--
|
|
5
|
+
The wrapper prevents its content (e.g. image component) from getting stretched to fill
|
|
6
|
+
remaining space on the new line.
|
|
7
|
+
-->
|
|
8
|
+
<div :key="index" :style="innerStyles">
|
|
9
|
+
<ui-component :spec="item" />
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
props: {
|
|
18
|
+
spec: { type: Object, required: true }
|
|
19
|
+
},
|
|
20
|
+
computed: {
|
|
21
|
+
cssClasses: function() {
|
|
22
|
+
const classes = this.$classes().concat("layouts-flow");
|
|
23
|
+
// switch(this.spec.distribution) {
|
|
24
|
+
// case 'fillEqually':
|
|
25
|
+
// classes.push('layouts-horizontal--fill-equally')
|
|
26
|
+
// break
|
|
27
|
+
// case 'spaceEqually':
|
|
28
|
+
// classes.push('layouts-horizontal--space-equally')
|
|
29
|
+
// break
|
|
30
|
+
// }
|
|
31
|
+
return classes;
|
|
32
|
+
},
|
|
33
|
+
cssStyles: function() {
|
|
34
|
+
const styles = this.$styles();
|
|
35
|
+
// switch(this.spec.align) {
|
|
36
|
+
// case 'middle':
|
|
37
|
+
// styles['align-items'] = 'center'
|
|
38
|
+
// break
|
|
39
|
+
// case 'bottom':
|
|
40
|
+
// styles['align-items'] = 'flex-end'
|
|
41
|
+
// break
|
|
42
|
+
// default:
|
|
43
|
+
// styles['align-items'] = 'flex-start'
|
|
44
|
+
// }
|
|
45
|
+
return styles;
|
|
46
|
+
},
|
|
47
|
+
innerStyles() {
|
|
48
|
+
const styles = {};
|
|
49
|
+
Utils.type.ifObject(this.spec.innerPadding, padding => {
|
|
50
|
+
Utils.type.ifNumber(
|
|
51
|
+
padding.top,
|
|
52
|
+
top => (styles["padding-top"] = `${top}px`)
|
|
53
|
+
);
|
|
54
|
+
Utils.type.ifNumber(
|
|
55
|
+
padding.bottom,
|
|
56
|
+
bottom => (styles["padding-bottom"] = `${bottom}px`)
|
|
57
|
+
);
|
|
58
|
+
Utils.type.ifNumber(
|
|
59
|
+
padding.left,
|
|
60
|
+
left => (styles["padding-left"] = `${left}px`)
|
|
61
|
+
);
|
|
62
|
+
Utils.type.ifNumber(
|
|
63
|
+
padding.right,
|
|
64
|
+
right => (styles["padding-right"] = `${right}px`)
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
return styles;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<style lang="scss" scoped>
|
|
74
|
+
.layouts-flow {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-wrap: wrap;
|
|
77
|
+
}
|
|
78
|
+
/* .layouts-horizontal > div {
|
|
79
|
+
display: inline-block;
|
|
80
|
+
} */
|
|
81
|
+
</style>
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-form
|
|
3
|
-
ref="form"
|
|
4
|
-
:style="parentStyles"
|
|
5
|
-
:action="url"
|
|
6
|
-
:method="spec.method"
|
|
7
|
-
:data-local="spec.local"
|
|
8
|
-
@submit="onSubmit"
|
|
9
|
-
>
|
|
10
|
-
<template v-for="(value, key, index) in params">
|
|
11
|
-
<input
|
|
12
|
-
:key="`hidden_${index}`"
|
|
13
|
-
type="hidden"
|
|
14
|
-
:name="key"
|
|
15
|
-
:value="value"
|
|
16
|
-
/>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<panels-responsive :spec="modifiedSpec" />
|
|
20
|
-
</v-form>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
// import ActionsFormsSubmit from "../../actions/forms/submit";
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
props: {
|
|
28
|
-
spec: { type: Object, required: true }
|
|
29
|
-
},
|
|
30
|
-
data: () => ({
|
|
31
|
-
url: null,
|
|
32
|
-
params: null,
|
|
33
|
-
parentStyles: {},
|
|
34
|
-
formElement: null,
|
|
35
|
-
submitButtons: [],
|
|
36
|
-
modifiedSpec: {}
|
|
37
|
-
}),
|
|
38
|
-
watch: {
|
|
39
|
-
$isBusy: function(val, oldVal) {
|
|
40
|
-
for (const button of this.submitButtons) {
|
|
41
|
-
button._isBusy = val;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
methods: {
|
|
46
|
-
$ready: function() {
|
|
47
|
-
this.$onEvent("forms/addSubmit", e => {
|
|
48
|
-
this.submitButtons.push(e.data);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
this.$onEvent("forms/setBusy", e => {
|
|
52
|
-
if (e.data.value) {
|
|
53
|
-
Utils.http.startIndicator(this);
|
|
54
|
-
} else {
|
|
55
|
-
Utils.http.stopIndicator(this);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
this.formElement = this.$refs.form.$el;
|
|
60
|
-
this.parentStyles = this.genericStyles({ width: this.spec.width });
|
|
61
|
-
|
|
62
|
-
const { url: url, params: params } = Utils.url.extractFormActionData(
|
|
63
|
-
this.spec.url,
|
|
64
|
-
this.spec.local
|
|
65
|
-
);
|
|
66
|
-
this.url = url;
|
|
67
|
-
this.params = params;
|
|
68
|
-
|
|
69
|
-
let firstAutoFocus = false;
|
|
70
|
-
this.modifiedSpec = this.spec;
|
|
71
|
-
this.modifiedSpec.childViews.map(childView => {
|
|
72
|
-
if (
|
|
73
|
-
childView.view.startsWith("fields/") &&
|
|
74
|
-
childView.view !== "fields/hidden-v1" &&
|
|
75
|
-
!firstAutoFocus
|
|
76
|
-
) {
|
|
77
|
-
childView.autoFocus = true;
|
|
78
|
-
firstAutoFocus = true;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return childView;
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
onSubmit(event) {
|
|
85
|
-
event.preventDefault();
|
|
86
|
-
event.stopPropagation();
|
|
87
|
-
|
|
88
|
-
this.submit();
|
|
89
|
-
},
|
|
90
|
-
submit() {
|
|
91
|
-
if (this.$refs.form.validate()) {
|
|
92
|
-
// Remove focus from current input field to avoid double submit if the user presses ENTER again.
|
|
93
|
-
document.activeElement.blur();
|
|
94
|
-
|
|
95
|
-
Utils.type.ifObject(
|
|
96
|
-
this.spec.onSubmit,
|
|
97
|
-
onSubmit => {
|
|
98
|
-
const formData = Utils.url.toMap(new FormData(this.formElement));
|
|
99
|
-
const params = {
|
|
100
|
-
[this.spec.paramNameForFormData || "formData"]: formData
|
|
101
|
-
};
|
|
102
|
-
const data = Object.assign({}, onSubmit, params);
|
|
103
|
-
GLib.action.execute(data, null, this);
|
|
104
|
-
},
|
|
105
|
-
() => {
|
|
106
|
-
GLib.form.submitData(this.formElement, this);
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
} else {
|
|
110
|
-
Utils.launch.alert("Make sure all fields are valid");
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
action_clear() {
|
|
114
|
-
this.formElement.reset();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
</script>
|
|
119
|
-
|
|
120
|
-
<style scoped>
|
|
121
|
-
/* .panels-form {
|
|
122
|
-
display: flex;
|
|
123
|
-
flex-direction: column;
|
|
124
|
-
align-items: flex-start;
|
|
125
|
-
} */
|
|
126
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<v-form
|
|
3
|
+
ref="form"
|
|
4
|
+
:style="parentStyles"
|
|
5
|
+
:action="url"
|
|
6
|
+
:method="spec.method"
|
|
7
|
+
:data-local="spec.local"
|
|
8
|
+
@submit="onSubmit"
|
|
9
|
+
>
|
|
10
|
+
<template v-for="(value, key, index) in params">
|
|
11
|
+
<input
|
|
12
|
+
:key="`hidden_${index}`"
|
|
13
|
+
type="hidden"
|
|
14
|
+
:name="key"
|
|
15
|
+
:value="value"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<panels-responsive :spec="modifiedSpec" />
|
|
20
|
+
</v-form>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
// import ActionsFormsSubmit from "../../actions/forms/submit";
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
props: {
|
|
28
|
+
spec: { type: Object, required: true }
|
|
29
|
+
},
|
|
30
|
+
data: () => ({
|
|
31
|
+
url: null,
|
|
32
|
+
params: null,
|
|
33
|
+
parentStyles: {},
|
|
34
|
+
formElement: null,
|
|
35
|
+
submitButtons: [],
|
|
36
|
+
modifiedSpec: {}
|
|
37
|
+
}),
|
|
38
|
+
watch: {
|
|
39
|
+
$isBusy: function(val, oldVal) {
|
|
40
|
+
for (const button of this.submitButtons) {
|
|
41
|
+
button._isBusy = val;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
$ready: function() {
|
|
47
|
+
this.$onEvent("forms/addSubmit", e => {
|
|
48
|
+
this.submitButtons.push(e.data);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
this.$onEvent("forms/setBusy", e => {
|
|
52
|
+
if (e.data.value) {
|
|
53
|
+
Utils.http.startIndicator(this);
|
|
54
|
+
} else {
|
|
55
|
+
Utils.http.stopIndicator(this);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
this.formElement = this.$refs.form.$el;
|
|
60
|
+
this.parentStyles = this.genericStyles({ width: this.spec.width });
|
|
61
|
+
|
|
62
|
+
const { url: url, params: params } = Utils.url.extractFormActionData(
|
|
63
|
+
this.spec.url,
|
|
64
|
+
this.spec.local
|
|
65
|
+
);
|
|
66
|
+
this.url = url;
|
|
67
|
+
this.params = params;
|
|
68
|
+
|
|
69
|
+
let firstAutoFocus = false;
|
|
70
|
+
this.modifiedSpec = this.spec;
|
|
71
|
+
this.modifiedSpec.childViews.map(childView => {
|
|
72
|
+
if (
|
|
73
|
+
childView.view.startsWith("fields/") &&
|
|
74
|
+
childView.view !== "fields/hidden-v1" &&
|
|
75
|
+
!firstAutoFocus
|
|
76
|
+
) {
|
|
77
|
+
childView.autoFocus = true;
|
|
78
|
+
firstAutoFocus = true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return childView;
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
onSubmit(event) {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
event.stopPropagation();
|
|
87
|
+
|
|
88
|
+
this.submit();
|
|
89
|
+
},
|
|
90
|
+
submit() {
|
|
91
|
+
if (this.$refs.form.validate()) {
|
|
92
|
+
// Remove focus from current input field to avoid double submit if the user presses ENTER again.
|
|
93
|
+
document.activeElement.blur();
|
|
94
|
+
|
|
95
|
+
Utils.type.ifObject(
|
|
96
|
+
this.spec.onSubmit,
|
|
97
|
+
onSubmit => {
|
|
98
|
+
const formData = Utils.url.toMap(new FormData(this.formElement));
|
|
99
|
+
const params = {
|
|
100
|
+
[this.spec.paramNameForFormData || "formData"]: formData
|
|
101
|
+
};
|
|
102
|
+
const data = Object.assign({}, onSubmit, params);
|
|
103
|
+
GLib.action.execute(data, null, this);
|
|
104
|
+
},
|
|
105
|
+
() => {
|
|
106
|
+
GLib.form.submitData(this.formElement, this);
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
} else {
|
|
110
|
+
Utils.launch.alert("Make sure all fields are valid");
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
action_clear() {
|
|
114
|
+
this.formElement.reset();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style scoped>
|
|
121
|
+
/* .panels-form {
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
align-items: flex-start;
|
|
125
|
+
} */
|
|
126
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/components/panels/ul.vue
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ul :style="$styles()" :class="$classes()">
|
|
3
|
-
<!-- Use view name for key to avoid component reuse issue -->
|
|
4
|
-
<li v-for="(item, index) in spec.childViews" :key="`${index}_${item.view}`">
|
|
5
|
-
<ui-component :spec="item" />
|
|
6
|
-
</li>
|
|
7
|
-
</ul>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
props: {
|
|
13
|
-
spec: { type: Object, required: true }
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<style lang="scss" scoped>
|
|
19
|
-
// TODO: Need responsive support for mobile screens.
|
|
20
|
-
ul.breadcrumbs {
|
|
21
|
-
padding-left: 0px;
|
|
22
|
-
list-style: none;
|
|
23
|
-
|
|
24
|
-
li {
|
|
25
|
-
display: inline;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
li + li:before {
|
|
29
|
-
padding: 4px 4px 4px 8px;
|
|
30
|
-
color: black;
|
|
31
|
-
content: "/\00a0";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<ul :style="$styles()" :class="$classes()">
|
|
3
|
+
<!-- Use view name for key to avoid component reuse issue -->
|
|
4
|
+
<li v-for="(item, index) in spec.childViews" :key="`${index}_${item.view}`">
|
|
5
|
+
<ui-component :spec="item" />
|
|
6
|
+
</li>
|
|
7
|
+
</ul>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
props: {
|
|
13
|
+
spec: { type: Object, required: true }
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style lang="scss" scoped>
|
|
19
|
+
// TODO: Need responsive support for mobile screens.
|
|
20
|
+
ul.breadcrumbs {
|
|
21
|
+
padding-left: 0px;
|
|
22
|
+
list-style: none;
|
|
23
|
+
|
|
24
|
+
li {
|
|
25
|
+
display: inline;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
li + li:before {
|
|
29
|
+
padding: 4px 4px 4px 8px;
|
|
30
|
+
color: black;
|
|
31
|
+
content: "/\00a0";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<iframe :style="$styles()" :src="spec.url"></iframe>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
export default {
|
|
7
|
-
props: {
|
|
8
|
-
spec: { type: Object, required: true }
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<iframe :style="$styles()" :src="spec.url"></iframe>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
props: {
|
|
8
|
+
spec: { type: Object, required: true }
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
</script>
|
package/components/spacer.vue
CHANGED
|
File without changes
|