@unicom-cloud/utils 0.1.10 → 0.1.12

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 (206) hide show
  1. package/caseName.js +11 -0
  2. package/className.js +5 -0
  3. package/clipboardCopy.js +6 -0
  4. package/constant.js +4 -0
  5. package/contentDisposition.js +7 -0
  6. package/cookie.js +7 -0
  7. package/date/convertTime.js +61 -0
  8. package/date/index.js +22 -0
  9. package/date.js +9 -0
  10. package/decimal.js +5 -0
  11. package/eventEmitter.js +4 -0
  12. package/file.js +6 -0
  13. package/filesize.js +8 -0
  14. package/index.js +56 -46
  15. package/invariant.js +4 -0
  16. package/is.js +92 -0
  17. package/lunar/index.js +36 -0
  18. package/lunar/lib/Holiday.js +42 -0
  19. package/lunar/lib/HolidayUtil.js +128 -0
  20. package/lunar/lib/I18n.js +1005 -0
  21. package/lunar/lib/JieQi.js +40 -0
  22. package/lunar/lib/Lunar.js +1035 -0
  23. package/lunar/lib/LunarMonth.js +150 -0
  24. package/lunar/lib/LunarTime.js +138 -0
  25. package/lunar/lib/LunarUtil.js +1752 -0
  26. package/lunar/lib/LunarYear.js +616 -0
  27. package/lunar/lib/ShouXingUtil.js +6915 -0
  28. package/lunar/lib/Solar.js +311 -0
  29. package/lunar/lib/SolarHalfYear.js +45 -0
  30. package/lunar/lib/SolarMonth.js +55 -0
  31. package/lunar/lib/SolarSeason.js +42 -0
  32. package/lunar/lib/SolarUtil.js +256 -0
  33. package/lunar/lib/SolarWeek.js +153 -0
  34. package/lunar/lib/SolarYear.js +35 -0
  35. package/lunar/lib/index.js +35 -0
  36. package/lunar.js +36 -0
  37. package/math.js +9 -0
  38. package/md5.js +4 -0
  39. package/mock.js +8 -0
  40. package/normalizeWheel.js +6 -0
  41. package/number-to-chinese/index.js +72 -0
  42. package/numberToChinese.js +4 -0
  43. package/nzh.js +4 -0
  44. package/object-keys-sort/index.js +7 -0
  45. package/objectKeysSort.js +2 -5
  46. package/package.json +1 -1
  47. package/random.js +15 -0
  48. package/screenfull.js +4 -0
  49. package/snapdom/src/api/preCache.js +26 -36
  50. package/snapdom/src/api/snapdom.js +78 -61
  51. package/snapdom/src/core/capture.js +54 -54
  52. package/snapdom/src/core/prepare.js +46 -37
  53. package/snapdom/src/modules/fonts.js +90 -92
  54. package/snapdom/src/modules/iconFonts.js +28 -0
  55. package/snapdom/src/modules/images.js +6 -6
  56. package/snapdom/src/modules/pseudo.js +51 -49
  57. package/snapdom/src/modules/styles.js +27 -7
  58. package/snapdom/src/modules/svgDefs.js +26 -0
  59. package/snapdom/src/utils/helpers.js +150 -103
  60. package/snapdom.js +6 -0
  61. package/tinycolor/index.js +46 -0
  62. package/tinycolor/src/conversion.js +143 -0
  63. package/tinycolor/src/css-color-names.js +153 -0
  64. package/tinycolor/src/format-input.js +77 -0
  65. package/tinycolor/src/from-ratio.js +21 -0
  66. package/tinycolor/src/index.js +404 -0
  67. package/tinycolor/src/random.js +221 -0
  68. package/tinycolor/src/readability.js +37 -0
  69. package/tinycolor/src/to-ms-filter.js +15 -0
  70. package/tinycolor/src/util.js +32 -0
  71. package/tinycolor.js +46 -0
  72. package/tree/index.js +10 -8
  73. package/tree/searchTree.js +54 -0
  74. package/tree.js +13 -0
  75. package/turboStream.js +6 -0
  76. package/types/case-name/index.d.ts +11 -0
  77. package/types/class-name/index.d.ts +2 -0
  78. package/types/clipboard-copy/index.d.ts +2 -0
  79. package/types/constant/address.d.ts +14 -0
  80. package/types/constant/chineseCharacters.d.ts +2 -0
  81. package/types/constant/constellations.d.ts +2 -0
  82. package/types/constant/domain.d.ts +2 -0
  83. package/types/constant/identity.d.ts +2 -0
  84. package/types/constant/index.d.ts +1 -0
  85. package/types/constant/keyboardCode.d.ts +158 -0
  86. package/types/constant/licensePlate.d.ts +2 -0
  87. package/types/constant/name.d.ts +4 -0
  88. package/types/constant/platform.d.ts +11 -0
  89. package/types/constant/protocol.d.ts +2 -0
  90. package/types/constant/ui.d.ts +14 -0
  91. package/types/content-disposition/index.d.ts +10 -0
  92. package/types/cookie/index.d.ts +4 -0
  93. package/types/cookie/src/index.d.ts +114 -0
  94. package/types/date/convertTime.d.ts +32 -0
  95. package/types/date/index.d.ts +4 -0
  96. package/types/decimal/decimal.d.ts +4 -0
  97. package/types/decimal/index.d.ts +1 -0
  98. package/types/event-emitter/index.d.ts +17 -0
  99. package/types/file/fileToURL.d.ts +2 -0
  100. package/types/file/index.d.ts +3 -0
  101. package/types/file/saveAs.d.ts +2 -0
  102. package/types/filesize/index.d.ts +2 -0
  103. package/types/filesize/src/constants.d.ts +42 -0
  104. package/types/filesize/src/filesize.d.ts +47 -0
  105. package/types/index.d.ts +25 -0
  106. package/types/invariant/index.d.ts +2 -0
  107. package/types/is/index.d.ts +53 -0
  108. package/types/lunar/index.d.ts +3 -0
  109. package/types/lunar/lib/Holiday.d.ts +17 -0
  110. package/types/lunar/lib/HolidayUtil.d.ts +23 -0
  111. package/types/lunar/lib/I18n.d.ts +23 -0
  112. package/types/lunar/lib/JieQi.d.ts +15 -0
  113. package/types/lunar/lib/Lunar.d.ts +245 -0
  114. package/types/lunar/lib/LunarMonth.d.ts +35 -0
  115. package/types/lunar/lib/LunarTime.d.ts +40 -0
  116. package/types/lunar/lib/LunarUtil.d.ts +128 -0
  117. package/types/lunar/lib/LunarYear.d.ts +61 -0
  118. package/types/lunar/lib/ShouXingUtil.d.ts +38 -0
  119. package/types/lunar/lib/Solar.d.ts +51 -0
  120. package/types/lunar/lib/SolarHalfYear.d.ts +15 -0
  121. package/types/lunar/lib/SolarMonth.d.ts +16 -0
  122. package/types/lunar/lib/SolarSeason.d.ts +15 -0
  123. package/types/lunar/lib/SolarUtil.d.ts +20 -0
  124. package/types/lunar/lib/SolarWeek.d.ts +23 -0
  125. package/types/lunar/lib/SolarYear.d.ts +12 -0
  126. package/types/lunar/lib/index.d.ts +17 -0
  127. package/types/math/index.d.ts +11 -0
  128. package/types/md5/index.d.ts +2 -0
  129. package/types/mock/MockWebSocket.d.ts +17 -0
  130. package/types/mock/MockXMLHttpRequest.d.ts +17 -0
  131. package/types/mock/index.d.ts +2 -0
  132. package/types/normalize-wheel/ExecutionEnvironment.d.ts +9 -0
  133. package/types/normalize-wheel/UserAgent_DEPRECATED.d.ts +86 -0
  134. package/types/normalize-wheel/index.d.ts +115 -0
  135. package/types/normalize-wheel/isEventSupported.d.ts +16 -0
  136. package/types/number-to-chinese/index.d.ts +11 -0
  137. package/types/nzh/cn.d.ts +8 -0
  138. package/types/nzh/hk.d.ts +8 -0
  139. package/types/nzh/index.d.ts +1 -0
  140. package/types/nzh/nzh.d.ts +36 -0
  141. package/types/nzh/src/autoGet.d.ts +8 -0
  142. package/types/nzh/src/index.d.ts +34 -0
  143. package/types/nzh/src/langs/cn_b.d.ts +10 -0
  144. package/types/nzh/src/langs/cn_s.d.ts +7 -0
  145. package/types/nzh/src/langs/hk_b.d.ts +10 -0
  146. package/types/nzh/src/langs/hk_s.d.ts +7 -0
  147. package/types/nzh/src/utils.d.ts +65 -0
  148. package/types/object-keys-sort/index.d.ts +4 -0
  149. package/types/random/address.d.ts +8 -0
  150. package/types/random/constellation.d.ts +2 -0
  151. package/types/random/image.d.ts +5 -0
  152. package/types/random/index.d.ts +40 -0
  153. package/types/random/licensePlate.d.ts +2 -0
  154. package/types/random/name.d.ts +9 -0
  155. package/types/random/number.d.ts +6 -0
  156. package/types/random/text.d.ts +13 -0
  157. package/types/random/time.d.ts +2 -0
  158. package/types/random/web.d.ts +11 -0
  159. package/types/screenfull/index.d.ts +10 -0
  160. package/types/snapdom/index.d.ts +1 -0
  161. package/types/snapdom/src/api/preCache.d.ts +8 -0
  162. package/types/snapdom/src/api/snapdom.d.ts +26 -0
  163. package/types/snapdom/src/core/cache.d.ts +11 -0
  164. package/types/snapdom/src/core/capture.d.ts +17 -0
  165. package/types/snapdom/src/core/clone.d.ts +11 -0
  166. package/types/snapdom/src/core/prepare.d.ts +8 -0
  167. package/types/snapdom/src/index.browser.d.ts +1 -0
  168. package/types/snapdom/src/index.d.ts +2 -0
  169. package/types/snapdom/src/modules/background.d.ts +10 -0
  170. package/types/snapdom/src/modules/fonts.d.ts +23 -0
  171. package/types/snapdom/src/modules/iconFonts.d.ts +2 -0
  172. package/types/snapdom/src/modules/images.d.ts +8 -0
  173. package/types/snapdom/src/modules/pseudo.d.ts +12 -0
  174. package/types/snapdom/src/modules/styles.d.ts +1 -0
  175. package/types/snapdom/src/modules/svgDefs.d.ts +19 -0
  176. package/types/snapdom/src/utils/cssTools.d.ts +38 -0
  177. package/types/snapdom/src/utils/helpers.d.ts +71 -0
  178. package/types/tinycolor/index.d.ts +2 -0
  179. package/types/tinycolor/src/conversion.d.ts +79 -0
  180. package/types/tinycolor/src/css-color-names.d.ts +4 -0
  181. package/types/tinycolor/src/format-input.d.ts +38 -0
  182. package/types/tinycolor/src/from-ratio.d.ts +14 -0
  183. package/types/tinycolor/src/index.d.ts +214 -0
  184. package/types/tinycolor/src/interfaces.d.ts +57 -0
  185. package/types/tinycolor/src/public_api.d.ts +10 -0
  186. package/types/tinycolor/src/random.d.ts +24 -0
  187. package/types/tinycolor/src/readability.d.ts +46 -0
  188. package/types/tinycolor/src/to-ms-filter.d.ts +5 -0
  189. package/types/tinycolor/src/umd_api.d.ts +22 -0
  190. package/types/tinycolor/src/util.d.ts +36 -0
  191. package/types/tree/index.d.ts +9 -0
  192. package/types/tree/searchTree.d.ts +20 -0
  193. package/types/turbo-stream/index.d.ts +1 -0
  194. package/types/turbo-stream/src/decode.d.ts +7 -0
  195. package/types/turbo-stream/src/encode.d.ts +27 -0
  196. package/types/turbo-stream/src/shared.d.ts +107 -0
  197. package/types/turbo-stream/src/turbo-stream.d.ts +4 -0
  198. package/types/ui-color/compareColorByRange.d.ts +2 -0
  199. package/types/ui-color/index.d.ts +183 -0
  200. package/types/url-toolkit/index.d.ts +2 -0
  201. package/types/url-toolkit/src/url-toolkit.d.ts +18 -0
  202. package/ui-color/compareColorByRange.js +9 -0
  203. package/ui-color/index.js +155 -0
  204. package/uiColor.js +28 -0
  205. package/urlToolkit.js +8 -0
  206. package/dayjs/index.js +0 -15
