@oneflowui/ui 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +215 -0
- package/README.md +142 -85
- package/dist/{FieldCheckbox-B1eVag_x.js → FieldCheckbox-DPylU5RA.js} +1 -1
- package/dist/{FieldDate-BCitHPQn.js → FieldDate-BWtlvi5Y.js} +1 -1
- package/dist/{FieldDatetime-BGeyZJl-.js → FieldDatetime-BXghiCm8.js} +1 -1
- package/dist/{FieldEmail-Ds8lTvNh.js → FieldEmail-D-hUADX4.js} +1 -1
- package/dist/{FieldMultiSelect-_cY4aZuE.js → FieldMultiSelect-Di0wE1Ns.js} +2 -2
- package/dist/{FieldNumber-DayaF31C.js → FieldNumber-BbcbizO4.js} +1 -1
- package/dist/{FieldRating-Dw9rvhUe.js → FieldRating-KKEc2khS.js} +6 -6
- package/dist/{FieldSelect-DEVkjnNY.js → FieldSelect-D2qtt-0u.js} +2 -2
- package/dist/{FieldText-LzCqM7jk.js → FieldText-DYbDp4aP.js} +1 -1
- package/dist/{FieldUrl-zqYEJCPK.js → FieldUrl-BoOM8A5O.js} +1 -1
- package/dist/components/base/Accordion.vue.d.ts +51 -0
- package/dist/components/base/Avatar.vue.d.ts +11 -0
- package/dist/components/base/Badge.vue.d.ts +28 -0
- package/dist/components/base/ChainItem.vue.d.ts +14 -0
- package/dist/components/base/DescBlock.vue.d.ts +17 -0
- package/dist/components/base/InfoCard.vue.d.ts +49 -0
- package/dist/components/base/MonitorItem.vue.d.ts +19 -0
- package/dist/components/base/PersonaCard.vue.d.ts +44 -0
- package/dist/components/base/ProgressBar.vue.d.ts +33 -0
- package/dist/components/base/RefTag.vue.d.ts +29 -0
- package/dist/components/base/SectionBlock.vue.d.ts +45 -0
- package/dist/components/base/SelectBadge.vue.d.ts +36 -0
- package/dist/components/base/StatusIndicator.vue.d.ts +29 -0
- package/dist/components/base/StatusSummary.vue.d.ts +35 -0
- package/dist/components/base/Stepper.vue.d.ts +39 -0
- package/dist/components/base/Switch.vue.d.ts +18 -0
- package/dist/components/base/ViewModeGroup.vue.d.ts +17 -0
- package/dist/components/base/ViewSwitcher.vue.d.ts +57 -0
- package/dist/components/base/index.d.ts +35 -0
- package/dist/components/kanban/KanbanColumn.vue.d.ts +3 -1
- package/dist/components/layout/Navbar.vue.d.ts +1 -1
- package/dist/components/overlay/Dialog.vue.d.ts +1 -1
- package/dist/components/overlay/Drawer.vue.d.ts +27 -0
- package/dist/components/overlay/SidePanel.vue.d.ts +37 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/table/DataTable.vue.d.ts +7 -1
- package/dist/components/table/TableGroupRow.vue.d.ts +17 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/timeline/ActivityTimeline.vue.d.ts +40 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/composables/index.d.ts +3 -1
- package/dist/composables/useStream.d.ts +13 -0
- package/dist/composables/useTable.d.ts +1 -1
- package/dist/composables/useTypewriter.d.ts +1 -0
- package/dist/composables/useVirtualList.d.ts +18 -0
- package/dist/index-CTlM81Ib.js +12486 -0
- package/dist/index.d.ts +13 -8
- package/dist/oneflow-ui.js +108 -82
- package/dist/oneflow-ui.umd.cjs +7 -7
- package/dist/style.css +1 -1
- package/dist/tests/drawer.integration.spec.d.ts +1 -0
- package/dist/tests/fielddef.integration.spec.d.ts +1 -0
- package/dist/tests/shallowRef.integration.spec.d.ts +1 -0
- package/dist/tests/useStream.integration.spec.d.ts +1 -0
- package/dist/tests/useTypewriter.integration.spec.d.ts +1 -0
- package/dist/tests/useVirtualList.integration.spec.d.ts +1 -0
- package/dist/types/index.d.ts +43 -4
- package/package.json +1 -1
- package/dist/index-B9LF7Kv4.js +0 -10661
package/README.en.md
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# OneFlow UI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@oneflowui/ui)
|
|
4
|
+
[](https://www.npmjs.com/package/@oneflowui/ui)
|
|
5
|
+
[](https://github.com/qixi54/oneui/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
A **Vue 3 + TypeScript** component library for building task management and productivity applications. Ships **75+ ready-to-use components** covering views, AI chat, dashboards, editors, and more.
|
|
8
|
+
|
|
9
|
+
> [中文文档](./README.md)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Components at a Glance
|
|
14
|
+
|
|
15
|
+
| Category | Components |
|
|
16
|
+
|----------|-----------|
|
|
17
|
+
| **Views** | DataTable, KanbanBoard, GalleryView, GanttTimeline |
|
|
18
|
+
| **AI Chat** | AiMessageList, AiMessageBubble, AiSender, AiThinking, AiStreamingCursor |
|
|
19
|
+
| **Dashboard** | Dashboard, BarChart, PieChart, DoughnutChart, NumberCard |
|
|
20
|
+
| **Editors** | RichTextEditor, CodeBlock, ContentBlock |
|
|
21
|
+
| **Detail** | DetailLayout, PropPanel, CommentItem |
|
|
22
|
+
| **Forms** | FormDesigner, 10 field components |
|
|
23
|
+
| **Layout** | AppLayout, Sidebar, Navbar, SplitPane |
|
|
24
|
+
| **General** | Modal, Dialog, Toast, Tabs, Breadcrumb, MermaidChart, ContextMenu |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Preview
|
|
29
|
+
|
|
30
|
+
<table>
|
|
31
|
+
<tr>
|
|
32
|
+
<td align="center"><b>Kanban Board</b></td>
|
|
33
|
+
<td align="center"><b>Data Table</b></td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td><img src="screenshots/kanban.png" alt="Kanban" /></td>
|
|
37
|
+
<td><img src="screenshots/table.png" alt="DataTable" /></td>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr>
|
|
40
|
+
<td align="center"><b>Gantt Timeline</b></td>
|
|
41
|
+
<td align="center"><b>Dashboard</b></td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td><img src="screenshots/gantt.png" alt="Gantt" /></td>
|
|
45
|
+
<td><img src="screenshots/dashboard.png" alt="Dashboard" /></td>
|
|
46
|
+
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td align="center"><b>AI Chat</b></td>
|
|
49
|
+
<td align="center"><b>Detail Layout</b></td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td><img src="screenshots/ai.png" alt="AI Chat" /></td>
|
|
53
|
+
<td><img src="screenshots/detail.png" alt="Detail" /></td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td align="center"><b>Rich Text Editor</b></td>
|
|
57
|
+
<td align="center"><b>Mermaid Chart</b></td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr>
|
|
60
|
+
<td><img src="screenshots/editor.png" alt="Editor" /></td>
|
|
61
|
+
<td><img src="screenshots/mermaid.png" alt="Mermaid" /></td>
|
|
62
|
+
</tr>
|
|
63
|
+
</table>
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# pnpm (recommended)
|
|
71
|
+
pnpm add @oneflowui/ui
|
|
72
|
+
|
|
73
|
+
# npm
|
|
74
|
+
npm install @oneflowui/ui
|
|
75
|
+
|
|
76
|
+
# yarn
|
|
77
|
+
yarn add @oneflowui/ui
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Install peer dependencies as needed:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pnpm add vue
|
|
84
|
+
pnpm add mermaid # required only when using MermaidChart
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Quick Start
|
|
90
|
+
|
|
91
|
+
### Register globally
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
import { createApp } from 'vue'
|
|
95
|
+
import App from './App.vue'
|
|
96
|
+
import OneflowUI from '@oneflowui/ui'
|
|
97
|
+
import '@oneflowui/ui/styles'
|
|
98
|
+
|
|
99
|
+
const app = createApp(App)
|
|
100
|
+
app.use(OneflowUI)
|
|
101
|
+
app.mount('#app')
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Import on demand
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { KanbanBoard, DataTable, AiMessageList, MermaidChart } from '@oneflowui/ui'
|
|
108
|
+
import '@oneflowui/ui/styles'
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Usage Examples
|
|
114
|
+
|
|
115
|
+
### KanbanBoard
|
|
116
|
+
|
|
117
|
+
```vue
|
|
118
|
+
<KanbanBoard
|
|
119
|
+
:records="records"
|
|
120
|
+
kanban-field-id="stage"
|
|
121
|
+
:lane-order="['todo', 'doing', 'done']"
|
|
122
|
+
:lane-titles="{ todo: 'Todo', doing: 'In Progress', done: 'Done' }"
|
|
123
|
+
/>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### AI Chat Panel
|
|
127
|
+
|
|
128
|
+
```vue
|
|
129
|
+
<script setup>
|
|
130
|
+
import { AiMessageList, AiSender, useAiChat } from '@oneflowui/ui'
|
|
131
|
+
|
|
132
|
+
const { messages, isThinking, send } = useAiChat({
|
|
133
|
+
onRequest: async (content) => {
|
|
134
|
+
// Connect your AI service here
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
</script>
|
|
138
|
+
|
|
139
|
+
<template>
|
|
140
|
+
<AiMessageList :messages="messages" :is-thinking="isThinking" />
|
|
141
|
+
<AiSender @send="send" />
|
|
142
|
+
</template>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### GanttTimeline
|
|
146
|
+
|
|
147
|
+
```vue
|
|
148
|
+
<GanttTimeline
|
|
149
|
+
:items="ganttItems"
|
|
150
|
+
start-date="2026-01-01"
|
|
151
|
+
end-date="2026-12-31"
|
|
152
|
+
@item-click="onItemClick"
|
|
153
|
+
/>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### MermaidChart
|
|
157
|
+
|
|
158
|
+
```vue
|
|
159
|
+
<MermaidChart :code="`graph TD\n A --> B\n B --> C`" />
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### DataTable
|
|
163
|
+
|
|
164
|
+
```vue
|
|
165
|
+
<DataTable
|
|
166
|
+
:columns="[
|
|
167
|
+
{ key: 'title', label: 'Title', width: 'fill' },
|
|
168
|
+
{ key: 'status', label: 'Status', width: 120 },
|
|
169
|
+
{ key: 'priority', label: 'Priority', width: 100 },
|
|
170
|
+
]"
|
|
171
|
+
:rows="tasks"
|
|
172
|
+
@row-click="onRowClick"
|
|
173
|
+
/>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Toast Notifications
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
import { useToast } from '@oneflowui/ui'
|
|
180
|
+
|
|
181
|
+
const toast = useToast()
|
|
182
|
+
toast.success('Saved successfully')
|
|
183
|
+
toast.error('Operation failed')
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Local Development
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Clone the repository
|
|
192
|
+
git clone https://github.com/qixi54/oneui.git
|
|
193
|
+
cd oneui
|
|
194
|
+
|
|
195
|
+
# Install dependencies
|
|
196
|
+
pnpm install
|
|
197
|
+
|
|
198
|
+
# Start dev server (port 5174)
|
|
199
|
+
pnpm dev
|
|
200
|
+
|
|
201
|
+
# Type check
|
|
202
|
+
pnpm type-check
|
|
203
|
+
|
|
204
|
+
# Run tests
|
|
205
|
+
pnpm test
|
|
206
|
+
|
|
207
|
+
# Build
|
|
208
|
+
pnpm build
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## License
|
|
214
|
+
|
|
215
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,77 +1,122 @@
|
|
|
1
1
|
# OneFlow UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> [English README](./README.en.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@oneflowui/ui)
|
|
6
|
+
[](https://www.npmjs.com/package/@oneflowui/ui)
|
|
7
|
+
[](https://github.com/qixi54/oneui/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
Vue 3 + TypeScript 任务管理视图组件库,75 个组件开箱即用。
|
|
10
|
+
|
|
11
|
+
**包含**:Table、Kanban、Gantt 甘特图、Gallery、AI Chat、Dashboard 图表、Rich Text Editor、Form Designer、MermaidChart、Toast 等。
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 预览
|
|
16
|
+
|
|
17
|
+
<table>
|
|
18
|
+
<tr>
|
|
19
|
+
<td align="center"><b>Kanban 看板</b></td>
|
|
20
|
+
<td align="center"><b>DataTable 数据表格</b></td>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr>
|
|
23
|
+
<td><img src="screenshots/kanban.png" alt="Kanban" /></td>
|
|
24
|
+
<td><img src="screenshots/table.png" alt="DataTable" /></td>
|
|
25
|
+
</tr>
|
|
26
|
+
<tr>
|
|
27
|
+
<td align="center"><b>Gantt 甘特图</b></td>
|
|
28
|
+
<td align="center"><b>Dashboard 仪表盘</b></td>
|
|
29
|
+
</tr>
|
|
30
|
+
<tr>
|
|
31
|
+
<td><img src="screenshots/gantt.png" alt="Gantt" /></td>
|
|
32
|
+
<td><img src="screenshots/dashboard.png" alt="Dashboard" /></td>
|
|
33
|
+
</tr>
|
|
34
|
+
<tr>
|
|
35
|
+
<td align="center"><b>AI Chat 对话组件</b></td>
|
|
36
|
+
<td align="center"><b>DetailLayout 详情页</b></td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td><img src="screenshots/ai.png" alt="AI Chat" /></td>
|
|
40
|
+
<td><img src="screenshots/detail.png" alt="Detail" /></td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td align="center"><b>RichTextEditor 富文本</b></td>
|
|
44
|
+
<td align="center"><b>MermaidChart 图表</b></td>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<td><img src="screenshots/editor.png" alt="Editor" /></td>
|
|
48
|
+
<td><img src="screenshots/mermaid.png" alt="Mermaid" /></td>
|
|
49
|
+
</tr>
|
|
50
|
+
</table>
|
|
51
|
+
|
|
52
|
+
---
|
|
4
53
|
|
|
5
54
|
## 安装
|
|
6
55
|
|
|
7
56
|
```bash
|
|
8
57
|
# pnpm(推荐)
|
|
9
|
-
pnpm add
|
|
58
|
+
pnpm add @oneflowui/ui
|
|
10
59
|
|
|
11
60
|
# npm
|
|
12
|
-
npm install
|
|
61
|
+
npm install @oneflowui/ui
|
|
13
62
|
|
|
14
63
|
# yarn
|
|
15
|
-
yarn add
|
|
64
|
+
yarn add @oneflowui/ui
|
|
16
65
|
```
|
|
17
66
|
|
|
18
|
-
|
|
67
|
+
安装 peer dependencies(按需):
|
|
19
68
|
|
|
20
69
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
70
|
+
pnpm add vue
|
|
71
|
+
pnpm add mermaid # 使用 MermaidChart 时需要
|
|
72
|
+
```
|
|
23
73
|
|
|
24
|
-
|
|
25
|
-
npm run type-check
|
|
74
|
+
---
|
|
26
75
|
|
|
27
|
-
|
|
28
|
-
npm run test
|
|
29
|
-
```
|
|
76
|
+
## 快速开始
|
|
30
77
|
|
|
31
|
-
|
|
78
|
+
### 全局注册
|
|
32
79
|
|
|
33
80
|
```ts
|
|
34
81
|
import { createApp } from 'vue'
|
|
35
82
|
import App from './App.vue'
|
|
36
|
-
import OneflowUI from '
|
|
37
|
-
import '
|
|
83
|
+
import OneflowUI from '@oneflowui/ui'
|
|
84
|
+
import '@oneflowui/ui/styles'
|
|
38
85
|
|
|
39
86
|
const app = createApp(App)
|
|
40
87
|
app.use(OneflowUI)
|
|
41
88
|
app.mount('#app')
|
|
42
89
|
```
|
|
43
90
|
|
|
44
|
-
|
|
91
|
+
### 按需引入
|
|
45
92
|
|
|
46
93
|
```ts
|
|
47
|
-
import {
|
|
48
|
-
import '
|
|
94
|
+
import { KanbanBoard, DataTable, AiMessageList, MermaidChart } from '@oneflowui/ui'
|
|
95
|
+
import '@oneflowui/ui/styles'
|
|
49
96
|
```
|
|
50
97
|
|
|
51
|
-
|
|
98
|
+
---
|
|
52
99
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
100
|
+
## 组件一览
|
|
101
|
+
|
|
102
|
+
| 分类 | 组件 |
|
|
103
|
+
|------|------|
|
|
104
|
+
| **视图** | DataTable, KanbanBoard, GalleryView, GanttTimeline |
|
|
105
|
+
| **AI 对话** | AiMessageList, AiMessageBubble, AiSender, AiThinking, AiStreamingCursor |
|
|
106
|
+
| **仪表盘** | Dashboard, BarChart, PieChart, DoughnutChart, NumberCard |
|
|
107
|
+
| **编辑器** | RichTextEditor, CodeBlock, ContentBlock |
|
|
108
|
+
| **详情** | DetailLayout, PropPanel, CommentItem |
|
|
109
|
+
| **表单** | FormDesigner, 10 种 Field 组件 |
|
|
110
|
+
| **布局** | AppLayout, Sidebar, Navbar, SplitPane |
|
|
111
|
+
| **通用** | Modal, Dialog, Toast, Tabs, Breadcrumb, MermaidChart, ContextMenu |
|
|
57
112
|
|
|
58
113
|
---
|
|
59
114
|
|
|
60
|
-
##
|
|
115
|
+
## 使用示例
|
|
61
116
|
|
|
62
117
|
### KanbanBoard
|
|
63
118
|
|
|
64
119
|
```vue
|
|
65
|
-
<KanbanBoard
|
|
66
|
-
:columns="[
|
|
67
|
-
{ id: 'todo', title: '待处理', color: '#64748B', tasks: [] },
|
|
68
|
-
{ id: 'in_progress', title: '进行中', color: '#2563EB', tasks: [] },
|
|
69
|
-
]"
|
|
70
|
-
@task-click="onTaskClick"
|
|
71
|
-
@add-task="onAddTask"
|
|
72
|
-
/>
|
|
73
|
-
|
|
74
|
-
<!-- 或者使用 DataRecord 配置泳道字段 -->
|
|
75
120
|
<KanbanBoard
|
|
76
121
|
:records="records"
|
|
77
122
|
kanban-field-id="stage"
|
|
@@ -80,6 +125,43 @@ import 'oneflow-ui/styles'
|
|
|
80
125
|
/>
|
|
81
126
|
```
|
|
82
127
|
|
|
128
|
+
### AI 聊天面板
|
|
129
|
+
|
|
130
|
+
```vue
|
|
131
|
+
<script setup>
|
|
132
|
+
import { AiMessageList, AiSender } from '@oneflowui/ui'
|
|
133
|
+
import { useAiChat } from '@oneflowui/ui'
|
|
134
|
+
|
|
135
|
+
const { messages, isThinking, send } = useAiChat({
|
|
136
|
+
onRequest: async (content) => {
|
|
137
|
+
// 接入你的 AI 服务
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<template>
|
|
143
|
+
<AiMessageList :messages="messages" :is-thinking="isThinking" />
|
|
144
|
+
<AiSender @send="send" />
|
|
145
|
+
</template>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### GanttTimeline
|
|
149
|
+
|
|
150
|
+
```vue
|
|
151
|
+
<GanttTimeline
|
|
152
|
+
:items="ganttItems"
|
|
153
|
+
start-date="2026-01-01"
|
|
154
|
+
end-date="2026-12-31"
|
|
155
|
+
@item-click="onItemClick"
|
|
156
|
+
/>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### MermaidChart
|
|
160
|
+
|
|
161
|
+
```vue
|
|
162
|
+
<MermaidChart :code="`graph TD\n A --> B\n B --> C`" />
|
|
163
|
+
```
|
|
164
|
+
|
|
83
165
|
### DataTable
|
|
84
166
|
|
|
85
167
|
```vue
|
|
@@ -94,68 +176,43 @@ import 'oneflow-ui/styles'
|
|
|
94
176
|
/>
|
|
95
177
|
```
|
|
96
178
|
|
|
97
|
-
###
|
|
179
|
+
### Toast 通知
|
|
98
180
|
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
:items="galleryItems"
|
|
102
|
-
@card-click="onCardClick"
|
|
103
|
-
/>
|
|
181
|
+
```ts
|
|
182
|
+
import { useToast } from '@oneflowui/ui'
|
|
104
183
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
cover-field-id="coverUrl"
|
|
109
|
-
:card-field-ids="['assignee', 'priority']"
|
|
110
|
-
/>
|
|
184
|
+
const toast = useToast()
|
|
185
|
+
toast.success('保存成功')
|
|
186
|
+
toast.error('操作失败')
|
|
111
187
|
```
|
|
112
188
|
|
|
113
|
-
|
|
189
|
+
---
|
|
114
190
|
|
|
115
|
-
|
|
116
|
-
<GanttTimeline
|
|
117
|
-
:items="ganttItems"
|
|
118
|
-
:start-date="'2026-01-01'"
|
|
119
|
-
:end-date="'2026-12-31'"
|
|
120
|
-
@item-click="onItemClick"
|
|
121
|
-
/>
|
|
122
|
-
```
|
|
191
|
+
## 本地开发
|
|
123
192
|
|
|
124
|
-
|
|
193
|
+
```bash
|
|
194
|
+
# 克隆仓库
|
|
195
|
+
git clone https://github.com/qixi54/oneui.git
|
|
196
|
+
cd oneui
|
|
125
197
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
:task="currentTask"
|
|
129
|
-
v-model:description-content="detailDescription"
|
|
130
|
-
:description-editable="true"
|
|
131
|
-
:comments="comments"
|
|
132
|
-
:prop-items="[
|
|
133
|
-
{ key: '状态', value: '进行中' },
|
|
134
|
-
{ key: '优先级', value: 'P1' },
|
|
135
|
-
{ key: '负责人', value: '张三' },
|
|
136
|
-
{ key: '截止日期', value: '2026-06-30' },
|
|
137
|
-
]"
|
|
138
|
-
/>
|
|
139
|
-
```
|
|
198
|
+
# 安装依赖
|
|
199
|
+
pnpm install
|
|
140
200
|
|
|
141
|
-
|
|
201
|
+
# 启动开发环境(端口 5174)
|
|
202
|
+
pnpm dev
|
|
142
203
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
204
|
+
# 类型检查
|
|
205
|
+
pnpm type-check
|
|
206
|
+
|
|
207
|
+
# 运行测试
|
|
208
|
+
pnpm test
|
|
209
|
+
|
|
210
|
+
# 构建
|
|
211
|
+
pnpm build
|
|
148
212
|
```
|
|
149
213
|
|
|
150
214
|
---
|
|
151
215
|
|
|
152
|
-
##
|
|
153
|
-
|
|
154
|
-
- 三层数据模型:`TableSchema + DataRecord + ViewConfig` 联动可用
|
|
155
|
-
- Table + Detail:表格点击事件与详情渲染链路可用
|
|
156
|
-
- Dashboard 甘特图:空态/有数据态渲染与点击事件可用
|
|
216
|
+
## License
|
|
157
217
|
|
|
158
|
-
|
|
159
|
-
- `src/tests/three-layer-model.integration.spec.ts`
|
|
160
|
-
- `src/tests/table-detail.integration.spec.ts`
|
|
161
|
-
- `src/tests/gantt.integration.spec.ts`
|
|
218
|
+
MIT
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as s, computed as f, openBlock as p, createElementBlock as r, withModifiers as d, createElementVNode as m, toDisplayString as _ } from "vue";
|
|
2
|
-
import { _ as u } from "./index-
|
|
2
|
+
import { _ as u } from "./index-CTlM81Ib.js";
|
|
3
3
|
const k = { class: "of-field-checkbox__icon" }, x = /* @__PURE__ */ s({
|
|
4
4
|
__name: "FieldCheckbox",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as f, ref as u, onMounted as m, nextTick as s, withDirectives as d, openBlock as v, createElementBlock as y, vModelText as _ } from "vue";
|
|
2
|
-
import { _ as k } from "./index-
|
|
2
|
+
import { _ as k } from "./index-CTlM81Ib.js";
|
|
3
3
|
const x = /* @__PURE__ */ f({
|
|
4
4
|
__name: "FieldDate",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as f, ref as i, onMounted as p, nextTick as s, withDirectives as d, openBlock as v, createElementBlock as y, vModelText as _ } from "vue";
|
|
2
|
-
import { _ as k } from "./index-
|
|
2
|
+
import { _ as k } from "./index-CTlM81Ib.js";
|
|
3
3
|
const x = /* @__PURE__ */ f({
|
|
4
4
|
__name: "FieldDatetime",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as f, ref as a, onMounted as p, nextTick as s, withDirectives as d, openBlock as v, createElementBlock as y, vModelText as _ } from "vue";
|
|
2
|
-
import { _ as k } from "./index-
|
|
2
|
+
import { _ as k } from "./index-CTlM81Ib.js";
|
|
3
3
|
const x = /* @__PURE__ */ f({
|
|
4
4
|
__name: "FieldEmail",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as $, ref as a, computed as M, onMounted as z, nextTick as F, onBeforeUnmount as O, watch as T, openBlock as l, createElementBlock as i, Fragment as A, renderList as L, normalizeStyle as w, toDisplayString as k, createBlock as I, Teleport as P, withModifiers as m, normalizeClass as U, createElementVNode as p, createCommentVNode as V } from "vue";
|
|
2
|
-
import { _ as K } from "./index-
|
|
2
|
+
import { _ as K } from "./index-CTlM81Ib.js";
|
|
3
3
|
const W = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "of-field-multiselect__chips"
|
|
@@ -139,7 +139,7 @@ const W = {
|
|
|
139
139
|
]))
|
|
140
140
|
], 544));
|
|
141
141
|
}
|
|
142
|
-
}), Z = /* @__PURE__ */ K(Q, [["__scopeId", "data-v-
|
|
142
|
+
}), Z = /* @__PURE__ */ K(Q, [["__scopeId", "data-v-08942f77"]]);
|
|
143
143
|
export {
|
|
144
144
|
Z as default
|
|
145
145
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as p, ref as m, onMounted as v, nextTick as d, withDirectives as N, openBlock as b, createElementBlock as y, vModelText as k } from "vue";
|
|
2
|
-
import { _ } from "./index-
|
|
2
|
+
import { _ } from "./index-CTlM81Ib.js";
|
|
3
3
|
const x = /* @__PURE__ */ p({
|
|
4
4
|
__name: "FieldNumber",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as v, ref as _, openBlock as o, createElementBlock as r, withKeys as x, Fragment as g, renderList as
|
|
2
|
-
import { _ as C } from "./index-
|
|
1
|
+
import { defineComponent as v, ref as _, openBlock as o, createElementBlock as r, withKeys as x, Fragment as g, renderList as k, unref as c, withModifiers as y, normalizeClass as b } from "vue";
|
|
2
|
+
import { _ as C } from "./index-CTlM81Ib.js";
|
|
3
3
|
const M = ["onMouseenter", "onClick"], $ = /* @__PURE__ */ v({
|
|
4
4
|
__name: "FieldRating",
|
|
5
5
|
props: {
|
|
@@ -17,16 +17,16 @@ const M = ["onMouseenter", "onClick"], $ = /* @__PURE__ */ v({
|
|
|
17
17
|
onKeydown: t[1] || (t[1] = x((e) => a("cancel"), ["escape"])),
|
|
18
18
|
tabindex: "0"
|
|
19
19
|
}, [
|
|
20
|
-
(o(!0), r(g, null,
|
|
20
|
+
(o(!0), r(g, null, k(c(d), (e) => (o(), r("span", {
|
|
21
21
|
key: e,
|
|
22
|
-
class:
|
|
22
|
+
class: b(["of-field-rating__star", { filled: e <= (n.value || c(f)) }]),
|
|
23
23
|
onMouseenter: (l) => n.value = e,
|
|
24
24
|
onMouseleave: t[0] || (t[0] = (l) => n.value = 0),
|
|
25
|
-
onClick:
|
|
25
|
+
onClick: y((l) => p(e), ["stop"])
|
|
26
26
|
}, "★", 42, M))), 128))
|
|
27
27
|
], 32));
|
|
28
28
|
}
|
|
29
|
-
}), F = /* @__PURE__ */ C($, [["__scopeId", "data-v-
|
|
29
|
+
}), F = /* @__PURE__ */ C($, [["__scopeId", "data-v-ced77f03"]]);
|
|
30
30
|
export {
|
|
31
31
|
F as default
|
|
32
32
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as N, ref as f, computed as x, onMounted as R, nextTick as V, onBeforeUnmount as z, watch as A, openBlock as l, createElementBlock as a, normalizeStyle as b, toDisplayString as w, createBlock as I, Teleport as F, createElementVNode as T, withModifiers as C, normalizeClass as L, Fragment as O, renderList as P, createCommentVNode as U } from "vue";
|
|
2
|
-
import { _ as K } from "./index-
|
|
2
|
+
import { _ as K } from "./index-CTlM81Ib.js";
|
|
3
3
|
const W = {
|
|
4
4
|
key: 1,
|
|
5
5
|
class: "of-field-select__display"
|
|
@@ -116,7 +116,7 @@ const W = {
|
|
|
116
116
|
], 544);
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
}), Q = /* @__PURE__ */ K(G, [["__scopeId", "data-v-
|
|
119
|
+
}), Q = /* @__PURE__ */ K(G, [["__scopeId", "data-v-fc270aec"]]);
|
|
120
120
|
export {
|
|
121
121
|
Q as default
|
|
122
122
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as f, ref as a, onMounted as m, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as x, vModelText as y } from "vue";
|
|
2
|
-
import { _ } from "./index-
|
|
2
|
+
import { _ } from "./index-CTlM81Ib.js";
|
|
3
3
|
const k = /* @__PURE__ */ f({
|
|
4
4
|
__name: "FieldText",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as f, ref as a, onMounted as m, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as y, vModelText as _ } from "vue";
|
|
2
|
-
import { _ as k } from "./index-
|
|
2
|
+
import { _ as k } from "./index-CTlM81Ib.js";
|
|
3
3
|
const x = /* @__PURE__ */ f({
|
|
4
4
|
__name: "FieldUrl",
|
|
5
5
|
props: {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface AccordionItem {
|
|
2
|
+
key: string;
|
|
3
|
+
title: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface AccordionProps {
|
|
8
|
+
items: AccordionItem[];
|
|
9
|
+
modelValue?: string | string[];
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
lazy?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function __VLS_template(): {
|
|
14
|
+
attrs: Partial<{}>;
|
|
15
|
+
slots: Readonly<{
|
|
16
|
+
default?: (props: {
|
|
17
|
+
item: AccordionItem;
|
|
18
|
+
}) => unknown;
|
|
19
|
+
trigger?: (props: {
|
|
20
|
+
item: AccordionItem;
|
|
21
|
+
open: boolean;
|
|
22
|
+
}) => unknown;
|
|
23
|
+
}> & {
|
|
24
|
+
default?: (props: {
|
|
25
|
+
item: AccordionItem;
|
|
26
|
+
}) => unknown;
|
|
27
|
+
trigger?: (props: {
|
|
28
|
+
item: AccordionItem;
|
|
29
|
+
open: boolean;
|
|
30
|
+
}) => unknown;
|
|
31
|
+
};
|
|
32
|
+
refs: {};
|
|
33
|
+
rootEl: HTMLDivElement;
|
|
34
|
+
};
|
|
35
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
36
|
+
declare const __VLS_component: import('vue').DefineComponent<AccordionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
37
|
+
"update:modelValue": (value: string | string[]) => any;
|
|
38
|
+
}, string, import('vue').PublicProps, Readonly<AccordionProps> & Readonly<{
|
|
39
|
+
"onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
modelValue: string | string[];
|
|
42
|
+
multiple: boolean;
|
|
43
|
+
lazy: boolean;
|
|
44
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
45
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
46
|
+
export default _default;
|
|
47
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
48
|
+
new (): {
|
|
49
|
+
$slots: S;
|
|
50
|
+
};
|
|
51
|
+
};
|