glib-web 2.4.1 → 3.0.0-beta1

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 (100) hide show
  1. package/LICENSE +0 -0
  2. package/action.js +6 -1
  3. package/actions/auth/restart.js +0 -0
  4. package/actions/commands/enqueue.js +17 -0
  5. package/actions/components/update.js +13 -14
  6. package/actions/dialogs/oauth.js +0 -0
  7. package/actions/dialogs/options.js +0 -0
  8. package/app.vue +25 -26
  9. package/components/_button.vue +21 -28
  10. package/components/_chip.vue +14 -19
  11. package/components/_dropdownMenu.vue +10 -23
  12. package/components/_icon.vue +5 -5
  13. package/components/_message.vue +0 -0
  14. package/components/_responsive.vue +7 -21
  15. package/components/avatar.vue +11 -15
  16. package/components/banners/alert.vue +2 -7
  17. package/components/banners/select.vue +18 -30
  18. package/components/button.vue +5 -5
  19. package/components/component.vue +97 -100
  20. package/components/datetime.vue +0 -0
  21. package/components/fab.vue +0 -0
  22. package/components/fields/_patternText.vue +5 -19
  23. package/components/fields/_select.vue +7 -28
  24. package/components/fields/autocomplete.vue +5 -21
  25. package/components/fields/check.vue +19 -11
  26. package/components/fields/country/countries.js +0 -0
  27. package/components/fields/country/field.vue +9 -27
  28. package/components/fields/country/regions.js +0 -0
  29. package/components/fields/date.vue +5 -5
  30. package/components/fields/datetime.vue +5 -5
  31. package/components/fields/dynamicSelect.vue +8 -29
  32. package/components/fields/newRichText.vue +66 -53
  33. package/components/fields/otpField.vue +90 -0
  34. package/components/fields/phone/field.vue +60 -78
  35. package/components/fields/radio.vue +16 -23
  36. package/components/fields/rating.vue +9 -16
  37. package/components/fields/richText.vue +8 -28
  38. package/components/fields/select.vue +10 -7
  39. package/components/fields/stripeExternalAccount.vue +10 -24
  40. package/components/fields/text.vue +24 -40
  41. package/components/fields/textarea.vue +13 -27
  42. package/components/fields/timeZone.vue +9 -6
  43. package/components/fields/timer.vue +3 -10
  44. package/components/hr.vue +0 -0
  45. package/components/html.vue +0 -0
  46. package/components/image.vue +13 -20
  47. package/components/map.vue +115 -29
  48. package/components/markdown.vue +15 -8
  49. package/components/mixins/events.js +17 -6
  50. package/components/mixins/longClick.js +0 -0
  51. package/components/mixins/scrolling.js +0 -0
  52. package/components/mixins/styles.js +18 -15
  53. package/components/mixins/table/export.js +0 -0
  54. package/components/mixins/table/import.js +0 -0
  55. package/components/p.vue +0 -0
  56. package/components/panels/column.vue +5 -5
  57. package/components/panels/custom.vue +15 -15
  58. package/components/panels/flow.vue +19 -13
  59. package/components/panels/form.vue +17 -28
  60. package/components/panels/grid.vue +15 -9
  61. package/components/panels/horizontal.vue +149 -18
  62. package/components/panels/list.vue +63 -70
  63. package/components/panels/responsive.vue +13 -33
  64. package/components/panels/split.vue +2 -2
  65. package/components/panels/table.vue +27 -61
  66. package/components/panels/timeline.vue +20 -30
  67. package/components/panels/vertical.vue +9 -14
  68. package/components/tabBar.vue +27 -19
  69. package/index.js +68 -72
  70. package/keys.js +0 -0
  71. package/nav/appbar.vue +4 -4
  72. package/nav/dialog.vue +24 -34
  73. package/nav/drawer.vue +39 -51
  74. package/nav/drawerButton.vue +5 -7
  75. package/nav/drawerLabel.vue +2 -3
  76. package/nav/sheet.vue +18 -24
  77. package/nav/snackbar.vue +16 -26
  78. package/package.json +10 -11
  79. package/plugins/driverCustomBehavior.js +1 -1
  80. package/plugins/updatableComponent.js +1 -7
  81. package/plugins/vuetify.js +27 -0
  82. package/settings.json.example +0 -0
  83. package/styles/test.sass +0 -0
  84. package/styles/test.scss +0 -0
  85. package/templates/comment.vue +42 -19
  86. package/templates/featured.vue +8 -9
  87. package/templates/thumbnail-old.vue +188 -0
  88. package/templates/thumbnail.vue +5 -188
  89. package/templates/unsupported.vue +0 -0
  90. package/tsconfig.json +1 -1
  91. package/utils/dom.js +0 -0
  92. package/utils/eventBus.js +9 -2
  93. package/utils/history.js +7 -4
  94. package/utils/http.js +7 -2
  95. package/utils/launch.js +43 -51
  96. package/utils/public.js +6 -0
  97. package/utils/queue.js +110 -0
  98. package/utils/settings.js +3 -1
  99. package/utils/storage.js +0 -0
  100. package/utils/url.js +0 -0
