@ithinkdt/ui 4.0.0-11 → 4.0.0-13
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/package.json +2 -2
- package/src/components/DataActions.jsx +5 -7
- package/src/components/DataTable.jsx +37 -25
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ithinkdt/ui",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "iThinkDT UI",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@vitejs/plugin-vue-jsx": "^5.1.1",
|
|
85
85
|
"ithinkdt-ui": "^1.7.3",
|
|
86
86
|
"typescript": "~5.9.3",
|
|
87
|
-
"unocss": ">=66.5.
|
|
87
|
+
"unocss": ">=66.5.3",
|
|
88
88
|
"vite": "npm:rolldown-vite@^7.1.16",
|
|
89
89
|
"vue": "^3.5.22",
|
|
90
90
|
"vue-router": "^4.5.1",
|
|
@@ -74,7 +74,7 @@ export const DataActions = /* @__PURE__ */ defineComponent({
|
|
|
74
74
|
onUpdateCount={onUpdateCount}
|
|
75
75
|
onUpdateOverflow={onUpdateOverflow}
|
|
76
76
|
updateCounter={updateCounter}
|
|
77
|
-
style="
|
|
77
|
+
style="margin-top: 2px"
|
|
78
78
|
>
|
|
79
79
|
{ {
|
|
80
80
|
default: () => props.options.map((act) => {
|
|
@@ -84,15 +84,13 @@ export const DataActions = /* @__PURE__ */ defineComponent({
|
|
|
84
84
|
? act.color
|
|
85
85
|
: 'primary'
|
|
86
86
|
return (
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
</NButton>
|
|
91
|
-
</span>
|
|
87
|
+
<NButton quaternary type={color} size="small" onClick={act.onClick}>
|
|
88
|
+
{act.text}
|
|
89
|
+
</NButton>
|
|
92
90
|
)
|
|
93
91
|
}),
|
|
94
92
|
counter: () => (
|
|
95
|
-
<span ref={counter}>
|
|
93
|
+
<span ref={counter} style="position: absolute">
|
|
96
94
|
<NDropdown options={moreOptions.value} renderLabel={renderLabel} onSelect={onSelect}>
|
|
97
95
|
<NButton quaternary size="small"><IMore style="font-size: 14px; color: #888" /></NButton>
|
|
98
96
|
</NDropdown>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toReactive, unrefElement, until } from '@vueuse/core'
|
|
2
|
-
import { NButton, NDataTable, NFlex, NIcon, NTooltip } from 'ithinkdt-ui'
|
|
2
|
+
import { NButton, NDataTable, NFlex, NIcon, NPerformantEllipsis, NTooltip } from 'ithinkdt-ui'
|
|
3
3
|
import { Sortable } from 'sortablejs'
|
|
4
4
|
import { computed, defineComponent, inject, mergeProps, nextTick, ref, shallowRef, toValue, useTemplateRef, watch, withDirectives } from 'vue'
|
|
5
5
|
|
|
@@ -43,40 +43,52 @@ function _map(columns, width) {
|
|
|
43
43
|
},
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
if (
|
|
47
|
-
column.children = _map(
|
|
46
|
+
if (col.children?.length) {
|
|
47
|
+
column.children = _map(col.children, width.value)
|
|
48
48
|
} else {
|
|
49
|
-
if (
|
|
49
|
+
if (col.hidden !== true) {
|
|
50
50
|
column.width ??= 100
|
|
51
51
|
width.value += Number(column.width)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const render0 =
|
|
55
|
-
if (
|
|
56
|
-
column.ellipsis =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
const render0 = col.render ?? (v => v)
|
|
55
|
+
if (col.ellipsis !== false) {
|
|
56
|
+
column.ellipsis = false
|
|
57
|
+
column.render = (...params) => {
|
|
58
|
+
const vnode = render0(...params)
|
|
59
|
+
return (
|
|
60
|
+
<NPerformantEllipsis
|
|
61
|
+
{...mergeProps(
|
|
62
|
+
{
|
|
63
|
+
expandTrigger: 'click',
|
|
64
|
+
lineClamp: 1,
|
|
65
|
+
tooltip: {
|
|
66
|
+
style: {
|
|
67
|
+
maxWidth: '61.8vw',
|
|
68
|
+
wordBreak: 'break-all',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
typeof col.ellipsis === 'boolean' ? {} : col.ellipsis,
|
|
73
|
+
)}
|
|
74
|
+
>
|
|
75
|
+
{
|
|
76
|
+
vnode
|
|
77
|
+
}
|
|
78
|
+
</NPerformantEllipsis>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (col.ellipsisTooltip === true) {
|
|
70
83
|
column.ellipsisTooltip ??= render0
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
86
|
|
|
74
87
|
Object.assign(column, {
|
|
75
|
-
resizable:
|
|
76
|
-
sorter:
|
|
77
|
-
type: ['selection', 'expand'].includes(
|
|
78
|
-
disabled:
|
|
79
|
-
ellipsisComponent: 'performant-ellipsis',
|
|
88
|
+
resizable: col.resizable !== false,
|
|
89
|
+
sorter: col.sortable,
|
|
90
|
+
type: ['selection', 'expand'].includes(col.type) ? col.type : undefined,
|
|
91
|
+
disabled: col.selectable ? model => col.selectable(model) === false : undefined,
|
|
80
92
|
})
|
|
81
93
|
}
|
|
82
94
|
|
package/src/index.js
CHANGED