@erpsquad/common 1.10.34 → 1.10.35
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/chunks/{ERPUIProvider-efoQR1NS.esm.js → ERPUIProvider-9v8Gxl0N.esm.js} +8 -8
- package/dist/chunks/{ERPUIProvider-efoQR1NS.esm.js.map → ERPUIProvider-9v8Gxl0N.esm.js.map} +1 -1
- package/dist/chunks/{ERPUIProvider-Cx_i_M4n.js → ERPUIProvider-CzbUy3QH.js} +8 -8
- package/dist/chunks/{ERPUIProvider-Cx_i_M4n.js.map → ERPUIProvider-CzbUy3QH.js.map} +1 -1
- package/dist/chunks/{actionCreator-vTZB9fR0.js → actionCreator-Bjpsmqhw.js} +2 -2
- package/dist/chunks/{actionCreator-vTZB9fR0.js.map → actionCreator-Bjpsmqhw.js.map} +1 -1
- package/dist/chunks/{actionCreator-BErV_DJi.esm.js → actionCreator-BqSofo6j.esm.js} +2 -2
- package/dist/chunks/{actionCreator-BErV_DJi.esm.js.map → actionCreator-BqSofo6j.esm.js.map} +1 -1
- package/dist/chunks/{android-12-switch-BVYQ-rw2.js → android-12-switch-CS2l3lZl.js} +10 -10
- package/dist/chunks/{android-12-switch-BVYQ-rw2.js.map → android-12-switch-CS2l3lZl.js.map} +1 -1
- package/dist/chunks/{android-12-switch-C_YbKxSb.esm.js → android-12-switch-CkNTxe05.esm.js} +10 -10
- package/dist/chunks/{android-12-switch-C_YbKxSb.esm.js.map → android-12-switch-CkNTxe05.esm.js.map} +1 -1
- package/dist/chunks/{appbar-iX4MsbPA.js → appbar-CpFRSqf_.js} +4 -4
- package/dist/chunks/{appbar-iX4MsbPA.js.map → appbar-CpFRSqf_.js.map} +1 -1
- package/dist/chunks/{appbar-GjX4JjE0.esm.js → appbar-TAwwuaX6.esm.js} +4 -4
- package/dist/chunks/{appbar-GjX4JjE0.esm.js.map → appbar-TAwwuaX6.esm.js.map} +1 -1
- package/dist/chunks/{common-iR052qHs.esm.js → common-Cpgvw0_g.esm.js} +98 -77
- package/dist/chunks/{common-iR052qHs.esm.js.map → common-Cpgvw0_g.esm.js.map} +1 -1
- package/dist/chunks/{common-B6ToXe3y.js → common-Dq-WJLKO.js} +41 -20
- package/dist/chunks/{common-B6ToXe3y.js.map → common-Dq-WJLKO.js.map} +1 -1
- package/dist/chunks/{custom-editor-BUI-1ej_.esm.js → custom-editor-DTVOLVrV.esm.js} +2 -2
- package/dist/chunks/{custom-editor-BUI-1ej_.esm.js.map → custom-editor-DTVOLVrV.esm.js.map} +1 -1
- package/dist/chunks/{custom-editor-BqtNIYz7.js → custom-editor-DXOQ1DX9.js} +2 -2
- package/dist/chunks/{custom-editor-BqtNIYz7.js.map → custom-editor-DXOQ1DX9.js.map} +1 -1
- package/dist/chunks/{default-data-CI-fIBLD.js → default-data-Il1hYVOO.js} +12 -12
- package/dist/chunks/{default-data-CI-fIBLD.js.map → default-data-Il1hYVOO.js.map} +1 -1
- package/dist/chunks/{default-data-C6WYth31.esm.js → default-data-ScyBocPE.esm.js} +12 -12
- package/dist/chunks/{default-data-C6WYth31.esm.js.map → default-data-ScyBocPE.esm.js.map} +1 -1
- package/dist/chunks/{form-builder-conversion-DB5e6ftU.js → form-builder-conversion-Coz57dDg.js} +2 -2
- package/dist/chunks/{form-builder-conversion-DB5e6ftU.js.map → form-builder-conversion-Coz57dDg.js.map} +1 -1
- package/dist/chunks/{form-builder-conversion-CLhxJznY.esm.js → form-builder-conversion-qaQHCAEa.esm.js} +2 -2
- package/dist/chunks/{form-builder-conversion-CLhxJznY.esm.js.map → form-builder-conversion-qaQHCAEa.esm.js.map} +1 -1
- package/dist/chunks/{form-builder-deconversion-DlqtSyif.esm.js → form-builder-deconversion-ByIXFXBn.esm.js} +7 -6
- package/dist/chunks/form-builder-deconversion-ByIXFXBn.esm.js.map +1 -0
- package/dist/chunks/{form-builder-deconversion-BjpzW-gS.js → form-builder-deconversion-fgHLe0ce.js} +7 -6
- package/dist/chunks/form-builder-deconversion-fgHLe0ce.js.map +1 -0
- package/dist/chunks/{fullScreen-DrF0XOKe.esm.js → fullScreen-DtKg0L3D.esm.js} +2 -2
- package/dist/chunks/{fullScreen-DrF0XOKe.esm.js.map → fullScreen-DtKg0L3D.esm.js.map} +1 -1
- package/dist/chunks/{fullScreen-b3cr4XpU.js → fullScreen-bRAya-he.js} +2 -2
- package/dist/chunks/{fullScreen-b3cr4XpU.js.map → fullScreen-bRAya-he.js.map} +1 -1
- package/dist/chunks/{languageContext-DY1QBZVu.js → languageContext-BPQIxsCP.js} +3 -3
- package/dist/chunks/{languageContext-DY1QBZVu.js.map → languageContext-BPQIxsCP.js.map} +1 -1
- package/dist/chunks/{languageContext-CQCN5pEP.esm.js → languageContext-D7fYlKrR.esm.js} +3 -3
- package/dist/chunks/{languageContext-CQCN5pEP.esm.js.map → languageContext-D7fYlKrR.esm.js.map} +1 -1
- package/dist/chunks/{migration-utils-DfD5CmSa.js → migration-utils-57WEkJ_B.js} +2 -2
- package/dist/chunks/{migration-utils-DfD5CmSa.js.map → migration-utils-57WEkJ_B.js.map} +1 -1
- package/dist/chunks/{migration-utils-DqFCCN6j.esm.js → migration-utils-CnkEEmRW.esm.js} +2 -2
- package/dist/chunks/{migration-utils-DqFCCN6j.esm.js.map → migration-utils-CnkEEmRW.esm.js.map} +1 -1
- package/dist/chunks/{page-context-DMDecvGS.js → page-context-BB4Ffwe1.js} +3 -3
- package/dist/chunks/{page-context-DMDecvGS.js.map → page-context-BB4Ffwe1.js.map} +1 -1
- package/dist/chunks/{page-context-CURXy5Ca.esm.js → page-context-DFpeobCn.esm.js} +3 -3
- package/dist/chunks/{page-context-CURXy5Ca.esm.js.map → page-context-DFpeobCn.esm.js.map} +1 -1
- package/dist/chunks/{reducer-DaDIARBt.js → reducer-BqlXjzxB.js} +2 -2
- package/dist/chunks/{reducer-DaDIARBt.js.map → reducer-BqlXjzxB.js.map} +1 -1
- package/dist/chunks/{reducer-C1gzAp4_.esm.js → reducer-CSMqWJei.esm.js} +2 -2
- package/dist/chunks/{reducer-C1gzAp4_.esm.js.map → reducer-CSMqWJei.esm.js.map} +1 -1
- package/dist/chunks/{shareSlice-BQoDjC6d.js → shareSlice-BQ9DRBnB.js} +2 -2
- package/dist/chunks/{shareSlice-BQoDjC6d.js.map → shareSlice-BQ9DRBnB.js.map} +1 -1
- package/dist/chunks/{shareSlice-C19tCird.esm.js → shareSlice-BT38JEAY.esm.js} +2 -2
- package/dist/chunks/{shareSlice-C19tCird.esm.js.map → shareSlice-BT38JEAY.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-B4z6-krq.esm.js → sidebar-C5qjTXXo.esm.js} +4 -4
- package/dist/chunks/{sidebar-B4z6-krq.esm.js.map → sidebar-C5qjTXXo.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-D2GVqop0.js → sidebar-VFv4DXkh.js} +4 -4
- package/dist/chunks/{sidebar-D2GVqop0.js.map → sidebar-VFv4DXkh.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-BIaE-1SX.esm.js → sidebarScreen-C2SlUP7r.esm.js} +5 -5
- package/dist/chunks/{sidebarScreen-BIaE-1SX.esm.js.map → sidebarScreen-C2SlUP7r.esm.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-tOaiDaZY.js → sidebarScreen-DCKbocRy.js} +5 -5
- package/dist/chunks/{sidebarScreen-tOaiDaZY.js.map → sidebarScreen-DCKbocRy.js.map} +1 -1
- package/dist/chunks/{store-BjX-S8qH.js → store-CLYNAnAD.js} +3 -3
- package/dist/chunks/{store-BjX-S8qH.js.map → store-CLYNAnAD.js.map} +1 -1
- package/dist/chunks/{store-IUKQwht8.esm.js → store-Cnp_aZ61.esm.js} +3 -3
- package/dist/chunks/{store-IUKQwht8.esm.js.map → store-Cnp_aZ61.esm.js.map} +1 -1
- package/dist/chunks/{translations-CEzDVctx.js → translations-BEy6oick.js} +2 -2
- package/dist/chunks/{translations-CEzDVctx.js.map → translations-BEy6oick.js.map} +1 -1
- package/dist/chunks/{translations-DAA1aPRP.esm.js → translations-BmOMbTU3.esm.js} +2 -2
- package/dist/chunks/{translations-DAA1aPRP.esm.js.map → translations-BmOMbTU3.esm.js.map} +1 -1
- package/dist/chunks/{uom-field-wrapper-CK0IofP-.esm.js → uom-field-wrapper-95SEvih0.esm.js} +14 -14
- package/dist/chunks/{uom-field-wrapper-CK0IofP-.esm.js.map → uom-field-wrapper-95SEvih0.esm.js.map} +1 -1
- package/dist/chunks/{uom-field-wrapper-ChPv3EW0.js → uom-field-wrapper-N6EMrv0V.js} +14 -14
- package/dist/chunks/{uom-field-wrapper-ChPv3EW0.js.map → uom-field-wrapper-N6EMrv0V.js.map} +1 -1
- package/dist/chunks/{useAccountSetting-STJXsAzw.esm.js → useAccountSetting-BVu31GsF.esm.js} +3 -3
- package/dist/chunks/{useAccountSetting-STJXsAzw.esm.js.map → useAccountSetting-BVu31GsF.esm.js.map} +1 -1
- package/dist/chunks/{useAccountSetting-DJpWj305.js → useAccountSetting-l4Yify9f.js} +3 -3
- package/dist/chunks/{useAccountSetting-DJpWj305.js.map → useAccountSetting-l4Yify9f.js.map} +1 -1
- package/dist/chunks/{useAdditionalDiscountAutoCalc-PgloXkHo.js → useAdditionalDiscountAutoCalc-BXCYogRk.js} +5 -5
- package/dist/chunks/{useAdditionalDiscountAutoCalc-PgloXkHo.js.map → useAdditionalDiscountAutoCalc-BXCYogRk.js.map} +1 -1
- package/dist/chunks/{useAdditionalDiscountAutoCalc-B38GlNl8.esm.js → useAdditionalDiscountAutoCalc-B_YCJ6Zq.esm.js} +5 -5
- package/dist/chunks/{useAdditionalDiscountAutoCalc-B38GlNl8.esm.js.map → useAdditionalDiscountAutoCalc-B_YCJ6Zq.esm.js.map} +1 -1
- package/dist/chunks/{useAuth-BFpig5Ps.esm.js → useAuth-B070hyUd.esm.js} +2 -2
- package/dist/chunks/{useAuth-BFpig5Ps.esm.js.map → useAuth-B070hyUd.esm.js.map} +1 -1
- package/dist/chunks/{useAuth-CAwkUuIW.js → useAuth-gK8z1bjy.js} +2 -2
- package/dist/chunks/{useAuth-CAwkUuIW.js.map → useAuth-gK8z1bjy.js.map} +1 -1
- package/dist/chunks/{useLangauge-DCJSwOB9.js → useLangauge-3LRrhzbB.js} +2 -2
- package/dist/chunks/{useLangauge-DCJSwOB9.js.map → useLangauge-3LRrhzbB.js.map} +1 -1
- package/dist/chunks/{useLangauge-CMwQu-W4.esm.js → useLangauge-dJL6I10G.esm.js} +2 -2
- package/dist/chunks/{useLangauge-CMwQu-W4.esm.js.map → useLangauge-dJL6I10G.esm.js.map} +1 -1
- package/dist/components/index.esm.js +9 -9
- package/dist/components/index.js +9 -9
- package/dist/contexts/index.esm.js +3 -3
- package/dist/contexts/index.js +3 -3
- package/dist/hooks/index.esm.js +5 -5
- package/dist/hooks/index.js +5 -5
- package/dist/index.esm.js +74 -72
- package/dist/index.js +26 -24
- package/dist/index.js.map +1 -1
- package/dist/layout/index.esm.js +2 -2
- package/dist/layout/index.js +2 -2
- package/dist/redux/index.esm.js +4 -4
- package/dist/redux/index.js +4 -4
- package/dist/src/utils/common-utility.d.ts +2 -1
- package/dist/src/utils/common.d.ts +4 -2
- package/dist/utils/common-utility.d.ts +2 -1
- package/dist/utils/common.d.ts +4 -2
- package/dist/utils/index.esm.js +62 -60
- package/dist/utils/index.js +8 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/views/index.esm.js +8 -8
- package/dist/views/index.js +7 -7
- package/package.json +1 -1
- package/dist/chunks/form-builder-deconversion-BjpzW-gS.js.map +0 -1
- package/dist/chunks/form-builder-deconversion-DlqtSyif.esm.js.map +0 -1
|
@@ -2715,7 +2715,7 @@ const getOperatorLabel = (rule, filterFields) => {
|
|
|
2715
2715
|
}
|
|
2716
2716
|
return operatorLable;
|
|
2717
2717
|
};
|
|
2718
|
-
const formatAmount = (amount = "", format = "", position = "before", symbol) => {
|
|
2718
|
+
const formatAmount = (amount = "", format = "", position = "before", symbol, fraction) => {
|
|
2719
2719
|
if (amount === "" || amount === null || amount === void 0) {
|
|
2720
2720
|
amount = 0;
|
|
2721
2721
|
}
|
|
@@ -2723,49 +2723,52 @@ const formatAmount = (amount = "", format = "", position = "before", symbol) =>
|
|
|
2723
2723
|
amount = parseFloat(amount.replace(/[^\d.-]/g, ""));
|
|
2724
2724
|
if (isNaN(amount)) return "";
|
|
2725
2725
|
}
|
|
2726
|
-
const
|
|
2726
|
+
const f = fraction ?? getDefaultFraction();
|
|
2727
|
+
console.log("🚀 ~ formatAmount ~ getDefaultFraction():", getDefaultFraction());
|
|
2728
|
+
console.log("🚀 ~ formatAmount ~ f :", f);
|
|
2729
|
+
const num = parseFloat(amount.toFixed(f));
|
|
2727
2730
|
let formatter;
|
|
2728
2731
|
switch (format) {
|
|
2729
2732
|
case "#,###.##":
|
|
2730
2733
|
formatter = new Intl.NumberFormat("en-US", {
|
|
2731
|
-
minimumFractionDigits:
|
|
2732
|
-
maximumFractionDigits:
|
|
2734
|
+
minimumFractionDigits: f,
|
|
2735
|
+
maximumFractionDigits: f
|
|
2733
2736
|
});
|
|
2734
2737
|
break;
|
|
2735
2738
|
case "#.###,##":
|
|
2736
2739
|
formatter = new Intl.NumberFormat("de-DE", {
|
|
2737
|
-
minimumFractionDigits:
|
|
2738
|
-
maximumFractionDigits:
|
|
2740
|
+
minimumFractionDigits: f,
|
|
2741
|
+
maximumFractionDigits: f
|
|
2739
2742
|
});
|
|
2740
2743
|
break;
|
|
2741
2744
|
case "# ###.##":
|
|
2742
2745
|
formatter = new Intl.NumberFormat("fr-FR", {
|
|
2743
|
-
minimumFractionDigits:
|
|
2744
|
-
maximumFractionDigits:
|
|
2746
|
+
minimumFractionDigits: f,
|
|
2747
|
+
maximumFractionDigits: f
|
|
2745
2748
|
});
|
|
2746
2749
|
break;
|
|
2747
2750
|
case "# ###,##":
|
|
2748
2751
|
formatter = new Intl.NumberFormat("es-ES", {
|
|
2749
|
-
minimumFractionDigits:
|
|
2750
|
-
maximumFractionDigits:
|
|
2752
|
+
minimumFractionDigits: f,
|
|
2753
|
+
maximumFractionDigits: f
|
|
2751
2754
|
});
|
|
2752
2755
|
break;
|
|
2753
2756
|
case "#’ ###. ##":
|
|
2754
2757
|
formatter = new Intl.NumberFormat("de-CH", {
|
|
2755
|
-
minimumFractionDigits:
|
|
2756
|
-
maximumFractionDigits:
|
|
2758
|
+
minimumFractionDigits: f,
|
|
2759
|
+
maximumFractionDigits: f
|
|
2757
2760
|
});
|
|
2758
2761
|
break;
|
|
2759
2762
|
case "#, ###.##":
|
|
2760
2763
|
formatter = new Intl.NumberFormat("en-GB", {
|
|
2761
|
-
minimumFractionDigits:
|
|
2762
|
-
maximumFractionDigits:
|
|
2764
|
+
minimumFractionDigits: f,
|
|
2765
|
+
maximumFractionDigits: f
|
|
2763
2766
|
});
|
|
2764
2767
|
break;
|
|
2765
2768
|
default:
|
|
2766
2769
|
formatter = new Intl.NumberFormat("en-US", {
|
|
2767
|
-
minimumFractionDigits:
|
|
2768
|
-
maximumFractionDigits:
|
|
2770
|
+
minimumFractionDigits: f,
|
|
2771
|
+
maximumFractionDigits: f
|
|
2769
2772
|
});
|
|
2770
2773
|
}
|
|
2771
2774
|
let formattedAmount = formatter.format(num);
|
|
@@ -3774,9 +3777,13 @@ function formatResponseDatesToDayJS(obj) {
|
|
|
3774
3777
|
}
|
|
3775
3778
|
return obj;
|
|
3776
3779
|
}
|
|
3777
|
-
const toFixedWithNumbers = (num) => {
|
|
3780
|
+
const toFixedWithNumbers = (num, fraction) => {
|
|
3778
3781
|
var _a;
|
|
3779
|
-
|
|
3782
|
+
let f = fraction ?? getDefaultFraction();
|
|
3783
|
+
console.log("🚀 ~ toFixedWithNumbers ~ getDefaultFraction():", getDefaultFraction());
|
|
3784
|
+
console.log("🚀 ~ toFixedWithNumbers ~ f :", f);
|
|
3785
|
+
let a = num || num === 0 ? (_a = Number(num)) == null ? void 0 : _a.toFixed(f) : num;
|
|
3786
|
+
return a;
|
|
3780
3787
|
};
|
|
3781
3788
|
const findById = (arr, id) => arr.find((a) => a.id == id);
|
|
3782
3789
|
const getTaxAmountFromMultipleTaxCodes = (amount, taxCodes = [], detail = false) => {
|
|
@@ -4225,9 +4232,21 @@ const addOrEditArray = (array = [], data) => {
|
|
|
4225
4232
|
}
|
|
4226
4233
|
return [...newArray, updatedData];
|
|
4227
4234
|
};
|
|
4228
|
-
const
|
|
4235
|
+
const getDefaultUserData = () => {
|
|
4229
4236
|
const uData = localStorage.getItem("_u_data");
|
|
4230
4237
|
const userData = uData ? JSON.parse(uData) : {};
|
|
4238
|
+
return userData;
|
|
4239
|
+
};
|
|
4240
|
+
const getDefaultFraction = () => {
|
|
4241
|
+
var _a, _b;
|
|
4242
|
+
const userData = getDefaultUserData();
|
|
4243
|
+
const fractionUnit = (_a = userData == null ? void 0 : userData.currency_data) == null ? void 0 : _a.fraction_unit;
|
|
4244
|
+
console.log("🚀 ~ getDefaultFraction ~ userData?.currency_data:", userData == null ? void 0 : userData.currency_data);
|
|
4245
|
+
console.log("🚀 ~ getDefaultFraction ~ userData?.currency_data?.fraction_unit:", (_b = userData == null ? void 0 : userData.currency_data) == null ? void 0 : _b.fraction_unit);
|
|
4246
|
+
return Number(fractionUnit ?? 2);
|
|
4247
|
+
};
|
|
4248
|
+
const getAccessibleModules = (moduleNames = []) => {
|
|
4249
|
+
const userData = getDefaultUserData();
|
|
4231
4250
|
const accessModules = (userData == null ? void 0 : userData.module_access) || [];
|
|
4232
4251
|
const findSubModules = accessModules.filter((module2) => moduleNames.includes(module2.module_name)).map((module2) => ({
|
|
4233
4252
|
...module2,
|
|
@@ -4655,6 +4674,8 @@ exports.getCountryIdByName = getCountryIdByName;
|
|
|
4655
4674
|
exports.getCurrency = getCurrency;
|
|
4656
4675
|
exports.getCurrencyFormat = getCurrencyFormat;
|
|
4657
4676
|
exports.getCurrencySymbol = getCurrencySymbol;
|
|
4677
|
+
exports.getDefaultFraction = getDefaultFraction;
|
|
4678
|
+
exports.getDefaultUserData = getDefaultUserData;
|
|
4658
4679
|
exports.getErrorMessage = getErrorMessage;
|
|
4659
4680
|
exports.getExcelExportTemplate = getExcelExportTemplate;
|
|
4660
4681
|
exports.getExcelTemplateGenerateTemplate = getExcelTemplateGenerateTemplate;
|
|
@@ -4709,4 +4730,4 @@ exports.updateFieldsDisabledState = updateFieldsDisabledState;
|
|
|
4709
4730
|
exports.uploadAttachments = uploadAttachments;
|
|
4710
4731
|
exports.uploadFiles = uploadFiles;
|
|
4711
4732
|
exports.validateDiscountValidity = validateDiscountValidity;
|
|
4712
|
-
//# sourceMappingURL=common-
|
|
4733
|
+
//# sourceMappingURL=common-Dq-WJLKO.js.map
|