@tager/admin-banners 1.0.0 → 1.0.2
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/dev/App.vue.d.ts +4 -3
- package/dist/hooks/useFetchBanner.d.ts +3 -3
- package/dist/hooks/useFetchBanners.d.ts +2 -2
- package/dist/hooks/useFetchZoneFields.d.ts +4 -4
- package/dist/hooks/useFetchZones.d.ts +2 -2
- package/dist/index.mjs +584 -666
- package/dist/services/requests.d.ts +3 -3
- package/dist/style.css +1 -1
- package/dist/typings/banners.d.ts +3 -3
- package/dist/typings/common.d.ts +1 -1
- package/dist/typings/model.d.ts +3 -3
- package/dist/typings/zones.d.ts +1 -1
- package/dist/views/Banners/BannerForm/BannerForm.helpers.d.ts +3 -3
- package/dist/views/Banners/BannerForm/BannerForm.vue.d.ts +1845 -370
- package/dist/views/Banners/BannerList/BannerList.helpers.d.ts +4 -4
- package/dist/views/Banners/BannerList/BannerList.vue.d.ts +5 -4
- package/dist/views/Banners/BannerList/hooks/useAdvancedSearch.d.ts +6 -7
- package/dist/views/Zones/ZoneList/ZoneList.helpers.d.ts +3 -3
- package/dist/views/Zones/ZoneList/ZoneList.vue.d.ts +4 -3
- package/package.json +20 -24
- package/src/dev/App.vue +1 -1
- package/src/dev/env.ts +11 -11
- package/src/hooks/useFetchBanner.ts +3 -3
- package/src/hooks/useFetchBanners.ts +3 -3
- package/src/hooks/useFetchZoneFields.ts +4 -4
- package/src/hooks/useFetchZones.ts +2 -2
- package/src/services/requests.ts +3 -3
- package/src/typings/banners.ts +6 -6
- package/src/typings/model.ts +7 -7
- package/src/typings/zones.ts +1 -1
- package/src/utils/paths.ts +5 -5
- package/src/views/Banners/BannerForm/BannerForm.helpers.ts +5 -5
- package/src/views/Banners/BannerForm/BannerForm.vue +6 -6
- package/src/views/Banners/BannerList/BannerList.helpers.ts +4 -4
- package/src/views/Banners/BannerList/BannerList.vue +7 -17
- package/src/views/Banners/BannerList/hooks/useAdvancedSearch.ts +34 -14
- package/src/views/Zones/ZoneList/ZoneList.helpers.ts +3 -3
- package/src/views/Zones/ZoneList/ZoneList.vue +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
2
|
-
import { ColumnDefinition } from '@tager/admin-ui';
|
|
3
|
-
import { Banner, Status } from '../../../typings/banners';
|
|
4
|
-
import { Zone } from '../../../typings/zones';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
|
+
import { type ColumnDefinition } from '@tager/admin-ui';
|
|
3
|
+
import { type Banner, Status } from '../../../typings/banners';
|
|
4
|
+
import { type Zone } from '../../../typings/zones';
|
|
5
5
|
export declare function getStatus(type: Status, t: TFunction): string;
|
|
6
6
|
export declare function getColumnDefs(zoneList: Zone[], t: TFunction): ColumnDefinition<Banner>[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ColumnDefinition } from '@tager/admin-ui';
|
|
2
|
-
import { Banner } from '../../../typings/banners';
|
|
1
|
+
import { type ColumnDefinition } from '@tager/admin-ui';
|
|
2
|
+
import { type Banner } from '../../../typings/banners';
|
|
3
3
|
import { getBannersBannerFormUrl } from '../../../utils/paths';
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export default _default;
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {
|
|
5
7
|
columnDefs: import("vue").ComputedRef<ColumnDefinition<Banner>[]>;
|
|
6
8
|
isRowDataLoading: import("vue").ComputedRef<boolean>;
|
|
7
9
|
rowData: import("vue").Ref<Banner[]>;
|
|
@@ -22,4 +24,3 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
22
24
|
tags: import("vue").ComputedRef<import("@tager/admin-ui").FilterTagType[]>;
|
|
23
25
|
tagRemovalHandler: (event: import("@tager/admin-ui").FilterTagType) => void;
|
|
24
26
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
25
|
-
export default _default;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ComputedRef, Ref
|
|
2
|
-
import { TFunction } from 'i18next';
|
|
3
|
-
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
4
|
-
import { FilterTagType, OptionType } from '@tager/admin-ui';
|
|
5
|
-
import { Zone } from '../../../../typings/zones';
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import { type TFunction } from 'i18next';
|
|
3
|
+
import { type RouteLocationNormalizedLoaded } from 'vue-router';
|
|
4
|
+
import { type FilterTagType, type OptionType } from '@tager/admin-ui';
|
|
5
|
+
import { type Zone } from '../../../../typings/zones';
|
|
6
6
|
interface Params {
|
|
7
|
-
context: SetupContext;
|
|
8
7
|
t: TFunction;
|
|
9
8
|
zoneList: Ref<Zone[]>;
|
|
10
9
|
route: RouteLocationNormalizedLoaded;
|
|
@@ -19,5 +18,5 @@ interface State {
|
|
|
19
18
|
tags: ComputedRef<FilterTagType[]>;
|
|
20
19
|
tagRemovalHandler(event: FilterTagType): void;
|
|
21
20
|
}
|
|
22
|
-
export declare function useAdvancedSearch({
|
|
21
|
+
export declare function useAdvancedSearch({ t, zoneList, route }: Params): State;
|
|
23
22
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
2
|
-
import { ColumnDefinition } from '@tager/admin-ui';
|
|
3
|
-
import { Zone } from '../../../typings/zones';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
|
+
import { type ColumnDefinition } from '@tager/admin-ui';
|
|
3
|
+
import { type Zone } from '../../../typings/zones';
|
|
4
4
|
export declare function getColumnDefs(t: TFunction): ColumnDefinition<Zone>[];
|
|
5
5
|
export declare function getLinkToBannersByZone(zoneId: number): string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Zone } from '../../../typings/zones';
|
|
1
|
+
import { type Zone } from '../../../typings/zones';
|
|
2
2
|
import { getLinkToBannersByZone } from './ZoneList.helpers';
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {
|
|
4
6
|
columnDefs: import("vue").ComputedRef<import("@tager/admin-ui").ColumnDefinition<Zone>[]>;
|
|
5
7
|
isRowDataLoading: import("vue").ComputedRef<boolean>;
|
|
6
8
|
rowData: import("vue").Ref<Zone[]>;
|
|
@@ -8,4 +10,3 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
8
10
|
handleChange: (event: import("@tager/admin-ui/dist/components/DataTable/DataTable.types").TableChangeEvent) => void;
|
|
9
11
|
getLinkToBannersByZone: typeof getLinkToBannersByZone;
|
|
10
12
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
11
|
-
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tager/admin-banners",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build:js": "vite build",
|
|
19
|
-
"build:package": "
|
|
19
|
+
"build:package": "yarn build:js && (yarn emit-declarations || echo 'vue-tsc: type errors found, declarations emitted anyway')",
|
|
20
20
|
"emit-declarations": "vue-tsc --project tsconfig.json --emitDeclarationOnly",
|
|
21
|
-
"start": "
|
|
21
|
+
"start": "vite",
|
|
22
22
|
"prepare": "yarn build:package",
|
|
23
|
-
"tager:update": "yarn upgrade --latest --scope @tager"
|
|
23
|
+
"tager:update": "yarn upgrade --latest --scope @tager",
|
|
24
|
+
"lint": "eslint .",
|
|
25
|
+
"format": "prettier --write src"
|
|
24
26
|
},
|
|
25
27
|
"dependencies": {
|
|
26
28
|
"filesize": "^9.0.11",
|
|
@@ -30,9 +32,7 @@
|
|
|
30
32
|
"path-to-regexp": "^6.1.0"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@babel/eslint-parser": "^7.17.0",
|
|
35
|
-
"@rushstack/eslint-patch": "^1.1.2",
|
|
35
|
+
"@eslint/js": "^9.39.5",
|
|
36
36
|
"@tager/admin-dynamic-field": "^1.0.0",
|
|
37
37
|
"@tager/admin-layout": "^1.0.0",
|
|
38
38
|
"@tager/admin-services": "^1.0.0",
|
|
@@ -41,29 +41,25 @@
|
|
|
41
41
|
"@types/lodash.isequal": "^4.5.6",
|
|
42
42
|
"@types/lodash.pick": "^4.4.7",
|
|
43
43
|
"@types/node": "16.x",
|
|
44
|
-
"@
|
|
45
|
-
"@typescript
|
|
46
|
-
"@vitejs/plugin-vue": "^2.3.1",
|
|
47
|
-
"@vue/cli-plugin-babel": "^5.0.4",
|
|
48
|
-
"@vue/cli-plugin-typescript": "^5.0.4",
|
|
49
|
-
"@vue/cli-service": "~5.0.0",
|
|
50
|
-
"@vue/eslint-config-prettier": "^7.0.0",
|
|
51
|
-
"@vue/eslint-config-typescript": "^10.0.0",
|
|
52
|
-
"concurrently": "^7.1.0",
|
|
44
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
45
|
+
"@vue/eslint-config-typescript": "^14.9.0",
|
|
53
46
|
"core-js": "^3.22.3",
|
|
54
|
-
"eslint": "^
|
|
55
|
-
"eslint-config-prettier": "^
|
|
56
|
-
"eslint-
|
|
57
|
-
"eslint-plugin-
|
|
58
|
-
"eslint-plugin-vue": "^
|
|
47
|
+
"eslint": "^9.39.5",
|
|
48
|
+
"eslint-config-prettier": "^10.1.8",
|
|
49
|
+
"eslint-import-resolver-typescript": "^4.4.5",
|
|
50
|
+
"eslint-plugin-import": "^2.32.0",
|
|
51
|
+
"eslint-plugin-vue": "^10.12.0",
|
|
52
|
+
"globals": "^16.5.0",
|
|
59
53
|
"pinia": "^2.0.21",
|
|
54
|
+
"prettier": "^3.9.10",
|
|
60
55
|
"sass": "^1.51.0",
|
|
61
56
|
"sass-loader": "^12.6.0",
|
|
62
|
-
"typescript": "^
|
|
63
|
-
"vite": "^
|
|
57
|
+
"typescript": "^5.9.3",
|
|
58
|
+
"vite": "^6.4.5",
|
|
64
59
|
"vue": "^3.2.31",
|
|
60
|
+
"vue-eslint-parser": "^10.4.1",
|
|
65
61
|
"vue-router": "^4.0.14",
|
|
66
|
-
"vue-tsc": "^
|
|
62
|
+
"vue-tsc": "^3.3.14"
|
|
67
63
|
},
|
|
68
64
|
"peerDependencies": {
|
|
69
65
|
"@tager/admin-layout": "^1.0.0",
|
package/src/dev/App.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<script lang="ts">
|
|
8
8
|
import { defineComponent } from 'vue';
|
|
9
9
|
|
|
10
|
-
import { MenuItemType, PageLayout } from '@tager/admin-layout';
|
|
10
|
+
import { type MenuItemType, PageLayout } from '@tager/admin-layout';
|
|
11
11
|
import { ViewListIcon } from '@tager/admin-ui';
|
|
12
12
|
import { useI18n } from '@tager/admin-services';
|
|
13
13
|
|
package/src/dev/env.ts
CHANGED
|
@@ -2,16 +2,16 @@ import { initializeEnvironment } from '@tager/admin-services';
|
|
|
2
2
|
|
|
3
3
|
export function populateEnvironment() {
|
|
4
4
|
initializeEnvironment({
|
|
5
|
-
publicPath:
|
|
6
|
-
appEnv:
|
|
7
|
-
apiUrl:
|
|
8
|
-
accessToken:
|
|
9
|
-
websiteUrl:
|
|
10
|
-
websiteButtonUrl:
|
|
11
|
-
sentryDsn:
|
|
12
|
-
sentryEnv:
|
|
13
|
-
baseUrl:
|
|
14
|
-
nodeEnv:
|
|
15
|
-
version:
|
|
5
|
+
publicPath: import.meta.env.VUE_APP_PUBLIC_PATH,
|
|
6
|
+
appEnv: import.meta.env.VUE_APP_ENV,
|
|
7
|
+
apiUrl: import.meta.env.VUE_APP_API_URL,
|
|
8
|
+
accessToken: import.meta.env.VUE_APP_ACCESS_TOKEN,
|
|
9
|
+
websiteUrl: import.meta.env.VUE_APP_WEBSITE_URL,
|
|
10
|
+
websiteButtonUrl: import.meta.env.VUE_APP_WEBSITE_BUTTON_URL,
|
|
11
|
+
sentryDsn: import.meta.env.VUE_APP_SENTRY_DSN,
|
|
12
|
+
sentryEnv: import.meta.env.VUE_APP_SENTRY_ENVIRONMENT,
|
|
13
|
+
baseUrl: import.meta.env.BASE_URL,
|
|
14
|
+
nodeEnv: import.meta.env.MODE,
|
|
15
|
+
version: import.meta.env.VUE_APP_VERSION,
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { onMounted, Ref, watch } from 'vue';
|
|
1
|
+
import { onMounted, type Ref, watch } from 'vue';
|
|
2
2
|
|
|
3
|
-
import { Nullable, ResourceRef, useResource } from '@tager/admin-services';
|
|
3
|
+
import { type Nullable, type ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
5
|
import { getBanner } from '../services/requests';
|
|
6
|
-
import { Banner } from '../typings/banners';
|
|
6
|
+
import { type Banner } from '../typings/banners';
|
|
7
7
|
|
|
8
8
|
export function useFetchBanner({
|
|
9
9
|
bannerId,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { onMounted, SetupContext } from 'vue';
|
|
1
|
+
import { onMounted, type SetupContext } from 'vue';
|
|
2
2
|
|
|
3
|
-
import { ResourceRef, useResource } from '@tager/admin-services';
|
|
3
|
+
import { type ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
5
|
import { getBanners } from '../services/requests';
|
|
6
|
-
import { Banner } from '../typings/banners';
|
|
6
|
+
import { type Banner } from '../typings/banners';
|
|
7
7
|
|
|
8
8
|
export function useFetchBanners(): ResourceRef<Banner[]> {
|
|
9
9
|
const [fetchBanners, resource] = useResource<Banner[]>({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed, onMounted, Ref, SetupContext, watch } from 'vue';
|
|
1
|
+
import { computed, onMounted, type Ref, type SetupContext, watch } from 'vue';
|
|
2
2
|
|
|
3
|
-
import { Nullable, ResourceRef, useResource } from '@tager/admin-services';
|
|
3
|
+
import { type Nullable, type ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
5
|
import { getZoneFields } from '../services/requests';
|
|
6
|
-
import { ZoneFields } from '../typings/zones';
|
|
7
|
-
import { BannerFormValues } from '../typings/banners';
|
|
6
|
+
import { type ZoneFields } from '../typings/zones';
|
|
7
|
+
import { type BannerFormValues } from '../typings/banners';
|
|
8
8
|
|
|
9
9
|
export function useFetchZoneFields({
|
|
10
10
|
values,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { onMounted } from 'vue';
|
|
2
2
|
|
|
3
|
-
import { ResourceRef, useResource } from '@tager/admin-services';
|
|
3
|
+
import { type ResourceRef, useResource } from '@tager/admin-services';
|
|
4
4
|
|
|
5
5
|
import { getZones } from '../services/requests';
|
|
6
|
-
import { Zone } from '../typings/zones';
|
|
6
|
+
import { type Zone } from '../typings/zones';
|
|
7
7
|
|
|
8
8
|
export function useFetchZones(): ResourceRef<Zone[]> {
|
|
9
9
|
const [fetchZones, resource] = useResource<Zone[]>({
|
package/src/services/requests.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { request, ResponseBody } from '@tager/admin-services';
|
|
1
|
+
import { request, type ResponseBody } from '@tager/admin-services';
|
|
2
2
|
|
|
3
|
-
import { Zone, ZoneFields } from '../typings/zones';
|
|
4
|
-
import { Banner, BannerPayload } from '../typings/banners';
|
|
3
|
+
import { type Zone, type ZoneFields } from '../typings/zones';
|
|
4
|
+
import { type Banner, type BannerPayload } from '../typings/banners';
|
|
5
5
|
|
|
6
6
|
/** Zones **/
|
|
7
7
|
|
package/src/typings/banners.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FileType, Nullable } from '@tager/admin-services';
|
|
2
|
-
import { OptionType, SingleFileInputValueType } from '@tager/admin-ui';
|
|
1
|
+
import { type FileType, type Nullable } from '@tager/admin-services';
|
|
2
|
+
import { type OptionType, type SingleFileInputValueType } from '@tager/admin-ui';
|
|
3
3
|
import {
|
|
4
|
-
FieldShortType,
|
|
5
|
-
FieldUnion,
|
|
6
|
-
IncomingValueUnion,
|
|
7
|
-
OutgoingValueUnion,
|
|
4
|
+
type FieldShortType,
|
|
5
|
+
type FieldUnion,
|
|
6
|
+
type IncomingValueUnion,
|
|
7
|
+
type OutgoingValueUnion,
|
|
8
8
|
} from '@tager/admin-dynamic-field';
|
|
9
9
|
|
|
10
10
|
export enum Status {
|
package/src/typings/model.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Nullable, FileType } from '@tager/admin-services';
|
|
1
|
+
import { type Nullable, type FileType } from '@tager/admin-services';
|
|
2
2
|
import {
|
|
3
|
-
FieldConfigUnion,
|
|
4
|
-
FieldShortType,
|
|
5
|
-
IncomingValueUnion,
|
|
3
|
+
type FieldConfigUnion,
|
|
4
|
+
type FieldShortType,
|
|
5
|
+
type IncomingValueUnion,
|
|
6
6
|
} from '@tager/admin-dynamic-field';
|
|
7
7
|
import {
|
|
8
|
-
OptionType,
|
|
9
|
-
ShortCodeItemType,
|
|
10
|
-
SingleFileInputValueType,
|
|
8
|
+
type OptionType,
|
|
9
|
+
type ShortCodeItemType,
|
|
10
|
+
type SingleFileInputValueType,
|
|
11
11
|
} from '@tager/admin-ui';
|
|
12
12
|
|
|
13
13
|
export interface SeoInfo {
|
package/src/typings/zones.ts
CHANGED
package/src/utils/paths.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {compile} from 'path-to-regexp';
|
|
1
|
+
import { compile } from 'path-to-regexp';
|
|
2
2
|
|
|
3
|
-
import {BANNERS_ROUTE_PATHS} from '../constants/paths';
|
|
3
|
+
import { BANNERS_ROUTE_PATHS } from '../constants/paths';
|
|
4
4
|
|
|
5
5
|
export function getBannersZoneListUrl() {
|
|
6
|
-
|
|
6
|
+
return BANNERS_ROUTE_PATHS.ZONE_LIST;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function getBannersBannerListUrl() {
|
|
10
|
-
|
|
10
|
+
return BANNERS_ROUTE_PATHS.BANNER_LIST;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function getBannersBannerFormUrl(params: { bannerId: number | string }) {
|
|
14
|
-
|
|
14
|
+
return compile(BANNERS_ROUTE_PATHS.BANNER_FORM)(params);
|
|
15
15
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { OptionType } from '@tager/admin-ui';
|
|
2
|
-
import { createId, Nullable } from '@tager/admin-services';
|
|
1
|
+
import { type OptionType } from '@tager/admin-ui';
|
|
2
|
+
import { createId, type Nullable } from '@tager/admin-services';
|
|
3
3
|
import { universalFieldUtils } from '@tager/admin-dynamic-field';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
Banner,
|
|
7
|
-
BannerFormValues,
|
|
8
|
-
BannerPayload,
|
|
6
|
+
type Banner,
|
|
7
|
+
type BannerFormValues,
|
|
8
|
+
type BannerPayload,
|
|
9
9
|
} from '../../../typings/banners';
|
|
10
10
|
|
|
11
11
|
export function convertBannerToFormValues(
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:is-content-loading="isContentLoading"
|
|
9
9
|
>
|
|
10
10
|
<template #content>
|
|
11
|
-
<form novalidate @submit.prevent
|
|
11
|
+
<form novalidate @submit.prevent>
|
|
12
12
|
<div class="zone">
|
|
13
13
|
<FormFieldSelect
|
|
14
14
|
v-model:value="values.bannerZone"
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
|
|
80
80
|
<DynamicField
|
|
81
81
|
v-for="field of values.fields"
|
|
82
|
-
:key="field.
|
|
82
|
+
:key="field.id"
|
|
83
83
|
:field="field"
|
|
84
84
|
/>
|
|
85
85
|
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
</template>
|
|
107
107
|
|
|
108
108
|
<script lang="ts">
|
|
109
|
-
import { computed, defineComponent, ref, SetupContext, watch } from 'vue';
|
|
109
|
+
import { computed, defineComponent, ref, type SetupContext, watch } from 'vue';
|
|
110
110
|
import { useRoute, useRouter } from 'vue-router';
|
|
111
111
|
|
|
112
112
|
import {
|
|
@@ -116,8 +116,8 @@ import {
|
|
|
116
116
|
FormFieldSelect,
|
|
117
117
|
FormFooter,
|
|
118
118
|
InputLabel,
|
|
119
|
-
OptionType,
|
|
120
|
-
TagerFormSubmitEvent,
|
|
119
|
+
type OptionType,
|
|
120
|
+
type TagerFormSubmitEvent,
|
|
121
121
|
} from '@tager/admin-ui';
|
|
122
122
|
import { DynamicField, universalFieldUtils } from '@tager/admin-dynamic-field';
|
|
123
123
|
import {
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
import { Page } from '@tager/admin-layout';
|
|
130
130
|
|
|
131
131
|
import { useFetchZones } from '../../../hooks';
|
|
132
|
-
import { BannerFormValues } from '../../../typings/banners';
|
|
132
|
+
import { type BannerFormValues } from '../../../typings/banners';
|
|
133
133
|
import { useFetchBanner } from '../../../hooks/useFetchBanner';
|
|
134
134
|
import {
|
|
135
135
|
getBannersBannerFormUrl,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
2
|
|
|
3
|
-
import { ColumnDefinition } from '@tager/admin-ui';
|
|
3
|
+
import { type ColumnDefinition } from '@tager/admin-ui';
|
|
4
4
|
|
|
5
|
-
import { Banner, Status } from '../../../typings/banners';
|
|
6
|
-
import { Zone } from '../../../typings/zones';
|
|
5
|
+
import { type Banner, Status } from '../../../typings/banners';
|
|
6
|
+
import { type Zone } from '../../../typings/zones';
|
|
7
7
|
|
|
8
8
|
export function getStatus(type: Status, t: TFunction) {
|
|
9
9
|
switch (type) {
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
</template>
|
|
84
84
|
|
|
85
85
|
<script lang="ts">
|
|
86
|
-
import { computed, defineComponent, SetupContext, watch } from 'vue';
|
|
86
|
+
import { computed, defineComponent, type SetupContext, watch } from 'vue';
|
|
87
87
|
import isEqual from 'lodash.isequal';
|
|
88
88
|
import pick from 'lodash.pick';
|
|
89
89
|
import { useRoute, useRouter } from 'vue-router';
|
|
90
90
|
|
|
91
91
|
import {
|
|
92
|
-
ColumnDefinition,
|
|
92
|
+
type ColumnDefinition,
|
|
93
93
|
useDataTable,
|
|
94
94
|
DataTable,
|
|
95
95
|
AdvancedSearch,
|
|
@@ -103,7 +103,7 @@ import { useI18n, useResourceDelete } from '@tager/admin-services';
|
|
|
103
103
|
import { Page } from '@tager/admin-layout';
|
|
104
104
|
|
|
105
105
|
import { deleteBanner, getBanners } from '../../../services/requests';
|
|
106
|
-
import { Banner } from '../../../typings/banners';
|
|
106
|
+
import { type Banner } from '../../../typings/banners';
|
|
107
107
|
import { getBannersBannerFormUrl } from '../../../utils/paths';
|
|
108
108
|
import { useFetchZones } from '../../../hooks';
|
|
109
109
|
|
|
@@ -122,7 +122,7 @@ export default defineComponent({
|
|
|
122
122
|
Page,
|
|
123
123
|
DataTable,
|
|
124
124
|
},
|
|
125
|
-
setup(
|
|
125
|
+
setup() {
|
|
126
126
|
const route = useRoute();
|
|
127
127
|
const router = useRouter();
|
|
128
128
|
const { t } = useI18n();
|
|
@@ -139,7 +139,6 @@ export default defineComponent({
|
|
|
139
139
|
tags,
|
|
140
140
|
tagRemovalHandler,
|
|
141
141
|
} = useAdvancedSearch({
|
|
142
|
-
context,
|
|
143
142
|
t,
|
|
144
143
|
zoneList,
|
|
145
144
|
route,
|
|
@@ -230,17 +229,8 @@ export default defineComponent({
|
|
|
230
229
|
|
|
231
230
|
<style lang="scss">
|
|
232
231
|
.filters {
|
|
233
|
-
display:
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
&:not(:first-child) {
|
|
237
|
-
margin-top: 10px;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.filter {
|
|
241
|
-
padding: 10px 10px 0;
|
|
242
|
-
width: 50%;
|
|
243
|
-
margin: 0;
|
|
244
|
-
}
|
|
232
|
+
display: grid;
|
|
233
|
+
gap: 1rem;
|
|
234
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
245
235
|
}
|
|
246
236
|
</style>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { computed, ComputedRef, ref, Ref, SetupContext, watch } from 'vue';
|
|
2
|
-
import { TFunction } from 'i18next';
|
|
3
|
-
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
1
|
+
import { computed, type ComputedRef, ref, type Ref, type SetupContext, watch } from 'vue';
|
|
2
|
+
import { type TFunction } from 'i18next';
|
|
3
|
+
import { type RouteLocationNormalizedLoaded } from 'vue-router';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
FilterTagType,
|
|
6
|
+
type FilterTagType,
|
|
7
7
|
getFilterParamAsString,
|
|
8
8
|
getFilterParamAsStringArray,
|
|
9
9
|
getFilterParams,
|
|
10
|
-
OptionType,
|
|
10
|
+
type OptionType,
|
|
11
11
|
} from '@tager/admin-ui';
|
|
12
|
+
import { isNotNullish } from '@tager/admin-services';
|
|
12
13
|
|
|
13
|
-
import { Zone } from '../../../../typings/zones';
|
|
14
|
+
import { type Zone } from '../../../../typings/zones';
|
|
14
15
|
import { Status } from '../../../../typings/banners';
|
|
15
16
|
import { getStatus } from '../BannerList.helpers';
|
|
16
17
|
|
|
17
18
|
interface Params {
|
|
18
|
-
context: SetupContext;
|
|
19
19
|
t: TFunction;
|
|
20
20
|
zoneList: Ref<Zone[]>;
|
|
21
21
|
route: RouteLocationNormalizedLoaded;
|
|
@@ -39,12 +39,7 @@ enum FilterTypes {
|
|
|
39
39
|
Status = 'status',
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export function useAdvancedSearch({
|
|
43
|
-
context,
|
|
44
|
-
t,
|
|
45
|
-
zoneList,
|
|
46
|
-
route,
|
|
47
|
-
}: Params): State {
|
|
42
|
+
export function useAdvancedSearch({ t, zoneList, route }: Params): State {
|
|
48
43
|
/** Zone **/
|
|
49
44
|
|
|
50
45
|
const zonesOptionList = computed<OptionType[]>(() =>
|
|
@@ -137,7 +132,32 @@ export function useAdvancedSearch({
|
|
|
137
132
|
|
|
138
133
|
/** Tags **/
|
|
139
134
|
|
|
140
|
-
const tags = computed<FilterTagType[]>(() =>
|
|
135
|
+
const tags = computed<FilterTagType[]>(() =>
|
|
136
|
+
[
|
|
137
|
+
...zoneFilter.value.map(({ value, label }) => ({
|
|
138
|
+
value,
|
|
139
|
+
label,
|
|
140
|
+
name: FilterTypes.Zone,
|
|
141
|
+
title: t('banners:zone'),
|
|
142
|
+
})),
|
|
143
|
+
|
|
144
|
+
...statusFilter.value.map(({ value, label }) => ({
|
|
145
|
+
value,
|
|
146
|
+
label,
|
|
147
|
+
name: FilterTypes.Status,
|
|
148
|
+
title: t('banners:status'),
|
|
149
|
+
})),
|
|
150
|
+
|
|
151
|
+
dateFilter.value
|
|
152
|
+
? {
|
|
153
|
+
value: dateFilter.value,
|
|
154
|
+
label: dateFilter.value,
|
|
155
|
+
name: FilterTypes.Date,
|
|
156
|
+
title: t('banners:date'),
|
|
157
|
+
}
|
|
158
|
+
: null,
|
|
159
|
+
].filter(isNotNullish)
|
|
160
|
+
);
|
|
141
161
|
|
|
142
162
|
return {
|
|
143
163
|
zoneFilter,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
1
|
+
import { type TFunction } from 'i18next';
|
|
2
2
|
|
|
3
|
-
import { ColumnDefinition } from '@tager/admin-ui';
|
|
3
|
+
import { type ColumnDefinition } from '@tager/admin-ui';
|
|
4
4
|
|
|
5
|
-
import { Zone } from '../../../typings/zones';
|
|
5
|
+
import { type Zone } from '../../../typings/zones';
|
|
6
6
|
import { getBannersBannerListUrl } from '../../../utils/paths';
|
|
7
7
|
|
|
8
8
|
export function getColumnDefs(t: TFunction): ColumnDefinition<Zone>[] {
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script lang="ts">
|
|
29
|
-
import { computed, defineComponent, onMounted, SetupContext } from 'vue';
|
|
29
|
+
import { computed, defineComponent, onMounted, type SetupContext } from 'vue';
|
|
30
30
|
|
|
31
31
|
import { CountButton, useDataTable, DataTable } from '@tager/admin-ui';
|
|
32
32
|
import { Page } from '@tager/admin-layout';
|
|
33
33
|
import { useI18n } from '@tager/admin-services';
|
|
34
34
|
|
|
35
|
-
import { Zone } from '../../../typings/zones';
|
|
35
|
+
import { type Zone } from '../../../typings/zones';
|
|
36
36
|
import { getZones } from '../../../services/requests';
|
|
37
37
|
|
|
38
38
|
import { getColumnDefs, getLinkToBannersByZone } from './ZoneList.helpers';
|