@next-bricks/visual-builder 1.39.15 → 1.39.17

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 (125) hide show
  1. package/dist/bricks.json +10 -10
  2. package/dist/chunks/{5522.678c03f6.js → 4577.f016e9de.js} +3 -3
  3. package/dist/chunks/4577.f016e9de.js.map +1 -0
  4. package/dist/chunks/6411.40f47da3.js +3 -0
  5. package/dist/chunks/6411.40f47da3.js.map +1 -0
  6. package/dist/chunks/7085.3c330b29.js +3 -0
  7. package/dist/chunks/7085.3c330b29.js.map +1 -0
  8. package/dist/chunks/9653.ac443b19.js +2 -0
  9. package/dist/chunks/9653.ac443b19.js.map +1 -0
  10. package/dist/chunks/chat-conversation.0ffc333f.js +3 -0
  11. package/dist/chunks/chat-conversation.0ffc333f.js.map +1 -0
  12. package/dist/chunks/chat-preview.36976c55.js.map +1 -1
  13. package/dist/chunks/contract-select.252b9e45.js +3 -0
  14. package/dist/chunks/contract-select.252b9e45.js.map +1 -0
  15. package/dist/chunks/generate-snippets-context-menu.56acf448.js.map +1 -1
  16. package/dist/chunks/main.1cb52df3.js +2 -0
  17. package/dist/chunks/{main.1c5337dd.js.map → main.1cb52df3.js.map} +1 -1
  18. package/dist/chunks/page-arch-node.379284ad.js +3 -0
  19. package/dist/chunks/page-arch-node.379284ad.js.map +1 -0
  20. package/dist/chunks/pre-generated-config-preview.cfbc2a1e.js.map +1 -1
  21. package/dist/chunks/pre-generated-config.a027788b.js.map +1 -1
  22. package/dist/chunks/pre-generated-container.dcfa8cc9.js.map +1 -1
  23. package/dist/chunks/pre-generated-preview.8e699675.js.map +1 -1
  24. package/dist/chunks/pre-generated-table-view.8a9d5527.js.map +1 -1
  25. package/dist/chunks/property-editor.dea9895b.js +2 -0
  26. package/dist/chunks/property-editor.dea9895b.js.map +1 -0
  27. package/dist/chunks/raw-data-preview.0bf12da3.js.map +1 -1
  28. package/dist/chunks/raw-metric-preview.c503481e.js.map +1 -1
  29. package/dist/chunks/workbench-action-list.c67329ed.js.map +1 -1
  30. package/dist/chunks/workbench-action.5b993227.js.map +1 -1
  31. package/dist/chunks/workbench-pane.5c4866a6.js +3 -0
  32. package/dist/chunks/workbench-pane.5c4866a6.js.map +1 -0
  33. package/dist/chunks/workbench-sidebar.01731e99.js.map +1 -1
  34. package/dist/chunks/{workbench-tree.e71a583f.js → workbench-tree.7097bd88.js} +3 -3
  35. package/dist/chunks/workbench-tree.7097bd88.js.map +1 -0
  36. package/dist/examples.json +47 -5
  37. package/dist/index.93f39de8.js +2 -0
  38. package/dist/{index.90916d4c.js.map → index.93f39de8.js.map} +1 -1
  39. package/dist/manifest.json +217 -63
  40. package/dist/types.json +36 -36
  41. package/dist-types/chat-conversation/index.d.ts +7 -1
  42. package/dist-types/chat-preview/index.d.ts +20 -1
  43. package/dist-types/contract-select/index.d.ts +16 -1
  44. package/dist-types/generate-snippets-context-menu/index.d.ts +17 -1
  45. package/dist-types/page-arch-node/index.d.ts +25 -1
  46. package/dist-types/pre-generated-config/index.d.ts +16 -1
  47. package/dist-types/pre-generated-config-preview/index.d.ts +13 -1
  48. package/dist-types/pre-generated-container/index.d.ts +3 -1
  49. package/dist-types/pre-generated-preview/index.d.ts +6 -1
  50. package/dist-types/pre-generated-table-view/index.d.ts +1 -1
  51. package/dist-types/property-editor/index.d.ts +10 -4
  52. package/dist-types/raw-data-preview/index.d.ts +9 -1
  53. package/dist-types/raw-metric-preview/index.d.ts +8 -1
  54. package/dist-types/workbench-action/index.d.ts +7 -0
  55. package/dist-types/workbench-action-list/index.d.ts +3 -0
  56. package/dist-types/workbench-pane/index.d.ts +4 -0
  57. package/dist-types/workbench-sidebar/index.d.ts +2 -0
  58. package/dist-types/workbench-tree/index.d.ts +19 -6
  59. package/docs/chat-conversation.md +51 -31
  60. package/docs/chat-conversation.react.md +115 -0
  61. package/docs/chat-preview.md +83 -0
  62. package/docs/chat-preview.react.md +105 -0
  63. package/docs/contract-select.md +97 -0
  64. package/docs/contract-select.react.md +95 -0
  65. package/docs/generate-snippets-context-menu.md +141 -0
  66. package/docs/generate-snippets-context-menu.react.md +134 -0
  67. package/docs/page-arch-node.md +87 -1
  68. package/docs/page-arch-node.react.md +97 -0
  69. package/docs/pre-generated-config-preview.md +74 -0
  70. package/docs/pre-generated-config-preview.react.md +82 -0
  71. package/docs/pre-generated-config.md +96 -0
  72. package/docs/pre-generated-config.react.md +78 -0
  73. package/docs/pre-generated-container.md +56 -0
  74. package/docs/pre-generated-container.react.md +62 -0
  75. package/docs/pre-generated-preview.md +83 -0
  76. package/docs/pre-generated-preview.react.md +92 -0
  77. package/docs/pre-generated-table-view.md +46 -0
  78. package/docs/pre-generated-table-view.react.md +36 -0
  79. package/docs/property-editor.md +44 -1
  80. package/docs/property-editor.react.md +97 -0
  81. package/docs/raw-data-preview.md +75 -1643
  82. package/docs/raw-data-preview.react.md +154 -0
  83. package/docs/raw-metric-preview.md +93 -0
  84. package/docs/raw-metric-preview.react.md +94 -0
  85. package/docs/workbench-action-list.md +80 -0
  86. package/docs/workbench-action-list.react.md +85 -0
  87. package/docs/workbench-action.md +80 -0
  88. package/docs/workbench-action.react.md +76 -0
  89. package/docs/workbench-history-action.md +42 -1
  90. package/docs/workbench-history-action.react.md +54 -0
  91. package/docs/workbench-pane.md +105 -0
  92. package/docs/workbench-pane.react.md +90 -0
  93. package/docs/workbench-sidebar.md +88 -0
  94. package/docs/workbench-sidebar.react.md +66 -0
  95. package/docs/workbench-tree.md +217 -0
  96. package/docs/workbench-tree.react.md +180 -0
  97. package/package.json +2 -2
  98. package/dist/chunks/36.b158228e.js +0 -3
  99. package/dist/chunks/36.b158228e.js.map +0 -1
  100. package/dist/chunks/5522.678c03f6.js.map +0 -1
  101. package/dist/chunks/7085.c58ac475.js +0 -3
  102. package/dist/chunks/7085.c58ac475.js.map +0 -1
  103. package/dist/chunks/9653.e857fdaf.js +0 -2
  104. package/dist/chunks/9653.e857fdaf.js.map +0 -1
  105. package/dist/chunks/chat-conversation.d873f6d5.js +0 -3
  106. package/dist/chunks/chat-conversation.d873f6d5.js.map +0 -1
  107. package/dist/chunks/contract-select.ff891ded.js +0 -3
  108. package/dist/chunks/contract-select.ff891ded.js.map +0 -1
  109. package/dist/chunks/main.1c5337dd.js +0 -2
  110. package/dist/chunks/page-arch-node.974674c0.js +0 -3
  111. package/dist/chunks/page-arch-node.974674c0.js.map +0 -1
  112. package/dist/chunks/property-editor.6de6adf4.js +0 -2
  113. package/dist/chunks/property-editor.6de6adf4.js.map +0 -1
  114. package/dist/chunks/workbench-pane.7e85de42.js +0 -3
  115. package/dist/chunks/workbench-pane.7e85de42.js.map +0 -1
  116. package/dist/chunks/workbench-tree.e71a583f.js.map +0 -1
  117. package/dist/index.90916d4c.js +0 -2
  118. /package/dist/chunks/{5522.678c03f6.js.LICENSE.txt → 4577.f016e9de.js.LICENSE.txt} +0 -0
  119. /package/dist/chunks/{36.b158228e.js.LICENSE.txt → 6411.40f47da3.js.LICENSE.txt} +0 -0
  120. /package/dist/chunks/{7085.c58ac475.js.LICENSE.txt → 7085.3c330b29.js.LICENSE.txt} +0 -0
  121. /package/dist/chunks/{chat-conversation.d873f6d5.js.LICENSE.txt → chat-conversation.0ffc333f.js.LICENSE.txt} +0 -0
  122. /package/dist/chunks/{contract-select.ff891ded.js.LICENSE.txt → contract-select.252b9e45.js.LICENSE.txt} +0 -0
  123. /package/dist/chunks/{page-arch-node.974674c0.js.LICENSE.txt → page-arch-node.379284ad.js.LICENSE.txt} +0 -0
  124. /package/dist/chunks/{workbench-pane.7e85de42.js.LICENSE.txt → workbench-pane.5c4866a6.js.LICENSE.txt} +0 -0
  125. /package/dist/chunks/{workbench-tree.e71a583f.js.LICENSE.txt → workbench-tree.7097bd88.js.LICENSE.txt} +0 -0
