@aloudata/aloudata-design 0.3.0 → 0.3.3
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/README.md +15 -5
- package/es/Breadcrumb/index.d.ts +0 -1
- package/es/Button/index.js +3 -2
- package/es/Button/style/index.less +135 -126
- package/es/Button/style/variables.less +53 -53
- package/es/Card/index.d.ts +3 -0
- package/es/Card/index.js +3 -0
- package/es/{Message → Card}/style/index.d.ts +0 -0
- package/es/{Message → Card}/style/index.js +0 -0
- package/es/{Message → Card}/style/index.less +0 -0
- package/es/Checkbox/index.d.ts +0 -1
- package/es/Drawer/index.d.ts +4 -0
- package/es/Drawer/index.js +3 -0
- package/es/{Notification → Drawer}/style/index.d.ts +0 -0
- package/es/{Notification → Drawer}/style/index.js +0 -0
- package/es/{Notification → Drawer}/style/index.less +0 -0
- package/es/Dropdown/Button.js +4 -3
- package/es/Empty/image/Authority.d.ts +0 -1
- package/es/Empty/image/Dataspace.d.ts +0 -1
- package/es/Empty/image/Search.d.ts +0 -1
- package/es/Empty/image/Simple.d.ts +0 -1
- package/es/Empty/image/Worksheet.d.ts +0 -1
- package/es/Empty/image/empty.d.ts +0 -1
- package/es/Icon/icons/CheckLine.d.ts +13 -0
- package/es/Icon/icons/CheckLine.js +73 -0
- package/es/Icon/icons.json +410 -0
- package/es/Input/components/Group/index.d.ts +2 -2
- package/es/Input/components/Group/index.js +6 -12
- package/es/Input/components/Input/index.d.ts +3 -2
- package/es/Input/components/Input/index.js +11 -22
- package/es/Input/components/Password/index.js +11 -16
- package/es/Input/style/index.less +102 -102
- package/es/InputNumber/index.d.ts +0 -1
- package/es/InputNumber/style/index.less +69 -69
- package/es/Menu/Divider.d.ts +0 -1
- package/es/Modal/index.js +20 -16
- package/es/Modal/locale.d.ts +7 -0
- package/es/Modal/locale.js +20 -0
- package/es/Modal/style/index.less +45 -45
- package/es/Navigator/components/Header/index.d.ts +0 -1
- package/es/Navigator/components/Menu/index.d.ts +0 -1
- package/es/Navigator/components/MenuItem/index.d.ts +1 -1
- package/es/Navigator/index.d.ts +1 -1
- package/es/PageHeader/index.d.ts +3 -0
- package/es/PageHeader/index.js +3 -0
- package/{lib/Message → es/PageHeader}/style/index.d.ts +0 -0
- package/es/PageHeader/style/index.js +2 -0
- package/{lib/Message → es/PageHeader}/style/index.less +0 -0
- package/es/Popover/index.d.ts +0 -1
- package/es/Select/rc-select/OptionList.js +4 -4
- package/es/Select/rc-select/Selector/MultipleSelector.js +11 -1
- package/es/Select/rc-select/hooks/useOptions.d.ts +1 -1
- package/es/Select/style/index.less +69 -45
- package/es/Select/style/variables.less +45 -45
- package/es/Select/utils/iconUtil.d.ts +2 -2
- package/es/Select/utils/iconUtil.js +9 -5
- package/es/Steps/components/ProcessIcon/index.d.ts +5 -0
- package/es/Steps/components/ProcessIcon/index.js +8 -0
- package/es/Steps/components/Step/index.d.ts +20 -0
- package/es/Steps/components/Step/index.js +45 -0
- package/es/Steps/index.d.ts +36 -2
- package/es/Steps/index.js +30 -1
- package/es/Steps/matchMedia.mock.d.ts +1 -0
- package/es/Steps/matchMedia.mock.js +17 -0
- package/es/Steps/style/index.less +251 -0
- package/es/Switch/index.d.ts +46 -2
- package/es/Switch/index.js +71 -1
- package/es/Switch/style/index.less +129 -0
- package/es/Table/Table.js +3 -3
- package/es/Table/style/index.less +1 -1
- package/es/Tabs/index.js +7 -9
- package/es/Tabs/style/index.less +57 -25
- package/es/index.d.ts +13 -7
- package/es/index.js +6 -3
- package/es/locale/default.d.ts +2 -0
- package/es/locale/default.js +2 -0
- package/es/locale/en_US.d.ts +3 -0
- package/es/locale/en_US.js +132 -0
- package/es/locale/zh_CN.d.ts +3 -2
- package/es/locale/zh_CN.js +131 -2
- package/es/locale-provider/LocaleReceiver.d.ts +4 -0
- package/es/locale-provider/LocaleReceiver.js +3 -0
- package/es/locale-provider/context.d.ts +7 -0
- package/es/locale-provider/context.js +3 -0
- package/es/locale-provider/default.d.ts +2 -0
- package/es/locale-provider/default.js +2 -0
- package/es/locale-provider/en_US.d.ts +2 -0
- package/es/locale-provider/en_US.js +2 -0
- package/es/locale-provider/index.d.ts +61 -0
- package/es/locale-provider/index.js +102 -0
- package/es/locale-provider/style/index.d.ts +1 -0
- package/es/locale-provider/style/index.js +1 -0
- package/es/locale-provider/style/index.less +2 -0
- package/es/locale-provider/zh_CN.d.ts +2 -0
- package/es/locale-provider/zh_CN.js +2 -0
- package/es/{Message → message}/index.d.ts +0 -0
- package/es/{Message → message}/index.js +0 -0
- package/{lib/Notification → es/message}/style/index.d.ts +0 -0
- package/es/message/style/index.js +2 -0
- package/{lib/Notification → es/message}/style/index.less +0 -0
- package/es/{Notification → notification}/index.d.ts +0 -0
- package/es/{Notification → notification}/index.js +0 -0
- package/es/notification/style/index.d.ts +2 -0
- package/es/notification/style/index.js +2 -0
- package/es/notification/style/index.less +1 -0
- package/es/style/index.less +1 -1
- package/es/style/themes/default/index.less +30 -30
- package/lib/Breadcrumb/index.d.ts +0 -1
- package/lib/Button/index.js +5 -3
- package/lib/Button/style/index.less +135 -126
- package/lib/Button/style/variables.less +53 -53
- package/lib/Card/index.d.ts +3 -0
- package/lib/Card/index.js +15 -0
- package/lib/Card/style/index.d.ts +2 -0
- package/lib/{Message → Card}/style/index.js +0 -0
- package/lib/Card/style/index.less +1 -0
- package/lib/Checkbox/index.d.ts +0 -1
- package/lib/Drawer/index.d.ts +4 -0
- package/lib/Drawer/index.js +15 -0
- package/lib/Drawer/style/index.d.ts +2 -0
- package/lib/{Notification → Drawer}/style/index.js +0 -0
- package/lib/Drawer/style/index.less +1 -0
- package/lib/Dropdown/Button.js +8 -6
- package/lib/Empty/image/Authority.d.ts +0 -1
- package/lib/Empty/image/Dataspace.d.ts +0 -1
- package/lib/Empty/image/Search.d.ts +0 -1
- package/lib/Empty/image/Simple.d.ts +0 -1
- package/lib/Empty/image/Worksheet.d.ts +0 -1
- package/lib/Empty/image/empty.d.ts +0 -1
- package/lib/Icon/icons/CheckLine.d.ts +13 -0
- package/lib/Icon/icons/CheckLine.js +90 -0
- package/lib/Icon/icons.json +410 -0
- package/lib/Input/components/Group/index.d.ts +2 -2
- package/lib/Input/components/Group/index.js +7 -12
- package/lib/Input/components/Input/index.d.ts +3 -2
- package/lib/Input/components/Input/index.js +13 -22
- package/lib/Input/components/Password/index.js +13 -17
- package/lib/Input/style/index.less +102 -102
- package/lib/InputNumber/index.d.ts +0 -1
- package/lib/InputNumber/style/index.less +69 -69
- package/lib/Menu/Divider.d.ts +0 -1
- package/lib/Modal/index.js +25 -18
- package/lib/Modal/locale.d.ts +7 -0
- package/lib/Modal/locale.js +31 -0
- package/lib/Modal/style/index.less +45 -45
- package/lib/Navigator/components/Header/index.d.ts +0 -1
- package/lib/Navigator/components/Menu/index.d.ts +0 -1
- package/lib/Navigator/components/MenuItem/index.d.ts +1 -1
- package/lib/Navigator/index.d.ts +1 -1
- package/lib/PageHeader/index.d.ts +3 -0
- package/lib/PageHeader/index.js +15 -0
- package/lib/PageHeader/style/index.d.ts +2 -0
- package/lib/PageHeader/style/index.js +5 -0
- package/lib/PageHeader/style/index.less +1 -0
- package/lib/Popover/index.d.ts +0 -1
- package/lib/Select/rc-select/OptionList.js +8 -7
- package/lib/Select/rc-select/Selector/MultipleSelector.js +11 -1
- package/lib/Select/rc-select/hooks/useOptions.d.ts +1 -1
- package/lib/Select/style/index.less +69 -45
- package/lib/Select/style/variables.less +45 -45
- package/lib/Select/utils/iconUtil.d.ts +2 -2
- package/lib/Select/utils/iconUtil.js +13 -7
- package/lib/Steps/components/ProcessIcon/index.d.ts +5 -0
- package/lib/Steps/components/ProcessIcon/index.js +19 -0
- package/lib/Steps/components/Step/index.d.ts +20 -0
- package/lib/Steps/components/Step/index.js +61 -0
- package/lib/Steps/index.d.ts +36 -2
- package/lib/Steps/index.js +34 -1
- package/lib/Steps/matchMedia.mock.d.ts +1 -0
- package/lib/Steps/matchMedia.mock.js +17 -0
- package/lib/Steps/style/index.less +251 -0
- package/lib/Switch/index.d.ts +46 -2
- package/lib/Switch/index.js +78 -1
- package/lib/Switch/style/index.less +129 -0
- package/lib/Table/Table.js +3 -3
- package/lib/Table/style/index.less +1 -1
- package/lib/Tabs/index.js +9 -11
- package/lib/Tabs/style/index.less +57 -25
- package/lib/index.d.ts +13 -7
- package/lib/index.js +34 -10
- package/lib/locale/default.d.ts +2 -0
- package/lib/locale/default.js +13 -0
- package/lib/locale/en_US.d.ts +3 -0
- package/lib/locale/en_US.js +146 -0
- package/lib/locale/zh_CN.d.ts +3 -2
- package/lib/locale/zh_CN.js +134 -2
- package/lib/locale-provider/LocaleReceiver.d.ts +4 -0
- package/lib/locale-provider/LocaleReceiver.js +23 -0
- package/lib/locale-provider/context.d.ts +7 -0
- package/lib/locale-provider/context.js +12 -0
- package/lib/locale-provider/default.d.ts +2 -0
- package/lib/locale-provider/default.js +13 -0
- package/lib/locale-provider/en_US.d.ts +2 -0
- package/lib/locale-provider/en_US.js +13 -0
- package/lib/locale-provider/index.d.ts +61 -0
- package/lib/locale-provider/index.js +116 -0
- package/lib/locale-provider/style/index.d.ts +1 -0
- package/lib/locale-provider/style/index.js +3 -0
- package/lib/locale-provider/style/index.less +2 -0
- package/lib/locale-provider/zh_CN.d.ts +2 -0
- package/lib/locale-provider/zh_CN.js +13 -0
- package/lib/{Message → message}/index.d.ts +0 -0
- package/lib/{Message → message}/index.js +0 -0
- package/lib/message/style/index.d.ts +2 -0
- package/lib/message/style/index.js +5 -0
- package/lib/message/style/index.less +1 -0
- package/lib/{Notification → notification}/index.d.ts +0 -0
- package/lib/{Notification → notification}/index.js +0 -0
- package/lib/notification/style/index.d.ts +2 -0
- package/lib/notification/style/index.js +5 -0
- package/lib/notification/style/index.less +1 -0
- package/lib/style/index.less +1 -1
- package/lib/style/themes/default/index.less +30 -30
- package/package.json +11 -8
|
@@ -1 +1,252 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
|
+
|
|
3
|
+
.ant-steps-item-icon {
|
|
4
|
+
width: 24px;
|
|
5
|
+
height: 24px;
|
|
6
|
+
margin: 6px 8px -2px 0;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
line-height: 24px;
|
|
9
|
+
text-align: center;
|
|
10
|
+
border-radius: 24px;
|
|
11
|
+
transition: background-color 0.3s, border-color 0.3s;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// 水平状态下
|
|
15
|
+
.ant-steps.ald-steps {
|
|
16
|
+
padding: 24px;
|
|
17
|
+
|
|
18
|
+
.ant-steps-item-content {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
margin: 0 -4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ant-steps-item-custom > .ant-steps-item-container > .ant-steps-item-icon > .ant-steps-icon {
|
|
26
|
+
top: 2px;
|
|
27
|
+
left: 0.5px;
|
|
28
|
+
width: 16px;
|
|
29
|
+
height: 16px;
|
|
30
|
+
font-size: 16px;
|
|
31
|
+
line-height: 16px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 常规step
|
|
35
|
+
.ant-steps-item {
|
|
36
|
+
.ant-steps-item-tail {
|
|
37
|
+
margin-left: 50px;
|
|
38
|
+
padding: 3.5px 7px;
|
|
39
|
+
|
|
40
|
+
&::after {
|
|
41
|
+
height: 2px;
|
|
42
|
+
background-color: @NL90;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ant-steps-item-title {
|
|
47
|
+
height: 20px;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
font-style: normal;
|
|
51
|
+
line-height: 20px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ant-steps-item-description {
|
|
55
|
+
max-width: 264px;
|
|
56
|
+
max-height: 32px;
|
|
57
|
+
margin-top: 3px;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
color: @NL50;
|
|
60
|
+
font-weight: 400;
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
font-style: normal;
|
|
63
|
+
line-height: 16px;
|
|
64
|
+
word-break: break-all;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// 已完成的step
|
|
68
|
+
.ant-steps-item-finish {
|
|
69
|
+
.ant-steps-item-tail::after {
|
|
70
|
+
height: 2px;
|
|
71
|
+
background-color: @B60;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ant-steps-item-title {
|
|
75
|
+
color: @NL50;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// 正在进行中的step
|
|
79
|
+
.ant-steps-item-active {
|
|
80
|
+
.ant-steps-item-title {
|
|
81
|
+
color: @B60;
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// 等待中step
|
|
86
|
+
.ant-steps-item-wait {
|
|
87
|
+
.ant-steps-item-title {
|
|
88
|
+
color: @NL0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// 错误状态下的step
|
|
92
|
+
.ant-steps-item-error {
|
|
93
|
+
.ant-steps-item-title {
|
|
94
|
+
color: @SC60;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// 竖直状态下
|
|
99
|
+
.ant-steps.ald-steps.ant-steps-vertical {
|
|
100
|
+
height: 100%;
|
|
101
|
+
|
|
102
|
+
.ant-steps-item-container {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
|
|
106
|
+
.ant-steps-item-content {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
align-items: flex-start;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
margin-left: 5px;
|
|
112
|
+
|
|
113
|
+
.ant-steps-item-title {
|
|
114
|
+
height: 20px;
|
|
115
|
+
margin-top: 1px;
|
|
116
|
+
font-size: 14px;
|
|
117
|
+
line-height: 20px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.ant-steps-item-description {
|
|
121
|
+
max-width: 264px;
|
|
122
|
+
// height: 16px;
|
|
123
|
+
max-height: 32px;
|
|
124
|
+
margin-top: 4px;
|
|
125
|
+
padding: 0;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
line-height: 16px;
|
|
129
|
+
text-overflow: ellipsis;
|
|
130
|
+
word-wrap: break-word;
|
|
131
|
+
-webkit-line-clamp: 2;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ant-steps-item-icon {
|
|
136
|
+
width: 16px;
|
|
137
|
+
height: 16px;
|
|
138
|
+
margin-top: 0;
|
|
139
|
+
margin-right: 0;
|
|
140
|
+
|
|
141
|
+
& .ant-steps-icon {
|
|
142
|
+
top: 0;
|
|
143
|
+
left: 0.5px;
|
|
144
|
+
width: 16px;
|
|
145
|
+
height: 16px;
|
|
146
|
+
font-size: 16px;
|
|
147
|
+
line-height: 16px;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 常规step
|
|
153
|
+
.ant-steps-item {
|
|
154
|
+
&:last-child {
|
|
155
|
+
flex: 0 0 auto;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ant-steps-item-tail {
|
|
159
|
+
position: absolute;
|
|
160
|
+
top: 18px;
|
|
161
|
+
left: 8px;
|
|
162
|
+
width: 2px;
|
|
163
|
+
height: 100%;
|
|
164
|
+
margin: 0;
|
|
165
|
+
padding: 14px 0 0;
|
|
166
|
+
|
|
167
|
+
&::after {
|
|
168
|
+
width: 2px;
|
|
169
|
+
height: 100%;
|
|
170
|
+
background-color: @NL90;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// 已完成的step
|
|
175
|
+
.ant-steps-item-finish {
|
|
176
|
+
.ant-steps-item-tail::after {
|
|
177
|
+
width: 2px;
|
|
178
|
+
height: 100%;
|
|
179
|
+
background-color: @B60;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&.ant-steps-item-title {
|
|
183
|
+
color: @NL50;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.ant-steps.ald-steps
|
|
189
|
+
.ant-steps-item:not(.ant-steps-item-active)
|
|
190
|
+
> .ant-steps-item-container[role='button'] {
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
|
|
193
|
+
&:hover {
|
|
194
|
+
.ant-steps-item-title,
|
|
195
|
+
.ant-steps-item-description {
|
|
196
|
+
color: #0f62fe;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// 自定义Icon的样式
|
|
201
|
+
.icon-box {
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
justify-content: center;
|
|
205
|
+
width: 16px;
|
|
206
|
+
height: 16px;
|
|
207
|
+
margin-bottom: 9px;
|
|
208
|
+
background-color: #fff;
|
|
209
|
+
border-radius: 50%;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.error-icon-box {
|
|
213
|
+
color: @SC60;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.check-icon-box {
|
|
217
|
+
color: @B60;
|
|
218
|
+
}
|
|
219
|
+
// 提升该类名的优先级,不然会被.iconBox覆盖掉
|
|
220
|
+
.ald-steps .process-icon-box {
|
|
221
|
+
position: relative;
|
|
222
|
+
background-color: @B60;
|
|
223
|
+
|
|
224
|
+
&::after {
|
|
225
|
+
position: absolute;
|
|
226
|
+
top: 50%;
|
|
227
|
+
left: 50%;
|
|
228
|
+
width: 6px;
|
|
229
|
+
height: 6px;
|
|
230
|
+
background-color: @ND0;
|
|
231
|
+
border-radius: 50%;
|
|
232
|
+
transform: translate(-50%, -50%);
|
|
233
|
+
content: '';
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.ald-steps .wait-icon-box {
|
|
238
|
+
position: relative;
|
|
239
|
+
background-color: @BG90;
|
|
240
|
+
|
|
241
|
+
&::after {
|
|
242
|
+
position: absolute;
|
|
243
|
+
top: 50%;
|
|
244
|
+
left: 50%;
|
|
245
|
+
width: 6px;
|
|
246
|
+
height: 6px;
|
|
247
|
+
background-color: @BG80;
|
|
248
|
+
border-radius: 50%;
|
|
249
|
+
transform: translate(-50%, -50%);
|
|
250
|
+
content: '';
|
|
251
|
+
}
|
|
252
|
+
}
|
package/es/Switch/index.d.ts
CHANGED
|
@@ -1,4 +1,48 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SwitchChangeEventHandler } from 'antd/es/switch';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
export type { SwitchSize, SwitchChangeEventHandler, SwitchClickEventHandler } from 'antd/es/switch';
|
|
3
|
-
export
|
|
4
|
+
export interface ISwitchProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description class类名
|
|
7
|
+
* @default -
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @description 指定当前是否选中
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @description 初始是否选中
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
defaultChecked?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @description 是否禁用
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @description 加载中的开关
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @description 尺寸大小
|
|
32
|
+
* @default middle
|
|
33
|
+
*/
|
|
34
|
+
size?: 'middle' | 'small';
|
|
35
|
+
/**
|
|
36
|
+
* @description 点击时的回调
|
|
37
|
+
* @type (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
38
|
+
*/
|
|
39
|
+
onClick?: SwitchChangeEventHandler;
|
|
40
|
+
/**
|
|
41
|
+
* @description 变时的回调
|
|
42
|
+
* @type (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
43
|
+
*/
|
|
44
|
+
onChange?: SwitchChangeEventHandler;
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
}
|
|
47
|
+
declare const Switch: React.FC<ISwitchProps>;
|
|
4
48
|
export default Switch;
|
package/es/Switch/index.js
CHANGED
|
@@ -1,2 +1,72 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "antd/es/switch/style";
|
|
2
|
+
import _Switch from "antd/es/switch";
|
|
3
|
+
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
|
+
|
|
12
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
13
|
+
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
|
|
16
|
+
import React, { useState, useEffect } from 'react';
|
|
17
|
+
import classnames from 'classnames';
|
|
18
|
+
|
|
19
|
+
var Switch = function Switch(_ref) {
|
|
20
|
+
var _ref$className = _ref.className,
|
|
21
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
22
|
+
_ref$disabled = _ref.disabled,
|
|
23
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
24
|
+
_ref$loading = _ref.loading,
|
|
25
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
26
|
+
_ref$size = _ref.size,
|
|
27
|
+
size = _ref$size === void 0 ? 'middle' : _ref$size,
|
|
28
|
+
checked = _ref.checked,
|
|
29
|
+
_ref$defaultChecked = _ref.defaultChecked,
|
|
30
|
+
defaultChecked = _ref$defaultChecked === void 0 ? false : _ref$defaultChecked,
|
|
31
|
+
onChange = _ref.onChange,
|
|
32
|
+
onClick = _ref.onClick,
|
|
33
|
+
children = _ref.children;
|
|
34
|
+
|
|
35
|
+
var _useState = useState(typeof checked === 'undefined' ? defaultChecked : checked),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
userChecked = _useState2[0],
|
|
38
|
+
setUserChecked = _useState2[1];
|
|
39
|
+
|
|
40
|
+
var onChangeCB = function onChangeCB(isChecked, event) {
|
|
41
|
+
setUserChecked(isChecked);
|
|
42
|
+
|
|
43
|
+
if (typeof onChange === 'function') {
|
|
44
|
+
onChange(isChecked, event);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var currentDisabled = loading ? true : disabled;
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
if (typeof checked === 'boolean') {
|
|
51
|
+
setUserChecked(checked);
|
|
52
|
+
}
|
|
53
|
+
}, [checked]);
|
|
54
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
55
|
+
className: classnames(className, 'ald-switch', "ald-switch-".concat(size), {
|
|
56
|
+
'ald-switch-disabled': currentDisabled,
|
|
57
|
+
'ald-switch-checked': userChecked
|
|
58
|
+
})
|
|
59
|
+
}, /*#__PURE__*/React.createElement(_Switch, {
|
|
60
|
+
disabled: currentDisabled,
|
|
61
|
+
loading: loading,
|
|
62
|
+
onChange: onChangeCB,
|
|
63
|
+
onClick: onClick,
|
|
64
|
+
checked: userChecked,
|
|
65
|
+
className: "ald-switch-btn",
|
|
66
|
+
defaultChecked: defaultChecked
|
|
67
|
+
}), children && /*#__PURE__*/React.createElement("span", {
|
|
68
|
+
className: "ald-switch-text"
|
|
69
|
+
}, children));
|
|
70
|
+
};
|
|
71
|
+
|
|
2
72
|
export default Switch;
|
|
@@ -1 +1,130 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
|
+
|
|
3
|
+
@switch-handle-middle: @font-size-middle;
|
|
4
|
+
@switch-handle-height-middle: @line-height-middle;
|
|
5
|
+
@switch-handle-small: @font-size-small;
|
|
6
|
+
@switch-handle-height-small: @line-height-small;
|
|
7
|
+
@switch-handle-gap-middle: 3px;
|
|
8
|
+
@switch-handle-gap-small: 2px;
|
|
9
|
+
@switch-text-margin-left: 8px;
|
|
10
|
+
@switch-aspect-ratio: 2; //宽高比
|
|
11
|
+
@switch-height-radius-ratio: 2; //高度和边框圆角比
|
|
12
|
+
|
|
13
|
+
.ald-switch {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
font-size: 0;
|
|
16
|
+
|
|
17
|
+
.ald-switch-btn {
|
|
18
|
+
background: @NL90;
|
|
19
|
+
|
|
20
|
+
&:focus {
|
|
21
|
+
box-shadow: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ald-switch-text {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
margin-left: @switch-text-margin-left;
|
|
29
|
+
color: @NL0;
|
|
30
|
+
vertical-align: middle;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.ald-switch-checked {
|
|
34
|
+
.ald-switch-btn {
|
|
35
|
+
background-color: @B60;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.ald-switch-disabled {
|
|
40
|
+
cursor: initial;
|
|
41
|
+
|
|
42
|
+
.ald-switch-btn {
|
|
43
|
+
cursor: initial;
|
|
44
|
+
opacity: 0.5;
|
|
45
|
+
|
|
46
|
+
* {
|
|
47
|
+
cursor: initial;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ald-switch-text {
|
|
52
|
+
color: @NL60;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.ald-switch-middle {
|
|
57
|
+
.ald-switch-btn {
|
|
58
|
+
width: @switch-handle-height-middle * @switch-aspect-ratio;
|
|
59
|
+
min-width: @switch-handle-height-middle * @switch-aspect-ratio;
|
|
60
|
+
height: @switch-handle-height-middle;
|
|
61
|
+
line-height: @switch-handle-height-middle;
|
|
62
|
+
border-radius: @switch-handle-height-middle / @switch-height-radius-ratio;
|
|
63
|
+
|
|
64
|
+
.ant-switch-handle {
|
|
65
|
+
top: @switch-handle-gap-middle;
|
|
66
|
+
left: @switch-handle-gap-middle;
|
|
67
|
+
width: @switch-handle-middle;
|
|
68
|
+
height: @switch-handle-middle;
|
|
69
|
+
|
|
70
|
+
.ant-switch-loading-icon {
|
|
71
|
+
width: @switch-handle-middle - 4px;
|
|
72
|
+
height: @switch-handle-middle - 4px;
|
|
73
|
+
font-size: @switch-handle-middle - 4px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ald-switch-text {
|
|
79
|
+
height: @switch-handle-height-middle;
|
|
80
|
+
font-size: @font-size-middle;
|
|
81
|
+
line-height: @switch-handle-height-middle;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.ald-switch-checked {
|
|
85
|
+
.ant-switch-handle {
|
|
86
|
+
top: 3px;
|
|
87
|
+
left: calc(100% - @switch-handle-middle - @switch-handle-gap-middle);
|
|
88
|
+
width: @switch-handle-middle;
|
|
89
|
+
height: @switch-handle-middle;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.ald-switch-small {
|
|
95
|
+
.ald-switch-btn {
|
|
96
|
+
width: @switch-handle-height-small * @switch-aspect-ratio;
|
|
97
|
+
min-width: @switch-handle-height-small * @switch-aspect-ratio;
|
|
98
|
+
height: @switch-handle-height-small;
|
|
99
|
+
line-height: @switch-handle-height-small;
|
|
100
|
+
border-radius: @switch-handle-height-small / @switch-height-radius-ratio;
|
|
101
|
+
|
|
102
|
+
.ant-switch-handle {
|
|
103
|
+
top: @switch-handle-gap-small;
|
|
104
|
+
left: @switch-handle-gap-small;
|
|
105
|
+
width: @switch-handle-small;
|
|
106
|
+
height: @switch-handle-small;
|
|
107
|
+
|
|
108
|
+
.ant-switch-loading-icon {
|
|
109
|
+
width: @switch-handle-small - 4px;
|
|
110
|
+
height: @switch-handle-small - 4px;
|
|
111
|
+
font-size: @switch-handle-small - 4px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ald-switch-text {
|
|
117
|
+
height: @switch-handle-height-small;
|
|
118
|
+
font-size: @font-size-small;
|
|
119
|
+
line-height: @switch-handle-height-small;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&.ald-switch-checked {
|
|
123
|
+
.ant-switch-handle {
|
|
124
|
+
left: calc(100% - @switch-handle-small - @switch-handle-gap-small);
|
|
125
|
+
width: @switch-handle-small;
|
|
126
|
+
height: @switch-handle-small;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
package/es/Table/Table.js
CHANGED
|
@@ -402,7 +402,7 @@ function Table(props, ref) {
|
|
|
402
402
|
}), row.cells.map(function (cell) {
|
|
403
403
|
return /*#__PURE__*/React.createElement("div", Object.assign({}, cell.getCellProps(), {
|
|
404
404
|
className: classnames("".concat(prefixCls, "-cell"))
|
|
405
|
-
}), cell.render('Cell'));
|
|
405
|
+
}), /*#__PURE__*/React.createElement(React.Fragment, null, cell.render('Cell')));
|
|
406
406
|
}));
|
|
407
407
|
});
|
|
408
408
|
};
|
|
@@ -456,9 +456,9 @@ function Table(props, ref) {
|
|
|
456
456
|
style: {
|
|
457
457
|
width: '100%'
|
|
458
458
|
}
|
|
459
|
-
}), column.render('Header'), /*#__PURE__*/React.createElement(SortIcons, {
|
|
459
|
+
}), /*#__PURE__*/React.createElement(React.Fragment, null, column.render('Header'), /*#__PURE__*/React.createElement(SortIcons, {
|
|
460
460
|
id: column.id
|
|
461
|
-
})), /*#__PURE__*/React.createElement("div", Object.assign({}, barPorps, {
|
|
461
|
+
}))), /*#__PURE__*/React.createElement("div", Object.assign({}, barPorps, {
|
|
462
462
|
className: classnames(_defineProperty({}, "".concat(prefixCls, "-dragBar"), resizeColumn), "".concat(prefixCls, "-bar"))
|
|
463
463
|
})));
|
|
464
464
|
}));
|
package/es/Tabs/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "@aloudata/icons-react/styles/index.less";
|
|
2
|
+
import _More from "@aloudata/icons-react/es/icons/More";
|
|
1
3
|
import "antd/es/tabs/style";
|
|
2
4
|
import _Tabs from "antd/es/tabs";
|
|
3
5
|
var _excluded = ["size", "className", "popupClassName", "adaptHeight"];
|
|
@@ -14,8 +16,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
14
16
|
|
|
15
17
|
import React from 'react'; // import AntdTabs, { TabsProps } from 'antd/lib/tabs';
|
|
16
18
|
|
|
17
|
-
import Icon from '../Icon';
|
|
18
|
-
import Button from '../Button';
|
|
19
19
|
import TabPane from './TabPane';
|
|
20
20
|
import classNames from 'classnames';
|
|
21
21
|
export default function Tabs(props) {
|
|
@@ -32,13 +32,11 @@ export default function Tabs(props) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
return /*#__PURE__*/React.createElement(_Tabs, Object.assign({
|
|
35
|
-
moreIcon: /*#__PURE__*/React.createElement(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
}),
|
|
35
|
+
moreIcon: /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "ald-tabs-moreIcon"
|
|
37
|
+
}, /*#__PURE__*/React.createElement(_More, {
|
|
38
|
+
color: "currentColor"
|
|
39
|
+
})),
|
|
42
40
|
tabBarGutter: 24,
|
|
43
41
|
popupClassName: classNames(popupClassName, 'ald-tabs-dropdown'),
|
|
44
42
|
className: classNames('ald-tabs', className, {
|
package/es/Tabs/style/index.less
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
/* stylelint-disable no-descending-specificity */
|
|
1
2
|
@import '../../style/index.less';
|
|
2
3
|
@import '../../Button/style/index.less';
|
|
3
4
|
//status- default
|
|
4
|
-
@
|
|
5
|
-
@
|
|
5
|
+
@tabs-color: @NL30;
|
|
6
|
+
@tabs-fontWeight: 400;
|
|
6
7
|
//active
|
|
7
|
-
@
|
|
8
|
-
@
|
|
8
|
+
@tabs-color-active: @B60;
|
|
9
|
+
@tabs-fontWeight-active: 600;
|
|
9
10
|
|
|
10
11
|
//middle - default
|
|
11
|
-
@
|
|
12
|
-
@
|
|
13
|
-
@
|
|
12
|
+
@tabs-font-size: 14px;
|
|
13
|
+
@tabs-line-height: 20px;
|
|
14
|
+
@tabs-ink-link-bar-height: 2px;
|
|
14
15
|
//large
|
|
15
|
-
@
|
|
16
|
-
@
|
|
17
|
-
@
|
|
18
|
-
// @
|
|
16
|
+
@tabs-font-size-large: 16px;
|
|
17
|
+
@tabs-line-height-large: 24px;
|
|
18
|
+
@tabs-ink-link-bar-height-large: 3px;
|
|
19
|
+
// @tabs-
|
|
19
20
|
.ant-tabs.ald-tabs {
|
|
20
21
|
&.ant-tabs {
|
|
21
22
|
color: @NL30;
|
|
@@ -23,29 +24,29 @@
|
|
|
23
24
|
|
|
24
25
|
.ant-tabs-tab {
|
|
25
26
|
padding: 8px 0;
|
|
26
|
-
color: @
|
|
27
|
-
font-weight: @
|
|
28
|
-
font-size: @
|
|
29
|
-
line-height: @
|
|
27
|
+
color: @tabs-color;
|
|
28
|
+
font-weight: @tabs-fontWeight;
|
|
29
|
+
font-size: @tabs-font-size;
|
|
30
|
+
line-height: @tabs-line-height;
|
|
30
31
|
|
|
31
32
|
&:hover {
|
|
32
33
|
color: inherit;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
&.ant-tabs-tab-active {
|
|
36
|
-
font-weight: @
|
|
37
|
+
font-weight: @tabs-fontWeight-active;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
|
|
41
|
-
color: @
|
|
42
|
-
font-weight: @
|
|
42
|
+
color: @tabs-color-active;
|
|
43
|
+
font-weight: @tabs-fontWeight-active;
|
|
43
44
|
text-shadow: none;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.ant-tabs-ink-bar {
|
|
47
|
-
height: @
|
|
48
|
-
background: @
|
|
48
|
+
height: @tabs-ink-link-bar-height;
|
|
49
|
+
background: @tabs-color-active;
|
|
49
50
|
border-top-left-radius: 2px;
|
|
50
51
|
border-top-right-radius: 2px;
|
|
51
52
|
}
|
|
@@ -53,24 +54,55 @@
|
|
|
53
54
|
/* large size */
|
|
54
55
|
&.ant-tabs-large {
|
|
55
56
|
.ant-tabs-tab {
|
|
56
|
-
font-size: @
|
|
57
|
-
line-height: @
|
|
57
|
+
font-size: @tabs-font-size-large;
|
|
58
|
+
line-height: @tabs-line-height-large;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
.ant-tabs-ink-bar {
|
|
61
|
-
height: @
|
|
62
|
+
height: @tabs-ink-link-bar-height-large;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ald-tabs-moreIcon {
|
|
66
|
+
width: 36px;
|
|
67
|
+
height: 36px;
|
|
68
|
+
border-radius: 8px;
|
|
62
69
|
}
|
|
63
70
|
}
|
|
64
71
|
|
|
65
72
|
&.ald-tabs-default {
|
|
66
73
|
.ant-tabs-tab {
|
|
67
|
-
font-size: @
|
|
68
|
-
line-height: @
|
|
74
|
+
font-size: @tabs-font-size;
|
|
75
|
+
line-height: @tabs-line-height;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ald-tabs-moreIcon {
|
|
79
|
+
width: 32px;
|
|
80
|
+
height: 32px;
|
|
81
|
+
border-radius: 6px;
|
|
69
82
|
}
|
|
70
83
|
}
|
|
71
84
|
|
|
72
85
|
.ant-tabs-nav-more {
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
73
89
|
margin: 0 !important;
|
|
90
|
+
padding: 2px;
|
|
91
|
+
|
|
92
|
+
.ald-tabs-moreIcon {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
color: inherit;
|
|
97
|
+
font-size: inherit;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.ant-tabs-dropdown-open {
|
|
101
|
+
.ald-tabs-moreIcon {
|
|
102
|
+
color: @B60;
|
|
103
|
+
background-color: @NL97;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
74
106
|
}
|
|
75
107
|
|
|
76
108
|
/* body自适应高度 */
|