@tager/admin-blog 0.3.43 → 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/constants/paths.d.ts +6 -14
- package/dist/constants/routes.d.ts +5 -5
- package/dist/dev/App.vue.d.ts +5 -0
- package/dist/dev/config.d.ts +2 -0
- package/dist/dev/env.d.ts +1 -0
- package/dist/dev/main.d.ts +3 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/useFetchCategories.d.ts +3 -6
- package/dist/hooks/useFetchCategory.d.ts +7 -8
- package/dist/hooks/useFetchModuleConfig.d.ts +3 -6
- package/dist/hooks/useFetchPosts.d.ts +3 -6
- package/dist/index.mjs +2355 -0
- package/dist/locales/apply.d.ts +1 -0
- package/dist/locales/en.d.ts +92 -86
- package/dist/locales/ru.d.ts +3 -3
- package/dist/main.d.ts +3 -4
- package/dist/services/requests.d.ts +60 -59
- package/dist/style.css +1 -0
- package/dist/typings/common.d.ts +1 -1
- package/dist/typings/model.d.ts +106 -106
- package/dist/utils/common.d.ts +2 -2
- package/dist/utils/paths.d.ts +8 -0
- package/dist/views/Categories/CategoryForm/CategoryForm.helpers.d.ts +7 -7
- package/dist/views/Categories/CategoryForm/CategoryForm.vue.d.ts +53 -116
- package/dist/views/Categories/CategoryForm/index.d.ts +1 -1
- package/dist/views/Categories/CategoryList/CategoryList.helpers.d.ts +7 -7
- package/dist/views/Categories/CategoryList/CategoryList.vue.d.ts +26 -57
- package/dist/views/Categories/CategoryList/hooks/index.d.ts +1 -1
- package/dist/views/Categories/CategoryList/hooks/useAdvancedSearch.d.ts +19 -16
- package/dist/views/Categories/CategoryList/index.d.ts +1 -1
- package/dist/views/Posts/PostForm/PostForm.helpers.d.ts +32 -32
- package/dist/views/Posts/PostForm/PostForm.vue.d.ts +2768 -9398
- package/dist/views/Posts/PostForm/index.d.ts +1 -1
- package/dist/views/Posts/PostList/PostList.helpers.d.ts +8 -7
- package/dist/views/Posts/PostList/PostList.vue.d.ts +40 -78
- package/dist/views/Posts/PostList/hooks/index.d.ts +1 -1
- package/dist/views/Posts/PostList/hooks/useAdvancedSearch.d.ts +27 -24
- package/dist/views/Posts/PostList/index.d.ts +1 -1
- package/package.json +51 -49
- package/src/constants/paths.ts +0 -22
- package/src/constants/routes.ts +9 -9
- package/src/dev/App.vue +56 -0
- package/src/dev/config.ts +23 -0
- package/src/dev/env.ts +17 -0
- package/src/dev/main.ts +49 -0
- package/src/hooks/useFetchCategories.ts +2 -7
- package/src/hooks/useFetchCategory.ts +3 -6
- package/src/hooks/useFetchModuleConfig.ts +2 -7
- package/src/hooks/useFetchPosts.ts +4 -6
- package/src/locales/apply.ts +9 -0
- package/src/locales/en.ts +10 -4
- package/src/locales/ru.ts +11 -3
- package/src/main.ts +3 -8
- package/src/services/requests.ts +1 -0
- package/src/utils/paths.ts +23 -0
- package/src/views/Categories/CategoryForm/CategoryForm.vue +81 -65
- package/src/views/Categories/CategoryList/CategoryList.helpers.ts +1 -1
- package/src/views/Categories/CategoryList/CategoryList.vue +86 -58
- package/src/views/Categories/CategoryList/hooks/useAdvancedSearch.ts +9 -12
- package/src/views/Posts/PostForm/PostForm.vue +265 -225
- package/src/views/Posts/PostList/PostList.helpers.ts +27 -2
- package/src/views/Posts/PostList/PostList.vue +203 -192
- package/src/views/Posts/PostList/hooks/useAdvancedSearch.ts +22 -30
- package/CHANGELOG.md +0 -13
- package/dist/constants/menu.d.ts +0 -5
- package/dist/dev.d.ts +0 -1
- package/dist/index.esm.js +0 -5294
- package/dist/index.umd.js +0 -5321
- package/dist/router/index.d.ts +0 -4
- package/dist/views/Posts/PostForm/components/TabList/TabList.types.d.ts +0 -5
- package/dist/views/Posts/PostForm/components/TabList/index.d.ts +0 -2
- package/src/constants/menu.ts +0 -31
- package/src/dev.ts +0 -34
- package/src/router/index.ts +0 -40
- package/src/typings/sfc.d.ts +0 -12
- package/src/typings/shims-tsx.d.ts +0 -13
- package/src/typings/shims-vue.d.ts +0 -11
- package/src/typings/translate.d.ts +0 -10
- package/src/views/App.vue +0 -22
- package/src/views/Home.vue +0 -31
- package/src/views/Posts/PostForm/components/TabList/TabList.types.ts +0 -5
- package/src/views/Posts/PostForm/components/TabList/TabList.vue +0 -92
- package/src/views/Posts/PostForm/components/TabList/index.ts +0 -2
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Ref,
|
|
5
|
-
ref,
|
|
6
|
-
SetupContext,
|
|
7
|
-
watch,
|
|
8
|
-
} from '@vue/composition-api';
|
|
1
|
+
import { computed, ComputedRef, Ref, ref, watch } from 'vue';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
3
|
+
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
9
4
|
|
|
10
5
|
import {
|
|
11
6
|
FilterTagType,
|
|
@@ -20,10 +15,12 @@ import { Category, Language } from '../../../../typings/model';
|
|
|
20
15
|
import { getNameWithDepth } from '../../../../utils/common';
|
|
21
16
|
|
|
22
17
|
interface Params {
|
|
23
|
-
|
|
24
|
-
categoryList: ComputedRef<Category[]>;
|
|
18
|
+
categoryList: Ref<Category[]>;
|
|
25
19
|
languageList: ComputedRef<Language[]>;
|
|
26
20
|
statusOptionList: ComputedRef<OptionType[]>;
|
|
21
|
+
|
|
22
|
+
t: TFunction;
|
|
23
|
+
route: RouteLocationNormalizedLoaded;
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
interface State {
|
|
@@ -36,6 +33,7 @@ interface State {
|
|
|
36
33
|
statusFilter: Ref<OptionType[]>;
|
|
37
34
|
filterParams: ComputedRef<Record<string, string | string[]>>;
|
|
38
35
|
tags: ComputedRef<FilterTagType[]>;
|
|
36
|
+
|
|
39
37
|
tagRemovalHandler(event: FilterTagType): void;
|
|
40
38
|
}
|
|
41
39
|
|
|
@@ -50,7 +48,8 @@ enum FilterTypes {
|
|
|
50
48
|
export const dateFormat = (date: string) => date.split('-').reverse().join('.');
|
|
51
49
|
|
|
52
50
|
export function useAdvancedSearch({
|
|
53
|
-
|
|
51
|
+
t,
|
|
52
|
+
route,
|
|
54
53
|
categoryList,
|
|
55
54
|
languageList,
|
|
56
55
|
statusOptionList,
|
|
@@ -66,9 +65,10 @@ export function useAdvancedSearch({
|
|
|
66
65
|
|
|
67
66
|
const initialCategoryFilter = computed<OptionType[]>(() => {
|
|
68
67
|
const queryValue = getFilterParamAsStringArray(
|
|
69
|
-
|
|
68
|
+
route.query,
|
|
70
69
|
FilterTypes.CATEGORY
|
|
71
70
|
);
|
|
71
|
+
|
|
72
72
|
return categoryOptionList.value.filter(({ value }) =>
|
|
73
73
|
queryValue.some((selected) => selected === value)
|
|
74
74
|
);
|
|
@@ -88,7 +88,7 @@ export function useAdvancedSearch({
|
|
|
88
88
|
|
|
89
89
|
const initialLanguageFilter = computed<OptionType[]>(() => {
|
|
90
90
|
const queryValue = getFilterParamAsStringArray(
|
|
91
|
-
|
|
91
|
+
route.query,
|
|
92
92
|
FilterTypes.LANGUAGE
|
|
93
93
|
);
|
|
94
94
|
return languageOptionList.value.filter(({ value }) =>
|
|
@@ -105,11 +105,7 @@ export function useAdvancedSearch({
|
|
|
105
105
|
/** From date **/
|
|
106
106
|
|
|
107
107
|
const initialFromDateFilter = computed<string>(
|
|
108
|
-
() =>
|
|
109
|
-
getFilterParamAsString(
|
|
110
|
-
context.root.$route.query,
|
|
111
|
-
FilterTypes.FROM_DATE
|
|
112
|
-
) ?? ''
|
|
108
|
+
() => getFilterParamAsString(route.query, FilterTypes.FROM_DATE) ?? ''
|
|
113
109
|
);
|
|
114
110
|
|
|
115
111
|
const fromDateFilter = ref<string>(initialFromDateFilter.value);
|
|
@@ -121,9 +117,7 @@ export function useAdvancedSearch({
|
|
|
121
117
|
/** To date **/
|
|
122
118
|
|
|
123
119
|
const initialToDateFilter = computed<string>(
|
|
124
|
-
() =>
|
|
125
|
-
getFilterParamAsString(context.root.$route.query, FilterTypes.TO_DATE) ??
|
|
126
|
-
''
|
|
120
|
+
() => getFilterParamAsString(route.query, FilterTypes.TO_DATE) ?? ''
|
|
127
121
|
);
|
|
128
122
|
|
|
129
123
|
const toDateFilter = ref<string>(initialToDateFilter.value);
|
|
@@ -148,20 +142,18 @@ export function useAdvancedSearch({
|
|
|
148
142
|
}
|
|
149
143
|
|
|
150
144
|
if (fromDateFilter.value && !toDateFilter.value) {
|
|
151
|
-
label = `${
|
|
152
|
-
fromDateFilter.value
|
|
153
|
-
)}`;
|
|
145
|
+
label = `${t('blog:from')} ${dateFormat(fromDateFilter.value)}`;
|
|
154
146
|
}
|
|
155
147
|
|
|
156
148
|
if (!fromDateFilter.value && toDateFilter.value) {
|
|
157
|
-
label = `${
|
|
149
|
+
label = `${t('blog:to')} ${dateFormat(toDateFilter.value)}`;
|
|
158
150
|
}
|
|
159
151
|
|
|
160
152
|
return {
|
|
161
153
|
value: '',
|
|
162
154
|
label,
|
|
163
155
|
name: FilterTypes.FROM_DATE,
|
|
164
|
-
title:
|
|
156
|
+
title: t('blog:dateOfPublication'),
|
|
165
157
|
};
|
|
166
158
|
});
|
|
167
159
|
|
|
@@ -169,7 +161,7 @@ export function useAdvancedSearch({
|
|
|
169
161
|
|
|
170
162
|
const initialStatusFilter = computed<OptionType[]>(() => {
|
|
171
163
|
const queryValue = getFilterParamAsStringArray(
|
|
172
|
-
|
|
164
|
+
route.query,
|
|
173
165
|
FilterTypes.STATUS
|
|
174
166
|
);
|
|
175
167
|
return statusOptionList.value.filter(({ value }) =>
|
|
@@ -235,20 +227,20 @@ export function useAdvancedSearch({
|
|
|
235
227
|
value,
|
|
236
228
|
label,
|
|
237
229
|
name: FilterTypes.CATEGORY,
|
|
238
|
-
title:
|
|
230
|
+
title: t('blog:category'),
|
|
239
231
|
})),
|
|
240
232
|
...languageFilter.value.map(({ value, label }) => ({
|
|
241
233
|
value,
|
|
242
234
|
label,
|
|
243
235
|
name: FilterTypes.LANGUAGE,
|
|
244
|
-
title:
|
|
236
|
+
title: t('blog:language'),
|
|
245
237
|
})),
|
|
246
238
|
date.value,
|
|
247
239
|
...statusFilter.value.map(({ value, label }) => ({
|
|
248
240
|
value,
|
|
249
241
|
label,
|
|
250
242
|
name: FilterTypes.STATUS,
|
|
251
|
-
title:
|
|
243
|
+
title: t('blog:status'),
|
|
252
244
|
})),
|
|
253
245
|
].filter(isNotNullish)
|
|
254
246
|
);
|
package/CHANGELOG.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# [0.0.2] (2020-06-06)
|
|
2
|
-
|
|
3
|
-
### Features
|
|
4
|
-
|
|
5
|
-
* **services:** Use VUE_APP_API_ORIGIN env variable as initial api origin value in ApiService
|
|
6
|
-
|
|
7
|
-
# [0.0.3] (2020-06-06)
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* **services:** Use api origin from ApiService to configure url for file upload
|
|
12
|
-
|
|
13
|
-
|
package/dist/constants/menu.d.ts
DELETED
package/dist/dev.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@tager/admin-ui/dist/admin-ui.css';
|