@ozdao/prometheus-framework 0.0.85 → 0.0.87
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-628f013e.mjs +138 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs +1944 -0
- package/dist/ButtonFollow-728aab73.mjs +130 -0
- package/dist/CardHeader-ce5a1a75.mjs +96 -0
- package/dist/CardOrganization-58b54995.js +1 -0
- package/dist/CardOrganization-91e79698.mjs +320 -0
- package/dist/CardOrganization-ee5c34ab.js +1 -0
- package/dist/CardOrganization-f70bd169.mjs +202 -0
- package/dist/Comments-63f154a6.js +9 -0
- package/dist/Comments-c092550f.mjs +76 -0
- package/dist/Comments-c5afa4d6.mjs +459 -0
- package/dist/EditProductImages-61ff4321.mjs +236 -0
- package/dist/Feed-8fd41524.js +1 -0
- package/dist/Feed-926cf4f3.mjs +355 -0
- package/dist/Feed-a31c43c2.mjs +423 -0
- package/dist/Feed-ecf37814.mjs +367 -0
- package/dist/IconEdit-736c89be.js +1 -0
- package/dist/IconEdit-e9fd4c6c.mjs +21 -0
- package/dist/PlaceholderUserpic-995da0fc.mjs +28 -0
- package/dist/Popup-0c791801.mjs +76 -0
- package/dist/Popup-105ef2c3.js +1 -0
- package/dist/Popup-82fb2c8a.mjs +76 -0
- package/dist/Product-2f3d592f.mjs +837 -0
- package/dist/Product-2fbf9d99.js +7 -0
- package/dist/Product-6c37ef35.js +7 -0
- package/dist/Product-7087b358.mjs +837 -0
- package/dist/ProductEdit-20709821.mjs +349 -0
- package/dist/ProductEdit-a81d13b9.js +1 -0
- package/dist/ProductEdit-c5067942.mjs +113 -0
- package/dist/ProfileBlogposts-79d5c858.mjs +63 -0
- package/dist/ProfileBlogposts-eca9916c.js +1 -0
- package/dist/ProfileBlogposts-fb014bc6.mjs +63 -0
- package/dist/ProfileComments-48f3d4bc.mjs +43 -0
- package/dist/ProfileComments-58094a50.mjs +43 -0
- package/dist/ProfileComments-b919f021.js +1 -0
- package/dist/ProfileEvents-05485e20.js +1 -0
- package/dist/ProfileEvents-20695376.mjs +55 -0
- package/dist/ProfileEvents-5d206e3d.mjs +55 -0
- package/dist/ProfileLikes-2f3a4488.js +1 -0
- package/dist/ProfileLikes-503712ec.mjs +43 -0
- package/dist/ProfileLikes-b5ac7f48.mjs +43 -0
- package/dist/ProfileOrganizations-0b76e38f.js +1 -0
- package/dist/ProfileOrganizations-32ab1e30.mjs +211 -0
- package/dist/ProfileOrganizations-3f305f4e.mjs +210 -0
- package/dist/ProfileOrganizations-50fce34e.js +1 -0
- package/dist/Publics-3f277c17.js +1 -0
- package/dist/Publics-49dbeafc.js +1 -0
- package/dist/Publics-9ebffff1.mjs +122 -0
- package/dist/Publics-b0fad2b0.mjs +1926 -0
- package/dist/Tab-58cd105f.mjs +46 -0
- package/dist/Tab-6f0a4909.js +1 -0
- package/dist/UploadImage-441e8526.js +1 -0
- package/dist/UploadImage-d1dbc280.mjs +99 -0
- package/dist/UploadImage-ff8f9a0c.mjs +83 -0
- package/dist/auth-35ef1791.mjs +1502 -0
- package/dist/auth.client.cjs +2 -2
- package/dist/auth.client.js +61 -41
- package/dist/auth.validation-29113f37.mjs +20 -0
- package/dist/categories-d669f3af.mjs +225 -0
- package/dist/community.client.cjs +1 -9
- package/dist/community.client.js +369 -741
- package/dist/community.server.js +16 -4
- package/dist/community.server.mjs +16 -4
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +433 -331
- package/dist/events.server.js +19 -2
- package/dist/events.server.mjs +19 -2
- package/dist/inputs.validation-24ae76b9.js +1 -0
- package/dist/modules/constructor/components/elements/Bullets.vue.d.ts +15 -0
- package/dist/modules/constructor/components/elements/Caption.vue.d.ts +15 -0
- package/dist/modules/constructor/components/elements/H2.vue.d.ts +16 -0
- package/dist/modules/constructor/components/elements/Image.vue.d.ts +8 -0
- package/dist/modules/constructor/components/elements/ImageUpload.vue.d.ts +9 -0
- package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +12 -0
- package/dist/modules/constructor/components/sections/Constructor.vue.d.ts +7 -0
- package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -0
- package/dist/modules/icons/entities/IconCommunity.vue.d.ts +2 -0
- package/dist/organizations-1b4c84ee.mjs +121 -0
- package/dist/organizations-af43bda4.js +1 -0
- package/dist/organizations.client-253c8068.mjs +3179 -0
- package/dist/organizations.client-c60d7659.js +3 -0
- package/dist/organizations.client.cjs +1 -3
- package/dist/organizations.client.js +50 -3026
- package/dist/organizations.server.js +1 -1
- package/dist/organizations.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +245 -208
- package/package.json +1 -1
- package/src/modules/auth/router/auth.js +28 -7
- package/src/modules/community/community.client.js +1 -12
- package/src/modules/community/components/pages/BlogPost.vue +1 -1
- package/src/modules/community/components/pages/CreateBlogPost.vue +8 -151
- package/src/modules/community/middlewares/server/verifyBlogpost.js +24 -11
- package/src/modules/{community → constructor}/components/elements/Textarea.vue +3 -11
- package/src/modules/constructor/components/sections/Constructor.vue +167 -0
- package/src/modules/events/components/blocks/CardEvent.vue +14 -6
- package/src/modules/events/components/pages/EditEvent.vue +228 -133
- package/src/modules/events/components/sections/Feed.vue +7 -1
- package/src/modules/events/controllers/events.controller.js +9 -0
- package/src/modules/events/controllers/tickets.controller.js +2 -1
- package/src/modules/events/models/event.model.js +10 -0
- package/src/modules/events/store/events.js +15 -19
- package/src/modules/icons/entities/IconCommunity.vue +8 -0
- package/src/modules/organizations/components/blocks/CardOrganization.vue +3 -5
- package/src/modules/organizations/components/sections/Publics.vue +3 -3
- package/src/modules/organizations/controllers/organizations.controller.js +1 -1
- package/src/modules/organizations/organizations.client.js +0 -2
- package/src/modules/users/components/pages/Profile.vue +15 -4
- package/src/modules/users/components/pages/ProfileEvents.vue +3 -3
- package/src/modules/organizations/components/blocks/CardOrganizationSocial.vue +0 -46
- /package/src/modules/{community → constructor}/components/elements/Bullets.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/Caption.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/H2.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/Image.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/ImageUpload.vue +0 -0
@@ -0,0 +1,423 @@
|
|
1
|
+
import { reactive as L, watch as I, openBlock as o, createElementBlock as l, toDisplayString as u, createCommentVNode as i, createElementVNode as b, ref as p, createTextVNode as z, computed as B, createVNode as _, normalizeClass as O, unref as d, renderSlot as A, onMounted as T, Transition as x, withCtx as $, createBlock as j, Fragment as U, renderList as E } from "vue";
|
2
|
+
import { _ as M } from "./EmptyState-34d85f10.mjs";
|
3
|
+
import { a as N, _ as F } from "./auth-35ef1791.mjs";
|
4
|
+
import { _ as V } from "./CardHeader-ce5a1a75.mjs";
|
5
|
+
import { useRouter as q } from "vue-router";
|
6
|
+
import { s as g } from "./globals-96ba60e4.mjs";
|
7
|
+
const k = N.create({ baseURL: process.env.API_URL, withCredentials: !0 });
|
8
|
+
k.defaults.withCredentials = !0;
|
9
|
+
const f = L({
|
10
|
+
all: [],
|
11
|
+
filter: {
|
12
|
+
// query
|
13
|
+
tags: [],
|
14
|
+
period: ""
|
15
|
+
// pagination
|
16
|
+
},
|
17
|
+
pagination: {
|
18
|
+
page: 1,
|
19
|
+
perPage: 18
|
20
|
+
},
|
21
|
+
// Sort
|
22
|
+
sort: {
|
23
|
+
current: "popularity",
|
24
|
+
ascending: !1
|
25
|
+
},
|
26
|
+
current: {
|
27
|
+
_id: "",
|
28
|
+
url: "",
|
29
|
+
status: "",
|
30
|
+
name: "",
|
31
|
+
tags: [],
|
32
|
+
owner: {},
|
33
|
+
date: "",
|
34
|
+
views: 0,
|
35
|
+
content: []
|
36
|
+
}
|
37
|
+
});
|
38
|
+
async function S(e = {}) {
|
39
|
+
e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.period && (e.params.period = e.period), e.url && (e.params = { url: e.url }), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.owner && (e.params.owner = e.owner), e.creator && (e.params.creator = e.creator), e.status && (e.params.status = e.status), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
|
40
|
+
try {
|
41
|
+
console.log("Request params:" + e.params);
|
42
|
+
const t = await k.get("/api/blog/read", { params: e.params });
|
43
|
+
return e.url ? w(t.data, "current") : w(t.data, "all"), Promise.resolve(t.data);
|
44
|
+
} catch (t) {
|
45
|
+
return g(t), Promise.reject(t);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
async function D(e) {
|
49
|
+
return k.post("/api/blog/create", e).then(
|
50
|
+
(t) => (w(t.data, "current"), Promise.resolve(t.data)),
|
51
|
+
(t) => (g(t), Promise.reject(t))
|
52
|
+
);
|
53
|
+
}
|
54
|
+
async function G(e) {
|
55
|
+
return k.post("/api/blog/update", e).then(
|
56
|
+
(t) => (w(t.data, "current"), Promise.resolve(t.data)),
|
57
|
+
(t) => (g(t), Promise.reject(t))
|
58
|
+
);
|
59
|
+
}
|
60
|
+
async function H(e) {
|
61
|
+
return await k.delete(`/api/blog/delete/${e}`).then(
|
62
|
+
(t) => {
|
63
|
+
const a = f.all.findIndex((r) => r._id === e);
|
64
|
+
return a !== -1 && f.all.splice(a, 1), Promise.resolve(t.data);
|
65
|
+
},
|
66
|
+
(t) => (g(t), Promise.reject(t))
|
67
|
+
);
|
68
|
+
}
|
69
|
+
function w(e, t) {
|
70
|
+
f[t] = e;
|
71
|
+
}
|
72
|
+
function J() {
|
73
|
+
f.current = {
|
74
|
+
_id: "",
|
75
|
+
url: "",
|
76
|
+
status: "",
|
77
|
+
name: "",
|
78
|
+
tags: [],
|
79
|
+
author: "",
|
80
|
+
owner: "",
|
81
|
+
date: "",
|
82
|
+
views: 0,
|
83
|
+
content: []
|
84
|
+
};
|
85
|
+
}
|
86
|
+
function K(e) {
|
87
|
+
const t = {
|
88
|
+
order: f.project.content.length + 1,
|
89
|
+
type: e.type,
|
90
|
+
data: e.data,
|
91
|
+
class: e.class,
|
92
|
+
content: e.content
|
93
|
+
};
|
94
|
+
f.project.content.push(t);
|
95
|
+
}
|
96
|
+
I(f, (e, t) => {
|
97
|
+
});
|
98
|
+
const xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
99
|
+
__proto__: null,
|
100
|
+
blockAdd: K,
|
101
|
+
clean: J,
|
102
|
+
create: D,
|
103
|
+
read: S,
|
104
|
+
remove: H,
|
105
|
+
set: w,
|
106
|
+
state: f,
|
107
|
+
update: G
|
108
|
+
}, Symbol.toStringTag, { value: "Module" })), Q = {
|
109
|
+
props: {
|
110
|
+
progress: {
|
111
|
+
type: Number,
|
112
|
+
default: null
|
113
|
+
},
|
114
|
+
status: {
|
115
|
+
type: String,
|
116
|
+
default: null
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}, W = { class: "circular-loader" }, X = /* @__PURE__ */ b("svg", { viewBox: "25 25 50 50" }, [
|
120
|
+
/* @__PURE__ */ b("circle", {
|
121
|
+
cx: "50",
|
122
|
+
cy: "50",
|
123
|
+
r: "20",
|
124
|
+
fill: "none",
|
125
|
+
"stroke-width": "4",
|
126
|
+
"stroke-miterlimit": "10"
|
127
|
+
})
|
128
|
+
], -1), Y = {
|
129
|
+
key: 0,
|
130
|
+
class: "progress-text"
|
131
|
+
}, Z = {
|
132
|
+
key: 1,
|
133
|
+
class: "uppercase t-semi w-m-10r status-text"
|
134
|
+
};
|
135
|
+
function ee(e, t, a, r, s, c) {
|
136
|
+
return o(), l("div", W, [
|
137
|
+
X,
|
138
|
+
a.progress ? (o(), l("div", Y, u(a.progress), 1)) : i("", !0),
|
139
|
+
a.status ? (o(), l("div", Z, u(a.status), 1)) : i("", !0)
|
140
|
+
]);
|
141
|
+
}
|
142
|
+
const te = /* @__PURE__ */ F(Q, [["render", ee]]), P = N.create({
|
143
|
+
baseURL: process.env.API_URL,
|
144
|
+
withCredentials: !0
|
145
|
+
}), y = L({
|
146
|
+
reactions: [],
|
147
|
+
error: null
|
148
|
+
}), C = {
|
149
|
+
async read({ user: e, type: t, target: a, role: r }) {
|
150
|
+
try {
|
151
|
+
const s = await P.get("/api/reactions", { params: { user: e, type: t, target: a, role: r } });
|
152
|
+
return y.error = null, y.reactions = s.data, Promise.resolve(s.data);
|
153
|
+
} catch (s) {
|
154
|
+
return g(s), Promise.reject(s);
|
155
|
+
}
|
156
|
+
},
|
157
|
+
async create(e) {
|
158
|
+
try {
|
159
|
+
const t = await P.post("/api/reactions/create", e);
|
160
|
+
return y.error = null, Promise.resolve(t.data);
|
161
|
+
} catch (t) {
|
162
|
+
return console.log(t), g(t), Promise.reject(t);
|
163
|
+
}
|
164
|
+
},
|
165
|
+
async update(e) {
|
166
|
+
try {
|
167
|
+
const t = await P.post("/api/reactions/update", e);
|
168
|
+
return y.error = null, Promise.resolve(t.data);
|
169
|
+
} catch (t) {
|
170
|
+
return g(t), Promise.reject(t);
|
171
|
+
}
|
172
|
+
},
|
173
|
+
async delete(e) {
|
174
|
+
try {
|
175
|
+
const t = await P.post("/api/reactions/delete", e);
|
176
|
+
return y.error = null, Promise.resolve(t.data);
|
177
|
+
} catch (t) {
|
178
|
+
return g(t), Promise.reject(t);
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}, re = {
|
182
|
+
handleReactionUpdate(e, t, a) {
|
183
|
+
let r;
|
184
|
+
if (Array.isArray(e) ? r = e.find((s) => s._id === t.target) : typeof e == "object" && e._id === t.target && (r = e), r)
|
185
|
+
if (r.hasReaction = a, a)
|
186
|
+
r.reactions.push(t), r.numberOfReactions += 1;
|
187
|
+
else {
|
188
|
+
const s = r.reactions.findIndex((c) => c._id === t._id);
|
189
|
+
s !== -1 && (r.reactions.splice(s, 1), r.numberOfReactions -= 1);
|
190
|
+
}
|
191
|
+
}
|
192
|
+
};
|
193
|
+
I(y, (e) => {
|
194
|
+
});
|
195
|
+
const $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
196
|
+
__proto__: null,
|
197
|
+
actions: C,
|
198
|
+
mutations: re,
|
199
|
+
state: y
|
200
|
+
}, Symbol.toStringTag, { value: "Module" })), ae = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, se = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), oe = { class: "cursor-pointer" }, ne = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), le = {
|
201
|
+
__name: "FooterBlogpost",
|
202
|
+
props: ["blogpost", "owner", "user"],
|
203
|
+
setup(e) {
|
204
|
+
const t = e, a = p(t.blogpost.numberOfReactions), r = p(t.blogpost.isReacted), s = p(t.blogpost.reactionId);
|
205
|
+
async function c(v) {
|
206
|
+
if (!t.user) {
|
207
|
+
alert("Please login to add a reaction");
|
208
|
+
return;
|
209
|
+
}
|
210
|
+
try {
|
211
|
+
const n = {
|
212
|
+
target: t.blogpost._id,
|
213
|
+
type: "blogpost",
|
214
|
+
user: t.user,
|
215
|
+
class: "like"
|
216
|
+
}, h = await C.create(n);
|
217
|
+
h.reaction.class === "like" && (a.value += 1, r.value = !0, s.value = h.reaction._id);
|
218
|
+
} catch (n) {
|
219
|
+
console.error(n), alert("Error adding reaction. Please try again later.");
|
220
|
+
}
|
221
|
+
}
|
222
|
+
async function m(v) {
|
223
|
+
if (!t.user) {
|
224
|
+
alert("Please login to add a reaction");
|
225
|
+
return;
|
226
|
+
}
|
227
|
+
try {
|
228
|
+
const n = { _id: s.value };
|
229
|
+
await C.delete(n), a.value -= 1, r.value = !1, s.value = null;
|
230
|
+
} catch {
|
231
|
+
alert("Error adding reaction. Please try again later.");
|
232
|
+
}
|
233
|
+
}
|
234
|
+
return (v, n) => (o(), l("footer", ae, [
|
235
|
+
z(" 👁️ " + u(e.blogpost.views) + " ", 1),
|
236
|
+
se,
|
237
|
+
b("div", oe, [
|
238
|
+
r.value ? i("", !0) : (o(), l("div", {
|
239
|
+
key: 0,
|
240
|
+
class: "cursor-pointer",
|
241
|
+
onClick: n[0] || (n[0] = (h) => c())
|
242
|
+
}, " 👍 " + u(a.value), 1)),
|
243
|
+
r.value ? (o(), l("div", {
|
244
|
+
key: 1,
|
245
|
+
class: "cursor-pointer",
|
246
|
+
onClick: n[1] || (n[1] = (h) => m())
|
247
|
+
}, " 👍 " + u(a.value), 1)) : i("", !0)
|
248
|
+
]),
|
249
|
+
ne,
|
250
|
+
z(" 💬 " + u(e.blogpost.numberOfComments), 1)
|
251
|
+
]));
|
252
|
+
}
|
253
|
+
}, ce = { class: "bg-grey radius-big" }, ie = ["src"], ue = { class: "pd-t-zero pd-medium" }, de = {
|
254
|
+
key: 0,
|
255
|
+
class: "cursor-pointer mn-thin flex-nowrap flex w-100"
|
256
|
+
}, me = {
|
257
|
+
key: 0,
|
258
|
+
class: "pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"
|
259
|
+
}, pe = {
|
260
|
+
key: 1,
|
261
|
+
class: "mn-small t-transp p-big"
|
262
|
+
}, ge = {
|
263
|
+
key: 2,
|
264
|
+
class: "mn-small h2"
|
265
|
+
}, fe = {
|
266
|
+
__name: "CardBlogpost",
|
267
|
+
props: ["blogpost", "user", "type"],
|
268
|
+
setup(e) {
|
269
|
+
const t = e, a = q(), r = B(() => t.blogpost.content.find((c) => c.type === "ImageUpload")), s = B(() => t.blogpost.content.find((c) => c.type === "Textarea"));
|
270
|
+
return (c, m) => (o(), l("article", ce, [
|
271
|
+
_(V, {
|
272
|
+
class: O({
|
273
|
+
"mn-small pd-medium": e.type !== "short",
|
274
|
+
"flex-child-order-last flex-child mn-l-small": e.type === "short"
|
275
|
+
}),
|
276
|
+
owner: e.blogpost.owner,
|
277
|
+
creator: e.blogpost.creator,
|
278
|
+
date: e.blogpost.createdAt
|
279
|
+
}, null, 8, ["class", "owner", "creator", "date"]),
|
280
|
+
d(r) && d(r).content && e.type !== "blogpostPage" ? (o(), l("img", {
|
281
|
+
key: 0,
|
282
|
+
src: d(r).content,
|
283
|
+
alt: "Blog post image",
|
284
|
+
class: "mn-medium object-fit-cover w-100 h-20r"
|
285
|
+
}, null, 8, ie)) : i("", !0),
|
286
|
+
b("section", ue, [
|
287
|
+
e.type !== "blogpostPage" ? (o(), l("div", de, [
|
288
|
+
b("h3", {
|
289
|
+
onClick: m[0] || (m[0] = (v) => d(a).push({
|
290
|
+
name: "BlogPost",
|
291
|
+
params: {
|
292
|
+
url: e.blogpost.url
|
293
|
+
}
|
294
|
+
})),
|
295
|
+
class: ""
|
296
|
+
}, u(e.blogpost.name), 1),
|
297
|
+
e.blogpost.status === "draft" ? (o(), l("div", me, u(e.blogpost.status), 1)) : i("", !0)
|
298
|
+
])) : i("", !0),
|
299
|
+
d(s) && d(s).content && e.type !== "blogpostPage" ? (o(), l("p", pe, u(d(s).content.slice(0, 120)) + "... ", 1)) : i("", !0),
|
300
|
+
e.type === "blogpostPage" ? (o(), l("h3", ge, u(e.blogpost.name), 1)) : i("", !0),
|
301
|
+
A(c.$slots, "default")
|
302
|
+
]),
|
303
|
+
_(le, {
|
304
|
+
class: "pd-t-zero pd-medium",
|
305
|
+
blogpost: e.blogpost,
|
306
|
+
user: e.user
|
307
|
+
}, null, 8, ["blogpost", "user"])
|
308
|
+
]));
|
309
|
+
}
|
310
|
+
}, ye = { class: "feed" }, be = { key: 1 }, je = {
|
311
|
+
__name: "Feed",
|
312
|
+
props: {
|
313
|
+
category: {
|
314
|
+
type: String,
|
315
|
+
default: null
|
316
|
+
},
|
317
|
+
owner: {
|
318
|
+
type: String,
|
319
|
+
default: null
|
320
|
+
},
|
321
|
+
creator: {
|
322
|
+
type: String,
|
323
|
+
default: null
|
324
|
+
},
|
325
|
+
status: {
|
326
|
+
type: String,
|
327
|
+
default: "published"
|
328
|
+
},
|
329
|
+
user: {
|
330
|
+
type: [String, Number],
|
331
|
+
default: null
|
332
|
+
},
|
333
|
+
period: {
|
334
|
+
type: String,
|
335
|
+
default: null
|
336
|
+
}
|
337
|
+
},
|
338
|
+
setup(e) {
|
339
|
+
const t = e, a = p([]), r = p(!0);
|
340
|
+
let s = p(!0), c = p(0), m = p(2);
|
341
|
+
const v = async () => {
|
342
|
+
if (r.value) {
|
343
|
+
c.value += m.value;
|
344
|
+
const n = await S({
|
345
|
+
skip: c.value,
|
346
|
+
limit: m.value,
|
347
|
+
category: t.category,
|
348
|
+
user: t.user,
|
349
|
+
owner: t.owner,
|
350
|
+
status: t.status,
|
351
|
+
creator: t.creator,
|
352
|
+
period: t.period
|
353
|
+
});
|
354
|
+
n.length === 0 && (r.value = !1), a.value = [...a.value, ...n];
|
355
|
+
}
|
356
|
+
};
|
357
|
+
return T(async () => {
|
358
|
+
const n = await S({
|
359
|
+
skip: c.value,
|
360
|
+
limit: m.value,
|
361
|
+
category: t.category,
|
362
|
+
user: t.user,
|
363
|
+
owner: t.owner,
|
364
|
+
status: t.status,
|
365
|
+
creator: t.creator,
|
366
|
+
period: t.period
|
367
|
+
});
|
368
|
+
n.length === 0 ? r.value = !1 : r.value = !0, a.value = n, s.value = !1;
|
369
|
+
}), (n, h) => (o(), l("section", ye, [
|
370
|
+
_(x, { name: "fade" }, {
|
371
|
+
default: $(() => [
|
372
|
+
d(s) ? (o(), j(te, {
|
373
|
+
key: 0,
|
374
|
+
class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
|
375
|
+
})) : i("", !0)
|
376
|
+
]),
|
377
|
+
_: 1
|
378
|
+
}),
|
379
|
+
_(x, { name: "fade" }, {
|
380
|
+
default: $(() => [
|
381
|
+
!d(s) && a.value.length < 1 ? (o(), j(M, {
|
382
|
+
key: 0,
|
383
|
+
title: "No Blog Posts Found",
|
384
|
+
description: "Currently, there are no posts available in this blog. Please check back later.",
|
385
|
+
class: "pd-medium mn-thin bg-grey radius-big"
|
386
|
+
})) : (o(), l("div", be, [
|
387
|
+
(o(!0), l(U, null, E(a.value, (R) => (o(), j(fe, {
|
388
|
+
key: R._id,
|
389
|
+
blogpost: R,
|
390
|
+
user: e.user,
|
391
|
+
class: "mn-medium"
|
392
|
+
}, null, 8, ["blogpost", "user"]))), 128)),
|
393
|
+
_(x, { name: "fade" }, {
|
394
|
+
default: $(() => [
|
395
|
+
r.value && a.value.length > 0 ? (o(), l("button", {
|
396
|
+
key: 0,
|
397
|
+
onClick: v,
|
398
|
+
class: "w-100 bg-main button"
|
399
|
+
}, " Load more ")) : i("", !0)
|
400
|
+
]),
|
401
|
+
_: 1
|
402
|
+
})
|
403
|
+
]))
|
404
|
+
]),
|
405
|
+
_: 1
|
406
|
+
})
|
407
|
+
]));
|
408
|
+
}
|
409
|
+
};
|
410
|
+
export {
|
411
|
+
te as L,
|
412
|
+
je as _,
|
413
|
+
D as a,
|
414
|
+
H as b,
|
415
|
+
J as c,
|
416
|
+
fe as d,
|
417
|
+
le as e,
|
418
|
+
xe as f,
|
419
|
+
$e as g,
|
420
|
+
S as r,
|
421
|
+
f as s,
|
422
|
+
G as u
|
423
|
+
};
|