@winchsa/ui 0.1.59 → 0.1.60
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/.DS_Store +0 -0
- package/dist/utils/toaster.js +8 -8
- package/dist/utils/toaster.mjs +8 -8
- package/package.json +67 -67
package/dist/.DS_Store
ADDED
|
Binary file
|
package/dist/utils/toaster.js
CHANGED
|
@@ -34,15 +34,15 @@ function responseAlert() {
|
|
|
34
34
|
} = toaster();
|
|
35
35
|
const getErrorMessage = response => {
|
|
36
36
|
const errorResponse = response?.response?._data;
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
37
|
+
const errorsList = errorResponse?.status?.errors_list;
|
|
38
|
+
const general = errorsList?.find(e => e.field == "0");
|
|
39
|
+
if (general) {
|
|
40
|
+
return general.message;
|
|
41
41
|
}
|
|
42
|
-
if (response?.data?.status
|
|
42
|
+
if (response?.data?.status?.code === 422 && errorsList?.length) {
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
|
-
return
|
|
45
|
+
return errorResponse?.status?.message ?? null;
|
|
46
46
|
};
|
|
47
47
|
const showAlert = response => {
|
|
48
48
|
const message = getErrorMessage(response);
|
|
@@ -52,8 +52,8 @@ function responseAlert() {
|
|
|
52
52
|
};
|
|
53
53
|
const showValidationAlert = response => {
|
|
54
54
|
const errorResponse = response?.response?._data;
|
|
55
|
-
if (response?.data?.status
|
|
56
|
-
const validationErrors = errorResponse?.status
|
|
55
|
+
if (response?.data?.status?.code === 422) {
|
|
56
|
+
const validationErrors = errorResponse?.status?.errors_list?.map(error => error.message).join(" ,");
|
|
57
57
|
if (validationErrors) {
|
|
58
58
|
showError(validationErrors);
|
|
59
59
|
return;
|
package/dist/utils/toaster.mjs
CHANGED
|
@@ -24,15 +24,15 @@ export function responseAlert() {
|
|
|
24
24
|
const { error: showError } = toaster();
|
|
25
25
|
const getErrorMessage = (response) => {
|
|
26
26
|
const errorResponse = response?.response?._data;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
return
|
|
27
|
+
const errorsList = errorResponse?.status?.errors_list;
|
|
28
|
+
const general = errorsList?.find((e) => e.field == "0");
|
|
29
|
+
if (general) {
|
|
30
|
+
return general.message;
|
|
31
31
|
}
|
|
32
|
-
if (response?.data?.status
|
|
32
|
+
if (response?.data?.status?.code === 422 && errorsList?.length) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return errorResponse?.status?.message ?? null;
|
|
36
36
|
};
|
|
37
37
|
const showAlert = (response) => {
|
|
38
38
|
const message = getErrorMessage(response);
|
|
@@ -42,8 +42,8 @@ export function responseAlert() {
|
|
|
42
42
|
};
|
|
43
43
|
const showValidationAlert = (response) => {
|
|
44
44
|
const errorResponse = response?.response?._data;
|
|
45
|
-
if (response?.data?.status
|
|
46
|
-
const validationErrors = errorResponse?.status
|
|
45
|
+
if (response?.data?.status?.code === 422) {
|
|
46
|
+
const validationErrors = errorResponse?.status?.errors_list?.map((error) => error.message).join(" ,");
|
|
47
47
|
if (validationErrors) {
|
|
48
48
|
showError(validationErrors);
|
|
49
49
|
return;
|
package/package.json
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"name": "@winchsa/ui",
|
|
3
|
+
"version": "0.1.60",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"private": false,
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/*"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"require": "./dist/index.js",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
8
17
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
".": {
|
|
14
|
-
"require": "./dist/index.js",
|
|
15
|
-
"import": "./dist/index.mjs",
|
|
16
|
-
"types": "./dist/index.d.ts"
|
|
17
|
-
},
|
|
18
|
-
"./utils": {
|
|
19
|
-
"require": "./dist/utils/index.js",
|
|
20
|
-
"import": "./dist/utils/index.mjs",
|
|
21
|
-
"types": "./dist/utils/index.d.ts"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"main": "./dist/index.js",
|
|
25
|
-
"module": "./dist/index.mjs",
|
|
26
|
-
"scripts": {
|
|
27
|
-
"dev": "vite",
|
|
28
|
-
"build": "unbuild",
|
|
29
|
-
"lint": "eslint \"**/*.{ts,vue,mjs}\"",
|
|
30
|
-
"lint:fix": "eslint \"**/*.{ts,vue,mjs}\" --fix",
|
|
31
|
-
"bump": "pnpm version patch && pnpm run build && git add . && git commit -m \"chore: release v$(node -p \"require('./package.json').version\")\""
|
|
32
|
-
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
|
35
|
-
"@tanstack/vue-query": "^5.74.5",
|
|
36
|
-
"@vueuse/core": "11.3.0",
|
|
37
|
-
"@vueuse/router": "^13.1.0",
|
|
38
|
-
"ofetch": "^1.4.1",
|
|
39
|
-
"vue": "^3.5.13",
|
|
40
|
-
"vue-i18n": "9.14.5",
|
|
41
|
-
"vue-router": "4.4.5",
|
|
42
|
-
"vue-sonner": "^1.3.0",
|
|
43
|
-
"vue3-perfect-scrollbar": "2.0.0",
|
|
44
|
-
"vuetify": "3.10.11"
|
|
45
|
-
},
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"@vuepic/vue-datepicker": "^11.0.0",
|
|
48
|
-
"cropperjs": "^1.6.2",
|
|
49
|
-
"print-js": "^1.6.0",
|
|
50
|
-
"v-calendar": "^3.1.2",
|
|
51
|
-
"vue-multiselect": "^3.1.0"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@tanstack/eslint-plugin-query": "^5.73.3",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
56
|
-
"@types/node": "^22.12.0",
|
|
57
|
-
"@vitejs/plugin-vue": "^6.0.1",
|
|
58
|
-
"eslint": "^8.57.1",
|
|
59
|
-
"eslint-import-resolver-typescript": "^4.3.3",
|
|
60
|
-
"eslint-plugin-import": "^2.31.0",
|
|
61
|
-
"eslint-plugin-vue": "^9.32.0",
|
|
62
|
-
"sass": "1.92.1",
|
|
63
|
-
"typescript": "^5.9.3",
|
|
64
|
-
"unbuild": "^3.0.0",
|
|
65
|
-
"vite": "^5.4.21",
|
|
66
|
-
"vite-plugin-vuetify": "^2.1.2",
|
|
67
|
-
"vue-sfc-transformer": "^0.1.16",
|
|
68
|
-
"vue-tsc": "^3.1.1"
|
|
18
|
+
"./utils": {
|
|
19
|
+
"require": "./dist/utils/index.js",
|
|
20
|
+
"import": "./dist/utils/index.mjs",
|
|
21
|
+
"types": "./dist/utils/index.d.ts"
|
|
69
22
|
}
|
|
70
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"module": "./dist/index.mjs",
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
|
28
|
+
"@tanstack/vue-query": "^5.74.5",
|
|
29
|
+
"@vueuse/core": "11.3.0",
|
|
30
|
+
"@vueuse/router": "^13.1.0",
|
|
31
|
+
"ofetch": "^1.4.1",
|
|
32
|
+
"vue": "^3.5.13",
|
|
33
|
+
"vue-i18n": "9.14.5",
|
|
34
|
+
"vue-router": "4.4.5",
|
|
35
|
+
"vue-sonner": "^1.3.0",
|
|
36
|
+
"vue3-perfect-scrollbar": "2.0.0",
|
|
37
|
+
"vuetify": "3.10.11"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@vuepic/vue-datepicker": "^11.0.0",
|
|
41
|
+
"cropperjs": "^1.6.2",
|
|
42
|
+
"print-js": "^1.6.0",
|
|
43
|
+
"v-calendar": "^3.1.2",
|
|
44
|
+
"vue-multiselect": "^3.1.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@tanstack/eslint-plugin-query": "^5.73.3",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
49
|
+
"@types/node": "^22.12.0",
|
|
50
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
51
|
+
"eslint": "^8.57.1",
|
|
52
|
+
"eslint-import-resolver-typescript": "^4.3.3",
|
|
53
|
+
"eslint-plugin-import": "^2.31.0",
|
|
54
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
55
|
+
"sass": "1.92.1",
|
|
56
|
+
"typescript": "^5.9.3",
|
|
57
|
+
"unbuild": "^3.0.0",
|
|
58
|
+
"vite": "^5.4.21",
|
|
59
|
+
"vite-plugin-vuetify": "^2.1.2",
|
|
60
|
+
"vue-sfc-transformer": "^0.1.16",
|
|
61
|
+
"vue-tsc": "^3.1.1"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"dev": "vite",
|
|
65
|
+
"build": "unbuild",
|
|
66
|
+
"lint": "eslint \"**/*.{ts,vue,mjs}\"",
|
|
67
|
+
"lint:fix": "eslint \"**/*.{ts,vue,mjs}\" --fix",
|
|
68
|
+
"bump": "pnpm run build && pnpm version patch"
|
|
69
|
+
}
|
|
70
|
+
}
|