crud-page-react 0.0.1

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,2526 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var antd = require('antd');
6
+ var dayjs = require('dayjs');
7
+ var customParseFormat = require('dayjs/plugin/customParseFormat');
8
+
9
+ function _interopNamespaceDefault(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 Object.freeze(n);
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
27
+
28
+ var IconContext = /*#__PURE__*/React.createContext({});
29
+
30
+ function _extends() {
31
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
32
+ for (var e = 1; e < arguments.length; e++) {
33
+ var t = arguments[e];
34
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
35
+ }
36
+ return n;
37
+ }, _extends.apply(null, arguments);
38
+ }
39
+
40
+ function _arrayWithHoles(r) {
41
+ if (Array.isArray(r)) return r;
42
+ }
43
+
44
+ function _iterableToArrayLimit(r, l) {
45
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
46
+ if (null != t) {
47
+ var e,
48
+ n,
49
+ i,
50
+ u,
51
+ a = [],
52
+ f = true,
53
+ o = false;
54
+ try {
55
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
56
+ } catch (r) {
57
+ o = true, n = r;
58
+ } finally {
59
+ try {
60
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
61
+ } finally {
62
+ if (o) throw n;
63
+ }
64
+ }
65
+ return a;
66
+ }
67
+ }
68
+
69
+ function _arrayLikeToArray(r, a) {
70
+ (null == a || a > r.length) && (a = r.length);
71
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
72
+ return n;
73
+ }
74
+
75
+ function _unsupportedIterableToArray(r, a) {
76
+ if (r) {
77
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
78
+ var t = {}.toString.call(r).slice(8, -1);
79
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
80
+ }
81
+ }
82
+
83
+ function _nonIterableRest() {
84
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
85
+ }
86
+
87
+ function _slicedToArray(r, e) {
88
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
89
+ }
90
+
91
+ function _typeof(o) {
92
+ "@babel/helpers - typeof";
93
+
94
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
95
+ return typeof o;
96
+ } : function (o) {
97
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
98
+ }, _typeof(o);
99
+ }
100
+
101
+ function toPrimitive(t, r) {
102
+ if ("object" != _typeof(t) || !t) return t;
103
+ var e = t[Symbol.toPrimitive];
104
+ if (void 0 !== e) {
105
+ var i = e.call(t, r);
106
+ if ("object" != _typeof(i)) return i;
107
+ throw new TypeError("@@toPrimitive must return a primitive value.");
108
+ }
109
+ return ("string" === r ? String : Number)(t);
110
+ }
111
+
112
+ function toPropertyKey(t) {
113
+ var i = toPrimitive(t, "string");
114
+ return "symbol" == _typeof(i) ? i : i + "";
115
+ }
116
+
117
+ function _defineProperty(e, r, t) {
118
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
119
+ value: t,
120
+ enumerable: true,
121
+ configurable: true,
122
+ writable: true
123
+ }) : e[r] = t, e;
124
+ }
125
+
126
+ function _objectWithoutPropertiesLoose(r, e) {
127
+ if (null == r) return {};
128
+ var t = {};
129
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
130
+ if (-1 !== e.indexOf(n)) continue;
131
+ t[n] = r[n];
132
+ }
133
+ return t;
134
+ }
135
+
136
+ function _objectWithoutProperties(e, t) {
137
+ if (null == e) return {};
138
+ var o,
139
+ r,
140
+ i = _objectWithoutPropertiesLoose(e, t);
141
+ if (Object.getOwnPropertySymbols) {
142
+ var n = Object.getOwnPropertySymbols(e);
143
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
144
+ }
145
+ return i;
146
+ }
147
+
148
+ function getDefaultExportFromCjs (x) {
149
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
150
+ }
151
+
152
+ var classnames = {exports: {}};
153
+
154
+ /*!
155
+ Copyright (c) 2018 Jed Watson.
156
+ Licensed under the MIT License (MIT), see
157
+ http://jedwatson.github.io/classnames
158
+ */
159
+
160
+ (function (module) {
161
+ /* global define */
162
+
163
+ (function () {
164
+
165
+ var hasOwn = {}.hasOwnProperty;
166
+
167
+ function classNames () {
168
+ var classes = '';
169
+
170
+ for (var i = 0; i < arguments.length; i++) {
171
+ var arg = arguments[i];
172
+ if (arg) {
173
+ classes = appendClass(classes, parseValue(arg));
174
+ }
175
+ }
176
+
177
+ return classes;
178
+ }
179
+
180
+ function parseValue (arg) {
181
+ if (typeof arg === 'string' || typeof arg === 'number') {
182
+ return arg;
183
+ }
184
+
185
+ if (typeof arg !== 'object') {
186
+ return '';
187
+ }
188
+
189
+ if (Array.isArray(arg)) {
190
+ return classNames.apply(null, arg);
191
+ }
192
+
193
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
194
+ return arg.toString();
195
+ }
196
+
197
+ var classes = '';
198
+
199
+ for (var key in arg) {
200
+ if (hasOwn.call(arg, key) && arg[key]) {
201
+ classes = appendClass(classes, key);
202
+ }
203
+ }
204
+
205
+ return classes;
206
+ }
207
+
208
+ function appendClass (value, newClass) {
209
+ if (!newClass) {
210
+ return value;
211
+ }
212
+
213
+ if (value) {
214
+ return value + ' ' + newClass;
215
+ }
216
+
217
+ return value + newClass;
218
+ }
219
+
220
+ if (module.exports) {
221
+ classNames.default = classNames;
222
+ module.exports = classNames;
223
+ } else {
224
+ window.classNames = classNames;
225
+ }
226
+ }());
227
+ } (classnames));
228
+
229
+ var classnamesExports = classnames.exports;
230
+ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
231
+
232
+ const round = Math.round;
233
+
234
+ /**
235
+ * Support format, alpha unit will check the % mark:
236
+ * - rgba(102, 204, 255, .5) -> [102, 204, 255, 0.5]
237
+ * - rgb(102 204 255 / .5) -> [102, 204, 255, 0.5]
238
+ * - rgb(100%, 50%, 0% / 50%) -> [255, 128, 0, 0.5]
239
+ * - hsl(270, 60, 40, .5) -> [270, 60, 40, 0.5]
240
+ * - hsl(270deg 60% 40% / 50%) -> [270, 60, 40, 0.5]
241
+ *
242
+ * When `base` is provided, the percentage value will be divided by `base`.
243
+ */
244
+ function splitColorStr(str, parseNum) {
245
+ const match = str
246
+ // Remove str before `(`
247
+ .replace(/^[^(]*\((.*)/, '$1')
248
+ // Remove str after `)`
249
+ .replace(/\).*/, '').match(/\d*\.?\d+%?/g) || [];
250
+ const numList = match.map(item => parseFloat(item));
251
+ for (let i = 0; i < 3; i += 1) {
252
+ numList[i] = parseNum(numList[i] || 0, match[i] || '', i);
253
+ }
254
+
255
+ // For alpha. 50% should be 0.5
256
+ if (match[3]) {
257
+ numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];
258
+ } else {
259
+ // By default, alpha is 1
260
+ numList[3] = 1;
261
+ }
262
+ return numList;
263
+ }
264
+ const parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
265
+
266
+ /** round and limit number to integer between 0-255 */
267
+ function limitRange(value, max) {
268
+ const mergedMax = max || 255;
269
+ if (value > mergedMax) {
270
+ return mergedMax;
271
+ }
272
+ if (value < 0) {
273
+ return 0;
274
+ }
275
+ return value;
276
+ }
277
+ class FastColor {
278
+ constructor(input) {
279
+ /**
280
+ * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
281
+ */
282
+ _defineProperty(this, "isValid", true);
283
+ /**
284
+ * Red, R in RGB
285
+ */
286
+ _defineProperty(this, "r", 0);
287
+ /**
288
+ * Green, G in RGB
289
+ */
290
+ _defineProperty(this, "g", 0);
291
+ /**
292
+ * Blue, B in RGB
293
+ */
294
+ _defineProperty(this, "b", 0);
295
+ /**
296
+ * Alpha/Opacity, A in RGBA/HSLA
297
+ */
298
+ _defineProperty(this, "a", 1);
299
+ // HSV privates
300
+ _defineProperty(this, "_h", void 0);
301
+ _defineProperty(this, "_s", void 0);
302
+ _defineProperty(this, "_l", void 0);
303
+ _defineProperty(this, "_v", void 0);
304
+ // intermediate variables to calculate HSL/HSV
305
+ _defineProperty(this, "_max", void 0);
306
+ _defineProperty(this, "_min", void 0);
307
+ _defineProperty(this, "_brightness", void 0);
308
+ /**
309
+ * Always check 3 char in the object to determine the format.
310
+ * We not use function in check to save bundle size.
311
+ * e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.
312
+ */
313
+ function matchFormat(str) {
314
+ return str[0] in input && str[1] in input && str[2] in input;
315
+ }
316
+ if (!input) ; else if (typeof input === 'string') {
317
+ const trimStr = input.trim();
318
+ function matchPrefix(prefix) {
319
+ return trimStr.startsWith(prefix);
320
+ }
321
+ if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
322
+ this.fromHexString(trimStr);
323
+ } else if (matchPrefix('rgb')) {
324
+ this.fromRgbString(trimStr);
325
+ } else if (matchPrefix('hsl')) {
326
+ this.fromHslString(trimStr);
327
+ } else if (matchPrefix('hsv') || matchPrefix('hsb')) {
328
+ this.fromHsvString(trimStr);
329
+ }
330
+ } else if (input instanceof FastColor) {
331
+ this.r = input.r;
332
+ this.g = input.g;
333
+ this.b = input.b;
334
+ this.a = input.a;
335
+ this._h = input._h;
336
+ this._s = input._s;
337
+ this._l = input._l;
338
+ this._v = input._v;
339
+ } else if (matchFormat('rgb')) {
340
+ this.r = limitRange(input.r);
341
+ this.g = limitRange(input.g);
342
+ this.b = limitRange(input.b);
343
+ this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;
344
+ } else if (matchFormat('hsl')) {
345
+ this.fromHsl(input);
346
+ } else if (matchFormat('hsv')) {
347
+ this.fromHsv(input);
348
+ } else {
349
+ throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));
350
+ }
351
+ }
352
+
353
+ // ======================= Setter =======================
354
+
355
+ setR(value) {
356
+ return this._sc('r', value);
357
+ }
358
+ setG(value) {
359
+ return this._sc('g', value);
360
+ }
361
+ setB(value) {
362
+ return this._sc('b', value);
363
+ }
364
+ setA(value) {
365
+ return this._sc('a', value, 1);
366
+ }
367
+ setHue(value) {
368
+ const hsv = this.toHsv();
369
+ hsv.h = value;
370
+ return this._c(hsv);
371
+ }
372
+
373
+ // ======================= Getter =======================
374
+ /**
375
+ * Returns the perceived luminance of a color, from 0-1.
376
+ * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
377
+ */
378
+ getLuminance() {
379
+ function adjustGamma(raw) {
380
+ const val = raw / 255;
381
+ return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
382
+ }
383
+ const R = adjustGamma(this.r);
384
+ const G = adjustGamma(this.g);
385
+ const B = adjustGamma(this.b);
386
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
387
+ }
388
+ getHue() {
389
+ if (typeof this._h === 'undefined') {
390
+ const delta = this.getMax() - this.getMin();
391
+ if (delta === 0) {
392
+ this._h = 0;
393
+ } else {
394
+ 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));
395
+ }
396
+ }
397
+ return this._h;
398
+ }
399
+ getSaturation() {
400
+ if (typeof this._s === 'undefined') {
401
+ const delta = this.getMax() - this.getMin();
402
+ if (delta === 0) {
403
+ this._s = 0;
404
+ } else {
405
+ this._s = delta / this.getMax();
406
+ }
407
+ }
408
+ return this._s;
409
+ }
410
+ getLightness() {
411
+ if (typeof this._l === 'undefined') {
412
+ this._l = (this.getMax() + this.getMin()) / 510;
413
+ }
414
+ return this._l;
415
+ }
416
+ getValue() {
417
+ if (typeof this._v === 'undefined') {
418
+ this._v = this.getMax() / 255;
419
+ }
420
+ return this._v;
421
+ }
422
+
423
+ /**
424
+ * Returns the perceived brightness of the color, from 0-255.
425
+ * Note: this is not the b of HSB
426
+ * @see http://www.w3.org/TR/AERT#color-contrast
427
+ */
428
+ getBrightness() {
429
+ if (typeof this._brightness === 'undefined') {
430
+ this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;
431
+ }
432
+ return this._brightness;
433
+ }
434
+
435
+ // ======================== Func ========================
436
+
437
+ darken(amount = 10) {
438
+ const h = this.getHue();
439
+ const s = this.getSaturation();
440
+ let l = this.getLightness() - amount / 100;
441
+ if (l < 0) {
442
+ l = 0;
443
+ }
444
+ return this._c({
445
+ h,
446
+ s,
447
+ l,
448
+ a: this.a
449
+ });
450
+ }
451
+ lighten(amount = 10) {
452
+ const h = this.getHue();
453
+ const s = this.getSaturation();
454
+ let l = this.getLightness() + amount / 100;
455
+ if (l > 1) {
456
+ l = 1;
457
+ }
458
+ return this._c({
459
+ h,
460
+ s,
461
+ l,
462
+ a: this.a
463
+ });
464
+ }
465
+
466
+ /**
467
+ * Mix the current color a given amount with another color, from 0 to 100.
468
+ * 0 means no mixing (return current color).
469
+ */
470
+ mix(input, amount = 50) {
471
+ const color = this._c(input);
472
+ const p = amount / 100;
473
+ const calc = key => (color[key] - this[key]) * p + this[key];
474
+ const rgba = {
475
+ r: round(calc('r')),
476
+ g: round(calc('g')),
477
+ b: round(calc('b')),
478
+ a: round(calc('a') * 100) / 100
479
+ };
480
+ return this._c(rgba);
481
+ }
482
+
483
+ /**
484
+ * Mix the color with pure white, from 0 to 100.
485
+ * Providing 0 will do nothing, providing 100 will always return white.
486
+ */
487
+ tint(amount = 10) {
488
+ return this.mix({
489
+ r: 255,
490
+ g: 255,
491
+ b: 255,
492
+ a: 1
493
+ }, amount);
494
+ }
495
+
496
+ /**
497
+ * Mix the color with pure black, from 0 to 100.
498
+ * Providing 0 will do nothing, providing 100 will always return black.
499
+ */
500
+ shade(amount = 10) {
501
+ return this.mix({
502
+ r: 0,
503
+ g: 0,
504
+ b: 0,
505
+ a: 1
506
+ }, amount);
507
+ }
508
+ onBackground(background) {
509
+ const bg = this._c(background);
510
+ const alpha = this.a + bg.a * (1 - this.a);
511
+ const calc = key => {
512
+ return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
513
+ };
514
+ return this._c({
515
+ r: calc('r'),
516
+ g: calc('g'),
517
+ b: calc('b'),
518
+ a: alpha
519
+ });
520
+ }
521
+
522
+ // ======================= Status =======================
523
+ isDark() {
524
+ return this.getBrightness() < 128;
525
+ }
526
+ isLight() {
527
+ return this.getBrightness() >= 128;
528
+ }
529
+
530
+ // ======================== MISC ========================
531
+ equals(other) {
532
+ return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
533
+ }
534
+ clone() {
535
+ return this._c(this);
536
+ }
537
+
538
+ // ======================= Format =======================
539
+ toHexString() {
540
+ let hex = '#';
541
+ const rHex = (this.r || 0).toString(16);
542
+ hex += rHex.length === 2 ? rHex : '0' + rHex;
543
+ const gHex = (this.g || 0).toString(16);
544
+ hex += gHex.length === 2 ? gHex : '0' + gHex;
545
+ const bHex = (this.b || 0).toString(16);
546
+ hex += bHex.length === 2 ? bHex : '0' + bHex;
547
+ if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {
548
+ const aHex = round(this.a * 255).toString(16);
549
+ hex += aHex.length === 2 ? aHex : '0' + aHex;
550
+ }
551
+ return hex;
552
+ }
553
+
554
+ /** CSS support color pattern */
555
+ toHsl() {
556
+ return {
557
+ h: this.getHue(),
558
+ s: this.getSaturation(),
559
+ l: this.getLightness(),
560
+ a: this.a
561
+ };
562
+ }
563
+
564
+ /** CSS support color pattern */
565
+ toHslString() {
566
+ const h = this.getHue();
567
+ const s = round(this.getSaturation() * 100);
568
+ const l = round(this.getLightness() * 100);
569
+ return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
570
+ }
571
+
572
+ /** Same as toHsb */
573
+ toHsv() {
574
+ return {
575
+ h: this.getHue(),
576
+ s: this.getSaturation(),
577
+ v: this.getValue(),
578
+ a: this.a
579
+ };
580
+ }
581
+ toRgb() {
582
+ return {
583
+ r: this.r,
584
+ g: this.g,
585
+ b: this.b,
586
+ a: this.a
587
+ };
588
+ }
589
+ toRgbString() {
590
+ return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
591
+ }
592
+ toString() {
593
+ return this.toRgbString();
594
+ }
595
+
596
+ // ====================== Privates ======================
597
+ /** Return a new FastColor object with one channel changed */
598
+ _sc(rgb, value, max) {
599
+ const clone = this.clone();
600
+ clone[rgb] = limitRange(value, max);
601
+ return clone;
602
+ }
603
+ _c(input) {
604
+ return new this.constructor(input);
605
+ }
606
+ getMax() {
607
+ if (typeof this._max === 'undefined') {
608
+ this._max = Math.max(this.r, this.g, this.b);
609
+ }
610
+ return this._max;
611
+ }
612
+ getMin() {
613
+ if (typeof this._min === 'undefined') {
614
+ this._min = Math.min(this.r, this.g, this.b);
615
+ }
616
+ return this._min;
617
+ }
618
+ fromHexString(trimStr) {
619
+ const withoutPrefix = trimStr.replace('#', '');
620
+ function connectNum(index1, index2) {
621
+ return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
622
+ }
623
+ if (withoutPrefix.length < 6) {
624
+ // #rgb or #rgba
625
+ this.r = connectNum(0);
626
+ this.g = connectNum(1);
627
+ this.b = connectNum(2);
628
+ this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
629
+ } else {
630
+ // #rrggbb or #rrggbbaa
631
+ this.r = connectNum(0, 1);
632
+ this.g = connectNum(2, 3);
633
+ this.b = connectNum(4, 5);
634
+ this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
635
+ }
636
+ }
637
+ fromHsl({
638
+ h,
639
+ s,
640
+ l,
641
+ a
642
+ }) {
643
+ this._h = h % 360;
644
+ this._s = s;
645
+ this._l = l;
646
+ this.a = typeof a === 'number' ? a : 1;
647
+ if (s <= 0) {
648
+ const rgb = round(l * 255);
649
+ this.r = rgb;
650
+ this.g = rgb;
651
+ this.b = rgb;
652
+ }
653
+ let r = 0,
654
+ g = 0,
655
+ b = 0;
656
+ const huePrime = h / 60;
657
+ const chroma = (1 - Math.abs(2 * l - 1)) * s;
658
+ const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
659
+ if (huePrime >= 0 && huePrime < 1) {
660
+ r = chroma;
661
+ g = secondComponent;
662
+ } else if (huePrime >= 1 && huePrime < 2) {
663
+ r = secondComponent;
664
+ g = chroma;
665
+ } else if (huePrime >= 2 && huePrime < 3) {
666
+ g = chroma;
667
+ b = secondComponent;
668
+ } else if (huePrime >= 3 && huePrime < 4) {
669
+ g = secondComponent;
670
+ b = chroma;
671
+ } else if (huePrime >= 4 && huePrime < 5) {
672
+ r = secondComponent;
673
+ b = chroma;
674
+ } else if (huePrime >= 5 && huePrime < 6) {
675
+ r = chroma;
676
+ b = secondComponent;
677
+ }
678
+ const lightnessModification = l - chroma / 2;
679
+ this.r = round((r + lightnessModification) * 255);
680
+ this.g = round((g + lightnessModification) * 255);
681
+ this.b = round((b + lightnessModification) * 255);
682
+ }
683
+ fromHsv({
684
+ h,
685
+ s,
686
+ v,
687
+ a
688
+ }) {
689
+ this._h = h % 360;
690
+ this._s = s;
691
+ this._v = v;
692
+ this.a = typeof a === 'number' ? a : 1;
693
+ const vv = round(v * 255);
694
+ this.r = vv;
695
+ this.g = vv;
696
+ this.b = vv;
697
+ if (s <= 0) {
698
+ return;
699
+ }
700
+ const hh = h / 60;
701
+ const i = Math.floor(hh);
702
+ const ff = hh - i;
703
+ const p = round(v * (1.0 - s) * 255);
704
+ const q = round(v * (1.0 - s * ff) * 255);
705
+ const t = round(v * (1.0 - s * (1.0 - ff)) * 255);
706
+ switch (i) {
707
+ case 0:
708
+ this.g = t;
709
+ this.b = p;
710
+ break;
711
+ case 1:
712
+ this.r = q;
713
+ this.b = p;
714
+ break;
715
+ case 2:
716
+ this.r = p;
717
+ this.b = t;
718
+ break;
719
+ case 3:
720
+ this.r = p;
721
+ this.g = q;
722
+ break;
723
+ case 4:
724
+ this.r = t;
725
+ this.g = p;
726
+ break;
727
+ case 5:
728
+ default:
729
+ this.g = p;
730
+ this.b = q;
731
+ break;
732
+ }
733
+ }
734
+ fromHsvString(trimStr) {
735
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
736
+ this.fromHsv({
737
+ h: cells[0],
738
+ s: cells[1],
739
+ v: cells[2],
740
+ a: cells[3]
741
+ });
742
+ }
743
+ fromHslString(trimStr) {
744
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
745
+ this.fromHsl({
746
+ h: cells[0],
747
+ s: cells[1],
748
+ l: cells[2],
749
+ a: cells[3]
750
+ });
751
+ }
752
+ fromRgbString(trimStr) {
753
+ const cells = splitColorStr(trimStr, (num, txt) =>
754
+ // Convert percentage to number. e.g. 50% -> 128
755
+ txt.includes('%') ? round(num / 100 * 255) : num);
756
+ this.r = cells[0];
757
+ this.g = cells[1];
758
+ this.b = cells[2];
759
+ this.a = cells[3];
760
+ }
761
+ }
762
+
763
+ var hueStep = 2; // 色相阶梯
764
+ var saturationStep = 0.16; // 饱和度阶梯,浅色部分
765
+ var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
766
+ var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
767
+ var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
768
+ var lightColorCount = 5; // 浅色数量,主色上
769
+ var darkColorCount = 4; // 深色数量,主色下
770
+
771
+ // 暗色主题颜色映射关系表
772
+ var darkColorMap = [{
773
+ index: 7,
774
+ amount: 15
775
+ }, {
776
+ index: 6,
777
+ amount: 25
778
+ }, {
779
+ index: 5,
780
+ amount: 30
781
+ }, {
782
+ index: 5,
783
+ amount: 45
784
+ }, {
785
+ index: 5,
786
+ amount: 65
787
+ }, {
788
+ index: 5,
789
+ amount: 85
790
+ }, {
791
+ index: 4,
792
+ amount: 90
793
+ }, {
794
+ index: 3,
795
+ amount: 95
796
+ }, {
797
+ index: 2,
798
+ amount: 97
799
+ }, {
800
+ index: 1,
801
+ amount: 98
802
+ }];
803
+ function getHue(hsv, i, light) {
804
+ var hue;
805
+ // 根据色相不同,色相转向不同
806
+ if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
807
+ hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
808
+ } else {
809
+ hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
810
+ }
811
+ if (hue < 0) {
812
+ hue += 360;
813
+ } else if (hue >= 360) {
814
+ hue -= 360;
815
+ }
816
+ return hue;
817
+ }
818
+ function getSaturation(hsv, i, light) {
819
+ // grey color don't change saturation
820
+ if (hsv.h === 0 && hsv.s === 0) {
821
+ return hsv.s;
822
+ }
823
+ var saturation;
824
+ if (light) {
825
+ saturation = hsv.s - saturationStep * i;
826
+ } else if (i === darkColorCount) {
827
+ saturation = hsv.s + saturationStep;
828
+ } else {
829
+ saturation = hsv.s + saturationStep2 * i;
830
+ }
831
+ // 边界值修正
832
+ if (saturation > 1) {
833
+ saturation = 1;
834
+ }
835
+ // 第一格的 s 限制在 0.06-0.1 之间
836
+ if (light && i === lightColorCount && saturation > 0.1) {
837
+ saturation = 0.1;
838
+ }
839
+ if (saturation < 0.06) {
840
+ saturation = 0.06;
841
+ }
842
+ return Math.round(saturation * 100) / 100;
843
+ }
844
+ function getValue(hsv, i, light) {
845
+ var value;
846
+ if (light) {
847
+ value = hsv.v + brightnessStep1 * i;
848
+ } else {
849
+ value = hsv.v - brightnessStep2 * i;
850
+ }
851
+ // Clamp value between 0 and 1
852
+ value = Math.max(0, Math.min(1, value));
853
+ return Math.round(value * 100) / 100;
854
+ }
855
+ function generate$1(color) {
856
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
857
+ var patterns = [];
858
+ var pColor = new FastColor(color);
859
+ var hsv = pColor.toHsv();
860
+ for (var i = lightColorCount; i > 0; i -= 1) {
861
+ var c = new FastColor({
862
+ h: getHue(hsv, i, true),
863
+ s: getSaturation(hsv, i, true),
864
+ v: getValue(hsv, i, true)
865
+ });
866
+ patterns.push(c);
867
+ }
868
+ patterns.push(pColor);
869
+ for (var _i = 1; _i <= darkColorCount; _i += 1) {
870
+ var _c = new FastColor({
871
+ h: getHue(hsv, _i),
872
+ s: getSaturation(hsv, _i),
873
+ v: getValue(hsv, _i)
874
+ });
875
+ patterns.push(_c);
876
+ }
877
+
878
+ // dark theme patterns
879
+ if (opts.theme === 'dark') {
880
+ return darkColorMap.map(function (_ref) {
881
+ var index = _ref.index,
882
+ amount = _ref.amount;
883
+ return new FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString();
884
+ });
885
+ }
886
+ return patterns.map(function (c) {
887
+ return c.toHexString();
888
+ });
889
+ }
890
+
891
+ // Generated by script. Do NOT modify!
892
+
893
+ var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
894
+ blue.primary = blue[5];
895
+
896
+ function ownKeys(e, r) {
897
+ var t = Object.keys(e);
898
+ if (Object.getOwnPropertySymbols) {
899
+ var o = Object.getOwnPropertySymbols(e);
900
+ r && (o = o.filter(function (r) {
901
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
902
+ })), t.push.apply(t, o);
903
+ }
904
+ return t;
905
+ }
906
+ function _objectSpread2(e) {
907
+ for (var r = 1; r < arguments.length; r++) {
908
+ var t = null != arguments[r] ? arguments[r] : {};
909
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
910
+ _defineProperty(e, r, t[r]);
911
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
912
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
913
+ });
914
+ }
915
+ return e;
916
+ }
917
+
918
+ function canUseDom() {
919
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
920
+ }
921
+
922
+ function contains(root, n) {
923
+ if (!root) {
924
+ return false;
925
+ }
926
+
927
+ // Use native if support
928
+ if (root.contains) {
929
+ return root.contains(n);
930
+ }
931
+
932
+ // `document.contains` not support with IE11
933
+ var node = n;
934
+ while (node) {
935
+ if (node === root) {
936
+ return true;
937
+ }
938
+ node = node.parentNode;
939
+ }
940
+ return false;
941
+ }
942
+
943
+ var APPEND_ORDER = 'data-rc-order';
944
+ var APPEND_PRIORITY = 'data-rc-priority';
945
+ var MARK_KEY = "rc-util-key";
946
+ var containerCache = new Map();
947
+ function getMark() {
948
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
949
+ mark = _ref.mark;
950
+ if (mark) {
951
+ return mark.startsWith('data-') ? mark : "data-".concat(mark);
952
+ }
953
+ return MARK_KEY;
954
+ }
955
+ function getContainer(option) {
956
+ if (option.attachTo) {
957
+ return option.attachTo;
958
+ }
959
+ var head = document.querySelector('head');
960
+ return head || document.body;
961
+ }
962
+ function getOrder(prepend) {
963
+ if (prepend === 'queue') {
964
+ return 'prependQueue';
965
+ }
966
+ return prepend ? 'prepend' : 'append';
967
+ }
968
+
969
+ /**
970
+ * Find style which inject by rc-util
971
+ */
972
+ function findStyles(container) {
973
+ return Array.from((containerCache.get(container) || container).children).filter(function (node) {
974
+ return node.tagName === 'STYLE';
975
+ });
976
+ }
977
+ function injectCSS(css) {
978
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
979
+ if (!canUseDom()) {
980
+ return null;
981
+ }
982
+ var csp = option.csp,
983
+ prepend = option.prepend,
984
+ _option$priority = option.priority,
985
+ priority = _option$priority === void 0 ? 0 : _option$priority;
986
+ var mergedOrder = getOrder(prepend);
987
+ var isPrependQueue = mergedOrder === 'prependQueue';
988
+ var styleNode = document.createElement('style');
989
+ styleNode.setAttribute(APPEND_ORDER, mergedOrder);
990
+ if (isPrependQueue && priority) {
991
+ styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority));
992
+ }
993
+ if (csp !== null && csp !== void 0 && csp.nonce) {
994
+ styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
995
+ }
996
+ styleNode.innerHTML = css;
997
+ var container = getContainer(option);
998
+ var firstChild = container.firstChild;
999
+ if (prepend) {
1000
+ // If is queue `prepend`, it will prepend first style and then append rest style
1001
+ if (isPrependQueue) {
1002
+ var existStyle = (option.styles || findStyles(container)).filter(function (node) {
1003
+ // Ignore style which not injected by rc-util with prepend
1004
+ if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {
1005
+ return false;
1006
+ }
1007
+
1008
+ // Ignore style which priority less then new style
1009
+ var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
1010
+ return priority >= nodePriority;
1011
+ });
1012
+ if (existStyle.length) {
1013
+ container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
1014
+ return styleNode;
1015
+ }
1016
+ }
1017
+
1018
+ // Use `insertBefore` as `prepend`
1019
+ container.insertBefore(styleNode, firstChild);
1020
+ } else {
1021
+ container.appendChild(styleNode);
1022
+ }
1023
+ return styleNode;
1024
+ }
1025
+ function findExistNode(key) {
1026
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1027
+ var container = getContainer(option);
1028
+ return (option.styles || findStyles(container)).find(function (node) {
1029
+ return node.getAttribute(getMark(option)) === key;
1030
+ });
1031
+ }
1032
+
1033
+ /**
1034
+ * qiankun will inject `appendChild` to insert into other
1035
+ */
1036
+ function syncRealContainer(container, option) {
1037
+ var cachedRealContainer = containerCache.get(container);
1038
+
1039
+ // Find real container when not cached or cached container removed
1040
+ if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
1041
+ var placeholderStyle = injectCSS('', option);
1042
+ var parentNode = placeholderStyle.parentNode;
1043
+ containerCache.set(container, parentNode);
1044
+ container.removeChild(placeholderStyle);
1045
+ }
1046
+ }
1047
+ function updateCSS(css, key) {
1048
+ var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1049
+ var container = getContainer(originOption);
1050
+ var styles = findStyles(container);
1051
+ var option = _objectSpread2(_objectSpread2({}, originOption), {}, {
1052
+ styles: styles
1053
+ });
1054
+
1055
+ // Sync real parent
1056
+ syncRealContainer(container, option);
1057
+ var existNode = findExistNode(key, option);
1058
+ if (existNode) {
1059
+ var _option$csp, _option$csp2;
1060
+ if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {
1061
+ var _option$csp3;
1062
+ existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;
1063
+ }
1064
+ if (existNode.innerHTML !== css) {
1065
+ existNode.innerHTML = css;
1066
+ }
1067
+ return existNode;
1068
+ }
1069
+ var newNode = injectCSS(css, option);
1070
+ newNode.setAttribute(getMark(option), key);
1071
+ return newNode;
1072
+ }
1073
+
1074
+ function getRoot(ele) {
1075
+ var _ele$getRootNode;
1076
+ return ele === null || ele === void 0 || (_ele$getRootNode = ele.getRootNode) === null || _ele$getRootNode === void 0 ? void 0 : _ele$getRootNode.call(ele);
1077
+ }
1078
+
1079
+ /**
1080
+ * Check if is in shadowRoot
1081
+ */
1082
+ function inShadow(ele) {
1083
+ return getRoot(ele) instanceof ShadowRoot;
1084
+ }
1085
+
1086
+ /**
1087
+ * Return shadowRoot if possible
1088
+ */
1089
+ function getShadowRoot(ele) {
1090
+ return inShadow(ele) ? getRoot(ele) : null;
1091
+ }
1092
+
1093
+ /* eslint-disable no-console */
1094
+ var warned = {};
1095
+ var preWarningFns = [];
1096
+
1097
+ /**
1098
+ * Pre warning enable you to parse content before console.error.
1099
+ * Modify to null will prevent warning.
1100
+ */
1101
+ var preMessage = function preMessage(fn) {
1102
+ preWarningFns.push(fn);
1103
+ };
1104
+
1105
+ /**
1106
+ * Warning if condition not match.
1107
+ * @param valid Condition
1108
+ * @param message Warning message
1109
+ * @example
1110
+ * ```js
1111
+ * warning(false, 'some error'); // print some error
1112
+ * warning(true, 'some error'); // print nothing
1113
+ * warning(1 === 2, 'some error'); // print some error
1114
+ * ```
1115
+ */
1116
+ function warning$1(valid, message) {
1117
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
1118
+ var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
1119
+ return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');
1120
+ }, message);
1121
+ if (finalMessage) {
1122
+ console.error("Warning: ".concat(finalMessage));
1123
+ }
1124
+ }
1125
+ }
1126
+
1127
+ /** @see Similar to {@link warning} */
1128
+ function note(valid, message) {
1129
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
1130
+ var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
1131
+ return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');
1132
+ }, message);
1133
+ if (finalMessage) {
1134
+ console.warn("Note: ".concat(finalMessage));
1135
+ }
1136
+ }
1137
+ }
1138
+ function resetWarned() {
1139
+ warned = {};
1140
+ }
1141
+ function call(method, valid, message) {
1142
+ if (!valid && !warned[message]) {
1143
+ method(false, message);
1144
+ warned[message] = true;
1145
+ }
1146
+ }
1147
+
1148
+ /** @see Same as {@link warning}, but only warn once for the same message */
1149
+ function warningOnce(valid, message) {
1150
+ call(warning$1, valid, message);
1151
+ }
1152
+
1153
+ /** @see Same as {@link warning}, but only warn once for the same message */
1154
+ function noteOnce(valid, message) {
1155
+ call(note, valid, message);
1156
+ }
1157
+ warningOnce.preMessage = preMessage;
1158
+ warningOnce.resetWarned = resetWarned;
1159
+ warningOnce.noteOnce = noteOnce;
1160
+
1161
+ function camelCase(input) {
1162
+ return input.replace(/-(.)/g, function (match, g) {
1163
+ return g.toUpperCase();
1164
+ });
1165
+ }
1166
+ function warning(valid, message) {
1167
+ warningOnce(valid, "[@ant-design/icons] ".concat(message));
1168
+ }
1169
+ function isIconDefinition(target) {
1170
+ return _typeof(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (_typeof(target.icon) === 'object' || typeof target.icon === 'function');
1171
+ }
1172
+ function normalizeAttrs() {
1173
+ var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1174
+ return Object.keys(attrs).reduce(function (acc, key) {
1175
+ var val = attrs[key];
1176
+ switch (key) {
1177
+ case 'class':
1178
+ acc.className = val;
1179
+ delete acc.class;
1180
+ break;
1181
+ default:
1182
+ delete acc[key];
1183
+ acc[camelCase(key)] = val;
1184
+ }
1185
+ return acc;
1186
+ }, {});
1187
+ }
1188
+ function generate(node, key, rootProps) {
1189
+ if (!rootProps) {
1190
+ return /*#__PURE__*/React.createElement(node.tag, _objectSpread2({
1191
+ key: key
1192
+ }, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {
1193
+ return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
1194
+ }));
1195
+ }
1196
+ return /*#__PURE__*/React.createElement(node.tag, _objectSpread2(_objectSpread2({
1197
+ key: key
1198
+ }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {
1199
+ return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
1200
+ }));
1201
+ }
1202
+ function getSecondaryColor(primaryColor) {
1203
+ // choose the second color
1204
+ return generate$1(primaryColor)[0];
1205
+ }
1206
+ function normalizeTwoToneColors(twoToneColor) {
1207
+ if (!twoToneColor) {
1208
+ return [];
1209
+ }
1210
+ return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
1211
+ }
1212
+ var iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
1213
+ var useInsertStyles = function useInsertStyles(eleRef) {
1214
+ var _useContext = React.useContext(IconContext),
1215
+ csp = _useContext.csp,
1216
+ prefixCls = _useContext.prefixCls,
1217
+ layer = _useContext.layer;
1218
+ var mergedStyleStr = iconStyles;
1219
+ if (prefixCls) {
1220
+ mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
1221
+ }
1222
+ if (layer) {
1223
+ mergedStyleStr = "@layer ".concat(layer, " {\n").concat(mergedStyleStr, "\n}");
1224
+ }
1225
+ React.useEffect(function () {
1226
+ var ele = eleRef.current;
1227
+ var shadowRoot = getShadowRoot(ele);
1228
+ updateCSS(mergedStyleStr, '@ant-design-icons', {
1229
+ prepend: !layer,
1230
+ csp: csp,
1231
+ attachTo: shadowRoot
1232
+ });
1233
+ }, []);
1234
+ };
1235
+
1236
+ var _excluded$1 = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"];
1237
+ var twoToneColorPalette = {
1238
+ primaryColor: '#333',
1239
+ secondaryColor: '#E6E6E6',
1240
+ calculated: false
1241
+ };
1242
+ function setTwoToneColors(_ref) {
1243
+ var primaryColor = _ref.primaryColor,
1244
+ secondaryColor = _ref.secondaryColor;
1245
+ twoToneColorPalette.primaryColor = primaryColor;
1246
+ twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
1247
+ twoToneColorPalette.calculated = !!secondaryColor;
1248
+ }
1249
+ function getTwoToneColors() {
1250
+ return _objectSpread2({}, twoToneColorPalette);
1251
+ }
1252
+ var IconBase = function IconBase(props) {
1253
+ var icon = props.icon,
1254
+ className = props.className,
1255
+ onClick = props.onClick,
1256
+ style = props.style,
1257
+ primaryColor = props.primaryColor,
1258
+ secondaryColor = props.secondaryColor,
1259
+ restProps = _objectWithoutProperties(props, _excluded$1);
1260
+ var svgRef = React__namespace.useRef();
1261
+ var colors = twoToneColorPalette;
1262
+ if (primaryColor) {
1263
+ colors = {
1264
+ primaryColor: primaryColor,
1265
+ secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
1266
+ };
1267
+ }
1268
+ useInsertStyles(svgRef);
1269
+ warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
1270
+ if (!isIconDefinition(icon)) {
1271
+ return null;
1272
+ }
1273
+ var target = icon;
1274
+ if (target && typeof target.icon === 'function') {
1275
+ target = _objectSpread2(_objectSpread2({}, target), {}, {
1276
+ icon: target.icon(colors.primaryColor, colors.secondaryColor)
1277
+ });
1278
+ }
1279
+ return generate(target.icon, "svg-".concat(target.name), _objectSpread2(_objectSpread2({
1280
+ className: className,
1281
+ onClick: onClick,
1282
+ style: style,
1283
+ 'data-icon': target.name,
1284
+ width: '1em',
1285
+ height: '1em',
1286
+ fill: 'currentColor',
1287
+ 'aria-hidden': 'true'
1288
+ }, restProps), {}, {
1289
+ ref: svgRef
1290
+ }));
1291
+ };
1292
+ IconBase.displayName = 'IconReact';
1293
+ IconBase.getTwoToneColors = getTwoToneColors;
1294
+ IconBase.setTwoToneColors = setTwoToneColors;
1295
+
1296
+ function setTwoToneColor(twoToneColor) {
1297
+ var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
1298
+ _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
1299
+ primaryColor = _normalizeTwoToneColo2[0],
1300
+ secondaryColor = _normalizeTwoToneColo2[1];
1301
+ return IconBase.setTwoToneColors({
1302
+ primaryColor: primaryColor,
1303
+ secondaryColor: secondaryColor
1304
+ });
1305
+ }
1306
+ function getTwoToneColor() {
1307
+ var colors = IconBase.getTwoToneColors();
1308
+ if (!colors.calculated) {
1309
+ return colors.primaryColor;
1310
+ }
1311
+ return [colors.primaryColor, colors.secondaryColor];
1312
+ }
1313
+
1314
+ var _excluded = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
1315
+ // Initial setting
1316
+ // should move it to antd main repo?
1317
+ setTwoToneColor(blue.primary);
1318
+
1319
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-488848720
1320
+
1321
+ var Icon = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
1322
+ var className = props.className,
1323
+ icon = props.icon,
1324
+ spin = props.spin,
1325
+ rotate = props.rotate,
1326
+ tabIndex = props.tabIndex,
1327
+ onClick = props.onClick,
1328
+ twoToneColor = props.twoToneColor,
1329
+ restProps = _objectWithoutProperties(props, _excluded);
1330
+ var _React$useContext = React__namespace.useContext(IconContext),
1331
+ _React$useContext$pre = _React$useContext.prefixCls,
1332
+ prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,
1333
+ rootClassName = _React$useContext.rootClassName;
1334
+ var classString = classNames(rootClassName, prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), "".concat(prefixCls, "-spin"), !!spin || icon.name === 'loading'), className);
1335
+ var iconTabIndex = tabIndex;
1336
+ if (iconTabIndex === undefined && onClick) {
1337
+ iconTabIndex = -1;
1338
+ }
1339
+ var svgStyle = rotate ? {
1340
+ msTransform: "rotate(".concat(rotate, "deg)"),
1341
+ transform: "rotate(".concat(rotate, "deg)")
1342
+ } : undefined;
1343
+ var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
1344
+ _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
1345
+ primaryColor = _normalizeTwoToneColo2[0],
1346
+ secondaryColor = _normalizeTwoToneColo2[1];
1347
+ return /*#__PURE__*/React__namespace.createElement("span", _extends({
1348
+ role: "img",
1349
+ "aria-label": icon.name
1350
+ }, restProps, {
1351
+ ref: ref,
1352
+ tabIndex: iconTabIndex,
1353
+ onClick: onClick,
1354
+ className: classString
1355
+ }), /*#__PURE__*/React__namespace.createElement(IconBase, {
1356
+ icon: icon,
1357
+ primaryColor: primaryColor,
1358
+ secondaryColor: secondaryColor,
1359
+ style: svgStyle
1360
+ }));
1361
+ });
1362
+ Icon.displayName = 'AntdIcon';
1363
+ Icon.getTwoToneColor = getTwoToneColor;
1364
+ Icon.setTwoToneColor = setTwoToneColor;
1365
+
1366
+ // This icon file is generated automatically.
1367
+ var CodeOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, "name": "code", "theme": "outlined" };
1368
+
1369
+ var CodeOutlined = function CodeOutlined(props, ref) {
1370
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1371
+ ref: ref,
1372
+ icon: CodeOutlined$1
1373
+ }));
1374
+ };
1375
+
1376
+ /**![code](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTUxNiA2NzNjMCA0LjQgMy40IDggNy41IDhoMTg1YzQuMSAwIDcuNS0zLjYgNy41LTh2LTQ4YzAtNC40LTMuNC04LTcuNS04aC0xODVjLTQuMSAwLTcuNSAzLjYtNy41IDh2NDh6bS0xOTQuOSA2LjFsMTkyLTE2MWMzLjgtMy4yIDMuOC05LjEgMC0xMi4zbC0xOTItMTYwLjlBNy45NSA3Ljk1IDAgMDAzMDggMzUxdjYyLjdjMCAyLjQgMSA0LjYgMi45IDYuMUw0MjAuNyA1MTJsLTEwOS44IDkyLjJhOC4xIDguMSAwIDAwLTIuOSA2LjFWNjczYzAgNi44IDcuOSAxMC41IDEzLjEgNi4xek04ODAgMTEySDE0NGMtMTcuNyAwLTMyIDE0LjMtMzIgMzJ2NzM2YzAgMTcuNyAxNC4zIDMyIDMyIDMyaDczNmMxNy43IDAgMzItMTQuMyAzMi0zMlYxNDRjMC0xNy43LTE0LjMtMzItMzItMzJ6bS00MCA3MjhIMTg0VjE4NGg2NTZ2NjU2eiIgLz48L3N2Zz4=) */
1377
+ var RefIcon$8 = /*#__PURE__*/React__namespace.forwardRef(CodeOutlined);
1378
+ if (process.env.NODE_ENV !== 'production') {
1379
+ RefIcon$8.displayName = 'CodeOutlined';
1380
+ }
1381
+
1382
+ // This icon file is generated automatically.
1383
+ var CopyOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z" } }] }, "name": "copy", "theme": "outlined" };
1384
+
1385
+ var CopyOutlined = function CopyOutlined(props, ref) {
1386
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1387
+ ref: ref,
1388
+ icon: CopyOutlined$1
1389
+ }));
1390
+ };
1391
+
1392
+ /**![copy](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTgzMiA2NEgyOTZjLTQuNCAwLTggMy42LTggOHY1NmMwIDQuNCAzLjYgOCA4IDhoNDk2djY4OGMwIDQuNCAzLjYgOCA4IDhoNTZjNC40IDAgOC0zLjYgOC04Vjk2YzAtMTcuNy0xNC4zLTMyLTMyLTMyek03MDQgMTkySDE5MmMtMTcuNyAwLTMyIDE0LjMtMzIgMzJ2NTMwLjdjMCA4LjUgMy40IDE2LjYgOS40IDIyLjZsMTczLjMgMTczLjNjMi4yIDIuMiA0LjcgNCA3LjQgNS41djEuOWg0LjJjMy41IDEuMyA3LjIgMiAxMSAySDcwNGMxNy43IDAgMzItMTQuMyAzMi0zMlYyMjRjMC0xNy43LTE0LjMtMzItMzItMzJ6TTM1MCA4NTYuMkwyNjMuOSA3NzBIMzUwdjg2LjJ6TTY2NCA4ODhINDE0Vjc0NmMwLTIyLjEtMTcuOS00MC00MC00MEgyMzJWMjY0aDQzMnY2MjR6IiAvPjwvc3ZnPg==) */
1393
+ var RefIcon$7 = /*#__PURE__*/React__namespace.forwardRef(CopyOutlined);
1394
+ if (process.env.NODE_ENV !== 'production') {
1395
+ RefIcon$7.displayName = 'CopyOutlined';
1396
+ }
1397
+
1398
+ // This icon file is generated automatically.
1399
+ var DeleteOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, "name": "delete", "theme": "outlined" };
1400
+
1401
+ var DeleteOutlined = function DeleteOutlined(props, ref) {
1402
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1403
+ ref: ref,
1404
+ icon: DeleteOutlined$1
1405
+ }));
1406
+ };
1407
+
1408
+ /**![delete](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTM2MCAxODRoLThjNC40IDAgOC0zLjYgOC04djhoMzA0di04YzAgNC40IDMuNiA4IDggOGgtOHY3Mmg3MnYtODBjMC0zNS4zLTI4LjctNjQtNjQtNjRIMzUyYy0zNS4zIDAtNjQgMjguNy02NCA2NHY4MGg3MnYtNzJ6bTUwNCA3MkgxNjBjLTE3LjcgMC0zMiAxNC4zLTMyIDMydjMyYzAgNC40IDMuNiA4IDggOGg2MC40bDI0LjcgNTIzYzEuNiAzNC4xIDI5LjggNjEgNjMuOSA2MWg0NTRjMzQuMiAwIDYyLjMtMjYuOCA2My45LTYxbDI0LjctNTIzSDg4OGM0LjQgMCA4LTMuNiA4LTh2LTMyYzAtMTcuNy0xNC4zLTMyLTMyLTMyek03MzEuMyA4NDBIMjkyLjdsLTI0LjItNTEyaDQ4N2wtMjQuMiA1MTJ6IiAvPjwvc3ZnPg==) */
1409
+ var RefIcon$6 = /*#__PURE__*/React__namespace.forwardRef(DeleteOutlined);
1410
+ if (process.env.NODE_ENV !== 'production') {
1411
+ RefIcon$6.displayName = 'DeleteOutlined';
1412
+ }
1413
+
1414
+ // This icon file is generated automatically.
1415
+ var EditOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z" } }] }, "name": "edit", "theme": "outlined" };
1416
+
1417
+ var EditOutlined = function EditOutlined(props, ref) {
1418
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1419
+ ref: ref,
1420
+ icon: EditOutlined$1
1421
+ }));
1422
+ };
1423
+
1424
+ /**![edit](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTI1Ny43IDc1MmMyIDAgNC0uMiA2LS41TDQzMS45IDcyMmMyLS40IDMuOS0xLjMgNS4zLTIuOGw0MjMuOS00MjMuOWE5Ljk2IDkuOTYgMCAwMDAtMTQuMUw2OTQuOSAxMTQuOWMtMS45LTEuOS00LjQtMi45LTcuMS0yLjlzLTUuMiAxLTcuMSAyLjlMMjU2LjggNTM4LjhjLTEuNSAxLjUtMi40IDMuMy0yLjggNS4zbC0yOS41IDE2OC4yYTMzLjUgMzMuNSAwIDAwOS40IDI5LjhjNi42IDYuNCAxNC45IDkuOSAyMy44IDkuOXptNjcuNC0xNzQuNEw2ODcuOCAyMTVsNzMuMyA3My4zLTM2Mi43IDM2Mi42LTg4LjkgMTUuNyAxNS42LTg5ek04ODAgODM2SDE0NGMtMTcuNyAwLTMyIDE0LjMtMzIgMzJ2MzZjMCA0LjQgMy42IDggOCA4aDc4NGM0LjQgMCA4LTMuNiA4LTh2LTM2YzAtMTcuNy0xNC4zLTMyLTMyLTMyeiIgLz48L3N2Zz4=) */
1425
+ var RefIcon$5 = /*#__PURE__*/React__namespace.forwardRef(EditOutlined);
1426
+ if (process.env.NODE_ENV !== 'production') {
1427
+ RefIcon$5.displayName = 'EditOutlined';
1428
+ }
1429
+
1430
+ // This icon file is generated automatically.
1431
+ var EyeOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
1432
+
1433
+ var EyeOutlined = function EyeOutlined(props, ref) {
1434
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1435
+ ref: ref,
1436
+ icon: EyeOutlined$1
1437
+ }));
1438
+ };
1439
+
1440
+ /**![eye](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTk0Mi4yIDQ4Ni4yQzg0Ny40IDI4Ni41IDcwNC4xIDE4NiA1MTIgMTg2Yy0xOTIuMiAwLTMzNS40IDEwMC41LTQzMC4yIDMwMC4zYTYwLjMgNjAuMyAwIDAwMCA1MS41QzE3Ni42IDczNy41IDMxOS45IDgzOCA1MTIgODM4YzE5Mi4yIDAgMzM1LjQtMTAwLjUgNDMwLjItMzAwLjMgNy43LTE2LjIgNy43LTM1IDAtNTEuNXpNNTEyIDc2NmMtMTYxLjMgMC0yNzkuNC04MS44LTM2Mi43LTI1NEMyMzIuNiAzMzkuOCAzNTAuNyAyNTggNTEyIDI1OGMxNjEuMyAwIDI3OS40IDgxLjggMzYyLjcgMjU0Qzc5MS41IDY4NC4yIDY3My40IDc2NiA1MTIgNzY2em0tNC00MzBjLTk3LjIgMC0xNzYgNzguOC0xNzYgMTc2czc4LjggMTc2IDE3NiAxNzYgMTc2LTc4LjggMTc2LTE3Ni03OC44LTE3Ni0xNzYtMTc2em0wIDI4OGMtNjEuOSAwLTExMi01MC4xLTExMi0xMTJzNTAuMS0xMTIgMTEyLTExMiAxMTIgNTAuMSAxMTIgMTEyLTUwLjEgMTEyLTExMiAxMTJ6IiAvPjwvc3ZnPg==) */
1441
+ var RefIcon$4 = /*#__PURE__*/React__namespace.forwardRef(EyeOutlined);
1442
+ if (process.env.NODE_ENV !== 'production') {
1443
+ RefIcon$4.displayName = 'EyeOutlined';
1444
+ }
1445
+
1446
+ // This icon file is generated automatically.
1447
+ var FormOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M904 512h-56c-4.4 0-8 3.6-8 8v320H184V184h320c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V520c0-4.4-3.6-8-8-8z" } }, { "tag": "path", "attrs": { "d": "M355.9 534.9L354 653.8c-.1 8.9 7.1 16.2 16 16.2h.4l118-2.9c2-.1 4-.9 5.4-2.3l415.9-415c3.1-3.1 3.1-8.2 0-11.3L785.4 114.3c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-415.8 415a8.3 8.3 0 00-2.3 5.6zm63.5 23.6L779.7 199l45.2 45.1-360.5 359.7-45.7 1.1.7-46.4z" } }] }, "name": "form", "theme": "outlined" };
1448
+
1449
+ var FormOutlined = function FormOutlined(props, ref) {
1450
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1451
+ ref: ref,
1452
+ icon: FormOutlined$1
1453
+ }));
1454
+ };
1455
+
1456
+ /**![form](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkwNCA1MTJoLTU2Yy00LjQgMC04IDMuNi04IDh2MzIwSDE4NFYxODRoMzIwYzQuNCAwIDgtMy42IDgtOHYtNTZjMC00LjQtMy42LTgtOC04SDE0NGMtMTcuNyAwLTMyIDE0LjMtMzIgMzJ2NzM2YzAgMTcuNyAxNC4zIDMyIDMyIDMyaDczNmMxNy43IDAgMzItMTQuMyAzMi0zMlY1MjBjMC00LjQtMy42LTgtOC04eiIgLz48cGF0aCBkPSJNMzU1LjkgNTM0LjlMMzU0IDY1My44Yy0uMSA4LjkgNy4xIDE2LjIgMTYgMTYuMmguNGwxMTgtMi45YzItLjEgNC0uOSA1LjQtMi4zbDQxNS45LTQxNWMzLjEtMy4xIDMuMS04LjIgMC0xMS4zTDc4NS40IDExNC4zYy0xLjYtMS42LTMuNi0yLjMtNS43LTIuM3MtNC4xLjgtNS43IDIuM2wtNDE1LjggNDE1YTguMyA4LjMgMCAwMC0yLjMgNS42em02My41IDIzLjZMNzc5LjcgMTk5bDQ1LjIgNDUuMS0zNjAuNSAzNTkuNy00NS43IDEuMS43LTQ2LjR6IiAvPjwvc3ZnPg==) */
1457
+ var RefIcon$3 = /*#__PURE__*/React__namespace.forwardRef(FormOutlined);
1458
+ if (process.env.NODE_ENV !== 'production') {
1459
+ RefIcon$3.displayName = 'FormOutlined';
1460
+ }
1461
+
1462
+ // This icon file is generated automatically.
1463
+ var PlusOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
1464
+
1465
+ var PlusOutlined = function PlusOutlined(props, ref) {
1466
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1467
+ ref: ref,
1468
+ icon: PlusOutlined$1
1469
+ }));
1470
+ };
1471
+
1472
+ /**![plus](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQ4MiAxNTJoNjBxOCAwIDggOHY3MDRxMCA4LTggOGgtNjBxLTggMC04LThWMTYwcTAtOCA4LTh6IiAvPjxwYXRoIGQ9Ik0xOTIgNDc0aDY3MnE4IDAgOCA4djYwcTAgOC04IDhIMTYwcS04IDAtOC04di02MHEwLTggOC04eiIgLz48L3N2Zz4=) */
1473
+ var RefIcon$2 = /*#__PURE__*/React__namespace.forwardRef(PlusOutlined);
1474
+ if (process.env.NODE_ENV !== 'production') {
1475
+ RefIcon$2.displayName = 'PlusOutlined';
1476
+ }
1477
+
1478
+ // This icon file is generated automatically.
1479
+ var ReloadOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z" } }] }, "name": "reload", "theme": "outlined" };
1480
+
1481
+ var ReloadOutlined = function ReloadOutlined(props, ref) {
1482
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1483
+ ref: ref,
1484
+ icon: ReloadOutlined$1
1485
+ }));
1486
+ };
1487
+
1488
+ /**![reload](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkwOS4xIDIwOS4zbC01Ni40IDQ0LjFDNzc1LjggMTU1LjEgNjU2LjIgOTIgNTIxLjkgOTIgMjkwIDkyIDEwMi4zIDI3OS41IDEwMiA1MTEuNSAxMDEuNyA3NDMuNyAyODkuOCA5MzIgNTIxLjkgOTMyYzE4MS4zIDAgMzM1LjgtMTE1IDM5NC42LTI3Ni4xIDEuNS00LjItLjctOC45LTQuOS0xMC4zbC01Ni43LTE5LjVhOCA4IDAgMDAtMTAuMSA0LjhjLTEuOCA1LTMuOCAxMC01LjkgMTQuOS0xNy4zIDQxLTQyLjEgNzcuOC03My43IDEwOS40QTM0NC43NyAzNDQuNzcgMCAwMTY1NS45IDgyOWMtNDIuMyAxNy45LTg3LjQgMjctMTMzLjggMjctNDYuNSAwLTkxLjUtOS4xLTEzMy44LTI3QTM0MS41IDM0MS41IDAgMDEyNzkgNzU1LjJhMzQyLjE2IDM0Mi4xNiAwIDAxLTczLjctMTA5LjRjLTE3LjktNDIuNC0yNy04Ny40LTI3LTEzMy45czkuMS05MS41IDI3LTEzMy45YzE3LjMtNDEgNDIuMS03Ny44IDczLjctMTA5LjQgMzEuNi0zMS42IDY4LjQtNTYuNCAxMDkuMy03My44IDQyLjMtMTcuOSA4Ny40LTI3IDEzMy44LTI3IDQ2LjUgMCA5MS41IDkuMSAxMzMuOCAyN2EzNDEuNSAzNDEuNSAwIDAxMTA5LjMgNzMuOGM5LjkgOS45IDE5LjIgMjAuNCAyNy44IDMxLjRsLTYwLjIgNDdhOCA4IDAgMDAzIDE0LjFsMTc1LjYgNDNjNSAxLjIgOS45LTIuNiA5LjktNy43bC44LTE4MC45Yy0uMS02LjYtNy44LTEwLjMtMTMtNi4yeiIgLz48L3N2Zz4=) */
1489
+ var RefIcon$1 = /*#__PURE__*/React__namespace.forwardRef(ReloadOutlined);
1490
+ if (process.env.NODE_ENV !== 'production') {
1491
+ RefIcon$1.displayName = 'ReloadOutlined';
1492
+ }
1493
+
1494
+ // This icon file is generated automatically.
1495
+ var SearchOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" };
1496
+
1497
+ var SearchOutlined = function SearchOutlined(props, ref) {
1498
+ return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
1499
+ ref: ref,
1500
+ icon: SearchOutlined$1
1501
+ }));
1502
+ };
1503
+
1504
+ /**![search](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkwOS42IDg1NC41TDY0OS45IDU5NC44QzY5MC4yIDU0Mi43IDcxMiA0NzkgNzEyIDQxMmMwLTgwLjItMzEuMy0xNTUuNC04Ny45LTIxMi4xLTU2LjYtNTYuNy0xMzItODcuOS0yMTIuMS04Ny45cy0xNTUuNSAzMS4zLTIxMi4xIDg3LjlDMTQzLjIgMjU2LjUgMTEyIDMzMS44IDExMiA0MTJjMCA4MC4xIDMxLjMgMTU1LjUgODcuOSAyMTIuMUMyNTYuNSA2ODAuOCAzMzEuOCA3MTIgNDEyIDcxMmM2NyAwIDEzMC42LTIxLjggMTgyLjctNjJsMjU5LjcgMjU5LjZhOC4yIDguMiAwIDAwMTEuNiAwbDQzLjYtNDMuNWE4LjIgOC4yIDAgMDAwLTExLjZ6TTU3MC40IDU3MC40QzUyOCA2MTIuNyA0NzEuOCA2MzYgNDEyIDYzNnMtMTE2LTIzLjMtMTU4LjQtNjUuNkMyMTEuMyA1MjggMTg4IDQ3MS44IDE4OCA0MTJzMjMuMy0xMTYuMSA2NS42LTE1OC40QzI5NiAyMTEuMyAzNTIuMiAxODggNDEyIDE4OHMxMTYuMSAyMy4yIDE1OC40IDY1LjZTNjM2IDM1Mi4yIDYzNiA0MTJzLTIzLjMgMTE2LjEtNjUuNiAxNTguNHoiIC8+PC9zdmc+) */
1505
+ var RefIcon = /*#__PURE__*/React__namespace.forwardRef(SearchOutlined);
1506
+ if (process.env.NODE_ENV !== 'production') {
1507
+ RefIcon.displayName = 'SearchOutlined';
1508
+ }
1509
+
1510
+ /* ─── 工具函数 ──────────────────────────────────────── */
1511
+ /**
1512
+ * 根据数据类型推导默认 UI 组件
1513
+ *
1514
+ * string → input
1515
+ * number → inputNumber
1516
+ * boolean → switch
1517
+ * date → datePicker
1518
+ * datetime → datePicker
1519
+ * array → multiselect
1520
+ * objectArray → editableTable
1521
+ */
1522
+ function defaultWidgetForType(type) {
1523
+ switch (type) {
1524
+ case 'number': return 'inputNumber';
1525
+ case 'boolean': return 'switch';
1526
+ case 'date':
1527
+ case 'datetime': return 'datePicker';
1528
+ case 'array': return 'multiselect';
1529
+ case 'objectArray': return 'editableTable';
1530
+ default: return 'input'; // string
1531
+ }
1532
+ }
1533
+ /** 获取实际生效的组件类型(context.widget > field.widget > type 推导) */
1534
+ function getEffectiveWidget(field, config) {
1535
+ if (config === null || config === void 0 ? void 0 : config.widget)
1536
+ return config.widget;
1537
+ if (field.widget)
1538
+ return field.widget;
1539
+ return defaultWidgetForType(field.type);
1540
+ }
1541
+ /**
1542
+ * 从嵌套对象按点分路径取值
1543
+ *
1544
+ * getNestedValue({ a: { b: 1 } }, 'a.b') → 1
1545
+ * getNestedValue({ x: [1, 2] }, 'x') → [1, 2]
1546
+ */
1547
+ function getNestedValue(obj, path) {
1548
+ return path.split('.').reduce((acc, key) => {
1549
+ if (acc != null && typeof acc === 'object' && !Array.isArray(acc)) {
1550
+ return acc[key];
1551
+ }
1552
+ return undefined;
1553
+ }, obj);
1554
+ }
1555
+ /**
1556
+ * 从点分路径 key 中提取分组前缀(第一个 segment)。
1557
+ * 无前缀的顶层字段返回 null。
1558
+ *
1559
+ * 'emergencyContact.name' → 'emergencyContact'
1560
+ * 'name' → null
1561
+ */
1562
+ function getFieldGroupPrefix(key) {
1563
+ const idx = key.indexOf('.');
1564
+ return idx >= 0 ? key.slice(0, idx) : null;
1565
+ }
1566
+
1567
+ const { RangePicker } = antd.DatePicker;
1568
+ /** 解析 FilterConfig */
1569
+ function getFilterConfig(field) {
1570
+ if (!field.filter || typeof field.filter === 'boolean')
1571
+ return undefined;
1572
+ return field.filter;
1573
+ }
1574
+ /** 获取选项列表(从 field.config 读取) */
1575
+ function getOptions$2(field) {
1576
+ var _a, _b;
1577
+ return (_b = (_a = field.config) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : [];
1578
+ }
1579
+ /** 渲染单个筛选组件 */
1580
+ function renderFilterInput(field, cfg) {
1581
+ var _a, _b;
1582
+ const widget = getEffectiveWidget(field, cfg);
1583
+ const placeholder = (_a = field.config) === null || _a === void 0 ? void 0 : _a.placeholder;
1584
+ const dateFormat = (_b = field.config) === null || _b === void 0 ? void 0 : _b.dateFormat;
1585
+ const options = getOptions$2(field);
1586
+ const style = { width: '100%' };
1587
+ switch (widget) {
1588
+ case 'input':
1589
+ return jsxRuntime.jsx(antd.Input, { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请输入 ${field.label}`, style: style });
1590
+ case 'textarea':
1591
+ return jsxRuntime.jsx(antd.Input.TextArea, { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请输入 ${field.label}`, style: style });
1592
+ case 'inputNumber': {
1593
+ if (cfg === null || cfg === void 0 ? void 0 : cfg.range) {
1594
+ return (jsxRuntime.jsxs(antd.Space, { children: [jsxRuntime.jsx(antd.Form.Item, { name: `${field.key}_min`, noStyle: true, children: jsxRuntime.jsx(antd.InputNumber, { placeholder: "\u6700\u5C0F\u503C" }) }), jsxRuntime.jsx("span", { children: "~" }), jsxRuntime.jsx(antd.Form.Item, { name: `${field.key}_max`, noStyle: true, children: jsxRuntime.jsx(antd.InputNumber, { placeholder: "\u6700\u5927\u503C" }) })] }));
1595
+ }
1596
+ return jsxRuntime.jsx(antd.InputNumber, { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请输入 ${field.label}`, style: style });
1597
+ }
1598
+ case 'select':
1599
+ return (jsxRuntime.jsx(antd.Select, { allowClear: true, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请选择 ${field.label}`, style: style, children: options.map((o) => (jsxRuntime.jsx(antd.Select.Option, { value: o.value, children: o.label }, String(o.value)))) }));
1600
+ case 'multiselect':
1601
+ return (jsxRuntime.jsx(antd.Select, { mode: "multiple", allowClear: true, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请选择 ${field.label}`, style: style, children: options.map((o) => (jsxRuntime.jsx(antd.Select.Option, { value: o.value, children: o.label }, String(o.value)))) }));
1602
+ case 'radio':
1603
+ return (jsxRuntime.jsx(antd.Radio.Group, { style: style, children: options.map((o) => (jsxRuntime.jsx(antd.Radio, { value: o.value, children: o.label }, String(o.value)))) }));
1604
+ case 'switch':
1605
+ return jsxRuntime.jsx(antd.Switch, {});
1606
+ case 'datePicker': {
1607
+ const showTime = field.type === 'datetime';
1608
+ return jsxRuntime.jsx(antd.DatePicker, { showTime: showTime, format: dateFormat, style: style });
1609
+ }
1610
+ case 'rangePicker': {
1611
+ const showTime = field.type === 'datetime';
1612
+ return jsxRuntime.jsx(RangePicker, { showTime: showTime, format: dateFormat, style: style });
1613
+ }
1614
+ case 'timePicker':
1615
+ return jsxRuntime.jsx(antd.DatePicker, { picker: "time", format: dateFormat !== null && dateFormat !== void 0 ? dateFormat : 'HH:mm:ss', style: style });
1616
+ case 'jsonInput':
1617
+ return jsxRuntime.jsx(antd.Input, { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `搜索 ${field.label}`, style: style });
1618
+ default:
1619
+ return jsxRuntime.jsx(antd.Input, { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请输入 ${field.label}`, style: style });
1620
+ }
1621
+ }
1622
+ function DynamicFilter({ schema, onSearch, onReset }) {
1623
+ const [form] = antd.Form.useForm();
1624
+ const [expanded, setExpanded] = React.useState(false);
1625
+ const filterFields = schema.fields.filter((f) => f.filter !== false && f.filter !== undefined && f.type !== 'objectArray');
1626
+ const handleFinish = (values) => {
1627
+ onSearch(values);
1628
+ };
1629
+ const handleReset = () => {
1630
+ form.resetFields();
1631
+ onReset();
1632
+ };
1633
+ const colSpan = { xs: 24, sm: 12, md: 12, lg: 8, xl: 6, xxl: 6 };
1634
+ const visibleFields = expanded ? filterFields : filterFields.slice(0, 4);
1635
+ return (jsxRuntime.jsx(antd.Form, { form: form, onFinish: handleFinish, layout: "vertical", children: jsxRuntime.jsxs(antd.Row, { gutter: [16, 0], children: [visibleFields.map((field) => {
1636
+ const cfg = getFilterConfig(field);
1637
+ const widget = getEffectiveWidget(field, cfg);
1638
+ // inputNumber 数字范围:name 不放在 Form.Item 上,由内部子 Form.Item 承载
1639
+ const isNumberRange = widget === 'inputNumber' && (cfg === null || cfg === void 0 ? void 0 : cfg.range);
1640
+ return (jsxRuntime.jsx(antd.Col, Object.assign({}, colSpan, { children: jsxRuntime.jsx(antd.Form.Item, { label: field.label, name: isNumberRange ? undefined : field.key, valuePropName: widget === 'switch' ? 'checked' : 'value', children: renderFilterInput(field, cfg) }) }), field.key));
1641
+ }), jsxRuntime.jsx(antd.Col, Object.assign({}, colSpan, { children: jsxRuntime.jsx(antd.Form.Item, { label: " ", children: jsxRuntime.jsxs(antd.Space, { children: [jsxRuntime.jsx(antd.Button, { type: "primary", htmlType: "submit", icon: jsxRuntime.jsx(RefIcon, {}), children: "\u641C\u7D22" }), jsxRuntime.jsx(antd.Button, { onClick: handleReset, icon: jsxRuntime.jsx(RefIcon$1, {}), children: "\u91CD\u7F6E" }), filterFields.length > 4 && (jsxRuntime.jsx(antd.Button, { type: "link", onClick: () => setExpanded(!expanded), children: expanded ? '收起' : '展开' }))] }) }) }))] }) }));
1642
+ }
1643
+
1644
+ function getTableConfig(field) {
1645
+ if (!field.table || typeof field.table === 'boolean')
1646
+ return undefined;
1647
+ return field.table;
1648
+ }
1649
+ function getOptions$1(field) {
1650
+ var _a, _b;
1651
+ return (_b = (_a = field.config) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : [];
1652
+ }
1653
+ /** 格式化单元格显示值 */
1654
+ function renderCell(field, value) {
1655
+ var _a, _b, _c, _d, _e, _f;
1656
+ if (value == null || value === '')
1657
+ return jsxRuntime.jsx("span", { style: { color: '#ccc' }, children: "-" });
1658
+ const widget = getEffectiveWidget(field);
1659
+ // ── 布尔类 ──────────────────────────────────────────────
1660
+ if (field.type === 'boolean' || widget === 'switch') {
1661
+ return jsxRuntime.jsx(antd.Switch, { checked: Boolean(value), disabled: true, size: "small" });
1662
+ }
1663
+ // ── 下拉/单选(有 options) ──────────────────────────────
1664
+ if (widget === 'select' || widget === 'radio') {
1665
+ const options = getOptions$1(field);
1666
+ const opt = options.find((o) => o.value === value);
1667
+ if (opt) {
1668
+ return opt.color ? jsxRuntime.jsx(antd.Tag, { color: opt.color, children: opt.label }) : jsxRuntime.jsx("span", { children: opt.label });
1669
+ }
1670
+ return jsxRuntime.jsx("span", { children: String(value) });
1671
+ }
1672
+ // ── 多选(multiselect / checkbox,值为数组) ─────────────
1673
+ if (widget === 'multiselect' || widget === 'checkbox') {
1674
+ const arr = Array.isArray(value) ? value : [value];
1675
+ const options = getOptions$1(field);
1676
+ return (jsxRuntime.jsx(antd.Space, { size: 4, wrap: true, children: arr.map((v) => {
1677
+ const opt = options.find((o) => o.value === v);
1678
+ return opt ? (jsxRuntime.jsx(antd.Tag, { color: opt.color, children: opt.label }, String(v))) : (jsxRuntime.jsx(antd.Tag, { children: String(v) }, String(v)));
1679
+ }) }));
1680
+ }
1681
+ // ── 日期/时间 ────────────────────────────────────────────
1682
+ if (widget === 'datePicker') {
1683
+ const fmt = (_b = (_a = field.config) === null || _a === void 0 ? void 0 : _a.dateFormat) !== null && _b !== void 0 ? _b : (field.type === 'datetime' ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD');
1684
+ const d = dayjs(value);
1685
+ return d.isValid() ? jsxRuntime.jsx("span", { children: d.format(fmt) }) : jsxRuntime.jsx("span", { children: String(value) });
1686
+ }
1687
+ if (widget === 'rangePicker') {
1688
+ if (Array.isArray(value)) {
1689
+ const fmt = (_d = (_c = field.config) === null || _c === void 0 ? void 0 : _c.dateFormat) !== null && _d !== void 0 ? _d : 'YYYY-MM-DD';
1690
+ return jsxRuntime.jsx("span", { children: value.map((v) => (v ? dayjs(v).format(fmt) : '-')).join(' ~ ') });
1691
+ }
1692
+ }
1693
+ if (widget === 'timePicker') {
1694
+ const fmt = (_f = (_e = field.config) === null || _e === void 0 ? void 0 : _e.dateFormat) !== null && _f !== void 0 ? _f : 'HH:mm:ss';
1695
+ const d = dayjs(value);
1696
+ return d.isValid() ? jsxRuntime.jsx("span", { children: d.format(fmt) }) : jsxRuntime.jsx("span", { children: String(value) });
1697
+ }
1698
+ // ── 普通数组(array 基本类型) ───────────────────────────
1699
+ if (field.type === 'array' && Array.isArray(value)) {
1700
+ return (jsxRuntime.jsx(antd.Space, { size: 4, wrap: true, children: value.map((v, i) => (jsxRuntime.jsx(antd.Tag, { children: String(v) }, i))) }));
1701
+ }
1702
+ // ── objectArray / editableTable:显示 N 条记录 ──────────
1703
+ if (field.type === 'objectArray' || widget === 'editableTable') {
1704
+ const arr = Array.isArray(value) ? value : [];
1705
+ return jsxRuntime.jsxs("span", { style: { color: '#888' }, children: [arr.length, " \u6761\u8BB0\u5F55"] });
1706
+ }
1707
+ // ── jsonInput(对象序列化为字符串) ──────────────────────
1708
+ if (widget === 'jsonInput') {
1709
+ if (typeof value === 'object') {
1710
+ const str = JSON.stringify(value);
1711
+ return (jsxRuntime.jsx(antd.Tooltip, { title: jsxRuntime.jsx("pre", { style: { margin: 0, fontSize: 11 }, children: JSON.stringify(value, null, 2) }), children: jsxRuntime.jsx("span", { style: { cursor: 'help', fontFamily: 'monospace', fontSize: 12 }, children: str.length > 40 ? str.slice(0, 40) + '…' : str }) }));
1712
+ }
1713
+ return jsxRuntime.jsx("span", { children: String(value) });
1714
+ }
1715
+ return jsxRuntime.jsx("span", { children: String(value) });
1716
+ }
1717
+ function DynamicTable({ schema, data, loading, pagination, onView, onEdit, onDelete, onCustomAction, }) {
1718
+ var _a, _b, _c, _d, _e, _f;
1719
+ const tableFields = schema.fields.filter((f) => f.table !== false && f.table !== undefined);
1720
+ const columns = tableFields.map((field) => {
1721
+ const cfg = getTableConfig(field);
1722
+ const isNested = field.key.includes('.');
1723
+ return {
1724
+ title: field.label,
1725
+ // 点分路径使用数组形式,Ant Design Table 支持嵌套取值
1726
+ dataIndex: isNested ? field.key.split('.') : field.key,
1727
+ key: field.key,
1728
+ width: cfg === null || cfg === void 0 ? void 0 : cfg.width,
1729
+ fixed: cfg === null || cfg === void 0 ? void 0 : cfg.fixed,
1730
+ ellipsis: cfg === null || cfg === void 0 ? void 0 : cfg.ellipsis,
1731
+ sorter: cfg === null || cfg === void 0 ? void 0 : cfg.sortable,
1732
+ render: (_value, record) => {
1733
+ // 统一使用 getNestedValue 以支持多层点分路径
1734
+ const actualValue = isNested ? getNestedValue(record, field.key) : _value;
1735
+ return renderCell(field, actualValue);
1736
+ },
1737
+ };
1738
+ });
1739
+ const copyJson = (record) => {
1740
+ navigator.clipboard.writeText(JSON.stringify(record, null, 2))
1741
+ .then(() => void antd.message.success('已复制 JSON'))
1742
+ .catch(() => void antd.message.error('复制失败'));
1743
+ };
1744
+ // 操作列(有 schema.actions 或始终存在,以便展示复制按钮)
1745
+ columns.push({
1746
+ title: '操作',
1747
+ key: '__actions',
1748
+ fixed: 'right',
1749
+ width: ((_b = (_a = schema.actions) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) * 60 + 60,
1750
+ render: (_, record) => {
1751
+ var _a;
1752
+ return (jsxRuntime.jsxs(antd.Space, { size: 4, children: [((_a = schema.actions) !== null && _a !== void 0 ? _a : []).map((action) => {
1753
+ var _a, _b, _c;
1754
+ if (action.type === 'view') {
1755
+ return (jsxRuntime.jsx(antd.Tooltip, { title: action.label, children: jsxRuntime.jsx(antd.Button, { type: "link", size: "small", icon: jsxRuntime.jsx(RefIcon$4, {}), onClick: () => onView(record) }) }, action.key));
1756
+ }
1757
+ if (action.type === 'edit') {
1758
+ return (jsxRuntime.jsx(antd.Tooltip, { title: action.label, children: jsxRuntime.jsx(antd.Button, { type: "link", size: "small", icon: jsxRuntime.jsx(RefIcon$5, {}), onClick: () => onEdit(record) }) }, action.key));
1759
+ }
1760
+ if (action.type === 'delete') {
1761
+ return (jsxRuntime.jsx(antd.Popconfirm, { title: (_b = (_a = action.confirm) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : '确定删除?', description: (_c = action.confirm) === null || _c === void 0 ? void 0 : _c.content, onConfirm: () => onDelete(record), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88", okButtonProps: { danger: true }, children: jsxRuntime.jsx(antd.Tooltip, { title: action.label, children: jsxRuntime.jsx(antd.Button, { type: "link", size: "small", danger: true, icon: jsxRuntime.jsx(RefIcon$6, {}) }) }) }, action.key));
1762
+ }
1763
+ return (jsxRuntime.jsx(antd.Tooltip, { title: action.label, children: jsxRuntime.jsx(antd.Button, { type: "link", size: "small", onClick: () => onCustomAction === null || onCustomAction === void 0 ? void 0 : onCustomAction(action.key, record), children: action.label }) }, action.key));
1764
+ }), jsxRuntime.jsx(antd.Tooltip, { title: "\u590D\u5236 JSON", children: jsxRuntime.jsx(antd.Button, { type: "link", size: "small", icon: jsxRuntime.jsx(RefIcon$7, {}), onClick: () => copyJson(record) }) })] }));
1765
+ },
1766
+ });
1767
+ return (jsxRuntime.jsx(antd.Table, { rowKey: (_c = schema.rowKey) !== null && _c !== void 0 ? _c : 'id', columns: columns, dataSource: data, loading: loading, scroll: { x: 'max-content' }, pagination: {
1768
+ current: pagination.current,
1769
+ pageSize: pagination.pageSize,
1770
+ total: pagination.total,
1771
+ showSizeChanger: true,
1772
+ showTotal: ((_d = schema.pagination) === null || _d === void 0 ? void 0 : _d.showTotal)
1773
+ ? (total) => `共 ${total} 条`
1774
+ : undefined,
1775
+ onChange: pagination.onChange,
1776
+ pageSizeOptions: (_f = (_e = schema.pagination) === null || _e === void 0 ? void 0 : _e.pageSizeOptions) !== null && _f !== void 0 ? _f : [10, 20, 50],
1777
+ } }));
1778
+ }
1779
+
1780
+ /** 内置规则集 */
1781
+ const BUILTIN_RULES = [
1782
+ {
1783
+ key: 'phone_cn',
1784
+ label: '手机号(中国大陆)',
1785
+ description: '1 开头的 11 位数字',
1786
+ message: '请输入正确的手机号',
1787
+ pattern: '^1[3-9]\\d{9}$',
1788
+ builtin: true,
1789
+ },
1790
+ {
1791
+ key: 'email',
1792
+ label: '邮箱地址',
1793
+ description: '标准电子邮箱格式',
1794
+ message: '请输入正确的邮箱地址',
1795
+ type: 'email',
1796
+ builtin: true,
1797
+ },
1798
+ {
1799
+ key: 'url',
1800
+ label: 'URL 链接',
1801
+ description: '以 http/https 开头的合法 URL',
1802
+ message: '请输入正确的 URL 地址',
1803
+ type: 'url',
1804
+ builtin: true,
1805
+ },
1806
+ {
1807
+ key: 'id_card_cn',
1808
+ label: '居民身份证(中国)',
1809
+ description: '18 位二代身份证号码',
1810
+ message: '请输入正确的身份证号',
1811
+ pattern: '^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]$',
1812
+ builtin: true,
1813
+ },
1814
+ {
1815
+ key: 'positive_integer',
1816
+ label: '正整数',
1817
+ description: '大于 0 的整数',
1818
+ message: '请输入正整数',
1819
+ pattern: '^[1-9]\\d*$',
1820
+ builtin: true,
1821
+ },
1822
+ {
1823
+ key: 'non_negative_integer',
1824
+ label: '非负整数',
1825
+ description: '0 或大于 0 的整数',
1826
+ message: '请输入非负整数',
1827
+ pattern: '^\\d+$',
1828
+ builtin: true,
1829
+ },
1830
+ {
1831
+ key: 'chinese',
1832
+ label: '纯中文',
1833
+ description: '只能包含中文字符',
1834
+ message: '只能输入中文字符',
1835
+ pattern: '^[\\u4e00-\\u9fa5]+$',
1836
+ builtin: true,
1837
+ },
1838
+ {
1839
+ key: 'alphanumeric',
1840
+ label: '字母和数字',
1841
+ description: '只能包含英文字母和数字',
1842
+ message: '只能输入字母和数字',
1843
+ pattern: '^[a-zA-Z0-9]+$',
1844
+ builtin: true,
1845
+ },
1846
+ {
1847
+ key: 'no_special_chars',
1848
+ label: '无特殊字符',
1849
+ description: '只允许中文、字母、数字、下划线、短横线',
1850
+ message: '不能包含特殊字符',
1851
+ pattern: '^[a-zA-Z0-9\\u4e00-\\u9fa5_-]+$',
1852
+ builtin: true,
1853
+ },
1854
+ {
1855
+ key: 'ip_address',
1856
+ label: 'IPv4 地址',
1857
+ description: '标准 IPv4 地址格式',
1858
+ message: '请输入正确的 IP 地址',
1859
+ pattern: '^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$',
1860
+ builtin: true,
1861
+ },
1862
+ {
1863
+ key: 'date_format',
1864
+ label: '日期格式 (YYYY-MM-DD)',
1865
+ description: '格式如 2024-01-01',
1866
+ message: '请输入正确的日期格式,如 2024-01-01',
1867
+ pattern: '^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$',
1868
+ builtin: true,
1869
+ },
1870
+ {
1871
+ key: 'no_whitespace',
1872
+ label: '不含空格',
1873
+ description: '不允许包含任何空白字符',
1874
+ message: '不能包含空格',
1875
+ pattern: '^\\S+$',
1876
+ builtin: true,
1877
+ },
1878
+ {
1879
+ key: 'min_len_2',
1880
+ label: '最少 2 个字符',
1881
+ description: '字符串长度不少于 2',
1882
+ message: '长度不能少于 2 个字符',
1883
+ min: 2,
1884
+ builtin: true,
1885
+ },
1886
+ {
1887
+ key: 'max_len_50',
1888
+ label: '最多 50 个字符',
1889
+ description: '字符串长度不超过 50',
1890
+ message: '长度不能超过 50 个字符',
1891
+ max: 50,
1892
+ builtin: true,
1893
+ },
1894
+ {
1895
+ key: 'max_len_200',
1896
+ label: '最多 200 个字符',
1897
+ description: '字符串长度不超过 200',
1898
+ message: '长度不能超过 200 个字符',
1899
+ max: 200,
1900
+ builtin: true,
1901
+ },
1902
+ {
1903
+ key: 'bank_card',
1904
+ label: '银行卡号',
1905
+ description: '16-19 位纯数字',
1906
+ message: '请输入正确的银行卡号',
1907
+ pattern: '^\\d{16,19}$',
1908
+ builtin: true,
1909
+ },
1910
+ {
1911
+ key: 'plate_cn',
1912
+ label: '车牌号(中国)',
1913
+ description: '含新能源车牌在内的中国大陆车牌',
1914
+ message: '请输入正确的车牌号',
1915
+ pattern: '^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤川青藏琼宁夏][A-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$',
1916
+ builtin: true,
1917
+ },
1918
+ {
1919
+ key: 'postal_code_cn',
1920
+ label: '邮政编码(中国)',
1921
+ description: '6 位数字邮编',
1922
+ message: '请输入正确的邮政编码',
1923
+ pattern: '^\\d{6}$',
1924
+ builtin: true,
1925
+ },
1926
+ ];
1927
+ const CUSTOM_RULES_STORAGE_KEY = 'dynamic_crud_custom_rules';
1928
+ function loadCustomRules() {
1929
+ try {
1930
+ const raw = localStorage.getItem(CUSTOM_RULES_STORAGE_KEY);
1931
+ return raw ? JSON.parse(raw) : [];
1932
+ }
1933
+ catch (_a) {
1934
+ return [];
1935
+ }
1936
+ }
1937
+ function saveCustomRules(rules) {
1938
+ try {
1939
+ localStorage.setItem(CUSTOM_RULES_STORAGE_KEY, JSON.stringify(rules));
1940
+ }
1941
+ catch ( /* ignore */_a) { /* ignore */ }
1942
+ }
1943
+ /** 获取所有规则(内置 + 自定义) */
1944
+ function getAllRules() {
1945
+ return [...BUILTIN_RULES, ...loadCustomRules()];
1946
+ }
1947
+ /** 根据 key 查找规则 */
1948
+ function getRuleByKey(key) {
1949
+ return getAllRules().find(r => r.key === key);
1950
+ }
1951
+ /** 将规则配置转为 Ant Design Form Rule */
1952
+ function ruleConfigToAntdRule(config) {
1953
+ const rule = { message: config.message };
1954
+ if (config.pattern) {
1955
+ rule.pattern = new RegExp(config.pattern);
1956
+ }
1957
+ if (config.type) {
1958
+ rule.type = config.type;
1959
+ }
1960
+ if (config.min !== undefined) {
1961
+ rule.min = config.min;
1962
+ }
1963
+ if (config.max !== undefined) {
1964
+ rule.max = config.max;
1965
+ }
1966
+ if (config.whitespace !== undefined) {
1967
+ rule.whitespace = config.whitespace;
1968
+ }
1969
+ return rule;
1970
+ }
1971
+ /** 将一组规则 key 转为 Ant Design Form Rules 数组 */
1972
+ function keysToAntdRules(keys) {
1973
+ return keys
1974
+ .map(k => getRuleByKey(k))
1975
+ .filter((c) => c !== undefined)
1976
+ .map(ruleConfigToAntdRule);
1977
+ }
1978
+
1979
+ dayjs.extend(customParseFormat);
1980
+ function getFormConfig(field) {
1981
+ if (!field.form || typeof field.form === 'boolean')
1982
+ return undefined;
1983
+ return field.form;
1984
+ }
1985
+ function getOptions(field) {
1986
+ var _a, _b;
1987
+ return (_b = (_a = field.config) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : [];
1988
+ }
1989
+ /** 将 camelCase 前缀转为可读标签(仅首字母大写) */
1990
+ function prefixToLabel(prefix) {
1991
+ return prefix.replace(/([A-Z])/g, ' $1').replace(/^./, (s) => s.toUpperCase()).trim();
1992
+ }
1993
+ /** 设置嵌套对象指定路径的值(修改原对象) */
1994
+ function setNestedValue(obj, path, value) {
1995
+ let cur = obj;
1996
+ for (let i = 0; i < path.length - 1; i++) {
1997
+ const k = path[i];
1998
+ if (cur[k] == null || typeof cur[k] !== 'object' || Array.isArray(cur[k])) {
1999
+ cur[k] = {};
2000
+ }
2001
+ cur = cur[k];
2002
+ }
2003
+ cur[path[path.length - 1]] = value;
2004
+ }
2005
+ /** 行内可编辑表格 cell 组件 */
2006
+ function EditableCellInput({ itemField, disabled, value, onChange, }) {
2007
+ var _a, _b, _c, _d, _e, _f;
2008
+ const ph = (_b = (_a = itemField.config) === null || _a === void 0 ? void 0 : _a.placeholder) !== null && _b !== void 0 ? _b : `请输入${itemField.label}`;
2009
+ switch (itemField.type) {
2010
+ case 'number':
2011
+ return (jsxRuntime.jsx(antd.InputNumber, { disabled: disabled, placeholder: ph, value: value, onChange: (v) => onChange === null || onChange === void 0 ? void 0 : onChange(v), style: { width: '100%' } }));
2012
+ case 'boolean':
2013
+ // Form.Item 默认 valuePropName="value",这里手动映射到 checked
2014
+ return (jsxRuntime.jsx(antd.Switch, { disabled: disabled, checked: value, onChange: (checked) => onChange === null || onChange === void 0 ? void 0 : onChange(checked) }));
2015
+ case 'date':
2016
+ case 'datetime': {
2017
+ const fmt = (_d = (_c = itemField.config) === null || _c === void 0 ? void 0 : _c.dateFormat) !== null && _d !== void 0 ? _d : (itemField.type === 'datetime' ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD');
2018
+ // value 可能是字符串(来自 initialValues)或 dayjs 对象(用户选择后)
2019
+ const pickerValue = value != null
2020
+ ? (dayjs.isDayjs(value) ? value : dayjs(value))
2021
+ : null;
2022
+ return (jsxRuntime.jsx(antd.DatePicker, { disabled: disabled, format: fmt, value: pickerValue, onChange: (v) => onChange === null || onChange === void 0 ? void 0 : onChange(v), style: { width: '100%' } }));
2023
+ }
2024
+ case 'string': {
2025
+ if (itemField.widget === 'select' && ((_f = (_e = itemField.config) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.length)) {
2026
+ return (jsxRuntime.jsx(antd.Select, { disabled: disabled, allowClear: true, placeholder: ph, value: value, onChange: (v) => onChange === null || onChange === void 0 ? void 0 : onChange(v), style: { width: '100%' }, children: itemField.config.options.map((o) => (jsxRuntime.jsx(antd.Select.Option, { value: o.value, children: o.label }, String(o.value)))) }));
2027
+ }
2028
+ return (jsxRuntime.jsx(antd.Input, { disabled: disabled, placeholder: ph, value: value, onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value) }));
2029
+ }
2030
+ default:
2031
+ return (jsxRuntime.jsx(antd.Input, { disabled: disabled, placeholder: ph, value: value, onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value) }));
2032
+ }
2033
+ }
2034
+ function renderFormInput(field, cfg, disabled) {
2035
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2036
+ const widget = getEffectiveWidget(field, cfg);
2037
+ const options = getOptions(field);
2038
+ const placeholder = (_a = field.config) === null || _a === void 0 ? void 0 : _a.placeholder;
2039
+ const rows = (_b = field.config) === null || _b === void 0 ? void 0 : _b.rows;
2040
+ const style = { width: '100%' };
2041
+ switch (widget) {
2042
+ case 'input':
2043
+ return jsxRuntime.jsx(antd.Input, { disabled: disabled, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请输入 ${field.label}`, style: style });
2044
+ case 'textarea':
2045
+ return (jsxRuntime.jsx(antd.Input.TextArea, { disabled: disabled, rows: rows !== null && rows !== void 0 ? rows : 4, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请输入 ${field.label}`, style: style }));
2046
+ case 'jsonInput':
2047
+ return (jsxRuntime.jsx(antd.Input.TextArea, { disabled: disabled, rows: rows !== null && rows !== void 0 ? rows : 5, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : '请输入 JSON', style: Object.assign(Object.assign({}, style), { fontFamily: 'monospace', fontSize: 12 }) }));
2048
+ case 'inputNumber':
2049
+ return (jsxRuntime.jsx(antd.InputNumber, { disabled: disabled, min: cfg === null || cfg === void 0 ? void 0 : cfg.min, max: cfg === null || cfg === void 0 ? void 0 : cfg.max, step: (_c = cfg === null || cfg === void 0 ? void 0 : cfg.step) !== null && _c !== void 0 ? _c : 1, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请输入 ${field.label}`, style: style }));
2050
+ case 'select':
2051
+ return (jsxRuntime.jsx(antd.Select, { disabled: disabled, allowClear: true, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请选择 ${field.label}`, style: style, children: options.map((o) => (jsxRuntime.jsx(antd.Select.Option, { value: o.value, children: o.label }, String(o.value)))) }));
2052
+ case 'multiselect':
2053
+ return (jsxRuntime.jsx(antd.Select, { mode: "multiple", disabled: disabled, allowClear: true, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请选择 ${field.label}`, style: style, children: options.map((o) => (jsxRuntime.jsx(antd.Select.Option, { value: o.value, children: o.label }, String(o.value)))) }));
2054
+ case 'radio':
2055
+ return (jsxRuntime.jsx(antd.Radio.Group, { disabled: disabled, children: options.map((o) => (jsxRuntime.jsx(antd.Radio, { value: o.value, children: o.label }, String(o.value)))) }));
2056
+ case 'checkbox':
2057
+ return (jsxRuntime.jsx(antd.Checkbox.Group, { disabled: disabled, children: jsxRuntime.jsx(antd.Space, { wrap: true, children: options.map((o) => (jsxRuntime.jsx(antd.Checkbox, { value: o.value, children: o.label }, String(o.value)))) }) }));
2058
+ case 'switch':
2059
+ return jsxRuntime.jsx(antd.Switch, { disabled: disabled });
2060
+ case 'datePicker': {
2061
+ const showTime = field.type === 'datetime';
2062
+ const format = (_e = (_d = field.config) === null || _d === void 0 ? void 0 : _d.dateFormat) !== null && _e !== void 0 ? _e : (showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD');
2063
+ return jsxRuntime.jsx(antd.DatePicker, { disabled: disabled, showTime: showTime, format: format, style: style });
2064
+ }
2065
+ case 'rangePicker': {
2066
+ const showTime = field.type === 'datetime';
2067
+ const format = (_g = (_f = field.config) === null || _f === void 0 ? void 0 : _f.dateFormat) !== null && _g !== void 0 ? _g : (showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD');
2068
+ return jsxRuntime.jsx(antd.DatePicker.RangePicker, { disabled: disabled, showTime: showTime, format: format, style: style });
2069
+ }
2070
+ case 'timePicker':
2071
+ return (jsxRuntime.jsx(antd.DatePicker, { picker: "time", disabled: disabled, format: (_j = (_h = field.config) === null || _h === void 0 ? void 0 : _h.dateFormat) !== null && _j !== void 0 ? _j : 'HH:mm:ss', style: style }));
2072
+ case 'editableTable': {
2073
+ const itemFields = (_k = field.itemFields) !== null && _k !== void 0 ? _k : [];
2074
+ return (jsxRuntime.jsx(antd.Form.List, { name: field.key, children: (listFields, { add, remove }) => {
2075
+ const columns = [
2076
+ ...itemFields.map((itemField) => ({
2077
+ title: itemField.label,
2078
+ dataIndex: itemField.key,
2079
+ width: itemField.width,
2080
+ render: (_, record) => (jsxRuntime.jsx(antd.Form.Item, { name: [record.name, itemField.key], rules: itemField.required ? [{ required: true, message: `${itemField.label}必填` }] : undefined, style: { margin: 0 }, children: jsxRuntime.jsx(EditableCellInput, { itemField: itemField, disabled: disabled }) })),
2081
+ })),
2082
+ ...(!disabled
2083
+ ? [{
2084
+ title: '',
2085
+ width: 50,
2086
+ render: (_, record) => (jsxRuntime.jsx(antd.Button, { type: "text", danger: true, icon: jsxRuntime.jsx(RefIcon$6, {}), onClick: () => remove(record.name) })),
2087
+ }]
2088
+ : []),
2089
+ ];
2090
+ return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(antd.Table, { size: "small", dataSource: listFields.map((f) => (Object.assign(Object.assign({}, f), { _key: f.key }))), rowKey: "_key", columns: columns, pagination: false, style: { marginBottom: 8 } }), !disabled && (jsxRuntime.jsx(antd.Button, { type: "dashed", icon: jsxRuntime.jsx(RefIcon$2, {}), onClick: () => add({}), block: true, children: "\u6DFB\u52A0\u4E00\u884C" }))] }));
2091
+ } }));
2092
+ }
2093
+ default:
2094
+ return jsxRuntime.jsx(antd.Input, { disabled: disabled, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : `请输入 ${field.label}`, style: style });
2095
+ }
2096
+ }
2097
+ /**
2098
+ * 将接口数据转为 Form 使用的初始值。
2099
+ *
2100
+ * - 顶层字段:直接展开(与原来相同)
2101
+ * - dot-path 字段(如 `emergencyContact.name`):
2102
+ * API 返回的数据已是嵌套结构,form.setFieldsValue 可直接识别
2103
+ * - 日期字段:将字符串转为 dayjs 对象
2104
+ */
2105
+ function normalizeInitialValues(fields, values) {
2106
+ if (!values)
2107
+ return {};
2108
+ // 深拷贝,避免修改原对象
2109
+ const result = JSON.parse(JSON.stringify(values));
2110
+ fields.forEach((field) => {
2111
+ var _a, _b;
2112
+ const cfg = getFormConfig(field);
2113
+ const widget = getEffectiveWidget(field, cfg);
2114
+ if (widget !== 'datePicker' && widget !== 'rangePicker' && widget !== 'timePicker')
2115
+ return;
2116
+ const path = field.key.split('.');
2117
+ const val = path.length > 1 ? getNestedValue(result, field.key) : result[field.key];
2118
+ if (val == null)
2119
+ return;
2120
+ if (widget === 'rangePicker' && Array.isArray(val)) {
2121
+ setNestedValue(result, path, val.map((v) => {
2122
+ if (!v)
2123
+ return null;
2124
+ return dayjs.isDayjs(v) ? v : dayjs(v);
2125
+ }));
2126
+ }
2127
+ else if (val) {
2128
+ // 检查是否已经是 dayjs 对象,避免重复转换
2129
+ if (dayjs.isDayjs(val)) {
2130
+ setNestedValue(result, path, val);
2131
+ }
2132
+ else {
2133
+ // timePicker 存储的是纯时间字符串(如 "09:30:00"),需要带 format 解析
2134
+ const fmt = widget === 'timePicker'
2135
+ ? ((_b = (_a = field.config) === null || _a === void 0 ? void 0 : _a.dateFormat) !== null && _b !== void 0 ? _b : 'HH:mm:ss')
2136
+ : undefined;
2137
+ setNestedValue(result, path, fmt ? dayjs(val, fmt) : dayjs(val));
2138
+ }
2139
+ }
2140
+ });
2141
+ return result;
2142
+ }
2143
+ /** 将 Form 值序列化为提交数据(dayjs → ISO string) */
2144
+ function serializeValues(fields, values) {
2145
+ const result = JSON.parse(JSON.stringify(values));
2146
+ fields.forEach((field) => {
2147
+ var _a, _b;
2148
+ const cfg = getFormConfig(field);
2149
+ const widget = getEffectiveWidget(field, cfg);
2150
+ if (widget !== 'datePicker' && widget !== 'rangePicker' && widget !== 'timePicker')
2151
+ return;
2152
+ const path = field.key.split('.');
2153
+ // 必须从原始 values 读(dayjs 对象仍存在),
2154
+ // 不能从 result 读——JSON.parse(JSON.stringify) 已把 dayjs 序列化为 ISO 字符串,
2155
+ // 导致 dayjs.isDayjs() 全部失败(rangePicker 变成 [null, null])。
2156
+ const val = path.length > 1 ? getNestedValue(values, field.key) : values[field.key];
2157
+ if (val == null)
2158
+ return;
2159
+ if (widget === 'timePicker' && dayjs.isDayjs(val)) {
2160
+ const fmt = (_b = (_a = field.config) === null || _a === void 0 ? void 0 : _a.dateFormat) !== null && _b !== void 0 ? _b : 'HH:mm:ss';
2161
+ setNestedValue(result, path, val.format(fmt));
2162
+ }
2163
+ else if (widget === 'datePicker' && dayjs.isDayjs(val)) {
2164
+ setNestedValue(result, path, val.toISOString());
2165
+ }
2166
+ else if (widget === 'rangePicker' && Array.isArray(val)) {
2167
+ setNestedValue(result, path, val.map((v) => (v && dayjs.isDayjs(v) ? v.toISOString() : null)));
2168
+ }
2169
+ });
2170
+ return result;
2171
+ }
2172
+ /** 渲染单个 Form.Item */
2173
+ function renderField(field, disabled) {
2174
+ var _a;
2175
+ const cfg = getFormConfig(field);
2176
+ const widget = getEffectiveWidget(field, cfg);
2177
+ const required = !disabled && ((_a = cfg === null || cfg === void 0 ? void 0 : cfg.required) !== null && _a !== void 0 ? _a : false);
2178
+ // editableTable 使用 Form.List,不能再套 Form.Item name
2179
+ if (widget === 'editableTable') {
2180
+ return (jsxRuntime.jsx(antd.Form.Item, { label: field.label, style: { marginBottom: 14 }, children: renderFormInput(field, cfg, disabled) }, field.key));
2181
+ }
2182
+ const namePath = field.key.includes('.') ? field.key.split('.') : field.key;
2183
+ const extraRules = field.rules && !disabled ? keysToAntdRules(field.rules) : [];
2184
+ const validationRules = [
2185
+ ...(required ? [{ required: true, message: `请输入 ${field.label}` }] : []),
2186
+ ...extraRules,
2187
+ ];
2188
+ return (jsxRuntime.jsx(antd.Form.Item, { label: field.label, name: namePath, valuePropName: widget === 'switch' ? 'checked' : 'value', rules: validationRules, style: { marginBottom: 14 }, children: renderFormInput(field, cfg, disabled) }, field.key));
2189
+ }
2190
+ function DynamicForm({ schema, mode, visible, initialValues, onSubmit, onCancel, }) {
2191
+ const [form] = antd.Form.useForm();
2192
+ const [rawJsonMode, setRawJsonMode] = React.useState(false);
2193
+ const [rawJsonText, setRawJsonText] = React.useState('');
2194
+ const [rawJsonError, setRawJsonError] = React.useState('');
2195
+ const disabled = mode === 'view';
2196
+ const entityName = schema.title.replace(/管理$/, '');
2197
+ const titleMap = {
2198
+ create: `新增${entityName}`,
2199
+ edit: `编辑${entityName}`,
2200
+ view: `查看${entityName}`,
2201
+ };
2202
+ const formFields = schema.fields.filter((f) => {
2203
+ if (mode === 'view')
2204
+ return f.table !== false && f.table !== undefined;
2205
+ return f.form !== false && f.form !== undefined;
2206
+ });
2207
+ React.useEffect(() => {
2208
+ if (!visible) {
2209
+ form.resetFields();
2210
+ setRawJsonMode(false);
2211
+ setRawJsonText('');
2212
+ setRawJsonError('');
2213
+ }
2214
+ else {
2215
+ // 模态框打开时,根据模式设置表单值
2216
+ if (mode === 'create') {
2217
+ // 新增模式:清空表单并确保没有残留数据
2218
+ form.resetFields();
2219
+ form.setFieldsValue({});
2220
+ }
2221
+ else {
2222
+ // 编辑/查看模式设置初始值
2223
+ const normalized = normalizeInitialValues(formFields, initialValues);
2224
+ form.setFieldsValue(normalized);
2225
+ }
2226
+ }
2227
+ }, [visible, mode, initialValues]);
2228
+ const switchToRaw = () => {
2229
+ // getFieldsValue(true) 返回 store 全量数据(含 id 等非 Form.Item 字段)
2230
+ const rawValues = disabled
2231
+ ? (initialValues !== null && initialValues !== void 0 ? initialValues : {})
2232
+ : form.getFieldsValue(true);
2233
+ const serialized = disabled ? rawValues : serializeValues(formFields, rawValues);
2234
+ setRawJsonText(JSON.stringify(serialized, null, 2));
2235
+ setRawJsonError('');
2236
+ setRawJsonMode(true);
2237
+ };
2238
+ const switchToForm = () => {
2239
+ if (!disabled) {
2240
+ try {
2241
+ const parsed = JSON.parse(rawJsonText);
2242
+ form.setFieldsValue(normalizeInitialValues(formFields, parsed));
2243
+ setRawJsonError('');
2244
+ }
2245
+ catch (_a) {
2246
+ setRawJsonError('JSON 格式错误,请修正后再切换');
2247
+ return;
2248
+ }
2249
+ }
2250
+ setRawJsonMode(false);
2251
+ };
2252
+ const handleOk = async () => {
2253
+ if (disabled) {
2254
+ onCancel();
2255
+ return;
2256
+ }
2257
+ if (rawJsonMode) {
2258
+ try {
2259
+ const parsed = JSON.parse(rawJsonText);
2260
+ onSubmit(parsed);
2261
+ }
2262
+ catch (_a) {
2263
+ setRawJsonError('JSON 格式错误,无法提交');
2264
+ }
2265
+ return;
2266
+ }
2267
+ const values = await form.validateFields();
2268
+ onSubmit(serializeValues(formFields, values));
2269
+ };
2270
+ /**
2271
+ * 将字段列表按 dot-path 前缀分组渲染:
2272
+ * - 无前缀字段:直接渲染
2273
+ * - 有前缀的字段:相同前缀聚合到一个带标题的 Card 中
2274
+ */
2275
+ const renderFieldGroups = () => {
2276
+ const nodes = [];
2277
+ let i = 0;
2278
+ while (i < formFields.length) {
2279
+ const field = formFields[i];
2280
+ const prefix = getFieldGroupPrefix(field.key);
2281
+ if (!prefix) {
2282
+ nodes.push(renderField(field, disabled));
2283
+ i++;
2284
+ }
2285
+ else {
2286
+ // 收集相同前缀的连续字段
2287
+ const groupFields = [];
2288
+ while (i < formFields.length && getFieldGroupPrefix(formFields[i].key) === prefix) {
2289
+ groupFields.push(formFields[i]);
2290
+ i++;
2291
+ }
2292
+ nodes.push(jsxRuntime.jsxs("div", { style: { marginBottom: 16 }, children: [jsxRuntime.jsx(antd.Divider, { style: { fontSize: 13, color: '#666', margin: '8px 0 12px' }, children: prefixToLabel(prefix) }), jsxRuntime.jsx(antd.Card, { size: "small", style: { background: '#fafafa', borderRadius: 6 }, styles: { body: { paddingBottom: 4 } }, children: groupFields.map((gf) => renderField(gf, disabled)) })] }, prefix));
2293
+ }
2294
+ }
2295
+ return nodes;
2296
+ };
2297
+ const copyRawJson = () => {
2298
+ const json = rawJsonMode
2299
+ ? rawJsonText
2300
+ : JSON.stringify(disabled
2301
+ ? (initialValues !== null && initialValues !== void 0 ? initialValues : {})
2302
+ : serializeValues(formFields, form.getFieldsValue(true)), null, 2);
2303
+ navigator.clipboard.writeText(json)
2304
+ .then(() => void antd.message.success('已复制 JSON'))
2305
+ .catch(() => void antd.message.error('复制失败'));
2306
+ };
2307
+ const modalTitle = (jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', paddingRight: 32 }, children: [jsxRuntime.jsx("span", { children: titleMap[mode] }), jsxRuntime.jsx(antd.Space, { size: 8, children: jsxRuntime.jsx(antd.Button, { size: "small", type: "text", icon: rawJsonMode ? jsxRuntime.jsx(RefIcon$3, {}) : jsxRuntime.jsx(RefIcon$8, {}), onClick: rawJsonMode ? switchToForm : switchToRaw, children: rawJsonMode ? '表单视图' : 'Raw JSON' }) })] }));
2308
+ return (jsxRuntime.jsxs(antd.Modal, { title: modalTitle, open: visible, onOk: handleOk, onCancel: onCancel, okText: disabled ? '关闭' : '确认', cancelText: "\u53D6\u6D88", cancelButtonProps: disabled ? { style: { display: 'none' } } : {}, width: 720, destroyOnClose: true, children: [jsxRuntime.jsx("div", { style: { display: rawJsonMode ? 'none' : undefined }, children: jsxRuntime.jsx(antd.Form, { form: form, layout: "vertical", initialValues: mode === 'create' ? {} : normalizeInitialValues(formFields, initialValues), children: renderFieldGroups() }) }), rawJsonMode && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(antd.Input.TextArea, { value: rawJsonText, onChange: disabled ? undefined : (e) => { setRawJsonText(e.target.value); setRawJsonError(''); }, readOnly: disabled, rows: 20, style: { fontFamily: 'monospace', fontSize: 12, resize: 'vertical' }, status: rawJsonError ? 'error' : undefined }), rawJsonError && (jsxRuntime.jsx("div", { style: { color: '#ff4d4f', fontSize: 12, marginTop: 4 }, children: rawJsonError })), !disabled && (jsxRuntime.jsx("div", { style: { marginTop: 8, textAlign: 'right' }, children: jsxRuntime.jsx(antd.Button, { size: "small", icon: jsxRuntime.jsx(RefIcon$8, {}), onClick: copyRawJson, children: "\u590D\u5236 JSON" }) }))] }))] }));
2309
+ }
2310
+
2311
+ const { Title } = antd.Typography;
2312
+ /** 替换 URL 模板中的 :id */
2313
+ function buildUrl(template, id) {
2314
+ return template.replace(/:id/, String(id));
2315
+ }
2316
+ /** 通用请求封装 */
2317
+ async function apiRequest(url, options) {
2318
+ const res = await fetch(url, Object.assign({ headers: { 'Content-Type': 'application/json' } }, options));
2319
+ if (!res.ok)
2320
+ throw new Error(`HTTP ${res.status}`);
2321
+ return res.json();
2322
+ }
2323
+ /** 从接口响应中提取列表和总数(兼容常见结构) */
2324
+ function extractListResponse(json) {
2325
+ var _a, _b, _c, _d, _e, _f, _g;
2326
+ if (!json || typeof json !== 'object')
2327
+ return { list: [], total: 0 };
2328
+ const obj = json;
2329
+ const data = (_b = (_a = obj.data) !== null && _a !== void 0 ? _a : obj.result) !== null && _b !== void 0 ? _b : obj;
2330
+ if (Array.isArray(data))
2331
+ return { list: data, total: data.length };
2332
+ if (data && typeof data === 'object') {
2333
+ const inner = data;
2334
+ const list = ((_e = (_d = (_c = inner.list) !== null && _c !== void 0 ? _c : inner.records) !== null && _d !== void 0 ? _d : inner.data) !== null && _e !== void 0 ? _e : []);
2335
+ const total = Number((_g = (_f = inner.total) !== null && _f !== void 0 ? _f : inner.count) !== null && _g !== void 0 ? _g : list.length);
2336
+ return { list, total };
2337
+ }
2338
+ return { list: [], total: 0 };
2339
+ }
2340
+ const CrudPage = ({ schema, initialData = [], apiRequest: customApiRequest }) => {
2341
+ var _a;
2342
+ const rowKey = schema.rowKey || 'id';
2343
+ // 使用传入的apiRequest或默认的
2344
+ const request = customApiRequest || apiRequest;
2345
+ // 本地兜底数据(API 失败时使用)
2346
+ const localDataRef = React.useRef(initialData);
2347
+ const [data, setData] = React.useState([]);
2348
+ const [loading, setLoading] = React.useState(false);
2349
+ const [total, setTotal] = React.useState(0);
2350
+ const [filterParams, setFilterParams] = React.useState({});
2351
+ const [page, setPage] = React.useState(1);
2352
+ const [pageSize, setPageSize] = React.useState(((_a = schema.pagination) === null || _a === void 0 ? void 0 : _a.pageSize) || 10);
2353
+ const [modalState, setModalState] = React.useState({ open: false, mode: 'create' });
2354
+ const [messageApi, contextHolder] = antd.message.useMessage();
2355
+ // ---------- 本地过滤(API 失败时兜底) ----------
2356
+ const localFilter = React.useCallback((params, p, ps) => {
2357
+ const filtered = localDataRef.current.filter(row => {
2358
+ return Object.entries(params).every(([key, val]) => {
2359
+ if (val === undefined || val === null || val === '')
2360
+ return true;
2361
+ if (key.endsWith('_min'))
2362
+ return Number(row[key.slice(0, -4)]) >= Number(val);
2363
+ if (key.endsWith('_max'))
2364
+ return Number(row[key.slice(0, -4)]) <= Number(val);
2365
+ if (key.endsWith('_start') || key.endsWith('_end'))
2366
+ return true;
2367
+ const rowVal = row[key];
2368
+ if (Array.isArray(rowVal)) {
2369
+ return Array.isArray(val) ? val.some(v => rowVal.includes(v)) : rowVal.includes(val);
2370
+ }
2371
+ if (typeof val === 'string')
2372
+ return String(rowVal).toLowerCase().includes(val.toLowerCase());
2373
+ return rowVal === val;
2374
+ });
2375
+ });
2376
+ const start = (p - 1) * ps;
2377
+ setData(filtered.slice(start, start + ps));
2378
+ setTotal(filtered.length);
2379
+ }, []);
2380
+ // ---------- 获取列表 ----------
2381
+ const fetchList = React.useCallback(async (params = filterParams, p = page, ps = pageSize) => {
2382
+ setLoading(true);
2383
+ try {
2384
+ const query = new URLSearchParams({ page: String(p), pageSize: String(ps) });
2385
+ Object.entries(params).forEach(([k, v]) => {
2386
+ if (v !== undefined && v !== null && v !== '')
2387
+ query.set(k, String(v));
2388
+ });
2389
+ const json = await request(`${schema.api.list}?${query}`);
2390
+ const { list, total: tot } = extractListResponse(json);
2391
+ setData(list);
2392
+ setTotal(tot);
2393
+ }
2394
+ catch (_a) {
2395
+ // API 不可用 → 本地演示模式
2396
+ localFilter(params, p, ps);
2397
+ }
2398
+ finally {
2399
+ setLoading(false);
2400
+ }
2401
+ }, [request, schema.api.list, filterParams, page, pageSize, localFilter]);
2402
+ // 初始加载 & 参数变化时重新请求
2403
+ React.useEffect(() => {
2404
+ fetchList(filterParams, page, pageSize);
2405
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2406
+ }, [filterParams, page, pageSize]);
2407
+ // ---------- 搜索 ----------
2408
+ const handleSearch = React.useCallback((params) => {
2409
+ setFilterParams(params);
2410
+ setPage(1);
2411
+ }, []);
2412
+ // ---------- 翻页 ----------
2413
+ const handlePageChange = React.useCallback((p, ps) => {
2414
+ setPage(p);
2415
+ setPageSize(ps);
2416
+ }, []);
2417
+ // ---------- 删除 ----------
2418
+ const handleDelete = React.useCallback(async (record) => {
2419
+ const id = record[rowKey];
2420
+ if (schema.api.delete) {
2421
+ try {
2422
+ await request(buildUrl(schema.api.delete, id), { method: 'DELETE' });
2423
+ messageApi.success('删除成功');
2424
+ fetchList();
2425
+ return;
2426
+ }
2427
+ catch (_a) {
2428
+ // 降级本地
2429
+ }
2430
+ }
2431
+ localDataRef.current = localDataRef.current.filter(r => r[rowKey] !== id);
2432
+ localFilter(filterParams, page, pageSize);
2433
+ messageApi.success('删除成功(演示模式)');
2434
+ }, [request, schema.api.delete, rowKey, fetchList, localFilter, filterParams, page, pageSize, messageApi]);
2435
+ // ---------- 操作列点击 ----------
2436
+ const handleAction = React.useCallback((action, record) => {
2437
+ if (action.type === 'view') {
2438
+ setModalState({ open: true, mode: 'view', record });
2439
+ }
2440
+ else if (action.type === 'edit') {
2441
+ setModalState({ open: true, mode: 'edit', record });
2442
+ }
2443
+ else if (action.type === 'delete') {
2444
+ handleDelete(record);
2445
+ }
2446
+ }, [handleDelete]);
2447
+ // ---------- 新增 / 编辑提交 ----------
2448
+ const handleFormOk = React.useCallback(async (values) => {
2449
+ const isCreate = modalState.mode === 'create';
2450
+ if (isCreate) {
2451
+ if (schema.api.create) {
2452
+ try {
2453
+ await request(schema.api.create, {
2454
+ method: 'POST',
2455
+ body: JSON.stringify(values),
2456
+ });
2457
+ messageApi.success('新增成功');
2458
+ setModalState({ open: false, mode: 'create' });
2459
+ fetchList();
2460
+ return;
2461
+ }
2462
+ catch (_a) {
2463
+ // 降级本地
2464
+ }
2465
+ }
2466
+ const newRecord = Object.assign({ [rowKey]: `local-${Date.now()}` }, values);
2467
+ localDataRef.current = [newRecord, ...localDataRef.current];
2468
+ localFilter(filterParams, 1, pageSize);
2469
+ setPage(1);
2470
+ messageApi.success('新增成功(演示模式)');
2471
+ }
2472
+ else {
2473
+ const id = values[rowKey];
2474
+ if (schema.api.update) {
2475
+ try {
2476
+ await request(buildUrl(schema.api.update, id), {
2477
+ method: 'PUT',
2478
+ body: JSON.stringify(values),
2479
+ });
2480
+ messageApi.success('编辑成功');
2481
+ setModalState({ open: false, mode: 'create' });
2482
+ fetchList();
2483
+ return;
2484
+ }
2485
+ catch (_b) {
2486
+ // 降级本地
2487
+ }
2488
+ }
2489
+ localDataRef.current = localDataRef.current.map(r => r[rowKey] === id ? Object.assign(Object.assign({}, r), values) : r);
2490
+ localFilter(filterParams, page, pageSize);
2491
+ messageApi.success('编辑成功(演示模式)');
2492
+ }
2493
+ setModalState({ open: false, mode: 'create' });
2494
+ }, [
2495
+ request, modalState.mode, schema.api, rowKey,
2496
+ fetchList, localFilter, filterParams, page, pageSize, messageApi,
2497
+ ]);
2498
+ return (jsxRuntime.jsxs("div", { style: { padding: 24, background: '#f5f6fa', minHeight: '100vh' }, children: [contextHolder, jsxRuntime.jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }, children: [jsxRuntime.jsx(Title, { level: 4, style: { margin: 0 }, children: schema.title }), schema.api.create && (jsxRuntime.jsx(antd.Button, { type: "primary", icon: jsxRuntime.jsx(RefIcon$2, {}), onClick: () => setModalState({ open: true, mode: 'create', record: undefined }), children: schema.createButtonLabel || '新增' }))] }), jsxRuntime.jsx(DynamicFilter, { schema: schema, onSearch: handleSearch, onReset: () => handleSearch({}) }), jsxRuntime.jsx(DynamicTable, { schema: schema, data: data, loading: loading, pagination: {
2499
+ current: page,
2500
+ pageSize,
2501
+ total,
2502
+ onChange: handlePageChange,
2503
+ }, onView: (record) => handleAction({ key: 'view', label: '查看', type: 'view' }, record), onEdit: (record) => handleAction({ key: 'edit', label: '编辑', type: 'edit' }, record), onDelete: (record) => handleDelete(record), onCustomAction: (actionKey, record) => {
2504
+ var _a;
2505
+ const action = (_a = schema.actions) === null || _a === void 0 ? void 0 : _a.find(a => a.key === actionKey);
2506
+ if (action)
2507
+ handleAction(action, record);
2508
+ } }), jsxRuntime.jsx(DynamicForm, { schema: schema, visible: modalState.open, mode: modalState.mode, initialValues: modalState.record, onSubmit: handleFormOk, onCancel: () => setModalState({ open: false, mode: 'create' }) })] }));
2509
+ };
2510
+
2511
+ exports.BUILTIN_RULES = BUILTIN_RULES;
2512
+ exports.CrudPage = CrudPage;
2513
+ exports.DynamicFilter = DynamicFilter;
2514
+ exports.DynamicForm = DynamicForm;
2515
+ exports.DynamicTable = DynamicTable;
2516
+ exports.defaultWidgetForType = defaultWidgetForType;
2517
+ exports.getAllRules = getAllRules;
2518
+ exports.getEffectiveWidget = getEffectiveWidget;
2519
+ exports.getFieldGroupPrefix = getFieldGroupPrefix;
2520
+ exports.getNestedValue = getNestedValue;
2521
+ exports.getRuleByKey = getRuleByKey;
2522
+ exports.keysToAntdRules = keysToAntdRules;
2523
+ exports.loadCustomRules = loadCustomRules;
2524
+ exports.ruleConfigToAntdRule = ruleConfigToAntdRule;
2525
+ exports.saveCustomRules = saveCustomRules;
2526
+ //# sourceMappingURL=index.js.map