@signal24/vue-foundation 4.30.4 → 4.30.7
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/dist/src/components/vf-ajax-select.vue.d.ts +9 -5
- package/dist/src/components/vf-ez-smart-select.vue.d.ts +9 -5
- package/dist/src/components/vf-smart-select.vue.d.ts +9 -5
- package/dist/src/helpers/object.d.ts +11 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/vue-foundation.es.js +912 -867
- package/package.json +21 -18
- package/src/components/vf-toast.vue +5 -1
- package/src/helpers/object.ts +64 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signal24/vue-foundation",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.30.
|
|
4
|
+
"version": "4.30.7",
|
|
5
5
|
"description": "Common components, directives, and helpers for Vue 3 apps",
|
|
6
6
|
"module": "./dist/vue-foundation.es.js",
|
|
7
7
|
"exports": {
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
"format": "prettier --write ."
|
|
32
32
|
},
|
|
33
33
|
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"url": "https://github.com/signal24/vue-foundation"
|
|
36
|
+
},
|
|
34
37
|
"dependencies": {
|
|
35
38
|
"currency.js": "^2.0.4",
|
|
36
39
|
"mark.js": "^8.11.1",
|
|
@@ -43,37 +46,37 @@
|
|
|
43
46
|
"vue": "^3.4.0"
|
|
44
47
|
},
|
|
45
48
|
"devDependencies": {
|
|
46
|
-
"@eslint/js": "9.39.
|
|
49
|
+
"@eslint/js": "9.39.2",
|
|
47
50
|
"@nabla/vite-plugin-eslint": "^2.0.6",
|
|
48
51
|
"@signal24/openapi-client-codegen": "^2.6.2",
|
|
49
|
-
"@tsconfig/node22": "^22.0.
|
|
52
|
+
"@tsconfig/node22": "^22.0.5",
|
|
50
53
|
"@types/jsdom": "^27.0.0",
|
|
51
|
-
"@types/lodash": "^4.17.
|
|
54
|
+
"@types/lodash": "^4.17.21",
|
|
52
55
|
"@types/mark.js": "^8",
|
|
53
|
-
"@types/node": "^
|
|
56
|
+
"@types/node": "^25.0.3",
|
|
54
57
|
"@types/uuid": "^11.0.0",
|
|
55
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
58
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
56
59
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
57
60
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
58
61
|
"@vue/test-utils": "^2.4.6",
|
|
59
62
|
"@vue/tsconfig": "^0.8.1",
|
|
60
63
|
"date-fns": "^4.1.0",
|
|
61
|
-
"eslint": "9.39.
|
|
64
|
+
"eslint": "9.39.2",
|
|
62
65
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
63
66
|
"eslint-plugin-unused-imports": "^4.3.0",
|
|
64
|
-
"eslint-plugin-vue": "^10.
|
|
65
|
-
"jsdom": "^27.
|
|
67
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
68
|
+
"jsdom": "^27.4.0",
|
|
66
69
|
"lodash": "^4.17.21",
|
|
67
|
-
"prettier": "^3.
|
|
68
|
-
"sass": "^1.
|
|
69
|
-
"start-server-and-test": "^2.1.
|
|
70
|
-
"type-fest": "^5.
|
|
70
|
+
"prettier": "^3.7.4",
|
|
71
|
+
"sass": "^1.97.2",
|
|
72
|
+
"start-server-and-test": "^2.1.3",
|
|
73
|
+
"type-fest": "^5.3.1",
|
|
71
74
|
"typescript": "~5.9",
|
|
72
|
-
"typescript-eslint": "^8.
|
|
73
|
-
"vite": "^7.
|
|
74
|
-
"vitest": "^4.0.
|
|
75
|
-
"vue": "^3.5.
|
|
76
|
-
"vue-tsc": "^3.
|
|
75
|
+
"typescript-eslint": "^8.52.0",
|
|
76
|
+
"vite": "^7.3.1",
|
|
77
|
+
"vitest": "^4.0.16",
|
|
78
|
+
"vue": "^3.5.26",
|
|
79
|
+
"vue-tsc": "^3.2.2"
|
|
77
80
|
},
|
|
78
81
|
"packageManager": "yarn@4.9.2"
|
|
79
82
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="vf-toast" :class="[className, { top: position === 'top', bottom: position !== 'top' }]" @click.stop="handleClick">
|
|
3
3
|
<div class="content">
|
|
4
4
|
<div class="message">{{ message }}</div>
|
|
5
|
-
<div v-if="!disableClose" class="close">x</div>
|
|
5
|
+
<div v-if="!disableClose" class="close" @click.stop="close">x</div>
|
|
6
6
|
</div>
|
|
7
7
|
<div v-if="durationSecs !== null" class="progress-bar">
|
|
8
8
|
<div ref="progressInnerEl" class="inner"></div>
|
|
@@ -37,6 +37,10 @@ function handleClick() {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function close() {
|
|
41
|
+
props.callback();
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
const progressInnerEl = ref<HTMLElement>();
|
|
41
45
|
if (props.durationSecs !== null) {
|
|
42
46
|
onMounted(() => {
|
package/src/helpers/object.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cloneDeep } from 'lodash';
|
|
1
|
+
import { cloneDeep, isEqual, isMatch } from 'lodash';
|
|
2
2
|
|
|
3
3
|
export function cloneProp<T>(prop: T | undefined | null, fallback: T): T {
|
|
4
4
|
if (prop !== undefined && prop !== null) {
|
|
@@ -22,3 +22,66 @@ export function nullifyEmptyInputs<T extends Record<string, unknown>, K extends
|
|
|
22
22
|
export function isNotNullOrUndefined<T>(value: T | null | undefined): value is T {
|
|
23
23
|
return value !== null && value !== undefined;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
export function objectKeys<T extends object>(object: T): (keyof T)[] {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
return Object.keys(object) as any[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function objectAssign<T extends object>(object: T, ...values: Partial<T>[]): T {
|
|
32
|
+
return Object.assign(object, ...values);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type Entries<T> = {
|
|
36
|
+
[K in keyof T]: [K, T[K]];
|
|
37
|
+
}[keyof T][];
|
|
38
|
+
export function objectEntries<T extends object>(object: T): Entries<T> {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
return Object.entries(object) as any;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function extractValues<T extends object, K extends readonly (keyof T)[]>(state: T, fields: K): Pick<T, K[number]> {
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
const result: Pick<T, K[number]> = {} as any;
|
|
46
|
+
for (const key of fields) {
|
|
47
|
+
if (state[key] !== undefined) {
|
|
48
|
+
result[key] = state[key];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
function doesMatch(original: any, updated: any, method?: 'equals' | 'matches'): boolean {
|
|
56
|
+
if (method === 'matches' && typeof original === 'object' && typeof updated === 'object') {
|
|
57
|
+
return isMatch(original, updated);
|
|
58
|
+
}
|
|
59
|
+
return isEqual(original, updated);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function extractUpdates<T extends object>(state: T, updates: Partial<T>, fields?: Array<keyof T>, method?: 'equals' | 'matches'): Partial<T> {
|
|
63
|
+
const result: Partial<T> = {};
|
|
64
|
+
const updateFields = fields ?? objectKeys(updates);
|
|
65
|
+
for (const key of updateFields) {
|
|
66
|
+
if (updates[key] !== undefined && !doesMatch(state[key], updates[key], method)) {
|
|
67
|
+
result[key] = updates[key];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function patchObject<T extends object>(state: T, updates: Partial<T>, fields?: Array<keyof T>, method?: 'equals' | 'matches'): T {
|
|
74
|
+
const effectiveUpdates = extractUpdates(state, updates, fields, method);
|
|
75
|
+
objectAssign(state, effectiveUpdates);
|
|
76
|
+
return state;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function extractKV<T, K extends keyof T, V extends keyof T>(arr: T[], keyCol: K, valCol: V) {
|
|
80
|
+
return arr.reduce(
|
|
81
|
+
(acc, cur) => {
|
|
82
|
+
acc[cur[keyCol] as string] = cur[valCol];
|
|
83
|
+
return acc;
|
|
84
|
+
},
|
|
85
|
+
{} as Record<string, T[V]>
|
|
86
|
+
);
|
|
87
|
+
}
|