@milaboratories/uikit 2.2.72 → 2.2.73

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": "@milaboratories/uikit",
3
- "version": "2.2.72",
3
+ "version": "2.2.73",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.umd.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -35,8 +35,8 @@
35
35
  "svgo": "^3.3.2",
36
36
  "@types/d3": "^7.4.3",
37
37
  "@milaboratories/eslint-config": "^1.0.4",
38
- "@platforma-sdk/model": "^1.30.3",
39
- "@milaboratories/helpers": "^1.6.11"
38
+ "@milaboratories/helpers": "^1.6.11",
39
+ "@platforma-sdk/model": "^1.30.11"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "vite",
@@ -131,16 +131,6 @@ const loadedOptionsRef = ref<ListOption<M>[]>([]);
131
131
  const modelOptionRef = ref<ListOptionNormalized<M> | undefined>(); // list of 1 option that is selected or empty, to keep selected label
132
132
 
133
133
  const renderedOptionsRef = computed(() => {
134
- if (model.value && !search.value) {
135
- return modelOptionRef.value
136
- ? [{
137
- ...modelOptionRef.value,
138
- index: 0,
139
- isSelected: true,
140
- isActive: true,
141
- }]
142
- : [];
143
- }
144
134
  return normalizeListOptions(loadedOptionsRef.value).map((opt, index) => ({
145
135
  ...opt,
146
136
  index,
@@ -215,14 +205,12 @@ const setFocusOnInput = () => input.value?.focus();
215
205
 
216
206
  const toggleOpen = () => {
217
207
  data.open = !data.open;
218
- if (!data.open) {
219
- search.value = null;
220
- }
221
- if (data.open) {
222
- search.value = '';
223
- }
224
208
  };
225
209
 
210
+ watch(() => data.open, (v) => {
211
+ search.value = v ? '' : null;
212
+ })
213
+
226
214
  const onInputFocus = () => {
227
215
  data.open = true;
228
216
  };
@@ -298,10 +286,10 @@ watchPostEffect(() => {
298
286
  }
299
287
  });
300
288
 
301
- const searchDebounced = refDebounced(search, 500, { maxWait: 1000 });
289
+ const searchDebounced = refDebounced(search, 300, { maxWait: 1000 });
302
290
 
303
291
  const optionsRequest = useWatchFetch(() => searchDebounced.value, async (v) => {
304
- if (v !== null && !(v === '' && model.value)) { // search is null when dropdown is closed; when search is '' and model is not empty show single selected option in the list;
292
+ if (v !== null) { // search is null when dropdown is closed;
305
293
  return props.optionsSearch(v);
306
294
  }
307
295
  return [];