@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.
Files changed (73) hide show
  1. package/dist/kdesign-complete.less +297 -81
  2. package/dist/kdesign.css +269 -58
  3. package/dist/kdesign.css.map +1 -1
  4. package/dist/kdesign.js +838 -379
  5. package/dist/kdesign.js.map +1 -1
  6. package/dist/kdesign.min.css +3 -3
  7. package/dist/kdesign.min.js +10 -10
  8. package/dist/kdesign.min.js.map +1 -1
  9. package/es/breadcrumb/breadcrumb.js +2 -2
  10. package/es/button/group.d.ts +1 -1
  11. package/es/button/group.js +5 -3
  12. package/es/city-picker/city-picker.js +1 -0
  13. package/es/city-picker/style/index.css +8 -0
  14. package/es/city-picker/style/index.less +10 -0
  15. package/es/color-picker/color-picker-panel.js +332 -82
  16. package/es/color-picker/color-picker.js +128 -58
  17. package/es/color-picker/constant/colorTypes.js +4 -4
  18. package/es/color-picker/constant/defaultColor.d.ts +1 -1
  19. package/es/color-picker/constant/defaultColor.js +1 -1
  20. package/es/color-picker/interface.d.ts +33 -11
  21. package/es/color-picker/style/index.css +256 -53
  22. package/es/color-picker/style/index.less +277 -73
  23. package/es/color-picker/style/token.less +6 -2
  24. package/es/color-picker/utils/colorFormat.d.ts +5 -1
  25. package/es/color-picker/utils/colorFormat.js +10 -10
  26. package/es/color-picker/utils/convertLetters.d.ts +1 -0
  27. package/es/color-picker/utils/convertLetters.js +12 -0
  28. package/es/color-picker/utils/validateColor.js +12 -9
  29. package/es/config-provider/compDefaultProps.d.ts +8 -0
  30. package/es/config-provider/compDefaultProps.js +8 -0
  31. package/es/popper/index.d.ts +1 -1
  32. package/es/popper/index.js +4 -1
  33. package/es/popper/style/index.css +4 -4
  34. package/es/popper/style/index.less +4 -6
  35. package/es/signature/signature.d.ts +1 -0
  36. package/es/signature/signature.js +42 -8
  37. package/es/tree/tree.d.ts +1 -0
  38. package/es/tree/tree.js +3 -1
  39. package/es/tree/treeNode.d.ts +1 -0
  40. package/es/tree/treeNode.js +3 -2
  41. package/lib/breadcrumb/breadcrumb.js +2 -2
  42. package/lib/button/group.d.ts +1 -1
  43. package/lib/button/group.js +5 -3
  44. package/lib/city-picker/city-picker.js +1 -0
  45. package/lib/city-picker/style/index.css +8 -0
  46. package/lib/city-picker/style/index.less +10 -0
  47. package/lib/color-picker/color-picker-panel.js +329 -79
  48. package/lib/color-picker/color-picker.js +125 -55
  49. package/lib/color-picker/constant/colorTypes.js +4 -4
  50. package/lib/color-picker/constant/defaultColor.d.ts +1 -1
  51. package/lib/color-picker/constant/defaultColor.js +1 -1
  52. package/lib/color-picker/interface.d.ts +33 -11
  53. package/lib/color-picker/style/index.css +256 -53
  54. package/lib/color-picker/style/index.less +277 -73
  55. package/lib/color-picker/style/token.less +6 -2
  56. package/lib/color-picker/utils/colorFormat.d.ts +5 -1
  57. package/lib/color-picker/utils/colorFormat.js +10 -9
  58. package/lib/color-picker/utils/convertLetters.d.ts +1 -0
  59. package/lib/color-picker/utils/convertLetters.js +13 -0
  60. package/lib/color-picker/utils/validateColor.js +12 -9
  61. package/lib/config-provider/compDefaultProps.d.ts +8 -0
  62. package/lib/config-provider/compDefaultProps.js +8 -0
  63. package/lib/popper/index.d.ts +1 -1
  64. package/lib/popper/index.js +4 -1
  65. package/lib/popper/style/index.css +4 -4
  66. package/lib/popper/style/index.less +4 -6
  67. package/lib/signature/signature.d.ts +1 -0
  68. package/lib/signature/signature.js +42 -8
  69. package/lib/tree/tree.d.ts +1 -0
  70. package/lib/tree/tree.js +3 -1
  71. package/lib/tree/treeNode.d.ts +1 -0
  72. package/lib/tree/treeNode.js +3 -2
  73. 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
