bkui-vue 0.0.1-beta.393 → 0.0.1-beta.394

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 (155) hide show
  1. package/dist/index.cjs.js +36 -36
  2. package/dist/index.esm.js +33 -3
  3. package/dist/index.umd.js +35 -35
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -353
  7. package/lib/alert/index.js +1 -251
  8. package/lib/animate-number/index.js +1 -226
  9. package/lib/backtop/index.js +1 -260
  10. package/lib/badge/index.js +1 -274
  11. package/lib/breadcrumb/index.js +1 -329
  12. package/lib/button/index.js +1 -371
  13. package/lib/card/index.js +1 -326
  14. package/lib/cascader/index.js +1 -2168
  15. package/lib/checkbox/index.js +1 -571
  16. package/lib/code-diff/index.js +1 -5520
  17. package/lib/collapse/index.js +1 -698
  18. package/lib/color-picker/index.js +1 -2816
  19. package/lib/components.js +1 -759
  20. package/lib/container/index.js +1 -369
  21. package/lib/date-picker/index.js +1 -5601
  22. package/lib/dialog/index.js +1 -545
  23. package/lib/directives/index.js +2 -1427
  24. package/lib/directives/index.js.LICENSE.txt +14 -0
  25. package/lib/dist.index.js +1 -166
  26. package/lib/divider/index.js +1 -512
  27. package/lib/dropdown/index.js +1 -414
  28. package/lib/exception/index.js +1 -405
  29. package/lib/fixed-navbar/index.js +1 -214
  30. package/lib/form/index.js +1 -986
  31. package/lib/icon/angle-double-down-line.js +1 -426
  32. package/lib/icon/angle-double-left-line.js +1 -426
  33. package/lib/icon/angle-double-left.js +1 -426
  34. package/lib/icon/angle-double-right-line.js +1 -426
  35. package/lib/icon/angle-double-right.js +1 -426
  36. package/lib/icon/angle-double-up-line.js +1 -426
  37. package/lib/icon/angle-down-fill.js +1 -426
  38. package/lib/icon/angle-down-line.js +1 -426
  39. package/lib/icon/angle-down.js +1 -426
  40. package/lib/icon/angle-left.js +1 -426
  41. package/lib/icon/angle-right.js +1 -426
  42. package/lib/icon/angle-up-fill.js +1 -426
  43. package/lib/icon/angle-up.js +1 -426
  44. package/lib/icon/archive-fill.js +1 -426
  45. package/lib/icon/arrows-left.js +1 -426
  46. package/lib/icon/arrows-right.js +1 -426
  47. package/lib/icon/audio-fill.js +1 -426
  48. package/lib/icon/bk.js +1 -426
  49. package/lib/icon/circle.js +1 -426
  50. package/lib/icon/close-line.js +1 -426
  51. package/lib/icon/close.js +1 -426
  52. package/lib/icon/code.js +1 -426
  53. package/lib/icon/cog-shape.js +1 -426
  54. package/lib/icon/collapse-left.js +1 -426
  55. package/lib/icon/copy.js +1 -426
  56. package/lib/icon/data-shape.js +1 -426
  57. package/lib/icon/del.js +1 -426
  58. package/lib/icon/doc-fill.js +1 -426
  59. package/lib/icon/done.js +1 -426
  60. package/lib/icon/down-shape.js +1 -426
  61. package/lib/icon/down-small.js +1 -426
  62. package/lib/icon/edit-line.js +1 -426
  63. package/lib/icon/ellipsis.js +1 -426
  64. package/lib/icon/enlarge-line.js +1 -426
  65. package/lib/icon/error.js +1 -426
  66. package/lib/icon/excel-fill.js +1 -426
  67. package/lib/icon/exclamation-circle-shape.js +1 -426
  68. package/lib/icon/eye.js +1 -426
  69. package/lib/icon/filliscreen-line.js +1 -426
  70. package/lib/icon/folder-open.js +1 -426
  71. package/lib/icon/folder-shape-open.js +1 -426
  72. package/lib/icon/folder-shape.js +1 -426
  73. package/lib/icon/folder.js +1 -426
  74. package/lib/icon/funnel.js +1 -426
  75. package/lib/icon/help-document-fill.js +1 -426
  76. package/lib/icon/help-fill.js +1 -426
  77. package/lib/icon/help.js +1 -426
  78. package/lib/icon/image-fill.js +1 -426
  79. package/lib/icon/img-placehoulder.js +1 -448
  80. package/lib/icon/index.js +1 -2275
  81. package/lib/icon/info-line.js +1 -448
  82. package/lib/icon/info.js +1 -448
  83. package/lib/icon/left-shape.js +1 -448
  84. package/lib/icon/left-turn-line.js +1 -448
  85. package/lib/icon/narrow-line.js +1 -448
  86. package/lib/icon/original.js +1 -448
  87. package/lib/icon/pdf-fill.js +1 -448
  88. package/lib/icon/play-shape.js +1 -448
  89. package/lib/icon/plus.js +1 -448
  90. package/lib/icon/ppt-fill.js +1 -448
  91. package/lib/icon/qq.js +1 -448
  92. package/lib/icon/right-shape.js +1 -448
  93. package/lib/icon/right-turn-line.js +1 -448
  94. package/lib/icon/search.js +1 -448
  95. package/lib/icon/share.js +1 -448
  96. package/lib/icon/spinner.js +1 -448
  97. package/lib/icon/success.js +1 -448
  98. package/lib/icon/switcher-loading.js +1 -448
  99. package/lib/icon/text-file.js +1 -448
  100. package/lib/icon/text-fill.js +1 -448
  101. package/lib/icon/transfer.js +1 -448
  102. package/lib/icon/tree-application-shape.js +1 -448
  103. package/lib/icon/unfull-screen.js +1 -448
  104. package/lib/icon/unvisible.js +1 -448
  105. package/lib/icon/up-shape.js +1 -448
  106. package/lib/icon/upload.js +1 -448
  107. package/lib/icon/video-fill.js +1 -448
  108. package/lib/icon/warn.js +1 -448
  109. package/lib/icon/weixin.js +1 -448
  110. package/lib/image/index.js +1 -873
  111. package/lib/index.js +1 -169
  112. package/lib/info-box/index.js +1 -1784
  113. package/lib/input/index.js +1 -846
  114. package/lib/link/index.js +1 -226
  115. package/lib/loading/index.js +1 -309
  116. package/lib/menu/index.js +1 -796
  117. package/lib/message/index.js +1 -401
  118. package/lib/modal/index.js +1 -395
  119. package/lib/navigation/index.js +1 -431
  120. package/lib/notify/index.js +1 -430
  121. package/lib/overflow-title/index.js +1 -512
  122. package/lib/pagination/index.js +1 -1026
  123. package/lib/plugin-popover/index.js +1 -2581
  124. package/lib/plugins/index.js +1 -130
  125. package/lib/popover/index.js +1 -2587
  126. package/lib/popover2/index.js +1 -172
  127. package/lib/preset.js +1 -129
  128. package/lib/process/index.js +1 -1417
  129. package/lib/progress/index.js +1 -479
  130. package/lib/radio/index.js +1 -649
  131. package/lib/rate/index.js +1 -358
  132. package/lib/resize-layout/index.js +1 -495
  133. package/lib/search-select/index.js +1 -3388
  134. package/lib/search-select/search-select.css +1 -1
  135. package/lib/search-select/search-select.less +1 -1
  136. package/lib/search-select/search-select.variable.css +1 -1
  137. package/lib/select/index.js +1 -2819
  138. package/lib/shared/index.js +1 -2813
  139. package/lib/sideslider/index.js +1 -1362
  140. package/lib/slider/index.js +1 -2060
  141. package/lib/steps/index.js +1 -1504
  142. package/lib/swiper/index.js +1 -374
  143. package/lib/switcher/index.js +1 -308
  144. package/lib/tab/index.js +1 -919
  145. package/lib/table/index.js +1 -6635
  146. package/lib/table-column/index.js +1 -737
  147. package/lib/tag/index.js +1 -278
  148. package/lib/tag-input/index.js +1 -1897
  149. package/lib/time-picker/index.js +1 -142
  150. package/lib/timeline/index.js +1 -315
  151. package/lib/transfer/index.js +1 -658
  152. package/lib/tree/index.js +1 -2917
  153. package/lib/upload/index.js +1 -3735
  154. package/lib/virtual-render/index.js +1 -825
  155. package/package.json +2 -1
