@signal24/vue-foundation 4.25.4 → 4.25.6
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
|
@@ -51,7 +51,9 @@
|
|
|
51
51
|
|
|
52
52
|
<script lang="ts" setup generic="T, V = T">
|
|
53
53
|
import { debounce, groupBy, isEqual, uniq } from 'lodash';
|
|
54
|
-
import { computed, onMounted, ref, watch } from 'vue';
|
|
54
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
55
|
+
|
|
56
|
+
import { isNotNullOrUndefined } from '@/helpers';
|
|
55
57
|
|
|
56
58
|
import { escapeHtml } from '../helpers/string';
|
|
57
59
|
import type { VfSmartSelectOptionDescriptor } from './vf-smart-select.types';
|
|
@@ -321,7 +323,7 @@ onMounted(async () => {
|
|
|
321
323
|
if (selectedOption.value !== props.modelValue) {
|
|
322
324
|
emit(
|
|
323
325
|
'update:modelValue',
|
|
324
|
-
selectedOption.value
|
|
326
|
+
isNotNullOrUndefined(selectedOption.value) && effectiveValueExtractor.value !== null
|
|
325
327
|
? effectiveValueExtractor.value(selectedOption.value)
|
|
326
328
|
: selectedOption.value
|
|
327
329
|
);
|
|
@@ -333,6 +335,10 @@ onMounted(async () => {
|
|
|
333
335
|
}
|
|
334
336
|
});
|
|
335
337
|
|
|
338
|
+
onBeforeUnmount(() => {
|
|
339
|
+
optionsContainer.value?.remove();
|
|
340
|
+
});
|
|
341
|
+
|
|
336
342
|
async function loadRemoteOptions() {
|
|
337
343
|
await reloadOptions();
|
|
338
344
|
if (loadedOptions.value) emit('optionsLoaded', loadedOptions.value);
|
|
@@ -559,7 +565,7 @@ function handleValueChanged() {
|
|
|
559
565
|
selectedOption.value = effectiveValueExtractor.value
|
|
560
566
|
? allOptions.value.find(o => props.modelValue === effectiveValueExtractor.value!(o))
|
|
561
567
|
: props.modelValue;
|
|
562
|
-
selectedOptionTitle.value = selectedOption.value
|
|
568
|
+
selectedOptionTitle.value = isNotNullOrUndefined(selectedOption.value) ? effectiveSelectionFormatter.value(selectedOption.value) : null;
|
|
563
569
|
searchText.value = selectedOptionTitle.value ?? '';
|
|
564
570
|
} else {
|
|
565
571
|
selectedOption.value = null;
|
package/src/helpers/object.ts
CHANGED