@data-fair/lib-vuetify 1.12.6 → 1.13.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.
package/owner-avatar.vue CHANGED
@@ -1,36 +1,57 @@
1
1
  <template>
2
- <v-tooltip location="top">
3
- <template #activator="{ props }">
2
+ <v-tooltip
3
+ v-if="showTooltip"
4
+ location="top"
5
+ >
6
+ <template #activator="{ props: tooltipProps }">
4
7
  <span
5
- v-bind="props"
8
+ v-bind="tooltipProps"
6
9
  class="text-body-2"
7
10
  >
8
- <v-avatar :size="28" :image="avatarUrl" />
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 ownerProps = defineProps({
19
- owner: {
20
- type: Object,
21
- default: null
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 (ownerProps.owner.department) return `/simple-directory/api/avatars/${ownerProps.owner.type}/${ownerProps.owner.id}/${ownerProps.owner.department}/avatar.png`
27
- else return `/simple-directory/api/avatars/${ownerProps.owner.type}/${ownerProps.owner.id}/avatar.png`
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 = ownerProps.owner.name
32
- if (ownerProps.owner.department) label += ' - ' + (ownerProps.owner.departmentName || ownerProps.owner.department)
33
- if (ownerProps.owner.role) label += ` (${ownerProps.owner.role})`
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>
@@ -1,14 +1,20 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
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
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
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;
@@ -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
- const ownerProps = defineProps({
5
- owner: {
6
- type: Object,
7
- default: null
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 (ownerProps.owner.department)
12
- return `/simple-directory/api/avatars/${ownerProps.owner.type}/${ownerProps.owner.id}/${ownerProps.owner.department}/avatar.png`;
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/${ownerProps.owner.type}/${ownerProps.owner.id}/avatar.png`;
14
+ return `/simple-directory/api/avatars/${props.owner.type}/${props.owner.id}/avatar.png`;
15
15
  });
16
16
  const label = computed(() => {
17
- let label = ownerProps.owner.name;
18
- if (ownerProps.owner.department)
19
- label += ' - ' + (ownerProps.owner.departmentName || ownerProps.owner.department);
20
- if (ownerProps.owner.role)
21
- label += ` (${ownerProps.owner.role})`;
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 __VLS_fnComponent = (await import('vue')).defineComponent({
25
- props: {
26
- owner: {
27
- type: Object,
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
- const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VTooltip;
52
- /** @type { [typeof __VLS_components.VTooltip, typeof __VLS_components.vTooltip, typeof __VLS_components.VTooltip, typeof __VLS_components.vTooltip, ] } */
53
- // @ts-ignore
54
- const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ location: ("top"), }));
55
- const __VLS_2 = __VLS_1({ location: ("top"), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
56
- __VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
57
- {
58
- const { activator: __VLS_thisSlot } = __VLS_nonNullable(__VLS_5.slots);
59
- const [{ props }] = __VLS_getSlotParams(__VLS_thisSlot);
60
- __VLS_elementAsFunction(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({ ...(props), ...{ class: ("text-body-2") }, });
61
- const __VLS_6 = __VLS_resolvedLocalAndGlobalComponents.VAvatar;
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 __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({ size: ((28)), image: ((__VLS_ctx.avatarUrl)), }));
65
- const __VLS_8 = __VLS_7({ size: ((28)), image: ((__VLS_ctx.avatarUrl)), }, ...__VLS_functionalComponentArgsRest(__VLS_7));
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
- props: {
89
- owner: {
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
- props: {
100
- owner: {
101
- type: Object,
102
- default: null
103
- }
104
- },
107
+ __typeProps: {},
108
+ props: {},
105
109
  });
106
110
  ;
107
111
  //# sourceMappingURL=owner-avatar.vue.js.map
package/owner-pick.vue CHANGED
@@ -80,6 +80,7 @@ const owners = computedAsync(async () => {
80
80
  const org = await ofetch(`/simple-directory/api/organizations/${o.id}`)
81
81
  owners.push({ type: 'organization', id: o.id, name: o.name })
82
82
  if (!org.departments) continue
83
+ org.departments.sort((d1: any, d2: any) => d1.name.localeCompare(d2.name))
83
84
  for (const dep of org.departments) {
84
85
  if (!owners.find(ow => ow.type === 'organization' && ow.id === o.id && ow.department === dep.id)) {
85
86
  owners.push({ type: 'organization', id: o.id, name: o.name, department: dep.id, departmentName: dep.name })
package/owner-pick.vue.js CHANGED
@@ -37,6 +37,7 @@ const owners = computedAsync(async () => {
37
37
  owners.push({ type: 'organization', id: o.id, name: o.name });
38
38
  if (!org.departments)
39
39
  continue;
40
+ org.departments.sort((d1, d2) => d1.name.localeCompare(d2.name));
40
41
  for (const dep of org.departments) {
41
42
  if (!owners.find(ow => ow.type === 'organization' && ow.id === o.id && ow.department === dep.id)) {
42
43
  owners.push({ type: 'organization', id: o.id, name: o.name, department: dep.id, departmentName: dep.name });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vuetify",
3
- "version": "1.12.6",
3
+ "version": "1.13.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": [
@@ -38,7 +38,7 @@ const findAdressesFn = async (search: string, selectedId?: string) => {
38
38
  addressesList.value = address.value ? [address.value] : []
39
39
  } else {
40
40
  const params = { q: search }
41
- const result = (await ofetch('https://api-adresse.data.gouv.fr/search/', { params }))
41
+ const result = (await ofetch('https://data.geopf.fr/geocodage/search/', { params }))
42
42
  addressesList.value = result.features.map((f: any) => ({
43
43
  title: f.properties.label,
44
44
  value: {
@@ -16,7 +16,7 @@ const findAdressesFn = async (search, selectedId) => {
16
16
  }
17
17
  else {
18
18
  const params = { q: search };
19
- const result = (await ofetch('https://api-adresse.data.gouv.fr/search/', { params }));
19
+ const result = (await ofetch('https://data.geopf.fr/geocodage/search/', { params }));
20
20
  addressesList.value = result.features.map((f) => ({
21
21
  title: f.properties.label,
22
22
  value: {
package/vite.d.ts CHANGED
@@ -8,6 +8,7 @@ export declare const autoImports: (string | {
8
8
  '@data-fair/lib-vue/ws.js': string[];
9
9
  '@data-fair/lib-vue/async-action.js': string[];
10
10
  '@data-fair/lib-vue/deep-diff.js': string[];
11
+ '@data-fair/lib-vue/format/bytes.js': string[];
11
12
  } | {
12
13
  '@data-fair/lib-vuetify/date-match-filter.vue': string[][];
13
14
  '@data-fair/lib-vuetify/date-range-picker.vue': string[][];