@@ -0,0 +1,221 @@
1
+ import { TinyColor as l } from "./index.js";
2
+ function g(e = {}) {
3
+ if (e.count !== void 0 && e.count !== null) {
4
+ const a = e.count, u = [];
5
+ for (e.count = void 0; a > u.length; )
6
+ e.count = null, e.seed && (e.seed += 1), u.push(g(e));
7
+ return e.count = a, u;
8
+ }
9
+ const n = w(e.hue, e.seed), o = R(n, e), r = B(n, o, e), t = { h: n, s: o, v: r };
10
+ return e.alpha !== void 0 && (t.a = e.alpha), new l(t);
11
+ }
12
+ function w(e, n) {
13
+ const o = M(e);
14
+ let r = s(o, n);
15
+ return r < 0 && (r = 360 + r), r;
16
+ }
17
+ function R(e, n) {
18
+ if (n.hue === "monochrome")
19
+ return 0;
20
+ if (n.luminosity === "random")
21
+ return s([0, 100], n.seed);
22
+ const { saturationRange: o } = i(e);
23
+ let r = o[0], t = o[1];
24
+ switch (n.luminosity) {
25
+ case "bright":
26
+ r = 55;
27
+ break;
28
+ case "dark":
29
+ r = t - 10;
30
+ break;
31
+ case "light":
32
+ t = 55;
33
+ break;
34
+ }
35
+ return s([r, t], n.seed);
36
+ }
37
+ function B(e, n, o) {
38
+ let r = k(e, n), t = 100;
39
+ switch (o.luminosity) {
40
+ case "dark":
41
+ t = r + 20;
42
+ break;
43
+ case "light":
44
+ r = (t + r) / 2;
45
+ break;
46
+ case "random":
47
+ r = 0, t = 100;
48
+ break;
49
+ }
50
+ return s([r, t], o.seed);
51
+ }
52
+ function k(e, n) {
53
+ const { lowerBounds: o } = i(e);
54
+ for (let r = 0; r < o.length - 1; r++) {
55
+ const t = o[r][0], a = o[r][1], u = o[r + 1][0], d = o[r + 1][1];
56
+ if (n >= t && n <= u) {
57
+ const c = (d - a) / (u - t), m = a - c * t;
58
+ return c * n + m;
59
+ }
60
+ }
61
+ return 0;
62
+ }
63
+ function M(e) {
64
+ const n = parseInt(e, 10);
65
+ if (!Number.isNaN(n) && n < 360 && n > 0)
66
+ return [n, n];
67
+ if (typeof e == "string") {
68
+ const o = f.find((t) => t.name === e);
69
+ if (o) {
70
+ const t = h(o);
71
+ if (t.hueRange)
72
+ return t.hueRange;
73
+ }
74
+ const r = new l(e);
75
+ if (r.isValid) {
76
+ const t = r.toHsv().h;
77
+ return [t, t];
78
+ }
79
+ }
80
+ return [0, 360];
81
+ }
82
+ function i(e) {
83
+ e >= 334 && e <= 360 && (e -= 360);
84
+ for (const n of f) {
85
+ const o = h(n);
86
+ if (o.hueRange && e >= o.hueRange[0] && e <= o.hueRange[1])
87
+ return o;
88
+ }
89
+ throw Error("Color not found");
90
+ }
91
+ function s(e, n) {
92
+ if (n === void 0)
93
+ return Math.floor(e[0] + Math.random() * (e[1] + 1 - e[0]));
94
+ const o = e[1] || 1, r = e[0] || 0;
95
+ n = (n * 9301 + 49297) % 233280;
96
+ const t = n / 233280;
97
+ return Math.floor(r + t * (o - r));
98
+ }
99
+ function h(e) {
100
+ const n = e.lowerBounds[0][0], o = e.lowerBounds[e.lowerBounds.length - 1][0], r = e.lowerBounds[e.lowerBounds.length - 1][1], t = e.lowerBounds[0][1];
101
+ return {
102
+ name: e.name,
103
+ hueRange: e.hueRange,
104
+ lowerBounds: e.lowerBounds,
105
+ saturationRange: [n, o],
106
+ brightnessRange: [r, t]
107
+ };
108
+ }
109
+ const f = [
110
+ {
111
+ name: "monochrome",
112
+ hueRange: null,
113
+ lowerBounds: [
114
+ [0, 0],
115
+ [100, 0]
116
+ ]
117
+ },
118
+ {
119
+ name: "red",
120
+ hueRange: [-26, 18],
121
+ lowerBounds: [
122
+ [20, 100],
123
+ [30, 92],
124
+ [40, 89],
125
+ [50, 85],
126
+ [60, 78],
127
+ [70, 70],
128
+ [80, 60],
129
+ [90, 55],
130
+ [100, 50]
131
+ ]
132
+ },
133
+ {
134
+ name: "orange",
135
+ hueRange: [19, 46],
136
+ lowerBounds: [
137
+ [20, 100],
138
+ [30, 93],
139
+ [40, 88],
140
+ [50, 86],
141
+ [60, 85],
142
+ [70, 70],
143
+ [100, 70]
144
+ ]
145
+ },
146
+ {
147
+ name: "yellow",
148
+ hueRange: [47, 62],
149
+ lowerBounds: [
150
+ [25, 100],
151
+ [40, 94],
152
+ [50, 89],
153
+ [60, 86],
154
+ [70, 84],
155
+ [80, 82],
156
+ [90, 80],
157
+ [100, 75]
158
+ ]
159
+ },
160
+ {
161
+ name: "green",
162
+ hueRange: [63, 178],
163
+ lowerBounds: [
164
+ [30, 100],
165
+ [40, 90],
166
+ [50, 85],
167
+ [60, 81],
168
+ [70, 74],
169
+ [80, 64],
170
+ [90, 50],
171
+ [100, 40]
172
+ ]
173
+ },
174
+ {
175
+ name: "blue",
176
+ hueRange: [179, 257],
177
+ lowerBounds: [
178
+ [20, 100],
179
+ [30, 86],
180
+ [40, 80],
181
+ [50, 74],
182
+ [60, 60],
183
+ [70, 52],
184
+ [80, 44],
185
+ [90, 39],
186
+ [100, 35]
187
+ ]
188
+ },
189
+ {
190
+ name: "purple",
191
+ hueRange: [258, 282],
192
+ lowerBounds: [
193
+ [20, 100],
194
+ [30, 87],
195
+ [40, 79],
196
+ [50, 70],
197
+ [60, 65],
198
+ [70, 59],
199
+ [80, 52],
200
+ [90, 45],
201
+ [100, 42]
202
+ ]
203
+ },
204
+ {
205
+ name: "pink",
206
+ hueRange: [283, 334],
207
+ lowerBounds: [
208
+ [20, 100],
209
+ [30, 90],
210
+ [40, 86],
211
+ [60, 84],
212
+ [80, 80],
213
+ [90, 75],
214
+ [100, 73]
215
+ ]
216
+ }
217
+ ];
218
+ export {
219
+ f as bounds,
220
+ g as random
221
+ };
@@ -0,0 +1,37 @@
1
+ import { TinyColor as a } from "./index.js";
2
+ function i(n, t) {
3
+ const l = new a(n), e = new a(t);
4
+ return (Math.max(l.getLuminance(), e.getLuminance()) + 0.05) / (Math.min(l.getLuminance(), e.getLuminance()) + 0.05);
5
+ }
6
+ function f(n, t, l = { level: "AA", size: "small" }) {
7
+ const e = i(n, t);
8
+ switch ((l.level ?? "AA") + (l.size ?? "small")) {
9
+ case "AAsmall":
10
+ case "AAAlarge":
11
+ return e >= 4.5;
12
+ case "AAlarge":
13
+ return e >= 3;
14
+ case "AAAsmall":
15
+ return e >= 7;
16
+ default:
17
+ return !1;
18
+ }
19
+ }
20
+ function m(n, t, l = {
21
+ includeFallbackColors: !1,
22
+ level: "AA",
23
+ size: "small"
24
+ }) {
25
+ let e = null, c = 0;
26
+ const { includeFallbackColors: o, level: u, size: A } = l;
27
+ for (const s of t) {
28
+ const r = i(n, s);
29
+ r > c && (c = r, e = new a(s));
30
+ }
31
+ return f(n, e, { level: u, size: A }) || !o ? e : (l.includeFallbackColors = !1, m(n, ["#fff", "#000"], l));
32
+ }
33
+ export {
34
+ f as isReadable,
35
+ m as mostReadable,
36
+ i as readability
37
+ };
@@ -0,0 +1,15 @@
1
+ import { rgbaToArgbHex as i } from "./conversion.js";
2
+ import { TinyColor as g } from "./index.js";
3
+ function d(s, o) {
4
+ const r = new g(s), e = `#${i(r.r, r.g, r.b, r.a)}`;
5
+ let n = e;
6
+ const a = r.gradientType ? "GradientType = 1, " : "";
7
+ if (o) {
8
+ const t = new g(o);
9
+ n = `#${i(t.r, t.g, t.b, t.a)}`;
10
+ }
11
+ return `progid:DXImageTransform.Microsoft.gradient(${a}startColorstr=${e},endColorstr=${n})`;
12
+ }
13
+ export {
14
+ d as toMsFilter
15
+ };
@@ -0,0 +1,32 @@
1
+ function o(t, r) {
2
+ i(t) && (t = "100%");
3
+ const e = n(t);
4
+ return t = r === 360 ? t : Math.min(r, Math.max(0, parseFloat(t))), e && (t = parseInt(String(t * r), 10) / 100), Math.abs(t - r) < 1e-6 ? 1 : (r === 360 ? t = (t < 0 ? t % r + r : t % r) / parseFloat(String(r)) : t = t % r / parseFloat(String(r)), t);
5
+ }
6
+ function u(t) {
7
+ return Math.min(1, Math.max(0, t));
8
+ }
9
+ function i(t) {
10
+ return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1;
11
+ }
12
+ function n(t) {
13
+ return typeof t == "string" && t.indexOf("%") !== -1;
14
+ }
15
+ function f(t) {
16
+ return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
17
+ }
18
+ function s(t) {
19
+ return Number(t) <= 1 ? `${Number(t) * 100}%` : t;
20
+ }
21
+ function p(t) {
22
+ return t.length === 1 ? "0" + t : String(t);
23
+ }
24
+ export {
25
+ o as bound01,
26
+ f as boundAlpha,
27
+ u as clamp01,
28
+ s as convertToPercentage,
29
+ i as isOnePointZero,
30
+ n as isPercentage,
31
+ p as pad2
32
+ };
package/tinycolor.js ADDED
@@ -0,0 +1,46 @@
1
+ import { cmykToRgb as e, convertDecimalToHex as t, convertHexToDecimal as a, hslToRgb as n, hsvToRgb as b, numberInputToObject as m, parseIntFromHex as T, rgbToCmyk as i, rgbToHex as g, rgbToHsl as p, rgbToHsv as l, rgbToRgb as s, rgbaToArgbHex as x, rgbaToHex as c } from "./tinycolor/src/conversion.js";
2
+ import { names as f } from "./tinycolor/src/css-color-names.js";
3
+ import { inputToRGB as u, isValidCSSUnit as H, stringInputToObject as y } from "./tinycolor/src/format-input.js";
4
+ import { fromRatio as C, legacyRandom as h } from "./tinycolor/src/from-ratio.js";
5
+ import { TinyColor as O, TinyColor as P } from "./tinycolor/src/index.js";
6
+ import { bounds as k, random as A } from "./tinycolor/src/random.js";
7
+ import { isReadable as F, mostReadable as S, readability as B } from "./tinycolor/src/readability.js";
8
+ import { toMsFilter as M } from "./tinycolor/src/to-ms-filter.js";
9
+ import { bound01 as V, boundAlpha as Z, clamp01 as q, convertToPercentage as w, isOnePointZero as z, isPercentage as E, pad2 as J } from "./tinycolor/src/util.js";
10
+ export {
11
+ O as TinyColor,
12
+ V as bound01,
13
+ Z as boundAlpha,
14
+ k as bounds,
15
+ q as clamp01,
16
+ e as cmykToRgb,
17
+ t as convertDecimalToHex,
18
+ a as convertHexToDecimal,
19
+ w as convertToPercentage,
20
+ P as default,
21
+ C as fromRatio,
22
+ n as hslToRgb,
23
+ b as hsvToRgb,
24
+ u as inputToRGB,
25
+ z as isOnePointZero,
26
+ E as isPercentage,
27
+ F as isReadable,
28
+ H as isValidCSSUnit,
29
+ h as legacyRandom,
30
+ S as mostReadable,
31
+ f as names,
32
+ m as numberInputToObject,
33
+ J as pad2,
34
+ T as parseIntFromHex,
35
+ A as random,
36
+ B as readability,
37
+ i as rgbToCmyk,
38
+ g as rgbToHex,
39
+ p as rgbToHsl,
40
+ l as rgbToHsv,
41
+ s as rgbToRgb,
42
+ x as rgbaToArgbHex,
43
+ c as rgbaToHex,
44
+ y as stringInputToObject,
45
+ M as toMsFilter
46
+ };
package/tree/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { default as I } from "./searchTree.js";
1
2
  function a(e, r, f, l = "children") {
2
3
  if (Array.isArray(e) && (e = {
3
4
  [l]: e
@@ -31,7 +32,7 @@ function y(e, r, f, l = "children") {
31
32
  }
32
33
  }
33
34
  const d = a;
34
- function A(e, r, f, l = "children") {
35
+ function h(e, r, f, l = "children") {
35
36
  if (!e) return;
36
37
  const t = Array.isArray(e) ? [...e] : [e];
37
38
  e: for (; t.length; ) {
@@ -50,14 +51,14 @@ function A(e, r, f, l = "children") {
50
51
  t.push(i[u - 1 - n]);
51
52
  }
52
53
  }
53
- function h(e, r) {
54
+ function A(e, r) {
54
55
  return y(e, "id", r);
55
56
  }
56
- function g(e, r, f = !0) {
57
+ function m(e, r, f = !0) {
57
58
  let l = y(e, "value", r)?.label;
58
59
  return !l && f && (l = r), l;
59
60
  }
60
- function m(e, r, f, l = "children") {
61
+ function g(e, r, f, l = "children") {
61
62
  if (!e) return;
62
63
  let t = null;
63
64
  function i(n) {
@@ -77,10 +78,11 @@ function m(e, r, f, l = "children") {
77
78
  export {
78
79
  y as default,
79
80
  a as findNodeBy,
80
- m as getChildWithParentBy,
81
+ g as getChildWithParentBy,
81
82
  y as getItemBy,
82
83
  d as getItemBy2,
83
- A as getItemBy3,
84
- h as getItemByID,
85
- g as getLabelFromDictionaryByValue
84
+ h as getItemBy3,
85
+ A as getItemByID,
86
+ m as getLabelFromDictionaryByValue,
87
+ I as searchTree
86
88
  };
@@ -0,0 +1,54 @@
1
+ function p(o, i, a = {}) {
2
+ const {
3
+ strategy: f = "BFS",
4
+ childrenKey: c = "children",
5
+ strict: u = !1
6
+ } = a;
7
+ if (!Array.isArray(o))
8
+ throw new TypeError("treeData must be an array");
9
+ if (typeof i != "object" || i === null)
10
+ throw new TypeError("searchCondition must be an object");
11
+ const t = [...o], l = (e) => {
12
+ for (const r in i) {
13
+ if (!Object.prototype.hasOwnProperty.call(e, r))
14
+ return !1;
15
+ const n = i[r], s = e[r];
16
+ if (u) {
17
+ if (s !== n)
18
+ return !1;
19
+ } else if (n instanceof RegExp) {
20
+ if (typeof s != "string" || !n.test(s))
21
+ return !1;
22
+ } else if (typeof n == "function") {
23
+ if (!n(s))
24
+ return !1;
25
+ } else if (s != n)
26
+ return !1;
27
+ }
28
+ return !0;
29
+ };
30
+ if (f === "BFS")
31
+ for (; t.length > 0; ) {
32
+ const e = t.shift();
33
+ if (!e) continue;
34
+ if (l(e))
35
+ return e;
36
+ const r = e[c];
37
+ Array.isArray(r) && t.push(...r);
38
+ }
39
+ else if (f === "DFS")
40
+ for (; t.length > 0; ) {
41
+ const e = t.pop();
42
+ if (!e) continue;
43
+ if (l(e))
44
+ return e;
45
+ const r = e[c];
46
+ Array.isArray(r) && t.push(...r.slice().reverse());
47
+ }
48
+ else
49
+ throw new Error('Invalid strategy. Use "BFS" or "DFS"');
50
+ return null;
51
+ }
52
+ export {
53
+ p as default
54
+ };
package/tree.js ADDED
@@ -0,0 +1,13 @@
1
+ import { default as a } from "./tree/searchTree.js";
2
+ import { getItemBy as y, findNodeBy as m, getChildWithParentBy as B, getItemBy as g, getItemBy2 as o, getItemBy3 as I, getItemByID as d, getLabelFromDictionaryByValue as f } from "./tree/index.js";
3
+ export {
4
+ y as default,
5
+ m as findNodeBy,
6
+ B as getChildWithParentBy,
7
+ g as getItemBy,
8
+ o as getItemBy2,
9
+ I as getItemBy3,
10
+ d as getItemByID,
11
+ f as getLabelFromDictionaryByValue,
12
+ a as searchTree
13
+ };
package/turboStream.js ADDED
@@ -0,0 +1,6 @@
1
+ import { decode as r } from "./turbo-stream/src/decode.js";
2
+ import { encode as c } from "./turbo-stream/src/encode.js";
3
+ export {
4
+ r as decode,
5
+ c as encode
6
+ };
@@ -0,0 +1,11 @@
1
+ export default caseName;
2
+ declare function caseName(name: any): {
3
+ kebabCaseName: string;
4
+ snakeCaseName: string;
5
+ camelCaseName: string;
6
+ capitalizeName: string;
7
+ startCaseName: string;
8
+ lowerFirstCaseName: Uncapitalize<any>;
9
+ upperFirstCaseName: Capitalize<any>;
10
+ ComponentCaseName: Capitalize<string>;
11
+ };
@@ -0,0 +1,2 @@
1
+ export default className;
2
+ declare function className(...args: any[]): string;
@@ -0,0 +1,2 @@
1
+ export default clipboardCopy;
2
+ declare function clipboardCopy(text: any): Promise<void>;
@@ -0,0 +1,14 @@
1
+ export const REGION: string[];
2
+ export default ADDRESS;
3
+ declare const ADDRESS: {
4
+ id: string;
5
+ name: string;
6
+ children: {
7
+ id: string;
8
+ name: string;
9
+ children: {
10
+ id: string;
11
+ name: string;
12
+ }[];
13
+ }[];
14
+ }[];
@@ -0,0 +1,2 @@
1
+ export default CHINESE_CHARACTERS;
2
+ declare const CHINESE_CHARACTERS: "\u7684\u4E00\u662F\u5728\u4E0D\u4E86\u6709\u548C\u4EBA\u8FD9\u4E2D\u5927\u4E3A\u4E0A\u4E2A\u56FD\u6211\u4EE5\u8981\u4ED6\u65F6\u6765\u7528\u4EEC\u751F\u5230\u4F5C\u5730\u4E8E\u51FA\u5C31\u5206\u5BF9\u6210\u4F1A\u53EF\u4E3B\u53D1\u5E74\u52A8\u540C\u5DE5\u4E5F\u80FD\u4E0B\u8FC7\u5B50\u8BF4\u4EA7\u79CD\u9762\u800C\u65B9\u540E\u591A\u5B9A\u884C\u5B66\u6CD5\u6240\u6C11\u5F97\u7ECF\u5341\u4E09\u4E4B\u8FDB\u7740\u7B49\u90E8\u5EA6\u5BB6\u7535\u529B\u91CC\u5982\u6C34\u5316\u9AD8\u81EA\u4E8C\u7406\u8D77\u5C0F\u7269\u73B0\u5B9E\u52A0\u91CF\u90FD\u4E24\u4F53\u5236\u673A\u5F53\u4F7F\u70B9\u4ECE\u4E1A\u672C\u53BB\u628A\u6027\u597D\u5E94\u5F00\u5B83\u5408\u8FD8\u56E0\u7531\u5176\u4E9B\u7136\u524D\u5916\u5929\u653F\u56DB\u65E5\u90A3\u793E\u4E49\u4E8B\u5E73\u5F62\u76F8\u5168\u8868\u95F4\u6837\u4E0E\u5173\u5404\u91CD\u65B0\u7EBF\u5185\u6570\u6B63\u5FC3\u53CD\u4F60\u660E\u770B\u539F\u53C8\u4E48\u5229\u6BD4\u6216\u4F46\u8D28\u6C14\u7B2C\u5411\u9053\u547D\u6B64\u53D8\u6761\u53EA\u6CA1\u7ED3\u89E3\u95EE\u610F\u5EFA\u6708\u516C\u65E0\u7CFB\u519B\u5F88\u60C5\u8005\u6700\u7ACB\u4EE3\u60F3\u5DF2\u901A\u5E76\u63D0\u76F4\u9898\u515A\u7A0B\u5C55\u4E94\u679C\u6599\u8C61\u5458\u9769\u4F4D\u5165\u5E38\u6587\u603B\u6B21\u54C1\u5F0F\u6D3B\u8BBE\u53CA\u7BA1\u7279\u4EF6\u957F\u6C42\u8001\u5934\u57FA\u8D44\u8FB9\u6D41\u8DEF\u7EA7\u5C11\u56FE\u5C71\u7EDF\u63A5\u77E5\u8F83\u5C06\u7EC4\u89C1\u8BA1\u522B\u5979\u624B\u89D2\u671F\u6839\u8BBA\u8FD0\u519C\u6307\u51E0\u4E5D\u533A\u5F3A\u653E\u51B3\u897F\u88AB\u5E72\u505A\u5FC5\u6218\u5148\u56DE\u5219\u4EFB\u53D6\u636E\u5904\u961F\u5357\u7ED9\u8272\u5149\u95E8\u5373\u4FDD\u6CBB\u5317\u9020\u767E\u89C4\u70ED\u9886\u4E03\u6D77\u53E3\u4E1C\u5BFC\u5668\u538B\u5FD7\u4E16\u91D1\u589E\u4E89\u6D4E\u9636\u6CB9\u601D\u672F\u6781\u4EA4\u53D7\u8054\u4EC0\u8BA4\u516D\u5171\u6743\u6536\u8BC1\u6539\u6E05\u5DF1\u7F8E\u518D\u91C7\u8F6C\u66F4\u5355\u98CE\u5207\u6253\u767D\u6559\u901F\u82B1\u5E26\u5B89\u573A\u8EAB\u8F66\u4F8B\u771F\u52A1\u5177\u4E07\u6BCF\u76EE\u81F3\u8FBE\u8D70\u79EF\u793A\u8BAE\u58F0\u62A5\u6597\u5B8C\u7C7B\u516B\u79BB\u534E\u540D\u786E\u624D\u79D1\u5F20\u4FE1\u9A6C\u8282\u8BDD\u7C73\u6574\u7A7A\u5143\u51B5\u4ECA\u96C6\u6E29\u4F20\u571F\u8BB8\u6B65\u7FA4\u5E7F\u77F3\u8BB0\u9700\u6BB5\u7814\u754C\u62C9\u6797\u5F8B\u53EB\u4E14\u7A76\u89C2\u8D8A\u7EC7\u88C5\u5F71\u7B97\u4F4E\u6301\u97F3\u4F17\u4E66\u5E03\u590D\u5BB9\u513F\u987B\u9645\u5546\u975E\u9A8C\u8FDE\u65AD\u6DF1\u96BE\u8FD1\u77FF\u5343\u5468\u59D4\u7D20\u6280\u5907\u534A\u529E\u9752\u7701\u5217\u4E60\u54CD\u7EA6\u652F\u822C\u53F2\u611F\u52B3\u4FBF\u56E2\u5F80\u9178\u5386\u5E02\u514B\u4F55\u9664\u6D88\u6784\u5E9C\u79F0\u592A\u51C6\u7CBE\u503C\u53F7\u7387\u65CF\u7EF4\u5212\u9009\u6807\u5199\u5B58\u5019\u6BDB\u4EB2\u5FEB\u6548\u65AF\u9662\u67E5\u6C5F\u578B\u773C\u738B\u6309\u683C\u517B\u6613\u7F6E\u6D3E\u5C42\u7247\u59CB\u5374\u4E13\u72B6\u80B2\u5382\u4EAC\u8BC6\u9002\u5C5E\u5706\u5305\u706B\u4F4F\u8C03\u6EE1\u53BF\u5C40\u7167\u53C2\u7EA2\u7EC6\u5F15\u542C\u8BE5\u94C1\u4EF7\u4E25\u9F99\u98DE";
@@ -0,0 +1,2 @@
1
+ export default CONSTELLATIONS;
2
+ declare const CONSTELLATIONS: string[];
@@ -0,0 +1,2 @@
1
+ export default DOMAIN;
2
+ declare const DOMAIN: string[];
@@ -0,0 +1,2 @@
1
+ export default IDENTITYS;
2
+ declare const IDENTITYS: string[];
@@ -0,0 +1 @@
1
+ export const MATCH_MEDIA_PREFERS_COLOR_SCHEME_DARK: MediaQueryList;
@@ -0,0 +1,158 @@
1
+ export namespace Enter {
2
+ let key: string;
3
+ let code: string;
4
+ let keyCode: number;
5
+ }
6
+ export namespace Esc {
7
+ let key_1: string;
8
+ export { key_1 as key };
9
+ let code_1: string;
10
+ export { code_1 as code };
11
+ let keyCode_1: number;
12
+ export { keyCode_1 as keyCode };
13
+ }
14
+ export namespace Escape { }
15
+ export namespace Backspace {
16
+ let key_2: string;
17
+ export { key_2 as key };
18
+ let code_2: string;
19
+ export { code_2 as code };
20
+ let keyCode_2: number;
21
+ export { keyCode_2 as keyCode };
22
+ }
23
+ export namespace Tab {
24
+ let key_3: string;
25
+ export { key_3 as key };
26
+ let code_3: string;
27
+ export { code_3 as code };
28
+ let keyCode_3: number;
29
+ export { keyCode_3 as keyCode };
30
+ }
31
+ export namespace Space {
32
+ let key_4: string;
33
+ export { key_4 as key };
34
+ let code_4: string;
35
+ export { code_4 as code };
36
+ let keyCode_4: number;
37
+ export { keyCode_4 as keyCode };
38
+ }
39
+ export namespace ArrowLeft {
40
+ let key_5: string;
41
+ export { key_5 as key };
42
+ let code_5: string;
43
+ export { code_5 as code };
44
+ let keyCode_5: number;
45
+ export { keyCode_5 as keyCode };
46
+ }
47
+ export namespace ArrowUp {
48
+ let key_6: string;
49
+ export { key_6 as key };
50
+ let code_6: string;
51
+ export { code_6 as code };
52
+ let keyCode_6: number;
53
+ export { keyCode_6 as keyCode };
54
+ }
55
+ export namespace ArrowRight {
56
+ let key_7: string;
57
+ export { key_7 as key };
58
+ let code_7: string;
59
+ export { code_7 as code };
60
+ let keyCode_7: number;
61
+ export { keyCode_7 as keyCode };
62
+ }
63
+ export namespace ArrowDown {
64
+ let key_8: string;
65
+ export { key_8 as key };
66
+ let code_8: string;
67
+ export { code_8 as code };
68
+ let keyCode_8: number;
69
+ export { keyCode_8 as keyCode };
70
+ }
71
+ export namespace CapsLock {
72
+ let key_9: string;
73
+ export { key_9 as key };
74
+ let code_9: string;
75
+ export { code_9 as code };
76
+ let keyCode_9: number;
77
+ export { keyCode_9 as keyCode };
78
+ }
79
+ export namespace Meta {
80
+ let key_10: string;
81
+ export { key_10 as key };
82
+ }
83
+ export namespace MetaLeft {
84
+ let key_11: string;
85
+ export { key_11 as key };
86
+ let code_10: string;
87
+ export { code_10 as code };
88
+ let keyCode_10: number;
89
+ export { keyCode_10 as keyCode };
90
+ }
91
+ export namespace MetaRight {
92
+ let key_12: string;
93
+ export { key_12 as key };
94
+ let code_11: string;
95
+ export { code_11 as code };
96
+ let keyCode_11: number;
97
+ export { keyCode_11 as keyCode };
98
+ }
99
+ export namespace Control {
100
+ let key_13: string;
101
+ export { key_13 as key };
102
+ }
103
+ export namespace ControlLeft {
104
+ let key_14: string;
105
+ export { key_14 as key };
106
+ let code_12: string;
107
+ export { code_12 as code };
108
+ let keyCode_12: number;
109
+ export { keyCode_12 as keyCode };
110
+ }
111
+ export namespace ControlRight {
112
+ let key_15: string;
113
+ export { key_15 as key };
114
+ let code_13: string;
115
+ export { code_13 as code };
116
+ let keyCode_13: number;
117
+ export { keyCode_13 as keyCode };
118
+ }
119
+ export namespace Alt {
120
+ let key_16: string;
121
+ export { key_16 as key };
122
+ }
123
+ export namespace AltLeft {
124
+ let key_17: string;
125
+ export { key_17 as key };
126
+ let code_14: string;
127
+ export { code_14 as code };
128
+ let keyCode_14: number;
129
+ export { keyCode_14 as keyCode };
130
+ }
131
+ export namespace AltRight {
132
+ let key_18: string;
133
+ export { key_18 as key };
134
+ let code_15: string;
135
+ export { code_15 as code };
136
+ let keyCode_15: number;
137
+ export { keyCode_15 as keyCode };
138
+ }
139
+ export namespace Shift {
140
+ let key_19: string;
141
+ export { key_19 as key };
142
+ }
143
+ export namespace ShiftLeft {
144
+ let key_20: string;
145
+ export { key_20 as key };
146
+ let code_16: string;
147
+ export { code_16 as code };
148
+ let keyCode_16: number;
149
+ export { keyCode_16 as keyCode };
150
+ }
151
+ export namespace ShiftRight {
152
+ let key_21: string;
153
+ export { key_21 as key };
154
+ let code_17: string;
155
+ export { code_17 as code };
156
+ let keyCode_17: number;
157
+ export { keyCode_17 as keyCode };
158
+ }