@tager/admin-banners 0.3.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 (75) hide show
  1. package/dist/constants/paths.d.ts +5 -10
  2. package/dist/constants/routes.d.ts +4 -4
  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/hooks/index.d.ts +2 -2
  8. package/dist/hooks/useFetchBanner.d.ts +7 -8
  9. package/dist/hooks/useFetchBanners.d.ts +3 -6
  10. package/dist/hooks/useFetchZoneFields.d.ts +7 -0
  11. package/dist/hooks/useFetchZones.d.ts +3 -6
  12. package/dist/index.mjs +993 -0
  13. package/dist/locales/apply.d.ts +1 -0
  14. package/dist/locales/en.d.ts +41 -40
  15. package/dist/locales/ru.d.ts +2 -3
  16. package/dist/main.d.ts +3 -4
  17. package/dist/services/requests.d.ts +25 -24
  18. package/dist/style.css +1 -0
  19. package/dist/typings/banners.d.ts +47 -40
  20. package/dist/typings/common.d.ts +1 -1
  21. package/dist/typings/model.d.ts +104 -104
  22. package/dist/typings/zones.d.ts +9 -5
  23. package/dist/utils/common.d.ts +2 -2
  24. package/dist/utils/paths.d.ts +5 -0
  25. package/dist/views/Banners/BannerForm/BannerForm.helpers.d.ts +5 -5
  26. package/dist/views/Banners/BannerForm/BannerForm.vue.d.ts +2694 -81
  27. package/dist/views/Banners/BannerForm/index.d.ts +1 -1
  28. package/dist/views/Banners/BannerList/BannerList.helpers.d.ts +6 -6
  29. package/dist/views/Banners/BannerList/BannerList.vue.d.ts +25 -55
  30. package/dist/views/Banners/BannerList/hooks/index.d.ts +1 -1
  31. package/dist/views/Banners/BannerList/hooks/useAdvancedSearch.d.ts +23 -21
  32. package/dist/views/Banners/BannerList/index.d.ts +1 -1
  33. package/dist/views/Zones/ZoneList/ZoneList.helpers.d.ts +5 -5
  34. package/dist/views/Zones/ZoneList/ZoneList.vue.d.ts +11 -28
  35. package/dist/views/Zones/ZoneList/index.d.ts +1 -1
  36. package/package.json +51 -49
  37. package/src/constants/paths.ts +1 -15
  38. package/src/constants/routes.ts +7 -7
  39. package/src/dev/App.vue +46 -0
  40. package/src/dev/config.ts +23 -0
  41. package/src/dev/env.ts +17 -0
  42. package/src/dev/main.ts +47 -0
  43. package/src/hooks/useFetchBanner.ts +3 -6
  44. package/src/hooks/useFetchBanners.ts +2 -5
  45. package/src/hooks/useFetchZoneFields.ts +39 -0
  46. package/src/hooks/useFetchZones.ts +2 -5
  47. package/src/locales/apply.ts +9 -0
  48. package/src/locales/en.ts +2 -1
  49. package/src/locales/ru.ts +40 -41
  50. package/src/main.ts +3 -8
  51. package/src/services/requests.ts +7 -1
  52. package/src/typings/banners.ts +14 -2
  53. package/src/typings/zones.ts +6 -0
  54. package/src/utils/paths.ts +15 -0
  55. package/src/views/Banners/BannerForm/BannerForm.helpers.ts +10 -0
  56. package/src/views/Banners/BannerForm/BannerForm.vue +168 -83
  57. package/src/views/Banners/BannerList/BannerList.helpers.ts +11 -4
  58. package/src/views/Banners/BannerList/BannerList.vue +60 -47
  59. package/src/views/Banners/BannerList/hooks/useAdvancedSearch.ts +14 -14
  60. package/src/views/Zones/ZoneList/ZoneList.helpers.ts +1 -1
  61. package/src/views/Zones/ZoneList/ZoneList.vue +18 -19
  62. package/CHANGELOG.md +0 -13
  63. package/dist/constants/menu.d.ts +0 -5
  64. package/dist/dev.d.ts +0 -1
  65. package/dist/index.esm.js +0 -3621
  66. package/dist/index.umd.js +0 -3640
  67. package/dist/router/index.d.ts +0 -4
  68. package/src/constants/menu.ts +0 -26
  69. package/src/dev.ts +0 -34
  70. package/src/router/index.ts +0 -38
  71. package/src/typings/sfc.d.ts +0 -12
  72. package/src/typings/shims-tsx.d.ts +0 -13
  73. package/src/typings/shims-vue.d.ts +0 -11
  74. package/src/views/App.vue +0 -22
  75. package/src/views/Home.vue +0 -37
