@robot-admin/naive-ui-components 0.41.0 → 0.41.2
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/CHANGELOG.md +15 -0
- package/README.md +44 -5
- package/README_EN.md +44 -5
- package/dist/C_ActionBar.css +54 -54
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_AntV.css +10 -10
- package/dist/C_AntV2.cjs +1 -1
- package/dist/C_AntV2.js +1 -1
- package/dist/C_AudioPlayer.css +53 -53
- package/dist/C_AudioPlayer2.cjs +1 -1
- package/dist/C_AudioPlayer2.js +1 -1
- package/dist/C_AutoComplete.css +2 -2
- package/dist/C_AutoComplete2.cjs +1 -1
- package/dist/C_AutoComplete2.js +1 -1
- package/dist/C_AvatarGroup.css +29 -29
- package/dist/C_AvatarGroup2.cjs +1 -1
- package/dist/C_AvatarGroup2.js +1 -1
- package/dist/C_BatchResult.css +10 -10
- package/dist/C_BatchResult2.cjs +1 -1
- package/dist/C_BatchResult2.js +1 -1
- package/dist/C_Breadcrumb.css +40 -40
- package/dist/C_Breadcrumb2.cjs +1 -1
- package/dist/C_Breadcrumb2.js +1 -1
- package/dist/C_Captcha.d.cts +2 -2
- package/dist/C_Captcha.d.ts +2 -2
- package/dist/C_Captcha2.cjs +1 -1
- package/dist/C_Captcha2.js +1 -1
- package/dist/C_Cascade.css +4 -4
- package/dist/C_Cascade2.cjs +1 -1
- package/dist/C_Cascade2.js +1 -1
- package/dist/C_Chat2.cjs +1 -1
- package/dist/C_Chat2.js +1 -1
- package/dist/C_City.css +35 -35
- package/dist/C_City2.cjs +1 -1
- package/dist/C_City2.js +1 -1
- package/dist/C_Code.css +27 -27
- package/dist/C_Code2.cjs +1 -1
- package/dist/C_Code2.js +2 -2
- package/dist/C_CollapsePanel2.cjs +1 -1
- package/dist/C_CollapsePanel2.js +1 -1
- package/dist/C_ContextMenu.css +3 -3
- package/dist/C_ContextMenu2.cjs +1 -1
- package/dist/C_ContextMenu2.js +1 -1
- package/dist/C_Cron.css +18 -18
- package/dist/C_Cron2.cjs +1 -1
- package/dist/C_Cron2.js +1 -1
- package/dist/C_DataPicker.css +52 -52
- package/dist/C_DataPicker2.cjs +1 -1
- package/dist/C_DataPicker2.js +1 -1
- package/dist/C_Date.css +5 -5
- package/dist/C_Date2.cjs +1 -1
- package/dist/C_Date2.js +1 -1
- package/dist/C_Draggable.css +53 -53
- package/dist/C_Draggable2.cjs +1 -1
- package/dist/C_Draggable2.js +1 -1
- package/dist/C_Editor.css +13 -13
- package/dist/C_Editor.d.cts +2 -2
- package/dist/C_Editor.d.ts +2 -2
- package/dist/C_Editor2.cjs +1 -1
- package/dist/C_Editor2.js +1 -1
- package/dist/C_FilePreview.css +49 -49
- package/dist/C_FilePreview2.cjs +1 -1
- package/dist/C_FilePreview2.js +1 -1
- package/dist/C_Form.base.css +241 -241
- package/dist/C_Form.css +241 -241
- package/dist/C_Form.d.cts +1 -1
- package/dist/C_Form.d.ts +1 -1
- package/dist/C_FormModal.css +55 -55
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.css +74 -74
- package/dist/C_FormSearch.d.ts +1 -1
- package/dist/C_FormulaEditor.cjs +1 -1
- package/dist/C_FormulaEditor.css +41 -41
- package/dist/C_FormulaEditor.d.cts +2 -2
- package/dist/C_FormulaEditor.d.ts +2 -2
- package/dist/C_FormulaEditor.js +1 -1
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_Guide.css +13 -13
- package/dist/C_Guide2.cjs +1 -1
- package/dist/C_Guide2.js +1 -1
- package/dist/C_ImageCropper.css +27 -27
- package/dist/C_ImageCropper2.cjs +1 -1
- package/dist/C_ImageCropper2.js +1 -1
- package/dist/C_ImportWizard.css +8 -8
- package/dist/C_ImportWizard2.cjs +1 -1
- package/dist/C_ImportWizard2.js +1 -1
- package/dist/C_Loading.css +18 -18
- package/dist/C_Loading2.cjs +1 -1
- package/dist/C_Loading2.js +1 -1
- package/dist/C_Login.css +94 -94
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Markdown.css +37 -37
- package/dist/C_Markdown2.cjs +1 -1
- package/dist/C_Markdown2.js +1 -1
- package/dist/C_NotificationCenter.css +24 -24
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_OrgChart.d.cts +2 -8
- package/dist/C_OrgChart.d.ts +2 -8
- package/dist/C_QRCode.css +9 -9
- package/dist/C_QRCode2.cjs +1 -1
- package/dist/C_QRCode2.js +1 -1
- package/dist/C_RecurrenceEditor.cjs +1 -1
- package/dist/C_RecurrenceEditor.d.cts +2 -2
- package/dist/C_RecurrenceEditor.d.ts +2 -2
- package/dist/C_RecurrenceEditor.js +1 -1
- package/dist/C_RecurrenceEditor2.cjs +1 -1
- package/dist/C_RecurrenceEditor2.js +1 -1
- package/dist/C_ScanInput2.cjs +1 -1
- package/dist/C_ScanInput2.js +1 -1
- package/dist/C_SectionNav.css +8 -8
- package/dist/C_SectionNav2.cjs +1 -1
- package/dist/C_SectionNav2.js +1 -1
- package/dist/C_Signature.css +15 -15
- package/dist/C_Signature2.cjs +1 -1
- package/dist/C_Signature2.js +1 -1
- package/dist/C_Table.base.css +428 -428
- package/dist/C_Table.css +187 -187
- package/dist/C_Table.d.cts +1 -1
- package/dist/C_Table.d.ts +1 -1
- package/dist/C_Table2.cjs +4 -4
- package/dist/C_Table2.js +4 -4
- package/dist/C_Timeline.css +50 -50
- package/dist/C_Timeline2.cjs +1 -1
- package/dist/C_Timeline2.js +1 -1
- package/dist/C_Tree.css +30 -30
- package/dist/C_Tree2.cjs +1 -1
- package/dist/C_Tree2.js +1 -1
- package/dist/C_Upload.css +5 -5
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/C_UserPicker.css +1 -1
- package/dist/C_VideoPlayer2.cjs +1 -1
- package/dist/C_VideoPlayer2.js +1 -1
- package/dist/C_VtableGantt.css +34 -34
- package/dist/C_WorkFlow.css +93 -93
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.js +1 -1
- package/dist/ColumnSettingsDrawer.cjs +1 -0
- package/dist/ColumnSettingsDrawer.js +1 -0
- package/dist/Custom.cjs +1 -1
- package/dist/Custom.js +1 -1
- package/dist/Dynamic.cjs +1 -1
- package/dist/Dynamic.js +1 -1
- package/dist/Steps.cjs +1 -1
- package/dist/Steps.js +1 -1
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/component-config.d.ts +1 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants2.d.cts +8 -1
- package/dist/constants2.d.ts +8 -1
- package/dist/constants3.d.cts +7 -7
- package/dist/constants3.d.ts +7 -7
- package/dist/constants4.d.cts +5 -5
- package/dist/constants4.d.ts +5 -5
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/context.d.cts +1 -1
- package/dist/data2.d.cts +6 -6
- package/dist/data2.d.ts +6 -6
- package/dist/editors.d.cts +14 -12
- package/dist/editors.d.ts +14 -12
- package/dist/fieldNode.cjs +1 -0
- package/dist/fieldNode.js +1 -0
- package/dist/fieldRenderers.cjs +1 -1
- package/dist/fieldRenderers.js +1 -1
- package/dist/graphics.cjs +1 -1
- package/dist/graphics.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/index11.vue.d.ts +1 -1
- package/dist/index12.vue.d.cts +1 -1
- package/dist/index13.vue.d.ts +3 -3
- package/dist/index14.vue.d.cts +3 -3
- package/dist/index14.vue.d.ts +1 -1
- package/dist/index15.vue.d.cts +1 -1
- package/dist/index17.vue.d.ts +18 -11
- package/dist/index18.vue.d.cts +18 -11
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index20.vue.d.ts +3 -3
- package/dist/index21.vue.d.cts +3 -3
- package/dist/index21.vue.d.ts +7 -7
- package/dist/index22.vue.d.cts +7 -7
- package/dist/index26.vue.d.ts +1 -1
- package/dist/index27.vue.d.cts +1 -1
- package/dist/index27.vue.d.ts +3 -3
- package/dist/index28.vue.d.cts +3 -3
- package/dist/index29.vue.d.cts +2 -2
- package/dist/index29.vue.d.ts +2 -2
- package/dist/index3.vue.d.cts +14 -16
- package/dist/index3.vue.d.ts +14 -16
- package/dist/index33.vue.d.cts +2 -2
- package/dist/index33.vue.d.ts +2 -2
- package/dist/index34.vue.d.cts +2 -0
- package/dist/index34.vue.d.ts +2 -0
- package/dist/index35.vue.d.cts +4 -4
- package/dist/index35.vue.d.ts +4 -4
- package/dist/index36.vue.d.cts +20 -11
- package/dist/index36.vue.d.ts +20 -11
- package/dist/index39.vue.d.cts +1 -1
- package/dist/index39.vue.d.ts +1 -1
- package/dist/index4.vue.d.cts +7 -4
- package/dist/index4.vue.d.ts +7 -4
- package/dist/index41.vue.d.cts +1 -1
- package/dist/index41.vue.d.ts +1 -1
- package/dist/index42.vue.d.cts +2 -2
- package/dist/index42.vue.d.ts +2 -2
- package/dist/index45.vue.d.cts +2 -2
- package/dist/index45.vue.d.ts +2 -2
- package/dist/index5.vue.d.cts +5 -17
- package/dist/index5.vue.d.ts +5 -17
- package/dist/index6.vue.d.cts +2 -2
- package/dist/index6.vue.d.ts +2 -2
- package/dist/index7.vue.d.cts +18 -12
- package/dist/index7.vue.d.ts +18 -12
- package/dist/localSource.d.cts +8 -8
- package/dist/localSource.d.ts +8 -8
- package/dist/locale.cjs +1 -1
- package/dist/locale.js +1 -1
- package/dist/mapUtils.d.cts +2 -2
- package/dist/mapUtils.d.ts +2 -2
- package/dist/persistence.cjs +1 -0
- package/dist/persistence.js +1 -0
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/rule.d.cts +4 -1
- package/dist/rule.d.ts +4 -1
- package/dist/serializeSearch.cjs +1 -1
- package/dist/serializeSearch.js +1 -1
- package/dist/source.cjs +1 -1
- package/dist/source.js +1 -1
- package/dist/style.css +1334 -1334
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types10.d.cts +2 -0
- package/dist/types10.d.ts +1 -1
- package/dist/types11.d.cts +1 -1
- package/dist/types3.d.cts +14 -5
- package/dist/types3.d.ts +14 -5
- package/dist/types5.d.ts +12 -10
- package/dist/types6.d.cts +12 -10
- package/dist/types6.d.ts +1 -1
- package/dist/types9.d.ts +2 -0
- package/dist/useCalendarEvents.d.cts +4 -16
- package/dist/useCalendarEvents.d.ts +4 -16
- package/dist/useCollapsePanel.d.cts +8 -7
- package/dist/useCollapsePanel.d.ts +8 -7
- package/dist/useCropperCore.d.cts +9 -20
- package/dist/useCropperCore.d.ts +9 -20
- package/dist/useDynamicFormState.d.cts +1 -1
- package/dist/useDynamicFormState.d.ts +1 -1
- package/dist/useEdgeInteraction.d.cts +2 -11
- package/dist/useEdgeInteraction.d.ts +2 -11
- package/dist/useFormRenderer.d.cts +1 -1
- package/dist/useFormRenderer.d.ts +1 -1
- package/dist/useFormulaEvaluator.cjs +2 -2
- package/dist/useFormulaEvaluator.js +2 -2
- package/dist/useFullscreen.d.cts +23 -5
- package/dist/useFullscreen.d.ts +23 -5
- package/dist/useInfiniteScroll.d.cts +2 -2
- package/dist/useInfiniteScroll.d.ts +2 -2
- package/dist/useQRCode.d.cts +5 -18
- package/dist/useQRCode.d.ts +5 -18
- package/dist/useSignatureHistory.d.cts +2 -2
- package/dist/useSignatureHistory.d.ts +2 -2
- package/dist/useSplitResize.d.cts +3 -3
- package/dist/useSplitResize.d.ts +3 -3
- package/dist/useTimeSelection.d.cts +4 -3
- package/dist/useTimeSelection.d.ts +4 -3
- package/dist/useWorkflowValidation.d.cts +113 -107
- package/dist/useWorkflowValidation.d.ts +113 -107
- package/dist/verification.d.cts +6 -6
- package/dist/verification.d.ts +6 -6
- package/docs/engineering.en.md +1 -0
- package/docs/engineering.md +1 -0
- package/docs/guides/batch-results.md +3 -3
- package/docs/guides/data-picker.md +2 -0
- package/docs/guides/runtime-performance.md +2 -0
- package/docs/guides/scene-components.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @robot-admin/naive-ui-components
|
|
2
2
|
|
|
3
|
+
## 0.41.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `C_DataPicker` 从数据源推断业务值,按单选或多选输出对应形状。`C_BatchResult` 和 `C_SectionNav` 从输入数据推断事件键,表格、表单和操作栏复用内部契约。
|
|
8
|
+
- `C_Table` 在用户打开列设置时加载抽屉,降低普通表格首屏和表格选择器首次打开的加载量。
|
|
9
|
+
- 修复扫码取消重入、缓存页菜单遮罩残留、引导实例争用遮罩和搜索取消重发旧查询。补齐选择器、编辑器、上传和持久化的会话边界,重复规则提供独立的草稿预览序列化。
|
|
10
|
+
- 更新中英文接入文档,验证发布包的类型推断、组件按需入口和生产构建下的交互。
|
|
11
|
+
|
|
12
|
+
## 0.41.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 分离操作栏的可见分组与窄容器溢出 composable,保留稳定渲染键和执行锁。溢出菜单仍按需加载,普通工具栏不加载菜单实现。
|
|
17
|
+
|
|
3
18
|
## 0.41.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
<a href="#快速开始">快速开始</a> ·
|
|
17
17
|
<a href="#能力地图">能力地图</a> ·
|
|
18
18
|
<a href="#场景接入">场景接入</a> ·
|
|
19
|
+
<a href="#按需加载与样式">按需加载</a> ·
|
|
19
20
|
<a href="./docs/components.md">组件目录</a> ·
|
|
20
21
|
<a href="https://www.tzagileteam.com/robot/components/preface">在线文档</a> ·
|
|
21
22
|
<a href="https://robotadmin.cn">在线体验</a> ·
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
|
|
28
29
|
**Naive UI Components** 是从 [Robot Admin](https://github.com/ChenyCHENYU/Robot_Admin) 提炼的 Vue 3 组件库,以 `@robot-admin/naive-ui-components` 独立发布。表单、表格、实体选择和工作台可以通过类型化的配置接入。业务接口、权限和任务执行由宿主应用负责。
|
|
29
30
|
|
|
30
|
-
当前仓库版本 **0.41.
|
|
31
|
+
当前仓库版本 **0.41.2**,版本变化和升级说明见[变更记录](./CHANGELOG.md)。
|
|
31
32
|
|
|
32
33
|
## 快速开始
|
|
33
34
|
|
|
@@ -50,7 +51,7 @@ bun add @robot-admin/naive-ui-components vue@^3.5.3 naive-ui@^2.35.0
|
|
|
50
51
|
C_Form,
|
|
51
52
|
defineFormOptions,
|
|
52
53
|
} from '@robot-admin/naive-ui-components/C_Form'
|
|
53
|
-
import '@robot-admin/naive-ui-components/C_Form/
|
|
54
|
+
import '@robot-admin/naive-ui-components/C_Form/base.css'
|
|
54
55
|
|
|
55
56
|
const draft = ref({ name: '' })
|
|
56
57
|
const fields = defineFormOptions<typeof draft.value>([
|
|
@@ -68,9 +69,41 @@ bun add @robot-admin/naive-ui-components vue@^3.5.3 naive-ui@^2.35.0
|
|
|
68
69
|
|
|
69
70
|
保存请求可以直接交给 `config.onSubmit`。需要在模板外读写表单或主动验证时,使用 `useCForm()`。完整示例见[表单与表格](./docs/guides/usage.md#c_form--c_table-推荐用法)。
|
|
70
71
|
|
|
71
|
-
###
|
|
72
|
+
### 通过表格选择物料
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
```vue
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { ref } from 'vue'
|
|
77
|
+
import {
|
|
78
|
+
C_DataPicker,
|
|
79
|
+
createLocalDataPickerSource,
|
|
80
|
+
} from '@robot-admin/naive-ui-components/C_DataPicker'
|
|
81
|
+
import '@robot-admin/naive-ui-components/C_DataPicker/style.css'
|
|
82
|
+
|
|
83
|
+
const selected = ref<number[]>([])
|
|
84
|
+
const source = createLocalDataPickerSource({
|
|
85
|
+
rows: [{ id: 1, name: '热轧卷板' }],
|
|
86
|
+
rowKey: 'id',
|
|
87
|
+
value: row => row.id,
|
|
88
|
+
label: row => row.name,
|
|
89
|
+
})
|
|
90
|
+
const columns = [{ key: 'name', title: '物料' }]
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<C_DataPicker
|
|
95
|
+
v-model="selected"
|
|
96
|
+
:source="source"
|
|
97
|
+
:columns="columns"
|
|
98
|
+
title="选择物料"
|
|
99
|
+
multiple
|
|
100
|
+
/>
|
|
101
|
+
</template>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`source.value` 决定业务值类型。开启 `multiple` 时回写数组,单选回写单值或 `null`。远程候选提供同样的数据源接口,接入分页、回显和字段回填的方式见[实体选择指南](./docs/guides/data-picker.md)。
|
|
105
|
+
|
|
106
|
+
`C_BatchResult` 从结果行推断重试键,`C_SectionNav` 从导航项推断 `select` 事件的键。配置需跨页面复用时,可以从各组件子路径导入公开类型。 [批量结果](./docs/guides/batch-results.md) · [分区导航](./docs/guides/data-workflows.md#多区域校验和导航)
|
|
74
107
|
|
|
75
108
|
## 能力地图
|
|
76
109
|
|
|
@@ -110,6 +143,8 @@ bun add @robot-admin/naive-ui-components vue@^3.5.3 naive-ui@^2.35.0
|
|
|
110
143
|
|
|
111
144
|
使用内置富文本字段时导入完整样式。普通表单与表格可以选用 `C_Form/base.css` 和 `C_Table/base.css`,自动导入对应的选项为 `importStyle: 'base'`。配置方式见[导入指南](./docs/guides/usage.md#导入方式)。
|
|
112
145
|
|
|
146
|
+
`C_Table` 在首次打开列设置时加载设置面板,`C_DataPicker` 在打开选择器时加载候选表格。`check:consumer-size` 分别检查消费端首屏和打开选择器新增的 JavaScript。 [运行时性能指南](./docs/guides/runtime-performance.md)
|
|
147
|
+
|
|
113
148
|
## 文档导航
|
|
114
149
|
|
|
115
150
|
| 文档 | 内容 |
|
|
@@ -127,9 +162,13 @@ bun add @robot-admin/naive-ui-components vue@^3.5.3 naive-ui@^2.35.0
|
|
|
127
162
|
```bash
|
|
128
163
|
bun install --frozen-lockfile
|
|
129
164
|
bun run verify
|
|
165
|
+
bun run test:browser
|
|
166
|
+
bun run test:performance
|
|
130
167
|
```
|
|
131
168
|
|
|
132
|
-
`verify`
|
|
169
|
+
`verify` 检查类型、单测、组件测试、打包消费和入口体积。随后在构建产物上运行 Chromium、Firefox、WebKit 回归,以及 Chromium 下的多表、编辑和组织图性能用例。首次运行浏览器测试前,执行 `bun run playwright install chromium firefox webkit`。 [验证与发布](./docs/engineering.md#发布)
|
|
170
|
+
|
|
171
|
+
本地查看场景时,先运行 `bun run build`,再运行 `bun run dev:search-workflows`。 [本地场景演示](http://127.0.0.1:4188/scenes.html)
|
|
133
172
|
|
|
134
173
|
## Robot 生态
|
|
135
174
|
|
package/README_EN.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
<a href="#quick-start">Quick start</a> ·
|
|
17
17
|
<a href="#capability-map">Capabilities</a> ·
|
|
18
18
|
<a href="#integration-recipes">Integration recipes</a> ·
|
|
19
|
+
<a href="#imports-and-styles">Imports</a> ·
|
|
19
20
|
<a href="./docs/components.en.md">Component catalog</a> ·
|
|
20
21
|
<a href="https://www.tzagileteam.com/robot/components/preface">Online docs</a> ·
|
|
21
22
|
<a href="https://robotadmin.cn">Live demo</a> ·
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
|
|
28
29
|
**Naive UI Components** is a Vue 3 library extracted from [Robot Admin](https://github.com/ChenyCHENYU/Robot_Admin) and published independently as `@robot-admin/naive-ui-components`. It provides typed configuration for forms, tables, entity pickers, and workspaces. The host application owns endpoints, permissions, and task execution.
|
|
29
30
|
|
|
30
|
-
The current repository version is **0.41.
|
|
31
|
+
The current repository version is **0.41.2**. See the [changelog](./CHANGELOG.md) for release and upgrade details.
|
|
31
32
|
|
|
32
33
|
## Quick start
|
|
33
34
|
|
|
@@ -50,7 +51,7 @@ The package root, `C_Breadcrumb`, and `C_TagsView` require `vue-router@^4.6.4` o
|
|
|
50
51
|
C_Form,
|
|
51
52
|
defineFormOptions,
|
|
52
53
|
} from '@robot-admin/naive-ui-components/C_Form'
|
|
53
|
-
import '@robot-admin/naive-ui-components/C_Form/
|
|
54
|
+
import '@robot-admin/naive-ui-components/C_Form/base.css'
|
|
54
55
|
|
|
55
56
|
const draft = ref({ name: '' })
|
|
56
57
|
const fields = defineFormOptions<typeof draft.value>([
|
|
@@ -68,9 +69,41 @@ The package root, `C_Breadcrumb`, and `C_TagsView` require `vue-router@^4.6.4` o
|
|
|
68
69
|
|
|
69
70
|
Pass a save handler to `config.onSubmit`. Use `useCForm()` when code outside the template needs to read, update, or validate the form. See [forms and tables](./docs/guides/usage.en.md#recommended-c_form--c_table-setup) for full examples.
|
|
70
71
|
|
|
71
|
-
###
|
|
72
|
+
### Select materials from a table
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
```vue
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { ref } from 'vue'
|
|
77
|
+
import {
|
|
78
|
+
C_DataPicker,
|
|
79
|
+
createLocalDataPickerSource,
|
|
80
|
+
} from '@robot-admin/naive-ui-components/C_DataPicker'
|
|
81
|
+
import '@robot-admin/naive-ui-components/C_DataPicker/style.css'
|
|
82
|
+
|
|
83
|
+
const selected = ref<number[]>([])
|
|
84
|
+
const source = createLocalDataPickerSource({
|
|
85
|
+
rows: [{ id: 1, name: 'Hot-rolled coil' }],
|
|
86
|
+
rowKey: 'id',
|
|
87
|
+
value: row => row.id,
|
|
88
|
+
label: row => row.name,
|
|
89
|
+
})
|
|
90
|
+
const columns = [{ key: 'name', title: 'Material' }]
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<C_DataPicker
|
|
95
|
+
v-model="selected"
|
|
96
|
+
:source="source"
|
|
97
|
+
:columns="columns"
|
|
98
|
+
title="Select materials"
|
|
99
|
+
multiple
|
|
100
|
+
/>
|
|
101
|
+
</template>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`source.value` determines the selected value type. With `multiple`, the component writes an array. Single selection writes a value or `null`. The guide covers remote pagination, label resolution, and form field mapping. [Entity picker guide](./docs/guides/data-picker.md)
|
|
105
|
+
|
|
106
|
+
`C_BatchResult` infers the retry keys from the result rows. `C_SectionNav` infers the `select` event key from the navigation items. Import public types from component subpaths when sharing configuration across pages. [Batch results](./docs/guides/batch-results.md) · [Section navigation](./docs/guides/data-workflows.md#多区域校验和导航)
|
|
74
107
|
|
|
75
108
|
## Capability map
|
|
76
109
|
|
|
@@ -110,6 +143,8 @@ Provide a reactive `persistPrefix` via `TABLE_GLOBAL_CONFIG_KEY`, then give each
|
|
|
110
143
|
|
|
111
144
|
Use full styles for built-in rich-text fields. Ordinary forms and tables can use `C_Form/base.css` and `C_Table/base.css`, or `importStyle: 'base'` with the resolver. See [import strategies](./docs/guides/usage.en.md#import-strategies) for configuration examples.
|
|
112
145
|
|
|
146
|
+
`C_Table` loads its column settings panel the first time it opens. `C_DataPicker` loads its candidate table when the picker opens. `check:consumer-size` measures the initial bundle and the JavaScript loaded when opening the picker separately. [Runtime performance guide](./docs/guides/runtime-performance.md)
|
|
147
|
+
|
|
113
148
|
## Documentation
|
|
114
149
|
|
|
115
150
|
| Document | Coverage |
|
|
@@ -127,9 +162,13 @@ Use Node.js 20.19+ and the Bun version pinned in the repository's `packageManage
|
|
|
127
162
|
```bash
|
|
128
163
|
bun install --frozen-lockfile
|
|
129
164
|
bun run verify
|
|
165
|
+
bun run test:browser
|
|
166
|
+
bun run test:performance
|
|
130
167
|
```
|
|
131
168
|
|
|
132
|
-
`verify` runs
|
|
169
|
+
`verify` runs type checks, unit and component tests, packaged-consumer checks, and bundle budget checks. Run the Chromium, Firefox, and WebKit regressions against the resulting build, followed by the Chromium performance cases for multiple tables, editable fields, and organization charts. Before your first browser run, execute `bun run playwright install chromium firefox webkit`. [Verification and releases](./docs/engineering.en.md#publishing)
|
|
170
|
+
|
|
171
|
+
For interactive demos, run `bun run build` and then `bun run dev:search-workflows`. [Local scene gallery](http://127.0.0.1:4188/scenes.html)
|
|
133
172
|
|
|
134
173
|
## Robot ecosystem
|
|
135
174
|
|
package/dist/C_ActionBar.css
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
|
|
87
87
|
/* 通用操作按钮组件样式 */
|
|
88
88
|
/* ================= 主容器 ================= */
|
|
89
|
-
.c-action-bar[data-v-
|
|
89
|
+
.c-action-bar[data-v-421fb4df] {
|
|
90
90
|
display: flex;
|
|
91
91
|
min-width: 0;
|
|
92
92
|
align-items: center;
|
|
@@ -98,26 +98,26 @@
|
|
|
98
98
|
border: 1px solid var(--c-border, var(--c-theme-border));
|
|
99
99
|
transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
|
|
100
100
|
}
|
|
101
|
-
.c-action-bar.is-align-left[data-v-
|
|
101
|
+
.c-action-bar.is-align-left[data-v-421fb4df] {
|
|
102
102
|
justify-content: flex-start;
|
|
103
103
|
}
|
|
104
|
-
.c-action-bar.is-align-center[data-v-
|
|
104
|
+
.c-action-bar.is-align-center[data-v-421fb4df] {
|
|
105
105
|
justify-content: center;
|
|
106
106
|
}
|
|
107
|
-
.c-action-bar.is-align-right[data-v-
|
|
107
|
+
.c-action-bar.is-align-right[data-v-421fb4df] {
|
|
108
108
|
justify-content: flex-end;
|
|
109
109
|
}
|
|
110
|
-
.c-action-bar.is-align-space-between[data-v-
|
|
110
|
+
.c-action-bar.is-align-space-between[data-v-421fb4df] {
|
|
111
111
|
justify-content: space-between;
|
|
112
112
|
}
|
|
113
|
-
.c-action-bar.is-align-space-around[data-v-
|
|
113
|
+
.c-action-bar.is-align-space-around[data-v-421fb4df] {
|
|
114
114
|
justify-content: space-around;
|
|
115
115
|
}
|
|
116
|
-
.c-action-bar.is-compact[data-v-
|
|
116
|
+
.c-action-bar.is-compact[data-v-421fb4df] {
|
|
117
117
|
padding: 8px;
|
|
118
118
|
margin-bottom: 8px;
|
|
119
119
|
}
|
|
120
|
-
.c-action-bar.is-inline[data-v-
|
|
120
|
+
.c-action-bar.is-inline[data-v-421fb4df] {
|
|
121
121
|
padding: 0;
|
|
122
122
|
margin-bottom: 0;
|
|
123
123
|
background: transparent;
|
|
@@ -125,107 +125,107 @@
|
|
|
125
125
|
border-radius: 0;
|
|
126
126
|
box-shadow: none;
|
|
127
127
|
}
|
|
128
|
-
.c-action-bar.has-overflow[data-v-
|
|
128
|
+
.c-action-bar.has-overflow[data-v-421fb4df] {
|
|
129
129
|
gap: 8px;
|
|
130
130
|
}
|
|
131
|
-
.c-action-bar.is-wrap[data-v-
|
|
131
|
+
.c-action-bar.is-wrap[data-v-421fb4df] {
|
|
132
132
|
flex-wrap: wrap;
|
|
133
133
|
gap: 8px;
|
|
134
134
|
}
|
|
135
|
-
.c-action-bar.is-wrap .actions-group[data-v-
|
|
135
|
+
.c-action-bar.is-wrap .actions-group[data-v-421fb4df] {
|
|
136
136
|
flex-wrap: wrap;
|
|
137
137
|
min-width: 0;
|
|
138
138
|
max-width: 100%;
|
|
139
139
|
}
|
|
140
140
|
@media (max-width: 768px) {
|
|
141
|
-
.c-action-bar[data-v-
|
|
141
|
+
.c-action-bar[data-v-421fb4df] {
|
|
142
142
|
flex-direction: column;
|
|
143
143
|
gap: 12px;
|
|
144
144
|
}
|
|
145
|
-
.c-action-bar .actions-group[data-v-
|
|
145
|
+
.c-action-bar .actions-group[data-v-421fb4df] {
|
|
146
146
|
width: 100%;
|
|
147
147
|
justify-content: center;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
/* ================= 按钮组 ================= */
|
|
152
|
-
.actions-group[data-v-
|
|
152
|
+
.actions-group[data-v-421fb4df] {
|
|
153
153
|
display: flex;
|
|
154
154
|
align-items: center;
|
|
155
155
|
gap: 12px;
|
|
156
156
|
flex-wrap: nowrap;
|
|
157
157
|
flex-shrink: 0;
|
|
158
158
|
}
|
|
159
|
-
.actions-group.actions-left[data-v-
|
|
159
|
+
.actions-group.actions-left[data-v-421fb4df] {
|
|
160
160
|
justify-content: flex-start;
|
|
161
161
|
}
|
|
162
|
-
.actions-group.actions-right[data-v-
|
|
162
|
+
.actions-group.actions-right[data-v-421fb4df] {
|
|
163
163
|
justify-content: flex-end;
|
|
164
164
|
}
|
|
165
|
-
.c-action-bar.has-only-left.is-align-center .actions-group.actions-left[data-v-
|
|
165
|
+
.c-action-bar.has-only-left.is-align-center .actions-group.actions-left[data-v-421fb4df], .c-action-bar.has-only-right.is-align-center .actions-group.actions-right[data-v-421fb4df] {
|
|
166
166
|
width: 100%;
|
|
167
167
|
justify-content: center;
|
|
168
168
|
}
|
|
169
|
-
.c-action-bar.has-only-left.is-align-space-between .actions-group.actions-left[data-v-
|
|
169
|
+
.c-action-bar.has-only-left.is-align-space-between .actions-group.actions-left[data-v-421fb4df], .c-action-bar.has-only-right.is-align-space-between .actions-group.actions-right[data-v-421fb4df] {
|
|
170
170
|
width: 100%;
|
|
171
171
|
justify-content: space-between;
|
|
172
172
|
}
|
|
173
|
-
.c-action-bar.has-only-left.is-align-space-around .actions-group.actions-left[data-v-
|
|
173
|
+
.c-action-bar.has-only-left.is-align-space-around .actions-group.actions-left[data-v-421fb4df], .c-action-bar.has-only-right.is-align-space-around .actions-group.actions-right[data-v-421fb4df] {
|
|
174
174
|
width: 100%;
|
|
175
175
|
justify-content: space-around;
|
|
176
176
|
}
|
|
177
|
-
.c-action-bar.has-only-left.is-align-right .actions-group.actions-left[data-v-
|
|
177
|
+
.c-action-bar.has-only-left.is-align-right .actions-group.actions-left[data-v-421fb4df] {
|
|
178
178
|
width: 100%;
|
|
179
179
|
justify-content: flex-end;
|
|
180
180
|
}
|
|
181
|
-
.c-action-bar.has-only-right.is-align-left .actions-group.actions-right[data-v-
|
|
181
|
+
.c-action-bar.has-only-right.is-align-left .actions-group.actions-right[data-v-421fb4df] {
|
|
182
182
|
width: 100%;
|
|
183
183
|
justify-content: flex-start;
|
|
184
184
|
}
|
|
185
|
-
.actions-group[data-v-
|
|
185
|
+
.actions-group[data-v-421fb4df] .n-button {
|
|
186
186
|
flex-shrink: 0;
|
|
187
187
|
transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
|
|
188
188
|
font-weight: 500;
|
|
189
189
|
}
|
|
190
|
-
.actions-group[data-v-
|
|
190
|
+
.actions-group[data-v-421fb4df] .n-button .n-icon {
|
|
191
191
|
transition: transform 0.3s ease;
|
|
192
192
|
}
|
|
193
|
-
.actions-group[data-v-
|
|
193
|
+
.actions-group[data-v-421fb4df] .n-button:hover:not(:disabled) {
|
|
194
194
|
transform: translateY(-1px);
|
|
195
195
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
|
|
196
196
|
}
|
|
197
|
-
.actions-group[data-v-
|
|
197
|
+
.actions-group[data-v-421fb4df] .n-button:hover:not(:disabled) .n-icon {
|
|
198
198
|
transform: scale(1.1);
|
|
199
199
|
}
|
|
200
|
-
.actions-group[data-v-
|
|
200
|
+
.actions-group[data-v-421fb4df] .n-button:active:not(:disabled) {
|
|
201
201
|
transform: translateY(0);
|
|
202
202
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
203
203
|
}
|
|
204
|
-
.actions-group[data-v-
|
|
204
|
+
.actions-group[data-v-421fb4df] .n-button:disabled {
|
|
205
205
|
cursor: not-allowed;
|
|
206
206
|
opacity: 0.5;
|
|
207
207
|
}
|
|
208
|
-
.actions-group[data-v-
|
|
208
|
+
.actions-group[data-v-421fb4df] .n-button.n-button--loading {
|
|
209
209
|
pointer-events: none;
|
|
210
210
|
}
|
|
211
|
-
.actions-group[data-v-
|
|
211
|
+
.actions-group[data-v-421fb4df] .n-button--primary-type:hover:not(:disabled) {
|
|
212
212
|
box-shadow: 0 4px 12px rgba(24, 160, 88, 0.3);
|
|
213
213
|
}
|
|
214
|
-
.actions-group[data-v-
|
|
214
|
+
.actions-group[data-v-421fb4df] .n-button--info-type:hover:not(:disabled) {
|
|
215
215
|
box-shadow: 0 4px 12px rgba(42, 148, 125, 0.3);
|
|
216
216
|
}
|
|
217
|
-
.actions-group[data-v-
|
|
217
|
+
.actions-group[data-v-421fb4df] .n-button--success-type:hover:not(:disabled) {
|
|
218
218
|
box-shadow: 0 4px 12px rgba(99, 226, 183, 0.3);
|
|
219
219
|
}
|
|
220
|
-
.actions-group[data-v-
|
|
220
|
+
.actions-group[data-v-421fb4df] .n-button--warning-type:hover:not(:disabled) {
|
|
221
221
|
box-shadow: 0 4px 12px rgba(240, 138, 0, 0.3);
|
|
222
222
|
}
|
|
223
|
-
.actions-group[data-v-
|
|
223
|
+
.actions-group[data-v-421fb4df] .n-button--error-type:hover:not(:disabled) {
|
|
224
224
|
box-shadow: 0 4px 12px rgba(208, 48, 80, 0.3);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
/* ================= 中间插槽区域 ================= */
|
|
228
|
-
.actions-center[data-v-
|
|
228
|
+
.actions-center[data-v-421fb4df] {
|
|
229
229
|
display: flex;
|
|
230
230
|
align-items: center;
|
|
231
231
|
justify-content: center;
|
|
@@ -235,38 +235,38 @@
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
/* ================= 分隔线 ================= */
|
|
238
|
-
.action-divider[data-v-
|
|
238
|
+
.action-divider[data-v-421fb4df] {
|
|
239
239
|
margin: 0 8px !important;
|
|
240
240
|
height: 20px;
|
|
241
241
|
opacity: 0.3;
|
|
242
242
|
transition: opacity 0.3s ease;
|
|
243
243
|
}
|
|
244
|
-
.action-divider--horizontal[data-v-
|
|
244
|
+
.action-divider--horizontal[data-v-421fb4df] {
|
|
245
245
|
width: 20px;
|
|
246
246
|
min-width: 20px;
|
|
247
247
|
height: auto;
|
|
248
248
|
flex: 0 0 20px;
|
|
249
249
|
}
|
|
250
|
-
.action-divider[data-v-
|
|
250
|
+
.action-divider[data-v-421fb4df]:hover {
|
|
251
251
|
opacity: 0.6;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
/* ================= 下拉菜单优化 ================= */
|
|
255
|
-
[data-v-
|
|
255
|
+
[data-v-421fb4df] .n-dropdown-option {
|
|
256
256
|
transition: all 0.2s ease;
|
|
257
257
|
}
|
|
258
|
-
[data-v-
|
|
258
|
+
[data-v-421fb4df] .n-dropdown-option:hover {
|
|
259
259
|
transform: translateX(4px);
|
|
260
260
|
}
|
|
261
|
-
[data-v-
|
|
261
|
+
[data-v-421fb4df] .n-dropdown-option .n-icon {
|
|
262
262
|
transition: transform 0.2s ease;
|
|
263
263
|
}
|
|
264
|
-
[data-v-
|
|
264
|
+
[data-v-421fb4df] .n-dropdown-option:hover .n-icon {
|
|
265
265
|
transform: scale(1.15);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
/* ================= 加载动画 ================= */
|
|
269
|
-
@keyframes button-loading-
|
|
269
|
+
@keyframes button-loading-421fb4df {
|
|
270
270
|
0% {
|
|
271
271
|
opacity: 0.6;
|
|
272
272
|
}
|
|
@@ -277,12 +277,12 @@
|
|
|
277
277
|
opacity: 0.6;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
[data-v-
|
|
281
|
-
animation: button-loading-
|
|
280
|
+
[data-v-421fb4df] .n-button--loading {
|
|
281
|
+
animation: button-loading-421fb4df 1.5s ease-in-out infinite;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
/* ================= Tooltip 样式 ================= */
|
|
285
|
-
[data-v-
|
|
285
|
+
[data-v-421fb4df] .n-tooltip .n-tooltip__content {
|
|
286
286
|
font-size: 12px;
|
|
287
287
|
padding: 6px 10px;
|
|
288
288
|
border-radius: 4px;
|
|
@@ -291,23 +291,23 @@
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
/* ================= 暗黑模式适配 ================= */
|
|
294
|
-
html.dark .c-action-bar[data-v-
|
|
294
|
+
html.dark .c-action-bar[data-v-421fb4df] {
|
|
295
295
|
border-color: rgba(255, 255, 255, 0.09);
|
|
296
296
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
297
297
|
}
|
|
298
|
-
html.dark .actions-group[data-v-
|
|
298
|
+
html.dark .actions-group[data-v-421fb4df] .n-button:hover:not(:disabled) {
|
|
299
299
|
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
|
|
300
300
|
}
|
|
301
|
-
html.dark .action-divider[data-v-
|
|
301
|
+
html.dark .action-divider[data-v-421fb4df] {
|
|
302
302
|
opacity: 0.15;
|
|
303
303
|
}
|
|
304
|
-
html.dark .action-divider[data-v-
|
|
304
|
+
html.dark .action-divider[data-v-421fb4df]:hover {
|
|
305
305
|
opacity: 0.4;
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
/* layer: default */
|
|
309
|
-
.m4[data-v-
|
|
310
|
-
.m5[data-v-
|
|
311
|
-
.m6[data-v-
|
|
312
|
-
.inline[data-v-
|
|
313
|
-
.px[data-v-
|
|
309
|
+
.m4[data-v-421fb4df]{margin:1rem;}
|
|
310
|
+
.m5[data-v-421fb4df]{margin:1.25rem;}
|
|
311
|
+
.m6[data-v-421fb4df]{margin:1.5rem;}
|
|
312
|
+
.inline[data-v-421fb4df]{display:inline;}
|
|
313
|
+
.px[data-v-421fb4df]{padding-left:1rem;padding-right:1rem;}
|
package/dist/C_ActionBar2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./useComponentLocale.cjs`),n=require(`./useComponentTheme.cjs`),r=require(`./export-helper.cjs`),i=require(`./useComponentDensity.cjs`),a=require(`./actionIcon.cjs`),o=require(`./useActionTask.cjs`);let s=require(`vue`),c=require(`naive-ui`);const l=`mdi:gesture-tap-button`,u={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0,overflowAt:0},d={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},f=e=>{let t=d[e.key??``]??{};return{...t,...e,label:e.label||t.label||e.key||`操作`,icon:e.icon||t.icon||l,type:e.type??t.type}},p=e=>typeof e==`function`?e():(0,s.unref)(e),m=e=>e,h={key:0,class:`actions-center`},
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./useComponentLocale.cjs`),n=require(`./useComponentTheme.cjs`),r=require(`./export-helper.cjs`),i=require(`./useComponentDensity.cjs`),a=require(`./actionIcon.cjs`),o=require(`./useActionTask.cjs`);let s=require(`vue`),c=require(`naive-ui`);const l=`mdi:gesture-tap-button`,u={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0,overflowAt:0},d={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},f=e=>{let t=d[e.key??``]??{};return{...t,...e,label:e.label||t.label||e.key||`操作`,icon:e.icon||t.icon||l,type:e.type??t.type}},p=e=>typeof e==`function`?e():(0,s.unref)(e),m=e=>e;function h(e,t){let n=new Map,r=[];return e.forEach((e,i)=>{let a=e.key===void 0?`position:${t}:${i}`:`key:${e.key}`,o=n.get(a)??0;n.set(a,o+1),p(e.show)!==!1&&r.push({action:e,taskKey:a,renderKey:`${t}:${a}:${o}`})}),r}function g({action:e}){return e.overflow===!0&&!e.buttonProps&&!e.directives?.length&&!e.dropdown?.length&&!e.tooltip}function _(e,t){let n=(0,s.ref)(!1),r=(0,s.computed)(()=>{let e=t();return Number.isFinite(e)&&e>0?e:0});return{buttonGroups:(0,s.computed)(()=>{let t=e.actions??[],i=h(e.leftActions?.length?e.leftActions:t.filter(e=>e.group!==`right`),`left`),a=h(e.rightActions?.length?e.rightActions:t.filter(e=>e.group===`right`),`right`),o=[];if(!r.value||!n.value)return{left:i,right:a,overflow:o};let s=e=>g(e)?(o.push(e),!1):!0;return{left:i.filter(s),right:a.filter(s),overflow:o}}),narrow:n,overflowAt:r}}const v={key:0,class:`actions-center`},y=(0,s.defineComponent)({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`,`action-error`],setup(r,{emit:l}){let d=n.n(),m=i.t(),{t:h}=t.t(),g={add:`common.add`,create:`common.add`,save:`common.save`,confirm:`action.confirm`,cancel:`common.cancel`,close:`common.close`,view:`common.view`,edit:`common.edit`,delete:`common.delete`,remove:`common.delete`,refresh:`common.refresh`,import:`common.import`,export:`common.export`,print:`common.print`,reset:`common.reset`,columns:`table.columnSettings`,fullscreen:`common.fullscreen`,settings:`common.settings`,more:`common.more`},y=e=>{let t=f(e);if(e.label)return t;let{key:n}=e,r=n&&Object.prototype.hasOwnProperty.call(g,n)?g[n]:void 0;return{...t,label:r?h(r):n||h(`common.action`)}},b=r,x=l,S=(0,s.computed)(()=>({...u,...b.config,size:b.config.size??(m.value?e.t(m.value).size:u.size),gap:b.config.gap??(b.config.compact===!1?12:u.gap)})),C=(0,s.defineAsyncComponent)({loader:()=>Promise.resolve().then(()=>require(`./ActionOverflow.cjs`)),suspensible:!1}),w=(0,s.ref)(),{buttonGroups:T,narrow:E,overflowAt:D}=_(b,()=>S.value.overflowAt),O=[`left`,`center`,`right`],k=o.t(),A=(e,t)=>!!(p(e.disabled)||e.buttonProps?.disabled||k.isRunning(t)),j=(e,t)=>!!(p(e.loading)||e.buttonProps?.loading||e.autoLoading!==!1&&k.isRunning(t)),M=(e,t)=>!A(e,t)&&!j(e,t),N=e=>p(e.disabled)!==!0&&p(e.show)!==!1,P=async({action:e,taskKey:t})=>{if(!(e.dropdown&&e.dropdown.length>0))try{await k.run(t,async()=>{x(`action-click`,e),await e.onClick?.()},()=>M(e,t))}catch(t){throw x(`action-error`,t,e),t}},F=async(e,{action:t,taskKey:n})=>{try{await k.run(n,async()=>{x(`dropdown-click`,e,t),await e.onClick?.()},()=>M(t,n)&&N(e))}catch(n){throw x(`action-error`,n,t,e),n}},I=({action:e,taskKey:t})=>{let{label:n,icon:r}=y(e);return{label:n,icon:r,disabled:!M(e,t)}},L=(0,s.defineComponent)({name:`ActionButton`,props:{action:{type:Object,required:!0},taskKey:{type:String,required:!0}},emits:[`click`,`dropdown-select`],setup(e,{emit:t}){let n=(0,s.computed)(()=>e.action),r=()=>M(n.value,e.taskKey),i=(0,s.computed)(()=>y(n.value)),o=(0,s.computed)(()=>i.value.buttonProps?.size||i.value.size||S.value.size),l=(0,s.computed)(()=>({tiny:14,small:15,medium:16,large:18})[o.value]),u=(0,s.computed)(()=>i.value.dropdown?i.value.dropdown.filter(e=>e.show===void 0?!0:p(e.show)).map(e=>{let{icon:t}=e;return{key:e.key,label:e.label,icon:t?()=>a.t(t,14):void 0,disabled:!r()||p(e.disabled)}}):[]),d=e=>{let n=i.value.dropdown?.find(t=>t.key===e);n&&r()&&N(n)&&t(`dropdown-select`,n)},f=t=>{let{icon:u,buttonProps:d}=i.value,f=e=>{if(!r())return;t?.();let n=d?.onClick;Array.isArray(n)?n.forEach(t=>t(e)):n?.(e)},p=(0,s.h)(c.NButton,{type:i.value.type||`default`,size:o.value,...d,loading:j(n.value,e.taskKey),disabled:A(n.value,e.taskKey),onClick:f},{default:()=>i.value.label,icon:u&&!d?.renderIcon?()=>a.t(u,l.value):void 0}),{directives:m}=i.value;return m?.length?(0,s.withDirectives)(p,m):p},m=()=>{let e=f(()=>t(`click`));return i.value.tooltip?(0,s.h)(c.NTooltip,{placement:`top`},{trigger:()=>e,default:()=>i.value.tooltip}):e},h=()=>{let e=f();return(0,s.h)(c.NDropdown,{disabled:!r(),options:u.value,onSelect:d},{default:()=>e})};return()=>i.value.dropdown&&i.value.dropdown.length>0?h():m()}});return(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{ref_key:`bar`,ref:w,class:(0,s.normalizeClass)([`c-action-bar`,{"is-compact":S.value.compact,"is-inline":S.value.inline,"is-wrap":S.value.wrap,"has-overflow":(0,s.unref)(T).overflow.length>0,[`is-align-${S.value.align}`]:!0,"has-only-left":(0,s.unref)(T).left.length>0&&(0,s.unref)(T).right.length===0&&!(0,s.unref)(T).overflow.length&&!e.$slots.center,"has-only-right":(0,s.unref)(T).right.length>0&&(0,s.unref)(T).left.length===0&&!(0,s.unref)(T).overflow.length&&!e.$slots.center}]),style:(0,s.normalizeStyle)((0,s.unref)(d))},[((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(O,t=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:t},[t===`center`?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:0},[e.$slots.center?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,v,[(0,s.renderSlot)(e.$slots,`center`,{},void 0,!0)])):(0,s.createCommentVNode)(`v-if`,!0)],64)):(0,s.unref)(T)[t].length>0?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:1,class:(0,s.normalizeClass)([`actions-group`,`actions-${t}`]),style:(0,s.normalizeStyle)({gap:`${S.value.gap}px`})},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(T)[t],(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:e.renderKey},[(0,s.createVNode)((0,s.unref)(L),{action:e.action,"task-key":e.taskKey,onClick:t=>P(e),onDropdownSelect:t=>F(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),S.value.showDivider&&n<(0,s.unref)(T)[t].length-1?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(c.NDivider),{key:0,vertical:S.value.dividerType===`vertical`,class:(0,s.normalizeClass)([`action-divider`,{"action-divider--horizontal":S.value.dividerType===`horizontal`}])},null,8,[`vertical`,`class`])):(0,s.createCommentVNode)(`v-if`,!0)],64))),128))],6)):(0,s.createCommentVNode)(`v-if`,!0)],64))),64)),(0,s.unref)(D)?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(C),{key:0,anchor:w.value,threshold:(0,s.unref)(D),entries:(0,s.unref)(T).overflow,size:S.value.size,resolve:I,onNarrow:t[0]||=e=>E.value=e,onSelect:P},null,8,[`anchor`,`threshold`,`entries`,`size`])):(0,s.createCommentVNode)(`v-if`,!0)],6))}});var b=r.t(y,[[`__scopeId`,`data-v-421fb4df`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});
|
package/dist/C_ActionBar2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./density.js";import{t}from"./useComponentLocale.js";import{n}from"./useComponentTheme.js";import{t as r}from"./export-helper.js";import{t as i}from"./useComponentDensity.js";import{t as a}from"./actionIcon.js";import{t as o}from"./useActionTask.js";import{Fragment as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createVNode as f,
|
|
1
|
+
import{t as e}from"./density.js";import{t}from"./useComponentLocale.js";import{n}from"./useComponentTheme.js";import{t as r}from"./export-helper.js";import{t as i}from"./useComponentDensity.js";import{t as a}from"./actionIcon.js";import{t as o}from"./useActionTask.js";import{Fragment as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createVNode as f,defineAsyncComponent as p,defineComponent as m,h,normalizeClass as g,normalizeStyle as _,openBlock as v,ref as y,renderList as b,renderSlot as x,unref as S,withDirectives as C}from"vue";import{NButton as w,NDivider as T,NDropdown as E,NTooltip as D}from"naive-ui";const O=`mdi:gesture-tap-button`,k={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0,overflowAt:0},A={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},j=e=>{let t=A[e.key??``]??{};return{...t,...e,label:e.label||t.label||e.key||`操作`,icon:e.icon||t.icon||O,type:e.type??t.type}},M=e=>typeof e==`function`?e():S(e),N=e=>e;function P(e,t){let n=new Map,r=[];return e.forEach((e,i)=>{let a=e.key===void 0?`position:${t}:${i}`:`key:${e.key}`,o=n.get(a)??0;n.set(a,o+1),M(e.show)!==!1&&r.push({action:e,taskKey:a,renderKey:`${t}:${a}:${o}`})}),r}function F({action:e}){return e.overflow===!0&&!e.buttonProps&&!e.directives?.length&&!e.dropdown?.length&&!e.tooltip}function I(e,t){let n=y(!1),r=c(()=>{let e=t();return Number.isFinite(e)&&e>0?e:0});return{buttonGroups:c(()=>{let t=e.actions??[],i=P(e.leftActions?.length?e.leftActions:t.filter(e=>e.group!==`right`),`left`),a=P(e.rightActions?.length?e.rightActions:t.filter(e=>e.group===`right`),`right`),o=[];if(!r.value||!n.value)return{left:i,right:a,overflow:o};let s=e=>F(e)?(o.push(e),!1):!0;return{left:i.filter(s),right:a.filter(s),overflow:o}}),narrow:n,overflowAt:r}}const L={key:0,class:`actions-center`};var R=r(m({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`,`action-error`],setup(r,{emit:O}){let A=n(),N=i(),{t:P}=t(),F={add:`common.add`,create:`common.add`,save:`common.save`,confirm:`action.confirm`,cancel:`common.cancel`,close:`common.close`,view:`common.view`,edit:`common.edit`,delete:`common.delete`,remove:`common.delete`,refresh:`common.refresh`,import:`common.import`,export:`common.export`,print:`common.print`,reset:`common.reset`,columns:`table.columnSettings`,fullscreen:`common.fullscreen`,settings:`common.settings`,more:`common.more`},R=e=>{let t=j(e);if(e.label)return t;let{key:n}=e,r=n&&Object.prototype.hasOwnProperty.call(F,n)?F[n]:void 0;return{...t,label:r?P(r):n||P(`common.action`)}},z=r,B=O,V=c(()=>({...k,...z.config,size:z.config.size??(N.value?e(N.value).size:k.size),gap:z.config.gap??(z.config.compact===!1?12:k.gap)})),H=p({loader:()=>import(`./ActionOverflow.js`),suspensible:!1}),U=y(),{buttonGroups:W,narrow:G,overflowAt:K}=I(z,()=>V.value.overflowAt),q=[`left`,`center`,`right`],J=o(),Y=(e,t)=>!!(M(e.disabled)||e.buttonProps?.disabled||J.isRunning(t)),X=(e,t)=>!!(M(e.loading)||e.buttonProps?.loading||e.autoLoading!==!1&&J.isRunning(t)),Z=(e,t)=>!Y(e,t)&&!X(e,t),Q=e=>M(e.disabled)!==!0&&M(e.show)!==!1,$=async({action:e,taskKey:t})=>{if(!(e.dropdown&&e.dropdown.length>0))try{await J.run(t,async()=>{B(`action-click`,e),await e.onClick?.()},()=>Z(e,t))}catch(t){throw B(`action-error`,t,e),t}},ee=async(e,{action:t,taskKey:n})=>{try{await J.run(n,async()=>{B(`dropdown-click`,e,t),await e.onClick?.()},()=>Z(t,n)&&Q(e))}catch(n){throw B(`action-error`,n,t,e),n}},te=({action:e,taskKey:t})=>{let{label:n,icon:r}=R(e);return{label:n,icon:r,disabled:!Z(e,t)}},ne=m({name:`ActionButton`,props:{action:{type:Object,required:!0},taskKey:{type:String,required:!0}},emits:[`click`,`dropdown-select`],setup(e,{emit:t}){let n=c(()=>e.action),r=()=>Z(n.value,e.taskKey),i=c(()=>R(n.value)),o=c(()=>i.value.buttonProps?.size||i.value.size||V.value.size),s=c(()=>({tiny:14,small:15,medium:16,large:18})[o.value]),l=c(()=>i.value.dropdown?i.value.dropdown.filter(e=>e.show===void 0?!0:M(e.show)).map(e=>{let{icon:t}=e;return{key:e.key,label:e.label,icon:t?()=>a(t,14):void 0,disabled:!r()||M(e.disabled)}}):[]),u=e=>{let n=i.value.dropdown?.find(t=>t.key===e);n&&r()&&Q(n)&&t(`dropdown-select`,n)},d=t=>{let{icon:c,buttonProps:l}=i.value,u=e=>{if(!r())return;t?.();let n=l?.onClick;Array.isArray(n)?n.forEach(t=>t(e)):n?.(e)},d=h(w,{type:i.value.type||`default`,size:o.value,...l,loading:X(n.value,e.taskKey),disabled:Y(n.value,e.taskKey),onClick:u},{default:()=>i.value.label,icon:c&&!l?.renderIcon?()=>a(c,s.value):void 0}),{directives:f}=i.value;return f?.length?C(d,f):d},f=()=>{let e=d(()=>t(`click`));return i.value.tooltip?h(D,{placement:`top`},{trigger:()=>e,default:()=>i.value.tooltip}):e},p=()=>{let e=d();return h(E,{disabled:!r(),options:l.value,onSelect:u},{default:()=>e})};return()=>i.value.dropdown&&i.value.dropdown.length>0?p():f()}});return(e,t)=>(v(),d(`div`,{ref_key:`bar`,ref:U,class:g([`c-action-bar`,{"is-compact":V.value.compact,"is-inline":V.value.inline,"is-wrap":V.value.wrap,"has-overflow":S(W).overflow.length>0,[`is-align-${V.value.align}`]:!0,"has-only-left":S(W).left.length>0&&S(W).right.length===0&&!S(W).overflow.length&&!e.$slots.center,"has-only-right":S(W).right.length>0&&S(W).left.length===0&&!S(W).overflow.length&&!e.$slots.center}]),style:_(S(A))},[(v(),d(s,null,b(q,t=>(v(),d(s,{key:t},[t===`center`?(v(),d(s,{key:0},[e.$slots.center?(v(),d(`div`,L,[x(e.$slots,`center`,{},void 0,!0)])):u(`v-if`,!0)],64)):S(W)[t].length>0?(v(),d(`div`,{key:1,class:g([`actions-group`,`actions-${t}`]),style:_({gap:`${V.value.gap}px`})},[(v(!0),d(s,null,b(S(W)[t],(e,n)=>(v(),d(s,{key:e.renderKey},[f(S(ne),{action:e.action,"task-key":e.taskKey,onClick:t=>$(e),onDropdownSelect:t=>ee(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),V.value.showDivider&&n<S(W)[t].length-1?(v(),l(S(T),{key:0,vertical:V.value.dividerType===`vertical`,class:g([`action-divider`,{"action-divider--horizontal":V.value.dividerType===`horizontal`}])},null,8,[`vertical`,`class`])):u(`v-if`,!0)],64))),128))],6)):u(`v-if`,!0)],64))),64)),S(K)?(v(),l(S(H),{key:0,anchor:U.value,threshold:S(K),entries:S(W).overflow,size:V.value.size,resolve:te,onNarrow:t[0]||=e=>G.value=e,onSelect:$},null,8,[`anchor`,`threshold`,`entries`,`size`])):u(`v-if`,!0)],6))}}),[[`__scopeId`,`data-v-421fb4df`]]);export{N as a,O as i,k as n,j as o,A as r,R as t};
|
package/dist/C_AntV.css
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
@import "./shared-tokens.css";
|
|
2
2
|
|
|
3
|
-
.c-antv-container[data-v-
|
|
3
|
+
.c-antv-container[data-v-dc4720fb] {
|
|
4
4
|
width: 100%;
|
|
5
5
|
height: 100%;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/* layer: shortcuts */
|
|
10
|
-
.container[data-v-
|
|
10
|
+
.container[data-v-dc4720fb]{width:100%;}
|
|
11
11
|
@media (min-width: 640px){
|
|
12
|
-
.container[data-v-
|
|
12
|
+
.container[data-v-dc4720fb]{max-width:640px;}
|
|
13
13
|
}
|
|
14
14
|
@media (min-width: 768px){
|
|
15
|
-
.container[data-v-
|
|
15
|
+
.container[data-v-dc4720fb]{max-width:768px;}
|
|
16
16
|
}
|
|
17
17
|
@media (min-width: 1024px){
|
|
18
|
-
.container[data-v-
|
|
18
|
+
.container[data-v-dc4720fb]{max-width:1024px;}
|
|
19
19
|
}
|
|
20
20
|
@media (min-width: 1280px){
|
|
21
|
-
.container[data-v-
|
|
21
|
+
.container[data-v-dc4720fb]{max-width:1280px;}
|
|
22
22
|
}
|
|
23
23
|
@media (min-width: 1536px){
|
|
24
|
-
.container[data-v-
|
|
24
|
+
.container[data-v-dc4720fb]{max-width:1536px;}
|
|
25
25
|
}
|
|
26
26
|
/* layer: default */
|
|
27
|
-
.visible[data-v-
|
|
28
|
-
.grid[data-v-
|
|
29
|
-
.select-all[data-v-
|
|
27
|
+
.visible[data-v-dc4720fb]{visibility:visible;}
|
|
28
|
+
.grid[data-v-dc4720fb]{display:grid;}
|
|
29
|
+
.select-all[data-v-dc4720fb]{-webkit-user-select:all;user-select:all;}
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
/* layer: default */
|
package/dist/C_AntV2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`);const r=e=>e===`task`?`activity`:e===`gateway`?`gateway`:`event`,i=e=>{let t=e.data?.type;return t===`start`||t===`end`||t===`task`||t===`gateway`||t===`event`?t:e.shape===`activity`?`task`:e.shape===`gateway`?`gateway`:`event`},a=e=>[...e.nodes.map(e=>{let t=r(e.type);return{id:e.id,shape:t,x:e.position.x,y:e.position.y,width:t===`activity`?120:t===`gateway`?40:50,height:t===`activity`?60:t===`gateway`?40:50,label:e.name,data:{...e.properties,type:e.type}}}),...e.flows.map(e=>({id:e.id,shape:`bpmn-edge`,source:e.source,target:e.target,label:e.name,x:0,y:0,data:e.condition?{condition:e.condition}:void 0}))],o=e=>({nodes:e.filter(e=>e.shape!==`bpmn-edge`).map(e=>{let t={...e.data};return delete t.type,{id:e.id,type:i(e),name:e.label??``,position:{x:e.x,y:e.y},properties:t}}),flows:e.filter(e=>e.shape===`bpmn-edge`).map(e=>({id:e.id,source:e.source??``,target:e.target??``,name:e.label,condition:typeof e.data?.condition==`string`?e.data.condition:void 0}))}),s=(0,n.defineComponent)({name:`C_AntV`,__name:`index`,props:{type:{},data:{},width:{default:`100%`},height:{default:`600px`},readonly:{type:Boolean,default:!1},showToolbar:{type:Boolean,default:!0},theme:{}},emits:[`ready`,`data-change`],setup(t,{expose:r,emit:i}){let s=t,c=i,l=e.n(()=>s.theme),u=e.t(()=>s.theme),d=(0,n.ref)(),f={er:(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./ER.cjs`)).then(e=>e.default)),bpmn:(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./BPMN.cjs`)).then(e=>e.default)),uml:(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./UML.cjs`)).then(e=>e.default))},p=(0,n.computed)(()=>f[s.type]),m=(0,n.computed)(()=>{let e={width:s.width,height:s.height,readonly:s.readonly,showToolbar:s.showToolbar,theme:u.value},t=s.type===`bpmn`&&s.data&&`nodes`in s.data?a(s.data):s.data;return{...e,data:t}}),h=e=>{c(`ready`,e)},g=e=>{
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`);const r=e=>e===`task`?`activity`:e===`gateway`?`gateway`:`event`,i=e=>{let t=e.data?.type;return t===`start`||t===`end`||t===`task`||t===`gateway`||t===`event`?t:e.shape===`activity`?`task`:e.shape===`gateway`?`gateway`:`event`},a=e=>[...e.nodes.map(e=>{let t=r(e.type);return{id:e.id,shape:t,x:e.position.x,y:e.position.y,width:t===`activity`?120:t===`gateway`?40:50,height:t===`activity`?60:t===`gateway`?40:50,label:e.name,data:{...e.properties,type:e.type}}}),...e.flows.map(e=>({id:e.id,shape:`bpmn-edge`,source:e.source,target:e.target,label:e.name,x:0,y:0,data:e.condition?{condition:e.condition}:void 0}))],o=e=>({nodes:e.filter(e=>e.shape!==`bpmn-edge`).map(e=>{let t={...e.data};return delete t.type,{id:e.id,type:i(e),name:e.label??``,position:{x:e.x,y:e.y},properties:t}}),flows:e.filter(e=>e.shape===`bpmn-edge`).map(e=>({id:e.id,source:e.source??``,target:e.target??``,name:e.label,condition:typeof e.data?.condition==`string`?e.data.condition:void 0}))}),s=(0,n.defineComponent)({name:`C_AntV`,__name:`index`,props:{type:{},data:{},width:{default:`100%`},height:{default:`600px`},readonly:{type:Boolean,default:!1},showToolbar:{type:Boolean,default:!0},theme:{}},emits:[`ready`,`data-change`],setup(t,{expose:r,emit:i}){let s=t,c=i,l=e.n(()=>s.theme),u=e.t(()=>s.theme),d=(0,n.ref)(),f={er:(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./ER.cjs`)).then(e=>e.default)),bpmn:(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./BPMN.cjs`)).then(e=>e.default)),uml:(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./UML.cjs`)).then(e=>e.default))},p=(0,n.computed)(()=>f[s.type]),m=(0,n.computed)(()=>{let e={width:s.width,height:s.height,readonly:s.readonly,showToolbar:s.showToolbar,theme:u.value},t=s.type===`bpmn`&&s.data&&`nodes`in s.data?a(s.data):s.data;return{...e,data:t}}),h=e=>{c(`ready`,e)},g=e=>{Array.isArray(e)?s.type===`bpmn`&&c(`data-change`,o(e)):c(`data-change`,e)};return r({getGraph:()=>d.value?.getGraph()??void 0,getData:()=>{let e=d.value?.getData();return s.type===`bpmn`&&Array.isArray(e)?o(e):Array.isArray(e)?void 0:e}}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:`c-antv-container`,style:(0,n.normalizeStyle)((0,n.unref)(l))},[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(p.value),(0,n.mergeProps)({style:(0,n.unref)(l)},m.value,{onReady:h,onDataChange:g,ref_key:`layoutRef`,ref:d}),null,16,[`style`]))],4))}});var c=t.t(s,[[`__scopeId`,`data-v-dc4720fb`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|