glib-web 3.20.4 → 3.20.6

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.
package/app.vue CHANGED
@@ -37,7 +37,6 @@ import { useDirtyState } from "./components/composable/dirtyState";
37
37
  import { useSocket } from "./components/composable/socket";
38
38
  import { uploadFiles, useFilesState, useDropableUtils, setBusyWhenUploading } from "./components/composable/dropable";
39
39
  import { ref, watch } from "vue";
40
- import { merge } from 'lodash.merge';
41
40
 
42
41
  const { watchDirtyState } = useDirtyState();
43
42
  const { signedIds } = useDropableUtils();
@@ -169,7 +168,9 @@ export default {
169
168
  );
170
169
  },
171
170
  $ready() {
172
- document.title = this.page.title;
171
+ this.$type.ifString(this.page.title, (title) => {
172
+ document.title = title;
173
+ });
173
174
 
174
175
  // this.$wsInitPhoenixSocket(this.page.phoenixSocket);
175
176
  // this.$wsInitActionCable(this.page.actionCable);
@@ -59,6 +59,7 @@ export default {
59
59
  // force update if child is charts
60
60
  if (item.view.toString().startsWith('charts/')) return item;
61
61
 
62
+ // TODO: fix reactivity issue
62
63
  return index;
63
64
 
64
65
  // return `view${index}_${item.view}`;
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div :style="$styles()" :class="classes()">
3
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 v-model="fieldModel" :name="fieldName" :label="spec.label" :hint="spec.hint" :type="type"
5
- :readonly="spec.readOnly" :disabled="inputDisabled" :min="$sanitizeValue(spec.min)"
4
+ <v-text-field color="primary" v-model="fieldModel" :name="fieldName" :label="spec.label" :hint="spec.hint"
5
+ :type="type" :readonly="spec.readOnly" :disabled="inputDisabled" :min="$sanitizeValue(spec.min)"
6
6
  :max="$sanitizeValue(spec.max)" :pattern="pattern" :rules="$validation()" :style="$styles()"
7
7
  :density="$classes().includes('compact') ? 'compact' : 'default'" clearable @change="onChange" :variant="variant"
8
8
  validate-on="blur" persistent-placeholder />
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <div :style="$styles()" :class="classes()">
3
- <v-autocomplete v-model="fieldModel" :label="label" :items="options || []" :chips="spec.multiple"
4
- :multiple="spec.multiple" :readonly="spec.readOnly" :clearable="!spec.readOnly"
5
- :placeholder="spec.placeholder" :rules="rules" persistent-hint :append-icon="append.icon" validate-on="blur"
6
- item-title='text' :variant="variant" :closable-chips="spec.multiple" :density="density" persistent-placeholder
7
- @update:modelValue="onChange" @focus="focused = true" @blur="focused = false">
3
+ <v-autocomplete color="primary" v-model="fieldModel" :label="label" :items="options || []" :chips="spec.multiple"
4
+ :multiple="spec.multiple" :readonly="spec.readOnly" :clearable="!spec.readOnly" :placeholder="spec.placeholder"
5
+ :rules="rules" persistent-hint :append-icon="append.icon" validate-on="blur" item-title='text' :variant="variant"
6
+ :closable-chips="spec.multiple" :density="density" persistent-placeholder @update:modelValue="onChange"
7
+ @focus="focused = true" @blur="focused = false">
8
8
 
9
- <template #item="{props, item}">
9
+ <template #item="{ props, item }">
10
10
  <v-list-subheader v-if="item.raw.header">
11
11
  {{ item.raw.header }}
12
12
  </v-list-subheader>
@@ -71,9 +71,9 @@ export default {
71
71
  },
72
72
  label() {
73
73
  if (this.focused && this.spec.hint) {
74
- return `${this.spec.label} ${this.spec.hint}`
74
+ return `${this.spec.label} ${this.spec.hint}`;
75
75
  }
76
- return this.spec.label
76
+ return this.spec.label;
77
77
  }
78
78
  },
79
79
  methods: {
@@ -90,7 +90,7 @@ export default {
90
90
  default:
91
91
  return Object.assign({}, i, {
92
92
  props: { subtitle: i.subtitle }
93
- })
93
+ });
94
94
  }
95
95
  });
96
96
  },
@@ -1,10 +1,11 @@
1
1
  <!-- TODO: Remove (deprecated) -->
2
2
  <template>
3
3
  <div :style="genericStyles()">
