@kne/file-system-view 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1907 @@
1
+ var React = require('react');
2
+ var antd = require('antd');
3
+ var reactIntl = require('@kne/react-intl');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n["default"] = e;
23
+ return n;
24
+ }
25
+
26
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
27
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
+
29
+ const locale$1 = {
30
+ empty: '暂无文件'
31
+ };
32
+
33
+ const locale = {
34
+ empty: 'No files'
35
+ };
36
+
37
+ const withLocale = reactIntl.createWithIntlProvider({
38
+ defaultLocale: 'zh-CN',
39
+ messages: {
40
+ 'zh-CN': locale$1,
41
+ 'en-US': locale
42
+ },
43
+ namespace: 'file-system-view'
44
+ });
45
+
46
+ var style = {"file-system-view":"_qMhn9","tree-node":"_t015K","action-btn":"_mLgqh","node-icon":"_dgomj","node-title":"_r6Ngq","node-name":"_st428","node-ext":"_POSao","empty":"_4zeDm"};
47
+
48
+ const IconContext = /*#__PURE__*/React.createContext({});
49
+ var Context = IconContext;
50
+
51
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
52
+
53
+ // 36 Hex to reduce the size of the file
54
+ var presetColors = {
55
+ aliceblue: '9ehhb',
56
+ antiquewhite: '9sgk7',
57
+ aqua: '1ekf',
58
+ aquamarine: '4zsno',
59
+ azure: '9eiv3',
60
+ beige: '9lhp8',
61
+ bisque: '9zg04',
62
+ black: '0',
63
+ blanchedalmond: '9zhe5',
64
+ blue: '73',
65
+ blueviolet: '5e31e',
66
+ brown: '6g016',
67
+ burlywood: '8ouiv',
68
+ cadetblue: '3qba8',
69
+ chartreuse: '4zshs',
70
+ chocolate: '87k0u',
71
+ coral: '9yvyo',
72
+ cornflowerblue: '3xael',
73
+ cornsilk: '9zjz0',
74
+ crimson: '8l4xo',
75
+ cyan: '1ekf',
76
+ darkblue: '3v',
77
+ darkcyan: 'rkb',
78
+ darkgoldenrod: '776yz',
79
+ darkgray: '6mbhl',
80
+ darkgreen: 'jr4',
81
+ darkgrey: '6mbhl',
82
+ darkkhaki: '7ehkb',
83
+ darkmagenta: '5f91n',
84
+ darkolivegreen: '3bzfz',
85
+ darkorange: '9yygw',
86
+ darkorchid: '5z6x8',
87
+ darkred: '5f8xs',
88
+ darksalmon: '9441m',
89
+ darkseagreen: '5lwgf',
90
+ darkslateblue: '2th1n',
91
+ darkslategray: '1ugcv',
92
+ darkslategrey: '1ugcv',
93
+ darkturquoise: '14up',
94
+ darkviolet: '5rw7n',
95
+ deeppink: '9yavn',
96
+ deepskyblue: '11xb',
97
+ dimgray: '442g9',
98
+ dimgrey: '442g9',
99
+ dodgerblue: '16xof',
100
+ firebrick: '6y7tu',
101
+ floralwhite: '9zkds',
102
+ forestgreen: '1cisi',
103
+ fuchsia: '9y70f',
104
+ gainsboro: '8m8kc',
105
+ ghostwhite: '9pq0v',
106
+ goldenrod: '8j4f4',
107
+ gold: '9zda8',
108
+ gray: '50i2o',
109
+ green: 'pa8',
110
+ greenyellow: '6senj',
111
+ grey: '50i2o',
112
+ honeydew: '9eiuo',
113
+ hotpink: '9yrp0',
114
+ indianred: '80gnw',
115
+ indigo: '2xcoy',
116
+ ivory: '9zldc',
117
+ khaki: '9edu4',
118
+ lavenderblush: '9ziet',
119
+ lavender: '90c8q',
120
+ lawngreen: '4vk74',
121
+ lemonchiffon: '9zkct',
122
+ lightblue: '6s73a',
123
+ lightcoral: '9dtog',
124
+ lightcyan: '8s1rz',
125
+ lightgoldenrodyellow: '9sjiq',
126
+ lightgray: '89jo3',
127
+ lightgreen: '5nkwg',
128
+ lightgrey: '89jo3',
129
+ lightpink: '9z6wx',
130
+ lightsalmon: '9z2ii',
131
+ lightseagreen: '19xgq',
132
+ lightskyblue: '5arju',
133
+ lightslategray: '4nwk9',
134
+ lightslategrey: '4nwk9',
135
+ lightsteelblue: '6wau6',
136
+ lightyellow: '9zlcw',
137
+ lime: '1edc',
138
+ limegreen: '1zcxe',
139
+ linen: '9shk6',
140
+ magenta: '9y70f',
141
+ maroon: '4zsow',
142
+ mediumaquamarine: '40eju',
143
+ mediumblue: '5p',
144
+ mediumorchid: '79qkz',
145
+ mediumpurple: '5r3rv',
146
+ mediumseagreen: '2d9ip',
147
+ mediumslateblue: '4tcku',
148
+ mediumspringgreen: '1di2',
149
+ mediumturquoise: '2uabw',
150
+ mediumvioletred: '7rn9h',
151
+ midnightblue: 'z980',
152
+ mintcream: '9ljp6',
153
+ mistyrose: '9zg0x',
154
+ moccasin: '9zfzp',
155
+ navajowhite: '9zest',
156
+ navy: '3k',
157
+ oldlace: '9wq92',
158
+ olive: '50hz4',
159
+ olivedrab: '472ub',
160
+ orange: '9z3eo',
161
+ orangered: '9ykg0',
162
+ orchid: '8iu3a',
163
+ palegoldenrod: '9bl4a',
164
+ palegreen: '5yw0o',
165
+ paleturquoise: '6v4ku',
166
+ palevioletred: '8k8lv',
167
+ papayawhip: '9zi6t',
168
+ peachpuff: '9ze0p',
169
+ peru: '80oqn',
170
+ pink: '9z8wb',
171
+ plum: '8nba5',
172
+ powderblue: '6wgdi',
173
+ purple: '4zssg',
174
+ rebeccapurple: '3zk49',
175
+ red: '9y6tc',
176
+ rosybrown: '7cv4f',
177
+ royalblue: '2jvtt',
178
+ saddlebrown: '5fmkz',
179
+ salmon: '9rvci',
180
+ sandybrown: '9jn1c',
181
+ seagreen: '1tdnb',
182
+ seashell: '9zje6',
183
+ sienna: '6973h',
184
+ silver: '7ir40',
185
+ skyblue: '5arjf',
186
+ slateblue: '45e4t',
187
+ slategray: '4e100',
188
+ slategrey: '4e100',
189
+ snow: '9zke2',
190
+ springgreen: '1egv',
191
+ steelblue: '2r1kk',
192
+ tan: '87yx8',
193
+ teal: 'pds',
194
+ thistle: '8ggk8',
195
+ tomato: '9yqfb',
196
+ turquoise: '2j4r4',
197
+ violet: '9b10u',
198
+ wheat: '9ld4j',
199
+ white: '9zldr',
200
+ whitesmoke: '9lhpx',
201
+ yellow: '9zl6o',
202
+ yellowgreen: '61fzm'
203
+ };
204
+
205
+ const round = Math.round;
206
+
207
+ /**
208
+ * Support format, alpha unit will check the % mark:
209
+ * - rgba(102, 204, 255, .5) -> [102, 204, 255, 0.5]
210
+ * - rgb(102 204 255 / .5) -> [102, 204, 255, 0.5]
211
+ * - rgb(100%, 50%, 0% / 50%) -> [255, 128, 0, 0.5]
212
+ * - hsl(270, 60, 40, .5) -> [270, 60, 40, 0.5]
213
+ * - hsl(270deg 60% 40% / 50%) -> [270, 60, 40, 0.5]
214
+ *
215
+ * When `base` is provided, the percentage value will be divided by `base`.
216
+ */
217
+ function splitColorStr(str, parseNum) {
218
+ const match = str
219
+ // Remove str before `(`
220
+ .replace(/^[^(]*\((.*)/, '$1')
221
+ // Remove str after `)`
222
+ .replace(/\).*/, '').match(/\d*\.?\d+%?/g) || [];
223
+ const numList = match.map(item => parseFloat(item));
224
+ for (let i = 0; i < 3; i += 1) {
225
+ numList[i] = parseNum(numList[i] || 0, match[i] || '', i);
226
+ }
227
+
228
+ // For alpha. 50% should be 0.5
229
+ if (match[3]) {
230
+ numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];
231
+ } else {
232
+ // By default, alpha is 1
233
+ numList[3] = 1;
234
+ }
235
+ return numList;
236
+ }
237
+ const parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
238
+
239
+ /** round and limit number to integer between 0-255 */
240
+ function limitRange(value, max) {
241
+ const mergedMax = max || 255;
242
+ if (value > mergedMax) {
243
+ return mergedMax;
244
+ }
245
+ if (value < 0) {
246
+ return 0;
247
+ }
248
+ return value;
249
+ }
250
+ class FastColor {
251
+ /**
252
+ * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
253
+ */
254
+ isValid = true;
255
+
256
+ /**
257
+ * Red, R in RGB
258
+ */
259
+ r = 0;
260
+
261
+ /**
262
+ * Green, G in RGB
263
+ */
264
+ g = 0;
265
+
266
+ /**
267
+ * Blue, B in RGB
268
+ */
269
+ b = 0;
270
+
271
+ /**
272
+ * Alpha/Opacity, A in RGBA/HSLA
273
+ */
274
+ a = 1;
275
+
276
+ // HSV privates
277
+ _h;
278
+ _hsl_s;
279
+ _hsv_s;
280
+ _l;
281
+ _v;
282
+
283
+ // intermediate variables to calculate HSL/HSV
284
+ _max;
285
+ _min;
286
+ _brightness;
287
+ constructor(input) {
288
+ /**
289
+ * Always check 3 char in the object to determine the format.
290
+ * We not use function in check to save bundle size.
291
+ * e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.
292
+ */
293
+ function matchFormat(str) {
294
+ return str[0] in input && str[1] in input && str[2] in input;
295
+ }
296
+ if (!input) ; else if (typeof input === 'string') {
297
+ const trimStr = input.trim();
298
+ function matchPrefix(prefix) {
299
+ return trimStr.startsWith(prefix);
300
+ }
301
+ if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
302
+ this.fromHexString(trimStr);
303
+ } else if (matchPrefix('rgb')) {
304
+ this.fromRgbString(trimStr);
305
+ } else if (matchPrefix('hsl')) {
306
+ this.fromHslString(trimStr);
307
+ } else if (matchPrefix('hsv') || matchPrefix('hsb')) {
308
+ this.fromHsvString(trimStr);
309
+ } else {
310
+ // From preset color
311
+ const presetColor = presetColors[trimStr.toLowerCase()];
312
+ if (presetColor) {
313
+ this.fromHexString(
314
+ // Convert 36 hex to 16 hex
315
+ parseInt(presetColor, 36).toString(16).padStart(6, '0'));
316
+ }
317
+ }
318
+ } else if (input instanceof FastColor) {
319
+ this.r = input.r;
320
+ this.g = input.g;
321
+ this.b = input.b;
322
+ this.a = input.a;
323
+ this._h = input._h;
324
+ this._hsl_s = input._hsl_s;
325
+ this._hsv_s = input._hsv_s;
326
+ this._l = input._l;
327
+ this._v = input._v;
328
+ } else if (matchFormat('rgb')) {
329
+ this.r = limitRange(input.r);
330
+ this.g = limitRange(input.g);
331
+ this.b = limitRange(input.b);
332
+ this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;
333
+ } else if (matchFormat('hsl')) {
334
+ this.fromHsl(input);
335
+ } else if (matchFormat('hsv')) {
336
+ this.fromHsv(input);
337
+ } else {
338
+ throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));
339
+ }
340
+ }
341
+
342
+ // ======================= Setter =======================
343
+
344
+ setR(value) {
345
+ return this._sc('r', value);
346
+ }
347
+ setG(value) {
348
+ return this._sc('g', value);
349
+ }
350
+ setB(value) {
351
+ return this._sc('b', value);
352
+ }
353
+ setA(value) {
354
+ return this._sc('a', value, 1);
355
+ }
356
+ setHue(value) {
357
+ const hsv = this.toHsv();
358
+ hsv.h = value;
359
+ return this._c(hsv);
360
+ }
361
+
362
+ // ======================= Getter =======================
363
+ /**
364
+ * Returns the perceived luminance of a color, from 0-1.
365
+ * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
366
+ */
367
+ getLuminance() {
368
+ function adjustGamma(raw) {
369
+ const val = raw / 255;
370
+ return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
371
+ }
372
+ const R = adjustGamma(this.r);
373
+ const G = adjustGamma(this.g);
374
+ const B = adjustGamma(this.b);
375
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
376
+ }
377
+ getHue() {
378
+ if (typeof this._h === 'undefined') {
379
+ const delta = this.getMax() - this.getMin();
380
+ if (delta === 0) {
381
+ this._h = 0;
382
+ } else {
383
+ this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
384
+ }
385
+ }
386
+ return this._h;
387
+ }
388
+
389
+ /**
390
+ * @deprecated should use getHSVSaturation or getHSLSaturation instead
391
+ */
392
+ getSaturation() {
393
+ return this.getHSVSaturation();
394
+ }
395
+ getHSVSaturation() {
396
+ if (typeof this._hsv_s === 'undefined') {
397
+ const delta = this.getMax() - this.getMin();
398
+ if (delta === 0) {
399
+ this._hsv_s = 0;
400
+ } else {
401
+ this._hsv_s = delta / this.getMax();
402
+ }
403
+ }
404
+ return this._hsv_s;
405
+ }
406
+ getHSLSaturation() {
407
+ if (typeof this._hsl_s === 'undefined') {
408
+ const delta = this.getMax() - this.getMin();
409
+ if (delta === 0) {
410
+ this._hsl_s = 0;
411
+ } else {
412
+ const l = this.getLightness();
413
+ this._hsl_s = delta / 255 / (1 - Math.abs(2 * l - 1));
414
+ }
415
+ }
416
+ return this._hsl_s;
417
+ }
418
+ getLightness() {
419
+ if (typeof this._l === 'undefined') {
420
+ this._l = (this.getMax() + this.getMin()) / 510;
421
+ }
422
+ return this._l;
423
+ }
424
+ getValue() {
425
+ if (typeof this._v === 'undefined') {
426
+ this._v = this.getMax() / 255;
427
+ }
428
+ return this._v;
429
+ }
430
+
431
+ /**
432
+ * Returns the perceived brightness of the color, from 0-255.
433
+ * Note: this is not the b of HSB
434
+ * @see http://www.w3.org/TR/AERT#color-contrast
435
+ */
436
+ getBrightness() {
437
+ if (typeof this._brightness === 'undefined') {
438
+ this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;
439
+ }
440
+ return this._brightness;
441
+ }
442
+
443
+ // ======================== Func ========================
444
+
445
+ darken(amount = 10) {
446
+ const h = this.getHue();
447
+ const s = this.getSaturation();
448
+ let l = this.getLightness() - amount / 100;
449
+ if (l < 0) {
450
+ l = 0;
451
+ }
452
+ return this._c({
453
+ h,
454
+ s,
455
+ l,
456
+ a: this.a
457
+ });
458
+ }
459
+ lighten(amount = 10) {
460
+ const h = this.getHue();
461
+ const s = this.getSaturation();
462
+ let l = this.getLightness() + amount / 100;
463
+ if (l > 1) {
464
+ l = 1;
465
+ }
466
+ return this._c({
467
+ h,
468
+ s,
469
+ l,
470
+ a: this.a
471
+ });
472
+ }
473
+
474
+ /**
475
+ * Mix the current color a given amount with another color, from 0 to 100.
476
+ * 0 means no mixing (return current color).
477
+ */
478
+ mix(input, amount = 50) {
479
+ const color = this._c(input);
480
+ const p = amount / 100;
481
+ const calc = key => (color[key] - this[key]) * p + this[key];
482
+ const rgba = {
483
+ r: round(calc('r')),
484
+ g: round(calc('g')),
485
+ b: round(calc('b')),
486
+ a: round(calc('a') * 100) / 100
487
+ };
488
+ return this._c(rgba);
489
+ }
490
+
491
+ /**
492
+ * Mix the color with pure white, from 0 to 100.
493
+ * Providing 0 will do nothing, providing 100 will always return white.
494
+ */
495
+ tint(amount = 10) {
496
+ return this.mix({
497
+ r: 255,
498
+ g: 255,
499
+ b: 255,
500
+ a: 1
501
+ }, amount);
502
+ }
503
+
504
+ /**
505
+ * Mix the color with pure black, from 0 to 100.
506
+ * Providing 0 will do nothing, providing 100 will always return black.
507
+ */
508
+ shade(amount = 10) {
509
+ return this.mix({
510
+ r: 0,
511
+ g: 0,
512
+ b: 0,
513
+ a: 1
514
+ }, amount);
515
+ }
516
+ onBackground(background) {
517
+ const bg = this._c(background);
518
+ const alpha = this.a + bg.a * (1 - this.a);
519
+ const calc = key => {
520
+ return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
521
+ };
522
+ return this._c({
523
+ r: calc('r'),
524
+ g: calc('g'),
525
+ b: calc('b'),
526
+ a: alpha
527
+ });
528
+ }
529
+
530
+ // ======================= Status =======================
531
+ isDark() {
532
+ return this.getBrightness() < 128;
533
+ }
534
+ isLight() {
535
+ return this.getBrightness() >= 128;
536
+ }
537
+
538
+ // ======================== MISC ========================
539
+ equals(other) {
540
+ return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
541
+ }
542
+ clone() {
543
+ return this._c(this);
544
+ }
545
+
546
+ // ======================= Format =======================
547
+ toHexString() {
548
+ let hex = '#';
549
+ const rHex = (this.r || 0).toString(16);
550
+ hex += rHex.length === 2 ? rHex : '0' + rHex;
551
+ const gHex = (this.g || 0).toString(16);
552
+ hex += gHex.length === 2 ? gHex : '0' + gHex;
553
+ const bHex = (this.b || 0).toString(16);
554
+ hex += bHex.length === 2 ? bHex : '0' + bHex;
555
+ if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {
556
+ const aHex = round(this.a * 255).toString(16);
557
+ hex += aHex.length === 2 ? aHex : '0' + aHex;
558
+ }
559
+ return hex;
560
+ }
561
+
562
+ /** CSS support color pattern */
563
+ toHsl() {
564
+ return {
565
+ h: this.getHue(),
566
+ s: this.getHSLSaturation(),
567
+ l: this.getLightness(),
568
+ a: this.a
569
+ };
570
+ }
571
+
572
+ /** CSS support color pattern */
573
+ toHslString() {
574
+ const h = this.getHue();
575
+ const s = round(this.getHSLSaturation() * 100);
576
+ const l = round(this.getLightness() * 100);
577
+ return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
578
+ }
579
+
580
+ /** Same as toHsb */
581
+ toHsv() {
582
+ return {
583
+ h: this.getHue(),
584
+ s: this.getHSVSaturation(),
585
+ v: this.getValue(),
586
+ a: this.a
587
+ };
588
+ }
589
+ toRgb() {
590
+ return {
591
+ r: this.r,
592
+ g: this.g,
593
+ b: this.b,
594
+ a: this.a
595
+ };
596
+ }
597
+ toRgbString() {
598
+ return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
599
+ }
600
+ toString() {
601
+ return this.toRgbString();
602
+ }
603
+
604
+ // ====================== Privates ======================
605
+ /** Return a new FastColor object with one channel changed */
606
+ _sc(rgb, value, max) {
607
+ const clone = this.clone();
608
+ clone[rgb] = limitRange(value, max);
609
+ return clone;
610
+ }
611
+ _c(input) {
612
+ return new this.constructor(input);
613
+ }
614
+ getMax() {
615
+ if (typeof this._max === 'undefined') {
616
+ this._max = Math.max(this.r, this.g, this.b);
617
+ }
618
+ return this._max;
619
+ }
620
+ getMin() {
621
+ if (typeof this._min === 'undefined') {
622
+ this._min = Math.min(this.r, this.g, this.b);
623
+ }
624
+ return this._min;
625
+ }
626
+ fromHexString(trimStr) {
627
+ const withoutPrefix = trimStr.replace('#', '');
628
+ function connectNum(index1, index2) {
629
+ return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
630
+ }
631
+ if (withoutPrefix.length < 6) {
632
+ // #rgb or #rgba
633
+ this.r = connectNum(0);
634
+ this.g = connectNum(1);
635
+ this.b = connectNum(2);
636
+ this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
637
+ } else {
638
+ // #rrggbb or #rrggbbaa
639
+ this.r = connectNum(0, 1);
640
+ this.g = connectNum(2, 3);
641
+ this.b = connectNum(4, 5);
642
+ this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
643
+ }
644
+ }
645
+ fromHsl({
646
+ h: _h,
647
+ s,
648
+ l,
649
+ a
650
+ }) {
651
+ const h = (_h % 360 + 360) % 360;
652
+ this._h = h;
653
+ this._hsl_s = s;
654
+ this._l = l;
655
+ this.a = typeof a === 'number' ? a : 1;
656
+ if (s <= 0) {
657
+ const rgb = round(l * 255);
658
+ this.r = rgb;
659
+ this.g = rgb;
660
+ this.b = rgb;
661
+ return;
662
+ }
663
+ let r = 0,
664
+ g = 0,
665
+ b = 0;
666
+ const huePrime = h / 60;
667
+ const chroma = (1 - Math.abs(2 * l - 1)) * s;
668
+ const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
669
+ if (huePrime >= 0 && huePrime < 1) {
670
+ r = chroma;
671
+ g = secondComponent;
672
+ } else if (huePrime >= 1 && huePrime < 2) {
673
+ r = secondComponent;
674
+ g = chroma;
675
+ } else if (huePrime >= 2 && huePrime < 3) {
676
+ g = chroma;
677
+ b = secondComponent;
678
+ } else if (huePrime >= 3 && huePrime < 4) {
679
+ g = secondComponent;
680
+ b = chroma;
681
+ } else if (huePrime >= 4 && huePrime < 5) {
682
+ r = secondComponent;
683
+ b = chroma;
684
+ } else if (huePrime >= 5 && huePrime < 6) {
685
+ r = chroma;
686
+ b = secondComponent;
687
+ }
688
+ const lightnessModification = l - chroma / 2;
689
+ this.r = round((r + lightnessModification) * 255);
690
+ this.g = round((g + lightnessModification) * 255);
691
+ this.b = round((b + lightnessModification) * 255);
692
+ }
693
+ fromHsv({
694
+ h: _h,
695
+ s,
696
+ v,
697
+ a
698
+ }) {
699
+ const h = (_h % 360 + 360) % 360;
700
+ this._h = h;
701
+ this._hsv_s = s;
702
+ this._v = v;
703
+ this.a = typeof a === 'number' ? a : 1;
704
+ const vv = round(v * 255);
705
+ this.r = vv;
706
+ this.g = vv;
707
+ this.b = vv;
708
+ if (s <= 0) {
709
+ return;
710
+ }
711
+ const hh = h / 60;
712
+ const i = Math.floor(hh);
713
+ const ff = hh - i;
714
+ const p = round(v * (1.0 - s) * 255);
715
+ const q = round(v * (1.0 - s * ff) * 255);
716
+ const t = round(v * (1.0 - s * (1.0 - ff)) * 255);
717
+ switch (i) {
718
+ case 0:
719
+ this.g = t;
720
+ this.b = p;
721
+ break;
722
+ case 1:
723
+ this.r = q;
724
+ this.b = p;
725
+ break;
726
+ case 2:
727
+ this.r = p;
728
+ this.b = t;
729
+ break;
730
+ case 3:
731
+ this.r = p;
732
+ this.g = q;
733
+ break;
734
+ case 4:
735
+ this.r = t;
736
+ this.g = p;
737
+ break;
738
+ case 5:
739
+ default:
740
+ this.g = p;
741
+ this.b = q;
742
+ break;
743
+ }
744
+ }
745
+ fromHsvString(trimStr) {
746
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
747
+ this.fromHsv({
748
+ h: cells[0],
749
+ s: cells[1],
750
+ v: cells[2],
751
+ a: cells[3]
752
+ });
753
+ }
754
+ fromHslString(trimStr) {
755
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
756
+ this.fromHsl({
757
+ h: cells[0],
758
+ s: cells[1],
759
+ l: cells[2],
760
+ a: cells[3]
761
+ });
762
+ }
763
+ fromRgbString(trimStr) {
764
+ const cells = splitColorStr(trimStr, (num, txt) =>
765
+ // Convert percentage to number. e.g. 50% -> 128
766
+ txt.includes('%') ? round(num / 100 * 255) : num);
767
+ this.r = cells[0];
768
+ this.g = cells[1];
769
+ this.b = cells[2];
770
+ this.a = cells[3];
771
+ }
772
+ }
773
+
774
+ const hueStep = 2; // 色相阶梯
775
+ const saturationStep = 0.16; // 饱和度阶梯,浅色部分
776
+ const saturationStep2 = 0.05; // 饱和度阶梯,深色部分
777
+ const brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
778
+ const brightnessStep2 = 0.15; // 亮度阶梯,深色部分
779
+ const lightColorCount = 5; // 浅色数量,主色上
780
+ const darkColorCount = 4; // 深色数量,主色下
781
+
782
+ // 暗色主题颜色映射关系表
783
+ const darkColorMap = [{
784
+ index: 7,
785
+ amount: 15
786
+ }, {
787
+ index: 6,
788
+ amount: 25
789
+ }, {
790
+ index: 5,
791
+ amount: 30
792
+ }, {
793
+ index: 5,
794
+ amount: 45
795
+ }, {
796
+ index: 5,
797
+ amount: 65
798
+ }, {
799
+ index: 5,
800
+ amount: 85
801
+ }, {
802
+ index: 4,
803
+ amount: 90
804
+ }, {
805
+ index: 3,
806
+ amount: 95
807
+ }, {
808
+ index: 2,
809
+ amount: 97
810
+ }, {
811
+ index: 1,
812
+ amount: 98
813
+ }];
814
+ function getHue(hsv, i, light) {
815
+ let hue;
816
+ // 根据色相不同,色相转向不同
817
+ if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
818
+ hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
819
+ } else {
820
+ hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
821
+ }
822
+ if (hue < 0) {
823
+ hue += 360;
824
+ } else if (hue >= 360) {
825
+ hue -= 360;
826
+ }
827
+ return hue;
828
+ }
829
+ function getSaturation(hsv, i, light) {
830
+ // grey color don't change saturation
831
+ if (hsv.h === 0 && hsv.s === 0) {
832
+ return hsv.s;
833
+ }
834
+ let saturation;
835
+ if (light) {
836
+ saturation = hsv.s - saturationStep * i;
837
+ } else if (i === darkColorCount) {
838
+ saturation = hsv.s + saturationStep;
839
+ } else {
840
+ saturation = hsv.s + saturationStep2 * i;
841
+ }
842
+ // 边界值修正
843
+ if (saturation > 1) {
844
+ saturation = 1;
845
+ }
846
+ // 第一格的 s 限制在 0.06-0.1 之间
847
+ if (light && i === lightColorCount && saturation > 0.1) {
848
+ saturation = 0.1;
849
+ }
850
+ if (saturation < 0.06) {
851
+ saturation = 0.06;
852
+ }
853
+ return Math.round(saturation * 100) / 100;
854
+ }
855
+ function getValue(hsv, i, light) {
856
+ let value;
857
+ if (light) {
858
+ value = hsv.v + brightnessStep1 * i;
859
+ } else {
860
+ value = hsv.v - brightnessStep2 * i;
861
+ }
862
+ // Clamp value between 0 and 1
863
+ value = Math.max(0, Math.min(1, value));
864
+ return Math.round(value * 100) / 100;
865
+ }
866
+ function generate$1(color, opts = {}) {
867
+ const patterns = [];
868
+ const pColor = new FastColor(color);
869
+ const hsv = pColor.toHsv();
870
+ for (let i = lightColorCount; i > 0; i -= 1) {
871
+ const c = new FastColor({
872
+ h: getHue(hsv, i, true),
873
+ s: getSaturation(hsv, i, true),
874
+ v: getValue(hsv, i, true)
875
+ });
876
+ patterns.push(c);
877
+ }
878
+ patterns.push(pColor);
879
+ for (let i = 1; i <= darkColorCount; i += 1) {
880
+ const c = new FastColor({
881
+ h: getHue(hsv, i),
882
+ s: getSaturation(hsv, i),
883
+ v: getValue(hsv, i)
884
+ });
885
+ patterns.push(c);
886
+ }
887
+
888
+ // dark theme patterns
889
+ if (opts.theme === 'dark') {
890
+ return darkColorMap.map(({
891
+ index,
892
+ amount
893
+ }) => new FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString());
894
+ }
895
+ return patterns.map(c => c.toHexString());
896
+ }
897
+
898
+ // Generated by script. Do NOT modify!
899
+ const blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
900
+ blue.primary = blue[5];
901
+
902
+ function canUseDom() {
903
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
904
+ }
905
+
906
+ function contains(root, n) {
907
+ if (!root) {
908
+ return false;
909
+ }
910
+
911
+ // Use native if support
912
+ if (root.contains) {
913
+ return root.contains(n);
914
+ }
915
+
916
+ // `document.contains` not support with IE11
917
+ let node = n;
918
+ while (node) {
919
+ if (node === root) {
920
+ return true;
921
+ }
922
+ node = node.parentNode;
923
+ }
924
+ return false;
925
+ }
926
+
927
+ const APPEND_ORDER = 'data-rc-order';
928
+ const APPEND_PRIORITY = 'data-rc-priority';
929
+ const MARK_KEY = `rc-util-key`;
930
+ const containerCache = new Map();
931
+ function getMark({
932
+ mark
933
+ } = {}) {
934
+ if (mark) {
935
+ return mark.startsWith('data-') ? mark : `data-${mark}`;
936
+ }
937
+ return MARK_KEY;
938
+ }
939
+ function getContainer(option) {
940
+ if (option.attachTo) {
941
+ return option.attachTo;
942
+ }
943
+ const head = document.querySelector('head');
944
+ return head || document.body;
945
+ }
946
+ function getOrder(prepend) {
947
+ if (prepend === 'queue') {
948
+ return 'prependQueue';
949
+ }
950
+ return prepend ? 'prepend' : 'append';
951
+ }
952
+
953
+ /**
954
+ * Find style which inject by rc-util
955
+ */
956
+ function findStyles(container) {
957
+ return Array.from((containerCache.get(container) || container).children).filter(node => node.tagName === 'STYLE');
958
+ }
959
+ function injectCSS(css, option = {}) {
960
+ if (!canUseDom()) {
961
+ return null;
962
+ }
963
+ const {
964
+ csp,
965
+ prepend,
966
+ priority = 0
967
+ } = option;
968
+ const mergedOrder = getOrder(prepend);
969
+ const isPrependQueue = mergedOrder === 'prependQueue';
970
+ const styleNode = document.createElement('style');
971
+ styleNode.setAttribute(APPEND_ORDER, mergedOrder);
972
+ if (isPrependQueue && priority) {
973
+ styleNode.setAttribute(APPEND_PRIORITY, `${priority}`);
974
+ }
975
+ if (csp?.nonce) {
976
+ styleNode.nonce = csp?.nonce;
977
+ }
978
+ styleNode.innerHTML = css;
979
+ const container = getContainer(option);
980
+ const {
981
+ firstChild
982
+ } = container;
983
+ if (prepend) {
984
+ // If is queue `prepend`, it will prepend first style and then append rest style
985
+ if (isPrependQueue) {
986
+ const existStyle = (option.styles || findStyles(container)).filter(node => {
987
+ // Ignore style which not injected by rc-util with prepend
988
+ if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {
989
+ return false;
990
+ }
991
+
992
+ // Ignore style which priority less then new style
993
+ const nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
994
+ return priority >= nodePriority;
995
+ });
996
+ if (existStyle.length) {
997
+ container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
998
+ return styleNode;
999
+ }
1000
+ }
1001
+
1002
+ // Use `insertBefore` as `prepend`
1003
+ container.insertBefore(styleNode, firstChild);
1004
+ } else {
1005
+ container.appendChild(styleNode);
1006
+ }
1007
+ return styleNode;
1008
+ }
1009
+ function findExistNode(key, option = {}) {
1010
+ let {
1011
+ styles
1012
+ } = option;
1013
+ styles ||= findStyles(getContainer(option));
1014
+ return styles.find(node => node.getAttribute(getMark(option)) === key);
1015
+ }
1016
+
1017
+ /**
1018
+ * qiankun will inject `appendChild` to insert into other
1019
+ */
1020
+ function syncRealContainer(container, option) {
1021
+ const cachedRealContainer = containerCache.get(container);
1022
+
1023
+ // Find real container when not cached or cached container removed
1024
+ if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
1025
+ const placeholderStyle = injectCSS('', option);
1026
+ const {
1027
+ parentNode
1028
+ } = placeholderStyle;
1029
+ containerCache.set(container, parentNode);
1030
+ container.removeChild(placeholderStyle);
1031
+ }
1032
+ }
1033
+ function updateCSS(css, key, originOption = {}) {
1034
+ const container = getContainer(originOption);
1035
+ const styles = findStyles(container);
1036
+ const option = {
1037
+ ...originOption,
1038
+ styles
1039
+ };
1040
+
1041
+ // Sync real parent
1042
+ syncRealContainer(container, option);
1043
+ const existNode = findExistNode(key, option);
1044
+ if (existNode) {
1045
+ if (option.csp?.nonce && existNode.nonce !== option.csp?.nonce) {
1046
+ existNode.nonce = option.csp?.nonce;
1047
+ }
1048
+ if (existNode.innerHTML !== css) {
1049
+ existNode.innerHTML = css;
1050
+ }
1051
+ return existNode;
1052
+ }
1053
+ const newNode = injectCSS(css, option);
1054
+ newNode.setAttribute(getMark(option), key);
1055
+ return newNode;
1056
+ }
1057
+
1058
+ function getRoot(ele) {
1059
+ return ele?.getRootNode?.();
1060
+ }
1061
+
1062
+ /**
1063
+ * Check if is in shadowRoot
1064
+ */
1065
+ function inShadow(ele) {
1066
+ return getRoot(ele) instanceof ShadowRoot;
1067
+ }
1068
+
1069
+ /**
1070
+ * Return shadowRoot if possible
1071
+ */
1072
+ function getShadowRoot(ele) {
1073
+ return inShadow(ele) ? getRoot(ele) : null;
1074
+ }
1075
+
1076
+ /* eslint-disable no-console */
1077
+ let warned = {};
1078
+ const preWarningFns = [];
1079
+
1080
+ /**
1081
+ * Pre warning enable you to parse content before console.error.
1082
+ * Modify to null will prevent warning.
1083
+ */
1084
+ const preMessage = fn => {
1085
+ preWarningFns.push(fn);
1086
+ };
1087
+
1088
+ /**
1089
+ * Warning if condition not match.
1090
+ * @param valid Condition
1091
+ * @param message Warning message
1092
+ * @example
1093
+ * ```js
1094
+ * warning(false, 'some error'); // print some error
1095
+ * warning(true, 'some error'); // print nothing
1096
+ * warning(1 === 2, 'some error'); // print some error
1097
+ * ```
1098
+ */
1099
+ function warning$1(valid, message) {
1100
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
1101
+ const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? '', 'warning'), message);
1102
+ if (finalMessage) {
1103
+ console.error(`Warning: ${finalMessage}`);
1104
+ }
1105
+ }
1106
+ }
1107
+
1108
+ /** @see Similar to {@link warning} */
1109
+ function note(valid, message) {
1110
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
1111
+ const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? '', 'note'), message);
1112
+ if (finalMessage) {
1113
+ console.warn(`Note: ${finalMessage}`);
1114
+ }
1115
+ }
1116
+ }
1117
+ function resetWarned() {
1118
+ warned = {};
1119
+ }
1120
+ function call(method, valid, message) {
1121
+ if (!valid && !warned[message]) {
1122
+ method(false, message);
1123
+ warned[message] = true;
1124
+ }
1125
+ }
1126
+
1127
+ /** @see Same as {@link warning}, but only warn once for the same message */
1128
+ function warningOnce(valid, message) {
1129
+ call(warning$1, valid, message);
1130
+ }
1131
+
1132
+ /** @see Same as {@link warning}, but only warn once for the same message */
1133
+ function noteOnce(valid, message) {
1134
+ call(note, valid, message);
1135
+ }
1136
+ warningOnce.preMessage = preMessage;
1137
+ warningOnce.resetWarned = resetWarned;
1138
+ warningOnce.noteOnce = noteOnce;
1139
+
1140
+ function camelCase(input) {
1141
+ return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
1142
+ }
1143
+ function warning(valid, message) {
1144
+ warningOnce(valid, `[@ant-design/icons] ${message}`);
1145
+ }
1146
+ function isIconDefinition(target) {
1147
+ return typeof target === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (typeof target.icon === 'object' || typeof target.icon === 'function');
1148
+ }
1149
+ function normalizeAttrs(attrs = {}) {
1150
+ return Object.keys(attrs).reduce((acc, key) => {
1151
+ const val = attrs[key];
1152
+ switch (key) {
1153
+ case 'class':
1154
+ acc.className = val;
1155
+ delete acc.class;
1156
+ break;
1157
+ default:
1158
+ delete acc[key];
1159
+ acc[camelCase(key)] = val;
1160
+ }
1161
+ return acc;
1162
+ }, {});
1163
+ }
1164
+ function generate(node, key, rootProps) {
1165
+ if (!rootProps) {
1166
+ return /*#__PURE__*/React__default["default"].createElement(node.tag, {
1167
+ key,
1168
+ ...normalizeAttrs(node.attrs)
1169
+ }, (node.children || []).map((child, index) => generate(child, `${key}-${node.tag}-${index}`)));
1170
+ }
1171
+ return /*#__PURE__*/React__default["default"].createElement(node.tag, {
1172
+ key,
1173
+ ...normalizeAttrs(node.attrs),
1174
+ ...rootProps
1175
+ }, (node.children || []).map((child, index) => generate(child, `${key}-${node.tag}-${index}`)));
1176
+ }
1177
+ function getSecondaryColor(primaryColor) {
1178
+ // choose the second color
1179
+ return generate$1(primaryColor)[0];
1180
+ }
1181
+ function normalizeTwoToneColors(twoToneColor) {
1182
+ if (!twoToneColor) {
1183
+ return [];
1184
+ }
1185
+ return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
1186
+ }
1187
+ const iconStyles = `
1188
+ .anticon {
1189
+ display: inline-flex;
1190
+ align-items: center;
1191
+ color: inherit;
1192
+ font-style: normal;
1193
+ line-height: 0;
1194
+ text-align: center;
1195
+ text-transform: none;
1196
+ vertical-align: -0.125em;
1197
+ text-rendering: optimizeLegibility;
1198
+ -webkit-font-smoothing: antialiased;
1199
+ -moz-osx-font-smoothing: grayscale;
1200
+ }
1201
+
1202
+ .anticon > * {
1203
+ line-height: 1;
1204
+ }
1205
+
1206
+ .anticon svg {
1207
+ display: inline-block;
1208
+ vertical-align: inherit;
1209
+ }
1210
+
1211
+ .anticon::before {
1212
+ display: none;
1213
+ }
1214
+
1215
+ .anticon .anticon-icon {
1216
+ display: block;
1217
+ }
1218
+
1219
+ .anticon[tabindex] {
1220
+ cursor: pointer;
1221
+ }
1222
+
1223
+ .anticon-spin::before,
1224
+ .anticon-spin {
1225
+ display: inline-block;
1226
+ -webkit-animation: loadingCircle 1s infinite linear;
1227
+ animation: loadingCircle 1s infinite linear;
1228
+ }
1229
+
1230
+ @-webkit-keyframes loadingCircle {
1231
+ 100% {
1232
+ -webkit-transform: rotate(360deg);
1233
+ transform: rotate(360deg);
1234
+ }
1235
+ }
1236
+
1237
+ @keyframes loadingCircle {
1238
+ 100% {
1239
+ -webkit-transform: rotate(360deg);
1240
+ transform: rotate(360deg);
1241
+ }
1242
+ }
1243
+ `;
1244
+ const useInsertStyles = eleRef => {
1245
+ const {
1246
+ csp,
1247
+ prefixCls,
1248
+ layer
1249
+ } = React.useContext(Context);
1250
+ let mergedStyleStr = iconStyles;
1251
+ if (prefixCls) {
1252
+ mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
1253
+ }
1254
+ if (layer) {
1255
+ mergedStyleStr = `@layer ${layer} {\n${mergedStyleStr}\n}`;
1256
+ }
1257
+ React.useEffect(() => {
1258
+ const ele = eleRef.current;
1259
+ const shadowRoot = getShadowRoot(ele);
1260
+ updateCSS(mergedStyleStr, '@ant-design-icons', {
1261
+ prepend: !layer,
1262
+ csp,
1263
+ attachTo: shadowRoot
1264
+ });
1265
+ }, []);
1266
+ };
1267
+
1268
+ const twoToneColorPalette = {
1269
+ primaryColor: '#333',
1270
+ secondaryColor: '#E6E6E6',
1271
+ calculated: false
1272
+ };
1273
+ function setTwoToneColors({
1274
+ primaryColor,
1275
+ secondaryColor
1276
+ }) {
1277
+ twoToneColorPalette.primaryColor = primaryColor;
1278
+ twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
1279
+ twoToneColorPalette.calculated = !!secondaryColor;
1280
+ }
1281
+ function getTwoToneColors() {
1282
+ return {
1283
+ ...twoToneColorPalette
1284
+ };
1285
+ }
1286
+ const IconBase$1 = props => {
1287
+ const {
1288
+ icon,
1289
+ className,
1290
+ onClick,
1291
+ style,
1292
+ primaryColor,
1293
+ secondaryColor,
1294
+ ...restProps
1295
+ } = props;
1296
+ const svgRef = React__namespace.useRef(null);
1297
+ let colors = twoToneColorPalette;
1298
+ if (primaryColor) {
1299
+ colors = {
1300
+ primaryColor,
1301
+ secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
1302
+ };
1303
+ }
1304
+ useInsertStyles(svgRef);
1305
+ warning(isIconDefinition(icon), `icon should be icon definiton, but got ${icon}`);
1306
+ if (!isIconDefinition(icon)) {
1307
+ return null;
1308
+ }
1309
+ let target = icon;
1310
+ if (target && typeof target.icon === 'function') {
1311
+ target = {
1312
+ ...target,
1313
+ icon: target.icon(colors.primaryColor, colors.secondaryColor)
1314
+ };
1315
+ }
1316
+ return generate(target.icon, `svg-${target.name}`, {
1317
+ className,
1318
+ onClick,
1319
+ style,
1320
+ 'data-icon': target.name,
1321
+ width: '1em',
1322
+ height: '1em',
1323
+ fill: 'currentColor',
1324
+ 'aria-hidden': 'true',
1325
+ ...restProps,
1326
+ ref: svgRef
1327
+ });
1328
+ };
1329
+ IconBase$1.displayName = 'IconReact';
1330
+ IconBase$1.getTwoToneColors = getTwoToneColors;
1331
+ IconBase$1.setTwoToneColors = setTwoToneColors;
1332
+ var ReactIcon = IconBase$1;
1333
+
1334
+ function setTwoToneColor(twoToneColor) {
1335
+ const [primaryColor, secondaryColor] = normalizeTwoToneColors(twoToneColor);
1336
+ return ReactIcon.setTwoToneColors({
1337
+ primaryColor,
1338
+ secondaryColor
1339
+ });
1340
+ }
1341
+ function getTwoToneColor() {
1342
+ const colors = ReactIcon.getTwoToneColors();
1343
+ if (!colors.calculated) {
1344
+ return colors.primaryColor;
1345
+ }
1346
+ return [colors.primaryColor, colors.secondaryColor];
1347
+ }
1348
+
1349
+ function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
1350
+ // Initial setting
1351
+ // should move it to antd main repo?
1352
+ setTwoToneColor(blue.primary);
1353
+
1354
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-488848720
1355
+
1356
+ const Icon = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
1357
+ const {
1358
+ // affect outter <i>...</i>
1359
+ className,
1360
+ // affect inner <svg>...</svg>
1361
+ icon,
1362
+ spin,
1363
+ rotate,
1364
+ tabIndex,
1365
+ onClick,
1366
+ // other
1367
+ twoToneColor,
1368
+ ...restProps
1369
+ } = props;
1370
+ const {
1371
+ prefixCls = 'anticon',
1372
+ rootClassName
1373
+ } = React__namespace.useContext(Context);
1374
+ const classString = clsx(rootClassName, prefixCls, {
1375
+ [`${prefixCls}-${icon.name}`]: !!icon.name,
1376
+ [`${prefixCls}-spin`]: !!spin || icon.name === 'loading'
1377
+ }, className);
1378
+ let iconTabIndex = tabIndex;
1379
+ if (iconTabIndex === undefined && onClick) {
1380
+ iconTabIndex = -1;
1381
+ }
1382
+ const svgStyle = rotate ? {
1383
+ msTransform: `rotate(${rotate}deg)`,
1384
+ transform: `rotate(${rotate}deg)`
1385
+ } : undefined;
1386
+ const [primaryColor, secondaryColor] = normalizeTwoToneColors(twoToneColor);
1387
+ return /*#__PURE__*/React__namespace.createElement("span", _extends$1({
1388
+ role: "img",
1389
+ "aria-label": icon.name
1390
+ }, restProps, {
1391
+ ref: ref,
1392
+ tabIndex: iconTabIndex,
1393
+ onClick: onClick,
1394
+ className: classString
1395
+ }), /*#__PURE__*/React__namespace.createElement(ReactIcon, {
1396
+ icon: icon,
1397
+ primaryColor: primaryColor,
1398
+ secondaryColor: secondaryColor,
1399
+ style: svgStyle
1400
+ }));
1401
+ });
1402
+ Icon.getTwoToneColor = getTwoToneColor;
1403
+ Icon.setTwoToneColor = setTwoToneColor;
1404
+ if (process.env.NODE_ENV !== 'production') {
1405
+ Icon.displayName = 'AntdIcon';
1406
+ }
1407
+ var AntdIcon = Icon;
1408
+
1409
+ // This icon file is generated automatically.
1410
+ var MoreOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, "name": "more", "theme": "outlined" };
1411
+ var MoreOutlinedSvg = MoreOutlined$2;
1412
+
1413
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1414
+ const MoreOutlined = (props, ref) => /*#__PURE__*/React__namespace.createElement(AntdIcon, _extends({}, props, {
1415
+ ref: ref,
1416
+ icon: MoreOutlinedSvg
1417
+ }));
1418
+
1419
+ /**![more](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQ1NiAyMzFhNTYgNTYgMCAxMDExMiAwIDU2IDU2IDAgMTAtMTEyIDB6bTAgMjgwYTU2IDU2IDAgMTAxMTIgMCA1NiA1NiAwIDEwLTExMiAwem0wIDI4MGE1NiA1NiAwIDEwMTEyIDAgNTYgNTYgMCAxMC0xMTIgMHoiIC8+PC9zdmc+) */
1420
+ const RefIcon = /*#__PURE__*/React__namespace.forwardRef(MoreOutlined);
1421
+ if (process.env.NODE_ENV !== 'production') {
1422
+ RefIcon.displayName = 'MoreOutlined';
1423
+ }
1424
+ var MoreOutlined$1 = RefIcon;
1425
+
1426
+ const IconBase = /*#__PURE__*/React.forwardRef(({
1427
+ size = '1em',
1428
+ color = 'currentColor',
1429
+ children,
1430
+ ...props
1431
+ }, ref) => /*#__PURE__*/jsxRuntime.jsx("svg", {
1432
+ ref: ref,
1433
+ xmlns: "http://www.w3.org/2000/svg",
1434
+ width: size,
1435
+ height: size,
1436
+ fill: color,
1437
+ viewBox: "0 0 256 256",
1438
+ ...props,
1439
+ children: children
1440
+ }));
1441
+ IconBase.displayName = 'IconBase';
1442
+
1443
+ // Helper to create icon component
1444
+ const createIcon = (path, displayName) => {
1445
+ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/jsxRuntime.jsx(IconBase, {
1446
+ ref: ref,
1447
+ ...props,
1448
+ children: /*#__PURE__*/jsxRuntime.jsx("path", {
1449
+ d: path
1450
+ })
1451
+ }));
1452
+ Icon.displayName = displayName;
1453
+ return Icon;
1454
+ };
1455
+
1456
+ // Folder icons
1457
+ const Folder = createIcon('M216,72H131.31L104,44.69A15.86,15.86,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.4,15.4,0,0,0,39.38,216H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40ZM216,200H40V88H216Z', 'Folder');
1458
+ const FolderOpen = createIcon('M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z', 'FolderOpen');
1459
+
1460
+ // File icons
1461
+ const File = createIcon('M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z', 'File');
1462
+ const FileText = createIcon('M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z', 'FileText');
1463
+ const FilePdf = createIcon('M224,152a8,8,0,0,1-8,8H192v16h16a8,8,0,0,1,0,16H192v16a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8h32A8,8,0,0,1,224,152ZM92,172a28,28,0,0,1-28,28H56v8a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8H64A28,28,0,0,1,92,172Zm-16,0a12,12,0,0,0-12-12H56v24h8A12,12,0,0,0,76,172Zm88,8a36,36,0,0,1-36,36H112a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8h16A36,36,0,0,1,164,180Zm-16,0a20,20,0,0,0-20-20h-8v40h8A20,20,0,0,0,148,180ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.69L160,51.31Z', 'FilePdf');
1464
+ const FileDoc = createIcon('M52,144H36a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8H52a36,36,0,0,0,0-72Zm0,56H44V160h8a20,20,0,0,1,0,40Zm169.53-4.91a8,8,0,0,1,.25,11.31A30.06,30.06,0,0,1,200,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,200,160c-8.82,0-16,9-16,20s7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,221.53,195.09ZM128,144c-17.65,0-32,16.15-32,36s14.35,36,32,36,32-16.15,32-36S145.65,144,128,144Zm0,56c-8.82,0-16-9-16-20s7.18-20,16-20,16,9,16,20S136.82,200,128,200ZM48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Z', 'FileDoc');
1465
+ const FileXls = createIcon('M156,208a8,8,0,0,1-8,8H120a8,8,0,0,1-8-8V152a8,8,0,0,1,16,0v48h20A8,8,0,0,1,156,208ZM92.65,145.49a8,8,0,0,0-11.16,1.86L68,166.24,54.51,147.35a8,8,0,1,0-13,9.3L58.17,180,41.49,203.35a8,8,0,0,0,13,9.3L68,193.76l13.49,18.89a8,8,0,0,0,13-9.3L77.83,180l16.68-23.35A8,8,0,0,0,92.65,145.49Zm98.94,25.82c-4-1.16-8.14-2.35-10.45-3.84-1.25-.82-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.72,19.82-.56a8,8,0,0,0,4.07-15.48c-2.11-.55-21-5.22-32.83,2.76a20.58,20.58,0,0,0-8.95,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.33-2.15,3.93-4.6,3.06-15.16,1.55-19.54.35A8,8,0,0,0,173.93,214a60.63,60.63,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.81,20.81,0,0,0,9.18-15.23C218,179,201.48,174.17,191.59,171.31ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,1,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.68L160,51.31Z', 'FileXls');
1466
+ const FilePng = createIcon('M60,144H44a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40H52V160h8a12,12,0,0,1,0,24Zm164,16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,200,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.45,29.45,0,0,1,16.48,5.11,8,8,0,0,1-9,13.27A13.21,13.21,0,0,0,200,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.57,13.57,0,0,0,8-2.72V192a8,8,0,0,1,0-16h8a8,8,0,0,1,8,8ZM156,152v56a8,8,0,0,1-5.56,7.62A7.91,7.91,0,0,1,148,216a8,8,0,0,1-6.51-3.35L116,177v31a8,8,0,0,1-16,0V152a8,8,0,0,1,14.51-4.65L140,183V152a8,8,0,0,1,16,0ZM48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Z', 'FilePng');
1467
+ const FileJpg = createIcon('M120,144H104a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40h-8V160h8a12,12,0,0,1,0,24Zm96,0v16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.38,29.38,0,0,1,16.48,5.12,8,8,0,0,1-9,13.26A13.21,13.21,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.63,13.63,0,0,0,8-2.71V192a8,8,0,0,1,0-16h8A8,8,0,0,1,216,184ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,80V51.31L188.69,80Z', 'FileJpg');
1468
+ const FileSvg = createIcon('M87.82,196.31a20.82,20.82,0,0,1-9.19,15.23C73.44,215,67,216,61.14,216A61.23,61.23,0,0,1,46,214a8,8,0,0,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.55,20.55,0,0,1,9-14.95c11.84-8,30.72-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.48-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.11.9-.14,1.09,1.12,1.9,2.31,1.49,6.44,2.68,10.45,3.84C73.5,174.17,90.06,179,87.82,196.31ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,1,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.65,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm-13.3,64.47a8,8,0,0,0-10.23,4.84L124,184.21l-12.47-34.9a8,8,0,1,0-15.06,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,146.7,144.47ZM208,176h-8a8,8,0,0,0,0,16v5.29a13.38,13.38,0,0,1-8,2.71c-8.82,0-16-9-16-20s7.18-20,16-20a13.27,13.27,0,0,1,7.53,2.38,8,8,0,0,0,8.95-13.26A29.38,29.38,0,0,0,192,144c-17.64,0-32,16.15-32,36s14.36,36,32,36a30.06,30.06,0,0,0,21.78-9.6,8,8,0,0,0,2.22-5.53V184A8,8,0,0,0,208,176Z', 'FileSvg');
1469
+ const FileGif = createIcon('M144,72V184a8,8,0,0,1-16,0V72a8,8,0,0,1,16,0Zm88-8H176a8,8,0,0,0-8,8V184a8,8,0,0,0,16,0V136h40a8,8,0,0,0,0-16H184V80h48a8,8,0,0,0,0-16ZM96,120H72a8,8,0,0,0,0,16H88v16a24,24,0,0,1-48,0V104A24,24,0,0,1,64,80c11.19,0,21.61,7.74,24.25,18a8,8,0,0,0,15.5-4C99.27,76.62,82.56,64,64,64a40,40,0,0,0-40,40v48a40,40,0,0,0,80,0V128A8,8,0,0,0,96,120Z', 'FileGif');
1470
+ const FileVideo = createIcon('M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM155.88,145a8,8,0,0,0-8.12.22l-19.95,12.46A16,16,0,0,0,112,144H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h64a16,16,0,0,0,15.81-13.68l19.95,12.46A8,8,0,0,0,160,216V152A8,8,0,0,0,155.88,145ZM112,208H48V160h64v48Zm32-6.43-16-10V176.43l16-10Z', 'FileVideo');
1471
+ const FileAudio = createIcon('M99.06,128.61a8,8,0,0,0-8.72,1.73L68.69,152H48a8,8,0,0,0-8,8v40a8,8,0,0,0,8,8H68.69l21.65,21.66A8,8,0,0,0,104,224V136A8,8,0,0,0,99.06,128.61ZM88,204.69,77.66,194.34A8,8,0,0,0,72,192H56V168H72a8,8,0,0,0,5.66-2.34L88,155.31ZM152,180a40.55,40.55,0,0,1-20,34.91A8,8,0,0,1,124,201.09a24.49,24.49,0,0,0,0-42.18A8,8,0,0,1,132,145.09,40.55,40.55,0,0,1,152,180Zm61.66-97.66-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v80a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H168a8,8,0,0,0,0,16h32a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Z', 'FileAudio');
1472
+ const FileCode = createIcon('M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z', 'FileCode');
1473
+ const FileZip = createIcon('M184,144H168a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40h-8V160h8a12,12,0,0,1,0,24Zm-48-32v56a8,8,0,0,1-16,0V152a8,8,0,0,1,16,0ZM96,208a8,8,0,0,1-8,8H56a8,8,0,0,1-7-12l25.16-44H56a8,8,0,0,1,0-16H88a8,8,0,0,1,7,12L69.79,200H88A8,8,0,0,1,96,208ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,80V51.31L188.69,80Z', 'FileZip');
1474
+ const FileMarkdown = createIcon('M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V224a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM144,144H128a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h16a36,36,0,0,0,0-72Zm0,56h-8V160h8a20,20,0,0,1,0,40Zm-40-48v56a8,8,0,0,1-16,0V177.38L74.55,196.59a8,8,0,0,1-13.1,0L48,177.38V208a8,8,0,0,1-16,0V152a8,8,0,0,1,14.55-4.59L68,178.05l21.45-30.64A8,8,0,0,1,104,152Z', 'FileMarkdown');
1475
+ const FileJs = createIcon('M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H176a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-12.19,145a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A61.14,61.14,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0Z', 'FileJs');
1476
+ const FileJsx = createIcon('M147.81,196.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a60.63,60.63,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.58,20.58,0,0,1,9-14.95c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.08,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM72,144a8,8,0,0,0-8,8v38a10,10,0,0,1-20,0,8,8,0,0,0-16,0,26,26,0,0,0,52,0V152A8,8,0,0,0,72,144Zm140.65,1.49a8,8,0,0,0-11.16,1.86L188,166.24l-13.49-18.89a8,8,0,0,0-13,9.3L178.17,180l-16.68,23.35a8,8,0,0,0,13,9.3L188,193.76l13.49,18.89a8,8,0,0,0,13-9.3L197.83,180l16.68-23.35A8,8,0,0,0,212.65,145.49ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z', 'FileJsx');
1477
+ const FileTs = createIcon('M147.81,196.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a61.34,61.34,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.34-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM216,88V216a16,16,0,0,1-16,16H176a8,8,0,0,1,0-16h24V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,144H40a8,8,0,0,0,0,16H52v48a8,8,0,0,0,16,0V160H80a8,8,0,0,0,0-16Z', 'FileTs');
1478
+ const FileTsx = createIcon('M214.51,156.65,197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,13-9.3L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM123.6,171.31c-4-1.16-8.14-2.35-10.45-3.84-1.25-.82-1.23-1-1.11-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56A8,8,0,0,0,138,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.33-2.14,3.93-4.6,3.06-15.17,1.56-19.55.35A8,8,0,0,0,105.94,214a60.63,60.63,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C150,179,133.49,174.17,123.6,171.31ZM80,144H40a8,8,0,0,0,0,16H52v48a8,8,0,0,0,16,0V160H80a8,8,0,0,0,0-16ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z', 'FileTsx');
1479
+ const FileCss = createIcon('M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,1,1,85.77,206.4,30,30,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30,30,0,0,1,21.77,9.6,8,8,0,1,1-11.55,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.26-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56a8,8,0,0,0,4.07-15.48c-2.12-.55-21-5.22-32.83,2.76a20.55,20.55,0,0,0-9,14.95c-2,15.88,13.64,20.41,23,23.11,12.07,3.49,13.13,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36a8,8,0,0,0-4.3,15.41,61.23,61.23,0,0,0,15.18,2c5.83,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.48,174.17,127.6,171.31Zm64,0c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56a8,8,0,0,0,4.07-15.48c-2.11-.55-21-5.22-32.83,2.76a20.58,20.58,0,0,0-8.95,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.15,3.93-4.6,3.06-15.16,1.56-19.54.36A8,8,0,0,0,173.93,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.81,20.81,0,0,0,9.18-15.23C218,179,201.48,174.17,191.59,171.31ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,1,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.68L160,51.31Z', 'FileCss');
1480
+ const FileHtml = createIcon('M216,120V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v80a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v24a8,8,0,0,0,16,0ZM160,51.31,188.69,80H160ZM68,160v48a8,8,0,0,1-16,0V192H32v16a8,8,0,0,1-16,0V160a8,8,0,0,1,16,0v16H52V160a8,8,0,0,1,16,0Zm56,0a8,8,0,0,1-8,8h-8v40a8,8,0,0,1-16,0V168H84a8,8,0,0,1,0-16h32A8,8,0,0,1,124,160Zm72,0v48a8,8,0,0,1-16,0V184l-9.6,12.8a8,8,0,0,1-12.8,0L148,184v24a8,8,0,0,1-16,0V160a8,8,0,0,1,14.4-4.8L164,178.67l17.6-23.47A8,8,0,0,1,196,160Zm56,48a8,8,0,0,1-8,8H216a8,8,0,0,1-8-8V160a8,8,0,0,1,16,0v40h20A8,8,0,0,1,252,208Z', 'FileHtml');
1481
+ const FileVue = createIcon('M87.54,154.69l-20,56a8,8,0,0,1-15.07,0l-20-56a8,8,0,0,1,15.07-5.38L60,184.21l12.47-34.9a8,8,0,0,1,15.07,5.38ZM208,160a8,8,0,0,0,0-16H176a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h32a8,8,0,0,0,0-16H184V188h16a8,8,0,0,0,0-16H184V160Zm-64-16a8,8,0,0,0-8,8v38a10,10,0,0,1-20,0V152a8,8,0,0,0-16,0v38a26,26,0,0,0,52,0V152A8,8,0,0,0,144,144Zm72-56v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z', 'FileVue');
1482
+ const FilePy = createIcon('M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H168a8,8,0,0,0,0,16h32a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM64,144H48a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40H56V160h8a12,12,0,0,1,0,24Zm90.78-27.76-18.78,30V208a8,8,0,0,1-16,0V186.29l-18.78-30a8,8,0,1,1,13.56-8.48L128,168.91l13.22-21.15a8,8,0,1,1,13.56,8.48Z', 'FilePy');
1483
+ const FileRs = createIcon('M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H184a8,8,0,0,0,0,16h16a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM64,144H48a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28.48,28.48,0,0,0,5.73-.59L77.09,212A8,8,0,0,0,90.91,204L83.8,191.78A28,28,0,0,0,64,144Zm-8,40V160h8a12,12,0,0,1,0,24Zm99.81,12.31a20.82,20.82,0,0,1-9.19,15.23C141.43,215,135,216,129.13,216a61.34,61.34,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.34-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C141.49,174.17,158.05,179,155.81,196.31Z', 'FileRs');
1484
+ const FileArchive = createIcon('M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H112V200h8a8,8,0,0,0,0-16h-8V168h8a8,8,0,0,0,0-16h-8v-8a8,8,0,0,0-16,0v8H88a8,8,0,0,0,0,16h8v16H88a8,8,0,0,0,0,16h8v16H56V40h88V88a8,8,0,0,0,8,8h48V216Z', 'FileArchive');
1485
+
1486
+ // 文件类型图标映射(图标 + 颜色)
1487
+ const fileTypeIcons = {
1488
+ // 文档类型
1489
+ md: {
1490
+ icon: FileMarkdown,
1491
+ color: '#083fa6'
1492
+ },
1493
+ txt: {
1494
+ icon: FileText,
1495
+ color: '#6b7280'
1496
+ },
1497
+ pdf: {
1498
+ icon: FilePdf,
1499
+ color: '#d32f2f'
1500
+ },
1501
+ doc: {
1502
+ icon: FileDoc,
1503
+ color: '#2b579a'
1504
+ },
1505
+ docx: {
1506
+ icon: FileDoc,
1507
+ color: '#2b579a'
1508
+ },
1509
+ xls: {
1510
+ icon: FileXls,
1511
+ color: '#217346'
1512
+ },
1513
+ xlsx: {
1514
+ icon: FileXls,
1515
+ color: '#217346'
1516
+ },
1517
+ // 图片类型
1518
+ png: {
1519
+ icon: FilePng,
1520
+ color: '#a855f7'
1521
+ },
1522
+ jpg: {
1523
+ icon: FileJpg,
1524
+ color: '#f97316'
1525
+ },
1526
+ jpeg: {
1527
+ icon: FileJpg,
1528
+ color: '#f97316'
1529
+ },
1530
+ gif: {
1531
+ icon: FileGif,
1532
+ color: '#ec4899'
1533
+ },
1534
+ svg: {
1535
+ icon: FileSvg,
1536
+ color: '#fbbf24'
1537
+ },
1538
+ webp: {
1539
+ icon: FilePng,
1540
+ color: '#22c55e'
1541
+ },
1542
+ // 视频类型
1543
+ mp4: {
1544
+ icon: FileVideo,
1545
+ color: '#ef4444'
1546
+ },
1547
+ avi: {
1548
+ icon: FileVideo,
1549
+ color: '#ef4444'
1550
+ },
1551
+ mov: {
1552
+ icon: FileVideo,
1553
+ color: '#ef4444'
1554
+ },
1555
+ wmv: {
1556
+ icon: FileVideo,
1557
+ color: '#ef4444'
1558
+ },
1559
+ mkv: {
1560
+ icon: FileVideo,
1561
+ color: '#ef4444'
1562
+ },
1563
+ webm: {
1564
+ icon: FileVideo,
1565
+ color: '#ef4444'
1566
+ },
1567
+ flv: {
1568
+ icon: FileVideo,
1569
+ color: '#ef4444'
1570
+ },
1571
+ // 音频类型
1572
+ mp3: {
1573
+ icon: FileAudio,
1574
+ color: '#8b5cf6'
1575
+ },
1576
+ wav: {
1577
+ icon: FileAudio,
1578
+ color: '#8b5cf6'
1579
+ },
1580
+ flac: {
1581
+ icon: FileAudio,
1582
+ color: '#8b5cf6'
1583
+ },
1584
+ aac: {
1585
+ icon: FileAudio,
1586
+ color: '#8b5cf6'
1587
+ },
1588
+ ogg: {
1589
+ icon: FileAudio,
1590
+ color: '#8b5cf6'
1591
+ },
1592
+ wma: {
1593
+ icon: FileAudio,
1594
+ color: '#8b5cf6'
1595
+ },
1596
+ // 代码类型
1597
+ js: {
1598
+ icon: FileJs,
1599
+ color: '#f7df1e'
1600
+ },
1601
+ jsx: {
1602
+ icon: FileJsx,
1603
+ color: '#61dafb'
1604
+ },
1605
+ ts: {
1606
+ icon: FileTs,
1607
+ color: '#3178c6'
1608
+ },
1609
+ tsx: {
1610
+ icon: FileTsx,
1611
+ color: '#3178c6'
1612
+ },
1613
+ json: {
1614
+ icon: FileCode,
1615
+ color: '#cbcb41'
1616
+ },
1617
+ css: {
1618
+ icon: FileCss,
1619
+ color: '#264de4'
1620
+ },
1621
+ scss: {
1622
+ icon: FileCss,
1623
+ color: '#cc6699'
1624
+ },
1625
+ less: {
1626
+ icon: FileCss,
1627
+ color: '#1d365d'
1628
+ },
1629
+ html: {
1630
+ icon: FileHtml,
1631
+ color: '#e34f26'
1632
+ },
1633
+ vue: {
1634
+ icon: FileVue,
1635
+ color: '#42b883'
1636
+ },
1637
+ py: {
1638
+ icon: FilePy,
1639
+ color: '#3776ab'
1640
+ },
1641
+ java: {
1642
+ icon: FileCode,
1643
+ color: '#ed8b00'
1644
+ },
1645
+ go: {
1646
+ icon: FileCode,
1647
+ color: '#00add8'
1648
+ },
1649
+ rs: {
1650
+ icon: FileRs,
1651
+ color: '#dea584'
1652
+ },
1653
+ // 压缩文件
1654
+ zip: {
1655
+ icon: FileZip,
1656
+ color: '#78909c'
1657
+ },
1658
+ rar: {
1659
+ icon: FileArchive,
1660
+ color: '#5c6bc0'
1661
+ },
1662
+ '7z': {
1663
+ icon: FileArchive,
1664
+ color: '#5c6bc0'
1665
+ },
1666
+ tar: {
1667
+ icon: FileArchive,
1668
+ color: '#8d6e63'
1669
+ },
1670
+ gz: {
1671
+ icon: FileArchive,
1672
+ color: '#8d6e63'
1673
+ }
1674
+ };
1675
+
1676
+ // 获取文件图标和颜色
1677
+ const getFileIcon = (name, isDirectory, expanded) => {
1678
+ if (isDirectory) {
1679
+ return {
1680
+ icon: expanded ? FolderOpen : Folder,
1681
+ color: '#e8a838'
1682
+ };
1683
+ }
1684
+ const ext = name.split('.').pop()?.toLowerCase() || '';
1685
+ return fileTypeIcons[ext] || {
1686
+ icon: File,
1687
+ color: '#6b7280'
1688
+ };
1689
+ };
1690
+
1691
+ // 分离文件名和扩展名
1692
+ const splitFileName = (name, isDirectory) => {
1693
+ if (isDirectory) {
1694
+ return {
1695
+ name,
1696
+ ext: ''
1697
+ };
1698
+ }
1699
+ const lastDotIndex = name.lastIndexOf('.');
1700
+ if (lastDotIndex === -1 || lastDotIndex === 0) {
1701
+ return {
1702
+ name,
1703
+ ext: ''
1704
+ };
1705
+ }
1706
+ return {
1707
+ name: name.substring(0, lastDotIndex),
1708
+ ext: name.substring(lastDotIndex)
1709
+ };
1710
+ };
1711
+
1712
+ // 将扁平数据转换为树形结构
1713
+ const convertToTreeData = (data, parentPath = '') => {
1714
+ if (!Array.isArray(data)) return [];
1715
+ return data.map((item, index) => {
1716
+ const key = parentPath ? `${parentPath}/${item.name}` : item.name;
1717
+ const isDirectory = item.type === 'directory' || item.children?.length > 0;
1718
+ const node = {
1719
+ key,
1720
+ title: item.name,
1721
+ isDirectory,
1722
+ isLeaf: !isDirectory,
1723
+ data: item
1724
+ };
1725
+ if (isDirectory && item.children?.length > 0) {
1726
+ node.children = convertToTreeData(item.children, key);
1727
+ }
1728
+ return node;
1729
+ });
1730
+ };
1731
+
1732
+ const TreeNode = ({
1733
+ node,
1734
+ menuItems,
1735
+ expandedKeys,
1736
+ onToggle,
1737
+ onFileClick,
1738
+ rootRef
1739
+ }) => {
1740
+ const {
1741
+ key,
1742
+ title,
1743
+ isDirectory,
1744
+ isLeaf,
1745
+ data
1746
+ } = node;
1747
+ const isExpanded = expandedKeys.includes(key);
1748
+ const {
1749
+ icon: IconComponent,
1750
+ color
1751
+ } = getFileIcon(title, isDirectory, isExpanded);
1752
+ const {
1753
+ name: fileName,
1754
+ ext
1755
+ } = splitFileName(title, isDirectory);
1756
+ const menu = React.useMemo(() => {
1757
+ if (!menuItems || menuItems.length === 0) return null;
1758
+ return {
1759
+ items: menuItems.map((item, index) => ({
1760
+ key: index,
1761
+ label: item.label,
1762
+ icon: item.icon,
1763
+ onClick: () => item.onClick?.(data, key),
1764
+ danger: item.danger,
1765
+ disabled: item.disabled?.(data, key)
1766
+ }))
1767
+ };
1768
+ }, [menuItems, data, key]);
1769
+ const handleMenuClick = React.useCallback(e => {
1770
+ e.stopPropagation();
1771
+ }, []);
1772
+ const handleNodeClick = React.useCallback(() => {
1773
+ if (isDirectory) {
1774
+ onToggle?.(key, isExpanded);
1775
+ } else {
1776
+ onFileClick?.(data, key);
1777
+ }
1778
+ }, [isDirectory, onToggle, onFileClick, key, isExpanded, data]);
1779
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1780
+ className: style['tree-node'],
1781
+ onClick: handleNodeClick,
1782
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
1783
+ className: style['node-icon'],
1784
+ style: {
1785
+ color
1786
+ },
1787
+ children: /*#__PURE__*/jsxRuntime.jsx(IconComponent, {})
1788
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
1789
+ className: style['node-title'],
1790
+ title: title,
1791
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
1792
+ className: style['node-name'],
1793
+ children: fileName
1794
+ }), ext && /*#__PURE__*/jsxRuntime.jsx("span", {
1795
+ className: style['node-ext'],
1796
+ children: ext
1797
+ })]
1798
+ }), menu && /*#__PURE__*/jsxRuntime.jsx(antd.Dropdown, {
1799
+ menu: menu,
1800
+ popupRender: menu => /*#__PURE__*/jsxRuntime.jsx("div", {
1801
+ onClick: handleMenuClick,
1802
+ children: menu
1803
+ }),
1804
+ trigger: ['click'],
1805
+ placement: "bottomRight",
1806
+ getPopupContainer: () => rootRef.current,
1807
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
1808
+ type: "text",
1809
+ size: "small",
1810
+ className: style['action-btn'],
1811
+ icon: /*#__PURE__*/jsxRuntime.jsx(MoreOutlined$1, {}),
1812
+ onClick: handleMenuClick
1813
+ })
1814
+ })]
1815
+ });
1816
+ };
1817
+
1818
+ const FileSystemView = withLocale(_ref => {
1819
+ let {
1820
+ data,
1821
+ menuItems,
1822
+ defaultExpandAll,
1823
+ expandedKeys: controlledExpandedKeys,
1824
+ onExpand,
1825
+ onFileClick
1826
+ } = _ref;
1827
+ const rootRef = React.useRef(null);
1828
+ const {
1829
+ formatMessage
1830
+ } = reactIntl.useIntl();
1831
+ const [internalExpandedKeys, setInternalExpandedKeys] = React.useState([]);
1832
+ const expandedKeys = controlledExpandedKeys ?? internalExpandedKeys;
1833
+ const treeData = React.useMemo(() => convertToTreeData(data), [data]);
1834
+ const handleExpand = React.useCallback((keys, info) => {
1835
+ if (!controlledExpandedKeys) {
1836
+ setInternalExpandedKeys(keys);
1837
+ }
1838
+ onExpand?.(keys, info);
1839
+ }, [controlledExpandedKeys, onExpand]);
1840
+ const handleToggle = React.useCallback((key, isExpanded) => {
1841
+ const newKeys = isExpanded ? expandedKeys.filter(k => k !== key) : [...expandedKeys, key];
1842
+ handleExpand(newKeys, {
1843
+ node: {
1844
+ key
1845
+ },
1846
+ expanded: !isExpanded
1847
+ });
1848
+ }, [expandedKeys, handleExpand]);
1849
+
1850
+ // 默认展开所有目录
1851
+ const initialExpandedKeys = React.useMemo(() => {
1852
+ if (defaultExpandAll) {
1853
+ const keys = [];
1854
+ const traverse = nodes => {
1855
+ nodes.forEach(node => {
1856
+ if (node.isDirectory) {
1857
+ keys.push(node.key);
1858
+ if (node.children) {
1859
+ traverse(node.children);
1860
+ }
1861
+ }
1862
+ });
1863
+ };
1864
+ traverse(treeData);
1865
+ return keys;
1866
+ }
1867
+ return [];
1868
+ }, [treeData, defaultExpandAll]);
1869
+
1870
+ // 初始化展开状态
1871
+ React.useMemo(() => {
1872
+ if (defaultExpandAll && initialExpandedKeys.length > 0 && !controlledExpandedKeys) {
1873
+ setInternalExpandedKeys(initialExpandedKeys);
1874
+ }
1875
+ }, [defaultExpandAll, initialExpandedKeys, controlledExpandedKeys]);
1876
+ const renderTreeNode = React.useCallback(node => /*#__PURE__*/jsxRuntime.jsx(TreeNode, {
1877
+ rootRef: rootRef,
1878
+ node: node,
1879
+ menuItems: menuItems,
1880
+ expandedKeys: expandedKeys,
1881
+ onToggle: handleToggle,
1882
+ onFileClick: onFileClick
1883
+ }), [menuItems, expandedKeys, handleToggle, onFileClick]);
1884
+ if (!data || data.length === 0) {
1885
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
1886
+ className: style['empty'],
1887
+ children: formatMessage({
1888
+ id: 'empty'
1889
+ })
1890
+ });
1891
+ }
1892
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
1893
+ className: style['file-system-view'],
1894
+ ref: rootRef,
1895
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Tree, {
1896
+ treeData: treeData,
1897
+ expandedKeys: expandedKeys,
1898
+ onExpand: handleExpand,
1899
+ selectable: false,
1900
+ blockNode: true,
1901
+ titleRender: renderTreeNode
1902
+ })
1903
+ });
1904
+ });
1905
+
1906
+ module.exports = FileSystemView;
1907
+ //# sourceMappingURL=index.js.map