@erpsquad/common 1.10.29 → 1.10.31
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-CLg_Yo12.esm.js → ERPUIProvider-CIzXMsuV.esm.js} +8 -8
- package/dist/chunks/{ERPUIProvider-CLg_Yo12.esm.js.map → ERPUIProvider-CIzXMsuV.esm.js.map} +1 -1
- package/dist/chunks/{actionCreator-C8cLIOap.esm.js → actionCreator-BzPZv2rR.esm.js} +2 -2
- package/dist/chunks/{actionCreator-C8cLIOap.esm.js.map → actionCreator-BzPZv2rR.esm.js.map} +1 -1
- package/dist/chunks/{android-12-switch-DM9s0XTb.js → android-12-switch-BILQvv4G.js} +170 -5
- package/dist/chunks/android-12-switch-BILQvv4G.js.map +1 -0
- package/dist/chunks/{android-12-switch-eTZOAHAa.esm.js → android-12-switch-DpJE56Wi.esm.js} +212 -47
- package/dist/chunks/android-12-switch-DpJE56Wi.esm.js.map +1 -0
- package/dist/chunks/{appbar-DtROOKgm.esm.js → appbar-5rP5iXcS.esm.js} +4 -4
- package/dist/chunks/{appbar-DtROOKgm.esm.js.map → appbar-5rP5iXcS.esm.js.map} +1 -1
- package/dist/chunks/{common-Nn4SUfK7.esm.js → common-D59u5rE6.esm.js} +2 -2
- package/dist/chunks/{common-Nn4SUfK7.esm.js.map → common-D59u5rE6.esm.js.map} +1 -1
- package/dist/chunks/{custom-editor-B-mleFzm.esm.js → custom-editor-UhZu0Svw.esm.js} +2 -2
- package/dist/chunks/{custom-editor-B-mleFzm.esm.js.map → custom-editor-UhZu0Svw.esm.js.map} +1 -1
- package/dist/chunks/{default-data-BjzCfuoR.js → default-data-B2-JPE4u.js} +9 -11
- package/dist/chunks/{default-data-BjzCfuoR.js.map → default-data-B2-JPE4u.js.map} +1 -1
- package/dist/chunks/{default-data-C8B-fYa8.esm.js → default-data-DLCnpyaM.esm.js} +19 -21
- package/dist/chunks/{default-data-C8B-fYa8.esm.js.map → default-data-DLCnpyaM.esm.js.map} +1 -1
- package/dist/chunks/{form-builder-conversion-yi03Elpa.esm.js → form-builder-conversion-gLJCNqSQ.esm.js} +2 -2
- package/dist/chunks/{form-builder-conversion-yi03Elpa.esm.js.map → form-builder-conversion-gLJCNqSQ.esm.js.map} +1 -1
- package/dist/chunks/{form-builder-deconversion-CFtHF1hm.esm.js → form-builder-deconversion-DNGMsAEj.esm.js} +3 -3
- package/dist/chunks/{form-builder-deconversion-CFtHF1hm.esm.js.map → form-builder-deconversion-DNGMsAEj.esm.js.map} +1 -1
- package/dist/chunks/{fullScreen-Xv8AR914.esm.js → fullScreen-C8Qnoyrr.esm.js} +2 -2
- package/dist/chunks/{fullScreen-Xv8AR914.esm.js.map → fullScreen-C8Qnoyrr.esm.js.map} +1 -1
- package/dist/chunks/{languageContext-cweJTzn0.esm.js → languageContext-ffrxXJkr.esm.js} +3 -3
- package/dist/chunks/{languageContext-cweJTzn0.esm.js.map → languageContext-ffrxXJkr.esm.js.map} +1 -1
- package/dist/chunks/{migration-utils-llqrdBh8.esm.js → migration-utils-BJsX1G2n.esm.js} +2 -2
- package/dist/chunks/{migration-utils-llqrdBh8.esm.js.map → migration-utils-BJsX1G2n.esm.js.map} +1 -1
- package/dist/chunks/{page-context-BbQNncGA.esm.js → page-context-BlGcwtdZ.esm.js} +3 -3
- package/dist/chunks/{page-context-BbQNncGA.esm.js.map → page-context-BlGcwtdZ.esm.js.map} +1 -1
- package/dist/chunks/{reducer-DRkUwBHb.esm.js → reducer-D6_f0R4C.esm.js} +2 -2
- package/dist/chunks/{reducer-DRkUwBHb.esm.js.map → reducer-D6_f0R4C.esm.js.map} +1 -1
- package/dist/chunks/{shareSlice-H0nwzQZv.esm.js → shareSlice-Bxrgfv7o.esm.js} +2 -2
- package/dist/chunks/{shareSlice-H0nwzQZv.esm.js.map → shareSlice-Bxrgfv7o.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-CdhW0PKj.esm.js → sidebar-n5_ky6G7.esm.js} +4 -4
- package/dist/chunks/{sidebar-CdhW0PKj.esm.js.map → sidebar-n5_ky6G7.esm.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-DbfP32Xx.esm.js → sidebarScreen-BwkiIBud.esm.js} +5 -6
- package/dist/chunks/sidebarScreen-BwkiIBud.esm.js.map +1 -0
- package/dist/chunks/{sidebarScreen-figZp_Ln.js → sidebarScreen-Cm763s1P.js} +1 -2
- package/dist/chunks/sidebarScreen-Cm763s1P.js.map +1 -0
- package/dist/chunks/{store-C2XaFCA_.esm.js → store-OqHSsVaz.esm.js} +3 -3
- package/dist/chunks/{store-C2XaFCA_.esm.js.map → store-OqHSsVaz.esm.js.map} +1 -1
- package/dist/chunks/{translations-DJZgOpfH.esm.js → translations-GFvlFdi5.esm.js} +2 -2
- package/dist/chunks/{translations-DJZgOpfH.esm.js.map → translations-GFvlFdi5.esm.js.map} +1 -1
- package/dist/chunks/{uom-field-wrapper-DKN31prP.esm.js → uom-field-wrapper-CgYTONsG.esm.js} +33 -158
- package/dist/chunks/uom-field-wrapper-CgYTONsG.esm.js.map +1 -0
- package/dist/chunks/{uom-field-wrapper-NNhtGgqI.js → uom-field-wrapper-DoyshtE9.js} +2 -127
- package/dist/chunks/uom-field-wrapper-DoyshtE9.js.map +1 -0
- package/dist/chunks/{useAccountSetting-CAUDy8rg.esm.js → useAccountSetting-D1Ze8r-T.esm.js} +3 -3
- package/dist/chunks/{useAccountSetting-CAUDy8rg.esm.js.map → useAccountSetting-D1Ze8r-T.esm.js.map} +1 -1
- package/dist/chunks/{useAdditionalDiscountAutoCalc-DbyTG80U.esm.js → useAdditionalDiscountAutoCalc-PhSfzd5X.esm.js} +5 -5
- package/dist/chunks/{useAdditionalDiscountAutoCalc-DbyTG80U.esm.js.map → useAdditionalDiscountAutoCalc-PhSfzd5X.esm.js.map} +1 -1
- package/dist/chunks/{useAuth-BaUSGWbL.esm.js → useAuth-DhzbULWV.esm.js} +2 -2
- package/dist/chunks/{useAuth-BaUSGWbL.esm.js.map → useAuth-DhzbULWV.esm.js.map} +1 -1
- package/dist/chunks/{useLangauge-BUF4epYu.esm.js → useLangauge-CbMaEsdS.esm.js} +2 -2
- package/dist/chunks/{useLangauge-BUF4epYu.esm.js.map → useLangauge-CbMaEsdS.esm.js.map} +1 -1
- package/dist/components/index.esm.js +53 -53
- package/dist/components/index.js +4 -4
- package/dist/contexts/index.esm.js +3 -3
- package/dist/hooks/index.esm.js +5 -5
- package/dist/index.esm.js +90 -90
- package/dist/index.js +6 -6
- package/dist/layout/index.esm.js +2 -2
- package/dist/layout/index.js +1 -1
- package/dist/redux/index.esm.js +4 -4
- package/dist/utils/index.esm.js +7 -7
- package/dist/views/index.esm.js +9 -9
- package/dist/views/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/android-12-switch-DM9s0XTb.js.map +0 -1
- package/dist/chunks/android-12-switch-eTZOAHAa.esm.js.map +0 -1
- package/dist/chunks/sidebarScreen-DbfP32Xx.esm.js.map +0 -1
- package/dist/chunks/sidebarScreen-figZp_Ln.js.map +0 -1
- package/dist/chunks/uom-field-wrapper-DKN31prP.esm.js.map +0 -1
- package/dist/chunks/uom-field-wrapper-NNhtGgqI.js.map +0 -1
|
@@ -3,7 +3,7 @@ const jsxRuntime = require("./jsx-runtime-B6vEU3CM.js");
|
|
|
3
3
|
const reactHookForm = require("react-hook-form");
|
|
4
4
|
const identifier = require("./identifier-B8P9ZGxG.js");
|
|
5
5
|
const useAuth = require("./useAuth-L64u9PZT.js");
|
|
6
|
-
const android12Switch = require("./android-12-switch-
|
|
6
|
+
const android12Switch = require("./android-12-switch-BILQvv4G.js");
|
|
7
7
|
const appbar = require("./appbar-DB5SgIHS.js");
|
|
8
8
|
const React = require("react");
|
|
9
9
|
const DatePicker = require("react-datepicker");
|
|
@@ -9560,129 +9560,6 @@ MultiSelect.propTypes = {
|
|
|
9560
9560
|
selectedLabel: identifier.PropTypes.string,
|
|
9561
9561
|
onChange: identifier.PropTypes.func
|
|
9562
9562
|
};
|
|
9563
|
-
const ProtectedRoute = ({
|
|
9564
|
-
module: module2,
|
|
9565
|
-
action,
|
|
9566
|
-
multiModule,
|
|
9567
|
-
complexPermissions,
|
|
9568
|
-
customPermissionCheck,
|
|
9569
|
-
redirectTo = "/403",
|
|
9570
|
-
showError = true,
|
|
9571
|
-
children
|
|
9572
|
-
}) => {
|
|
9573
|
-
const permissions = useAccountSetting.usePermissions();
|
|
9574
|
-
const hasPermission = React.useMemo(() => {
|
|
9575
|
-
if (!permissions) {
|
|
9576
|
-
return false;
|
|
9577
|
-
}
|
|
9578
|
-
if (customPermissionCheck) {
|
|
9579
|
-
return customPermissionCheck(permissions);
|
|
9580
|
-
}
|
|
9581
|
-
if (complexPermissions) {
|
|
9582
|
-
const { permissions: permList, operator = "AND" } = complexPermissions;
|
|
9583
|
-
const results = permList.map(({ module: mod, action: act }) => {
|
|
9584
|
-
const modulePerms = _$1.get(permissions, mod, {});
|
|
9585
|
-
return modulePerms[act] ?? false;
|
|
9586
|
-
});
|
|
9587
|
-
return operator === "AND" ? results.every(Boolean) : results.some(Boolean);
|
|
9588
|
-
}
|
|
9589
|
-
if (multiModule) {
|
|
9590
|
-
const { modules: modules2, action: act, operator = "OR" } = multiModule;
|
|
9591
|
-
const results = modules2.map((mod) => {
|
|
9592
|
-
const modulePerms = _$1.get(permissions, mod, {});
|
|
9593
|
-
return modulePerms[act] ?? false;
|
|
9594
|
-
});
|
|
9595
|
-
return operator === "AND" ? results.every(Boolean) : results.some(Boolean);
|
|
9596
|
-
}
|
|
9597
|
-
if (module2 && action) {
|
|
9598
|
-
const modulePerms = _$1.get(permissions, module2, {});
|
|
9599
|
-
return modulePerms[action] ?? false;
|
|
9600
|
-
}
|
|
9601
|
-
return false;
|
|
9602
|
-
}, [permissions, module2, action, multiModule, complexPermissions, customPermissionCheck]);
|
|
9603
|
-
const ErrorComponent = () => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
9604
|
-
material.Box,
|
|
9605
|
-
{
|
|
9606
|
-
sx: {
|
|
9607
|
-
display: "flex",
|
|
9608
|
-
flexDirection: "column",
|
|
9609
|
-
justifyContent: "center",
|
|
9610
|
-
alignItems: "center",
|
|
9611
|
-
position: "absolute",
|
|
9612
|
-
top: "50%",
|
|
9613
|
-
left: "50%",
|
|
9614
|
-
transform: "translate(-50%, -50%)",
|
|
9615
|
-
// Fixed transform values
|
|
9616
|
-
gap: 2,
|
|
9617
|
-
textAlign: "center",
|
|
9618
|
-
p: 3
|
|
9619
|
-
},
|
|
9620
|
-
children: [
|
|
9621
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
9622
|
-
useAuth.Typography,
|
|
9623
|
-
{
|
|
9624
|
-
type: "h1",
|
|
9625
|
-
color: "theme.secondary.900",
|
|
9626
|
-
weight: "bold",
|
|
9627
|
-
sx: { fontSize: { xs: "4rem", sm: "6rem" } },
|
|
9628
|
-
children: "403"
|
|
9629
|
-
}
|
|
9630
|
-
),
|
|
9631
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
9632
|
-
material.Divider,
|
|
9633
|
-
{
|
|
9634
|
-
flexItem: true
|
|
9635
|
-
}
|
|
9636
|
-
),
|
|
9637
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
9638
|
-
useAuth.Typography,
|
|
9639
|
-
{
|
|
9640
|
-
type: "s3",
|
|
9641
|
-
color: "theme.secondary.900",
|
|
9642
|
-
weight: "medium",
|
|
9643
|
-
children: "Access Denied"
|
|
9644
|
-
}
|
|
9645
|
-
),
|
|
9646
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
9647
|
-
useAuth.Typography,
|
|
9648
|
-
{
|
|
9649
|
-
type: "body2",
|
|
9650
|
-
color: "theme.secondary.700",
|
|
9651
|
-
weight: "regular",
|
|
9652
|
-
sx: { mt: 1, maxWidth: "300px" },
|
|
9653
|
-
children: "You don't have the required permissions to access this resource."
|
|
9654
|
-
}
|
|
9655
|
-
)
|
|
9656
|
-
]
|
|
9657
|
-
}
|
|
9658
|
-
);
|
|
9659
|
-
if (!permissions || Object.keys(permissions).length === 0) {
|
|
9660
|
-
return null;
|
|
9661
|
-
}
|
|
9662
|
-
if (hasPermission) {
|
|
9663
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, { children });
|
|
9664
|
-
}
|
|
9665
|
-
return showError ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(ErrorComponent, {}) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(reactRouterDom.Navigate, { to: redirectTo, replace: true });
|
|
9666
|
-
};
|
|
9667
|
-
const createPermissionConfig = {
|
|
9668
|
-
// Single module
|
|
9669
|
-
single: (module2, action) => ({
|
|
9670
|
-
module: module2,
|
|
9671
|
-
action
|
|
9672
|
-
}),
|
|
9673
|
-
// Multiple modules with same action
|
|
9674
|
-
multiModule: (modules2, action, operator = "OR") => ({
|
|
9675
|
-
multiModule: { modules: modules2, action, operator }
|
|
9676
|
-
}),
|
|
9677
|
-
// Complex permissions
|
|
9678
|
-
complex: (permissions, operator = "AND") => ({
|
|
9679
|
-
complexPermissions: { permissions, operator }
|
|
9680
|
-
}),
|
|
9681
|
-
// Custom function
|
|
9682
|
-
custom: (checkFn) => ({
|
|
9683
|
-
customPermissionCheck: checkFn
|
|
9684
|
-
})
|
|
9685
|
-
};
|
|
9686
9563
|
const ReportButtons = ({ buttons, dropdownMenuButtonData = null, toggleCallback, className, zIndex = 999 }) => {
|
|
9687
9564
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className, children: [
|
|
9688
9565
|
buttons == null ? void 0 : buttons.map((ele) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
@@ -16336,7 +16213,6 @@ exports.MultiLine = MultiLine;
|
|
|
16336
16213
|
exports.MultiLineChart = MultiLineChart;
|
|
16337
16214
|
exports.MultiSelect = MultiSelect;
|
|
16338
16215
|
exports.PageLoader = PageLoader;
|
|
16339
|
-
exports.ProtectedRoute = ProtectedRoute;
|
|
16340
16216
|
exports.QuickApprovalModal = QuickApprovalModal;
|
|
16341
16217
|
exports.ReportButtons = ReportButtons;
|
|
16342
16218
|
exports.ReportTable = ReportTable;
|
|
@@ -16351,9 +16227,8 @@ exports.UomFieldWrapper = UomFieldWrapper;
|
|
|
16351
16227
|
exports.Upload = Upload;
|
|
16352
16228
|
exports.UserDropdown = UserDropdown;
|
|
16353
16229
|
exports.calculateOptimalSizes = calculateOptimalSizes;
|
|
16354
|
-
exports.createPermissionConfig = createPermissionConfig;
|
|
16355
16230
|
exports.dynamicFields = dynamicFields;
|
|
16356
16231
|
exports.fields = fields;
|
|
16357
16232
|
exports.useDynamicLayout = useDynamicLayout;
|
|
16358
16233
|
exports.validator = validator;
|
|
16359
|
-
//# sourceMappingURL=uom-field-wrapper-
|
|
16234
|
+
//# sourceMappingURL=uom-field-wrapper-DoyshtE9.js.map
|