@devappsnpm/vue-kit 1.0.3 → 1.0.5
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/cli/commands/MakeModuleCommand.d.ts +11 -0
- package/dist/cli/commands/MakeModuleCommand.d.ts.map +1 -0
- package/dist/cli/commands/MakeOtherCommands.d.ts +7 -0
- package/dist/cli/commands/MakeOtherCommands.d.ts.map +1 -0
- package/dist/cli/generators/ModuleGenerator.d.ts +31 -0
- package/dist/cli/generators/ModuleGenerator.d.ts.map +1 -0
- package/dist/cli/generators/SingleFileGenerators.d.ts +12 -0
- package/dist/cli/generators/SingleFileGenerators.d.ts.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/utils/FileGenerator.d.ts +44 -0
- package/dist/cli/utils/FileGenerator.d.ts.map +1 -0
- package/dist/cli/utils/NameParser.d.ts +39 -0
- package/dist/cli/utils/NameParser.d.ts.map +1 -0
- package/dist/cli/utils/TemplateRenderer.d.ts +19 -0
- package/dist/cli/utils/TemplateRenderer.d.ts.map +1 -0
- package/dist/config/VueKitConfig.d.ts +19 -0
- package/dist/config/VueKitConfig.d.ts.map +1 -0
- package/dist/config/createVueKit.d.ts +8 -0
- package/dist/config/createVueKit.d.ts.map +1 -0
- package/dist/contracts/api.d.ts +18 -0
- package/dist/contracts/api.d.ts.map +1 -0
- package/dist/contracts/auth.d.ts +16 -0
- package/dist/contracts/auth.d.ts.map +1 -0
- package/dist/contracts/http.d.ts +8 -0
- package/dist/contracts/http.d.ts.map +1 -0
- package/dist/contracts/pagination.d.ts +19 -0
- package/dist/contracts/pagination.d.ts.map +1 -0
- package/dist/core/forms/Form.d.ts +32 -0
- package/dist/core/forms/Form.d.ts.map +1 -0
- package/dist/core/http/HttpClient.d.ts +13 -0
- package/dist/core/http/HttpClient.d.ts.map +1 -0
- package/dist/core/http/HttpClientConfig.d.ts +9 -0
- package/dist/core/http/HttpClientConfig.d.ts.map +1 -0
- package/dist/core/http/HttpError.d.ts +10 -0
- package/dist/core/http/HttpError.d.ts.map +1 -0
- package/dist/core/http/auth/AuthDriver.d.ts +6 -0
- package/dist/core/http/auth/AuthDriver.d.ts.map +1 -0
- package/dist/core/http/auth/CookieAuthDriver.d.ts +12 -0
- package/dist/core/http/auth/CookieAuthDriver.d.ts.map +1 -0
- package/dist/core/http/auth/JwtAuthDriver.d.ts +10 -0
- package/dist/core/http/auth/JwtAuthDriver.d.ts.map +1 -0
- package/dist/core/http/auth/LocalStorageTokenStorage.d.ts +9 -0
- package/dist/core/http/auth/LocalStorageTokenStorage.d.ts.map +1 -0
- package/dist/core/http/auth/SessionStorageTokenStorage.d.ts +9 -0
- package/dist/core/http/auth/SessionStorageTokenStorage.d.ts.map +1 -0
- package/dist/core/http/auth/TokenStorage.d.ts +6 -0
- package/dist/core/http/auth/TokenStorage.d.ts.map +1 -0
- package/dist/core/http/interceptors/response.interceptor.d.ts +4 -0
- package/dist/core/http/interceptors/response.interceptor.d.ts.map +1 -0
- package/dist/core/pagination/Pagination.d.ts +33 -0
- package/dist/core/pagination/Pagination.d.ts.map +1 -0
- package/dist/core/services/BaseService.d.ts +17 -0
- package/dist/core/services/BaseService.d.ts.map +1 -0
- package/dist/core/services/CrudService.d.ts +29 -0
- package/dist/core/services/CrudService.d.ts.map +1 -0
- package/dist/core/stores/BaseStore.d.ts +23 -0
- package/dist/core/stores/BaseStore.d.ts.map +1 -0
- package/dist/core/stores/CrudStore.d.ts +254 -0
- package/dist/core/stores/CrudStore.d.ts.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/ui/components/BaseModal.vue.d.ts +30 -0
- package/dist/ui/components/BaseModal.vue.d.ts.map +1 -0
- package/dist/ui/components/ConfirmDeleteModal.vue.d.ts +17 -0
- package/dist/ui/components/ConfirmDeleteModal.vue.d.ts.map +1 -0
- package/dist/ui/components/ToastContainer.vue.d.ts +4 -0
- package/dist/ui/components/ToastContainer.vue.d.ts.map +1 -0
- package/dist/ui/composables/useToast.d.ts +23 -0
- package/dist/ui/composables/useToast.d.ts.map +1 -0
- package/dist/ui.d.ts +6 -0
- package/dist/ui.d.ts.map +1 -0
- package/package.json +2 -2
- package/stubs/module/crud/modal/components/DeleteModal.vue.stub +1 -1
- package/stubs/module/crud/modal/components/FormModal.vue.stub +2 -2
- package/stubs/module/crud/modal/services/service.ts.stub +2 -2
- package/stubs/module/crud/modal/stores/store.ts.stub +1 -1
- package/stubs/module/crud/page/components/DeleteModal.vue.stub +1 -1
- package/stubs/module/crud/page/components/Form.vue.stub +1 -1
- package/stubs/module/crud/page/pages/CreatePage.vue.stub +1 -1
- package/stubs/module/crud/page/services/service.ts.stub +2 -2
- package/stubs/module/crud/page/stores/store.ts.stub +1 -1
- package/stubs/module/resource/service.ts.stub +2 -2
- package/stubs/module/resource/store.ts.stub +1 -1
- package/stubs/services/service.ts.stub +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared state shape expected by CrudStore.
|
|
3
|
+
* Exported so consuming apps can type their stores explicitly.
|
|
4
|
+
*/
|
|
5
|
+
export interface CrudState<T> {
|
|
6
|
+
items: T[];
|
|
7
|
+
item: T | null;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
saving: boolean;
|
|
10
|
+
deleting: boolean;
|
|
11
|
+
error: string | null;
|
|
12
|
+
pagination: {
|
|
13
|
+
currentPage: number;
|
|
14
|
+
lastPage: number;
|
|
15
|
+
perPage: number;
|
|
16
|
+
total: number;
|
|
17
|
+
} | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the default initial state for a CrudStore.
|
|
21
|
+
*/
|
|
22
|
+
export declare function initialCrudState<T>(): CrudState<T>;
|
|
23
|
+
//# sourceMappingURL=BaseStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseStore.d.ts","sourceRoot":"","sources":["../../../src/core/stores/BaseStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE;QACV,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;CACV;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAUlD"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import type { CrudService } from "../services/CrudService";
|
|
2
|
+
import type { ApiParams } from "../../contracts/api";
|
|
3
|
+
import type { PaginationParams } from "../../contracts/pagination";
|
|
4
|
+
import { Pagination } from "../pagination/Pagination";
|
|
5
|
+
/**
|
|
6
|
+
* Factory that creates a fully-typed Pinia Composition-API store for CRUD operations.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* export const useCustomerStore = defineCrudStore('customer', () => customerService)
|
|
10
|
+
*/
|
|
11
|
+
export declare function defineCrudStore<T extends {
|
|
12
|
+
uuid: string;
|
|
13
|
+
}>(id: string, serviceFactory: () => CrudService<T>): import("pinia").StoreDefinition<string, Pick<{
|
|
14
|
+
items: import("vue").Ref<T[], T[]>;
|
|
15
|
+
item: import("vue").Ref<T | null, T | null>;
|
|
16
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
saving: import("vue").Ref<boolean, boolean>;
|
|
18
|
+
deleting: import("vue").Ref<boolean, boolean>;
|
|
19
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
20
|
+
pagination: import("vue").Ref<{
|
|
21
|
+
readonly meta: {
|
|
22
|
+
current_page: number;
|
|
23
|
+
from: number | null;
|
|
24
|
+
last_page: number;
|
|
25
|
+
per_page: number;
|
|
26
|
+
to: number | null;
|
|
27
|
+
total: number;
|
|
28
|
+
};
|
|
29
|
+
readonly links: {
|
|
30
|
+
first: string | null;
|
|
31
|
+
last: string | null;
|
|
32
|
+
prev: string | null;
|
|
33
|
+
next: string | null;
|
|
34
|
+
};
|
|
35
|
+
readonly currentPage: number;
|
|
36
|
+
readonly lastPage: number;
|
|
37
|
+
readonly perPage: number;
|
|
38
|
+
readonly total: number;
|
|
39
|
+
readonly from: number | null;
|
|
40
|
+
readonly to: number | null;
|
|
41
|
+
readonly isFirstPage: boolean;
|
|
42
|
+
readonly isLastPage: boolean;
|
|
43
|
+
readonly hasPrevPage: boolean;
|
|
44
|
+
readonly hasNextPage: boolean;
|
|
45
|
+
readonly pageCount: number;
|
|
46
|
+
pages: () => number[];
|
|
47
|
+
nextPageParams: () => {
|
|
48
|
+
page: number;
|
|
49
|
+
} | null;
|
|
50
|
+
prevPageParams: () => {
|
|
51
|
+
page: number;
|
|
52
|
+
} | null;
|
|
53
|
+
} | null, Pagination | {
|
|
54
|
+
readonly meta: {
|
|
55
|
+
current_page: number;
|
|
56
|
+
from: number | null;
|
|
57
|
+
last_page: number;
|
|
58
|
+
per_page: number;
|
|
59
|
+
to: number | null;
|
|
60
|
+
total: number;
|
|
61
|
+
};
|
|
62
|
+
readonly links: {
|
|
63
|
+
first: string | null;
|
|
64
|
+
last: string | null;
|
|
65
|
+
prev: string | null;
|
|
66
|
+
next: string | null;
|
|
67
|
+
};
|
|
68
|
+
readonly currentPage: number;
|
|
69
|
+
readonly lastPage: number;
|
|
70
|
+
readonly perPage: number;
|
|
71
|
+
readonly total: number;
|
|
72
|
+
readonly from: number | null;
|
|
73
|
+
readonly to: number | null;
|
|
74
|
+
readonly isFirstPage: boolean;
|
|
75
|
+
readonly isLastPage: boolean;
|
|
76
|
+
readonly hasPrevPage: boolean;
|
|
77
|
+
readonly hasNextPage: boolean;
|
|
78
|
+
readonly pageCount: number;
|
|
79
|
+
pages: () => number[];
|
|
80
|
+
nextPageParams: () => {
|
|
81
|
+
page: number;
|
|
82
|
+
} | null;
|
|
83
|
+
prevPageParams: () => {
|
|
84
|
+
page: number;
|
|
85
|
+
} | null;
|
|
86
|
+
} | null>;
|
|
87
|
+
fetchAll: (params?: PaginationParams & ApiParams) => Promise<void>;
|
|
88
|
+
fetchOne: (id: string | number) => Promise<void>;
|
|
89
|
+
create: (data: unknown) => Promise<T>;
|
|
90
|
+
update: (id: string | number, data: unknown) => Promise<T>;
|
|
91
|
+
remove: (id: string | number) => Promise<void>;
|
|
92
|
+
$reset: () => void;
|
|
93
|
+
}, "items" | "item" | "loading" | "saving" | "deleting" | "error" | "pagination">, Pick<{
|
|
94
|
+
items: import("vue").Ref<T[], T[]>;
|
|
95
|
+
item: import("vue").Ref<T | null, T | null>;
|
|
96
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
97
|
+
saving: import("vue").Ref<boolean, boolean>;
|
|
98
|
+
deleting: import("vue").Ref<boolean, boolean>;
|
|
99
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
100
|
+
pagination: import("vue").Ref<{
|
|
101
|
+
readonly meta: {
|
|
102
|
+
current_page: number;
|
|
103
|
+
from: number | null;
|
|
104
|
+
last_page: number;
|
|
105
|
+
per_page: number;
|
|
106
|
+
to: number | null;
|
|
107
|
+
total: number;
|
|
108
|
+
};
|
|
109
|
+
readonly links: {
|
|
110
|
+
first: string | null;
|
|
111
|
+
last: string | null;
|
|
112
|
+
prev: string | null;
|
|
113
|
+
next: string | null;
|
|
114
|
+
};
|
|
115
|
+
readonly currentPage: number;
|
|
116
|
+
readonly lastPage: number;
|
|
117
|
+
readonly perPage: number;
|
|
118
|
+
readonly total: number;
|
|
119
|
+
readonly from: number | null;
|
|
120
|
+
readonly to: number | null;
|
|
121
|
+
readonly isFirstPage: boolean;
|
|
122
|
+
readonly isLastPage: boolean;
|
|
123
|
+
readonly hasPrevPage: boolean;
|
|
124
|
+
readonly hasNextPage: boolean;
|
|
125
|
+
readonly pageCount: number;
|
|
126
|
+
pages: () => number[];
|
|
127
|
+
nextPageParams: () => {
|
|
128
|
+
page: number;
|
|
129
|
+
} | null;
|
|
130
|
+
prevPageParams: () => {
|
|
131
|
+
page: number;
|
|
132
|
+
} | null;
|
|
133
|
+
} | null, Pagination | {
|
|
134
|
+
readonly meta: {
|
|
135
|
+
current_page: number;
|
|
136
|
+
from: number | null;
|
|
137
|
+
last_page: number;
|
|
138
|
+
per_page: number;
|
|
139
|
+
to: number | null;
|
|
140
|
+
total: number;
|
|
141
|
+
};
|
|
142
|
+
readonly links: {
|
|
143
|
+
first: string | null;
|
|
144
|
+
last: string | null;
|
|
145
|
+
prev: string | null;
|
|
146
|
+
next: string | null;
|
|
147
|
+
};
|
|
148
|
+
readonly currentPage: number;
|
|
149
|
+
readonly lastPage: number;
|
|
150
|
+
readonly perPage: number;
|
|
151
|
+
readonly total: number;
|
|
152
|
+
readonly from: number | null;
|
|
153
|
+
readonly to: number | null;
|
|
154
|
+
readonly isFirstPage: boolean;
|
|
155
|
+
readonly isLastPage: boolean;
|
|
156
|
+
readonly hasPrevPage: boolean;
|
|
157
|
+
readonly hasNextPage: boolean;
|
|
158
|
+
readonly pageCount: number;
|
|
159
|
+
pages: () => number[];
|
|
160
|
+
nextPageParams: () => {
|
|
161
|
+
page: number;
|
|
162
|
+
} | null;
|
|
163
|
+
prevPageParams: () => {
|
|
164
|
+
page: number;
|
|
165
|
+
} | null;
|
|
166
|
+
} | null>;
|
|
167
|
+
fetchAll: (params?: PaginationParams & ApiParams) => Promise<void>;
|
|
168
|
+
fetchOne: (id: string | number) => Promise<void>;
|
|
169
|
+
create: (data: unknown) => Promise<T>;
|
|
170
|
+
update: (id: string | number, data: unknown) => Promise<T>;
|
|
171
|
+
remove: (id: string | number) => Promise<void>;
|
|
172
|
+
$reset: () => void;
|
|
173
|
+
}, never>, Pick<{
|
|
174
|
+
items: import("vue").Ref<T[], T[]>;
|
|
175
|
+
item: import("vue").Ref<T | null, T | null>;
|
|
176
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
177
|
+
saving: import("vue").Ref<boolean, boolean>;
|
|
178
|
+
deleting: import("vue").Ref<boolean, boolean>;
|
|
179
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
180
|
+
pagination: import("vue").Ref<{
|
|
181
|
+
readonly meta: {
|
|
182
|
+
current_page: number;
|
|
183
|
+
from: number | null;
|
|
184
|
+
last_page: number;
|
|
185
|
+
per_page: number;
|
|
186
|
+
to: number | null;
|
|
187
|
+
total: number;
|
|
188
|
+
};
|
|
189
|
+
readonly links: {
|
|
190
|
+
first: string | null;
|
|
191
|
+
last: string | null;
|
|
192
|
+
prev: string | null;
|
|
193
|
+
next: string | null;
|
|
194
|
+
};
|
|
195
|
+
readonly currentPage: number;
|
|
196
|
+
readonly lastPage: number;
|
|
197
|
+
readonly perPage: number;
|
|
198
|
+
readonly total: number;
|
|
199
|
+
readonly from: number | null;
|
|
200
|
+
readonly to: number | null;
|
|
201
|
+
readonly isFirstPage: boolean;
|
|
202
|
+
readonly isLastPage: boolean;
|
|
203
|
+
readonly hasPrevPage: boolean;
|
|
204
|
+
readonly hasNextPage: boolean;
|
|
205
|
+
readonly pageCount: number;
|
|
206
|
+
pages: () => number[];
|
|
207
|
+
nextPageParams: () => {
|
|
208
|
+
page: number;
|
|
209
|
+
} | null;
|
|
210
|
+
prevPageParams: () => {
|
|
211
|
+
page: number;
|
|
212
|
+
} | null;
|
|
213
|
+
} | null, Pagination | {
|
|
214
|
+
readonly meta: {
|
|
215
|
+
current_page: number;
|
|
216
|
+
from: number | null;
|
|
217
|
+
last_page: number;
|
|
218
|
+
per_page: number;
|
|
219
|
+
to: number | null;
|
|
220
|
+
total: number;
|
|
221
|
+
};
|
|
222
|
+
readonly links: {
|
|
223
|
+
first: string | null;
|
|
224
|
+
last: string | null;
|
|
225
|
+
prev: string | null;
|
|
226
|
+
next: string | null;
|
|
227
|
+
};
|
|
228
|
+
readonly currentPage: number;
|
|
229
|
+
readonly lastPage: number;
|
|
230
|
+
readonly perPage: number;
|
|
231
|
+
readonly total: number;
|
|
232
|
+
readonly from: number | null;
|
|
233
|
+
readonly to: number | null;
|
|
234
|
+
readonly isFirstPage: boolean;
|
|
235
|
+
readonly isLastPage: boolean;
|
|
236
|
+
readonly hasPrevPage: boolean;
|
|
237
|
+
readonly hasNextPage: boolean;
|
|
238
|
+
readonly pageCount: number;
|
|
239
|
+
pages: () => number[];
|
|
240
|
+
nextPageParams: () => {
|
|
241
|
+
page: number;
|
|
242
|
+
} | null;
|
|
243
|
+
prevPageParams: () => {
|
|
244
|
+
page: number;
|
|
245
|
+
} | null;
|
|
246
|
+
} | null>;
|
|
247
|
+
fetchAll: (params?: PaginationParams & ApiParams) => Promise<void>;
|
|
248
|
+
fetchOne: (id: string | number) => Promise<void>;
|
|
249
|
+
create: (data: unknown) => Promise<T>;
|
|
250
|
+
update: (id: string | number, data: unknown) => Promise<T>;
|
|
251
|
+
remove: (id: string | number) => Promise<void>;
|
|
252
|
+
$reset: () => void;
|
|
253
|
+
}, "fetchAll" | "fetchOne" | "create" | "update" | "remove" | "$reset">>;
|
|
254
|
+
//# sourceMappingURL=CrudStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrudStore.d.ts","sourceRoot":"","sources":["../../../src/core/stores/CrudStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtD;;;;;GAKG;AACH,wBAAgB,eAAe,C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,GAAG,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;kBAetC,IAAI;yEA0B1B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { createVueKit } from "./config/createVueKit";
|
|
2
|
+
export type { VueKit } from "./config/createVueKit";
|
|
3
|
+
export type { VueKitConfig } from "./config/VueKitConfig";
|
|
4
|
+
export { HttpClient } from "./core/http/HttpClient";
|
|
5
|
+
export type { HttpClientConfig } from "./core/http/HttpClientConfig";
|
|
6
|
+
export { HttpError } from "./core/http/HttpError";
|
|
7
|
+
export { LocalStorageTokenStorage } from "./core/http/auth/LocalStorageTokenStorage";
|
|
8
|
+
export { SessionStorageTokenStorage } from "./core/http/auth/SessionStorageTokenStorage";
|
|
9
|
+
export type { TokenStorage } from "./core/http/auth/TokenStorage";
|
|
10
|
+
export { BaseService } from "./core/services/BaseService";
|
|
11
|
+
export { CrudService } from "./core/services/CrudService";
|
|
12
|
+
export { defineCrudStore } from "./core/stores/CrudStore";
|
|
13
|
+
export type { CrudState } from "./core/stores/BaseStore";
|
|
14
|
+
export { Form } from "./core/forms/Form";
|
|
15
|
+
export { Pagination } from "./core/pagination/Pagination";
|
|
16
|
+
export type { ApiResource, ApiCollection, ApiPaginatedCollection, ApiParams, ApiErrorResponse, } from "./contracts/api";
|
|
17
|
+
export type { PaginationMeta, PaginationLinks, PaginationParams, } from "./contracts/pagination";
|
|
18
|
+
export type { AuthConfig, AuthDriver, TokenStorageConfig, CsrfConfig, } from "./contracts/auth";
|
|
19
|
+
export type { HttpHandlers } from "./contracts/http";
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EAA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__VLS_21: {}, __VLS_23: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
header?: (props: typeof __VLS_19) => any;
|
|
12
|
+
} & {
|
|
13
|
+
default?: (props: typeof __VLS_21) => any;
|
|
14
|
+
} & {
|
|
15
|
+
footer?: (props: typeof __VLS_23) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
close: () => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
onClose?: () => any;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=BaseModal.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseModal.vue.d.ts","sourceRoot":"","sources":["../../../src/ui/components/BaseModal.vue"],"names":[],"mappings":"AA8HA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IAChC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;AAsQF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACpE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
confirmationLabel: string;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
close: () => any;
|
|
10
|
+
confirm: () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onClose?: () => any;
|
|
13
|
+
onConfirm?: () => any;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
//# sourceMappingURL=ConfirmDeleteModal.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ConfirmDeleteModal.vue"],"names":[],"mappings":"AAqGA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;AAmMF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
//# sourceMappingURL=ToastContainer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastContainer.vue.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ToastContainer.vue"],"names":[],"mappings":"AAyPA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ToastType = 'success' | 'error' | 'warning' | 'info';
|
|
2
|
+
export interface Toast {
|
|
3
|
+
id: number;
|
|
4
|
+
message: string;
|
|
5
|
+
type: ToastType;
|
|
6
|
+
duration: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function useToast(): {
|
|
9
|
+
toasts: import("vue").Ref<{
|
|
10
|
+
id: number;
|
|
11
|
+
message: string;
|
|
12
|
+
type: ToastType;
|
|
13
|
+
duration: number;
|
|
14
|
+
}[], Toast[] | {
|
|
15
|
+
id: number;
|
|
16
|
+
message: string;
|
|
17
|
+
type: ToastType;
|
|
18
|
+
duration: number;
|
|
19
|
+
}[]>;
|
|
20
|
+
addToast: (message: string, type?: ToastType, duration?: number) => void;
|
|
21
|
+
removeToast: (id: number) => void;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useToast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/ui/composables/useToast.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAEhE,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAKD,wBAAgB,QAAQ;;YATlB,MAAM;iBACD,MAAM;cACT,SAAS;kBACL,MAAM;;YAHZ,MAAM;iBACD,MAAM;cACT,SAAS;kBACL,MAAM;;wBAOW,MAAM,SAAQ,SAAS;sBAWzB,MAAM;EAYhC"}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as BaseModal } from './ui/components/BaseModal.vue';
|
|
2
|
+
export { default as ConfirmDeleteModal } from './ui/components/ConfirmDeleteModal.vue';
|
|
3
|
+
export { default as ToastContainer } from './ui/components/ToastContainer.vue';
|
|
4
|
+
export { useToast } from './ui/composables/useToast';
|
|
5
|
+
export type { Toast, ToastType } from './ui/composables/useToast';
|
|
6
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AACtF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devappsnpm/vue-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Vue 3 toolkit for Laravel API applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devapps-vue": "./bin/devapps-vue.js"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "tsup && vue-tsc
|
|
34
|
+
"build": "tsup && vue-tsc -p tsconfig.build.json",
|
|
35
35
|
"dev": "tsup --watch",
|
|
36
36
|
"typecheck": "tsc --noEmit",
|
|
37
37
|
"test": "vitest",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ConfirmDeleteModal } from '@
|
|
2
|
+
import { ConfirmDeleteModal } from '@devappsnpm/vue-kit/ui'
|
|
3
3
|
import { use{{ ModuleName }}Store } from '../stores/{{ moduleSlug }}.store'
|
|
4
4
|
import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { reactive, watch } from 'vue'
|
|
3
|
-
import { BaseModal } from '@
|
|
4
|
-
import { Form } from '@
|
|
3
|
+
import { BaseModal } from '@devappsnpm/vue-kit/ui'
|
|
4
|
+
import { Form } from '@devappsnpm/vue-kit'
|
|
5
5
|
import { use{{ ModuleName }}Store } from '../stores/{{ moduleSlug }}.store'
|
|
6
6
|
import type { {{ ModuleName }}, {{ ModuleName }}Form } from '../types/{{ moduleSlug }}.types'
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CrudService } from '@
|
|
2
|
-
import type { HttpClient } from '@
|
|
1
|
+
import { CrudService } from '@devappsnpm/vue-kit'
|
|
2
|
+
import type { HttpClient } from '@devappsnpm/vue-kit'
|
|
3
3
|
import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
|
|
4
4
|
|
|
5
5
|
export class {{ ModuleName }}Service extends CrudService<{{ ModuleName }}> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineCrudStore } from '@
|
|
1
|
+
import { defineCrudStore } from '@devappsnpm/vue-kit'
|
|
2
2
|
import { {{ ModuleName }}Service } from '../services/{{ moduleSlug }}.service'
|
|
3
3
|
import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
|
|
4
4
|
import { useHttpClient } from '@/composables/useHttpClient' // adjust to your project
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ConfirmDeleteModal } from '@
|
|
2
|
+
import { ConfirmDeleteModal } from '@devappsnpm/vue-kit/ui'
|
|
3
3
|
import { use{{ ModuleName }}Store } from '../stores/{{ moduleSlug }}.store'
|
|
4
4
|
import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { reactive, watch } from 'vue'
|
|
3
|
-
import { Form } from '@
|
|
3
|
+
import { Form } from '@devappsnpm/vue-kit'
|
|
4
4
|
import type { {{ ModuleName }}, {{ ModuleName }}Form } from '../types/{{ moduleSlug }}.types'
|
|
5
5
|
|
|
6
6
|
const props = defineProps<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { reactive } from 'vue'
|
|
3
3
|
import { useRouter } from 'vue-router'
|
|
4
|
-
import { Form } from '@
|
|
4
|
+
import { Form } from '@devappsnpm/vue-kit'
|
|
5
5
|
import { use{{ ModuleName }}Store } from '../stores/{{ moduleSlug }}.store'
|
|
6
6
|
import {{ ModuleName }}Form from '../components/{{ ModuleName }}Form.vue'
|
|
7
7
|
import type { {{ ModuleName }}Form as {{ ModuleName }}FormData } from '../types/{{ moduleSlug }}.types'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CrudService } from '@
|
|
2
|
-
import type { HttpClient } from '@
|
|
1
|
+
import { CrudService } from '@devappsnpm/vue-kit'
|
|
2
|
+
import type { HttpClient } from '@devappsnpm/vue-kit'
|
|
3
3
|
import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
|
|
4
4
|
|
|
5
5
|
export class {{ ModuleName }}Service extends CrudService<{{ ModuleName }}> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineCrudStore } from '@
|
|
1
|
+
import { defineCrudStore } from '@devappsnpm/vue-kit'
|
|
2
2
|
import { {{ ModuleName }}Service } from '../services/{{ moduleSlug }}.service'
|
|
3
3
|
import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
|
|
4
4
|
import { useHttpClient } from '@/composables/useHttpClient' // adjust to your project
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CrudService } from '@
|
|
2
|
-
import type { HttpClient } from '@
|
|
1
|
+
import { CrudService } from '@devappsnpm/vue-kit'
|
|
2
|
+
import type { HttpClient } from '@devappsnpm/vue-kit'
|
|
3
3
|
import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
|
|
4
4
|
|
|
5
5
|
export class {{ ModuleName }}Service extends CrudService<{{ ModuleName }}> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineCrudStore } from '@
|
|
1
|
+
import { defineCrudStore } from '@devappsnpm/vue-kit'
|
|
2
2
|
import { {{ ModuleName }}Service } from '../services/{{ moduleSlug }}.service'
|
|
3
3
|
import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
|
|
4
4
|
import { useHttpClient } from '@/composables/useHttpClient' // adjust to your project
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseService } from '@
|
|
2
|
-
import type { HttpClient } from '@
|
|
1
|
+
import { BaseService } from '@devappsnpm/vue-kit'
|
|
2
|
+
import type { HttpClient } from '@devappsnpm/vue-kit'
|
|
3
3
|
|
|
4
4
|
export class {{ ModuleName }}Service extends BaseService {
|
|
5
5
|
constructor(http: HttpClient) {
|