@salesgenterp/ui-components 0.4.546 → 0.4.547

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/index.js CHANGED
@@ -2834,7 +2834,7 @@ var InfoContainer = styled__default.div(_templateObject$9 || (_templateObject$9
2834
2834
  return props.fontColor;
2835
2835
  });
2836
2836
 
2837
- var _templateObject$a, _templateObject2$5, _templateObject3$3, _templateObject4$2, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
2837
+ var _templateObject$a, _templateObject2$5, _templateObject3$3, _templateObject4$2, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
2838
2838
  var totalIcons = [{
2839
2839
  name: '',
2840
2840
  icon: /*#__PURE__*/React__default.createElement(ai.AiOutlineShoppingCart, null)
@@ -2920,12 +2920,31 @@ var Dashboard = function Dashboard(_ref) {
2920
2920
  try {
2921
2921
  var _iframe$contentWindow, _doc$body, _doc$documentElement;
2922
2922
  var doc = iframe.contentDocument || ((_iframe$contentWindow = iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow.document);
2923
- var contentHeight = Math.max((doc === null || doc === void 0 ? void 0 : (_doc$body = doc.body) === null || _doc$body === void 0 ? void 0 : _doc$body.scrollHeight) || 0, (doc === null || doc === void 0 ? void 0 : (_doc$documentElement = doc.documentElement) === null || _doc$documentElement === void 0 ? void 0 : _doc$documentElement.scrollHeight) || 0);
2923
+ var contentHeight = Math.max((doc === null || doc === void 0 ? void 0 : (_doc$body = doc.body) === null || _doc$body === void 0 ? void 0 : _doc$body.offsetHeight) || 0, (doc === null || doc === void 0 ? void 0 : (_doc$documentElement = doc.documentElement) === null || _doc$documentElement === void 0 ? void 0 : _doc$documentElement.offsetHeight) || 0);
2924
2924
  if (contentHeight) {
2925
2925
  iframe.style.height = contentHeight + "px";
2926
2926
  }
2927
2927
  } catch (_unused) {}
2928
2928
  };
2929
+ React.useEffect(function () {
2930
+ if (!isTablet || !invoiceModal.open) return;
2931
+ var scrollY = window.scrollY;
2932
+ document.body.style.position = 'fixed';
2933
+ document.body.style.top = "-" + scrollY + "px";
2934
+ document.body.style.left = '0';
2935
+ document.body.style.right = '0';
2936
+ document.body.style.width = '100%';
2937
+ document.body.style.overflow = 'hidden';
2938
+ return function () {
2939
+ document.body.style.position = '';
2940
+ document.body.style.top = '';
2941
+ document.body.style.left = '';
2942
+ document.body.style.right = '';
2943
+ document.body.style.width = '';
2944
+ document.body.style.overflow = '';
2945
+ window.scrollTo(0, scrollY);
2946
+ };
2947
+ }, [isTablet, invoiceModal.open]);
2929
2948
  React.useEffect(function () {
2930
2949
  if (hideSalesOrderTab) {
2931
2950
  setValue(1);
@@ -3342,12 +3361,15 @@ var Dashboard = function Dashboard(_ref) {
3342
3361
  maxWidth: "lg",
3343
3362
  fullScreen: isTablet,
3344
3363
  $tablet: isTablet
3345
- }, /*#__PURE__*/React__default.createElement(material.DialogContent, {
3346
- dividers: true
3347
- }, /*#__PURE__*/React__default.createElement("iframe", {
3364
+ }, isTablet ? /*#__PURE__*/React__default.createElement(InvoiceScrollArea, null, /*#__PURE__*/React__default.createElement("iframe", {
3348
3365
  src: invoiceModal.url,
3349
3366
  title: "Invoice preview",
3350
3367
  onLoad: handleInvoiceIframeLoad
3368
+ })) : /*#__PURE__*/React__default.createElement(material.DialogContent, {
3369
+ dividers: true
3370
+ }, /*#__PURE__*/React__default.createElement("iframe", {
3371
+ src: invoiceModal.url,
3372
+ title: "Invoice preview"
3351
3373
  }))), /*#__PURE__*/React__default.createElement(APITable, {
3352
3374
  key: value,
3353
3375
  cacheFilters: true,
@@ -3616,9 +3638,10 @@ var StatusContainer = styled__default(material.Stack)(_templateObject16 || (_tem
3616
3638
  var TableContainer = styled__default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteralLoose(["\n margin-top: 2rem;\n border-radius: 14px;\n"])));
3617
3639
  var InvoiceDialog = styled__default(material.Dialog)(_templateObject18 || (_templateObject18 = _taggedTemplateLiteralLoose(["\n iframe {\n width: 900px;\n border: none;\n height: 600px;\n display: block;\n }\n\n ", "\n"])), function (_ref3) {
3618
3640
  var $tablet = _ref3.$tablet;
3619
- return $tablet && "\n .MuiDialog-paper {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .MuiDialogContent-root {\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n padding: 0;\n flex: 1;\n min-height: 0;\n }\n\n iframe {\n width: 100%;\n min-height: 600px;\n height: auto;\n pointer-events: none;\n }\n ";
3641
+ return $tablet && "\n .MuiDialog-container {\n overscroll-behavior: none;\n }\n\n .MuiDialog-paper {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n max-height: 100%;\n margin: 0;\n }\n ";
3620
3642
  });
3621
- var TabsContainer = styled__default(material.Tabs)(_templateObject19 || (_templateObject19 = _taggedTemplateLiteralLoose(["\n button {\n color: ", " !important;\n font-size: 1.1rem;\n font-weight: 600;\n }\n .Mui-selected {\n color: ", " !important;\n }\n .MuiTabs-indicator {\n background-color: ", " !important;\n }\n"])), function (props) {
3643
+ var InvoiceScrollArea = styled__default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteralLoose(["\n overflow-y: auto;\n overflow-x: hidden;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n touch-action: pan-y;\n flex: 1;\n min-height: 0;\n width: 100%;\n height: 100%;\n\n iframe {\n width: 100%;\n border: none;\n display: block;\n pointer-events: none;\n }\n"])));
3644
+ var TabsContainer = styled__default(material.Tabs)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteralLoose(["\n button {\n color: ", " !important;\n font-size: 1.1rem;\n font-weight: 600;\n }\n .Mui-selected {\n color: ", " !important;\n }\n .MuiTabs-indicator {\n background-color: ", " !important;\n }\n"])), function (props) {
3622
3645
  return props.fontColor;
3623
3646
  }, function (props) {
3624
3647
  return props.primaryColor;
@@ -4932,7 +4955,7 @@ var getDropzoneRejectionError = function getDropzoneRejectionError(fileRejection
4932
4955
  return (error === null || error === void 0 ? void 0 : error.message) || 'Invalid file';
4933
4956
  };
4934
4957
 
4935
- var _templateObject$k, _templateObject2$c, _templateObject3$8, _templateObject4$6, _templateObject5$4, _templateObject6$3, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject10$2, _templateObject11$2, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34;
4958
+ var _templateObject$k, _templateObject2$c, _templateObject3$8, _templateObject4$6, _templateObject5$4, _templateObject6$3, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject10$2, _templateObject11$2, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20$1, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34;
4936
4959
  var DEFAULT_PRIMARY_COLOR = "#437c0f";
4937
4960
  var Container = styled__default.div(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n width: 100%;\n min-height: 80vh;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #f6f6f6;\n padding: 2rem 1rem;\n"])));
4938
4961
  var Card = styled__default.div(_templateObject2$c || (_templateObject2$c = _taggedTemplateLiteralLoose(["\n width: min(100%, 720px);\n background: #fff;\n border: 1px solid #cac8c8;\n border-radius: 8px;\n padding: 1.5rem;\n"])));
@@ -4972,7 +4995,7 @@ var DropzoneBtn = styled__default.span(_templateObject16$1 || (_templateObject16
4972
4995
  var DropzoneText = styled__default.span(_templateObject17$1 || (_templateObject17$1 = _taggedTemplateLiteralLoose(["\n font-size: 0.875rem;\n color: #666;\n"])));
4973
4996
  var DropzoneError = styled__default.p(_templateObject18$1 || (_templateObject18$1 = _taggedTemplateLiteralLoose(["\n margin: 0.5rem 0 0;\n font-size: 0.8rem;\n color: #c62828;\n"])));
4974
4997
  var SelectedFileRow = styled__default.div(_templateObject19$1 || (_templateObject19$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.6rem 0.75rem;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n background: #fafafa;\n"])));
4975
- var SelectedFileInfo = styled__default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-width: 0;\n flex: 1;\n"])));
4998
+ var SelectedFileInfo = styled__default.div(_templateObject20$1 || (_templateObject20$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-width: 0;\n flex: 1;\n"])));
4976
4999
  var SelectedFileName = styled__default.span(_templateObject21 || (_templateObject21 = _taggedTemplateLiteralLoose(["\n font-size: 0.875rem;\n color: #333;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
4977
5000
  var ClearFileBtn = styled__default.button(_templateObject22 || (_templateObject22 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n background: none;\n color: #c62828;\n font-size: 1.1rem;\n cursor: pointer;\n flex-shrink: 0;\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"])));
4978
5001
  var UploadedFiles = styled__default.ul(_templateObject23 || (_templateObject23 = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n li {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n font-size: 0.875rem;\n color: #555;\n padding: 0.65rem 0.75rem;\n background: #fff;\n border: 1px solid #eee;\n border-radius: 4px;\n }\n"])));