@signal24/vue-foundation 4.25.7 → 4.25.8
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.
|
@@ -126,7 +126,7 @@ const loadedOptions = computed(() => props.options ?? remoteOptions.value ?? [])
|
|
|
126
126
|
|
|
127
127
|
const effectivePrependOptions = computed(() => props.prependOptions ?? []);
|
|
128
128
|
const effectiveAppendOptions = computed(() => props.appendOptions ?? []);
|
|
129
|
-
const effectiveDisabled = computed(() => !!props.disabled || !isLoaded.value);
|
|
129
|
+
const effectiveDisabled = computed(() => !!props.disabled || (!isLoaded.value && !props.loadOptions));
|
|
130
130
|
const effectivePlaceholder = computed(() => {
|
|
131
131
|
if (!isLoaded.value && props.preload) return 'Loading...';
|
|
132
132
|
if (props.nullTitle) return props.nullTitle;
|
|
@@ -305,7 +305,7 @@ onMounted(async () => {
|
|
|
305
305
|
await loadRemoteOptions();
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
if (!props.options && (props.valueField || props.valueExtractor)) {
|
|
308
|
+
if (!props.options && (props.valueField || props.valueExtractor) && (!props.loadOptions || props.preload)) {
|
|
309
309
|
searchText.value = props.loadingText ?? '...';
|
|
310
310
|
} else {
|
|
311
311
|
handleValueChanged();
|
|
@@ -341,6 +341,7 @@ async function reloadOptions() {
|
|
|
341
341
|
isLoading.value = true;
|
|
342
342
|
remoteOptions.value = (await props.loadOptions?.(effectiveSearchText)) ?? [];
|
|
343
343
|
isLoading.value = false;
|
|
344
|
+
setHighlightedOptionKey();
|
|
344
345
|
}
|
|
345
346
|
|
|
346
347
|
function reloadOptionsIfSearching() {
|
package/src/helpers/string.ts
CHANGED
|
@@ -17,7 +17,7 @@ export function desnakeCase(value: string) {
|
|
|
17
17
|
|
|
18
18
|
export function formatPhone(value: string) {
|
|
19
19
|
const cleanValue = value.replace(/\D/g, '').replace(/^1/, '');
|
|
20
|
-
if (cleanValue.length
|
|
20
|
+
if (cleanValue.length !== 10) return value;
|
|
21
21
|
return '(' + cleanValue.substring(0, 3) + ') ' + cleanValue.substring(3, 6) + '-' + cleanValue.substring(6);
|
|
22
22
|
}
|
|
23
23
|
|