@kdcloudjs/kdesign 1.8.15 → 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 +838 -379
- 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 +1 -0
- 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 +1 -0
- 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;
|
|
@@ -3,7 +3,7 @@ import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/in
|
|
|
3
3
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
4
4
|
import Color from 'color';
|
|
5
5
|
import { validateColor } from './validateColor';
|
|
6
|
-
import { toLowerCase } from './convertLetters';
|
|
6
|
+
import { toLowerCase, toUpCase } from './convertLetters';
|
|
7
7
|
export var colorFormat = function colorFormat(colorStr) {
|
|
8
8
|
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
9
9
|
var outType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'all';
|
|
@@ -12,18 +12,18 @@ export var colorFormat = function colorFormat(colorStr) {
|
|
|
12
12
|
var toHex = function toHex() {
|
|
13
13
|
if (/^#([0-9a-fA-F]{8})$/.test(colorStr)) {
|
|
14
14
|
if (formatHex) {
|
|
15
|
-
return
|
|
15
|
+
return toUpCase(alpha === 1 ? ColorTools.hex() : ColorTools.hexa());
|
|
16
16
|
} else {
|
|
17
17
|
return colorStr;
|
|
18
18
|
}
|
|
19
19
|
} else {
|
|
20
|
-
return
|
|
20
|
+
return toUpCase(alpha === 1 ? ColorTools.hex() : ColorTools.hexa());
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
var HEX = toHex();
|
|
24
|
-
var HSB = colorToStr(ColorTools.hsv());
|
|
25
|
-
var RGB = ColorTools.rgb().string();
|
|
26
|
-
var HSL = colorToStr(ColorTools.hsl());
|
|
23
|
+
var HEX = toUpCase(toHex());
|
|
24
|
+
var HSB = toUpCase(colorToStr(ColorTools.hsv()));
|
|
25
|
+
var RGB = toUpCase(ColorTools.rgb().string());
|
|
26
|
+
var HSL = toUpCase(colorToStr(ColorTools.hsl()));
|
|
27
27
|
if (outType === 'HEX') return HEX;
|
|
28
28
|
if (outType === 'HSB') return HSB;
|
|
29
29
|
if (outType === 'HSL') return HSL;
|
|
@@ -45,7 +45,7 @@ export var colorFormat = function colorFormat(colorStr) {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
export var getColorObj = function getColorObj(colorStr) {
|
|
48
|
-
var colorArray = colorStr.split(',');
|
|
48
|
+
var colorArray = toLowerCase(colorStr).split(',');
|
|
49
49
|
var type = validateColor(colorStr);
|
|
50
50
|
if (type === 'HSB' || type === 'HSBA') {
|
|
51
51
|
var s = removePercentage(colorArray[1]);
|
|
@@ -106,7 +106,7 @@ var addPercentage = function addPercentage(parameter) {
|
|
|
106
106
|
var removePercentage = function removePercentage(parameter) {
|
|
107
107
|
return (parameter === null || parameter === void 0 ? void 0 : parameter.indexOf('%')) !== -1 ? +parameter.replace('%', '') : +parameter > 0 && +parameter <= 1 ? +parameter * 100 : +parameter;
|
|
108
108
|
};
|
|
109
|
-
var colorToStr = function colorToStr(obj) {
|
|
109
|
+
export var colorToStr = function colorToStr(obj) {
|
|
110
110
|
var arr = obj.color;
|
|
111
111
|
if (obj.valpha === 1) {
|
|
112
112
|
var _context11, _context12, _context13;
|
|
@@ -147,7 +147,7 @@ export var highlightPresetColorIndex = function highlightPresetColorIndex(color,
|
|
|
147
147
|
export var presetColorToHEX = function presetColorToHEX(colorArr) {
|
|
148
148
|
if (!colorArr) return [];
|
|
149
149
|
var hexColorArr = _mapInstanceProperty(colorArr).call(colorArr, function (color) {
|
|
150
|
-
return colorFormat(color,
|
|
150
|
+
return colorFormat(color, Color(getColorObj(color)).alpha(), 'HEX');
|
|
151
151
|
});
|
|
152
152
|
return hexColorArr;
|
|
153
153
|
};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
export function toUpCase(str) {
|
|
2
|
+
var result = '';
|
|
3
|
+
for (var i = 0; i < str.length; i++) {
|
|
4
|
+
var charCode = str.charCodeAt(i);
|
|
5
|
+
if (charCode >= 97 && charCode <= 122) {
|
|
6
|
+
result += String.fromCharCode(charCode - 32);
|
|
7
|
+
} else {
|
|
8
|
+
result += str[i];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
1
13
|
export function toLowerCase(str) {
|
|
2
14
|
var result = '';
|
|
3
15
|
for (var i = 0; i < str.length; i++) {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { toLowerCase } from './convertLetters';
|
|
1
2
|
export function validateColor(color) {
|
|
3
|
+
if (!color) return '';
|
|
4
|
+
var lowerColor = toLowerCase(color);
|
|
2
5
|
var hexReg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
3
6
|
var hexaReg = /^#([0-9a-fA-F]{8})$/;
|
|
4
7
|
var hsbReg = /^hsb\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*\)$/;
|
|
@@ -8,14 +11,14 @@ export function validateColor(color) {
|
|
|
8
11
|
var hslReg = /^hsl\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*\)$/;
|
|
9
12
|
var hslaReg = /^hsla\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*,\s*(-?\d+|-?\d*\.\d+)\)$/;
|
|
10
13
|
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)$/;
|
|
11
|
-
if (hexReg.test(
|
|
12
|
-
if (hexaReg.test(
|
|
13
|
-
if (hsbReg.test(
|
|
14
|
-
if (hsbaReg.test(
|
|
15
|
-
if (rgbaReg.test(
|
|
16
|
-
if (rgbReg.test(
|
|
17
|
-
if (hslReg.test(
|
|
18
|
-
if (hslaReg.test(
|
|
19
|
-
if (colorNameReg.test(
|
|
14
|
+
if (hexReg.test(lowerColor)) return 'HEX';
|
|
15
|
+
if (hexaReg.test(lowerColor)) return 'HEXA';
|
|
16
|
+
if (hsbReg.test(lowerColor)) return 'HSB';
|
|
17
|
+
if (hsbaReg.test(lowerColor)) return 'HSBA';
|
|
18
|
+
if (rgbaReg.test(lowerColor)) return 'RGBA';
|
|
19
|
+
if (rgbReg.test(lowerColor)) return 'RGB';
|
|
20
|
+
if (hslReg.test(lowerColor)) return 'HSL';
|
|
21
|
+
if (hslaReg.test(lowerColor)) return 'HSLA';
|
|
22
|
+
if (colorNameReg.test(lowerColor)) return 'colorName';
|
|
20
23
|
return '';
|
|
21
24
|
}
|
|
@@ -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;
|
|
@@ -72,12 +72,20 @@ var compDefaultProps = {
|
|
|
72
72
|
internationalName: 'followFunctionalColor'
|
|
73
73
|
},
|
|
74
74
|
placeholder: '#',
|
|
75
|
+
pure: false,
|
|
76
|
+
showAlphaInput: true,
|
|
77
|
+
showClear: true,
|
|
75
78
|
showColorTransfer: true,
|
|
76
79
|
showPresetColor: true,
|
|
77
80
|
showColorPickerBox: {
|
|
78
81
|
showBox: false,
|
|
79
82
|
showHue: false,
|
|
80
83
|
showOpacity: false
|
|
84
|
+
},
|
|
85
|
+
format: 'HEX',
|
|
86
|
+
panelFormatConfig: {
|
|
87
|
+
show: ['HEX', 'HSB', 'RGB', 'HSL'],
|
|
88
|
+
default: 'HEX'
|
|
81
89
|
}
|
|
82
90
|
},
|
|
83
91
|
Checkbox: {
|
package/es/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/es/popper/index.js
CHANGED
|
@@ -352,9 +352,12 @@ export var Popper = forwardRef(function (props, ref) {
|
|
|
352
352
|
var domReference = getRealDom(referenceRef, referenceElement);
|
|
353
353
|
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;
|
|
354
354
|
var isTarget = trigger === 'contextMenu' ? isPopper : isPopper || isReference;
|
|
355
|
-
if (
|
|
355
|
+
if (!isTarget && !isSubPopper(e)) {
|
|
356
356
|
triggerOpen(false, 'clickOutside', 0);
|
|
357
357
|
}
|
|
358
|
+
if (clickToClose && isPopper) {
|
|
359
|
+
triggerOpen(false, 'clickToClose', 0);
|
|
360
|
+
}
|
|
358
361
|
}
|
|
359
362
|
}, 10, {
|
|
360
363
|
leading: true
|