glib-web 3.0.2 → 3.0.4

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 (45) hide show
  1. package/action.js +15 -29
  2. package/actions/analytics/logEvent.js +2 -2
  3. package/actions/auth/saveCsrfToken.js +0 -6
  4. package/actions/cables/push.js +3 -1
  5. package/actions/http/get.js +28 -16
  6. package/actions/panels/scrollTo.js +32 -7
  7. package/actions/panels/scrollToBottom.js +1 -1
  8. package/actions/windows/closeWithReload.js +1 -1
  9. package/actions/ws/push.js +2 -2
  10. package/app.vue +8 -9
  11. package/components/_chip.vue +29 -12
  12. package/components/_responsive.vue +27 -10
  13. package/components/component.vue +10 -2
  14. package/components/datetime.vue +0 -2
  15. package/components/fields/check.vue +31 -23
  16. package/components/fields/hidden.vue +7 -2
  17. package/components/fields/newRichText.vue +1 -1
  18. package/components/fields/radioGroup.vue +2 -1
  19. package/components/fields/richText.vue +4 -4
  20. package/components/fields/submit.vue +5 -2
  21. package/components/fields/text.vue +22 -23
  22. package/components/fields/textarea.vue +2 -1
  23. package/components/fields/timer.vue +1 -2
  24. package/components/label.vue +8 -4
  25. package/components/mixins/events.js +14 -19
  26. package/components/mixins/generic.js +2 -2
  27. package/components/mixins/styles.js +1 -1
  28. package/components/mixins/ws/actionCable.js +2 -2
  29. package/components/mixins/ws/phoenixSocket.js +6 -7
  30. package/components/panels/horizontal.vue +8 -8
  31. package/components/panels/list.vue +22 -3
  32. package/components/panels/responsive.vue +2 -11
  33. package/components/panels/scroll.vue +0 -3
  34. package/components/panels/table.vue +0 -3
  35. package/components/panels/timeline.vue +3 -4
  36. package/components/switch.vue +5 -4
  37. package/nav/dialog.vue +18 -8
  38. package/package.json +2 -2
  39. package/utils/history.js +1 -1
  40. package/utils/http.js +56 -10
  41. package/utils/private/ws.js +2 -2
  42. package/utils/public.js +0 -6
  43. package/utils/settings.js +10 -2
  44. package/actions/commands/enqueue.js +0 -17
  45. package/utils/queue.js +0 -102
package/action.js CHANGED
@@ -52,7 +52,6 @@ import ActionsAnalyticsLogEvent from "./actions/analytics/logEvent";
52
52
 
53
53
  import ActionCommandsCopy from "./actions/commands/copy";
54
54
  import ActionCommandsCustom from "./actions/commands/custom";
55
- import ActionCommandsEnqueue from "./actions/commands/enqueue";
56
55
 
57
56
  import ActionToursStart from "./actions/tours/start";
58
57
  import ActionToursStop from "./actions/tours/stop";
