@next-bricks/advanced 0.24.4 → 0.25.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.
Files changed (58) hide show
  1. package/dist/bricks.json +7 -6
  2. package/dist/chunks/272.2b9690e3.js +2 -0
  3. package/dist/chunks/{272.8537c9ef.js.map → 272.2b9690e3.js.map} +1 -1
  4. package/dist/chunks/3472.800bfa03.js +3 -0
  5. package/dist/chunks/{7824.ec40916f.js.LICENSE.txt → 3472.800bfa03.js.LICENSE.txt} +2 -3
  6. package/dist/chunks/3472.800bfa03.js.map +1 -0
  7. package/dist/chunks/3648.bf6ac98e.js +2 -0
  8. package/dist/chunks/{3648.17f00ef6.js.map → 3648.bf6ac98e.js.map} +1 -1
  9. package/dist/chunks/4024.5949aac1.js +3 -0
  10. package/dist/chunks/4024.5949aac1.js.LICENSE.txt +1 -0
  11. package/dist/chunks/4024.5949aac1.js.map +1 -0
  12. package/dist/chunks/{4944.b2560e0a.js → 4944.6aec0241.js} +2 -2
  13. package/dist/chunks/4944.6aec0241.js.map +1 -0
  14. package/dist/chunks/5672.7900fcac.js +2 -0
  15. package/dist/chunks/{9156.a4973d26.js.map → 5672.7900fcac.js.map} +1 -1
  16. package/dist/chunks/6472.4bed6243.js +2 -0
  17. package/dist/chunks/6472.4bed6243.js.map +1 -0
  18. package/dist/chunks/7072.2771a6a3.js +2 -0
  19. package/dist/chunks/7072.2771a6a3.js.map +1 -0
  20. package/dist/chunks/8064.cf8c5e0d.js.map +1 -1
  21. package/dist/chunks/9087.011a9874.js +2 -0
  22. package/dist/chunks/9087.011a9874.js.map +1 -0
  23. package/dist/chunks/eo-cascader.ca61551c.js +2 -0
  24. package/dist/chunks/eo-cascader.ca61551c.js.map +1 -0
  25. package/dist/chunks/eo-table.8549b40e.js +2 -0
  26. package/dist/chunks/{eo-table.a9e8bd1e.js.map → eo-table.8549b40e.js.map} +1 -1
  27. package/dist/chunks/eo-tree.9f447e13.js +2 -0
  28. package/dist/chunks/eo-tree.9f447e13.js.map +1 -0
  29. package/dist/chunks/main.4393c0c2.js +2 -0
  30. package/dist/chunks/main.4393c0c2.js.map +1 -0
  31. package/dist/examples.json +6 -3
  32. package/dist/index.0ae500ed.js +2 -0
  33. package/dist/index.0ae500ed.js.map +1 -0
  34. package/dist/manifest.json +147 -96
  35. package/dist/types.json +322 -114
  36. package/dist-types/bootstrap.d.ts +1 -0
  37. package/dist-types/cascader/index.d.ts +1 -0
  38. package/dist-types/tree/index.d.ts +44 -0
  39. package/dist-types/tree/index.spec.d.ts +1 -0
  40. package/docs/eo-tree.md +60 -0
  41. package/package.json +2 -2
  42. package/dist/chunks/2364.bbce4b80.js +0 -2
  43. package/dist/chunks/2364.bbce4b80.js.map +0 -1
  44. package/dist/chunks/272.8537c9ef.js +0 -2
  45. package/dist/chunks/276.bb7612e9.js +0 -2
  46. package/dist/chunks/276.bb7612e9.js.map +0 -1
  47. package/dist/chunks/3648.17f00ef6.js +0 -2
  48. package/dist/chunks/4944.b2560e0a.js.map +0 -1
  49. package/dist/chunks/7824.ec40916f.js +0 -3
  50. package/dist/chunks/7824.ec40916f.js.map +0 -1
  51. package/dist/chunks/9156.a4973d26.js +0 -2
  52. package/dist/chunks/eo-cascader.87d88b1a.js +0 -2
  53. package/dist/chunks/eo-cascader.87d88b1a.js.map +0 -1
  54. package/dist/chunks/eo-table.a9e8bd1e.js +0 -2
  55. package/dist/chunks/main.5470a1f1.js +0 -2
  56. package/dist/chunks/main.5470a1f1.js.map +0 -1
  57. package/dist/index.54628cc2.js +0 -2
  58. package/dist/index.54628cc2.js.map +0 -1
package/dist/types.json CHANGED
@@ -431,6 +431,328 @@
431
431
  }
432
432
  ]
433
433
  },
