@data-fair/lib-vuetify 1.0.1 → 1.1.1

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.
@@ -0,0 +1,11 @@
1
+ // made for https://github.com/unplugin/unplugin-auto-import
2
+ import vueAutoImports from '@data-fair/lib-vue/auto-imports.js'
3
+ export default [
4
+ ...vueAutoImports,
5
+ {
6
+ '@data-fair/lib-vuetify/personal-menu.vue': [['default', 'dfPersonalMenu']],
7
+ '@data-fair/lib-vuetify/tutorial-alert.vue': [['default', 'dfTutorialAlert']],
8
+ '@data-fair/lib-vuetify/user-avatar.vue': [['default', 'dfUserAvatar']]
9
+ }
10
+ ]
11
+ // # sourceMappingURL=auto-imports.js.map
package/default.scss ADDED
@@ -0,0 +1,10 @@
1
+ @use 'vuetify' with (
2
+ $color-pack: false,
3
+ $body-font-family: 'Nunito'
4
+ );
5
+
6
+ // v-icon has an opacity when it is prepended in a list of items.
7
+ // ref: https://github.com/vuetifyjs/vuetify/issues/18760
8
+ .v-icon {
9
+ --v-medium-emphasis-opacity: 1 !important;
10
+ }
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { VuetifyOptions } from 'vuetify';
2
- export declare function defaultOptions(searchParams: Record<string, string>, darkCookie?: boolean): VuetifyOptions;
2
+ export declare function defaultOptions(searchParams: Record<string, string>, darkCookie?: boolean, locale?: 'fr' | 'en'): VuetifyOptions;
package/index.js CHANGED
@@ -13,7 +13,7 @@ const baseDarkColors = {
13
13
  primary: '#2196F3', // blue.base
14
14
  success: '#00E676' // green.accent3
15
15
  }
