rayyy-vue-table-components 1.0.39 → 1.0.40
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.md +58 -2
- package/dist/index.es.js +10818 -6743
- package/dist/index.umd.js +29 -3
- package/dist/rayyy-vue-table-components.css +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/transfer/TransferDialog.vue +1 -0
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
- 🎯 完整的 TypeScript 類型支持
|
|
10
10
|
- 📱 響應式設計
|
|
11
11
|
- 🔧 高度可配置
|
|
12
|
+
- 🎛️ 可拖拽的列配置對話框
|
|
13
|
+
- 📋 支持表格列的顯示/隱藏和排序
|
|
12
14
|
|
|
13
15
|
## 安裝
|
|
14
16
|
|
|
@@ -20,6 +22,18 @@ yarn add rayyy-vue-table-components
|
|
|
20
22
|
pnpm add rayyy-vue-table-components
|
|
21
23
|
```
|
|
22
24
|
|
|
25
|
+
### 依賴說明
|
|
26
|
+
|
|
27
|
+
如果您需要使用 `TransferDialog` 組件,還需要安裝 `vuedraggable` 依賴:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install vuedraggable
|
|
31
|
+
# 或
|
|
32
|
+
yarn add vuedraggable
|
|
33
|
+
# 或
|
|
34
|
+
pnpm add vuedraggable
|
|
35
|
+
```
|
|
36
|
+
|
|
23
37
|
## 使用方法
|
|
24
38
|
|
|
25
39
|
### 全局註冊
|
|
@@ -51,15 +65,22 @@ app.use(VueTableComponents)
|
|
|
51
65
|
<BaseDialog v-model="showDialog" title="確認操作">
|
|
52
66
|
<p>您確定要執行此操作嗎?</p>
|
|
53
67
|
</BaseDialog>
|
|
68
|
+
|
|
69
|
+
<TransferDialog
|
|
70
|
+
v-model="showTransferDialog"
|
|
71
|
+
:columns-value="columns"
|
|
72
|
+
transfer-title="配置表格列"
|
|
73
|
+
@update:submit="handleTransferSubmit"
|
|
74
|
+
/>
|
|
54
75
|
</template>
|
|
55
76
|
|
|
56
77
|
<script setup lang="ts">
|
|
57
78
|
// 方式一:從主模塊導入
|
|
58
|
-
import { BaseTable, BaseBtn, BaseDialog } from 'rayyy-vue-table-components'
|
|
79
|
+
import { BaseTable, BaseBtn, BaseDialog, TransferDialog } from 'rayyy-vue-table-components'
|
|
59
80
|
import type { TableColumn, SortChangValue } from 'rayyy-vue-table-components'
|
|
60
81
|
|
|
61
82
|
// 方式二:單獨導入組件
|
|
62
|
-
import { BaseTable } from 'rayyy-vue-table-components/components'
|
|
83
|
+
import { BaseTable, TransferDialog } from 'rayyy-vue-table-components/components'
|
|
63
84
|
import type { TableColumn } from 'rayyy-vue-table-components/types'
|
|
64
85
|
|
|
65
86
|
// 方式三:單獨導入類型
|
|
@@ -87,10 +108,16 @@ const columns: TableColumn<User>[] = [
|
|
|
87
108
|
]
|
|
88
109
|
|
|
89
110
|
const loading = ref(false)
|
|
111
|
+
const showTransferDialog = ref(false)
|
|
90
112
|
|
|
91
113
|
const handleSortChange = (sortInfo: SortChangValue<User>) => {
|
|
92
114
|
console.log('排序變更:', sortInfo)
|
|
93
115
|
}
|
|
116
|
+
|
|
117
|
+
const handleTransferSubmit = (columns: TableColumn<User>[]) => {
|
|
118
|
+
console.log('TransferDialog 提交的列配置:', columns)
|
|
119
|
+
// 這裡可以更新表格的列配置
|
|
120
|
+
}
|
|
94
121
|
</script>
|
|
95
122
|
```
|
|
96
123
|
|
|
@@ -269,6 +296,22 @@ const tableProps: BaseTableProps<User> = {
|
|
|
269
296
|
| bodyLoading | `boolean` | `false` | 內容區域加載狀態 |
|
|
270
297
|
| submitLoading | `boolean` | `false` | 提交按鈕加載狀態 |
|
|
271
298
|
|
|
299
|
+
### TransferDialog Props
|
|
300
|
+
|
|
301
|
+
| 屬性 | 類型 | 默認值 | 說明 |
|
|
302
|
+
|------|------|--------|------|
|
|
303
|
+
| modelValue | `boolean` | - | 對話框顯示狀態 |
|
|
304
|
+
| columnsValue | `TableColumn<T>[]` | `[]` | 表格列配置 |
|
|
305
|
+
| transferTitle | `string` | `'列配置'` | 對話框標題 |
|
|
306
|
+
| checkAll | `boolean` | `false` | 是否全選 |
|
|
307
|
+
|
|
308
|
+
### TransferDialog Events
|
|
309
|
+
|
|
310
|
+
| 事件名 | 參數 | 說明 |
|
|
311
|
+
|--------|------|------|
|
|
312
|
+
| update:submit | `columns: TableColumn<T>[]` | 提交列配置 |
|
|
313
|
+
| update:modelValue | `value: boolean` | 對話框顯示狀態變更 |
|
|
314
|
+
|
|
272
315
|
### TableColumn 接口
|
|
273
316
|
|
|
274
317
|
```typescript
|
|
@@ -307,6 +350,19 @@ npm run test:unit
|
|
|
307
350
|
npm run lint
|
|
308
351
|
```
|
|
309
352
|
|
|
353
|
+
## 組件列表
|
|
354
|
+
|
|
355
|
+
| 組件 | 說明 | 依賴 |
|
|
356
|
+
|------|------|------|
|
|
357
|
+
| BaseTable | 基礎表格組件 | - |
|
|
358
|
+
| BaseBtn | 基礎按鈕組件 | - |
|
|
359
|
+
| BaseInput | 基礎輸入組件 | - |
|
|
360
|
+
| FilterBtn | 篩選按鈕組件 | - |
|
|
361
|
+
| BaseDialog | 基礎對話框組件 | - |
|
|
362
|
+
| SortTable | 排序表格組件 | - |
|
|
363
|
+
| SearchBar | 搜尋欄組件 | - |
|
|
364
|
+
| TransferDialog | 列配置對話框組件 | vuedraggable |
|
|
365
|
+
|
|
310
366
|
## 許可證
|
|
311
367
|
|
|
312
368
|
MIT License
|