434
+ "eo-tree": {
435
+ "properties": [
436
+ {
437
+ "name": "dataSource",
438
+ "annotation": {
439
+ "type": "array",
440
+ "elementType": {
441
+ "type": "reference",
442
+ "typeName": {
443
+ "type": "identifier",
444
+ "name": "TreeNode"
445
+ }
446
+ }
447
+ }
448
+ },
449
+ {
450
+ "name": "checkable",
451
+ "annotation": {
452
+ "type": "keyword",
453
+ "value": "boolean"
454
+ }
455
+ },
456
+ {
457
+ "name": "selectable",
458
+ "annotation": {
459
+ "type": "keyword",
460
+ "value": "boolean"
461
+ }
462
+ },
463
+ {
464
+ "name": "defaultExpandAll",
465
+ "annotation": {
466
+ "type": "keyword",
467
+ "value": "boolean"
468
+ }
469
+ },
470
+ {
471
+ "name": "showLine",
472
+ "annotation": {
473
+ "type": "keyword",
474
+ "value": "boolean"
475
+ }
476
+ },
477
+ {
478
+ "name": "switcherIcon",
479
+ "annotation": {
480
+ "type": "union",
481
+ "types": [
482
+ {
483
+ "type": "jsLiteral",
484
+ "value": "auto"
485
+ },
486
+ {
487
+ "type": "jsLiteral",
488
+ "value": "chevron"
489
+ },
490
+ {
491
+ "type": "jsLiteral",
492
+ "value": false
493
+ }
494
+ ]
495
+ }
496
+ }
497
+ ],
498
+ "events": [
499
+ {
500
+ "name": "check",
501
+ "detail": {
502
+ "annotation": {
503
+ "type": "array",
504
+ "elementType": {
505
+ "type": "reference",
506
+ "typeName": {
507
+ "type": "identifier",
508
+ "name": "TreeNodeKey"
509
+ }
510
+ }
511
+ }
512
+ }
513
+ },
514
+ {
515
+ "name": "check.detail",
516
+ "detail": {
517
+ "annotation": {
518
+ "type": "reference",
519
+ "typeName": {
520
+ "type": "identifier",
521
+ "name": "CheckDetail"
522
+ }
523
+ }
524
+ }
525
+ }
526
+ ],
527
+ "methods": [],
528
+ "types": [
529
+ {
530
+ "type": "interface",
531
+ "name": "TreeNode",
532
+ "body": [
533
+ {
534
+ "type": "propertySignature",
535
+ "key": {
536
+ "type": "identifier",
537
+ "name": "title"
538
+ },
539
+ "annotation": {
540
+ "type": "keyword",
541
+ "value": "string"
542
+ },
543
+ "computed": false
544
+ },
545
+ {
546
+ "type": "propertySignature",
547
+ "key": {
548
+ "type": "identifier",
549
+ "name": "key"
550
+ },
551
+ "annotation": {
552
+ "type": "reference",
553
+ "typeName": {
554
+ "type": "identifier",
555
+ "name": "TreeNodeKey"
556
+ }
557
+ },
558
+ "computed": false
559
+ },
560
+ {
561
+ "type": "propertySignature",
562
+ "key": {
563
+ "type": "identifier",
564
+ "name": "children"
565
+ },
566
+ "annotation": {
567
+ "type": "array",
568
+ "elementType": {
569
+ "type": "reference",
570
+ "typeName": {
571
+ "type": "identifier",
572
+ "name": "TreeNode"
573
+ }
574
+ }
575
+ },
576
+ "optional": true,
577
+ "computed": false
578
+ }
579
+ ]
580
+ },
581
+ {
582
+ "type": "typeAlias",
583
+ "name": "TreeNodeKey",
584
+ "annotation": {
585
+ "type": "union",
586
+ "types": [
587
+ {
588
+ "type": "keyword",
589
+ "value": "string"
590
+ },
591
+ {
592
+ "type": "keyword",
593
+ "value": "number"
594
+ }
595
+ ]
596
+ }
597
+ },
598
+ {
599
+ "type": "interface",
600
+ "name": "CheckDetail",
601
+ "body": [
602
+ {
603
+ "type": "propertySignature",
604
+ "key": {
605
+ "type": "identifier",
606
+ "name": "checkedKeys"
607
+ },
608
+ "annotation": {
609
+ "type": "array",
610
+ "elementType": {
611
+ "type": "reference",
612
+ "typeName": {
613
+ "type": "identifier",
614
+ "name": "TreeNodeKey"
615
+ }
616
+ }
617
+ },
618
+ "computed": false
619
+ },
620
+ {
621
+ "type": "propertySignature",
622
+ "key": {
623
+ "type": "identifier",
624
+ "name": "halfCheckedKeys"
625
+ },
626
+ "annotation": {
627
+ "type": "array",
628
+ "elementType": {
629
+ "type": "reference",
630
+ "typeName": {
631
+ "type": "identifier",
632
+ "name": "TreeNodeKey"
633
+ }
634
+ }
635
+ },
636
+ "computed": false
637
+ }
638
+ ]
639
+ }
640
+ ]
641
+ },
642
+ "advanced.capture-snapshot": {
643
+ "type": "provider",
644
+ "params": [
645
+ {
646
+ "name": "options",
647
+ "description": "选项",
648
+ "annotation": {
649
+ "type": "reference",
650
+ "typeName": {
651
+ "type": "identifier",
652
+ "name": "SnapshotOptions"
653
+ }
654
+ }
655
+ }
656
+ ],
657
+ "returns": {
658
+ "annotation": {
659
+ "type": "reference",
660
+ "typeName": {
661
+ "type": "identifier",
662
+ "name": "Promise"
663
+ },
664
+ "typeParameters": {
665
+ "type": "typeParameterInstantiation",
666
+ "params": [
667
+ {
668
+ "type": "union",
669
+ "types": [
670
+ {
671
+ "type": "keyword",
672
+ "value": "void"
673
+ },
674
+ {
675
+ "type": "keyword",
676
+ "value": "string"
677
+ }
678
+ ]
679
+ }
680
+ ]
681
+ }
682
+ }
683
+ },
684
+ "types": [
685
+ {
686
+ "type": "interface",
687
+ "name": "SnapshotOptions",
688
+ "body": [
689
+ {
690
+ "type": "propertySignature",
691
+ "key": {
692
+ "type": "identifier",
693
+ "name": "name"
694
+ },
695
+ "annotation": {
696
+ "type": "keyword",
697
+ "value": "string"
698
+ },
699
+ "computed": false,
700
+ "description": "文件名称"
701
+ },
702
+ {
703
+ "type": "propertySignature",
704
+ "key": {
705
+ "type": "identifier",
706
+ "name": "fileType"
707
+ },
708
+ "annotation": {
709
+ "type": "union",
710
+ "types": [
711
+ {
712
+ "type": "jsLiteral",
713
+ "value": "image"
714
+ },
715
+ {
716
+ "type": "jsLiteral",
717
+ "value": "pdf"
718
+ }
719
+ ]
720
+ },
721
+ "computed": false,
722
+ "description": "文件类型"
723
+ },
724
+ {
725
+ "type": "propertySignature",
726
+ "key": {
727
+ "type": "identifier",
728
+ "name": "selector"
729
+ },
730
+ "annotation": {
731
+ "type": "keyword",
732
+ "value": "string"
733
+ },
734
+ "optional": true,
735
+ "computed": false,
736
+ "description": "选择器"
737
+ },
738
+ {
739
+ "type": "propertySignature",
740
+ "key": {
741
+ "type": "identifier",
742
+ "name": "bucketName"
743
+ },
744
+ "annotation": {
745
+ "type": "keyword",
746
+ "value": "string"
747
+ },
748
+ "optional": true,
749
+ "computed": false,
750
+ "description": "对象存储桶名字, fileType只能为 `image`"
751
+ }
752
+ ]
753
+ }
754
+ ]
755
+ },
434
756
  "eo-table": {
435
757
  "properties": [
436
758
  {
@@ -1373,120 +1695,6 @@
1373
1695
  }
1374
1696
  ]
1375
1697
  },
