@feedmepos/mf-menu 0.32.17 → 0.32.18-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App-Cfl37TTw.js +152661 -0
- package/dist/{Catalog-ChlP8Cid.js → Catalog-Yxsb-D33.js} +47 -52
- package/dist/{Category-CHs96ibF.js → Category-0vJH8Ct0.js} +86 -92
- package/dist/{Category-B1tAJpNd.js → Category-qp0wI14I.js} +25 -26
- package/dist/{CookingGuide-mEvca-0v.js → CookingGuide-EpAr5F5U.js} +139 -143
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Bk26jQI7.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CkyD0sdI.js} +14 -16
- package/dist/{Group-Ye2IIY52.js → Group-B3W9iSbO.js} +5 -5
- package/dist/{Group-Co2Vf4Lw.js → Group-DLCh0fDU.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BcxSbvJS.js → Group.vue_vue_type_script_setup_true_lang-Bzy_hXDv.js} +176 -186
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D1f8VG-n.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BFaAXp7r.js} +81 -88
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Jv6iJlg9.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CxP8lDD0.js} +2502 -2508
- package/dist/{Ingredient-BgnW8sWo.js → Ingredient-CVLMr_YB.js} +102 -105
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-8ziHcUiK.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CdTC5ykI.js} +1058 -1059
- package/dist/{MenuSetting-GEngjeC8.js → MenuSetting-Blpi1vSd.js} +58 -61
- package/dist/{PrintRoute-BSlUQT7g.js → PrintRoute-BS7PPPkE.js} +49 -52
- package/dist/{Product-DNg_BUuV.js → Product-DDeNKQ7u.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-Cehy2oy-.js → Product.vue_vue_type_script_setup_true_lang-rmv8m4_D.js} +286 -298
- package/dist/{ProductInternalTools-B5A67yxH.js → ProductInternalTools-CVuothk9.js} +45 -46
- package/dist/{Products-DCsxmTPB.js → Products-BIvsHKEt.js} +111 -116
- package/dist/{Publish-Cst0Ll6T.js → Publish-CDADU3Pp.js} +154 -159
- package/dist/{Recipe-DupS3SQT.js → Recipe-CMhW7e_z.js} +40 -43
- package/dist/{Scheduler-BcThU1M6.js → Scheduler-BpxunKBV.js} +7 -7
- package/dist/{ServingSequence-CT3THBH6.js → ServingSequence-BQVuYyAB.js} +54 -58
- package/dist/{Setting-Dxh8E3no.js → Setting-Dj0yyP37.js} +63 -66
- package/dist/{Subcategory-DhJEzofz.js → Subcategory-BH4DDZM4.js} +72 -76
- package/dist/{Takeaway-DSC7U4Jk.js → Takeaway-CGJBZ_sJ.js} +1 -1
- package/dist/{Takeaway-B8BSSKNj.js → Takeaway-DifOudVE.js} +20 -21
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BLpiJlk2.js → Takeaway.vue_vue_type_script_setup_true_lang-D-R5_S5G.js} +59 -64
- package/dist/{Unit-joU7vZZu.js → Unit-DXDox2Ut.js} +8 -8
- package/dist/{Variant-D8YjRJ6N.js → Variant-DbJVwgm5.js} +75 -78
- package/dist/{_id_-Bd9uo1WW.js → _id_-RFYwWjbM.js} +34 -38
- package/dist/{app-BNrAos5Z.js → app-Z0KWH9-d.js} +74 -335
- package/dist/app.js +4 -5
- package/dist/apps/mf-menu/src/app.d.ts +1 -2
- package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +1 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-DbjzbFTw.js → linked-status-CkmoJAm-.js} +2 -2
- package/dist/assets/{menu-export-D_oNY_wi.js → menu-export-DcINiK28.js} +3 -3
- package/dist/assets/{override-menu-CIU7U1_4.js → override-menu-PUKiu-df.js} +2 -2
- package/dist/assets/{validate-menu-kuOxuwG9.js → validate-menu-CcqiRhNT.js} +2 -2
- package/dist/{catalogSetting-BHgsBDTl.js → catalogSetting-Bf66H-j7.js} +1 -1
- package/dist/dayjs.min-DNPTnUFp.js +6 -0
- package/dist/{jszip.min-7SsHzD5O.js → jszip.min-CO2_Gf69.js} +545 -545
- package/dist/{menu-Cd4NbFVq.js → menu-Brxar171.js} +1 -1
- package/dist/mf-menu.css +1 -1
- package/dist/{scheduler-B6OokVIA.js → scheduler-CqdIiE8G.js} +56 -60
- package/dist/{toExcel-BZkbXlHv.js → toExcel-CRJIU0NC.js} +2 -2
- package/dist/{unit-D6QOkMoM.js → unit-wYPYkm33.js} +98 -105
- package/package.json +1 -1
- package/dist/App-BiSEuDkd.js +0 -13484
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-C_SjdLpO.js +0 -161
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +0 -26
- package/dist/LinkProductSideSheet-DFDYEUBh.js +0 -687
- package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js +0 -69
- package/dist/RuleView.vue_vue_type_script_setup_true_lang-BeesK2ym.js +0 -3285
- package/dist/TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js +0 -20
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-C3qXnZlz.js +0 -399
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CMe76XvZ.js +0 -6011
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-5fxKLAzS.js +0 -8163
- package/dist/app-nTzkERJW.js +0 -68
- package/dist/catalog-BO2nXwe5.js +0 -199
- package/dist/category-CuG3DsGL.js +0 -156
- package/dist/check-C9mY6LiX.js +0 -9
- package/dist/createComponentProgrammatically-Bt2rn1IQ.js +0 -11
- package/dist/currency-DxC5zyZB.js +0 -7
- package/dist/dayjs.min-BvFUSPWD.js +0 -6
- package/dist/discardConfirm-BHni0LNu.js +0 -28
- package/dist/index-B0nhvuxR.js +0 -273
- package/dist/index-C2zPvt64.js +0 -239
- package/dist/index-C36JQix-.js +0 -246
- package/dist/index-CisutoS9.js +0 -156
- package/dist/index.vue_vue_type_script_setup_true_lang-DCBYExNb.js +0 -109064
- package/dist/item-K01xd1Z0.js +0 -6868
- package/dist/menuV2-DKE-xanq.js +0 -1052
- package/dist/object-DVUNCr7w.js +0 -16
- package/dist/priceTier-Beavb91W.js +0 -87
- package/dist/search-BAPEUu1R.js +0 -15
- package/dist/string-DpfFixWH.js +0 -4
- package/dist/subcategory-DnslmmRD.js +0 -148
- package/dist/tooltip-B5BiPMx9.js +0 -32
- package/dist/vuedraggable-CK8z7qA8.js +0 -1728
package/dist/index-B0nhvuxR.js
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import { B as S, A, u as K, I as O, D as q, J as R } from "./index.vue_vue_type_script_setup_true_lang-DCBYExNb.js";
|
|
2
|
-
import { defineComponent as T, ref as f, computed as B, watch as L, onMounted as z, onBeforeUnmount as P, resolveComponent as F, createBlock as N, openBlock as M, withModifiers as D, withCtx as g, renderSlot as U, createElementBlock as W, Fragment as j, createVNode as c, unref as i, createElementVNode as C, createCommentVNode as H, toDisplayString as J } from "vue";
|
|
3
|
-
import { useI18n as I } from "@feedmepos/mf-common";
|
|
4
|
-
import { components as Y } from "@feedmepos/ui-library";
|
|
5
|
-
import { _ as Z } from "./RuleView.vue_vue_type_script_setup_true_lang-BeesK2ym.js";
|
|
6
|
-
import { u as G } from "./discardConfirm-BHni0LNu.js";
|
|
7
|
-
import { _ as Q } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-C_SjdLpO.js";
|
|
8
|
-
import { c as X } from "./check-C9mY6LiX.js";
|
|
9
|
-
import { f as ee } from "./currency-DxC5zyZB.js";
|
|
10
|
-
import { c as ae } from "./string-DpfFixWH.js";
|
|
11
|
-
const te = /* @__PURE__ */ T({
|
|
12
|
-
__name: "CurrencyInput",
|
|
13
|
-
props: {
|
|
14
|
-
modelValue: {},
|
|
15
|
-
label: {},
|
|
16
|
-
placeholder: {},
|
|
17
|
-
nullable: { type: Boolean },
|
|
18
|
-
showCurrency: { type: Boolean },
|
|
19
|
-
min: {},
|
|
20
|
-
max: {},
|
|
21
|
-
required: { type: [Boolean, String] },
|
|
22
|
-
rules: {},
|
|
23
|
-
disable: { type: Boolean },
|
|
24
|
-
minLength: {},
|
|
25
|
-
maxLength: {},
|
|
26
|
-
inputmode: {},
|
|
27
|
-
type: {},
|
|
28
|
-
readonly: { type: Boolean },
|
|
29
|
-
labelMark: {},
|
|
30
|
-
prependIcon: {},
|
|
31
|
-
appendIcon: {},
|
|
32
|
-
showValidBorder: { type: Boolean },
|
|
33
|
-
labelInfo: {},
|
|
34
|
-
showWordCount: { type: Boolean },
|
|
35
|
-
invalid: { type: Boolean },
|
|
36
|
-
autofocus: { type: Boolean },
|
|
37
|
-
formatter: { type: Function },
|
|
38
|
-
decimal: {},
|
|
39
|
-
datalist: {},
|
|
40
|
-
shiftDatalist: { type: Boolean },
|
|
41
|
-
datalistMaxHeight: {},
|
|
42
|
-
datalistMinHeight: {},
|
|
43
|
-
offsetDatalist: {},
|
|
44
|
-
datalistPlacement: {},
|
|
45
|
-
datalistZIndex: {},
|
|
46
|
-
datalistWidth: {},
|
|
47
|
-
disabled: { type: Boolean },
|
|
48
|
-
focused: { type: Boolean },
|
|
49
|
-
helperText: {},
|
|
50
|
-
helperState: {}
|
|
51
|
-
},
|
|
52
|
-
emits: ["update:model-value"],
|
|
53
|
-
setup(y, { emit: m }) {
|
|
54
|
-
const a = y, { t: n } = I(), d = f(!1), v = f(!1), r = f(), x = B(() => a.modelValue ? (v.value && !d.value && (d.value = !0), S.Dinero.fromFdoDinero(a.modelValue).toUnit().toFixed(2)) : "");
|
|
55
|
-
L(
|
|
56
|
-
() => v.value,
|
|
57
|
-
(e) => {
|
|
58
|
-
var t, l, o, E, w;
|
|
59
|
-
e ? (l = (t = r.value) == null ? void 0 : t.inputEl) == null || l.select() : (d.value = !1, (o = r.value) != null && o.inputEl && k((w = (E = r.value) == null ? void 0 : E.inputEl) == null ? void 0 : w.value));
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
const V = m, u = B(() => typeof a.required == "string" ? a.required : n("menu.common.validation.field_required", {
|
|
63
|
-
field: a.label ?? n("menu.currency.input.field")
|
|
64
|
-
})), b = [
|
|
65
|
-
(e) => a.required ? !!e || u.value : !0,
|
|
66
|
-
(e) => a.min !== void 0 && e && parseFloat(e.toString()) < a.min ? n("menu.common.validation.min_value", { value: a.min }) : !0,
|
|
67
|
-
(e) => a.max !== void 0 && e && parseFloat(e.toString()) > a.max ? n("menu.common.validation.max_value", { value: a.max }) : !0,
|
|
68
|
-
...a.rules ?? []
|
|
69
|
-
];
|
|
70
|
-
function k(e) {
|
|
71
|
-
if (typeof e != "number" && !e && a.nullable)
|
|
72
|
-
V("update:model-value", void 0);
|
|
73
|
-
else {
|
|
74
|
-
if (typeof e == "string" && e === "-")
|
|
75
|
-
return;
|
|
76
|
-
let t = parseFloat((e || "").toString());
|
|
77
|
-
t = Number.isNaN(t) ? 0 : t, V("update:model-value", S.Dinero.fromNumber({ number: t }).toObject());
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
const s = B(() => typeof a.min == "number" && a.min >= 0), _ = (e) => {
|
|
81
|
-
var t, l, o;
|
|
82
|
-
if (!(e.ctrlKey || e.metaKey)) {
|
|
83
|
-
if (e.key === "Enter") {
|
|
84
|
-
(t = r.value) != null && t.inputEl && k((o = (l = r.value) == null ? void 0 : l.inputEl) == null ? void 0 : o.value);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (e.key === "-" && s.value) {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
e.key >= "0" && e.key <= "9" || e.key === "." || e.key === "," || e.key === "-" || e.key === "Backspace" || e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Tab" || e.preventDefault();
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
return z(() => {
|
|
95
|
-
var e;
|
|
96
|
-
r.value && ((e = r.value.inputEl) == null || e.addEventListener("keydown", _));
|
|
97
|
-
}), P(() => {
|
|
98
|
-
var e;
|
|
99
|
-
r.value && ((e = r.value.inputEl) == null || e.removeEventListener("keydown", _));
|
|
100
|
-
}), (e, t) => {
|
|
101
|
-
const l = F("fm-text-field");
|
|
102
|
-
return M(), N(l, {
|
|
103
|
-
ref_key: "inputRef",
|
|
104
|
-
ref: r,
|
|
105
|
-
autofocus: a.autofocus,
|
|
106
|
-
disabled: a.disable,
|
|
107
|
-
label: e.label,
|
|
108
|
-
"model-value": x.value,
|
|
109
|
-
placeholder: a.placeholder,
|
|
110
|
-
"prepend-icon": e.showCurrency ? "attach_money" : void 0,
|
|
111
|
-
rules: b,
|
|
112
|
-
inputmode: "decimal",
|
|
113
|
-
onFocusChanged: t[0] || (t[0] = (o) => v.value = o),
|
|
114
|
-
onWheel: t[1] || (t[1] = D(() => {
|
|
115
|
-
}, ["prevent"])),
|
|
116
|
-
onTouchmove: t[2] || (t[2] = D(() => {
|
|
117
|
-
}, ["prevent"])),
|
|
118
|
-
onScroll: t[3] || (t[3] = D(() => {
|
|
119
|
-
}, ["prevent"]))
|
|
120
|
-
}, {
|
|
121
|
-
append: g(() => [
|
|
122
|
-
U(e.$slots, "append")
|
|
123
|
-
]),
|
|
124
|
-
_: 3
|
|
125
|
-
}, 8, ["autofocus", "disabled", "label", "model-value", "placeholder", "prepend-icon"]);
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
function be(y) {
|
|
130
|
-
return y.map((m) => ({
|
|
131
|
-
module: A.F_MENU_MODULE_V4_KEY.enum.item,
|
|
132
|
-
id: m._id,
|
|
133
|
-
discriminator: m.combinationKey,
|
|
134
|
-
data: void 0
|
|
135
|
-
}));
|
|
136
|
-
}
|
|
137
|
-
const le = { class: "fm-typo-en-title-md-600" }, oe = { class: "space-y-32" }, ne = { class: "flex gap-8 items-center justify-start" }, ie = /* @__PURE__ */ T({
|
|
138
|
-
__name: "Form",
|
|
139
|
-
props: {
|
|
140
|
-
action: {},
|
|
141
|
-
initialValue: {},
|
|
142
|
-
fallback: {},
|
|
143
|
-
applyProduct: { type: Boolean },
|
|
144
|
-
bindToVariant: { type: Boolean }
|
|
145
|
-
},
|
|
146
|
-
emits: ["update:takeaway"],
|
|
147
|
-
setup(y, { expose: m, emit: a }) {
|
|
148
|
-
const { t: n } = I(), d = y, v = a, r = K(), x = B(() => r.rules.takeaway), V = f(!1), u = f(!1), b = (l) => {
|
|
149
|
-
X.isBoolean(l) ? u.value = l : u.value = !u.value;
|
|
150
|
-
};
|
|
151
|
-
function k() {
|
|
152
|
-
var o;
|
|
153
|
-
const l = {
|
|
154
|
-
...q.generator.initMenuV4Takeaway(),
|
|
155
|
-
usedBy: [],
|
|
156
|
-
...O(d.initialValue ?? {})
|
|
157
|
-
};
|
|
158
|
-
return (o = d.fallback) != null && o.price && (l.price = null), l;
|
|
159
|
-
}
|
|
160
|
-
const s = f(k()), _ = B(() => d.action === "add" ? n("menu.takeaway.add") : n("menu.takeaway.update")), e = G(
|
|
161
|
-
() => !R.isEqual(
|
|
162
|
-
s.value,
|
|
163
|
-
d.initialValue || {
|
|
164
|
-
...q.generator.initMenuV4Takeaway(),
|
|
165
|
-
usedBy: []
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
() => u.value = !1
|
|
169
|
-
);
|
|
170
|
-
function t() {
|
|
171
|
-
v("update:takeaway", s.value), b(!1);
|
|
172
|
-
}
|
|
173
|
-
return L(
|
|
174
|
-
() => u.value,
|
|
175
|
-
() => {
|
|
176
|
-
u.value && (s.value = k());
|
|
177
|
-
}
|
|
178
|
-
), m({
|
|
179
|
-
trigger: b,
|
|
180
|
-
show: u
|
|
181
|
-
}), (l, o) => {
|
|
182
|
-
const E = F("fm-text-field"), w = F("fm-button"), $ = F("fm-side-sheet");
|
|
183
|
-
return M(), W(j, null, [
|
|
184
|
-
U(l.$slots, "default", { trigger: b }),
|
|
185
|
-
c($, {
|
|
186
|
-
id: "group-form",
|
|
187
|
-
modelValue: u.value,
|
|
188
|
-
"onUpdate:modelValue": o[4] || (o[4] = (p) => u.value = p),
|
|
189
|
-
"is-container": i(Y).FmForm,
|
|
190
|
-
"is-container-props": {
|
|
191
|
-
onValidationSuccess: t,
|
|
192
|
-
blameFormChildOnValidationFailed: !0
|
|
193
|
-
},
|
|
194
|
-
"max-width": 560,
|
|
195
|
-
"onOn:clickedAway": i(e)
|
|
196
|
-
}, {
|
|
197
|
-
"side-sheet-header": g(() => [
|
|
198
|
-
C("p", le, J(_.value), 1)
|
|
199
|
-
]),
|
|
200
|
-
"side-sheet-footer": g(() => [
|
|
201
|
-
C("div", ne, [
|
|
202
|
-
c(w, {
|
|
203
|
-
label: i(ae)(i(n)(`menu.common.actions.${l.action}`)),
|
|
204
|
-
loading: V.value,
|
|
205
|
-
size: "lg",
|
|
206
|
-
type: "submit",
|
|
207
|
-
variant: "primary"
|
|
208
|
-
}, null, 8, ["label", "loading"]),
|
|
209
|
-
c(w, {
|
|
210
|
-
label: i(n)("menu.common.actions.cancel"),
|
|
211
|
-
size: "lg",
|
|
212
|
-
variant: "tertiary",
|
|
213
|
-
onClick: o[3] || (o[3] = () => u.value = !1)
|
|
214
|
-
}, null, 8, ["label"])
|
|
215
|
-
])
|
|
216
|
-
]),
|
|
217
|
-
default: g(() => [
|
|
218
|
-
C("div", oe, [
|
|
219
|
-
c(Z, null, {
|
|
220
|
-
default: g(() => {
|
|
221
|
-
var p;
|
|
222
|
-
return [
|
|
223
|
-
c(E, {
|
|
224
|
-
modelValue: s.value.name,
|
|
225
|
-
"onUpdate:modelValue": o[0] || (o[0] = (h) => s.value.name = h),
|
|
226
|
-
disabled: !x.value.name,
|
|
227
|
-
rules: [
|
|
228
|
-
(h) => !!h || i(n)("menu.common.validation.required", {
|
|
229
|
-
field: i(n)("menu.takeaway.columns.title").toLowerCase()
|
|
230
|
-
})
|
|
231
|
-
],
|
|
232
|
-
autofocus: "",
|
|
233
|
-
label: i(n)("menu.takeaway.columns.title"),
|
|
234
|
-
placeholder: i(n)("menu.takeaway.placeholders.title"),
|
|
235
|
-
required: "",
|
|
236
|
-
title: i(n)("menu.takeaway.columns.title")
|
|
237
|
-
}, null, 8, ["modelValue", "disabled", "rules", "label", "placeholder", "title"]),
|
|
238
|
-
c(te, {
|
|
239
|
-
modelValue: s.value.price,
|
|
240
|
-
"onUpdate:modelValue": o[1] || (o[1] = (h) => s.value.price = h),
|
|
241
|
-
min: 0,
|
|
242
|
-
nullable: !!l.fallback,
|
|
243
|
-
placeholder: (p = l.fallback) != null && p.price ? i(ee)(l.fallback.price, !1) : void 0,
|
|
244
|
-
label: i(n)("menu.takeaway.columns.price"),
|
|
245
|
-
"show-currency": "",
|
|
246
|
-
title: i(n)("menu.takeaway.columns.price")
|
|
247
|
-
}, null, 8, ["modelValue", "nullable", "placeholder", "label", "title"])
|
|
248
|
-
];
|
|
249
|
-
}),
|
|
250
|
-
_: 1
|
|
251
|
-
}),
|
|
252
|
-
l.applyProduct ? (M(), N(Q, {
|
|
253
|
-
key: 0,
|
|
254
|
-
overrides: s.value.usedBy,
|
|
255
|
-
"onUpdate:overrides": o[2] || (o[2] = (p) => s.value.usedBy = p),
|
|
256
|
-
"select-variant": l.bindToVariant,
|
|
257
|
-
editable: "",
|
|
258
|
-
title: i(n)("menu.common.labels.product")
|
|
259
|
-
}, null, 8, ["overrides", "select-variant", "title"])) : H("", !0)
|
|
260
|
-
])
|
|
261
|
-
]),
|
|
262
|
-
_: 1
|
|
263
|
-
}, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"])
|
|
264
|
-
], 64);
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
}), ke = ie;
|
|
268
|
-
export {
|
|
269
|
-
ke as T,
|
|
270
|
-
te as _,
|
|
271
|
-
ie as a,
|
|
272
|
-
be as l
|
|
273
|
-
};
|
package/dist/index-C2zPvt64.js
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import { defineComponent as R, computed as w, ref as E, watch as C, resolveComponent as g, createElementBlock as M, openBlock as V, Fragment as K, renderSlot as j, createVNode as s, unref as n, withCtx as m, createElementVNode as d, createBlock as F, createCommentVNode as U, normalizeClass as J, createSlots as Q, toDisplayString as H } from "vue";
|
|
2
|
-
import { Q as W, G as X, I as f, D, M as I, A as S, J as Z } from "./index.vue_vue_type_script_setup_true_lang-DCBYExNb.js";
|
|
3
|
-
import { d as ee } from "./vuedraggable-CK8z7qA8.js";
|
|
4
|
-
import { useI18n as te } from "@feedmepos/mf-common";
|
|
5
|
-
import { useSnackbar as ae, components as ne } from "@feedmepos/ui-library";
|
|
6
|
-
import { _ as oe } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
7
|
-
import { _ as le } from "./RuleView.vue_vue_type_script_setup_true_lang-BeesK2ym.js";
|
|
8
|
-
import { u as ie } from "./discardConfirm-BHni0LNu.js";
|
|
9
|
-
import { _ as se } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-C_SjdLpO.js";
|
|
10
|
-
import { c as re } from "./check-C9mY6LiX.js";
|
|
11
|
-
const ue = { class: "fm-typo-en-title-md-600" }, me = { class: "py-16 space-y-32" }, de = ["data-not-allow-sort"], ce = {
|
|
12
|
-
key: 1,
|
|
13
|
-
class: "w-24"
|
|
14
|
-
}, pe = { class: "flex-1" }, fe = { class: "flex gap-8 items-center justify-start" }, ve = /* @__PURE__ */ R({
|
|
15
|
-
__name: "Form",
|
|
16
|
-
props: {
|
|
17
|
-
initialValue: {}
|
|
18
|
-
},
|
|
19
|
-
setup(B, { expose: N }) {
|
|
20
|
-
const r = B, b = W(X(ae())), { t: o } = te(), A = w(
|
|
21
|
-
() => r.initialValue ? o("menu.variant.form.title.edit") : o("menu.variant.form.title.add")
|
|
22
|
-
), L = w(() => r.initialValue ? "Update" : "Add"), k = () => {
|
|
23
|
-
if (r.initialValue) {
|
|
24
|
-
const e = f(r.initialValue);
|
|
25
|
-
return e.options.push({
|
|
26
|
-
_id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
27
|
-
name: ""
|
|
28
|
-
}), e;
|
|
29
|
-
} else
|
|
30
|
-
return { ...D.generator.initMenuV4VariantGroup(), usedBy: [] };
|
|
31
|
-
}, t = E(k()), y = E(!1), i = E(!1), x = (e) => {
|
|
32
|
-
re.isBoolean(e) ? i.value = e : i.value = !i.value;
|
|
33
|
-
};
|
|
34
|
-
function $(e) {
|
|
35
|
-
t.value.options = e;
|
|
36
|
-
}
|
|
37
|
-
function q(e, a) {
|
|
38
|
-
const l = f(t.value.options), c = l.findIndex((v) => v._id == e);
|
|
39
|
-
l[c].name = a, t.value.options = l, c === t.value.options.length - 1 && O();
|
|
40
|
-
}
|
|
41
|
-
function O() {
|
|
42
|
-
const e = f(t.value.options);
|
|
43
|
-
t.value.options = [
|
|
44
|
-
...e,
|
|
45
|
-
{
|
|
46
|
-
_id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
47
|
-
name: ""
|
|
48
|
-
}
|
|
49
|
-
];
|
|
50
|
-
}
|
|
51
|
-
function P(e) {
|
|
52
|
-
const a = f(t.value.options);
|
|
53
|
-
t.value.options = a.filter((l) => l._id !== e);
|
|
54
|
-
}
|
|
55
|
-
C(
|
|
56
|
-
() => t.value.options,
|
|
57
|
-
(e) => {
|
|
58
|
-
e.length <= 0 && O();
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
immediate: !0
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
function T(e) {
|
|
65
|
-
const a = e.draggedContext.futureIndex, l = e.relatedContext.list;
|
|
66
|
-
return a !== l.length - 1;
|
|
67
|
-
}
|
|
68
|
-
const Y = ie(
|
|
69
|
-
() => {
|
|
70
|
-
if (r.initialValue) {
|
|
71
|
-
const e = t.value.options.filter((a) => !!a.name.trim());
|
|
72
|
-
return !Z.isEqual({ ...t.value, options: e }, r.initialValue);
|
|
73
|
-
} else
|
|
74
|
-
return !!(t.value.options.length > 1 || t.value.name.trim());
|
|
75
|
-
},
|
|
76
|
-
() => {
|
|
77
|
-
i.value = !1;
|
|
78
|
-
}
|
|
79
|
-
), z = async () => {
|
|
80
|
-
try {
|
|
81
|
-
y.value = !0;
|
|
82
|
-
const e = f(t.value);
|
|
83
|
-
e.options = e.options.filter((a) => !!a.name.trim()), r.initialValue ? await b.updateMenu(
|
|
84
|
-
{
|
|
85
|
-
module: S.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
86
|
-
operation: I.F_OPERATION_TYPE.update,
|
|
87
|
-
data: e
|
|
88
|
-
},
|
|
89
|
-
e.name
|
|
90
|
-
) : await b.updateMenu(
|
|
91
|
-
{
|
|
92
|
-
module: S.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
93
|
-
operation: I.F_OPERATION_TYPE.create,
|
|
94
|
-
data: e
|
|
95
|
-
},
|
|
96
|
-
e.name
|
|
97
|
-
), x(!1), t.value = { ...D.generator.initMenuV4VariantGroup(), usedBy: [] };
|
|
98
|
-
} finally {
|
|
99
|
-
y.value = !1;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
return C(
|
|
103
|
-
() => i.value,
|
|
104
|
-
(e) => {
|
|
105
|
-
e && (t.value = k());
|
|
106
|
-
}
|
|
107
|
-
), N({
|
|
108
|
-
show: i,
|
|
109
|
-
trigger: x
|
|
110
|
-
}), (e, a) => {
|
|
111
|
-
const l = g("fm-text-field"), c = g("fm-icon"), v = g("fm-button"), G = g("fm-side-sheet");
|
|
112
|
-
return V(), M(K, null, [
|
|
113
|
-
j(e.$slots, "default", { trigger: x }),
|
|
114
|
-
s(G, {
|
|
115
|
-
id: "variant-form",
|
|
116
|
-
modelValue: i.value,
|
|
117
|
-
"onUpdate:modelValue": a[2] || (a[2] = (_) => i.value = _),
|
|
118
|
-
"is-container": n(ne).FmForm,
|
|
119
|
-
"is-container-props": {
|
|
120
|
-
onValidationSuccess: z,
|
|
121
|
-
blameFormChildOnValidationFailed: !0
|
|
122
|
-
},
|
|
123
|
-
"max-width": 560,
|
|
124
|
-
"onOn:clickedAway": n(Y)
|
|
125
|
-
}, {
|
|
126
|
-
"side-sheet-header": m(() => [
|
|
127
|
-
d("p", ue, H(A.value), 1)
|
|
128
|
-
]),
|
|
129
|
-
"side-sheet-footer": m(() => [
|
|
130
|
-
d("div", fe, [
|
|
131
|
-
s(v, {
|
|
132
|
-
label: L.value,
|
|
133
|
-
loading: y.value,
|
|
134
|
-
size: "lg",
|
|
135
|
-
type: "submit",
|
|
136
|
-
variant: "primary"
|
|
137
|
-
}, null, 8, ["label", "loading"]),
|
|
138
|
-
s(v, {
|
|
139
|
-
label: n(o)("menu.common.actions.cancel"),
|
|
140
|
-
size: "lg",
|
|
141
|
-
variant: "tertiary",
|
|
142
|
-
onClick: a[1] || (a[1] = () => i.value = !1)
|
|
143
|
-
}, null, 8, ["label"])
|
|
144
|
-
])
|
|
145
|
-
]),
|
|
146
|
-
default: m(() => {
|
|
147
|
-
var _;
|
|
148
|
-
return [
|
|
149
|
-
d("div", me, [
|
|
150
|
-
s(le, {
|
|
151
|
-
title: n(o)("menu.variant.form.detail")
|
|
152
|
-
}, {
|
|
153
|
-
default: m(() => [
|
|
154
|
-
s(l, {
|
|
155
|
-
autofocus: "",
|
|
156
|
-
label: n(o)("menu.variant.form.name.label"),
|
|
157
|
-
"helper-text": n(o)("menu.variant.form.name.helper"),
|
|
158
|
-
modelValue: t.value.name,
|
|
159
|
-
"onUpdate:modelValue": a[0] || (a[0] = (u) => t.value.name = u),
|
|
160
|
-
rules: [(u) => !!u || n(o)("menu.variant.form.name.required")],
|
|
161
|
-
placeholder: n(o)("menu.variant.form.name.placeholder")
|
|
162
|
-
}, null, 8, ["label", "helper-text", "modelValue", "rules", "placeholder"]),
|
|
163
|
-
s(oe, {
|
|
164
|
-
label: n(o)("menu.variant.form.options.title")
|
|
165
|
-
}, {
|
|
166
|
-
default: m(() => [
|
|
167
|
-
d("div", null, [
|
|
168
|
-
s(n(ee), {
|
|
169
|
-
"model-value": t.value.options,
|
|
170
|
-
move: T,
|
|
171
|
-
class: "space-y-16",
|
|
172
|
-
group: "categories",
|
|
173
|
-
handle: ".handle",
|
|
174
|
-
"item-key": "_id",
|
|
175
|
-
"onUpdate:modelValue": $
|
|
176
|
-
}, {
|
|
177
|
-
item: m(({ element: u, index: p }) => [
|
|
178
|
-
d("div", {
|
|
179
|
-
class: J(["flex items-center", "space-x-8"]),
|
|
180
|
-
"data-not-allow-sort": p === t.value.options.length - 1
|
|
181
|
-
}, [
|
|
182
|
-
p !== t.value.options.length - 1 ? (V(), F(c, {
|
|
183
|
-
key: 0,
|
|
184
|
-
class: "handle",
|
|
185
|
-
name: "drag_handle"
|
|
186
|
-
})) : p > 0 ? (V(), M("div", ce)) : U("", !0),
|
|
187
|
-
d("div", pe, [
|
|
188
|
-
s(l, {
|
|
189
|
-
"model-value": u.name,
|
|
190
|
-
rules: [
|
|
191
|
-
() => !!t.value.options.length || n(o)("menu.variant.form.options.min_required"),
|
|
192
|
-
(h) => p === t.value.options.length - 1 || h ? !0 : n(o)("menu.variant.form.options.name_required")
|
|
193
|
-
],
|
|
194
|
-
class: "flex-1",
|
|
195
|
-
placeholder: n(o)("menu.variant.form.options.placeholder"),
|
|
196
|
-
"onUpdate:modelValue": (h) => q(u._id, h)
|
|
197
|
-
}, Q({ _: 2 }, [
|
|
198
|
-
p !== t.value.options.length - 1 ? {
|
|
199
|
-
name: "append",
|
|
200
|
-
fn: m(() => [
|
|
201
|
-
s(c, {
|
|
202
|
-
name: "close",
|
|
203
|
-
onClick: (h) => P(u._id)
|
|
204
|
-
}, null, 8, ["onClick"])
|
|
205
|
-
]),
|
|
206
|
-
key: "0"
|
|
207
|
-
} : void 0
|
|
208
|
-
]), 1032, ["model-value", "rules", "placeholder", "onUpdate:modelValue"])
|
|
209
|
-
])
|
|
210
|
-
], 8, de)
|
|
211
|
-
]),
|
|
212
|
-
_: 1
|
|
213
|
-
}, 8, ["model-value"])
|
|
214
|
-
])
|
|
215
|
-
]),
|
|
216
|
-
_: 1
|
|
217
|
-
}, 8, ["label"])
|
|
218
|
-
]),
|
|
219
|
-
_: 1
|
|
220
|
-
}, 8, ["title"]),
|
|
221
|
-
(_ = t.value.usedBy) != null && _.length ? (V(), F(se, {
|
|
222
|
-
key: 0,
|
|
223
|
-
editable: !1,
|
|
224
|
-
overrides: t.value.usedBy || [],
|
|
225
|
-
"select-variant": !1,
|
|
226
|
-
title: n(o)("menu.variant.form.applied_product")
|
|
227
|
-
}, null, 8, ["overrides", "title"])) : U("", !0)
|
|
228
|
-
])
|
|
229
|
-
];
|
|
230
|
-
}),
|
|
231
|
-
_: 1
|
|
232
|
-
}, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"])
|
|
233
|
-
], 64);
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
}), we = ve;
|
|
237
|
-
export {
|
|
238
|
-
we as V
|
|
239
|
-
};
|