@@ -0,0 +1 @@
1
+ export declare function applyTranslations(): void;
@@ -1,40 +1,41 @@
1
- declare const EN: {
2
- home: string;
3
- zone: string;
4
- zones: string;
5
- banners: string;
6
- bannerForm: string;
7
- createBanner: string;
8
- updateBanner: string;
9
- link: string;
10
- image: string;
11
- openNewTab: string;
12
- period: string;
13
- from: string;
14
- to: string;
15
- disabled: string;
16
- comment: string;
17
- status: string;
18
- bannerZoneIsDeleted: string;
19
- newTab: string;
20
- yes: string;
21
- no: string;
22
- edit: string;
23
- remove: string;
24
- actions: string;
25
- date: string;
26
- name: string;
27
- success: string;
28
- error: string;
29
- statuses: {
30
- waiting: string;
31
- archived: string;
32
- active: string;
33
- disabled: string;
34
- };
35
- bannerWasSuccessfullyCreated: string;
36
- bannerWasSuccessfullyUpdated: string;
37
- bannerCreationWasFailed: string;
38
- bannerUpdateWasFailed: string;
39
- };
40
- export default EN;
1
+ export declare const EN: {
2
+ home: string;
3
+ zone: string;
4
+ zones: string;
5
+ banners: string;
6
+ bannerForm: string;
7
+ createBanner: string;
8
+ updateBanner: string;
9
+ link: string;
10
+ image: string;
11
+ openNewTab: string;
12
+ period: string;
13
+ from: string;
14
+ to: string;
15
+ disabled: string;
16
+ comment: string;
17
+ status: string;
18
+ bannerZoneIsDeleted: string;
19
+ newTab: string;
20
+ yes: string;
21
+ no: string;
22
+ edit: string;
23
+ remove: string;
24
+ actions: string;
25
+ date: string;
26
+ name: string;
27
+ priority: string;
28
+ success: string;
29
+ error: string;
30
+ statuses: {
31
+ waiting: string;
32
+ archived: string;
33
+ active: string;
34
+ disabled: string;
35
+ };
36
+ bannerWasSuccessfullyCreated: string;
37
+ bannerWasSuccessfullyUpdated: string;
38
+ bannerCreationWasFailed: string;
39
+ bannerUpdateWasFailed: string;
40
+ };
41
+ export default EN;
@@ -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,4 +1,3 @@
1
- export * from './constants/routes';
2
- export * from './constants/menu';
3
- export * from './constants/paths';
4
- export * from './services/requests';
1
+ export * from './constants/routes';
2
+ export * from './utils/paths';
3
+ export * from './services/requests';
@@ -1,24 +1,25 @@
1
- import { ResponseBody } from '@tager/admin-services';
2
- import { Zone } from '../typings/zones';
3
- import { Banner, BannerPayload } from '../typings/banners';
4
- /** Zones **/
5
- export declare function getZones(params?: {
6
- query?: string;
7
- pageNumber?: number;
8
- pageSize?: number;
9
- }): Promise<ResponseBody<Zone[]>>;
10
- /** Banners **/
11
- export declare function getBanners(params?: {
12
- query?: string;
13
- pageNumber?: number;
14
- pageSize?: number;
15
- }): Promise<ResponseBody<Banner[]>>;
16
- export declare function getBanner(bannerId: number | string): Promise<ResponseBody<Banner>>;
17
- export declare function createBanner(payload: BannerPayload): Promise<ResponseBody<Banner>>;
18
- export declare function updateBanner(bannerId: number | string, payload: BannerPayload): Promise<ResponseBody<Banner>>;
19
- export declare function deleteBanner(bannerId: number | string): Promise<{
20
- success: boolean;
21
- }>;
22
- export declare function getBannerCount(): Promise<ResponseBody<{
23
- count: number;
24
- }>>;
1
+ import { ResponseBody } from '@tager/admin-services';
2
+ import { Zone, ZoneFields } from '../typings/zones';
3
+ import { Banner, BannerPayload } from '../typings/banners';
4
+ /** Zones **/
5
+ export declare function getZones(params?: {
6
+ query?: string;
7
+ pageNumber?: number;
8
+ pageSize?: number;
9
+ }): Promise<ResponseBody<Zone[]>>;
10
+ export declare function getZoneFields(zoneId: string): Promise<ResponseBody<ZoneFields>>;
11
+ /** Banners **/
12
+ export declare function getBanners(params?: {
13
+ query?: string;
14
+ pageNumber?: number;
15
+ pageSize?: number;
16
+ }): Promise<ResponseBody<Banner[]>>;
17
+ export declare function getBanner(bannerId: number | string): Promise<ResponseBody<Banner>>;
18
+ export declare function createBanner(payload: BannerPayload): Promise<ResponseBody<Banner>>;
19
+ export declare function updateBanner(bannerId: number | string, payload: BannerPayload): Promise<ResponseBody<Banner>>;
20
+ export declare function deleteBanner(bannerId: number | string): Promise<{
21
+ success: boolean;
22
+ }>;
23
+ export declare function getBannerCount(): Promise<ResponseBody<{
24
+ count: number;
25
+ }>>;
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .filters{display:flex;margin:0 -10px}.filters:not(:first-child){margin-top:10px}.filters .filter{padding:10px 10px 0;width:50%;margin:0}.date{display:grid;grid-template-columns:repeat(2,1fr);column-gap:10px}.zone{display:flex}.zone>*:first-child{flex:1 1 1px}.zone>*:last-child{flex-basis:30%;margin-left:20px}.link{display:flex;align-items:flex-end}.link>*:first-child{flex:1 1 1px}.link>*:last-child{flex-basis:30%;margin-left:20px;padding-bottom:8px}
@@ -1,40 +1,47 @@
1
- import { FileType, Nullable } from '@tager/admin-services';
2
- import { OptionType, SingleFileInputValueType } from '@tager/admin-ui';
3
- export declare enum Status {
4
- Waiting = "WAITING",
5
- Archived = "ARCHIVED",
6
- Active = "ACTIVE",
7
- Disabled = "DISABLED"
8
- }
9
- export interface Banner {
10
- id: number;
11
- status: Status;
12
- link: Nullable<string>;
13
- image: Nullable<FileType>;
14
- bannerZone: Nullable<string>;
15
- openNewTab: boolean;
16
- dateStart: Nullable<string>;
17
- dateEnd: Nullable<string>;
18
- disabled: boolean;
19
- comment: Nullable<string>;
20
- }
21
- export interface BannerFormValues {
22
- link: Nullable<string>;
23
- image: Nullable<SingleFileInputValueType>;
24
- bannerZone: Nullable<OptionType>;
25
- openNewTab: boolean;
26
- dateStart: string;
27
- dateEnd: string;
28
- disabled: boolean;
29
- comment: string;
30
- }
31
- export interface BannerPayload {
32
- link: Nullable<string>;
33
- image: Nullable<string>;
34
- bannerZone: string;
35
- openNewTab: boolean;
36
- dateStart: string;
37
- dateEnd: string;
38
- disabled: boolean;
39
- comment: string;
40
- }
1
+ import { FileType, Nullable } from '@tager/admin-services';
2
+ import { OptionType, SingleFileInputValueType } from '@tager/admin-ui';
3
+ import { FieldShortType, FieldUnion, IncomingValueUnion, OutgoingValueUnion } from '@tager/admin-dynamic-field';
4
+ export declare enum Status {
5
+ Waiting = "WAITING",
6
+ Archived = "ARCHIVED",
7
+ Active = "ACTIVE",
8
+ Disabled = "DISABLED"
9
+ }
10
+ export interface Banner {
11
+ id: number;
12
+ status: Status;
13
+ priority: number;
14
+ link: Nullable<string>;
15
+ image: Nullable<FileType>;
16
+ bannerZone: Nullable<string>;
17
+ openNewTab: boolean;
18
+ dateStart: Nullable<string>;
19
+ dateEnd: Nullable<string>;
20
+ disabled: boolean;
21
+ comment: Nullable<string>;
22
+ fields: FieldShortType<IncomingValueUnion>[];
23
+ }
24
+ export interface BannerFormValues {
25
+ link: Nullable<string>;
26
+ image: Nullable<SingleFileInputValueType>;
27
+ bannerZone: Nullable<OptionType>;
28
+ priority: string;
29
+ openNewTab: boolean;
30
+ dateStart: string;
31
+ dateEnd: string;
32
+ disabled: boolean;
33
+ comment: string;
34
+ fields: FieldUnion[];
35
+ }
36
+ export interface BannerPayload {
37
+ link: Nullable<string>;
38
+ image: Nullable<string>;
39
+ priority: number;
40
+ bannerZone: string;
41
+ openNewTab: boolean;
42
+ dateStart: Nullable<string>;
43
+ dateEnd: Nullable<string>;
44
+ disabled: boolean;
45
+ comment: string;
46
+ fields: FieldShortType<OutgoingValueUnion>[];
47
+ }
@@ -1 +1 @@
1
- export declare type Values<T> = T[keyof T];
1
+ export declare type Values<T> = T[keyof T];
@@ -1,104 +1,104 @@
1
- import { Nullable, FileType } from '@tager/admin-services';
2
- import { FieldConfigUnion, FieldShortType, IncomingValueUnion } from '@tager/admin-dynamic-field';
3
- import { OptionType, ShortCodeItemType, SingleFileInputValueType } from '@tager/admin-ui';
4
- export interface SeoInfo {
5
- readonly pageTitle: Nullable<string>;
6
- readonly pageDescription: Nullable<string>;
7
- readonly pageKeywords: Nullable<string>;
8
- readonly openGraphTitle: Nullable<string>;
9
- readonly openGraphDescription: Nullable<string>;
10
- readonly openGraphImage: Nullable<FileType>;
11
- }
12
- export interface Category extends SeoInfo {
13
- readonly id: number;
14
- readonly name: string;
15
- readonly isDefault: boolean;
16
- readonly language: string;
17
- readonly url: string;
18
- readonly urlTemplate: string;
19
- readonly urlAlias: string;
20
- readonly postsCount: string;
21
- readonly parent: Nullable<{
22
- id: Nullable<number>;
23
- name: string;
24
- }>;
25
- readonly depth: number;
26
- }
27
- export interface PostShort {
28
- readonly id: number;
29
- readonly title: string;
30
- readonly url: string;
31
- readonly excerpt: string;
32
- readonly status: string;
33
- readonly language: string;
34
- readonly categories: Category[];
35
- readonly datetime: string;
36
- readonly image: Nullable<FileType>;
37
- }
38
- export interface PostFull extends SeoInfo {
39
- readonly id: number;
40
- readonly language: string;
41
- readonly title: string;
42
- readonly url: string;
43
- readonly urlTemplate: string;
44
- readonly urlAlias: string;
45
- readonly datetime: string | null;
46
- readonly status: string;
47
- readonly excerpt: string;
48
- readonly image: Nullable<FileType>;
49
- readonly imageMobile: Nullable<FileType>;
50
- readonly categories: Category[];
51
- readonly body: string;
52
- readonly coverImage: Nullable<FileType>;
53
- readonly relatedPosts: Pick<PostShort, 'id' | 'title'>[];
54
- readonly tags: string[];
55
- readonly additionalFields: FieldShortType<IncomingValueUnion>[];
56
- }
57
- export interface Language {
58
- readonly id: string;
59
- readonly name: string;
60
- }
61
- export interface DefaultCategory {
62
- readonly id: number;
63
- readonly name: string;
64
- readonly language: string;
65
- }
66
- export interface FileScenarios {
67
- readonly cover: Nullable<string>;
68
- readonly image: Nullable<string>;
69
- readonly imageMobile: Nullable<string>;
70
- readonly content: Nullable<string>;
71
- readonly openGraph: Nullable<string>;
72
- }
73
- export interface ModuleConfig {
74
- readonly urlPostTemplate: Nullable<string>;
75
- readonly urlCategoryTemplate: Nullable<string>;
76
- readonly languages: Language[];
77
- readonly defaultCategories: DefaultCategory[];
78
- readonly fields: FieldConfigUnion[];
79
- readonly shortcodes: ShortCodeItemType[];
80
- readonly fileScenarios: FileScenarios;
81
- }
82
- export interface CategoryFormValues {
83
- language: Nullable<OptionType>;
84
- name: string;
85
- parent: OptionType<Nullable<number>>;
86
- urlAlias: string;
87
- isDefault: boolean;
88
- pageTitle: Nullable<string>;
89
- pageDescription: Nullable<string>;
90
- pageKeywords: Nullable<string>;
91
- openGraphTitle: Nullable<string>;
92
- openGraphDescription: Nullable<string>;
93
- openGraphImage: Nullable<SingleFileInputValueType>;
94
- }
95
- export interface CategoryPayload {
96
- language: Nullable<string>;
97
- name: string;
98
- parent: Nullable<number>;
99
- urlAlias: Nullable<string>;
100
- isDefault: boolean;
101
- pageTitle: Nullable<string>;
102
- pageDescription: Nullable<string>;
103
- openGraphImage: Nullable<string>;
104
- }
1
+ import { Nullable, FileType } from '@tager/admin-services';
2
+ import { FieldConfigUnion, FieldShortType, IncomingValueUnion } from '@tager/admin-dynamic-field';
3
+ import { OptionType, ShortCodeItemType, SingleFileInputValueType } from '@tager/admin-ui';
4
+ export interface SeoInfo {
5
+ readonly pageTitle: Nullable<string>;
6
+ readonly pageDescription: Nullable<string>;
7
+ readonly pageKeywords: Nullable<string>;
8
+ readonly openGraphTitle: Nullable<string>;
9
+ readonly openGraphDescription: Nullable<string>;
10
+ readonly openGraphImage: Nullable<FileType>;
11
+ }
12
+ export interface Category extends SeoInfo {
13
+ readonly id: number;
14
+ readonly name: string;
15
+ readonly isDefault: boolean;
16
+ readonly language: string;
17
+ readonly url: string;
18
+ readonly urlTemplate: string;
19
+ readonly urlAlias: string;
20
+ readonly postsCount: string;
21
+ readonly parent: Nullable<{
22
+ id: Nullable<number>;
23
+ name: string;
24
+ }>;
25
+ readonly depth: number;
26
+ }
27
+ export interface PostShort {
28
+ readonly id: number;
29
+ readonly title: string;
30
+ readonly url: string;
31
+ readonly excerpt: string;
32
+ readonly status: string;
33
+ readonly language: string;
34
+ readonly categories: Category[];
35
+ readonly datetime: string;
36
+ readonly image: Nullable<FileType>;
37
+ }
38
+ export interface PostFull extends SeoInfo {
39
+ readonly id: number;
40
+ readonly language: string;
41
+ readonly title: string;
42
+ readonly url: string;
43
+ readonly urlTemplate: string;
44
+ readonly urlAlias: string;
45
+ readonly datetime: string | null;
46
+ readonly status: string;
47
+ readonly excerpt: string;
48
+ readonly image: Nullable<FileType>;
49
+ readonly imageMobile: Nullable<FileType>;
50
+ readonly categories: Category[];
51
+ readonly body: string;
52
+ readonly coverImage: Nullable<FileType>;
53
+ readonly relatedPosts: Pick<PostShort, 'id' | 'title'>[];
54
+ readonly tags: string[];
55
+ readonly additionalFields: FieldShortType<IncomingValueUnion>[];
56
+ }
57
+ export interface Language {
58
+ readonly id: string;
59
+ readonly name: string;
60
+ }
61
+ export interface DefaultCategory {
62
+ readonly id: number;
63
+ readonly name: string;
64
+ readonly language: string;
65
+ }
66
+ export interface FileScenarios {
67
+ readonly cover: Nullable<string>;
68
+ readonly image: Nullable<string>;
69
+ readonly imageMobile: Nullable<string>;
70
+ readonly content: Nullable<string>;
71
+ readonly openGraph: Nullable<string>;
72
+ }
73
+ export interface ModuleConfig {
74
+ readonly urlPostTemplate: Nullable<string>;
75
+ readonly urlCategoryTemplate: Nullable<string>;
76
+ readonly languages: Language[];
77
+ readonly defaultCategories: DefaultCategory[];
78
+ readonly fields: FieldConfigUnion[];
79
+ readonly shortcodes: ShortCodeItemType[];
80
+ readonly fileScenarios: FileScenarios;
81
+ }
82
+ export interface CategoryFormValues {
83
+ language: Nullable<OptionType>;
84
+ name: string;
85
+ parent: OptionType<Nullable<number>>;
86
+ urlAlias: string;
87
+ isDefault: boolean;
88
+ pageTitle: Nullable<string>;
89
+ pageDescription: Nullable<string>;
90
+ pageKeywords: Nullable<string>;
91
+ openGraphTitle: Nullable<string>;
92
+ openGraphDescription: Nullable<string>;
93
+ openGraphImage: Nullable<SingleFileInputValueType>;
94
+ }
95
+ export interface CategoryPayload {
96
+ language: Nullable<string>;
97
+ name: string;
98
+ parent: Nullable<number>;
99
+ urlAlias: Nullable<string>;
100
+ isDefault: boolean;
101
+ pageTitle: Nullable<string>;
102
+ pageDescription: Nullable<string>;
103
+ openGraphImage: Nullable<string>;
104
+ }
@@ -1,5 +1,9 @@
1
- export interface Zone {
2
- id: string;
3
- name: string;
4
- bannersCount: number;
5
- }
1
+ import { FieldConfigUnion } from '@tager/admin-dynamic-field';
2
+ export interface Zone {
3
+ id: string;
4
+ name: string;
5
+ bannersCount: number;
6
+ }
7
+ export interface ZoneFields extends Zone {
8
+ fields: FieldConfigUnion[];
9
+ }
@@ -1,2 +1,2 @@
1
- export declare function generateNumberArray(length: number): Array<number>;
2
- export declare function getNameWithDepth(name: string, depth: number): string;
1
+ export declare function generateNumberArray(length: number): Array<number>;
2
+ export declare function getNameWithDepth(name: string, depth: number): string;
@@ -0,0 +1,5 @@
1
+ export declare function getBannersZoneListUrl(): "/banners/zones";
2
+ export declare function getBannersBannerListUrl(): "/banners";
3
+ export declare function getBannersBannerFormUrl(params: {
4
+ bannerId: number | string;
5
+ }): string;
@@ -1,5 +1,5 @@
1
- import { OptionType } from '@tager/admin-ui';
2
- import { Nullable } from '@tager/admin-services';
3
- import { Banner, BannerFormValues, BannerPayload } from '../../../typings/banners';
4
- export declare function convertBannerToFormValues(banner: Nullable<Banner>, zonesOptionList: OptionType[]): BannerFormValues;
5
- export declare function convertBannerFormValuesToPayload(values: BannerFormValues): BannerPayload;
1
+ import { OptionType } from '@tager/admin-ui';
2
+ import { Nullable } from '@tager/admin-services';
3
+ import { Banner, BannerFormValues, BannerPayload } from '../../../typings/banners';
4
+ export declare function convertBannerToFormValues(banner: Nullable<Banner>, zonesOptionList: OptionType[]): BannerFormValues;
5
+ export declare function convertBannerFormValuesToPayload(values: BannerFormValues): BannerPayload;