@tager/admin-files 0.0.5 → 1.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.
Files changed (47) hide show
  1. package/dist/constants/paths.d.ts +4 -4
  2. package/dist/constants/routes.d.ts +3 -3
  3. package/dist/dev/App.vue.d.ts +5 -0
  4. package/dist/dev/config.d.ts +2 -0
  5. package/dist/dev/env.d.ts +1 -0
  6. package/dist/dev/main.d.ts +3 -0
  7. package/dist/index.mjs +330 -0
  8. package/dist/locales/apply.d.ts +1 -0
  9. package/dist/locales/en.d.ts +18 -19
  10. package/dist/locales/ru.d.ts +2 -3
  11. package/dist/main.d.ts +3 -3
  12. package/dist/services/requests.d.ts +16 -16
  13. package/dist/typings/model.d.ts +14 -14
  14. package/dist/utils/paths.d.ts +4 -4
  15. package/dist/views/FilesForm/FilesForm.helpers.d.ts +2 -2
  16. package/dist/views/FilesForm/FilesForm.vue.d.ts +22 -50
  17. package/dist/views/FilesForm/index.d.ts +1 -1
  18. package/dist/views/FilesList/FilesList.vue.d.ts +18 -38
  19. package/dist/views/FilesList/index.d.ts +1 -1
  20. package/package.json +51 -48
  21. package/src/constants/routes.ts +10 -10
  22. package/src/dev/App.vue +38 -0
  23. package/src/dev/config.ts +23 -0
  24. package/src/dev/env.ts +17 -0
  25. package/src/dev/main.ts +36 -0
  26. package/src/locales/apply.ts +9 -0
  27. package/src/locales/en.ts +1 -3
  28. package/src/locales/ru.ts +2 -4
  29. package/src/main.ts +2 -6
  30. package/src/views/FilesForm/FilesForm.vue +30 -22
  31. package/src/views/FilesList/FilesList.vue +29 -28
  32. package/README.md +0 -1
  33. package/dist/dev.d.ts +0 -1
  34. package/dist/index.esm.js +0 -850
  35. package/dist/index.umd.js +0 -862
  36. package/dist/node_modules/@tager/admin-ui/src/utils/common.d.ts +0 -59
  37. package/dist/src/dev.d.ts +0 -1
  38. package/dist/src/typings/model.d.ts +0 -14
  39. package/dist/views/FilesList/components/UrlCell/UrlCell.vue.d.ts +0 -169
  40. package/dist/views/FilesList/components/UrlCell/index.d.ts +0 -1
  41. package/src/dev.ts +0 -41
  42. package/src/typings/sfc.d.ts +0 -12
  43. package/src/typings/shims-tsx.d.ts +0 -13
  44. package/src/typings/shims-vue.d.ts +0 -11
  45. package/src/views/App.vue +0 -36
  46. package/src/views/FilesList/components/UrlCell/UrlCell.vue +0 -68
  47. package/src/views/FilesList/components/UrlCell/index.ts +0 -1