@@ -1,26 +1,19 @@
1
1
  <template>
2
2
  <div>
3
- <v-rating
4
- v-model="fieldModel"
5
- :name="fieldName"
6
- :value="spec.value"
7
- empty-icon="star_outline"
8
- full-icon="star"
9
- half-icon="star_half"
10
- :half-increments="spec.halfIncrements"
11
- hover
12
- length="5"
13
- :readonly="spec.readOnly"
14
- :color="spec.color"
15
- :background-color="spec.color"
16
- :size="spec.size"
17
- ></v-rating>
3
+ <v-rating v-model="fieldModel" :name="fieldName" empty-icon="star_outline" full-icon="star" half-icon="star_half"
4
+ :half-increments="spec.halfIncrements" hover length="5" :readonly="spec.readOnly" :color="spec.color"
5
+ :bg-color="spec.color" :size="spec.size"></v-rating>
18
6
  <input type="hidden" :name="fieldName" :value="fieldModel" />
19
7
  </div>
20
8
  </template>
21
9
 
22
10
  <script>
23
11
  export default {
24
- props: { spec: { type: Object, required: true } }
12
+ props: { spec: { type: Object, required: true } },
13
+ methos: {
14
+ $ready() {
15
+ this.fieldModel = this.spec.value;
16
+ },
17
+ },
25
18
  };
26
19
  </script>
@@ -8,36 +8,16 @@
8
8
  <v-progress-linear v-if="showProgress" v-model="progress.value" />
9
9
 
10
10
  <!-- Remove the editor to avoid circular updating between this editor and the raw field. -->
11
- <VueEditor
12
- v-if="!rawMode"
13
- id="rich-editor"
14
- v-model="richEditorValue"
15
- :editor-toolbar="customToolbar"
16
- use-custom-image-handler
17
- @text-change="onRichTextEditorChanged"
18
- @image-added="uploadImage"
19
- :editorOptions="editorSettings"
20
- />
11
+ <VueEditor v-if="!rawMode" id="rich-editor" v-model="richEditorValue" :editor-toolbar="customToolbar"
12
+ use-custom-image-handler @text-change="onRichTextEditorChanged" @image-added="uploadImage"
13
+ :editorOptions="editorSettings" />
21
14
  <!-- Hide these fields but don't remove them because these are the values that will get submitted. -->
22
15
  <div :style="{ display: rawMode ? 'block' : 'none' }">
23
- <v-textarea
24
- id="raw-editor"
25
- v-model="rawEditorValue"
26
- :style="$styles()"
27
- :class="$classes()"
28
- :outlined="$classes().includes('outlined')"
29
- @input="onRawTextEditorChanged"
30
- ></v-textarea>
31
- <v-text-field
32
- v-for="(imageKey, index) in imageKeys"
33
- :key="index"
34
- :label="`Image ${index + 1}`"
35
- :style="$styles()"
36
- :outlined="$classes().includes('outlined')"
37
- type="text"
38
- :name="imageUploader.name"
39
- :value="images[imageKey]"
40
- />
16
+ <v-textarea id="raw-editor" v-model="rawEditorValue" :style="$styles()" :class="$classes()"
17
+ :outlined="$classes().includes('outlined') || null" @input="onRawTextEditorChanged"></v-textarea>
18
+ <v-text-field v-for="(imageKey, index) in imageKeys" :key="index" :label="`Image ${index + 1}`" :style="$styles()"
19
+ :outlined="$classes().includes('outlined') || null" type="text" :name="imageUploader.name"
20
+ :value="images[imageKey]" />
41
21
  </div>
42
22
  <input type="hidden" :name="spec.name" :value="producedValue" />
43
23
  </div>
@@ -1,21 +1,24 @@
1
1
  <template>
2
- <fields-genericSelect ref="delegate" :spec="updatedSpec" />
2
+ <fields-genericSelect
3
+ ref="delegate"
4
+ :spec="updatedSpec"
5
+ />
3
6
  </template>
