tango-ui-cw 0.0.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +10 -10
- package/dist/index.mjs +1086 -849
- package/package.json +1 -1
- package/src/component/CSSFab/useTangoStyle.jsx +182 -182
- package/src/component/MaterialButton/{MaterialButton.css → MaterialButton.module.css} +64 -64
- package/src/component/MaterialButton/index.jsx +69 -58
- package/src/component/MaterialInput/{MaterialInput.css → MaterialInput.module.css} +37 -33
- package/src/component/MaterialInput/index.jsx +34 -29
- package/src/component/TButton/TButton.module.css +184 -0
- package/src/component/TButton/index.jsx +81 -74
- package/src/component/TColorPicker/{TColorPicker.css → TColorPicker.module.css} +24 -24
- package/src/component/TColorPicker/index.jsx +107 -106
- package/src/component/TDate/index.jsx +146 -148
- package/src/component/TDatePicker/TDatePicker.module.css +12 -0
- package/src/component/TDatePicker/index.jsx +72 -60
- package/src/component/TDrawer/{TDrawer.css → TDrawer.module.css} +203 -202
- package/src/component/TDrawer/index.jsx +80 -74
- package/src/component/TInput/{TInput.css → TInput.module.css} +67 -80
- package/src/component/TInput/index.jsx +95 -102
- package/src/component/TLayout/TLayout.css +88 -88
- package/src/component/TLayout/index.jsx +77 -77
- package/src/component/TLine/TLine.module.css +52 -0
- package/src/component/TLine/index.jsx +48 -57
- package/src/component/TMark/{TMark.css → TMark.module.css} +6 -6
- package/src/component/TMark/index.jsx +69 -78
- package/src/component/TModal/{TModal.css → TModal.module.css} +109 -108
- package/src/component/TModal/index.jsx +75 -69
- package/src/component/TNotice/{TNotice.css → TNotice.module.css} +50 -52
- package/src/component/TNotice/index.jsx +37 -38
- package/src/component/TNotice/useNotice.jsx +54 -54
- package/src/component/TSearch/{TSearch.css → TSearch.module.css} +80 -90
- package/src/component/TSearch/index.jsx +86 -100
- package/src/component/TSpace/TSpace.module.css +43 -0
- package/src/component/TSpace/index.jsx +60 -60
- package/src/component/TTable/{TTable.css → TTable.module.css} +26 -26
- package/src/component/TTable/index.jsx +73 -77
- package/src/component/TTooltip/TTooltip.module.css +66 -0
- package/src/component/TTooltip/index.jsx +33 -25
- package/src/component/Tango/store.js +105 -105
- package/src/component/Tools/WaterMark/WaterMark.jsx +78 -78
- package/src/component/TButton/TButton.css +0 -270
- package/src/component/TDate/TDate.css +0 -0
- package/src/component/TDatePicker/TDatePicker.css +0 -13
- package/src/component/TLine/TLine.css +0 -54
- package/src/component/TSpace/TSpace.css +0 -43
- package/src/component/TTooltip/TTooltip.css +0 -105
@@ -1,60 +1,72 @@
|
|
1
|
-
import React, { useState } from "react";
|
2
|
-
import PropTypes from "prop-types";
|
3
|
-
import "./TDatePicker.css";
|
4
|
-
import { useTangoStyle } from "../CSSFab/useTangoStyle";
|
5
|
-
|
6
|
-
export default function DatePicker(props) {
|
7
|
-
const {
|
8
|
-
sx = {},
|
9
|
-
style: userStyle = {},
|
10
|
-
className: userClassName = "",
|
11
|
-
disabled,
|
12
|
-
onChange,
|
13
|
-
time,
|
14
|
-
} = props;
|
15
|
-
|
16
|
-
const [value, setValue] = useState("");
|
17
|
-
|
18
|
-
const
|
19
|
-
const
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
const
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import PropTypes from "prop-types";
|
3
|
+
import styles from "./TDatePicker.module.css";
|
4
|
+
import { useTangoStyle } from "../CSSFab/useTangoStyle";
|
5
|
+
|
6
|
+
export default function DatePicker(props) {
|
7
|
+
const {
|
8
|
+
sx = {},
|
9
|
+
style: userStyle = {},
|
10
|
+
className: userClassName = "",
|
11
|
+
disabled,
|
12
|
+
onChange,
|
13
|
+
time,
|
14
|
+
} = props;
|
15
|
+
|
16
|
+
const [value, setValue] = useState("");
|
17
|
+
|
18
|
+
const formatDate = (date) => {
|
19
|
+
const d = new Date(date);
|
20
|
+
const year = d.getFullYear();
|
21
|
+
const month = (d.getMonth() + 1).toString().padStart(2, "0");
|
22
|
+
const day = d.getDate().toString().padStart(2, "0");
|
23
|
+
const hours = d.getHours().toString().padStart(2, "0");
|
24
|
+
const minutes = d.getMinutes().toString().padStart(2, "0");
|
25
|
+
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
26
|
+
};
|
27
|
+
|
28
|
+
const handleChange = (e) => {
|
29
|
+
const val = e.target.value;
|
30
|
+
setValue(val);
|
31
|
+
const formattedValue = time ? formatDate(val) : val;
|
32
|
+
if (onChange) onChange(formattedValue, val);
|
33
|
+
};
|
34
|
+
|
35
|
+
const inputType = time ? "datetime-local" : "date";
|
36
|
+
|
37
|
+
const className = `${styles.datePicker} ${
|
38
|
+
disabled ? styles.datePickerDisabled : ""
|
39
|
+
} ${userClassName}`;
|
40
|
+
|
41
|
+
const sxStyle = useTangoStyle(sx);
|
42
|
+
const combinedStyle = { ...sxStyle, ...userStyle };
|
43
|
+
|
44
|
+
return (
|
45
|
+
<input
|
46
|
+
type={inputType}
|
47
|
+
value={value}
|
48
|
+
onChange={handleChange}
|
49
|
+
className={className}
|
50
|
+
style={combinedStyle}
|
51
|
+
disabled={disabled}
|
52
|
+
/>
|
53
|
+
);
|
54
|
+
}
|
55
|
+
|
56
|
+
DatePicker.propTypes = {
|
57
|
+
sx: PropTypes.object,
|
58
|
+
style: PropTypes.object,
|
59
|
+
className: PropTypes.string,
|
60
|
+
disabled: PropTypes.bool,
|
61
|
+
onChange: PropTypes.func,
|
62
|
+
time: PropTypes.bool,
|
63
|
+
};
|
64
|
+
|
65
|
+
DatePicker.defaultProps = {
|
66
|
+
sx: {},
|
67
|
+
style: {},
|
68
|
+
className: "",
|
69
|
+
disabled: false,
|
70
|
+
onChange: () => {},
|
71
|
+
time: false,
|
72
|
+
};
|
@@ -1,202 +1,203 @@
|
|
1
|
-
.
|
2
|
-
position: fixed;
|
3
|
-
top: 0;
|
4
|
-
left: 0;
|
5
|
-
width: 100vw;
|
6
|
-
height: 100vh;
|
7
|
-
background-color: rgba(0, 0, 0, 0.5);
|
8
|
-
z-index: 999;
|
9
|
-
display: flex;
|
10
|
-
justify-content: flex-end;
|
11
|
-
}
|
12
|
-
|
13
|
-
.
|
14
|
-
background-color: #fff;
|
15
|
-
padding: 20px;
|
16
|
-
width: 320px;
|
17
|
-
height:100vh;
|
18
|
-
position: relative;
|
19
|
-
}
|
20
|
-
|
21
|
-
.
|
22
|
-
font-size: 18px;
|
23
|
-
font-weight: bold;
|
24
|
-
margin-bottom: 16px;
|
25
|
-
display: flex;
|
26
|
-
justify-content: space-between;
|
27
|
-
}
|
28
|
-
|
29
|
-
.
|
30
|
-
margin-bottom: 24px;
|
31
|
-
}
|
32
|
-
|
33
|
-
.
|
34
|
-
position: absolute;
|
35
|
-
bottom: 0;
|
36
|
-
right: 0;
|
37
|
-
display: flex;
|
38
|
-
gap: 10px;
|
39
|
-
padding: 10px 20px;
|
40
|
-
background-color: #fff;
|
41
|
-
}
|
42
|
-
|
43
|
-
.
|
44
|
-
background-image: url('../../assets/关闭.png');
|
45
|
-
width: 15px;
|
46
|
-
height: 15px;
|
47
|
-
background-size: 100% 100%;
|
48
|
-
cursor: pointer;
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
}
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
}
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
}
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
}
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
}
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
}
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
}
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
1
|
+
.drawerOverlay {
|
2
|
+
position: fixed;
|
3
|
+
top: 0;
|
4
|
+
left: 0;
|
5
|
+
width: 100vw;
|
6
|
+
height: 100vh;
|
7
|
+
background-color: rgba(0, 0, 0, 0.5);
|
8
|
+
z-index: 999;
|
9
|
+
display: flex;
|
10
|
+
justify-content: flex-end;
|
11
|
+
}
|
12
|
+
|
13
|
+
.drawerContainer {
|
14
|
+
background-color: #fff;
|
15
|
+
padding: 20px;
|
16
|
+
width: 320px;
|
17
|
+
height: 100vh;
|
18
|
+
position: relative;
|
19
|
+
}
|
20
|
+
|
21
|
+
.drawerHeader {
|
22
|
+
font-size: 18px;
|
23
|
+
font-weight: bold;
|
24
|
+
margin-bottom: 16px;
|
25
|
+
display: flex;
|
26
|
+
justify-content: space-between;
|
27
|
+
}
|
28
|
+
|
29
|
+
.drawerContent {
|
30
|
+
margin-bottom: 24px;
|
31
|
+
}
|
32
|
+
|
33
|
+
.drawerFooter {
|
34
|
+
position: absolute;
|
35
|
+
bottom: 0;
|
36
|
+
right: 0;
|
37
|
+
display: flex;
|
38
|
+
gap: 10px;
|
39
|
+
padding: 10px 20px;
|
40
|
+
background-color: #fff;
|
41
|
+
}
|
42
|
+
|
43
|
+
.drawerCloseBtn {
|
44
|
+
background-image: url('../../assets/关闭.png');
|
45
|
+
width: 15px;
|
46
|
+
height: 15px;
|
47
|
+
background-size: 100% 100%;
|
48
|
+
cursor: pointer;
|
49
|
+
}
|
50
|
+
|
51
|
+
/* 位置类 */
|
52
|
+
.drawerRight {
|
53
|
+
right: 0;
|
54
|
+
top: 0;
|
55
|
+
position: fixed;
|
56
|
+
height: 100vh;
|
57
|
+
width: 320px;
|
58
|
+
}
|
59
|
+
|
60
|
+
.drawerLeft {
|
61
|
+
left: 0;
|
62
|
+
top: 0;
|
63
|
+
position: fixed;
|
64
|
+
height: 100vh;
|
65
|
+
width: 320px;
|
66
|
+
}
|
67
|
+
|
68
|
+
.drawerTop {
|
69
|
+
top: 0;
|
70
|
+
left: 0;
|
71
|
+
position: fixed;
|
72
|
+
width: 100vw;
|
73
|
+
height: 300px;
|
74
|
+
}
|
75
|
+
|
76
|
+
.drawerBottom {
|
77
|
+
bottom: 0;
|
78
|
+
left: 0;
|
79
|
+
position: fixed;
|
80
|
+
width: 100vw;
|
81
|
+
height: 300px;
|
82
|
+
}
|
83
|
+
|
84
|
+
/* 动画类 */
|
85
|
+
@keyframes comeInRight {
|
86
|
+
from {
|
87
|
+
transform: translateX(100%);
|
88
|
+
opacity: 0;
|
89
|
+
}
|
90
|
+
to {
|
91
|
+
transform: translateX(0);
|
92
|
+
opacity: 1;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
@keyframes comeOutRight {
|
97
|
+
from {
|
98
|
+
transform: translateX(0);
|
99
|
+
opacity: 1;
|
100
|
+
}
|
101
|
+
to {
|
102
|
+
transform: translateX(100%);
|
103
|
+
opacity: 0;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
@keyframes comeInLeft {
|
108
|
+
from {
|
109
|
+
transform: translateX(-100%);
|
110
|
+
opacity: 0;
|
111
|
+
}
|
112
|
+
to {
|
113
|
+
transform: translateX(0);
|
114
|
+
opacity: 1;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
@keyframes comeOutLeft {
|
119
|
+
from {
|
120
|
+
transform: translateX(0);
|
121
|
+
opacity: 1;
|
122
|
+
}
|
123
|
+
to {
|
124
|
+
transform: translateX(-100%);
|
125
|
+
opacity: 0;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
@keyframes comeInTop {
|
130
|
+
from {
|
131
|
+
transform: translateY(-100%);
|
132
|
+
opacity: 0;
|
133
|
+
}
|
134
|
+
to {
|
135
|
+
transform: translateY(0);
|
136
|
+
opacity: 1;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
@keyframes comeOutTop {
|
141
|
+
from {
|
142
|
+
transform: translateY(0);
|
143
|
+
opacity: 1;
|
144
|
+
}
|
145
|
+
to {
|
146
|
+
transform: translateY(-100%);
|
147
|
+
opacity: 0;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
@keyframes comeInBottom {
|
152
|
+
from {
|
153
|
+
transform: translateY(100%);
|
154
|
+
opacity: 0;
|
155
|
+
}
|
156
|
+
to {
|
157
|
+
transform: translateY(0);
|
158
|
+
opacity: 1;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
@keyframes comeOutBottom {
|
163
|
+
from {
|
164
|
+
transform: translateY(0);
|
165
|
+
opacity: 1;
|
166
|
+
}
|
167
|
+
to {
|
168
|
+
transform: translateY(100%);
|
169
|
+
opacity: 0;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
.comeInRight {
|
174
|
+
animation: comeInRight 0.3s ease-in-out;
|
175
|
+
}
|
176
|
+
|
177
|
+
.comeOutRight {
|
178
|
+
animation: comeOutRight 0.3s ease-in-out;
|
179
|
+
}
|
180
|
+
|
181
|
+
.comeInLeft {
|
182
|
+
animation: comeInLeft 0.3s ease-in-out;
|
183
|
+
}
|
184
|
+
|
185
|
+
.comeOutLeft {
|
186
|
+
animation: comeOutLeft 0.3s ease-in-out;
|
187
|
+
}
|
188
|
+
|
189
|
+
.comeInTop {
|
190
|
+
animation: comeInTop 0.3s ease-in-out;
|
191
|
+
}
|
192
|
+
|
193
|
+
.comeOutTop {
|
194
|
+
animation: comeOutTop 0.3s ease-in-out;
|
195
|
+
}
|
196
|
+
|
197
|
+
.comeInBottom {
|
198
|
+
animation: comeInBottom 0.3s ease-in-out;
|
199
|
+
}
|
200
|
+
|
201
|
+
.comeOutBottom {
|
202
|
+
animation: comeOutBottom 0.3s ease-in-out;
|
203
|
+
}
|