@feedmepos/mf-inventory-portal 0.0.17-dev.9 → 0.0.18-dev.3
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/ApprovalView-G-u9nPxH.js +118 -0
- package/dist/{BindingsDialog-Dw_DCOTY.js → BindingsDialog-CVeD1mOn.js} +2 -2
- package/dist/{BindingsPicker-BRLTF4Qs.js → BindingsPicker-K04aOoGr.js} +2 -2
- package/dist/BindingsTable-65aYkpX7.js +147 -0
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DgHp7KgJ.js +268 -0
- package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-YzVhmNJc.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-C5WBLEy3.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dv01gy7k.js → FmUnitInput.vue_vue_type_script_setup_true_lang-QKFZeZKM.js} +12 -12
- package/dist/IngredientsView-6Q2UWsu-.js +1776 -0
- package/dist/{IntegrationView-Xnl758CS.js → IntegrationView-ZMPPIopU.js} +260 -266
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUj9Mnt6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-C8YTZoBw.js} +6 -6
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CW0h41FP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-kidodonU.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-DzimxkGt.js → PurchaseOrderPrintPreview-B4uzudnC.js} +1 -1
- package/dist/ReceiveRequestView-DuHtLwZN.js +1394 -0
- package/dist/{RecipeView-B9NcEw7x.js → RecipeView-CRj0pC9N.js} +182 -190
- package/dist/StockView-CQbeZ5pU.js +1862 -0
- package/dist/SupplierView-CrfQATQf.js +796 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BSwsz8Xt.js → TransferDetails.vue_vue_type_script_setup_true_lang-CLUo-Tve.js} +21 -20
- package/dist/{UnitView-BvbaRHxG.js → UnitView-D1acjiRV.js} +129 -133
- package/dist/{WarehouseView-Cf5Bmfhn.js → WarehouseView-DID1G1qK.js} +260 -264
- package/dist/app-D1teOEQX.js +66113 -0
- package/dist/app.js +1 -1
- package/dist/array-AvWd53LI.js +30 -0
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +53 -0
- package/dist/date2-6Vt_hnAG.js +95 -0
- package/dist/dayjs.min-Co7-8-Mb.js +282 -0
- package/dist/{decimal-S-jYTEL5.js → decimal-ziY3648r.js} +1 -1
- package/dist/extensions/array.d.ts +1 -0
- package/dist/{fuzzy-DW00BX8H.js → fuzzy-gvHXFsh0.js} +1 -1
- package/dist/{dayjs.min-M4PEyOKN.js → index-Do1KDD1S.js} +3594 -3356
- package/dist/{layout-DACHKQ9G.js → layout-BxDEsp4a.js} +1 -1
- package/dist/number-Dvvpk3SV.js +97 -0
- package/dist/{rules-ldw61cGA.js → rules-CQu9yXsg.js} +16 -15
- package/dist/stock-estimate-Wysv30cx.js +122 -0
- package/dist/{supplier-DjKC4TaM.js → supplier-BFdAYn3E.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-D1M09VoX.js → use-inventory-binding-dialog-CuyOzZ5r.js} +2 -2
- package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -0
- package/dist/{xlsx-BcM9fWkc.js → xlsx-BG4CsaGF.js} +1 -1
- package/dist/{xlsx.util-BNXjhkYU.js → xlsx.util-BkVYceD0.js} +2 -2
- package/package.json +4 -4
- package/dist/ApprovalView-BJ_SGOrx.js +0 -134
- package/dist/BindingsTable-BMIkL0Bk.js +0 -121
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D9Qp3jke.js +0 -97
- package/dist/IngredientsView-DYFkUsHx.js +0 -1802
- package/dist/ReceiveRequestView-C_0jK6GY.js +0 -1435
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-Dov3Uq2z.js +0 -64
- package/dist/StockView-JPw1K8aU.js +0 -1960
- package/dist/SupplierView-CiQLFWmQ.js +0 -804
- package/dist/app-BbXzmbBO.js +0 -42892
- package/dist/components/FmTableToolbar.vue.d.ts +0 -49
- package/dist/date2-DFqSdEvG.js +0 -189
- package/dist/init-date-range-B_ha80e0.js +0 -21
- package/dist/stock-estimate-DOP1qO5w.js +0 -145
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { h as We, k as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { D as
|
|
5
|
-
import { c as
|
|
6
|
-
import { _ as Ge } from "./
|
|
1
|
+
import { ref as F, defineComponent as q, watch as Y, onMounted as oe, onUnmounted as $e, openBlock as R, createElementBlock as B, toRaw as ve, reactive as Se, createElementVNode as v, toDisplayString as X, createVNode as k, pushScopeId as Me, popScopeId as De, resolveComponent as L, unref as A, createSlots as Fe, withCtx as I, createTextVNode as Pe, renderSlot as Ee, createBlock as N, createCommentVNode as ke, computed as D, isRef as be, normalizeStyle as Re } from "vue";
|
|
2
|
+
import { h as We, k as Te, l as Ue, c as z, m as te, n as ae, o as Le, _ as Ie, f as Be } from "./app-D1teOEQX.js";
|
|
3
|
+
import { useCoreStore as Ne } from "@feedmepos/mf-common";
|
|
4
|
+
import { D as we, R as Z, F as W } from "./row-action.enum-BwQbURNh.js";
|
|
5
|
+
import { c as qe, _ as ze, F as J, u as je } from "./layout-BxDEsp4a.js";
|
|
6
|
+
import { _ as Oe, a as Ge } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DgHp7KgJ.js";
|
|
7
7
|
import { useDialogChild as Ke, useDialog as Ce, useSnackbar as le, useProxiedModel as ee, useBreakpoints as He } from "@feedmepos/ui-library";
|
|
8
|
-
import { R as
|
|
8
|
+
import { R as U } from "./rules-CQu9yXsg.js";
|
|
9
9
|
const Q = We((u, c) => {
|
|
10
|
-
const p =
|
|
10
|
+
const p = Ne();
|
|
11
11
|
return {
|
|
12
12
|
async readWarehouses() {
|
|
13
13
|
var r;
|
|
@@ -36,15 +36,15 @@ function Ze() {
|
|
|
36
36
|
warehouses: []
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const Ve = F(Ze());
|
|
40
40
|
function Ae() {
|
|
41
41
|
return {
|
|
42
42
|
// state
|
|
43
43
|
get warehouses() {
|
|
44
|
-
return
|
|
44
|
+
return Ve.value.warehouses;
|
|
45
45
|
},
|
|
46
46
|
set warehouses(u) {
|
|
47
|
-
|
|
47
|
+
Ve.value.warehouses = u;
|
|
48
48
|
},
|
|
49
49
|
// actions
|
|
50
50
|
async readWarehouses() {
|
|
@@ -61,11 +61,11 @@ function Ae() {
|
|
|
61
61
|
await Q().deleteWarehouse(u._id);
|
|
62
62
|
},
|
|
63
63
|
async init() {
|
|
64
|
-
const u =
|
|
64
|
+
const u = Te();
|
|
65
65
|
try {
|
|
66
66
|
await this.readWarehouses();
|
|
67
67
|
} catch (c) {
|
|
68
|
-
throw c instanceof
|
|
68
|
+
throw c instanceof Ue || u.error("Error at reading warehouses"), c;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
};
|
|
@@ -106,8 +106,8 @@ function Je(u, c) {
|
|
|
106
106
|
id: "action",
|
|
107
107
|
header: "",
|
|
108
108
|
cell(r) {
|
|
109
|
-
return
|
|
110
|
-
[
|
|
109
|
+
return qe(
|
|
110
|
+
[we[Z.Edit], we[Z.Delete]],
|
|
111
111
|
(n) => {
|
|
112
112
|
p(n, r.row.original.original);
|
|
113
113
|
}
|
|
@@ -136,7 +136,7 @@ function Je(u, c) {
|
|
|
136
136
|
s == null ? void 0 : s.postcode,
|
|
137
137
|
s == null ? void 0 : s.state,
|
|
138
138
|
s == null ? void 0 : s.country
|
|
139
|
-
].map((
|
|
139
|
+
].map((g) => g == null ? void 0 : g.trim()).filter((g) => g).join(", ");
|
|
140
140
|
}
|
|
141
141
|
}));
|
|
142
142
|
}
|
|
@@ -171,49 +171,49 @@ const Qe = /* @__PURE__ */ q({
|
|
|
171
171
|
const l = u, a = p;
|
|
172
172
|
c({
|
|
173
173
|
setCenter: (i) => {
|
|
174
|
-
var m,
|
|
175
|
-
(m = s.value) == null || m.setCenter(i), (
|
|
174
|
+
var m, y;
|
|
175
|
+
(m = s.value) == null || m.setCenter(i), (y = s.value) == null || y.setZoom(18);
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
|
-
const { googleMap: r } = ae(), n =
|
|
179
|
-
function
|
|
178
|
+
const { googleMap: r } = ae(), n = F(), s = F(null), x = [];
|
|
179
|
+
function g(i) {
|
|
180
180
|
return {
|
|
181
181
|
lat: i.latLng.lat(),
|
|
182
182
|
lng: i.latLng.lng()
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
const M = r.maps.event.addListener(i, m,
|
|
187
|
-
|
|
185
|
+
function V(i, m, y) {
|
|
186
|
+
const M = r.maps.event.addListener(i, m, y);
|
|
187
|
+
x.push(M);
|
|
188
188
|
}
|
|
189
|
-
const _ =
|
|
190
|
-
function
|
|
191
|
-
|
|
189
|
+
const _ = F([]);
|
|
190
|
+
function b(i, m, y) {
|
|
191
|
+
V(i, m, y);
|
|
192
192
|
}
|
|
193
193
|
function S(i) {
|
|
194
|
-
d(null), _.value = i.map((m,
|
|
194
|
+
d(null), _.value = i.map((m, y) => {
|
|
195
195
|
const M = new r.maps.Marker({
|
|
196
196
|
position: m,
|
|
197
197
|
draggable: !0
|
|
198
198
|
});
|
|
199
|
-
return
|
|
200
|
-
a("marker-change", { index:
|
|
199
|
+
return b(M, "dragend", (T) => {
|
|
200
|
+
a("marker-change", { index: y, position: g(T) });
|
|
201
201
|
}), M;
|
|
202
202
|
}), d(s.value);
|
|
203
203
|
}
|
|
204
204
|
function d(i) {
|
|
205
|
-
_.value.map((m) =>
|
|
205
|
+
_.value.map((m) => ve(m).setMap(i));
|
|
206
206
|
}
|
|
207
|
-
const
|
|
208
|
-
function $(i, m,
|
|
209
|
-
|
|
207
|
+
const C = F([]);
|
|
208
|
+
function $(i, m, y) {
|
|
209
|
+
V(i, m, y);
|
|
210
210
|
}
|
|
211
|
-
function o(i, m,
|
|
212
|
-
|
|
211
|
+
function o(i, m, y) {
|
|
212
|
+
V(i, m, y);
|
|
213
213
|
}
|
|
214
214
|
function e(i) {
|
|
215
|
-
return
|
|
216
|
-
lat:
|
|
215
|
+
return C.value[i].getPath().getArray().map(({ lat: y, lng: M }) => ({
|
|
216
|
+
lat: y(),
|
|
217
217
|
lng: M()
|
|
218
218
|
}));
|
|
219
219
|
}
|
|
@@ -221,15 +221,15 @@ const Qe = /* @__PURE__ */ q({
|
|
|
221
221
|
const m = e(i);
|
|
222
222
|
a("polygon-change", { index: i, path: m });
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const M = e(i).filter((
|
|
224
|
+
function w(i, m) {
|
|
225
|
+
const M = e(i).filter((T, O) => O !== m);
|
|
226
226
|
a("polygon-change", { index: i, path: M });
|
|
227
227
|
}
|
|
228
228
|
function h(i, m) {
|
|
229
|
-
m.vertex !== void 0 ?
|
|
229
|
+
m.vertex !== void 0 ? w(i, m.vertex) : a("polygon-right-click", i);
|
|
230
230
|
}
|
|
231
231
|
function f(i) {
|
|
232
|
-
|
|
232
|
+
P(null), C.value = i.map((m, y) => {
|
|
233
233
|
const M = new r.maps.Polygon({
|
|
234
234
|
paths: m.paths,
|
|
235
235
|
strokeColor: m.strokeColor,
|
|
@@ -237,18 +237,18 @@ const Qe = /* @__PURE__ */ q({
|
|
|
237
237
|
fillOpacity: 0.5,
|
|
238
238
|
editable: l.editable
|
|
239
239
|
});
|
|
240
|
-
return $(M, "contextmenu", (
|
|
241
|
-
o(
|
|
240
|
+
return $(M, "contextmenu", (T) => h(y, T)), M.getPaths().forEach((T) => {
|
|
241
|
+
o(T, "insert_at", () => t(y)), o(T, "set_at", () => t(y));
|
|
242
242
|
}), M;
|
|
243
|
-
}),
|
|
243
|
+
}), P(s.value);
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
|
|
245
|
+
function P(i) {
|
|
246
|
+
C.value.map((m) => ve(m).setMap(i));
|
|
247
247
|
}
|
|
248
|
-
function E(i, m,
|
|
249
|
-
|
|
248
|
+
function E(i, m, y) {
|
|
249
|
+
V(i, m, y);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function j() {
|
|
252
252
|
s.value = new r.maps.Map(n.value, {
|
|
253
253
|
center: l.center,
|
|
254
254
|
zoom: l.zoom,
|
|
@@ -256,13 +256,13 @@ const Qe = /* @__PURE__ */ q({
|
|
|
256
256
|
streetViewControl: !1,
|
|
257
257
|
draggable: !0,
|
|
258
258
|
scrollwheel: !0
|
|
259
|
-
}), E(s.value, "click", (i) => a("map-click",
|
|
259
|
+
}), E(s.value, "click", (i) => a("map-click", g(i)));
|
|
260
260
|
}
|
|
261
261
|
return Y(() => l.markers, S, { deep: !0 }), Y(() => l.polygons, f, { deep: !0 }), oe(() => {
|
|
262
|
-
!n.value || !r || (
|
|
263
|
-
}),
|
|
264
|
-
|
|
265
|
-
}), (i, m) => (
|
|
262
|
+
!n.value || !r || (j(), S(l.markers), f(l.polygons));
|
|
263
|
+
}), $e(() => {
|
|
264
|
+
x.forEach((i) => i.remove());
|
|
265
|
+
}), (i, m) => (R(), B("div", {
|
|
266
266
|
ref_key: "mapRef",
|
|
267
267
|
ref: n,
|
|
268
268
|
class: "map app-map"
|
|
@@ -270,46 +270,46 @@ const Qe = /* @__PURE__ */ q({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
var se = { exports: {} };
|
|
273
|
-
function
|
|
273
|
+
function xe(u, c = 100, p = {}) {
|
|
274
274
|
if (typeof u != "function")
|
|
275
275
|
throw new TypeError(`Expected the first parameter to be a function, got \`${typeof u}\`.`);
|
|
276
276
|
if (c < 0)
|
|
277
277
|
throw new RangeError("`wait` must not be negative.");
|
|
278
278
|
const { immediate: l } = typeof p == "boolean" ? { immediate: p } : p;
|
|
279
|
-
let a, r, n, s,
|
|
280
|
-
function
|
|
279
|
+
let a, r, n, s, x;
|
|
280
|
+
function g() {
|
|
281
281
|
const _ = Date.now() - s;
|
|
282
282
|
if (_ < c && _ >= 0)
|
|
283
|
-
n = setTimeout(
|
|
283
|
+
n = setTimeout(g, c - _);
|
|
284
284
|
else if (n = void 0, !l) {
|
|
285
|
-
const
|
|
286
|
-
a = void 0, r = void 0,
|
|
285
|
+
const b = a, S = r;
|
|
286
|
+
a = void 0, r = void 0, x = u.apply(b, S);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const V = function(..._) {
|
|
290
290
|
if (a && this !== a)
|
|
291
291
|
throw new Error("Debounced method called with different contexts.");
|
|
292
292
|
a = this, r = _, s = Date.now();
|
|
293
|
-
const
|
|
294
|
-
if (n || (n = setTimeout(
|
|
293
|
+
const b = l && !n;
|
|
294
|
+
if (n || (n = setTimeout(g, c)), b) {
|
|
295
295
|
const S = a, d = r;
|
|
296
|
-
a = void 0, r = void 0,
|
|
296
|
+
a = void 0, r = void 0, x = u.apply(S, d);
|
|
297
297
|
}
|
|
298
|
-
return
|
|
298
|
+
return x;
|
|
299
299
|
};
|
|
300
|
-
return
|
|
300
|
+
return V.clear = () => {
|
|
301
301
|
n && (clearTimeout(n), n = void 0);
|
|
302
|
-
},
|
|
302
|
+
}, V.flush = () => {
|
|
303
303
|
if (!n)
|
|
304
304
|
return;
|
|
305
|
-
const _ = a,
|
|
306
|
-
a = void 0, r = void 0,
|
|
307
|
-
},
|
|
305
|
+
const _ = a, b = r;
|
|
306
|
+
a = void 0, r = void 0, x = u.apply(_, b), clearTimeout(n), n = void 0;
|
|
307
|
+
}, V;
|
|
308
308
|
}
|
|
309
|
-
se.exports.debounce =
|
|
310
|
-
se.exports =
|
|
309
|
+
se.exports.debounce = xe;
|
|
310
|
+
se.exports = xe;
|
|
311
311
|
var Xe = se.exports;
|
|
312
|
-
const Ye = /* @__PURE__ */
|
|
312
|
+
const Ye = /* @__PURE__ */ Le(Xe), ne = (u) => (Me("data-v-ea67d23a"), u = u(), De(), u), eo = { class: "flex flex-col gap-24" }, oo = { class: "flex flex-col gap-8" }, to = /* @__PURE__ */ ne(() => /* @__PURE__ */ v("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Address: ", -1)), ao = { class: "fm-typo-en-body-lg-600" }, lo = /* @__PURE__ */ ne(() => /* @__PURE__ */ v("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Longitude: ", -1)), so = { class: "fm-typo-en-body-lg-600" }, no = /* @__PURE__ */ ne(() => /* @__PURE__ */ v("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Latitude: ", -1)), ro = { class: "fm-typo-en-body-lg-600" }, uo = /* @__PURE__ */ q({
|
|
313
313
|
__name: "CoordinateDialog",
|
|
314
314
|
props: {
|
|
315
315
|
address: {
|
|
@@ -324,7 +324,7 @@ const Ye = /* @__PURE__ */ Ie(Xe), ne = (u) => (Fe("data-v-ea67d23a"), u = u(),
|
|
|
324
324
|
setup(u) {
|
|
325
325
|
const c = u, p = Ke(), l = ae(), a = Se(
|
|
326
326
|
z(c.coordinate ? c.coordinate : te.jb)
|
|
327
|
-
), r =
|
|
327
|
+
), r = F(""), n = Ye(async function() {
|
|
328
328
|
r.value = await l.getFirstMatchingAddress(
|
|
329
329
|
a.lat,
|
|
330
330
|
a.lng
|
|
@@ -333,39 +333,39 @@ const Ye = /* @__PURE__ */ Ie(Xe), ne = (u) => (Fe("data-v-ea67d23a"), u = u(),
|
|
|
333
333
|
oe(() => {
|
|
334
334
|
p.emitData(z(a)), n();
|
|
335
335
|
});
|
|
336
|
-
function s({ position:
|
|
337
|
-
a.lat =
|
|
336
|
+
function s({ position: g }) {
|
|
337
|
+
a.lat = g.lat, a.lng = g.lng, p.emitData(z(a)), n();
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
return (
|
|
341
|
-
|
|
342
|
-
|
|
339
|
+
const x = F();
|
|
340
|
+
return (g, V) => (R(), B("div", eo, [
|
|
341
|
+
v("div", oo, [
|
|
342
|
+
v("div", null, [
|
|
343
343
|
to,
|
|
344
|
-
|
|
344
|
+
v("span", ao, X(r.value), 1)
|
|
345
345
|
]),
|
|
346
|
-
|
|
346
|
+
v("div", null, [
|
|
347
347
|
lo,
|
|
348
|
-
|
|
348
|
+
v("span", so, X(a.lng), 1)
|
|
349
349
|
]),
|
|
350
|
-
|
|
350
|
+
v("div", null, [
|
|
351
351
|
no,
|
|
352
|
-
|
|
352
|
+
v("span", ro, X(a.lat), 1)
|
|
353
353
|
])
|
|
354
354
|
]),
|
|
355
355
|
k(Qe, {
|
|
356
356
|
ref_key: "gmapRef",
|
|
357
|
-
ref:
|
|
357
|
+
ref: x,
|
|
358
358
|
class: "h-[272px] sm:h-[240px] xs:h-[240px]",
|
|
359
359
|
editable: "",
|
|
360
360
|
center: a,
|
|
361
361
|
markers: [a],
|
|
362
362
|
onMarkerChange: s,
|
|
363
|
-
onMapClick:
|
|
363
|
+
onMapClick: V[0] || (V[0] = (_) => s({ position: _ }))
|
|
364
364
|
}, null, 8, ["center", "markers"])
|
|
365
365
|
]));
|
|
366
366
|
}
|
|
367
|
-
}), io = /* @__PURE__ */
|
|
368
|
-
function
|
|
367
|
+
}), io = /* @__PURE__ */ Ie(uo, [["__scopeId", "data-v-ea67d23a"]]);
|
|
368
|
+
function _e([u, c]) {
|
|
369
369
|
return {
|
|
370
370
|
lat: c,
|
|
371
371
|
lng: u
|
|
@@ -391,14 +391,14 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
391
391
|
},
|
|
392
392
|
emits: ["update:modelValue"],
|
|
393
393
|
setup(u, { emit: c }) {
|
|
394
|
-
const p = u, l = c, a = ae(), r = Ce(), n = le(), s = ee(p, "modelValue"),
|
|
395
|
-
function
|
|
394
|
+
const p = u, l = c, a = ae(), r = Ce(), n = le(), s = ee(p, "modelValue"), x = F(!1);
|
|
395
|
+
function g(d) {
|
|
396
396
|
if (d != null && d[0] && (d != null && d[1]))
|
|
397
397
|
return `${d[0].toFixed(3)} Long ${d[1].toFixed(3)} Lat`;
|
|
398
398
|
}
|
|
399
|
-
async function
|
|
399
|
+
async function V(d) {
|
|
400
400
|
var e, t;
|
|
401
|
-
const
|
|
401
|
+
const C = p.modelValue, $ = !C && ((e = p.address) != null && e.formatted) ? await a.getFirstMatchingCoordinate(p.address.formatted) : null, o = C ? _e(C) : $ ? _e($) : te.jb;
|
|
402
402
|
r.open({
|
|
403
403
|
title: p.dialogTitle ?? p.label ?? "Pin location",
|
|
404
404
|
closeButton: !0,
|
|
@@ -418,7 +418,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
418
418
|
}).onPrimary(d);
|
|
419
419
|
}
|
|
420
420
|
const _ = (d) => l("update:modelValue", d ? co(d) : null);
|
|
421
|
-
async function
|
|
421
|
+
async function b() {
|
|
422
422
|
if (!p.disabled) {
|
|
423
423
|
if (!a.isGoogleMapReady) {
|
|
424
424
|
n.open({
|
|
@@ -428,41 +428,41 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
428
428
|
});
|
|
429
429
|
return;
|
|
430
430
|
}
|
|
431
|
-
|
|
431
|
+
V(_);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
function S() {
|
|
435
435
|
l("update:modelValue", null);
|
|
436
436
|
}
|
|
437
|
-
return (d,
|
|
438
|
-
const $ =
|
|
439
|
-
return
|
|
437
|
+
return (d, C) => {
|
|
438
|
+
const $ = L("FmField"), o = L("FmButton"), e = L("FmFormGroup");
|
|
439
|
+
return R(), B("div", po, [
|
|
440
440
|
k(e, {
|
|
441
441
|
class: "flex-1",
|
|
442
|
-
"model-value":
|
|
442
|
+
"model-value": A(s),
|
|
443
443
|
label: d.label,
|
|
444
444
|
disabled: d.disabled,
|
|
445
445
|
required: d.labelMark === "required",
|
|
446
446
|
optional: d.labelMark === "optional",
|
|
447
447
|
info: d.labelInfo,
|
|
448
448
|
rules: d.rules,
|
|
449
|
-
focused:
|
|
449
|
+
focused: x.value,
|
|
450
450
|
"helper-text": d.helperText,
|
|
451
451
|
"helper-state": d.helperState,
|
|
452
|
-
onClick:
|
|
453
|
-
},
|
|
452
|
+
onClick: C[0] || (C[0] = (t) => b())
|
|
453
|
+
}, Fe({
|
|
454
454
|
default: I(({ invalid: t }) => [
|
|
455
|
-
d.modelValue && d.modelValue[0] && d.modelValue[1] ? (
|
|
455
|
+
d.modelValue && d.modelValue[0] && d.modelValue[1] ? (R(), B("div", mo, [
|
|
456
456
|
k($, {
|
|
457
457
|
invalid: t,
|
|
458
458
|
class: "fm-typo-en-body-lg-400"
|
|
459
459
|
}, {
|
|
460
460
|
default: I(() => [
|
|
461
|
-
|
|
461
|
+
Pe(X(g(d.modelValue)), 1)
|
|
462
462
|
]),
|
|
463
463
|
_: 2
|
|
464
464
|
}, 1032, ["invalid"])
|
|
465
|
-
])) : (
|
|
465
|
+
])) : (R(), B("div", fo, [
|
|
466
466
|
k(o, {
|
|
467
467
|
label: "Add coordinate",
|
|
468
468
|
"prepend-icon": "add",
|
|
@@ -480,16 +480,16 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
480
480
|
key: "0"
|
|
481
481
|
} : void 0
|
|
482
482
|
]), 1032, ["model-value", "label", "disabled", "required", "optional", "info", "rules", "focused", "helper-text", "helper-state"]),
|
|
483
|
-
d.modelValue && d.modelValue[0] && d.modelValue[1] ? (
|
|
483
|
+
d.modelValue && d.modelValue[0] && d.modelValue[1] ? (R(), N(o, {
|
|
484
484
|
key: 0,
|
|
485
485
|
"prepend-icon": "delete",
|
|
486
486
|
variant: "tertiary",
|
|
487
|
-
onClick:
|
|
488
|
-
})) :
|
|
487
|
+
onClick: C[1] || (C[1] = (t) => S())
|
|
488
|
+
})) : ke("", !0)
|
|
489
489
|
]);
|
|
490
490
|
};
|
|
491
491
|
}
|
|
492
|
-
}), go = { class: "flex flex-col gap-40" }, yo = { class: "flex flex-col gap-16" }, vo = { class: "flex flex-col gap-8" }, bo = /* @__PURE__ */
|
|
492
|
+
}), go = { class: "flex flex-col gap-40" }, yo = { class: "flex flex-col gap-16" }, vo = { class: "flex flex-col gap-8" }, bo = /* @__PURE__ */ v("div", { class: "fm-typo-en-title-sm-800" }, "Address", -1), wo = { class: "grid grid-cols-2 gap-24" }, Vo = { class: "flex flex-col gap-8" }, _o = /* @__PURE__ */ v("div", { class: "fm-typo-en-title-sm-800" }, "Coordinate", -1), ko = { class: "flex flex-col gap-8" }, Co = /* @__PURE__ */ v("div", { class: "fm-typo-en-title-sm-800" }, "Contact", -1), Ao = { class: "flex flex-col gap-16" }, xo = /* @__PURE__ */ q({
|
|
493
493
|
__name: "WarehouseForm",
|
|
494
494
|
props: {
|
|
495
495
|
modelValue: {},
|
|
@@ -497,7 +497,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
497
497
|
},
|
|
498
498
|
emits: ["update:modelValue", "validation-success"],
|
|
499
499
|
setup(u, { expose: c, emit: p }) {
|
|
500
|
-
const l = u, a = p, r =
|
|
500
|
+
const l = u, a = p, r = D({
|
|
501
501
|
get() {
|
|
502
502
|
var o, e;
|
|
503
503
|
return ((e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.name) ?? "";
|
|
@@ -506,7 +506,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
506
506
|
const e = l.modelValue ?? {};
|
|
507
507
|
e.profile ?? (e.profile = {}), e.profile.name = o, a("update:modelValue", e);
|
|
508
508
|
}
|
|
509
|
-
}), n =
|
|
509
|
+
}), n = D({
|
|
510
510
|
get() {
|
|
511
511
|
var o, e;
|
|
512
512
|
return ((e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.regNo) ?? "";
|
|
@@ -515,7 +515,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
515
515
|
const e = l.modelValue ?? {};
|
|
516
516
|
e.profile ?? (e.profile = {}), e.profile.regNo = o, a("update:modelValue", e);
|
|
517
517
|
}
|
|
518
|
-
}), s =
|
|
518
|
+
}), s = D({
|
|
519
519
|
get() {
|
|
520
520
|
var o, e, t;
|
|
521
521
|
return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.line1) ?? "";
|
|
@@ -525,7 +525,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
525
525
|
const e = l.modelValue ?? {};
|
|
526
526
|
e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.line1 = o, a("update:modelValue", e);
|
|
527
527
|
}
|
|
528
|
-
}),
|
|
528
|
+
}), x = D({
|
|
529
529
|
get() {
|
|
530
530
|
var o, e, t;
|
|
531
531
|
return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.line2) ?? "";
|
|
@@ -535,7 +535,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
535
535
|
const e = l.modelValue ?? {};
|
|
536
536
|
e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.line2 = o, a("update:modelValue", e);
|
|
537
537
|
}
|
|
538
|
-
}),
|
|
538
|
+
}), g = D({
|
|
539
539
|
get() {
|
|
540
540
|
var o, e, t;
|
|
541
541
|
return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.city) ?? "";
|
|
@@ -545,7 +545,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
545
545
|
const e = l.modelValue ?? {};
|
|
546
546
|
e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.city = o, a("update:modelValue", e);
|
|
547
547
|
}
|
|
548
|
-
}),
|
|
548
|
+
}), V = D({
|
|
549
549
|
get() {
|
|
550
550
|
var o, e, t;
|
|
551
551
|
return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.postcode) ?? "";
|
|
@@ -555,7 +555,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
555
555
|
const e = l.modelValue ?? {};
|
|
556
556
|
e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.postcode = o, a("update:modelValue", e);
|
|
557
557
|
}
|
|
558
|
-
}), _ =
|
|
558
|
+
}), _ = D({
|
|
559
559
|
get() {
|
|
560
560
|
var o, e, t;
|
|
561
561
|
return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.state) ?? "";
|
|
@@ -565,7 +565,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
565
565
|
const e = l.modelValue ?? {};
|
|
566
566
|
e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.state = o, a("update:modelValue", e);
|
|
567
567
|
}
|
|
568
|
-
}),
|
|
568
|
+
}), b = D({
|
|
569
569
|
get() {
|
|
570
570
|
var o, e, t;
|
|
571
571
|
return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.country) ?? "";
|
|
@@ -575,7 +575,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
575
575
|
const e = l.modelValue ?? {};
|
|
576
576
|
e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.country = o, a("update:modelValue", e);
|
|
577
577
|
}
|
|
578
|
-
}), S =
|
|
578
|
+
}), S = D({
|
|
579
579
|
get() {
|
|
580
580
|
var o, e, t;
|
|
581
581
|
return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.coordinates) ?? null;
|
|
@@ -585,7 +585,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
585
585
|
const e = l.modelValue ?? {};
|
|
586
586
|
e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.coordinates = o, a("update:modelValue", e);
|
|
587
587
|
}
|
|
588
|
-
}), d =
|
|
588
|
+
}), d = D({
|
|
589
589
|
get() {
|
|
590
590
|
var o, e;
|
|
591
591
|
return ((e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.phoneNo) ?? "";
|
|
@@ -594,7 +594,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
594
594
|
const e = l.modelValue ?? {};
|
|
595
595
|
e.profile ?? (e.profile = {}), e.profile.phoneNo = o, a("update:modelValue", e);
|
|
596
596
|
}
|
|
597
|
-
}),
|
|
597
|
+
}), C = D({
|
|
598
598
|
get() {
|
|
599
599
|
var o, e;
|
|
600
600
|
return ((e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.email) ?? "";
|
|
@@ -603,7 +603,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
603
603
|
const e = l.modelValue ?? {};
|
|
604
604
|
e.profile ?? (e.profile = {}), e.profile.email = o, a("update:modelValue", e);
|
|
605
605
|
}
|
|
606
|
-
}), $ =
|
|
606
|
+
}), $ = F();
|
|
607
607
|
return c({
|
|
608
608
|
validateInputs: () => {
|
|
609
609
|
var o, e;
|
|
@@ -618,18 +618,18 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
618
618
|
(e = (o = $.value) == null ? void 0 : o.resetInputs) == null || e.call(o);
|
|
619
619
|
}
|
|
620
620
|
}), (o, e) => {
|
|
621
|
-
const t =
|
|
622
|
-
return
|
|
621
|
+
const t = L("FmTextField"), w = L("FmPhoneNumber"), h = L("FmForm");
|
|
622
|
+
return R(), N(h, {
|
|
623
623
|
ref_key: "formRef",
|
|
624
624
|
ref: $,
|
|
625
625
|
onValidationSuccess: e[11] || (e[11] = (f) => a("validation-success"))
|
|
626
626
|
}, {
|
|
627
627
|
default: I(() => [
|
|
628
|
-
|
|
629
|
-
|
|
628
|
+
v("div", go, [
|
|
629
|
+
v("div", yo, [
|
|
630
630
|
k(t, {
|
|
631
631
|
disabled: o.disabled,
|
|
632
|
-
rules: [
|
|
632
|
+
rules: [A(U)()],
|
|
633
633
|
"label-mark": "required",
|
|
634
634
|
label: "Company name",
|
|
635
635
|
modelValue: r.value,
|
|
@@ -637,19 +637,19 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
637
637
|
}, null, 8, ["disabled", "rules", "modelValue"]),
|
|
638
638
|
k(t, {
|
|
639
639
|
disabled: o.disabled,
|
|
640
|
-
rules: [
|
|
640
|
+
rules: [A(U)()],
|
|
641
641
|
"label-mark": "required",
|
|
642
642
|
label: "Registration no.",
|
|
643
643
|
modelValue: n.value,
|
|
644
644
|
"onUpdate:modelValue": e[1] || (e[1] = (f) => n.value = f)
|
|
645
645
|
}, null, 8, ["disabled", "rules", "modelValue"])
|
|
646
646
|
]),
|
|
647
|
-
|
|
647
|
+
v("div", vo, [
|
|
648
648
|
bo,
|
|
649
|
-
|
|
649
|
+
v("div", wo, [
|
|
650
650
|
k(t, {
|
|
651
651
|
disabled: o.disabled,
|
|
652
|
-
rules: [
|
|
652
|
+
rules: [A(U)()],
|
|
653
653
|
"label-mark": "required",
|
|
654
654
|
label: "Line 1",
|
|
655
655
|
modelValue: s.value,
|
|
@@ -659,28 +659,28 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
659
659
|
disabled: o.disabled,
|
|
660
660
|
"label-mark": "optional",
|
|
661
661
|
label: "Line 2",
|
|
662
|
-
modelValue:
|
|
663
|
-
"onUpdate:modelValue": e[3] || (e[3] = (f) =>
|
|
662
|
+
modelValue: x.value,
|
|
663
|
+
"onUpdate:modelValue": e[3] || (e[3] = (f) => x.value = f)
|
|
664
664
|
}, null, 8, ["disabled", "modelValue"]),
|
|
665
665
|
k(t, {
|
|
666
666
|
disabled: o.disabled,
|
|
667
|
-
rules: [
|
|
667
|
+
rules: [A(U)()],
|
|
668
668
|
"label-mark": "required",
|
|
669
669
|
label: "City",
|
|
670
|
-
modelValue:
|
|
671
|
-
"onUpdate:modelValue": e[4] || (e[4] = (f) =>
|
|
670
|
+
modelValue: g.value,
|
|
671
|
+
"onUpdate:modelValue": e[4] || (e[4] = (f) => g.value = f)
|
|
672
672
|
}, null, 8, ["disabled", "rules", "modelValue"]),
|
|
673
673
|
k(t, {
|
|
674
674
|
disabled: o.disabled,
|
|
675
|
-
rules: [
|
|
675
|
+
rules: [A(U)()],
|
|
676
676
|
"label-mark": "required",
|
|
677
677
|
label: "Postal code",
|
|
678
|
-
modelValue:
|
|
679
|
-
"onUpdate:modelValue": e[5] || (e[5] = (f) =>
|
|
678
|
+
modelValue: V.value,
|
|
679
|
+
"onUpdate:modelValue": e[5] || (e[5] = (f) => V.value = f)
|
|
680
680
|
}, null, 8, ["disabled", "rules", "modelValue"]),
|
|
681
681
|
k(t, {
|
|
682
682
|
disabled: o.disabled,
|
|
683
|
-
rules: [
|
|
683
|
+
rules: [A(U)()],
|
|
684
684
|
"label-mark": "required",
|
|
685
685
|
label: "State",
|
|
686
686
|
modelValue: _.value,
|
|
@@ -688,30 +688,30 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
688
688
|
}, null, 8, ["disabled", "rules", "modelValue"]),
|
|
689
689
|
k(t, {
|
|
690
690
|
disabled: o.disabled,
|
|
691
|
-
rules: [
|
|
691
|
+
rules: [A(U)()],
|
|
692
692
|
"label-mark": "required",
|
|
693
693
|
label: "Country",
|
|
694
|
-
modelValue:
|
|
695
|
-
"onUpdate:modelValue": e[7] || (e[7] = (f) =>
|
|
694
|
+
modelValue: b.value,
|
|
695
|
+
"onUpdate:modelValue": e[7] || (e[7] = (f) => b.value = f)
|
|
696
696
|
}, null, 8, ["disabled", "rules", "modelValue"])
|
|
697
697
|
])
|
|
698
698
|
]),
|
|
699
|
-
|
|
699
|
+
v("div", Vo, [
|
|
700
700
|
_o,
|
|
701
701
|
k(ho, {
|
|
702
702
|
disabled: o.disabled,
|
|
703
|
-
rules: [
|
|
703
|
+
rules: [A(U)()],
|
|
704
704
|
"label-mark": "required",
|
|
705
705
|
modelValue: S.value,
|
|
706
706
|
"onUpdate:modelValue": e[8] || (e[8] = (f) => S.value = f)
|
|
707
707
|
}, null, 8, ["disabled", "rules", "modelValue"])
|
|
708
708
|
]),
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
k(
|
|
709
|
+
v("div", ko, [
|
|
710
|
+
Co,
|
|
711
|
+
v("div", Ao, [
|
|
712
|
+
k(w, {
|
|
713
713
|
disabled: o.disabled,
|
|
714
|
-
rules: [
|
|
714
|
+
rules: [A(U)()],
|
|
715
715
|
"label-mark": "required",
|
|
716
716
|
label: "Phone number",
|
|
717
717
|
modelValue: d.value,
|
|
@@ -721,8 +721,8 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
721
721
|
disabled: o.disabled,
|
|
722
722
|
"label-mark": "optional",
|
|
723
723
|
label: "Email",
|
|
724
|
-
modelValue:
|
|
725
|
-
"onUpdate:modelValue": e[10] || (e[10] = (f) =>
|
|
724
|
+
modelValue: C.value,
|
|
725
|
+
"onUpdate:modelValue": e[10] || (e[10] = (f) => C.value = f)
|
|
726
726
|
}, null, 8, ["disabled", "modelValue"])
|
|
727
727
|
])
|
|
728
728
|
])
|
|
@@ -732,7 +732,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
732
732
|
}, 512);
|
|
733
733
|
};
|
|
734
734
|
}
|
|
735
|
-
}), $o = { class: "flex gap-4" },
|
|
735
|
+
}), $o = { class: "flex gap-4" }, So = /* @__PURE__ */ q({
|
|
736
736
|
__name: "WarehouseDialog",
|
|
737
737
|
props: {
|
|
738
738
|
mode: {},
|
|
@@ -741,72 +741,72 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
741
741
|
},
|
|
742
742
|
emits: ["update:show", "submitted"],
|
|
743
743
|
setup(u, { expose: c, emit: p }) {
|
|
744
|
-
const l = u, a = p, r =
|
|
744
|
+
const l = u, a = p, r = F(!1), n = le(), s = Ae(), x = D(() => {
|
|
745
745
|
switch (l.mode) {
|
|
746
|
-
case
|
|
746
|
+
case W.CREATE:
|
|
747
747
|
return "Add warehouse";
|
|
748
|
-
case
|
|
748
|
+
case W.READ:
|
|
749
749
|
return "View";
|
|
750
|
-
case
|
|
750
|
+
case W.UPDATE:
|
|
751
751
|
return "Edit warehouse";
|
|
752
752
|
}
|
|
753
753
|
return "";
|
|
754
|
-
}),
|
|
754
|
+
}), g = D(() => {
|
|
755
755
|
switch (l.mode) {
|
|
756
|
-
case
|
|
756
|
+
case W.READ:
|
|
757
757
|
return "";
|
|
758
|
-
case
|
|
758
|
+
case W.UPDATE:
|
|
759
759
|
return "Save";
|
|
760
|
-
case
|
|
760
|
+
case W.CREATE:
|
|
761
761
|
return "Add";
|
|
762
762
|
}
|
|
763
763
|
return "";
|
|
764
|
-
}),
|
|
764
|
+
}), V = F();
|
|
765
765
|
c({
|
|
766
766
|
validateInputs: () => {
|
|
767
767
|
var o, e;
|
|
768
|
-
(e = (o =
|
|
768
|
+
(e = (o = V.value) == null ? void 0 : o.validateInputs) == null || e.call(o);
|
|
769
769
|
},
|
|
770
770
|
resetInputsValidation: () => {
|
|
771
771
|
var o, e;
|
|
772
|
-
(e = (o =
|
|
772
|
+
(e = (o = V.value) == null ? void 0 : o.resetInputsValidation) == null || e.call(o);
|
|
773
773
|
},
|
|
774
774
|
resetInputs: () => {
|
|
775
775
|
var o, e;
|
|
776
|
-
(e = (o =
|
|
776
|
+
(e = (o = V.value) == null ? void 0 : o.resetInputs) == null || e.call(o);
|
|
777
777
|
}
|
|
778
778
|
});
|
|
779
|
-
const _ = ee(l, "show"),
|
|
779
|
+
const _ = ee(l, "show"), b = ee(l, "warehouse");
|
|
780
780
|
function S() {
|
|
781
781
|
var o, e;
|
|
782
|
-
(e = (o =
|
|
782
|
+
(e = (o = V.value) == null ? void 0 : o.validateInputs) == null || e.call(o);
|
|
783
783
|
}
|
|
784
784
|
function d() {
|
|
785
785
|
switch (l.mode) {
|
|
786
|
-
case
|
|
786
|
+
case W.READ:
|
|
787
787
|
return;
|
|
788
|
-
case
|
|
788
|
+
case W.UPDATE:
|
|
789
789
|
return $();
|
|
790
|
-
case
|
|
791
|
-
return
|
|
790
|
+
case W.CREATE:
|
|
791
|
+
return C();
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
|
-
async function
|
|
795
|
-
var o, e, t,
|
|
794
|
+
async function C() {
|
|
795
|
+
var o, e, t, w;
|
|
796
796
|
r.value = !0;
|
|
797
797
|
try {
|
|
798
798
|
await Promise.all([
|
|
799
|
-
s.createWarehouse(
|
|
799
|
+
s.createWarehouse(b.value),
|
|
800
800
|
new Promise((h) => setTimeout(h, 1e3))
|
|
801
801
|
]), n.open({
|
|
802
802
|
title: "Success",
|
|
803
|
-
message: `Created ${(e = (o =
|
|
803
|
+
message: `Created ${(e = (o = b.value) == null ? void 0 : o.profile) == null ? void 0 : e.name} warehouse`,
|
|
804
804
|
type: "success"
|
|
805
805
|
}), a("update:show", !1), a("submitted");
|
|
806
806
|
} catch (h) {
|
|
807
807
|
n.open({
|
|
808
808
|
title: "Something went wrong",
|
|
809
|
-
message: `Cannot create ${(
|
|
809
|
+
message: `Cannot create ${(w = (t = b.value) == null ? void 0 : t.profile) == null ? void 0 : w.name} warehouse. Please try again`,
|
|
810
810
|
type: "error"
|
|
811
811
|
}), console.error("cannot create warehouse", h);
|
|
812
812
|
} finally {
|
|
@@ -814,8 +814,8 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
816
|
async function $() {
|
|
817
|
-
var o, e, t,
|
|
818
|
-
if (
|
|
817
|
+
var o, e, t, w;
|
|
818
|
+
if (b.value === null) {
|
|
819
819
|
n.open({
|
|
820
820
|
title: "Something went wrong",
|
|
821
821
|
message: "Cannot update empty warehouse info",
|
|
@@ -826,17 +826,17 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
826
826
|
r.value = !0;
|
|
827
827
|
try {
|
|
828
828
|
await Promise.all([
|
|
829
|
-
s.updateWarehouse(
|
|
829
|
+
s.updateWarehouse(b.value),
|
|
830
830
|
new Promise((h) => setTimeout(h, 1e3))
|
|
831
831
|
]), n.open({
|
|
832
832
|
title: "Success",
|
|
833
|
-
message: `Updated ${(e = (o =
|
|
833
|
+
message: `Updated ${(e = (o = b.value) == null ? void 0 : o.profile) == null ? void 0 : e.name} warehouse`,
|
|
834
834
|
type: "success"
|
|
835
835
|
}), a("update:show", !1), a("submitted");
|
|
836
836
|
} catch (h) {
|
|
837
837
|
n.open({
|
|
838
838
|
title: "Something went wrong",
|
|
839
|
-
message: `Cannot update ${(
|
|
839
|
+
message: `Cannot update ${(w = (t = b.value) == null ? void 0 : t.profile) == null ? void 0 : w.name} warehouse. Please try again`,
|
|
840
840
|
type: "error"
|
|
841
841
|
}), console.error("cannot update warehouse", h);
|
|
842
842
|
} finally {
|
|
@@ -844,11 +844,11 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
return (o, e) => {
|
|
847
|
-
const t =
|
|
848
|
-
return
|
|
849
|
-
header:
|
|
850
|
-
modelValue:
|
|
851
|
-
"onUpdate:modelValue": e[1] || (e[1] = (h) =>
|
|
847
|
+
const t = L("FmButton"), w = L("FmSideSheet");
|
|
848
|
+
return R(), N(w, {
|
|
849
|
+
header: x.value,
|
|
850
|
+
modelValue: A(_),
|
|
851
|
+
"onUpdate:modelValue": e[1] || (e[1] = (h) => be(_) ? _.value = h : null),
|
|
852
852
|
"dismiss-away": !r.value,
|
|
853
853
|
"close-button": "",
|
|
854
854
|
"max-width": 500
|
|
@@ -856,12 +856,12 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
856
856
|
default: I(() => {
|
|
857
857
|
var h;
|
|
858
858
|
return [
|
|
859
|
-
(
|
|
859
|
+
(R(), N(xo, {
|
|
860
860
|
class: "w-full",
|
|
861
861
|
ref_key: "formRef",
|
|
862
|
-
ref:
|
|
863
|
-
modelValue:
|
|
864
|
-
"onUpdate:modelValue": e[0] || (e[0] = (f) =>
|
|
862
|
+
ref: V,
|
|
863
|
+
modelValue: A(b),
|
|
864
|
+
"onUpdate:modelValue": e[0] || (e[0] = (f) => be(b) ? b.value = f : null),
|
|
865
865
|
onValidationSuccess: d,
|
|
866
866
|
key: ((h = o.warehouse) == null ? void 0 : h._id) ?? "",
|
|
867
867
|
disabled: r.value
|
|
@@ -869,10 +869,10 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
869
869
|
];
|
|
870
870
|
}),
|
|
871
871
|
"side-sheet-footer": I(() => [
|
|
872
|
-
|
|
872
|
+
v("div", $o, [
|
|
873
873
|
k(t, {
|
|
874
874
|
loading: r.value,
|
|
875
|
-
label:
|
|
875
|
+
label: g.value,
|
|
876
876
|
onClick: S
|
|
877
877
|
}, null, 8, ["loading", "label"])
|
|
878
878
|
])
|
|
@@ -881,29 +881,29 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
881
881
|
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
|
-
}),
|
|
884
|
+
}), Mo = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Do = { class: "flex flex-col py-8" }, Fo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Po = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Eo = {
|
|
885
885
|
key: 0,
|
|
886
886
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
887
|
-
},
|
|
887
|
+
}, Ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-3" }, zo = /* @__PURE__ */ q({
|
|
888
888
|
__name: "WarehouseView",
|
|
889
889
|
setup(u) {
|
|
890
|
-
const c = Ae(), p =
|
|
890
|
+
const c = Ae(), p = Be(), l = D(() => c.warehouses), a = Ce(), r = le(), n = F(!1);
|
|
891
891
|
oe(() => {
|
|
892
892
|
p._currentLocation && $();
|
|
893
893
|
}), Y([() => p._currentLocation], () => {
|
|
894
894
|
p._currentLocation && $();
|
|
895
895
|
});
|
|
896
|
-
const s =
|
|
897
|
-
function
|
|
898
|
-
s.value.mode =
|
|
896
|
+
const s = F({});
|
|
897
|
+
function x() {
|
|
898
|
+
s.value.mode = W.CREATE, s.value.warehouse = {}, s.value.show = !0;
|
|
899
899
|
}
|
|
900
|
-
function
|
|
901
|
-
s.value.mode =
|
|
900
|
+
function g(w) {
|
|
901
|
+
s.value.mode = W.UPDATE, s.value.warehouse = w, s.value.show = !0;
|
|
902
902
|
}
|
|
903
|
-
async function w
|
|
903
|
+
async function V(w) {
|
|
904
904
|
a.open({
|
|
905
905
|
title: "Delete warehouse?",
|
|
906
|
-
message: `Confirm deleting ${
|
|
906
|
+
message: `Confirm deleting ${w.profile.name}?`,
|
|
907
907
|
primaryActions: {
|
|
908
908
|
text: "Delete",
|
|
909
909
|
close: !0,
|
|
@@ -913,41 +913,41 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
913
913
|
text: "Cancel",
|
|
914
914
|
close: !0
|
|
915
915
|
}
|
|
916
|
-
}).onPrimary(() => _(
|
|
916
|
+
}).onPrimary(() => _(w));
|
|
917
917
|
}
|
|
918
|
-
async function _(
|
|
918
|
+
async function _(w) {
|
|
919
919
|
a.open({
|
|
920
920
|
title: "Deleting warehouse...",
|
|
921
921
|
closeButton: !1
|
|
922
922
|
});
|
|
923
923
|
try {
|
|
924
|
-
await c.deleteWarehouse(
|
|
924
|
+
await c.deleteWarehouse(w), r.open({
|
|
925
925
|
title: "Success",
|
|
926
|
-
message: `Deleted ${
|
|
926
|
+
message: `Deleted ${w.profile.name}.`,
|
|
927
927
|
type: "success"
|
|
928
928
|
}), await $(!0);
|
|
929
929
|
} catch (h) {
|
|
930
930
|
r.open({
|
|
931
931
|
title: "Something went wrong",
|
|
932
|
-
message: `Cannot delete ${
|
|
932
|
+
message: `Cannot delete ${w.profile.name}. Please try again.`,
|
|
933
933
|
type: "error"
|
|
934
934
|
}), console.error("failed to delete warehouse", h);
|
|
935
935
|
} finally {
|
|
936
936
|
a.close();
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
|
-
const { columnDefs:
|
|
940
|
-
|
|
941
|
-
|
|
939
|
+
const { columnDefs: b, formatRowData: S } = Je(
|
|
940
|
+
g,
|
|
941
|
+
V
|
|
942
942
|
);
|
|
943
|
-
function d(
|
|
944
|
-
|
|
943
|
+
function d(w) {
|
|
944
|
+
w === "create" && x();
|
|
945
945
|
}
|
|
946
|
-
const
|
|
947
|
-
async function $(
|
|
946
|
+
const C = F("");
|
|
947
|
+
async function $(w = !1) {
|
|
948
948
|
n.value = !0;
|
|
949
949
|
try {
|
|
950
|
-
await c.readWarehouses(),
|
|
950
|
+
await c.readWarehouses(), w && await p.readLocations();
|
|
951
951
|
} catch {
|
|
952
952
|
r.open({
|
|
953
953
|
title: "Cannot fetch warehouse list",
|
|
@@ -957,67 +957,63 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
957
957
|
n.value = !1;
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
const { breakpoints: o } = He(), e =
|
|
961
|
-
return (
|
|
962
|
-
const f =
|
|
963
|
-
return
|
|
960
|
+
const { breakpoints: o } = He(), e = D(() => o.value.xs || o.value.sm ? 10 : 20), t = je();
|
|
961
|
+
return (w, h) => {
|
|
962
|
+
const f = L("FmTable");
|
|
963
|
+
return R(), N(Oe, {
|
|
964
964
|
title: "Warehouse",
|
|
965
965
|
actions: [{ label: "Create warehouse", value: "create", isPrimary: !0, prependIcon: "add" }],
|
|
966
966
|
"onClick:action": d
|
|
967
967
|
}, {
|
|
968
968
|
default: I(() => [
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
"row-data": C(S)(l.value),
|
|
984
|
-
"search-value": x.value,
|
|
985
|
-
loading: !C(p)._currentLocation || n.value,
|
|
986
|
-
onRowClick: h[1] || (h[1] = (E) => y(E.original.original)),
|
|
969
|
+
v("div", Mo, [
|
|
970
|
+
k(Ge, {
|
|
971
|
+
searchable: "",
|
|
972
|
+
"change-location": "",
|
|
973
|
+
search: C.value,
|
|
974
|
+
"onUpdate:search": h[0] || (h[0] = (P) => C.value = P)
|
|
975
|
+
}, null, 8, ["search"]),
|
|
976
|
+
(R(), N(f, {
|
|
977
|
+
style: Re(A(t).tableHeight),
|
|
978
|
+
"column-defs": A(b),
|
|
979
|
+
"row-data": A(S)(l.value),
|
|
980
|
+
"search-value": C.value,
|
|
981
|
+
loading: !A(p)._currentLocation || n.value,
|
|
982
|
+
onRowClick: h[1] || (h[1] = (P) => g(P.original.original)),
|
|
987
983
|
key: l.value.length,
|
|
988
984
|
"page-size": e.value
|
|
989
985
|
}, {
|
|
990
|
-
"list-row": I((
|
|
991
|
-
k(
|
|
992
|
-
row:
|
|
993
|
-
onRowClick: (
|
|
986
|
+
"list-row": I((P) => [
|
|
987
|
+
k(ze, {
|
|
988
|
+
row: P,
|
|
989
|
+
onRowClick: (E) => g(E.original)
|
|
994
990
|
}, {
|
|
995
|
-
default: I((
|
|
996
|
-
var i, m,
|
|
991
|
+
default: I((E) => {
|
|
992
|
+
var j, i, m, y, M, T, O, re, G, ue, de, ie, ce, pe, K, me, fe, he, ge, H, ye;
|
|
997
993
|
return [
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
k(
|
|
1001
|
-
render: (
|
|
1002
|
-
props: (
|
|
994
|
+
v("div", Do, [
|
|
995
|
+
v("div", Fo, [
|
|
996
|
+
k(A(J), {
|
|
997
|
+
render: (m = (i = (j = E.warehouse) == null ? void 0 : j.column) == null ? void 0 : i.columnDef) == null ? void 0 : m.cell,
|
|
998
|
+
props: (M = (y = E.warehouse) == null ? void 0 : y.getContext) == null ? void 0 : M.call(y)
|
|
1003
999
|
}, null, 8, ["render", "props"])
|
|
1004
1000
|
]),
|
|
1005
|
-
|
|
1006
|
-
k(
|
|
1007
|
-
render: (
|
|
1008
|
-
props: (
|
|
1001
|
+
v("div", Po, [
|
|
1002
|
+
k(A(J), {
|
|
1003
|
+
render: (re = (O = (T = E.contact) == null ? void 0 : T.column) == null ? void 0 : O.columnDef) == null ? void 0 : re.cell,
|
|
1004
|
+
props: (ue = (G = E.contact) == null ? void 0 : G.getContext) == null ? void 0 : ue.call(G)
|
|
1009
1005
|
}, null, 8, ["render", "props"])
|
|
1010
1006
|
]),
|
|
1011
|
-
(
|
|
1012
|
-
k(
|
|
1013
|
-
render: (
|
|
1014
|
-
props: (
|
|
1007
|
+
(de = P.original) != null && de.email ? (R(), B("div", Eo, [
|
|
1008
|
+
k(A(J), {
|
|
1009
|
+
render: (pe = (ce = (ie = E.email) == null ? void 0 : ie.column) == null ? void 0 : ce.columnDef) == null ? void 0 : pe.cell,
|
|
1010
|
+
props: (me = (K = E.email) == null ? void 0 : K.getContext) == null ? void 0 : me.call(K)
|
|
1015
1011
|
}, null, 8, ["render", "props"])
|
|
1016
|
-
])) :
|
|
1017
|
-
|
|
1018
|
-
k(
|
|
1019
|
-
render: (
|
|
1020
|
-
props: (
|
|
1012
|
+
])) : ke("", !0),
|
|
1013
|
+
v("div", Ro, [
|
|
1014
|
+
k(A(J), {
|
|
1015
|
+
render: (ge = (he = (fe = E.address) == null ? void 0 : fe.column) == null ? void 0 : he.columnDef) == null ? void 0 : ge.cell,
|
|
1016
|
+
props: (ye = (H = E.address) == null ? void 0 : H.getContext) == null ? void 0 : ye.call(H)
|
|
1021
1017
|
}, null, 8, ["render", "props"])
|
|
1022
1018
|
])
|
|
1023
1019
|
])
|
|
@@ -1029,12 +1025,12 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
1029
1025
|
_: 1
|
|
1030
1026
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1031
1027
|
]),
|
|
1032
|
-
k(
|
|
1028
|
+
k(So, {
|
|
1033
1029
|
show: s.value.show,
|
|
1034
|
-
"onUpdate:show": h[2] || (h[2] = (
|
|
1030
|
+
"onUpdate:show": h[2] || (h[2] = (P) => s.value.show = P),
|
|
1035
1031
|
warehouse: s.value.warehouse,
|
|
1036
1032
|
mode: s.value.mode,
|
|
1037
|
-
onSubmitted: h[3] || (h[3] = (
|
|
1033
|
+
onSubmitted: h[3] || (h[3] = (P) => $(!0))
|
|
1038
1034
|
}, null, 8, ["show", "warehouse", "mode"])
|
|
1039
1035
|
]),
|
|
1040
1036
|
_: 1
|
|
@@ -1043,5 +1039,5 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
|
|
|
1043
1039
|
}
|
|
1044
1040
|
});
|
|
1045
1041
|
export {
|
|
1046
|
-
|
|
1042
|
+
zo as default
|
|
1047
1043
|
};
|