@yosgo/swap-ui 1.0.139 → 1.0.141

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/build/index.js CHANGED
@@ -664,7 +664,7 @@ var ModalOpenEffect = function (props) {
664
664
  React__default.createElement("div", null, props.children)))));
665
665
  };
666
666
  var SWAPModal = function (_a) {
667
- var open = _a.open, title = _a.title, onClose = _a.onClose, helpText = _a.helpText, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, children = _a.children, steps = _a.steps, successMessage = _a.successMessage, errorMessage = _a.errorMessage, closeWindowOnSuccessMessage = _a.closeWindowOnSuccessMessage, reloadOnWindowClose = _a.reloadOnWindowClose;
667
+ var open = _a.open, title = _a.title, onClose = _a.onClose, helpText = _a.helpText, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, children = _a.children, steps = _a.steps, successMessage = _a.successMessage, errorMessage = _a.errorMessage, closeWindowOnSuccessMessage = _a.closeWindowOnSuccessMessage, reloadOnWindowClose = _a.reloadOnWindowClose, fullScreen = _a.fullScreen;
668
668
  var _b = React.useState(false), sm = _b[0], setSm = _b[1];
669
669
  var _c = React.useState(0), stepIndex = _c[0], setStepIndex = _c[1];
670
670
  var handleModalSize = function () {
@@ -725,7 +725,7 @@ var SWAPModal = function (_a) {
725
725
  React__default.createElement(core.Fade, { in: open, timeout: { enter: 300, exit: 300 } },
726
726
  React__default.createElement(SWAPModalWrap, { id: "modal_wrap_" + title },
727
727
  React__default.createElement(ModalOpenEffect, { in: open, sm: sm },
728
- React__default.createElement(core.Paper, { className: "modal_inner", id: "modal_inner_" + title },
728
+ React__default.createElement(core.Paper, { className: "modal_inner " + (fullScreen ? 'full_screen' : ''), id: "modal_inner_" + title },
729
729
  React__default.createElement("div", { className: "modal_inner_header", id: "modal_header_" + title },
730
730
  React__default.createElement(core.Container, { maxWidth: "lg" },
731
731
  React__default.createElement(SWAPSpace, { size: "m" }),
@@ -781,7 +781,7 @@ var SWAPModal = function (_a) {
781
781
  React__default.createElement(core.Button, { variant: "text", size: sm ? "medium" : "large", onClick: function () { return handleStepButton("next"); } }, steps[stepIndex].nextStepText || "下一步"))))),
782
782
  React__default.createElement(SWAPSpace, { size: "m" })))))))));
783
783
  };
