@a2simcode/ui 0.0.213 → 0.0.215
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/dist/components/button/index.d.ts +0 -3
- package/dist/components/button/src/button.vue.d.ts +0 -3
- package/dist/components/input-layer/src/input-layer.vue.d.ts +0 -2
- package/dist/components/table/index.d.ts +15 -0
- package/dist/components/table/src/table.vue.d.ts +15 -0
- package/dist/components/table-panel/index.d.ts +15 -0
- package/dist/components/table-panel/src/table-panel.vue.d.ts +15 -0
- package/dist/simcode-ui.es.js +2417 -2396
- package/dist/simcode-ui.umd.js +2 -2
- package/dist/stats.html +1 -1
- package/dist/ui.css +1 -1
- package/docs/components/button.md +7 -7
- package/docs/components/meta/button.ts +0 -11
- package/docs/components/meta/input-layer.ts +0 -10
- package/docs/components/meta/table.ts +6 -0
- package/docs/components/table.md +14 -0
- package/docs/examples/button/danger.vue +9 -0
- package/docs/examples/button/disabled.vue +0 -1
- package/docs/examples/input-layer/basic.vue +0 -1
- package/docs/examples/table/multiple-disabled.vue +112 -0
- package/package.json +4 -4
- package/docs/examples/button/danger-ghost.vue +0 -17
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<j-button type="primary" disabled label="Primary Disabled" />
|
|
5
5
|
<j-button type="dashed" disabled label="Dashed Disabled" />
|
|
6
6
|
<j-button type="link" disabled label="Link Disabled" />
|
|
7
|
-
<j-button ghost disabled label="Ghost Disabled" />
|
|
8
7
|
<j-button danger disabled label="Danger Disabled" />
|
|
9
8
|
</div>
|
|
10
9
|
</template>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="margin-bottom: 10px; display: flex; gap: 8px">
|
|
3
|
+
<j-button type="primary" label="获取选中数据" @click="getSelection" />
|
|
4
|
+
<j-button label="尝试选中前四行" @click="setSelection" />
|
|
5
|
+
</div>
|
|
6
|
+
<div style="margin-bottom: 10px; color: #606266; font-size: 13px">
|
|
7
|
+
状态为“已锁定”的行会禁用多选框,调用 `setSelection` 时也会自动跳过这些行。
|
|
8
|
+
</div>
|
|
9
|
+
<div style="position: relative; width: 100%; height: 420px">
|
|
10
|
+
<j-table
|
|
11
|
+
ref="tableRef"
|
|
12
|
+
:columns="columns"
|
|
13
|
+
:records="records"
|
|
14
|
+
row-key="id"
|
|
15
|
+
is-multiple
|
|
16
|
+
:multiple-disabled="isMultipleDisabled"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { ref } from 'vue'
|
|
23
|
+
|
|
24
|
+
const tableRef = ref()
|
|
25
|
+
|
|
26
|
+
const getSelection = () => {
|
|
27
|
+
const selectedRecords = tableRef.value?.getSelection?.() || []
|
|
28
|
+
console.log(selectedRecords)
|
|
29
|
+
alert(`当前选中了 ${selectedRecords.length} 条数据,详情请查看控制台`)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const setSelection = () => {
|
|
33
|
+
tableRef.value?.setSelection?.(records.value.slice(0, 4))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const isMultipleDisabled = (record: Record<string, any>) => {
|
|
37
|
+
return record.status === '已锁定'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const columns = ref([
|
|
41
|
+
{
|
|
42
|
+
id: 'name',
|
|
43
|
+
config: {
|
|
44
|
+
label: '任务名称',
|
|
45
|
+
width: 'auto',
|
|
46
|
+
align: 'left',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'owner',
|
|
51
|
+
config: {
|
|
52
|
+
label: '负责人',
|
|
53
|
+
width: 'auto',
|
|
54
|
+
align: 'left',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'status',
|
|
59
|
+
config: {
|
|
60
|
+
label: '状态',
|
|
61
|
+
width: 'auto',
|
|
62
|
+
align: 'left',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'remark',
|
|
67
|
+
config: {
|
|
68
|
+
label: '说明',
|
|
69
|
+
width: 'auto',
|
|
70
|
+
align: 'left',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
const records = ref([
|
|
76
|
+
{
|
|
77
|
+
id: 'task-001',
|
|
78
|
+
name: '需求评审',
|
|
79
|
+
owner: '张三',
|
|
80
|
+
status: '处理中',
|
|
81
|
+
remark: '可选择',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'task-002',
|
|
85
|
+
name: '接口联调',
|
|
86
|
+
owner: '李四',
|
|
87
|
+
status: '已锁定',
|
|
88
|
+
remark: '已锁定,禁止选择',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'task-003',
|
|
92
|
+
name: '页面开发',
|
|
93
|
+
owner: '王五',
|
|
94
|
+
status: '待处理',
|
|
95
|
+
remark: '可选择',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'task-004',
|
|
99
|
+
name: '数据回归',
|
|
100
|
+
owner: '赵六',
|
|
101
|
+
status: '已锁定',
|
|
102
|
+
remark: '已锁定,禁止选择',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'task-005',
|
|
106
|
+
name: '上线检查',
|
|
107
|
+
owner: '钱七',
|
|
108
|
+
status: '处理中',
|
|
109
|
+
remark: '可选择',
|
|
110
|
+
},
|
|
111
|
+
])
|
|
112
|
+
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a2simcode/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.215",
|
|
4
4
|
"description": "A Vue 3 UI Component Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/simcode-ui.umd.js",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"@codemirror/state": "6.6.0",
|
|
48
48
|
"@codemirror/view": "6.40.0",
|
|
49
49
|
"@iconify/vue": "5.0.0",
|
|
50
|
-
"@visactor/vtable": "1.26.
|
|
51
|
-
"@visactor/vtable-editors": "1.26.
|
|
52
|
-
"@visactor/vtable-plugins": "1.26.
|
|
50
|
+
"@visactor/vtable": "1.26.1",
|
|
51
|
+
"@visactor/vtable-editors": "1.26.1",
|
|
52
|
+
"@visactor/vtable-plugins": "1.26.1",
|
|
53
53
|
"@vueuse/core": "14.2.1",
|
|
54
54
|
"async-validator": "4.2.5",
|
|
55
55
|
"codemirror": "6.0.2",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div style="display: flex; flex-direction: column; gap: 16px">
|
|
3
|
-
<div style="display: flex; gap: 8px; flex-wrap: wrap">
|
|
4
|
-
<j-button danger label="Danger Default" />
|
|
5
|
-
<j-button type="primary" danger label="Danger Primary" />
|
|
6
|
-
<j-button type="dashed" danger label="Danger Dashed" />
|
|
7
|
-
<j-button type="text" danger label="Danger Text" />
|
|
8
|
-
<j-button type="link" danger label="Danger Link" />
|
|
9
|
-
</div>
|
|
10
|
-
<div style="background: #999; padding: 16px; display: flex; gap: 8px; flex-wrap: wrap">
|
|
11
|
-
<j-button ghost label="Ghost Default" />
|
|
12
|
-
<j-button type="primary" ghost label="Ghost Primary" />
|
|
13
|
-
<j-button type="dashed" ghost label="Ghost Dashed" />
|
|
14
|
-
<j-button danger ghost label="Ghost Danger" />
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|