@@ -1,11 +1,52 @@
1
- 项目变更历史
1
+ ---
2
+ tagName: visual-builder.workbench-history-action
3
+ displayName: WrappedVisualBuilderWorkbenchHistoryAction
4
+ description: 项目变更历史
5
+ category: ""
6
+ source: "@next-bricks/visual-builder"
7
+ ---
8
+
9
+ # visual-builder.workbench-history-action
10
+
11
+ > 项目变更历史
12
+
13
+ ## Props
14
+
15
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
16
+ | --------- | -------- | ---- | ------ | ------- |
17
+ | appId | `string` | 是 | - | 应用 ID |
18
+ | projectId | `string` | 是 | - | 项目 ID |
19
+
20
+ ## Events
21
+
22
+ | 事件 | detail | 说明 |
23
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------ |
24
+ | history.item.click | `HistoryData & { enableRollback: boolean }` — { enableRollback: 是否可回滚, action: 操作类型, user: 操作用户, ts: 时间戳 } | 点击历史项标题触发 |
25
+ | rollback | `HistoryData` — { action: 操作类型, user: 操作用户, ts: 时间戳 } | 点击回滚触发 |
26
+ | rollback.all | `void` | 点击全部回滚触发 |
27
+
28
+ ## Slots
29
+
30
+ | 名称 | 说明 |
31
+ | --------- | -------------------------------------------------------------------------------- |
32
+ | (default) | 放置 modal 等弹层构件,使其成为 popover 的子内容,防止操作弹层时意外关闭 popover |
2
33
 
