@feedmepos/mf-menu-portal 1.0.4-dev.3 → 1.0.4-dev.4

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.
Files changed (80) hide show
  1. package/dist/{App-nS46pByh.js → App-CrpoLCjA.js} +3 -3
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C9OSr8ft.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js} +1 -1
  3. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-DnvN5R5w.js → BindingTable.vue_vue_type_script_setup_true_lang-D3CmOOPY.js} +1 -1
  4. package/dist/{Catalog-B4RS8T29.js → Catalog-VU3HhNro.js} +4 -4
  5. package/dist/{CatalogBinding-6_783kbu.js → CatalogBinding-BNATtZEY.js} +3 -3
  6. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-BawCLY5-.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BmG-xpW4.js} +3 -3
  7. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-BjP8ZXyb.js → CatalogEditor.vue_vue_type_script_setup_true_lang-BFsRDFpj.js} +7 -7
  8. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Diapahfp.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Bk4FqVmx.js} +14 -14
  9. package/dist/{Category-CqneIGq4.js → Category-DMoXTsfG.js} +5 -5
  10. package/dist/{Category-DNQH1CI7.js → Category-DxjdQ-NN.js} +2 -2
  11. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-B3Ts1O-9.js +847 -0
  12. package/dist/{CookingGuide-DTAiFmEL.js → CookingGuide-DiZZDYD-.js} +5 -5
  13. package/dist/{Group-DeUqUomY.js → Group-DFR8q-tt.js} +5 -5
  14. package/dist/{Group-5xO2j3CL.js → Group-rzfh_o6r.js} +2 -2
  15. package/dist/GroupList.vue_vue_type_script_setup_true_lang-DiN-wQXX.js +1807 -0
  16. package/dist/Ingredient-DpjGIuH9.js +505 -0
  17. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CnI80Ojd.js +782 -0
  18. package/dist/{MenuSetting-DdekHsQy.js → MenuSetting-DR-pDSF_.js} +4 -4
  19. package/dist/OrderPacing-JcTuweqF.js +769 -0
  20. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-C3SqQPSr.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-HwwJ2mGv.js} +2 -2
  21. package/dist/{Preview-DGTw0POk.js → Preview-BZyun5lZ.js} +1 -1
  22. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-DffhFv0Y.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-DquqNbE1.js} +1 -1
  23. package/dist/PrintRoute-CzEx2dCt.js +518 -0
  24. package/dist/{Product-CsbcyIgD.js → Product-CQb0n06E.js} +4 -4
  25. package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js +7931 -0
  26. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang--rBKdKV7.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-CBlDEjqF.js} +9 -9
  27. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-D8NQTCLx.js +2011 -0
  28. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-DtCzHjpN.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-cG47Pu-6.js} +1 -1
  29. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-aDx01-WW.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-0UwUcA2L.js} +630 -587
  30. package/dist/{ProductInternalTools-Ccd4dAmx.js → ProductInternalTools-QrBR1nFp.js} +2 -2
  31. package/dist/{ProductInventoryDialog-DYcKdKHi.js → ProductInventoryDialog-fV38GO1a.js} +1 -1
  32. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-DySFcCJz.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-Bzb3RrMg.js} +1 -1
  33. package/dist/ProductList.vue_vue_type_script_setup_true_lang-BwKQESr3.js +2765 -0
  34. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Dw2xiPYX.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-CDYcHXo1.js} +1 -1
  35. package/dist/{Products-phZwCZhU.js → Products-B8tysOAL.js} +3 -3
  36. package/dist/Publish-DTvOvFNa.js +1337 -0
  37. package/dist/Recipe-Ddx31csF.js +388 -0
  38. package/dist/{Scheduler-C-A5m92O.js → Scheduler-CST5L_cw.js} +314 -254
  39. package/dist/ServingSequence-DYyEZI2S.js +374 -0
  40. package/dist/{Setting-C24V-lps.js → Setting-Ip0pGjks.js} +6 -6
  41. package/dist/Subcategory-BIgjzVta.js +459 -0
  42. package/dist/{Takeaway-DywX5BiX.js → Takeaway-CekhGM-m.js} +2 -2
  43. package/dist/{Takeaway-BFP2ohJn.js → Takeaway-aXsPg4JT.js} +5 -5
  44. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-B3QS7o1v.js → TakeawayList.vue_vue_type_script_setup_true_lang-CaRR4_j3.js} +4 -4
  45. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CshqYpc9.js +1291 -0
  46. package/dist/Unit-BMW8u0Us.js +424 -0
  47. package/dist/{Variant-BBfWhH-s.js → Variant-CZsrYRMU.js} +5 -5
  48. package/dist/{_id_-BooM3FX1.js → _id_-D4swrvNa.js} +3 -3
  49. package/dist/{app-Bmgb8ACe.js → app-BWwwHsWi.js} +312 -312
  50. package/dist/app.js +1 -1
  51. package/dist/apps/mf-menu/src/app.d.ts +60 -0
  52. package/dist/apps/mf-menu/src/components/Product/BulkCategorySelect.vue.d.ts +37 -0
  53. package/dist/apps/mf-menu/src/components/Product/ProductAttributeFilter.vue.d.ts +11 -1
  54. package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +2 -2
  55. package/dist/apps/mf-menu/src/components/feature/NestedGroupManager/NestedGroupOverrideSheets.vue.d.ts +27 -0
  56. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesFilter.vue.d.ts +20 -0
  57. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  58. package/dist/assets/{menu-compute-CG-fX5pi.js → menu-compute-D7TdiHt4.js} +4 -4
  59. package/dist/assets/{validate-menu-BeGMWVns.js → validate-menu-DXppWUVq.js} +2 -2
  60. package/dist/mf-menu-portal.css +1 -1
  61. package/dist/{provide-CfF0FmUz.js → provide-CDmXzkhz.js} +67990 -66891
  62. package/dist/{useActionFeedback-DyUCQl2x.js → useActionFeedback-Dm2HDa_2.js} +1 -1
  63. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js → vuedraggable-CBtQLb_S.js} +140 -139
  64. package/package.json +2 -2
  65. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-Bt_onPrP.js +0 -797
  66. package/dist/GroupList.vue_vue_type_script_setup_true_lang-Dgya_JLB.js +0 -2183
  67. package/dist/Ingredient-BlDW3TfZ.js +0 -463
  68. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-0tCpJlOf.js +0 -709
  69. package/dist/OrderPacing-Bb2n5wmI.js +0 -698
  70. package/dist/PrintRoute-CJB4gIP2.js +0 -473
  71. package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D8DygCBl.js +0 -110
  72. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-J6LpJ5wT.js +0 -1257
  73. package/dist/ProductList.vue_vue_type_script_setup_true_lang-DTLslTpK.js +0 -10353
  74. package/dist/Publish-BeKIXu3z.js +0 -1261
  75. package/dist/Recipe-Fo4tBkBv.js +0 -350
  76. package/dist/ServingSequence-BrCwLSO7.js +0 -336
  77. package/dist/Subcategory-B0oZIKbw.js +0 -412
  78. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D7mhnrXx.js +0 -1213
  79. package/dist/Unit-NhEwH-kr.js +0 -385
  80. package/dist/apps/mf-menu/src/views/MenuManagementEditor/RestaurantAttributesFilter.vue.d.ts +0 -2
