@yosgo/swap-ui 1.0.119 → 1.0.123
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/Breadcrumb/Breadcrumb.d.ts +4 -0
- package/build/Breadcrumb/Breadcrumb.types.d.ts +7 -0
- package/build/BreadcrumbItem/BreadcrumbItem.d.ts +4 -0
- package/build/BreadcrumbItem/BreadcrumbItem.types.d.ts +4 -0
- package/build/Card/Card.d.ts +4 -0
- package/build/Card/Card.types.d.ts +17 -0
- package/build/DatePicker/DatePicker.d.ts +4 -0
- package/build/DatePicker/DatePicker.types.d.ts +14 -0
- package/build/DatePicker.tsx/DatePicker.d.ts +4 -0
- package/build/DatePicker.tsx/DatePicker.types.d.ts +13 -0
- package/build/Modal/Modal.types.d.ts +0 -1
- package/build/TaxTextField/TaxTextField.types.d.ts +2 -0
- package/build/index.d.ts +5 -1
- package/build/index.esm.js +615 -52
- package/build/index.esm.js.map +1 -1
- package/build/index.js +617 -50
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -2700,14 +2700,22 @@ var RadioButton = function (props) {
|
|
|
2700
2700
|
};
|
|
2701
2701
|
|
|
2702
2702
|
var useStyles$2 = core.makeStyles(function (theme) { return ({
|
|
2703
|
+
root: {
|
|
2704
|
+
"& .MuiFormHelperText-contained": {
|
|
2705
|
+
marginLeft: 16,
|
|
2706
|
+
marginRight: 16,
|
|
2707
|
+
},
|
|
2708
|
+
},
|
|
2703
2709
|
inputRoot: function (props) { return ({
|
|
2704
2710
|
width: props.width,
|
|
2705
2711
|
height: props.height,
|
|
2706
2712
|
padding: "0px 16px",
|
|
2707
2713
|
backgroundColor: "white",
|
|
2708
2714
|
fontSize: 16,
|
|
2709
|
-
lineHeight:
|
|
2715
|
+
lineHeight: "unset",
|
|
2710
2716
|
fontWeight: 400,
|
|
2717
|
+
display: "flex",
|
|
2718
|
+
alignItems: "center",
|
|
2711
2719
|
"& fieldset": {
|
|
2712
2720
|
"& legend": {
|
|
2713
2721
|
width: "0.01px",
|
|
@@ -2715,11 +2723,9 @@ var useStyles$2 = core.makeStyles(function (theme) { return ({
|
|
|
2715
2723
|
borderColor: theme.black.black500,
|
|
2716
2724
|
},
|
|
2717
2725
|
"&.Mui-focused": {
|
|
2718
|
-
boxShadow:
|
|
2726
|
+
boxShadow: "0px 0px 0px 4px #D7DFF8",
|
|
2719
2727
|
"& fieldset": {
|
|
2720
|
-
border:
|
|
2721
|
-
? "1px solid " + theme.black.black1000 + " !important"
|
|
2722
|
-
: "1px solid " + theme.primary.primary400 + " !important",
|
|
2728
|
+
border: "1px solid " + theme.primary.primary400 + " !important",
|
|
2723
2729
|
borderWidth: "1px !important",
|
|
2724
2730
|
},
|
|
2725
2731
|
"&.Mui-error": {
|
|
@@ -2737,11 +2743,18 @@ var useStyles$2 = core.makeStyles(function (theme) { return ({
|
|
|
2737
2743
|
},
|
|
2738
2744
|
}); },
|
|
2739
2745
|
input: {
|
|
2746
|
+
fontSize: 16,
|
|
2747
|
+
lineHeight: "unset",
|
|
2748
|
+
fontWeight: 400,
|
|
2749
|
+
display: "flex",
|
|
2750
|
+
alignItems: "center",
|
|
2740
2751
|
"&:-webkit-autofill": {
|
|
2741
2752
|
"-webkit-box-shadow": "0 0 0 100px #FFFFFF inset",
|
|
2742
2753
|
},
|
|
2743
2754
|
"&::placeholder": { color: theme.black.black700, opacity: 1 },
|
|
2744
2755
|
padding: 0,
|
|
2756
|
+
margin: 0,
|
|
2757
|
+
height: "fit-content",
|
|
2745
2758
|
},
|
|
2746
2759
|
selectRoot: function (props) { return ({
|
|
2747
2760
|
borderRadius: 8,
|
|
@@ -2761,7 +2774,11 @@ var useStyles$2 = core.makeStyles(function (theme) { return ({
|
|
|
2761
2774
|
"&.Mui-error": { color: theme.black.black700 },
|
|
2762
2775
|
},
|
|
2763
2776
|
shrink: {
|
|
2764
|
-
transform: "translate(14px, -
|
|
2777
|
+
transform: "translate(14px, -10px) !important",
|
|
2778
|
+
height: 20,
|
|
2779
|
+
display: "flex",
|
|
2780
|
+
alignItems: "center",
|
|
2781
|
+
justifyContent: "center",
|
|
2765
2782
|
backgroundColor: "white",
|
|
2766
2783
|
fontSize: 14,
|
|
2767
2784
|
fontWeight: 700,
|
|
@@ -2783,7 +2800,7 @@ var TextField = function (props) {
|
|
|
2783
2800
|
select: select,
|
|
2784
2801
|
};
|
|
2785
2802
|
var classes = useStyles$2(styleProps);
|
|
2786
|
-
return (React__default.createElement(MaterialTextField, __assign({ fullWidth: fullWidth, select: select }, other, { variant: "outlined", InputProps: __assign({ classes: {
|
|
2803
|
+
return (React__default.createElement(MaterialTextField, __assign({ fullWidth: fullWidth, select: select }, other, { className: classes.root, variant: "outlined", InputProps: __assign({ classes: {
|
|
2787
2804
|
root: classes.inputRoot,
|
|
2788
2805
|
input: classes.input,
|
|
2789
2806
|
} }, InputProps), InputLabelProps: __assign({ classes: {
|
|
@@ -3107,7 +3124,7 @@ var Button = function (props) {
|
|
|
3107
3124
|
: variant === "secondary"
|
|
3108
3125
|
? theme.primary.primary400
|
|
3109
3126
|
: variant === "tertiary"
|
|
3110
|
-
? theme.
|
|
3127
|
+
? theme.black.black800
|
|
3111
3128
|
: variant === "text"
|
|
3112
3129
|
? theme.primary.primary400
|
|
3113
3130
|
: variant === "black"
|
|
@@ -3120,7 +3137,7 @@ var Button = function (props) {
|
|
|
3120
3137
|
: variant === "secondary"
|
|
3121
3138
|
? theme.black.white
|
|
3122
3139
|
: variant === "tertiary"
|
|
3123
|
-
? theme.
|
|
3140
|
+
? theme.black.black400
|
|
3124
3141
|
: variant === "text"
|
|
3125
3142
|
? theme.black.white
|
|
3126
3143
|
: variant === "black"
|
|
@@ -3165,7 +3182,7 @@ var Button = function (props) {
|
|
|
3165
3182
|
: variant === "secondary"
|
|
3166
3183
|
? theme.primary.primary50
|
|
3167
3184
|
: variant === "tertiary"
|
|
3168
|
-
? theme.
|
|
3185
|
+
? theme.black.black500
|
|
3169
3186
|
: variant === "text"
|
|
3170
3187
|
? theme.primary.primary50
|
|
3171
3188
|
: variant === "black"
|
|
@@ -3189,7 +3206,7 @@ var Button = function (props) {
|
|
|
3189
3206
|
: variant === "secondary"
|
|
3190
3207
|
? theme.primary.primary100
|
|
3191
3208
|
: variant === "tertiary"
|
|
3192
|
-
? theme.
|
|
3209
|
+
? theme.black.black600
|
|
3193
3210
|
: variant === "text"
|
|
3194
3211
|
? theme.primary.primary100
|
|
3195
3212
|
: variant === "black"
|
|
@@ -3203,13 +3220,15 @@ var Button = function (props) {
|
|
|
3203
3220
|
? "0px 0px 0px 4px #CCCCCC"
|
|
3204
3221
|
: variant === "danger"
|
|
3205
3222
|
? "0px 0px 0px 4px #FFCCD0"
|
|
3206
|
-
:
|
|
3223
|
+
: variant === "tertiary"
|
|
3224
|
+
? "0px 0px 0px 4px rgba(0, 0, 0, 0.1)"
|
|
3225
|
+
: "0px 0px 0px 4px #D7DFF8",
|
|
3207
3226
|
backgroundColor: variant === "primary"
|
|
3208
3227
|
? theme.primary.primary400
|
|
3209
3228
|
: variant === "secondary"
|
|
3210
3229
|
? theme.primary.primary50
|
|
3211
3230
|
: variant === "tertiary"
|
|
3212
|
-
? theme.
|
|
3231
|
+
? theme.black.black400
|
|
3213
3232
|
: variant === "text"
|
|
3214
3233
|
? theme.primary.primary50
|
|
3215
3234
|
: variant === "black"
|
|
@@ -3220,7 +3239,7 @@ var Button = function (props) {
|
|
|
3220
3239
|
border: variant === "secondary"
|
|
3221
3240
|
? "1px solid " + theme.primary.primary400
|
|
3222
3241
|
: variant === "tertiary"
|
|
3223
|
-
? "1px solid " + theme.
|
|
3242
|
+
? "1px solid " + theme.black.black600
|
|
3224
3243
|
: variant === "text"
|
|
3225
3244
|
? "1px solid " + theme.primary.primary400
|
|
3226
3245
|
: variant === "black"
|
|
@@ -3236,7 +3255,7 @@ var Button = function (props) {
|
|
|
3236
3255
|
: variant === "secondary"
|
|
3237
3256
|
? theme.black.white
|
|
3238
3257
|
: variant === "tertiary"
|
|
3239
|
-
? theme.
|
|
3258
|
+
? theme.black.black400
|
|
3240
3259
|
: variant === "text"
|
|
3241
3260
|
? theme.black.white
|
|
3242
3261
|
: variant === "black"
|
|
@@ -3249,7 +3268,7 @@ var Button = function (props) {
|
|
|
3249
3268
|
: variant === "secondary"
|
|
3250
3269
|
? theme.primary.primary400
|
|
3251
3270
|
: variant === "tertiary"
|
|
3252
|
-
? theme.
|
|
3271
|
+
? theme.black.black800
|
|
3253
3272
|
: variant === "text"
|
|
3254
3273
|
? theme.primary.primary400
|
|
3255
3274
|
: variant === "black"
|
|
@@ -6671,11 +6690,11 @@ var ModalTransitionEffect = React__default.forwardRef(function ModalTransitionEf
|
|
|
6671
6690
|
return (React__default.createElement(React__default.Fragment, null, slide ? (React__default.createElement(core.Slide, { in: open, direction: "up", mountOnEnter: true, unmountOnExit: true, timeout: { enter: 300, exit: 300 } }, children)) : (React__default.createElement(animated.div, __assign({ style: __assign(__assign({}, style), defaultStyle) }, other), children))));
|
|
6672
6691
|
});
|
|
6673
6692
|
var Modal = React__default.forwardRef(function (props, ref) {
|
|
6674
|
-
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
|
|
6693
|
+
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;
|
|
6675
6694
|
var _a = React.useState(0), clientHeight = _a[0], setClientHeight = _a[1];
|
|
6676
6695
|
var _b = React.useState(0), scorllbarWidth = _b[0], setScorllbarWidth = _b[1];
|
|
6677
6696
|
React.useEffect(function () {
|
|
6678
|
-
if (mobile
|
|
6697
|
+
if (mobile || fullWidth) {
|
|
6679
6698
|
if ((helpText || multiline) && !label) {
|
|
6680
6699
|
setClientHeight(window.innerHeight - 64 - 73 - 64);
|
|
6681
6700
|
}
|
|
@@ -6689,19 +6708,11 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
6689
6708
|
setClientHeight(window.innerHeight - 64 - 56 - 64);
|
|
6690
6709
|
}
|
|
6691
6710
|
}
|
|
6692
|
-
}, []);
|
|
6711
|
+
}, [fullWidth, mobile]);
|
|
6693
6712
|
React.useEffect(function () {
|
|
6694
6713
|
var scrollbar_width = window.innerWidth - document.body.clientWidth;
|
|
6695
6714
|
setScorllbarWidth(scrollbar_width / 2);
|
|
6696
6715
|
}, []);
|
|
6697
|
-
React.useEffect(function () {
|
|
6698
|
-
if (!isFreshchatOpen) {
|
|
6699
|
-
var elem = document.getElementById("fc_frame");
|
|
6700
|
-
if (elem) {
|
|
6701
|
-
elem.style["display"] = open ? "none" : "block";
|
|
6702
|
-
}
|
|
6703
|
-
}
|
|
6704
|
-
}, [open]);
|
|
6705
6716
|
var match_XS = useBreakpoints("xs");
|
|
6706
6717
|
var useStyles = core.makeStyles(function (theme) { return ({
|
|
6707
6718
|
root: {
|
|
@@ -7013,7 +7024,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7013
7024
|
pointerEvents: onExit ? "none" : "unset",
|
|
7014
7025
|
maxHeight: bodyMaxHeight
|
|
7015
7026
|
? bodyMaxHeight
|
|
7016
|
-
:
|
|
7027
|
+
: fullWidth
|
|
7017
7028
|
? clientHeight
|
|
7018
7029
|
: "unset",
|
|
7019
7030
|
overflowY: !onExit ? "scroll" : "hidden",
|
|
@@ -7053,7 +7064,10 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7053
7064
|
},
|
|
7054
7065
|
}); });
|
|
7055
7066
|
var classes = useStyles();
|
|
7056
|
-
return (React__default.createElement(MaterialModal, { open: open, className: classes.root, BackdropComponent: core.Backdrop, BackdropProps: {
|
|
7067
|
+
return (React__default.createElement(MaterialModal, { open: open, className: classes.root, BackdropComponent: core.Backdrop, BackdropProps: {
|
|
7068
|
+
className: classes.backdrop,
|
|
7069
|
+
style: { overflow: "auto", WebkitOverflowScrolling: "touch" },
|
|
7070
|
+
} },
|
|
7057
7071
|
React__default.createElement(ModalTransitionEffect, { in: open, slide: fullWidth, style: {
|
|
7058
7072
|
outline: "none",
|
|
7059
7073
|
transition: "ease-in-out",
|
|
@@ -7134,12 +7148,15 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7134
7148
|
children))) : null,
|
|
7135
7149
|
(label || secondaryButton || primaryButton) && !disUnderLine ? (React__default.createElement(core.Divider, null)) : null,
|
|
7136
7150
|
React__default.createElement(core.Box, { className: classes.footer }, footer ? (footer) : (React__default.createElement(React__default.Fragment, null,
|
|
7137
|
-
!buttonFullWidth || !footerDisplayColumn ? (React__default.createElement(core.Box, { marginBottom: mobile ? (label ? "12px" : 0) : 0
|
|
7138
|
-
|
|
7151
|
+
!buttonFullWidth || !footerDisplayColumn ? (React__default.createElement(core.Box, { marginBottom: mobile ? (label ? "12px" : 0) : 0, style: {
|
|
7152
|
+
fontSize: mobile ? 16 : 18,
|
|
7153
|
+
fontWeight: 700,
|
|
7154
|
+
lineHeight: 1.4,
|
|
7155
|
+
} }, label)) : null,
|
|
7139
7156
|
secondaryButton || primaryButton ? (React__default.createElement(core.Box, { className: classes.footerButton },
|
|
7140
7157
|
React__default.createElement(core.Box, { width: mobile && !buttonFullWidth && !footerDisplayColumn
|
|
7141
7158
|
? null
|
|
7142
|
-
: "100%", marginRight: !footerDisplayColumn ? 1 : 0 }, secondaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn, variant: secondaryButton.variant
|
|
7159
|
+
: "100%", marginRight: !footerDisplayColumn && secondaryButton ? 1 : 0 }, secondaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn, variant: secondaryButton.variant
|
|
7143
7160
|
? secondaryButton.variant
|
|
7144
7161
|
: "secondary", size: "small", onClick: secondaryButton.onClick, disabled: secondaryButton.disabled, loading: secondaryButton.loading, style: secondaryButton.style }, secondaryButton.title)) : null),
|
|
7145
7162
|
React__default.createElement(core.Box, { width: "100%", marginBottom: footerDisplayColumn ? 1 : 0 }, primaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn || mobile, variant: primaryButton.variant
|
|
@@ -7231,7 +7248,12 @@ var useStyles$b = core.makeStyles(function () { return ({
|
|
|
7231
7248
|
height: props.height,
|
|
7232
7249
|
display: "flex",
|
|
7233
7250
|
alignItems: "center",
|
|
7234
|
-
justifyContent: "
|
|
7251
|
+
justifyContent: "center",
|
|
7252
|
+
fontSize: "0.75rem",
|
|
7253
|
+
lineHeight: 1.4,
|
|
7254
|
+
fontWeight: 700,
|
|
7255
|
+
marginRight: props.marginRight,
|
|
7256
|
+
color: props.color,
|
|
7235
7257
|
}); },
|
|
7236
7258
|
}); });
|
|
7237
7259
|
var Chip = function (props) {
|
|
@@ -7250,7 +7272,7 @@ var Chip = function (props) {
|
|
|
7250
7272
|
? theme.danger.danger50
|
|
7251
7273
|
: theme.primary.primary50,
|
|
7252
7274
|
width: width ? width : "fit-content",
|
|
7253
|
-
height: height ? height :
|
|
7275
|
+
height: height ? height : 24,
|
|
7254
7276
|
border: outlined || !contained
|
|
7255
7277
|
? variant === "neutral"
|
|
7256
7278
|
? "1px solid " + theme.black.black500
|
|
@@ -7262,21 +7284,25 @@ var Chip = function (props) {
|
|
|
7262
7284
|
? "1px solid " + theme.danger.danger800
|
|
7263
7285
|
: "1px solid " + theme.primary.primary800
|
|
7264
7286
|
: null,
|
|
7265
|
-
padding: outlined || !contained ? "
|
|
7287
|
+
padding: outlined || !contained ? "0px 8px" : "0px 9px",
|
|
7288
|
+
color: variant === "neutral"
|
|
7289
|
+
? theme.black.black800
|
|
7290
|
+
: variant === "primary"
|
|
7291
|
+
? theme.primary.primary800
|
|
7292
|
+
: variant === "success"
|
|
7293
|
+
? theme.success.success800
|
|
7294
|
+
: variant === "danger"
|
|
7295
|
+
? theme.danger.danger800
|
|
7296
|
+
: theme.primary.primary800,
|
|
7297
|
+
marginRight: variant === "success" ? 4 : 0,
|
|
7266
7298
|
};
|
|
7267
7299
|
var classes = useStyles$b(styleProps);
|
|
7268
7300
|
return (React__default.createElement("div", __assign({ className: classes.root }, other),
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
? "success800"
|
|
7275
|
-
: variant === "danger"
|
|
7276
|
-
? "danger800"
|
|
7277
|
-
: "primary800", style: { marginRight: icon ? 4 : 0 } }, label),
|
|
7278
|
-
icon));
|
|
7279
|
-
};
|
|
7301
|
+
label,
|
|
7302
|
+
variant === "success" && !icon ? icon_success : icon));
|
|
7303
|
+
};
|
|
7304
|
+
var icon_success = (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
7305
|
+
React__default.createElement("path", { d: "M14 4.66666L6 12.6667L2.33333 9L3.27333 8.06L6 10.78L13.06 3.72666L14 4.66666Z", fill: "#00821E" })));
|
|
7280
7306
|
|
|
7281
7307
|
var CircularProgress = function (props) {
|
|
7282
7308
|
var theme = core.useTheme();
|
|
@@ -11784,7 +11810,7 @@ var AutoComplete = function (props) {
|
|
|
11784
11810
|
};
|
|
11785
11811
|
|
|
11786
11812
|
var TaxTextField = function (_a) {
|
|
11787
|
-
var onChange = _a.onChange, codeValue = _a.codeValue, domainValue = _a.domainValue, domainCodeValue = _a.domainCodeValue, codeError = _a.codeError, codeHelperText = _a.codeHelperText, domainError = _a.domainError, domainHelperText = _a.domainHelperText, codeOnClick = _a.codeOnClick, domainOnClick = _a.domainOnClick, mobile = _a.mobile;
|
|
11813
|
+
var onChange = _a.onChange, codeValue = _a.codeValue, domainValue = _a.domainValue, domainCodeValue = _a.domainCodeValue, codeError = _a.codeError, codeHelperText = _a.codeHelperText, domainError = _a.domainError, domainHelperText = _a.domainHelperText, codeOnClick = _a.codeOnClick, domainOnClick = _a.domainOnClick, mobile = _a.mobile, codeFocused = _a.codeFocused, domainFocused = _a.domainFocused;
|
|
11788
11814
|
var _b = React.useState(""), modalIncome = _b[0], setModalIncome = _b[1];
|
|
11789
11815
|
var _c = React.useState(""), modalExpense = _c[0], setModalExpense = _c[1];
|
|
11790
11816
|
var handleModalTaxDescription = function () {
|
|
@@ -11841,7 +11867,7 @@ var TaxTextField = function (_a) {
|
|
|
11841
11867
|
justifyContent: "space-between",
|
|
11842
11868
|
} },
|
|
11843
11869
|
React__default.createElement("div", { style: { width: "100%" } },
|
|
11844
|
-
React__default.createElement(TextField, { fullWidth: true, select: true, error: codeError, helperText: codeHelperText, height: 56, label: "\u9078\u64C7\u7533\u5831\u985E\u5225", value: codeValue, onClick: handleCodeClick, onChange: function (e) {
|
|
11870
|
+
React__default.createElement(TextField, { focused: codeFocused, fullWidth: true, select: true, error: codeError, helperText: codeHelperText, height: 56, label: "\u9078\u64C7\u7533\u5831\u985E\u5225", value: codeValue, onClick: handleCodeClick, onChange: function (e) {
|
|
11845
11871
|
setModalIncome(e.target.value);
|
|
11846
11872
|
setModalExpense("");
|
|
11847
11873
|
} },
|
|
@@ -11873,7 +11899,7 @@ var TaxTextField = function (_a) {
|
|
|
11873
11899
|
margin: mobile ? "24px 0 0 0 " : "0 0 0 8px",
|
|
11874
11900
|
} }, codeValue === "9B" ? (
|
|
11875
11901
|
// 9B Select
|
|
11876
|
-
React__default.createElement(TextField, { select: true, fullWidth: true, error: domainError, helperText: domainHelperText, height: 56, label: "\u8F38\u5165\u57F7\u884C\u696D\u52D9\u985E\u5225", value: domainCodeValue, onClick: handleDomainClick, onChange: function (e) {
|
|
11902
|
+
React__default.createElement(TextField, { focused: domainFocused, select: true, fullWidth: true, error: domainError, helperText: domainHelperText, height: 56, label: "\u8F38\u5165\u57F7\u884C\u696D\u52D9\u985E\u5225", value: domainCodeValue, onClick: handleDomainClick, onChange: function (e) {
|
|
11877
11903
|
setModalExpense(e.target.value);
|
|
11878
11904
|
setAnchorEl(null);
|
|
11879
11905
|
} },
|
|
@@ -11902,7 +11928,7 @@ var TaxTextField = function (_a) {
|
|
|
11902
11928
|
option.label)); }))) : (
|
|
11903
11929
|
// 9A AutoComplete
|
|
11904
11930
|
React__default.createElement(React__default.Fragment, null,
|
|
11905
|
-
React__default.createElement(TextField, { error: domainError, helperText: domainHelperText, fullWidth: true, label: "\u8F38\u5165\u57F7\u884C\u696D\u52D9\u985E\u5225", height: 56, value: domainValue, onClick: handleDomainClick, InputProps: {
|
|
11931
|
+
React__default.createElement(TextField, { focused: domainFocused, error: domainError, helperText: domainHelperText, fullWidth: true, label: "\u8F38\u5165\u57F7\u884C\u696D\u52D9\u985E\u5225", height: 56, value: domainValue, onClick: handleDomainClick, InputProps: {
|
|
11906
11932
|
endAdornment: (React__default.createElement("div", { style: { width: 24, height: 24 } },
|
|
11907
11933
|
React__default.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
11908
11934
|
React__default.createElement("path", { d: "M7 10L12 15L17 10H7Z", fill: "black" })))),
|
|
@@ -12645,6 +12671,543 @@ var Switch = function (props) {
|
|
|
12645
12671
|
React__default.createElement("path", { d: "M4.5 10.21L1.395 7.105L2.81 5.69L4.5 7.385L9.44 2.44L10.855 3.855L4.5 10.21Z", fill: "#4862CC" })))) }, other))));
|
|
12646
12672
|
};
|
|
12647
12673
|
|
|
12674
|
+
var useStylesForMonthButton = core.makeStyles(function (theme) { return ({
|
|
12675
|
+
root: function (props) { return ({
|
|
12676
|
+
width: "100%",
|
|
12677
|
+
height: "100%",
|
|
12678
|
+
borderRadius: 8,
|
|
12679
|
+
border: props.selected
|
|
12680
|
+
? "1px solid " + theme.primary.primary300
|
|
12681
|
+
: "1px solid " + theme.black.black500,
|
|
12682
|
+
boxSizing: "border-box",
|
|
12683
|
+
display: "flex",
|
|
12684
|
+
alignItems: "center",
|
|
12685
|
+
justifyContent: "center",
|
|
12686
|
+
fontSize: 14,
|
|
12687
|
+
fontWeight: 700,
|
|
12688
|
+
lineHeight: 1.4,
|
|
12689
|
+
backgroundColor: props.selected
|
|
12690
|
+
? theme.primary.primary50
|
|
12691
|
+
: theme.black.white,
|
|
12692
|
+
cursor: "pointer",
|
|
12693
|
+
"&:hover": {
|
|
12694
|
+
border: props.selected
|
|
12695
|
+
? "1px solid " + theme.primary.primary300
|
|
12696
|
+
: "1px solid " + theme.black.black600,
|
|
12697
|
+
backgroundColor: props.selected
|
|
12698
|
+
? theme.primary.primary50
|
|
12699
|
+
: theme.black.black100,
|
|
12700
|
+
},
|
|
12701
|
+
}); },
|
|
12702
|
+
}); });
|
|
12703
|
+
var useStylesForCalendar = core.makeStyles(function (theme) { return ({
|
|
12704
|
+
head: {
|
|
12705
|
+
width: "100%",
|
|
12706
|
+
display: "flex",
|
|
12707
|
+
alignItems: "center",
|
|
12708
|
+
justifyContent: "center",
|
|
12709
|
+
height: 48,
|
|
12710
|
+
fontSize: 14,
|
|
12711
|
+
fontWeight: 700,
|
|
12712
|
+
marginBottom: 8,
|
|
12713
|
+
position: "relative",
|
|
12714
|
+
},
|
|
12715
|
+
body: {
|
|
12716
|
+
display: "grid",
|
|
12717
|
+
gridTemplateColumns: "1fr 1fr 1fr 1fr 1fr 1fr 1fr",
|
|
12718
|
+
gap: 8,
|
|
12719
|
+
},
|
|
12720
|
+
days: {
|
|
12721
|
+
width: 32,
|
|
12722
|
+
height: 32,
|
|
12723
|
+
display: "flex",
|
|
12724
|
+
alignItems: "center",
|
|
12725
|
+
justifyContent: "center",
|
|
12726
|
+
fontSize: 14,
|
|
12727
|
+
color: theme.black.black600,
|
|
12728
|
+
},
|
|
12729
|
+
date: {
|
|
12730
|
+
width: 32,
|
|
12731
|
+
height: 32,
|
|
12732
|
+
display: "flex",
|
|
12733
|
+
alignItems: "center",
|
|
12734
|
+
justifyContent: "center",
|
|
12735
|
+
marginBottom: 4,
|
|
12736
|
+
fontSize: 14,
|
|
12737
|
+
fontWeight: 700,
|
|
12738
|
+
color: theme.black.black800,
|
|
12739
|
+
cursor: "pointer",
|
|
12740
|
+
borderRadius: "50%",
|
|
12741
|
+
"&:hover": {
|
|
12742
|
+
backgroundColor: theme.primary.primary50,
|
|
12743
|
+
},
|
|
12744
|
+
},
|
|
12745
|
+
}); });
|
|
12746
|
+
var DatePicker = function (props) {
|
|
12747
|
+
var open = props.open, onClose = props.onClose, format = props.format, mobile = props.mobile, min = props.min, max = props.max, ModalProps = props.ModalProps, defaultValue = props.defaultValue, getValue = props.getValue, value = props.value, other = __rest(props, ["open", "onClose", "format", "mobile", "min", "max", "ModalProps", "defaultValue", "getValue", "value"]);
|
|
12748
|
+
var _a = React.useState(Number(new Date().getFullYear())), year = _a[0], setYear = _a[1];
|
|
12749
|
+
var _b = React.useState(Number(new Date().getMonth() + 1)), month = _b[0], setMonth = _b[1];
|
|
12750
|
+
var _c = React.useState(1), nextMonth = _c[0], setNextMonth = _c[1];
|
|
12751
|
+
var _d = React.useState(""), date = _d[0], setDate = _d[1];
|
|
12752
|
+
var _e = React.useState(false), isOpenMonthSelector = _e[0], setIsOpenMonthSelector = _e[1];
|
|
12753
|
+
var _f = React.useState(false), isClicked = _f[0], setIsClicked = _f[1];
|
|
12754
|
+
React.useEffect(function () {
|
|
12755
|
+
if (format === "month") {
|
|
12756
|
+
if (month % 2 === 0) {
|
|
12757
|
+
setMonth(month - 1);
|
|
12758
|
+
}
|
|
12759
|
+
else {
|
|
12760
|
+
if (month < 1) {
|
|
12761
|
+
setMonth(11);
|
|
12762
|
+
setYear(year - 1);
|
|
12763
|
+
}
|
|
12764
|
+
if (month > 12) {
|
|
12765
|
+
setMonth(1);
|
|
12766
|
+
setYear(year + 1);
|
|
12767
|
+
}
|
|
12768
|
+
}
|
|
12769
|
+
}
|
|
12770
|
+
}, [month]);
|
|
12771
|
+
React.useEffect(function () {
|
|
12772
|
+
if (isClicked && getValue) {
|
|
12773
|
+
if (format === "month") {
|
|
12774
|
+
if (month < 1) {
|
|
12775
|
+
getValue(year - 1 + "-11");
|
|
12776
|
+
}
|
|
12777
|
+
else if (month > 12) {
|
|
12778
|
+
getValue(year + 1 + "-1");
|
|
12779
|
+
}
|
|
12780
|
+
else {
|
|
12781
|
+
getValue(year + "-" + month);
|
|
12782
|
+
}
|
|
12783
|
+
}
|
|
12784
|
+
else if (format === "day") {
|
|
12785
|
+
getValue(date.replace(/\//g, "-"));
|
|
12786
|
+
}
|
|
12787
|
+
else {
|
|
12788
|
+
getValue(String(year));
|
|
12789
|
+
}
|
|
12790
|
+
setIsClicked(false);
|
|
12791
|
+
}
|
|
12792
|
+
}, [isClicked]);
|
|
12793
|
+
React.useEffect(function () {
|
|
12794
|
+
if (value) {
|
|
12795
|
+
setDate(changeDateFormatToSlash(value));
|
|
12796
|
+
}
|
|
12797
|
+
}, [value]);
|
|
12798
|
+
return (React__default.createElement("div", __assign({}, other), format !== "day" ? (React__default.createElement("div", { style: {
|
|
12799
|
+
borderRadius: 8,
|
|
12800
|
+
border: "1px solid #cccccc",
|
|
12801
|
+
boxSizing: "border-box",
|
|
12802
|
+
width: format === "month" ? 219 : 180,
|
|
12803
|
+
height: 40,
|
|
12804
|
+
display: "grid",
|
|
12805
|
+
alignItems: "center",
|
|
12806
|
+
gridTemplateColumns: "36px 1px 1fr 1px 36px",
|
|
12807
|
+
position: "relative",
|
|
12808
|
+
} },
|
|
12809
|
+
React__default.createElement(IconButton, { onClick: function () {
|
|
12810
|
+
if (format === "month") {
|
|
12811
|
+
setMonth(month - 2);
|
|
12812
|
+
}
|
|
12813
|
+
else {
|
|
12814
|
+
setYear(year - 1);
|
|
12815
|
+
}
|
|
12816
|
+
setIsClicked(true);
|
|
12817
|
+
}, style: {
|
|
12818
|
+
width: "100%",
|
|
12819
|
+
height: "100%",
|
|
12820
|
+
display: "flex",
|
|
12821
|
+
justifyContent: "center",
|
|
12822
|
+
alignItems: "center",
|
|
12823
|
+
borderRadius: "8px 0 0 8px",
|
|
12824
|
+
} }, icon_arrowleft),
|
|
12825
|
+
verticalline,
|
|
12826
|
+
React__default.createElement("div", { style: {
|
|
12827
|
+
display: "flex",
|
|
12828
|
+
justifyContent: "center",
|
|
12829
|
+
alignItems: "center",
|
|
12830
|
+
} },
|
|
12831
|
+
icon_calendar,
|
|
12832
|
+
format === "month" ? (React__default.createElement("div", { style: {
|
|
12833
|
+
fontSize: 14,
|
|
12834
|
+
fontWeight: 700,
|
|
12835
|
+
lineHeight: 1.4,
|
|
12836
|
+
marginLeft: 4,
|
|
12837
|
+
cursor: "pointer",
|
|
12838
|
+
}, onClick: function () { return setIsOpenMonthSelector(!isOpenMonthSelector); } },
|
|
12839
|
+
year,
|
|
12840
|
+
"\u5E74",
|
|
12841
|
+
month,
|
|
12842
|
+
"-",
|
|
12843
|
+
month + 1,
|
|
12844
|
+
"\u6708")) : (React__default.createElement("div", { style: {
|
|
12845
|
+
fontSize: 14,
|
|
12846
|
+
fontWeight: 700,
|
|
12847
|
+
lineHeight: 1.4,
|
|
12848
|
+
marginLeft: 4,
|
|
12849
|
+
} },
|
|
12850
|
+
year,
|
|
12851
|
+
"\u5E74"))),
|
|
12852
|
+
verticalline,
|
|
12853
|
+
React__default.createElement(IconButton, { onClick: function () {
|
|
12854
|
+
if (format === "month") {
|
|
12855
|
+
setMonth(month + 2);
|
|
12856
|
+
}
|
|
12857
|
+
else {
|
|
12858
|
+
setYear(year + 1);
|
|
12859
|
+
}
|
|
12860
|
+
setIsClicked(true);
|
|
12861
|
+
}, style: {
|
|
12862
|
+
width: "100%",
|
|
12863
|
+
height: "100%",
|
|
12864
|
+
display: "flex",
|
|
12865
|
+
justifyContent: "center",
|
|
12866
|
+
alignItems: "center",
|
|
12867
|
+
borderRadius: "0 8px 8px 0",
|
|
12868
|
+
} }, icon_arrowright),
|
|
12869
|
+
format === "month" ? (React__default.createElement(core.Grow, { in: isOpenMonthSelector, style: { transformOrigin: "0 0 0" } },
|
|
12870
|
+
React__default.createElement("div", { style: {
|
|
12871
|
+
border: "1px solid #cccccc",
|
|
12872
|
+
borderRadius: 8,
|
|
12873
|
+
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
12874
|
+
boxSizing: "border-box",
|
|
12875
|
+
width: 302,
|
|
12876
|
+
height: 160,
|
|
12877
|
+
position: "absolute",
|
|
12878
|
+
backgroundColor: "#ffffff",
|
|
12879
|
+
zIndex: 1,
|
|
12880
|
+
top: 52,
|
|
12881
|
+
left: 0,
|
|
12882
|
+
} },
|
|
12883
|
+
React__default.createElement("div", { style: {
|
|
12884
|
+
height: 48,
|
|
12885
|
+
padding: 8,
|
|
12886
|
+
display: "grid",
|
|
12887
|
+
gridTemplateColumns: "32px 1fr 32px",
|
|
12888
|
+
gap: 13,
|
|
12889
|
+
alignItems: "center",
|
|
12890
|
+
boxShadow: "0px 1px 0px #ECECEC",
|
|
12891
|
+
} },
|
|
12892
|
+
React__default.createElement(IconButton, { hoverColor: "black400", onClick: function () {
|
|
12893
|
+
setYear(year - 1);
|
|
12894
|
+
setIsClicked(true);
|
|
12895
|
+
} }, icon_arrowleft),
|
|
12896
|
+
React__default.createElement(Typography, { variant: "subtitle", style: { textAlign: "center" } },
|
|
12897
|
+
year,
|
|
12898
|
+
"\u5E74"),
|
|
12899
|
+
React__default.createElement(IconButton, { hoverColor: "black400", onClick: function () {
|
|
12900
|
+
setYear(year + 1);
|
|
12901
|
+
setIsClicked(true);
|
|
12902
|
+
} }, icon_arrowright)),
|
|
12903
|
+
React__default.createElement("div", { style: {
|
|
12904
|
+
padding: 16,
|
|
12905
|
+
display: "grid",
|
|
12906
|
+
alignItems: "center",
|
|
12907
|
+
gap: 8,
|
|
12908
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
12909
|
+
gridTemplateRows: "36px 36px",
|
|
12910
|
+
} }, Array.from(Array(6).keys()).map(function (_i, i) { return (React__default.createElement(MonthButton, { key: i, index: i, month: month, setMonth: setMonth, setIsOpenMonthSelector: setIsOpenMonthSelector, setIsClicked: setIsClicked })); }))))) : null)) : (React__default.createElement(Modal, __assign({ bodyPadding: mobile ? 16 : undefined, fullWidth: mobile, open: open, onClose: onClose, size: mobile ? undefined : "medium", label: !mobile ? (React__default.createElement(Typography, { variant: "h6" },
|
|
12911
|
+
React__default.createElement("span", { style: { fontWeight: 400 } }, "\u5DF2\u9078\u64C7\uFF1A"),
|
|
12912
|
+
date &&
|
|
12913
|
+
date.split("/")[0] + "\u5E74" + date.split("/")[1] + "\u6708" + date.split("/")[2] + "\u65E5")) : (React__default.createElement(React__default.Fragment, null,
|
|
12914
|
+
React__default.createElement(Typography, { variant: "caption2" },
|
|
12915
|
+
React__default.createElement("span", { style: { fontWeight: 400 } }, "\u5DF2\u9078\u64C7\uFF1A")),
|
|
12916
|
+
React__default.createElement(Typography, { variant: "subtitle" }, date &&
|
|
12917
|
+
date.split("/")[0] + "\u5E74" + date.split("/")[1] + "\u6708" + date.split("/")[2] + "\u65E5"))), primaryButton: {
|
|
12918
|
+
title: "確認",
|
|
12919
|
+
onClick: function () {
|
|
12920
|
+
onClose();
|
|
12921
|
+
},
|
|
12922
|
+
}, secondaryButton: { title: "取消", onClick: onClose }, children: !mobile ? (React__default.createElement("div", { style: { display: "flex", justifyContent: "space-between" } },
|
|
12923
|
+
React__default.createElement(Calendar, { month: month, year: year, date: date, setDate: setDate, min: min, max: max, position: "left", leftClick: function () {
|
|
12924
|
+
if (month - 1 < 1) {
|
|
12925
|
+
setMonth(12);
|
|
12926
|
+
setYear(year - 1);
|
|
12927
|
+
}
|
|
12928
|
+
else {
|
|
12929
|
+
setMonth(month - 1);
|
|
12930
|
+
}
|
|
12931
|
+
setNextMonth(month);
|
|
12932
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked }),
|
|
12933
|
+
React__default.createElement(Calendar, { month: nextMonth, year: month > nextMonth ? year + 1 : year, date: date, setDate: setDate, min: min, max: max, position: "right", rightClick: function () {
|
|
12934
|
+
if (nextMonth + 1 > 12) {
|
|
12935
|
+
setMonth(12);
|
|
12936
|
+
setNextMonth(1);
|
|
12937
|
+
}
|
|
12938
|
+
else if (month + 1 > 12) {
|
|
12939
|
+
setMonth(1);
|
|
12940
|
+
setNextMonth(2);
|
|
12941
|
+
setYear(year + 1);
|
|
12942
|
+
}
|
|
12943
|
+
else {
|
|
12944
|
+
setMonth(month + 1);
|
|
12945
|
+
setNextMonth(nextMonth + 1);
|
|
12946
|
+
}
|
|
12947
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked }))) : (React__default.createElement(Calendar, { month: month, year: year, date: date, setDate: setDate, min: min, max: max, position: "left", leftClick: function () {
|
|
12948
|
+
if (month - 1 < 1) {
|
|
12949
|
+
setMonth(12);
|
|
12950
|
+
setYear(year - 1);
|
|
12951
|
+
}
|
|
12952
|
+
else {
|
|
12953
|
+
setMonth(month - 1);
|
|
12954
|
+
}
|
|
12955
|
+
setNextMonth(month);
|
|
12956
|
+
}, rightClick: function () {
|
|
12957
|
+
if (nextMonth + 1 > 12) {
|
|
12958
|
+
setMonth(12);
|
|
12959
|
+
setNextMonth(1);
|
|
12960
|
+
}
|
|
12961
|
+
else if (month + 1 > 12) {
|
|
12962
|
+
setMonth(1);
|
|
12963
|
+
setNextMonth(2);
|
|
12964
|
+
setYear(year + 1);
|
|
12965
|
+
}
|
|
12966
|
+
else {
|
|
12967
|
+
setMonth(month + 1);
|
|
12968
|
+
setNextMonth(nextMonth + 1);
|
|
12969
|
+
}
|
|
12970
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked, mobile: mobile })) }, ModalProps)))));
|
|
12971
|
+
};
|
|
12972
|
+
var MonthButton = function (_a) {
|
|
12973
|
+
var index = _a.index, month = _a.month, setMonth = _a.setMonth, setIsOpenMonthSelector = _a.setIsOpenMonthSelector, setIsClicked = _a.setIsClicked;
|
|
12974
|
+
var styleProps = {
|
|
12975
|
+
selected: 1 + 2 * index === month,
|
|
12976
|
+
};
|
|
12977
|
+
var classes = useStylesForMonthButton(styleProps);
|
|
12978
|
+
return (React__default.createElement("div", { className: classes.root, onClick: function () {
|
|
12979
|
+
setMonth(1 + 2 * index);
|
|
12980
|
+
setIsOpenMonthSelector(false);
|
|
12981
|
+
setIsClicked(true);
|
|
12982
|
+
} },
|
|
12983
|
+
1 + 2 * index,
|
|
12984
|
+
"-",
|
|
12985
|
+
2 + 2 * index,
|
|
12986
|
+
"\u6708"));
|
|
12987
|
+
};
|
|
12988
|
+
var Calendar = function (_a) {
|
|
12989
|
+
var year = _a.year, month = _a.month, setDate = _a.setDate, date = _a.date, min = _a.min, max = _a.max, leftClick = _a.leftClick, rightClick = _a.rightClick, position = _a.position, defaultValue = _a.defaultValue, setIsClicked = _a.setIsClicked, mobile = _a.mobile;
|
|
12990
|
+
var isBigMonth = (month <= 7 && month % 2 !== 0) || (month >= 8 && month % 2 === 0);
|
|
12991
|
+
var today = defaultValue
|
|
12992
|
+
? new Date(changeDateFormatToSlash(defaultValue))
|
|
12993
|
+
: new Date();
|
|
12994
|
+
var selectedYear = Number(date.split("/")[0]);
|
|
12995
|
+
var selectedMonth = Number(date.split("/")[1]);
|
|
12996
|
+
var selectedDate = Number(date.split("/")[2]);
|
|
12997
|
+
var msOfMin = min ? new Date(changeDateFormatToSlash(min)).getTime() : 0;
|
|
12998
|
+
var msOfMax = max ? new Date(changeDateFormatToSlash(max)).getTime() : 0;
|
|
12999
|
+
var msOfFirstDayOfMonth = new Date(year + "/" + month + "/1").getTime();
|
|
13000
|
+
var msOfLastDayOfMonth = new Date(year + "/" + month + "/" + (month === 2 ? (year % 4 === 0 ? 29 : 28) : isBigMonth ? 31 : 30)).getTime();
|
|
13001
|
+
var arrowDisabled = (msOfMin !== 0 && position === "left" && msOfFirstDayOfMonth <= msOfMin) ||
|
|
13002
|
+
(msOfMax !== 0 && position === "right" && msOfLastDayOfMonth >= msOfMax);
|
|
13003
|
+
var mobileLeftArrowDisabled = msOfMin !== 0 && msOfFirstDayOfMonth <= msOfMin;
|
|
13004
|
+
var mobileRightArrowDisabled = msOfMax !== 0 && msOfLastDayOfMonth >= msOfMax;
|
|
13005
|
+
var classes = useStylesForCalendar();
|
|
13006
|
+
var theme = core.useTheme();
|
|
13007
|
+
return (React__default.createElement("div", null,
|
|
13008
|
+
React__default.createElement("div", { className: classes.head },
|
|
13009
|
+
year,
|
|
13010
|
+
"\u5E74",
|
|
13011
|
+
month,
|
|
13012
|
+
"\u6708",
|
|
13013
|
+
!mobile ? (React__default.createElement(IconButton, { onClick: position === "left" ? leftClick : rightClick, disabled: arrowDisabled, style: {
|
|
13014
|
+
position: "absolute",
|
|
13015
|
+
left: position === "left" ? 8 : undefined,
|
|
13016
|
+
right: position === "left" ? undefined : 8,
|
|
13017
|
+
top: 8,
|
|
13018
|
+
opacity: arrowDisabled ? 0.4 : undefined,
|
|
13019
|
+
} }, position === "left" ? icon_arrowleft : icon_arrowright)) : (React__default.createElement(React__default.Fragment, null,
|
|
13020
|
+
React__default.createElement(IconButton, { onClick: leftClick, disabled: mobileLeftArrowDisabled, style: {
|
|
13021
|
+
position: "absolute",
|
|
13022
|
+
left: 8,
|
|
13023
|
+
top: 8,
|
|
13024
|
+
opacity: mobileLeftArrowDisabled ? 0.4 : undefined,
|
|
13025
|
+
} }, icon_arrowleft),
|
|
13026
|
+
React__default.createElement(IconButton, { onClick: rightClick, disabled: mobileRightArrowDisabled, style: {
|
|
13027
|
+
position: "absolute",
|
|
13028
|
+
right: 8,
|
|
13029
|
+
top: 8,
|
|
13030
|
+
opacity: mobileRightArrowDisabled ? 0.4 : undefined,
|
|
13031
|
+
} }, icon_arrowright)))),
|
|
13032
|
+
React__default.createElement("div", { className: classes.body },
|
|
13033
|
+
["日", "一", "二", "三", "四", "五", "六"].map(function (i) { return (React__default.createElement("div", { key: i, className: classes.days }, i)); }),
|
|
13034
|
+
Array.from(Array(month === 2
|
|
13035
|
+
? year % 4 === 0
|
|
13036
|
+
? 29 + firstDayOfMonth(year, month)
|
|
13037
|
+
: 28 + firstDayOfMonth(year, month)
|
|
13038
|
+
: isBigMonth
|
|
13039
|
+
? 31 + firstDayOfMonth(year, month)
|
|
13040
|
+
: 30 + firstDayOfMonth(year, month)).keys()).map(function (_i, i) {
|
|
13041
|
+
if (i + 1 <= firstDayOfMonth(year, month))
|
|
13042
|
+
return (React__default.createElement("div", { key: i, style: {
|
|
13043
|
+
width: 32,
|
|
13044
|
+
height: 32,
|
|
13045
|
+
} }));
|
|
13046
|
+
var dateNumber = i + 1 - firstDayOfMonth(year, month);
|
|
13047
|
+
var isSelected = year === selectedYear &&
|
|
13048
|
+
month === selectedMonth &&
|
|
13049
|
+
dateNumber === selectedDate;
|
|
13050
|
+
var isToday = year === today.getFullYear() &&
|
|
13051
|
+
month === today.getMonth() + 1 &&
|
|
13052
|
+
dateNumber === today.getDate();
|
|
13053
|
+
var msOfDate = new Date(year + "/" + month + "/" + dateNumber).getTime();
|
|
13054
|
+
var disabled = (msOfMin !== 0 && msOfDate < msOfMin) ||
|
|
13055
|
+
(msOfMax !== 0 && msOfDate > msOfMax);
|
|
13056
|
+
return (React__default.createElement("div", { key: i, className: classes.date, onClick: function () {
|
|
13057
|
+
setDate(year + "/" + month + "/" + dateNumber);
|
|
13058
|
+
setIsClicked(true);
|
|
13059
|
+
}, style: {
|
|
13060
|
+
backgroundColor: isSelected
|
|
13061
|
+
? theme.primary.primary400
|
|
13062
|
+
: isToday
|
|
13063
|
+
? theme.black.black400
|
|
13064
|
+
: undefined,
|
|
13065
|
+
color: isSelected ? theme.black.white : undefined,
|
|
13066
|
+
border: isSelected
|
|
13067
|
+
? "1px solid " + theme.primary.primary600
|
|
13068
|
+
: undefined,
|
|
13069
|
+
opacity: disabled ? 0.4 : undefined,
|
|
13070
|
+
pointerEvents: disabled ? "none" : undefined,
|
|
13071
|
+
} }, dateNumber));
|
|
13072
|
+
}))));
|
|
13073
|
+
};
|
|
13074
|
+
var firstDayOfMonth = function (year, month) {
|
|
13075
|
+
var firstDay = year + "/" + month + "/" + 1;
|
|
13076
|
+
return new Date(firstDay).getDay();
|
|
13077
|
+
};
|
|
13078
|
+
var changeDateFormatToSlash = function (date) {
|
|
13079
|
+
return date.replace(/-/g, "/");
|
|
13080
|
+
};
|
|
13081
|
+
var verticalline = (React__default.createElement("div", { style: { width: 1, height: "100%", backgroundColor: "#cccccc" } }));
|
|
13082
|
+
var icon_arrowleft = (React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
13083
|
+
React__default.createElement("path", { d: "M12.8417 13.8167L9.02502 10L12.8417 6.175L11.6667 5L6.66669 10L11.6667 15L12.8417 13.8167Z", fill: "black" })));
|
|
13084
|
+
var icon_arrowright = (React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
13085
|
+
React__default.createElement("path", { d: "M7.15833 13.8167L10.975 10L7.15833 6.175L8.33333 5L13.3333 10L8.33333 15L7.15833 13.8167Z", fill: "black" })));
|
|
13086
|
+
var icon_calendar = (React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
13087
|
+
React__default.createElement("path", { d: "M5.83333 8.33333H10V12.5H5.83333V8.33333ZM15.8333 15.8333H4.16667V6.66667H15.8333V15.8333ZM15.8333 2.5H15V0.833332H13.3333V2.5H6.66667V0.833332H5V2.5H4.16667C3.24167 2.5 2.5 3.25 2.5 4.16667V15.8333C2.5 16.2754 2.67559 16.6993 2.98816 17.0118C3.30072 17.3244 3.72464 17.5 4.16667 17.5H15.8333C16.2754 17.5 16.6993 17.3244 17.0118 17.0118C17.3244 16.6993 17.5 16.2754 17.5 15.8333V4.16667C17.5 3.72464 17.3244 3.30071 17.0118 2.98815C16.6993 2.67559 16.2754 2.5 15.8333 2.5Z", fill: "#6F6F6F" })));
|
|
13088
|
+
|
|
13089
|
+
var Breadcrumb = function (props) {
|
|
13090
|
+
var maxItems = props.maxItems, separator = props.separator, children = props.children, other = __rest(props, ["maxItems", "separator", "children"]);
|
|
13091
|
+
var _a = React.useState(false), isHoverThreeDots = _a[0], setIsHoverThreeDots = _a[1];
|
|
13092
|
+
var _b = React.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
13093
|
+
var handleThreeDotsClick = function (event) {
|
|
13094
|
+
setAnchorEl(event.currentTarget);
|
|
13095
|
+
};
|
|
13096
|
+
var handleThreeDotsClose = function () {
|
|
13097
|
+
setAnchorEl(null);
|
|
13098
|
+
};
|
|
13099
|
+
return (React__default.createElement("div", __assign({ style: { display: "flex", alignItems: "center" } }, other),
|
|
13100
|
+
maxItems && (children === null || children === void 0 ? void 0 : children.length) > maxItems ? (
|
|
13101
|
+
/**隱藏內容 */
|
|
13102
|
+
React__default.createElement(React__default.Fragment, null,
|
|
13103
|
+
React__default.createElement("div", { style: {
|
|
13104
|
+
display: "flex",
|
|
13105
|
+
alignItems: "center",
|
|
13106
|
+
fontSize: 14,
|
|
13107
|
+
fontWeight: 400,
|
|
13108
|
+
} },
|
|
13109
|
+
children[0],
|
|
13110
|
+
React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"),
|
|
13111
|
+
React__default.createElement("div", { onClick: handleThreeDotsClick, onMouseEnter: function () { return setIsHoverThreeDots(true); }, onMouseLeave: function () { return setIsHoverThreeDots(false); }, style: { cursor: "pointer" } }, isHoverThreeDots ? icon_threedots_hover : icon_threedots),
|
|
13112
|
+
React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/")),
|
|
13113
|
+
children
|
|
13114
|
+
.slice((children === null || children === void 0 ? void 0 : children.length) - maxItems + 1)
|
|
13115
|
+
.map(function (i, index) {
|
|
13116
|
+
return (React__default.createElement("div", { key: Math.random().toString(36).substr(2), style: {
|
|
13117
|
+
display: "flex",
|
|
13118
|
+
alignItems: "center",
|
|
13119
|
+
fontSize: 14,
|
|
13120
|
+
fontWeight: index + 1 === (children === null || children === void 0 ? void 0 : children.length) ? 700 : 400,
|
|
13121
|
+
} },
|
|
13122
|
+
i,
|
|
13123
|
+
index + 1 !== maxItems - 1 && (React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"))));
|
|
13124
|
+
}))) : (children === null || children === void 0 ? void 0 : children.map(function (i, index) {
|
|
13125
|
+
return (React__default.createElement("div", { key: Math.random().toString(36).substr(2), style: {
|
|
13126
|
+
display: "flex",
|
|
13127
|
+
alignItems: "center",
|
|
13128
|
+
fontSize: 14,
|
|
13129
|
+
fontWeight: index + 1 === (children === null || children === void 0 ? void 0 : children.length) ? 700 : 400,
|
|
13130
|
+
} },
|
|
13131
|
+
i,
|
|
13132
|
+
index + 1 !== (children === null || children === void 0 ? void 0 : children.length) && (React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"))));
|
|
13133
|
+
})),
|
|
13134
|
+
React__default.createElement(Menu, { anchorEl: anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleThreeDotsClose, anchorOrigin: { vertical: "bottom", horizontal: -16 }, getContentAnchorEl: null }, children === null || children === void 0 ? void 0 : children.slice(1, (children === null || children === void 0 ? void 0 : children.length) - maxItems + 1).map(function (i) {
|
|
13135
|
+
var content = i.props.children;
|
|
13136
|
+
var href = i.props.href;
|
|
13137
|
+
var target = i.props.target;
|
|
13138
|
+
console.log(target);
|
|
13139
|
+
return (React__default.createElement(MenuItem, { key: Math.random().toString(36).substr(2), onClick: function () {
|
|
13140
|
+
if (target && target === "_blank") {
|
|
13141
|
+
window.open(href);
|
|
13142
|
+
}
|
|
13143
|
+
else {
|
|
13144
|
+
window.location.href = href;
|
|
13145
|
+
}
|
|
13146
|
+
} }, content));
|
|
13147
|
+
}))));
|
|
13148
|
+
};
|
|
13149
|
+
var icon_threedots = (React__default.createElement("svg", { width: "12", height: "20", viewBox: "0 0 12 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
13150
|
+
React__default.createElement("path", { d: "M1.946 16.182C2.45 16.182 2.87 15.79 2.87 15.216C2.87 14.642 2.45 14.222 1.946 14.222C1.442 14.222 1.022 14.642 1.022 15.216C1.022 15.79 1.442 16.182 1.946 16.182ZM5.84248 16.182C6.34648 16.182 6.76648 15.79 6.76648 15.216C6.76648 14.642 6.34648 14.222 5.84248 14.222C5.33848 14.222 4.91848 14.642 4.91848 15.216C4.91848 15.79 5.33848 16.182 5.84248 16.182ZM9.73897 16.182C10.243 16.182 10.663 15.79 10.663 15.216C10.663 14.642 10.243 14.222 9.73897 14.222C9.23497 14.222 8.81497 14.642 8.81497 15.216C8.81497 15.79 9.23497 16.182 9.73897 16.182Z", fill: "#4B4B4B" })));
|
|
13151
|
+
var icon_threedots_hover = (React__default.createElement("svg", { width: "12", height: "20", viewBox: "0 0 12 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
13152
|
+
React__default.createElement("path", { d: "M1.946 16.182C2.45 16.182 2.87 15.79 2.87 15.216C2.87 14.642 2.45 14.222 1.946 14.222C1.442 14.222 1.022 14.642 1.022 15.216C1.022 15.79 1.442 16.182 1.946 16.182ZM5.84248 16.182C6.34648 16.182 6.76648 15.79 6.76648 15.216C6.76648 14.642 6.34648 14.222 5.84248 14.222C5.33848 14.222 4.91848 14.642 4.91848 15.216C4.91848 15.79 5.33848 16.182 5.84248 16.182ZM9.73897 16.182C10.243 16.182 10.663 15.79 10.663 15.216C10.663 14.642 10.243 14.222 9.73897 14.222C9.23497 14.222 8.81497 14.642 8.81497 15.216C8.81497 15.79 9.23497 16.182 9.73897 16.182Z", fill: "#4B4B4B" }),
|
|
13153
|
+
React__default.createElement("path", { d: "M0 18.1H11.685V18.8H0V18.1Z", fill: "#4B4B4B" })));
|
|
13154
|
+
|
|
13155
|
+
var BreadcrumbItem = function (props) {
|
|
13156
|
+
var last = props.last, other = __rest(props, ["last"]);
|
|
13157
|
+
return (React__default.createElement(Link, __assign({}, other, { color: last ? "black1000" : "black800", style: {
|
|
13158
|
+
fontWeight: last ? 700 : 400,
|
|
13159
|
+
cursor: last ? "unset" : undefined,
|
|
13160
|
+
textDecoration: last ? "none" : undefined,
|
|
13161
|
+
} })));
|
|
13162
|
+
};
|
|
13163
|
+
|
|
13164
|
+
var useStyles$n = core.makeStyles(function (theme) { return ({
|
|
13165
|
+
root: function (props) { return ({
|
|
13166
|
+
width: props.width ? props.width : 350,
|
|
13167
|
+
height: props.height ? props.height : "100%",
|
|
13168
|
+
backgroundColor: theme.black.white,
|
|
13169
|
+
boxSizing: "border-box",
|
|
13170
|
+
border: "1px solid " + theme.black.black500,
|
|
13171
|
+
borderRadius: 8,
|
|
13172
|
+
display: "flex",
|
|
13173
|
+
flexDirection: "column",
|
|
13174
|
+
justifyContent: "space-between",
|
|
13175
|
+
overflow: "hidden",
|
|
13176
|
+
}); },
|
|
13177
|
+
body: { padding: 24, width: "100%", height: "100%" },
|
|
13178
|
+
buttonblock: {
|
|
13179
|
+
width: "100%",
|
|
13180
|
+
boxShadow: "0px -1px 0px " + theme.black.black400,
|
|
13181
|
+
borderRadius: " 0px 0px 8px 8px",
|
|
13182
|
+
display: "flex",
|
|
13183
|
+
padding: 0,
|
|
13184
|
+
},
|
|
13185
|
+
}); });
|
|
13186
|
+
var Card = function (props) {
|
|
13187
|
+
var width = props.width, height = props.height, children = props.children, buttons = props.buttons, bodyStyle = props.bodyStyle, loading = props.loading, other = __rest(props, ["width", "height", "children", "buttons", "bodyStyle", "loading"]);
|
|
13188
|
+
var useStylesProps = { width: width, height: height };
|
|
13189
|
+
var classes = useStyles$n(useStylesProps);
|
|
13190
|
+
var theme = core.useTheme();
|
|
13191
|
+
return (React__default.createElement("div", __assign({ className: classes.root }, other),
|
|
13192
|
+
React__default.createElement("div", { className: classes.body, style: bodyStyle }, !loading ? (children) : (React__default.createElement("div", { style: { width: "100%", height: "100%" } },
|
|
13193
|
+
React__default.createElement(Skeleton$1, { width: "40%", height: "calc((100% - 16px) /3 )" }),
|
|
13194
|
+
React__default.createElement(SWAPSpace, { size: 8 }),
|
|
13195
|
+
React__default.createElement(Skeleton$1, { width: "100%", height: "calc((100% - 16px) /3 )" }),
|
|
13196
|
+
React__default.createElement(SWAPSpace, { size: 8 }),
|
|
13197
|
+
React__default.createElement("div", { style: {
|
|
13198
|
+
display: "flex",
|
|
13199
|
+
justifyContent: "space-between",
|
|
13200
|
+
width: "100%",
|
|
13201
|
+
height: "calc((100% - 16px) /3 )",
|
|
13202
|
+
} },
|
|
13203
|
+
React__default.createElement(Skeleton$1, { width: "26.4%", height: "100%" }),
|
|
13204
|
+
React__default.createElement(Skeleton$1, { width: "26.4%", height: "100%" }))))),
|
|
13205
|
+
React__default.createElement("div", { className: classes.buttonblock }, !loading ? (buttons === null || buttons === void 0 ? void 0 : buttons.map(function (i, index) { return (React__default.createElement(Button, { key: Math.random().toString(36).substr(2), fullWidth: true, variant: i.variant ? i.variant : "black", style: __assign({ borderRight: index + 1 === (buttons === null || buttons === void 0 ? void 0 : buttons.length)
|
|
13206
|
+
? undefined
|
|
13207
|
+
: "1px solid " + theme.black.black400, borderRadius: "0px 0px 0px 0px" }, i.style), onClick: i.onClick, disabled: i.disabled, loading: i.loading }, i.title)); })) : (React__default.createElement("div", { style: { padding: "16px 24px", width: "100%", height: 48 } },
|
|
13208
|
+
React__default.createElement(Skeleton$1, { width: "100%", height: "100%" }))))));
|
|
13209
|
+
};
|
|
13210
|
+
|
|
12648
13211
|
var Container = function (_a) {
|
|
12649
13212
|
var children = _a.children, style = _a.style, maxWidth = _a.maxWidth, padding = _a.padding;
|
|
12650
13213
|
var XXS = useBreakpoints("xxs");
|
|
@@ -12722,12 +13285,16 @@ Object.defineProperty(exports, 'createMuiTheme', {
|
|
|
12722
13285
|
});
|
|
12723
13286
|
exports.AutoComplete = AutoComplete;
|
|
12724
13287
|
exports.Banner = Banner;
|
|
13288
|
+
exports.Breadcrumb = Breadcrumb;
|
|
13289
|
+
exports.BreadcrumbItem = BreadcrumbItem;
|
|
12725
13290
|
exports.Button = Button;
|
|
13291
|
+
exports.Card = Card;
|
|
12726
13292
|
exports.CheckBox = CheckBox;
|
|
12727
13293
|
exports.CheckBoxList = CheckBoxList;
|
|
12728
13294
|
exports.Chip = Chip;
|
|
12729
13295
|
exports.CircularProgress = CircularProgress;
|
|
12730
13296
|
exports.Container = Container;
|
|
13297
|
+
exports.DatePicker = DatePicker;
|
|
12731
13298
|
exports.Dropdown = Dropdown;
|
|
12732
13299
|
exports.IconButton = IconButton;
|
|
12733
13300
|
exports.Link = Link;
|