@nocobase/plugin-gantt 2.1.0-beta.38 → 2.1.0-beta.41

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 (118) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/client-v2/793.629d4cd39664b681.js +10 -0
  3. package/dist/client-v2/index.js +1 -1
  4. package/dist/client-v2/locale.d.ts +6 -0
  5. package/dist/client-v2/models/GanttBlockModel.d.ts +1 -1
  6. package/dist/client-v2/models/components/GanttBlock.helpers.d.ts +8 -0
  7. package/dist/client-v2/models/components/GanttBlock.styles.d.ts +2 -1
  8. package/dist/client-v2/models/components/GanttBlock.tree.d.ts +9 -6
  9. package/dist/{shared → client-v2/shared}/components/grid/style.d.ts +4 -3
  10. package/dist/{shared → client-v2/shared}/components/other/horizontal-scroll.d.ts +1 -1
  11. package/dist/externalVersion.js +6 -6
  12. package/dist/locale/en-US.json +4 -1
  13. package/dist/locale/zh-CN.json +4 -1
  14. package/package.json +2 -2
  15. package/dist/client-v2/143.1a8cf1cd5ce17b64.js +0 -10
  16. package/dist/node_modules/@ctrl/tinycolor/LICENSE +0 -7
  17. package/dist/node_modules/@ctrl/tinycolor/dist/bundles/tinycolor.umd.min.js +0 -2
  18. package/dist/node_modules/@ctrl/tinycolor/dist/conversion.d.ts +0 -61
  19. package/dist/node_modules/@ctrl/tinycolor/dist/conversion.js +0 -250
  20. package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.d.ts +0 -4
  21. package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.js +0 -157
  22. package/dist/node_modules/@ctrl/tinycolor/dist/format-input.d.ts +0 -37
  23. package/dist/node_modules/@ctrl/tinycolor/dist/format-input.js +0 -189
  24. package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.d.ts +0 -14
  25. package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.js +0 -30
  26. package/dist/node_modules/@ctrl/tinycolor/dist/index.d.ts +0 -207
  27. package/dist/node_modules/@ctrl/tinycolor/dist/index.js +0 -512
  28. package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.d.ts +0 -46
  29. package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.js +0 -2
  30. package/dist/node_modules/@ctrl/tinycolor/dist/module/conversion.js +0 -235
  31. package/dist/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js +0 -154
  32. package/dist/node_modules/@ctrl/tinycolor/dist/module/format-input.js +0 -183
  33. package/dist/node_modules/@ctrl/tinycolor/dist/module/from-ratio.js +0 -25
  34. package/dist/node_modules/@ctrl/tinycolor/dist/module/index.js +0 -508
  35. package/dist/node_modules/@ctrl/tinycolor/dist/module/interfaces.js +0 -1
  36. package/dist/node_modules/@ctrl/tinycolor/dist/module/public_api.js +0 -12
  37. package/dist/node_modules/@ctrl/tinycolor/dist/module/random.js +0 -278
  38. package/dist/node_modules/@ctrl/tinycolor/dist/module/readability.js +0 -80
  39. package/dist/node_modules/@ctrl/tinycolor/dist/module/to-ms-filter.js +0 -16
  40. package/dist/node_modules/@ctrl/tinycolor/dist/module/umd_api.js +0 -20
  41. package/dist/node_modules/@ctrl/tinycolor/dist/module/util.js +0 -82
  42. package/dist/node_modules/@ctrl/tinycolor/dist/public_api.d.ts +0 -11
  43. package/dist/node_modules/@ctrl/tinycolor/dist/public_api.js +0 -1
  44. package/dist/node_modules/@ctrl/tinycolor/dist/random.d.ts +0 -24
  45. package/dist/node_modules/@ctrl/tinycolor/dist/random.js +0 -282
  46. package/dist/node_modules/@ctrl/tinycolor/dist/readability.d.ts +0 -46
  47. package/dist/node_modules/@ctrl/tinycolor/dist/readability.js +0 -86
  48. package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.d.ts +0 -5
  49. package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.js +0 -20
  50. package/dist/node_modules/@ctrl/tinycolor/dist/umd_api.d.ts +0 -23
  51. package/dist/node_modules/@ctrl/tinycolor/dist/umd_api.js +0 -22
  52. package/dist/node_modules/@ctrl/tinycolor/dist/util.d.ts +0 -36
  53. package/dist/node_modules/@ctrl/tinycolor/dist/util.js +0 -92
  54. package/dist/node_modules/@ctrl/tinycolor/package.json +0 -1
  55. package/dist/shared/components/calendar/calendar.js +0 -417
  56. package/dist/shared/components/calendar/style.js +0 -79
  57. package/dist/shared/components/calendar/top-part-of-calendar.js +0 -57
  58. package/dist/shared/components/gantt/style.js +0 -74
  59. package/dist/shared/components/gantt/task-gantt-content.js +0 -337
  60. package/dist/shared/components/gantt/task-gantt.js +0 -128
  61. package/dist/shared/components/grid/grid-body.js +0 -114
  62. package/dist/shared/components/grid/grid.js +0 -50
  63. package/dist/shared/components/grid/style.js +0 -54
  64. package/dist/shared/components/other/arrow.js +0 -90
  65. package/dist/shared/components/other/horizontal-scroll.js +0 -64
  66. package/dist/shared/components/other/style.js +0 -125
  67. package/dist/shared/components/other/tooltip.js +0 -137
  68. package/dist/shared/components/other/vertical-scroll.js +0 -74
  69. package/dist/shared/components/task-item/bar/bar-date-handle.js +0 -62
  70. package/dist/shared/components/task-item/bar/bar-display.js +0 -98
  71. package/dist/shared/components/task-item/bar/bar-progress-handle.js +0 -49
  72. package/dist/shared/components/task-item/bar/bar-small.js +0 -85
  73. package/dist/shared/components/task-item/bar/bar.js +0 -113
  74. package/dist/shared/components/task-item/bar/style.js +0 -58
  75. package/dist/shared/components/task-item/milestone/milestone.js +0 -72
  76. package/dist/shared/components/task-item/milestone/style.js +0 -45
  77. package/dist/shared/components/task-item/project/project.js +0 -77
  78. package/dist/shared/components/task-item/project/style.js +0 -51
  79. package/dist/shared/components/task-item/style.js +0 -74
  80. package/dist/shared/components/task-item/task-item.js +0 -132
  81. package/dist/shared/helpers/bar-helper.js +0 -415
  82. package/dist/shared/helpers/date-helper.js +0 -231
  83. package/dist/shared/helpers/other-helper.js +0 -97
  84. package/dist/shared/types/bar-task.js +0 -24
  85. package/dist/shared/types/date-setup.js +0 -24
  86. package/dist/shared/types/gantt-task-actions.js +0 -24
  87. package/dist/shared/types/public-types.js +0 -46
  88. /package/dist/{shared → client-v2/shared}/components/calendar/calendar.d.ts +0 -0
  89. /package/dist/{shared → client-v2/shared}/components/calendar/style.d.ts +0 -0
  90. /package/dist/{shared → client-v2/shared}/components/calendar/top-part-of-calendar.d.ts +0 -0
  91. /package/dist/{shared → client-v2/shared}/components/gantt/style.d.ts +0 -0
  92. /package/dist/{shared → client-v2/shared}/components/gantt/task-gantt-content.d.ts +0 -0
  93. /package/dist/{shared → client-v2/shared}/components/gantt/task-gantt.d.ts +0 -0
  94. /package/dist/{shared → client-v2/shared}/components/grid/grid-body.d.ts +0 -0
  95. /package/dist/{shared → client-v2/shared}/components/grid/grid.d.ts +0 -0
  96. /package/dist/{shared → client-v2/shared}/components/other/arrow.d.ts +0 -0
  97. /package/dist/{shared → client-v2/shared}/components/other/style.d.ts +0 -0
  98. /package/dist/{shared → client-v2/shared}/components/other/tooltip.d.ts +0 -0
  99. /package/dist/{shared → client-v2/shared}/components/other/vertical-scroll.d.ts +0 -0
  100. /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar-date-handle.d.ts +0 -0
  101. /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar-display.d.ts +0 -0
  102. /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar-progress-handle.d.ts +0 -0
  103. /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar-small.d.ts +0 -0
  104. /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar.d.ts +0 -0
  105. /package/dist/{shared → client-v2/shared}/components/task-item/bar/style.d.ts +0 -0
  106. /package/dist/{shared → client-v2/shared}/components/task-item/milestone/milestone.d.ts +0 -0
  107. /package/dist/{shared → client-v2/shared}/components/task-item/milestone/style.d.ts +0 -0
  108. /package/dist/{shared → client-v2/shared}/components/task-item/project/project.d.ts +0 -0
  109. /package/dist/{shared → client-v2/shared}/components/task-item/project/style.d.ts +0 -0
  110. /package/dist/{shared → client-v2/shared}/components/task-item/style.d.ts +0 -0
  111. /package/dist/{shared → client-v2/shared}/components/task-item/task-item.d.ts +0 -0
  112. /package/dist/{shared → client-v2/shared}/helpers/bar-helper.d.ts +0 -0
  113. /package/dist/{shared → client-v2/shared}/helpers/date-helper.d.ts +0 -0
  114. /package/dist/{shared → client-v2/shared}/helpers/other-helper.d.ts +0 -0
  115. /package/dist/{shared → client-v2/shared}/types/bar-task.d.ts +0 -0
  116. /package/dist/{shared → client-v2/shared}/types/date-setup.d.ts +0 -0
  117. /package/dist/{shared → client-v2/shared}/types/gantt-task-actions.d.ts +0 -0
  118. /package/dist/{shared → client-v2/shared}/types/public-types.d.ts +0 -0
