nuxt-outfit 1.9.1 → 2.0.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/{module.d.ts → module.d.mts} +10 -1
- package/dist/module.json +5 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/composables/useDataFetch.d.ts +4 -4
- package/dist/runtime/composables/{useDataFetch.mjs → useDataFetch.js} +8 -4
- package/dist/runtime/composables/useFile.d.ts +1 -1
- package/dist/runtime/composables/useForm.d.ts +2 -2
- package/dist/runtime/composables/{useGoodResponse.mjs → useGoodResponse.js} +1 -1
- package/dist/runtime/composables/{useQuery.mjs → useQuery.js} +2 -2
- package/dist/runtime/composables/useSpaHeaders.d.ts +5 -1
- package/dist/runtime/composables/{useSpaHeaders.mjs → useSpaHeaders.js} +1 -1
- package/dist/runtime/plugins/echo.client.d.ts +1 -1
- package/dist/types.d.mts +7 -0
- package/package.json +33 -20
- package/dist/module.cjs +0 -5
- package/dist/types.d.ts +0 -6
- /package/dist/runtime/composables/{useDetectOutsideClick.mjs → useDetectOutsideClick.js} +0 -0
- /package/dist/runtime/composables/{useEcho.mjs → useEcho.js} +0 -0
- /package/dist/runtime/composables/{useFile.mjs → useFile.js} +0 -0
- /package/dist/runtime/composables/{useForm.mjs → useForm.js} +0 -0
- /package/dist/runtime/plugins/{echo.client.mjs → echo.client.js} +0 -0
|
@@ -9,6 +9,15 @@ declare const _default: _nuxt_schema.NuxtModule<{
|
|
|
9
9
|
};
|
|
10
10
|
serverUrl: null;
|
|
11
11
|
httpInstance: null;
|
|
12
|
-
}
|
|
12
|
+
}, {
|
|
13
|
+
echo: {
|
|
14
|
+
broadcaster: string;
|
|
15
|
+
autoConnect: boolean;
|
|
16
|
+
transports: string[];
|
|
17
|
+
host: null;
|
|
18
|
+
};
|
|
19
|
+
serverUrl: null;
|
|
20
|
+
httpInstance: null;
|
|
21
|
+
}, false>;
|
|
13
22
|
|
|
14
23
|
export { _default as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -13,7 +13,7 @@ const includeDeps = (nuxt, deps) => {
|
|
|
13
13
|
}
|
|
14
14
|
nuxt.options.vite.optimizeDeps.include.push(...deps);
|
|
15
15
|
};
|
|
16
|
-
const module = defineNuxtModule({
|
|
16
|
+
const module$1 = defineNuxtModule({
|
|
17
17
|
meta: {
|
|
18
18
|
name: "@nuxt/outfit",
|
|
19
19
|
configKey: "outfit"
|
|
@@ -47,4 +47,4 @@ const module = defineNuxtModule({
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
export { module as default };
|
|
50
|
+
export { module$1 as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const useDataFetch: (name: any, path: any, options?: {}) => Promise<{
|
|
2
|
-
pending:
|
|
3
|
-
refresh:
|
|
4
|
-
data:
|
|
2
|
+
pending: import("vue").Ref<boolean, boolean>;
|
|
3
|
+
refresh: (opts?: import("#app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
|
|
4
|
+
data: import("vue").Ref<unknown, unknown>;
|
|
5
5
|
filters: any;
|
|
6
|
-
currentPage: import("vue").WritableComputedRef<
|
|
6
|
+
currentPage: import("vue").WritableComputedRef<number, number>;
|
|
7
7
|
changePage: (page: any) => Promise<void>;
|
|
8
8
|
changePerPage: (count: any) => Promise<void>;
|
|
9
9
|
filter: () => Promise<void>;
|
|
@@ -25,11 +25,15 @@ export const useDataFetch = async (name, path, options = {}) => {
|
|
|
25
25
|
return result;
|
|
26
26
|
}, {});
|
|
27
27
|
});
|
|
28
|
-
const validQuery = computed(() => ({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
...
|
|
28
|
+
const validQuery = computed(() => ({
|
|
29
|
+
...options?.params ?? {},
|
|
30
|
+
...other,
|
|
31
|
+
...preparedFilters.value
|
|
32
32
|
}));
|
|
33
|
+
const { data, refresh, pending } = await useAsyncData(
|
|
34
|
+
name,
|
|
35
|
+
(_nuxtApp, { signal }) => http(path, { params: validQuery.value }, signal)
|
|
36
|
+
);
|
|
33
37
|
const make = async () => {
|
|
34
38
|
await refresh();
|
|
35
39
|
if (options?.isSilent !== true) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const useForm: (opts?: {}) => {
|
|
2
2
|
fields: any;
|
|
3
|
-
errors: import("vue").Ref<{}>;
|
|
3
|
+
errors: import("vue").Ref<{}, {}>;
|
|
4
4
|
repeatArray: (property: any) => void;
|
|
5
5
|
removeArray: (property: any, index: any) => void;
|
|
6
|
-
isPending: import("vue").Ref<boolean>;
|
|
6
|
+
isPending: import("vue").Ref<boolean, boolean>;
|
|
7
7
|
handleSubmit: (event?: null, params?: null) => Promise<void>;
|
|
8
8
|
clearError: (field: any) => void;
|
|
9
9
|
reset: (values?: null) => void;
|
|
@@ -11,7 +11,7 @@ export const useGoodResponse = () => {
|
|
|
11
11
|
return parse(split(cookies)).map((cookie) => serialize(cookie.name, cookie.value, cookie));
|
|
12
12
|
};
|
|
13
13
|
const setCookieFromResponse = ({ status, headers }) => {
|
|
14
|
-
if (isGoodResponse(status) && !
|
|
14
|
+
if (isGoodResponse(status) && !import.meta.client) {
|
|
15
15
|
setResponseHeaders(event, { "Set-Cookie": parseCookie(headers.get("set-cookie")) });
|
|
16
16
|
}
|
|
17
17
|
};
|
|
@@ -2,8 +2,8 @@ import { useRoute } from "#imports";
|
|
|
2
2
|
export const useQuery = () => {
|
|
3
3
|
const { query } = useRoute();
|
|
4
4
|
const convertValue = (value) => {
|
|
5
|
-
if (!isNaN(value)) {
|
|
6
|
-
return parseFloat(value);
|
|
5
|
+
if (!Number.isNaN(value)) {
|
|
6
|
+
return Number.parseFloat(value);
|
|
7
7
|
} else if (value === "true" || value === "false") {
|
|
8
8
|
return value === "true";
|
|
9
9
|
} else if (value.includes(",")) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRuntimeConfig, useRequestEvent, useRequestHeaders, useEcho } from "#imports";
|
|
2
2
|
export const useSpaHeaders = (additionalHeaders = {}) => {
|
|
3
|
-
if (
|
|
3
|
+
if (import.meta.client) {
|
|
4
4
|
const { getSocketId } = useEcho();
|
|
5
5
|
return {
|
|
6
6
|
headers: additionalHeaders,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
package/dist/types.d.mts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-outfit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Outfit - Connection Laravel and Nuxt",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,28 +15,38 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"types": "./dist/types.d.
|
|
19
|
-
"import": "./dist/module.mjs"
|
|
20
|
-
|
|
18
|
+
"types": "./dist/types.d.mts",
|
|
19
|
+
"import": "./dist/module.mjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/module.mjs",
|
|
23
|
+
"typesVersions": {
|
|
24
|
+
"*": {
|
|
25
|
+
".": [
|
|
26
|
+
"./dist/types.d.mts"
|
|
27
|
+
]
|
|
21
28
|
}
|
|
22
29
|
},
|
|
23
|
-
"main": "./dist/module.cjs",
|
|
24
|
-
"types": "./dist/types.d.ts",
|
|
25
30
|
"files": [
|
|
26
31
|
"dist"
|
|
27
32
|
],
|
|
33
|
+
"workspaces": [
|
|
34
|
+
"playground"
|
|
35
|
+
],
|
|
28
36
|
"scripts": {
|
|
29
|
-
"prepack": "nuxt-module-build",
|
|
30
|
-
"dev": "
|
|
31
|
-
"dev:build": "
|
|
32
|
-
"dev:prepare": "nuxt-module-build --stub &&
|
|
37
|
+
"prepack": "nuxt-module-build build",
|
|
38
|
+
"dev": "npm run dev:prepare && nuxt dev playground",
|
|
39
|
+
"dev:build": "nuxt build playground",
|
|
40
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
33
41
|
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
34
42
|
"lint": "eslint .",
|
|
43
|
+
"lint-fix": "eslint . --fix",
|
|
35
44
|
"test": "vitest run",
|
|
36
|
-
"test:watch": "vitest watch"
|
|
45
|
+
"test:watch": "vitest watch",
|
|
46
|
+
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
37
47
|
},
|
|
38
48
|
"dependencies": {
|
|
39
|
-
"@nuxt/kit": "^
|
|
49
|
+
"@nuxt/kit": "^4.4.2",
|
|
40
50
|
"cookie": "^1.0.2",
|
|
41
51
|
"flat": "^6.0.1",
|
|
42
52
|
"klona": "^2.0.6",
|
|
@@ -47,14 +57,17 @@
|
|
|
47
57
|
"yup": "^1.0.0"
|
|
48
58
|
},
|
|
49
59
|
"devDependencies": {
|
|
50
|
-
"@nuxt/
|
|
51
|
-
"@nuxt/
|
|
52
|
-
"@nuxt/
|
|
53
|
-
"@nuxt/
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
60
|
+
"@nuxt/devtools": "^3.2.4",
|
|
61
|
+
"@nuxt/eslint-config": "^1.15.2",
|
|
62
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
63
|
+
"@nuxt/schema": "^4.4.2",
|
|
64
|
+
"@nuxt/test-utils": "^4.0.0",
|
|
65
|
+
"changelogen": "^0.6.2",
|
|
66
|
+
"eslint": "^10.1.0",
|
|
67
|
+
"nuxt": "^4.4.2",
|
|
68
|
+
"typescript": "~6.0.2",
|
|
69
|
+
"vitest": "^4.1.1",
|
|
70
|
+
"vue-tsc": "^3.2.6"
|
|
58
71
|
},
|
|
59
72
|
"keywords": [
|
|
60
73
|
"outfit",
|
package/dist/module.cjs
DELETED
package/dist/types.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|