@data-fair/lib-vuetify 0.1.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/date-match-filter.vue +104 -0
- package/date-match-filter.vue.d.ts +32 -0
- package/date-match-filter.vue.js +133 -0
- package/date-range-picker.vue +76 -0
- package/date-range-picker.vue.d.ts +11 -0
- package/date-range-picker.vue.js +134 -0
- package/index.d.ts +2 -0
- package/index.js +53 -0
- package/owner-avatar.vue +44 -0
- package/owner-avatar.vue.d.ts +7 -0
- package/owner-avatar.vue.js +103 -0
- package/owner-pick.vue +123 -0
- package/owner-pick.vue.d.ts +11 -0
- package/owner-pick.vue.js +186 -0
- package/package.json +22 -0
- package/personal-menu.vue +260 -0
- package/personal-menu.vue.d.ts +19 -0
- package/personal-menu.vue.js +484 -0
- package/search-address.vue +75 -0
- package/search-address.vue.d.ts +14 -0
- package/search-address.vue.js +125 -0
- package/tutorial-alert.vue +131 -0
- package/tutorial-alert.vue.d.ts +70 -0
- package/tutorial-alert.vue.js +138 -0
- package/user-avatar.vue +85 -0
- package/user-avatar.vue.d.ts +7 -0
- package/user-avatar.vue.js +112 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
|
|
2
|
+
import { VAutocomplete } from 'vuetify/components/VAutocomplete';
|
|
3
|
+
import { ref, watch } from 'vue';
|
|
4
|
+
import { ofetch } from 'ofetch';
|
|
5
|
+
import { useDebounceFn } from '@vueuse/core';
|
|
6
|
+
const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
|
|
7
|
+
let __VLS_typeProps;
|
|
8
|
+
const __VLS_props = defineProps();
|
|
9
|
+
const emit = defineEmits(['selected']);
|
|
10
|
+
const model = defineModel({ type: String });
|
|
11
|
+
const addressesList = ref([]);
|
|
12
|
+
const loadingAddresses = ref(false);
|
|
13
|
+
const address = ref(null);
|
|
14
|
+
const findAdressesFn = async (search, selectedId) => {
|
|
15
|
+
loadingAddresses.value = true;
|
|
16
|
+
if (!search || search.length < 3) {
|
|
17
|
+
addressesList.value = address.value ? [address.value] : [];
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const params = { q: search };
|
|
21
|
+
const result = (await ofetch('https://api-adresse.data.gouv.fr/search/', { params }));
|
|
22
|
+
addressesList.value = result.features.map((f) => ({
|
|
23
|
+
title: f.properties.label,
|
|
24
|
+
value: {
|
|
25
|
+
lat: f.geometry.coordinates[1],
|
|
26
|
+
lon: f.geometry.coordinates[0],
|
|
27
|
+
...f.properties
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
if (selectedId) {
|
|
32
|
+
address.value = addressesList.value.find(a => a.value.id === selectedId);
|
|
33
|
+
}
|
|
34
|
+
loadingAddresses.value = false;
|
|
35
|
+
};
|
|
36
|
+
const findAdresses = useDebounceFn(findAdressesFn, 300);
|
|
37
|
+
if (model.value && model.value.length) {
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
findAdresses(...JSON.parse(`[${model.value}]`));
|
|
40
|
+
}
|
|
41
|
+
watch(address, (addr) => {
|
|
42
|
+
if (addr) {
|
|
43
|
+
model.value = JSON.stringify([addr.title, addr.value.id]).slice(1, -1);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
model.value = undefined;
|
|
47
|
+
addressesList.value = [];
|
|
48
|
+
}
|
|
49
|
+
emit('selected', addr ? addr.value : undefined);
|
|
50
|
+
});
|
|
51
|
+
const __VLS_fnComponent = (await import('vue')).defineComponent({
|
|
52
|
+
emits: {
|
|
53
|
+
...{},
|
|
54
|
+
...{},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
;
|
|
58
|
+
let __VLS_functionalComponentProps;
|
|
59
|
+
const __VLS_defaults = {};
|
|
60
|
+
function __VLS_template() {
|
|
61
|
+
const __VLS_ctx = {};
|
|
62
|
+
const __VLS_localComponents = {
|
|
63
|
+
...{},
|
|
64
|
+
...{},
|
|
65
|
+
...__VLS_ctx,
|
|
66
|
+
};
|
|
67
|
+
let __VLS_components;
|
|
68
|
+
const __VLS_localDirectives = {
|
|
69
|
+
...{},
|
|
70
|
+
...__VLS_ctx,
|
|
71
|
+
};
|
|
72
|
+
let __VLS_directives;
|
|
73
|
+
let __VLS_styleScopedClasses;
|
|
74
|
+
let __VLS_resolvedLocalAndGlobalComponents;
|
|
75
|
+
const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VAutocomplete;
|
|
76
|
+
/** @type { [typeof __VLS_components.VAutocomplete, typeof __VLS_components.vAutocomplete, ] } */
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ ...{ 'onUpdate:search': {} }, modelValue: ((__VLS_ctx.address)), items: ((__VLS_ctx.addressesList)), loading: ((__VLS_ctx.loadingAddresses)), noFilter: (true), clearable: ((true)), returnObject: (true), hideNoData: (true), hideDetails: (true), label: ("Adresse"), placeholder: ("Saisissez une adresse"), variant: ((__VLS_ctx.variant)), density: ("compact"), menuIcon: (""), }));
|
|
79
|
+
const __VLS_2 = __VLS_1({ ...{ 'onUpdate:search': {} }, modelValue: ((__VLS_ctx.address)), items: ((__VLS_ctx.addressesList)), loading: ((__VLS_ctx.loadingAddresses)), noFilter: (true), clearable: ((true)), returnObject: (true), hideNoData: (true), hideDetails: (true), label: ("Adresse"), placeholder: ("Saisissez une adresse"), variant: ((__VLS_ctx.variant)), density: ("compact"), menuIcon: (""), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
80
|
+
let __VLS_6;
|
|
81
|
+
const __VLS_7 = {
|
|
82
|
+
'onUpdate:search': ((search) => __VLS_ctx.findAdresses(search))
|
|
83
|
+
};
|
|
84
|
+
let __VLS_3;
|
|
85
|
+
let __VLS_4;
|
|
86
|
+
const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
|
|
87
|
+
var __VLS_slots;
|
|
88
|
+
var __VLS_inheritedAttrs;
|
|
89
|
+
const __VLS_refs = {};
|
|
90
|
+
var $refs;
|
|
91
|
+
return {
|
|
92
|
+
slots: __VLS_slots,
|
|
93
|
+
refs: $refs,
|
|
94
|
+
attrs: {},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
;
|
|
98
|
+
const __VLS_self = (await import('vue')).defineComponent({
|
|
99
|
+
setup() {
|
|
100
|
+
return {
|
|
101
|
+
VAutocomplete: VAutocomplete,
|
|
102
|
+
addressesList: addressesList,
|
|
103
|
+
loadingAddresses: loadingAddresses,
|
|
104
|
+
address: address,
|
|
105
|
+
findAdresses: findAdresses,
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
emits: {
|
|
109
|
+
...{},
|
|
110
|
+
...{},
|
|
111
|
+
},
|
|
112
|
+
__typeProps: {},
|
|
113
|
+
});
|
|
114
|
+
export default (await import('vue')).defineComponent({
|
|
115
|
+
setup() {
|
|
116
|
+
return {};
|
|
117
|
+
},
|
|
118
|
+
emits: {
|
|
119
|
+
...{},
|
|
120
|
+
...{},
|
|
121
|
+
},
|
|
122
|
+
__typeProps: {},
|
|
123
|
+
});
|
|
124
|
+
;
|
|
125
|
+
//# sourceMappingURL=search-address.vue.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<!-- eslint-disable vue/no-v-html -->
|
|
2
|
+
<template lang="html">
|
|
3
|
+
<div
|
|
4
|
+
v-if="show || showBtn"
|
|
5
|
+
class="tutorial-alert pt-3 pb-2 pr-3"
|
|
6
|
+
>
|
|
7
|
+
<v-alert
|
|
8
|
+
v-if="show"
|
|
9
|
+
dark
|
|
10
|
+
color="success"
|
|
11
|
+
density="compact"
|
|
12
|
+
border="start"
|
|
13
|
+
class="ma-0"
|
|
14
|
+
:variant="theme.current.value.dark ? 'outlined' : 'flat'"
|
|
15
|
+
>
|
|
16
|
+
<slot>
|
|
17
|
+
<a
|
|
18
|
+
v-if="href"
|
|
19
|
+
:href="href"
|
|
20
|
+
target="_blank"
|
|
21
|
+
>{{ text || $t('readDoc') }}</a>
|
|
22
|
+
<template v-else>
|
|
23
|
+
<span
|
|
24
|
+
v-if="text"
|
|
25
|
+
v-text="text"
|
|
26
|
+
/>
|
|
27
|
+
<div
|
|
28
|
+
v-else-if="html"
|
|
29
|
+
v-html="html"
|
|
30
|
+
/>
|
|
31
|
+
</template>
|
|
32
|
+
</slot>
|
|
33
|
+
</v-alert>
|
|
34
|
+
<v-btn
|
|
35
|
+
v-if="showBtn"
|
|
36
|
+
class="toggle"
|
|
37
|
+
icon
|
|
38
|
+
density="compact"
|
|
39
|
+
color="success"
|
|
40
|
+
:title="show ? $t('closeHelp') : $t('readHelp')"
|
|
41
|
+
@click="show = !show"
|
|
42
|
+
>
|
|
43
|
+
<v-icon v-if="show">
|
|
44
|
+
mdi-close-circle
|
|
45
|
+
</v-icon>
|
|
46
|
+
<v-icon v-else>
|
|
47
|
+
mdi-information
|
|
48
|
+
</v-icon>
|
|
49
|
+
</v-btn>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<i18n lang="yaml">
|
|
54
|
+
fr:
|
|
55
|
+
readHelp: Ouvrez un message d'aide
|
|
56
|
+
closeHelp: Fermez le message d'aide
|
|
57
|
+
readDoc: Consultez la documentation
|
|
58
|
+
en:
|
|
59
|
+
readHelp: Open a help message
|
|
60
|
+
closeHelp: Close the help message
|
|
61
|
+
readDoc: Read the documentation
|
|
62
|
+
</i18n>
|
|
63
|
+
|
|
64
|
+
<script>
|
|
65
|
+
import { useTheme } from 'vuetify';
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
props: {
|
|
69
|
+
id: { type: String, required: true },
|
|
70
|
+
href: { type: String, required: false, default: null },
|
|
71
|
+
text: { type: String, required: false, default: null },
|
|
72
|
+
html: { type: String, required: false, default: null },
|
|
73
|
+
initial: { type: Boolean, default: true },
|
|
74
|
+
persistent: { type: Boolean, default: false }
|
|
75
|
+
},
|
|
76
|
+
setup() {
|
|
77
|
+
const theme = useTheme()
|
|
78
|
+
return {theme}
|
|
79
|
+
},
|
|
80
|
+
data: () => ({
|
|
81
|
+
show: false
|
|
82
|
+
}),
|
|
83
|
+
computed: {
|
|
84
|
+
showBtn () {
|
|
85
|
+
return this.show || (!this.show && this.persistent)
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
watch: {
|
|
89
|
+
show () {
|
|
90
|
+
window.localStorage['closed-tutorial-' + this.id] = '' + !this.show
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
mounted () {
|
|
94
|
+
if (window.localStorage) {
|
|
95
|
+
if (window.localStorage['closed-tutorial-' + this.id] !== 'true') {
|
|
96
|
+
this.show = this.initial
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<style lang="css">
|
|
104
|
+
.tutorial-alert {
|
|
105
|
+
/*background-color: rgba(10, 10, 10, 0.1);*/
|
|
106
|
+
position: relative;
|
|
107
|
+
overflow:visible;
|
|
108
|
+
min-height:28px;
|
|
109
|
+
}
|
|
110
|
+
.tutorial-alert .v-alert--outlined {
|
|
111
|
+
background: black !important
|
|
112
|
+
}
|
|
113
|
+
.tutorial-alert .v-alert .v-alert__content a {
|
|
114
|
+
color: white !important;
|
|
115
|
+
text-decoration: underline;
|
|
116
|
+
}
|
|
117
|
+
.tutorial-alert .toggle.v-btn {
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: -1px;
|
|
120
|
+
right: -1px;
|
|
121
|
+
}
|
|
122
|
+
.tutorial-alert .toggle.v-btn .v-icon {
|
|
123
|
+
border-radius: 30px;
|
|
124
|
+
}
|
|
125
|
+
.tutorial-alert .toggle.v-btn .v-icon.theme--dark {
|
|
126
|
+
background-color: black;
|
|
127
|
+
}
|
|
128
|
+
.tutorial-alert .toggle.v-btn .v-icon.theme--light {
|
|
129
|
+
background-color: white;
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
id: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
href: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: false;
|
|
9
|
+
default: null;
|
|
10
|
+
};
|
|
11
|
+
text: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: false;
|
|
14
|
+
default: null;
|
|
15
|
+
};
|
|
16
|
+
html: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
required: false;
|
|
19
|
+
default: null;
|
|
20
|
+
};
|
|
21
|
+
initial: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
persistent: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
}>, {
|
|
30
|
+
theme: import("vuetify", { with: { "resolution-mode": "import" } }).ThemeInstance;
|
|
31
|
+
}, {
|
|
32
|
+
show: boolean;
|
|
33
|
+
}, {
|
|
34
|
+
showBtn(): boolean;
|
|
35
|
+
}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
id: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
href: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
required: false;
|
|
43
|
+
default: null;
|
|
44
|
+
};
|
|
45
|
+
text: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
required: false;
|
|
48
|
+
default: null;
|
|
49
|
+
};
|
|
50
|
+
html: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
required: false;
|
|
53
|
+
default: null;
|
|
54
|
+
};
|
|
55
|
+
initial: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
59
|
+
persistent: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
63
|
+
}>> & Readonly<{}>, {
|
|
64
|
+
persistent: boolean;
|
|
65
|
+
html: string;
|
|
66
|
+
text: string;
|
|
67
|
+
href: string;
|
|
68
|
+
initial: boolean;
|
|
69
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
70
|
+
export default _default;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
|
|
2
|
+
import { useTheme } from 'vuetify';
|
|
3
|
+
export default (await import('vue')).defineComponent({
|
|
4
|
+
props: {
|
|
5
|
+
id: { type: String, required: true },
|
|
6
|
+
href: { type: String, required: false, default: null },
|
|
7
|
+
text: { type: String, required: false, default: null },
|
|
8
|
+
html: { type: String, required: false, default: null },
|
|
9
|
+
initial: { type: Boolean, default: true },
|
|
10
|
+
persistent: { type: Boolean, default: false }
|
|
11
|
+
},
|
|
12
|
+
setup() {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
return { theme };
|
|
15
|
+
},
|
|
16
|
+
data: () => ({
|
|
17
|
+
show: false
|
|
18
|
+
}),
|
|
19
|
+
computed: {
|
|
20
|
+
showBtn() {
|
|
21
|
+
return this.show || (!this.show && this.persistent);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
watch: {
|
|
25
|
+
show() {
|
|
26
|
+
window.localStorage['closed-tutorial-' + this.id] = '' + !this.show;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
mounted() {
|
|
30
|
+
if (window.localStorage) {
|
|
31
|
+
if (window.localStorage['closed-tutorial-' + this.id] !== 'true') {
|
|
32
|
+
this.show = this.initial;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
function __VLS_template() {
|
|
38
|
+
const __VLS_ctx = {};
|
|
39
|
+
const __VLS_localComponents = {
|
|
40
|
+
...{},
|
|
41
|
+
...__VLS_ctx,
|
|
42
|
+
};
|
|
43
|
+
let __VLS_components;
|
|
44
|
+
const __VLS_localDirectives = {
|
|
45
|
+
...{},
|
|
46
|
+
...__VLS_ctx,
|
|
47
|
+
};
|
|
48
|
+
let __VLS_directives;
|
|
49
|
+
let __VLS_styleScopedClasses;
|
|
50
|
+
// CSS variable injection
|
|
51
|
+
// CSS variable injection end
|
|
52
|
+
let __VLS_resolvedLocalAndGlobalComponents;
|
|
53
|
+
if (__VLS_ctx.show || __VLS_ctx.showBtn) {
|
|
54
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("tutorial-alert pt-3 pb-2 pr-3") }, });
|
|
55
|
+
if (__VLS_ctx.show) {
|
|
56
|
+
const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VAlert;
|
|
57
|
+
/** @type { [typeof __VLS_components.VAlert, typeof __VLS_components.vAlert, typeof __VLS_components.VAlert, typeof __VLS_components.vAlert, ] } */
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ dark: (true), color: ("success"), density: ("compact"), border: ("start"), ...{ class: ("ma-0") }, variant: ((__VLS_ctx.theme.current.value.dark ? 'outlined' : 'flat')), }));
|
|
60
|
+
const __VLS_2 = __VLS_1({ dark: (true), color: ("success"), density: ("compact"), border: ("start"), ...{ class: ("ma-0") }, variant: ((__VLS_ctx.theme.current.value.dark ? 'outlined' : 'flat')), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
61
|
+
var __VLS_6 = {};
|
|
62
|
+
if (__VLS_ctx.href) {
|
|
63
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.a, __VLS_intrinsicElements.a)({ href: ((__VLS_ctx.href)), target: ("_blank"), });
|
|
64
|
+
(__VLS_ctx.text || __VLS_ctx.$t('readDoc'));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
if (__VLS_ctx.text) {
|
|
68
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.span)({});
|
|
69
|
+
__VLS_directiveAsFunction(__VLS_directives.vText)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.text) }, null, null);
|
|
70
|
+
}
|
|
71
|
+
else if (__VLS_ctx.html) {
|
|
72
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.div)({});
|
|
73
|
+
__VLS_directiveAsFunction(__VLS_directives.vHtml)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.html) }, null, null);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
__VLS_nonNullable(__VLS_5.slots).default;
|
|
77
|
+
__VLS_nonNullable(__VLS_5.slots).default;
|
|
78
|
+
const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
|
|
79
|
+
}
|
|
80
|
+
if (__VLS_ctx.showBtn) {
|
|
81
|
+
const __VLS_7 = __VLS_resolvedLocalAndGlobalComponents.VBtn;
|
|
82
|
+
/** @type { [typeof __VLS_components.VBtn, typeof __VLS_components.vBtn, typeof __VLS_components.VBtn, typeof __VLS_components.vBtn, ] } */
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
const __VLS_8 = __VLS_asFunctionalComponent(__VLS_7, new __VLS_7({ ...{ 'onClick': {} }, ...{ class: ("toggle") }, icon: (true), density: ("compact"), color: ("success"), title: ((__VLS_ctx.show ? __VLS_ctx.$t('closeHelp') : __VLS_ctx.$t('readHelp'))), }));
|
|
85
|
+
const __VLS_9 = __VLS_8({ ...{ 'onClick': {} }, ...{ class: ("toggle") }, icon: (true), density: ("compact"), color: ("success"), title: ((__VLS_ctx.show ? __VLS_ctx.$t('closeHelp') : __VLS_ctx.$t('readHelp'))), }, ...__VLS_functionalComponentArgsRest(__VLS_8));
|
|
86
|
+
let __VLS_13;
|
|
87
|
+
const __VLS_14 = {
|
|
88
|
+
onClick: (...[$event]) => {
|
|
89
|
+
if (!((__VLS_ctx.show || __VLS_ctx.showBtn)))
|
|
90
|
+
return;
|
|
91
|
+
if (!((__VLS_ctx.showBtn)))
|
|
92
|
+
return;
|
|
93
|
+
__VLS_ctx.show = !__VLS_ctx.show;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
let __VLS_10;
|
|
97
|
+
let __VLS_11;
|
|
98
|
+
if (__VLS_ctx.show) {
|
|
99
|
+
const __VLS_15 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
|
|
100
|
+
/** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
const __VLS_16 = __VLS_asFunctionalComponent(__VLS_15, new __VLS_15({}));
|
|
103
|
+
const __VLS_17 = __VLS_16({}, ...__VLS_functionalComponentArgsRest(__VLS_16));
|
|
104
|
+
__VLS_nonNullable(__VLS_20.slots).default;
|
|
105
|
+
const __VLS_20 = __VLS_pickFunctionalComponentCtx(__VLS_15, __VLS_17);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const __VLS_21 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
|
|
109
|
+
/** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
const __VLS_22 = __VLS_asFunctionalComponent(__VLS_21, new __VLS_21({}));
|
|
112
|
+
const __VLS_23 = __VLS_22({}, ...__VLS_functionalComponentArgsRest(__VLS_22));
|
|
113
|
+
__VLS_nonNullable(__VLS_26.slots).default;
|
|
114
|
+
const __VLS_26 = __VLS_pickFunctionalComponentCtx(__VLS_21, __VLS_23);
|
|
115
|
+
}
|
|
116
|
+
__VLS_nonNullable(__VLS_12.slots).default;
|
|
117
|
+
const __VLS_12 = __VLS_pickFunctionalComponentCtx(__VLS_7, __VLS_9);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
__VLS_styleScopedClasses['tutorial-alert'];
|
|
121
|
+
__VLS_styleScopedClasses['pt-3'];
|
|
122
|
+
__VLS_styleScopedClasses['pb-2'];
|
|
123
|
+
__VLS_styleScopedClasses['pr-3'];
|
|
124
|
+
__VLS_styleScopedClasses['ma-0'];
|
|
125
|
+
__VLS_styleScopedClasses['toggle'];
|
|
126
|
+
var __VLS_slots;
|
|
127
|
+
var __VLS_inheritedAttrs;
|
|
128
|
+
const __VLS_refs = {};
|
|
129
|
+
var $refs;
|
|
130
|
+
return {
|
|
131
|
+
slots: __VLS_slots,
|
|
132
|
+
refs: $refs,
|
|
133
|
+
attrs: {},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
;
|
|
137
|
+
let __VLS_self;
|
|
138
|
+
//# sourceMappingURL=tutorial-alert.vue.js.map
|
package/user-avatar.vue
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="sd-avatar"
|
|
4
|
+
:class="{'has-secondary-avatar': showSecondAvatar}"
|
|
5
|
+
>
|
|
6
|
+
<v-avatar
|
|
7
|
+
v-if="showAccount && session.state.account && session.state.account.type === 'user'"
|
|
8
|
+
class="primary-avatar"
|
|
9
|
+
:size="36"
|
|
10
|
+
>
|
|
11
|
+
<img
|
|
12
|
+
:src="userAvatarUrl"
|
|
13
|
+
aria-hidden
|
|
14
|
+
alt=""
|
|
15
|
+
>
|
|
16
|
+
</v-avatar>
|
|
17
|
+
<v-avatar
|
|
18
|
+
v-else
|
|
19
|
+
class="primary-avatar"
|
|
20
|
+
:size="36"
|
|
21
|
+
>
|
|
22
|
+
<img
|
|
23
|
+
:src="accountAvatarUrl"
|
|
24
|
+
aria-hidden
|
|
25
|
+
alt=""
|
|
26
|
+
>
|
|
27
|
+
</v-avatar>
|
|
28
|
+
<v-avatar
|
|
29
|
+
v-if="showSecondAvatar"
|
|
30
|
+
class="secondary-avatar"
|
|
31
|
+
:size="28"
|
|
32
|
+
>
|
|
33
|
+
<img
|
|
34
|
+
:src="userAvatarUrl"
|
|
35
|
+
aria-hidden
|
|
36
|
+
alt=""
|
|
37
|
+
>
|
|
38
|
+
</v-avatar>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup>
|
|
43
|
+
import { computed } from 'vue'
|
|
44
|
+
import { useSession } from '@data-fair/lib/vue/session.js'
|
|
45
|
+
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
showAccount: { type: Boolean, default: false }
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const session = useSession()
|
|
51
|
+
const userAvatarUrl = computed(() => session.state.user && `/simple-directory/api/avatars/user/${session.state.user.id}/avatar.png`)
|
|
52
|
+
const accountAvatarUrl = computed(() => {
|
|
53
|
+
if (!session.state.account) return
|
|
54
|
+
let url = `/simple-directory/api/avatars/${session.state.account.type}/${session.state.account.id}`
|
|
55
|
+
if (session.state.account.department) url += `/${session.state.account.department}`
|
|
56
|
+
url += '/avatar.png'
|
|
57
|
+
return url
|
|
58
|
+
})
|
|
59
|
+
const showSecondAvatar = computed(() => props.showAccount && session.state.account && session.state.account.type !== 'user')
|
|
60
|
+
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style>
|
|
64
|
+
.sd-avatar {
|
|
65
|
+
width: 36px;
|
|
66
|
+
text-indent: 0;
|
|
67
|
+
}
|
|
68
|
+
.sd-avatar.has-secondary-avatar {
|
|
69
|
+
width: 56px;
|
|
70
|
+
height: 40px;
|
|
71
|
+
position: relative;
|
|
72
|
+
margin-left: 8px;
|
|
73
|
+
margin-right: 8px;
|
|
74
|
+
}
|
|
75
|
+
.sd-avatar.has-secondary-avatar .primary-avatar {
|
|
76
|
+
position: absolute;
|
|
77
|
+
left: 0;
|
|
78
|
+
top: 0
|
|
79
|
+
}
|
|
80
|
+
.sd-avatar .secondary-avatar {
|
|
81
|
+
position:absolute;
|
|
82
|
+
right:0px;
|
|
83
|
+
bottom:0;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
showAccount: boolean;
|
|
3
|
+
$props: {
|
|
4
|
+
readonly showAccount?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { useSession } from '@data-fair/lib/vue/session.js';
|
|
4
|
+
const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
showAccount: { type: Boolean, default: false }
|
|
7
|
+
});
|
|
8
|
+
const session = useSession();
|
|
9
|
+
const userAvatarUrl = computed(() => session.state.user && `/simple-directory/api/avatars/user/${session.state.user.id}/avatar.png`);
|
|
10
|
+
const accountAvatarUrl = computed(() => {
|
|
11
|
+
if (!session.state.account)
|
|
12
|
+
return;
|
|
13
|
+
let url = `/simple-directory/api/avatars/${session.state.account.type}/${session.state.account.id}`;
|
|
14
|
+
if (session.state.account.department)
|
|
15
|
+
url += `/${session.state.account.department}`;
|
|
16
|
+
url += '/avatar.png';
|
|
17
|
+
return url;
|
|
18
|
+
});
|
|
19
|
+
const showSecondAvatar = computed(() => props.showAccount && session.state.account && session.state.account.type !== 'user');
|
|
20
|
+
const __VLS_fnComponent = (await import('vue')).defineComponent({
|
|
21
|
+
props: {
|
|
22
|
+
showAccount: { type: Boolean, default: false }
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
;
|
|
26
|
+
let __VLS_functionalComponentProps;
|
|
27
|
+
function __VLS_template() {
|
|
28
|
+
const __VLS_ctx = {};
|
|
29
|
+
const __VLS_localComponents = {
|
|
30
|
+
...{},
|
|
31
|
+
...{},
|
|
32
|
+
...__VLS_ctx,
|
|
33
|
+
};
|
|
34
|
+
let __VLS_components;
|
|
35
|
+
const __VLS_localDirectives = {
|
|
36
|
+
...{},
|
|
37
|
+
...__VLS_ctx,
|
|
38
|
+
};
|
|
39
|
+
let __VLS_directives;
|
|
40
|
+
let __VLS_styleScopedClasses;
|
|
41
|
+
// CSS variable injection
|
|
42
|
+
// CSS variable injection end
|
|
43
|
+
let __VLS_resolvedLocalAndGlobalComponents;
|
|
44
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("sd-avatar") }, ...{ class: (({ 'has-secondary-avatar': __VLS_ctx.showSecondAvatar })) }, });
|
|
45
|
+
if (__VLS_ctx.showAccount && __VLS_ctx.session.state.account && __VLS_ctx.session.state.account.type === 'user') {
|
|
46
|
+
const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VAvatar;
|
|
47
|
+
/** @type { [typeof __VLS_components.VAvatar, typeof __VLS_components.vAvatar, typeof __VLS_components.VAvatar, typeof __VLS_components.vAvatar, ] } */
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ ...{ class: ("primary-avatar") }, size: ((36)), }));
|
|
50
|
+
const __VLS_2 = __VLS_1({ ...{ class: ("primary-avatar") }, size: ((36)), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
51
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.img, __VLS_intrinsicElements.img)({ src: ((__VLS_ctx.userAvatarUrl)), "aria-hidden": (true), alt: (""), });
|
|
52
|
+
__VLS_nonNullable(__VLS_5.slots).default;
|
|
53
|
+
const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
const __VLS_6 = __VLS_resolvedLocalAndGlobalComponents.VAvatar;
|
|
57
|
+
/** @type { [typeof __VLS_components.VAvatar, typeof __VLS_components.vAvatar, typeof __VLS_components.VAvatar, typeof __VLS_components.vAvatar, ] } */
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
const __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({ ...{ class: ("primary-avatar") }, size: ((36)), }));
|
|
60
|
+
const __VLS_8 = __VLS_7({ ...{ class: ("primary-avatar") }, size: ((36)), }, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
61
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.img, __VLS_intrinsicElements.img)({ src: ((__VLS_ctx.accountAvatarUrl)), "aria-hidden": (true), alt: (""), });
|
|
62
|
+
__VLS_nonNullable(__VLS_11.slots).default;
|
|
63
|
+
const __VLS_11 = __VLS_pickFunctionalComponentCtx(__VLS_6, __VLS_8);
|
|
64
|
+
}
|
|
65
|
+
if (__VLS_ctx.showSecondAvatar) {
|
|
66
|
+
const __VLS_12 = __VLS_resolvedLocalAndGlobalComponents.VAvatar;
|
|
67
|
+
/** @type { [typeof __VLS_components.VAvatar, typeof __VLS_components.vAvatar, typeof __VLS_components.VAvatar, typeof __VLS_components.vAvatar, ] } */
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
const __VLS_13 = __VLS_asFunctionalComponent(__VLS_12, new __VLS_12({ ...{ class: ("secondary-avatar") }, size: ((28)), }));
|
|
70
|
+
const __VLS_14 = __VLS_13({ ...{ class: ("secondary-avatar") }, size: ((28)), }, ...__VLS_functionalComponentArgsRest(__VLS_13));
|
|
71
|
+
__VLS_elementAsFunction(__VLS_intrinsicElements.img, __VLS_intrinsicElements.img)({ src: ((__VLS_ctx.userAvatarUrl)), "aria-hidden": (true), alt: (""), });
|
|
72
|
+
__VLS_nonNullable(__VLS_17.slots).default;
|
|
73
|
+
const __VLS_17 = __VLS_pickFunctionalComponentCtx(__VLS_12, __VLS_14);
|
|
74
|
+
}
|
|
75
|
+
__VLS_styleScopedClasses['sd-avatar'];
|
|
76
|
+
__VLS_styleScopedClasses['has-secondary-avatar'];
|
|
77
|
+
__VLS_styleScopedClasses['primary-avatar'];
|
|
78
|
+
__VLS_styleScopedClasses['primary-avatar'];
|
|
79
|
+
__VLS_styleScopedClasses['secondary-avatar'];
|
|
80
|
+
var __VLS_slots;
|
|
81
|
+
var __VLS_inheritedAttrs;
|
|
82
|
+
const __VLS_refs = {};
|
|
83
|
+
var $refs;
|
|
84
|
+
return {
|
|
85
|
+
slots: __VLS_slots,
|
|
86
|
+
refs: $refs,
|
|
87
|
+
attrs: {},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
;
|
|
91
|
+
const __VLS_self = (await import('vue')).defineComponent({
|
|
92
|
+
setup() {
|
|
93
|
+
return {
|
|
94
|
+
$props: __VLS_makeOptional(props),
|
|
95
|
+
...props,
|
|
96
|
+
session: session,
|
|
97
|
+
userAvatarUrl: userAvatarUrl,
|
|
98
|
+
accountAvatarUrl: accountAvatarUrl,
|
|
99
|
+
showSecondAvatar: showSecondAvatar,
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
export default (await import('vue')).defineComponent({
|
|
104
|
+
setup() {
|
|
105
|
+
return {
|
|
106
|
+
$props: __VLS_makeOptional(props),
|
|
107
|
+
...props,
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
;
|
|
112
|
+
//# sourceMappingURL=user-avatar.vue.js.map
|