@@ -1,4 +1,4 @@
1
- export declare const FILES_ROUTE_PATHS: {
2
- readonly FILES_LIST: "/files";
3
- readonly FILES_FORM: "/files/:fileId";
4
- };
1
+ export declare const FILES_ROUTE_PATHS: {
2
+ readonly FILES_LIST: "/files";
3
+ readonly FILES_FORM: "/files/:fileId";
4
+ };
@@ -1,3 +1,3 @@
1
- import { CustomRouteConfig } from '@tager/admin-layout';
2
- export declare const FILES_LIST_ROUTE: CustomRouteConfig;
3
- export declare const FILES_FORM_ROUTE: CustomRouteConfig;
1
+ import type { RouteRecordRaw } from 'vue-router';
2
+ export declare const FILES_LIST_ROUTE: RouteRecordRaw;
3
+ export declare const FILES_FORM_ROUTE: RouteRecordRaw;
@@ -0,0 +1,5 @@
1
+ import { MenuItemType } from "@tager/admin-layout";
2
+ declare const _default: import("vue").DefineComponent<{}, {
3
+ sidebarMenuList: MenuItemType[];
4
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
5
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import type { AppConfigType } from '@tager/admin-services';
2
+ export declare const OZITAG_CONFIG: AppConfigType;
@@ -0,0 +1 @@
1
+ export declare function populateEnvironment(): void;
@@ -0,0 +1,3 @@
1
+ import '@tager/admin-ui/css';
2
+ import '@tager/admin-layout/css';
3
+ import '@tager/admin-dynamic-field/css';
package/dist/index.mjs ADDED
@@ -0,0 +1,330 @@
1
+ import { i18n, request, useI18n, useResourceDelete, useToast, navigateBack, convertRequestErrorToMap } from "@tager/admin-services";
2
+ import { defineComponent, onMounted, resolveComponent, openBlock, createBlock, withCtx, createVNode, ref, createElementVNode, withModifiers } from "vue";
3
+ import filesize from "filesize";
4
+ import { DataTable, BaseButton, DeleteIcon, useDataTable, cutUrlOrigin, FormFieldFileInput, FormFooter } from "@tager/admin-ui";
5
+ import { Page } from "@tager/admin-layout";
6
+ import { compile } from "path-to-regexp";
7
+ import { useRouter } from "vue-router";
8
+ const EN = {
9
+ home: "Home",
10
+ success: "Success",
11
+ error: "Error",
12
+ createdSuccessMessage: "The file was added successfully",
13
+ createdErrorMessage: "Failed to add file",
14
+ files: "Files",
15
+ filesList: "Files List",
16
+ filesForm: "File Form",
17
+ createFile: "Create file",
18
+ fileCreation: "File creation",
19
+ file: "File",
20
+ fileName: "File",
21
+ fileType: "Type",
22
+ fileSize: "Size",
23
+ delete: "Delete",
24
+ add: "Add"
25
+ };
26
+ const RU = {
27
+ home: "\u0413\u043B\u0430\u0432\u043D\u0430\u044F",
28
+ success: "\u0423\u0441\u043F\u0435\u0445",
29
+ error: "\u041E\u0448\u0438\u0431\u043A\u0430",
30
+ createdSuccessMessage: "\u0424\u0430\u0439\u043B \u0431\u044B\u043B \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D",
31
+ createdErrorMessage: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0444\u0430\u0439\u043B",
32
+ files: "\u0424\u0430\u0439\u043B\u044B",
33
+ filesList: "\u0421\u043F\u0438\u0441\u043E\u043A \u0444\u0430\u0439\u043B\u043E\u0432",
34
+ filesForm: "\u0424\u043E\u0440\u043C\u0430 \u0444\u0430\u0439\u043B\u043E\u0432",
35
+ createFile: "\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0444\u0430\u0439\u043B",
36
+ fileCreation: "\u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u0430",
37
+ file: "\u0424\u0430\u0439\u043B",
38
+ fileName: "\u0418\u043C\u044F \u0444\u0430\u0439\u043B\u0430",
39
+ fileType: "\u0422\u0438\u043F \u0444\u0430\u0439\u043B\u0430",
40
+ fileSize: "\u0420\u0430\u0437\u043C\u0435\u0440",
41
+ delete: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
42
+ add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C"
43
+ };
44
+ function applyTranslations() {
45
+ i18n.addTranslations("en", "files", EN);
46
+ i18n.addTranslations("ru", "files", RU);
47
+ }
48
+ function getFilesList(params) {
49
+ return request.get({ path: "/admin/userfiles", params });
50
+ }
51
+ function getFilesCount() {
52
+ return request.get({ path: "/admin/userfiles/count" });
53
+ }
54
+ function deleteFile(fileId) {
55
+ return request.delete({ path: `/admin/userfiles/${fileId}` });
56
+ }
57
+ function addFile(payload) {
58
+ return request.post({ path: "/admin/userfiles", body: payload });
59
+ }
60
+ const FILES_ROUTE_PATHS = {
61
+ FILES_LIST: "/files",
62
+ FILES_FORM: "/files/:fileId"
63
+ };
64
+ function getFilesListUrl() {
65
+ return FILES_ROUTE_PATHS.FILES_LIST;
66
+ }
67
+ function getFilesFormUrl(params) {
68
+ return compile(FILES_ROUTE_PATHS.FILES_FORM)(params);
69
+ }
70
+ var _export_sfc = (sfc, props) => {
71
+ const target = sfc.__vccOpts || sfc;
72
+ for (const [key, val] of props) {
73
+ target[key] = val;
74
+ }
75
+ return target;
76
+ };
77
+ const _sfc_main$1 = defineComponent({
78
+ name: "FilesList",
79
+ components: { DataTable, BaseButton, DeleteIcon, Page },
80
+ setup() {
81
+ const { t } = useI18n();
82
+ const {
83
+ fetchEntityList: fetchFilesList,
84
+ isLoading: isFilesListLoading,
85
+ rowData: filesList,
86
+ errorMessage,
87
+ searchQuery,
88
+ handleChange,
89
+ pageSize,
90
+ pageCount,
91
+ pageNumber
92
+ } = useDataTable({
93
+ fetchEntityList: (params) => getFilesList({
94
+ query: params.searchQuery,
95
+ pageNumber: params.pageNumber,
96
+ pageSize: params.pageSize
97
+ }),
98
+ initialValue: [],
99
+ resourceName: "Files list",
100
+ pageSize: 100
101
+ });
102
+ onMounted(() => {
103
+ fetchFilesList();
104
+ });
105
+ const { handleResourceDelete, isDeleting } = useResourceDelete({
106
+ deleteResource: deleteFile,
107
+ resourceName: "File",
108
+ onSuccess: fetchFilesList
109
+ });
110
+ const columnDefs = [
111
+ {
112
+ id: 1,
113
+ name: "ID",
114
+ field: "id",
115
+ style: { width: "50px", textAlign: "center" },
116
+ headStyle: { width: "50px", textAlign: "center" }
117
+ },
118
+ {
119
+ id: 2,
120
+ name: t("files:fileName"),
121
+ field: "name"
122
+ },
123
+ {
124
+ id: 3,
125
+ name: t("files:fileType"),
126
+ field: "type"
127
+ },
128
+ {
129
+ id: 4,
130
+ name: t("files:fileSize"),
131
+ field: "size",
132
+ format: ({ row }) => filesize(row.size),
133
+ style: { whiteSpace: "nowrap" },
134
+ headStyle: { whiteSpace: "nowrap" }
135
+ },
136
+ {
137
+ id: 5,
138
+ name: "URL",
139
+ type: "link",
140
+ field: "url",
141
+ format: ({ row }) => ({
142
+ url: row.url,
143
+ text: cutUrlOrigin(row.url)
144
+ })
145
+ },
146
+ {
147
+ id: 6,
148
+ name: t("files:delete"),
149
+ field: "delete",
150
+ style: { textAlign: "center" },
151
+ headStyle: { textAlign: "center" }
152
+ }
153
+ ];
154
+ return {
155
+ columnDefs,
156
+ getFilesFormUrl,
157
+ rowData: filesList,
158
+ isRowDataLoading: isFilesListLoading,
159
+ errorMessage,
160
+ searchQuery,
161
+ handleChange,
162
+ pageSize,
163
+ pageCount,
164
+ pageNumber,
165
+ handleResourceDelete,
166
+ isDeleting
167
+ };
168
+ }
169
+ });
170
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
171
+ const _component_DeleteIcon = resolveComponent("DeleteIcon");
172
+ const _component_BaseButton = resolveComponent("BaseButton");
173
+ const _component_DataTable = resolveComponent("DataTable");
174
+ const _component_Page = resolveComponent("Page");
175
+ return openBlock(), createBlock(_component_Page, {
176
+ title: _ctx.$i18n.t("files:filesList"),
177
+ "header-buttons": [
178
+ {
179
+ text: _ctx.$i18n.t("files:createFile"),
180
+ href: _ctx.getFilesFormUrl({ fileId: "create" })
181
+ }
182
+ ]
183
+ }, {
184
+ default: withCtx(() => [
185
+ createVNode(_component_DataTable, {
186
+ "column-defs": _ctx.columnDefs,
187
+ "row-data": _ctx.rowData,
188
+ loading: _ctx.isRowDataLoading,
189
+ "error-message": _ctx.errorMessage,
190
+ "search-query": _ctx.searchQuery,
191
+ pagination: {
192
+ pageSize: _ctx.pageSize,
193
+ pageCount: _ctx.pageCount,
194
+ pageNumber: _ctx.pageNumber,
195
+ disabled: _ctx.isRowDataLoading
196
+ },
197
+ onChange: _ctx.handleChange
198
+ }, {
199
+ "cell(delete)": withCtx(({ row }) => [
200
+ createVNode(_component_BaseButton, {
201
+ variant: "icon",
202
+ title: _ctx.$i18n.t("files:delete"),
203
+ disabled: _ctx.isDeleting(row.id),
204
+ onClick: ($event) => _ctx.handleResourceDelete(row.id)
205
+ }, {
206
+ default: withCtx(() => [
207
+ createVNode(_component_DeleteIcon)
208
+ ]),
209
+ _: 2
210
+ }, 1032, ["title", "disabled", "onClick"])
211
+ ]),
212
+ _: 1
213
+ }, 8, ["column-defs", "row-data", "loading", "error-message", "search-query", "pagination", "onChange"])
214
+ ]),
215
+ _: 1
216
+ }, 8, ["title", "header-buttons"]);
217
+ }
218
+ var FilesList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
219
+ function convertFilesFormValuesToCreationPayload(values) {
220
+ var _a, _b;
221
+ return {
222
+ file: (_b = (_a = values.file) == null ? void 0 : _a.file.id) != null ? _b : ""
223
+ };
224
+ }
225
+ const _sfc_main = defineComponent({
226
+ name: "FilesForm",
227
+ components: { Page, FormFieldFileInput, FormFooter },
228
+ setup() {
229
+ const { t } = useI18n();
230
+ const toast = useToast();
231
+ const router = useRouter();
232
+ const errors = ref({});
233
+ const values = ref({ file: null });
234
+ const isSubmitting = ref(false);
235
+ function submitForm(event) {
236
+ isSubmitting.value = true;
237
+ const creationPayload = convertFilesFormValuesToCreationPayload(
238
+ values.value
239
+ );
240
+ addFile(creationPayload).then(() => {
241
+ errors.value = {};
242
+ if (event.type === "create" || event.type === "save" || event.type === "create_exit" || event.type === "save_exit") {
243
+ navigateBack(router, getFilesListUrl());
244
+ }
245
+ toast.show({
246
+ variant: "success",
247
+ title: t("files:success"),
248
+ body: t("files:createdSuccessMessage")
249
+ });
250
+ }).catch((error) => {
251
+ console.error(error);
252
+ errors.value = convertRequestErrorToMap(error);
253
+ toast.show({
254
+ variant: "danger",
255
+ title: t("files:error"),
256
+ body: t("files:createdErrorMessage")
257
+ });
258
+ }).finally(() => {
259
+ isSubmitting.value = false;
260
+ });
261
+ }
262
+ return {
263
+ values,
264
+ errors,
265
+ isSubmitting,
266
+ submitForm,
267
+ getFilesListUrl
268
+ };
269
+ }
270
+ });
271
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
272
+ const _component_FormFieldFileInput = resolveComponent("FormFieldFileInput");
273
+ const _component_FormFooter = resolveComponent("FormFooter");
274
+ const _component_Page = resolveComponent("Page");
275
+ return openBlock(), createBlock(_component_Page, {
276
+ title: _ctx.$i18n.t("files:fileCreation")
277
+ }, {
278
+ footer: withCtx(() => [
279
+ createVNode(_component_FormFooter, {
280
+ "back-href": _ctx.getFilesListUrl(),
281
+ "is-submitting": _ctx.isSubmitting,
282
+ "is-creation": true,
283
+ "submit-label": "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C",
284
+ onSubmit: _ctx.submitForm
285
+ }, null, 8, ["back-href", "is-submitting", "onSubmit"])
286
+ ]),
287
+ default: withCtx(() => [
288
+ createElementVNode("form", {
289
+ novalidate: "",
290
+ onSubmit: _cache[1] || (_cache[1] = withModifiers(() => {
291
+ }, ["prevent"]))
292
+ }, [
293
+ createVNode(_component_FormFieldFileInput, {
294
+ value: _ctx.values.file,
295
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.values.file = $event),
296
+ error: _ctx.errors.file,
297
+ label: _ctx.$i18n.t("files:file"),
298
+ name: "file"
299
+ }, null, 8, ["value", "error", "label"])
300
+ ], 32)
301
+ ]),
302
+ _: 1
303
+ }, 8, ["title"]);
304
+ }
305
+ var FilesForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
306
+ const FILES_LIST_ROUTE = {
307
+ path: FILES_ROUTE_PATHS.FILES_LIST,
308
+ component: FilesList,
309
+ name: "Files List",
310
+ meta: {
311
+ getBreadcrumbs: (route, i18n2) => [
312
+ { url: "/", text: i18n2.t("files:home") },
313
+ { url: route.path, text: i18n2.t("files:filesList") }
314
+ ]
315
+ }
316
+ };
317
+ const FILES_FORM_ROUTE = {
318
+ path: FILES_ROUTE_PATHS.FILES_FORM,
319
+ component: FilesForm,
320
+ name: "Files Form",
321
+ meta: {
322
+ getBreadcrumbs: (route, i18n2) => [
323
+ { url: "/", text: i18n2.t("files:home") },
324
+ { url: FILES_LIST_ROUTE.path, text: i18n2.t("files:filesList") },
325
+ { url: route.path, text: i18n2.t("files:filesForm") }
326
+ ]
327
+ }
328
+ };
329
+ applyTranslations();
330
+ export { FILES_FORM_ROUTE, FILES_LIST_ROUTE, addFile, deleteFile, getFilesCount, getFilesFormUrl, getFilesList, getFilesListUrl };
@@ -0,0 +1 @@
1
+ export declare function applyTranslations(): void;
@@ -1,19 +1,18 @@
1
- declare const EN: {
2
- home: string;
3
- success: string;
4
- error: string;
5
- createdSuccessMessage: string;
6
- createdErrorMessage: string;
7
- files: string;
8
- filesList: string;
9
- filesForm: string;
10
- createFile: string;
11
- fileCreation: string;
12
- file: string;
13
- fileName: string;
14
- fileType: string;
15
- fileSize: string;
16
- delete: string;
17
- add: string;
18
- };
19
- export default EN;
1
+ export declare const EN: {
2
+ home: string;
3
+ success: string;
4
+ error: string;
5
+ createdSuccessMessage: string;
6
+ createdErrorMessage: string;
7
+ files: string;
8
+ filesList: string;
9
+ filesForm: string;
10
+ createFile: string;
11
+ fileCreation: string;
12
+ file: string;
13
+ fileName: string;
14
+ fileType: string;
15
+ fileSize: string;
16
+ delete: string;
17
+ add: string;
18
+ };
@@ -1,3 +1,2 @@
1
- import EN from './en';
2
- declare const RU: typeof EN;
3
- export default RU;
1
+ import { EN } from './en';
2
+ export declare const RU: typeof EN;
package/dist/main.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './constants/routes';
2
- export * from './utils/paths';
3
- export * from './services/requests';
1
+ export * from './constants/routes';
2
+ export * from './utils/paths';
3
+ export * from './services/requests';
@@ -1,16 +1,16 @@
1
- import { ResponseBody } from '@tager/admin-services';
2
- import { FileModel } from '../typings/model';
3
- export declare function getFilesList(params?: {
4
- query?: string;
5
- pageNumber?: number;
6
- pageSize?: number;
7
- }): Promise<ResponseBody<Array<FileModel>>>;
8
- export declare function getFilesCount(): Promise<ResponseBody<{
9
- count: number;
10
- }>>;
11
- export declare function deleteFile(fileId: number | string): Promise<{
12
- success: boolean;
13
- }>;
14
- export declare function addFile(payload: {
15
- file: string;
16
- }): Promise<import("@tager/admin-services").ParsedResponseBody>;
1
+ import { ResponseBody } from '@tager/admin-services';
2
+ import { FileModel } from '../typings/model';
3
+ export declare function getFilesList(params?: {
4
+ query?: string;
5
+ pageNumber?: number;
6
+ pageSize?: number;
7
+ }): Promise<ResponseBody<Array<FileModel>>>;
8
+ export declare function getFilesCount(): Promise<ResponseBody<{
9
+ count: number;
10
+ }>>;
11
+ export declare function deleteFile(fileId: number | string): Promise<{
12
+ success: boolean;
13
+ }>;
14
+ export declare function addFile(payload: {
15
+ file: string;
16
+ }): Promise<import("@tager/admin-services").ParsedResponseBody>;
@@ -1,14 +1,14 @@
1
- import { SingleFileInputValueType } from '@tager/admin-ui';
2
- export interface FileModel {
3
- id: number;
4
- name: string;
5
- type: string;
6
- size: number;
7
- url: string;
8
- }
9
- export interface FormValues {
10
- file: SingleFileInputValueType | null;
11
- }
12
- export interface FilesCreatePayload {
13
- file: string;
14
- }
1
+ import { SingleFileInputValueType } from '@tager/admin-ui';
2
+ export interface FileModel {
3
+ id: number;
4
+ name: string;
5
+ type: string;
6
+ size: number;
7
+ url: string;
8
+ }
9
+ export interface FormValues {
10
+ file: SingleFileInputValueType | null;
11
+ }
12
+ export interface FilesCreatePayload {
13
+ file: string;
14
+ }
@@ -1,4 +1,4 @@
1
- export declare function getFilesListUrl(): string;
2
- export declare function getFilesFormUrl(params: {
3
- fileId: string | number;
4
- }): string;
1
+ export declare function getFilesListUrl(): string;
2
+ export declare function getFilesFormUrl(params: {
3
+ fileId: string | number;
4
+ }): string;
@@ -1,2 +1,2 @@
1
- import { FilesCreatePayload, FormValues } from '../../typings/model';
2
- export declare function convertFilesFormValuesToCreationPayload(values: FormValues): FilesCreatePayload;
1
+ import { FilesCreatePayload, FormValues } from '../../typings/model';
2
+ export declare function convertFilesFormValuesToCreationPayload(values: FormValues): FilesCreatePayload;
@@ -1,50 +1,22 @@
1
- import { TagerFormSubmitEvent } from '@tager/admin-ui';
2
- import { getFilesListUrl } from '../../utils/paths';
3
- declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
4
- values: import("@vue/composition-api").Ref<{
5
- file: {
6
- id: string;
7
- file: {
8
- id: string;
9
- mime: string;
10
- name: string;
11
- size: number;
12
- url: string;
13
- };
14
- caption?: string | null | undefined;
15
- } | null;
16
- }>;
17
- errors: import("@vue/composition-api").Ref<{
18
- [x: string]: string;
19
- }>;
20
- isSubmitting: import("@vue/composition-api").Ref<boolean>;
21
- submitForm: (event: TagerFormSubmitEvent) => void;
22
- getFilesListUrl: typeof getFilesListUrl;
23
- }> & import("@vue/composition-api").Data, {}, {}, unknown, {
24
- [x: string]: any;
25
- }> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
26
- [x: string]: any;
27
- }, import("@vue/composition-api").ShallowUnwrapRef<{
28
- values: import("@vue/composition-api").Ref<{
29
- file: {
30
- id: string;
31
- file: {
32
- id: string;
33
- mime: string;
34
- name: string;
35
- size: number;
36
- url: string;
37
- };
38
- caption?: string | null | undefined;
39
- } | null;
40
- }>;
41
- errors: import("@vue/composition-api").Ref<{
42
- [x: string]: string;
43
- }>;
44
- isSubmitting: import("@vue/composition-api").Ref<boolean>;
45
- submitForm: (event: TagerFormSubmitEvent) => void;
46
- getFilesListUrl: typeof getFilesListUrl;
47
- }>, import("@vue/composition-api").Data, {}, {}, {
48
- [x: string]: any;
49
- }, {}, true>);
50
- export default _default;
1
+ import { TagerFormSubmitEvent } from '@tager/admin-ui';
2
+ import { getFilesListUrl } from '../../utils/paths';
3
+ declare const _default: import("vue").DefineComponent<{}, {
4
+ values: import("vue").Ref<{
5
+ file: {
6
+ id: string;
7
+ file: {
8
+ id: string;
9
+ url: string;
10
+ name: string;
11
+ size: number;
12
+ mime: string;
13
+ };
14
+ caption?: import("@tager/admin-services").Nullable<string> | undefined;
15
+ } | null;
16
+ }>;
17
+ errors: import("vue").Ref<Record<string, string>>;
18
+ isSubmitting: import("vue").Ref<boolean>;
19
+ submitForm: (event: TagerFormSubmitEvent) => void;
20
+ getFilesListUrl: typeof getFilesListUrl;
21
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
22
+ export default _default;
@@ -1 +1 @@
1
- export { default } from './FilesForm.vue';
1
+ export { default } from './FilesForm.vue';
@@ -1,38 +1,18 @@
1
- import { ColumnDefinition } from '@tager/admin-ui';
2
- import { FileModel } from '../../typings/model';
3
- import { getFilesFormUrl } from '../../utils/paths';
4
- import UrlCell from './components/UrlCell';
5
- declare const _default: import("vue").ComponentOptions<UrlCell, import("@vue/composition-api").ShallowUnwrapRef<{
6
- columnDefs: ColumnDefinition<FileModel>[];
7
- getFilesFormUrl: typeof getFilesFormUrl;
8
- rowData: import("@vue/composition-api").Ref<FileModel[]>;
9
- isRowDataLoading: import("@vue/composition-api").ComputedRef<boolean>;
10
- errorMessage: import("@vue/composition-api").Ref<import("@tager/admin-services").Nullable<string>>;
11
- searchQuery: import("@vue/composition-api").Ref<string>;
12
- handleChange: (event: import("@tager/admin-ui").TableChangeEvent) => void;
13
- pageSize: import("@vue/composition-api").Ref<number>;
14
- pageCount: import("@vue/composition-api").ComputedRef<number>;
15
- pageNumber: import("@vue/composition-api").Ref<number>;
16
- handleResourceDelete: (entityId: string | number) => void;
17
- isDeleting: (entityId: string | number) => boolean;
18
- }> & import("@vue/composition-api").Data, {}, {}, unknown, {
19
- [x: string]: any;
20
- }> & import("vue").VueConstructor<UrlCell> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
21
- [x: string]: any;
22
- }, import("@vue/composition-api").ShallowUnwrapRef<{
23
- columnDefs: ColumnDefinition<FileModel>[];
24
- getFilesFormUrl: typeof getFilesFormUrl;
25
- rowData: import("@vue/composition-api").Ref<FileModel[]>;
26
- isRowDataLoading: import("@vue/composition-api").ComputedRef<boolean>;
27
- errorMessage: import("@vue/composition-api").Ref<import("@tager/admin-services").Nullable<string>>;
28
- searchQuery: import("@vue/composition-api").Ref<string>;
29
- handleChange: (event: import("@tager/admin-ui").TableChangeEvent) => void;
30
- pageSize: import("@vue/composition-api").Ref<number>;
31
- pageCount: import("@vue/composition-api").ComputedRef<number>;
32
- pageNumber: import("@vue/composition-api").Ref<number>;
33
- handleResourceDelete: (entityId: string | number) => void;
34
- isDeleting: (entityId: string | number) => boolean;
35
- }>, import("@vue/composition-api").Data, {}, {}, {
36
- [x: string]: any;
37
- }, {}, true>);
38
- export default _default;
1
+ import { ColumnDefinition } from '@tager/admin-ui';
2
+ import { FileModel } from '../../typings/model';
3
+ import { getFilesFormUrl } from '../../utils/paths';
4
+ declare const _default: import("vue").DefineComponent<{}, {
5
+ columnDefs: ColumnDefinition<FileModel>[];
6
+ getFilesFormUrl: typeof getFilesFormUrl;
7
+ rowData: import("vue").Ref<FileModel[]>;
8
+ isRowDataLoading: import("vue").ComputedRef<boolean>;
9
+ errorMessage: import("vue").Ref<import("@tager/admin-services").Nullable<string>>;
10
+ searchQuery: import("vue").Ref<string>;
11
+ handleChange: (event: import("@tager/admin-ui/dist/components/DataTable/DataTable.types").TableChangeEvent) => void;
12
+ pageSize: import("vue").Ref<number>;
13
+ pageCount: import("vue").ComputedRef<number>;
14
+ pageNumber: import("vue").Ref<number>;
15
+ handleResourceDelete: (entityId: string | number) => void;
16
+ isDeleting: (entityId: string | number) => boolean;
17
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
18
+ export default _default;
@@ -1 +1 @@
1
- export { default } from './FilesList.vue';
1
+ export { default } from './FilesList.vue';