@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.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppBar, Toolbar, Container as Container$1, Grid, Button as Button$1, Typography as Typography$1, IconButton as IconButton$1, Menu as Menu$1, MenuItem as MenuItem$1, Divider, Fade, Paper as Paper$1, TextField as TextField$1, Dialog, Modal as Modal$1, Breadcrumbs, Slide, FormControl, InputLabel, Select as Select$1, CssBaseline, Box, useTheme as useTheme$1, makeStyles as makeStyles$1, useMediaQuery, FormControlLabel, OutlinedInput, FormHelperText, ListItemIcon, Backdrop, fade as fade$1, Popper as Popper$1, InputBase } from '@material-ui/core';
|
|
1
|
+
import { AppBar, Toolbar, Container as Container$1, Grid, Button as Button$1, Typography as Typography$1, IconButton as IconButton$1, Menu as Menu$1, MenuItem as MenuItem$1, Divider, Fade, Paper as Paper$1, TextField as TextField$1, Dialog, Modal as Modal$1, Breadcrumbs, Slide, FormControl, InputLabel, Select as Select$1, CssBaseline, Box, useTheme as useTheme$1, makeStyles as makeStyles$1, useMediaQuery, FormControlLabel, OutlinedInput, FormHelperText, ListItemIcon, Backdrop, fade as fade$1, Popper as Popper$1, InputBase, Grow } from '@material-ui/core';
|
|
2
2
|
export { CssBaseline } from '@material-ui/core';
|
|
3
3
|
import React__default, { useEffect, useState, Component as Component$1, forwardRef, useRef, useLayoutEffect as useLayoutEffect$1, useCallback, createElement, createContext, useContext, useMemo, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -2695,14 +2695,22 @@ var RadioButton = function (props) {
|
|
|
2695
2695
|
};
|
|
2696
2696
|
|
|
2697
2697
|
var useStyles$2 = makeStyles$1(function (theme) { return ({
|
|
2698
|
+
root: {
|
|
2699
|
+
"& .MuiFormHelperText-contained": {
|
|
2700
|
+
marginLeft: 16,
|
|
2701
|
+
marginRight: 16,
|
|
2702
|
+
},
|
|
2703
|
+
},
|
|
2698
2704
|
inputRoot: function (props) { return ({
|
|
2699
2705
|
width: props.width,
|
|
2700
2706
|
height: props.height,
|
|
2701
2707
|
padding: "0px 16px",
|
|
2702
2708
|
backgroundColor: "white",
|
|
2703
2709
|
fontSize: 16,
|
|
2704
|
-
lineHeight:
|
|
2710
|
+
lineHeight: "unset",
|
|
2705
2711
|
fontWeight: 400,
|
|
2712
|
+
display: "flex",
|
|
2713
|
+
alignItems: "center",
|
|
2706
2714
|
"& fieldset": {
|
|
2707
2715
|
"& legend": {
|
|
2708
2716
|
width: "0.01px",
|
|
@@ -2710,11 +2718,9 @@ var useStyles$2 = makeStyles$1(function (theme) { return ({
|
|
|
2710
2718
|
borderColor: theme.black.black500,
|
|
2711
2719
|
},
|
|
2712
2720
|
"&.Mui-focused": {
|
|
2713
|
-
boxShadow:
|
|
2721
|
+
boxShadow: "0px 0px 0px 4px #D7DFF8",
|
|
2714
2722
|
"& fieldset": {
|
|
2715
|
-
border:
|
|
2716
|
-
? "1px solid " + theme.black.black1000 + " !important"
|
|
2717
|
-
: "1px solid " + theme.primary.primary400 + " !important",
|
|
2723
|
+
border: "1px solid " + theme.primary.primary400 + " !important",
|
|
2718
2724
|
borderWidth: "1px !important",
|
|
2719
2725
|
},
|
|
2720
2726
|
"&.Mui-error": {
|
|
@@ -2732,11 +2738,18 @@ var useStyles$2 = makeStyles$1(function (theme) { return ({
|
|
|
2732
2738
|
},
|
|
2733
2739
|
}); },
|
|
2734
2740
|
input: {
|
|
2741
|
+
fontSize: 16,
|
|
2742
|
+
lineHeight: "unset",
|
|
2743
|
+
fontWeight: 400,
|
|
2744
|
+
display: "flex",
|
|
2745
|
+
alignItems: "center",
|
|
2735
2746
|
"&:-webkit-autofill": {
|
|
2736
2747
|
"-webkit-box-shadow": "0 0 0 100px #FFFFFF inset",
|
|
2737
2748
|
},
|
|
2738
2749
|
"&::placeholder": { color: theme.black.black700, opacity: 1 },
|
|
2739
2750
|
padding: 0,
|
|
2751
|
+
margin: 0,
|
|
2752
|
+
height: "fit-content",
|
|
2740
2753
|
},
|
|
2741
2754
|
selectRoot: function (props) { return ({
|
|
2742
2755
|
borderRadius: 8,
|
|
@@ -2756,7 +2769,11 @@ var useStyles$2 = makeStyles$1(function (theme) { return ({
|
|
|
2756
2769
|
"&.Mui-error": { color: theme.black.black700 },
|
|
2757
2770
|
},
|
|
2758
2771
|
shrink: {
|
|
2759
|
-
transform: "translate(14px, -
|
|
2772
|
+
transform: "translate(14px, -10px) !important",
|
|
2773
|
+
height: 20,
|
|
2774
|
+
display: "flex",
|
|
2775
|
+
alignItems: "center",
|
|
2776
|
+
justifyContent: "center",
|
|
2760
2777
|
backgroundColor: "white",
|
|
2761
2778
|
fontSize: 14,
|
|
2762
2779
|
fontWeight: 700,
|
|
@@ -2778,7 +2795,7 @@ var TextField = function (props) {
|
|
|
2778
2795
|
select: select,
|
|
2779
2796
|
};
|
|
2780
2797
|
var classes = useStyles$2(styleProps);
|
|
2781
|
-
return (React__default.createElement(MaterialTextField, __assign({ fullWidth: fullWidth, select: select }, other, { variant: "outlined", InputProps: __assign({ classes: {
|
|
2798
|
+
return (React__default.createElement(MaterialTextField, __assign({ fullWidth: fullWidth, select: select }, other, { className: classes.root, variant: "outlined", InputProps: __assign({ classes: {
|
|
2782
2799
|
root: classes.inputRoot,
|
|
2783
2800
|
input: classes.input,
|
|
2784
2801
|
} }, InputProps), InputLabelProps: __assign({ classes: {
|
|
@@ -3102,7 +3119,7 @@ var Button = function (props) {
|
|
|
3102
3119
|
: variant === "secondary"
|
|
3103
3120
|
? theme.primary.primary400
|
|
3104
3121
|
: variant === "tertiary"
|
|
3105
|
-
? theme.
|
|
3122
|
+
? theme.black.black800
|
|
3106
3123
|
: variant === "text"
|
|
3107
3124
|
? theme.primary.primary400
|
|
3108
3125
|
: variant === "black"
|
|
@@ -3115,7 +3132,7 @@ var Button = function (props) {
|
|
|
3115
3132
|
: variant === "secondary"
|
|
3116
3133
|
? theme.black.white
|
|
3117
3134
|
: variant === "tertiary"
|
|
3118
|
-
? theme.
|
|
3135
|
+
? theme.black.black400
|
|
3119
3136
|
: variant === "text"
|
|
3120
3137
|
? theme.black.white
|
|
3121
3138
|
: variant === "black"
|
|
@@ -3160,7 +3177,7 @@ var Button = function (props) {
|
|
|
3160
3177
|
: variant === "secondary"
|
|
3161
3178
|
? theme.primary.primary50
|
|
3162
3179
|
: variant === "tertiary"
|
|
3163
|
-
? theme.
|
|
3180
|
+
? theme.black.black500
|
|
3164
3181
|
: variant === "text"
|
|
3165
3182
|
? theme.primary.primary50
|
|
3166
3183
|
: variant === "black"
|
|
@@ -3184,7 +3201,7 @@ var Button = function (props) {
|
|
|
3184
3201
|
: variant === "secondary"
|
|
3185
3202
|
? theme.primary.primary100
|
|
3186
3203
|
: variant === "tertiary"
|
|
3187
|
-
? theme.
|
|
3204
|
+
? theme.black.black600
|
|
3188
3205
|
: variant === "text"
|
|
3189
3206
|
? theme.primary.primary100
|
|
3190
3207
|
: variant === "black"
|
|
@@ -3198,13 +3215,15 @@ var Button = function (props) {
|
|
|
3198
3215
|
? "0px 0px 0px 4px #CCCCCC"
|
|
3199
3216
|
: variant === "danger"
|
|
3200
3217
|
? "0px 0px 0px 4px #FFCCD0"
|
|
3201
|
-
:
|
|
3218
|
+
: variant === "tertiary"
|
|
3219
|
+
? "0px 0px 0px 4px rgba(0, 0, 0, 0.1)"
|
|
3220
|
+
: "0px 0px 0px 4px #D7DFF8",
|
|
3202
3221
|
backgroundColor: variant === "primary"
|
|
3203
3222
|
? theme.primary.primary400
|
|
3204
3223
|
: variant === "secondary"
|
|
3205
3224
|
? theme.primary.primary50
|
|
3206
3225
|
: variant === "tertiary"
|
|
3207
|
-
? theme.
|
|
3226
|
+
? theme.black.black400
|
|
3208
3227
|
: variant === "text"
|
|
3209
3228
|
? theme.primary.primary50
|
|
3210
3229
|
: variant === "black"
|
|
@@ -3215,7 +3234,7 @@ var Button = function (props) {
|
|
|
3215
3234
|
border: variant === "secondary"
|
|
3216
3235
|
? "1px solid " + theme.primary.primary400
|
|
3217
3236
|
: variant === "tertiary"
|
|
3218
|
-
? "1px solid " + theme.
|
|
3237
|
+
? "1px solid " + theme.black.black600
|
|
3219
3238
|
: variant === "text"
|
|
3220
3239
|
? "1px solid " + theme.primary.primary400
|
|
3221
3240
|
: variant === "black"
|
|
@@ -3231,7 +3250,7 @@ var Button = function (props) {
|
|
|
3231
3250
|
: variant === "secondary"
|
|
3232
3251
|
? theme.black.white
|
|
3233
3252
|
: variant === "tertiary"
|
|
3234
|
-
? theme.
|
|
3253
|
+
? theme.black.black400
|
|
3235
3254
|
: variant === "text"
|
|
3236
3255
|
? theme.black.white
|
|
3237
3256
|
: variant === "black"
|
|
@@ -3244,7 +3263,7 @@ var Button = function (props) {
|
|
|
3244
3263
|
: variant === "secondary"
|
|
3245
3264
|
? theme.primary.primary400
|
|
3246
3265
|
: variant === "tertiary"
|
|
3247
|
-
? theme.
|
|
3266
|
+
? theme.black.black800
|
|
3248
3267
|
: variant === "text"
|
|
3249
3268
|
? theme.primary.primary400
|
|
3250
3269
|
: variant === "black"
|
|
@@ -6670,7 +6689,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
6670
6689
|
var _a = useState(0), clientHeight = _a[0], setClientHeight = _a[1];
|
|
6671
6690
|
var _b = useState(0), scorllbarWidth = _b[0], setScorllbarWidth = _b[1];
|
|
6672
6691
|
useEffect(function () {
|
|
6673
|
-
if (mobile
|
|
6692
|
+
if (mobile || fullWidth) {
|
|
6674
6693
|
if ((helpText || multiline) && !label) {
|
|
6675
6694
|
setClientHeight(window.innerHeight - 64 - 73 - 64);
|
|
6676
6695
|
}
|
|
@@ -6684,7 +6703,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
6684
6703
|
setClientHeight(window.innerHeight - 64 - 56 - 64);
|
|
6685
6704
|
}
|
|
6686
6705
|
}
|
|
6687
|
-
}, []);
|
|
6706
|
+
}, [fullWidth, mobile]);
|
|
6688
6707
|
useEffect(function () {
|
|
6689
6708
|
var scrollbar_width = window.innerWidth - document.body.clientWidth;
|
|
6690
6709
|
setScorllbarWidth(scrollbar_width / 2);
|
|
@@ -7000,7 +7019,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7000
7019
|
pointerEvents: onExit ? "none" : "unset",
|
|
7001
7020
|
maxHeight: bodyMaxHeight
|
|
7002
7021
|
? bodyMaxHeight
|
|
7003
|
-
:
|
|
7022
|
+
: fullWidth
|
|
7004
7023
|
? clientHeight
|
|
7005
7024
|
: "unset",
|
|
7006
7025
|
overflowY: !onExit ? "scroll" : "hidden",
|
|
@@ -7040,7 +7059,10 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7040
7059
|
},
|
|
7041
7060
|
}); });
|
|
7042
7061
|
var classes = useStyles();
|
|
7043
|
-
return (React__default.createElement(MaterialModal, { open: open, className: classes.root, BackdropComponent: Backdrop, BackdropProps: {
|
|
7062
|
+
return (React__default.createElement(MaterialModal, { open: open, className: classes.root, BackdropComponent: Backdrop, BackdropProps: {
|
|
7063
|
+
className: classes.backdrop,
|
|
7064
|
+
style: { overflow: "auto", WebkitOverflowScrolling: "touch" },
|
|
7065
|
+
} },
|
|
7044
7066
|
React__default.createElement(ModalTransitionEffect, { in: open, slide: fullWidth, style: {
|
|
7045
7067
|
outline: "none",
|
|
7046
7068
|
transition: "ease-in-out",
|
|
@@ -7121,12 +7143,15 @@ var Modal = React__default.forwardRef(function (props, ref) {
|
|
|
7121
7143
|
children))) : null,
|
|
7122
7144
|
(label || secondaryButton || primaryButton) && !disUnderLine ? (React__default.createElement(Divider, null)) : null,
|
|
7123
7145
|
React__default.createElement(Box, { className: classes.footer }, footer ? (footer) : (React__default.createElement(React__default.Fragment, null,
|
|
7124
|
-
!buttonFullWidth || !footerDisplayColumn ? (React__default.createElement(Box, { marginBottom: mobile ? (label ? "12px" : 0) : 0
|
|
7125
|
-
|
|
7146
|
+
!buttonFullWidth || !footerDisplayColumn ? (React__default.createElement(Box, { marginBottom: mobile ? (label ? "12px" : 0) : 0, style: {
|
|
7147
|
+
fontSize: mobile ? 16 : 18,
|
|
7148
|
+
fontWeight: 700,
|
|
7149
|
+
lineHeight: 1.4,
|
|
7150
|
+
} }, label)) : null,
|
|
7126
7151
|
secondaryButton || primaryButton ? (React__default.createElement(Box, { className: classes.footerButton },
|
|
7127
7152
|
React__default.createElement(Box, { width: mobile && !buttonFullWidth && !footerDisplayColumn
|
|
7128
7153
|
? null
|
|
7129
|
-
: "100%", marginRight: !footerDisplayColumn ? 1 : 0 }, secondaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn, variant: secondaryButton.variant
|
|
7154
|
+
: "100%", marginRight: !footerDisplayColumn && secondaryButton ? 1 : 0 }, secondaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn, variant: secondaryButton.variant
|
|
7130
7155
|
? secondaryButton.variant
|
|
7131
7156
|
: "secondary", size: "small", onClick: secondaryButton.onClick, disabled: secondaryButton.disabled, loading: secondaryButton.loading, style: secondaryButton.style }, secondaryButton.title)) : null),
|
|
7132
7157
|
React__default.createElement(Box, { width: "100%", marginBottom: footerDisplayColumn ? 1 : 0 }, primaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn || mobile, variant: primaryButton.variant
|
|
@@ -7218,7 +7243,7 @@ var useStyles$b = makeStyles$1(function () { return ({
|
|
|
7218
7243
|
height: props.height,
|
|
7219
7244
|
display: "flex",
|
|
7220
7245
|
alignItems: "center",
|
|
7221
|
-
justifyContent: "
|
|
7246
|
+
justifyContent: "center",
|
|
7222
7247
|
}); },
|
|
7223
7248
|
}); });
|
|
7224
7249
|
var Chip = function (props) {
|
|
@@ -7237,7 +7262,7 @@ var Chip = function (props) {
|
|
|
7237
7262
|
? theme.danger.danger50
|
|
7238
7263
|
: theme.primary.primary50,
|
|
7239
7264
|
width: width ? width : "fit-content",
|
|
7240
|
-
height: height ? height :
|
|
7265
|
+
height: height ? height : 24,
|
|
7241
7266
|
border: outlined || !contained
|
|
7242
7267
|
? variant === "neutral"
|
|
7243
7268
|
? "1px solid " + theme.black.black500
|
|
@@ -7249,7 +7274,7 @@ var Chip = function (props) {
|
|
|
7249
7274
|
? "1px solid " + theme.danger.danger800
|
|
7250
7275
|
: "1px solid " + theme.primary.primary800
|
|
7251
7276
|
: null,
|
|
7252
|
-
padding: outlined || !contained ? "
|
|
7277
|
+
padding: outlined || !contained ? "0px 8px" : "0px 9px",
|
|
7253
7278
|
};
|
|
7254
7279
|
var classes = useStyles$b(styleProps);
|
|
7255
7280
|
return (React__default.createElement("div", __assign({ className: classes.root }, other),
|
|
@@ -7261,9 +7286,11 @@ var Chip = function (props) {
|
|
|
7261
7286
|
? "success800"
|
|
7262
7287
|
: variant === "danger"
|
|
7263
7288
|
? "danger800"
|
|
7264
|
-
: "primary800", style: { marginRight:
|
|
7265
|
-
icon));
|
|
7266
|
-
};
|
|
7289
|
+
: "primary800", style: { marginRight: variant === "success" ? 4 : 0 } }, label),
|
|
7290
|
+
variant === "success" && !icon ? icon_success : icon));
|
|
7291
|
+
};
|
|
7292
|
+
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" },
|
|
7293
|
+
React__default.createElement("path", { d: "M14 4.66666L6 12.6667L2.33333 9L3.27333 8.06L6 10.78L13.06 3.72666L14 4.66666Z", fill: "#00821E" })));
|
|
7267
7294
|
|
|
7268
7295
|
var CircularProgress = function (props) {
|
|
7269
7296
|
var theme = useTheme$1();
|
|
@@ -11771,7 +11798,7 @@ var AutoComplete = function (props) {
|
|
|
11771
11798
|
};
|
|
11772
11799
|
|
|
11773
11800
|
var TaxTextField = function (_a) {
|
|
11774
|
-
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;
|
|
11801
|
+
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;
|
|
11775
11802
|
var _b = useState(""), modalIncome = _b[0], setModalIncome = _b[1];
|
|
11776
11803
|
var _c = useState(""), modalExpense = _c[0], setModalExpense = _c[1];
|
|
11777
11804
|
var handleModalTaxDescription = function () {
|
|
@@ -11828,7 +11855,7 @@ var TaxTextField = function (_a) {
|
|
|
11828
11855
|
justifyContent: "space-between",
|
|
11829
11856
|
} },
|
|
11830
11857
|
React__default.createElement("div", { style: { width: "100%" } },
|
|
11831
|
-
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) {
|
|
11858
|
+
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) {
|
|
11832
11859
|
setModalIncome(e.target.value);
|
|
11833
11860
|
setModalExpense("");
|
|
11834
11861
|
} },
|
|
@@ -11860,7 +11887,7 @@ var TaxTextField = function (_a) {
|
|
|
11860
11887
|
margin: mobile ? "24px 0 0 0 " : "0 0 0 8px",
|
|
11861
11888
|
} }, codeValue === "9B" ? (
|
|
11862
11889
|
// 9B Select
|
|
11863
|
-
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) {
|
|
11890
|
+
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) {
|
|
11864
11891
|
setModalExpense(e.target.value);
|
|
11865
11892
|
setAnchorEl(null);
|
|
11866
11893
|
} },
|
|
@@ -11889,7 +11916,7 @@ var TaxTextField = function (_a) {
|
|
|
11889
11916
|
option.label)); }))) : (
|
|
11890
11917
|
// 9A AutoComplete
|
|
11891
11918
|
React__default.createElement(React__default.Fragment, null,
|
|
11892
|
-
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: {
|
|
11919
|
+
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: {
|
|
11893
11920
|
endAdornment: (React__default.createElement("div", { style: { width: 24, height: 24 } },
|
|
11894
11921
|
React__default.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
11895
11922
|
React__default.createElement("path", { d: "M7 10L12 15L17 10H7Z", fill: "black" })))),
|
|
@@ -12632,6 +12659,543 @@ var Switch = function (props) {
|
|
|
12632
12659
|
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))));
|
|
12633
12660
|
};
|
|
12634
12661
|
|
|
12662
|
+
var useStylesForMonthButton = makeStyles$1(function (theme) { return ({
|
|
12663
|
+
root: function (props) { return ({
|
|
12664
|
+
width: "100%",
|
|
12665
|
+
height: "100%",
|
|
12666
|
+
borderRadius: 8,
|
|
12667
|
+
border: props.selected
|
|
12668
|
+
? "1px solid " + theme.primary.primary300
|
|
12669
|
+
: "1px solid " + theme.black.black500,
|
|
12670
|
+
boxSizing: "border-box",
|
|
12671
|
+
display: "flex",
|
|
12672
|
+
alignItems: "center",
|
|
12673
|
+
justifyContent: "center",
|
|
12674
|
+
fontSize: 14,
|
|
12675
|
+
fontWeight: 700,
|
|
12676
|
+
lineHeight: 1.4,
|
|
12677
|
+
backgroundColor: props.selected
|
|
12678
|
+
? theme.primary.primary50
|
|
12679
|
+
: theme.black.white,
|
|
12680
|
+
cursor: "pointer",
|
|
12681
|
+
"&:hover": {
|
|
12682
|
+
border: props.selected
|
|
12683
|
+
? "1px solid " + theme.primary.primary300
|
|
12684
|
+
: "1px solid " + theme.black.black600,
|
|
12685
|
+
backgroundColor: props.selected
|
|
12686
|
+
? theme.primary.primary50
|
|
12687
|
+
: theme.black.black100,
|
|
12688
|
+
},
|
|
12689
|
+
}); },
|
|
12690
|
+
}); });
|
|
12691
|
+
var useStylesForCalendar = makeStyles$1(function (theme) { return ({
|
|
12692
|
+
head: {
|
|
12693
|
+
width: "100%",
|
|
12694
|
+
display: "flex",
|
|
12695
|
+
alignItems: "center",
|
|
12696
|
+
justifyContent: "center",
|
|
12697
|
+
height: 48,
|
|
12698
|
+
fontSize: 14,
|
|
12699
|
+
fontWeight: 700,
|
|
12700
|
+
marginBottom: 8,
|
|
12701
|
+
position: "relative",
|
|
12702
|
+
},
|
|
12703
|
+
body: {
|
|
12704
|
+
display: "grid",
|
|
12705
|
+
gridTemplateColumns: "1fr 1fr 1fr 1fr 1fr 1fr 1fr",
|
|
12706
|
+
gap: 8,
|
|
12707
|
+
},
|
|
12708
|
+
days: {
|
|
12709
|
+
width: 32,
|
|
12710
|
+
height: 32,
|
|
12711
|
+
display: "flex",
|
|
12712
|
+
alignItems: "center",
|
|
12713
|
+
justifyContent: "center",
|
|
12714
|
+
fontSize: 14,
|
|
12715
|
+
color: theme.black.black600,
|
|
12716
|
+
},
|
|
12717
|
+
date: {
|
|
12718
|
+
width: 32,
|
|
12719
|
+
height: 32,
|
|
12720
|
+
display: "flex",
|
|
12721
|
+
alignItems: "center",
|
|
12722
|
+
justifyContent: "center",
|
|
12723
|
+
marginBottom: 4,
|
|
12724
|
+
fontSize: 14,
|
|
12725
|
+
fontWeight: 700,
|
|
12726
|
+
color: theme.black.black800,
|
|
12727
|
+
cursor: "pointer",
|
|
12728
|
+
borderRadius: "50%",
|
|
12729
|
+
"&:hover": {
|
|
12730
|
+
backgroundColor: theme.primary.primary50,
|
|
12731
|
+
},
|
|
12732
|
+
},
|
|
12733
|
+
}); });
|
|
12734
|
+
var DatePicker = function (props) {
|
|
12735
|
+
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"]);
|
|
12736
|
+
var _a = useState(Number(new Date().getFullYear())), year = _a[0], setYear = _a[1];
|
|
12737
|
+
var _b = useState(Number(new Date().getMonth() + 1)), month = _b[0], setMonth = _b[1];
|
|
12738
|
+
var _c = useState(1), nextMonth = _c[0], setNextMonth = _c[1];
|
|
12739
|
+
var _d = useState(""), date = _d[0], setDate = _d[1];
|
|
12740
|
+
var _e = useState(false), isOpenMonthSelector = _e[0], setIsOpenMonthSelector = _e[1];
|
|
12741
|
+
var _f = useState(false), isClicked = _f[0], setIsClicked = _f[1];
|
|
12742
|
+
useEffect(function () {
|
|
12743
|
+
if (format === "month") {
|
|
12744
|
+
if (month % 2 === 0) {
|
|
12745
|
+
setMonth(month - 1);
|
|
12746
|
+
}
|
|
12747
|
+
else {
|
|
12748
|
+
if (month < 1) {
|
|
12749
|
+
setMonth(11);
|
|
12750
|
+
setYear(year - 1);
|
|
12751
|
+
}
|
|
12752
|
+
if (month > 12) {
|
|
12753
|
+
setMonth(1);
|
|
12754
|
+
setYear(year + 1);
|
|
12755
|
+
}
|
|
12756
|
+
}
|
|
12757
|
+
}
|
|
12758
|
+
}, [month]);
|
|
12759
|
+
useEffect(function () {
|
|
12760
|
+
if (isClicked && getValue) {
|
|
12761
|
+
if (format === "month") {
|
|
12762
|
+
if (month < 1) {
|
|
12763
|
+
getValue(year - 1 + "-11");
|
|
12764
|
+
}
|
|
12765
|
+
else if (month > 12) {
|
|
12766
|
+
getValue(year + 1 + "-1");
|
|
12767
|
+
}
|
|
12768
|
+
else {
|
|
12769
|
+
getValue(year + "-" + month);
|
|
12770
|
+
}
|
|
12771
|
+
}
|
|
12772
|
+
else if (format === "day") {
|
|
12773
|
+
getValue(date.replace(/\//g, "-"));
|
|
12774
|
+
}
|
|
12775
|
+
else {
|
|
12776
|
+
getValue(String(year));
|
|
12777
|
+
}
|
|
12778
|
+
setIsClicked(false);
|
|
12779
|
+
}
|
|
12780
|
+
}, [isClicked]);
|
|
12781
|
+
useEffect(function () {
|
|
12782
|
+
if (value) {
|
|
12783
|
+
setDate(changeDateFormatToSlash(value));
|
|
12784
|
+
}
|
|
12785
|
+
}, [value]);
|
|
12786
|
+
return (React__default.createElement("div", __assign({}, other), format !== "day" ? (React__default.createElement("div", { style: {
|
|
12787
|
+
borderRadius: 8,
|
|
12788
|
+
border: "1px solid #cccccc",
|
|
12789
|
+
boxSizing: "border-box",
|
|
12790
|
+
width: format === "month" ? 219 : 180,
|
|
12791
|
+
height: 40,
|
|
12792
|
+
display: "grid",
|
|
12793
|
+
alignItems: "center",
|
|
12794
|
+
gridTemplateColumns: "36px 1px 1fr 1px 36px",
|
|
12795
|
+
position: "relative",
|
|
12796
|
+
} },
|
|
12797
|
+
React__default.createElement(IconButton, { onClick: function () {
|
|
12798
|
+
if (format === "month") {
|
|
12799
|
+
setMonth(month - 2);
|
|
12800
|
+
}
|
|
12801
|
+
else {
|
|
12802
|
+
setYear(year - 1);
|
|
12803
|
+
}
|
|
12804
|
+
setIsClicked(true);
|
|
12805
|
+
}, style: {
|
|
12806
|
+
width: "100%",
|
|
12807
|
+
height: "100%",
|
|
12808
|
+
display: "flex",
|
|
12809
|
+
justifyContent: "center",
|
|
12810
|
+
alignItems: "center",
|
|
12811
|
+
borderRadius: "8px 0 0 8px",
|
|
12812
|
+
} }, icon_arrowleft),
|
|
12813
|
+
verticalline,
|
|
12814
|
+
React__default.createElement("div", { style: {
|
|
12815
|
+
display: "flex",
|
|
12816
|
+
justifyContent: "center",
|
|
12817
|
+
alignItems: "center",
|
|
12818
|
+
} },
|
|
12819
|
+
icon_calendar,
|
|
12820
|
+
format === "month" ? (React__default.createElement("div", { style: {
|
|
12821
|
+
fontSize: 14,
|
|
12822
|
+
fontWeight: 700,
|
|
12823
|
+
lineHeight: 1.4,
|
|
12824
|
+
marginLeft: 4,
|
|
12825
|
+
cursor: "pointer",
|
|
12826
|
+
}, onClick: function () { return setIsOpenMonthSelector(!isOpenMonthSelector); } },
|
|
12827
|
+
year,
|
|
12828
|
+
"\u5E74",
|
|
12829
|
+
month,
|
|
12830
|
+
"-",
|
|
12831
|
+
month + 1,
|
|
12832
|
+
"\u6708")) : (React__default.createElement("div", { style: {
|
|
12833
|
+
fontSize: 14,
|
|
12834
|
+
fontWeight: 700,
|
|
12835
|
+
lineHeight: 1.4,
|
|
12836
|
+
marginLeft: 4,
|
|
12837
|
+
} },
|
|
12838
|
+
year,
|
|
12839
|
+
"\u5E74"))),
|
|
12840
|
+
verticalline,
|
|
12841
|
+
React__default.createElement(IconButton, { onClick: function () {
|
|
12842
|
+
if (format === "month") {
|
|
12843
|
+
setMonth(month + 2);
|
|
12844
|
+
}
|
|
12845
|
+
else {
|
|
12846
|
+
setYear(year + 1);
|
|
12847
|
+
}
|
|
12848
|
+
setIsClicked(true);
|
|
12849
|
+
}, style: {
|
|
12850
|
+
width: "100%",
|
|
12851
|
+
height: "100%",
|
|
12852
|
+
display: "flex",
|
|
12853
|
+
justifyContent: "center",
|
|
12854
|
+
alignItems: "center",
|
|
12855
|
+
borderRadius: "0 8px 8px 0",
|
|
12856
|
+
} }, icon_arrowright),
|
|
12857
|
+
format === "month" ? (React__default.createElement(Grow, { in: isOpenMonthSelector, style: { transformOrigin: "0 0 0" } },
|
|
12858
|
+
React__default.createElement("div", { style: {
|
|
12859
|
+
border: "1px solid #cccccc",
|
|
12860
|
+
borderRadius: 8,
|
|
12861
|
+
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
12862
|
+
boxSizing: "border-box",
|
|
12863
|
+
width: 302,
|
|
12864
|
+
height: 160,
|
|
12865
|
+
position: "absolute",
|
|
12866
|
+
backgroundColor: "#ffffff",
|
|
12867
|
+
zIndex: 1,
|
|
12868
|
+
top: 52,
|
|
12869
|
+
left: 0,
|
|
12870
|
+
} },
|
|
12871
|
+
React__default.createElement("div", { style: {
|
|
12872
|
+
height: 48,
|
|
12873
|
+
padding: 8,
|
|
12874
|
+
display: "grid",
|
|
12875
|
+
gridTemplateColumns: "32px 1fr 32px",
|
|
12876
|
+
gap: 13,
|
|
12877
|
+
alignItems: "center",
|
|
12878
|
+
boxShadow: "0px 1px 0px #ECECEC",
|
|
12879
|
+
} },
|
|
12880
|
+
React__default.createElement(IconButton, { hoverColor: "black400", onClick: function () {
|
|
12881
|
+
setYear(year - 1);
|
|
12882
|
+
setIsClicked(true);
|
|
12883
|
+
} }, icon_arrowleft),
|
|
12884
|
+
React__default.createElement(Typography, { variant: "subtitle", style: { textAlign: "center" } },
|
|
12885
|
+
year,
|
|
12886
|
+
"\u5E74"),
|
|
12887
|
+
React__default.createElement(IconButton, { hoverColor: "black400", onClick: function () {
|
|
12888
|
+
setYear(year + 1);
|
|
12889
|
+
setIsClicked(true);
|
|
12890
|
+
} }, icon_arrowright)),
|
|
12891
|
+
React__default.createElement("div", { style: {
|
|
12892
|
+
padding: 16,
|
|
12893
|
+
display: "grid",
|
|
12894
|
+
alignItems: "center",
|
|
12895
|
+
gap: 8,
|
|
12896
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
12897
|
+
gridTemplateRows: "36px 36px",
|
|
12898
|
+
} }, 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" },
|
|
12899
|
+
React__default.createElement("span", { style: { fontWeight: 400 } }, "\u5DF2\u9078\u64C7\uFF1A"),
|
|
12900
|
+
date &&
|
|
12901
|
+
date.split("/")[0] + "\u5E74" + date.split("/")[1] + "\u6708" + date.split("/")[2] + "\u65E5")) : (React__default.createElement(React__default.Fragment, null,
|
|
12902
|
+
React__default.createElement(Typography, { variant: "caption2" },
|
|
12903
|
+
React__default.createElement("span", { style: { fontWeight: 400 } }, "\u5DF2\u9078\u64C7\uFF1A")),
|
|
12904
|
+
React__default.createElement(Typography, { variant: "subtitle" }, date &&
|
|
12905
|
+
date.split("/")[0] + "\u5E74" + date.split("/")[1] + "\u6708" + date.split("/")[2] + "\u65E5"))), primaryButton: {
|
|
12906
|
+
title: "確認",
|
|
12907
|
+
onClick: function () {
|
|
12908
|
+
onClose();
|
|
12909
|
+
},
|
|
12910
|
+
}, secondaryButton: { title: "取消", onClick: onClose }, children: !mobile ? (React__default.createElement("div", { style: { display: "flex", justifyContent: "space-between" } },
|
|
12911
|
+
React__default.createElement(Calendar, { month: month, year: year, date: date, setDate: setDate, min: min, max: max, position: "left", leftClick: function () {
|
|
12912
|
+
if (month - 1 < 1) {
|
|
12913
|
+
setMonth(12);
|
|
12914
|
+
setYear(year - 1);
|
|
12915
|
+
}
|
|
12916
|
+
else {
|
|
12917
|
+
setMonth(month - 1);
|
|
12918
|
+
}
|
|
12919
|
+
setNextMonth(month);
|
|
12920
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked }),
|
|
12921
|
+
React__default.createElement(Calendar, { month: nextMonth, year: month > nextMonth ? year + 1 : year, date: date, setDate: setDate, min: min, max: max, position: "right", rightClick: function () {
|
|
12922
|
+
if (nextMonth + 1 > 12) {
|
|
12923
|
+
setMonth(12);
|
|
12924
|
+
setNextMonth(1);
|
|
12925
|
+
}
|
|
12926
|
+
else if (month + 1 > 12) {
|
|
12927
|
+
setMonth(1);
|
|
12928
|
+
setNextMonth(2);
|
|
12929
|
+
setYear(year + 1);
|
|
12930
|
+
}
|
|
12931
|
+
else {
|
|
12932
|
+
setMonth(month + 1);
|
|
12933
|
+
setNextMonth(nextMonth + 1);
|
|
12934
|
+
}
|
|
12935
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked }))) : (React__default.createElement(Calendar, { month: month, year: year, date: date, setDate: setDate, min: min, max: max, position: "left", leftClick: function () {
|
|
12936
|
+
if (month - 1 < 1) {
|
|
12937
|
+
setMonth(12);
|
|
12938
|
+
setYear(year - 1);
|
|
12939
|
+
}
|
|
12940
|
+
else {
|
|
12941
|
+
setMonth(month - 1);
|
|
12942
|
+
}
|
|
12943
|
+
setNextMonth(month);
|
|
12944
|
+
}, rightClick: function () {
|
|
12945
|
+
if (nextMonth + 1 > 12) {
|
|
12946
|
+
setMonth(12);
|
|
12947
|
+
setNextMonth(1);
|
|
12948
|
+
}
|
|
12949
|
+
else if (month + 1 > 12) {
|
|
12950
|
+
setMonth(1);
|
|
12951
|
+
setNextMonth(2);
|
|
12952
|
+
setYear(year + 1);
|
|
12953
|
+
}
|
|
12954
|
+
else {
|
|
12955
|
+
setMonth(month + 1);
|
|
12956
|
+
setNextMonth(nextMonth + 1);
|
|
12957
|
+
}
|
|
12958
|
+
}, defaultValue: defaultValue, setIsClicked: setIsClicked, mobile: mobile })) }, ModalProps)))));
|
|
12959
|
+
};
|
|
12960
|
+
var MonthButton = function (_a) {
|
|
12961
|
+
var index = _a.index, month = _a.month, setMonth = _a.setMonth, setIsOpenMonthSelector = _a.setIsOpenMonthSelector, setIsClicked = _a.setIsClicked;
|
|
12962
|
+
var styleProps = {
|
|
12963
|
+
selected: 1 + 2 * index === month,
|
|
12964
|
+
};
|
|
12965
|
+
var classes = useStylesForMonthButton(styleProps);
|
|
12966
|
+
return (React__default.createElement("div", { className: classes.root, onClick: function () {
|
|
12967
|
+
setMonth(1 + 2 * index);
|
|
12968
|
+
setIsOpenMonthSelector(false);
|
|
12969
|
+
setIsClicked(true);
|
|
12970
|
+
} },
|
|
12971
|
+
1 + 2 * index,
|
|
12972
|
+
"-",
|
|
12973
|
+
2 + 2 * index,
|
|
12974
|
+
"\u6708"));
|
|
12975
|
+
};
|
|
12976
|
+
var Calendar = function (_a) {
|
|
12977
|
+
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;
|
|
12978
|
+
var isBigMonth = (month <= 7 && month % 2 !== 0) || (month >= 8 && month % 2 === 0);
|
|
12979
|
+
var today = defaultValue
|
|
12980
|
+
? new Date(changeDateFormatToSlash(defaultValue))
|
|
12981
|
+
: new Date();
|
|
12982
|
+
var selectedYear = Number(date.split("/")[0]);
|
|
12983
|
+
var selectedMonth = Number(date.split("/")[1]);
|
|
12984
|
+
var selectedDate = Number(date.split("/")[2]);
|
|
12985
|
+
var msOfMin = min ? new Date(changeDateFormatToSlash(min)).getTime() : 0;
|
|
12986
|
+
var msOfMax = max ? new Date(changeDateFormatToSlash(max)).getTime() : 0;
|
|
12987
|
+
var msOfFirstDayOfMonth = new Date(year + "/" + month + "/1").getTime();
|
|
12988
|
+
var msOfLastDayOfMonth = new Date(year + "/" + month + "/" + (month === 2 ? (year % 4 === 0 ? 29 : 28) : isBigMonth ? 31 : 30)).getTime();
|
|
12989
|
+
var arrowDisabled = (msOfMin !== 0 && position === "left" && msOfFirstDayOfMonth <= msOfMin) ||
|
|
12990
|
+
(msOfMax !== 0 && position === "right" && msOfLastDayOfMonth >= msOfMax);
|
|
12991
|
+
var mobileLeftArrowDisabled = msOfMin !== 0 && msOfFirstDayOfMonth <= msOfMin;
|
|
12992
|
+
var mobileRightArrowDisabled = msOfMax !== 0 && msOfLastDayOfMonth >= msOfMax;
|
|
12993
|
+
var classes = useStylesForCalendar();
|
|
12994
|
+
var theme = useTheme$1();
|
|
12995
|
+
return (React__default.createElement("div", null,
|
|
12996
|
+
React__default.createElement("div", { className: classes.head },
|
|
12997
|
+
year,
|
|
12998
|
+
"\u5E74",
|
|
12999
|
+
month,
|
|
13000
|
+
"\u6708",
|
|
13001
|
+
!mobile ? (React__default.createElement(IconButton, { onClick: position === "left" ? leftClick : rightClick, disabled: arrowDisabled, style: {
|
|
13002
|
+
position: "absolute",
|
|
13003
|
+
left: position === "left" ? 8 : undefined,
|
|
13004
|
+
right: position === "left" ? undefined : 8,
|
|
13005
|
+
top: 8,
|
|
13006
|
+
opacity: arrowDisabled ? 0.4 : undefined,
|
|
13007
|
+
} }, position === "left" ? icon_arrowleft : icon_arrowright)) : (React__default.createElement(React__default.Fragment, null,
|
|
13008
|
+
React__default.createElement(IconButton, { onClick: leftClick, disabled: mobileLeftArrowDisabled, style: {
|
|
13009
|
+
position: "absolute",
|
|
13010
|
+
left: 8,
|
|
13011
|
+
top: 8,
|
|
13012
|
+
opacity: mobileLeftArrowDisabled ? 0.4 : undefined,
|
|
13013
|
+
} }, icon_arrowleft),
|
|
13014
|
+
React__default.createElement(IconButton, { onClick: rightClick, disabled: mobileRightArrowDisabled, style: {
|
|
13015
|
+
position: "absolute",
|
|
13016
|
+
right: 8,
|
|
13017
|
+
top: 8,
|
|
13018
|
+
opacity: mobileRightArrowDisabled ? 0.4 : undefined,
|
|
13019
|
+
} }, icon_arrowright)))),
|
|
13020
|
+
React__default.createElement("div", { className: classes.body },
|
|
13021
|
+
["日", "一", "二", "三", "四", "五", "六"].map(function (i) { return (React__default.createElement("div", { key: i, className: classes.days }, i)); }),
|
|
13022
|
+
Array.from(Array(month === 2
|
|
13023
|
+
? year % 4 === 0
|
|
13024
|
+
? 29 + firstDayOfMonth(year, month)
|
|
13025
|
+
: 28 + firstDayOfMonth(year, month)
|
|
13026
|
+
: isBigMonth
|
|
13027
|
+
? 31 + firstDayOfMonth(year, month)
|
|
13028
|
+
: 30 + firstDayOfMonth(year, month)).keys()).map(function (_i, i) {
|
|
13029
|
+
if (i + 1 <= firstDayOfMonth(year, month))
|
|
13030
|
+
return (React__default.createElement("div", { key: i, style: {
|
|
13031
|
+
width: 32,
|
|
13032
|
+
height: 32,
|
|
13033
|
+
} }));
|
|
13034
|
+
var dateNumber = i + 1 - firstDayOfMonth(year, month);
|
|
13035
|
+
var isSelected = year === selectedYear &&
|
|
13036
|
+
month === selectedMonth &&
|
|
13037
|
+
dateNumber === selectedDate;
|
|
13038
|
+
var isToday = year === today.getFullYear() &&
|
|
13039
|
+
month === today.getMonth() + 1 &&
|
|
13040
|
+
dateNumber === today.getDate();
|
|
13041
|
+
var msOfDate = new Date(year + "/" + month + "/" + dateNumber).getTime();
|
|
13042
|
+
var disabled = (msOfMin !== 0 && msOfDate < msOfMin) ||
|
|
13043
|
+
(msOfMax !== 0 && msOfDate > msOfMax);
|
|
13044
|
+
return (React__default.createElement("div", { key: i, className: classes.date, onClick: function () {
|
|
13045
|
+
setDate(year + "/" + month + "/" + dateNumber);
|
|
13046
|
+
setIsClicked(true);
|
|
13047
|
+
}, style: {
|
|
13048
|
+
backgroundColor: isSelected
|
|
13049
|
+
? theme.primary.primary400
|
|
13050
|
+
: isToday
|
|
13051
|
+
? theme.black.black400
|
|
13052
|
+
: undefined,
|
|
13053
|
+
color: isSelected ? theme.black.white : undefined,
|
|
13054
|
+
border: isSelected
|
|
13055
|
+
? "1px solid " + theme.primary.primary600
|
|
13056
|
+
: undefined,
|
|
13057
|
+
opacity: disabled ? 0.4 : undefined,
|
|
13058
|
+
pointerEvents: disabled ? "none" : undefined,
|
|
13059
|
+
} }, dateNumber));
|
|
13060
|
+
}))));
|
|
13061
|
+
};
|
|
13062
|
+
var firstDayOfMonth = function (year, month) {
|
|
13063
|
+
var firstDay = year + "/" + month + "/" + 1;
|
|
13064
|
+
return new Date(firstDay).getDay();
|
|
13065
|
+
};
|
|
13066
|
+
var changeDateFormatToSlash = function (date) {
|
|
13067
|
+
return date.replace(/-/g, "/");
|
|
13068
|
+
};
|
|
13069
|
+
var verticalline = (React__default.createElement("div", { style: { width: 1, height: "100%", backgroundColor: "#cccccc" } }));
|
|
13070
|
+
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" },
|
|
13071
|
+
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" })));
|
|
13072
|
+
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" },
|
|
13073
|
+
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" })));
|
|
13074
|
+
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" },
|
|
13075
|
+
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" })));
|
|
13076
|
+
|
|
13077
|
+
var Breadcrumb = function (props) {
|
|
13078
|
+
var maxItems = props.maxItems, separator = props.separator, children = props.children, other = __rest(props, ["maxItems", "separator", "children"]);
|
|
13079
|
+
var _a = useState(false), isHoverThreeDots = _a[0], setIsHoverThreeDots = _a[1];
|
|
13080
|
+
var _b = useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
13081
|
+
var handleThreeDotsClick = function (event) {
|
|
13082
|
+
setAnchorEl(event.currentTarget);
|
|
13083
|
+
};
|
|
13084
|
+
var handleThreeDotsClose = function () {
|
|
13085
|
+
setAnchorEl(null);
|
|
13086
|
+
};
|
|
13087
|
+
return (React__default.createElement("div", __assign({ style: { display: "flex", alignItems: "center" } }, other),
|
|
13088
|
+
maxItems && (children === null || children === void 0 ? void 0 : children.length) > maxItems ? (
|
|
13089
|
+
/**隱藏內容 */
|
|
13090
|
+
React__default.createElement(React__default.Fragment, null,
|
|
13091
|
+
React__default.createElement("div", { style: {
|
|
13092
|
+
display: "flex",
|
|
13093
|
+
alignItems: "center",
|
|
13094
|
+
fontSize: 14,
|
|
13095
|
+
fontWeight: 400,
|
|
13096
|
+
} },
|
|
13097
|
+
children[0],
|
|
13098
|
+
React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"),
|
|
13099
|
+
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),
|
|
13100
|
+
React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/")),
|
|
13101
|
+
children
|
|
13102
|
+
.slice((children === null || children === void 0 ? void 0 : children.length) - maxItems + 1)
|
|
13103
|
+
.map(function (i, index) {
|
|
13104
|
+
return (React__default.createElement("div", { key: Math.random().toString(36).substr(2), style: {
|
|
13105
|
+
display: "flex",
|
|
13106
|
+
alignItems: "center",
|
|
13107
|
+
fontSize: 14,
|
|
13108
|
+
fontWeight: index + 1 === (children === null || children === void 0 ? void 0 : children.length) ? 700 : 400,
|
|
13109
|
+
} },
|
|
13110
|
+
i,
|
|
13111
|
+
index + 1 !== maxItems - 1 && (React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"))));
|
|
13112
|
+
}))) : (children === null || children === void 0 ? void 0 : children.map(function (i, index) {
|
|
13113
|
+
return (React__default.createElement("div", { key: Math.random().toString(36).substr(2), style: {
|
|
13114
|
+
display: "flex",
|
|
13115
|
+
alignItems: "center",
|
|
13116
|
+
fontSize: 14,
|
|
13117
|
+
fontWeight: index + 1 === (children === null || children === void 0 ? void 0 : children.length) ? 700 : 400,
|
|
13118
|
+
} },
|
|
13119
|
+
i,
|
|
13120
|
+
index + 1 !== (children === null || children === void 0 ? void 0 : children.length) && (React__default.createElement(Typography, { variant: "body2", style: { margin: "0 8px" } }, separator ? separator : "/"))));
|
|
13121
|
+
})),
|
|
13122
|
+
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) {
|
|
13123
|
+
var content = i.props.children;
|
|
13124
|
+
var href = i.props.href;
|
|
13125
|
+
var target = i.props.target;
|
|
13126
|
+
console.log(target);
|
|
13127
|
+
return (React__default.createElement(MenuItem, { key: Math.random().toString(36).substr(2), onClick: function () {
|
|
13128
|
+
if (target && target === "_blank") {
|
|
13129
|
+
window.open(href);
|
|
13130
|
+
}
|
|
13131
|
+
else {
|
|
13132
|
+
window.location.href = href;
|
|
13133
|
+
}
|
|
13134
|
+
} }, content));
|
|
13135
|
+
}))));
|
|
13136
|
+
};
|
|
13137
|
+
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" },
|
|
13138
|
+
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" })));
|
|
13139
|
+
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" },
|
|
13140
|
+
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" }),
|
|
13141
|
+
React__default.createElement("path", { d: "M0 18.1H11.685V18.8H0V18.1Z", fill: "#4B4B4B" })));
|
|
13142
|
+
|
|
13143
|
+
var BreadcrumbItem = function (props) {
|
|
13144
|
+
var last = props.last, other = __rest(props, ["last"]);
|
|
13145
|
+
return (React__default.createElement(Link, __assign({}, other, { color: last ? "black1000" : "black800", style: {
|
|
13146
|
+
fontWeight: last ? 700 : 400,
|
|
13147
|
+
cursor: last ? "unset" : undefined,
|
|
13148
|
+
textDecoration: last ? "none" : undefined,
|
|
13149
|
+
} })));
|
|
13150
|
+
};
|
|
13151
|
+
|
|
13152
|
+
var useStyles$n = makeStyles$1(function (theme) { return ({
|
|
13153
|
+
root: function (props) { return ({
|
|
13154
|
+
width: props.width ? props.width : 350,
|
|
13155
|
+
height: props.height ? props.height : "100%",
|
|
13156
|
+
backgroundColor: theme.black.white,
|
|
13157
|
+
boxSizing: "border-box",
|
|
13158
|
+
border: "1px solid " + theme.black.black500,
|
|
13159
|
+
borderRadius: 8,
|
|
13160
|
+
display: "flex",
|
|
13161
|
+
flexDirection: "column",
|
|
13162
|
+
justifyContent: "space-between",
|
|
13163
|
+
overflow: "hidden",
|
|
13164
|
+
}); },
|
|
13165
|
+
body: { padding: 24, width: "100%", height: "100%" },
|
|
13166
|
+
buttonblock: {
|
|
13167
|
+
width: "100%",
|
|
13168
|
+
boxShadow: "0px -1px 0px " + theme.black.black400,
|
|
13169
|
+
borderRadius: " 0px 0px 8px 8px",
|
|
13170
|
+
display: "flex",
|
|
13171
|
+
padding: 0,
|
|
13172
|
+
},
|
|
13173
|
+
}); });
|
|
13174
|
+
var Card = function (props) {
|
|
13175
|
+
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"]);
|
|
13176
|
+
var useStylesProps = { width: width, height: height };
|
|
13177
|
+
var classes = useStyles$n(useStylesProps);
|
|
13178
|
+
var theme = useTheme$1();
|
|
13179
|
+
return (React__default.createElement("div", __assign({ className: classes.root }, other),
|
|
13180
|
+
React__default.createElement("div", { className: classes.body, style: bodyStyle }, !loading ? (children) : (React__default.createElement("div", { style: { width: "100%", height: "100%" } },
|
|
13181
|
+
React__default.createElement(Skeleton$1, { width: "40%", height: "calc((100% - 16px) /3 )" }),
|
|
13182
|
+
React__default.createElement(SWAPSpace, { size: 8 }),
|
|
13183
|
+
React__default.createElement(Skeleton$1, { width: "100%", height: "calc((100% - 16px) /3 )" }),
|
|
13184
|
+
React__default.createElement(SWAPSpace, { size: 8 }),
|
|
13185
|
+
React__default.createElement("div", { style: {
|
|
13186
|
+
display: "flex",
|
|
13187
|
+
justifyContent: "space-between",
|
|
13188
|
+
width: "100%",
|
|
13189
|
+
height: "calc((100% - 16px) /3 )",
|
|
13190
|
+
} },
|
|
13191
|
+
React__default.createElement(Skeleton$1, { width: "26.4%", height: "100%" }),
|
|
13192
|
+
React__default.createElement(Skeleton$1, { width: "26.4%", height: "100%" }))))),
|
|
13193
|
+
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)
|
|
13194
|
+
? undefined
|
|
13195
|
+
: "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 } },
|
|
13196
|
+
React__default.createElement(Skeleton$1, { width: "100%", height: "100%" }))))));
|
|
13197
|
+
};
|
|
13198
|
+
|
|
12635
13199
|
var Container = function (_a) {
|
|
12636
13200
|
var children = _a.children, style = _a.style, maxWidth = _a.maxWidth, padding = _a.padding;
|
|
12637
13201
|
var XXS = useBreakpoints("xxs");
|
|
@@ -12689,5 +13253,5 @@ var Container = function (_a) {
|
|
|
12689
13253
|
return (React__default.createElement(MaterialContainer, { className: classes.root, style: style }, children));
|
|
12690
13254
|
};
|
|
12691
13255
|
|
|
12692
|
-
export { AutoComplete, Banner, Button, CheckBox, CheckBoxList, Chip, CircularProgress, Container, Dropdown, IconButton, Link, Menu, MenuItem, Modal, Pagination$1 as Pagination, Paper, Progress, RadioButton, RadioList, SWAPAppBar, SWAPBanner, SWAPCopyField, SWAPDialog, SWAPExpenseTypes, SWAPIncomeTypes, SWAPLogo, SWAPModal, SWAPShare, SWAPSpace, SWAPTaxDescription, SWAPTaxExpenseLabel, SWAPTaxField, SWAPTaxIncomeLabel, SWAPTheme, SegmentedTab, SegmentedTabs, Select, Skeleton$1 as Skeleton, Snackbar, Styles, Switch, Tab, TabPanel, Tabs, TaxTextField, TextField, Tooltip, Typography, useBreakpoints };
|
|
13256
|
+
export { AutoComplete, Banner, Breadcrumb, BreadcrumbItem, Button, Card, CheckBox, CheckBoxList, Chip, CircularProgress, Container, DatePicker, Dropdown, IconButton, Link, Menu, MenuItem, Modal, Pagination$1 as Pagination, Paper, Progress, RadioButton, RadioList, SWAPAppBar, SWAPBanner, SWAPCopyField, SWAPDialog, SWAPExpenseTypes, SWAPIncomeTypes, SWAPLogo, SWAPModal, SWAPShare, SWAPSpace, SWAPTaxDescription, SWAPTaxExpenseLabel, SWAPTaxField, SWAPTaxIncomeLabel, SWAPTheme, SegmentedTab, SegmentedTabs, Select, Skeleton$1 as Skeleton, Snackbar, Styles, Switch, Tab, TabPanel, Tabs, TaxTextField, TextField, Tooltip, Typography, useBreakpoints };
|
|
12693
13257
|
//# sourceMappingURL=index.esm.js.map
|