@usssa/component-library 1.0.0-alpha.93 → 1.0.0-alpha.94
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/core/UDrawer.vue +26 -25
- package/src/components/core/UMenuDropdown.vue +4 -4
- package/src/components/core/UMenuItem.vue +2 -3
- package/src/components/core/UTable/UTable.vue +29 -29
- package/src/components/core/UTableStd.vue +74 -128
- package/src/css/quasar.variables.sass +1 -1
package/package.json
CHANGED
|
@@ -6,6 +6,16 @@ import UBtnIcon from './UBtnIcon.vue'
|
|
|
6
6
|
import UBtnStd from './UBtnStd.vue'
|
|
7
7
|
import UMenuItem from './UMenuItem.vue'
|
|
8
8
|
import UTooltip from './UTooltip.vue'
|
|
9
|
+
|
|
10
|
+
const emit = defineEmits(['menuItemClicked', 'closeDrawer'])
|
|
11
|
+
const miniState = defineModel('miniState', {
|
|
12
|
+
default: false,
|
|
13
|
+
type: Boolean,
|
|
14
|
+
})
|
|
15
|
+
const open = defineModel('open', {
|
|
16
|
+
default: false,
|
|
17
|
+
type: Boolean,
|
|
18
|
+
})
|
|
9
19
|
const props = defineProps({
|
|
10
20
|
menu: {
|
|
11
21
|
default: () => [],
|
|
@@ -23,32 +33,15 @@ const props = defineProps({
|
|
|
23
33
|
type: String,
|
|
24
34
|
},
|
|
25
35
|
})
|
|
26
|
-
const emit = defineEmits(['menuItemClicked', 'closeDrawer'])
|
|
27
|
-
const open = defineModel('open', {
|
|
28
|
-
default: false,
|
|
29
|
-
type: Boolean,
|
|
30
|
-
})
|
|
31
|
-
const miniState = defineModel('miniState', {
|
|
32
|
-
default: false,
|
|
33
|
-
type: Boolean,
|
|
34
|
-
})
|
|
35
36
|
|
|
36
37
|
const $router = useRouter()
|
|
37
|
-
const currentRoute = computed(() => $router.currentRoute.value.fullPath)
|
|
38
38
|
const currentPath = computed(() => getCurrentPath())
|
|
39
|
+
const currentRoute = computed(() => $router.currentRoute.value.fullPath)
|
|
39
40
|
|
|
40
41
|
const getCurrentPath = (int = 1) => {
|
|
41
42
|
return currentRoute.value.split('/')[int]
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
const handleClick = (menu) => {
|
|
45
|
-
emit('menuItemClicked', menu)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const handleCloseDrawer = () => {
|
|
49
|
-
emit('closeDrawer')
|
|
50
|
-
}
|
|
51
|
-
|
|
52
45
|
/**
|
|
53
46
|
* returning x offset for tooltip for long text
|
|
54
47
|
* @param {*} label
|
|
@@ -57,6 +50,14 @@ const getXOffset = (label) => {
|
|
|
57
50
|
let labelLength = label.trim().length
|
|
58
51
|
return labelLength <= 4 ? 65 : labelLength < 9 ? 85 : 145
|
|
59
52
|
}
|
|
53
|
+
|
|
54
|
+
const handleClick = (menu) => {
|
|
55
|
+
emit('menuItemClicked', menu)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const handleCloseDrawer = () => {
|
|
59
|
+
emit('closeDrawer')
|
|
60
|
+
}
|
|
60
61
|
</script>
|
|
61
62
|
<template>
|
|
62
63
|
<q-drawer
|
|
@@ -65,14 +66,14 @@ const getXOffset = (label) => {
|
|
|
65
66
|
:breakpoint="400"
|
|
66
67
|
:mini="miniState"
|
|
67
68
|
:mini-width="64"
|
|
68
|
-
side="left"
|
|
69
69
|
show-if-above
|
|
70
|
+
side="left"
|
|
70
71
|
:width="224"
|
|
71
72
|
>
|
|
72
73
|
<q-scroll-area class="u-drawer-scrollable-area">
|
|
73
74
|
<div
|
|
74
75
|
:class="`flex items-center justify-${
|
|
75
|
-
miniState ? 'center q-py-
|
|
76
|
+
miniState ? 'center q-py-xs' : 'between q-py-xs q-pl-ba q-pr-xxs'
|
|
76
77
|
} `"
|
|
77
78
|
>
|
|
78
79
|
<UBtnStd
|
|
@@ -102,10 +103,10 @@ const getXOffset = (label) => {
|
|
|
102
103
|
class="drawer-open-close-icon-wrapper flex items-center justify-center"
|
|
103
104
|
>
|
|
104
105
|
<UBtnIcon
|
|
106
|
+
iconClass="fa-kit-duotone fa-sidebar-shrink"
|
|
105
107
|
ariaLabel="Sidebar shrink icon"
|
|
106
108
|
color="primary"
|
|
107
109
|
dense
|
|
108
|
-
iconClass="fa-kit-duotone fa-sidebar-shrink"
|
|
109
110
|
ref="btn-icon"
|
|
110
111
|
size="sm"
|
|
111
112
|
@click="handleCloseDrawer"
|
|
@@ -132,7 +133,7 @@ const getXOffset = (label) => {
|
|
|
132
133
|
@onClick="handleClick(m)"
|
|
133
134
|
>
|
|
134
135
|
<template v-if="!miniState" #trailing_slot>
|
|
135
|
-
<UBadgeStd v-if="m.badgeInfo"
|
|
136
|
+
<UBadgeStd v-if="m.badgeInfo" :label="m.badgeInfo" size="lg" />
|
|
136
137
|
<q-icon
|
|
137
138
|
v-if="m.rightIcon"
|
|
138
139
|
:class="`${m.rightIcon} ${
|
|
@@ -146,12 +147,12 @@ const getXOffset = (label) => {
|
|
|
146
147
|
</template>
|
|
147
148
|
</UMenuItem>
|
|
148
149
|
<UTooltip
|
|
149
|
-
:description="m.label"
|
|
150
150
|
v-if="miniState"
|
|
151
|
-
:target="`#u-drawer-menu-${i}`"
|
|
152
151
|
anchor="center right"
|
|
153
|
-
|
|
152
|
+
:description="m.label"
|
|
154
153
|
:offset="[getXOffset(m.label), 20]"
|
|
154
|
+
self="center right"
|
|
155
|
+
:target="`#u-drawer-menu-${i}`"
|
|
155
156
|
/>
|
|
156
157
|
</template>
|
|
157
158
|
</q-list>
|
|
@@ -26,13 +26,13 @@ const props = defineProps({
|
|
|
26
26
|
<q-list :class="`u-menu-dropdown size-${size} ${menuClass} q-gutter-y-xxs`">
|
|
27
27
|
<template v-for="(item, index) in data" :key="index">
|
|
28
28
|
<UMenuItem
|
|
29
|
+
:iconClass="iconClass"
|
|
30
|
+
:destructive="item.destructive"
|
|
31
|
+
:disable="item.disable"
|
|
32
|
+
:hide="item.hide"
|
|
29
33
|
:label="item.label"
|
|
30
34
|
:leftIcon="item.leftIcon"
|
|
31
35
|
:rightIcon="item.rightIcon"
|
|
32
|
-
:destructive="item.destructive"
|
|
33
|
-
:iconClass="iconClass"
|
|
34
|
-
:hide="item.hide"
|
|
35
|
-
:disable="item.disable"
|
|
36
36
|
@onClick="item.handler"
|
|
37
37
|
>
|
|
38
38
|
<template #leading_slot>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, ref, watch } from 'vue'
|
|
3
3
|
|
|
4
|
+
const emit = defineEmits(['onClick'])
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
leftIcon: {
|
|
6
7
|
type: String,
|
|
@@ -32,8 +33,6 @@ const props = defineProps({
|
|
|
32
33
|
},
|
|
33
34
|
})
|
|
34
35
|
|
|
35
|
-
const emit = defineEmits(['onClick'])
|
|
36
|
-
|
|
37
36
|
const type = ref(props.destructive ? 'destructive' : 'default')
|
|
38
37
|
|
|
39
38
|
/* Computed variables */
|
|
@@ -98,9 +97,9 @@ watch(
|
|
|
98
97
|
<q-item-section v-if="rightIcon" side>
|
|
99
98
|
<q-icon
|
|
100
99
|
:class="`${rightIcon} ${iconClass}`"
|
|
100
|
+
:aria-hidden="true"
|
|
101
101
|
:color="iconColor"
|
|
102
102
|
size="1rem"
|
|
103
|
-
:aria-hidden="true"
|
|
104
103
|
/>
|
|
105
104
|
</q-item-section>
|
|
106
105
|
<slot name="trailing_slot"></slot>
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
const pagination = defineModel('pagination', {
|
|
3
|
+
default: { page: 1, rowsPerPage: 15 },
|
|
4
|
+
type: Object,
|
|
5
|
+
})
|
|
6
|
+
const loading = defineModel('loading', {
|
|
7
|
+
default: null,
|
|
8
|
+
type: Boolean,
|
|
9
|
+
})
|
|
10
|
+
const rows = defineModel('rows', {
|
|
11
|
+
default: () => [],
|
|
12
|
+
type: Array,
|
|
13
|
+
})
|
|
14
|
+
const columns = defineModel('columns', {
|
|
15
|
+
default: () => [],
|
|
16
|
+
type: Array,
|
|
17
|
+
})
|
|
18
|
+
|
|
2
19
|
const props = defineProps({
|
|
3
20
|
title: {
|
|
4
21
|
type: String,
|
|
@@ -37,38 +54,12 @@ const props = defineProps({
|
|
|
37
54
|
default: true,
|
|
38
55
|
},
|
|
39
56
|
})
|
|
40
|
-
|
|
41
|
-
const pagination = defineModel('pagination', {
|
|
42
|
-
default: { page: 1, rowsPerPage: 15 },
|
|
43
|
-
type: Object,
|
|
44
|
-
})
|
|
45
|
-
const loading = defineModel('loading', {
|
|
46
|
-
default: null,
|
|
47
|
-
type: Boolean,
|
|
48
|
-
})
|
|
49
|
-
const rows = defineModel('rows', {
|
|
50
|
-
default: () => [],
|
|
51
|
-
type: Array,
|
|
52
|
-
})
|
|
53
|
-
const columns = defineModel('columns', {
|
|
54
|
-
default: () => [],
|
|
55
|
-
type: Array,
|
|
56
|
-
})
|
|
57
57
|
</script>
|
|
58
58
|
|
|
59
59
|
<template>
|
|
60
60
|
<q-table
|
|
61
|
+
v-model:pagination="pagination"
|
|
61
62
|
v-bind="$attrs"
|
|
62
|
-
:title="title"
|
|
63
|
-
:columns="columns"
|
|
64
|
-
:rows="rows"
|
|
65
|
-
:row-key="rowKey"
|
|
66
|
-
:flat="flat"
|
|
67
|
-
:bordered="bordered"
|
|
68
|
-
:separator="separator"
|
|
69
|
-
:loading="loading"
|
|
70
|
-
hide-pagination
|
|
71
|
-
:grid="grid"
|
|
72
63
|
:class="`u-table ${virtualScroll ? 'u-virtualscroll-table' : ''} ${
|
|
73
64
|
grid ? 'u-virtualscroll-grid-table' : ''
|
|
74
65
|
} ${stickyHeader ? 'u-sticky-table-header' : ''} ${
|
|
@@ -76,9 +67,18 @@ const columns = defineModel('columns', {
|
|
|
76
67
|
? 'force-auto-height-table'
|
|
77
68
|
: ''
|
|
78
69
|
}`"
|
|
79
|
-
:
|
|
80
|
-
|
|
70
|
+
:bordered="bordered"
|
|
71
|
+
:columns="columns"
|
|
72
|
+
:flat="flat"
|
|
73
|
+
:grid="grid"
|
|
74
|
+
hide-pagination
|
|
75
|
+
:loading="loading"
|
|
76
|
+
:separator="separator"
|
|
77
|
+
:rows="rows"
|
|
78
|
+
:row-key="rowKey"
|
|
81
79
|
:rows-per-page-options="[0]"
|
|
80
|
+
:title="title"
|
|
81
|
+
:virtual-scroll="!grid && virtualScroll"
|
|
82
82
|
:virtual-scroll-item-size="48"
|
|
83
83
|
:virtual-scroll-sticky-size-start="48"
|
|
84
84
|
>
|
|
@@ -12,6 +12,27 @@ import UTd from './UTable/UTd.vue'
|
|
|
12
12
|
import UTh from './UTable/UTh.vue'
|
|
13
13
|
import UTr from './UTable/UTr.vue'
|
|
14
14
|
|
|
15
|
+
const emit = defineEmits(['onCustomSort'])
|
|
16
|
+
const selectedRows = defineModel('selectedRows', {
|
|
17
|
+
default: () => [],
|
|
18
|
+
type: Array,
|
|
19
|
+
})
|
|
20
|
+
const rows = defineModel('rows', {
|
|
21
|
+
default: () => [],
|
|
22
|
+
type: Array,
|
|
23
|
+
})
|
|
24
|
+
const columns = defineModel('columns', {
|
|
25
|
+
default: () => [],
|
|
26
|
+
type: Array,
|
|
27
|
+
})
|
|
28
|
+
const pagination = defineModel('pagination', {
|
|
29
|
+
default: { page: 1, rowsPerPage: 15 },
|
|
30
|
+
type: Object,
|
|
31
|
+
})
|
|
32
|
+
const loading = defineModel('loading', {
|
|
33
|
+
default: () => {},
|
|
34
|
+
type: Boolean,
|
|
35
|
+
})
|
|
15
36
|
const props = defineProps({
|
|
16
37
|
title: {
|
|
17
38
|
type: String,
|
|
@@ -67,29 +88,6 @@ const props = defineProps({
|
|
|
67
88
|
},
|
|
68
89
|
})
|
|
69
90
|
|
|
70
|
-
const emit = defineEmits(['onCustomSort'])
|
|
71
|
-
|
|
72
|
-
const selectedRows = defineModel('selectedRows', {
|
|
73
|
-
default: () => [],
|
|
74
|
-
type: Array,
|
|
75
|
-
})
|
|
76
|
-
const rows = defineModel('rows', {
|
|
77
|
-
default: () => [],
|
|
78
|
-
type: Array,
|
|
79
|
-
})
|
|
80
|
-
const columns = defineModel('columns', {
|
|
81
|
-
default: () => [],
|
|
82
|
-
type: Array,
|
|
83
|
-
})
|
|
84
|
-
const pagination = defineModel('pagination', {
|
|
85
|
-
default: { page: 1, rowsPerPage: 15 },
|
|
86
|
-
type: Object,
|
|
87
|
-
})
|
|
88
|
-
const loading = defineModel('loading', {
|
|
89
|
-
default: () => {},
|
|
90
|
-
type: Boolean,
|
|
91
|
-
})
|
|
92
|
-
|
|
93
91
|
const customLoading = ref(false)
|
|
94
92
|
const rowsPerPageOptions = ref([
|
|
95
93
|
{ label: '5 / per page', value: 5 },
|
|
@@ -99,9 +97,6 @@ const rowsPerPageOptions = ref([
|
|
|
99
97
|
{ label: '25 / per page', value: 25 },
|
|
100
98
|
])
|
|
101
99
|
const tableDataChip = ref(true) // this is required to show chip
|
|
102
|
-
const openMenu = ref([])
|
|
103
|
-
const hoveringButton = ref({})
|
|
104
|
-
const hoveringMenu = ref({})
|
|
105
100
|
|
|
106
101
|
// if virtual scroll is enbaled then adding large rows per page to view in virtual scroll
|
|
107
102
|
const getRowsPerPageOptions = computed(() => {
|
|
@@ -273,61 +268,39 @@ const handleMenuEventStop = (e) => {
|
|
|
273
268
|
e.preventDefault()
|
|
274
269
|
e.stopPropagation()
|
|
275
270
|
}
|
|
276
|
-
|
|
277
|
-
const handleMouseEnter = (type, index) => {
|
|
278
|
-
if (type === 'button') {
|
|
279
|
-
hoveringButton.value[index] = true
|
|
280
|
-
} else {
|
|
281
|
-
hoveringMenu.value[index] = true
|
|
282
|
-
}
|
|
283
|
-
openMenu.value[index] = true
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const handleMouseLeave = (type, index) => {
|
|
287
|
-
if (type === 'button') {
|
|
288
|
-
hoveringButton.value[index] = false
|
|
289
|
-
} else {
|
|
290
|
-
hoveringMenu.value[index] = false
|
|
291
|
-
}
|
|
292
|
-
setTimeout(() => {
|
|
293
|
-
if (!hoveringButton.value[index] && !hoveringMenu.value[index]) {
|
|
294
|
-
openMenu.value[index] = false
|
|
295
|
-
}
|
|
296
|
-
}, 100)
|
|
297
|
-
}
|
|
298
271
|
</script>
|
|
299
272
|
|
|
300
273
|
<template>
|
|
301
274
|
<UTable
|
|
302
|
-
:title="title"
|
|
303
|
-
v-model:rows="rows"
|
|
304
275
|
v-model:columns="columns"
|
|
305
|
-
:separator="separator"
|
|
306
|
-
:loading="loading"
|
|
307
|
-
:flat="flat"
|
|
308
|
-
:bordered="bordered"
|
|
309
276
|
v-model:pagination="pagination"
|
|
310
|
-
:
|
|
311
|
-
:virtualScroll="virtualScroll"
|
|
312
|
-
:stickyHeader="stickyHeader"
|
|
277
|
+
v-model:rows="rows"
|
|
313
278
|
:class="customClass"
|
|
279
|
+
:bordered="bordered"
|
|
280
|
+
:flat="flat"
|
|
281
|
+
:grid="grid"
|
|
282
|
+
:loading="loading"
|
|
283
|
+
:separator="separator"
|
|
314
284
|
:showPagination="showPagination"
|
|
285
|
+
:stickyHeader="stickyHeader"
|
|
286
|
+
:title="title"
|
|
287
|
+
:virtualScroll="virtualScroll"
|
|
315
288
|
>
|
|
316
289
|
<!-- custom header slot to add customized header -->
|
|
317
290
|
<template v-slot:header="props">
|
|
318
291
|
<UTr :props="props" :tableRowHover="tableRowHover">
|
|
319
292
|
<UTh
|
|
320
293
|
v-if="multiSelection"
|
|
294
|
+
:separator="separator"
|
|
321
295
|
style="width: 3% !important"
|
|
322
296
|
:tableHeaderAutoWidth="false"
|
|
323
297
|
tableHeadAlignment="left"
|
|
324
|
-
:separator="separator"
|
|
325
298
|
>
|
|
326
299
|
<UCheckboxStd
|
|
327
|
-
:id="`u-checkbox-table-header`"
|
|
328
300
|
v-model="isRowSelected(null).value"
|
|
329
|
-
|
|
301
|
+
id="u-checkbox-table-header"
|
|
330
302
|
:indeterminate="true"
|
|
303
|
+
name="Table Header"
|
|
331
304
|
/>
|
|
332
305
|
</UTh>
|
|
333
306
|
<template v-for="(col, key) in props.cols">
|
|
@@ -337,6 +310,8 @@ const handleMouseLeave = (type, index) => {
|
|
|
337
310
|
col.headerClasses
|
|
338
311
|
}`"
|
|
339
312
|
:key="key"
|
|
313
|
+
:separator="separator"
|
|
314
|
+
:style="col.headerStyle"
|
|
340
315
|
:tableHeaderAutoWidth="col.autoWidth"
|
|
341
316
|
:tableHeadAlignment="col.field === 'action' ? col.align : col.align"
|
|
342
317
|
@click="
|
|
@@ -346,8 +321,6 @@ const handleMouseLeave = (type, index) => {
|
|
|
346
321
|
: handleSort(col.field, col.sortOrder, col.type)
|
|
347
322
|
: null
|
|
348
323
|
"
|
|
349
|
-
:separator="separator"
|
|
350
|
-
:style="col.headerStyle"
|
|
351
324
|
>
|
|
352
325
|
<span
|
|
353
326
|
:class="`${col.field === 'action' ? 'hidden-header-label' : ''}`"
|
|
@@ -359,8 +332,8 @@ const handleMouseLeave = (type, index) => {
|
|
|
359
332
|
<UBtnIcon
|
|
360
333
|
:class="`more-action-icon cursor-pointer`"
|
|
361
334
|
:iconClass="`${getSortingIcon(col)}`"
|
|
362
|
-
ref="btn-icon"
|
|
363
335
|
:aria-label="`Sort ${col.label}`"
|
|
336
|
+
ref="btn-icon"
|
|
364
337
|
size="sm"
|
|
365
338
|
/>
|
|
366
339
|
</span>
|
|
@@ -379,16 +352,17 @@ const handleMouseLeave = (type, index) => {
|
|
|
379
352
|
<UTd
|
|
380
353
|
v-if="multiSelection"
|
|
381
354
|
:index="-1"
|
|
355
|
+
:separator="separator"
|
|
382
356
|
tableDataAlignment="left"
|
|
383
357
|
:tableHeaderAutoWidth="false"
|
|
384
|
-
:separator="separator"
|
|
385
358
|
>
|
|
386
359
|
<UCheckboxStd
|
|
387
|
-
:id="`u-checkbox-${props.row._id}`"
|
|
388
360
|
v-model="isRowSelected(props.row).value"
|
|
361
|
+
:id="`u-checkbox-${props.row._id}`"
|
|
389
362
|
:name="props.row._id"
|
|
390
363
|
/>
|
|
391
364
|
</UTd>
|
|
365
|
+
|
|
392
366
|
<template v-for="(col, index) in props.cols" :key="index">
|
|
393
367
|
<!-- to show the cell data without the action cell -->
|
|
394
368
|
<UTd
|
|
@@ -396,28 +370,28 @@ const handleMouseLeave = (type, index) => {
|
|
|
396
370
|
col.field !== 'action' &&
|
|
397
371
|
(typeof col.show === 'undefined' || col.show)
|
|
398
372
|
"
|
|
399
|
-
:
|
|
373
|
+
:class="col.classes"
|
|
400
374
|
:col="col"
|
|
401
375
|
:index="index"
|
|
402
|
-
:
|
|
403
|
-
:tableDataAutoWidth="col.autoWidth"
|
|
376
|
+
:row="props.row"
|
|
404
377
|
:separator="separator"
|
|
405
378
|
:style="col.style"
|
|
406
|
-
:
|
|
379
|
+
:tableDataAlignment="col.align"
|
|
380
|
+
:tableDataAutoWidth="col.autoWidth"
|
|
407
381
|
>
|
|
408
382
|
<!-- to show the chips with different variant -->
|
|
409
383
|
<template v-if="col.chipValues && col.chipValues.length > 0">
|
|
410
384
|
<UChip
|
|
411
385
|
v-model="tableDataChip"
|
|
412
|
-
|
|
386
|
+
class="u-table-chip"
|
|
413
387
|
avatarLabel=""
|
|
388
|
+
:anchor="col.anchor"
|
|
414
389
|
:chipLabel="props.row[col.field].toString()"
|
|
415
|
-
:
|
|
416
|
-
class="u-table-chip"
|
|
390
|
+
:dense="col.denseChip"
|
|
417
391
|
:is-show-tooltip="col.showChipTooltip"
|
|
418
392
|
:offset="col.offset"
|
|
419
|
-
:
|
|
420
|
-
:
|
|
393
|
+
:removable="false"
|
|
394
|
+
:type="getChipColor(col.chipValues, props.row[col.field])"
|
|
421
395
|
/>
|
|
422
396
|
</template>
|
|
423
397
|
<!-- to show the avatar of user image with name and other details -->
|
|
@@ -432,29 +406,29 @@ const handleMouseLeave = (type, index) => {
|
|
|
432
406
|
>
|
|
433
407
|
<UAvatar
|
|
434
408
|
v-if="props.row[col.avatarKey]?.type === 'initials'"
|
|
435
|
-
size="md"
|
|
436
409
|
:name="`${props.row[col.avatarKey]?.value}`"
|
|
410
|
+
size="md"
|
|
437
411
|
/>
|
|
438
412
|
<UAvatar
|
|
439
413
|
v-else-if="props.row[col.avatarKey]?.type === 'image'"
|
|
440
|
-
|
|
414
|
+
:image="`${props.row[col.avatarKey]?.value}`"
|
|
441
415
|
:name="
|
|
442
416
|
props.row[col.avatarKey]?.name ??
|
|
443
417
|
props.row[col.avatarKey]?.value
|
|
444
418
|
"
|
|
445
|
-
|
|
419
|
+
size="md"
|
|
446
420
|
/>
|
|
447
421
|
</div>
|
|
448
422
|
<div v-else class="table-data-avatar">
|
|
449
423
|
<UAvatar
|
|
450
|
-
size="md"
|
|
451
|
-
:name="`${props.row[col.avatarKey]}`"
|
|
452
424
|
:image="`${props.row[col.avatarKey]}`"
|
|
425
|
+
:name="`${props.row[col.avatarKey]}`"
|
|
426
|
+
size="md"
|
|
453
427
|
/>
|
|
454
428
|
</div>
|
|
455
429
|
<div class="td-grid-content">
|
|
456
430
|
<div>{{ props.row[col.field] }}</div>
|
|
457
|
-
<div class="td-caption text-body-xs"
|
|
431
|
+
<div v-if="col.captionKey" class="td-caption text-body-xs">
|
|
458
432
|
{{ props.row[col.captionKey] }}
|
|
459
433
|
</div>
|
|
460
434
|
</div>
|
|
@@ -478,8 +452,8 @@ const handleMouseLeave = (type, index) => {
|
|
|
478
452
|
</template>
|
|
479
453
|
</div>
|
|
480
454
|
<div
|
|
481
|
-
class="td-caption text-body-xs"
|
|
482
455
|
v-if="col.captionKey && col.type !== 'icon'"
|
|
456
|
+
class="td-caption text-body-xs"
|
|
483
457
|
>
|
|
484
458
|
{{ props.row[col.captionKey] }}
|
|
485
459
|
</div>
|
|
@@ -492,11 +466,11 @@ const handleMouseLeave = (type, index) => {
|
|
|
492
466
|
v-else-if="typeof col.show === 'undefined' || col.show"
|
|
493
467
|
:class="col.classes"
|
|
494
468
|
:index="index"
|
|
495
|
-
:tableDataAlignment="col.align"
|
|
496
|
-
:tableDataAutoWidth="false"
|
|
497
|
-
style="width: 3%"
|
|
498
469
|
:separator="separator"
|
|
499
470
|
:style="col.style"
|
|
471
|
+
style="width: 3%"
|
|
472
|
+
:tableDataAlignment="col.align"
|
|
473
|
+
:tableDataAutoWidth="false"
|
|
500
474
|
>
|
|
501
475
|
<template v-if="col.actions && col.actions.length === 1">
|
|
502
476
|
<template v-for="(action, key) in col.actions" :key="key">
|
|
@@ -506,16 +480,16 @@ const handleMouseLeave = (type, index) => {
|
|
|
506
480
|
? !action.hide(props.row)
|
|
507
481
|
: true
|
|
508
482
|
"
|
|
509
|
-
:key="key"
|
|
510
|
-
:label="action.label"
|
|
511
|
-
:flat="action.flat"
|
|
512
|
-
:outline="action.outline"
|
|
513
|
-
:leftIcon="action.icon"
|
|
514
483
|
:color="action.color"
|
|
515
484
|
:disable="
|
|
516
485
|
typeof action.disable === 'function' &&
|
|
517
486
|
action.disable(props.row)
|
|
518
487
|
"
|
|
488
|
+
:flat="action.flat"
|
|
489
|
+
:key="key"
|
|
490
|
+
:label="action.label"
|
|
491
|
+
:leftIcon="action.icon"
|
|
492
|
+
:outline="action.outline"
|
|
519
493
|
:size="action.size"
|
|
520
494
|
@onClick="action.handler(props.row)"
|
|
521
495
|
/>
|
|
@@ -524,30 +498,16 @@ const handleMouseLeave = (type, index) => {
|
|
|
524
498
|
<!-- to show the actions list if the actions are multiple -->
|
|
525
499
|
<template v-else>
|
|
526
500
|
<UBtnIcon
|
|
527
|
-
:key="index"
|
|
528
501
|
:class="`action-icon cursor-pointer`"
|
|
529
502
|
iconClass="fa-kit fa-ellipsis-vertical"
|
|
530
|
-
ref="btn-icon"
|
|
531
503
|
ariaLabel="More action"
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
@blur="handleMouseLeave('button', props.row.id)"
|
|
504
|
+
:id="`more-action-list-button-${props.row.id}`"
|
|
505
|
+
:key="index"
|
|
506
|
+
ref="btn-icon"
|
|
536
507
|
@click.stop="handleMenuEventStop"
|
|
537
508
|
>
|
|
538
509
|
<template #menu>
|
|
539
|
-
<q-menu
|
|
540
|
-
v-if="!verticalMoreActions"
|
|
541
|
-
v-model="openMenu[props.row.id]"
|
|
542
|
-
role="list"
|
|
543
|
-
no-focus
|
|
544
|
-
no-refocus
|
|
545
|
-
persistent
|
|
546
|
-
@focus="handleMouseEnter('button', props.row.id)"
|
|
547
|
-
@mouseleave="handleMouseLeave('menu', props.row.id)"
|
|
548
|
-
@mouseover="handleMouseEnter('menu', props.row.id)"
|
|
549
|
-
@blur="handleMouseLeave('button', props.row.id)"
|
|
550
|
-
>
|
|
510
|
+
<q-menu v-if="!verticalMoreActions" auto-close role="list">
|
|
551
511
|
<div
|
|
552
512
|
:class="`${
|
|
553
513
|
verticalMoreActions ? 'vertical' : 'horizontal'
|
|
@@ -560,37 +520,25 @@ const handleMouseLeave = (type, index) => {
|
|
|
560
520
|
? !action.hide(props.row)
|
|
561
521
|
: true && !verticalMoreActions
|
|
562
522
|
"
|
|
563
|
-
:
|
|
564
|
-
:class="`more-action-icon cursor-pointer`"
|
|
523
|
+
:class="`more-action-icon cursor-pointer table-more-action`"
|
|
565
524
|
:iconClass="action.icon"
|
|
566
|
-
ref="btn-icon"
|
|
567
525
|
:ariaLabel="action.label"
|
|
568
526
|
:disable="
|
|
569
527
|
typeof action.disable === 'function' &&
|
|
570
528
|
action.disable(props.row)
|
|
571
529
|
"
|
|
530
|
+
:id="`more-action-${key}`"
|
|
531
|
+
ref="btn-icon"
|
|
572
532
|
:size="action.size"
|
|
573
533
|
:tooltip="action.tooltip"
|
|
574
|
-
@onClick="action.handler(props.row)"
|
|
575
534
|
@click.stop="handleMenuEventStop"
|
|
576
|
-
@
|
|
535
|
+
@onClick="action.handler(props.row)"
|
|
577
536
|
/>
|
|
578
537
|
</template>
|
|
579
538
|
</div>
|
|
580
539
|
</q-menu>
|
|
581
540
|
|
|
582
|
-
<q-menu
|
|
583
|
-
v-else
|
|
584
|
-
v-model="openMenu[props.row.id]"
|
|
585
|
-
role="list"
|
|
586
|
-
no-focus
|
|
587
|
-
no-refocus
|
|
588
|
-
persistent
|
|
589
|
-
@focus="handleMouseEnter('button', props.row.id)"
|
|
590
|
-
@mouseleave="handleMouseLeave('menu', props.row.id)"
|
|
591
|
-
@mouseover="handleMouseEnter('menu', props.row.id)"
|
|
592
|
-
@blur="handleMouseLeave('button', props.row.id)"
|
|
593
|
-
>
|
|
541
|
+
<q-menu v-else auto-close role="list">
|
|
594
542
|
<UMenuDropdown
|
|
595
543
|
v-if="verticalMoreActions"
|
|
596
544
|
:data="
|
|
@@ -639,12 +587,12 @@ const handleMouseLeave = (type, index) => {
|
|
|
639
587
|
<UPagination
|
|
640
588
|
v-if="rows.length >= 6"
|
|
641
589
|
v-model="pagination.page"
|
|
642
|
-
:rowPerPage="pagination.rowsPerPage"
|
|
643
|
-
:perPageOptions="getRowsPerPageOptions"
|
|
644
590
|
:maxPageLink="
|
|
645
591
|
Number(Math.ceil(rows.length / pagination.rowsPerPage > 10 ? 6 : 3))
|
|
646
592
|
"
|
|
647
593
|
:maxPages="Number(Math.ceil(rows.length / pagination.rowsPerPage))"
|
|
594
|
+
:perPageOptions="getRowsPerPageOptions"
|
|
595
|
+
:rowPerPage="pagination.rowsPerPage"
|
|
648
596
|
@onPageChange="onPageChange"
|
|
649
597
|
@onRowChange="onRowPerPageChange"
|
|
650
598
|
/>
|
|
@@ -665,7 +613,6 @@ const handleMouseLeave = (type, index) => {
|
|
|
665
613
|
&:hover
|
|
666
614
|
color: $primary !important
|
|
667
615
|
|
|
668
|
-
|
|
669
616
|
.table-data-avatar
|
|
670
617
|
padding: $xs
|
|
671
618
|
padding-left: 0px
|
|
@@ -682,7 +629,6 @@ const handleMouseLeave = (type, index) => {
|
|
|
682
629
|
background: $surface-bg-1
|
|
683
630
|
box-shadow: 0px 0px 4px 0px rgba(16, 17, 20, 0.08)
|
|
684
631
|
|
|
685
|
-
|
|
686
632
|
.vertical-more-action-wrapper
|
|
687
633
|
display: grid
|
|
688
634
|
place-items: flex-start
|
|
@@ -99,7 +99,7 @@ $xxl : $space-base * 3.375 !default
|
|
|
99
99
|
$space-none : (x: 0, y: 0) !default
|
|
100
100
|
$space-xxs : (x: ($space-x-base * .25), y: ($space-y-base * .25)) !default
|
|
101
101
|
$space-xs : (x: ($space-x-base * .5), y: ($space-y-base * .5)) !default
|
|
102
|
-
$space-sm : (x: ($space-x-base * .75), y: ($space-y-base * .
|
|
102
|
+
$space-sm : (x: ($space-x-base * .75), y: ($space-y-base * .75)) !default
|
|
103
103
|
$space-ms : (x: ($space-x-base * 1.5), y: ($space-y-base * 1.5)) !default
|
|
104
104
|
$space-ba : (x: ($space-x-base * 1), y: ($space-y-base * 1)) !default
|
|
105
105
|
$space-md : (x: $space-x-base * 2, y: $space-y-base * 2) !default
|