glib-web 0.5.77
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 +37 -0
- package/LICENSE +201 -0
- package/README.md +33 -0
- package/action.js +167 -0
- package/actions/analytics/logEvent.js +26 -0
- package/actions/auth/creditCard.js +29 -0
- package/actions/auth/restart.js +5 -0
- package/actions/auth/saveCsrfToken.js +12 -0
- package/actions/cables/push.js +38 -0
- package/actions/dialogs/alert.js +15 -0
- package/actions/dialogs/close.js +7 -0
- package/actions/dialogs/notification.js +14 -0
- package/actions/dialogs/oauth.js +6 -0
- package/actions/dialogs/open.js +7 -0
- package/actions/dialogs/options.js +5 -0
- package/actions/dialogs/show.js +5 -0
- package/actions/forms/submit.js +15 -0
- package/actions/http/delete.js +7 -0
- package/actions/http/patch.js +7 -0
- package/actions/http/post.js +7 -0
- package/actions/http/put.js +7 -0
- package/actions/panels/scrollTo.js +18 -0
- package/actions/panels/scrollToBottom.js +11 -0
- package/actions/runMultiple.js +11 -0
- package/actions/sheets/select.js +5 -0
- package/actions/snackbars/alert.js +15 -0
- package/actions/snackbars/select.js +5 -0
- package/actions/timeouts/set.js +20 -0
- package/actions/windows/close.js +13 -0
- package/actions/windows/closeAll.js +16 -0
- package/actions/windows/closeWithReload.js +18 -0
- package/actions/windows/open.js +5 -0
- package/actions/windows/openWeb.js +5 -0
- package/actions/windows/refreshState.js +5 -0
- package/actions/windows/reload.js +24 -0
- package/actions/ws/push.js +35 -0
- package/app.vue +180 -0
- package/components/_button.vue +101 -0
- package/components/_dropdownMenu.vue +76 -0
- package/components/_icon.vue +50 -0
- package/components/_message.vue +25 -0
- package/components/avatar.vue +16 -0
- package/components/banners/alert.vue +49 -0
- package/components/banners/select.vue +82 -0
- package/components/button.vue +13 -0
- package/components/calendar.vue +105 -0
- package/components/charts/column.vue +26 -0
- package/components/charts/line.vue +61 -0
- package/components/chip.vue +24 -0
- package/components/component.vue +222 -0
- package/components/datetime.vue +54 -0
- package/components/fab.vue +33 -0
- package/components/fields/_patternText.vue +61 -0
- package/components/fields/_select.vue +86 -0
- package/components/fields/autocomplete.vue +73 -0
- package/components/fields/check.vue +104 -0
- package/components/fields/checkGroup.vue +51 -0
- package/components/fields/country/countries.js +251 -0
- package/components/fields/country/field.vue +81 -0
- package/components/fields/country/regions.js +12 -0
- package/components/fields/creditCard.vue +105 -0
- package/components/fields/date.vue +24 -0
- package/components/fields/datetime.vue +49 -0
- package/components/fields/dynamicGroup.vue +106 -0
- package/components/fields/dynamicSelect.vue +173 -0
- package/components/fields/file.vue +166 -0
- package/components/fields/googlePlace.vue +158 -0
- package/components/fields/hidden.vue +18 -0
- package/components/fields/location.vue +223 -0
- package/components/fields/newRichText.vue +191 -0
- package/components/fields/phone/countries.js +315 -0
- package/components/fields/phone/field.vue +348 -0
- package/components/fields/phone/sprite.css +1071 -0
- package/components/fields/radio.vue +64 -0
- package/components/fields/radioGroup.vue +93 -0
- package/components/fields/rating.vue +26 -0
- package/components/fields/richText.vue +172 -0
- package/components/fields/select.vue +17 -0
- package/components/fields/stripe/stripeFields.vue +93 -0
- package/components/fields/stripe/stripeIndividualFields.vue +207 -0
- package/components/fields/stripeExternalAccount.vue +135 -0
- package/components/fields/stripeToken.vue +59 -0
- package/components/fields/submit.vue +23 -0
- package/components/fields/text.vue +144 -0
- package/components/fields/textarea.vue +59 -0
- package/components/fields/timeZone.vue +22 -0
- package/components/fields/timer.vue +83 -0
- package/components/h1.vue +28 -0
- package/components/h2.vue +20 -0
- package/components/h3.vue +22 -0
- package/components/h4.vue +20 -0
- package/components/h5.vue +20 -0
- package/components/h6.vue +20 -0
- package/components/hr.vue +13 -0
- package/components/html.vue +13 -0
- package/components/icon.vue +25 -0
- package/components/image.vue +87 -0
- package/components/label.vue +62 -0
- package/components/map.vue +206 -0
- package/components/markdown.vue +52 -0
- package/components/mixins/events.js +178 -0
- package/components/mixins/generic.js +58 -0
- package/components/mixins/list/autoload.js +144 -0
- package/components/mixins/longClick.js +56 -0
- package/components/mixins/scrolling.js +35 -0
- package/components/mixins/styles.js +221 -0
- package/components/mixins/table/autoload.js +131 -0
- package/components/mixins/table/export.js +52 -0
- package/components/mixins/table/import.js +106 -0
- package/components/mixins/text.js +20 -0
- package/components/mixins/ws/actionCable.js +48 -0
- package/components/mixins/ws/phoenixSocket.js +117 -0
- package/components/p.vue +36 -0
- package/components/panels/carousel.vue +55 -0
- package/components/panels/column.vue +117 -0
- package/components/panels/custom.vue +52 -0
- package/components/panels/flow.vue +81 -0
- package/components/panels/form.vue +126 -0
- package/components/panels/horizontal.vue +73 -0
- package/components/panels/list.vue +241 -0
- package/components/panels/responsive.vue +88 -0
- package/components/panels/scroll.vue +68 -0
- package/components/panels/split.vue +52 -0
- package/components/panels/table.vue +234 -0
- package/components/panels/ul.vue +34 -0
- package/components/panels/vertical.vue +71 -0
- package/components/panels/web.vue +11 -0
- package/components/spacer.vue +11 -0
- package/components/switch.vue +42 -0
- package/components/tabBar.vue +44 -0
- package/extensions/array.js +20 -0
- package/extensions/string.js +21 -0
- package/index.js +195 -0
- package/keys.js +12 -0
- package/nav/appbar.vue +117 -0
- package/nav/content.vue +40 -0
- package/nav/dialog.vue +127 -0
- package/nav/drawer.vue +88 -0
- package/nav/drawerButton.vue +28 -0
- package/nav/drawerLabel.vue +21 -0
- package/nav/sheet.vue +57 -0
- package/nav/snackbar.vue +72 -0
- package/package.json +42 -0
- package/settings.json.example +21 -0
- package/static/plugins/alignment/alignment.js +76 -0
- package/static/plugins/alignment/alignment.min.js +1 -0
- package/static/plugins/beyondgrammar/beyondgrammar.js +46 -0
- package/static/plugins/beyondgrammar/beyondgrammar.min.js +1 -0
- package/static/plugins/blockcode/blockcode.js +110 -0
- package/static/plugins/blockcode/blockcode.min.js +1 -0
- package/static/plugins/clips/clips.js +44 -0
- package/static/plugins/clips/clips.min.js +1 -0
- package/static/plugins/counter/counter.js +60 -0
- package/static/plugins/counter/counter.min.js +1 -0
- package/static/plugins/definedlinks/definedlinks.js +64 -0
- package/static/plugins/definedlinks/definedlinks.min.js +1 -0
- package/static/plugins/handle/handle.js +173 -0
- package/static/plugins/handle/handle.min.js +1 -0
- package/static/plugins/icons/icons.js +72 -0
- package/static/plugins/icons/icons.min.js +1 -0
- package/static/plugins/imageposition/imageposition.js +85 -0
- package/static/plugins/imageposition/imageposition.min.js +1 -0
- package/static/plugins/inlineformat/inlineformat.js +85 -0
- package/static/plugins/inlineformat/inlineformat.min.js +1 -0
- package/static/plugins/removeformat/removeformat.js +28 -0
- package/static/plugins/removeformat/removeformat.min.js +1 -0
- package/static/plugins/selector/selector.js +96 -0
- package/static/plugins/selector/selector.min.js +1 -0
- package/static/plugins/specialchars/specialchars.js +63 -0
- package/static/plugins/specialchars/specialchars.min.js +1 -0
- package/static/plugins/textdirection/textdirection.js +55 -0
- package/static/plugins/textdirection/textdirection.min.js +1 -0
- package/static/plugins/textexpander/textexpander.js +46 -0
- package/static/plugins/textexpander/textexpander.min.js +1 -0
- package/static/plugins/underline/underline.js +27 -0
- package/static/plugins/underline/underline.min.js +1 -0
- package/static/redactorx.css +1344 -0
- package/static/redactorx.js +14254 -0
- package/static/redactorx.min.css +1 -0
- package/static/redactorx.min.js +1 -0
- package/static/redactorx.usm.min.js +2 -0
- package/styles/test.sass +3 -0
- package/styles/test.scss +5 -0
- package/templates/_menu.vue +38 -0
- package/templates/comment.vue +202 -0
- package/templates/featured.vue +32 -0
- package/templates/thumbnail.vue +138 -0
- package/templates/unsupported.vue +12 -0
- package/utils/app.js +14 -0
- package/utils/dom.js +13 -0
- package/utils/form.js +34 -0
- package/utils/format.js +14 -0
- package/utils/hash.js +29 -0
- package/utils/helper.js +44 -0
- package/utils/history.js +70 -0
- package/utils/http.js +209 -0
- package/utils/launch.js +135 -0
- package/utils/private/ws.js +22 -0
- package/utils/public.js +23 -0
- package/utils/settings.js +48 -0
- package/utils/storage.js +9 -0
- package/utils/type.js +69 -0
- package/utils/uploader.js +121 -0
- package/utils/url.js +132 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="genericStyles()" :class="$classes()">
|
|
3
|
+
<v-text-field
|
|
4
|
+
v-model="accountNumber"
|
|
5
|
+
label="Account Number"
|
|
6
|
+
placeholder="000123456"
|
|
7
|
+
:outlined="$classes().includes('outlined')"
|
|
8
|
+
:rounded="$classes().includes('rounded')"
|
|
9
|
+
:dense="$classes().includes('dense')"
|
|
10
|
+
:rules="accountNumberRules"
|
|
11
|
+
:error-messages="errorMessages"
|
|
12
|
+
@keyup="$onTyping({ duration: 200 })"
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<div v-if="spec.country">
|
|
16
|
+
<div v-for="field in inputs[country].fields" :key="field.label">
|
|
17
|
+
<v-text-field
|
|
18
|
+
v-model="field.model"
|
|
19
|
+
:label="field.label"
|
|
20
|
+
:placeholder="field.placeholder"
|
|
21
|
+
:outlined="$classes().includes('outlined')"
|
|
22
|
+
:rounded="$classes().includes('rounded')"
|
|
23
|
+
:dense="$classes().includes('dense')"
|
|
24
|
+
:rules="field.rules"
|
|
25
|
+
@keyup="$onTyping({ duration: 200 })"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<input ref="token" type="hidden" :name="spec.name" />
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
<script>
|
|
34
|
+
export default {
|
|
35
|
+
props: {
|
|
36
|
+
spec: { type: Object, required: true }
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
routingNumber: null,
|
|
41
|
+
accountNumber: null,
|
|
42
|
+
inputs: {},
|
|
43
|
+
accountNumberRules: [value => !!value || "Account number required"],
|
|
44
|
+
errorMessages: null
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
created() {
|
|
48
|
+
this.country = this.spec.country.toLowerCase();
|
|
49
|
+
this.stripe = Stripe(this.spec.publicKey);
|
|
50
|
+
this.spec.onTypeEnd = { action: "component/createToken" };
|
|
51
|
+
this.registerCountry("nz", [], function() {
|
|
52
|
+
return "";
|
|
53
|
+
});
|
|
54
|
+
this.registerCountry(
|
|
55
|
+
"au",
|
|
56
|
+
[
|
|
57
|
+
{
|
|
58
|
+
label: "Bank State Number",
|
|
59
|
+
placeholder: "110000",
|
|
60
|
+
model: "",
|
|
61
|
+
rules: [value => !!value || "Bank state number required"]
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
function() {
|
|
65
|
+
return this.fields[0].model;
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
this.registerCountry(
|
|
69
|
+
"ca",
|
|
70
|
+
[
|
|
71
|
+
{
|
|
72
|
+
label: "Transit",
|
|
73
|
+
placeholder: "12345",
|
|
74
|
+
model: "",
|
|
75
|
+
rules: [value => !!value || "Transit number required"]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: "Institution",
|
|
79
|
+
placeholder: "678",
|
|
80
|
+
model: "",
|
|
81
|
+
rules: [value => !!value || "Institution number required"]
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
function() {
|
|
85
|
+
return `${this.fields[0].model}-${this.fields[1].model}`;
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
methods: {
|
|
90
|
+
action_createToken() {
|
|
91
|
+
const token = this.$refs.token;
|
|
92
|
+
this.errorMessages = null;
|
|
93
|
+
this.routingNumber = this.inputs[this.country].makeRoutingNumber();
|
|
94
|
+
if (this.accountNumber) {
|
|
95
|
+
this.$dispatchEvent("forms/setBusy", { value: true });
|
|
96
|
+
const vm = this;
|
|
97
|
+
const bank = {
|
|
98
|
+
country: this.spec.country,
|
|
99
|
+
currency: this.spec.currency,
|
|
100
|
+
account_number: this.accountNumber,
|
|
101
|
+
account_holder_name: this.spec.accountHolderName,
|
|
102
|
+
account_holder_type: this.spec.accountHolderType
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
if (this.routingNumber) {
|
|
106
|
+
bank["routing_number"] = this.routingNumber;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this.stripe.createToken("bank_account", bank).then(response => {
|
|
110
|
+
if (response.token) {
|
|
111
|
+
token.value = response.token.id;
|
|
112
|
+
} else {
|
|
113
|
+
this.errorMessages = [response.error.message];
|
|
114
|
+
token.value = "";
|
|
115
|
+
}
|
|
116
|
+
vm.$dispatchEvent("forms/setBusy", { value: false });
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
/**
|
|
121
|
+
* Different countries have different ways of creating routing numbers.
|
|
122
|
+
* Canada, for example, requires transit numbers and institution numbers and then combined to create a routing number,
|
|
123
|
+
* while New Zealand does not use a routing number.
|
|
124
|
+
*/
|
|
125
|
+
registerCountry(country = "", fields = [], makeRoutingNumber) {
|
|
126
|
+
this.inputs[country] = { fields, makeRoutingNumber };
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
</script>
|
|
131
|
+
<style lang="scss" scoped>
|
|
132
|
+
v-text-field {
|
|
133
|
+
padding: 0 8px 0 8px;
|
|
134
|
+
}
|
|
135
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="genericStyles()" :class="$classes()">
|
|
3
|
+
<StripeIndividualFields
|
|
4
|
+
v-if="$classes().includes('individual')"
|
|
5
|
+
:spec="spec"
|
|
6
|
+
:on-complete="_retrieveToken"
|
|
7
|
+
:on-error="_displayError"
|
|
8
|
+
/>
|
|
9
|
+
<StripeFields
|
|
10
|
+
v-else
|
|
11
|
+
:spec="spec"
|
|
12
|
+
:on-complete="_retrieveToken"
|
|
13
|
+
:on-error="_displayError"
|
|
14
|
+
/>
|
|
15
|
+
<div ref="error" style="color: red;"></div>
|
|
16
|
+
<input ref="token" type="hidden" :name="spec.name" />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import StripeIndividualFields from "./stripe/stripeIndividualFields.vue";
|
|
22
|
+
import StripeFields from "./stripe/stripeFields.vue";
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
components: {
|
|
26
|
+
StripeIndividualFields,
|
|
27
|
+
StripeFields
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
spec: { type: Object, required: true }
|
|
31
|
+
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
stripe: null,
|
|
35
|
+
card: null
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
methods: {
|
|
39
|
+
_displayError(message) {
|
|
40
|
+
const displayError = this.$refs.error;
|
|
41
|
+
displayError.textContent = message;
|
|
42
|
+
},
|
|
43
|
+
_retrieveToken(stripe, card) {
|
|
44
|
+
this.$dispatchEvent("forms/setBusy", { value: true });
|
|
45
|
+
const vm = this;
|
|
46
|
+
stripe.createToken(card).then(function(result) {
|
|
47
|
+
if (result.error) {
|
|
48
|
+
vm._displayError(result.error.message);
|
|
49
|
+
} else {
|
|
50
|
+
vm._displayError("");
|
|
51
|
+
const token = result.token;
|
|
52
|
+
vm.$refs.token.setAttribute("value", token.id);
|
|
53
|
+
}
|
|
54
|
+
vm.$dispatchEvent("forms/setBusy", { value: false });
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<common-button :spec="spec" type="submit" :disabled="$isBusy" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
props: {
|
|
8
|
+
spec: { type: Object, required: true }
|
|
9
|
+
},
|
|
10
|
+
data: function() {
|
|
11
|
+
return {
|
|
12
|
+
data: this.$data
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
$ready() {
|
|
17
|
+
this.$dispatchEvent("forms/addSubmit", this.$data);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style scoped></style>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="$styles()" :class="classes()">
|
|
3
|
+
<v-text-field
|
|
4
|
+
v-model="fieldModel"
|
|
5
|
+
:label="spec.label"
|
|
6
|
+
:name="fieldName"
|
|
7
|
+
:value="spec.value"
|
|
8
|
+
:hint="spec.hint"
|
|
9
|
+
:placeholder="spec.placeholder"
|
|
10
|
+
:maxlength="spec.maxLength || 255"
|
|
11
|
+
:disabled="spec.readOnly"
|
|
12
|
+
:type="variant.type"
|
|
13
|
+
:rules="rules"
|
|
14
|
+
:prepend-inner-icon="leftIconName"
|
|
15
|
+
:append-icon="variant.appendIcon"
|
|
16
|
+
:prefix="spec.leftText"
|
|
17
|
+
:suffix="spec.rightText"
|
|
18
|
+
:min="spec.min"
|
|
19
|
+
:max="spec.max"
|
|
20
|
+
:outlined="$classes().includes('outlined')"
|
|
21
|
+
:rounded="$classes().includes('rounded')"
|
|
22
|
+
:dense="$classes().includes('dense')"
|
|
23
|
+
:autofocus="spec.autoFocus || false"
|
|
24
|
+
validate-on-blur
|
|
25
|
+
@click:append="onRightIconClick"
|
|
26
|
+
/>
|
|
27
|
+
<input
|
|
28
|
+
v-if="spec.readOnly"
|
|
29
|
+
type="hidden"
|
|
30
|
+
:name="fieldName"
|
|
31
|
+
:value="fieldModel"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
export default {
|
|
38
|
+
props: {
|
|
39
|
+
spec: { type: Object, required: true },
|
|
40
|
+
type: { type: String, required: true }
|
|
41
|
+
},
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
variant: {},
|
|
45
|
+
rules: [],
|
|
46
|
+
fields: {
|
|
47
|
+
email: {
|
|
48
|
+
type: "email",
|
|
49
|
+
prependIcon: "email",
|
|
50
|
+
onRightIconClick: function() {},
|
|
51
|
+
rules: [
|
|
52
|
+
v =>
|
|
53
|
+
!v ||
|
|
54
|
+
/^\w+([.-\\+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) ||
|
|
55
|
+
"E-mail must be valid"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
number: {
|
|
59
|
+
type: "number",
|
|
60
|
+
prependIcon: "looks_one",
|
|
61
|
+
onRightIconClick: function() {},
|
|
62
|
+
rules: [v => !v || /^\-?[.\d]*$/.test(v) || "Must be a number"]
|
|
63
|
+
},
|
|
64
|
+
password: {
|
|
65
|
+
type: "password",
|
|
66
|
+
prependIcon: "lock",
|
|
67
|
+
appendIcon: "visibility",
|
|
68
|
+
onRightIconClick: function(vm) {
|
|
69
|
+
vm.togglePasswordVisibility();
|
|
70
|
+
},
|
|
71
|
+
rules: [v => !v || v.length >= 6 || "Password must be longer"]
|
|
72
|
+
},
|
|
73
|
+
url: {
|
|
74
|
+
type: "url",
|
|
75
|
+
prependIcon: "web",
|
|
76
|
+
onRightIconClick: function() {},
|
|
77
|
+
rules: [
|
|
78
|
+
// From https://gist.github.com/rodneyrehm/8013067
|
|
79
|
+
// Make sure to support unicode chars, e.g. https://www.facebook.com/%E5%86%B0%E5%8F%8B%E4%BE%86%E7%9C%8B%E7%90%83-103474391161721/
|
|
80
|
+
v =>
|
|
81
|
+
!v ||
|
|
82
|
+
/^(https?|ftp|torrent|image|irc):\/\/(-\.)?([^\s\/?\.#]+\.?)+(\/[^\s]*)?$/i.test(
|
|
83
|
+
v
|
|
84
|
+
) ||
|
|
85
|
+
"Must be a valid URL"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
search: {
|
|
89
|
+
type: "url",
|
|
90
|
+
prependIcon: "search",
|
|
91
|
+
onRightIconClick: function() {},
|
|
92
|
+
rules: [
|
|
93
|
+
v => !v || /^\w+:\/\/[.-\w]+$/.test(v) || "Must be a valid URL"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
computed: {
|
|
100
|
+
leftIconName() {
|
|
101
|
+
const icon = this.spec.leftIcon || {};
|
|
102
|
+
const materialIcon = icon.material || {};
|
|
103
|
+
return materialIcon.name;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
methods: {
|
|
107
|
+
$ready() {
|
|
108
|
+
this.variant = this.fields[this.type] || {};
|
|
109
|
+
this.rules = this.$validation(this.variant.rules);
|
|
110
|
+
},
|
|
111
|
+
togglePasswordVisibility() {
|
|
112
|
+
const passwordField = this.fields["password"];
|
|
113
|
+
if (passwordField.appendIcon == "visibility") {
|
|
114
|
+
passwordField.type = "text";
|
|
115
|
+
passwordField.appendIcon = "visibility_off";
|
|
116
|
+
} else {
|
|
117
|
+
passwordField.type = "password";
|
|
118
|
+
passwordField.appendIcon = "visibility";
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
onRightIconClick() {
|
|
122
|
+
this.variant.onRightIconClick(this);
|
|
123
|
+
},
|
|
124
|
+
classes() {
|
|
125
|
+
return this.$classes().concat("g-text-field--hintless");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
</script>
|
|
130
|
+
|
|
131
|
+
<style lang="scss">
|
|
132
|
+
.g-text-field--hintless {
|
|
133
|
+
.v-text-field {
|
|
134
|
+
.v-text-field__details {
|
|
135
|
+
min-height: 0;
|
|
136
|
+
margin-bottom: 0;
|
|
137
|
+
|
|
138
|
+
.v-messages {
|
|
139
|
+
min-height: 0;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="styles()" :class="classes()">
|
|
3
|
+
<v-textarea
|
|
4
|
+
v-model="fieldModel"
|
|
5
|
+
:label="spec.label"
|
|
6
|
+
:name="fieldName"
|
|
7
|
+
:value="spec.value"
|
|
8
|
+
:hint="spec.hint"
|
|
9
|
+
:placeholder="spec.placeholder"
|
|
10
|
+
:maxlength="spec.maxLength || 255"
|
|
11
|
+
:disabled="spec.readOnly"
|
|
12
|
+
:height="height"
|
|
13
|
+
:rules="$validation()"
|
|
14
|
+
counter
|
|
15
|
+
:outlined="$classes().includes('outlined')"
|
|
16
|
+
validate-on-blur
|
|
17
|
+
@keyup="$onTyping"
|
|
18
|
+
></v-textarea>
|
|
19
|
+
<input
|
|
20
|
+
v-if="spec.readOnly"
|
|
21
|
+
type="hidden"
|
|
22
|
+
:name="fieldName"
|
|
23
|
+
:value="spec.value"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
export default {
|
|
30
|
+
props: {
|
|
31
|
+
spec: { type: Object, required: true }
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
// styles: null,
|
|
36
|
+
height: null
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
styles() {
|
|
41
|
+
const styles = this.$styles();
|
|
42
|
+
this.height = styles.remove("height");
|
|
43
|
+
return styles;
|
|
44
|
+
},
|
|
45
|
+
classes() {
|
|
46
|
+
return this.$classes().concat("g-text-field--hintless");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style lang="scss">
|
|
53
|
+
.v-text-field__details {
|
|
54
|
+
margin-top: 2px;
|
|
55
|
+
}
|
|
56
|
+
.text-bold {
|
|
57
|
+
font-weight: bold;
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<fields-genericSelect :spec="spec" :default-value="defaultValue" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import SelectField from "./_select";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
components: {
|
|
10
|
+
// Need to start with `fields-` to enable jsonlogic in `styles.js#_linkFieldModels`
|
|
11
|
+
"fields-genericSelect": SelectField
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
spec: { type: Object, required: true }
|
|
15
|
+
},
|
|
16
|
+
computed: {
|
|
17
|
+
defaultValue() {
|
|
18
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="$styles()" :class="classes()">
|
|
3
|
+
<v-text-field
|
|
4
|
+
v-model="fieldModel"
|
|
5
|
+
:label="spec.label"
|
|
6
|
+
:name="fieldName"
|
|
7
|
+
:disabled="true"
|
|
8
|
+
:outlined="$classes().includes('outlined')"
|
|
9
|
+
:rounded="$classes().includes('rounded')"
|
|
10
|
+
:dense="$classes().includes('dense')"
|
|
11
|
+
/>
|
|
12
|
+
<input type="hidden" :name="fieldName" :value="fieldModel" />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import actionCableMixin from "../mixins/ws/actionCable";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
mixins: [actionCableMixin],
|
|
21
|
+
props: {
|
|
22
|
+
spec: { type: Object, required: true }
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
timer: null,
|
|
27
|
+
minValue: -1000000,
|
|
28
|
+
maxValue: 1000000
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
$ready() {
|
|
33
|
+
this.$wsInitActionCable(this.spec.actionCable);
|
|
34
|
+
|
|
35
|
+
Utils.type.ifNumber(this.spec.min, value => {
|
|
36
|
+
this.minValue = value;
|
|
37
|
+
});
|
|
38
|
+
Utils.type.ifNumber(this.spec.max, value => {
|
|
39
|
+
this.maxValue = value;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
Utils.type.ifNumber(this.spec.value, value => {
|
|
43
|
+
if (value !== null) {
|
|
44
|
+
this.fieldModel = value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
this.timer = setInterval(() => {
|
|
48
|
+
this.adjustValue();
|
|
49
|
+
}, 1000);
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
adjustValue() {
|
|
53
|
+
if (this.spec.forward) {
|
|
54
|
+
if (this.fieldModel < this.maxValue) {
|
|
55
|
+
this.fieldModel += 1;
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
if (this.fieldModel > this.minValue) {
|
|
59
|
+
this.fieldModel -= 1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
$tearDown() {
|
|
64
|
+
console.log("Cleaning up timer...");
|
|
65
|
+
if (this.timer != null) {
|
|
66
|
+
clearInterval(this.timer);
|
|
67
|
+
console.log(`Timer stopped: ${this.timer}`);
|
|
68
|
+
this.timer == null;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
action_set(spec) {
|
|
72
|
+
Utils.type.ifNumber(spec.value, value => {
|
|
73
|
+
this.fieldModel = value;
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
classes() {
|
|
77
|
+
return this.$classes().concat("g-text-field--hintless");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<style scoped></style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h1
|
|
3
|
+
:style="textStyles()"
|
|
4
|
+
:class="$classes()"
|
|
5
|
+
:href="$href()"
|
|
6
|
+
:rel="$rel()"
|
|
7
|
+
@click="$onClick()"
|
|
8
|
+
>
|
|
9
|
+
{{ spec.text }}
|
|
10
|
+
</h1>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import textMixin from "./mixins/text.js";
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
mixins: [textMixin],
|
|
18
|
+
props: {
|
|
19
|
+
spec: { type: Object, required: true }
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
/* h1 {
|
|
26
|
+
line-height: 1.5;
|
|
27
|
+
} */
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h2 :style="textStyles()" :class="$classes()">{{ spec.text }}</h2>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import textMixin from "./mixins/text.js";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
mixins: [textMixin],
|
|
10
|
+
props: {
|
|
11
|
+
spec: { type: Object, required: true }
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
/* h2 {
|
|
18
|
+
line-height: 1.5;
|
|
19
|
+
} */
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h3 :id="spec.id" :style="textStyles()" :class="$classes()">
|
|
3
|
+
{{ spec.text }}
|
|
4
|
+
</h3>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import textMixin from "./mixins/text.js";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
mixins: [textMixin],
|
|
12
|
+
props: {
|
|
13
|
+
spec: { type: Object, required: true }
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style scoped>
|
|
19
|
+
/* h3 {
|
|
20
|
+
line-height: 1.5;
|
|
21
|
+
} */
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h4 :style="textStyles()" :class="$classes()">{{ spec.text }}</h4>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import textMixin from "./mixins/text.js";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
mixins: [textMixin],
|
|
10
|
+
props: {
|
|
11
|
+
spec: { type: Object, required: true }
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
/* h4 {
|
|
18
|
+
line-height: 1.5;
|
|
19
|
+
} */
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h5 :style="textStyles()" :class="$classes()">{{ spec.text }}</h5>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import textMixin from "./mixins/text.js";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
mixins: [textMixin],
|
|
10
|
+
props: {
|
|
11
|
+
spec: { type: Object, required: true }
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
/* h4 {
|
|
18
|
+
line-height: 1.5;
|
|
19
|
+
} */
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h4 :style="textStyles()" :class="$classes()">{{ spec.text }}</h4>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import textMixin from "./mixins/text.js";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
mixins: [textMixin],
|
|
10
|
+
props: {
|
|
11
|
+
spec: { type: Object, required: true }
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
/* h4 {
|
|
18
|
+
line-height: 1.5;
|
|
19
|
+
} */
|
|
20
|
+
</style>
|