vxe-pc-ui 4.3.85 → 4.3.87
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/src/link.js +5 -5
- 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 -8
- 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 +70 -17
- package/lib/index.umd.min.js +1 -1
- package/lib/link/src/link.js +3 -3
- package/lib/link/src/link.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 +55 -6
- 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 +7 -5
- package/packages/table-select/src/table-select.ts +7 -5
- package/packages/text-ellipsis/src/text-ellipsis.ts +52 -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.1739528199347.ttf → iconfont.1739698300455.ttf} +0 -0
- /package/es/icon/{iconfont.1739528199347.woff → iconfont.1739698300455.woff} +0 -0
- /package/es/icon/{iconfont.1739528199347.woff2 → iconfont.1739698300455.woff2} +0 -0
- /package/es/{iconfont.1739528199347.ttf → iconfont.1739698300455.ttf} +0 -0
- /package/es/{iconfont.1739528199347.woff → iconfont.1739698300455.woff} +0 -0
- /package/es/{iconfont.1739528199347.woff2 → iconfont.1739698300455.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1739528199347.ttf → iconfont.1739698300455.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1739528199347.woff → iconfont.1739698300455.woff} +0 -0
- /package/lib/icon/style/{iconfont.1739528199347.woff2 → iconfont.1739698300455.woff2} +0 -0
- /package/lib/{iconfont.1739528199347.ttf → iconfont.1739698300455.ttf} +0 -0
- /package/lib/{iconfont.1739528199347.woff → iconfont.1739698300455.woff} +0 -0
- /package/lib/{iconfont.1739528199347.woff2 → iconfont.1739698300455.woff2} +0 -0
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import { defineComponent, ref, h, PropType, watch, computed, reactive, onMounted, onBeforeUnmount } from 'vue'
|
|
1
|
+
import { defineComponent, ref, h, PropType, watch, computed, reactive, resolveComponent, onMounted, onBeforeUnmount } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
-
import { getConfig, createEvent, useSize } from '../../ui'
|
|
3
|
+
import { getConfig, createEvent, usePermission, useSize, renderEmptyElement } from '../../ui'
|
|
4
4
|
|
|
5
5
|
import type { TextEllipsisReactData, VxeTextEllipsisEmits, VxeTextEllipsisPropTypes, TextEllipsisMethods, TextEllipsisPrivateMethods, ValueOf, TextEllipsisPrivateRef, VxeTextEllipsisPrivateComputed, VxeTextEllipsisConstructor, VxeTextEllipsisPrivateMethods } from '../../../types'
|
|
6
6
|
|
|
7
7
|
export default defineComponent({
|
|
8
8
|
name: 'VxeTextEllipsis',
|
|
9
9
|
props: {
|
|
10
|
+
href: String as PropType<VxeTextEllipsisPropTypes.Href>,
|
|
11
|
+
target: String as PropType<VxeTextEllipsisPropTypes.Target>,
|
|
10
12
|
content: [String, Number] as PropType<VxeTextEllipsisPropTypes.Content>,
|
|
11
13
|
lineClamp: [String, Number] as PropType<VxeTextEllipsisPropTypes.LineClamp>,
|
|
12
14
|
status: String as PropType<VxeTextEllipsisPropTypes.Status>,
|
|
13
15
|
title: [String, Number] as PropType<VxeTextEllipsisPropTypes.Title>,
|
|
14
16
|
loading: Boolean as PropType<VxeTextEllipsisPropTypes.Loading>,
|
|
15
17
|
offsetLength: [String, Number] as PropType<VxeTextEllipsisPropTypes.OffsetLength>,
|
|
18
|
+
routerLink: Object as PropType<VxeTextEllipsisPropTypes.RouterLink>,
|
|
19
|
+
underline: {
|
|
20
|
+
type: Boolean as PropType<VxeTextEllipsisPropTypes.Underline>,
|
|
21
|
+
default: () => getConfig().textEllipsis.underline
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* 权限码
|
|
25
|
+
*/
|
|
26
|
+
permissionCode: [String, Number] as PropType<VxeTextEllipsisPropTypes.PermissionCode>,
|
|
16
27
|
size: {
|
|
17
28
|
type: String as PropType<VxeTextEllipsisPropTypes.Size>,
|
|
18
29
|
default: () => getConfig().textEllipsis.size || getConfig().size
|
|
@@ -28,6 +39,8 @@ export default defineComponent({
|
|
|
28
39
|
|
|
29
40
|
const { computeSize } = useSize(props)
|
|
30
41
|
|
|
42
|
+
const { computePermissionInfo } = usePermission(props)
|
|
43
|
+
|
|
31
44
|
const refElem = ref<HTMLDivElement>()
|
|
32
45
|
const realityElem = ref<HTMLDivElement>()
|
|
33
46
|
|
|
@@ -171,17 +184,50 @@ export default defineComponent({
|
|
|
171
184
|
|
|
172
185
|
Object.assign($xeTextEllipsis, textEllipsisMethods, textEllipsisPrivateMethods)
|
|
173
186
|
|
|
187
|
+
const renderContent = () => {
|
|
188
|
+
const { routerLink, href, target, title } = props
|
|
189
|
+
const visibleContent = computeVisibleContent.value
|
|
190
|
+
if (routerLink) {
|
|
191
|
+
return h(resolveComponent('router-link'), {
|
|
192
|
+
class: 'vxe-text-ellipsis--link',
|
|
193
|
+
title,
|
|
194
|
+
target,
|
|
195
|
+
to: routerLink
|
|
196
|
+
}, {
|
|
197
|
+
default () {
|
|
198
|
+
return renderContent()
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
if (href) {
|
|
203
|
+
return h('a', {
|
|
204
|
+
class: 'vxe-text-ellipsis--link',
|
|
205
|
+
href,
|
|
206
|
+
target,
|
|
207
|
+
title
|
|
208
|
+
}, visibleContent)
|
|
209
|
+
}
|
|
210
|
+
return h('span', {
|
|
211
|
+
class: 'vxe-text-ellipsis--content'
|
|
212
|
+
}, visibleContent)
|
|
213
|
+
}
|
|
214
|
+
|
|
174
215
|
const renderVN = () => {
|
|
175
|
-
const { loading, status, title } = props
|
|
216
|
+
const { loading, status, title, underline } = props
|
|
217
|
+
const permissionInfo = computePermissionInfo.value
|
|
176
218
|
const vSize = computeSize.value
|
|
177
|
-
const visibleContent = computeVisibleContent.value
|
|
178
219
|
const textLineClamp = computeTextLineClamp.value
|
|
179
220
|
|
|
221
|
+
if (!permissionInfo.visible) {
|
|
222
|
+
return renderEmptyElement($xeTextEllipsis)
|
|
223
|
+
}
|
|
224
|
+
|
|
180
225
|
return h('div', {
|
|
181
226
|
ref: refElem,
|
|
182
227
|
class: ['vxe-text-ellipsis', textLineClamp > 1 ? 'is--multi' : 'is--single', {
|
|
183
228
|
[`size--${vSize}`]: vSize,
|
|
184
229
|
[`theme--${status}`]: status,
|
|
230
|
+
'is--underline': underline,
|
|
185
231
|
'is--loading': loading
|
|
186
232
|
}],
|
|
187
233
|
title,
|
|
@@ -189,11 +235,9 @@ export default defineComponent({
|
|
|
189
235
|
}, [
|
|
190
236
|
h('span', {
|
|
191
237
|
ref: realityElem,
|
|
192
|
-
class: 'vxe-text-ellipsis
|
|
238
|
+
class: 'vxe-text-ellipsis--reality'
|
|
193
239
|
}),
|
|
194
|
-
|
|
195
|
-
class: 'vxe-text-ellipsis-content'
|
|
196
|
-
}, visibleContent)
|
|
240
|
+
renderContent()
|
|
197
241
|
])
|
|
198
242
|
}
|
|
199
243
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { RenderFunction, SetupContext, Ref } from 'vue'
|
|
2
|
-
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentBaseOptions, VxeComponentEventParams, VxeComponentSizeType, ValueOf, VxeComponentStatusType } from '@vxe-ui/core'
|
|
2
|
+
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentBaseOptions, VxeComponentEventParams, VxeComponentSizeType, ValueOf, VxeComponentStatusType, VxeComponentPermissionCodeType } from '@vxe-ui/core'
|
|
3
3
|
|
|
4
4
|
/* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
|
|
5
5
|
|
|
@@ -23,21 +23,37 @@ export interface TextEllipsisPrivateRef {
|
|
|
23
23
|
export interface VxeTextEllipsisPrivateRef extends TextEllipsisPrivateRef { }
|
|
24
24
|
|
|
25
25
|
export namespace VxeTextEllipsisPropTypes {
|
|
26
|
+
export type Href = null | string
|
|
27
|
+
export type Target = null | '' | '_blank' | '_self' | '_parent' | '_top'
|
|
26
28
|
export type Status = VxeComponentStatusType
|
|
27
29
|
export type Title = string | number
|
|
28
30
|
export type LineClamp = string | number
|
|
29
31
|
export type Loading = boolean
|
|
30
32
|
export type OffsetLength = string | number
|
|
33
|
+
export type RouterLink = {
|
|
34
|
+
path?: string
|
|
35
|
+
name?: string | number | null
|
|
36
|
+
query?: any
|
|
37
|
+
params?: any
|
|
38
|
+
target?: null | '' | '_blank' | '_self' | '_parent' | '_top'
|
|
39
|
+
}
|
|
40
|
+
export type Underline = boolean
|
|
41
|
+
export type PermissionCode = VxeComponentPermissionCodeType
|
|
31
42
|
export type Content = string | number
|
|
32
43
|
export type Size = VxeComponentSizeType
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
export type VxeTextEllipsisProps = {
|
|
47
|
+
href?: VxeTextEllipsisPropTypes.Href
|
|
48
|
+
target?: VxeTextEllipsisPropTypes.Target
|
|
36
49
|
status?: VxeTextEllipsisPropTypes.Status
|
|
37
50
|
title?: VxeTextEllipsisPropTypes.Title
|
|
38
51
|
lineClamp?: VxeTextEllipsisPropTypes.LineClamp
|
|
39
52
|
loading?: VxeTextEllipsisPropTypes.Loading
|
|
40
53
|
offsetLength?: VxeTextEllipsisPropTypes.OffsetLength
|
|
54
|
+
underline?: VxeTextEllipsisPropTypes.Underline
|
|
55
|
+
routerLink?: VxeTextEllipsisPropTypes.RouterLink
|
|
56
|
+
permissionCode?: VxeTextEllipsisPropTypes.PermissionCode
|
|
41
57
|
content?: VxeTextEllipsisPropTypes.Content
|
|
42
58
|
size?: VxeTextEllipsisPropTypes.Size
|
|
43
59
|
}
|
|
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
|