3
34
  ## Examples
4
35
 
5
36
  ### Basic
6
37
 
38
+ 显示项目变更历史弹窗,支持查看历史记录和回滚操作。
39
+
7
40
  ```yaml preview
8
41
  brick: visual-builder.workbench-history-action
9
42
  properties:
10
43
  appId: project-a
44
+ projectId: proj-001
45
+ events:
46
+ history.item.click:
47
+ - action: console.log
48
+ rollback:
49
+ - action: console.log
50
+ rollback.all:
51
+ - action: console.log
11
52
  ```
@@ -0,0 +1,54 @@
1
+ ---
2
+ tagName: visual-builder.workbench-history-action
3
+ displayName: WrappedVisualBuilderWorkbenchHistoryAction
4
+ description: 项目变更历史
5
+ category: ""
6
+ source: "@next-bricks/visual-builder"
7
+ ---
8
+
9
+ # WrappedVisualBuilderWorkbenchHistoryAction
10
+
11
+ > 项目变更历史
12
+
13
+ ## 导入
14
+
15
+ ```tsx
16
+ import { WrappedVisualBuilderWorkbenchHistoryAction } from "@easyops/wrapped-components";
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
22
+ | --------- | -------- | ---- | ------ | ------- |
23
+ | appId | `string` | 是 | - | 应用 ID |
24
+ | projectId | `string` | 是 | - | 项目 ID |
25
+
26
+ ## Events
27
+
28
+ | 事件 | detail | 说明 |
29
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------ |
30
+ | onHistoryItemClick | `HistoryData & { enableRollback: boolean }` — { enableRollback: 是否可回滚, action: 操作类型, user: 操作用户, ts: 时间戳 } | 点击历史项标题触发 |
31
+ | onRollback | `HistoryData` — { action: 操作类型, user: 操作用户, ts: 时间戳 } | 点击回滚触发 |
32
+ | onRollbackAll | `void` | 点击全部回滚触发 |
33
+
34
+ ## Slots
35
+
36
+ | 名称 | 说明 |
37
+ | --------- | -------------------------------------------------------------------------------- |
38
+ | (default) | 放置 modal 等弹层构件,使其成为 popover 的子内容,防止操作弹层时意外关闭 popover |
39
+
40
+ ## Examples
41
+
42
+ ### Basic
43
+
44
+ 显示项目变更历史弹窗,支持查看历史记录和回滚操作。
45
+
46
+ ```tsx
47
+ <WrappedVisualBuilderWorkbenchHistoryAction
48
+ appId="project-a"
49
+ projectId="proj-001"
50
+ onHistoryItemClick={(e) => console.log(e.detail)}
51
+ onRollback={(e) => console.log(e.detail)}
52
+ onRollbackAll={() => console.log("rollback all")}
53
+ />
54
+ ```
@@ -0,0 +1,105 @@
1
+ ---
2
+ tagName: visual-builder.workbench-pane
3
+ displayName: WrappedVisualBuilderWorkbenchPane
4
+ description: 工作台侧边栏面板,可折叠的内容面板,包含标题栏和可滚动的内容区
5
+ category: ""
6
+ source: "@next-bricks/visual-builder"
7
+ ---
8
+
9
+ # visual-builder.workbench-pane
10
+
11
+ > 工作台侧边栏面板,可折叠的内容面板,包含标题栏和可滚动的内容区
12
+
13
+ ## Props
14
+
15
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
16
+ | ---------- | --------- | ---- | ------ | -------------------- |
17
+ | titleLabel | `string` | 否 | - | 面板标题文本 |
18
+ | active | `boolean` | 否 | - | 是否展开面板 |
19
+ | badge | `number` | 否 | - | 标题栏右侧的数字徽标 |
20
+
21
+ ## Events
22
+
23
+ | 事件 | detail | 说明 |
24
+ | --------------------- | --------------------------------------------------- | ---------------------------------- |
25
+ | active.change | `boolean` — 当前展开状态,true 为展开,false 为折叠 | 面板展开/折叠状态变化时触发 |
26
+ | active.firstActivated | `void` | 面板首次被展开时触发(仅触发一次) |
27
+
28
+ ## Slots
29
+
30
+ | 名称 | 说明 |
31
+ | --------- | ------------------------------------ |
32
+ | title | 标题栏自定义内容,显示在标题文本右侧 |
33
+ | actions | 标题栏操作区,显示在 badge 左侧 |
34
+ | (default) | 面板内容区,可滚动 |
35
+
36
+ ## Examples
37
+
38
+ ### Basic
39
+
40
+ 展示一个可折叠的侧边栏面板,包含标题和内容区域。
41
+
42
+ ```yaml preview
43
+ brick: visual-builder.workbench-pane
44
+ properties:
45
+ titleLabel: 资源列表
46
+ active: true
47
+ events:
48
+ active.change:
49
+ - action: console.log
50
+ children:
51
+ - brick: div
52
+ properties:
53
+ textContent: 这是面板内容
54
+ style:
55
+ padding: 16px
56
+ ```
57
+
58
+ ### 带徽标和操作区
59
+
60
+ 在标题栏右侧显示数字徽标,并在操作区提供额外按钮。
61
+
62
+ ```yaml preview
63
+ brick: visual-builder.workbench-pane
64
+ properties:
65
+ titleLabel: 告警列表
66
+ active: true
67
+ badge: 5
68
+ children:
69
+ - brick: eo-button
70
+ slot: actions
71
+ properties:
72
+ icon:
73
+ lib: antd
74
+ icon: plus
75
+ theme: outlined
76
+ type: text
77
+ size: small
78
+ - brick: div
79
+ properties:
80
+ textContent: 5 条告警信息
81
+ style:
82
+ padding: 16px
83
+ ```
84
+
85
+ ### 首次激活事件
86
+
87
+ 监听面板首次展开时触发的一次性事件,适用于懒加载场景。
88
+
89
+ ```yaml preview
90
+ brick: visual-builder.workbench-pane
91
+ properties:
92
+ titleLabel: 延迟加载内容
93
+ active: false
94
+ events:
95
+ active.firstActivated:
96
+ - action: console.log
97
+ args:
98
+ - "面板首次展开,开始加载数据"
99
+ children:
100
+ - brick: div
101
+ properties:
102
+ textContent: 内容将在首次展开后加载
103
+ style:
104
+ padding: 16px
105
+ ```
@@ -0,0 +1,90 @@
1
+ ---
2
+ tagName: visual-builder.workbench-pane
3
+ displayName: WrappedVisualBuilderWorkbenchPane
4
+ description: 工作台侧边栏面板,可折叠的内容面板,包含标题栏和可滚动的内容区
5
+ category: ""
6
+ source: "@next-bricks/visual-builder"
7
+ ---
8
+
9
+ # WrappedVisualBuilderWorkbenchPane
10
+
11
+ > 工作台侧边栏面板,可折叠的内容面板,包含标题栏和可滚动的内容区
12
+
13
+ ## 导入
14
+
15
+ ```tsx
16
+ import { WrappedVisualBuilderWorkbenchPane } from "@easyops/wrapped-components";
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
22
+ | ---------- | --------- | ---- | ------ | -------------------- |
23
+ | titleLabel | `string` | 否 | - | 面板标题文本 |
24
+ | active | `boolean` | 否 | - | 是否展开面板 |
25
+ | badge | `number` | 否 | - | 标题栏右侧的数字徽标 |
26
+
27
+ ## Events
28
+
29
+ | 事件 | detail | 说明 |
30
+ | ---------------------- | --------------------------------------------------- | ---------------------------------- |
31
+ | onActiveChange | `boolean` — 当前展开状态,true 为展开,false 为折叠 | 面板展开/折叠状态变化时触发 |
32
+ | onActiveFirstActivated | `void` | 面板首次被展开时触发(仅触发一次) |
33
+
34
+ ## Slots
35
+
36
+ | 名称 | 说明 |
37
+ | --------- | ------------------------------------ |
38
+ | title | 标题栏自定义内容,显示在标题文本右侧 |
39
+ | actions | 标题栏操作区,显示在 badge 左侧 |
40
+ | (default) | 面板内容区,可滚动 |
41
+
42
+ ## Examples
43
+
44
+ ### Basic
45
+
46
+ 展示一个可折叠的侧边栏面板,包含标题和内容区域。
47
+
48
+ ```tsx
49
+ <WrappedVisualBuilderWorkbenchPane
50
+ titleLabel="资源列表"
51
+ active={true}
52
+ onActiveChange={(e) => console.log(e.detail)}
53
+ >
54
+ <div style={{ padding: "16px" }}>这是面板内容</div>
55
+ </WrappedVisualBuilderWorkbenchPane>
56
+ ```
57
+
58
+ ### 带徽标和操作区
59
+
60
+ 在标题栏右侧显示数字徽标,并在操作区提供额外按钮。
61
+
62
+ ```tsx
63
+ <WrappedVisualBuilderWorkbenchPane
64
+ titleLabel="告警列表"
65
+ active={true}
66
+ badge={5}
67
+ >
68
+ <WrappedEoButton
69
+ slot="actions"
70
+ icon={{ lib: "antd", icon: "plus", theme: "outlined" }}
71
+ type="text"
72
+ size="small"
73
+ />
74
+ <div style={{ padding: "16px" }}>5 条告警信息</div>
75
+ </WrappedVisualBuilderWorkbenchPane>
76
+ ```
77
+
78
+ ### 首次激活事件
79
+
80
+ 监听面板首次展开时触发的一次性事件,适用于懒加载场景。
81
+
82
+ ```tsx
83
+ <WrappedVisualBuilderWorkbenchPane
84
+ titleLabel="延迟加载内容"
85
+ active={false}
86
+ onActiveFirstActivated={() => console.log("面板首次展开,开始加载数据")}
87
+ >
88
+ <div style={{ padding: "16px" }}>内容将在首次展开后加载</div>
89
+ </WrappedVisualBuilderWorkbenchPane>
90
+ ```
@@ -0,0 +1,88 @@
1
+ ---
2
+ tagName: visual-builder.workbench-sidebar
3
+ displayName: WrappedVisualBuilderWorkbenchSidebar
4
+ description: 工作台侧边栏容器,包含标题栏和面板容器,自动管理子面板(workbench-pane)的展开/折叠布局
5
+ category: ""
6
+ source: "@next-bricks/visual-builder"
7
+ ---
8
+
9
+ # visual-builder.workbench-sidebar
10
+
11
+ > 工作台侧边栏容器,包含标题栏和面板容器,自动管理子面板(workbench-pane)的展开/折叠布局
12
+
13
+ ## Props
14
+
15
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
16
+ | ---------- | -------- | ---- | ------ | -------------- |
17
+ | titleLabel | `string` | 否 | - | 侧边栏标题文本 |
18
+
19
+ ## Slots
20
+
21
+ | 名称 | 说明 |
22
+ | ------------ | -------------------------- |
23
+ | titleToolbar | 标题栏右侧工具栏区域 |
24
+ | (default) | 放置 workbench-pane 子面板 |
25
+
26
+ ## Examples
27
+
28
+ ### Basic
29
+
30
+ 展示包含多个可折叠面板的侧边栏容器,子面板会自动响应展开/折叠状态调整布局。
31
+
32
+ ```yaml preview
33
+ brick: visual-builder.workbench-sidebar
34
+ properties:
35
+ titleLabel: 工作区
36
+ children:
37
+ - brick: visual-builder.workbench-pane
38
+ properties:
39
+ titleLabel: 资源列表
40
+ active: true
41
+ children:
42
+ - brick: div
43
+ properties:
44
+ textContent: 资源内容区域
45
+ style:
46
+ padding: 16px
47
+ - brick: visual-builder.workbench-pane
48
+ properties:
49
+ titleLabel: 属性面板
50
+ active: false
51
+ children:
52
+ - brick: div
53
+ properties:
54
+ textContent: 属性内容区域
55
+ style:
56
+ padding: 16px
57
+ ```
58
+
59
+ ### 带标题栏工具栏
60
+
61
+ 在侧边栏标题栏右侧添加操作按钮。
62
+
63
+ ```yaml preview
64
+ brick: visual-builder.workbench-sidebar
65
+ properties:
66
+ titleLabel: 组件树
67
+ children:
68
+ - brick: eo-button
69
+ slot: titleToolbar
70
+ properties:
71
+ icon:
72
+ lib: antd
73
+ icon: plus
74
+ theme: outlined
75
+ type: text
76
+ size: small
77
+ tooltip: 新增节点
78
+ - brick: visual-builder.workbench-pane
79
+ properties:
80
+ titleLabel: 页面结构
81
+ active: true
82
+ children:
83
+ - brick: div
84
+ properties:
85
+ textContent: 页面结构树
86
+ style:
87
+ padding: 16px
88
+ ```
@@ -0,0 +1,66 @@
1
+ ---
2
+ tagName: visual-builder.workbench-sidebar
3
+ displayName: WrappedVisualBuilderWorkbenchSidebar
4
+ description: 工作台侧边栏容器,包含标题栏和面板容器,自动管理子面板(workbench-pane)的展开/折叠布局
5
+ category: ""
6
+ source: "@next-bricks/visual-builder"
7
+ ---
8
+
9
+ # WrappedVisualBuilderWorkbenchSidebar
10
+
11
+ > 工作台侧边栏容器,包含标题栏和面板容器,自动管理子面板(workbench-pane)的展开/折叠布局
12
+
13
+ ## 导入
14
+
15
+ ```tsx
16
+ import { WrappedVisualBuilderWorkbenchSidebar } from "@easyops/wrapped-components";
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
22
+ | ---------- | -------- | ---- | ------ | -------------- |
23
+ | titleLabel | `string` | 否 | - | 侧边栏标题文本 |
24
+
25
+ ## Slots
26
+
27
+ | 名称 | 说明 |
28
+ | ------------ | -------------------------- |
29
+ | titleToolbar | 标题栏右侧工具栏区域 |
30
+ | (default) | 放置 workbench-pane 子面板 |
31
+
32
+ ## Examples
33
+
34
+ ### Basic
35
+
36
+ 展示包含多个可折叠面板的侧边栏容器,子面板会自动响应展开/折叠状态调整布局。
37
+
38
+ ```tsx
39
+ <WrappedVisualBuilderWorkbenchSidebar titleLabel="工作区">
40
+ <WrappedVisualBuilderWorkbenchPane titleLabel="资源列表" active={true}>
41
+ <div style={{ padding: "16px" }}>资源内容区域</div>
42
+ </WrappedVisualBuilderWorkbenchPane>
43
+ <WrappedVisualBuilderWorkbenchPane titleLabel="属性面板" active={false}>
44
+ <div style={{ padding: "16px" }}>属性内容区域</div>
45
+ </WrappedVisualBuilderWorkbenchPane>
46
+ </WrappedVisualBuilderWorkbenchSidebar>
47
+ ```
48
+
49
+ ### 带标题栏工具栏
50
+
51
+ 在侧边栏标题栏右侧添加操作按钮。
52
+
53
+ ```tsx
54
+ <WrappedVisualBuilderWorkbenchSidebar titleLabel="组件树">
55
+ <WrappedEoButton
56
+ slot="titleToolbar"
57
+ icon={{ lib: "antd", icon: "plus", theme: "outlined" }}
58
+ type="text"
59
+ size="small"
60
+ tooltip="新增节点"
61
+ />
62
+ <WrappedVisualBuilderWorkbenchPane titleLabel="页面结构" active={true}>
63
+ <div style={{ padding: "16px" }}>页面结构树</div>
64
+ </WrappedVisualBuilderWorkbenchPane>
65
+ </WrappedVisualBuilderWorkbenchSidebar>
66
+ ```
@@ -0,0 +1,217 @@
1
+ ---
2
+ tagName: visual-builder.workbench-tree
3
+ displayName: WrappedVisualBuilderWorkbenchTree
4
+ description: 工作台树形组件,支持搜索、拖拽排序、折叠展开和节点操作
5
+ category: ""
6
+ source: "@next-bricks/visual-builder"
7
+ ---
8
+
9
+ # visual-builder.workbench-tree
10
+
11
+ > 工作台树形组件,支持搜索、拖拽排序、折叠展开和节点操作
12
+
13
+ ## Props
14
+
15
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
16
+ | ------------------- | ------------------------------------------------------ | ---- | ------ | ----------------------------------------------- |
17
+ | nodes | `WorkbenchNodeData[]` | 是 | - | 树节点数据列表 |
18
+ | actions | `WorkbenchTreeAction[]` | 是 | - | 节点操作按钮配置列表 |
19
+ | actionsHidden | `boolean` | 是 | - | 是否隐藏节点操作按钮 |
20
+ | placeholder | `string` | 是 | - | 无数据时显示的占位文本 |
21
+ | isTransformName | `boolean` | 是 | - | 是否将节点名称转换为可读格式 |
22
+ | searchPlaceholder | `string` | 是 | - | 搜索框占位文本 |
23
+ | noSearch | `boolean` | 是 | - | 是否隐藏搜索框 |
24
+ | activeKey | `string \| number` | 是 | - | 当前激活节点的 key |
25
+ | showMatchedNodeOnly | `boolean` | 是 | - | 搜索时是否只显示匹配的节点 |
26
+ | matchNodeDataFields | `string \| string[]` | 是 | - | 搜索时匹配的节点数据字段,"\*" 表示匹配所有字段 |
27
+ | fixedActionsFor | `Record<string, unknown> \| Record<string, unknown>[]` | 是 | - | 始终显示操作按钮的节点数据条件 |
28
+ | collapsible | `boolean` | 是 | - | 是否启用节点折叠功能 |
29
+ | collapsedNodes | `string[]` | 是 | - | 当前已折叠节点的 ID 列表 |
30
+ | allowDrag | `boolean` | 是 | - | 是否允许拖拽排序 |
31
+ | allowDragToRoot | `boolean` | 是 | - | 是否允许拖拽到根节点位置 |
32
+ | allowDragToInside | `boolean` | 是 | - | 是否允许拖拽到节点内部成为子节点 |
33
+ | nodeKey | `string` | 是 | - | 节点唯一标识字段名 |
34
+ | skipNotify | `boolean` | 是 | - | 是否跳过节点点击时的通知 |
35
+
36
+ ## Events
37
+
38
+ | 事件 | detail | 说明 |
39
+ | ------------ | -------------------------------------------------------------------------------------- | --------------------------- |
40
+ | action.click | `ActionClickDetail` — { action: 操作标识, data: 节点数据 } | 点击节点操作按钮时触发 |
41
+ | node.click | `unknown` — 节点的 data 数据 | 点击节点时触发 |
42
+ | node.drop | `any` — 拖拽完成后的节点位置信息 | 拖拽节点完成时触发 |
43
+ | context.menu | `unknown` — { active: true, node: 节点的 data 数据, x: 鼠标 X 坐标, y: 鼠标 Y 坐标 } | 右键点击节点时触发 |
44
+ | node.toggle | `{ nodeId: string; collapsed: boolean; }` — { nodeId: 节点 ID, collapsed: 是否已折叠 } | 节点折叠/展开状态变化时触发 |
45
+
46
+ ## Examples
47
+
48
+ ### Basic
49
+
50
+ 展示基本的树形结构,包含节点数据和操作按钮。
51
+
52
+ ```yaml preview
53
+ brick: visual-builder.workbench-tree
54
+ properties:
55
+ nodes:
56
+ - key: "1"
57
+ name: 页面A
58
+ data:
59
+ id: "1"
60
+ type: page
61
+ children:
62
+ - key: "1-1"
63
+ name: 子页面A1
64
+ data:
65
+ id: "1-1"
66
+ type: page
67
+ - key: "1-2"
68
+ name: 子页面A2
69
+ data:
70
+ id: "1-2"
71
+ type: page
72
+ - key: "2"
73
+ name: 页面B
74
+ data:
75
+ id: "2"
76
+ type: page
77
+ actions:
78
+ - action: add
79
+ icon:
80
+ lib: antd
81
+ icon: plus
82
+ theme: outlined
83
+ title: 新增
84
+ - action: delete
85
+ icon:
86
+ lib: antd
87
+ icon: delete
88
+ theme: outlined
89
+ title: 删除
90
+ actionsHidden: false
91
+ placeholder: 暂无页面
92
+ searchPlaceholder: 搜索页面
93
+ noSearch: false
94
+ activeKey: "1"
95
+ showMatchedNodeOnly: false
96
+ matchNodeDataFields: []
97
+ fixedActionsFor: []
98
+ collapsible: true
99
+ collapsedNodes: []
100
+ allowDrag: false
101
+ allowDragToRoot: false
102
+ allowDragToInside: false
103
+ nodeKey: ""
104
+ skipNotify: false
105
+ events:
106
+ node.click:
107
+ - action: console.log
108
+ action.click:
109
+ - action: console.log
110
+ ```
111
+
112
+ ### 可拖拽排序
113
+
114
+ 启用拖拽功能,支持在节点间拖拽调整顺序和层级。
115
+
116
+ ```yaml preview
117
+ brick: visual-builder.workbench-tree
118
+ properties:
119
+ nodes:
120
+ - key: "1"
121
+ name: 构件A
122
+ data:
123
+ id: "1"
124
+ children: []
125
+ - key: "2"
126
+ name: 构件B
127
+ data:
128
+ id: "2"
129
+ children:
130
+ - key: "2-1"
131
+ name: 子构件B1
132
+ data:
133
+ id: "2-1"
134
+ - key: "2-2"
135
+ name: 子构件B2
136
+ data:
137
+ id: "2-2"
138
+ - key: "3"
139
+ name: 构件C
140
+ data:
141
+ id: "3"
142
+ children: []
143
+ actions: []
144
+ actionsHidden: true
145
+ placeholder: 暂无构件
146
+ searchPlaceholder: 搜索构件
147
+ noSearch: false
148
+ activeKey: ""
149
+ showMatchedNodeOnly: false
150
+ matchNodeDataFields: []
151
+ fixedActionsFor: []
152
+ collapsible: true
153
+ collapsedNodes: []
154
+ allowDrag: true
155
+ allowDragToRoot: true
156
+ allowDragToInside: true
157
+ nodeKey: ""
158
+ skipNotify: false
159
+ events:
160
+ node.drop:
161
+ - action: console.log
162
+ node.toggle:
163
+ - action: console.log
164
+ ```
165
+
166
+ ### 搜索和右键菜单
167
+
168
+ 启用节点数据字段搜索,并监听右键菜单事件。
169
+
170
+ ```yaml preview
171
+ brick: visual-builder.workbench-tree
172
+ properties:
173
+ nodes:
174
+ - key: "1"
175
+ name: 登录页
176
+ data:
177
+ id: "1"
178
+ path: /login
179
+ - key: "2"
180
+ name: 首页
181
+ data:
182
+ id: "2"
183
+ path: /home
184
+ - key: "3"
185
+ name: 详情页
186
+ data:
187
+ id: "3"
188
+ path: /detail
189
+ actions:
190
+ - action: edit
191
+ icon:
192
+ lib: antd
193
+ icon: edit
194
+ theme: outlined
195
+ title: 编辑
196
+ actionsHidden: false
197
+ placeholder: 暂无页面
198
+ searchPlaceholder: 搜索路径或名称
199
+ noSearch: false
200
+ activeKey: "2"
201
+ showMatchedNodeOnly: true
202
+ matchNodeDataFields:
203
+ - path
204
+ fixedActionsFor: []
205
+ collapsible: false
206
+ collapsedNodes: []
207
+ allowDrag: false
208
+ allowDragToRoot: false
209
+ allowDragToInside: false
210
+ nodeKey: ""
211
+ skipNotify: false
212
+ events:
213
+ context.menu:
214
+ - action: console.log
215
+ action.click:
216
+ - action: console.log
217
+ ```