@drax/crud-vue 3.2.0 → 3.3.0
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "3.
|
|
6
|
+
"version": "3.3.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@drax/common-front": "^3.0.0",
|
|
28
28
|
"@drax/crud-front": "^3.0.0",
|
|
29
29
|
"@drax/crud-share": "^3.2.0",
|
|
30
|
-
"@drax/media-vue": "^3.
|
|
30
|
+
"@drax/media-vue": "^3.3.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"pinia": "^3.0.4",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"vue-tsc": "^3.2.4",
|
|
51
51
|
"vuetify": "^3.11.8"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "fc2385eda786017691d453699801a2f342e5c538"
|
|
54
54
|
}
|
|
@@ -27,6 +27,7 @@ const {entity, multiple} = defineProps({
|
|
|
27
27
|
hint: {type: String},
|
|
28
28
|
persistentHint: {type: Boolean, default: false},
|
|
29
29
|
rules: {type: Array as PropType<any>, default: () => []},
|
|
30
|
+
onInput: {type: Function as PropType<Function>, required: false},
|
|
30
31
|
errorMessages: {type: Array as PropType<string[]>, default: () => []},
|
|
31
32
|
hideDetails: {type: Boolean, default: false},
|
|
32
33
|
singleLine: {type: Boolean, default: false},
|
|
@@ -128,11 +129,17 @@ defineEmits(['updateValue'])
|
|
|
128
129
|
:single-line="singleLine"
|
|
129
130
|
:clearable="clearable"
|
|
130
131
|
:error-messages="errorMessages"
|
|
131
|
-
@update:modelValue="
|
|
132
|
+
@update:modelValue="v => {
|
|
133
|
+
if(onInput && typeof onInput === 'function'){
|
|
134
|
+
onInput(v)
|
|
135
|
+
}
|
|
136
|
+
$emit('updateValue')
|
|
137
|
+
}"
|
|
132
138
|
:prepend-icon="prependIcon"
|
|
133
139
|
:append-icon="appendIcon"
|
|
134
140
|
:prepend-inner-icon="prependInnerIcon"
|
|
135
141
|
:append-inner-icon="appendInnerIcon"
|
|
142
|
+
@input="onInput"
|
|
136
143
|
>
|
|
137
144
|
|
|
138
145
|
<template v-if="addOnTheFly" v-slot:append>
|
|
@@ -185,11 +192,17 @@ defineEmits(['updateValue'])
|
|
|
185
192
|
:clearable="clearable"
|
|
186
193
|
:error-messages="errorMessages"
|
|
187
194
|
@update:search="debouncedSearch"
|
|
188
|
-
@update:modelValue="
|
|
195
|
+
@update:modelValue="v => {
|
|
196
|
+
if(onInput && typeof onInput === 'function'){
|
|
197
|
+
onInput(v)
|
|
198
|
+
}
|
|
199
|
+
$emit('updateValue')
|
|
200
|
+
}"
|
|
189
201
|
:prepend-icon="prependIcon"
|
|
190
202
|
:append-icon="appendIcon"
|
|
191
203
|
:prepend-inner-icon="prependInnerIcon"
|
|
192
204
|
:append-inner-icon="appendInnerIcon"
|
|
205
|
+
@input="onInput"
|
|
193
206
|
>
|
|
194
207
|
|
|
195
208
|
<template v-if="addOnTheFly" v-slot:append>
|
|
@@ -16,7 +16,6 @@ import MediaField from "@drax/media-vue/src/components/MediaField.vue";
|
|
|
16
16
|
import MediaFullField from "@drax/media-vue/src/components/MediaFullField.vue";
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
const {t, te} = useI18n()
|
|
21
20
|
|
|
22
21
|
const {hasPermission} = useAuth()
|
|
@@ -70,11 +69,10 @@ const label = computed(() => {
|
|
|
70
69
|
})
|
|
71
70
|
|
|
72
71
|
|
|
73
|
-
|
|
74
72
|
const storeErrorMessages = computed(() => {
|
|
75
73
|
let sIndex = (index != null && index >= 0) ? `${index}.` : ''
|
|
76
74
|
let name = parentField ? `${parentField}.${sIndex}${field.name}` : field.name
|
|
77
|
-
return store.getFieldInputErrors(name).map((error: string) =>te(error) ? t(error) : error)
|
|
75
|
+
return store.getFieldInputErrors(name).map((error: string) => te(error) ? t(error) : error)
|
|
78
76
|
}
|
|
79
77
|
)
|
|
80
78
|
|
|
@@ -85,10 +83,10 @@ const inputErrors = computed(() => {
|
|
|
85
83
|
defineEmits(['updateValue'])
|
|
86
84
|
|
|
87
85
|
|
|
88
|
-
const hasHideDetails = computed(()=>{
|
|
89
|
-
if(readonly){
|
|
86
|
+
const hasHideDetails = computed(() => {
|
|
87
|
+
if (readonly) {
|
|
90
88
|
return true
|
|
91
|
-
}else{
|
|
89
|
+
} else {
|
|
92
90
|
return hideDetails ?? field.hideDetails
|
|
93
91
|
}
|
|
94
92
|
|
|
@@ -148,8 +146,8 @@ const hasHideDetails = computed(()=>{
|
|
|
148
146
|
:append-icon="appendIcon"
|
|
149
147
|
:prepend-inner-icon="prependInnerIcon"
|
|
150
148
|
:append-inner-icon="appendInnerIcon"
|
|
151
|
-
@input="onInput"
|
|
152
149
|
@update:modelValue="$emit('updateValue')"
|
|
150
|
+
@input="onInput"
|
|
153
151
|
/>
|
|
154
152
|
|
|
155
153
|
<v-text-field
|
|
@@ -175,8 +173,8 @@ const hasHideDetails = computed(()=>{
|
|
|
175
173
|
:type="show ? 'text' : 'password'"
|
|
176
174
|
:append-inner-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
|
|
177
175
|
@click:append-inner="show = !show"
|
|
178
|
-
@input="onInput"
|
|
179
176
|
@update:modelValue="$emit('updateValue')"
|
|
177
|
+
@input="onInput"
|
|
180
178
|
/>
|
|
181
179
|
|
|
182
180
|
|
|
@@ -198,12 +196,17 @@ const hasHideDetails = computed(()=>{
|
|
|
198
196
|
:hide-details="hasHideDetails"
|
|
199
197
|
:single-line="singleLine"
|
|
200
198
|
:rules="rules"
|
|
201
|
-
@update:modelValue="
|
|
199
|
+
@update:modelValue="v => {
|
|
200
|
+
if(onInput && typeof onInput === 'function'){
|
|
201
|
+
onInput(v)
|
|
202
|
+
}
|
|
203
|
+
$emit('updateValue')
|
|
204
|
+
}"
|
|
202
205
|
:prepend-icon="prependIcon"
|
|
203
206
|
:append-icon="appendIcon"
|
|
204
207
|
:prepend-inner-icon="prependInnerIcon"
|
|
205
208
|
:append-inner-icon="appendInnerIcon"
|
|
206
|
-
|
|
209
|
+
@input="onInput"
|
|
207
210
|
>
|
|
208
211
|
</v-combobox>
|
|
209
212
|
|
|
@@ -227,12 +230,17 @@ const hasHideDetails = computed(()=>{
|
|
|
227
230
|
:hide-details="hasHideDetails"
|
|
228
231
|
:single-line="singleLine"
|
|
229
232
|
:rules="rules"
|
|
230
|
-
@update:modelValue="
|
|
233
|
+
@update:modelValue="v => {
|
|
234
|
+
if(onInput && typeof onInput === 'function'){
|
|
235
|
+
onInput(v)
|
|
236
|
+
}
|
|
237
|
+
$emit('updateValue')
|
|
238
|
+
}"
|
|
231
239
|
:prepend-icon="prependIcon"
|
|
232
240
|
:append-icon="appendIcon"
|
|
233
241
|
:prepend-inner-icon="prependInnerIcon"
|
|
234
242
|
:append-inner-icon="appendInnerIcon"
|
|
235
|
-
|
|
243
|
+
@input="onInput"
|
|
236
244
|
>
|
|
237
245
|
<template v-slot:item="{ props: itemProps, item }">
|
|
238
246
|
<v-list-item
|
|
@@ -246,7 +254,10 @@ const hasHideDetails = computed(()=>{
|
|
|
246
254
|
</template>
|
|
247
255
|
|
|
248
256
|
<template v-slot:selection="{item}">
|
|
249
|
-
<v-chip tile density="compact" :color="item.raw.color" :prepend-icon="item.raw.icon">{{
|
|
257
|
+
<v-chip tile density="compact" :color="item.raw.color" :prepend-icon="item.raw.icon">{{
|
|
258
|
+
item.raw.title
|
|
259
|
+
}}
|
|
260
|
+
</v-chip>
|
|
250
261
|
</template>
|
|
251
262
|
</v-select>
|
|
252
263
|
|
|
@@ -274,11 +285,11 @@ const hasHideDetails = computed(()=>{
|
|
|
274
285
|
:append-icon="appendIcon"
|
|
275
286
|
:prepend-inner-icon="prependInnerIcon"
|
|
276
287
|
:append-inner-icon="appendInnerIcon"
|
|
288
|
+
@input="onInput"
|
|
277
289
|
>
|
|
278
290
|
</v-select>
|
|
279
291
|
|
|
280
292
|
|
|
281
|
-
|
|
282
293
|
<v-text-field
|
|
283
294
|
v-if="field.type === 'number'"
|
|
284
295
|
type="number"
|
|
@@ -302,6 +313,7 @@ const hasHideDetails = computed(()=>{
|
|
|
302
313
|
:append-icon="appendIcon"
|
|
303
314
|
:prepend-inner-icon="prependInnerIcon"
|
|
304
315
|
:append-inner-icon="appendInnerIcon"
|
|
316
|
+
@input="onInput"
|
|
305
317
|
/>
|
|
306
318
|
|
|
307
319
|
<media-field
|
|
@@ -371,6 +383,7 @@ const hasHideDetails = computed(()=>{
|
|
|
371
383
|
:prepend-inner-icon="prependInnerIcon"
|
|
372
384
|
:append-inner-icon="appendInnerIcon"
|
|
373
385
|
color="primary"
|
|
386
|
+
@input="onInput"
|
|
374
387
|
/>
|
|
375
388
|
|
|
376
389
|
|
|
@@ -379,7 +392,8 @@ const hasHideDetails = computed(()=>{
|
|
|
379
392
|
:name="name"
|
|
380
393
|
:label="label"
|
|
381
394
|
:hint="hint ?? field.hint"
|
|
382
|
-
:persistent-hint="persistentHint ?? field.persistentHint" :placeholder="placeholder ?? field.placeholder"
|
|
395
|
+
:persistent-hint="persistentHint ?? field.persistentHint" :placeholder="placeholder ?? field.placeholder"
|
|
396
|
+
:persistent-placeholder="persistentPlaceholder ?? field.persistentPlaceholder"
|
|
383
397
|
v-model="valueModel"
|
|
384
398
|
:readonly="readonly"
|
|
385
399
|
:error-messages="inputErrors"
|
|
@@ -395,6 +409,9 @@ const hasHideDetails = computed(()=>{
|
|
|
395
409
|
date.setHours(23, 59, 59, 0)
|
|
396
410
|
valueModel = date
|
|
397
411
|
}
|
|
412
|
+
if(onInput && typeof onInput === 'function'){
|
|
413
|
+
onInput(v)
|
|
414
|
+
}
|
|
398
415
|
$emit('updateValue')
|
|
399
416
|
}"
|
|
400
417
|
@click:clear="() => {valueModel = null; $emit('updateValue');} "
|
|
@@ -403,6 +420,7 @@ const hasHideDetails = computed(()=>{
|
|
|
403
420
|
:prepend-inner-icon="prependInnerIcon"
|
|
404
421
|
:append-inner-icon="appendInnerIcon"
|
|
405
422
|
:max="field.max"
|
|
423
|
+
@input="onInput"
|
|
406
424
|
>
|
|
407
425
|
<template v-if="field.endOfDay && field.showEndOfDayChip !== false" v-slot:append-inner>
|
|
408
426
|
<v-chip size="small">23:59</v-chip>
|
|
@@ -435,6 +453,7 @@ const hasHideDetails = computed(()=>{
|
|
|
435
453
|
:prepend-inner-icon="prependInnerIcon"
|
|
436
454
|
:append-inner-icon="appendInnerIcon"
|
|
437
455
|
:add-on-the-fly="field?.addOnTheFly"
|
|
456
|
+
:on-input="onInput"
|
|
438
457
|
/>
|
|
439
458
|
|
|
440
459
|
<v-card v-if="field.type === 'object'" class="mt-3" variant="flat" border>
|
|
@@ -443,7 +462,7 @@ const hasHideDetails = computed(()=>{
|
|
|
443
462
|
<v-card-text>
|
|
444
463
|
|
|
445
464
|
<v-row dense>
|
|
446
|
-
<v-col cols="12"
|
|
465
|
+
<v-col cols="12" v-for="oField in field.objectFields">
|
|
447
466
|
<crud-form-field
|
|
448
467
|
|
|
449
468
|
:entity="entity"
|
|
@@ -491,11 +510,17 @@ const hasHideDetails = computed(()=>{
|
|
|
491
510
|
:hide-details="hasHideDetails"
|
|
492
511
|
:single-line="singleLine"
|
|
493
512
|
:rules="rules"
|
|
494
|
-
@update:modelValue="
|
|
513
|
+
@update:modelValue="v => {
|
|
514
|
+
if(onInput && typeof onInput === 'function'){
|
|
515
|
+
onInput(v)
|
|
516
|
+
}
|
|
517
|
+
$emit('updateValue')
|
|
518
|
+
}"
|
|
495
519
|
:prepend-icon="prependIcon"
|
|
496
520
|
:append-icon="appendIcon"
|
|
497
521
|
:prepend-inner-icon="prependInnerIcon"
|
|
498
522
|
:append-inner-icon="appendInnerIcon"
|
|
523
|
+
@input="onInput"
|
|
499
524
|
>
|
|
500
525
|
</v-combobox>
|
|
501
526
|
|
|
@@ -521,11 +546,17 @@ const hasHideDetails = computed(()=>{
|
|
|
521
546
|
:hide-details="hasHideDetails"
|
|
522
547
|
:single-line="singleLine"
|
|
523
548
|
:rules="rules"
|
|
524
|
-
@update:modelValue="
|
|
549
|
+
@update:modelValue="v => {
|
|
550
|
+
if(onInput && typeof onInput === 'function'){
|
|
551
|
+
onInput(v)
|
|
552
|
+
}
|
|
553
|
+
$emit('updateValue')
|
|
554
|
+
}"
|
|
525
555
|
:prepend-icon="prependIcon"
|
|
526
556
|
:append-icon="appendIcon"
|
|
527
557
|
:prepend-inner-icon="prependInnerIcon"
|
|
528
558
|
:append-inner-icon="appendInnerIcon"
|
|
559
|
+
@input="onInput"
|
|
529
560
|
>
|
|
530
561
|
</v-combobox>
|
|
531
562
|
|
|
@@ -557,6 +588,7 @@ const hasHideDetails = computed(()=>{
|
|
|
557
588
|
:prepend-inner-icon="prependInnerIcon"
|
|
558
589
|
:append-inner-icon="appendInnerIcon"
|
|
559
590
|
:add-on-the-fly="field?.addOnTheFly"
|
|
591
|
+
:on-input="onInput"
|
|
560
592
|
/>
|
|
561
593
|
|
|
562
594
|
|
|
@@ -569,7 +601,7 @@ const hasHideDetails = computed(()=>{
|
|
|
569
601
|
:persistent-hint="persistentHint ?? field.persistentHint"
|
|
570
602
|
:placeholder="placeholder ?? field.placeholder"
|
|
571
603
|
:persistent-placeholder="persistentPlaceholder ?? field.persistentPlaceholder"
|
|
572
|
-
v-model
|
|
604
|
+
v-model="valueModel"
|
|
573
605
|
:multiple="true"
|
|
574
606
|
:chips="true"
|
|
575
607
|
:readonly="readonly"
|
|
@@ -580,11 +612,17 @@ const hasHideDetails = computed(()=>{
|
|
|
580
612
|
:hide-details="hasHideDetails"
|
|
581
613
|
:single-line="singleLine"
|
|
582
614
|
:rules="rules"
|
|
583
|
-
@update:modelValue="
|
|
615
|
+
@update:modelValue="v => {
|
|
616
|
+
if(onInput && typeof onInput === 'function'){
|
|
617
|
+
onInput(v)
|
|
618
|
+
}
|
|
619
|
+
$emit('updateValue')
|
|
620
|
+
}"
|
|
584
621
|
:prepend-icon="prependIcon"
|
|
585
622
|
:append-icon="appendIcon"
|
|
586
623
|
:prepend-inner-icon="prependInnerIcon"
|
|
587
624
|
:append-inner-icon="appendInnerIcon"
|
|
625
|
+
@input="onInput"
|
|
588
626
|
>
|
|
589
627
|
</v-combobox>
|
|
590
628
|
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ import {useCrud} from "./composables/UseCrud";
|
|
|
17
17
|
import {useFilterIcon} from "./composables/UseFilterIcon";
|
|
18
18
|
import {useFormUtils} from "./composables/UseFormUtils";
|
|
19
19
|
import {useInputErrorI18n} from "./composables/UseInputErrorI18n";
|
|
20
|
-
import {EntityCrud} from "./EntityCrud";
|
|
20
|
+
import {EntityCrud} from "./cruds/EntityCrud";
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
export {
|
|
File without changes
|