glib-web 2.6.7 → 3.0.0

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 (110) hide show
  1. package/action.js +39 -17
  2. package/actions/analytics/logEvent.js +2 -2
  3. package/actions/auth/saveCsrfToken.js +6 -0
  4. package/actions/cables/push.js +4 -4
  5. package/actions/commands/enqueue.js +17 -0
  6. package/actions/fields/reset.js +2 -2
  7. package/actions/http/get.js +15 -27
  8. package/actions/panels/scrollTo.js +1 -1
  9. package/actions/panels/scrollToBottom.js +1 -1
  10. package/actions/popovers/close.js +5 -0
  11. package/actions/popovers/open.js +9 -0
  12. package/actions/windows/closeWithReload.js +1 -1
  13. package/actions/windows/refreshState.js +3 -1
  14. package/actions/ws/push.js +5 -3
  15. package/app.vue +59 -27
  16. package/components/_badge.vue +1 -6
  17. package/components/_button.vue +30 -30
  18. package/components/_chip.vue +27 -29
  19. package/components/_dropdownMenu.vue +10 -23
  20. package/components/_icon.vue +5 -5
  21. package/components/_responsive.vue +7 -21
  22. package/components/avatar.vue +11 -15
  23. package/components/banners/alert.vue +2 -7
  24. package/components/banners/select.vue +18 -30
  25. package/components/button.vue +4 -5
  26. package/components/component.vue +112 -133
  27. package/components/datetime.vue +2 -0
  28. package/components/fields/_patternText.vue +8 -19
  29. package/components/fields/_select.vue +9 -27
  30. package/components/fields/autocomplete.vue +8 -21
  31. package/components/fields/check.vue +5 -12
  32. package/components/fields/checkGroup.vue +3 -13
  33. package/components/fields/country/field.vue +9 -27
  34. package/components/fields/date.vue +5 -5
  35. package/components/fields/datetime.vue +6 -11
  36. package/components/fields/dynamicSelect.vue +8 -29
  37. package/components/fields/file.vue +10 -29
  38. package/components/fields/newRichText.vue +67 -54
  39. package/components/fields/otpField.vue +11 -31
  40. package/components/fields/phone/field.vue +60 -78
  41. package/components/fields/radio.vue +8 -44
  42. package/components/fields/radioGroup.vue +17 -19
  43. package/components/fields/rating.vue +9 -16
  44. package/components/fields/richText.vue +27 -45
  45. package/components/fields/select.vue +10 -7
  46. package/components/fields/stripe/stripeFields.vue +9 -2
  47. package/components/fields/stripe/stripeIndividualFields.vue +9 -7
  48. package/components/fields/stripeExternalAccount.vue +10 -24
  49. package/components/fields/text.vue +26 -50
  50. package/components/fields/textarea.vue +14 -27
  51. package/components/fields/timeZone.vue +9 -6
  52. package/components/fields/timer.vue +5 -11
  53. package/components/image.vue +12 -23
  54. package/components/label.vue +10 -18
  55. package/components/markdown.vue +45 -23
  56. package/components/mixins/events.js +24 -25
  57. package/components/mixins/generic.js +7 -4
  58. package/components/mixins/inputVariant.js +16 -0
  59. package/components/mixins/list/autoload.js +7 -5
  60. package/components/mixins/styles.js +16 -16
  61. package/components/mixins/table/autoload.js +6 -4
  62. package/components/mixins/ws/actionCable.js +6 -5
  63. package/components/mixins/ws/phoenixSocket.js +11 -9
  64. package/components/p.vue +10 -0
  65. package/components/panels/column.vue +8 -19
  66. package/components/panels/custom.vue +9 -13
  67. package/components/panels/flow.vue +19 -13
  68. package/components/panels/form.vue +26 -34
  69. package/components/panels/grid.vue +15 -9
  70. package/components/panels/horizontal.vue +58 -54
  71. package/components/panels/list.vue +37 -72
  72. package/components/panels/responsive.vue +2 -33
  73. package/components/panels/scroll.vue +3 -0
  74. package/components/panels/split.vue +2 -2
  75. package/components/panels/table.vue +32 -63
  76. package/components/panels/timeline.vue +20 -30
  77. package/components/panels/vertical.vue +8 -13
  78. package/components/popover.vue +39 -0
  79. package/components/progressCircle.vue +2 -8
  80. package/components/progressbar.vue +4 -14
  81. package/components/shareButton.vue +24 -30
  82. package/components/tabBar.vue +29 -28
  83. package/index.js +60 -94
  84. package/nav/appbar.vue +8 -6
  85. package/nav/dialog.vue +30 -49
  86. package/nav/drawer.vue +39 -51
  87. package/nav/drawerButton.vue +5 -7
  88. package/nav/drawerLabel.vue +2 -3
  89. package/nav/sheet.vue +21 -22
  90. package/nav/snackbar.vue +19 -30
  91. package/package.json +13 -16
  92. package/plugins/driverCustomBehavior.js +1 -1
  93. package/plugins/updatableComponent.js +2 -2
  94. package/plugins/vuetify.js +26 -0
  95. package/store.js +16 -0
  96. package/templates/comment.vue +42 -19
  97. package/templates/featured.vue +8 -9
  98. package/templates/thumbnail-old.vue +188 -0
  99. package/templates/thumbnail.vue +3 -208
  100. package/tsconfig.json +1 -1
  101. package/utils/component.js +18 -18
  102. package/utils/constant.js +4 -0
  103. package/utils/eventBus.js +9 -2
  104. package/utils/history.js +12 -8
  105. package/utils/http.js +29 -71
  106. package/utils/launch.js +89 -52
  107. package/utils/private/ws.js +5 -3
  108. package/utils/public.js +6 -0
  109. package/utils/queue.js +102 -0
  110. package/utils/settings.js +3 -9
