@tager/admin-blog 1.0.0 → 1.0.1
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/index.mjs +20 -70
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/views/Categories/CategoryForm/CategoryForm.vue +2 -6
- package/src/views/Posts/PostForm/PostForm.vue +2 -6
- package/dist/views/Posts/PostForm/components/TabList/TabList.types.d.ts +0 -5
- package/dist/views/Posts/PostForm/components/TabList/TabList.vue.d.ts +0 -23
- package/dist/views/Posts/PostForm/components/TabList/index.d.ts +0 -2
- 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
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i18n, request, useResource, createId, notEmpty, isNotNullish, useI18n, useResourceDelete, useResourceClone, useToast, navigateBack, convertRequestErrorToMap, urlTranslit, getWebsiteOrigin } from "@tager/admin-services";
|
|
2
|
-
import { onMounted, watch, computed, ref, defineComponent, resolveComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, createCommentVNode, toDisplayString, createElementBlock, createTextVNode, Fragment, renderList,
|
|
2
|
+
import { onMounted, watch, computed, ref, defineComponent, resolveComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, createCommentVNode, toDisplayString, createElementBlock, createTextVNode, withModifiers, Fragment, renderList, createSlots } from "vue";
|
|
3
3
|
import isEqual from "lodash.isequal";
|
|
4
4
|
import pick from "lodash.pick";
|
|
5
5
|
import { useRoute, useRouter } from "vue-router";
|
|
6
|
-
import { getFilterParamAsStringArray, getFilterParamAsString, getFilterParams, DeleteIcon, ContentCopyIcon, EditIcon, BaseButton, FormField, FormFieldMultiSelect, AdvancedSearch, DataTable, useDataTable, formatDateTime, SeoFieldGroup, FormFieldFileInput, FormFieldRichTextInput, FormFieldCheckbox, FormFieldUrlAliasInput, FormFieldSelect, ShortCodeConstructor, FormFooter, createTabErrorFinder, SouthIcon, NorthIcon, CountButton } from "@tager/admin-ui";
|
|
6
|
+
import { getFilterParamAsStringArray, getFilterParamAsString, getFilterParams, DeleteIcon, ContentCopyIcon, EditIcon, BaseButton, FormField, FormFieldMultiSelect, AdvancedSearch, DataTable, useDataTable, formatDateTime, SeoFieldGroup, FormFieldFileInput, FormFieldRichTextInput, FormFieldCheckbox, FormFieldUrlAliasInput, FormFieldSelect, TabList, ShortCodeConstructor, FormFooter, createTabErrorFinder, SouthIcon, NorthIcon, CountButton } from "@tager/admin-ui";
|
|
7
7
|
import { Page } from "@tager/admin-layout";
|
|
8
8
|
import { universalFieldUtils, DynamicField } from "@tager/admin-dynamic-field";
|
|
9
9
|
import { compile } from "path-to-regexp";
|
|
@@ -711,7 +711,7 @@ var _export_sfc = (sfc, props) => {
|
|
|
711
711
|
}
|
|
712
712
|
return target;
|
|
713
713
|
};
|
|
714
|
-
const _sfc_main$
|
|
714
|
+
const _sfc_main$3 = defineComponent({
|
|
715
715
|
name: "PostList",
|
|
716
716
|
components: {
|
|
717
717
|
DeleteIcon,
|
|
@@ -872,12 +872,12 @@ const _sfc_main$4 = defineComponent({
|
|
|
872
872
|
};
|
|
873
873
|
}
|
|
874
874
|
});
|
|
875
|
-
const _hoisted_1$
|
|
876
|
-
const _hoisted_2$
|
|
877
|
-
const _hoisted_3$
|
|
875
|
+
const _hoisted_1$2 = { class: "filters" };
|
|
876
|
+
const _hoisted_2$1 = { class: "filters" };
|
|
877
|
+
const _hoisted_3$1 = { class: "status" };
|
|
878
878
|
const _hoisted_4$1 = { key: 0 };
|
|
879
879
|
const _hoisted_5 = { key: 1 };
|
|
880
|
-
function _sfc_render$
|
|
880
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
881
881
|
const _component_FormFieldMultiSelect = resolveComponent("FormFieldMultiSelect");
|
|
882
882
|
const _component_FormField = resolveComponent("FormField");
|
|
883
883
|
const _component_AdvancedSearch = resolveComponent("AdvancedSearch");
|
|
@@ -918,7 +918,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
918
918
|
"onClick:tag": _ctx.tagRemovalHandler
|
|
919
919
|
}, {
|
|
920
920
|
default: withCtx(() => [
|
|
921
|
-
createElementVNode("div", _hoisted_1$
|
|
921
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
922
922
|
createVNode(_component_FormFieldMultiSelect, {
|
|
923
923
|
"selected-options": _ctx.categoryFilter,
|
|
924
924
|
"onUpdate:selected-options": _cache[0] || (_cache[0] = ($event) => _ctx.categoryFilter = $event),
|
|
@@ -948,7 +948,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
948
948
|
class: "filter"
|
|
949
949
|
}, null, 8, ["selected-options", "options", "label"])
|
|
950
950
|
]),
|
|
951
|
-
createElementVNode("div", _hoisted_2$
|
|
951
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
952
952
|
createVNode(_component_FormField, {
|
|
953
953
|
value: _ctx.fromDateFilter,
|
|
954
954
|
"onUpdate:value": _cache[3] || (_cache[3] = ($event) => _ctx.fromDateFilter = $event),
|
|
@@ -971,7 +971,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
971
971
|
}, 8, ["tags", "onClick:tag"])
|
|
972
972
|
]),
|
|
973
973
|
"cell(status)": withCtx(({ row }) => [
|
|
974
|
-
createElementVNode("div", _hoisted_3$
|
|
974
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
975
975
|
createElementVNode("span", null, toDisplayString(_ctx.getStatuses(_ctx.$i18n.t)[row.status]), 1),
|
|
976
976
|
row.status === "PUBLISHED" && row.archiveAt ? (openBlock(), createElementBlock("span", _hoisted_4$1, [
|
|
977
977
|
createTextVNode(toDisplayString(_ctx.$i18n.t("blog:archiveAtLabel")) + ": ", 1),
|
|
@@ -1024,57 +1024,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1024
1024
|
_: 1
|
|
1025
1025
|
}, 8, ["title", "header-buttons"]);
|
|
1026
1026
|
}
|
|
1027
|
-
var BlogPostList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1028
|
-
var TabList_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1029
|
-
const _sfc_main$3 = defineComponent({
|
|
1030
|
-
name: "TabList",
|
|
1031
|
-
props: {
|
|
1032
|
-
tabList: {
|
|
1033
|
-
type: Array,
|
|
1034
|
-
required: true
|
|
1035
|
-
},
|
|
1036
|
-
selectedTabId: {
|
|
1037
|
-
type: String,
|
|
1038
|
-
required: true
|
|
1039
|
-
}
|
|
1040
|
-
},
|
|
1041
|
-
setup(props, context) {
|
|
1042
|
-
function handleTabClick(tabId) {
|
|
1043
|
-
if (props.selectedTabId === tabId)
|
|
1044
|
-
return;
|
|
1045
|
-
context.emit("tab:update", { tabId });
|
|
1046
|
-
}
|
|
1047
|
-
return {
|
|
1048
|
-
handleTabClick
|
|
1049
|
-
};
|
|
1050
|
-
}
|
|
1051
|
-
});
|
|
1052
|
-
const _hoisted_1$2 = { class: "tab-list" };
|
|
1053
|
-
const _hoisted_2$1 = ["onClick"];
|
|
1054
|
-
const _hoisted_3$1 = { key: 0 };
|
|
1055
|
-
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1056
|
-
return openBlock(), createElementBlock("ul", _hoisted_1$2, [
|
|
1057
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tabList, (tab) => {
|
|
1058
|
-
return openBlock(), createElementBlock("li", {
|
|
1059
|
-
key: tab.id,
|
|
1060
|
-
class: normalizeClass([
|
|
1061
|
-
"tab",
|
|
1062
|
-
{ active: _ctx.selectedTabId === tab.id, invalid: tab.hasErrors }
|
|
1063
|
-
])
|
|
1064
|
-
}, [
|
|
1065
|
-
createElementVNode("button", {
|
|
1066
|
-
class: "tab-button",
|
|
1067
|
-
type: "button",
|
|
1068
|
-
onClick: ($event) => _ctx.handleTabClick(tab.id)
|
|
1069
|
-
}, [
|
|
1070
|
-
createTextVNode(toDisplayString(tab.label) + " ", 1),
|
|
1071
|
-
tab.hasErrors ? (openBlock(), createElementBlock("span", _hoisted_3$1, "*")) : createCommentVNode("", true)
|
|
1072
|
-
], 8, _hoisted_2$1)
|
|
1073
|
-
], 2);
|
|
1074
|
-
}), 128))
|
|
1075
|
-
]);
|
|
1076
|
-
}
|
|
1077
|
-
var TabList = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-6a295e80"]]);
|
|
1027
|
+
var BlogPostList = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-2ee9b750"]]);
|
|
1078
1028
|
var PostForm_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1079
1029
|
const _sfc_main$2 = defineComponent({
|
|
1080
1030
|
name: "BlogPostForm",
|
|
@@ -1422,10 +1372,10 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1422
1372
|
onSubmit: _cache[16] || (_cache[16] = withModifiers((...args) => _ctx.submitForm && _ctx.submitForm(...args), ["prevent"]))
|
|
1423
1373
|
}, [
|
|
1424
1374
|
createVNode(_component_TabList, {
|
|
1425
|
-
"tab-
|
|
1426
|
-
"
|
|
1427
|
-
"
|
|
1428
|
-
}, null, 8, ["tab-
|
|
1375
|
+
"tab-id": _ctx.selectedTabId,
|
|
1376
|
+
"onUpdate:tab-id": _cache[0] || (_cache[0] = ($event) => _ctx.selectedTabId = $event),
|
|
1377
|
+
"tab-list": _ctx.tabList
|
|
1378
|
+
}, null, 8, ["tab-id", "tab-list"]),
|
|
1429
1379
|
_ctx.selectedTabId === "common" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1430
1380
|
_ctx.isCreation && _ctx.isLangSpecific ? (openBlock(), createBlock(_component_FormFieldSelect, {
|
|
1431
1381
|
key: 0,
|
|
@@ -1605,7 +1555,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1605
1555
|
_: 1
|
|
1606
1556
|
}, 8, ["title", "is-content-loading", "header-buttons", "footer"]);
|
|
1607
1557
|
}
|
|
1608
|
-
var BlogPostForm = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-
|
|
1558
|
+
var BlogPostForm = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-62596ad5"]]);
|
|
1609
1559
|
function convertCategoryList(categoryList, languages) {
|
|
1610
1560
|
return categoryList.map((category) => {
|
|
1611
1561
|
if (languages.length > 0) {
|
|
@@ -2236,10 +2186,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2236
2186
|
}, null, 8, ["value", "label", "url-template", "error", "onChange"])
|
|
2237
2187
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2238
2188
|
createVNode(_component_TabList, {
|
|
2239
|
-
"tab-
|
|
2240
|
-
"
|
|
2241
|
-
"
|
|
2242
|
-
}, null, 8, ["tab-
|
|
2189
|
+
"tab-id": _ctx.selectedTabId,
|
|
2190
|
+
"onUpdate:tab-id": _cache[4] || (_cache[4] = ($event) => _ctx.selectedTabId = $event),
|
|
2191
|
+
"tab-list": _ctx.tabList
|
|
2192
|
+
}, null, 8, ["tab-id", "tab-list"]),
|
|
2243
2193
|
_ctx.selectedTabId === "common" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2244
2194
|
_ctx.isLangSpecific ? (openBlock(), createBlock(_component_FormFieldSelect, {
|
|
2245
2195
|
key: 0,
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.filters[data-v-2ee9b750]{margin-bottom:1rem;width:100%;display:grid;gap:1rem;grid-template-columns:1fr 1fr}.filters[data-v-2ee9b750]:not(:first-child){margin-top:1rem}.status span[data-v-2ee9b750]:first-child{display:block}.status span[data-v-2ee9b750]:nth-child(2){display:block;margin-top:5px;font-size:.8rem}.status span:nth-child(2) i[data-v-2ee9b750]{display:block}.
|
|
1
|
+
.filters[data-v-2ee9b750]{margin-bottom:1rem;width:100%;display:grid;gap:1rem;grid-template-columns:1fr 1fr}.filters[data-v-2ee9b750]:not(:first-child){margin-top:1rem}.status span[data-v-2ee9b750]:first-child{display:block}.status span[data-v-2ee9b750]:nth-child(2){display:block;margin-top:5px;font-size:.8rem}.status span:nth-child(2) i[data-v-2ee9b750]{display:block}.status[data-v-62596ad5]{display:flex;align-items:flex-end}.status-value[data-v-62596ad5]{flex-basis:50%}.status-checkbox[data-v-62596ad5]{margin-left:20px;padding-bottom:8px}.status-date[data-v-62596ad5]{margin-left:20px;flex:1 1 1px}
|
package/package.json
CHANGED
|
@@ -48,11 +48,7 @@
|
|
|
48
48
|
</template>
|
|
49
49
|
|
|
50
50
|
<template v-else>
|
|
51
|
-
<TabList
|
|
52
|
-
:tab-list="tabList"
|
|
53
|
-
:selected-tab-id="selectedTabId"
|
|
54
|
-
@tab:update="selectedTabId = $event.tabId"
|
|
55
|
-
/>
|
|
51
|
+
<TabList v-model:tab-id="selectedTabId" :tab-list="tabList" />
|
|
56
52
|
|
|
57
53
|
<template v-if="selectedTabId === 'common'">
|
|
58
54
|
<FormFieldSelect
|
|
@@ -152,6 +148,7 @@ import {
|
|
|
152
148
|
FormFieldUrlAliasInput,
|
|
153
149
|
FormFieldCheckbox,
|
|
154
150
|
SeoFieldGroup,
|
|
151
|
+
TabList,
|
|
155
152
|
} from '@tager/admin-ui';
|
|
156
153
|
import { Page } from '@tager/admin-layout';
|
|
157
154
|
|
|
@@ -166,7 +163,6 @@ import {
|
|
|
166
163
|
} from '../../../utils/paths';
|
|
167
164
|
import { CategoryFormValues, Language } from '../../../typings/model';
|
|
168
165
|
import { createCategory, updateCategory } from '../../../services/requests';
|
|
169
|
-
import TabList from '../../Posts/PostForm/components/TabList/TabList.vue';
|
|
170
166
|
|
|
171
167
|
import {
|
|
172
168
|
convertCategoryFormValuesToPayload,
|
|
@@ -13,11 +13,7 @@
|
|
|
13
13
|
>
|
|
14
14
|
<template #content>
|
|
15
15
|
<form novalidate @submit.prevent="submitForm">
|
|
16
|
-
<TabList
|
|
17
|
-
:tab-list="tabList"
|
|
18
|
-
:selected-tab-id="selectedTabId"
|
|
19
|
-
@tab:update="selectedTabId = $event.tabId"
|
|
20
|
-
/>
|
|
16
|
+
<TabList v-model:tab-id="selectedTabId" :tab-list="tabList" />
|
|
21
17
|
|
|
22
18
|
<template v-if="selectedTabId === 'common'">
|
|
23
19
|
<FormFieldSelect
|
|
@@ -258,6 +254,7 @@ import {
|
|
|
258
254
|
FormFieldFileInput,
|
|
259
255
|
FormFieldMultiSelect,
|
|
260
256
|
SeoFieldGroup,
|
|
257
|
+
TabList,
|
|
261
258
|
} from '@tager/admin-ui';
|
|
262
259
|
import { DynamicField } from '@tager/admin-dynamic-field';
|
|
263
260
|
import { Page } from '@tager/admin-layout';
|
|
@@ -283,7 +280,6 @@ import {
|
|
|
283
280
|
FormValues,
|
|
284
281
|
getStatusOptions,
|
|
285
282
|
} from './PostForm.helpers';
|
|
286
|
-
import TabList from './components/TabList/TabList.vue';
|
|
287
283
|
|
|
288
284
|
export default defineComponent({
|
|
289
285
|
name: 'BlogPostForm',
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TabType } from './TabList.types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
3
|
-
tabList: {
|
|
4
|
-
type: () => TabType[];
|
|
5
|
-
required: true;
|
|
6
|
-
};
|
|
7
|
-
selectedTabId: {
|
|
8
|
-
type: StringConstructor;
|
|
9
|
-
required: true;
|
|
10
|
-
};
|
|
11
|
-
}, {
|
|
12
|
-
handleTabClick: (tabId: TabType['id']) => void;
|
|
13
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
|
-
tabList: {
|
|
15
|
-
type: () => TabType[];
|
|
16
|
-
required: true;
|
|
17
|
-
};
|
|
18
|
-
selectedTabId: {
|
|
19
|
-
type: StringConstructor;
|
|
20
|
-
required: true;
|
|
21
|
-
};
|
|
22
|
-
}>>, {}>;
|
|
23
|
-
export default _default;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ul class="tab-list">
|
|
3
|
-
<li
|
|
4
|
-
v-for="tab of tabList"
|
|
5
|
-
:key="tab.id"
|
|
6
|
-
:class="[
|
|
7
|
-
'tab',
|
|
8
|
-
{ active: selectedTabId === tab.id, invalid: tab.hasErrors },
|
|
9
|
-
]"
|
|
10
|
-
>
|
|
11
|
-
<button class="tab-button" type="button" @click="handleTabClick(tab.id)">
|
|
12
|
-
{{ tab.label }} <span v-if="tab.hasErrors">*</span>
|
|
13
|
-
</button>
|
|
14
|
-
</li>
|
|
15
|
-
</ul>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script lang="ts">
|
|
19
|
-
import { defineComponent } from 'vue';
|
|
20
|
-
|
|
21
|
-
import { TabType } from './TabList.types';
|
|
22
|
-
|
|
23
|
-
export default defineComponent({
|
|
24
|
-
name: 'TabList',
|
|
25
|
-
props: {
|
|
26
|
-
tabList: {
|
|
27
|
-
type: Array as () => TabType[],
|
|
28
|
-
required: true,
|
|
29
|
-
},
|
|
30
|
-
selectedTabId: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: true,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
setup(props, context) {
|
|
36
|
-
function handleTabClick(tabId: TabType['id']) {
|
|
37
|
-
if (props.selectedTabId === tabId) return;
|
|
38
|
-
|
|
39
|
-
context.emit('tab:update', { tabId });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
handleTabClick,
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<style scoped lang="scss">
|
|
50
|
-
.tab-list {
|
|
51
|
-
display: flex;
|
|
52
|
-
border-bottom: 1px solid #eee;
|
|
53
|
-
margin: -1rem -1rem 1.5rem -1rem;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.tab {
|
|
57
|
-
display: block;
|
|
58
|
-
border-top: 3px solid transparent;
|
|
59
|
-
|
|
60
|
-
margin-bottom: -1px;
|
|
61
|
-
|
|
62
|
-
&:not(.active):not(.invalid):hover {
|
|
63
|
-
color: var(--secondary);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
&.active {
|
|
67
|
-
background-color: #fff;
|
|
68
|
-
border-top-color: var(--primary);
|
|
69
|
-
|
|
70
|
-
&:not(:first-child) .tab-button {
|
|
71
|
-
border-left-color: #eee;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.tab-button {
|
|
75
|
-
cursor: default;
|
|
76
|
-
border-right-color: #eee;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&.invalid {
|
|
81
|
-
color: red;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.tab-button {
|
|
86
|
-
padding: 0.7rem 2rem;
|
|
87
|
-
border-right: 1px solid transparent;
|
|
88
|
-
border-left: 1px solid transparent;
|
|
89
|
-
color: inherit;
|
|
90
|
-
font-weight: inherit;
|
|
91
|
-
}
|
|
92
|
-
</style>
|