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.
Files changed (58) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/link/style.css +1 -1
  3. package/es/link/style.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table-select/src/table-select.js +7 -5
  7. package/es/text-ellipsis/src/text-ellipsis.js +49 -7
  8. package/es/text-ellipsis/style.css +47 -3
  9. package/es/text-ellipsis/style.min.css +1 -1
  10. package/es/ui/index.js +4 -2
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-link/style.css +1 -1
  13. package/es/vxe-link/style.min.css +1 -1
  14. package/es/vxe-text-ellipsis/style.css +47 -3
  15. package/es/vxe-text-ellipsis/style.min.css +1 -1
  16. package/lib/icon/style/style.css +1 -1
  17. package/lib/icon/style/style.min.css +1 -1
  18. package/lib/index.umd.js +66 -15
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/link/style/style.css +1 -1
  21. package/lib/link/style/style.min.css +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/table-select/src/table-select.js +7 -5
  25. package/lib/table-select/src/table-select.min.js +1 -1
  26. package/lib/text-ellipsis/src/text-ellipsis.js +54 -7
  27. package/lib/text-ellipsis/src/text-ellipsis.min.js +1 -1
  28. package/lib/text-ellipsis/style/style.css +47 -3
  29. package/lib/text-ellipsis/style/style.min.css +1 -1
  30. package/lib/ui/index.js +4 -2
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-link/style/style.css +1 -1
  35. package/lib/vxe-link/style/style.min.css +1 -1
  36. package/lib/vxe-text-ellipsis/style/style.css +47 -3
  37. package/lib/vxe-text-ellipsis/style/style.min.css +1 -1
  38. package/package.json +2 -2
  39. package/packages/link/src/link.ts +2 -0
  40. package/packages/table-select/src/table-select.ts +7 -5
  41. package/packages/text-ellipsis/src/text-ellipsis.ts +53 -8
  42. package/packages/ui/index.ts +3 -1
  43. package/styles/components/link.scss +1 -1
  44. package/styles/components/text-ellipsis.scss +22 -3
  45. package/types/components/table.d.ts +1 -2
  46. package/types/components/text-ellipsis.d.ts +17 -1
  47. /package/es/icon/{iconfont.1739528185252.ttf → iconfont.1739698284242.ttf} +0 -0
  48. /package/es/icon/{iconfont.1739528185252.woff → iconfont.1739698284242.woff} +0 -0
  49. /package/es/icon/{iconfont.1739528185252.woff2 → iconfont.1739698284242.woff2} +0 -0
  50. /package/es/{iconfont.1739528185252.ttf → iconfont.1739698284242.ttf} +0 -0
  51. /package/es/{iconfont.1739528185252.woff → iconfont.1739698284242.woff} +0 -0
  52. /package/es/{iconfont.1739528185252.woff2 → iconfont.1739698284242.woff2} +0 -0
  53. /package/lib/icon/style/{iconfont.1739528185252.ttf → iconfont.1739698284242.ttf} +0 -0
  54. /package/lib/icon/style/{iconfont.1739528185252.woff → iconfont.1739698284242.woff} +0 -0
  55. /package/lib/icon/style/{iconfont.1739528185252.woff2 → iconfont.1739698284242.woff2} +0 -0
  56. /package/lib/{iconfont.1739528185252.ttf → iconfont.1739698284242.ttf} +0 -0
  57. /package/lib/{iconfont.1739528185252.woff → iconfont.1739698284242.woff} +0 -0
  58. /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-reality'
245
+ class: 'vxe-text-ellipsis--reality'
199
246
  }),
200
- h('span', {
201
- class: 'vxe-text-ellipsis-content'
202
- }, visibleContent)
247
+ $xeTextEllipsis.renderContent(h)
203
248
  ])
204
249
  }
205
250
  },
@@ -300,7 +300,9 @@ setConfig({
300
300
  },
301
301
  tabs: {},
302
302
  tag: {},
303
- textEllipsis: {},
303
+ textEllipsis: {
304
+ underline: true
305
+ },
304
306
  text: {},
305
307
  textarea: {
306
308
  resize: 'none'
@@ -54,8 +54,8 @@ $btnThemeList: (
54
54
 
55
55
  .vxe-link {
56
56
  text-decoration: none;
57
+ color: inherit;
57
58
  &:not(.is--disabled) {
58
- color: var(--vxe-ui-font-color);
59
59
  cursor: pointer;
60
60
  &:hover {
61
61
  color: var(--vxe-ui-font-primary-color);
@@ -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-reality {
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 {
@@ -980,8 +980,7 @@ export namespace VxeTablePropTypes {
980
980
  height?: number
981
981
  padding?: boolean
982
982
  /**
983
- * @deprecated
984
- * @private
983
+ * 展开内容的显示模式
985
984
  */
986
985
  mode?: 'inside' | 'fixed' | '' | null
987
986
  loadMethod?(params: {
@@ -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
  }