4
7
 
5
8
  <script>
6
- import SelectField from "./_select";
9
+ import SelectField from "./_select.vue";
7
10
 
8
11
  export default {
9
12
  components: {
10
13
  // Need to start with `fields-` to enable jsonlogic in `styles.js#_linkFieldModels`
11
- "fields-genericSelect": SelectField
14
+ "fields-genericSelect": SelectField,
12
15
  },
13
16
  props: {
14
- spec: { type: Object, required: true }
17
+ spec: { type: Object, required: true },
15
18
  },
16
19
  data() {
17
20
  return {
18
- updatedSpec: this.spec
21
+ updatedSpec: this.spec,
19
22
  };
20
23
  },
21
24
  methods: {
@@ -25,7 +28,7 @@ export default {
25
28
  action_merge(mergedSpec) {
26
29
  Object.assign(this.updatedSpec, mergedSpec);
27
30
  this.$refs.delegate.updateData(true);
28
- }
29
- }
31
+ },
32
+ },
30
33
  };
31
34
  </script>
@@ -1,29 +1,15 @@
1
1
  <template>
2
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
- />
3
+ <v-text-field v-model="accountNumber" label="Account Number" placeholder="000123456"
4
+ :outlined="$classes().includes('outlined') || null" :rounded="$classes().includes('rounded')"
5
+ :dense="$classes().includes('dense') || null" :rules="accountNumberRules" :error-messages="errorMessages"
6
+ @keyup="$onTyping({ duration: 200 })" />
14
7
 
15
8
  <div v-if="spec.country">
16
9
  <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
- />
10
+ <v-text-field v-model="field.model" :label="field.label" :placeholder="field.placeholder"
11
+ :outlined="$classes().includes('outlined') || null" :rounded="$classes().includes('rounded')"
12
+ :dense="$classes().includes('dense') || null" :rules="field.rules" @keyup="$onTyping({ duration: 200 })" />
27
13
  </div>
28
14
  </div>
29
15
 
