@mythpe/quasar-ui-qui 0.3.30 → 0.3.32

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.3.30",
3
+ "version": "0.3.32",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -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="computedImageColumns.indexOf(col.name) !== -1">
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')"
@@ -651,6 +659,8 @@ defineExpose({
651
659
  <template v-else-if="computedUrlColumns.indexOf(col.name) !== -1">
652
660
  <MDtUrlColumn
653
661
  v-if="col.value !== undefined && col.value !== null"
662
+ :copy="computedCopyColumns.includes(col.name)"
663
+ :copy-value="col.copyValue && typeof col.copyValue === 'function' ? col.copyValue(iTempProps.row) : iTempProps.row[col.copyValue || col.field]"
654
664
  :value="col.value"
655
665
  @click="openWindow(col.value)"
656
666
  />
@@ -671,14 +681,6 @@ defineExpose({
671
681
  :value="col.value"
672
682
  />
673
683
  </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
684
  <template v-else-if="computedDescColumns.indexOf(col.name) !== -1">
683
685
  <MDtDescColumn
684
686
  :align="col.align as any || undefined"
@@ -1345,6 +1347,19 @@ defineExpose({
1345
1347
  </q-td>
1346
1348
  </slot>
1347
1349
  </template>
1350
+ <template
1351
+ v-for="copyCell in computedCopyColumns.filter(e => !computedSarColumns.includes(e))"
1352
+ :key="`copyCell-body-cell-${copyCell}`"
1353
+ #[`body-cell-${copyCell}`]="copyCellProps"
1354
+ >
1355
+ <q-td :props="copyCellProps">
1356
+ <MDtCopyColumn
1357
+ :align="copyCellProps.col.align as any || undefined"
1358
+ :label="copyCellProps.col.copyLabel && typeof copyCellProps.col.copyLabel === 'function' ? copyCellProps.col.copyLabel(copyCellProps.row) : copyCellProps.row[copyCellProps.col.copyLabel || copyCellProps.col.field]"
1359
+ :value="copyCellProps.col.copyValue && typeof copyCellProps.col.copyValue === 'function' ? copyCellProps.col.copyValue(copyCellProps.row) : copyCellProps.row[copyCellProps.col.copyValue || copyCellProps.col.field]"
1360
+ />
1361
+ </q-td>
1362
+ </template>
1348
1363
  <template
1349
1364
  v-for="imageCol in computedImageColumns"
1350
1365
  :key="`a-image-body-cell-${imageCol}`"
@@ -1368,6 +1383,8 @@ defineExpose({
1368
1383
  <q-td :props="urlProps">
1369
1384
  <MDtUrlColumn
1370
1385
  v-if="urlProps.row[urlProps.col.field] !== undefined && urlProps.row[urlProps.col.field] !== null"
1386
+ :copy="computedCopyColumns.includes(urlProps.col.name)"
1387
+ :copy-value="urlProps.col.copyValue && typeof urlProps.col.copyValue === 'function' ? urlProps.col.copyValue(urlProps.row) : urlProps.row[urlProps.col.copyValue || urlProps.col.field]"
1371
1388
  :value="urlProps.row[urlProps.col.field]"
1372
1389
  @click="openWindow(urlProps.row[urlProps.col.field])"
1373
1390
  />
@@ -1401,19 +1418,6 @@ defineExpose({
1401
1418
  />
1402
1419
  </q-td>
1403
1420
  </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
1421
  <template
1418
1422
  v-for="cdd in computedDescColumns"
1419
1423
  :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 />
@@ -15,8 +15,8 @@ import { computed } from 'vue'
15
15
 
16
16
  interface Props {
17
17
  value?: MDtSarColumnProps['value'];
18
- copyValue?: MDtSarColumnProps['copyValue'];
19
18
  copy?: boolean;
19
+ copyValue?: MDtSarColumnProps['copyValue'];
20
20
  align?: MDtSarColumnProps['align'];
21
21
  }
22
22
 
@@ -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 {