@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,459 @@
|
|
1
|
+
import { ref as d, onUpdated as U, nextTick as b, onMounted as I, openBlock as i, createElementBlock as v, withDirectives as B, createElementVNode as m, vModelText as $, watch as D, createTextVNode as j, toDisplayString as F, withModifiers as E, watchEffect as K, unref as _, createBlock as V, withCtx as A, Fragment as H, renderList as z, resolveDynamicComponent as P, normalizeClass as W, createVNode as L, Transition as q, createCommentVNode as w } from "vue";
|
2
|
+
import { a as M } from "./auth-35ef1791.mjs";
|
3
|
+
import { V as G } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
4
|
+
import { _ as J } from "./CardHeader-ce5a1a75.mjs";
|
5
|
+
const O = ["placeholder"], Q = {
|
6
|
+
__name: "Textarea",
|
7
|
+
props: ["prop", "value", "content", "placeholder", "index", "setFocus"],
|
8
|
+
emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
|
9
|
+
setup(n, { emit: s }) {
|
10
|
+
const t = n;
|
11
|
+
d(t);
|
12
|
+
const e = d(null);
|
13
|
+
d(0);
|
14
|
+
function p(o) {
|
15
|
+
let l = o.target.value.split(/\n+/);
|
16
|
+
if (l.length > 1) {
|
17
|
+
t.prop[t.content] = l[0], b(() => {
|
18
|
+
a();
|
19
|
+
});
|
20
|
+
let c = l.slice(1).map((h) => ({ __name: "Textarea", content: h }));
|
21
|
+
s("addBlock", "Textarea", "", t.index, { blocks: c, ref: e });
|
22
|
+
} else
|
23
|
+
o.target.value.trim() === "" && o.target.value.includes(`
|
24
|
+
|
25
|
+
`) && (console.log("We are adding new block:" + t.index + newBlocks + e), s("addBlock", "Textarea", "", t.index, { blocks: newBlocks, ref: e })), a();
|
26
|
+
}
|
27
|
+
function u(o) {
|
28
|
+
(o.keyCode === 8 || o.keyCode === 46) && t.prop[t.content].trim() === "" && s("deleteBlock", t.prop);
|
29
|
+
}
|
30
|
+
function r() {
|
31
|
+
b(() => {
|
32
|
+
e.value.focus(), s("updateBlock", t.prop, { setFocus: !1 });
|
33
|
+
});
|
34
|
+
}
|
35
|
+
function a() {
|
36
|
+
e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
|
37
|
+
}
|
38
|
+
return U(() => {
|
39
|
+
t.setFocus && b(() => {
|
40
|
+
r();
|
41
|
+
}), a();
|
42
|
+
}), I(() => {
|
43
|
+
t.setFocus && b(() => {
|
44
|
+
r();
|
45
|
+
}), a();
|
46
|
+
}), (o, l) => (i(), v("div", null, [
|
47
|
+
B(m("textarea", {
|
48
|
+
"onUpdate:modelValue": l[0] || (l[0] = (c) => n.prop[n.content] = c),
|
49
|
+
placeholder: n.placeholder ? n.placeholder : "Enter text",
|
50
|
+
onInput: p,
|
51
|
+
onFocus: l[1] || (l[1] = (c) => s("focus", e.value)),
|
52
|
+
onKeyup: u,
|
53
|
+
ref_key: "textarea",
|
54
|
+
ref: e,
|
55
|
+
class: "text-area mn-thin"
|
56
|
+
}, `
|
57
|
+
`, 40, O), [
|
58
|
+
[$, n.prop[n.content]]
|
59
|
+
])
|
60
|
+
]));
|
61
|
+
}
|
62
|
+
};
|
63
|
+
const X = ["placeholder"], Y = {
|
64
|
+
__name: "H2",
|
65
|
+
props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref", "setFocus"],
|
66
|
+
emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
|
67
|
+
setup(n, { emit: s }) {
|
68
|
+
const t = n;
|
69
|
+
d(t);
|
70
|
+
const e = d(null);
|
71
|
+
d(0);
|
72
|
+
function p(o) {
|
73
|
+
let l = o.target.value.split(/\n+/);
|
74
|
+
if (l.length > 1) {
|
75
|
+
t.prop[t.content] = l[0], b(() => {
|
76
|
+
a();
|
77
|
+
});
|
78
|
+
let c = l.slice(1).map((h) => ({ type: "Textarea", content: h }));
|
79
|
+
s("addBlock", "Textarea", "", t.index, { blocks: c, ref: e });
|
80
|
+
} else
|
81
|
+
o.target.value.trim() === "" && o.target.value.includes(`
|
82
|
+
|
83
|
+
`) && (console.log("We are adding new block:" + t.index + newBlocks + e), s("addBlock", "Textarea", "", t.index, { blocks: newBlocks, ref: e })), a();
|
84
|
+
}
|
85
|
+
function u(o) {
|
86
|
+
(o.keyCode === 8 || o.keyCode === 46) && t.prop[t.content].trim() === "" && s("deleteBlock", t.prop);
|
87
|
+
}
|
88
|
+
function r() {
|
89
|
+
b(() => {
|
90
|
+
e.value.focus(), s("updateBlock", t.prop, { setFocus: !1 });
|
91
|
+
});
|
92
|
+
}
|
93
|
+
function a() {
|
94
|
+
e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
|
95
|
+
}
|
96
|
+
return U(() => {
|
97
|
+
t.setFocus && b(() => {
|
98
|
+
r();
|
99
|
+
}), a();
|
100
|
+
}), I(() => {
|
101
|
+
t.setFocus && b(() => {
|
102
|
+
r();
|
103
|
+
}), a();
|
104
|
+
}), D(() => t.prop[t.content], (o) => {
|
105
|
+
}), (o, l) => (i(), v("div", null, [
|
106
|
+
B(m("textarea", {
|
107
|
+
"onUpdate:modelValue": l[0] || (l[0] = (c) => n.prop[n.content] = c),
|
108
|
+
placeholder: n.placeholder ? n.placeholder : "Enter text",
|
109
|
+
onInput: p,
|
110
|
+
onFocus: l[1] || (l[1] = (c) => s("focus", e.value)),
|
111
|
+
onKeyup: u,
|
112
|
+
ref_key: "textarea",
|
113
|
+
ref: e,
|
114
|
+
class: "h3 text-area mn-thin"
|
115
|
+
}, `
|
116
|
+
`, 40, X), [
|
117
|
+
[$, n.prop[n.content]]
|
118
|
+
])
|
119
|
+
]));
|
120
|
+
}
|
121
|
+
}, Z = ["placeholder"], ee = {
|
122
|
+
__name: "Caption",
|
123
|
+
props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
|
124
|
+
emits: ["deleteBlock", "addBlock", "focus"],
|
125
|
+
setup(n, { emit: s }) {
|
126
|
+
const t = n;
|
127
|
+
d(t);
|
128
|
+
const e = d(null);
|
129
|
+
function p(r) {
|
130
|
+
const a = /^\s*[-*]\s+(.*)/;
|
131
|
+
let l = r.target.value.split(/\n+/).map((c) => {
|
132
|
+
const h = a.exec(c);
|
133
|
+
return h ? h[1] : null;
|
134
|
+
}).filter((c) => c !== null);
|
135
|
+
l.length > 0 ? (t.prop[t.content] = l, u()) : r.target.value.trim() === "" && (t.prop[t.content] = [], u());
|
136
|
+
}
|
137
|
+
function u() {
|
138
|
+
e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
|
139
|
+
}
|
140
|
+
return U(() => {
|
141
|
+
u();
|
142
|
+
}), I(() => {
|
143
|
+
u();
|
144
|
+
}), D(() => t.prop[t.content], (r) => {
|
145
|
+
(!r || r.length === 0) && s("deleteBlock", t.prop);
|
146
|
+
}), (r, a) => (i(), v("div", null, [
|
147
|
+
B(m("textarea", {
|
148
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => n.prop[n.content] = o),
|
149
|
+
placeholder: n.placeholder ? n.placeholder : "Enter text",
|
150
|
+
onInput: p,
|
151
|
+
onFocus: a[1] || (a[1] = (o) => s("focus", e.value)),
|
152
|
+
ref_key: "textarea",
|
153
|
+
ref: e,
|
154
|
+
class: "br-l br-solid br-main pd-l-small text-area mn-small"
|
155
|
+
}, `
|
156
|
+
`, 40, Z), [
|
157
|
+
[$, n.prop[n.content]]
|
158
|
+
])
|
159
|
+
]));
|
160
|
+
}
|
161
|
+
}, te = ["placeholder"], ne = {
|
162
|
+
__name: "Bullets",
|
163
|
+
props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
|
164
|
+
emits: ["deleteBlock", "addBlock", "focus"],
|
165
|
+
setup(n, { emit: s }) {
|
166
|
+
const t = n;
|
167
|
+
d(t);
|
168
|
+
const e = d(null);
|
169
|
+
function p(r) {
|
170
|
+
const a = /^\s*[-*]\s+(.*)/;
|
171
|
+
let l = r.target.value.split(/\n+/).map((c) => {
|
172
|
+
const h = a.exec(c);
|
173
|
+
return h ? h[1] : null;
|
174
|
+
}).filter((c) => c !== null);
|
175
|
+
l.length > 0 ? (t.prop[t.content] = l, u()) : r.target.value.trim() === "" && (t.prop[t.content] = [], u());
|
176
|
+
}
|
177
|
+
function u() {
|
178
|
+
e.value.style.height = "1rem", e.value.style.height = e.value.scrollHeight + "px";
|
179
|
+
}
|
180
|
+
return U(() => {
|
181
|
+
u();
|
182
|
+
}), I(() => {
|
183
|
+
u();
|
184
|
+
}), D(() => t.prop[t.content], (r) => {
|
185
|
+
(!r || r.length === 0) && s("deleteBlock", t.prop);
|
186
|
+
}), (r, a) => (i(), v("div", null, [
|
187
|
+
j(F(n.prop[n.content]) + " ", 1),
|
188
|
+
B(m("textarea", {
|
189
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => n.prop[n.content] = o),
|
190
|
+
placeholder: n.placeholder ? n.placeholder : "Enter text",
|
191
|
+
onInput: p,
|
192
|
+
onFocus: a[1] || (a[1] = (o) => s("focus", e.value)),
|
193
|
+
ref_key: "textarea",
|
194
|
+
ref: e,
|
195
|
+
class: "text-area mn-small"
|
196
|
+
}, `
|
197
|
+
`, 40, te), [
|
198
|
+
[$, n.prop[n.content]]
|
199
|
+
])
|
200
|
+
]));
|
201
|
+
}
|
202
|
+
}, le = ["src"], oe = {
|
203
|
+
key: 1,
|
204
|
+
class: "t-transp pd-extra"
|
205
|
+
}, ae = {
|
206
|
+
__name: "ImageUpload",
|
207
|
+
props: [
|
208
|
+
"label",
|
209
|
+
"value",
|
210
|
+
"prop"
|
211
|
+
],
|
212
|
+
emits: ["input", "updateBlock"],
|
213
|
+
setup(n, { emit: s }) {
|
214
|
+
const t = n, e = d(null), p = d(null);
|
215
|
+
function u() {
|
216
|
+
p.value.click();
|
217
|
+
}
|
218
|
+
async function r(o) {
|
219
|
+
let l = o.target.files[0];
|
220
|
+
console.log(l);
|
221
|
+
let c = new FormData(), h = "unsorted";
|
222
|
+
c.append("file", l), console.log(c.has("file"));
|
223
|
+
try {
|
224
|
+
let y = await M.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/file?folderName=${encodeURIComponent(h)}`, c, {
|
225
|
+
headers: {
|
226
|
+
"Content-Type": "multipart/form-data"
|
227
|
+
}
|
228
|
+
});
|
229
|
+
e.value = y.data.filepath, console.log(e.value), s("input", e.value), s("updateBlock", t.prop, { content: e.value });
|
230
|
+
} catch (C) {
|
231
|
+
console.error(C);
|
232
|
+
}
|
233
|
+
}
|
234
|
+
function a(o) {
|
235
|
+
o.preventDefault(), r({
|
236
|
+
target: {
|
237
|
+
files: o.dataTransfer.files
|
238
|
+
}
|
239
|
+
});
|
240
|
+
}
|
241
|
+
return (o, l) => (i(), v("div", {
|
242
|
+
onClick: u,
|
243
|
+
onDrop: a,
|
244
|
+
onDragover: l[0] || (l[0] = E(() => {
|
245
|
+
}, ["prevent"])),
|
246
|
+
class: "w-100 radius-big bg-white image-upload-area flex-v-center flex-h-center flex t-black mn-small"
|
247
|
+
}, [
|
248
|
+
n.prop.content ? (i(), v("img", {
|
249
|
+
key: 0,
|
250
|
+
src: n.prop.content,
|
251
|
+
alt: "Uploaded image",
|
252
|
+
class: "w-100 h-30r object-fit-contain"
|
253
|
+
}, null, 8, le)) : (i(), v("span", oe, "Click or drag-and-drop your image")),
|
254
|
+
m("input", {
|
255
|
+
type: "file",
|
256
|
+
ref_key: "fileInput",
|
257
|
+
ref: p,
|
258
|
+
onChange: r,
|
259
|
+
style: { display: "none" }
|
260
|
+
}, null, 544)
|
261
|
+
], 32));
|
262
|
+
}
|
263
|
+
}, se = ["onMouseover"], re = {
|
264
|
+
key: 0,
|
265
|
+
class: "z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded"
|
266
|
+
}, ce = ["onClick"], ue = ["onClick"], ie = ["onClick"], Be = {
|
267
|
+
__name: "Constructor",
|
268
|
+
props: ["content"],
|
269
|
+
emits: ["update"],
|
270
|
+
setup(n, { emit: s }) {
|
271
|
+
const t = n;
|
272
|
+
let e = d(null);
|
273
|
+
d(null), e.value = { content: t.content };
|
274
|
+
const p = {
|
275
|
+
Textarea: Q,
|
276
|
+
H2: Y,
|
277
|
+
Bullets: ne,
|
278
|
+
Caption: ee,
|
279
|
+
ImageUpload: ae
|
280
|
+
};
|
281
|
+
function u(y = "Textarea", x = "", f, g) {
|
282
|
+
console.log("We are adding new block (functuin HandleAddBlock):" + y + x + f + g);
|
283
|
+
let k = {
|
284
|
+
order: e.value.content.length + 1,
|
285
|
+
type: y,
|
286
|
+
style: "",
|
287
|
+
class: "",
|
288
|
+
content: x,
|
289
|
+
blocks: [],
|
290
|
+
setFocus: !0
|
291
|
+
};
|
292
|
+
if (g && g.blocks && Array.isArray(g.blocks)) {
|
293
|
+
let T = g.blocks.map((S) => ({
|
294
|
+
...k,
|
295
|
+
content: S.content
|
296
|
+
})), N = [(g.index || f) + 1, 0].concat(T);
|
297
|
+
e.value.content.splice.apply(e.value.content, N);
|
298
|
+
const R = T[T.length - 1];
|
299
|
+
console.log("New block is" + R);
|
300
|
+
} else
|
301
|
+
f !== void 0 ? (e.value.content.splice(f + 1, 0, k), console.log("Latest block is" + k)) : (console.log("Another block is" + k), e.value.content.push(k));
|
302
|
+
o.value = null, s("update", e.value.content);
|
303
|
+
}
|
304
|
+
function r(y, x) {
|
305
|
+
const f = e.value.content.findIndex((g) => g === y);
|
306
|
+
f !== -1 && (e.value.content[f] = { ...e.value.content[f], ...x }), s("update", e.value.content);
|
307
|
+
}
|
308
|
+
function a(y) {
|
309
|
+
let x = e.value.content.findIndex((f) => f === y);
|
310
|
+
x !== -1 && e.value.content.splice(x, 1), e.value.content[x - 1].setFocus = !0, s("update", e.value.content);
|
311
|
+
}
|
312
|
+
const o = d(null), l = d(!1), c = d(!1);
|
313
|
+
function h() {
|
314
|
+
l.value = !0;
|
315
|
+
}
|
316
|
+
function C() {
|
317
|
+
l.value = !1;
|
318
|
+
}
|
319
|
+
return K(() => {
|
320
|
+
e.value && e.value.content.length === 0 && u("Textarea", ""), s("update", e.value.content);
|
321
|
+
}), (y, x) => (i(), v("section", null, [
|
322
|
+
_(e).content ? (i(), V(_(G), {
|
323
|
+
key: 0,
|
324
|
+
class: "w-full",
|
325
|
+
list: _(e).content,
|
326
|
+
onStart: h,
|
327
|
+
onEnd: C
|
328
|
+
}, {
|
329
|
+
default: A(() => [
|
330
|
+
(i(!0), v(H, null, z(_(e).content, (f, g) => (i(), v("div", {
|
331
|
+
key: g,
|
332
|
+
class: "relative"
|
333
|
+
}, [
|
334
|
+
m("div", {
|
335
|
+
onMouseover: (k) => (o.value = g, c.value = !1),
|
336
|
+
class: "w-full h-full"
|
337
|
+
}, [
|
338
|
+
(i(), V(P(p[f.type]), {
|
339
|
+
index: g,
|
340
|
+
component: f,
|
341
|
+
prop: f,
|
342
|
+
class: W(f.class),
|
343
|
+
setFocus: f.setFocus,
|
344
|
+
content: "content",
|
345
|
+
onDeleteBlock: a,
|
346
|
+
onAddBlock: u,
|
347
|
+
onUpdateBlock: r
|
348
|
+
}, null, 40, ["index", "component", "prop", "class", "setFocus"]))
|
349
|
+
], 40, se),
|
350
|
+
L(q, { name: "fade" }, {
|
351
|
+
default: A(() => [
|
352
|
+
o.value === g ? (i(), v("div", {
|
353
|
+
key: 0,
|
354
|
+
class: "pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi",
|
355
|
+
onMousedown: x[1] || (x[1] = E((k) => l.value = !0, ["prevent"]))
|
356
|
+
}, [
|
357
|
+
m("button", {
|
358
|
+
onClick: x[0] || (x[0] = (k) => c.value = !c.value),
|
359
|
+
class: "mn-small w-100 i-semi bg-white radius-thin"
|
360
|
+
}, F(f.content ? "..." : "+"), 1),
|
361
|
+
c.value ? (i(), v("div", re, [
|
362
|
+
m("button", {
|
363
|
+
onClick: (k) => a(f),
|
364
|
+
class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
|
365
|
+
}, "Удалить", 8, ce),
|
366
|
+
m("button", {
|
367
|
+
onClick: (k) => u("ImageUpload", "", g),
|
368
|
+
class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
|
369
|
+
}, "Добавить изображение", 8, ue),
|
370
|
+
m("button", {
|
371
|
+
onClick: (k) => u("H2", "", g),
|
372
|
+
class: "block w-max text-left px-4 py-2 hover:bg-gray-200"
|
373
|
+
}, "Добавить заголовок", 8, ie)
|
374
|
+
])) : w("", !0)
|
375
|
+
], 32)) : w("", !0)
|
376
|
+
]),
|
377
|
+
_: 2
|
378
|
+
}, 1024)
|
379
|
+
]))), 128))
|
380
|
+
]),
|
381
|
+
_: 1
|
382
|
+
}, 8, ["list"])) : w("", !0)
|
383
|
+
]));
|
384
|
+
}
|
385
|
+
}, de = { class: "mn-small" }, pe = /* @__PURE__ */ m("p", { class: "t-semi uppercase" }, "Please log in to leave a comment.", -1), fe = [
|
386
|
+
pe
|
387
|
+
], me = {
|
388
|
+
key: 1,
|
389
|
+
class: "mn-small"
|
390
|
+
}, ve = ["onSubmit"], ge = /* @__PURE__ */ m("button", {
|
391
|
+
type: "submit",
|
392
|
+
class: "mn-l-auto bg-main button"
|
393
|
+
}, "Send", -1), he = { class: "pd-t-zero" }, xe = { class: "p-big" }, $e = {
|
394
|
+
__name: "Comments",
|
395
|
+
props: ["target", "owner", "type"],
|
396
|
+
setup(n) {
|
397
|
+
const s = n, t = M.create({ baseURL: process.env.API_URL }), e = d([]), p = d(""), u = async () => {
|
398
|
+
const { data: a } = await t.get(`/comments/read?type=${s.type}&target=${s.target}`);
|
399
|
+
e.value = a;
|
400
|
+
}, r = async () => {
|
401
|
+
if (p.value)
|
402
|
+
try {
|
403
|
+
const a = await t.post("/comments/create", {
|
404
|
+
target: s.target,
|
405
|
+
user: s.owner,
|
406
|
+
type: s.type,
|
407
|
+
content: p.value
|
408
|
+
});
|
409
|
+
a.data.owner = s.owner, e.value.push(a.data), p.value = "";
|
410
|
+
} catch (a) {
|
411
|
+
console.error(a);
|
412
|
+
}
|
413
|
+
};
|
414
|
+
return u(), (a, o) => (i(), v("div", null, [
|
415
|
+
m("div", null, [
|
416
|
+
m("h3", de, F(e.value.length) + " comments", 1),
|
417
|
+
n.owner ? w("", !0) : (i(), v("div", {
|
418
|
+
key: 0,
|
419
|
+
onClick: o[0] || (o[0] = (l) => a.$router.push({ name: "Sign In" })),
|
420
|
+
class: "cursor-pointer mn-small section bg-black t-white flex-center flex radius-big"
|
421
|
+
}, fe)),
|
422
|
+
n.owner ? (i(), v("div", me, [
|
423
|
+
m("form", {
|
424
|
+
onSubmit: E(r, ["prevent"]),
|
425
|
+
class: "bg-grey radius-big pd-medium"
|
426
|
+
}, [
|
427
|
+
B(m("textarea", {
|
428
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => p.value = l),
|
429
|
+
placeholder: "Enter your comment",
|
430
|
+
class: "pd-small p-big w-100 radius-small mn-r-small"
|
431
|
+
}, null, 512), [
|
432
|
+
[$, p.value]
|
433
|
+
]),
|
434
|
+
ge
|
435
|
+
], 40, ve)
|
436
|
+
])) : w("", !0)
|
437
|
+
]),
|
438
|
+
(i(!0), v(H, null, z(e.value, (l) => (i(), v("div", {
|
439
|
+
key: l._id,
|
440
|
+
class: "comment mn-small radius-big pd-medium bg-grey"
|
441
|
+
}, [
|
442
|
+
L(J, {
|
443
|
+
class: "mn-medium",
|
444
|
+
owner: { target: l.user },
|
445
|
+
creator: { target: l.user },
|
446
|
+
date: l.createdAt
|
447
|
+
}, null, 8, ["owner", "creator", "date"]),
|
448
|
+
m("div", he, [
|
449
|
+
m("p", xe, F(l.content), 1)
|
450
|
+
])
|
451
|
+
]))), 128))
|
452
|
+
]));
|
453
|
+
}
|
454
|
+
};
|
455
|
+
export {
|
456
|
+
Be as _,
|
457
|
+
$e as a,
|
458
|
+
Q as b
|
459
|
+
};
|
@@ -0,0 +1,236 @@
|
|
1
|
+
import { toRefs as $, openBlock as n, createElementBlock as r, createTextVNode as U, toDisplayString as w, unref as e, createVNode as p, createElementVNode as o, createCommentVNode as y, createBlock as P, withCtx as N, Fragment as D, renderList as S, ref as C, withModifiers as B } from "vue";
|
2
|
+
import { F as _, b as E, a as V } from "./auth-35ef1791.mjs";
|
3
|
+
import { S as z } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-628f013e.mjs";
|
4
|
+
import { u as A } from "./vuex.esm-bundler-57d8b6ba.mjs";
|
5
|
+
import { V as F } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
6
|
+
import { s as x } from "./categories-d669f3af.mjs";
|
7
|
+
const L = { class: "mn-big flex-column flex" }, ne = {
|
8
|
+
__name: "EditProductInfo",
|
9
|
+
props: {
|
10
|
+
product: Object
|
11
|
+
},
|
12
|
+
setup(i) {
|
13
|
+
const c = i, t = A();
|
14
|
+
return $(c), (s, a) => (n(), r("div", L, [
|
15
|
+
U(w(e(t).products.current) + " ", 1),
|
16
|
+
p(z, {
|
17
|
+
options: [
|
18
|
+
"unpublished",
|
19
|
+
"published",
|
20
|
+
"archivied"
|
21
|
+
],
|
22
|
+
select: e(t).products.state.current.status,
|
23
|
+
"onUpdate:select": a[0] || (a[0] = (l) => e(t).products.state.current.status = l),
|
24
|
+
placeholder: "Display product",
|
25
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
26
|
+
}, null, 8, ["select"]),
|
27
|
+
p(_, {
|
28
|
+
field: e(t).products.state.current.name,
|
29
|
+
"onUpdate:field": a[1] || (a[1] = (l) => e(t).products.state.current.name = l),
|
30
|
+
placeholder: "Введите название",
|
31
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
32
|
+
}, null, 8, ["field"]),
|
33
|
+
p(_, {
|
34
|
+
field: e(t).products.state.current.price,
|
35
|
+
"onUpdate:field": a[2] || (a[2] = (l) => e(t).products.state.current.price = l),
|
36
|
+
placeholder: "Введите цену",
|
37
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
38
|
+
type: "number"
|
39
|
+
}, null, 8, ["field"]),
|
40
|
+
p(_, {
|
41
|
+
field: e(t).products.state.current.description,
|
42
|
+
"onUpdate:field": a[3] || (a[3] = (l) => e(t).products.state.current.description = l),
|
43
|
+
placeholder: "Введите описание",
|
44
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
45
|
+
type: "textarea"
|
46
|
+
}, null, 8, ["field"])
|
47
|
+
]));
|
48
|
+
}
|
49
|
+
}, j = { class: "mn-big" }, M = { class: "mn-small flex-nowrap flex" }, O = { class: "mn-r-thin" }, R = { class: "flex-column flex" }, T = {
|
50
|
+
key: 0,
|
51
|
+
class: "w-100 mn-small"
|
52
|
+
}, q = ["onClick"], G = /* @__PURE__ */ o("svg", {
|
53
|
+
class: "i-small",
|
54
|
+
fill: "none",
|
55
|
+
height: "20",
|
56
|
+
viewBox: "0 0 20 20",
|
57
|
+
width: "20",
|
58
|
+
xmlns: "http://www.w3.org/2000/svg"
|
59
|
+
}, [
|
60
|
+
/* @__PURE__ */ o("path", {
|
61
|
+
"clip-rule": "evenodd",
|
62
|
+
d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
|
63
|
+
fill: "#8a8a8a",
|
64
|
+
"fill-rule": "evenodd"
|
65
|
+
})
|
66
|
+
], -1), H = [
|
67
|
+
G
|
68
|
+
], oe = {
|
69
|
+
__name: "EditParameters",
|
70
|
+
props: {
|
71
|
+
items: {
|
72
|
+
type: Array,
|
73
|
+
default: () => []
|
74
|
+
},
|
75
|
+
title: String,
|
76
|
+
addButtonLabel: String,
|
77
|
+
emptyMessage: String,
|
78
|
+
keyName: String,
|
79
|
+
valueName: String
|
80
|
+
},
|
81
|
+
emits: ["add-info", "delete-info"],
|
82
|
+
setup(i, { emit: c }) {
|
83
|
+
const t = i;
|
84
|
+
function s() {
|
85
|
+
c("add-info", {});
|
86
|
+
}
|
87
|
+
function a(d) {
|
88
|
+
c("delete-info", d);
|
89
|
+
}
|
90
|
+
const { items: l, title: f, emptyMessage: v, addButtonLabel: m, keyName: u, valueName: g } = $(t);
|
91
|
+
return (d, I) => (n(), r("div", j, [
|
92
|
+
o("div", M, [
|
93
|
+
o("h5", O, w(e(f)), 1),
|
94
|
+
o("button", {
|
95
|
+
onClick: s,
|
96
|
+
class: "i-small pd-thin button-delete button"
|
97
|
+
}, "+")
|
98
|
+
]),
|
99
|
+
o("div", R, [
|
100
|
+
e(l).length == 0 ? (n(), r("p", T, w(e(v)), 1)) : y("", !0),
|
101
|
+
e(l).length == 0 ? (n(), P(E, {
|
102
|
+
key: 1,
|
103
|
+
onClick: s,
|
104
|
+
class: "button"
|
105
|
+
}, {
|
106
|
+
default: N(() => [
|
107
|
+
U(w(e(m)), 1)
|
108
|
+
]),
|
109
|
+
_: 1
|
110
|
+
})) : y("", !0),
|
111
|
+
(n(!0), r(D, null, S(e(l), (h, k) => (n(), r("div", {
|
112
|
+
class: "mn-medium w-100 flex-nowrap flex",
|
113
|
+
key: k
|
114
|
+
}, [
|
115
|
+
p(_, {
|
116
|
+
field: h[e(u)],
|
117
|
+
"onUpdate:field": (b) => h[e(u)] = b,
|
118
|
+
placeholder: "Название параметра",
|
119
|
+
class: "w-100 mn-r-small bg-white radius-small pd-medium"
|
120
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
121
|
+
p(_, {
|
122
|
+
field: h[e(g)],
|
123
|
+
"onUpdate:field": (b) => h[e(g)] = b,
|
124
|
+
placeholder: "Значение параметра",
|
125
|
+
class: "w-100 bg-white radius-small pd-medium"
|
126
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
127
|
+
o("button", {
|
128
|
+
onClick: (b) => a(k),
|
129
|
+
class: "mn-l-small button"
|
130
|
+
}, H, 8, q)
|
131
|
+
]))), 128))
|
132
|
+
])
|
133
|
+
]));
|
134
|
+
}
|
135
|
+
}, J = /* @__PURE__ */ o("div", { class: "flex-v-center flex-h-center flex w-100 h-100" }, " upload ", -1), K = {
|
136
|
+
__name: "UploadImageMultiple",
|
137
|
+
props: [
|
138
|
+
"uploadPath"
|
139
|
+
],
|
140
|
+
emits: ["update:images"],
|
141
|
+
setup(i, { emit: c }) {
|
142
|
+
const t = i, s = C([]), a = C(null);
|
143
|
+
function l() {
|
144
|
+
a.value.click();
|
145
|
+
}
|
146
|
+
async function f(m) {
|
147
|
+
let u = m.target.files, g = new FormData();
|
148
|
+
for (let d = 0; d < u.length; d++)
|
149
|
+
g.append("file", u[d]);
|
150
|
+
try {
|
151
|
+
(await V.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/multiple?folderName=${encodeURIComponent(t.uploadPath)}`, g, {
|
152
|
+
headers: {
|
153
|
+
"Content-Type": "multipart/form-data"
|
154
|
+
}
|
155
|
+
})).data.forEach((h) => {
|
156
|
+
s.value.push(h.filepath);
|
157
|
+
}), c("update:images", s.value);
|
158
|
+
} catch (d) {
|
159
|
+
console.error(d);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
function v(m) {
|
163
|
+
m.preventDefault(), f({
|
164
|
+
target: {
|
165
|
+
files: m.dataTransfer.files
|
166
|
+
}
|
167
|
+
});
|
168
|
+
}
|
169
|
+
return (m, u) => (n(), r("div", {
|
170
|
+
onClick: l,
|
171
|
+
onDrop: v,
|
172
|
+
onDragover: u[0] || (u[0] = B(() => {
|
173
|
+
}, ["prevent"])),
|
174
|
+
class: "flex-v-center flex-h-center flex"
|
175
|
+
}, [
|
176
|
+
J,
|
177
|
+
o("input", {
|
178
|
+
type: "file",
|
179
|
+
ref_key: "fileInput",
|
180
|
+
ref: a,
|
181
|
+
onChange: f,
|
182
|
+
multiple: "",
|
183
|
+
style: { display: "none" }
|
184
|
+
}, null, 544)
|
185
|
+
], 32));
|
186
|
+
}
|
187
|
+
}, Q = {
|
188
|
+
key: 0,
|
189
|
+
class: "mn-big"
|
190
|
+
}, W = { class: "flex-column block" }, X = ["src"], Y = ["onClick"], re = {
|
191
|
+
__name: "EditProductImages",
|
192
|
+
props: {
|
193
|
+
product: Object
|
194
|
+
},
|
195
|
+
setup(i) {
|
196
|
+
function c(s) {
|
197
|
+
console.log(s), console.log(x.current.images), x.current.images.push(...s);
|
198
|
+
}
|
199
|
+
function t(s) {
|
200
|
+
x.current.images.splice(s, 1);
|
201
|
+
}
|
202
|
+
return (s, a) => (n(), r("div", null, [
|
203
|
+
i.product.images.length < 1 ? (n(), r("p", Q, " The product doesn't have any images yet. ")) : y("", !0),
|
204
|
+
p(e(F), {
|
205
|
+
class: "cols-4 dragArea list-group w-full",
|
206
|
+
list: i.product.images,
|
207
|
+
sort: !0,
|
208
|
+
onChange: s.log
|
209
|
+
}, {
|
210
|
+
default: N(() => [
|
211
|
+
(n(!0), r(D, null, S(i.product.images, (l, f) => (n(), r("div", W, [
|
212
|
+
o("img", {
|
213
|
+
class: "w-100 mn-small",
|
214
|
+
src: l
|
215
|
+
}, null, 8, X),
|
216
|
+
o("a", {
|
217
|
+
onClick: (v) => t(f),
|
218
|
+
class: "w-100 br-grey br-solid br-1px button"
|
219
|
+
}, "Удалить", 8, Y)
|
220
|
+
]))), 256))
|
221
|
+
]),
|
222
|
+
_: 1
|
223
|
+
}, 8, ["list", "onChange"]),
|
224
|
+
p(K, {
|
225
|
+
"onUpdate:images": c,
|
226
|
+
uploadPath: "organizations/" + s.$route.params._id + "/products",
|
227
|
+
class: "mn-t-semi pd-small w-100 button bg-main"
|
228
|
+
}, null, 8, ["uploadPath"])
|
229
|
+
]));
|
230
|
+
}
|
231
|
+
};
|
232
|
+
export {
|
233
|
+
ne as _,
|
234
|
+
oe as a,
|
235
|
+
re as b
|
236
|
+
};
|