glib-web 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +1 -0
- package/action.js +1 -1
- package/actions/auth/restart.js +0 -0
- package/actions/commands/copy.js +0 -0
- package/actions/components/replace.js +1 -1
- package/actions/components/set.js +4 -4
- 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 +1 -1
- package/actions/dialogs/reload.js +0 -0
- package/actions/dialogs/show.js +1 -1
- 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/runMultiple.js +0 -0
- package/actions/sheets/select.js +0 -0
- package/actions/snackbars/select.js +0 -0
- package/actions/windows/openWeb.js +0 -0
- package/actions/windows/print.js +0 -0
- package/app.vue +5 -4
- package/components/_message.vue +0 -0
- package/components/composable/upload.js +2 -1
- package/components/fields/_select.vue +1 -1
- package/components/fields/check.vue +5 -41
- package/components/fields/checkGroup.vue +41 -88
- package/components/fields/chipGroup.vue +0 -1
- package/components/fields/dynamicGroup.vue +5 -3
- package/components/fields/phone/countries.js +0 -0
- package/components/fields/phone/sprite.css +0 -0
- package/components/fields/phone.vue +25 -9
- package/components/fields/radio.vue +110 -3
- package/components/fields/radioGroup.vue +2 -8
- package/components/fields/submit.vue +8 -1
- 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/mixins/extension.js +0 -0
- package/components/mixins/longClick.js +0 -0
- package/components/mixins/scrolling.js +0 -0
- package/components/mixins/styles.js +7 -5
- 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/multimedia/video.vue +0 -0
- package/components/panels/form.vue +17 -2
- package/cypress/e2e/glib-web/test_page.cy.ts +53 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/support/commands.ts +37 -0
- package/cypress/support/e2e.ts +20 -0
- package/cypress.config.ts +9 -0
- package/keys.js +0 -0
- package/nav/dialog.vue +8 -9
- package/nav/layout.vue +2 -0
- package/package.json +5 -3
- 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.min.css +0 -0
- package/static/redactorx.min.js +0 -0
- package/static/redactorx.usm.min.js +0 -0
- package/store.js +15 -5
- package/styles/test.sass +0 -0
- package/styles/test.scss +0 -0
- package/templates/unsupported.vue +0 -0
- package/utils/dom.js +0 -0
- package/utils/glibDirectUpload.js +7 -6
- package/utils/helper.js +0 -0
- package/utils/http.js +1 -1
- package/utils/launch.js +3 -3
- package/utils/type.js +0 -0
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
package/action.js
CHANGED
|
@@ -228,7 +228,7 @@ export default class Action {
|
|
|
228
228
|
|
|
229
229
|
if (response.header || response.body || response.footer) {
|
|
230
230
|
Utils.http.forceComponentUpdate(() => {
|
|
231
|
-
const dialog = dialogs.last();
|
|
231
|
+
const dialog = dialogs.value.last();
|
|
232
232
|
const updateDialog = windowMode ? false : Utils.type.isObject(dialog);
|
|
233
233
|
if (updateDialog) {
|
|
234
234
|
dialog.updateContent(response);
|
package/actions/auth/restart.js
CHANGED
|
File without changes
|
package/actions/commands/copy.js
CHANGED
|
File without changes
|
|
@@ -5,7 +5,7 @@ export default class {
|
|
|
5
5
|
execute(spec, component) {
|
|
6
6
|
const target = GLib.component.findById(spec.targetId) || component;
|
|
7
7
|
if (target) {
|
|
8
|
-
|
|
8
|
+
target.action_merge(spec.newView);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
Action.execute(spec.onReplace, target);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const setFileModel = (component, value) => {
|
|
2
|
-
|
|
3
|
-
};
|
|
1
|
+
// const setFileModel = (component, value) => {
|
|
2
|
+
// component.fieldModel = component.$sanitizeValue(component.$externalizeValue(value));
|
|
3
|
+
// };
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export default class {
|
|
@@ -13,7 +13,7 @@ export default class {
|
|
|
13
13
|
|
|
14
14
|
Utils.type.ifObject(spec.data, (data) => {
|
|
15
15
|
targetComponent.action_merge(data);
|
|
16
|
-
if (data.value) setFileModel(targetComponent, data.value);
|
|
16
|
+
// if (data.value) setFileModel(targetComponent, data.value);
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
GLib.action.execute(spec.onSet, targetComponent);
|
package/actions/dialogs/close.js
CHANGED
|
File without changes
|
|
File without changes
|
package/actions/dialogs/oauth.js
CHANGED
|
File without changes
|
package/actions/dialogs/open.js
CHANGED
|
File without changes
|
package/actions/dialogs/show.js
CHANGED
package/actions/http/delete.js
CHANGED
|
File without changes
|
package/actions/http/patch.js
CHANGED
|
File without changes
|
package/actions/http/post.js
CHANGED
|
File without changes
|
package/actions/http/put.js
CHANGED
|
File without changes
|
package/actions/runMultiple.js
CHANGED
|
File without changes
|
package/actions/sheets/select.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/actions/windows/print.js
CHANGED
|
File without changes
|
package/app.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-app :class="page.styleClasses">
|
|
3
3
|
<component :is="containerComponent" :spec="formSpec" :style="'height: 100%;'">
|
|
4
|
-
<nav-layout ref="navBar" :page="page" />
|
|
4
|
+
<nav-layout ref="navBar" @mounted="updateMainHeight()" :page="page" />
|
|
5
5
|
|
|
6
6
|
<v-progress-linear color="primary" v-if="vueApp.indicator" :indeterminate="true" height="5"
|
|
7
7
|
style="position: fixed; z-index: 4">
|
|
@@ -50,6 +50,7 @@ import { watchGlibEvent } from "./store";
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
export default {
|
|
53
|
+
expose: ['updateMainHeight'],
|
|
53
54
|
setup(props) {
|
|
54
55
|
const filePaster = computed(() => props.page.filePaster);
|
|
55
56
|
usePasteable(filePaster);
|
|
@@ -183,9 +184,9 @@ export default {
|
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
// Use nextTick() to allow time for the navBar to complete initialization.
|
|
186
|
-
this.$nextTick(() => {
|
|
187
|
-
|
|
188
|
-
});
|
|
187
|
+
// this.$nextTick(() => {
|
|
188
|
+
// this.updateMainHeight();
|
|
189
|
+
// });
|
|
189
190
|
|
|
190
191
|
const hash = window.location.hash.substring(1);
|
|
191
192
|
if (hash) {
|
package/components/_message.vue
CHANGED
|
File without changes
|
|
@@ -6,63 +6,27 @@
|
|
|
6
6
|
<v-checkbox :color="gcolor" v-model="fieldModel" :name="fieldName" :readonly="spec.readOnly"
|
|
7
7
|
:disabled="inputDisabled" :label="fieldModel ? spec.onLabel || spec.label : spec.label" :true-icon="spec.onIcon"
|
|
8
8
|
:false-icon="spec.offIcon" :value="spec.value" :true-value="spec.checkValue" :false-value="uncheckValue"
|
|
9
|
-
hide-details @change="
|
|
9
|
+
hide-details @change="onChange()" :rules="$validation()" :multiple="false"></v-checkbox>
|
|
10
10
|
</div>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script>
|
|
14
14
|
export default {
|
|
15
|
+
emits: ['oncheck'],
|
|
15
16
|
props: {
|
|
16
17
|
spec: { type: Object, required: true }
|
|
17
18
|
},
|
|
18
19
|
data() {
|
|
19
20
|
return {
|
|
20
|
-
groupName: null,
|
|
21
|
-
fieldType: null,
|
|
22
21
|
uncheckValue: this.spec.uncheckValue
|
|
23
22
|
};
|
|
24
23
|
},
|
|
25
|
-
computed: {
|
|
26
|
-
fieldName() {
|
|
27
|
-
return this.spec.name || this.spec.parentName;
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
24
|
methods: {
|
|
31
|
-
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
changed(event) {
|
|
35
|
-
// Execute later to ensure the checkbox's checked state has been updated.
|
|
36
|
-
setTimeout(() => {
|
|
37
|
-
this.$type.ifObject(this.groupElement, val =>
|
|
38
|
-
val.dispatchEvent(new Event("change"))
|
|
39
|
-
);
|
|
40
|
-
}, 100);
|
|
41
|
-
|
|
42
|
-
// setTimeout(() => {
|
|
25
|
+
onChange() {
|
|
26
|
+
const checked = this.spec.checkValue == this.fieldModel ? true : false;
|
|
27
|
+
this.$emit("oncheck", { checked, value: this.spec.checkValue });
|
|
43
28
|
this.$executeOnChange();
|
|
44
|
-
// }, 500);
|
|
45
|
-
},
|
|
46
|
-
updateData() {
|
|
47
|
-
this.groupElement = this.$el.closest("[data-component=checkGroup]");
|
|
48
|
-
|
|
49
|
-
// this.fieldModel = this.spec.checked
|
|
50
|
-
// ? this.spec.checkValue
|
|
51
|
-
// : this.spec.value;
|
|
52
|
-
|
|
53
|
-
Utils.type.ifArray(this.spec.styleClasses, classes => {
|
|
54
|
-
if (classes.remove("switch")) {
|
|
55
|
-
this.fieldType = "switch";
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
// this.fieldModel = this.spec.value;
|
|
59
29
|
}
|
|
60
30
|
}
|
|
61
31
|
};
|
|
62
32
|
</script>
|
|
63
|
-
|
|
64
|
-
<style scoped>
|
|
65
|
-
.v-input--selection-controls {
|
|
66
|
-
margin-top: 0;
|
|
67
|
-
}
|
|
68
|
-
</style>
|
|
@@ -1,101 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<div :style="$styles()" :class="$classes()">
|
|
3
|
+
<fields-check v-for="(childView, index) in childViews" :spec="childView" :key="index"
|
|
4
|
+
@oncheck="updateFieldModel"></fields-check>
|
|
5
|
+
<v-input ref="validator" :model-value="fieldModel" :rules="$validation()" :name="fieldName" validate-on="input"
|
|
6
|
+
:disabled="inputDisabled"></v-input>
|
|
7
|
+
|
|
8
|
+
<template v-if="values.length > 0">
|
|
9
|
+
<input type="hidden" v-for="(value, index) in values" :value="value" :key="index" :name="fieldName" />
|
|
10
|
+
</template>
|
|
11
|
+
<input v-else type="hidden" :name="fieldName" :value="null" />
|
|
11
12
|
</div>
|
|
12
13
|
</template>
|
|
13
14
|
|
|
14
15
|
<script>
|
|
15
|
-
|
|
16
|
+
import { defineComponent } from "vue";
|
|
17
|
+
import FieldCheck from './check.vue';
|
|
16
18
|
|
|
17
|
-
export default {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
components: {
|
|
21
|
+
'fields-check': FieldCheck
|
|
22
|
+
},
|
|
21
23
|
props: {
|
|
22
|
-
spec: { type: Object, required: true }
|
|
24
|
+
spec: { type: Object, required: true }
|
|
23
25
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
computed: {
|
|
27
|
+
values() {
|
|
28
|
+
return this.fieldModel || [];
|
|
29
|
+
},
|
|
30
|
+
childViews() {
|
|
31
|
+
return this.spec.childViews.map((childView) => {
|
|
32
|
+
const { readOnly, disabled } = this.spec;
|
|
33
|
+
const parentName = this.spec.name;
|
|
34
|
+
return Object.assign({}, { readOnly, disabled, parentName }, childView);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
34
37
|
},
|
|
35
|
-
// computed: {
|
|
36
|
-
// uncheckSpec() {
|
|
37
|
-
// return { name: this.spec.name, value: this.spec.uncheckValue };
|
|
38
|
-
// }
|
|
39
|
-
// },
|
|
40
38
|
methods: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
this.detectChecked();
|
|
49
|
-
const vm = this;
|
|
50
|
-
this.$el.addEventListener(
|
|
51
|
-
"change",
|
|
52
|
-
function (e) {
|
|
53
|
-
vm.detectChecked();
|
|
54
|
-
},
|
|
55
|
-
false
|
|
56
|
-
);
|
|
57
|
-
},
|
|
58
|
-
detectChecked() {
|
|
59
|
-
this.anyChecked = false;
|
|
60
|
-
const vm = this;
|
|
61
|
-
this.$el
|
|
62
|
-
.querySelectorAll("input[type=checkbox]")
|
|
63
|
-
.forEach(function (checkbox) {
|
|
64
|
-
if (checkbox.checked) {
|
|
65
|
-
vm.anyChecked = true;
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
childSpec(item) {
|
|
71
|
-
if (this.spec.readOnly) {
|
|
72
|
-
return Object.assign(item, {
|
|
73
|
-
parentName: this.spec.name,
|
|
74
|
-
readOnly: this.spec.readOnly,
|
|
75
|
-
onChange: this.spec.onChange,
|
|
76
|
-
});
|
|
39
|
+
updateFieldModel(obj) {
|
|
40
|
+
let newValue = this.fieldModel || [];
|
|
41
|
+
const { checked, value } = obj;
|
|
42
|
+
if (checked) {
|
|
43
|
+
newValue.push(value);
|
|
44
|
+
} else {
|
|
45
|
+
newValue = newValue.filter((v) => v != value);
|
|
77
46
|
}
|
|
78
47
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<style lang="scss">
|
|
86
|
-
// Hide the uncheck field, but continue to show the validation div.
|
|
87
|
-
.checkgroup__uncheckvalue {
|
|
88
|
-
padding-top: 0px;
|
|
89
|
-
|
|
90
|
-
.v-input__slot {
|
|
91
|
-
display: none;
|
|
48
|
+
// empty array still count as has value
|
|
49
|
+
this.fieldModel = newValue.length <= 0 ? null : newValue;
|
|
50
|
+
this.$executeOnChange();
|
|
51
|
+
}
|
|
92
52
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
display: none;
|
|
96
|
-
|
|
97
|
-
&.error--text {
|
|
98
|
-
display: block;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
53
|
+
});
|
|
54
|
+
</script>
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
import { defineComponent } from "vue";
|
|
14
14
|
import inputVariant from "../mixins/inputVariant";
|
|
15
15
|
import { triggerOnInput } from "../composable/form";
|
|
16
|
-
import { fieldModels } from "../composable/conditional";
|
|
17
16
|
|
|
18
17
|
export default defineComponent({
|
|
19
18
|
mixins: [inputVariant],
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
<div v-for="(group, groupIndex) in groupSpecs" :key="`group${groupIndex}`">
|
|
4
4
|
<input v-if="isDeleted(groupIndex)" type="hidden" :name="`${spec.name}[${groupIndex}][_destroy]`" value="1" />
|
|
5
5
|
<div :style="{ display: isDeleted(groupIndex) ? 'none' : 'block' }">
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
<div class="group-wrapper">
|
|
7
|
+
<v-icon class="float-left mr-2" color="error" @click="removeGroup(groupIndex)">remove_circle</v-icon>
|
|
8
|
+
<h4 v-if="spec.titlePrefix">{{ spec.titlePrefix }}{{ group.actualIndex }}</h4>
|
|
9
|
+
<panels-responsive :spec="group" />
|
|
10
|
+
</div>
|
|
9
11
|
</div>
|
|
10
12
|
</div>
|
|
11
13
|
|
|
File without changes
|
|
File without changes
|
|
@@ -1,31 +1,47 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :style="$styles()" :class="$classes()">
|
|
3
|
-
<v-phone-input :guessCountry="guessCountry" displayFormat="e164" :defaultCountry="
|
|
4
|
-
|
|
5
|
-
:
|
|
6
|
-
:
|
|
7
|
-
|
|
3
|
+
<v-phone-input :guessCountry="guessCountry" displayFormat="e164" :defaultCountry="defaultCountry" :color="gcolor"
|
|
4
|
+
v-model="fieldModel" :label="spec.label" :name="fieldName" :hint="spec.hint" :placeholder="spec.placeholder"
|
|
5
|
+
:maxlength="spec.maxLength || 255" :readonly="spec.readOnly" :rules="$validation()"
|
|
6
|
+
:outlined="$classes().includes('outlined')" :disabled="inputDisabled" validate-on="blur" :variant="variant"
|
|
7
|
+
@update:modelValue="onChange()" persistent-placeholder></v-phone-input>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
12
|
import eventFiltering from "../../utils/eventFiltering";
|
|
13
13
|
import inputVariant from "../mixins/inputVariant";
|
|
14
|
+
import countries from "moment-timezone/data/meta/latest.json";
|
|
14
15
|
|
|
15
16
|
export default {
|
|
16
17
|
mixins: [inputVariant],
|
|
17
18
|
props: {
|
|
18
|
-
spec: {
|
|
19
|
+
spec: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
19
23
|
},
|
|
24
|
+
|
|
20
25
|
methods: {
|
|
21
26
|
onChange: eventFiltering.debounce(function () {
|
|
22
27
|
this.$executeOnChange();
|
|
23
28
|
}, 300),
|
|
24
29
|
},
|
|
30
|
+
|
|
25
31
|
computed: {
|
|
26
32
|
guessCountry() {
|
|
27
|
-
return !this.spec.disableAutoDetect && !this.
|
|
28
|
-
}
|
|
29
|
-
|
|
33
|
+
return !this.spec.disableAutoDetect && !this.defaultCountry;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
defaultCountry() {
|
|
37
|
+
return this.spec.defaultCountry || this.getCountry;
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
getCountry() {
|
|
41
|
+
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
42
|
+
const countriesWithTimeZone = Object.values(countries.countries).filter((country) => country.zones.includes(timeZone));
|
|
43
|
+
return countriesWithTimeZone.length === 1 ? countriesWithTimeZone[0].abbr : null;
|
|
44
|
+
},
|
|
45
|
+
},
|
|
30
46
|
};
|
|
31
47
|
</script>
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$classes()" :style="$styles()">
|
|
3
|
-
<v-radio :label="spec.label" :value="spec.value.presence() || vuetifyEmptyString" :readonly="spec.readOnly"
|
|
4
|
-
:on-icon="spec.onIcon" :off-icon="spec.offIcon" @click="$onClick()" :color="gcolor"
|
|
3
|
+
<v-radio :label="spec.label" :value="(spec.value || '').presence() || vuetifyEmptyString" :readonly="spec.readOnly"
|
|
4
|
+
:on-icon="spec.onIcon" :off-icon="spec.offIcon" @click="$onClick()" :color="gcolor"
|
|
5
|
+
:class="spec.imageUrl || spec.icon ? 'custom-radio' : ''">
|
|
6
|
+
<template v-slot:label v-if="spec.imageUrl || spec.icon">
|
|
7
|
+
<div class="custom-radio-content">
|
|
8
|
+
<img v-if="spec.imageUrl" :src="spec.imageUrl" alt="icon" class="custom-radio-icon" />
|
|
9
|
+
<v-icon v-if="spec.icon" class="aligner" :color="spec.iconColor" :size="spec.iconSize">
|
|
10
|
+
{{ spec.icon }}
|
|
11
|
+
</v-icon>
|
|
12
|
+
<div class="custom-radio-label">{{ spec.label }}</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
</v-radio>
|
|
5
16
|
<div v-if="spec.childViews" class="radio-childviews">
|
|
6
|
-
<div v-for="(item, i) in spec.childViews" :key="i">
|
|
17
|
+
<div v-for="( item, i ) in spec.childViews " :key="i">
|
|
7
18
|
<glib-component :spec="item" />
|
|
8
19
|
</div>
|
|
9
20
|
</div>
|
|
@@ -18,3 +29,99 @@ export default {
|
|
|
18
29
|
}
|
|
19
30
|
};
|
|
20
31
|
</script>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.custom-radio {
|
|
35
|
+
/* styles for custom-radio class */
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
width: 240px;
|
|
40
|
+
height: 254px;
|
|
41
|
+
transition: border-color 0.3s, box-shadow 0.3s, color 0.3s;
|
|
42
|
+
text-align: center;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
padding: 16px;
|
|
45
|
+
position: relative;
|
|
46
|
+
border: 1px solid #E6E6E6;
|
|
47
|
+
border-radius: 24px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.custom-radio:hover {
|
|
51
|
+
border: 2px solid;
|
|
52
|
+
border-radius: 24px;
|
|
53
|
+
border-color: #0A2A9E;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.custom-radio:hover .custom-radio-label {
|
|
57
|
+
font-size: 22px;
|
|
58
|
+
color: #0A2A9E;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.custom-radio .custom-radio-content {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
margin-right: 30px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.custom-radio .custom-radio-icon {
|
|
72
|
+
width: 80px;
|
|
73
|
+
height: 80px;
|
|
74
|
+
margin-bottom: 8px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.custom-radio .custom-radio-label {
|
|
78
|
+
font-size: 22px;
|
|
79
|
+
color: inherit;
|
|
80
|
+
margin-top: 16px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.custom-radio ::v-deep .v-selection-control__input {
|
|
84
|
+
width: 240px;
|
|
85
|
+
height: 254px;
|
|
86
|
+
background-color: transparent;
|
|
87
|
+
left: 50%;
|
|
88
|
+
|
|
89
|
+
>.v-icon {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.custom-radio ::v-deep .v-selection-control__input::before {
|
|
96
|
+
background-color: transparent
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.custom-radio ::v-deep .v-ripple__container {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
.custom-radio .v-ripple__container {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.radio--active .custom-radio {
|
|
109
|
+
border: 2px solid;
|
|
110
|
+
border-radius: 24px;
|
|
111
|
+
border-color: #0A2A9E;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.radio--active .custom-radio-label {
|
|
115
|
+
color: #0A2A9E;
|
|
116
|
+
font-weight: 700;
|
|
117
|
+
font-size: 22px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.radio--active .v-icon {
|
|
121
|
+
color: #0A2A9E;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.radio-childviews {
|
|
125
|
+
margin-top: 16px;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
validation error on page load.
|
|
5
5
|
-->
|
|
6
6
|
<v-radio-group v-model="fieldModel" :name="fieldName" :readonly="spec.readOnly" :disabled="inputDisabled"
|
|
7
|
-
:rules="$validation()" :
|
|
7
|
+
:rules="$validation()" :inline="spec.row" validate-on="blur" @change="$executeOnChange()" :class="$classes()"
|
|
8
|
+
:style="$styles()">
|
|
8
9
|
<div v-for="(childView, index) in spec.childViews" :key="index" style="width: 100%;">
|
|
9
10
|
<glib-component :spec="childSpec(childView)" />
|
|
10
11
|
</div>
|
|
11
|
-
|
|
12
|
-
<!-- <input v-if="spec.readOnly" type="hidden" :name="fieldName" :value="fieldModel" /> -->
|
|
13
12
|
</v-radio-group>
|
|
14
13
|
</template>
|
|
15
14
|
|
|
@@ -19,11 +18,6 @@ export default {
|
|
|
19
18
|
spec: { type: Object, required: true },
|
|
20
19
|
},
|
|
21
20
|
methods: {
|
|
22
|
-
onChange() {
|
|
23
|
-
setTimeout(() => {
|
|
24
|
-
this.$executeOnChange();
|
|
25
|
-
}, 500);
|
|
26
|
-
},
|
|
27
21
|
updateValue(variable) {
|
|
28
22
|
if (variable.value) {
|
|
29
23
|
this.fieldModel = variable.value;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<common-button :spec="spec" type="submit" :disabled="
|
|
2
|
+
<common-button :spec="spec" type="submit" :disabled="disabled" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -9,11 +9,18 @@ export default {
|
|
|
9
9
|
props: {
|
|
10
10
|
spec: { type: Object, required: true }
|
|
11
11
|
},
|
|
12
|
+
inject: ['formCtx'],
|
|
12
13
|
data: function () {
|
|
13
14
|
return {
|
|
14
15
|
data: this.$data
|
|
15
16
|
};
|
|
16
17
|
},
|
|
18
|
+
computed: {
|
|
19
|
+
disabled() {
|
|
20
|
+
const disableIfFormInvalid = this.spec.disableIfFormInvalid && this.formCtx.form && !this.formCtx.form.isValid;
|
|
21
|
+
return disableIfFormInvalid || this.spec.disabled || this.$isBusy;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
17
24
|
methods: {
|
|
18
25
|
$mounted() {
|
|
19
26
|
nextTick(() => this.$dispatchEvent("forms/addSubmit", this.$data));
|
package/components/h1.vue
CHANGED
|
File without changes
|
package/components/h2.vue
CHANGED
|
File without changes
|
package/components/h3.vue
CHANGED
|
File without changes
|
package/components/h5.vue
CHANGED
|
File without changes
|
package/components/h6.vue
CHANGED
|
File without changes
|
package/components/hr.vue
CHANGED
|
File without changes
|
package/components/html.vue
CHANGED
|
File without changes
|
package/components/icon.vue
CHANGED
|
File without changes
|