@kdcloudjs/kdesign 1.7.70 → 1.8.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/kdesign-complete.less +105 -10
- package/dist/kdesign.css +361 -66
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +4202 -440
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +13 -13
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/useId.d.ts +2 -0
- package/es/_utils/useId.js +30 -0
- package/es/date-picker/calendar.d.ts +3 -2
- package/es/date-picker/date-panel.d.ts +2 -1
- package/es/date-picker/date-picker.d.ts +4 -0
- package/es/date-picker/hooks/use-range-disabled.d.ts +3 -2
- package/es/date-picker/hooks/use-range-disabled.js +4 -2
- package/es/date-picker/interface.d.ts +2 -1
- package/es/date-picker/panel/month/month.d.ts +2 -2
- package/es/date-picker/panel/month/month.js +7 -3
- package/es/date-picker/panel/quarter/quarter.d.ts +2 -2
- package/es/date-picker/panel/quarter/quarter.js +7 -3
- package/es/date-picker/panel/week/week.d.ts +2 -1
- package/es/date-picker/panel/year/year.d.ts +2 -1
- package/es/date-picker/panel/year/year.js +7 -3
- package/es/date-picker/range-picker.js +3 -1
- package/es/date-picker/single/input-date.d.ts +2 -1
- package/es/popper/index.d.ts +54 -0
- package/es/popper/index.js +495 -0
- package/es/popper/style/css.js +2 -0
- package/es/popper/style/index.css +355 -0
- package/es/popper/style/index.d.ts +2 -0
- package/es/popper/style/index.js +2 -0
- package/es/popper/style/index.less +101 -0
- package/es/tooltip/style/index.css +4 -65
- package/es/tooltip/style/index.less +3 -10
- package/es/tooltip/tooltip.d.ts +3 -7
- package/es/tooltip/tooltip.js +10 -26
- package/lib/_utils/useId.d.ts +2 -0
- package/lib/_utils/useId.js +43 -0
- package/lib/date-picker/calendar.d.ts +3 -2
- package/lib/date-picker/date-panel.d.ts +2 -1
- package/lib/date-picker/date-picker.d.ts +4 -0
- package/lib/date-picker/hooks/use-range-disabled.d.ts +3 -2
- package/lib/date-picker/hooks/use-range-disabled.js +4 -2
- package/lib/date-picker/interface.d.ts +2 -1
- package/lib/date-picker/panel/month/month.d.ts +2 -2
- package/lib/date-picker/panel/month/month.js +7 -3
- package/lib/date-picker/panel/quarter/quarter.d.ts +2 -2
- package/lib/date-picker/panel/quarter/quarter.js +7 -3
- package/lib/date-picker/panel/week/week.d.ts +2 -1
- package/lib/date-picker/panel/year/year.d.ts +2 -1
- package/lib/date-picker/panel/year/year.js +7 -3
- package/lib/date-picker/range-picker.js +3 -1
- package/lib/date-picker/single/input-date.d.ts +2 -1
- package/lib/popper/index.d.ts +54 -0
- package/lib/popper/index.js +512 -0
- package/lib/popper/style/css.js +4 -0
- package/lib/popper/style/index.css +355 -0
- package/lib/popper/style/index.d.ts +2 -0
- package/lib/popper/style/index.js +4 -0
- package/lib/popper/style/index.less +101 -0
- package/lib/style/components.less +1 -0
- package/lib/tooltip/style/index.css +4 -65
- package/lib/tooltip/style/index.less +3 -10
- package/lib/tooltip/tooltip.d.ts +3 -7
- package/lib/tooltip/tooltip.js +10 -31
- package/package.json +8 -3
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/* ----------- color ——————---- start */
|
|
2
|
+
/* ----------- color ——————---- end */
|
|
3
|
+
/* ----------- motion ——————---- start */
|
|
4
|
+
/* ----------- motion ——————---- end */
|
|
5
|
+
/* ----------- transition ——————---- start */
|
|
6
|
+
/* ----------- transition ——————---- end */
|
|
7
|
+
/* ----------- font ——————---- start */
|
|
8
|
+
/* ----------- font ——————---- end */
|
|
9
|
+
/* ----------- zIndex ——————---- start */
|
|
10
|
+
/*
|
|
11
|
+
普通组件内部自身层级应设置在0-100间
|
|
12
|
+
*/
|
|
13
|
+
/* ----------- zIndex ——————---- end */
|
|
14
|
+
/* ----------- Button ——————---- start */
|
|
15
|
+
/* ----------- Button ——————---- end */
|
|
16
|
+
/* ----------- Collapse ——————---- start */
|
|
17
|
+
/* ----------- Collapse ——————---- end */
|
|
18
|
+
/* ----------- Card ——————---- start */
|
|
19
|
+
/* ----------- Card ——————---- end */
|
|
20
|
+
/* ----------- Carousel ——————---- start */
|
|
21
|
+
/* ----------- Carousel ——————---- end */
|
|
22
|
+
/* ----------- Cascader ——————---- start */
|
|
23
|
+
/* ----------- Cascader ——————---- end */
|
|
24
|
+
/* ----------- Switch ——————---- start */
|
|
25
|
+
/* ----------- Switch ——————---- end */
|
|
26
|
+
/* ----------- Input ——————---- start */
|
|
27
|
+
/* ----------- Input ——————---- end */
|
|
28
|
+
/* ----------- InputNumber ——————---- start */
|
|
29
|
+
/* ----------- InputNumber ——————---- end */
|
|
30
|
+
/* ----------- checkbox ——————---- start */
|
|
31
|
+
/* ----------- checkbox ——————---- start */
|
|
32
|
+
/* ----------- checkbox ——————---- end */
|
|
33
|
+
/* ----------- Radio ——————---- start */
|
|
34
|
+
/* ----------- Radio ——————---- end */
|
|
35
|
+
/* ----------- icon ——————---- start */
|
|
36
|
+
/* ----------- icon ——————---- end */
|
|
37
|
+
/* ----------- Popconfirm ——————---- start */
|
|
38
|
+
/* ----------- Popconfirm ——————---- end */
|
|
39
|
+
/* ----------- Progress ——————---- start */
|
|
40
|
+
/* ----------- Progress ——————---- end */
|
|
41
|
+
/* ----------- Pagination ——————---- start */
|
|
42
|
+
/* ----------- Pagination ——————---- end */
|
|
43
|
+
/* ----------- Timeline ——————---- start */
|
|
44
|
+
/* ----------- Timeline ——————---- end */
|
|
45
|
+
/* ----------- Tabs ——————---- start */
|
|
46
|
+
/* ----------- Tabs ——————---- end */
|
|
47
|
+
/* ----------- Select ——————---- start */
|
|
48
|
+
/* ----------- Select ——————---- end */
|
|
49
|
+
/* ----------- Rate ——————---- start */
|
|
50
|
+
/* ----------- Rate ——————---- end */
|
|
51
|
+
/* ----------- Dropdown ——————---- start */
|
|
52
|
+
/* ----------- Dropdown ——————---- end */
|
|
53
|
+
/* ----------- Tooltip ——————---- start */
|
|
54
|
+
/* ----------- Tooltip ——————---- end */
|
|
55
|
+
/* ----------- Transfer ——————---- start */
|
|
56
|
+
/* ----------- Transfer ——————---- end */
|
|
57
|
+
/* ----------- DatePicker ——————---- start */
|
|
58
|
+
/* ----------- DatePicker ——————---- end */
|
|
59
|
+
/* ----------- ColorPicker ——————---- start */
|
|
60
|
+
/* ----------- ColorPicker ——————---- end */
|
|
61
|
+
/* ----------- Tree ——————---- start */
|
|
62
|
+
/* ----------- Tree ——————---- end */
|
|
63
|
+
/* ----------- Alert ——————---- start */
|
|
64
|
+
/* ----------- Alert ——————---- end */
|
|
65
|
+
/* ----------- Split-Panel ——————---- start */
|
|
66
|
+
/* ----------- Split-Panel ——————---- end */
|
|
67
|
+
/* ----------- Modal ——————---- start */
|
|
68
|
+
/* ----------- Modal ——————---- end */
|
|
69
|
+
/* ----------- Steps ——————---- start */
|
|
70
|
+
/* ----------- Steps ——————---- end */
|
|
71
|
+
/* ----------- Form ——————---- start */
|
|
72
|
+
/* ----------- Form ——————---- end */
|
|
73
|
+
/* ----------- Tag ——————---- start */
|
|
74
|
+
/* ----------- Tag ——————---- end */
|
|
75
|
+
/* ----------- Menu ——————---- start */
|
|
76
|
+
/* ----------- Menu ——————---- end */
|
|
77
|
+
/* ----------- notice ——————---- start */
|
|
78
|
+
/* ----------- message ——————---- end */
|
|
79
|
+
/* ----------- Spin ——————---- start */
|
|
80
|
+
/* ----------- Spin ——————---- end */
|
|
81
|
+
/* ----------- Spin ——————---- start */
|
|
82
|
+
/* ----------- Spin ——————---- end */
|
|
83
|
+
/* ----------- Layout ——————---- start */
|
|
84
|
+
/* ----------- Layout ——————---- end */
|
|
85
|
+
/* ----------- Typography ——————---- start */
|
|
86
|
+
/* ----------- Typography ——————---- start */
|
|
87
|
+
/* ----------- Search ——————---- start */
|
|
88
|
+
/* ----------- Search ——————---- start */
|
|
89
|
+
/* ----------- Badge ——————---- start */
|
|
90
|
+
/* ----------- Badge ——————---- end */
|
|
91
|
+
/* ----------- Anchor ——————---- start */
|
|
92
|
+
/* ----------- Anchor ——————---- end */
|
|
93
|
+
/* ----------- Avatar ——————---- start */
|
|
94
|
+
/* ----------- Avatar ——————---- end */
|
|
95
|
+
/* ----------- AdvancedSelector ——————---- start */
|
|
96
|
+
/* ----------- AdvancedSelector ——————---- end */
|
|
97
|
+
/* ----------- motion ——————---- start */
|
|
98
|
+
/* ----------- motion ——————---- end */
|
|
99
|
+
/* ----------- transition ——————---- start */
|
|
100
|
+
/* ----------- transition ——————---- end */
|
|
101
|
+
/* ----------- zIndex ——————---- start */
|
|
102
|
+
/*
|
|
103
|
+
普通组件内部自身层级应设置在0-100间
|
|
104
|
+
*/
|
|
105
|
+
/* ----------- zIndex ——————---- end */
|
|
106
|
+
/* 多行显示省略号 */
|
|
107
|
+
/* 单行显示省略号 */
|
|
108
|
+
/** 浮层箭头样式 **/
|
|
109
|
+
.kd-popper {
|
|
110
|
+
opacity: 1;
|
|
111
|
+
z-index: var(--kd-g-z-index-popper, 1050);
|
|
112
|
+
visibility: visible;
|
|
113
|
+
}
|
|
114
|
+
.kd-popper.hidden {
|
|
115
|
+
opacity: 0;
|
|
116
|
+
visibility: hidden;
|
|
117
|
+
pointer-events: none;
|
|
118
|
+
}
|
|
119
|
+
.kd-popper .arrow {
|
|
120
|
+
visibility: hidden;
|
|
121
|
+
}
|
|
122
|
+
.kd-popper .arrow::before {
|
|
123
|
+
visibility: visible;
|
|
124
|
+
position: absolute;
|
|
125
|
+
border-style: solid;
|
|
126
|
+
border-color: transparent;
|
|
127
|
+
border-width: var(--arrowSize);
|
|
128
|
+
content: '';
|
|
129
|
+
-webkit-transform: rotate(45deg);
|
|
130
|
+
transform: rotate(45deg);
|
|
131
|
+
}
|
|
132
|
+
.kd-popper[data-popper-placement^='top'] .arrow {
|
|
133
|
+
bottom: calc(0.9 * var(--arrowSize));
|
|
134
|
+
}
|
|
135
|
+
.kd-popper[data-popper-placement^='top'] .arrow::before {
|
|
136
|
+
left: calc(-1 * var(--arrowSize));
|
|
137
|
+
border-top-color: transparent;
|
|
138
|
+
border-left-color: transparent;
|
|
139
|
+
}
|
|
140
|
+
.kd-popper[data-popper-placement^='bottom'] .arrow {
|
|
141
|
+
top: calc(-0.9 * var(--arrowSize));
|
|
142
|
+
}
|
|
143
|
+
.kd-popper[data-popper-placement^='bottom'] .arrow::before {
|
|
144
|
+
left: calc(-1 * var(--arrowSize));
|
|
145
|
+
border-bottom-color: transparent;
|
|
146
|
+
border-right-color: transparent;
|
|
147
|
+
}
|
|
148
|
+
.kd-popper[data-popper-placement^='left'] .arrow {
|
|
149
|
+
right: calc(0.9 * var(--arrowSize));
|
|
150
|
+
}
|
|
151
|
+
.kd-popper[data-popper-placement^='left'] .arrow::before {
|
|
152
|
+
top: calc(-1 * var(--arrowSize));
|
|
153
|
+
border-left-color: transparent;
|
|
154
|
+
border-bottom-color: transparent;
|
|
155
|
+
}
|
|
156
|
+
.kd-popper[data-popper-placement^='right'] .arrow {
|
|
157
|
+
left: calc(-0.9 * var(--arrowSize));
|
|
158
|
+
}
|
|
159
|
+
.kd-popper[data-popper-placement^='right'] .arrow::before {
|
|
160
|
+
top: calc(-1 * var(--arrowSize));
|
|
161
|
+
border-top-color: transparent;
|
|
162
|
+
border-right-color: transparent;
|
|
163
|
+
}
|
|
164
|
+
.kd-popper-top {
|
|
165
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
166
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
167
|
+
}
|
|
168
|
+
.kd-popper-top-in {
|
|
169
|
+
-webkit-animation-name: kdZoomBottomIn;
|
|
170
|
+
animation-name: kdZoomBottomIn;
|
|
171
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
172
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
173
|
+
}
|
|
174
|
+
.kd-popper-top-out {
|
|
175
|
+
-webkit-animation-name: kdZoomBottomOut;
|
|
176
|
+
animation-name: kdZoomBottomOut;
|
|
177
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
178
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
179
|
+
}
|
|
180
|
+
.kd-popper-left {
|
|
181
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
182
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
183
|
+
}
|
|
184
|
+
.kd-popper-left-in {
|
|
185
|
+
-webkit-animation-name: kdZoomRightIn;
|
|
186
|
+
animation-name: kdZoomRightIn;
|
|
187
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
188
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
189
|
+
}
|
|
190
|
+
.kd-popper-left-out {
|
|
191
|
+
-webkit-animation-name: kdZoomRightOut;
|
|
192
|
+
animation-name: kdZoomRightOut;
|
|
193
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
194
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
195
|
+
}
|
|
196
|
+
.kd-popper-right {
|
|
197
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
198
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
199
|
+
}
|
|
200
|
+
.kd-popper-right-in {
|
|
201
|
+
-webkit-animation-name: kdZoomLeftIn;
|
|
202
|
+
animation-name: kdZoomLeftIn;
|
|
203
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
204
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
205
|
+
}
|
|
206
|
+
.kd-popper-right-out {
|
|
207
|
+
-webkit-animation-name: kdZoomLeftOut;
|
|
208
|
+
animation-name: kdZoomLeftOut;
|
|
209
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
210
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
211
|
+
}
|
|
212
|
+
.kd-popper-bottom {
|
|
213
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
214
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
215
|
+
}
|
|
216
|
+
.kd-popper-bottom-in {
|
|
217
|
+
-webkit-animation-name: kdZoomTopIn;
|
|
218
|
+
animation-name: kdZoomTopIn;
|
|
219
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
220
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
221
|
+
}
|
|
222
|
+
.kd-popper-bottom-out {
|
|
223
|
+
-webkit-animation-name: kdZoomTopOut;
|
|
224
|
+
animation-name: kdZoomTopOut;
|
|
225
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
226
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
227
|
+
}
|
|
228
|
+
.kd-popper-top-start {
|
|
229
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
230
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
231
|
+
}
|
|
232
|
+
.kd-popper-top-start-in {
|
|
233
|
+
-webkit-animation-name: kdZoomLeftBottomIn;
|
|
234
|
+
animation-name: kdZoomLeftBottomIn;
|
|
235
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
236
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
237
|
+
}
|
|
238
|
+
.kd-popper-top-start-out {
|
|
239
|
+
-webkit-animation-name: kdZoomLeftBottomOut;
|
|
240
|
+
animation-name: kdZoomLeftBottomOut;
|
|
241
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
242
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
243
|
+
}
|
|
244
|
+
.kd-popper-right-end {
|
|
245
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
246
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
247
|
+
}
|
|
248
|
+
.kd-popper-right-end-in {
|
|
249
|
+
-webkit-animation-name: kdZoomLeftBottomIn;
|
|
250
|
+
animation-name: kdZoomLeftBottomIn;
|
|
251
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
252
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
253
|
+
}
|
|
254
|
+
.kd-popper-right-end-out {
|
|
255
|
+
-webkit-animation-name: kdZoomLeftBottomOut;
|
|
256
|
+
animation-name: kdZoomLeftBottomOut;
|
|
257
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
258
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
259
|
+
}
|
|
260
|
+
.kd-popper-top-end {
|
|
261
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
262
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
263
|
+
}
|
|
264
|
+
.kd-popper-top-end-in {
|
|
265
|
+
-webkit-animation-name: kdZoomRightBottomIn;
|
|
266
|
+
animation-name: kdZoomRightBottomIn;
|
|
267
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
268
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
269
|
+
}
|
|
270
|
+
.kd-popper-top-end-out {
|
|
271
|
+
-webkit-animation-name: kdZoomRightBottomOut;
|
|
272
|
+
animation-name: kdZoomRightBottomOut;
|
|
273
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
274
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
275
|
+
}
|
|
276
|
+
.kd-popper-left-end {
|
|
277
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
278
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
279
|
+
}
|
|
280
|
+
.kd-popper-left-end-in {
|
|
281
|
+
-webkit-animation-name: kdZoomRightBottomIn;
|
|
282
|
+
animation-name: kdZoomRightBottomIn;
|
|
283
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
284
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
285
|
+
}
|
|
286
|
+
.kd-popper-left-end-out {
|
|
287
|
+
-webkit-animation-name: kdZoomRightBottomOut;
|
|
288
|
+
animation-name: kdZoomRightBottomOut;
|
|
289
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
290
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
291
|
+
}
|
|
292
|
+
.kd-popper-left-start {
|
|
293
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
294
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
295
|
+
}
|
|
296
|
+
.kd-popper-left-start-in {
|
|
297
|
+
-webkit-animation-name: kdZoomTopRightIn;
|
|
298
|
+
animation-name: kdZoomTopRightIn;
|
|
299
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
300
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
301
|
+
}
|
|
302
|
+
.kd-popper-left-start-out {
|
|
303
|
+
-webkit-animation-name: kdZoomTopRightOut;
|
|
304
|
+
animation-name: kdZoomTopRightOut;
|
|
305
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
306
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
307
|
+
}
|
|
308
|
+
.kd-popper-bottom-end {
|
|
309
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
310
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
311
|
+
}
|
|
312
|
+
.kd-popper-bottom-end-in {
|
|
313
|
+
-webkit-animation-name: kdZoomTopRightIn;
|
|
314
|
+
animation-name: kdZoomTopRightIn;
|
|
315
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
316
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
317
|
+
}
|
|
318
|
+
.kd-popper-bottom-end-out {
|
|
319
|
+
-webkit-animation-name: kdZoomTopRightOut;
|
|
320
|
+
animation-name: kdZoomTopRightOut;
|
|
321
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
322
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
323
|
+
}
|
|
324
|
+
.kd-popper-right-start {
|
|
325
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
326
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
327
|
+
}
|
|
328
|
+
.kd-popper-right-start-in {
|
|
329
|
+
-webkit-animation-name: kdZoomTopLeftIn;
|
|
330
|
+
animation-name: kdZoomTopLeftIn;
|
|
331
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
332
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
333
|
+
}
|
|
334
|
+
.kd-popper-right-start-out {
|
|
335
|
+
-webkit-animation-name: kdZoomTopLeftOut;
|
|
336
|
+
animation-name: kdZoomTopLeftOut;
|
|
337
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
338
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
339
|
+
}
|
|
340
|
+
.kd-popper-bottom-start {
|
|
341
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
342
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
343
|
+
}
|
|
344
|
+
.kd-popper-bottom-start-in {
|
|
345
|
+
-webkit-animation-name: kdZoomTopLeftIn;
|
|
346
|
+
animation-name: kdZoomTopLeftIn;
|
|
347
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
348
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
349
|
+
}
|
|
350
|
+
.kd-popper-bottom-start-out {
|
|
351
|
+
-webkit-animation-name: kdZoomTopLeftOut;
|
|
352
|
+
animation-name: kdZoomTopLeftOut;
|
|
353
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
354
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
355
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
@import '../../style/themes/index';
|
|
2
|
+
@import '../../style/mixins/index';
|
|
3
|
+
|
|
4
|
+
@popper-prefix-cls: ~'@{kd-prefix}-popper';
|
|
5
|
+
|
|
6
|
+
.@{popper-prefix-cls} {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
z-index: @z-index-popper;
|
|
9
|
+
visibility: visible;
|
|
10
|
+
|
|
11
|
+
&.hidden {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
visibility: hidden;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.arrow {
|
|
18
|
+
visibility: hidden;
|
|
19
|
+
|
|
20
|
+
&::before {
|
|
21
|
+
visibility: visible;
|
|
22
|
+
position: absolute;
|
|
23
|
+
border-style: solid;
|
|
24
|
+
border-color: transparent;
|
|
25
|
+
border-width: var(--arrowSize);
|
|
26
|
+
content: '';
|
|
27
|
+
transform: rotate(45deg);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&[data-popper-placement^='top'] .arrow {
|
|
32
|
+
bottom: calc(0.9 * var(--arrowSize));
|
|
33
|
+
|
|
34
|
+
&::before {
|
|
35
|
+
left: calc(-1 * var(--arrowSize));
|
|
36
|
+
border-top-color: transparent;
|
|
37
|
+
border-left-color: transparent;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&[data-popper-placement^='bottom'] .arrow {
|
|
42
|
+
top: calc(-0.9 * var(--arrowSize));
|
|
43
|
+
|
|
44
|
+
&::before {
|
|
45
|
+
left: calc(-1 * var(--arrowSize));
|
|
46
|
+
border-bottom-color: transparent;
|
|
47
|
+
border-right-color: transparent;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&[data-popper-placement^='left'] .arrow {
|
|
52
|
+
right: calc(0.9 * var(--arrowSize));
|
|
53
|
+
|
|
54
|
+
&::before {
|
|
55
|
+
top: calc(-1 * var(--arrowSize));
|
|
56
|
+
border-left-color: transparent;
|
|
57
|
+
border-bottom-color: transparent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&[data-popper-placement^='right'] .arrow {
|
|
62
|
+
left: calc(-0.9 * var(--arrowSize));
|
|
63
|
+
|
|
64
|
+
&::before {
|
|
65
|
+
top: calc(-1 * var(--arrowSize));
|
|
66
|
+
border-top-color: transparent;
|
|
67
|
+
border-right-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.popper-motion(@className, @keyframeName, @duration: calc(@transition-duration - 0.1s)) {
|
|
73
|
+
.@{className} {
|
|
74
|
+
animation-duration: @duration;
|
|
75
|
+
|
|
76
|
+
&-in {
|
|
77
|
+
animation-name: ~'@{keyframeName}In';
|
|
78
|
+
animation-timing-function: @ease-out;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&-out {
|
|
82
|
+
animation-name: ~'@{keyframeName}Out';
|
|
83
|
+
animation-timing-function: @ease-in;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.popper-motion(~'@{popper-prefix-cls}-top', kdZoomBottom);
|
|
89
|
+
.popper-motion(~'@{popper-prefix-cls}-left', kdZoomRight);
|
|
90
|
+
.popper-motion(~'@{popper-prefix-cls}-right', kdZoomLeft);
|
|
91
|
+
.popper-motion(~'@{popper-prefix-cls}-bottom', kdZoomTop);
|
|
92
|
+
.popper-motion(~'@{popper-prefix-cls}-top-start', kdZoomLeftBottom);
|
|
93
|
+
.popper-motion(~'@{popper-prefix-cls}-right-end', kdZoomLeftBottom);
|
|
94
|
+
.popper-motion(~'@{popper-prefix-cls}-top-end', kdZoomRightBottom);
|
|
95
|
+
.popper-motion(~'@{popper-prefix-cls}-left-end', kdZoomRightBottom);
|
|
96
|
+
.popper-motion(~'@{popper-prefix-cls}-left-start', kdZoomTopRight);
|
|
97
|
+
.popper-motion(~'@{popper-prefix-cls}-bottom-end', kdZoomTopRight);
|
|
98
|
+
.popper-motion(~'@{popper-prefix-cls}-right-start', kdZoomTopLeft);
|
|
99
|
+
.popper-motion(~'@{popper-prefix-cls}-bottom-start', kdZoomTopLeft);
|
|
100
|
+
|
|
101
|
+
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
@import "../notification/style/index.less";
|
|
35
35
|
@import "../pagination/style/index.less";
|
|
36
36
|
@import "../popconfirm/style/index.less";
|
|
37
|
+
@import "../popper/style/index.less";
|
|
37
38
|
@import "../progress/style/index.less";
|
|
38
39
|
@import "../qr-code/style/index.less";
|
|
39
40
|
@import "../radio/style/index.less";
|
|
@@ -122,70 +122,9 @@
|
|
|
122
122
|
font-size: var(--kd-c-tooltip-color-text, var(--kd-g-font-size-small, 12px));
|
|
123
123
|
line-height: 1.5;
|
|
124
124
|
background-color: var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff));
|
|
125
|
-
-webkit-
|
|
126
|
-
|
|
127
|
-
opacity: 1;
|
|
128
|
-
z-index: var(--kd-g-z-index-popper, 1050);
|
|
129
|
-
visibility: visible;
|
|
125
|
+
-webkit-filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
|
|
126
|
+
filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
|
|
130
127
|
}
|
|
131
|
-
.kd-tooltip.
|
|
132
|
-
|
|
133
|
-
visibility: hidden;
|
|
134
|
-
}
|
|
135
|
-
.kd-tooltip.arrow::before {
|
|
136
|
-
position: absolute;
|
|
137
|
-
z-index: -2;
|
|
138
|
-
background: var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff));
|
|
139
|
-
border-style: solid;
|
|
140
|
-
border-width: var(--arrowSize);
|
|
141
|
-
-webkit-transform: rotate(45deg);
|
|
142
|
-
transform: rotate(45deg);
|
|
143
|
-
content: '';
|
|
144
|
-
}
|
|
145
|
-
.kd-tooltip.arrow::after {
|
|
146
|
-
position: absolute;
|
|
147
|
-
z-index: -1;
|
|
148
|
-
top: 0;
|
|
149
|
-
right: 0;
|
|
150
|
-
bottom: 0;
|
|
151
|
-
left: 0;
|
|
152
|
-
content: '';
|
|
153
|
-
background: var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff));
|
|
154
|
-
border-radius: var(--kd-g-radius-border, 2px);
|
|
155
|
-
}
|
|
156
|
-
.kd-tooltip.arrow.bottomLeft::before,
|
|
157
|
-
.kd-tooltip.arrow.bottom::before,
|
|
158
|
-
.kd-tooltip.arrow.bottomRight::before {
|
|
159
|
-
left: var(--arrowLeft);
|
|
160
|
-
top: var(--arrowSpill);
|
|
161
|
-
-webkit-box-shadow: -2px -2px calc(6px - 1px) rgba(0, 0, 0, 0.1);
|
|
162
|
-
box-shadow: -2px -2px calc(6px - 1px) rgba(0, 0, 0, 0.1);
|
|
163
|
-
border-color: var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff)) transparent transparent var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff));
|
|
164
|
-
}
|
|
165
|
-
.kd-tooltip.arrow.topLeft::before,
|
|
166
|
-
.kd-tooltip.arrow.top::before,
|
|
167
|
-
.kd-tooltip.arrow.topRight::before {
|
|
168
|
-
left: var(--arrowLeft);
|
|
169
|
-
bottom: var(--arrowSpill);
|
|
170
|
-
-webkit-box-shadow: 3px 3px calc(6px + 1px) rgba(0, 0, 0, 0.15);
|
|
171
|
-
box-shadow: 3px 3px calc(6px + 1px) rgba(0, 0, 0, 0.15);
|
|
172
|
-
border-color: transparent var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff)) var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff)) transparent;
|
|
173
|
-
}
|
|
174
|
-
.kd-tooltip.arrow.leftTop::before,
|
|
175
|
-
.kd-tooltip.arrow.left::before,
|
|
176
|
-
.kd-tooltip.arrow.leftBottom::before {
|
|
177
|
-
top: var(--arrowTop);
|
|
178
|
-
right: var(--arrowSpill);
|
|
179
|
-
-webkit-box-shadow: 3px 0 6px rgba(0, 0, 0, 0.12), 0 -2px 6px rgba(204, 149, 149, 0.12);
|
|
180
|
-
box-shadow: 3px 0 6px rgba(0, 0, 0, 0.12), 0 -2px 6px rgba(204, 149, 149, 0.12);
|
|
181
|
-
border-color: var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff)) var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff)) transparent transparent;
|
|
182
|
-
}
|
|
183
|
-
.kd-tooltip.arrow.rightTop::before,
|
|
184
|
-
.kd-tooltip.arrow.right::before,
|
|
185
|
-
.kd-tooltip.arrow.rightBottom::before {
|
|
186
|
-
top: var(--arrowTop);
|
|
187
|
-
left: var(--arrowSpill);
|
|
188
|
-
-webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1), -2px 0 6px rgba(0, 0, 0, 0.1);
|
|
189
|
-
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1), -2px 0 6px rgba(0, 0, 0, 0.1);
|
|
190
|
-
border-color: transparent transparent var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff)) var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff));
|
|
128
|
+
.kd-tooltip .arrow::before {
|
|
129
|
+
border-color: var(--kd-c-tooltip-color-background, var(--kd-g-color-background, #fff));
|
|
191
130
|
}
|
|
@@ -13,16 +13,9 @@
|
|
|
13
13
|
font-size: @tooltip-font-size;
|
|
14
14
|
line-height: 1.5;
|
|
15
15
|
background-color: @tooltip-background-color;
|
|
16
|
-
|
|
17
|
-
opacity: 1;
|
|
18
|
-
z-index: @z-index-popper;
|
|
19
|
-
visibility: visible;
|
|
16
|
+
filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
visibility: hidden;
|
|
18
|
+
.arrow::before {
|
|
19
|
+
border-color: @tooltip-background-color;
|
|
24
20
|
}
|
|
25
|
-
|
|
26
|
-
// 箭头样式
|
|
27
|
-
.popperArrow(@tooltip-background-color, @tooltip-horizontal-gap, @tooltip-box-shadow-blur);
|
|
28
21
|
}
|
package/lib/tooltip/tooltip.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PopperProps } from '../
|
|
3
|
-
export declare type
|
|
4
|
-
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
tip?: React.ReactNode | RenderFunction;
|
|
7
|
-
}
|
|
8
|
-
declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<unknown>>;
|
|
2
|
+
import { PopperProps } from '../popper';
|
|
3
|
+
export declare type TooltipProps = PopperProps;
|
|
4
|
+
declare const Tooltip: React.ForwardRefExoticComponent<PopperProps & React.RefAttributes<unknown>>;
|
|
9
5
|
export default Tooltip;
|
package/lib/tooltip/tooltip.js
CHANGED
|
@@ -1,48 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
5
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
6
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
|
8
5
|
value: true
|
|
9
6
|
});
|
|
10
7
|
exports.default = void 0;
|
|
11
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
12
|
-
var _react =
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
10
|
var _utils = require("../_utils");
|
|
14
|
-
var _reactNode = require("../_utils/reactNode");
|
|
15
11
|
var _configProvider = require("../config-provider");
|
|
16
|
-
var
|
|
17
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
var _popper = _interopRequireDefault(require("../popper"));
|
|
19
13
|
var Tooltip = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
20
14
|
var _React$useContext = _react.default.useContext(_configProvider.ConfigContext),
|
|
21
15
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
22
16
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var prefixCls = getPrefixCls(pkgPrefixCls, 'tooltip', customPrefixcls);
|
|
32
|
-
var tiplocator = /*#__PURE__*/_react.default.cloneElement( /*#__PURE__*/_react.default.isValidElement(children) && !(0, _reactNode.isFragment)(children) ? children : /*#__PURE__*/_react.default.createElement("span", null, children), {
|
|
33
|
-
ref: /*#__PURE__*/_react.default.isValidElement(children) && !(0, _reactNode.isFragment)(children) && children.ref ? children.ref : ref
|
|
34
|
-
});
|
|
35
|
-
var onVisibleChange = function onVisibleChange(v) {
|
|
36
|
-
if (status.current === v && allProps.visible === undefined) return;
|
|
37
|
-
status.current = v;
|
|
38
|
-
props.onVisibleChange && props.onVisibleChange(v);
|
|
39
|
-
};
|
|
40
|
-
var popperProps = (0, _extends2.default)((0, _extends2.default)({}, allProps), {
|
|
41
|
-
prefixCls: prefixCls,
|
|
42
|
-
onVisibleChange: onVisibleChange
|
|
43
|
-
});
|
|
44
|
-
var tipPopper = typeof tip === 'function' ? tip() : tip;
|
|
45
|
-
return (0, _usePopper.default)(tiplocator, tipPopper, popperProps);
|
|
17
|
+
compDefaultProps = _React$useContext.compDefaultProps;
|
|
18
|
+
var allProps = (0, _utils.getCompProps)('ToolTip', compDefaultProps, props);
|
|
19
|
+
var prefixCls = getPrefixCls(pkgPrefixCls, 'tooltip', allProps === null || allProps === void 0 ? void 0 : allProps.prefixCls);
|
|
20
|
+
var popperProps = (0, _extends2.default)({
|
|
21
|
+
ref: ref,
|
|
22
|
+
prefixCls: prefixCls
|
|
23
|
+
}, allProps);
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_popper.default, (0, _extends2.default)({}, popperProps));
|
|
46
25
|
});
|
|
47
26
|
Tooltip.displayName = 'Tooltip';
|
|
48
27
|
var _default = Tooltip;
|