free-fe-core-modules 0.0.4 → 0.0.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/components/Basic/BreadCrumbs.vue +18 -9
- package/components/Basic/LeveledMenus.vue +13 -5
- package/components/Basic/SummaryHead.vue +5 -2
- package/components/Dialog/BasicDialog.vue +14 -3
- package/components/FloatingWindow/index.vue +9 -1
- package/components/SlidingCarousel/index.vue +5 -2
- package/components/SlidingNews/index.vue +33 -24
- package/composible/useFormValidator.js +56 -0
- package/free-field/Fields/AgreementCheck.js +6 -2
- package/free-field/Fields/Category.js +2 -1
- package/free-field/Fields/Check.js +1 -0
- package/free-field/Fields/Date.js +13 -5
- package/free-field/Fields/DateRange.js +14 -8
- package/free-field/Fields/DynamicList.js +36 -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/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 +13 -5
- package/free-field/Fields/Year.js +12 -6
- package/free-field/Fields/YearRange.vue +9 -6
- package/free-field/composible/fieldWrapper.js +59 -51
- package/free-field/composible/freeFieldLabel.js +10 -3
- package/index.js +123 -78
- package/package.json +1 -1
- package/view/dict/index.vue +85 -1
- package/view/menu/index.vue +15 -11
- package/view/mourning/mourning.vue +17 -12
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ref, defineComponent, getCurrentInstance, h, computed, watchEffect } from 'vue';
|
|
2
|
-
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
3
2
|
import { QTable, QTh, QTd, QTr, QIcon } from 'quasar';
|
|
3
|
+
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
4
4
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
5
5
|
import FreeField from '../composible/fieldWrapper';
|
|
6
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
6
7
|
|
|
7
8
|
export default defineComponent({
|
|
8
9
|
name: 'InputFieldDynamicList',
|
|
@@ -424,10 +425,16 @@ export default defineComponent({
|
|
|
424
425
|
}
|
|
425
426
|
};
|
|
426
427
|
|
|
428
|
+
const fieldsToValidate = ref([]);
|
|
429
|
+
const {
|
|
430
|
+
validate
|
|
431
|
+
} = useFormValidator(fieldsToValidate);
|
|
432
|
+
|
|
427
433
|
expose({
|
|
428
434
|
selected,
|
|
429
435
|
addRow,
|
|
430
436
|
deleteRow,
|
|
437
|
+
validate,
|
|
431
438
|
})
|
|
432
439
|
|
|
433
440
|
watchEffect(() => {
|
|
@@ -456,6 +463,27 @@ export default defineComponent({
|
|
|
456
463
|
);
|
|
457
464
|
|
|
458
465
|
const bodyCell = (slotProps) => {
|
|
466
|
+
const fields = ref([]);
|
|
467
|
+
fields.value = slotProps.col?.List?.length > 1 ? slotProps.col.List.map((col) =>
|
|
468
|
+
h(FreeField, {
|
|
469
|
+
Field: columnField(col, true, slotProps.col),
|
|
470
|
+
values: slotProps.row,
|
|
471
|
+
style: "margin: 4px auto",
|
|
472
|
+
onInput: cellChanged,
|
|
473
|
+
})
|
|
474
|
+
) : [
|
|
475
|
+
h(FreeField, {
|
|
476
|
+
Field: columnField(slotProps.col),
|
|
477
|
+
values: slotProps.row,
|
|
478
|
+
borderless: true,
|
|
479
|
+
onInput: cellChanged,
|
|
480
|
+
}),
|
|
481
|
+
];
|
|
482
|
+
|
|
483
|
+
// add fields from the current cell to validate list
|
|
484
|
+
fieldsToValidate.value.push(...fields.value);
|
|
485
|
+
|
|
486
|
+
|
|
459
487
|
if (slotProps.col.name === "listActions") {
|
|
460
488
|
return h(QTd, null, {
|
|
461
489
|
default: () =>
|
|
@@ -480,38 +508,13 @@ export default defineComponent({
|
|
|
480
508
|
rowspan: slotProps.value ? slotProps.value.rowspan || "1" : "1",
|
|
481
509
|
class: "items-center justify-center",
|
|
482
510
|
},
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
},
|
|
491
|
-
slotProps.col.List.map((col) =>
|
|
492
|
-
h(FreeField, {
|
|
493
|
-
Field: columnField(col, true, slotProps.col),
|
|
494
|
-
values: slotProps.row,
|
|
495
|
-
style: "margin: 4px auto",
|
|
496
|
-
onInput: cellChanged,
|
|
497
|
-
})
|
|
498
|
-
)
|
|
499
|
-
)
|
|
500
|
-
: h(
|
|
501
|
-
"span",
|
|
502
|
-
{
|
|
503
|
-
class: "full-height full-width defClass",
|
|
504
|
-
},
|
|
505
|
-
[
|
|
506
|
-
h(FreeField, {
|
|
507
|
-
Field: columnField(slotProps.col),
|
|
508
|
-
values: slotProps.row,
|
|
509
|
-
borderless: true,
|
|
510
|
-
onInput: cellChanged,
|
|
511
|
-
}),
|
|
512
|
-
]
|
|
513
|
-
),
|
|
514
|
-
}
|
|
511
|
+
() => h(
|
|
512
|
+
"span",
|
|
513
|
+
{
|
|
514
|
+
class: "full-height full-width",
|
|
515
|
+
},
|
|
516
|
+
fields.value,
|
|
517
|
+
)
|
|
515
518
|
);
|
|
516
519
|
}
|
|
517
520
|
};
|
|
@@ -45,8 +45,7 @@
|
|
|
45
45
|
:Field="columnField(col, true, props.col)"
|
|
46
46
|
:values="props.row"
|
|
47
47
|
@input="cellChanged()"
|
|
48
|
-
|
|
49
|
-
columnField(col, true, props.col).Name}-${index}-${props.row.auto__index}`"
|
|
48
|
+
ref="fieldsToValid"
|
|
50
49
|
></free-field>
|
|
51
50
|
</span>
|
|
52
51
|
<span v-else class="full-width full-height">
|
|
@@ -55,8 +54,7 @@
|
|
|
55
54
|
:values="props.row"
|
|
56
55
|
@input="cellChanged()"
|
|
57
56
|
borderless
|
|
58
|
-
|
|
59
|
-
columnField(props.col, false).Name}-${props.row.auto__index}`"
|
|
57
|
+
ref="fieldToValid"
|
|
60
58
|
></free-field>
|
|
61
59
|
</span>
|
|
62
60
|
</q-td>
|
|
@@ -74,6 +72,7 @@
|
|
|
74
72
|
<script>
|
|
75
73
|
import { defineComponent, watchEffect, ref, computed } from 'vue';
|
|
76
74
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
75
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
77
76
|
|
|
78
77
|
export default defineComponent({
|
|
79
78
|
name: 'InputFieldFixedList',
|
|
@@ -205,7 +204,7 @@ export default defineComponent({
|
|
|
205
204
|
props: {
|
|
206
205
|
...freeFieldProps,
|
|
207
206
|
},
|
|
208
|
-
setup(props, { emit }) {
|
|
207
|
+
setup(props, { emit, expose }) {
|
|
209
208
|
if (!props.Field) return {};
|
|
210
209
|
|
|
211
210
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
@@ -341,6 +340,11 @@ export default defineComponent({
|
|
|
341
340
|
setFieldData(tableData.value, emit);
|
|
342
341
|
};
|
|
343
342
|
|
|
343
|
+
const { validate } = useFormValidator('fieldsToValid', 'fieldToValid')
|
|
344
|
+
expose({
|
|
345
|
+
validate,
|
|
346
|
+
})
|
|
347
|
+
|
|
344
348
|
return {
|
|
345
349
|
fieldData,
|
|
346
350
|
tableData,
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
<script>
|
|
88
88
|
import { defineComponent } from 'vue';
|
|
89
89
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
90
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
90
91
|
|
|
91
92
|
export default defineComponent({
|
|
92
93
|
name: 'InputFieldLabels',
|
|
@@ -114,9 +115,14 @@ export default defineComponent({
|
|
|
114
115
|
newLabel: '',
|
|
115
116
|
};
|
|
116
117
|
},
|
|
117
|
-
setup(props) {
|
|
118
|
+
setup(props, { expose }) {
|
|
118
119
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
119
120
|
|
|
121
|
+
const { validate } = useFormValidator('input_field_validator_label');
|
|
122
|
+
expose({
|
|
123
|
+
validate,
|
|
124
|
+
});
|
|
125
|
+
|
|
120
126
|
return {
|
|
121
127
|
fieldData,
|
|
122
128
|
setFieldData,
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
:Field="{...f, ReadOnly: Field.ReadOnly || f.ReadOnly}"
|
|
55
55
|
:values="fieldData.value"
|
|
56
56
|
@input="cellChanged(f)"
|
|
57
|
-
|
|
57
|
+
ref="fieldsToValid"
|
|
58
58
|
></free-field>
|
|
59
59
|
</span>
|
|
60
60
|
<span
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
:values="fieldData.value"
|
|
67
67
|
@input="cellChanged(r[rk].List[0])"
|
|
68
68
|
borderless
|
|
69
|
-
|
|
69
|
+
ref="fieldToValid"
|
|
70
70
|
></free-field>
|
|
71
71
|
</span>
|
|
72
72
|
</q-td>
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
<script>
|
|
92
92
|
import { computed, defineComponent } from 'vue';
|
|
93
93
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
94
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
94
95
|
|
|
95
96
|
export default defineComponent({
|
|
96
97
|
name: 'InputFieldMixedTable',
|
|
@@ -271,7 +272,7 @@ export default defineComponent({
|
|
|
271
272
|
props: {
|
|
272
273
|
...freeFieldProps,
|
|
273
274
|
},
|
|
274
|
-
setup(props, { emit }) {
|
|
275
|
+
setup(props, { emit, expose }) {
|
|
275
276
|
if (!props.Field) return () => null;
|
|
276
277
|
|
|
277
278
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
@@ -342,6 +343,11 @@ export default defineComponent({
|
|
|
342
343
|
return summaryText;
|
|
343
344
|
});
|
|
344
345
|
|
|
346
|
+
const { validate } = useFormValidator('fieldsToValid', 'fieldToValid');
|
|
347
|
+
expose({
|
|
348
|
+
validate,
|
|
349
|
+
});
|
|
350
|
+
|
|
345
351
|
return {
|
|
346
352
|
fieldData,
|
|
347
353
|
setFieldData,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, h, watch } from 'vue';
|
|
2
|
-
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
1
|
+
import { defineComponent, h, watch, 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: 'InputFieldNumber',
|
|
@@ -95,7 +96,7 @@ export default defineComponent({
|
|
|
95
96
|
methods: {
|
|
96
97
|
...useFreeFieldMethods,
|
|
97
98
|
},
|
|
98
|
-
setup(props, { emit, slots }){
|
|
99
|
+
setup(props, { emit, slots , expose }){
|
|
99
100
|
if (!props.Field) return {};
|
|
100
101
|
|
|
101
102
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
@@ -134,7 +135,7 @@ export default defineComponent({
|
|
|
134
135
|
class: 'postfix',
|
|
135
136
|
}, props.Field.Options?.Postfix));
|
|
136
137
|
|
|
137
|
-
const inputNode = () => h(QInput, {
|
|
138
|
+
const inputNode = computed(() => h(QInput, {
|
|
138
139
|
type: 'number',
|
|
139
140
|
maxlength: props.Field.Options?.MaxLength,
|
|
140
141
|
autocomplete: 'off',
|
|
@@ -155,12 +156,17 @@ export default defineComponent({
|
|
|
155
156
|
before,
|
|
156
157
|
prepend,
|
|
157
158
|
append,
|
|
158
|
-
});
|
|
159
|
+
}));
|
|
160
|
+
|
|
161
|
+
const { validate } = useFormValidator(inputNode);
|
|
162
|
+
expose({
|
|
163
|
+
validate,
|
|
164
|
+
})
|
|
159
165
|
|
|
160
166
|
return () => h('div', {
|
|
161
167
|
class: 'simple-field input-field-number row items-center no-wrap',
|
|
162
168
|
}, [
|
|
163
|
-
props.Field.ReadOnly ? readonlyNode() : inputNode
|
|
169
|
+
props.Field.ReadOnly ? readonlyNode() : inputNode.value,
|
|
164
170
|
slots.warning && slots.warning(),
|
|
165
171
|
]);
|
|
166
172
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent, h, ref } from 'vue';
|
|
2
|
-
import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
|
|
1
|
+
import { defineComponent, h, ref, computed } from 'vue';
|
|
3
2
|
import { QInput, QIcon } 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: 'InputFieldPassword',
|
|
@@ -31,7 +32,7 @@ export default defineComponent({
|
|
|
31
32
|
methods: {
|
|
32
33
|
...useFreeFieldMethods,
|
|
33
34
|
},
|
|
34
|
-
setup(props, { emit, slots }){
|
|
35
|
+
setup(props, { emit, slots, expose }){
|
|
35
36
|
if (!props.Field) return {};
|
|
36
37
|
|
|
37
38
|
const { fieldData, setFieldData } = useFreeField(props);
|
|
@@ -49,7 +50,7 @@ export default defineComponent({
|
|
|
49
50
|
},
|
|
50
51
|
});
|
|
51
52
|
|
|
52
|
-
const inputNode = () => h(QInput, {
|
|
53
|
+
const inputNode = () => computed(h(QInput, {
|
|
53
54
|
type: isPwd.value ? 'password' : 'text',
|
|
54
55
|
maxlength: props.Field.Options?.MaxLength,
|
|
55
56
|
autocomplete: props.Field.Options?.autocomplete ? '' : 'new-password',
|
|
@@ -69,12 +70,17 @@ export default defineComponent({
|
|
|
69
70
|
}, {
|
|
70
71
|
before,
|
|
71
72
|
append,
|
|
72
|
-
});
|
|
73
|
+
}));
|
|
74
|
+
|
|
75
|
+
const { validate } = useFormValidator(inputNode);
|
|
76
|
+
expose({
|
|
77
|
+
validate,
|
|
78
|
+
})
|
|
73
79
|
|
|
74
80
|
return () => h('div', {
|
|
75
81
|
class: 'simple-field input-field-password row items-center no-wrap',
|
|
76
82
|
}, [
|
|
77
|
-
inputNode
|
|
83
|
+
inputNode.value,
|
|
78
84
|
slots.warning && slots.warning(),
|
|
79
85
|
]);
|
|
80
86
|
},
|
|
@@ -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"
|
|
@@ -96,8 +96,9 @@
|
|
|
96
96
|
</template>
|
|
97
97
|
|
|
98
98
|
<script>
|
|
99
|
-
import { defineComponent, ref, getCurrentInstance } from 'vue';
|
|
99
|
+
import { defineComponent, ref, getCurrentInstance, watch, watchEffect, computed } 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();
|
|
@@ -299,7 +300,7 @@ export default defineComponent({
|
|
|
299
300
|
const objOptions = computed(() => props.Field.Options || undefined);
|
|
300
301
|
|
|
301
302
|
const timeOptions = computed(() => {
|
|
302
|
-
if (objOptions.
|
|
303
|
+
if (objOptions.value) return undefined;
|
|
303
304
|
|
|
304
305
|
if (!props.Field.MinValue && !props.Field.MaxValue) {
|
|
305
306
|
return undefined;
|
|
@@ -342,7 +343,14 @@ 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 {
|
|
352
|
+
min,
|
|
353
|
+
max,
|
|
346
354
|
fieldData,
|
|
347
355
|
locale,
|
|
348
356
|
|
|
@@ -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
|
},
|