@@ -1,2816 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("../shared"), require("vue"), require("vue-types"), require("../directives"), require("../icon"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["../shared", "vue", "vue-types", "../directives", "../icon"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("vue-types"), require("../directives"), require("../icon")) : factory(root["../shared"], root["vue"], root["vue-types"], root["../directives"], root["../icon"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__210__, __WEBPACK_EXTERNAL_MODULE__4061__, __WEBPACK_EXTERNAL_MODULE__6870__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ var __webpack_modules__ = ({
13
-
14
- /***/ 8621:
15
- /***/ ((module, exports, __webpack_require__) => {
16
-
17
- var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.2
18
- // https://github.com/bgrins/TinyColor
19
- // Brian Grinstead, MIT License
20
-
21
- (function(Math) {
22
-
23
- var trimLeft = /^\s+/,
24
- trimRight = /\s+$/,
25
- tinyCounter = 0,
26
- mathRound = Math.round,
27
- mathMin = Math.min,
28
- mathMax = Math.max,
29
- mathRandom = Math.random;
30
-
31
- function tinycolor (color, opts) {
32
-
33
- color = (color) ? color : '';
34
- opts = opts || { };
35
-
36
- // If input is already a tinycolor, return itself
37
- if (color instanceof tinycolor) {
38
- return color;
39
- }
40
- // If we are called as a function, call using new instead
41
- if (!(this instanceof tinycolor)) {
42
- return new tinycolor(color, opts);
43
- }
44
-
45
- var rgb = inputToRGB(color);
46
- this._originalInput = color,
47
- this._r = rgb.r,
48
- this._g = rgb.g,
49
- this._b = rgb.b,
50
- this._a = rgb.a,
51
- this._roundA = mathRound(100*this._a) / 100,
52
- this._format = opts.format || rgb.format;
53
- this._gradientType = opts.gradientType;
54
-
55
- // Don't let the range of [0,255] come back in [0,1].
56
- // Potentially lose a little bit of precision here, but will fix issues where
57
- // .5 gets interpreted as half of the total, instead of half of 1
58
- // If it was supposed to be 128, this was already taken care of by `inputToRgb`
59
- if (this._r < 1) { this._r = mathRound(this._r); }
60
- if (this._g < 1) { this._g = mathRound(this._g); }
61
- if (this._b < 1) { this._b = mathRound(this._b); }
62
-
63
- this._ok = rgb.ok;
64
- this._tc_id = tinyCounter++;
65
- }
66
-
67
- tinycolor.prototype = {
68
- isDark: function() {
69
- return this.getBrightness() < 128;
70
- },
71
- isLight: function() {
72
- return !this.isDark();
73
- },
74
- isValid: function() {
75
- return this._ok;
76
- },
77
- getOriginalInput: function() {
78
- return this._originalInput;
79
- },
80
- getFormat: function() {
81
- return this._format;
82
- },
83
- getAlpha: function() {
84
- return this._a;
85
- },
86
- getBrightness: function() {
87
- //http://www.w3.org/TR/AERT#color-contrast
88
- var rgb = this.toRgb();
89
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
90
- },
91
- getLuminance: function() {
92
- //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
93
- var rgb = this.toRgb();
94
- var RsRGB, GsRGB, BsRGB, R, G, B;
95
- RsRGB = rgb.r/255;
96
- GsRGB = rgb.g/255;
97
- BsRGB = rgb.b/255;
98
-
99
- if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
100
- if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
101
- if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
102
- return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
103
- },
104
- setAlpha: function(value) {
105
- this._a = boundAlpha(value);
106
- this._roundA = mathRound(100*this._a) / 100;
107
- return this;
108
- },
109
- toHsv: function() {
110
- var hsv = rgbToHsv(this._r, this._g, this._b);
111
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
112
- },
113
- toHsvString: function() {
114
- var hsv = rgbToHsv(this._r, this._g, this._b);
115
- var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
116
- return (this._a == 1) ?
117
- "hsv(" + h + ", " + s + "%, " + v + "%)" :
118
- "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
119
- },
120
- toHsl: function() {
121
- var hsl = rgbToHsl(this._r, this._g, this._b);
122
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
123
- },
124
- toHslString: function() {
125
- var hsl = rgbToHsl(this._r, this._g, this._b);
126
- var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
127
- return (this._a == 1) ?
128
- "hsl(" + h + ", " + s + "%, " + l + "%)" :
129
- "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
130
- },
131
- toHex: function(allow3Char) {
132
- return rgbToHex(this._r, this._g, this._b, allow3Char);
133
- },
134
- toHexString: function(allow3Char) {
135
- return '#' + this.toHex(allow3Char);
136
- },
137
- toHex8: function(allow4Char) {
138
- return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
139
- },
140
- toHex8String: function(allow4Char) {
141
- return '#' + this.toHex8(allow4Char);
142
- },
143
- toRgb: function() {
144
- return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
145
- },
146
- toRgbString: function() {
147
- return (this._a == 1) ?
148
- "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
149
- "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
150
- },
151
- toPercentageRgb: function() {
152
- return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
153
- },
154
- toPercentageRgbString: function() {
155
- return (this._a == 1) ?
156
- "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
157
- "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
158
- },
159
- toName: function() {
160
- if (this._a === 0) {
161
- return "transparent";
162
- }
163
-
164
- if (this._a < 1) {
165
- return false;
166
- }
167
-
168
- return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
169
- },
170
- toFilter: function(secondColor) {
171
- var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
172
- var secondHex8String = hex8String;
173
- var gradientType = this._gradientType ? "GradientType = 1, " : "";
174
-
175
- if (secondColor) {
176
- var s = tinycolor(secondColor);
177
- secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
178
- }
179
-
180
- return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
181
- },
182
- toString: function(format) {
183
- var formatSet = !!format;
184
- format = format || this._format;
185
-
186
- var formattedString = false;
187
- var hasAlpha = this._a < 1 && this._a >= 0;
188
- var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
189
-
190
- if (needsAlphaFormat) {
191
- // Special case for "transparent", all other non-alpha formats
192
- // will return rgba when there is transparency.
193
- if (format === "name" && this._a === 0) {
194
- return this.toName();
195
- }
196
- return this.toRgbString();
197
- }
198
- if (format === "rgb") {
199
- formattedString = this.toRgbString();
200
- }
201
- if (format === "prgb") {
202
- formattedString = this.toPercentageRgbString();
203
- }
204
- if (format === "hex" || format === "hex6") {
205
- formattedString = this.toHexString();
206
- }
207
- if (format === "hex3") {
208
- formattedString = this.toHexString(true);
209
- }
210
- if (format === "hex4") {
211
- formattedString = this.toHex8String(true);
212
- }
213
- if (format === "hex8") {
214
- formattedString = this.toHex8String();
215
- }
216
- if (format === "name") {
217
- formattedString = this.toName();
218
- }
219
- if (format === "hsl") {
220
- formattedString = this.toHslString();
221
- }
222
- if (format === "hsv") {
223
- formattedString = this.toHsvString();
224
- }
225
-
226
- return formattedString || this.toHexString();
227
- },
228
- clone: function() {
229
- return tinycolor(this.toString());
230
- },
231
-
232
- _applyModification: function(fn, args) {
233
- var color = fn.apply(null, [this].concat([].slice.call(args)));
234
- this._r = color._r;
235
- this._g = color._g;
236
- this._b = color._b;
237
- this.setAlpha(color._a);
238
- return this;
239
- },
240
- lighten: function() {
241
- return this._applyModification(lighten, arguments);
242
- },
243
- brighten: function() {
244
- return this._applyModification(brighten, arguments);
245
- },
246
- darken: function() {
247
- return this._applyModification(darken, arguments);
248
- },
249
- desaturate: function() {
250
- return this._applyModification(desaturate, arguments);
251
- },
252
- saturate: function() {
253
- return this._applyModification(saturate, arguments);
254
- },
255
- greyscale: function() {
256
- return this._applyModification(greyscale, arguments);
257
- },
258
- spin: function() {
259
- return this._applyModification(spin, arguments);
260
- },
261
-
262
- _applyCombination: function(fn, args) {
263
- return fn.apply(null, [this].concat([].slice.call(args)));
264
- },
265
- analogous: function() {
266
- return this._applyCombination(analogous, arguments);
267
- },
268
- complement: function() {
269
- return this._applyCombination(complement, arguments);
270
- },
271
- monochromatic: function() {
272
- return this._applyCombination(monochromatic, arguments);
273
- },
274
- splitcomplement: function() {
275
- return this._applyCombination(splitcomplement, arguments);
276
- },
277
- triad: function() {
278
- return this._applyCombination(triad, arguments);
279
- },
280
- tetrad: function() {
281
- return this._applyCombination(tetrad, arguments);
282
- }
283
- };
284
-
285
- // If input is an object, force 1 into "1.0" to handle ratios properly
286
- // String input requires "1.0" as input, so 1 will be treated as 1
287
- tinycolor.fromRatio = function(color, opts) {
288
- if (typeof color == "object") {
289
- var newColor = {};
290
- for (var i in color) {
291
- if (color.hasOwnProperty(i)) {
292
- if (i === "a") {
293
- newColor[i] = color[i];
294
- }
295
- else {
296
- newColor[i] = convertToPercentage(color[i]);
297
- }
298
- }
299
- }
300
- color = newColor;
301
- }
302
-
303
- return tinycolor(color, opts);
304
- };
305
-
306
- // Given a string or object, convert that input to RGB
307
- // Possible string inputs:
308
- //
309
- // "red"
310
- // "#f00" or "f00"
311
- // "#ff0000" or "ff0000"
312
- // "#ff000000" or "ff000000"
313
- // "rgb 255 0 0" or "rgb (255, 0, 0)"
314
- // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
315
- // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
316
- // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
317
- // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
318
- // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
319
- // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
320
- //
321
- function inputToRGB(color) {
322
-
323
- var rgb = { r: 0, g: 0, b: 0 };
324
- var a = 1;
325
- var s = null;
326
- var v = null;
327
- var l = null;
328
- var ok = false;
329
- var format = false;
330
-
331
- if (typeof color == "string") {
332
- color = stringInputToObject(color);
333
- }
334
-
335
- if (typeof color == "object") {
336
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
337
- rgb = rgbToRgb(color.r, color.g, color.b);
338
- ok = true;
339
- format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
340
- }
341
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
342
- s = convertToPercentage(color.s);
343
- v = convertToPercentage(color.v);
344
- rgb = hsvToRgb(color.h, s, v);
345
- ok = true;
346
- format = "hsv";
347
- }
348
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
349
- s = convertToPercentage(color.s);
350
- l = convertToPercentage(color.l);
351
- rgb = hslToRgb(color.h, s, l);
352
- ok = true;
353
- format = "hsl";
354
- }
355
-
356
- if (color.hasOwnProperty("a")) {
357
- a = color.a;
358
- }
359
- }
360
-
361
- a = boundAlpha(a);
362
-
363
- return {
364
- ok: ok,
365
- format: color.format || format,
366
- r: mathMin(255, mathMax(rgb.r, 0)),
367
- g: mathMin(255, mathMax(rgb.g, 0)),
368
- b: mathMin(255, mathMax(rgb.b, 0)),
369
- a: a
370
- };
371
- }
372
-
373
-
374
- // Conversion Functions
375
- // --------------------
376
-
377
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
378
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
379
-
380
- // `rgbToRgb`
381
- // Handle bounds / percentage checking to conform to CSS color spec
382
- // <http://www.w3.org/TR/css3-color/>
383
- // *Assumes:* r, g, b in [0, 255] or [0, 1]
384
- // *Returns:* { r, g, b } in [0, 255]
385
- function rgbToRgb(r, g, b){
386
- return {
387
- r: bound01(r, 255) * 255,
388
- g: bound01(g, 255) * 255,
389
- b: bound01(b, 255) * 255
390
- };
391
- }
392
-
393
- // `rgbToHsl`
394
- // Converts an RGB color value to HSL.
395
- // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
396
- // *Returns:* { h, s, l } in [0,1]
397
- function rgbToHsl(r, g, b) {
398
-
399
- r = bound01(r, 255);
400
- g = bound01(g, 255);
401
- b = bound01(b, 255);
402
-
403
- var max = mathMax(r, g, b), min = mathMin(r, g, b);
404
- var h, s, l = (max + min) / 2;
405
-
406
- if(max == min) {
407
- h = s = 0; // achromatic
408
- }
409
- else {
410
- var d = max - min;
411
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
412
- switch(max) {
413
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
414
- case g: h = (b - r) / d + 2; break;
415
- case b: h = (r - g) / d + 4; break;
416
- }
417
-
418
- h /= 6;
419
- }
420
-
421
- return { h: h, s: s, l: l };
422
- }
423
-
424
- // `hslToRgb`
425
- // Converts an HSL color value to RGB.
426
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
427
- // *Returns:* { r, g, b } in the set [0, 255]
428
- function hslToRgb(h, s, l) {
429
- var r, g, b;
430
-
431
- h = bound01(h, 360);
432
- s = bound01(s, 100);
433
- l = bound01(l, 100);
434
-
435
- function hue2rgb(p, q, t) {
436
- if(t < 0) t += 1;
437
- if(t > 1) t -= 1;
438
- if(t < 1/6) return p + (q - p) * 6 * t;
439
- if(t < 1/2) return q;
440
- if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
441
- return p;
442
- }
443
-
444
- if(s === 0) {
445
- r = g = b = l; // achromatic
446
- }
447
- else {
448
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
449
- var p = 2 * l - q;
450
- r = hue2rgb(p, q, h + 1/3);
451
- g = hue2rgb(p, q, h);
452
- b = hue2rgb(p, q, h - 1/3);
453
- }
454
-
455
- return { r: r * 255, g: g * 255, b: b * 255 };
456
- }
457
-
458
- // `rgbToHsv`
459
- // Converts an RGB color value to HSV
460
- // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
461
- // *Returns:* { h, s, v } in [0,1]
462
- function rgbToHsv(r, g, b) {
463
-
464
- r = bound01(r, 255);
465
- g = bound01(g, 255);
466
- b = bound01(b, 255);
467
-
468
- var max = mathMax(r, g, b), min = mathMin(r, g, b);
469
- var h, s, v = max;
470
-
471
- var d = max - min;
472
- s = max === 0 ? 0 : d / max;
473
-
474
- if(max == min) {
475
- h = 0; // achromatic
476
- }
477
- else {
478
- switch(max) {
479
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
480
- case g: h = (b - r) / d + 2; break;
481
- case b: h = (r - g) / d + 4; break;
482
- }
483
- h /= 6;
484
- }
485
- return { h: h, s: s, v: v };
486
- }
487
-
488
- // `hsvToRgb`
489
- // Converts an HSV color value to RGB.
490
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
491
- // *Returns:* { r, g, b } in the set [0, 255]
492
- function hsvToRgb(h, s, v) {
493
-
494
- h = bound01(h, 360) * 6;
495
- s = bound01(s, 100);
496
- v = bound01(v, 100);
497
-
498
- var i = Math.floor(h),
499
- f = h - i,
500
- p = v * (1 - s),
501
- q = v * (1 - f * s),
502
- t = v * (1 - (1 - f) * s),
503
- mod = i % 6,
504
- r = [v, q, p, p, t, v][mod],
505
- g = [t, v, v, q, p, p][mod],
506
- b = [p, p, t, v, v, q][mod];
507
-
508
- return { r: r * 255, g: g * 255, b: b * 255 };
509
- }
510
-
511
- // `rgbToHex`
512
- // Converts an RGB color to hex
513
- // Assumes r, g, and b are contained in the set [0, 255]
514
- // Returns a 3 or 6 character hex
515
- function rgbToHex(r, g, b, allow3Char) {
516
-
517
- var hex = [
518
- pad2(mathRound(r).toString(16)),
519
- pad2(mathRound(g).toString(16)),
520
- pad2(mathRound(b).toString(16))
521
- ];
522
-
523
- // Return a 3 character hex if possible
524
- if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
525
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
526
- }
527
-
528
- return hex.join("");
529
- }
530
-
531
- // `rgbaToHex`
532
- // Converts an RGBA color plus alpha transparency to hex
533
- // Assumes r, g, b are contained in the set [0, 255] and
534
- // a in [0, 1]. Returns a 4 or 8 character rgba hex
535
- function rgbaToHex(r, g, b, a, allow4Char) {
536
-
537
- var hex = [
538
- pad2(mathRound(r).toString(16)),
539
- pad2(mathRound(g).toString(16)),
540
- pad2(mathRound(b).toString(16)),
541
- pad2(convertDecimalToHex(a))
542
- ];
543
-
544
- // Return a 4 character hex if possible
545
- if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
546
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
547
- }
548
-
549
- return hex.join("");
550
- }
551
-
552
- // `rgbaToArgbHex`
553
- // Converts an RGBA color to an ARGB Hex8 string
554
- // Rarely used, but required for "toFilter()"
555
- function rgbaToArgbHex(r, g, b, a) {
556
-
557
- var hex = [
558
- pad2(convertDecimalToHex(a)),
559
- pad2(mathRound(r).toString(16)),
560
- pad2(mathRound(g).toString(16)),
561
- pad2(mathRound(b).toString(16))
562
- ];
563
-
564
- return hex.join("");
565
- }
566
-
567
- // `equals`
568
- // Can be called with any tinycolor input
569
- tinycolor.equals = function (color1, color2) {
570
- if (!color1 || !color2) { return false; }
571
- return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
572
- };
573
-
574
- tinycolor.random = function() {
575
- return tinycolor.fromRatio({
576
- r: mathRandom(),
577
- g: mathRandom(),
578
- b: mathRandom()
579
- });
580
- };
581
-
582
-
583
- // Modification Functions
584
- // ----------------------
585
- // Thanks to less.js for some of the basics here
586
- // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
587
-
588
- function desaturate(color, amount) {
589
- amount = (amount === 0) ? 0 : (amount || 10);
590
- var hsl = tinycolor(color).toHsl();
591
- hsl.s -= amount / 100;
592
- hsl.s = clamp01(hsl.s);
593
- return tinycolor(hsl);
594
- }
595
-
596
- function saturate(color, amount) {
597
- amount = (amount === 0) ? 0 : (amount || 10);
598
- var hsl = tinycolor(color).toHsl();
599
- hsl.s += amount / 100;
600
- hsl.s = clamp01(hsl.s);
601
- return tinycolor(hsl);
602
- }
603
-
604
- function greyscale(color) {
605
- return tinycolor(color).desaturate(100);
606
- }
607
-
608
- function lighten (color, amount) {
609
- amount = (amount === 0) ? 0 : (amount || 10);
610
- var hsl = tinycolor(color).toHsl();
611
- hsl.l += amount / 100;
612
- hsl.l = clamp01(hsl.l);
613
- return tinycolor(hsl);
614
- }
615
-
616
- function brighten(color, amount) {
617
- amount = (amount === 0) ? 0 : (amount || 10);
618
- var rgb = tinycolor(color).toRgb();
619
- rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
620
- rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
621
- rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
622
- return tinycolor(rgb);
623
- }
624
-
625
- function darken (color, amount) {
626
- amount = (amount === 0) ? 0 : (amount || 10);
627
- var hsl = tinycolor(color).toHsl();
628
- hsl.l -= amount / 100;
629
- hsl.l = clamp01(hsl.l);
630
- return tinycolor(hsl);
631
- }
632
-
633
- // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
634
- // Values outside of this range will be wrapped into this range.
635
- function spin(color, amount) {
636
- var hsl = tinycolor(color).toHsl();
637
- var hue = (hsl.h + amount) % 360;
638
- hsl.h = hue < 0 ? 360 + hue : hue;
639
- return tinycolor(hsl);
640
- }
641
-
642
- // Combination Functions
643
- // ---------------------
644
- // Thanks to jQuery xColor for some of the ideas behind these
645
- // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
646
-
647
- function complement(color) {
648
- var hsl = tinycolor(color).toHsl();
649
- hsl.h = (hsl.h + 180) % 360;
650
- return tinycolor(hsl);
651
- }
652
-
653
- function triad(color) {
654
- var hsl = tinycolor(color).toHsl();
655
- var h = hsl.h;
656
- return [
657
- tinycolor(color),
658
- tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
659
- tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
660
- ];
661
- }
662
-
663
- function tetrad(color) {
664
- var hsl = tinycolor(color).toHsl();
665
- var h = hsl.h;
666
- return [
667
- tinycolor(color),
668
- tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
669
- tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
670
- tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
671
- ];
672
- }
673
-
674
- function splitcomplement(color) {
675
- var hsl = tinycolor(color).toHsl();
676
- var h = hsl.h;
677
- return [
678
- tinycolor(color),
679
- tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
680
- tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
681
- ];
682
- }
683
-
684
- function analogous(color, results, slices) {
685
- results = results || 6;
686
- slices = slices || 30;
687
-
688
- var hsl = tinycolor(color).toHsl();
689
- var part = 360 / slices;
690
- var ret = [tinycolor(color)];
691
-
692
- for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
693
- hsl.h = (hsl.h + part) % 360;
694
- ret.push(tinycolor(hsl));
695
- }
696
- return ret;
697
- }
698
-
699
- function monochromatic(color, results) {
700
- results = results || 6;
701
- var hsv = tinycolor(color).toHsv();
702
- var h = hsv.h, s = hsv.s, v = hsv.v;
703
- var ret = [];
704
- var modification = 1 / results;
705
-
706
- while (results--) {
707
- ret.push(tinycolor({ h: h, s: s, v: v}));
708
- v = (v + modification) % 1;
709
- }
710
-
711
- return ret;
712
- }
713
-
714
- // Utility Functions
715
- // ---------------------
716
-
717
- tinycolor.mix = function(color1, color2, amount) {
718
- amount = (amount === 0) ? 0 : (amount || 50);
719
-
720
- var rgb1 = tinycolor(color1).toRgb();
721
- var rgb2 = tinycolor(color2).toRgb();
722
-
723
- var p = amount / 100;
724
-
725
- var rgba = {
726
- r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
727
- g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
728
- b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
729
- a: ((rgb2.a - rgb1.a) * p) + rgb1.a
730
- };
731
-
732
- return tinycolor(rgba);
733
- };
734
-
735
-
736
- // Readability Functions
737
- // ---------------------
738
- // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
739
-
740
- // `contrast`
741
- // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
742
- tinycolor.readability = function(color1, color2) {
743
- var c1 = tinycolor(color1);
744
- var c2 = tinycolor(color2);
745
- return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
746
- };
747
-
748
- // `isReadable`
749
- // Ensure that foreground and background color combinations meet WCAG2 guidelines.
750
- // The third argument is an optional Object.
751
- // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
752
- // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
753
- // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
754
-
755
- // *Example*
756
- // tinycolor.isReadable("#000", "#111") => false
757
- // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
758
- tinycolor.isReadable = function(color1, color2, wcag2) {
759
- var readability = tinycolor.readability(color1, color2);
760
- var wcag2Parms, out;
761
-
762
- out = false;
763
-
764
- wcag2Parms = validateWCAG2Parms(wcag2);
765
- switch (wcag2Parms.level + wcag2Parms.size) {
766
- case "AAsmall":
767
- case "AAAlarge":
768
- out = readability >= 4.5;
769
- break;
770
- case "AAlarge":
771
- out = readability >= 3;
772
- break;
773
- case "AAAsmall":
774
- out = readability >= 7;
775
- break;
776
- }
777
- return out;
778
-
779
- };
780
-
781
- // `mostReadable`
782
- // Given a base color and a list of possible foreground or background
783
- // colors for that base, returns the most readable color.
784
- // Optionally returns Black or White if the most readable color is unreadable.
785
- // *Example*
786
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
787
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
788
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
789
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
790
- tinycolor.mostReadable = function(baseColor, colorList, args) {
791
- var bestColor = null;
792
- var bestScore = 0;
793
- var readability;
794
- var includeFallbackColors, level, size ;
795
- args = args || {};
796
- includeFallbackColors = args.includeFallbackColors ;
797
- level = args.level;
798
- size = args.size;
799
-
800
- for (var i= 0; i < colorList.length ; i++) {
801
- readability = tinycolor.readability(baseColor, colorList[i]);
802
- if (readability > bestScore) {
803
- bestScore = readability;
804
- bestColor = tinycolor(colorList[i]);
805
- }
806
- }
807
-
808
- if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
809
- return bestColor;
810
- }
811
- else {
812
- args.includeFallbackColors=false;
813
- return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
814
- }
815
- };
816
-
817
-
818
- // Big List of Colors
819
- // ------------------
820
- // <http://www.w3.org/TR/css3-color/#svg-color>
821
- var names = tinycolor.names = {
822
- aliceblue: "f0f8ff",
823
- antiquewhite: "faebd7",
824
- aqua: "0ff",
825
- aquamarine: "7fffd4",
826
- azure: "f0ffff",
827
- beige: "f5f5dc",
828
- bisque: "ffe4c4",
829
- black: "000",
830
- blanchedalmond: "ffebcd",
831
- blue: "00f",
832
- blueviolet: "8a2be2",
833
- brown: "a52a2a",
834
- burlywood: "deb887",
835
- burntsienna: "ea7e5d",
836
- cadetblue: "5f9ea0",
837
- chartreuse: "7fff00",
838
- chocolate: "d2691e",
839
- coral: "ff7f50",
840
- cornflowerblue: "6495ed",
841
- cornsilk: "fff8dc",
842
- crimson: "dc143c",
843
- cyan: "0ff",
844
- darkblue: "00008b",
845
- darkcyan: "008b8b",
846
- darkgoldenrod: "b8860b",
847
- darkgray: "a9a9a9",
848
- darkgreen: "006400",
849
- darkgrey: "a9a9a9",
850
- darkkhaki: "bdb76b",
851
- darkmagenta: "8b008b",
852
- darkolivegreen: "556b2f",
853
- darkorange: "ff8c00",
854
- darkorchid: "9932cc",
855
- darkred: "8b0000",
856
- darksalmon: "e9967a",
857
- darkseagreen: "8fbc8f",
858
- darkslateblue: "483d8b",
859
- darkslategray: "2f4f4f",
860
- darkslategrey: "2f4f4f",
861
- darkturquoise: "00ced1",
862
- darkviolet: "9400d3",
863
- deeppink: "ff1493",
864
- deepskyblue: "00bfff",
865
- dimgray: "696969",
866
- dimgrey: "696969",
867
- dodgerblue: "1e90ff",
868
- firebrick: "b22222",
869
- floralwhite: "fffaf0",
870
- forestgreen: "228b22",
871
- fuchsia: "f0f",
872
- gainsboro: "dcdcdc",
873
- ghostwhite: "f8f8ff",
874
- gold: "ffd700",
875
- goldenrod: "daa520",
876
- gray: "808080",
877
- green: "008000",
878
- greenyellow: "adff2f",
879
- grey: "808080",
880
- honeydew: "f0fff0",
881
- hotpink: "ff69b4",
882
- indianred: "cd5c5c",
883
- indigo: "4b0082",
884
- ivory: "fffff0",
885
- khaki: "f0e68c",
886
- lavender: "e6e6fa",
887
- lavenderblush: "fff0f5",
888
- lawngreen: "7cfc00",
889
- lemonchiffon: "fffacd",
890
- lightblue: "add8e6",
891
- lightcoral: "f08080",
892
- lightcyan: "e0ffff",
893
- lightgoldenrodyellow: "fafad2",
894
- lightgray: "d3d3d3",
895
- lightgreen: "90ee90",
896
- lightgrey: "d3d3d3",
897
- lightpink: "ffb6c1",
898
- lightsalmon: "ffa07a",
899
- lightseagreen: "20b2aa",
900
- lightskyblue: "87cefa",
901
- lightslategray: "789",
902
- lightslategrey: "789",
903
- lightsteelblue: "b0c4de",
904
- lightyellow: "ffffe0",
905
- lime: "0f0",
906
- limegreen: "32cd32",
907
- linen: "faf0e6",
908
- magenta: "f0f",
909
- maroon: "800000",
910
- mediumaquamarine: "66cdaa",
911
- mediumblue: "0000cd",
912
- mediumorchid: "ba55d3",
913
- mediumpurple: "9370db",
914
- mediumseagreen: "3cb371",
915
- mediumslateblue: "7b68ee",
916
- mediumspringgreen: "00fa9a",
917
- mediumturquoise: "48d1cc",
918
- mediumvioletred: "c71585",
919
- midnightblue: "191970",
920
- mintcream: "f5fffa",
921
- mistyrose: "ffe4e1",
922
- moccasin: "ffe4b5",
923
- navajowhite: "ffdead",
924
- navy: "000080",
925
- oldlace: "fdf5e6",
926
- olive: "808000",
927
- olivedrab: "6b8e23",
928
- orange: "ffa500",
929
- orangered: "ff4500",
930
- orchid: "da70d6",
931
- palegoldenrod: "eee8aa",
932
- palegreen: "98fb98",
933
- paleturquoise: "afeeee",
934
- palevioletred: "db7093",
935
- papayawhip: "ffefd5",
936
- peachpuff: "ffdab9",
937
- peru: "cd853f",
938
- pink: "ffc0cb",
939
- plum: "dda0dd",
940
- powderblue: "b0e0e6",
941
- purple: "800080",
942
- rebeccapurple: "663399",
943
- red: "f00",
944
- rosybrown: "bc8f8f",
945
- royalblue: "4169e1",
946
- saddlebrown: "8b4513",
947
- salmon: "fa8072",
948
- sandybrown: "f4a460",
949
- seagreen: "2e8b57",
950
- seashell: "fff5ee",
951
- sienna: "a0522d",
952
- silver: "c0c0c0",
953
- skyblue: "87ceeb",
954
- slateblue: "6a5acd",
955
- slategray: "708090",
956
- slategrey: "708090",
957
- snow: "fffafa",
958
- springgreen: "00ff7f",
959
- steelblue: "4682b4",
960
- tan: "d2b48c",
961
- teal: "008080",
962
- thistle: "d8bfd8",
963
- tomato: "ff6347",
964
- turquoise: "40e0d0",
965
- violet: "ee82ee",
966
- wheat: "f5deb3",
967
- white: "fff",
968
- whitesmoke: "f5f5f5",
969
- yellow: "ff0",
970
- yellowgreen: "9acd32"
971
- };
972
-
973
- // Make it easy to access colors via `hexNames[hex]`
974
- var hexNames = tinycolor.hexNames = flip(names);
975
-
976
-
977
- // Utilities
978
- // ---------
979
-
980
- // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
981
- function flip(o) {
982
- var flipped = { };
983
- for (var i in o) {
984
- if (o.hasOwnProperty(i)) {
985
- flipped[o[i]] = i;
986
- }
987
- }
988
- return flipped;
989
- }
990
-
991
- // Return a valid alpha value [0,1] with all invalid values being set to 1
992
- function boundAlpha(a) {
993
- a = parseFloat(a);
994
-
995
- if (isNaN(a) || a < 0 || a > 1) {
996
- a = 1;
997
- }
998
-
999
- return a;
1000
- }
1001
-
1002
- // Take input from [0, n] and return it as [0, 1]
1003
- function bound01(n, max) {
1004
- if (isOnePointZero(n)) { n = "100%"; }
1005
-
1006
- var processPercent = isPercentage(n);
1007
- n = mathMin(max, mathMax(0, parseFloat(n)));
1008
-
1009
- // Automatically convert percentage into number
1010
- if (processPercent) {
1011
- n = parseInt(n * max, 10) / 100;
1012
- }
1013
-
1014
- // Handle floating point rounding errors
1015
- if ((Math.abs(n - max) < 0.000001)) {
1016
- return 1;
1017
- }
1018
-
1019
- // Convert into [0, 1] range if it isn't already
1020
- return (n % max) / parseFloat(max);
1021
- }
1022
-
1023
- // Force a number between 0 and 1
1024
- function clamp01(val) {
1025
- return mathMin(1, mathMax(0, val));
1026
- }
1027
-
1028
- // Parse a base-16 hex value into a base-10 integer
1029
- function parseIntFromHex(val) {
1030
- return parseInt(val, 16);
1031
- }
1032
-
1033
- // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
1034
- // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
1035
- function isOnePointZero(n) {
1036
- return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
1037
- }
1038
-
1039
- // Check to see if string passed in is a percentage
1040
- function isPercentage(n) {
1041
- return typeof n === "string" && n.indexOf('%') != -1;
1042
- }
1043
-
1044
- // Force a hex value to have 2 characters
1045
- function pad2(c) {
1046
- return c.length == 1 ? '0' + c : '' + c;
1047
- }
1048
-
1049
- // Replace a decimal with it's percentage value
1050
- function convertToPercentage(n) {
1051
- if (n <= 1) {
1052
- n = (n * 100) + "%";
1053
- }
1054
-
1055
- return n;
1056
- }
1057
-
1058
- // Converts a decimal to a hex value
1059
- function convertDecimalToHex(d) {
1060
- return Math.round(parseFloat(d) * 255).toString(16);
1061
- }
1062
- // Converts a hex value to a decimal
1063
- function convertHexToDecimal(h) {
1064
- return (parseIntFromHex(h) / 255);
1065
- }
1066
-
1067
- var matchers = (function() {
1068
-
1069
- // <http://www.w3.org/TR/css3-values/#integers>
1070
- var CSS_INTEGER = "[-\\+]?\\d+%?";
1071
-
1072
- // <http://www.w3.org/TR/css3-values/#number-value>
1073
- var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
1074
-
1075
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
1076
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
1077
-
1078
- // Actual matching.
1079
- // Parentheses and commas are optional, but not required.
1080
- // Whitespace can take the place of commas or opening paren
1081
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
1082
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
1083
-
1084
- return {
1085
- CSS_UNIT: new RegExp(CSS_UNIT),
1086
- rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
1087
- rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
1088
- hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
1089
- hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
1090
- hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
1091
- hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
1092
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1093
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
1094
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1095
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
1096
- };
1097
- })();
1098
-
1099
- // `isValidCSSUnit`
1100
- // Take in a single string / number and check to see if it looks like a CSS unit
1101
- // (see `matchers` above for definition).
1102
- function isValidCSSUnit(color) {
1103
- return !!matchers.CSS_UNIT.exec(color);
1104
- }
1105
-
1106
- // `stringInputToObject`
1107
- // Permissive string parsing. Take in a number of formats, and output an object
1108
- // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
1109
- function stringInputToObject(color) {
1110
-
1111
- color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
1112
- var named = false;
1113
- if (names[color]) {
1114
- color = names[color];
1115
- named = true;
1116
- }
1117
- else if (color == 'transparent') {
1118
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
1119
- }
1120
-
1121
- // Try to match string input using regular expressions.
1122
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
1123
- // Just return an object and let the conversion functions handle that.
1124
- // This way the result will be the same whether the tinycolor is initialized with string or object.
1125
- var match;
1126
- if ((match = matchers.rgb.exec(color))) {
1127
- return { r: match[1], g: match[2], b: match[3] };
1128
- }
1129
- if ((match = matchers.rgba.exec(color))) {
1130
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
1131
- }
1132
- if ((match = matchers.hsl.exec(color))) {
1133
- return { h: match[1], s: match[2], l: match[3] };
1134
- }
1135
- if ((match = matchers.hsla.exec(color))) {
1136
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
1137
- }
1138
- if ((match = matchers.hsv.exec(color))) {
1139
- return { h: match[1], s: match[2], v: match[3] };
1140
- }
1141
- if ((match = matchers.hsva.exec(color))) {
1142
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
1143
- }
1144
- if ((match = matchers.hex8.exec(color))) {
1145
- return {
1146
- r: parseIntFromHex(match[1]),
1147
- g: parseIntFromHex(match[2]),
1148
- b: parseIntFromHex(match[3]),
1149
- a: convertHexToDecimal(match[4]),
1150
- format: named ? "name" : "hex8"
1151
- };
1152
- }
1153
- if ((match = matchers.hex6.exec(color))) {
1154
- return {
1155
- r: parseIntFromHex(match[1]),
1156
- g: parseIntFromHex(match[2]),
1157
- b: parseIntFromHex(match[3]),
1158
- format: named ? "name" : "hex"
1159
- };
1160
- }
1161
- if ((match = matchers.hex4.exec(color))) {
1162
- return {
1163
- r: parseIntFromHex(match[1] + '' + match[1]),
1164
- g: parseIntFromHex(match[2] + '' + match[2]),
1165
- b: parseIntFromHex(match[3] + '' + match[3]),
1166
- a: convertHexToDecimal(match[4] + '' + match[4]),
1167
- format: named ? "name" : "hex8"
1168
- };
1169
- }
1170
- if ((match = matchers.hex3.exec(color))) {
1171
- return {
1172
- r: parseIntFromHex(match[1] + '' + match[1]),
1173
- g: parseIntFromHex(match[2] + '' + match[2]),
1174
- b: parseIntFromHex(match[3] + '' + match[3]),
1175
- format: named ? "name" : "hex"
1176
- };
1177
- }
1178
-
1179
- return false;
1180
- }
1181
-
1182
- function validateWCAG2Parms(parms) {
1183
- // return valid WCAG2 parms for isReadable.
1184
- // If input parms are invalid, return {"level":"AA", "size":"small"}
1185
- var level, size;
1186
- parms = parms || {"level":"AA", "size":"small"};
1187
- level = (parms.level || "AA").toUpperCase();
1188
- size = (parms.size || "small").toLowerCase();
1189
- if (level !== "AA" && level !== "AAA") {
1190
- level = "AA";
1191
- }
1192
- if (size !== "small" && size !== "large") {
1193
- size = "small";
1194
- }
1195
- return {"level":level, "size":size};
1196
- }
1197
-
1198
- // Node: Export function
1199
- if ( true && module.exports) {
1200
- module.exports = tinycolor;
1201
- }
1202
- // AMD/requirejs: Define the module
1203
- else if (true) {
1204
- !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module),
1205
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
1206
- }
1207
- // Browser: Expose to window
1208
- else {}
1209
-
1210
- })(Math);
1211
-
1212
-
1213
- /***/ }),
1214
-
1215
- /***/ 4061:
1216
- /***/ ((module) => {
1217
-
1218
- "use strict";
1219
- module.exports = __WEBPACK_EXTERNAL_MODULE__4061__;
1220
-
1221
- /***/ }),
1222
-
1223
- /***/ 6870:
1224
- /***/ ((module) => {
1225
-
1226
- "use strict";
1227
- module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
1228
-
1229
- /***/ }),
1230
-
1231
- /***/ 4212:
1232
- /***/ ((module) => {
1233
-
1234
- "use strict";
1235
- module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
1236
-
1237
- /***/ }),
1238
-
1239
- /***/ 748:
1240
- /***/ ((module) => {
1241
-
1242
- "use strict";
1243
- module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
1244
-
1245
- /***/ }),
1246
-
1247
- /***/ 210:
1248
- /***/ ((module) => {
1249
-
1250
- "use strict";
1251
- module.exports = __WEBPACK_EXTERNAL_MODULE__210__;
1252
-
1253
- /***/ })
1254
-
1255
- /******/ });
1256
- /************************************************************************/
1257
- /******/ // The module cache
1258
- /******/ var __webpack_module_cache__ = {};
1259
- /******/
1260
- /******/ // The require function
1261
- /******/ function __webpack_require__(moduleId) {
1262
- /******/ // Check if module is in cache
1263
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
1264
- /******/ if (cachedModule !== undefined) {
1265
- /******/ return cachedModule.exports;
1266
- /******/ }
1267
- /******/ // Create a new module (and put it into the cache)
1268
- /******/ var module = __webpack_module_cache__[moduleId] = {
1269
- /******/ // no module.id needed
1270
- /******/ // no module.loaded needed
1271
- /******/ exports: {}
1272
- /******/ };
1273
- /******/
1274
- /******/ // Execute the module function
1275
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1276
- /******/
1277
- /******/ // Return the exports of the module
1278
- /******/ return module.exports;
1279
- /******/ }
1280
- /******/
1281
- /************************************************************************/
1282
- /******/ /* webpack/runtime/compat get default export */
1283
- /******/ (() => {
1284
- /******/ // getDefaultExport function for compatibility with non-harmony modules
1285
- /******/ __webpack_require__.n = (module) => {
1286
- /******/ var getter = module && module.__esModule ?
1287
- /******/ () => (module['default']) :
1288
- /******/ () => (module);
1289
- /******/ __webpack_require__.d(getter, { a: getter });
1290
- /******/ return getter;
1291
- /******/ };
1292
- /******/ })();
1293
- /******/
1294
- /******/ /* webpack/runtime/define property getters */
1295
- /******/ (() => {
1296
- /******/ // define getter functions for harmony exports
1297
- /******/ __webpack_require__.d = (exports, definition) => {
1298
- /******/ for(var key in definition) {
1299
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1300
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1301
- /******/ }
1302
- /******/ }
1303
- /******/ };
1304
- /******/ })();
1305
- /******/
1306
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
1307
- /******/ (() => {
1308
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1309
- /******/ })();
1310
- /******/
1311
- /******/ /* webpack/runtime/make namespace object */
1312
- /******/ (() => {
1313
- /******/ // define __esModule on exports
1314
- /******/ __webpack_require__.r = (exports) => {
1315
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1316
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1317
- /******/ }
1318
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
1319
- /******/ };
1320
- /******/ })();
1321
- /******/
1322
- /************************************************************************/
1323
- var __webpack_exports__ = {};
1324
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
1325
- (() => {
1326
- "use strict";
1327
- // ESM COMPAT FLAG
1328
- __webpack_require__.r(__webpack_exports__);
1329
-
1330
- // EXPORTS
1331
- __webpack_require__.d(__webpack_exports__, {
1332
- "default": () => (/* binding */ src)
1333
- });
1334
-
1335
- // EXTERNAL MODULE: external "../shared"
1336
- var external_shared_ = __webpack_require__(4212);
1337
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
1338
- function _defineProperty(obj, key, value) {
1339
- if (key in obj) {
1340
- Object.defineProperty(obj, key, {
1341
- value: value,
1342
- enumerable: true,
1343
- configurable: true,
1344
- writable: true
1345
- });
1346
- } else {
1347
- obj[key] = value;
1348
- }
1349
-
1350
- return obj;
1351
- }
1352
- // EXTERNAL MODULE: external "vue"
1353
- var external_vue_ = __webpack_require__(748);
1354
- // EXTERNAL MODULE: ../../node_modules/tinycolor2/tinycolor.js
1355
- var tinycolor = __webpack_require__(8621);
1356
- var tinycolor_default = /*#__PURE__*/__webpack_require__.n(tinycolor);
1357
- // EXTERNAL MODULE: external "vue-types"
1358
- var external_vue_types_ = __webpack_require__(210);
1359
- // EXTERNAL MODULE: external "../directives"
1360
- var external_directives_ = __webpack_require__(4061);
1361
- // EXTERNAL MODULE: external "../icon"
1362
- var external_icon_ = __webpack_require__(6870);
1363
- ;// CONCATENATED MODULE: ../../packages/date-picker/src/base/picker-dropdown.tsx
1364
-
1365
-
1366
- /*
1367
- * Tencent is pleased to support the open source community by making
1368
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1369
- *
1370
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1371
- *
1372
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1373
- *
1374
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1375
- *
1376
- * ---------------------------------------------------
1377
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1378
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1379
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1380
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1381
- *
1382
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1383
- * the Software.
1384
- *
1385
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1386
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1387
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1388
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1389
- * IN THE SOFTWARE.
1390
- */
1391
-
1392
-
1393
- var pickerDropdownProps = {
1394
- placement: {
1395
- type: String,
1396
- "default": 'bottom-start',
1397
- validator: function validator(value) {
1398
- var validList = ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'];
1399
-
1400
- if (validList.indexOf(value) < 0) {
1401
- console.error("placement property is not valid: '".concat(value, "'"));
1402
- return false;
1403
- }
1404
-
1405
- return true;
1406
- }
1407
- },
1408
- className: {
1409
- type: String
1410
- },
1411
- extPopoverCls: {
1412
- type: String
1413
- },
1414
- appendToBody: {
1415
- type: Boolean
1416
- },
1417
- triggerRef: {
1418
- type: Object
1419
- },
1420
- onClick: Function
1421
- };
1422
- /* harmony default export */ const picker_dropdown = ((0,external_vue_.defineComponent)({
1423
- props: pickerDropdownProps,
1424
- emits: ['changeVisible'],
1425
- setup: function setup(props, _ref) {
1426
- var emit = _ref.emit;
1427
- var popoverInstance = Object.create(null);
1428
- var refContentRef = (0,external_vue_.ref)(null);
1429
- (0,external_vue_.onMounted)(function () {
1430
- updateDropdown();
1431
- });
1432
- (0,external_vue_.onBeforeUnmount)(function () {
1433
- destoryDropdown();
1434
- }); // const resetTransformOrigin = (state) => {
1435
- // if (popoverInstance && Object.keys(popoverInstance).length !== 0) {
1436
- // const dataPopperPlacement = state.attributes.popper['data-popper-placement'] as string;
1437
- // const arr = dataPopperPlacement.split('-');
1438
- // const placementStart = arr[0];
1439
- // const placementEnd = arr[1];
1440
- // const leftOrRight = dataPopperPlacement === 'left' || dataPopperPlacement === 'right';
1441
- // if (!leftOrRight) {
1442
- // state.styles.popper.transformOrigin = placementStart === 'bottom'
1443
- // || (placementStart !== 'top' && placementEnd === 'start')
1444
- // ? 'center top'
1445
- // : 'center bottom';
1446
- // }
1447
- // }
1448
- // };
1449
-
1450
- var forceUpdate = function forceUpdate() {
1451
- var _a;
1452
-
1453
- if (popoverInstance) {
1454
- (_a = popoverInstance === null || popoverInstance === void 0 ? void 0 : popoverInstance.forceUpdate) === null || _a === void 0 ? void 0 : _a.call(popoverInstance);
1455
- }
1456
- };
1457
-
1458
- var destoryDropdown = function destoryDropdown() {
1459
- if (popoverInstance && Object.keys(popoverInstance).length !== 0) {
1460
- var instance = popoverInstance;
1461
- instance.isShow && instance.hide();
1462
- instance.destroy();
1463
- popoverInstance = null;
1464
- emit('changeVisible', false);
1465
- }
1466
- }; // const transforms = {
1467
- // top: 'bottom center',
1468
- // 'top-start': 'bottom left',
1469
- // 'top-end': 'bottom right',
1470
- // bottom: 'top center',
1471
- // 'bottom-start': 'top left',
1472
- // 'bottom-end': 'top right',
1473
- // left: 'right center',
1474
- // 'left-start': 'right top',
1475
- // 'left-end': 'right bottom',
1476
- // right: 'left center',
1477
- // 'right-start': 'left top',
1478
- // 'right-end': 'left bottom',
1479
- // };
1480
- // const toTransformOrigin = (placement: Placement) => transforms[placement];
1481
- // const toVar = (value: string, fallback?: string) => ({
1482
- // var: value,
1483
- // varRef: fallback ? `var(${value}, ${fallback})` : `var(${value})`,
1484
- // });
1485
- // const cssVars = {
1486
- // arrowShadowColor: toVar('--popper-arrow-shadow-color'),
1487
- // arrowSize: toVar('--popper-arrow-size', '8px'),
1488
- // arrowSizeHalf: toVar('--popper-arrow-size-half'),
1489
- // arrowBg: toVar('--popper-arrow-bg'),
1490
- // transformOrigin: toVar('--popper-transform-origin'),
1491
- // arrowOffset: toVar('--popper-arrow-offset'),
1492
- // } as const;
1493
- // const setTransformOrigin = (state: State) => {
1494
- // state.elements.popper.style.setProperty(
1495
- // cssVars.transformOrigin.var,
1496
- // toTransformOrigin(state.placement),
1497
- // );
1498
- // };
1499
- // const transformOrigin: Modifier<'transformOrigin', any> = {
1500
- // name: 'transformOrigin',
1501
- // enabled: true,
1502
- // phase: 'write',
1503
- // fn: ({ state }) => {
1504
- // setTransformOrigin(state);
1505
- // },
1506
- // effect: ({ state }) => () => {
1507
- // setTransformOrigin(state);
1508
- // },
1509
- // };
1510
- // const matchWidth: Modifier<'matchWidth', any> = {
1511
- // name: 'matchWidth',
1512
- // enabled: true,
1513
- // phase: 'beforeWrite',
1514
- // requires: ['computeStyles'],
1515
- // fn: ({ state }) => {
1516
- // state.styles.popper.width = `${state.rects.reference.width + 1}px`;
1517
- // },
1518
- // effect: ({ state }) => () => {
1519
- // const reference = state.elements.reference as HTMLElement;
1520
- // state.elements.popper.style.width = `${reference.offsetWidth}px`;
1521
- // },
1522
- // };
1523
-
1524
-
1525
- var updateDropdown = function updateDropdown() {
1526
- if (popoverInstance && Object.keys(popoverInstance).length !== 0) {
1527
- (0,external_vue_.nextTick)(function () {
1528
- popoverInstance.update();
1529
- });
1530
- } else {
1531
- (0,external_vue_.nextTick)(function () {
1532
- popoverInstance = new external_shared_.BKPopover(props.triggerRef, refContentRef.value, {
1533
- placement: props.placement,
1534
- trigger: 'manual',
1535
- modifiers: [// matchWidth,
1536
- // transformOrigin,
1537
- {
1538
- name: 'computeStyles',
1539
- options: {
1540
- adaptive: false,
1541
- gpuAcceleration: false
1542
- }
1543
- }, {
1544
- name: 'offset',
1545
- options: {
1546
- offset: [0, 4]
1547
- }
1548
- } // {
1549
- // name: 'preventOverflow',
1550
- // options: {
1551
- // // boundariesElement: 'window',
1552
- // padding: {
1553
- // top: 2,
1554
- // bottom: 2,
1555
- // left: 5,
1556
- // right: 5,
1557
- // },
1558
- // },
1559
- // },
1560
- // {
1561
- // name: 'flip',
1562
- // options: {
1563
- // padding: 5,
1564
- // rootBoundary: 'document',
1565
- // },
1566
- // },
1567
- // {
1568
- // name: 'onUpdate',
1569
- // enabled: true,
1570
- // phase: 'afterWrite',
1571
- // fn({ state }) {
1572
- // resetTransformOrigin(state);
1573
- // },
1574
- // },
1575
- ] // onFirstUpdate: () => {
1576
- // resetTransformOrigin(popoverInstance.instance.state);
1577
- // },
1578
-
1579
- }); // popoverInstance.update();
1580
- });
1581
- }
1582
- };
1583
-
1584
- var styles = (0,external_vue_.computed)(function () {
1585
- var style = {};
1586
-
1587
- if (props.appendToBody) {
1588
- style['z-index'] = 1060 + external_shared_.bkZIndexManager.getModalNextIndex();
1589
- }
1590
-
1591
- return style;
1592
- });
1593
- var state = (0,external_vue_.reactive)({
1594
- styles: styles
1595
- });
1596
- return Object.assign(Object.assign({}, (0,external_vue_.toRefs)(state)), {
1597
- refContentRef: refContentRef,
1598
- forceUpdate: forceUpdate,
1599
- updateDropdown: updateDropdown,
1600
- destoryDropdown: destoryDropdown
1601
- });
1602
- },
1603
- render: function render() {
1604
- var _a, _b, _c;
1605
-
1606
- return (0,external_vue_.createVNode)("div", {
1607
- "ref": "refContentRef",
1608
- "class": [(0,external_shared_.resolveClassName)('date-picker-dropdown'), this.className, this.extPopoverCls],
1609
- "style": this.styles,
1610
- "onClick": this.onClick
1611
- }, [(_c = (_b = (_a = this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '']);
1612
- }
1613
- }));
1614
- ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/input-container.tsx
1615
-
1616
-
1617
- /*
1618
- * Tencent is pleased to support the open source community by making
1619
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1620
- *
1621
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1622
- *
1623
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1624
- *
1625
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1626
- *
1627
- * ---------------------------------------------------
1628
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1629
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1630
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1631
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1632
- *
1633
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1634
- * the Software.
1635
- *
1636
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1637
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1638
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1639
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1640
- * IN THE SOFTWARE.
1641
- */
1642
-
1643
-
1644
- var inputContainerProps = {
1645
- info: external_shared_.PropTypes.object.isRequired
1646
- };
1647
- /* harmony default export */ const input_container = ((0,external_vue_.defineComponent)({
1648
- props: inputContainerProps,
1649
- emits: ['tab', 'input'],
1650
- setup: function setup(props, _ref) {
1651
- var emit = _ref.emit;
1652
-
1653
- var handleTab = function handleTab(e) {
1654
- if (props.info.key === 'a') {
1655
- emit('tab', e);
1656
- }
1657
- };
1658
-
1659
- var handleInput = function handleInput(e) {
1660
- var key = props.info.key;
1661
- var value = e.target.value;
1662
- emit('input', key, value);
1663
- };
1664
-
1665
- var colorPickerCls = (0,external_vue_.computed)(function () {
1666
- return (0,external_shared_.classes)({
1667
- error: props.info.error
1668
- }, 'bk-color-picker-input-value');
1669
- });
1670
- return function () {
1671
- return (0,external_vue_.createVNode)("div", {
1672
- "class": "bk-color-picker-input-part"
1673
- }, [(0,external_vue_.createVNode)("input", {
1674
- "type": props.info.name === 'HEX' ? 'text' : 'number',
1675
- "class": colorPickerCls.value,
1676
- "value": props.info.value,
1677
- "onKeydown": handleTab,
1678
- "onInput": handleInput
1679
- }, null), (0,external_vue_.createVNode)("span", {
1680
- "class": "bk-color-picker-input-text"
1681
- }, [props.info.name])]);
1682
- };
1683
- }
1684
- }));
1685
- ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/color-input.tsx
1686
-
1687
-
1688
- /*
1689
- * Tencent is pleased to support the open source community by making
1690
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1691
- *
1692
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1693
- *
1694
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1695
- *
1696
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1697
- *
1698
- * ---------------------------------------------------
1699
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1700
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1701
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1702
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1703
- *
1704
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1705
- * the Software.
1706
- *
1707
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1708
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1709
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1710
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1711
- * IN THE SOFTWARE.
1712
- */
1713
-
1714
-
1715
-
1716
-
1717
- var colorPickerProps = {
1718
- colorObj: external_shared_.PropTypes.object.isRequired
1719
- };
1720
- /* harmony default export */ const color_input = ((0,external_vue_.defineComponent)({
1721
- name: 'ColorPicker',
1722
- props: colorPickerProps,
1723
- emits: ['change', 'tab'],
1724
- setup: function setup(props, _ref) {
1725
- var emit = _ref.emit;
1726
- var hex = (0,external_vue_.reactive)({
1727
- key: 'hex',
1728
- name: 'HEX',
1729
- value: props.colorObj.hex,
1730
- error: false
1731
- });
1732
- var r = (0,external_vue_.reactive)({
1733
- key: 'r',
1734
- name: 'R',
1735
- value: props.colorObj.rgba.r.toString(),
1736
- error: false
1737
- });
1738
- var g = (0,external_vue_.reactive)({
1739
- key: 'g',
1740
- name: 'G',
1741
- value: props.colorObj.rgba.g.toString(),
1742
- error: false
1743
- });
1744
- var b = (0,external_vue_.reactive)({
1745
- key: 'b',
1746
- name: 'B',
1747
- value: props.colorObj.rgba.b.toString(),
1748
- error: false
1749
- });
1750
- var a = (0,external_vue_.reactive)({
1751
- key: 'a',
1752
- name: 'Alpha',
1753
- value: props.colorObj.rgba.a.toString(),
1754
- error: false
1755
- });
1756
- (0,external_vue_.watch)(function () {
1757
- return props.colorObj;
1758
- }, function (val) {
1759
- if (tinycolor_default()(val.hex).toString() !== tinycolor_default()(hex.value).toString()) {
1760
- // 只有 hex 代表的颜色不同才同步,像这种手动输入了 #fEF 等价于 #ffeeff 就不同步
1761
- hex.value = val.hex;
1762
- }
1763
-
1764
- r.value = val.rgba.r.toString();
1765
- g.value = val.rgba.g.toString();
1766
- b.value = val.rgba.b.toString();
1767
- a.value = val.rgba.a.toString(); // 每次变化时校验以更新存在的错误
1768
-
1769
- validate();
1770
- }, {
1771
- deep: true
1772
- }); // 最后的 alpha 表单 tab 事件
1773
-
1774
- var handleAlphaTab = function handleAlphaTab(e) {
1775
- emit('tab', e);
1776
- };
1777
- /**
1778
- * 处理手动输入颜色
1779
- * @param {String} key
1780
- * @param {String} value
1781
- */
1782
-
1783
-
1784
- var handleInput = function handleInput(key, value) {
1785
- var colorList = {
1786
- r: r,
1787
- g: g,
1788
- b: b,
1789
- a: a,
1790
- hex: hex
1791
- };
1792
- colorList[key].value = value;
1793
-
1794
- if (validate()) {
1795
- var colorStr = key === 'hex' ? hex.value : "rgba(".concat(r.value, ", ").concat(g.value, ", ").concat(b.value, ", ").concat(a.value, ")");
1796
- emit('change', colorStr);
1797
- }
1798
- }; // 判断表单输入值是否合法
1799
-
1800
-
1801
- var validate = function validate() {
1802
- var result = true; // hex
1803
-
1804
- if (hex.value.startsWith('#') && (hex.value.length === 4 || hex.value.length === 7) && !hex.value.slice(1).match(/[^0-9a-fA-F]/)) {
1805
- hex.error = false;
1806
- } else {
1807
- hex.error = true;
1808
- result = false;
1809
- } // a
1810
-
1811
-
1812
- if (a.value !== '' && a.value >= 0 && a.value <= 1) {
1813
- a.error = false;
1814
- } else {
1815
- a.error = true;
1816
- result = false;
1817
- } // r g b
1818
-
1819
-
1820
- for (var _i = 0, _arr = [r, g, b]; _i < _arr.length; _i++) {
1821
- var colorInfo = _arr[_i];
1822
- var value = colorInfo.value;
1823
-
1824
- if (value !== '' && value >= 0 && value <= 255) {
1825
- colorInfo.error = false;
1826
- } else {
1827
- colorInfo.error = true;
1828
- result = false;
1829
- }
1830
- }
1831
-
1832
- return result;
1833
- };
1834
-
1835
- return function () {
1836
- return (0,external_vue_.createVNode)("div", {
1837
- "class": "bk-color-picker-input"
1838
- }, [(0,external_vue_.createVNode)("div", {
1839
- "class": "bk-color-picker-input-hex"
1840
- }, [(0,external_vue_.createVNode)(input_container, {
1841
- "info": hex,
1842
- "onInput": handleInput
1843
- }, null)]), (0,external_vue_.createVNode)("div", {
1844
- "class": "bk-color-picker-input-rgba"
1845
- }, [(0,external_vue_.createVNode)(input_container, {
1846
- "info": r,
1847
- "onInput": handleInput
1848
- }, null), (0,external_vue_.createVNode)(input_container, {
1849
- "info": g,
1850
- "onInput": handleInput
1851
- }, null), (0,external_vue_.createVNode)(input_container, {
1852
- "info": b,
1853
- "onInput": handleInput
1854
- }, null), (0,external_vue_.createVNode)(input_container, {
1855
- "info": a,
1856
- "onInput": handleInput,
1857
- "onTab": handleAlphaTab
1858
- }, null)])]);
1859
- };
1860
- }
1861
- }));
1862
- ;// CONCATENATED MODULE: ../../packages/color-picker/src/utils.ts
1863
- /*
1864
- * Tencent is pleased to support the open source community by making
1865
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1866
- *
1867
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1868
- *
1869
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1870
- *
1871
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1872
- *
1873
- * ---------------------------------------------------
1874
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1875
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1876
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1877
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1878
- *
1879
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1880
- * the Software.
1881
- *
1882
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1883
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1884
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1885
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1886
- * IN THE SOFTWARE.
1887
- */
1888
-
1889
- /**
1890
- * 根据饱和度面板、色值面板或普通色值标准化颜色信息
1891
- * @param {String|Object} colorParam - 色值信息
1892
- * @param {String} colorParam.h - 色相
1893
- * @param {String} colorParam.s - 饱和度
1894
- * @param {String} [colorParam.l] - 亮度
1895
- * @param {String} [colorParam.v] - 明度
1896
- * @param {String} colorParam.a - 透明度
1897
- * @returns {Object} - 转化后的色值对象
1898
- */
1899
-
1900
- var formatColor = function formatColor(colorParam) {
1901
- var colorValue = colorParam;
1902
-
1903
- if (colorParam === '') {
1904
- colorValue = '#FFFFFF';
1905
- } // 如果参数不合法会返回黑色#000相关信息
1906
-
1907
-
1908
- var tinyColor = tinycolor_default()(colorParam);
1909
- var hsl = tinyColor.toHsl();
1910
- var hsv = tinyColor.toHsv(); // 因为饱和度为0时,颜色不受色相值影响,色相会置零,但是这里需要在面板中保存色相值
1911
-
1912
- if (hsl.s === 0) {
1913
- hsl.h = colorValue.h || 0;
1914
- hsv.h = colorValue.h || 0;
1915
- } // when the hsv.v is less than 0.0164 (base on test)
1916
- // because of possible loss of precision
1917
- // the result of hue and saturation would be miscalculated
1918
-
1919
-
1920
- if (hsv.v < 0.0164) {
1921
- hsv.h = colorValue.h || 0;
1922
- hsv.s = colorValue.s || 0;
1923
- }
1924
-
1925
- if (hsl.l < 0.01) {
1926
- hsl.h = colorValue.h || 0;
1927
- hsl.s = colorValue.s || 0;
1928
- }
1929
-
1930
- return {
1931
- hsl: hsl,
1932
- hsv: hsv,
1933
- hex: tinyColor.toHexString().toUpperCase(),
1934
- rgba: tinyColor.toRgb()
1935
- };
1936
- };
1937
- /**
1938
- * 返回指定闭区间数值
1939
- * @param {Number} value
1940
- * @param {Number} min
1941
- * @param {Number} max
1942
- * @returns {Number}
1943
- */
1944
-
1945
- var clamp = function clamp(value, min, max) {
1946
- if (value < min) {
1947
- return min;
1948
- }
1949
-
1950
- if (value > max) {
1951
- return max;
1952
- }
1953
-
1954
- return value;
1955
- };
1956
- /**
1957
- * 移动端获取事件位置
1958
- * @param {Object} e
1959
- * @param {String} prop
1960
- * @returns {Number}
1961
- */
1962
-
1963
- var getTouches = function getTouches(e, prop) {
1964
- return e.touches ? e.touches[0][prop] : 0;
1965
- };
1966
- /**
1967
- * 转化 rgba 色值字符串
1968
- * @param {Object} rgba
1969
- * @returns {String}
1970
- */
1971
-
1972
- var toRGBAString = function toRGBAString(rgba) {
1973
- var r = rgba.r,
1974
- g = rgba.g,
1975
- b = rgba.b,
1976
- a = rgba.a;
1977
- return "rgba(".concat([r, g, b, a].join(','), ")");
1978
- };
1979
- ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/hue-slider.tsx
1980
-
1981
-
1982
- /*
1983
- * Tencent is pleased to support the open source community by making
1984
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1985
- *
1986
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1987
- *
1988
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1989
- *
1990
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1991
- *
1992
- * ---------------------------------------------------
1993
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1994
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1995
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1996
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1997
- *
1998
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1999
- * the Software.
2000
- *
2001
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2002
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2003
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2004
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2005
- * IN THE SOFTWARE.
2006
- */
2007
-
2008
-
2009
-
2010
- var hue_slider_colorPickerProps = {
2011
- colorObj: external_shared_.PropTypes.object.isRequired
2012
- };
2013
- /* harmony default export */ const hue_slider = ((0,external_vue_.defineComponent)({
2014
- name: 'ColorPicker',
2015
- props: hue_slider_colorPickerProps,
2016
- emits: ['change'],
2017
- setup: function setup(props, _ref) {
2018
- var emit = _ref.emit;
2019
- var containerRef = (0,external_vue_.ref)(null);
2020
- var pointerStyle = (0,external_vue_.computed)(function () {
2021
- return {
2022
- left: "".concat(props.colorObj.hsv.h / 360 * 100, "%")
2023
- };
2024
- });
2025
-
2026
- var handleArrowKeydown = function handleArrowKeydown(e) {
2027
- var clientWidth = containerRef.value.clientWidth;
2028
- var left = props.colorObj.hsv.h / 360 * clientWidth;
2029
- var step = 2;
2030
- var hugeStep = 10;
2031
-
2032
- switch (e.code) {
2033
- case 'ArrowLeft':
2034
- e.preventDefault();
2035
- left = clamp(left - step, 0, clientWidth);
2036
- break;
2037
-
2038
- case 'ArrowRight':
2039
- e.preventDefault();
2040
- left = clamp(left + step, 0, clientWidth);
2041
- break;
2042
-
2043
- case 'ArrowUp':
2044
- e.preventDefault();
2045
- left = clamp(left - hugeStep, 0, clientWidth);
2046
- break;
2047
-
2048
- case 'ArrowDown':
2049
- e.preventDefault();
2050
- left = clamp(left + hugeStep, 0, clientWidth);
2051
- break;
2052
-
2053
- default:
2054
- return;
2055
- }
2056
-
2057
- handlePointChange(null, left);
2058
- };
2059
-
2060
- var handleMouseDown = function handleMouseDown(e) {
2061
- containerRef.value.focus();
2062
- handlePointChange(e);
2063
- window.addEventListener('mousemove', handlePointChange, {
2064
- passive: true
2065
- });
2066
- window.addEventListener('mouseup', handleMouseUp);
2067
- };
2068
-
2069
- var handleMouseUp = function handleMouseUp() {
2070
- window.removeEventListener('mousemove', handlePointChange);
2071
- window.removeEventListener('mouseup', handleMouseUp);
2072
- };
2073
- /**
2074
- * 色相面板变化
2075
- * @param {MouseEvent|null} e - 鼠标滑动事件
2076
- * @param {Number} [appointedLeft] - 键盘事件对应坐标,如果有就优先使用
2077
- */
2078
-
2079
-
2080
- var handlePointChange = function handlePointChange(e, appointedLeft) {
2081
- var clientWidth = containerRef.value.clientWidth;
2082
- var left = appointedLeft !== undefined ? appointedLeft : getLeft(e);
2083
- changeColor(left / clientWidth);
2084
- };
2085
-
2086
- var getLeft = function getLeft(e) {
2087
- var xOffset = containerRef.value.getBoundingClientRect().left + window.pageXOffset;
2088
- var pageX = e.pageX || getTouches(e, 'PageX');
2089
- return clamp(pageX - xOffset, 0, containerRef.value.clientWidth);
2090
- };
2091
-
2092
- var changeColor = function changeColor(ratio) {
2093
- var _props$colorObj$hsl = props.colorObj.hsl,
2094
- h = _props$colorObj$hsl.h,
2095
- s = _props$colorObj$hsl.s,
2096
- l = _props$colorObj$hsl.l,
2097
- a = _props$colorObj$hsl.a;
2098
- var newHue = ratio * 360;
2099
-
2100
- if (h !== newHue) {
2101
- emit('change', {
2102
- h: newHue,
2103
- s: s,
2104
- l: l,
2105
- a: a
2106
- });
2107
- }
2108
- };
2109
-
2110
- return function () {
2111
- return (0,external_vue_.createVNode)("div", {
2112
- "ref": containerRef,
2113
- "tabindex": "0",
2114
- "class": "bk-color-picker-hue",
2115
- "onKeydown": handleArrowKeydown,
2116
- "onMousedown": function onMousedown(e) {
2117
- e.stopPropagation();
2118
- e.preventDefault();
2119
- handleMouseDown(e);
2120
- }
2121
- }, [(0,external_vue_.createVNode)("div", {
2122
- "class": "bk-color-picker-hue-pointer",
2123
- "style": pointerStyle.value
2124
- }, [(0,external_vue_.createVNode)("div", {
2125
- "class": "bk-color-picker-hue-rectangle"
2126
- }, null)])]);
2127
- };
2128
- }
2129
- }));
2130
- ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/recommend-colors.tsx
2131
-
2132
-
2133
- /*
2134
- * Tencent is pleased to support the open source community by making
2135
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2136
- *
2137
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2138
- *
2139
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2140
- *
2141
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2142
- *
2143
- * ---------------------------------------------------
2144
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2145
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2146
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2147
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2148
- *
2149
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2150
- * the Software.
2151
- *
2152
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2153
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2154
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2155
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2156
- * IN THE SOFTWARE.
2157
- */
2158
-
2159
-
2160
-
2161
-
2162
- var recommend_colors_colorPickerProps = {
2163
- colorObj: external_shared_.PropTypes.object.isRequired,
2164
- recommend: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.array.def(function () {
2165
- return [];
2166
- }), external_shared_.PropTypes.bool.def(true)]).isRequired
2167
- };
2168
- /* harmony default export */ const recommend_colors = ((0,external_vue_.defineComponent)({
2169
- props: recommend_colors_colorPickerProps,
2170
- emits: ['change', 'tab'],
2171
- setup: function setup(props, _ref) {
2172
- var emit = _ref.emit;
2173
- var isFocused = (0,external_vue_.ref)(false);
2174
- var selectedIndex = (0,external_vue_.ref)(-1);
2175
- var selectedColor = (0,external_vue_.ref)(null);
2176
- (0,external_vue_.watch)(function () {
2177
- return props.colorObj;
2178
- }, function () {
2179
- // 每次在外部修改颜色后预设面板都会取消预设选择的样式,即便预设和当前色一样
2180
- // 预设里面修改颜色会在 $nextTick 恢复状态
2181
- selectedIndex.value = -1;
2182
- selectedColor.value = null;
2183
- }, {
2184
- deep: true
2185
- });
2186
- var colors = (0,external_vue_.computed)(function () {
2187
- return getColorsFromRecommend(props.recommend);
2188
- });
2189
-
2190
- var getColorClass = function getColorClass(color, index) {
2191
- return (0,external_shared_.classes)({
2192
- 'bk-color-picker-empty': color === '',
2193
- 'bk-color-picker-recommend-selected-color': isFocused.value && selectedIndex.value === index
2194
- }, 'bk-color-picker-recommend-color');
2195
- };
2196
-
2197
- var handleKeydown = function handleKeydown(e) {
2198
- if (e.code === 'Tab') {
2199
- emit('tab', e);
2200
- } else {
2201
- var index = 0;
2202
- var rowNum = 10; // 每行展示的颜色块个数,和样式相关联
2203
-
2204
- var max = colors.value.length - 1;
2205
-
2206
- switch (e.code) {
2207
- case 'ArrowLeft':
2208
- e.preventDefault();
2209
- index = clamp(selectedIndex.value - 1, 0, max);
2210
- break;
2211
-
2212
- case 'ArrowRight':
2213
- e.preventDefault();
2214
- index = clamp(selectedIndex.value + 1, 0, max);
2215
- break;
2216
-
2217
- case 'ArrowUp':
2218
- e.preventDefault();
2219
- index = clamp(selectedIndex.value - rowNum, 0, max);
2220
- break;
2221
-
2222
- case 'ArrowDown':
2223
- e.preventDefault();
2224
- index = clamp(selectedIndex.value + rowNum, 0, max);
2225
- break;
2226
-
2227
- default:
2228
- return;
2229
- }
2230
-
2231
- selectColor(index);
2232
- }
2233
- };
2234
-
2235
- var selectColor = function selectColor(index) {
2236
- var color = colors.value[index];
2237
- emit('change', color); // 预设里面修改颜色不重置状态(恢复状态)
2238
-
2239
- (0,external_vue_.nextTick)(function () {
2240
- selectedIndex.value = index;
2241
- selectedColor.value = color;
2242
- });
2243
- };
2244
- /**
2245
- * 校验、处理预设值
2246
- * @param {Boolean|String[]} recommend
2247
- * @returns {String[]}
2248
- */
2249
-
2250
-
2251
- var getColorsFromRecommend = function getColorsFromRecommend(recommend) {
2252
- if (recommend === true) {
2253
- return ['', '#ff4500', '#ff8c00', '#ffd700', '#90ee90', '#ddffff', '#00ced1', '#3a84ff', '#a933f5', '#db7093', '#000000', '#494949', '#9B9B9B', '#ffffff'];
2254
- }
2255
-
2256
- if (Array.isArray(recommend)) {
2257
- // 如果预设值是无效的,这里按空字符串处理以显示提示用户,应该输入正确的色值
2258
- return recommend.map(function (color) {
2259
- return tinycolor_default()(color).isValid() ? color : '';
2260
- });
2261
- }
2262
- };
2263
-
2264
- return function () {
2265
- return (0,external_vue_.createVNode)("div", {
2266
- "tabindex": "0",
2267
- "class": "bk-color-picker-recommend",
2268
- "onFocus": function onFocus() {
2269
- return isFocused.value = true;
2270
- },
2271
- "onBlur": function onBlur() {
2272
- return isFocused.value = false;
2273
- },
2274
- "onKeydown": handleKeydown
2275
- }, [colors.value.map(function (color, index) {
2276
- return (0,external_vue_.createVNode)("div", {
2277
- "style": "background: ".concat(color || '#fff'),
2278
- "class": getColorClass(color, index),
2279
- "onClick": function onClick() {
2280
- return selectColor(index);
2281
- }
2282
- }, [selectedIndex.value === index ? (0,external_vue_.createVNode)("div", {
2283
- "class": "bk-color-picker-pointer"
2284
- }, [(0,external_vue_.createVNode)("div", {
2285
- "class": "bk-color-picker-circle"
2286
- }, null)]) : undefined]);
2287
- })]);
2288
- };
2289
- }
2290
- }));
2291
- ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/saturation-panel.tsx
2292
-
2293
-
2294
- /*
2295
- * Tencent is pleased to support the open source community by making
2296
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2297
- *
2298
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2299
- *
2300
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2301
- *
2302
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2303
- *
2304
- * ---------------------------------------------------
2305
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2306
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2307
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2308
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2309
- *
2310
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2311
- * the Software.
2312
- *
2313
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2314
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2315
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2316
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2317
- * IN THE SOFTWARE.
2318
- */
2319
-
2320
-
2321
-
2322
- var saturation_panel_colorPickerProps = {
2323
- colorObj: external_shared_.PropTypes.object.isRequired
2324
- };
2325
- /* harmony default export */ const saturation_panel = ((0,external_vue_.defineComponent)({
2326
- props: saturation_panel_colorPickerProps,
2327
- emits: ['change'],
2328
- setup: function setup(props, _ref) {
2329
- var emit = _ref.emit;
2330
- var containerRef = (0,external_vue_.ref)(null);
2331
- var backgroundStyle = (0,external_vue_.computed)(function () {
2332
- return {
2333
- background: "hsl(".concat(props.colorObj.hsv.h, ", 100%, 50%)")
2334
- };
2335
- });
2336
- var pointerStyle = (0,external_vue_.computed)(function () {
2337
- return {
2338
- top: "".concat((1 - props.colorObj.hsv.v) * 100, "%"),
2339
- left: "".concat(props.colorObj.hsv.s * 100, "%")
2340
- };
2341
- });
2342
-
2343
- var handleMouseDown = function handleMouseDown(e) {
2344
- containerRef.value.focus();
2345
- handlePointChange(e);
2346
- window.addEventListener('mousemove', handlePointChange, {
2347
- passive: true
2348
- });
2349
- window.addEventListener('mouseup', handleMouseUp);
2350
- };
2351
-
2352
- var handleMouseUp = function handleMouseUp() {
2353
- window.removeEventListener('mousemove', handlePointChange);
2354
- window.removeEventListener('mouseup', handleMouseUp);
2355
- };
2356
-
2357
- var handleArrowKeydown = function handleArrowKeydown(e) {
2358
- var _containerRef$value = containerRef.value,
2359
- clientWidth = _containerRef$value.clientWidth,
2360
- clientHeight = _containerRef$value.clientHeight;
2361
- var left = props.colorObj.hsv.s * clientWidth;
2362
- var top = (1 - props.colorObj.hsv.v) * clientHeight;
2363
- var step = 10;
2364
-
2365
- switch (e.code) {
2366
- case 'ArrowLeft':
2367
- e.preventDefault();
2368
- left = clamp(left - step, 0, clientWidth);
2369
- break;
2370
-
2371
- case 'ArrowRight':
2372
- e.preventDefault();
2373
- left = clamp(left + step, 0, clientWidth);
2374
- break;
2375
-
2376
- case 'ArrowUp':
2377
- e.preventDefault();
2378
- top = clamp(top - step, 0, clientHeight);
2379
- break;
2380
-
2381
- case 'ArrowDown':
2382
- e.preventDefault();
2383
- top = clamp(top + step, 0, clientHeight);
2384
- break;
2385
-
2386
- default:
2387
- return;
2388
- }
2389
-
2390
- handlePointChange(null, left, top);
2391
- };
2392
- /**
2393
- * 饱和度面板变化
2394
- * @param {MouseEvent|null} e - 鼠标滑动事件
2395
- * @param {Number} [appointedLeft] - 键盘事件对应坐标,如果有就优先使用
2396
- * @param {Number} [appointedTop] - 键盘事件对应坐标,如果有就优先使用
2397
- */
2398
-
2399
-
2400
- var handlePointChange = function handlePointChange(e, appointedLeft, appointedTop) {
2401
- var _containerRef$value2 = containerRef.value,
2402
- clientWidth = _containerRef$value2.clientWidth,
2403
- clientHeight = _containerRef$value2.clientHeight;
2404
- var left = appointedLeft !== undefined ? appointedLeft : getLeft(e);
2405
- var top = appointedTop !== undefined ? appointedTop : getTop(e);
2406
- var saturation = left / clientWidth;
2407
- var bright = 1 - top / clientHeight;
2408
- changeColor(props.colorObj.hsv.h, saturation, bright, props.colorObj.hsv.a);
2409
- };
2410
-
2411
- var getLeft = function getLeft(e) {
2412
- var xOffset = containerRef.value.getBoundingClientRect().left + window.pageXOffset;
2413
- var pageX = e.pageX || getTouches(e, 'PageX');
2414
- return clamp(pageX - xOffset, 0, containerRef.value.clientWidth);
2415
- };
2416
-
2417
- var getTop = function getTop(e) {
2418
- var yOffset = containerRef.value.getBoundingClientRect().top + window.pageYOffset;
2419
- var pageY = e.pageY || getTouches(e, 'PageY');
2420
- return clamp(pageY - yOffset, 0, containerRef.value.clientHeight);
2421
- };
2422
-
2423
- var changeColor = function changeColor(h, s, v, a) {
2424
- emit('change', {
2425
- h: h,
2426
- s: s,
2427
- v: v,
2428
- a: a
2429
- });
2430
- };
2431
-
2432
- return function () {
2433
- return (0,external_vue_.createVNode)("div", {
2434
- "ref": containerRef,
2435
- "tabindex": "0",
2436
- "class": "bk-color-picker-saturation",
2437
- "style": backgroundStyle.value,
2438
- "onKeydown": handleArrowKeydown,
2439
- "onMousedown": function onMousedown(e) {
2440
- e.stopPropagation();
2441
- handleMouseDown(e);
2442
- }
2443
- }, [(0,external_vue_.createVNode)("div", {
2444
- "class": "bk-color-picker-saturation-white"
2445
- }, null), (0,external_vue_.createVNode)("div", {
2446
- "class": "bk-color-picker-saturation-black"
2447
- }, null), (0,external_vue_.createVNode)("div", {
2448
- "class": "bk-color-picker-pointer",
2449
- "style": pointerStyle.value
2450
- }, [(0,external_vue_.createVNode)("div", {
2451
- "class": "bk-color-picker-circle"
2452
- }, null)])]);
2453
- };
2454
- }
2455
- }));
2456
- ;// CONCATENATED MODULE: ../../packages/color-picker/src/color-picker.tsx
2457
-
2458
-
2459
-
2460
- /*
2461
- * Tencent is pleased to support the open source community by making
2462
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2463
- *
2464
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2465
- *
2466
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2467
- *
2468
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2469
- *
2470
- * ---------------------------------------------------
2471
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2472
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2473
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2474
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2475
- *
2476
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2477
- * the Software.
2478
- *
2479
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2480
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2481
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2482
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2483
- * IN THE SOFTWARE.
2484
- */
2485
-
2486
-
2487
-
2488
-
2489
-
2490
-
2491
-
2492
-
2493
-
2494
-
2495
-
2496
-
2497
- var ColorPickSizeEnum;
2498
-
2499
- (function (ColorPickSizeEnum) {
2500
- ColorPickSizeEnum["UNKNOWN"] = "";
2501
- ColorPickSizeEnum["SMALL"] = "small";
2502
- ColorPickSizeEnum["LARGE"] = "large";
2503
- })(ColorPickSizeEnum || (ColorPickSizeEnum = {}));
2504
-
2505
- var color_picker_colorPickerProps = {
2506
- modelValue: external_shared_.PropTypes.string.def(''),
2507
- disabled: external_shared_.PropTypes.bool.def(false),
2508
- readonly: external_shared_.PropTypes.bool.def(false),
2509
- transfer: external_shared_.PropTypes.bool.def(false),
2510
- size: (0,external_vue_types_.toType)('colorPickSize', {}).def(ColorPickSizeEnum.UNKNOWN),
2511
- showValue: external_shared_.PropTypes.bool.def(true),
2512
- // true 展示组件内置预设值
2513
- // false 不展示预设值
2514
- // 数组 自定义预设值
2515
- recommend: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.array.def(function () {
2516
- return [];
2517
- }), external_shared_.PropTypes.bool.def(true)]).def(true),
2518
- extCls: external_shared_.PropTypes.string.def(''),
2519
- withValidate: external_shared_.PropTypes.bool.def(true)
2520
- };
2521
- var whiteColorObj = formatColor('#FFFFFF');
2522
- /* harmony default export */ const color_picker = ((0,external_vue_.defineComponent)({
2523
- name: 'ColorPicker',
2524
- directives: {
2525
- clickoutside: external_directives_.clickoutside
2526
- },
2527
- props: color_picker_colorPickerProps,
2528
- emits: ['update:modelValue', 'change'],
2529
- setup: function setup(props, _ref) {
2530
- var emit = _ref.emit;
2531
- var formItem = (0,external_shared_.useFormItem)();
2532
- var showDropdown = (0,external_vue_.ref)(false); // 当前颜色的色值,如果为空字符串显示:默认白色背景 + 中间一个叉
2533
-
2534
- var colorStr = (0,external_vue_.ref)(''); // 储存当前颜色的相关信息
2535
-
2536
- var colorObj = (0,external_vue_.reactive)(JSON.parse(JSON.stringify(whiteColorObj)));
2537
- var dropRef = (0,external_vue_.ref)(null);
2538
- var saturationPanelRef = (0,external_vue_.ref)(null);
2539
- var referenceRef = (0,external_vue_.ref)(null);
2540
- var colorPickerCls = (0,external_vue_.computed)(function () {
2541
- var _classes;
2542
-
2543
- return (0,external_shared_.classes)((_classes = {}, _defineProperty(_classes, "bk-color-picker-".concat(props.size), props.size), _defineProperty(_classes, 'bk-color-picker-show-dropdown', showDropdown.value), _defineProperty(_classes, 'bk-color-picker-show-value', props.showValue), _defineProperty(_classes, 'bk-color-picker-disabled', props.disabled || props.readonly), _classes), "bk-color-picker ".concat(props.extCls));
2544
- }); // 是否渲染预设值
2545
-
2546
- var isRenderRecommend = (0,external_vue_.computed)(function () {
2547
- return Boolean(props.recommend === true || Array.isArray(props.recommend) && props.recommend.length);
2548
- });
2549
- (0,external_vue_.onBeforeMount)(function () {
2550
- // 1. 组件初始化时,如果计算的色值和传入的值不一样,显示计算的色值
2551
- changeColorFromProps({
2552
- isCreated: true
2553
- });
2554
- });
2555
- (0,external_vue_.watch)(function () {
2556
- return props.modelValue;
2557
- }, function () {
2558
- var _a; // 2. 如果组件绑定值被外部修改,自动根据绑定至更新组件色值
2559
-
2560
-
2561
- changeColorFromProps();
2562
-
2563
- if (props.withValidate) {
2564
- (_a = formItem === null || formItem === void 0 ? void 0 : formItem.validate) === null || _a === void 0 ? void 0 : _a.call(formItem, 'change');
2565
- }
2566
- });
2567
-
2568
- var handleTriggerKeydown = function handleTriggerKeydown(e) {
2569
- if (e.code === 'Enter' || e.code === 'NumpadEnter') {
2570
- toggleDropdown();
2571
- } else if (e.code === 'Escape') {
2572
- closeDropdown();
2573
- }
2574
- };
2575
-
2576
- var handleDropdownKeydown = function handleDropdownKeydown(e) {
2577
- if (props.transfer) {
2578
- handleTriggerKeydown(e);
2579
- }
2580
- };
2581
-
2582
- var toggleDropdown = function toggleDropdown() {
2583
- if (props.disabled || props.readonly) {
2584
- return;
2585
- }
2586
-
2587
- showDropdown.value ? closeDropdown() : openDropdown();
2588
- }; // 如果未开启预设则此 tab 事件为颜色选择器最后一个表单 tab 事件,重新聚焦于饱和度面板
2589
-
2590
-
2591
- var handleTabInput = function handleTabInput(e) {
2592
- if (!isRenderRecommend.value) {
2593
- e.preventDefault();
2594
- saturationPanelRef.value.$el.focus();
2595
- }
2596
- }; // 颜色选择器最后一个表单 tab 事件,重新聚焦于饱和度面板
2597
-
2598
-
2599
- var handleTabRecommend = function handleTabRecommend(e) {
2600
- e.preventDefault();
2601
- saturationPanelRef.value.$el.focus();
2602
- };
2603
-
2604
- var openDropdown = function openDropdown() {
2605
- var _a;
2606
-
2607
- showDropdown.value = true;
2608
- (_a = dropRef.value) === null || _a === void 0 ? void 0 : _a.updateDropdown(); // 展开后默认聚焦于 HEX 输入框,setTimeout 等 transfer 出现
2609
-
2610
- setTimeout(function () {
2611
- var hexInput = dropRef.value.$el.querySelector('.bk-color-picker-input-hex .bk-color-picker-input-value');
2612
- hexInput.select();
2613
- }, 100);
2614
- };
2615
-
2616
- var closeDropdown = function closeDropdown() {
2617
- var _a;
2618
-
2619
- if (showDropdown.value) {
2620
- (0,external_vue_.nextTick)(function () {
2621
- return referenceRef.value.focus();
2622
- });
2623
- showDropdown.value = false;
2624
- (_a = dropRef.value) === null || _a === void 0 ? void 0 : _a.destoryDropdown(); // 3. 关闭组件时如果绑定值与组件内部选择的值不一致(比如既没有使用 v-model 也没有监听 change 事件)显示绑定值
2625
-
2626
- changeColorFromProps();
2627
- }
2628
- };
2629
- /**
2630
- * created 时、props.value 变化时、每次关闭组件时调用
2631
- * @param {Object} option
2632
- * @param {Boolean} [option.isCreated = false] - 是否是实例创建完成后的第一次调用
2633
- */
2634
-
2635
-
2636
- var changeColorFromProps = function changeColorFromProps() {
2637
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
2638
- _ref2$isCreated = _ref2.isCreated,
2639
- isCreated = _ref2$isCreated === void 0 ? false : _ref2$isCreated;
2640
-
2641
- // 空字符串为默认值且合法
2642
- if (props.modelValue === '') {
2643
- // 颜色选择器有色值,用户手动修改为空字符串;或用户关闭组件时绑定的value为空字符串(没有使用组件传递的值)
2644
- if (colorStr.value !== '') {
2645
- colorStr.value = '';
2646
- Object.assign(colorObj, whiteColorObj);
2647
- emit('update:modelValue', colorStr.value);
2648
- }
2649
-
2650
- return;
2651
- } // 根据 props 计算色值
2652
-
2653
-
2654
- var propsColorObj = formatColor(props.modelValue);
2655
- var propsColorStr = propsColorObj.rgba.a === 1 ? propsColorObj.hex : toRGBAString(propsColorObj.rgba); // 根据 props 计算的色值和组件内部色值不一致,有几种情况
2656
-
2657
- if (propsColorStr !== colorStr.value) {
2658
- // 传入的值是否是合法的色值
2659
- var isValid = tinycolor_default()(props.modelValue).isValid(); // 实例挂载之前
2660
-
2661
- if (isCreated) {
2662
- // 传入了非法的色值,按空字符串处理并触发 change 事件
2663
- if (!isValid) {
2664
- Object.assign(colorObj, whiteColorObj);
2665
- emit('change', '');
2666
- } else {
2667
- // 到了这里,说明传入的色值已经计算出来了,是合法的,但可能存在格式上的偏差,如用户传入 #fff 计算得 #FFFFFF
2668
- colorStr.value = propsColorStr.toLowerCase() === props.modelValue.toLowerCase() ? props.modelValue // 如果只是大小写不一致,显示用户传入的字符
2669
- : propsColorStr; // 其它格式上的不一致,以本组件计算值为准
2670
-
2671
- Object.assign(colorObj, propsColorObj);
2672
- }
2673
- } else {
2674
- // 实例挂载之后
2675
- // 用户在实例挂载之后在组件外面修改色值 组件内部只是跟着 props 变化色值 并不触发 change 事件
2676
- if (!isValid) {
2677
- colorStr.value = '';
2678
- Object.assign(colorObj, whiteColorObj);
2679
- } else if (propsColorStr.toLowerCase() !== colorStr.value.toLowerCase()) {
2680
- // 如果只是外部传入的值和当前组件显示的的值大小写不一致,不作处理
2681
- // 比如 this.value === '#ffffff',计算值为 '#FFFFFF',不进行下面的处理直接显示 '#ffffff'
2682
- // 反之显示内部计算值:
2683
- Object.assign(colorObj, propsColorObj);
2684
- colorStr.value = propsColorStr;
2685
- }
2686
- }
2687
- }
2688
- };
2689
- /**
2690
- * 组件内部选择颜色处理
2691
- * @param {String|Object} val - hex,rgba,hsla,hsva
2692
- */
2693
-
2694
-
2695
- var handleColorChange = function handleColorChange(val) {
2696
- // 组件内拿到的色值都是合法的,空字符串特殊处理
2697
- if (val === '') {
2698
- colorStr.value = '';
2699
- Object.assign(colorObj, whiteColorObj);
2700
- emit('update:modelValue', '');
2701
- emit('change', '');
2702
- return;
2703
- }
2704
-
2705
- var handleColorObj = formatColor(val);
2706
- var handleColorStr = handleColorObj.rgba.a === 1 ? handleColorObj.hex : toRGBAString(handleColorObj.rgba);
2707
- colorStr.value = handleColorStr;
2708
- Object.assign(colorObj, handleColorObj);
2709
- emit('update:modelValue', colorStr.value);
2710
- emit('change', handleColorStr);
2711
- };
2712
-
2713
- var hideDropDown = function hideDropDown() {
2714
- showDropdown.value = false;
2715
- };
2716
-
2717
- return function () {
2718
- return (0,external_vue_.withDirectives)((0,external_vue_.createVNode)("div", {
2719
- "ref": referenceRef,
2720
- "tabindex": "0",
2721
- "class": colorPickerCls.value,
2722
- "onKeydown": handleTriggerKeydown,
2723
- "onClick": toggleDropdown
2724
- }, [(0,external_vue_.createVNode)("div", {
2725
- "class": "bk-color-picker-color"
2726
- }, [(0,external_vue_.createVNode)("span", {
2727
- "class": "bk-color-picker-color-square ".concat(!colorStr.value && 'bk-color-picker-empty'),
2728
- "style": "background: ".concat(colorStr.value || '#FFF')
2729
- }, null)]), props.showValue ? (0,external_vue_.createVNode)("div", {
2730
- "class": "bk-color-picker-text"
2731
- }, [(0,external_vue_.createVNode)("span", null, [colorStr.value])]) : undefined, (0,external_vue_.createVNode)("div", {
2732
- "class": "bk-color-picker-icon"
2733
- }, [(0,external_vue_.createVNode)(external_icon_.AngleUp, {
2734
- "class": "icon-angle-down"
2735
- }, null)]), (0,external_vue_.createVNode)(external_vue_.Transition, {
2736
- "name": "bk-fade-down-transition"
2737
- }, {
2738
- "default": function _default() {
2739
- return [(0,external_vue_.withDirectives)((0,external_vue_.createVNode)(picker_dropdown, {
2740
- "ref": dropRef,
2741
- "triggerRef": referenceRef.value
2742
- }, {
2743
- "default": function _default() {
2744
- return [(0,external_vue_.createVNode)("div", {
2745
- "class": "bk-color-dropdown-container"
2746
- }, [(0,external_vue_.createVNode)("div", {
2747
- "class": "bk-color-picker-dropdown",
2748
- "onClick": function onClick(e) {
2749
- e.stopPropagation();
2750
- },
2751
- "onMousedown": function onMousedown(e) {
2752
- e.stopPropagation();
2753
- },
2754
- "onKeydown": handleDropdownKeydown
2755
- }, [(0,external_vue_.createVNode)(saturation_panel, {
2756
- "ref": saturationPanelRef,
2757
- "colorObj": colorObj,
2758
- "onChange": handleColorChange
2759
- }, null), (0,external_vue_.createVNode)(hue_slider, {
2760
- "colorObj": colorObj,
2761
- "onChange": handleColorChange
2762
- }, null), (0,external_vue_.createVNode)(color_input, {
2763
- "colorObj": colorObj,
2764
- "onTab": handleTabInput,
2765
- "onChange": handleColorChange
2766
- }, null), isRenderRecommend.value ? (0,external_vue_.createVNode)("div", {
2767
- "class": "bk-color-picker-recommend-container"
2768
- }, [(0,external_vue_.createVNode)(recommend_colors, {
2769
- "colorObj": colorObj,
2770
- "recommend": props.recommend,
2771
- "onTab": handleTabRecommend,
2772
- "onChange": handleColorChange
2773
- }, null)]) : undefined])])];
2774
- }
2775
- }), [[external_vue_.vShow, showDropdown.value]])];
2776
- }
2777
- })]), [[(0,external_vue_.resolveDirective)("clickoutside"), hideDropDown]]);
2778
- };
2779
- }
2780
- }));
2781
- ;// CONCATENATED MODULE: ../../packages/color-picker/src/index.ts
2782
- /*
2783
- * Tencent is pleased to support the open source community by making
2784
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2785
- *
2786
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2787
- *
2788
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2789
- *
2790
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2791
- *
2792
- * ---------------------------------------------------
2793
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2794
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2795
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2796
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2797
- *
2798
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2799
- * the Software.
2800
- *
2801
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2802
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2803
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2804
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2805
- * IN THE SOFTWARE.
2806
- */
2807
-
2808
-
2809
- var BkColorPicker = (0,external_shared_.withInstall)(color_picker);
2810
- /* harmony default export */ const src = (BkColorPicker);
2811
- })();
2812
-
2813
- /******/ return __webpack_exports__;
2814
- /******/ })()
2815
- ;
2816
- });
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("vue-types"),require("../directives"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","vue-types","../directives","../icon"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("vue-types"),require("../directives"),require("../icon")):t(e["../shared"],e.vue,e["vue-types"],e["../directives"],e["../icon"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o)=>(()=>{var a={8621:(e,t,r)=>{var n;!function(o){var a=/^\s+/,i=/\s+$/,c=0,l=o.round,s=o.min,u=o.max,f=o.random;function d(e,t){if(t=t||{},(e=e||"")instanceof d)return e;if(!(this instanceof d))return new d(e,t);var r=function(e){var t,r,n,c={r:0,g:0,b:0},l=1,f=null,d=null,h=null,p=!1,v=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(i,"").toLowerCase();var t,r=!1;if(C[e])e=C[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=U.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=U.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=U.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=U.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=U.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=U.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=U.hex8.exec(e))?{r:H(t[1]),g:H(t[2]),b:H(t[3]),a:E(t[4]),format:r?"name":"hex8"}:(t=U.hex6.exec(e))?{r:H(t[1]),g:H(t[2]),b:H(t[3]),format:r?"name":"hex"}:(t=U.hex4.exec(e))?{r:H(t[1]+""+t[1]),g:H(t[2]+""+t[2]),b:H(t[3]+""+t[3]),a:E(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=U.hex3.exec(e))&&{r:H(t[1]+""+t[1]),g:H(t[2]+""+t[2]),b:H(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==typeof e&&(z(e.r)&&z(e.g)&&z(e.b)?(t=e.r,r=e.g,n=e.b,c={r:255*F(t,255),g:255*F(r,255),b:255*F(n,255)},p=!0,v="%"===String(e.r).substr(-1)?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(f=D(e.s),d=D(e.v),c=function(e,t,r){e=6*F(e,360),t=F(t,100),r=F(r,100);var n=o.floor(e),a=e-n,i=r*(1-t),c=r*(1-a*t),l=r*(1-(1-a)*t),s=n%6;return{r:255*[r,c,i,i,l,r][s],g:255*[l,r,r,c,i,i][s],b:255*[i,i,l,r,r,c][s]}}(e.h,f,d),p=!0,v="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(f=D(e.s),h=D(e.l),c=function(e,t,r){var n,o,a;function i(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=F(e,360),t=F(t,100),r=F(r,100),0===t)n=o=a=r;else{var c=r<.5?r*(1+t):r+t-r*t,l=2*r-c;n=i(l,c,e+1/3),o=i(l,c,e),a=i(l,c,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(e.h,f,h),p=!0,v="hsl"),e.hasOwnProperty("a")&&(l=e.a)),l=P(l),{ok:p,format:e.format||v,r:s(255,u(c.r,0)),g:s(255,u(c.g,0)),b:s(255,u(c.b,0)),a:l}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=c++}function h(e,t,r){e=F(e,255),t=F(t,255),r=F(r,255);var n,o,a=u(e,t,r),i=s(e,t,r),c=(a+i)/2;if(a==i)n=o=0;else{var l=a-i;switch(o=c>.5?l/(2-a-i):l/(a+i),a){case e:n=(t-r)/l+(t<r?6:0);break;case t:n=(r-e)/l+2;break;case r:n=(e-t)/l+4}n/=6}return{h:n,s:o,l:c}}function p(e,t,r){e=F(e,255),t=F(t,255),r=F(r,255);var n,o,a=u(e,t,r),i=s(e,t,r),c=a,l=a-i;if(o=0===a?0:l/a,a==i)n=0;else{switch(a){case e:n=(t-r)/l+(t<r?6:0);break;case t:n=(r-e)/l+2;break;case r:n=(e-t)/l+4}n/=6}return{h:n,s:o,v:c}}function v(e,t,r,n){var o=[q(l(e).toString(16)),q(l(t).toString(16)),q(l(r).toString(16))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function b(e,t,r,n){return[q(L(n)),q(l(e).toString(16)),q(l(t).toString(16)),q(l(r).toString(16))].join("")}function g(e,t){t=0===t?0:t||10;var r=d(e).toHsl();return r.s-=t/100,r.s=T(r.s),d(r)}function m(e,t){t=0===t?0:t||10;var r=d(e).toHsl();return r.s+=t/100,r.s=T(r.s),d(r)}function k(e){return d(e).desaturate(100)}function y(e,t){t=0===t?0:t||10;var r=d(e).toHsl();return r.l+=t/100,r.l=T(r.l),d(r)}function w(e,t){t=0===t?0:t||10;var r=d(e).toRgb();return r.r=u(0,s(255,r.r-l(-t/100*255))),r.g=u(0,s(255,r.g-l(-t/100*255))),r.b=u(0,s(255,r.b-l(-t/100*255))),d(r)}function _(e,t){t=0===t?0:t||10;var r=d(e).toHsl();return r.l-=t/100,r.l=T(r.l),d(r)}function x(e,t){var r=d(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,d(r)}function A(e){var t=d(e).toHsl();return t.h=(t.h+180)%360,d(t)}function S(e){var t=d(e).toHsl(),r=t.h;return[d(e),d({h:(r+120)%360,s:t.s,l:t.l}),d({h:(r+240)%360,s:t.s,l:t.l})]}function N(e){var t=d(e).toHsl(),r=t.h;return[d(e),d({h:(r+90)%360,s:t.s,l:t.l}),d({h:(r+180)%360,s:t.s,l:t.l}),d({h:(r+270)%360,s:t.s,l:t.l})]}function V(e){var t=d(e).toHsl(),r=t.h;return[d(e),d({h:(r+72)%360,s:t.s,l:t.l}),d({h:(r+216)%360,s:t.s,l:t.l})]}function O(e,t,r){t=t||6,r=r||30;var n=d(e).toHsl(),o=360/r,a=[d(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(d(n));return a}function j(e,t){t=t||6;for(var r=d(e).toHsv(),n=r.h,o=r.s,a=r.v,i=[],c=1/t;t--;)i.push(d({h:n,s:o,v:a})),a=(a+c)%1;return i}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:o.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=P(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return v(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,o){var a=[q(l(e).toString(16)),q(l(t).toString(16)),q(l(r).toString(16)),q(L(n))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*F(this._r,255))+"%",g:l(100*F(this._g,255))+"%",b:l(100*F(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*F(this._r,255))+"%, "+l(100*F(this._g,255))+"%, "+l(100*F(this._b,255))+"%)":"rgba("+l(100*F(this._r,255))+"%, "+l(100*F(this._g,255))+"%, "+l(100*F(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+b(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=d(e);r="#"+b(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(k,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(O,arguments)},complement:function(){return this._applyCombination(A,arguments)},monochromatic:function(){return this._applyCombination(j,arguments)},splitcomplement:function(){return this._applyCombination(V,arguments)},triad:function(){return this._applyCombination(S,arguments)},tetrad:function(){return this._applyCombination(N,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:D(e[n]));e=r}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:f(),g:f(),b:f()})},d.mix=function(e,t,r){r=0===r?0:r||50;var n=d(e).toRgb(),o=d(t).toRgb(),a=r/100;return d({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},d.readability=function(e,t){var r=d(e),n=d(t);return(o.max(r.getLuminance(),n.getLuminance())+.05)/(o.min(r.getLuminance(),n.getLuminance())+.05)},d.isReadable=function(e,t,r){var n,o,a,i,c,l=d.readability(e,t);switch(o=!1,(a=r,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(c=(a.size||"small").toLowerCase())&&"large"!==c&&(c="small"),n={level:i,size:c}).level+n.size){case"AAsmall":case"AAAlarge":o=l>=4.5;break;case"AAlarge":o=l>=3;break;case"AAAsmall":o=l>=7}return o},d.mostReadable=function(e,t,r){var n,o,a,i,c=null,l=0;o=(r=r||{}).includeFallbackColors,a=r.level,i=r.size;for(var s=0;s<t.length;s++)(n=d.readability(e,t[s]))>l&&(l=n,c=d(t[s]));return d.isReadable(e,c,{level:a,size:i})||!o?c:(r.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],r))};var C=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},R=d.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(C);function P(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function F(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=s(t,u(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function T(e){return s(1,u(0,e))}function H(e){return parseInt(e,16)}function q(e){return 1==e.length?"0"+e:""+e}function D(e){return e<=1&&(e=100*e+"%"),e}function L(e){return o.round(255*parseFloat(e)).toString(16)}function E(e){return H(e)/255}var M,I,B,U=(I="[\\s|\\(]+("+(M="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",B="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",{CSS_UNIT:new RegExp(M),rgb:new RegExp("rgb"+I),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+I),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+I),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function z(e){return!!U.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(n=function(){return d}.call(t,r,t,e))||(e.exports=n)}(Math)},4061:e=>{"use strict";e.exports=n},6870:e=>{"use strict";e.exports=o},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t},210:e=>{"use strict";e.exports=r}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return a[e](r,r.exports,c),r.exports}c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{"use strict";c.r(l),c.d(l,{default:()=>C});var e=c(4212);function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var r=c(748),n=c(8621),o=c.n(n),a=c(210),i=c(4061),s=c(6870),u={placement:{type:String,default:"bottom-start",validator:function(e){return!(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)<0&&(console.error("placement property is not valid: '".concat(e,"'")),1))}},className:{type:String},extPopoverCls:{type:String},appendToBody:{type:Boolean},triggerRef:{type:Object},onClick:Function};const f=(0,r.defineComponent)({props:u,emits:["changeVisible"],setup:function(t,n){var o=n.emit,a=Object.create(null),i=(0,r.ref)(null);(0,r.onMounted)((function(){l()})),(0,r.onBeforeUnmount)((function(){c()}));var c=function(){if(a&&0!==Object.keys(a).length){var e=a;e.isShow&&e.hide(),e.destroy(),a=null,o("changeVisible",!1)}},l=function(){a&&0!==Object.keys(a).length?(0,r.nextTick)((function(){a.update()})):(0,r.nextTick)((function(){a=new e.BKPopover(t.triggerRef,i.value,{placement:t.placement,trigger:"manual",modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},{name:"offset",options:{offset:[0,4]}}]})}))},s=(0,r.computed)((function(){var r={};return t.appendToBody&&(r["z-index"]=1060+e.bkZIndexManager.getModalNextIndex()),r})),u=(0,r.reactive)({styles:s});return Object.assign(Object.assign({},(0,r.toRefs)(u)),{refContentRef:i,forceUpdate:function(){var e;a&&(null===(e=null==a?void 0:a.forceUpdate)||void 0===e||e.call(a))},updateDropdown:l,destoryDropdown:c})},render:function(){var t,n,o;return(0,r.createVNode)("div",{ref:"refContentRef",class:[(0,e.resolveClassName)("date-picker-dropdown"),this.className,this.extPopoverCls],style:this.styles,onClick:this.onClick},[null!==(o=null===(n=(t=this.$slots).default)||void 0===n?void 0:n.call(t))&&void 0!==o?o:""])}});var d={info:e.PropTypes.object.isRequired};const h=(0,r.defineComponent)({props:d,emits:["tab","input"],setup:function(t,n){var o=n.emit,a=function(e){"a"===t.info.key&&o("tab",e)},i=function(e){var r=t.info.key,n=e.target.value;o("input",r,n)},c=(0,r.computed)((function(){return(0,e.classes)({error:t.info.error},"bk-color-picker-input-value")}));return function(){return(0,r.createVNode)("div",{class:"bk-color-picker-input-part"},[(0,r.createVNode)("input",{type:"HEX"===t.info.name?"text":"number",class:c.value,value:t.info.value,onKeydown:a,onInput:i},null),(0,r.createVNode)("span",{class:"bk-color-picker-input-text"},[t.info.name])])}}});var p={colorObj:e.PropTypes.object.isRequired};const v=(0,r.defineComponent)({name:"ColorPicker",props:p,emits:["change","tab"],setup:function(e,t){var n=t.emit,a=(0,r.reactive)({key:"hex",name:"HEX",value:e.colorObj.hex,error:!1}),i=(0,r.reactive)({key:"r",name:"R",value:e.colorObj.rgba.r.toString(),error:!1}),c=(0,r.reactive)({key:"g",name:"G",value:e.colorObj.rgba.g.toString(),error:!1}),l=(0,r.reactive)({key:"b",name:"B",value:e.colorObj.rgba.b.toString(),error:!1}),s=(0,r.reactive)({key:"a",name:"Alpha",value:e.colorObj.rgba.a.toString(),error:!1});(0,r.watch)((function(){return e.colorObj}),(function(e){o()(e.hex).toString()!==o()(a.value).toString()&&(a.value=e.hex),i.value=e.rgba.r.toString(),c.value=e.rgba.g.toString(),l.value=e.rgba.b.toString(),s.value=e.rgba.a.toString(),d()}),{deep:!0});var u=function(e){n("tab",e)},f=function(e,t){if({r:i,g:c,b:l,a:s,hex:a}[e].value=t,d()){var r="hex"===e?a.value:"rgba(".concat(i.value,", ").concat(c.value,", ").concat(l.value,", ").concat(s.value,")");n("change",r)}},d=function(){var e=!0;!a.value.startsWith("#")||4!==a.value.length&&7!==a.value.length||a.value.slice(1).match(/[^0-9a-fA-F]/)?(a.error=!0,e=!1):a.error=!1,""!==s.value&&s.value>=0&&s.value<=1?s.error=!1:(s.error=!0,e=!1);for(var t=0,r=[i,c,l];t<r.length;t++){var n=r[t],o=n.value;""!==o&&o>=0&&o<=255?n.error=!1:(n.error=!0,e=!1)}return e};return function(){return(0,r.createVNode)("div",{class:"bk-color-picker-input"},[(0,r.createVNode)("div",{class:"bk-color-picker-input-hex"},[(0,r.createVNode)(h,{info:a,onInput:f},null)]),(0,r.createVNode)("div",{class:"bk-color-picker-input-rgba"},[(0,r.createVNode)(h,{info:i,onInput:f},null),(0,r.createVNode)(h,{info:c,onInput:f},null),(0,r.createVNode)(h,{info:l,onInput:f},null),(0,r.createVNode)(h,{info:s,onInput:f,onTab:u},null)])])}}});var b=function(e){var t=e;""===e&&(t="#FFFFFF");var r=o()(e),n=r.toHsl(),a=r.toHsv();return 0===n.s&&(n.h=t.h||0,a.h=t.h||0),a.v<.0164&&(a.h=t.h||0,a.s=t.s||0),n.l<.01&&(n.h=t.h||0,n.s=t.s||0),{hsl:n,hsv:a,hex:r.toHexString().toUpperCase(),rgba:r.toRgb()}},g=function(e,t,r){return e<t?t:e>r?r:e},m=function(e,t){return e.touches?e.touches[0][t]:0},k=function(e){var t=e.r,r=e.g,n=e.b,o=e.a;return"rgba(".concat([t,r,n,o].join(","),")")},y={colorObj:e.PropTypes.object.isRequired};const w=(0,r.defineComponent)({name:"ColorPicker",props:y,emits:["change"],setup:function(e,t){var n=t.emit,o=(0,r.ref)(null),a=(0,r.computed)((function(){return{left:"".concat(e.colorObj.hsv.h/360*100,"%")}})),i=function(t){var r=o.value.clientWidth,n=e.colorObj.hsv.h/360*r;switch(t.code){case"ArrowLeft":t.preventDefault(),n=g(n-2,0,r);break;case"ArrowRight":t.preventDefault(),n=g(n+2,0,r);break;case"ArrowUp":t.preventDefault(),n=g(n-10,0,r);break;case"ArrowDown":t.preventDefault(),n=g(n+10,0,r);break;default:return}l(null,n)},c=function e(){window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",e)},l=function(e,t){var r=o.value.clientWidth,n=void 0!==t?t:s(e);u(n/r)},s=function(e){var t=o.value.getBoundingClientRect().left+window.pageXOffset,r=e.pageX||m(e,"PageX");return g(r-t,0,o.value.clientWidth)},u=function(t){var r=e.colorObj.hsl,o=r.h,a=r.s,i=r.l,c=r.a,l=360*t;o!==l&&n("change",{h:l,s:a,l:i,a:c})};return function(){return(0,r.createVNode)("div",{ref:o,tabindex:"0",class:"bk-color-picker-hue",onKeydown:i,onMousedown:function(e){e.stopPropagation(),e.preventDefault(),function(e){o.value.focus(),l(e),window.addEventListener("mousemove",l,{passive:!0}),window.addEventListener("mouseup",c)}(e)}},[(0,r.createVNode)("div",{class:"bk-color-picker-hue-pointer",style:a.value},[(0,r.createVNode)("div",{class:"bk-color-picker-hue-rectangle"},null)])])}}});var _={colorObj:e.PropTypes.object.isRequired,recommend:e.PropTypes.oneOfType([e.PropTypes.array.def((function(){return[]})),e.PropTypes.bool.def(!0)]).isRequired};const x=(0,r.defineComponent)({props:_,emits:["change","tab"],setup:function(t,n){var a=n.emit,i=(0,r.ref)(!1),c=(0,r.ref)(-1),l=(0,r.ref)(null);(0,r.watch)((function(){return t.colorObj}),(function(){c.value=-1,l.value=null}),{deep:!0});var s=(0,r.computed)((function(){return h(t.recommend)})),u=function(t,r){return(0,e.classes)({"bk-color-picker-empty":""===t,"bk-color-picker-recommend-selected-color":i.value&&c.value===r},"bk-color-picker-recommend-color")},f=function(e){if("Tab"===e.code)a("tab",e);else{var t=0,r=s.value.length-1;switch(e.code){case"ArrowLeft":e.preventDefault(),t=g(c.value-1,0,r);break;case"ArrowRight":e.preventDefault(),t=g(c.value+1,0,r);break;case"ArrowUp":e.preventDefault(),t=g(c.value-10,0,r);break;case"ArrowDown":e.preventDefault(),t=g(c.value+10,0,r);break;default:return}d(t)}},d=function(e){var t=s.value[e];a("change",t),(0,r.nextTick)((function(){c.value=e,l.value=t}))},h=function(e){return!0===e?["","#ff4500","#ff8c00","#ffd700","#90ee90","#ddffff","#00ced1","#3a84ff","#a933f5","#db7093","#000000","#494949","#9B9B9B","#ffffff"]:Array.isArray(e)?e.map((function(e){return o()(e).isValid()?e:""})):void 0};return function(){return(0,r.createVNode)("div",{tabindex:"0",class:"bk-color-picker-recommend",onFocus:function(){return i.value=!0},onBlur:function(){return i.value=!1},onKeydown:f},[s.value.map((function(e,t){return(0,r.createVNode)("div",{style:"background: ".concat(e||"#fff"),class:u(e,t),onClick:function(){return d(t)}},[c.value===t?(0,r.createVNode)("div",{class:"bk-color-picker-pointer"},[(0,r.createVNode)("div",{class:"bk-color-picker-circle"},null)]):void 0])}))])}}});var A={colorObj:e.PropTypes.object.isRequired};const S=(0,r.defineComponent)({props:A,emits:["change"],setup:function(e,t){var n=t.emit,o=(0,r.ref)(null),a=(0,r.computed)((function(){return{background:"hsl(".concat(e.colorObj.hsv.h,", 100%, 50%)")}})),i=(0,r.computed)((function(){return{top:"".concat(100*(1-e.colorObj.hsv.v),"%"),left:"".concat(100*e.colorObj.hsv.s,"%")}})),c=function e(){window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",e)},l=function(t){var r=o.value,n=r.clientWidth,a=r.clientHeight,i=e.colorObj.hsv.s*n,c=(1-e.colorObj.hsv.v)*a;switch(t.code){case"ArrowLeft":t.preventDefault(),i=g(i-10,0,n);break;case"ArrowRight":t.preventDefault(),i=g(i+10,0,n);break;case"ArrowUp":t.preventDefault(),c=g(c-10,0,a);break;case"ArrowDown":t.preventDefault(),c=g(c+10,0,a);break;default:return}s(null,i,c)},s=function(t,r,n){var a=o.value,i=a.clientWidth,c=a.clientHeight,l=(void 0!==r?r:u(t))/i,s=1-(void 0!==n?n:f(t))/c;d(e.colorObj.hsv.h,l,s,e.colorObj.hsv.a)},u=function(e){var t=o.value.getBoundingClientRect().left+window.pageXOffset,r=e.pageX||m(e,"PageX");return g(r-t,0,o.value.clientWidth)},f=function(e){var t=o.value.getBoundingClientRect().top+window.pageYOffset,r=e.pageY||m(e,"PageY");return g(r-t,0,o.value.clientHeight)},d=function(e,t,r,o){n("change",{h:e,s:t,v:r,a:o})};return function(){return(0,r.createVNode)("div",{ref:o,tabindex:"0",class:"bk-color-picker-saturation",style:a.value,onKeydown:l,onMousedown:function(e){e.stopPropagation(),function(e){o.value.focus(),s(e),window.addEventListener("mousemove",s,{passive:!0}),window.addEventListener("mouseup",c)}(e)}},[(0,r.createVNode)("div",{class:"bk-color-picker-saturation-white"},null),(0,r.createVNode)("div",{class:"bk-color-picker-saturation-black"},null),(0,r.createVNode)("div",{class:"bk-color-picker-pointer",style:i.value},[(0,r.createVNode)("div",{class:"bk-color-picker-circle"},null)])])}}});var N;!function(e){e.UNKNOWN="",e.SMALL="small",e.LARGE="large"}(N||(N={}));var V={modelValue:e.PropTypes.string.def(""),disabled:e.PropTypes.bool.def(!1),readonly:e.PropTypes.bool.def(!1),transfer:e.PropTypes.bool.def(!1),size:(0,a.toType)("colorPickSize",{}).def(N.UNKNOWN),showValue:e.PropTypes.bool.def(!0),recommend:e.PropTypes.oneOfType([e.PropTypes.array.def((function(){return[]})),e.PropTypes.bool.def(!0)]).def(!0),extCls:e.PropTypes.string.def(""),withValidate:e.PropTypes.bool.def(!0)},O=b("#FFFFFF");const j=(0,r.defineComponent)({name:"ColorPicker",directives:{clickoutside:i.clickoutside},props:V,emits:["update:modelValue","change"],setup:function(n,a){var i=a.emit,c=(0,e.useFormItem)(),l=(0,r.ref)(!1),u=(0,r.ref)(""),d=(0,r.reactive)(JSON.parse(JSON.stringify(O))),h=(0,r.ref)(null),p=(0,r.ref)(null),g=(0,r.ref)(null),m=(0,r.computed)((function(){var r;return(0,e.classes)((t(r={},"bk-color-picker-".concat(n.size),n.size),t(r,"bk-color-picker-show-dropdown",l.value),t(r,"bk-color-picker-show-value",n.showValue),t(r,"bk-color-picker-disabled",n.disabled||n.readonly),r),"bk-color-picker ".concat(n.extCls))})),y=(0,r.computed)((function(){return Boolean(!0===n.recommend||Array.isArray(n.recommend)&&n.recommend.length)}));(0,r.onBeforeMount)((function(){P({isCreated:!0})})),(0,r.watch)((function(){return n.modelValue}),(function(){var e;P(),n.withValidate&&(null===(e=null==c?void 0:c.validate)||void 0===e||e.call(c,"change"))}));var _=function(e){"Enter"===e.code||"NumpadEnter"===e.code?N():"Escape"===e.code&&R()},A=function(e){n.transfer&&_(e)},N=function(){n.disabled||n.readonly||(l.value?R():C())},V=function(e){y.value||(e.preventDefault(),p.value.$el.focus())},j=function(e){e.preventDefault(),p.value.$el.focus()},C=function(){var e;l.value=!0,null===(e=h.value)||void 0===e||e.updateDropdown(),setTimeout((function(){h.value.$el.querySelector(".bk-color-picker-input-hex .bk-color-picker-input-value").select()}),100)},R=function(){var e;l.value&&((0,r.nextTick)((function(){return g.value.focus()})),l.value=!1,null===(e=h.value)||void 0===e||e.destoryDropdown(),P())},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isCreated,r=void 0!==t&&t;if(""!==n.modelValue){var a=b(n.modelValue),c=1===a.rgba.a?a.hex:k(a.rgba);if(c!==u.value){var l=o()(n.modelValue).isValid();r?l?(u.value=c.toLowerCase()===n.modelValue.toLowerCase()?n.modelValue:c,Object.assign(d,a)):(Object.assign(d,O),i("change","")):l?c.toLowerCase()!==u.value.toLowerCase()&&(Object.assign(d,a),u.value=c):(u.value="",Object.assign(d,O))}}else""!==u.value&&(u.value="",Object.assign(d,O),i("update:modelValue",u.value))},F=function(e){if(""===e)return u.value="",Object.assign(d,O),i("update:modelValue",""),void i("change","");var t=b(e),r=1===t.rgba.a?t.hex:k(t.rgba);u.value=r,Object.assign(d,t),i("update:modelValue",u.value),i("change",r)},T=function(){l.value=!1};return function(){return(0,r.withDirectives)((0,r.createVNode)("div",{ref:g,tabindex:"0",class:m.value,onKeydown:_,onClick:N},[(0,r.createVNode)("div",{class:"bk-color-picker-color"},[(0,r.createVNode)("span",{class:"bk-color-picker-color-square ".concat(!u.value&&"bk-color-picker-empty"),style:"background: ".concat(u.value||"#FFF")},null)]),n.showValue?(0,r.createVNode)("div",{class:"bk-color-picker-text"},[(0,r.createVNode)("span",null,[u.value])]):void 0,(0,r.createVNode)("div",{class:"bk-color-picker-icon"},[(0,r.createVNode)(s.AngleUp,{class:"icon-angle-down"},null)]),(0,r.createVNode)(r.Transition,{name:"bk-fade-down-transition"},{default:function(){return[(0,r.withDirectives)((0,r.createVNode)(f,{ref:h,triggerRef:g.value},{default:function(){return[(0,r.createVNode)("div",{class:"bk-color-dropdown-container"},[(0,r.createVNode)("div",{class:"bk-color-picker-dropdown",onClick:function(e){e.stopPropagation()},onMousedown:function(e){e.stopPropagation()},onKeydown:A},[(0,r.createVNode)(S,{ref:p,colorObj:d,onChange:F},null),(0,r.createVNode)(w,{colorObj:d,onChange:F},null),(0,r.createVNode)(v,{colorObj:d,onTab:V,onChange:F},null),y.value?(0,r.createVNode)("div",{class:"bk-color-picker-recommend-container"},[(0,r.createVNode)(x,{colorObj:d,recommend:n.recommend,onTab:j,onChange:F},null)]):void 0])])]}}),[[r.vShow,l.value]])]}})]),[[(0,r.resolveDirective)("clickoutside"),T]])}}}),C=(0,e.withInstall)(j)})(),l})()));