free-fe-core-modules 0.0.3 → 0.0.5
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/components/Basic/SummaryHead.vue +13 -2
- package/components/Dialog/BasicDialog.vue +11 -3
- package/components/SlidingCarousel/index.vue +13 -2
- package/components/SlidingNews/index.vue +13 -2
- package/composible/useFormValidator.js +56 -0
- package/free-field/Fields/AgreementCheck.js +6 -2
- package/free-field/Fields/Date.js +13 -5
- package/free-field/Fields/DateRange.js +14 -8
- package/free-field/Fields/DynamicList.js +33 -33
- package/free-field/Fields/FixedList.vue +9 -5
- package/free-field/Fields/Labels.vue +7 -1
- package/free-field/Fields/MixedTable.vue +9 -3
- package/free-field/Fields/Number.js +12 -6
- package/free-field/Fields/Password.js +12 -6
- package/free-field/Fields/PermissionEditor.vue +0 -1
- package/free-field/Fields/Search.vue +8 -2
- package/free-field/Fields/Select.vue +4 -1
- package/free-field/Fields/SelectionChain.vue +8 -2
- package/free-field/Fields/String.js +11 -5
- package/free-field/Fields/Text.js +12 -6
- package/free-field/Fields/Time.vue +8 -2
- package/free-field/Fields/TimeRange.vue +9 -3
- package/free-field/Fields/Year.js +12 -6
- package/free-field/Fields/YearRange.vue +9 -6
- package/free-field/Fields/index.js +12 -12
- package/free-field/composible/fieldWrapper.js +59 -51
- package/package.json +2 -2
- package/view/menu/index.vue +15 -11
- package/free-field/Fields/File.vue +0 -382
- package/free-field/Fields/FileList.vue +0 -405
- package/free-field/Fields/FileListCombined.vue +0 -142
- package/free-field/Fields/Image.vue +0 -328
- package/free-field/Fields/ImageList.vue +0 -285
- package/free-field/Fields/ImageListCombined.vue +0 -76
- package/free-field/Fields/UltimateFile.vue +0 -100
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
readonly
|
|
128
128
|
:class="`${Field && Field.Multiple
|
|
129
129
|
? '' : 'simple-field'} ${searchDisplay ? 'has-data' : 'empty'}`"
|
|
130
|
-
|
|
130
|
+
ref="fieldToValid"
|
|
131
131
|
@click="searchKey = '';searchData = {}; showSearch = true"
|
|
132
132
|
>
|
|
133
133
|
<template v-slot:prepend>
|
|
@@ -175,6 +175,7 @@
|
|
|
175
175
|
<script>
|
|
176
176
|
import { defineComponent } from 'vue';
|
|
177
177
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
178
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
178
179
|
|
|
179
180
|
export default defineComponent({
|
|
180
181
|
name: 'InputFieldSearch',
|
|
@@ -286,11 +287,16 @@ export default defineComponent({
|
|
|
286
287
|
],
|
|
287
288
|
Description: '',
|
|
288
289
|
},
|
|
289
|
-
setup(props) {
|
|
290
|
+
setup(props, { expose }) {
|
|
290
291
|
if (!props.Field) return {};
|
|
291
292
|
|
|
292
293
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
293
294
|
|
|
295
|
+
const { validate } = useFormValidator('fieldToValid');
|
|
296
|
+
expose({
|
|
297
|
+
validate,
|
|
298
|
+
})
|
|
299
|
+
|
|
294
300
|
return {
|
|
295
301
|
fieldData,
|
|
296
302
|
setFieldData,
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
emit-value
|
|
56
56
|
:multiple="Field.Multiple"
|
|
57
57
|
:readonly="Field.ReadOnly"
|
|
58
|
-
|
|
58
|
+
ref="fieldToValid"
|
|
59
59
|
:use-input="Field && Field.UseInput"
|
|
60
60
|
:use-chip="Field && Field.UseChip"
|
|
61
61
|
>
|
|
@@ -156,6 +156,7 @@
|
|
|
156
156
|
<script>
|
|
157
157
|
import { ref, computed, defineComponent, getCurrentInstance, watch, watchEffect } from 'vue';
|
|
158
158
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
159
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
159
160
|
|
|
160
161
|
export default defineComponent({
|
|
161
162
|
name: 'InputFieldSelect',
|
|
@@ -304,8 +305,10 @@ export default defineComponent({
|
|
|
304
305
|
return true;
|
|
305
306
|
};
|
|
306
307
|
|
|
308
|
+
const { validate } = useFormValidator('fieldToValid');
|
|
307
309
|
expose ({
|
|
308
310
|
selfValidate,
|
|
311
|
+
validate,
|
|
309
312
|
})
|
|
310
313
|
|
|
311
314
|
const checkChanged = (v) => {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
:label="valuesList[index] ? '' : option.Placeholder"
|
|
35
35
|
emit-value
|
|
36
36
|
@input="selectionChanged(index)"
|
|
37
|
-
|
|
37
|
+
ref="fieldsToValid"
|
|
38
38
|
></q-select>
|
|
39
39
|
</span>
|
|
40
40
|
<span v-if="Field && Field.ReadOnly">
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
<script>
|
|
57
57
|
import { defineComponent, ref, watch, getCurrentInstance, } from 'vue';
|
|
58
58
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
59
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
59
60
|
|
|
60
61
|
export default defineComponent({
|
|
61
62
|
name: 'InputFieldSelectChain',
|
|
@@ -113,7 +114,7 @@ export default defineComponent({
|
|
|
113
114
|
],
|
|
114
115
|
Description: '',
|
|
115
116
|
},
|
|
116
|
-
setup(props, { emit }) {
|
|
117
|
+
setup(props, { emit, expose }) {
|
|
117
118
|
if (!props.Field) return () => null;
|
|
118
119
|
|
|
119
120
|
const { proxy:vm } = getCurrentInstance();
|
|
@@ -202,6 +203,11 @@ export default defineComponent({
|
|
|
202
203
|
initOptions();
|
|
203
204
|
});
|
|
204
205
|
|
|
206
|
+
const { validate } = useFormValidator('fieldsToValid');
|
|
207
|
+
expose ({
|
|
208
|
+
validate,
|
|
209
|
+
})
|
|
210
|
+
|
|
205
211
|
return {
|
|
206
212
|
fieldData,
|
|
207
213
|
setFieldData,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, h } from 'vue';
|
|
1
|
+
import { defineComponent, h, computed } from 'vue';
|
|
2
2
|
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
3
3
|
import { QInput } from 'quasar';
|
|
4
4
|
import ReadonlyContent from '../composible/readonlyContent';
|
|
5
5
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
6
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
6
7
|
|
|
7
8
|
export default defineComponent({
|
|
8
9
|
name: 'InputFieldString',
|
|
@@ -51,7 +52,7 @@ export default defineComponent({
|
|
|
51
52
|
methods: {
|
|
52
53
|
...useFreeFieldMethods,
|
|
53
54
|
},
|
|
54
|
-
setup(props, { emit, slots }){
|
|
55
|
+
setup(props, { emit, slots, expose }){
|
|
55
56
|
if (!props.Field) return {};
|
|
56
57
|
|
|
57
58
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
@@ -73,7 +74,7 @@ export default defineComponent({
|
|
|
73
74
|
class: 'postfix',
|
|
74
75
|
}, props.Field.Options?.Postfix));
|
|
75
76
|
|
|
76
|
-
const inputNode = () => h(QInput, {
|
|
77
|
+
const inputNode = computed(() => h(QInput, {
|
|
77
78
|
maxlength: props.Field.Options?.MaxLength,
|
|
78
79
|
autocomplete: 'off',
|
|
79
80
|
// bottomSlots: true,
|
|
@@ -93,12 +94,17 @@ export default defineComponent({
|
|
|
93
94
|
before,
|
|
94
95
|
prepend,
|
|
95
96
|
append,
|
|
96
|
-
});
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
const { validate } = useFormValidator(inputNode);
|
|
100
|
+
expose({
|
|
101
|
+
validate,
|
|
102
|
+
})
|
|
97
103
|
|
|
98
104
|
return () => h('div', {
|
|
99
105
|
class: 'simple-field input-field-string row items-center no-wrap',
|
|
100
106
|
}, [
|
|
101
|
-
props.Field.ReadOnly ? readonlyNode() : inputNode
|
|
107
|
+
props.Field.ReadOnly ? readonlyNode() : inputNode.value,
|
|
102
108
|
slots.warning && slots.warning(),
|
|
103
109
|
]);
|
|
104
110
|
},
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, h, ref, watchEffect } from 'vue';
|
|
2
|
-
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
1
|
+
import { defineComponent, h, ref, watchEffect, computed } from 'vue';
|
|
3
2
|
import { QInput } from 'quasar';
|
|
3
|
+
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
4
4
|
import ReadonlyContent from '../composible/readonlyContent';
|
|
5
5
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
6
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
6
7
|
|
|
7
8
|
export default defineComponent({
|
|
8
9
|
name: 'InputFieldText',
|
|
@@ -26,7 +27,7 @@ export default defineComponent({
|
|
|
26
27
|
methods: {
|
|
27
28
|
...useFreeFieldMethods,
|
|
28
29
|
},
|
|
29
|
-
setup(props, { emit, slots }){
|
|
30
|
+
setup(props, { emit, slots, expose }){
|
|
30
31
|
if (!props.Field) return {};
|
|
31
32
|
|
|
32
33
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
@@ -48,7 +49,7 @@ export default defineComponent({
|
|
|
48
49
|
Field: props.Field,
|
|
49
50
|
});
|
|
50
51
|
|
|
51
|
-
const inputNode = () => h(QInput, {
|
|
52
|
+
const inputNode = computed(() => h(QInput, {
|
|
52
53
|
type: 'textarea',
|
|
53
54
|
maxlength: props.Field.Options?.MaxLength,
|
|
54
55
|
hideBottomSpace: true,
|
|
@@ -66,7 +67,12 @@ export default defineComponent({
|
|
|
66
67
|
},
|
|
67
68
|
}, {
|
|
68
69
|
before,
|
|
69
|
-
});
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
const { validate } = useFormValidator(inputNode);
|
|
73
|
+
expose ({
|
|
74
|
+
validate,
|
|
75
|
+
})
|
|
70
76
|
|
|
71
77
|
return () => h('div', {
|
|
72
78
|
class: 'input-field-text',
|
|
@@ -74,7 +80,7 @@ export default defineComponent({
|
|
|
74
80
|
slots.warning && h('div', {
|
|
75
81
|
class: props.Field.Label ? 'warning-with-label' : 'warning-without-label',
|
|
76
82
|
}, slots.warning()),
|
|
77
|
-
props.Field.ReadOnly ? readonlyNode() : inputNode
|
|
83
|
+
props.Field.ReadOnly ? readonlyNode() : inputNode.value,
|
|
78
84
|
]);
|
|
79
85
|
},
|
|
80
86
|
});
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<q-input v-else v-model="fieldData.value" hide-bottom-space
|
|
15
15
|
:readonly="Field.ReadOnly"
|
|
16
16
|
@input="$emit('input')"
|
|
17
|
-
|
|
17
|
+
ref="fieldToValid">
|
|
18
18
|
<template v-slot:before v-if="Field.Label !== void 0">
|
|
19
19
|
<span
|
|
20
20
|
:class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
<script>
|
|
57
57
|
import { computed, defineComponent, getCurrentInstance } from 'vue';
|
|
58
58
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
59
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
59
60
|
|
|
60
61
|
export default defineComponent({
|
|
61
62
|
name: 'InputFieldTime',
|
|
@@ -91,7 +92,7 @@ export default defineComponent({
|
|
|
91
92
|
...freeFieldProps,
|
|
92
93
|
},
|
|
93
94
|
emits:['input'],
|
|
94
|
-
setup(props, { emit }) {
|
|
95
|
+
setup(props, { emit, expose }) {
|
|
95
96
|
if (!props.Field) return () => null;
|
|
96
97
|
|
|
97
98
|
const { proxy:vm } = getCurrentInstance();
|
|
@@ -158,6 +159,11 @@ export default defineComponent({
|
|
|
158
159
|
};
|
|
159
160
|
});
|
|
160
161
|
|
|
162
|
+
const { validate } = useFormValidator('fieldToValid');
|
|
163
|
+
expose ({
|
|
164
|
+
validate,
|
|
165
|
+
})
|
|
166
|
+
|
|
161
167
|
return {
|
|
162
168
|
fieldData,
|
|
163
169
|
locale,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
v-model="min"
|
|
28
28
|
hide-bottom-space
|
|
29
29
|
:readonly="Field.ReadOnly"
|
|
30
|
-
|
|
30
|
+
ref="input_field_validator_first"
|
|
31
31
|
>
|
|
32
32
|
<q-popup-proxy
|
|
33
33
|
v-if="!Field.ReadOnly"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
v-model="max"
|
|
63
63
|
hide-bottom-space
|
|
64
64
|
:readonly="Field.ReadOnly"
|
|
65
|
-
|
|
65
|
+
ref="input_field_validator_second"
|
|
66
66
|
>
|
|
67
67
|
<q-popup-proxy
|
|
68
68
|
v-if="!Field.ReadOnly"
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
<script>
|
|
99
99
|
import { defineComponent, ref, getCurrentInstance } from 'vue';
|
|
100
100
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
101
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
101
102
|
|
|
102
103
|
export default defineComponent({
|
|
103
104
|
name: 'InputFieldTimeRange',
|
|
@@ -155,7 +156,7 @@ export default defineComponent({
|
|
|
155
156
|
],
|
|
156
157
|
Description: '',
|
|
157
158
|
},
|
|
158
|
-
setup(props, { emit }) {
|
|
159
|
+
setup(props, { emit, expose }) {
|
|
159
160
|
if (!props.Field) return () => null;
|
|
160
161
|
|
|
161
162
|
const { proxy:vm } = getCurrentInstance();
|
|
@@ -342,6 +343,11 @@ export default defineComponent({
|
|
|
342
343
|
};
|
|
343
344
|
});
|
|
344
345
|
|
|
346
|
+
const { validate } = useFormValidator('input_field_validator_first', 'input_field_validator_second');
|
|
347
|
+
expose ({
|
|
348
|
+
validate,
|
|
349
|
+
})
|
|
350
|
+
|
|
345
351
|
return {
|
|
346
352
|
fieldData,
|
|
347
353
|
locale,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
1
|
+
import { defineComponent, h, computed } from 'vue';
|
|
3
2
|
import { QSelect } from 'quasar';
|
|
3
|
+
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
4
4
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
5
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
5
6
|
|
|
6
7
|
export default defineComponent({
|
|
7
8
|
name: 'InputFieldYear',
|
|
@@ -74,7 +75,7 @@ export default defineComponent({
|
|
|
74
75
|
methods: {
|
|
75
76
|
...useFreeFieldMethods,
|
|
76
77
|
},
|
|
77
|
-
setup(props, { emit, slots }){
|
|
78
|
+
setup(props, { emit, slots, expose }){
|
|
78
79
|
if (!props.Field) return {};
|
|
79
80
|
|
|
80
81
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
@@ -107,7 +108,7 @@ export default defineComponent({
|
|
|
107
108
|
return options;
|
|
108
109
|
});
|
|
109
110
|
|
|
110
|
-
const selectNode = () => h(QSelect, {
|
|
111
|
+
const selectNode = computed(() => h(QSelect, {
|
|
111
112
|
hideBottomSpace: true,
|
|
112
113
|
readonly: props.Field?.ReadOnly,
|
|
113
114
|
'map-options': true,
|
|
@@ -125,12 +126,17 @@ export default defineComponent({
|
|
|
125
126
|
},
|
|
126
127
|
}, {
|
|
127
128
|
before,
|
|
128
|
-
});
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
const { validate } = useFormValidator(selectNode);
|
|
132
|
+
expose ({
|
|
133
|
+
validate,
|
|
134
|
+
})
|
|
129
135
|
|
|
130
136
|
return () => h('div', {
|
|
131
137
|
class: 'simple-field input-field-year row items-center no-wrap',
|
|
132
138
|
}, [
|
|
133
|
-
selectNode
|
|
139
|
+
selectNode.value,
|
|
134
140
|
slots.warning && slots.warning(),
|
|
135
141
|
]);
|
|
136
142
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
:options="minYearOptions"
|
|
20
20
|
:readonly="Field.ReadOnly"
|
|
21
21
|
@input="rangeChanged"
|
|
22
|
-
|
|
22
|
+
ref="input_field_validator_first"
|
|
23
23
|
>
|
|
24
24
|
<template v-slot:before v-if="Field.Label !== void 0">
|
|
25
25
|
<span
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
:options="maxYearOptions"
|
|
40
40
|
:readonly="Field.ReadOnly"
|
|
41
41
|
@input="rangeChanged"
|
|
42
|
-
|
|
42
|
+
ref="input_field_validator_second"
|
|
43
43
|
/>
|
|
44
44
|
</span>
|
|
45
45
|
|
|
@@ -48,8 +48,9 @@
|
|
|
48
48
|
</template>
|
|
49
49
|
|
|
50
50
|
<script>
|
|
51
|
-
import { defineComponent, ref
|
|
51
|
+
import { defineComponent, ref } from 'vue';
|
|
52
52
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
53
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
53
54
|
|
|
54
55
|
export default defineComponent({
|
|
55
56
|
name: 'InputFieldYearRange',
|
|
@@ -85,11 +86,9 @@ export default defineComponent({
|
|
|
85
86
|
...freeFieldProps,
|
|
86
87
|
},
|
|
87
88
|
emits:['input'],
|
|
88
|
-
setup(props, { emit }) {
|
|
89
|
+
setup(props, { emit, expose }) {
|
|
89
90
|
if (!props.Field) return () => null;
|
|
90
91
|
|
|
91
|
-
const { proxy:vm } = getCurrentInstance();
|
|
92
|
-
|
|
93
92
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
94
93
|
|
|
95
94
|
const min = ref('');
|
|
@@ -163,6 +162,10 @@ export default defineComponent({
|
|
|
163
162
|
return options;
|
|
164
163
|
});
|
|
165
164
|
|
|
165
|
+
const { validate } = useFormValidator('input_field_validator_first', 'input_field_validator_second');
|
|
166
|
+
expose ({
|
|
167
|
+
validate,
|
|
168
|
+
})
|
|
166
169
|
|
|
167
170
|
return {
|
|
168
171
|
fieldData,
|
|
@@ -17,10 +17,10 @@ import fYear from './Year.js';
|
|
|
17
17
|
import fYearRange from './YearRange.vue';
|
|
18
18
|
import fRadioList from './RadioList.vue';
|
|
19
19
|
import fBoolean from './Boolean.js';
|
|
20
|
-
import fFile from './File.vue';
|
|
21
|
-
import fFileList from './FileList.vue';
|
|
22
|
-
import fImage from './Image.vue';
|
|
23
|
-
import fImageList from './ImageList.vue';
|
|
20
|
+
// import fFile from './File.vue';
|
|
21
|
+
// import fFileList from './FileList.vue';
|
|
22
|
+
// import fImage from './Image.vue';
|
|
23
|
+
// import fImageList from './ImageList.vue';
|
|
24
24
|
import fFixedList from './FixedList.vue';
|
|
25
25
|
import fDynamicList from './DynamicList.js';
|
|
26
26
|
import fSingleList from './SingleList.vue';
|
|
@@ -32,8 +32,8 @@ import fCustomize from './Customize.js';
|
|
|
32
32
|
import fAgreementCheck from './AgreementCheck.js';
|
|
33
33
|
import fSeparator from './Separator.js';
|
|
34
34
|
import fQueryFilters from './QueryFilters.vue';
|
|
35
|
-
import fFileListCombined from './FileListCombined.vue';
|
|
36
|
-
import fImageListCombined from './ImageListCombined.vue';
|
|
35
|
+
// import fFileListCombined from './FileListCombined.vue';
|
|
36
|
+
// import fImageListCombined from './ImageListCombined.vue';
|
|
37
37
|
import fApiCall from './ApiCall.js';
|
|
38
38
|
|
|
39
39
|
export default {
|
|
@@ -56,10 +56,10 @@ export default {
|
|
|
56
56
|
YearRange: fYearRange,
|
|
57
57
|
RadioList: fRadioList,
|
|
58
58
|
Boolean: fBoolean,
|
|
59
|
-
File: fFile,
|
|
60
|
-
FileList: fFileList,
|
|
61
|
-
Image: fImage,
|
|
62
|
-
ImageList: fImageList,
|
|
59
|
+
// File: fFile,
|
|
60
|
+
// FileList: fFileList,
|
|
61
|
+
// Image: fImage,
|
|
62
|
+
// ImageList: fImageList,
|
|
63
63
|
FixedList: fFixedList,
|
|
64
64
|
DynamicList: fDynamicList,
|
|
65
65
|
SingleList: fSingleList,
|
|
@@ -71,8 +71,8 @@ export default {
|
|
|
71
71
|
AgreementCheck: fAgreementCheck,
|
|
72
72
|
Separator: fSeparator,
|
|
73
73
|
QueryFilters: fQueryFilters,
|
|
74
|
-
FileListCombined: fFileListCombined,
|
|
75
|
-
ImageListCombined: fImageListCombined,
|
|
74
|
+
// FileListCombined: fFileListCombined,
|
|
75
|
+
// ImageListCombined: fImageListCombined,
|
|
76
76
|
ApiCall: fApiCall,
|
|
77
77
|
// Static: () => import('./Static.vue'),
|
|
78
78
|
// Select: () => import('./Select.vue'),
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getCurrentInstance,
|
|
4
4
|
h,
|
|
5
5
|
ref,
|
|
6
|
-
|
|
6
|
+
shallowRef,
|
|
7
7
|
watchEffect,
|
|
8
8
|
computed,
|
|
9
9
|
onMounted,
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
isRef,
|
|
12
12
|
} from "vue";
|
|
13
13
|
import { freeFieldProps } from "./useFreeField";
|
|
14
|
+
import { useFormValidator } from '../../composible/useFormValidator';
|
|
15
|
+
|
|
14
16
|
|
|
15
17
|
export default defineComponent({
|
|
16
18
|
name: "FreeFieldWrapper",
|
|
@@ -111,7 +113,7 @@ export default defineComponent({
|
|
|
111
113
|
return props.Field.Hidden;
|
|
112
114
|
});
|
|
113
115
|
|
|
114
|
-
let realComponent =
|
|
116
|
+
let realComponent = shallowRef(null);
|
|
115
117
|
|
|
116
118
|
watchEffect(() => {
|
|
117
119
|
const fComponents = vm.ctx.FieldComponents || {};
|
|
@@ -131,7 +133,7 @@ export default defineComponent({
|
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
135
|
|
|
134
|
-
realComponent = field;
|
|
136
|
+
realComponent.value = field;
|
|
135
137
|
});
|
|
136
138
|
|
|
137
139
|
if (props.Field && props.Field.Info && props.Field.Info.KeepChanged) {
|
|
@@ -153,20 +155,23 @@ export default defineComponent({
|
|
|
153
155
|
const warningSlot = (!props.noWarning && localField.value.Warning)
|
|
154
156
|
&& h('span', {
|
|
155
157
|
class: 'input-field-warning no-wrap',
|
|
156
|
-
},
|
|
158
|
+
},
|
|
159
|
+
[
|
|
157
160
|
h('span', { class: 'input-field-warning-icon' }),
|
|
158
161
|
h('span', { class: 'input-field-warning-icon-sign-top' }),
|
|
159
162
|
h('span', { class: 'input-field-warning-icon-sign-dot' }),
|
|
160
163
|
h('span', { class: 'input-field-warning-text ellipsis' }, localField.value.Warning),
|
|
161
|
-
]
|
|
164
|
+
]
|
|
165
|
+
);
|
|
162
166
|
|
|
163
|
-
if (realComponent) {
|
|
164
|
-
const compEmits = {};
|
|
165
|
-
(realComponent.emits || []).forEach((em) => {
|
|
166
|
-
if (!em || em === 'input') return;
|
|
167
167
|
|
|
168
|
+
const compEmits = ref({});
|
|
169
|
+
watchEffect(() => {
|
|
170
|
+
(realComponent?.value?.emits || []).forEach((em) => {
|
|
171
|
+
if (!em || em === 'input') return;
|
|
172
|
+
|
|
168
173
|
const captEm = `${em[0].toUpperCase()}${em.substring(1)}`;
|
|
169
|
-
compEmits[`on${captEm}`] = (...args) => {
|
|
174
|
+
compEmits.value[`on${captEm}`] = (...args) => {
|
|
170
175
|
// should not emit event directly as we were not inlucde these events in the emits list
|
|
171
176
|
// but we could get any matched handller from the parent component and then call that
|
|
172
177
|
// handller directly
|
|
@@ -176,46 +181,49 @@ export default defineComponent({
|
|
|
176
181
|
outerHandller(...args);
|
|
177
182
|
}
|
|
178
183
|
};
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
"
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
184
|
+
});
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
const readComp = computed(() => realComponent.value && h(
|
|
188
|
+
realComponent.value,
|
|
189
|
+
{
|
|
190
|
+
Field: localField.value,
|
|
191
|
+
values: props.values,
|
|
192
|
+
style: shouldHide.value ? "display:none;" : "",
|
|
193
|
+
class: [
|
|
194
|
+
props.Field.ReadOnly ? "free-field--readonly" : "",
|
|
195
|
+
!shouldHide.value && hasError.value ? "hasError" : "",
|
|
196
|
+
],
|
|
197
|
+
onInput: () => {
|
|
198
|
+
emit("input", props.Field);
|
|
199
|
+
},
|
|
200
|
+
...compEmits,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
...slots,
|
|
204
|
+
warning: slots.warning ? slots.warning : () => warningSlot,
|
|
205
|
+
}
|
|
206
|
+
));
|
|
207
|
+
|
|
208
|
+
// const emitsRef = computed(() => realComponent?.value?.emits);
|
|
209
|
+
|
|
210
|
+
const {
|
|
211
|
+
validate,
|
|
212
|
+
} = useFormValidator(readComp);
|
|
213
|
+
|
|
214
|
+
expose ({
|
|
215
|
+
// emits: emitsRef.value,
|
|
216
|
+
validate: () => validate.value(props.Field.Name),
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
return realComponent.value ? () => h(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
class: wrapperClass,
|
|
223
|
+
},
|
|
224
|
+
[
|
|
225
|
+
readComp.value,
|
|
226
|
+
]
|
|
227
|
+
) : () => null;
|
|
220
228
|
},
|
|
221
229
|
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "free-fe-core-modules",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": "git@gitlab.com:eis-base/modules/free-fe-core-modules.git",
|
|
6
6
|
"author": "zhiquan",
|
|
7
7
|
"license": "UNLICENSED",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@tinymce/tinymce-vue": "^5.0.
|
|
9
|
+
"@tinymce/tinymce-vue": "^5.0.1"
|
|
10
10
|
}
|
|
11
11
|
}
|
package/view/menu/index.vue
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
:key="fIndex"
|
|
57
57
|
:values="editingMenu"
|
|
58
58
|
:Field="field"
|
|
59
|
-
|
|
59
|
+
ref="refsToValid"
|
|
60
60
|
></free-field>
|
|
61
61
|
|
|
62
62
|
<div class="action-btns full-width row justify-center q-gutter-md">
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
</template>
|
|
87
87
|
|
|
88
88
|
<script>
|
|
89
|
-
import { defineComponent } from 'vue';
|
|
89
|
+
import { defineComponent, ref } from 'vue';
|
|
90
90
|
import { useObjectData, objectDataProps } from '../../composible/useObjectData';
|
|
91
|
+
import { useFormValidator } from '../../composible/useFormValidator';
|
|
91
92
|
|
|
92
93
|
export default defineComponent({
|
|
93
94
|
name: 'MenuPage',
|
|
94
|
-
mixins: [mixins.InputFieldValidator],
|
|
95
95
|
props: {
|
|
96
96
|
...objectDataProps,
|
|
97
97
|
addMenu: { type: Function, default: () => { } },
|
|
@@ -99,24 +99,28 @@ export default defineComponent({
|
|
|
99
99
|
deleteMenu: { type: Function, default: () => { } },
|
|
100
100
|
},
|
|
101
101
|
setup(props, ctx) {
|
|
102
|
+
const selectedMenuNode = ref({});
|
|
103
|
+
const editingMenu = ref({});
|
|
104
|
+
const menuFields = ref([]);
|
|
105
|
+
|
|
102
106
|
const {
|
|
103
107
|
data,
|
|
104
108
|
refreshData,
|
|
105
109
|
} = useObjectData(props, ctx);
|
|
106
110
|
|
|
111
|
+
const {
|
|
112
|
+
validate,
|
|
113
|
+
} = useFormValidator('refsToValid');
|
|
114
|
+
|
|
107
115
|
return {
|
|
116
|
+
selectedMenuNode,
|
|
117
|
+
editingMenu,
|
|
118
|
+
menuFields,
|
|
108
119
|
data,
|
|
109
120
|
refreshData,
|
|
121
|
+
validate,
|
|
110
122
|
};
|
|
111
123
|
},
|
|
112
|
-
data() {
|
|
113
|
-
return {
|
|
114
|
-
selectedMenuNode: {},
|
|
115
|
-
editingMenu: {},
|
|
116
|
-
menuFields: [],
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
watch: {},
|
|
120
124
|
created() {
|
|
121
125
|
this.menuFields = this.getModule('core-modules').config.menuFields;
|
|
122
126
|
|