@mythpe/quasar-ui-qui 0.3.29 → 0.3.31
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 +1 -1
- package/src/components/datatable/MDatatable.vue +24 -22
- package/src/components/datatable/MDtCopyColumn.vue +4 -3
- package/src/components/datatable/MDtSarColumn.vue +1 -1
- package/src/components/datatable/MDtUrlColumn.vue +29 -2
- package/src/components/form/MHiddenInput.vue +1 -0
- package/src/types/m-datatable.d.ts +3 -0
package/package.json
CHANGED
|
@@ -639,7 +639,15 @@ defineExpose({
|
|
|
639
639
|
:auto="col.name !== controlKey"
|
|
640
640
|
:class="`overflow-hidden ${col.name === controlKey ? 'text-right col-12 q-pb-xs' : ''}`"
|
|
641
641
|
>
|
|
642
|
-
<template v-if="
|
|
642
|
+
<template v-if="computedCopyColumns.indexOf(col.name) !== -1">
|
|
643
|
+
<MDtCopyColumn
|
|
644
|
+
v-if="col.value !== undefined && col.value !== null"
|
|
645
|
+
:align="col.align as any || undefined"
|
|
646
|
+
:label="col.value"
|
|
647
|
+
:value="col.copyValue && typeof col.copyValue === 'function' ? col.copyValue(iTempProps.row) : iTempProps.row[col.copyValue || col.field]"
|
|
648
|
+
/>
|
|
649
|
+
</template>
|
|
650
|
+
<template v-else-if="computedImageColumns.indexOf(col.name) !== -1">
|
|
643
651
|
<MDtImageColumn
|
|
644
652
|
v-if="col.value !== undefined && col.value !== null"
|
|
645
653
|
:image-mode="getProp('imageMode')"
|
|
@@ -671,14 +679,6 @@ defineExpose({
|
|
|
671
679
|
:value="col.value"
|
|
672
680
|
/>
|
|
673
681
|
</template>
|
|
674
|
-
<template v-else-if="computedCopyColumns.indexOf(col.name) !== -1">
|
|
675
|
-
<MDtCopyColumn
|
|
676
|
-
v-if="col.value !== undefined && col.value !== null"
|
|
677
|
-
:align="col.align as any || undefined"
|
|
678
|
-
:label="col.value"
|
|
679
|
-
:value="col.copyValue && typeof col.copyValue === 'function' ? col.copyValue(iTempProps.row) : iTempProps.row[col.copyValue || col.field]"
|
|
680
|
-
/>
|
|
681
|
-
</template>
|
|
682
682
|
<template v-else-if="computedDescColumns.indexOf(col.name) !== -1">
|
|
683
683
|
<MDtDescColumn
|
|
684
684
|
:align="col.align as any || undefined"
|
|
@@ -1345,6 +1345,19 @@ defineExpose({
|
|
|
1345
1345
|
</q-td>
|
|
1346
1346
|
</slot>
|
|
1347
1347
|
</template>
|
|
1348
|
+
<template
|
|
1349
|
+
v-for="copyCell in computedCopyColumns.filter(e => !computedSarColumns.includes(e))"
|
|
1350
|
+
:key="`copyCell-body-cell-${copyCell}`"
|
|
1351
|
+
#[`body-cell-${copyCell}`]="copyCellProps"
|
|
1352
|
+
>
|
|
1353
|
+
<q-td :props="copyCellProps">
|
|
1354
|
+
<MDtCopyColumn
|
|
1355
|
+
:align="copyCellProps.col.align as any || undefined"
|
|
1356
|
+
:label="copyCellProps.col.copyLabel && typeof copyCellProps.col.copyLabel === 'function' ? copyCellProps.col.copyLabel(copyCellProps.row) : copyCellProps.row[copyCellProps.col.copyLabel || copyCellProps.col.field]"
|
|
1357
|
+
:value="copyCellProps.col.copyValue && typeof copyCellProps.col.copyValue === 'function' ? copyCellProps.col.copyValue(copyCellProps.row) : copyCellProps.row[copyCellProps.col.copyValue || copyCellProps.col.field]"
|
|
1358
|
+
/>
|
|
1359
|
+
</q-td>
|
|
1360
|
+
</template>
|
|
1348
1361
|
<template
|
|
1349
1362
|
v-for="imageCol in computedImageColumns"
|
|
1350
1363
|
:key="`a-image-body-cell-${imageCol}`"
|
|
@@ -1368,6 +1381,8 @@ defineExpose({
|
|
|
1368
1381
|
<q-td :props="urlProps">
|
|
1369
1382
|
<MDtUrlColumn
|
|
1370
1383
|
v-if="urlProps.row[urlProps.col.field] !== undefined && urlProps.row[urlProps.col.field] !== null"
|
|
1384
|
+
:copy="computedCopyColumns.includes(urlProps.col.name)"
|
|
1385
|
+
:copy-value="urlProps.col.copyValue && typeof urlProps.col.copyValue === 'function' ? urlProps.col.copyValue(urlProps.row) : urlProps.row[urlProps.col.copyValue || urlProps.col.field]"
|
|
1371
1386
|
:value="urlProps.row[urlProps.col.field]"
|
|
1372
1387
|
@click="openWindow(urlProps.row[urlProps.col.field])"
|
|
1373
1388
|
/>
|
|
@@ -1401,19 +1416,6 @@ defineExpose({
|
|
|
1401
1416
|
/>
|
|
1402
1417
|
</q-td>
|
|
1403
1418
|
</template>
|
|
1404
|
-
<template
|
|
1405
|
-
v-for="copyCell in computedCopyColumns.filter(e => !computedSarColumns.includes(e))"
|
|
1406
|
-
:key="`copyCell-body-cell-${copyCell}`"
|
|
1407
|
-
#[`body-cell-${copyCell}`]="copyCellProps"
|
|
1408
|
-
>
|
|
1409
|
-
<q-td :props="copyCellProps">
|
|
1410
|
-
<MDtCopyColumn
|
|
1411
|
-
:align="copyCellProps.col.align as any || undefined"
|
|
1412
|
-
:label="copyCellProps.col.copyLabel && typeof copyCellProps.col.copyLabel === 'function' ? copyCellProps.col.copyLabel(copyCellProps.row) : copyCellProps.row[copyCellProps.col.copyLabel || copyCellProps.col.field]"
|
|
1413
|
-
:value="copyCellProps.col.copyValue && typeof copyCellProps.col.copyValue === 'function' ? copyCellProps.col.copyValue(copyCellProps.row) : copyCellProps.row[copyCellProps.col.copyValue || copyCellProps.col.field]"
|
|
1414
|
-
/>
|
|
1415
|
-
</q-td>
|
|
1416
|
-
</template>
|
|
1417
1419
|
<template
|
|
1418
1420
|
v-for="cdd in computedDescColumns"
|
|
1419
1421
|
:key="`a-cdd-body-cell-${cdd}`"
|
|
@@ -19,6 +19,7 @@ interface Props {
|
|
|
19
19
|
width?: MDtCopyColumnProps['width'];
|
|
20
20
|
sar?: MDtCopyColumnProps['sar'];
|
|
21
21
|
align?: MDtCopyColumnProps['align'];
|
|
22
|
+
tooltip?: MDtCopyColumnProps['align'];
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const props = defineProps<Props>()
|
|
@@ -56,13 +57,13 @@ defineOptions({
|
|
|
56
57
|
/>
|
|
57
58
|
<MDtSarColumn
|
|
58
59
|
v-if="!!sar"
|
|
59
|
-
:value="label
|
|
60
|
+
:value="label || ''"
|
|
60
61
|
/>
|
|
61
62
|
<template v-else>
|
|
62
|
-
{{ label
|
|
63
|
+
{{ label || '' }}
|
|
63
64
|
</template>
|
|
64
65
|
<q-tooltip>
|
|
65
|
-
{{ value }}
|
|
66
|
+
{{ tooltip || value }}
|
|
66
67
|
</q-tooltip>
|
|
67
68
|
</div>
|
|
68
69
|
<slot />
|
|
@@ -8,12 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
<script lang="ts" setup>
|
|
10
10
|
|
|
11
|
-
import type { MDtUrlColumnProps } from '../../types'
|
|
11
|
+
import type { MDtSarColumnProps, MDtUrlColumnProps } from '../../types'
|
|
12
|
+
import MDtCopyColumn from './MDtCopyColumn.vue'
|
|
13
|
+
import { useMyth } from '../../composable'
|
|
12
14
|
|
|
13
15
|
interface Props {
|
|
14
16
|
value?: MDtUrlColumnProps['value'];
|
|
17
|
+
copy?: boolean;
|
|
18
|
+
copyValue?: MDtSarColumnProps['copyValue'];
|
|
15
19
|
}
|
|
16
20
|
|
|
21
|
+
const { __ } = useMyth()
|
|
17
22
|
defineProps<Props>()
|
|
18
23
|
type Emits = {
|
|
19
24
|
(e: 'click', evt?: Event): void;
|
|
@@ -26,8 +31,30 @@ defineOptions({
|
|
|
26
31
|
</script>
|
|
27
32
|
|
|
28
33
|
<template>
|
|
34
|
+
<template v-if="copy">
|
|
35
|
+
<MDtCopyColumn
|
|
36
|
+
:copy-value="copyValue"
|
|
37
|
+
:tooltip="__('labels.copy_url')"
|
|
38
|
+
:value="value"
|
|
39
|
+
>
|
|
40
|
+
<q-btn
|
|
41
|
+
v-if="!!value"
|
|
42
|
+
dense
|
|
43
|
+
fab-mini
|
|
44
|
+
flat
|
|
45
|
+
icon="ion-ios-open"
|
|
46
|
+
v-bind="$attrs"
|
|
47
|
+
@click="emit('click',$event)"
|
|
48
|
+
>
|
|
49
|
+
<slot />
|
|
50
|
+
<q-tooltip>
|
|
51
|
+
{{ __('labels.open_url') }}
|
|
52
|
+
</q-tooltip>
|
|
53
|
+
</q-btn>
|
|
54
|
+
</MDtCopyColumn>
|
|
55
|
+
</template>
|
|
29
56
|
<q-btn
|
|
30
|
-
v-if="!!value"
|
|
57
|
+
v-else-if="!!value"
|
|
31
58
|
dense
|
|
32
59
|
fab-mini
|
|
33
60
|
flat
|
|
@@ -389,6 +389,7 @@ export interface MDtCopyColumnProps {
|
|
|
389
389
|
width?: string | number;
|
|
390
390
|
sar?: boolean;
|
|
391
391
|
align?: 'left' | 'right' | 'center';
|
|
392
|
+
tooltip?: any;
|
|
392
393
|
}
|
|
393
394
|
|
|
394
395
|
export interface MDtCopyColumnSlots {
|
|
@@ -439,6 +440,8 @@ export interface MDtSarColumnSlots {
|
|
|
439
440
|
|
|
440
441
|
export interface MDtUrlColumnProps {
|
|
441
442
|
value?: any;
|
|
443
|
+
copy?: boolean;
|
|
444
|
+
copyValue?: any;
|
|
442
445
|
}
|
|
443
446
|
|
|
444
447
|
export interface MDtUrlColumnSlots {
|