@kdcloudjs/kdesign 1.8.14 → 1.8.16
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 +297 -81
- package/dist/kdesign.css +269 -58
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +987 -543
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +3 -3
- package/dist/kdesign.min.js +10 -10
- package/dist/kdesign.min.js.map +1 -1
- package/es/breadcrumb/breadcrumb.js +2 -2
- package/es/button/group.d.ts +1 -1
- package/es/button/group.js +5 -3
- package/es/city-picker/city-picker.js +12 -27
- package/es/city-picker/option.js +1 -5
- package/es/city-picker/style/index.css +8 -0
- package/es/city-picker/style/index.less +10 -0
- package/es/color-picker/color-picker-panel.js +332 -82
- package/es/color-picker/color-picker.js +128 -58
- package/es/color-picker/constant/colorTypes.js +4 -4
- package/es/color-picker/constant/defaultColor.d.ts +1 -1
- package/es/color-picker/constant/defaultColor.js +1 -1
- package/es/color-picker/interface.d.ts +33 -11
- package/es/color-picker/style/index.css +256 -53
- package/es/color-picker/style/index.less +277 -73
- package/es/color-picker/style/token.less +6 -2
- package/es/color-picker/utils/colorFormat.d.ts +5 -1
- package/es/color-picker/utils/colorFormat.js +10 -10
- package/es/color-picker/utils/convertLetters.d.ts +1 -0
- package/es/color-picker/utils/convertLetters.js +12 -0
- package/es/color-picker/utils/validateColor.js +12 -9
- package/es/config-provider/compDefaultProps.d.ts +8 -0
- package/es/config-provider/compDefaultProps.js +8 -0
- package/es/popper/index.d.ts +1 -1
- package/es/popper/index.js +4 -1
- package/es/popper/style/index.css +4 -4
- package/es/popper/style/index.less +4 -6
- package/es/signature/signature.d.ts +1 -0
- package/es/signature/signature.js +42 -8
- package/es/tree/tree.d.ts +1 -0
- package/es/tree/tree.js +3 -1
- package/es/tree/treeNode.d.ts +1 -0
- package/es/tree/treeNode.js +3 -2
- package/lib/breadcrumb/breadcrumb.js +2 -2
- package/lib/button/group.d.ts +1 -1
- package/lib/button/group.js +5 -3
- package/lib/city-picker/city-picker.js +12 -27
- package/lib/city-picker/option.js +1 -5
- package/lib/city-picker/style/index.css +8 -0
- package/lib/city-picker/style/index.less +10 -0
- package/lib/color-picker/color-picker-panel.js +329 -79
- package/lib/color-picker/color-picker.js +125 -55
- package/lib/color-picker/constant/colorTypes.js +4 -4
- package/lib/color-picker/constant/defaultColor.d.ts +1 -1
- package/lib/color-picker/constant/defaultColor.js +1 -1
- package/lib/color-picker/interface.d.ts +33 -11
- package/lib/color-picker/style/index.css +256 -53
- package/lib/color-picker/style/index.less +277 -73
- package/lib/color-picker/style/token.less +6 -2
- package/lib/color-picker/utils/colorFormat.d.ts +5 -1
- package/lib/color-picker/utils/colorFormat.js +10 -9
- package/lib/color-picker/utils/convertLetters.d.ts +1 -0
- package/lib/color-picker/utils/convertLetters.js +13 -0
- package/lib/color-picker/utils/validateColor.js +12 -9
- package/lib/config-provider/compDefaultProps.d.ts +8 -0
- package/lib/config-provider/compDefaultProps.js +8 -0
- package/lib/popper/index.d.ts +1 -1
- package/lib/popper/index.js +4 -1
- package/lib/popper/style/index.css +4 -4
- package/lib/popper/style/index.less +4 -6
- package/lib/signature/signature.d.ts +1 -0
- package/lib/signature/signature.js +42 -8
- package/lib/tree/tree.d.ts +1 -0
- package/lib/tree/tree.js +3 -1
- package/lib/tree/treeNode.d.ts +1 -0
- package/lib/tree/treeNode.js +3 -2
- package/package.json +1 -1
|
@@ -8,44 +8,57 @@
|
|
|
8
8
|
position: relative;
|
|
9
9
|
width: @color-picker-input-sizing-width;
|
|
10
10
|
|
|
11
|
+
&-pure {
|
|
12
|
+
width: 28px;
|
|
13
|
+
|
|
14
|
+
.@{kd-prefix}-input-wrapper.@{color-picker-prefix-cls}-input {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
width: 100%;
|
|
19
|
+
|
|
20
|
+
.@{kd-prefix}-input-prefix {
|
|
21
|
+
margin-right: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.@{kd-prefix}-input-suffix {
|
|
25
|
+
margin-left: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.@{kd-prefix}-input {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
11
34
|
.@{color-picker-prefix-cls}-input {
|
|
12
35
|
width: @color-picker-input-sizing-width;
|
|
13
36
|
height: @color-picker-input-sizing-height;
|
|
37
|
+
padding: 0 8px;
|
|
14
38
|
border-bottom: 1px solid rgba(217, 217, 217, 1);
|
|
15
39
|
font-size: @color-picker-input-font-size;
|
|
16
40
|
}
|
|
17
41
|
|
|
18
42
|
.@{color-picker-prefix-cls}-icon-container {
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: 3px;
|
|
21
|
-
right: 6px;
|
|
22
43
|
cursor: pointer;
|
|
23
44
|
|
|
24
45
|
.@{color-picker-prefix-cls}-icon {
|
|
25
|
-
|
|
26
|
-
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
align-items: center;
|
|
49
|
+
width: @color-picker-input-prefix-sizing-width;
|
|
50
|
+
height: @color-picker-input-prefix-sizing-height;
|
|
27
51
|
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
28
52
|
border-radius: 2px;
|
|
29
53
|
line-height: 18px;
|
|
30
54
|
text-align: center;
|
|
31
55
|
color: @bg;
|
|
32
56
|
|
|
33
|
-
&-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.kdicon-arrow-down {
|
|
39
|
-
transform: rotate(180deg);
|
|
40
|
-
transition: transform @transition-duration-quickly ease-in-out;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&-down {
|
|
45
|
-
.kdicon-arrow-down {
|
|
46
|
-
transform: rotate(0deg);
|
|
47
|
-
transition: transform @transition-duration-quickly ease-in-out;
|
|
48
|
-
}
|
|
57
|
+
&-no-color-line {
|
|
58
|
+
width: @color-picker-input-prefix-line-sizing-width;
|
|
59
|
+
height: @color-picker-input-prefix-line-sizing-height;
|
|
60
|
+
background-color: #ff2e3d;
|
|
61
|
+
rotate: 45deg;
|
|
49
62
|
}
|
|
50
63
|
}
|
|
51
64
|
}
|
|
@@ -74,9 +87,74 @@
|
|
|
74
87
|
transform-origin: top left;
|
|
75
88
|
z-index: @color-picker-panel-z-index;
|
|
76
89
|
|
|
90
|
+
&>div {
|
|
91
|
+
margin-top: 12px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&-clear {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
font-size: 12px;
|
|
98
|
+
color: #666666;
|
|
99
|
+
line-height: 16px;
|
|
100
|
+
font-weight: 400;
|
|
101
|
+
|
|
102
|
+
&-box {
|
|
103
|
+
position: relative;
|
|
104
|
+
width: 16px;
|
|
105
|
+
height: 16px;
|
|
106
|
+
margin-right: 4px;
|
|
107
|
+
border: 1px solid rgba(217, 217, 217, 1);
|
|
108
|
+
border-radius: 2px;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
background-color: #fff;
|
|
111
|
+
|
|
112
|
+
&::after {
|
|
113
|
+
position: absolute;
|
|
114
|
+
left: 7.5px;
|
|
115
|
+
top: -3.5px;
|
|
116
|
+
content: '';
|
|
117
|
+
width: 1px;
|
|
118
|
+
height: 22.6px;
|
|
119
|
+
background-color: #ff2e3d;
|
|
120
|
+
rotate: 45deg;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.active {
|
|
124
|
+
content: '';
|
|
125
|
+
position: absolute;
|
|
126
|
+
top: -3px;
|
|
127
|
+
left: -3px;
|
|
128
|
+
width: 20px;
|
|
129
|
+
height: 20px;
|
|
130
|
+
border: 1px solid rgba(217, 217, 217, 1);
|
|
131
|
+
border-radius: 4px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
&::before {
|
|
136
|
+
.active;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&:active {
|
|
141
|
+
&::before {
|
|
142
|
+
.active;
|
|
143
|
+
border: 1px solid rgba(148, 148, 148, 1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&-text {
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
color: #666666;
|
|
151
|
+
line-height: 16px;
|
|
152
|
+
font-weight: 400;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
77
156
|
&-chrome {
|
|
78
157
|
width: 278px !important;
|
|
79
|
-
margin-top: 12px;
|
|
80
158
|
box-shadow: none !important;
|
|
81
159
|
|
|
82
160
|
&>div:last-child {
|
|
@@ -191,7 +269,6 @@
|
|
|
191
269
|
}
|
|
192
270
|
|
|
193
271
|
&-switch {
|
|
194
|
-
margin: 12px 0 0;
|
|
195
272
|
font-size: 12px;
|
|
196
273
|
color: #666666;
|
|
197
274
|
letter-spacing: 0;
|
|
@@ -207,21 +284,36 @@
|
|
|
207
284
|
&-container {
|
|
208
285
|
display: flex;
|
|
209
286
|
flex-wrap: nowrap;
|
|
210
|
-
margin-top: 10px;
|
|
211
287
|
|
|
212
|
-
&-
|
|
213
|
-
flex:
|
|
288
|
+
&-select {
|
|
289
|
+
flex: 0 0 64px;
|
|
214
290
|
display: inline-block;
|
|
215
291
|
position: relative;
|
|
292
|
+
margin-right: 8px;
|
|
216
293
|
font-size: @color-picker-panel-select-font-size;
|
|
217
294
|
|
|
295
|
+
.@{kd-prefix}-select {
|
|
296
|
+
width: 64px;
|
|
297
|
+
|
|
298
|
+
.@{kd-prefix}-select,
|
|
299
|
+
.@{kd-prefix}-select-selection-item {
|
|
300
|
+
overflow: visible;
|
|
301
|
+
text-overflow: unset;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&-suffix {
|
|
305
|
+
padding-right: 4px;
|
|
306
|
+
margin-left: 0;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
218
310
|
.@{kd-prefix}-select-dropdown-panel {
|
|
219
311
|
margin: 0 !important;
|
|
220
312
|
|
|
221
313
|
&.bottomLeft,
|
|
222
314
|
&.topLeft {
|
|
223
315
|
position: absolute;
|
|
224
|
-
width:
|
|
316
|
+
width: 64px !important;
|
|
225
317
|
min-width: unset !important;
|
|
226
318
|
background: #FFFFFF;
|
|
227
319
|
right: 0;
|
|
@@ -245,10 +337,6 @@
|
|
|
245
337
|
height: @color-picker-panel-select-sizing-height;
|
|
246
338
|
min-height: 28px;
|
|
247
339
|
padding: 0 28px 0 0;
|
|
248
|
-
|
|
249
|
-
.@{kd-prefix}-select-placeholder {
|
|
250
|
-
left: 8px;
|
|
251
|
-
}
|
|
252
340
|
}
|
|
253
341
|
|
|
254
342
|
.active-option {
|
|
@@ -256,74 +344,190 @@
|
|
|
256
344
|
}
|
|
257
345
|
}
|
|
258
346
|
|
|
347
|
+
&-input {
|
|
348
|
+
height: 28px;
|
|
349
|
+
flex: 1 1 auto;
|
|
350
|
+
padding: 0 8px;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
&-input-group {
|
|
354
|
+
display: flex;
|
|
355
|
+
align-items: center;
|
|
356
|
+
|
|
357
|
+
&-item {
|
|
358
|
+
height: 28px;
|
|
359
|
+
flex: 1;
|
|
360
|
+
|
|
361
|
+
&.active {
|
|
362
|
+
z-index: 2;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
&:first-child {
|
|
366
|
+
border-top-right-radius: 0;
|
|
367
|
+
border-bottom-right-radius: 0;
|
|
368
|
+
z-index: 1;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
&:nth-child(2) {
|
|
372
|
+
margin-right: -1px;
|
|
373
|
+
margin-left: -1px;
|
|
374
|
+
border-radius: 0;
|
|
375
|
+
|
|
376
|
+
&:hover {
|
|
377
|
+
z-index: 1;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
&:last-child {
|
|
382
|
+
border-top-left-radius: 0;
|
|
383
|
+
border-bottom-left-radius: 0;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
259
388
|
&-transparent {
|
|
260
|
-
flex: 0
|
|
389
|
+
flex: 0 0 54px;
|
|
261
390
|
height: 28px;
|
|
262
391
|
margin-left: 8px;
|
|
392
|
+
padding: 0;
|
|
263
393
|
text-align: center;
|
|
264
394
|
font-size: @color-picker-panel-alpha-font-size;
|
|
265
395
|
}
|
|
266
396
|
}
|
|
267
397
|
|
|
268
|
-
&-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
398
|
+
&-historical-color-box {
|
|
399
|
+
&-title {
|
|
400
|
+
font-size: 12px;
|
|
401
|
+
color: #666666;
|
|
402
|
+
line-height: 18px;
|
|
403
|
+
font-weight: 400;
|
|
404
|
+
margin-bottom: 8px;
|
|
405
|
+
}
|
|
274
406
|
|
|
275
|
-
&-
|
|
276
|
-
display:
|
|
277
|
-
|
|
407
|
+
&-container {
|
|
408
|
+
display: grid;
|
|
409
|
+
grid-template-columns: repeat(12, 1fr);
|
|
410
|
+
grid-column-gap: 8px;
|
|
411
|
+
grid-row-gap: 8px;
|
|
412
|
+
|
|
413
|
+
&-ie11 {
|
|
414
|
+
display: flex;
|
|
415
|
+
flex-wrap: wrap;
|
|
416
|
+
|
|
417
|
+
li {
|
|
418
|
+
margin-right: 8px;
|
|
419
|
+
margin-top: 8px;
|
|
420
|
+
|
|
421
|
+
&:nth-child(12n) {
|
|
422
|
+
margin-right: 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
&:nth-child(-n+12) {
|
|
426
|
+
margin-top: 0;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
278
430
|
|
|
279
431
|
li {
|
|
280
|
-
|
|
281
|
-
|
|
432
|
+
position: relative;
|
|
433
|
+
box-sizing: border-box;
|
|
434
|
+
width: @color-picker-panel-historical-sizing-width;
|
|
435
|
+
height: @color-picker-panel-historical-sizing-height;
|
|
436
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
437
|
+
border-radius: 2px;
|
|
438
|
+
list-style: none;
|
|
439
|
+
cursor: pointer;
|
|
282
440
|
|
|
283
|
-
|
|
284
|
-
|
|
441
|
+
.square {
|
|
442
|
+
display: none;
|
|
443
|
+
position: absolute;
|
|
444
|
+
box-sizing: inherit;
|
|
445
|
+
top: -3px;
|
|
446
|
+
left: -3px;
|
|
447
|
+
width: calc(@color-picker-panel-historical-sizing-width + 4px);
|
|
448
|
+
height: calc(@color-picker-panel-historical-sizing-height + 4px);
|
|
449
|
+
border: 1px solid rgba(178, 178, 176, 1);
|
|
450
|
+
border-radius: 4px;
|
|
451
|
+
|
|
452
|
+
&-click {
|
|
453
|
+
display: block;
|
|
454
|
+
box-shadow: 0 0 0 1px #e5e5e5 !important;
|
|
455
|
+
}
|
|
285
456
|
}
|
|
286
457
|
|
|
287
|
-
&:
|
|
288
|
-
|
|
458
|
+
&:hover {
|
|
459
|
+
.square {
|
|
460
|
+
display: block;
|
|
461
|
+
}
|
|
289
462
|
}
|
|
290
463
|
}
|
|
291
464
|
}
|
|
465
|
+
}
|
|
292
466
|
|
|
293
|
-
|
|
294
|
-
|
|
467
|
+
&-color-box {
|
|
468
|
+
&-title {
|
|
469
|
+
font-size: 12px;
|
|
470
|
+
color: #666666;
|
|
471
|
+
line-height: 18px;
|
|
472
|
+
font-weight: 400;
|
|
473
|
+
margin-bottom: 8px;
|
|
295
474
|
}
|
|
296
475
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
303
|
-
border-radius: 2px;
|
|
304
|
-
list-style: none;
|
|
305
|
-
cursor: pointer;
|
|
476
|
+
&-container {
|
|
477
|
+
display: grid;
|
|
478
|
+
grid-template-columns: repeat(12, 1fr);
|
|
479
|
+
grid-column-gap: 8px;
|
|
480
|
+
grid-row-gap: 8px;
|
|
306
481
|
|
|
307
|
-
|
|
308
|
-
display:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
482
|
+
&-ie11 {
|
|
483
|
+
display: flex;
|
|
484
|
+
flex-wrap: wrap;
|
|
485
|
+
|
|
486
|
+
li {
|
|
487
|
+
margin-right: 8px;
|
|
488
|
+
margin-top: 8px;
|
|
489
|
+
|
|
490
|
+
&:nth-child(12n) {
|
|
491
|
+
margin-right: 0;
|
|
492
|
+
}
|
|
317
493
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
494
|
+
&:nth-child(-n+12) {
|
|
495
|
+
margin-top: 0;
|
|
496
|
+
}
|
|
321
497
|
}
|
|
322
498
|
}
|
|
323
499
|
|
|
324
|
-
|
|
500
|
+
li {
|
|
501
|
+
position: relative;
|
|
502
|
+
box-sizing: border-box;
|
|
503
|
+
width: @color-picker-panel-preset-sizing-width;
|
|
504
|
+
height: @color-picker-panel-preset-sizing-height;
|
|
505
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
506
|
+
border-radius: 2px;
|
|
507
|
+
list-style: none;
|
|
508
|
+
cursor: pointer;
|
|
509
|
+
|
|
325
510
|
.square {
|
|
326
|
-
display:
|
|
511
|
+
display: none;
|
|
512
|
+
position: absolute;
|
|
513
|
+
box-sizing: inherit;
|
|
514
|
+
top: -3px;
|
|
515
|
+
left: -3px;
|
|
516
|
+
width: calc(@color-picker-panel-preset-sizing-width + 4px);
|
|
517
|
+
height: calc(@color-picker-panel-preset-sizing-height + 4px);
|
|
518
|
+
border: 1px solid rgba(178, 178, 176, 1);
|
|
519
|
+
border-radius: 4px;
|
|
520
|
+
|
|
521
|
+
&-click {
|
|
522
|
+
display: block;
|
|
523
|
+
box-shadow: 0 0 0 1px #e5e5e5 !important;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
&:hover {
|
|
528
|
+
.square {
|
|
529
|
+
display: block;
|
|
530
|
+
}
|
|
327
531
|
}
|
|
328
532
|
}
|
|
329
533
|
}
|
|
@@ -13,13 +13,17 @@
|
|
|
13
13
|
// sizing
|
|
14
14
|
@color-picker-input-sizing-width: var(~'@{color-picker-custom-prefix}-input-sizing-width', 230px);
|
|
15
15
|
@color-picker-input-sizing-height: var(~'@{color-picker-custom-prefix}-input-sizing-height', 28px);
|
|
16
|
-
@color-picker-input-
|
|
17
|
-
@color-picker-input-
|
|
16
|
+
@color-picker-input-prefix-sizing-width: var(~'@{color-picker-custom-prefix}-input-prefix-sizing-width', 16px);
|
|
17
|
+
@color-picker-input-prefix-line-sizing-width: var(~'@{color-picker-custom-prefix}-input-prefix-line-sizing-width', 1px);
|
|
18
|
+
@color-picker-input-prefix-line-sizing-height: var(~'@{color-picker-custom-prefix}-input-prefix-line-sizing-height', 22.6px);
|
|
19
|
+
@color-picker-input-prefix-sizing-height: var(~'@{color-picker-custom-prefix}-input-prefix-sizing-height', 16px);
|
|
18
20
|
@color-picker-panel-sizing-width: var(~'@{color-picker-custom-prefix}-panel-sizing-width', 304px);
|
|
19
21
|
@color-picker-panel-select-sizing-width: var(~'@{color-picker-custom-prefix}-panel-select-sizing-width', 212px);
|
|
20
22
|
@color-picker-panel-select-sizing-height: var(~'@{color-picker-custom-prefix}-panel-select-sizing-height', 28px);
|
|
21
23
|
@color-picker-panel-preset-sizing-width: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-width', 16px);
|
|
22
24
|
@color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
|
|
25
|
+
@color-picker-panel-historical-sizing-width: var(~'@{color-picker-custom-prefix}-panel-historical-sizing-width', 16px);
|
|
26
|
+
@color-picker-panel-historical-sizing-height: var(~'@{color-picker-custom-prefix}-panel-historical-sizing-height', 16px);
|
|
23
27
|
|
|
24
28
|
// z-index
|
|
25
29
|
@color-picker-panel-z-index: var(~'@{color-picker-custom-prefix}-panel-z-index', @z-index-popper);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
declare type IOutType = 'HEX' | 'HSB' | 'HSL' | 'RGB' | 'all';
|
|
2
|
-
export declare const colorFormat: (colorStr: string, alpha?: number, outType?: IOutType, formatHex?: boolean) =>
|
|
2
|
+
export declare const colorFormat: (colorStr: string, alpha?: number, outType?: IOutType, formatHex?: boolean) => string | {
|
|
3
|
+
type: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[] | undefined;
|
|
3
6
|
export declare const getColorObj: (colorStr: string) => string | {
|
|
4
7
|
h: string;
|
|
5
8
|
s: number;
|
|
@@ -11,6 +14,7 @@ export declare const getColorObj: (colorStr: string) => string | {
|
|
|
11
14
|
v: number;
|
|
12
15
|
alpha: number;
|
|
13
16
|
};
|
|
17
|
+
export declare const colorToStr: (obj: any) => string;
|
|
14
18
|
export declare const strFixed: (numStr: string | number, num?: number) => number;
|
|
15
19
|
export declare const valOfCorrespondingType: (currentColorType: string) => number | undefined;
|
|
16
20
|
export declare const highlightPresetColorIndex: (color: string, colorArr: string[]) => number;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.valOfCorrespondingType = exports.strFixed = exports.presetColorToHEX = exports.highlightPresetColorIndex = exports.getColorObj = exports.colorFormat = void 0;
|
|
7
|
+
exports.valOfCorrespondingType = exports.strFixed = exports.presetColorToHEX = exports.highlightPresetColorIndex = exports.getColorObj = exports.colorToStr = exports.colorFormat = void 0;
|
|
8
8
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
9
9
|
var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
|
|
10
10
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
@@ -19,18 +19,18 @@ var colorFormat = function colorFormat(colorStr) {
|
|
|
19
19
|
var toHex = function toHex() {
|
|
20
20
|
if (/^#([0-9a-fA-F]{8})$/.test(colorStr)) {
|
|
21
21
|
if (formatHex) {
|
|
22
|
-
return (0, _convertLetters.
|
|
22
|
+
return (0, _convertLetters.toUpCase)(alpha === 1 ? ColorTools.hex() : ColorTools.hexa());
|
|
23
23
|
} else {
|
|
24
24
|
return colorStr;
|
|
25
25
|
}
|
|
26
26
|
} else {
|
|
27
|
-
return (0, _convertLetters.
|
|
27
|
+
return (0, _convertLetters.toUpCase)(alpha === 1 ? ColorTools.hex() : ColorTools.hexa());
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
var HEX = toHex();
|
|
31
|
-
var HSB = colorToStr(ColorTools.hsv());
|
|
32
|
-
var RGB = ColorTools.rgb().string();
|
|
33
|
-
var HSL = colorToStr(ColorTools.hsl());
|
|
30
|
+
var HEX = (0, _convertLetters.toUpCase)(toHex());
|
|
31
|
+
var HSB = (0, _convertLetters.toUpCase)(colorToStr(ColorTools.hsv()));
|
|
32
|
+
var RGB = (0, _convertLetters.toUpCase)(ColorTools.rgb().string());
|
|
33
|
+
var HSL = (0, _convertLetters.toUpCase)(colorToStr(ColorTools.hsl()));
|
|
34
34
|
if (outType === 'HEX') return HEX;
|
|
35
35
|
if (outType === 'HSB') return HSB;
|
|
36
36
|
if (outType === 'HSL') return HSL;
|
|
@@ -53,7 +53,7 @@ var colorFormat = function colorFormat(colorStr) {
|
|
|
53
53
|
};
|
|
54
54
|
exports.colorFormat = colorFormat;
|
|
55
55
|
var getColorObj = function getColorObj(colorStr) {
|
|
56
|
-
var colorArray = colorStr.split(',');
|
|
56
|
+
var colorArray = (0, _convertLetters.toLowerCase)(colorStr).split(',');
|
|
57
57
|
var type = (0, _validateColor.validateColor)(colorStr);
|
|
58
58
|
if (type === 'HSB' || type === 'HSBA') {
|
|
59
59
|
var s = removePercentage(colorArray[1]);
|
|
@@ -125,6 +125,7 @@ var colorToStr = function colorToStr(obj) {
|
|
|
125
125
|
return (0, _concat.default)(_context14 = (0, _concat.default)(_context15 = (0, _concat.default)(_context16 = (0, _concat.default)(_context17 = "".concat(obj.model === 'hsv' ? 'hsba' : 'hsla', "(")).call(_context17, strFixed(arr[0]), ", ")).call(_context16, strFixed(arr[1]), "%, ")).call(_context15, strFixed(arr[2]), "%, ")).call(_context14, strFixed(obj.valpha, 2), ")");
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
+
exports.colorToStr = colorToStr;
|
|
128
129
|
var strFixed = function strFixed(numStr) {
|
|
129
130
|
var num = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
130
131
|
return +(+numStr).toFixed(num);
|
|
@@ -159,7 +160,7 @@ exports.highlightPresetColorIndex = highlightPresetColorIndex;
|
|
|
159
160
|
var presetColorToHEX = function presetColorToHEX(colorArr) {
|
|
160
161
|
if (!colorArr) return [];
|
|
161
162
|
var hexColorArr = (0, _map.default)(colorArr).call(colorArr, function (color) {
|
|
162
|
-
return colorFormat(color,
|
|
163
|
+
return colorFormat(color, (0, _color.default)(getColorObj(color)).alpha(), 'HEX');
|
|
163
164
|
});
|
|
164
165
|
return hexColorArr;
|
|
165
166
|
};
|
|
@@ -4,6 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.toLowerCase = toLowerCase;
|
|
7
|
+
exports.toUpCase = toUpCase;
|
|
8
|
+
function toUpCase(str) {
|
|
9
|
+
var result = '';
|
|
10
|
+
for (var i = 0; i < str.length; i++) {
|
|
11
|
+
var charCode = str.charCodeAt(i);
|
|
12
|
+
if (charCode >= 97 && charCode <= 122) {
|
|
13
|
+
result += String.fromCharCode(charCode - 32);
|
|
14
|
+
} else {
|
|
15
|
+
result += str[i];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
7
20
|
function toLowerCase(str) {
|
|
8
21
|
var result = '';
|
|
9
22
|
for (var i = 0; i < str.length; i++) {
|
|
@@ -4,7 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validateColor = validateColor;
|
|
7
|
+
var _convertLetters = require("./convertLetters");
|
|
7
8
|
function validateColor(color) {
|
|
9
|
+
if (!color) return '';
|
|
10
|
+
var lowerColor = (0, _convertLetters.toLowerCase)(color);
|
|
8
11
|
var hexReg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
9
12
|
var hexaReg = /^#([0-9a-fA-F]{8})$/;
|
|
10
13
|
var hsbReg = /^hsb\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*\)$/;
|
|
@@ -14,14 +17,14 @@ function validateColor(color) {
|
|
|
14
17
|
var hslReg = /^hsl\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*\)$/;
|
|
15
18
|
var hslaReg = /^hsla\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*,\s*(-?\d+|-?\d*\.\d+)\)$/;
|
|
16
19
|
var colorNameReg = /^(?:aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)$/;
|
|
17
|
-
if (hexReg.test(
|
|
18
|
-
if (hexaReg.test(
|
|
19
|
-
if (hsbReg.test(
|
|
20
|
-
if (hsbaReg.test(
|
|
21
|
-
if (rgbaReg.test(
|
|
22
|
-
if (rgbReg.test(
|
|
23
|
-
if (hslReg.test(
|
|
24
|
-
if (hslaReg.test(
|
|
25
|
-
if (colorNameReg.test(
|
|
20
|
+
if (hexReg.test(lowerColor)) return 'HEX';
|
|
21
|
+
if (hexaReg.test(lowerColor)) return 'HEXA';
|
|
22
|
+
if (hsbReg.test(lowerColor)) return 'HSB';
|
|
23
|
+
if (hsbaReg.test(lowerColor)) return 'HSBA';
|
|
24
|
+
if (rgbaReg.test(lowerColor)) return 'RGBA';
|
|
25
|
+
if (rgbReg.test(lowerColor)) return 'RGB';
|
|
26
|
+
if (hslReg.test(lowerColor)) return 'HSL';
|
|
27
|
+
if (hslaReg.test(lowerColor)) return 'HSLA';
|
|
28
|
+
if (colorNameReg.test(lowerColor)) return 'colorName';
|
|
26
29
|
return '';
|
|
27
30
|
}
|
|
@@ -73,6 +73,9 @@ declare const compDefaultProps: {
|
|
|
73
73
|
internationalName: string;
|
|
74
74
|
};
|
|
75
75
|
placeholder: string;
|
|
76
|
+
pure: boolean;
|
|
77
|
+
showAlphaInput: boolean;
|
|
78
|
+
showClear: boolean;
|
|
76
79
|
showColorTransfer: boolean;
|
|
77
80
|
showPresetColor: boolean;
|
|
78
81
|
showColorPickerBox: {
|
|
@@ -80,6 +83,11 @@ declare const compDefaultProps: {
|
|
|
80
83
|
showHue: boolean;
|
|
81
84
|
showOpacity: boolean;
|
|
82
85
|
};
|
|
86
|
+
format: string;
|
|
87
|
+
panelFormatConfig: {
|
|
88
|
+
show: string[];
|
|
89
|
+
default: string;
|
|
90
|
+
};
|
|
83
91
|
};
|
|
84
92
|
Checkbox: {
|
|
85
93
|
defaultChecked: boolean;
|
|
@@ -83,12 +83,20 @@ var compDefaultProps = {
|
|
|
83
83
|
internationalName: 'followFunctionalColor'
|
|
84
84
|
},
|
|
85
85
|
placeholder: '#',
|
|
86
|
+
pure: false,
|
|
87
|
+
showAlphaInput: true,
|
|
88
|
+
showClear: true,
|
|
86
89
|
showColorTransfer: true,
|
|
87
90
|
showPresetColor: true,
|
|
88
91
|
showColorPickerBox: {
|
|
89
92
|
showBox: false,
|
|
90
93
|
showHue: false,
|
|
91
94
|
showOpacity: false
|
|
95
|
+
},
|
|
96
|
+
format: 'HEX',
|
|
97
|
+
panelFormatConfig: {
|
|
98
|
+
show: ['HEX', 'HSB', 'RGB', 'HSL'],
|
|
99
|
+
default: 'HEX'
|
|
92
100
|
}
|
|
93
101
|
},
|
|
94
102
|
Checkbox: {
|
package/lib/popper/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const Placements: ["top", "left", "right", "bottom", "topLeft", "
|
|
|
4
4
|
export declare type PlacementType = typeof Placements[number];
|
|
5
5
|
export declare const Triggers: ["hover", "focus", "click", "contextMenu"];
|
|
6
6
|
export declare type TriggerType = typeof Triggers[number];
|
|
7
|
-
export declare type Reason = TriggerType | 'scroll' | 'clickOutside' | 'parentHidden' | 'unknown';
|
|
7
|
+
export declare type Reason = TriggerType | 'scroll' | 'clickOutside' | 'clickToClose' | 'parentHidden' | 'unknown';
|
|
8
8
|
export declare type RenderFunction = () => React.ReactNode;
|
|
9
9
|
export declare type PopperProps = {
|
|
10
10
|
gap?: number;
|
package/lib/popper/index.js
CHANGED
|
@@ -367,9 +367,12 @@ var Popper = (0, _react.forwardRef)(function (props, ref) {
|
|
|
367
367
|
var domReference = getRealDom(referenceRef, referenceElement);
|
|
368
368
|
var isReference = domReference ? domReference === e.target || ((_c = domReference === null || domReference === void 0 ? void 0 : domReference.contains) === null || _c === void 0 ? void 0 : _c.call(domReference, e.target)) : false;
|
|
369
369
|
var isTarget = trigger === 'contextMenu' ? isPopper : isPopper || isReference;
|
|
370
|
-
if (
|
|
370
|
+
if (!isTarget && !isSubPopper(e)) {
|
|
371
371
|
triggerOpen(false, 'clickOutside', 0);
|
|
372
372
|
}
|
|
373
|
+
if (clickToClose && isPopper) {
|
|
374
|
+
triggerOpen(false, 'clickToClose', 0);
|
|
375
|
+
}
|
|
373
376
|
}
|
|
374
377
|
}, 10, {
|
|
375
378
|
leading: true
|