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.
Files changed (204) hide show
  1. package/.eslintrc.js +37 -0
  2. package/LICENSE +201 -0
  3. package/README.md +33 -0
  4. package/action.js +167 -0
  5. package/actions/analytics/logEvent.js +26 -0
  6. package/actions/auth/creditCard.js +29 -0
  7. package/actions/auth/restart.js +5 -0
  8. package/actions/auth/saveCsrfToken.js +12 -0
  9. package/actions/cables/push.js +38 -0
  10. package/actions/dialogs/alert.js +15 -0
  11. package/actions/dialogs/close.js +7 -0
  12. package/actions/dialogs/notification.js +14 -0
  13. package/actions/dialogs/oauth.js +6 -0
  14. package/actions/dialogs/open.js +7 -0
  15. package/actions/dialogs/options.js +5 -0
  16. package/actions/dialogs/show.js +5 -0
  17. package/actions/forms/submit.js +15 -0
  18. package/actions/http/delete.js +7 -0
  19. package/actions/http/patch.js +7 -0
  20. package/actions/http/post.js +7 -0
  21. package/actions/http/put.js +7 -0
  22. package/actions/panels/scrollTo.js +18 -0
  23. package/actions/panels/scrollToBottom.js +11 -0
  24. package/actions/runMultiple.js +11 -0
  25. package/actions/sheets/select.js +5 -0
  26. package/actions/snackbars/alert.js +15 -0
  27. package/actions/snackbars/select.js +5 -0
  28. package/actions/timeouts/set.js +20 -0
  29. package/actions/windows/close.js +13 -0
  30. package/actions/windows/closeAll.js +16 -0
  31. package/actions/windows/closeWithReload.js +18 -0
  32. package/actions/windows/open.js +5 -0
  33. package/actions/windows/openWeb.js +5 -0
  34. package/actions/windows/refreshState.js +5 -0
  35. package/actions/windows/reload.js +24 -0
  36. package/actions/ws/push.js +35 -0
  37. package/app.vue +180 -0
  38. package/components/_button.vue +101 -0
  39. package/components/_dropdownMenu.vue +76 -0
  40. package/components/_icon.vue +50 -0
  41. package/components/_message.vue +25 -0
  42. package/components/avatar.vue +16 -0
  43. package/components/banners/alert.vue +49 -0
  44. package/components/banners/select.vue +82 -0
  45. package/components/button.vue +13 -0
  46. package/components/calendar.vue +105 -0
  47. package/components/charts/column.vue +26 -0
  48. package/components/charts/line.vue +61 -0
  49. package/components/chip.vue +24 -0
  50. package/components/component.vue +222 -0
  51. package/components/datetime.vue +54 -0
  52. package/components/fab.vue +33 -0
  53. package/components/fields/_patternText.vue +61 -0
  54. package/components/fields/_select.vue +86 -0
  55. package/components/fields/autocomplete.vue +73 -0
  56. package/components/fields/check.vue +104 -0
  57. package/components/fields/checkGroup.vue +51 -0
  58. package/components/fields/country/countries.js +251 -0
  59. package/components/fields/country/field.vue +81 -0
  60. package/components/fields/country/regions.js +12 -0
  61. package/components/fields/creditCard.vue +105 -0
  62. package/components/fields/date.vue +24 -0
  63. package/components/fields/datetime.vue +49 -0
  64. package/components/fields/dynamicGroup.vue +106 -0
  65. package/components/fields/dynamicSelect.vue +173 -0
  66. package/components/fields/file.vue +166 -0
  67. package/components/fields/googlePlace.vue +158 -0
  68. package/components/fields/hidden.vue +18 -0
  69. package/components/fields/location.vue +223 -0
  70. package/components/fields/newRichText.vue +191 -0
  71. package/components/fields/phone/countries.js +315 -0
  72. package/components/fields/phone/field.vue +348 -0
  73. package/components/fields/phone/sprite.css +1071 -0
  74. package/components/fields/radio.vue +64 -0
  75. package/components/fields/radioGroup.vue +93 -0
  76. package/components/fields/rating.vue +26 -0
  77. package/components/fields/richText.vue +172 -0
  78. package/components/fields/select.vue +17 -0
  79. package/components/fields/stripe/stripeFields.vue +93 -0
  80. package/components/fields/stripe/stripeIndividualFields.vue +207 -0
  81. package/components/fields/stripeExternalAccount.vue +135 -0
  82. package/components/fields/stripeToken.vue +59 -0
  83. package/components/fields/submit.vue +23 -0
  84. package/components/fields/text.vue +144 -0
  85. package/components/fields/textarea.vue +59 -0
  86. package/components/fields/timeZone.vue +22 -0
  87. package/components/fields/timer.vue +83 -0
  88. package/components/h1.vue +28 -0
  89. package/components/h2.vue +20 -0
  90. package/components/h3.vue +22 -0
  91. package/components/h4.vue +20 -0
  92. package/components/h5.vue +20 -0
  93. package/components/h6.vue +20 -0
  94. package/components/hr.vue +13 -0
  95. package/components/html.vue +13 -0
  96. package/components/icon.vue +25 -0
  97. package/components/image.vue +87 -0
  98. package/components/label.vue +62 -0
  99. package/components/map.vue +206 -0
  100. package/components/markdown.vue +52 -0
  101. package/components/mixins/events.js +178 -0
  102. package/components/mixins/generic.js +58 -0
  103. package/components/mixins/list/autoload.js +144 -0
  104. package/components/mixins/longClick.js +56 -0
  105. package/components/mixins/scrolling.js +35 -0
  106. package/components/mixins/styles.js +221 -0
  107. package/components/mixins/table/autoload.js +131 -0
  108. package/components/mixins/table/export.js +52 -0
  109. package/components/mixins/table/import.js +106 -0
  110. package/components/mixins/text.js +20 -0
  111. package/components/mixins/ws/actionCable.js +48 -0
  112. package/components/mixins/ws/phoenixSocket.js +117 -0
  113. package/components/p.vue +36 -0
  114. package/components/panels/carousel.vue +55 -0
  115. package/components/panels/column.vue +117 -0
  116. package/components/panels/custom.vue +52 -0
  117. package/components/panels/flow.vue +81 -0
  118. package/components/panels/form.vue +126 -0
  119. package/components/panels/horizontal.vue +73 -0
  120. package/components/panels/list.vue +241 -0
  121. package/components/panels/responsive.vue +88 -0
  122. package/components/panels/scroll.vue +68 -0
  123. package/components/panels/split.vue +52 -0
  124. package/components/panels/table.vue +234 -0
  125. package/components/panels/ul.vue +34 -0
  126. package/components/panels/vertical.vue +71 -0
  127. package/components/panels/web.vue +11 -0
  128. package/components/spacer.vue +11 -0
  129. package/components/switch.vue +42 -0
  130. package/components/tabBar.vue +44 -0
  131. package/extensions/array.js +20 -0
  132. package/extensions/string.js +21 -0
  133. package/index.js +195 -0
  134. package/keys.js +12 -0
  135. package/nav/appbar.vue +117 -0
  136. package/nav/content.vue +40 -0
  137. package/nav/dialog.vue +127 -0
  138. package/nav/drawer.vue +88 -0
  139. package/nav/drawerButton.vue +28 -0
  140. package/nav/drawerLabel.vue +21 -0
  141. package/nav/sheet.vue +57 -0
  142. package/nav/snackbar.vue +72 -0
  143. package/package.json +42 -0
  144. package/settings.json.example +21 -0
  145. package/static/plugins/alignment/alignment.js +76 -0
  146. package/static/plugins/alignment/alignment.min.js +1 -0
  147. package/static/plugins/beyondgrammar/beyondgrammar.js +46 -0
  148. package/static/plugins/beyondgrammar/beyondgrammar.min.js +1 -0
  149. package/static/plugins/blockcode/blockcode.js +110 -0
  150. package/static/plugins/blockcode/blockcode.min.js +1 -0
  151. package/static/plugins/clips/clips.js +44 -0
  152. package/static/plugins/clips/clips.min.js +1 -0
  153. package/static/plugins/counter/counter.js +60 -0
  154. package/static/plugins/counter/counter.min.js +1 -0
  155. package/static/plugins/definedlinks/definedlinks.js +64 -0
  156. package/static/plugins/definedlinks/definedlinks.min.js +1 -0
  157. package/static/plugins/handle/handle.js +173 -0
  158. package/static/plugins/handle/handle.min.js +1 -0
  159. package/static/plugins/icons/icons.js +72 -0
  160. package/static/plugins/icons/icons.min.js +1 -0
  161. package/static/plugins/imageposition/imageposition.js +85 -0
  162. package/static/plugins/imageposition/imageposition.min.js +1 -0
  163. package/static/plugins/inlineformat/inlineformat.js +85 -0
  164. package/static/plugins/inlineformat/inlineformat.min.js +1 -0
  165. package/static/plugins/removeformat/removeformat.js +28 -0
  166. package/static/plugins/removeformat/removeformat.min.js +1 -0
  167. package/static/plugins/selector/selector.js +96 -0
  168. package/static/plugins/selector/selector.min.js +1 -0
  169. package/static/plugins/specialchars/specialchars.js +63 -0
  170. package/static/plugins/specialchars/specialchars.min.js +1 -0
  171. package/static/plugins/textdirection/textdirection.js +55 -0
  172. package/static/plugins/textdirection/textdirection.min.js +1 -0
  173. package/static/plugins/textexpander/textexpander.js +46 -0
  174. package/static/plugins/textexpander/textexpander.min.js +1 -0
  175. package/static/plugins/underline/underline.js +27 -0
  176. package/static/plugins/underline/underline.min.js +1 -0
  177. package/static/redactorx.css +1344 -0
  178. package/static/redactorx.js +14254 -0
  179. package/static/redactorx.min.css +1 -0
  180. package/static/redactorx.min.js +1 -0
  181. package/static/redactorx.usm.min.js +2 -0
  182. package/styles/test.sass +3 -0
  183. package/styles/test.scss +5 -0
  184. package/templates/_menu.vue +38 -0
  185. package/templates/comment.vue +202 -0
  186. package/templates/featured.vue +32 -0
  187. package/templates/thumbnail.vue +138 -0
  188. package/templates/unsupported.vue +12 -0
  189. package/utils/app.js +14 -0
  190. package/utils/dom.js +13 -0
  191. package/utils/form.js +34 -0
  192. package/utils/format.js +14 -0
  193. package/utils/hash.js +29 -0
  194. package/utils/helper.js +44 -0
  195. package/utils/history.js +70 -0
  196. package/utils/http.js +209 -0
  197. package/utils/launch.js +135 -0
  198. package/utils/private/ws.js +22 -0
  199. package/utils/public.js +23 -0
  200. package/utils/settings.js +48 -0
  201. package/utils/storage.js +9 -0
  202. package/utils/type.js +69 -0
  203. package/utils/uploader.js +121 -0
  204. 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>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <hr :style="$styles()" :color="spec.color" />
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ props: {
8
+ spec: { type: Object, required: true }
9
+ }
10
+ };
11
+ </script>
12
+
13
+ <style scoped></style>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div v-html="spec.text"></div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ props: {
8
+ spec: { type: Object, required: true }
9
+ }
10
+ };
11
+ </script>
12
+
13
+ <style scoped></style>