@feedmepos/mf-menu 0.32.40 → 0.32.41-dev.2
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-DqpxV0zp.js → App-mCGGnjeS.js} +7 -7
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BQM40AWC.js → ApplyProduct.vue_vue_type_script_setup_true_lang-MWoYiClD.js} +3 -3
- package/dist/{Catalog-RdpK3RmL.js → Catalog-CM2wnQ4l.js} +44 -44
- package/dist/{Category-ar15UpWV.js → Category-Bp9tGWwJ.js} +24 -24
- package/dist/{Category-DbvCHZU4.js → Category-bsL9IQ5n.js} +24 -24
- package/dist/{CookingGuide-x2w_WTnE.js → CookingGuide-Cy0Kt6Ys.js} +105 -105
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-pRoVDEEM.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CX4s7NYy.js} +1 -1
- package/dist/{Group-D30WEl2L.js → Group-0hMArGNs.js} +1 -1
- package/dist/{Group-DevhimQn.js → Group-BKFZMvZg.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BY3nr67e.js → Group.vue_vue_type_script_setup_true_lang-st4plK2R.js} +18 -18
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CPvumpiM.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-8zW2KIMn.js} +30 -30
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-hEPchEwW.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-UhuYuL-A.js} +4129 -4125
- package/dist/{Ingredient-CiJSeTgO.js → Ingredient-CvE0xujL.js} +20 -20
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-Cnq9QAeQ.js → InventoryBinding.vue_vue_type_script_setup_true_lang-iEhZ4_5G.js} +2 -2
- package/dist/{LinkProductSideSheet-CJxffg6I.js → LinkProductSideSheet-CbppLDSB.js} +45 -45
- package/dist/{MenuSetting-BMuUIgLN.js → MenuSetting-CQ9HnQKx.js} +47 -47
- package/dist/{PrintRoute-Uu2n0dAY.js → PrintRoute-Cc81zV6Q.js} +39 -39
- package/dist/{Product-e81DLAaw.js → Product-kFoTn7zI.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-1axfwskP.js → Product.vue_vue_type_script_setup_true_lang-BVF9SBEL.js} +128 -128
- package/dist/{ProductInternalTools-BiK5b7KA.js → ProductInternalTools-CwxPRqTy.js} +66 -66
- package/dist/Products-IBe-R8XN.js +334 -0
- package/dist/{Publish-d_T1ROxG.js → Publish-BE-PPNO8.js} +29 -29
- package/dist/{Recipe-QIACzb3h.js → Recipe-Ddts2It2.js} +24 -24
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-01qpukRE.js → RuleView.vue_vue_type_script_setup_true_lang-DQjE4JRi.js} +369 -369
- package/dist/{Scheduler-VxoCoh9o.js → Scheduler-CqP0Ha2K.js} +11 -11
- package/dist/{ServingSequence-C7aNpyh4.js → ServingSequence-WpneAUiB.js} +44 -44
- package/dist/{Setting-BzoqHU2T.js → Setting-CNGZaUUT.js} +17 -17
- package/dist/{Subcategory-dyK9h6SV.js → Subcategory-BVN0OH_q.js} +51 -51
- package/dist/{Takeaway-C3UnFVOa.js → Takeaway-BtnGTcvW.js} +1 -1
- package/dist/{Takeaway-DxLGfrmv.js → Takeaway-LFslRotB.js} +13 -13
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-zsgXKNRt.js → Takeaway.vue_vue_type_script_setup_true_lang-CJZfd5JB.js} +28 -28
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-Ba0ZuCdS.js → Thumbnail.vue_vue_type_script_setup_true_lang-CI8eK98T.js} +27 -27
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-Xfmvx9wx.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-CfA400oN.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang--vNq7F0Z.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-SNBrW4Or.js} +13 -13
- package/dist/{Unit-Clc8AYHy.js → Unit-kL0Wjfb6.js} +8 -8
- package/dist/{Variant-DOGe2aJK.js → Variant-Cj82yGYE.js} +24 -24
- package/dist/{_id_-Bbc2mu9G.js → _id_-B-guZ25K.js} +28 -28
- package/dist/app-D4se7Sr4.js +1643 -0
- package/dist/{app-DQD4sPc8.js → app-DiVDYcc9.js} +1 -1
- package/dist/app.js +2 -2
- package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +2 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-DojmxFzq.js → linked-status-C4nECq-3.js} +5 -5
- package/dist/assets/{menu-export-rmsdV9dK.js → menu-export-PPICN1VA.js} +5 -3
- package/dist/assets/{override-menu-CVjWw9he.js → override-menu-BaYdZfDk.js} +5 -5
- package/dist/assets/{validate-menu-BB1XuZ9d.js → validate-menu-DCyVSa7R.js} +2 -2
- package/dist/{catalog-ku3nqGmL.js → catalog-BTsgJdVe.js} +1 -1
- package/dist/{catalogSetting-CpgLgy9o.js → catalogSetting-BNYPChMH.js} +1 -1
- package/dist/{currency-B58wqs-1.js → currency-2KuoTCt5.js} +1 -1
- package/dist/dayjs.min-BE8PtbAQ.js +7 -0
- package/dist/{index-BGm9S8Ih.js → index-GaHNc4iH.js} +43 -43
- package/dist/{index-CPY_DjD2.js → index-UthDVOpX.js} +31 -31
- package/dist/{index-ByMVMoTu.js → index-fLVJt8Pt.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-IHmRgZTC.js → index.vue_vue_type_script_setup_true_lang-CsnEYmWv.js} +244 -269
- package/dist/{item-DotiWZRv.js → item-DYsNPLH9.js} +759 -754
- package/dist/{jszip.min-OZZMb1gD.js → jszip.min-CLQSAAHL.js} +7 -6
- package/dist/{menu-v_Cm5BNh.js → menu-Btb1sPTh.js} +1 -1
- package/dist/{menuV2-DsvYmLeh.js → menuV2-Bfj5ljzI.js} +129 -129
- package/dist/{priceTier-BQeJLJUu.js → priceTier-DHp_DiBo.js} +1 -1
- package/dist/{rules-D3qosTfl.js → rules-B5QEx6OC.js} +11 -11
- package/dist/{scheduler-B32ag1lR.js → scheduler-CI-LJfho.js} +29 -29
- package/dist/{toExcel-CIrCsrWL.js → toExcel-CHdQxEnw.js} +2 -2
- package/dist/{unit-y1on6-W3.js → unit-D53f5n16.js} +35 -35
- package/package.json +2 -1
- package/dist/Products-DOIcfgzd.js +0 -291
- package/dist/app-BSpY6Pgy.js +0 -363
- package/dist/dayjs.min-Dj2ONTtr.js +0 -6
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { defineStore as jn } from "pinia";
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import {
|
|
4
|
-
import { useI18n as
|
|
2
|
+
import { defineComponent as ge, resolveComponent as D, createElementBlock as K, createBlock as Q, openBlock as C, createElementVNode as O, createVNode as h, toDisplayString as ie, Fragment as me, renderList as ke, h as Se, ref as Y, computed as E, watch as Te, unref as c, renderSlot as Ce, withCtx as V, createCommentVNode as ne, Transition as To, normalizeClass as Ue, resolveDynamicComponent as Dt, withDirectives as ct, vShow as jt, mergeProps as Gn, withModifiers as Ft, onMounted as ft, onUnmounted as Vo, createTextVNode as Pt, getCurrentInstance as vn, render as $t, resolveDirective as Kn, markRaw as zo, mergeModels as Io, useModel as Do, nextTick as Wn, normalizeProps as Po, guardReactiveProps as $o, normalizeStyle as Uo } from "vue";
|
|
3
|
+
import { J as Fe, y as Z, ai as No, ak as Lo, Y as Yn, G as ve, A as Ge, z as $e, U as Bo, u as Ae, H as Re, B as nt, O as ot, $ as jo, al as Go, K as Ut, M as on, N as On, P as Ko, Q as Wo, R as Yo, T as Xt, ad as Ho, V as qo } from "./index.vue_vue_type_script_setup_true_lang-CsnEYmWv.js";
|
|
4
|
+
import { useI18n as ye, useLocale as Hn, useCoreStore as Ot, CustomAttributesForm as qn } from "@feedmepos/mf-common";
|
|
5
5
|
import { useDialog as Ze, useSnackbar as Ke, components as ze, useDialogChild as gn, FmButtonColorThemeVariant as Ye, FmButtonVariant as tt, useBreakpoints as Xn } from "@feedmepos/ui-library";
|
|
6
|
-
import { C as Je } from "./catalog-
|
|
6
|
+
import { C as Je } from "./catalog-BTsgJdVe.js";
|
|
7
7
|
import { c as Zn } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
8
8
|
import { a as Rn, _ as an } from "./tooltip-B5BiPMx9.js";
|
|
9
|
-
import { H as Xo, L as Zo } from "./LinkProductSideSheet-
|
|
10
|
-
import { e as Qo, _ as Le, a as Jo } from "./RuleView.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { H as Xo, L as Zo } from "./LinkProductSideSheet-CbppLDSB.js";
|
|
10
|
+
import { e as Qo, _ as Le, a as Jo } from "./RuleView.vue_vue_type_script_setup_true_lang-DQjE4JRi.js";
|
|
11
11
|
import { s as rn, F as ei, _ as ti } from "./index-CisutoS9.js";
|
|
12
|
-
import { a as ni } from "./app-
|
|
12
|
+
import { a as ni } from "./app-D4se7Sr4.js";
|
|
13
13
|
import { _ as mt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
-
import { g as Qn, b as oi, c as ii, a as ai, m as ri } from "./menuV2-
|
|
14
|
+
import { g as Qn, b as oi, c as ii, a as ai, m as ri } from "./menuV2-Bfj5ljzI.js";
|
|
15
15
|
import { useAppStore as bn, RemyButton as Jn } from "@feedmepos/mf-remy-panel";
|
|
16
16
|
import { _ as it } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
17
|
-
import { u as si, r as li } from "./rules-
|
|
17
|
+
import { u as si, r as li } from "./rules-B5QEx6OC.js";
|
|
18
18
|
import { u as _t } from "./discardConfirm-BHni0LNu.js";
|
|
19
19
|
import { g as Pe, a as ht, _ as Nt, b as Lt } from "./translation-Cdap0IVg.js";
|
|
20
20
|
import { c as sn } from "./object-DVUNCr7w.js";
|
|
21
|
-
import { _ as yn } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-
|
|
22
|
-
import { u as ui } from "./menu-
|
|
21
|
+
import { _ as yn } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-CfA400oN.js";
|
|
22
|
+
import { u as ui } from "./menu-Btb1sPTh.js";
|
|
23
23
|
import { c as wt } from "./check-C9mY6LiX.js";
|
|
24
|
-
import { _ as ut, l as ln, T as ci } from "./index-
|
|
24
|
+
import { _ as ut, l as ln, T as ci } from "./index-UthDVOpX.js";
|
|
25
25
|
import { useInventoryStore as eo, InventoryBindingForm as di, InventoryBindingSummary as mi } from "@feedmepos/mf-inventory-portal";
|
|
26
|
-
import { f as vt } from "./currency-
|
|
27
|
-
import { u as to } from "./priceTier-
|
|
26
|
+
import { f as vt } from "./currency-2KuoTCt5.js";
|
|
27
|
+
import { u as to } from "./priceTier-DHp_DiBo.js";
|
|
28
28
|
import { u as pi } from "./search-BAPEUu1R.js";
|
|
29
29
|
import { c as fi } from "./string-DpfFixWH.js";
|
|
30
30
|
import { d as no } from "./vuedraggable-CK8z7qA8.js";
|
|
31
|
-
import { _ as hi } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-
|
|
32
|
-
import { V as An } from "./index-
|
|
31
|
+
import { _ as hi } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-MWoYiClD.js";
|
|
32
|
+
import { V as An } from "./index-GaHNc4iH.js";
|
|
33
33
|
class zt {
|
|
34
34
|
constructor(n, t, o, a) {
|
|
35
35
|
this.scheduler = n, this.menuStore = t, this.updateMenu = o, this.dialog = a;
|
|
@@ -333,7 +333,7 @@ class io {
|
|
|
333
333
|
this.updateMenu,
|
|
334
334
|
this.dialog
|
|
335
335
|
);
|
|
336
|
-
let r =
|
|
336
|
+
let r = ve(this.menuStore.state.menu);
|
|
337
337
|
if (t)
|
|
338
338
|
o ? a.overrideCatalogSchedulerGroups(n, o._id) : a.overrideCatalogGroups(n), r = a.injectCatalogToMenu();
|
|
339
339
|
else if (o)
|
|
@@ -387,24 +387,24 @@ class io {
|
|
|
387
387
|
const a = this.menuStore.state.menu.modules.item, i = this.menuStore.state.menu.modules.group, r = this.menuStore.items, l = this.menuStore.rules.group.linkAddonName;
|
|
388
388
|
function s(u, d) {
|
|
389
389
|
const m = u.items.reduce((f, v) => {
|
|
390
|
-
var M, R, _,
|
|
390
|
+
var M, R, _, x;
|
|
391
391
|
const A = a.find((b) => v._id === b._id);
|
|
392
392
|
if (!A && t) return f;
|
|
393
393
|
const y = v.combinationKey ? {
|
|
394
394
|
...(M = A == null ? void 0 : A.variant) == null ? void 0 : M.variantCombinations.find(
|
|
395
395
|
(b) => b.combinationKey === v.combinationKey
|
|
396
396
|
),
|
|
397
|
-
name: Bo(
|
|
398
|
-
} : A, w = (_ = i.find((b) => b._id === u._id)) == null ? void 0 : _.items.find((b) => b._id === v._id && b.combinationKey === v.combinationKey), g = !t && !v.combinationKey,
|
|
397
|
+
name: Bo(Ae().variants, ((R = A == null ? void 0 : A.variant) == null ? void 0 : R.variantGroupIds) || [])[v.combinationKey]
|
|
398
|
+
} : A, w = (_ = i.find((b) => b._id === u._id)) == null ? void 0 : _.items.find((b) => b._id === v._id && b.combinationKey === v.combinationKey), g = !t && !v.combinationKey, k = (x = d.find(
|
|
399
399
|
(b) => b._id == v._id && b.combinationKey == v.combinationKey
|
|
400
|
-
)) == null ? void 0 :
|
|
400
|
+
)) == null ? void 0 : x.price, L = l ? null : y == null ? void 0 : y.name, $ = v.name || (w == null ? void 0 : w.name) || L || null, U = (y == null ? void 0 : y.name) || null, T = v.name_locale ?? (w == null ? void 0 : w.name_locale) ?? (y == null ? void 0 : y.name_locale) ?? null, B = {
|
|
401
401
|
...v,
|
|
402
402
|
name: $,
|
|
403
403
|
name_locale: T,
|
|
404
404
|
code: y == null ? void 0 : y.code,
|
|
405
405
|
fallbackName: g ? U : $,
|
|
406
406
|
price: v.price,
|
|
407
|
-
fallbackPrice: g ? null :
|
|
407
|
+
fallbackPrice: g ? null : k,
|
|
408
408
|
orderFrom: v.orderFrom,
|
|
409
409
|
fallbackOrder: y == null ? void 0 : y.orderFrom,
|
|
410
410
|
priceTiers: v.priceTiers
|
|
@@ -432,7 +432,7 @@ class io {
|
|
|
432
432
|
await this.updateMenu(t, "Groups");
|
|
433
433
|
}
|
|
434
434
|
async duplicateGroup(n) {
|
|
435
|
-
const t =
|
|
435
|
+
const t = ve(n);
|
|
436
436
|
n.type === Z.F_ADDON_GROUP_TYPE.enum.PRODUCT || (t.items = Object.entries(t.items).reduce((r, [l, s]) => (r[l] = {
|
|
437
437
|
...s,
|
|
438
438
|
items: (s.items ?? []).map((u) => ({ ...u, _id: "" }))
|
|
@@ -513,7 +513,7 @@ function gi(e, n) {
|
|
|
513
513
|
return e.priceEdit || t.push("price"), e.isDefault(n) || t.push("isDefault"), e.name(n) || t.push("name"), t;
|
|
514
514
|
}
|
|
515
515
|
function bi(e, n) {
|
|
516
|
-
const t =
|
|
516
|
+
const t = ve(e);
|
|
517
517
|
return ao(n).forEach((i) => {
|
|
518
518
|
delete t[i];
|
|
519
519
|
}), (t.items ?? []).forEach((i) => {
|
|
@@ -529,7 +529,7 @@ function bi(e, n) {
|
|
|
529
529
|
const yi = {
|
|
530
530
|
key: 0,
|
|
531
531
|
class: "ml-40 w-[320px] fm-corner-radius-lg p-16 border border-fm-color-neutral-gray-200 space-y-4"
|
|
532
|
-
}, _i = { class: "fm-typo-en-title-sm-600" }, Mn = /* @__PURE__ */
|
|
532
|
+
}, _i = { class: "fm-typo-en-title-sm-600" }, Mn = /* @__PURE__ */ ge({
|
|
533
533
|
__name: "Summary",
|
|
534
534
|
props: {
|
|
535
535
|
title: {},
|
|
@@ -556,7 +556,7 @@ const yi = {
|
|
|
556
556
|
return n.variant === "full" ? (C(), K("div", yi, [
|
|
557
557
|
O("div", _i, ie(a.title), 1),
|
|
558
558
|
h(Xo),
|
|
559
|
-
(C(!0), K(me, null,
|
|
559
|
+
(C(!0), K(me, null, ke(a.items, (l) => (C(), Q(Rn, {
|
|
560
560
|
key: l.name,
|
|
561
561
|
name: l.name,
|
|
562
562
|
value: l.value || "--"
|
|
@@ -569,14 +569,14 @@ const yi = {
|
|
|
569
569
|
}));
|
|
570
570
|
};
|
|
571
571
|
}
|
|
572
|
-
}), wi = { class: "space-y-24 p-16 border-fm-color-neutral-gray-200 fm-corner-radius-lg border" }, ki = { class: "space-y-4" }, xi = { class: "fm-typo-en-title-sm-600" }, Ci = { class: "text-fm-color-typo-secondary" }, Si = { class: "flex gap-16" }, Fi = { class: "flex-1" }, Oi = { class: "flex-1" }, Ri = /* @__PURE__ */
|
|
572
|
+
}), wi = { class: "space-y-24 p-16 border-fm-color-neutral-gray-200 fm-corner-radius-lg border" }, ki = { class: "space-y-4" }, xi = { class: "fm-typo-en-title-sm-600" }, Ci = { class: "text-fm-color-typo-secondary" }, Si = { class: "flex gap-16" }, Fi = { class: "flex-1" }, Oi = { class: "flex-1" }, Ri = /* @__PURE__ */ ge({
|
|
573
573
|
__name: "CatalogSchedulerSelector",
|
|
574
574
|
props: {
|
|
575
575
|
linkedStatus: {}
|
|
576
576
|
},
|
|
577
577
|
emits: ["update:catalogAndScheduler"],
|
|
578
578
|
setup(e, { emit: n }) {
|
|
579
|
-
const t = e, o = n, { t: a } =
|
|
579
|
+
const t = e, o = n, { t: a } = ye(), i = Ae(), r = Y(i.state.currentCatalogId || null), l = E(() => {
|
|
580
580
|
const p = Object.keys(t.linkedStatus.catalogs).map((f) => {
|
|
581
581
|
var v;
|
|
582
582
|
return {
|
|
@@ -607,13 +607,13 @@ const yi = {
|
|
|
607
607
|
...f
|
|
608
608
|
];
|
|
609
609
|
});
|
|
610
|
-
|
|
610
|
+
Te(r, (p) => {
|
|
611
611
|
[null, ...u()].includes(s.value) || (s.value = null);
|
|
612
612
|
});
|
|
613
|
-
const m =
|
|
613
|
+
const m = Re.debounce(() => {
|
|
614
614
|
o("update:catalogAndScheduler", [r.value, s.value]);
|
|
615
615
|
}, 100);
|
|
616
|
-
return
|
|
616
|
+
return Te(
|
|
617
617
|
() => `${r.value}-${s.value}`,
|
|
618
618
|
() => {
|
|
619
619
|
m();
|
|
@@ -649,7 +649,7 @@ const yi = {
|
|
|
649
649
|
}), Ai = { class: "flex items-center justify-between" }, Mi = { class: "space-y-4 flex-1" }, Ei = { class: "fm-typo-en-title-sm-600" }, Ti = {
|
|
650
650
|
key: 0,
|
|
651
651
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
652
|
-
}, Vi = { key: 0 }, zi = /* @__PURE__ */
|
|
652
|
+
}, Vi = { key: 0 }, zi = /* @__PURE__ */ ge({
|
|
653
653
|
__name: "ToggleCard",
|
|
654
654
|
props: {
|
|
655
655
|
title: {},
|
|
@@ -662,7 +662,7 @@ const yi = {
|
|
|
662
662
|
const t = n;
|
|
663
663
|
return (o, a) => {
|
|
664
664
|
const i = D("fm-switch"), r = D("fm-card");
|
|
665
|
-
return o.disabled ?
|
|
665
|
+
return o.disabled ? Ce(o.$slots, "default", { key: 0 }, void 0, !0) : (C(), Q(r, {
|
|
666
666
|
key: 1,
|
|
667
667
|
class: "p-16 space-y-24",
|
|
668
668
|
variant: "outlined"
|
|
@@ -681,7 +681,7 @@ const yi = {
|
|
|
681
681
|
h(To, { name: "expand" }, {
|
|
682
682
|
default: V(() => [
|
|
683
683
|
o.toggle ? (C(), K("div", Vi, [
|
|
684
|
-
|
|
684
|
+
Ce(o.$slots, "default", {}, void 0, !0)
|
|
685
685
|
])) : ne("", !0)
|
|
686
686
|
]),
|
|
687
687
|
_: 3
|
|
@@ -758,13 +758,13 @@ async function Qu(e, n, t = {}) {
|
|
|
758
758
|
const $i = {}, Ui = { class: "pl-32" };
|
|
759
759
|
function Ni(e, n) {
|
|
760
760
|
return C(), K("div", Ui, [
|
|
761
|
-
|
|
761
|
+
Ce(e.$slots, "default")
|
|
762
762
|
]);
|
|
763
763
|
}
|
|
764
764
|
const Li = /* @__PURE__ */ mt($i, [["render", Ni]]), Bi = { class: "flex flex-col gap-4" }, ji = { class: "fm-select__menu__wrapper" }, Gi = {
|
|
765
765
|
key: 0,
|
|
766
766
|
class: "flex flex-col gap-4 justify-center"
|
|
767
|
-
}, Ki = /* @__PURE__ */
|
|
767
|
+
}, Ki = /* @__PURE__ */ ge({
|
|
768
768
|
__name: "CategoriesSelector",
|
|
769
769
|
props: {
|
|
770
770
|
modelValue: {},
|
|
@@ -811,7 +811,7 @@ const Li = /* @__PURE__ */ mt($i, [["render", Ni]]), Bi = { class: "flex flex-co
|
|
|
811
811
|
(v, A) => (v[A.value] = A, v),
|
|
812
812
|
{}
|
|
813
813
|
)), m = Y(!1);
|
|
814
|
-
|
|
814
|
+
Te(
|
|
815
815
|
() => o.modelValue,
|
|
816
816
|
(v) => {
|
|
817
817
|
v != null && v.length ? r.value = v.map((A) => d.value[A]).filter((A) => !!A) : r.value = [];
|
|
@@ -822,7 +822,7 @@ const Li = /* @__PURE__ */ mt($i, [["render", Ni]]), Bi = { class: "flex flex-co
|
|
|
822
822
|
return n({
|
|
823
823
|
hideMenu: u
|
|
824
824
|
}), (v, A) => {
|
|
825
|
-
const y = D("FmIcon"), w = D("FmField"), g = D("FmMenuItem"),
|
|
825
|
+
const y = D("FmIcon"), w = D("FmField"), g = D("FmMenuItem"), k = D("FmMenu"), L = D("FmFormGroup"), $ = D("FmChipGroup");
|
|
826
826
|
return C(), K("div", Bi, [
|
|
827
827
|
h(L, {
|
|
828
828
|
"model-value": v.modelValue,
|
|
@@ -833,7 +833,7 @@ const Li = /* @__PURE__ */ mt($i, [["render", Ni]]), Bi = { class: "flex flex-co
|
|
|
833
833
|
rules: v.rules
|
|
834
834
|
}, {
|
|
835
835
|
default: V(({ invalid: U }) => [
|
|
836
|
-
h(
|
|
836
|
+
h(k, {
|
|
837
837
|
disabled: v.disabled,
|
|
838
838
|
ref_key: "fmMenuRef",
|
|
839
839
|
ref: i,
|
|
@@ -865,7 +865,7 @@ const Li = /* @__PURE__ */ mt($i, [["render", Ni]]), Bi = { class: "flex flex-co
|
|
|
865
865
|
]),
|
|
866
866
|
default: V(() => [
|
|
867
867
|
O("div", ji, [
|
|
868
|
-
(C(!0), K(me, null,
|
|
868
|
+
(C(!0), K(me, null, ke(v.items, (T) => (C(), Q(g, {
|
|
869
869
|
key: T.value,
|
|
870
870
|
disabled: T.disabled,
|
|
871
871
|
"has-checkbox": !0,
|
|
@@ -873,7 +873,7 @@ const Li = /* @__PURE__ */ mt($i, [["render", Ni]]), Bi = { class: "flex flex-co
|
|
|
873
873
|
"model-value": r.value.some((B) => B.value === T.value),
|
|
874
874
|
"onUpdate:modelValue": (B) => l(B, T)
|
|
875
875
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue"]))), 128)),
|
|
876
|
-
|
|
876
|
+
Ce(v.$slots, "append-menu", {}, void 0, !0)
|
|
877
877
|
])
|
|
878
878
|
]),
|
|
879
879
|
_: 2
|
|
@@ -903,7 +903,7 @@ function En(e, n) {
|
|
|
903
903
|
}
|
|
904
904
|
return t;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function fe(e) {
|
|
907
907
|
for (var n = 1; n < arguments.length; n++) {
|
|
908
908
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
909
909
|
n % 2 ? En(Object(t), !0).forEach(function(o) {
|
|
@@ -953,7 +953,7 @@ function Zt(e, n) {
|
|
|
953
953
|
for (var t = 0, o = new Array(n); t < n; t++) o[t] = e[t];
|
|
954
954
|
return o;
|
|
955
955
|
}
|
|
956
|
-
var Tn, Hi, At,
|
|
956
|
+
var Tn, Hi, At, Ee = (Tn = function(e) {
|
|
957
957
|
/*!
|
|
958
958
|
Copyright (c) 2018 Jed Watson.
|
|
959
959
|
Licensed under the MIT License (MIT), see
|
|
@@ -1147,7 +1147,7 @@ wn.render = function(e, n, t, o, a, i) {
|
|
|
1147
1147
|
return i.onMouseOver && i.onMouseOver.apply(i, arguments);
|
|
1148
1148
|
}), onMouseleave: n[4] || (n[4] = function() {
|
|
1149
1149
|
return i.onMouseLeave && i.onMouseLeave.apply(i, arguments);
|
|
1150
|
-
}) }, [
|
|
1150
|
+
}) }, [Ce(e.$slots, "default")], 34);
|
|
1151
1151
|
};
|
|
1152
1152
|
var Qt = We("vue-handler-wrapper"), mo = { name: "HandlerWrapper", components: { DraggableElement: wn }, props: { horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, computed: { classes: function() {
|
|
1153
1153
|
var e;
|
|
@@ -1168,7 +1168,7 @@ mo.render = function(e, n, t, o, a, i) {
|
|
|
1168
1168
|
}), onEnter: n[4] || (n[4] = function(l) {
|
|
1169
1169
|
return e.$emit("enter");
|
|
1170
1170
|
}) }, { default: V(function() {
|
|
1171
|
-
return [
|
|
1171
|
+
return [Ce(e.$slots, "default")];
|
|
1172
1172
|
}), _: 3 }, 8, ["class"])], 2);
|
|
1173
1173
|
};
|
|
1174
1174
|
var Zi = We("vue-line-wrapper"), po = { name: "LineWrapper", components: { DraggableElement: wn }, props: { position: { type: String, required: !0 }, disabled: { type: Boolean, default: !1 } }, computed: { classname: function() {
|
|
@@ -1186,7 +1186,7 @@ po.render = function(e, n, t, o, a, i) {
|
|
|
1186
1186
|
}), onEnter: n[4] || (n[4] = function(l) {
|
|
1187
1187
|
return e.$emit("enter");
|
|
1188
1188
|
}) }, { default: V(function() {
|
|
1189
|
-
return [
|
|
1189
|
+
return [Ce(e.$slots, "default")];
|
|
1190
1190
|
}), _: 3 }, 8, ["class"]);
|
|
1191
1191
|
};
|
|
1192
1192
|
var qe = ["left", "right", "top", "bottom"], Qi = ["left", "right"], Ji = ["top", "bottom"], ea = ["left", "top"], ta = ["fill-area", "fit-area", "stencil", "none"], In = { left: 0, top: 0, width: 0, height: 0 };
|
|
@@ -1230,7 +1230,7 @@ function je(e, n, t, o) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
return e;
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1233
|
+
function he(e) {
|
|
1234
1234
|
return e.width / e.height;
|
|
1235
1235
|
}
|
|
1236
1236
|
function bt(e, n) {
|
|
@@ -1245,7 +1245,7 @@ function Jt(e, n) {
|
|
|
1245
1245
|
return n.minimum && e < n.minimum ? t = n.minimum : n.maximum && e > n.maximum && (t = n.maximum), t;
|
|
1246
1246
|
}
|
|
1247
1247
|
function fo(e, n) {
|
|
1248
|
-
var t =
|
|
1248
|
+
var t = he(e), o = he(n);
|
|
1249
1249
|
return n.width < 1 / 0 && n.height < 1 / 0 ? t > o ? { width: n.width, height: n.width / t } : { width: n.height * t, height: n.height } : n.width < 1 / 0 ? { width: n.width, height: n.width / t } : n.height < 1 / 0 ? { width: n.height * t, height: n.height } : e;
|
|
1250
1250
|
}
|
|
1251
1251
|
function ho(e, n) {
|
|
@@ -1284,7 +1284,7 @@ function Yt(e, n) {
|
|
|
1284
1284
|
}
|
|
1285
1285
|
function Pn(e) {
|
|
1286
1286
|
var n = e.size, t = e.aspectRatio, o = e.ignoreMinimum, a = e.sizeRestrictions;
|
|
1287
|
-
return !!((n.correctRatio ||
|
|
1287
|
+
return !!((n.correctRatio || he(n) >= t.minimum && he(n) <= t.maximum) && n.height <= a.maxHeight && n.width <= a.maxWidth && n.width && n.height && (o || n.height >= a.minHeight && n.width >= a.minWidth));
|
|
1288
1288
|
}
|
|
1289
1289
|
function $n(e, n) {
|
|
1290
1290
|
return Math.pow(e.width - n.width, 2) + Math.pow(e.height - n.height, 2);
|
|
@@ -1326,7 +1326,7 @@ function ia(e) {
|
|
|
1326
1326
|
var i = e.stencilSize, r = e.sizeRestrictions, l = e.positionRestrictions;
|
|
1327
1327
|
e.stencilReference;
|
|
1328
1328
|
var s, u, d, m = re({}, o), p = re({}, a), f = re({}, i);
|
|
1329
|
-
s =
|
|
1329
|
+
s = he(f), u = he(m), 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) || (m = re(re({}, m), et({ sizeRestrictions: r, width: m.width, height: m.height, aspectRatio: { minimum: he(f), maximum: he(f) } })));
|
|
1330
1330
|
var v = Wt(p = je(p, m.width * t.width / (p.width * f.width)), n({ visibleArea: p, type: "resize" }));
|
|
1331
1331
|
return v !== 1 && (p = je(p, v), m = je(m, v)), p = De(p = Ne(p, gt(Ie(m), Ie(p))), n({ visibleArea: p, type: "move" })), { coordinates: m = De(m, Yt(Xe(p), l)), visibleArea: p };
|
|
1332
1332
|
}
|
|
@@ -1338,7 +1338,7 @@ function aa(e) {
|
|
|
1338
1338
|
var l = re({}, a), s = re({}, i);
|
|
1339
1339
|
if (a && i && n.type !== "manipulateImage") {
|
|
1340
1340
|
var u = { width: 0, height: 0 };
|
|
1341
|
-
s.width, o.width,
|
|
1341
|
+
s.width, o.width, he(o) > he(l) ? (u.height = 0.8 * o.height, u.width = u.height * he(l)) : (u.width = 0.8 * o.width, u.height = u.width * he(l));
|
|
1342
1342
|
var d = Wt(s = je(s, l.width * o.width / (s.width * u.width)), t({ visibleArea: s, type: "resize" }));
|
|
1343
1343
|
s = je(s, d), d !== 1 && (u.height /= d, u.width /= d), s = De(s = Ne(s, gt(Ie(l), Ie(s))), t({ visibleArea: s, type: "move" })), l = De(l, Yt(Xe(s), r));
|
|
1344
1344
|
}
|
|
@@ -1357,20 +1357,20 @@ function sa(e) {
|
|
|
1357
1357
|
return { left: (t ? t.left : 0) + a.width / 2 - o.width / 2, top: (t ? t.top : 0) + a.height / 2 - o.height / 2 };
|
|
1358
1358
|
}
|
|
1359
1359
|
function la(e) {
|
|
1360
|
-
var n = e.imageSize, t = e.visibleArea, o = e.aspectRatio, a = e.sizeRestrictions, i = t || n, r = Math.min(o.maximum || 1 / 0, Math.max(o.minimum || 0,
|
|
1360
|
+
var n = e.imageSize, t = e.visibleArea, o = e.aspectRatio, a = e.sizeRestrictions, i = t || n, r = Math.min(o.maximum || 1 / 0, Math.max(o.minimum || 0, he(i))), l = i.width < i.height ? { width: 0.8 * i.width, height: 0.8 * i.width / r } : { height: 0.8 * i.height, width: 0.8 * i.height * r };
|
|
1361
1361
|
return et(re(re({}, l), { aspectRatio: o, sizeRestrictions: a }));
|
|
1362
1362
|
}
|
|
1363
1363
|
function ua(e) {
|
|
1364
1364
|
var n, t, o = e.imageSize, a = e.visibleArea, i = e.boundaries, r = e.aspectRatio, l = e.sizeRestrictions, s = e.stencilSize, u = a || o;
|
|
1365
|
-
return
|
|
1365
|
+
return he(u) > he(i) ? t = (n = s.height * u.height / i.height) * he(s) : n = (t = s.width * u.width / i.width) / he(s), et({ width: t, height: n, aspectRatio: r, sizeRestrictions: l });
|
|
1366
1366
|
}
|
|
1367
1367
|
function ca(e) {
|
|
1368
|
-
var n = e.getAreaRestrictions, t = e.coordinates, o = e.imageSize, a =
|
|
1368
|
+
var n = e.getAreaRestrictions, t = e.coordinates, o = e.imageSize, a = he(e.boundaries);
|
|
1369
1369
|
if (t) {
|
|
1370
|
-
var i = { height: Math.max(t.height, o.height), width: Math.max(t.width, o.width) }, r = fo({ width:
|
|
1370
|
+
var i = { height: Math.max(t.height, o.height), width: Math.max(t.width, o.width) }, r = fo({ width: he(i) > a ? i.width : i.height * a, height: he(i) > a ? i.width / a : i.height }, mn(n())), 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 = St(t, Xe(re({ left: 0, top: 0 }, o))), u = {};
|
|
1371
1371
|
return !s.left && !s.right && l.width <= o.width && (u.left = 0, u.right = o.width), !s.top && !s.bottom && l.height <= o.height && (u.top = 0, u.bottom = o.height), De(l, u);
|
|
1372
1372
|
}
|
|
1373
|
-
var d =
|
|
1373
|
+
var d = he(o);
|
|
1374
1374
|
return r = { height: d > a ? o.height : o.width / a, width: d > a ? o.height * a : o.width }, { left: o.width / 2 - r.width / 2, top: o.height / 2 - r.height / 2, width: r.width, height: r.height };
|
|
1375
1375
|
}
|
|
1376
1376
|
function Et(e, n) {
|
|
@@ -1381,8 +1381,8 @@ function da(e) {
|
|
|
1381
1381
|
d = Ne(d, { left: u.left || 0, top: u.top || 0 });
|
|
1382
1382
|
var A = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / m.width : 0, a.minHeight ? a.minHeight / m.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / m.width : 1 / 0, a.maxHeight ? a.maxHeight / m.height : 1 / 0, bt(m, r)) }, area: { maximum: bt(d, i({ visibleArea: d, type: "resize" })) } };
|
|
1383
1383
|
s.factor && v && (s.factor < 1 ? (f = Math.max(s.factor, A.stencil.minimum)) > 1 && (f = 1) : s.factor > 1 && (f = Math.min(s.factor, Math.min(A.area.maximum, A.stencil.maximum))) < 1 && (f = 1)), f && (d = je(d, f, s.center));
|
|
1384
|
-
var y = t.left - o.left, w = o.width + o.left - (t.width + t.left), g = t.top - o.top,
|
|
1385
|
-
return d = De(d = Ne(d, yt(d, { left: r.left !== void 0 ? r.left - y * f : void 0, top: r.top !== void 0 ? r.top - g * f : void 0, bottom: r.bottom !== void 0 ? r.bottom +
|
|
1384
|
+
var y = t.left - o.left, w = o.width + o.left - (t.width + t.left), g = t.top - o.top, k = o.height + o.top - (t.height + t.top);
|
|
1385
|
+
return d = De(d = Ne(d, yt(d, { left: r.left !== void 0 ? r.left - y * f : void 0, top: r.top !== void 0 ? r.top - g * f : void 0, bottom: r.bottom !== void 0 ? r.bottom + k * f : void 0, right: r.right !== void 0 ? r.right + w * f : void 0 })), i({ visibleArea: d, type: "move" })), m.width = m.width * f, m.height = m.height * f, m.left = d.left + y * f, m.top = d.top + g * f, m = De(m, Yt(Xe(d), r)), s.factor && v && l && (s.factor > 1 ? p = Math.min(A.area.maximum, s.factor) / f : s.factor < 1 && (p = Math.max(m.height / d.height, m.width / d.width, s.factor / f)), p !== 1 && (d = Ne(d = De(d = je(d, p, s.factor > 1 ? s.center : Ie(m)), i({ visibleArea: d, type: "move" })), Kt(yt(m, Xe(d)))))), { coordinates: m, visibleArea: d };
|
|
1386
1386
|
}
|
|
1387
1387
|
function ma(e) {
|
|
1388
1388
|
var n = e.aspectRatio, t = e.getAreaRestrictions, o = e.coordinates, a = e.visibleArea, i = e.sizeRestrictions, r = e.positionRestrictions, l = e.imageSize, s = e.previousImageSize, u = e.angle, d = re({}, o), m = re({}, a), p = at(Ie(re({ left: 0, top: 0 }, s)), u);
|
|
@@ -1434,7 +1434,7 @@ var fa = We("vue-simple-handler"), ha = We("vue-simple-handler-wrapper"), kn = {
|
|
|
1434
1434
|
return { hover: !1 };
|
|
1435
1435
|
}, computed: { classes: function() {
|
|
1436
1436
|
var e, n = (Be(e = {}, this.horizontalPosition, !!this.horizontalPosition), Be(e, this.verticalPosition, !!this.verticalPosition), Be(e, "".concat(this.horizontalPosition, "-").concat(this.verticalPosition), !!(this.verticalPosition && this.horizontalPosition)), Be(e, "hover", this.hover), e);
|
|
1437
|
-
return { default:
|
|
1437
|
+
return { default: Ee(fa(n), this.defaultClass, this.hover && this.hoverClass), wrapper: Ee(ha(n), this.wrapperClass) };
|
|
1438
1438
|
} }, methods: { onDrag: function(e) {
|
|
1439
1439
|
this.$emit("drag", e);
|
|
1440
1440
|
}, onEnter: function() {
|
|
@@ -1453,7 +1453,7 @@ kn.render = function(e, n, t, o, a, i) {
|
|
|
1453
1453
|
var va = We("vue-simple-line"), ga = We("vue-simple-line-wrapper"), xn = { name: "SimpleLine", components: { LineWrapper: po }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, position: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
|
|
1454
1454
|
return { hover: !1 };
|
|
1455
1455
|
}, computed: { classes: function() {
|
|
1456
|
-
return { root:
|
|
1456
|
+
return { root: Ee(va(Be({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass), wrapper: Ee(ga(Be({}, this.position, !0)), this.wrapperClass) };
|
|
1457
1457
|
} }, methods: { onDrag: function(e) {
|
|
1458
1458
|
this.$emit("drag", e);
|
|
1459
1459
|
}, onEnter: function() {
|
|
@@ -1504,13 +1504,13 @@ var en = We("vue-bounding-box"), ba = ["east", "west", null], ya = ["south", "no
|
|
|
1504
1504
|
}, lineNodes: function() {
|
|
1505
1505
|
var e = this, n = [];
|
|
1506
1506
|
return this.points.forEach(function(t) {
|
|
1507
|
-
t.horizontalDirection && t.verticalDirection || !e.lines[t.name] || n.push({ name: t.name, component: e.linesComponent, class:
|
|
1507
|
+
t.horizontalDirection && t.verticalDirection || !e.lines[t.name] || n.push({ name: t.name, component: e.linesComponent, class: Ee(e.classes.lines.default, e.classes.lines[t.name], !e.resizable && e.classes.lines.disabled), wrapperClass: Ee(e.classes.linesWrappers.default, e.classes.linesWrappers[t.name], !e.resizable && e.classes.linesWrappers.disabled), hoverClass: e.classes.lines.hover, verticalDirection: t.verticalDirection, horizontalDirection: t.horizontalDirection, disabled: !e.resizable });
|
|
1508
1508
|
}), n;
|
|
1509
1509
|
}, handlerNodes: function() {
|
|
1510
1510
|
var e = this, n = [], t = this.width, o = this.height;
|
|
1511
1511
|
return this.points.forEach(function(a) {
|
|
1512
1512
|
if (e.handlers[a.name]) {
|
|
1513
|
-
var i = { name: a.name, component: e.handlersComponent, class:
|
|
1513
|
+
var i = { name: a.name, component: e.handlersComponent, class: Ee(e.classes.handlers.default, e.classes.handlers[a.name]), wrapperClass: Ee(e.classes.handlersWrappers.default, e.classes.handlersWrappers[a.name]), hoverClass: e.classes.handlers.hover, verticalDirection: a.verticalDirection, horizontalDirection: a.horizontalDirection, disabled: !e.resizable };
|
|
1514
1514
|
if (t && o) {
|
|
1515
1515
|
var r = a.horizontalDirection, l = a.verticalDirection, s = r === "east" ? t : r === "west" ? 0 : t / 2, u = l === "south" ? o : l === "north" ? 0 : o / 2;
|
|
1516
1516
|
i.wrapperClass = en("handler"), i.wrapperStyle = { transform: "translate(".concat(s, "px, ").concat(u, "px)") }, e.transitions && e.transitions.enabled && (i.wrapperStyle.transition = "".concat(e.transitions.time, "ms ").concat(e.transitions.timingFunction));
|
|
@@ -1531,13 +1531,13 @@ var en = We("vue-bounding-box"), ba = ["east", "west", null], ya = ["south", "no
|
|
|
1531
1531
|
n === "west" ? l.left -= i : n === "east" && (l.right += i), t === "north" ? l.top -= r : t === "south" && (l.bottom += r), !t && n ? o = "width" : t && !n && (o = "height"), this.resizable && this.$emit("resize", new qi(l, { allowedDirections: { left: n === "west" || !n, right: n === "east" || !n, bottom: t === "south" || !t, top: t === "north" || !t }, preserveAspectRatio: e.nativeEvent && e.nativeEvent.shiftKey, respectDirection: o }));
|
|
1532
1532
|
} }, emits: ["resize", "resize-end"] };
|
|
1533
1533
|
go.render = function(e, n, t, o, a, i) {
|
|
1534
|
-
return C(), Q("div", { ref: "box", class: i.classes.root, style: i.style }, [
|
|
1534
|
+
return C(), Q("div", { ref: "box", class: i.classes.root, style: i.style }, [Ce(e.$slots, "default"), h("div", null, [(C(!0), Q(me, null, ke(i.lineNodes, function(r) {
|
|
1535
1535
|
return C(), Q(Dt(r.component), { key: r.name, "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, position: r.name, disabled: r.disabled, onDrag: function(l) {
|
|
1536
1536
|
return i.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1537
1537
|
}, onDragEnd: n[1] || (n[1] = function(l) {
|
|
1538
1538
|
return i.onEnd();
|
|
1539
1539
|
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
|
|
1540
|
-
}), 128))]), (C(!0), Q(me, null,
|
|
1540
|
+
}), 128))]), (C(!0), Q(me, null, ke(i.handlerNodes, function(r) {
|
|
1541
1541
|
return C(), Q("div", { key: r.name, style: r.wrapperStyle, class: r.wrapperClass }, [(C(), Q(Dt(r.component), { "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, "horizontal-position": r.horizontalDirection, "vertical-position": r.verticalDirection, disabled: r.disabled, onDrag: function(l) {
|
|
1542
1542
|
return i.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1543
1543
|
}, onDragEnd: n[2] || (n[2] = function(l) {
|
|
@@ -1588,7 +1588,7 @@ bo.render = function(e, n, t, o, a, i) {
|
|
|
1588
1588
|
return i.onTouchStart && i.onTouchStart.apply(i, arguments);
|
|
1589
1589
|
}), onMousedown: n[2] || (n[2] = function() {
|
|
1590
1590
|
return i.onMouseDown && i.onMouseDown.apply(i, arguments);
|
|
1591
|
-
}) }, [
|
|
1591
|
+
}) }, [Ce(e.$slots, "default")], 544);
|
|
1592
1592
|
};
|
|
1593
1593
|
function tn(e) {
|
|
1594
1594
|
var n, t;
|
|
@@ -1734,7 +1734,7 @@ _o.render = function(e, n, t, o, a, i) {
|
|
|
1734
1734
|
return i.onMouseDown && i.onMouseDown.apply(i, arguments);
|
|
1735
1735
|
}), onWheel: n[3] || (n[3] = function() {
|
|
1736
1736
|
return i.onWheel && i.onWheel.apply(i, arguments);
|
|
1737
|
-
}) }, [
|
|
1737
|
+
}) }, [Ce(e.$slots, "default")], 544);
|
|
1738
1738
|
};
|
|
1739
1739
|
var fn = { components: { TransformableImage: _o }, props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 } }, emits: ["resize", "move"] };
|
|
1740
1740
|
fn.render = function(e, n, t, o, a, i) {
|
|
@@ -1744,7 +1744,7 @@ fn.render = function(e, n, t, o, a, i) {
|
|
|
1744
1744
|
}), onResize: n[2] || (n[2] = function(l) {
|
|
1745
1745
|
return e.$emit("resize", l);
|
|
1746
1746
|
}) }, { default: V(function() {
|
|
1747
|
-
return [
|
|
1747
|
+
return [Ce(e.$slots, "default")];
|
|
1748
1748
|
}), _: 3 }, 8, ["touch-move", "touch-resize", "mouse-move", "wheel-resize"]);
|
|
1749
1749
|
};
|
|
1750
1750
|
var Vt = We("vue-preview"), wo = { props: { coordinates: { type: Object }, transitions: { type: Object }, image: { type: Object, default: function() {
|
|
@@ -1752,7 +1752,7 @@ var Vt = We("vue-preview"), wo = { props: { coordinates: { type: Object }, trans
|
|
|
1752
1752
|
} }, imageClass: { type: String }, width: { type: Number }, height: { type: Number }, fill: { type: Boolean } }, data: function() {
|
|
1753
1753
|
return { calculatedImageSize: { width: 0, height: 0 }, calculatedSize: { width: 0, height: 0 } };
|
|
1754
1754
|
}, computed: { classes: function() {
|
|
1755
|
-
return { root: Vt({ fill: this.fill }), wrapper: Vt("wrapper"), imageWrapper: Vt("image-wrapper"), image:
|
|
1755
|
+
return { root: Vt({ fill: this.fill }), wrapper: Vt("wrapper"), imageWrapper: Vt("image-wrapper"), image: Ee(Vt("image"), this.imageClass) };
|
|
1756
1756
|
}, style: function() {
|
|
1757
1757
|
if (this.fill) return {};
|
|
1758
1758
|
var e = {};
|
|
@@ -1762,7 +1762,7 @@ var Vt = We("vue-preview"), wo = { props: { coordinates: { type: Object }, trans
|
|
|
1762
1762
|
return this.transitions && this.transitions.enabled && (e.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), e;
|
|
1763
1763
|
}, imageStyle: function() {
|
|
1764
1764
|
if (this.coordinates && this.image) {
|
|
1765
|
-
var e = this.coordinates.width / this.size.width, n =
|
|
1765
|
+
var e = this.coordinates.width / this.size.width, n = fe(fe({ rotate: 0, flip: { horizontal: !1, vertical: !1 } }, this.image.transforms), {}, { scaleX: 1 / e, scaleY: 1 / e }), t = this.imageSize.width, o = this.imageSize.height, a = ho({ width: t, height: o }, n.rotate), i = { width: "".concat(t, "px"), height: "".concat(o, "px"), left: "0px", top: "0px" }, r = { rotate: { left: (t - a.width) * n.scaleX / 2, top: (o - a.height) * n.scaleY / 2 }, scale: { left: (1 - n.scaleX) * t / 2, top: (1 - n.scaleY) * o / 2 } };
|
|
1766
1766
|
return i.transform = `translate(
|
|
1767
1767
|
`.concat(-this.coordinates.left / e - r.rotate.left - r.scale.left, "px,").concat(-this.coordinates.top / e - r.rotate.top - r.scale.top, "px) ") + yo(n), this.transitions && this.transitions.enabled && (i.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), i;
|
|
1768
1768
|
}
|
|
@@ -1813,7 +1813,7 @@ var nn = We("vue-rectangle-stencil"), xo = { name: "RectangleStencil", component
|
|
|
1813
1813
|
} } }, data: function() {
|
|
1814
1814
|
return { moving: !1, resizing: !1 };
|
|
1815
1815
|
}, computed: { classes: function() {
|
|
1816
|
-
return { stencil:
|
|
1816
|
+
return { stencil: Ee(nn({ movable: this.movable, moving: this.moving, resizing: this.resizing }), this.moving && this.movingClass, this.resizing && this.resizingClass), preview: Ee(nn("preview"), this.previewClass), boundingBox: Ee(nn("bounding-box"), this.boundingBoxClass) };
|
|
1817
1817
|
}, style: function() {
|
|
1818
1818
|
var e = this.stencilCoordinates, n = e.height, t = e.width, o = e.left, a = e.top, i = { width: "".concat(t, "px"), height: "".concat(n, "px"), transform: "translate(".concat(o, "px, ").concat(a, "px)") };
|
|
1819
1819
|
return this.transitions && this.transitions.enabled && (i.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), i;
|
|
@@ -1851,7 +1851,7 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
1851
1851
|
i.widthFrozen && (s.left = 0, s.right = 0), i.heightFrozen && (s.top = 0, s.bottom = 0), qe.forEach(function(L) {
|
|
1852
1852
|
u[L] || (s[L] = 0);
|
|
1853
1853
|
});
|
|
1854
|
-
var d = He(r, s = Un({ coordinates: r, directions: s, sizeRestrictions: i, positionRestrictions: a })).width, m = He(r, s).height, p = l.preserveRatio ?
|
|
1854
|
+
var d = He(r, s = Un({ coordinates: r, directions: s, sizeRestrictions: i, positionRestrictions: a })).width, m = He(r, s).height, p = l.preserveRatio ? he(r) : Jt(d / m, o);
|
|
1855
1855
|
if (p) {
|
|
1856
1856
|
var f = l.respectDirection;
|
|
1857
1857
|
if (f || (f = r.width >= r.height || p === 1 ? "width" : "height"), f === "width") {
|
|
@@ -1863,36 +1863,36 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
1863
1863
|
} else if (f === "height") {
|
|
1864
1864
|
var w = r.width - m * p;
|
|
1865
1865
|
if (u.left && u.right) {
|
|
1866
|
-
var g = s.left,
|
|
1867
|
-
s.left = -Tt(w, g,
|
|
1866
|
+
var g = s.left, k = s.right;
|
|
1867
|
+
s.left = -Tt(w, g, k), s.right = -Tt(w, k, g);
|
|
1868
1868
|
} else u.left ? s.left = -w : u.right ? s.right = -w : u.top ? s.top = 0 : u.bottom && (s.bottom = 0);
|
|
1869
1869
|
}
|
|
1870
1870
|
s = Un({ directions: s, coordinates: r, sizeRestrictions: i, positionRestrictions: a, preserveRatio: !0, compensate: l.compensate });
|
|
1871
1871
|
}
|
|
1872
|
-
return d = He(r, s).width, m = He(r, s).height, (p = l.preserveRatio ?
|
|
1872
|
+
return d = He(r, s).width, m = He(r, s).height, (p = l.preserveRatio ? he(r) : Jt(d / m, o)) && Math.abs(p - d / m) > 1e-3 && qe.forEach(function(L) {
|
|
1873
1873
|
u[L] || (s[L] = 0);
|
|
1874
1874
|
}), pn({ event: new _n({ 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 });
|
|
1875
1875
|
} }, moveAlgorithm: { type: Function, default: pn }, initStretcher: { type: Function, default: function(e) {
|
|
1876
|
-
var n = e.stretcher, t = e.imageSize, o =
|
|
1876
|
+
var n = e.stretcher, t = e.imageSize, o = he(t);
|
|
1877
1877
|
n.style.width = t.width + "px", n.style.height = n.clientWidth / o + "px", n.style.width = n.clientWidth + "px";
|
|
1878
1878
|
} }, fitCoordinates: { type: Function, default: function(e) {
|
|
1879
1879
|
var n = e.visibleArea, t = e.coordinates, o = e.aspectRatio, a = e.sizeRestrictions, i = e.positionRestrictions, r = re(re({}, t), et({ width: t.width, height: t.height, aspectRatio: o, sizeRestrictions: { maxWidth: n.width, maxHeight: n.height, minHeight: Math.min(n.height, a.minHeight), minWidth: Math.min(n.width, a.minWidth) } }));
|
|
1880
1880
|
return r = De(r = Ne(r, gt(Ie(t), Ie(r))), Yt(Xe(n), i));
|
|
1881
1881
|
} }, fitVisibleArea: { type: Function, default: function(e) {
|
|
1882
1882
|
var n = e.visibleArea, t = e.boundaries, o = e.getAreaRestrictions, a = e.coordinates, i = re({}, n);
|
|
1883
|
-
i.height = i.width /
|
|
1883
|
+
i.height = i.width / he(t), i.top += (n.height - i.height) / 2, (a.height - i.height > 0 || a.width - i.width > 0) && (i = je(i, Math.max(a.height / i.height, a.width / i.width)));
|
|
1884
1884
|
var r = Kt(yt(a, Xe(i = je(i, Wt(i, o({ visibleArea: i, type: "resize" }))))));
|
|
1885
1885
|
return i.width < a.width && (r.left = 0), i.height < a.height && (r.top = 0), i = De(i = Ne(i, r), o({ visibleArea: i, type: "move" }));
|
|
1886
1886
|
} }, areaRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1887
1887
|
var n = e.visibleArea, t = e.boundaries, o = e.imageSize, a = e.imageRestriction, i = e.type, r = {};
|
|
1888
|
-
return a === "fill-area" ? r = { left: 0, top: 0, right: o.width, bottom: o.height } : a === "fit-area" && (
|
|
1888
|
+
return a === "fill-area" ? r = { left: 0, top: 0, right: o.width, bottom: o.height } : a === "fit-area" && (he(t) > he(o) ? (r = { top: 0, bottom: o.height }, n && i === "move" && (n.width > o.width ? (r.left = -(n.width - o.width) / 2, r.right = o.width - r.left) : (r.left = 0, r.right = o.width))) : (r = { left: 0, right: o.width }, n && i === "move" && (n.height > o.height ? (r.top = -(n.height - o.height) / 2, r.bottom = o.height - r.top) : (r.top = 0, r.bottom = o.height)))), r;
|
|
1889
1889
|
} }, sizeRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1890
1890
|
return { minWidth: e.minWidth, minHeight: e.minHeight, maxWidth: e.maxWidth, maxHeight: e.maxHeight };
|
|
1891
1891
|
} }, positionRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1892
1892
|
var n = e.imageSize, t = {};
|
|
1893
1893
|
return e.imageRestriction !== "none" && (t = { left: 0, top: 0, right: n.width, bottom: n.height }), t;
|
|
1894
1894
|
} } }, data: function() {
|
|
1895
|
-
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates:
|
|
1895
|
+
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: fe({}, In) };
|
|
1896
1896
|
}, computed: { image: function() {
|
|
1897
1897
|
return { src: this.imageAttributes.src, width: this.imageAttributes.width, height: this.imageAttributes.height, transforms: this.imageTransforms };
|
|
1898
1898
|
}, imageTransforms: function() {
|
|
@@ -1931,7 +1931,7 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
1931
1931
|
}, positionRestrictions: function() {
|
|
1932
1932
|
return this.positionRestrictionsAlgorithm({ imageSize: this.imageSize, imageRestriction: this.imageRestriction });
|
|
1933
1933
|
}, classes: function() {
|
|
1934
|
-
return { cropper: Qe(), image:
|
|
1934
|
+
return { cropper: Qe(), image: Ee(Qe("image"), this.imageClass), stencil: Qe("stencil"), boundaries: Ee(Qe("boundaries"), this.boundariesClass), stretcher: Ee(Qe("stretcher")), background: Ee(Qe("background"), this.backgroundClass), foreground: Ee(Qe("foreground"), this.foregroundClass), imageWrapper: Ee(Qe("image-wrapper")), cropperWrapper: Ee(Qe("cropper-wrapper")) };
|
|
1935
1935
|
}, stencilCoordinates: function() {
|
|
1936
1936
|
if (this.initialized) {
|
|
1937
1937
|
var e = this.coordinates, n = e.width, t = e.height, o = e.left, a = e.top;
|
|
@@ -1942,7 +1942,7 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
1942
1942
|
var e = { width: this.boundaries.width ? "".concat(Math.round(this.boundaries.width), "px") : "auto", height: this.boundaries.height ? "".concat(Math.round(this.boundaries.height), "px") : "auto", transition: "opacity ".concat(this.transitionTime, "ms"), pointerEvents: this.imageLoaded ? "all" : "none" };
|
|
1943
1943
|
return this.imageLoaded || (e.opacity = "0"), e;
|
|
1944
1944
|
}, imageStyle: function() {
|
|
1945
|
-
var e = this.imageAttributes.width > this.imageAttributes.height ? { width: Math.min(1024, this.imageAttributes.width), height: Math.min(1024, this.imageAttributes.width) / (this.imageAttributes.width / this.imageAttributes.height) } : { height: Math.min(1024, this.imageAttributes.height), width: Math.min(1024, this.imageAttributes.height) * (this.imageAttributes.width / this.imageAttributes.height) }, n = { left: (e.width - this.imageSize.width) / (2 * this.coefficient), top: (e.height - this.imageSize.height) / (2 * this.coefficient) }, t = { left: (1 - 1 / this.coefficient) * e.width / 2, top: (1 - 1 / this.coefficient) * e.height / 2 }, o =
|
|
1945
|
+
var e = this.imageAttributes.width > this.imageAttributes.height ? { width: Math.min(1024, this.imageAttributes.width), height: Math.min(1024, this.imageAttributes.width) / (this.imageAttributes.width / this.imageAttributes.height) } : { height: Math.min(1024, this.imageAttributes.height), width: Math.min(1024, this.imageAttributes.height) * (this.imageAttributes.width / this.imageAttributes.height) }, n = { left: (e.width - this.imageSize.width) / (2 * this.coefficient), top: (e.height - this.imageSize.height) / (2 * this.coefficient) }, t = { left: (1 - 1 / this.coefficient) * e.width / 2, top: (1 - 1 / this.coefficient) * e.height / 2 }, o = fe(fe({}, this.imageTransforms), {}, { scaleX: this.imageTransforms.scaleX * (this.imageAttributes.width / e.width), scaleY: this.imageTransforms.scaleY * (this.imageAttributes.height / e.height) }), a = { width: "".concat(e.width, "px"), height: "".concat(e.height, "px"), left: "0px", top: "0px", transform: "translate(".concat(-n.left - t.left - this.imageTransforms.translateX, "px, ").concat(-n.top - t.top - this.imageTransforms.translateY, "px)") + yo(o) };
|
|
1946
1946
|
return this.transitionsOptions.enabled && (a.transition = "".concat(this.transitionsOptions.time, "ms ").concat(this.transitionsOptions.timingFunction)), a;
|
|
1947
1947
|
} }, watch: { src: function() {
|
|
1948
1948
|
this.onChangeImage();
|
|
@@ -1972,14 +1972,14 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
1972
1972
|
}, unmounted: function() {
|
|
1973
1973
|
window.removeEventListener("resize", this.refresh), window.removeEventListener("orientationchange", this.refresh), this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.debouncedUpdate.clear(), this.debouncedDisableTransitions.clear();
|
|
1974
1974
|
}, methods: { getResult: function() {
|
|
1975
|
-
var e = this.initialized ? this.prepareResult(
|
|
1975
|
+
var e = this.initialized ? this.prepareResult(fe({}, this.coordinates)) : this.defaultCoordinates(), n = { rotate: this.imageTransforms.rotate % 360, flip: fe({}, this.imageTransforms.flip) };
|
|
1976
1976
|
if (this.src && this.imageLoaded) {
|
|
1977
1977
|
var t = this;
|
|
1978
|
-
return { image: this.image, coordinates: e, visibleArea: this.visibleArea ?
|
|
1978
|
+
return { image: this.image, coordinates: e, visibleArea: this.visibleArea ? fe({}, this.visibleArea) : null, imageTransforms: n, get canvas() {
|
|
1979
1979
|
return t.canvas ? t.getCanvas() : void 0;
|
|
1980
1980
|
} };
|
|
1981
1981
|
}
|
|
1982
|
-
return { image: this.image, coordinates: e, visibleArea: this.visibleArea ?
|
|
1982
|
+
return { image: this.image, coordinates: e, visibleArea: this.visibleArea ? fe({}, this.visibleArea) : null, canvas: void 0, imageTransforms: n };
|
|
1983
1983
|
}, zoom: function(e, n) {
|
|
1984
1984
|
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = t.transitions, a = o === void 0 || o;
|
|
1985
1985
|
this.onManipulateImage(new Ct({}, { factor: 1 / e, center: n }), { normalize: !1, transitions: a });
|
|
@@ -2012,12 +2012,12 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
2012
2012
|
return this.roundResult ? function(n) {
|
|
2013
2013
|
var t = n.coordinates, o = n.sizeRestrictions, a = n.positionRestrictions, i = { width: Math.round(t.width), height: Math.round(t.height), left: Math.round(t.left), top: Math.round(t.top) };
|
|
2014
2014
|
return i.width > o.maxWidth ? i.width = Math.floor(t.width) : i.width < o.minWidth && (i.width = Math.ceil(t.width)), i.height > o.maxHeight ? i.height = Math.floor(t.height) : i.height < o.minHeight && (i.height = Math.ceil(t.height)), De(i, a);
|
|
2015
|
-
}(
|
|
2015
|
+
}(fe(fe({}, this.getPublicProperties()), {}, { positionRestrictions: Et(this.positionRestrictions, this.visibleArea), coordinates: e })) : e;
|
|
2016
2016
|
}, processAutoZoom: function(e, n, t, o) {
|
|
2017
2017
|
var a = this.autoZoomAlgorithm;
|
|
2018
2018
|
a || (a = this.stencilSize ? ia : this.autoZoom ? aa : ra);
|
|
2019
2019
|
var i = a({ event: { type: e, params: o }, visibleArea: n, coordinates: t, boundaries: this.boundaries, aspectRatio: this.getAspectRatio(), positionRestrictions: this.positionRestrictions, getAreaRestrictions: this.getAreaRestrictions, sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize() });
|
|
2020
|
-
return
|
|
2020
|
+
return fe(fe({}, i), {}, { changed: !Dn(i.visibleArea, n) || !Dn(i.coordinates, t) });
|
|
2021
2021
|
}, runAutoZoom: function(e) {
|
|
2022
2022
|
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = n.transitions, o = t !== void 0 && t, a = Yi(n, xa), i = this.processAutoZoom(e, this.visibleArea, this.coordinates, a), r = i.visibleArea, l = i.coordinates, s = i.changed;
|
|
2023
2023
|
o && s && this.enableTransitions(), this.visibleArea = r, this.coordinates = l, o && s && this.debouncedDisableTransitions();
|
|
@@ -2038,7 +2038,7 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
2038
2038
|
}), r;
|
|
2039
2039
|
}
|
|
2040
2040
|
return t;
|
|
2041
|
-
}(
|
|
2041
|
+
}(fe(fe({}, this.getPublicProperties()), {}, { event: e }));
|
|
2042
2042
|
}, getCanvas: function() {
|
|
2043
2043
|
if (this.$refs.canvas) {
|
|
2044
2044
|
var e = this.$refs.canvas, n = this.$refs.image, t = this.imageTransforms.rotate !== 0 || this.imageTransforms.flip.horizontal || this.imageTransforms.flip.vertical ? function(l, s, u) {
|
|
@@ -2046,7 +2046,7 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
2046
2046
|
l.height = f.height, l.width = f.width, v.save();
|
|
2047
2047
|
var A = at(Ie(re({ left: 0, top: 0 }, p)), d);
|
|
2048
2048
|
return v.translate(-(A.left - f.width / 2), -(A.top - f.height / 2)), v.rotate(d * Math.PI / 180), v.translate(m.horizontal ? p.width : 0, m.vertical ? p.height : 0), v.scale(m.horizontal ? -1 : 1, m.vertical ? -1 : 1), v.drawImage(s, 0, 0, p.width, p.height), v.restore(), l;
|
|
2049
|
-
}(this.$refs.sourceCanvas, n, this.imageTransforms) : n, o =
|
|
2049
|
+
}(this.$refs.sourceCanvas, n, this.imageTransforms) : n, o = fe({ minWidth: 0, minHeight: 0, maxWidth: 1 / 0, maxHeight: 1 / 0, maxArea: this.maxCanvasSize, imageSmoothingEnabled: !0, imageSmoothingQuality: "high", fillColor: "transparent" }, this.canvas), a = function(l) {
|
|
2050
2050
|
return l.find(function(s) {
|
|
2051
2051
|
return u = s, !Number.isNaN(parseFloat(u)) && isFinite(u);
|
|
2052
2052
|
var u;
|
|
@@ -2079,7 +2079,7 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
2079
2079
|
t.minWidth, t.minHeight, t.maxWidth, t.maxHeight;
|
|
2080
2080
|
var o = pt(n) ? n({ boundaries: this.boundaries, imageSize: this.imageSize, aspectRatio: this.getAspectRatio(), sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize(), visibleArea: this.visibleArea }) : n, a = this.defaultPosition || sa, i = [o, function(r) {
|
|
2081
2081
|
var l = r.coordinates;
|
|
2082
|
-
return
|
|
2082
|
+
return fe({}, pt(a) ? a({ coordinates: l, imageSize: e.imageSize, visibleArea: e.visibleArea }) : e.defaultPosition);
|
|
2083
2083
|
}];
|
|
2084
2084
|
this.delayedTransforms && i.push.apply(i, dt(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
|
|
2085
2085
|
}
|
|
@@ -2107,10 +2107,10 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
2107
2107
|
});
|
|
2108
2108
|
}, resetVisibleArea: function() {
|
|
2109
2109
|
var e = this;
|
|
2110
|
-
return this.appliedImageTransforms =
|
|
2110
|
+
return this.appliedImageTransforms = fe(fe({}, this.defaultImageTransforms), {}, { flip: fe({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then(function() {
|
|
2111
2111
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
2112
2112
|
var n, t, o, a, i, r, l = e.defaultVisibleArea || ca;
|
|
2113
|
-
e.visibleArea = pt(l) ? l({ imageSize: e.imageSize, boundaries: e.boundaries, coordinates: e.priority !== "visible-area" ? e.coordinates : null, getAreaRestrictions: e.getAreaRestrictions, stencilSize: e.getStencilSize() }) : e.defaultVisibleArea, e.visibleArea = (n = { visibleArea: e.visibleArea, boundaries: e.boundaries, getAreaRestrictions: e.getAreaRestrictions }, t = n.visibleArea, o = n.boundaries, a = n.getAreaRestrictions, i = re({}, t), r =
|
|
2113
|
+
e.visibleArea = pt(l) ? l({ imageSize: e.imageSize, boundaries: e.boundaries, coordinates: e.priority !== "visible-area" ? e.coordinates : null, getAreaRestrictions: e.getAreaRestrictions, stencilSize: e.getStencilSize() }) : e.defaultVisibleArea, e.visibleArea = (n = { visibleArea: e.visibleArea, boundaries: e.boundaries, getAreaRestrictions: e.getAreaRestrictions }, t = n.visibleArea, o = n.boundaries, a = n.getAreaRestrictions, i = re({}, t), r = he(o), i.width / i.height !== r && (i.height = i.width / r), De(i, a({ visibleArea: i, type: "move" }))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({ visibleArea: e.visibleArea, coordinates: e.coordinates, aspectRatio: e.getAspectRatio(), positionRestrictions: e.positionRestrictions, sizeRestrictions: e.sizeRestrictions }), e.runAutoZoom("resetVisibleArea");
|
|
2114
2114
|
}).catch(function() {
|
|
2115
2115
|
e.visibleArea = null;
|
|
2116
2116
|
});
|
|
@@ -2193,7 +2193,7 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
2193
2193
|
r.rotate = -90;
|
|
2194
2194
|
}
|
|
2195
2195
|
return r;
|
|
2196
|
-
}(a), this.defaultImageTransforms =
|
|
2196
|
+
}(a), this.defaultImageTransforms = fe(fe({}, this.appliedImageTransforms), {}, { flip: fe({}, this.appliedImageTransforms.flip) }), this.$nextTick(function() {
|
|
2197
2197
|
var i = n.$refs.image;
|
|
2198
2198
|
i && i.complete && (function(r) {
|
|
2199
2199
|
return !!r.naturalWidth;
|
|
@@ -2206,20 +2206,20 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
2206
2206
|
}, onMove: function(e) {
|
|
2207
2207
|
var n = this;
|
|
2208
2208
|
this.transitionsOptions.enabled || this.awaitRender(function() {
|
|
2209
|
-
n.coordinates = n.moveAlgorithm(
|
|
2209
|
+
n.coordinates = n.moveAlgorithm(fe(fe({}, n.getPublicProperties()), {}, { positionRestrictions: Et(n.positionRestrictions, n.visibleArea), coordinates: n.coordinates, event: n.normalizeEvent(e) })), n.onChange();
|
|
2210
2210
|
});
|
|
2211
2211
|
}, onResize: function(e) {
|
|
2212
2212
|
var n = this;
|
|
2213
2213
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender(function() {
|
|
2214
2214
|
var t = n.sizeRestrictions, o = Math.min(n.coordinates.width, n.coordinates.height, 20 * n.coefficient);
|
|
2215
|
-
n.coordinates = n.resizeAlgorithm(
|
|
2215
|
+
n.coordinates = n.resizeAlgorithm(fe(fe({}, n.getPublicProperties()), {}, { positionRestrictions: Et(n.positionRestrictions, n.visibleArea), sizeRestrictions: { maxWidth: Math.min(t.maxWidth, n.visibleArea.width), maxHeight: Math.min(t.maxHeight, n.visibleArea.height), minWidth: Math.max(t.minWidth, o), minHeight: Math.max(t.minHeight, o) }, event: n.normalizeEvent(e) })), n.onChange(), n.ticking = !1;
|
|
2216
2216
|
});
|
|
2217
2217
|
}, onManipulateImage: function(e) {
|
|
2218
2218
|
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2219
2219
|
if (!this.transitionsOptions.enabled) {
|
|
2220
2220
|
var t = n.transitions, o = t !== void 0 && t, a = n.normalize, i = a === void 0 || a;
|
|
2221
2221
|
o && this.enableTransitions();
|
|
2222
|
-
var r = da(
|
|
2222
|
+
var r = da(fe(fe({}, this.getPublicProperties()), {}, { event: i ? this.normalizeEvent(e) : e, getAreaRestrictions: this.getAreaRestrictions, imageRestriction: this.imageRestriction, adjustStencil: !this.stencilSize && this.settings.resizeImage.adjustStencil })), l = r.visibleArea, s = r.coordinates;
|
|
2223
2223
|
this.visibleArea = l, this.coordinates = s, this.runAutoZoom("manipulateImage"), this.onChange(), o && this.debouncedDisableTransitions();
|
|
2224
2224
|
}
|
|
2225
2225
|
}, onPropsChange: function() {
|
|
@@ -2234,29 +2234,29 @@ var xa = ["transitions"], Qe = We("vue-advanced-cropper"), Co = { name: "Cropper
|
|
|
2234
2234
|
n = l.minimum, t = l.maximum;
|
|
2235
2235
|
}
|
|
2236
2236
|
if (Ve(n) && (n = Ve(a) ? i : a), Ve(t) && (t = Ve(a) ? r : a), !e && (Ve(n) || Ve(t))) {
|
|
2237
|
-
var s = this.getStencilSize(), u = s ?
|
|
2237
|
+
var s = this.getStencilSize(), u = s ? he(s) : null;
|
|
2238
2238
|
Ve(n) && (n = zn(u) ? u : void 0), Ve(t) && (t = zn(u) ? u : void 0);
|
|
2239
2239
|
}
|
|
2240
2240
|
return { minimum: n, maximum: t };
|
|
2241
2241
|
}, getStencilSize: function() {
|
|
2242
|
-
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) }, n = e.boundaries, t = e.stencilSize, o = e.aspectRatio, Jt(
|
|
2242
|
+
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) }, n = e.boundaries, t = e.stencilSize, o = e.aspectRatio, Jt(he(a = pt(t) ? t({ boundaries: n, aspectRatio: o }) : t), o) && (a = et({ sizeRestrictions: { maxWidth: n.width, maxHeight: n.height, minWidth: 0, minHeight: 0 }, width: a.width, height: a.height, aspectRatio: { minimum: o.minimum, maximum: o.maximum } })), (a.width > n.width || a.height > n.height) && (a = et({ sizeRestrictions: { maxWidth: n.width, maxHeight: n.height, minWidth: 0, minHeight: 0 }, width: a.width, height: a.height, aspectRatio: { minimum: he(a), maximum: he(a) } })), a;
|
|
2243
2243
|
var e, n, t, o, a;
|
|
2244
2244
|
}, getPublicProperties: function() {
|
|
2245
2245
|
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 };
|
|
2246
2246
|
}, defaultCoordinates: function() {
|
|
2247
|
-
return
|
|
2247
|
+
return fe({}, In);
|
|
2248
2248
|
}, flip: function(e, n) {
|
|
2249
2249
|
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = t.transitions, a = o === void 0 || o;
|
|
2250
2250
|
if (!this.transitionsActive) {
|
|
2251
2251
|
a && this.enableTransitions();
|
|
2252
|
-
var i =
|
|
2252
|
+
var i = fe({}, this.imageTransforms.flip), r = pa({ flip: { horizontal: e ? !i.horizontal : i.horizontal, vertical: n ? !i.vertical : i.vertical }, previousFlip: i, rotate: this.imageTransforms.rotate, visibleArea: this.visibleArea, coordinates: this.coordinates, imageSize: this.imageSize, positionRestrictions: this.positionRestrictions, sizeRestrictions: this.sizeRestrictions, getAreaRestrictions: this.getAreaRestrictions, aspectRatio: this.getAspectRatio() }), l = r.visibleArea, s = r.coordinates;
|
|
2253
2253
|
e && (this.appliedImageTransforms.flip.horizontal = !this.appliedImageTransforms.flip.horizontal), n && (this.appliedImageTransforms.flip.vertical = !this.appliedImageTransforms.flip.vertical), this.visibleArea = l, this.coordinates = s, this.onChange(), a && this.debouncedDisableTransitions();
|
|
2254
2254
|
}
|
|
2255
2255
|
}, rotate: function(e) {
|
|
2256
2256
|
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = n.transitions, o = t === void 0 || t;
|
|
2257
2257
|
if (!this.transitionsActive) {
|
|
2258
2258
|
o && this.enableTransitions();
|
|
2259
|
-
var a =
|
|
2259
|
+
var a = fe({}, this.imageSize);
|
|
2260
2260
|
this.appliedImageTransforms.rotate += e;
|
|
2261
2261
|
var i = ma({ visibleArea: this.visibleArea, coordinates: this.coordinates, previousImageSize: a, imageSize: this.imageSize, angle: e, positionRestrictions: this.positionRestrictions, sizeRestrictions: this.sizeRestrictions, getAreaRestrictions: this.getAreaRestrictions, aspectRatio: this.getAspectRatio() }), r = i.visibleArea, l = i.coordinates, s = this.processAutoZoom("rotateImage", r, l);
|
|
2262
2262
|
r = s.visibleArea, l = s.coordinates, this.visibleArea = r, this.coordinates = l, this.onChange(), o && this.debouncedDisableTransitions();
|
|
@@ -2304,7 +2304,7 @@ const Ra = {
|
|
|
2304
2304
|
class: /* @__PURE__ */ Ue(["absolute inset-0", "h-full w-full", "rounded-md overflow-hidden"])
|
|
2305
2305
|
}, Va = {
|
|
2306
2306
|
class: /* @__PURE__ */ Ue(["relative z-0", "w-full h-full", "overflow-hidden"])
|
|
2307
|
-
}, za = { class: "absolute top-12 right-12 z-10 flex flex-col gap-8" }, Ia = { class: "fm-typo-en-body-lg-600 pb-4" }, Da = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, So = /* @__PURE__ */
|
|
2307
|
+
}, za = { class: "absolute top-12 right-12 z-10 flex flex-col gap-8" }, Ia = { class: "fm-typo-en-body-lg-600 pb-4" }, Da = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, So = /* @__PURE__ */ ge({
|
|
2308
2308
|
__name: "ImageDropField",
|
|
2309
2309
|
props: {
|
|
2310
2310
|
title: {},
|
|
@@ -2313,7 +2313,7 @@ const Ra = {
|
|
|
2313
2313
|
},
|
|
2314
2314
|
emits: ["update:model-value", "reset:model-value"],
|
|
2315
2315
|
setup(e, { emit: n }) {
|
|
2316
|
-
const t = e, { t: o } =
|
|
2316
|
+
const t = e, { t: o } = ye(), a = n, i = E(() => t.modelValue ? URL.createObjectURL(t.modelValue) : ""), r = Y(), l = Y(), s = Y(!1);
|
|
2317
2317
|
async function u([y]) {
|
|
2318
2318
|
if (!y) return;
|
|
2319
2319
|
s.value = !0;
|
|
@@ -2321,8 +2321,8 @@ const Ra = {
|
|
|
2321
2321
|
w.onload = () => {
|
|
2322
2322
|
const g = new Image();
|
|
2323
2323
|
g.src = w.result, l.value = w.result, g.onload = () => {
|
|
2324
|
-
const
|
|
2325
|
-
r.value =
|
|
2324
|
+
const k = Oa(g, 1.7777777777777777);
|
|
2325
|
+
r.value = k, s.value = !1;
|
|
2326
2326
|
}, g.onerror = () => {
|
|
2327
2327
|
s.value = !1;
|
|
2328
2328
|
};
|
|
@@ -2335,7 +2335,7 @@ const Ra = {
|
|
|
2335
2335
|
!r.value && i.value && (r.value = i.value);
|
|
2336
2336
|
const { canvas: w } = y, g = w.toDataURL("image/jpeg", 0.75);
|
|
2337
2337
|
l.value = g;
|
|
2338
|
-
const
|
|
2338
|
+
const k = await (await fetch(g)).blob(), L = new File([k], "img.jpeg", { type: "image/jpeg" });
|
|
2339
2339
|
a("update:model-value", L);
|
|
2340
2340
|
}
|
|
2341
2341
|
function p() {
|
|
@@ -2358,7 +2358,7 @@ const Ra = {
|
|
|
2358
2358
|
});
|
|
2359
2359
|
}
|
|
2360
2360
|
return (y, w) => {
|
|
2361
|
-
const g = D("fm-icon"),
|
|
2361
|
+
const g = D("fm-icon"), k = D("fm-drop-field");
|
|
2362
2362
|
return r.value || i.value ? (C(), K("div", Ra, [
|
|
2363
2363
|
O("p", Aa, [
|
|
2364
2364
|
Pt(ie(y.title) + " ", 1),
|
|
@@ -2409,7 +2409,7 @@ const Ra = {
|
|
|
2409
2409
|
])
|
|
2410
2410
|
])
|
|
2411
2411
|
])
|
|
2412
|
-
])) : (C(), Q(
|
|
2412
|
+
])) : (C(), Q(k, {
|
|
2413
2413
|
key: 1,
|
|
2414
2414
|
accept: ".jpg, .jpeg, .png, .gif, .JPG, .JPEG, .PNG, .GIF",
|
|
2415
2415
|
"content-class": "h-[150px] w-[200px]",
|
|
@@ -2428,7 +2428,7 @@ const Ra = {
|
|
|
2428
2428
|
}));
|
|
2429
2429
|
};
|
|
2430
2430
|
}
|
|
2431
|
-
}), Sn = /* @__PURE__ */
|
|
2431
|
+
}), Sn = /* @__PURE__ */ ge({
|
|
2432
2432
|
__name: "OrderFrom",
|
|
2433
2433
|
props: {
|
|
2434
2434
|
modelValue: {
|
|
@@ -2470,7 +2470,7 @@ const Ra = {
|
|
|
2470
2470
|
},
|
|
2471
2471
|
emits: ["update:model-value"],
|
|
2472
2472
|
setup(e, { emit: n }) {
|
|
2473
|
-
const t = e, { t: o } =
|
|
2473
|
+
const t = e, { t: o } = ye(), a = n, i = E(() => ({
|
|
2474
2474
|
ALL: {
|
|
2475
2475
|
label: o("menu.order.from.options.all"),
|
|
2476
2476
|
value: Z.F_ORDER_FROM.enum.ALL
|
|
@@ -2523,7 +2523,7 @@ const Ra = {
|
|
|
2523
2523
|
}), $a = { class: "flex flex-col gap-4" }, Ua = { class: "fm-select__menu__wrapper" }, Na = { class: "fm-typo-en-body-lg-600 text-fm-color-primary" }, La = {
|
|
2524
2524
|
key: 0,
|
|
2525
2525
|
class: "flex flex-col gap-4 justify-center"
|
|
2526
|
-
}, Ba = /* @__PURE__ */
|
|
2526
|
+
}, Ba = /* @__PURE__ */ ge({
|
|
2527
2527
|
__name: "SubcategorySelector",
|
|
2528
2528
|
props: {
|
|
2529
2529
|
modelValue: {},
|
|
@@ -2541,30 +2541,30 @@ const Ra = {
|
|
|
2541
2541
|
dialog: a,
|
|
2542
2542
|
menuLoader: l,
|
|
2543
2543
|
isLocalOnly: t.isLocalOnly
|
|
2544
|
-
}), p = (g,
|
|
2545
|
-
g ? d.value = [...d.value,
|
|
2544
|
+
}), p = (g, k) => {
|
|
2545
|
+
g ? d.value = [...d.value, k] : d.value = d.value.filter((L) => L.value !== k.value), o(
|
|
2546
2546
|
"update:modelValue",
|
|
2547
2547
|
d.value.map((L) => L.value)
|
|
2548
2548
|
);
|
|
2549
2549
|
}, f = (g) => {
|
|
2550
|
-
d.value = d.value.filter((
|
|
2550
|
+
d.value = d.value.filter((k, L) => L !== g), o(
|
|
2551
2551
|
"update:modelValue",
|
|
2552
|
-
d.value.map((
|
|
2552
|
+
d.value.map((k) => k.value)
|
|
2553
2553
|
);
|
|
2554
2554
|
}, v = () => {
|
|
2555
2555
|
var g;
|
|
2556
2556
|
(g = u.value) == null || g.toggleMenu(!1), m.create();
|
|
2557
2557
|
}, A = E(() => t.items.reduce(
|
|
2558
|
-
(g,
|
|
2558
|
+
(g, k) => (g[k.value] = k, g),
|
|
2559
2559
|
{}
|
|
2560
2560
|
)), y = E(() => d.value.length > 0 ? d.value.map((g) => g.label).join("/") : t.placeholder), w = Y(!1);
|
|
2561
|
-
return
|
|
2561
|
+
return Te(
|
|
2562
2562
|
() => t.modelValue,
|
|
2563
2563
|
(g) => {
|
|
2564
|
-
g != null && g.length ? d.value = g.map((
|
|
2564
|
+
g != null && g.length ? d.value = g.map((k) => A.value[k]).filter((k) => !!k) : d.value = [];
|
|
2565
2565
|
},
|
|
2566
2566
|
{ immediate: !0 }
|
|
2567
|
-
), (g,
|
|
2567
|
+
), (g, k) => {
|
|
2568
2568
|
const L = D("FmIcon"), $ = D("FmField"), U = D("FmMenuItem"), T = D("FmMenu"), B = D("FmFormGroup"), M = D("FmChipGroup");
|
|
2569
2569
|
return C(), K("div", $a, [
|
|
2570
2570
|
h(B, {
|
|
@@ -2581,7 +2581,7 @@ const Ra = {
|
|
|
2581
2581
|
ref_key: "fmMenuRef",
|
|
2582
2582
|
ref: u,
|
|
2583
2583
|
"close-on-click": !1,
|
|
2584
|
-
onMenuChanged:
|
|
2584
|
+
onMenuChanged: k[1] || (k[1] = (_) => w.value = _)
|
|
2585
2585
|
}, {
|
|
2586
2586
|
"menu-button": V(() => [
|
|
2587
2587
|
h($, {
|
|
@@ -2608,18 +2608,18 @@ const Ra = {
|
|
|
2608
2608
|
]),
|
|
2609
2609
|
default: V(() => [
|
|
2610
2610
|
O("div", Ua, [
|
|
2611
|
-
(C(!0), K(me, null,
|
|
2611
|
+
(C(!0), K(me, null, ke(g.items, (_) => (C(), Q(U, {
|
|
2612
2612
|
key: _.value,
|
|
2613
2613
|
disabled: _.disabled,
|
|
2614
2614
|
"has-checkbox": !0,
|
|
2615
2615
|
label: _.label,
|
|
2616
|
-
"model-value": d.value.some((
|
|
2617
|
-
"onUpdate:modelValue": (
|
|
2616
|
+
"model-value": d.value.some((x) => x.value === _.value),
|
|
2617
|
+
"onUpdate:modelValue": (x) => p(x, _)
|
|
2618
2618
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue"]))), 128)),
|
|
2619
2619
|
O("button", {
|
|
2620
2620
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
2621
2621
|
type: "button",
|
|
2622
|
-
onClick:
|
|
2622
|
+
onClick: k[0] || (k[0] = (_) => v())
|
|
2623
2623
|
}, [
|
|
2624
2624
|
h(L, {
|
|
2625
2625
|
color: "primary",
|
|
@@ -2658,7 +2658,7 @@ const Ra = {
|
|
|
2658
2658
|
}, pr = {
|
|
2659
2659
|
key: 0,
|
|
2660
2660
|
class: "space-y-8"
|
|
2661
|
-
}, fr = { class: "flex w-[100px] items-center gap-8 pt-12" }, hr = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, vr = { class: "fm-typo-en-body-md-400" }, gr = { class: "flex-1" }, br = { class: "w-full flex gap-8 items-center justify-end" }, yr = /* @__PURE__ */
|
|
2661
|
+
}, fr = { class: "flex w-[100px] items-center gap-8 pt-12" }, hr = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, vr = { class: "fm-typo-en-body-md-400" }, gr = { class: "flex-1" }, br = { class: "w-full flex gap-8 items-center justify-end" }, yr = /* @__PURE__ */ ge({
|
|
2662
2662
|
__name: "ProductTranslationDialog",
|
|
2663
2663
|
props: {
|
|
2664
2664
|
modelValue: { type: Boolean },
|
|
@@ -2670,20 +2670,20 @@ const Ra = {
|
|
|
2670
2670
|
},
|
|
2671
2671
|
emits: ["update:modelValue", "update:name", "update:description", "update:nameLocale", "update:descriptionLocale"],
|
|
2672
2672
|
setup(e, { emit: n }) {
|
|
2673
|
-
const t = e, o = n, { t: a } =
|
|
2673
|
+
const t = e, o = n, { t: a } = ye(), { localeList: i } = Hn(), r = Y([]), l = Y([]), s = Y(""), u = Y(""), d = Y(""), m = Y(""), p = Y(!0), f = Y(!1);
|
|
2674
2674
|
function v() {
|
|
2675
2675
|
const M = t.productNameLocale || {}, R = t.productDescriptionLocale || {}, _ = /* @__PURE__ */ new Set([...Object.keys(M), ...Object.keys(R)]);
|
|
2676
|
-
return _.size === 0 ? [] : Array.from(_).map((
|
|
2677
|
-
const b = c(i).find((z) => z.code ===
|
|
2676
|
+
return _.size === 0 ? [] : Array.from(_).map((x) => {
|
|
2677
|
+
const b = c(i).find((z) => z.code === x);
|
|
2678
2678
|
return {
|
|
2679
|
-
localeCode:
|
|
2680
|
-
localeName: (b == null ? void 0 : b.name) ||
|
|
2681
|
-
nameValue: M[
|
|
2682
|
-
descriptionValue: R[
|
|
2679
|
+
localeCode: x,
|
|
2680
|
+
localeName: (b == null ? void 0 : b.name) || x,
|
|
2681
|
+
nameValue: M[x] || "",
|
|
2682
|
+
descriptionValue: R[x] || ""
|
|
2683
2683
|
};
|
|
2684
2684
|
});
|
|
2685
2685
|
}
|
|
2686
|
-
|
|
2686
|
+
Te(
|
|
2687
2687
|
() => [
|
|
2688
2688
|
t.modelValue,
|
|
2689
2689
|
t.productName,
|
|
@@ -2692,7 +2692,7 @@ const Ra = {
|
|
|
2692
2692
|
t.productDescriptionLocale
|
|
2693
2693
|
],
|
|
2694
2694
|
([M]) => {
|
|
2695
|
-
M && (r.value = v(), l.value =
|
|
2695
|
+
M && (r.value = v(), l.value = Re.clone(r.value), s.value = t.productName, u.value = t.productDescription || "", d.value = t.productName, m.value = t.productDescription || "", t.initialSection === "name" ? (p.value = !0, f.value = !1) : (p.value = !1, f.value = !0));
|
|
2696
2696
|
},
|
|
2697
2697
|
{ immediate: !0 }
|
|
2698
2698
|
);
|
|
@@ -2713,19 +2713,19 @@ const Ra = {
|
|
|
2713
2713
|
r.value = r.value.filter((R) => R.localeCode !== M);
|
|
2714
2714
|
}
|
|
2715
2715
|
function g() {
|
|
2716
|
-
const M = !
|
|
2716
|
+
const M = !Re.isEqual(r.value, l.value), R = s.value !== d.value, _ = u.value !== m.value;
|
|
2717
2717
|
return M || R || _;
|
|
2718
2718
|
}
|
|
2719
|
-
function
|
|
2719
|
+
function k() {
|
|
2720
2720
|
o("update:name", s.value.trim()), o("update:description", u.value.trim());
|
|
2721
2721
|
const M = r.value.filter((b) => b.nameValue.trim()), R = M.length === 0 ? void 0 : M.reduce(
|
|
2722
2722
|
(b, z) => (b[z.localeCode] = z.nameValue.trim(), b),
|
|
2723
2723
|
{}
|
|
2724
|
-
), _ = r.value.filter((b) => b.descriptionValue.trim()),
|
|
2724
|
+
), _ = r.value.filter((b) => b.descriptionValue.trim()), x = _.length === 0 ? void 0 : _.reduce(
|
|
2725
2725
|
(b, z) => (b[z.localeCode] = z.descriptionValue.trim(), b),
|
|
2726
2726
|
{}
|
|
2727
2727
|
);
|
|
2728
|
-
o("update:nameLocale", R), o("update:descriptionLocale",
|
|
2728
|
+
o("update:nameLocale", R), o("update:descriptionLocale", x), o("update:modelValue", !1);
|
|
2729
2729
|
}
|
|
2730
2730
|
function L() {
|
|
2731
2731
|
o("update:modelValue", !1);
|
|
@@ -2741,7 +2741,7 @@ const Ra = {
|
|
|
2741
2741
|
f.value = !f.value;
|
|
2742
2742
|
}
|
|
2743
2743
|
return (M, R) => {
|
|
2744
|
-
const _ = D("FmIcon"),
|
|
2744
|
+
const _ = D("FmIcon"), x = D("fm-button"), b = D("FmMenu"), z = D("fm-text-field"), q = D("fm-textarea"), N = D("fm-dialog");
|
|
2745
2745
|
return C(), Q(N, {
|
|
2746
2746
|
modelValue: U.value,
|
|
2747
2747
|
"onUpdate:modelValue": R[2] || (R[2] = (S) => U.value = S),
|
|
@@ -2753,17 +2753,17 @@ const Ra = {
|
|
|
2753
2753
|
]),
|
|
2754
2754
|
"dialog-footer": V(() => [
|
|
2755
2755
|
O("div", br, [
|
|
2756
|
-
h(
|
|
2756
|
+
h(x, {
|
|
2757
2757
|
label: c(a)("menu.common.actions.cancel"),
|
|
2758
2758
|
size: "lg",
|
|
2759
2759
|
variant: "tertiary",
|
|
2760
2760
|
onClick: c($)
|
|
2761
2761
|
}, null, 8, ["label", "onClick"]),
|
|
2762
|
-
h(
|
|
2762
|
+
h(x, {
|
|
2763
2763
|
label: c(a)("menu.common.actions.save"),
|
|
2764
2764
|
size: "lg",
|
|
2765
2765
|
variant: "primary",
|
|
2766
|
-
onClick:
|
|
2766
|
+
onClick: k
|
|
2767
2767
|
}, null, 8, ["label"])
|
|
2768
2768
|
])
|
|
2769
2769
|
]),
|
|
@@ -2772,7 +2772,7 @@ const Ra = {
|
|
|
2772
2772
|
O("div", Wa, [
|
|
2773
2773
|
O("p", Ya, ie(c(a)("menu.product.translation.language")), 1),
|
|
2774
2774
|
O("div", Ha, [
|
|
2775
|
-
(C(!0), K(me, null,
|
|
2775
|
+
(C(!0), K(me, null, ke(r.value, (S) => (C(), K("div", {
|
|
2776
2776
|
key: S.localeCode,
|
|
2777
2777
|
class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
|
|
2778
2778
|
}, [
|
|
@@ -2787,7 +2787,7 @@ const Ra = {
|
|
|
2787
2787
|
]))), 128)),
|
|
2788
2788
|
A.value.length > 0 ? (C(), Q(b, { key: 0 }, {
|
|
2789
2789
|
"menu-button": V(() => [
|
|
2790
|
-
h(
|
|
2790
|
+
h(x, {
|
|
2791
2791
|
variant: "secondary",
|
|
2792
2792
|
"border-color": "neutral-gray-300",
|
|
2793
2793
|
"text-color": "neutral-gray-400",
|
|
@@ -2795,7 +2795,7 @@ const Ra = {
|
|
|
2795
2795
|
})
|
|
2796
2796
|
]),
|
|
2797
2797
|
default: V(() => [
|
|
2798
|
-
(C(!0), K(me, null,
|
|
2798
|
+
(C(!0), K(me, null, ke(A.value, (S) => (C(), K("div", {
|
|
2799
2799
|
class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
|
|
2800
2800
|
key: S.code,
|
|
2801
2801
|
onClick: (G) => y(S.code)
|
|
@@ -2832,7 +2832,7 @@ const Ra = {
|
|
|
2832
2832
|
h(Lt, {
|
|
2833
2833
|
label: c(a)("menu.product.translation.translation")
|
|
2834
2834
|
}, null, 8, ["label"]),
|
|
2835
|
-
(C(!0), K(me, null,
|
|
2835
|
+
(C(!0), K(me, null, ke(r.value, (S) => (C(), K("div", {
|
|
2836
2836
|
key: S.localeCode,
|
|
2837
2837
|
class: "flex items-center gap-16"
|
|
2838
2838
|
}, [
|
|
@@ -2877,7 +2877,7 @@ const Ra = {
|
|
|
2877
2877
|
h(Lt, {
|
|
2878
2878
|
label: c(a)("menu.product.translation.translation")
|
|
2879
2879
|
}, null, 8, ["label"]),
|
|
2880
|
-
(C(!0), K(me, null,
|
|
2880
|
+
(C(!0), K(me, null, ke(r.value, (S) => (C(), K("div", {
|
|
2881
2881
|
key: S.localeCode,
|
|
2882
2882
|
class: "flex items-start gap-16"
|
|
2883
2883
|
}, [
|
|
@@ -2903,7 +2903,7 @@ const Ra = {
|
|
|
2903
2903
|
};
|
|
2904
2904
|
}
|
|
2905
2905
|
});
|
|
2906
|
-
var Ln = { firebase: { storageBucket: "image.
|
|
2906
|
+
var Ln = { firebase: { storageBucket: "image.feedmedev.cc" } };
|
|
2907
2907
|
const _r = {
|
|
2908
2908
|
class: "fm-typo-en-title-md-600"
|
|
2909
2909
|
}, wr = {
|
|
@@ -2922,7 +2922,7 @@ const _r = {
|
|
|
2922
2922
|
class: "flex-1 overflow-hidden min-h-[300px]"
|
|
2923
2923
|
}, Rr = {
|
|
2924
2924
|
class: "flex gap-8 items-center justify-start"
|
|
2925
|
-
}, Ar = /* @__PURE__ */
|
|
2925
|
+
}, Ar = /* @__PURE__ */ ge({
|
|
2926
2926
|
__name: "Form",
|
|
2927
2927
|
props: {
|
|
2928
2928
|
initialValue: {},
|
|
@@ -2933,13 +2933,13 @@ const _r = {
|
|
|
2933
2933
|
setup(e, {
|
|
2934
2934
|
expose: n
|
|
2935
2935
|
}) {
|
|
2936
|
-
const t = e, o = Ke(), a = nt(o), i = ot(a), r =
|
|
2936
|
+
const t = e, o = Ke(), a = nt(o), i = ot(a), r = Ae(), l = Ht(), {
|
|
2937
2937
|
categories: s
|
|
2938
2938
|
} = ui(), {
|
|
2939
2939
|
t: u
|
|
2940
|
-
} =
|
|
2940
|
+
} = ye(), d = Y(!1), m = Y(!1), p = Y(!1), f = Y(void 0), v = Y(null), A = (S) => {
|
|
2941
2941
|
wt.isBoolean(S) ? m.value = S : m.value = !m.value;
|
|
2942
|
-
}, y = E(() => t.initialValue.name === "Addon"), w = Y(sn(t.initialValue)), g = E(() => !w.value.id && !y.value),
|
|
2942
|
+
}, y = E(() => t.initialValue.name === "Addon"), w = Y(sn(t.initialValue)), g = E(() => !w.value.id && !y.value), k = Y(""), L = E(() => {
|
|
2943
2943
|
var oe;
|
|
2944
2944
|
if (!w.value.id && !y.value)
|
|
2945
2945
|
return [];
|
|
@@ -2987,18 +2987,18 @@ const _r = {
|
|
|
2987
2987
|
const G = Go(S, w.value.id);
|
|
2988
2988
|
await l.updateMany(G);
|
|
2989
2989
|
}
|
|
2990
|
-
const R = E(() => [li]), _ = E(() => !!w.value.name),
|
|
2990
|
+
const R = E(() => [li]), _ = E(() => !!w.value.name), x = E(() => {
|
|
2991
2991
|
var te;
|
|
2992
2992
|
const S = [], G = "en-US", oe = (te = f.value) == null ? void 0 : te[G];
|
|
2993
2993
|
return w.value.name && !oe && S.push({
|
|
2994
2994
|
locale: G,
|
|
2995
2995
|
name: w.value.name,
|
|
2996
2996
|
localeDisplay: Pe(G)
|
|
2997
|
-
}), f.value && Object.entries(f.value).filter(([
|
|
2997
|
+
}), f.value && Object.entries(f.value).filter(([be, I]) => I && I.trim()).sort(([be], [I]) => be.localeCompare(I)).forEach(([be, I]) => {
|
|
2998
2998
|
S.push({
|
|
2999
|
-
locale:
|
|
2999
|
+
locale: be,
|
|
3000
3000
|
name: I,
|
|
3001
|
-
localeDisplay: Pe(
|
|
3001
|
+
localeDisplay: Pe(be)
|
|
3002
3002
|
});
|
|
3003
3003
|
}), S;
|
|
3004
3004
|
});
|
|
@@ -3011,8 +3011,8 @@ const _r = {
|
|
|
3011
3011
|
const q = _t(() => {
|
|
3012
3012
|
if (g.value)
|
|
3013
3013
|
return !!w.value.name || !!(f.value && Object.keys(f.value).length > 0);
|
|
3014
|
-
const S = r.categories.find((F) => F._id === w.value.id), G = w.value.name !== (S == null ? void 0 : S.name), oe = (S == null ? void 0 : S.name_locale) || {}, te = f.value || {},
|
|
3015
|
-
return G ||
|
|
3014
|
+
const S = r.categories.find((F) => F._id === w.value.id), G = w.value.name !== (S == null ? void 0 : S.name), oe = (S == null ? void 0 : S.name_locale) || {}, te = f.value || {}, be = JSON.stringify(oe) !== JSON.stringify(te), I = !!v.value || v.value === null && !!(S != null && S.thumbnail);
|
|
3015
|
+
return G || be || I;
|
|
3016
3016
|
}, () => {
|
|
3017
3017
|
m.value = !1;
|
|
3018
3018
|
});
|
|
@@ -3034,7 +3034,7 @@ const _r = {
|
|
|
3034
3034
|
...f.value && {
|
|
3035
3035
|
name_locale: f.value
|
|
3036
3036
|
},
|
|
3037
|
-
position:
|
|
3037
|
+
position: Ae().categories.length,
|
|
3038
3038
|
...G && {
|
|
3039
3039
|
thumbnail: G
|
|
3040
3040
|
}
|
|
@@ -3062,9 +3062,9 @@ const _r = {
|
|
|
3062
3062
|
}
|
|
3063
3063
|
A(!1);
|
|
3064
3064
|
}
|
|
3065
|
-
return
|
|
3066
|
-
var
|
|
3067
|
-
if (!S && G && ((
|
|
3065
|
+
return Te(() => m.value, (S, G) => {
|
|
3066
|
+
var be;
|
|
3067
|
+
if (!S && G && ((be = t.onClosed) == null || be.call(t)), !S) return;
|
|
3068
3068
|
w.value = sn(t.initialValue);
|
|
3069
3069
|
const oe = r.categories.find((I) => I._id === w.value.id);
|
|
3070
3070
|
f.value = oe == null ? void 0 : oe.name_locale;
|
|
@@ -3076,8 +3076,8 @@ const _r = {
|
|
|
3076
3076
|
trigger: A,
|
|
3077
3077
|
show: m
|
|
3078
3078
|
}), (S, G) => {
|
|
3079
|
-
const oe = D("fm-button"), te = D("FmTooltip"),
|
|
3080
|
-
return C(), K(me, null, [
|
|
3079
|
+
const oe = D("fm-button"), te = D("FmTooltip"), be = D("FmTextField"), I = D("FmButton"), F = D("FmSearch"), j = D("FmTable"), J = D("fm-side-sheet");
|
|
3080
|
+
return C(), K(me, null, [Ce(S.$slots, "default", {
|
|
3081
3081
|
trigger: A
|
|
3082
3082
|
}), h(J, {
|
|
3083
3083
|
id: "group-form",
|
|
@@ -3107,7 +3107,7 @@ const _r = {
|
|
|
3107
3107
|
default: V(() => [O("div", wr, [h(Le, {
|
|
3108
3108
|
title: c(u)("menu.category.detail")
|
|
3109
3109
|
}, {
|
|
3110
|
-
default: V(() => [h(
|
|
3110
|
+
default: V(() => [h(be, {
|
|
3111
3111
|
modelValue: w.value.name,
|
|
3112
3112
|
"onUpdate:modelValue": G[1] || (G[1] = (W) => w.value.name = W),
|
|
3113
3113
|
label: c(u)("menu.category.name"),
|
|
@@ -3119,7 +3119,7 @@ const _r = {
|
|
|
3119
3119
|
placement: "top",
|
|
3120
3120
|
"z-index": 999
|
|
3121
3121
|
}, {
|
|
3122
|
-
content: V(() => [O("div", kr, [(C(!0), K(me, null,
|
|
3122
|
+
content: V(() => [O("div", kr, [(C(!0), K(me, null, ke(x.value, (W) => (C(), K("div", {
|
|
3123
3123
|
key: W.locale
|
|
3124
3124
|
}, ie(W.name) + " (" + ie(W.localeDisplay) + ") ", 1))), 128))])]),
|
|
3125
3125
|
default: V(() => [h(oe, {
|
|
@@ -3173,14 +3173,14 @@ const _r = {
|
|
|
3173
3173
|
count: L.value.length
|
|
3174
3174
|
})), 1), O("div", Fr, [h(F, {
|
|
3175
3175
|
placeholder: c(u)("menu.common.actions.search"),
|
|
3176
|
-
modelValue:
|
|
3177
|
-
"onUpdate:modelValue": G[4] || (G[4] = (W) =>
|
|
3176
|
+
modelValue: k.value,
|
|
3177
|
+
"onUpdate:modelValue": G[4] || (G[4] = (W) => k.value = W)
|
|
3178
3178
|
}, null, 8, ["placeholder", "modelValue"])])]), O("div", Or, [h(j, {
|
|
3179
3179
|
"column-defs": $,
|
|
3180
3180
|
draggable: B.value && !g.value,
|
|
3181
3181
|
"page-size": L.value.length,
|
|
3182
3182
|
"row-data": L.value,
|
|
3183
|
-
"search-value":
|
|
3183
|
+
"search-value": k.value,
|
|
3184
3184
|
"shrink-at": !1,
|
|
3185
3185
|
"hide-footer": "",
|
|
3186
3186
|
"pin-header-row": "",
|
|
@@ -3201,15 +3201,15 @@ const _r = {
|
|
|
3201
3201
|
}, null, 8, ["modelValue", "title", "name", "name-locale"])], 64);
|
|
3202
3202
|
};
|
|
3203
3203
|
}
|
|
3204
|
-
}), Mr = /* @__PURE__ */
|
|
3204
|
+
}), Mr = /* @__PURE__ */ ge({
|
|
3205
3205
|
__name: "AddCategoryDialogContentComponent",
|
|
3206
3206
|
props: {
|
|
3207
3207
|
initialValue: {},
|
|
3208
3208
|
initialNameLocale: {}
|
|
3209
3209
|
},
|
|
3210
3210
|
setup(e) {
|
|
3211
|
-
const n = e, { t } =
|
|
3212
|
-
|
|
3211
|
+
const n = e, { t } = ye(), o = Y(!1), a = Y(n.initialValue || ""), i = Y(n.initialNameLocale);
|
|
3212
|
+
Te(
|
|
3213
3213
|
() => [n.initialValue, n.initialNameLocale],
|
|
3214
3214
|
([v, A]) => {
|
|
3215
3215
|
a.value = v ?? "", i.value = A;
|
|
@@ -3240,7 +3240,7 @@ const _r = {
|
|
|
3240
3240
|
default: V(() => [
|
|
3241
3241
|
h(w, {
|
|
3242
3242
|
modelValue: a.value,
|
|
3243
|
-
"onUpdate:modelValue": A[1] || (A[1] = (
|
|
3243
|
+
"onUpdate:modelValue": A[1] || (A[1] = (k) => a.value = k),
|
|
3244
3244
|
rules: s.value,
|
|
3245
3245
|
autofocus: "",
|
|
3246
3246
|
label: c(t)("menu.category.dialog.add.name.label"),
|
|
@@ -3250,7 +3250,7 @@ const _r = {
|
|
|
3250
3250
|
h(y, {
|
|
3251
3251
|
variant: "tertiary",
|
|
3252
3252
|
icon: "g_translate",
|
|
3253
|
-
onClick: A[0] || (A[0] = (
|
|
3253
|
+
onClick: A[0] || (A[0] = (k) => o.value = !0),
|
|
3254
3254
|
disabled: !u.value
|
|
3255
3255
|
}, null, 8, ["disabled"])
|
|
3256
3256
|
]),
|
|
@@ -3261,7 +3261,7 @@ const _r = {
|
|
|
3261
3261
|
}),
|
|
3262
3262
|
h(yn, {
|
|
3263
3263
|
modelValue: o.value,
|
|
3264
|
-
"onUpdate:modelValue": A[2] || (A[2] = (
|
|
3264
|
+
"onUpdate:modelValue": A[2] || (A[2] = (k) => o.value = k),
|
|
3265
3265
|
title: c(t)("menu.category.title"),
|
|
3266
3266
|
name: a.value,
|
|
3267
3267
|
"name-locale": i.value,
|
|
@@ -3275,7 +3275,7 @@ const _r = {
|
|
|
3275
3275
|
dialog: e,
|
|
3276
3276
|
menuLoader: n
|
|
3277
3277
|
}) => {
|
|
3278
|
-
const { t } =
|
|
3278
|
+
const { t } = ye(), o = vn();
|
|
3279
3279
|
function a() {
|
|
3280
3280
|
var d, m, p;
|
|
3281
3281
|
if (!o) throw new Error("No current instance found");
|
|
@@ -3410,7 +3410,7 @@ const Tr = {
|
|
|
3410
3410
|
var lt = /* @__PURE__ */ function(e) {
|
|
3411
3411
|
return e.ADD_ON = "ADD_ON", e.PRODUCT = "PRODUCT", e;
|
|
3412
3412
|
}(lt || {});
|
|
3413
|
-
const Hr = /* @__PURE__ */
|
|
3413
|
+
const Hr = /* @__PURE__ */ ge({
|
|
3414
3414
|
__name: "ProductDetail",
|
|
3415
3415
|
props: {
|
|
3416
3416
|
isOverride: {
|
|
@@ -3430,7 +3430,7 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3430
3430
|
setup(e, {
|
|
3431
3431
|
emit: n
|
|
3432
3432
|
}) {
|
|
3433
|
-
const t = e, o =
|
|
3433
|
+
const t = e, o = Ae(), a = Ot(), i = Ze(), r = Ke(), l = nt(r), s = ot(l), u = Er({
|
|
3434
3434
|
dialog: i,
|
|
3435
3435
|
menuLoader: s
|
|
3436
3436
|
}), {
|
|
@@ -3441,15 +3441,15 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3441
3441
|
value: H.id
|
|
3442
3442
|
}));
|
|
3443
3443
|
return t.isAddon ? P : P.filter((H) => !!H.value);
|
|
3444
|
-
}), A = E(() => p.value.addon), y = E(() => !v.value.find((P) => !!P.value)), w = E(() => Ko(t.form.category ? t.form : t.fallback) || []), g = E(() => w.value.reduce((P, H) => (P[H._id] = H, P), {})),
|
|
3444
|
+
}), A = E(() => p.value.addon), y = E(() => !v.value.find((P) => !!P.value)), w = E(() => Ko(t.form.category ? t.form : t.fallback) || []), g = E(() => w.value.reduce((P, H) => (P[H._id] = H, P), {})), k = E({
|
|
3445
3445
|
get() {
|
|
3446
3446
|
return w.value.map((P) => P._id);
|
|
3447
3447
|
},
|
|
3448
3448
|
set(P = []) {
|
|
3449
|
-
const [H, ...le] = P.map((
|
|
3450
|
-
const
|
|
3451
|
-
return
|
|
3452
|
-
_id:
|
|
3449
|
+
const [H, ...le] = P.map((Me) => {
|
|
3450
|
+
const xe = g.value[Me];
|
|
3451
|
+
return xe || {
|
|
3452
|
+
_id: Me,
|
|
3453
3453
|
position: null
|
|
3454
3454
|
};
|
|
3455
3455
|
});
|
|
@@ -3465,8 +3465,8 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3465
3465
|
ref: L,
|
|
3466
3466
|
disabled: !p.value.category || t.isAddon || d(),
|
|
3467
3467
|
items: v.value,
|
|
3468
|
-
modelValue:
|
|
3469
|
-
"onUpdate:model-value": (H) =>
|
|
3468
|
+
modelValue: k.value,
|
|
3469
|
+
"onUpdate:model-value": (H) => k.value = H,
|
|
3470
3470
|
placeholder: S("menu.product.form.detail.category.placeholder"),
|
|
3471
3471
|
multiple: P
|
|
3472
3472
|
}, {
|
|
@@ -3493,21 +3493,21 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3493
3493
|
const P = t.form.name || ((H = t.fallback) == null ? void 0 : H.name);
|
|
3494
3494
|
return P ? o.items.filter((le) => !!le.category && le._id !== t.form._id && le.name === P).length : 0;
|
|
3495
3495
|
}), T = E(() => {
|
|
3496
|
-
var
|
|
3496
|
+
var Me, xe, Oe;
|
|
3497
3497
|
if (!o.state.featureFlags.uniqueProductCode) return 0;
|
|
3498
|
-
const P = t.form.code || ((
|
|
3498
|
+
const P = t.form.code || ((Me = t.fallback) == null ? void 0 : Me.code);
|
|
3499
3499
|
if (!P) return 0;
|
|
3500
3500
|
let H = o.itemCodeMap.get(P) || 0;
|
|
3501
|
-
const le = o.items.find((
|
|
3502
|
-
return (le == null ? void 0 : le.code) === P && (H -= 1), (
|
|
3503
|
-
|
|
3501
|
+
const le = o.items.find((pe) => pe._id === t.form._id);
|
|
3502
|
+
return (le == null ? void 0 : le.code) === P && (H -= 1), (Oe = (xe = le == null ? void 0 : le.variant) == null ? void 0 : xe.variantCombinations) == null || Oe.forEach((pe) => {
|
|
3503
|
+
pe.code === P && (H -= 1);
|
|
3504
3504
|
}), H;
|
|
3505
3505
|
}), B = E(() => t.isAddon ? lt.ADD_ON : lt.PRODUCT);
|
|
3506
3506
|
function M(P) {
|
|
3507
|
-
var le,
|
|
3507
|
+
var le, Me, xe;
|
|
3508
3508
|
if (B.value === P) return;
|
|
3509
3509
|
const H = P == lt.ADD_ON;
|
|
3510
|
-
m("update:form", "category", t.isOverride ? H ? "" : ((le = t.fallback) == null ? void 0 : le.category) ?? ((
|
|
3510
|
+
m("update:form", "category", t.isOverride ? H ? "" : ((le = t.fallback) == null ? void 0 : le.category) ?? ((Me = v.value.find((Oe) => !!Oe.value)) == null ? void 0 : Me.value) : H ? null : (xe = v.value.find((Oe) => !!Oe.value)) == null ? void 0 : xe.value), H && (m("update:form", "additionalCategories", []), m("update:form", "subCategories", []));
|
|
3511
3511
|
}
|
|
3512
3512
|
const R = bn();
|
|
3513
3513
|
Cn("apply-description", (P) => {
|
|
@@ -3529,7 +3529,7 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3529
3529
|
command: "suggestDescription"
|
|
3530
3530
|
});
|
|
3531
3531
|
}
|
|
3532
|
-
const
|
|
3532
|
+
const x = E(() => o.subcategories), b = E(() => x.value.map((P) => ({
|
|
3533
3533
|
label: P.name,
|
|
3534
3534
|
value: P._id
|
|
3535
3535
|
}))), z = E({
|
|
@@ -3545,32 +3545,32 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3545
3545
|
}
|
|
3546
3546
|
const {
|
|
3547
3547
|
t: S
|
|
3548
|
-
} =
|
|
3549
|
-
var
|
|
3550
|
-
const P = [], H = "en-US", le = t.form.name_locale,
|
|
3551
|
-
return (t.form.name || (
|
|
3548
|
+
} = ye(), G = Y(!1), oe = Y("name"), te = E(() => {
|
|
3549
|
+
var xe, Oe;
|
|
3550
|
+
const P = [], H = "en-US", le = t.form.name_locale, Me = le == null ? void 0 : le[H];
|
|
3551
|
+
return (t.form.name || (xe = t.fallback) != null && xe.name) && !Me && P.push({
|
|
3552
3552
|
locale: H,
|
|
3553
|
-
name: t.form.name || ((
|
|
3553
|
+
name: t.form.name || ((Oe = t.fallback) == null ? void 0 : Oe.name) || "",
|
|
3554
3554
|
localeDisplay: Pe(H)
|
|
3555
|
-
}), le && Object.entries(le).filter(([
|
|
3555
|
+
}), le && Object.entries(le).filter(([pe, de]) => de && de.trim()).sort(([pe], [de]) => pe.localeCompare(de)).forEach(([pe, de]) => {
|
|
3556
3556
|
P.push({
|
|
3557
|
-
locale:
|
|
3558
|
-
name:
|
|
3559
|
-
localeDisplay: Pe(
|
|
3557
|
+
locale: pe,
|
|
3558
|
+
name: de,
|
|
3559
|
+
localeDisplay: Pe(pe)
|
|
3560
3560
|
});
|
|
3561
3561
|
}), P;
|
|
3562
|
-
}),
|
|
3563
|
-
var
|
|
3564
|
-
const P = [], H = "en-US", le = t.form.description_locale,
|
|
3565
|
-
return (t.form.description || (
|
|
3562
|
+
}), be = E(() => {
|
|
3563
|
+
var xe, Oe;
|
|
3564
|
+
const P = [], H = "en-US", le = t.form.description_locale, Me = le == null ? void 0 : le[H];
|
|
3565
|
+
return (t.form.description || (xe = t.fallback) != null && xe.description) && !Me && P.push({
|
|
3566
3566
|
locale: H,
|
|
3567
|
-
name: t.form.description || ((
|
|
3567
|
+
name: t.form.description || ((Oe = t.fallback) == null ? void 0 : Oe.description) || "",
|
|
3568
3568
|
localeDisplay: Pe(H)
|
|
3569
|
-
}), le && Object.entries(le).filter(([
|
|
3569
|
+
}), le && Object.entries(le).filter(([pe, de]) => de && de.trim()).sort(([pe], [de]) => pe.localeCompare(de)).forEach(([pe, de]) => {
|
|
3570
3570
|
P.push({
|
|
3571
|
-
locale:
|
|
3572
|
-
name:
|
|
3573
|
-
localeDisplay: Pe(
|
|
3571
|
+
locale: pe,
|
|
3572
|
+
name: de,
|
|
3573
|
+
localeDisplay: Pe(pe)
|
|
3574
3574
|
});
|
|
3575
3575
|
}), P;
|
|
3576
3576
|
});
|
|
@@ -3592,13 +3592,13 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3592
3592
|
function se(P) {
|
|
3593
3593
|
m("update:form", "description_locale", P);
|
|
3594
3594
|
}
|
|
3595
|
-
const
|
|
3595
|
+
const ce = E(() => {
|
|
3596
3596
|
var P;
|
|
3597
3597
|
return !!t.form.name || !!((P = t.fallback) != null && P.name);
|
|
3598
3598
|
});
|
|
3599
3599
|
return (P, H) => {
|
|
3600
3600
|
var ae, kt;
|
|
3601
|
-
const le = D("fm-text-field"),
|
|
3601
|
+
const le = D("fm-text-field"), Me = D("fm-button"), xe = D("FmTooltip"), Oe = D("fm-textarea"), pe = D("fm-radio"), de = D("FmSnackbar"), Rt = D("FmButton"), ee = D("fm-radio-group"), X = D("FmFormGroup"), _e = D("FmStepperField"), we = Kn("tooltip");
|
|
3602
3602
|
return C(), K(me, null, [h(Le, {
|
|
3603
3603
|
title: c(S)("menu.product.form.detail.title")
|
|
3604
3604
|
}, {
|
|
@@ -3608,10 +3608,10 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3608
3608
|
"model-value": P.form.code,
|
|
3609
3609
|
placeholder: ((rt = P.fallback) == null ? void 0 : rt.code) || c(S)("menu.product.form.detail.fields.code.placeholder"),
|
|
3610
3610
|
label: c(S)("menu.product.form.detail.fields.code.label"),
|
|
3611
|
-
rules: [(
|
|
3611
|
+
rules: [(ue) => T.value === 0 || c(S)("menu.product.form.detail.fields.code.duplicate_warning", {
|
|
3612
3612
|
count: T.value
|
|
3613
3613
|
})],
|
|
3614
|
-
"onUpdate:modelValue": H[0] || (H[0] = (
|
|
3614
|
+
"onUpdate:modelValue": H[0] || (H[0] = (ue) => m("update:form", "code", c(Fo)(ue, P.isOverride)))
|
|
3615
3615
|
}, null, 8, ["model-value", "placeholder", "label", "rules"])]), O("div", Dr, [h(le, {
|
|
3616
3616
|
id: "product-name",
|
|
3617
3617
|
disabled: !p.value.name,
|
|
@@ -3620,63 +3620,63 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3620
3620
|
}) : void 0,
|
|
3621
3621
|
"model-value": P.form.name,
|
|
3622
3622
|
placeholder: (xt = P.fallback) == null ? void 0 : xt.name,
|
|
3623
|
-
rules: p.value.name ? [(
|
|
3623
|
+
rules: p.value.name ? [(ue) => !!ue || c(S)("menu.product.form.detail.fields.name.required")] : void 0,
|
|
3624
3624
|
"label-mark": "required",
|
|
3625
3625
|
autofocus: "",
|
|
3626
3626
|
label: c(S)("menu.product.form.detail.fields.name.label"),
|
|
3627
|
-
"onUpdate:modelValue": H[1] || (H[1] = (
|
|
3627
|
+
"onUpdate:modelValue": H[1] || (H[1] = (ue) => m("update:form", "name", ue))
|
|
3628
3628
|
}, {
|
|
3629
|
-
append: V(() => [h(
|
|
3629
|
+
append: V(() => [h(xe, {
|
|
3630
3630
|
variant: "plain",
|
|
3631
3631
|
placement: "top",
|
|
3632
3632
|
"z-index": 999
|
|
3633
3633
|
}, {
|
|
3634
|
-
content: V(() => [O("div", Pr, [(C(!0), K(me, null,
|
|
3635
|
-
key:
|
|
3636
|
-
}, ie(
|
|
3637
|
-
default: V(() => [h(
|
|
3634
|
+
content: V(() => [O("div", Pr, [(C(!0), K(me, null, ke(te.value, (ue) => (C(), K("div", {
|
|
3635
|
+
key: ue.locale
|
|
3636
|
+
}, ie(ue.name) + " (" + ie(ue.localeDisplay) + ") ", 1))), 128))])]),
|
|
3637
|
+
default: V(() => [h(Me, {
|
|
3638
3638
|
variant: "tertiary",
|
|
3639
3639
|
icon: "g_translate",
|
|
3640
3640
|
onClick: I,
|
|
3641
|
-
disabled: !
|
|
3641
|
+
disabled: !ce.value
|
|
3642
3642
|
}, null, 8, ["disabled"])]),
|
|
3643
3643
|
_: 1
|
|
3644
3644
|
})]),
|
|
3645
3645
|
_: 1
|
|
3646
|
-
}, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), O("div", $r, [h(
|
|
3646
|
+
}, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), O("div", $r, [h(Oe, {
|
|
3647
3647
|
disabled: !p.value.description,
|
|
3648
3648
|
"model-value": P.form.description || void 0,
|
|
3649
3649
|
placeholder: c(S)("menu.product.form.detail.fields.description.placeholder"),
|
|
3650
|
-
"onUpdate:modelValue": H[2] || (H[2] = (
|
|
3650
|
+
"onUpdate:modelValue": H[2] || (H[2] = (ue) => m("update:form", "description", ue.trim())),
|
|
3651
3651
|
class: "description"
|
|
3652
3652
|
}, {
|
|
3653
3653
|
label: V(() => [O("p", Ur, [Pt(ie(c(S)("menu.product.form.detail.fields.description.label")) + " ", 1), O("span", Nr, ie(c(S)("menu.product.form.detail.fields.description.optional")), 1)])]),
|
|
3654
3654
|
_: 1
|
|
3655
|
-
}, 8, ["disabled", "model-value", "placeholder"]), O("div", Lr, [h(
|
|
3655
|
+
}, 8, ["disabled", "model-value", "placeholder"]), O("div", Lr, [h(xe, {
|
|
3656
3656
|
variant: "plain",
|
|
3657
3657
|
placement: "top",
|
|
3658
3658
|
"z-index": 999
|
|
3659
3659
|
}, {
|
|
3660
|
-
content: V(() => [O("div", Br, [(C(!0), K(me, null,
|
|
3661
|
-
key:
|
|
3662
|
-
}, ie(
|
|
3663
|
-
default: V(() => [ct(h(
|
|
3660
|
+
content: V(() => [O("div", Br, [(C(!0), K(me, null, ke(be.value, (ue) => (C(), K("div", {
|
|
3661
|
+
key: ue.locale
|
|
3662
|
+
}, ie(ue.name) + " (" + ie(ue.localeDisplay) + ") ", 1))), 128))])]),
|
|
3663
|
+
default: V(() => [ct(h(Me, {
|
|
3664
3664
|
variant: "tertiary",
|
|
3665
3665
|
icon: "g_translate",
|
|
3666
3666
|
class: "cursor-pointer",
|
|
3667
3667
|
onClick: F
|
|
3668
|
-
}, null, 512), [[
|
|
3668
|
+
}, null, 512), [[we, c(an)("Translate description")]])]),
|
|
3669
3669
|
_: 1
|
|
3670
3670
|
}), ct(h(c(Jn), {
|
|
3671
3671
|
class: "cursor-pointer",
|
|
3672
3672
|
onClick: _
|
|
3673
|
-
}, null, 512), [[
|
|
3673
|
+
}, null, 512), [[we, c(an)("Suggest description")]])])])]), h(So, {
|
|
3674
3674
|
disabled: !p.value.thumbnail,
|
|
3675
3675
|
title: c(S)("menu.common.labels.product_image"),
|
|
3676
3676
|
"model-value": P.thumbnail,
|
|
3677
|
-
"onUpdate:modelValue": H[3] || (H[3] = (
|
|
3678
|
-
"onReset:modelValue": H[4] || (H[4] = (
|
|
3679
|
-
"onUpdate:trackingId": H[5] || (H[5] = (
|
|
3677
|
+
"onUpdate:modelValue": H[3] || (H[3] = (ue) => m("update:thumbnail", ue)),
|
|
3678
|
+
"onReset:modelValue": H[4] || (H[4] = (ue) => m("reset:thumbnail")),
|
|
3679
|
+
"onUpdate:trackingId": H[5] || (H[5] = (ue) => m("update:form", "_thumbnailTrackingId", ue))
|
|
3680
3680
|
}, null, 8, ["disabled", "title", "model-value"])]), h(it, {
|
|
3681
3681
|
label: c(o).isV4 ? c(S)("menu.product.form.detail.category.label") : c(S)("menu.product.form.detail.category.label_singular")
|
|
3682
3682
|
}, {
|
|
@@ -3684,9 +3684,9 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3684
3684
|
key: 0,
|
|
3685
3685
|
disabled: !p.value.category,
|
|
3686
3686
|
"model-value": B.value,
|
|
3687
|
-
"onUpdate:modelValue": H[6] || (H[6] = (
|
|
3687
|
+
"onUpdate:modelValue": H[6] || (H[6] = (ue) => M(ue))
|
|
3688
3688
|
}, {
|
|
3689
|
-
default: V(() => [O("div", jr, [O("div", Gr, [h(
|
|
3689
|
+
default: V(() => [O("div", jr, [O("div", Gr, [h(pe, {
|
|
3690
3690
|
disabled: y.value || !p.value.category,
|
|
3691
3691
|
value: lt.PRODUCT,
|
|
3692
3692
|
label: c(S)("menu.product.form.detail.category.options.product.label"),
|
|
@@ -3696,7 +3696,7 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3696
3696
|
key: 0
|
|
3697
3697
|
})) : ne("", !0)]),
|
|
3698
3698
|
_: 1
|
|
3699
|
-
})]), y.value ? (C(), K("div", Kr, [h(
|
|
3699
|
+
})]), y.value ? (C(), K("div", Kr, [h(de, {
|
|
3700
3700
|
title: c(S)("menu.product.form.detail.category.add_first"),
|
|
3701
3701
|
variant: "info"
|
|
3702
3702
|
}, null, 8, ["title"]), h(Rt, {
|
|
@@ -3704,7 +3704,7 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3704
3704
|
"prepend-icon": "add",
|
|
3705
3705
|
variant: "secondary",
|
|
3706
3706
|
onClick: c(u).create
|
|
3707
|
-
}, null, 8, ["label", "onClick"])])) : ne("", !0), h(
|
|
3707
|
+
}, null, 8, ["label", "onClick"])])) : ne("", !0), h(pe, {
|
|
3708
3708
|
value: lt.ADD_ON,
|
|
3709
3709
|
label: c(S)("menu.product.form.detail.category.options.addon.label"),
|
|
3710
3710
|
sublabel: c(S)("menu.product.form.detail.category.options.addon.sublabel")
|
|
@@ -3713,8 +3713,8 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3713
3713
|
}, 8, ["disabled", "model-value"])) : ne("", !0), c(o).isV4 ? ne("", !0) : (C(), Q(X, {
|
|
3714
3714
|
key: 1,
|
|
3715
3715
|
"model-value": P.form.category,
|
|
3716
|
-
rules: [(
|
|
3717
|
-
"onUpdate:modelValue": H[7] || (H[7] = (
|
|
3716
|
+
rules: [(ue) => !ue && !P.isOverride ? "Category is required" : !0],
|
|
3717
|
+
"onUpdate:modelValue": H[7] || (H[7] = (ue) => m("update:form", "category", ue))
|
|
3718
3718
|
}, {
|
|
3719
3719
|
default: V(() => [h($, {
|
|
3720
3720
|
multiple: !1
|
|
@@ -3728,23 +3728,23 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3728
3728
|
}, {
|
|
3729
3729
|
default: V(() => [O("div", Wr, [h(ja, {
|
|
3730
3730
|
modelValue: z.value,
|
|
3731
|
-
"onUpdate:modelValue": H[8] || (H[8] = (
|
|
3731
|
+
"onUpdate:modelValue": H[8] || (H[8] = (ue) => z.value = ue),
|
|
3732
3732
|
items: b.value,
|
|
3733
3733
|
placeholder: c(S)("menu.product.form.detail.path.placeholder"),
|
|
3734
3734
|
disabled: !p.value.category,
|
|
3735
3735
|
"is-local-only": !1
|
|
3736
3736
|
}, null, 8, ["modelValue", "items", "placeholder", "disabled"])])]),
|
|
3737
3737
|
_: 1
|
|
3738
|
-
}, 8, ["label"])) : ne("", !0), c(o).isV4 ? (C(), K("div", Yr, [h(
|
|
3738
|
+
}, 8, ["label"])) : ne("", !0), c(o).isV4 ? (C(), K("div", Yr, [h(_e, {
|
|
3739
3739
|
label: "Shelf Life (mins)",
|
|
3740
3740
|
"model-value": P.form.shelfLife ?? null,
|
|
3741
|
-
rules: [(
|
|
3741
|
+
rules: [(ue) => ue == null || ue > 0 || c(S)("menu.common.validation.min_value", {
|
|
3742
3742
|
value: 1
|
|
3743
3743
|
})],
|
|
3744
|
-
"onUpdate:modelValue": H[9] || (H[9] = (
|
|
3745
|
-
(
|
|
3744
|
+
"onUpdate:modelValue": H[9] || (H[9] = (ue) => {
|
|
3745
|
+
(ue == null || ue > 0) && m("update:form", "shelfLife", ue);
|
|
3746
3746
|
})
|
|
3747
|
-
}, null, 8, ["model-value", "rules"]), h(
|
|
3747
|
+
}, null, 8, ["model-value", "rules"]), h(_e, {
|
|
3748
3748
|
label: c(S)("menu.product.form.detail.fields.minimum_order_quantity.label"),
|
|
3749
3749
|
"model-value": q.value,
|
|
3750
3750
|
min: 0,
|
|
@@ -3757,7 +3757,7 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3757
3757
|
required: p.value.orderFrom,
|
|
3758
3758
|
"default-label": c(S)("menu.product.form.detail.order_from.default"),
|
|
3759
3759
|
label: c(S)("menu.product.form.detail.order_from.label"),
|
|
3760
|
-
"onUpdate:modelValue": H[10] || (H[10] = (
|
|
3760
|
+
"onUpdate:modelValue": H[10] || (H[10] = (ue) => ue && m("update:form", "orderFrom", ue))
|
|
3761
3761
|
}, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
|
|
3762
3762
|
}),
|
|
3763
3763
|
_: 1
|
|
@@ -3780,14 +3780,14 @@ const Hr = /* @__PURE__ */ ve({
|
|
|
3780
3780
|
function Jr(e, n) {
|
|
3781
3781
|
return C(), K("div", Zr, [
|
|
3782
3782
|
O("div", Qr, [
|
|
3783
|
-
|
|
3783
|
+
Ce(e.$slots, "default")
|
|
3784
3784
|
])
|
|
3785
3785
|
]);
|
|
3786
3786
|
}
|
|
3787
|
-
const Oo = /* @__PURE__ */ mt(Xr, [["render", Jr]]), es = /* @__PURE__ */
|
|
3787
|
+
const Oo = /* @__PURE__ */ mt(Xr, [["render", Jr]]), es = /* @__PURE__ */ ge({
|
|
3788
3788
|
__name: "AddForm",
|
|
3789
3789
|
setup(e) {
|
|
3790
|
-
const n =
|
|
3790
|
+
const n = Ae(), t = E(() => n.rules.group), o = E(() => !!n.state.currentCatalogId || !!n.state.currentSchedulerId), a = E(() => {
|
|
3791
3791
|
const s = !n.state.currentSchedulerId, u = n.rules.group.type, d = n.version === Z.F_MENU_VERSION.enum.v3, m = n.rules.item.orderFromActiveOnly, p = n.rules.item.bindToVariant;
|
|
3792
3792
|
return function(v) {
|
|
3793
3793
|
return {
|
|
@@ -3814,7 +3814,7 @@ const Oo = /* @__PURE__ */ mt(Xr, [["render", Jr]]), es = /* @__PURE__ */ ve({
|
|
|
3814
3814
|
items: {},
|
|
3815
3815
|
position: n.groups.length - 1,
|
|
3816
3816
|
itemsLinked: []
|
|
3817
|
-
}), r = Y(i()), { t: l } =
|
|
3817
|
+
}), r = Y(i()), { t: l } = ye();
|
|
3818
3818
|
return (s, u) => t.value.create ? (C(), Q(c(al), {
|
|
3819
3819
|
key: 0,
|
|
3820
3820
|
"categorized-items": c(n).categorizedItems,
|
|
@@ -3828,7 +3828,7 @@ const Oo = /* @__PURE__ */ mt(Xr, [["render", Jr]]), es = /* @__PURE__ */ ve({
|
|
|
3828
3828
|
title: c(l)("menu.group.add")
|
|
3829
3829
|
}, {
|
|
3830
3830
|
default: V(({ trigger: d }) => [
|
|
3831
|
-
|
|
3831
|
+
Ce(s.$slots, "default", { trigger: d })
|
|
3832
3832
|
]),
|
|
3833
3833
|
_: 3
|
|
3834
3834
|
}, 8, ["categorized-items", "config", "group", "title"])) : ne("", !0);
|
|
@@ -3836,7 +3836,7 @@ const Oo = /* @__PURE__ */ mt(Xr, [["render", Jr]]), es = /* @__PURE__ */ ve({
|
|
|
3836
3836
|
}), ts = {}, ns = { class: "flex gap-16" };
|
|
3837
3837
|
function os(e, n) {
|
|
3838
3838
|
return C(), K("div", ns, [
|
|
3839
|
-
|
|
3839
|
+
Ce(e.$slots, "default")
|
|
3840
3840
|
]);
|
|
3841
3841
|
}
|
|
3842
3842
|
const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-title-md-600" }, rs = { class: "pt-8 space-y-24" }, ss = { class: "flex flex-col gap-8" }, ls = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, us = { class: "flex items-center gap-8 flex-wrap" }, cs = { class: "w-24 h-24 rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600" }, ds = { class: "fm-typo-en-body-md-600" }, ms = ["onClick"], ps = { class: "flex items-center gap-8" }, fs = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, hs = { class: "fm-typo-en-body-md-400" }, vs = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, gs = { class: "fm-typo-en-body-lg-600" }, bs = {
|
|
@@ -3851,7 +3851,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3851
3851
|
}, Os = { class: "fm-typo-en-body-md-600 text-fm-color-primary border border-fm-color-primary inline-block rounded-md px-8 py-4" }, Rs = { class: "space-y-32" }, As = {
|
|
3852
3852
|
key: 0,
|
|
3853
3853
|
class: "space-y-8"
|
|
3854
|
-
}, Ms = { class: "flex w-[100px] items-center gap-8" }, Es = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, Ts = { class: "fm-typo-en-body-md-400" }, Vs = { class: "flex-1" }, zs = { class: "flex gap-8 items-center justify-start" }, Is = /* @__PURE__ */
|
|
3854
|
+
}, Ms = { class: "flex w-[100px] items-center gap-8" }, Es = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, Ts = { class: "fm-typo-en-body-md-400" }, Vs = { class: "flex-1" }, zs = { class: "flex gap-8 items-center justify-start" }, Is = /* @__PURE__ */ ge({
|
|
3855
3855
|
__name: "ProductOverrideTranslation",
|
|
3856
3856
|
props: {
|
|
3857
3857
|
modelValue: { type: Boolean },
|
|
@@ -3859,8 +3859,8 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3859
3859
|
},
|
|
3860
3860
|
emits: ["update:modelValue", "update:group"],
|
|
3861
3861
|
setup(e, { emit: n }) {
|
|
3862
|
-
const t = e, o = n, { t: a } =
|
|
3863
|
-
const _ = c(i).find((
|
|
3862
|
+
const t = e, o = n, { t: a } = ye(), { localeList: i } = Hn(), r = Y(!1), l = Y(!0), s = Y([]), u = Y([]), d = Y({}), m = Y({}), p = Y({}), f = Y({}), v = E(() => t.group.name_locale ? Object.entries(t.group.name_locale).map(([M, R]) => {
|
|
3863
|
+
const _ = c(i).find((x) => x.code === M);
|
|
3864
3864
|
return {
|
|
3865
3865
|
localeCode: M,
|
|
3866
3866
|
localeName: (_ == null ? void 0 : _.name) || M,
|
|
@@ -3885,17 +3885,17 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3885
3885
|
};
|
|
3886
3886
|
});
|
|
3887
3887
|
s.value = R;
|
|
3888
|
-
const _ = {},
|
|
3888
|
+
const _ = {}, x = {};
|
|
3889
3889
|
Object.values(t.group.items).forEach((b) => {
|
|
3890
3890
|
_[b._id] = {}, b.name_locale && Object.entries(b.name_locale).forEach(([z, q]) => {
|
|
3891
3891
|
_[b._id][z] = q;
|
|
3892
|
-
}),
|
|
3893
|
-
}), d.value = _, p.value =
|
|
3892
|
+
}), x[b._id] = b.name || b.fallbackName || "";
|
|
3893
|
+
}), d.value = _, p.value = x;
|
|
3894
3894
|
}
|
|
3895
|
-
|
|
3895
|
+
Te(
|
|
3896
3896
|
() => [t.modelValue, t.group],
|
|
3897
3897
|
([M]) => {
|
|
3898
|
-
M && (y(), u.value =
|
|
3898
|
+
M && (y(), u.value = Re.clone(s.value), m.value = Re.clone(d.value), f.value = Re.clone(p.value), r.value = !1, l.value = !0);
|
|
3899
3899
|
},
|
|
3900
3900
|
{ immediate: !0, deep: !0 }
|
|
3901
3901
|
);
|
|
@@ -3913,23 +3913,23 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3913
3913
|
d.value[_][R.code] || (d.value[_][R.code] = "");
|
|
3914
3914
|
}));
|
|
3915
3915
|
}
|
|
3916
|
-
function
|
|
3916
|
+
function k(M) {
|
|
3917
3917
|
s.value = s.value.filter((R) => R.localeCode !== M), Object.keys(d.value).forEach((R) => {
|
|
3918
3918
|
delete d.value[R][M];
|
|
3919
3919
|
});
|
|
3920
3920
|
}
|
|
3921
3921
|
function L() {
|
|
3922
|
-
return !
|
|
3922
|
+
return !Re.isEqual(s.value, u.value) || !Re.isEqual(d.value, m.value) || !Re.isEqual(p.value, f.value);
|
|
3923
3923
|
}
|
|
3924
3924
|
function $() {
|
|
3925
|
-
const M =
|
|
3925
|
+
const M = Re.clone(t.group);
|
|
3926
3926
|
Object.keys(M.items).forEach((R) => {
|
|
3927
3927
|
const _ = p.value[R];
|
|
3928
3928
|
_ !== void 0 && (M.items[R].name = _ || null);
|
|
3929
|
-
const
|
|
3930
|
-
if (
|
|
3929
|
+
const x = d.value[R];
|
|
3930
|
+
if (x && Object.keys(x).length > 0) {
|
|
3931
3931
|
const b = {};
|
|
3932
|
-
Object.entries(
|
|
3932
|
+
Object.entries(x).forEach(([z, q]) => {
|
|
3933
3933
|
q && q.trim() && (b[z] = q.trim());
|
|
3934
3934
|
}), Object.keys(b).length > 0 ? M.items[R].name_locale = b : delete M.items[R].name_locale;
|
|
3935
3935
|
} else
|
|
@@ -3944,7 +3944,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3944
3944
|
set: (M) => o("update:modelValue", M)
|
|
3945
3945
|
});
|
|
3946
3946
|
return (M, R) => {
|
|
3947
|
-
const _ = D("FmIcon"),
|
|
3947
|
+
const _ = D("FmIcon"), x = D("fm-button"), b = D("FmMenu"), z = D("fm-text-field"), q = D("fm-side-sheet");
|
|
3948
3948
|
return C(), Q(q, {
|
|
3949
3949
|
modelValue: B.value,
|
|
3950
3950
|
"onUpdate:modelValue": R[2] || (R[2] = (N) => B.value = N),
|
|
@@ -3956,13 +3956,13 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3956
3956
|
]),
|
|
3957
3957
|
"side-sheet-footer": V(() => [
|
|
3958
3958
|
O("div", zs, [
|
|
3959
|
-
h(
|
|
3959
|
+
h(x, {
|
|
3960
3960
|
label: c(a)("common.save"),
|
|
3961
3961
|
size: "lg",
|
|
3962
3962
|
variant: "primary",
|
|
3963
3963
|
onClick: $
|
|
3964
3964
|
}, null, 8, ["label"]),
|
|
3965
|
-
h(
|
|
3965
|
+
h(x, {
|
|
3966
3966
|
label: c(a)("common.cancel"),
|
|
3967
3967
|
size: "lg",
|
|
3968
3968
|
variant: "tertiary",
|
|
@@ -3975,7 +3975,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3975
3975
|
O("div", ss, [
|
|
3976
3976
|
O("p", ls, ie(c(a)("menu.group.translation.language")), 1),
|
|
3977
3977
|
O("div", us, [
|
|
3978
|
-
(C(!0), K(me, null,
|
|
3978
|
+
(C(!0), K(me, null, ke(s.value, (N) => (C(), K("div", {
|
|
3979
3979
|
key: N.localeCode,
|
|
3980
3980
|
class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
|
|
3981
3981
|
}, [
|
|
@@ -3985,12 +3985,12 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3985
3985
|
name: "close",
|
|
3986
3986
|
class: "cursor-pointer",
|
|
3987
3987
|
variant: "secondary",
|
|
3988
|
-
onClick: (S) =>
|
|
3988
|
+
onClick: (S) => k(N.localeCode)
|
|
3989
3989
|
}, null, 8, ["onClick"])
|
|
3990
3990
|
]))), 128)),
|
|
3991
3991
|
w.value.length > 0 ? (C(), Q(b, { key: 0 }, {
|
|
3992
3992
|
"menu-button": V(() => [
|
|
3993
|
-
h(
|
|
3993
|
+
h(x, {
|
|
3994
3994
|
variant: "secondary",
|
|
3995
3995
|
"border-color": "neutral-gray-300",
|
|
3996
3996
|
"text-color": "neutral-gray-400",
|
|
@@ -3998,7 +3998,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
3998
3998
|
})
|
|
3999
3999
|
]),
|
|
4000
4000
|
default: V(() => [
|
|
4001
|
-
(C(!0), K(me, null,
|
|
4001
|
+
(C(!0), K(me, null, ke(w.value, (N) => (C(), K("div", {
|
|
4002
4002
|
class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
|
|
4003
4003
|
key: N.code,
|
|
4004
4004
|
onClick: (S) => g(N.code)
|
|
@@ -4034,7 +4034,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
4034
4034
|
h(Lt, {
|
|
4035
4035
|
label: c(a)("menu.group.translation.translation")
|
|
4036
4036
|
}, null, 8, ["label"]),
|
|
4037
|
-
(C(!0), K(me, null,
|
|
4037
|
+
(C(!0), K(me, null, ke(v.value, (N) => (C(), K("div", {
|
|
4038
4038
|
key: N.localeCode,
|
|
4039
4039
|
class: "flex items-center gap-16"
|
|
4040
4040
|
}, [
|
|
@@ -4064,7 +4064,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
4064
4064
|
O("p", Ss, ie(c(a)("menu.group.translation.product_name")), 1)
|
|
4065
4065
|
]),
|
|
4066
4066
|
l.value ? (C(), K("div", Fs, [
|
|
4067
|
-
(C(!0), K(me, null,
|
|
4067
|
+
(C(!0), K(me, null, ke(A.value, (N) => (C(), K("div", {
|
|
4068
4068
|
key: N._id,
|
|
4069
4069
|
class: "space-y-8"
|
|
4070
4070
|
}, [
|
|
@@ -4082,7 +4082,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
4082
4082
|
label: c(a)("menu.group.translation.translation"),
|
|
4083
4083
|
spacing: "sm"
|
|
4084
4084
|
}, null, 8, ["label"]),
|
|
4085
|
-
(C(!0), K(me, null,
|
|
4085
|
+
(C(!0), K(me, null, ke(s.value, (S) => (C(), K("div", {
|
|
4086
4086
|
key: S.localeCode,
|
|
4087
4087
|
class: "flex items-center gap-16"
|
|
4088
4088
|
}, [
|
|
@@ -4109,7 +4109,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
4109
4109
|
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
4110
4110
|
};
|
|
4111
4111
|
}
|
|
4112
|
-
}), Ds = { class: "fm-typo-en-title-md-600 mr-auto" }, Ps = { class: "space-y-40" }, $s = { class: "flex gap-8 items-center justify-start" }, Us = /* @__PURE__ */
|
|
4112
|
+
}), Ds = { class: "fm-typo-en-title-md-600 mr-auto" }, Ps = { class: "space-y-40" }, $s = { class: "flex gap-8 items-center justify-start" }, Us = /* @__PURE__ */ ge({
|
|
4113
4113
|
__name: "Form",
|
|
4114
4114
|
props: {
|
|
4115
4115
|
bindingKey: {},
|
|
@@ -4123,7 +4123,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
4123
4123
|
const o = e, a = Y(!1), i = (f) => {
|
|
4124
4124
|
wt.isBoolean(f) ? a.value = f : a.value = !a.value;
|
|
4125
4125
|
}, r = Y([]), l = t, s = _t(
|
|
4126
|
-
() => !
|
|
4126
|
+
() => !Re.isEqual(r.value, o.initialValue),
|
|
4127
4127
|
() => {
|
|
4128
4128
|
a.value = !1;
|
|
4129
4129
|
}
|
|
@@ -4134,21 +4134,21 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
4134
4134
|
return;
|
|
4135
4135
|
l("update:inventory", r.value), i(!1);
|
|
4136
4136
|
}
|
|
4137
|
-
|
|
4137
|
+
Te(
|
|
4138
4138
|
() => a.value,
|
|
4139
4139
|
(f) => {
|
|
4140
|
-
f && (r.value =
|
|
4140
|
+
f && (r.value = ve(o.initialValue), p.readInventory());
|
|
4141
4141
|
}
|
|
4142
4142
|
), n({ getKey: () => o.bindingKey, trigger: i });
|
|
4143
|
-
const { t: m } =
|
|
4143
|
+
const { t: m } = ye(), p = eo();
|
|
4144
4144
|
return (f, v) => {
|
|
4145
4145
|
const A = D("fm-text-field"), y = D("fm-card"), w = D("fm-button"), g = D("fm-side-sheet");
|
|
4146
4146
|
return C(), K(me, null, [
|
|
4147
|
-
|
|
4147
|
+
Ce(f.$slots, "default", { trigger: i }),
|
|
4148
4148
|
h(g, {
|
|
4149
4149
|
id: "inventory-form",
|
|
4150
4150
|
modelValue: a.value,
|
|
4151
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
4151
|
+
"onUpdate:modelValue": v[2] || (v[2] = (k) => a.value = k),
|
|
4152
4152
|
"close-button": !1,
|
|
4153
4153
|
"is-container": c(ze).FmForm,
|
|
4154
4154
|
"is-container-props": {
|
|
@@ -4191,7 +4191,7 @@ const is = /* @__PURE__ */ mt(ts, [["render", os]]), as = { class: "fm-typo-en-t
|
|
|
4191
4191
|
default: V(() => [
|
|
4192
4192
|
h(c(di), {
|
|
4193
4193
|
modelValue: r.value,
|
|
4194
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
4194
|
+
"onUpdate:modelValue": v[0] || (v[0] = (k) => r.value = k)
|
|
4195
4195
|
}, null, 8, ["modelValue"])
|
|
4196
4196
|
]),
|
|
4197
4197
|
_: 1
|
|
@@ -4239,7 +4239,7 @@ function Ns() {
|
|
|
4239
4239
|
open: n
|
|
4240
4240
|
};
|
|
4241
4241
|
}
|
|
4242
|
-
const Ro = /* @__PURE__ */
|
|
4242
|
+
const Ro = /* @__PURE__ */ ge({
|
|
4243
4243
|
__name: "PriceTierForm",
|
|
4244
4244
|
props: /* @__PURE__ */ Io({
|
|
4245
4245
|
priceTiers: {
|
|
@@ -4260,7 +4260,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4260
4260
|
setup(e) {
|
|
4261
4261
|
const {
|
|
4262
4262
|
t: n
|
|
4263
|
-
} =
|
|
4263
|
+
} = ye(), t = e, o = Do(e, "modelValue");
|
|
4264
4264
|
function a(r, l) {
|
|
4265
4265
|
l ? o.value = {
|
|
4266
4266
|
...o.value,
|
|
@@ -4298,7 +4298,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4298
4298
|
}, null, 8, ["row-data", "page-size"])]);
|
|
4299
4299
|
};
|
|
4300
4300
|
}
|
|
4301
|
-
}), Ls = { class: "fm-typo-en-title-md-600" }, Bs = { class: "py-16 space-y-32" }, js = { class: "flex gap-8 items-center justify-start" }, Gs = /* @__PURE__ */
|
|
4301
|
+
}), Ls = { class: "fm-typo-en-title-md-600" }, Bs = { class: "py-16 space-y-32" }, js = { class: "flex gap-8 items-center justify-start" }, Gs = /* @__PURE__ */ ge({
|
|
4302
4302
|
__name: "PriceTierSheet",
|
|
4303
4303
|
props: {
|
|
4304
4304
|
initialValue: {},
|
|
@@ -4307,10 +4307,10 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4307
4307
|
},
|
|
4308
4308
|
emits: ["update:show", "submit"],
|
|
4309
4309
|
setup(e, { emit: n }) {
|
|
4310
|
-
const { t } =
|
|
4310
|
+
const { t } = ye(), o = n, a = Y(!0), i = () => {
|
|
4311
4311
|
a.value = !1, o("update:show", !1);
|
|
4312
4312
|
}, r = E(() => t("menu.price_tier.price_tier_config")), l = E(() => t("common.update")), s = e, u = to(s.menuStore), d = Y(s.initialValue ? sn(s.initialValue) : {}), m = _t(
|
|
4313
|
-
() => !
|
|
4313
|
+
() => !Re.isEqual(s.initialValue || {}, d.value),
|
|
4314
4314
|
() => {
|
|
4315
4315
|
i();
|
|
4316
4316
|
}
|
|
@@ -4382,7 +4382,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4382
4382
|
}, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]);
|
|
4383
4383
|
};
|
|
4384
4384
|
}
|
|
4385
|
-
}), Ao = /* @__PURE__ */
|
|
4385
|
+
}), Ao = /* @__PURE__ */ ge({
|
|
4386
4386
|
__name: "PriceTierButton",
|
|
4387
4387
|
props: {
|
|
4388
4388
|
priceTiers: {},
|
|
@@ -4405,10 +4405,10 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4405
4405
|
o("update:priceTiers", s);
|
|
4406
4406
|
});
|
|
4407
4407
|
}
|
|
4408
|
-
const { t: l } =
|
|
4408
|
+
const { t: l } = ye();
|
|
4409
4409
|
return (s, u) => {
|
|
4410
4410
|
const d = D("FmButton"), m = D("FmTooltip");
|
|
4411
|
-
return s.$slots.default ?
|
|
4411
|
+
return s.$slots.default ? Ce(s.$slots, "default", { key: 0 }) : (C(), Q(m, {
|
|
4412
4412
|
key: 1,
|
|
4413
4413
|
content: c(l)("menu.price_tier.price_tier_config"),
|
|
4414
4414
|
"z-index": 999,
|
|
@@ -4436,7 +4436,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4436
4436
|
class: "xs:overflow-x-scroll"
|
|
4437
4437
|
}, Hs = {
|
|
4438
4438
|
class: "xs:min-w-[640px]"
|
|
4439
|
-
}, qs = /* @__PURE__ */
|
|
4439
|
+
}, qs = /* @__PURE__ */ ge({
|
|
4440
4440
|
__name: "OptionTable",
|
|
4441
4441
|
props: {
|
|
4442
4442
|
config: {},
|
|
@@ -4450,7 +4450,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4450
4450
|
setup(e, {
|
|
4451
4451
|
emit: n
|
|
4452
4452
|
}) {
|
|
4453
|
-
const t = e, o = n, a = Ot(), i =
|
|
4453
|
+
const t = e, o = n, a = Ot(), i = Ae(), r = E(() => $e.Country.getCountry(a.currentCountry.value)), l = Y(!1), s = Y(!1), u = E(() => t.config.isV4 || t.group.type === Z.F_ADDON_GROUP_TYPE.enum.PRODUCT), d = E(() => u.value), m = E(() => u.value), p = E(() => Object.values(t.group.items).flatMap((I) => [{
|
|
4454
4454
|
_id: I._id,
|
|
4455
4455
|
combinationKey: void 0
|
|
4456
4456
|
}, ...(I.items ?? []).filter((F) => F.orderFrom !== Z.F_ORDER_FROM.enum.NONE).map((F) => ({
|
|
@@ -4460,7 +4460,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4460
4460
|
searchKey: f,
|
|
4461
4461
|
filter: v
|
|
4462
4462
|
} = pi(), A = E(() => {
|
|
4463
|
-
const I = Object.entries(t.group.items).filter(([, F]) => v([F.code || "", F.name || F.fallbackName, g(F.price ?? F.fallbackPrice),
|
|
4463
|
+
const I = Object.entries(t.group.items).filter(([, F]) => v([F.code || "", F.name || F.fallbackName, g(F.price ?? F.fallbackPrice), k(F.orderFrom || F.fallbackOrder), ...(F.items || []).map((j) => [j.code || "", j.name || j.fallbackName, g(j.price ?? j.fallbackPrice), k(j.orderFrom || j.fallbackOrder)].join(""))]));
|
|
4464
4464
|
return Object.fromEntries(I);
|
|
4465
4465
|
}), y = (I) => ({
|
|
4466
4466
|
...t.config,
|
|
@@ -4468,19 +4468,19 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4468
4468
|
link: t.config.link(I),
|
|
4469
4469
|
name: t.config.name(I),
|
|
4470
4470
|
orderFrom: t.config.orderFrom(I)
|
|
4471
|
-
}), w = E(() => !0), g = (I) => I ? vt(I, !1) : "",
|
|
4471
|
+
}), w = E(() => !0), g = (I) => I ? vt(I, !1) : "", k = (I) => {
|
|
4472
4472
|
var F;
|
|
4473
4473
|
return I == null ? "" : (F = Wo()[I]) == null ? void 0 : F.label;
|
|
4474
4474
|
}, L = E(() => Object.values(A.value)), $ = Y({}), {
|
|
4475
4475
|
t: U
|
|
4476
|
-
} =
|
|
4476
|
+
} = ye(), T = Y([{
|
|
4477
4477
|
accessorKey: "isDefault",
|
|
4478
4478
|
header: () => U("menu.group.option.is_default"),
|
|
4479
4479
|
enableSorting: !1,
|
|
4480
4480
|
size: 75,
|
|
4481
4481
|
cell: (I) => {
|
|
4482
|
-
var se,
|
|
4483
|
-
if ((
|
|
4482
|
+
var se, ce;
|
|
4483
|
+
if ((ce = (se = I.row.original) == null ? void 0 : se.items) != null && ce.length)
|
|
4484
4484
|
return null;
|
|
4485
4485
|
const F = I.row.depth > 0, j = I.row.original, J = !y(j.combinationKey).isDefault || j.orderFrom === Z.F_ORDER_FROM.enum.NONE, W = !!I.getValue();
|
|
4486
4486
|
return h(ze.FmCheckbox, {
|
|
@@ -4529,8 +4529,8 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4529
4529
|
})]),
|
|
4530
4530
|
enableSorting: !1,
|
|
4531
4531
|
cell: (I) => {
|
|
4532
|
-
var
|
|
4533
|
-
const F = I.getValue(), j = I.row.original, J = !y(j.combinationKey).name || j.orderFrom === Z.F_ORDER_FROM.enum.NONE, W = I.row.depth > 0, se = j.combinationKey ? Qn(j.combinationKey,
|
|
4532
|
+
var ce;
|
|
4533
|
+
const F = I.getValue(), j = I.row.original, J = !y(j.combinationKey).name || j.orderFrom === Z.F_ORDER_FROM.enum.NONE, W = I.row.depth > 0, se = j.combinationKey ? Qn(j.combinationKey, Ae().variants) : i.rules.group.linkAddonName ? (ce = q.value[j._id]) == null ? void 0 : ce.name : null;
|
|
4534
4534
|
return Se("div", Se(ze.FmTextField, {
|
|
4535
4535
|
modelValue: F,
|
|
4536
4536
|
placeholder: se ?? "",
|
|
@@ -4577,7 +4577,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4577
4577
|
required: !W && !J,
|
|
4578
4578
|
nullable: !!W,
|
|
4579
4579
|
min: w.value ? void 0 : 0,
|
|
4580
|
-
"onUpdate:modelValue": (
|
|
4580
|
+
"onUpdate:modelValue": (ce) => {
|
|
4581
4581
|
var P;
|
|
4582
4582
|
if (se) {
|
|
4583
4583
|
const H = (P = I.row.getParentRow()) == null ? void 0 : P.original;
|
|
@@ -4587,10 +4587,10 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4587
4587
|
j.combinationKey ?? "",
|
|
4588
4588
|
// @ts-ignore
|
|
4589
4589
|
"price",
|
|
4590
|
-
|
|
4590
|
+
ce
|
|
4591
4591
|
);
|
|
4592
4592
|
} else
|
|
4593
|
-
R(j._id, "price",
|
|
4593
|
+
R(j._id, "price", ce);
|
|
4594
4594
|
},
|
|
4595
4595
|
showCurrency: !1,
|
|
4596
4596
|
class: "min-w-[88px]"
|
|
@@ -4610,9 +4610,9 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4610
4610
|
required: !0,
|
|
4611
4611
|
editActiveOnly: y(j.combinationKey).orderFromActiveOnly,
|
|
4612
4612
|
"onUpdate:modelValue": (se) => {
|
|
4613
|
-
var
|
|
4613
|
+
var ce;
|
|
4614
4614
|
if (W) {
|
|
4615
|
-
const P = (
|
|
4615
|
+
const P = (ce = I.row.getParentRow()) == null ? void 0 : ce.original;
|
|
4616
4616
|
if (!P) return;
|
|
4617
4617
|
_(
|
|
4618
4618
|
P._id,
|
|
@@ -4646,10 +4646,10 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4646
4646
|
"onUpdate:priceTiers": (W) => {
|
|
4647
4647
|
var se;
|
|
4648
4648
|
if (J) {
|
|
4649
|
-
const
|
|
4650
|
-
if (!
|
|
4649
|
+
const ce = (se = I.row.getParentRow()) == null ? void 0 : se.original;
|
|
4650
|
+
if (!ce) return;
|
|
4651
4651
|
_(
|
|
4652
|
-
|
|
4652
|
+
ce._id,
|
|
4653
4653
|
F.combinationKey ?? "",
|
|
4654
4654
|
// @ts-ignore
|
|
4655
4655
|
"priceTiers",
|
|
@@ -4666,10 +4666,10 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4666
4666
|
"onUpdate:inventory": (W) => {
|
|
4667
4667
|
var se;
|
|
4668
4668
|
if (J) {
|
|
4669
|
-
const
|
|
4670
|
-
if (!
|
|
4669
|
+
const ce = (se = I.row.getParentRow()) == null ? void 0 : se.original;
|
|
4670
|
+
if (!ce) return;
|
|
4671
4671
|
_(
|
|
4672
|
-
|
|
4672
|
+
ce._id,
|
|
4673
4673
|
F.combinationKey ?? "",
|
|
4674
4674
|
// @ts-ignore
|
|
4675
4675
|
"inventoryBindings",
|
|
@@ -4703,7 +4703,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4703
4703
|
textColor: Ye.NeutralGray400,
|
|
4704
4704
|
disabled: J,
|
|
4705
4705
|
onClick: () => {
|
|
4706
|
-
|
|
4706
|
+
x(F._id);
|
|
4707
4707
|
}
|
|
4708
4708
|
}, null)]);
|
|
4709
4709
|
}
|
|
@@ -4748,16 +4748,16 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4748
4748
|
}
|
|
4749
4749
|
function _(I, F, j, J) {
|
|
4750
4750
|
var P, H;
|
|
4751
|
-
const W =
|
|
4751
|
+
const W = ve(t.group), se = (P = W.items[I].items) == null ? void 0 : P.findIndex((le) => le.combinationKey === F);
|
|
4752
4752
|
if (!wt.isSet(se)) return;
|
|
4753
|
-
let
|
|
4754
|
-
|
|
4755
|
-
...
|
|
4753
|
+
let ce = (H = W.items[I].items) == null ? void 0 : H[se];
|
|
4754
|
+
ce && (ce = {
|
|
4755
|
+
...ce,
|
|
4756
4756
|
[j]: J
|
|
4757
|
-
}, W.items[I].items[se] =
|
|
4757
|
+
}, W.items[I].items[se] = ce, o("update:group", W));
|
|
4758
4758
|
}
|
|
4759
|
-
function
|
|
4760
|
-
const F =
|
|
4759
|
+
function x(I) {
|
|
4760
|
+
const F = ve(t.group);
|
|
4761
4761
|
delete F.items[I], o("update:group", F);
|
|
4762
4762
|
}
|
|
4763
4763
|
function b(I) {
|
|
@@ -4773,12 +4773,12 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4773
4773
|
function N(I) {
|
|
4774
4774
|
const F = [], j = new Set(I.filter((J) => J.combinationKey).map((J) => `${J._id}:${J.combinationKey}`));
|
|
4775
4775
|
return I.forEach((J) => {
|
|
4776
|
-
var
|
|
4776
|
+
var ce;
|
|
4777
4777
|
if (J.combinationKey)
|
|
4778
4778
|
return;
|
|
4779
4779
|
F.push(J);
|
|
4780
4780
|
const W = q.value[J._id];
|
|
4781
|
-
if (!W || !W.variant || ((
|
|
4781
|
+
if (!W || !W.variant || ((ce = W.variant.variantCombinations) == null ? void 0 : ce.length) === 0)
|
|
4782
4782
|
return;
|
|
4783
4783
|
(W.variant.variantCombinations || []).forEach((P) => {
|
|
4784
4784
|
const H = `${P._id}:${P.combinationKey}`, le = !j.has(H);
|
|
@@ -4796,7 +4796,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4796
4796
|
F = {
|
|
4797
4797
|
...F,
|
|
4798
4798
|
items: j.map((J) => {
|
|
4799
|
-
const W = F.items.find((
|
|
4799
|
+
const W = F.items.find((ce) => ce._id == J._id && ce.combinationKey == J.combinationKey);
|
|
4800
4800
|
J.orderFrom && W && (W.orderFrom = J.orderFrom);
|
|
4801
4801
|
const se = z.value[J._id];
|
|
4802
4802
|
return W || {
|
|
@@ -4810,13 +4810,13 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4810
4810
|
}, o("update:unmap-group", F);
|
|
4811
4811
|
}, G = (I) => I.items;
|
|
4812
4812
|
function oe(I) {
|
|
4813
|
-
const F =
|
|
4813
|
+
const F = ve(t.group);
|
|
4814
4814
|
F.items = I.reduce((j, J) => ({
|
|
4815
4815
|
...j,
|
|
4816
4816
|
[J._id]: J
|
|
4817
4817
|
}), {}), o("update:group", F);
|
|
4818
4818
|
}
|
|
4819
|
-
const te = Xn(),
|
|
4819
|
+
const te = Xn(), be = E(() => te.breakpoints.value.xs);
|
|
4820
4820
|
return (I, F) => {
|
|
4821
4821
|
const j = D("fm-button"), J = D("fm-table");
|
|
4822
4822
|
return C(), K(me, null, [h(Le, {
|
|
@@ -4857,7 +4857,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4857
4857
|
default: V(() => [O("div", Ys, [O("div", Hs, [h(J, {
|
|
4858
4858
|
"column-defs": T.value,
|
|
4859
4859
|
"column-visibility": B.value,
|
|
4860
|
-
draggable: !
|
|
4860
|
+
draggable: !be.value && y(null).name,
|
|
4861
4861
|
"expanded-state": l.value ? {} : $.value,
|
|
4862
4862
|
"get-sub-row": G,
|
|
4863
4863
|
"page-size": 999,
|
|
@@ -4880,7 +4880,7 @@ const Ro = /* @__PURE__ */ ve({
|
|
|
4880
4880
|
}
|
|
4881
4881
|
});
|
|
4882
4882
|
function Xs(e) {
|
|
4883
|
-
const { t: n } =
|
|
4883
|
+
const { t: n } = ye();
|
|
4884
4884
|
function t(r) {
|
|
4885
4885
|
let l = 0;
|
|
4886
4886
|
for (const s of Object.values(r.items)) {
|
|
@@ -4941,7 +4941,7 @@ function Xs(e) {
|
|
|
4941
4941
|
const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
4942
4942
|
key: 0,
|
|
4943
4943
|
class: "pt-8 space-y-32"
|
|
4944
|
-
}, Js = { class: "py-12 px-16 space-y-4" }, el = { class: "flex gap-8 items-center justify-start" }, Mo = /* @__PURE__ */
|
|
4944
|
+
}, Js = { class: "py-12 px-16 space-y-4" }, el = { class: "flex gap-8 items-center justify-start" }, Mo = /* @__PURE__ */ ge({
|
|
4945
4945
|
__name: "BaseForm",
|
|
4946
4946
|
props: {
|
|
4947
4947
|
title: {},
|
|
@@ -4955,11 +4955,11 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
4955
4955
|
setup(e, { expose: n, emit: t }) {
|
|
4956
4956
|
var I;
|
|
4957
4957
|
let o = e;
|
|
4958
|
-
const a = t, i =
|
|
4958
|
+
const a = t, i = Ae(), r = Ot(), l = Ze(), s = Ke(), u = ot(nt(s)), { countDefaultItems: d, validateGroupItems: m, minMaxValidationRules: p } = Xs(
|
|
4959
4959
|
() => o.group
|
|
4960
4960
|
), f = Y(!1), v = Y(!1), A = Y(!1), y = (F) => {
|
|
4961
4961
|
wt.isBoolean(F) ? v.value = F : v.value = !v.value;
|
|
4962
|
-
}, w = E(() => o.group ? o.config(o.group) : null), g = E(() => ao(w.value)),
|
|
4962
|
+
}, w = E(() => o.group ? o.config(o.group) : null), g = E(() => ao(w.value)), k = (F) => g.value.includes(F), L = E(() => [
|
|
4963
4963
|
{
|
|
4964
4964
|
label: "Normal",
|
|
4965
4965
|
value: Z.F_ADDON_GROUP_TYPE.enum.NORMAL
|
|
@@ -4982,7 +4982,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
4982
4982
|
name_locale: F
|
|
4983
4983
|
});
|
|
4984
4984
|
}
|
|
4985
|
-
const T = Y((
|
|
4985
|
+
const T = Y((I = o.group) == null ? void 0 : I.name);
|
|
4986
4986
|
function B(F) {
|
|
4987
4987
|
o.group && (T.value = F, $({
|
|
4988
4988
|
...o.group,
|
|
@@ -5016,8 +5016,8 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5016
5016
|
w.value.isOverride
|
|
5017
5017
|
)[0];
|
|
5018
5018
|
}
|
|
5019
|
-
const _ = Y(
|
|
5020
|
-
() => !
|
|
5019
|
+
const _ = Y(Re.clone(o.group)), x = _t(
|
|
5020
|
+
() => !Re.isEqual(o.group, _.value),
|
|
5021
5021
|
() => {
|
|
5022
5022
|
v.value = !1;
|
|
5023
5023
|
}
|
|
@@ -5080,10 +5080,10 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5080
5080
|
}
|
|
5081
5081
|
y(!1);
|
|
5082
5082
|
}
|
|
5083
|
-
|
|
5083
|
+
Te(
|
|
5084
5084
|
() => v.value,
|
|
5085
5085
|
async (F) => {
|
|
5086
|
-
a("status:show", F), F && (await Wn(), _.value =
|
|
5086
|
+
a("status:show", F), F && (await Wn(), _.value = Re.clone(o.group));
|
|
5087
5087
|
}
|
|
5088
5088
|
);
|
|
5089
5089
|
const q = E(() => {
|
|
@@ -5111,36 +5111,37 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5111
5111
|
trigger: y,
|
|
5112
5112
|
show: v
|
|
5113
5113
|
});
|
|
5114
|
-
const { t: te } =
|
|
5114
|
+
const { t: te } = ye(), be = E(() => {
|
|
5115
5115
|
if (!o.group) return [];
|
|
5116
5116
|
const F = [], j = o.group.name_locale, J = "en-US", W = j == null ? void 0 : j[J];
|
|
5117
5117
|
return o.group.name && !W && F.push({
|
|
5118
5118
|
locale: J,
|
|
5119
5119
|
name: o.group.name,
|
|
5120
5120
|
localeDisplay: Pe(J)
|
|
5121
|
-
}), j && Object.entries(j).filter(([se,
|
|
5121
|
+
}), j && Object.entries(j).filter(([se, ce]) => ce).sort(([se], [ce]) => se.localeCompare(ce)).forEach(([se, ce]) => {
|
|
5122
5122
|
F.push({
|
|
5123
5123
|
locale: se,
|
|
5124
|
-
name:
|
|
5124
|
+
name: ce,
|
|
5125
5125
|
localeDisplay: Pe(se)
|
|
5126
5126
|
});
|
|
5127
5127
|
}), F;
|
|
5128
5128
|
});
|
|
5129
5129
|
return (F, j) => {
|
|
5130
|
-
|
|
5130
|
+
var Oe;
|
|
5131
|
+
const J = D("fm-button"), W = D("FmTooltip"), se = D("fm-text-field"), ce = D("fm-stepper-field"), P = D("FmFormGroup"), H = D("fm-radio"), le = D("fm-radio-group"), Me = D("fm-switch"), xe = D("fm-side-sheet");
|
|
5131
5132
|
return C(), K(me, null, [
|
|
5132
|
-
|
|
5133
|
-
h(
|
|
5133
|
+
Ce(F.$slots, "default", { trigger: y }),
|
|
5134
|
+
h(xe, {
|
|
5134
5135
|
id: "group-form",
|
|
5135
5136
|
modelValue: v.value,
|
|
5136
|
-
"onUpdate:modelValue": j[9] || (j[9] = (
|
|
5137
|
+
"onUpdate:modelValue": j[9] || (j[9] = (pe) => v.value = pe),
|
|
5137
5138
|
"is-container": c(ze).FmForm,
|
|
5138
5139
|
"is-container-props": {
|
|
5139
5140
|
onValidationSuccess: z,
|
|
5140
5141
|
blameFormChildOnValidationFailed: !0
|
|
5141
5142
|
},
|
|
5142
5143
|
"max-width": 720,
|
|
5143
|
-
"onOn:clickedAway": c(
|
|
5144
|
+
"onOn:clickedAway": c(x)
|
|
5144
5145
|
}, {
|
|
5145
5146
|
"side-sheet-header": V(() => [
|
|
5146
5147
|
O("p", Zs, ie(F.title), 1)
|
|
@@ -5164,125 +5165,129 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5164
5165
|
]),
|
|
5165
5166
|
default: V(() => [
|
|
5166
5167
|
F.group ? (C(), K("div", Qs, [
|
|
5167
|
-
|
|
5168
|
+
Ce(F.$slots, "variant-section"),
|
|
5168
5169
|
h(Jo, null, {
|
|
5169
|
-
default: V(() =>
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
rules
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
"
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5170
|
+
default: V(() => {
|
|
5171
|
+
var pe;
|
|
5172
|
+
return [
|
|
5173
|
+
h(se, {
|
|
5174
|
+
modelValue: T.value,
|
|
5175
|
+
"onUpdate:modelValue": j[1] || (j[1] = (de) => T.value = de),
|
|
5176
|
+
placeholder: (pe = _.value) == null ? void 0 : pe.name,
|
|
5177
|
+
disabled: k("name"),
|
|
5178
|
+
rules: k("name") ? [] : G.value,
|
|
5179
|
+
autofocus: "",
|
|
5180
|
+
label: c(te)("menu.common.labels.group_name")
|
|
5181
|
+
}, {
|
|
5182
|
+
append: V(() => [
|
|
5183
|
+
h(W, {
|
|
5184
|
+
variant: "plain",
|
|
5185
|
+
placement: "top",
|
|
5186
|
+
"z-index": 999
|
|
5187
|
+
}, {
|
|
5188
|
+
content: V(() => [
|
|
5189
|
+
O("div", Js, [
|
|
5190
|
+
(C(!0), K(me, null, ke(be.value, (de) => (C(), K("div", {
|
|
5191
|
+
key: de.locale
|
|
5192
|
+
}, ie(de.name) + " (" + ie(de.localeDisplay) + ") ", 1))), 128))
|
|
5193
|
+
])
|
|
5194
|
+
]),
|
|
5195
|
+
default: V(() => [
|
|
5196
|
+
h(J, {
|
|
5197
|
+
variant: "tertiary",
|
|
5198
|
+
icon: "g_translate",
|
|
5199
|
+
onClick: j[0] || (j[0] = (de) => A.value = !0),
|
|
5200
|
+
disabled: !oe.value
|
|
5201
|
+
}, null, 8, ["disabled"])
|
|
5202
|
+
]),
|
|
5203
|
+
_: 1
|
|
5204
|
+
})
|
|
5205
|
+
]),
|
|
5206
|
+
_: 1
|
|
5207
|
+
}, 8, ["modelValue", "placeholder", "disabled", "rules", "label"]),
|
|
5208
|
+
h(P, {
|
|
5209
|
+
"model-value": F.group.min + " " + F.group.max,
|
|
5210
|
+
rules: c(p)
|
|
5211
|
+
}, {
|
|
5212
|
+
default: V(() => [
|
|
5213
|
+
h(is, null, {
|
|
5214
|
+
default: V(() => [
|
|
5215
|
+
h(ce, {
|
|
5216
|
+
modelValue: F.group.min,
|
|
5217
|
+
"onUpdate:modelValue": j[2] || (j[2] = (de) => F.group.min = de),
|
|
5218
|
+
disabled: k("min"),
|
|
5219
|
+
min: 0,
|
|
5220
|
+
class: "flex-1",
|
|
5221
|
+
label: c(te)("menu.common.labels.min_select")
|
|
5222
|
+
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
5223
|
+
h(ce, {
|
|
5224
|
+
modelValue: F.group.max,
|
|
5225
|
+
"onUpdate:modelValue": j[3] || (j[3] = (de) => F.group.max = de),
|
|
5226
|
+
disabled: k("max"),
|
|
5227
|
+
min: F.group.min,
|
|
5228
|
+
class: "flex-1",
|
|
5229
|
+
label: c(te)("menu.common.labels.max_select")
|
|
5230
|
+
}, null, 8, ["modelValue", "disabled", "min", "label"])
|
|
5231
|
+
]),
|
|
5232
|
+
_: 1
|
|
5233
|
+
})
|
|
5234
|
+
]),
|
|
5235
|
+
_: 1
|
|
5236
|
+
}, 8, ["model-value", "rules"]),
|
|
5237
|
+
w.value.type ? (C(), Q(it, {
|
|
5238
|
+
key: 0,
|
|
5239
|
+
label: c(te)("menu.common.labels.group_type")
|
|
5240
|
+
}, {
|
|
5241
|
+
default: V(() => [
|
|
5242
|
+
h(le, {
|
|
5243
|
+
disabled: k("type"),
|
|
5244
|
+
"model-value": F.group.type,
|
|
5245
|
+
"onUpdate:modelValue": j[4] || (j[4] = (de) => M(de))
|
|
5246
|
+
}, {
|
|
5247
|
+
default: V(() => [
|
|
5248
|
+
(C(!0), K(me, null, ke(L.value, (de) => (C(), Q(H, {
|
|
5249
|
+
key: de.value,
|
|
5250
|
+
label: c(te)(`menu.group.types.${de.label.toLowerCase()}`),
|
|
5251
|
+
value: de.value
|
|
5252
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
5253
|
+
]),
|
|
5254
|
+
_: 1
|
|
5255
|
+
}, 8, ["disabled", "model-value"])
|
|
5256
|
+
]),
|
|
5257
|
+
_: 1
|
|
5258
|
+
}, 8, ["label"])) : ne("", !0),
|
|
5259
|
+
h(it, {
|
|
5260
|
+
label: c(te)("menu.common.labels.configuration")
|
|
5261
|
+
}, {
|
|
5262
|
+
default: V(() => [
|
|
5263
|
+
h(Me, {
|
|
5264
|
+
modelValue: F.group.stackable,
|
|
5265
|
+
"onUpdate:modelValue": j[5] || (j[5] = (de) => F.group.stackable = de),
|
|
5266
|
+
disabled: k("stackable"),
|
|
5267
|
+
label: c(te)("menu.common.labels.stackable"),
|
|
5268
|
+
"label-placement": "right",
|
|
5269
|
+
sublabel: c(te)("menu.common.labels.stackable_sublabel")
|
|
5270
|
+
}, null, 8, ["modelValue", "disabled", "label", "sublabel"])
|
|
5271
|
+
]),
|
|
5272
|
+
_: 1
|
|
5273
|
+
}, 8, ["label"]),
|
|
5274
|
+
q.value ? (C(), Q(Le, {
|
|
5275
|
+
key: 1,
|
|
5276
|
+
title: c(te)("menu.group.form.tagging.title"),
|
|
5277
|
+
"sub-title": c(te)("menu.group.form.tagging.subtitle")
|
|
5278
|
+
}, {
|
|
5279
|
+
default: V(() => [
|
|
5280
|
+
h(c(qn), {
|
|
5281
|
+
entity: "group",
|
|
5282
|
+
"model-value": F.group.customAttributes || {},
|
|
5283
|
+
"onUpdate:modelValue": S,
|
|
5284
|
+
"value-options": N.value
|
|
5285
|
+
}, null, 8, ["model-value", "value-options"])
|
|
5286
|
+
]),
|
|
5287
|
+
_: 1
|
|
5288
|
+
}, 8, ["title", "sub-title"])) : ne("", !0)
|
|
5289
|
+
];
|
|
5290
|
+
}),
|
|
5286
5291
|
_: 1
|
|
5287
5292
|
}),
|
|
5288
5293
|
h(P, {
|
|
@@ -5300,8 +5305,8 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5300
5305
|
"categorized-items": F.categorizedItems,
|
|
5301
5306
|
config: w.value,
|
|
5302
5307
|
group: F.group,
|
|
5303
|
-
"onUpdate:group": j[6] || (j[6] = (
|
|
5304
|
-
"onUpdate:unmapGroup": j[7] || (j[7] = (
|
|
5308
|
+
"onUpdate:group": j[6] || (j[6] = (pe) => $(pe)),
|
|
5309
|
+
"onUpdate:unmapGroup": j[7] || (j[7] = (pe) => $(R(pe)))
|
|
5305
5310
|
}, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
|
|
5306
5311
|
]),
|
|
5307
5312
|
_: 1
|
|
@@ -5313,9 +5318,9 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5313
5318
|
F.group ? (C(), Q(yn, {
|
|
5314
5319
|
key: 0,
|
|
5315
5320
|
modelValue: A.value,
|
|
5316
|
-
"onUpdate:modelValue": j[10] || (j[10] = (
|
|
5321
|
+
"onUpdate:modelValue": j[10] || (j[10] = (pe) => A.value = pe),
|
|
5317
5322
|
title: c(te)("menu.group.title"),
|
|
5318
|
-
name: T.value,
|
|
5323
|
+
name: T.value ?? ((Oe = _.value) == null ? void 0 : Oe.name) ?? "",
|
|
5319
5324
|
"name-locale": F.group.name_locale,
|
|
5320
5325
|
"onUpdate:name": B,
|
|
5321
5326
|
"onUpdate:nameLocale": U
|
|
@@ -5323,7 +5328,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5323
5328
|
], 64);
|
|
5324
5329
|
};
|
|
5325
5330
|
}
|
|
5326
|
-
}), tl = { class: "fm-typo-en-title-sm-600" }, nl = { class: "flex items-end space-x-24" }, ol = { class: "flex" }, il = /* @__PURE__ */
|
|
5331
|
+
}), tl = { class: "fm-typo-en-title-sm-600" }, nl = { class: "flex items-end space-x-24" }, ol = { class: "flex" }, il = /* @__PURE__ */ ge({
|
|
5327
5332
|
__name: "UpdateForm",
|
|
5328
5333
|
props: {
|
|
5329
5334
|
combinations: {},
|
|
@@ -5333,7 +5338,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5333
5338
|
emits: ["update:combinations"],
|
|
5334
5339
|
setup(e, { expose: n, emit: t }) {
|
|
5335
5340
|
var L, $;
|
|
5336
|
-
const o = e, a = t, i =
|
|
5341
|
+
const o = e, a = t, i = Ae(), r = Ze(), l = ot(nt(Ke())), s = Y([]), u = Y(o.combinations[0].combinationKey || ""), d = E(
|
|
5337
5342
|
() => s.value.findIndex((U) => U.combinationKey == u.value)
|
|
5338
5343
|
), m = E(
|
|
5339
5344
|
() => o.combinations.map((U) => ({
|
|
@@ -5341,9 +5346,9 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5341
5346
|
value: U.combinationKey || ""
|
|
5342
5347
|
}))
|
|
5343
5348
|
), p = E(() => {
|
|
5344
|
-
var _,
|
|
5349
|
+
var _, x;
|
|
5345
5350
|
if (!w.value) return null;
|
|
5346
|
-
const U = ((
|
|
5351
|
+
const U = ((x = (_ = s.value[d.value]) == null ? void 0 : _.groups) == null ? void 0 : x.find((b) => b._id === o.groupId)) || {
|
|
5347
5352
|
_id: o.groupId,
|
|
5348
5353
|
groupKey: ""
|
|
5349
5354
|
}, B = i.state.menu.modules.group.find((b) => b._id === o.groupId), M = Object.entries({ ...U, items: void 0 }).filter(([, b]) => !!b), R = {
|
|
@@ -5368,8 +5373,8 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5368
5373
|
function f(U) {
|
|
5369
5374
|
var R, _;
|
|
5370
5375
|
const T = (R = s.value[d.value].groups) == null ? void 0 : R.findIndex(
|
|
5371
|
-
(
|
|
5372
|
-
), B =
|
|
5376
|
+
(x) => x._id === o.groupId
|
|
5377
|
+
), B = ve(s.value), M = { ...Bt(U), _id: o.groupId, groupKey: "" };
|
|
5373
5378
|
(T ?? -1) < 0 ? B[d.value] = {
|
|
5374
5379
|
...B[d.value],
|
|
5375
5380
|
groups: [...((_ = B[d.value]) == null ? void 0 : _.groups) || [], M]
|
|
@@ -5412,10 +5417,10 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5412
5417
|
a("update:combinations", U);
|
|
5413
5418
|
}
|
|
5414
5419
|
const w = Y(!1);
|
|
5415
|
-
|
|
5420
|
+
Te(
|
|
5416
5421
|
() => w.value,
|
|
5417
5422
|
(U) => {
|
|
5418
|
-
U && (s.value =
|
|
5423
|
+
U && (s.value = ve(o.combinations), u.value = o.combinations[0].combinationKey || "");
|
|
5419
5424
|
}
|
|
5420
5425
|
);
|
|
5421
5426
|
const g = Y();
|
|
@@ -5423,7 +5428,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5423
5428
|
show: (L = g.value) == null ? void 0 : L.show,
|
|
5424
5429
|
trigger: ($ = g.value) == null ? void 0 : $.trigger
|
|
5425
5430
|
});
|
|
5426
|
-
const { t:
|
|
5431
|
+
const { t: k } = ye();
|
|
5427
5432
|
return (U, T) => {
|
|
5428
5433
|
const B = D("fm-select"), M = D("fm-button"), R = D("fm-card");
|
|
5429
5434
|
return C(), Q(Mo, {
|
|
@@ -5434,13 +5439,13 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5434
5439
|
config: A,
|
|
5435
5440
|
group: p.value,
|
|
5436
5441
|
action: "update",
|
|
5437
|
-
title: c(
|
|
5442
|
+
title: c(k)("menu.group.update"),
|
|
5438
5443
|
"onUpdate:group": T[3] || (T[3] = (_) => f(_)),
|
|
5439
5444
|
"onSubmit:group": T[4] || (T[4] = (_) => y()),
|
|
5440
5445
|
"onStatus:show": T[5] || (T[5] = (_) => w.value = _)
|
|
5441
5446
|
}, {
|
|
5442
5447
|
default: V(({ trigger: _ }) => [
|
|
5443
|
-
|
|
5448
|
+
Ce(U.$slots, "default", { trigger: _ })
|
|
5444
5449
|
]),
|
|
5445
5450
|
"variant-section": V(() => [
|
|
5446
5451
|
u.value ? (C(), Q(R, {
|
|
@@ -5449,7 +5454,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5449
5454
|
variant: "outlined"
|
|
5450
5455
|
}, {
|
|
5451
5456
|
default: V(() => [
|
|
5452
|
-
O("p", tl, ie(c(
|
|
5457
|
+
O("p", tl, ie(c(k)("menu.group.option.variant")), 1),
|
|
5453
5458
|
O("div", nl, [
|
|
5454
5459
|
h(B, {
|
|
5455
5460
|
modelValue: u.value,
|
|
@@ -5486,15 +5491,15 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5486
5491
|
}, ll = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, ul = { class: "flex justify-between pb-16" }, cl = { class: "flex gap-8" }, dl = {
|
|
5487
5492
|
key: 1,
|
|
5488
5493
|
class: "flex flex-col items-center space-y-16"
|
|
5489
|
-
}, ml = { class: "flex flex-col items-center space-y-4 w-full" }, pl = { class: "fm-typo-en-title-sm-600" }, fl = { class: "text-fm-color-typo-secondary" }, hl = /* @__PURE__ */
|
|
5494
|
+
}, ml = { class: "flex flex-col items-center space-y-4 w-full" }, pl = { class: "fm-typo-en-title-sm-600" }, fl = { class: "text-fm-color-typo-secondary" }, hl = /* @__PURE__ */ ge({
|
|
5490
5495
|
__name: "SelectGroupDialog",
|
|
5491
5496
|
props: {
|
|
5492
5497
|
groupIds: {}
|
|
5493
5498
|
},
|
|
5494
5499
|
setup(e) {
|
|
5495
|
-
const n = e, t = Ze(), { emitData: o, emitAction: a } = gn(), i =
|
|
5500
|
+
const n = e, t = Ze(), { emitData: o, emitAction: a } = gn(), i = Ae(), r = E(() => i.rules.group), l = E(() => i.groups);
|
|
5496
5501
|
function s(y) {
|
|
5497
|
-
return
|
|
5502
|
+
return ve(y ?? []).sort((g, k) => g.position - k.position);
|
|
5498
5503
|
}
|
|
5499
5504
|
const u = E(() => s(l.value).reduce((y, w) => (y[w._id] = {
|
|
5500
5505
|
name: w.name,
|
|
@@ -5506,7 +5511,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5506
5511
|
}))
|
|
5507
5512
|
]), m = E(() => !!i.state.currentCatalogId || !!i.state.currentSchedulerId);
|
|
5508
5513
|
E(() => {
|
|
5509
|
-
const y = !i.state.currentSchedulerId, w = i.rules.group.type, g = i.version == Z.F_MENU_VERSION.enum.v3,
|
|
5514
|
+
const y = !i.state.currentSchedulerId, w = i.rules.group.type, g = i.version == Z.F_MENU_VERSION.enum.v3, k = i.rules.item.orderFromActiveOnly, L = i.rules.item.bindToVariant;
|
|
5510
5515
|
return function(U) {
|
|
5511
5516
|
return {
|
|
5512
5517
|
isDefault: (T) => !m.value && !T,
|
|
@@ -5518,7 +5523,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5518
5523
|
priceTier: i.isV4,
|
|
5519
5524
|
inventory: y ? g ? !m.value && U.type == Z.F_ADDON_GROUP_TYPE.enum.NORMAL : !m.value : !1,
|
|
5520
5525
|
orderFrom: (T) => y ? g ? U.type == Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? m.value : !!m.value == !T : m.value : !1,
|
|
5521
|
-
orderFromActiveOnly:
|
|
5526
|
+
orderFromActiveOnly: k,
|
|
5522
5527
|
showOrderFrom: y ? g ? m.value ? !0 : U.type == Z.F_ADDON_GROUP_TYPE.enum.PRODUCT : m.value : !1,
|
|
5523
5528
|
bindToVariant: L,
|
|
5524
5529
|
isOverride: m.value,
|
|
@@ -5533,11 +5538,11 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5533
5538
|
position: i.groups.length - 1,
|
|
5534
5539
|
itemsLinked: []
|
|
5535
5540
|
}));
|
|
5536
|
-
const p = Y(
|
|
5541
|
+
const p = Y(ve(n.groupIds || [])), f = Y(""), { t: v } = ye(), A = () => {
|
|
5537
5542
|
o(p.value), a("primary"), t.close();
|
|
5538
5543
|
};
|
|
5539
5544
|
return (y, w) => {
|
|
5540
|
-
const g = D("FmSearch"),
|
|
5545
|
+
const g = D("FmSearch"), k = D("FmCheckbox"), L = D("FmButton");
|
|
5541
5546
|
return d.value.length > 0 ? (C(), K("div", sl, [
|
|
5542
5547
|
O("div", null, [
|
|
5543
5548
|
h(g, {
|
|
@@ -5549,10 +5554,10 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5549
5554
|
]),
|
|
5550
5555
|
O("div", ll, [
|
|
5551
5556
|
O("div", null, [
|
|
5552
|
-
(C(!0), K(me, null,
|
|
5557
|
+
(C(!0), K(me, null, ke(d.value, ($) => (C(), K("div", {
|
|
5553
5558
|
key: $.value
|
|
5554
5559
|
}, [
|
|
5555
|
-
ct(h(
|
|
5560
|
+
ct(h(k, {
|
|
5556
5561
|
modelValue: p.value,
|
|
5557
5562
|
"onUpdate:modelValue": [
|
|
5558
5563
|
w[1] || (w[1] = (U) => p.value = U),
|
|
@@ -5608,7 +5613,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5608
5613
|
]));
|
|
5609
5614
|
};
|
|
5610
5615
|
}
|
|
5611
|
-
}), vl = /* @__PURE__ */
|
|
5616
|
+
}), vl = /* @__PURE__ */ ge({
|
|
5612
5617
|
__name: "ProductGroup",
|
|
5613
5618
|
props: {
|
|
5614
5619
|
isOverride: {
|
|
@@ -5625,12 +5630,12 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5625
5630
|
setup(e, {
|
|
5626
5631
|
emit: n
|
|
5627
5632
|
}) {
|
|
5628
|
-
const t = e, o = Ke(), a =
|
|
5633
|
+
const t = e, o = Ke(), a = Ae(), i = Ht(), r = Ze(), {
|
|
5629
5634
|
t: l
|
|
5630
|
-
} =
|
|
5631
|
-
function p(
|
|
5632
|
-
return
|
|
5633
|
-
const N =
|
|
5635
|
+
} = ye(), s = n, u = E(() => a.rules.group), d = E(() => a.rules.item), m = E(() => a.groups);
|
|
5636
|
+
function p(x, b) {
|
|
5637
|
+
return ve(b ?? []).map((q) => {
|
|
5638
|
+
const N = x.find((S) => S._id === q._id);
|
|
5634
5639
|
return {
|
|
5635
5640
|
name: (N == null ? void 0 : N.name) ?? "",
|
|
5636
5641
|
...q,
|
|
@@ -5642,11 +5647,11 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5642
5647
|
var b;
|
|
5643
5648
|
return [...v(p(m.value, t.form.groups || ((b = t.fallback) == null ? void 0 : b.groups) || [])).map((z) => z._id)];
|
|
5644
5649
|
});
|
|
5645
|
-
function v(
|
|
5646
|
-
return
|
|
5650
|
+
function v(x) {
|
|
5651
|
+
return ve(x ?? []).sort((z, q) => z.position - q.position);
|
|
5647
5652
|
}
|
|
5648
|
-
function A(
|
|
5649
|
-
const b = m.value.find((N) => N._id ===
|
|
5653
|
+
function A(x) {
|
|
5654
|
+
const b = m.value.find((N) => N._id === x);
|
|
5650
5655
|
if (!b)
|
|
5651
5656
|
return [];
|
|
5652
5657
|
const z = [];
|
|
@@ -5666,21 +5671,21 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5666
5671
|
})})` : S;
|
|
5667
5672
|
});
|
|
5668
5673
|
}
|
|
5669
|
-
const y = E(() => v(m.value).reduce((
|
|
5674
|
+
const y = E(() => v(m.value).reduce((x, b) => (x[b._id] = {
|
|
5670
5675
|
name: b.name,
|
|
5671
5676
|
type: Gt(a.items, b.items)
|
|
5672
|
-
},
|
|
5677
|
+
}, x), {})), w = E(() => [...Object.entries(y.value).map(([x, {
|
|
5673
5678
|
name: b,
|
|
5674
5679
|
type: z
|
|
5675
5680
|
}]) => ({
|
|
5676
5681
|
label: `${b} ${u.value.type ? `(${rn(z)})` : ""}`.trim(),
|
|
5677
|
-
value:
|
|
5682
|
+
value: x
|
|
5678
5683
|
}))]), g = E(() => [{
|
|
5679
5684
|
accessorKey: "name",
|
|
5680
5685
|
header: () => l("menu.product.form.group.columns.title"),
|
|
5681
5686
|
enableSorting: !1,
|
|
5682
|
-
cell: (
|
|
5683
|
-
const b =
|
|
5687
|
+
cell: (x) => {
|
|
5688
|
+
const b = x.row.original._id;
|
|
5684
5689
|
return R(b);
|
|
5685
5690
|
}
|
|
5686
5691
|
}, {
|
|
@@ -5688,9 +5693,9 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5688
5693
|
accessorKey: "type",
|
|
5689
5694
|
header: () => l("menu.product.form.group.columns.type"),
|
|
5690
5695
|
enableSorting: !1,
|
|
5691
|
-
cell: (
|
|
5696
|
+
cell: (x) => {
|
|
5692
5697
|
var z;
|
|
5693
|
-
const b =
|
|
5698
|
+
const b = x.row.original._id;
|
|
5694
5699
|
return rn((z = y.value[b]) == null ? void 0 : z.type);
|
|
5695
5700
|
}
|
|
5696
5701
|
}, {
|
|
@@ -5698,8 +5703,8 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5698
5703
|
header: () => l("menu.group.list.columns.products"),
|
|
5699
5704
|
enableSorting: !1,
|
|
5700
5705
|
size: 200,
|
|
5701
|
-
cell: (
|
|
5702
|
-
const b =
|
|
5706
|
+
cell: (x) => {
|
|
5707
|
+
const b = x.row.original._id, q = A(b).join(", ");
|
|
5703
5708
|
return h(ze.FmTooltip, {
|
|
5704
5709
|
"z-index": 51,
|
|
5705
5710
|
class: "flex",
|
|
@@ -5723,8 +5728,8 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5723
5728
|
header: "",
|
|
5724
5729
|
size: 52,
|
|
5725
5730
|
enableSorting: !1,
|
|
5726
|
-
cell: (
|
|
5727
|
-
const b =
|
|
5731
|
+
cell: (x) => {
|
|
5732
|
+
const b = x.row.original._id;
|
|
5728
5733
|
return Se("div", {
|
|
5729
5734
|
class: "flex justify-end"
|
|
5730
5735
|
}, [Se(ze.FmButton, {
|
|
@@ -5753,7 +5758,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5753
5758
|
})
|
|
5754
5759
|
})]);
|
|
5755
5760
|
}
|
|
5756
|
-
}]),
|
|
5761
|
+
}]), k = E(() => ({
|
|
5757
5762
|
type: a.version !== Z.F_MENU_VERSION.enum.v4
|
|
5758
5763
|
}));
|
|
5759
5764
|
function L() {
|
|
@@ -5763,9 +5768,9 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5763
5768
|
contentComponentProps: {
|
|
5764
5769
|
groupIds: f.value
|
|
5765
5770
|
}
|
|
5766
|
-
}).onPrimary((
|
|
5771
|
+
}).onPrimary((x) => {
|
|
5767
5772
|
var b;
|
|
5768
|
-
for (const z of
|
|
5773
|
+
for (const z of x)
|
|
5769
5774
|
if (ii(a.state.menu, z, t.form._id)) {
|
|
5770
5775
|
const q = (b = y.value[z]) == null ? void 0 : b.name;
|
|
5771
5776
|
o.open({
|
|
@@ -5777,11 +5782,11 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5777
5782
|
});
|
|
5778
5783
|
return;
|
|
5779
5784
|
}
|
|
5780
|
-
$(
|
|
5785
|
+
$(x);
|
|
5781
5786
|
});
|
|
5782
5787
|
}
|
|
5783
|
-
function $(
|
|
5784
|
-
const b =
|
|
5788
|
+
function $(x) {
|
|
5789
|
+
const b = x.reduce((z, q) => {
|
|
5785
5790
|
var S;
|
|
5786
5791
|
const N = ((S = t.form.groups) == null ? void 0 : S.find((G) => G._id === q)) || {
|
|
5787
5792
|
_id: q,
|
|
@@ -5794,35 +5799,35 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5794
5799
|
groups: b
|
|
5795
5800
|
}));
|
|
5796
5801
|
}
|
|
5797
|
-
function U(
|
|
5802
|
+
function U(x) {
|
|
5798
5803
|
var z, q, N;
|
|
5799
5804
|
if (!t.form.groups)
|
|
5800
5805
|
return;
|
|
5801
|
-
const b =
|
|
5802
|
-
b.splice(b.findIndex((S) => S._id ===
|
|
5806
|
+
const b = ve(t.form.groups);
|
|
5807
|
+
b.splice(b.findIndex((S) => S._id === x), 1);
|
|
5803
5808
|
for (const S of ((z = t.form.variant) == null ? void 0 : z.variantCombinations) || [])
|
|
5804
|
-
(N = S.groups) == null || N.splice((q = S.groups) == null ? void 0 : q.findIndex((G) => G._id ===
|
|
5809
|
+
(N = S.groups) == null || N.splice((q = S.groups) == null ? void 0 : q.findIndex((G) => G._id === x), 1);
|
|
5805
5810
|
s("replace:form", i.initDynamicGroupItem({
|
|
5806
5811
|
...t.form,
|
|
5807
5812
|
groups: b
|
|
5808
5813
|
}));
|
|
5809
5814
|
}
|
|
5810
5815
|
const T = E(() => {
|
|
5811
|
-
var
|
|
5812
|
-
return !!((
|
|
5816
|
+
var x;
|
|
5817
|
+
return !!((x = t.form.variant) != null && x.variantGroupIds.length);
|
|
5813
5818
|
}), B = E(() => {
|
|
5814
|
-
var
|
|
5815
|
-
return T.value ? (
|
|
5819
|
+
var x;
|
|
5820
|
+
return T.value ? (x = t.form.variant) == null ? void 0 : x.variantCombinations : [{
|
|
5816
5821
|
_id: t.form._id,
|
|
5817
5822
|
combinationKey: "",
|
|
5818
5823
|
groups: t.form.groups || []
|
|
5819
5824
|
}];
|
|
5820
5825
|
});
|
|
5821
|
-
function M(
|
|
5826
|
+
function M(x) {
|
|
5822
5827
|
var z;
|
|
5823
|
-
if (!
|
|
5828
|
+
if (!x) return !1;
|
|
5824
5829
|
if (d.value.overrideProductGroup) return !0;
|
|
5825
|
-
switch ((z = y.value[
|
|
5830
|
+
switch ((z = y.value[x]) == null ? void 0 : z.type) {
|
|
5826
5831
|
case Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC:
|
|
5827
5832
|
return !0;
|
|
5828
5833
|
case Z.F_ADDON_GROUP_TYPE.enum.PRODUCT:
|
|
@@ -5833,18 +5838,18 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5833
5838
|
return !1;
|
|
5834
5839
|
}
|
|
5835
5840
|
}
|
|
5836
|
-
|
|
5837
|
-
const R = (
|
|
5841
|
+
Te(() => m.value.length, () => $([...f.value, m.value[m.value.length - 1]._id]));
|
|
5842
|
+
const R = (x) => {
|
|
5838
5843
|
var b;
|
|
5839
|
-
return (b = w.value.find((z) => z.value ===
|
|
5840
|
-
}, _ = (
|
|
5844
|
+
return (b = w.value.find((z) => z.value === x)) == null ? void 0 : b.label;
|
|
5845
|
+
}, _ = (x) => {
|
|
5841
5846
|
var b;
|
|
5842
5847
|
T.value ? s("update:form", "variant", {
|
|
5843
5848
|
variantGroupIds: ((b = t.form.variant) == null ? void 0 : b.variantGroupIds) || [],
|
|
5844
|
-
variantCombinations:
|
|
5845
|
-
}) : s("update:form", "groups",
|
|
5849
|
+
variantCombinations: x
|
|
5850
|
+
}) : s("update:form", "groups", x[0].groups || []);
|
|
5846
5851
|
};
|
|
5847
|
-
return (
|
|
5852
|
+
return (x, b) => {
|
|
5848
5853
|
const z = D("FmButton"), q = D("FmTable");
|
|
5849
5854
|
return C(), Q(Le, {
|
|
5850
5855
|
title: c(l)("menu.product.form.group.title"),
|
|
@@ -5863,7 +5868,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5863
5868
|
return [((N = f.value) == null ? void 0 : N.length) > 0 ? (C(), Q(q, {
|
|
5864
5869
|
key: 0,
|
|
5865
5870
|
"column-defs": g.value,
|
|
5866
|
-
"column-visibility":
|
|
5871
|
+
"column-visibility": k.value,
|
|
5867
5872
|
"row-data": f.value.map((S) => ({
|
|
5868
5873
|
_id: S
|
|
5869
5874
|
})),
|
|
@@ -5883,7 +5888,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5883
5888
|
class: "xs:overflow-x-scroll"
|
|
5884
5889
|
}, bl = {
|
|
5885
5890
|
class: "xs:min-w-[640px]"
|
|
5886
|
-
}, yl = /* @__PURE__ */
|
|
5891
|
+
}, yl = /* @__PURE__ */ ge({
|
|
5887
5892
|
__name: "ProductInventory",
|
|
5888
5893
|
props: {
|
|
5889
5894
|
isOverride: {
|
|
@@ -5902,16 +5907,16 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5902
5907
|
}) {
|
|
5903
5908
|
const {
|
|
5904
5909
|
t
|
|
5905
|
-
} =
|
|
5906
|
-
function m(
|
|
5907
|
-
const L =
|
|
5908
|
-
L.lowStockThreshold =
|
|
5910
|
+
} = ye(), o = e, a = n, i = Ae(), r = E(() => i.rules.item), l = E(() => r.value.inventory), s = E(() => i.state.menu.lowStockThreshold), u = E(() => o.form.lowStockThreshold), d = E(() => s.value != null ? String(s.value) : t("menu.inventory.threshold.not_set"));
|
|
5911
|
+
function m(k) {
|
|
5912
|
+
const L = Re.clone(o.form);
|
|
5913
|
+
L.lowStockThreshold = k === null ? void 0 : k, a("replace:form", L);
|
|
5909
5914
|
}
|
|
5910
|
-
function p(
|
|
5915
|
+
function p(k, L, $, U) {
|
|
5911
5916
|
return !L || L && L.length === 0 ? [{
|
|
5912
5917
|
_id: "",
|
|
5913
5918
|
name: $ || "",
|
|
5914
|
-
binding:
|
|
5919
|
+
binding: k || []
|
|
5915
5920
|
}] : L.map((T) => ({
|
|
5916
5921
|
_id: T.combinationKey || "",
|
|
5917
5922
|
name: Qn(T.combinationKey || "", U),
|
|
@@ -5919,20 +5924,20 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5919
5924
|
}));
|
|
5920
5925
|
}
|
|
5921
5926
|
const f = E(() => {
|
|
5922
|
-
var
|
|
5923
|
-
return o.form.name || ((
|
|
5927
|
+
var k;
|
|
5928
|
+
return o.form.name || ((k = o.fallback) == null ? void 0 : k.name) || "";
|
|
5924
5929
|
}), v = E(() => {
|
|
5925
|
-
var
|
|
5926
|
-
return p(o.form.inventoryBindings || [], ((
|
|
5930
|
+
var k;
|
|
5931
|
+
return p(o.form.inventoryBindings || [], ((k = o.form.variant) == null ? void 0 : k.variantCombinations) || [], f.value, i.variants);
|
|
5927
5932
|
});
|
|
5928
|
-
function A(
|
|
5933
|
+
function A(k, L) {
|
|
5929
5934
|
var B, M;
|
|
5930
|
-
let $ =
|
|
5935
|
+
let $ = Re.clone(o.form);
|
|
5931
5936
|
const U = $.variant;
|
|
5932
5937
|
if ((((B = U == null ? void 0 : U.variantCombinations) == null ? void 0 : B.length) ?? 0) > 0 && U) {
|
|
5933
|
-
const R = U.variantCombinations.findIndex((
|
|
5938
|
+
const R = U.variantCombinations.findIndex((x) => x.combinationKey === k);
|
|
5934
5939
|
if (R < 0) return;
|
|
5935
|
-
const _ =
|
|
5940
|
+
const _ = Re.clone(U.variantCombinations);
|
|
5936
5941
|
_[R].inventoryBindings = L, $ = {
|
|
5937
5942
|
...$,
|
|
5938
5943
|
variant: {
|
|
@@ -5955,8 +5960,8 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5955
5960
|
accessorKey: "_skuLinked",
|
|
5956
5961
|
header: () => t("menu.inventory.columns.ingredient"),
|
|
5957
5962
|
enableSorting: !1,
|
|
5958
|
-
cell: (
|
|
5959
|
-
const L =
|
|
5963
|
+
cell: (k) => {
|
|
5964
|
+
const L = k.getValue();
|
|
5960
5965
|
return L ? t("menu.inventory.status.sku_linked", {
|
|
5961
5966
|
count: L
|
|
5962
5967
|
}) : t("menu.inventory.status.not_set");
|
|
@@ -5965,8 +5970,8 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5965
5970
|
accessorKey: "_recipeLinked",
|
|
5966
5971
|
header: () => t("menu.inventory.columns.recipe"),
|
|
5967
5972
|
enableSorting: !1,
|
|
5968
|
-
cell: (
|
|
5969
|
-
const L =
|
|
5973
|
+
cell: (k) => {
|
|
5974
|
+
const L = k.getValue();
|
|
5970
5975
|
return L ? t("menu.inventory.status.recipe_linked", {
|
|
5971
5976
|
count: L
|
|
5972
5977
|
}) : t("menu.inventory.status.not_set");
|
|
@@ -5975,8 +5980,8 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
5975
5980
|
id: "action",
|
|
5976
5981
|
size: 52,
|
|
5977
5982
|
enableSorting: !1,
|
|
5978
|
-
cell: (
|
|
5979
|
-
const L =
|
|
5983
|
+
cell: (k) => {
|
|
5984
|
+
const L = k.row.original;
|
|
5980
5985
|
return l.value ? h("div", {
|
|
5981
5986
|
class: "flex items-center justify-end"
|
|
5982
5987
|
}, [h(hn, {
|
|
@@ -6002,21 +6007,21 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6002
6007
|
}]);
|
|
6003
6008
|
const y = Y([]);
|
|
6004
6009
|
async function w({
|
|
6005
|
-
_id:
|
|
6010
|
+
_id: k
|
|
6006
6011
|
}) {
|
|
6007
6012
|
for (const L of y.value)
|
|
6008
|
-
L.getKey() ===
|
|
6013
|
+
L.getKey() === k && L.trigger(!0);
|
|
6009
6014
|
}
|
|
6010
6015
|
const g = eo();
|
|
6011
6016
|
return ft(() => {
|
|
6012
6017
|
g.readInventory();
|
|
6013
|
-
}), (
|
|
6018
|
+
}), (k, L) => {
|
|
6014
6019
|
const $ = D("FmStepperField");
|
|
6015
6020
|
return C(), K(me, null, [h(Le, {
|
|
6016
6021
|
title: c(t)("menu.inventory.title"),
|
|
6017
6022
|
subTitle: c(t)("menu.inventory.subtitle")
|
|
6018
6023
|
}, {
|
|
6019
|
-
default: V(() => [O("div", gl, [O("div", bl, [(C(!0), K(me, null,
|
|
6024
|
+
default: V(() => [O("div", gl, [O("div", bl, [(C(!0), K(me, null, ke(v.value, (U) => (C(), Q(c(hn), {
|
|
6020
6025
|
key: U._id,
|
|
6021
6026
|
ref_for: !0,
|
|
6022
6027
|
ref_key: "inventoryManagerForms",
|
|
@@ -6035,7 +6040,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6035
6040
|
onRowClick: w
|
|
6036
6041
|
}, null, 8, ["row-data"])])])]),
|
|
6037
6042
|
_: 1
|
|
6038
|
-
}, 8, ["title", "subTitle"]), !
|
|
6043
|
+
}, 8, ["title", "subTitle"]), !k.isOverride && c(i).isV4 ? (C(), K(me, {
|
|
6039
6044
|
key: 0
|
|
6040
6045
|
}, [L[0] || (L[0] = O("div", {
|
|
6041
6046
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
@@ -6069,7 +6074,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6069
6074
|
}, Al = { class: "w-[258px] xs:w-full" }, Ml = {
|
|
6070
6075
|
key: 1,
|
|
6071
6076
|
class: "space-y-8"
|
|
6072
|
-
}, El = { class: "pl-32 pb-4 flex space-x-16" }, Tl = { class: "w-[258px] xs:w-full" }, Vl = /* @__PURE__ */
|
|
6077
|
+
}, El = { class: "pl-32 pb-4 flex space-x-16" }, Tl = { class: "w-[258px] xs:w-full" }, Vl = /* @__PURE__ */ ge({
|
|
6073
6078
|
__name: "ProductPrice",
|
|
6074
6079
|
props: {
|
|
6075
6080
|
isOverride: { type: Boolean },
|
|
@@ -6079,10 +6084,10 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6079
6084
|
},
|
|
6080
6085
|
emits: ["update:form"],
|
|
6081
6086
|
setup(e, { emit: n }) {
|
|
6082
|
-
const t = e, o = Ot(), a =
|
|
6087
|
+
const t = e, o = Ot(), a = Ae(), i = to(), { t: r } = ye(), l = n, s = E(() => a.rules.item), u = E(() => {
|
|
6083
6088
|
var L, $;
|
|
6084
|
-
const g = t.isOverride ? ((L = t.fallback) == null ? void 0 : L.unit) ?? (($ = t.fallback) == null ? void 0 : $.perXUnit) : void 0,
|
|
6085
|
-
return
|
|
6089
|
+
const g = t.isOverride ? ((L = t.fallback) == null ? void 0 : L.unit) ?? (($ = t.fallback) == null ? void 0 : $.perXUnit) : void 0, k = t.form.unit ?? t.form.perXUnit ?? g;
|
|
6090
|
+
return k != null;
|
|
6086
6091
|
}), d = (g) => {
|
|
6087
6092
|
l("update:form", "unit", g ? "" : void 0), l("update:form", "perXUnit", g ? 0 : void 0);
|
|
6088
6093
|
}, m = E(() => {
|
|
@@ -6097,13 +6102,13 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6097
6102
|
);
|
|
6098
6103
|
});
|
|
6099
6104
|
function f(g) {
|
|
6100
|
-
const
|
|
6105
|
+
const k = g.replace(/[^0-9.]/g, "");
|
|
6101
6106
|
if (!g) return !1;
|
|
6102
|
-
l("update:form", "perXUnit", parseFloat(
|
|
6107
|
+
l("update:form", "perXUnit", parseFloat(k));
|
|
6103
6108
|
}
|
|
6104
6109
|
function v(g) {
|
|
6105
6110
|
if (!g && t.form.perXUnit) {
|
|
6106
|
-
const [
|
|
6111
|
+
const [k, L] = t.form.perXUnit.toString().split(".");
|
|
6107
6112
|
if (L && L.length > 4) {
|
|
6108
6113
|
const U = (typeof t.form.perXUnit == "string" ? parseFloat(t.form.perXUnit) : t.form.perXUnit).toFixed(4);
|
|
6109
6114
|
l("update:form", "perXUnit", parseFloat(U));
|
|
@@ -6117,9 +6122,9 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6117
6122
|
async function y() {
|
|
6118
6123
|
const g = t.form.name || "";
|
|
6119
6124
|
if (!g) {
|
|
6120
|
-
const
|
|
6121
|
-
if (
|
|
6122
|
-
|
|
6125
|
+
const k = document.getElementById("product-name");
|
|
6126
|
+
if (k) {
|
|
6127
|
+
k.focus();
|
|
6123
6128
|
return;
|
|
6124
6129
|
} else
|
|
6125
6130
|
return;
|
|
@@ -6130,10 +6135,10 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6130
6135
|
});
|
|
6131
6136
|
}
|
|
6132
6137
|
const w = E(() => {
|
|
6133
|
-
var g,
|
|
6134
|
-
return ((g = a.currentCatalog) == null ? void 0 : g.priceTierRules) ?? ((
|
|
6138
|
+
var g, k;
|
|
6139
|
+
return ((g = a.currentCatalog) == null ? void 0 : g.priceTierRules) ?? ((k = a.currentCatalog) == null ? void 0 : k.usePriceTiers) ?? [];
|
|
6135
6140
|
});
|
|
6136
|
-
return (g,
|
|
6141
|
+
return (g, k) => {
|
|
6137
6142
|
const L = D("fm-select"), $ = D("FmButton"), U = D("fm-checkbox"), T = D("fm-text-field"), B = Kn("tooltip");
|
|
6138
6143
|
return C(), Q(Le, {
|
|
6139
6144
|
title: c(r)("menu.product.form.price.title")
|
|
@@ -6153,7 +6158,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6153
6158
|
class: "w-[258px] xs:w-full",
|
|
6154
6159
|
label: c(r)("menu.product.form.price.fields.selling_price.label"),
|
|
6155
6160
|
"show-currency": "",
|
|
6156
|
-
"onUpdate:modelValue":
|
|
6161
|
+
"onUpdate:modelValue": k[0] || (k[0] = (R) => R && l("update:form", "price", R))
|
|
6157
6162
|
}, {
|
|
6158
6163
|
append: V(() => [
|
|
6159
6164
|
ct(h(c(Jn), {
|
|
@@ -6176,7 +6181,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6176
6181
|
placeholder: "--",
|
|
6177
6182
|
class: "flex-1",
|
|
6178
6183
|
"shift-menu": "",
|
|
6179
|
-
"onUpdate:modelValue":
|
|
6184
|
+
"onUpdate:modelValue": k[1] || (k[1] = (R) => l("update:form", "taxes", [c(Xt).decodeTax(R)]))
|
|
6180
6185
|
}, null, 8, ["disabled", "items", "label", "model-value"])
|
|
6181
6186
|
]),
|
|
6182
6187
|
!g.isOverride && c(a).isV4 ? (C(), Q(it, {
|
|
@@ -6200,7 +6205,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6200
6205
|
"price-tiers": c(i).priceTiers.value,
|
|
6201
6206
|
"model-value": g.form.priceTiers || ((R = g.fallback) == null ? void 0 : R.priceTiers) || {},
|
|
6202
6207
|
"allow-negative-price": !1,
|
|
6203
|
-
"onUpdate:modelValue":
|
|
6208
|
+
"onUpdate:modelValue": k[2] || (k[2] = (_) => l("update:form", "priceTiers", _))
|
|
6204
6209
|
}, null, 8, ["price-tiers", "model-value"]))
|
|
6205
6210
|
];
|
|
6206
6211
|
}),
|
|
@@ -6210,7 +6215,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6210
6215
|
label: c(r)("menu.product.form.price.settings.title")
|
|
6211
6216
|
}, {
|
|
6212
6217
|
default: V(() => {
|
|
6213
|
-
var R, _,
|
|
6218
|
+
var R, _, x;
|
|
6214
6219
|
return [
|
|
6215
6220
|
O("div", wl, [
|
|
6216
6221
|
h(U, {
|
|
@@ -6219,7 +6224,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6219
6224
|
value: g.form.openPrice,
|
|
6220
6225
|
label: c(r)("menu.product.form.price.settings.open_price.label"),
|
|
6221
6226
|
sublabel: c(r)("menu.product.form.price.settings.open_price.sublabel"),
|
|
6222
|
-
"onUpdate:modelValue":
|
|
6227
|
+
"onUpdate:modelValue": k[3] || (k[3] = (b) => l("update:form", "openPrice", b))
|
|
6223
6228
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
6224
6229
|
O("div", kl, [
|
|
6225
6230
|
h(U, {
|
|
@@ -6250,12 +6255,12 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6250
6255
|
O("div", Fl, [
|
|
6251
6256
|
h(T, {
|
|
6252
6257
|
disabled: !s.value.unit,
|
|
6253
|
-
"model-value": g.form.unit || ((
|
|
6258
|
+
"model-value": g.form.unit || ((x = g.fallback) == null ? void 0 : x.unit) || null,
|
|
6254
6259
|
rules: [
|
|
6255
6260
|
(b) => !!b || c(r)("menu.product.form.price.settings.sell_by_unit.unit.required")
|
|
6256
6261
|
],
|
|
6257
6262
|
placeholder: c(r)("menu.product.form.price.settings.sell_by_unit.unit.placeholder"),
|
|
6258
|
-
"onUpdate:modelValue":
|
|
6263
|
+
"onUpdate:modelValue": k[4] || (k[4] = (b) => l("update:form", "unit", b))
|
|
6259
6264
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
6260
6265
|
])
|
|
6261
6266
|
])) : ne("", !0)
|
|
@@ -6265,7 +6270,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6265
6270
|
"model-value": !!g.form.costing,
|
|
6266
6271
|
value: !!g.form.costing,
|
|
6267
6272
|
label: c(r)("menu.product.form.price.settings.track_costing.label"),
|
|
6268
|
-
"onUpdate:modelValue":
|
|
6273
|
+
"onUpdate:modelValue": k[5] || (k[5] = (b) => l("update:form", "costing", b ? c($e.Dinero).zero().toObject() : void 0))
|
|
6269
6274
|
}, null, 8, ["model-value", "value", "label"]),
|
|
6270
6275
|
g.form.costing ? (C(), K("div", Rl, [
|
|
6271
6276
|
O("div", Al, [
|
|
@@ -6275,7 +6280,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6275
6280
|
"model-value": g.form.costing || null,
|
|
6276
6281
|
nullable: "",
|
|
6277
6282
|
"show-currency": "",
|
|
6278
|
-
"onUpdate:modelValue":
|
|
6283
|
+
"onUpdate:modelValue": k[6] || (k[6] = (b) => l("update:form", "costing", b ?? c($e.Dinero).zero().toObject()))
|
|
6279
6284
|
}, null, 8, ["model-value"])
|
|
6280
6285
|
])
|
|
6281
6286
|
])) : ne("", !0)
|
|
@@ -6286,7 +6291,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6286
6291
|
"model-value": !!g.form.minPrice,
|
|
6287
6292
|
value: !!g.form.minPrice,
|
|
6288
6293
|
label: c(r)("menu.product.form.price.settings.min_price.label"),
|
|
6289
|
-
"onUpdate:modelValue":
|
|
6294
|
+
"onUpdate:modelValue": k[7] || (k[7] = (b) => l("update:form", "minPrice", b ? c($e.Dinero).zero().toObject() : void 0))
|
|
6290
6295
|
}, null, 8, ["disabled", "model-value", "value", "label"]),
|
|
6291
6296
|
O("div", El, [
|
|
6292
6297
|
O("div", Tl, [
|
|
@@ -6297,7 +6302,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6297
6302
|
"model-value": g.form.minPrice || null,
|
|
6298
6303
|
class: "flex-1",
|
|
6299
6304
|
"show-currency": "",
|
|
6300
|
-
"onUpdate:modelValue":
|
|
6305
|
+
"onUpdate:modelValue": k[8] || (k[8] = (b) => l("update:form", "minPrice", b ?? c($e.Dinero).zero().toObject()))
|
|
6301
6306
|
}, null, 8, ["max", "model-value"])) : ne("", !0)
|
|
6302
6307
|
])
|
|
6303
6308
|
])
|
|
@@ -6313,19 +6318,19 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6313
6318
|
}, 8, ["title"]);
|
|
6314
6319
|
};
|
|
6315
6320
|
}
|
|
6316
|
-
}), zl = { class: "fm-typo-en-title-md-600" }, Il = { class: "pt-8 space-y-24" }, Dl = { class: "flex gap-8 items-center justify-start" }, Pl = /* @__PURE__ */
|
|
6321
|
+
}), zl = { class: "fm-typo-en-title-md-600" }, Il = { class: "pt-8 space-y-24" }, Dl = { class: "flex gap-8 items-center justify-start" }, Pl = /* @__PURE__ */ ge({
|
|
6317
6322
|
__name: "Form",
|
|
6318
6323
|
props: {
|
|
6319
6324
|
initialValue: {},
|
|
6320
6325
|
applyProduct: { type: Boolean }
|
|
6321
6326
|
},
|
|
6322
6327
|
setup(e) {
|
|
6323
|
-
const { t: n } =
|
|
6328
|
+
const { t: n } = ye(), t = e, o = ot(nt(Ke())), a = E(
|
|
6324
6329
|
() => t.initialValue ? n("menu.print_dept.update") : n("menu.print_dept.add")
|
|
6325
6330
|
), i = E(
|
|
6326
6331
|
() => t.initialValue ? n("menu.common.actions.update") : n("menu.common.actions.add")
|
|
6327
6332
|
), r = Y(
|
|
6328
|
-
t.initialValue ?
|
|
6333
|
+
t.initialValue ? ve(t.initialValue) : { ...Ge.generator.initMenuV4PrintDepartment(), usedBy: [] }
|
|
6329
6334
|
), l = Y(!1), s = Y(!1), u = (m) => {
|
|
6330
6335
|
wt.isBoolean(m) ? s.value = m : s.value = !s.value;
|
|
6331
6336
|
};
|
|
@@ -6355,15 +6360,15 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6355
6360
|
l.value = !1;
|
|
6356
6361
|
}
|
|
6357
6362
|
}
|
|
6358
|
-
return
|
|
6363
|
+
return Te(
|
|
6359
6364
|
() => s.value,
|
|
6360
6365
|
(m) => {
|
|
6361
|
-
m && (r.value = t.initialValue ?
|
|
6366
|
+
m && (r.value = t.initialValue ? ve(t.initialValue) : { ...Ge.generator.initMenuV4PrintDepartment(), usedBy: [] });
|
|
6362
6367
|
}
|
|
6363
6368
|
), (m, p) => {
|
|
6364
6369
|
const f = D("fm-text-field"), v = D("fm-button"), A = D("fm-side-sheet");
|
|
6365
6370
|
return C(), K(me, null, [
|
|
6366
|
-
|
|
6371
|
+
Ce(m.$slots, "default", { trigger: u }),
|
|
6367
6372
|
h(A, {
|
|
6368
6373
|
id: "variant-form",
|
|
6369
6374
|
modelValue: s.value,
|
|
@@ -6424,7 +6429,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6424
6429
|
], 64);
|
|
6425
6430
|
};
|
|
6426
6431
|
}
|
|
6427
|
-
}), $l = Pl, Ul = { class: "space-y-16" }, Nl = { class: "flex items-center space-x-4" }, Ll = { class: "handle" }, Bl = { class: "pt-16" }, jl = /* @__PURE__ */
|
|
6432
|
+
}), $l = Pl, Ul = { class: "space-y-16" }, Nl = { class: "flex items-center space-x-4" }, Ll = { class: "handle" }, Bl = { class: "pt-16" }, jl = /* @__PURE__ */ ge({
|
|
6428
6433
|
__name: "ProductPrint",
|
|
6429
6434
|
props: {
|
|
6430
6435
|
isOverride: { type: Boolean },
|
|
@@ -6435,7 +6440,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6435
6440
|
},
|
|
6436
6441
|
emits: ["update:form", "replace:form"],
|
|
6437
6442
|
setup(e, { emit: n }) {
|
|
6438
|
-
const t = e, o =
|
|
6443
|
+
const t = e, o = Ae(), { t: a } = ye(), i = n;
|
|
6439
6444
|
function r() {
|
|
6440
6445
|
return {
|
|
6441
6446
|
...Ge.generator.initMenuV4PrintSetting(),
|
|
@@ -6449,7 +6454,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6449
6454
|
}), d = E(() => {
|
|
6450
6455
|
var w;
|
|
6451
6456
|
return u.value ? s.value.reduce(
|
|
6452
|
-
(g, { _id:
|
|
6457
|
+
(g, { _id: k }) => (g.includes(k) || (g = [...g, k]), g),
|
|
6453
6458
|
[...((w = t.form.print) == null ? void 0 : w.department) ?? []]
|
|
6454
6459
|
) : s.value.map(({ _id: g }) => g);
|
|
6455
6460
|
}), m = E(() => s.value.reduce((w, g) => (w[g._id] = g.name, w), {}));
|
|
@@ -6472,18 +6477,18 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6472
6477
|
...r(),
|
|
6473
6478
|
...t.form.print,
|
|
6474
6479
|
department: w.filter((g) => {
|
|
6475
|
-
var
|
|
6476
|
-
return (((
|
|
6480
|
+
var k;
|
|
6481
|
+
return (((k = t.form.print) == null ? void 0 : k.department) ?? []).includes(g);
|
|
6477
6482
|
})
|
|
6478
6483
|
});
|
|
6479
6484
|
}
|
|
6480
6485
|
function A(w, g) {
|
|
6481
6486
|
var L, $;
|
|
6482
|
-
let
|
|
6483
|
-
g && !
|
|
6487
|
+
let k = [...(($ = (L = t.form) == null ? void 0 : L.print) == null ? void 0 : $.department) ?? []];
|
|
6488
|
+
g && !k.includes(w) ? k = [...k, w] : g || (k = k.filter((U) => U !== w)), i("update:form", "print", {
|
|
6484
6489
|
...r(),
|
|
6485
6490
|
...t.form.print,
|
|
6486
|
-
department:
|
|
6491
|
+
department: k
|
|
6487
6492
|
});
|
|
6488
6493
|
}
|
|
6489
6494
|
const y = E(() => [
|
|
@@ -6498,11 +6503,11 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6498
6503
|
description: a("menu.product.form.print.kds.options.sequential.description")
|
|
6499
6504
|
}
|
|
6500
6505
|
]);
|
|
6501
|
-
return
|
|
6506
|
+
return Te(
|
|
6502
6507
|
() => s.value.length,
|
|
6503
6508
|
() => A(s.value[s.value.length - 1]._id, !0)
|
|
6504
6509
|
), (w, g) => {
|
|
6505
|
-
const
|
|
6510
|
+
const k = D("fm-switch"), L = D("fm-radio"), $ = D("fm-radio-group"), U = D("fm-button"), T = D("fm-checkbox");
|
|
6506
6511
|
return C(), Q(Le, {
|
|
6507
6512
|
title: c(a)("menu.product.form.print.title")
|
|
6508
6513
|
}, {
|
|
@@ -6516,7 +6521,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6516
6521
|
default: V(() => {
|
|
6517
6522
|
var M;
|
|
6518
6523
|
return [
|
|
6519
|
-
h(
|
|
6524
|
+
h(k, {
|
|
6520
6525
|
"model-value": !((M = w.form.print) != null && M.toRoot),
|
|
6521
6526
|
label: c(a)("menu.product.form.print.config.group_parent.label"),
|
|
6522
6527
|
"label-placement": "right",
|
|
@@ -6534,7 +6539,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6534
6539
|
}, {
|
|
6535
6540
|
default: V(() => [
|
|
6536
6541
|
O("div", Ul, [
|
|
6537
|
-
(C(!0), K(me, null,
|
|
6542
|
+
(C(!0), K(me, null, ke(y.value, (M, R) => (C(), Q(L, {
|
|
6538
6543
|
key: R,
|
|
6539
6544
|
label: M.label,
|
|
6540
6545
|
sublabel: M.description,
|
|
@@ -6557,7 +6562,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6557
6562
|
class: "space-y-16"
|
|
6558
6563
|
}, {
|
|
6559
6564
|
item: V(({ element: M }) => {
|
|
6560
|
-
var R, _,
|
|
6565
|
+
var R, _, x, b, z;
|
|
6561
6566
|
return [
|
|
6562
6567
|
O("div", Nl, [
|
|
6563
6568
|
O("div", Ll, [
|
|
@@ -6573,7 +6578,7 @@ const Zs = { class: "fm-typo-en-title-md-600" }, Qs = {
|
|
|
6573
6578
|
]),
|
|
6574
6579
|
h(T, {
|
|
6575
6580
|
id: M,
|
|
6576
|
-
"data-checked": (b = (
|
|
6581
|
+
"data-checked": (b = (x = t.form.print) == null ? void 0 : x.department) == null ? void 0 : b.includes(M),
|
|
6577
6582
|
label: m.value[M],
|
|
6578
6583
|
"model-value": (((z = t.form.print) == null ? void 0 : z.department) ?? []).includes(M),
|
|
6579
6584
|
value: M,
|
|
@@ -6622,7 +6627,7 @@ function Gl(e, n, t) {
|
|
|
6622
6627
|
onUpdate: (u) => {
|
|
6623
6628
|
var d, m;
|
|
6624
6629
|
if (n("update:form", "takeawayUsed", u), a.value) {
|
|
6625
|
-
const p =
|
|
6630
|
+
const p = ve(((d = e.form.variant) == null ? void 0 : d.variantCombinations) || []);
|
|
6626
6631
|
p.forEach((f) => {
|
|
6627
6632
|
f.takeawayUsed || (f.takeawayUsed = u);
|
|
6628
6633
|
}), n("update:form", "variant", {
|
|
@@ -6641,7 +6646,7 @@ function Gl(e, n, t) {
|
|
|
6641
6646
|
takeaway: d.takeawayUsed,
|
|
6642
6647
|
onUpdate: (p) => {
|
|
6643
6648
|
var v, A;
|
|
6644
|
-
const f =
|
|
6649
|
+
const f = ve(((v = e.form.variant) == null ? void 0 : v.variantCombinations) || []);
|
|
6645
6650
|
f[m].takeawayUsed = p, n("update:form", "variant", {
|
|
6646
6651
|
variantGroupIds: ((A = e.form.variant) == null ? void 0 : A.variantGroupIds) || [],
|
|
6647
6652
|
variantCombinations: f
|
|
@@ -6659,7 +6664,7 @@ function Gl(e, n, t) {
|
|
|
6659
6664
|
}
|
|
6660
6665
|
const Kl = {
|
|
6661
6666
|
class: "flex flex-col gap-16"
|
|
6662
|
-
}, Wl = /* @__PURE__ */
|
|
6667
|
+
}, Wl = /* @__PURE__ */ ge({
|
|
6663
6668
|
__name: "ProductTakeaway",
|
|
6664
6669
|
props: {
|
|
6665
6670
|
isOverride: {
|
|
@@ -6676,9 +6681,9 @@ const Kl = {
|
|
|
6676
6681
|
setup(e, {
|
|
6677
6682
|
emit: n
|
|
6678
6683
|
}) {
|
|
6679
|
-
const t = e, o =
|
|
6684
|
+
const t = e, o = Ae(), a = E(() => o.rules.item), i = ot(nt(Ke())), {
|
|
6680
6685
|
t: r
|
|
6681
|
-
} =
|
|
6686
|
+
} = ye(), l = n, {
|
|
6682
6687
|
hasVariant: s,
|
|
6683
6688
|
takeaways: u
|
|
6684
6689
|
} = Gl(t, l, a), d = E(() => [t.isOverride ? {
|
|
@@ -6704,17 +6709,17 @@ const Kl = {
|
|
|
6704
6709
|
action: "add",
|
|
6705
6710
|
applyProduct: !1,
|
|
6706
6711
|
bindToVariant: o.rules.item.bindToVariant,
|
|
6707
|
-
"onUpdate:takeaway": async (
|
|
6712
|
+
"onUpdate:takeaway": async (k) => {
|
|
6708
6713
|
await i.updateMenu({
|
|
6709
6714
|
module: Z.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
6710
6715
|
operation: Fe.F_OPERATION_TYPE.create,
|
|
6711
|
-
data:
|
|
6712
|
-
link: ln(
|
|
6713
|
-
},
|
|
6716
|
+
data: k,
|
|
6717
|
+
link: ln(k.usedBy || [])
|
|
6718
|
+
}, k.name);
|
|
6714
6719
|
}
|
|
6715
6720
|
}, {
|
|
6716
6721
|
default: ({
|
|
6717
|
-
trigger:
|
|
6722
|
+
trigger: k
|
|
6718
6723
|
}) => Se(ze.FmSelect, {
|
|
6719
6724
|
modelValue: w || null,
|
|
6720
6725
|
menuZIndex: 103,
|
|
@@ -6727,7 +6732,7 @@ const Kl = {
|
|
|
6727
6732
|
"append-menu": () => o.rules.takeaway.create ? Se("button", {
|
|
6728
6733
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
6729
6734
|
type: "button",
|
|
6730
|
-
onClick:
|
|
6735
|
+
onClick: k
|
|
6731
6736
|
}, [Se(ze.FmIcon, {
|
|
6732
6737
|
name: "add",
|
|
6733
6738
|
size: "md",
|
|
@@ -6747,12 +6752,12 @@ const Kl = {
|
|
|
6747
6752
|
});
|
|
6748
6753
|
function f(y) {
|
|
6749
6754
|
return (w) => {
|
|
6750
|
-
const g = t.form.takeawayConfig,
|
|
6755
|
+
const g = t.form.takeawayConfig, k = {
|
|
6751
6756
|
pos: (g == null ? void 0 : g.pos) ?? !0,
|
|
6752
6757
|
app: (g == null ? void 0 : g.app) ?? !0,
|
|
6753
6758
|
[y]: w
|
|
6754
6759
|
};
|
|
6755
|
-
l("update:form", "takeawayConfig",
|
|
6760
|
+
l("update:form", "takeawayConfig", k);
|
|
6756
6761
|
};
|
|
6757
6762
|
}
|
|
6758
6763
|
const v = E({
|
|
@@ -6769,7 +6774,7 @@ const Kl = {
|
|
|
6769
6774
|
set: f("app")
|
|
6770
6775
|
});
|
|
6771
6776
|
return (y, w) => {
|
|
6772
|
-
const g = D("FmCheckbox"),
|
|
6777
|
+
const g = D("FmCheckbox"), k = D("fm-table");
|
|
6773
6778
|
return C(), Q(Le, {
|
|
6774
6779
|
title: c(r)("menu.product.form.takeaway.title"),
|
|
6775
6780
|
"sub-title": c(r)("menu.product.form.takeaway.subtitle")
|
|
@@ -6788,7 +6793,7 @@ const Kl = {
|
|
|
6788
6793
|
label: c(r)("menu.product.form.takeaway.takeawayConfig.app.label"),
|
|
6789
6794
|
sublabel: c(r)("menu.product.form.takeaway.takeawayConfig.app.sublabel"),
|
|
6790
6795
|
value: !0
|
|
6791
|
-
}, null, 8, ["modelValue", "label", "sublabel"])) : ne("", !0)]), h(
|
|
6796
|
+
}, null, 8, ["modelValue", "label", "sublabel"])) : ne("", !0)]), h(k, {
|
|
6792
6797
|
columnDefs: m.value,
|
|
6793
6798
|
"page-size": c(u).length,
|
|
6794
6799
|
"row-data": c(u),
|
|
@@ -6804,17 +6809,17 @@ const Kl = {
|
|
|
6804
6809
|
}, Hl = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, ql = { class: "flex justify-between pb-16" }, Xl = { class: "flex gap-8" }, Zl = {
|
|
6805
6810
|
key: 1,
|
|
6806
6811
|
class: "flex flex-col items-center space-y-16"
|
|
6807
|
-
}, Ql = { class: "flex flex-col items-center space-y-4 w-full" }, Jl = { class: "fm-typo-en-title-sm-600" }, eu = { class: "text-fm-color-typo-secondary" }, tu = /* @__PURE__ */
|
|
6812
|
+
}, Ql = { class: "flex flex-col items-center space-y-4 w-full" }, Jl = { class: "fm-typo-en-title-sm-600" }, eu = { class: "text-fm-color-typo-secondary" }, tu = /* @__PURE__ */ ge({
|
|
6808
6813
|
__name: "SelectVariantDialog",
|
|
6809
6814
|
props: {
|
|
6810
6815
|
selectedVariants: {}
|
|
6811
6816
|
},
|
|
6812
6817
|
setup(e) {
|
|
6813
|
-
const n = Ze(), { emitData: t, emitAction: o } = gn(), a =
|
|
6818
|
+
const n = Ze(), { emitData: t, emitAction: o } = gn(), a = Ae(), { t: i } = ye(), r = e, l = E(() => a.variants.map((m) => ({
|
|
6814
6819
|
label: m.name,
|
|
6815
6820
|
value: m._id,
|
|
6816
6821
|
disabled: !1
|
|
6817
|
-
}))), s = Y(
|
|
6822
|
+
}))), s = Y(ve(r.selectedVariants)), u = Y(""), d = () => {
|
|
6818
6823
|
t(s.value), o("primary"), n.close();
|
|
6819
6824
|
};
|
|
6820
6825
|
return (m, p) => {
|
|
@@ -6830,7 +6835,7 @@ const Kl = {
|
|
|
6830
6835
|
]),
|
|
6831
6836
|
O("div", Hl, [
|
|
6832
6837
|
O("div", null, [
|
|
6833
|
-
(C(!0), K(me, null,
|
|
6838
|
+
(C(!0), K(me, null, ke(l.value, (y) => (C(), K("div", {
|
|
6834
6839
|
key: y.value
|
|
6835
6840
|
}, [
|
|
6836
6841
|
ct(h(v, {
|
|
@@ -6898,7 +6903,7 @@ const Kl = {
|
|
|
6898
6903
|
class: "flex items-center flex-1 h-[36px] px-8 border border-fm-color-neutral-gray-300 rounded-md bg-fm-color-neutral-white"
|
|
6899
6904
|
}, au = {
|
|
6900
6905
|
class: "flex-1 fm-typo-en-body-lg-400"
|
|
6901
|
-
}, ru = /* @__PURE__ */
|
|
6906
|
+
}, ru = /* @__PURE__ */ ge({
|
|
6902
6907
|
__name: "ProductVariants",
|
|
6903
6908
|
props: {
|
|
6904
6909
|
isOverride: {
|
|
@@ -6915,27 +6920,27 @@ const Kl = {
|
|
|
6915
6920
|
setup(e, {
|
|
6916
6921
|
emit: n
|
|
6917
6922
|
}) {
|
|
6918
|
-
const t = e, o =
|
|
6923
|
+
const t = e, o = Ae(), a = Ht(), i = Ke(), r = Ze(), {
|
|
6919
6924
|
t: l
|
|
6920
|
-
} =
|
|
6925
|
+
} = ye(), s = Y(!1), u = E(() => o.rules.item), d = E(() => u.value.minPrice && !!t.form.minPrice), m = E(() => !o.state.currentCatalogId), p = E(() => o.variants.reduce((_, x) => (_[x._id] = x, _), {})), f = n;
|
|
6921
6926
|
function v(_) {
|
|
6922
|
-
const
|
|
6927
|
+
const x = Re.clone(t.form);
|
|
6923
6928
|
for (const {
|
|
6924
6929
|
key: b,
|
|
6925
6930
|
value: z
|
|
6926
6931
|
} of _)
|
|
6927
|
-
|
|
6928
|
-
f("replace:form",
|
|
6932
|
+
x[b] = z;
|
|
6933
|
+
f("replace:form", x);
|
|
6929
6934
|
}
|
|
6930
6935
|
function A(_) {
|
|
6931
6936
|
var b;
|
|
6932
|
-
const
|
|
6937
|
+
const x = w(_.combinationKey || "");
|
|
6933
6938
|
return {
|
|
6934
6939
|
..._,
|
|
6935
|
-
price:
|
|
6936
|
-
inventoryBindings: (
|
|
6937
|
-
takeawayUsed: (
|
|
6938
|
-
groups: (
|
|
6940
|
+
price: x == null ? void 0 : x.price,
|
|
6941
|
+
inventoryBindings: (x == null ? void 0 : x.inventoryBindings) || t.form.inventoryBindings,
|
|
6942
|
+
takeawayUsed: (x == null ? void 0 : x.takeawayUsed) || t.form.takeawayUsed,
|
|
6943
|
+
groups: (x == null ? void 0 : x.groups) || ((b = t.form.groups) == null ? void 0 : b.map((z) => ({
|
|
6939
6944
|
...z,
|
|
6940
6945
|
groupKey: ""
|
|
6941
6946
|
})))
|
|
@@ -6949,20 +6954,20 @@ const Kl = {
|
|
|
6949
6954
|
contentComponentProps: {
|
|
6950
6955
|
selectedVariants: ((_ = t.form.variant) == null ? void 0 : _.variantGroupIds) ?? []
|
|
6951
6956
|
}
|
|
6952
|
-
}).onPrimary(async (
|
|
6953
|
-
L(
|
|
6957
|
+
}).onPrimary(async (x) => {
|
|
6958
|
+
L(x, A);
|
|
6954
6959
|
});
|
|
6955
6960
|
}
|
|
6956
6961
|
function w(_) {
|
|
6957
6962
|
var S, G;
|
|
6958
|
-
const
|
|
6963
|
+
const x = ((S = t.form.variant) == null ? void 0 : S.variantGroupIds) || [], b = (G = t.form.variant) == null ? void 0 : G.variantCombinations, N = _.split(/(?=variant)/g).map((oe) => oe.replace(/\/*$/, "")).filter((oe) => x.some((te) => oe.includes(te))).join("/");
|
|
6959
6964
|
return b == null ? void 0 : b.find((oe) => oe.combinationKey === N);
|
|
6960
6965
|
}
|
|
6961
6966
|
const g = (_) => {
|
|
6962
6967
|
L(_);
|
|
6963
|
-
},
|
|
6964
|
-
var
|
|
6965
|
-
return (((
|
|
6968
|
+
}, k = E(() => {
|
|
6969
|
+
var x;
|
|
6970
|
+
return (((x = t.form.variant) == null ? void 0 : x.variantCombinations) || []).map((b) => {
|
|
6966
6971
|
var N, S;
|
|
6967
6972
|
const z = (S = (N = t.fallback) == null ? void 0 : N.variant) == null ? void 0 : S.variantCombinations.find(({
|
|
6968
6973
|
combinationKey: G
|
|
@@ -6981,7 +6986,7 @@ const Kl = {
|
|
|
6981
6986
|
};
|
|
6982
6987
|
});
|
|
6983
6988
|
});
|
|
6984
|
-
function L(_,
|
|
6989
|
+
function L(_, x = (b) => b) {
|
|
6985
6990
|
var q;
|
|
6986
6991
|
const b = _.filter((N) => !!N);
|
|
6987
6992
|
let z;
|
|
@@ -6990,8 +6995,8 @@ const Kl = {
|
|
|
6990
6995
|
combinationKey: G
|
|
6991
6996
|
}) => {
|
|
6992
6997
|
var te;
|
|
6993
|
-
const oe = (te = t.form.variant) == null ? void 0 : te.variantCombinations.find((
|
|
6994
|
-
return
|
|
6998
|
+
const oe = (te = t.form.variant) == null ? void 0 : te.variantCombinations.find((be) => be.combinationKey === G);
|
|
6999
|
+
return x(oe || {
|
|
6995
7000
|
_id: t.form._id,
|
|
6996
7001
|
combinationKey: G
|
|
6997
7002
|
});
|
|
@@ -7028,16 +7033,16 @@ const Kl = {
|
|
|
7028
7033
|
}
|
|
7029
7034
|
f("replace:form", a.initDynamicGroupItem(z));
|
|
7030
7035
|
}
|
|
7031
|
-
async function $(_,
|
|
7032
|
-
const z =
|
|
7033
|
-
z.variant.variantCombinations[_][
|
|
7036
|
+
async function $(_, x, b) {
|
|
7037
|
+
const z = Re.clone(t.form);
|
|
7038
|
+
z.variant.variantCombinations[_][x] = b, v([{
|
|
7034
7039
|
key: "variant",
|
|
7035
7040
|
value: z.variant
|
|
7036
7041
|
}]);
|
|
7037
7042
|
}
|
|
7038
7043
|
const U = E(() => {
|
|
7039
|
-
var _,
|
|
7040
|
-
return ((_ = o.currentCatalog) == null ? void 0 : _.priceTierRules) ?? ((
|
|
7044
|
+
var _, x;
|
|
7045
|
+
return ((_ = o.currentCatalog) == null ? void 0 : _.priceTierRules) ?? ((x = o.currentCatalog) == null ? void 0 : x.usePriceTiers) ?? [];
|
|
7041
7046
|
}), T = E(() => U.value.length > 0 && o.currentCatalog && !o.currentScheduler), B = E(() => [{
|
|
7042
7047
|
accessorKey: "combinationKey",
|
|
7043
7048
|
header: () => l("menu.product.form.variant.columns.variant"),
|
|
@@ -7049,18 +7054,18 @@ const Kl = {
|
|
|
7049
7054
|
enableSorting: !1,
|
|
7050
7055
|
cell: (_) => {
|
|
7051
7056
|
var N, S;
|
|
7052
|
-
const
|
|
7057
|
+
const x = _.getValue(), b = _.row.original, q = ((N = b.fallback) == null ? void 0 : N.code) ?? t.form.code ?? ((S = t.fallback) == null ? void 0 : S.code);
|
|
7053
7058
|
return h(ze.FmTextField, {
|
|
7054
|
-
modelValue:
|
|
7059
|
+
modelValue: x,
|
|
7055
7060
|
placeholder: q || l("menu.product.form.variant.placeholders.no_code"),
|
|
7056
7061
|
rules: [(G) => {
|
|
7057
7062
|
const oe = G, te = E(() => {
|
|
7058
7063
|
var I;
|
|
7059
7064
|
if (!o.state.featureFlags.uniqueProductCode || !oe) return 0;
|
|
7060
|
-
let
|
|
7061
|
-
return b.code === oe &&
|
|
7062
|
-
F.combinationKey !== b.combinationKey && F.code === oe && (
|
|
7063
|
-
}),
|
|
7065
|
+
let be = o.itemCodeMap.get(oe) || 0;
|
|
7066
|
+
return b.code === oe && be > 0 && (be -= 1), oe === q && (be += 1), (I = t.form.variant) == null || I.variantCombinations.forEach((F) => {
|
|
7067
|
+
F.combinationKey !== b.combinationKey && F.code === oe && (be += 1);
|
|
7068
|
+
}), be;
|
|
7064
7069
|
});
|
|
7065
7070
|
return s.value && te.value > 0 ? l("menu.product.form.detail.fields.code.duplicate_warning", {
|
|
7066
7071
|
count: te.value
|
|
@@ -7077,9 +7082,9 @@ const Kl = {
|
|
|
7077
7082
|
enableSorting: !1,
|
|
7078
7083
|
cell: (_) => {
|
|
7079
7084
|
var q, N;
|
|
7080
|
-
const
|
|
7085
|
+
const x = _.getValue(), z = (q = _.row.original.fallback) == null ? void 0 : q.orderFrom;
|
|
7081
7086
|
return h(Sn, {
|
|
7082
|
-
modelValue:
|
|
7087
|
+
modelValue: x,
|
|
7083
7088
|
fallback: t.form.orderFrom ?? z ?? ((N = t.fallback) == null ? void 0 : N.orderFrom),
|
|
7084
7089
|
disable: !u.value.orderFrom,
|
|
7085
7090
|
required: u.value.orderFrom && u.value.orderFromActiveOnly,
|
|
@@ -7098,13 +7103,13 @@ const Kl = {
|
|
|
7098
7103
|
enableSorting: !1,
|
|
7099
7104
|
cell: (_) => {
|
|
7100
7105
|
var N, S, G;
|
|
7101
|
-
const
|
|
7106
|
+
const x = _.getValue(), b = _.row.original, q = ((N = b.fallback) == null ? void 0 : N.price) ?? t.form.price ?? ((S = t.fallback) == null ? void 0 : S.price);
|
|
7102
7107
|
return h("div", {
|
|
7103
7108
|
class: "flex items-center gap-8"
|
|
7104
7109
|
}, [h(ut, {
|
|
7105
7110
|
disable: T.value,
|
|
7106
7111
|
placeholder: q ? vt(q) : void 0,
|
|
7107
|
-
modelValue:
|
|
7112
|
+
modelValue: x,
|
|
7108
7113
|
min: 0,
|
|
7109
7114
|
"onUpdate:model-value": (oe) => {
|
|
7110
7115
|
$(_.row.index, "price", oe);
|
|
@@ -7123,10 +7128,10 @@ const Kl = {
|
|
|
7123
7128
|
enableSorting: !1,
|
|
7124
7129
|
cell: (_) => {
|
|
7125
7130
|
var N, S, G;
|
|
7126
|
-
const
|
|
7131
|
+
const x = _.getValue(), b = _.row.original, q = ((N = b.fallback) == null ? void 0 : N.minPrice) ?? t.form.minPrice ?? ((S = t.fallback) == null ? void 0 : S.minPrice);
|
|
7127
7132
|
return h(ut, {
|
|
7128
7133
|
placeholder: q ? vt(q) : void 0,
|
|
7129
|
-
modelValue:
|
|
7134
|
+
modelValue: x,
|
|
7130
7135
|
max: $e.Dinero.fromFdoDinero(b.price ?? ((G = b.fallback) == null ? void 0 : G.price) ?? $e.Dinero.zero().toObject()).toUnit(),
|
|
7131
7136
|
"onUpdate:model-value": (oe) => {
|
|
7132
7137
|
$(_.row.index, "minPrice", oe);
|
|
@@ -7143,7 +7148,7 @@ const Kl = {
|
|
|
7143
7148
|
max: o.rules.item.maxVariant
|
|
7144
7149
|
}) : !0;
|
|
7145
7150
|
}
|
|
7146
|
-
return (_,
|
|
7151
|
+
return (_, x) => {
|
|
7147
7152
|
const b = D("fm-button"), z = D("fm-icon"), q = D("FmFormGroup"), N = D("fm-table");
|
|
7148
7153
|
return C(), Q(Le, {
|
|
7149
7154
|
title: c(l)("menu.product.form.variant.title"),
|
|
@@ -7183,7 +7188,7 @@ const Kl = {
|
|
|
7183
7188
|
}, null, 8, ["variant"]), O("div", iu, [O("p", au, ie((te = p.value[oe]) == null ? void 0 : te.name), 1), h(z, {
|
|
7184
7189
|
class: "cursor-pointer",
|
|
7185
7190
|
name: "close",
|
|
7186
|
-
onClick: Ft((
|
|
7191
|
+
onClick: Ft((be) => {
|
|
7187
7192
|
var I;
|
|
7188
7193
|
return L(((I = _.form.variant) == null ? void 0 : I.variantGroupIds.filter((F) => F !== oe)) ?? []);
|
|
7189
7194
|
}, ["stop"])
|
|
@@ -7194,13 +7199,13 @@ const Kl = {
|
|
|
7194
7199
|
}),
|
|
7195
7200
|
_: 1
|
|
7196
7201
|
}, 8, ["model-value", "rules"]), h(Oo, null, {
|
|
7197
|
-
default: V(() => [
|
|
7202
|
+
default: V(() => [k.value.length ? (C(), Q(N, {
|
|
7198
7203
|
key: 0,
|
|
7199
7204
|
class: "w-full",
|
|
7200
7205
|
"column-defs": B.value,
|
|
7201
7206
|
"column-visibility": M.value,
|
|
7202
|
-
"page-size":
|
|
7203
|
-
"row-data":
|
|
7207
|
+
"page-size": k.value.length ?? 0,
|
|
7208
|
+
"row-data": k.value ?? [],
|
|
7204
7209
|
"hide-footer": "",
|
|
7205
7210
|
"shrink-at": !1
|
|
7206
7211
|
}, null, 8, ["column-defs", "column-visibility", "page-size", "row-data"])) : ne("", !0)]),
|
|
@@ -7234,7 +7239,7 @@ const Kl = {
|
|
|
7234
7239
|
}, fu = {
|
|
7235
7240
|
key: 11,
|
|
7236
7241
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
7237
|
-
}, hu = /* @__PURE__ */
|
|
7242
|
+
}, hu = /* @__PURE__ */ ge({
|
|
7238
7243
|
__name: "Form",
|
|
7239
7244
|
props: {
|
|
7240
7245
|
initialForm: {},
|
|
@@ -7244,13 +7249,13 @@ const Kl = {
|
|
|
7244
7249
|
},
|
|
7245
7250
|
emits: ["update:show", "submit:form"],
|
|
7246
7251
|
setup(e, { emit: n }) {
|
|
7247
|
-
var
|
|
7248
|
-
const t = e, o = n, a =
|
|
7252
|
+
var xe, Oe, pe, de, Rt;
|
|
7253
|
+
const t = e, o = n, a = Ae(), i = Ot(), { t: r } = ye(), l = E(() => t.action === "add" ? r("menu.product.form.title.add") : r("menu.product.form.title.update")), s = E(() => a.rules.item), u = (ee) => new Promise((X) => setTimeout(X, ee));
|
|
7249
7254
|
ft(async () => {
|
|
7250
7255
|
t.autoShow && (await u(100), m());
|
|
7251
7256
|
});
|
|
7252
7257
|
const d = Y(!1);
|
|
7253
|
-
|
|
7258
|
+
Te(
|
|
7254
7259
|
() => d.value,
|
|
7255
7260
|
async (ee) => {
|
|
7256
7261
|
await u(500), o("update:show", ee);
|
|
@@ -7259,12 +7264,12 @@ const Kl = {
|
|
|
7259
7264
|
const m = () => {
|
|
7260
7265
|
d.value = !d.value;
|
|
7261
7266
|
}, p = Y(), f = Y(
|
|
7262
|
-
t.initialForm ?
|
|
7267
|
+
t.initialForm ? ve(t.initialForm) : {
|
|
7263
7268
|
...Ge.generator.initMenuV4Item(),
|
|
7264
7269
|
category: t.categoryId
|
|
7265
7270
|
}
|
|
7266
7271
|
), v = Y(null);
|
|
7267
|
-
|
|
7272
|
+
Te(
|
|
7268
7273
|
() => t.initialForm,
|
|
7269
7274
|
async () => {
|
|
7270
7275
|
if (t.initialForm)
|
|
@@ -7287,7 +7292,7 @@ const Kl = {
|
|
|
7287
7292
|
var ee;
|
|
7288
7293
|
return a.mapVariant((ee = f.value.variant) == null ? void 0 : ee.variantGroupIds);
|
|
7289
7294
|
}), g = Y(null);
|
|
7290
|
-
|
|
7295
|
+
Te(
|
|
7291
7296
|
() => f.value.thumbnail,
|
|
7292
7297
|
async (ee) => {
|
|
7293
7298
|
ee && (typeof ee == "string" ? g.value = await ro(ee, "thumbnail.jpg", "image/jpeg") : g.value = ee);
|
|
@@ -7296,9 +7301,9 @@ const Kl = {
|
|
|
7296
7301
|
immediate: !0
|
|
7297
7302
|
}
|
|
7298
7303
|
);
|
|
7299
|
-
const
|
|
7304
|
+
const k = (ee, X) => {
|
|
7300
7305
|
f.value = {
|
|
7301
|
-
...
|
|
7306
|
+
...ve(f.value),
|
|
7302
7307
|
[ee]: X
|
|
7303
7308
|
};
|
|
7304
7309
|
};
|
|
@@ -7319,19 +7324,19 @@ const Kl = {
|
|
|
7319
7324
|
return $.value ? f.value.category == "" || f.value.category == null && ((ee = p.value) == null ? void 0 : ee.category) == null : a.version === Z.F_MENU_VERSION.enum.v4 && f.value.category == null;
|
|
7320
7325
|
}), T = E(() => i.itemAttributeSettings.value.length > 0 && !$.value);
|
|
7321
7326
|
function B() {
|
|
7322
|
-
var
|
|
7327
|
+
var we;
|
|
7323
7328
|
const ee = a.getSelectedTax(
|
|
7324
7329
|
f.value.taxes,
|
|
7325
|
-
(
|
|
7330
|
+
(we = p.value) == null ? void 0 : we.taxes,
|
|
7326
7331
|
a.taxSetting.countryTaxOptions
|
|
7327
|
-
),
|
|
7328
|
-
return
|
|
7332
|
+
), _e = a.taxSetting.countryTaxOptions.find((ae) => ae.value === ee);
|
|
7333
|
+
return _e ? Ho(_e.meta.rate) : "-";
|
|
7329
7334
|
}
|
|
7330
7335
|
function M() {
|
|
7331
7336
|
g.value = null, f.value.thumbnail = null;
|
|
7332
7337
|
}
|
|
7333
7338
|
const R = E(() => {
|
|
7334
|
-
var ee, X,
|
|
7339
|
+
var ee, X, _e, we, ae, kt, rt, xt, ue;
|
|
7335
7340
|
return {
|
|
7336
7341
|
title: r("menu.product.form.summary.title"),
|
|
7337
7342
|
items: [
|
|
@@ -7345,11 +7350,11 @@ const Kl = {
|
|
|
7345
7350
|
},
|
|
7346
7351
|
{
|
|
7347
7352
|
name: r("menu.product.form.summary.fields.category"),
|
|
7348
|
-
value: ((
|
|
7353
|
+
value: ((_e = a.categories.find((qt) => qt._id === f.value.category)) == null ? void 0 : _e.name) || "-"
|
|
7349
7354
|
},
|
|
7350
7355
|
{
|
|
7351
7356
|
name: r("menu.product.form.summary.fields.order_from"),
|
|
7352
|
-
value: f.value.orderFrom || ((
|
|
7357
|
+
value: f.value.orderFrom || ((we = p.value) == null ? void 0 : we.orderFrom) || "-"
|
|
7353
7358
|
},
|
|
7354
7359
|
{
|
|
7355
7360
|
name: r("menu.product.form.summary.fields.selling_price"),
|
|
@@ -7365,19 +7370,19 @@ const Kl = {
|
|
|
7365
7370
|
},
|
|
7366
7371
|
{
|
|
7367
7372
|
name: r("menu.product.form.summary.fields.takeaway"),
|
|
7368
|
-
value: ((
|
|
7373
|
+
value: ((ue = a.state.menu.modules.takeaway.find(
|
|
7369
7374
|
(qt) => {
|
|
7370
7375
|
var Fn;
|
|
7371
7376
|
return qt._id === (f.value.takeawayUsed || ((Fn = p.value) == null ? void 0 : Fn.takeawayUsed));
|
|
7372
7377
|
}
|
|
7373
|
-
)) == null ? void 0 :
|
|
7378
|
+
)) == null ? void 0 : ue.name) || "-"
|
|
7374
7379
|
}
|
|
7375
7380
|
]
|
|
7376
7381
|
};
|
|
7377
7382
|
}), _ = Y(
|
|
7378
7383
|
f.value.category != null || !!f.value.code || !!f.value.orderFrom
|
|
7379
7384
|
);
|
|
7380
|
-
function
|
|
7385
|
+
function x(ee) {
|
|
7381
7386
|
ee || (f.value = {
|
|
7382
7387
|
...f.value,
|
|
7383
7388
|
name: void 0,
|
|
@@ -7389,9 +7394,9 @@ const Kl = {
|
|
|
7389
7394
|
const b = E(() => {
|
|
7390
7395
|
const ee = {};
|
|
7391
7396
|
return a.state.menu.modules.item.forEach((X) => {
|
|
7392
|
-
var
|
|
7393
|
-
for (const [
|
|
7394
|
-
typeof ae == "string" && ae && !((
|
|
7397
|
+
var _e;
|
|
7398
|
+
for (const [we, ae] of Object.entries(X.customAttributes || {}))
|
|
7399
|
+
typeof ae == "string" && ae && !((_e = ee[we]) != null && _e.includes(ae)) && (ee[we] = [...ee[we] || [], ae]);
|
|
7395
7400
|
}), ee;
|
|
7396
7401
|
}), z = Y(!!f.value.price || !!f.value.minPrice || !!f.value.costing);
|
|
7397
7402
|
function q(ee) {
|
|
@@ -7403,17 +7408,17 @@ const Kl = {
|
|
|
7403
7408
|
});
|
|
7404
7409
|
}
|
|
7405
7410
|
const N = Y(
|
|
7406
|
-
(((
|
|
7411
|
+
(((xe = f.value.variant) == null ? void 0 : xe.variantCombinations) || []).some(
|
|
7407
7412
|
(ee) => !!ee.price || !!ee.orderFrom || !!ee.code
|
|
7408
7413
|
)
|
|
7409
7414
|
);
|
|
7410
7415
|
function S(ee) {
|
|
7411
|
-
var X,
|
|
7416
|
+
var X, _e, we;
|
|
7412
7417
|
ee || (f.value = {
|
|
7413
7418
|
...f.value,
|
|
7414
7419
|
variant: {
|
|
7415
7420
|
variantGroupIds: ((X = f.value.variant) == null ? void 0 : X.variantGroupIds) || [],
|
|
7416
|
-
variantCombinations: ((
|
|
7421
|
+
variantCombinations: ((we = (_e = f.value.variant) == null ? void 0 : _e.variantCombinations) == null ? void 0 : we.map((ae) => ({
|
|
7417
7422
|
...ae,
|
|
7418
7423
|
price: void 0,
|
|
7419
7424
|
orderFrom: void 0,
|
|
@@ -7423,16 +7428,16 @@ const Kl = {
|
|
|
7423
7428
|
});
|
|
7424
7429
|
}
|
|
7425
7430
|
const G = Y(
|
|
7426
|
-
!!f.value.inventoryBindings || (((
|
|
7431
|
+
!!f.value.inventoryBindings || (((Oe = f.value.variant) == null ? void 0 : Oe.variantCombinations) || []).some((ee) => !!ee.inventoryBindings) || !1
|
|
7427
7432
|
);
|
|
7428
7433
|
function oe(ee) {
|
|
7429
|
-
var X,
|
|
7434
|
+
var X, _e, we;
|
|
7430
7435
|
ee || (f.value = {
|
|
7431
7436
|
...f.value,
|
|
7432
7437
|
inventoryBindings: void 0,
|
|
7433
7438
|
variant: f.value.variant ? {
|
|
7434
7439
|
variantGroupIds: ((X = f.value.variant) == null ? void 0 : X.variantGroupIds) || [],
|
|
7435
|
-
variantCombinations: ((
|
|
7440
|
+
variantCombinations: ((we = (_e = f.value.variant) == null ? void 0 : _e.variantCombinations) == null ? void 0 : we.map((ae) => ({
|
|
7436
7441
|
...ae,
|
|
7437
7442
|
inventoryBindings: void 0
|
|
7438
7443
|
}))) || []
|
|
@@ -7440,17 +7445,17 @@ const Kl = {
|
|
|
7440
7445
|
});
|
|
7441
7446
|
}
|
|
7442
7447
|
const te = Y(
|
|
7443
|
-
f.value.takeawayUsed != null || (((
|
|
7448
|
+
f.value.takeawayUsed != null || (((pe = f.value.variant) == null ? void 0 : pe.variantCombinations) || []).some((ee) => ee.takeawayUsed != null) || !1
|
|
7444
7449
|
);
|
|
7445
|
-
function
|
|
7446
|
-
var X,
|
|
7450
|
+
function be(ee) {
|
|
7451
|
+
var X, _e;
|
|
7447
7452
|
ee || (f.value = {
|
|
7448
7453
|
...f.value,
|
|
7449
7454
|
takeawayUsed: void 0,
|
|
7450
7455
|
variant: {
|
|
7451
7456
|
variantGroupIds: ((X = f.value.variant) == null ? void 0 : X.variantGroupIds) || [],
|
|
7452
|
-
variantCombinations: ((
|
|
7453
|
-
...
|
|
7457
|
+
variantCombinations: ((_e = f.value.variant) == null ? void 0 : _e.variantCombinations.map((we) => ({
|
|
7458
|
+
...we,
|
|
7454
7459
|
takeawayUsed: void 0
|
|
7455
7460
|
}))) || []
|
|
7456
7461
|
}
|
|
@@ -7461,32 +7466,32 @@ const Kl = {
|
|
|
7461
7466
|
ee || (f.value = { ...f.value, print: void 0 });
|
|
7462
7467
|
}
|
|
7463
7468
|
const j = Y(
|
|
7464
|
-
!!((
|
|
7469
|
+
!!((de = f.value.groups) != null && de.length) != null || (((Rt = f.value.variant) == null ? void 0 : Rt.variantCombinations) || []).some((ee) => {
|
|
7465
7470
|
var X;
|
|
7466
7471
|
return !!((X = ee.groups) != null && X.length);
|
|
7467
7472
|
}) || !1
|
|
7468
7473
|
);
|
|
7469
7474
|
function J(ee) {
|
|
7470
|
-
var X,
|
|
7475
|
+
var X, _e;
|
|
7471
7476
|
ee || (f.value = {
|
|
7472
7477
|
...f.value,
|
|
7473
7478
|
groups: [],
|
|
7474
7479
|
variant: {
|
|
7475
7480
|
variantGroupIds: ((X = f.value.variant) == null ? void 0 : X.variantGroupIds) || [],
|
|
7476
|
-
variantCombinations: ((
|
|
7477
|
-
...
|
|
7481
|
+
variantCombinations: ((_e = f.value.variant) == null ? void 0 : _e.variantCombinations.map((we) => ({
|
|
7482
|
+
...we,
|
|
7478
7483
|
groups: []
|
|
7479
7484
|
}))) || []
|
|
7480
7485
|
}
|
|
7481
7486
|
});
|
|
7482
7487
|
}
|
|
7483
|
-
|
|
7488
|
+
Te(() => {
|
|
7484
7489
|
var ee;
|
|
7485
7490
|
return (ee = f.value.price) == null ? void 0 : ee.amount;
|
|
7486
|
-
}, L, { deep: !0 }),
|
|
7491
|
+
}, L, { deep: !0 }), Te(
|
|
7487
7492
|
() => d.value,
|
|
7488
7493
|
(ee) => {
|
|
7489
|
-
ee && (f.value = t.initialForm ?
|
|
7494
|
+
ee && (f.value = t.initialForm ? ve(t.initialForm) : {
|
|
7490
7495
|
...Ge.generator.initMenuV4Item(),
|
|
7491
7496
|
category: t.categoryId
|
|
7492
7497
|
});
|
|
@@ -7512,24 +7517,24 @@ const Kl = {
|
|
|
7512
7517
|
function se() {
|
|
7513
7518
|
W.isUpdatingItem = !1, a.selectCatalog(W.storedCatalogId), a.selectScheduler(W.storedSchedulerId);
|
|
7514
7519
|
}
|
|
7515
|
-
function
|
|
7520
|
+
function ce() {
|
|
7516
7521
|
$.value && [
|
|
7517
|
-
[_.value,
|
|
7522
|
+
[_.value, x],
|
|
7518
7523
|
[z.value, q]
|
|
7519
|
-
].forEach(([X,
|
|
7520
|
-
X ||
|
|
7524
|
+
].forEach(([X, _e]) => {
|
|
7525
|
+
X || _e(!1);
|
|
7521
7526
|
}), o(
|
|
7522
7527
|
"submit:form",
|
|
7523
|
-
qo(
|
|
7528
|
+
qo(ve(f.value), $.value),
|
|
7524
7529
|
g.value
|
|
7525
7530
|
), m(), se();
|
|
7526
7531
|
}
|
|
7527
7532
|
function P() {
|
|
7528
7533
|
m(), se();
|
|
7529
7534
|
}
|
|
7530
|
-
const { isAtMost: H } = Xn(), le = Y(null),
|
|
7535
|
+
const { isAtMost: H } = Xn(), le = Y(null), Me = ni(le);
|
|
7531
7536
|
return (ee, X) => (C(), K(me, null, [
|
|
7532
|
-
|
|
7537
|
+
Ce(ee.$slots, "trigger", Po($o({
|
|
7533
7538
|
trigger: m
|
|
7534
7539
|
}))),
|
|
7535
7540
|
h(ei, {
|
|
@@ -7544,7 +7549,7 @@ const Kl = {
|
|
|
7544
7549
|
click: P
|
|
7545
7550
|
}
|
|
7546
7551
|
],
|
|
7547
|
-
onOnPrimary:
|
|
7552
|
+
onOnPrimary: ce,
|
|
7548
7553
|
onOnCancel: P
|
|
7549
7554
|
}, {
|
|
7550
7555
|
"append-title": V(() => [
|
|
@@ -7556,14 +7561,14 @@ const Kl = {
|
|
|
7556
7561
|
}, null, 8, ["title", "items"])) : ne("", !0)
|
|
7557
7562
|
]),
|
|
7558
7563
|
default: V(() => {
|
|
7559
|
-
var
|
|
7564
|
+
var _e, we;
|
|
7560
7565
|
return [
|
|
7561
7566
|
c(H)("sm") ? ne("", !0) : (C(), Q(Mn, {
|
|
7562
7567
|
key: 0,
|
|
7563
7568
|
class: "fixed",
|
|
7564
7569
|
style: Uo({
|
|
7565
7570
|
top: "85px",
|
|
7566
|
-
left: c(
|
|
7571
|
+
left: c(Me).right + "px"
|
|
7567
7572
|
}),
|
|
7568
7573
|
variant: "full",
|
|
7569
7574
|
title: R.value.title,
|
|
@@ -7585,7 +7590,7 @@ const Kl = {
|
|
|
7585
7590
|
toggle: _.value,
|
|
7586
7591
|
"onUpdate:toggle": [
|
|
7587
7592
|
X[1] || (X[1] = (ae) => _.value = ae),
|
|
7588
|
-
X[2] || (X[2] = (ae) =>
|
|
7593
|
+
X[2] || (X[2] = (ae) => x(ae))
|
|
7589
7594
|
],
|
|
7590
7595
|
disabled: !$.value,
|
|
7591
7596
|
description: c(r)("menu.product.form.sections.general.description"),
|
|
@@ -7599,7 +7604,7 @@ const Kl = {
|
|
|
7599
7604
|
"is-override": $.value,
|
|
7600
7605
|
"is-create": t.action === "add",
|
|
7601
7606
|
thumbnail: g.value,
|
|
7602
|
-
"onUpdate:form":
|
|
7607
|
+
"onUpdate:form": k,
|
|
7603
7608
|
"onUpdate:thumbnail": X[0] || (X[0] = (ae) => g.value = ae),
|
|
7604
7609
|
"onReset:thumbnail": M
|
|
7605
7610
|
}, null, 8, ["fallback", "form", "is-addon", "is-override", "is-create", "thumbnail"])
|
|
@@ -7616,7 +7621,7 @@ const Kl = {
|
|
|
7616
7621
|
h(c(qn), {
|
|
7617
7622
|
entity: "item",
|
|
7618
7623
|
"model-value": f.value.customAttributes || {},
|
|
7619
|
-
"onUpdate:modelValue": X[3] || (X[3] = (ae) =>
|
|
7624
|
+
"onUpdate:modelValue": X[3] || (X[3] = (ae) => k("customAttributes", ae)),
|
|
7620
7625
|
"value-options": b.value
|
|
7621
7626
|
}, null, 8, ["model-value", "value-options"])
|
|
7622
7627
|
]),
|
|
@@ -7639,7 +7644,7 @@ const Kl = {
|
|
|
7639
7644
|
form: f.value,
|
|
7640
7645
|
"is-addon": U.value,
|
|
7641
7646
|
"is-override": $.value,
|
|
7642
|
-
"onUpdate:form":
|
|
7647
|
+
"onUpdate:form": k
|
|
7643
7648
|
}, null, 8, ["fallback", "form", "is-addon", "is-override"])
|
|
7644
7649
|
]),
|
|
7645
7650
|
_: 1
|
|
@@ -7663,7 +7668,7 @@ const Kl = {
|
|
|
7663
7668
|
"full-combinations": w.value,
|
|
7664
7669
|
"is-addon": U.value,
|
|
7665
7670
|
"is-override": $.value,
|
|
7666
|
-
"onUpdate:form":
|
|
7671
|
+
"onUpdate:form": k,
|
|
7667
7672
|
"onReplace:form": X[6] || (X[6] = (ae) => f.value = ae)
|
|
7668
7673
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
7669
7674
|
]),
|
|
@@ -7687,7 +7692,7 @@ const Kl = {
|
|
|
7687
7692
|
"full-combinations": w.value,
|
|
7688
7693
|
"is-addon": U.value,
|
|
7689
7694
|
"is-override": $.value,
|
|
7690
|
-
"onUpdate:form":
|
|
7695
|
+
"onUpdate:form": k,
|
|
7691
7696
|
"onReplace:form": X[9] || (X[9] = (ae) => f.value = ae)
|
|
7692
7697
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
7693
7698
|
]),
|
|
@@ -7712,7 +7717,7 @@ const Kl = {
|
|
|
7712
7717
|
"full-combinations": w.value,
|
|
7713
7718
|
"is-addon": U.value,
|
|
7714
7719
|
"is-override": $.value,
|
|
7715
|
-
"onUpdate:form":
|
|
7720
|
+
"onUpdate:form": k,
|
|
7716
7721
|
"onReplace:form": X[12] || (X[12] = (ae) => f.value = ae)
|
|
7717
7722
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
7718
7723
|
]),
|
|
@@ -7737,19 +7742,19 @@ const Kl = {
|
|
|
7737
7742
|
"full-combinations": w.value,
|
|
7738
7743
|
"is-addon": U.value,
|
|
7739
7744
|
"is-override": $.value,
|
|
7740
|
-
"onUpdate:form":
|
|
7745
|
+
"onUpdate:form": k,
|
|
7741
7746
|
"onReplace:form": X[15] || (X[15] = (ae) => f.value = ae)
|
|
7742
7747
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
7743
7748
|
]),
|
|
7744
7749
|
_: 1
|
|
7745
7750
|
}, 8, ["toggle", "disabled", "description", "title"])) : ne("", !0),
|
|
7746
|
-
s.value.takeaway(f.value.category ?? ((
|
|
7747
|
-
s.value.takeaway(f.value.category ?? ((
|
|
7751
|
+
s.value.takeaway(f.value.category ?? ((_e = p.value) == null ? void 0 : _e.category)) && !$.value ? (C(), K("div", fu)) : ne("", !0),
|
|
7752
|
+
s.value.takeaway(f.value.category ?? ((we = p.value) == null ? void 0 : we.category)) ? (C(), Q(st, {
|
|
7748
7753
|
key: 12,
|
|
7749
7754
|
toggle: te.value,
|
|
7750
7755
|
"onUpdate:toggle": [
|
|
7751
7756
|
X[19] || (X[19] = (ae) => te.value = ae),
|
|
7752
|
-
X[20] || (X[20] = (ae) =>
|
|
7757
|
+
X[20] || (X[20] = (ae) => be(ae))
|
|
7753
7758
|
],
|
|
7754
7759
|
disabled: !$.value,
|
|
7755
7760
|
description: c(r)("menu.product.form.sections.takeaway.description"),
|
|
@@ -7762,7 +7767,7 @@ const Kl = {
|
|
|
7762
7767
|
"full-combinations": w.value,
|
|
7763
7768
|
"is-addon": U.value,
|
|
7764
7769
|
"is-override": $.value,
|
|
7765
|
-
"onUpdate:form":
|
|
7770
|
+
"onUpdate:form": k,
|
|
7766
7771
|
"onReplace:form": X[18] || (X[18] = (ae) => f.value = ae)
|
|
7767
7772
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
7768
7773
|
]),
|
|
@@ -7823,7 +7828,7 @@ function Eo(e, n) {
|
|
|
7823
7828
|
return { ...n, groups: a(n.groups || []) };
|
|
7824
7829
|
}
|
|
7825
7830
|
function gu(e, n, t, o) {
|
|
7826
|
-
const a =
|
|
7831
|
+
const a = ve(n), i = t ? a.modules.catalog.find((p) => p._id === t) : null, r = o ? a.modules.scheduler.find((p) => p._id === o) : null, l = i ? ve(i) : void 0, s = t ? a.modules.catalog.filter((p) => p._id !== t) : [], u = r ? ve(r) : void 0, d = e.reduce((p, f) => (p[f._id] = bu(f), p), {});
|
|
7827
7832
|
function m(p = []) {
|
|
7828
7833
|
const f = e.map((v) => v._id);
|
|
7829
7834
|
return [
|
|
@@ -7861,7 +7866,7 @@ function gu(e, n, t, o) {
|
|
|
7861
7866
|
}
|
|
7862
7867
|
function bu(e) {
|
|
7863
7868
|
var o;
|
|
7864
|
-
const n =
|
|
7869
|
+
const n = ve(e), t = (o = n.variant) == null ? void 0 : o.variantCombinations;
|
|
7865
7870
|
return delete n.variant, delete n.thumbnail, [n, ...t || []];
|
|
7866
7871
|
}
|
|
7867
7872
|
function yu(e, n) {
|
|
@@ -7876,7 +7881,7 @@ function yu(e, n) {
|
|
|
7876
7881
|
};
|
|
7877
7882
|
}
|
|
7878
7883
|
const Ht = jn("item-manager", () => {
|
|
7879
|
-
const e =
|
|
7884
|
+
const e = Ae(), n = Ke(), t = Ze(), o = nt(n), a = ot(o), i = vn(), { t: r } = ye(), l = (T) => {
|
|
7880
7885
|
if (!i) throw new Error("No current instance found");
|
|
7881
7886
|
const { container: B } = Zn(vu, i, {
|
|
7882
7887
|
...T,
|
|
@@ -7915,8 +7920,8 @@ const Ht = jn("item-manager", () => {
|
|
|
7915
7920
|
});
|
|
7916
7921
|
}
|
|
7917
7922
|
async function d(T) {
|
|
7918
|
-
var
|
|
7919
|
-
const B = e.currentCatalog, M = e.state.currentSchedulerId, R = B.override.scheduler[M] ?? {}, _ = (
|
|
7923
|
+
var x;
|
|
7924
|
+
const B = e.currentCatalog, M = e.state.currentSchedulerId, R = B.override.scheduler[M] ?? {}, _ = (x = R == null ? void 0 : R.items) == null ? void 0 : x.filter((b) => b._id === T._id);
|
|
7920
7925
|
await u(T, _, async (b) => {
|
|
7921
7926
|
const z = b.modules.catalog.find(
|
|
7922
7927
|
(q) => q._id === B._id
|
|
@@ -7939,14 +7944,14 @@ const Ht = jn("item-manager", () => {
|
|
|
7939
7944
|
), M = B.items.filter((R) => R._id === T._id);
|
|
7940
7945
|
await u(T, M, async (R) => {
|
|
7941
7946
|
const _ = R.modules.scheduler.find(
|
|
7942
|
-
(
|
|
7947
|
+
(x) => x._id === B._id
|
|
7943
7948
|
);
|
|
7944
7949
|
await new zt(_, e, a.updateMenu, t).update();
|
|
7945
7950
|
});
|
|
7946
7951
|
}
|
|
7947
7952
|
async function f(T) {
|
|
7948
|
-
var _,
|
|
7949
|
-
const B = e.state.currentSchedulerId, M =
|
|
7953
|
+
var _, x;
|
|
7954
|
+
const B = e.state.currentSchedulerId, M = ve(e.currentCatalog), R = (x = ((_ = M.override.scheduler[B]) == null ? void 0 : _.items) || []) == null ? void 0 : x.reduce((b, z) => {
|
|
7950
7955
|
if (z.combinationKey) return [...b, z];
|
|
7951
7956
|
const q = T.find((N) => N._id === z._id);
|
|
7952
7957
|
return q ? [...b, { ...z, price: q.price }] : [...b, z];
|
|
@@ -7962,13 +7967,13 @@ const Ht = jn("item-manager", () => {
|
|
|
7962
7967
|
}
|
|
7963
7968
|
async function v(T) {
|
|
7964
7969
|
var _;
|
|
7965
|
-
const B =
|
|
7966
|
-
(
|
|
7970
|
+
const B = ve(e.currentCatalog), M = (_ = Object.entries(B.override.items)) == null ? void 0 : _.reduce(
|
|
7971
|
+
(x, [b, z]) => {
|
|
7967
7972
|
const q = T.find((S) => S._id === b);
|
|
7968
7973
|
if (!q)
|
|
7969
|
-
return
|
|
7974
|
+
return x[b] = z, x;
|
|
7970
7975
|
const N = z.find((S) => !S.combinationKey);
|
|
7971
|
-
return
|
|
7976
|
+
return x[b] = [
|
|
7972
7977
|
...z.filter((S) => !!S.combinationKey),
|
|
7973
7978
|
{
|
|
7974
7979
|
...N,
|
|
@@ -7977,7 +7982,7 @@ const Ht = jn("item-manager", () => {
|
|
|
7977
7982
|
price: q.price,
|
|
7978
7983
|
orderFrom: q.orderFrom ?? N.orderFrom
|
|
7979
7984
|
}
|
|
7980
|
-
],
|
|
7985
|
+
], x;
|
|
7981
7986
|
},
|
|
7982
7987
|
{}
|
|
7983
7988
|
), { updateMenu: R } = a;
|
|
@@ -7995,10 +8000,10 @@ const Ht = jn("item-manager", () => {
|
|
|
7995
8000
|
).update();
|
|
7996
8001
|
}
|
|
7997
8002
|
async function A(T) {
|
|
7998
|
-
const B =
|
|
8003
|
+
const B = ve(e.currentScheduler), M = B.items.reduce((R, _) => {
|
|
7999
8004
|
if (_.combinationKey) return [...R, _];
|
|
8000
|
-
const
|
|
8001
|
-
return
|
|
8005
|
+
const x = T.find((b) => b._id === _._id);
|
|
8006
|
+
return x ? [...R, { ..._, price: x.price }] : [...R, _];
|
|
8002
8007
|
}, []);
|
|
8003
8008
|
await new zt(
|
|
8004
8009
|
{
|
|
@@ -8012,17 +8017,17 @@ const Ht = jn("item-manager", () => {
|
|
|
8012
8017
|
}
|
|
8013
8018
|
async function y(T) {
|
|
8014
8019
|
const B = T.reduce((R, _) => {
|
|
8015
|
-
const
|
|
8016
|
-
return
|
|
8017
|
-
...
|
|
8018
|
-
code: _.code ??
|
|
8019
|
-
name: _.name ||
|
|
8020
|
-
price: _.price ??
|
|
8021
|
-
orderFrom: _.orderFrom ??
|
|
8022
|
-
taxes: _.taxes ??
|
|
8023
|
-
category: _.category === void 0 ?
|
|
8024
|
-
position: _.position ??
|
|
8025
|
-
additionalCategories: _.additionalCategories ??
|
|
8020
|
+
const x = e.items.find((b) => b._id === _._id);
|
|
8021
|
+
return x && R.push({
|
|
8022
|
+
...x,
|
|
8023
|
+
code: _.code ?? x.code,
|
|
8024
|
+
name: _.name || x.name,
|
|
8025
|
+
price: _.price ?? x.price,
|
|
8026
|
+
orderFrom: _.orderFrom ?? x.orderFrom,
|
|
8027
|
+
taxes: _.taxes ?? x.taxes,
|
|
8028
|
+
category: _.category === void 0 ? x.category : _.category,
|
|
8029
|
+
position: _.position ?? x.position,
|
|
8030
|
+
additionalCategories: _.additionalCategories ?? x.additionalCategories
|
|
8026
8031
|
}), R;
|
|
8027
8032
|
}, []), { updateMenu: M } = a;
|
|
8028
8033
|
await M(
|
|
@@ -8049,7 +8054,7 @@ const Ht = jn("item-manager", () => {
|
|
|
8049
8054
|
const B = e.state.menu.modules.item.find((M) => M._id === T);
|
|
8050
8055
|
e.currentCatalog ? e.state.currentSchedulerId ? await d(B) : await m(B) : e.state.currentSchedulerId ? await p(B) : w(B);
|
|
8051
8056
|
}
|
|
8052
|
-
async function
|
|
8057
|
+
async function k(T) {
|
|
8053
8058
|
e.currentCatalog ? e.currentScheduler ? await f(T) : await v(T) : (
|
|
8054
8059
|
// If Main
|
|
8055
8060
|
e.currentScheduler ? await A(T) : await y(T)
|
|
@@ -8115,7 +8120,7 @@ const Ht = jn("item-manager", () => {
|
|
|
8115
8120
|
initDynamicGroupItem: (T) => Eo(e, T),
|
|
8116
8121
|
create: s,
|
|
8117
8122
|
update: g,
|
|
8118
|
-
updateMany:
|
|
8123
|
+
updateMany: k,
|
|
8119
8124
|
deleteItem: $,
|
|
8120
8125
|
rearrange: U
|
|
8121
8126
|
};
|