784
- var SWAPModalWrap = styled.div(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n outline: 0px;\n position: absolute;\n height: 100vh;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n .modal_inner {\n border-radius: 9px;\n overflow: hidden;\n position: relative;\n width: 48vw;\n z-index: 2;\n .modal_inner_header {\n position: absolute;\n width: 100%;\n left: 0;\n top: 0;\n background: white;\n z-index: 1;\n }\n .modal_inner_body {\n position: relative;\n overflow-y: auto;\n z-index: 1;\n }\n .modal_inner_bottom {\n position: absolute;\n width: 100%;\n left: 0;\n bottom: 0;\n background: white;\n z-index: 1;\n }\n }\n @media screen and (max-width: 960px) {\n align-items: flex-end;\n .modal_inner {\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n width: 100vw;\n }\n }\n"], ["\n outline: 0px;\n position: absolute;\n height: 100vh;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n .modal_inner {\n border-radius: 9px;\n overflow: hidden;\n position: relative;\n width: 48vw;\n z-index: 2;\n .modal_inner_header {\n position: absolute;\n width: 100%;\n left: 0;\n top: 0;\n background: white;\n z-index: 1;\n }\n .modal_inner_body {\n position: relative;\n overflow-y: auto;\n z-index: 1;\n }\n .modal_inner_bottom {\n position: absolute;\n width: 100%;\n left: 0;\n bottom: 0;\n background: white;\n z-index: 1;\n }\n }\n @media screen and (max-width: 960px) {\n align-items: flex-end;\n .modal_inner {\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n width: 100vw;\n }\n }\n"])));
784
+ var SWAPModalWrap = styled.div(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n outline: 0px;\n position: absolute;\n height: 100vh;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n .modal_inner {\n border-radius: 9px;\n overflow: hidden;\n position: relative;\n width: 48vw;\n z-index: 2;\n .modal_inner_header {\n position: absolute;\n width: 100%;\n left: 0;\n top: 0;\n background: white;\n z-index: 1;\n }\n .modal_inner_body {\n position: relative;\n overflow-y: auto;\n z-index: 1;\n }\n .modal_inner_bottom {\n position: absolute;\n width: 100%;\n left: 0;\n bottom: 0;\n background: white;\n z-index: 1;\n }\n }\n .full_screen {\n width: 100vw;\n height: 100vh;\n }\n @media screen and (max-width: 960px) {\n align-items: flex-end;\n .modal_inner {\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n width: 100vw;\n }\n }\n"], ["\n outline: 0px;\n position: absolute;\n height: 100vh;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n .modal_inner {\n border-radius: 9px;\n overflow: hidden;\n position: relative;\n width: 48vw;\n z-index: 2;\n .modal_inner_header {\n position: absolute;\n width: 100%;\n left: 0;\n top: 0;\n background: white;\n z-index: 1;\n }\n .modal_inner_body {\n position: relative;\n overflow-y: auto;\n z-index: 1;\n }\n .modal_inner_bottom {\n position: absolute;\n width: 100%;\n left: 0;\n bottom: 0;\n background: white;\n z-index: 1;\n }\n }\n .full_screen {\n width: 100vw;\n height: 100vh;\n }\n @media screen and (max-width: 960px) {\n align-items: flex-end;\n .modal_inner {\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n width: 100vw;\n }\n }\n"])));
785
785
  var templateObject_1$5;
786
786
 
787
787
  function objectToGetParams(object) {
@@ -7376,8 +7376,8 @@ var useStyles$f = core.makeStyles(function (theme) { return ({
7376
7376
  border: "unset",
7377
7377
  borderRadius: 12,
7378
7378
  margin: function (_a) {
7379
- var fullWidth = _a.fullWidth, match_XS = _a.match_XS;
7380
- return fullWidth ? 0 : match_XS ? "0px 24px" : "0px 16px";
7379
+ var fullWidth = _a.fullWidth, fullScreen = _a.fullScreen, match_XS = _a.match_XS;
7380
+ return (fullWidth || fullScreen) ? 0 : match_XS ? "0px 24px" : "0px 16px";
7381
7381
  },
7382
7382
  },
7383
7383
  backdrop: {
@@ -7385,36 +7385,44 @@ var useStyles$f = core.makeStyles(function (theme) { return ({
7385
7385
  },
7386
7386
  modal: {
7387
7387
  width: function (_a) {
7388
- var width = _a.width, size = _a.size;
7389
- return width
7390
- ? width
7391
- : size === "large"
7392
- ? 800
7393
- : size === "medium"
7394
- ? 640
7395
- : size === "small"
7396
- ? 480
7397
- : size === "extraSmall"
7398
- ? 320
7399
- : "100%";
7388
+ var fullScreen = _a.fullScreen, width = _a.width, size = _a.size;
7389
+ return fullScreen
7390
+ ? "100vw"
7391
+ : width
7392
+ ? width
7393
+ : size === "large"
7394
+ ? 800
7395
+ : size === "medium"
7396
+ ? 640
7397
+ : size === "small"
7398
+ ? 480
7399
+ : size === "extraSmall"
7400
+ ? 320
7401
+ : "100%";
7400
7402
  },
7401
7403
  maxWidth: function (_a) {
7402
7404
  var maxWidth = _a.maxWidth;
7403
7405
  return maxWidth;
7404
7406
  },
7405
7407
  borderRadius: function (_a) {
7406
- var fullWidth = _a.fullWidth;
7407
- return fullWidth ? "12px 12px 0px 0px" : 12;
7408
+ var fullWidth = _a.fullWidth, fullScreen = _a.fullScreen;
7409
+ return fullScreen ? 0 : fullWidth ? "12px 12px 0px 0px" : 12;
7408
7410
  },
7409
7411
  border: "unset",
7410
- boxShadow: theme.boxShadow.l,
7412
+ boxShadow: function (_a) {
7413
+ var fullScreen = _a.fullScreen;
7414
+ return fullScreen ? "unset" : theme.boxShadow.l;
7415
+ },
7411
7416
  display: "flex",
7412
7417
  flexDirection: "column",
7413
7418
  outline: 0,
7414
7419
  },
7415
7420
  head: {
7416
7421
  height: "100%",
7417
- borderRadius: "12px 12px 0px 0px",
7422
+ borderRadius: function (_a) {
7423
+ var fullScreen = _a.fullScreen;
7424
+ return fullScreen ? 0 : "12px 12px 0px 0px";
7425
+ },
7418
7426
  padding: function (_a) {
7419
7427
  var headpadding = _a.headpadding, mobile = _a.mobile, disCloseIcon = _a.disCloseIcon, helpText = _a.helpText, multiline = _a.multiline;
7420
7428
  return headpadding
@@ -7694,8 +7702,8 @@ var useStyles$f = core.makeStyles(function (theme) { return ({
7694
7702
  body: {
7695
7703
  transition: "all 0.2s ease-in-out",
7696
7704
  height: function (_a) {
7697
- var height = _a.height;
7698
- return (height ? height : "100%");
7705
+ var fullScreen = _a.fullScreen, height = _a.height;
7706
+ return fullScreen ? "calc(100vh - 146px)" : height ? height : "100%";
7699
7707
  },
7700
7708
  padding: function (_a) {
7701
7709
  var bodyPadding = _a.bodyPadding, mobile = _a.mobile;
@@ -7707,8 +7715,14 @@ var useStyles$f = core.makeStyles(function (theme) { return ({
7707
7715
  return (onExit ? "none" : "unset");
7708
7716
  },
7709
7717
  maxHeight: function (_a) {
7710
- var bodyMaxHeight = _a.bodyMaxHeight, fullWidth = _a.fullWidth, clientHeight = _a.clientHeight;
7711
- return bodyMaxHeight ? bodyMaxHeight : fullWidth ? clientHeight : "unset";
7718
+ var bodyMaxHeight = _a.bodyMaxHeight, fullWidth = _a.fullWidth, fullScreen = _a.fullScreen, clientHeight = _a.clientHeight;
7719
+ return fullScreen
7720
+ ? "calc(100vh - 146px)"
7721
+ : bodyMaxHeight
7722
+ ? bodyMaxHeight
7723
+ : fullWidth
7724
+ ? clientHeight
7725
+ : "unset";
7712
7726
  },
7713
7727
  overflowY: function (_a) {
7714
7728
  var onExit = _a.onExit;
@@ -7762,7 +7776,7 @@ var useStyles$f = core.makeStyles(function (theme) { return ({
7762
7776
  },
7763
7777
  }); });
7764
7778
  var Modal = React__default.forwardRef(function (props, ref) {
7765
- var width = props.width, height = props.height, open = props.open, onClose = props.onClose, title = props.title, helpText = props.helpText, size = props.size, headpadding = props.headpadding, headChildren = props.headChildren, checked = props.checked, failed = props.failed, icon = props.icon, checkIconColor = props.checkIconColor, iconColor = props.iconColor, children = props.children, label = props.label, buttonFullWidth = props.buttonFullWidth, footerDisplayColumn = props.footerDisplayColumn, secondaryButton = props.secondaryButton, primaryButton = props.primaryButton, mobile = props.mobile, fullWidth = props.fullWidth, bodyPadding = props.bodyPadding, maxWidth = props.maxWidth, disCloseIcon = props.disCloseIcon, titleStyle = props.titleStyle, bodyStyle = props.bodyStyle, onExit = props.onExit, bodyMaxHeight = props.bodyMaxHeight, multiline = props.multiline, disUnderLine = props.disUnderLine, footer = props.footer;
7779
+ var width = props.width, height = props.height, open = props.open, onClose = props.onClose, title = props.title, helpText = props.helpText, size = props.size, headpadding = props.headpadding, headChildren = props.headChildren, checked = props.checked, failed = props.failed, icon = props.icon, checkIconColor = props.checkIconColor, iconColor = props.iconColor, children = props.children, label = props.label, buttonFullWidth = props.buttonFullWidth, footerDisplayColumn = props.footerDisplayColumn, secondaryButton = props.secondaryButton, primaryButton = props.primaryButton, mobile = props.mobile, fullWidth = props.fullWidth, fullScreen = props.fullScreen, bodyPadding = props.bodyPadding, maxWidth = props.maxWidth, disCloseIcon = props.disCloseIcon, titleStyle = props.titleStyle, bodyStyle = props.bodyStyle, onExit = props.onExit, bodyMaxHeight = props.bodyMaxHeight, multiline = props.multiline, disUnderLine = props.disUnderLine, footer = props.footer;
7766
7780
  var _a = React.useState(0), clientHeight = _a[0], setClientHeight = _a[1];
7767
7781
  var _b = React.useState(0), scorllbarWidth = _b[0], setScorllbarWidth = _b[1];
7768
7782
  React.useEffect(function () {
@@ -7788,6 +7802,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
7788
7802
  var match_XS = useBreakpoints("xs");
7789
7803
  var classes = useStyles$f({
7790
7804
  fullWidth: fullWidth,
7805
+ fullScreen: fullScreen,
7791
7806
  match_XS: match_XS,
7792
7807
  width: width,
7793
7808
  size: size,
@@ -7814,7 +7829,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
7814
7829
  className: classes.backdrop,
7815
7830
  style: { overflow: "auto", WebkitOverflowScrolling: "touch" },
7816
7831
  } },
7817
- React__default.createElement(ModalTransitionEffect, { in: open, slide: fullWidth, style: {
7832
+ React__default.createElement(ModalTransitionEffect, { in: open, slide: fullWidth || fullScreen, style: {
7818
7833
  outline: "none",
7819
7834
  transition: "ease-in-out",
7820
7835
  width: "100%",
@@ -7866,7 +7881,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
7866
7881
  : mobile
7867
7882
  ? -16
7868
7883
  : -24,
7869
- position: bodyMaxHeight || height || (mobile && fullWidth)
7884
+ position: bodyMaxHeight || height || (mobile && fullWidth) || fullScreen
7870
7885
  ? "fixed"
7871
7886
  : "absolute",
7872
7887
  width: width
@@ -7880,13 +7895,15 @@ var Modal = React__default.forwardRef(function (props, ref) {
7880
7895
  : size === "extraSmall"
7881
7896
  ? 320
7882
7897
  : "100%",
7883
- height: bodyMaxHeight
7884
- ? bodyMaxHeight
7885
- : height
7886
- ? height
7887
- : mobile && fullWidth
7888
- ? clientHeight
7889
- : "100%",
7898
+ height: fullScreen
7899
+ ? "100vh"
7900
+ : bodyMaxHeight
7901
+ ? bodyMaxHeight
7902
+ : height
7903
+ ? height
7904
+ : mobile && fullWidth
7905
+ ? clientHeight
7906
+ : "100%",
7890
7907
  background: "black",
7891
7908
  opacity: 0.5,
7892
7909
  zIndex: 10,