@feedmepos/mf-menu 0.31.40-prod → 0.31.41-prod
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-aWEH-ZEk.js → App-5Lzy8zHZ.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-jJyinQZl.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BnKXsQH-.js} +3 -3
- package/dist/{Catalog-BoFfFdn8.js → Catalog-s5b8V8nw.js} +8 -9
- package/dist/{Category-CWYbb3Jn.js → Category-BJzScJEY.js} +4 -4
- package/dist/{Category-DZ45uikR.js → Category-DZ-xqIMI.js} +6 -6
- package/dist/{CookingGuide-BU0PRWIQ.js → CookingGuide-Bkd6GPww.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-B8tIjKOW.js} +1 -1
- package/dist/{Group-BMQDeqiS.js → Group-0b2Qiov3.js} +1 -1
- package/dist/{Group-C0T_uknK.js → Group-BOaCcKiI.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DyfmY6F1.js → Group.vue_vue_type_script_setup_true_lang-DUlUfMAs.js} +8 -8
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CouimeC4.js +399 -0
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DOvQmbrZ.js} +13 -14
- package/dist/{Ingredient-3lwDUQx_.js → Ingredient-ChcYUvOg.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-VLrrTkSC.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DE1HkipX.js} +2 -2
- package/dist/LinkProductSideSheet-BdzBGYxG.js +361 -0
- package/dist/MenuSetting-zAAttaoA.js +618 -0
- package/dist/{PrintRoute-DfJ-vUAb.js → PrintRoute-T-vuO5N8.js} +4 -4
- package/dist/{Product-F4PoLm9v.js → Product-B5q291VF.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js → Product.vue_vue_type_script_setup_true_lang-DLRlT10W.js} +468 -465
- package/dist/{ProductInternalTools-DSGU-OqU.js → ProductInternalTools-BOlc0VUR.js} +5 -5
- package/dist/{Products-COzW2Z4g.js → Products-Cd4Mqhm3.js} +88 -85
- package/dist/{Publish-CDXVWCk2.js → Publish-SuRzt-_D.js} +3 -3
- package/dist/{Recipe-BZx4wrcP.js → Recipe-BKrjNs5g.js} +4 -4
- package/dist/{Scheduler-wHCWSeU2.js → Scheduler-DnDgImLC.js} +3 -3
- package/dist/{ServingSequence-BbYEhDYh.js → ServingSequence-D602bVnm.js} +3 -3
- package/dist/{Setting-C9Tlw1Iy.js → Setting-FMT4oBYH.js} +44 -45
- package/dist/{Subcategory-C8AwfrKb.js → Subcategory-CpYmjAvA.js} +4 -4
- package/dist/{Takeaway-t1053wg2.js → Takeaway-BXh3iuME.js} +1 -1
- package/dist/{Takeaway-DaEUn-yM.js → Takeaway-D4hjN5z5.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js → Takeaway.vue_vue_type_script_setup_true_lang-By1f-FCO.js} +5 -5
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-CZUwa5C_.js +440 -0
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ci6iqOry.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DfjtfcCh.js} +604 -600
- package/dist/{Unit-CnqptGCz.js → Unit-CsjHkV-h.js} +2 -2
- package/dist/{Variant-DiOYOwJs.js → Variant-Djra14ZX.js} +3 -3
- package/dist/{_id_-BSfU16VO.js → _id_-BXkqoCzB.js} +78 -75
- package/dist/{app-Ddb81PNo.js → app-CVqWWV4x.js} +278 -278
- package/dist/{LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js → app-CiBqmBzO.js} +2120 -2084
- package/dist/{app-Cou6qPF2.js → app-PhBJNss_.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/menu.d.ts +2 -1
- package/dist/apps/mf-menu/src/app.d.ts +144 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +36 -0
- package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +9 -3
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +294 -4
- package/dist/apps/mf-menu/src/composable/attributes.d.ts +26 -0
- package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +40 -0
- package/dist/apps/mf-menu/src/helper/import-export.d.ts +285 -0
- package/dist/apps/mf-menu/src/helper/menu.d.ts +285 -0
- package/dist/apps/mf-menu/src/manager/menu/item.d.ts +285 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +293 -3
- package/dist/apps/mf-menu/src/utils/array.d.ts +1 -0
- package/dist/apps/mf-menu/src/utils/customAttributes.d.ts +12 -0
- package/dist/apps/mf-menu/src/views/MenuSetting/LinkProductRuleGroups.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/MenuSetting/RuleGroupSideSheet.vue.d.ts +176 -0
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +166 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-WlVAcpRn.js +13 -0
- package/dist/assets/override-menu-__h4D7ac.js +13 -0
- package/dist/assets/validate-menu-DyPuzLRg.js +13 -0
- package/dist/{catalog-DSuJhsUb.js → catalog-C_TuQLxq.js} +1 -1
- package/dist/{catalogSetting-C3gEw9ov.js → catalogSetting-BUlJu6hG.js} +1 -1
- package/dist/{category-CwWq3KCE.js → category-CmVw1Kj-.js} +1 -1
- package/dist/{currency-g45Sh-t6.js → currency-OhOTnAqk.js} +1 -1
- package/dist/customAttributes-fpOfmGnw.js +180 -0
- package/dist/{dayjs.min-g3eN5z-V.js → dayjs.min-CDhP-7L5.js} +1 -1
- package/dist/{index-QsLFbxyG.js → index-BJZEWB5C.js} +4 -4
- package/dist/{index-BLQCYEc6.js → index-DHAYGEPp.js} +7 -8
- package/dist/{index-0yRUi7LL.js → index-DtwHmS38.js} +1 -1
- package/dist/index-N3cGc8ex.js +245 -0
- package/dist/{item-BvvQ9urP.js → item-BELLphR0.js} +16 -16
- package/dist/{jszip.min-DzdUiaR4.js → jszip.min-CZtcGb7A.js} +353 -353
- package/dist/{menu-QrVg2Ph7.js → menu-Csyr6W9A.js} +7 -7
- package/dist/{menu-DFNvhoNQ.js → menu-DS_ERmBf.js} +23355 -23206
- package/dist/{menuV2-Ezf_jW40.js → menuV2-DKzAZ4Ss.js} +151 -146
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-zENsn3P_.js → priceTier-CYWS5lDS.js} +1 -1
- package/dist/{scheduler-BuwGSv6A.js → scheduler-DI5dXC7Y.js} +8 -8
- package/dist/{subcategory-O3L_zCJA.js → subcategory-D_ao-IV9.js} +2 -2
- package/dist/{toExcel-CpRy_4nG.js → toExcel-Cml-rkJQ.js} +2 -2
- package/dist/{unit-Ct_7Hfa2.js → unit-BWDp2LkV.js} +42 -41
- package/package.json +3 -3
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +0 -50
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D6qro5w_.js +0 -367
- package/dist/LinkProductSideSheet-LDZjKX95.js +0 -297
- package/dist/MenuSetting-AhutsCVy.js +0 -185
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js +0 -431
- package/dist/assets/linked-status-B_crHhZH.js +0 -24
- package/dist/assets/override-menu-BmlCEpHH.js +0 -24
- package/dist/assets/validate-menu-CF-psoB-.js +0 -24
- package/dist/index-0Q5T9VZV.js +0 -214
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { computed as D, shallowRef as Wt, ref as H, watch as ye, nextTick as nt, getCurrentInstance as xn, onMounted as Ae, defineComponent as ae, resolveComponent as W, createElementBlock as J, openBlock as
|
|
2
|
-
import { g as An, o as Nn, f as Ln, a as Gn, n as Qt, _ as Zt, I as Kn, S as Bn, b as Dt, C as zn, R as We, c as en, d as Et, e as tn, h as Yn, m as jn, F as Wn, M as nn, j as Hn, r as qn, k as on, l as Nt, p as rn, q as Xn, P as Jn, s as Qn, t as an, u as Zn, T as Be } from "./item-
|
|
3
|
-
import { _ as eo, T as to } from "./app-
|
|
4
|
-
import { B as be, J as _e, A as te, G as ot, K as no, M as oo, N as ro, O as Vt, P as ao, D as Le, Q as lo, H as me, R as io, T as $t, I as ke, U as vt, V as so, W as uo, X as bt, Y as Lt, Z as co, u as ln, $ as mo } from "./menu-
|
|
1
|
+
import { computed as D, shallowRef as Wt, ref as H, watch as ye, nextTick as nt, getCurrentInstance as xn, onMounted as Ae, defineComponent as ae, resolveComponent as W, createElementBlock as J, openBlock as $, createBlock as q, normalizeClass as fe, createElementVNode as A, createVNode as C, unref as o, withCtx as B, toDisplayString as ge, mergeModels as Ht, useModel as qt, createCommentVNode as X, resolveDirective as Xt, withDirectives as ft, createTextVNode as Sn, renderSlot as Me, h as ve, Fragment as Oe, renderList as Ne, vShow as Jt, withModifiers as qe, createSlots as Fn, onBeforeUnmount as Ot, watchEffect as On, onUnmounted as Dn, normalizeStyle as ct, mergeProps as Vn, normalizeProps as $n, guardReactiveProps as Pn, Teleport as Un, Transition as Rn, withKeys as Mn } from "vue";
|
|
2
|
+
import { g as An, o as Nn, f as Ln, a as Gn, n as Qt, _ as Zt, I as Kn, S as Bn, b as Dt, C as zn, R as We, c as en, d as Et, e as tn, h as Yn, m as jn, F as Wn, M as nn, j as Hn, r as qn, k as on, l as Nt, p as rn, q as Xn, P as Jn, s as Qn, t as an, u as Zn, T as Be } from "./item-BELLphR0.js";
|
|
3
|
+
import { _ as eo, T as to } from "./app-CVqWWV4x.js";
|
|
4
|
+
import { B as be, J as _e, A as te, G as ot, K as no, M as oo, N as ro, O as Vt, P as ao, D as Le, Q as lo, H as me, R as io, T as $t, I as ke, U as vt, V as so, W as uo, X as bt, Y as Lt, Z as co, u as ln, $ as mo } from "./menu-DS_ERmBf.js";
|
|
5
5
|
import { useI18n as ce, useCoreStore as rt, CustomAttributesForm as sn } from "@feedmepos/mf-common";
|
|
6
6
|
import { useDialog as Ge, useDialogChild as Pt, useSnackbar as Re, FmButtonColorThemeVariant as Fe, components as Ie, FmButtonVariant as He, useBreakpoints as po } from "@feedmepos/ui-library";
|
|
7
7
|
import { u as Ut } from "./discardConfirm-BHni0LNu.js";
|
|
8
8
|
import { defineStore as fo } from "pinia";
|
|
9
|
-
import { _ as De, a as go } from "./
|
|
10
|
-
import { u as se, g as un, m as vo } from "./menuV2-
|
|
11
|
-
import { s as Tt, _ as bo } from "./index-
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { _ as
|
|
9
|
+
import { _ as De, a as Ue, b as go } from "./customAttributes-fpOfmGnw.js";
|
|
10
|
+
import { u as se, g as un, m as vo } from "./menuV2-DKzAZ4Ss.js";
|
|
11
|
+
import { s as Tt, _ as bo } from "./index-DtwHmS38.js";
|
|
12
|
+
import { _ as Gt } from "./category-CmVw1Kj-.js";
|
|
13
|
+
import { _ as _o, a as yo, u as ho } from "./Thumbnail.vue_vue_type_script_setup_true_lang-CZUwa5C_.js";
|
|
14
|
+
import { _ as Ze, L as xt } from "./LinkProductSideSheet-BdzBGYxG.js";
|
|
15
15
|
import { _ as dn } from "./tooltip-B5BiPMx9.js";
|
|
16
|
-
import { _ as Xe, T as wo, l as Co } from "./index-
|
|
16
|
+
import { _ as Xe, T as wo, l as Co } from "./index-BJZEWB5C.js";
|
|
17
17
|
import { u as Io } from "./search-BAPEUu1R.js";
|
|
18
18
|
import { c as Rt } from "./check-C9mY6LiX.js";
|
|
19
|
-
import { f as tt } from "./currency-
|
|
19
|
+
import { f as tt } from "./currency-OhOTnAqk.js";
|
|
20
20
|
import { c as ko } from "./string-DpfFixWH.js";
|
|
21
21
|
import { useInventoryStore as Eo, InventoryBindingSummary as To } from "@feedmepos/mf-inventory-portal";
|
|
22
|
-
import { u as xo } from "./priceTier-
|
|
22
|
+
import { u as xo } from "./priceTier-CYWS5lDS.js";
|
|
23
23
|
import { d as Mt } from "./vuedraggable-CK8z7qA8.js";
|
|
24
|
-
import { _ as So } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-
|
|
25
|
-
import "./
|
|
26
|
-
|
|
24
|
+
import { _ as So } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-BnKXsQH-.js";
|
|
25
|
+
import "./app-CiBqmBzO.js";
|
|
26
|
+
/* empty css */
|
|
27
|
+
import { i as Fo, t as At, w as Oo, a as cn, b as mn, n as Do, c as Vo, r as $o, _ as Po } from "./index-N3cGc8ex.js";
|
|
27
28
|
import { c as mt } from "./object-DVUNCr7w.js";
|
|
28
29
|
import { _ as Uo } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
29
30
|
import { _ as Kt } from "./MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js";
|
|
@@ -137,15 +138,15 @@ function Bo(n, r, e, t = {}) {
|
|
|
137
138
|
}
|
|
138
139
|
if (!e)
|
|
139
140
|
return S;
|
|
140
|
-
const
|
|
141
|
+
const O = At(r), k = Go(O), p = (m = t.serializer) != null ? m : Ko[k], { pause: T, resume: U } = Oo(
|
|
141
142
|
S,
|
|
142
|
-
() =>
|
|
143
|
+
() => F(S.value),
|
|
143
144
|
{ flush: s, deep: g, eventFilter: f }
|
|
144
145
|
);
|
|
145
146
|
v && d && cn(() => {
|
|
146
147
|
Bt(v, "storage", E), Bt(v, zt, u), I && E();
|
|
147
148
|
}), I || E();
|
|
148
|
-
function
|
|
149
|
+
function M(l, i) {
|
|
149
150
|
v && v.dispatchEvent(new CustomEvent(zt, {
|
|
150
151
|
detail: {
|
|
151
152
|
key: n,
|
|
@@ -155,42 +156,42 @@ function Bo(n, r, e, t = {}) {
|
|
|
155
156
|
}
|
|
156
157
|
}));
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function F(l) {
|
|
159
160
|
try {
|
|
160
161
|
const i = e.getItem(n);
|
|
161
162
|
if (l == null)
|
|
162
|
-
|
|
163
|
+
M(i, null), e.removeItem(n);
|
|
163
164
|
else {
|
|
164
165
|
const _ = p.write(l);
|
|
165
|
-
i !== _ && (e.setItem(n, _),
|
|
166
|
+
i !== _ && (e.setItem(n, _), M(i, _));
|
|
166
167
|
}
|
|
167
168
|
} catch (i) {
|
|
168
169
|
a(i);
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
+
function R(l) {
|
|
172
173
|
const i = l ? l.newValue : e.getItem(n);
|
|
173
174
|
if (i == null)
|
|
174
|
-
return h &&
|
|
175
|
+
return h && O != null && e.setItem(n, p.write(O)), O;
|
|
175
176
|
if (!l && w) {
|
|
176
177
|
const _ = p.read(i);
|
|
177
|
-
return typeof w == "function" ? w(_,
|
|
178
|
+
return typeof w == "function" ? w(_, O) : k === "object" && !Array.isArray(_) ? { ...O, ..._ } : _;
|
|
178
179
|
} else return typeof i != "string" ? i : p.read(i);
|
|
179
180
|
}
|
|
180
181
|
function E(l) {
|
|
181
182
|
if (!(l && l.storageArea !== e)) {
|
|
182
183
|
if (l && l.key == null) {
|
|
183
|
-
S.value =
|
|
184
|
+
S.value = O;
|
|
184
185
|
return;
|
|
185
186
|
}
|
|
186
187
|
if (!(l && l.key !== n)) {
|
|
187
188
|
T();
|
|
188
189
|
try {
|
|
189
|
-
(l == null ? void 0 : l.newValue) !== p.write(S.value) && (S.value =
|
|
190
|
+
(l == null ? void 0 : l.newValue) !== p.write(S.value) && (S.value = R(l));
|
|
190
191
|
} catch (i) {
|
|
191
192
|
a(i);
|
|
192
193
|
} finally {
|
|
193
|
-
l ? nt(
|
|
194
|
+
l ? nt(U) : U();
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
}
|
|
@@ -352,12 +353,12 @@ function hn(n, r, e, t) {
|
|
|
352
353
|
};
|
|
353
354
|
}
|
|
354
355
|
function qo(n, r) {
|
|
355
|
-
const e = pn(r), { state: t, source: m, currentList: s, size: g, containerRef: d } = e, h = { overflowX: "auto" }, { itemWidth: w, overscan: b = 5 } = n, v = fn(t, m, w), f = gn(m, w), a = vn("horizontal", b, f, v, e), I = bn(w, m), S = D(() => I(t.value.start)),
|
|
356
|
+
const e = pn(r), { state: t, source: m, currentList: s, size: g, containerRef: d } = e, h = { overflowX: "auto" }, { itemWidth: w, overscan: b = 5 } = n, v = fn(t, m, w), f = gn(m, w), a = vn("horizontal", b, f, v, e), I = bn(w, m), S = D(() => I(t.value.start)), O = yn(w, m);
|
|
356
357
|
_n(g, r, d, a);
|
|
357
358
|
const k = hn("horizontal", a, I, d), p = D(() => ({
|
|
358
359
|
style: {
|
|
359
360
|
height: "100%",
|
|
360
|
-
width: `${
|
|
361
|
+
width: `${O.value - S.value}px`,
|
|
361
362
|
marginLeft: `${S.value}px`,
|
|
362
363
|
display: "flex"
|
|
363
364
|
}
|
|
@@ -372,12 +373,12 @@ function qo(n, r) {
|
|
|
372
373
|
};
|
|
373
374
|
}
|
|
374
375
|
function Xo(n, r) {
|
|
375
|
-
const e = pn(r), { state: t, source: m, currentList: s, size: g, containerRef: d } = e, h = { overflowY: "auto" }, { itemHeight: w, overscan: b = 5 } = n, v = fn(t, m, w), f = gn(m, w), a = vn("vertical", b, f, v, e), I = bn(w, m), S = D(() => I(t.value.start)),
|
|
376
|
+
const e = pn(r), { state: t, source: m, currentList: s, size: g, containerRef: d } = e, h = { overflowY: "auto" }, { itemHeight: w, overscan: b = 5 } = n, v = fn(t, m, w), f = gn(m, w), a = vn("vertical", b, f, v, e), I = bn(w, m), S = D(() => I(t.value.start)), O = yn(w, m);
|
|
376
377
|
_n(g, r, d, a);
|
|
377
378
|
const k = hn("vertical", a, I, d), p = D(() => ({
|
|
378
379
|
style: {
|
|
379
380
|
width: "100%",
|
|
380
|
-
height: `${
|
|
381
|
+
height: `${O.value - S.value}px`,
|
|
381
382
|
marginTop: `${S.value}px`
|
|
382
383
|
}
|
|
383
384
|
}));
|
|
@@ -771,8 +772,8 @@ const gt = () => {
|
|
|
771
772
|
}
|
|
772
773
|
return (w, b) => {
|
|
773
774
|
const v = W("fm-icon"), f = W("fm-drop-field");
|
|
774
|
-
return
|
|
775
|
-
e.value ? (
|
|
775
|
+
return $(), J("div", sr, [
|
|
776
|
+
e.value ? ($(), J("div", ur, [
|
|
776
777
|
A("div", dr, [
|
|
777
778
|
A("div", cr, [
|
|
778
779
|
C(o(Ln), {
|
|
@@ -803,7 +804,7 @@ const gt = () => {
|
|
|
803
804
|
C(v, { name: "close" })
|
|
804
805
|
])
|
|
805
806
|
])
|
|
806
|
-
])) : (
|
|
807
|
+
])) : ($(), q(f, {
|
|
807
808
|
key: 1,
|
|
808
809
|
accept: ".jpg, .JPG, .jpeg, .JPEG, .png, .PNG, .gif, .GIF",
|
|
809
810
|
"content-class": "h-[300px] w-[400px]",
|
|
@@ -891,7 +892,7 @@ const gr = {
|
|
|
891
892
|
};
|
|
892
893
|
return (b, v) => {
|
|
893
894
|
const f = W("FmButton"), a = W("FmFormGroup");
|
|
894
|
-
return
|
|
895
|
+
return $(), q(a, {
|
|
895
896
|
tag: "div",
|
|
896
897
|
"model-value": t.value,
|
|
897
898
|
label: o(r)("menu.common.labels.product_image"),
|
|
@@ -906,13 +907,13 @@ const gr = {
|
|
|
906
907
|
},
|
|
907
908
|
src: t.value,
|
|
908
909
|
alt: "Product image"
|
|
909
|
-
}, null, 8, ["src"]), b.disabled ? X("", !0) : (
|
|
910
|
+
}, null, 8, ["src"]), b.disabled ? X("", !0) : ($(), J("div", gr, [A("div", vr, [C(f, {
|
|
910
911
|
icon: t.value ? "edit" : "add",
|
|
911
912
|
variant: "secondary",
|
|
912
913
|
"text-color": o(Fe).NeutralGray400,
|
|
913
914
|
class: "bg-white",
|
|
914
915
|
onClick: w
|
|
915
|
-
}, null, 8, ["icon", "text-color"]), t.value ? (
|
|
916
|
+
}, null, 8, ["icon", "text-color"]), t.value ? ($(), q(f, {
|
|
916
917
|
key: 0,
|
|
917
918
|
icon: "delete",
|
|
918
919
|
"text-color": o(Fe).NeutralGray400,
|
|
@@ -986,8 +987,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
986
987
|
},
|
|
987
988
|
set(i = []) {
|
|
988
989
|
const [_, ...x] = i.map((y) => {
|
|
989
|
-
const
|
|
990
|
-
return
|
|
990
|
+
const P = I.value[y];
|
|
991
|
+
return P || {
|
|
991
992
|
_id: y,
|
|
992
993
|
position: null
|
|
993
994
|
};
|
|
@@ -998,8 +999,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
998
999
|
}
|
|
999
1000
|
d("update:form", "category", _._id), d("update:form", "additionalCategories", x);
|
|
1000
1001
|
}
|
|
1001
|
-
}),
|
|
1002
|
-
ref:
|
|
1002
|
+
}), O = H(), k = () => e.isAddon ? null : C(zn, {
|
|
1003
|
+
ref: O,
|
|
1003
1004
|
disabled: !h.value.category || s(),
|
|
1004
1005
|
items: b.value,
|
|
1005
1006
|
modelValue: S.value,
|
|
@@ -1011,7 +1012,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1011
1012
|
type: "button",
|
|
1012
1013
|
onClick: () => {
|
|
1013
1014
|
var i;
|
|
1014
|
-
(i =
|
|
1015
|
+
(i = O.value) == null || i.hideMenu(), m.create();
|
|
1015
1016
|
}
|
|
1016
1017
|
}, [C(Ie.FmIcon, {
|
|
1017
1018
|
color: "primary",
|
|
@@ -1022,21 +1023,21 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1022
1023
|
}, [l("menu.product.form.detail.category.add_new")])])
|
|
1023
1024
|
});
|
|
1024
1025
|
Ae(() => {
|
|
1025
|
-
!f.value && e.form.category === void 0 && e.isCreate &&
|
|
1026
|
+
!f.value && e.form.category === void 0 && e.isCreate && U(Pe.PRODUCT);
|
|
1026
1027
|
});
|
|
1027
1028
|
const p = D(() => {
|
|
1028
1029
|
var _;
|
|
1029
1030
|
const i = e.form.name || ((_ = e.fallback) == null ? void 0 : _.name);
|
|
1030
1031
|
return i ? t.items.filter((x) => !!x.category && x._id !== e.form._id && x.name === i).length : 0;
|
|
1031
1032
|
}), T = D(() => e.isAddon ? Pe.ADD_ON : Pe.PRODUCT);
|
|
1032
|
-
function
|
|
1033
|
-
var x, y,
|
|
1033
|
+
function U(i) {
|
|
1034
|
+
var x, y, P;
|
|
1034
1035
|
if (T.value === i) return;
|
|
1035
1036
|
const _ = i == Pe.ADD_ON;
|
|
1036
|
-
d("update:form", "category", e.isOverride ? _ ? "" : ((x = e.fallback) == null ? void 0 : x.category) ?? ((y = b.value.find((j) => !!j.value)) == null ? void 0 : y.value) : _ ? null : (
|
|
1037
|
+
d("update:form", "category", e.isOverride ? _ ? "" : ((x = e.fallback) == null ? void 0 : x.category) ?? ((y = b.value.find((j) => !!j.value)) == null ? void 0 : y.value) : _ ? null : (P = b.value.find((j) => !!j.value)) == null ? void 0 : P.value), _ && d("update:form", "additionalCategories", []);
|
|
1037
1038
|
}
|
|
1038
|
-
const
|
|
1039
|
-
async function
|
|
1039
|
+
const M = H(!1);
|
|
1040
|
+
async function F() {
|
|
1040
1041
|
var i, _, x;
|
|
1041
1042
|
if (!e.form.name) {
|
|
1042
1043
|
const y = document.getElementById("product-name");
|
|
@@ -1046,20 +1047,20 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1046
1047
|
} else
|
|
1047
1048
|
return;
|
|
1048
1049
|
}
|
|
1049
|
-
if (!
|
|
1050
|
+
if (!M.value)
|
|
1050
1051
|
try {
|
|
1051
|
-
|
|
1052
|
+
M.value = !0, g.pushDataLayer({
|
|
1052
1053
|
event: "menu_catalog_item_general_remy_suggest_description"
|
|
1053
1054
|
}), We.toggleDialog(!0);
|
|
1054
1055
|
const y = await ((_ = (i = We).getItemDescription) == null ? void 0 : _.call(i, {
|
|
1055
1056
|
name: e.form.name || ""
|
|
1056
|
-
}, !0)),
|
|
1057
|
-
typeof
|
|
1057
|
+
}, !0)), P = (x = y == null ? void 0 : y.data) == null ? void 0 : x.value;
|
|
1058
|
+
typeof P == "string" && d("update:form", "description", P);
|
|
1058
1059
|
} finally {
|
|
1059
|
-
|
|
1060
|
+
M.value = !1;
|
|
1060
1061
|
}
|
|
1061
1062
|
}
|
|
1062
|
-
const
|
|
1063
|
+
const R = D(() => t.subcategories), E = D(() => R.value.map((i) => ({
|
|
1063
1064
|
label: i.name,
|
|
1064
1065
|
value: i._id
|
|
1065
1066
|
}))), u = D({
|
|
@@ -1073,8 +1074,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1073
1074
|
t: l
|
|
1074
1075
|
} = ce();
|
|
1075
1076
|
return (i, _) => {
|
|
1076
|
-
const x = W("fm-text-field"), y = W("fm-textarea"),
|
|
1077
|
-
return
|
|
1077
|
+
const x = W("fm-text-field"), y = W("fm-textarea"), P = W("fm-radio"), j = W("FmSnackbar"), Q = W("FmButton"), le = W("fm-radio-group"), Ce = W("FmFormGroup"), he = Xt("tooltip");
|
|
1078
|
+
return $(), q(De, {
|
|
1078
1079
|
title: o(l)("menu.product.form.detail.title")
|
|
1079
1080
|
}, {
|
|
1080
1081
|
default: B(() => {
|
|
@@ -1107,7 +1108,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1107
1108
|
_: 1
|
|
1108
1109
|
}, 8, ["disabled", "model-value", "placeholder"]), ft(C(Zt, {
|
|
1109
1110
|
class: "absolute top-32 right-4 cursor-pointer",
|
|
1110
|
-
onClick:
|
|
1111
|
+
onClick: F
|
|
1111
1112
|
}, null, 512), [[he, o(dn)("Suggest description")]])])]), C(_r, {
|
|
1112
1113
|
disabled: !h.value.thumbnail,
|
|
1113
1114
|
"item-id": i.form._id || "",
|
|
@@ -1116,23 +1117,23 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1116
1117
|
}, null, 8, ["disabled", "item-id", "model-value"])]), C(Ue, {
|
|
1117
1118
|
label: o(l)("menu.product.form.detail.category.label")
|
|
1118
1119
|
}, {
|
|
1119
|
-
default: B(() => [v.value ? (
|
|
1120
|
+
default: B(() => [v.value ? ($(), q(le, {
|
|
1120
1121
|
key: 0,
|
|
1121
1122
|
disabled: !h.value.category,
|
|
1122
1123
|
"model-value": i.isAddon ? Pe.ADD_ON : Pe.PRODUCT,
|
|
1123
|
-
"onUpdate:modelValue": _[4] || (_[4] = (L) =>
|
|
1124
|
+
"onUpdate:modelValue": _[4] || (_[4] = (L) => U(L))
|
|
1124
1125
|
}, {
|
|
1125
|
-
default: B(() => [A("div", xr, [A("div", Sr, [C(
|
|
1126
|
+
default: B(() => [A("div", xr, [A("div", Sr, [C(P, {
|
|
1126
1127
|
disabled: f.value,
|
|
1127
1128
|
value: Pe.PRODUCT,
|
|
1128
1129
|
label: o(l)("menu.product.form.detail.category.options.product.label"),
|
|
1129
1130
|
sublabel: o(l)("menu.product.form.detail.category.options.product.sublabel")
|
|
1130
1131
|
}, null, 8, ["disabled", "value", "label", "sublabel"]), C(Kn, null, {
|
|
1131
|
-
default: B(() => [o(t).isV4 ? (
|
|
1132
|
+
default: B(() => [o(t).isV4 ? ($(), q(k, {
|
|
1132
1133
|
key: 0
|
|
1133
1134
|
})) : X("", !0)]),
|
|
1134
1135
|
_: 1
|
|
1135
|
-
})]), f.value ? (
|
|
1136
|
+
})]), f.value ? ($(), J("div", Fr, [C(j, {
|
|
1136
1137
|
title: o(l)("menu.product.form.detail.category.add_first"),
|
|
1137
1138
|
variant: "info"
|
|
1138
1139
|
}, null, 8, ["title"]), C(Q, {
|
|
@@ -1140,14 +1141,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1140
1141
|
"prepend-icon": "add",
|
|
1141
1142
|
variant: "secondary",
|
|
1142
1143
|
onClick: o(m).create
|
|
1143
|
-
}, null, 8, ["label", "onClick"])])) : X("", !0), C(
|
|
1144
|
+
}, null, 8, ["label", "onClick"])])) : X("", !0), C(P, {
|
|
1144
1145
|
value: Pe.ADD_ON,
|
|
1145
1146
|
disabled: !1,
|
|
1146
1147
|
label: o(l)("menu.product.form.detail.category.options.addon.label"),
|
|
1147
1148
|
sublabel: o(l)("menu.product.form.detail.category.options.addon.sublabel")
|
|
1148
1149
|
}, null, 8, ["value", "label", "sublabel"])])]),
|
|
1149
1150
|
_: 1
|
|
1150
|
-
}, 8, ["disabled", "model-value"])) : X("", !0), o(t).isV4 ? X("", !0) : (
|
|
1151
|
+
}, 8, ["disabled", "model-value"])) : X("", !0), o(t).isV4 ? X("", !0) : ($(), q(Ce, {
|
|
1151
1152
|
key: 1,
|
|
1152
1153
|
"model-value": i.form.category,
|
|
1153
1154
|
rules: [(L) => !L && !i.isOverride ? "Category is required" : !0]
|
|
@@ -1156,7 +1157,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1156
1157
|
_: 1
|
|
1157
1158
|
}, 8, ["model-value", "rules"]))]),
|
|
1158
1159
|
_: 1
|
|
1159
|
-
}, 8, ["label"]), o(t).isV4 && !i.isAddon ? (
|
|
1160
|
+
}, 8, ["label"]), o(t).isV4 && !i.isAddon ? ($(), q(Ue, {
|
|
1160
1161
|
key: 0,
|
|
1161
1162
|
label: o(l)("menu.product.form.detail.path.label")
|
|
1162
1163
|
}, {
|
|
@@ -1214,7 +1215,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1214
1215
|
position: r.groups.length - 1,
|
|
1215
1216
|
itemsLinked: []
|
|
1216
1217
|
}), g = H(s()), { t: d } = ce();
|
|
1217
|
-
return (h, w) => e.value.create ? (
|
|
1218
|
+
return (h, w) => e.value.create ? ($(), q(o(jr), {
|
|
1218
1219
|
key: 0,
|
|
1219
1220
|
"categorized-items": o(r).categorizedItems,
|
|
1220
1221
|
config: m.value,
|
|
@@ -1266,7 +1267,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1266
1267
|
} = Io(), S = D(() => {
|
|
1267
1268
|
const c = Object.entries(e.group.items).filter(([, V]) => I([V.code || "", V.name || V.fallbackName, p(V.price ?? V.fallbackPrice), T(V.orderFrom || V.fallbackOrder), ...(V.items || []).map((N) => [N.code || "", N.name || N.fallbackName, p(N.price ?? N.fallbackPrice), T(N.orderFrom || N.fallbackOrder)].join(""))]));
|
|
1268
1269
|
return Object.fromEntries(c);
|
|
1269
|
-
}),
|
|
1270
|
+
}), O = (c) => ({
|
|
1270
1271
|
...e.config,
|
|
1271
1272
|
isDefault: e.config.isDefault(c),
|
|
1272
1273
|
link: e.config.link(c),
|
|
@@ -1275,11 +1276,11 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1275
1276
|
}), k = D(() => !0), p = (c) => c ? tt(c, !1) : "", T = (c) => {
|
|
1276
1277
|
var V;
|
|
1277
1278
|
return c == null ? "" : (V = lo()[c]) == null ? void 0 : V.label;
|
|
1278
|
-
},
|
|
1279
|
-
t:
|
|
1280
|
-
} = ce(),
|
|
1279
|
+
}, U = D(() => Object.values(S.value)), M = H({}), {
|
|
1280
|
+
t: F
|
|
1281
|
+
} = ce(), R = H([{
|
|
1281
1282
|
accessorKey: "isDefault",
|
|
1282
|
-
header: () =>
|
|
1283
|
+
header: () => F("menu.group.option.is_default"),
|
|
1283
1284
|
enableSorting: !1,
|
|
1284
1285
|
size: 75,
|
|
1285
1286
|
cell: (c) => {
|
|
@@ -1290,7 +1291,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1290
1291
|
return C(Ie.FmCheckbox, {
|
|
1291
1292
|
value: "default",
|
|
1292
1293
|
modelValue: L,
|
|
1293
|
-
disabled: !
|
|
1294
|
+
disabled: !O(N.combinationKey).isDefault,
|
|
1294
1295
|
"onUpdate:modelValue": (oe) => {
|
|
1295
1296
|
var ee;
|
|
1296
1297
|
if (V) {
|
|
@@ -1304,7 +1305,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1304
1305
|
}
|
|
1305
1306
|
}, {
|
|
1306
1307
|
accessorKey: "code",
|
|
1307
|
-
header: () =>
|
|
1308
|
+
header: () => F("menu.group.option.code"),
|
|
1308
1309
|
enableSorting: !1,
|
|
1309
1310
|
size: 100,
|
|
1310
1311
|
cell: (c) => {
|
|
@@ -1321,15 +1322,15 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1321
1322
|
}
|
|
1322
1323
|
}, {
|
|
1323
1324
|
accessorKey: "name",
|
|
1324
|
-
header: () =>
|
|
1325
|
+
header: () => F("menu.group.option.product_title"),
|
|
1325
1326
|
enableSorting: !1,
|
|
1326
1327
|
cell: (c) => {
|
|
1327
1328
|
const V = c.getValue(), N = c.row.original, L = c.row.depth > 0, G = N.combinationKey ? un(N.combinationKey, se().variants) : null;
|
|
1328
1329
|
return ve("div", ve(Ie.FmTextField, {
|
|
1329
1330
|
modelValue: V,
|
|
1330
1331
|
placeholder: G ?? "",
|
|
1331
|
-
disabled: !
|
|
1332
|
-
rules: G ? void 0 : [(z) => z.length > 0 ||
|
|
1332
|
+
disabled: !O(N.combinationKey).name,
|
|
1333
|
+
rules: G ? void 0 : [(z) => z.length > 0 || F("menu.group.option.product_title_required")],
|
|
1333
1334
|
"onUpdate:modelValue": (z) => {
|
|
1334
1335
|
var oe;
|
|
1335
1336
|
if (L) {
|
|
@@ -1347,7 +1348,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1347
1348
|
name: "keyboard_arrow_up",
|
|
1348
1349
|
onClick: c.row.getToggleExpandedHandler(),
|
|
1349
1350
|
class: ["cursor-pointer", "transition-transform", c.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
1350
|
-
color:
|
|
1351
|
+
color: O(N.combinationKey).name ? void 0 : Fe.NeutralGray200
|
|
1351
1352
|
}) : void 0;
|
|
1352
1353
|
}
|
|
1353
1354
|
}));
|
|
@@ -1357,7 +1358,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1357
1358
|
enableSorting: !1,
|
|
1358
1359
|
header: () => {
|
|
1359
1360
|
var c;
|
|
1360
|
-
return
|
|
1361
|
+
return F("menu.group.option.price", {
|
|
1361
1362
|
symbol: (c = d.value) == null ? void 0 : c.currency.symbol
|
|
1362
1363
|
});
|
|
1363
1364
|
},
|
|
@@ -1365,7 +1366,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1365
1366
|
cell: (c) => {
|
|
1366
1367
|
const V = c.getValue(), N = c.row.original, L = N.fallbackPrice, G = c.row.depth > 0;
|
|
1367
1368
|
return ve(Xe, {
|
|
1368
|
-
disable: !
|
|
1369
|
+
disable: !O(null).priceEdit,
|
|
1369
1370
|
placeholder: L ? tt(L) : void 0,
|
|
1370
1371
|
modelValue: V,
|
|
1371
1372
|
required: !L,
|
|
@@ -1392,7 +1393,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1392
1393
|
}
|
|
1393
1394
|
}, {
|
|
1394
1395
|
accessorKey: "orderFrom",
|
|
1395
|
-
header: () =>
|
|
1396
|
+
header: () => F("menu.common.labels.order_from"),
|
|
1396
1397
|
size: 100,
|
|
1397
1398
|
enableSorting: !1,
|
|
1398
1399
|
cell: (c) => {
|
|
@@ -1400,9 +1401,9 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1400
1401
|
return ve(Dt, {
|
|
1401
1402
|
modelValue: V,
|
|
1402
1403
|
fallback: L,
|
|
1403
|
-
disable: !
|
|
1404
|
+
disable: !O(N.combinationKey).orderFrom,
|
|
1404
1405
|
required: !0,
|
|
1405
|
-
editActiveOnly:
|
|
1406
|
+
editActiveOnly: O(N.combinationKey).orderFromActiveOnly,
|
|
1406
1407
|
"onUpdate:modelValue": (z) => {
|
|
1407
1408
|
var oe;
|
|
1408
1409
|
if (G) {
|
|
@@ -1434,7 +1435,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1434
1435
|
const V = c.row.original, N = c.row.depth > 0;
|
|
1435
1436
|
return C("div", {
|
|
1436
1437
|
class: "flex items-center justify-end"
|
|
1437
|
-
}, [
|
|
1438
|
+
}, [O(null).priceTier && C(en, {
|
|
1438
1439
|
menuStore: g,
|
|
1439
1440
|
priceTiers: V.priceTiers,
|
|
1440
1441
|
"onUpdate:priceTiers": (L) => {
|
|
@@ -1452,7 +1453,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1452
1453
|
} else
|
|
1453
1454
|
l(V._id, "priceTiers", L);
|
|
1454
1455
|
}
|
|
1455
|
-
}, null),
|
|
1456
|
+
}, null), O(V.combinationKey).inventory && C(Et, {
|
|
1456
1457
|
title: "Inventory",
|
|
1457
1458
|
initialValue: V.inventoryBindings ?? [],
|
|
1458
1459
|
name: V.name ?? V.fallbackName ?? "",
|
|
@@ -1490,7 +1491,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1490
1491
|
}, null)];
|
|
1491
1492
|
}
|
|
1492
1493
|
})
|
|
1493
|
-
}),
|
|
1494
|
+
}), O(V.combinationKey).link && C(W("fm-button"), {
|
|
1494
1495
|
variant: He.Tertiary,
|
|
1495
1496
|
prependIcon: "delete",
|
|
1496
1497
|
textColor: Fe.NeutralGray400,
|
|
@@ -1501,7 +1502,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1501
1502
|
if (!z) return;
|
|
1502
1503
|
if ((((G = e.group.items[z._id].items) == null ? void 0 : G.length) || 0) <= 1) {
|
|
1503
1504
|
m.open({
|
|
1504
|
-
title:
|
|
1505
|
+
title: F("menu.group.option.should_link_at_least_one_variant", {
|
|
1505
1506
|
name: z.name
|
|
1506
1507
|
}),
|
|
1507
1508
|
type: "error"
|
|
@@ -1517,9 +1518,9 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1517
1518
|
}]), E = D(() => ({
|
|
1518
1519
|
code: v.value,
|
|
1519
1520
|
name: !0,
|
|
1520
|
-
price:
|
|
1521
|
-
orderFrom:
|
|
1522
|
-
action:
|
|
1521
|
+
price: O(null).price,
|
|
1522
|
+
orderFrom: O(null).showOrderFrom,
|
|
1523
|
+
action: O(null).inventory || O(null).link
|
|
1523
1524
|
}));
|
|
1524
1525
|
async function u() {
|
|
1525
1526
|
const c = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -1577,7 +1578,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1577
1578
|
price: V.price,
|
|
1578
1579
|
variants: io(((N = V.variant) == null ? void 0 : N.variantCombinations) || [], "combinationKey")
|
|
1579
1580
|
}, c;
|
|
1580
|
-
}, {})),
|
|
1581
|
+
}, {})), P = (c) => {
|
|
1581
1582
|
var G, z;
|
|
1582
1583
|
const N = g.state.menu.modules.item.find((oe) => oe._id === c._id), L = c.combinationKey ? {
|
|
1583
1584
|
...(G = N == null ? void 0 : N.variant) == null ? void 0 : G.variantCombinations.find((oe) => oe.combinationKey === c.combinationKey),
|
|
@@ -1592,7 +1593,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1592
1593
|
const L = V.items.find((z) => z._id == N._id && z.combinationKey == N.combinationKey), G = y.value[N._id];
|
|
1593
1594
|
return L || {
|
|
1594
1595
|
...N,
|
|
1595
|
-
name:
|
|
1596
|
+
name: P(N),
|
|
1596
1597
|
price: N.combinationKey ? G.variants[N.combinationKey || ""].price : G.price,
|
|
1597
1598
|
orderFrom: te.F_ORDER_FROM.enum.ALL
|
|
1598
1599
|
};
|
|
@@ -1609,17 +1610,17 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1609
1610
|
const Ce = po(), he = D(() => Ce.breakpoints.value.xs);
|
|
1610
1611
|
return (c, V) => {
|
|
1611
1612
|
const N = W("fm-button"), L = W("fm-table");
|
|
1612
|
-
return
|
|
1613
|
-
title: o(
|
|
1613
|
+
return $(), q(De, {
|
|
1614
|
+
title: o(F)("menu.group.option.title")
|
|
1614
1615
|
}, {
|
|
1615
|
-
"append-title": B(() => [c.config.link() ? (
|
|
1616
|
+
"append-title": B(() => [c.config.link() ? ($(), J(Oe, {
|
|
1616
1617
|
key: 0
|
|
1617
|
-
}, [b.value ? (
|
|
1618
|
+
}, [b.value ? ($(), J("div", Pr, [C(xt, {
|
|
1618
1619
|
"categorized-items": c.categorizedItems,
|
|
1619
1620
|
"initial-value": f.value,
|
|
1620
1621
|
"show-variant": c.config.bindToVariant,
|
|
1621
1622
|
"select-variant": "",
|
|
1622
|
-
title: o(
|
|
1623
|
+
title: o(F)("menu.group.option.link_products"),
|
|
1623
1624
|
"is-local-only": !0,
|
|
1624
1625
|
onSubmit: V[0] || (V[0] = ({
|
|
1625
1626
|
items: G
|
|
@@ -1631,31 +1632,31 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1631
1632
|
"text-color": o(Fe).ColorPrimary,
|
|
1632
1633
|
"border-color": o(Fe).ColorPrimary,
|
|
1633
1634
|
variant: "secondary",
|
|
1634
|
-
label: o(
|
|
1635
|
+
label: o(F)("menu.group.option.link_products"),
|
|
1635
1636
|
"prepend-icon": "link",
|
|
1636
1637
|
onClick: G
|
|
1637
1638
|
}, null, 8, ["text-color", "border-color", "label", "onClick"])]),
|
|
1638
1639
|
_: 1
|
|
1639
|
-
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (
|
|
1640
|
+
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : ($(), J("div", Ur, [C(N, {
|
|
1640
1641
|
"text-color": o(Fe).ColorPrimary,
|
|
1641
1642
|
"border-color": o(Fe).ColorPrimary,
|
|
1642
1643
|
variant: "secondary",
|
|
1643
|
-
label: o(
|
|
1644
|
+
label: o(F)("menu.group.option.add_option"),
|
|
1644
1645
|
"prepend-icon": "add",
|
|
1645
1646
|
onClick: u
|
|
1646
1647
|
}, null, 8, ["text-color", "border-color", "label"])]))], 64)) : X("", !0)]),
|
|
1647
1648
|
default: B(() => [A("div", Rr, [A("div", Mr, [C(L, {
|
|
1648
|
-
"column-defs":
|
|
1649
|
+
"column-defs": R.value,
|
|
1649
1650
|
"column-visibility": E.value,
|
|
1650
|
-
draggable: !he.value &&
|
|
1651
|
-
"expanded-state": h.value ? {} :
|
|
1651
|
+
draggable: !he.value && O(null).name,
|
|
1652
|
+
"expanded-state": h.value ? {} : M.value,
|
|
1652
1653
|
"get-sub-row": Q,
|
|
1653
1654
|
"page-size": 999,
|
|
1654
|
-
"row-data":
|
|
1655
|
+
"row-data": U.value,
|
|
1655
1656
|
"search-value": o(a),
|
|
1656
1657
|
"shrink-at": !1,
|
|
1657
1658
|
"hide-footer": "",
|
|
1658
|
-
"onUpdate:expandedState": V[1] || (V[1] = (G) =>
|
|
1659
|
+
"onUpdate:expandedState": V[1] || (V[1] = (G) => M.value = G),
|
|
1659
1660
|
onDndChanged: V[2] || (V[2] = (G) => le(G)),
|
|
1660
1661
|
"onUpdate:dragging": V[3] || (V[3] = (G) => h.value = G)
|
|
1661
1662
|
}, null, 8, ["column-defs", "column-visibility", "draggable", "expanded-state", "row-data", "search-value"])])])]),
|
|
@@ -1683,7 +1684,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1683
1684
|
() => t.group
|
|
1684
1685
|
), f = H(!1), a = H(!1), I = (y) => {
|
|
1685
1686
|
Rt.isBoolean(y) ? a.value = y : a.value = !a.value;
|
|
1686
|
-
}, S = D(() => t.group ? t.config(t.group) : null),
|
|
1687
|
+
}, S = D(() => t.group ? t.config(t.group) : null), O = D(() => jn(S.value)), k = (y) => O.value.includes(y), p = D(() => [
|
|
1687
1688
|
{
|
|
1688
1689
|
label: "Normal",
|
|
1689
1690
|
value: te.F_ADDON_GROUP_TYPE.enum.NORMAL
|
|
@@ -1700,8 +1701,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1700
1701
|
function T(y) {
|
|
1701
1702
|
m("update:group", y);
|
|
1702
1703
|
}
|
|
1703
|
-
function
|
|
1704
|
-
function
|
|
1704
|
+
function U(y) {
|
|
1705
|
+
function P() {
|
|
1705
1706
|
T({
|
|
1706
1707
|
...t.group,
|
|
1707
1708
|
items: {},
|
|
@@ -1719,23 +1720,23 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1719
1720
|
text: "No",
|
|
1720
1721
|
close: !0
|
|
1721
1722
|
}
|
|
1722
|
-
}).onPrimary(
|
|
1723
|
+
}).onPrimary(P) : P();
|
|
1723
1724
|
}
|
|
1724
|
-
function
|
|
1725
|
+
function M(y) {
|
|
1725
1726
|
return new nn(s, h.updateMenu, d).mapGroups(
|
|
1726
1727
|
[y],
|
|
1727
1728
|
S.value.isOverride
|
|
1728
1729
|
)[0];
|
|
1729
1730
|
}
|
|
1730
|
-
const
|
|
1731
|
-
() => !ke.isEqual(t.group,
|
|
1731
|
+
const F = H(ke.clone(t.group)), R = Ut(
|
|
1732
|
+
() => !ke.isEqual(t.group, F.value),
|
|
1732
1733
|
() => {
|
|
1733
1734
|
a.value = !1;
|
|
1734
1735
|
}
|
|
1735
1736
|
), E = D(() => t.action === "add" ? x("common.add") : x("common.update"));
|
|
1736
1737
|
async function u() {
|
|
1737
1738
|
if (t.action === "add") {
|
|
1738
|
-
const { group: y, linkItems:
|
|
1739
|
+
const { group: y, linkItems: P } = Hn(t.group), j = {
|
|
1739
1740
|
module: te.F_MENU_MODULE_V4_KEY.enum.group,
|
|
1740
1741
|
operation: _e.F_OPERATION_TYPE.create,
|
|
1741
1742
|
data: y,
|
|
@@ -1743,7 +1744,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1743
1744
|
{
|
|
1744
1745
|
module: te.F_MENU_MODULE_V4_KEY.enum.item,
|
|
1745
1746
|
id: "",
|
|
1746
|
-
data:
|
|
1747
|
+
data: P
|
|
1747
1748
|
}
|
|
1748
1749
|
]
|
|
1749
1750
|
};
|
|
@@ -1754,7 +1755,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1754
1755
|
ye(
|
|
1755
1756
|
() => a.value,
|
|
1756
1757
|
async (y) => {
|
|
1757
|
-
m("status:show", y), y && (await nt(),
|
|
1758
|
+
m("status:show", y), y && (await nt(), F.value = ke.clone(t.group));
|
|
1758
1759
|
}
|
|
1759
1760
|
);
|
|
1760
1761
|
const l = D(() => {
|
|
@@ -1762,9 +1763,9 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1762
1763
|
return ((y = g.groupAttributeSettings) == null ? void 0 : y.value.length) > 0 && !S.value.isOverride;
|
|
1763
1764
|
}), i = D(() => {
|
|
1764
1765
|
const y = {};
|
|
1765
|
-
return s.state.menu.modules.group.forEach((
|
|
1766
|
+
return s.state.menu.modules.group.forEach((P) => {
|
|
1766
1767
|
var j;
|
|
1767
|
-
for (const [Q, le] of Object.entries(
|
|
1768
|
+
for (const [Q, le] of Object.entries(P.customAttributes || {}))
|
|
1768
1769
|
typeof le == "string" && le && !((j = y[Q]) != null && j.includes(le)) && (y[Q] = [...y[Q] || [], le]);
|
|
1769
1770
|
}), y;
|
|
1770
1771
|
}), _ = (y) => {
|
|
@@ -1778,21 +1779,21 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1778
1779
|
show: a
|
|
1779
1780
|
});
|
|
1780
1781
|
const { t: x } = ce();
|
|
1781
|
-
return (y,
|
|
1782
|
+
return (y, P) => {
|
|
1782
1783
|
const j = W("fm-text-field"), Q = W("fm-stepper-field"), le = W("FmFormGroup"), Ce = W("fm-radio"), he = W("fm-radio-group"), c = W("fm-switch"), V = W("FormSection"), N = W("fm-button"), L = W("fm-side-sheet");
|
|
1783
|
-
return
|
|
1784
|
+
return $(), J(Oe, null, [
|
|
1784
1785
|
Me(y.$slots, "default", { trigger: I }),
|
|
1785
1786
|
C(L, {
|
|
1786
1787
|
id: "group-form",
|
|
1787
1788
|
modelValue: a.value,
|
|
1788
|
-
"onUpdate:modelValue":
|
|
1789
|
+
"onUpdate:modelValue": P[8] || (P[8] = (G) => a.value = G),
|
|
1789
1790
|
"is-container": o(Ie).FmForm,
|
|
1790
1791
|
"is-container-props": {
|
|
1791
1792
|
onValidationSuccess: u,
|
|
1792
1793
|
blameFormChildOnValidationFailed: !0
|
|
1793
1794
|
},
|
|
1794
1795
|
"max-width": 720,
|
|
1795
|
-
"onOn:clickedAway": o(
|
|
1796
|
+
"onOn:clickedAway": o(R)
|
|
1796
1797
|
}, {
|
|
1797
1798
|
"side-sheet-header": B(() => [
|
|
1798
1799
|
A("p", Nr, ge(y.title), 1)
|
|
@@ -1810,19 +1811,19 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1810
1811
|
label: o(x)("menu.common.actions.cancel"),
|
|
1811
1812
|
size: "lg",
|
|
1812
1813
|
variant: "tertiary",
|
|
1813
|
-
onClick:
|
|
1814
|
+
onClick: P[7] || (P[7] = () => a.value = !1)
|
|
1814
1815
|
}, null, 8, ["label"])
|
|
1815
1816
|
])
|
|
1816
1817
|
]),
|
|
1817
1818
|
default: B(() => [
|
|
1818
|
-
y.group ? (
|
|
1819
|
+
y.group ? ($(), J("div", Lr, [
|
|
1819
1820
|
Me(y.$slots, "variant-section"),
|
|
1820
1821
|
C(go, null, {
|
|
1821
1822
|
default: B(() => [
|
|
1822
1823
|
A("div", null, [
|
|
1823
1824
|
C(j, {
|
|
1824
1825
|
modelValue: y.group.name,
|
|
1825
|
-
"onUpdate:modelValue":
|
|
1826
|
+
"onUpdate:modelValue": P[0] || (P[0] = (G) => y.group.name = G),
|
|
1826
1827
|
disabled: k("name"),
|
|
1827
1828
|
rules: [
|
|
1828
1829
|
(G) => !!G || o(x)("menu.common.validation.required", { field: o(x)("menu.common.labels.group_name") })
|
|
@@ -1840,7 +1841,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1840
1841
|
default: B(() => [
|
|
1841
1842
|
C(Q, {
|
|
1842
1843
|
modelValue: y.group.min,
|
|
1843
|
-
"onUpdate:modelValue":
|
|
1844
|
+
"onUpdate:modelValue": P[1] || (P[1] = (G) => y.group.min = G),
|
|
1844
1845
|
disabled: k("min"),
|
|
1845
1846
|
min: 0,
|
|
1846
1847
|
class: "flex-1",
|
|
@@ -1848,7 +1849,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1848
1849
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
1849
1850
|
C(Q, {
|
|
1850
1851
|
modelValue: y.group.max,
|
|
1851
|
-
"onUpdate:modelValue":
|
|
1852
|
+
"onUpdate:modelValue": P[2] || (P[2] = (G) => y.group.max = G),
|
|
1852
1853
|
disabled: k("max"),
|
|
1853
1854
|
min: y.group.min,
|
|
1854
1855
|
class: "flex-1",
|
|
@@ -1860,7 +1861,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1860
1861
|
]),
|
|
1861
1862
|
_: 1
|
|
1862
1863
|
}, 8, ["model-value", "rules"]),
|
|
1863
|
-
S.value.type ? (
|
|
1864
|
+
S.value.type ? ($(), q(Ue, {
|
|
1864
1865
|
key: 0,
|
|
1865
1866
|
label: o(x)("menu.common.labels.group_type")
|
|
1866
1867
|
}, {
|
|
@@ -1868,10 +1869,10 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1868
1869
|
C(he, {
|
|
1869
1870
|
disabled: k("type"),
|
|
1870
1871
|
"model-value": y.group.type,
|
|
1871
|
-
"onUpdate:modelValue":
|
|
1872
|
+
"onUpdate:modelValue": P[3] || (P[3] = (G) => U(G))
|
|
1872
1873
|
}, {
|
|
1873
1874
|
default: B(() => [
|
|
1874
|
-
(
|
|
1875
|
+
($(!0), J(Oe, null, Ne(p.value, (G) => ($(), q(Ce, {
|
|
1875
1876
|
key: G.value,
|
|
1876
1877
|
label: o(x)(`menu.group.types.${G.label.toLowerCase()}`),
|
|
1877
1878
|
value: G.value
|
|
@@ -1888,7 +1889,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1888
1889
|
default: B(() => [
|
|
1889
1890
|
C(c, {
|
|
1890
1891
|
modelValue: y.group.stackable,
|
|
1891
|
-
"onUpdate:modelValue":
|
|
1892
|
+
"onUpdate:modelValue": P[4] || (P[4] = (G) => y.group.stackable = G),
|
|
1892
1893
|
disabled: k("stackable"),
|
|
1893
1894
|
label: o(x)("menu.common.labels.stackable"),
|
|
1894
1895
|
"label-placement": "right",
|
|
@@ -1897,7 +1898,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1897
1898
|
]),
|
|
1898
1899
|
_: 1
|
|
1899
1900
|
}, 8, ["label"]),
|
|
1900
|
-
l.value ? (
|
|
1901
|
+
l.value ? ($(), q(V, {
|
|
1901
1902
|
key: 1,
|
|
1902
1903
|
title: o(x)("menu.group.form.tagging.title"),
|
|
1903
1904
|
"sub-title": o(x)("menu.group.form.tagging.subtitle")
|
|
@@ -1930,8 +1931,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1930
1931
|
"categorized-items": y.categorizedItems,
|
|
1931
1932
|
config: S.value,
|
|
1932
1933
|
group: y.group,
|
|
1933
|
-
"onUpdate:group":
|
|
1934
|
-
"onUpdate:unmapGroup":
|
|
1934
|
+
"onUpdate:group": P[5] || (P[5] = (G) => T(G)),
|
|
1935
|
+
"onUpdate:unmapGroup": P[6] || (P[6] = (G) => T(M(G)))
|
|
1935
1936
|
}, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
|
|
1936
1937
|
]),
|
|
1937
1938
|
_: 1
|
|
@@ -1952,26 +1953,26 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1952
1953
|
},
|
|
1953
1954
|
emits: ["update:combinations"],
|
|
1954
1955
|
setup(n, { expose: r, emit: e }) {
|
|
1955
|
-
var
|
|
1956
|
+
var U, M;
|
|
1956
1957
|
const t = n, m = e, s = se(), g = Ge(), d = Vt(ot(Re())), h = H([]), w = H(t.combinations[0].combinationKey || ""), b = D(
|
|
1957
|
-
() => h.value.findIndex((
|
|
1958
|
+
() => h.value.findIndex((F) => F.combinationKey == w.value)
|
|
1958
1959
|
), v = D(
|
|
1959
|
-
() => t.combinations.map((
|
|
1960
|
-
label: t.fullCombinations[
|
|
1961
|
-
value:
|
|
1960
|
+
() => t.combinations.map((F) => ({
|
|
1961
|
+
label: t.fullCombinations[F.combinationKey || ""],
|
|
1962
|
+
value: F.combinationKey || ""
|
|
1962
1963
|
}))
|
|
1963
1964
|
), f = D(() => {
|
|
1964
1965
|
var i, _;
|
|
1965
1966
|
if (!k.value) return null;
|
|
1966
|
-
const
|
|
1967
|
+
const F = ((_ = (i = h.value[b.value]) == null ? void 0 : i.groups) == null ? void 0 : _.find((x) => x._id === t.groupId)) || {
|
|
1967
1968
|
_id: t.groupId,
|
|
1968
1969
|
groupKey: ""
|
|
1969
|
-
}, E = s.state.menu.modules.group.find((x) => x._id === t.groupId), u = Object.entries({ ...
|
|
1970
|
+
}, E = s.state.menu.modules.group.find((x) => x._id === t.groupId), u = Object.entries({ ...F, items: void 0 }).filter(([, x]) => !!x), l = {
|
|
1970
1971
|
...E,
|
|
1971
1972
|
...Object.fromEntries(u),
|
|
1972
1973
|
items: E.items.map((x) => {
|
|
1973
|
-
var
|
|
1974
|
-
const y = (
|
|
1974
|
+
var P;
|
|
1975
|
+
const y = (P = F.items) == null ? void 0 : P.find(
|
|
1975
1976
|
(j) => j._id == x._id && j.combinationKey == x.combinationKey
|
|
1976
1977
|
);
|
|
1977
1978
|
return {
|
|
@@ -1985,28 +1986,28 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1985
1986
|
};
|
|
1986
1987
|
return new nn(s, d.updateMenu, g).mapGroups([l], !0)[0];
|
|
1987
1988
|
});
|
|
1988
|
-
function a(
|
|
1989
|
+
function a(F) {
|
|
1989
1990
|
var l, i;
|
|
1990
|
-
const
|
|
1991
|
+
const R = (l = h.value[b.value].groups) == null ? void 0 : l.findIndex(
|
|
1991
1992
|
(_) => _._id === t.groupId
|
|
1992
|
-
), E = me(h.value), u = { ...tn(
|
|
1993
|
-
(
|
|
1993
|
+
), E = me(h.value), u = { ...tn(F), _id: t.groupId, groupKey: "" };
|
|
1994
|
+
(R ?? -1) < 0 ? E[b.value] = {
|
|
1994
1995
|
...E[b.value],
|
|
1995
1996
|
groups: [...((i = E[b.value]) == null ? void 0 : i.groups) || [], u]
|
|
1996
|
-
} : E[b.value].groups[
|
|
1997
|
+
} : E[b.value].groups[R] = u, h.value = E;
|
|
1997
1998
|
}
|
|
1998
|
-
function I(
|
|
1999
|
-
const
|
|
1999
|
+
function I(F) {
|
|
2000
|
+
const R = v.value.length;
|
|
2000
2001
|
let E = b.value;
|
|
2001
|
-
|
|
2002
|
+
F === "left" ? E = E === 0 ? R - 1 : E - 1 : E = E === R - 1 ? 0 : E + 1, w.value = v.value[E].value;
|
|
2002
2003
|
}
|
|
2003
|
-
function S(
|
|
2004
|
+
function S(F) {
|
|
2004
2005
|
return {
|
|
2005
2006
|
isV4: s.version === te.F_MENU_VERSION.enum.v4,
|
|
2006
|
-
isDefault: (
|
|
2007
|
-
link: (
|
|
2008
|
-
orderFrom: (
|
|
2009
|
-
name: (
|
|
2007
|
+
isDefault: (R) => !1,
|
|
2008
|
+
link: (R) => !1,
|
|
2009
|
+
orderFrom: (R) => !0,
|
|
2010
|
+
name: (R) => !1,
|
|
2010
2011
|
bindToVariant: !1,
|
|
2011
2012
|
inventory: !0,
|
|
2012
2013
|
orderFromActiveOnly: s.rules.item.orderFromActiveOnly,
|
|
@@ -2019,34 +2020,34 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2019
2020
|
isOverride: !0
|
|
2020
2021
|
};
|
|
2021
2022
|
}
|
|
2022
|
-
function
|
|
2023
|
-
const
|
|
2023
|
+
function O() {
|
|
2024
|
+
const F = h.value.map((R) => {
|
|
2024
2025
|
var E;
|
|
2025
2026
|
return {
|
|
2026
|
-
...
|
|
2027
|
-
groups: (E =
|
|
2027
|
+
...R,
|
|
2028
|
+
groups: (E = R.groups) == null ? void 0 : E.map((u) => ({
|
|
2028
2029
|
...qn(u, S())
|
|
2029
2030
|
}))
|
|
2030
2031
|
};
|
|
2031
2032
|
});
|
|
2032
|
-
m("update:combinations",
|
|
2033
|
+
m("update:combinations", F);
|
|
2033
2034
|
}
|
|
2034
2035
|
const k = H(!1);
|
|
2035
2036
|
ye(
|
|
2036
2037
|
() => k.value,
|
|
2037
|
-
(
|
|
2038
|
-
|
|
2038
|
+
(F) => {
|
|
2039
|
+
F && (h.value = me(t.combinations), w.value = t.combinations[0].combinationKey || "");
|
|
2039
2040
|
}
|
|
2040
2041
|
);
|
|
2041
2042
|
const p = H();
|
|
2042
2043
|
r({
|
|
2043
|
-
show: (
|
|
2044
|
-
trigger: (
|
|
2044
|
+
show: (U = p.value) == null ? void 0 : U.show,
|
|
2045
|
+
trigger: (M = p.value) == null ? void 0 : M.trigger
|
|
2045
2046
|
});
|
|
2046
2047
|
const { t: T } = ce();
|
|
2047
|
-
return (
|
|
2048
|
+
return (F, R) => {
|
|
2048
2049
|
const E = W("fm-select"), u = W("fm-button"), l = W("fm-card");
|
|
2049
|
-
return
|
|
2050
|
+
return $(), q(In, {
|
|
2050
2051
|
ref_key: "baseFormRef",
|
|
2051
2052
|
ref: p,
|
|
2052
2053
|
"allow-refund-inventory": !0,
|
|
@@ -2055,15 +2056,15 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2055
2056
|
group: f.value,
|
|
2056
2057
|
action: "update",
|
|
2057
2058
|
title: o(T)("menu.group.update"),
|
|
2058
|
-
"onUpdate:group":
|
|
2059
|
-
"onSubmit:group":
|
|
2060
|
-
"onStatus:show":
|
|
2059
|
+
"onUpdate:group": R[3] || (R[3] = (i) => a(i)),
|
|
2060
|
+
"onSubmit:group": R[4] || (R[4] = (i) => O()),
|
|
2061
|
+
"onStatus:show": R[5] || (R[5] = (i) => k.value = i)
|
|
2061
2062
|
}, {
|
|
2062
2063
|
default: B(({ trigger: i }) => [
|
|
2063
|
-
Me(
|
|
2064
|
+
Me(F.$slots, "default", { trigger: i })
|
|
2064
2065
|
]),
|
|
2065
2066
|
"variant-section": B(() => [
|
|
2066
|
-
w.value ? (
|
|
2067
|
+
w.value ? ($(), q(l, {
|
|
2067
2068
|
key: 0,
|
|
2068
2069
|
class: "p-16 bg-fm-color-neutral-gray-100 space-y-24",
|
|
2069
2070
|
variant: "outlined"
|
|
@@ -2073,7 +2074,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2073
2074
|
A("div", Br, [
|
|
2074
2075
|
C(E, {
|
|
2075
2076
|
modelValue: w.value,
|
|
2076
|
-
"onUpdate:modelValue":
|
|
2077
|
+
"onUpdate:modelValue": R[0] || (R[0] = (i) => w.value = i),
|
|
2077
2078
|
items: v.value,
|
|
2078
2079
|
class: "flex-1"
|
|
2079
2080
|
}, null, 8, ["modelValue", "items"]),
|
|
@@ -2082,13 +2083,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2082
2083
|
variant: o(He).Tertiary,
|
|
2083
2084
|
"prepend-icon": "keyboard_arrow_left",
|
|
2084
2085
|
size: "lg",
|
|
2085
|
-
onClick:
|
|
2086
|
+
onClick: R[1] || (R[1] = (i) => I("left"))
|
|
2086
2087
|
}, null, 8, ["variant"]),
|
|
2087
2088
|
C(u, {
|
|
2088
2089
|
variant: o(He).Tertiary,
|
|
2089
2090
|
"prepend-icon": "keyboard_arrow_right",
|
|
2090
2091
|
size: "lg",
|
|
2091
|
-
onClick:
|
|
2092
|
+
onClick: R[2] || (R[2] = (i) => I("right"))
|
|
2092
2093
|
}, null, 8, ["variant"])
|
|
2093
2094
|
])
|
|
2094
2095
|
])
|
|
@@ -2113,34 +2114,34 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2113
2114
|
},
|
|
2114
2115
|
setup(n) {
|
|
2115
2116
|
const r = n, e = Ge(), { emitData: t, emitAction: m } = Pt(), s = se(), g = D(() => s.rules.group), d = D(() => s.groups);
|
|
2116
|
-
function h(
|
|
2117
|
-
return me(
|
|
2117
|
+
function h(O) {
|
|
2118
|
+
return me(O ?? []).sort((p, T) => p.position - T.position);
|
|
2118
2119
|
}
|
|
2119
|
-
const w = D(() => h(d.value).reduce((
|
|
2120
|
+
const w = D(() => h(d.value).reduce((O, k) => (O[k._id] = {
|
|
2120
2121
|
name: k.name,
|
|
2121
2122
|
type: on(s.items, k.items)
|
|
2122
|
-
},
|
|
2123
|
-
...Object.entries(w.value).map(([
|
|
2123
|
+
}, O), {})), b = D(() => [
|
|
2124
|
+
...Object.entries(w.value).map(([O, { name: k, type: p }]) => ({
|
|
2124
2125
|
label: `${k} ${g.value.type ? `(${Tt(p)})` : ""}`.trim(),
|
|
2125
|
-
value:
|
|
2126
|
+
value: O
|
|
2126
2127
|
}))
|
|
2127
2128
|
]), v = D(() => !!s.state.currentCatalogId || !!s.state.currentSchedulerId);
|
|
2128
2129
|
D(() => {
|
|
2129
|
-
const
|
|
2130
|
-
return function(
|
|
2130
|
+
const O = !s.state.currentSchedulerId, k = s.rules.group.type, p = s.version == te.F_MENU_VERSION.enum.v3, T = s.rules.item.orderFromActiveOnly, U = s.rules.item.bindToVariant;
|
|
2131
|
+
return function(F) {
|
|
2131
2132
|
return {
|
|
2132
|
-
isDefault: (
|
|
2133
|
-
link: (
|
|
2134
|
-
name: (
|
|
2135
|
-
type: k && !
|
|
2136
|
-
price:
|
|
2133
|
+
isDefault: (R) => !v.value && !R,
|
|
2134
|
+
link: (R) => !v.value && (!R || U),
|
|
2135
|
+
name: (R) => !v.value && !R,
|
|
2136
|
+
type: k && !F._id && !v.value,
|
|
2137
|
+
price: F.type != te.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
2137
2138
|
priceEdit: !0,
|
|
2138
2139
|
priceTier: s.isV4,
|
|
2139
|
-
inventory:
|
|
2140
|
-
orderFrom: (
|
|
2140
|
+
inventory: O ? p ? !v.value && F.type == te.F_ADDON_GROUP_TYPE.enum.NORMAL : !v.value : !1,
|
|
2141
|
+
orderFrom: (R) => O ? p ? F.type == te.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? v.value : !!v.value == !R : v.value : !1,
|
|
2141
2142
|
orderFromActiveOnly: T,
|
|
2142
|
-
showOrderFrom:
|
|
2143
|
-
bindToVariant:
|
|
2143
|
+
showOrderFrom: O ? p ? v.value ? !0 : F.type == te.F_ADDON_GROUP_TYPE.enum.PRODUCT : v.value : !1,
|
|
2144
|
+
bindToVariant: U,
|
|
2144
2145
|
isOverride: v.value,
|
|
2145
2146
|
isItemGroup: !1,
|
|
2146
2147
|
isV4: !p
|
|
@@ -2156,71 +2157,71 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2156
2157
|
const f = H(me(r.groupIds || [])), a = H(""), { t: I } = ce(), S = () => {
|
|
2157
2158
|
t(f.value), m("primary"), e.close();
|
|
2158
2159
|
};
|
|
2159
|
-
return (
|
|
2160
|
-
const p = W("FmSearch"), T = W("FmCheckbox"),
|
|
2161
|
-
return b.value.length > 0 ? (
|
|
2160
|
+
return (O, k) => {
|
|
2161
|
+
const p = W("FmSearch"), T = W("FmCheckbox"), U = W("FmButton");
|
|
2162
|
+
return b.value.length > 0 ? ($(), J("div", Hr, [
|
|
2162
2163
|
A("div", null, [
|
|
2163
2164
|
C(p, {
|
|
2164
2165
|
autofocus: "",
|
|
2165
2166
|
modelValue: a.value,
|
|
2166
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
2167
|
+
"onUpdate:modelValue": k[0] || (k[0] = (M) => a.value = M),
|
|
2167
2168
|
placeholder: o(I)("menu.common.labels.search_groups")
|
|
2168
2169
|
}, null, 8, ["modelValue", "placeholder"])
|
|
2169
2170
|
]),
|
|
2170
2171
|
A("div", qr, [
|
|
2171
2172
|
A("div", null, [
|
|
2172
|
-
(
|
|
2173
|
-
key:
|
|
2173
|
+
($(!0), J(Oe, null, Ne(b.value, (M) => ($(), J("div", {
|
|
2174
|
+
key: M.value
|
|
2174
2175
|
}, [
|
|
2175
2176
|
ft(C(T, {
|
|
2176
2177
|
modelValue: f.value,
|
|
2177
2178
|
"onUpdate:modelValue": [
|
|
2178
|
-
k[1] || (k[1] = (
|
|
2179
|
-
k[2] || (k[2] = (
|
|
2179
|
+
k[1] || (k[1] = (F) => f.value = F),
|
|
2180
|
+
k[2] || (k[2] = (F) => o(t)(f.value))
|
|
2180
2181
|
],
|
|
2181
|
-
label:
|
|
2182
|
-
value:
|
|
2182
|
+
label: M.label,
|
|
2183
|
+
value: M.value
|
|
2183
2184
|
}, null, 8, ["modelValue", "label", "value"]), [
|
|
2184
|
-
[Jt,
|
|
2185
|
+
[Jt, M.label.toLowerCase().includes(a.value.toLowerCase())]
|
|
2185
2186
|
])
|
|
2186
2187
|
]))), 128))
|
|
2187
2188
|
])
|
|
2188
2189
|
]),
|
|
2189
2190
|
A("div", Xr, [
|
|
2190
2191
|
C(o(jt), null, {
|
|
2191
|
-
default: B(({ trigger:
|
|
2192
|
-
C(
|
|
2192
|
+
default: B(({ trigger: M }) => [
|
|
2193
|
+
C(U, {
|
|
2193
2194
|
label: o(I)("menu.common.actions.add_group"),
|
|
2194
2195
|
variant: "tertiary",
|
|
2195
2196
|
"text-color": "primary",
|
|
2196
|
-
onClick: (
|
|
2197
|
+
onClick: (F) => M()
|
|
2197
2198
|
}, null, 8, ["label", "onClick"])
|
|
2198
2199
|
]),
|
|
2199
2200
|
_: 1
|
|
2200
2201
|
}),
|
|
2201
2202
|
A("div", Jr, [
|
|
2202
|
-
C(
|
|
2203
|
+
C(U, {
|
|
2203
2204
|
label: o(I)("menu.common.actions.cancel"),
|
|
2204
2205
|
variant: "tertiary",
|
|
2205
|
-
onClick: k[3] || (k[3] = (
|
|
2206
|
+
onClick: k[3] || (k[3] = (M) => o(e).close())
|
|
2206
2207
|
}, null, 8, ["label"]),
|
|
2207
|
-
C(
|
|
2208
|
+
C(U, {
|
|
2208
2209
|
label: o(I)("menu.common.actions.confirm"),
|
|
2209
|
-
onClick: k[4] || (k[4] = (
|
|
2210
|
+
onClick: k[4] || (k[4] = (M) => S())
|
|
2210
2211
|
}, null, 8, ["label"])
|
|
2211
2212
|
])
|
|
2212
2213
|
])
|
|
2213
|
-
])) : (
|
|
2214
|
+
])) : ($(), J("div", Qr, [
|
|
2214
2215
|
A("div", Zr, [
|
|
2215
2216
|
A("p", ea, ge(o(I)("menu.common.empty.no_group.title")), 1),
|
|
2216
2217
|
A("p", ta, ge(o(I)("menu.common.empty.no_group.subtitle")), 1)
|
|
2217
2218
|
]),
|
|
2218
2219
|
C(o(jt), null, {
|
|
2219
|
-
default: B(({ trigger:
|
|
2220
|
-
C(
|
|
2220
|
+
default: B(({ trigger: M }) => [
|
|
2221
|
+
C(U, {
|
|
2221
2222
|
label: o(I)("menu.common.actions.add_group"),
|
|
2222
2223
|
icon: "add",
|
|
2223
|
-
onClick: (
|
|
2224
|
+
onClick: (F) => M()
|
|
2224
2225
|
}, null, 8, ["label", "onClick"])
|
|
2225
2226
|
]),
|
|
2226
2227
|
_: 1
|
|
@@ -2250,7 +2251,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2250
2251
|
} = ce(), g = r, d = D(() => t.rules.group), h = D(() => t.rules.item), w = D(() => t.groups);
|
|
2251
2252
|
function b(l, i) {
|
|
2252
2253
|
return me(i ?? []).map((x) => {
|
|
2253
|
-
const y = l.find((
|
|
2254
|
+
const y = l.find((P) => P._id === x._id);
|
|
2254
2255
|
return {
|
|
2255
2256
|
name: (y == null ? void 0 : y.name) ?? "",
|
|
2256
2257
|
...x,
|
|
@@ -2273,17 +2274,17 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2273
2274
|
return i.items.forEach((y) => {
|
|
2274
2275
|
if (y.combinationKey)
|
|
2275
2276
|
return;
|
|
2276
|
-
const
|
|
2277
|
+
const P = t.items.find((Q) => Q._id === y._id), j = i.items.filter((Q) => Q._id === y._id && Q.combinationKey).length;
|
|
2277
2278
|
_.push({
|
|
2278
|
-
code: y.code || (
|
|
2279
|
-
name: y.name || (
|
|
2279
|
+
code: y.code || (P == null ? void 0 : P.code),
|
|
2280
|
+
name: y.name || (P == null ? void 0 : P.name),
|
|
2280
2281
|
variantCount: j
|
|
2281
2282
|
});
|
|
2282
2283
|
}), _.map((y) => {
|
|
2283
|
-
const
|
|
2284
|
-
return (y.variantCount || 0) > 1 ? `${
|
|
2284
|
+
const P = [(y == null ? void 0 : y.code) || "", (y == null ? void 0 : y.name) || ""].join(" ").trim();
|
|
2285
|
+
return (y.variantCount || 0) > 1 ? `${P} (${s("menu.group.list.variants", {
|
|
2285
2286
|
count: y.variantCount
|
|
2286
|
-
})})` :
|
|
2287
|
+
})})` : P;
|
|
2287
2288
|
});
|
|
2288
2289
|
}
|
|
2289
2290
|
const I = D(() => f(w.value).reduce((l, i) => (l[i._id] = {
|
|
@@ -2295,7 +2296,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2295
2296
|
}]) => ({
|
|
2296
2297
|
label: `${i} ${d.value.type ? `(${Tt(_)})` : ""}`.trim(),
|
|
2297
2298
|
value: l
|
|
2298
|
-
}))]),
|
|
2299
|
+
}))]), O = D(() => [{
|
|
2299
2300
|
accessorKey: "name",
|
|
2300
2301
|
header: () => s("menu.product.form.group.columns.title"),
|
|
2301
2302
|
enableSorting: !1,
|
|
@@ -2352,11 +2353,11 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2352
2353
|
variant: "tertiary",
|
|
2353
2354
|
textColor: "neutral-gray-400",
|
|
2354
2355
|
onClick: qe(async () => {
|
|
2355
|
-
|
|
2356
|
+
U(i);
|
|
2356
2357
|
}, ["stop", "prevent"])
|
|
2357
2358
|
}), ve(Wr, {
|
|
2358
2359
|
// variant items
|
|
2359
|
-
combinations:
|
|
2360
|
+
combinations: F.value ?? [],
|
|
2360
2361
|
// combinationKey: varaintName
|
|
2361
2362
|
fullCombinations: e.fullCombinations,
|
|
2362
2363
|
groupId: i,
|
|
@@ -2368,7 +2369,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2368
2369
|
id: pt(Se.GROUP, i),
|
|
2369
2370
|
icon: "edit",
|
|
2370
2371
|
variant: "tertiary",
|
|
2371
|
-
disabled: !
|
|
2372
|
+
disabled: !R(i),
|
|
2372
2373
|
textColor: "neutral-gray-400",
|
|
2373
2374
|
onClick: _
|
|
2374
2375
|
})
|
|
@@ -2390,8 +2391,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2390
2391
|
}
|
|
2391
2392
|
function T(l) {
|
|
2392
2393
|
const i = l.reduce((_, x) => {
|
|
2393
|
-
var
|
|
2394
|
-
const y = ((
|
|
2394
|
+
var P;
|
|
2395
|
+
const y = ((P = e.form.groups) == null ? void 0 : P.find((j) => j._id === x)) || {
|
|
2395
2396
|
_id: x,
|
|
2396
2397
|
groupKey: ""
|
|
2397
2398
|
};
|
|
@@ -2402,31 +2403,31 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2402
2403
|
groups: i
|
|
2403
2404
|
}));
|
|
2404
2405
|
}
|
|
2405
|
-
function
|
|
2406
|
+
function U(l) {
|
|
2406
2407
|
var _, x, y;
|
|
2407
2408
|
if (!e.form.groups)
|
|
2408
2409
|
return;
|
|
2409
2410
|
const i = me(e.form.groups);
|
|
2410
|
-
i.splice(i.findIndex((
|
|
2411
|
-
for (const
|
|
2412
|
-
(y =
|
|
2411
|
+
i.splice(i.findIndex((P) => P._id === l), 1);
|
|
2412
|
+
for (const P of ((_ = e.form.variant) == null ? void 0 : _.variantCombinations) || [])
|
|
2413
|
+
(y = P.groups) == null || y.splice((x = P.groups) == null ? void 0 : x.findIndex((j) => j._id === l), 1);
|
|
2413
2414
|
g("replace:form", Nt(t, {
|
|
2414
2415
|
...e.form,
|
|
2415
2416
|
groups: i
|
|
2416
2417
|
}));
|
|
2417
2418
|
}
|
|
2418
|
-
const
|
|
2419
|
+
const M = D(() => {
|
|
2419
2420
|
var l;
|
|
2420
2421
|
return !!((l = e.form.variant) != null && l.variantGroupIds.length);
|
|
2421
|
-
}),
|
|
2422
|
+
}), F = D(() => {
|
|
2422
2423
|
var l;
|
|
2423
|
-
return
|
|
2424
|
+
return M.value ? (l = e.form.variant) == null ? void 0 : l.variantCombinations : [{
|
|
2424
2425
|
_id: e.form._id,
|
|
2425
2426
|
combinationKey: "",
|
|
2426
2427
|
groups: e.form.groups || []
|
|
2427
2428
|
}];
|
|
2428
2429
|
});
|
|
2429
|
-
function
|
|
2430
|
+
function R(l) {
|
|
2430
2431
|
var _;
|
|
2431
2432
|
if (!l) return !1;
|
|
2432
2433
|
if (h.value.overrideProductGroup) return !0;
|
|
@@ -2447,14 +2448,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2447
2448
|
return (i = S.value.find((_) => _.value === l)) == null ? void 0 : i.label;
|
|
2448
2449
|
}, u = (l) => {
|
|
2449
2450
|
var i;
|
|
2450
|
-
|
|
2451
|
+
M.value ? g("update:form", "variant", {
|
|
2451
2452
|
variantGroupIds: ((i = e.form.variant) == null ? void 0 : i.variantGroupIds) || [],
|
|
2452
2453
|
variantCombinations: l
|
|
2453
2454
|
}) : g("update:form", "groups", l[0].groups || []);
|
|
2454
2455
|
};
|
|
2455
2456
|
return (l, i) => {
|
|
2456
2457
|
const _ = W("FmButton"), x = W("FmTable");
|
|
2457
|
-
return
|
|
2458
|
+
return $(), q(De, {
|
|
2458
2459
|
title: o(s)("menu.product.form.group.title"),
|
|
2459
2460
|
"sub-title": o(s)("menu.product.form.group.subtitle"),
|
|
2460
2461
|
id: o(Se).GROUP
|
|
@@ -2469,12 +2470,12 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2469
2470
|
default: B(() => [C(rn, null, {
|
|
2470
2471
|
default: B(() => {
|
|
2471
2472
|
var y;
|
|
2472
|
-
return [((y = v.value) == null ? void 0 : y.length) > 0 ? (
|
|
2473
|
+
return [((y = v.value) == null ? void 0 : y.length) > 0 ? ($(), q(x, {
|
|
2473
2474
|
key: 0,
|
|
2474
|
-
"column-defs":
|
|
2475
|
+
"column-defs": O.value,
|
|
2475
2476
|
"column-visibility": k.value,
|
|
2476
|
-
"row-data": v.value.map((
|
|
2477
|
-
_id:
|
|
2477
|
+
"row-data": v.value.map((P) => ({
|
|
2478
|
+
_id: P
|
|
2478
2479
|
})),
|
|
2479
2480
|
"page-size": v.value.length,
|
|
2480
2481
|
"hide-footer": "",
|
|
@@ -2512,12 +2513,12 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2512
2513
|
const {
|
|
2513
2514
|
t: e
|
|
2514
2515
|
} = ce(), t = n, m = r, s = se(), g = D(() => s.rules.item), d = D(() => g.value.inventory);
|
|
2515
|
-
function h(S,
|
|
2516
|
-
return !
|
|
2516
|
+
function h(S, O, k, p) {
|
|
2517
|
+
return !O || O && O.length === 0 ? [{
|
|
2517
2518
|
_id: "",
|
|
2518
2519
|
name: k || "",
|
|
2519
2520
|
binding: S || []
|
|
2520
|
-
}] :
|
|
2521
|
+
}] : O.map((T) => ({
|
|
2521
2522
|
_id: T.combinationKey || "",
|
|
2522
2523
|
name: un(T.combinationKey || "", p),
|
|
2523
2524
|
binding: T.inventoryBindings || []
|
|
@@ -2530,25 +2531,25 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2530
2531
|
var S;
|
|
2531
2532
|
return h(t.form.inventoryBindings || [], ((S = t.form.variant) == null ? void 0 : S.variantCombinations) || [], w.value, s.variants);
|
|
2532
2533
|
});
|
|
2533
|
-
function v(S,
|
|
2534
|
-
var
|
|
2534
|
+
function v(S, O) {
|
|
2535
|
+
var U, M;
|
|
2535
2536
|
let k = ke.clone(t.form);
|
|
2536
2537
|
const p = k.variant;
|
|
2537
|
-
if ((((
|
|
2538
|
-
const
|
|
2539
|
-
if (
|
|
2540
|
-
const
|
|
2541
|
-
|
|
2538
|
+
if ((((U = p == null ? void 0 : p.variantCombinations) == null ? void 0 : U.length) ?? 0) > 0 && p) {
|
|
2539
|
+
const F = p.variantCombinations.findIndex((E) => E.combinationKey === S);
|
|
2540
|
+
if (F < 0) return;
|
|
2541
|
+
const R = ke.clone(p.variantCombinations);
|
|
2542
|
+
R[F].inventoryBindings = O, k = {
|
|
2542
2543
|
...k,
|
|
2543
2544
|
variant: {
|
|
2544
|
-
variantGroupIds: ((
|
|
2545
|
-
variantCombinations:
|
|
2545
|
+
variantGroupIds: ((M = k.variant) == null ? void 0 : M.variantGroupIds) || [],
|
|
2546
|
+
variantCombinations: R
|
|
2546
2547
|
}
|
|
2547
2548
|
};
|
|
2548
2549
|
} else
|
|
2549
2550
|
k = {
|
|
2550
2551
|
...k,
|
|
2551
|
-
inventoryBindings:
|
|
2552
|
+
inventoryBindings: O
|
|
2552
2553
|
};
|
|
2553
2554
|
m("replace:form", k);
|
|
2554
2555
|
}
|
|
@@ -2561,9 +2562,9 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2561
2562
|
header: () => e("menu.inventory.columns.ingredient"),
|
|
2562
2563
|
enableSorting: !1,
|
|
2563
2564
|
cell: (S) => {
|
|
2564
|
-
const
|
|
2565
|
-
return
|
|
2566
|
-
count:
|
|
2565
|
+
const O = S.getValue();
|
|
2566
|
+
return O ? e("menu.inventory.status.sku_linked", {
|
|
2567
|
+
count: O
|
|
2567
2568
|
}) : e("menu.inventory.status.not_set");
|
|
2568
2569
|
}
|
|
2569
2570
|
}, {
|
|
@@ -2571,9 +2572,9 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2571
2572
|
header: () => e("menu.inventory.columns.recipe"),
|
|
2572
2573
|
enableSorting: !1,
|
|
2573
2574
|
cell: (S) => {
|
|
2574
|
-
const
|
|
2575
|
-
return
|
|
2576
|
-
count:
|
|
2575
|
+
const O = S.getValue();
|
|
2576
|
+
return O ? e("menu.inventory.status.recipe_linked", {
|
|
2577
|
+
count: O
|
|
2577
2578
|
}) : e("menu.inventory.status.not_set");
|
|
2578
2579
|
}
|
|
2579
2580
|
}, {
|
|
@@ -2581,17 +2582,17 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2581
2582
|
size: 52,
|
|
2582
2583
|
enableSorting: !1,
|
|
2583
2584
|
cell: (S) => {
|
|
2584
|
-
const
|
|
2585
|
+
const O = S.row.original;
|
|
2585
2586
|
return d.value ? C("div", {
|
|
2586
2587
|
class: "flex items-center justify-end"
|
|
2587
2588
|
}, [C(Et, {
|
|
2588
|
-
name:
|
|
2589
|
-
initialValue:
|
|
2589
|
+
name: O.name,
|
|
2590
|
+
initialValue: O.bindings ?? [],
|
|
2590
2591
|
title: e("menu.inventory.dialog.title", {
|
|
2591
2592
|
name: w.value
|
|
2592
2593
|
}),
|
|
2593
2594
|
"onUpdate:inventory": (k) => {
|
|
2594
|
-
v(
|
|
2595
|
+
v(O.key, k);
|
|
2595
2596
|
}
|
|
2596
2597
|
}, {
|
|
2597
2598
|
default: ({
|
|
@@ -2609,17 +2610,17 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2609
2610
|
async function a({
|
|
2610
2611
|
_id: S
|
|
2611
2612
|
}) {
|
|
2612
|
-
for (const
|
|
2613
|
-
|
|
2613
|
+
for (const O of f.value)
|
|
2614
|
+
O.getKey() === S && O.trigger(!0);
|
|
2614
2615
|
}
|
|
2615
2616
|
const I = Eo();
|
|
2616
2617
|
return Ae(() => {
|
|
2617
2618
|
I.readInventory();
|
|
2618
|
-
}), (S,
|
|
2619
|
+
}), (S, O) => ($(), q(De, {
|
|
2619
2620
|
title: o(e)("menu.inventory.title"),
|
|
2620
2621
|
subTitle: o(e)("menu.inventory.subtitle")
|
|
2621
2622
|
}, {
|
|
2622
|
-
default: B(() => [A("div", ra, [A("div", aa, [(
|
|
2623
|
+
default: B(() => [A("div", ra, [A("div", aa, [($(!0), J(Oe, null, Ne(b.value, (k) => ($(), q(o(Et), {
|
|
2623
2624
|
key: k._id,
|
|
2624
2625
|
ref_for: !0,
|
|
2625
2626
|
ref_key: "inventoryManagerForms",
|
|
@@ -2663,8 +2664,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2663
2664
|
emits: ["update:form"],
|
|
2664
2665
|
setup(n, { emit: r }) {
|
|
2665
2666
|
const e = n, t = rt(), m = se(), { t: s } = ce(), g = r, d = D(() => m.rules.item), h = D(() => {
|
|
2666
|
-
var
|
|
2667
|
-
const p = e.isOverride ? ((
|
|
2667
|
+
var U, M;
|
|
2668
|
+
const p = e.isOverride ? ((U = e.fallback) == null ? void 0 : U.unit) ?? ((M = e.fallback) == null ? void 0 : M.perXUnit) : void 0, T = e.form.unit ?? e.form.perXUnit ?? p;
|
|
2668
2669
|
return T != null;
|
|
2669
2670
|
}), w = (p) => {
|
|
2670
2671
|
g("update:form", "unit", p ? "" : void 0), g("update:form", "perXUnit", p ? 0 : void 0);
|
|
@@ -2686,16 +2687,16 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2686
2687
|
}
|
|
2687
2688
|
function a(p) {
|
|
2688
2689
|
if (!p && e.form.perXUnit) {
|
|
2689
|
-
const [T,
|
|
2690
|
-
if (
|
|
2691
|
-
const
|
|
2692
|
-
g("update:form", "perXUnit", parseFloat(
|
|
2690
|
+
const [T, U] = e.form.perXUnit.toString().split(".");
|
|
2691
|
+
if (U && U.length > 4) {
|
|
2692
|
+
const F = (typeof e.form.perXUnit == "string" ? parseFloat(e.form.perXUnit) : e.form.perXUnit).toFixed(4);
|
|
2693
|
+
g("update:form", "perXUnit", parseFloat(F));
|
|
2693
2694
|
}
|
|
2694
2695
|
}
|
|
2695
2696
|
}
|
|
2696
2697
|
const I = H(!1);
|
|
2697
2698
|
async function S() {
|
|
2698
|
-
var T,
|
|
2699
|
+
var T, U, M, F, R, E, u, l;
|
|
2699
2700
|
if (!(e.form.name || "")) {
|
|
2700
2701
|
const i = document.getElementById("product-name");
|
|
2701
2702
|
if (i) {
|
|
@@ -2718,8 +2719,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2718
2719
|
u,
|
|
2719
2720
|
{
|
|
2720
2721
|
name: e.form.name || "",
|
|
2721
|
-
lat: (
|
|
2722
|
-
lon: (E = (
|
|
2722
|
+
lat: (M = (U = (T = t.currentRestaurant) == null ? void 0 : T.value) == null ? void 0 : U.profile.address.coordinates) == null ? void 0 : M[1],
|
|
2723
|
+
lon: (E = (R = (F = t.currentRestaurant) == null ? void 0 : F.value) == null ? void 0 : R.profile.address.coordinates) == null ? void 0 : E[0]
|
|
2723
2724
|
},
|
|
2724
2725
|
!0
|
|
2725
2726
|
));
|
|
@@ -2727,13 +2728,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2727
2728
|
I.value = !1;
|
|
2728
2729
|
}
|
|
2729
2730
|
}
|
|
2730
|
-
const
|
|
2731
|
+
const O = xo(m), k = D(() => {
|
|
2731
2732
|
var p, T;
|
|
2732
2733
|
return ((p = m.currentCatalog) == null ? void 0 : p.priceTierRules) ?? ((T = m.currentCatalog) == null ? void 0 : T.usePriceTiers) ?? [];
|
|
2733
2734
|
});
|
|
2734
2735
|
return (p, T) => {
|
|
2735
|
-
const
|
|
2736
|
-
return
|
|
2736
|
+
const U = W("fm-select"), M = W("FmButton"), F = W("fm-checkbox"), R = W("fm-text-field"), E = Xt("tooltip");
|
|
2737
|
+
return $(), q(De, {
|
|
2737
2738
|
title: o(s)("menu.product.form.price.title")
|
|
2738
2739
|
}, {
|
|
2739
2740
|
default: B(() => {
|
|
@@ -2766,7 +2767,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2766
2767
|
]),
|
|
2767
2768
|
_: 1
|
|
2768
2769
|
}, 8, ["disable", "model-value", "placeholder", "rules", "label"]),
|
|
2769
|
-
C(
|
|
2770
|
+
C(U, {
|
|
2770
2771
|
disabled: !d.value.tax || !b.value.systemCode,
|
|
2771
2772
|
items: b.value.countryTaxOptions,
|
|
2772
2773
|
label: b.value.systemCode ? o(s)("menu.product.form.price.fields.tax.label_with_code", {
|
|
@@ -2779,25 +2780,25 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2779
2780
|
"onUpdate:modelValue": T[1] || (T[1] = (l) => g("update:form", "taxes", [o(vt).decodeTax(l)]))
|
|
2780
2781
|
}, null, 8, ["disabled", "items", "label", "model-value"])
|
|
2781
2782
|
], 8, ia),
|
|
2782
|
-
!p.isOverride && o(m).isV4 ? (
|
|
2783
|
+
!p.isOverride && o(m).isV4 ? ($(), q(Ue, {
|
|
2783
2784
|
key: 0,
|
|
2784
2785
|
label: o(s)("menu.price_tier.price_group"),
|
|
2785
2786
|
description: o(s)("menu.price_tier.description")
|
|
2786
2787
|
}, {
|
|
2787
2788
|
append: B(() => [
|
|
2788
|
-
C(
|
|
2789
|
+
C(M, {
|
|
2789
2790
|
label: o(s)("menu.price_tier.add_price_group"),
|
|
2790
2791
|
icon: "add",
|
|
2791
2792
|
variant: "secondary",
|
|
2792
|
-
onClick: o(
|
|
2793
|
+
onClick: o(O).create
|
|
2793
2794
|
}, null, 8, ["label", "onClick"])
|
|
2794
2795
|
]),
|
|
2795
2796
|
default: B(() => {
|
|
2796
2797
|
var l;
|
|
2797
2798
|
return [
|
|
2798
|
-
p.isOverride ? X("", !0) : (
|
|
2799
|
+
p.isOverride ? X("", !0) : ($(), q(Xn, {
|
|
2799
2800
|
key: 0,
|
|
2800
|
-
"price-tiers": o(
|
|
2801
|
+
"price-tiers": o(O).priceTiers.value,
|
|
2801
2802
|
"model-value": p.form.priceTiers || ((l = p.fallback) == null ? void 0 : l.priceTiers) || {},
|
|
2802
2803
|
"allow-negative-price": !1,
|
|
2803
2804
|
"onUpdate:modelValue": T[2] || (T[2] = (i) => g("update:form", "priceTiers", i))
|
|
@@ -2813,7 +2814,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2813
2814
|
var l, i, _;
|
|
2814
2815
|
return [
|
|
2815
2816
|
A("div", sa, [
|
|
2816
|
-
C(
|
|
2817
|
+
C(F, {
|
|
2817
2818
|
disabled: !d.value.openPrice || p.isAddon,
|
|
2818
2819
|
"model-value": p.form.openPrice ?? ((l = p.fallback) == null ? void 0 : l.openPrice) ?? !1,
|
|
2819
2820
|
value: p.form.openPrice,
|
|
@@ -2822,7 +2823,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2822
2823
|
"onUpdate:modelValue": T[3] || (T[3] = (x) => g("update:form", "openPrice", x))
|
|
2823
2824
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
2824
2825
|
A("div", ua, [
|
|
2825
|
-
C(
|
|
2826
|
+
C(F, {
|
|
2826
2827
|
disabled: !d.value.unit || p.isAddon,
|
|
2827
2828
|
"model-value": h.value,
|
|
2828
2829
|
value: h.value,
|
|
@@ -2830,10 +2831,10 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2830
2831
|
sublabel: o(s)("menu.product.form.price.settings.sell_by_unit.sublabel"),
|
|
2831
2832
|
"onUpdate:modelValue": w
|
|
2832
2833
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
2833
|
-
h.value ? (
|
|
2834
|
+
h.value ? ($(), J("div", da, [
|
|
2834
2835
|
A("p", ca, ge(o(s)("menu.product.form.price.settings.sell_by_unit.per_unit.label")), 1),
|
|
2835
2836
|
A("div", ma, [
|
|
2836
|
-
C(
|
|
2837
|
+
C(R, {
|
|
2837
2838
|
disabled: !d.value.unit,
|
|
2838
2839
|
"model-value": p.form.perXUnit || ((i = p.fallback) == null ? void 0 : i.perXUnit) || null,
|
|
2839
2840
|
rules: [
|
|
@@ -2848,7 +2849,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2848
2849
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
2849
2850
|
]),
|
|
2850
2851
|
A("div", pa, [
|
|
2851
|
-
C(
|
|
2852
|
+
C(R, {
|
|
2852
2853
|
disabled: !d.value.unit,
|
|
2853
2854
|
"model-value": p.form.unit || ((_ = p.fallback) == null ? void 0 : _.unit) || null,
|
|
2854
2855
|
rules: [
|
|
@@ -2860,14 +2861,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2860
2861
|
])
|
|
2861
2862
|
])) : X("", !0)
|
|
2862
2863
|
]),
|
|
2863
|
-
d.value.costing ? (
|
|
2864
|
-
C(
|
|
2864
|
+
d.value.costing ? ($(), J("div", fa, [
|
|
2865
|
+
C(F, {
|
|
2865
2866
|
"model-value": !!p.form.costing,
|
|
2866
2867
|
value: !!p.form.costing,
|
|
2867
2868
|
label: o(s)("menu.product.form.price.settings.track_costing.label"),
|
|
2868
2869
|
"onUpdate:modelValue": T[5] || (T[5] = (x) => g("update:form", "costing", x ? o(be.Dinero).zero().toObject() : void 0))
|
|
2869
2870
|
}, null, 8, ["model-value", "value", "label"]),
|
|
2870
|
-
p.form.costing ? (
|
|
2871
|
+
p.form.costing ? ($(), J("div", ga, [
|
|
2871
2872
|
A("div", va, [
|
|
2872
2873
|
C(Xe, {
|
|
2873
2874
|
class: "w-full",
|
|
@@ -2880,8 +2881,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2880
2881
|
])
|
|
2881
2882
|
])) : X("", !0)
|
|
2882
2883
|
])) : X("", !0),
|
|
2883
|
-
d.value.minPrice ? (
|
|
2884
|
-
C(
|
|
2884
|
+
d.value.minPrice ? ($(), J("div", ba, [
|
|
2885
|
+
C(F, {
|
|
2885
2886
|
disabled: !d.value.minPrice || p.isAddon,
|
|
2886
2887
|
"model-value": !!p.form.minPrice,
|
|
2887
2888
|
value: !!p.form.minPrice,
|
|
@@ -2890,7 +2891,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2890
2891
|
}, null, 8, ["disabled", "model-value", "value", "label"]),
|
|
2891
2892
|
A("div", _a, [
|
|
2892
2893
|
A("div", ya, [
|
|
2893
|
-
p.form.minPrice ? (
|
|
2894
|
+
p.form.minPrice ? ($(), q(Xe, {
|
|
2894
2895
|
key: 0,
|
|
2895
2896
|
max: o(be.Dinero).fromFdoDinero(p.form.price).toUnit(),
|
|
2896
2897
|
min: 0,
|
|
@@ -2967,15 +2968,15 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2967
2968
|
});
|
|
2968
2969
|
}
|
|
2969
2970
|
function S(k, p) {
|
|
2970
|
-
var
|
|
2971
|
-
let T = [...((
|
|
2972
|
-
p && !T.includes(k) ? T = [...T, k] : p || (T = T.filter((
|
|
2971
|
+
var U, M;
|
|
2972
|
+
let T = [...((M = (U = e.form) == null ? void 0 : U.print) == null ? void 0 : M.department) ?? []];
|
|
2973
|
+
p && !T.includes(k) ? T = [...T, k] : p || (T = T.filter((F) => F !== k)), s("update:form", "print", {
|
|
2973
2974
|
...g(),
|
|
2974
2975
|
...e.form.print,
|
|
2975
2976
|
department: T
|
|
2976
2977
|
});
|
|
2977
2978
|
}
|
|
2978
|
-
const
|
|
2979
|
+
const O = D(() => [
|
|
2979
2980
|
{
|
|
2980
2981
|
label: m("menu.product.form.print.kds.options.all.label"),
|
|
2981
2982
|
value: !1,
|
|
@@ -2991,14 +2992,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2991
2992
|
() => h.value.length,
|
|
2992
2993
|
() => S(h.value[h.value.length - 1]._id, !0)
|
|
2993
2994
|
), (k, p) => {
|
|
2994
|
-
const T = W("fm-switch"),
|
|
2995
|
-
return
|
|
2995
|
+
const T = W("fm-switch"), U = W("fm-radio"), M = W("fm-radio-group"), F = W("fm-button"), R = W("fm-checkbox");
|
|
2996
|
+
return $(), q(De, {
|
|
2996
2997
|
title: o(m)("menu.product.form.print.title")
|
|
2997
2998
|
}, {
|
|
2998
2999
|
default: B(() => {
|
|
2999
3000
|
var E;
|
|
3000
3001
|
return [
|
|
3001
|
-
d.value.printConfig ? (
|
|
3002
|
+
d.value.printConfig ? ($(), q(Ue, {
|
|
3002
3003
|
key: 0,
|
|
3003
3004
|
label: o(m)("menu.product.form.print.config.label")
|
|
3004
3005
|
}, {
|
|
@@ -3016,14 +3017,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3016
3017
|
}),
|
|
3017
3018
|
_: 1
|
|
3018
3019
|
}, 8, ["label"])) : X("", !0),
|
|
3019
|
-
C(
|
|
3020
|
+
C(M, {
|
|
3020
3021
|
label: o(m)("menu.product.form.print.kds.label"),
|
|
3021
3022
|
"model-value": ((E = k.form.print) == null ? void 0 : E.sequential) ?? !1,
|
|
3022
3023
|
"onUpdate:modelValue": p[1] || (p[1] = (u) => a(u))
|
|
3023
3024
|
}, {
|
|
3024
3025
|
default: B(() => [
|
|
3025
3026
|
A("div", wa, [
|
|
3026
|
-
(
|
|
3027
|
+
($(!0), J(Oe, null, Ne(O.value, (u, l) => ($(), q(U, {
|
|
3027
3028
|
key: l,
|
|
3028
3029
|
label: u.label,
|
|
3029
3030
|
sublabel: u.description,
|
|
@@ -3037,7 +3038,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3037
3038
|
label: o(m)("menu.product.form.print.routes.label")
|
|
3038
3039
|
}, {
|
|
3039
3040
|
default: B(() => [
|
|
3040
|
-
b.value.length ? (
|
|
3041
|
+
b.value.length ? ($(), q(o(Mt), {
|
|
3041
3042
|
key: 0,
|
|
3042
3043
|
"item-key": (u) => u,
|
|
3043
3044
|
"model-value": b.value,
|
|
@@ -3050,7 +3051,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3050
3051
|
return [
|
|
3051
3052
|
A("div", Ca, [
|
|
3052
3053
|
A("div", Ia, [
|
|
3053
|
-
w.value ? (
|
|
3054
|
+
w.value ? ($(), q(F, {
|
|
3054
3055
|
key: 0,
|
|
3055
3056
|
disabled: !((i = (l = e.form.print) == null ? void 0 : l.department) != null && i.includes(u)),
|
|
3056
3057
|
class: "handle",
|
|
@@ -3060,14 +3061,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3060
3061
|
}, ["stop"]))
|
|
3061
3062
|
}, null, 8, ["disabled"])) : X("", !0)
|
|
3062
3063
|
]),
|
|
3063
|
-
C(
|
|
3064
|
+
C(R, {
|
|
3064
3065
|
id: u,
|
|
3065
3066
|
"data-checked": (x = (_ = e.form.print) == null ? void 0 : _.department) == null ? void 0 : x.includes(u),
|
|
3066
3067
|
label: v.value[u],
|
|
3067
3068
|
"model-value": (((y = e.form.print) == null ? void 0 : y.department) ?? []).includes(u),
|
|
3068
3069
|
value: u,
|
|
3069
3070
|
class: "flex-1",
|
|
3070
|
-
"onUpdate:modelValue": (
|
|
3071
|
+
"onUpdate:modelValue": (P) => S(u, P)
|
|
3071
3072
|
}, null, 8, ["id", "data-checked", "label", "model-value", "value", "onUpdate:modelValue"])
|
|
3072
3073
|
])
|
|
3073
3074
|
];
|
|
@@ -3077,7 +3078,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3077
3078
|
C(o(Jn), { "apply-product": !1 }, {
|
|
3078
3079
|
default: B(({ trigger: u }) => [
|
|
3079
3080
|
A("div", ka, [
|
|
3080
|
-
C(
|
|
3081
|
+
C(F, {
|
|
3081
3082
|
variant: o(He).Secondary,
|
|
3082
3083
|
label: o(m)("menu.product.form.print.routes.add"),
|
|
3083
3084
|
"prepend-icon": "add",
|
|
@@ -3178,7 +3179,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3178
3179
|
}]);
|
|
3179
3180
|
return (v, f) => {
|
|
3180
3181
|
const a = W("fm-table");
|
|
3181
|
-
return
|
|
3182
|
+
return $(), q(De, {
|
|
3182
3183
|
title: o(s)("menu.product.form.takeaway.title"),
|
|
3183
3184
|
"sub-title": o(s)("menu.product.form.takeaway.subtitle")
|
|
3184
3185
|
}, {
|
|
@@ -3210,53 +3211,53 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3210
3211
|
() => e.initialValue ? g("menu.variant.form.title.edit") : g("menu.variant.form.title.add")
|
|
3211
3212
|
), h = D(() => e.initialValue ? "Update" : "Add"), w = () => {
|
|
3212
3213
|
if (e.initialValue) {
|
|
3213
|
-
const
|
|
3214
|
-
return
|
|
3214
|
+
const U = me(e.initialValue);
|
|
3215
|
+
return U.options.push({
|
|
3215
3216
|
_id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3216
3217
|
name: ""
|
|
3217
|
-
}),
|
|
3218
|
+
}), U;
|
|
3218
3219
|
} else
|
|
3219
3220
|
return { ...Le.generator.initMenuV4VariantGroup(), usedBy: [] };
|
|
3220
3221
|
}, b = H(w()), v = H(!1), f = H(!1);
|
|
3221
|
-
function a(
|
|
3222
|
-
b.value.options =
|
|
3222
|
+
function a(U) {
|
|
3223
|
+
b.value.options = U;
|
|
3223
3224
|
}
|
|
3224
|
-
function I(
|
|
3225
|
-
const
|
|
3226
|
-
|
|
3225
|
+
function I(U, M) {
|
|
3226
|
+
const F = me(b.value.options), R = F.findIndex((E) => E._id == U);
|
|
3227
|
+
F[R].name = M, b.value.options = F, R === b.value.options.length - 1 && S();
|
|
3227
3228
|
}
|
|
3228
3229
|
function S() {
|
|
3229
|
-
const
|
|
3230
|
+
const U = me(b.value.options);
|
|
3230
3231
|
b.value.options = [
|
|
3231
|
-
|
|
3232
|
+
...U,
|
|
3232
3233
|
{
|
|
3233
3234
|
_id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3234
3235
|
name: ""
|
|
3235
3236
|
}
|
|
3236
3237
|
];
|
|
3237
3238
|
}
|
|
3238
|
-
function
|
|
3239
|
-
const
|
|
3240
|
-
b.value.options =
|
|
3239
|
+
function O(U) {
|
|
3240
|
+
const M = me(b.value.options);
|
|
3241
|
+
b.value.options = M.filter((F) => F._id !== U);
|
|
3241
3242
|
}
|
|
3242
3243
|
ye(
|
|
3243
3244
|
() => b.value.options,
|
|
3244
|
-
(
|
|
3245
|
-
|
|
3245
|
+
(U) => {
|
|
3246
|
+
U.length <= 0 && S();
|
|
3246
3247
|
},
|
|
3247
3248
|
{
|
|
3248
3249
|
immediate: !0
|
|
3249
3250
|
}
|
|
3250
3251
|
);
|
|
3251
|
-
function k(
|
|
3252
|
-
const
|
|
3253
|
-
return
|
|
3252
|
+
function k(U) {
|
|
3253
|
+
const M = U.draggedContext.futureIndex, F = U.relatedContext.list;
|
|
3254
|
+
return M !== F.length - 1;
|
|
3254
3255
|
}
|
|
3255
3256
|
const p = Ut(
|
|
3256
3257
|
() => {
|
|
3257
3258
|
if (e.initialValue) {
|
|
3258
|
-
const
|
|
3259
|
-
return !ke.isEqual({ ...b.value, options:
|
|
3259
|
+
const U = b.value.options.filter((M) => !!M.name.trim());
|
|
3260
|
+
return !ke.isEqual({ ...b.value, options: U }, e.initialValue);
|
|
3260
3261
|
} else
|
|
3261
3262
|
return !!(b.value.options.length > 1 || b.value.name.trim());
|
|
3262
3263
|
},
|
|
@@ -3266,15 +3267,15 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3266
3267
|
), T = async () => {
|
|
3267
3268
|
try {
|
|
3268
3269
|
v.value = !0;
|
|
3269
|
-
const
|
|
3270
|
-
|
|
3270
|
+
const U = me(b.value);
|
|
3271
|
+
U.options = U.options.filter((M) => !!M.name.trim()), e.initialValue ? await s.updateMenu({
|
|
3271
3272
|
module: te.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
3272
3273
|
operation: _e.F_OPERATION_TYPE.update,
|
|
3273
|
-
data:
|
|
3274
|
+
data: U
|
|
3274
3275
|
}) : await s.updateMenu({
|
|
3275
3276
|
module: te.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
3276
3277
|
operation: _e.F_OPERATION_TYPE.create,
|
|
3277
|
-
data:
|
|
3278
|
+
data: U
|
|
3278
3279
|
}), m();
|
|
3279
3280
|
} finally {
|
|
3280
3281
|
v.value = !1;
|
|
@@ -3282,17 +3283,17 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3282
3283
|
};
|
|
3283
3284
|
return ye(
|
|
3284
3285
|
() => f.value,
|
|
3285
|
-
(
|
|
3286
|
-
|
|
3286
|
+
(U) => {
|
|
3287
|
+
U ? b.value = w() : m();
|
|
3287
3288
|
}
|
|
3288
3289
|
), Ae(() => {
|
|
3289
3290
|
f.value = !0;
|
|
3290
|
-
}), (
|
|
3291
|
-
const
|
|
3292
|
-
return
|
|
3291
|
+
}), (U, M) => {
|
|
3292
|
+
const F = W("fm-text-field"), R = W("fm-icon"), E = W("fm-button"), u = W("fm-side-sheet");
|
|
3293
|
+
return $(), q(u, {
|
|
3293
3294
|
id: "variant-form",
|
|
3294
3295
|
modelValue: f.value,
|
|
3295
|
-
"onUpdate:modelValue":
|
|
3296
|
+
"onUpdate:modelValue": M[2] || (M[2] = (l) => f.value = l),
|
|
3296
3297
|
"is-container": o(Ie).FmForm,
|
|
3297
3298
|
"is-container-props": {
|
|
3298
3299
|
onValidationSuccess: T,
|
|
@@ -3317,7 +3318,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3317
3318
|
label: o(g)("menu.common.actions.cancel"),
|
|
3318
3319
|
size: "lg",
|
|
3319
3320
|
variant: "tertiary",
|
|
3320
|
-
onClick:
|
|
3321
|
+
onClick: M[1] || (M[1] = () => f.value = !1)
|
|
3321
3322
|
}, null, 8, ["label"])
|
|
3322
3323
|
])
|
|
3323
3324
|
]),
|
|
@@ -3329,12 +3330,12 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3329
3330
|
title: o(g)("menu.variant.form.detail")
|
|
3330
3331
|
}, {
|
|
3331
3332
|
default: B(() => [
|
|
3332
|
-
C(
|
|
3333
|
+
C(F, {
|
|
3333
3334
|
autofocus: "",
|
|
3334
3335
|
label: o(g)("menu.variant.form.name.label"),
|
|
3335
3336
|
"helper-text": o(g)("menu.variant.form.name.helper"),
|
|
3336
3337
|
modelValue: b.value.name,
|
|
3337
|
-
"onUpdate:modelValue":
|
|
3338
|
+
"onUpdate:modelValue": M[0] || (M[0] = (i) => b.value.name = i),
|
|
3338
3339
|
rules: [(i) => !!i || o(g)("menu.variant.form.name.required")],
|
|
3339
3340
|
placeholder: o(g)("menu.variant.form.name.placeholder")
|
|
3340
3341
|
}, null, 8, ["label", "helper-text", "modelValue", "rules", "placeholder"]),
|
|
@@ -3357,13 +3358,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3357
3358
|
class: fe(["flex items-center", "space-x-8"]),
|
|
3358
3359
|
"data-not-allow-sort": _ === b.value.options.length - 1
|
|
3359
3360
|
}, [
|
|
3360
|
-
_ !== b.value.options.length - 1 ? (
|
|
3361
|
+
_ !== b.value.options.length - 1 ? ($(), q(R, {
|
|
3361
3362
|
key: 0,
|
|
3362
3363
|
class: "handle",
|
|
3363
3364
|
name: "drag_handle"
|
|
3364
|
-
})) : _ > 0 ? (
|
|
3365
|
+
})) : _ > 0 ? ($(), J("div", Oa)) : X("", !0),
|
|
3365
3366
|
A("div", Da, [
|
|
3366
|
-
C(
|
|
3367
|
+
C(F, {
|
|
3367
3368
|
"model-value": i.name,
|
|
3368
3369
|
rules: [
|
|
3369
3370
|
() => !!b.value.options.length || o(g)("menu.variant.form.options.min_required"),
|
|
@@ -3376,9 +3377,9 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3376
3377
|
_ !== b.value.options.length - 1 ? {
|
|
3377
3378
|
name: "append",
|
|
3378
3379
|
fn: B(() => [
|
|
3379
|
-
C(
|
|
3380
|
+
C(R, {
|
|
3380
3381
|
name: "close",
|
|
3381
|
-
onClick: (x) =>
|
|
3382
|
+
onClick: (x) => O(i._id)
|
|
3382
3383
|
}, null, 8, ["onClick"])
|
|
3383
3384
|
]),
|
|
3384
3385
|
key: "0"
|
|
@@ -3396,7 +3397,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3396
3397
|
]),
|
|
3397
3398
|
_: 1
|
|
3398
3399
|
}, 8, ["title"]),
|
|
3399
|
-
(l = b.value.usedBy) != null && l.length ? (
|
|
3400
|
+
(l = b.value.usedBy) != null && l.length ? ($(), q(So, {
|
|
3400
3401
|
key: 0,
|
|
3401
3402
|
editable: !1,
|
|
3402
3403
|
overrides: b.value.usedBy || [],
|
|
@@ -3445,8 +3446,8 @@ const Ua = {
|
|
|
3445
3446
|
e(h.value), t("primary"), r.close();
|
|
3446
3447
|
};
|
|
3447
3448
|
return (f, a) => {
|
|
3448
|
-
const I = W("FmSearch"), S = W("FmCheckbox"),
|
|
3449
|
-
return d.value.length > 0 ? (
|
|
3449
|
+
const I = W("FmSearch"), S = W("FmCheckbox"), O = W("FmButton");
|
|
3450
|
+
return d.value.length > 0 ? ($(), J("div", Ua, [
|
|
3450
3451
|
A("div", null, [
|
|
3451
3452
|
C(I, {
|
|
3452
3453
|
autofocus: "",
|
|
@@ -3457,7 +3458,7 @@ const Ua = {
|
|
|
3457
3458
|
]),
|
|
3458
3459
|
A("div", Ra, [
|
|
3459
3460
|
A("div", null, [
|
|
3460
|
-
(
|
|
3461
|
+
($(!0), J(Oe, null, Ne(d.value, (k) => ($(), J("div", {
|
|
3461
3462
|
key: k.value
|
|
3462
3463
|
}, [
|
|
3463
3464
|
ft(C(S, {
|
|
@@ -3475,7 +3476,7 @@ const Ua = {
|
|
|
3475
3476
|
])
|
|
3476
3477
|
]),
|
|
3477
3478
|
A("div", Ma, [
|
|
3478
|
-
o(m).rules.item.variant ? (
|
|
3479
|
+
o(m).rules.item.variant ? ($(), q(O, {
|
|
3479
3480
|
key: 0,
|
|
3480
3481
|
label: o(s)("menu.common.actions.add_new_variant"),
|
|
3481
3482
|
variant: "tertiary",
|
|
@@ -3483,23 +3484,23 @@ const Ua = {
|
|
|
3483
3484
|
onClick: a[3] || (a[3] = (k) => o(b)())
|
|
3484
3485
|
}, null, 8, ["label"])) : X("", !0),
|
|
3485
3486
|
A("div", Aa, [
|
|
3486
|
-
C(
|
|
3487
|
+
C(O, {
|
|
3487
3488
|
label: o(s)("menu.common.actions.cancel"),
|
|
3488
3489
|
variant: "tertiary",
|
|
3489
3490
|
onClick: a[4] || (a[4] = (k) => o(r).close())
|
|
3490
3491
|
}, null, 8, ["label"]),
|
|
3491
|
-
C(
|
|
3492
|
+
C(O, {
|
|
3492
3493
|
label: o(s)("menu.common.actions.confirm"),
|
|
3493
3494
|
onClick: a[5] || (a[5] = (k) => v())
|
|
3494
3495
|
}, null, 8, ["label"])
|
|
3495
3496
|
])
|
|
3496
3497
|
])
|
|
3497
|
-
])) : (
|
|
3498
|
+
])) : ($(), J("div", Na, [
|
|
3498
3499
|
A("div", La, [
|
|
3499
3500
|
A("p", Ga, ge(o(s)("menu.common.empty.no_variant.title")), 1),
|
|
3500
3501
|
A("p", Ka, ge(o(s)("menu.common.empty.no_variant.subtitle")), 1)
|
|
3501
3502
|
]),
|
|
3502
|
-
C(
|
|
3503
|
+
C(O, {
|
|
3503
3504
|
label: o(s)("menu.variant.add"),
|
|
3504
3505
|
icon: "add",
|
|
3505
3506
|
onClick: a[6] || (a[6] = (k) => o(b)())
|
|
@@ -3553,7 +3554,7 @@ const Ua = {
|
|
|
3553
3554
|
})));
|
|
3554
3555
|
function I(u) {
|
|
3555
3556
|
var i;
|
|
3556
|
-
const l =
|
|
3557
|
+
const l = O(u.combinationKey || "");
|
|
3557
3558
|
return {
|
|
3558
3559
|
...u,
|
|
3559
3560
|
price: l == null ? void 0 : l.price,
|
|
@@ -3577,9 +3578,9 @@ const Ua = {
|
|
|
3577
3578
|
T(l, I);
|
|
3578
3579
|
});
|
|
3579
3580
|
}
|
|
3580
|
-
function
|
|
3581
|
-
var
|
|
3582
|
-
const l = ((
|
|
3581
|
+
function O(u) {
|
|
3582
|
+
var P, j;
|
|
3583
|
+
const l = ((P = e.form.variant) == null ? void 0 : P.variantGroupIds) || [], i = (j = e.form.variant) == null ? void 0 : j.variantCombinations, y = u.split(/(?=variant)/g).map((Q) => Q.replace(/\/*$/, "")).filter((Q) => l.some((le) => Q.includes(le))).join("/");
|
|
3583
3584
|
return i == null ? void 0 : i.find((Q) => Q.combinationKey === y);
|
|
3584
3585
|
}
|
|
3585
3586
|
const k = (u) => {
|
|
@@ -3589,8 +3590,8 @@ const Ua = {
|
|
|
3589
3590
|
return (((l = e.form.variant) == null ? void 0 : l.variantCombinations) || []).map((i) => {
|
|
3590
3591
|
var x, y;
|
|
3591
3592
|
const _ = (y = (x = e.fallback) == null ? void 0 : x.variant) == null ? void 0 : y.variantCombinations.find(({
|
|
3592
|
-
combinationKey:
|
|
3593
|
-
}) =>
|
|
3593
|
+
combinationKey: P
|
|
3594
|
+
}) => P === i.combinationKey);
|
|
3594
3595
|
return {
|
|
3595
3596
|
...i,
|
|
3596
3597
|
fallback: {
|
|
@@ -3609,7 +3610,7 @@ const Ua = {
|
|
|
3609
3610
|
const i = u.filter((y) => !!y);
|
|
3610
3611
|
let _;
|
|
3611
3612
|
if (i.length) {
|
|
3612
|
-
const y = i.map((j) => t.variants.find((Q) => Q._id === j)),
|
|
3613
|
+
const y = i.map((j) => t.variants.find((Q) => Q._id === j)), P = Le.fullVariantCombination(y).map(({
|
|
3613
3614
|
combinationKey: j
|
|
3614
3615
|
}) => {
|
|
3615
3616
|
var le;
|
|
@@ -3619,7 +3620,7 @@ const Ua = {
|
|
|
3619
3620
|
combinationKey: j
|
|
3620
3621
|
});
|
|
3621
3622
|
});
|
|
3622
|
-
if (
|
|
3623
|
+
if (P.length > 100) {
|
|
3623
3624
|
s.open({
|
|
3624
3625
|
type: "error",
|
|
3625
3626
|
message: "'Combinations of variant should not be more than 100'"
|
|
@@ -3630,38 +3631,38 @@ const Ua = {
|
|
|
3630
3631
|
...e.form,
|
|
3631
3632
|
variant: {
|
|
3632
3633
|
variantGroupIds: i,
|
|
3633
|
-
variantCombinations:
|
|
3634
|
+
variantCombinations: P
|
|
3634
3635
|
},
|
|
3635
3636
|
inventoryBindings: null,
|
|
3636
3637
|
takeawayUsed: null
|
|
3637
3638
|
};
|
|
3638
3639
|
} else {
|
|
3639
|
-
const y = (x = e.form.variant) == null ? void 0 : x.variantCombinations.map((j) => j.takeawayUsed),
|
|
3640
|
+
const y = (x = e.form.variant) == null ? void 0 : x.variantCombinations.map((j) => j.takeawayUsed), P = [...new Set(y)];
|
|
3640
3641
|
a([{
|
|
3641
3642
|
key: "variant",
|
|
3642
3643
|
value: void 0
|
|
3643
3644
|
}, {
|
|
3644
3645
|
key: "takeawayUsed",
|
|
3645
|
-
value:
|
|
3646
|
+
value: P.length === 1 ? P[0] : null
|
|
3646
3647
|
}]), _ = {
|
|
3647
3648
|
...e.form,
|
|
3648
3649
|
variant: void 0,
|
|
3649
|
-
takeawayUsed:
|
|
3650
|
+
takeawayUsed: P.length === 1 ? P[0] : null
|
|
3650
3651
|
};
|
|
3651
3652
|
}
|
|
3652
3653
|
f("replace:form", m.initDynamicGroupItem(_));
|
|
3653
3654
|
}
|
|
3654
|
-
async function
|
|
3655
|
+
async function U(u, l, i) {
|
|
3655
3656
|
const _ = ke.clone(e.form);
|
|
3656
3657
|
_.variant.variantCombinations[u][l] = i, a([{
|
|
3657
3658
|
key: "variant",
|
|
3658
3659
|
value: _.variant
|
|
3659
3660
|
}]);
|
|
3660
3661
|
}
|
|
3661
|
-
const
|
|
3662
|
+
const M = D(() => {
|
|
3662
3663
|
var u, l;
|
|
3663
3664
|
return ((u = t.currentCatalog) == null ? void 0 : u.priceTierRules) ?? ((l = t.currentCatalog) == null ? void 0 : l.usePriceTiers) ?? [];
|
|
3664
|
-
}),
|
|
3665
|
+
}), F = D(() => [{
|
|
3665
3666
|
accessorKey: "combinationKey",
|
|
3666
3667
|
header: () => d("menu.product.form.variant.columns.variant"),
|
|
3667
3668
|
enableSorting: !1,
|
|
@@ -3671,13 +3672,13 @@ const Ua = {
|
|
|
3671
3672
|
header: () => d("menu.product.form.variant.columns.code"),
|
|
3672
3673
|
enableSorting: !1,
|
|
3673
3674
|
cell: (u) => {
|
|
3674
|
-
var y,
|
|
3675
|
-
const l = u.getValue(), x = ((y = u.row.original.fallback) == null ? void 0 : y.code) ?? e.form.code ?? ((
|
|
3675
|
+
var y, P;
|
|
3676
|
+
const l = u.getValue(), x = ((y = u.row.original.fallback) == null ? void 0 : y.code) ?? e.form.code ?? ((P = e.fallback) == null ? void 0 : P.code);
|
|
3676
3677
|
return ve(Ie.FmTextField, {
|
|
3677
3678
|
modelValue: l,
|
|
3678
3679
|
placeholder: x || d("menu.product.form.variant.placeholders.no_code"),
|
|
3679
3680
|
"onUpdate:modelValue": (j) => {
|
|
3680
|
-
|
|
3681
|
+
U(u.row.index, "code", Qt(j, !0));
|
|
3681
3682
|
}
|
|
3682
3683
|
});
|
|
3683
3684
|
}
|
|
@@ -3694,8 +3695,8 @@ const Ua = {
|
|
|
3694
3695
|
disable: !h.value.orderFrom,
|
|
3695
3696
|
required: h.value.orderFrom && h.value.orderFromActiveOnly,
|
|
3696
3697
|
editActiveOnly: h.value.orderFromActiveOnly || !1,
|
|
3697
|
-
"onUpdate:modelValue": (
|
|
3698
|
-
|
|
3698
|
+
"onUpdate:modelValue": (P) => {
|
|
3699
|
+
U(u.row.index, "orderFrom", P);
|
|
3699
3700
|
},
|
|
3700
3701
|
label: "",
|
|
3701
3702
|
defaultLabel: "Follow general"
|
|
@@ -3706,18 +3707,18 @@ const Ua = {
|
|
|
3706
3707
|
header: () => d("menu.product.form.variant.columns.price"),
|
|
3707
3708
|
enableSorting: !1,
|
|
3708
3709
|
cell: (u) => {
|
|
3709
|
-
var y,
|
|
3710
|
-
const l = u.getValue(), i = u.row.original, x = ((y = i.fallback) == null ? void 0 : y.price) ?? e.form.price ?? ((
|
|
3710
|
+
var y, P, j;
|
|
3711
|
+
const l = u.getValue(), i = u.row.original, x = ((y = i.fallback) == null ? void 0 : y.price) ?? e.form.price ?? ((P = e.fallback) == null ? void 0 : P.price);
|
|
3711
3712
|
return C("div", {
|
|
3712
3713
|
id: pt(Se.VARIANT, i.combinationKey ?? ""),
|
|
3713
3714
|
class: "flex items-center gap-8"
|
|
3714
3715
|
}, [C(Xe, {
|
|
3715
|
-
disable:
|
|
3716
|
+
disable: M.value.length > 0 && t.currentCatalog && !t.currentScheduler,
|
|
3716
3717
|
placeholder: x ? tt(x) : void 0,
|
|
3717
3718
|
modelValue: l,
|
|
3718
3719
|
min: 0,
|
|
3719
3720
|
"onUpdate:model-value": (Q) => {
|
|
3720
|
-
|
|
3721
|
+
U(u.row.index, "price", Q);
|
|
3721
3722
|
},
|
|
3722
3723
|
nullable: !0,
|
|
3723
3724
|
showCurrency: !1
|
|
@@ -3725,7 +3726,7 @@ const Ua = {
|
|
|
3725
3726
|
"menu-store": t,
|
|
3726
3727
|
"price-tiers": i.priceTiers,
|
|
3727
3728
|
fallback: (j = i.fallback) == null ? void 0 : j.priceTiers,
|
|
3728
|
-
"onUpdate:price-tiers": (Q) =>
|
|
3729
|
+
"onUpdate:price-tiers": (Q) => U(u.row.index, "priceTiers", Q)
|
|
3729
3730
|
}, null)]);
|
|
3730
3731
|
}
|
|
3731
3732
|
}, {
|
|
@@ -3733,20 +3734,20 @@ const Ua = {
|
|
|
3733
3734
|
header: () => d("menu.product.form.variant.columns.min_price"),
|
|
3734
3735
|
enableSorting: !1,
|
|
3735
3736
|
cell: (u) => {
|
|
3736
|
-
var y,
|
|
3737
|
-
const l = u.getValue(), i = u.row.original, x = ((y = i.fallback) == null ? void 0 : y.minPrice) ?? e.form.minPrice ?? ((
|
|
3737
|
+
var y, P, j;
|
|
3738
|
+
const l = u.getValue(), i = u.row.original, x = ((y = i.fallback) == null ? void 0 : y.minPrice) ?? e.form.minPrice ?? ((P = e.fallback) == null ? void 0 : P.minPrice);
|
|
3738
3739
|
return ve(Xe, {
|
|
3739
3740
|
placeholder: x ? tt(x) : void 0,
|
|
3740
3741
|
modelValue: l,
|
|
3741
3742
|
max: be.Dinero.fromFdoDinero(i.price ?? ((j = i.fallback) == null ? void 0 : j.price) ?? be.Dinero.zero().toObject()).toUnit(),
|
|
3742
3743
|
"onUpdate:modelValue": (Q) => {
|
|
3743
|
-
|
|
3744
|
+
U(u.row.index, "minPrice", Q);
|
|
3744
3745
|
},
|
|
3745
3746
|
nullable: !0,
|
|
3746
3747
|
showCurrency: !1
|
|
3747
3748
|
});
|
|
3748
3749
|
}
|
|
3749
|
-
}]),
|
|
3750
|
+
}]), R = D(() => ({
|
|
3750
3751
|
minPrice: w.value
|
|
3751
3752
|
}));
|
|
3752
3753
|
function E(u) {
|
|
@@ -3756,12 +3757,12 @@ const Ua = {
|
|
|
3756
3757
|
}
|
|
3757
3758
|
return (u, l) => {
|
|
3758
3759
|
const i = W("fm-button"), _ = W("fm-icon"), x = W("FmFormGroup"), y = W("fm-table");
|
|
3759
|
-
return
|
|
3760
|
+
return $(), q(De, {
|
|
3760
3761
|
id: o(Se).VARIANT,
|
|
3761
3762
|
title: o(d)("menu.product.form.variant.title"),
|
|
3762
3763
|
"sub-title": o(d)("menu.product.form.variant.subtitle")
|
|
3763
3764
|
}, {
|
|
3764
|
-
"append-title": B(() => [o(t).rules.item.variant ? (
|
|
3765
|
+
"append-title": B(() => [o(t).rules.item.variant ? ($(), q(i, {
|
|
3765
3766
|
key: 0,
|
|
3766
3767
|
label: o(d)("menu.product.form.variant.add"),
|
|
3767
3768
|
variant: "secondary",
|
|
@@ -3769,9 +3770,9 @@ const Ua = {
|
|
|
3769
3770
|
onClick: S
|
|
3770
3771
|
}, null, 8, ["label"])) : X("", !0)]),
|
|
3771
3772
|
default: B(() => {
|
|
3772
|
-
var
|
|
3773
|
+
var P;
|
|
3773
3774
|
return [A("div", za, [C(x, {
|
|
3774
|
-
"model-value": (
|
|
3775
|
+
"model-value": (P = u.form.variant) == null ? void 0 : P.variantGroupIds,
|
|
3775
3776
|
rules: [E]
|
|
3776
3777
|
}, {
|
|
3777
3778
|
default: B(() => {
|
|
@@ -3806,11 +3807,11 @@ const Ua = {
|
|
|
3806
3807
|
}),
|
|
3807
3808
|
_: 1
|
|
3808
3809
|
}, 8, ["model-value", "rules"]), C(rn, null, {
|
|
3809
|
-
default: B(() => [p.value.length ? (
|
|
3810
|
+
default: B(() => [p.value.length ? ($(), q(y, {
|
|
3810
3811
|
key: 0,
|
|
3811
3812
|
class: "w-full",
|
|
3812
|
-
"column-defs":
|
|
3813
|
-
"column-visibility":
|
|
3813
|
+
"column-defs": F.value,
|
|
3814
|
+
"column-visibility": R.value,
|
|
3814
3815
|
"page-size": p.value.length ?? 0,
|
|
3815
3816
|
"row-data": p.value ?? [],
|
|
3816
3817
|
"hide-footer": "",
|
|
@@ -3895,7 +3896,7 @@ const Ua = {
|
|
|
3895
3896
|
...me(a.value),
|
|
3896
3897
|
[K]: Y
|
|
3897
3898
|
}, c());
|
|
3898
|
-
},
|
|
3899
|
+
}, O = (K) => {
|
|
3899
3900
|
a.value = K, c();
|
|
3900
3901
|
};
|
|
3901
3902
|
async function k() {
|
|
@@ -3912,10 +3913,10 @@ const Ua = {
|
|
|
3912
3913
|
), T = D(() => {
|
|
3913
3914
|
var K;
|
|
3914
3915
|
return p.value ? a.value.category == "" || a.value.category == null && ((K = f.value) == null ? void 0 : K.category) == null : Cn(t.menu) && a.value.category == null;
|
|
3915
|
-
}),
|
|
3916
|
+
}), U = D(() => s.itemAttributeSettings.value.length > 0 && !p.value), M = H(
|
|
3916
3917
|
a.value.category != null || !!a.value.code || !!a.value.orderFrom
|
|
3917
3918
|
);
|
|
3918
|
-
function
|
|
3919
|
+
function F(K) {
|
|
3919
3920
|
K || (a.value = {
|
|
3920
3921
|
...a.value,
|
|
3921
3922
|
name: void 0,
|
|
@@ -3924,7 +3925,7 @@ const Ua = {
|
|
|
3924
3925
|
orderFrom: void 0
|
|
3925
3926
|
}, c());
|
|
3926
3927
|
}
|
|
3927
|
-
const
|
|
3928
|
+
const R = D(() => {
|
|
3928
3929
|
const K = {};
|
|
3929
3930
|
return t.menu.modules.item.forEach((Y) => {
|
|
3930
3931
|
var re;
|
|
@@ -3980,7 +3981,7 @@ const Ua = {
|
|
|
3980
3981
|
const y = H(
|
|
3981
3982
|
a.value.takeawayUsed != null || (((pe = a.value.variant) == null ? void 0 : pe.variantCombinations) || []).some((K) => K.takeawayUsed != null) || !1
|
|
3982
3983
|
);
|
|
3983
|
-
function
|
|
3984
|
+
function P(K) {
|
|
3984
3985
|
var Y, re;
|
|
3985
3986
|
K || (a.value = {
|
|
3986
3987
|
...a.value,
|
|
@@ -4090,7 +4091,7 @@ const Ua = {
|
|
|
4090
4091
|
hasUnsavedChanges: N
|
|
4091
4092
|
}), (K, Y) => {
|
|
4092
4093
|
const re = W("FmBreadcrumb"), ue = W("FmForm");
|
|
4093
|
-
return
|
|
4094
|
+
return $(), q(ue, {
|
|
4094
4095
|
id: o(Se).GENERAL,
|
|
4095
4096
|
class: fe(["tree-item-form", ["flex-1 py-24 space-y-24", "xs:w-full"]]),
|
|
4096
4097
|
ref_key: "formWrapper",
|
|
@@ -4107,10 +4108,10 @@ const Ua = {
|
|
|
4107
4108
|
}, null, 8, ["items"]),
|
|
4108
4109
|
C(bo, { "menu-store": o(g) }, null, 8, ["menu-store"]),
|
|
4109
4110
|
C(Be, {
|
|
4110
|
-
toggle:
|
|
4111
|
+
toggle: M.value,
|
|
4111
4112
|
"onUpdate:toggle": [
|
|
4112
|
-
Y[0] || (Y[0] = (Z) =>
|
|
4113
|
-
Y[1] || (Y[1] = (Z) =>
|
|
4113
|
+
Y[0] || (Y[0] = (Z) => M.value = Z),
|
|
4114
|
+
Y[1] || (Y[1] = (Z) => F(Z))
|
|
4114
4115
|
],
|
|
4115
4116
|
disabled: !p.value,
|
|
4116
4117
|
description: o(d)("menu.product.form.sections.general.description"),
|
|
@@ -4131,8 +4132,8 @@ const Ua = {
|
|
|
4131
4132
|
}),
|
|
4132
4133
|
_: 1
|
|
4133
4134
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
4134
|
-
p.value ? X("", !0) : (
|
|
4135
|
-
|
|
4135
|
+
p.value ? X("", !0) : ($(), J("div", qa)),
|
|
4136
|
+
U.value ? ($(), q(De, {
|
|
4136
4137
|
key: 1,
|
|
4137
4138
|
title: o(d)("menu.product.form.sections.tagging.title"),
|
|
4138
4139
|
"sub-title": o(d)("menu.product.form.sections.tagging.subtitle")
|
|
@@ -4142,12 +4143,12 @@ const Ua = {
|
|
|
4142
4143
|
entity: "item",
|
|
4143
4144
|
"model-value": a.value.customAttributes || {},
|
|
4144
4145
|
"onUpdate:modelValue": Y[2] || (Y[2] = (Z) => S("customAttributes", Z)),
|
|
4145
|
-
"value-options":
|
|
4146
|
+
"value-options": R.value
|
|
4146
4147
|
}, null, 8, ["model-value", "value-options"])
|
|
4147
4148
|
]),
|
|
4148
4149
|
_: 1
|
|
4149
4150
|
}, 8, ["title", "sub-title"])) : X("", !0),
|
|
4150
|
-
|
|
4151
|
+
U.value ? ($(), J("div", Xa)) : X("", !0),
|
|
4151
4152
|
C(Be, {
|
|
4152
4153
|
toggle: E.value,
|
|
4153
4154
|
"onUpdate:toggle": [
|
|
@@ -4169,8 +4170,8 @@ const Ua = {
|
|
|
4169
4170
|
]),
|
|
4170
4171
|
_: 1
|
|
4171
4172
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
4172
|
-
v.value.print && !p.value ? (
|
|
4173
|
-
v.value.print ? (
|
|
4173
|
+
v.value.print && !p.value ? ($(), J("div", Ja)) : X("", !0),
|
|
4174
|
+
v.value.print ? ($(), q(Be, {
|
|
4174
4175
|
key: 4,
|
|
4175
4176
|
toggle: j.value,
|
|
4176
4177
|
"onUpdate:toggle": [
|
|
@@ -4189,12 +4190,12 @@ const Ua = {
|
|
|
4189
4190
|
"is-addon": T.value,
|
|
4190
4191
|
"is-override": p.value,
|
|
4191
4192
|
"onUpdate:form": S,
|
|
4192
|
-
"onReplace:form": Y[5] || (Y[5] = (Z) =>
|
|
4193
|
+
"onReplace:form": Y[5] || (Y[5] = (Z) => O(Z))
|
|
4193
4194
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4194
4195
|
]),
|
|
4195
4196
|
_: 1
|
|
4196
4197
|
}, 8, ["toggle"])) : X("", !0),
|
|
4197
|
-
p.value ? X("", !0) : (
|
|
4198
|
+
p.value ? X("", !0) : ($(), J("div", Qa)),
|
|
4198
4199
|
C(Be, {
|
|
4199
4200
|
toggle: l.value,
|
|
4200
4201
|
"onUpdate:toggle": [
|
|
@@ -4213,13 +4214,13 @@ const Ua = {
|
|
|
4213
4214
|
"is-addon": T.value,
|
|
4214
4215
|
"is-override": p.value,
|
|
4215
4216
|
"onUpdate:form": S,
|
|
4216
|
-
"onReplace:form": Y[8] || (Y[8] = (Z) =>
|
|
4217
|
+
"onReplace:form": Y[8] || (Y[8] = (Z) => O(Z))
|
|
4217
4218
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4218
4219
|
]),
|
|
4219
4220
|
_: 1
|
|
4220
4221
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
4221
|
-
v.value.group && !p.value ? (
|
|
4222
|
-
v.value.group ? (
|
|
4222
|
+
v.value.group && !p.value ? ($(), J("div", Za)) : X("", !0),
|
|
4223
|
+
v.value.group ? ($(), q(Be, {
|
|
4223
4224
|
key: 7,
|
|
4224
4225
|
toggle: le.value,
|
|
4225
4226
|
"onUpdate:toggle": [
|
|
@@ -4238,13 +4239,13 @@ const Ua = {
|
|
|
4238
4239
|
"is-addon": T.value,
|
|
4239
4240
|
"is-override": p.value,
|
|
4240
4241
|
"onUpdate:form": S,
|
|
4241
|
-
"onReplace:form": Y[11] || (Y[11] = (Z) =>
|
|
4242
|
+
"onReplace:form": Y[11] || (Y[11] = (Z) => O(Z))
|
|
4242
4243
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4243
4244
|
]),
|
|
4244
4245
|
_: 1
|
|
4245
4246
|
}, 8, ["toggle", "disabled"])) : X("", !0),
|
|
4246
|
-
v.value.inventory && !p.value ? (
|
|
4247
|
-
v.value.inventory ? (
|
|
4247
|
+
v.value.inventory && !p.value ? ($(), J("div", el)) : X("", !0),
|
|
4248
|
+
v.value.inventory ? ($(), q(Be, {
|
|
4248
4249
|
key: 9,
|
|
4249
4250
|
toggle: _.value,
|
|
4250
4251
|
"onUpdate:toggle": [
|
|
@@ -4263,18 +4264,18 @@ const Ua = {
|
|
|
4263
4264
|
"is-addon": T.value,
|
|
4264
4265
|
"is-override": p.value,
|
|
4265
4266
|
"onUpdate:form": S,
|
|
4266
|
-
"onReplace:form": Y[14] || (Y[14] = (Z) =>
|
|
4267
|
+
"onReplace:form": Y[14] || (Y[14] = (Z) => O(Z))
|
|
4267
4268
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4268
4269
|
]),
|
|
4269
4270
|
_: 1
|
|
4270
4271
|
}, 8, ["toggle", "disabled", "description", "title"])) : X("", !0),
|
|
4271
|
-
v.value.takeaway(a.value.category ?? ((ie = f.value) == null ? void 0 : ie.category)) && !p.value ? (
|
|
4272
|
-
v.value.takeaway(a.value.category ?? ((Te = f.value) == null ? void 0 : Te.category)) ? (
|
|
4272
|
+
v.value.takeaway(a.value.category ?? ((ie = f.value) == null ? void 0 : ie.category)) && !p.value ? ($(), J("div", tl)) : X("", !0),
|
|
4273
|
+
v.value.takeaway(a.value.category ?? ((Te = f.value) == null ? void 0 : Te.category)) ? ($(), q(Be, {
|
|
4273
4274
|
key: 11,
|
|
4274
4275
|
toggle: y.value,
|
|
4275
4276
|
"onUpdate:toggle": [
|
|
4276
4277
|
Y[18] || (Y[18] = (Z) => y.value = Z),
|
|
4277
|
-
Y[19] || (Y[19] = (Z) =>
|
|
4278
|
+
Y[19] || (Y[19] = (Z) => P(Z))
|
|
4278
4279
|
],
|
|
4279
4280
|
disabled: !p.value,
|
|
4280
4281
|
description: o(d)("menu.product.form.sections.takeaway.description"),
|
|
@@ -4288,7 +4289,7 @@ const Ua = {
|
|
|
4288
4289
|
"is-addon": T.value,
|
|
4289
4290
|
"is-override": p.value,
|
|
4290
4291
|
"onUpdate:form": S,
|
|
4291
|
-
"onReplace:form": Y[17] || (Y[17] = (Z) =>
|
|
4292
|
+
"onReplace:form": Y[17] || (Y[17] = (Z) => O(Z))
|
|
4292
4293
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4293
4294
|
]),
|
|
4294
4295
|
_: 1
|
|
@@ -4343,7 +4344,7 @@ const rl = {
|
|
|
4343
4344
|
minWidth: sl,
|
|
4344
4345
|
maxWidth: ul
|
|
4345
4346
|
});
|
|
4346
|
-
return (m, s) => (
|
|
4347
|
+
return (m, s) => ($(), J("div", {
|
|
4347
4348
|
ref_key: "containerRef",
|
|
4348
4349
|
ref: e,
|
|
4349
4350
|
class: "flex h-full relative"
|
|
@@ -4364,7 +4365,7 @@ const rl = {
|
|
|
4364
4365
|
A("div", al, [
|
|
4365
4366
|
Me(m.$slots, "right-panel", {}, void 0, !0)
|
|
4366
4367
|
]),
|
|
4367
|
-
m.$slots.overlay ? (
|
|
4368
|
+
m.$slots.overlay ? ($(), J("div", ll, [
|
|
4368
4369
|
Me(m.$slots, "overlay", {}, void 0, !0)
|
|
4369
4370
|
])) : X("", !0)
|
|
4370
4371
|
], 512));
|
|
@@ -4418,7 +4419,7 @@ function kn() {
|
|
|
4418
4419
|
const f = /* @__PURE__ */ new Map(), a = mt(n.state.menu);
|
|
4419
4420
|
for (const S of a.modules.item)
|
|
4420
4421
|
f.set(S._id, S);
|
|
4421
|
-
d.forEach((S,
|
|
4422
|
+
d.forEach((S, O) => {
|
|
4422
4423
|
if (S.type === "item") {
|
|
4423
4424
|
const k = f.get(S.id);
|
|
4424
4425
|
if (k) {
|
|
@@ -4431,13 +4432,13 @@ function kn() {
|
|
|
4431
4432
|
const T = uo(
|
|
4432
4433
|
p ?? k,
|
|
4433
4434
|
h._id,
|
|
4434
|
-
|
|
4435
|
+
O + 1
|
|
4435
4436
|
);
|
|
4436
4437
|
Object.assign(k, T);
|
|
4437
4438
|
}
|
|
4438
4439
|
} else if (S.type === "subCategory")
|
|
4439
4440
|
v = pl(v, [...w, S.id], {
|
|
4440
|
-
position:
|
|
4441
|
+
position: O
|
|
4441
4442
|
});
|
|
4442
4443
|
else
|
|
4443
4444
|
throw new Error("Invalid item type");
|
|
@@ -4474,8 +4475,8 @@ function fl() {
|
|
|
4474
4475
|
function g(a) {
|
|
4475
4476
|
function I(S) {
|
|
4476
4477
|
if (S.children && S.children.length > 0)
|
|
4477
|
-
for (const
|
|
4478
|
-
|
|
4478
|
+
for (const O of S.children)
|
|
4479
|
+
O.parent = S, I(O);
|
|
4479
4480
|
}
|
|
4480
4481
|
for (const S of a)
|
|
4481
4482
|
I(S);
|
|
@@ -4483,45 +4484,45 @@ function fl() {
|
|
|
4483
4484
|
}
|
|
4484
4485
|
function d(a) {
|
|
4485
4486
|
return a.map((I) => {
|
|
4486
|
-
var
|
|
4487
|
+
var O, k, p;
|
|
4487
4488
|
const S = {
|
|
4488
4489
|
...I,
|
|
4489
4490
|
children: []
|
|
4490
4491
|
};
|
|
4491
4492
|
for (const T of I.children ?? []) {
|
|
4492
|
-
if (((
|
|
4493
|
+
if (((O = T.meta) == null ? void 0 : O.nodeType) !== "item")
|
|
4493
4494
|
continue;
|
|
4494
|
-
const
|
|
4495
|
-
if (!(
|
|
4495
|
+
const U = ut.get((k = T.meta) == null ? void 0 : k.rawId);
|
|
4496
|
+
if (!(U != null && U.subCategories) || !U.subCategories.length)
|
|
4496
4497
|
(p = S.children) == null || p.push(T);
|
|
4497
4498
|
else {
|
|
4498
|
-
let
|
|
4499
|
-
for (const
|
|
4500
|
-
|
|
4501
|
-
const E =
|
|
4499
|
+
let M = S.children, F = "";
|
|
4500
|
+
for (const R of U.subCategories || []) {
|
|
4501
|
+
F += R;
|
|
4502
|
+
const E = M.find(
|
|
4502
4503
|
(u) => {
|
|
4503
4504
|
var l, i;
|
|
4504
|
-
return ((l = u.meta) == null ? void 0 : l.nodeType) === "subCategory" && ((i = u.meta) == null ? void 0 : i.rawId) ===
|
|
4505
|
+
return ((l = u.meta) == null ? void 0 : l.nodeType) === "subCategory" && ((i = u.meta) == null ? void 0 : i.rawId) === R;
|
|
4505
4506
|
}
|
|
4506
4507
|
);
|
|
4507
4508
|
if (E)
|
|
4508
|
-
E.children = E.children || [],
|
|
4509
|
+
E.children = E.children || [], M = E.children;
|
|
4509
4510
|
else {
|
|
4510
4511
|
const u = {
|
|
4511
|
-
id: `category-${I.label}-sub-category-${
|
|
4512
|
-
label: s(
|
|
4512
|
+
id: `category-${I.label}-sub-category-${F}`,
|
|
4513
|
+
label: s(R),
|
|
4513
4514
|
icon: $e.CATEGORY,
|
|
4514
4515
|
children: [],
|
|
4515
4516
|
draggable: !0,
|
|
4516
4517
|
meta: {
|
|
4517
4518
|
nodeType: "subCategory",
|
|
4518
|
-
rawId:
|
|
4519
|
+
rawId: R
|
|
4519
4520
|
}
|
|
4520
4521
|
};
|
|
4521
|
-
|
|
4522
|
+
M.push(u), M = u.children;
|
|
4522
4523
|
}
|
|
4523
4524
|
}
|
|
4524
|
-
|
|
4525
|
+
M.push(T);
|
|
4525
4526
|
}
|
|
4526
4527
|
}
|
|
4527
4528
|
return S;
|
|
@@ -4544,19 +4545,19 @@ function fl() {
|
|
|
4544
4545
|
throw new Error("No parent category node found");
|
|
4545
4546
|
}
|
|
4546
4547
|
function b(a) {
|
|
4547
|
-
var
|
|
4548
|
+
var O, k, p, T;
|
|
4548
4549
|
if (!a.children)
|
|
4549
4550
|
return a;
|
|
4550
|
-
const I = ((k = (
|
|
4551
|
+
const I = ((k = (O = w(a)) == null ? void 0 : O.meta) == null ? void 0 : k.rawId) ?? null, S = co(I);
|
|
4551
4552
|
return ((p = a.meta) == null ? void 0 : p.nodeType) === "category" || ((T = a.meta) == null ? void 0 : T.nodeType) === "subCategory" ? (a.children = bt(
|
|
4552
4553
|
a.children,
|
|
4553
|
-
(
|
|
4554
|
-
(
|
|
4555
|
-
var
|
|
4556
|
-
if (((
|
|
4557
|
-
return h(
|
|
4558
|
-
if (((
|
|
4559
|
-
return S(
|
|
4554
|
+
(U) => U.label,
|
|
4555
|
+
(U) => {
|
|
4556
|
+
var M, F;
|
|
4557
|
+
if (((M = U.meta) == null ? void 0 : M.nodeType) === "subCategory")
|
|
4558
|
+
return h(U);
|
|
4559
|
+
if (((F = U.meta) == null ? void 0 : F.nodeType) === "item")
|
|
4560
|
+
return S(U.meta.rawObject);
|
|
4560
4561
|
throw new Error("Should not have other node type in category");
|
|
4561
4562
|
}
|
|
4562
4563
|
), { ...a, children: a.children.map(b) }) : a;
|
|
@@ -4566,13 +4567,13 @@ function fl() {
|
|
|
4566
4567
|
}
|
|
4567
4568
|
async function f({ eventEmitter: a }) {
|
|
4568
4569
|
var Q, le, Ce, he;
|
|
4569
|
-
const I = r.state.menu, S = !r.state.currentCatalogId,
|
|
4570
|
+
const I = r.state.menu, S = !r.state.currentCatalogId, O = !r.state.currentSchedulerId, k = (((le = (Q = r.currentCatalog) == null ? void 0 : Q.linkItemRules) == null ? void 0 : le.length) ?? 0) > 0, p = yo(), T = r.mergedMenu;
|
|
4570
4571
|
ut.clear(), dt.clear();
|
|
4571
4572
|
for (const c of I.modules.item)
|
|
4572
4573
|
ut.set(c._id, c);
|
|
4573
4574
|
for (const c of T.modules.group)
|
|
4574
4575
|
dt.set(c._id, c);
|
|
4575
|
-
function
|
|
4576
|
+
function U(c, V) {
|
|
4576
4577
|
return {
|
|
4577
4578
|
id: `add-item-${c}`,
|
|
4578
4579
|
icon: "add",
|
|
@@ -4583,7 +4584,7 @@ function fl() {
|
|
|
4583
4584
|
}
|
|
4584
4585
|
};
|
|
4585
4586
|
}
|
|
4586
|
-
function
|
|
4587
|
+
function M(c, V, N) {
|
|
4587
4588
|
var G;
|
|
4588
4589
|
const L = T.modules.group.find(
|
|
4589
4590
|
(z) => z._id === N._id
|
|
@@ -4653,7 +4654,7 @@ function fl() {
|
|
|
4653
4654
|
};
|
|
4654
4655
|
});
|
|
4655
4656
|
}
|
|
4656
|
-
function
|
|
4657
|
+
function F(c, V) {
|
|
4657
4658
|
const N = (ee) => V ? `item-${c._id}-variant-${V.combinationKey}-group-${ee}` : `item-${c._id}-group-${ee}`, L = [];
|
|
4658
4659
|
function G() {
|
|
4659
4660
|
var ne;
|
|
@@ -4683,7 +4684,7 @@ function fl() {
|
|
|
4683
4684
|
id: N(ne._id),
|
|
4684
4685
|
icon: $e.GROUP,
|
|
4685
4686
|
label: ne.name,
|
|
4686
|
-
children:
|
|
4687
|
+
children: M(c, V, ee),
|
|
4687
4688
|
onClick: () => {
|
|
4688
4689
|
a({
|
|
4689
4690
|
type: we.SELECT_GROUP,
|
|
@@ -4695,14 +4696,14 @@ function fl() {
|
|
|
4695
4696
|
}
|
|
4696
4697
|
return L;
|
|
4697
4698
|
}
|
|
4698
|
-
function
|
|
4699
|
-
return
|
|
4699
|
+
function R(c, V) {
|
|
4700
|
+
return F(c, V);
|
|
4700
4701
|
}
|
|
4701
4702
|
function E(c) {
|
|
4702
4703
|
var G;
|
|
4703
4704
|
const V = [], N = c.groups && c.groups.length > 0, L = ((G = c.variant) == null ? void 0 : G.variantGroupIds) && c.variant.variantGroupIds.length > 0;
|
|
4704
4705
|
if (N && !L) {
|
|
4705
|
-
const z =
|
|
4706
|
+
const z = F(c);
|
|
4706
4707
|
V.push(...z);
|
|
4707
4708
|
}
|
|
4708
4709
|
if (L) {
|
|
@@ -4721,7 +4722,7 @@ function fl() {
|
|
|
4721
4722
|
rr(oe, ne.combinationKey),
|
|
4722
4723
|
ne.code
|
|
4723
4724
|
),
|
|
4724
|
-
children:
|
|
4725
|
+
children: R(c, ne),
|
|
4725
4726
|
rightLabel: Jo(c, ne),
|
|
4726
4727
|
chips: Ee,
|
|
4727
4728
|
onClick: () => {
|
|
@@ -4743,7 +4744,7 @@ function fl() {
|
|
|
4743
4744
|
(c) => c.name
|
|
4744
4745
|
).map((c) => {
|
|
4745
4746
|
const V = [];
|
|
4746
|
-
return r.rules.category.create && V.push(
|
|
4747
|
+
return r.rules.category.create && V.push(U(c._id, t)), r.rules.category.edit && V.push({
|
|
4747
4748
|
id: `update-category-${c._id}`,
|
|
4748
4749
|
icon: "edit",
|
|
4749
4750
|
showOnHover: !0,
|
|
@@ -4759,7 +4760,7 @@ function fl() {
|
|
|
4759
4760
|
onClick: () => {
|
|
4760
4761
|
e.deleteCategory(c);
|
|
4761
4762
|
}
|
|
4762
|
-
}), !S &&
|
|
4763
|
+
}), !S && O && !k && V.push({
|
|
4763
4764
|
id: `apply-to-catalog-${c._id}`,
|
|
4764
4765
|
icon: "add_link",
|
|
4765
4766
|
showOnHover: !0,
|
|
@@ -4801,7 +4802,7 @@ function fl() {
|
|
|
4801
4802
|
rawObject: null
|
|
4802
4803
|
}
|
|
4803
4804
|
};
|
|
4804
|
-
i && (r.rules.category.create && x.actions.push(
|
|
4805
|
+
i && (r.rules.category.create && x.actions.push(U(null, t)), r.currentCatalog && x.actions.push({
|
|
4805
4806
|
id: "apply-to-catalog-addon",
|
|
4806
4807
|
icon: "add_link",
|
|
4807
4808
|
showOnHover: !0,
|
|
@@ -4838,7 +4839,7 @@ function fl() {
|
|
|
4838
4839
|
const Te = (Ee = r.currentCatalog) == null ? void 0 : Ee.override.items, Z = (Ve = Te == null ? void 0 : Te[c._id]) == null ? void 0 : Ve.find(
|
|
4839
4840
|
(Ke) => !Ke.combinationKey
|
|
4840
4841
|
), de = (Z == null ? void 0 : Z.orderFrom) === te.F_ORDER_FROM.enum.NONE;
|
|
4841
|
-
!S &&
|
|
4842
|
+
!S && O && !k && (de ? ie.push({
|
|
4842
4843
|
id: `apply-to-catalog-${c._id}`,
|
|
4843
4844
|
icon: "add_link",
|
|
4844
4845
|
showOnHover: !0,
|
|
@@ -4899,9 +4900,9 @@ function fl() {
|
|
|
4899
4900
|
);
|
|
4900
4901
|
V && (c.chips = ht(c.chips ?? [], V));
|
|
4901
4902
|
}
|
|
4902
|
-
const
|
|
4903
|
-
return g(
|
|
4904
|
-
tree: v(
|
|
4903
|
+
const P = d(l);
|
|
4904
|
+
return g(P), {
|
|
4905
|
+
tree: v(P)
|
|
4905
4906
|
};
|
|
4906
4907
|
}
|
|
4907
4908
|
return {
|
|
@@ -4986,18 +4987,18 @@ function gl() {
|
|
|
4986
4987
|
if (g(u)) {
|
|
4987
4988
|
const x = I(E), y = I(u);
|
|
4988
4989
|
return (x == null ? void 0 : x.id) === (y == null ? void 0 : y.id) ? !0 : !((x == null ? void 0 : x.id) !== (y == null ? void 0 : y.id) && a(y).some(
|
|
4989
|
-
(
|
|
4990
|
+
(P) => {
|
|
4990
4991
|
var j, Q;
|
|
4991
|
-
return ((j =
|
|
4992
|
+
return ((j = P.meta) == null ? void 0 : j.rawId) === ((Q = E.meta) == null ? void 0 : Q.rawId);
|
|
4992
4993
|
}
|
|
4993
4994
|
));
|
|
4994
4995
|
}
|
|
4995
4996
|
return s(u) && i && u.id !== i.id && l === "inside" ? !a(u).some((y) => {
|
|
4996
|
-
var
|
|
4997
|
-
return ((
|
|
4997
|
+
var P, j;
|
|
4998
|
+
return ((P = y.meta) == null ? void 0 : P.rawId) === ((j = E.meta) == null ? void 0 : j.rawId);
|
|
4998
4999
|
}) : !!(g(u) && (_ == null ? void 0 : _.id) !== (i == null ? void 0 : i.id) || d(u));
|
|
4999
5000
|
}
|
|
5000
|
-
const
|
|
5001
|
+
const O = (E, u, l) => {
|
|
5001
5002
|
const i = t.getNodeById(E), _ = t.getNodeById(u), x = i == null ? void 0 : i.parent, y = _ == null ? void 0 : _.parent;
|
|
5002
5003
|
return !i || !_ ? !1 : s(i) ? v(i, _) : d(i) ? f(i, _, l, x, y) : g(i) ? S(i, _, l, x, y) : !1;
|
|
5003
5004
|
};
|
|
@@ -5012,8 +5013,8 @@ function gl() {
|
|
|
5012
5013
|
const y = i.map((j) => {
|
|
5013
5014
|
var Q;
|
|
5014
5015
|
return (Q = j.meta) == null ? void 0 : Q.rawId;
|
|
5015
|
-
}).filter(Boolean),
|
|
5016
|
-
await e.rearrange(
|
|
5016
|
+
}).filter(Boolean), P = wt(y, _, x);
|
|
5017
|
+
await e.rearrange(P);
|
|
5017
5018
|
}
|
|
5018
5019
|
function p(E, u) {
|
|
5019
5020
|
var l;
|
|
@@ -5039,10 +5040,10 @@ function gl() {
|
|
|
5039
5040
|
var j;
|
|
5040
5041
|
const _ = b(u), x = ((j = u.children) == null ? void 0 : j.findIndex((Q) => Q.id === E.id)) ?? -1;
|
|
5041
5042
|
if (x === -1) throw new Error("Source index not found");
|
|
5042
|
-
const y = wt(_, x, l),
|
|
5043
|
-
await r.rearrangeWithSubCategory(y, i,
|
|
5043
|
+
const y = wt(_, x, l), P = w(u);
|
|
5044
|
+
await r.rearrangeWithSubCategory(y, i, P);
|
|
5044
5045
|
}
|
|
5045
|
-
async function
|
|
5046
|
+
async function U(E, u, l, i) {
|
|
5046
5047
|
var j;
|
|
5047
5048
|
const _ = b(u);
|
|
5048
5049
|
_.splice(l, 0, {
|
|
@@ -5054,15 +5055,15 @@ function gl() {
|
|
|
5054
5055
|
throw new Error("Expected dragged node to be an item");
|
|
5055
5056
|
const y = mt(E.meta.rawObject);
|
|
5056
5057
|
y.category = i._id, y.subCategories = x;
|
|
5057
|
-
const
|
|
5058
|
+
const P = h(E);
|
|
5058
5059
|
await r.updateItem(y._id, y), await r.rearrangeWithSubCategory(
|
|
5059
5060
|
_,
|
|
5060
5061
|
i,
|
|
5061
5062
|
x,
|
|
5062
|
-
|
|
5063
|
+
P
|
|
5063
5064
|
);
|
|
5064
5065
|
}
|
|
5065
|
-
async function
|
|
5066
|
+
async function M(E, u, l) {
|
|
5066
5067
|
var i;
|
|
5067
5068
|
try {
|
|
5068
5069
|
if (!S(E, u, l, E.parent, u.parent)) {
|
|
@@ -5075,7 +5076,7 @@ function gl() {
|
|
|
5075
5076
|
_.parent,
|
|
5076
5077
|
_.index,
|
|
5077
5078
|
x
|
|
5078
|
-
) : await
|
|
5079
|
+
) : await U(
|
|
5079
5080
|
E,
|
|
5080
5081
|
_.parent,
|
|
5081
5082
|
_.index,
|
|
@@ -5085,7 +5086,7 @@ function gl() {
|
|
|
5085
5086
|
m(_.message || "Failed to move item");
|
|
5086
5087
|
}
|
|
5087
5088
|
}
|
|
5088
|
-
async function
|
|
5089
|
+
async function F(E, u, l) {
|
|
5089
5090
|
if (!f(
|
|
5090
5091
|
E,
|
|
5091
5092
|
u,
|
|
@@ -5104,19 +5105,19 @@ function gl() {
|
|
|
5104
5105
|
if (x === -1 || y === -1)
|
|
5105
5106
|
throw new Error("Source or target index not found");
|
|
5106
5107
|
l === "after" && y++;
|
|
5107
|
-
const
|
|
5108
|
-
await r.rearrangeWithSubCategory(
|
|
5108
|
+
const P = wt(_, x, y), j = h(i), Q = w(i);
|
|
5109
|
+
await r.rearrangeWithSubCategory(P, j, Q);
|
|
5109
5110
|
}
|
|
5110
|
-
async function
|
|
5111
|
+
async function R(E) {
|
|
5111
5112
|
const u = t.getNodeById(E.draggedNodeId), l = t.getNodeById(E.targetNodeId);
|
|
5112
|
-
!u || !l || (s(u) ? await k(u, l, E.dragPosition) : g(u) ? await
|
|
5113
|
+
!u || !l || (s(u) ? await k(u, l, E.dragPosition) : g(u) ? await M(u, l, E.dragPosition) : d(u) ? await F(u, l, E.dragPosition) : m("Unsupported drag operation"));
|
|
5113
5114
|
}
|
|
5114
5115
|
return {
|
|
5115
5116
|
isCategoryNode: s,
|
|
5116
5117
|
isItemNode: g,
|
|
5117
5118
|
isSubCategoryNode: d,
|
|
5118
|
-
canDropFn:
|
|
5119
|
-
handleNodeDragDrop:
|
|
5119
|
+
canDropFn: O,
|
|
5120
|
+
handleNodeDragDrop: R
|
|
5120
5121
|
};
|
|
5121
5122
|
}
|
|
5122
5123
|
const St = /* @__PURE__ */ ae({
|
|
@@ -5129,7 +5130,7 @@ const St = /* @__PURE__ */ ae({
|
|
|
5129
5130
|
const r = n;
|
|
5130
5131
|
return (e, t) => {
|
|
5131
5132
|
const m = W("FmIcon");
|
|
5132
|
-
return
|
|
5133
|
+
return $(), J("div", {
|
|
5133
5134
|
class: fe(`p-4 relative flex items-center justify-center ${r.visible ? "" : "invisible"}`)
|
|
5134
5135
|
}, [
|
|
5135
5136
|
C(m, {
|
|
@@ -5153,7 +5154,7 @@ const St = /* @__PURE__ */ ae({
|
|
|
5153
5154
|
setup(n) {
|
|
5154
5155
|
return (r, e) => {
|
|
5155
5156
|
const t = W("FmTooltip");
|
|
5156
|
-
return r.tooltip ? (
|
|
5157
|
+
return r.tooltip ? ($(), q(t, {
|
|
5157
5158
|
key: 0,
|
|
5158
5159
|
content: r.tooltip,
|
|
5159
5160
|
"z-index": 50
|
|
@@ -5166,7 +5167,7 @@ const St = /* @__PURE__ */ ae({
|
|
|
5166
5167
|
}, null, 8, ["name", "visible", "onClick"])
|
|
5167
5168
|
]),
|
|
5168
5169
|
_: 1
|
|
5169
|
-
}, 8, ["content"])) : (
|
|
5170
|
+
}, 8, ["content"])) : ($(), q(St, {
|
|
5170
5171
|
key: 1,
|
|
5171
5172
|
name: r.name,
|
|
5172
5173
|
visible: r.visible,
|
|
@@ -5190,9 +5191,9 @@ function vl(n) {
|
|
|
5190
5191
|
});
|
|
5191
5192
|
const p = m();
|
|
5192
5193
|
if (!p) return;
|
|
5193
|
-
const T = p.getBoundingClientRect(),
|
|
5194
|
-
if (
|
|
5195
|
-
const l =
|
|
5194
|
+
const T = p.getBoundingClientRect(), U = k.clientY - T.top + p.scrollTop, M = Math.floor(U / r), F = t();
|
|
5195
|
+
if (M >= 0 && M < F.length) {
|
|
5196
|
+
const l = F[M].id;
|
|
5196
5197
|
if (l === d.value) {
|
|
5197
5198
|
h.value = null, w.value = null, e("updateDragState", d.value, null, null);
|
|
5198
5199
|
return;
|
|
@@ -5209,8 +5210,8 @@ function vl(n) {
|
|
|
5209
5210
|
}
|
|
5210
5211
|
e("updateDragState", d.value, h.value, w.value);
|
|
5211
5212
|
}
|
|
5212
|
-
const
|
|
5213
|
-
k.clientY - T.top <
|
|
5213
|
+
const R = 50;
|
|
5214
|
+
k.clientY - T.top < R ? p.scrollTop -= 10 : T.bottom - k.clientY < R && (p.scrollTop += 10);
|
|
5214
5215
|
}
|
|
5215
5216
|
function S() {
|
|
5216
5217
|
document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", S), g.value && d.value && h.value && w.value && e("nodeDragDrop", {
|
|
@@ -5219,7 +5220,7 @@ function vl(n) {
|
|
|
5219
5220
|
dragPosition: w.value
|
|
5220
5221
|
}), g.value = !1, e("updateDragState", null, null, null), d.value = null, h.value = null, w.value = null, f.value.clear();
|
|
5221
5222
|
}
|
|
5222
|
-
function
|
|
5223
|
+
function O() {
|
|
5223
5224
|
document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", S), g.value = !1, e("updateDragState", null, null, null), d.value = null, h.value = null, w.value = null, f.value.clear();
|
|
5224
5225
|
}
|
|
5225
5226
|
return {
|
|
@@ -5229,7 +5230,7 @@ function vl(n) {
|
|
|
5229
5230
|
dropPosition: w,
|
|
5230
5231
|
mousePosition: v,
|
|
5231
5232
|
onDragStart: a,
|
|
5232
|
-
cancelDrag:
|
|
5233
|
+
cancelDrag: O
|
|
5233
5234
|
};
|
|
5234
5235
|
}
|
|
5235
5236
|
function bl(n, r) {
|
|
@@ -5265,7 +5266,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5265
5266
|
const t = r.highlightedStrings.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), m = new RegExp(`(${t})`, "gi");
|
|
5266
5267
|
return r.text.replace(m, '<span class="highlighted-span">$1</span>');
|
|
5267
5268
|
});
|
|
5268
|
-
return (t, m) => !t.highlightedStrings || t.highlightedStrings.length === 0 ? (
|
|
5269
|
+
return (t, m) => !t.highlightedStrings || t.highlightedStrings.length === 0 ? ($(), J("span", _l, ge(t.text), 1)) : ($(), J("span", {
|
|
5269
5270
|
key: 1,
|
|
5270
5271
|
innerHTML: e.value
|
|
5271
5272
|
}, null, 8, yl));
|
|
@@ -5337,15 +5338,15 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5337
5338
|
return !!e.node.disabled || !((f = e.node) != null && f.draggable);
|
|
5338
5339
|
});
|
|
5339
5340
|
return (f, a) => {
|
|
5340
|
-
var
|
|
5341
|
+
var O, k, p;
|
|
5341
5342
|
const I = W("FmIcon"), S = W("FmTooltip");
|
|
5342
|
-
return
|
|
5343
|
+
return $(), J("div", {
|
|
5343
5344
|
class: fe(["tree-node", "max-w-full", "py-4 px-8 flex items-center justify-between gap-4", "fm-corner-radius-sm", "select-none", m.value, s.value, g.value, {
|
|
5344
5345
|
"opacity-50": f.dragging
|
|
5345
5346
|
}, "hover-effect"]),
|
|
5346
5347
|
onClick: a[2] || (a[2] = qe(() => {
|
|
5347
|
-
var T,
|
|
5348
|
-
f.node.disabled || (
|
|
5348
|
+
var T, U;
|
|
5349
|
+
f.node.disabled || (U = (T = f.node).onClick) == null || U.call(T);
|
|
5349
5350
|
}, ["stop"])),
|
|
5350
5351
|
onMousedown: a[3] || (a[3] = //@ts-ignore
|
|
5351
5352
|
(...T) => o(w) && o(w)(...T)),
|
|
@@ -5355,7 +5356,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5355
5356
|
(...T) => o(v) && o(v)(...T)),
|
|
5356
5357
|
onMouseleave: a[6] || (a[6] = //@ts-ignore
|
|
5357
5358
|
(...T) => o(v) && o(v)(...T))
|
|
5358
|
-
}, [A("div", wl, [A("div", Cl, [(
|
|
5359
|
+
}, [A("div", wl, [A("div", Cl, [(O = f.node) != null && O.draggable && !f.node.disabled ? ($(), q(I, {
|
|
5359
5360
|
key: 0,
|
|
5360
5361
|
name: "drag_indicator",
|
|
5361
5362
|
size: "sm",
|
|
@@ -5367,7 +5368,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5367
5368
|
onClick: a[0] || (a[0] = qe(() => {
|
|
5368
5369
|
f.node.disabled || h("toggleExpand");
|
|
5369
5370
|
}, ["stop"]))
|
|
5370
|
-
}, null, 8, ["name", "visible"]), f.node.icon ? (
|
|
5371
|
+
}, null, 8, ["name", "visible"]), f.node.icon ? ($(), q(I, {
|
|
5371
5372
|
key: 1,
|
|
5372
5373
|
size: "sm",
|
|
5373
5374
|
outline: "",
|
|
@@ -5390,30 +5391,30 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5390
5391
|
highlightedStrings: f.highlightedStrings
|
|
5391
5392
|
}, null, 8, ["class", "text", "highlightedStrings"])]),
|
|
5392
5393
|
_: 1
|
|
5393
|
-
}, 8, ["content"])])]), A("div", El, [(
|
|
5394
|
+
}, 8, ["content"])])]), A("div", El, [($(!0), J(Oe, null, Ne(f.node.chips, (T) => ($(), q(Uo, {
|
|
5394
5395
|
key: T.label,
|
|
5395
5396
|
size: T.size || "xs",
|
|
5396
5397
|
label: T.label,
|
|
5397
5398
|
variant: T.variant || "neutral",
|
|
5398
5399
|
border: T.border
|
|
5399
|
-
}, null, 8, ["size", "label", "variant", "border"]))), 128))])]), A("div", Tl, [A("div", xl, [(
|
|
5400
|
+
}, null, 8, ["size", "label", "variant", "border"]))), 128))])]), A("div", Tl, [A("div", xl, [($(!0), J(Oe, null, Ne(f.node.actions, (T) => ($(), q(Ft, {
|
|
5400
5401
|
key: T.id,
|
|
5401
5402
|
name: T.icon,
|
|
5402
5403
|
tooltip: T.tooltip,
|
|
5403
5404
|
visible: !0,
|
|
5404
|
-
onClick: (
|
|
5405
|
-
var
|
|
5406
|
-
return (
|
|
5405
|
+
onClick: (U) => {
|
|
5406
|
+
var M;
|
|
5407
|
+
return (M = T.onClick) == null ? void 0 : M.call(T);
|
|
5407
5408
|
}
|
|
5408
5409
|
}, null, 8, ["name", "tooltip", "onClick"]))), 128))]), C(Ct, {
|
|
5409
5410
|
class: fe(["fm-typo-en-body-md-400", ((k = f.node.rightLabel) == null ? void 0 : k.variant) === o(Qe).PRIMARY ? "text-fm-color-primary" : "text-fm-color-typo-secondary"]),
|
|
5410
5411
|
text: (p = f.node.rightLabel) == null ? void 0 : p.label,
|
|
5411
5412
|
highlightedStrings: f.highlightedStrings,
|
|
5412
5413
|
onClick: a[1] || (a[1] = qe((T) => {
|
|
5413
|
-
var
|
|
5414
|
-
return (
|
|
5414
|
+
var U, M;
|
|
5415
|
+
return (M = (U = f.node.rightLabel) == null ? void 0 : U.onClick) == null ? void 0 : M.call(U);
|
|
5415
5416
|
}, ["stop"]))
|
|
5416
|
-
}, null, 8, ["class", "text", "highlightedStrings"])]), f.dropTarget && f.dropPosition === "before" ? (
|
|
5417
|
+
}, null, 8, ["class", "text", "highlightedStrings"])]), f.dropTarget && f.dropPosition === "before" ? ($(), J("div", Sl)) : X("", !0), f.dropTarget && f.dropPosition === "after" ? ($(), J("div", Fl)) : X("", !0), f.dropTarget && f.dropPosition === "inside" ? ($(), J("div", Ol)) : X("", !0)], 34);
|
|
5417
5418
|
};
|
|
5418
5419
|
}
|
|
5419
5420
|
}), Vl = ["id"], $l = {
|
|
@@ -5439,22 +5440,22 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5439
5440
|
const {
|
|
5440
5441
|
t
|
|
5441
5442
|
} = ce(), m = n, s = e;
|
|
5442
|
-
function g(
|
|
5443
|
-
const
|
|
5444
|
-
|
|
5443
|
+
function g(F) {
|
|
5444
|
+
const R = m.expandedNodeIds;
|
|
5445
|
+
R != null && R.includes(F) ? s("updateExpandedNodeIds", R.filter((E) => E !== F)) : s("updateExpandedNodeIds", [...R || [], F]);
|
|
5445
5446
|
}
|
|
5446
5447
|
const d = D(() => new Set(m.expandedNodeIds)), h = D(() => {
|
|
5447
|
-
const
|
|
5448
|
-
function
|
|
5448
|
+
const F = [];
|
|
5449
|
+
function R(E, u = 0) {
|
|
5449
5450
|
if (E)
|
|
5450
5451
|
for (const l of E)
|
|
5451
|
-
|
|
5452
|
+
F.push({
|
|
5452
5453
|
id: l.id,
|
|
5453
5454
|
level: u,
|
|
5454
5455
|
node: l
|
|
5455
|
-
}), d.value.has(l.id) && l.children && l.children.length > 0 &&
|
|
5456
|
+
}), d.value.has(l.id) && l.children && l.children.length > 0 && R(l.children, u + 1);
|
|
5456
5457
|
}
|
|
5457
|
-
return
|
|
5458
|
+
return R(m.nodes), F;
|
|
5458
5459
|
});
|
|
5459
5460
|
H(null);
|
|
5460
5461
|
const {
|
|
@@ -5466,29 +5467,29 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5466
5467
|
itemHeight: It,
|
|
5467
5468
|
overscan: 10
|
|
5468
5469
|
});
|
|
5469
|
-
ye(() => h.value.length, async (
|
|
5470
|
-
const
|
|
5471
|
-
|
|
5470
|
+
ye(() => h.value.length, async (F) => {
|
|
5471
|
+
const R = v.ref.value;
|
|
5472
|
+
R && F * It < R.scrollTop && (await nt(), b(0));
|
|
5472
5473
|
});
|
|
5473
5474
|
function a() {
|
|
5474
5475
|
b(0);
|
|
5475
5476
|
}
|
|
5476
|
-
function I(
|
|
5477
|
-
const
|
|
5478
|
-
|
|
5477
|
+
function I(F) {
|
|
5478
|
+
const R = h.value.findIndex((E) => E.id === F);
|
|
5479
|
+
R !== -1 && b(R);
|
|
5479
5480
|
}
|
|
5480
5481
|
const {
|
|
5481
5482
|
isDragging: S,
|
|
5482
|
-
draggedNodeId:
|
|
5483
|
+
draggedNodeId: O,
|
|
5483
5484
|
dropTargetNodeId: k,
|
|
5484
5485
|
dropPosition: p,
|
|
5485
5486
|
mousePosition: T,
|
|
5486
|
-
onDragStart:
|
|
5487
|
-
cancelDrag:
|
|
5487
|
+
onDragStart: U,
|
|
5488
|
+
cancelDrag: M
|
|
5488
5489
|
} = vl({
|
|
5489
5490
|
itemHeight: It,
|
|
5490
|
-
emit: (
|
|
5491
|
-
|
|
5491
|
+
emit: (F, ...R) => {
|
|
5492
|
+
F === "updateDragState" ? s("updateDragState", ...R) : F === "nodeDragDrop" && s("nodeDragDrop", R[0]);
|
|
5492
5493
|
},
|
|
5493
5494
|
getFlattenedItems: () => h.value,
|
|
5494
5495
|
getContainerRef: () => v.ref.value,
|
|
@@ -5497,43 +5498,43 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5497
5498
|
return r({
|
|
5498
5499
|
scrollToTop: a,
|
|
5499
5500
|
scrollToNode: I,
|
|
5500
|
-
cancelDrag:
|
|
5501
|
-
}), (
|
|
5501
|
+
cancelDrag: M
|
|
5502
|
+
}), (F, R) => {
|
|
5502
5503
|
var u;
|
|
5503
5504
|
const E = W("FmIcon");
|
|
5504
|
-
return
|
|
5505
|
+
return $(), J("div", Vn({
|
|
5505
5506
|
class: "tree-container"
|
|
5506
|
-
}, o(v)), [A("div", $n(Pn(o(f))), [(
|
|
5507
|
+
}, o(v)), [A("div", $n(Pn(o(f))), [($(!0), J(Oe, null, Ne(o(w), ({
|
|
5507
5508
|
data: l
|
|
5508
5509
|
}) => {
|
|
5509
5510
|
var i;
|
|
5510
|
-
return
|
|
5511
|
+
return $(), J("div", {
|
|
5511
5512
|
key: l.id,
|
|
5512
5513
|
class: fe(["tree-node-wrapper", {
|
|
5513
5514
|
"drop-target": o(k) === l.id,
|
|
5514
5515
|
"drop-before": o(k) === l.id && o(p) === "before",
|
|
5515
5516
|
"drop-after": o(k) === l.id && o(p) === "after",
|
|
5516
5517
|
"drop-inside": o(k) === l.id && o(p) === "inside",
|
|
5517
|
-
"being-dragged": o(
|
|
5518
|
+
"being-dragged": o(O) === l.id
|
|
5518
5519
|
}]),
|
|
5519
5520
|
id: `tree-node-${l.id}`
|
|
5520
|
-
}, [(
|
|
5521
|
+
}, [($(), q(Dl, {
|
|
5521
5522
|
key: l.id,
|
|
5522
5523
|
node: l.node,
|
|
5523
5524
|
selected: m.selectedNodeId === l.id,
|
|
5524
5525
|
expandable: !!((i = l.node.children) != null && i.length && l.node.children.length > 0),
|
|
5525
5526
|
expanded: d.value.has(l.id),
|
|
5526
5527
|
highlightedStrings: l.node.highlightedStrings,
|
|
5527
|
-
dragging: o(S) && o(
|
|
5528
|
+
dragging: o(S) && o(O) === l.id,
|
|
5528
5529
|
dropTarget: o(k) === l.id,
|
|
5529
5530
|
dropPosition: o(k) === l.id ? o(p) : null,
|
|
5530
5531
|
onToggleExpand: (_) => g(l.id),
|
|
5531
|
-
onDragStart: (_) => o(
|
|
5532
|
+
onDragStart: (_) => o(U)(l.id, _),
|
|
5532
5533
|
style: ct({
|
|
5533
5534
|
paddingLeft: `${l.level * 20}px`
|
|
5534
5535
|
})
|
|
5535
5536
|
}, null, 8, ["node", "selected", "expandable", "expanded", "highlightedStrings", "dragging", "dropTarget", "dropPosition", "onToggleExpand", "onDragStart", "style"]))], 10, Vl);
|
|
5536
|
-
}), 128))], 16), o(S) && o(
|
|
5537
|
+
}), 128))], 16), o(S) && o(O) ? ($(), J("div", {
|
|
5537
5538
|
key: 0,
|
|
5538
5539
|
class: "drag-overlay",
|
|
5539
5540
|
style: ct({
|
|
@@ -5544,7 +5545,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5544
5545
|
})
|
|
5545
5546
|
}, [A("div", $l, [C(E, {
|
|
5546
5547
|
name: "drag_indicator"
|
|
5547
|
-
}), A("span", null, ge((u = h.value.find((l) => l.id === o(
|
|
5548
|
+
}), A("span", null, ge((u = h.value.find((l) => l.id === o(O))) == null ? void 0 : u.node.label), 1)])], 4)) : X("", !0), h.value.length === 0 ? ($(), J("div", Pl, ge(o(t)("menu.tree_editor.labels.no_items")), 1)) : X("", !0)], 16);
|
|
5548
5549
|
};
|
|
5549
5550
|
}
|
|
5550
5551
|
}), Rl = /* @__PURE__ */ Ze(Ul, [["__scopeId", "data-v-9244f342"]]), Ml = { class: "py-4 px-8 flex items-center gap-4 text-fm-color-primary cursor-pointer relative" }, Al = {
|
|
@@ -5559,12 +5560,12 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5559
5560
|
setup(n) {
|
|
5560
5561
|
return (r, e) => {
|
|
5561
5562
|
const t = W("FmIcon");
|
|
5562
|
-
return
|
|
5563
|
-
r.icon ? (
|
|
5563
|
+
return $(), J("div", Ml, [
|
|
5564
|
+
r.icon ? ($(), q(t, {
|
|
5564
5565
|
key: 0,
|
|
5565
5566
|
name: r.icon
|
|
5566
5567
|
}, null, 8, ["name"])) : X("", !0),
|
|
5567
|
-
r.label ? (
|
|
5568
|
+
r.label ? ($(), J("span", Al, ge(r.label), 1)) : X("", !0),
|
|
5568
5569
|
e[0] || (e[0] = A("div", { class: "absolute inset-0 fm-corner-radius-md hover:bg-fm-color-opacity-sm" }, null, -1))
|
|
5569
5570
|
]);
|
|
5570
5571
|
};
|
|
@@ -5595,90 +5596,93 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5595
5596
|
async function f() {
|
|
5596
5597
|
return await v({
|
|
5597
5598
|
filterState: e.filterState,
|
|
5598
|
-
eventEmitter: (
|
|
5599
|
-
t("tree-event",
|
|
5599
|
+
eventEmitter: (M) => {
|
|
5600
|
+
t("tree-event", M);
|
|
5600
5601
|
}
|
|
5601
5602
|
});
|
|
5602
5603
|
}
|
|
5603
5604
|
ye([() => e.overridedMenu, () => b.value], async () => {
|
|
5604
|
-
const
|
|
5605
|
+
const M = await f();
|
|
5605
5606
|
if (e.filterState.searchKey) {
|
|
5606
|
-
const
|
|
5607
|
-
m.setTreeNodes(
|
|
5607
|
+
const F = er(M.tree, e.filterState.searchKey);
|
|
5608
|
+
m.setTreeNodes(F.subTree), m.setExpandedNodeIds(F.shouldExpandNodeIds);
|
|
5608
5609
|
} else
|
|
5609
|
-
m.setTreeNodes(
|
|
5610
|
+
m.setTreeNodes(M.tree);
|
|
5610
5611
|
});
|
|
5611
5612
|
const {
|
|
5612
5613
|
t: a
|
|
5613
5614
|
} = ce(), {
|
|
5614
5615
|
menuItems: I,
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5616
|
+
categories: S,
|
|
5617
|
+
linkItemRules: O,
|
|
5618
|
+
handleSubmit: k,
|
|
5619
|
+
catalogManager: p,
|
|
5620
|
+
schedulerManager: T,
|
|
5621
|
+
noScheduler: U
|
|
5620
5622
|
} = ho(!0);
|
|
5621
|
-
return (
|
|
5623
|
+
return (M, F) => ($(), J("div", Nl, [A("div", Ll, [o(s).rules.category.create ? ($(), q(kt, {
|
|
5622
5624
|
key: 0,
|
|
5623
5625
|
label: o(a)("menu.tree_editor.actions.add_category"),
|
|
5624
5626
|
icon: "add",
|
|
5625
|
-
onClick:
|
|
5626
|
-
}, null, 8, ["label"])) : X("", !0), o(s).state.currentCatalogId && !o(s).state.currentSchedulerId ? (
|
|
5627
|
+
onClick: F[0] || (F[0] = (R) => o(g).create())
|
|
5628
|
+
}, null, 8, ["label"])) : X("", !0), o(s).state.currentCatalogId && !o(s).state.currentSchedulerId ? ($(), q(xt, {
|
|
5627
5629
|
key: 1,
|
|
5628
|
-
"categorized-items": o(
|
|
5629
|
-
"initial-value": o(
|
|
5630
|
+
"categorized-items": o(p).linkableItems.value,
|
|
5631
|
+
"initial-value": o(p).currentItems.value,
|
|
5630
5632
|
"menu-items": o(I),
|
|
5631
|
-
|
|
5633
|
+
categories: o(S),
|
|
5634
|
+
"link-item-rules": o(O),
|
|
5632
5635
|
"show-variant": !1,
|
|
5633
|
-
"no-scheduler": o(
|
|
5636
|
+
"no-scheduler": o(U),
|
|
5634
5637
|
"is-local-only": !0,
|
|
5635
|
-
onSubmit: o(
|
|
5638
|
+
onSubmit: o(k)
|
|
5636
5639
|
}, {
|
|
5637
5640
|
default: B(({
|
|
5638
|
-
trigger:
|
|
5641
|
+
trigger: R
|
|
5639
5642
|
}) => [C(kt, {
|
|
5640
5643
|
label: o(a)("menu.catalog.edit.link_product"),
|
|
5641
5644
|
icon: "link",
|
|
5642
|
-
onClick:
|
|
5645
|
+
onClick: R
|
|
5643
5646
|
}, null, 8, ["label", "onClick"])]),
|
|
5644
5647
|
_: 1
|
|
5645
|
-
}, 8, ["categorized-items", "initial-value", "menu-items", "link-item-rules", "no-scheduler", "onSubmit"])) : X("", !0), o(s).state.currentSchedulerId ? (
|
|
5648
|
+
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : X("", !0), o(s).state.currentSchedulerId ? ($(), q(xt, {
|
|
5646
5649
|
key: 2,
|
|
5647
|
-
"categorized-items": o(
|
|
5648
|
-
"initial-value": o(
|
|
5650
|
+
"categorized-items": o(T).linkableItems.value,
|
|
5651
|
+
"initial-value": o(T).currentItems.value,
|
|
5649
5652
|
"menu-items": o(I),
|
|
5650
|
-
|
|
5653
|
+
categories: o(S),
|
|
5654
|
+
"link-item-rules": o(O),
|
|
5651
5655
|
"show-variant": !1,
|
|
5652
|
-
"no-scheduler": o(
|
|
5656
|
+
"no-scheduler": o(U),
|
|
5653
5657
|
"is-local-only": !0,
|
|
5654
|
-
onSubmit: o(
|
|
5658
|
+
onSubmit: o(k)
|
|
5655
5659
|
}, {
|
|
5656
5660
|
default: B(({
|
|
5657
|
-
trigger:
|
|
5661
|
+
trigger: R
|
|
5658
5662
|
}) => [C(kt, {
|
|
5659
5663
|
label: o(a)("menu.catalog.edit.apply_scheduler"),
|
|
5660
5664
|
icon: "link",
|
|
5661
|
-
onClick:
|
|
5665
|
+
onClick: R
|
|
5662
5666
|
}, null, 8, ["label", "onClick"])]),
|
|
5663
5667
|
_: 1
|
|
5664
|
-
}, 8, ["categorized-items", "initial-value", "menu-items", "link-item-rules", "no-scheduler", "onSubmit"])) : X("", !0), A("div", Gl, [C(Ft, {
|
|
5668
|
+
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : X("", !0), A("div", Gl, [C(Ft, {
|
|
5665
5669
|
name: "expand_all",
|
|
5666
5670
|
tooltip: o(a)("menu.tree_editor.actions.expand_all"),
|
|
5667
5671
|
visible: !0,
|
|
5668
|
-
onClick:
|
|
5672
|
+
onClick: F[1] || (F[1] = (R) => o(m).expandAllNodes())
|
|
5669
5673
|
}, null, 8, ["tooltip"]), C(Ft, {
|
|
5670
5674
|
name: "collapse_all",
|
|
5671
5675
|
tooltip: o(a)("menu.tree_editor.actions.collapse_all"),
|
|
5672
5676
|
visible: !0,
|
|
5673
|
-
onClick:
|
|
5677
|
+
onClick: F[2] || (F[2] = (R) => o(m).collapseAllNodes())
|
|
5674
5678
|
}, null, 8, ["tooltip"])])]), C(eo, null, {
|
|
5675
5679
|
default: B(() => [C(Rl, {
|
|
5676
5680
|
nodes: o(m).treeNodes,
|
|
5677
5681
|
selectedNodeId: o(m).selectedNodeId,
|
|
5678
5682
|
expandedNodeIds: o(m).expandedNodeIds,
|
|
5679
5683
|
canDropFn: o(d),
|
|
5680
|
-
onUpdateExpandedNodeIds:
|
|
5681
|
-
onNodeDragDrop:
|
|
5684
|
+
onUpdateExpandedNodeIds: F[3] || (F[3] = (R) => o(m).setExpandedNodeIds(R)),
|
|
5685
|
+
onNodeDragDrop: F[4] || (F[4] = (R) => o(h)(R))
|
|
5682
5686
|
}, null, 8, ["nodes", "selectedNodeId", "expandedNodeIds", "canDropFn"])]),
|
|
5683
5687
|
_: 1
|
|
5684
5688
|
})]));
|
|
@@ -5727,7 +5731,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5727
5731
|
});
|
|
5728
5732
|
return (v, f) => {
|
|
5729
5733
|
const a = W("FmSearch");
|
|
5730
|
-
return
|
|
5734
|
+
return $(), J("div", Bl, [
|
|
5731
5735
|
C(Kt, {
|
|
5732
5736
|
"model-value": m.value.catalogId || "",
|
|
5733
5737
|
items: s.value,
|
|
@@ -5736,7 +5740,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5736
5740
|
"custom-label": g.value,
|
|
5737
5741
|
"onUpdate:modelValue": f[0] || (f[0] = (I) => m.value.catalogId = I)
|
|
5738
5742
|
}, null, 8, ["model-value", "items", "placeholder", "search-placeholder", "custom-label"]),
|
|
5739
|
-
h.value ? (
|
|
5743
|
+
h.value ? ($(), q(Kt, {
|
|
5740
5744
|
key: 0,
|
|
5741
5745
|
"model-value": m.value.schedulerId || "",
|
|
5742
5746
|
items: w.value,
|
|
@@ -5745,12 +5749,12 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5745
5749
|
"custom-label": d.value,
|
|
5746
5750
|
"onUpdate:modelValue": f[1] || (f[1] = (I) => m.value.schedulerId = I)
|
|
5747
5751
|
}, null, 8, ["model-value", "items", "placeholder", "search-placeholder", "custom-label"])) : X("", !0),
|
|
5748
|
-
b.value ? (
|
|
5752
|
+
b.value ? ($(), q(Po, {
|
|
5749
5753
|
key: 1,
|
|
5750
|
-
"current-restaurant-
|
|
5751
|
-
onConfirm: f[2] || (f[2] = (I) => o(t).
|
|
5754
|
+
"current-restaurant-attr-params": o(t).state.currentRestaurantAttrParams,
|
|
5755
|
+
onConfirm: f[2] || (f[2] = (I) => o(t).setRestaurantAttrParams(I)),
|
|
5752
5756
|
fullWidth: !0
|
|
5753
|
-
}, null, 8, ["current-restaurant-
|
|
5757
|
+
}, null, 8, ["current-restaurant-attr-params"])) : X("", !0),
|
|
5754
5758
|
f[4] || (f[4] = A("div", { class: "h-[1px] bg-fm-color-neutral-gray-100" }, null, -1)),
|
|
5755
5759
|
C(a, {
|
|
5756
5760
|
"model-value": m.value.searchKey || "",
|
|
@@ -5781,7 +5785,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5781
5785
|
m.selectCatalog(t.value.catalogId), m.selectScheduler(t.value.schedulerId);
|
|
5782
5786
|
}), (s, g) => {
|
|
5783
5787
|
const d = W("FmCircularProgress");
|
|
5784
|
-
return
|
|
5788
|
+
return $(), J("div", Yl, [
|
|
5785
5789
|
A("div", jl, [
|
|
5786
5790
|
C(zl, {
|
|
5787
5791
|
menu: s.menu,
|
|
@@ -5797,7 +5801,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5797
5801
|
onTreeEvent: g[1] || (g[1] = (h) => e("tree-event", h))
|
|
5798
5802
|
}, null, 8, ["menu", "overrided-menu", "filter-state"])
|
|
5799
5803
|
]),
|
|
5800
|
-
s.loading ? (
|
|
5804
|
+
s.loading ? ($(), J("div", Hl, [
|
|
5801
5805
|
A("div", ql, [
|
|
5802
5806
|
C(d, { size: "lg" })
|
|
5803
5807
|
])
|
|
@@ -5836,17 +5840,17 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5836
5840
|
}
|
|
5837
5841
|
}
|
|
5838
5842
|
function f(a) {
|
|
5839
|
-
var I, S,
|
|
5843
|
+
var I, S, O;
|
|
5840
5844
|
if (((I = d.value) == null ? void 0 : I._id) === a)
|
|
5841
5845
|
return !0;
|
|
5842
5846
|
if (g.value && g.value !== a && ((S = s.value) != null && S.hasUnsavedChanges())) {
|
|
5843
|
-
const k = (
|
|
5847
|
+
const k = (O = s.value) == null ? void 0 : O.validate();
|
|
5844
5848
|
if (!k || k.length > 0)
|
|
5845
5849
|
return !1;
|
|
5846
5850
|
}
|
|
5847
5851
|
return a && (g.value = a, m.setSelectedNodeByItemId(a)), !0;
|
|
5848
5852
|
}
|
|
5849
|
-
return (a, I) => (
|
|
5853
|
+
return (a, I) => ($(), q(ml, null, {
|
|
5850
5854
|
"left-panel": B(() => [
|
|
5851
5855
|
C(Xl, {
|
|
5852
5856
|
menu: a.menu,
|
|
@@ -5857,7 +5861,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5857
5861
|
]),
|
|
5858
5862
|
"right-panel": B(() => [
|
|
5859
5863
|
A("div", Jl, [
|
|
5860
|
-
o(d) ? (
|
|
5864
|
+
o(d) ? ($(), q(nl, {
|
|
5861
5865
|
ref_key: "itemFormRef",
|
|
5862
5866
|
ref: s,
|
|
5863
5867
|
key: o(h),
|
|
@@ -5867,7 +5871,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5867
5871
|
"category-id": null,
|
|
5868
5872
|
focused: b.value,
|
|
5869
5873
|
"onUpdate:editingState": o(w)
|
|
5870
|
-
}, null, 8, ["initial-form", "menu", "merged-menu", "focused", "onUpdate:editingState"])) : (
|
|
5874
|
+
}, null, 8, ["initial-form", "menu", "merged-menu", "focused", "onUpdate:editingState"])) : ($(), J("div", Ql, [
|
|
5871
5875
|
A("div", Zl, ge(o(r)("menu.tree_editor.labels.please_select_a_product_to_edit")), 1)
|
|
5872
5876
|
]))
|
|
5873
5877
|
])
|
|
@@ -5916,11 +5920,11 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5916
5920
|
}
|
|
5917
5921
|
);
|
|
5918
5922
|
return (a, I) => {
|
|
5919
|
-
const S = W("fm-button"),
|
|
5920
|
-
return
|
|
5923
|
+
const S = W("fm-button"), O = W("fm-form");
|
|
5924
|
+
return $(), q(Un, { to: "body" }, [
|
|
5921
5925
|
C(Rn, { name: "fade" }, {
|
|
5922
5926
|
default: B(() => [
|
|
5923
|
-
C(
|
|
5927
|
+
C(O, {
|
|
5924
5928
|
"blame-form-child-on-validation-failed": "",
|
|
5925
5929
|
class: fe(["fixed inset-0", "flex flex-col", "w-screen h-dvh", "bg-fm-color-neutral-white"]),
|
|
5926
5930
|
style: ct({ zIndex: a.zIndex }),
|
|
@@ -5969,7 +5973,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5969
5973
|
]);
|
|
5970
5974
|
};
|
|
5971
5975
|
}
|
|
5972
|
-
}), li = /* @__PURE__ */ Ze(ai, [["__scopeId", "data-v-6c3052b3"]]),
|
|
5976
|
+
}), li = /* @__PURE__ */ Ze(ai, [["__scopeId", "data-v-6c3052b3"]]), Mi = /* @__PURE__ */ ae({
|
|
5973
5977
|
__name: "TreeEditorOpenner",
|
|
5974
5978
|
setup(n) {
|
|
5975
5979
|
const r = ln(), e = an();
|
|
@@ -5993,6 +5997,6 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5993
5997
|
}
|
|
5994
5998
|
});
|
|
5995
5999
|
export {
|
|
5996
|
-
|
|
6000
|
+
Mi as _,
|
|
5997
6001
|
jo as u
|
|
5998
6002
|
};
|