@data-fair/lib-vuetify 1.13.3 → 1.13.4

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/index.js CHANGED
@@ -57,6 +57,12 @@ export function vuetifySessionOptions(session, cspNonce) {
57
57
  },
58
58
  VSwitch: {
59
59
  color: 'primary'
60
+ },
61
+ vAutocomplete: {
62
+ autocomplete: 'suppress'
63
+ },
64
+ vSelect: {
65
+ autocomplete: 'suppress'
60
66
  }
61
67
  }
62
68
  };
@@ -14,7 +14,7 @@
14
14
  bg-color="background"
15
15
  density="compact"
16
16
  >
17
- <v-defaults-provider :defaults="{ VListItem: { rounded: true } }">
17
+ <v-defaults-provider :defaults="defaults">
18
18
  <slot />
19
19
  </v-defaults-provider>
20
20
  </v-list>
@@ -43,10 +43,9 @@
43
43
  >
44
44
  <v-list
45
45
  data-iframe-height
46
- bg-color="background"
47
46
  density="compact"
48
47
  >
49
- <v-defaults-provider :defaults="{ VListItem: { rounded: true } }">
48
+ <v-defaults-provider :defaults="defaults">
50
49
  <slot />
51
50
  </v-defaults-provider>
52
51
  </v-list>
@@ -60,4 +59,29 @@ import { mdiDotsVertical } from '@mdi/js'
60
59
  import { useDisplay } from 'vuetify'
61
60
 
62
61
  const display = useDisplay()
62
+
63
+ const defaults = {
64
+ VListItem: {
65
+ rounded: true
66
+ },
67
+ VAutocomplete: {
68
+ color: 'primary',
69
+ density: 'compact',
70
+ variant: 'outlined',
71
+ clearable: true,
72
+ hideDetails: true,
73
+ rounded: true,
74
+ },
75
+ VSelect: {
76
+ color: 'primary',
77
+ density: 'compact',
78
+ variant: 'outlined',
79
+ clearable: true,
80
+ hideDetails: true,
81
+ rounded: true
82
+ },
83
+ VSwitch: {
84
+ hideDetails: true
85
+ }
86
+ }
63
87
  </script>
@@ -3,6 +3,30 @@ import { mdiDotsVertical } from '@mdi/js';
3
3
  import { useDisplay } from 'vuetify';
4
4
  const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
5
5
  const display = useDisplay();
6
+ const defaults = {
7
+ VListItem: {
8
+ rounded: true
9
+ },
10
+ VAutocomplete: {
11
+ color: 'primary',
12
+ density: 'compact',
13
+ variant: 'outlined',
14
+ clearable: true,
15
+ hideDetails: true,
16
+ rounded: true,
17
+ },
18
+ VSelect: {
19
+ color: 'primary',
20
+ density: 'compact',
21
+ variant: 'outlined',
22
+ clearable: true,
23
+ hideDetails: true,
24
+ rounded: true
25
+ },
26
+ VSwitch: {
27
+ hideDetails: true
28
+ }
29
+ };
6
30
  const __VLS_fnComponent = (await import('vue')).defineComponent({});
7
31
  ;
8
32
  let __VLS_functionalComponentProps;