4
- <v-combobox v-model="fieldModel" :name="fieldName" :label="spec.label" :items="options || []" :chips="spec.multiple"
5
- :deletable-chips="spec.multiple" :multiple="spec.multiple" :readonly="spec.readOnly" :disabled="inputDisabled"
6
- :hint="spec.hint" :placeholder="spec.placeholder" :outlined="$classes().includes('outlined') || null"
7
- :append-icon="append.icon" validate-on="blur" :variant="variant" persistent-placeholder />
4
+ <v-combobox color="primary" v-model="fieldModel" :name="fieldName" :label="spec.label" :items="options || []"
5
+ :chips="spec.multiple" :deletable-chips="spec.multiple" :multiple="spec.multiple" :readonly="spec.readOnly"
6
+ :disabled="inputDisabled" :hint="spec.hint" :placeholder="spec.placeholder"
7
+ :outlined="$classes().includes('outlined') || null" :append-icon="append.icon" validate-on="blur"
8
+ :variant="variant" persistent-placeholder />
8
9
  </div>
9
10
  </template>
10
11
 
@@ -3,9 +3,10 @@
3
3
  <!-- This hidden field should always be there to make sure the submitted param is not empty,
4
4
  which could cause "Not accessible" error on the server. -->
5
5
  <input v-model="uncheckValue" type="hidden" :name="fieldName" />
6
- <v-checkbox v-model="fieldModel" :name="fieldName" :readonly="spec.readOnly" :disabled="inputDisabled"
7
- :label="fieldModel ? spec.onLabel || spec.label : spec.label" :true-icon="spec.onIcon" :false-icon="spec.offIcon"
8
- :value="spec.value" :true-value="spec.checkValue" hide-details @change="changed" color="primary"></v-checkbox>
6
+ <v-checkbox color="primary" v-model="fieldModel" :name="fieldName" :readonly="spec.readOnly"
7
+ :disabled="inputDisabled" :label="fieldModel ? spec.onLabel || spec.label : spec.label" :true-icon="spec.onIcon"
8
+ :false-icon="spec.offIcon" :value="spec.value" :true-value="spec.checkValue" hide-details
9
+ @change="changed"></v-checkbox>
9
10
  </div>
10
11
  </template>
11
12
 
@@ -5,7 +5,7 @@ w<template>
5
5
  <v-chip v-for="(option, index) in spec.options" :key="index" filter :variant="variant">{{
6
6
  option.text }}</v-chip>
7
7
  </v-chip-group>
8
- <input v-for="(item, index) in $internalizeValue(fieldModel) " :key="index" type="hidden" :disabled="inputDisabled"
8
+ <input v-for="(item, index) in $internalizeValue(fieldModel) " :key="index" type="hidden" :disabled="inputDisabled"
9
9
  :name="fieldName" :value="item" />
10
10
  </div>
11
11
  </template>
@@ -22,7 +22,7 @@ export default defineComponent({
22
22
  },
23
23
  computed: {
24
24
  color() {
25
- return determineColor(this.spec.styleClasses, this.spec.color);
25
+ return determineColor(this.spec.styleClasses, this.spec.color || 'primary');
26
26
  }
27
27
  },
28
28
  methods: {
@@ -6,11 +6,11 @@
6
6
 
7
7
  <div class="cloud" style="pointer-events: none;">
8
8
  <v-icon ref="icon" size="48" class="icon">cloud_upload</v-icon>
9
- <h4 v-if="spec.placeholder" class="title">{{ spec.placeholder }}</h4>
10
- <p v-if="spec.hint" class="subtitle">{{ spec.hint }}</p>
9
+ <h4 v-if="props.spec.placeholder" class="title">{{ props.spec.placeholder }}</h4>
10
+ <p v-if="props.spec.hint" class="subtitle">{{ props.spec.hint }}</p>
11
11
  </div>
12
12
 
13
- <input v-for="(file, index) in Object.values(files)" type="hidden" :name="spec.name" :value="file.signedId"
13
+ <input v-for="(file, index) in Object.values(files)" type="hidden" :name="props.spec.name" :value="file.signedId"
14
14
  :disabled="inputDisabled" :key="`hidden-${index}`">
15
15
  </div>
16
16
 
@@ -28,7 +28,7 @@
28
28
  <div class="progress">
29
29
  <div class="label"><a :href="file[1].url" target="_blank">{{ `${file[1].name}` }}</a><span
30
30
  v-if="file[1].message" style="font-size: 0.75em">{{
31
- file[1].message }}</span></div>
31
+ file[1].message }}</span></div>
32
32
  <div class="background" v-show="file[1].progress.value > 0">
33
33
  <div class="value" :style="{ width: `${file[1].progress.value}%` }"></div>
34
34
  </div>
