@data-fair/lib-vuetify 1.12.6 → 1.13.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/owner-avatar.vue +35 -14
- package/owner-avatar.vue.d.ts +18 -12
- package/owner-avatar.vue.js +51 -47
- package/package.json +1 -1
package/owner-avatar.vue
CHANGED
|
@@ -1,36 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-tooltip
|
|
3
|
-
|
|
2
|
+
<v-tooltip
|
|
3
|
+
v-if="showTooltip"
|
|
4
|
+
location="top"
|
|
5
|
+
>
|
|
6
|
+
<template #activator="{ props: tooltipProps }">
|
|
4
7
|
<span
|
|
5
|
-
v-bind="
|
|
8
|
+
v-bind="tooltipProps"
|
|
6
9
|
class="text-body-2"
|
|
7
10
|
>
|
|
8
|
-
<v-avatar
|
|
11
|
+
<v-avatar
|
|
12
|
+
:size="size"
|
|
13
|
+
:image="avatarUrl"
|
|
14
|
+
class="bg-transparent"
|
|
15
|
+
/>
|
|
9
16
|
</span>
|
|
10
17
|
</template>
|
|
11
18
|
{{ label }}
|
|
12
19
|
</v-tooltip>
|
|
20
|
+
<span v-else>
|
|
21
|
+
<v-avatar
|
|
22
|
+
:size="size"
|
|
23
|
+
:image="avatarUrl"
|
|
24
|
+
class="bg-transparent"
|
|
25
|
+
/>
|
|
26
|
+
</span>
|
|
13
27
|
</template>
|
|
14
28
|
|
|
15
29
|
<script setup lang="ts">
|
|
16
30
|
import { computed } from 'vue'
|
|
17
31
|
|
|
18
|
-
const
|
|
19
|
-
owner:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
const props = withDefaults(defineProps<{
|
|
33
|
+
owner: Record<string, any>
|
|
34
|
+
size?: number
|
|
35
|
+
/** If true, a tooltip with the owner's name and department will be shown (default: true) */
|
|
36
|
+
showTooltip?: boolean
|
|
37
|
+
/** If true, the owner's name will be omitted from the tooltip when the department is present */
|
|
38
|
+
omitOwnerName?: boolean
|
|
39
|
+
}>(), {
|
|
40
|
+
size: 28,
|
|
41
|
+
showTooltip: true,
|
|
42
|
+
omitOwnerName: false
|
|
23
43
|
})
|
|
24
44
|
|
|
25
45
|
const avatarUrl = computed(() => {
|
|
26
|
-
if (
|
|
27
|
-
else return `/simple-directory/api/avatars/${
|
|
46
|
+
if (props.owner.department) return `/simple-directory/api/avatars/${props.owner.type}/${props.owner.id}/${props.owner.department}/avatar.png`
|
|
47
|
+
else return `/simple-directory/api/avatars/${props.owner.type}/${props.owner.id}/avatar.png`
|
|
28
48
|
})
|
|
29
49
|
|
|
30
50
|
const label = computed(() => {
|
|
31
|
-
let label =
|
|
32
|
-
if (
|
|
33
|
-
if (
|
|
51
|
+
let label = ''
|
|
52
|
+
if (!props.omitOwnerName || !props.owner.department) label += props.owner.name
|
|
53
|
+
if (props.owner.department) label += ' - ' + (props.owner.departmentName || props.owner.department)
|
|
54
|
+
if (props.owner.role) label += ` (${props.owner.role})`
|
|
34
55
|
return label
|
|
35
56
|
})
|
|
36
57
|
</script>
|
package/owner-avatar.vue.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
2
|
-
owner: {
|
|
3
|
-
type: ObjectConstructor;
|
|
4
|
-
default: null;
|
|
5
|
-
};
|
|
6
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
-
owner: {
|
|
8
|
-
type: ObjectConstructor;
|
|
9
|
-
default: null;
|
|
10
|
-
};
|
|
11
|
-
}>> & Readonly<{}>, {
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
12
2
|
owner: Record<string, any>;
|
|
13
|
-
|
|
3
|
+
size?: number;
|
|
4
|
+
/** If true, a tooltip with the owner's name and department will be shown (default: true) */
|
|
5
|
+
showTooltip?: boolean;
|
|
6
|
+
/** If true, the owner's name will be omitted from the tooltip when the department is present */
|
|
7
|
+
omitOwnerName?: boolean;
|
|
8
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
9
|
+
owner: Record<string, any>;
|
|
10
|
+
size?: number;
|
|
11
|
+
/** If true, a tooltip with the owner's name and department will be shown (default: true) */
|
|
12
|
+
showTooltip?: boolean;
|
|
13
|
+
/** If true, the owner's name will be omitted from the tooltip when the department is present */
|
|
14
|
+
omitOwnerName?: boolean;
|
|
15
|
+
}> & Readonly<{}>, {
|
|
16
|
+
size: number;
|
|
17
|
+
showTooltip: boolean;
|
|
18
|
+
omitOwnerName: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
20
|
export default _default;
|
package/owner-avatar.vue.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
/// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
let __VLS_typeProps;
|
|
5
|
+
const props = withDefaults(defineProps(), {
|
|
6
|
+
size: 28,
|
|
7
|
+
showTooltip: true,
|
|
8
|
+
omitOwnerName: false
|
|
9
9
|
});
|
|
10
10
|
const avatarUrl = computed(() => {
|
|
11
|
-
if (
|
|
12
|
-
return `/simple-directory/api/avatars/${
|
|
11
|
+
if (props.owner.department)
|
|
12
|
+
return `/simple-directory/api/avatars/${props.owner.type}/${props.owner.id}/${props.owner.department}/avatar.png`;
|
|
13
13
|
else
|
|
14
|
-
return `/simple-directory/api/avatars/${
|
|
14
|
+
return `/simple-directory/api/avatars/${props.owner.type}/${props.owner.id}/avatar.png`;
|
|
15
15
|
});
|
|
16
16
|
const label = computed(() => {
|
|
17
|
-
let label =
|
|
18
|
-
if (
|
|
19
|
-
label +=
|
|
20
|
-
if (
|
|
21
|
-
label +=
|
|
17
|
+
let label = '';
|
|
18
|
+
if (!props.omitOwnerName || !props.owner.department)
|
|
19
|
+
label += props.owner.name;
|
|
20
|
+
if (props.owner.department)
|
|
21
|
+
label += ' - ' + (props.owner.departmentName || props.owner.department);
|
|
22
|
+
if (props.owner.role)
|
|
23
|
+
label += ` (${props.owner.role})`;
|
|
22
24
|
return label;
|
|
23
25
|
});
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
default: null
|
|
29
|
-
}
|
|
30
|
-
},
|
|
26
|
+
const __VLS_withDefaultsArg = (function (t) { return t; })({
|
|
27
|
+
size: 28,
|
|
28
|
+
showTooltip: true,
|
|
29
|
+
omitOwnerName: false
|
|
31
30
|
});
|
|
31
|
+
const __VLS_fnComponent = (await import('vue')).defineComponent({});
|
|
32
32
|
;
|
|
33
33
|
let __VLS_functionalComponentProps;
|
|
34
34
|
function __VLS_template() {
|
|
@@ -48,25 +48,37 @@ function __VLS_template() {
|
|
|
48
48
|
// CSS variable injection
|
|
49
49
|
// CSS variable injection end
|
|
50
50
|
let __VLS_resolvedLocalAndGlobalComponents;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
if (__VLS_ctx.showTooltip) {
|
|
52
|
+
const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VTooltip;
|
|
53
|
+
/** @type { [typeof __VLS_components.VTooltip, typeof __VLS_components.vTooltip, typeof __VLS_components.VTooltip, typeof __VLS_components.vTooltip, ] } */
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ location: ("top"), }));
|
|
56
|
+
const __VLS_2 = __VLS_1({ location: ("top"), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
57
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
|
|
58
|
+
{
|
|
59
|
+
const { activator: __VLS_thisSlot } = __VLS_nonNullable(__VLS_5.slots);
|
|
60
|
+
const { props: tooltipProps } = __VLS_getSlotParam(__VLS_thisSlot);
|
|
61
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({ ...(tooltipProps), ...{ class: ("text-body-2") }, });
|
|
62
|
+
const __VLS_6 = __VLS_resolvedLocalAndGlobalComponents.VAvatar;
|
|
63
|
+
/** @type { [typeof __VLS_components.VAvatar, typeof __VLS_components.vAvatar, ] } */
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
const __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({ size: ((__VLS_ctx.size)), image: ((__VLS_ctx.avatarUrl)), ...{ class: ("bg-transparent") }, }));
|
|
66
|
+
const __VLS_8 = __VLS_7({ size: ((__VLS_ctx.size)), image: ((__VLS_ctx.avatarUrl)), ...{ class: ("bg-transparent") }, }, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
67
|
+
}
|
|
68
|
+
(__VLS_ctx.label);
|
|
69
|
+
const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({});
|
|
73
|
+
const __VLS_12 = __VLS_resolvedLocalAndGlobalComponents.VAvatar;
|
|
62
74
|
/** @type { [typeof __VLS_components.VAvatar, typeof __VLS_components.vAvatar, ] } */
|
|
63
75
|
// @ts-ignore
|
|
64
|
-
const
|
|
65
|
-
const
|
|
76
|
+
const __VLS_13 = __VLS_asFunctionalComponent(__VLS_12, new __VLS_12({ size: ((__VLS_ctx.size)), image: ((__VLS_ctx.avatarUrl)), ...{ class: ("bg-transparent") }, }));
|
|
77
|
+
const __VLS_14 = __VLS_13({ size: ((__VLS_ctx.size)), image: ((__VLS_ctx.avatarUrl)), ...{ class: ("bg-transparent") }, }, ...__VLS_functionalComponentArgsRest(__VLS_13));
|
|
66
78
|
}
|
|
67
|
-
(__VLS_ctx.label);
|
|
68
|
-
const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
|
|
69
79
|
__VLS_styleScopedClasses['text-body-2'];
|
|
80
|
+
__VLS_styleScopedClasses['bg-transparent'];
|
|
81
|
+
__VLS_styleScopedClasses['bg-transparent'];
|
|
70
82
|
var __VLS_slots;
|
|
71
83
|
var __VLS_inheritedAttrs;
|
|
72
84
|
const __VLS_refs = {};
|
|
@@ -85,23 +97,15 @@ const __VLS_self = (await import('vue')).defineComponent({
|
|
|
85
97
|
label: label,
|
|
86
98
|
};
|
|
87
99
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
type: Object,
|
|
91
|
-
default: null
|
|
92
|
-
}
|
|
93
|
-
},
|
|
100
|
+
__typeProps: {},
|
|
101
|
+
props: {},
|
|
94
102
|
});
|
|
95
103
|
export default (await import('vue')).defineComponent({
|
|
96
104
|
setup() {
|
|
97
105
|
return {};
|
|
98
106
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
type: Object,
|
|
102
|
-
default: null
|
|
103
|
-
}
|
|
104
|
-
},
|
|
107
|
+
__typeProps: {},
|
|
108
|
+
props: {},
|
|
105
109
|
});
|
|
106
110
|
;
|
|
107
111
|
//# sourceMappingURL=owner-avatar.vue.js.map
|