@ozdao/prometheus-framework 0.1.27 → 0.1.29
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Chips-493042f7.js +1 -0
- package/dist/Chips-9cf6c0da.mjs +286 -0
- package/dist/Feed-27f62b1c.mjs +368 -0
- package/dist/Feed-7c8c901a.mjs +380 -0
- package/dist/Feed-aee74095.js +1 -0
- package/dist/Feed-bfd7d1d9.js +1 -0
- package/dist/Image-1f7252c0.mjs +477 -0
- package/dist/Image-448f9228.js +9 -0
- package/dist/Product-3c9c8197.js +7 -0
- package/dist/Product-748ec8b7.mjs +842 -0
- package/dist/Product-852f952c.js +7 -0
- package/dist/Product-bbdc8460.mjs +841 -0
- package/dist/ProductEdit-17f4e395.mjs +304 -0
- package/dist/ProductEdit-4af06681.js +1 -0
- package/dist/ProductEdit-4f9b6d56.js +1 -0
- package/dist/ProductEdit-a1050ab6.mjs +303 -0
- package/dist/ProfileBlogposts-03d04b92.mjs +66 -0
- package/dist/ProfileBlogposts-f9312adf.js +1 -0
- package/dist/ProfileComments-6d863cd3.mjs +45 -0
- package/dist/ProfileComments-e6970923.js +1 -0
- package/dist/ProfileEvents-917169c6.mjs +58 -0
- package/dist/ProfileEvents-996bce18.js +1 -0
- package/dist/ProfileLikes-0402d1fb.js +1 -0
- package/dist/ProfileLikes-92196922.mjs +45 -0
- package/dist/auth.client.cjs +8 -8
- package/dist/auth.client.js +581 -602
- package/dist/auth.validation-2cdd2231.mjs +17 -0
- package/dist/auth.validation-30bb0efd.js +1 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +65 -65
- package/dist/components/CardFooter/CardFooter.vue.d.ts +1 -1
- package/dist/components/CardHeader/CardHeader.vue.d.ts +1 -1
- package/dist/events.client.cjs +2 -2
- package/dist/events.client.js +6 -6
- package/dist/legal.client.cjs +1 -1
- package/dist/legal.client.js +2596 -2567
- package/dist/modules/community/components/blocks/FooterBlogpost.vue.d.ts +1 -1
- package/dist/modules/community/components/sections/Feed.vue.d.ts +1 -1
- package/dist/modules/events/components/blocks/CardEvent.vue.d.ts +3 -3
- package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -1
- package/dist/modules/events/components/sections/List.vue.d.ts +1 -1
- package/dist/modules/organizations/components/sections/Feed.vue.d.ts +1 -1
- package/dist/modules/organizations/components/sections/Organizations.vue.d.ts +1 -1
- package/dist/organizations.client-13fc2cbe.js +3 -0
- package/dist/organizations.client-39196bef.mjs +3041 -0
- package/dist/organizations.client-85a2ae66.js +3 -0
- package/dist/organizations.client-91e84d4f.mjs +3022 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +43 -42
- package/dist/states.validation-766a62a6.mjs +13 -0
- package/dist/states.validation-92231934.js +1 -0
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +199 -194
- package/package.json +1 -1
- package/src/components/CardFooter/CardFooter.vue +27 -30
- package/src/components/CardHeader/CardHeader.vue +56 -3
- package/src/modules/auth/components/pages/SignIn.vue +2 -2
- package/src/modules/community/components/layouts/Community.vue +5 -5
- package/src/modules/events/components/blocks/CardEvent.vue +3 -2
- package/src/modules/events/components/pages/EditEvent.vue +1 -1
- package/src/modules/events/router/events.js +1 -0
- package/src/modules/legal/components/pages/Legal.vue +33 -17
- package/src/modules/legal/router/legal.js +51 -21
- package/src/modules/organizations/router/organizations.js +19 -0
- package/src/modules/users/components/pages/Profile.vue +2 -2
- package/src/modules/users/router/users.js +36 -31
@@ -0,0 +1,304 @@
|
|
1
|
+
import { toRefs as I, openBlock as r, createElementBlock as d, createTextVNode as C, toDisplayString as w, unref as e, createVNode as i, createElementVNode as t, createCommentVNode as k, createBlock as U, withCtx as z, Fragment as N, renderList as P, withAsyncContext as E } from "vue";
|
2
|
+
import { useRoute as B, useRouter as V } from "vue-router";
|
3
|
+
import { s as l, a as R, b as $, _ as D, c as j } from "./organizations.client-39196bef.mjs";
|
4
|
+
import "./inputs.validation-14e8e01f.mjs";
|
5
|
+
import "./index-0ab9d59c.mjs";
|
6
|
+
import "./Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-4ed993c7.mjs";
|
7
|
+
import { C as F } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-19e23006.mjs";
|
8
|
+
import { F as h, _ as L } from "./Button-d8e72ac0.mjs";
|
9
|
+
import "vue-i18n";
|
10
|
+
import "./Chips-9cf6c0da.mjs";
|
11
|
+
import { S as M } from "./Select-90d4b7c8.mjs";
|
12
|
+
import { u as O } from "./vuex.esm-bundler-57d8b6ba.mjs";
|
13
|
+
import { V as T } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
14
|
+
import { _ as q } from "./UploadImageMultiple-7b132ba0.mjs";
|
15
|
+
import "./globals-96ba60e4.mjs";
|
16
|
+
import "./Tab-a243605d.mjs";
|
17
|
+
import "./ButtonFollow-00d85977.mjs";
|
18
|
+
import "./auth-b047fdc0.mjs";
|
19
|
+
import "./_plugin-vue_export-helper-dad06003.mjs";
|
20
|
+
import "./Feed-27f62b1c.mjs";
|
21
|
+
import "./EmptyState-34d85f10.mjs";
|
22
|
+
import "./IconEdit-eacf3856.mjs";
|
23
|
+
import "./Feed-7c8c901a.mjs";
|
24
|
+
import "./Socials-8193477c.mjs";
|
25
|
+
import "./CardOrganization-3f4a13d3.mjs";
|
26
|
+
import "./organizations-aed4245d.mjs";
|
27
|
+
import "./UploadImage-f7b0335f.mjs";
|
28
|
+
import "./Publics-538180a8.mjs";
|
29
|
+
import "./auth.validation-2cdd2231.mjs";
|
30
|
+
const G = { class: "mn-big flex-column flex" }, H = {
|
31
|
+
__name: "EditProductInfo",
|
32
|
+
props: {
|
33
|
+
product: Object
|
34
|
+
},
|
35
|
+
setup(u) {
|
36
|
+
const c = u, o = O();
|
37
|
+
return I(c), (s, n) => (r(), d("div", G, [
|
38
|
+
C(w(e(o).products.current) + " ", 1),
|
39
|
+
i(M, {
|
40
|
+
options: [
|
41
|
+
"unpublished",
|
42
|
+
"published",
|
43
|
+
"archivied"
|
44
|
+
],
|
45
|
+
select: e(o).products.state.current.status,
|
46
|
+
"onUpdate:select": n[0] || (n[0] = (a) => e(o).products.state.current.status = a),
|
47
|
+
placeholder: "Display product",
|
48
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
49
|
+
}, null, 8, ["select"]),
|
50
|
+
i(h, {
|
51
|
+
field: e(o).products.state.current.name,
|
52
|
+
"onUpdate:field": n[1] || (n[1] = (a) => e(o).products.state.current.name = a),
|
53
|
+
placeholder: "Введите название",
|
54
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
55
|
+
}, null, 8, ["field"]),
|
56
|
+
i(h, {
|
57
|
+
field: e(o).products.state.current.price,
|
58
|
+
"onUpdate:field": n[2] || (n[2] = (a) => e(o).products.state.current.price = a),
|
59
|
+
placeholder: "Введите цену",
|
60
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
61
|
+
type: "number"
|
62
|
+
}, null, 8, ["field"]),
|
63
|
+
i(h, {
|
64
|
+
field: e(o).products.state.current.description,
|
65
|
+
"onUpdate:field": n[3] || (n[3] = (a) => e(o).products.state.current.description = a),
|
66
|
+
placeholder: "Введите описание",
|
67
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
68
|
+
type: "textarea"
|
69
|
+
}, null, 8, ["field"])
|
70
|
+
]));
|
71
|
+
}
|
72
|
+
}, J = { class: "mn-big" }, K = { class: "mn-small flex-nowrap flex" }, Q = { class: "mn-r-thin" }, W = { class: "flex-column flex" }, X = {
|
73
|
+
key: 0,
|
74
|
+
class: "w-100 mn-small"
|
75
|
+
}, Y = ["onClick"], Z = /* @__PURE__ */ t("svg", {
|
76
|
+
class: "i-small",
|
77
|
+
fill: "none",
|
78
|
+
height: "20",
|
79
|
+
viewBox: "0 0 20 20",
|
80
|
+
width: "20",
|
81
|
+
xmlns: "http://www.w3.org/2000/svg"
|
82
|
+
}, [
|
83
|
+
/* @__PURE__ */ t("path", {
|
84
|
+
"clip-rule": "evenodd",
|
85
|
+
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",
|
86
|
+
fill: "#8a8a8a",
|
87
|
+
"fill-rule": "evenodd"
|
88
|
+
})
|
89
|
+
], -1), ee = [
|
90
|
+
Z
|
91
|
+
], S = {
|
92
|
+
__name: "EditParameters",
|
93
|
+
props: {
|
94
|
+
items: {
|
95
|
+
type: Array,
|
96
|
+
default: () => []
|
97
|
+
},
|
98
|
+
title: String,
|
99
|
+
addButtonLabel: String,
|
100
|
+
emptyMessage: String,
|
101
|
+
keyName: String,
|
102
|
+
valueName: String
|
103
|
+
},
|
104
|
+
emits: ["add-info", "delete-info"],
|
105
|
+
setup(u, { emit: c }) {
|
106
|
+
const o = u;
|
107
|
+
function s() {
|
108
|
+
c("add-info", {});
|
109
|
+
}
|
110
|
+
function n(m) {
|
111
|
+
c("delete-info", m);
|
112
|
+
}
|
113
|
+
const { items: a, title: _, emptyMessage: f, addButtonLabel: y, keyName: g, valueName: b } = I(o);
|
114
|
+
return (m, A) => (r(), d("div", J, [
|
115
|
+
t("div", K, [
|
116
|
+
t("h5", Q, w(e(_)), 1),
|
117
|
+
t("button", {
|
118
|
+
onClick: s,
|
119
|
+
class: "i-small pd-thin button-delete button"
|
120
|
+
}, "+")
|
121
|
+
]),
|
122
|
+
t("div", W, [
|
123
|
+
e(a).length == 0 ? (r(), d("p", X, w(e(f)), 1)) : k("", !0),
|
124
|
+
e(a).length == 0 ? (r(), U(L, {
|
125
|
+
key: 1,
|
126
|
+
onClick: s,
|
127
|
+
class: "button"
|
128
|
+
}, {
|
129
|
+
default: z(() => [
|
130
|
+
C(w(e(y)), 1)
|
131
|
+
]),
|
132
|
+
_: 1
|
133
|
+
})) : k("", !0),
|
134
|
+
(r(!0), d(N, null, P(e(a), (p, x) => (r(), d("div", {
|
135
|
+
class: "mn-medium w-100 flex-nowrap flex",
|
136
|
+
key: x
|
137
|
+
}, [
|
138
|
+
i(h, {
|
139
|
+
field: p[e(g)],
|
140
|
+
"onUpdate:field": (v) => p[e(g)] = v,
|
141
|
+
placeholder: "Название параметра",
|
142
|
+
class: "w-100 mn-r-small bg-white radius-small pd-medium"
|
143
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
144
|
+
i(h, {
|
145
|
+
field: p[e(b)],
|
146
|
+
"onUpdate:field": (v) => p[e(b)] = v,
|
147
|
+
placeholder: "Значение параметра",
|
148
|
+
class: "w-100 bg-white radius-small pd-medium"
|
149
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
150
|
+
t("button", {
|
151
|
+
onClick: (v) => n(x),
|
152
|
+
class: "mn-l-small button"
|
153
|
+
}, ee, 8, Y)
|
154
|
+
]))), 128))
|
155
|
+
])
|
156
|
+
]));
|
157
|
+
}
|
158
|
+
}, te = {
|
159
|
+
key: 0,
|
160
|
+
class: "mn-big"
|
161
|
+
}, se = { class: "flex-column block" }, oe = ["src"], ae = ["onClick"], le = {
|
162
|
+
__name: "EditProductImages",
|
163
|
+
props: {
|
164
|
+
product: Object
|
165
|
+
},
|
166
|
+
setup(u) {
|
167
|
+
function c(s) {
|
168
|
+
console.log(s), console.log(l.current.images), l.current.images.push(...s);
|
169
|
+
}
|
170
|
+
function o(s) {
|
171
|
+
l.current.images.splice(s, 1);
|
172
|
+
}
|
173
|
+
return (s, n) => (r(), d("div", null, [
|
174
|
+
u.product.images.length < 1 ? (r(), d("p", te, " The product doesn't have any images yet. ")) : k("", !0),
|
175
|
+
i(e(T), {
|
176
|
+
class: "cols-4 dragArea list-group w-full",
|
177
|
+
list: u.product.images,
|
178
|
+
sort: !0,
|
179
|
+
onChange: s.log
|
180
|
+
}, {
|
181
|
+
default: z(() => [
|
182
|
+
(r(!0), d(N, null, P(u.product.images, (a, _) => (r(), d("div", se, [
|
183
|
+
t("img", {
|
184
|
+
class: "w-100 mn-small",
|
185
|
+
src: (s.FILE_SERVER_URL || "") + a
|
186
|
+
}, null, 8, oe),
|
187
|
+
t("a", {
|
188
|
+
onClick: (f) => o(_),
|
189
|
+
class: "w-100 br-grey br-solid br-1px button"
|
190
|
+
}, "Удалить", 8, ae)
|
191
|
+
]))), 256))
|
192
|
+
]),
|
193
|
+
_: 1
|
194
|
+
}, 8, ["list", "onChange"]),
|
195
|
+
i(q, {
|
196
|
+
"onUpdate:images": c,
|
197
|
+
uploadPath: "organizations/" + s.$route.params._id + "/products",
|
198
|
+
class: "mn-t-semi pd-small w-100 button bg-main"
|
199
|
+
}, null, 8, ["uploadPath"])
|
200
|
+
]));
|
201
|
+
}
|
202
|
+
};
|
203
|
+
const re = { class: "for-transition w-100" }, ie = { class: "pd-b-zero pd-t-zero pd-thin" }, ne = { class: "pd-thin" }, de = { class: "flex-nowrap flex bg-grey pd-medium radius-big" }, ce = {
|
204
|
+
key: 0,
|
205
|
+
class: "mn-r-auto"
|
206
|
+
}, ue = {
|
207
|
+
key: 1,
|
208
|
+
class: "mn-r-auto"
|
209
|
+
}, me = { class: "flex-nowrap flex pd-thin" }, pe = { class: "pd-b-zero pd-t-zero pd-thin cols-2 gap-thin" }, _e = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, he = /* @__PURE__ */ t("h3", { class: "mn-semi" }, "Profile", -1), fe = { class: "mn-semi" }, ge = /* @__PURE__ */ t("h5", null, "Categories", -1), be = { class: "" }, ve = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, we = /* @__PURE__ */ t("h3", { class: "mn-semi" }, "Images", -1), We = {
|
210
|
+
__name: "ProductEdit",
|
211
|
+
async setup(u) {
|
212
|
+
let c, o;
|
213
|
+
const s = B(), n = V();
|
214
|
+
[c, o] = E(() => R.fetchCategories()), await c, o(), s.params.product && ([c, o] = E(() => $.read({ _id: s.params.product })), await c, o());
|
215
|
+
function a() {
|
216
|
+
l.current.information.push({ name: "", value: "" });
|
217
|
+
}
|
218
|
+
function _(m) {
|
219
|
+
l.current.information.splice(m, 1);
|
220
|
+
}
|
221
|
+
function f() {
|
222
|
+
l.current.localization.push({ locale: "", text: "" });
|
223
|
+
}
|
224
|
+
function y(m) {
|
225
|
+
l.current.localization.splice(m, 1);
|
226
|
+
}
|
227
|
+
function g() {
|
228
|
+
s.params.product ? $.update(s.params.product, l.current) : $.create(s.params._id, l.current);
|
229
|
+
}
|
230
|
+
function b() {
|
231
|
+
n.push({ name: "ProductEdit", params: { _id: s.params._id, product: l.current._id } });
|
232
|
+
}
|
233
|
+
return (m, A) => (r(), d("div", re, [
|
234
|
+
t("div", ie, [
|
235
|
+
i(D, { class: "pd-medium bg-grey radius-big" })
|
236
|
+
]),
|
237
|
+
t("div", ne, [
|
238
|
+
t("header", de, [
|
239
|
+
e(s).params.product ? (r(), d("h1", ce, "Edit Product")) : (r(), d("h1", ue, "Create Product")),
|
240
|
+
t("section", me, [
|
241
|
+
i(L, {
|
242
|
+
submit: g,
|
243
|
+
callback: b
|
244
|
+
}, {
|
245
|
+
default: z(() => [
|
246
|
+
C("Save Product")
|
247
|
+
]),
|
248
|
+
_: 1
|
249
|
+
})
|
250
|
+
])
|
251
|
+
])
|
252
|
+
]),
|
253
|
+
t("div", pe, [
|
254
|
+
t("div", _e, [
|
255
|
+
he,
|
256
|
+
i(H, {
|
257
|
+
product: l.current
|
258
|
+
}, null, 8, ["product"]),
|
259
|
+
t("div", fe, [
|
260
|
+
ge,
|
261
|
+
(r(!0), d(N, null, P(j.all, (p, x) => (r(), U(F, {
|
262
|
+
label: p.name,
|
263
|
+
name: "categories",
|
264
|
+
value: p.url,
|
265
|
+
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
266
|
+
radio: l.current.category
|
267
|
+
}, null, 8, ["label", "value", "radio"]))), 256))
|
268
|
+
]),
|
269
|
+
i(S, {
|
270
|
+
items: l.current.information,
|
271
|
+
title: "Parameters",
|
272
|
+
emptyMessage: "No parameters",
|
273
|
+
addButtonLabel: "Add parameter",
|
274
|
+
keyName: "name",
|
275
|
+
valueName: "value",
|
276
|
+
onAddInfo: a,
|
277
|
+
onDeleteInfo: _
|
278
|
+
}, null, 8, ["items"]),
|
279
|
+
i(S, {
|
280
|
+
items: l.current.localization,
|
281
|
+
title: "Localization",
|
282
|
+
emptyMessage: "No localizations",
|
283
|
+
addButtonLabel: "Add localization",
|
284
|
+
keyName: "locale",
|
285
|
+
valueName: "text",
|
286
|
+
onAddInfo: f,
|
287
|
+
onDeleteInfo: y
|
288
|
+
}, null, 8, ["items"])
|
289
|
+
]),
|
290
|
+
t("div", be, [
|
291
|
+
t("div", ve, [
|
292
|
+
we,
|
293
|
+
i(le, {
|
294
|
+
product: l.current
|
295
|
+
}, null, 8, ["product"])
|
296
|
+
])
|
297
|
+
])
|
298
|
+
])
|
299
|
+
]));
|
300
|
+
}
|
301
|
+
};
|
302
|
+
export {
|
303
|
+
We as default
|
304
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("vue-router"),t=require("./organizations.client-13fc2cbe.js");require("./inputs.validation-24ae76b9.js");require("./index-7ecbf72a.js");require("./Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-0ea8fbf8.js");const k=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-f3d37f29.js"),d=require("./Button-ee08e6bf.js");require("vue-i18n");require("./Chips-493042f7.js");const E=require("./Select-b9299fb6.js"),V=require("./vuex.esm-bundler-e8cf3cd2.js"),y=require("./vue-draggable-next.esm-bundler-80731ae0.js"),B=require("./UploadImageMultiple-297b3897.js");require("./globals-928eb13c.js");require("./Tab-6f0a4909.js");require("./ButtonFollow-7c0180b3.js");require("./auth-2f9b2dfc.js");require("./_plugin-vue_export-helper-f246444f.js");require("./Feed-bfd7d1d9.js");require("./EmptyState-7658d7d6.js");require("./IconEdit-4cfe2115.js");require("./Feed-aee74095.js");require("./Socials-821bd677.js");require("./CardOrganization-bf366e4e.js");require("./organizations-bb8f676d.js");require("./UploadImage-33f6a9f4.js");require("./Publics-4438ca51.js");const w={class:"mn-big flex-column flex"},x={__name:"EditProductInfo",props:{product:Object},setup(s){const a=s,n=V.useStore();return e.toRefs(a),(r,l)=>(e.openBlock(),e.createElementBlock("div",w,[e.createTextVNode(e.toDisplayString(e.unref(n).products.current)+" ",1),e.createVNode(E.Select,{options:["unpublished","published","archivied"],select:e.unref(n).products.state.current.status,"onUpdate:select":l[0]||(l[0]=o=>e.unref(n).products.state.current.status=o),placeholder:"Display product",class:"w-100 mn-small bg-white radius-small pd-medium"},null,8,["select"]),e.createVNode(d.Field,{field:e.unref(n).products.state.current.name,"onUpdate:field":l[1]||(l[1]=o=>e.unref(n).products.state.current.name=o),placeholder:"Введите название",class:"w-100 mn-small bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.Field,{field:e.unref(n).products.state.current.price,"onUpdate:field":l[2]||(l[2]=o=>e.unref(n).products.state.current.price=o),placeholder:"Введите цену",class:"w-100 mn-small bg-white radius-small pd-medium",type:"number"},null,8,["field"]),e.createVNode(d.Field,{field:e.unref(n).products.state.current.description,"onUpdate:field":l[3]||(l[3]=o=>e.unref(n).products.state.current.description=o),placeholder:"Введите описание",class:"w-100 mn-small bg-white radius-small pd-medium",type:"textarea"},null,8,["field"])]))}},q={class:"mn-big"},$={class:"mn-small flex-nowrap flex"},C={class:"mn-r-thin"},S={class:"flex-column flex"},z={key:0,class:"w-100 mn-small"},P=["onClick"],I=e.createElementVNode("svg",{class:"i-small",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"clip-rule":"evenodd",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",fill:"#8a8a8a","fill-rule":"evenodd"})],-1),L=[I],N={__name:"EditParameters",props:{items:{type:Array,default:()=>[]},title:String,addButtonLabel:String,emptyMessage:String,keyName:String,valueName:String},emits:["add-info","delete-info"],setup(s,{emit:a}){const n=s;function r(){a("add-info",{})}function l(c){a("delete-info",c)}const{items:o,title:u,emptyMessage:m,addButtonLabel:h,keyName:p,valueName:_}=e.toRefs(n);return(c,v)=>(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",$,[e.createElementVNode("h5",C,e.toDisplayString(e.unref(u)),1),e.createElementVNode("button",{onClick:r,class:"i-small pd-thin button-delete button"},"+")]),e.createElementVNode("div",S,[e.unref(o).length==0?(e.openBlock(),e.createElementBlock("p",z,e.toDisplayString(e.unref(m)),1)):e.createCommentVNode("",!0),e.unref(o).length==0?(e.openBlock(),e.createBlock(d._sfc_main,{key:1,onClick:r,class:"button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)),1)]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),(i,g)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-medium w-100 flex-nowrap flex",key:g},[e.createVNode(d.Field,{field:i[e.unref(p)],"onUpdate:field":f=>i[e.unref(p)]=f,placeholder:"Название параметра",class:"w-100 mn-r-small bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.Field,{field:i[e.unref(_)],"onUpdate:field":f=>i[e.unref(_)]=f,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("button",{onClick:f=>l(g),class:"mn-l-small button"},L,8,P)]))),128))])]))}},U={key:0,class:"mn-big"},A={class:"flex-column block"},D=["src"],F=["onClick"],R={__name:"EditProductImages",props:{product:Object},setup(s){function a(r){console.log(r),console.log(t.state.current.images),t.state.current.images.push(...r)}function n(r){t.state.current.images.splice(r,1)}return(r,l)=>(e.openBlock(),e.createElementBlock("div",null,[s.product.images.length<1?(e.openBlock(),e.createElementBlock("p",U," The product doesn't have any images yet. ")):e.createCommentVNode("",!0),e.createVNode(e.unref(y.VueDraggableNext),{class:"cols-4 dragArea list-group w-full",list:s.product.images,sort:!0,onChange:r.log},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.product.images,(o,u)=>(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("img",{class:"w-100 mn-small",src:(r.FILE_SERVER_URL||"")+o},null,8,D),e.createElementVNode("a",{onClick:m=>n(u),class:"w-100 br-grey br-solid br-1px button"},"Удалить",8,F)]))),256))]),_:1},8,["list","onChange"]),e.createVNode(B._sfc_main,{"onUpdate:images":a,uploadPath:"organizations/"+r.$route.params._id+"/products",class:"mn-t-semi pd-small w-100 button bg-main"},null,8,["uploadPath"])]))}};const M={class:"for-transition w-100"},T={class:"pd-b-zero pd-t-zero pd-thin"},j={class:"pd-thin"},O={class:"flex-nowrap flex bg-grey pd-medium radius-big"},G={key:0,class:"mn-r-auto"},H={key:1,class:"mn-r-auto"},J={class:"flex-nowrap flex pd-thin"},K={class:"pd-b-zero pd-t-zero pd-thin cols-2 gap-thin"},Q={class:"mn-thin bg-grey pd-medium o-hidden radius-big"},W=e.createElementVNode("h3",{class:"mn-semi"},"Profile",-1),X={class:"mn-semi"},Y=e.createElementVNode("h5",null,"Categories",-1),Z={class:""},ee={class:"mn-thin bg-grey pd-medium o-hidden radius-big"},te=e.createElementVNode("h3",{class:"mn-semi"},"Images",-1),re={__name:"ProductEdit",async setup(s){let a,n;const r=b.useRoute(),l=b.useRouter();[a,n]=e.withAsyncContext(()=>t.actions.fetchCategories()),await a,n(),r.params.product&&([a,n]=e.withAsyncContext(()=>t.actions$1.read({_id:r.params.product})),await a,n());function o(){t.state.current.information.push({name:"",value:""})}function u(c){t.state.current.information.splice(c,1)}function m(){t.state.current.localization.push({locale:"",text:""})}function h(c){t.state.current.localization.splice(c,1)}function p(){r.params.product?t.actions$1.update(r.params.product,t.state.current):t.actions$1.create(r.params._id,t.state.current)}function _(){l.push({name:"ProductEdit",params:{_id:r.params._id,product:t.state.current._id}})}return(c,v)=>(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",T,[e.createVNode(t._sfc_main,{class:"pd-medium bg-grey radius-big"})]),e.createElementVNode("div",j,[e.createElementVNode("header",O,[e.unref(r).params.product?(e.openBlock(),e.createElementBlock("h1",G,"Edit Product")):(e.openBlock(),e.createElementBlock("h1",H,"Create Product")),e.createElementVNode("section",J,[e.createVNode(d._sfc_main,{submit:p,callback:_},{default:e.withCtx(()=>[e.createTextVNode("Save Product")]),_:1})])])]),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[W,e.createVNode(x,{product:t.state.current},null,8,["product"]),e.createElementVNode("div",X,[Y,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state$1.all,(i,g)=>(e.openBlock(),e.createBlock(k.Checkbox,{label:i.name,name:"categories",value:i.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category},null,8,["label","value","radio"]))),256))]),e.createVNode(N,{items:t.state.current.information,title:"Parameters",emptyMessage:"No parameters",addButtonLabel:"Add parameter",keyName:"name",valueName:"value",onAddInfo:o,onDeleteInfo:u},null,8,["items"]),e.createVNode(N,{items:t.state.current.localization,title:"Localization",emptyMessage:"No localizations",addButtonLabel:"Add localization",keyName:"locale",valueName:"text",onAddInfo:m,onDeleteInfo:h},null,8,["items"])]),e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[te,e.createVNode(R,{product:t.state.current},null,8,["product"])])])])]))}};exports.default=re;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("vue-router"),t=require("./organizations.client-85a2ae66.js");require("./inputs.validation-24ae76b9.js");require("./index-7ecbf72a.js");require("./Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-0ea8fbf8.js");const k=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-f3d37f29.js"),d=require("./Button-ee08e6bf.js");require("vue-i18n");require("./Chips-493042f7.js");const E=require("./Select-b9299fb6.js"),V=require("./vuex.esm-bundler-e8cf3cd2.js"),y=require("./vue-draggable-next.esm-bundler-80731ae0.js"),B=require("./UploadImageMultiple-297b3897.js");require("./globals-928eb13c.js");require("./Tab-6f0a4909.js");require("./ButtonFollow-7c0180b3.js");require("./auth-2f9b2dfc.js");require("./_plugin-vue_export-helper-f246444f.js");require("./Feed-bfd7d1d9.js");require("./EmptyState-7658d7d6.js");require("./IconEdit-4cfe2115.js");require("./Feed-aee74095.js");require("./Socials-821bd677.js");require("./CardOrganization-bf366e4e.js");require("./organizations-bb8f676d.js");require("./UploadImage-33f6a9f4.js");require("./Publics-4438ca51.js");require("./auth.validation-30bb0efd.js");const w={class:"mn-big flex-column flex"},x={__name:"EditProductInfo",props:{product:Object},setup(s){const a=s,n=V.useStore();return e.toRefs(a),(r,l)=>(e.openBlock(),e.createElementBlock("div",w,[e.createTextVNode(e.toDisplayString(e.unref(n).products.current)+" ",1),e.createVNode(E.Select,{options:["unpublished","published","archivied"],select:e.unref(n).products.state.current.status,"onUpdate:select":l[0]||(l[0]=o=>e.unref(n).products.state.current.status=o),placeholder:"Display product",class:"w-100 mn-small bg-white radius-small pd-medium"},null,8,["select"]),e.createVNode(d.Field,{field:e.unref(n).products.state.current.name,"onUpdate:field":l[1]||(l[1]=o=>e.unref(n).products.state.current.name=o),placeholder:"Введите название",class:"w-100 mn-small bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.Field,{field:e.unref(n).products.state.current.price,"onUpdate:field":l[2]||(l[2]=o=>e.unref(n).products.state.current.price=o),placeholder:"Введите цену",class:"w-100 mn-small bg-white radius-small pd-medium",type:"number"},null,8,["field"]),e.createVNode(d.Field,{field:e.unref(n).products.state.current.description,"onUpdate:field":l[3]||(l[3]=o=>e.unref(n).products.state.current.description=o),placeholder:"Введите описание",class:"w-100 mn-small bg-white radius-small pd-medium",type:"textarea"},null,8,["field"])]))}},q={class:"mn-big"},$={class:"mn-small flex-nowrap flex"},C={class:"mn-r-thin"},S={class:"flex-column flex"},z={key:0,class:"w-100 mn-small"},P=["onClick"],I=e.createElementVNode("svg",{class:"i-small",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"clip-rule":"evenodd",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",fill:"#8a8a8a","fill-rule":"evenodd"})],-1),L=[I],N={__name:"EditParameters",props:{items:{type:Array,default:()=>[]},title:String,addButtonLabel:String,emptyMessage:String,keyName:String,valueName:String},emits:["add-info","delete-info"],setup(s,{emit:a}){const n=s;function r(){a("add-info",{})}function l(c){a("delete-info",c)}const{items:o,title:u,emptyMessage:m,addButtonLabel:h,keyName:p,valueName:_}=e.toRefs(n);return(c,v)=>(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",$,[e.createElementVNode("h5",C,e.toDisplayString(e.unref(u)),1),e.createElementVNode("button",{onClick:r,class:"i-small pd-thin button-delete button"},"+")]),e.createElementVNode("div",S,[e.unref(o).length==0?(e.openBlock(),e.createElementBlock("p",z,e.toDisplayString(e.unref(m)),1)):e.createCommentVNode("",!0),e.unref(o).length==0?(e.openBlock(),e.createBlock(d._sfc_main,{key:1,onClick:r,class:"button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)),1)]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),(i,g)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-medium w-100 flex-nowrap flex",key:g},[e.createVNode(d.Field,{field:i[e.unref(p)],"onUpdate:field":f=>i[e.unref(p)]=f,placeholder:"Название параметра",class:"w-100 mn-r-small bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.Field,{field:i[e.unref(_)],"onUpdate:field":f=>i[e.unref(_)]=f,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("button",{onClick:f=>l(g),class:"mn-l-small button"},L,8,P)]))),128))])]))}},U={key:0,class:"mn-big"},A={class:"flex-column block"},D=["src"],F=["onClick"],R={__name:"EditProductImages",props:{product:Object},setup(s){function a(r){console.log(r),console.log(t.state.current.images),t.state.current.images.push(...r)}function n(r){t.state.current.images.splice(r,1)}return(r,l)=>(e.openBlock(),e.createElementBlock("div",null,[s.product.images.length<1?(e.openBlock(),e.createElementBlock("p",U," The product doesn't have any images yet. ")):e.createCommentVNode("",!0),e.createVNode(e.unref(y.VueDraggableNext),{class:"cols-4 dragArea list-group w-full",list:s.product.images,sort:!0,onChange:r.log},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.product.images,(o,u)=>(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("img",{class:"w-100 mn-small",src:(r.FILE_SERVER_URL||"")+o},null,8,D),e.createElementVNode("a",{onClick:m=>n(u),class:"w-100 br-grey br-solid br-1px button"},"Удалить",8,F)]))),256))]),_:1},8,["list","onChange"]),e.createVNode(B._sfc_main,{"onUpdate:images":a,uploadPath:"organizations/"+r.$route.params._id+"/products",class:"mn-t-semi pd-small w-100 button bg-main"},null,8,["uploadPath"])]))}};const M={class:"for-transition w-100"},T={class:"pd-b-zero pd-t-zero pd-thin"},j={class:"pd-thin"},O={class:"flex-nowrap flex bg-grey pd-medium radius-big"},G={key:0,class:"mn-r-auto"},H={key:1,class:"mn-r-auto"},J={class:"flex-nowrap flex pd-thin"},K={class:"pd-b-zero pd-t-zero pd-thin cols-2 gap-thin"},Q={class:"mn-thin bg-grey pd-medium o-hidden radius-big"},W=e.createElementVNode("h3",{class:"mn-semi"},"Profile",-1),X={class:"mn-semi"},Y=e.createElementVNode("h5",null,"Categories",-1),Z={class:""},ee={class:"mn-thin bg-grey pd-medium o-hidden radius-big"},te=e.createElementVNode("h3",{class:"mn-semi"},"Images",-1),re={__name:"ProductEdit",async setup(s){let a,n;const r=b.useRoute(),l=b.useRouter();[a,n]=e.withAsyncContext(()=>t.actions.fetchCategories()),await a,n(),r.params.product&&([a,n]=e.withAsyncContext(()=>t.actions$1.read({_id:r.params.product})),await a,n());function o(){t.state.current.information.push({name:"",value:""})}function u(c){t.state.current.information.splice(c,1)}function m(){t.state.current.localization.push({locale:"",text:""})}function h(c){t.state.current.localization.splice(c,1)}function p(){r.params.product?t.actions$1.update(r.params.product,t.state.current):t.actions$1.create(r.params._id,t.state.current)}function _(){l.push({name:"ProductEdit",params:{_id:r.params._id,product:t.state.current._id}})}return(c,v)=>(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",T,[e.createVNode(t._sfc_main,{class:"pd-medium bg-grey radius-big"})]),e.createElementVNode("div",j,[e.createElementVNode("header",O,[e.unref(r).params.product?(e.openBlock(),e.createElementBlock("h1",G,"Edit Product")):(e.openBlock(),e.createElementBlock("h1",H,"Create Product")),e.createElementVNode("section",J,[e.createVNode(d._sfc_main,{submit:p,callback:_},{default:e.withCtx(()=>[e.createTextVNode("Save Product")]),_:1})])])]),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[W,e.createVNode(x,{product:t.state.current},null,8,["product"]),e.createElementVNode("div",X,[Y,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state$1.all,(i,g)=>(e.openBlock(),e.createBlock(k.Checkbox,{label:i.name,name:"categories",value:i.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category},null,8,["label","value","radio"]))),256))]),e.createVNode(N,{items:t.state.current.information,title:"Parameters",emptyMessage:"No parameters",addButtonLabel:"Add parameter",keyName:"name",valueName:"value",onAddInfo:o,onDeleteInfo:u},null,8,["items"]),e.createVNode(N,{items:t.state.current.localization,title:"Localization",emptyMessage:"No localizations",addButtonLabel:"Add localization",keyName:"locale",valueName:"text",onAddInfo:m,onDeleteInfo:h},null,8,["items"])]),e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[te,e.createVNode(R,{product:t.state.current},null,8,["product"])])])])]))}};exports.default=re;
|
@@ -0,0 +1,303 @@
|
|
1
|
+
import { toRefs as I, openBlock as n, createElementBlock as d, createTextVNode as C, toDisplayString as w, unref as e, createVNode as r, createElementVNode as t, createCommentVNode as k, createBlock as U, withCtx as z, Fragment as N, renderList as P, withAsyncContext as E } from "vue";
|
2
|
+
import { useRoute as B, useRouter as V } from "vue-router";
|
3
|
+
import { s as l, a as R, b as $, _ as D, c as j } from "./organizations.client-91e84d4f.mjs";
|
4
|
+
import "./inputs.validation-14e8e01f.mjs";
|
5
|
+
import "./index-0ab9d59c.mjs";
|
6
|
+
import "./Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-4ed993c7.mjs";
|
7
|
+
import { C as F } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-19e23006.mjs";
|
8
|
+
import { F as h, _ as L } from "./Button-d8e72ac0.mjs";
|
9
|
+
import "vue-i18n";
|
10
|
+
import "./Chips-9cf6c0da.mjs";
|
11
|
+
import { S as M } from "./Select-90d4b7c8.mjs";
|
12
|
+
import { u as O } from "./vuex.esm-bundler-57d8b6ba.mjs";
|
13
|
+
import { V as T } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
14
|
+
import { _ as q } from "./UploadImageMultiple-7b132ba0.mjs";
|
15
|
+
import "./globals-96ba60e4.mjs";
|
16
|
+
import "./Tab-a243605d.mjs";
|
17
|
+
import "./ButtonFollow-00d85977.mjs";
|
18
|
+
import "./auth-b047fdc0.mjs";
|
19
|
+
import "./_plugin-vue_export-helper-dad06003.mjs";
|
20
|
+
import "./Feed-27f62b1c.mjs";
|
21
|
+
import "./EmptyState-34d85f10.mjs";
|
22
|
+
import "./IconEdit-eacf3856.mjs";
|
23
|
+
import "./Feed-7c8c901a.mjs";
|
24
|
+
import "./Socials-8193477c.mjs";
|
25
|
+
import "./CardOrganization-3f4a13d3.mjs";
|
26
|
+
import "./organizations-aed4245d.mjs";
|
27
|
+
import "./UploadImage-f7b0335f.mjs";
|
28
|
+
import "./Publics-538180a8.mjs";
|
29
|
+
const G = { class: "mn-big flex-column flex" }, H = {
|
30
|
+
__name: "EditProductInfo",
|
31
|
+
props: {
|
32
|
+
product: Object
|
33
|
+
},
|
34
|
+
setup(u) {
|
35
|
+
const c = u, o = O();
|
36
|
+
return I(c), (s, i) => (n(), d("div", G, [
|
37
|
+
C(w(e(o).products.current) + " ", 1),
|
38
|
+
r(M, {
|
39
|
+
options: [
|
40
|
+
"unpublished",
|
41
|
+
"published",
|
42
|
+
"archivied"
|
43
|
+
],
|
44
|
+
select: e(o).products.state.current.status,
|
45
|
+
"onUpdate:select": i[0] || (i[0] = (a) => e(o).products.state.current.status = a),
|
46
|
+
placeholder: "Display product",
|
47
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
48
|
+
}, null, 8, ["select"]),
|
49
|
+
r(h, {
|
50
|
+
field: e(o).products.state.current.name,
|
51
|
+
"onUpdate:field": i[1] || (i[1] = (a) => e(o).products.state.current.name = a),
|
52
|
+
placeholder: "Введите название",
|
53
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
54
|
+
}, null, 8, ["field"]),
|
55
|
+
r(h, {
|
56
|
+
field: e(o).products.state.current.price,
|
57
|
+
"onUpdate:field": i[2] || (i[2] = (a) => e(o).products.state.current.price = a),
|
58
|
+
placeholder: "Введите цену",
|
59
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
60
|
+
type: "number"
|
61
|
+
}, null, 8, ["field"]),
|
62
|
+
r(h, {
|
63
|
+
field: e(o).products.state.current.description,
|
64
|
+
"onUpdate:field": i[3] || (i[3] = (a) => e(o).products.state.current.description = a),
|
65
|
+
placeholder: "Введите описание",
|
66
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
67
|
+
type: "textarea"
|
68
|
+
}, null, 8, ["field"])
|
69
|
+
]));
|
70
|
+
}
|
71
|
+
}, J = { class: "mn-big" }, K = { class: "mn-small flex-nowrap flex" }, Q = { class: "mn-r-thin" }, W = { class: "flex-column flex" }, X = {
|
72
|
+
key: 0,
|
73
|
+
class: "w-100 mn-small"
|
74
|
+
}, Y = ["onClick"], Z = /* @__PURE__ */ t("svg", {
|
75
|
+
class: "i-small",
|
76
|
+
fill: "none",
|
77
|
+
height: "20",
|
78
|
+
viewBox: "0 0 20 20",
|
79
|
+
width: "20",
|
80
|
+
xmlns: "http://www.w3.org/2000/svg"
|
81
|
+
}, [
|
82
|
+
/* @__PURE__ */ t("path", {
|
83
|
+
"clip-rule": "evenodd",
|
84
|
+
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",
|
85
|
+
fill: "#8a8a8a",
|
86
|
+
"fill-rule": "evenodd"
|
87
|
+
})
|
88
|
+
], -1), ee = [
|
89
|
+
Z
|
90
|
+
], S = {
|
91
|
+
__name: "EditParameters",
|
92
|
+
props: {
|
93
|
+
items: {
|
94
|
+
type: Array,
|
95
|
+
default: () => []
|
96
|
+
},
|
97
|
+
title: String,
|
98
|
+
addButtonLabel: String,
|
99
|
+
emptyMessage: String,
|
100
|
+
keyName: String,
|
101
|
+
valueName: String
|
102
|
+
},
|
103
|
+
emits: ["add-info", "delete-info"],
|
104
|
+
setup(u, { emit: c }) {
|
105
|
+
const o = u;
|
106
|
+
function s() {
|
107
|
+
c("add-info", {});
|
108
|
+
}
|
109
|
+
function i(m) {
|
110
|
+
c("delete-info", m);
|
111
|
+
}
|
112
|
+
const { items: a, title: _, emptyMessage: f, addButtonLabel: y, keyName: g, valueName: b } = I(o);
|
113
|
+
return (m, A) => (n(), d("div", J, [
|
114
|
+
t("div", K, [
|
115
|
+
t("h5", Q, w(e(_)), 1),
|
116
|
+
t("button", {
|
117
|
+
onClick: s,
|
118
|
+
class: "i-small pd-thin button-delete button"
|
119
|
+
}, "+")
|
120
|
+
]),
|
121
|
+
t("div", W, [
|
122
|
+
e(a).length == 0 ? (n(), d("p", X, w(e(f)), 1)) : k("", !0),
|
123
|
+
e(a).length == 0 ? (n(), U(L, {
|
124
|
+
key: 1,
|
125
|
+
onClick: s,
|
126
|
+
class: "button"
|
127
|
+
}, {
|
128
|
+
default: z(() => [
|
129
|
+
C(w(e(y)), 1)
|
130
|
+
]),
|
131
|
+
_: 1
|
132
|
+
})) : k("", !0),
|
133
|
+
(n(!0), d(N, null, P(e(a), (p, x) => (n(), d("div", {
|
134
|
+
class: "mn-medium w-100 flex-nowrap flex",
|
135
|
+
key: x
|
136
|
+
}, [
|
137
|
+
r(h, {
|
138
|
+
field: p[e(g)],
|
139
|
+
"onUpdate:field": (v) => p[e(g)] = v,
|
140
|
+
placeholder: "Название параметра",
|
141
|
+
class: "w-100 mn-r-small bg-white radius-small pd-medium"
|
142
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
143
|
+
r(h, {
|
144
|
+
field: p[e(b)],
|
145
|
+
"onUpdate:field": (v) => p[e(b)] = v,
|
146
|
+
placeholder: "Значение параметра",
|
147
|
+
class: "w-100 bg-white radius-small pd-medium"
|
148
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
149
|
+
t("button", {
|
150
|
+
onClick: (v) => i(x),
|
151
|
+
class: "mn-l-small button"
|
152
|
+
}, ee, 8, Y)
|
153
|
+
]))), 128))
|
154
|
+
])
|
155
|
+
]));
|
156
|
+
}
|
157
|
+
}, te = {
|
158
|
+
key: 0,
|
159
|
+
class: "mn-big"
|
160
|
+
}, se = { class: "flex-column block" }, oe = ["src"], ae = ["onClick"], le = {
|
161
|
+
__name: "EditProductImages",
|
162
|
+
props: {
|
163
|
+
product: Object
|
164
|
+
},
|
165
|
+
setup(u) {
|
166
|
+
function c(s) {
|
167
|
+
console.log(s), console.log(l.current.images), l.current.images.push(...s);
|
168
|
+
}
|
169
|
+
function o(s) {
|
170
|
+
l.current.images.splice(s, 1);
|
171
|
+
}
|
172
|
+
return (s, i) => (n(), d("div", null, [
|
173
|
+
u.product.images.length < 1 ? (n(), d("p", te, " The product doesn't have any images yet. ")) : k("", !0),
|
174
|
+
r(e(T), {
|
175
|
+
class: "cols-4 dragArea list-group w-full",
|
176
|
+
list: u.product.images,
|
177
|
+
sort: !0,
|
178
|
+
onChange: s.log
|
179
|
+
}, {
|
180
|
+
default: z(() => [
|
181
|
+
(n(!0), d(N, null, P(u.product.images, (a, _) => (n(), d("div", se, [
|
182
|
+
t("img", {
|
183
|
+
class: "w-100 mn-small",
|
184
|
+
src: (s.FILE_SERVER_URL || "") + a
|
185
|
+
}, null, 8, oe),
|
186
|
+
t("a", {
|
187
|
+
onClick: (f) => o(_),
|
188
|
+
class: "w-100 br-grey br-solid br-1px button"
|
189
|
+
}, "Удалить", 8, ae)
|
190
|
+
]))), 256))
|
191
|
+
]),
|
192
|
+
_: 1
|
193
|
+
}, 8, ["list", "onChange"]),
|
194
|
+
r(q, {
|
195
|
+
"onUpdate:images": c,
|
196
|
+
uploadPath: "organizations/" + s.$route.params._id + "/products",
|
197
|
+
class: "mn-t-semi pd-small w-100 button bg-main"
|
198
|
+
}, null, 8, ["uploadPath"])
|
199
|
+
]));
|
200
|
+
}
|
201
|
+
};
|
202
|
+
const ne = { class: "for-transition w-100" }, re = { class: "pd-b-zero pd-t-zero pd-thin" }, ie = { class: "pd-thin" }, de = { class: "flex-nowrap flex bg-grey pd-medium radius-big" }, ce = {
|
203
|
+
key: 0,
|
204
|
+
class: "mn-r-auto"
|
205
|
+
}, ue = {
|
206
|
+
key: 1,
|
207
|
+
class: "mn-r-auto"
|
208
|
+
}, me = { class: "flex-nowrap flex pd-thin" }, pe = { class: "pd-b-zero pd-t-zero pd-thin cols-2 gap-thin" }, _e = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, he = /* @__PURE__ */ t("h3", { class: "mn-semi" }, "Profile", -1), fe = { class: "mn-semi" }, ge = /* @__PURE__ */ t("h5", null, "Categories", -1), be = { class: "" }, ve = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, we = /* @__PURE__ */ t("h3", { class: "mn-semi" }, "Images", -1), Qe = {
|
209
|
+
__name: "ProductEdit",
|
210
|
+
async setup(u) {
|
211
|
+
let c, o;
|
212
|
+
const s = B(), i = V();
|
213
|
+
[c, o] = E(() => R.fetchCategories()), await c, o(), s.params.product && ([c, o] = E(() => $.read({ _id: s.params.product })), await c, o());
|
214
|
+
function a() {
|
215
|
+
l.current.information.push({ name: "", value: "" });
|
216
|
+
}
|
217
|
+
function _(m) {
|
218
|
+
l.current.information.splice(m, 1);
|
219
|
+
}
|
220
|
+
function f() {
|
221
|
+
l.current.localization.push({ locale: "", text: "" });
|
222
|
+
}
|
223
|
+
function y(m) {
|
224
|
+
l.current.localization.splice(m, 1);
|
225
|
+
}
|
226
|
+
function g() {
|
227
|
+
s.params.product ? $.update(s.params.product, l.current) : $.create(s.params._id, l.current);
|
228
|
+
}
|
229
|
+
function b() {
|
230
|
+
i.push({ name: "ProductEdit", params: { _id: s.params._id, product: l.current._id } });
|
231
|
+
}
|
232
|
+
return (m, A) => (n(), d("div", ne, [
|
233
|
+
t("div", re, [
|
234
|
+
r(D, { class: "pd-medium bg-grey radius-big" })
|
235
|
+
]),
|
236
|
+
t("div", ie, [
|
237
|
+
t("header", de, [
|
238
|
+
e(s).params.product ? (n(), d("h1", ce, "Edit Product")) : (n(), d("h1", ue, "Create Product")),
|
239
|
+
t("section", me, [
|
240
|
+
r(L, {
|
241
|
+
submit: g,
|
242
|
+
callback: b
|
243
|
+
}, {
|
244
|
+
default: z(() => [
|
245
|
+
C("Save Product")
|
246
|
+
]),
|
247
|
+
_: 1
|
248
|
+
})
|
249
|
+
])
|
250
|
+
])
|
251
|
+
]),
|
252
|
+
t("div", pe, [
|
253
|
+
t("div", _e, [
|
254
|
+
he,
|
255
|
+
r(H, {
|
256
|
+
product: l.current
|
257
|
+
}, null, 8, ["product"]),
|
258
|
+
t("div", fe, [
|
259
|
+
ge,
|
260
|
+
(n(!0), d(N, null, P(j.all, (p, x) => (n(), U(F, {
|
261
|
+
label: p.name,
|
262
|
+
name: "categories",
|
263
|
+
value: p.url,
|
264
|
+
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
265
|
+
radio: l.current.category
|
266
|
+
}, null, 8, ["label", "value", "radio"]))), 256))
|
267
|
+
]),
|
268
|
+
r(S, {
|
269
|
+
items: l.current.information,
|
270
|
+
title: "Parameters",
|
271
|
+
emptyMessage: "No parameters",
|
272
|
+
addButtonLabel: "Add parameter",
|
273
|
+
keyName: "name",
|
274
|
+
valueName: "value",
|
275
|
+
onAddInfo: a,
|
276
|
+
onDeleteInfo: _
|
277
|
+
}, null, 8, ["items"]),
|
278
|
+
r(S, {
|
279
|
+
items: l.current.localization,
|
280
|
+
title: "Localization",
|
281
|
+
emptyMessage: "No localizations",
|
282
|
+
addButtonLabel: "Add localization",
|
283
|
+
keyName: "locale",
|
284
|
+
valueName: "text",
|
285
|
+
onAddInfo: f,
|
286
|
+
onDeleteInfo: y
|
287
|
+
}, null, 8, ["items"])
|
288
|
+
]),
|
289
|
+
t("div", be, [
|
290
|
+
t("div", ve, [
|
291
|
+
we,
|
292
|
+
r(le, {
|
293
|
+
product: l.current
|
294
|
+
}, null, 8, ["product"])
|
295
|
+
])
|
296
|
+
])
|
297
|
+
])
|
298
|
+
]));
|
299
|
+
}
|
300
|
+
};
|
301
|
+
export {
|
302
|
+
Qe as default
|
303
|
+
};
|