1376
- "advanced.capture-snapshot": {
1377
- "type": "provider",
1378
- "params": [
1379
- {
1380
- "name": "options",
1381
- "description": "选项",
1382
- "annotation": {
1383
- "type": "reference",
1384
- "typeName": {
1385
- "type": "identifier",
1386
- "name": "SnapshotOptions"
1387
- }
1388
- }
1389
- }
1390
- ],
1391
- "returns": {
1392
- "annotation": {
1393
- "type": "reference",
1394
- "typeName": {
1395
- "type": "identifier",
1396
- "name": "Promise"
1397
- },
1398
- "typeParameters": {
1399
- "type": "typeParameterInstantiation",
1400
- "params": [
1401
- {
1402
- "type": "union",
1403
- "types": [
1404
- {
1405
- "type": "keyword",
1406
- "value": "void"
1407
- },
1408
- {
1409
- "type": "keyword",
1410
- "value": "string"
1411
- }
1412
- ]
1413
- }
1414
- ]
1415
- }
1416
- }
1417
- },
1418
- "types": [
1419
- {
1420
- "type": "interface",
1421
- "name": "SnapshotOptions",
1422
- "body": [
1423
- {
1424
- "type": "propertySignature",
1425
- "key": {
1426
- "type": "identifier",
1427
- "name": "name"
1428
- },
1429
- "annotation": {
1430
- "type": "keyword",
1431
- "value": "string"
1432
- },
1433
- "computed": false,
1434
- "description": "文件名称"
1435
- },
1436
- {
1437
- "type": "propertySignature",
1438
- "key": {
1439
- "type": "identifier",
1440
- "name": "fileType"
1441
- },
1442
- "annotation": {
1443
- "type": "union",
1444
- "types": [
1445
- {
1446
- "type": "jsLiteral",
1447
- "value": "image"
1448
- },
1449
- {
1450
- "type": "jsLiteral",
1451
- "value": "pdf"
1452
- }
1453
- ]
1454
- },
1455
- "computed": false,
1456
- "description": "文件类型"
1457
- },
1458
- {
1459
- "type": "propertySignature",
1460
- "key": {
1461
- "type": "identifier",
1462
- "name": "selector"
1463
- },
1464
- "annotation": {
1465
- "type": "keyword",
1466
- "value": "string"
1467
- },
1468
- "optional": true,
1469
- "computed": false,
1470
- "description": "选择器"
1471
- },
1472
- {
1473
- "type": "propertySignature",
1474
- "key": {
1475
- "type": "identifier",
1476
- "name": "bucketName"
1477
- },
1478
- "annotation": {
1479
- "type": "keyword",
1480
- "value": "string"
1481
- },
1482
- "optional": true,
1483
- "computed": false,
1484
- "description": "对象存储桶名字, fileType只能为 `image`"
1485
- }
1486
- ]
1487
- }
1488
- ]
1489
- },
1490
1698
  "eo-next-table": {
1491
1699
  "properties": [
1492
1700
  {
@@ -3,3 +3,4 @@ import "./cascader/index.js";
3
3
  import "./next-table/index.js";
4
4
  import "./workbench-layout/index.js";
5
5
  import "./data-providers/capture-snapshot.js";
6
+ import "./tree/index.js";
@@ -1,4 +1,5 @@
1
1
  import React, { CSSProperties } from "react";
2
+ import "@next-core/theme";
2
3
  import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
3
4
  import { CascaderProps as AntdCascaderProps, DefaultOptionType } from "antd/lib/cascader";
4
5
  import { FormItemElementBase } from "@next-shared/form";
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import "@next-core/theme";
4
+ import type { TreeProps } from "antd";
5
+ export interface EoTreeProps {
6
+ dataSource?: TreeNode[];
7
+ checkable?: boolean;
8
+ selectable?: boolean;
9
+ defaultExpandAll?: boolean;
10
+ showLine?: boolean;
11
+ switcherIcon?: "auto" | "chevron" | false;
12
+ }
13
+ export interface TreeNode {
14
+ title: string;
15
+ key: TreeNodeKey;
16
+ children?: TreeNode[];
17
+ }
18
+ export type TreeNodeKey = string | number;
19
+ export interface CheckDetail {
20
+ checkedKeys: TreeNodeKey[];
21
+ halfCheckedKeys: TreeNodeKey[];
22
+ }
23
+ /**
24
+ * 树形构件
25
+ * @author steve
26
+ */
27
+ export declare class EoTree extends ReactNextElement implements EoTreeProps {
28
+ #private;
29
+ accessor dataSource: TreeNode[] | undefined;
30
+ accessor checkable: boolean | undefined;
31
+ /**
32
+ * @default true
33
+ */
34
+ accessor selectable: boolean | undefined;
35
+ accessor defaultExpandAll: boolean | undefined;
36
+ accessor showLine: boolean | undefined;
37
+ accessor switcherIcon: "auto" | "chevron" | false | undefined;
38
+ render(): React.JSX.Element;
39
+ }
40
+ export interface EoTreeComponentProps extends EoTreeProps {
41
+ shadowRoot: ShadowRoot;
42
+ onCheck: TreeProps["onCheck"];
43
+ }
44
+ export declare function EoTreeComponent({ dataSource, shadowRoot, checkable, selectable, defaultExpandAll, showLine, switcherIcon, onCheck, }: EoTreeComponentProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import "./";
@@ -0,0 +1,60 @@
1
+ 树形构件
2
+
3
+ ## Examples
4
+
5
+ ### Basic
6
+
7
+ ```yaml preview
8
+ brick: eo-tree
9
+ properties:
10
+ defaultExpandAll: true
11
+ dataSource:
12
+ - title: parent 1
13
+ key: 0-0
14
+ children:
15
+ - title: parent 1-0
16
+ key: 0-0-0
17
+ children:
18
+ - title: leaf
19
+ key: 0-0-0-0
20
+ - title: leaf
21
+ key: 0-0-0-1
22
+ - title: parent 1-1
23
+ key: 0-0-1
24
+ children:
25
+ - title: sss
26
+ key: 0-0-1-0
27
+ ```
28
+
29
+ ### Checkable
30
+
31
+ ```yaml preview
32
+ brick: eo-tree
33
+ properties:
34
+ defaultExpandAll: true
35
+ checkable: true
36
+ selectable: false
37
+ showLine: true
38
+ switcherIcon: chevron
39
+ dataSource:
40
+ - title: parent 1
41
+ key: 0-0
42
+ children:
43
+ - title: parent 1-0
44
+ key: 0-0-0
45
+ children:
46
+ - title: leaf
47
+ key: 0-0-0-0
48
+ - title: leaf
49
+ key: 0-0-0-1
50
+ - title: parent 1-1
51
+ key: 0-0-1
52
+ children:
53
+ - title: sss
54
+ key: 0-0-1-0
55
+ events:
56
+ check:
57
+ action: console.log
58
+ check.detail:
59
+ action: console.log
60
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/advanced",
3
- "version": "0.24.4",
3
+ "version": "0.25.1",
4
4
  "homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/basic",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,5 +42,5 @@
42
42
  "@next-bricks/form": "*",
43
43
  "@next-bricks/icons": "*"
44
44
  },
45
- "gitHead": "965aa10c19b7cc57fca0aaeb93c38ad5de4d31b1"
45
+ "gitHead": "2a943abb329b09fbb01de9d37c13990fca637b17"
46
46
  }
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_next_bricks_advanced=self.webpackChunk_next_bricks_advanced||[]).push([[2364],{2364:(e,n,t)=>{t.d(n,{c:()=>ge});var o=t(83516),r=t(35600),a=t(37890),c=t(95616),i=t(97588),l=t(26484),u=t.n(l),s=t(15307),d=t(51428),p=t(30640),f=t(98874),h=t(67684),m=t(51492),v=t(77112),g=t(8800);const b=r.createContext(null);var C=t(15804),k=t(77392),S=t(64412),x="__rc_cascader_search_mark__",y=function(e,n,t){var o=t.label;return n.some((function(n){return String(n[o]).toLowerCase().includes(e.toLowerCase())}))},w=function(e,n,t,o){return n.map((function(e){return e[o.label]})).join(" / ")},E="__RC_CASCADER_SPLIT__",I="SHOW_PARENT",N="SHOW_CHILD";function O(e){return e.join(E)}function P(e){return e.map(O)}function _(e,n){var t,o;return null!==(t=e.isLeaf)&&void 0!==t?t:!(null!==(o=e[n.children])&&void 0!==o&&o.length)}function M(e){var n=e.parentElement;if(n){var t=e.offsetTop-n.offsetTop;t-n.scrollTop<0?n.scrollTo({top:t}):t+e.offsetHeight-n.scrollTop>n.offsetHeight&&n.scrollTo({top:t+e.offsetHeight-n.offsetHeight})}}function T(e,n){return e.map((function(e){var t;return null===(t=e[x])||void 0===t?void 0:t.map((function(e){return e[n.value]}))}))}function W(e,n,t){var o=new Set(e),r=n();return e.filter((function(e){var n=r[e],a=n?n.parent:null,c=n?n.children:null;return!((!n||!n.node.disabled)&&(t===N?c&&c.some((function(e){return e.key&&o.has(e.key)})):a&&!a.node.disabled&&o.has(a.key)))}))}function V(e,n,t){for(var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=n,a=[],c=function(){var n,c,l,u=e[i],s=null===(n=r)||void 0===n?void 0:n.findIndex((function(e){var n=e[t.value];return o?String(n)===String(u):n===u})),d=-1!==s?null===(c=r)||void 0===c?void 0:c[s]:null;a.push({value:null!==(l=null==d?void 0:d[t.value])&&void 0!==l?l:u,index:s,option:d}),r=null==d?void 0:d[t.children]},i=0;i<e.length;i+=1)c();return a}var $=t(11868);t(20256);const H=r.memo((function(e){return e.children}),(function(e,n){return!n.open}));function D(e){var n,t=e.prefixCls,o=e.checked,a=e.halfChecked,c=e.disabled,i=e.onClick,l=e.disableCheckbox,s=r.useContext(b).checkable,d="boolean"!=typeof s?s:null;return r.createElement("span",{className:u()("".concat(t),(n={},(0,k.c)(n,"".concat(t,"-checked"),o),(0,k.c)(n,"".concat(t,"-indeterminate"),!o&&a),(0,k.c)(n,"".concat(t,"-disabled"),c||l),n)),onClick:i},d)}var A="__cascader_fix_label__";function j(e){var n=e.prefixCls,t=e.multiple,a=e.options,c=e.activeValue,i=e.prevValuePath,l=e.onToggleOpen,s=e.onSelect,d=e.onActive,p=e.checkedSet,f=e.halfCheckedSet,h=e.loadingKeys,m=e.isSelectable,v=e.searchValue,g="".concat(n,"-menu"),C="".concat(n,"-menu-item"),S=r.useContext(b),y=S.fieldNames,w=S.changeOnSelect,E=S.expandTrigger,I=S.expandIcon,N=S.loadingIcon,P=S.dropdownMenuColumnStyle,M="hover"===E,T=r.useMemo((function(){return a.map((function(e){var n,t=e.disabled,r=e.disableCheckbox,a=e[x],c=null!==(n=e[A])&&void 0!==n?n:e[y.label],l=e[y.value],u=_(e,y),s=a?a.map((function(e){return e[y.value]})):[].concat((0,o.c)(i),[l]),d=O(s);return{disabled:t,label:c,value:l,isLeaf:u,isLoading:h.includes(d),checked:p.has(d),halfChecked:f.has(d),option:e,disableCheckbox:r,fullPath:s,fullPathKey:d}}))}),[a,p,y,f,h,i]);return r.createElement("ul",{className:g,role:"menu"},T.map((function(e){var a,i,p=e.disabled,f=e.label,h=e.value,g=e.isLeaf,b=e.isLoading,S=e.checked,x=e.halfChecked,y=e.option,E=e.fullPath,O=e.fullPathKey,_=e.disableCheckbox,T=function(){if(!p&&!v){var e=(0,o.c)(E);M&&g&&e.pop(),d(e)}},W=function(){m(y)&&s(E,g)};return"string"==typeof y.title?i=y.title:"string"==typeof f&&(i=f),r.createElement("li",{key:O,className:u()(C,(a={},(0,k.c)(a,"".concat(C,"-expand"),!g),(0,k.c)(a,"".concat(C,"-active"),c===h||c===O),(0,k.c)(a,"".concat(C,"-disabled"),p),(0,k.c)(a,"".concat(C,"-loading"),b),a)),style:P,role:"menuitemcheckbox",title:i,"aria-checked":S,"data-path-key":O,onClick:function(){T(),_||t&&!g||W()},onDoubleClick:function(){w&&l(!1)},onMouseEnter:function(){M&&T()},onMouseDown:function(e){e.preventDefault()}},t&&r.createElement(D,{prefixCls:"".concat(n,"-checkbox"),checked:S,halfChecked:x,disabled:p||_,disableCheckbox:_,onClick:function(e){_||(e.stopPropagation(),W())}}),r.createElement("div",{className:"".concat(C,"-content")},f),!b&&I&&!g&&r.createElement("div",{className:"".concat(C,"-expand-icon")},I),b&&N&&r.createElement("div",{className:"".concat(C,"-loading-icon")},N))})))}var R=t(55480);const L=r.forwardRef((function(e,n){var t,a,c,i,l=(0,f.Yp)(),p=l.prefixCls,h=l.multiple,m=l.searchValue,v=l.toggleOpen,g=l.notFoundContent,C=l.direction,y=l.open,w=r.useRef(),I="rtl"===C,N=r.useContext(b),W=N.options,$=N.values,D=N.halfValues,L=N.fieldNames,K=N.changeOnSelect,F=N.onSelect,z=N.searchOptions,B=N.dropdownPrefixCls,X=N.loadData,Y=N.expandTrigger,q=B||p,U=r.useState([]),G=(0,d.c)(U,2),J=G[0],Q=G[1];r.useEffect((function(){J.length&&J.forEach((function(e){var n=V(e.split(E),W,L,!0).map((function(e){return e.option})),t=n[n.length-1];(!t||t[L.children]||_(t,L))&&Q((function(n){return n.filter((function(n){return n!==e}))}))}))}),[W,J,L]);var Z=r.useMemo((function(){return new Set(P($))}),[$]),ee=r.useMemo((function(){return new Set(P(D))}),[D]),ne=function(){var e=(0,f.Yp)(),n=e.multiple,t=e.open,o=r.useContext(b).values,a=r.useState([]),c=(0,d.c)(a,2),i=c[0],l=c[1];return r.useEffect((function(){if(t&&!n){var e=o[0];l(e||[])}}),[t]),[i,l]}(),te=(0,d.c)(ne,2),oe=te[0],re=te[1],ae=function(e){re(e),function(e){if(X&&!m){var n=V(e,W,L).map((function(e){return e.option})),t=n[n.length-1];if(t&&!_(t,L)){var r=O(e);Q((function(e){return[].concat((0,o.c)(e),[r])})),X(n)}}}(e)},ce=function(e){var n=e.disabled,t=_(e,L);return!n&&(t||K||h)},ie=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];F(e),!h&&(n||K&&("hover"===Y||t))&&v(!1)},le=r.useMemo((function(){return m?z:W}),[m,z,W]),ue=r.useMemo((function(){for(var e=[{options:le}],n=le,t=T(n,L),o=function(){var o=oe[r],a=n.find((function(e,n){return(t[n]?O(t[n]):e[L.value])===o})),c=null==a?void 0:a[L.children];if(null==c||!c.length)return"break";n=c,e.push({options:c})},r=0;r<oe.length&&"break"!==o();r+=1);return e}),[le,oe,L]);(function(e,n,t,a,c,i){var l=(0,f.Yp)(),u=l.direction,s=l.searchValue,p=l.toggleOpen,h=l.open,m="rtl"===u,v=r.useMemo((function(){for(var e=-1,o=n,r=[],c=[],i=a.length,l=T(n,t),u=function(n){var i=o.findIndex((function(e,o){return(l[o]?O(l[o]):e[t.value])===a[n]}));if(-1===i)return"break";e=i,r.push(e),c.push(a[n]),o=o[e][t.children]},s=0;s<i&&o&&"break"!==u(s);s+=1);for(var d=n,p=0;p<r.length-1;p+=1)d=d[r[p]][t.children];return[c,e,d,l]}),[a,t,n]),g=(0,d.c)(v,4),b=g[0],C=g[1],k=g[2],S=g[3],y=function(e){c(e)},w=function(){if(b.length>1){var e=b.slice(0,-1);y(e)}else p(!1)},E=function(){var e,n=((null===(e=k[C])||void 0===e?void 0:e[t.children])||[]).find((function(e){return!e.disabled}));if(n){var r=[].concat((0,o.c)(b),[n[t.value]]);y(r)}};r.useImperativeHandle(e,(function(){return{onKeyDown:function(e){var n=e.which;switch(n){case R.c.UP:case R.c.DOWN:var o=0;n===R.c.UP?o=-1:n===R.c.DOWN&&(o=1),0!==o&&function(e){var n=k.length,o=C;-1===o&&e<0&&(o=n);for(var r=0;r<n;r+=1){var a=k[o=(o+e+n)%n];if(a&&!a.disabled){var c=b.slice(0,-1).concat(S[o]?O(S[o]):a[t.value]);return void y(c)}}}(o);break;case R.c.LEFT:if(s)break;m?E():w();break;case R.c.RIGHT:if(s)break;m?w():E();break;case R.c.BACKSPACE:s||w();break;case R.c.ENTER:if(b.length){var r=k[C],a=(null==r?void 0:r[x])||[];a.length?i(a.map((function(e){return e[t.value]})),a[a.length-1]):i(b,k[C])}break;case R.c.ESC:p(!1),h&&e.stopPropagation()}},onKeyUp:function(){}}}))})(n,le,L,oe,ae,(function(e,n){ce(n)&&ie(e,_(n,L),!0)})),r.useEffect((function(){for(var e=0;e<oe.length;e+=1){var n,t=O(oe.slice(0,e+1)),o=null===(n=w.current)||void 0===n?void 0:n.querySelector('li[data-path-key="'.concat(t.replace(/\\{0,2}"/g,'\\"'),'"]'));o&&M(o)}}),[oe]);var se=!(null!==(t=ue[0])&&void 0!==t&&null!==(a=t.options)&&void 0!==a&&a.length),de=[(c={},(0,k.c)(c,L.value,"__EMPTY__"),(0,k.c)(c,A,g),(0,k.c)(c,"disabled",!0),c)],pe=(0,S.c)((0,S.c)({},e),{},{multiple:!se&&h,onSelect:ie,onActive:ae,onToggleOpen:v,checkedSet:Z,halfCheckedSet:ee,loadingKeys:J,isSelectable:ce}),fe=(se?[{options:de}]:ue).map((function(e,n){var t=oe.slice(0,n),o=oe[n];return r.createElement(j,(0,s.c)({key:n},pe,{searchValue:m,prefixCls:q,options:e.options,prevValuePath:t,activeValue:o}))}));return r.createElement(H,{open:y},r.createElement("div",{className:u()("".concat(q,"-menus"),(i={},(0,k.c)(i,"".concat(q,"-menu-empty"),se),(0,k.c)(i,"".concat(q,"-rtl"),I),i)),ref:w},fe))}));var K=["id","prefixCls","fieldNames","defaultValue","value","changeOnSelect","onChange","displayRender","checkable","autoClearSearchValue","searchValue","onSearch","showSearch","expandTrigger","options","dropdownPrefixCls","loadData","popupVisible","open","popupClassName","dropdownClassName","dropdownMenuColumnStyle","popupPlacement","placement","onDropdownVisibleChange","onPopupVisibleChange","expandIcon","loadingIcon","children","dropdownMatchSelectWidth","showCheckedStrategy"];function F(e){return e?function(e){return Array.isArray(e)&&Array.isArray(e[0])}(e)?e:(0===e.length?[]:[e]).map((function(e){return Array.isArray(e)?e:[e]})):[]}var z=r.forwardRef((function(e,n){var t=e.id,a=e.prefixCls,c=void 0===a?"rc-cascader":a,i=e.fieldNames,l=e.defaultValue,u=e.value,N=e.changeOnSelect,_=e.onChange,M=e.displayRender,T=e.checkable,H=e.autoClearSearchValue,D=void 0===H||H,A=e.searchValue,j=e.onSearch,R=e.showSearch,z=e.expandTrigger,B=e.options,X=e.dropdownPrefixCls,Y=e.loadData,q=e.popupVisible,U=e.open,G=e.popupClassName,J=e.dropdownClassName,Q=e.dropdownMenuColumnStyle,Z=e.popupPlacement,ee=e.placement,ne=e.onDropdownVisibleChange,te=e.onPopupVisibleChange,oe=e.expandIcon,re=void 0===oe?">":oe,ae=e.loadingIcon,ce=e.children,ie=e.dropdownMatchSelectWidth,le=void 0!==ie&&ie,ue=e.showCheckedStrategy,se=void 0===ue?I:ue,de=(0,p.c)(e,K),pe=(0,h.cp)(t),fe=!!T,he=(0,g.c)(l,{value:u,postState:F}),me=(0,d.c)(he,2),ve=me[0],ge=me[1],be=r.useMemo((function(){return function(e){var n=e||{},t=n.label,o=n.value||"value";return{label:t||"label",value:o,key:o,children:n.children||"children"}}(i)}),[JSON.stringify(i)]),Ce=r.useMemo((function(){return B||[]}),[B]),ke=function(e,n){var t=r.useRef({options:null,info:null});return r.useCallback((function(){return t.current.options!==e&&(t.current.options=e,t.current.info=(0,$.W)(e,{fieldNames:n,initWrapper:function(e){return(0,S.c)((0,S.c)({},e),{},{pathKeyEntities:{}})},processEntity:function(e,t){var o=e.nodes.map((function(e){return e[n.value]})).join(E);t.pathKeyEntities[o]=e,e.key=o}})),t.current.info.pathKeyEntities}),[n,e])}(Ce,be),Se=r.useCallback((function(e){var n=ke();return e.map((function(e){return n[e].nodes.map((function(e){return e[be.value]}))}))}),[ke,be]),xe=(0,g.c)("",{value:A,postState:function(e){return e||""}}),ye=(0,d.c)(xe,2),we=ye[0],Ee=ye[1],Ie=function(e){return r.useMemo((function(){if(!e)return[!1,{}];var n={matchInputWidth:!0,limit:50};return e&&"object"===(0,C.c)(e)&&(n=(0,S.c)((0,S.c)({},n),e)),n.limit<=0&&delete n.limit,[!0,n]}),[e])}(R),Ne=(0,d.c)(Ie,2),Oe=Ne[0],Pe=Ne[1],_e=function(e,n,t,a,c,i){var l=c.filter,u=void 0===l?y:l,s=c.render,d=void 0===s?w:s,p=c.limit,f=void 0===p?50:p,h=c.sort;return r.useMemo((function(){var r=[];return e?(function n(c,l){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];c.forEach((function(c){if(!(!h&&!1!==f&&f>0&&r.length>=f)){var p,m=[].concat((0,o.c)(l),[c]),v=c[t.children],g=s||c.disabled;v&&0!==v.length&&!i||u(e,m,{label:t.label})&&r.push((0,S.c)((0,S.c)({},c),{},(p={disabled:g},(0,k.c)(p,t.label,d(e,m,a,t)),(0,k.c)(p,x,m),(0,k.c)(p,t.children,void 0),p))),v&&n(c[t.children],m,g)}}))}(n,[]),h&&r.sort((function(n,o){return h(n[x],o[x],e,t)})),!1!==f&&f>0?r.slice(0,f):r):[]}),[e,n,t,a,d,i,u,h,f])}(we,Ce,be,X||c,Pe,N),Me=function(e,n){return r.useCallback((function(t){var o=[],r=[];return t.forEach((function(t){V(t,e,n).every((function(e){return e.option}))?r.push(t):o.push(t)})),[r,o]}),[e,n])}(Ce,be),Te=r.useMemo((function(){var e=Me(ve),n=(0,d.c)(e,2),t=n[0],o=n[1];if(!fe||!ve.length)return[t,[],o];var r=P(t),a=ke(),c=(0,m.q)(r,!0,a),i=c.checkedKeys,l=c.halfCheckedKeys;return[Se(i),Se(l),o]}),[fe,ve,ke,Se,Me]),We=(0,d.c)(Te,3),Ve=We[0],$e=We[1],He=We[2],De=function(e,n,t,a,c){return r.useMemo((function(){var i=c||function(e){var n=a?e.slice(-1):e;return n.every((function(e){return["string","number"].includes((0,C.c)(e))}))?n.join(" / "):n.reduce((function(e,n,t){var a=r.isValidElement(n)?r.cloneElement(n,{key:t}):n;return 0===t?[a]:[].concat((0,o.c)(e),[" / ",a])}),[])};return e.map((function(e){var o,r,a=V(e,n,t),c=i(a.map((function(e){var n,o=e.option,r=e.value;return null!==(n=null==o?void 0:o[t.label])&&void 0!==n?n:r})),a.map((function(e){return e.option}))),l=O(e);return{label:c,value:l,key:l,valueCells:e,disabled:null===(o=a[a.length-1])||void 0===o||null===(r=o.option)||void 0===r?void 0:r.disabled}}))}),[e,n,t,c,a])}(r.useMemo((function(){var e=W(P(Ve),ke,se);return[].concat((0,o.c)(He),(0,o.c)(Se(e)))}),[Ve,ke,Se,He,se]),Ce,be,fe,M),Ae=(0,v.c)((function(e){if(ge(e),_){var n=F(e),t=n.map((function(e){return V(e,Ce,be).map((function(e){return e.option}))})),o=fe?n:n[0],r=fe?t:t[0];_(o,r)}})),je=(0,v.c)((function(e){if(fe&&!D||Ee(""),fe){var n=O(e),t=P(Ve),r=P($e),a=t.includes(n),c=He.some((function(e){return O(e)===n})),i=Ve,l=He;if(c&&!a)l=He.filter((function(e){return O(e)!==n}));else{var u=a?t.filter((function(e){return e!==n})):[].concat((0,o.c)(t),[n]),s=ke(),d=W(a?(0,m.q)(u,{checked:!1,halfCheckedKeys:r},s).checkedKeys:(0,m.q)(u,!0,s).checkedKeys,ke,se);i=Se(d)}Ae([].concat((0,o.c)(l),(0,o.c)(i)))}else Ae(e)})),Re=void 0!==U?U:q,Le=J||G,Ke=ee||Z,Fe=r.useMemo((function(){return{options:Ce,fieldNames:be,values:Ve,halfValues:$e,changeOnSelect:N,onSelect:je,checkable:T,searchOptions:_e,dropdownPrefixCls:X,loadData:Y,expandTrigger:z,expandIcon:re,loadingIcon:ae,dropdownMenuColumnStyle:Q}}),[Ce,be,Ve,$e,N,je,T,_e,X,Y,z,re,ae,Q]),ze=!(we?_e:Ce).length,Be=we&&Pe.matchInputWidth||ze?{}:{minWidth:"auto"};return r.createElement(b.Provider,{value:Fe},r.createElement(f.Qt,(0,s.c)({},de,{ref:n,id:pe,prefixCls:c,autoClearSearchValue:D,dropdownMatchSelectWidth:le,dropdownStyle:Be,displayValues:De,onDisplayValuesChange:function(e,n){if("clear"!==n.type){var t=n.values[0].valueCells;je(t)}else Ae([])},mode:fe?"multiple":void 0,searchValue:we,onSearch:function(e,n){Ee(e),"blur"!==n.source&&j&&j(e)},showSearch:Oe,OptionList:L,emptyOptions:ze,open:Re,dropdownClassName:Le,placement:Ke,onDropdownVisibleChange:function(e){null==ne||ne(e),null==te||te(e)},getRawInputElement:function(){return ce}})))}));z.SHOW_PARENT=I,z.SHOW_CHILD=N;const B=z;var X=t(82508),Y=t(73105),q=t(40951),U=t(73880),G=t(86732),J=t(82072),Q=t(54492),Z=t(14704),ee=t(32524),ne=t(82244),te=t(57355),oe=t(21448),re=t(24022),ae=t(76604),ce=t(24136),ie=t(16923),le=t(79644),ue=t(21899);const se=e=>{const{prefixCls:n,componentCls:t,antCls:o}=e,r=`${t}-menu-item`,a=`\n &${r}-expand ${r}-expand-icon,\n ${r}-loading-icon\n `;return[{[t]:{width:e.controlWidth}},{[`${t}-dropdown`]:[(0,ce.GA)(`${n}-checkbox`,e),{[`&${o}-select-dropdown`]:{padding:0}},{[t]:{"&-checkbox":{top:0,marginInlineEnd:e.paddingXS},"&-menus":{display:"flex",flexWrap:"nowrap",alignItems:"flex-start",[`&${t}-menu-empty`]:{[`${t}-menu`]:{width:"100%",height:"auto",[r]:{color:e.colorTextDisabled}}}},"&-menu":{flexGrow:1,minWidth:e.controlItemWidth,height:e.dropdownHeight,margin:0,padding:e.menuPadding,overflow:"auto",verticalAlign:"top",listStyle:"none","-ms-overflow-style":"-ms-autohiding-scrollbar","&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-item":Object.assign(Object.assign({},ie.Id),{display:"flex",flexWrap:"nowrap",alignItems:"center",padding:e.optionPadding,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${e.motionDurationMid}`,borderRadius:e.borderRadiusSM,"&:hover":{background:e.controlItemBgHover},"&-disabled":{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"},[a]:{color:e.colorTextDisabled}},[`&-active:not(${r}-disabled)`]:{"&, &:hover":{fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg}},"&-content":{flex:"auto"},[a]:{marginInlineStart:e.paddingXXS,color:e.colorTextDescription,fontSize:e.fontSizeIcon},"&-keyword":{color:e.colorHighlight}})}}}]},{[`${t}-dropdown-rtl`]:{direction:"rtl"}},(0,le._)(e)]},de=(0,ue.c)("Cascader",(e=>[se(e)]),(e=>{const n=Math.round((e.controlHeight-e.fontSize*e.lineHeight)/2);return{controlWidth:184,controlItemWidth:111,dropdownHeight:180,optionSelectedBg:e.controlItemBgActive,optionSelectedFontWeight:e.fontWeightStrong,optionPadding:`${n}px ${e.paddingSM}px`,menuPadding:e.paddingXXS}}));const{SHOW_CHILD:pe,SHOW_PARENT:fe}=B,he=(e,n,t,a)=>{const c=[],i=e.toLowerCase();return n.forEach(((e,n)=>{0!==n&&c.push(" / ");let l=e[a.label];const u=typeof l;"string"!==u&&"number"!==u||(l=function(e,n,t){const a=e.toLowerCase().split(n).reduce(((e,t,r)=>0===r?[t]:[].concat((0,o.c)(e),[n,t])),[]),c=[];let i=0;return a.forEach(((n,o)=>{const a=i+n.length;let l=e.slice(i,a);i=a,o%2==1&&(l=r.createElement("span",{className:`${t}-menu-item-keyword`,key:`separator-${o}`},l)),c.push(l)})),c}(String(l),i,t)),c.push(l)})),c},me=r.forwardRef(((e,n)=>{const{prefixCls:t,size:o,disabled:l,className:s,rootClassName:d,multiple:p,bordered:f=!0,transitionName:h,choiceTransitionName:m="",popupClassName:v,dropdownClassName:g,expandIcon:b,placement:C,showSearch:k,allowClear:S=!0,notFoundContent:x,direction:y,getPopupContainer:w,status:E,showArrow:I,builtinPlacements:N,style:O}=e,P=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t}(e,["prefixCls","size","disabled","className","rootClassName","multiple","bordered","transitionName","choiceTransitionName","popupClassName","dropdownClassName","expandIcon","placement","showSearch","allowClear","notFoundContent","direction","getPopupContainer","status","showArrow","builtinPlacements","style"]),_=(0,X.c)(P,["suffixIcon"]),{getPopupContainer:M,getPrefixCls:T,renderEmpty:W,direction:V,popupOverflow:$,cascader:H}=r.useContext(G.MT),D=y||V,A="rtl"===D,{status:j,hasFeedback:R,isFormItemInput:L,feedbackIcon:K}=r.useContext(ee.A9),F=(0,U.O)(j,E),z=x||(null==W?void 0:W("Cascader"))||r.createElement(J.c,{componentName:"Cascader"}),q=T(),ce=T("select",t),ie=T("cascader",t),[le,ue]=(0,ne.c)(ce),[se]=de(ie),{compactSize:pe,compactItemClassnames:fe}=(0,ae.eu)(ce,y),me=u()(v||g,`${ie}-dropdown`,{[`${ie}-dropdown-rtl`]:"rtl"===D},d,ue),ve=r.useMemo((()=>{if(!k)return k;let e={render:he};return"object"==typeof k&&(e=Object.assign(Object.assign({},e),k)),e}),[k]),ge=(0,Z.c)((e=>{var n;return null!==(n=null!=o?o:pe)&&void 0!==n?n:e})),be=r.useContext(Q.c),Ce=null!=l?l:be;let ke=b;b||(ke=A?r.createElement(a.c,null):r.createElement(i.c,null));const Se=r.createElement("span",{className:`${ce}-menu-item-loading-icon`},r.createElement(c.c,{spin:!0})),xe=r.useMemo((()=>!!p&&r.createElement("span",{className:`${ie}-checkbox-inner`})),[p]),ye=(0,oe.c)(e.suffixIcon,I),{suffixIcon:we,removeIcon:Ee,clearIcon:Ie}=(0,re.c)(Object.assign(Object.assign({},e),{hasFeedback:R,feedbackIcon:K,showSuffixIcon:ye,multiple:p,prefixCls:ce,componentName:"Cascader"})),Ne=r.useMemo((()=>void 0!==C?C:A?"bottomRight":"bottomLeft"),[C,A]),Oe=(0,te.c)(N,$),Pe=!0===S?{clearIcon:Ie}:S;return se(le(r.createElement(B,Object.assign({prefixCls:ce,className:u()(!t&&ie,{[`${ce}-lg`]:"large"===ge,[`${ce}-sm`]:"small"===ge,[`${ce}-rtl`]:A,[`${ce}-borderless`]:!f,[`${ce}-in-form-item`]:L},(0,U.h)(ce,F,R),fe,null==H?void 0:H.className,s,d,ue),disabled:Ce,style:Object.assign(Object.assign({},null==H?void 0:H.style),O)},_,{builtinPlacements:Oe,direction:D,placement:Ne,notFoundContent:z,allowClear:Pe,showSearch:ve,expandIcon:ke,suffixIcon:we,removeIcon:Ee,loadingIcon:Se,checkable:xe,dropdownClassName:me,dropdownPrefixCls:t||ie,choiceTransitionName:(0,Y.M)(q,"",m),transitionName:(0,Y.M)(q,"slide-up",h),getPopupContainer:w||M,ref:n}))))})),ve=(0,q.c)(me);me.SHOW_PARENT=fe,me.SHOW_CHILD=pe,me._InternalPanelDoNotUseOrYouWillBeFired=ve;const ge=me}}]);
2
- //# sourceMappingURL=2364.bbce4b80.js.map