@yosgo/swap-ui 1.0.118 → 1.0.122
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/TaxTextField/TaxTextField.types.d.ts +2 -0
- package/build/index.d.ts +5 -1
- package/build/index.esm.js +599 -35
- package/build/index.esm.js.map +1 -1
- package/build/index.js +601 -33
- 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"
|
|
@@ -6675,7 +6694,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
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,7 +6708,7 @@ 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);
|
|
@@ -7005,7 +7024,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7005
7024
|
pointerEvents: onExit ? "none" : "unset",
|
|
7006
7025
|
maxHeight: bodyMaxHeight
|
|
7007
7026
|
? bodyMaxHeight
|
|
7008
|
-
:
|
|
7027
|
+
: fullWidth
|
|
7009
7028
|
? clientHeight
|
|
7010
7029
|
: "unset",
|
|
7011
7030
|
overflowY: !onExit ? "scroll" : "hidden",
|
|
@@ -7045,7 +7064,10 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7045
7064
|
},
|
|
7046
7065
|
}); });
|
|
7047
7066
|
var classes = useStyles();
|
|
7048
|
-
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
|
+
} },
|
|
7049
7071
|
React__default.createElement(ModalTransitionEffect, { in: open, slide: fullWidth, style: {
|
|
7050
7072
|
outline: "none",
|
|
7051
7073
|
transition: "ease-in-out",
|
|
@@ -7126,12 +7148,15 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7126
7148
|
children))) : null,
|
|
7127
7149
|
(label || secondaryButton || primaryButton) && !disUnderLine ? (React__default.createElement(core.Divider, null)) : null,
|
|
7128
7150
|
React__default.createElement(core.Box, { className: classes.footer }, footer ? (footer) : (React__default.createElement(React__default.Fragment, null,
|
|
7129
|
-
!buttonFullWidth || !footerDisplayColumn ? (React__default.createElement(core.Box, { marginBottom: mobile ? (label ? "12px" : 0) : 0
|
|
7130
|
-
|
|
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,
|
|
7131
7156
|
secondaryButton || primaryButton ? (React__default.createElement(core.Box, { className: classes.footerButton },
|
|
7132
7157
|
React__default.createElement(core.Box, { width: mobile && !buttonFullWidth && !footerDisplayColumn
|
|
7133
7158
|
? null
|
|
7134
|
-
: "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
|
|
7135
7160
|
? secondaryButton.variant
|
|
7136
7161
|
: "secondary", size: "small", onClick: secondaryButton.onClick, disabled: secondaryButton.disabled, loading: secondaryButton.loading, style: secondaryButton.style }, secondaryButton.title)) : null),
|
|
7137
7162
|
React__default.createElement(core.Box, { width: "100%", marginBottom: footerDisplayColumn ? 1 : 0 }, primaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn || mobile, variant: primaryButton.variant
|
|
@@ -7223,7 +7248,7 @@ var useStyles$b = core.makeStyles(function () { return ({
|
|
|
7223
7248
|
height: props.height,
|
|
7224
7249
|
display: "flex",
|
|
7225
7250
|
alignItems: "center",
|
|
7226
|
-
justifyContent: "
|
|
7251
|
+
justifyContent: "center",
|
|
7227
7252
|
}); },
|
|
7228
7253
|
}); });
|
|
7229
7254
|
var Chip = function (props) {
|
|
@@ -7242,7 +7267,7 @@ var Chip = function (props) {
|
|
|
7242
7267
|
? theme.danger.danger50
|
|
7243
7268
|
: theme.primary.primary50,
|
|
7244
7269
|
width: width ? width : "fit-content",
|
|
7245
|
-
height: height ? height :
|
|
7270
|
+
height: height ? height : 24,
|
|
7246
7271
|
border: outlined || !contained
|
|
7247
7272
|
? variant === "neutral"
|
|
7248
7273
|
? "1px solid " + theme.black.black500
|
|
@@ -7254,7 +7279,7 @@ var Chip = function (props) {
|
|
|
7254
7279
|
? "1px solid " + theme.danger.danger800
|
|
7255
7280
|
: "1px solid " + theme.primary.primary800
|
|
7256
7281
|
: null,
|
|
7257
|
-
padding: outlined || !contained ? "
|
|
7282
|
+
padding: outlined || !contained ? "0px 8px" : "0px 9px",
|
|
7258
7283
|
};
|
|
7259
7284
|
var classes = useStyles$b(styleProps);
|
|
7260
7285
|
return (React__default.createElement("div", __assign({ className: classes.root }, other),
|
|
@@ -7266,9 +7291,11 @@ var Chip = function (props) {
|
|
|
7266
7291
|
? "success800"
|
|
7267
7292
|
: variant === "danger"
|
|
7268
7293
|
? "danger800"
|
|
7269
|
-
: "primary800", style: { marginRight:
|
|
7270
|
-
icon));
|
|
7271
|
-
};
|
|
7294
|
+
: "primary800", style: { marginRight: variant === "success" ? 4 : 0 } }, label),
|
|
7295
|
+
variant === "success" && !icon ? icon_success : icon));
|
|
7296
|
+
};
|
|
7297
|
+
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" },
|
|
7298
|
+
React__default.createElement("path", { d: "M14 4.66666L6 12.6667L2.33333 9L3.27333 8.06L6 10.78L13.06 3.72666L14 4.66666Z", fill: "#00821E" })));
|
|
7272
7299
|
|
|
7273
7300
|
var CircularProgress = function (props) {
|
|
7274
7301
|
var theme = core.useTheme();
|
|
@@ -11776,7 +11803,7 @@ var AutoComplete = function (props) {
|
|
|
11776
11803
|
};
|
|
11777
11804
|
|
|
11778
11805
|
var TaxTextField = function (_a) {
|
|
11779
|
-
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;
|
|
11806
|
+
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;
|
|
11780
11807
|
var _b = React.useState(""), modalIncome = _b[0], setModalIncome = _b[1];
|
|
11781
11808
|
var _c = React.useState(""), modalExpense = _c[0], setModalExpense = _c[1];
|
|
11782
11809
|
var handleModalTaxDescription = function () {
|
|
@@ -11833,7 +11860,7 @@ var TaxTextField = function (_a) {
|
|
|
11833
11860
|
justifyContent: "space-between",
|
|
11834
11861
|
} },
|
|
11835
11862
|
React__default.createElement("div", { style: { width: "100%" } },
|
|
11836
|
-
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) {
|
|
11863
|
+
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) {
|
|
11837
11864
|
setModalIncome(e.target.value);
|
|
11838
11865
|
setModalExpense("");
|
|
11839
11866
|
} },
|
|
@@ -11865,7 +11892,7 @@ var TaxTextField = function (_a) {
|
|
|
11865
11892
|
margin: mobile ? "24px 0 0 0 " : "0 0 0 8px",
|
|
11866
11893
|
} }, codeValue === "9B" ? (
|
|
11867
11894
|
// 9B Select
|
|
11868
|
-
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) {
|
|
11895
|
+
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) {
|
|
11869
11896
|
setModalExpense(e.target.value);
|
|
11870
11897
|
setAnchorEl(null);
|
|
11871
11898
|
} },
|
|
@@ -11894,7 +11921,7 @@ var TaxTextField = function (_a) {
|
|
|
11894
11921
|
option.label)); }))) : (
|
|
11895
11922
|
// 9A AutoComplete
|
|
11896
11923
|
React__default.createElement(React__default.Fragment, null,
|
|
11897
|
-
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: {
|
|
11924
|
+
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: {
|
|
11898
11925
|
endAdornment: (React__default.createElement("div", { style: { width: 24, height: 24 } },
|
|
11899
11926
|
React__default.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
11900
11927
|
React__default.createElement("path", { d: "M7 10L12 15L17 10H7Z", fill: "black" })))),
|
|
@@ -12637,6 +12664,543 @@ var Switch = function (props) {
|
|
|
12637
12664
|
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))));
|
|
12638
12665
|
};
|
|
12639
12666
|
|
|
12667
|
+
var useStylesForMonthButton = core.makeStyles(function (theme) { return ({
|
|
12668
|
+
root: function (props) { return ({
|
|
12669
|
+
width: "100%",
|
|
12670
|
+
height: "100%",
|
|
12671
|
+
borderRadius: 8,
|
|
12672
|
+
border: props.selected
|
|
12673
|
+
? "1px solid " + theme.primary.primary300
|
|
12674
|
+
: "1px solid " + theme.black.black500,
|
|
12675
|
+
boxSizing: "border-box",
|
|
12676
|
+
display: "flex",
|
|
12677
|
+
alignItems: "center",
|
|
12678
|
+
justifyContent: "center",
|
|
12679
|
+
fontSize: 14,
|
|
12680
|
+
fontWeight: 700,
|
|
12681
|
+
lineHeight: 1.4,
|
|
12682
|
+
backgroundColor: props.selected
|
|
12683
|
+
? theme.primary.primary50
|
|
12684
|
+
: theme.black.white,
|
|
12685
|
+
cursor: "pointer",
|
|
12686
|
+
"&:hover": {
|
|
12687
|
+
border: props.selected
|
|
12688
|
+
? "1px solid " + theme.primary.primary300
|
|
12689
|
+
: "1px solid " + theme.black.black600,
|
|
12690
|
+
backgroundColor: props.selected
|
|
12691
|
+
? theme.primary.primary50
|
|
12692
|
+
: theme.black.black100,
|
|
12693
|
+
},
|
|
12694
|
+
}); },
|
|
12695
|
+
}); });
|
|
12696
|
+
var useStylesForCalendar = core.makeStyles(function (theme) { return ({
|
|
12697
|
+
head: {
|
|
12698
|
+
width: "100%",
|
|
12699
|
+
display: "flex",
|
|
12700
|
+
alignItems: "center",
|
|
12701
|
+
justifyContent: "center",
|
|
12702
|
+
height: 48,
|
|
12703
|
+
fontSize: 14,
|
|
12704
|
+
fontWeight: 700,
|
|
12705
|
+
marginBottom: 8,
|
|
12706
|
+
position: "relative",
|
|
12707
|
+
},
|
|
12708
|
+
body: {
|
|
12709
|
+
display: "grid",
|
|
12710
|
+
gridTemplateColumns: "1fr 1fr 1fr 1fr 1fr 1fr 1fr",
|
|
12711
|
+
gap: 8,
|
|
12712
|
+
},
|
|
12713
|
+
days: {
|
|
12714
|
+
width: 32,
|
|
12715
|
+
height: 32,
|
|
12716
|
+
display: "flex",
|
|
12717
|
+
alignItems: "center",
|
|
12718
|
+
justifyContent: "center",
|
|
12719
|
+
fontSize: 14,
|
|
12720
|
+
color: theme.black.black600,
|
|
12721
|
+
},
|
|
12722
|
+
date: {
|
|
12723
|
+
width: 32,
|
|
12724
|
+
height: 32,
|
|
12725
|
+
display: "flex",
|
|
12726
|
+
alignItems: "center",
|
|
12727
|
+
justifyContent: "center",
|
|
12728
|
+
marginBottom: 4,
|
|
12729
|
+
fontSize: 14,
|
|
12730
|
+
fontWeight: 700,
|
|
12731
|
+
color: theme.black.black800,
|
|
12732
|
+
cursor: "pointer",
|
|
12733
|
+
borderRadius: "50%",
|
|
12734
|
+
"&:hover": {
|
|
12735
|
+
backgroundColor: theme.primary.primary50,
|
|
12736
|
+
},
|
|
12737
|
+
},
|
|
12738
|
+
}); });
|
|
12739
|
+
var DatePicker = function (props) {
|
|
12740
|
+
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"]);
|
|
12741
|
+
var _a = React.useState(Number(new Date().getFullYear())), year = _a[0], setYear = _a[1];
|
|
12742
|
+
var _b = React.useState(Number(new Date().getMonth() + 1)), month = _b[0], setMonth = _b[1];
|
|
12743
|
+
var _c = React.useState(1), nextMonth = _c[0], setNextMonth = _c[1];
|
|
12744
|
+
var _d = React.useState(""), date = _d[0], setDate = _d[1];
|
|
12745
|
+
var _e = React.useState(false), isOpenMonthSelector = _e[0], setIsOpenMonthSelector = _e[1];
|
|
12746
|
+
var _f = React.useState(false), isClicked = _f[0], setIsClicked = _f[1];
|
|
12747
|
+
React.useEffect(function () {
|
|
12748
|
+
if (format === "month") {
|
|
12749
|
+
if (month % 2 === 0) {
|
|
12750
|
+
setMonth(month - 1);
|
|
12751
|
+
}
|
|
12752
|
+
else {
|
|
12753
|
+
if (month < 1) {
|
|
12754
|
+
setMonth(11);
|
|
12755
|
+
setYear(year - 1);
|
|
12756
|
+
}
|
|
12757
|
+
if (month > 12) {
|
|
12758
|
+
setMonth(1);
|
|
12759
|
+
setYear(year + 1);
|
|
12760
|
+
}
|
|
12761
|
+
}
|
|
12762
|
+
}
|
|
12763
|
+
}, [month]);
|
|
12764
|
+
React.useEffect(function () {
|
|
12765
|
+
if (isClicked && getValue) {
|
|
12766
|
+
if (format === "month") {
|
|
12767
|
+
if (month < 1) {
|
|
12768
|
+
getValue(year - 1 + "-11");
|
|
12769
|
+
}
|
|
12770
|
+
else if (month > 12) {
|
|
12771
|
+
getValue(year + 1 + "-1");
|
|
12772
|
+
}
|
|
12773
|
+
else {
|
|
12774
|
+
getValue(year + "-" + month);
|
|
12775
|
+
}
|
|
12776
|
+
}
|
|
12777
|
+
else if (format === "day") {
|
|
12778
|
+
getValue(date.replace(/\//g, "-"));
|
|
12779
|
+
}
|
|
12780
|
+
else {
|
|
12781
|
+
getValue(String(year));
|
|
12782
|
+
}
|
|
12783
|
+
setIsClicked(false);
|
|
12784
|
+
}
|
|
12785
|
+
}, [isClicked]);
|
|
12786
|
+
React.useEffect(function () {
|
|
12787
|
+
if (value) {
|
|
12788
|
+
setDate(changeDateFormatToSlash(value));
|
|
12789
|
+
}
|
|
12790
|
+
}, [value]);
|
|
12791
|
+
return (React__default.createElement("div", __assign({}, other), format !== "day" ? (React__default.createElement("div", { style: {
|
|
12792
|
+
borderRadius: 8,
|
|
12793
|
+
border: "1px solid #cccccc",
|
|
12794
|
+
boxSizing: "border-box",
|
|
12795
|
+
width: format === "month" ? 219 : 180,
|
|
12796
|
+
height: 40,
|
|
12797
|
+
display: "grid",
|
|
12798
|
+
alignItems: "center",
|
|
12799
|
+
gridTemplateColumns: "36px 1px 1fr 1px 36px",
|
|
12800
|
+
position: "relative",
|
|
12801
|
+
} },
|
|
12802
|
+
React__default.createElement(IconButton, { onClick: function () {
|
|
12803
|
+
if (format === "month") {
|
|
12804
|
+
setMonth(month - 2);
|
|
12805
|
+
}
|
|
12806
|
+
else {
|
|
12807
|
+
setYear(year - 1);
|
|
12808
|
+
}
|
|
12809
|
+
setIsClicked(true);
|
|
12810
|
+
}, style: {
|
|
12811
|
+
width: "100%",
|
|
12812
|
+
height: "100%",
|
|
12813
|
+
display: "flex",
|
|
12814
|
+
justifyContent: "center",
|
|
12815
|
+
alignItems: "center",
|
|
12816
|
+
borderRadius: "8px 0 0 8px",
|
|
12817
|
+
} }, icon_arrowleft),
|
|
12818
|
+
verticalline,
|
|
12819
|
+
React__default.createElement("div", { style: {
|
|
12820
|
+
display: "flex",
|
|
12821
|
+
justifyContent: "center",
|
|
12822
|
+
alignItems: "center",
|
|
12823
|
+
} },
|
|
12824
|
+
icon_calendar,
|
|
12825
|
+
format === "month" ? (React__default.createElement("div", { style: {
|
|
12826
|
+
fontSize: 14,
|
|
12827
|
+
fontWeight: 700,
|
|
12828
|
+
lineHeight: 1.4,
|
|
12829
|
+
marginLeft: 4,
|
|
12830
|
+
cursor: "pointer",
|
|
12831
|
+
}, onClick: function () { return setIsOpenMonthSelector(!isOpenMonthSelector); } },
|
|
12832
|
+
year,
|
|
12833
|
+
"\u5E74",
|
|
12834
|
+
month,
|
|
12835
|
+
"-",
|
|
12836
|
+
month + 1,
|
|
12837
|
+
"\u6708")) : (React__default.createElement("div", { style: {
|
|
12838
|
+
fontSize: 14,
|
|
12839
|
+
fontWeight: 700,
|
|
12840
|
+
lineHeight: 1.4,
|
|
12841
|
+
marginLeft: 4,
|
|
12842
|
+
} },
|
|
12843
|
+
year,
|
|
12844
|
+
"\u5E74"))),
|
|
12845
|
+
verticalline,
|
|
12846
|
+
React__default.createElement(IconButton, { onClick: function () {
|
|
12847
|
+
if (format === "month") {
|
|
12848
|
+
setMonth(month + 2);
|
|
12849
|
+
}
|
|
12850
|
+
else {
|
|
12851
|
+
setYear(year + 1);
|
|
12852
|
+
}
|
|
12853
|
+
setIsClicked(true);
|
|
12854
|
+
}, style: {
|
|
12855
|
+
width: "100%",
|
|
12856
|
+
height: "100%",
|
|
12857
|
+
display: "flex",
|
|
12858
|
+
justifyContent: "center",
|
|
12859
|
+
alignItems: "center",
|
|
12860
|
+
borderRadius: "0 8px 8px 0",
|
|
12861
|
+
} }, icon_arrowright),
|
|
12862
|
+
format === "month" ? (React__default.createElement(core.Grow, { in: isOpenMonthSelector, style: { transformOrigin: "0 0 0" } },
|
|
12863
|
+
React__default.createElement("div", { style: {
|
|
12864
|
+
border: "1px solid #cccccc",
|
|
12865
|
+
borderRadius: 8,
|
|
12866
|
+
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
12867
|
+
boxSizing: "border-box",
|
|
12868
|
+
width: 302,
|
|
12869
|
+
height: 160,
|
|
12870
|
+
position: "absolute",
|
|
12871
|
+
backgroundColor: "#ffffff",
|
|
12872
|
+
zIndex: 1,
|
|
12873
|
+
top: 52,
|
|
12874
|
+
left: 0,
|
|
12875
|
+
} },
|
|
12876
|
+
React__default.createElement("div", { style: {
|
|
12877
|
+
height: 48,
|
|
12878
|
+
padding: 8,
|
|
12879
|
+
display: "grid",
|
|
12880
|
+
gridTemplateColumns: "32px 1fr 32px",
|
|
12881
|
+
gap: 13,
|
|
12882
|
+
alignItems: "center",
|
|
12883
|
+
boxShadow: "0px 1px 0px #ECECEC",
|
|
12884
|
+
} },
|
|
12885
|
+
React__default.createElement(IconButton, { hoverColor: "black400", onClick: function () {
|
|
12886
|
+
setYear(year - 1);
|
|
12887
|
+
setIsClicked(true);
|
|
12888
|
+
} }, icon_arrowleft),
|
|
12889
|
+
React__default.createElement(Typography, { variant: "subtitle", style: { textAlign: "center" } },
|
|
12890
|
+
year,
|
|
12891
|
+
"\u5E74"),
|
|
12892
|
+
React__default.createElement(IconButton, { hoverColor: "black400", onClick: function () {
|
|
12893
|
+
setYear(year + 1);
|
|
12894
|
+
setIsClicked(true);
|
|
12895
|
+
} }, icon_arrowright)),
|
|
12896
|
+
React__default.createElement("div", { style: {
|
|
12897
|
+
padding: 16,
|
|
12898
|
+
display: "grid",
|
|
12899
|
+
alignItems: "center",
|
|
12900
|
+
gap: 8,
|
|
12901
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
12902
|
+
gridTemplateRows: "36px 36px",
|
|
12903
|
+
} }, 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" },
|
|
12904
|
+
React__default.createElement("span", { style: { fontWeight: 400 } }, "\u5DF2\u9078\u64C7\uFF1A"),
|
|
12905
|
+
date &&
|
|
12906
|
+
date.split("/")[0] + "\u5E74" + date.split("/")[1] + "\u6708" + date.split("/")[2] + "\u65E5")) : (React__default.createElement(React__default.Fragment, null,
|
|
12907
|
+
React__default.createElement(Typography, { variant: "caption2" },
|
|
12908
|
+
React__default.createElement("span", { style: { fontWeight: 400 } }, "\u5DF2\u9078\u64C7\uFF1A")),
|
|
12909
|
+
React__default.createElement(Typography, { variant: "subtitle" }, date &&
|
|
12910
|
+
date.split("/")[0] + "\u5E74" + date.split("/")[1] + "\u6708" + date.split("/")[2] + "\u65E5"))), primaryButton: {
|
|
12911
|
+
title: "確認",
|
|
12912
|
+
onClick: function () {
|
|
12913
|
+
onClose();
|
|
12914
|
+
},
|
|
12915
|
+
}, secondaryButton: { title: "取消", onClick: onClose }, children: !mobile ? (React__default.createElement("div", { style: { display: "flex", justifyContent: "space-between" } },
|
|
12916
|
+
React__default.createElement(Calendar, { month: month, year: year, date: date, setDate: setDate, min: min, max: max, position: "left", leftClick: function () {
|
|
12917
|
+
if (month - 1 < 1) {
|
|
12918
|
+
setMonth(12);
|
|
12919
|
+
setYear(year - 1);
|
|
12920
|
+
}
|
|
12921
|
+
else {
|
|
12922
|
+
setMonth(month - 1);
|
|
12923
|
+
}
|
|
12924
|
+
setNextMonth(month);
|
|
12925
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked }),
|
|
12926
|
+
React__default.createElement(Calendar, { month: nextMonth, year: month > nextMonth ? year + 1 : year, date: date, setDate: setDate, min: min, max: max, position: "right", rightClick: function () {
|
|
12927
|
+
if (nextMonth + 1 > 12) {
|
|
12928
|
+
setMonth(12);
|
|
12929
|
+
setNextMonth(1);
|
|
12930
|
+
}
|
|
12931
|
+
else if (month + 1 > 12) {
|
|
12932
|
+
setMonth(1);
|
|
12933
|
+
setNextMonth(2);
|
|
12934
|
+
setYear(year + 1);
|
|
12935
|
+
}
|
|
12936
|
+
else {
|
|
12937
|
+
setMonth(month + 1);
|
|
12938
|
+
setNextMonth(nextMonth + 1);
|
|
12939
|
+
}
|
|
12940
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked }))) : (React__default.createElement(Calendar, { month: month, year: year, date: date, setDate: setDate, min: min, max: max, position: "left", leftClick: function () {
|
|
12941
|
+
if (month - 1 < 1) {
|
|
12942
|
+
setMonth(12);
|
|
12943
|
+
setYear(year - 1);
|
|
12944
|
+
}
|
|
12945
|
+
else {
|
|
12946
|
+
setMonth(month - 1);
|
|
12947
|
+
}
|
|
12948
|
+
setNextMonth(month);
|
|
12949
|
+
}, rightClick: function () {
|
|
12950
|
+
if (nextMonth + 1 > 12) {
|
|
12951
|
+
setMonth(12);
|
|
12952
|
+
setNextMonth(1);
|
|
12953
|
+
}
|
|
12954
|
+
else if (month + 1 > 12) {
|
|
12955
|
+
setMonth(1);
|
|
12956
|
+
setNextMonth(2);
|
|
12957
|
+
setYear(year + 1);
|
|
12958
|
+
}
|
|
12959
|
+
else {
|
|
12960
|
+
setMonth(month + 1);
|
|
12961
|
+
setNextMonth(nextMonth + 1);
|
|
12962
|
+
}
|
|
12963
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked, mobile: mobile })) }, ModalProps)))));
|
|
12964
|
+
};
|
|
12965
|
+
var MonthButton = function (_a) {
|
|
12966
|
+
var index = _a.index, month = _a.month, setMonth = _a.setMonth, setIsOpenMonthSelector = _a.setIsOpenMonthSelector, setIsClicked = _a.setIsClicked;
|
|
12967
|
+
var styleProps = {
|
|
12968
|
+
selected: 1 + 2 * index === month,
|
|
12969
|
+
};
|
|
12970
|
+
var classes = useStylesForMonthButton(styleProps);
|
|
12971
|
+
return (React__default.createElement("div", { className: classes.root, onClick: function () {
|
|
12972
|
+
setMonth(1 + 2 * index);
|
|
12973
|
+
setIsOpenMonthSelector(false);
|
|
12974
|
+
setIsClicked(true);
|
|
12975
|
+
} },
|
|
12976
|
+
1 + 2 * index,
|
|
12977
|
+
"-",
|
|
12978
|
+
2 + 2 * index,
|
|
12979
|
+
"\u6708"));
|
|
12980
|
+
};
|
|
12981
|
+
var Calendar = function (_a) {
|
|
12982
|
+
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;
|
|
12983
|
+
var isBigMonth = (month <= 7 && month % 2 !== 0) || (month >= 8 && month % 2 === 0);
|
|
12984
|
+
var today = defaultValue
|
|
12985
|
+
? new Date(changeDateFormatToSlash(defaultValue))
|
|
12986
|
+
: new Date();
|
|
12987
|
+
var selectedYear = Number(date.split("/")[0]);
|
|
12988
|
+
var selectedMonth = Number(date.split("/")[1]);
|
|
12989
|
+
var selectedDate = Number(date.split("/")[2]);
|
|
12990
|
+
var msOfMin = min ? new Date(changeDateFormatToSlash(min)).getTime() : 0;
|
|
12991
|
+
var msOfMax = max ? new Date(changeDateFormatToSlash(max)).getTime() : 0;
|
|
12992
|
+
var msOfFirstDayOfMonth = new Date(year + "/" + month + "/1").getTime();
|
|
12993
|
+
var msOfLastDayOfMonth = new Date(year + "/" + month + "/" + (month === 2 ? (year % 4 === 0 ? 29 : 28) : isBigMonth ? 31 : 30)).getTime();
|
|
12994
|
+
var arrowDisabled = (msOfMin !== 0 && position === "left" && msOfFirstDayOfMonth <= msOfMin) ||
|
|
12995
|
+
(msOfMax !== 0 && position === "right" && msOfLastDayOfMonth >= msOfMax);
|
|
12996
|
+
var mobileLeftArrowDisabled = msOfMin !== 0 && msOfFirstDayOfMonth <= msOfMin;
|
|
12997
|
+
var mobileRightArrowDisabled = msOfMax !== 0 && msOfLastDayOfMonth >= msOfMax;
|
|
12998
|
+
var classes = useStylesForCalendar();
|
|
12999
|
+
var theme = core.useTheme();
|
|
13000
|
+
return (React__default.createElement("div", null,
|
|
13001
|
+
React__default.createElement("div", { className: classes.head },
|
|
13002
|
+
year,
|
|
13003
|
+
"\u5E74",
|
|
13004
|
+
month,
|
|
13005
|
+
"\u6708",
|
|
13006
|
+
!mobile ? (React__default.createElement(IconButton, { onClick: position === "left" ? leftClick : rightClick, disabled: arrowDisabled, style: {
|
|
13007
|
+
position: "absolute",
|
|
13008
|
+
left: position === "left" ? 8 : undefined,
|
|
13009
|
+
right: position === "left" ? undefined : 8,
|
|
13010
|
+
top: 8,
|
|
13011
|
+
opacity: arrowDisabled ? 0.4 : undefined,
|
|
13012
|
+
} }, position === "left" ? icon_arrowleft : icon_arrowright)) : (React__default.createElement(React__default.Fragment, null,
|
|
13013
|
+
React__default.createElement(IconButton, { onClick: leftClick, disabled: mobileLeftArrowDisabled, style: {
|
|
13014
|
+
position: "absolute",
|
|
13015
|
+
left: 8,
|
|
13016
|
+
top: 8,
|
|
13017
|
+
opacity: mobileLeftArrowDisabled ? 0.4 : undefined,
|
|
13018
|
+
} }, icon_arrowleft),
|
|
13019
|
+
React__default.createElement(IconButton, { onClick: rightClick, disabled: mobileRightArrowDisabled, style: {
|
|
13020
|
+
position: "absolute",
|
|
13021
|
+
right: 8,
|
|
13022
|
+
top: 8,
|
|
13023
|
+
opacity: mobileRightArrowDisabled ? 0.4 : undefined,
|
|
13024
|
+
} }, icon_arrowright)))),
|
|
13025
|
+
React__default.createElement("div", { className: classes.body },
|
|
13026
|
+
["日", "一", "二", "三", "四", "五", "六"].map(function (i) { return (React__default.createElement("div", { key: i, className: classes.days }, i)); }),
|
|
13027
|
+
Array.from(Array(month === 2
|
|
13028
|
+
? year % 4 === 0
|
|
13029
|
+
? 29 + firstDayOfMonth(year, month)
|
|
13030
|
+
: 28 + firstDayOfMonth(year, month)
|
|
13031
|
+
: isBigMonth
|
|
13032
|
+
? 31 + firstDayOfMonth(year, month)
|
|
13033
|
+
: 30 + firstDayOfMonth(year, month)).keys()).map(function (_i, i) {
|
|
13034
|
+
if (i + 1 <= firstDayOfMonth(year, month))
|
|
13035
|
+
return (React__default.createElement("div", { key: i, style: {
|
|
13036
|
+
width: 32,
|
|
13037
|
+
height: 32,
|
|
13038
|
+
} }));
|
|
13039
|
+
var dateNumber = i + 1 - firstDayOfMonth(year, month);
|
|
13040
|
+
var isSelected = year === selectedYear &&
|
|
13041
|
+
month === selectedMonth &&
|
|
13042
|
+
dateNumber === selectedDate;
|
|
13043
|
+
var isToday = year === today.getFullYear() &&
|
|
13044
|
+
month === today.getMonth() + 1 &&
|
|
13045
|
+
dateNumber === today.getDate();
|
|
13046
|
+
var msOfDate = new Date(year + "/" + month + "/" + dateNumber).getTime();
|
|
13047
|
+
var disabled = (msOfMin !== 0 && msOfDate < msOfMin) ||
|
|
13048
|
+
(msOfMax !== 0 && msOfDate > msOfMax);
|
|
13049
|
+
return (React__default.createElement("div", { key: i, className: classes.date, onClick: function () {
|
|
13050
|
+
setDate(year + "/" + month + "/" + dateNumber);
|
|
13051
|
+
setIsClicked(true);
|
|
13052
|
+
}, style: {
|
|
13053
|
+
backgroundColor: isSelected
|
|
13054
|
+
? theme.primary.primary400
|
|
13055
|
+
: isToday
|
|
13056
|
+
? theme.black.black400
|
|
13057
|
+
: undefined,
|
|
13058
|
+
color: isSelected ? theme.black.white : undefined,
|
|
13059
|
+
border: isSelected
|
|
13060
|
+
? "1px solid " + theme.primary.primary600
|
|
13061
|
+
: undefined,
|
|
13062
|
+
opacity: disabled ? 0.4 : undefined,
|
|
13063
|
+
pointerEvents: disabled ? "none" : undefined,
|
|
13064
|
+
} }, dateNumber));
|
|
13065
|
+
}))));
|
|
13066
|
+
};
|
|
13067
|
+
var firstDayOfMonth = function (year, month) {
|
|
13068
|
+
var firstDay = year + "/" + month + "/" + 1;
|
|
13069
|
+
return new Date(firstDay).getDay();
|
|
13070
|
+
};
|
|
13071
|
+
var changeDateFormatToSlash = function (date) {
|
|
13072
|
+
return date.replace(/-/g, "/");
|
|
13073
|
+
};
|
|
13074
|
+
var verticalline = (React__default.createElement("div", { style: { width: 1, height: "100%", backgroundColor: "#cccccc" } }));
|
|
13075
|
+
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" },
|
|
13076
|
+
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" })));
|
|
13077
|
+
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" },
|
|
13078
|
+
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" })));
|
|
13079
|
+
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" },
|
|
13080
|
+
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" })));
|
|
13081
|
+
|
|
13082
|
+
var Breadcrumb = function (props) {
|
|
13083
|
+
var maxItems = props.maxItems, separator = props.separator, children = props.children, other = __rest(props, ["maxItems", "separator", "children"]);
|
|
13084
|
+
var _a = React.useState(false), isHoverThreeDots = _a[0], setIsHoverThreeDots = _a[1];
|
|
13085
|
+
var _b = React.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
13086
|
+
var handleThreeDotsClick = function (event) {
|
|
13087
|
+
setAnchorEl(event.currentTarget);
|
|
13088
|
+
};
|
|
13089
|
+
var handleThreeDotsClose = function () {
|
|
13090
|
+
setAnchorEl(null);
|
|
13091
|
+
};
|
|
13092
|
+
return (React__default.createElement("div", __assign({ style: { display: "flex", alignItems: "center" } }, other),
|
|
13093
|
+
maxItems && (children === null || children === void 0 ? void 0 : children.length) > maxItems ? (
|
|
13094
|
+
/**隱藏內容 */
|
|
13095
|
+
React__default.createElement(React__default.Fragment, null,
|
|
13096
|
+
React__default.createElement("div", { style: {
|
|
13097
|
+
display: "flex",
|
|
13098
|
+
alignItems: "center",
|
|
13099
|
+
fontSize: 14,
|
|
13100
|
+
fontWeight: 400,
|
|
13101
|
+
} },
|
|
13102
|
+
children[0],
|
|
13103
|
+
React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"),
|
|
13104
|
+
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),
|
|
13105
|
+
React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/")),
|
|
13106
|
+
children
|
|
13107
|
+
.slice((children === null || children === void 0 ? void 0 : children.length) - maxItems + 1)
|
|
13108
|
+
.map(function (i, index) {
|
|
13109
|
+
return (React__default.createElement("div", { key: Math.random().toString(36).substr(2), style: {
|
|
13110
|
+
display: "flex",
|
|
13111
|
+
alignItems: "center",
|
|
13112
|
+
fontSize: 14,
|
|
13113
|
+
fontWeight: index + 1 === (children === null || children === void 0 ? void 0 : children.length) ? 700 : 400,
|
|
13114
|
+
} },
|
|
13115
|
+
i,
|
|
13116
|
+
index + 1 !== maxItems - 1 && (React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"))));
|
|
13117
|
+
}))) : (children === null || children === void 0 ? void 0 : children.map(function (i, index) {
|
|
13118
|
+
return (React__default.createElement("div", { key: Math.random().toString(36).substr(2), style: {
|
|
13119
|
+
display: "flex",
|
|
13120
|
+
alignItems: "center",
|
|
13121
|
+
fontSize: 14,
|
|
13122
|
+
fontWeight: index + 1 === (children === null || children === void 0 ? void 0 : children.length) ? 700 : 400,
|
|
13123
|
+
} },
|
|
13124
|
+
i,
|
|
13125
|
+
index + 1 !== (children === null || children === void 0 ? void 0 : children.length) && (React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"))));
|
|
13126
|
+
})),
|
|
13127
|
+
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) {
|
|
13128
|
+
var content = i.props.children;
|
|
13129
|
+
var href = i.props.href;
|
|
13130
|
+
var target = i.props.target;
|
|
13131
|
+
console.log(target);
|
|
13132
|
+
return (React__default.createElement(MenuItem, { key: Math.random().toString(36).substr(2), onClick: function () {
|
|
13133
|
+
if (target && target === "_blank") {
|
|
13134
|
+
window.open(href);
|
|
13135
|
+
}
|
|
13136
|
+
else {
|
|
13137
|
+
window.location.href = href;
|
|
13138
|
+
}
|
|
13139
|
+
} }, content));
|
|
13140
|
+
}))));
|
|
13141
|
+
};
|
|
13142
|
+
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" },
|
|
13143
|
+
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" })));
|
|
13144
|
+
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" },
|
|
13145
|
+
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" }),
|
|
13146
|
+
React__default.createElement("path", { d: "M0 18.1H11.685V18.8H0V18.1Z", fill: "#4B4B4B" })));
|
|
13147
|
+
|
|
13148
|
+
var BreadcrumbItem = function (props) {
|
|
13149
|
+
var last = props.last, other = __rest(props, ["last"]);
|
|
13150
|
+
return (React__default.createElement(Link, __assign({}, other, { color: last ? "black1000" : "black800", style: {
|
|
13151
|
+
fontWeight: last ? 700 : 400,
|
|
13152
|
+
cursor: last ? "unset" : undefined,
|
|
13153
|
+
textDecoration: last ? "none" : undefined,
|
|
13154
|
+
} })));
|
|
13155
|
+
};
|
|
13156
|
+
|
|
13157
|
+
var useStyles$n = core.makeStyles(function (theme) { return ({
|
|
13158
|
+
root: function (props) { return ({
|
|
13159
|
+
width: props.width ? props.width : 350,
|
|
13160
|
+
height: props.height ? props.height : "100%",
|
|
13161
|
+
backgroundColor: theme.black.white,
|
|
13162
|
+
boxSizing: "border-box",
|
|
13163
|
+
border: "1px solid " + theme.black.black500,
|
|
13164
|
+
borderRadius: 8,
|
|
13165
|
+
display: "flex",
|
|
13166
|
+
flexDirection: "column",
|
|
13167
|
+
justifyContent: "space-between",
|
|
13168
|
+
overflow: "hidden",
|
|
13169
|
+
}); },
|
|
13170
|
+
body: { padding: 24, width: "100%", height: "100%" },
|
|
13171
|
+
buttonblock: {
|
|
13172
|
+
width: "100%",
|
|
13173
|
+
boxShadow: "0px -1px 0px " + theme.black.black400,
|
|
13174
|
+
borderRadius: " 0px 0px 8px 8px",
|
|
13175
|
+
display: "flex",
|
|
13176
|
+
padding: 0,
|
|
13177
|
+
},
|
|
13178
|
+
}); });
|
|
13179
|
+
var Card = function (props) {
|
|
13180
|
+
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"]);
|
|
13181
|
+
var useStylesProps = { width: width, height: height };
|
|
13182
|
+
var classes = useStyles$n(useStylesProps);
|
|
13183
|
+
var theme = core.useTheme();
|
|
13184
|
+
return (React__default.createElement("div", __assign({ className: classes.root }, other),
|
|
13185
|
+
React__default.createElement("div", { className: classes.body, style: bodyStyle }, !loading ? (children) : (React__default.createElement("div", { style: { width: "100%", height: "100%" } },
|
|
13186
|
+
React__default.createElement(Skeleton$1, { width: "40%", height: "calc((100% - 16px) /3 )" }),
|
|
13187
|
+
React__default.createElement(SWAPSpace, { size: 8 }),
|
|
13188
|
+
React__default.createElement(Skeleton$1, { width: "100%", height: "calc((100% - 16px) /3 )" }),
|
|
13189
|
+
React__default.createElement(SWAPSpace, { size: 8 }),
|
|
13190
|
+
React__default.createElement("div", { style: {
|
|
13191
|
+
display: "flex",
|
|
13192
|
+
justifyContent: "space-between",
|
|
13193
|
+
width: "100%",
|
|
13194
|
+
height: "calc((100% - 16px) /3 )",
|
|
13195
|
+
} },
|
|
13196
|
+
React__default.createElement(Skeleton$1, { width: "26.4%", height: "100%" }),
|
|
13197
|
+
React__default.createElement(Skeleton$1, { width: "26.4%", height: "100%" }))))),
|
|
13198
|
+
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)
|
|
13199
|
+
? undefined
|
|
13200
|
+
: "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 } },
|
|
13201
|
+
React__default.createElement(Skeleton$1, { width: "100%", height: "100%" }))))));
|
|
13202
|
+
};
|
|
13203
|
+
|
|
12640
13204
|
var Container = function (_a) {
|
|
12641
13205
|
var children = _a.children, style = _a.style, maxWidth = _a.maxWidth, padding = _a.padding;
|
|
12642
13206
|
var XXS = useBreakpoints("xxs");
|
|
@@ -12714,12 +13278,16 @@ Object.defineProperty(exports, 'createMuiTheme', {
|
|
|
12714
13278
|
});
|
|
12715
13279
|
exports.AutoComplete = AutoComplete;
|
|
12716
13280
|
exports.Banner = Banner;
|
|
13281
|
+
exports.Breadcrumb = Breadcrumb;
|
|
13282
|
+
exports.BreadcrumbItem = BreadcrumbItem;
|
|
12717
13283
|
exports.Button = Button;
|
|
13284
|
+
exports.Card = Card;
|
|
12718
13285
|
exports.CheckBox = CheckBox;
|
|
12719
13286
|
exports.CheckBoxList = CheckBoxList;
|
|
12720
13287
|
exports.Chip = Chip;
|
|
12721
13288
|
exports.CircularProgress = CircularProgress;
|
|
12722
13289
|
exports.Container = Container;
|
|
13290
|
+
exports.DatePicker = DatePicker;
|
|
12723
13291
|
exports.Dropdown = Dropdown;
|
|
12724
13292
|
exports.IconButton = IconButton;
|
|
12725
13293
|
exports.Link = Link;
|