@signal24/vue-foundation 4.20.2 → 4.21.1

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.20.2",
4
+ "version": "4.21.1",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "exports": {
@@ -21,7 +21,7 @@
21
21
  "typings": "./dist/src/index.d.ts",
22
22
  "scripts": {
23
23
  "dev": "vite",
24
- "build": "rm -rf dist && vite build && vue-tsc -p tsconfig.app.json && tsc -p tsconfig.vite-plugins.json && find dist -name '*.tsbuildinfo' -delete",
24
+ "build": "rm -rf dist && vite build && tsc -p tsconfig.vite-plugins.json && find dist -name '*.tsbuildinfo' -delete && vue-tsc -p tsconfig.app.json",
25
25
  "build:watch": "fswatch -o src | xargs -n1 -I{} yarn build",
26
26
  "demo": "vite -c ./demo/vite.config.ts ./demo",
27
27
  "test:types": "vue-tsc -p tsconfig.vitest.json",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "uuid": "^11.0.5"
37
+ "uuid": "^11.1.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@signal24/openapi-client-codegen": "^2.1.1",
@@ -43,39 +43,38 @@
43
43
  "vue": "^3.4.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@eslint/js": "9.18.0",
46
+ "@eslint/js": "9.21.0",
47
47
  "@nabla/vite-plugin-eslint": "^2.0.5",
48
48
  "@signal24/openapi-client-codegen": "^2.2.1",
49
49
  "@tsconfig/node22": "^22.0.0",
50
- "@types/eslint__js": "^8.42.3",
51
50
  "@types/jsdom": "^21.1.7",
52
- "@types/lodash": "^4.17.14",
53
- "@types/node": "^22.10.7",
51
+ "@types/lodash": "^4.17.16",
52
+ "@types/node": "^22.13.8",
54
53
  "@types/uuid": "^10.0.0",
55
54
  "@vitejs/plugin-vue": "^5.2.1",
56
55
  "@vue/eslint-config-prettier": "^10.2.0",
57
- "@vue/eslint-config-typescript": "^14.3.0",
56
+ "@vue/eslint-config-typescript": "^14.4.0",
58
57
  "@vue/test-utils": "^2.4.6",
59
58
  "@vue/tsconfig": "^0.7.0",
60
- "cypress": "^14.0.0",
59
+ "cypress": "^14.1.0",
61
60
  "date-fns": "^4.1.0",
62
- "eslint": "9.18.0",
61
+ "eslint": "9.21.0",
63
62
  "eslint-plugin-cypress": "^4.1.0",
64
63
  "eslint-plugin-simple-import-sort": "^12.1.1",
65
64
  "eslint-plugin-unused-imports": "^4.1.4",
66
65
  "eslint-plugin-vue": "^9.32.0",
67
66
  "jsdom": "^26.0.0",
68
67
  "lodash": "^4.17.21",
69
- "prettier": "^3.4.2",
70
- "sass": "^1.83.4",
68
+ "prettier": "^3.5.2",
69
+ "sass": "^1.85.1",
71
70
  "start-server-and-test": "^2.0.10",
72
- "type-fest": "^4.33.0",
73
- "typescript": "~5.6",
74
- "typescript-eslint": "^8.21.0",
75
- "vite": "^6.0.11",
76
- "vitest": "^3.0.3",
71
+ "type-fest": "^4.36.0",
72
+ "typescript": "~5.8",
73
+ "typescript-eslint": "^8.25.0",
74
+ "vite": "^6.2.0",
75
+ "vitest": "^3.0.7",
77
76
  "vue": "^3.5.13",
78
- "vue-tsc": "^2.2.0"
77
+ "vue-tsc": "^2.2.4"
79
78
  },
80
- "packageManager": "yarn@4.5.1"
79
+ "packageManager": "yarn@4.6.0"
81
80
  }
@@ -2,43 +2,43 @@
2
2
  <VfSmartSelect v-model="selectedItem" :options="computedOpts" :formatter="ezFormatter" :null-title="nullTitle" :placeholder="placeholder" />
3
3
  </template>
4
4
 
5
- <script lang="ts" setup>
5
+ <script lang="ts" setup generic="T extends string">
6
6
  import { isEqual } from 'lodash';
7
7
  import { computed, ref, watch } from 'vue';
8
8
 
9
9
  import VfSmartSelect from './vf-smart-select.vue';
10
10
 
11
11
  interface IComputedOption {
12
- value: string;
12
+ value: T;
13
13
  label: string;
14
14
  }
15
15
 
16
16
  const props = defineProps<{
17
- modelValue: string | null | undefined;
17
+ modelValue: T | null | undefined;
18
18
  nullTitle?: string;
19
19
  placeholder?: string;
20
- options: { [K: string]: string } | string[];
21
- formatter?: (title: string) => string;
20
+ options: { [key in T]: string } | T[];
21
+ formatter?: (label: string, key: T) => string;
22
22
  }>();
23
23
 
24
24
  const computedOpts = computed(() => {
25
25
  return Array.isArray(props.options)
26
- ? props.options.map(o => ({ value: o, label: o }))
26
+ ? props.options.map(o => ({ value: o, label: String(o) }))
27
27
  : Object.entries(props.options).map(([value, label]) => ({
28
- value,
29
- label
28
+ value: value as T,
29
+ label: label as string
30
30
  }));
31
31
  });
32
32
 
33
33
  const ezFormatter = computed(() => {
34
34
  if (props.formatter) {
35
- return (o: IComputedOption) => props.formatter!(o.label);
35
+ return (o: IComputedOption) => props.formatter!(o.label, o.value);
36
36
  }
37
37
  return (o: IComputedOption) => o.label;
38
38
  });
39
39
 
40
40
  const emit = defineEmits<{
41
- (e: 'update:modelValue', value: string | null): void;
41
+ (e: 'update:modelValue', value: T | null): void;
42
42
  }>();
43
43
 
44
44
  const selectedItem = ref<IComputedOption | null>(computedOpts.value.find(o => o.value === props.modelValue) ?? null);
package/tsconfig.app.json CHANGED
@@ -16,5 +16,6 @@
16
16
  "declarationDir": "dist",
17
17
  "target": "ES2020",
18
18
  "lib": ["ES2020", "DOM", "DOM.Iterable"]
19
- }
19
+ },
20
+ "references": [{ "path": "./tsconfig.vite-plugins.json" }]
20
21
  }