@@ -48,7 +34,7 @@ export default {
48
34
  this.country = this.spec.country.toLowerCase();
49
35
  this.stripe = Stripe(this.spec.publicKey);
50
36
  this.spec.onTypeEnd = { action: "component/createToken" };
51
- this.registerCountry("nz", [], function() {
37
+ this.registerCountry("nz", [], function () {
52
38
  return "";
53
39
  });
54
40
  this.registerCountry(
@@ -61,7 +47,7 @@ export default {
61
47
  rules: [value => !!value || "Bank state number required"]
62
48
  }
63
49
  ],
64
- function() {
50
+ function () {
65
51
  return this.fields[0].model;
66
52
  }
67
53
  );
@@ -81,7 +67,7 @@ export default {
81
67
  rules: [value => !!value || "Institution number required"]
82
68
  }
83
69
  ],
84
- function() {
70
+ function () {
85
71
  return `${this.fields[0].model}-${this.fields[1].model}`;
86
72
  }
87
73
  );
@@ -1,36 +1,11 @@
1
1
  <template>
2
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
- @input="onChange"
27
- />
28
- <input
29
- v-if="spec.readOnly"
30
- type="hidden"
31
- :name="fieldName"
32
- :value="fieldModel"
33
- />
3
+ <v-text-field v-model="fieldModel" :label="spec.label" :name="fieldName" :hint="spec.hint"
4
+ :placeholder="spec.placeholder" :maxlength="spec.maxLength || 255" :disabled="spec.readOnly" :type="variant.type"
5
+ :rules="rules" :prepend-inner-icon="leftIconName" :append-icon="variant.appendIcon" :prefix="spec.leftText"
6
+ :suffix="spec.rightText" :min="spec.min" :max="spec.max" :outlined="$classes().includes('outlined') || null"
7
+ :autofocus="spec.autoFocus || false" validate-on-blur @click:append="onRightIconClick" @input="onChange" />
8
+ <input v-if="spec.readOnly" type="hidden" :name="fieldName" :model-value="fieldModel" />
34
9
  </div>
35
10
  </template>
36
11
 
@@ -46,11 +21,12 @@ export default {
46
21
  return {
47
22
  variant: {},
48
23
  rules: [],
24
+ onRightIconClick: null,
49
25
  fields: {
50
26
  email: {
51
27
  type: "email",
52
28
  prependIcon: "email",
53
- onRightIconClick: function() {},
29
+ onRightIconClick: function () { },
54
30
  rules: [
55
31
  v =>
56
32
  !v ||
@@ -61,14 +37,14 @@ export default {
61
37
  number: {
62
38
  type: "number",
63
39
  prependIcon: "looks_one",
64
- onRightIconClick: function() {},
40
+ onRightIconClick: function () { },
65
41
  rules: [v => !v || /^\-?[.\d]*$/.test(v) || "Must be a number"]
66
42
  },
67
43
  password: {
68
44
  type: "password",
69
45
  prependIcon: "lock",
70
46
  appendIcon: "visibility",
71
- onRightIconClick: function(vm) {
47
+ onRightIconClick: function (vm) {
72
48
  vm.togglePasswordVisibility();
73
49
  },
74
50
  rules: [v => !v || v.length >= 6 || "Password must be longer"]
@@ -76,7 +52,7 @@ export default {
76
52
  url: {
77
53
  type: "url",
78
54
  prependIcon: "web",
79
- onRightIconClick: function() {},
55
+ onRightIconClick: function () { },
80
56
  rules: [
81
57
  // From https://gist.github.com/rodneyrehm/8013067
82
58
  // 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/
@@ -91,7 +67,7 @@ export default {
91
67
  search: {
92
68
  type: "url",
93
69
  prependIcon: "search",
94
- onRightIconClick: function() {},
70
+ onRightIconClick: function () { },
95
71
  rules: [
96
72
  v => !v || /^\w+:\/\/[.-\w]+$/.test(v) || "Must be a valid URL"
97
73
  ]
@@ -104,12 +80,23 @@ export default {
104
80
  const icon = this.spec.leftIcon || {};
105
81
  const materialIcon = icon.material || {};
106
82
  return materialIcon.name;
83
+ },
84
+ rightIconName() {
85
+ const icon = this.spec.rightIcon || {};
86
+ const materialIcon = icon.material || {};
87
+ return materialIcon.name;
107
88
  }
108
89
  },
109
90
  methods: {
110
91
  $ready() {
111
92
  this.variant = this.fields[this.type] || {};
112
93
  this.rules = this.$validation(this.variant.rules);
94
+
95
+ if (this.variant.onRightIconClick) {
96
+ this.onRightIconClick = () => {
97
+ this.variant.onRightIconClick(this);
98
+ };
99
+ }
113
100
  },
114
101
  togglePasswordVisibility() {
115
102
  const passwordField = this.fields["password"];
@@ -121,13 +108,10 @@ export default {
121
108
  passwordField.appendIcon = "visibility";
122
109
  }
123
110
  },
124
- onRightIconClick() {
125
- this.variant.onRightIconClick(this);
126
- },
127
111
  classes() {
128
112
  return this.$classes().concat("g-text-field--hintless");
129
113
  },
130
- onChange: eventFiltering.debounce(function() {
114
+ onChange: eventFiltering.debounce(function () {
131
115
  this.executeActionWithParams();
132
116
  }, 300),
133
117
  executeActionWithParams() {
@@ -1,43 +1,28 @@
1
1
  <template>
2
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
- :no-resize="$classes().includes('no-resize')"
17
- validate-on-blur
18
- @keyup="$onTyping"
19
- ></v-textarea>
20
- <input
21
- v-if="spec.readOnly"
22
- type="hidden"
23
- :name="fieldName"
24
- :value="spec.value"
25
- />
3
+ <v-textarea v-model="fieldModel" :label="spec.label" :name="fieldName" :hint="spec.hint"
4
+ :placeholder="spec.placeholder" :maxlength="spec.maxLength || 255" :disabled="spec.readOnly" :height="height"
5
+ :rules="$validation()" counter :outlined="$classes().includes('outlined') || null"
6
+ :no-resize="$classes().includes('no-resize')" validate-on-blur @keyup="$onTyping"></v-textarea>
7
+ <input v-if="spec.readOnly" type="hidden" :name="fieldName" :value="spec.value" />
26
8
  </div>
27
9
  </template>
28
10
 
29
11
  <script>
30
12
  export default {
31
13
  props: {
32
- spec: { type: Object, required: true }
14
+ spec: { type: Object, required: true },
33
15
  },
34
16
  data() {
35
17
  return {
36
18
  // styles: null,
37
- height: null
19
+ height: null,
38
20
  };
39
21
  },
40
22
  methods: {
23
+ $ready() {
24
+ this.fieldModel = this.spec.value;
25
+ },
41
26
  styles() {
42
27
  const styles = this.$styles();
43
28
  this.height = styles.remove("height");
@@ -45,8 +30,8 @@ export default {
45
30
  },
46
31
  classes() {
47
32
  return this.$classes().concat("g-text-field--hintless");
48
- }
49
- }
33
+ },
34
+ },
50
35
  };
51
36
  </script>
52
37
 
@@ -54,6 +39,7 @@ export default {
54
39
  .v-text-field__details {
55
40
  margin-top: 2px;
56
41
  }
42
+
57
43
  .text-bold {
58
44
  font-weight: bold;
59
45
  }
@@ -1,22 +1,25 @@
1
1
  <template>
2
- <fields-genericSelect :spec="spec" :default-value="defaultValue" />
2
+ <fields-genericSelect
3
+ :spec="spec"
4
+ :default-value="defaultValue"
5
+ />
3
6
  </template>
4
7
 
5
8
  <script>
6
- import SelectField from "./_select";
9
+ import SelectField from "./_select.vue";
7
10
 
8
11
  export default {
9
12
  components: {
10
13
  // Need to start with `fields-` to enable jsonlogic in `styles.js#_linkFieldModels`
11
- "fields-genericSelect": SelectField
14
+ "fields-genericSelect": SelectField,
12
15
  },
13
16
  props: {
14
- spec: { type: Object, required: true }
17
+ spec: { type: Object, required: true },
15
18
  },
16
19
  computed: {
17
20
  defaultValue() {
18
21
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
19
- }
20
- }
22
+ },
23
+ },
21
24
  };
22
25
  </script>
@@ -22,16 +22,9 @@
22
22
  </v-row>
23
23
  </div>
24
24
  </div>
25
- <v-text-field
26
- v-else
27
- v-model="fieldModel"
28
- :label="spec.label"
29
- :name="fieldName"
30
- :disabled="true"
31
- :outlined="$classes().includes('outlined')"
32
- :rounded="$classes().includes('rounded')"
33
- :dense="$classes().includes('dense')"
34
- />
25
+ <v-text-field v-else v-model="fieldModel" :label="spec.label" :name="fieldName" :disabled="true"
26
+ :outlined="$classes().includes('outlined') || null" :rounded="$classes().includes('rounded')"
27
+ :dense="$classes().includes('dense') || null" />
35
28
  <input type="hidden" :name="fieldName" :value="fieldModel" />
36
29
  </div>
37
30
  </template>
package/components/hr.vue CHANGED
File without changes
File without changes
@@ -1,23 +1,18 @@
1
1
  <template>
2
- <common-tooltip :spec="spec">
3
- <template v-slot:activator="{ on }">
4
- <common-badge :spec="spec">
5
- <!-- TODO: Add support for href and :rel="$rel()" -->
6
- <v-img
7
- :src="spec.url || spec.base64Data"
8
- :style="styles"
9
- @click="$onClick()"
10
- v-on="on"
11
- >
12
- <!-- <v-progress-circular v-if="$isBusy" indeterminate /> -->
13
- </v-img>
14
- </common-badge>
15
- </template>
16
- </common-tooltip>
2
+ <!-- <common-tooltip :spec="spec"> -->
3
+ <!-- <template v-slot:activator="{ on }"> -->
4
+ <!-- <common-badge :spec="spec"> -->
5
+ <!-- TODO: Add support for href and :rel="$rel()" -->
6
+ <v-img :src="spec.url || spec.base64Data" :width="spec.width" :max-height="spec.height" :style="styles"
7
+ :aspect-ratio="spec.aspectRatio" @click="$onClick()" cover>
8
+ <!-- <v-progress-circular v-if="$isBusy" indeterminate /> -->
9
+ </v-img>
10
+ <!-- </common-badge> -->
11
+ <!-- </template> -->
12
+ <!-- </common-tooltip> -->
17
13
  </template>
18
14
 
19
15
  <script>
20
- import Vue from "vue";
21
16
  // import TooltipMixins from "./mixins/tooltip";
22
17
 
23
18
  export default {
@@ -71,8 +66,7 @@ export default {
71
66
  }
72
67
  }
73
68
 
74
- Vue.set(this.styles, "width", width);
75
- Vue.set(this.styles, "height", height);
69
+ Object.assign(this.styles, { width, height });
76
70
  },
77
71
  fitCrop(image) {
78
72
  let width, height;
@@ -85,8 +79,7 @@ export default {
85
79
  height = `${this.spec.height}px`;
86
80
  }
87
81
 
88
- Vue.set(this.styles, "width", width);
89
- Vue.set(this.styles, "height", height);
82
+ Object.assign(this.styles, { width, height });
90
83
  }
91
84
  }
92
85
  };