@mythpe/quasar-ui-qui 0.2.54 → 0.2.55
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 +57 -148
- package/src/components/datatable/MDtColorColumn.vue +46 -0
- package/src/components/datatable/MDtCopyColumn.vue +55 -0
- package/src/components/datatable/MDtImageColumn.vue +79 -0
- package/src/components/datatable/MDtSarColumn.vue +32 -0
- package/src/components/datatable/MDtUrlColumn.vue +43 -0
- package/src/components/datatable/index.ts +14 -1
- package/src/plugin/defineAsyncComponents.ts +5 -0
- package/src/types/components.d.ts +25 -1
- package/src/types/m-datatable.d.ts +77 -16
package/package.json
CHANGED
|
@@ -17,6 +17,11 @@ import { computed, onMounted, ref, toValue, watch } from 'vue'
|
|
|
17
17
|
import { is as quasarHelpers, QCardSection, QTable, useQuasar } from 'quasar'
|
|
18
18
|
import { useDtHelpers, useMyth } from '../../composable'
|
|
19
19
|
import { useI18n } from 'vue-i18n'
|
|
20
|
+
import MDtImageColumn from './MDtImageColumn.vue'
|
|
21
|
+
import MDtUrlColumn from './MDtUrlColumn.vue'
|
|
22
|
+
import MDtColorColumn from './MDtColorColumn.vue'
|
|
23
|
+
import MDtSarColumn from './MDtSarColumn.vue'
|
|
24
|
+
import MDtCopyColumn from './MDtCopyColumn.vue'
|
|
20
25
|
|
|
21
26
|
type Props = {
|
|
22
27
|
controlKey?: MDatatableProps['controlKey'];
|
|
@@ -80,6 +85,7 @@ type Props = {
|
|
|
80
85
|
urlColumns?: MDatatableProps['urlColumns'];
|
|
81
86
|
colorColumns?: MDatatableProps['colorColumns'];
|
|
82
87
|
sarColumns?: MDatatableProps['sarColumns'];
|
|
88
|
+
copyColumns?: MDatatableProps['copyColumns'];
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -136,14 +142,15 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
136
142
|
bordered: undefined,
|
|
137
143
|
flat: undefined,
|
|
138
144
|
fixed: undefined,
|
|
139
|
-
imageColumns:
|
|
140
|
-
imageMode:
|
|
141
|
-
imageSize:
|
|
145
|
+
imageColumns: undefined,
|
|
146
|
+
imageMode: 'image',
|
|
147
|
+
imageSize: '35px',
|
|
142
148
|
noBackBtn: !1,
|
|
143
149
|
backIcon: undefined,
|
|
144
|
-
urlColumns:
|
|
145
|
-
colorColumns:
|
|
146
|
-
sarColumns:
|
|
150
|
+
urlColumns: undefined,
|
|
151
|
+
colorColumns: undefined,
|
|
152
|
+
sarColumns: undefined,
|
|
153
|
+
copyColumns: undefined
|
|
147
154
|
})
|
|
148
155
|
|
|
149
156
|
interface Emits {
|
|
@@ -161,8 +168,7 @@ const {
|
|
|
161
168
|
props: pluginOptions,
|
|
162
169
|
theme,
|
|
163
170
|
isSmall,
|
|
164
|
-
openWindow
|
|
165
|
-
copyText
|
|
171
|
+
openWindow
|
|
166
172
|
} = useMyth()
|
|
167
173
|
|
|
168
174
|
const $q = useQuasar()
|
|
@@ -372,9 +378,11 @@ const onInvalidSubmit: InvalidSubmissionHandler = ({ errors }) => {
|
|
|
372
378
|
}
|
|
373
379
|
}
|
|
374
380
|
const defaultSubmitItem = handleSubmit.withControlled(onSuccess, onInvalidSubmit)
|
|
375
|
-
const
|
|
376
|
-
const
|
|
377
|
-
const
|
|
381
|
+
const imageColumnsProp = computed<string[]>(() => toValue(props.imageColumns || []))
|
|
382
|
+
const urlColumnsProp = computed<string[]>(() => toValue(props.urlColumns || []))
|
|
383
|
+
const colorColumnsProp = computed<string[]>(() => toValue(props.colorColumns || []))
|
|
384
|
+
const sarColumnsProp = computed<string[]>(() => toValue(props.sarColumns || []))
|
|
385
|
+
const copyColumnsProp = computed<string[]>(() => toValue(props.copyColumns || []))
|
|
378
386
|
onMounted(() => refresh())
|
|
379
387
|
watch(loading, v => {
|
|
380
388
|
if (pluginOptions.value?.dt?.useQuasarLoading) {
|
|
@@ -564,82 +572,28 @@ defineExpose({
|
|
|
564
572
|
:auto="col.name !== controlKey"
|
|
565
573
|
:class="`overflow-hidden ${col.name === controlKey ? 'text-right col-12 q-pb-xs' : ''}`"
|
|
566
574
|
>
|
|
567
|
-
<template v-if="
|
|
568
|
-
<
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
icon="ion-ios-eye"
|
|
575
|
-
@click="openImageDialog(col.value)"
|
|
576
|
-
>
|
|
577
|
-
<q-tooltip class="m-dt-btn-tooltip">
|
|
578
|
-
{{ __('myth.titles.show') }}
|
|
579
|
-
</q-tooltip>
|
|
580
|
-
</q-btn>
|
|
581
|
-
</template>
|
|
582
|
-
<template v-else-if="getProp('imageMode') === 'image'">
|
|
583
|
-
<q-avatar :size="getProp('imageSize')">
|
|
584
|
-
<q-img
|
|
585
|
-
v-if="col.value"
|
|
586
|
-
:src="col.value"
|
|
587
|
-
:style="`width: ${getProp('imageSize')}; height: ${getProp('imageSize')}`"
|
|
588
|
-
class="cursor-pointer"
|
|
589
|
-
fit="contain"
|
|
590
|
-
no-spinner
|
|
591
|
-
@click="openImageDialog(col.value)"
|
|
592
|
-
>
|
|
593
|
-
<q-tooltip class="m-dt-btn-tooltip">
|
|
594
|
-
{{ __('myth.titles.show') }}
|
|
595
|
-
</q-tooltip>
|
|
596
|
-
</q-img>
|
|
597
|
-
<q-icon
|
|
598
|
-
v-else
|
|
599
|
-
:size="getProp('imageSize')"
|
|
600
|
-
name="ion-ios-aperture"
|
|
601
|
-
/>
|
|
602
|
-
</q-avatar>
|
|
603
|
-
</template>
|
|
575
|
+
<template v-if="imageColumnsProp.indexOf(col.name) !== -1">
|
|
576
|
+
<MDtImageColumn
|
|
577
|
+
:image-mode="getProp('imageMode')"
|
|
578
|
+
:image-size="getProp('imageSize')"
|
|
579
|
+
:value="col.value"
|
|
580
|
+
@click="openImageDialog(col.value)"
|
|
581
|
+
/>
|
|
604
582
|
</template>
|
|
605
583
|
<template v-else-if="urlColumnsProp.indexOf(col.name) !== -1">
|
|
606
|
-
<
|
|
607
|
-
|
|
608
|
-
dense
|
|
609
|
-
fab-mini
|
|
610
|
-
flat
|
|
611
|
-
icon="ion-ios-open"
|
|
584
|
+
<MDtUrlColumn
|
|
585
|
+
:value="col.value"
|
|
612
586
|
@click="openWindow(col.value)"
|
|
613
|
-
|
|
614
|
-
<q-tooltip>
|
|
615
|
-
{{ col.value }}
|
|
616
|
-
</q-tooltip>
|
|
617
|
-
</MBtn>
|
|
587
|
+
/>
|
|
618
588
|
</template>
|
|
619
589
|
<template v-else-if="colorColumnsProp.indexOf(col.name) !== -1">
|
|
620
|
-
<
|
|
621
|
-
v-if="!!col.value"
|
|
622
|
-
class="row q-gutter-lg justify-center items-center"
|
|
623
|
-
>
|
|
624
|
-
<div>
|
|
625
|
-
{{ col.value }}
|
|
626
|
-
</div>
|
|
627
|
-
<div
|
|
628
|
-
:style="`width: 20px; height: 20px; background-color: ${col.value};`"
|
|
629
|
-
class="m-input__color-preview cursor-pointer"
|
|
630
|
-
@click="copyText(col.value)"
|
|
631
|
-
>
|
|
632
|
-
<q-tooltip>{{ __('labels.copy') }}</q-tooltip>
|
|
633
|
-
</div>
|
|
634
|
-
</div>
|
|
590
|
+
<MDtColorColumn :color="col.value" />
|
|
635
591
|
</template>
|
|
636
592
|
<template v-else-if="sarColumnsProp.indexOf(col.name) !== -1">
|
|
637
|
-
<
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
<MSarString :text="col.value||'0.00'" />
|
|
642
|
-
</div>
|
|
593
|
+
<MDtSarColumn :value="col.value" />
|
|
594
|
+
</template>
|
|
595
|
+
<template v-else-if="copyColumnsProp.indexOf(col.name) !== -1">
|
|
596
|
+
<MDtCopyColumn :value="col.value" />
|
|
643
597
|
</template>
|
|
644
598
|
<template v-else-if="col.name === controlKey">
|
|
645
599
|
<MRow
|
|
@@ -1065,7 +1019,7 @@ defineExpose({
|
|
|
1065
1019
|
>
|
|
1066
1020
|
<q-chip
|
|
1067
1021
|
clickable
|
|
1068
|
-
color="
|
|
1022
|
+
color="body"
|
|
1069
1023
|
icon-remove="clear"
|
|
1070
1024
|
outline
|
|
1071
1025
|
removable
|
|
@@ -1170,48 +1124,17 @@ defineExpose({
|
|
|
1170
1124
|
</slot>
|
|
1171
1125
|
</template>
|
|
1172
1126
|
<template
|
|
1173
|
-
v-for="c in
|
|
1127
|
+
v-for="c in imageColumnsProp"
|
|
1174
1128
|
:key="`a-c-${c}`"
|
|
1175
1129
|
#[`body-cell-${c}`]="colProps"
|
|
1176
1130
|
>
|
|
1177
1131
|
<q-td :props="colProps">
|
|
1178
|
-
<
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
flat
|
|
1185
|
-
icon="ion-ios-eye"
|
|
1186
|
-
@click="openImageDialog(colProps.row[c])"
|
|
1187
|
-
>
|
|
1188
|
-
<q-tooltip class="m-dt-btn-tooltip">
|
|
1189
|
-
{{ __('myth.titles.show') }}
|
|
1190
|
-
</q-tooltip>
|
|
1191
|
-
</q-btn>
|
|
1192
|
-
</template>
|
|
1193
|
-
<template v-else-if="getProp('imageMode') === 'image'">
|
|
1194
|
-
<q-avatar :size="getProp('imageSize')">
|
|
1195
|
-
<q-img
|
|
1196
|
-
v-if="colProps.row[c]"
|
|
1197
|
-
:src="colProps.row[c]"
|
|
1198
|
-
:style="`width: ${getProp('imageSize')}; height: ${getProp('imageSize')}`"
|
|
1199
|
-
class="cursor-pointer"
|
|
1200
|
-
fit="contain"
|
|
1201
|
-
no-spinner
|
|
1202
|
-
@click="openImageDialog(colProps.row[c])"
|
|
1203
|
-
>
|
|
1204
|
-
<q-tooltip class="m-dt-btn-tooltip">
|
|
1205
|
-
{{ __('myth.titles.show') }}
|
|
1206
|
-
</q-tooltip>
|
|
1207
|
-
</q-img>
|
|
1208
|
-
<q-icon
|
|
1209
|
-
v-else
|
|
1210
|
-
:size="getProp('imageSize')"
|
|
1211
|
-
name="ion-ios-aperture"
|
|
1212
|
-
/>
|
|
1213
|
-
</q-avatar>
|
|
1214
|
-
</template>
|
|
1132
|
+
<MDtImageColumn
|
|
1133
|
+
:image-mode="getProp('imageMode')"
|
|
1134
|
+
:image-size="getProp('imageSize')"
|
|
1135
|
+
:value="colProps.row[c]"
|
|
1136
|
+
@click="openImageDialog(colProps.row[c])"
|
|
1137
|
+
/>
|
|
1215
1138
|
</q-td>
|
|
1216
1139
|
</template>
|
|
1217
1140
|
<template
|
|
@@ -1220,19 +1143,10 @@ defineExpose({
|
|
|
1220
1143
|
#[`body-cell-${u}`]="urlProps"
|
|
1221
1144
|
>
|
|
1222
1145
|
<q-td :props="urlProps">
|
|
1223
|
-
<
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
flat
|
|
1228
|
-
icon="ion-ios-open"
|
|
1229
|
-
@click="openWindow(urlProps.row[u])"
|
|
1230
|
-
>
|
|
1231
|
-
<q-tooltip>
|
|
1232
|
-
{{ urlProps.row[u] }}
|
|
1233
|
-
</q-tooltip>
|
|
1234
|
-
</MBtn>
|
|
1235
|
-
</template>
|
|
1146
|
+
<MDtUrlColumn
|
|
1147
|
+
:value="urlProps.row[u]"
|
|
1148
|
+
@click="openWindow(urlProps.row[u])"
|
|
1149
|
+
/>
|
|
1236
1150
|
</q-td>
|
|
1237
1151
|
</template>
|
|
1238
1152
|
<template
|
|
@@ -1241,21 +1155,7 @@ defineExpose({
|
|
|
1241
1155
|
#[`body-cell-${cc}`]="ccProps"
|
|
1242
1156
|
>
|
|
1243
1157
|
<q-td :props="ccProps">
|
|
1244
|
-
<
|
|
1245
|
-
v-if="!!ccProps.row[cc]"
|
|
1246
|
-
class="row q-gutter-lg justify-center items-center"
|
|
1247
|
-
>
|
|
1248
|
-
<div>
|
|
1249
|
-
{{ ccProps.row[cc] }}
|
|
1250
|
-
</div>
|
|
1251
|
-
<div
|
|
1252
|
-
:style="`width: 20px; height: 20px; background-color: ${ccProps.row[cc]};`"
|
|
1253
|
-
class="m-input__color-preview cursor-pointer"
|
|
1254
|
-
@click="copyText(ccProps.row[cc])"
|
|
1255
|
-
>
|
|
1256
|
-
<q-tooltip>{{ __('labels.copy') }}</q-tooltip>
|
|
1257
|
-
</div>
|
|
1258
|
-
</div>
|
|
1158
|
+
<MDtColorColumn :color="ccProps.row[cc]" />
|
|
1259
1159
|
</q-td>
|
|
1260
1160
|
</template>
|
|
1261
1161
|
<template
|
|
@@ -1264,7 +1164,16 @@ defineExpose({
|
|
|
1264
1164
|
#[`body-cell-${sr}`]="srProps"
|
|
1265
1165
|
>
|
|
1266
1166
|
<q-td :props="srProps">
|
|
1267
|
-
<
|
|
1167
|
+
<MDtSarColumn :value="srProps.row[sr]" />
|
|
1168
|
+
</q-td>
|
|
1169
|
+
</template>
|
|
1170
|
+
<template
|
|
1171
|
+
v-for="cp in copyColumnsProp"
|
|
1172
|
+
:key="`a-cp-${cp}`"
|
|
1173
|
+
#[`body-cell-${cp}`]="copyColumnProps"
|
|
1174
|
+
>
|
|
1175
|
+
<q-td :props="copyColumnProps">
|
|
1176
|
+
<MDtCopyColumn :value="copyColumnProps.row[cp]" />
|
|
1268
1177
|
</q-td>
|
|
1269
1178
|
</template>
|
|
1270
1179
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- MyTh Ahmed Faiz Copyright © 2016-2025 All rights reserved.
|
|
3
|
+
- Email: mythpe@gmail.com
|
|
4
|
+
- Mobile: +966590470092
|
|
5
|
+
- Website: https://www.4myth.com
|
|
6
|
+
- Github: https://github.com/mythpe
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
|
|
11
|
+
import { useMyth } from '../../composable'
|
|
12
|
+
import type { MDtColorColumnProps } from '../../types'
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
value?: MDtColorColumnProps['value'];
|
|
16
|
+
size?: MDtColorColumnProps['size'];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
defineProps<Props>()
|
|
20
|
+
const { __, copyText } = useMyth()
|
|
21
|
+
defineOptions({
|
|
22
|
+
name: 'MDtColorColumn',
|
|
23
|
+
inheritAttrs: !1
|
|
24
|
+
})
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div
|
|
29
|
+
class="row q-gutter-lg justify-center items-center"
|
|
30
|
+
v-bind="$attrs"
|
|
31
|
+
>
|
|
32
|
+
<div>
|
|
33
|
+
{{ value || '' }}
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
:class="`m-input__color-preview ${value ? 'cursor-pointer' : ''}`"
|
|
37
|
+
:style="`width: ${size||20}px; height: ${size||20}px; ${value ? `background-color: ${value};` : ''}`"
|
|
38
|
+
@click="() => !!value ? copyText(value) : null"
|
|
39
|
+
>
|
|
40
|
+
<q-tooltip v-if="!!value">
|
|
41
|
+
{{ __('labels.copy') }}
|
|
42
|
+
</q-tooltip>
|
|
43
|
+
</div>
|
|
44
|
+
<slot />
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- MyTh Ahmed Faiz Copyright © 2016-2025 All rights reserved.
|
|
3
|
+
- Email: mythpe@gmail.com
|
|
4
|
+
- Mobile: +966590470092
|
|
5
|
+
- Website: https://www.4myth.com
|
|
6
|
+
- Github: https://github.com/mythpe
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
|
|
11
|
+
import { useMyth } from '../../composable'
|
|
12
|
+
import type { MDtCopyColumnProps } from '../../types'
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
value?: MDtCopyColumnProps['value'];
|
|
16
|
+
width?: MDtCopyColumnProps['width'];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
defineProps<Props>()
|
|
20
|
+
const { __, copyText } = useMyth()
|
|
21
|
+
defineOptions({
|
|
22
|
+
name: 'MDtCopyColumn',
|
|
23
|
+
inheritAttrs: !1
|
|
24
|
+
})
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div
|
|
29
|
+
class="row q-gutter-md items-center"
|
|
30
|
+
v-bind="$attrs"
|
|
31
|
+
>
|
|
32
|
+
<div
|
|
33
|
+
:style="`max-width: ${width || 150}px;`"
|
|
34
|
+
class="ellipsis"
|
|
35
|
+
>
|
|
36
|
+
{{ value || '' }}
|
|
37
|
+
<q-tooltip>
|
|
38
|
+
{{ __('labels.copy') }}
|
|
39
|
+
</q-tooltip>
|
|
40
|
+
</div>
|
|
41
|
+
<q-btn
|
|
42
|
+
dense
|
|
43
|
+
flat
|
|
44
|
+
icon="ion-copy"
|
|
45
|
+
round
|
|
46
|
+
size="sm"
|
|
47
|
+
@click="() => !!value ? copyText(value) : null"
|
|
48
|
+
>
|
|
49
|
+
<q-tooltip>
|
|
50
|
+
{{ __('labels.copy') }}
|
|
51
|
+
</q-tooltip>
|
|
52
|
+
</q-btn>
|
|
53
|
+
<slot />
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- MyTh Ahmed Faiz Copyright © 2016-2025 All rights reserved.
|
|
3
|
+
- Email: mythpe@gmail.com
|
|
4
|
+
- Mobile: +966590470092
|
|
5
|
+
- Website: https://www.4myth.com
|
|
6
|
+
- Github: https://github.com/mythpe
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import type { MDtImageColumnProps } from '../../types'
|
|
11
|
+
import { useMyth } from '../../composable'
|
|
12
|
+
import { computed } from 'vue'
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
imageMode?: MDtImageColumnProps['imageMode'];
|
|
16
|
+
imageSize?: MDtImageColumnProps['imageSize'];
|
|
17
|
+
value: MDtImageColumnProps['value'];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = defineProps<Props>()
|
|
21
|
+
const getMode = computed(() => props.imageMode || 'image')
|
|
22
|
+
type Emits = {
|
|
23
|
+
(e: 'click', evt?: Event): void;
|
|
24
|
+
}
|
|
25
|
+
const emit = defineEmits<Emits>()
|
|
26
|
+
const { __ } = useMyth()
|
|
27
|
+
defineOptions({
|
|
28
|
+
name: 'MDtImageColumn',
|
|
29
|
+
inheritAttrs: !1
|
|
30
|
+
})
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<template v-if="getMode === 'icon'">
|
|
35
|
+
<q-btn
|
|
36
|
+
v-if="!!value"
|
|
37
|
+
dense
|
|
38
|
+
fab-mini
|
|
39
|
+
flat
|
|
40
|
+
icon="ion-ios-eye"
|
|
41
|
+
v-bind="$attrs"
|
|
42
|
+
@click="emit('click',$event)"
|
|
43
|
+
>
|
|
44
|
+
<q-tooltip class="m-dt-btn-tooltip">
|
|
45
|
+
{{ __('myth.titles.show') }}
|
|
46
|
+
</q-tooltip>
|
|
47
|
+
</q-btn>
|
|
48
|
+
</template>
|
|
49
|
+
<template v-else-if="getMode === 'image'">
|
|
50
|
+
<q-avatar
|
|
51
|
+
:size="imageSize"
|
|
52
|
+
v-bind="$attrs"
|
|
53
|
+
>
|
|
54
|
+
<q-img
|
|
55
|
+
v-if="!!value"
|
|
56
|
+
:src="value"
|
|
57
|
+
:style="`width: ${imageSize}; height: ${imageSize}`"
|
|
58
|
+
class="cursor-pointer"
|
|
59
|
+
fit="contain"
|
|
60
|
+
no-spinner
|
|
61
|
+
v-bind="$attrs"
|
|
62
|
+
@click="emit('click',$event)"
|
|
63
|
+
>
|
|
64
|
+
<q-tooltip class="m-dt-btn-tooltip">
|
|
65
|
+
{{ __('myth.titles.show') }}
|
|
66
|
+
</q-tooltip>
|
|
67
|
+
</q-img>
|
|
68
|
+
<q-icon
|
|
69
|
+
v-else
|
|
70
|
+
:size="imageSize"
|
|
71
|
+
name="ion-ios-aperture"
|
|
72
|
+
/>
|
|
73
|
+
</q-avatar>
|
|
74
|
+
</template>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<style lang="sass" scoped>
|
|
78
|
+
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- MyTh Ahmed Faiz Copyright © 2016-2025 All rights reserved.
|
|
3
|
+
- Email: mythpe@gmail.com
|
|
4
|
+
- Mobile: +966590470092
|
|
5
|
+
- Website: https://www.4myth.com
|
|
6
|
+
- Github: https://github.com/mythpe
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
|
|
11
|
+
import type { MDtSarColumnProps } from '../../types'
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
value?: MDtSarColumnProps['value'];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
defineProps<Props>()
|
|
18
|
+
defineOptions({
|
|
19
|
+
name: 'MDtSarColumn',
|
|
20
|
+
inheritAttrs: !1
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div
|
|
26
|
+
class="row q-gutter-lg justify-center items-center"
|
|
27
|
+
v-bind="$attrs"
|
|
28
|
+
>
|
|
29
|
+
<MSarString :text="string || '0.00'" />
|
|
30
|
+
<slot />
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- MyTh Ahmed Faiz Copyright © 2016-2025 All rights reserved.
|
|
3
|
+
- Email: mythpe@gmail.com
|
|
4
|
+
- Mobile: +966590470092
|
|
5
|
+
- Website: https://www.4myth.com
|
|
6
|
+
- Github: https://github.com/mythpe
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
|
|
11
|
+
import type { MDtUrlColumnProps } from '../../types'
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
value?: MDtUrlColumnProps['value'];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
defineProps<Props>()
|
|
18
|
+
type Emits = {
|
|
19
|
+
(e: 'click', evt?: Event): void;
|
|
20
|
+
}
|
|
21
|
+
const emit = defineEmits<Emits>()
|
|
22
|
+
defineOptions({
|
|
23
|
+
name: 'MDtUrlColumn',
|
|
24
|
+
inheritAttrs: !1
|
|
25
|
+
})
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<MBtn
|
|
30
|
+
v-if="!!value"
|
|
31
|
+
dense
|
|
32
|
+
fab-mini
|
|
33
|
+
flat
|
|
34
|
+
icon="ion-ios-open"
|
|
35
|
+
v-bind="$attrs"
|
|
36
|
+
@click="emit('click',$event)"
|
|
37
|
+
>
|
|
38
|
+
<slot />
|
|
39
|
+
<q-tooltip>
|
|
40
|
+
{{ value }}
|
|
41
|
+
</q-tooltip>
|
|
42
|
+
</MBtn>
|
|
43
|
+
</template>
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import MDatatable from './MDatatable.vue'
|
|
2
2
|
import MDtAvatar from './MDtAvatar.vue'
|
|
3
3
|
import MDtBtn from './MDtBtn.vue'
|
|
4
|
+
import MDtColorColumn from './MDtColorColumn.vue'
|
|
4
5
|
import MDtContextmenuItems from './MDtContextmenuItems.vue'
|
|
6
|
+
import MDtImageColumn from './MDtImageColumn.vue'
|
|
7
|
+
import MDtSarColumn from './MDtSarColumn.vue'
|
|
8
|
+
import MDtUrlColumn from './MDtUrlColumn.vue'
|
|
5
9
|
|
|
6
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
MDatatable,
|
|
12
|
+
MDtAvatar,
|
|
13
|
+
MDtBtn,
|
|
14
|
+
MDtColorColumn,
|
|
15
|
+
MDtContextmenuItems,
|
|
16
|
+
MDtImageColumn,
|
|
17
|
+
MDtSarColumn,
|
|
18
|
+
MDtUrlColumn
|
|
19
|
+
}
|
|
7
20
|
|
|
8
21
|
export default {}
|
|
@@ -55,7 +55,12 @@ export const defineAsyncComponents = function (app: App) {
|
|
|
55
55
|
app.component('MDatatable', defineAsyncComponent(() => import('../components/datatable/MDatatable.vue')))
|
|
56
56
|
app.component('MDtAvatar', defineAsyncComponent(() => import('../components/datatable/MDtAvatar.vue')))
|
|
57
57
|
app.component('MDtBtn', defineAsyncComponent(() => import('../components/datatable/MDtBtn.vue')))
|
|
58
|
+
app.component('MDtColorColumn', defineAsyncComponent(() => import('../components/datatable/MDtColorColumn.vue')))
|
|
58
59
|
app.component('MDtContextmenuItems', defineAsyncComponent(() => import('../components/datatable/MDtContextmenuItems.vue')))
|
|
60
|
+
app.component('MDtCopyColumn', defineAsyncComponent(() => import('../components/datatable/MDtCopyColumn.vue')))
|
|
61
|
+
app.component('MDtImageColumn', defineAsyncComponent(() => import('../components/datatable/MDtImageColumn.vue')))
|
|
62
|
+
app.component('MDtSarColumn', defineAsyncComponent(() => import('../components/datatable/MDtSarColumn.vue')))
|
|
63
|
+
app.component('MDtUrlColumn', defineAsyncComponent(() => import('../components/datatable/MDtUrlColumn.vue')))
|
|
59
64
|
|
|
60
65
|
// Utils.
|
|
61
66
|
app.component('MSarIcon', defineAsyncComponent(() => import('../components/sar/MSarIcon.vue')))
|
|
@@ -8,7 +8,26 @@
|
|
|
8
8
|
|
|
9
9
|
import type { GlobalComponentConstructor } from 'quasar'
|
|
10
10
|
import type { ApiInterface } from './api-helpers'
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
MDatatableProps,
|
|
13
|
+
MDatatableSlots,
|
|
14
|
+
MDtAvatarProps,
|
|
15
|
+
MDtAvatarSlots,
|
|
16
|
+
MDtBtnProps,
|
|
17
|
+
MDtBtnSlots,
|
|
18
|
+
MDtColorColumnProps,
|
|
19
|
+
MDtColorColumnSlots,
|
|
20
|
+
MDtContextmenuItemsProps,
|
|
21
|
+
MDtContextmenuItemsSlots,
|
|
22
|
+
MDtCopyColumnProps,
|
|
23
|
+
MDtCopyColumnSlots,
|
|
24
|
+
MDtImageColumnProps,
|
|
25
|
+
MDtImageColumnSlots,
|
|
26
|
+
MDtSarColumnProps,
|
|
27
|
+
MDtSarColumnSlots,
|
|
28
|
+
MDtUrlColumnProps,
|
|
29
|
+
MDtUrlColumnSlots
|
|
30
|
+
} from './m-datatable'
|
|
12
31
|
import type { MAvatarViewerProps, MAvatarViewerSlots } from './api/MAvatarViewer'
|
|
13
32
|
import type { MTransitionGroupProps, MTransitionProps, MTransitionsSlots } from './api/MTransition'
|
|
14
33
|
import type { MAxiosProps, MAxiosSlots } from './api/MAxios'
|
|
@@ -103,7 +122,12 @@ declare module '@vue/runtime-core' {
|
|
|
103
122
|
MDatatable: GlobalComponentConstructor<MDatatableProps, MDatatableSlots>;
|
|
104
123
|
MDtAvatar: GlobalComponentConstructor<MDtAvatarProps, MDtAvatarSlots>;
|
|
105
124
|
MDtBtn: GlobalComponentConstructor<MDtBtnProps, MDtBtnSlots>;
|
|
125
|
+
MDtColorColumn: GlobalComponentConstructor<MDtColorColumnProps, MDtColorColumnSlots>;
|
|
106
126
|
MDtContextmenuItems: GlobalComponentConstructor<MDtContextmenuItemsProps, MDtContextmenuItemsSlots>;
|
|
127
|
+
MDtCopyColumn: GlobalComponentConstructor<MDtCopyColumnProps, MDtCopyColumnSlots>;
|
|
128
|
+
MDtImageColumn: GlobalComponentConstructor<MDtImageColumnProps, MDtImageColumnSlots>;
|
|
129
|
+
MDtSarColumn: GlobalComponentConstructor<MDtSarColumnProps, MDtSarColumnSlots>;
|
|
130
|
+
MDtUrlColumn: GlobalComponentConstructor<MDtUrlColumnProps, MDtUrlColumnSlots>;
|
|
107
131
|
|
|
108
132
|
// Utils.
|
|
109
133
|
MSarIcon: GlobalComponentConstructor<MSarIconProps, MSarIconSlots>;
|
|
@@ -182,24 +182,22 @@ type MDatatableMainScope = {
|
|
|
182
182
|
form: MDatatableFormScope,
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
tools: ((scope: { dt: MDatatableScope, }) => VNode[]);
|
|
185
|
+
type MDatatableSlotFn<T = any> = (scope: T) => VNode[];
|
|
187
186
|
|
|
188
|
-
|
|
187
|
+
export interface MDatatableSlots extends Omit<QTableSlots, 'top'> {
|
|
188
|
+
tools: MDatatableSlotFn<{ dt: MDatatableScope }>;
|
|
189
|
+
selection: MDatatableSlotFn<{ dt: MDatatableScope }>;
|
|
190
|
+
filter: MDatatableSlotFn<{ filter: MDatatableFilterForm } & MDatatableMainScope>;
|
|
191
|
+
show: MDatatableSlotFn<MDatatableMainScope>;
|
|
192
|
+
form: MDatatableSlotFn<MDatatableMainScope>;
|
|
193
|
+
'form-actions': MDatatableSlotFn<MDatatableMainScope>;
|
|
194
|
+
title: MDatatableSlotFn<MDatatableMainScope>;
|
|
195
|
+
'top-search': MDatatableSlotFn<MDatatableMainScope>;
|
|
196
|
+
'bottom-search': MDatatableSlotFn<MDatatableMainScope>;
|
|
189
197
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
form: ((scope: MDatatableMainScope) => VNode[]);
|
|
195
|
-
|
|
196
|
-
'form-actions': ((scope: MDatatableMainScope) => VNode[]);
|
|
197
|
-
|
|
198
|
-
title: ((scope: MDatatableMainScope) => VNode[]);
|
|
199
|
-
'top-search': ((scope: MDatatableMainScope) => VNode[]);
|
|
200
|
-
'bottom-search': ((scope: MDatatableMainScope) => VNode[]);
|
|
201
|
-
|
|
202
|
-
[K: `body-cell-${string}`]: ((scope: Parameters<QTableSlots['body-cell']>[0] & { dt: MDatatableScope }) => VNode[]);
|
|
198
|
+
[key: `body-cell-${string}`]: MDatatableSlotFn<
|
|
199
|
+
Parameters<QTableSlots['body-cell']>[0] & { dt: MDatatableScope }
|
|
200
|
+
>;
|
|
203
201
|
}
|
|
204
202
|
|
|
205
203
|
export type MDtServiceNameCallbackProp = (() => Record<string, (() => Promise<AxiosResponse>)>)
|
|
@@ -310,6 +308,10 @@ export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = O
|
|
|
310
308
|
* Names of SAR columns in the table.
|
|
311
309
|
*/
|
|
312
310
|
sarColumns?: MaybeRefOrGetter<string[]>;
|
|
311
|
+
/**
|
|
312
|
+
* Names of a text want to show copy btn
|
|
313
|
+
*/
|
|
314
|
+
copyColumns?: MaybeRefOrGetter<string[]>;
|
|
313
315
|
}
|
|
314
316
|
|
|
315
317
|
export interface MDtAvatarProps extends QAvatarProps {
|
|
@@ -338,3 +340,62 @@ export interface MDtContextmenuItemsSlots {
|
|
|
338
340
|
*/
|
|
339
341
|
default: () => VNode[];
|
|
340
342
|
}
|
|
343
|
+
|
|
344
|
+
export interface MDtColorColumnProps {
|
|
345
|
+
value?: any;
|
|
346
|
+
size?: string | number;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface MDtColorColumnSlots {
|
|
350
|
+
/**
|
|
351
|
+
* Default slot can be used for captions. See examples
|
|
352
|
+
*/
|
|
353
|
+
default: () => VNode[];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface MDtCopyColumnProps {
|
|
357
|
+
value?: any;
|
|
358
|
+
width?: string | number;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface MDtCopyColumnSlots {
|
|
362
|
+
/**
|
|
363
|
+
* Default slot can be used for captions. See examples
|
|
364
|
+
*/
|
|
365
|
+
default: () => VNode[];
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export interface MDtImageColumnProps {
|
|
369
|
+
imageMode?: MDatatableProps['imageMode'];
|
|
370
|
+
imageSize?: MDatatableProps['imageSize'];
|
|
371
|
+
value: any;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface MDtImageColumnSlots {
|
|
375
|
+
/**
|
|
376
|
+
* Default slot can be used for captions. See examples
|
|
377
|
+
*/
|
|
378
|
+
default: () => VNode[];
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export interface MDtSarColumnProps {
|
|
382
|
+
value?: any;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface MDtSarColumnSlots {
|
|
386
|
+
/**
|
|
387
|
+
* Default slot can be used for captions. See examples
|
|
388
|
+
*/
|
|
389
|
+
default: () => VNode[];
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface MDtUrlColumnProps {
|
|
393
|
+
value?: any;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface MDtUrlColumnSlots {
|
|
397
|
+
/**
|
|
398
|
+
* Default slot can be used for captions. See examples
|
|
399
|
+
*/
|
|
400
|
+
default: () => VNode[];
|
|
401
|
+
}
|