@dative-gpi/foundation-shared-components 0.0.141 → 0.0.143

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.
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <FSAutocompleteField
3
3
  :toggleSet="!$props.toggleSetDisabled && toggleSet"
4
+ :customFilter="customFilter"
4
5
  :multiple="$props.multiple"
5
6
  :loading="loading"
6
7
  :items="timeZones"
@@ -127,6 +128,10 @@ export default defineComponent({
127
128
  return getManyTimeZones({ ...props.timeZoneFilters, search: search ?? undefined });
128
129
  };
129
130
 
131
+ const customFilter = (_: any, search: string, item: any): boolean => {
132
+ return item.raw.id.toLowerCase().includes(search.toLowerCase());
133
+ };
134
+
130
135
  const { toggleSet, search, init, onUpdate } = useAutocomplete(
131
136
  timeZones,
132
137
  [() => props.timeZoneFilters],
@@ -142,6 +147,7 @@ export default defineComponent({
142
147
  toggleSet,
143
148
  loading,
144
149
  search,
150
+ customFilter,
145
151
  onUpdate
146
152
  };
147
153
  }
@@ -564,15 +564,18 @@ export default defineComponent({
564
564
  };
565
565
 
566
566
  const onClick = () => {
567
- if (props.modelValue) {
567
+ if (props.modelValue && !props.multiple) {
568
568
  search.value = "";
569
569
  emit("update:search", search.value);
570
570
  emit("update:modelValue", null);
571
571
  }
572
- }
572
+ };
573
573
 
574
574
  watch(search, () => {
575
575
  emit("update:search", search.value);
576
+ if (props.modelValue && search.value && !props.multiple) {
577
+ emit("update:modelValue", null);
578
+ }
576
579
  });
577
580
 
578
581
  return {
@@ -60,11 +60,11 @@ export const useAutocomplete = <TInfos>(
60
60
  }
61
61
  });
62
62
 
63
- watch(entities, () => {
63
+ watch(() => entities.value, () => {
64
64
  if (init.value) {
65
65
  init.value = false;
66
- entitiesLength.value = entities.value.length;
67
66
  }
67
+ entitiesLength.value = entities.value.length;
68
68
  });
69
69
 
70
70
  onMounted((): void => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.141",
4
+ "version": "0.0.143",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "0.0.141",
14
- "@dative-gpi/foundation-shared-services": "0.0.141",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.143",
14
+ "@dative-gpi/foundation-shared-services": "0.0.143",
15
15
  "@fontsource/montserrat": "^5.0.16",
16
16
  "@lexical/clipboard": "^0.12.5",
17
17
  "@lexical/history": "^0.12.5",
@@ -32,5 +32,5 @@
32
32
  "sass": "^1.69.5",
33
33
  "sass-loader": "^13.3.2"
34
34
  },
35
- "gitHead": "c318ee98722b674ed4f4264333aeebe65be23785"
35
+ "gitHead": "ae5f1392bfc6440d175863c16487987575ed484d"
36
36
  }