@feedmepos/mf-menu 0.32.11-dev → 0.32.12-dev
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-BMQJXzfs.js → App-D0JZMDPU.js} +14 -10
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BwPzEkZi.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C5fI7pDt.js} +3 -3
- package/dist/{Catalog-DD9pz5om.js → Catalog-BIVVmu4F.js} +6 -6
- package/dist/{Category-Dbxxz-jo.js → Category-Cmf6dD5G.js} +6 -6
- package/dist/{Category-B_PZ_G_u.js → Category-DoEzIDPA.js} +4 -4
- package/dist/{CookingGuide-DHnJp0ti.js → CookingGuide-DxQ5vDF5.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DwLbvoN2.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BQscJC6_.js} +1 -1
- package/dist/{Group-D5DNbNUE.js → Group-EAACXFDr.js} +1 -1
- package/dist/{Group-TogIQUnh.js → Group-l59a7MQy.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BtiHaKaM.js → Group.vue_vue_type_script_setup_true_lang-CdIKM2jO.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DRYeG7wX.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CendqbFI.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CX-Q1qT4.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-B3I3jPxC.js} +3891 -3871
- package/dist/{Ingredient-B_Cu5XUX.js → Ingredient-B7kPk3oV.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-JMpeJ55c.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CzpY9mWg.js} +2 -2
- package/dist/{LinkProductSideSheet-qp0TBdii.js → LinkProductSideSheet-CeXhbGnn.js} +208 -213
- package/dist/{MenuSetting-CuMpJ9E0.js → MenuSetting-CCtL2qui.js} +5 -5
- package/dist/{PrintRoute-DQVaF9Jy.js → PrintRoute-DMLRAZJg.js} +4 -4
- package/dist/{Product-DZkUA6iZ.js → Product-BAcGhIEf.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-BJfoQDpz.js → Product.vue_vue_type_script_setup_true_lang-V8-_F7WQ.js} +14 -14
- package/dist/{ProductInternalTools-KzWVZEWb.js → ProductInternalTools-BrQwrwyG.js} +28 -29
- package/dist/{Products-Bo7V88vF.js → Products-O5YVYdlT.js} +11 -11
- package/dist/Publish-CtKo19_y.js +1262 -0
- package/dist/{Recipe-DDIYbpDs.js → Recipe-ORx3rnvx.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CEtK-cui.js → RuleView.vue_vue_type_script_setup_true_lang-biTDrokQ.js} +2 -2
- package/dist/{Scheduler-CnRzjrae.js → Scheduler-B7v3W8eG.js} +3 -3
- package/dist/{ServingSequence-BI-_zfXH.js → ServingSequence-DczYH8BU.js} +3 -3
- package/dist/{Setting-CObzXORw.js → Setting-fNLED9R0.js} +5 -5
- package/dist/{Subcategory-SwoAI9Ll.js → Subcategory-DjK1PTao.js} +4 -4
- package/dist/{Takeaway-CoRzd77l.js → Takeaway-ChMYycO_.js} +1 -1
- package/dist/{Takeaway-DtwZd8AR.js → Takeaway-LjEJbd4e.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-Dug9sZJl.js → Takeaway.vue_vue_type_script_setup_true_lang-CMdZM60P.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-1lzIehRE.js → Thumbnail.vue_vue_type_script_setup_true_lang-Yh_aUxqS.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-NjBNW9ch.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CEmOkHc5.js} +21 -20
- package/dist/{Unit-BkIkJdrO.js → Unit-DGZ9xVpM.js} +2 -2
- package/dist/{Variant-DNqk4G2y.js → Variant-CUasE1B5.js} +3 -3
- package/dist/{_id_-uch349de.js → _id_-CXV1a1UW.js} +10 -10
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/{app-C5IMDITK.js → app--9ZjQ_dH.js} +35 -35
- package/dist/{app-0e_XOvyp.js → app-E7mszfIB.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/menu.d.ts +9 -3
- package/dist/apps/mf-menu/src/app.d.ts +47 -0
- package/dist/apps/mf-menu/src/components/ProgressBar.vue.d.ts +17 -0
- package/dist/apps/mf-menu/src/components/calender/DateTimePicker.vue.d.ts +73 -0
- package/dist/apps/mf-menu/src/components/calender/FmCalendar.vue.d.ts +80 -0
- package/dist/apps/mf-menu/src/components/calender/FmDateRangeYearMonthPicker.vue.d.ts +22 -0
- package/dist/apps/mf-menu/src/components/calender/FmTimeInput.vue.d.ts +26 -0
- package/dist/apps/mf-menu/src/components/calender/TimeInput.vue.d.ts +32 -0
- package/dist/apps/mf-menu/src/components/feature/Fields/ImageDropField.vue.d.ts +3 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/FmTreeNode.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ItemForm.vue.d.ts +5 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductDetail.vue.d.ts +5 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductPrice.vue.d.ts +5 -1
- package/dist/apps/mf-menu/src/stores/menu.d.ts +9 -2
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductDetail.vue.d.ts +9 -1
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductPrice.vue.d.ts +5 -1
- package/dist/apps/mf-menu/src/views/Publish/PublishProgressView.vue.d.ts +198 -0
- package/dist/apps/mf-menu/src/views/Publish/PublishRestaurantSelector.vue.d.ts +17 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-BLErS-90.js → linked-status-Doclb1U6.js} +2 -2
- package/dist/assets/{override-menu-Bns6Vkk-.js → override-menu-BWkFILg4.js} +2 -2
- package/dist/assets/{validate-menu-v_LSEIFo.js → validate-menu-BS4T4zZm.js} +2 -2
- package/dist/{catalog-BuRtQI40.js → catalog-PkvD9BV_.js} +1 -1
- package/dist/{catalogSetting-B6GcQUXu.js → catalogSetting-Cd9aIJs2.js} +1 -1
- package/dist/{category-CztP5_ri.js → category-1NLh1OVo.js} +1 -1
- package/dist/{currency-qSlZ481F.js → currency-J1RZcMOx.js} +1 -1
- package/dist/dayjs.min-CXjOYO85.js +6 -0
- package/dist/{index-BbIeWj3n.js → index-BPpNi-Hh.js} +3 -3
- package/dist/{index-DMdZCp2g.js → index-BiCSP8Fy.js} +1 -1
- package/dist/{index-9XceRQZF.js → index-CisutoS9.js} +1 -1
- package/dist/{index-CJg7adB_.js → index-D9h3wl03.js} +4 -4
- package/dist/{index.vue_vue_type_script_setup_true_lang-CgDE93jl.js → index.vue_vue_type_script_setup_true_lang-B3Eku0Ig.js} +4479 -4432
- package/dist/{item-ByIhAQnU.js → item-Ctnd-m_D.js} +956 -925
- package/dist/{jszip.min-C4evSkfb.js → jszip.min-Bwz_vC7R.js} +353 -353
- package/dist/{menu-VanBYNI5.js → menu-DpTANxng.js} +1 -1
- package/dist/{menuV2-Pl32HC6Y.js → menuV2-BBMwj4p0.js} +61 -61
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-COST6Ohr.js → priceTier-DAG2W_y3.js} +1 -1
- package/dist/{scheduler-DIFsyx8F.js → scheduler-DYuLkKsc.js} +4 -4
- package/dist/{subcategory-D_YPCzZt.js → subcategory-BJ0oG92x.js} +2 -2
- package/dist/{toExcel-BTHGNmrM.js → toExcel-C5_3G21q.js} +2 -2
- package/dist/tooltip-B5BiPMx9.js +32 -0
- package/dist/{unit-scfKpGAE.js → unit-CNwmGzjU.js} +2 -2
- package/package.json +2 -3
- package/dist/Publish-B1cSJdud.js +0 -586
- package/dist/iteration-Brm6sHmJ.js +0 -27
- package/dist/tooltip-CQW9YRO5.js +0 -60
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { defineStore as Mi } from "pinia";
|
|
2
|
-
import { defineComponent as me, resolveComponent as N, createElementBlock as te, createBlock as j, openBlock as F, createElementVNode as V, createVNode as b, toDisplayString as de, Fragment as Ae, renderList as Ue, h as Se, ref as ee, computed as O, watch as
|
|
3
|
-
import { K as Ce, A as G, ak as
|
|
2
|
+
import { defineComponent as me, resolveComponent as N, createElementBlock as te, createBlock as j, openBlock as F, createElementVNode as V, createVNode as b, toDisplayString as de, Fragment as Ae, renderList as Ue, h as Se, ref as ee, computed as O, watch as Re, unref as h, renderSlot as ve, withCtx as P, createCommentVNode as ie, Transition as gn, normalizeClass as Fe, resolveDynamicComponent as wt, withDirectives as lt, vShow as St, mergeProps as Fi, withModifiers as Ct, createTextVNode as Pt, onMounted as ut, resolveDirective as Oi, getCurrentInstance as Ii, markRaw as bn, render as Vt, mergeModels as yn, useModel as _n, nextTick as zi, normalizeProps as wn, guardReactiveProps as Sn, normalizeStyle as Cn } from "vue";
|
|
3
|
+
import { K as Ce, A as G, ak as kn, am as Rn, Y as xn, I as ue, D as ze, B as ke, U as Ei, u as be, J as Ve, G as Xe, P as qe, Q as An, R as Mn, T as Fn, V as Ft, ae as On, N as In, M as pi } from "./index.vue_vue_type_script_setup_true_lang-B3Eku0Ig.js";
|
|
4
4
|
import { useI18n as he, useCoreStore as mt, CustomAttributesForm as Ti } from "@feedmepos/mf-common";
|
|
5
|
-
import { useDialog as Ne, useSnackbar as Ee, components as
|
|
6
|
-
import { C as je } from "./catalog-
|
|
7
|
-
import { c as
|
|
8
|
-
import { a as hi,
|
|
9
|
-
import { H as
|
|
10
|
-
import { e as
|
|
11
|
-
import { s as Ut, F as
|
|
12
|
-
import { a as
|
|
13
|
-
import {
|
|
5
|
+
import { useDialog as Ne, useSnackbar as Ee, components as xe, FmButtonColorThemeVariant as Ke, FmButtonVariant as Ze, useBreakpoints as Di, useDialogChild as Pi } from "@feedmepos/ui-library";
|
|
6
|
+
import { C as je } from "./catalog-PkvD9BV_.js";
|
|
7
|
+
import { c as zn } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
8
|
+
import { a as hi, _ as Vi } from "./tooltip-B5BiPMx9.js";
|
|
9
|
+
import { H as En, L as Tn } from "./LinkProductSideSheet-CeXhbGnn.js";
|
|
10
|
+
import { e as Dn, _ as Be, a as Pn } from "./RuleView.vue_vue_type_script_setup_true_lang-biTDrokQ.js";
|
|
11
|
+
import { s as Ut, F as Vn, _ as Un } from "./index-CisutoS9.js";
|
|
12
|
+
import { a as $n } from "./app--9ZjQ_dH.js";
|
|
13
|
+
import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
+
import { g as Ui, b as Nn, c as Bn, a as Ln, m as Gn } from "./menuV2-BBMwj4p0.js";
|
|
14
15
|
import { useRemyStore as Yt, RemyButton as $i } from "@feedmepos/mf-remy-panel";
|
|
15
16
|
import { _ as Ye } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
17
|
+
import { u as Kn } from "./subcategory-BJ0oG92x.js";
|
|
18
|
+
import { u as jn } from "./category-1NLh1OVo.js";
|
|
18
19
|
import { u as Ht } from "./discardConfirm-BHni0LNu.js";
|
|
19
|
-
import { _ as et, l as $t, T as
|
|
20
|
-
import { useInventoryStore as Ni, InventoryBindingForm as
|
|
20
|
+
import { _ as et, l as $t, T as Wn } from "./index-D9h3wl03.js";
|
|
21
|
+
import { useInventoryStore as Ni, InventoryBindingForm as Yn, InventoryBindingSummary as Hn } from "@feedmepos/mf-inventory-portal";
|
|
21
22
|
import { c as pt } from "./check-C9mY6LiX.js";
|
|
22
|
-
import { c as
|
|
23
|
-
import { f as ot } from "./currency-
|
|
24
|
-
import { u as Bi } from "./priceTier-
|
|
25
|
-
import { u as
|
|
26
|
-
import { c as
|
|
23
|
+
import { c as Xn } from "./object-DVUNCr7w.js";
|
|
24
|
+
import { f as ot } from "./currency-J1RZcMOx.js";
|
|
25
|
+
import { u as Bi } from "./priceTier-DAG2W_y3.js";
|
|
26
|
+
import { u as qn } from "./search-BAPEUu1R.js";
|
|
27
|
+
import { c as Zn } from "./string-DpfFixWH.js";
|
|
27
28
|
import { d as Li } from "./vuedraggable-CK8z7qA8.js";
|
|
28
|
-
import { _ as
|
|
29
|
-
import { V as fi } from "./index-
|
|
29
|
+
import { _ as Qn } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-C5fI7pDt.js";
|
|
30
|
+
import { V as fi } from "./index-BPpNi-Hh.js";
|
|
30
31
|
class yt {
|
|
31
32
|
constructor(i, t, n, a) {
|
|
32
33
|
this.scheduler = i, this.menuStore = t, this.updateMenu = n, this.dialog = a;
|
|
@@ -211,7 +212,7 @@ class yt {
|
|
|
211
212
|
const a = i.reduce((r, l) => {
|
|
212
213
|
const s = t.items.filter((u) => u._id == l) ?? [];
|
|
213
214
|
return r = r.concat(
|
|
214
|
-
|
|
215
|
+
kn(l, s, (u) => ({
|
|
215
216
|
...u,
|
|
216
217
|
orderFrom: null
|
|
217
218
|
}))
|
|
@@ -224,10 +225,10 @@ class yt {
|
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
getAvailableItemForLink() {
|
|
227
|
-
const i =
|
|
228
|
+
const i = Rn(
|
|
228
229
|
this.menuStore.variants,
|
|
229
230
|
this.menuStore.categories,
|
|
230
|
-
|
|
231
|
+
xn(this.menuStore.state.menu.modules.item, (a) => a.code || a.name)
|
|
231
232
|
), t = new Set(
|
|
232
233
|
this.menuStore.currentCatalog ? je.getItemAvailable(this.menuStore.currentCatalog) : this.menuStore.state.menu.modules.item.map((a) => a._id)
|
|
233
234
|
);
|
|
@@ -237,7 +238,7 @@ class yt {
|
|
|
237
238
|
})).filter((a) => a.items.length > 0);
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
+
function kt(e, i) {
|
|
241
242
|
for (const t of i) {
|
|
242
243
|
const n = e.find((a) => a._id === t._id);
|
|
243
244
|
if (n != null && n.isDynamicAddon || t.isDynamicAddon) return G.F_ADDON_GROUP_TYPE.enum.DYNAMIC;
|
|
@@ -245,14 +246,14 @@ function Rt(e, i) {
|
|
|
245
246
|
}
|
|
246
247
|
return G.F_ADDON_GROUP_TYPE.enum.NORMAL;
|
|
247
248
|
}
|
|
248
|
-
function
|
|
249
|
+
function Jn(e) {
|
|
249
250
|
return [...new Set(e.map((t) => t._id))].reduce((t, n) => {
|
|
250
251
|
const a = e.filter((l) => l._id === n), { base: o, variants: r } = a.reduce(
|
|
251
252
|
(l, s) => {
|
|
252
253
|
if (!s.combinationKey)
|
|
253
254
|
l.base = s;
|
|
254
255
|
else {
|
|
255
|
-
const u = l.variants.findIndex((
|
|
256
|
+
const u = l.variants.findIndex((d) => d.combinationKey == s.combinationKey);
|
|
256
257
|
u < 0 ? l.variants.push(s) : l.variants[u] = s;
|
|
257
258
|
}
|
|
258
259
|
return l;
|
|
@@ -299,11 +300,11 @@ function Xt(e) {
|
|
|
299
300
|
}
|
|
300
301
|
function Gi(e) {
|
|
301
302
|
const i = Xt(e), t = (o) => ["product", "item", "addonGroup", "group"].some((r) => o._id.startsWith(r)), n = i.items.filter((o) => t(o)), a = i.items.filter((o) => !t(o)).map((o) => ({
|
|
302
|
-
...
|
|
303
|
+
...ze.generator.initMenuV4Item(),
|
|
303
304
|
...o,
|
|
304
305
|
code: o.code ?? "",
|
|
305
306
|
name: o.name ?? "",
|
|
306
|
-
price: o.price ??
|
|
307
|
+
price: o.price ?? ke.Dinero.zero().toObject(),
|
|
307
308
|
orderFrom: G.F_ORDER_FROM.enum.ALL,
|
|
308
309
|
groups: [],
|
|
309
310
|
isDynamicAddon: e.type === G.F_ADDON_GROUP_TYPE.enum.DYNAMIC
|
|
@@ -339,12 +340,12 @@ class Ki {
|
|
|
339
340
|
modules: {
|
|
340
341
|
...r.modules,
|
|
341
342
|
group: r == null ? void 0 : r.modules.group.reduce((s, u) => {
|
|
342
|
-
const
|
|
343
|
-
if (!
|
|
343
|
+
const d = i.find((m) => m._id === u._id);
|
|
344
|
+
if (!d)
|
|
344
345
|
return s = [...s, u], s;
|
|
345
|
-
const c =
|
|
346
|
-
(
|
|
347
|
-
(p) => p._id ===
|
|
346
|
+
const c = d.items.filter(
|
|
347
|
+
(m) => !u.items.find(
|
|
348
|
+
(p) => p._id === m._id && p.combinationKey === m.combinationKey
|
|
348
349
|
)
|
|
349
350
|
);
|
|
350
351
|
return s = [
|
|
@@ -364,7 +365,7 @@ class Ki {
|
|
|
364
365
|
})) && !u._id && r.modules.group.push(u);
|
|
365
366
|
}
|
|
366
367
|
}
|
|
367
|
-
return r ?
|
|
368
|
+
return r ? ze.getFallbackPrices({
|
|
368
369
|
catalogId: t == null ? void 0 : t._id,
|
|
369
370
|
schedulerId: n == null ? void 0 : n._id,
|
|
370
371
|
rawMenu: r,
|
|
@@ -380,35 +381,35 @@ class Ki {
|
|
|
380
381
|
}
|
|
381
382
|
const a = this.menuStore.state.menu.modules.item, o = this.menuStore.state.menu.modules.group, r = this.menuStore.items;
|
|
382
383
|
function l(s, u) {
|
|
383
|
-
const
|
|
384
|
+
const d = s.items.reduce((m, p) => {
|
|
384
385
|
var U, L, M, T;
|
|
385
|
-
const v = a.find((
|
|
386
|
-
if (!v && t) return
|
|
386
|
+
const v = a.find((z) => p._id === z._id);
|
|
387
|
+
if (!v && t) return m;
|
|
387
388
|
const y = p.combinationKey ? {
|
|
388
389
|
...(U = v == null ? void 0 : v.variant) == null ? void 0 : U.variantCombinations.find(
|
|
389
|
-
(
|
|
390
|
+
(z) => z.combinationKey === p.combinationKey
|
|
390
391
|
),
|
|
391
392
|
name: Ei(be().variants, ((L = v == null ? void 0 : v.variant) == null ? void 0 : L.variantGroupIds) || [])[p.combinationKey]
|
|
392
|
-
} : v, _ = (M = o.find((
|
|
393
|
-
(
|
|
394
|
-
)) == null ? void 0 : T.price,
|
|
393
|
+
} : v, _ = (M = o.find((z) => z._id === s._id)) == null ? void 0 : M.items.find((z) => z._id === p._id && z.combinationKey === p.combinationKey), S = !t && !p.combinationKey, f = (T = u.find(
|
|
394
|
+
(z) => z._id == p._id && z.combinationKey == p.combinationKey
|
|
395
|
+
)) == null ? void 0 : T.price, x = p.name ?? (_ == null ? void 0 : _.name) ?? (y == null ? void 0 : y.name) ?? "", K = {
|
|
395
396
|
...p,
|
|
396
|
-
name:
|
|
397
|
+
name: x,
|
|
397
398
|
code: y == null ? void 0 : y.code,
|
|
398
|
-
fallbackName: S ? null :
|
|
399
|
+
fallbackName: S ? null : x,
|
|
399
400
|
price: p.price,
|
|
400
401
|
fallbackPrice: S ? null : f,
|
|
401
402
|
orderFrom: p.orderFrom,
|
|
402
403
|
fallbackOrder: y == null ? void 0 : y.orderFrom,
|
|
403
404
|
priceTiers: p.priceTiers
|
|
404
405
|
};
|
|
405
|
-
return [...
|
|
406
|
-
}, []), c =
|
|
406
|
+
return [...m, K];
|
|
407
|
+
}, []), c = kt(a, s.items);
|
|
407
408
|
return {
|
|
408
409
|
...s,
|
|
409
410
|
type: c,
|
|
410
|
-
items:
|
|
411
|
-
itemsLinked: r.filter((
|
|
411
|
+
items: Jn(d),
|
|
412
|
+
itemsLinked: r.filter((m) => m.groups.some(({ _id: p }) => p === s._id)).map((m) => m._id)
|
|
412
413
|
};
|
|
413
414
|
}
|
|
414
415
|
return i.map((s) => {
|
|
@@ -458,13 +459,13 @@ class Ki {
|
|
|
458
459
|
}
|
|
459
460
|
async applyItems(i, t) {
|
|
460
461
|
function n(s, u) {
|
|
461
|
-
const
|
|
462
|
-
return u ? c : [...c, ...
|
|
462
|
+
const d = s.filter((m) => m._id === i._id), c = s.filter((m) => m._id !== i._id);
|
|
463
|
+
return u ? c : [...c, ...d.length ? d : [{ _id: i._id, groupKey: "" }]];
|
|
463
464
|
}
|
|
464
|
-
function a(s, u,
|
|
465
|
+
function a(s, u, d) {
|
|
465
466
|
var p;
|
|
466
|
-
const c = n(u.groups,
|
|
467
|
-
const y = n(v.groups ?? [],
|
|
467
|
+
const c = n(u.groups, d), m = (((p = u.variant) == null ? void 0 : p.variantCombinations) ?? []).map((v) => {
|
|
468
|
+
const y = n(v.groups ?? [], d);
|
|
468
469
|
return { ...v, groups: y };
|
|
469
470
|
});
|
|
470
471
|
return fn(s, {
|
|
@@ -472,13 +473,13 @@ class Ki {
|
|
|
472
473
|
groups: c,
|
|
473
474
|
variant: u.variant ? {
|
|
474
475
|
variantGroupIds: u.variant.variantGroupIds,
|
|
475
|
-
variantCombinations:
|
|
476
|
+
variantCombinations: m
|
|
476
477
|
} : null
|
|
477
478
|
});
|
|
478
479
|
}
|
|
479
480
|
const o = i.itemsLinked, l = [.../* @__PURE__ */ new Set([...t, ...o])].map((s) => {
|
|
480
481
|
const u = this.menuStore.state.menu.modules.item.find(
|
|
481
|
-
(
|
|
482
|
+
(d) => d._id === s
|
|
482
483
|
);
|
|
483
484
|
return {
|
|
484
485
|
module: G.F_MENU_MODULE_V4_KEY.enum.item,
|
|
@@ -499,19 +500,19 @@ function ji(e) {
|
|
|
499
500
|
const i = [];
|
|
500
501
|
return e.link() || (i.push("name"), i.push("min"), i.push("max"), i.push("stackable")), e.type || i.push("type"), i;
|
|
501
502
|
}
|
|
502
|
-
function
|
|
503
|
+
function eo(e, i) {
|
|
503
504
|
if (!e)
|
|
504
505
|
return [];
|
|
505
506
|
const t = ["code"];
|
|
506
507
|
return e.priceEdit || t.push("price"), e.isDefault(i) || t.push("isDefault"), e.name(i) || t.push("name"), t;
|
|
507
508
|
}
|
|
508
|
-
function
|
|
509
|
+
function to(e, i) {
|
|
509
510
|
const t = ue(e);
|
|
510
511
|
return ji(i).forEach((o) => {
|
|
511
512
|
delete t[o];
|
|
512
513
|
}), (t.items ?? []).forEach((o) => {
|
|
513
514
|
const r = o.combinationKey ?? null;
|
|
514
|
-
|
|
515
|
+
eo(
|
|
515
516
|
i,
|
|
516
517
|
r
|
|
517
518
|
).forEach((s) => {
|
|
@@ -519,10 +520,10 @@ function io(e, i) {
|
|
|
519
520
|
});
|
|
520
521
|
}), t;
|
|
521
522
|
}
|
|
522
|
-
const
|
|
523
|
+
const io = {
|
|
523
524
|
key: 0,
|
|
524
525
|
class: "ml-40 w-[320px] fm-corner-radius-lg p-16 border border-fm-color-neutral-gray-200 space-y-4"
|
|
525
|
-
},
|
|
526
|
+
}, no = { class: "fm-typo-en-title-sm-600" }, vi = /* @__PURE__ */ me({
|
|
526
527
|
__name: "Summary",
|
|
527
528
|
props: {
|
|
528
529
|
title: {},
|
|
@@ -546,9 +547,9 @@ const no = {
|
|
|
546
547
|
}
|
|
547
548
|
return (a, o) => {
|
|
548
549
|
const r = N("FmButton");
|
|
549
|
-
return i.variant === "full" ? (F(), te("div",
|
|
550
|
-
V("div",
|
|
551
|
-
b(
|
|
550
|
+
return i.variant === "full" ? (F(), te("div", io, [
|
|
551
|
+
V("div", no, de(a.title), 1),
|
|
552
|
+
b(En),
|
|
552
553
|
(F(!0), te(Ae, null, Ue(a.items, (l) => (F(), j(hi, {
|
|
553
554
|
key: l.name,
|
|
554
555
|
name: l.name,
|
|
@@ -562,7 +563,7 @@ const no = {
|
|
|
562
563
|
}));
|
|
563
564
|
};
|
|
564
565
|
}
|
|
565
|
-
}),
|
|
566
|
+
}), oo = { class: "space-y-24 p-16 border-fm-color-neutral-gray-200 fm-corner-radius-lg border" }, ao = { class: "space-y-4" }, ro = { class: "fm-typo-en-title-sm-600" }, so = { class: "text-fm-color-typo-secondary" }, lo = { class: "flex gap-16" }, uo = { class: "flex-1" }, co = { class: "flex-1" }, mo = /* @__PURE__ */ me({
|
|
566
567
|
__name: "CatalogSchedulerSelector",
|
|
567
568
|
props: {
|
|
568
569
|
linkedStatus: {}
|
|
@@ -570,7 +571,7 @@ const no = {
|
|
|
570
571
|
emits: ["update:catalogAndScheduler"],
|
|
571
572
|
setup(e, { emit: i }) {
|
|
572
573
|
const t = e, n = i, { t: a } = he(), o = be(), r = ee(o.state.currentCatalogId || null), l = O(() => {
|
|
573
|
-
const
|
|
574
|
+
const m = Object.keys(t.linkedStatus.catalogs).map((p) => {
|
|
574
575
|
var v;
|
|
575
576
|
return {
|
|
576
577
|
label: ((v = o.state.menu.modules.catalog.find((y) => y._id === p)) == null ? void 0 : v.name) || "Unknown",
|
|
@@ -582,9 +583,9 @@ const no = {
|
|
|
582
583
|
label: "Main",
|
|
583
584
|
value: null
|
|
584
585
|
},
|
|
585
|
-
...
|
|
586
|
+
...m
|
|
586
587
|
];
|
|
587
|
-
}), s = ee(o.state.currentSchedulerId || null), u = () => r.value ? t.linkedStatus.catalogs[r.value].schedulers : t.linkedStatus.schedulers,
|
|
588
|
+
}), s = ee(o.state.currentSchedulerId || null), u = () => r.value ? t.linkedStatus.catalogs[r.value].schedulers : t.linkedStatus.schedulers, d = O(() => {
|
|
588
589
|
const p = u().map((v) => {
|
|
589
590
|
var y;
|
|
590
591
|
return {
|
|
@@ -600,26 +601,26 @@ const no = {
|
|
|
600
601
|
...p
|
|
601
602
|
];
|
|
602
603
|
});
|
|
603
|
-
|
|
604
|
+
Re(r, (m) => {
|
|
604
605
|
[null, ...u()].includes(s.value) || (s.value = null);
|
|
605
606
|
});
|
|
606
607
|
const c = Ve.debounce(() => {
|
|
607
608
|
n("update:catalogAndScheduler", [r.value, s.value]);
|
|
608
609
|
}, 100);
|
|
609
|
-
return
|
|
610
|
+
return Re(
|
|
610
611
|
() => `${r.value}-${s.value}`,
|
|
611
612
|
() => {
|
|
612
613
|
c();
|
|
613
614
|
}
|
|
614
|
-
), (
|
|
615
|
+
), (m, p) => {
|
|
615
616
|
const v = N("FmSelect");
|
|
616
|
-
return F(), te("div",
|
|
617
|
-
V("div",
|
|
618
|
-
V("div",
|
|
619
|
-
V("div",
|
|
617
|
+
return F(), te("div", oo, [
|
|
618
|
+
V("div", ao, [
|
|
619
|
+
V("div", ro, de(h(a)("menu.catalog_scheduler.title")), 1),
|
|
620
|
+
V("div", so, de(h(a)("menu.catalog_scheduler.subtitle")), 1)
|
|
620
621
|
]),
|
|
621
|
-
V("div",
|
|
622
|
-
V("div",
|
|
622
|
+
V("div", lo, [
|
|
623
|
+
V("div", uo, [
|
|
623
624
|
b(v, {
|
|
624
625
|
label: h(a)("menu.common.labels.catalog"),
|
|
625
626
|
items: l.value,
|
|
@@ -627,10 +628,10 @@ const no = {
|
|
|
627
628
|
"onUpdate:modelValue": p[0] || (p[0] = (y) => r.value = y)
|
|
628
629
|
}, null, 8, ["label", "items", "modelValue"])
|
|
629
630
|
]),
|
|
630
|
-
V("div",
|
|
631
|
+
V("div", co, [
|
|
631
632
|
b(v, {
|
|
632
633
|
label: h(a)("menu.common.labels.scheduler"),
|
|
633
|
-
items:
|
|
634
|
+
items: d.value,
|
|
634
635
|
modelValue: s.value,
|
|
635
636
|
"onUpdate:modelValue": p[1] || (p[1] = (y) => s.value = y)
|
|
636
637
|
}, null, 8, ["label", "items", "modelValue"])
|
|
@@ -639,10 +640,10 @@ const no = {
|
|
|
639
640
|
]);
|
|
640
641
|
};
|
|
641
642
|
}
|
|
642
|
-
}),
|
|
643
|
+
}), po = { class: "flex items-center justify-between" }, ho = { class: "space-y-4 flex-1" }, fo = { class: "fm-typo-en-title-sm-600" }, vo = {
|
|
643
644
|
key: 0,
|
|
644
645
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
645
|
-
},
|
|
646
|
+
}, go = { key: 0 }, bo = /* @__PURE__ */ me({
|
|
646
647
|
__name: "ToggleCard",
|
|
647
648
|
props: {
|
|
648
649
|
title: {},
|
|
@@ -661,10 +662,10 @@ const no = {
|
|
|
661
662
|
variant: "outlined"
|
|
662
663
|
}, {
|
|
663
664
|
default: P(() => [
|
|
664
|
-
V("div",
|
|
665
|
-
V("div",
|
|
666
|
-
V("p",
|
|
667
|
-
n.description ? (F(), te("p",
|
|
665
|
+
V("div", po, [
|
|
666
|
+
V("div", ho, [
|
|
667
|
+
V("p", fo, de(n.title), 1),
|
|
668
|
+
n.description ? (F(), te("p", vo, de(n.description), 1)) : ie("", !0)
|
|
668
669
|
]),
|
|
669
670
|
b(o, {
|
|
670
671
|
"model-value": n.toggle,
|
|
@@ -673,7 +674,7 @@ const no = {
|
|
|
673
674
|
]),
|
|
674
675
|
b(gn, { name: "expand" }, {
|
|
675
676
|
default: P(() => [
|
|
676
|
-
n.toggle ? (F(), te("div",
|
|
677
|
+
n.toggle ? (F(), te("div", go, [
|
|
677
678
|
ve(n.$slots, "default", {}, void 0, !0)
|
|
678
679
|
])) : ie("", !0)
|
|
679
680
|
]),
|
|
@@ -684,13 +685,40 @@ const no = {
|
|
|
684
685
|
}));
|
|
685
686
|
};
|
|
686
687
|
}
|
|
687
|
-
}), Qe = /* @__PURE__ */ it(
|
|
688
|
+
}), Qe = /* @__PURE__ */ it(bo, [["__scopeId", "data-v-e920f110"]]), yo = Mi("menu-edit-state", {
|
|
688
689
|
state: () => ({
|
|
689
690
|
isUpdatingItem: !1,
|
|
690
691
|
storedCatalogId: null,
|
|
691
692
|
storedSchedulerId: null
|
|
692
693
|
})
|
|
693
694
|
});
|
|
695
|
+
async function _o(e) {
|
|
696
|
+
const {
|
|
697
|
+
items: i,
|
|
698
|
+
processor: t,
|
|
699
|
+
batchSize: n = 5,
|
|
700
|
+
batchDelay: a = 200,
|
|
701
|
+
onProgress: o,
|
|
702
|
+
progressMessage: r,
|
|
703
|
+
onBatchEnd: l
|
|
704
|
+
} = e, s = i.length, u = [];
|
|
705
|
+
for (let d = 0; d < i.length; d += n) {
|
|
706
|
+
const c = i.slice(d, d + n), m = d + 1, p = Math.min(d + n, i.length), v = `Processing items ${m}-${p}/${s}...`;
|
|
707
|
+
r && (r.value = v), o && o({
|
|
708
|
+
current: d,
|
|
709
|
+
total: s,
|
|
710
|
+
batchStart: m,
|
|
711
|
+
batchEnd: p,
|
|
712
|
+
message: v
|
|
713
|
+
});
|
|
714
|
+
const y = c.map(t), _ = await Promise.all(y);
|
|
715
|
+
u.push(..._), l && l({
|
|
716
|
+
batchIndex: Math.floor(d / n),
|
|
717
|
+
results: _
|
|
718
|
+
}), d + n < i.length && await new Promise((S) => setTimeout(S, a));
|
|
719
|
+
}
|
|
720
|
+
return u;
|
|
721
|
+
}
|
|
694
722
|
async function wo(e, i = {}) {
|
|
695
723
|
const { withTimestamp: t = !1, filename: n = "image.jpg" } = i;
|
|
696
724
|
try {
|
|
@@ -714,20 +742,20 @@ async function So(e, i = "image.jpg", t = "image/jpeg") {
|
|
|
714
742
|
});
|
|
715
743
|
return n ? new File([n.blob], i, { type: t }) : null;
|
|
716
744
|
}
|
|
717
|
-
async function
|
|
718
|
-
return
|
|
745
|
+
async function ml(e, i, t = {}) {
|
|
746
|
+
return _o({
|
|
719
747
|
items: e,
|
|
720
748
|
processor: (n) => i(n.url, n.filename),
|
|
721
749
|
...t
|
|
722
750
|
});
|
|
723
751
|
}
|
|
724
|
-
const Co = {},
|
|
725
|
-
function
|
|
726
|
-
return F(), te("div",
|
|
752
|
+
const Co = {}, ko = { class: "pl-32" };
|
|
753
|
+
function Ro(e, i) {
|
|
754
|
+
return F(), te("div", ko, [
|
|
727
755
|
ve(e.$slots, "default")
|
|
728
756
|
]);
|
|
729
757
|
}
|
|
730
|
-
const
|
|
758
|
+
const xo = /* @__PURE__ */ it(Co, [["render", Ro]]), Ao = { class: "flex flex-col gap-4" }, Mo = { class: "fm-select__menu__wrapper" }, Fo = {
|
|
731
759
|
key: 0,
|
|
732
760
|
class: "flex flex-col gap-4 justify-center"
|
|
733
761
|
}, Oo = /* @__PURE__ */ me({
|
|
@@ -773,22 +801,22 @@ const ko = /* @__PURE__ */ it(Co, [["render", xo]]), Ao = { class: "flex flex-co
|
|
|
773
801
|
}, u = () => {
|
|
774
802
|
var v;
|
|
775
803
|
(v = o.value) == null || v.toggleMenu(!1);
|
|
776
|
-
},
|
|
804
|
+
}, d = O(() => n.items.reduce(
|
|
777
805
|
(v, y) => (v[y.value] = y, v),
|
|
778
806
|
{}
|
|
779
807
|
)), c = ee(!1);
|
|
780
|
-
|
|
808
|
+
Re(
|
|
781
809
|
() => n.modelValue,
|
|
782
810
|
(v) => {
|
|
783
|
-
v != null && v.length ? r.value = v.map((y) =>
|
|
811
|
+
v != null && v.length ? r.value = v.map((y) => d.value[y]).filter((y) => !!y) : r.value = [];
|
|
784
812
|
},
|
|
785
813
|
{ immediate: !0 }
|
|
786
814
|
);
|
|
787
|
-
const
|
|
815
|
+
const m = O(() => n.shouldShowSelectedItemsWithinPlaceholder && r.value.length > 0), p = O(() => m.value ? r.value.map((v) => v.label).join(", ") : n.placeholder);
|
|
788
816
|
return i({
|
|
789
817
|
hideMenu: u
|
|
790
818
|
}), (v, y) => {
|
|
791
|
-
const _ = N("FmIcon"), S = N("FmField"), f = N("FmMenuItem"),
|
|
819
|
+
const _ = N("FmIcon"), S = N("FmField"), f = N("FmMenuItem"), x = N("FmMenu"), K = N("FmFormGroup"), U = N("FmChipGroup");
|
|
792
820
|
return F(), te("div", Ao, [
|
|
793
821
|
b(K, {
|
|
794
822
|
"model-value": v.modelValue,
|
|
@@ -799,7 +827,7 @@ const ko = /* @__PURE__ */ it(Co, [["render", xo]]), Ao = { class: "flex flex-co
|
|
|
799
827
|
rules: v.rules
|
|
800
828
|
}, {
|
|
801
829
|
default: P(({ invalid: L }) => [
|
|
802
|
-
b(
|
|
830
|
+
b(x, {
|
|
803
831
|
disabled: v.disabled,
|
|
804
832
|
ref_key: "fmMenuRef",
|
|
805
833
|
ref: o,
|
|
@@ -822,7 +850,7 @@ const ko = /* @__PURE__ */ it(Co, [["render", xo]]), Ao = { class: "flex flex-co
|
|
|
822
850
|
default: P(() => [
|
|
823
851
|
V("div", {
|
|
824
852
|
class: Fe([[
|
|
825
|
-
v.disabled ? "text-fm-color-typo-disabled" :
|
|
853
|
+
v.disabled ? "text-fm-color-typo-disabled" : m.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"
|
|
826
854
|
], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
|
|
827
855
|
}, de(p.value), 3)
|
|
828
856
|
]),
|
|
@@ -858,7 +886,7 @@ const ko = /* @__PURE__ */ it(Co, [["render", xo]]), Ao = { class: "flex flex-co
|
|
|
858
886
|
]);
|
|
859
887
|
};
|
|
860
888
|
}
|
|
861
|
-
}),
|
|
889
|
+
}), Io = /* @__PURE__ */ it(Oo, [["__scopeId", "data-v-89b5becb"]]);
|
|
862
890
|
function gi(e, i) {
|
|
863
891
|
var t = Object.keys(e);
|
|
864
892
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -883,13 +911,13 @@ function se(e) {
|
|
|
883
911
|
function Oe(e, i, t) {
|
|
884
912
|
return i in e ? Object.defineProperty(e, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[i] = t, e;
|
|
885
913
|
}
|
|
886
|
-
function
|
|
914
|
+
function zo(e, i) {
|
|
887
915
|
if (e == null) return {};
|
|
888
916
|
var t, n, a = function(r, l) {
|
|
889
917
|
if (r == null) return {};
|
|
890
|
-
var s, u,
|
|
891
|
-
for (u = 0; u < c.length; u++) s = c[u], l.indexOf(s) >= 0 || (
|
|
892
|
-
return
|
|
918
|
+
var s, u, d = {}, c = Object.keys(r);
|
|
919
|
+
for (u = 0; u < c.length; u++) s = c[u], l.indexOf(s) >= 0 || (d[s] = r[s]);
|
|
920
|
+
return d;
|
|
893
921
|
}(e, i);
|
|
894
922
|
if (Object.getOwnPropertySymbols) {
|
|
895
923
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -965,14 +993,14 @@ var bi, Eo, ht, ge = (bi = function(e) {
|
|
|
965
993
|
function Nt(e, i, t) {
|
|
966
994
|
var n, a, o, r, l;
|
|
967
995
|
function s() {
|
|
968
|
-
var
|
|
969
|
-
|
|
996
|
+
var d = Date.now() - r;
|
|
997
|
+
d < i && d >= 0 ? n = setTimeout(s, i - d) : (n = null, t || (l = e.apply(o, a), o = a = null));
|
|
970
998
|
}
|
|
971
999
|
i == null && (i = 100);
|
|
972
1000
|
var u = function() {
|
|
973
1001
|
o = this, a = arguments, r = Date.now();
|
|
974
|
-
var
|
|
975
|
-
return n || (n = setTimeout(s, i)),
|
|
1002
|
+
var d = t && !n;
|
|
1003
|
+
return n || (n = setTimeout(s, i)), d && (l = e.apply(o, a), o = a = null), l;
|
|
976
1004
|
};
|
|
977
1005
|
return u.clear = function() {
|
|
978
1006
|
n && (clearTimeout(n), n = null);
|
|
@@ -1115,13 +1143,13 @@ Zt.render = function(e, i, t, n, a, o) {
|
|
|
1115
1143
|
return o.onMouseLeave && o.onMouseLeave.apply(o, arguments);
|
|
1116
1144
|
}) }, [ve(e.$slots, "default")], 34);
|
|
1117
1145
|
};
|
|
1118
|
-
var
|
|
1146
|
+
var It = Te("vue-handler-wrapper"), qi = { name: "HandlerWrapper", components: { DraggableElement: Zt }, props: { horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, computed: { classes: function() {
|
|
1119
1147
|
var e;
|
|
1120
1148
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
1121
1149
|
var i, t = Wi(this.horizontalPosition, this.verticalPosition);
|
|
1122
|
-
e =
|
|
1123
|
-
} else e =
|
|
1124
|
-
return { root: e, draggable:
|
|
1150
|
+
e = It((Oe(i = {}, t.classname, !0), Oe(i, "disabled", this.disabled), i));
|
|
1151
|
+
} else e = It({ disabled: this.disabled });
|
|
1152
|
+
return { root: e, draggable: It("draggable") };
|
|
1125
1153
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1126
1154
|
qi.render = function(e, i, t, n, a, o) {
|
|
1127
1155
|
var r = N("DraggableElement");
|
|
@@ -1180,13 +1208,13 @@ function dt(e, i) {
|
|
|
1180
1208
|
function De(e, i) {
|
|
1181
1209
|
return { left: e.left - i.left, top: e.top - i.top, width: e.width + i.left + i.right, height: e.height + i.top + i.bottom };
|
|
1182
1210
|
}
|
|
1183
|
-
function
|
|
1211
|
+
function Rt(e) {
|
|
1184
1212
|
return { left: -e.left, top: -e.top };
|
|
1185
1213
|
}
|
|
1186
1214
|
function Me(e, i) {
|
|
1187
1215
|
return J(J({}, e), { left: e.left + i.left, top: e.top + i.top });
|
|
1188
1216
|
}
|
|
1189
|
-
function
|
|
1217
|
+
function Ie(e, i, t, n) {
|
|
1190
1218
|
if (i !== 1) {
|
|
1191
1219
|
if (t) {
|
|
1192
1220
|
var a = _e(e);
|
|
@@ -1206,7 +1234,7 @@ function st(e, i) {
|
|
|
1206
1234
|
var t = { left: 0, top: 0 }, n = dt(e, i);
|
|
1207
1235
|
return n.left && n.left > 0 ? t.left = n.left : n.right && n.right > 0 && (t.left = -n.right), n.top && n.top > 0 ? t.top = n.top : n.bottom && n.bottom > 0 && (t.top = -n.bottom), t;
|
|
1208
1236
|
}
|
|
1209
|
-
function
|
|
1237
|
+
function zt(e, i) {
|
|
1210
1238
|
var t;
|
|
1211
1239
|
return i.minimum && e < i.minimum ? t = i.minimum : i.maximum && e > i.maximum && (t = i.maximum), t;
|
|
1212
1240
|
}
|
|
@@ -1222,14 +1250,14 @@ function He(e, i) {
|
|
|
1222
1250
|
var t = i * Math.PI / 180;
|
|
1223
1251
|
return { left: e.left * Math.cos(t) - e.top * Math.sin(t), top: e.left * Math.sin(t) + e.top * Math.cos(t) };
|
|
1224
1252
|
}
|
|
1225
|
-
function
|
|
1253
|
+
function xt(e, i) {
|
|
1226
1254
|
var t = dt(we(e, i), i);
|
|
1227
1255
|
return t.left + t.right + t.top + t.bottom ? t.left + t.right > t.top + t.bottom ? Math.min((e.width + t.left + t.right) / e.width, rt(e, i)) : Math.min((e.height + t.top + t.bottom) / e.height, rt(e, i)) : 1;
|
|
1228
1256
|
}
|
|
1229
1257
|
function we(e, i, t) {
|
|
1230
1258
|
t === void 0 && (t = !1);
|
|
1231
1259
|
var n = st(e, i);
|
|
1232
|
-
return Me(e, t ?
|
|
1260
|
+
return Me(e, t ? Rt(n) : n);
|
|
1233
1261
|
}
|
|
1234
1262
|
function Gt(e) {
|
|
1235
1263
|
return { width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0, height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0 };
|
|
@@ -1252,14 +1280,14 @@ function Ci(e) {
|
|
|
1252
1280
|
var i = e.size, t = e.aspectRatio, n = e.ignoreMinimum, a = e.sizeRestrictions;
|
|
1253
1281
|
return !!((i.correctRatio || le(i) >= t.minimum && le(i) <= t.maximum) && i.height <= a.maxHeight && i.width <= a.maxWidth && i.width && i.height && (n || i.height >= a.minHeight && i.width >= a.minWidth));
|
|
1254
1282
|
}
|
|
1255
|
-
function
|
|
1283
|
+
function ki(e, i) {
|
|
1256
1284
|
return Math.pow(e.width - i.width, 2) + Math.pow(e.height - i.height, 2);
|
|
1257
1285
|
}
|
|
1258
1286
|
function We(e) {
|
|
1259
1287
|
var i = e.width, t = e.height, n = e.sizeRestrictions, a = { minimum: e.aspectRatio && e.aspectRatio.minimum || 0, maximum: e.aspectRatio && e.aspectRatio.maximum || 1 / 0 }, o = { width: Math.max(n.minWidth, Math.min(n.maxWidth, i)), height: Math.max(n.minHeight, Math.min(n.maxHeight, t)) };
|
|
1260
|
-
function r(u,
|
|
1261
|
-
return
|
|
1262
|
-
return Ci({ size:
|
|
1288
|
+
function r(u, d) {
|
|
1289
|
+
return d === void 0 && (d = !1), u.reduce(function(c, m) {
|
|
1290
|
+
return Ci({ size: m, aspectRatio: a, sizeRestrictions: n, ignoreMinimum: d }) && (!c || ki(m, { width: i, height: t }) < ki(c, { width: i, height: t })) ? m : c;
|
|
1263
1291
|
}, null);
|
|
1264
1292
|
}
|
|
1265
1293
|
var l = [];
|
|
@@ -1274,14 +1302,14 @@ function Kt(e) {
|
|
|
1274
1302
|
return Me(o, st(o, a));
|
|
1275
1303
|
}
|
|
1276
1304
|
function Lo(e) {
|
|
1277
|
-
var i = e.coordinates, t = e.transform, n = e.imageSize, a = e.sizeRestrictions, o = e.positionRestrictions, r = e.aspectRatio, l = e.visibleArea, s = function(
|
|
1278
|
-
return Kt({ coordinates:
|
|
1305
|
+
var i = e.coordinates, t = e.transform, n = e.imageSize, a = e.sizeRestrictions, o = e.positionRestrictions, r = e.aspectRatio, l = e.visibleArea, s = function(d, c) {
|
|
1306
|
+
return Kt({ coordinates: d, positionRestrictions: o, event: new qt({ left: c.left - d.left, top: c.top - d.top }) });
|
|
1279
1307
|
}, u = J({}, i);
|
|
1280
|
-
return (Array.isArray(t) ? t : [t]).forEach(function(
|
|
1308
|
+
return (Array.isArray(t) ? t : [t]).forEach(function(d) {
|
|
1281
1309
|
var c = {};
|
|
1282
|
-
ye((c = typeof
|
|
1283
|
-
var v = J(J(J({},
|
|
1284
|
-
return s(v, { left:
|
|
1310
|
+
ye((c = typeof d == "function" ? d({ coordinates: u, imageSize: n, visibleArea: l }) : d).width) && ye(c.height) || (u = function(m, p) {
|
|
1311
|
+
var v = J(J(J({}, m), We({ width: p.width, height: p.height, sizeRestrictions: a, aspectRatio: r })), { left: 0, top: 0 });
|
|
1312
|
+
return s(v, { left: m.left, top: m.top });
|
|
1285
1313
|
}(u, J(J({}, u), c))), ye(c.left) && ye(c.top) || (u = s(u, J(J({}, u), c)));
|
|
1286
1314
|
}), u;
|
|
1287
1315
|
}
|
|
@@ -1291,10 +1319,10 @@ function Go(e) {
|
|
|
1291
1319
|
e.aspectRatio;
|
|
1292
1320
|
var o = e.stencilSize, r = e.sizeRestrictions, l = e.positionRestrictions;
|
|
1293
1321
|
e.stencilReference;
|
|
1294
|
-
var s, u,
|
|
1295
|
-
s = le(p), u = le(c),
|
|
1296
|
-
var v =
|
|
1297
|
-
return v !== 1 && (
|
|
1322
|
+
var s, u, d, c = J({}, n), m = J({}, a), p = J({}, o);
|
|
1323
|
+
s = le(p), u = le(c), d === void 0 && (d = 1e-3), (s === 0 || u === 0 ? Math.abs(u - s) < d : Math.abs(u / s) < 1 + d && Math.abs(u / s) > 1 - d) || (c = J(J({}, c), We({ sizeRestrictions: r, width: c.width, height: c.height, aspectRatio: { minimum: le(p), maximum: le(p) } })));
|
|
1324
|
+
var v = xt(m = Ie(m, c.width * t.width / (m.width * p.width)), i({ visibleArea: m, type: "resize" }));
|
|
1325
|
+
return v !== 1 && (m = Ie(m, v), c = Ie(c, v)), m = we(m = Me(m, at(_e(c), _e(m))), i({ visibleArea: m, type: "move" })), { coordinates: c = we(c, At($e(m), l)), visibleArea: m };
|
|
1298
1326
|
}
|
|
1299
1327
|
function Ko(e) {
|
|
1300
1328
|
var i = e.event, t = e.getAreaRestrictions, n = e.boundaries, a = e.coordinates, o = e.visibleArea;
|
|
@@ -1305,8 +1333,8 @@ function Ko(e) {
|
|
|
1305
1333
|
if (a && o && i.type !== "manipulateImage") {
|
|
1306
1334
|
var u = { width: 0, height: 0 };
|
|
1307
1335
|
s.width, n.width, le(n) > le(l) ? (u.height = 0.8 * n.height, u.width = u.height * le(l)) : (u.width = 0.8 * n.width, u.height = u.width * le(l));
|
|
1308
|
-
var
|
|
1309
|
-
s =
|
|
1336
|
+
var d = xt(s = Ie(s, l.width * n.width / (s.width * u.width)), t({ visibleArea: s, type: "resize" }));
|
|
1337
|
+
s = Ie(s, d), d !== 1 && (u.height /= d, u.width /= d), s = we(s = Me(s, at(_e(l), _e(s))), t({ visibleArea: s, type: "move" })), l = we(l, At($e(s), r));
|
|
1310
1338
|
}
|
|
1311
1339
|
return { coordinates: l, visibleArea: s };
|
|
1312
1340
|
}
|
|
@@ -1314,7 +1342,7 @@ function jo(e) {
|
|
|
1314
1342
|
var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.getAreaRestrictions, o = J({}, n), r = J({}, t);
|
|
1315
1343
|
if (i.type === "setCoordinates") {
|
|
1316
1344
|
var l = Math.max(0, r.width - o.width), s = Math.max(0, r.height - o.height);
|
|
1317
|
-
l > s ? o =
|
|
1345
|
+
l > s ? o = Ie(o, Math.min(r.width / o.width, rt(o, a({ visibleArea: o, type: "resize" })))) : s > l && (o = Ie(o, Math.min(r.height / o.height, rt(o, a({ visibleArea: o, type: "resize" }))))), o = we(o = Me(o, Rt(st(r, $e(o)))), a({ visibleArea: o, type: "move" }));
|
|
1318
1346
|
}
|
|
1319
1347
|
return { visibleArea: o, coordinates: r };
|
|
1320
1348
|
}
|
|
@@ -1336,60 +1364,60 @@ function Xo(e) {
|
|
|
1336
1364
|
var o = { height: Math.max(t.height, n.height), width: Math.max(t.width, n.width) }, r = Qi({ width: le(o) > a ? o.width : o.height * a, height: le(o) > a ? o.width / a : o.height }, Gt(i())), l = { left: t.left + t.width / 2 - r.width / 2, top: t.top + t.height / 2 - r.height / 2, width: r.width, height: r.height }, s = dt(t, $e(J({ left: 0, top: 0 }, n))), u = {};
|
|
1337
1365
|
return !s.left && !s.right && l.width <= n.width && (u.left = 0, u.right = n.width), !s.top && !s.bottom && l.height <= n.height && (u.top = 0, u.bottom = n.height), we(l, u);
|
|
1338
1366
|
}
|
|
1339
|
-
var
|
|
1340
|
-
return r = { height:
|
|
1367
|
+
var d = le(n);
|
|
1368
|
+
return r = { height: d > a ? n.height : n.width / a, width: d > a ? n.height * a : n.width }, { left: n.width / 2 - r.width / 2, top: n.height / 2 - r.height / 2, width: r.width, height: r.height };
|
|
1341
1369
|
}
|
|
1342
1370
|
function vt(e, i) {
|
|
1343
1371
|
return en(e, $e(i));
|
|
1344
1372
|
}
|
|
1345
1373
|
function qo(e) {
|
|
1346
|
-
var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.sizeRestrictions, o = e.getAreaRestrictions, r = e.positionRestrictions, l = e.adjustStencil, s = i.scale, u = i.move,
|
|
1347
|
-
|
|
1348
|
-
var y = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / c.width : 0, a.minHeight ? a.minHeight / c.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / c.width : 1 / 0, a.maxHeight ? a.maxHeight / c.height : 1 / 0, rt(c, r)) }, area: { maximum: rt(
|
|
1349
|
-
s.factor && v && (s.factor < 1 ? (p = Math.max(s.factor, y.stencil.minimum)) > 1 && (p = 1) : s.factor > 1 && (p = Math.min(s.factor, Math.min(y.area.maximum, y.stencil.maximum))) < 1 && (p = 1)), p && (
|
|
1350
|
-
var _ = t.left - n.left, S = n.width + n.left - (t.width + t.left), f = t.top - n.top,
|
|
1351
|
-
return
|
|
1374
|
+
var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.sizeRestrictions, o = e.getAreaRestrictions, r = e.positionRestrictions, l = e.adjustStencil, s = i.scale, u = i.move, d = J({}, n), c = J({}, t), m = 1, p = 1, v = s.factor && Math.abs(s.factor - 1) > 1e-3;
|
|
1375
|
+
d = Me(d, { left: u.left || 0, top: u.top || 0 });
|
|
1376
|
+
var y = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / c.width : 0, a.minHeight ? a.minHeight / c.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / c.width : 1 / 0, a.maxHeight ? a.maxHeight / c.height : 1 / 0, rt(c, r)) }, area: { maximum: rt(d, o({ visibleArea: d, type: "resize" })) } };
|
|
1377
|
+
s.factor && v && (s.factor < 1 ? (p = Math.max(s.factor, y.stencil.minimum)) > 1 && (p = 1) : s.factor > 1 && (p = Math.min(s.factor, Math.min(y.area.maximum, y.stencil.maximum))) < 1 && (p = 1)), p && (d = Ie(d, p, s.center));
|
|
1378
|
+
var _ = t.left - n.left, S = n.width + n.left - (t.width + t.left), f = t.top - n.top, x = n.height + n.top - (t.height + t.top);
|
|
1379
|
+
return d = we(d = Me(d, st(d, { left: r.left !== void 0 ? r.left - _ * p : void 0, top: r.top !== void 0 ? r.top - f * p : void 0, bottom: r.bottom !== void 0 ? r.bottom + x * p : void 0, right: r.right !== void 0 ? r.right + S * p : void 0 })), o({ visibleArea: d, type: "move" })), c.width = c.width * p, c.height = c.height * p, c.left = d.left + _ * p, c.top = d.top + f * p, c = we(c, At($e(d), r)), s.factor && v && l && (s.factor > 1 ? m = Math.min(y.area.maximum, s.factor) / p : s.factor < 1 && (m = Math.max(c.height / d.height, c.width / d.width, s.factor / p)), m !== 1 && (d = Me(d = we(d = Ie(d, m, s.factor > 1 ? s.center : _e(c)), o({ visibleArea: d, type: "move" })), Rt(st(c, $e(d)))))), { coordinates: c, visibleArea: d };
|
|
1352
1380
|
}
|
|
1353
1381
|
function Zo(e) {
|
|
1354
|
-
var i = e.aspectRatio, t = e.getAreaRestrictions, n = e.coordinates, a = e.visibleArea, o = e.sizeRestrictions, r = e.positionRestrictions, l = e.imageSize, s = e.previousImageSize, u = e.angle,
|
|
1355
|
-
return (
|
|
1382
|
+
var i = e.aspectRatio, t = e.getAreaRestrictions, n = e.coordinates, a = e.visibleArea, o = e.sizeRestrictions, r = e.positionRestrictions, l = e.imageSize, s = e.previousImageSize, u = e.angle, d = J({}, n), c = J({}, a), m = He(_e(J({ left: 0, top: 0 }, s)), u);
|
|
1383
|
+
return (d = J(J({}, We({ sizeRestrictions: o, aspectRatio: i, width: d.width, height: d.height })), He(_e(d), u))).left -= m.left - l.width / 2 + d.width / 2, d.top -= m.top - l.height / 2 + d.height / 2, c = Ie(c, xt(c, t({ visibleArea: c, type: "resize" }))), { coordinates: d = we(d, r), visibleArea: c = we(c = Me(c, at(_e(d), _e(n))), t({ visibleArea: c, type: "move" })) };
|
|
1356
1384
|
}
|
|
1357
1385
|
function Qo(e) {
|
|
1358
|
-
var i = e.flip, t = e.previousFlip, n = e.rotate, a = e.getAreaRestrictions, o = e.coordinates, r = e.visibleArea, l = e.imageSize, s = J({}, o), u = J({}, r),
|
|
1359
|
-
if (
|
|
1360
|
-
var
|
|
1361
|
-
s = Me(s, at(v, _e(s))), p = He(_e(u), -n), u = we(u = Me(u, at(v = He({ left:
|
|
1386
|
+
var i = e.flip, t = e.previousFlip, n = e.rotate, a = e.getAreaRestrictions, o = e.coordinates, r = e.visibleArea, l = e.imageSize, s = J({}, o), u = J({}, r), d = t.horizontal !== i.horizontal, c = t.vertical !== i.vertical;
|
|
1387
|
+
if (d || c) {
|
|
1388
|
+
var m = He({ left: l.width / 2, top: l.height / 2 }, -n), p = He(_e(s), -n), v = He({ left: d ? m.left - (p.left - m.left) : p.left, top: c ? m.top - (p.top - m.top) : p.top }, n);
|
|
1389
|
+
s = Me(s, at(v, _e(s))), p = He(_e(u), -n), u = we(u = Me(u, at(v = He({ left: d ? m.left - (p.left - m.left) : p.left, top: c ? m.top - (p.top - m.top) : p.top }, n), _e(u))), a({ visibleArea: u, type: "move" }));
|
|
1362
1390
|
}
|
|
1363
1391
|
return { coordinates: s, visibleArea: u };
|
|
1364
1392
|
}
|
|
1365
|
-
function
|
|
1366
|
-
var i = e.directions, t = e.coordinates, n = e.positionRestrictions, a = n === void 0 ? {} : n, o = e.sizeRestrictions, r = e.preserveRatio, l = e.compensate, s = J({}, i), u = De(t, s).width,
|
|
1367
|
-
u < 0 && (s.left < 0 && s.right < 0 ? (s.left = -(t.width - o.minWidth) / (s.left / s.right), s.right = -(t.width - o.minWidth) / (s.right / s.left)) : s.left < 0 ? s.left = -(t.width - o.minWidth) : s.right < 0 && (s.right = -(t.width - o.minWidth))),
|
|
1393
|
+
function Ri(e) {
|
|
1394
|
+
var i = e.directions, t = e.coordinates, n = e.positionRestrictions, a = n === void 0 ? {} : n, o = e.sizeRestrictions, r = e.preserveRatio, l = e.compensate, s = J({}, i), u = De(t, s).width, d = De(t, s).height;
|
|
1395
|
+
u < 0 && (s.left < 0 && s.right < 0 ? (s.left = -(t.width - o.minWidth) / (s.left / s.right), s.right = -(t.width - o.minWidth) / (s.right / s.left)) : s.left < 0 ? s.left = -(t.width - o.minWidth) : s.right < 0 && (s.right = -(t.width - o.minWidth))), d < 0 && (s.top < 0 && s.bottom < 0 ? (s.top = -(t.height - o.minHeight) / (s.top / s.bottom), s.bottom = -(t.height - o.minHeight) / (s.bottom / s.top)) : s.top < 0 ? s.top = -(t.height - o.minHeight) : s.bottom < 0 && (s.bottom = -(t.height - o.minHeight)));
|
|
1368
1396
|
var c = dt(De(t, s), a);
|
|
1369
1397
|
l && (c.left && c.left > 0 && c.right === 0 ? (s.right += c.left, s.left -= c.left) : c.right && c.right > 0 && c.left === 0 && (s.left += c.right, s.right -= c.right), c.top && c.top > 0 && c.bottom === 0 ? (s.bottom += c.top, s.top -= c.top) : c.bottom && c.bottom > 0 && c.top === 0 && (s.top += c.bottom, s.bottom -= c.bottom), c = dt(De(t, s), a));
|
|
1370
|
-
var
|
|
1398
|
+
var m = { width: 1 / 0, height: 1 / 0, left: 1 / 0, right: 1 / 0, top: 1 / 0, bottom: 1 / 0 };
|
|
1371
1399
|
if (Pe.forEach(function(y) {
|
|
1372
1400
|
var _ = c[y];
|
|
1373
|
-
_ && s[y] && (
|
|
1401
|
+
_ && s[y] && (m[y] = Math.max(0, 1 - _ / s[y]));
|
|
1374
1402
|
}), r) {
|
|
1375
1403
|
var p = Math.min.apply(null, Pe.map(function(y) {
|
|
1376
|
-
return
|
|
1404
|
+
return m[y];
|
|
1377
1405
|
}));
|
|
1378
1406
|
p !== 1 / 0 && Pe.forEach(function(y) {
|
|
1379
1407
|
s[y] *= p;
|
|
1380
1408
|
});
|
|
1381
1409
|
} else Pe.forEach(function(y) {
|
|
1382
|
-
|
|
1410
|
+
m[y] !== 1 / 0 && (s[y] *= m[y]);
|
|
1383
1411
|
});
|
|
1384
|
-
if (u = De(t, s).width,
|
|
1385
|
-
var v = Math.min(
|
|
1412
|
+
if (u = De(t, s).width, d = De(t, s).height, s.right + s.left && (u > o.maxWidth ? m.width = (o.maxWidth - t.width) / (s.right + s.left) : u < o.minWidth && (m.width = (o.minWidth - t.width) / (s.right + s.left))), s.bottom + s.top && (d > o.maxHeight ? m.height = (o.maxHeight - t.height) / (s.bottom + s.top) : d < o.minHeight && (m.height = (o.minHeight - t.height) / (s.bottom + s.top))), r) {
|
|
1413
|
+
var v = Math.min(m.width, m.height);
|
|
1386
1414
|
v !== 1 / 0 && Pe.forEach(function(y) {
|
|
1387
1415
|
s[y] *= v;
|
|
1388
1416
|
});
|
|
1389
|
-
} else
|
|
1390
|
-
s[y] *=
|
|
1391
|
-
}),
|
|
1392
|
-
s[y] *=
|
|
1417
|
+
} else m.width !== 1 / 0 && Vo.forEach(function(y) {
|
|
1418
|
+
s[y] *= m.width;
|
|
1419
|
+
}), m.height !== 1 / 0 && Uo.forEach(function(y) {
|
|
1420
|
+
s[y] *= m.height;
|
|
1393
1421
|
});
|
|
1394
1422
|
return s;
|
|
1395
1423
|
}
|
|
@@ -1565,7 +1593,7 @@ function ra(e) {
|
|
|
1565
1593
|
try {
|
|
1566
1594
|
if (e) if (/^data:/i.test(e)) i(function(s) {
|
|
1567
1595
|
s = s.replace(/^data:([^;]+);base64,/gim, "");
|
|
1568
|
-
for (var u = atob(s),
|
|
1596
|
+
for (var u = atob(s), d = u.length, c = new ArrayBuffer(d), m = new Uint8Array(c), p = 0; p < d; p++) m[p] = u.charCodeAt(p);
|
|
1569
1597
|
return c;
|
|
1570
1598
|
}(e));
|
|
1571
1599
|
else if (/^blob:/i.test(e)) {
|
|
@@ -1613,13 +1641,13 @@ function sa(e) {
|
|
|
1613
1641
|
}(t, o + 4, 4) === "Exif")) {
|
|
1614
1642
|
var u = t.getUint16(n);
|
|
1615
1643
|
if (((a = u === 18761) || u === 19789) && t.getUint16(n + 2, a) === 42) {
|
|
1616
|
-
var
|
|
1617
|
-
|
|
1644
|
+
var d = t.getUint32(n + 4, a);
|
|
1645
|
+
d >= 8 && (r = n + d);
|
|
1618
1646
|
}
|
|
1619
1647
|
}
|
|
1620
1648
|
if (r) {
|
|
1621
|
-
for (var c = t.getUint16(r, a),
|
|
1622
|
-
if (s = r + 12 *
|
|
1649
|
+
for (var c = t.getUint16(r, a), m = 0; m < c; m++)
|
|
1650
|
+
if (s = r + 12 * m + 2, t.getUint16(s, a) === 274) {
|
|
1623
1651
|
s += 8, i = t.getUint16(s, a), t.setUint16(s, 1, a);
|
|
1624
1652
|
break;
|
|
1625
1653
|
}
|
|
@@ -1629,7 +1657,7 @@ function sa(e) {
|
|
|
1629
1657
|
return null;
|
|
1630
1658
|
}
|
|
1631
1659
|
}
|
|
1632
|
-
function
|
|
1660
|
+
function xi(e, i) {
|
|
1633
1661
|
var t = i.getBoundingClientRect(), n = t.left, a = t.top, o = { left: 0, top: 0 }, r = 0;
|
|
1634
1662
|
return e.forEach(function(l) {
|
|
1635
1663
|
o.left += (l.clientX - n) / e.length, o.top += (l.clientY - a) / e.length;
|
|
@@ -1647,7 +1675,7 @@ var an = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { typ
|
|
|
1647
1675
|
if (this.touches.length) {
|
|
1648
1676
|
if (this.touches.length === 1 && i.length === 1) this.$emit("move", new ct({ left: this.touches[0].clientX - i[0].clientX, top: this.touches[0].clientY - i[0].clientY }));
|
|
1649
1677
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
1650
|
-
var t =
|
|
1678
|
+
var t = xi(i, this.$refs.container), n = this.oldGeometricProperties;
|
|
1651
1679
|
n.count === t.count && n.count > 1 && this.$emit("resize", new ct({ left: n.centerMass.left - t.centerMass.left, top: n.centerMass.top - t.centerMass.top }, { factor: n.spread / t.spread, center: t.centerMass })), this.oldGeometricProperties = t;
|
|
1652
1680
|
}
|
|
1653
1681
|
this.touches = i;
|
|
@@ -1663,7 +1691,7 @@ var an = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { typ
|
|
|
1663
1691
|
var i = this.$refs.container, t = i.getBoundingClientRect(), n = t.left, a = t.top, o = t.bottom, r = t.right;
|
|
1664
1692
|
this.touches = tt(e.touches).filter(function(l) {
|
|
1665
1693
|
return l.clientX > n && l.clientX < r && l.clientY > a && l.clientY < o;
|
|
1666
|
-
}), this.oldGeometricProperties =
|
|
1694
|
+
}), this.oldGeometricProperties = xi(this.touches, i);
|
|
1667
1695
|
}
|
|
1668
1696
|
}, onTouchEnd: function(e) {
|
|
1669
1697
|
e.touches.length === 0 && (this.touches = [], this.processEnd());
|
|
@@ -1817,25 +1845,25 @@ var la = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
1817
1845
|
o.widthFrozen && (s.left = 0, s.right = 0), o.heightFrozen && (s.top = 0, s.bottom = 0), Pe.forEach(function(K) {
|
|
1818
1846
|
u[K] || (s[K] = 0);
|
|
1819
1847
|
});
|
|
1820
|
-
var
|
|
1821
|
-
if (
|
|
1848
|
+
var d = De(r, s = Ri({ coordinates: r, directions: s, sizeRestrictions: o, positionRestrictions: a })).width, c = De(r, s).height, m = l.preserveRatio ? le(r) : zt(d / c, n);
|
|
1849
|
+
if (m) {
|
|
1822
1850
|
var p = l.respectDirection;
|
|
1823
|
-
if (p || (p = r.width >= r.height ||
|
|
1824
|
-
var v =
|
|
1851
|
+
if (p || (p = r.width >= r.height || m === 1 ? "width" : "height"), p === "width") {
|
|
1852
|
+
var v = d / m - r.height;
|
|
1825
1853
|
if (u.top && u.bottom) {
|
|
1826
1854
|
var y = s.top, _ = s.bottom;
|
|
1827
1855
|
s.bottom = gt(v, _, y), s.top = gt(v, y, _);
|
|
1828
1856
|
} else u.bottom ? s.bottom = v : u.top ? s.top = v : u.right ? s.right = 0 : u.left && (s.left = 0);
|
|
1829
1857
|
} else if (p === "height") {
|
|
1830
|
-
var S = r.width - c *
|
|
1858
|
+
var S = r.width - c * m;
|
|
1831
1859
|
if (u.left && u.right) {
|
|
1832
|
-
var f = s.left,
|
|
1833
|
-
s.left = -gt(S, f,
|
|
1860
|
+
var f = s.left, x = s.right;
|
|
1861
|
+
s.left = -gt(S, f, x), s.right = -gt(S, x, f);
|
|
1834
1862
|
} else u.left ? s.left = -S : u.right ? s.right = -S : u.top ? s.top = 0 : u.bottom && (s.bottom = 0);
|
|
1835
1863
|
}
|
|
1836
|
-
s =
|
|
1864
|
+
s = Ri({ directions: s, coordinates: r, sizeRestrictions: o, positionRestrictions: a, preserveRatio: !0, compensate: l.compensate });
|
|
1837
1865
|
}
|
|
1838
|
-
return
|
|
1866
|
+
return d = De(r, s).width, c = De(r, s).height, (m = l.preserveRatio ? le(r) : zt(d / c, n)) && Math.abs(m - d / c) > 1e-3 && Pe.forEach(function(K) {
|
|
1839
1867
|
u[K] || (s[K] = 0);
|
|
1840
1868
|
}), Kt({ event: new qt({ left: -s.left, top: -s.top }), coordinates: { width: t.width + s.right + s.left, height: t.height + s.top + s.bottom, left: t.left, top: t.top }, positionRestrictions: a });
|
|
1841
1869
|
} }, moveAlgorithm: { type: Function, default: Kt }, initStretcher: { type: Function, default: function(e) {
|
|
@@ -1846,8 +1874,8 @@ var la = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
1846
1874
|
return r = we(r = Me(r, at(_e(t), _e(r))), At($e(i), o));
|
|
1847
1875
|
} }, fitVisibleArea: { type: Function, default: function(e) {
|
|
1848
1876
|
var i = e.visibleArea, t = e.boundaries, n = e.getAreaRestrictions, a = e.coordinates, o = J({}, i);
|
|
1849
|
-
o.height = o.width / le(t), o.top += (i.height - o.height) / 2, (a.height - o.height > 0 || a.width - o.width > 0) && (o =
|
|
1850
|
-
var r =
|
|
1877
|
+
o.height = o.width / le(t), o.top += (i.height - o.height) / 2, (a.height - o.height > 0 || a.width - o.width > 0) && (o = Ie(o, Math.max(a.height / o.height, a.width / o.width)));
|
|
1878
|
+
var r = Rt(st(a, $e(o = Ie(o, xt(o, n({ visibleArea: o, type: "resize" }))))));
|
|
1851
1879
|
return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = we(o = Me(o, r), n({ visibleArea: o, type: "move" }));
|
|
1852
1880
|
} }, areaRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1853
1881
|
var i = e.visibleArea, t = e.boundaries, n = e.imageSize, a = e.imageRestriction, o = e.type, r = {};
|
|
@@ -1885,8 +1913,8 @@ var la = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
1885
1913
|
if (e = function(n) {
|
|
1886
1914
|
var a = n.areaRestrictions, o = n.sizeRestrictions, r = n.boundaries, l = n.positionRestrictions, s = J(J({}, o), { minWidth: o.minWidth !== void 0 ? o.minWidth : 0, minHeight: o.minHeight !== void 0 ? o.minHeight : 0, maxWidth: o.maxWidth !== void 0 ? o.maxWidth : 1 / 0, maxHeight: o.maxHeight !== void 0 ? o.maxHeight : 1 / 0 });
|
|
1887
1915
|
l.left !== void 0 && l.right !== void 0 && (s.maxWidth = Math.min(s.maxWidth, l.right - l.left)), l.bottom !== void 0 && l.top !== void 0 && (s.maxHeight = Math.min(s.maxHeight, l.bottom - l.top));
|
|
1888
|
-
var u = Gt(a),
|
|
1889
|
-
return u.width < 1 / 0 && (!s.maxWidth || s.maxWidth >
|
|
1916
|
+
var u = Gt(a), d = Qi(r, u);
|
|
1917
|
+
return u.width < 1 / 0 && (!s.maxWidth || s.maxWidth > d.width) && (s.maxWidth = Math.min(s.maxWidth, d.width)), u.height < 1 / 0 && (!s.maxHeight || s.maxHeight > d.height) && (s.maxHeight = Math.min(s.maxHeight, d.height)), s.minWidth > s.maxWidth && (s.minWidth = s.maxWidth, s.widthFrozen = !0), s.minHeight > s.maxHeight && (s.minHeight = s.maxHeight, s.heightFrozen = !0), s;
|
|
1890
1918
|
}({ sizeRestrictions: e, areaRestrictions: this.getAreaRestrictions({ visibleArea: this.visibleArea, type: "resize" }), imageSize: this.imageSize, boundaries: this.boundaries, positionRestrictions: this.positionRestrictions, imageRestriction: this.imageRestriction, visibleArea: this.visibleArea, stencilSize: this.getStencilSize() }), this.visibleArea && this.stencilSize) {
|
|
1891
1919
|
var i = this.getStencilSize(), t = Gt(this.getAreaRestrictions({ visibleArea: this.visibleArea, type: "resize" }));
|
|
1892
1920
|
e.maxWidth = Math.min(e.maxWidth, t.width * i.width / this.boundaries.width), e.maxHeight = Math.min(e.maxHeight, t.height * i.height / this.boundaries.height), e.maxWidth < e.minWidth && (e.minWidth = e.maxWidth), e.maxHeight < e.minHeight && (e.minHeight = e.maxHeight);
|
|
@@ -1985,7 +2013,7 @@ var la = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
1985
2013
|
var o = a({ event: { type: e, params: n }, visibleArea: i, coordinates: t, boundaries: this.boundaries, aspectRatio: this.getAspectRatio(), positionRestrictions: this.positionRestrictions, getAreaRestrictions: this.getAreaRestrictions, sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize() });
|
|
1986
2014
|
return se(se({}, o), {}, { changed: !Si(o.visibleArea, i) || !Si(o.coordinates, t) });
|
|
1987
2015
|
}, runAutoZoom: function(e) {
|
|
1988
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = i.transitions, n = t !== void 0 && t, a =
|
|
2016
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = i.transitions, n = t !== void 0 && t, a = zo(i, la), o = this.processAutoZoom(e, this.visibleArea, this.coordinates, a), r = o.visibleArea, l = o.coordinates, s = o.changed;
|
|
1989
2017
|
n && s && this.enableTransitions(), this.visibleArea = r, this.coordinates = l, n && s && this.debouncedDisableTransitions();
|
|
1990
2018
|
}, normalizeEvent: function(e) {
|
|
1991
2019
|
return function(i) {
|
|
@@ -2008,10 +2036,10 @@ var la = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
2008
2036
|
}, getCanvas: function() {
|
|
2009
2037
|
if (this.$refs.canvas) {
|
|
2010
2038
|
var e = this.$refs.canvas, i = this.$refs.image, t = this.imageTransforms.rotate !== 0 || this.imageTransforms.flip.horizontal || this.imageTransforms.flip.vertical ? function(l, s, u) {
|
|
2011
|
-
var
|
|
2039
|
+
var d = u.rotate, c = u.flip, m = { width: s.naturalWidth, height: s.naturalHeight }, p = Ji(m, d), v = l.getContext("2d");
|
|
2012
2040
|
l.height = p.height, l.width = p.width, v.save();
|
|
2013
|
-
var y = He(_e(J({ left: 0, top: 0 },
|
|
2014
|
-
return v.translate(-(y.left - p.width / 2), -(y.top - p.height / 2)), v.rotate(
|
|
2041
|
+
var y = He(_e(J({ left: 0, top: 0 }, m)), d);
|
|
2042
|
+
return v.translate(-(y.left - p.width / 2), -(y.top - p.height / 2)), v.rotate(d * Math.PI / 180), v.translate(c.horizontal ? m.width : 0, c.vertical ? m.height : 0), v.scale(c.horizontal ? -1 : 1, c.vertical ? -1 : 1), v.drawImage(s, 0, 0, m.width, m.height), v.restore(), l;
|
|
2015
2043
|
}(this.$refs.sourceCanvas, i, this.imageTransforms) : i, n = se({ minWidth: 0, minHeight: 0, maxWidth: 1 / 0, maxHeight: 1 / 0, maxArea: this.maxCanvasSize, imageSmoothingEnabled: !0, imageSmoothingQuality: "high", fillColor: "transparent" }, this.canvas), a = function(l) {
|
|
2016
2044
|
return l.find(function(s) {
|
|
2017
2045
|
return u = s, !Number.isNaN(parseFloat(u)) && isFinite(u);
|
|
@@ -2022,12 +2050,12 @@ var la = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
2022
2050
|
var r = Math.sqrt(n.maxArea / (o.width * o.height));
|
|
2023
2051
|
o = { width: Math.round(r * o.width), height: Math.round(r * o.height) };
|
|
2024
2052
|
}
|
|
2025
|
-
return function(l, s, u,
|
|
2026
|
-
l.width =
|
|
2027
|
-
var
|
|
2028
|
-
|
|
2053
|
+
return function(l, s, u, d, c) {
|
|
2054
|
+
l.width = d ? d.width : u.width, l.height = d ? d.height : u.height;
|
|
2055
|
+
var m = l.getContext("2d");
|
|
2056
|
+
m.clearRect(0, 0, l.width, l.height), c && (c.imageSmoothingEnabled && (m.imageSmoothingEnabled = c.imageSmoothingEnabled), c.imageSmoothingQuality && (m.imageSmoothingQuality = c.imageSmoothingQuality), c.fillColor && (m.fillStyle = c.fillColor, m.fillRect(0, 0, l.width, l.height), m.save()));
|
|
2029
2057
|
var p = u.left < 0 ? -u.left : 0, v = u.top < 0 ? -u.top : 0;
|
|
2030
|
-
|
|
2058
|
+
m.drawImage(s, u.left + p, u.top + v, u.width, u.height, p * (l.width / u.width), v * (l.height / u.height), l.width, l.height);
|
|
2031
2059
|
}(e, t, this.coordinates, o, n), e;
|
|
2032
2060
|
}
|
|
2033
2061
|
}, update: function() {
|
|
@@ -2064,8 +2092,8 @@ var la = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
2064
2092
|
return this.initStretcher({ cropper: t, stretcher: i, imageSize: this.imageSize }), this.$nextTick().then(function() {
|
|
2065
2093
|
var n = { cropper: t, imageSize: e.imageSize };
|
|
2066
2094
|
if (nt(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(n) : e.defaultBoundaries === "fit" ? e.boundaries = function(a) {
|
|
2067
|
-
var o = a.cropper, r = a.imageSize, l = o.clientHeight, s = o.clientWidth, u = l,
|
|
2068
|
-
return
|
|
2095
|
+
var o = a.cropper, r = a.imageSize, l = o.clientHeight, s = o.clientWidth, u = l, d = r.width * l / r.height;
|
|
2096
|
+
return d > s && (d = s, u = r.height * s / r.width), { width: d, height: u };
|
|
2069
2097
|
}(n) : e.boundaries = function(a) {
|
|
2070
2098
|
var o = a.cropper;
|
|
2071
2099
|
return { width: o.clientWidth, height: o.clientHeight };
|
|
@@ -2205,7 +2233,7 @@ var la = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
2205
2233
|
}
|
|
2206
2234
|
return { minimum: i, maximum: t };
|
|
2207
2235
|
}, getStencilSize: function() {
|
|
2208
|
-
if (this.stencilSize) return e = { currentStencilSize: { width: this.stencilCoordinates.width, height: this.stencilCoordinates.height }, stencilSize: this.stencilSize, boundaries: this.boundaries, coefficient: this.coefficient, coordinates: this.coordinates, aspectRatio: this.getAspectRatio(!0) }, i = e.boundaries, t = e.stencilSize, n = e.aspectRatio,
|
|
2236
|
+
if (this.stencilSize) return e = { currentStencilSize: { width: this.stencilCoordinates.width, height: this.stencilCoordinates.height }, stencilSize: this.stencilSize, boundaries: this.boundaries, coefficient: this.coefficient, coordinates: this.coordinates, aspectRatio: this.getAspectRatio(!0) }, i = e.boundaries, t = e.stencilSize, n = e.aspectRatio, zt(le(a = nt(t) ? t({ boundaries: i, aspectRatio: n }) : t), n) && (a = We({ sizeRestrictions: { maxWidth: i.width, maxHeight: i.height, minWidth: 0, minHeight: 0 }, width: a.width, height: a.height, aspectRatio: { minimum: n.minimum, maximum: n.maximum } })), (a.width > i.width || a.height > i.height) && (a = We({ sizeRestrictions: { maxWidth: i.width, maxHeight: i.height, minWidth: 0, minHeight: 0 }, width: a.width, height: a.height, aspectRatio: { minimum: le(a), maximum: le(a) } })), a;
|
|
2209
2237
|
var e, i, t, n, a;
|
|
2210
2238
|
}, getPublicProperties: function() {
|
|
2211
2239
|
return { coefficient: this.coefficient, visibleArea: this.visibleArea, coordinates: this.coordinates, boundaries: this.boundaries, sizeRestrictions: this.sizeRestrictions, positionRestrictions: this.positionRestrictions, aspectRatio: this.getAspectRatio(), imageRestriction: this.imageRestriction };
|
|
@@ -2248,8 +2276,8 @@ function ma(e, i) {
|
|
|
2248
2276
|
a > i ? r = o / i : o = r * i;
|
|
2249
2277
|
const l = da(o, r), s = document.createElement("canvas");
|
|
2250
2278
|
s.width = l.width, s.height = l.height;
|
|
2251
|
-
const u = o > t ? (o - t) / 2 * l.ratio : 0,
|
|
2252
|
-
return c ? (c.fillStyle = "white", c.fillRect(0, 0, l.width, l.height), c.drawImage(e, u,
|
|
2279
|
+
const u = o > t ? (o - t) / 2 * l.ratio : 0, d = r > n ? (r - n) / 2 * l.ratio : 0, c = s.getContext("2d");
|
|
2280
|
+
return c ? (c.fillStyle = "white", c.fillRect(0, 0, l.width, l.height), c.drawImage(e, u, d, t * l.ratio, n * l.ratio), s.toDataURL()) : (console.error("Could not get 2D context from canvas"), "");
|
|
2253
2281
|
}
|
|
2254
2282
|
const pa = {
|
|
2255
2283
|
key: 0,
|
|
@@ -2267,9 +2295,10 @@ const pa = {
|
|
|
2267
2295
|
}, ya = { class: "absolute top-12 right-12 z-10 flex flex-col gap-8" }, _a = { class: "fm-typo-en-body-lg-600 pb-4" }, wa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Sa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ca = /* @__PURE__ */ me({
|
|
2268
2296
|
__name: "ImageDropField",
|
|
2269
2297
|
props: {
|
|
2270
|
-
modelValue: {}
|
|
2298
|
+
modelValue: {},
|
|
2299
|
+
trackingId: {}
|
|
2271
2300
|
},
|
|
2272
|
-
emits: ["update:model-value", "reset:model-value"],
|
|
2301
|
+
emits: ["update:model-value", "reset:model-value", "update:tracking-id"],
|
|
2273
2302
|
setup(e, { emit: i }) {
|
|
2274
2303
|
const t = e, { t: n } = he(), a = i, o = O(() => t.modelValue ? URL.createObjectURL(t.modelValue) : ""), r = ee(), l = ee(), s = ee(!1);
|
|
2275
2304
|
async function u([_]) {
|
|
@@ -2279,25 +2308,25 @@ const pa = {
|
|
|
2279
2308
|
S.onload = () => {
|
|
2280
2309
|
const f = new Image();
|
|
2281
2310
|
f.src = S.result, l.value = S.result, f.onload = () => {
|
|
2282
|
-
const
|
|
2283
|
-
r.value =
|
|
2311
|
+
const x = ma(f, 1.7777777777777777);
|
|
2312
|
+
r.value = x, a("update:tracking-id", void 0), s.value = !1;
|
|
2284
2313
|
}, f.onerror = () => {
|
|
2285
2314
|
s.value = !1;
|
|
2286
2315
|
};
|
|
2287
2316
|
}, S.readAsDataURL(_);
|
|
2288
2317
|
}
|
|
2289
|
-
const
|
|
2318
|
+
const d = (_) => {
|
|
2290
2319
|
u([_]);
|
|
2291
2320
|
};
|
|
2292
2321
|
async function c(_) {
|
|
2293
2322
|
!r.value && o.value && (r.value = o.value);
|
|
2294
2323
|
const { canvas: S } = _, f = S.toDataURL("image/jpeg", 0.75);
|
|
2295
2324
|
l.value = f;
|
|
2296
|
-
const
|
|
2325
|
+
const x = await (await fetch(f)).blob(), K = new File([x], "img.jpeg", { type: "image/jpeg" });
|
|
2297
2326
|
a("update:model-value", K);
|
|
2298
2327
|
}
|
|
2299
|
-
function
|
|
2300
|
-
r.value = void 0, l.value = void 0, a("reset:model-value");
|
|
2328
|
+
function m() {
|
|
2329
|
+
r.value = void 0, l.value = void 0, a("reset:model-value"), a("update:tracking-id", void 0);
|
|
2301
2330
|
}
|
|
2302
2331
|
const p = Yt(), v = O(() => !!p.showRemy);
|
|
2303
2332
|
async function y() {
|
|
@@ -2313,12 +2342,12 @@ const pa = {
|
|
|
2313
2342
|
inputImage: l.value
|
|
2314
2343
|
},
|
|
2315
2344
|
onResult: (_) => {
|
|
2316
|
-
_.imageData && (r.value = _.imageData, l.value = _.imageData);
|
|
2345
|
+
_.imageData && (r.value = _.imageData, l.value = _.imageData, a("update:tracking-id", _.trackingId));
|
|
2317
2346
|
}
|
|
2318
2347
|
});
|
|
2319
2348
|
}
|
|
2320
2349
|
return (_, S) => {
|
|
2321
|
-
const f = N("fm-icon"),
|
|
2350
|
+
const f = N("fm-icon"), x = N("fm-drop-field");
|
|
2322
2351
|
return r.value || o.value ? (F(), te("div", pa, [
|
|
2323
2352
|
V("p", ha, [
|
|
2324
2353
|
Pt(de(h(n)("menu.common.labels.product_image")) + " ", 1),
|
|
@@ -2347,7 +2376,7 @@ const pa = {
|
|
|
2347
2376
|
V("button", {
|
|
2348
2377
|
class: Fe(["w-24 h-24 rounded-[50%]", "bg-fm-color-neutral-white"]),
|
|
2349
2378
|
type: "button",
|
|
2350
|
-
onClick:
|
|
2379
|
+
onClick: m
|
|
2351
2380
|
}, [
|
|
2352
2381
|
b(f, { name: "close" })
|
|
2353
2382
|
]),
|
|
@@ -2369,11 +2398,11 @@ const pa = {
|
|
|
2369
2398
|
])
|
|
2370
2399
|
])
|
|
2371
2400
|
])
|
|
2372
|
-
])) : (F(), j(
|
|
2401
|
+
])) : (F(), j(x, {
|
|
2373
2402
|
key: 1,
|
|
2374
2403
|
accept: ".jpg, .jpeg, .png, .gif, .JPG, .JPEG, .PNG, .GIF",
|
|
2375
2404
|
"content-class": "h-[150px] w-[200px]",
|
|
2376
|
-
onFileUpload:
|
|
2405
|
+
onFileUpload: d
|
|
2377
2406
|
}, {
|
|
2378
2407
|
label: P(() => [
|
|
2379
2408
|
V("p", _a, [
|
|
@@ -2446,25 +2475,25 @@ const pa = {
|
|
|
2446
2475
|
})), r = O(() => {
|
|
2447
2476
|
const u = Object.values(o.value);
|
|
2448
2477
|
if (t.disable) return u;
|
|
2449
|
-
let
|
|
2450
|
-
return t.defaultLabel && !t.required && (
|
|
2478
|
+
let d = t.editActiveOnly ? [o.value.ALL, o.value.NONE] : u;
|
|
2479
|
+
return t.defaultLabel && !t.required && (d = [
|
|
2451
2480
|
{
|
|
2452
2481
|
label: t.defaultLabel,
|
|
2453
2482
|
value: null
|
|
2454
2483
|
},
|
|
2455
|
-
...
|
|
2456
|
-
]), t.orderFromNone ?
|
|
2484
|
+
...d
|
|
2485
|
+
]), t.orderFromNone ? d : d.filter((c) => c.value !== G.F_ORDER_FROM.enum.NONE);
|
|
2457
2486
|
});
|
|
2458
2487
|
function l(u) {
|
|
2459
|
-
let
|
|
2460
|
-
return t.editActiveOnly && u && (
|
|
2488
|
+
let d = u;
|
|
2489
|
+
return t.editActiveOnly && u && (d = d === G.F_ORDER_FROM.enum.NONE ? G.F_ORDER_FROM.enum.NONE : G.F_ORDER_FROM.enum.ALL), d;
|
|
2461
2490
|
}
|
|
2462
2491
|
const s = O(() => {
|
|
2463
2492
|
if (t.modelValue) return t.modelValue;
|
|
2464
|
-
const u = t.editActiveOnly || t.required,
|
|
2493
|
+
const u = t.editActiveOnly || t.required, d = r.value.some((m) => m.value === null), c = u && !d ? t.fallback ?? r.value[0].value : t.modelValue;
|
|
2465
2494
|
return c ? l(c) : null;
|
|
2466
2495
|
});
|
|
2467
|
-
return (u,
|
|
2496
|
+
return (u, d) => {
|
|
2468
2497
|
const c = N("fm-select");
|
|
2469
2498
|
return F(), te("div", null, [
|
|
2470
2499
|
b(c, {
|
|
@@ -2473,14 +2502,14 @@ const pa = {
|
|
|
2473
2502
|
label: e.label ?? h(n)("menu.common.labels.order_from"),
|
|
2474
2503
|
"menu-z-index": e.menuZIndex,
|
|
2475
2504
|
"model-value": s.value,
|
|
2476
|
-
rules: e.required ? [(
|
|
2505
|
+
rules: e.required ? [(m) => !!m || h(n)("menu.common.validation.required_field")] : [],
|
|
2477
2506
|
"shift-menu": "",
|
|
2478
|
-
"onUpdate:modelValue":
|
|
2507
|
+
"onUpdate:modelValue": d[0] || (d[0] = (m) => a("update:model-value", m ?? null))
|
|
2479
2508
|
}, null, 8, ["disabled", "items", "label", "menu-z-index", "model-value", "rules"])
|
|
2480
2509
|
]);
|
|
2481
2510
|
};
|
|
2482
2511
|
}
|
|
2483
|
-
}),
|
|
2512
|
+
}), ka = { class: "flex flex-col gap-4" }, Ra = { class: "fm-select__menu__wrapper" }, xa = { class: "fm-typo-en-body-lg-600 text-fm-color-primary" }, Aa = {
|
|
2484
2513
|
key: 0,
|
|
2485
2514
|
class: "flex flex-col gap-4 justify-center"
|
|
2486
2515
|
}, Ma = /* @__PURE__ */ me({
|
|
@@ -2497,36 +2526,36 @@ const pa = {
|
|
|
2497
2526
|
},
|
|
2498
2527
|
emits: ["update:modelValue"],
|
|
2499
2528
|
setup(e, { emit: i }) {
|
|
2500
|
-
const t = e, n = i, a = Ne(), o = Ee(), r = Xe(o), l = qe(r), { t: s } =
|
|
2529
|
+
const t = e, n = i, a = Ne(), o = Ee(), r = Xe(o), l = qe(r), { t: s } = Dn(), u = ee(null), d = ee([]), c = Kn({
|
|
2501
2530
|
dialog: a,
|
|
2502
2531
|
menuLoader: l,
|
|
2503
2532
|
isLocalOnly: t.isLocalOnly
|
|
2504
|
-
}),
|
|
2505
|
-
f ?
|
|
2533
|
+
}), m = (f, x) => {
|
|
2534
|
+
f ? d.value = [...d.value, x] : d.value = d.value.filter((K) => K.value !== x.value), n(
|
|
2506
2535
|
"update:modelValue",
|
|
2507
|
-
|
|
2536
|
+
d.value.map((K) => K.value)
|
|
2508
2537
|
);
|
|
2509
2538
|
}, p = (f) => {
|
|
2510
|
-
|
|
2539
|
+
d.value = d.value.filter((x, K) => K !== f), n(
|
|
2511
2540
|
"update:modelValue",
|
|
2512
|
-
|
|
2541
|
+
d.value.map((x) => x.value)
|
|
2513
2542
|
);
|
|
2514
2543
|
}, v = () => {
|
|
2515
2544
|
var f;
|
|
2516
2545
|
(f = u.value) == null || f.toggleMenu(!1), c.create();
|
|
2517
2546
|
}, y = O(() => t.items.reduce(
|
|
2518
|
-
(f,
|
|
2547
|
+
(f, x) => (f[x.value] = x, f),
|
|
2519
2548
|
{}
|
|
2520
|
-
)), _ = O(() =>
|
|
2521
|
-
return
|
|
2549
|
+
)), _ = O(() => d.value.length > 0 ? d.value.map((f) => f.label).join("/") : t.placeholder), S = ee(!1);
|
|
2550
|
+
return Re(
|
|
2522
2551
|
() => t.modelValue,
|
|
2523
2552
|
(f) => {
|
|
2524
|
-
f != null && f.length ?
|
|
2553
|
+
f != null && f.length ? d.value = f.map((x) => y.value[x]).filter((x) => !!x) : d.value = [];
|
|
2525
2554
|
},
|
|
2526
2555
|
{ immediate: !0 }
|
|
2527
|
-
), (f,
|
|
2528
|
-
const K = N("FmIcon"), U = N("FmField"), L = N("FmMenuItem"), M = N("FmMenu"), T = N("FmFormGroup"),
|
|
2529
|
-
return F(), te("div",
|
|
2556
|
+
), (f, x) => {
|
|
2557
|
+
const K = N("FmIcon"), U = N("FmField"), L = N("FmMenuItem"), M = N("FmMenu"), T = N("FmFormGroup"), z = N("FmChipGroup");
|
|
2558
|
+
return F(), te("div", ka, [
|
|
2530
2559
|
b(T, {
|
|
2531
2560
|
"model-value": f.modelValue,
|
|
2532
2561
|
disabled: f.disabled,
|
|
@@ -2541,7 +2570,7 @@ const pa = {
|
|
|
2541
2570
|
ref_key: "fmMenuRef",
|
|
2542
2571
|
ref: u,
|
|
2543
2572
|
"close-on-click": !1,
|
|
2544
|
-
onMenuChanged:
|
|
2573
|
+
onMenuChanged: x[1] || (x[1] = (A) => S.value = A)
|
|
2545
2574
|
}, {
|
|
2546
2575
|
"menu-button": P(() => [
|
|
2547
2576
|
b(U, {
|
|
@@ -2559,7 +2588,7 @@ const pa = {
|
|
|
2559
2588
|
default: P(() => [
|
|
2560
2589
|
V("div", {
|
|
2561
2590
|
class: Fe([[
|
|
2562
|
-
f.disabled ? "text-fm-color-typo-disabled" :
|
|
2591
|
+
f.disabled ? "text-fm-color-typo-disabled" : d.value.length > 0 ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"
|
|
2563
2592
|
], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
|
|
2564
2593
|
}, de(_.value), 3)
|
|
2565
2594
|
]),
|
|
@@ -2567,26 +2596,26 @@ const pa = {
|
|
|
2567
2596
|
}, 1032, ["class", "focused", "invalid"])
|
|
2568
2597
|
]),
|
|
2569
2598
|
default: P(() => [
|
|
2570
|
-
V("div",
|
|
2599
|
+
V("div", Ra, [
|
|
2571
2600
|
(F(!0), te(Ae, null, Ue(f.items, (A) => (F(), j(L, {
|
|
2572
2601
|
key: A.value,
|
|
2573
2602
|
disabled: A.disabled,
|
|
2574
2603
|
"has-checkbox": !0,
|
|
2575
2604
|
label: A.label,
|
|
2576
|
-
"model-value":
|
|
2577
|
-
"onUpdate:modelValue": (
|
|
2605
|
+
"model-value": d.value.some((k) => k.value === A.value),
|
|
2606
|
+
"onUpdate:modelValue": (k) => m(k, A)
|
|
2578
2607
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue"]))), 128)),
|
|
2579
2608
|
V("button", {
|
|
2580
2609
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
2581
2610
|
type: "button",
|
|
2582
|
-
onClick:
|
|
2611
|
+
onClick: x[0] || (x[0] = (A) => v())
|
|
2583
2612
|
}, [
|
|
2584
2613
|
b(K, {
|
|
2585
2614
|
color: "primary",
|
|
2586
2615
|
name: "add",
|
|
2587
2616
|
size: "md"
|
|
2588
2617
|
}),
|
|
2589
|
-
V("p",
|
|
2618
|
+
V("p", xa, de(h(s)("menu.product.form.detail.subcategory.add_new")), 1)
|
|
2590
2619
|
])
|
|
2591
2620
|
])
|
|
2592
2621
|
]),
|
|
@@ -2595,10 +2624,10 @@ const pa = {
|
|
|
2595
2624
|
]),
|
|
2596
2625
|
_: 1
|
|
2597
2626
|
}, 8, ["model-value", "disabled", "focused", "helper-state", "helper-text", "rules"]),
|
|
2598
|
-
|
|
2599
|
-
b(
|
|
2627
|
+
d.value.length > 0 ? (F(), te("div", Aa, [
|
|
2628
|
+
b(z, {
|
|
2600
2629
|
disabled: f.disabled,
|
|
2601
|
-
items:
|
|
2630
|
+
items: d.value.map((w) => ({ label: w.label })),
|
|
2602
2631
|
removable: "",
|
|
2603
2632
|
onChipClosed: p
|
|
2604
2633
|
}, null, 8, ["disabled", "items"])
|
|
@@ -2612,9 +2641,9 @@ function cn(e, i) {
|
|
|
2612
2641
|
}
|
|
2613
2642
|
const Oa = {
|
|
2614
2643
|
class: "flex flex-row xs:flex-col gap-24"
|
|
2615
|
-
}, za = {
|
|
2616
|
-
class: "flex-1 flex flex-col gap-24"
|
|
2617
2644
|
}, Ia = {
|
|
2645
|
+
class: "flex-1 flex flex-col gap-24"
|
|
2646
|
+
}, za = {
|
|
2618
2647
|
class: /* @__PURE__ */ Fe(["flex space-x-16", "xs:flex-col xs:space-x-0 xs:space-y-16"])
|
|
2619
2648
|
}, Ea = {
|
|
2620
2649
|
class: "w-[160px] xs:w-full"
|
|
@@ -2661,18 +2690,18 @@ const Ga = /* @__PURE__ */ me({
|
|
|
2661
2690
|
setup(e, {
|
|
2662
2691
|
emit: i
|
|
2663
2692
|
}) {
|
|
2664
|
-
const t = e, n = be(), a = mt(), o = Ne(), r = Ee(), l = Xe(r), s = qe(l), u =
|
|
2693
|
+
const t = e, n = be(), a = mt(), o = Ne(), r = Ee(), l = Xe(r), s = qe(l), u = jn({
|
|
2665
2694
|
dialog: o,
|
|
2666
2695
|
menuLoader: s
|
|
2667
2696
|
}), {
|
|
2668
|
-
checkMenuIsLoading:
|
|
2669
|
-
} = qe(Xe(Ee())), c = i,
|
|
2697
|
+
checkMenuIsLoading: d
|
|
2698
|
+
} = qe(Xe(Ee())), c = i, m = O(() => n.rules.item), p = O(() => n.categorizedItems), v = O(() => {
|
|
2670
2699
|
const g = p.value.map((C) => ({
|
|
2671
2700
|
label: C.name,
|
|
2672
2701
|
value: C.id
|
|
2673
2702
|
}));
|
|
2674
2703
|
return t.isAddon ? g : g.filter((C) => !!C.value);
|
|
2675
|
-
}), y = O(() =>
|
|
2704
|
+
}), y = O(() => m.value.addon), _ = O(() => !v.value.find((g) => !!g.value)), S = O(() => An(t.form.category ? t.form : t.fallback) || []), f = O(() => S.value.reduce((g, C) => (g[C._id] = C, g), {})), x = O({
|
|
2676
2705
|
get() {
|
|
2677
2706
|
return S.value.map((g) => g._id);
|
|
2678
2707
|
},
|
|
@@ -2692,13 +2721,13 @@ const Ga = /* @__PURE__ */ me({
|
|
|
2692
2721
|
}
|
|
2693
2722
|
}), K = ee(), U = ({
|
|
2694
2723
|
multiple: g = !0
|
|
2695
|
-
} = {}) => t.isAddon ? null : b(
|
|
2724
|
+
} = {}) => t.isAddon ? null : b(Io, {
|
|
2696
2725
|
ref: K,
|
|
2697
|
-
disabled: !
|
|
2726
|
+
disabled: !m.value.category || t.isAddon || d(),
|
|
2698
2727
|
items: v.value,
|
|
2699
|
-
modelValue:
|
|
2700
|
-
"onUpdate:model-value": (C) =>
|
|
2701
|
-
placeholder:
|
|
2728
|
+
modelValue: x.value,
|
|
2729
|
+
"onUpdate:model-value": (C) => x.value = C,
|
|
2730
|
+
placeholder: I("menu.product.form.detail.category.placeholder"),
|
|
2702
2731
|
multiple: g
|
|
2703
2732
|
}, {
|
|
2704
2733
|
"append-menu": () => b("button", {
|
|
@@ -2708,16 +2737,16 @@ const Ga = /* @__PURE__ */ me({
|
|
|
2708
2737
|
var C;
|
|
2709
2738
|
(C = K.value) == null || C.hideMenu(), u.create();
|
|
2710
2739
|
}
|
|
2711
|
-
}, [b(
|
|
2740
|
+
}, [b(xe.FmIcon, {
|
|
2712
2741
|
color: "primary",
|
|
2713
2742
|
name: "add",
|
|
2714
2743
|
size: "md"
|
|
2715
2744
|
}, null), b("p", {
|
|
2716
2745
|
class: "fm-typo-en-body-lg-600 text-fm-color-primary"
|
|
2717
|
-
}, [
|
|
2746
|
+
}, [I("menu.product.form.detail.category.add_new")])])
|
|
2718
2747
|
});
|
|
2719
2748
|
ut(async () => {
|
|
2720
|
-
!_.value && t.form.category === void 0 && t.isCreate &&
|
|
2749
|
+
!_.value && t.form.category === void 0 && t.isCreate && z(Je.PRODUCT);
|
|
2721
2750
|
});
|
|
2722
2751
|
const L = O(() => {
|
|
2723
2752
|
var C;
|
|
@@ -2734,7 +2763,7 @@ const Ga = /* @__PURE__ */ me({
|
|
|
2734
2763
|
D.code === g && (C -= 1);
|
|
2735
2764
|
}), C;
|
|
2736
2765
|
}), T = O(() => t.isAddon ? Je.ADD_ON : Je.PRODUCT);
|
|
2737
|
-
function
|
|
2766
|
+
function z(g) {
|
|
2738
2767
|
var W, ae, re;
|
|
2739
2768
|
if (T.value === g) return;
|
|
2740
2769
|
const C = g == Je.ADD_ON;
|
|
@@ -2758,11 +2787,11 @@ const Ga = /* @__PURE__ */ me({
|
|
|
2758
2787
|
itemName: t.form.name || ""
|
|
2759
2788
|
},
|
|
2760
2789
|
onResult: (g) => {
|
|
2761
|
-
c("update:form", "description", g.description || "");
|
|
2790
|
+
c("update:form", "description", g.description || ""), c("update:form", "_descriptionTrackingId", g.trackingId);
|
|
2762
2791
|
}
|
|
2763
2792
|
});
|
|
2764
2793
|
}
|
|
2765
|
-
const
|
|
2794
|
+
const k = O(() => n.subcategories), R = O(() => k.value.map((g) => ({
|
|
2766
2795
|
label: g.name,
|
|
2767
2796
|
value: g._id
|
|
2768
2797
|
}))), $ = O({
|
|
@@ -2773,91 +2802,92 @@ const Ga = /* @__PURE__ */ me({
|
|
|
2773
2802
|
c("update:form", "subCategories", g);
|
|
2774
2803
|
}
|
|
2775
2804
|
}), {
|
|
2776
|
-
t:
|
|
2805
|
+
t: I
|
|
2777
2806
|
} = he();
|
|
2778
2807
|
return (g, C) => {
|
|
2779
2808
|
const W = N("fm-text-field"), ae = N("fm-textarea"), re = N("fm-radio"), E = N("FmSnackbar"), D = N("FmButton"), Y = N("fm-radio-group"), q = N("FmFormGroup"), Z = N("FmStepperField"), X = Oi("tooltip");
|
|
2780
2809
|
return F(), j(Be, {
|
|
2781
|
-
title: h(
|
|
2810
|
+
title: h(I)("menu.product.form.detail.title")
|
|
2782
2811
|
}, {
|
|
2783
2812
|
default: P(() => {
|
|
2784
|
-
var
|
|
2785
|
-
return [V("div", Oa, [V("div",
|
|
2813
|
+
var oe, ce;
|
|
2814
|
+
return [V("div", Oa, [V("div", Ia, [V("div", za, [V("div", Ea, [b(W, {
|
|
2786
2815
|
"model-value": g.form.code,
|
|
2787
|
-
placeholder: ((
|
|
2788
|
-
label: h(
|
|
2789
|
-
rules: [(
|
|
2816
|
+
placeholder: ((oe = g.fallback) == null ? void 0 : oe.code) || h(I)("menu.product.form.detail.fields.code.placeholder"),
|
|
2817
|
+
label: h(I)("menu.product.form.detail.fields.code.label"),
|
|
2818
|
+
rules: [(ne) => M.value === 0 || h(I)("menu.product.form.detail.fields.code.duplicate_warning", {
|
|
2790
2819
|
count: M.value
|
|
2791
2820
|
})],
|
|
2792
|
-
"onUpdate:modelValue": C[0] || (C[0] = (
|
|
2821
|
+
"onUpdate:modelValue": C[0] || (C[0] = (ne) => c("update:form", "code", h(cn)(ne, g.isOverride)))
|
|
2793
2822
|
}, null, 8, ["model-value", "placeholder", "label", "rules"])]), V("div", Ta, [b(W, {
|
|
2794
2823
|
id: "product-name",
|
|
2795
|
-
disabled: !
|
|
2796
|
-
"helper-text": L.value > 0 ? h(
|
|
2824
|
+
disabled: !m.value.name,
|
|
2825
|
+
"helper-text": L.value > 0 ? h(I)("menu.product.form.detail.fields.name.duplicate_warning", {
|
|
2797
2826
|
count: L.value
|
|
2798
2827
|
}) : void 0,
|
|
2799
2828
|
"model-value": g.form.name,
|
|
2800
2829
|
placeholder: (ce = g.fallback) == null ? void 0 : ce.name,
|
|
2801
|
-
rules:
|
|
2830
|
+
rules: m.value.name ? [(ne) => !!ne || h(I)("menu.product.form.detail.fields.name.required")] : void 0,
|
|
2802
2831
|
"label-mark": "required",
|
|
2803
2832
|
autofocus: "",
|
|
2804
|
-
label: h(
|
|
2805
|
-
"onUpdate:modelValue": C[1] || (C[1] = (
|
|
2833
|
+
label: h(I)("menu.product.form.detail.fields.name.label"),
|
|
2834
|
+
"onUpdate:modelValue": C[1] || (C[1] = (ne) => c("update:form", "name", ne))
|
|
2806
2835
|
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), V("div", Da, [b(ae, {
|
|
2807
|
-
disabled: !
|
|
2836
|
+
disabled: !m.value.description,
|
|
2808
2837
|
"model-value": g.form.description || void 0,
|
|
2809
|
-
placeholder: h(
|
|
2810
|
-
"onUpdate:modelValue": C[2] || (C[2] = (
|
|
2838
|
+
placeholder: h(I)("menu.product.form.detail.fields.description.placeholder"),
|
|
2839
|
+
"onUpdate:modelValue": C[2] || (C[2] = (ne) => c("update:form", "description", ne.trim())),
|
|
2811
2840
|
class: "description"
|
|
2812
2841
|
}, {
|
|
2813
|
-
label: P(() => [V("p", Pa, [Pt(de(h(
|
|
2842
|
+
label: P(() => [V("p", Pa, [Pt(de(h(I)("menu.product.form.detail.fields.description.label")) + " ", 1), V("span", Va, de(h(I)("menu.product.form.detail.fields.description.optional")), 1)])]),
|
|
2814
2843
|
_: 1
|
|
2815
2844
|
}, 8, ["disabled", "model-value", "placeholder"]), lt(b(h($i), {
|
|
2816
2845
|
class: "absolute top-32 right-4 cursor-pointer",
|
|
2817
2846
|
onClick: A
|
|
2818
2847
|
}, null, 512), [[X, h(Vi)("Suggest description")]])])]), b(Ca, {
|
|
2819
|
-
disabled: !
|
|
2848
|
+
disabled: !m.value.thumbnail,
|
|
2820
2849
|
"model-value": g.thumbnail,
|
|
2821
|
-
"onUpdate:modelValue": C[3] || (C[3] = (
|
|
2822
|
-
"onReset:modelValue": C[4] || (C[4] = (
|
|
2850
|
+
"onUpdate:modelValue": C[3] || (C[3] = (ne) => c("update:thumbnail", ne)),
|
|
2851
|
+
"onReset:modelValue": C[4] || (C[4] = (ne) => c("reset:thumbnail")),
|
|
2852
|
+
"onUpdate:trackingId": C[5] || (C[5] = (ne) => c("update:form", "_thumbnailTrackingId", ne))
|
|
2823
2853
|
}, null, 8, ["disabled", "model-value"])]), b(Ye, {
|
|
2824
|
-
label: h(n).isV4 ? h(
|
|
2854
|
+
label: h(n).isV4 ? h(I)("menu.product.form.detail.category.label") : h(I)("menu.product.form.detail.category.label_singular")
|
|
2825
2855
|
}, {
|
|
2826
2856
|
default: P(() => [y.value ? (F(), j(Y, {
|
|
2827
2857
|
key: 0,
|
|
2828
|
-
disabled: !
|
|
2858
|
+
disabled: !m.value.category,
|
|
2829
2859
|
"model-value": T.value,
|
|
2830
|
-
"onUpdate:modelValue": C[
|
|
2860
|
+
"onUpdate:modelValue": C[6] || (C[6] = (ne) => z(ne))
|
|
2831
2861
|
}, {
|
|
2832
2862
|
default: P(() => [V("div", Ua, [V("div", $a, [b(re, {
|
|
2833
|
-
disabled: _.value || !
|
|
2863
|
+
disabled: _.value || !m.value.category,
|
|
2834
2864
|
value: Je.PRODUCT,
|
|
2835
|
-
label: h(
|
|
2836
|
-
sublabel: h(
|
|
2837
|
-
}, null, 8, ["disabled", "value", "label", "sublabel"]), b(
|
|
2865
|
+
label: h(I)("menu.product.form.detail.category.options.product.label"),
|
|
2866
|
+
sublabel: h(I)("menu.product.form.detail.category.options.product.sublabel")
|
|
2867
|
+
}, null, 8, ["disabled", "value", "label", "sublabel"]), b(xo, null, {
|
|
2838
2868
|
default: P(() => [h(n).isV4 ? (F(), j(U, {
|
|
2839
2869
|
key: 0
|
|
2840
2870
|
})) : ie("", !0)]),
|
|
2841
2871
|
_: 1
|
|
2842
2872
|
})]), _.value ? (F(), te("div", Na, [b(E, {
|
|
2843
|
-
title: h(
|
|
2873
|
+
title: h(I)("menu.product.form.detail.category.add_first"),
|
|
2844
2874
|
variant: "info"
|
|
2845
2875
|
}, null, 8, ["title"]), b(D, {
|
|
2846
|
-
label: h(
|
|
2876
|
+
label: h(I)("menu.common.actions.add"),
|
|
2847
2877
|
"prepend-icon": "add",
|
|
2848
2878
|
variant: "secondary",
|
|
2849
2879
|
onClick: h(u).create
|
|
2850
2880
|
}, null, 8, ["label", "onClick"])])) : ie("", !0), b(re, {
|
|
2851
2881
|
value: Je.ADD_ON,
|
|
2852
|
-
label: h(
|
|
2853
|
-
sublabel: h(
|
|
2882
|
+
label: h(I)("menu.product.form.detail.category.options.addon.label"),
|
|
2883
|
+
sublabel: h(I)("menu.product.form.detail.category.options.addon.sublabel")
|
|
2854
2884
|
}, null, 8, ["value", "label", "sublabel"])])]),
|
|
2855
2885
|
_: 1
|
|
2856
2886
|
}, 8, ["disabled", "model-value"])) : ie("", !0), h(n).isV4 ? ie("", !0) : (F(), j(q, {
|
|
2857
2887
|
key: 1,
|
|
2858
2888
|
"model-value": g.form.category,
|
|
2859
|
-
rules: [(
|
|
2860
|
-
"onUpdate:modelValue": C[
|
|
2889
|
+
rules: [(ne) => !ne && !g.isOverride ? "Category is required" : !0],
|
|
2890
|
+
"onUpdate:modelValue": C[7] || (C[7] = (ne) => c("update:form", "category", ne))
|
|
2861
2891
|
}, {
|
|
2862
2892
|
default: P(() => [b(U, {
|
|
2863
2893
|
multiple: !1
|
|
@@ -2867,36 +2897,36 @@ const Ga = /* @__PURE__ */ me({
|
|
|
2867
2897
|
_: 1
|
|
2868
2898
|
}, 8, ["label"]), h(n).isV4 && !g.isAddon ? (F(), j(Ye, {
|
|
2869
2899
|
key: 0,
|
|
2870
|
-
label: h(
|
|
2900
|
+
label: h(I)("menu.product.form.detail.path.label")
|
|
2871
2901
|
}, {
|
|
2872
2902
|
default: P(() => [V("div", Ba, [b(Fa, {
|
|
2873
2903
|
modelValue: $.value,
|
|
2874
|
-
"onUpdate:modelValue": C[
|
|
2875
|
-
items:
|
|
2876
|
-
placeholder: h(
|
|
2877
|
-
disabled: !
|
|
2904
|
+
"onUpdate:modelValue": C[8] || (C[8] = (ne) => $.value = ne),
|
|
2905
|
+
items: R.value,
|
|
2906
|
+
placeholder: h(I)("menu.product.form.detail.path.placeholder"),
|
|
2907
|
+
disabled: !m.value.category,
|
|
2878
2908
|
"is-local-only": !1
|
|
2879
2909
|
}, null, 8, ["modelValue", "items", "placeholder", "disabled"])])]),
|
|
2880
2910
|
_: 1
|
|
2881
2911
|
}, 8, ["label"])) : ie("", !0), V("div", La, [b(Z, {
|
|
2882
2912
|
label: "Shelf Life (mins)",
|
|
2883
2913
|
"model-value": g.form.shelfLife ?? null,
|
|
2884
|
-
"onUpdate:modelValue": C[
|
|
2914
|
+
"onUpdate:modelValue": C[9] || (C[9] = (ne) => ne && c("update:form", "shelfLife", ne))
|
|
2885
2915
|
}, null, 8, ["model-value"])]), b(ei, {
|
|
2886
|
-
disabled: !
|
|
2916
|
+
disabled: !m.value.orderFrom,
|
|
2887
2917
|
"model-value": g.form.orderFrom,
|
|
2888
|
-
"order-from-none":
|
|
2889
|
-
required:
|
|
2890
|
-
"default-label": h(
|
|
2891
|
-
label: h(
|
|
2892
|
-
"onUpdate:modelValue": C[
|
|
2918
|
+
"order-from-none": m.value.orderFromNone,
|
|
2919
|
+
required: m.value.orderFrom,
|
|
2920
|
+
"default-label": h(I)("menu.product.form.detail.order_from.default"),
|
|
2921
|
+
label: h(I)("menu.product.form.detail.order_from.label"),
|
|
2922
|
+
"onUpdate:modelValue": C[10] || (C[10] = (ne) => ne && c("update:form", "orderFrom", ne))
|
|
2893
2923
|
}, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
|
|
2894
2924
|
}),
|
|
2895
2925
|
_: 1
|
|
2896
2926
|
}, 8, ["title"]);
|
|
2897
2927
|
};
|
|
2898
2928
|
}
|
|
2899
|
-
}), Ka = /* @__PURE__ */ it(Ga, [["__scopeId", "data-v-
|
|
2929
|
+
}), Ka = /* @__PURE__ */ it(Ga, [["__scopeId", "data-v-8bd8a216"]]), ja = {}, Wa = { class: "overflow-x-auto" }, Ya = { class: "xs:w-[600px]" };
|
|
2900
2930
|
function Ha(e, i) {
|
|
2901
2931
|
return F(), te("div", Wa, [
|
|
2902
2932
|
V("div", Ya, [
|
|
@@ -2908,28 +2938,28 @@ const dn = /* @__PURE__ */ it(ja, [["render", Ha]]), Xa = /* @__PURE__ */ me({
|
|
|
2908
2938
|
__name: "AddForm",
|
|
2909
2939
|
setup(e) {
|
|
2910
2940
|
const i = be(), t = O(() => i.rules.group), n = O(() => !!i.state.currentCatalogId || !!i.state.currentSchedulerId), a = O(() => {
|
|
2911
|
-
const s = !i.state.currentSchedulerId, u = i.rules.group.type,
|
|
2941
|
+
const s = !i.state.currentSchedulerId, u = i.rules.group.type, d = i.version === G.F_MENU_VERSION.enum.v3, c = i.rules.item.orderFromActiveOnly, m = i.rules.item.bindToVariant;
|
|
2912
2942
|
return function(v) {
|
|
2913
2943
|
return {
|
|
2914
|
-
link: (y) => !n.value && (!y ||
|
|
2944
|
+
link: (y) => !n.value && (!y || m),
|
|
2915
2945
|
name: (y) => !n.value && !y,
|
|
2916
2946
|
isDefault: (y) => !n.value,
|
|
2917
2947
|
type: u && !v._id && !n.value,
|
|
2918
2948
|
price: v.type !== G.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
2919
2949
|
priceEdit: !0,
|
|
2920
2950
|
priceTier: i.isV4,
|
|
2921
|
-
inventory: s ?
|
|
2922
|
-
orderFrom: (y) => s ?
|
|
2951
|
+
inventory: s ? d ? !n.value && v.type === G.F_ADDON_GROUP_TYPE.enum.NORMAL : !n.value : !1,
|
|
2952
|
+
orderFrom: (y) => s ? d ? v.type === G.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? n.value : !!n.value == !y : n.value : !1,
|
|
2923
2953
|
orderFromActiveOnly: c,
|
|
2924
|
-
showOrderFrom: s ?
|
|
2925
|
-
bindToVariant:
|
|
2954
|
+
showOrderFrom: s ? d ? n.value ? !0 : v.type === G.F_ADDON_GROUP_TYPE.enum.PRODUCT : n.value : !1,
|
|
2955
|
+
bindToVariant: m,
|
|
2926
2956
|
isOverride: n.value,
|
|
2927
2957
|
isItemGroup: !1,
|
|
2928
|
-
isV4: !
|
|
2958
|
+
isV4: !d
|
|
2929
2959
|
};
|
|
2930
2960
|
};
|
|
2931
2961
|
}), o = () => ({
|
|
2932
|
-
...
|
|
2962
|
+
...ze.generator.initMenuV4Group(),
|
|
2933
2963
|
type: i.version === G.F_MENU_VERSION.enum.v4 ? G.F_ADDON_GROUP_TYPE.enum.PRODUCT : G.F_ADDON_GROUP_TYPE.enum.NORMAL,
|
|
2934
2964
|
items: {},
|
|
2935
2965
|
position: i.groups.length - 1,
|
|
@@ -2940,15 +2970,15 @@ const dn = /* @__PURE__ */ it(ja, [["render", Ha]]), Xa = /* @__PURE__ */ me({
|
|
|
2940
2970
|
"categorized-items": h(i).categorizedItems,
|
|
2941
2971
|
config: a.value,
|
|
2942
2972
|
group: r.value,
|
|
2943
|
-
"onUpdate:group": u[0] || (u[0] = (
|
|
2944
|
-
"onStatus:show": u[1] || (u[1] = (
|
|
2945
|
-
|
|
2973
|
+
"onUpdate:group": u[0] || (u[0] = (d) => r.value = d),
|
|
2974
|
+
"onStatus:show": u[1] || (u[1] = (d) => {
|
|
2975
|
+
d || (r.value = o());
|
|
2946
2976
|
}),
|
|
2947
2977
|
action: "add",
|
|
2948
2978
|
title: h(l)("menu.group.add")
|
|
2949
2979
|
}, {
|
|
2950
|
-
default: P(({ trigger:
|
|
2951
|
-
ve(s.$slots, "default", { trigger:
|
|
2980
|
+
default: P(({ trigger: d }) => [
|
|
2981
|
+
ve(s.$slots, "default", { trigger: d })
|
|
2952
2982
|
]),
|
|
2953
2983
|
_: 3
|
|
2954
2984
|
}, 8, ["categorized-items", "config", "group", "title"])) : ie("", !0);
|
|
@@ -2984,13 +3014,13 @@ const Ja = /* @__PURE__ */ it(qa, [["render", Qa]]), er = { class: "fm-typo-en-t
|
|
|
2984
3014
|
return;
|
|
2985
3015
|
l("update:inventory", r.value), o(!1);
|
|
2986
3016
|
}
|
|
2987
|
-
|
|
3017
|
+
Re(
|
|
2988
3018
|
() => a.value,
|
|
2989
3019
|
(p) => {
|
|
2990
|
-
p && (r.value = ue(n.initialValue),
|
|
3020
|
+
p && (r.value = ue(n.initialValue), m.readInventory());
|
|
2991
3021
|
}
|
|
2992
3022
|
), i({ getKey: () => n.bindingKey, trigger: o });
|
|
2993
|
-
const { t: c } = he(),
|
|
3023
|
+
const { t: c } = he(), m = Ni();
|
|
2994
3024
|
return (p, v) => {
|
|
2995
3025
|
const y = N("fm-text-field"), _ = N("fm-card"), S = N("fm-button"), f = N("fm-side-sheet");
|
|
2996
3026
|
return F(), te(Ae, null, [
|
|
@@ -2998,9 +3028,9 @@ const Ja = /* @__PURE__ */ it(qa, [["render", Qa]]), er = { class: "fm-typo-en-t
|
|
|
2998
3028
|
b(f, {
|
|
2999
3029
|
id: "inventory-form",
|
|
3000
3030
|
modelValue: a.value,
|
|
3001
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
3031
|
+
"onUpdate:modelValue": v[2] || (v[2] = (x) => a.value = x),
|
|
3002
3032
|
"close-button": !1,
|
|
3003
|
-
"is-container": h(
|
|
3033
|
+
"is-container": h(xe).FmForm,
|
|
3004
3034
|
"is-container-props": {
|
|
3005
3035
|
onValidationSuccess: u,
|
|
3006
3036
|
blameFormChildOnValidationFailed: !0
|
|
@@ -3039,9 +3069,9 @@ const Ja = /* @__PURE__ */ it(qa, [["render", Qa]]), er = { class: "fm-typo-en-t
|
|
|
3039
3069
|
variant: "outlined"
|
|
3040
3070
|
}, {
|
|
3041
3071
|
default: P(() => [
|
|
3042
|
-
b(h(
|
|
3072
|
+
b(h(Yn), {
|
|
3043
3073
|
modelValue: r.value,
|
|
3044
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
3074
|
+
"onUpdate:modelValue": v[0] || (v[0] = (x) => r.value = x)
|
|
3045
3075
|
}, null, 8, ["modelValue"])
|
|
3046
3076
|
]),
|
|
3047
3077
|
_: 1
|
|
@@ -3055,7 +3085,7 @@ const Ja = /* @__PURE__ */ it(qa, [["render", Qa]]), er = { class: "fm-typo-en-t
|
|
|
3055
3085
|
}
|
|
3056
3086
|
}), Wt = nr;
|
|
3057
3087
|
function or() {
|
|
3058
|
-
const e =
|
|
3088
|
+
const e = Ii();
|
|
3059
3089
|
function i({
|
|
3060
3090
|
component: t,
|
|
3061
3091
|
props: n
|
|
@@ -3065,25 +3095,25 @@ function or() {
|
|
|
3065
3095
|
const a = document.createElement("div");
|
|
3066
3096
|
document.body.appendChild(a);
|
|
3067
3097
|
const o = bn(t), r = async () => {
|
|
3068
|
-
await new Promise((
|
|
3098
|
+
await new Promise((m) => setTimeout(m, 500)), Vt(null, a), a.remove();
|
|
3069
3099
|
};
|
|
3070
3100
|
let l, s;
|
|
3071
|
-
const u = (
|
|
3072
|
-
l =
|
|
3073
|
-
},
|
|
3074
|
-
s =
|
|
3101
|
+
const u = (m) => {
|
|
3102
|
+
l = m;
|
|
3103
|
+
}, d = (m) => {
|
|
3104
|
+
s = m;
|
|
3075
3105
|
}, c = b(o, {
|
|
3076
3106
|
...n,
|
|
3077
3107
|
// close event from the component
|
|
3078
|
-
"onUpdate:show": (
|
|
3079
|
-
|
|
3108
|
+
"onUpdate:show": (m) => {
|
|
3109
|
+
m || (r(), s == null || s());
|
|
3080
3110
|
},
|
|
3081
3111
|
// submit event from the component
|
|
3082
|
-
onSubmit: (
|
|
3083
|
-
l == null || l(
|
|
3112
|
+
onSubmit: (m) => {
|
|
3113
|
+
l == null || l(m);
|
|
3084
3114
|
}
|
|
3085
3115
|
});
|
|
3086
|
-
return c.appContext = e.appContext, Vt(c, a), { instance: c, close: r, onOk: u, onCancel:
|
|
3116
|
+
return c.appContext = e.appContext, Vt(c, a), { instance: c, close: r, onOk: u, onCancel: d };
|
|
3087
3117
|
}
|
|
3088
3118
|
return {
|
|
3089
3119
|
open: i
|
|
@@ -3125,14 +3155,14 @@ const mn = /* @__PURE__ */ me({
|
|
|
3125
3155
|
header: i("menu.price_tier.form.table.columns.price"),
|
|
3126
3156
|
accessorKey: "price",
|
|
3127
3157
|
cell: (r) => {
|
|
3128
|
-
var u,
|
|
3158
|
+
var u, d;
|
|
3129
3159
|
const l = (u = t.fallback) == null ? void 0 : u[r.row.original.key], s = l ? ot(l) : void 0;
|
|
3130
3160
|
return b(et, {
|
|
3131
3161
|
required: !1,
|
|
3132
3162
|
nullable: !0,
|
|
3133
3163
|
min: t.allowNegativePrice ? void 0 : 0,
|
|
3134
3164
|
placeholder: s,
|
|
3135
|
-
"model-value": (
|
|
3165
|
+
"model-value": (d = n.value) == null ? void 0 : d[r.row.original.key],
|
|
3136
3166
|
"onUpdate:model-value": (c) => a(r.row.original.key, c)
|
|
3137
3167
|
}, null);
|
|
3138
3168
|
},
|
|
@@ -3159,14 +3189,14 @@ const mn = /* @__PURE__ */ me({
|
|
|
3159
3189
|
setup(e, { emit: i }) {
|
|
3160
3190
|
const { t } = he(), n = i, a = ee(!0), o = () => {
|
|
3161
3191
|
a.value = !1, n("update:show", !1);
|
|
3162
|
-
}, r = O(() => t("menu.price_tier.price_tier_config")), l = O(() => t("common.update")), s = e, u = Bi(s.menuStore),
|
|
3163
|
-
() => !Ve.isEqual(s.initialValue || {},
|
|
3192
|
+
}, r = O(() => t("menu.price_tier.price_tier_config")), l = O(() => t("common.update")), s = e, u = Bi(s.menuStore), d = ee(s.initialValue ? Xn(s.initialValue) : {}), c = Ht(
|
|
3193
|
+
() => !Ve.isEqual(s.initialValue || {}, d.value),
|
|
3164
3194
|
() => {
|
|
3165
3195
|
o();
|
|
3166
3196
|
}
|
|
3167
3197
|
);
|
|
3168
|
-
function
|
|
3169
|
-
n("submit",
|
|
3198
|
+
function m() {
|
|
3199
|
+
n("submit", d.value), o();
|
|
3170
3200
|
}
|
|
3171
3201
|
return (p, v) => {
|
|
3172
3202
|
const y = N("FmButton"), _ = N("fm-button"), S = N("FmSideSheet");
|
|
@@ -3174,9 +3204,9 @@ const mn = /* @__PURE__ */ me({
|
|
|
3174
3204
|
id: "business-form",
|
|
3175
3205
|
modelValue: a.value,
|
|
3176
3206
|
"onUpdate:modelValue": v[1] || (v[1] = (f) => a.value = f),
|
|
3177
|
-
"is-container": h(
|
|
3207
|
+
"is-container": h(xe).FmForm,
|
|
3178
3208
|
"is-container-props": {
|
|
3179
|
-
onValidationSuccess:
|
|
3209
|
+
onValidationSuccess: m,
|
|
3180
3210
|
blameFormChildOnValidationFailed: !0
|
|
3181
3211
|
},
|
|
3182
3212
|
"max-width": 560,
|
|
@@ -3219,9 +3249,9 @@ const mn = /* @__PURE__ */ me({
|
|
|
3219
3249
|
default: P(() => [
|
|
3220
3250
|
b(mn, {
|
|
3221
3251
|
"price-tiers": h(u).priceTiers.value,
|
|
3222
|
-
"model-value":
|
|
3252
|
+
"model-value": d.value,
|
|
3223
3253
|
fallback: p.fallback,
|
|
3224
|
-
"onUpdate:modelValue": v[0] || (v[0] = (f) =>
|
|
3254
|
+
"onUpdate:modelValue": v[0] || (v[0] = (f) => d.value = f)
|
|
3225
3255
|
}, null, 8, ["price-tiers", "model-value", "fallback"])
|
|
3226
3256
|
]),
|
|
3227
3257
|
_: 1
|
|
@@ -3257,7 +3287,7 @@ const mn = /* @__PURE__ */ me({
|
|
|
3257
3287
|
}
|
|
3258
3288
|
const { t: l } = he();
|
|
3259
3289
|
return (s, u) => {
|
|
3260
|
-
const
|
|
3290
|
+
const d = N("FmButton"), c = N("FmTooltip");
|
|
3261
3291
|
return s.$slots.default ? ve(s.$slots, "default", { key: 0 }) : (F(), j(c, {
|
|
3262
3292
|
key: 1,
|
|
3263
3293
|
content: h(l)("menu.price_tier.price_tier_config"),
|
|
@@ -3265,7 +3295,7 @@ const mn = /* @__PURE__ */ me({
|
|
|
3265
3295
|
placement: "top"
|
|
3266
3296
|
}, {
|
|
3267
3297
|
default: P(() => [
|
|
3268
|
-
b(
|
|
3298
|
+
b(d, {
|
|
3269
3299
|
icon: "price_change",
|
|
3270
3300
|
variant: "tertiary",
|
|
3271
3301
|
"text-color": h(Ke).NeutralGray400,
|
|
@@ -3302,16 +3332,16 @@ const mn = /* @__PURE__ */ me({
|
|
|
3302
3332
|
}) {
|
|
3303
3333
|
const t = e, n = i;
|
|
3304
3334
|
Ee();
|
|
3305
|
-
const a = mt(), o = be(), r = O(() =>
|
|
3335
|
+
const a = mt(), o = be(), r = O(() => ke.Country.getCountry(a.currentCountry.value)), l = ee(!1), s = O(() => t.config.isV4 || t.group.type === G.F_ADDON_GROUP_TYPE.enum.PRODUCT), u = O(() => s.value), d = O(() => s.value), c = O(() => Object.values(t.group.items).flatMap((E) => [{
|
|
3306
3336
|
_id: E._id,
|
|
3307
3337
|
combinationKey: void 0
|
|
3308
3338
|
}, ...(E.items ?? []).filter((D) => D.orderFrom !== G.F_ORDER_FROM.enum.NONE).map((D) => ({
|
|
3309
3339
|
_id: D._id,
|
|
3310
3340
|
combinationKey: D.combinationKey
|
|
3311
3341
|
}))])), {
|
|
3312
|
-
searchKey:
|
|
3342
|
+
searchKey: m,
|
|
3313
3343
|
filter: p
|
|
3314
|
-
} =
|
|
3344
|
+
} = qn(), v = O(() => {
|
|
3315
3345
|
const E = Object.entries(t.group.items).filter(([, D]) => p([D.code || "", D.name || D.fallbackName, S(D.price ?? D.fallbackPrice), f(D.orderFrom || D.fallbackOrder), ...(D.items || []).map((Y) => [Y.code || "", Y.name || Y.fallbackName, S(Y.price ?? Y.fallbackPrice), f(Y.orderFrom || Y.fallbackOrder)].join(""))]));
|
|
3316
3346
|
return Object.fromEntries(E);
|
|
3317
3347
|
}), y = (E) => ({
|
|
@@ -3323,7 +3353,7 @@ const mn = /* @__PURE__ */ me({
|
|
|
3323
3353
|
}), _ = O(() => !0), S = (E) => E ? ot(E, !1) : "", f = (E) => {
|
|
3324
3354
|
var D;
|
|
3325
3355
|
return E == null ? "" : (D = Mn()[E]) == null ? void 0 : D.label;
|
|
3326
|
-
},
|
|
3356
|
+
}, x = O(() => Object.values(v.value)), K = ee({}), {
|
|
3327
3357
|
t: U
|
|
3328
3358
|
} = he(), L = ee([{
|
|
3329
3359
|
accessorKey: "isDefault",
|
|
@@ -3331,22 +3361,22 @@ const mn = /* @__PURE__ */ me({
|
|
|
3331
3361
|
enableSorting: !1,
|
|
3332
3362
|
size: 75,
|
|
3333
3363
|
cell: (E) => {
|
|
3334
|
-
var X,
|
|
3335
|
-
if ((
|
|
3364
|
+
var X, oe;
|
|
3365
|
+
if ((oe = (X = E.row.original) == null ? void 0 : X.items) != null && oe.length)
|
|
3336
3366
|
return null;
|
|
3337
3367
|
const D = E.row.depth > 0, Y = E.row.original, q = !y(Y.combinationKey).isDefault || Y.orderFrom === G.F_ORDER_FROM.enum.NONE, Z = !!E.getValue();
|
|
3338
|
-
return b(
|
|
3368
|
+
return b(xe.FmCheckbox, {
|
|
3339
3369
|
value: "default",
|
|
3340
3370
|
modelValue: Z,
|
|
3341
3371
|
disabled: q,
|
|
3342
3372
|
"onUpdate:modelValue": (ce) => {
|
|
3343
|
-
var
|
|
3373
|
+
var ne;
|
|
3344
3374
|
if (D) {
|
|
3345
|
-
const Le = (
|
|
3375
|
+
const Le = (ne = E.row.getParentRow()) == null ? void 0 : ne.original;
|
|
3346
3376
|
if (!Le) return;
|
|
3347
3377
|
w(Le._id, Y.combinationKey ?? "", "isDefault", ce);
|
|
3348
3378
|
} else
|
|
3349
|
-
|
|
3379
|
+
z(Y._id, "isDefault", ce);
|
|
3350
3380
|
}
|
|
3351
3381
|
}, null);
|
|
3352
3382
|
}
|
|
@@ -3357,7 +3387,7 @@ const mn = /* @__PURE__ */ me({
|
|
|
3357
3387
|
size: 100,
|
|
3358
3388
|
cell: (E) => {
|
|
3359
3389
|
const D = E.getValue();
|
|
3360
|
-
return b(
|
|
3390
|
+
return b(xe.FmTooltip, {
|
|
3361
3391
|
class: "flex",
|
|
3362
3392
|
content: D,
|
|
3363
3393
|
zIndex: 110
|
|
@@ -3373,25 +3403,25 @@ const mn = /* @__PURE__ */ me({
|
|
|
3373
3403
|
enableSorting: !1,
|
|
3374
3404
|
cell: (E) => {
|
|
3375
3405
|
const D = E.getValue(), Y = E.row.original, q = !y(Y.combinationKey).name || Y.orderFrom === G.F_ORDER_FROM.enum.NONE, Z = E.row.depth > 0, X = Y.combinationKey ? Ui(Y.combinationKey, be().variants) : null;
|
|
3376
|
-
return Se("div", Se(
|
|
3406
|
+
return Se("div", Se(xe.FmTextField, {
|
|
3377
3407
|
modelValue: D,
|
|
3378
3408
|
placeholder: X ?? "",
|
|
3379
3409
|
disabled: q,
|
|
3380
|
-
rules: X ? void 0 : [(
|
|
3381
|
-
"onUpdate:modelValue": (
|
|
3410
|
+
rules: X ? void 0 : [(oe) => oe.length > 0 || U("menu.group.option.product_title_required")],
|
|
3411
|
+
"onUpdate:modelValue": (oe) => {
|
|
3382
3412
|
var ce;
|
|
3383
3413
|
if (Z) {
|
|
3384
|
-
const
|
|
3385
|
-
if (!
|
|
3386
|
-
w(
|
|
3414
|
+
const ne = (ce = E.row.getParentRow()) == null ? void 0 : ce.original;
|
|
3415
|
+
if (!ne) return;
|
|
3416
|
+
w(ne._id, Y.combinationKey ?? "", "name", oe);
|
|
3387
3417
|
} else
|
|
3388
|
-
|
|
3418
|
+
z(Y._id, "name", oe);
|
|
3389
3419
|
},
|
|
3390
3420
|
class: "min-w-[300px]"
|
|
3391
3421
|
}, {
|
|
3392
3422
|
append: () => {
|
|
3393
|
-
var
|
|
3394
|
-
return (ce = (
|
|
3423
|
+
var oe, ce;
|
|
3424
|
+
return (ce = (oe = E.row.original) == null ? void 0 : oe.items) != null && ce.length ? Se(xe.FmIcon, {
|
|
3395
3425
|
name: "keyboard_arrow_up",
|
|
3396
3426
|
onClick: E.row.getToggleExpandedHandler(),
|
|
3397
3427
|
class: ["cursor-pointer", "transition-transform", E.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
@@ -3419,20 +3449,20 @@ const mn = /* @__PURE__ */ me({
|
|
|
3419
3449
|
required: !Z && !q,
|
|
3420
3450
|
nullable: !!Z,
|
|
3421
3451
|
min: _.value ? void 0 : 0,
|
|
3422
|
-
"onUpdate:modelValue": (
|
|
3452
|
+
"onUpdate:modelValue": (oe) => {
|
|
3423
3453
|
var ce;
|
|
3424
3454
|
if (X) {
|
|
3425
|
-
const
|
|
3426
|
-
if (!
|
|
3455
|
+
const ne = (ce = E.row.getParentRow()) == null ? void 0 : ce.original;
|
|
3456
|
+
if (!ne) return;
|
|
3427
3457
|
w(
|
|
3428
|
-
|
|
3458
|
+
ne._id,
|
|
3429
3459
|
Y.combinationKey ?? "",
|
|
3430
3460
|
// @ts-ignore
|
|
3431
3461
|
"price",
|
|
3432
|
-
|
|
3462
|
+
oe
|
|
3433
3463
|
);
|
|
3434
3464
|
} else
|
|
3435
|
-
|
|
3465
|
+
z(Y._id, "price", oe);
|
|
3436
3466
|
},
|
|
3437
3467
|
showCurrency: !1,
|
|
3438
3468
|
class: "min-w-[88px]"
|
|
@@ -3452,9 +3482,9 @@ const mn = /* @__PURE__ */ me({
|
|
|
3452
3482
|
required: !0,
|
|
3453
3483
|
editActiveOnly: y(Y.combinationKey).orderFromActiveOnly,
|
|
3454
3484
|
"onUpdate:modelValue": (X) => {
|
|
3455
|
-
var
|
|
3485
|
+
var oe;
|
|
3456
3486
|
if (Z) {
|
|
3457
|
-
const ce = (
|
|
3487
|
+
const ce = (oe = E.row.getParentRow()) == null ? void 0 : oe.original;
|
|
3458
3488
|
if (!ce) return;
|
|
3459
3489
|
w(
|
|
3460
3490
|
ce._id,
|
|
@@ -3464,7 +3494,7 @@ const mn = /* @__PURE__ */ me({
|
|
|
3464
3494
|
X
|
|
3465
3495
|
);
|
|
3466
3496
|
} else
|
|
3467
|
-
|
|
3497
|
+
z(Y._id, "orderFrom", X);
|
|
3468
3498
|
},
|
|
3469
3499
|
label: "",
|
|
3470
3500
|
menuZIndex: 101
|
|
@@ -3488,17 +3518,17 @@ const mn = /* @__PURE__ */ me({
|
|
|
3488
3518
|
"onUpdate:priceTiers": (Z) => {
|
|
3489
3519
|
var X;
|
|
3490
3520
|
if (q) {
|
|
3491
|
-
const
|
|
3492
|
-
if (!
|
|
3521
|
+
const oe = (X = E.row.getParentRow()) == null ? void 0 : X.original;
|
|
3522
|
+
if (!oe) return;
|
|
3493
3523
|
w(
|
|
3494
|
-
|
|
3524
|
+
oe._id,
|
|
3495
3525
|
D.combinationKey ?? "",
|
|
3496
3526
|
// @ts-ignore
|
|
3497
3527
|
"priceTiers",
|
|
3498
3528
|
Z
|
|
3499
3529
|
);
|
|
3500
3530
|
} else
|
|
3501
|
-
|
|
3531
|
+
z(D._id, "priceTiers", Z);
|
|
3502
3532
|
}
|
|
3503
3533
|
}, null), y(D.combinationKey).inventory && b(Wt, {
|
|
3504
3534
|
title: "Inventory",
|
|
@@ -3508,17 +3538,17 @@ const mn = /* @__PURE__ */ me({
|
|
|
3508
3538
|
"onUpdate:inventory": (Z) => {
|
|
3509
3539
|
var X;
|
|
3510
3540
|
if (q) {
|
|
3511
|
-
const
|
|
3512
|
-
if (!
|
|
3541
|
+
const oe = (X = E.row.getParentRow()) == null ? void 0 : X.original;
|
|
3542
|
+
if (!oe) return;
|
|
3513
3543
|
w(
|
|
3514
|
-
|
|
3544
|
+
oe._id,
|
|
3515
3545
|
D.combinationKey ?? "",
|
|
3516
3546
|
// @ts-ignore
|
|
3517
3547
|
"inventoryBindings",
|
|
3518
3548
|
Z
|
|
3519
3549
|
);
|
|
3520
3550
|
} else
|
|
3521
|
-
|
|
3551
|
+
z(D._id, "inventoryBindings", Z);
|
|
3522
3552
|
}
|
|
3523
3553
|
}, {
|
|
3524
3554
|
default: ({
|
|
@@ -3550,7 +3580,7 @@ const mn = /* @__PURE__ */ me({
|
|
|
3550
3580
|
}, null)]);
|
|
3551
3581
|
}
|
|
3552
3582
|
}]), M = O(() => ({
|
|
3553
|
-
code:
|
|
3583
|
+
code: d.value,
|
|
3554
3584
|
name: !0,
|
|
3555
3585
|
price: y(null).price,
|
|
3556
3586
|
orderFrom: y(null).showOrderFrom
|
|
@@ -3566,7 +3596,7 @@ const mn = /* @__PURE__ */ me({
|
|
|
3566
3596
|
_id: E,
|
|
3567
3597
|
name: "",
|
|
3568
3598
|
inventoryBindings: [],
|
|
3569
|
-
price:
|
|
3599
|
+
price: ke.Dinero.zero().toObject(),
|
|
3570
3600
|
isDynamicAddon: t.group.type === G.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
3571
3601
|
items: [],
|
|
3572
3602
|
orderFrom: G.F_ORDER_FROM.enum.ALL
|
|
@@ -3574,13 +3604,13 @@ const mn = /* @__PURE__ */ me({
|
|
|
3574
3604
|
}
|
|
3575
3605
|
});
|
|
3576
3606
|
}
|
|
3577
|
-
function
|
|
3607
|
+
function z(E, D, Y) {
|
|
3578
3608
|
const q = t.group.items[E];
|
|
3579
3609
|
if (!q) return;
|
|
3580
3610
|
const Z = {
|
|
3581
3611
|
...q
|
|
3582
3612
|
};
|
|
3583
|
-
D === "price" ? Z[D] = !Y && !q.fallbackPrice ?
|
|
3613
|
+
D === "price" ? Z[D] = !Y && !q.fallbackPrice ? ke.Dinero.zero().toObject() : Y : Z[D] = Y, n("update:group", {
|
|
3584
3614
|
...t.group,
|
|
3585
3615
|
items: {
|
|
3586
3616
|
...t.group.items,
|
|
@@ -3589,45 +3619,45 @@ const mn = /* @__PURE__ */ me({
|
|
|
3589
3619
|
});
|
|
3590
3620
|
}
|
|
3591
3621
|
function w(E, D, Y, q) {
|
|
3592
|
-
var ce,
|
|
3622
|
+
var ce, ne;
|
|
3593
3623
|
const Z = ue(t.group), X = (ce = Z.items[E].items) == null ? void 0 : ce.findIndex((Le) => Le.combinationKey === D);
|
|
3594
3624
|
if (!pt.isSet(X)) return;
|
|
3595
|
-
let
|
|
3596
|
-
|
|
3597
|
-
...
|
|
3625
|
+
let oe = (ne = Z.items[E].items) == null ? void 0 : ne[X];
|
|
3626
|
+
oe && (oe = {
|
|
3627
|
+
...oe,
|
|
3598
3628
|
[Y]: q
|
|
3599
|
-
}, Z.items[E].items[X] =
|
|
3629
|
+
}, Z.items[E].items[X] = oe, n("update:group", Z));
|
|
3600
3630
|
}
|
|
3601
3631
|
function A(E) {
|
|
3602
3632
|
const D = ue(t.group);
|
|
3603
3633
|
delete D.items[E], n("update:group", D);
|
|
3604
3634
|
}
|
|
3605
|
-
const
|
|
3635
|
+
const k = O(() => t.categorizedItems.flatMap((E) => E.items).reduce((E, D) => {
|
|
3606
3636
|
var Y;
|
|
3607
3637
|
return E[D._id] = {
|
|
3608
3638
|
price: D.price,
|
|
3609
3639
|
variants: Fn(((Y = D.variant) == null ? void 0 : Y.variantCombinations) || [], "combinationKey")
|
|
3610
3640
|
}, E;
|
|
3611
|
-
}, {})),
|
|
3641
|
+
}, {})), R = (E) => {
|
|
3612
3642
|
var Z, X;
|
|
3613
|
-
const Y = o.state.menu.modules.item.find((
|
|
3614
|
-
...(Z = Y == null ? void 0 : Y.variant) == null ? void 0 : Z.variantCombinations.find((
|
|
3643
|
+
const Y = o.state.menu.modules.item.find((oe) => oe._id === E._id), q = E.combinationKey ? {
|
|
3644
|
+
...(Z = Y == null ? void 0 : Y.variant) == null ? void 0 : Z.variantCombinations.find((oe) => oe.combinationKey === E.combinationKey),
|
|
3615
3645
|
name: Ei(be().variants, ((X = Y == null ? void 0 : Y.variant) == null ? void 0 : X.variantGroupIds) || [])[E.combinationKey]
|
|
3616
3646
|
} : Y;
|
|
3617
3647
|
return q == null ? void 0 : q.name;
|
|
3618
3648
|
}, $ = O(() => o.state.menu.modules.item.reduce((E, D) => (E[D._id] = D, E), {}));
|
|
3619
|
-
function
|
|
3649
|
+
function I(E) {
|
|
3620
3650
|
const D = [], Y = new Set(E.filter((q) => q.combinationKey).map((q) => `${q._id}:${q.combinationKey}`));
|
|
3621
3651
|
return E.forEach((q) => {
|
|
3622
|
-
var
|
|
3652
|
+
var oe;
|
|
3623
3653
|
if (q.combinationKey)
|
|
3624
3654
|
return;
|
|
3625
3655
|
D.push(q);
|
|
3626
3656
|
const Z = $.value[q._id];
|
|
3627
|
-
if (!Z || !Z.variant || ((
|
|
3657
|
+
if (!Z || !Z.variant || ((oe = Z.variant.variantCombinations) == null ? void 0 : oe.length) === 0)
|
|
3628
3658
|
return;
|
|
3629
3659
|
(Z.variant.variantCombinations || []).forEach((ce) => {
|
|
3630
|
-
const
|
|
3660
|
+
const ne = `${ce._id}:${ce.combinationKey}`, Le = !Y.has(ne);
|
|
3631
3661
|
D.push({
|
|
3632
3662
|
_id: ce._id,
|
|
3633
3663
|
combinationKey: ce.combinationKey,
|
|
@@ -3638,16 +3668,16 @@ const mn = /* @__PURE__ */ me({
|
|
|
3638
3668
|
}
|
|
3639
3669
|
const g = async (E) => {
|
|
3640
3670
|
let D = Xt(t.group);
|
|
3641
|
-
const Y =
|
|
3671
|
+
const Y = I(E);
|
|
3642
3672
|
D = {
|
|
3643
3673
|
...D,
|
|
3644
3674
|
items: Y.map((q) => {
|
|
3645
|
-
const Z = D.items.find((
|
|
3675
|
+
const Z = D.items.find((oe) => oe._id == q._id && oe.combinationKey == q.combinationKey);
|
|
3646
3676
|
q.orderFrom && Z && (Z.orderFrom = q.orderFrom);
|
|
3647
|
-
const X =
|
|
3677
|
+
const X = k.value[q._id];
|
|
3648
3678
|
return Z || {
|
|
3649
3679
|
...q,
|
|
3650
|
-
name:
|
|
3680
|
+
name: R(q),
|
|
3651
3681
|
price: q.combinationKey ? X.variants[q.combinationKey || ""].price : X.price,
|
|
3652
3682
|
orderFrom: q.orderFrom ?? G.F_ORDER_FROM.enum.ALL
|
|
3653
3683
|
};
|
|
@@ -3670,7 +3700,7 @@ const mn = /* @__PURE__ */ me({
|
|
|
3670
3700
|
}, {
|
|
3671
3701
|
"append-title": P(() => [E.config.link() ? (F(), te(Ae, {
|
|
3672
3702
|
key: 0
|
|
3673
|
-
}, [u.value ? (F(), te("div", ur, [b(
|
|
3703
|
+
}, [u.value ? (F(), te("div", ur, [b(Tn, {
|
|
3674
3704
|
"categorized-items": E.categorizedItems,
|
|
3675
3705
|
"initial-value": c.value,
|
|
3676
3706
|
"show-variant": E.config.bindToVariant,
|
|
@@ -3706,8 +3736,8 @@ const mn = /* @__PURE__ */ me({
|
|
|
3706
3736
|
"expanded-state": l.value ? {} : K.value,
|
|
3707
3737
|
"get-sub-row": C,
|
|
3708
3738
|
"page-size": 999,
|
|
3709
|
-
"row-data":
|
|
3710
|
-
"search-value": h(
|
|
3739
|
+
"row-data": x.value,
|
|
3740
|
+
"search-value": h(m),
|
|
3711
3741
|
"shrink-at": !1,
|
|
3712
3742
|
"hide-footer": "",
|
|
3713
3743
|
"onUpdate:expandedState": D[1] || (D[1] = (Z) => K.value = Z),
|
|
@@ -3794,11 +3824,11 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3794
3824
|
emits: ["update:group", "submit:group", "status:show"],
|
|
3795
3825
|
setup(e, { expose: i, emit: t }) {
|
|
3796
3826
|
let n = e;
|
|
3797
|
-
const a = t, o = be(), r = mt(), l = Ne(), s = Ee(), u = qe(Xe(s)), { countDefaultItems:
|
|
3827
|
+
const a = t, o = be(), r = mt(), l = Ne(), s = Ee(), u = qe(Xe(s)), { countDefaultItems: d, validateGroupItems: c, minMaxValidationRules: m } = hr(
|
|
3798
3828
|
() => n.group
|
|
3799
3829
|
), p = ee(!1), v = ee(!1), y = (g) => {
|
|
3800
3830
|
pt.isBoolean(g) ? v.value = g : v.value = !v.value;
|
|
3801
|
-
}, _ = O(() => n.group ? n.config(n.group) : null), S = O(() => ji(_.value)), f = (g) => S.value.includes(g),
|
|
3831
|
+
}, _ = O(() => n.group ? n.config(n.group) : null), S = O(() => ji(_.value)), f = (g) => S.value.includes(g), x = O(() => [
|
|
3802
3832
|
{
|
|
3803
3833
|
label: "Normal",
|
|
3804
3834
|
value: G.F_ADDON_GROUP_TYPE.enum.NORMAL
|
|
@@ -3847,7 +3877,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3847
3877
|
() => {
|
|
3848
3878
|
v.value = !1;
|
|
3849
3879
|
}
|
|
3850
|
-
),
|
|
3880
|
+
), z = O(() => n.action === "add" ? I("common.add") : I("common.update"));
|
|
3851
3881
|
async function w() {
|
|
3852
3882
|
var g;
|
|
3853
3883
|
if (n.action === "add") {
|
|
@@ -3866,10 +3896,10 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3866
3896
|
await u.updateMenu(ae, C.name), a("submit:group", n.group);
|
|
3867
3897
|
} else if (n.action === "update") {
|
|
3868
3898
|
for (const C of Object.values(((g = n.group) == null ? void 0 : g.items) ?? {}))
|
|
3869
|
-
if (
|
|
3899
|
+
if (Nn(o.state.menu, n.group._id, C._id)) {
|
|
3870
3900
|
s.open({
|
|
3871
3901
|
type: "error",
|
|
3872
|
-
message:
|
|
3902
|
+
message: I("menu.product.form.group.circularError", {
|
|
3873
3903
|
groupName: n.group.name,
|
|
3874
3904
|
productName: C.name
|
|
3875
3905
|
})
|
|
@@ -3880,38 +3910,38 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3880
3910
|
}
|
|
3881
3911
|
y(!1);
|
|
3882
3912
|
}
|
|
3883
|
-
|
|
3913
|
+
Re(
|
|
3884
3914
|
() => v.value,
|
|
3885
3915
|
async (g) => {
|
|
3886
|
-
a("status:show", g), g && (await
|
|
3916
|
+
a("status:show", g), g && (await zi(), M.value = Ve.clone(n.group));
|
|
3887
3917
|
}
|
|
3888
3918
|
);
|
|
3889
3919
|
const A = O(() => {
|
|
3890
3920
|
var g;
|
|
3891
3921
|
return ((g = r.groupAttributeSettings) == null ? void 0 : g.value.length) > 0 && !_.value.isOverride;
|
|
3892
|
-
}),
|
|
3922
|
+
}), k = O(() => {
|
|
3893
3923
|
const g = {};
|
|
3894
3924
|
return o.state.menu.modules.group.forEach((C) => {
|
|
3895
3925
|
var W;
|
|
3896
3926
|
for (const [ae, re] of Object.entries(C.customAttributes || {}))
|
|
3897
3927
|
typeof re == "string" && re && !((W = g[ae]) != null && W.includes(re)) && (g[ae] = [...g[ae] || [], re]);
|
|
3898
3928
|
}), g;
|
|
3899
|
-
}),
|
|
3929
|
+
}), R = (g) => {
|
|
3900
3930
|
n.group && K({
|
|
3901
3931
|
...n.group,
|
|
3902
3932
|
customAttributes: g
|
|
3903
3933
|
});
|
|
3904
3934
|
}, $ = O(() => [
|
|
3905
3935
|
// Required validation
|
|
3906
|
-
(g) => !!g ||
|
|
3936
|
+
(g) => !!g || I("menu.common.validation.required", { field: I("menu.common.labels.group_name") }),
|
|
3907
3937
|
// Duplicate name validation
|
|
3908
|
-
(g) => n.action === "add" ? !o.groups.find((W) => W.name === g) ||
|
|
3938
|
+
(g) => n.action === "add" ? !o.groups.find((W) => W.name === g) || I("menu.group.validation.name_duplicate") : n.action === "update" ? !o.groups.find((W) => W.name === g && W._id !== n.group._id) || I("menu.group.validation.name_duplicate") : !0
|
|
3909
3939
|
]);
|
|
3910
3940
|
i({
|
|
3911
3941
|
trigger: y,
|
|
3912
3942
|
show: v
|
|
3913
3943
|
});
|
|
3914
|
-
const { t:
|
|
3944
|
+
const { t: I } = he();
|
|
3915
3945
|
return (g, C) => {
|
|
3916
3946
|
const W = N("fm-text-field"), ae = N("fm-stepper-field"), re = N("FmFormGroup"), E = N("fm-radio"), D = N("fm-radio-group"), Y = N("fm-switch"), q = N("fm-button"), Z = N("fm-side-sheet");
|
|
3917
3947
|
return F(), te(Ae, null, [
|
|
@@ -3920,7 +3950,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3920
3950
|
id: "group-form",
|
|
3921
3951
|
modelValue: v.value,
|
|
3922
3952
|
"onUpdate:modelValue": C[8] || (C[8] = (X) => v.value = X),
|
|
3923
|
-
"is-container": h(
|
|
3953
|
+
"is-container": h(xe).FmForm,
|
|
3924
3954
|
"is-container-props": {
|
|
3925
3955
|
onValidationSuccess: w,
|
|
3926
3956
|
blameFormChildOnValidationFailed: !0
|
|
@@ -3934,14 +3964,14 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3934
3964
|
"side-sheet-footer": P(() => [
|
|
3935
3965
|
V("div", gr, [
|
|
3936
3966
|
b(q, {
|
|
3937
|
-
label: h(
|
|
3967
|
+
label: h(Zn)(z.value),
|
|
3938
3968
|
loading: p.value,
|
|
3939
3969
|
size: "lg",
|
|
3940
3970
|
type: "submit",
|
|
3941
3971
|
variant: "primary"
|
|
3942
3972
|
}, null, 8, ["label", "loading"]),
|
|
3943
3973
|
b(q, {
|
|
3944
|
-
label: h(
|
|
3974
|
+
label: h(I)("menu.common.actions.cancel"),
|
|
3945
3975
|
size: "lg",
|
|
3946
3976
|
variant: "tertiary",
|
|
3947
3977
|
onClick: C[7] || (C[7] = () => v.value = !1)
|
|
@@ -3951,7 +3981,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3951
3981
|
default: P(() => [
|
|
3952
3982
|
g.group ? (F(), te("div", vr, [
|
|
3953
3983
|
ve(g.$slots, "variant-section"),
|
|
3954
|
-
b(
|
|
3984
|
+
b(Pn, null, {
|
|
3955
3985
|
default: P(() => [
|
|
3956
3986
|
V("div", null, [
|
|
3957
3987
|
b(W, {
|
|
@@ -3960,12 +3990,12 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3960
3990
|
disabled: f("name"),
|
|
3961
3991
|
rules: $.value,
|
|
3962
3992
|
autofocus: "",
|
|
3963
|
-
label: h(
|
|
3993
|
+
label: h(I)("menu.common.labels.group_name")
|
|
3964
3994
|
}, null, 8, ["modelValue", "disabled", "rules", "label"])
|
|
3965
3995
|
]),
|
|
3966
3996
|
b(re, {
|
|
3967
3997
|
"model-value": g.group.min + " " + g.group.max,
|
|
3968
|
-
rules: h(
|
|
3998
|
+
rules: h(m)
|
|
3969
3999
|
}, {
|
|
3970
4000
|
default: P(() => [
|
|
3971
4001
|
b(Ja, null, {
|
|
@@ -3976,7 +4006,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3976
4006
|
disabled: f("min"),
|
|
3977
4007
|
min: 0,
|
|
3978
4008
|
class: "flex-1",
|
|
3979
|
-
label: h(
|
|
4009
|
+
label: h(I)("menu.common.labels.min_select")
|
|
3980
4010
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
3981
4011
|
b(ae, {
|
|
3982
4012
|
modelValue: g.group.max,
|
|
@@ -3984,7 +4014,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3984
4014
|
disabled: f("max"),
|
|
3985
4015
|
min: g.group.min,
|
|
3986
4016
|
class: "flex-1",
|
|
3987
|
-
label: h(
|
|
4017
|
+
label: h(I)("menu.common.labels.max_select")
|
|
3988
4018
|
}, null, 8, ["modelValue", "disabled", "min", "label"])
|
|
3989
4019
|
]),
|
|
3990
4020
|
_: 1
|
|
@@ -3994,7 +4024,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
3994
4024
|
}, 8, ["model-value", "rules"]),
|
|
3995
4025
|
_.value.type ? (F(), j(Ye, {
|
|
3996
4026
|
key: 0,
|
|
3997
|
-
label: h(
|
|
4027
|
+
label: h(I)("menu.common.labels.group_type")
|
|
3998
4028
|
}, {
|
|
3999
4029
|
default: P(() => [
|
|
4000
4030
|
b(D, {
|
|
@@ -4003,9 +4033,9 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4003
4033
|
"onUpdate:modelValue": C[3] || (C[3] = (X) => U(X))
|
|
4004
4034
|
}, {
|
|
4005
4035
|
default: P(() => [
|
|
4006
|
-
(F(!0), te(Ae, null, Ue(
|
|
4036
|
+
(F(!0), te(Ae, null, Ue(x.value, (X) => (F(), j(E, {
|
|
4007
4037
|
key: X.value,
|
|
4008
|
-
label: h(
|
|
4038
|
+
label: h(I)(`menu.group.types.${X.label.toLowerCase()}`),
|
|
4009
4039
|
value: X.value
|
|
4010
4040
|
}, null, 8, ["label", "value"]))), 128))
|
|
4011
4041
|
]),
|
|
@@ -4015,31 +4045,31 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4015
4045
|
_: 1
|
|
4016
4046
|
}, 8, ["label"])) : ie("", !0),
|
|
4017
4047
|
b(Ye, {
|
|
4018
|
-
label: h(
|
|
4048
|
+
label: h(I)("menu.common.labels.configuration")
|
|
4019
4049
|
}, {
|
|
4020
4050
|
default: P(() => [
|
|
4021
4051
|
b(Y, {
|
|
4022
4052
|
modelValue: g.group.stackable,
|
|
4023
4053
|
"onUpdate:modelValue": C[4] || (C[4] = (X) => g.group.stackable = X),
|
|
4024
4054
|
disabled: f("stackable"),
|
|
4025
|
-
label: h(
|
|
4055
|
+
label: h(I)("menu.common.labels.stackable"),
|
|
4026
4056
|
"label-placement": "right",
|
|
4027
|
-
sublabel: h(
|
|
4057
|
+
sublabel: h(I)("menu.common.labels.stackable_sublabel")
|
|
4028
4058
|
}, null, 8, ["modelValue", "disabled", "label", "sublabel"])
|
|
4029
4059
|
]),
|
|
4030
4060
|
_: 1
|
|
4031
4061
|
}, 8, ["label"]),
|
|
4032
4062
|
A.value ? (F(), j(Be, {
|
|
4033
4063
|
key: 1,
|
|
4034
|
-
title: h(
|
|
4035
|
-
"sub-title": h(
|
|
4064
|
+
title: h(I)("menu.group.form.tagging.title"),
|
|
4065
|
+
"sub-title": h(I)("menu.group.form.tagging.subtitle")
|
|
4036
4066
|
}, {
|
|
4037
4067
|
default: P(() => [
|
|
4038
4068
|
b(h(Ti), {
|
|
4039
4069
|
entity: "group",
|
|
4040
4070
|
"model-value": g.group.customAttributes || {},
|
|
4041
|
-
"onUpdate:modelValue":
|
|
4042
|
-
"value-options":
|
|
4071
|
+
"onUpdate:modelValue": R,
|
|
4072
|
+
"value-options": k.value
|
|
4043
4073
|
}, null, 8, ["model-value", "value-options"])
|
|
4044
4074
|
]),
|
|
4045
4075
|
_: 1
|
|
@@ -4051,8 +4081,8 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4051
4081
|
tag: "div",
|
|
4052
4082
|
modelValue: g.group,
|
|
4053
4083
|
rules: [h(c)],
|
|
4054
|
-
"helper-text": h(
|
|
4055
|
-
count: h(
|
|
4084
|
+
"helper-text": h(I)("menu.common.validation.default_items_tip", {
|
|
4085
|
+
count: h(d)(g.group),
|
|
4056
4086
|
max: g.group.max
|
|
4057
4087
|
})
|
|
4058
4088
|
}, {
|
|
@@ -4085,29 +4115,29 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4085
4115
|
emits: ["update:combinations"],
|
|
4086
4116
|
setup(e, { expose: i, emit: t }) {
|
|
4087
4117
|
var K, U;
|
|
4088
|
-
const n = e, a = t, o = be(), r = Ne(), l = qe(Xe(Ee())), s = ee([]), u = ee(n.combinations[0].combinationKey || ""),
|
|
4118
|
+
const n = e, a = t, o = be(), r = Ne(), l = qe(Xe(Ee())), s = ee([]), u = ee(n.combinations[0].combinationKey || ""), d = O(
|
|
4089
4119
|
() => s.value.findIndex((L) => L.combinationKey == u.value)
|
|
4090
4120
|
), c = O(
|
|
4091
4121
|
() => n.combinations.map((L) => ({
|
|
4092
4122
|
label: n.fullCombinations[L.combinationKey || ""],
|
|
4093
4123
|
value: L.combinationKey || ""
|
|
4094
4124
|
}))
|
|
4095
|
-
),
|
|
4096
|
-
var A,
|
|
4125
|
+
), m = O(() => {
|
|
4126
|
+
var A, k;
|
|
4097
4127
|
if (!S.value) return null;
|
|
4098
|
-
const L = ((
|
|
4128
|
+
const L = ((k = (A = s.value[d.value]) == null ? void 0 : A.groups) == null ? void 0 : k.find((R) => R._id === n.groupId)) || {
|
|
4099
4129
|
_id: n.groupId,
|
|
4100
4130
|
groupKey: ""
|
|
4101
|
-
}, T = o.state.menu.modules.group.find((
|
|
4131
|
+
}, T = o.state.menu.modules.group.find((R) => R._id === n.groupId), z = Object.entries({ ...L, items: void 0 }).filter(([, R]) => !!R), w = {
|
|
4102
4132
|
...T,
|
|
4103
|
-
...Object.fromEntries(
|
|
4104
|
-
items: T.items.map((
|
|
4105
|
-
var
|
|
4106
|
-
const $ = (
|
|
4107
|
-
(g) => g._id ==
|
|
4133
|
+
...Object.fromEntries(z),
|
|
4134
|
+
items: T.items.map((R) => {
|
|
4135
|
+
var I;
|
|
4136
|
+
const $ = (I = L.items) == null ? void 0 : I.find(
|
|
4137
|
+
(g) => g._id == R._id && g.combinationKey == R.combinationKey
|
|
4108
4138
|
);
|
|
4109
4139
|
return {
|
|
4110
|
-
...
|
|
4140
|
+
...R,
|
|
4111
4141
|
...$ ?? {},
|
|
4112
4142
|
price: ($ == null ? void 0 : $.price) || null,
|
|
4113
4143
|
priceTiers: ($ == null ? void 0 : $.priceTiers) || null,
|
|
@@ -4119,17 +4149,17 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4119
4149
|
});
|
|
4120
4150
|
function p(L) {
|
|
4121
4151
|
var w, A;
|
|
4122
|
-
const M = (w = s.value[
|
|
4123
|
-
(
|
|
4124
|
-
), T = ue(s.value),
|
|
4125
|
-
(M ?? -1) < 0 ? T[
|
|
4126
|
-
...T[
|
|
4127
|
-
groups: [...((A = T[
|
|
4128
|
-
} : T[
|
|
4152
|
+
const M = (w = s.value[d.value].groups) == null ? void 0 : w.findIndex(
|
|
4153
|
+
(k) => k._id === n.groupId
|
|
4154
|
+
), T = ue(s.value), z = { ...Xt(L), _id: n.groupId, groupKey: "" };
|
|
4155
|
+
(M ?? -1) < 0 ? T[d.value] = {
|
|
4156
|
+
...T[d.value],
|
|
4157
|
+
groups: [...((A = T[d.value]) == null ? void 0 : A.groups) || [], z]
|
|
4158
|
+
} : T[d.value].groups[M] = z, s.value = T;
|
|
4129
4159
|
}
|
|
4130
4160
|
function v(L) {
|
|
4131
4161
|
const M = c.value.length;
|
|
4132
|
-
let T =
|
|
4162
|
+
let T = d.value;
|
|
4133
4163
|
L === "left" ? T = T === 0 ? M - 1 : T - 1 : T = T === M - 1 ? 0 : T + 1, u.value = c.value[T].value;
|
|
4134
4164
|
}
|
|
4135
4165
|
function y(L) {
|
|
@@ -4156,15 +4186,15 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4156
4186
|
var T;
|
|
4157
4187
|
return {
|
|
4158
4188
|
...M,
|
|
4159
|
-
groups: (T = M.groups) == null ? void 0 : T.map((
|
|
4160
|
-
...
|
|
4189
|
+
groups: (T = M.groups) == null ? void 0 : T.map((z) => ({
|
|
4190
|
+
...to(z, y())
|
|
4161
4191
|
}))
|
|
4162
4192
|
};
|
|
4163
4193
|
});
|
|
4164
4194
|
a("update:combinations", L);
|
|
4165
4195
|
}
|
|
4166
4196
|
const S = ee(!1);
|
|
4167
|
-
|
|
4197
|
+
Re(
|
|
4168
4198
|
() => S.value,
|
|
4169
4199
|
(L) => {
|
|
4170
4200
|
L && (s.value = ue(n.combinations), u.value = n.combinations[0].combinationKey || "");
|
|
@@ -4175,18 +4205,18 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4175
4205
|
show: (K = f.value) == null ? void 0 : K.show,
|
|
4176
4206
|
trigger: (U = f.value) == null ? void 0 : U.trigger
|
|
4177
4207
|
});
|
|
4178
|
-
const { t:
|
|
4208
|
+
const { t: x } = he();
|
|
4179
4209
|
return (L, M) => {
|
|
4180
|
-
const T = N("fm-select"),
|
|
4210
|
+
const T = N("fm-select"), z = N("fm-button"), w = N("fm-card");
|
|
4181
4211
|
return F(), j(hn, {
|
|
4182
4212
|
ref_key: "baseFormRef",
|
|
4183
4213
|
ref: f,
|
|
4184
4214
|
"allow-refund-inventory": !0,
|
|
4185
4215
|
"categorized-items": h(o).categorizedItems,
|
|
4186
4216
|
config: y,
|
|
4187
|
-
group:
|
|
4217
|
+
group: m.value,
|
|
4188
4218
|
action: "update",
|
|
4189
|
-
title: h(
|
|
4219
|
+
title: h(x)("menu.group.update"),
|
|
4190
4220
|
"onUpdate:group": M[3] || (M[3] = (A) => p(A)),
|
|
4191
4221
|
"onSubmit:group": M[4] || (M[4] = (A) => _()),
|
|
4192
4222
|
"onStatus:show": M[5] || (M[5] = (A) => S.value = A)
|
|
@@ -4201,7 +4231,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4201
4231
|
variant: "outlined"
|
|
4202
4232
|
}, {
|
|
4203
4233
|
default: P(() => [
|
|
4204
|
-
V("p", br, de(h(
|
|
4234
|
+
V("p", br, de(h(x)("menu.group.option.variant")), 1),
|
|
4205
4235
|
V("div", yr, [
|
|
4206
4236
|
b(T, {
|
|
4207
4237
|
modelValue: u.value,
|
|
@@ -4210,13 +4240,13 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4210
4240
|
class: "flex-1"
|
|
4211
4241
|
}, null, 8, ["modelValue", "items"]),
|
|
4212
4242
|
V("div", _r, [
|
|
4213
|
-
b(
|
|
4243
|
+
b(z, {
|
|
4214
4244
|
variant: h(Ze).Tertiary,
|
|
4215
4245
|
"prepend-icon": "keyboard_arrow_left",
|
|
4216
4246
|
size: "lg",
|
|
4217
4247
|
onClick: M[1] || (M[1] = (A) => v("left"))
|
|
4218
4248
|
}, null, 8, ["variant"]),
|
|
4219
|
-
b(
|
|
4249
|
+
b(z, {
|
|
4220
4250
|
variant: h(Ze).Tertiary,
|
|
4221
4251
|
"prepend-icon": "keyboard_arrow_right",
|
|
4222
4252
|
size: "lg",
|
|
@@ -4232,13 +4262,13 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4232
4262
|
}, 8, ["categorized-items", "group", "title"]);
|
|
4233
4263
|
};
|
|
4234
4264
|
}
|
|
4235
|
-
}), Sr = hn, Ai = Xa, Cr = wr,
|
|
4265
|
+
}), Sr = hn, Ai = Xa, Cr = wr, kr = {
|
|
4236
4266
|
key: 0,
|
|
4237
4267
|
class: "flex flex-col space-y-16 h-[440px]"
|
|
4238
|
-
},
|
|
4268
|
+
}, Rr = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, xr = { class: "flex justify-between pb-16" }, Ar = { class: "flex gap-8" }, Mr = {
|
|
4239
4269
|
key: 1,
|
|
4240
4270
|
class: "flex flex-col items-center space-y-16"
|
|
4241
|
-
}, Fr = { class: "flex flex-col items-center space-y-4 w-full" }, Or = { class: "fm-typo-en-title-sm-600" },
|
|
4271
|
+
}, Fr = { class: "flex flex-col items-center space-y-4 w-full" }, Or = { class: "fm-typo-en-title-sm-600" }, Ir = { class: "text-fm-color-typo-secondary" }, zr = /* @__PURE__ */ me({
|
|
4242
4272
|
__name: "SelectGroupDialog",
|
|
4243
4273
|
props: {
|
|
4244
4274
|
groupIds: {}
|
|
@@ -4246,19 +4276,19 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4246
4276
|
setup(e) {
|
|
4247
4277
|
const i = e, t = Ne(), { emitData: n, emitAction: a } = Pi(), o = be(), r = O(() => o.rules.group), l = O(() => o.groups);
|
|
4248
4278
|
function s(_) {
|
|
4249
|
-
return ue(_ ?? []).sort((f,
|
|
4279
|
+
return ue(_ ?? []).sort((f, x) => f.position - x.position);
|
|
4250
4280
|
}
|
|
4251
4281
|
const u = O(() => s(l.value).reduce((_, S) => (_[S._id] = {
|
|
4252
4282
|
name: S.name,
|
|
4253
|
-
type:
|
|
4254
|
-
}, _), {})),
|
|
4283
|
+
type: kt(o.items, S.items)
|
|
4284
|
+
}, _), {})), d = O(() => [
|
|
4255
4285
|
...Object.entries(u.value).map(([_, { name: S, type: f }]) => ({
|
|
4256
4286
|
label: `${S} ${r.value.type ? `(${Ut(f)})` : ""}`.trim(),
|
|
4257
4287
|
value: _
|
|
4258
4288
|
}))
|
|
4259
4289
|
]), c = O(() => !!o.state.currentCatalogId || !!o.state.currentSchedulerId);
|
|
4260
4290
|
O(() => {
|
|
4261
|
-
const _ = !o.state.currentSchedulerId, S = o.rules.group.type, f = o.version == G.F_MENU_VERSION.enum.v3,
|
|
4291
|
+
const _ = !o.state.currentSchedulerId, S = o.rules.group.type, f = o.version == G.F_MENU_VERSION.enum.v3, x = o.rules.item.orderFromActiveOnly, K = o.rules.item.bindToVariant;
|
|
4262
4292
|
return function(L) {
|
|
4263
4293
|
return {
|
|
4264
4294
|
isDefault: (M) => !c.value && !M,
|
|
@@ -4270,7 +4300,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4270
4300
|
priceTier: o.isV4,
|
|
4271
4301
|
inventory: _ ? f ? !c.value && L.type == G.F_ADDON_GROUP_TYPE.enum.NORMAL : !c.value : !1,
|
|
4272
4302
|
orderFrom: (M) => _ ? f ? L.type == G.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? c.value : !!c.value == !M : c.value : !1,
|
|
4273
|
-
orderFromActiveOnly:
|
|
4303
|
+
orderFromActiveOnly: x,
|
|
4274
4304
|
showOrderFrom: _ ? f ? c.value ? !0 : L.type == G.F_ADDON_GROUP_TYPE.enum.PRODUCT : c.value : !1,
|
|
4275
4305
|
bindToVariant: K,
|
|
4276
4306
|
isOverride: c.value,
|
|
@@ -4279,18 +4309,18 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4279
4309
|
};
|
|
4280
4310
|
};
|
|
4281
4311
|
}), O(() => ({
|
|
4282
|
-
...
|
|
4312
|
+
...ze.generator.initMenuV4Group(),
|
|
4283
4313
|
type: o.version === G.F_MENU_VERSION.enum.v4 ? G.F_ADDON_GROUP_TYPE.enum.PRODUCT : G.F_ADDON_GROUP_TYPE.enum.NORMAL,
|
|
4284
4314
|
items: {},
|
|
4285
4315
|
position: o.groups.length - 1,
|
|
4286
4316
|
itemsLinked: []
|
|
4287
4317
|
}));
|
|
4288
|
-
const
|
|
4289
|
-
n(
|
|
4318
|
+
const m = ee(ue(i.groupIds || [])), p = ee(""), { t: v } = he(), y = () => {
|
|
4319
|
+
n(m.value), a("primary"), t.close();
|
|
4290
4320
|
};
|
|
4291
4321
|
return (_, S) => {
|
|
4292
|
-
const f = N("FmSearch"),
|
|
4293
|
-
return
|
|
4322
|
+
const f = N("FmSearch"), x = N("FmCheckbox"), K = N("FmButton");
|
|
4323
|
+
return d.value.length > 0 ? (F(), te("div", kr, [
|
|
4294
4324
|
V("div", null, [
|
|
4295
4325
|
b(f, {
|
|
4296
4326
|
autofocus: "",
|
|
@@ -4299,16 +4329,16 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4299
4329
|
placeholder: h(v)("menu.common.labels.search_groups")
|
|
4300
4330
|
}, null, 8, ["modelValue", "placeholder"])
|
|
4301
4331
|
]),
|
|
4302
|
-
V("div",
|
|
4332
|
+
V("div", Rr, [
|
|
4303
4333
|
V("div", null, [
|
|
4304
|
-
(F(!0), te(Ae, null, Ue(
|
|
4334
|
+
(F(!0), te(Ae, null, Ue(d.value, (U) => (F(), te("div", {
|
|
4305
4335
|
key: U.value
|
|
4306
4336
|
}, [
|
|
4307
|
-
lt(b(
|
|
4308
|
-
modelValue:
|
|
4337
|
+
lt(b(x, {
|
|
4338
|
+
modelValue: m.value,
|
|
4309
4339
|
"onUpdate:modelValue": [
|
|
4310
|
-
S[1] || (S[1] = (L) =>
|
|
4311
|
-
S[2] || (S[2] = (L) => h(n)(
|
|
4340
|
+
S[1] || (S[1] = (L) => m.value = L),
|
|
4341
|
+
S[2] || (S[2] = (L) => h(n)(m.value))
|
|
4312
4342
|
],
|
|
4313
4343
|
label: U.label,
|
|
4314
4344
|
value: U.value
|
|
@@ -4318,7 +4348,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4318
4348
|
]))), 128))
|
|
4319
4349
|
])
|
|
4320
4350
|
]),
|
|
4321
|
-
V("div",
|
|
4351
|
+
V("div", xr, [
|
|
4322
4352
|
b(h(Ai), null, {
|
|
4323
4353
|
default: P(({ trigger: U }) => [
|
|
4324
4354
|
b(K, {
|
|
@@ -4345,7 +4375,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4345
4375
|
])) : (F(), te("div", Mr, [
|
|
4346
4376
|
V("div", Fr, [
|
|
4347
4377
|
V("p", Or, de(h(v)("menu.common.empty.no_group.title")), 1),
|
|
4348
|
-
V("p",
|
|
4378
|
+
V("p", Ir, de(h(v)("menu.common.empty.no_group.subtitle")), 1)
|
|
4349
4379
|
]),
|
|
4350
4380
|
b(h(Ai), null, {
|
|
4351
4381
|
default: P(({ trigger: U }) => [
|
|
@@ -4379,33 +4409,33 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4379
4409
|
}) {
|
|
4380
4410
|
const t = e, n = Ee(), a = be(), o = ti(), r = Ne(), {
|
|
4381
4411
|
t: l
|
|
4382
|
-
} = he(), s = i, u = O(() => a.rules.group),
|
|
4383
|
-
function
|
|
4384
|
-
return ue(
|
|
4385
|
-
const g =
|
|
4412
|
+
} = he(), s = i, u = O(() => a.rules.group), d = O(() => a.rules.item), c = O(() => a.groups);
|
|
4413
|
+
function m(k, R) {
|
|
4414
|
+
return ue(R ?? []).map((I) => {
|
|
4415
|
+
const g = k.find((C) => C._id === I._id);
|
|
4386
4416
|
return {
|
|
4387
4417
|
name: (g == null ? void 0 : g.name) ?? "",
|
|
4388
|
-
...
|
|
4418
|
+
...I,
|
|
4389
4419
|
position: g == null ? void 0 : g.position
|
|
4390
4420
|
};
|
|
4391
4421
|
});
|
|
4392
4422
|
}
|
|
4393
4423
|
const p = O(() => {
|
|
4394
|
-
var
|
|
4395
|
-
return [...v(
|
|
4424
|
+
var R;
|
|
4425
|
+
return [...v(m(c.value, t.form.groups || ((R = t.fallback) == null ? void 0 : R.groups) || [])).map(($) => $._id)];
|
|
4396
4426
|
});
|
|
4397
|
-
function v(
|
|
4398
|
-
return ue(
|
|
4427
|
+
function v(k) {
|
|
4428
|
+
return ue(k ?? []).sort(($, I) => $.position - I.position);
|
|
4399
4429
|
}
|
|
4400
|
-
function y(
|
|
4401
|
-
const
|
|
4402
|
-
if (!
|
|
4430
|
+
function y(k) {
|
|
4431
|
+
const R = c.value.find((g) => g._id === k);
|
|
4432
|
+
if (!R)
|
|
4403
4433
|
return [];
|
|
4404
4434
|
const $ = [];
|
|
4405
|
-
return
|
|
4435
|
+
return R.items.forEach((g) => {
|
|
4406
4436
|
if (g.combinationKey)
|
|
4407
4437
|
return;
|
|
4408
|
-
const C = a.items.find((ae) => ae._id === g._id), W =
|
|
4438
|
+
const C = a.items.find((ae) => ae._id === g._id), W = R.items.filter((ae) => ae._id === g._id && ae.combinationKey).length;
|
|
4409
4439
|
$.push({
|
|
4410
4440
|
code: g.code || (C == null ? void 0 : C.code),
|
|
4411
4441
|
name: g.name || (C == null ? void 0 : C.name),
|
|
@@ -4418,41 +4448,41 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4418
4448
|
})})` : C;
|
|
4419
4449
|
});
|
|
4420
4450
|
}
|
|
4421
|
-
const _ = O(() => v(c.value).reduce((
|
|
4422
|
-
name:
|
|
4423
|
-
type:
|
|
4424
|
-
},
|
|
4425
|
-
name:
|
|
4451
|
+
const _ = O(() => v(c.value).reduce((k, R) => (k[R._id] = {
|
|
4452
|
+
name: R.name,
|
|
4453
|
+
type: kt(a.items, R.items)
|
|
4454
|
+
}, k), {})), S = O(() => [...Object.entries(_.value).map(([k, {
|
|
4455
|
+
name: R,
|
|
4426
4456
|
type: $
|
|
4427
4457
|
}]) => ({
|
|
4428
|
-
label: `${
|
|
4429
|
-
value:
|
|
4458
|
+
label: `${R} ${u.value.type ? `(${Ut($)})` : ""}`.trim(),
|
|
4459
|
+
value: k
|
|
4430
4460
|
}))]), f = O(() => [{
|
|
4431
4461
|
accessorKey: "name",
|
|
4432
4462
|
header: () => l("menu.product.form.group.columns.title"),
|
|
4433
4463
|
enableSorting: !1,
|
|
4434
|
-
cell: (
|
|
4435
|
-
const
|
|
4436
|
-
return w(
|
|
4464
|
+
cell: (k) => {
|
|
4465
|
+
const R = k.row.original._id;
|
|
4466
|
+
return w(R);
|
|
4437
4467
|
}
|
|
4438
4468
|
}, {
|
|
4439
4469
|
id: "type",
|
|
4440
4470
|
accessorKey: "type",
|
|
4441
4471
|
header: () => l("menu.product.form.group.columns.type"),
|
|
4442
4472
|
enableSorting: !1,
|
|
4443
|
-
cell: (
|
|
4473
|
+
cell: (k) => {
|
|
4444
4474
|
var $;
|
|
4445
|
-
const
|
|
4446
|
-
return Ut(($ = _.value[
|
|
4475
|
+
const R = k.row.original._id;
|
|
4476
|
+
return Ut(($ = _.value[R]) == null ? void 0 : $.type);
|
|
4447
4477
|
}
|
|
4448
4478
|
}, {
|
|
4449
4479
|
accessorKey: "items",
|
|
4450
4480
|
header: () => l("menu.group.list.columns.products"),
|
|
4451
4481
|
enableSorting: !1,
|
|
4452
4482
|
size: 200,
|
|
4453
|
-
cell: (
|
|
4454
|
-
const
|
|
4455
|
-
return b(
|
|
4483
|
+
cell: (k) => {
|
|
4484
|
+
const R = k.row.original._id, I = y(R).join(", ");
|
|
4485
|
+
return b(xe.FmTooltip, {
|
|
4456
4486
|
"z-index": 51,
|
|
4457
4487
|
class: "flex",
|
|
4458
4488
|
variant: "rich",
|
|
@@ -4460,14 +4490,14 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4460
4490
|
}, {
|
|
4461
4491
|
default: () => b("div", {
|
|
4462
4492
|
class: "line-clamp-2 break-all"
|
|
4463
|
-
}, [
|
|
4493
|
+
}, [I]),
|
|
4464
4494
|
content: () => b("div", {
|
|
4465
4495
|
class: "py-12 px-16 space-y-12"
|
|
4466
4496
|
}, [b("p", {
|
|
4467
4497
|
class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-600"
|
|
4468
4498
|
}, [l("menu.group.list.columns.products")]), b("div", {
|
|
4469
4499
|
class: "flex flex-wrap gap-8"
|
|
4470
|
-
}, [
|
|
4500
|
+
}, [I])])
|
|
4471
4501
|
});
|
|
4472
4502
|
}
|
|
4473
4503
|
}, {
|
|
@@ -4475,129 +4505,129 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4475
4505
|
header: "",
|
|
4476
4506
|
size: 52,
|
|
4477
4507
|
enableSorting: !1,
|
|
4478
|
-
cell: (
|
|
4479
|
-
const
|
|
4508
|
+
cell: (k) => {
|
|
4509
|
+
const R = k.row.original._id;
|
|
4480
4510
|
return Se("div", {
|
|
4481
4511
|
class: "flex justify-end"
|
|
4482
|
-
}, [Se(
|
|
4512
|
+
}, [Se(xe.FmButton, {
|
|
4483
4513
|
icon: "delete",
|
|
4484
4514
|
variant: "tertiary",
|
|
4485
4515
|
textColor: "neutral-gray-400",
|
|
4486
4516
|
onClick: Ct(async () => {
|
|
4487
|
-
L(
|
|
4517
|
+
L(R);
|
|
4488
4518
|
}, ["stop", "prevent"])
|
|
4489
4519
|
}), Se(Cr, {
|
|
4490
4520
|
// variant items
|
|
4491
4521
|
combinations: T.value ?? [],
|
|
4492
4522
|
// combinationKey: varaintName
|
|
4493
4523
|
fullCombinations: t.fullCombinations,
|
|
4494
|
-
groupId:
|
|
4524
|
+
groupId: R,
|
|
4495
4525
|
"onUpdate:combinations": A
|
|
4496
4526
|
}, {
|
|
4497
4527
|
default: ({
|
|
4498
4528
|
trigger: $
|
|
4499
|
-
}) => Se(
|
|
4529
|
+
}) => Se(xe.FmButton, {
|
|
4500
4530
|
icon: "edit",
|
|
4501
4531
|
variant: "tertiary",
|
|
4502
|
-
disabled: !
|
|
4532
|
+
disabled: !z(R),
|
|
4503
4533
|
textColor: "neutral-gray-400",
|
|
4504
4534
|
onClick: $
|
|
4505
4535
|
})
|
|
4506
4536
|
})]);
|
|
4507
4537
|
}
|
|
4508
|
-
}]),
|
|
4538
|
+
}]), x = O(() => ({
|
|
4509
4539
|
type: a.version !== G.F_MENU_VERSION.enum.v4
|
|
4510
4540
|
}));
|
|
4511
4541
|
function K() {
|
|
4512
4542
|
r.open({
|
|
4513
4543
|
title: l("menu.product.form.group.add"),
|
|
4514
|
-
contentComponent:
|
|
4544
|
+
contentComponent: zr,
|
|
4515
4545
|
contentComponentProps: {
|
|
4516
4546
|
groupIds: p.value
|
|
4517
4547
|
}
|
|
4518
|
-
}).onPrimary((
|
|
4519
|
-
var
|
|
4520
|
-
for (const $ of
|
|
4521
|
-
if (
|
|
4522
|
-
const
|
|
4548
|
+
}).onPrimary((k) => {
|
|
4549
|
+
var R;
|
|
4550
|
+
for (const $ of k)
|
|
4551
|
+
if (Bn(a.state.menu, $, t.form._id)) {
|
|
4552
|
+
const I = (R = _.value[$]) == null ? void 0 : R.name;
|
|
4523
4553
|
n.open({
|
|
4524
4554
|
type: "error",
|
|
4525
4555
|
message: l("menu.product.form.group.circularError", {
|
|
4526
|
-
groupName:
|
|
4556
|
+
groupName: I,
|
|
4527
4557
|
productName: t.form.name
|
|
4528
4558
|
})
|
|
4529
4559
|
});
|
|
4530
4560
|
return;
|
|
4531
4561
|
}
|
|
4532
|
-
U(
|
|
4562
|
+
U(k);
|
|
4533
4563
|
});
|
|
4534
4564
|
}
|
|
4535
|
-
function U(
|
|
4536
|
-
const
|
|
4565
|
+
function U(k) {
|
|
4566
|
+
const R = k.reduce(($, I) => {
|
|
4537
4567
|
var C;
|
|
4538
|
-
const g = ((C = t.form.groups) == null ? void 0 : C.find((W) => W._id ===
|
|
4539
|
-
_id:
|
|
4568
|
+
const g = ((C = t.form.groups) == null ? void 0 : C.find((W) => W._id === I)) || {
|
|
4569
|
+
_id: I,
|
|
4540
4570
|
groupKey: ""
|
|
4541
4571
|
};
|
|
4542
4572
|
return $.push(g), $;
|
|
4543
4573
|
}, []);
|
|
4544
4574
|
s("replace:form", o.initDynamicGroupItem({
|
|
4545
4575
|
...t.form,
|
|
4546
|
-
groups:
|
|
4576
|
+
groups: R
|
|
4547
4577
|
}));
|
|
4548
4578
|
}
|
|
4549
|
-
function L(
|
|
4550
|
-
var $,
|
|
4579
|
+
function L(k) {
|
|
4580
|
+
var $, I, g;
|
|
4551
4581
|
if (!t.form.groups)
|
|
4552
4582
|
return;
|
|
4553
|
-
const
|
|
4554
|
-
|
|
4583
|
+
const R = ue(t.form.groups);
|
|
4584
|
+
R.splice(R.findIndex((C) => C._id === k), 1);
|
|
4555
4585
|
for (const C of (($ = t.form.variant) == null ? void 0 : $.variantCombinations) || [])
|
|
4556
|
-
(g = C.groups) == null || g.splice((
|
|
4586
|
+
(g = C.groups) == null || g.splice((I = C.groups) == null ? void 0 : I.findIndex((W) => W._id === k), 1);
|
|
4557
4587
|
s("replace:form", o.initDynamicGroupItem({
|
|
4558
4588
|
...t.form,
|
|
4559
|
-
groups:
|
|
4589
|
+
groups: R
|
|
4560
4590
|
}));
|
|
4561
4591
|
}
|
|
4562
4592
|
const M = O(() => {
|
|
4563
|
-
var
|
|
4564
|
-
return !!((
|
|
4593
|
+
var k;
|
|
4594
|
+
return !!((k = t.form.variant) != null && k.variantGroupIds.length);
|
|
4565
4595
|
}), T = O(() => {
|
|
4566
|
-
var
|
|
4567
|
-
return M.value ? (
|
|
4596
|
+
var k;
|
|
4597
|
+
return M.value ? (k = t.form.variant) == null ? void 0 : k.variantCombinations : [{
|
|
4568
4598
|
_id: t.form._id,
|
|
4569
4599
|
combinationKey: "",
|
|
4570
4600
|
groups: t.form.groups || []
|
|
4571
4601
|
}];
|
|
4572
4602
|
});
|
|
4573
|
-
function
|
|
4603
|
+
function z(k) {
|
|
4574
4604
|
var $;
|
|
4575
|
-
if (!
|
|
4576
|
-
if (
|
|
4577
|
-
switch (($ = _.value[
|
|
4605
|
+
if (!k) return !1;
|
|
4606
|
+
if (d.value.overrideProductGroup) return !0;
|
|
4607
|
+
switch (($ = _.value[k]) == null ? void 0 : $.type) {
|
|
4578
4608
|
case G.F_ADDON_GROUP_TYPE.enum.DYNAMIC:
|
|
4579
4609
|
return !0;
|
|
4580
4610
|
case G.F_ADDON_GROUP_TYPE.enum.PRODUCT:
|
|
4581
|
-
return
|
|
4611
|
+
return d.value.overrideProductGroup;
|
|
4582
4612
|
case G.F_ADDON_GROUP_TYPE.enum.NORMAL:
|
|
4583
4613
|
return !1;
|
|
4584
4614
|
default:
|
|
4585
4615
|
return !1;
|
|
4586
4616
|
}
|
|
4587
4617
|
}
|
|
4588
|
-
|
|
4589
|
-
const w = (
|
|
4590
|
-
var
|
|
4591
|
-
return (
|
|
4592
|
-
}, A = (
|
|
4593
|
-
var
|
|
4618
|
+
Re(() => c.value.length, () => U([...p.value, c.value[c.value.length - 1]._id]));
|
|
4619
|
+
const w = (k) => {
|
|
4620
|
+
var R;
|
|
4621
|
+
return (R = S.value.find(($) => $.value === k)) == null ? void 0 : R.label;
|
|
4622
|
+
}, A = (k) => {
|
|
4623
|
+
var R;
|
|
4594
4624
|
M.value ? s("update:form", "variant", {
|
|
4595
|
-
variantGroupIds: ((
|
|
4596
|
-
variantCombinations:
|
|
4597
|
-
}) : s("update:form", "groups",
|
|
4625
|
+
variantGroupIds: ((R = t.form.variant) == null ? void 0 : R.variantGroupIds) || [],
|
|
4626
|
+
variantCombinations: k
|
|
4627
|
+
}) : s("update:form", "groups", k[0].groups || []);
|
|
4598
4628
|
};
|
|
4599
|
-
return (
|
|
4600
|
-
const $ = N("FmButton"),
|
|
4629
|
+
return (k, R) => {
|
|
4630
|
+
const $ = N("FmButton"), I = N("FmTable");
|
|
4601
4631
|
return F(), j(Be, {
|
|
4602
4632
|
title: h(l)("menu.product.form.group.title"),
|
|
4603
4633
|
"sub-title": h(l)("menu.product.form.group.subtitle")
|
|
@@ -4612,10 +4642,10 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4612
4642
|
default: P(() => [b(dn, null, {
|
|
4613
4643
|
default: P(() => {
|
|
4614
4644
|
var g;
|
|
4615
|
-
return [((g = p.value) == null ? void 0 : g.length) > 0 ? (F(), j(
|
|
4645
|
+
return [((g = p.value) == null ? void 0 : g.length) > 0 ? (F(), j(I, {
|
|
4616
4646
|
key: 0,
|
|
4617
4647
|
"column-defs": f.value,
|
|
4618
|
-
"column-visibility":
|
|
4648
|
+
"column-visibility": x.value,
|
|
4619
4649
|
"row-data": p.value.map((C) => ({
|
|
4620
4650
|
_id: C
|
|
4621
4651
|
})),
|
|
@@ -4660,16 +4690,16 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4660
4690
|
_id: "",
|
|
4661
4691
|
name: S || "",
|
|
4662
4692
|
binding: y || []
|
|
4663
|
-
}] : _.map((
|
|
4664
|
-
_id:
|
|
4665
|
-
name: Ui(
|
|
4666
|
-
binding:
|
|
4693
|
+
}] : _.map((x) => ({
|
|
4694
|
+
_id: x.combinationKey || "",
|
|
4695
|
+
name: Ui(x.combinationKey || "", f),
|
|
4696
|
+
binding: x.inventoryBindings || []
|
|
4667
4697
|
}));
|
|
4668
4698
|
}
|
|
4669
4699
|
const u = O(() => {
|
|
4670
4700
|
var y;
|
|
4671
4701
|
return n.form.name || ((y = n.fallback) == null ? void 0 : y.name) || "";
|
|
4672
|
-
}),
|
|
4702
|
+
}), d = O(() => {
|
|
4673
4703
|
var y;
|
|
4674
4704
|
return s(n.form.inventoryBindings || [], ((y = n.form.variant) == null ? void 0 : y.variantCombinations) || [], u.value, o.variants);
|
|
4675
4705
|
});
|
|
@@ -4748,11 +4778,11 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4748
4778
|
})]) : null;
|
|
4749
4779
|
}
|
|
4750
4780
|
}]);
|
|
4751
|
-
const
|
|
4781
|
+
const m = ee([]);
|
|
4752
4782
|
async function p({
|
|
4753
4783
|
_id: y
|
|
4754
4784
|
}) {
|
|
4755
|
-
for (const _ of
|
|
4785
|
+
for (const _ of m.value)
|
|
4756
4786
|
_.getKey() === y && _.trigger(!0);
|
|
4757
4787
|
}
|
|
4758
4788
|
const v = Ni();
|
|
@@ -4762,11 +4792,11 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4762
4792
|
title: h(t)("menu.inventory.title"),
|
|
4763
4793
|
subTitle: h(t)("menu.inventory.subtitle")
|
|
4764
4794
|
}, {
|
|
4765
|
-
default: P(() => [V("div", Tr, [V("div", Dr, [(F(!0), te(Ae, null, Ue(
|
|
4795
|
+
default: P(() => [V("div", Tr, [V("div", Dr, [(F(!0), te(Ae, null, Ue(d.value, (S) => (F(), j(h(Wt), {
|
|
4766
4796
|
key: S._id,
|
|
4767
4797
|
ref_for: !0,
|
|
4768
4798
|
ref_key: "inventoryManagerForms",
|
|
4769
|
-
ref:
|
|
4799
|
+
ref: m,
|
|
4770
4800
|
title: h(t)("menu.inventory.dialog.title", {
|
|
4771
4801
|
name: u.value
|
|
4772
4802
|
}),
|
|
@@ -4776,8 +4806,8 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4776
4806
|
"onUpdate:inventory": (f) => {
|
|
4777
4807
|
c(S._id, f);
|
|
4778
4808
|
}
|
|
4779
|
-
}, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 128)), b(h(
|
|
4780
|
-
"row-data":
|
|
4809
|
+
}, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 128)), b(h(Hn), {
|
|
4810
|
+
"row-data": d.value,
|
|
4781
4811
|
onRowClick: p
|
|
4782
4812
|
}, null, 8, ["row-data"])])])]),
|
|
4783
4813
|
_: 1
|
|
@@ -4809,14 +4839,14 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4809
4839
|
setup(e, { emit: i }) {
|
|
4810
4840
|
const t = e, n = mt(), a = be(), o = Bi(), { t: r } = he(), l = i, s = O(() => a.rules.item), u = O(() => {
|
|
4811
4841
|
var K, U;
|
|
4812
|
-
const f = t.isOverride ? ((K = t.fallback) == null ? void 0 : K.unit) ?? ((U = t.fallback) == null ? void 0 : U.perXUnit) : void 0,
|
|
4813
|
-
return
|
|
4814
|
-
}),
|
|
4842
|
+
const f = t.isOverride ? ((K = t.fallback) == null ? void 0 : K.unit) ?? ((U = t.fallback) == null ? void 0 : U.perXUnit) : void 0, x = t.form.unit ?? t.form.perXUnit ?? f;
|
|
4843
|
+
return x != null;
|
|
4844
|
+
}), d = (f) => {
|
|
4815
4845
|
l("update:form", "unit", f ? "" : void 0), l("update:form", "perXUnit", f ? 0 : void 0);
|
|
4816
4846
|
}, c = O(() => {
|
|
4817
4847
|
const f = a.isV4;
|
|
4818
4848
|
return Ft.setCoreStore(n).taxSetting(f);
|
|
4819
|
-
}),
|
|
4849
|
+
}), m = O(() => {
|
|
4820
4850
|
var f;
|
|
4821
4851
|
return Ft.getSelectedTax(
|
|
4822
4852
|
t.form.taxes,
|
|
@@ -4825,13 +4855,13 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4825
4855
|
);
|
|
4826
4856
|
});
|
|
4827
4857
|
function p(f) {
|
|
4828
|
-
const
|
|
4858
|
+
const x = f.replace(/[^0-9.]/g, "");
|
|
4829
4859
|
if (!f) return !1;
|
|
4830
|
-
l("update:form", "perXUnit", parseFloat(
|
|
4860
|
+
l("update:form", "perXUnit", parseFloat(x));
|
|
4831
4861
|
}
|
|
4832
4862
|
function v(f) {
|
|
4833
4863
|
if (!f && t.form.perXUnit) {
|
|
4834
|
-
const [
|
|
4864
|
+
const [x, K] = t.form.perXUnit.toString().split(".");
|
|
4835
4865
|
if (K && K.length > 4) {
|
|
4836
4866
|
const L = (typeof t.form.perXUnit == "string" ? parseFloat(t.form.perXUnit) : t.form.perXUnit).toFixed(4);
|
|
4837
4867
|
l("update:form", "perXUnit", parseFloat(L));
|
|
@@ -4841,9 +4871,9 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4841
4871
|
const y = Yt();
|
|
4842
4872
|
async function _() {
|
|
4843
4873
|
if (!(t.form.name || "")) {
|
|
4844
|
-
const
|
|
4845
|
-
if (
|
|
4846
|
-
|
|
4874
|
+
const x = document.getElementById("product-name");
|
|
4875
|
+
if (x) {
|
|
4876
|
+
x.focus();
|
|
4847
4877
|
return;
|
|
4848
4878
|
} else
|
|
4849
4879
|
return;
|
|
@@ -4851,42 +4881,42 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4851
4881
|
n.pushDataLayer({ event: "menu_catalog_item_price_remy_suggest_pricing" }), y.activate({
|
|
4852
4882
|
command: "suggestPrice",
|
|
4853
4883
|
context: { itemName: "ABC Soup" },
|
|
4854
|
-
onResult: (
|
|
4884
|
+
onResult: (x) => {
|
|
4855
4885
|
l(
|
|
4856
4886
|
"update:form",
|
|
4857
4887
|
"price",
|
|
4858
|
-
|
|
4859
|
-
number:
|
|
4888
|
+
ke.Dinero.fromNumber({
|
|
4889
|
+
number: x.price
|
|
4860
4890
|
}).toObject()
|
|
4861
|
-
);
|
|
4891
|
+
), l("update:form", "_priceTrackingId", x.trackingId);
|
|
4862
4892
|
}
|
|
4863
4893
|
});
|
|
4864
4894
|
}
|
|
4865
4895
|
const S = O(() => {
|
|
4866
|
-
var f,
|
|
4867
|
-
return ((f = a.currentCatalog) == null ? void 0 : f.priceTierRules) ?? ((
|
|
4896
|
+
var f, x;
|
|
4897
|
+
return ((f = a.currentCatalog) == null ? void 0 : f.priceTierRules) ?? ((x = a.currentCatalog) == null ? void 0 : x.usePriceTiers) ?? [];
|
|
4868
4898
|
});
|
|
4869
|
-
return (f,
|
|
4899
|
+
return (f, x) => {
|
|
4870
4900
|
const K = N("fm-select"), U = N("FmButton"), L = N("fm-checkbox"), M = N("fm-text-field"), T = Oi("tooltip");
|
|
4871
4901
|
return F(), j(Be, {
|
|
4872
4902
|
title: h(r)("menu.product.form.price.title")
|
|
4873
4903
|
}, {
|
|
4874
4904
|
default: P(() => {
|
|
4875
|
-
var
|
|
4905
|
+
var z;
|
|
4876
4906
|
return [
|
|
4877
4907
|
V("div", Vr, [
|
|
4878
4908
|
b(et, {
|
|
4879
4909
|
disable: S.value.length > 0 && h(a).currentCatalog && !h(a).currentScheduler,
|
|
4880
4910
|
min: 0,
|
|
4881
4911
|
"model-value": f.form.price || null,
|
|
4882
|
-
placeholder: (
|
|
4912
|
+
placeholder: (z = f.fallback) != null && z.price ? h(ot)(f.fallback.price, !1) : void 0,
|
|
4883
4913
|
rules: [
|
|
4884
4914
|
s.value.price ? (w) => !!w || h(r)("menu.product.form.price.fields.selling_price.required") : void 0
|
|
4885
4915
|
].filter(h(pt).isSet),
|
|
4886
4916
|
class: "w-[258px] xs:w-full",
|
|
4887
4917
|
label: h(r)("menu.product.form.price.fields.selling_price.label"),
|
|
4888
4918
|
"show-currency": "",
|
|
4889
|
-
"onUpdate:modelValue":
|
|
4919
|
+
"onUpdate:modelValue": x[0] || (x[0] = (w) => w && l("update:form", "price", w))
|
|
4890
4920
|
}, {
|
|
4891
4921
|
append: P(() => [
|
|
4892
4922
|
lt(b(h($i), {
|
|
@@ -4904,11 +4934,11 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4904
4934
|
label: c.value.systemCode ? h(r)("menu.product.form.price.fields.tax.label_with_code", {
|
|
4905
4935
|
code: c.value.systemCode
|
|
4906
4936
|
}) : h(r)("menu.product.form.price.fields.tax.label"),
|
|
4907
|
-
"model-value":
|
|
4937
|
+
"model-value": m.value,
|
|
4908
4938
|
placeholder: "--",
|
|
4909
4939
|
class: "flex-1",
|
|
4910
4940
|
"shift-menu": "",
|
|
4911
|
-
"onUpdate:modelValue":
|
|
4941
|
+
"onUpdate:modelValue": x[1] || (x[1] = (w) => l("update:form", "taxes", [h(Ft).decodeTax(w)]))
|
|
4912
4942
|
}, null, 8, ["disabled", "items", "label", "model-value"])
|
|
4913
4943
|
]),
|
|
4914
4944
|
!f.isOverride && h(a).isV4 ? (F(), j(Ye, {
|
|
@@ -4932,7 +4962,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4932
4962
|
"price-tiers": h(o).priceTiers.value,
|
|
4933
4963
|
"model-value": f.form.priceTiers || ((w = f.fallback) == null ? void 0 : w.priceTiers) || {},
|
|
4934
4964
|
"allow-negative-price": !1,
|
|
4935
|
-
"onUpdate:modelValue":
|
|
4965
|
+
"onUpdate:modelValue": x[2] || (x[2] = (A) => l("update:form", "priceTiers", A))
|
|
4936
4966
|
}, null, 8, ["price-tiers", "model-value"]))
|
|
4937
4967
|
];
|
|
4938
4968
|
}),
|
|
@@ -4942,7 +4972,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4942
4972
|
label: h(r)("menu.product.form.price.settings.title")
|
|
4943
4973
|
}, {
|
|
4944
4974
|
default: P(() => {
|
|
4945
|
-
var w, A,
|
|
4975
|
+
var w, A, k;
|
|
4946
4976
|
return [
|
|
4947
4977
|
V("div", Ur, [
|
|
4948
4978
|
b(L, {
|
|
@@ -4951,7 +4981,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4951
4981
|
value: f.form.openPrice,
|
|
4952
4982
|
label: h(r)("menu.product.form.price.settings.open_price.label"),
|
|
4953
4983
|
sublabel: h(r)("menu.product.form.price.settings.open_price.sublabel"),
|
|
4954
|
-
"onUpdate:modelValue":
|
|
4984
|
+
"onUpdate:modelValue": x[3] || (x[3] = (R) => l("update:form", "openPrice", R))
|
|
4955
4985
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
4956
4986
|
V("div", $r, [
|
|
4957
4987
|
b(L, {
|
|
@@ -4960,7 +4990,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4960
4990
|
value: u.value,
|
|
4961
4991
|
label: h(r)("menu.product.form.price.settings.sell_by_unit.label"),
|
|
4962
4992
|
sublabel: h(r)("menu.product.form.price.settings.sell_by_unit.sublabel"),
|
|
4963
|
-
"onUpdate:modelValue":
|
|
4993
|
+
"onUpdate:modelValue": d
|
|
4964
4994
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
4965
4995
|
u.value ? (F(), te("div", Nr, [
|
|
4966
4996
|
V("p", Br, de(h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.label")), 1),
|
|
@@ -4969,8 +4999,8 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4969
4999
|
disabled: !s.value.unit,
|
|
4970
5000
|
"model-value": f.form.perXUnit || ((A = f.fallback) == null ? void 0 : A.perXUnit) || null,
|
|
4971
5001
|
rules: [
|
|
4972
|
-
(
|
|
4973
|
-
(
|
|
5002
|
+
(R) => !!R || h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
|
|
5003
|
+
(R) => !R || R > 0 || h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
|
|
4974
5004
|
],
|
|
4975
5005
|
inputmode: "numeric",
|
|
4976
5006
|
placeholder: h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.placeholder"),
|
|
@@ -4982,12 +5012,12 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4982
5012
|
V("div", Gr, [
|
|
4983
5013
|
b(M, {
|
|
4984
5014
|
disabled: !s.value.unit,
|
|
4985
|
-
"model-value": f.form.unit || ((
|
|
5015
|
+
"model-value": f.form.unit || ((k = f.fallback) == null ? void 0 : k.unit) || null,
|
|
4986
5016
|
rules: [
|
|
4987
|
-
(
|
|
5017
|
+
(R) => !!R || h(r)("menu.product.form.price.settings.sell_by_unit.unit.required")
|
|
4988
5018
|
],
|
|
4989
5019
|
placeholder: h(r)("menu.product.form.price.settings.sell_by_unit.unit.placeholder"),
|
|
4990
|
-
"onUpdate:modelValue":
|
|
5020
|
+
"onUpdate:modelValue": x[4] || (x[4] = (R) => l("update:form", "unit", R))
|
|
4991
5021
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
4992
5022
|
])
|
|
4993
5023
|
])) : ie("", !0)
|
|
@@ -4997,7 +5027,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
4997
5027
|
"model-value": !!f.form.costing,
|
|
4998
5028
|
value: !!f.form.costing,
|
|
4999
5029
|
label: h(r)("menu.product.form.price.settings.track_costing.label"),
|
|
5000
|
-
"onUpdate:modelValue":
|
|
5030
|
+
"onUpdate:modelValue": x[5] || (x[5] = (R) => l("update:form", "costing", R ? h(ke.Dinero).zero().toObject() : void 0))
|
|
5001
5031
|
}, null, 8, ["model-value", "value", "label"]),
|
|
5002
5032
|
f.form.costing ? (F(), te("div", jr, [
|
|
5003
5033
|
V("div", Wr, [
|
|
@@ -5007,7 +5037,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5007
5037
|
"model-value": f.form.costing || null,
|
|
5008
5038
|
nullable: "",
|
|
5009
5039
|
"show-currency": "",
|
|
5010
|
-
"onUpdate:modelValue":
|
|
5040
|
+
"onUpdate:modelValue": x[6] || (x[6] = (R) => l("update:form", "costing", R ?? h(ke.Dinero).zero().toObject()))
|
|
5011
5041
|
}, null, 8, ["model-value"])
|
|
5012
5042
|
])
|
|
5013
5043
|
])) : ie("", !0)
|
|
@@ -5018,18 +5048,18 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5018
5048
|
"model-value": !!f.form.minPrice,
|
|
5019
5049
|
value: !!f.form.minPrice,
|
|
5020
5050
|
label: h(r)("menu.product.form.price.settings.min_price.label"),
|
|
5021
|
-
"onUpdate:modelValue":
|
|
5051
|
+
"onUpdate:modelValue": x[7] || (x[7] = (R) => l("update:form", "minPrice", R ? h(ke.Dinero).zero().toObject() : void 0))
|
|
5022
5052
|
}, null, 8, ["disabled", "model-value", "value", "label"]),
|
|
5023
5053
|
V("div", Hr, [
|
|
5024
5054
|
V("div", Xr, [
|
|
5025
5055
|
f.form.minPrice ? (F(), j(et, {
|
|
5026
5056
|
key: 0,
|
|
5027
|
-
max: h(
|
|
5057
|
+
max: h(ke.Dinero).fromFdoDinero(f.form.price).toUnit(),
|
|
5028
5058
|
min: 0,
|
|
5029
5059
|
"model-value": f.form.minPrice || null,
|
|
5030
5060
|
class: "flex-1",
|
|
5031
5061
|
"show-currency": "",
|
|
5032
|
-
"onUpdate:modelValue":
|
|
5062
|
+
"onUpdate:modelValue": x[8] || (x[8] = (R) => l("update:form", "minPrice", R ?? h(ke.Dinero).zero().toObject()))
|
|
5033
5063
|
}, null, 8, ["max", "model-value"])) : ie("", !0)
|
|
5034
5064
|
])
|
|
5035
5065
|
])
|
|
@@ -5057,12 +5087,12 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5057
5087
|
), o = O(
|
|
5058
5088
|
() => t.initialValue ? i("menu.common.actions.update") : i("menu.common.actions.add")
|
|
5059
5089
|
), r = ee(
|
|
5060
|
-
t.initialValue ? ue(t.initialValue) : { ...
|
|
5090
|
+
t.initialValue ? ue(t.initialValue) : { ...ze.generator.initMenuV4PrintDepartment(), usedBy: [] }
|
|
5061
5091
|
), l = ee(!1), s = ee(!1), u = (c) => {
|
|
5062
5092
|
pt.isBoolean(c) ? s.value = c : s.value = !s.value;
|
|
5063
5093
|
};
|
|
5064
|
-
async function
|
|
5065
|
-
var c,
|
|
5094
|
+
async function d() {
|
|
5095
|
+
var c, m;
|
|
5066
5096
|
try {
|
|
5067
5097
|
l.value = !0, t.initialValue ? await n.updateMenu(
|
|
5068
5098
|
{
|
|
@@ -5077,7 +5107,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5077
5107
|
module: G.F_MENU_MODULE_V4_KEY.enum.printDepartment,
|
|
5078
5108
|
operation: Ce.F_OPERATION_TYPE.create,
|
|
5079
5109
|
data: r.value,
|
|
5080
|
-
link: $t(((
|
|
5110
|
+
link: $t(((m = r.value) == null ? void 0 : m.usedBy) || [])
|
|
5081
5111
|
},
|
|
5082
5112
|
r.value.name
|
|
5083
5113
|
), u(!1);
|
|
@@ -5087,22 +5117,22 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5087
5117
|
l.value = !1;
|
|
5088
5118
|
}
|
|
5089
5119
|
}
|
|
5090
|
-
return
|
|
5120
|
+
return Re(
|
|
5091
5121
|
() => s.value,
|
|
5092
5122
|
(c) => {
|
|
5093
|
-
c && (r.value = t.initialValue ? ue(t.initialValue) : { ...
|
|
5123
|
+
c && (r.value = t.initialValue ? ue(t.initialValue) : { ...ze.generator.initMenuV4PrintDepartment(), usedBy: [] });
|
|
5094
5124
|
}
|
|
5095
|
-
), (c,
|
|
5125
|
+
), (c, m) => {
|
|
5096
5126
|
const p = N("fm-text-field"), v = N("fm-button"), y = N("fm-side-sheet");
|
|
5097
5127
|
return F(), te(Ae, null, [
|
|
5098
5128
|
ve(c.$slots, "default", { trigger: u }),
|
|
5099
5129
|
b(y, {
|
|
5100
5130
|
id: "variant-form",
|
|
5101
5131
|
modelValue: s.value,
|
|
5102
|
-
"onUpdate:modelValue":
|
|
5103
|
-
"is-container": h(
|
|
5132
|
+
"onUpdate:modelValue": m[3] || (m[3] = (_) => s.value = _),
|
|
5133
|
+
"is-container": h(xe).FmForm,
|
|
5104
5134
|
"is-container-props": {
|
|
5105
|
-
onValidationSuccess:
|
|
5135
|
+
onValidationSuccess: d,
|
|
5106
5136
|
blameFormChildOnValidationFailed: !0
|
|
5107
5137
|
},
|
|
5108
5138
|
"max-width": 560,
|
|
@@ -5124,7 +5154,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5124
5154
|
label: h(i)("menu.common.actions.cancel"),
|
|
5125
5155
|
size: "lg",
|
|
5126
5156
|
variant: "tertiary",
|
|
5127
|
-
onClick:
|
|
5157
|
+
onClick: m[2] || (m[2] = () => s.value = !1)
|
|
5128
5158
|
}, null, 8, ["label"])
|
|
5129
5159
|
])
|
|
5130
5160
|
]),
|
|
@@ -5132,7 +5162,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5132
5162
|
V("div", Qr, [
|
|
5133
5163
|
b(p, {
|
|
5134
5164
|
modelValue: r.value.name,
|
|
5135
|
-
"onUpdate:modelValue":
|
|
5165
|
+
"onUpdate:modelValue": m[0] || (m[0] = (_) => r.value.name = _),
|
|
5136
5166
|
rules: [
|
|
5137
5167
|
(_) => _ ? !0 : h(i)("menu.common.validation.required", {
|
|
5138
5168
|
field: h(i)("menu.print_dept.columns.name").toLowerCase()
|
|
@@ -5141,13 +5171,13 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5141
5171
|
autofocus: "",
|
|
5142
5172
|
label: h(i)("menu.print_dept.columns.name")
|
|
5143
5173
|
}, null, 8, ["modelValue", "rules", "label"]),
|
|
5144
|
-
c.applyProduct ? (F(), j(
|
|
5174
|
+
c.applyProduct ? (F(), j(Qn, {
|
|
5145
5175
|
key: 0,
|
|
5146
5176
|
overrides: r.value.usedBy || [],
|
|
5147
5177
|
"select-variant": !1,
|
|
5148
5178
|
editable: "",
|
|
5149
5179
|
title: h(i)("menu.print_dept.columns.products"),
|
|
5150
|
-
"onUpdate:overrides":
|
|
5180
|
+
"onUpdate:overrides": m[1] || (m[1] = (_) => r.value.usedBy = _)
|
|
5151
5181
|
}, null, 8, ["overrides", "title"])) : ie("", !0)
|
|
5152
5182
|
])
|
|
5153
5183
|
]),
|
|
@@ -5170,7 +5200,7 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5170
5200
|
const t = e, n = be(), { t: a } = he(), o = i;
|
|
5171
5201
|
function r() {
|
|
5172
5202
|
return {
|
|
5173
|
-
...
|
|
5203
|
+
...ze.generator.initMenuV4PrintSetting(),
|
|
5174
5204
|
// make toRoot default to false
|
|
5175
5205
|
toRoot: !1
|
|
5176
5206
|
};
|
|
@@ -5178,14 +5208,14 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5178
5208
|
const l = O(() => n.rules.item), s = O(() => n.printDepartments), u = O(() => {
|
|
5179
5209
|
var S;
|
|
5180
5210
|
return ((S = t.form.print) == null ? void 0 : S.sequential) ?? !1;
|
|
5181
|
-
}),
|
|
5211
|
+
}), d = O(() => {
|
|
5182
5212
|
var S;
|
|
5183
5213
|
return u.value ? s.value.reduce(
|
|
5184
|
-
(f, { _id:
|
|
5214
|
+
(f, { _id: x }) => (f.includes(x) || (f = [...f, x]), f),
|
|
5185
5215
|
[...((S = t.form.print) == null ? void 0 : S.department) ?? []]
|
|
5186
5216
|
) : s.value.map(({ _id: f }) => f);
|
|
5187
5217
|
}), c = O(() => s.value.reduce((S, f) => (S[f._id] = f.name, S), {}));
|
|
5188
|
-
function
|
|
5218
|
+
function m(S) {
|
|
5189
5219
|
o("update:form", "print", {
|
|
5190
5220
|
...r(),
|
|
5191
5221
|
...t.form.print,
|
|
@@ -5204,18 +5234,18 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5204
5234
|
...r(),
|
|
5205
5235
|
...t.form.print,
|
|
5206
5236
|
department: S.filter((f) => {
|
|
5207
|
-
var
|
|
5208
|
-
return (((
|
|
5237
|
+
var x;
|
|
5238
|
+
return (((x = t.form.print) == null ? void 0 : x.department) ?? []).includes(f);
|
|
5209
5239
|
})
|
|
5210
5240
|
});
|
|
5211
5241
|
}
|
|
5212
5242
|
function y(S, f) {
|
|
5213
5243
|
var K, U;
|
|
5214
|
-
let
|
|
5215
|
-
f && !
|
|
5244
|
+
let x = [...((U = (K = t.form) == null ? void 0 : K.print) == null ? void 0 : U.department) ?? []];
|
|
5245
|
+
f && !x.includes(S) ? x = [...x, S] : f || (x = x.filter((L) => L !== S)), o("update:form", "print", {
|
|
5216
5246
|
...r(),
|
|
5217
5247
|
...t.form.print,
|
|
5218
|
-
department:
|
|
5248
|
+
department: x
|
|
5219
5249
|
});
|
|
5220
5250
|
}
|
|
5221
5251
|
const _ = O(() => [
|
|
@@ -5230,11 +5260,11 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5230
5260
|
description: a("menu.product.form.print.kds.options.sequential.description")
|
|
5231
5261
|
}
|
|
5232
5262
|
]);
|
|
5233
|
-
return
|
|
5263
|
+
return Re(
|
|
5234
5264
|
() => s.value.length,
|
|
5235
5265
|
() => y(s.value[s.value.length - 1]._id, !0)
|
|
5236
5266
|
), (S, f) => {
|
|
5237
|
-
const
|
|
5267
|
+
const x = N("fm-switch"), K = N("fm-radio"), U = N("fm-radio-group"), L = N("fm-button"), M = N("fm-checkbox");
|
|
5238
5268
|
return F(), j(Be, {
|
|
5239
5269
|
title: h(a)("menu.product.form.print.title")
|
|
5240
5270
|
}, {
|
|
@@ -5246,14 +5276,14 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5246
5276
|
label: h(a)("menu.product.form.print.config.label")
|
|
5247
5277
|
}, {
|
|
5248
5278
|
default: P(() => {
|
|
5249
|
-
var
|
|
5279
|
+
var z;
|
|
5250
5280
|
return [
|
|
5251
|
-
b(
|
|
5252
|
-
"model-value": !((
|
|
5281
|
+
b(x, {
|
|
5282
|
+
"model-value": !((z = S.form.print) != null && z.toRoot),
|
|
5253
5283
|
label: h(a)("menu.product.form.print.config.group_parent.label"),
|
|
5254
5284
|
"label-placement": "right",
|
|
5255
5285
|
sublabel: h(a)("menu.product.form.print.config.group_parent.sublabel"),
|
|
5256
|
-
"onUpdate:modelValue": f[0] || (f[0] = (w) =>
|
|
5286
|
+
"onUpdate:modelValue": f[0] || (f[0] = (w) => m(w))
|
|
5257
5287
|
}, null, 8, ["model-value", "label", "sublabel"])
|
|
5258
5288
|
];
|
|
5259
5289
|
}),
|
|
@@ -5262,15 +5292,15 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5262
5292
|
b(U, {
|
|
5263
5293
|
label: h(a)("menu.product.form.print.kds.label"),
|
|
5264
5294
|
"model-value": ((T = S.form.print) == null ? void 0 : T.sequential) ?? !1,
|
|
5265
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
5295
|
+
"onUpdate:modelValue": f[1] || (f[1] = (z) => p(z))
|
|
5266
5296
|
}, {
|
|
5267
5297
|
default: P(() => [
|
|
5268
5298
|
V("div", is, [
|
|
5269
|
-
(F(!0), te(Ae, null, Ue(_.value, (
|
|
5299
|
+
(F(!0), te(Ae, null, Ue(_.value, (z, w) => (F(), j(K, {
|
|
5270
5300
|
key: w,
|
|
5271
|
-
label:
|
|
5272
|
-
sublabel:
|
|
5273
|
-
value:
|
|
5301
|
+
label: z.label,
|
|
5302
|
+
sublabel: z.description,
|
|
5303
|
+
value: z.value
|
|
5274
5304
|
}, null, 8, ["label", "sublabel", "value"]))), 128))
|
|
5275
5305
|
])
|
|
5276
5306
|
]),
|
|
@@ -5280,22 +5310,22 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5280
5310
|
label: h(a)("menu.product.form.print.routes.label")
|
|
5281
5311
|
}, {
|
|
5282
5312
|
default: P(() => [
|
|
5283
|
-
|
|
5313
|
+
d.value.length ? (F(), j(h(Li), {
|
|
5284
5314
|
key: 0,
|
|
5285
|
-
"item-key": (
|
|
5286
|
-
"model-value":
|
|
5315
|
+
"item-key": (z) => z,
|
|
5316
|
+
"model-value": d.value,
|
|
5287
5317
|
handle: ".handle",
|
|
5288
|
-
"onUpdate:modelValue": f[3] || (f[3] = (
|
|
5318
|
+
"onUpdate:modelValue": f[3] || (f[3] = (z) => v(z)),
|
|
5289
5319
|
class: "space-y-16"
|
|
5290
5320
|
}, {
|
|
5291
|
-
item: P(({ element:
|
|
5292
|
-
var w, A,
|
|
5321
|
+
item: P(({ element: z }) => {
|
|
5322
|
+
var w, A, k, R, $;
|
|
5293
5323
|
return [
|
|
5294
5324
|
V("div", ns, [
|
|
5295
5325
|
V("div", os, [
|
|
5296
5326
|
u.value ? (F(), j(L, {
|
|
5297
5327
|
key: 0,
|
|
5298
|
-
disabled: !((A = (w = t.form.print) == null ? void 0 : w.department) != null && A.includes(
|
|
5328
|
+
disabled: !((A = (w = t.form.print) == null ? void 0 : w.department) != null && A.includes(z)),
|
|
5299
5329
|
class: "handle",
|
|
5300
5330
|
"prepend-icon": "drag_handle",
|
|
5301
5331
|
variant: "tertiary",
|
|
@@ -5304,13 +5334,13 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5304
5334
|
}, null, 8, ["disabled"])) : ie("", !0)
|
|
5305
5335
|
]),
|
|
5306
5336
|
b(M, {
|
|
5307
|
-
id:
|
|
5308
|
-
"data-checked": (
|
|
5309
|
-
label: c.value[
|
|
5310
|
-
"model-value": ((($ = t.form.print) == null ? void 0 : $.department) ?? []).includes(
|
|
5311
|
-
value:
|
|
5337
|
+
id: z,
|
|
5338
|
+
"data-checked": (R = (k = t.form.print) == null ? void 0 : k.department) == null ? void 0 : R.includes(z),
|
|
5339
|
+
label: c.value[z],
|
|
5340
|
+
"model-value": ((($ = t.form.print) == null ? void 0 : $.department) ?? []).includes(z),
|
|
5341
|
+
value: z,
|
|
5312
5342
|
class: "flex-1",
|
|
5313
|
-
"onUpdate:modelValue": (
|
|
5343
|
+
"onUpdate:modelValue": (I) => y(z, I)
|
|
5314
5344
|
}, null, 8, ["id", "data-checked", "label", "model-value", "value", "onUpdate:modelValue"])
|
|
5315
5345
|
])
|
|
5316
5346
|
];
|
|
@@ -5318,13 +5348,13 @@ const fr = { class: "fm-typo-en-title-md-600" }, vr = {
|
|
|
5318
5348
|
_: 1
|
|
5319
5349
|
}, 8, ["item-key", "model-value"])) : ie("", !0),
|
|
5320
5350
|
b(h(ts), { "apply-product": !1 }, {
|
|
5321
|
-
default: P(({ trigger:
|
|
5351
|
+
default: P(({ trigger: z }) => [
|
|
5322
5352
|
V("div", as, [
|
|
5323
5353
|
b(L, {
|
|
5324
5354
|
variant: h(Ze).Secondary,
|
|
5325
5355
|
label: h(a)("menu.product.form.print.routes.add"),
|
|
5326
5356
|
"prepend-icon": "add",
|
|
5327
|
-
onClick:
|
|
5357
|
+
onClick: z
|
|
5328
5358
|
}, null, 8, ["variant", "label", "onClick"])
|
|
5329
5359
|
])
|
|
5330
5360
|
]),
|
|
@@ -5352,14 +5382,14 @@ function ss(e, i, t) {
|
|
|
5352
5382
|
name: e.form.name || ((s = e.fallback) == null ? void 0 : s.name) || "Product",
|
|
5353
5383
|
takeaway: e.form.takeawayUsed,
|
|
5354
5384
|
onUpdate: (u) => {
|
|
5355
|
-
var
|
|
5385
|
+
var d, c;
|
|
5356
5386
|
if (i("update:form", "takeawayUsed", u), a.value) {
|
|
5357
|
-
const
|
|
5358
|
-
|
|
5387
|
+
const m = ue(((d = e.form.variant) == null ? void 0 : d.variantCombinations) || []);
|
|
5388
|
+
m.forEach((p) => {
|
|
5359
5389
|
p.takeawayUsed || (p.takeawayUsed = u);
|
|
5360
5390
|
}), i("update:form", "variant", {
|
|
5361
5391
|
variantGroupIds: ((c = e.form.variant) == null ? void 0 : c.variantGroupIds) || [],
|
|
5362
|
-
variantCombinations:
|
|
5392
|
+
variantCombinations: m
|
|
5363
5393
|
});
|
|
5364
5394
|
}
|
|
5365
5395
|
}
|
|
@@ -5367,14 +5397,14 @@ function ss(e, i, t) {
|
|
|
5367
5397
|
];
|
|
5368
5398
|
}), r = O(() => {
|
|
5369
5399
|
var u;
|
|
5370
|
-
const s = (((u = e.form.variant) == null ? void 0 : u.variantCombinations) || []).map((
|
|
5371
|
-
key:
|
|
5372
|
-
name: e.fullCombinations[
|
|
5373
|
-
takeaway:
|
|
5374
|
-
onUpdate: (
|
|
5400
|
+
const s = (((u = e.form.variant) == null ? void 0 : u.variantCombinations) || []).map((d, c) => ({
|
|
5401
|
+
key: d.combinationKey || "",
|
|
5402
|
+
name: e.fullCombinations[d.combinationKey || ""],
|
|
5403
|
+
takeaway: d.takeawayUsed,
|
|
5404
|
+
onUpdate: (m) => {
|
|
5375
5405
|
var v, y;
|
|
5376
5406
|
const p = ue(((v = e.form.variant) == null ? void 0 : v.variantCombinations) || []);
|
|
5377
|
-
p[c].takeawayUsed =
|
|
5407
|
+
p[c].takeawayUsed = m, i("update:form", "variant", {
|
|
5378
5408
|
variantGroupIds: ((y = e.form.variant) == null ? void 0 : y.variantGroupIds) || [],
|
|
5379
5409
|
variantCombinations: p
|
|
5380
5410
|
});
|
|
@@ -5411,15 +5441,15 @@ const ls = /* @__PURE__ */ me({
|
|
|
5411
5441
|
} = he(), l = i, {
|
|
5412
5442
|
hasVariant: s,
|
|
5413
5443
|
takeaways: u
|
|
5414
|
-
} = ss(t, l, a),
|
|
5444
|
+
} = ss(t, l, a), d = O(() => [t.isOverride ? {
|
|
5415
5445
|
label: r("menu.product.form.takeaway.options.follows_main"),
|
|
5416
5446
|
value: null
|
|
5417
5447
|
} : {
|
|
5418
5448
|
label: r("menu.product.form.takeaway.options.no_preset"),
|
|
5419
5449
|
value: null
|
|
5420
|
-
}, ...n.takeaways.map((
|
|
5421
|
-
label:
|
|
5422
|
-
value:
|
|
5450
|
+
}, ...n.takeaways.map((m) => ({
|
|
5451
|
+
label: m.name,
|
|
5452
|
+
value: m._id
|
|
5423
5453
|
}))]), c = ee([{
|
|
5424
5454
|
accessorKey: "name",
|
|
5425
5455
|
enableSorting: !1,
|
|
@@ -5428,9 +5458,9 @@ const ls = /* @__PURE__ */ me({
|
|
|
5428
5458
|
accessorKey: "takeaway",
|
|
5429
5459
|
enableSorting: !1,
|
|
5430
5460
|
header: () => r("menu.product.form.takeaway.columns.takeaway"),
|
|
5431
|
-
cell: (
|
|
5432
|
-
const p =
|
|
5433
|
-
return Se(
|
|
5461
|
+
cell: (m) => {
|
|
5462
|
+
const p = m.getValue(), v = m.row.original;
|
|
5463
|
+
return Se(Wn, {
|
|
5434
5464
|
action: "add",
|
|
5435
5465
|
applyProduct: !1,
|
|
5436
5466
|
bindToVariant: n.rules.item.bindToVariant,
|
|
@@ -5445,10 +5475,10 @@ const ls = /* @__PURE__ */ me({
|
|
|
5445
5475
|
}, {
|
|
5446
5476
|
default: ({
|
|
5447
5477
|
trigger: y
|
|
5448
|
-
}) => Se(
|
|
5478
|
+
}) => Se(xe.FmSelect, {
|
|
5449
5479
|
modelValue: p || null,
|
|
5450
5480
|
menuZIndex: 103,
|
|
5451
|
-
items:
|
|
5481
|
+
items: d.value,
|
|
5452
5482
|
shiftMenu: !0,
|
|
5453
5483
|
"onUpdate:modelValue": (_) => {
|
|
5454
5484
|
v.onUpdate(_ || "");
|
|
@@ -5458,7 +5488,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
5458
5488
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
5459
5489
|
type: "button",
|
|
5460
5490
|
onClick: y
|
|
5461
|
-
}, [Se(
|
|
5491
|
+
}, [Se(xe.FmIcon, {
|
|
5462
5492
|
name: "add",
|
|
5463
5493
|
size: "md",
|
|
5464
5494
|
color: "primary"
|
|
@@ -5469,7 +5499,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
5469
5499
|
});
|
|
5470
5500
|
}
|
|
5471
5501
|
}]);
|
|
5472
|
-
return (
|
|
5502
|
+
return (m, p) => {
|
|
5473
5503
|
const v = N("fm-table");
|
|
5474
5504
|
return F(), j(Be, {
|
|
5475
5505
|
title: h(r)("menu.product.form.takeaway.title"),
|
|
@@ -5501,17 +5531,17 @@ const ls = /* @__PURE__ */ me({
|
|
|
5501
5531
|
label: c.name,
|
|
5502
5532
|
value: c._id,
|
|
5503
5533
|
disabled: !1
|
|
5504
|
-
}))), s = ee(ue(r.selectedVariants)), u = ee(""),
|
|
5534
|
+
}))), s = ee(ue(r.selectedVariants)), u = ee(""), d = () => {
|
|
5505
5535
|
t(s.value), n("primary"), i.close();
|
|
5506
5536
|
};
|
|
5507
|
-
return (c,
|
|
5537
|
+
return (c, m) => {
|
|
5508
5538
|
const p = N("FmSearch"), v = N("FmCheckbox"), y = N("FmButton");
|
|
5509
5539
|
return l.value.length > 0 ? (F(), te("div", us, [
|
|
5510
5540
|
V("div", null, [
|
|
5511
5541
|
b(p, {
|
|
5512
5542
|
autofocus: "",
|
|
5513
5543
|
modelValue: u.value,
|
|
5514
|
-
"onUpdate:modelValue":
|
|
5544
|
+
"onUpdate:modelValue": m[0] || (m[0] = (_) => u.value = _),
|
|
5515
5545
|
placeholder: h(o)("menu.common.labels.search_variants")
|
|
5516
5546
|
}, null, 8, ["modelValue", "placeholder"])
|
|
5517
5547
|
]),
|
|
@@ -5523,8 +5553,8 @@ const ls = /* @__PURE__ */ me({
|
|
|
5523
5553
|
lt(b(v, {
|
|
5524
5554
|
modelValue: s.value,
|
|
5525
5555
|
"onUpdate:modelValue": [
|
|
5526
|
-
|
|
5527
|
-
|
|
5556
|
+
m[1] || (m[1] = (S) => s.value = S),
|
|
5557
|
+
m[2] || (m[2] = (S) => h(t)(s.value))
|
|
5528
5558
|
],
|
|
5529
5559
|
label: _.label,
|
|
5530
5560
|
value: _.value
|
|
@@ -5551,11 +5581,11 @@ const ls = /* @__PURE__ */ me({
|
|
|
5551
5581
|
b(y, {
|
|
5552
5582
|
label: h(o)("menu.common.actions.cancel"),
|
|
5553
5583
|
variant: "tertiary",
|
|
5554
|
-
onClick:
|
|
5584
|
+
onClick: m[3] || (m[3] = (_) => h(i).close())
|
|
5555
5585
|
}, null, 8, ["label"]),
|
|
5556
5586
|
b(y, {
|
|
5557
5587
|
label: h(o)("menu.common.actions.confirm"),
|
|
5558
|
-
onClick:
|
|
5588
|
+
onClick: m[4] || (m[4] = (_) => d())
|
|
5559
5589
|
}, null, 8, ["label"])
|
|
5560
5590
|
])
|
|
5561
5591
|
])
|
|
@@ -5604,26 +5634,26 @@ const ls = /* @__PURE__ */ me({
|
|
|
5604
5634
|
}) {
|
|
5605
5635
|
const t = e, n = be(), a = ti(), o = Ee(), r = Ne(), {
|
|
5606
5636
|
t: l
|
|
5607
|
-
} = he(), s = ee(!1), u = O(() => n.rules.item),
|
|
5637
|
+
} = he(), s = ee(!1), u = O(() => n.rules.item), d = O(() => u.value.minPrice && !!t.form.minPrice), c = O(() => !n.state.currentCatalogId), m = O(() => n.variants.reduce((w, A) => (w[A._id] = A, w), {})), p = i;
|
|
5608
5638
|
function v(w) {
|
|
5609
5639
|
const A = Ve.clone(t.form);
|
|
5610
5640
|
for (const {
|
|
5611
|
-
key:
|
|
5612
|
-
value:
|
|
5641
|
+
key: k,
|
|
5642
|
+
value: R
|
|
5613
5643
|
} of w)
|
|
5614
|
-
A[
|
|
5644
|
+
A[k] = R;
|
|
5615
5645
|
p("replace:form", A);
|
|
5616
5646
|
}
|
|
5617
5647
|
function y(w) {
|
|
5618
|
-
var
|
|
5648
|
+
var k;
|
|
5619
5649
|
const A = S(w.combinationKey || "");
|
|
5620
5650
|
return {
|
|
5621
5651
|
...w,
|
|
5622
5652
|
price: A == null ? void 0 : A.price,
|
|
5623
5653
|
inventoryBindings: (A == null ? void 0 : A.inventoryBindings) || t.form.inventoryBindings,
|
|
5624
5654
|
takeawayUsed: (A == null ? void 0 : A.takeawayUsed) || t.form.takeawayUsed,
|
|
5625
|
-
groups: (A == null ? void 0 : A.groups) || ((
|
|
5626
|
-
...
|
|
5655
|
+
groups: (A == null ? void 0 : A.groups) || ((k = t.form.groups) == null ? void 0 : k.map((R) => ({
|
|
5656
|
+
...R,
|
|
5627
5657
|
groupKey: ""
|
|
5628
5658
|
})))
|
|
5629
5659
|
};
|
|
@@ -5642,37 +5672,37 @@ const ls = /* @__PURE__ */ me({
|
|
|
5642
5672
|
}
|
|
5643
5673
|
function S(w) {
|
|
5644
5674
|
var g, C;
|
|
5645
|
-
const A = ((g = t.form.variant) == null ? void 0 : g.variantGroupIds) || [],
|
|
5646
|
-
return
|
|
5675
|
+
const A = ((g = t.form.variant) == null ? void 0 : g.variantGroupIds) || [], k = (C = t.form.variant) == null ? void 0 : C.variantCombinations, I = w.split(/(?=variant)/g).map((W) => W.replace(/\/*$/, "")).filter((W) => A.some((ae) => W.includes(ae))).join("/");
|
|
5676
|
+
return k == null ? void 0 : k.find((W) => W.combinationKey === I);
|
|
5647
5677
|
}
|
|
5648
5678
|
const f = (w) => {
|
|
5649
5679
|
K(w);
|
|
5650
|
-
},
|
|
5680
|
+
}, x = O(() => {
|
|
5651
5681
|
var A;
|
|
5652
|
-
return (((A = t.form.variant) == null ? void 0 : A.variantCombinations) || []).map((
|
|
5653
|
-
var $,
|
|
5654
|
-
const
|
|
5682
|
+
return (((A = t.form.variant) == null ? void 0 : A.variantCombinations) || []).map((k) => {
|
|
5683
|
+
var $, I;
|
|
5684
|
+
const R = (I = ($ = t.fallback) == null ? void 0 : $.variant) == null ? void 0 : I.variantCombinations.find(({
|
|
5655
5685
|
combinationKey: g
|
|
5656
|
-
}) => g ===
|
|
5686
|
+
}) => g === k.combinationKey);
|
|
5657
5687
|
return {
|
|
5658
|
-
...
|
|
5688
|
+
...k,
|
|
5659
5689
|
fallback: {
|
|
5660
|
-
...
|
|
5661
|
-
_id:
|
|
5662
|
-
combinationKey:
|
|
5663
|
-
price: c.value ? t.form.price ?? (
|
|
5664
|
-
minPrice: t.form.minPrice ?? (
|
|
5690
|
+
...R,
|
|
5691
|
+
_id: k._id,
|
|
5692
|
+
combinationKey: k.combinationKey,
|
|
5693
|
+
price: c.value ? t.form.price ?? (R == null ? void 0 : R.price) : k.price ?? (R == null ? void 0 : R.price),
|
|
5694
|
+
minPrice: t.form.minPrice ?? (R == null ? void 0 : R.minPrice),
|
|
5665
5695
|
priceTiers: t.form.priceTiers
|
|
5666
5696
|
}
|
|
5667
5697
|
};
|
|
5668
5698
|
});
|
|
5669
5699
|
});
|
|
5670
|
-
function K(w, A = (
|
|
5700
|
+
function K(w, A = (k) => k) {
|
|
5671
5701
|
var $;
|
|
5672
|
-
const
|
|
5673
|
-
let
|
|
5674
|
-
if (
|
|
5675
|
-
const
|
|
5702
|
+
const k = w.filter((I) => !!I);
|
|
5703
|
+
let R;
|
|
5704
|
+
if (k.length) {
|
|
5705
|
+
const I = k.map((C) => n.variants.find((W) => W._id === C)), g = ze.fullVariantCombination(I).map(({
|
|
5676
5706
|
combinationKey: C
|
|
5677
5707
|
}) => {
|
|
5678
5708
|
var ae;
|
|
@@ -5689,36 +5719,36 @@ const ls = /* @__PURE__ */ me({
|
|
|
5689
5719
|
});
|
|
5690
5720
|
return;
|
|
5691
5721
|
}
|
|
5692
|
-
|
|
5722
|
+
R = {
|
|
5693
5723
|
...t.form,
|
|
5694
5724
|
variant: {
|
|
5695
|
-
variantGroupIds:
|
|
5725
|
+
variantGroupIds: k,
|
|
5696
5726
|
variantCombinations: g
|
|
5697
5727
|
},
|
|
5698
5728
|
inventoryBindings: null,
|
|
5699
5729
|
takeawayUsed: null
|
|
5700
5730
|
};
|
|
5701
5731
|
} else {
|
|
5702
|
-
const
|
|
5732
|
+
const I = ($ = t.form.variant) == null ? void 0 : $.variantCombinations.map((C) => C.takeawayUsed), g = [...new Set(I)];
|
|
5703
5733
|
v([{
|
|
5704
5734
|
key: "variant",
|
|
5705
5735
|
value: void 0
|
|
5706
5736
|
}, {
|
|
5707
5737
|
key: "takeawayUsed",
|
|
5708
5738
|
value: g.length === 1 ? g[0] : null
|
|
5709
|
-
}]),
|
|
5739
|
+
}]), R = {
|
|
5710
5740
|
...t.form,
|
|
5711
5741
|
variant: void 0,
|
|
5712
5742
|
takeawayUsed: g.length === 1 ? g[0] : null
|
|
5713
5743
|
};
|
|
5714
5744
|
}
|
|
5715
|
-
p("replace:form", a.initDynamicGroupItem(
|
|
5745
|
+
p("replace:form", a.initDynamicGroupItem(R));
|
|
5716
5746
|
}
|
|
5717
|
-
async function U(w, A,
|
|
5718
|
-
const
|
|
5719
|
-
|
|
5747
|
+
async function U(w, A, k) {
|
|
5748
|
+
const R = Ve.clone(t.form);
|
|
5749
|
+
R.variant.variantCombinations[w][A] = k, v([{
|
|
5720
5750
|
key: "variant",
|
|
5721
|
-
value:
|
|
5751
|
+
value: R.variant
|
|
5722
5752
|
}]);
|
|
5723
5753
|
}
|
|
5724
5754
|
const L = O(() => {
|
|
@@ -5734,9 +5764,9 @@ const ls = /* @__PURE__ */ me({
|
|
|
5734
5764
|
header: () => l("menu.product.form.variant.columns.code"),
|
|
5735
5765
|
enableSorting: !1,
|
|
5736
5766
|
cell: (w) => {
|
|
5737
|
-
var
|
|
5738
|
-
const A = w.getValue(),
|
|
5739
|
-
return b(
|
|
5767
|
+
var I, g;
|
|
5768
|
+
const A = w.getValue(), k = w.row.original, $ = ((I = k.fallback) == null ? void 0 : I.code) ?? t.form.code ?? ((g = t.fallback) == null ? void 0 : g.code);
|
|
5769
|
+
return b(xe.FmTextField, {
|
|
5740
5770
|
modelValue: A,
|
|
5741
5771
|
placeholder: $ || l("menu.product.form.variant.placeholders.no_code"),
|
|
5742
5772
|
rules: [(C) => {
|
|
@@ -5744,8 +5774,8 @@ const ls = /* @__PURE__ */ me({
|
|
|
5744
5774
|
var E;
|
|
5745
5775
|
if (!n.state.featureFlags.uniqueProductCode || !W) return 0;
|
|
5746
5776
|
let re = n.itemCodeMap.get(W) || 0;
|
|
5747
|
-
return
|
|
5748
|
-
D.combinationKey !==
|
|
5777
|
+
return k.code === W && re > 0 && (re -= 1), W === $ && (re += 1), (E = t.form.variant) == null || E.variantCombinations.forEach((D) => {
|
|
5778
|
+
D.combinationKey !== k.combinationKey && D.code === W && (re += 1);
|
|
5749
5779
|
}), re;
|
|
5750
5780
|
});
|
|
5751
5781
|
return s.value && ae.value > 0 ? l("menu.product.form.detail.fields.code.duplicate_warning", {
|
|
@@ -5762,11 +5792,11 @@ const ls = /* @__PURE__ */ me({
|
|
|
5762
5792
|
header: () => l("menu.product.form.variant.columns.order_from"),
|
|
5763
5793
|
enableSorting: !1,
|
|
5764
5794
|
cell: (w) => {
|
|
5765
|
-
var $,
|
|
5766
|
-
const A = w.getValue(),
|
|
5795
|
+
var $, I;
|
|
5796
|
+
const A = w.getValue(), R = ($ = w.row.original.fallback) == null ? void 0 : $.orderFrom;
|
|
5767
5797
|
return b(ei, {
|
|
5768
5798
|
modelValue: A,
|
|
5769
|
-
fallback: t.form.orderFrom ??
|
|
5799
|
+
fallback: t.form.orderFrom ?? R ?? ((I = t.fallback) == null ? void 0 : I.orderFrom),
|
|
5770
5800
|
disable: !u.value.orderFrom,
|
|
5771
5801
|
required: u.value.orderFrom && u.value.orderFromActiveOnly,
|
|
5772
5802
|
editActiveOnly: u.value.orderFromActiveOnly || !1,
|
|
@@ -5783,8 +5813,8 @@ const ls = /* @__PURE__ */ me({
|
|
|
5783
5813
|
size: 200,
|
|
5784
5814
|
enableSorting: !1,
|
|
5785
5815
|
cell: (w) => {
|
|
5786
|
-
var
|
|
5787
|
-
const A = w.getValue(),
|
|
5816
|
+
var I, g, C;
|
|
5817
|
+
const A = w.getValue(), k = w.row.original, $ = ((I = k.fallback) == null ? void 0 : I.price) ?? t.form.price ?? ((g = t.fallback) == null ? void 0 : g.price);
|
|
5788
5818
|
return b("div", {
|
|
5789
5819
|
class: "flex items-center gap-8"
|
|
5790
5820
|
}, [b(et, {
|
|
@@ -5798,8 +5828,8 @@ const ls = /* @__PURE__ */ me({
|
|
|
5798
5828
|
nullable: !0,
|
|
5799
5829
|
showCurrency: !1
|
|
5800
5830
|
}, null), n.isV4 && !t.isOverride && b(pn, {
|
|
5801
|
-
"price-tiers":
|
|
5802
|
-
fallback: (C =
|
|
5831
|
+
"price-tiers": k.priceTiers,
|
|
5832
|
+
fallback: (C = k.fallback) == null ? void 0 : C.priceTiers,
|
|
5803
5833
|
"onUpdate:price-tiers": (W) => U(w.row.index, "priceTiers", W)
|
|
5804
5834
|
}, null)]);
|
|
5805
5835
|
}
|
|
@@ -5808,12 +5838,12 @@ const ls = /* @__PURE__ */ me({
|
|
|
5808
5838
|
header: () => l("menu.product.form.variant.columns.min_price"),
|
|
5809
5839
|
enableSorting: !1,
|
|
5810
5840
|
cell: (w) => {
|
|
5811
|
-
var
|
|
5812
|
-
const A = w.getValue(),
|
|
5841
|
+
var I, g, C;
|
|
5842
|
+
const A = w.getValue(), k = w.row.original, $ = ((I = k.fallback) == null ? void 0 : I.minPrice) ?? t.form.minPrice ?? ((g = t.fallback) == null ? void 0 : g.minPrice);
|
|
5813
5843
|
return b(et, {
|
|
5814
5844
|
placeholder: $ ? ot($) : void 0,
|
|
5815
5845
|
modelValue: A,
|
|
5816
|
-
max:
|
|
5846
|
+
max: ke.Dinero.fromFdoDinero(k.price ?? ((C = k.fallback) == null ? void 0 : C.price) ?? ke.Dinero.zero().toObject()).toUnit(),
|
|
5817
5847
|
"onUpdate:model-value": (W) => {
|
|
5818
5848
|
U(w.row.index, "minPrice", W);
|
|
5819
5849
|
},
|
|
@@ -5822,20 +5852,20 @@ const ls = /* @__PURE__ */ me({
|
|
|
5822
5852
|
}, null);
|
|
5823
5853
|
}
|
|
5824
5854
|
}]), T = O(() => ({
|
|
5825
|
-
minPrice:
|
|
5855
|
+
minPrice: d.value
|
|
5826
5856
|
}));
|
|
5827
|
-
function
|
|
5857
|
+
function z(w) {
|
|
5828
5858
|
return w != null && w.length && w.length > n.rules.item.maxVariant ? l("menu.product.form.variant.validation.max_variants", {
|
|
5829
5859
|
max: n.rules.item.maxVariant
|
|
5830
5860
|
}) : !0;
|
|
5831
5861
|
}
|
|
5832
5862
|
return (w, A) => {
|
|
5833
|
-
const
|
|
5863
|
+
const k = N("fm-button"), R = N("fm-icon"), $ = N("FmFormGroup"), I = N("fm-table");
|
|
5834
5864
|
return F(), j(Be, {
|
|
5835
5865
|
title: h(l)("menu.product.form.variant.title"),
|
|
5836
5866
|
"sub-title": h(l)("menu.product.form.variant.subtitle")
|
|
5837
5867
|
}, {
|
|
5838
|
-
"append-title": P(() => [h(n).rules.item.variant ? (F(), j(
|
|
5868
|
+
"append-title": P(() => [h(n).rules.item.variant ? (F(), j(k, {
|
|
5839
5869
|
key: 0,
|
|
5840
5870
|
label: h(l)("menu.product.form.variant.add"),
|
|
5841
5871
|
variant: "secondary",
|
|
@@ -5846,7 +5876,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
5846
5876
|
var g;
|
|
5847
5877
|
return [V("div", bs, [b($, {
|
|
5848
5878
|
"model-value": (g = w.form.variant) == null ? void 0 : g.variantGroupIds,
|
|
5849
|
-
rules: [
|
|
5879
|
+
rules: [z]
|
|
5850
5880
|
}, {
|
|
5851
5881
|
default: P(() => {
|
|
5852
5882
|
var C;
|
|
@@ -5862,11 +5892,11 @@ const ls = /* @__PURE__ */ me({
|
|
|
5862
5892
|
element: W
|
|
5863
5893
|
}) => {
|
|
5864
5894
|
var ae;
|
|
5865
|
-
return [V("div", ys, [b(
|
|
5895
|
+
return [V("div", ys, [b(k, {
|
|
5866
5896
|
variant: h(Ze).Tertiary,
|
|
5867
5897
|
class: "handle",
|
|
5868
5898
|
"prepend-icon": "drag_handle"
|
|
5869
|
-
}, null, 8, ["variant"]), V("div", _s, [V("p", ws, de((ae =
|
|
5899
|
+
}, null, 8, ["variant"]), V("div", _s, [V("p", ws, de((ae = m.value[W]) == null ? void 0 : ae.name), 1), b(R, {
|
|
5870
5900
|
class: "cursor-pointer",
|
|
5871
5901
|
name: "close",
|
|
5872
5902
|
onClick: Ct((re) => {
|
|
@@ -5880,13 +5910,13 @@ const ls = /* @__PURE__ */ me({
|
|
|
5880
5910
|
}),
|
|
5881
5911
|
_: 1
|
|
5882
5912
|
}, 8, ["model-value", "rules"]), b(dn, null, {
|
|
5883
|
-
default: P(() => [
|
|
5913
|
+
default: P(() => [x.value.length ? (F(), j(I, {
|
|
5884
5914
|
key: 0,
|
|
5885
5915
|
class: "w-full",
|
|
5886
5916
|
"column-defs": M.value,
|
|
5887
5917
|
"column-visibility": T.value,
|
|
5888
|
-
"page-size":
|
|
5889
|
-
"row-data":
|
|
5918
|
+
"page-size": x.value.length ?? 0,
|
|
5919
|
+
"row-data": x.value ?? [],
|
|
5890
5920
|
"hide-footer": "",
|
|
5891
5921
|
"shrink-at": !1
|
|
5892
5922
|
}, null, 8, ["column-defs", "column-visibility", "page-size", "row-data"])) : ie("", !0)]),
|
|
@@ -5899,13 +5929,13 @@ const ls = /* @__PURE__ */ me({
|
|
|
5899
5929
|
}
|
|
5900
5930
|
}), Cs = {
|
|
5901
5931
|
class: /* @__PURE__ */ Fe(["flex", "space-x-40", "max-w-[1200px] mx-auto w-full"])
|
|
5902
|
-
},
|
|
5932
|
+
}, ks = {
|
|
5903
5933
|
key: 1,
|
|
5904
5934
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
5905
|
-
},
|
|
5935
|
+
}, Rs = {
|
|
5906
5936
|
key: 3,
|
|
5907
5937
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
5908
|
-
},
|
|
5938
|
+
}, xs = {
|
|
5909
5939
|
key: 4,
|
|
5910
5940
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
5911
5941
|
}, As = {
|
|
@@ -5920,7 +5950,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
5920
5950
|
}, Os = {
|
|
5921
5951
|
key: 11,
|
|
5922
5952
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
5923
|
-
},
|
|
5953
|
+
}, Is = /* @__PURE__ */ me({
|
|
5924
5954
|
__name: "Form",
|
|
5925
5955
|
props: {
|
|
5926
5956
|
initialForm: {},
|
|
@@ -5935,26 +5965,26 @@ const ls = /* @__PURE__ */ me({
|
|
|
5935
5965
|
ut(async () => {
|
|
5936
5966
|
t.autoShow && (await u(100), c());
|
|
5937
5967
|
});
|
|
5938
|
-
const
|
|
5939
|
-
|
|
5940
|
-
() =>
|
|
5968
|
+
const d = ee(!1);
|
|
5969
|
+
Re(
|
|
5970
|
+
() => d.value,
|
|
5941
5971
|
async (H) => {
|
|
5942
5972
|
await u(500), n("update:show", H);
|
|
5943
5973
|
}
|
|
5944
5974
|
);
|
|
5945
5975
|
const c = () => {
|
|
5946
|
-
|
|
5947
|
-
},
|
|
5976
|
+
d.value = !d.value;
|
|
5977
|
+
}, m = ee(), p = ee(
|
|
5948
5978
|
t.initialForm ? ue(t.initialForm) : {
|
|
5949
|
-
...
|
|
5979
|
+
...ze.generator.initMenuV4Item(),
|
|
5950
5980
|
category: t.categoryId
|
|
5951
5981
|
}
|
|
5952
5982
|
), v = ee(null);
|
|
5953
|
-
|
|
5983
|
+
Re(
|
|
5954
5984
|
() => t.initialForm,
|
|
5955
5985
|
async () => {
|
|
5956
5986
|
if (t.initialForm)
|
|
5957
|
-
v.value = await
|
|
5987
|
+
v.value = await Ln(
|
|
5958
5988
|
a.state.menu,
|
|
5959
5989
|
t.initialForm._id
|
|
5960
5990
|
);
|
|
@@ -5966,14 +5996,14 @@ const ls = /* @__PURE__ */ me({
|
|
|
5966
5996
|
}
|
|
5967
5997
|
);
|
|
5968
5998
|
const y = ti(), _ = async ([H, B]) => {
|
|
5969
|
-
a.selectCatalog(H), a.selectScheduler(B), await
|
|
5999
|
+
a.selectCatalog(H), a.selectScheduler(B), await zi(), y.update(p.value._id), setTimeout(() => {
|
|
5970
6000
|
n("update:show", !1);
|
|
5971
6001
|
}, 100);
|
|
5972
6002
|
}, S = O(() => {
|
|
5973
6003
|
var H;
|
|
5974
6004
|
return a.mapVariant((H = p.value.variant) == null ? void 0 : H.variantGroupIds);
|
|
5975
6005
|
}), f = ee(null);
|
|
5976
|
-
|
|
6006
|
+
Re(
|
|
5977
6007
|
() => p.value.thumbnail,
|
|
5978
6008
|
async (H) => {
|
|
5979
6009
|
H && (typeof H == "string" ? f.value = await So(H, "thumbnail.jpg", "image/jpeg") : f.value = H);
|
|
@@ -5982,7 +6012,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
5982
6012
|
immediate: !0
|
|
5983
6013
|
}
|
|
5984
6014
|
);
|
|
5985
|
-
const
|
|
6015
|
+
const x = (H, B) => {
|
|
5986
6016
|
p.value = {
|
|
5987
6017
|
...ue(p.value),
|
|
5988
6018
|
[H]: B
|
|
@@ -5990,7 +6020,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
5990
6020
|
};
|
|
5991
6021
|
async function K() {
|
|
5992
6022
|
var H, B;
|
|
5993
|
-
|
|
6023
|
+
m.value = p.value._id && U.value ? (await Gn(
|
|
5994
6024
|
a.mergedMenu,
|
|
5995
6025
|
[p.value],
|
|
5996
6026
|
a.state.menu,
|
|
@@ -6002,18 +6032,18 @@ const ls = /* @__PURE__ */ me({
|
|
|
6002
6032
|
() => !!a.currentCatalog || !!a.state.currentSchedulerId
|
|
6003
6033
|
), L = O(() => {
|
|
6004
6034
|
var H;
|
|
6005
|
-
return U.value ? p.value.category == "" || p.value.category == null && ((H =
|
|
6035
|
+
return U.value ? p.value.category == "" || p.value.category == null && ((H = m.value) == null ? void 0 : H.category) == null : a.version === G.F_MENU_VERSION.enum.v4 && p.value.category == null;
|
|
6006
6036
|
}), M = O(() => o.itemAttributeSettings.value.length > 0 && !U.value);
|
|
6007
6037
|
function T() {
|
|
6008
6038
|
var fe;
|
|
6009
6039
|
const H = a.getSelectedTax(
|
|
6010
6040
|
p.value.taxes,
|
|
6011
|
-
(fe =
|
|
6041
|
+
(fe = m.value) == null ? void 0 : fe.taxes,
|
|
6012
6042
|
a.taxSetting.countryTaxOptions
|
|
6013
6043
|
), pe = a.taxSetting.countryTaxOptions.find((Q) => Q.value === H);
|
|
6014
6044
|
return pe ? On(pe.meta.rate) : "-";
|
|
6015
6045
|
}
|
|
6016
|
-
function
|
|
6046
|
+
function z() {
|
|
6017
6047
|
f.value = null, p.value.thumbnail = null;
|
|
6018
6048
|
}
|
|
6019
6049
|
const w = O(() => {
|
|
@@ -6023,11 +6053,11 @@ const ls = /* @__PURE__ */ me({
|
|
|
6023
6053
|
items: [
|
|
6024
6054
|
{
|
|
6025
6055
|
name: r("menu.product.form.summary.fields.code"),
|
|
6026
|
-
value: p.value.code || ((H =
|
|
6056
|
+
value: p.value.code || ((H = m.value) == null ? void 0 : H.code) || "-"
|
|
6027
6057
|
},
|
|
6028
6058
|
{
|
|
6029
6059
|
name: r("menu.product.form.summary.fields.name"),
|
|
6030
|
-
value: p.value.name || ((B =
|
|
6060
|
+
value: p.value.name || ((B = m.value) == null ? void 0 : B.name) || "-"
|
|
6031
6061
|
},
|
|
6032
6062
|
{
|
|
6033
6063
|
name: r("menu.product.form.summary.fields.category"),
|
|
@@ -6035,11 +6065,11 @@ const ls = /* @__PURE__ */ me({
|
|
|
6035
6065
|
},
|
|
6036
6066
|
{
|
|
6037
6067
|
name: r("menu.product.form.summary.fields.order_from"),
|
|
6038
|
-
value: p.value.orderFrom || ((fe =
|
|
6068
|
+
value: p.value.orderFrom || ((fe = m.value) == null ? void 0 : fe.orderFrom) || "-"
|
|
6039
6069
|
},
|
|
6040
6070
|
{
|
|
6041
6071
|
name: r("menu.product.form.summary.fields.selling_price"),
|
|
6042
|
-
value: p.value.price ?
|
|
6072
|
+
value: p.value.price ? ke.Dinero.fromFdoDinero(p.value.price).toFormat() : (Q = m.value) != null && Q.price ? ke.Dinero.fromFdoDinero(m.value.price).toFormat() : "-"
|
|
6043
6073
|
},
|
|
6044
6074
|
{
|
|
6045
6075
|
name: r("menu.product.form.summary.fields.tax"),
|
|
@@ -6047,14 +6077,14 @@ const ls = /* @__PURE__ */ me({
|
|
|
6047
6077
|
},
|
|
6048
6078
|
{
|
|
6049
6079
|
name: r("menu.product.form.summary.fields.inventory"),
|
|
6050
|
-
value: (li = p.value.inventoryBindings) != null && li.length ? String(p.value.inventoryBindings.length) : (ci = (ui =
|
|
6080
|
+
value: (li = p.value.inventoryBindings) != null && li.length ? String(p.value.inventoryBindings.length) : (ci = (ui = m.value) == null ? void 0 : ui.inventoryBindings) != null && ci.length ? String(m.value.inventoryBindings.length) : "-"
|
|
6051
6081
|
},
|
|
6052
6082
|
{
|
|
6053
6083
|
name: r("menu.product.form.summary.fields.takeaway"),
|
|
6054
6084
|
value: ((di = a.state.menu.modules.takeaway.find(
|
|
6055
6085
|
(Mt) => {
|
|
6056
6086
|
var mi;
|
|
6057
|
-
return Mt._id === (p.value.takeawayUsed || ((mi =
|
|
6087
|
+
return Mt._id === (p.value.takeawayUsed || ((mi = m.value) == null ? void 0 : mi.takeawayUsed));
|
|
6058
6088
|
}
|
|
6059
6089
|
)) == null ? void 0 : di.name) || "-"
|
|
6060
6090
|
}
|
|
@@ -6063,7 +6093,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
6063
6093
|
}), A = ee(
|
|
6064
6094
|
p.value.category != null || !!p.value.code || !!p.value.orderFrom
|
|
6065
6095
|
);
|
|
6066
|
-
function
|
|
6096
|
+
function k(H) {
|
|
6067
6097
|
H || (p.value = {
|
|
6068
6098
|
...p.value,
|
|
6069
6099
|
name: void 0,
|
|
@@ -6072,7 +6102,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
6072
6102
|
orderFrom: void 0
|
|
6073
6103
|
});
|
|
6074
6104
|
}
|
|
6075
|
-
const
|
|
6105
|
+
const R = O(() => {
|
|
6076
6106
|
const H = {};
|
|
6077
6107
|
return a.state.menu.modules.item.forEach((B) => {
|
|
6078
6108
|
var pe;
|
|
@@ -6080,7 +6110,7 @@ const ls = /* @__PURE__ */ me({
|
|
|
6080
6110
|
typeof Q == "string" && Q && !((pe = H[fe]) != null && pe.includes(Q)) && (H[fe] = [...H[fe] || [], Q]);
|
|
6081
6111
|
}), H;
|
|
6082
6112
|
}), $ = ee(!!p.value.price || !!p.value.minPrice || !!p.value.costing);
|
|
6083
|
-
function
|
|
6113
|
+
function I(H) {
|
|
6084
6114
|
H || (p.value = {
|
|
6085
6115
|
...p.value,
|
|
6086
6116
|
costing: void 0,
|
|
@@ -6166,14 +6196,14 @@ const ls = /* @__PURE__ */ me({
|
|
|
6166
6196
|
}
|
|
6167
6197
|
});
|
|
6168
6198
|
}
|
|
6169
|
-
|
|
6199
|
+
Re(() => {
|
|
6170
6200
|
var H;
|
|
6171
6201
|
return (H = p.value.price) == null ? void 0 : H.amount;
|
|
6172
|
-
}, K, { deep: !0 }),
|
|
6173
|
-
() =>
|
|
6202
|
+
}, K, { deep: !0 }), Re(
|
|
6203
|
+
() => d.value,
|
|
6174
6204
|
(H) => {
|
|
6175
6205
|
H && (p.value = t.initialForm ? ue(t.initialForm) : {
|
|
6176
|
-
...
|
|
6206
|
+
...ze.generator.initMenuV4Item(),
|
|
6177
6207
|
category: t.categoryId
|
|
6178
6208
|
});
|
|
6179
6209
|
}
|
|
@@ -6191,43 +6221,43 @@ const ls = /* @__PURE__ */ me({
|
|
|
6191
6221
|
console.log(H);
|
|
6192
6222
|
}
|
|
6193
6223
|
});
|
|
6194
|
-
const X =
|
|
6224
|
+
const X = yo();
|
|
6195
6225
|
ut(() => {
|
|
6196
6226
|
X.isUpdatingItem || (X.isUpdatingItem = !0, X.storedCatalogId = a.state.currentCatalogId, X.storedSchedulerId = a.state.currentSchedulerId);
|
|
6197
6227
|
});
|
|
6198
|
-
function
|
|
6228
|
+
function oe() {
|
|
6199
6229
|
X.isUpdatingItem = !1, a.selectCatalog(X.storedCatalogId), a.selectScheduler(X.storedSchedulerId);
|
|
6200
6230
|
}
|
|
6201
6231
|
function ce() {
|
|
6202
6232
|
U.value && [
|
|
6203
|
-
[A.value,
|
|
6204
|
-
[$.value,
|
|
6233
|
+
[A.value, k],
|
|
6234
|
+
[$.value, I]
|
|
6205
6235
|
].forEach(([B, pe]) => {
|
|
6206
6236
|
B || pe(!1);
|
|
6207
|
-
}), n("submit:form", p.value, f.value), c(),
|
|
6237
|
+
}), n("submit:form", p.value, f.value), c(), oe();
|
|
6208
6238
|
}
|
|
6209
|
-
function
|
|
6210
|
-
c(),
|
|
6239
|
+
function ne() {
|
|
6240
|
+
c(), oe();
|
|
6211
6241
|
}
|
|
6212
|
-
const { isAtMost: Le } = Di(), ii = ee(null), vn =
|
|
6242
|
+
const { isAtMost: Le } = Di(), ii = ee(null), vn = $n(ii);
|
|
6213
6243
|
return (H, B) => (F(), te(Ae, null, [
|
|
6214
6244
|
ve(H.$slots, "trigger", wn(Sn({
|
|
6215
6245
|
trigger: c
|
|
6216
6246
|
}))),
|
|
6217
|
-
b(
|
|
6247
|
+
b(Vn, {
|
|
6218
6248
|
title: l.value,
|
|
6219
|
-
show:
|
|
6249
|
+
show: d.value,
|
|
6220
6250
|
"primary-action": {
|
|
6221
6251
|
label: t.action === "add" ? h(r)("menu.common.actions.add") : h(r)("menu.common.actions.update")
|
|
6222
6252
|
},
|
|
6223
6253
|
"secondary-actions": [
|
|
6224
6254
|
{
|
|
6225
6255
|
label: h(r)("menu.common.actions.cancel"),
|
|
6226
|
-
click:
|
|
6256
|
+
click: ne
|
|
6227
6257
|
}
|
|
6228
6258
|
],
|
|
6229
6259
|
onOnPrimary: ce,
|
|
6230
|
-
onOnCancel:
|
|
6260
|
+
onOnCancel: ne
|
|
6231
6261
|
}, {
|
|
6232
6262
|
"append-title": P(() => [
|
|
6233
6263
|
h(Le)("sm") ? (F(), j(vi, {
|
|
@@ -6257,17 +6287,17 @@ const ls = /* @__PURE__ */ me({
|
|
|
6257
6287
|
ref: ii,
|
|
6258
6288
|
class: Fe(["flex-1 py-24 space-y-24", "xs:w-full"])
|
|
6259
6289
|
}, [
|
|
6260
|
-
v.value && (Object.keys(v.value.catalogs || {}).length > 0 || v.value.schedulers.length > 0) ? (F(), j(
|
|
6290
|
+
v.value && (Object.keys(v.value.catalogs || {}).length > 0 || v.value.schedulers.length > 0) ? (F(), j(mo, {
|
|
6261
6291
|
key: 0,
|
|
6262
6292
|
"linked-status": v.value,
|
|
6263
6293
|
"onUpdate:catalogAndScheduler": _
|
|
6264
6294
|
}, null, 8, ["linked-status"])) : ie("", !0),
|
|
6265
|
-
b(
|
|
6295
|
+
b(Un, { "menu-store": h(a) }, null, 8, ["menu-store"]),
|
|
6266
6296
|
b(Qe, {
|
|
6267
6297
|
toggle: A.value,
|
|
6268
6298
|
"onUpdate:toggle": [
|
|
6269
6299
|
B[1] || (B[1] = (Q) => A.value = Q),
|
|
6270
|
-
B[2] || (B[2] = (Q) =>
|
|
6300
|
+
B[2] || (B[2] = (Q) => k(Q))
|
|
6271
6301
|
],
|
|
6272
6302
|
disabled: !U.value,
|
|
6273
6303
|
description: h(r)("menu.product.form.sections.general.description"),
|
|
@@ -6275,20 +6305,20 @@ const ls = /* @__PURE__ */ me({
|
|
|
6275
6305
|
}, {
|
|
6276
6306
|
default: P(() => [
|
|
6277
6307
|
b(Ka, {
|
|
6278
|
-
fallback:
|
|
6308
|
+
fallback: m.value,
|
|
6279
6309
|
form: p.value,
|
|
6280
6310
|
"is-addon": L.value,
|
|
6281
6311
|
"is-override": U.value,
|
|
6282
6312
|
"is-create": t.action === "add",
|
|
6283
6313
|
thumbnail: f.value,
|
|
6284
|
-
"onUpdate:form":
|
|
6314
|
+
"onUpdate:form": x,
|
|
6285
6315
|
"onUpdate:thumbnail": B[0] || (B[0] = (Q) => f.value = Q),
|
|
6286
|
-
"onReset:thumbnail":
|
|
6316
|
+
"onReset:thumbnail": z
|
|
6287
6317
|
}, null, 8, ["fallback", "form", "is-addon", "is-override", "is-create", "thumbnail"])
|
|
6288
6318
|
]),
|
|
6289
6319
|
_: 1
|
|
6290
6320
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
6291
|
-
U.value ? ie("", !0) : (F(), te("div",
|
|
6321
|
+
U.value ? ie("", !0) : (F(), te("div", ks)),
|
|
6292
6322
|
M.value ? (F(), j(Be, {
|
|
6293
6323
|
key: 2,
|
|
6294
6324
|
title: h(r)("menu.product.form.sections.tagging.title"),
|
|
@@ -6298,18 +6328,18 @@ const ls = /* @__PURE__ */ me({
|
|
|
6298
6328
|
b(h(Ti), {
|
|
6299
6329
|
entity: "item",
|
|
6300
6330
|
"model-value": p.value.customAttributes || {},
|
|
6301
|
-
"onUpdate:modelValue": B[3] || (B[3] = (Q) =>
|
|
6302
|
-
"value-options":
|
|
6331
|
+
"onUpdate:modelValue": B[3] || (B[3] = (Q) => x("customAttributes", Q)),
|
|
6332
|
+
"value-options": R.value
|
|
6303
6333
|
}, null, 8, ["model-value", "value-options"])
|
|
6304
6334
|
]),
|
|
6305
6335
|
_: 1
|
|
6306
6336
|
}, 8, ["title", "sub-title"])) : ie("", !0),
|
|
6307
|
-
M.value ? (F(), te("div",
|
|
6337
|
+
M.value ? (F(), te("div", Rs)) : ie("", !0),
|
|
6308
6338
|
b(Qe, {
|
|
6309
6339
|
toggle: $.value,
|
|
6310
6340
|
"onUpdate:toggle": [
|
|
6311
6341
|
B[4] || (B[4] = (Q) => $.value = Q),
|
|
6312
|
-
B[5] || (B[5] = (Q) =>
|
|
6342
|
+
B[5] || (B[5] = (Q) => I(Q))
|
|
6313
6343
|
],
|
|
6314
6344
|
disabled: !U.value,
|
|
6315
6345
|
description: h(r)("menu.product.form.sections.price.description"),
|
|
@@ -6317,16 +6347,16 @@ const ls = /* @__PURE__ */ me({
|
|
|
6317
6347
|
}, {
|
|
6318
6348
|
default: P(() => [
|
|
6319
6349
|
b(qr, {
|
|
6320
|
-
fallback:
|
|
6350
|
+
fallback: m.value,
|
|
6321
6351
|
form: p.value,
|
|
6322
6352
|
"is-addon": L.value,
|
|
6323
6353
|
"is-override": U.value,
|
|
6324
|
-
"onUpdate:form":
|
|
6354
|
+
"onUpdate:form": x
|
|
6325
6355
|
}, null, 8, ["fallback", "form", "is-addon", "is-override"])
|
|
6326
6356
|
]),
|
|
6327
6357
|
_: 1
|
|
6328
6358
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
6329
|
-
s.value.print && !U.value ? (F(), te("div",
|
|
6359
|
+
s.value.print && !U.value ? (F(), te("div", xs)) : ie("", !0),
|
|
6330
6360
|
s.value.print ? (F(), j(Qe, {
|
|
6331
6361
|
key: 5,
|
|
6332
6362
|
toggle: D.value,
|
|
@@ -6340,12 +6370,12 @@ const ls = /* @__PURE__ */ me({
|
|
|
6340
6370
|
}, {
|
|
6341
6371
|
default: P(() => [
|
|
6342
6372
|
b(rs, {
|
|
6343
|
-
fallback:
|
|
6373
|
+
fallback: m.value,
|
|
6344
6374
|
form: p.value,
|
|
6345
6375
|
"full-combinations": S.value,
|
|
6346
6376
|
"is-addon": L.value,
|
|
6347
6377
|
"is-override": U.value,
|
|
6348
|
-
"onUpdate:form":
|
|
6378
|
+
"onUpdate:form": x,
|
|
6349
6379
|
"onReplace:form": B[6] || (B[6] = (Q) => p.value = Q)
|
|
6350
6380
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6351
6381
|
]),
|
|
@@ -6364,12 +6394,12 @@ const ls = /* @__PURE__ */ me({
|
|
|
6364
6394
|
}, {
|
|
6365
6395
|
default: P(() => [
|
|
6366
6396
|
b(Ss, {
|
|
6367
|
-
fallback:
|
|
6397
|
+
fallback: m.value,
|
|
6368
6398
|
form: p.value,
|
|
6369
6399
|
"full-combinations": S.value,
|
|
6370
6400
|
"is-addon": L.value,
|
|
6371
6401
|
"is-override": U.value,
|
|
6372
|
-
"onUpdate:form":
|
|
6402
|
+
"onUpdate:form": x,
|
|
6373
6403
|
"onReplace:form": B[9] || (B[9] = (Q) => p.value = Q)
|
|
6374
6404
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6375
6405
|
]),
|
|
@@ -6389,12 +6419,12 @@ const ls = /* @__PURE__ */ me({
|
|
|
6389
6419
|
}, {
|
|
6390
6420
|
default: P(() => [
|
|
6391
6421
|
b(Er, {
|
|
6392
|
-
fallback:
|
|
6422
|
+
fallback: m.value,
|
|
6393
6423
|
form: p.value,
|
|
6394
6424
|
"full-combinations": S.value,
|
|
6395
6425
|
"is-addon": L.value,
|
|
6396
6426
|
"is-override": U.value,
|
|
6397
|
-
"onUpdate:form":
|
|
6427
|
+
"onUpdate:form": x,
|
|
6398
6428
|
"onReplace:form": B[12] || (B[12] = (Q) => p.value = Q)
|
|
6399
6429
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6400
6430
|
]),
|
|
@@ -6414,19 +6444,19 @@ const ls = /* @__PURE__ */ me({
|
|
|
6414
6444
|
}, {
|
|
6415
6445
|
default: P(() => [
|
|
6416
6446
|
b(Pr, {
|
|
6417
|
-
fallback:
|
|
6447
|
+
fallback: m.value,
|
|
6418
6448
|
form: p.value,
|
|
6419
6449
|
"full-combinations": S.value,
|
|
6420
6450
|
"is-addon": L.value,
|
|
6421
6451
|
"is-override": U.value,
|
|
6422
|
-
"onUpdate:form":
|
|
6452
|
+
"onUpdate:form": x,
|
|
6423
6453
|
"onReplace:form": B[15] || (B[15] = (Q) => p.value = Q)
|
|
6424
6454
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6425
6455
|
]),
|
|
6426
6456
|
_: 1
|
|
6427
6457
|
}, 8, ["toggle", "disabled", "description", "title"])) : ie("", !0),
|
|
6428
|
-
s.value.takeaway(p.value.category ?? ((pe =
|
|
6429
|
-
s.value.takeaway(p.value.category ?? ((fe =
|
|
6458
|
+
s.value.takeaway(p.value.category ?? ((pe = m.value) == null ? void 0 : pe.category)) && !U.value ? (F(), te("div", Os)) : ie("", !0),
|
|
6459
|
+
s.value.takeaway(p.value.category ?? ((fe = m.value) == null ? void 0 : fe.category)) ? (F(), j(Qe, {
|
|
6430
6460
|
key: 12,
|
|
6431
6461
|
toggle: re.value,
|
|
6432
6462
|
"onUpdate:toggle": [
|
|
@@ -6439,12 +6469,12 @@ const ls = /* @__PURE__ */ me({
|
|
|
6439
6469
|
}, {
|
|
6440
6470
|
default: P(() => [
|
|
6441
6471
|
b(ls, {
|
|
6442
|
-
fallback:
|
|
6472
|
+
fallback: m.value,
|
|
6443
6473
|
form: p.value,
|
|
6444
6474
|
"full-combinations": S.value,
|
|
6445
6475
|
"is-addon": L.value,
|
|
6446
6476
|
"is-override": U.value,
|
|
6447
|
-
"onUpdate:form":
|
|
6477
|
+
"onUpdate:form": x,
|
|
6448
6478
|
"onReplace:form": B[18] || (B[18] = (Q) => p.value = Q)
|
|
6449
6479
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6450
6480
|
]),
|
|
@@ -6459,41 +6489,41 @@ const ls = /* @__PURE__ */ me({
|
|
|
6459
6489
|
}, 8, ["title", "show", "primary-action", "secondary-actions"])
|
|
6460
6490
|
], 64));
|
|
6461
6491
|
}
|
|
6462
|
-
}),
|
|
6492
|
+
}), zs = Is;
|
|
6463
6493
|
function fn(e, i) {
|
|
6464
6494
|
var o, r, l, s;
|
|
6465
|
-
const t = (o = i.groups) == null ? void 0 : o.reduce((u,
|
|
6466
|
-
const c = e.groups.find((p) => p._id ===
|
|
6467
|
-
return
|
|
6495
|
+
const t = (o = i.groups) == null ? void 0 : o.reduce((u, d) => {
|
|
6496
|
+
const c = e.groups.find((p) => p._id === d._id);
|
|
6497
|
+
return kt(e.items, c.items) === G.F_ADDON_GROUP_TYPE.enum.DYNAMIC && u.push(c), u;
|
|
6468
6498
|
}, []);
|
|
6469
6499
|
if (!(t != null && t.length)) return i;
|
|
6470
6500
|
const n = t.map((u) => u._id);
|
|
6471
6501
|
function a(u) {
|
|
6472
|
-
const
|
|
6502
|
+
const d = t.map((c) => {
|
|
6473
6503
|
var v;
|
|
6474
|
-
const
|
|
6504
|
+
const m = u.find((y) => y._id === c._id), p = (v = c.items) == null ? void 0 : v.map((y) => {
|
|
6475
6505
|
var S;
|
|
6476
|
-
const _ = (S =
|
|
6506
|
+
const _ = (S = m == null ? void 0 : m.items) == null ? void 0 : S.find(
|
|
6477
6507
|
(f) => f._id === y._id && f.combinationKey == y.combinationKey
|
|
6478
6508
|
);
|
|
6479
6509
|
return {
|
|
6480
6510
|
..._ || {},
|
|
6481
6511
|
_id: y._id,
|
|
6482
6512
|
combinationKey: y.combinationKey,
|
|
6483
|
-
price: (_ == null ? void 0 : _.price) ??
|
|
6513
|
+
price: (_ == null ? void 0 : _.price) ?? ke.Dinero.zero().toObject(),
|
|
6484
6514
|
orderFrom: (_ == null ? void 0 : _.orderFrom) ?? G.F_ORDER_FROM.enum.ALL
|
|
6485
6515
|
};
|
|
6486
6516
|
});
|
|
6487
6517
|
return {
|
|
6488
6518
|
_id: c._id,
|
|
6489
|
-
groupKey: (
|
|
6519
|
+
groupKey: (m == null ? void 0 : m.groupKey) ?? "",
|
|
6490
6520
|
items: p
|
|
6491
6521
|
};
|
|
6492
6522
|
});
|
|
6493
|
-
return [...u.filter((c) => !n.includes(c._id)), ...
|
|
6523
|
+
return [...u.filter((c) => !n.includes(c._id)), ...d];
|
|
6494
6524
|
}
|
|
6495
6525
|
if ((r = i.variant) != null && r.variantCombinations.length) {
|
|
6496
|
-
const u = (l = i.variant) == null ? void 0 : l.variantCombinations.map((
|
|
6526
|
+
const u = (l = i.variant) == null ? void 0 : l.variantCombinations.map((d) => ({ ...d, groups: a(d.groups || []) }));
|
|
6497
6527
|
return {
|
|
6498
6528
|
...i,
|
|
6499
6529
|
variant: {
|
|
@@ -6505,12 +6535,12 @@ function fn(e, i) {
|
|
|
6505
6535
|
return { ...i, groups: a(i.groups || []) };
|
|
6506
6536
|
}
|
|
6507
6537
|
function Es(e, i, t, n) {
|
|
6508
|
-
const a = ue(i), o = t ? a.modules.catalog.find((
|
|
6509
|
-
function c(
|
|
6538
|
+
const a = ue(i), o = t ? a.modules.catalog.find((m) => m._id === t) : null, r = n ? a.modules.scheduler.find((m) => m._id === n) : null, l = o ? ue(o) : void 0, s = t ? a.modules.catalog.filter((m) => m._id !== t) : [], u = r ? ue(r) : void 0, d = e.reduce((m, p) => (m[p._id] = Ts(p), m), {});
|
|
6539
|
+
function c(m = []) {
|
|
6510
6540
|
const p = e.map((v) => v._id);
|
|
6511
6541
|
return [
|
|
6512
|
-
...
|
|
6513
|
-
...Object.values(
|
|
6542
|
+
...m.filter((v) => !p.includes(v._id)),
|
|
6543
|
+
...Object.values(d).flatMap((v) => v)
|
|
6514
6544
|
];
|
|
6515
6545
|
}
|
|
6516
6546
|
return l && n ? (l.override.scheduler = {
|
|
@@ -6518,21 +6548,21 @@ function Es(e, i, t, n) {
|
|
|
6518
6548
|
[n]: {
|
|
6519
6549
|
...l.override.scheduler[n],
|
|
6520
6550
|
_id: n,
|
|
6521
|
-
items: c(u == null ? void 0 : u.items).map((
|
|
6522
|
-
...
|
|
6551
|
+
items: c(u == null ? void 0 : u.items).map((m) => ({
|
|
6552
|
+
...m,
|
|
6523
6553
|
orderFrom: G.F_ORDER_FROM.enum.ALL
|
|
6524
6554
|
}))
|
|
6525
6555
|
}
|
|
6526
6556
|
}, a.modules.catalog = [...s, l], a) : l ? (l.override.items = {
|
|
6527
6557
|
...l.override.items,
|
|
6528
|
-
...
|
|
6558
|
+
...d
|
|
6529
6559
|
}, a.modules.catalog = [...s, l], a) : u ? (u.items = c(u.items), a.modules.scheduler = [
|
|
6530
|
-
...a.modules.scheduler.filter((
|
|
6560
|
+
...a.modules.scheduler.filter((m) => m._id !== n),
|
|
6531
6561
|
u
|
|
6532
6562
|
], a) : {
|
|
6533
|
-
...
|
|
6563
|
+
...ze.generator.initMenuV4(),
|
|
6534
6564
|
modules: {
|
|
6535
|
-
...
|
|
6565
|
+
...ze.generator.initMenuV4().modules,
|
|
6536
6566
|
catalog: a.modules.catalog,
|
|
6537
6567
|
item: a.modules.item,
|
|
6538
6568
|
group: a.modules.group,
|
|
@@ -6558,13 +6588,13 @@ function Ds(e, i) {
|
|
|
6558
6588
|
};
|
|
6559
6589
|
}
|
|
6560
6590
|
const ti = Mi("item-manager", () => {
|
|
6561
|
-
const e = be(), i = Ee(), t = Ne(), n = Xe(i), a = qe(n), o =
|
|
6591
|
+
const e = be(), i = Ee(), t = Ne(), n = Xe(i), a = qe(n), o = Ii(), { t: r } = he(), l = (M) => {
|
|
6562
6592
|
if (!o) throw new Error("No current instance found");
|
|
6563
|
-
const { container: T } =
|
|
6593
|
+
const { container: T } = zn(zs, o, {
|
|
6564
6594
|
...M,
|
|
6565
6595
|
autoShow: !0,
|
|
6566
|
-
"onUpdate:show": async (
|
|
6567
|
-
|
|
6596
|
+
"onUpdate:show": async (z) => {
|
|
6597
|
+
z || (Vt(null, T), T.remove());
|
|
6568
6598
|
}
|
|
6569
6599
|
});
|
|
6570
6600
|
};
|
|
@@ -6573,19 +6603,19 @@ const ti = Mi("item-manager", () => {
|
|
|
6573
6603
|
l({
|
|
6574
6604
|
action: "add",
|
|
6575
6605
|
categoryId: M,
|
|
6576
|
-
"onSubmit:form": async (
|
|
6577
|
-
|
|
6606
|
+
"onSubmit:form": async (z, w) => {
|
|
6607
|
+
z.inventoryBindings ?? (z.inventoryBindings = []), z.inventoryBindings.length === 0 && (z.inventoryBindings = null);
|
|
6578
6608
|
const A = pi();
|
|
6579
|
-
await T(
|
|
6609
|
+
await T(z, Ce.F_OPERATION_TYPE.create, A, w);
|
|
6580
6610
|
}
|
|
6581
6611
|
});
|
|
6582
6612
|
}
|
|
6583
|
-
async function u(M, T,
|
|
6613
|
+
async function u(M, T, z) {
|
|
6584
6614
|
l({
|
|
6585
6615
|
initialForm: Ds(M, T || []),
|
|
6586
6616
|
action: "update",
|
|
6587
6617
|
"onSubmit:form": async (w) => {
|
|
6588
|
-
w.inventoryBindings ?? (w.inventoryBindings = []), w.inventoryBindings.length === 0 && (w.inventoryBindings = null), await
|
|
6618
|
+
w.inventoryBindings ?? (w.inventoryBindings = []), w.inventoryBindings.length === 0 && (w.inventoryBindings = null), await z(
|
|
6589
6619
|
Es(
|
|
6590
6620
|
[w],
|
|
6591
6621
|
e.state.menu,
|
|
@@ -6596,70 +6626,70 @@ const ti = Mi("item-manager", () => {
|
|
|
6596
6626
|
}
|
|
6597
6627
|
});
|
|
6598
6628
|
}
|
|
6599
|
-
async function
|
|
6600
|
-
var
|
|
6601
|
-
const T = e.currentCatalog,
|
|
6602
|
-
await u(M, A, async (
|
|
6603
|
-
const $ =
|
|
6604
|
-
(
|
|
6629
|
+
async function d(M) {
|
|
6630
|
+
var k;
|
|
6631
|
+
const T = e.currentCatalog, z = e.state.currentSchedulerId, w = T.override.scheduler[z] ?? {}, A = (k = w == null ? void 0 : w.items) == null ? void 0 : k.filter((R) => R._id === M._id);
|
|
6632
|
+
await u(M, A, async (R) => {
|
|
6633
|
+
const $ = R.modules.catalog.find(
|
|
6634
|
+
(I) => I._id === T._id
|
|
6605
6635
|
);
|
|
6606
6636
|
await new je($, e, a.updateMenu, t).update();
|
|
6607
6637
|
});
|
|
6608
6638
|
}
|
|
6609
6639
|
async function c(M) {
|
|
6610
6640
|
const T = e.currentCatalog;
|
|
6611
|
-
await u(M, T.override.items[M._id], async (
|
|
6612
|
-
const w =
|
|
6641
|
+
await u(M, T.override.items[M._id], async (z) => {
|
|
6642
|
+
const w = z.modules.catalog.find(
|
|
6613
6643
|
(A) => A._id === T._id
|
|
6614
6644
|
);
|
|
6615
6645
|
await new je(w, e, a.updateMenu, t).update();
|
|
6616
6646
|
});
|
|
6617
6647
|
}
|
|
6618
|
-
async function
|
|
6648
|
+
async function m(M) {
|
|
6619
6649
|
const T = e.schedulers.find(
|
|
6620
6650
|
(w) => w._id === e.state.currentSchedulerId
|
|
6621
|
-
),
|
|
6622
|
-
await u(M,
|
|
6651
|
+
), z = T.items.filter((w) => w._id === M._id);
|
|
6652
|
+
await u(M, z, async (w) => {
|
|
6623
6653
|
const A = w.modules.scheduler.find(
|
|
6624
|
-
(
|
|
6654
|
+
(k) => k._id === T._id
|
|
6625
6655
|
);
|
|
6626
6656
|
await new yt(A, e, a.updateMenu, t).update();
|
|
6627
6657
|
});
|
|
6628
6658
|
}
|
|
6629
6659
|
async function p(M) {
|
|
6630
|
-
var A,
|
|
6631
|
-
const T = e.state.currentSchedulerId,
|
|
6632
|
-
if ($.combinationKey) return [...
|
|
6633
|
-
const
|
|
6634
|
-
return
|
|
6660
|
+
var A, k;
|
|
6661
|
+
const T = e.state.currentSchedulerId, z = ue(e.currentCatalog), w = (k = ((A = z.override.scheduler[T]) == null ? void 0 : A.items) || []) == null ? void 0 : k.reduce((R, $) => {
|
|
6662
|
+
if ($.combinationKey) return [...R, $];
|
|
6663
|
+
const I = M.find((g) => g._id === $._id);
|
|
6664
|
+
return I ? [...R, { ...$, price: I.price }] : [...R, $];
|
|
6635
6665
|
}, []);
|
|
6636
|
-
|
|
6637
|
-
...
|
|
6666
|
+
z.override.scheduler = {
|
|
6667
|
+
...z.override.scheduler,
|
|
6638
6668
|
[T]: {
|
|
6639
|
-
...
|
|
6669
|
+
...z.override.scheduler[T],
|
|
6640
6670
|
_id: T,
|
|
6641
6671
|
items: w
|
|
6642
6672
|
}
|
|
6643
|
-
}, await new je(
|
|
6673
|
+
}, await new je(z, e, a.updateMenu, t).update();
|
|
6644
6674
|
}
|
|
6645
6675
|
async function v(M) {
|
|
6646
6676
|
var A;
|
|
6647
|
-
const T = ue(e.currentCatalog),
|
|
6648
|
-
(
|
|
6649
|
-
const
|
|
6650
|
-
if (!
|
|
6651
|
-
return R
|
|
6677
|
+
const T = ue(e.currentCatalog), z = (A = Object.entries(T.override.items)) == null ? void 0 : A.reduce(
|
|
6678
|
+
(k, [R, $]) => {
|
|
6679
|
+
const I = M.find((C) => C._id === R);
|
|
6680
|
+
if (!I)
|
|
6681
|
+
return k[R] = $, k;
|
|
6652
6682
|
const g = $.find((C) => !C.combinationKey);
|
|
6653
|
-
return R
|
|
6683
|
+
return k[R] = [
|
|
6654
6684
|
...$.filter((C) => !!C.combinationKey),
|
|
6655
6685
|
{
|
|
6656
6686
|
...g,
|
|
6657
|
-
code:
|
|
6658
|
-
name:
|
|
6659
|
-
price:
|
|
6660
|
-
orderFrom:
|
|
6687
|
+
code: I.code || void 0,
|
|
6688
|
+
name: I.name,
|
|
6689
|
+
price: I.price,
|
|
6690
|
+
orderFrom: I.orderFrom ?? g.orderFrom
|
|
6661
6691
|
}
|
|
6662
|
-
],
|
|
6692
|
+
], k;
|
|
6663
6693
|
},
|
|
6664
6694
|
{}
|
|
6665
6695
|
), { updateMenu: w } = a;
|
|
@@ -6668,7 +6698,7 @@ const ti = Mi("item-manager", () => {
|
|
|
6668
6698
|
...T,
|
|
6669
6699
|
override: {
|
|
6670
6700
|
...T.override,
|
|
6671
|
-
items:
|
|
6701
|
+
items: z
|
|
6672
6702
|
}
|
|
6673
6703
|
},
|
|
6674
6704
|
e,
|
|
@@ -6677,15 +6707,15 @@ const ti = Mi("item-manager", () => {
|
|
|
6677
6707
|
).update();
|
|
6678
6708
|
}
|
|
6679
6709
|
async function y(M) {
|
|
6680
|
-
const T = ue(e.currentScheduler),
|
|
6710
|
+
const T = ue(e.currentScheduler), z = T.items.reduce((w, A) => {
|
|
6681
6711
|
if (A.combinationKey) return [...w, A];
|
|
6682
|
-
const
|
|
6683
|
-
return
|
|
6712
|
+
const k = M.find((R) => R._id === A._id);
|
|
6713
|
+
return k ? [...w, { ...A, price: k.price }] : [...w, A];
|
|
6684
6714
|
}, []);
|
|
6685
6715
|
await new yt(
|
|
6686
6716
|
{
|
|
6687
6717
|
...T,
|
|
6688
|
-
items:
|
|
6718
|
+
items: z
|
|
6689
6719
|
},
|
|
6690
6720
|
e,
|
|
6691
6721
|
a.updateMenu,
|
|
@@ -6694,20 +6724,20 @@ const ti = Mi("item-manager", () => {
|
|
|
6694
6724
|
}
|
|
6695
6725
|
async function _(M) {
|
|
6696
6726
|
const T = M.reduce((w, A) => {
|
|
6697
|
-
const
|
|
6698
|
-
return
|
|
6699
|
-
...
|
|
6700
|
-
code: A.code ??
|
|
6701
|
-
name: A.name ||
|
|
6702
|
-
price: A.price ??
|
|
6703
|
-
orderFrom: A.orderFrom ??
|
|
6704
|
-
taxes: A.taxes ??
|
|
6705
|
-
category: A.category === void 0 ?
|
|
6706
|
-
position: A.position ??
|
|
6707
|
-
additionalCategories: A.additionalCategories ??
|
|
6727
|
+
const k = e.items.find((R) => R._id === A._id);
|
|
6728
|
+
return k && w.push({
|
|
6729
|
+
...k,
|
|
6730
|
+
code: A.code ?? k.code,
|
|
6731
|
+
name: A.name || k.name,
|
|
6732
|
+
price: A.price ?? k.price,
|
|
6733
|
+
orderFrom: A.orderFrom ?? k.orderFrom,
|
|
6734
|
+
taxes: A.taxes ?? k.taxes,
|
|
6735
|
+
category: A.category === void 0 ? k.category : A.category,
|
|
6736
|
+
position: A.position ?? k.position,
|
|
6737
|
+
additionalCategories: A.additionalCategories ?? k.additionalCategories
|
|
6708
6738
|
}), w;
|
|
6709
|
-
}, []), { updateMenu:
|
|
6710
|
-
await
|
|
6739
|
+
}, []), { updateMenu: z } = a;
|
|
6740
|
+
await z(
|
|
6711
6741
|
T.map((w) => ({
|
|
6712
6742
|
module: G.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6713
6743
|
operation: Ce.F_OPERATION_TYPE.update,
|
|
@@ -6721,27 +6751,27 @@ const ti = Mi("item-manager", () => {
|
|
|
6721
6751
|
l({
|
|
6722
6752
|
initialForm: M,
|
|
6723
6753
|
action: "update",
|
|
6724
|
-
"onSubmit:form": async (
|
|
6754
|
+
"onSubmit:form": async (z, w) => {
|
|
6725
6755
|
const A = pi(M._id);
|
|
6726
|
-
|
|
6756
|
+
z.inventoryBindings ?? (z.inventoryBindings = []), z.inventoryBindings.length === 0 && (z.inventoryBindings = null), await T(z, Ce.F_OPERATION_TYPE.update, A, w);
|
|
6727
6757
|
}
|
|
6728
6758
|
});
|
|
6729
6759
|
}
|
|
6730
6760
|
async function f(M) {
|
|
6731
|
-
const T = e.state.menu.modules.item.find((
|
|
6732
|
-
e.currentCatalog ? e.state.currentSchedulerId ? await
|
|
6761
|
+
const T = e.state.menu.modules.item.find((z) => z._id === M);
|
|
6762
|
+
e.currentCatalog ? e.state.currentSchedulerId ? await d(T) : await c(T) : e.state.currentSchedulerId ? await m(T) : S(T);
|
|
6733
6763
|
}
|
|
6734
|
-
async function
|
|
6764
|
+
async function x(M) {
|
|
6735
6765
|
e.currentCatalog ? e.currentScheduler ? await p(M) : await v(M) : (
|
|
6736
6766
|
// If Main
|
|
6737
6767
|
e.currentScheduler ? await y(M) : await _(M)
|
|
6738
6768
|
);
|
|
6739
6769
|
}
|
|
6740
6770
|
function K(M) {
|
|
6741
|
-
const { updateMenu: T } = a,
|
|
6771
|
+
const { updateMenu: T } = a, z = M.length > 1 ? `${M.length} products` : M[0].name;
|
|
6742
6772
|
t.open({
|
|
6743
6773
|
title: r("menu.common.dialog.remove.product.title"),
|
|
6744
|
-
message: r("menu.common.dialog.remove.product.message", { name:
|
|
6774
|
+
message: r("menu.common.dialog.remove.product.message", { name: z }),
|
|
6745
6775
|
primaryActions: {
|
|
6746
6776
|
text: r("menu.common.actions.remove"),
|
|
6747
6777
|
close: !0,
|
|
@@ -6758,11 +6788,11 @@ const ti = Mi("item-manager", () => {
|
|
|
6758
6788
|
operation: Ce.F_OPERATION_TYPE.delete,
|
|
6759
6789
|
data: w
|
|
6760
6790
|
})),
|
|
6761
|
-
|
|
6791
|
+
z,
|
|
6762
6792
|
!0
|
|
6763
6793
|
);
|
|
6764
6794
|
for (const w of M)
|
|
6765
|
-
w.thumbnail && await
|
|
6795
|
+
w.thumbnail && await In.delete(w.thumbnail);
|
|
6766
6796
|
i.open({
|
|
6767
6797
|
message: r("menu.common.dialog.remove.product.success"),
|
|
6768
6798
|
type: "success"
|
|
@@ -6797,16 +6827,16 @@ const ti = Mi("item-manager", () => {
|
|
|
6797
6827
|
initDynamicGroupItem: (M) => fn(e, M),
|
|
6798
6828
|
create: s,
|
|
6799
6829
|
update: f,
|
|
6800
|
-
updateMany:
|
|
6830
|
+
updateMany: x,
|
|
6801
6831
|
deleteItem: U,
|
|
6802
6832
|
rearrange: L
|
|
6803
6833
|
};
|
|
6804
6834
|
});
|
|
6805
6835
|
export {
|
|
6806
6836
|
Ai as A,
|
|
6807
|
-
|
|
6837
|
+
Io as C,
|
|
6808
6838
|
Ja as F,
|
|
6809
|
-
|
|
6839
|
+
xo as I,
|
|
6810
6840
|
Ki as M,
|
|
6811
6841
|
ts as P,
|
|
6812
6842
|
Fa as S,
|
|
@@ -6820,7 +6850,7 @@ export {
|
|
|
6820
6850
|
un as f,
|
|
6821
6851
|
Es as g,
|
|
6822
6852
|
Gi as h,
|
|
6823
|
-
|
|
6853
|
+
kt as i,
|
|
6824
6854
|
fn as j,
|
|
6825
6855
|
dn as k,
|
|
6826
6856
|
mn as l,
|
|
@@ -6829,10 +6859,11 @@ export {
|
|
|
6829
6859
|
Ds as o,
|
|
6830
6860
|
ss as p,
|
|
6831
6861
|
or as q,
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6862
|
+
to as r,
|
|
6863
|
+
ml as s,
|
|
6864
|
+
_o as t,
|
|
6835
6865
|
ti as u,
|
|
6836
|
-
|
|
6837
|
-
|
|
6866
|
+
wo as v,
|
|
6867
|
+
yt as w,
|
|
6868
|
+
hn as x
|
|
6838
6869
|
};
|