@@ -38,8 +62,8 @@ function __VLS_template() {
38
62
  const __VLS_12 = __VLS_resolvedLocalAndGlobalComponents.VDefaultsProvider;
39
63
  /** @type { [typeof __VLS_components.VDefaultsProvider, typeof __VLS_components.vDefaultsProvider, typeof __VLS_components.VDefaultsProvider, typeof __VLS_components.vDefaultsProvider, ] } */
40
64
  // @ts-ignore
41
- const __VLS_13 = __VLS_asFunctionalComponent(__VLS_12, new __VLS_12({ defaults: (({ VListItem: { rounded: true } })), }));
42
- const __VLS_14 = __VLS_13({ defaults: (({ VListItem: { rounded: true } })), }, ...__VLS_functionalComponentArgsRest(__VLS_13));
65
+ const __VLS_13 = __VLS_asFunctionalComponent(__VLS_12, new __VLS_12({ defaults: ((__VLS_ctx.defaults)), }));
66
+ const __VLS_14 = __VLS_13({ defaults: ((__VLS_ctx.defaults)), }, ...__VLS_functionalComponentArgsRest(__VLS_13));
43
67
  var __VLS_18 = {};
44
68
  __VLS_nonNullable(__VLS_17.slots).default;
45
69
  const __VLS_17 = __VLS_pickFunctionalComponentCtx(__VLS_12, __VLS_14);
@@ -72,13 +96,13 @@ function __VLS_template() {
72
96
  const __VLS_43 = __VLS_resolvedLocalAndGlobalComponents.VList;
73
97
  /** @type { [typeof __VLS_components.VList, typeof __VLS_components.vList, typeof __VLS_components.VList, typeof __VLS_components.vList, ] } */
74
98
  // @ts-ignore
75
- const __VLS_44 = __VLS_asFunctionalComponent(__VLS_43, new __VLS_43({ dataIframeHeight: (true), bgColor: ("background"), density: ("compact"), }));
76
- const __VLS_45 = __VLS_44({ dataIframeHeight: (true), bgColor: ("background"), density: ("compact"), }, ...__VLS_functionalComponentArgsRest(__VLS_44));
99
+ const __VLS_44 = __VLS_asFunctionalComponent(__VLS_43, new __VLS_43({ dataIframeHeight: (true), density: ("compact"), }));
100
+ const __VLS_45 = __VLS_44({ dataIframeHeight: (true), density: ("compact"), }, ...__VLS_functionalComponentArgsRest(__VLS_44));
77
101
  const __VLS_49 = __VLS_resolvedLocalAndGlobalComponents.VDefaultsProvider;
78
102
  /** @type { [typeof __VLS_components.VDefaultsProvider, typeof __VLS_components.vDefaultsProvider, typeof __VLS_components.VDefaultsProvider, typeof __VLS_components.vDefaultsProvider, ] } */
79
103
  // @ts-ignore
80
- const __VLS_50 = __VLS_asFunctionalComponent(__VLS_49, new __VLS_49({ defaults: (({ VListItem: { rounded: true } })), }));
81
- const __VLS_51 = __VLS_50({ defaults: (({ VListItem: { rounded: true } })), }, ...__VLS_functionalComponentArgsRest(__VLS_50));
104
+ const __VLS_50 = __VLS_asFunctionalComponent(__VLS_49, new __VLS_49({ defaults: ((__VLS_ctx.defaults)), }));
105
+ const __VLS_51 = __VLS_50({ defaults: ((__VLS_ctx.defaults)), }, ...__VLS_functionalComponentArgsRest(__VLS_50));
82
106
  var __VLS_55 = {};
83
107
  __VLS_nonNullable(__VLS_54.slots).default;
84
108
  const __VLS_54 = __VLS_pickFunctionalComponentCtx(__VLS_49, __VLS_51);
@@ -109,6 +133,7 @@ const __VLS_self = (await import('vue')).defineComponent({
109
133
  return {
110
134
  mdiDotsVertical: mdiDotsVertical,
111
135
  display: display,
136
+ defaults: defaults,
112
137
  };
113
138
  },
114
139
  });
package/owner-avatar.vue CHANGED
@@ -50,7 +50,7 @@ const avatarUrl = computed(() => {
50
50
  const label = computed(() => {
51
51
  let label = ''
52
52
  if (!props.omitOwnerName || !props.owner.department) label += props.owner.name
53
- if (props.owner.department) label += !props.omitOwnerName ? ' - ' : '' + (props.owner.departmentName || props.owner.department)
53
+ if (props.owner.department) label += (!props.omitOwnerName ? ' - ' : '') + (props.owner.departmentName || props.owner.department)
54
54
  if (props.owner.role) label += ` (${props.owner.role})`
55
55
  return label
56
56
  })
@@ -18,7 +18,7 @@ const label = computed(() => {
18
18
  if (!props.omitOwnerName || !props.owner.department)
19
19
  label += props.owner.name;
20
20
  if (props.owner.department)
21
- label += !props.omitOwnerName ? ' - ' : '' + (props.owner.departmentName || props.owner.department);
21
+ label += (!props.omitOwnerName ? ' - ' : '') + (props.owner.departmentName || props.owner.department);
22
22
  if (props.owner.role)
23
23
  label += ` (${props.owner.role})`;
24
24
  return label;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vuetify",
3
- "version": "1.13.3",
3
+ "version": "1.13.4",
4
4
  "description": "Components based on the Vuetify 3 UI lib for the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -36,6 +36,12 @@ const findAdressesFn = async (search: string, selectedId?: string) => {
36
36
  loadingAddresses.value = true
37
37
  if (!search || search.length < 3) {
38
38
  addressesList.value = address.value ? [address.value] : []
39
+ } else if (/^\s*(-?\d+\.?\d*),\s*(-?\d+\.?\d*)\s*$/.test(search)) {
40
+ const [lat, lon] = search.split(',').map(s => parseFloat(s.trim()))
41
+ addressesList.value = [{
42
+ title: `${lat}, ${lon}`,
43
+ value: { lat, lon, label: `${lat}, ${lon}` }
44
+ }]
39
45
  } else {
40
46
  const params = { q: search }
41
47
  const result = (await ofetch('https://data.geopf.fr/geocodage/search/', { params }))
@@ -65,7 +71,11 @@ watch(
65
71
  address,
66
72
  (addr) => {
67
73
  if (addr) {
68
- model.value = JSON.stringify([addr.title, addr.value.id]).slice(1, -1)
74
+ if (addr.value.lat !== undefined && addr.value.lon !== undefined && !addr.value.id) {
75
+ model.value = `${addr.value.lat}, ${addr.value.lon}`
76
+ } else {
77
+ model.value = JSON.stringify([addr.title, addr.value.id]).slice(1, -1)
78
+ }
69
79
  } else {
70
80
  model.value = undefined
71
81
  addressesList.value = []
@@ -14,6 +14,13 @@ const findAdressesFn = async (search, selectedId) => {
14
14
  if (!search || search.length < 3) {
15
15
  addressesList.value = address.value ? [address.value] : [];
16
16
  }
17
+ else if (/^\s*(-?\d+\.?\d*),\s*(-?\d+\.?\d*)\s*$/.test(search)) {
18
+ const [lat, lon] = search.split(',').map(s => parseFloat(s.trim()));
19
+ addressesList.value = [{
20
+ title: `${lat}, ${lon}`,
21
+ value: { lat, lon, label: `${lat}, ${lon}` }
22
+ }];
23
+ }
17
24
  else {
18
25
  const params = { q: search };
19
26
  const result = (await ofetch('https://data.geopf.fr/geocodage/search/', { params }));
@@ -38,7 +45,12 @@ if (model.value && model.value.length) {
38
45
  }
39
46
  watch(address, (addr) => {
40
47
  if (addr) {
41
- model.value = JSON.stringify([addr.title, addr.value.id]).slice(1, -1);
48
+ if (addr.value.lat !== undefined && addr.value.lon !== undefined && !addr.value.id) {
49
+ model.value = `${addr.value.lat}, ${addr.value.lon}`;
50
+ }
51
+ else {
52
+ model.value = JSON.stringify([addr.title, addr.value.id]).slice(1, -1);
53
+ }
42
54
  }
43
55
  else {
44
56
  model.value = undefined;
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <v-text-field
3
+ v-bind="$attrs"
4
+ :append-inner-icon="mdiMagnify"
5
+ :label="t('search')"
6
+ class="mx-4"
7
+ color="primary"
8
+ density="compact"
9
+ variant="outlined"
10
+ autofocus
11
+ hide-details
12
+ clearable
13
+ />
14
+ </template>
15
+
16
+ <script setup lang="ts">
17
+ import { mdiMagnify } from '@mdi/js'
18
+ import { useI18n } from 'vue-i18n'
19
+
20
+ const { t } = useI18n()
21
+
22
+ </script>
23
+
24
+ <i18n lang="yaml">
25
+ en:
26
+ search: Search
27
+ fr:
28
+ search: Rechercher
29
+ </i18n>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,55 @@
1
+ /// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
2
+ import { mdiMagnify } from '@mdi/js';
3
+ import { useI18n } from 'vue-i18n';
4
+ const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
5
+ const { t } = useI18n();
6
+ const __VLS_fnComponent = (await import('vue')).defineComponent({});
7
+ ;
8
+ let __VLS_functionalComponentProps;
9
+ function __VLS_template() {
10
+ const __VLS_ctx = {};
11
+ const __VLS_localComponents = {
12
+ ...{},
13
+ ...{},
14
+ ...__VLS_ctx,
15
+ };
16
+ let __VLS_components;
17
+ const __VLS_localDirectives = {
18
+ ...{},
19
+ ...__VLS_ctx,
20
+ };
21
+ let __VLS_directives;
22
+ let __VLS_styleScopedClasses;
23
+ let __VLS_resolvedLocalAndGlobalComponents;
24
+ const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VTextField;
25
+ /** @type { [typeof __VLS_components.VTextField, typeof __VLS_components.vTextField, ] } */
26
+ // @ts-ignore
27
+ const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ ...(__VLS_ctx.$attrs), appendInnerIcon: ((__VLS_ctx.mdiMagnify)), label: ((__VLS_ctx.t('search'))), ...{ class: ("mx-4") }, color: ("primary"), density: ("compact"), variant: ("outlined"), autofocus: (true), hideDetails: (true), clearable: (true), }));
28
+ const __VLS_2 = __VLS_1({ ...(__VLS_ctx.$attrs), appendInnerIcon: ((__VLS_ctx.mdiMagnify)), label: ((__VLS_ctx.t('search'))), ...{ class: ("mx-4") }, color: ("primary"), density: ("compact"), variant: ("outlined"), autofocus: (true), hideDetails: (true), clearable: (true), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
29
+ __VLS_styleScopedClasses['mx-4'];
30
+ var __VLS_slots;
31
+ var __VLS_inheritedAttrs;
32
+ const __VLS_refs = {};
33
+ var $refs;
34
+ return {
35
+ slots: __VLS_slots,
36
+ refs: $refs,
37
+ attrs: {},
38
+ };
39
+ }
40
+ ;
41
+ const __VLS_self = (await import('vue')).defineComponent({
42
+ setup() {
43
+ return {
44
+ mdiMagnify: mdiMagnify,
45
+ t: t,
46
+ };
47
+ },
48
+ });
49
+ export default (await import('vue')).defineComponent({
50
+ setup() {
51
+ return {};
52
+ },
53
+ });
54
+ ;
55
+ //# sourceMappingURL=search-field.vue.js.map