@signal24/vue-foundation 4.27.0 → 4.28.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@signal24/vue-foundation",
3
3
  "type": "module",
4
- "version": "4.27.0",
4
+ "version": "4.28.0",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "exports": {
@@ -42,13 +42,13 @@
42
42
  "vue": "^3.4.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@eslint/js": "9.30.0",
45
+ "@eslint/js": "9.30.1",
46
46
  "@nabla/vite-plugin-eslint": "^2.0.5",
47
- "@signal24/openapi-client-codegen": "^2.5.1",
47
+ "@signal24/openapi-client-codegen": "^2.5.2",
48
48
  "@tsconfig/node22": "^22.0.2",
49
49
  "@types/jsdom": "^21.1.7",
50
- "@types/lodash": "^4.17.19",
51
- "@types/node": "^24.0.6",
50
+ "@types/lodash": "^4.17.20",
51
+ "@types/node": "^24.0.10",
52
52
  "@types/uuid": "^10.0.0",
53
53
  "@vitejs/plugin-vue": "^6.0.0",
54
54
  "@vue/eslint-config-prettier": "^10.2.0",
@@ -56,7 +56,7 @@
56
56
  "@vue/test-utils": "^2.4.6",
57
57
  "@vue/tsconfig": "^0.7.0",
58
58
  "date-fns": "^4.1.0",
59
- "eslint": "9.30.0",
59
+ "eslint": "9.30.1",
60
60
  "eslint-plugin-simple-import-sort": "^12.1.1",
61
61
  "eslint-plugin-unused-imports": "^4.1.4",
62
62
  "eslint-plugin-vue": "^10.2.0",
@@ -67,11 +67,11 @@
67
67
  "start-server-and-test": "^2.0.12",
68
68
  "type-fest": "^4.41.0",
69
69
  "typescript": "~5.8",
70
- "typescript-eslint": "^8.35.0",
70
+ "typescript-eslint": "^8.35.1",
71
71
  "vite": "^7.0.0",
72
72
  "vitest": "^3.2.4",
73
73
  "vue": "^3.5.17",
74
- "vue-tsc": "^2.2.10"
74
+ "vue-tsc": "^3.0.0"
75
75
  },
76
- "packageManager": "yarn@4.6.0"
76
+ "packageManager": "yarn@4.9.2"
77
77
  }
@@ -127,8 +127,15 @@ const loadedOptions = computed(() => props.options ?? remoteOptions.value ?? [])
127
127
  const effectivePrependOptions = computed(() => props.prependOptions ?? []);
128
128
  const effectiveAppendOptions = computed(() => props.appendOptions ?? []);
129
129
  const effectiveDisabled = computed(() => !!props.disabled || (!isLoaded.value && !props.loadOptions));
130
+ const effectiveLoadingText = computed(() => props.loadingText || '...');
130
131
  const effectivePlaceholder = computed(() => {
131
- if (!isLoaded.value && props.preload) return 'Loading...';
132
+ if (!isLoaded.value) {
133
+ if (!props.loadOptions) return effectiveLoadingText.value;
134
+ if (props.preload) return effectiveLoadingText.value;
135
+ if (props.modelValue && (props.valueField || props.valueExtractor)) {
136
+ return effectiveLoadingText.value;
137
+ }
138
+ }
132
139
  if (props.nullTitle) return props.nullTitle;
133
140
  return props.placeholder || '';
134
141
  });
@@ -302,23 +309,27 @@ onMounted(async () => {
302
309
  shouldShowCreateOption.value = props.onCreateItem !== undefined;
303
310
 
304
311
  if (props.loadOptions && props.preload) {
312
+ searchText.value = effectiveLoadingText.value;
305
313
  await loadRemoteOptions();
314
+ searchText.value = '';
306
315
  }
307
316
 
308
- if (!props.options && (props.valueField || props.valueExtractor) && (!props.loadOptions || props.preload)) {
309
- searchText.value = props.loadingText ?? '...';
317
+ // if we have a value, but we don't have options and we use a specific field for the value,
318
+ // then the value is not something we can pass through the formatter.
319
+ // thus, we have to wait to parse the value and render the value later.
320
+ if (!props.options && !props.loadOptions && (props.valueField || props.valueExtractor)) {
321
+ searchText.value = effectiveLoadingText.value;
310
322
  } else {
311
323
  handleValueChanged();
312
324
  }
313
325
 
314
326
  watch(selectedOption, () => {
315
- if (selectedOption.value !== props.modelValue) {
316
- emit(
317
- 'update:modelValue',
318
- isNotNullOrUndefined(selectedOption.value) && effectiveValueExtractor.value !== null
319
- ? effectiveValueExtractor.value(selectedOption.value)
320
- : selectedOption.value
321
- );
327
+ const effectiveValue =
328
+ isNotNullOrUndefined(selectedOption.value) && effectiveValueExtractor.value !== null
329
+ ? effectiveValueExtractor.value(selectedOption.value)
330
+ : selectedOption.value;
331
+ if (!isEqual(props.modelValue, effectiveValue)) {
332
+ emit('update:modelValue', effectiveValue);
322
333
  }
323
334
  });
324
335