@vesperjs/shared 0.8.2 → 0.9.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/dist/index.d.mts +5 -21
- package/dist/index.mjs +2 -17
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ref, WritableComputedRef } from "@vue/reactivity";
|
|
2
2
|
|
|
3
3
|
//#region src/types/error/backend-error-info.d.ts
|
|
4
4
|
interface BackendErrorInfo<BER> {
|
|
@@ -28,22 +28,12 @@ interface Flash {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/composables/backend/error/use-external-errors.d.ts
|
|
31
|
-
declare const useExternalErrors: <P extends string>({
|
|
32
|
-
|
|
33
|
-
}: {
|
|
34
|
-
flash: Ref<Flash>;
|
|
35
|
-
}) => {
|
|
36
|
-
externalErrors: WritableComputedRef<Partial<Record<P, string[]>>, Partial<Record<P, string[]>>>;
|
|
31
|
+
declare const useExternalErrors: <P extends string>(flash: Ref<Flash>) => {
|
|
32
|
+
externalErrors: WritableComputedRef<ErrorMessages<P>>;
|
|
37
33
|
clearExternalErrors: () => void;
|
|
38
34
|
isSuccess: () => boolean;
|
|
39
35
|
};
|
|
40
36
|
//#endregion
|
|
41
|
-
//#region src/composables/backend/error/use-backend-error-info.d.ts
|
|
42
|
-
declare const useBackendErrorInfo: <R extends object>() => {
|
|
43
|
-
backendErrorInfo: ComputedRef<BackendErrorInfo<R>>;
|
|
44
|
-
clearBackendErrorInfo: () => void;
|
|
45
|
-
};
|
|
46
|
-
//#endregion
|
|
47
37
|
//#region src/composables/util/use-date.d.ts
|
|
48
38
|
declare const useDate: (fmtDate?: string, locale?: string) => {
|
|
49
39
|
isValidDate: (value: string) => boolean;
|
|
@@ -67,15 +57,9 @@ declare const useEntity: <M extends object, R extends object = M>() => {
|
|
|
67
57
|
//#endregion
|
|
68
58
|
//#region src/composables/use-flash.d.ts
|
|
69
59
|
declare const useFlash: () => {
|
|
70
|
-
flash: Ref<
|
|
71
|
-
notice?: string | undefined;
|
|
72
|
-
alert?: string | undefined;
|
|
73
|
-
}, Flash | {
|
|
74
|
-
notice?: string | undefined;
|
|
75
|
-
alert?: string | undefined;
|
|
76
|
-
}>;
|
|
60
|
+
flash: Ref<Flash>;
|
|
77
61
|
clearFlash: () => void;
|
|
78
62
|
};
|
|
79
63
|
type UseFlashType = ReturnType<typeof useFlash>;
|
|
80
64
|
//#endregion
|
|
81
|
-
export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, type UseFlashType,
|
|
65
|
+
export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, type UseFlashType, useDate, useEntity, useExternalErrors, useFlash };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, ref } from "@vue/reactivity";
|
|
2
2
|
import { parse } from "@formkit/tempo";
|
|
3
3
|
//#region src/composables/backend/error/use-external-errors.ts
|
|
4
|
-
const useExternalErrors = function(
|
|
4
|
+
const useExternalErrors = function(flash) {
|
|
5
5
|
const errors = ref({});
|
|
6
6
|
const externalErrors = computed({
|
|
7
7
|
get() {
|
|
@@ -27,21 +27,6 @@ const useExternalErrors = function({ flash }) {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region src/composables/backend/error/use-backend-error-info.ts
|
|
31
|
-
const useBackendErrorInfo = function() {
|
|
32
|
-
const info = ref({});
|
|
33
|
-
const backendErrorInfo = computed(() => {
|
|
34
|
-
return info.value;
|
|
35
|
-
});
|
|
36
|
-
const clearBackendErrorInfo = () => {
|
|
37
|
-
info.value = {};
|
|
38
|
-
};
|
|
39
|
-
return {
|
|
40
|
-
backendErrorInfo,
|
|
41
|
-
clearBackendErrorInfo
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
//#endregion
|
|
45
30
|
//#region src/composables/util/use-date.ts
|
|
46
31
|
const useDate = function(fmtDate = "YYYY/MM/DD", locale) {
|
|
47
32
|
const isValidDate = (value) => {
|
|
@@ -83,4 +68,4 @@ const useFlash = function() {
|
|
|
83
68
|
};
|
|
84
69
|
};
|
|
85
70
|
//#endregion
|
|
86
|
-
export {
|
|
71
|
+
export { useDate, useEntity, useExternalErrors, useFlash };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesperjs/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Nuxt",
|
|
6
6
|
"vue.js"
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@eslint/js": "^10.0.1",
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
28
|
-
"@typescript-eslint/parser": "^8.
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^8.60.0",
|
|
28
|
+
"@typescript-eslint/parser": "^8.60.0",
|
|
29
29
|
"@vue/eslint-config-typescript": "^14.7.0",
|
|
30
30
|
"eslint": "^10.4.0",
|
|
31
31
|
"eslint-plugin-vue": "^10.9.1",
|
|
32
|
-
"oxfmt": "^0.
|
|
32
|
+
"oxfmt": "^0.52.0",
|
|
33
33
|
"tsdown": "^0.22.0",
|
|
34
34
|
"typescript": "^6.0.3",
|
|
35
|
-
"typescript-eslint": "^8.
|
|
35
|
+
"typescript-eslint": "^8.60.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@vue/reactivity": "^3.5.34 || ^3.6.0-beta.12"
|