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,61 @@
1
+ <template>
2
+ <div :style="$styles()" :class="classes()">
3
+ <!-- See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for why we need to use `pattern` -->
4
+ <v-text-field
5
+ v-model="fieldModel"
6
+ :name="fieldName"
7
+ :label="spec.label"
8
+ :value="spec.value"
9
+ :hint="spec.hint"
10
+ :type="type"
11
+ :readonly="spec.readOnly || false"
12
+ :disabled="spec.readOnly"
13
+ :min="spec.min"
14
+ :max="spec.max"
15
+ :pattern="pattern"
16
+ :outlined="$classes().includes('outlined')"
17
+ :style="$styles()"
18
+ clearable
19
+ />
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ props: {
26
+ spec: { type: Object, required: true },
27
+ type: { type: String, required: true },
28
+ pattern: { type: String, required: true }
29
+ },
30
+ methods: {
31
+ $internalizeValue(val) {
32
+ if (Utils.type.isString(val)) {
33
+ return new Date(val).getTime() / 1000;
34
+ }
35
+ return null;
36
+ },
37
+ $externalizeValue(val) {
38
+ if (Utils.type.isNumber(val)) {
39
+ const date = new Date(val * 1000);
40
+ return Utils.format.local_iso8601(date);
41
+ }
42
+ return null;
43
+ },
44
+ $sanitizeValue(val) {
45
+ switch (this.type) {
46
+ case "date":
47
+ return val.slice(0, 10);
48
+ case "datetime-local":
49
+ return val.slice(0, 16);
50
+ default:
51
+ return val;
52
+ }
53
+ },
54
+ classes() {
55
+ return this.$classes().concat("g-text-field--hintless");
56
+ }
57
+ }
58
+ };
59
+ </script>
60
+
61
+ <style scoped></style>
@@ -0,0 +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>
@@ -0,0 +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>
@@ -0,0 +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>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div ref="checkGroup" data-component="checkGroup" :name="spec.name">
3
+ <fields-hidden :spec="uncheckSpec" v-if="!anyChecked" />
4
+
5
+ <div v-for="(item, index) in spec.childViews" :key="index">
6
+ <ui-component :spec="item" />
7
+ </div>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ import HiddenField from './hidden'
13
+
14
+ export default {
15
+ props: ['spec'],
16
+ data() {
17
+ return {
18
+ anyChecked: false
19
+ }
20
+ },
21
+ components: {
22
+ 'fields-hidden': HiddenField,
23
+ },
24
+ computed: {
25
+ uncheckSpec() {
26
+ // const cloneSpec = Object.assign({}, this.spec)
27
+ // return Object.assign(cloneSpec, { value: 0 })
28
+ return { name: this.spec.name, value: this.spec.uncheckValue }
29
+ },
30
+ },
31
+ methods: {
32
+ detectChecked() {
33
+ this.anyChecked = false
34
+ const vm = this
35
+ this.$el.querySelectorAll('input[type=checkbox]').forEach(function(checkbox) {
36
+ if (checkbox.checked) {
37
+ vm.anyChecked = true
38
+ }
39
+ })
40
+ }
41
+ },
42
+ mounted() {
43
+ this.detectChecked()
44
+ const vm = this
45
+ this.$el.addEventListener('change', function (e) { vm.detectChecked() }, false);
46
+ }
47
+ }
48
+ </script>
49
+
50
+ <style scoped>
51
+ </style>
@@ -0,0 +1,251 @@
1
+ export default [
2
+ "Afghanistan",
3
+ "Albania",
4
+ "Algeria",
5
+ "American Samoa",
6
+ "Andorra",
7
+ "Angola",
8
+ "Anguilla",
9
+ "Antarctica",
10
+ "Antigua and Barbuda",
11
+ "Argentina",
12
+ "Armenia",
13
+ "Aruba",
14
+ "Australia",
15
+ "Austria",
16
+ "Azerbaijan",
17
+ "Bahamas",
18
+ "Bahrain",
19
+ "Bangladesh",
20
+ "Barbados",
21
+ "Belarus",
22
+ "Belgium",
23
+ "Belize",
24
+ "Benin",
25
+ "Bermuda",
26
+ "Bhutan",
27
+ "Bolivia, Plurinational State of",
28
+ "Bonaire, Sint Eustatius and Saba",
29
+ "Bosnia and Herzegovina",
30
+ "Botswana",
31
+ "Bouvet Island",
32
+ "Brazil",
33
+ "British Indian Ocean Territory",
34
+ "Brunei Darussalam",
35
+ "Bulgaria",
36
+ "Burkina Faso",
37
+ "Burundi",
38
+ "Cambodia",
39
+ "Cameroon",
40
+ "Canada",
41
+ "Cape Verde",
42
+ "Cayman Islands",
43
+ "Central African Republic",
44
+ "Chad",
45
+ "Chile",
46
+ "China",
47
+ "Christmas Island",
48
+ "Cocos (Keeling) Islands",
49
+ "Colombia",
50
+ "Comoros",
51
+ "Congo",
52
+ "Congo, The Democratic Republic of the",
53
+ "Cook Islands",
54
+ "Costa Rica",
55
+ "Croatia",
56
+ "Cuba",
57
+ "Curaçao",
58
+ "Cyprus",
59
+ "Czech Republic",
60
+ "Côte d'Ivoire",
61
+ "Denmark",
62
+ "Djibouti",
63
+ "Dominica",
64
+ "Dominican Republic",
65
+ "Ecuador",
66
+ "Egypt",
67
+ "El Salvador",
68
+ "Equatorial Guinea",
69
+ "Eritrea",
70
+ "Estonia",
71
+ "Ethiopia",
72
+ "Falkland Islands (Malvinas)",
73
+ "Faroe Islands",
74
+ "Fiji",
75
+ "Finland",
76
+ "France",
77
+ "French Guiana",
78
+ "French Polynesia",
79
+ "French Southern Territories",
80
+ "Gabon",
81
+ "Gambia",
82
+ "Georgia",
83
+ "Germany",
84
+ "Ghana",
85
+ "Gibraltar",
86
+ "Greece",
87
+ "Greenland",
88
+ "Grenada",
89
+ "Guadeloupe",
90
+ "Guam",
91
+ "Guatemala",
92
+ "Guernsey",
93
+ "Guinea",
94
+ "Guinea-Bissau",
95
+ "Guyana",
96
+ "Haiti",
97
+ "Heard Island and McDonald Islands",
98
+ "Holy See (Vatican City State)",
99
+ "Honduras",
100
+ "Hong Kong",
101
+ "Hungary",
102
+ "Iceland",
103
+ "India",
104
+ "Indonesia",
105
+ "Iran, Islamic Republic of",
106
+ "Iraq",
107
+ "Ireland",
108
+ "Ireland",
109
+ "Isle of Man",
110
+ "Israel",
111
+ "Italy",
112
+ "Jamaica",
113
+ "Japan",
114
+ "Jersey",
115
+ "Jordan",
116
+ "Kazakhstan",
117
+ "Kenya",
118
+ "Kiribati",
119
+ "Korea, Democratic People's Republic of",
120
+ "Korea, Republic of",
121
+ "Kuwait",
122
+ "Kyrgyzstan",
123
+ "Lao People's Democratic Republic",
124
+ "Latvia",
125
+ "Lebanon",
126
+ "Lesotho",
127
+ "Liberia",
128
+ "Libya",
129
+ "Liechtenstein",
130
+ "Lithuania",
131
+ "Luxembourg",
132
+ "Macao",
133
+ "Macedonia, Republic of",
134
+ "Madagascar",
135
+ "Malawi",
136
+ "Malaysia",
137
+ "Maldives",
138
+ "Mali",
139
+ "Malta",
140
+ "Marshall Islands",
141
+ "Martinique",
142
+ "Mauritania",
143
+ "Mauritius",
144
+ "Mayotte",
145
+ "Mexico",
146
+ "Micronesia, Federated States of",
147
+ "Moldova, Republic of",
148
+ "Monaco",
149
+ "Mongolia",
150
+ "Montenegro",
151
+ "Montserrat",
152
+ "Morocco",
153
+ "Mozambique",
154
+ "Myanmar",
155
+ "Namibia",
156
+ "Nauru",
157
+ "Nepal",
158
+ "Netherlands",
159
+ "New Caledonia",
160
+ "New Zealand",
161
+ "Nicaragua",
162
+ "Niger",
163
+ "Nigeria",
164
+ "Niue",
165
+ "Norfolk Island",
166
+ "Northern Mariana Islands",
167
+ "Norway",
168
+ "Oman",
169
+ "Pakistan",
170
+ "Palau",
171
+ "Palestinian Territory, Occupied",
172
+ "Panama",
173
+ "Papua New Guinea",
174
+ "Paraguay",
175
+ "Peru",
176
+ "Philippines",
177
+ "Pitcairn",
178
+ "Poland",
179
+ "Portugal",
180
+ "Qatar",
181
+ "Romania",
182
+ "Russian Federation",
183
+ "Rwanda",
184
+ "Réunion",
185
+ "Saint Barthélemy",
186
+ "Saint Helena, Ascension and Tristan da Cunha",
187
+ "Saint Kitts and Nevis",
188
+ "Saint Lucia",
189
+ "Saint Martin (French part)",
190
+ "Saint Pierre and Miquelon",
191
+ "Saint Vincent and the Grenadines",
192
+ "Samoa",
193
+ "San Marino",
194
+ "Sao Tome and Principe",
195
+ "Saudi Arabia",
196
+ "Senegal",
197
+ "Serbia",
198
+ "Seychelles",
199
+ "Sierra Leone",
200
+ "Singapore",
201
+ "Sint Maarten (Dutch part)",
202
+ "Slovakia",
203
+ "Slovenia",
204
+ "Solomon Islands",
205
+ "Somalia",
206
+ "South Africa",
207
+ "South Georgia and the South Sandwich Islands",
208
+ "South Sudan",
209
+ "Spain",
210
+ "Sri Lanka",
211
+ "Sudan",
212
+ "Suriname",
213
+ "Svalbard and Jan Mayen",
214
+ "Swaziland",
215
+ "Sweden",
216
+ "Switzerland",
217
+ "Syrian Arab Republic",
218
+ "Taiwan",
219
+ "Tajikistan",
220
+ "Tanzania, United Republic of",
221
+ "Thailand",
222
+ "Timor-Leste",
223
+ "Togo",
224
+ "Tokelau",
225
+ "Tonga",
226
+ "Trinidad and Tobago",
227
+ "Tunisia",
228
+ "Turkey",
229
+ "Turkmenistan",
230
+ "Turks and Caicos Islands",
231
+ "Tuvalu",
232
+ "Uganda",
233
+ "Ukraine",
234
+ "United Arab Emirates",
235
+ "United Kingdom",
236
+ "United States",
237
+ "United States Minor Outlying Islands",
238
+ "Uruguay",
239
+ "Uzbekistan",
240
+ "Vanuatu",
241
+ "Venezuela, Bolivarian Republic of",
242
+ "Viet Nam",
243
+ "Virgin Islands, British",
244
+ "Virgin Islands, U.S.",
245
+ "Wallis and Futuna",
246
+ "Western Sahara",
247
+ "Yemen",
248
+ "Zambia",
249
+ "Zimbabwe",
250
+ "Åland Islands"
251
+ ]
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <div :style="genericStyles()" :class="classes()">
3
+ <!-- <v-select
4
+ clearable
5
+ :autocomplete="true"
6
+ :label="spec.label"
7
+ :name="spec.name"
8
+ :value="spec.value"
9
+ :items="countryOptions"
10
+ v-model="country"
11
+ />
12
+
13
+ <v-select v-if="regionField && regionOptions"
14
+ clearable
15
+ :autocomplete="true"
16
+ :label="regionField.label"
17
+ :items="regionOptions"
18
+ :name="regionField.name"
19
+ :value="regionField.value"
20
+ />-->
21
+
22
+ <v-autocomplete
23
+ v-model="country"
24
+ :label="spec.label"
25
+ :name="spec.name"
26
+ :items="countryOptions"
27
+ :readonly="spec.readOnly"
28
+ :disabled="spec.readOnly"
29
+ :clearable="!spec.readOnly"
30
+ :hint="spec.hint"
31
+ persistent-hint
32
+ :outlined="$classes().includes('outlined')"
33
+ />
34
+
35
+ <v-autocomplete
36
+ v-if="regionField && regionOptions"
37
+ :label="regionField.label"
38
+ :name="regionField.name"
39
+ :value="regionField.value"
40
+ :items="regionOptions"
41
+ :readonly="regionField.readOnly"
42
+ :disabled="regionField.readOnly"
43
+ :clearable="!regionField.readOnly"
44
+ :hint="regionField.hint"
45
+ persistent-hint
46
+ :outlined="$classes().includes('outlined')"
47
+ />
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+ import countries from "./countries";
53
+ import regions from "./regions";
54
+
55
+ export default {
56
+ props: {
57
+ spec: { type: Object, required: true }
58
+ },
59
+ data() {
60
+ return {
61
+ countryOptions: countries,
62
+ country: this.spec.value
63
+ };
64
+ },
65
+ computed: {
66
+ regionField: function() {
67
+ return this.spec.region;
68
+ },
69
+ regionOptions: function() {
70
+ return regions[this.country];
71
+ }
72
+ },
73
+ methods: {
74
+ classes() {
75
+ return this.$classes().concat("g-text-field--hintless");
76
+ }
77
+ }
78
+ };
79
+ </script>
80
+
81
+ <style scoped></style>