@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,59 +0,0 @@
1
- import VueRouter, { Route } from 'vue-router';
2
- /**
3
- * @param {Date} date
4
- * @returns {string}
5
- */
6
- export declare function formatDate(date: Date): string;
7
- /**
8
- * @param {Date} date
9
- * @returns {string}
10
- */
11
- export declare function formatDateTime(date: Date): string;
12
- /**
13
- * @param {Date} date
14
- * @returns {string}
15
- */
16
- export declare function formatTime(date: Date): string;
17
- /**
18
- * @param {any} value
19
- * @returns {string}
20
- */
21
- export declare function formatBoolean(value: unknown): "Yes" | "No";
22
- export declare function isValidSelectOption(option: unknown): boolean | null;
23
- export declare function createTabErrorFinder(errors: Record<string, string>): (fieldList: Array<string>) => boolean;
24
- export declare const FINAL_NUMBER_REGEXP: RegExp;
25
- export declare const INTERMEDIATE_NUMBER_REGEXP: RegExp;
26
- export declare const INTERMEDIATE_INTEGER_REGEXP: RegExp;
27
- export declare const DOT_REGEXP: RegExp;
28
- export declare const SPACE_REGEXP: RegExp;
29
- export declare function floatParser(currentValue: string, previousValue: string): string;
30
- export declare function integerParser(currentValue: string, previousValue: string): string;
31
- export declare function getWebsiteOrigin(): string;
32
- export declare function getSearchParams(): URLSearchParams;
33
- export declare function getSearchParamByKey(key: string): string | null;
34
- export declare function updateSearchParam(router: VueRouter, paramName: string, paramValue: string | number | null | undefined): Promise<Route>;
35
- /**
36
- * Example:
37
- * input: "https://ozitag.com/search?query=some_text"
38
- * output: "/search?query=some_text"
39
- */
40
- export declare function cutUrlOrigin(url: string): string;
41
- export declare function isScrollable(element: HTMLElement): boolean;
42
- export declare function getScrollableParent(element: HTMLElement | null): HTMLElement;
43
- export declare class LocalStorageService<T> {
44
- defaultValue: T;
45
- key: string;
46
- constructor(key: string, defaultValue: T);
47
- get(): T;
48
- set(value: T): void;
49
- }
50
- declare type ParamValue = string | (string | null)[];
51
- declare type QueryType = {
52
- [key in string]?: ParamValue;
53
- };
54
- export declare function getFilterParamAsString(query: QueryType, key: string): string | null;
55
- export declare function getFilterParamAsNumber(query: QueryType, key: string): number | null;
56
- export declare function getFilterParamAsStringArray(query: QueryType, key: string): Array<string>;
57
- export declare function getFilterParamAsNumberArray(query: QueryType, key: string): Array<number>;
58
- export declare function getFilterParams(filters: Record<string, string | number | Array<string> | Array<number>>): Record<string, string | Array<string>>;
59
- export {};
package/dist/src/dev.d.ts DELETED
@@ -1 +0,0 @@
1
- import '@tager/admin-ui/dist/admin-ui.css';
@@ -1,14 +0,0 @@
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,169 +0,0 @@
1
- declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<import("@vue/composition-api").Data> & import("@vue/composition-api").Data, {}, {}, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, ({
2
- [x: number]: string;
3
- } & {
4
- length?: number | undefined;
5
- toString?: string | undefined;
6
- toLocaleString?: string | undefined;
7
- pop?: string | undefined;
8
- push?: number | undefined;
9
- concat?: string[] | undefined;
10
- join?: string | undefined;
11
- reverse?: string[] | undefined;
12
- shift?: string | undefined;
13
- slice?: string[] | undefined;
14
- sort?: string[] | undefined;
15
- splice?: {
16
- (start: number, deleteCount?: number | undefined): string[];
17
- (start: number, deleteCount: number, ...items: string[]): string[];
18
- } | undefined;
19
- unshift?: number | undefined;
20
- indexOf?: ((searchElement: string, fromIndex?: number | undefined) => number) | undefined;
21
- lastIndexOf?: ((searchElement: string, fromIndex?: number | undefined) => number) | undefined;
22
- every?: ((callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean) | undefined;
23
- some?: ((callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean) | undefined;
24
- forEach?: ((callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void) | undefined;
25
- map?: (<U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | undefined;
26
- filter?: {
27
- <S extends string>(callbackfn: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
28
- (callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
29
- } | undefined;
30
- reduce?: {
31
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
32
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
33
- <U_1>(callbackfn: (previousValue: U_1, currentValue: string, currentIndex: number, array: string[]) => U_1, initialValue: U_1): U_1;
34
- } | undefined;
35
- reduceRight?: {
36
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
37
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
38
- <U_2>(callbackfn: (previousValue: U_2, currentValue: string, currentIndex: number, array: string[]) => U_2, initialValue: U_2): U_2;
39
- } | undefined;
40
- find?: {
41
- <S_1 extends string>(predicate: (this: void, value: string, index: number, obj: string[]) => value is S_1, thisArg?: any): S_1 | undefined;
42
- (predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
43
- } | undefined;
44
- findIndex?: ((predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any) => number) | undefined;
45
- fill?: ((value: string, start?: number | undefined, end?: number | undefined) => string[]) | undefined;
46
- copyWithin?: ((target: number, start: number, end?: number | undefined) => string[]) | undefined;
47
- entries?: IterableIterator<[number, string]> | undefined;
48
- keys?: IterableIterator<number> | undefined;
49
- values?: IterableIterator<string> | undefined;
50
- includes?: ((searchElement: string, fromIndex?: number | undefined) => boolean) | undefined;
51
- flatMap?: (<U_3, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U_3 | readonly U_3[], thisArg?: This | undefined) => U_3[]) | undefined;
52
- flat?: unknown[] | undefined;
53
- }) | ({} & {
54
- [x: string]: any;
55
- [x: number]: any;
56
- })> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<({
57
- [x: number]: string;
58
- } & {
59
- length?: number | undefined;
60
- toString?: string | undefined;
61
- toLocaleString?: string | undefined;
62
- pop?: string | undefined;
63
- push?: number | undefined;
64
- concat?: string[] | undefined;
65
- join?: string | undefined;
66
- reverse?: string[] | undefined;
67
- shift?: string | undefined;
68
- slice?: string[] | undefined;
69
- sort?: string[] | undefined;
70
- splice?: {
71
- (start: number, deleteCount?: number | undefined): string[];
72
- (start: number, deleteCount: number, ...items: string[]): string[];
73
- } | undefined;
74
- unshift?: number | undefined;
75
- indexOf?: ((searchElement: string, fromIndex?: number | undefined) => number) | undefined;
76
- lastIndexOf?: ((searchElement: string, fromIndex?: number | undefined) => number) | undefined;
77
- every?: ((callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean) | undefined;
78
- some?: ((callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean) | undefined;
79
- forEach?: ((callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void) | undefined;
80
- map?: (<U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | undefined;
81
- filter?: {
82
- <S extends string>(callbackfn: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
83
- (callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
84
- } | undefined;
85
- reduce?: {
86
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
87
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
88
- <U_1>(callbackfn: (previousValue: U_1, currentValue: string, currentIndex: number, array: string[]) => U_1, initialValue: U_1): U_1;
89
- } | undefined;
90
- reduceRight?: {
91
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
92
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
93
- <U_2>(callbackfn: (previousValue: U_2, currentValue: string, currentIndex: number, array: string[]) => U_2, initialValue: U_2): U_2;
94
- } | undefined;
95
- find?: {
96
- <S_1 extends string>(predicate: (this: void, value: string, index: number, obj: string[]) => value is S_1, thisArg?: any): S_1 | undefined;
97
- (predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
98
- } | undefined;
99
- findIndex?: ((predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any) => number) | undefined;
100
- fill?: ((value: string, start?: number | undefined, end?: number | undefined) => string[]) | undefined;
101
- copyWithin?: ((target: number, start: number, end?: number | undefined) => string[]) | undefined;
102
- entries?: IterableIterator<[number, string]> | undefined;
103
- keys?: IterableIterator<number> | undefined;
104
- values?: IterableIterator<string> | undefined;
105
- includes?: ((searchElement: string, fromIndex?: number | undefined) => boolean) | undefined;
106
- flatMap?: (<U_3, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U_3 | readonly U_3[], thisArg?: This | undefined) => U_3[]) | undefined;
107
- flat?: unknown[] | undefined;
108
- }) | ({} & {
109
- [x: string]: any;
110
- [x: number]: any;
111
- }), import("@vue/composition-api").ShallowUnwrapRef<import("@vue/composition-api").Data>, import("@vue/composition-api").Data, {}, {}, ({
112
- [x: number]: string;
113
- } & {
114
- length?: number | undefined;
115
- toString?: string | undefined;
116
- toLocaleString?: string | undefined;
117
- pop?: string | undefined;
118
- push?: number | undefined;
119
- concat?: string[] | undefined;
120
- join?: string | undefined;
121
- reverse?: string[] | undefined;
122
- shift?: string | undefined;
123
- slice?: string[] | undefined;
124
- sort?: string[] | undefined;
125
- splice?: {
126
- (start: number, deleteCount?: number | undefined): string[];
127
- (start: number, deleteCount: number, ...items: string[]): string[];
128
- } | undefined;
129
- unshift?: number | undefined;
130
- indexOf?: ((searchElement: string, fromIndex?: number | undefined) => number) | undefined;
131
- lastIndexOf?: ((searchElement: string, fromIndex?: number | undefined) => number) | undefined;
132
- every?: ((callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean) | undefined;
133
- some?: ((callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean) | undefined;
134
- forEach?: ((callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void) | undefined;
135
- map?: (<U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | undefined;
136
- filter?: {
137
- <S extends string>(callbackfn: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
138
- (callbackfn: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
139
- } | undefined;
140
- reduce?: {
141
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
142
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
143
- <U_1>(callbackfn: (previousValue: U_1, currentValue: string, currentIndex: number, array: string[]) => U_1, initialValue: U_1): U_1;
144
- } | undefined;
145
- reduceRight?: {
146
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
147
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
148
- <U_2>(callbackfn: (previousValue: U_2, currentValue: string, currentIndex: number, array: string[]) => U_2, initialValue: U_2): U_2;
149
- } | undefined;
150
- find?: {
151
- <S_1 extends string>(predicate: (this: void, value: string, index: number, obj: string[]) => value is S_1, thisArg?: any): S_1 | undefined;
152
- (predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
153
- } | undefined;
154
- findIndex?: ((predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any) => number) | undefined;
155
- fill?: ((value: string, start?: number | undefined, end?: number | undefined) => string[]) | undefined;
156
- copyWithin?: ((target: number, start: number, end?: number | undefined) => string[]) | undefined;
157
- entries?: IterableIterator<[number, string]> | undefined;
158
- keys?: IterableIterator<number> | undefined;
159
- values?: IterableIterator<string> | undefined;
160
- includes?: ((searchElement: string, fromIndex?: number | undefined) => boolean) | undefined;
161
- flatMap?: (<U_3, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U_3 | readonly U_3[], thisArg?: This | undefined) => U_3[]) | undefined;
162
- flat?: unknown[] | undefined;
163
- }) | ({} & {
164
- [x: string]: any;
165
- [x: number]: any;
166
- }), {
167
- [x: number]: string;
168
- } | {}, true>);
169
- export default _default;
@@ -1 +0,0 @@
1
- export { default } from './UrlCell.vue';
package/src/dev.ts DELETED
@@ -1,41 +0,0 @@
1
- import Vue, { CreateElement } from 'vue';
2
- import VueCompositionApi, { createApp } from '@vue/composition-api';
3
-
4
- import { configStore, i18n } from '@tager/admin-services';
5
- import { AdminUiPlugin } from '@tager/admin-ui';
6
- import { AdminLayoutPlugin, createRouter } from '@tager/admin-layout';
7
-
8
- import '@tager/admin-ui/dist/admin-ui.css';
9
-
10
- import EN from './locales/en';
11
- import RU from './locales/ru';
12
- import config from './config/config.json';
13
- import App from './views/App.vue';
14
- import { FILES_LIST_ROUTE, FILES_FORM_ROUTE } from './constants/routes';
15
-
16
- configStore.setConfig(config);
17
-
18
- const router = createRouter(
19
- {
20
- routes: [FILES_LIST_ROUTE, FILES_FORM_ROUTE],
21
- },
22
- { useTitleSync: false }
23
- );
24
-
25
- i18n.addTranslations('en', 'files', EN);
26
- i18n.addTranslations('ru', 'files', RU);
27
-
28
- i18n.init({ debug: false, lng: 'ru' }).then(() => {
29
- Vue.use(VueCompositionApi);
30
-
31
- const app = createApp({
32
- router,
33
- render: (h: CreateElement) => h(App),
34
- });
35
-
36
- app.use(i18n.getPlugin());
37
- app.use(AdminUiPlugin);
38
- app.use(AdminLayoutPlugin);
39
-
40
- app.mount('#app');
41
- });
@@ -1,12 +0,0 @@
1
- /** Reference: https://stackoverflow.com/a/53999913 */
2
- // 1. Make sure to import 'vue' before declaring augmented types
3
- import Vue from 'vue';
4
-
5
- // 2. Specify a file with the types you want to augment
6
- // Vue has the constructor type in types/vue.d.ts
7
- declare module 'vue/types/vue' {
8
- // 3. Declare augmentation for Vue
9
- interface Vue {
10
- $style: { [key: string]: string };
11
- }
12
- }
@@ -1,13 +0,0 @@
1
- import Vue, { VNode } from 'vue';
2
-
3
- declare global {
4
- namespace JSX {
5
- // tslint:disable no-empty-interface
6
- interface Element extends VNode {}
7
- // tslint:disable no-empty-interface
8
- interface ElementClass extends Vue {}
9
- interface IntrinsicElements {
10
- [elem: string]: any;
11
- }
12
- }
13
- }
@@ -1,11 +0,0 @@
1
- declare module '*.vue' {
2
- // eslint-disable-next-line import/order
3
- import Vue from 'vue';
4
- export default Vue;
5
- }
6
-
7
- declare module '*.svg' {
8
- import Vue, { VueConstructor } from 'vue';
9
- const content: VueConstructor<Vue>;
10
- export default content;
11
- }
package/src/views/App.vue DELETED
@@ -1,36 +0,0 @@
1
- <template>
2
- <page-layout :sidebar-menu-list="sidebarMenuList">
3
- <router-view />
4
- </page-layout>
5
- </template>
6
-
7
- <script lang="ts">
8
- import { defineComponent, SetupContext } from '@vue/composition-api';
9
-
10
- import { useTranslation } from '@tager/admin-ui';
11
- import { MenuItemType } from '@tager/admin-layout';
12
-
13
- import { getFilesListUrl } from '../utils/paths';
14
-
15
- export default defineComponent({
16
- name: 'App',
17
- setup(props, context: SetupContext) {
18
- const { t } = useTranslation(context);
19
-
20
- const sidebarMenuList: Array<MenuItemType> = [
21
- {
22
- id: 'files',
23
- text: t('files:files'),
24
- icon: 'viewList',
25
- children: [{ text: t('files:filesList'), url: getFilesListUrl() }],
26
- },
27
- ];
28
-
29
- return {
30
- sidebarMenuList,
31
- };
32
- },
33
- });
34
- </script>
35
-
36
- <style scoped lang="scss"></style>
@@ -1,68 +0,0 @@
1
- <template>
2
- <div class="url-cell">
3
- <a :href="url" target="_blank" class="url-text">{{ cutUrlOrigin(url) }}</a>
4
- <base-button variant="icon" class="copy-button" @click="handleCopy(url)">
5
- <svg-icon v-if="!isCopied" name="contentCopy" class="icon-size" />
6
- <svg-icon v-else name="done" class="icon-size icon-color-green" />
7
- </base-button>
8
- </div>
9
- </template>
10
-
11
- <script lang="ts">
12
- import { defineComponent } from '@vue/composition-api';
13
-
14
- import { cutUrlOrigin } from '@tager/admin-ui/src/utils/common';
15
- import { useCopyToClipboard } from '@tager/admin-ui';
16
-
17
- interface Props {
18
- url: string;
19
- }
20
-
21
- export default defineComponent<Props>({
22
- name: 'UrlCell',
23
- props: {
24
- url: {
25
- type: String,
26
- default: '',
27
- },
28
- },
29
- setup() {
30
- const [isCopied, handleCopy] = useCopyToClipboard(500);
31
-
32
- return {
33
- isCopied,
34
- handleCopy,
35
- cutUrlOrigin,
36
- };
37
- },
38
- });
39
- </script>
40
-
41
- <style lang="scss" scoped>
42
- .url-cell {
43
- display: flex;
44
- align-items: center;
45
-
46
- .url-text {
47
- color: #007bff;
48
-
49
- &:hover {
50
- color: #0056b3;
51
- text-decoration: underline;
52
- }
53
- }
54
-
55
- .copy-button {
56
- margin-left: 5px;
57
-
58
- .icon-size {
59
- width: 14px;
60
- height: 14px;
61
- }
62
-
63
- .icon-color-green {
64
- color: #22863a;
65
- }
66
- }
67
- }
68
- </style>
@@ -1 +0,0 @@
1
- export { default } from './UrlCell.vue';