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 +3 -2
- package/components/_responsive.vue +1 -0
- package/components/fields/_patternText.vue +2 -2
- package/components/fields/_select.vue +9 -9
- package/components/fields/autocomplete.vue +5 -4
- package/components/fields/check.vue +4 -3
- package/components/fields/chipGroup.vue +2 -2
- package/components/fields/multiUpload.vue +16 -16
- package/components/fields/text.vue +8 -8
- package/components/fields/textarea.vue +1 -1
- package/components/p.vue +5 -6
- package/nav/appBar.vue +0 -1
- package/nav/drawer.vue +9 -7
- package/nav/drawerLabel.vue +1 -2
- package/package.json +1 -2
- package/plugins/vuetify.js +1 -1
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
|
-
|
|
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);
|
|
@@ -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"
|
|
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
|
-
:
|
|
6
|
-
|
|
7
|
-
@
|
|
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 || []"
|
|
5
|
-
:deletable-chips="spec.multiple" :multiple="spec.multiple" :readonly="spec.readOnly"
|
|
6
|
-
:hint="spec.hint" :placeholder="spec.placeholder"
|
|
7
|
-
:append-icon="append.icon" validate-on="blur"
|
|
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"
|
|
7
|
-
:label="fieldModel ? spec.onLabel || spec.label : spec.label" :true-icon="spec.onIcon"
|
|
8
|
-
:value="spec.value" :true-value="spec.checkValue" hide-details
|
|
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)
|
|
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
|
-
|
|
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"
|
|
4
|
-
:density="density" :hint="spec.hint" :maxlength="spec.maxLength || 255"
|
|
5
|
-
:disabled="inputDisabled" :type="config.type" :rules="rules"
|
|
6
|
-
:append-inner-icon="config.appendIcon" :prefix="spec.leftText"
|
|
7
|
-
:max="spec.max" :autofocus="spec.autoFocus || false" validate-on="blur"
|
|
8
|
-
@input="onChange" :variant="variant" persistent-placeholder
|
|
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
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>
|
package/nav/drawerLabel.vue
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glib-web",
|
|
3
|
-
"version": "3.20.
|
|
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",
|
package/plugins/vuetify.js
CHANGED
|
@@ -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';
|