vxe-pc-ui 3.3.89 → 3.3.91
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/es/icon/style.css +1 -1
- package/es/link/style.css +1 -1
- package/es/link/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table-select/src/table-select.js +7 -5
- package/es/text-ellipsis/src/text-ellipsis.js +49 -7
- package/es/text-ellipsis/style.css +47 -3
- package/es/text-ellipsis/style.min.css +1 -1
- package/es/ui/index.js +4 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-link/style.css +1 -1
- package/es/vxe-link/style.min.css +1 -1
- package/es/vxe-text-ellipsis/style.css +47 -3
- package/es/vxe-text-ellipsis/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +66 -15
- package/lib/index.umd.min.js +1 -1
- package/lib/link/style/style.css +1 -1
- package/lib/link/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table-select/src/table-select.js +7 -5
- package/lib/table-select/src/table-select.min.js +1 -1
- package/lib/text-ellipsis/src/text-ellipsis.js +54 -7
- package/lib/text-ellipsis/src/text-ellipsis.min.js +1 -1
- package/lib/text-ellipsis/style/style.css +47 -3
- package/lib/text-ellipsis/style/style.min.css +1 -1
- package/lib/ui/index.js +4 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-link/style/style.css +1 -1
- package/lib/vxe-link/style/style.min.css +1 -1
- package/lib/vxe-text-ellipsis/style/style.css +47 -3
- package/lib/vxe-text-ellipsis/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/link/src/link.ts +2 -0
- package/packages/table-select/src/table-select.ts +7 -5
- package/packages/text-ellipsis/src/text-ellipsis.ts +53 -8
- package/packages/ui/index.ts +3 -1
- package/styles/components/link.scss +1 -1
- package/styles/components/text-ellipsis.scss +22 -3
- package/types/components/table.d.ts +1 -2
- package/types/components/text-ellipsis.d.ts +17 -1
- /package/es/icon/{iconfont.1739528185252.ttf → iconfont.1739698284242.ttf} +0 -0
- /package/es/icon/{iconfont.1739528185252.woff → iconfont.1739698284242.woff} +0 -0
- /package/es/icon/{iconfont.1739528185252.woff2 → iconfont.1739698284242.woff2} +0 -0
- /package/es/{iconfont.1739528185252.ttf → iconfont.1739698284242.ttf} +0 -0
- /package/es/{iconfont.1739528185252.woff → iconfont.1739698284242.woff} +0 -0
- /package/es/{iconfont.1739528185252.woff2 → iconfont.1739698284242.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1739528185252.ttf → iconfont.1739698284242.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1739528185252.woff → iconfont.1739698284242.woff} +0 -0
- /package/lib/icon/style/{iconfont.1739528185252.woff2 → iconfont.1739698284242.woff2} +0 -0
- /package/lib/{iconfont.1739528185252.ttf → iconfont.1739698284242.ttf} +0 -0
- /package/lib/{iconfont.1739528185252.woff → iconfont.1739698284242.woff} +0 -0
- /package/lib/{iconfont.1739528185252.woff2 → iconfont.1739698284242.woff2} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropType, CreateElement, VNode } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
|
-
import { getConfig, createEvent, globalMixins } from '../../ui'
|
|
4
|
+
import { getConfig, createEvent, renderEmptyElement, globalMixins } from '../../ui'
|
|
5
5
|
|
|
6
|
-
import type { VxeTextEllipsisPropTypes, TextEllipsisReactData, VxeTextEllipsisEmits, VxeComponentSizeType, ValueOf } from '../../../types'
|
|
6
|
+
import type { VxeTextEllipsisPropTypes, TextEllipsisReactData, VxeTextEllipsisEmits, VxeComponentSizeType, ValueOf, VxeComponentPermissionInfo } from '../../../types'
|
|
7
7
|
|
|
8
8
|
export default defineVxeComponent({
|
|
9
9
|
name: 'VxeTextEllipsis',
|
|
@@ -12,12 +12,23 @@ export default defineVxeComponent({
|
|
|
12
12
|
globalMixins.permissionMixin
|
|
13
13
|
],
|
|
14
14
|
props: {
|
|
15
|
+
href: String as PropType<VxeTextEllipsisPropTypes.Href>,
|
|
16
|
+
target: String as PropType<VxeTextEllipsisPropTypes.Target>,
|
|
15
17
|
content: [String, Number] as PropType<VxeTextEllipsisPropTypes.Content>,
|
|
16
18
|
lineClamp: [String, Number] as PropType<VxeTextEllipsisPropTypes.LineClamp>,
|
|
17
19
|
status: String as PropType<VxeTextEllipsisPropTypes.Status>,
|
|
18
20
|
title: [String, Number] as PropType<VxeTextEllipsisPropTypes.Title>,
|
|
19
21
|
loading: Boolean as PropType<VxeTextEllipsisPropTypes.Loading>,
|
|
20
22
|
offsetLength: [String, Number] as PropType<VxeTextEllipsisPropTypes.OffsetLength>,
|
|
23
|
+
routerLink: Object as PropType<VxeTextEllipsisPropTypes.RouterLink>,
|
|
24
|
+
underline: {
|
|
25
|
+
type: Boolean as PropType<VxeTextEllipsisPropTypes.Underline>,
|
|
26
|
+
default: () => getConfig().textEllipsis.underline
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* 权限码
|
|
30
|
+
*/
|
|
31
|
+
permissionCode: [String, Number] as PropType<VxeTextEllipsisPropTypes.PermissionCode>,
|
|
21
32
|
size: {
|
|
22
33
|
type: String as PropType<VxeTextEllipsisPropTypes.Size>,
|
|
23
34
|
default: () => getConfig().textEllipsis.size || getConfig().size
|
|
@@ -35,6 +46,7 @@ export default defineVxeComponent({
|
|
|
35
46
|
},
|
|
36
47
|
computed: {
|
|
37
48
|
...({} as {
|
|
49
|
+
computePermissionInfo(): VxeComponentPermissionInfo
|
|
38
50
|
computeSize(): VxeComponentSizeType
|
|
39
51
|
}),
|
|
40
52
|
computeTextLineClamp () {
|
|
@@ -170,20 +182,55 @@ export default defineVxeComponent({
|
|
|
170
182
|
//
|
|
171
183
|
// Render
|
|
172
184
|
//
|
|
185
|
+
renderContent (h: CreateElement) {
|
|
186
|
+
const $xeTextEllipsis = this
|
|
187
|
+
const props = $xeTextEllipsis
|
|
188
|
+
|
|
189
|
+
const { routerLink, href, target, title } = props
|
|
190
|
+
const visibleContent = $xeTextEllipsis.computeVisibleContent
|
|
191
|
+
if (routerLink) {
|
|
192
|
+
return h('router-link', {
|
|
193
|
+
class: 'vxe-text-ellipsis--link',
|
|
194
|
+
props: {
|
|
195
|
+
title,
|
|
196
|
+
target,
|
|
197
|
+
custom: true
|
|
198
|
+
}
|
|
199
|
+
}, visibleContent)
|
|
200
|
+
}
|
|
201
|
+
if (href) {
|
|
202
|
+
return h('a', {
|
|
203
|
+
class: 'vxe-text-ellipsis--link',
|
|
204
|
+
attrs: {
|
|
205
|
+
href,
|
|
206
|
+
target,
|
|
207
|
+
title
|
|
208
|
+
}
|
|
209
|
+
}, visibleContent)
|
|
210
|
+
}
|
|
211
|
+
return h('span', {
|
|
212
|
+
class: 'vxe-text-ellipsis--content'
|
|
213
|
+
}, visibleContent)
|
|
214
|
+
},
|
|
173
215
|
renderVN (h: CreateElement): VNode {
|
|
174
216
|
const $xeTextEllipsis = this
|
|
175
217
|
const props = $xeTextEllipsis
|
|
176
218
|
|
|
177
|
-
const { loading, status, title } = props
|
|
219
|
+
const { loading, status, title, underline } = props
|
|
220
|
+
const permissionInfo = $xeTextEllipsis.computePermissionInfo
|
|
178
221
|
const vSize = $xeTextEllipsis.computeSize
|
|
179
|
-
const visibleContent = $xeTextEllipsis.computeVisibleContent
|
|
180
222
|
const textLineClamp = $xeTextEllipsis.computeTextLineClamp
|
|
181
223
|
|
|
224
|
+
if (!permissionInfo.visible) {
|
|
225
|
+
return renderEmptyElement($xeTextEllipsis)
|
|
226
|
+
}
|
|
227
|
+
|
|
182
228
|
return h('div', {
|
|
183
229
|
ref: 'refElem',
|
|
184
230
|
class: ['vxe-text-ellipsis', textLineClamp > 1 ? 'is--multi' : 'is--single', {
|
|
185
231
|
[`size--${vSize}`]: vSize,
|
|
186
232
|
[`theme--${status}`]: status,
|
|
233
|
+
'is--underline': underline,
|
|
187
234
|
'is--loading': loading
|
|
188
235
|
}],
|
|
189
236
|
attrs: {
|
|
@@ -195,11 +242,9 @@ export default defineVxeComponent({
|
|
|
195
242
|
}, [
|
|
196
243
|
h('span', {
|
|
197
244
|
ref: 'realityElem',
|
|
198
|
-
class: 'vxe-text-ellipsis
|
|
245
|
+
class: 'vxe-text-ellipsis--reality'
|
|
199
246
|
}),
|
|
200
|
-
h
|
|
201
|
-
class: 'vxe-text-ellipsis-content'
|
|
202
|
-
}, visibleContent)
|
|
247
|
+
$xeTextEllipsis.renderContent(h)
|
|
203
248
|
])
|
|
204
249
|
}
|
|
205
250
|
},
|
package/packages/ui/index.ts
CHANGED
|
@@ -56,11 +56,25 @@ $btnThemeList: (
|
|
|
56
56
|
display: block;
|
|
57
57
|
overflow: hidden;
|
|
58
58
|
white-space: normal;
|
|
59
|
-
color: var(--vxe-ui-font-color);
|
|
60
59
|
@for $index from 0 to list.length($btnThemeList) {
|
|
61
60
|
$item: list.nth($btnThemeList, $index + 1);
|
|
62
61
|
&.theme--#{map.get($item, name)} {
|
|
63
62
|
color: map.get($item, textColor);
|
|
63
|
+
& > .vxe-text-ellipsis--link {
|
|
64
|
+
&:focus {
|
|
65
|
+
color: map.get($item, btnDarkenColor);
|
|
66
|
+
}
|
|
67
|
+
&:hover {
|
|
68
|
+
color: map.get($item, btnLightenColor);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
&.is--underline {
|
|
74
|
+
&:hover {
|
|
75
|
+
.vxe-text-ellipsis--link {
|
|
76
|
+
text-decoration: underline;
|
|
77
|
+
}
|
|
64
78
|
}
|
|
65
79
|
}
|
|
66
80
|
&.is--single {
|
|
@@ -85,7 +99,7 @@ $btnThemeList: (
|
|
|
85
99
|
}
|
|
86
100
|
}
|
|
87
101
|
}
|
|
88
|
-
.vxe-text-ellipsis
|
|
102
|
+
.vxe-text-ellipsis--reality {
|
|
89
103
|
display: none;
|
|
90
104
|
z-index: -1;
|
|
91
105
|
pointer-events: none;
|
|
@@ -95,9 +109,14 @@ $btnThemeList: (
|
|
|
95
109
|
padding: 0 0.1em;
|
|
96
110
|
user-select: none;
|
|
97
111
|
}
|
|
98
|
-
.vxe-text-ellipsis--content
|
|
112
|
+
.vxe-text-ellipsis--content,
|
|
113
|
+
.vxe-text-ellipsis--link {
|
|
99
114
|
padding: 0 0.1em;
|
|
100
115
|
}
|
|
116
|
+
.vxe-text-ellipsis--link {
|
|
117
|
+
text-decoration: none;
|
|
118
|
+
color: inherit;
|
|
119
|
+
}
|
|
101
120
|
|
|
102
121
|
.vxe-text-ellipsis {
|
|
103
122
|
&.size--medium {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentEventParams, VxeComponentSizeType, ValueOf, VxeComponentStatusType } from '@vxe-ui/core'
|
|
1
|
+
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentEventParams, VxeComponentSizeType, ValueOf, VxeComponentStatusType, VxeComponentPermissionCodeType } from '@vxe-ui/core'
|
|
2
2
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-empty-interface,no-use-before-define,@typescript-eslint/ban-types */
|
|
4
4
|
|
|
@@ -16,21 +16,37 @@ export interface TextEllipsisPrivateRef {
|
|
|
16
16
|
export interface VxeTextEllipsisPrivateRef extends TextEllipsisPrivateRef { }
|
|
17
17
|
|
|
18
18
|
export namespace VxeTextEllipsisPropTypes {
|
|
19
|
+
export type Href = null | string
|
|
20
|
+
export type Target = null | '' | '_blank' | '_self' | '_parent' | '_top'
|
|
19
21
|
export type Status = VxeComponentStatusType
|
|
20
22
|
export type Title = string | number
|
|
21
23
|
export type LineClamp = string | number
|
|
22
24
|
export type Loading = boolean
|
|
23
25
|
export type OffsetLength = string | number
|
|
26
|
+
export type RouterLink = {
|
|
27
|
+
path?: string
|
|
28
|
+
name?: string | number | null
|
|
29
|
+
query?: any
|
|
30
|
+
params?: any
|
|
31
|
+
target?: null | '' | '_blank' | '_self' | '_parent' | '_top'
|
|
32
|
+
}
|
|
33
|
+
export type Underline = boolean
|
|
34
|
+
export type PermissionCode = VxeComponentPermissionCodeType
|
|
24
35
|
export type Content = string | number
|
|
25
36
|
export type Size = VxeComponentSizeType
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
export type VxeTextEllipsisProps = {
|
|
40
|
+
href?: VxeTextEllipsisPropTypes.Href
|
|
41
|
+
target?: VxeTextEllipsisPropTypes.Target
|
|
29
42
|
status?: VxeTextEllipsisPropTypes.Status
|
|
30
43
|
title?: VxeTextEllipsisPropTypes.Title
|
|
31
44
|
lineClamp?: VxeTextEllipsisPropTypes.LineClamp
|
|
32
45
|
loading?: VxeTextEllipsisPropTypes.Loading
|
|
33
46
|
offsetLength?: VxeTextEllipsisPropTypes.OffsetLength
|
|
47
|
+
underline?: VxeTextEllipsisPropTypes.Underline
|
|
48
|
+
routerLink?: VxeTextEllipsisPropTypes.RouterLink
|
|
49
|
+
permissionCode?: VxeTextEllipsisPropTypes.PermissionCode
|
|
34
50
|
content?: VxeTextEllipsisPropTypes.Content
|
|
35
51
|
size?: VxeTextEllipsisPropTypes.Size
|
|
36
52
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|