@@ -117,7 +116,6 @@ const actions = {
117
116
 
118
117
  "commands/copy": ActionCommandsCopy,
119
118
  "commands/custom": ActionCommandsCustom,
120
- "commands/enqueue": ActionCommandsEnqueue,
121
119
 
122
120
  "tours/start": ActionToursStart,
123
121
  "components/update": ActionComponentsUpdate,
@@ -134,43 +132,34 @@ export default class Action {
134
132
  if (!TypeUtils.isObject(spec)) {
135
133
  return;
136
134
  }
135
+ if (!TypeUtils.isObject(component)) {
136
+ console.warn("Action requires a component");
137
+ return;
138
+ }
137
139
 
138
140
  const name = spec.action;
139
141
  if (TypeUtils.isString(name)) {
140
142
  if (name.startsWith("component/")) {
141
- this.executeLocal(name, spec, component);
143
+ return this.executeLocal(name, spec, component);
142
144
  } else {
143
- this.executeGlobal(name, spec, component, params);
145
+ return this.executeGlobal(name, spec, component, params);
144
146
  }
145
-
146
- // const actionName = name.replace(/-v1$/, "");
147
-
148
- // try {
149
- // const action = new actions[actionName]();
150
- // const logDisabled = action.logDisabled && action.logDisabled();
151
- // if (!logDisabled) {
152
- // console.log(`Executing "${actionName}"`);
153
- // }
154
- // action.execute(spec, null, component, params);
155
- // } catch (e) {
156
- // console.log(`Failed executing command: "${e.message}"`);
157
- // }
158
147
  } else {
159
- console.log(`Invalid action: "${name}"`);
148
+ console.warn(`Invalid action: "${name}"`);
160
149
  }
161
150
  }
162
151
 
163
152
  static executeLocal(name, spec, component) {
164
153
  const methodName = name.replace(/^component\//, "");
165
154
  const componentName = GLib.component.vueName(component);
166
- console.log(
155
+ console.debug(
167
156
  `Executing component action on ${componentName}: ${methodName}`
168
157
  );
169
158
  component[`action_${methodName}`](spec);
170
159
  }
171
160
 
172
161
  static executeGlobal(name, spec, component, params) {
173
- this._executeInternal(name, spec, component, params, actions);
162
+ return this._executeInternal(name, spec, component, params, actions);
174
163
  }
175
164
 
176
165
  static _executeInternal(name, spec, component, params, registry) {
@@ -179,16 +168,13 @@ export default class Action {
179
168
  try {
180
169
  const action = new registry[actionName]();
181
170
  const logDisabled = action.logDisabled && action.logDisabled();
182
- if (!logDisabled) {
183
- console.log(`Executing "${actionName}"`);
171
+ if (!logDisabled && !spec.silent) {
172
+ console.debug(`Executing "${actionName}"`);
184
173
  }
185
- action.execute(spec, component, params);
174
+ return action.execute(spec, component, params);
186
175
  } catch (e) {
187
- GLib.settings.errorHandler(
188
- new Error(
189
- `Failed executing command "${actionName}". Error: ${e.message}`
190
- )
191
- );
176
+ GLib.settings.errorHandler(e, `Failed executing "${actionName}"`);
177
+ return null;
192
178
  }
193
179
  }
194
180
 
@@ -214,7 +200,7 @@ export default class Action {
214
200
  }
215
201
 
216
202
  static executeCustom(name, spec, component, params) {
217
- this._executeInternal(name, spec, component, params, customActions);
203
+ return this._executeInternal(name, spec, component, params, customActions);
218
204
  }
219
205
  }
220
206
 
@@ -14,10 +14,10 @@ export default class {
14
14
  const suffix = params.referer_group ? "w/ referer" : "w/o referer";
15
15
  params.build_env = Utils.settings.env;
16
16
  // params.build_version = Utils.settings.appVersion;
17
- console.log(`Logging ${suffix}:`, properties.name, params);
17
+ console.debug(`Logging ${suffix}:`, properties.name, params);
18
18
  firebase.analytics().logEvent(properties.name, params);
19
19
  } else {
20
- console.log("Waiting for firebase to be initialized...");
20
+ console.debug("Waiting for firebase to be initialized...");
21
21
  setTimeout(() => {
22
22
  this.execute(properties);
23
23
  }, 100);
@@ -1,11 +1,5 @@
1
- // import Storage from '../../utils/storage'
2
- // import Keys from '../../keys'
3
-
4
1
  export default class {
5
2
  execute(properties, component) {
6
- // console.log(properties['token'])
7
- // Storage.setLocal(Keys.Db.csrfToken, properties['token'])
8
-
9
3
  Utils.dom.setCsrf(properties["token"]);
10
4
  Action.execute(properties["onSave"], component);
11
5
  }
@@ -6,7 +6,9 @@ export default class {
6
6
  const ws = vueApp.actionCable;
7
7
  const channel = ws.channels[channelName];
8
8
 
9
- console.log("Pushing to", channel);
9
+ // TODO: Use logDisabled() that reads params from server to decide whether we want to print the log or not.
10
+ // This is because `push` action's logs are a bit sensitive.
11
+ console.debug("Pushing to", channel);
10
12
 
11
13
  Utils.type.ifString(properties.event, eventName => {
12
14
  if (channel) {
@@ -1,22 +1,34 @@
1
1
  export default class {
2
- execute(properties, controller) {
2
+ execute(spec, component) {
3
+ return new Promise(resolve => {
4
+ GLib.http.execute(
5
+ spec,
6
+ "GET",
7
+ component,
8
+ (page, response) => {
9
+ this.handleSuccess(page, spec, component);
10
+ resolve({ page: page, response: response });
11
+ },
12
+ (error, response) => {
13
+ resolve({ error: error, response: response });
14
+ }
15
+ );
16
+ });
17
+ }
18
+
19
+ handleSuccess(page, spec, component) {
3
20
  const currentUrl = window.location.href;
4
- // const htmlUrl = Utils.url.htmlUrl(properties["url"]);
5
21
 
6
- GLib.http.execute(properties, "GET", controller, (page, response) => {
7
- Utils.type.ifString(properties.historyUrl, historyUrl => {
8
- const cleanUrl = Utils.url.htmlUrl(historyUrl);
9
- if (cleanUrl !== currentUrl) {
10
- console.log("URL", cleanUrl, response.url, response);
11
- const data = Object.assign({}, page, {
12
- replayGetResponse: page.onResponse
13
- });
22
+ Utils.type.ifString(spec.historyUrl, historyUrl => {
23
+ const cleanUrl = Utils.url.htmlUrl(historyUrl);
24
+ if (cleanUrl !== currentUrl) {
25
+ const data = Object.assign({}, window.vueApp.page, {
26
+ replayGetResponse: page.onResponse
27
+ });
14
28
 
15
- // Utils.history.pushPage(data, historyUrl);
16
- Utils.history.pushPage(data, cleanUrl);
17
- }
18
- });
19
- GLib.action.handleResponse(page, controller);
29
+ Utils.history.pushPage(data, cleanUrl);
30
+ }
20
31
  });
32
+ GLib.action.handleResponse(page, component);
21
33
  }
22
- }
34
+ }
@@ -1,20 +1,45 @@
1
1
  // Scroll the main body of the current window
2
2
  export default class {
3
- execute(properties, component) {
3
+ execute(spec, component) {
4
4
  const pageBody =
5
5
  Utils.launch.dialog.closestBody(component) || Utils.history._pageBody;
6
6
 
7
- const selector = `#${properties.viewId}`;
8
- console.log("Scrolling to", selector);
7
+ const selector = `#${spec.viewId}`;
8
+ console.debug("Scrolling to", selector);
9
9
  const element = pageBody.querySelector(selector);
10
- element.scrollIntoView({
11
- behavior: properties["animate"] ? "smooth" : "auto"
12
- });
10
+
11
+ this.scrollIfNeeded(element, spec, component);
13
12
 
14
13
  element.classList.add("glib-scrollto");
15
14
  element.classList.add("glib-scrollto--highlighted");
15
+ }
16
+
17
+ // From https://gist.github.com/hsablonniere/2581101
18
+ scrollIfNeeded(element, spec, component, centerIfNeeded = true) {
19
+ const vm = this;
20
+ const observerOptions = {
21
+ threshold: 1 // Trigger callback when 100% of the element becomes/unbecomes visible
22
+ };
23
+ new IntersectionObserver(function([entry]) {
24
+ const ratio = entry.intersectionRatio;
25
+ if (ratio < 1) {
26
+ const place = ratio <= 0 && centerIfNeeded ? "center" : "nearest";
27
+ element.scrollIntoView({
28
+ block: place,
29
+ inline: place,
30
+ behavior: spec["animate"] ? "smooth" : "auto"
31
+ });
32
+ } else {
33
+ vm.onScrollEnd(element, spec, component);
34
+ this.disconnect();
35
+ }
36
+ }, observerOptions).observe(element);
37
+ }
38
+
39
+ onScrollEnd(element, spec, component) {
16
40
  setTimeout(() => {
17
41
  element.classList.remove("glib-scrollto--highlighted");
18
- }, 500);
42
+ }, 300); // Allow time so the changes can be seen by human eyes.
43
+ GLib.action.execute(spec.onScroll, component);
19
44
  }
20
45
  }
@@ -4,7 +4,7 @@ export default class {
4
4
  // TODO: make this support any panelId
5
5
  const target = properties.panelId ? `_innerBody` : "_pageBody";
6
6
  const pageBody = Utils.history[target];
7
- console.log(`Scrolling ${target} to bottom`);
7
+ console.debug(`Scrolling ${target} to bottom`);
8
8
  pageBody.scrollTo({
9
9
  top: pageBody.scrollHeight,
10
10
  behavior: properties["animate"] ? "smooth" : "auto"
@@ -6,7 +6,7 @@ export default class {
6
6
  const data = Object.assign({}, properties);
7
7
  if (!Utils.history.back()) {
8
8
  data.url = fallbackUrl;
9
- console.log("Use fallbackUrl", data.url);
9
+ console.debug("Use fallbackUrl", data.url);
10
10
  }
11
11
 
12
12
  // Allow time for history.back() to complete, which is important for actions that need
@@ -15,14 +15,14 @@ export default class {
15
15
  channel
16
16
  .push(eventName, payload)
17
17
  .receive("ok", resp => {
18
- console.log(
18
+ console.debug(
19
19
  `Push to '${topicName}/${eventName}' succeeded`,
20
20
  resp
21
21
  );
22
22
  Utils.ws.handleResponse(resp.onResponse, component);
23
23
  })
24
24
  .receive("error", resp => {
25
- console.log(`Push to '${topicName}/${eventName}' failed`, resp);
25
+ console.debug(`Push to '${topicName}/${eventName}' failed`, resp);
26
26
  Utils.ws.handleResponse(resp.onResponse, component);
27
27
  });
28
28
  } else {
package/app.vue CHANGED
@@ -4,7 +4,7 @@
4
4
  <nav-appbar ref="appBar" :page="page" />
5
5
 
6
6
  <v-progress-linear color="primary" v-if="vueApp.indicator" :indeterminate="true" height="5"
7
- style="position: fixed; z-index: 4;">
7
+ style="position: fixed; z-index: 4">
8
8
  </v-progress-linear>
9
9
 
10
10
  <v-main :style="`height: ${mainHeight}px;`">
@@ -47,7 +47,7 @@ export default {
47
47
  return {
48
48
  title: "...",
49
49
  mainHeight: 0,
50
- vueApp
50
+ vueApp,
51
51
  };
52
52
  },
53
53
  computed: {
@@ -62,7 +62,7 @@ export default {
62
62
  },
63
63
  containerComponent() {
64
64
  if (this.formSpec) {
65
- this.name = 'panels-form'
65
+ this.name = "panels-form";
66
66
  return "panels-form";
67
67
  }
68
68
  return "div";
@@ -80,10 +80,10 @@ export default {
80
80
  watch: {
81
81
  "vueApp.indicator": function (val, oldVal) {
82
82
  document.title = val ? "..." : this.page.title;
83
- }
83
+ },
84
84
  },
85
85
  created() {
86
- console.log(
86
+ console.debug(
87
87
  `Version: ${Utils.settings.appVersion} (${Utils.settings.env})`
88
88
  );
89
89
  Utils.history.saveInitialContent(this.page);
@@ -137,7 +137,6 @@ export default {
137
137
  });
138
138
  },
139
139
  updateMainHeight() {
140
- console.debug("Setting body height");
141
140
  this.mainHeight = window.innerHeight - this.$refs.appBar.$el.offsetHeight;
142
141
  },
143
142
  },
@@ -193,13 +192,13 @@ body,
193
192
  }
194
193
 
195
194
  // Don't override the default button's effect.
196
- .glib-clickable:not(.v-btn) {
195
+ .glib-clickable:not(.v-btn):not(.disabled) {
197
196
  cursor: pointer;
198
197
 
199
198
  // // So that we can display a semi-transparent layer on hover (see below)
200
199
  position: relative;
201
200
 
202
- &:hover:before {
201
+ &:not(.no-hover):hover:before {
203
202
  content: "\A";
204
203
  width: 100%;
205
204
  height: 100%;
@@ -227,7 +226,7 @@ body,
227
226
  }
228
227
 
229
228
  .popover-menu-item {
230
- font-size: 14px;
229
+ font-size: 16px;
231
230
  padding: 8px 16px;
232
231
  width: 100%;
233
232
  }
@@ -1,11 +1,24 @@
1
1
  <template>
2
2
  <common-badge :spec="spec">
3
3
  <div>
4
- <v-chip v-if="spec.onClick" :style="genericStyles()" :color="color" :class="$classes()" :href="$href()"
5
- @click="$onClick()" :variant="variant">
4
+ <v-chip
5
+ v-if="spec.onClick"
6
+ :style="genericStyles()"
7
+ :color="color"
8
+ :class="$classes()"
9
+ :href="$href()"
10
+ @click="$onClick()"
11
+ :variant="variant"
12
+ >
6
13
  {{ spec.text }}
7
14
  </v-chip>
8
- <v-chip v-else :style="genericStyles()" :color="color" :class="$classes()" :variant="variant">
15
+ <v-chip
16
+ v-else
17
+ :style="genericStyles()"
18
+ :color="color"
19
+ :class="$classes()"
20
+ :variant="variant"
21
+ >
9
22
  {{ spec.text }}
10
23
  </v-chip>
11
24
  </div>
@@ -13,17 +26,17 @@
13
26
  </template>
14
27
 
15
28
  <script>
16
- import { colors, variants } from '../utils/constant'
29
+ import { colors, variants } from "../utils/constant";
17
30
 
18
31
  export default {
19
32
  data: function () {
20
33
  return {
21
- color: '',
22
- variant: 'tonal'
23
- }
34
+ color: "",
35
+ variant: "tonal",
36
+ };
24
37
  },
25
38
  props: {
26
- spec: { type: Object, required: true }
39
+ spec: { type: Object, required: true },
27
40
  },
28
41
  // data: function() {
29
42
  // return {
@@ -34,15 +47,15 @@ export default {
34
47
  $ready() {
35
48
  colors.forEach((value) => {
36
49
  if (this.$classes().includes(value)) this.color = value;
37
- })
50
+ });
38
51
  variants.forEach((value) => {
39
52
  if (this.$classes().includes(value)) this.variant = value;
40
- })
53
+ });
41
54
  },
42
55
  $registryEnabled() {
43
56
  return false;
44
- }
45
- }
57
+ },
58
+ },
46
59
  };
47
60
  </script>
48
61
 
@@ -51,4 +64,8 @@ export default {
51
64
  .v-chip:not(.v-chip--clickable).theme--light:hover:before {
52
65
  opacity: 0;
53
66
  }
67
+ .icon-wrapper {
68
+ display: flex;
69
+ padding-right: 2px;
70
+ }
54
71
  </style>
@@ -1,9 +1,24 @@
1
1
  <template>
2
- <component :is="componentName" :class="cssClasses" :style="$styles()" :href="$href()" @click="$onClick()">
2
+ <component
3
+ :is="componentName"
4
+ :class="cssClasses"
5
+ :style="$styles()"
6
+ :href="$href()"
7
+ @click="$onClick()"
8
+ >
3
9
  <v-row no-gutters class="full-height">
4
10
  <template v-for="(item, index) in spec.childViews">
5
- <glib-component v-if="isColumn(item)" :key="viewKey(item, index)" :spec="item" />
6
- <div v-else :key="'else-' + viewKey(item, index)" class="full-width" :style="innerStyles">
11
+ <glib-component
12
+ v-if="isColumn(item)"
13
+ :key="viewKey(item, index)"
14
+ :spec="item"
15
+ />
16
+ <div
17
+ v-else
18
+ :key="'else-' + viewKey(item, index)"
19
+ class="full-width"
20
+ :style="innerStyles"
21
+ >
7
22
  <glib-component :spec="item" />
8
23
  </div>
9
24
  </template>
@@ -12,15 +27,14 @@
12
27
  </template>
13
28
 
14
29
  <script>
15
-
16
30
  export default {
17
31
  props: {
18
32
  spec: { type: Object, required: true },
19
- eventHandlers: { type: Object, default: null }
33
+ eventHandlers: { type: Object, default: null },
20
34
  },
21
35
  data() {
22
36
  return {
23
- innerStyles: {}
37
+ innerStyles: {},
24
38
  };
25
39
  },
26
40
  computed: {
@@ -30,7 +44,7 @@ export default {
30
44
  },
31
45
  componentName() {
32
46
  return this.spec.onClick ? "a" : "div";
33
- }
47
+ },
34
48
  },
35
49
  methods: {
36
50
  $ready() {
@@ -45,7 +59,7 @@ export default {
45
59
  default:
46
60
  align = "flex-start";
47
61
  }
48
- Object.assign(this.innerStyles, { 'align-items': align, height: 'auto' })
62
+ Object.assign(this.innerStyles, { "align-items": align, height: "auto" });
49
63
  },
50
64
  isColumn(item) {
51
65
  return item.view == "panels/column-v1";
@@ -53,8 +67,11 @@ export default {
53
67
  viewKey(item, index) {
54
68
  // Use view name for key to avoid component reuse issue
55
69
  return `view${index}_${item.view}`;
56
- }
57
- }
70
+ },
71
+ $registryEnabled() {
72
+ return false;
73
+ },
74
+ },
58
75
  };
59
76
  </script>
60
77
 
@@ -209,7 +209,9 @@ export default {
209
209
  },
210
210
  data() {
211
211
  return {
212
- name: null
212
+ name: null,
213
+ // See events#$recursiveUpdate().
214
+ $passthrough: true
213
215
  };
214
216
  },
215
217
  computed: {
@@ -240,7 +242,13 @@ export default {
240
242
  }
241
243
  },
242
244
  $update() {
243
- this.$refs.delegate.$update();
245
+ this.$ready();
246
+
247
+ const delegate = this.$refs.delegate;
248
+ if (delegate) {
249
+ // Might be null if the component is getting removed as part of the update.
250
+ delegate.$update();
251
+ }
244
252
  },
245
253
  $registryEnabled() {
246
254
  return false;
@@ -34,10 +34,8 @@ export default {
34
34
  }
35
35
  },
36
36
  $tearDown() {
37
- console.log("TimeTicker destroyed");
38
37
  if (this.timer != null) {
39
38
  clearInterval(this.timer);
40
- console.log(`Timer stopped: ${this.timer}`);
41
39
  }
42
40
  },
43
41
  tick() {
@@ -12,7 +12,7 @@
12
12
  <script>
13
13
  export default {
14
14
  props: {
15
- spec: { type: Object, required: true },
15
+ spec: { type: Object, required: true }
16
16
  },
17
17
  data() {
18
18
  return {
@@ -23,12 +23,37 @@ export default {
23
23
  },
24
24
  methods: {
25
25
  $ready() {
26
+ this.updateData()
27
+ },
28
+ changed(event) {
29
+ // Execute later to ensure the checkbox's checked state has been updated.
30
+ setTimeout(() => {
31
+ this.$type.ifObject(this.groupElement, val =>
32
+ val.dispatchEvent(new Event("change"))
33
+ );
34
+ }, 100);
35
+
36
+ // setTimeout(() => {
37
+ this.$executeOnChange();
38
+ // }, 500);
39
+ },
40
+ $internalizeValue(val) {
41
+ if (val == this.spec.checkValue) {
42
+ return val;
43
+ }
44
+ return this.spec.uncheckValue;
45
+ },
46
+ action_merge(mergedSpec) {
47
+ Object.assign(this.spec, mergedSpec);
48
+ this.updateData()
49
+ },
50
+ updateData() {
26
51
  this.groupElement = this.$el.closest("[data-component=checkGroup]");
27
52
 
28
53
  let groupName = null;
29
54
  this.$type.ifObject(
30
55
  this.groupElement,
31
- (val) => (groupName = val.getAttribute("name"))
56
+ val => (groupName = val.getAttribute("name"))
32
57
  );
33
58
 
34
59
  this.fieldName = this.spec.name || groupName;
@@ -37,31 +62,14 @@ export default {
37
62
  ? this.spec.checkValue
38
63
  : this.spec.value;
39
64
 
40
- Utils.type.ifArray(this.spec.styleClasses, (classes) => {
65
+ Utils.type.ifArray(this.spec.styleClasses, classes => {
41
66
  if (classes.remove("switch")) {
42
67
  this.fieldType = "switch";
43
68
  }
44
69
  });
45
- },
46
- changed(event) {
47
- // Execute later to ensure the checkbox's checked state has been updated.
48
- setTimeout(() => {
49
- this.$type.ifObject(this.groupElement, (val) =>
50
- val.dispatchEvent(new Event("change"))
51
- );
52
- }, 100);
53
-
54
- setTimeout(() => {
55
- this.$executeOnChange();
56
- }, 500);
57
- },
58
- $internalizeValue(val) {
59
- if (val == this.spec.checkValue) {
60
- return val;
61
- }
62
- return this.spec.uncheckValue;
63
- },
64
- },
70
+ // this.fieldModel = this.spec.value;
71
+ }
72
+ }
65
73
  };
66
74
  </script>
67
75
 
@@ -10,8 +10,13 @@
10
10
  <script>
11
11
  export default {
12
12
  props: {
13
- spec: { type: Object, required: true }
14
- }
13
+ spec: { type: Object, required: true },
14
+ },
15
+ methods: {
16
+ $ready() {
17
+ this.fieldModel = this.spec.value;
18
+ },
19
+ },
15
20
  };
16
21
  </script>
17
22
 
@@ -160,7 +160,7 @@ export default {
160
160
  upload.start((error, blob) => {
161
161
  if (error) {
162
162
  // Handle the error
163
- console.log("Failed uploading image!");
163
+ console.warn("Failed uploading image!");
164
164
  } else {
165
165
  this.insertImage(file, blob, onComplete);
166
166
  }
@@ -31,12 +31,13 @@ export default {
31
31
  },
32
32
  childSpec(childView) {
33
33
  const cls = Object.assign({}, childView)
34
+ cls.styleClasses ||= []
34
35
  if (this.activeClass(cls)) {
35
36
  if (!cls.styleClasses.includes('radio--active')) {
36
37
  cls.styleClasses.push('radio--active')
37
38
  }
38
39
  } else {
39
- cls.styleClasses = childView.styleClasses.filter((v) => v != 'radio--active')
40
+ cls.styleClasses = cls.styleClasses.filter((v) => v != 'radio--active')
40
41
  }
41
42
  return cls;
42
43
  },