@@ -1,250 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.numberInputToObject = exports.parseIntFromHex = exports.convertHexToDecimal = exports.convertDecimalToHex = exports.rgbaToArgbHex = exports.rgbaToHex = exports.rgbToHex = exports.hsvToRgb = exports.rgbToHsv = exports.hslToRgb = exports.rgbToHsl = exports.rgbToRgb = void 0;
4
- var util_js_1 = require("./util.js");
5
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
6
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
7
- /**
8
- * Handle bounds / percentage checking to conform to CSS color spec
9
- * <http://www.w3.org/TR/css3-color/>
10
- * *Assumes:* r, g, b in [0, 255] or [0, 1]
11
- * *Returns:* { r, g, b } in [0, 255]
12
- */
13
- function rgbToRgb(r, g, b) {
14
- return {
15
- r: (0, util_js_1.bound01)(r, 255) * 255,
16
- g: (0, util_js_1.bound01)(g, 255) * 255,
17
- b: (0, util_js_1.bound01)(b, 255) * 255,
18
- };
19
- }
20
- exports.rgbToRgb = rgbToRgb;
21
- /**
22
- * Converts an RGB color value to HSL.
23
- * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
24
- * *Returns:* { h, s, l } in [0,1]
25
- */
26
- function rgbToHsl(r, g, b) {
27
- r = (0, util_js_1.bound01)(r, 255);
28
- g = (0, util_js_1.bound01)(g, 255);
29
- b = (0, util_js_1.bound01)(b, 255);
30
- var max = Math.max(r, g, b);
31
- var min = Math.min(r, g, b);
32
- var h = 0;
33
- var s = 0;
34
- var l = (max + min) / 2;
35
- if (max === min) {
36
- s = 0;
37
- h = 0; // achromatic
38
- }
39
- else {
40
- var d = max - min;
41
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
42
- switch (max) {
43
- case r:
44
- h = (g - b) / d + (g < b ? 6 : 0);
45
- break;
46
- case g:
47
- h = (b - r) / d + 2;
48
- break;
49
- case b:
50
- h = (r - g) / d + 4;
51
- break;
52
- default:
53
- break;
54
- }
55
- h /= 6;
56
- }
57
- return { h: h, s: s, l: l };
58
- }
59
- exports.rgbToHsl = rgbToHsl;
60
- function hue2rgb(p, q, t) {
61
- if (t < 0) {
62
- t += 1;
63
- }
64
- if (t > 1) {
65
- t -= 1;
66
- }
67
- if (t < 1 / 6) {
68
- return p + (q - p) * (6 * t);
69
- }
70
- if (t < 1 / 2) {
71
- return q;
72
- }
73
- if (t < 2 / 3) {
74
- return p + (q - p) * (2 / 3 - t) * 6;
75
- }
76
- return p;
77
- }
78
- /**
79
- * Converts an HSL color value to RGB.
80
- *
81
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
82
- * *Returns:* { r, g, b } in the set [0, 255]
83
- */
84
- function hslToRgb(h, s, l) {
85
- var r;
86
- var g;
87
- var b;
88
- h = (0, util_js_1.bound01)(h, 360);
89
- s = (0, util_js_1.bound01)(s, 100);
90
- l = (0, util_js_1.bound01)(l, 100);
91
- if (s === 0) {
92
- // achromatic
93
- g = l;
94
- b = l;
95
- r = l;
96
- }
97
- else {
98
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
99
- var p = 2 * l - q;
100
- r = hue2rgb(p, q, h + 1 / 3);
101
- g = hue2rgb(p, q, h);
102
- b = hue2rgb(p, q, h - 1 / 3);
103
- }
104
- return { r: r * 255, g: g * 255, b: b * 255 };
105
- }
106
- exports.hslToRgb = hslToRgb;
107
- /**
108
- * Converts an RGB color value to HSV
109
- *
110
- * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
111
- * *Returns:* { h, s, v } in [0,1]
112
- */
113
- function rgbToHsv(r, g, b) {
114
- r = (0, util_js_1.bound01)(r, 255);
115
- g = (0, util_js_1.bound01)(g, 255);
116
- b = (0, util_js_1.bound01)(b, 255);
117
- var max = Math.max(r, g, b);
118
- var min = Math.min(r, g, b);
119
- var h = 0;
120
- var v = max;
121
- var d = max - min;
122
- var s = max === 0 ? 0 : d / max;
123
- if (max === min) {
124
- h = 0; // achromatic
125
- }
126
- else {
127
- switch (max) {
128
- case r:
129
- h = (g - b) / d + (g < b ? 6 : 0);
130
- break;
131
- case g:
132
- h = (b - r) / d + 2;
133
- break;
134
- case b:
135
- h = (r - g) / d + 4;
136
- break;
137
- default:
138
- break;
139
- }
140
- h /= 6;
141
- }
142
- return { h: h, s: s, v: v };
143
- }
144
- exports.rgbToHsv = rgbToHsv;
145
- /**
146
- * Converts an HSV color value to RGB.
147
- *
148
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
149
- * *Returns:* { r, g, b } in the set [0, 255]
150
- */
151
- function hsvToRgb(h, s, v) {
152
- h = (0, util_js_1.bound01)(h, 360) * 6;
153
- s = (0, util_js_1.bound01)(s, 100);
154
- v = (0, util_js_1.bound01)(v, 100);
155
- var i = Math.floor(h);
156
- var f = h - i;
157
- var p = v * (1 - s);
158
- var q = v * (1 - f * s);
159
- var t = v * (1 - (1 - f) * s);
160
- var mod = i % 6;
161
- var r = [v, q, p, p, t, v][mod];
162
- var g = [t, v, v, q, p, p][mod];
163
- var b = [p, p, t, v, v, q][mod];
164
- return { r: r * 255, g: g * 255, b: b * 255 };
165
- }
166
- exports.hsvToRgb = hsvToRgb;
167
- /**
168
- * Converts an RGB color to hex
169
- *
170
- * Assumes r, g, and b are contained in the set [0, 255]
171
- * Returns a 3 or 6 character hex
172
- */
173
- function rgbToHex(r, g, b, allow3Char) {
174
- var hex = [
175
- (0, util_js_1.pad2)(Math.round(r).toString(16)),
176
- (0, util_js_1.pad2)(Math.round(g).toString(16)),
177
- (0, util_js_1.pad2)(Math.round(b).toString(16)),
178
- ];
179
- // Return a 3 character hex if possible
180
- if (allow3Char &&
181
- hex[0].startsWith(hex[0].charAt(1)) &&
182
- hex[1].startsWith(hex[1].charAt(1)) &&
183
- hex[2].startsWith(hex[2].charAt(1))) {
184
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
185
- }
186
- return hex.join('');
187
- }
188
- exports.rgbToHex = rgbToHex;
189
- /**
190
- * Converts an RGBA color plus alpha transparency to hex
191
- *
192
- * Assumes r, g, b are contained in the set [0, 255] and
193
- * a in [0, 1]. Returns a 4 or 8 character rgba hex
194
- */
195
- // eslint-disable-next-line max-params
196
- function rgbaToHex(r, g, b, a, allow4Char) {
197
- var hex = [
198
- (0, util_js_1.pad2)(Math.round(r).toString(16)),
199
- (0, util_js_1.pad2)(Math.round(g).toString(16)),
200
- (0, util_js_1.pad2)(Math.round(b).toString(16)),
201
- (0, util_js_1.pad2)(convertDecimalToHex(a)),
202
- ];
203
- // Return a 4 character hex if possible
204
- if (allow4Char &&
205
- hex[0].startsWith(hex[0].charAt(1)) &&
206
- hex[1].startsWith(hex[1].charAt(1)) &&
207
- hex[2].startsWith(hex[2].charAt(1)) &&
208
- hex[3].startsWith(hex[3].charAt(1))) {
209
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
210
- }
211
- return hex.join('');
212
- }
213
- exports.rgbaToHex = rgbaToHex;
214
- /**
215
- * Converts an RGBA color to an ARGB Hex8 string
216
- * Rarely used, but required for "toFilter()"
217
- */
218
- function rgbaToArgbHex(r, g, b, a) {
219
- var hex = [
220
- (0, util_js_1.pad2)(convertDecimalToHex(a)),
221
- (0, util_js_1.pad2)(Math.round(r).toString(16)),
222
- (0, util_js_1.pad2)(Math.round(g).toString(16)),
223
- (0, util_js_1.pad2)(Math.round(b).toString(16)),
224
- ];
225
- return hex.join('');
226
- }
227
- exports.rgbaToArgbHex = rgbaToArgbHex;
228
- /** Converts a decimal to a hex value */
229
- function convertDecimalToHex(d) {
230
- return Math.round(parseFloat(d) * 255).toString(16);
231
- }
232
- exports.convertDecimalToHex = convertDecimalToHex;
233
- /** Converts a hex value to a decimal */
234
- function convertHexToDecimal(h) {
235
- return parseIntFromHex(h) / 255;
236
- }
237
- exports.convertHexToDecimal = convertHexToDecimal;
238
- /** Parse a base-16 hex value into a base-10 integer */
239
- function parseIntFromHex(val) {
240
- return parseInt(val, 16);
241
- }
242
- exports.parseIntFromHex = parseIntFromHex;
243
- function numberInputToObject(color) {
244
- return {
245
- r: color >> 16,
246
- g: (color & 0xff00) >> 8,
247
- b: color & 0xff,
248
- };
249
- }
250
- exports.numberInputToObject = numberInputToObject;
@@ -1,4 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- export declare const names: Record<string, string>;
@@ -1,157 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.names = void 0;
4
- // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
5
- /**
6
- * @hidden
7
- */
8
- exports.names = {
9
- aliceblue: '#f0f8ff',
10
- antiquewhite: '#faebd7',
11
- aqua: '#00ffff',
12
- aquamarine: '#7fffd4',
13
- azure: '#f0ffff',
14
- beige: '#f5f5dc',
15
- bisque: '#ffe4c4',
16
- black: '#000000',
17
- blanchedalmond: '#ffebcd',
18
- blue: '#0000ff',
19
- blueviolet: '#8a2be2',
20
- brown: '#a52a2a',
21
- burlywood: '#deb887',
22
- cadetblue: '#5f9ea0',
23
- chartreuse: '#7fff00',
24
- chocolate: '#d2691e',
25
- coral: '#ff7f50',
26
- cornflowerblue: '#6495ed',
27
- cornsilk: '#fff8dc',
28
- crimson: '#dc143c',
29
- cyan: '#00ffff',
30
- darkblue: '#00008b',
31
- darkcyan: '#008b8b',
32
- darkgoldenrod: '#b8860b',
33
- darkgray: '#a9a9a9',
34
- darkgreen: '#006400',
35
- darkgrey: '#a9a9a9',
36
- darkkhaki: '#bdb76b',
37
- darkmagenta: '#8b008b',
38
- darkolivegreen: '#556b2f',
39
- darkorange: '#ff8c00',
40
- darkorchid: '#9932cc',
41
- darkred: '#8b0000',
42
- darksalmon: '#e9967a',
43
- darkseagreen: '#8fbc8f',
44
- darkslateblue: '#483d8b',
45
- darkslategray: '#2f4f4f',
46
- darkslategrey: '#2f4f4f',
47
- darkturquoise: '#00ced1',
48
- darkviolet: '#9400d3',
49
- deeppink: '#ff1493',
50
- deepskyblue: '#00bfff',
51
- dimgray: '#696969',
52
- dimgrey: '#696969',
53
- dodgerblue: '#1e90ff',
54
- firebrick: '#b22222',
55
- floralwhite: '#fffaf0',
56
- forestgreen: '#228b22',
57
- fuchsia: '#ff00ff',
58
- gainsboro: '#dcdcdc',
59
- ghostwhite: '#f8f8ff',
60
- goldenrod: '#daa520',
61
- gold: '#ffd700',
62
- gray: '#808080',
63
- green: '#008000',
64
- greenyellow: '#adff2f',
65
- grey: '#808080',
66
- honeydew: '#f0fff0',
67
- hotpink: '#ff69b4',
68
- indianred: '#cd5c5c',
69
- indigo: '#4b0082',
70
- ivory: '#fffff0',
71
- khaki: '#f0e68c',
72
- lavenderblush: '#fff0f5',
73
- lavender: '#e6e6fa',
74
- lawngreen: '#7cfc00',
75
- lemonchiffon: '#fffacd',
76
- lightblue: '#add8e6',
77
- lightcoral: '#f08080',
78
- lightcyan: '#e0ffff',
79
- lightgoldenrodyellow: '#fafad2',
80
- lightgray: '#d3d3d3',
81
- lightgreen: '#90ee90',
82
- lightgrey: '#d3d3d3',
83
- lightpink: '#ffb6c1',
84
- lightsalmon: '#ffa07a',
85
- lightseagreen: '#20b2aa',
86
- lightskyblue: '#87cefa',
87
- lightslategray: '#778899',
88
- lightslategrey: '#778899',
89
- lightsteelblue: '#b0c4de',
90
- lightyellow: '#ffffe0',
91
- lime: '#00ff00',
92
- limegreen: '#32cd32',
93
- linen: '#faf0e6',
94
- magenta: '#ff00ff',
95
- maroon: '#800000',
96
- mediumaquamarine: '#66cdaa',
97
- mediumblue: '#0000cd',
98
- mediumorchid: '#ba55d3',
99
- mediumpurple: '#9370db',
100
- mediumseagreen: '#3cb371',
101
- mediumslateblue: '#7b68ee',
102
- mediumspringgreen: '#00fa9a',
103
- mediumturquoise: '#48d1cc',
104
- mediumvioletred: '#c71585',
105
- midnightblue: '#191970',
106
- mintcream: '#f5fffa',
107
- mistyrose: '#ffe4e1',
108
- moccasin: '#ffe4b5',
109
- navajowhite: '#ffdead',
110
- navy: '#000080',
111
- oldlace: '#fdf5e6',
112
- olive: '#808000',
113
- olivedrab: '#6b8e23',
114
- orange: '#ffa500',
115
- orangered: '#ff4500',
116
- orchid: '#da70d6',
117
- palegoldenrod: '#eee8aa',
118
- palegreen: '#98fb98',
119
- paleturquoise: '#afeeee',
120
- palevioletred: '#db7093',
121
- papayawhip: '#ffefd5',
122
- peachpuff: '#ffdab9',
123
- peru: '#cd853f',
124
- pink: '#ffc0cb',
125
- plum: '#dda0dd',
126
- powderblue: '#b0e0e6',
127
- purple: '#800080',
128
- rebeccapurple: '#663399',
129
- red: '#ff0000',
130
- rosybrown: '#bc8f8f',
131
- royalblue: '#4169e1',
132
- saddlebrown: '#8b4513',
133
- salmon: '#fa8072',
134
- sandybrown: '#f4a460',
135
- seagreen: '#2e8b57',
136
- seashell: '#fff5ee',
137
- sienna: '#a0522d',
138
- silver: '#c0c0c0',
139
- skyblue: '#87ceeb',
140
- slateblue: '#6a5acd',
141
- slategray: '#708090',
142
- slategrey: '#708090',
143
- snow: '#fffafa',
144
- springgreen: '#00ff7f',
145
- steelblue: '#4682b4',
146
- tan: '#d2b48c',
147
- teal: '#008080',
148
- thistle: '#d8bfd8',
149
- tomato: '#ff6347',
150
- turquoise: '#40e0d0',
151
- violet: '#ee82ee',
152
- wheat: '#f5deb3',
153
- white: '#ffffff',
154
- whitesmoke: '#f5f5f5',
155
- yellow: '#ffff00',
156
- yellowgreen: '#9acd32',
157
- };
@@ -1,37 +0,0 @@
1
- import { HSL, HSLA, HSV, HSVA, RGB, RGBA } from './interfaces.js';
2
- /**
3
- * Given a string or object, convert that input to RGB
4
- *
5
- * Possible string inputs:
6
- * ```
7
- * "red"
8
- * "#f00" or "f00"
9
- * "#ff0000" or "ff0000"
10
- * "#ff000000" or "ff000000"
11
- * "rgb 255 0 0" or "rgb (255, 0, 0)"
12
- * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
13
- * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
14
- * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
15
- * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
16
- * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
17
- * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
18
- * ```
19
- */
20
- export declare function inputToRGB(color: string | RGB | RGBA | HSL | HSLA | HSV | HSVA | any): {
21
- ok: boolean;
22
- format: any;
23
- r: number;
24
- g: number;
25
- b: number;
26
- a: number;
27
- };
28
- /**
29
- * Permissive string parsing. Take in a number of formats, and output an object
30
- * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
31
- */
32
- export declare function stringInputToObject(color: string): any;
33
- /**
34
- * Check to see if it looks like a CSS unit
35
- * (see `matchers` above for definition).
36
- */
37
- export declare function isValidCSSUnit(color: string | number): boolean;
@@ -1,189 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isValidCSSUnit = exports.stringInputToObject = exports.inputToRGB = void 0;
4
- /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
5
- var conversion_js_1 = require("./conversion.js");
6
- var css_color_names_js_1 = require("./css-color-names.js");
7
- var util_js_1 = require("./util.js");
8
- /**
9
- * Given a string or object, convert that input to RGB
10
- *
11
- * Possible string inputs:
12
- * ```
13
- * "red"
14
- * "#f00" or "f00"
15
- * "#ff0000" or "ff0000"
16
- * "#ff000000" or "ff000000"
17
- * "rgb 255 0 0" or "rgb (255, 0, 0)"
18
- * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
19
- * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
20
- * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
21
- * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
22
- * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
23
- * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
24
- * ```
25
- */
26
- function inputToRGB(color) {
27
- var rgb = { r: 0, g: 0, b: 0 };
28
- var a = 1;
29
- var s = null;
30
- var v = null;
31
- var l = null;
32
- var ok = false;
33
- var format = false;
34
- if (typeof color === 'string') {
35
- color = stringInputToObject(color);
36
- }
37
- if (typeof color === 'object') {
38
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
39
- rgb = (0, conversion_js_1.rgbToRgb)(color.r, color.g, color.b);
40
- ok = true;
41
- format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
42
- }
43
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
44
- s = (0, util_js_1.convertToPercentage)(color.s);
45
- v = (0, util_js_1.convertToPercentage)(color.v);
46
- rgb = (0, conversion_js_1.hsvToRgb)(color.h, s, v);
47
- ok = true;
48
- format = 'hsv';
49
- }
50
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
51
- s = (0, util_js_1.convertToPercentage)(color.s);
52
- l = (0, util_js_1.convertToPercentage)(color.l);
53
- rgb = (0, conversion_js_1.hslToRgb)(color.h, s, l);
54
- ok = true;
55
- format = 'hsl';
56
- }
57
- if (Object.prototype.hasOwnProperty.call(color, 'a')) {
58
- a = color.a;
59
- }
60
- }
61
- a = (0, util_js_1.boundAlpha)(a);
62
- return {
63
- ok: ok,
64
- format: color.format || format,
65
- r: Math.min(255, Math.max(rgb.r, 0)),
66
- g: Math.min(255, Math.max(rgb.g, 0)),
67
- b: Math.min(255, Math.max(rgb.b, 0)),
68
- a: a,
69
- };
70
- }
71
- exports.inputToRGB = inputToRGB;
72
- // <http://www.w3.org/TR/css3-values/#integers>
73
- var CSS_INTEGER = '[-\\+]?\\d+%?';
74
- // <http://www.w3.org/TR/css3-values/#number-value>
75
- var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
76
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
77
- var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
78
- // Actual matching.
79
- // Parentheses and commas are optional, but not required.
80
- // Whitespace can take the place of commas or opening paren
81
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
82
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
83
- var matchers = {
84
- CSS_UNIT: new RegExp(CSS_UNIT),
85
- rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
86
- rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
87
- hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
88
- hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
89
- hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
90
- hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
91
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
92
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
93
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
94
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
95
- };
96
- /**
97
- * Permissive string parsing. Take in a number of formats, and output an object
98
- * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
99
- */
100
- function stringInputToObject(color) {
101
- color = color.trim().toLowerCase();
102
- if (color.length === 0) {
103
- return false;
104
- }
105
- var named = false;
106
- if (css_color_names_js_1.names[color]) {
107
- color = css_color_names_js_1.names[color];
108
- named = true;
109
- }
110
- else if (color === 'transparent') {
111
- return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
112
- }
113
- // Try to match string input using regular expressions.
114
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
115
- // Just return an object and let the conversion functions handle that.
116
- // This way the result will be the same whether the tinycolor is initialized with string or object.
117
- var match = matchers.rgb.exec(color);
118
- if (match) {
119
- return { r: match[1], g: match[2], b: match[3] };
120
- }
121
- match = matchers.rgba.exec(color);
122
- if (match) {
123
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
124
- }
125
- match = matchers.hsl.exec(color);
126
- if (match) {
127
- return { h: match[1], s: match[2], l: match[3] };
128
- }
129
- match = matchers.hsla.exec(color);
130
- if (match) {
131
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
132
- }
133
- match = matchers.hsv.exec(color);
134
- if (match) {
135
- return { h: match[1], s: match[2], v: match[3] };
136
- }
137
- match = matchers.hsva.exec(color);
138
- if (match) {
139
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
140
- }
141
- match = matchers.hex8.exec(color);
142
- if (match) {
143
- return {
144
- r: (0, conversion_js_1.parseIntFromHex)(match[1]),
145
- g: (0, conversion_js_1.parseIntFromHex)(match[2]),
146
- b: (0, conversion_js_1.parseIntFromHex)(match[3]),
147
- a: (0, conversion_js_1.convertHexToDecimal)(match[4]),
148
- format: named ? 'name' : 'hex8',
149
- };
150
- }
151
- match = matchers.hex6.exec(color);
152
- if (match) {
153
- return {
154
- r: (0, conversion_js_1.parseIntFromHex)(match[1]),
155
- g: (0, conversion_js_1.parseIntFromHex)(match[2]),
156
- b: (0, conversion_js_1.parseIntFromHex)(match[3]),
157
- format: named ? 'name' : 'hex',
158
- };
159
- }
160
- match = matchers.hex4.exec(color);
161
- if (match) {
162
- return {
163
- r: (0, conversion_js_1.parseIntFromHex)(match[1] + match[1]),
164
- g: (0, conversion_js_1.parseIntFromHex)(match[2] + match[2]),
165
- b: (0, conversion_js_1.parseIntFromHex)(match[3] + match[3]),
166
- a: (0, conversion_js_1.convertHexToDecimal)(match[4] + match[4]),
167
- format: named ? 'name' : 'hex8',
168
- };
169
- }
170
- match = matchers.hex3.exec(color);
171
- if (match) {
172
- return {
173
- r: (0, conversion_js_1.parseIntFromHex)(match[1] + match[1]),
174
- g: (0, conversion_js_1.parseIntFromHex)(match[2] + match[2]),
175
- b: (0, conversion_js_1.parseIntFromHex)(match[3] + match[3]),
176
- format: named ? 'name' : 'hex',
177
- };
178
- }
179
- return false;
180
- }
181
- exports.stringInputToObject = stringInputToObject;
182
- /**
183
- * Check to see if it looks like a CSS unit
184
- * (see `matchers` above for definition).
185
- */
186
- function isValidCSSUnit(color) {
187
- return Boolean(matchers.CSS_UNIT.exec(String(color)));
188
- }
189
- exports.isValidCSSUnit = isValidCSSUnit;
@@ -1,14 +0,0 @@
1
- import { TinyColor } from './index.js';
2
- export interface RatioInput {
3
- r: number | string;
4
- g: number | string;
5
- b: number | string;
6
- a?: number | string;
7
- }
8
- /**
9
- * If input is an object, force 1 into "1.0" to handle ratios properly
10
- * String input requires "1.0" as input, so 1 will be treated as 1
11
- */
12
- export declare function fromRatio(ratio: RatioInput, opts?: any): TinyColor;
13
- /** old random function */
14
- export declare function legacyRandom(): TinyColor;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.legacyRandom = exports.fromRatio = void 0;
4
- var index_js_1 = require("./index.js");
5
- var util_js_1 = require("./util.js");
6
- /**
7
- * If input is an object, force 1 into "1.0" to handle ratios properly
8
- * String input requires "1.0" as input, so 1 will be treated as 1
9
- */
10
- function fromRatio(ratio, opts) {
11
- var newColor = {
12
- r: (0, util_js_1.convertToPercentage)(ratio.r),
13
- g: (0, util_js_1.convertToPercentage)(ratio.g),
14
- b: (0, util_js_1.convertToPercentage)(ratio.b),
15
- };
16
- if (ratio.a !== undefined) {
17
- newColor.a = Number(ratio.a);
18
- }
19
- return new index_js_1.TinyColor(newColor, opts);
20
- }
21
- exports.fromRatio = fromRatio;
22
- /** old random function */
23
- function legacyRandom() {
24
- return new index_js_1.TinyColor({
25
- r: Math.random(),
26
- g: Math.random(),
27
- b: Math.random(),
28
- });
29
- }
30
- exports.legacyRandom = legacyRandom;