@ithinkdt/ui 4.0.0-12 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ithinkdt/ui",
3
- "version": "4.0.0-12",
3
+ "version": "4.0.0-13",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "iThinkDT UI",
@@ -74,7 +74,7 @@ export const DataActions = /* @__PURE__ */ defineComponent({
74
74
  onUpdateCount={onUpdateCount}
75
75
  onUpdateOverflow={onUpdateOverflow}
76
76
  updateCounter={updateCounter}
77
- style="width: 100%; display: flex; overflow: hidden; align-items: center; line-height: 1.25;"
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
- <span>
88
- <NButton quaternary type={color} size="small" onClick={act.onClick}>
89
- {act.text}
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 (column.children?.length) {
47
- column.children = _map(column.children, width.value)
46
+ if (col.children?.length) {
47
+ column.children = _map(col.children, width.value)
48
48
  } else {
49
- if (column.hidden !== true) {
49
+ if (col.hidden !== true) {
50
50
  column.width ??= 100
51
51
  width.value += Number(column.width)
52
52
  }
53
53
 
54
- const render0 = column.render ?? (v => v)
55
- if (column.ellipsis !== false) {
56
- column.ellipsis = mergeProps(
57
- {
58
- expandTrigger: 'click',
59
- lineClamp: 1,
60
- tooltip: {
61
- style: {
62
- maxWidth: '61.8vw',
63
- wordBreak: 'break-all',
64
- },
65
- },
66
- },
67
- typeof column.ellipsis === 'boolean' ? {} : column.ellipsis,
68
- )
69
- if (column.ellipsisTooltip === true) {
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: column.resizable !== false,
76
- sorter: column.sortable,
77
- type: ['selection', 'expand'].includes(column.type) ? column.type : undefined,
78
- disabled: column.selectable ? model => column.selectable(model) === false : undefined,
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