- width: @color-picker-input-suffix-sizing-width;
26
- height: @color-picker-input-suffix-sizing-height;
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
- &-underline {
34
- margin-right: -6px;
35
- }
36
-
37
- &-up {
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
- &-input {
213
- flex: 1 1 auto;
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: 60px !important;
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 1 60px;
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
- &-colorDivContainer {
269
- display: grid;
270
- grid-template-columns: repeat(12, 1fr);
271
- grid-column-gap: 8px;
272
- grid-row-gap: 8px;
273
- margin-top: 12px;
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
- &-ie11 {
276
- display: flex;
277
- flex-wrap: wrap;
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
- margin-right: 8px;
281
- margin-top: 8px;
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
- &:nth-child(12n) {
284
- margin-right: 0;
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
- &:nth-child(-n+12) {
288
- margin-top: 0;
458
+ &:hover {
459
+ .square {
460
+ display: block;
461
+ }
289
462
  }
290
463
  }
291
464
  }
465
+ }
292
466
 
293
- &-unset-color {
294
- margin-top: 0;
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
- li {
298
- position: relative;
299
- box-sizing: border-box;
300
- width: @color-picker-panel-preset-sizing-width;
301
- height: @color-picker-panel-preset-sizing-height;
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
- .square {
308
- display: none;
309
- position: absolute;
310
- box-sizing: inherit;
311
- top: -3px;
312
- left: -3px;
313
- width: calc(@color-picker-panel-preset-sizing-width + 4px);
314
- height: calc(@color-picker-panel-preset-sizing-height + 4px);
315
- border: 1px solid rgba(178, 178, 176, 1);
316
- border-radius: 4px;
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
- &-click {
319
- display: block;
320
- box-shadow: 0 0 0 1px #e5e5e5 !important;
494
+ &:nth-child(-n+12) {
495
+ margin-top: 0;
496
+ }
321
497
  }
322
498
  }
323
499
 
324
- &:hover {
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: block;
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-suffix-sizing-width: var(~'@{color-picker-custom-prefix}-input-suffix-sizing-width', 20px);
17
- @color-picker-input-suffix-sizing-height: var(~'@{color-picker-custom-prefix}-input-suffix-sizing-height', 20px);
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) => any;
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 toLowerCase(alpha === 1 ? ColorTools.hex() : ColorTools.hexa());
15
+ return toUpCase(alpha === 1 ? ColorTools.hex() : ColorTools.hexa());
16
16
  } else {
17
17
  return colorStr;
18
18
  }
19
19
  } else {
20
- return toLowerCase(alpha === 1 ? ColorTools.hex() : ColorTools.hexa());
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, 1, 'HEX');
150
+ return colorFormat(color, Color(getColorObj(color)).alpha(), 'HEX');
151
151
  });
152
152
  return hexColorArr;
153
153
  };
@@ -1 +1,2 @@
1
+ export declare function toUpCase(str: string): string;
1
2
  export declare function toLowerCase(str: string): string;
@@ -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(color)) return 'HEX';
12
- if (hexaReg.test(color)) return 'HEXA';
13
- if (hsbReg.test(color)) return 'HSB';
14
- if (hsbaReg.test(color)) return 'HSBA';
15
- if (rgbaReg.test(color)) return 'RGBA';
16
- if (rgbReg.test(color)) return 'RGB';
17
- if (hslReg.test(color)) return 'HSL';
18
- if (hslaReg.test(color)) return 'HSLA';
19
- if (colorNameReg.test(color)) return 'colorName';
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: {
@@ -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;
@@ -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 (clickToClose && !isTarget && !isSubPopper(e)) {
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