@@ -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>
@@ -7,6 +7,9 @@
7
7
  </template>
8
8
 
9
9
  <script>
10
+
11
+ import { vueApp } from '../../../store';
12
+
10
13
  export default {
11
14
  props: {
12
15
  spec: { type: Object, required: true },
@@ -22,11 +25,12 @@ export default {
22
25
  data() {
23
26
  return {
24
27
  stripe: null,
25
- card: null
28
+ card: null,
29
+ vueApp
26
30
  };
27
31
  },
28
32
  watch: {
29
- "$root.vueApp.stateUpdatedAt": function(val, oldVal) {
33
+ "vueApp.stateUpdatedAt": function (val, oldVal) {
30
34
  this.onComplete(this.stripe, this.card);
31
35
  }
32
36
  },
@@ -77,14 +81,17 @@ export default {
77
81
  -webkit-transition: box-shadow 150ms ease;
78
82
  transition: box-shadow 150ms ease;
79
83
  }
84
+
80
85
  .StripeElement:hover {
81
86
  border-color: #000000;
82
87
  cursor: text;
83
88
  }
89
+
84
90
  .StripeElement--focus {
85
91
  border-color: #1976d2;
86
92
  border-width: 2px;
87
93
  }
94
+
88
95
  .StripeElement--invalid {
89
96
  border-color: #f44336;
90
97
  border-width: 2px;
@@ -31,6 +31,7 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
+ import { vueApp } from '../../../store';
34
35
  export default {
35
36
  props: {
36
37
  spec: { type: Object, required: true },
@@ -47,11 +48,12 @@ export default {
47
48
  return {
48
49
  stripe: null,
49
50
  card: null,
50
- errorMessages: []
51
+ errorMessages: [],
52
+ vueApp
51
53
  };
52
54
  },
53
55
  watch: {
54
- "$root.vueApp.stateUpdatedAt": function(val, oldVal) {
56
+ "vueApp.stateUpdatedAt": function (val, oldVal) {
55
57
  this.onComplete(this.stripe, this.card);
56
58
  }
57
59
  },
@@ -144,24 +146,24 @@ export default {
144
146
  width: 100%;
145
147
  }
146
148
 
147
- .input.StripeElement--focus + label {
149
+ .input.StripeElement--focus+label {
148
150
  color: #1976d2 !important;
149
151
  }
150
152
 
151
- .input.StripeElement--invalid + label {
153
+ .input.StripeElement--invalid+label {
152
154
  color: #f44336 !important;
153
155
  }
154
156
 
155
- .input:hover + label + .baseline {
157
+ .input:hover+label+.baseline {
156
158
  border-color: #000000;
157
159
  }
158
160
 
159
- .input.StripeElement--focus + label + .baseline {
161
+ .input.StripeElement--focus+label+.baseline {
160
162
  border-color: #1976d2;
161
163
  border-width: 2px;
162
164
  }
163
165
 
164
- .input.StripeElement--invalid + label + .baseline {
166
+ .input.StripeElement--invalid+label+.baseline {
165
167
  border-color: #f44336;
166
168
  border-width: 2px;
167
169
  }
@@ -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,58 +1,35 @@
1
1
  <template>
2
2
  <div :style="$styles()" :class="classes()">
3
- <v-text-field
4
- ref="field"
5
- v-model="fieldModel"
6
- :label="spec.label"
7
- :name="fieldName"
8
- :value="spec.value"
9
- :hint="spec.hint"
10
- :placeholder="spec.placeholder"
11
- :maxlength="spec.maxLength || 255"
12
- :disabled="spec.readOnly"
13
- :type="variant.type"
14
- :rules="rules"
15
- :prepend-inner-icon="leftIconName"
16
- :append-icon="rightIconName || variant.appendIcon"
17
- :prefix="spec.leftText"
18
- :suffix="spec.rightText"
19
- :min="spec.min"
20
- :max="spec.max"
21
- :outlined="$classes().includes('outlined')"
22
- :rounded="$classes().includes('rounded')"
23
- :dense="$classes().includes('dense')"
24
- :autofocus="spec.autoFocus || false"
25
- validate-on-blur
26
- v-on="onRightIconClick ? { 'click:append': onRightIconClick } : null"
27
- @input="onChange"
28
- />
29
- <input
30
- v-if="spec.readOnly"
31
- type="hidden"
32
- :name="fieldName"
33
- :value="fieldModel"
34
- />
3
+ <v-text-field v-model="fieldModel" :label="spec.label" :name="fieldName" :placeholder="spec.placeholder"
4
+ :maxlength="spec.maxLength || 255" :disabled="spec.readOnly" :type="config.type" :rules="rules"
5
+ :prepend-inner-icon="leftIconName" :append-inner-icon="config.appendIcon" :prefix="spec.leftText"
6
+ :suffix="spec.rightText" :min="spec.min" :max="spec.max" :autofocus="spec.autoFocus || false" validate-on="blur"
7
+ @click:appendInner="onRightIconClick" @input="onChange" :variant="variant" persistent-placeholder />
8
+ <input v-if="spec.readOnly" type="hidden" :name="fieldName" />
9
+
35
10
  </div>
36
11
  </template>
37
12
 
38
13
  <script>
39
14
  import eventFiltering from "../../utils/eventFiltering";
15
+ import inputVariant from "../mixins/inputVariant";
40
16
 
41
17
  export default {
18
+ mixins: [inputVariant],
42
19
  props: {
43
20
  spec: { type: Object, required: true },
44
21
  type: { type: String, required: true }
45
22
  },
46
23
  data() {
47
24
  return {
48
- variant: {},
25
+ config: {},
49
26
  rules: [],
50
27
  onRightIconClick: null,
51
28
  fields: {
52
29
  email: {
53
30
  type: "email",
54
31
  prependIcon: "email",
55
- onRightIconClick: function() {},
32
+ onRightIconClick: function () { },
56
33
  rules: [
57
34
  v =>
58
35
  !v ||
@@ -63,14 +40,14 @@ export default {
63
40
  number: {
64
41
  type: "number",
65
42
  prependIcon: "looks_one",
66
- onRightIconClick: function() {},
43
+ onRightIconClick: function () { },
67
44
  rules: [v => !v || /^\-?[.\d]*$/.test(v) || "Must be a number"]
68
45
  },
69
46
  password: {
70
47
  type: "password",
71
48
  prependIcon: "lock",
72
49
  appendIcon: "visibility",
73
- onRightIconClick: function(vm) {
50
+ onRightIconClick: function (vm) {
74
51
  vm.togglePasswordVisibility();
75
52
  },
76
53
  rules: [v => !v || v.length >= 6 || "Password must be longer"]
@@ -78,7 +55,7 @@ export default {
78
55
  url: {
79
56
  type: "url",
80
57
  prependIcon: "web",
81
- onRightIconClick: function() {},
58
+ onRightIconClick: function () { },
82
59
  rules: [
83
60
  // From https://gist.github.com/rodneyrehm/8013067
84
61
  // 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/
@@ -93,7 +70,7 @@ export default {
93
70
  search: {
94
71
  type: "url",
95
72
  prependIcon: "search",
96
- onRightIconClick: function() {},
73
+ onRightIconClick: function () { },
97
74
  rules: [
98
75
  v => !v || /^\w+:\/\/[.-\w]+$/.test(v) || "Must be a valid URL"
99
76
  ]
@@ -115,12 +92,13 @@ export default {
115
92
  },
116
93
  methods: {
117
94
  $ready() {
118
- this.variant = this.fields[this.type] || {};
119
- this.rules = this.$validation(this.variant.rules);
95
+ this.fieldModel = this.spec.value
96
+ this.config = this.fields[this.type] || {};
97
+ this.rules = this.$validation(this.config.rules);
120
98
 
121
- if (this.variant.onRightIconClick) {
99
+ if (this.config.onRightIconClick) {
122
100
  this.onRightIconClick = () => {
123
- this.variant.onRightIconClick(this);
101
+ this.config.onRightIconClick(this);
124
102
  };
125
103
  }
126
104
  },
@@ -140,7 +118,7 @@ export default {
140
118
  action_focus() {
141
119
  this.$refs.field.focus();
142
120
  },
143
- onChange: eventFiltering.debounce(function() {
121
+ onChange: eventFiltering.debounce(function () {
144
122
  this.$executeOnChange();
145
123
  }, 300)
146
124
  }
@@ -149,14 +127,12 @@ export default {
149
127
 
150
128
  <style lang="scss">
151
129
  .g-text-field--hintless {
152
- .v-text-field {
153
- .v-text-field__details {
154
- min-height: 0;
155
- margin-bottom: 0;
130
+ .v-input__details {
131
+ min-height: 0;
132
+ margin-bottom: 0;
156
133
 
157
- .v-messages {
158
- min-height: 0;
159
- }
134
+ .v-messages {
135
+ min-height: 0;
160
136
  }
161
137
  }
162
138
  }
@@ -1,46 +1,32 @@
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
- @input="onChange"
20
- ></v-textarea>
21
- <input
22
- v-if="spec.readOnly"
23
- type="hidden"
24
- :name="fieldName"
25
- :value="spec.value"
26
- />
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')"
6
+ :no-resize="$classes().includes('no-resize')" validate-on="blur" :variant="variant"></v-textarea>
7
+ <input v-if="spec.readOnly" type="hidden" :name="fieldName" :value="fieldModel" />
27
8
  </div>
28
9
  </template>
29
10
 
30
11
  <script>
31
12
  import eventFiltering from "../../utils/eventFiltering";
13
+ import inputVariant from "../mixins/inputVariant";
32
14
 
33
15
  export default {
16
+ mixins: [inputVariant],
34
17
  props: {
35
- spec: { type: Object, required: true }
18
+ spec: { type: Object, required: true },
36
19
  },
37
20
  data() {
38
21
  return {
39
22
  // styles: null,
40
- height: null
23
+ height: null,
41
24
  };
42
25
  },
43
26
  methods: {
27
+ $ready() {
28
+ this.fieldModel = this.spec.value;
29
+ },
44
30
  styles() {
45
31
  const styles = this.$styles();
46
32
  this.height = styles.remove("height");
@@ -49,7 +35,7 @@ export default {
49
35
  classes() {
50
36
  return this.$classes().concat("g-text-field--hintless");
51
37
  },
52
- onChange: eventFiltering.debounce(function() {
38
+ onChange: eventFiltering.debounce(function () {
53
39
  this.$executeOnChange();
54
40
  }, 300)
55
41
  }
@@ -60,6 +46,7 @@ export default {
60
46
  .v-text-field__details {
61
47
  margin-top: 2px;
62
48
  }
49
+
63
50
  .text-bold {
64
51
  font-weight: bold;
65
52
  }
@@ -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>
@@ -108,9 +101,10 @@ export default {
108
101
  }
109
102
  },
110
103
  $tearDown() {
104
+ console.log("Cleaning up timer...");
111
105
  if (this.timer != null) {
112
106
  clearInterval(this.timer);
113
- console.debug(`Timer stopped: ${this.timer}`);
107
+ console.log(`Timer stopped: ${this.timer}`);
114
108
  this.timer == null;
115
109
  }
116
110
  },
@@ -1,33 +1,20 @@
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
+ <v-img :eager="true" :src="spec.url || spec.base64Data" @click="$onClick()" :style="styles" :class="$classes()"
3
+ :max-width="width" :max-height="height" cover>
4
+ </v-img>
17
5
  </template>
18
6
 
19
7
  <script>
20
- import Vue from "vue";
21
- // import TooltipMixins from "./mixins/tooltip";
22
8
 
23
9
  export default {
24
- // mixins: [TooltipMixins],
25
10
  props: {
26
11
  spec: { type: Object, required: true }
27
12
  },
28
13
  data() {
29
14
  return {
30
- styles: {}
15
+ styles: {},
16
+ height: null,
17
+ width: null
31
18
  };
32
19
  },
33
20
  methods: {
@@ -71,8 +58,9 @@ export default {
71
58
  }
72
59
  }
73
60
 
74
- Vue.set(this.styles, "width", width);
75
- Vue.set(this.styles, "height", height);
61
+ Object.assign(this.styles, { width, height });
62
+ this.width = width
63
+ this.height = height
76
64
  },
77
65
  fitCrop(image) {
78
66
  let width, height;
@@ -85,8 +73,9 @@ export default {
85
73
  height = `${this.spec.height}px`;
86
74
  }
87
75
 
88
- Vue.set(this.styles, "width", width);
89
- Vue.set(this.styles, "height", height);
76
+ Object.assign(this.styles, { width, height });
77
+ this.width = width
78
+ this.height = height
90
79
  }
91
80
  }
92
81
  };
@@ -1,13 +1,6 @@
1
1
  <template>
2
- <a
3
- v-if="spec.onClick"
4
- :href="$href()"
5
- :rel="$rel()"
6
- :style="textStyles()"
7
- :class="$classes()"
8
- @click="$onClick()"
9
- >{{ text }}</a
10
- >
2
+ <a v-if="spec.onClick" :href="$href()" :rel="$rel()" :style="textStyles()" :class="$classes()" @click="$onClick()">{{
3
+ text }}</a>
11
4
  <span v-else :style="$styles()" :class="$classes()">{{ text }}</span>
12
5
  </template>
13
6
 
@@ -20,7 +13,7 @@ export default {
20
13
  props: {
21
14
  spec: { type: Object, required: true }
22
15
  },
23
- data: function() {
16
+ data: function () {
24
17
  return {
25
18
  text: " "
26
19
  };
@@ -31,14 +24,10 @@ export default {
31
24
 
32
25
  this.text = this.spec.text;
33
26
  },
34
- // action_set(spec) {
35
- // if (spec.user_id !== spec.filterKey) {
36
- // this.text = spec.text;
37
- // }
38
- // },
39
- action_merge(mergedSpec) {
40
- Object.assign(this.spec, mergedSpec);
41
- this.$ready();
27
+ action_set(spec) {
28
+ if (spec.user_id !== spec.filterKey) {
29
+ this.text = spec.text;
30
+ }
42
31
  }
43
32
  }
44
33
  };
@@ -54,12 +43,15 @@ a {
54
43
  display: inline-block;
55
44
  line-height: 1;
56
45
  }
46
+
57
47
  span.muted {
58
48
  opacity: 0.7;
59
49
  }
50
+
60
51
  span.small {
61
52
  font-size: 80%;
62
53
  }
54
+
63
55
  a:hover {
64
56
  text-decoration: none;
65
57
  }