@@ -205,18 +205,17 @@ export default defineComponent({
205
205
  props: { spec: { type: Object } },
206
206
  components: { VIcon },
207
207
  setup(props) {
208
- const spec = props.spec;
209
208
  const fileSelect = ref(null);
210
209
  const container = ref(null);
211
210
  const icon = ref(null);
212
211
  const { ctx } = getCurrentInstance();
213
212
 
214
- const responseMessages = spec.responseMessages;
215
- const uploadTitle = spec.uploadTitle || 'File added';
213
+ const responseMessages = props.spec.responseMessages;
214
+ const uploadTitle = props.spec.uploadTitle || 'File added';
216
215
 
217
216
  let files = ref({});
218
- if (spec.files && spec.files.length > 0) {
219
- files = ref(spec.files.reduce((prev, curr) => {
217
+ if (props.spec.files && props.spec.files.length > 0) {
218
+ files = ref(props.spec.files.reduce((prev, curr) => {
220
219
  const key = makeKey();
221
220
 
222
221
  prev[key] = new Item({
@@ -232,11 +231,11 @@ export default defineComponent({
232
231
  }, {}));
233
232
  }
234
233
 
235
- if (spec.onFinishUpload) {
234
+ if (props.spec.onFinishUpload) {
236
235
  const { uploaded } = useFilesState(files);
237
236
  watch(uploaded, (val, oldVal) => {
238
237
  if (val) {
239
- nextTick(() => GLib.action.execute(spec.onFinishUpload, ctx));
238
+ nextTick(() => GLib.action.execute(props.spec.onFinishUpload, ctx));
240
239
  }
241
240
  });
242
241
  }
@@ -253,8 +252,8 @@ export default defineComponent({
253
252
  {
254
253
  droppedFiles: e.dataTransfer.files,
255
254
  files: files,
256
- directUploadUrl: spec.directUploadUrl,
257
- accepts: spec.accepts,
255
+ directUploadUrl: props.spec.directUploadUrl,
256
+ accepts: props.spec.accepts,
258
257
  responseMessages: responseMessages,
259
258
  container: container
260
259
  }
@@ -301,8 +300,8 @@ export default defineComponent({
301
300
  {
302
301
  droppedFiles: e.target.files,
303
302
  files: files,
304
- directUploadUrl: spec.directUploadUrl,
305
- accepts: spec.accepts,
303
+ directUploadUrl: props.spec.directUploadUrl,
304
+ accepts: props.spec.accepts,
306
305
  responseMessages: responseMessages,
307
306
  container: container
308
307
  }
@@ -325,7 +324,8 @@ export default defineComponent({
325
324
  handleRemoveFile,
326
325
  showUploadedFile,
327
326
  responseMessages,
328
- uploadTitle
327
+ uploadTitle,
328
+ props
329
329
  };
330
330
  }
331
331
  })
@@ -1,11 +1,12 @@
1
1
  <template>
2
2
  <div :style="$styles()" :class="$classes()">
3
- <v-text-field ref="field" v-model="fieldModel" :label="spec.label" :name="fieldName" :placeholder="spec.placeholder"
4
- :density="density" :hint="spec.hint" :maxlength="spec.maxLength || 255" :readonly="spec.readOnly"
5
- :disabled="inputDisabled" :type="config.type" :rules="rules" :prepend-inner-icon="leftIconName"
6
- :append-inner-icon="config.appendIcon" :prefix="spec.leftText" :suffix="spec.rightText" :min="spec.min"
7
- :max="spec.max" :autofocus="spec.autoFocus || false" validate-on="blur" @click:appendInner="onRightIconClick"
8
- @input="onChange" :variant="variant" persistent-placeholder @keyup="$onTyping({ duration: 2000 })" />
3
+ <v-text-field color="primary" ref="field" v-model="fieldModel" :label="spec.label" :name="fieldName"
4
+ :placeholder="spec.placeholder" :density="density" :hint="spec.hint" :maxlength="spec.maxLength || 255"
5
+ :readonly="spec.readOnly" :disabled="inputDisabled" :type="config.type" :rules="rules"
6
+ :prepend-inner-icon="leftIconName" :append-inner-icon="config.appendIcon" :prefix="spec.leftText"
7
+ :suffix="spec.rightText" :min="spec.min" :max="spec.max" :autofocus="spec.autoFocus || false" validate-on="blur"
8
+ @click:appendInner="onRightIconClick" @input="onChange" :variant="variant" persistent-placeholder
9
+ @keyup="$onTyping({ duration: 2000 })" />
9
10
  </div>
10
11
  </template>
11
12
 
@@ -158,5 +159,4 @@ export default {
158
159
  // min-height: 0;
159
160
  // }
160
161
  // }
161
- // }
162
- </style>
162
+ // }</style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :style="styles()" :class="classes()">
3
- <v-textarea v-model="fieldModel" :label="spec.label" :name="fieldName" :hint="spec.hint"
3
+ <v-textarea color="primary" v-model="fieldModel" :label="spec.label" :name="fieldName" :hint="spec.hint"
4
4
  :placeholder="spec.placeholder" :maxlength="spec.maxLength || 255" :readonly="spec.readOnly" :height="height"
5
5
  :rules="$validation()" counter :outlined="$classes().includes('outlined')" :disabled="inputDisabled"
6
6
  :no-resize="$classes().includes('no-resize')" validate-on="blur" :variant="variant" :density="density"
package/components/p.vue CHANGED
@@ -7,14 +7,13 @@
7
7
  // import marked from "marked";
8
8
 
9
9
  export default {
10
- expose: ['text'],
11
- data: function () {
12
- return {
13
- text: this.spec.text
14
- };
15
- },
16
10
  props: {
17
11
  spec: { type: Object, required: true }
12
+ },
13
+ computed: {
14
+ text() {
15
+ return this.spec.text;
16
+ }
18
17
  }
19
18
  // computed: {
20
19
  // compiledText() {
package/nav/appBar.vue CHANGED
@@ -63,7 +63,6 @@ export default {
63
63
  // },
64
64
  isPermanent() {
65
65
  const display = this.$vuetify.display.name;
66
- console.log("isPermanent1", display);
67
66
  return display == "lg" || display == "xl";
68
67
  },
69
68
  showDrawerMenu() {
package/nav/drawer.vue CHANGED
@@ -12,12 +12,11 @@
12
12
  </template>
13
13
  <glib-component v-if="spec.body" :spec="spec.body" />
14
14
 
15
-
16
15
  <v-list :dense="true">
17
16
  <div v-for="(item, index) in spec.rows" :key="index" class="nav-item">
18
17
  <div v-if="item.type == 'button'" class="indicator"></div>
19
18
  <v-divider v-if="item.type == 'divider'" />
20
- <nav-drawerLabel v-else-if="item.type == 'label'" :spec="item" />
19
+ <nav-drawerLabel v-else-if="item.type == 'label'" :spec="rowSpec(item)" />
21
20
  <nav-drawerButton v-else :spec="item" />
22
21
  </div>
23
22
  </v-list>
@@ -35,10 +34,9 @@
35
34
 
36
35
 
37
36
  <script>
38
- // import UrlUtils from "../utils/url";
39
37
  import NavDrawerButton from "./drawerButton.vue";
40
38
  import NavDrawerLabel from "./drawerLabel.vue";
41
- import bus from "../utils/eventBus";
39
+ // import bus from "../utils/eventBus";
42
40
  import { useDisplay } from "vuetify";
43
41
 
44
42
  export default {
@@ -46,11 +44,10 @@ export default {
46
44
  "nav-drawerButton": NavDrawerButton,
47
45
  "nav-drawerLabel": NavDrawerLabel,
48
46
  },
49
- // props: ["spec", "trigger", "permanent"],
50
47
  props: {
51
48
  spec: { type: Object, required: true },
52
49
  trigger: { type: [Object, Date], default: null },
53
- permanent: { type: Boolean, required: true },
50
+ // permanent: { type: Boolean, required: true },
54
51
  },
55
52
  setup() {
56
53
  const { mdAndUp } = useDisplay();
@@ -114,10 +111,15 @@ export default {
114
111
  handleDrawerEnter() {
115
112
  this.isExpand = true;
116
113
  },
117
-
118
114
  handleDrawerLeave() {
119
115
  this.isExpand = false;
120
116
  },
117
+ rowSpec(item) {
118
+ return Object.assign({}, item, {
119
+ view: item.type,
120
+ type: null
121
+ });
122
+ }
121
123
  },
122
124
  };
123
125
  </script>
@@ -1,7 +1,6 @@
1
1
  <template>
2
- <v-list-item>
2
+ <v-list-item :class="$classes()">
3
3
  <v-list-item-title>{{ spec.text }}</v-list-item-title>
4
-
5
4
  </v-list-item>
6
5
  </template>
7
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "3.20.4",
3
+ "version": "3.20.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,7 +22,6 @@
22
22
  "json-logic-js": "^2.0.0",
23
23
  "lodash.merge": "^4.6.2",
24
24
  "marked": "^4.0.0",
25
- "material-design-icons-iconfont": "^6.7.0",
26
25
  "moment": "^2.29.4",
27
26
  "phoenix": "^1.5.3",
28
27
  "push.js": "^1.0.12",
@@ -1,5 +1,5 @@
1
1
  import { createVuetify } from "vuetify";
2
- import 'material-design-icons-iconfont/dist/material-design-icons.css';
2
+ // import 'material-design-icons-iconfont/dist/material-design-icons.css';
3
3
  import { aliases, md } from 'vuetify/iconsets/md';
4
4
  import 'vuetify/styles';
5
5
  import * as components from 'vuetify/components';