@feedmepos/mf-inventory-portal 1.2.64 → 1.2.66-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-apJIvz1w.js → App-BUNonuLz.js} +82 -78
- package/dist/{ApprovalView-CnT6gEI8.js → ApprovalView-BlS1tfbh.js} +6 -6
- package/dist/{BindingsDialog-DLEGDbV2.js → BindingsDialog-tRpsVTm0.js} +5 -5
- package/dist/{BindingsPicker-1Xt1vCu9.js → BindingsPicker-CUvkqcAG.js} +3 -3
- package/dist/{BindingsTable-_0cOM0Kx.js → BindingsTable-B86pWYMk.js} +5 -5
- package/dist/{ClosingDraftView-DsVPsN87.js → ClosingDraftView-gMVnQcWw.js} +226 -224
- package/dist/ClosingHistoryView-DhbE1pEl.js +1147 -0
- package/dist/{ClosingTemplateView-DB3F1wul.js → ClosingTemplateView-Ywbdj05y.js} +15 -15
- package/dist/{DeliveryOrderPrintPreview-CglCMgHc.js → DeliveryOrderPrintPreview-BPhVNc_r.js} +7 -7
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-MMPTJodu.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BrPh_Nvx.js} +16 -16
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CCID5O2Y.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CkUwLhut.js} +3 -3
- package/dist/{FmMultiselectDialog-B8xFmCsH.js → FmMultiselectDialog-C6E_KMFO.js} +1 -1
- package/dist/{FmMultiselectDialog-lQM1qEEW.js → FmMultiselectDialog-DBXpkw5b.js} +16 -16
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BLDz8wwK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D-ZqJ8sU.js} +23 -22
- package/dist/{ImportView-DeC-MPFn.js → ImportView-DV1e51qk.js} +7 -7
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BGDZlmsr.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DkQL7hK2.js} +1 -1
- package/dist/{IngredientGroupView-CuFwQ8Bo.js → IngredientGroupView-CdXGO34J.js} +6 -6
- package/dist/{IngredientsView-CfloqEqn.js → IngredientsView-D2qffNiJ.js} +26 -25
- package/dist/{IntegrationView-CFU0yG6C.js → IntegrationView-RFJIHXQv.js} +19 -18
- package/dist/{InventoryBindingForm-i7eNurS2.js → InventoryBindingForm-CPn-IXgg.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-zOo9YVJe.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-0Vrih8D5.js} +17 -16
- package/dist/{InventoryBindingSummary-BbHLCdjj.js → InventoryBindingSummary-B_WUQ6By.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-NEPqmkHR.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmDuR4Yb.js} +5 -5
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-DhIHSpzG.js +93 -0
- package/dist/{PublishView-CbwCLtph.js → PublishView-BtTSOUyL.js} +9 -9
- package/dist/{PurchaseOrderPrintPreview-DLhgjhHB.js → PurchaseOrderPrintPreview-CxhMPx5u.js} +11 -11
- package/dist/{ReceiveRequestView-CE2aQR-o.js → ReceiveRequestView-CsqEjf7r.js} +144 -142
- package/dist/RecipeView-DASoba97.js +1558 -0
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-mvRR4CrP.js +254 -0
- package/dist/StockView-B4Km4DgB.js +2395 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D0BDdq4d.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cki-LAZR.js} +1 -1
- package/dist/{SupplierView-wSzWjZLY.js → SupplierView-CrzFvBIx.js} +21 -20
- package/dist/{SurchargeView-G8OyE60y.js → SurchargeView-BoNWpxFY.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CROQL761.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-Dcp5vZPM.js} +3 -3
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-IAknr-ye.js +292 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D1AGDeEP.js → TransferDetails.vue_vue_type_script_setup_true_lang-D9aNX0oM.js} +131 -130
- package/dist/{TransferTemplateView-CVfi8jsk.js → TransferTemplateView-DwIU0paO.js} +23 -22
- package/dist/UnitCostHistoryView-Bjs4RwyR.js +651 -0
- package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-BH0PxivU.js +137 -0
- package/dist/{UnitView-Dn3nuQHm.js → UnitView-BbQ0jOgS.js} +12 -10
- package/dist/{WarehouseView-GSxQ_Ev2.js → WarehouseView-DzPttKzE.js} +6 -6
- package/dist/WastageTemplateView-CxyZz5JC.js +2327 -0
- package/dist/api/adjustment-template.d.ts +1 -0
- package/dist/api/closing.d.ts +2 -0
- package/dist/api/inventory.d.ts +126 -36
- package/dist/api/netsuite.d.ts +8 -1
- package/dist/api/stock.d.ts +5 -1
- package/dist/api/unit-cost-history.d.ts +28 -0
- package/dist/{app-CYbiMVcX.js → app-EoCCjoRh.js} +9021 -7945
- package/dist/app.d.ts +236 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-Dq16W8vW.js → closing-template-O_hzhisU.js} +5 -1
- package/dist/components/TemplatePublishDialog.d.ts +1 -0
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +37 -1
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +14 -0
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +16 -1
- package/dist/{date2-De3BHKh5.js → date2-CTHKdfXp.js} +1 -1
- package/dist/{dayjs.min-DxdfVXA-.js → dayjs.min-Ccv4NdEp.js} +16 -16
- package/dist/decimal-tRyklLh0.js +99 -0
- package/dist/{defineDeepModel-2n_afItE.js → defineDeepModel-rmOd66to.js} +1 -1
- package/dist/{duplicate-template-DM7YIgor.js → duplicate-template-k8Erwdzo.js} +1 -1
- package/dist/export-TmaGpV98.js +25 -0
- package/dist/{feature-_nNpSZuh.js → feature-D4-lt7R6.js} +94 -89
- package/dist/{format-time-from-id-D5HSMsS-.js → format-time-from-id-Cru7cG1h.js} +1 -1
- package/dist/{format-unit-display-CQUFDxVm.js → format-unit-display-DZDD796a.js} +16 -15
- package/dist/{import-export.helper-BoxczUsX.js → import-export.helper-BjzXGudc.js} +16 -15
- package/dist/{index-B6nDUCCe.js → index-BeEz64I1.js} +3 -3
- package/dist/{index-Cp_mpu5S.js → index-DKCY6354.js} +1471 -1412
- package/dist/{index-CdfF5GGW.js → index-gGbN4qbt.js} +1 -1
- package/dist/{lodash-2R7Rgorb.js → lodash-BSCFf0k7.js} +1 -1
- package/dist/{netsuite-Bss4fURp.js → netsuite-DwoCq3Mv.js} +92 -92
- package/dist/number-CEUoMyIk.js +138 -0
- package/dist/{purchase-order-template-CBSvv0b2.js → purchase-order-template-DWTdjo9l.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/rules-CyW1Bx31.js +98 -0
- package/dist/{stock-DMX_hH5c.js → stock-DYWJ4DZW.js} +28 -27
- package/dist/stock-Ds3GNgHG.js +75 -0
- package/dist/stores/feature.d.ts +2 -0
- package/dist/stores/integration/netsuite.d.ts +8 -1
- package/dist/stores/inventory.d.ts +120 -30
- package/dist/{supplier-Cf5HW15s.js → supplier-DwUb1oVo.js} +2 -2
- package/dist/{surcharge-CyReT8lG.js → surcharge-UTJFNBLN.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BCyydlHR.js → use-ingredient-select-dialog-D8A3bPTe.js} +2 -2
- package/dist/{use-inventory-binding-dialog-WGQs-_2i.js → use-inventory-binding-dialog-DFmiAQ9d.js} +2 -2
- package/dist/{use-template-enabled-locations-2-B0nlqUjb.js → use-template-enabled-locations-2-snlITfW8.js} +2 -2
- package/dist/views/adjustment-template/wastage-template/table.d.ts +10 -1
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +68 -12
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +204 -36
- package/dist/views/closing-history/ClosingDetailDialog.vue.d.ts +23 -0
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +8 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +96 -12
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +96 -12
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +18 -18
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +14 -0
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +32 -4
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +28 -0
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +169 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingAlternative.vue.d.ts +43 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingRule.vue.d.ts +25 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +125 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventorySkuBindingV2Field.vue.d.ts +129 -0
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-alternative-table.d.ts +30 -0
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +4 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +8 -1
- package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +16 -2
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +33 -5
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +16 -2
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +32 -4
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +8 -1
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +41 -6
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +246 -36
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +287 -42
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +16 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -0
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +16 -2
- package/dist/views/stock/components/dialog/SnapshotRecalculationDialog.vue.d.ts +11 -0
- package/dist/views/stock/components/dialog/recalculationUtils.d.ts +16 -0
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -1
- package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +24 -3
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -12
- package/dist/views/unit-cost-history/UnitCostHistoryView.vue.d.ts +2 -0
- package/dist/views/unit-cost-history/components/UnitCostDetailsSideSheet.vue.d.ts +19 -0
- package/dist/views/unit-cost-history/components/UnitCostRecalculationDialog.vue.d.ts +11 -0
- package/dist/views/unit-cost-history/composables/use-unit-cost-history.d.ts +65 -0
- package/dist/{vue-i18n-DwS_fjo9.js → vue-i18n-CY4442Fb.js} +510 -510
- package/dist/{xlsx-9MOvXxhT.js → xlsx-Kc1XotGV.js} +1 -1
- package/dist/{xlsx.util-D1DdGA1N.js → xlsx.util-Dy4jmPyv.js} +1 -1
- package/package.json +1 -1
- package/dist/ClosingHistoryView-YrEVWvGu.js +0 -447
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-BDVHkTSE.js +0 -116
- package/dist/RecipeView-B-gmrXHR.js +0 -646
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js +0 -251
- package/dist/StockView-BNe2_5bA.js +0 -2520
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CwV2luel.js +0 -263
- package/dist/WastageTemplateView-BG-y48uc.js +0 -2388
- package/dist/rules-T-fs8_4_.js +0 -327
- package/dist/stock-CFWu5bRA.js +0 -75
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ai as Q, A as K } from "./app-EoCCjoRh.js";
|
|
2
2
|
var E = { exports: {} };
|
|
3
3
|
(function(V, X) {
|
|
4
4
|
(function(W, k) {
|
|
5
5
|
V.exports = k();
|
|
6
6
|
})(Q, function() {
|
|
7
|
-
var W = 1e3, k = 6e4, N = 36e5, A = "millisecond", S = "second", w = "minute", O = "hour", M = "day", T = "week", m = "month", U = "quarter",
|
|
7
|
+
var W = 1e3, k = 6e4, N = 36e5, A = "millisecond", S = "second", w = "minute", O = "hour", M = "day", T = "week", m = "month", U = "quarter", v = "year", _ = "date", J = "Invalid Date", q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, B = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, G = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
|
|
8
8
|
var n = ["th", "st", "nd", "rd"], t = s % 100;
|
|
9
9
|
return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
|
|
10
10
|
} }, I = function(s, n, t) {
|
|
@@ -20,7 +20,7 @@ var E = { exports: {} };
|
|
|
20
20
|
}, a: function(s) {
|
|
21
21
|
return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
|
|
22
22
|
}, p: function(s) {
|
|
23
|
-
return { M: m, y, w: T, d: M, D: _, h: O, m: w, s: S, ms: A, Q: U }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
|
23
|
+
return { M: m, y: v, w: T, d: M, D: _, h: O, m: w, s: S, ms: A, Q: U }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
|
24
24
|
}, u: function(s) {
|
|
25
25
|
return s === void 0;
|
|
26
26
|
} }, x = "en", D = {};
|
|
@@ -90,13 +90,13 @@ var E = { exports: {} };
|
|
|
90
90
|
return this.$d.getTime();
|
|
91
91
|
}, n.startOf = function(t, r) {
|
|
92
92
|
var e = this, i = !!a.u(r) || r, u = a.p(t), o = function(p, $) {
|
|
93
|
-
var
|
|
94
|
-
return i ?
|
|
93
|
+
var y = a.w(e.$u ? Date.UTC(e.$y, $, p) : new Date(e.$y, $, p), e);
|
|
94
|
+
return i ? y : y.endOf(M);
|
|
95
95
|
}, c = function(p, $) {
|
|
96
96
|
return a.w(e.toDate()[p].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), e);
|
|
97
97
|
}, h = this.$W, d = this.$M, l = this.$D, b = "set" + (this.$u ? "UTC" : "");
|
|
98
98
|
switch (u) {
|
|
99
|
-
case
|
|
99
|
+
case v:
|
|
100
100
|
return i ? o(1, 0) : o(31, 11);
|
|
101
101
|
case m:
|
|
102
102
|
return i ? o(1, d) : o(0, d + 1);
|
|
@@ -118,8 +118,8 @@ var E = { exports: {} };
|
|
|
118
118
|
}, n.endOf = function(t) {
|
|
119
119
|
return this.startOf(t, !1);
|
|
120
120
|
}, n.$set = function(t, r) {
|
|
121
|
-
var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[M] = u + "Date", e[_] = u + "Date", e[m] = u + "Month", e[
|
|
122
|
-
if (i === m || i ===
|
|
121
|
+
var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[M] = u + "Date", e[_] = u + "Date", e[m] = u + "Month", e[v] = u + "FullYear", e[O] = u + "Hours", e[w] = u + "Minutes", e[S] = u + "Seconds", e[A] = u + "Milliseconds", e)[i], c = i === M ? this.$D + (r - this.$W) : r;
|
|
122
|
+
if (i === m || i === v) {
|
|
123
123
|
var h = this.clone().set(_, 1);
|
|
124
124
|
h.$d[o](c), h.init(), this.$d = h.set(_, Math.min(this.$D, h.daysInMonth())).$d;
|
|
125
125
|
} else o && this.$d[o](c);
|
|
@@ -136,7 +136,7 @@ var E = { exports: {} };
|
|
|
136
136
|
return a.w(l.date(l.date() + Math.round(d * t)), i);
|
|
137
137
|
};
|
|
138
138
|
if (u === m) return this.set(m, this.$M + t);
|
|
139
|
-
if (u ===
|
|
139
|
+
if (u === v) return this.set(v, this.$y + t);
|
|
140
140
|
if (u === M) return o(1);
|
|
141
141
|
if (u === T) return o(7);
|
|
142
142
|
var c = (e = {}, e[w] = k, e[O] = N, e[S] = W, e)[u] || 1, h = this.$d.getTime() + t * c;
|
|
@@ -146,16 +146,16 @@ var E = { exports: {} };
|
|
|
146
146
|
}, n.format = function(t) {
|
|
147
147
|
var r = this, e = this.$locale();
|
|
148
148
|
if (!this.isValid()) return e.invalidDate || J;
|
|
149
|
-
var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, l = e.months, b = e.meridiem, g = function($,
|
|
150
|
-
return $ && ($[
|
|
149
|
+
var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, l = e.months, b = e.meridiem, g = function($, y, H, L) {
|
|
150
|
+
return $ && ($[y] || $(r, i)) || H[y].slice(0, L);
|
|
151
151
|
}, Y = function($) {
|
|
152
152
|
return a.s(o % 12 || 12, $, "0");
|
|
153
|
-
}, p = b || function($,
|
|
153
|
+
}, p = b || function($, y, H) {
|
|
154
154
|
var L = $ < 12 ? "AM" : "PM";
|
|
155
155
|
return H ? L.toLowerCase() : L;
|
|
156
156
|
};
|
|
157
|
-
return i.replace(B, function($,
|
|
158
|
-
return
|
|
157
|
+
return i.replace(B, function($, y) {
|
|
158
|
+
return y || function(H) {
|
|
159
159
|
switch (H) {
|
|
160
160
|
case "YY":
|
|
161
161
|
return String(r.$y).slice(-2);
|
|
@@ -216,7 +216,7 @@ var E = { exports: {} };
|
|
|
216
216
|
return a.m(u, c);
|
|
217
217
|
};
|
|
218
218
|
switch (o) {
|
|
219
|
-
case
|
|
219
|
+
case v:
|
|
220
220
|
i = l() / 12;
|
|
221
221
|
break;
|
|
222
222
|
case m:
|
|
@@ -264,7 +264,7 @@ var E = { exports: {} };
|
|
|
264
264
|
return this.$d.toUTCString();
|
|
265
265
|
}, s;
|
|
266
266
|
}(), z = C.prototype;
|
|
267
|
-
return f.prototype = z, [["$ms", A], ["$s", S], ["$m", w], ["$H", O], ["$W", M], ["$M", m], ["$y",
|
|
267
|
+
return f.prototype = z, [["$ms", A], ["$s", S], ["$m", w], ["$H", O], ["$W", M], ["$M", m], ["$y", v], ["$D", _]].forEach(function(s) {
|
|
268
268
|
z[s[1]] = function(n) {
|
|
269
269
|
return this.$g(n, s[0], s[1]);
|
|
270
270
|
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import "./dayjs.min-Ccv4NdEp.js";
|
|
2
|
+
import "./app-EoCCjoRh.js";
|
|
3
|
+
function m(a) {
|
|
4
|
+
function t(o, n = !0) {
|
|
5
|
+
const e = Math.round(Math.log10(o));
|
|
6
|
+
return isFinite(e) && e >= 0 ? Math.ceil(e) : n ? 0 : Math.floor(e);
|
|
7
|
+
}
|
|
8
|
+
function r(o) {
|
|
9
|
+
const n = o.conversion;
|
|
10
|
+
return i - n.precision + t(n.amount);
|
|
11
|
+
}
|
|
12
|
+
const i = a.precision;
|
|
13
|
+
return a.measurements.reduce((o, n) => {
|
|
14
|
+
const e = r(n);
|
|
15
|
+
return e > o ? e : o;
|
|
16
|
+
}, 0);
|
|
17
|
+
}
|
|
18
|
+
class c {
|
|
19
|
+
static toDouble(t) {
|
|
20
|
+
return t.amount / Math.pow(10, t.precision);
|
|
21
|
+
}
|
|
22
|
+
static multiplyDecimal(t, r) {
|
|
23
|
+
let i = t.amount * r.amount, o = i == 0 ? 0 : t.precision + r.precision, n = i.toString();
|
|
24
|
+
for (; n.length > 0 && n[n.length - 1] == "0" && o > 0; )
|
|
25
|
+
i = i / 10, o -= 1, n = i.toString();
|
|
26
|
+
return {
|
|
27
|
+
amount: i,
|
|
28
|
+
precision: o
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
static divide(t, r) {
|
|
32
|
+
return {
|
|
33
|
+
amount: Math.floor(t.amount / r),
|
|
34
|
+
precision: t.precision
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/// Adds two decimals and returns result of any max precision from [left] or [right]
|
|
38
|
+
static addDecimal(t, r) {
|
|
39
|
+
const i = c.normalize([t, r]), o = i[0], n = i[1];
|
|
40
|
+
return {
|
|
41
|
+
amount: o.amount + n.amount,
|
|
42
|
+
precision: o.precision
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/// Multiplies amount if new precision is higher or rounds amount if new precision is lower
|
|
46
|
+
///
|
|
47
|
+
/// e.g. 0.4 to 2 precision --> 0.40
|
|
48
|
+
/// 0.47 to 1 precision --> 0.5
|
|
49
|
+
/// 0.22 to 1 precision --> 0.0
|
|
50
|
+
static toPrecision(t, r) {
|
|
51
|
+
function i(n, e) {
|
|
52
|
+
let s = n.amount;
|
|
53
|
+
for (let u = n.precision; u < e; u++)
|
|
54
|
+
s *= 10;
|
|
55
|
+
return {
|
|
56
|
+
amount: s,
|
|
57
|
+
precision: e
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function o(n, e) {
|
|
61
|
+
let s = n.amount;
|
|
62
|
+
for (let u = n.precision; u > e; u--)
|
|
63
|
+
s /= 10;
|
|
64
|
+
return {
|
|
65
|
+
amount: Number(s.toFixed(0)),
|
|
66
|
+
precision: e
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return t.precision == r ? t : t.precision < r ? i(t, r) : o(t, r);
|
|
70
|
+
}
|
|
71
|
+
static equal(t, r) {
|
|
72
|
+
const i = c.normalize([t, r]), o = i[0], n = i[1];
|
|
73
|
+
return o.amount == n.amount;
|
|
74
|
+
}
|
|
75
|
+
static normalize(t) {
|
|
76
|
+
const r = t.reduce(
|
|
77
|
+
(i, o) => Math.max(i, Math.floor(o.precision)),
|
|
78
|
+
0
|
|
79
|
+
);
|
|
80
|
+
return t.map((i) => c.toPrecision(i, r));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function f(a, t, r, i = !0) {
|
|
84
|
+
let o = {
|
|
85
|
+
...a
|
|
86
|
+
};
|
|
87
|
+
if (r) {
|
|
88
|
+
const n = typeof r == "string" ? t.measurements.find((s) => s.id === r) : r;
|
|
89
|
+
if (!n)
|
|
90
|
+
return "NaN";
|
|
91
|
+
const e = m(t);
|
|
92
|
+
return o.precision < e && (o = c.toPrecision(o, m(t))), o = c.divide(o, c.toDouble(n.conversion)), `${c.toDouble(o)} ${n.abbrev}`;
|
|
93
|
+
}
|
|
94
|
+
return i ? `${c.toDouble(o)} ${t.abbrev}` : c.toDouble(o);
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
c as F,
|
|
98
|
+
f as g
|
|
99
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { u as s, w as c } from "./xlsx-Kc1XotGV.js";
|
|
2
|
+
function i(e, o) {
|
|
3
|
+
return o.map((t) => typeof t.selector == "function" ? t.selector(e) : e[t.selector]);
|
|
4
|
+
}
|
|
5
|
+
function p(e, o) {
|
|
6
|
+
const t = o.map((n) => n.name), a = e.map((n) => i(n, o));
|
|
7
|
+
return s.aoa_to_sheet([t, ...a]);
|
|
8
|
+
}
|
|
9
|
+
async function u(e, o) {
|
|
10
|
+
const t = s.book_new();
|
|
11
|
+
for (const a of e) {
|
|
12
|
+
const n = p(
|
|
13
|
+
a.data,
|
|
14
|
+
a.columns.map((r) => typeof r == "string" ? {
|
|
15
|
+
name: r,
|
|
16
|
+
selector: r
|
|
17
|
+
} : r)
|
|
18
|
+
);
|
|
19
|
+
s.book_append_sheet(t, n, a.name);
|
|
20
|
+
}
|
|
21
|
+
await c(t, o);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
u as e
|
|
25
|
+
};
|