@feedmepos/mf-menu-portal 1.0.4-dev.4 → 1.0.5-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-CrpoLCjA.js → App-B2xq1U4S.js} +699 -687
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CPh1GBw9.js} +11 -10
- package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-D3CmOOPY.js → BindingTable.vue_vue_type_script_setup_true_lang-DCgMQJE-.js} +50 -46
- package/dist/Catalog-BEI73S_k.js +433 -0
- package/dist/{CatalogBinding-BNATtZEY.js → CatalogBinding-3rhuTWDD.js} +30 -29
- package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-BmG-xpW4.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-CraEwqCY.js} +30 -29
- package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-BFsRDFpj.js → CatalogEditor.vue_vue_type_script_setup_true_lang-Dc72SNpI.js} +314 -304
- package/dist/CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-CMyubLvP.js +127 -0
- package/dist/{Category-DMoXTsfG.js → Category-BVCdkA5K.js} +14 -13
- package/dist/{Category-DxjdQ-NN.js → Category-P5DYjIeF.js} +2 -2
- package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-B3Ts1O-9.js → CategoryList.vue_vue_type_script_setup_true_lang-DyhW52Df.js} +274 -262
- package/dist/{CookingGuide-DiZZDYD-.js → CookingGuide-Y-c1NLP5.js} +144 -140
- package/dist/{Group-rzfh_o6r.js → Group-D6wA3jCF.js} +2 -2
- package/dist/{Group-DFR8q-tt.js → Group-qqr5SUIc.js} +17 -15
- package/dist/GroupList.vue_vue_type_script_setup_true_lang-DNTVfY2d.js +1996 -0
- package/dist/{Ingredient-DpjGIuH9.js → Ingredient-CJHkJZ0y.js} +94 -93
- package/dist/{LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CnI80Ojd.js → LinkProductSideSheet.vue_vue_type_script_setup_true_lang-Cb6nO43H.js} +1 -1
- package/dist/{MenuSetting-DR-pDSF_.js → MenuSetting-YcEGo51l.js} +462 -446
- package/dist/{OrderPacing-JcTuweqF.js → OrderPacing-DwQU7c0Y.js} +207 -204
- package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-HwwJ2mGv.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-2Cdz70u-.js} +1 -2
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-DrhsROXo.js +44 -0
- package/dist/PhoneFab.vue_vue_type_script_setup_true_lang-CipbTqbp.js +12 -0
- package/dist/{Preview-BZyun5lZ.js → Preview-DLeXy5V-.js} +2 -2
- package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-DquqNbE1.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-D_OV9Z_4.js} +1 -1
- package/dist/{PrintRoute-CzEx2dCt.js → PrintRoute-R38w0-U2.js} +151 -150
- package/dist/{Product-CQb0n06E.js → Product-sbMCaVhM.js} +8 -7
- package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-DoHQeOHy.js +7826 -0
- package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D9v88xZs.js +111 -0
- package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-CBlDEjqF.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-DsIGLKNS.js} +17 -17
- package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-D8NQTCLx.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-CEliG36Z.js} +726 -726
- package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-cG47Pu-6.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-B3bShTjM.js} +127 -124
- package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-0UwUcA2L.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-BzctosMW.js} +820 -807
- package/dist/{ProductInternalTools-QrBR1nFp.js → ProductInternalTools-jE3Ovo4l.js} +3 -3
- package/dist/{ProductInventoryDialog-fV38GO1a.js → ProductInventoryDialog-EDlrXupB.js} +1 -1
- package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-Bzb3RrMg.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-LOwSpoiA.js} +1 -1
- package/dist/{ProductList.vue_vue_type_script_setup_true_lang-BwKQESr3.js → ProductList.vue_vue_type_script_setup_true_lang-rczFAWVa.js} +1135 -1098
- package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-CDYcHXo1.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-C4iK-sAd.js} +1 -1
- package/dist/{Products-B8tysOAL.js → Products-DUE10OyS.js} +51 -49
- package/dist/Publish-BlMxKniP.js +1300 -0
- package/dist/{Recipe-Ddx31csF.js → Recipe-BhjPAidT.js} +83 -82
- package/dist/{Scheduler-CST5L_cw.js → Scheduler-wKG3_D1f.js} +137 -136
- package/dist/{ServingSequence-DYyEZI2S.js → ServingSequence-B26BETQs.js} +63 -61
- package/dist/Setting-DBdNl3WL.js +185 -0
- package/dist/{Subcategory-BIgjzVta.js → Subcategory-B06yMcuE.js} +147 -144
- package/dist/{Takeaway-CekhGM-m.js → Takeaway-CFATfy-6.js} +2 -2
- package/dist/{Takeaway-aXsPg4JT.js → Takeaway-DFqOtls7.js} +17 -16
- package/dist/TakeawayList.vue_vue_type_script_setup_true_lang-CUHB-g9I.js +616 -0
- package/dist/TextChip.vue_vue_type_script_setup_true_lang-YkUjMTXo.js +32 -0
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CshqYpc9.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DoS4Btzj.js} +281 -308
- package/dist/{Unit-BMW8u0Us.js → Unit-B5wKBmIT.js} +90 -89
- package/dist/{Variant-CZsrYRMU.js → Variant-C5ePu0za.js} +167 -174
- package/dist/{_id_-D4swrvNa.js → _id_-HRDqt6oD.js} +3 -3
- package/dist/{app-BWwwHsWi.js → app-CxJjx2ma.js} +39 -39
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +35 -0
- package/dist/apps/mf-menu/src/components/GroupList.vue.d.ts +8 -0
- package/dist/apps/mf-menu/src/components/Product/OrderFromChip.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/Product/ProductThumbnail.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +4 -2
- package/dist/apps/mf-menu/src/components/PublishList.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/layout/MobileXScrollable.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/components/layout/PageLayout.vue.d.ts +7 -0
- package/dist/apps/mf-menu/src/components/layout/PhoneFab.vue.d.ts +9 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{menu-compute-D7TdiHt4.js → menu-compute-CQdeCEBO.js} +19 -19
- package/dist/assets/{validate-menu-DXppWUVq.js → validate-menu-BVo4fNWG.js} +14 -14
- package/dist/mf-menu-portal.css +1 -1
- package/dist/{provide-CDmXzkhz.js → provide-BGLSDsuJ.js} +99816 -99564
- package/dist/{useActionFeedback-Dm2HDa_2.js → useActionFeedback-CElXij1W.js} +1 -1
- package/package.json +1 -1
- package/dist/Catalog-VU3HhNro.js +0 -374
- package/dist/CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Bk4FqVmx.js +0 -117
- package/dist/GroupList.vue_vue_type_script_setup_true_lang-DiN-wQXX.js +0 -1807
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js +0 -41
- package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js +0 -7931
- package/dist/Publish-DTvOvFNa.js +0 -1337
- package/dist/Setting-Ip0pGjks.js +0 -179
- package/dist/TakeawayList.vue_vue_type_script_setup_true_lang-CaRR4_j3.js +0 -554
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { components as te, useDialog as
|
|
4
|
-
import { _ as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { _ as
|
|
12
|
-
import { _ as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
1
|
+
import { defineComponent as De, computed as U, ref as Y, watch as ae, onMounted as Xe, onUnmounted as Ie, openBlock as m, createElementBlock as N, createElementVNode as g, createTextVNode as Re, toDisplayString as M, unref as o, isRef as be, createVNode as b, createBlock as F, createCommentVNode as T, withCtx as x, shallowRef as J, h as ge, withModifiers as he, resolveComponent as ie, renderSlot as pe, normalizeClass as we, Fragment as Ee, renderList as Ye, resolveDynamicComponent as Ze, withDirectives as ea, mergeProps as aa } from "vue";
|
|
2
|
+
import { useI18n as Me } from "@feedmepos/mf-common";
|
|
3
|
+
import { components as te, useDialog as ta, useBreakpoints as oa, FmButtonVariant as ke } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as la } from "./PhoneFab.vue_vue_type_script_setup_true_lang-CipbTqbp.js";
|
|
5
|
+
import { _ as na } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
|
|
6
|
+
import { f as sa } from "./ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-B3bShTjM.js";
|
|
7
|
+
import { useAppStore as ia } from "@feedmepos/mf-remy-panel";
|
|
8
|
+
import { _ as ra } from "./ListCountTag.vue_vue_type_script_setup_true_lang-0bjk8Aly.js";
|
|
9
|
+
import { _ as ua } from "./TranslationLanguageSelector.vue_vue_type_script_setup_true_lang-BJZ6VcrT.js";
|
|
10
|
+
import { _ as $e } from "./vuedraggable-CBtQLb_S.js";
|
|
11
|
+
import { _ as ca } from "./PageLayout.vue_vue_type_script_setup_true_lang-DrhsROXo.js";
|
|
12
|
+
import { _ as da } from "./app-CxJjx2ma.js";
|
|
13
|
+
import { _ as ma } from "./ProductEditorHost.vue_vue_type_script_setup_true_lang-DsIGLKNS.js";
|
|
14
|
+
import { _ as va } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-B0j2PNih.js";
|
|
15
|
+
import { u as ga } from "./useActionFeedback-CElXij1W.js";
|
|
16
|
+
import { u as Ve } from "./useEditorValidation-Ctef5Bxt.js";
|
|
17
|
+
import { b as pa, u as fa } from "./provide-BGLSDsuJ.js";
|
|
18
|
+
import { v as ya } from "./tableSemantics-C9WFO_I_.js";
|
|
19
|
+
const ba = {
|
|
18
20
|
key: 0,
|
|
19
21
|
class: "space-y-4"
|
|
20
|
-
},
|
|
22
|
+
}, ha = { class: "fm-typo-en-body-lg-600" }, wa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, ka = { class: "fm-typo-en-body-lg-600 pb-4" }, _a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xa = /* @__PURE__ */ De({
|
|
21
23
|
__name: "CategoryImageField",
|
|
22
24
|
props: {
|
|
23
25
|
thumbnailUrl: {},
|
|
@@ -25,19 +27,19 @@ const pa = {
|
|
|
25
27
|
disabled: { type: Boolean }
|
|
26
28
|
},
|
|
27
29
|
emits: ["select", "clear", "encoding"],
|
|
28
|
-
setup(fe, { emit:
|
|
29
|
-
const a = fe,
|
|
30
|
-
let
|
|
31
|
-
function
|
|
32
|
-
X !== i && (X = i,
|
|
30
|
+
setup(fe, { emit: w }) {
|
|
31
|
+
const a = fe, B = w, { t: R } = Me(), j = ia(), O = U(() => !!j.showRemy), r = Y(a.thumbnailUrl);
|
|
32
|
+
let V = null, E = 0, K = !1, v = !1, Q = !1, X = !1;
|
|
33
|
+
function h(i) {
|
|
34
|
+
X !== i && (X = i, B("encoding", i));
|
|
33
35
|
}
|
|
34
36
|
function p() {
|
|
35
|
-
|
|
37
|
+
V && URL.revokeObjectURL(V), V = null;
|
|
36
38
|
}
|
|
37
39
|
ae(
|
|
38
40
|
() => [a.thumbnailUrl, a.change],
|
|
39
41
|
() => {
|
|
40
|
-
a.change !== "selected" && (
|
|
42
|
+
a.change !== "selected" && (E++, h(!1), K = !1, v = !1, p(), r.value = a.change === "cleared" ? null : a.thumbnailUrl);
|
|
41
43
|
}
|
|
42
44
|
);
|
|
43
45
|
function G(i) {
|
|
@@ -45,13 +47,13 @@ const pa = {
|
|
|
45
47
|
const y = URL.createObjectURL(i), d = new Image();
|
|
46
48
|
d.onload = () => {
|
|
47
49
|
URL.revokeObjectURL(y);
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
50
|
+
const k = d.naturalWidth, D = d.naturalHeight;
|
|
51
|
+
if (!k || !D) {
|
|
50
52
|
c(new Error("Empty category image"));
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
|
-
const W = Math.max(
|
|
54
|
-
I.width = 2e3, I.height = Math.round(
|
|
55
|
+
const W = Math.max(k, D * 16 / 9), $ = Math.max(D, k * 9 / 16), _ = 2e3 / W, I = document.createElement("canvas");
|
|
56
|
+
I.width = 2e3, I.height = Math.round($ * _);
|
|
55
57
|
const q = I.getContext("2d");
|
|
56
58
|
if (!q) {
|
|
57
59
|
c(new Error("Category image canvas unavailable"));
|
|
@@ -64,10 +66,10 @@ const pa = {
|
|
|
64
66
|
}
|
|
65
67
|
q.fillStyle = ue, q.fillRect(0, 0, I.width, I.height), q.drawImage(
|
|
66
68
|
d,
|
|
67
|
-
(W -
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
(W - k) / 2 * _,
|
|
70
|
+
($ - D) / 2 * _,
|
|
71
|
+
k * _,
|
|
72
|
+
D * _
|
|
71
73
|
), I.toBlob(
|
|
72
74
|
(ne) => ne ? u(ne) : c(new Error("Category image encoding failed")),
|
|
73
75
|
"image/png"
|
|
@@ -80,37 +82,37 @@ const pa = {
|
|
|
80
82
|
async function oe(i) {
|
|
81
83
|
const u = Array.isArray(i) ? i[0] : i;
|
|
82
84
|
if (!u || a.disabled) return;
|
|
83
|
-
const c = ++
|
|
84
|
-
|
|
85
|
+
const c = ++E;
|
|
86
|
+
h(!0);
|
|
85
87
|
try {
|
|
86
88
|
const y = await G(u);
|
|
87
|
-
if (c !==
|
|
88
|
-
p(),
|
|
89
|
+
if (c !== E) return;
|
|
90
|
+
p(), V = URL.createObjectURL(y), K = !0, v = !1, r.value = V;
|
|
89
91
|
} catch {
|
|
90
|
-
c ===
|
|
92
|
+
c === E && h(!1);
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
function l(i) {
|
|
94
|
-
if (!K && !
|
|
95
|
-
const u = ++
|
|
96
|
-
|
|
96
|
+
if (!K && !v || a.disabled || !i.canvas) return;
|
|
97
|
+
const u = ++E, { width: c, height: y } = i.canvas;
|
|
98
|
+
h(!0), i.canvas.toBlob(
|
|
97
99
|
(d) => {
|
|
98
|
-
u ===
|
|
100
|
+
u === E && (d && B("select", {
|
|
99
101
|
bytes: d,
|
|
100
102
|
contentType: d.type || "image/jpeg",
|
|
101
103
|
width: c,
|
|
102
104
|
height: y
|
|
103
|
-
}),
|
|
105
|
+
}), h(!1));
|
|
104
106
|
},
|
|
105
107
|
"image/jpeg",
|
|
106
108
|
0.75
|
|
107
109
|
);
|
|
108
110
|
}
|
|
109
111
|
function le() {
|
|
110
|
-
|
|
112
|
+
E++, h(!1);
|
|
111
113
|
}
|
|
112
114
|
function re() {
|
|
113
|
-
a.disabled || (
|
|
115
|
+
a.disabled || (E++, h(!1), K = !1, v = !1, Q = !1, p(), r.value = null, B("clear"));
|
|
114
116
|
}
|
|
115
117
|
async function Z() {
|
|
116
118
|
if (a.disabled || !r.value) return;
|
|
@@ -120,34 +122,34 @@ const pa = {
|
|
|
120
122
|
if (u.ok) {
|
|
121
123
|
const c = await u.blob();
|
|
122
124
|
i = await new Promise((y, d) => {
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
+
const k = new FileReader();
|
|
126
|
+
k.onload = () => y(String(k.result)), k.onerror = () => d(k.error), k.readAsDataURL(c);
|
|
125
127
|
});
|
|
126
128
|
}
|
|
127
129
|
} catch {
|
|
128
130
|
}
|
|
129
131
|
Q = !0, j.activate({ imageData: i, command: "modifyImage" });
|
|
130
132
|
}
|
|
131
|
-
function
|
|
133
|
+
function z(i) {
|
|
132
134
|
var c;
|
|
133
135
|
if (!Q || a.disabled) return;
|
|
134
136
|
const u = (c = i.detail) == null ? void 0 : c.imageData;
|
|
135
|
-
typeof u != "string" || !u || (Q = !1,
|
|
136
|
-
}
|
|
137
|
-
return
|
|
138
|
-
window.removeEventListener("apply-image",
|
|
139
|
-
}), (i, u) => r.value ? (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
typeof u != "string" || !u || (Q = !1, E++, h(!0), K = !0, v = !1, p(), r.value = u);
|
|
138
|
+
}
|
|
139
|
+
return Xe(() => window.addEventListener("apply-image", z)), Ie(() => {
|
|
140
|
+
window.removeEventListener("apply-image", z), E++, h(!1), p();
|
|
141
|
+
}), (i, u) => r.value ? (m(), N("div", ba, [
|
|
142
|
+
g("p", ha, [
|
|
143
|
+
Re(M(o(R)("menu.common.labels.category_image")) + " ", 1),
|
|
144
|
+
g("span", wa, M(o(R)("menu.common.labels.optional")), 1)
|
|
143
145
|
]),
|
|
144
|
-
|
|
146
|
+
g("div", {
|
|
145
147
|
class: "relative h-[150px] w-[200px] overflow-hidden rounded-md border-2 border-dashed border-fm-color-neutral-gray-300",
|
|
146
|
-
onPointerdown: u[0] || (u[0] = (c) => be(
|
|
147
|
-
onWheel: u[1] || (u[1] = (c) => be(
|
|
148
|
-
onKeydown: u[2] || (u[2] = (c) => be(
|
|
148
|
+
onPointerdown: u[0] || (u[0] = (c) => be(v) ? v.value = !0 : v = !0),
|
|
149
|
+
onWheel: u[1] || (u[1] = (c) => be(v) ? v.value = !0 : v = !0),
|
|
150
|
+
onKeydown: u[2] || (u[2] = (c) => be(v) ? v.value = !0 : v = !0)
|
|
149
151
|
}, [
|
|
150
|
-
b(o(
|
|
152
|
+
b(o(sa), {
|
|
151
153
|
class: "h-[150px] w-[200px]",
|
|
152
154
|
src: r.value,
|
|
153
155
|
"stencil-props": { handlers: {}, movable: !1, scalable: !1 },
|
|
@@ -157,66 +159,60 @@ const pa = {
|
|
|
157
159
|
onError: le
|
|
158
160
|
}, null, 8, ["src"]),
|
|
159
161
|
b(o(te).FmButton, {
|
|
160
|
-
"aria-label": o(
|
|
162
|
+
"aria-label": o(R)("menu.category.image.remove"),
|
|
161
163
|
disabled: i.disabled,
|
|
162
|
-
label: o(
|
|
164
|
+
label: o(R)("menu.category.image.remove"),
|
|
163
165
|
class: "!absolute right-12 top-12 z-10 !h-24 !w-24 !rounded-full !p-0",
|
|
164
166
|
"bg-color": "neutral-white",
|
|
165
167
|
icon: "close",
|
|
166
168
|
variant: "tertiary",
|
|
167
169
|
onClick: re
|
|
168
170
|
}, null, 8, ["aria-label", "disabled", "label"]),
|
|
169
|
-
O.value ? (
|
|
171
|
+
O.value ? (m(), F(o(te).FmButton, {
|
|
170
172
|
key: 0,
|
|
171
|
-
"aria-label": o(
|
|
173
|
+
"aria-label": o(R)("menu.remy.title"),
|
|
172
174
|
disabled: i.disabled,
|
|
173
|
-
label: o(
|
|
175
|
+
label: o(R)("menu.remy.title"),
|
|
174
176
|
class: "!absolute right-12 top-[44px] z-10 !h-24 !w-24 !rounded-full !p-0",
|
|
175
177
|
"bg-color": "neutral-white",
|
|
176
178
|
icon: "auto_awesome",
|
|
177
179
|
variant: "tertiary",
|
|
178
180
|
onClick: Z
|
|
179
|
-
}, null, 8, ["aria-label", "disabled", "label"])) :
|
|
181
|
+
}, null, 8, ["aria-label", "disabled", "label"])) : T("", !0)
|
|
180
182
|
], 32)
|
|
181
|
-
])) : (
|
|
183
|
+
])) : (m(), F(o(te).FmDropField, {
|
|
182
184
|
key: 1,
|
|
183
185
|
accept: ".jpg, .jpeg, .png, .gif, .JPG, .JPEG, .PNG, .GIF",
|
|
184
186
|
"content-class": "h-[150px] w-[200px]",
|
|
185
187
|
disabled: i.disabled,
|
|
186
188
|
onFileUpload: oe
|
|
187
189
|
}, {
|
|
188
|
-
label:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
label: x(() => [
|
|
191
|
+
g("p", ka, [
|
|
192
|
+
Re(M(o(R)("menu.common.labels.category_image")) + " ", 1),
|
|
193
|
+
g("span", _a, M(o(R)("menu.common.labels.optional")), 1)
|
|
192
194
|
])
|
|
193
195
|
]),
|
|
194
|
-
"accept-text":
|
|
195
|
-
|
|
196
|
+
"accept-text": x(() => [
|
|
197
|
+
g("p", Ca, M(o(R)("menu.common.file.accepts")), 1)
|
|
196
198
|
]),
|
|
197
199
|
_: 1
|
|
198
200
|
}, 8, ["disabled"]));
|
|
199
201
|
}
|
|
200
|
-
}),
|
|
202
|
+
}), Sa = {
|
|
201
203
|
key: 0,
|
|
202
204
|
class: "flex-1 flex justify-between gap-8 pl-8"
|
|
203
|
-
},
|
|
205
|
+
}, Pa = { class: "flex items-center" }, La = {
|
|
204
206
|
key: 1,
|
|
205
207
|
class: "flex items-center gap-8 ml-auto"
|
|
206
|
-
},
|
|
208
|
+
}, Ua = {
|
|
207
209
|
key: 0,
|
|
208
210
|
class: "text-fm-color-typo-secondary",
|
|
209
211
|
role: "alert"
|
|
210
|
-
},
|
|
212
|
+
}, Fa = {
|
|
211
213
|
key: 1,
|
|
212
214
|
class: "text-fm-color-typo-secondary"
|
|
213
|
-
},
|
|
214
|
-
key: 4,
|
|
215
|
-
class: "flex-1 flex flex-col min-h-0"
|
|
216
|
-
}, Fa = { class: "p-8" }, Pa = { class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64" }, Ra = ["onClick"], Ea = { class: "min-w-0 flex-1 space-y-4" }, $a = { class: "fm-typo-en-body-lg-600 break-words" }, Va = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ia = {
|
|
217
|
-
key: 0,
|
|
218
|
-
class: "fixed right-16 bottom-[72px] z-[100]"
|
|
219
|
-
}, Da = { class: "w-[320px]" }, Ma = { class: "fm-typo-en-title-md-600" }, Ba = { class: "flex flex-col gap-32 h-full min-h-0 py-16" }, za = { class: "flex gap-24 items-center" }, Ta = { class: "text-fm-color-typo-secondary" }, ja = { class: "flex-1" }, Oa = { class: "flex-1 overflow-hidden min-h-[300px]" }, Aa = { class: "flex gap-8 items-center justify-start" }, nt = /* @__PURE__ */ Ve({
|
|
215
|
+
}, Ra = { class: "p-8" }, Ea = { class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64" }, $a = ["onClick"], Va = { class: "min-w-0 flex-1 space-y-4" }, Da = { class: "fm-typo-en-body-lg-600 break-words" }, Ia = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ma = { class: "w-[320px]" }, Ba = { class: "fm-typo-en-title-md-600" }, za = { class: "flex flex-col gap-32 h-full min-h-0 py-16" }, Ta = { class: "flex gap-24 items-center" }, ja = { class: "text-fm-color-typo-secondary" }, Oa = { class: "flex-1" }, Aa = { class: "flex-1 overflow-hidden min-h-[300px]" }, Na = { class: "flex gap-8 items-center justify-start" }, rt = /* @__PURE__ */ De({
|
|
220
216
|
__name: "CategoryList",
|
|
221
217
|
props: {
|
|
222
218
|
sdk: {},
|
|
@@ -224,13 +220,13 @@ const pa = {
|
|
|
224
220
|
heading: { default: "" }
|
|
225
221
|
},
|
|
226
222
|
setup(fe) {
|
|
227
|
-
const
|
|
223
|
+
const w = fe, { t: a } = Me(), B = pa(), R = ta(), { run: j } = ga(), O = fa(w.sdk.category.list), r = U(
|
|
228
224
|
() => O.value.status === "ready" ? O.value.value : null
|
|
229
|
-
),
|
|
225
|
+
), V = U(() => {
|
|
230
226
|
var e;
|
|
231
227
|
return ((e = r.value) == null ? void 0 : e.query) ?? "";
|
|
232
|
-
}), { breakpoints:
|
|
233
|
-
|
|
228
|
+
}), { breakpoints: E } = oa(), K = U(() => E.value.xs), v = Y(!1), Q = Y(0), X = Y(!1), h = Y(""), p = J(
|
|
229
|
+
w.sdk.category.editor()
|
|
234
230
|
), G = J(
|
|
235
231
|
p.value.get()
|
|
236
232
|
);
|
|
@@ -239,83 +235,83 @@ const pa = {
|
|
|
239
235
|
});
|
|
240
236
|
const l = U(
|
|
241
237
|
() => G.value.status === "ready" ? G.value.value : null
|
|
242
|
-
), le =
|
|
238
|
+
), le = Ve(() => p.value), re = U(
|
|
243
239
|
() => l.value ? le.issue(l.value.fieldIssues, "name") ?? l.value.nameIssue : null
|
|
244
|
-
), Z = Y(!1),
|
|
240
|
+
), Z = Y(!1), z = J(null), i = J({ status: "loading" });
|
|
245
241
|
let u = null;
|
|
246
242
|
const c = U(
|
|
247
243
|
() => i.value.status === "ready" ? i.value.value : null
|
|
248
|
-
), y = Y(!1), d = J(null),
|
|
244
|
+
), y = Y(!1), d = J(null), k = Ve(() => d.value), D = J({
|
|
249
245
|
status: "loading"
|
|
250
246
|
}), W = U(
|
|
251
|
-
() =>
|
|
247
|
+
() => D.value.status === "ready" ? D.value.value : null
|
|
252
248
|
);
|
|
253
|
-
let
|
|
249
|
+
let $ = null, _ = null;
|
|
254
250
|
function I() {
|
|
255
251
|
var e;
|
|
256
|
-
|
|
252
|
+
_ == null || _(), _ = null, (e = d.value) == null || e.dispose(), d.value = null, $ == null || $.dispose(), $ = null, D.value = { status: "loading" };
|
|
257
253
|
}
|
|
258
254
|
function q(e, t) {
|
|
259
255
|
var n;
|
|
260
|
-
|
|
256
|
+
_ == null || _(), (n = d.value) == null || n.dispose(), d.value = w.sdk.item.editor(e, {
|
|
261
257
|
initialCategoryId: t
|
|
262
|
-
}),
|
|
263
|
-
|
|
258
|
+
}), D.value = d.value.get(), _ = d.value.subscribe((C) => {
|
|
259
|
+
D.value = C;
|
|
264
260
|
});
|
|
265
261
|
}
|
|
266
262
|
function ue() {
|
|
267
263
|
var t, n;
|
|
268
264
|
const e = (t = l.value) == null ? void 0 : t.categoryId;
|
|
269
|
-
!e || ((n = l.value) == null ? void 0 : n.products.state) !== "allowed" || (I(),
|
|
265
|
+
!e || ((n = l.value) == null ? void 0 : n.products.state) !== "allowed" || (I(), $ = w.sdk.item.editorScope(), q(void 0, e), y.value = !0);
|
|
270
266
|
}
|
|
271
267
|
function ne(e) {
|
|
272
268
|
var t;
|
|
273
|
-
((t = l.value) == null ? void 0 : t.products.state) === "allowed" && (I(),
|
|
269
|
+
((t = l.value) == null ? void 0 : t.products.state) === "allowed" && (I(), $ = w.sdk.item.editorScope(), q(e.id), y.value = !0);
|
|
274
270
|
}
|
|
275
|
-
function
|
|
271
|
+
function Be(e) {
|
|
276
272
|
var n;
|
|
277
273
|
const t = ((n = W.value) == null ? void 0 : n.itemId) ?? void 0;
|
|
278
|
-
|
|
274
|
+
$ == null || $.select(e), q(t);
|
|
279
275
|
}
|
|
280
|
-
async function
|
|
276
|
+
async function ze() {
|
|
281
277
|
const e = d.value;
|
|
282
278
|
if (!e) return;
|
|
283
279
|
(await j(
|
|
284
|
-
() =>
|
|
280
|
+
() => k.submit(() => e.submit()),
|
|
285
281
|
{
|
|
286
282
|
showLoading: () => {
|
|
287
283
|
var n;
|
|
288
284
|
return ((n = W.value) == null ? void 0 : n.status) === "submitting";
|
|
289
285
|
},
|
|
290
|
-
successMessage: W.value ?
|
|
286
|
+
successMessage: W.value ? B(W.value.saveMessage) : ""
|
|
291
287
|
}
|
|
292
288
|
)).kind === "success" && d.value === e && (y.value = !1);
|
|
293
289
|
}
|
|
294
290
|
function H(e) {
|
|
295
291
|
var t;
|
|
296
|
-
u == null || u(), u = null, e && ((t =
|
|
292
|
+
u == null || u(), u = null, e && ((t = z.value) == null || t.dispose()), z.value = null, i.value = { status: "loading" }, Z.value = !1;
|
|
297
293
|
}
|
|
298
|
-
function
|
|
294
|
+
function Te() {
|
|
299
295
|
var t;
|
|
300
296
|
if (((t = l.value) == null ? void 0 : t.translation.state) !== "allowed") return;
|
|
301
297
|
H(!0);
|
|
302
298
|
const e = p.value.translationEditor();
|
|
303
|
-
|
|
299
|
+
z.value = e, i.value = e.get(), u = e.subscribe((n) => {
|
|
304
300
|
i.value = n;
|
|
305
301
|
}), Z.value = !0;
|
|
306
302
|
}
|
|
307
|
-
function
|
|
303
|
+
function je(e) {
|
|
308
304
|
var C;
|
|
309
|
-
const t =
|
|
305
|
+
const t = z.value, n = (C = c.value) == null ? void 0 : C.nameLocale;
|
|
310
306
|
if (!(!t || !n)) {
|
|
311
307
|
for (const f of Object.keys(n))
|
|
312
308
|
f in e || t.removeLocale(f);
|
|
313
|
-
for (const [f,
|
|
314
|
-
f in n || t.addLocale(f), t.setNameLocale(f,
|
|
309
|
+
for (const [f, S] of Object.entries(e))
|
|
310
|
+
f in n || t.addLocale(f), t.setNameLocale(f, S);
|
|
315
311
|
}
|
|
316
312
|
}
|
|
317
|
-
async function
|
|
318
|
-
const e =
|
|
313
|
+
async function Oe() {
|
|
314
|
+
const e = z.value;
|
|
319
315
|
if (!e) return;
|
|
320
316
|
(await j(async () => e.apply(), {
|
|
321
317
|
showLoading: !1
|
|
@@ -324,37 +320,37 @@ const pa = {
|
|
|
324
320
|
function _e() {
|
|
325
321
|
H(!0);
|
|
326
322
|
}
|
|
327
|
-
function
|
|
323
|
+
function Ae(e) {
|
|
328
324
|
e ? Z.value = !0 : _e();
|
|
329
325
|
}
|
|
330
|
-
function
|
|
331
|
-
H(!0), oe(), p.value.dispose(), p.value =
|
|
326
|
+
function Ce(e) {
|
|
327
|
+
H(!0), oe(), p.value.dispose(), p.value = w.sdk.category.editor(e), Q.value++, X.value = !1, G.value = p.value.get(), oe = p.value.subscribe((t) => {
|
|
332
328
|
G.value = t;
|
|
333
329
|
});
|
|
334
330
|
}
|
|
335
331
|
function ye() {
|
|
336
|
-
|
|
332
|
+
Ce(), v.value = !0;
|
|
337
333
|
}
|
|
338
|
-
function
|
|
339
|
-
!e.id && !e.isSynthetic || (
|
|
334
|
+
function xe(e) {
|
|
335
|
+
!e.id && !e.isSynthetic || (Ce(e.isSynthetic ? null : e.id), v.value = !0);
|
|
340
336
|
}
|
|
341
337
|
function ce() {
|
|
342
|
-
H(!0),
|
|
338
|
+
H(!0), v.value = !1;
|
|
343
339
|
}
|
|
344
|
-
function
|
|
340
|
+
function Se() {
|
|
345
341
|
var e;
|
|
346
342
|
if (!((e = l.value) != null && e.dirty)) {
|
|
347
343
|
ce();
|
|
348
344
|
return;
|
|
349
345
|
}
|
|
350
|
-
|
|
346
|
+
R.open({
|
|
351
347
|
zIndex: 101,
|
|
352
348
|
title: a("menu.common.dialog.dismiss.title"),
|
|
353
349
|
message: a("menu.common.dialog.dismiss.message"),
|
|
354
350
|
primaryActions: {
|
|
355
351
|
text: a("menu.common.dialog.dismiss.discard"),
|
|
356
352
|
close: !0,
|
|
357
|
-
variant:
|
|
353
|
+
variant: ke.Destructive
|
|
358
354
|
},
|
|
359
355
|
secondaryActions: {
|
|
360
356
|
text: a("menu.common.actions.cancel"),
|
|
@@ -362,20 +358,20 @@ const pa = {
|
|
|
362
358
|
}
|
|
363
359
|
}).onPrimary(ce);
|
|
364
360
|
}
|
|
365
|
-
function
|
|
366
|
-
e ?
|
|
361
|
+
function Ne(e) {
|
|
362
|
+
e ? v.value = !0 : Se();
|
|
367
363
|
}
|
|
368
|
-
ae(
|
|
364
|
+
ae(v, (e) => {
|
|
369
365
|
e || H(!0);
|
|
370
366
|
}), ae(y, (e) => {
|
|
371
367
|
e || I();
|
|
372
368
|
}), ae(G, (e) => {
|
|
373
|
-
|
|
369
|
+
z.value && (e.status !== "ready" || e.value.translation.state !== "allowed") && H(!0);
|
|
374
370
|
});
|
|
375
|
-
async function
|
|
376
|
-
var C, f,
|
|
371
|
+
async function Ke() {
|
|
372
|
+
var C, f, S;
|
|
377
373
|
if (X.value) return;
|
|
378
|
-
const e = (C = l.value) == null ? void 0 : C.mode, t = ((
|
|
374
|
+
const e = (C = l.value) == null ? void 0 : C.mode, t = ((S = (f = l.value) == null ? void 0 : f.name) == null ? void 0 : S.trim()) ?? "";
|
|
379
375
|
(await j(
|
|
380
376
|
() => le.submit(() => p.value.submit()),
|
|
381
377
|
{
|
|
@@ -390,8 +386,8 @@ const pa = {
|
|
|
390
386
|
}
|
|
391
387
|
)).kind === "success" && ce();
|
|
392
388
|
}
|
|
393
|
-
function
|
|
394
|
-
e.remove.state !== "allowed" || !e.id ||
|
|
389
|
+
function Pe(e) {
|
|
390
|
+
e.remove.state !== "allowed" || !e.id || R.open({
|
|
395
391
|
title: a("menu.category.dialog.remove.title"),
|
|
396
392
|
message: a("menu.common.dialog.remove_confirmation", {
|
|
397
393
|
name: e.name
|
|
@@ -399,23 +395,23 @@ const pa = {
|
|
|
399
395
|
primaryActions: {
|
|
400
396
|
text: a("menu.common.actions.remove"),
|
|
401
397
|
close: !0,
|
|
402
|
-
variant:
|
|
398
|
+
variant: ke.Destructive
|
|
403
399
|
},
|
|
404
400
|
secondaryActions: {
|
|
405
401
|
text: a("menu.common.actions.cancel"),
|
|
406
402
|
close: !0
|
|
407
403
|
}
|
|
408
404
|
}).onPrimary(async () => {
|
|
409
|
-
await j(() =>
|
|
405
|
+
await j(() => w.sdk.category.remove(e.id), {
|
|
410
406
|
successMessage: a("menu.category.dialog.remove.success", {
|
|
411
407
|
name: e.name
|
|
412
408
|
})
|
|
413
409
|
});
|
|
414
410
|
});
|
|
415
411
|
}
|
|
416
|
-
const
|
|
412
|
+
const Ge = U(() => {
|
|
417
413
|
var e;
|
|
418
|
-
return
|
|
414
|
+
return V.value || ((e = r.value) == null ? void 0 : e.reorder.state) !== "allowed" ? () => !1 : (t) => !t.isSynthetic;
|
|
419
415
|
}), de = J([]);
|
|
420
416
|
ae(
|
|
421
417
|
() => {
|
|
@@ -427,26 +423,26 @@ const pa = {
|
|
|
427
423
|
},
|
|
428
424
|
{ immediate: !0 }
|
|
429
425
|
);
|
|
430
|
-
async function
|
|
431
|
-
var f,
|
|
432
|
-
if (
|
|
426
|
+
async function We(e) {
|
|
427
|
+
var f, S, A;
|
|
428
|
+
if (V.value || ((f = r.value) == null ? void 0 : f.reorder.state) !== "allowed") return;
|
|
433
429
|
const t = e.map((s) => s.id).filter((s) => !!s);
|
|
434
430
|
if (t.length === 0) return;
|
|
435
431
|
const n = de.value;
|
|
436
|
-
(await j(() =>
|
|
437
|
-
successMessage: ((
|
|
432
|
+
(await j(() => w.sdk.category.reorder(t), {
|
|
433
|
+
successMessage: ((S = r.value) == null ? void 0 : S.reorderScope) === "catalog" ? a("menu.catalog.saved", { name: a("menu.category.entity") }) : a("menu.category.reorder.success")
|
|
438
434
|
})).kind !== "success" && (de.value = [...((A = r.value) == null ? void 0 : A.rows) ?? n]);
|
|
439
435
|
}
|
|
440
436
|
function Le(e) {
|
|
441
|
-
|
|
437
|
+
w.sdk.category.search(e);
|
|
442
438
|
}
|
|
443
|
-
const
|
|
439
|
+
const qe = U(() => [
|
|
444
440
|
{
|
|
445
441
|
accessorKey: "name",
|
|
446
442
|
header: () => a("menu.category.columns.title"),
|
|
447
443
|
enableSorting: !1,
|
|
448
444
|
meta: { width: "auto" },
|
|
449
|
-
cell: (e) => e.row.original.nameMessage ?
|
|
445
|
+
cell: (e) => e.row.original.nameMessage ? B(e.row.original.nameMessage) : e.row.original.name
|
|
450
446
|
},
|
|
451
447
|
{
|
|
452
448
|
accessorKey: "linkedProductCount",
|
|
@@ -463,7 +459,7 @@ const pa = {
|
|
|
463
459
|
// Catalog scope only changes membership/order. Categories remain master
|
|
464
460
|
// entities, so the scoped table deliberately has no destructive action
|
|
465
461
|
// column — the legacy editor renders just its two data columns there.
|
|
466
|
-
...
|
|
462
|
+
...w.catalogPage ? [] : [
|
|
467
463
|
{
|
|
468
464
|
id: "actions",
|
|
469
465
|
size: 52,
|
|
@@ -479,7 +475,7 @@ const pa = {
|
|
|
479
475
|
textColor: "neutral-gray-400",
|
|
480
476
|
"aria-label": a("menu.category.dialog.remove.title"),
|
|
481
477
|
onClick: he(
|
|
482
|
-
() =>
|
|
478
|
+
() => Pe(t),
|
|
483
479
|
["stop", "prevent"]
|
|
484
480
|
)
|
|
485
481
|
})
|
|
@@ -489,7 +485,7 @@ const pa = {
|
|
|
489
485
|
]
|
|
490
486
|
]), me = U(() => {
|
|
491
487
|
var n;
|
|
492
|
-
const e = ((n = l.value) == null ? void 0 : n.productRows) ?? [], t =
|
|
488
|
+
const e = ((n = l.value) == null ? void 0 : n.productRows) ?? [], t = h.value.trim().toLocaleLowerCase();
|
|
493
489
|
return t ? e.filter(
|
|
494
490
|
(C) => C.name.toLocaleLowerCase().includes(t) || (C.code ?? "").toLocaleLowerCase().includes(t)
|
|
495
491
|
) : e;
|
|
@@ -501,18 +497,18 @@ const pa = {
|
|
|
501
497
|
},
|
|
502
498
|
{ immediate: !0 }
|
|
503
499
|
);
|
|
504
|
-
const
|
|
500
|
+
const He = U(() => {
|
|
505
501
|
var e, t;
|
|
506
|
-
return me.value.length === 0 ? !1 :
|
|
502
|
+
return me.value.length === 0 ? !1 : h.value || ((e = l.value) == null ? void 0 : e.products.state) !== "allowed" || me.value.length < 2 ? () => !1 : (t = l.value) != null && t.synthetic ? () => !1 : () => !0;
|
|
507
503
|
});
|
|
508
|
-
async function
|
|
509
|
-
var f,
|
|
504
|
+
async function Je(e) {
|
|
505
|
+
var f, S;
|
|
510
506
|
const t = (f = l.value) == null ? void 0 : f.categoryId;
|
|
511
|
-
if (!t ||
|
|
507
|
+
if (!t || h.value || ((S = l.value) == null ? void 0 : S.products.state) !== "allowed")
|
|
512
508
|
return;
|
|
513
509
|
const n = ve.value;
|
|
514
510
|
(await j(
|
|
515
|
-
() =>
|
|
511
|
+
() => w.sdk.item.reorderForCategory(
|
|
516
512
|
t,
|
|
517
513
|
e.map((A) => A.id)
|
|
518
514
|
),
|
|
@@ -523,7 +519,7 @@ const pa = {
|
|
|
523
519
|
}
|
|
524
520
|
)).kind !== "success" && (ve.value = [...me.value ?? n]);
|
|
525
521
|
}
|
|
526
|
-
const
|
|
522
|
+
const Qe = U(() => [
|
|
527
523
|
{
|
|
528
524
|
accessorKey: "name",
|
|
529
525
|
header: () => a("menu.category.products.columns.name"),
|
|
@@ -542,7 +538,7 @@ const pa = {
|
|
|
542
538
|
cell: (e) => ge("div", { class: "flex justify-end" }, [
|
|
543
539
|
ge(te.FmButton, {
|
|
544
540
|
icon: "edit",
|
|
545
|
-
variant:
|
|
541
|
+
variant: ke.Tertiary,
|
|
546
542
|
textColor: "neutral-gray-400",
|
|
547
543
|
"aria-label": a("menu.common.labels.a11y_labelled_name", {
|
|
548
544
|
label: a("menu.common.actions.edit"),
|
|
@@ -557,95 +553,104 @@ const pa = {
|
|
|
557
553
|
}
|
|
558
554
|
]);
|
|
559
555
|
return Ie(() => {
|
|
560
|
-
|
|
556
|
+
w.sdk.category.search(""), H(!0), I(), oe(), p.value.dispose();
|
|
561
557
|
}), (e, t) => {
|
|
562
|
-
const n = ie("FmButton"), C = ie("FmCircularProgress"), f = ie("FmSearch"),
|
|
563
|
-
return
|
|
558
|
+
const n = ie("FmButton"), C = ie("FmCircularProgress"), f = ie("FmSearch"), S = ie("FmTable"), A = ie("FmSideSheet");
|
|
559
|
+
return m(), F(ca, {
|
|
564
560
|
heading: e.catalogPage ? e.heading : o(a)("menu.category.title")
|
|
565
561
|
}, {
|
|
566
|
-
"prepend-heading":
|
|
562
|
+
"prepend-heading": x(() => [
|
|
567
563
|
pe(e.$slots, "prepend-heading")
|
|
568
564
|
]),
|
|
569
|
-
"append-heading":
|
|
565
|
+
"append-heading": x(() => {
|
|
570
566
|
var s;
|
|
571
567
|
return [
|
|
572
|
-
e.catalogPage ?
|
|
573
|
-
|
|
574
|
-
b(
|
|
568
|
+
e.catalogPage ? T("", !0) : (m(), N("div", Sa, [
|
|
569
|
+
g("div", Pa, [
|
|
570
|
+
b(ra, {
|
|
575
571
|
value: ((s = r.value) == null ? void 0 : s.totalCount) ?? 0
|
|
576
572
|
}, null, 8, ["value"])
|
|
577
573
|
]),
|
|
578
|
-
r.value && r.value.totalCount > 0 && !K.value ? (
|
|
574
|
+
r.value && r.value.totalCount > 0 && !K.value ? (m(), F(n, {
|
|
579
575
|
key: 0,
|
|
580
576
|
disabled: r.value.create.state !== "allowed",
|
|
581
577
|
label: o(a)("menu.category.add"),
|
|
582
578
|
"prepend-icon": "add",
|
|
583
579
|
onClick: ye
|
|
584
|
-
}, null, 8, ["disabled", "label"])) :
|
|
580
|
+
}, null, 8, ["disabled", "label"])) : T("", !0)
|
|
585
581
|
])),
|
|
586
|
-
e.catalogPage ? (
|
|
582
|
+
e.catalogPage ? (m(), N("div", La, [
|
|
587
583
|
pe(e.$slots, "append-heading")
|
|
588
584
|
])) : pe(e.$slots, "append-heading", { key: 2 })
|
|
589
585
|
];
|
|
590
586
|
}),
|
|
591
|
-
default:
|
|
587
|
+
default: x(() => [
|
|
592
588
|
pe(e.$slots, "navigation"),
|
|
593
|
-
o(O).status === "error" ? (
|
|
589
|
+
o(O).status === "error" ? (m(), N("p", Ua, M(o(B)(o(O).error.message)), 1)) : o(O).status === "unavailable" ? (m(), N("p", Fa, M(o(B)(o(O).reason)), 1)) : o(O).status === "loading" ? (m(), F(C, { key: 2 })) : r.value && r.value.rows.length === 0 && !V.value ? (m(), F(o(na), {
|
|
594
590
|
key: 3,
|
|
595
591
|
action: e.catalogPage ? void 0 : { text: o(a)("menu.category.add"), callback: ye },
|
|
596
592
|
subtitle: o(a)("menu.category.empty.subtitle"),
|
|
597
593
|
title: o(a)("menu.category.empty.title")
|
|
598
|
-
}, null, 8, ["action", "subtitle", "title"])) : r.value && K.value ? (
|
|
599
|
-
|
|
594
|
+
}, null, 8, ["action", "subtitle", "title"])) : r.value && K.value ? (m(), N("div", {
|
|
595
|
+
key: 4,
|
|
596
|
+
class: we(["flex-1 flex flex-col min-h-0", { "pt-16": e.catalogPage }])
|
|
597
|
+
}, [
|
|
598
|
+
g("div", Ra, [
|
|
600
599
|
b(f, {
|
|
600
|
+
autofocus: "",
|
|
601
601
|
class: "w-full",
|
|
602
|
-
"model-value":
|
|
602
|
+
"model-value": V.value,
|
|
603
603
|
placeholder: o(a)("menu.common.labels.search_placeholder", {
|
|
604
604
|
type: o(a)("menu.category.title")
|
|
605
605
|
}),
|
|
606
606
|
"onUpdate:modelValue": Le
|
|
607
607
|
}, null, 8, ["model-value", "placeholder"])
|
|
608
608
|
]),
|
|
609
|
-
|
|
610
|
-
(
|
|
609
|
+
g("div", Ea, [
|
|
610
|
+
(m(!0), N(Ee, null, Ye(r.value.rows, (s) => (m(), N("div", {
|
|
611
611
|
key: s.id ?? "",
|
|
612
612
|
class: "flex flex-row py-12 px-16",
|
|
613
|
-
|
|
613
|
+
"data-test": "category-phone-row",
|
|
614
|
+
onClick: (P) => !e.catalogPage && xe(s)
|
|
614
615
|
}, [
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
616
|
+
g("div", Va, [
|
|
617
|
+
g("p", Da, M(s.nameMessage ? o(B)(s.nameMessage) : s.name), 1),
|
|
618
|
+
g("p", Ia, M(o(a)("menu.common.labels.product_linked", {
|
|
618
619
|
count: s.linkedProductCount
|
|
619
620
|
})), 1)
|
|
620
621
|
]),
|
|
621
|
-
|
|
622
|
+
e.catalogPage ? T("", !0) : (m(), F(n, {
|
|
623
|
+
key: 0,
|
|
622
624
|
class: "shrink-0",
|
|
623
625
|
"aria-label": o(a)("menu.category.dialog.remove.title"),
|
|
624
626
|
disabled: s.remove.state !== "allowed",
|
|
625
627
|
"prepend-icon": "delete",
|
|
626
628
|
"text-color": "neutral-gray-400",
|
|
627
629
|
variant: "tertiary",
|
|
628
|
-
onClick: he((
|
|
629
|
-
}, null, 8, ["aria-label", "disabled", "onClick"])
|
|
630
|
-
], 8,
|
|
630
|
+
onClick: he((P) => Pe(s), ["stop"])
|
|
631
|
+
}, null, 8, ["aria-label", "disabled", "onClick"]))
|
|
632
|
+
], 8, $a))), 128))
|
|
631
633
|
]),
|
|
632
|
-
r.value.totalCount > 0 ? (
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
634
|
+
!e.catalogPage && r.value.totalCount > 0 ? (m(), F(la, { key: 0 }, {
|
|
635
|
+
default: x(() => [
|
|
636
|
+
b(n, {
|
|
637
|
+
disabled: r.value.create.state !== "allowed",
|
|
638
|
+
label: o(a)("menu.category.add"),
|
|
639
|
+
"prepend-icon": "add",
|
|
640
|
+
variant: "fab",
|
|
641
|
+
onClick: ye
|
|
642
|
+
}, null, 8, ["disabled", "label"])
|
|
643
|
+
]),
|
|
644
|
+
_: 1
|
|
645
|
+
})) : T("", !0)
|
|
646
|
+
], 2)) : r.value ? (m(), N(Ee, { key: 5 }, [
|
|
647
|
+
g("div", {
|
|
648
|
+
class: we(["flex justify-end items-center", { "pt-16": e.catalogPage }])
|
|
644
649
|
}, [
|
|
645
|
-
|
|
650
|
+
g("div", Ma, [
|
|
646
651
|
b(f, {
|
|
647
652
|
class: "mb-8",
|
|
648
|
-
"model-value":
|
|
653
|
+
"model-value": V.value,
|
|
649
654
|
placeholder: o(a)("menu.common.labels.search_placeholder", {
|
|
650
655
|
type: o(a)("menu.category.title")
|
|
651
656
|
}),
|
|
@@ -653,47 +658,54 @@ const pa = {
|
|
|
653
658
|
}, null, 8, ["model-value", "placeholder"])
|
|
654
659
|
])
|
|
655
660
|
], 2),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
661
|
+
(m(), F(Ze(e.catalogPage ? da : "div"), {
|
|
662
|
+
class: we({ contents: !e.catalogPage })
|
|
663
|
+
}, {
|
|
664
|
+
default: x(() => [
|
|
665
|
+
ea(b(S, {
|
|
666
|
+
"column-defs": qe.value,
|
|
667
|
+
draggable: Ge.value,
|
|
668
|
+
"page-size": r.value.rows.length,
|
|
669
|
+
"row-data": de.value,
|
|
670
|
+
"shrink-at": !1,
|
|
671
|
+
"hide-footer": "",
|
|
672
|
+
"pin-header-row": "",
|
|
673
|
+
onDndChanged: We,
|
|
674
|
+
onRowClick: t[0] || (t[0] = (s) => xe(s.original))
|
|
675
|
+
}, null, 8, ["column-defs", "draggable", "page-size", "row-data"]), [
|
|
676
|
+
[o(ya), o(a)("menu.category.columns.title")]
|
|
677
|
+
])
|
|
678
|
+
]),
|
|
679
|
+
_: 1
|
|
680
|
+
}, 8, ["class"]))
|
|
681
|
+
], 64)) : T("", !0),
|
|
670
682
|
b(A, {
|
|
671
|
-
"model-value":
|
|
683
|
+
"model-value": v.value && !y.value,
|
|
672
684
|
"is-container": o(te).FmForm,
|
|
673
|
-
"is-container-props": { onValidationSuccess:
|
|
685
|
+
"is-container-props": { onValidationSuccess: Ke },
|
|
674
686
|
"max-width": 560,
|
|
675
687
|
"z-index": 100,
|
|
676
|
-
"onOn:clickedAway":
|
|
677
|
-
"onUpdate:modelValue":
|
|
688
|
+
"onOn:clickedAway": Se,
|
|
689
|
+
"onUpdate:modelValue": Ne
|
|
678
690
|
}, {
|
|
679
|
-
"side-sheet-header":
|
|
680
|
-
var s,
|
|
691
|
+
"side-sheet-header": x(() => {
|
|
692
|
+
var s, P;
|
|
681
693
|
return [
|
|
682
|
-
|
|
694
|
+
g("p", Ba, M((s = l.value) != null && s.synthetic ? o(a)("menu.category.entity") : ((P = l.value) == null ? void 0 : P.mode) === "update" ? o(a)("menu.category.manager.dialog.update.title") : o(a)("menu.category.manager.dialog.add.title")), 1)
|
|
683
695
|
];
|
|
684
696
|
}),
|
|
685
|
-
"side-sheet-footer":
|
|
686
|
-
var s,
|
|
697
|
+
"side-sheet-footer": x(() => {
|
|
698
|
+
var s, P, se;
|
|
687
699
|
return [
|
|
688
|
-
|
|
689
|
-
((s = l.value) == null ? void 0 : s.submit.state) !== "hidden" ? (
|
|
700
|
+
g("div", Na, [
|
|
701
|
+
((s = l.value) == null ? void 0 : s.submit.state) !== "hidden" ? (m(), F(n, {
|
|
690
702
|
key: 0,
|
|
691
|
-
disabled: ((
|
|
703
|
+
disabled: ((P = l.value) == null ? void 0 : P.submit.state) !== "allowed" || X.value,
|
|
692
704
|
label: ((se = l.value) == null ? void 0 : se.mode) === "update" ? o(a)("menu.common.actions.update") : o(a)("menu.category.manager.dialog.add.action"),
|
|
693
705
|
size: "lg",
|
|
694
706
|
type: "submit",
|
|
695
707
|
variant: "primary"
|
|
696
|
-
}, null, 8, ["disabled", "label"])) :
|
|
708
|
+
}, null, 8, ["disabled", "label"])) : T("", !0),
|
|
697
709
|
b(n, {
|
|
698
710
|
label: o(a)("menu.common.actions.cancel"),
|
|
699
711
|
size: "lg",
|
|
@@ -703,34 +715,34 @@ const pa = {
|
|
|
703
715
|
])
|
|
704
716
|
];
|
|
705
717
|
}),
|
|
706
|
-
default:
|
|
707
|
-
var s,
|
|
718
|
+
default: x(() => {
|
|
719
|
+
var s, P, se;
|
|
708
720
|
return [
|
|
709
|
-
|
|
710
|
-
b(
|
|
721
|
+
g("div", za, [
|
|
722
|
+
b($e, {
|
|
711
723
|
title: o(a)("menu.category.detail")
|
|
712
724
|
}, {
|
|
713
|
-
default:
|
|
725
|
+
default: x(() => {
|
|
714
726
|
var L, ee;
|
|
715
727
|
return [
|
|
716
|
-
b(
|
|
717
|
-
"error-messages": re.value ? [o(
|
|
728
|
+
b(ua, aa({
|
|
729
|
+
"error-messages": re.value ? [o(B)(re.value)] : [],
|
|
718
730
|
label: o(a)("menu.category.name"),
|
|
719
731
|
readonly: (L = l.value) == null ? void 0 : L.synthetic,
|
|
720
732
|
"model-value": ((ee = l.value) == null ? void 0 : ee.name) ?? ""
|
|
721
733
|
}, o(le).field("name", p.value.setName)), {
|
|
722
|
-
append:
|
|
734
|
+
append: x(() => {
|
|
723
735
|
var Ue, Fe;
|
|
724
736
|
return [
|
|
725
|
-
((Ue = l.value) == null ? void 0 : Ue.translation.state) !== "hidden" ? (
|
|
737
|
+
((Ue = l.value) == null ? void 0 : Ue.translation.state) !== "hidden" ? (m(), F(n, {
|
|
726
738
|
key: 0,
|
|
727
739
|
"aria-label": o(a)("menu.common.translation.translation_label"),
|
|
728
740
|
disabled: ((Fe = l.value) == null ? void 0 : Fe.translation.state) !== "allowed",
|
|
729
741
|
class: "!p-0",
|
|
730
742
|
icon: "g_translate",
|
|
731
743
|
variant: "tertiary",
|
|
732
|
-
onClick:
|
|
733
|
-
}, null, 8, ["aria-label", "disabled"])) :
|
|
744
|
+
onClick: Te
|
|
745
|
+
}, null, 8, ["aria-label", "disabled"])) : T("", !0)
|
|
734
746
|
];
|
|
735
747
|
}),
|
|
736
748
|
_: 1
|
|
@@ -739,21 +751,21 @@ const pa = {
|
|
|
739
751
|
}),
|
|
740
752
|
_: 1
|
|
741
753
|
}, 8, ["title"]),
|
|
742
|
-
l.value && l.value.image.capability.state !== "hidden" ? (
|
|
754
|
+
l.value && l.value.image.capability.state !== "hidden" ? (m(), F(xa, {
|
|
743
755
|
key: Q.value,
|
|
744
756
|
"thumbnail-url": ((s = l.value) == null ? void 0 : s.image.thumbnailUrl) ?? null,
|
|
745
|
-
change: ((
|
|
757
|
+
change: ((P = l.value) == null ? void 0 : P.image.change) ?? "unchanged",
|
|
746
758
|
disabled: ((se = l.value) == null ? void 0 : se.image.capability.state) !== "allowed",
|
|
747
759
|
onSelect: t[1] || (t[1] = (L) => p.value.setImage(L)),
|
|
748
760
|
onClear: t[2] || (t[2] = (L) => p.value.clearImage()),
|
|
749
761
|
onEncoding: t[3] || (t[3] = (L) => X.value = L)
|
|
750
|
-
}, null, 8, ["thumbnail-url", "change", "disabled"])) :
|
|
751
|
-
b(
|
|
762
|
+
}, null, 8, ["thumbnail-url", "change", "disabled"])) : T("", !0),
|
|
763
|
+
b($e, {
|
|
752
764
|
class: "flex-1 min-h-0",
|
|
753
765
|
shrinkable: !0,
|
|
754
766
|
title: o(a)("menu.category.products.title")
|
|
755
767
|
}, {
|
|
756
|
-
"append-title":
|
|
768
|
+
"append-title": x(() => {
|
|
757
769
|
var L;
|
|
758
770
|
return [
|
|
759
771
|
b(n, {
|
|
@@ -767,30 +779,30 @@ const pa = {
|
|
|
767
779
|
}, null, 8, ["disabled", "label"])
|
|
768
780
|
];
|
|
769
781
|
}),
|
|
770
|
-
default:
|
|
782
|
+
default: x(() => {
|
|
771
783
|
var L;
|
|
772
784
|
return [
|
|
773
|
-
|
|
774
|
-
|
|
785
|
+
g("div", Ta, [
|
|
786
|
+
g("div", ja, M(o(a)("menu.category.products.linked_count", {
|
|
775
787
|
count: ((L = l.value) == null ? void 0 : L.productRows.length) ?? 0
|
|
776
788
|
})), 1),
|
|
777
|
-
|
|
789
|
+
g("div", Oa, [
|
|
778
790
|
b(f, {
|
|
779
|
-
modelValue:
|
|
780
|
-
"onUpdate:modelValue": t[4] || (t[4] = (ee) =>
|
|
791
|
+
modelValue: h.value,
|
|
792
|
+
"onUpdate:modelValue": t[4] || (t[4] = (ee) => h.value = ee),
|
|
781
793
|
placeholder: o(a)("menu.common.actions.search")
|
|
782
794
|
}, null, 8, ["modelValue", "placeholder"])
|
|
783
795
|
])
|
|
784
796
|
]),
|
|
785
|
-
|
|
786
|
-
b(
|
|
787
|
-
"column-defs":
|
|
788
|
-
draggable:
|
|
797
|
+
g("div", Aa, [
|
|
798
|
+
b(S, {
|
|
799
|
+
"column-defs": Qe.value,
|
|
800
|
+
draggable: He.value,
|
|
789
801
|
"hide-footer": "",
|
|
790
802
|
"pin-header-row": "",
|
|
791
803
|
"row-data": ve.value,
|
|
792
804
|
"shrink-at": !1,
|
|
793
|
-
onDndChanged:
|
|
805
|
+
onDndChanged: Je,
|
|
794
806
|
onRowClick: t[5] || (t[5] = (ee) => ne(ee.original))
|
|
795
807
|
}, null, 8, ["column-defs", "draggable", "row-data"])
|
|
796
808
|
])
|
|
@@ -803,17 +815,17 @@ const pa = {
|
|
|
803
815
|
}),
|
|
804
816
|
_: 1
|
|
805
817
|
}, 8, ["model-value", "is-container", "is-container-props"]),
|
|
806
|
-
b(
|
|
818
|
+
b(ma, {
|
|
807
819
|
open: y.value,
|
|
808
820
|
"onUpdate:open": t[6] || (t[6] = (s) => y.value = s),
|
|
809
821
|
sdk: e.sdk,
|
|
810
822
|
session: d.value,
|
|
811
|
-
validation: o(
|
|
823
|
+
validation: o(k),
|
|
812
824
|
view: W.value,
|
|
813
|
-
onSelectScope:
|
|
814
|
-
onSubmit:
|
|
825
|
+
onSelectScope: Be,
|
|
826
|
+
onSubmit: ze
|
|
815
827
|
}, null, 8, ["open", "sdk", "session", "validation", "view"]),
|
|
816
|
-
c.value ? (
|
|
828
|
+
c.value ? (m(), F(va, {
|
|
817
829
|
key: 6,
|
|
818
830
|
"model-value": Z.value,
|
|
819
831
|
dirty: c.value.dirty,
|
|
@@ -828,14 +840,14 @@ const pa = {
|
|
|
828
840
|
}),
|
|
829
841
|
"z-index": 200,
|
|
830
842
|
onDiscard: _e,
|
|
831
|
-
onSave:
|
|
832
|
-
"onUpdate:modelValue":
|
|
843
|
+
onSave: Oe,
|
|
844
|
+
"onUpdate:modelValue": Ae,
|
|
833
845
|
"onUpdate:name": t[7] || (t[7] = (s) => {
|
|
834
|
-
var
|
|
835
|
-
return (
|
|
846
|
+
var P;
|
|
847
|
+
return (P = z.value) == null ? void 0 : P.setName(s);
|
|
836
848
|
}),
|
|
837
|
-
"onUpdate:nameLocale":
|
|
838
|
-
}, null, 8, ["model-value", "dirty", "name", "name-locale", "supported-locales", "title", "name-section-label"])) :
|
|
849
|
+
"onUpdate:nameLocale": je
|
|
850
|
+
}, null, 8, ["model-value", "dirty", "name", "name-locale", "supported-locales", "title", "name-section-label"])) : T("", !0)
|
|
839
851
|
]),
|
|
840
852
|
_: 3
|
|
841
853
|
}, 8, ["heading"]);
|
|
@@ -843,5 +855,5 @@ const pa = {
|
|
|
843
855
|
}
|
|
844
856
|
});
|
|
845
857
|
export {
|
|
846
|
-
|
|
858
|
+
rt as _
|
|
847
859
|
};
|