@data-fair/lib-vuetify 1.1.0 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vuetify",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Components based on the Vuetify 3 UI lib for the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -16,7 +16,7 @@
16
16
  "build": "cd .. && npm run build"
17
17
  },
18
18
  "peerDependencies": {
19
- "@data-fair/lib-vue": "^1.1.0",
19
+ "@data-fair/lib-vue": "^1.2.0",
20
20
  "ofetch": "1",
21
21
  "vue-i18n": "10",
22
22
  "vuetify": "3"
package/personal-menu.vue CHANGED
@@ -24,9 +24,8 @@
24
24
  v-if="user.pd"
25
25
  color="warning"
26
26
  style="position:absolute;"
27
- >
28
- mdi-alert
29
- </v-icon>
27
+ :icon="mdiAlert"
28
+ />
30
29
  </v-btn>
31
30
  </template>
32
31
 
@@ -134,7 +133,7 @@
134
133
  class="personal-menu-switch-list-item"
135
134
  >
136
135
  <template #prepend>
137
- <v-icon>mdi-shield-alert</v-icon>
136
+ <v-icon :icon="mdiShieldAlert" />
138
137
  </template>
139
138
  <v-list-item-title>
140
139
  <v-switch
@@ -157,7 +156,7 @@
157
156
  @click="session.asAdmin(null)"
158
157
  >
159
158
  <template #prepend>
160
- <v-icon>mdi-account-switch-outline</v-icon>
159
+ <v-icon :icon="mdiAccountSwitchOutline" />
161
160
  </template>
162
161
  <v-list-item-title>{{ t('backToAdmin') }}</v-list-item-title>
163
162
  </v-list-item>
@@ -169,7 +168,7 @@
169
168
  class="personal-menu-switch-list-item"
170
169
  >
171
170
  <template #prepend>
172
- <v-icon>mdi-weather-night</v-icon>
171
+ <v-icon :icon="mdiWeatherNight" />
173
172
  </template>
174
173
  <v-list-item-title>
175
174
  <v-switch
@@ -190,7 +189,7 @@
190
189
  @click="() => session.logout()"
191
190
  >
192
191
  <template #prepend>
193
- <v-icon>mdi-logout</v-icon>
192
+ <v-icon :icon="mdiLogout" />
194
193
  </template>
195
194
  <v-list-item-title v-t="'logout'" />
196
195
  </v-list-item>
@@ -230,6 +229,7 @@ import { useI18n } from 'vue-i18n'
230
229
  import { useSession } from '@data-fair/lib-vue/session.js'
231
230
  import { useTheme } from 'vuetify'
232
231
  import UserAvatar from './user-avatar.vue'
232
+ import { mdiAlert, mdiShieldAlert, mdiLogout, mdiAccountSwitchOutline, mdiWeatherNight } from '@mdi/js'
233
233
 
234
234
  const theme = useTheme()
235
235
  const session = useSession()
@@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
4
4
  import { useSession } from '@data-fair/lib-vue/session.js';
5
5
  import { useTheme } from 'vuetify';
6
6
  import UserAvatar from './user-avatar.vue';
7
+ import { mdiAlert, mdiShieldAlert, mdiLogout, mdiAccountSwitchOutline, mdiWeatherNight } from '@mdi/js';
7
8
  const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
8
9
  const theme = useTheme();
9
10
  const session = useSession();
@@ -83,12 +84,10 @@ function __VLS_template() {
83
84
  const __VLS_25 = __VLS_24({ showAccount: (true), }, ...__VLS_functionalComponentArgsRest(__VLS_24));
84
85
  if (__VLS_ctx.user.pd) {
85
86
  const __VLS_29 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
86
- /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
87
+ /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
87
88
  // @ts-ignore
88
- const __VLS_30 = __VLS_asFunctionalComponent(__VLS_29, new __VLS_29({ color: ("warning"), ...{ style: ({}) }, }));
89
- const __VLS_31 = __VLS_30({ color: ("warning"), ...{ style: ({}) }, }, ...__VLS_functionalComponentArgsRest(__VLS_30));
90
- __VLS_nonNullable(__VLS_34.slots).default;
91
- const __VLS_34 = __VLS_pickFunctionalComponentCtx(__VLS_29, __VLS_31);
89
+ const __VLS_30 = __VLS_asFunctionalComponent(__VLS_29, new __VLS_29({ color: ("warning"), ...{ style: ({}) }, icon: ((__VLS_ctx.mdiAlert)), }));
90
+ const __VLS_31 = __VLS_30({ color: ("warning"), ...{ style: ({}) }, icon: ((__VLS_ctx.mdiAlert)), }, ...__VLS_functionalComponentArgsRest(__VLS_30));
92
91
  }
93
92
  __VLS_nonNullable(__VLS_23.slots).default;
94
93
  const __VLS_23 = __VLS_pickFunctionalComponentCtx(__VLS_18, __VLS_20);
@@ -289,12 +288,10 @@ function __VLS_template() {
289
288
  {
290
289
  const { prepend: __VLS_thisSlot } = __VLS_nonNullable(__VLS_154.slots);
291
290
  const __VLS_155 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
292
- /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
291
+ /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
293
292
  // @ts-ignore
294
- const __VLS_156 = __VLS_asFunctionalComponent(__VLS_155, new __VLS_155({}));
295
- const __VLS_157 = __VLS_156({}, ...__VLS_functionalComponentArgsRest(__VLS_156));
296
- __VLS_nonNullable(__VLS_160.slots).default;
297
- const __VLS_160 = __VLS_pickFunctionalComponentCtx(__VLS_155, __VLS_157);
293
+ const __VLS_156 = __VLS_asFunctionalComponent(__VLS_155, new __VLS_155({ icon: ((__VLS_ctx.mdiShieldAlert)), }));
294
+ const __VLS_157 = __VLS_156({ icon: ((__VLS_ctx.mdiShieldAlert)), }, ...__VLS_functionalComponentArgsRest(__VLS_156));
298
295
  }
299
296
  const __VLS_161 = __VLS_resolvedLocalAndGlobalComponents.VListItemTitle;
300
297
  /** @type { [typeof __VLS_components.VListItemTitle, typeof __VLS_components.vListItemTitle, typeof __VLS_components.VListItemTitle, typeof __VLS_components.vListItemTitle, ] } */
@@ -339,12 +336,10 @@ function __VLS_template() {
339
336
  {
340
337
  const { prepend: __VLS_thisSlot } = __VLS_nonNullable(__VLS_180.slots);
341
338
  const __VLS_183 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
342
- /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
339
+ /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
343
340
  // @ts-ignore
344
- const __VLS_184 = __VLS_asFunctionalComponent(__VLS_183, new __VLS_183({}));
345
- const __VLS_185 = __VLS_184({}, ...__VLS_functionalComponentArgsRest(__VLS_184));
346
- __VLS_nonNullable(__VLS_188.slots).default;
347
- const __VLS_188 = __VLS_pickFunctionalComponentCtx(__VLS_183, __VLS_185);
341
+ const __VLS_184 = __VLS_asFunctionalComponent(__VLS_183, new __VLS_183({ icon: ((__VLS_ctx.mdiAccountSwitchOutline)), }));
342
+ const __VLS_185 = __VLS_184({ icon: ((__VLS_ctx.mdiAccountSwitchOutline)), }, ...__VLS_functionalComponentArgsRest(__VLS_184));
348
343
  }
349
344
  const __VLS_189 = __VLS_resolvedLocalAndGlobalComponents.VListItemTitle;
350
345
  /** @type { [typeof __VLS_components.VListItemTitle, typeof __VLS_components.vListItemTitle, typeof __VLS_components.VListItemTitle, typeof __VLS_components.vListItemTitle, ] } */
@@ -366,12 +361,10 @@ function __VLS_template() {
366
361
  {
367
362
  const { prepend: __VLS_thisSlot } = __VLS_nonNullable(__VLS_200.slots);
368
363
  const __VLS_201 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
369
- /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
364
+ /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
370
365
  // @ts-ignore
371
- const __VLS_202 = __VLS_asFunctionalComponent(__VLS_201, new __VLS_201({}));
372
- const __VLS_203 = __VLS_202({}, ...__VLS_functionalComponentArgsRest(__VLS_202));
373
- __VLS_nonNullable(__VLS_206.slots).default;
374
- const __VLS_206 = __VLS_pickFunctionalComponentCtx(__VLS_201, __VLS_203);
366
+ const __VLS_202 = __VLS_asFunctionalComponent(__VLS_201, new __VLS_201({ icon: ((__VLS_ctx.mdiWeatherNight)), }));
367
+ const __VLS_203 = __VLS_202({ icon: ((__VLS_ctx.mdiWeatherNight)), }, ...__VLS_functionalComponentArgsRest(__VLS_202));
375
368
  }
376
369
  const __VLS_207 = __VLS_resolvedLocalAndGlobalComponents.VListItemTitle;
377
370
  /** @type { [typeof __VLS_components.VListItemTitle, typeof __VLS_components.vListItemTitle, typeof __VLS_components.VListItemTitle, typeof __VLS_components.vListItemTitle, ] } */
@@ -414,12 +407,10 @@ function __VLS_template() {
414
407
  {
415
408
  const { prepend: __VLS_thisSlot } = __VLS_nonNullable(__VLS_232.slots);
416
409
  const __VLS_235 = __VLS_resolvedLocalAndGlobalComponents.VIcon;
417
- /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
410
+ /** @type { [typeof __VLS_components.VIcon, typeof __VLS_components.vIcon, ] } */
418
411
  // @ts-ignore
419
- const __VLS_236 = __VLS_asFunctionalComponent(__VLS_235, new __VLS_235({}));
420
- const __VLS_237 = __VLS_236({}, ...__VLS_functionalComponentArgsRest(__VLS_236));
421
- __VLS_nonNullable(__VLS_240.slots).default;
422
- const __VLS_240 = __VLS_pickFunctionalComponentCtx(__VLS_235, __VLS_237);
412
+ const __VLS_236 = __VLS_asFunctionalComponent(__VLS_235, new __VLS_235({ icon: ((__VLS_ctx.mdiLogout)), }));
413
+ const __VLS_237 = __VLS_236({ icon: ((__VLS_ctx.mdiLogout)), }, ...__VLS_functionalComponentArgsRest(__VLS_236));
423
414
  }
424
415
  const __VLS_241 = __VLS_resolvedLocalAndGlobalComponents.VListItemTitle;
425
416
  /** @type { [typeof __VLS_components.VListItemTitle, typeof __VLS_components.vListItemTitle, ] } */
@@ -460,6 +451,11 @@ const __VLS_self = (await import('vue')).defineComponent({
460
451
  setup() {
461
452
  return {
462
453
  UserAvatar: UserAvatar,
454
+ mdiAlert: mdiAlert,
455
+ mdiShieldAlert: mdiShieldAlert,
456
+ mdiLogout: mdiLogout,
457
+ mdiAccountSwitchOutline: mdiAccountSwitchOutline,
458
+ mdiWeatherNight: mdiWeatherNight,
463
459
  theme: theme,
464
460
  session: session,
465
461
  t: t,
@@ -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>
@@ -63,6 +59,8 @@ en:
63
59
 
64
60
  <script lang="ts">
65
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: {
@@ -75,10 +73,13 @@ export default {
75
73
  },
76
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 CHANGED
@@ -10,7 +10,7 @@
10
10
  <p
11
11
  v-if="notification.type === 'error'"
12
12
  class="ml-3"
13
- v-html="notification.errorMsg"
13
+ v-text="notification.errorMsg"
14
14
  />
15
15
 
16
16
  <template #actions>
package/ui-notif.vue.js CHANGED
@@ -74,7 +74,7 @@ function __VLS_template() {
74
74
  (__VLS_ctx.notification.msg);
75
75
  if (__VLS_ctx.notification.type === 'error') {
76
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);
77
+ __VLS_directiveAsFunction(__VLS_directives.vText)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.notification.errorMsg) }, null, null);
78
78
  }
79
79
  __VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
80
80
  {
package/vite.d.ts CHANGED
@@ -4,6 +4,8 @@ export declare const autoImports: (string | {
4
4
  '@data-fair/lib-vue/locale-dayjs.js': string[];
5
5
  '@data-fair/lib-vue/concept-filters.js': string[];
6
6
  '@data-fair/lib-vue/ui-notif.js': string[];
7
+ '@data-fair/lib-vue/fetch.js': string[];
8
+ '@data-fair/lib-vue/ws.js': string[];
7
9
  } | {
8
10
  '@data-fair/lib-vuetify/personal-menu.vue': string[][];
9
11
  '@data-fair/lib-vuetify/tutorial-alert.vue': string[][];