@@ -1,1257 +0,0 @@
1
- import { defineComponent as W, computed as E, toDisplayString as T, ref as oe, watch as se, openBlock as c, createBlock as O, createSlots as ye, withCtx as p, renderSlot as ue, createElementBlock as w, createVNode as s, createCommentVNode as N, nextTick as Le, resolveComponent as y, unref as n, createElementVNode as v, Fragment as K, renderList as Q, shallowRef as Ae, onBeforeUnmount as xe, h as _, mergeProps as ae } from "vue";
2
- import { useI18n as X, CustomAttributesForm as _e } from "@feedmepos/mf-common";
3
- import { useDialog as he, components as M } from "@feedmepos/ui-library";
4
- import { RemyButton as fe } from "@feedmepos/mf-remy-panel";
5
- import { _ as Ie } from "./AddPriceGroupDialog.vue_vue_type_script_setup_true_lang-DhKyG3gY.js";
6
- import { u as we } from "./useEditorValidation-Ctef5Bxt.js";
7
- import { b as ke, u as me } from "./provide-CfF0FmUz.js";
8
- import { _ as ze } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-B0j2PNih.js";
9
- import { _ as J, b as Ee } from "./TranslationLanguageSelector.vue_vue_type_script_setup_true_lang-BJZ6VcrT.js";
10
- import { a as Ne, _ as le } from "./FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js";
11
- import { _ as re } from "./FormItem.vue_vue_type_script_setup_true_lang-C2S6QCyR.js";
12
- import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
- import { a as Be, A as De, _ as Me } from "./LinkProductSideSheet.vue_vue_type_script_setup_true_lang-0tCpJlOf.js";
14
- import { u as Re } from "./useActionFeedback-DyUCQl2x.js";
15
- const Fe = /* @__PURE__ */ W({
16
- __name: "LocalizedCurrencySymbol",
17
- props: {
18
- currency: {}
19
- },
20
- setup(I) {
21
- const P = I, { n: b } = X(), f = E(() => {
22
- if (!P.currency) return "";
23
- const e = b(0, {
24
- useGrouping: !1,
25
- minimumFractionDigits: 0,
26
- maximumFractionDigits: 0
27
- });
28
- return b(0, {
29
- style: "currency",
30
- currency: P.currency,
31
- currencyDisplay: "narrowSymbol",
32
- useGrouping: !1,
33
- minimumFractionDigits: 0,
34
- maximumFractionDigits: 0
35
- }).replace(e, "").trim() || P.currency;
36
- });
37
- return (e, F) => T(f.value);
38
- }
39
- }), Ge = { key: 0 }, ie = /* @__PURE__ */ W({
40
- __name: "ProductMoneyField",
41
- props: {
42
- modelValue: {},
43
- currency: {},
44
- commitOnInput: { type: Boolean }
45
- },
46
- emits: ["update:modelValue"],
47
- setup(I, { expose: P, emit: b }) {
48
- const f = I, e = b, { n: F, locale: L } = X(), C = oe();
49
- P({
50
- inputEl: E(() => {
51
- var u;
52
- return ((u = C.value) == null ? void 0 : u.inputEl) ?? null;
53
- }),
54
- focus: () => {
55
- var u, S;
56
- return (S = (u = C.value) == null ? void 0 : u.inputEl) == null ? void 0 : S.focus();
57
- }
58
- });
59
- const g = E(
60
- () => f.modelValue === null ? "" : F(f.modelValue, {
61
- minimumFractionDigits: 2,
62
- maximumFractionDigits: 2,
63
- useGrouping: !1
64
- })
65
- ), a = oe(g.value);
66
- se(g, (u) => {
67
- a.value = u;
68
- });
69
- async function j() {
70
- var U, Y, i;
71
- const u = ((Y = (U = C.value) == null ? void 0 : U.inputEl) == null ? void 0 : Y.value) ?? "", S = ((i = new Intl.NumberFormat(L.value).formatToParts(1.5).find((r) => r.type === "decimal")) == null ? void 0 : i.value) ?? ".", x = u.trim() === "" ? null : Number(u.replace(S, "."));
72
- (x === null || Number.isFinite(x)) && e("update:modelValue", x), await Le(), a.value = g.value;
73
- }
74
- async function l(u) {
75
- var U;
76
- if (a.value = String(u ?? ""), !f.commitOnInput) return;
77
- const S = ((U = new Intl.NumberFormat(L.value).formatToParts(1.5).find((Y) => Y.type === "decimal")) == null ? void 0 : U.value) ?? ".", x = a.value.trim() === "" ? null : Number(a.value.replace(S, "."));
78
- (x === null || Number.isFinite(x)) && e("update:modelValue", x);
79
- }
80
- function $(u) {
81
- var S, x;
82
- u ? (x = (S = C.value) == null ? void 0 : S.inputEl) == null || x.select() : j();
83
- }
84
- function R(u) {
85
- u.key === "Enter" && !u.isComposing && j();
86
- }
87
- return se(
88
- () => {
89
- var u;
90
- return ((u = C.value) == null ? void 0 : u.inputEl) ?? null;
91
- },
92
- (u, S, x) => {
93
- u && (u.addEventListener("keydown", R), x(() => u.removeEventListener("keydown", R)));
94
- },
95
- { immediate: !0, flush: "post" }
96
- ), (u, S) => (c(), O(J, {
97
- ref_key: "field",
98
- ref: C,
99
- "model-value": a.value,
100
- inputmode: "decimal",
101
- "onUpdate:modelValue": l,
102
- onFocusChanged: $
103
- }, ye({
104
- prepend: p(() => [
105
- u.currency ? (c(), w("span", Ge, [
106
- s(Fe, { currency: u.currency }, null, 8, ["currency"])
107
- ])) : N("", !0)
108
- ]),
109
- append: p(() => [
110
- ue(u.$slots, "append")
111
- ]),
112
- _: 2
113
- }, [
114
- u.$slots["helper-text"] ? {
115
- name: "helper-text",
116
- fn: p(() => [
117
- ue(u.$slots, "helper-text")
118
- ]),
119
- key: "0"
120
- } : void 0
121
- ]), 1032, ["model-value"]));
122
- }
123
- }), Ro = /* @__PURE__ */ W({
124
- __name: "ProductPriceTierButton",
125
- props: {
126
- configured: { type: Boolean },
127
- label: {},
128
- disabled: { type: Boolean }
129
- },
130
- emits: ["open"],
131
- setup(I, { emit: P }) {
132
- const b = P, { t: f } = X();
133
- return (e, F) => {
134
- const L = y("FmButton"), C = y("FmTooltip");
135
- return c(), O(C, {
136
- content: n(f)("menu.price_tier.price_tier_config"),
137
- "z-index": 999,
138
- placement: "top"
139
- }, {
140
- default: p(() => [
141
- s(L, {
142
- icon: "price_change",
143
- variant: "tertiary",
144
- "text-color": "neutral-gray-400",
145
- "overwrite-icon-outline": e.configured ? "filled" : "outline",
146
- "aria-label": e.label,
147
- disabled: e.disabled,
148
- onClick: F[0] || (F[0] = (g) => b("open"))
149
- }, null, 8, ["overwrite-icon-outline", "aria-label", "disabled"])
150
- ]),
151
- _: 1
152
- }, 8, ["content"]);
153
- };
154
- }
155
- }), Ke = { class: "flex flex-col gap-8 p-8" }, je = { class: "fm-typo-en-body-md-600" }, Ye = { class: "flex flex-col gap-4" }, He = { key: 0 }, qe = /* @__PURE__ */ W({
156
- __name: "ProductMemberPriceTooltip",
157
- props: {
158
- prices: {},
159
- currency: {}
160
- },
161
- setup(I) {
162
- const P = I, { t: b, n: f } = X(), e = E(
163
- () => Object.entries(P.prices).flatMap(
164
- ([F, L]) => L === null ? [] : [{ name: F, amount: L }]
165
- )
166
- );
167
- return (F, L) => {
168
- const C = y("FmIcon"), g = y("FmTooltip");
169
- return c(), O(g, {
170
- variant: "plain",
171
- placement: "right",
172
- "z-index": 100
173
- }, {
174
- default: p(() => [
175
- s(C, {
176
- name: "info",
177
- outline: ""
178
- })
179
- ]),
180
- content: p(() => [
181
- v("div", Ke, [
182
- v("p", je, T(n(b)("menu.member_pricing.title")), 1),
183
- v("ul", Ye, [
184
- e.value.length === 0 ? (c(), w("li", He, T(n(b)("menu.member_pricing.tooltip.no_member_price")), 1)) : N("", !0),
185
- (c(!0), w(K, null, Q(e.value, (a) => (c(), w("li", {
186
- key: a.name,
187
- class: "fm-typo-en-body-md-400"
188
- }, T(n(b)("menu.common.labels.a11y_labelled_name", {
189
- label: a.name,
190
- name: n(f)(
191
- a.amount,
192
- F.currency ? { style: "currency", currency: F.currency, minimumFractionDigits: 2 } : { minimumFractionDigits: 2 }
193
- )
194
- })), 1))), 128))
195
- ])
196
- ])
197
- ]),
198
- _: 1
199
- });
200
- };
201
- }
202
- }), Je = { class: "fm-typo-en-title-md-600" }, Qe = {
203
- key: 0,
204
- class: "flex flex-col gap-32"
205
- }, We = { class: "flex flex-col fm-corner-radius-lg p-16 border border-fm-color-neutral-gray-100 gap-4" }, Xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ze = {
206
- key: 0,
207
- class: "fm-typo-en-body-lg-600"
208
- }, eo = { class: "flex flex-col gap-24" }, oo = { class: "fm-typo-en-title-sm-600" }, no = { class: "flex flex-col gap-16" }, to = { class: "flex flex-col gap-4" }, lo = { class: "fm-typo-en-body-lg-600" }, ao = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, io = {
209
- key: 1,
210
- class: "py-16 space-y-32"
211
- }, ro = { class: "space-y-8" }, so = { class: "flex items-center justify-between" }, uo = { class: "space-y-8" }, mo = { class: "fm-typo-en-body-lg-600" }, co = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, po = { class: "flex gap-8" }, Go = /* @__PURE__ */ W({
212
- __name: "ProductPricingSheet",
213
- props: {
214
- session: {},
215
- onCreatePriceGroup: { type: Function, default: void 0 },
216
- zIndex: { default: void 0 },
217
- mainPricingLabel: { type: Boolean, default: !0 }
218
- },
219
- emits: ["close", "suggest"],
220
- setup(I, { emit: P }) {
221
- const b = I, f = P, { t: e } = X(), F = he(), L = ke(), C = me(b.session), g = E(
222
- () => C.value.status === "ready" ? C.value.value : null
223
- ), a = we(() => b.session);
224
- function j(i, r) {
225
- var k;
226
- const h = a.issue(((k = g.value) == null ? void 0 : k.fieldIssues) ?? {}, `rows.${i}.amount`) ?? r.issue;
227
- return h ? [L(h)] : [];
228
- }
229
- function l(i) {
230
- var h;
231
- const r = a.issue(
232
- ((h = g.value) == null ? void 0 : h.fieldIssues) ?? {},
233
- `rows.0.members.${i.key}`
234
- ) ?? i.issue;
235
- return r ? [L(r)] : [];
236
- }
237
- const $ = Ae(null);
238
- function R() {
239
- var i;
240
- (i = $.value) == null || i.dispose(), $.value = null;
241
- }
242
- function u(i) {
243
- R(), $.value = b.session.memberEditor(i);
244
- }
245
- xe(R);
246
- const S = E(() => [
247
- {
248
- accessorKey: "key",
249
- header: () => e(
250
- "menu.product.form.member_price.configure.member_selling_price.table.tier"
251
- ),
252
- enableSorting: !1
253
- },
254
- {
255
- id: "amount",
256
- header: () => e(
257
- "menu.product.form.member_price.configure.member_selling_price.table.selling_price"
258
- ),
259
- enableSorting: !1,
260
- cell: ({ row: i }) => _(
261
- ie,
262
- {
263
- modelValue: i.original.amount,
264
- commitOnInput: !0,
265
- "aria-label": i.original.key,
266
- errorMessages: l(i.original),
267
- ...a.field(
268
- `rows.0.members.${i.original.key}`,
269
- (r) => {
270
- var h, k;
271
- return b.session.setAmount(
272
- ((k = (h = g.value) == null ? void 0 : h.rows[0]) == null ? void 0 : k.tier) ?? null,
273
- i.original.key,
274
- r
275
- );
276
- }
277
- )
278
- },
279
- {
280
- append: () => {
281
- var r;
282
- return (r = g.value) != null && r.showSuggestion ? _(fe, {
283
- pureStyling: !0,
284
- class: "shrink-0 scale-75",
285
- "aria-label": e("menu.product.remy.pricing"),
286
- onClick: () => f("suggest")
287
- }) : null;
288
- }
289
- }
290
- )
291
- }
292
- ]), x = E(() => [
293
- {
294
- accessorKey: "tier",
295
- header: () => e("menu.price_tier.form.table.columns.name"),
296
- enableSorting: !1
297
- },
298
- {
299
- id: "amount",
300
- header: () => e("menu.price_tier.form.table.columns.price"),
301
- enableSorting: !1,
302
- cell: ({ row: i }) => _(ie, {
303
- modelValue: i.original.amount,
304
- commitOnInput: !0,
305
- // Every tier row rendered this field under one name, so a step naming
306
- // a particular tier's price had nothing to distinguish the rows by.
307
- // Qualify it with the tier, as the frozen baselines name it
308
- // ("Default selling price: DISC TIER CLEAR").
309
- "aria-label": i.original.tier ? e("menu.common.labels.a11y_labelled_name", {
310
- label: e(
311
- "menu.product.form.member_price.configure.default_selling_price"
312
- ),
313
- name: i.original.tier
314
- }) : e(
315
- "menu.product.form.member_price.configure.default_selling_price"
316
- ),
317
- errorMessages: j(i.index, i.original),
318
- ...a.field(
319
- `rows.${i.index}.amount`,
320
- (r) => b.session.setAmount(i.original.tier, null, r)
321
- )
322
- })
323
- },
324
- {
325
- id: "members",
326
- header: () => e("menu.price_tier.form.table.columns.member_price"),
327
- enableSorting: !1,
328
- cell: ({ row: i }) => {
329
- var k;
330
- const r = i.original.members.filter(
331
- (B) => B.amount !== null
332
- ).length, h = r ? e("menu.product.form.member_price.configure.title_with_tier", {
333
- num: r
334
- }) : e("menu.product.form.member_price.configure.title");
335
- return _("div", { class: "flex items-center justify-between" }, [
336
- _(
337
- M.FmButton,
338
- {
339
- variant: "plain",
340
- label: h,
341
- // This is the nested pricing-sheet action. Keep it distinct from
342
- // the product form's row-level "Member price" action while
343
- // qualifying the tier, so both independently reachable surfaces
344
- // stay semantic.
345
- "aria-label": r ? h : i.original.tier ? e("menu.common.labels.a11y_labelled_name", {
346
- label: e(
347
- "menu.product.form.member_price.configure.title"
348
- ),
349
- name: i.original.tier
350
- }) : void 0,
351
- onClick: () => i.original.tier && u(i.original.tier)
352
- },
353
- {
354
- default: () => _(
355
- "span",
356
- { class: "underline line-clamp-2 break-all" },
357
- h
358
- )
359
- }
360
- ),
361
- _(qe, {
362
- prices: Object.fromEntries(
363
- i.original.members.map((B) => [B.key, B.amount])
364
- ),
365
- currency: (k = g.value) == null ? void 0 : k.currency
366
- })
367
- ]);
368
- }
369
- }
370
- ]);
371
- function U() {
372
- var r;
373
- if (b.session.apply()) {
374
- f("close");
375
- return;
376
- }
377
- const i = Object.entries(((r = g.value) == null ? void 0 : r.fieldIssues) ?? {}).flatMap(
378
- ([h, k]) => (k ?? []).map((B) => ({ ...B, field: h }))
379
- );
380
- a.submit(async () => ({ kind: "rejected", issues: i }));
381
- }
382
- function Y() {
383
- b.onCreatePriceGroup && F.open({
384
- zIndex: 200,
385
- title: e("menu.price_tier.add_price_group"),
386
- contentComponent: Ie,
387
- primaryActions: {
388
- text: e("menu.category.manager.dialog.add.action"),
389
- close: !1
390
- },
391
- secondaryActions: {
392
- text: e("menu.common.actions.cancel"),
393
- close: !0
394
- }
395
- }).onPrimary(async (i) => {
396
- const r = String(i ?? "");
397
- await b.onCreatePriceGroup(r) && (b.session.addTier(r), F.close());
398
- });
399
- }
400
- return (i, r) => {
401
- var G;
402
- const h = y("FmTable"), k = y("FmButton"), B = y("FmSideSheet"), Z = y("ProductPricingSheet", !0);
403
- return c(), w(K, null, [
404
- s(B, {
405
- "model-value": !0,
406
- "z-index": b.zIndex ?? 300,
407
- "max-width": ((G = g.value) == null ? void 0 : G.mode) === "members" ? 720 : 560,
408
- "is-container": n(M).FmForm,
409
- "is-container-props": {
410
- onValidationSuccess: U,
411
- blameFormChildOnValidationFailed: !0
412
- },
413
- "onUpdate:modelValue": r[2] || (r[2] = (z) => !z && f("close"))
414
- }, {
415
- "side-sheet-header": p(() => {
416
- var z;
417
- return [
418
- v("p", Je, T(n(e)(
419
- ((z = g.value) == null ? void 0 : z.mode) === "tiers" ? "menu.price_tier.price_tier_config" : "menu.product.form.member_price.configure.title"
420
- )), 1)
421
- ];
422
- }),
423
- "side-sheet-footer": p(() => {
424
- var z, H, D;
425
- return [
426
- v("div", po, [
427
- s(k, {
428
- label: ((z = g.value) == null ? void 0 : z.mode) === "tiers" ? n(e)("menu.common.actions.update") : n(e)("menu.common.actions.apply"),
429
- "aria-label": ((H = g.value) == null ? void 0 : H.mode) === "tiers" ? n(e)("menu.price_tier.action.update") : void 0,
430
- variant: "primary",
431
- size: "lg",
432
- type: "button",
433
- onClick: U
434
- }, null, 8, ["label", "aria-label"]),
435
- s(k, {
436
- label: n(e)("menu.common.actions.cancel"),
437
- "aria-label": ((D = g.value) == null ? void 0 : D.mode) === "tiers" ? n(e)("menu.price_tier.action.cancel") : n(e)("menu.product.form.member_price.configure.cancel"),
438
- variant: "tertiary",
439
- size: "lg",
440
- onClick: r[1] || (r[1] = (ee) => f("close"))
441
- }, null, 8, ["label", "aria-label"])
442
- ])
443
- ];
444
- }),
445
- default: p(() => {
446
- var z, H;
447
- return [
448
- ((z = g.value) == null ? void 0 : z.mode) === "members" ? (c(), w("div", Qe, [
449
- v("div", We, [
450
- v("p", Xe, T(n(e)("menu.product.form.member_price.configure.current_configuration")), 1),
451
- g.value.configurationName || i.mainPricingLabel ? (c(), w("p", Ze, T(g.value.configurationName ?? n(e)("menu.product.form.member_price.configure.main_pricing")), 1)) : N("", !0)
452
- ]),
453
- v("div", eo, [
454
- v("p", oo, T(n(e)("menu.product.form.member_price.configure.pricing_grid")), 1),
455
- (c(!0), w(K, null, Q(g.value.rows, (D, ee) => (c(), O(ie, ae(
456
- {
457
- key: D.tier ?? "base",
458
- class: "w-[258px] xs:w-full",
459
- label: n(e)("menu.product.form.member_price.configure.default_selling_price"),
460
- "model-value": D.amount,
461
- "commit-on-input": "",
462
- currency: g.value.currency,
463
- "error-messages": j(ee, D)
464
- },
465
- { ref_for: !0 },
466
- n(a).field(
467
- `rows.${ee}.amount`,
468
- (ne) => i.session.setAmount(D.tier, null, ne)
469
- )
470
- ), {
471
- append: p(() => [
472
- g.value.showSuggestion ? (c(), O(n(fe), {
473
- key: 0,
474
- "pure-styling": "",
475
- class: "shrink-0 scale-75",
476
- "aria-label": n(e)("menu.product.remy.pricing"),
477
- onClick: r[0] || (r[0] = (ne) => f("suggest"))
478
- }, null, 8, ["aria-label"])) : N("", !0)
479
- ]),
480
- _: 2
481
- }, 1040, ["label", "model-value", "currency", "error-messages"]))), 128))
482
- ]),
483
- v("div", no, [
484
- v("div", to, [
485
- v("p", lo, T(n(e)(
486
- "menu.product.form.member_price.configure.member_selling_price.label"
487
- )), 1),
488
- v("p", ao, T(n(e)(
489
- "menu.product.form.member_price.configure.member_selling_price.sublabel"
490
- )), 1)
491
- ]),
492
- s(h, {
493
- "column-defs": S.value,
494
- "row-data": [...((H = g.value.rows[0]) == null ? void 0 : H.members) ?? []],
495
- "hide-footer": ""
496
- }, null, 8, ["column-defs", "row-data"])
497
- ])
498
- ])) : g.value ? (c(), w("div", io, [
499
- v("div", ro, [
500
- v("div", so, [
501
- v("div", uo, [
502
- v("p", mo, T(n(e)("menu.price_tier.price_group")), 1),
503
- v("p", co, T(n(e)("menu.price_tier.description")), 1)
504
- ]),
505
- b.onCreatePriceGroup ? (c(), O(k, {
506
- key: 0,
507
- class: "min-w-fit",
508
- label: n(e)("menu.price_tier.add_price_group"),
509
- icon: "add",
510
- variant: "secondary",
511
- onClick: Y
512
- }, null, 8, ["label"])) : N("", !0)
513
- ]),
514
- s(h, {
515
- "column-defs": x.value,
516
- "row-data": [...g.value.rows],
517
- "hide-footer": ""
518
- }, null, 8, ["column-defs", "row-data"])
519
- ])
520
- ])) : N("", !0)
521
- ];
522
- }),
523
- _: 1
524
- }, 8, ["z-index", "max-width", "is-container", "is-container-props"]),
525
- $.value ? (c(), O(Z, {
526
- key: 0,
527
- session: $.value,
528
- "z-index": (b.zIndex ?? 300) + 100,
529
- "main-pricing-label": i.mainPricingLabel,
530
- onClose: R
531
- }, null, 8, ["session", "z-index", "main-pricing-label"])) : N("", !0)
532
- ], 64);
533
- };
534
- }
535
- }), go = {}, bo = { class: "flex gap-16" };
536
- function vo(I, P) {
537
- return c(), w("div", bo, [
538
- ue(I.$slots, "default")
539
- ]);
540
- }
541
- const _o = /* @__PURE__ */ Ue(go, [["render", vo]]), fo = { class: "fm-typo-en-title-md-600" }, yo = {
542
- key: 0,
543
- class: "pt-8 space-y-32"
544
- }, xo = { class: "xs:overflow-x-scroll" }, ho = { class: "xs:min-w-[640px]" }, wo = { class: "flex gap-8 items-center justify-start" }, ko = { class: "fm-typo-en-title-md-600" }, Fo = { class: "pt-8 space-y-24" }, Co = { class: "flex gap-8 flex-wrap" }, $o = { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, So = { class: "flex gap-8" }, Ko = /* @__PURE__ */ W({
545
- __name: "ProductGroupCreateSheet",
546
- props: {
547
- sdk: {},
548
- presentation: {}
549
- },
550
- emits: ["close", "created"],
551
- setup(I, { emit: P }) {
552
- const b = I, f = P, { t: e } = X(), F = y("i18n-t"), L = ke(), { run: C } = Re(), g = he(), a = b.sdk.group.creationEditor(
553
- b.presentation === "tree" ? { surface: "editor" } : void 0
554
- ), j = me(a), l = E(
555
- () => j.value.status === "ready" ? j.value.value : null
556
- ), $ = we(() => a), R = E(
557
- () => {
558
- var o;
559
- return Object.fromEntries(
560
- Object.entries(((o = l.value) == null ? void 0 : o.attributeValueOptions) ?? {}).map(
561
- ([t, V]) => [t, [...V]]
562
- )
563
- );
564
- }
565
- ), u = me(b.sdk.linkProduct.catalogue), S = E(
566
- () => u.value.status === "ready" ? u.value.value : null
567
- ), x = oe(!1), U = oe({}), Y = E(
568
- () => {
569
- var o;
570
- return (((o = l.value) == null ? void 0 : o.options) ?? []).map((t) => ({
571
- ...t,
572
- subRows: t.variants
573
- }));
574
- }
575
- ), i = (o) => o.combinationKey ? `${o.id}:${o.combinationKey}` : o.id, r = (o, t, V, q) => o.combinationKey ? e("menu.common.labels.a11y_labelled_name", {
576
- label: e(V),
577
- name: o.name || o.inheritedName
578
- }) : q ? e(q, { index: t + 1 }) : e("menu.group.a11y.row", { label: e(V), index: t + 1 });
579
- function h(o) {
580
- a.setProducts([...o]), x.value = !1;
581
- }
582
- function k() {
583
- a.cancelTranslation();
584
- }
585
- function B() {
586
- var o;
587
- if (!((o = l.value) != null && o.translationDirty)) {
588
- a.cancelTranslation();
589
- return;
590
- }
591
- g.open({
592
- title: e("menu.common.dialog.discard.title"),
593
- message: e("menu.common.dialog.discard.message"),
594
- primaryActions: {
595
- text: e("menu.common.actions.discard"),
596
- close: !0,
597
- variant: "destructive"
598
- },
599
- secondaryActions: {
600
- text: e("menu.common.actions.cancel"),
601
- close: !0
602
- }
603
- }).onPrimary(() => a.cancelTranslation());
604
- }
605
- xe(() => a.dispose());
606
- const Z = (o) => l.value ? $.issue(l.value.fieldIssues, o) ?? l.value.issues.find((t) => t.field === o) : void 0, G = (o) => {
607
- const t = Z(o);
608
- return t ? L(t) : "";
609
- }, z = ["NORMAL", "PRODUCT", "DYNAMIC"], H = oe(0);
610
- function D() {
611
- a.confirmTypeChange(!1), H.value += 1;
612
- }
613
- se(
614
- () => {
615
- var o;
616
- return (o = l.value) == null ? void 0 : o.typeChange;
617
- },
618
- (o) => {
619
- o && g.open({
620
- title: e("menu.common.dialog.change_type.title"),
621
- message: e("menu.common.dialog.change_type.message"),
622
- primaryActions: { text: e("menu.common.actions.yes"), close: !0 },
623
- secondaryActions: { text: e("menu.common.actions.no"), close: !0 }
624
- }).onPrimary(() => a.confirmTypeChange(!0)).onSecondary(() => D()).onClose(() => D());
625
- }
626
- );
627
- async function ee() {
628
- var V;
629
- const o = ((V = l.value) == null ? void 0 : V.name) ?? "";
630
- (await C(() => $.submit(() => a.submit()), {
631
- showLoading: () => {
632
- var q;
633
- return ((q = l.value) == null ? void 0 : q.status) === "submitting";
634
- }
635
- })).kind === "success" && (f("created", o), f("close"));
636
- }
637
- const ne = E(() => [
638
- {
639
- accessorKey: "isDefault",
640
- size: 35,
641
- header: () => e("menu.group.option.is_default"),
642
- enableSorting: !1,
643
- cell: (o) => (
644
- // A product with variants has no default of its own; its
645
- // combinations do (OptionTable.vue:143-145).
646
- o.row.original.variants.length ? null : _(M.FmCheckbox, {
647
- modelValue: o.row.original.isDefault,
648
- value: i(o.row.original),
649
- "aria-label": r(
650
- o.row.original,
651
- o.row.index,
652
- "menu.group.option.is_default"
653
- ),
654
- "onUpdate:modelValue": (t) => {
655
- a.setOption(
656
- o.row.original.id,
657
- { isDefault: t },
658
- o.row.original.combinationKey
659
- ), $.touch("options");
660
- }
661
- })
662
- )
663
- },
664
- {
665
- accessorKey: "code",
666
- size: 100,
667
- header: () => e("menu.group.option.code"),
668
- enableSorting: !1,
669
- cell: (o) => _("div", { class: "break-all max-w-[100px]" }, o.row.original.code)
670
- },
671
- {
672
- accessorKey: "name",
673
- header: () => {
674
- var o;
675
- return _("div", { class: "flex items-center w-full gap-8" }, [
676
- _("span", e("menu.group.option.product_title")),
677
- ((o = l.value) == null ? void 0 : o.showTranslation) === !1 ? null : _(M.FmButton, {
678
- icon: "g_translate",
679
- variant: "tertiary",
680
- textColor: "neutral-gray-400",
681
- // Distinct from the group-name translate button below, AND from
682
- // every field's own name: `getByLabel` is substring-matching, so
683
- // "Translate group name" made the "Group name" textbox resolve two
684
- // elements and the frozen create input could not run at all. Both
685
- // are named so that no control's accessible name contains another's
686
- // (including the collision that the first renaming created).
687
- // Distinct from the group-name translate button below: both are
688
- // `g_translate` FmButtons inside one side sheet, and one shared
689
- // name made two controls of one role indistinguishable — the same
690
- // ADR-0003 §1 condition as on the option cells. Neither name is
691
- // visible, so this changes no rendering.
692
- "aria-label": e("menu.group.translation.translate_options"),
693
- onClick: () => a.beginTranslation("options")
694
- })
695
- ]);
696
- },
697
- enableSorting: !1,
698
- cell: (o) => _(
699
- J,
700
- {
701
- class: "min-w-[300px]",
702
- modelValue: o.row.original.name,
703
- placeholder: o.row.original.inheritedName,
704
- errorMessages: Z(`option.${o.row.original.id}.name`) ? [G(`option.${o.row.original.id}.name`)] : [],
705
- // Named PER ROW: "Option 1 title", "Option 2 title", …
706
- //
707
- // The accessible name is an addition the MIGRATED app owns — legacy
708
- // renders these cells unlabelled, with no accessible name at all, so
709
- // nothing here is matched to legacy's DOM. One shared name was the
710
- // first attempt and it could not work: after the second "Add option"
711
- // two textboxes answer to it, so a locator that must resolve one
712
- // element fails. The index has to lead rather than trail, because
713
- // `getByLabel` is substring-matching — "Option title 1"
714
- // and "Option title 2" would both still match a recorded
715
- // "Option title", while "Option 1 title" is not a substring of
716
- // "Option 2 title". Owner-approved 2026-09-08 together with the
717
- // baseline refresh that re-records the four steps against these names.
718
- //
719
- // The visible column header stays "Title", which is what the golden
720
- // shows; this is the accessible name only.
721
- "aria-label": r(
722
- o.row.original,
723
- o.row.index,
724
- "menu.group.option.product_title",
725
- "menu.group.option.option_title_numbered"
726
- ),
727
- ...$.field(
728
- `option.${o.row.original.id}.name`,
729
- (t) => a.setOption(
730
- o.row.original.id,
731
- { name: t },
732
- o.row.original.combinationKey
733
- )
734
- )
735
- },
736
- o.row.original.variants.length ? {
737
- // Legacy puts the toggle inside the title field
738
- // (OptionTable.vue:228-243).
739
- append: () => _(
740
- "button",
741
- {
742
- type: "button",
743
- class: "flex",
744
- "aria-label": e(
745
- o.row.getIsExpanded() ? "menu.apply_product.table.collapse_combinations" : "menu.apply_product.table.expand_combinations",
746
- {
747
- name: o.row.original.name || o.row.original.inheritedName
748
- }
749
- ),
750
- onClick: o.row.getToggleExpandedHandler()
751
- },
752
- _(M.FmIcon, {
753
- name: "keyboard_arrow_up",
754
- class: [
755
- "cursor-pointer transition-transform",
756
- o.row.getIsExpanded() ? "rotate-180" : ""
757
- ]
758
- })
759
- )
760
- } : void 0
761
- )
762
- },
763
- {
764
- accessorKey: "priceAmount",
765
- size: 400,
766
- header: () => _(
767
- F,
768
- { keypath: "menu.group.option.price", tag: "span" },
769
- {
770
- symbol: () => {
771
- var o;
772
- return _(Fe, { currency: (o = l.value) == null ? void 0 : o.currency });
773
- }
774
- }
775
- ),
776
- enableSorting: !1,
777
- cell: (o) => (
778
- // Legacy wraps the price control in `flex items-center gap-8`
779
- // (`portal .../GroupManager/OptionTable.vue:290`), so the input takes
780
- // its natural width inside the 400px column instead of stretching to
781
- // fill it. Without the wrapper the field runs ~127px wider than the
782
- // frozen `group/v3-create/form-normal` golden shows.
783
- _("div", { class: "flex items-center gap-8" }, [
784
- _(ie, {
785
- modelValue: o.row.original.priceAmount,
786
- // Indexed for the same reason as the title above; the visible
787
- // header keeps its currency symbol.
788
- "aria-label": r(
789
- o.row.original,
790
- o.row.index,
791
- "menu.group.option.price",
792
- "menu.group.option.option_price_numbered"
793
- ),
794
- "onUpdate:modelValue": (t) => a.setOption(
795
- o.row.original.id,
796
- { priceAmount: t },
797
- o.row.original.combinationKey
798
- )
799
- })
800
- ])
801
- )
802
- },
803
- {
804
- accessorKey: "orderFrom",
805
- size: 100,
806
- header: () => e("menu.common.labels.order_from"),
807
- enableSorting: !1,
808
- cell: (o) => _(M.FmSelect, {
809
- modelValue: o.row.original.orderFrom,
810
- disabled: !o.row.original.editOrderFrom,
811
- "aria-label": r(
812
- o.row.original,
813
- o.row.index,
814
- "menu.common.labels.order_from"
815
- ),
816
- items: ["ALL", "POS_ONLY", "NONE"].map((t) => ({
817
- value: t,
818
- label: e(Be[t])
819
- })),
820
- "onUpdate:modelValue": (t) => a.setOption(
821
- o.row.original.id,
822
- { orderFrom: t },
823
- o.row.original.combinationKey
824
- )
825
- })
826
- },
827
- {
828
- id: "action",
829
- meta: { cellClass: "" },
830
- size: 80,
831
- enableSorting: !1,
832
- cell: (o) => {
833
- var t;
834
- return _("div", { class: "flex items-center justify-end" }, [
835
- // Legacy offers inventory binding on an option row for every V4 group
836
- // and, on V3, only for a NORMAL one. It is rendered disabled for the
837
- // same reason as the nested-group affordance below: no approved
838
- // scenario in this module covers an inventory intent, so there is
839
- // nothing to open, but the button's presence is part of the frozen
840
- // `group/v3-create/form-normal` layout — it is what narrows the Price
841
- // column to the width the golden shows.
842
- ...(t = l.value) != null && t.showInventory ? [
843
- _(M.FmButton, {
844
- prependIcon: "inventory_2",
845
- variant: "tertiary",
846
- textColor: "neutral-gray-400",
847
- disabled: !0,
848
- "aria-label": r(
849
- o.row.original,
850
- o.row.index,
851
- "menu.group.option.inventory"
852
- )
853
- })
854
- ] : [],
855
- // Legacy retains the disabled nested-group affordance on empty rows.
856
- // There is no nested edit intent when the product links no groups.
857
- ...o.row.original.nestedGroupCount ? [] : [
858
- _(M.FmButton, {
859
- prependIcon: "arrow_split",
860
- variant: "tertiary",
861
- textColor: "neutral-gray-400",
862
- disabled: !0,
863
- "aria-label": r(
864
- o.row.original,
865
- o.row.index,
866
- "menu.group.nested.title"
867
- )
868
- })
869
- ],
870
- _(M.FmButton, {
871
- prependIcon: "delete",
872
- variant: "tertiary",
873
- textColor: "neutral-gray-400",
874
- "aria-label": r(
875
- o.row.original,
876
- o.row.index,
877
- "menu.common.actions.remove"
878
- ),
879
- // A combination is removed with its product (OptionTable.vue:547-556).
880
- disabled: !!o.row.original.combinationKey,
881
- onClick: () => a.removeOption(o.row.original.id)
882
- })
883
- ]);
884
- }
885
- }
886
- ]);
887
- return (o, t) => {
888
- var ge, be, ve;
889
- const V = y("FmButton"), q = y("FmTooltip"), ce = y("FmStepperField"), de = y("FmFormGroup"), Ce = y("FmRadio"), $e = y("FmRadioGroup"), Se = y("FmSwitch"), Te = y("FmTable"), pe = y("FmSideSheet"), Pe = y("FmChip"), Ve = y("FmSelect");
890
- return c(), w(K, null, [
891
- s(pe, {
892
- "model-value": !0,
893
- "max-width": o.presentation === "tree" ? 720 : 800,
894
- "is-container": n(M).FmForm,
895
- "is-container-props": { onValidationSuccess: ee },
896
- "onUpdate:modelValue": t[9] || (t[9] = (m) => !m && f("close"))
897
- }, {
898
- "side-sheet-header": p(() => [
899
- v("p", fo, T(n(e)("menu.group.add")), 1)
900
- ]),
901
- "side-sheet-footer": p(() => {
902
- var m;
903
- return [
904
- v("div", wo, [
905
- s(V, {
906
- label: n(e)("menu.common.actions.add"),
907
- disabled: ((m = l.value) == null ? void 0 : m.submit.state) !== "allowed",
908
- size: "lg",
909
- type: "submit",
910
- variant: "primary"
911
- }, null, 8, ["label", "disabled"]),
912
- s(V, {
913
- label: n(e)("menu.common.actions.cancel"),
914
- size: "lg",
915
- variant: "tertiary",
916
- onClick: t[8] || (t[8] = (d) => f("close"))
917
- }, null, 8, ["label"])
918
- ])
919
- ];
920
- }),
921
- default: p(() => [
922
- l.value ? (c(), w("div", yo, [
923
- s(Ne, null, {
924
- default: p(() => {
925
- var m;
926
- return [
927
- s(J, ae({
928
- autofocus: "",
929
- label: n(e)("menu.common.labels.group_name"),
930
- "model-value": l.value.name,
931
- "error-messages": Z("name") ? [G("name")] : []
932
- }, n($).field("name", n(a).setName)), ye({ _: 2 }, [
933
- l.value.showTranslation !== !1 ? {
934
- name: "append",
935
- fn: p(() => [
936
- s(q, {
937
- variant: "plain",
938
- placement: "top",
939
- "z-index": 999
940
- }, {
941
- default: p(() => [
942
- s(V, {
943
- variant: "tertiary",
944
- icon: "g_translate",
945
- disabled: !l.value.canTranslateName,
946
- "aria-label": n(e)("menu.group.translation.translate_name"),
947
- onClick: t[0] || (t[0] = (d) => n(a).beginTranslation("group"))
948
- }, null, 8, ["disabled", "aria-label"])
949
- ]),
950
- _: 1
951
- })
952
- ]),
953
- key: "0"
954
- } : void 0
955
- ]), 1040, ["label", "model-value", "error-messages"]),
956
- s(de, {
957
- "model-value": `${l.value.min} ${l.value.max}`,
958
- invalid: !!G("bounds"),
959
- "helper-text": G("bounds")
960
- }, {
961
- default: p(() => [
962
- s(_o, null, {
963
- default: p(() => [
964
- s(ce, ae({
965
- class: "flex-1",
966
- min: 0,
967
- label: n(e)("menu.common.labels.min_select"),
968
- "model-value": l.value.min
969
- }, n($).field("bounds", n(a).setMin)), null, 16, ["label", "model-value"]),
970
- s(ce, ae({
971
- class: "flex-1",
972
- min: l.value.min,
973
- label: n(e)("menu.common.labels.max_select"),
974
- "model-value": l.value.max
975
- }, n($).field("bounds", n(a).setMax)), null, 16, ["min", "label", "model-value"])
976
- ]),
977
- _: 1
978
- })
979
- ]),
980
- _: 1
981
- }, 8, ["model-value", "invalid", "helper-text"]),
982
- l.value.showType ? (c(), O(re, {
983
- key: 0,
984
- label: n(e)("menu.common.labels.group_type")
985
- }, {
986
- default: p(() => [
987
- (c(), O($e, {
988
- key: H.value,
989
- "model-value": l.value.type,
990
- "onUpdate:modelValue": t[1] || (t[1] = (d) => n(a).setType(d))
991
- }, {
992
- default: p(() => [
993
- (c(), w(K, null, Q(z, (d) => s(Ce, {
994
- key: d,
995
- value: d,
996
- label: n(e)(n(De)[d])
997
- }, null, 8, ["value", "label"])), 64))
998
- ]),
999
- _: 1
1000
- }, 8, ["model-value"]))
1001
- ]),
1002
- _: 1
1003
- }, 8, ["label"])) : N("", !0),
1004
- s(re, {
1005
- label: n(e)("menu.common.labels.configuration")
1006
- }, {
1007
- default: p(() => [
1008
- s(Se, {
1009
- "model-value": l.value.stackable,
1010
- label: n(e)("menu.common.labels.stackable"),
1011
- "label-placement": "right",
1012
- sublabel: n(e)("menu.common.labels.stackable_sublabel"),
1013
- "onUpdate:modelValue": t[2] || (t[2] = (d) => n(a).setStackable(d))
1014
- }, null, 8, ["model-value", "label", "sublabel"])
1015
- ]),
1016
- _: 1
1017
- }, 8, ["label"]),
1018
- (m = l.value.tagging) != null && m.visible ? (c(), w(K, { key: 1 }, [
1019
- o.presentation === "tree" ? (c(), O(n(_e), {
1020
- key: 0,
1021
- entity: "group",
1022
- "model-value": l.value.customAttributes ?? {},
1023
- "value-options": R.value,
1024
- "onUpdate:modelValue": t[3] || (t[3] = (d) => n(a).setCustomAttributes(d ?? null))
1025
- }, null, 8, ["model-value", "value-options"])) : (c(), O(le, {
1026
- key: 1,
1027
- title: n(e)("menu.group.form.tagging.title"),
1028
- "sub-title": n(e)("menu.group.form.tagging.subtitle")
1029
- }, {
1030
- default: p(() => [
1031
- s(n(_e), {
1032
- entity: "group",
1033
- "model-value": l.value.customAttributes ?? {},
1034
- "value-options": R.value,
1035
- "onUpdate:modelValue": t[4] || (t[4] = (d) => n(a).setCustomAttributes(d ?? null))
1036
- }, null, 8, ["model-value", "value-options"])
1037
- ]),
1038
- _: 1
1039
- }, 8, ["title", "sub-title"]))
1040
- ], 64)) : N("", !0)
1041
- ];
1042
- }),
1043
- _: 1
1044
- }),
1045
- s(de, {
1046
- tag: "div",
1047
- "model-value": l.value.options,
1048
- invalid: !!G("options"),
1049
- "helper-text": G("options") || n(e)("menu.common.validation.default_items_tip", {
1050
- count: l.value.defaultCount,
1051
- max: l.value.max
1052
- })
1053
- }, {
1054
- default: p(() => [
1055
- s(le, {
1056
- title: n(e)("menu.group.option.title"),
1057
- "sub-title": l.value.linkProducts && o.presentation !== "tree" ? n(e)("menu.group.option.subtitle") : ""
1058
- }, {
1059
- "append-title": p(() => [
1060
- s(V, {
1061
- variant: "secondary",
1062
- "text-color": "primary",
1063
- "border-color": "primary",
1064
- "prepend-icon": l.value.linkProducts ? "link" : "add",
1065
- label: n(e)(
1066
- l.value.linkProducts ? "menu.group.option.link_products" : "menu.group.option.add_option"
1067
- ),
1068
- onClick: t[5] || (t[5] = (m) => l.value.linkProducts ? x.value = !0 : n(a).addOption())
1069
- }, null, 8, ["prepend-icon", "label"])
1070
- ]),
1071
- default: p(() => [
1072
- v("div", xo, [
1073
- v("div", ho, [
1074
- s(Te, {
1075
- draggable: "",
1076
- onDndChanged: t[6] || (t[6] = (m) => n(a).reorderOptions(
1077
- m.map((d) => d.id)
1078
- )),
1079
- "column-defs": ne.value,
1080
- "column-visibility": {
1081
- code: l.value.showCode,
1082
- priceAmount: l.value.showPrice,
1083
- orderFrom: l.value.showOrderFrom
1084
- },
1085
- "row-data": Y.value,
1086
- "get-row-id": i,
1087
- "expanded-state": U.value,
1088
- "onUpdate:expandedState": t[7] || (t[7] = (m) => U.value = m),
1089
- "page-size": Math.max(l.value.options.length, 1),
1090
- "shrink-at": !1,
1091
- "hide-footer": ""
1092
- }, null, 8, ["column-defs", "column-visibility", "row-data", "expanded-state", "page-size"])
1093
- ])
1094
- ])
1095
- ]),
1096
- _: 1
1097
- }, 8, ["title", "sub-title"])
1098
- ]),
1099
- _: 1
1100
- }, 8, ["model-value", "invalid", "helper-text"])
1101
- ])) : N("", !0)
1102
- ]),
1103
- _: 1
1104
- }, 8, ["max-width", "is-container", "is-container-props"]),
1105
- ((ge = l.value) == null ? void 0 : ge.translationMode) === "group" ? (c(), O(ze, {
1106
- key: 0,
1107
- "model-value": !0,
1108
- name: l.value.name,
1109
- "name-locale": l.value.nameLocale,
1110
- "supported-locales": l.value.supportedLocales,
1111
- dirty: l.value.translationDirty,
1112
- title: n(e)("menu.group.translation.title"),
1113
- "name-section-label": n(e)("menu.common.translation.name_section", {
1114
- entity: n(e)("menu.group.title")
1115
- }),
1116
- "onUpdate:modelValue": t[10] || (t[10] = (m) => !m && k()),
1117
- "onUpdate:name": t[11] || (t[11] = (m) => n(a).setName(m)),
1118
- "onUpdate:nameLocale": t[12] || (t[12] = (m) => n(a).setNameLocale(m)),
1119
- onSave: t[13] || (t[13] = (m) => n(a).applyTranslation()),
1120
- onDiscard: t[14] || (t[14] = (m) => n(a).cancelTranslation())
1121
- }, null, 8, ["name", "name-locale", "supported-locales", "dirty", "title", "name-section-label"])) : N("", !0),
1122
- ((be = l.value) == null ? void 0 : be.translationMode) === "options" ? (c(), O(pe, {
1123
- key: 1,
1124
- "model-value": !0,
1125
- "max-width": 720,
1126
- "onUpdate:modelValue": t[17] || (t[17] = (m) => !m && k()),
1127
- "onOn:clickedAway": B
1128
- }, {
1129
- "side-sheet-header": p(() => [
1130
- v("p", ko, T(n(e)("menu.group.translation.title")), 1)
1131
- ]),
1132
- "side-sheet-footer": p(() => [
1133
- v("div", So, [
1134
- s(V, {
1135
- label: n(e)("menu.common.actions.save"),
1136
- size: "lg",
1137
- onClick: t[16] || (t[16] = (m) => n(a).applyTranslation())
1138
- }, null, 8, ["label"]),
1139
- s(V, {
1140
- label: n(e)("menu.common.actions.cancel"),
1141
- variant: "tertiary",
1142
- size: "lg",
1143
- onClick: B
1144
- }, null, 8, ["label"])
1145
- ])
1146
- ]),
1147
- default: p(() => [
1148
- v("div", Fo, [
1149
- s(re, {
1150
- label: n(e)("menu.group.translation.language")
1151
- }, {
1152
- default: p(() => {
1153
- var m;
1154
- return [
1155
- v("div", Co, [
1156
- (c(!0), w(K, null, Q(l.value.optionTranslationLocales, (d) => {
1157
- var A;
1158
- return c(), O(Pe, {
1159
- key: d,
1160
- removable: "",
1161
- label: ((A = l.value.supportedLocales.find((te) => te.code === d)) == null ? void 0 : A.name) ?? d,
1162
- onChipClosed: (te) => n(a).setOptionTranslationLocales(
1163
- l.value.optionTranslationLocales.filter((Oe) => Oe !== d)
1164
- )
1165
- }, null, 8, ["label", "onChipClosed"]);
1166
- }), 128)),
1167
- s(Ve, {
1168
- items: (((m = l.value) == null ? void 0 : m.supportedLocales) ?? []).filter(
1169
- (d) => {
1170
- var A;
1171
- return !(((A = l.value) == null ? void 0 : A.optionTranslationLocales) ?? []).includes(d.code);
1172
- }
1173
- ).map((d) => ({ value: d.code, label: d.name })),
1174
- placeholder: n(e)("menu.group.translation.add_language"),
1175
- "model-value": null,
1176
- "onUpdate:modelValue": t[15] || (t[15] = (d) => n(a).setOptionTranslationLocales([
1177
- ...l.value.optionTranslationLocales,
1178
- d
1179
- ]))
1180
- }, null, 8, ["items", "placeholder"])
1181
- ])
1182
- ];
1183
- }),
1184
- _: 1
1185
- }, 8, ["label"]),
1186
- s(le, {
1187
- title: n(e)("menu.group.translation.group_name")
1188
- }, {
1189
- default: p(() => [
1190
- s(J, {
1191
- "model-value": l.value.name,
1192
- readonly: ""
1193
- }, null, 8, ["model-value"])
1194
- ]),
1195
- _: 1
1196
- }, 8, ["title"]),
1197
- s(le, {
1198
- title: n(e)("menu.group.translation.product_name")
1199
- }, {
1200
- default: p(() => [
1201
- (c(!0), w(K, null, Q(l.value.options, (m, d) => (c(), w("div", {
1202
- key: m.id,
1203
- class: "space-y-8"
1204
- }, [
1205
- v("p", $o, T(n(e)("menu.group.translation.option", { number: d + 1 })), 1),
1206
- s(J, {
1207
- label: n(e)("menu.group.translation.option_default", { number: d + 1 }),
1208
- "model-value": m.name,
1209
- "onUpdate:modelValue": (A) => n(a).setOption(m.id, { name: A })
1210
- }, null, 8, ["label", "model-value", "onUpdate:modelValue"]),
1211
- (c(!0), w(K, null, Q(l.value.optionTranslationLocales, (A) => (c(), w("div", {
1212
- key: A,
1213
- class: "flex gap-8 items-center"
1214
- }, [
1215
- s(Ee, { code: A }, null, 8, ["code"]),
1216
- s(J, {
1217
- class: "flex-1",
1218
- "aria-label": n(e)("menu.group.translation.option_translation", {
1219
- number: d + 1,
1220
- language: A
1221
- }),
1222
- "model-value": m.nameLocale[A] ?? "",
1223
- placeholder: n(e)("menu.group.translation.placeholder"),
1224
- "onUpdate:modelValue": (te) => n(a).setOptionNameLocale(m.id, {
1225
- ...m.nameLocale,
1226
- [A]: te
1227
- })
1228
- }, null, 8, ["aria-label", "model-value", "placeholder", "onUpdate:modelValue"])
1229
- ]))), 128))
1230
- ]))), 128))
1231
- ]),
1232
- _: 1
1233
- }, 8, ["title"])
1234
- ])
1235
- ]),
1236
- _: 1
1237
- })) : N("", !0),
1238
- s(Me, {
1239
- modelValue: x.value,
1240
- "onUpdate:modelValue": t[18] || (t[18] = (m) => x.value = m),
1241
- catalogue: S.value,
1242
- "selected-product-ids": ((ve = l.value) == null ? void 0 : ve.selectedProductIds) ?? [],
1243
- title: n(e)("menu.group.option.link_products"),
1244
- onSubmit: h
1245
- }, null, 8, ["modelValue", "catalogue", "selected-product-ids", "title"])
1246
- ], 64);
1247
- };
1248
- }
1249
- });
1250
- export {
1251
- _o as F,
1252
- ie as _,
1253
- qe as a,
1254
- Go as b,
1255
- Ro as c,
1256
- Ko as d
1257
- };