16
- export function defaultOptions (searchParams, darkCookie = false) {
16
+ export function defaultOptions (searchParams, darkCookie = false, locale = 'fr') {
17
17
  const dark = searchParams?.dark ? searchParams.dark === 'true' : darkCookie
18
18
  const searchParamsColors = {}
19
19
  for (const colorCode of ['primary', 'secondary']) {
@@ -25,9 +25,9 @@ export function defaultOptions (searchParams, darkCookie = false) {
25
25
  return {
26
26
  ssr: false,
27
27
  locale: {
28
- locale: 'fr',
28
+ locale,
29
29
  messages: { fr, en }
30
- }, // TODO: sync this with the i18n locale
30
+ },
31
31
  theme: {
32
32
  defaultTheme,
33
33
  themes: {
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vuetify",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Components based on the Vuetify 3 UI lib for the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "**/*.js",
8
8
  "**/*.d.ts",
9
- "**/*.vue"
9
+ "**/*.vue",
10
+ "**/*.scss"
10
11
  ],
11
12
  "author": "",
12
13
  "license": "MIT",
@@ -15,13 +16,14 @@
15
16
  "build": "cd .. && npm run build"
16
17
  },
17
18
  "peerDependencies": {
18
- "@data-fair/lib-vue": "^1.0.1",
19
+ "@data-fair/lib-vue": "^1.1.0",
19
20
  "ofetch": "1",
20
21
  "vue-i18n": "10",
21
22
  "vuetify": "3"
22
23
  },
23
24
  "type": "module",
24
25
  "dependencies": {
25
- "@data-fair/lib-common-types": "^1.1.0"
26
+ "@data-fair/lib-common-types": "^1.1.0",
27
+ "@mdi/js": "^7.4.47"
26
28
  }
27
29
  }
@@ -18,7 +18,7 @@
18
18
  v-if="href"
19
19
  :href="href"
20
20
  target="_blank"
21
- >{{ text || $t('readDoc') }}</a>
21
+ >{{ text || t('readDoc') }}</a>
22
22
  <template v-else>
23
23
  <span
24
24
  v-if="text"
@@ -37,15 +37,11 @@
37
37
  icon
38
38
  density="compact"
39
39
  color="success"
40
- :title="show ? $t('closeHelp') : $t('readHelp')"
40
+ :title="show ? t('closeHelp') : t('readHelp')"
41
41
  @click="show = !show"
42
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>
43
+ <v-icon v-if="show":icon="mdiCloseCircle" />
44
+ <v-icon v-else :icon="mdiInformation" />
49
45
  </v-btn>
50
46
  </div>
51
47
  </template>
@@ -62,7 +58,9 @@ en:
62
58
  </i18n>
63
59
 
64
60
  <script lang="ts">
65
- import { useTheme } from 'vuetify';
61
+ import { useTheme } from 'vuetify'
62
+ import { useI18n } from 'vue-i18n'
63
+ import { mdiCloseCircle, mdiInformation } from '@mdi/js'
66
64
 
67
65
  export default {
68
66
  props: {
@@ -73,12 +71,15 @@ export default {
73
71
  initial: { type: Boolean, default: true },
74
72
  persistent: { type: Boolean, default: false }
75
73
  },
76
- setup() {
74
+ setup () {
77
75
  const theme = useTheme()
78
- return {theme}
76
+ const { t } = useI18n({ useScope: 'local' })
77
+ return { theme, t }
79
78
  },
80
79
  data: () => ({
81
- show: false
80
+ show: false,
81
+ mdiCloseCircle,
82
+ mdiInformation
82
83
  }),
83
84
  computed: {
84
85
  showBtn () {
@@ -28,8 +28,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
28
28
  };
29
29
  }>, {
30
30
  theme: import("vuetify", { with: { "resolution-mode": "import" } }).ThemeInstance;
31
+ t: import("vue-i18n").ComposerTranslation<{}, string, import("@intlify/core-base").RemoveIndexSignature<{
32
+ [x: string]: import("vue-i18n").LocaleMessageValue<import("vue-i18n").VueMessageType>;
33
+ }>, never, never, never>;
31
34
  }, {
32
35
  show: boolean;
36
+ mdiCloseCircle: string;
37
+ mdiInformation: string;
33
38
  }, {
34
39
  showBtn(): boolean;
35
40
  }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -1,5 +1,7 @@
1
1
  /// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
2
2
  import { useTheme } from 'vuetify';
3
+ import { useI18n } from 'vue-i18n';
4
+ import { mdiCloseCircle, mdiInformation } from '@mdi/js';
3
5
  export default (await import('vue')).defineComponent({
4
6
  props: {
5
7
  id: { type: String, required: true },
@@ -11,10 +13,13 @@ export default (await import('vue')).defineComponent({
11
13
  },
12
14
  setup() {
13
15
  const theme = useTheme();
14
- return { theme };
16
+ const { t } = useI18n({ useScope: 'local' });
17
+ return { theme, t };
15
18
  },
16
19
  data: () => ({
17
- show: false
20
+ show: false,
21
+ mdiCloseCircle,
22
+ mdiInformation
18
23
  }),
19
24
  computed: {
20
25
  showBtn() {
@@ -61,7 +66,7 @@ function __VLS_template() {
61
66
  var __VLS_6 = {};
62
67
  if (__VLS_ctx.href) {
63
68
  __VLS_elementAsFunction(__VLS_intrinsicElements.a, __VLS_intrinsicElements.a)({ href: ((__VLS_ctx.href)), target: ("_blank"), });
64
- (__VLS_ctx.text || __VLS_ctx.$t('readDoc'));
69
+ (__VLS_ctx.text || __VLS_ctx.t('readDoc'));
65
70
  }
66
71
  else {
67
72
  if (__VLS_ctx.text) {
@@ -81,8 +86,8 @@ function __VLS_template() {
81
86
  const __VLS_7 = __VLS_resolvedLocalAndGlobalComponents.VBtn;
82
87
  /** @type { [typeof __VLS_components.VBtn, typeof __VLS_components.vBtn, typeof __VLS_components.VBtn, typeof __VLS_components.vBtn, ] } */
83
88
  // @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));
89
+ 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'))), }));
90
+ 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
91
  let __VLS_13;
87
92
  const __VLS_14 = {
88
93
  onClick: (...[$event]) => {
@@ -97,21 +102,17 @@ function __VLS_template() {
97
102
  let __VLS_11;
98
103
  if (__VLS_ctx.show) {
99
104
  const __VLS_15 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
100
- /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
105
+ /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
101
106
  // @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);
107
+ const __VLS_16 = __VLS_asFunctionalComponent(__VLS_15, new __VLS_15({ icon: ((__VLS_ctx.mdiCloseCircle)), }));
108
+ const __VLS_17 = __VLS_16({ icon: ((__VLS_ctx.mdiCloseCircle)), }, ...__VLS_functionalComponentArgsRest(__VLS_16));
106
109
  }
107
110
  else {
108
111
  const __VLS_21 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
109
- /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
112
+ /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
110
113
  // @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);
114
+ const __VLS_22 = __VLS_asFunctionalComponent(__VLS_21, new __VLS_21({ icon: ((__VLS_ctx.mdiInformation)), }));
115
+ const __VLS_23 = __VLS_22({ icon: ((__VLS_ctx.mdiInformation)), }, ...__VLS_functionalComponentArgsRest(__VLS_22));
115
116
  }
116
117
  __VLS_nonNullable(__VLS_12.slots).default;
117
118
  const __VLS_12 = __VLS_pickFunctionalComponentCtx(__VLS_7, __VLS_9);
package/ui-notif.vue ADDED
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <v-snackbar
3
+ v-if="notification"
4
+ ref="notificationSnackbar"
5
+ v-model="showNotification"
6
+ class="ui-notification"
7
+ v-bind="fullSnackbarProps"
8
+ >
9
+ <p>{{ notification.msg }}</p>
10
+ <p
11
+ v-if="notification.type === 'error'"
12
+ class="ml-3"
13
+ v-html="notification.errorMsg"
14
+ />
15
+
16
+ <template #actions>
17
+ <v-btn
18
+ icon
19
+ @click.native="showNotification = false"
20
+ >
21
+ <v-icon :icon="mdiClose" />
22
+ </v-btn>
23
+ </template>
24
+ </v-snackbar>
25
+ </template>
26
+
27
+ <script setup lang="ts">
28
+ import { computed, ref, watch } from 'vue'
29
+ import { useUiNotif } from '@data-fair/lib-vue/ui-notif.js'
30
+ import inIframe from '@data-fair/lib-utils/in-iframe.js'
31
+ import { mdiClose } from '@mdi/js'
32
+
33
+ const uiNotif = useUiNotif()
34
+
35
+ const notification = computed(() => uiNotif.notification.value)
36
+ const showNotification = ref(false)
37
+
38
+ watch(() => notification.value, async () => {
39
+ showNotification.value = false
40
+ if (!inIframe && notification.value) {
41
+ await new Promise(resolve => setTimeout(resolve, 300))
42
+ showNotification.value = true
43
+ }
44
+ }, {immediate: true})
45
+
46
+ const { snackbarProps } = defineProps({
47
+ snackbarProps: {
48
+ type: Object,
49
+ default () {
50
+ return { tile: true, right: true, bottom: true, timeout: 30000 }
51
+ }
52
+ }
53
+ })
54
+
55
+ const fullSnackbarProps = computed(() => {
56
+ const props = { ...snackbarProps }
57
+ if (!notification.value) return props
58
+ if (notification.value.type === 'error') props.timeout = -1
59
+ props.color = notification.value.type
60
+ return props
61
+ })
62
+
63
+ </script>
64
+
65
+ <style>
66
+ </style>
@@ -0,0 +1,24 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ snackbarProps: {
3
+ type: ObjectConstructor;
4
+ default(): {
5
+ tile: boolean;
6
+ right: boolean;
7
+ bottom: boolean;
8
+ timeout: number;
9
+ };
10
+ };
11
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ snackbarProps: {
13
+ type: ObjectConstructor;
14
+ default(): {
15
+ tile: boolean;
16
+ right: boolean;
17
+ bottom: boolean;
18
+ timeout: number;
19
+ };
20
+ };
21
+ }>> & Readonly<{}>, {
22
+ snackbarProps: Record<string, any>;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
24
+ export default _default;
@@ -0,0 +1,154 @@
1
+ /// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
2
+ import { computed, ref, watch } from 'vue';
3
+ import { useUiNotif } from '@data-fair/lib-vue/ui-notif.js';
4
+ import inIframe from '@data-fair/lib-utils/in-iframe.js';
5
+ import { mdiClose } from '@mdi/js';
6
+ const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
7
+ const uiNotif = useUiNotif();
8
+ const notification = computed(() => uiNotif.notification.value);
9
+ const showNotification = ref(false);
10
+ watch(() => notification.value, async () => {
11
+ showNotification.value = false;
12
+ if (!inIframe && notification.value) {
13
+ await new Promise(resolve => setTimeout(resolve, 300));
14
+ showNotification.value = true;
15
+ }
16
+ }, { immediate: true });
17
+ const __VLS_props = defineProps({
18
+ snackbarProps: {
19
+ type: Object,
20
+ default() {
21
+ return { tile: true, right: true, bottom: true, timeout: 30000 };
22
+ }
23
+ }
24
+ });
25
+ const { snackbarProps } = __VLS_props;
26
+ const fullSnackbarProps = computed(() => {
27
+ const props = { ...snackbarProps };
28
+ if (!notification.value)
29
+ return props;
30
+ if (notification.value.type === 'error')
31
+ props.timeout = -1;
32
+ props.color = notification.value.type;
33
+ return props;
34
+ });
35
+ const __VLS_fnComponent = (await import('vue')).defineComponent({
36
+ props: {
37
+ snackbarProps: {
38
+ type: Object,
39
+ default() {
40
+ return { tile: true, right: true, bottom: true, timeout: 30000 };
41
+ }
42
+ }
43
+ },
44
+ });
45
+ ;
46
+ let __VLS_functionalComponentProps;
47
+ function __VLS_template() {
48
+ const __VLS_ctx = {};
49
+ const __VLS_localComponents = {
50
+ ...{},
51
+ ...{},
52
+ ...__VLS_ctx,
53
+ };
54
+ let __VLS_components;
55
+ const __VLS_localDirectives = {
56
+ ...{},
57
+ ...__VLS_ctx,
58
+ };
59
+ let __VLS_directives;
60
+ let __VLS_styleScopedClasses;
61
+ // CSS variable injection
62
+ // CSS variable injection end
63
+ let __VLS_resolvedLocalAndGlobalComponents;
64
+ if (__VLS_ctx.notification) {
65
+ const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VSnackbar;
66
+ /** @type { [typeof __VLS_components.VSnackbar, typeof __VLS_components.vSnackbar, typeof __VLS_components.VSnackbar, typeof __VLS_components.vSnackbar, ] } */
67
+ // @ts-ignore
68
+ const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ ref: ("notificationSnackbar"), modelValue: ((__VLS_ctx.showNotification)), ...{ class: ("ui-notification") }, ...(__VLS_ctx.fullSnackbarProps), }));
69
+ const __VLS_2 = __VLS_1({ ref: ("notificationSnackbar"), modelValue: ((__VLS_ctx.showNotification)), ...{ class: ("ui-notification") }, ...(__VLS_ctx.fullSnackbarProps), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
70
+ // @ts-ignore navigation for `const notificationSnackbar = ref()`
71
+ __VLS_ctx.notificationSnackbar;
72
+ var __VLS_6 = {};
73
+ __VLS_elementAsFunction(__VLS_intrinsicElements.p, __VLS_intrinsicElements.p)({});
74
+ (__VLS_ctx.notification.msg);
75
+ if (__VLS_ctx.notification.type === 'error') {
76
+ __VLS_elementAsFunction(__VLS_intrinsicElements.p)({ ...{ class: ("ml-3") }, });
77
+ __VLS_directiveAsFunction(__VLS_directives.vHtml)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.notification.errorMsg) }, null, null);
78
+ }
79
+ __VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
80
+ {
81
+ const { actions: __VLS_thisSlot } = __VLS_nonNullable(__VLS_5.slots);
82
+ const __VLS_7 = __VLS_resolvedLocalAndGlobalComponents.VBtn;
83
+ /** @type { [typeof __VLS_components.VBtn, typeof __VLS_components.vBtn, typeof __VLS_components.VBtn, typeof __VLS_components.vBtn, ] } */
84
+ // @ts-ignore
85
+ const __VLS_8 = __VLS_asFunctionalComponent(__VLS_7, new __VLS_7({ ...{ 'onClick': {} }, icon: (true), }));
86
+ const __VLS_9 = __VLS_8({ ...{ 'onClick': {} }, icon: (true), }, ...__VLS_functionalComponentArgsRest(__VLS_8));
87
+ let __VLS_13;
88
+ const __VLS_14 = {
89
+ onClick: (...[$event]) => {
90
+ if (!((__VLS_ctx.notification)))
91
+ return;
92
+ __VLS_ctx.showNotification = false;
93
+ }
94
+ };
95
+ let __VLS_10;
96
+ let __VLS_11;
97
+ const __VLS_15 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
98
+ /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
99
+ // @ts-ignore
100
+ const __VLS_16 = __VLS_asFunctionalComponent(__VLS_15, new __VLS_15({ icon: ((__VLS_ctx.mdiClose)), }));
101
+ const __VLS_17 = __VLS_16({ icon: ((__VLS_ctx.mdiClose)), }, ...__VLS_functionalComponentArgsRest(__VLS_16));
102
+ __VLS_nonNullable(__VLS_12.slots).default;
103
+ const __VLS_12 = __VLS_pickFunctionalComponentCtx(__VLS_7, __VLS_9);
104
+ }
105
+ const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
106
+ }
107
+ __VLS_styleScopedClasses['ui-notification'];
108
+ __VLS_styleScopedClasses['ml-3'];
109
+ var __VLS_slots;
110
+ var __VLS_inheritedAttrs;
111
+ const __VLS_refs = {
112
+ "notificationSnackbar": __VLS_6,
113
+ };
114
+ var $refs;
115
+ return {
116
+ slots: __VLS_slots,
117
+ refs: $refs,
118
+ attrs: {},
119
+ };
120
+ }
121
+ ;
122
+ const __VLS_self = (await import('vue')).defineComponent({
123
+ setup() {
124
+ return {
125
+ mdiClose: mdiClose,
126
+ notification: notification,
127
+ showNotification: showNotification,
128
+ fullSnackbarProps: fullSnackbarProps,
129
+ };
130
+ },
131
+ props: {
132
+ snackbarProps: {
133
+ type: Object,
134
+ default() {
135
+ return { tile: true, right: true, bottom: true, timeout: 30000 };
136
+ }
137
+ }
138
+ },
139
+ });
140
+ export default (await import('vue')).defineComponent({
141
+ setup() {
142
+ return {};
143
+ },
144
+ props: {
145
+ snackbarProps: {
146
+ type: Object,
147
+ default() {
148
+ return { tile: true, right: true, bottom: true, timeout: 30000 };
149
+ }
150
+ }
151
+ },
152
+ });
153
+ ;
154
+ //# sourceMappingURL=ui-notif.vue.js.map
package/user-avatar.vue CHANGED
@@ -48,10 +48,10 @@ const props = defineProps({
48
48
  })
49
49
 
50
50
  const session = useSession()
51
- const userAvatarUrl = computed(() => session.state.user && `/simple-directory/api/avatars/user/${session.state.user.id}/avatar.png`)
51
+ const userAvatarUrl = computed(() => session.state.user && `${session.options.directoryUrl}/api/avatars/user/${session.state.user.id}/avatar.png`)
52
52
  const accountAvatarUrl = computed(() => {
53
53
  if (!session.state.account) return
54
- let url = `/simple-directory/api/avatars/${session.state.account.type}/${session.state.account.id}`
54
+ let url = `${session.options.directoryUrl}/api/avatars/${session.state.account.type}/${session.state.account.id}`
55
55
  if (session.state.account.department) url += `/${session.state.account.department}`
56
56
  url += '/avatar.png'
57
57
  return url
@@ -6,11 +6,11 @@ const props = defineProps({
6
6
  showAccount: { type: Boolean, default: false }
7
7
  });
8
8
  const session = useSession();
9
- const userAvatarUrl = computed(() => session.state.user && `/simple-directory/api/avatars/user/${session.state.user.id}/avatar.png`);
9
+ const userAvatarUrl = computed(() => session.state.user && `${session.options.directoryUrl}/api/avatars/user/${session.state.user.id}/avatar.png`);
10
10
  const accountAvatarUrl = computed(() => {
11
11
  if (!session.state.account)
12
12
  return;
13
- let url = `/simple-directory/api/avatars/${session.state.account.type}/${session.state.account.id}`;
13
+ let url = `${session.options.directoryUrl}/api/avatars/${session.state.account.type}/${session.state.account.id}`;
14
14
  if (session.state.account.department)
15
15
  url += `/${session.state.account.department}`;
16
16
  url += '/avatar.png';
package/vite.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export declare const autoImports: (string | {
2
+ '@data-fair/lib-vue/session.js': string[];
3
+ '@data-fair/lib-vue/reactive-search-params.js': string[];
4
+ '@data-fair/lib-vue/locale-dayjs.js': string[];
5
+ '@data-fair/lib-vue/concept-filters.js': string[];
6
+ '@data-fair/lib-vue/ui-notif.js': string[];
7
+ } | {
8
+ '@data-fair/lib-vuetify/personal-menu.vue': string[][];
9
+ '@data-fair/lib-vuetify/tutorial-alert.vue': string[][];
10
+ '@data-fair/lib-vuetify/user-avatar.vue': string[][];
11
+ })[];
package/vite.js ADDED
@@ -0,0 +1,11 @@
1
+ // made for https://github.com/unplugin/unplugin-auto-import
2
+ import { autoImports as vueAutoImports } from '@data-fair/lib-vue/vite.js'
3
+ export const autoImports = [
4
+ ...vueAutoImports,
5
+ {
6
+ '@data-fair/lib-vuetify/personal-menu.vue': [['default', 'dfPersonalMenu']],
7
+ '@data-fair/lib-vuetify/tutorial-alert.vue': [['default', 'dfTutorialAlert']],
8
+ '@data-fair/lib-vuetify/user-avatar.vue': [['default', 'dfUserAvatar']]
9
+ }
10
+ ]
11
+ // # sourceMappingURL=vite.js.map