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,86 +1,86 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="$styles()" :class="classes()">
|
|
3
|
-
<v-autocomplete
|
|
4
|
-
v-model="fieldModel"
|
|
5
|
-
:label="spec.label"
|
|
6
|
-
:items="options"
|
|
7
|
-
:chips="spec.multiple"
|
|
8
|
-
:deletable-chips="spec.multiple"
|
|
9
|
-
:multiple="spec.multiple"
|
|
10
|
-
:disabled="spec.readOnly"
|
|
11
|
-
:clearable="!spec.readOnly"
|
|
12
|
-
:hint="spec.hint"
|
|
13
|
-
:placeholder="spec.placeholder"
|
|
14
|
-
:rules="rules"
|
|
15
|
-
validate-on-blur
|
|
16
|
-
persistent-hint
|
|
17
|
-
:class="$classes()"
|
|
18
|
-
:outlined="$classes().includes('outlined')"
|
|
19
|
-
:append-icon="append.icon"
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
-
<input
|
|
23
|
-
v-for="(item, index) in values"
|
|
24
|
-
:key="index"
|
|
25
|
-
type="hidden"
|
|
26
|
-
:name="fieldName"
|
|
27
|
-
:value="item"
|
|
28
|
-
/>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
export default {
|
|
34
|
-
props: {
|
|
35
|
-
spec: { type: Object, required: true },
|
|
36
|
-
defaultValue: { type: String, default: null }
|
|
37
|
-
},
|
|
38
|
-
data() {
|
|
39
|
-
return {
|
|
40
|
-
options: null,
|
|
41
|
-
append: {},
|
|
42
|
-
rules: []
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
computed: {
|
|
46
|
-
values() {
|
|
47
|
-
// Depends on whether the field is single or multiple
|
|
48
|
-
if (this.$type.isArray(this.fieldModel)) {
|
|
49
|
-
return this.fieldModel.length > 0 ? this.fieldModel : this.emptyValue;
|
|
50
|
-
} else {
|
|
51
|
-
return [this.fieldModel];
|
|
52
|
-
}
|
|
53
|
-
// return this.emptyValue;
|
|
54
|
-
},
|
|
55
|
-
// To avoid empty param error
|
|
56
|
-
emptyValue() {
|
|
57
|
-
return [null];
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
methods: {
|
|
61
|
-
$ready() {
|
|
62
|
-
this.options = this.normalizedOptions();
|
|
63
|
-
this.append = this.spec.append || {};
|
|
64
|
-
this.rules = this.$validation();
|
|
65
|
-
if (this.defaultValue) {
|
|
66
|
-
this.fieldModel = this.defaultValue;
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
normalizedOptions() {
|
|
70
|
-
return this.spec.options.map(i => {
|
|
71
|
-
switch (i.type) {
|
|
72
|
-
case "label":
|
|
73
|
-
return { header: i.text };
|
|
74
|
-
case "divider":
|
|
75
|
-
return { divider: true };
|
|
76
|
-
default:
|
|
77
|
-
return i;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
classes() {
|
|
82
|
-
return this.$classes().concat("g-text-field--hintless");
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="$styles()" :class="classes()">
|
|
3
|
+
<v-autocomplete
|
|
4
|
+
v-model="fieldModel"
|
|
5
|
+
:label="spec.label"
|
|
6
|
+
:items="options"
|
|
7
|
+
:chips="spec.multiple"
|
|
8
|
+
:deletable-chips="spec.multiple"
|
|
9
|
+
:multiple="spec.multiple"
|
|
10
|
+
:disabled="spec.readOnly"
|
|
11
|
+
:clearable="!spec.readOnly"
|
|
12
|
+
:hint="spec.hint"
|
|
13
|
+
:placeholder="spec.placeholder"
|
|
14
|
+
:rules="rules"
|
|
15
|
+
validate-on-blur
|
|
16
|
+
persistent-hint
|
|
17
|
+
:class="$classes()"
|
|
18
|
+
:outlined="$classes().includes('outlined')"
|
|
19
|
+
:append-icon="append.icon"
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<input
|
|
23
|
+
v-for="(item, index) in values"
|
|
24
|
+
:key="index"
|
|
25
|
+
type="hidden"
|
|
26
|
+
:name="fieldName"
|
|
27
|
+
:value="item"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
export default {
|
|
34
|
+
props: {
|
|
35
|
+
spec: { type: Object, required: true },
|
|
36
|
+
defaultValue: { type: String, default: null }
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
options: null,
|
|
41
|
+
append: {},
|
|
42
|
+
rules: []
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
values() {
|
|
47
|
+
// Depends on whether the field is single or multiple
|
|
48
|
+
if (this.$type.isArray(this.fieldModel)) {
|
|
49
|
+
return this.fieldModel.length > 0 ? this.fieldModel : this.emptyValue;
|
|
50
|
+
} else {
|
|
51
|
+
return [this.fieldModel];
|
|
52
|
+
}
|
|
53
|
+
// return this.emptyValue;
|
|
54
|
+
},
|
|
55
|
+
// To avoid empty param error
|
|
56
|
+
emptyValue() {
|
|
57
|
+
return [null];
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
$ready() {
|
|
62
|
+
this.options = this.normalizedOptions();
|
|
63
|
+
this.append = this.spec.append || {};
|
|
64
|
+
this.rules = this.$validation();
|
|
65
|
+
if (this.defaultValue) {
|
|
66
|
+
this.fieldModel = this.defaultValue;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
normalizedOptions() {
|
|
70
|
+
return this.spec.options.map(i => {
|
|
71
|
+
switch (i.type) {
|
|
72
|
+
case "label":
|
|
73
|
+
return { header: i.text };
|
|
74
|
+
case "divider":
|
|
75
|
+
return { divider: true };
|
|
76
|
+
default:
|
|
77
|
+
return i;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
classes() {
|
|
82
|
+
return this.$classes().concat("g-text-field--hintless");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
<!-- TODO: Remove (deprecated) -->
|
|
2
|
-
<template>
|
|
3
|
-
<div :style="genericStyles()">
|
|
4
|
-
<v-combobox
|
|
5
|
-
v-model="fieldModel"
|
|
6
|
-
:label="spec.label"
|
|
7
|
-
:items="options"
|
|
8
|
-
:chips="spec.multiple"
|
|
9
|
-
:deletable-chips="spec.multiple"
|
|
10
|
-
:multiple="spec.multiple"
|
|
11
|
-
:readonly="spec.readOnly"
|
|
12
|
-
:disabled="spec.readOnly"
|
|
13
|
-
:hint="spec.hint"
|
|
14
|
-
:placeholder="spec.placeholder"
|
|
15
|
-
:outlined="$classes().includes('outlined')"
|
|
16
|
-
:append-icon="append.icon"
|
|
17
|
-
/>
|
|
18
|
-
|
|
19
|
-
<input
|
|
20
|
-
v-for="(item, index) in values"
|
|
21
|
-
:key="index"
|
|
22
|
-
type="hidden"
|
|
23
|
-
:name="fieldName"
|
|
24
|
-
:value="item"
|
|
25
|
-
/>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
export default {
|
|
31
|
-
props: {
|
|
32
|
-
spec: { type: Object, required: true }
|
|
33
|
-
},
|
|
34
|
-
data() {
|
|
35
|
-
return {
|
|
36
|
-
options: null,
|
|
37
|
-
append: {}
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
computed: {
|
|
41
|
-
values() {
|
|
42
|
-
// Depends on whether the field is single or multiple
|
|
43
|
-
if (this.$type.isArray(this.fieldModel)) {
|
|
44
|
-
return this.fieldModel.length > 0 ? this.fieldModel : this.emptyValue;
|
|
45
|
-
} else {
|
|
46
|
-
return [this.fieldModel];
|
|
47
|
-
}
|
|
48
|
-
return this.emptyValue;
|
|
49
|
-
},
|
|
50
|
-
// To avoid empty param error
|
|
51
|
-
emptyValue() {
|
|
52
|
-
return [null];
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
methods: {
|
|
56
|
-
$ready() {
|
|
57
|
-
const spec = this.spec;
|
|
58
|
-
const options = spec.options;
|
|
59
|
-
|
|
60
|
-
if (Utils.type.isArray(options)) {
|
|
61
|
-
// It can be really confusing if the options are not strings (e.g. value-text pair)
|
|
62
|
-
this.options = options.map(i =>
|
|
63
|
-
Utils.type.isString(i)
|
|
64
|
-
? i
|
|
65
|
-
: console.warn("Option needs to be a string", i)
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
this.append = spec.append || {};
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
</script>
|
|
1
|
+
<!-- TODO: Remove (deprecated) -->
|
|
2
|
+
<template>
|
|
3
|
+
<div :style="genericStyles()">
|
|
4
|
+
<v-combobox
|
|
5
|
+
v-model="fieldModel"
|
|
6
|
+
:label="spec.label"
|
|
7
|
+
:items="options"
|
|
8
|
+
:chips="spec.multiple"
|
|
9
|
+
:deletable-chips="spec.multiple"
|
|
10
|
+
:multiple="spec.multiple"
|
|
11
|
+
:readonly="spec.readOnly"
|
|
12
|
+
:disabled="spec.readOnly"
|
|
13
|
+
:hint="spec.hint"
|
|
14
|
+
:placeholder="spec.placeholder"
|
|
15
|
+
:outlined="$classes().includes('outlined')"
|
|
16
|
+
:append-icon="append.icon"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<input
|
|
20
|
+
v-for="(item, index) in values"
|
|
21
|
+
:key="index"
|
|
22
|
+
type="hidden"
|
|
23
|
+
:name="fieldName"
|
|
24
|
+
:value="item"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
props: {
|
|
32
|
+
spec: { type: Object, required: true }
|
|
33
|
+
},
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
options: null,
|
|
37
|
+
append: {}
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
computed: {
|
|
41
|
+
values() {
|
|
42
|
+
// Depends on whether the field is single or multiple
|
|
43
|
+
if (this.$type.isArray(this.fieldModel)) {
|
|
44
|
+
return this.fieldModel.length > 0 ? this.fieldModel : this.emptyValue;
|
|
45
|
+
} else {
|
|
46
|
+
return [this.fieldModel];
|
|
47
|
+
}
|
|
48
|
+
return this.emptyValue;
|
|
49
|
+
},
|
|
50
|
+
// To avoid empty param error
|
|
51
|
+
emptyValue() {
|
|
52
|
+
return [null];
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
methods: {
|
|
56
|
+
$ready() {
|
|
57
|
+
const spec = this.spec;
|
|
58
|
+
const options = spec.options;
|
|
59
|
+
|
|
60
|
+
if (Utils.type.isArray(options)) {
|
|
61
|
+
// It can be really confusing if the options are not strings (e.g. value-text pair)
|
|
62
|
+
this.options = options.map(i =>
|
|
63
|
+
Utils.type.isString(i)
|
|
64
|
+
? i
|
|
65
|
+
: console.warn("Option needs to be a string", i)
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
this.append = spec.append || {};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
</script>
|
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="$classes()">
|
|
3
|
-
<fields-hidden v-if="uncheckSpec" :spec="uncheckSpec" />
|
|
4
|
-
<v-checkbox
|
|
5
|
-
v-model="fieldModel"
|
|
6
|
-
:name="fieldName"
|
|
7
|
-
:value="spec.checkValue"
|
|
8
|
-
:label="spec.label"
|
|
9
|
-
hide-details
|
|
10
|
-
@change="changed"
|
|
11
|
-
></v-checkbox>
|
|
12
|
-
<!-- <v-switch
|
|
13
|
-
v-if="fieldType == 'switch'"
|
|
14
|
-
v-model="fieldModel"
|
|
15
|
-
:name="fieldName"
|
|
16
|
-
:value="spec.checkValue"
|
|
17
|
-
:label="spec.label"
|
|
18
|
-
hide-details
|
|
19
|
-
@change="changed"
|
|
20
|
-
>
|
|
21
|
-
</v-switch>
|
|
22
|
-
<v-checkbox
|
|
23
|
-
v-else
|
|
24
|
-
v-model="fieldModel"
|
|
25
|
-
:name="fieldName"
|
|
26
|
-
:value="spec.checkValue"
|
|
27
|
-
:label="spec.label"
|
|
28
|
-
hide-details
|
|
29
|
-
@change="changed"
|
|
30
|
-
></v-checkbox> -->
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import HiddenField from "./hidden";
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
components: {
|
|
39
|
-
"fields-hidden": HiddenField
|
|
40
|
-
},
|
|
41
|
-
props: {
|
|
42
|
-
spec: { type: Object, required: true }
|
|
43
|
-
},
|
|
44
|
-
data() {
|
|
45
|
-
return {
|
|
46
|
-
groupElement: null,
|
|
47
|
-
groupName: null,
|
|
48
|
-
fieldType: null,
|
|
49
|
-
uncheckSpec: null
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
// computed: {
|
|
53
|
-
// uncheckSpec() {
|
|
54
|
-
// // const cloneSpec = Object.assign({}, this.spec)
|
|
55
|
-
// // return Object.assign(cloneSpec, { value: 0 })
|
|
56
|
-
// return { name: this.spec.name, value: this.spec.uncheckValue };
|
|
57
|
-
// }
|
|
58
|
-
// },
|
|
59
|
-
mounted() {
|
|
60
|
-
// TODO: probably need fixing
|
|
61
|
-
this.groupElement = this.$el.closest("[data-component=checkGroup]");
|
|
62
|
-
this.$type.ifObject(
|
|
63
|
-
this.groupElement,
|
|
64
|
-
val => (this.groupName = val.getAttribute("name"))
|
|
65
|
-
);
|
|
66
|
-
// if (this.groupElement) {
|
|
67
|
-
// this.groupName = this.groupElement.getAttribute('name')
|
|
68
|
-
// }
|
|
69
|
-
},
|
|
70
|
-
methods: {
|
|
71
|
-
$ready() {
|
|
72
|
-
this.fieldName = this.spec.name || this.groupName;
|
|
73
|
-
this.fieldModel = this.spec.checked
|
|
74
|
-
? this.spec.checkValue
|
|
75
|
-
: this.spec.value;
|
|
76
|
-
|
|
77
|
-
Utils.type.ifArray(this.spec.styleClasses, classes => {
|
|
78
|
-
if (classes.remove("switch")) {
|
|
79
|
-
this.fieldType = "switch";
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
Utils.type.ifNotNull(this.spec.uncheckValue, value => {
|
|
84
|
-
this.uncheckSpec = { name: this.spec.name, value: value };
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
changed(event) {
|
|
88
|
-
// Execute later to ensure the checkbox's checked state has been updated.
|
|
89
|
-
const vm = this;
|
|
90
|
-
setTimeout(function() {
|
|
91
|
-
vm.$type.ifObject(vm.groupElement, val =>
|
|
92
|
-
val.dispatchEvent(new Event("change"))
|
|
93
|
-
);
|
|
94
|
-
}, 100);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
</script>
|
|
99
|
-
|
|
100
|
-
<style scoped>
|
|
101
|
-
.v-input--selection-controls {
|
|
102
|
-
margin-top: 0;
|
|
103
|
-
}
|
|
104
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$classes()">
|
|
3
|
+
<fields-hidden v-if="uncheckSpec" :spec="uncheckSpec" />
|
|
4
|
+
<v-checkbox
|
|
5
|
+
v-model="fieldModel"
|
|
6
|
+
:name="fieldName"
|
|
7
|
+
:value="spec.checkValue"
|
|
8
|
+
:label="spec.label"
|
|
9
|
+
hide-details
|
|
10
|
+
@change="changed"
|
|
11
|
+
></v-checkbox>
|
|
12
|
+
<!-- <v-switch
|
|
13
|
+
v-if="fieldType == 'switch'"
|
|
14
|
+
v-model="fieldModel"
|
|
15
|
+
:name="fieldName"
|
|
16
|
+
:value="spec.checkValue"
|
|
17
|
+
:label="spec.label"
|
|
18
|
+
hide-details
|
|
19
|
+
@change="changed"
|
|
20
|
+
>
|
|
21
|
+
</v-switch>
|
|
22
|
+
<v-checkbox
|
|
23
|
+
v-else
|
|
24
|
+
v-model="fieldModel"
|
|
25
|
+
:name="fieldName"
|
|
26
|
+
:value="spec.checkValue"
|
|
27
|
+
:label="spec.label"
|
|
28
|
+
hide-details
|
|
29
|
+
@change="changed"
|
|
30
|
+
></v-checkbox> -->
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import HiddenField from "./hidden";
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
components: {
|
|
39
|
+
"fields-hidden": HiddenField
|
|
40
|
+
},
|
|
41
|
+
props: {
|
|
42
|
+
spec: { type: Object, required: true }
|
|
43
|
+
},
|
|
44
|
+
data() {
|
|
45
|
+
return {
|
|
46
|
+
groupElement: null,
|
|
47
|
+
groupName: null,
|
|
48
|
+
fieldType: null,
|
|
49
|
+
uncheckSpec: null
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
// computed: {
|
|
53
|
+
// uncheckSpec() {
|
|
54
|
+
// // const cloneSpec = Object.assign({}, this.spec)
|
|
55
|
+
// // return Object.assign(cloneSpec, { value: 0 })
|
|
56
|
+
// return { name: this.spec.name, value: this.spec.uncheckValue };
|
|
57
|
+
// }
|
|
58
|
+
// },
|
|
59
|
+
mounted() {
|
|
60
|
+
// TODO: probably need fixing
|
|
61
|
+
this.groupElement = this.$el.closest("[data-component=checkGroup]");
|
|
62
|
+
this.$type.ifObject(
|
|
63
|
+
this.groupElement,
|
|
64
|
+
val => (this.groupName = val.getAttribute("name"))
|
|
65
|
+
);
|
|
66
|
+
// if (this.groupElement) {
|
|
67
|
+
// this.groupName = this.groupElement.getAttribute('name')
|
|
68
|
+
// }
|
|
69
|
+
},
|
|
70
|
+
methods: {
|
|
71
|
+
$ready() {
|
|
72
|
+
this.fieldName = this.spec.name || this.groupName;
|
|
73
|
+
this.fieldModel = this.spec.checked
|
|
74
|
+
? this.spec.checkValue
|
|
75
|
+
: this.spec.value;
|
|
76
|
+
|
|
77
|
+
Utils.type.ifArray(this.spec.styleClasses, classes => {
|
|
78
|
+
if (classes.remove("switch")) {
|
|
79
|
+
this.fieldType = "switch";
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
Utils.type.ifNotNull(this.spec.uncheckValue, value => {
|
|
84
|
+
this.uncheckSpec = { name: this.spec.name, value: value };
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
changed(event) {
|
|
88
|
+
// Execute later to ensure the checkbox's checked state has been updated.
|
|
89
|
+
const vm = this;
|
|
90
|
+
setTimeout(function() {
|
|
91
|
+
vm.$type.ifObject(vm.groupElement, val =>
|
|
92
|
+
val.dispatchEvent(new Event("change"))
|
|
93
|
+
);
|
|
94
|
+
}, 100);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style scoped>
|
|
101
|
+
.v-input--selection-controls {
|
|
102
|
+
margin-top: 0;
|
|
103
|
+
}
|
|
104
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|