vxe-pc-ui 4.9.16 → 4.9.18
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/image/src/preview.js +8 -2
- package/es/input/src/input.js +8 -1
- package/es/number-input/src/number-input.js +8 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/text/src/text.js +56 -36
- package/es/text/style.css +77 -4
- package/es/text/style.min.css +1 -1
- package/es/ui/index.js +6 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-text/style.css +77 -4
- package/es/vxe-text/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/image/src/preview.js +10 -2
- package/lib/image/src/preview.min.js +1 -1
- package/lib/index.umd.js +97 -45
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +10 -1
- package/lib/input/src/input.min.js +1 -1
- package/lib/number-input/src/number-input.js +10 -1
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/text/src/text.js +60 -38
- package/lib/text/src/text.min.js +1 -1
- package/lib/text/style/style.css +77 -4
- package/lib/text/style/style.min.css +1 -1
- package/lib/ui/index.js +6 -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-text/style/style.css +77 -4
- package/lib/vxe-text/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/image/src/preview.ts +8 -2
- package/packages/input/src/input.ts +10 -2
- package/packages/number-input/src/number-input.ts +10 -6
- package/packages/text/src/text.ts +59 -36
- package/packages/ui/index.ts +5 -1
- package/styles/components/text.scss +21 -6
- package/types/components/countdown.d.ts +8 -0
- package/types/components/text.d.ts +12 -5
- /package/es/icon/{iconfont.1757082114285.ttf → iconfont.1757160944209.ttf} +0 -0
- /package/es/icon/{iconfont.1757082114285.woff → iconfont.1757160944209.woff} +0 -0
- /package/es/icon/{iconfont.1757082114285.woff2 → iconfont.1757160944209.woff2} +0 -0
- /package/es/{iconfont.1757082114285.ttf → iconfont.1757160944209.ttf} +0 -0
- /package/es/{iconfont.1757082114285.woff → iconfont.1757160944209.woff} +0 -0
- /package/es/{iconfont.1757082114285.woff2 → iconfont.1757160944209.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1757082114285.ttf → iconfont.1757160944209.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1757082114285.woff → iconfont.1757160944209.woff} +0 -0
- /package/lib/icon/style/{iconfont.1757082114285.woff2 → iconfont.1757160944209.woff2} +0 -0
- /package/lib/{iconfont.1757082114285.ttf → iconfont.1757160944209.ttf} +0 -0
- /package/lib/{iconfont.1757082114285.woff → iconfont.1757160944209.woff} +0 -0
- /package/lib/{iconfont.1757082114285.woff2 → iconfont.1757160944209.woff2} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, h, reactive, PropType, VNode } from 'vue'
|
|
1
|
+
import { ref, h, reactive, PropType, VNode, computed } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI, getConfig, getIcon, getI18n, useSize, createEvent } from '../../ui'
|
|
@@ -19,14 +19,7 @@ export default defineVxeComponent({
|
|
|
19
19
|
type: Boolean as PropType<VxeTextPropTypes.ClickToCopy>,
|
|
20
20
|
default: () => getConfig().text.clickToCopy
|
|
21
21
|
},
|
|
22
|
-
|
|
23
|
-
type: String as PropType<VxeTextPropTypes.CopyIcon>,
|
|
24
|
-
default: () => getConfig().text.copyIcon
|
|
25
|
-
},
|
|
26
|
-
copyLayout: {
|
|
27
|
-
type: String as PropType<VxeTextPropTypes.CopyLayout>,
|
|
28
|
-
default: () => getConfig().text.copyLayout
|
|
29
|
-
},
|
|
22
|
+
copyConfig: Object as PropType<VxeTextPropTypes.CopyConfig>,
|
|
30
23
|
size: {
|
|
31
24
|
type: String as PropType<VxeTextPropTypes.Size>,
|
|
32
25
|
default: () => getConfig().text.size || getConfig().size
|
|
@@ -34,8 +27,11 @@ export default defineVxeComponent({
|
|
|
34
27
|
},
|
|
35
28
|
emits: [
|
|
36
29
|
'click',
|
|
30
|
+
'dblclick',
|
|
37
31
|
'prefix-click',
|
|
38
|
-
'suffix-click'
|
|
32
|
+
'suffix-click',
|
|
33
|
+
'copy-success',
|
|
34
|
+
'copy-error'
|
|
39
35
|
] as VxeTextEmits,
|
|
40
36
|
setup (props, context) {
|
|
41
37
|
const { emit, slots } = context
|
|
@@ -50,6 +46,10 @@ export default defineVxeComponent({
|
|
|
50
46
|
const reactData = reactive<TextReactData>({
|
|
51
47
|
})
|
|
52
48
|
|
|
49
|
+
const computeCopyOpts = computed(() => {
|
|
50
|
+
return Object.assign({}, getConfig().text.copyConfig, props.copyConfig)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
53
|
const refMaps: TextPrivateRef = {
|
|
54
54
|
refElem
|
|
55
55
|
}
|
|
@@ -57,31 +57,49 @@ export default defineVxeComponent({
|
|
|
57
57
|
const computeMaps: VxeTextPrivateComputed = {
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const
|
|
61
|
-
const { content
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
60
|
+
const handleCopy = (evnt: MouseEvent) => {
|
|
61
|
+
const { content } = props
|
|
62
|
+
const copyOpts = computeCopyOpts.value
|
|
63
|
+
const { showMessage } = copyOpts
|
|
64
|
+
const contentEl = refContentElem.value
|
|
65
|
+
const copyVal = (contentEl ? contentEl.textContent : '') || content
|
|
66
|
+
if (copyVal) {
|
|
67
|
+
if (VxeUI.clipboard.copy(copyVal)) {
|
|
68
|
+
if (showMessage && VxeUI.modal) {
|
|
69
|
+
VxeUI.modal.message({
|
|
70
|
+
content: getI18n('vxe.text.copySuccess'),
|
|
71
|
+
status: 'success'
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
dispatchEvent('copy-success', {}, evnt)
|
|
75
|
+
} else {
|
|
76
|
+
if (showMessage && VxeUI.modal) {
|
|
77
|
+
VxeUI.modal.message({
|
|
78
|
+
content: getI18n('vxe.text.copyError'),
|
|
79
|
+
status: 'error'
|
|
80
|
+
})
|
|
80
81
|
}
|
|
82
|
+
dispatchEvent('copy-error', {}, evnt)
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
const clickIconEvent = (evnt: MouseEvent) => {
|
|
88
|
+
const { clickToCopy } = props
|
|
89
|
+
const copyOpts = computeCopyOpts.value
|
|
90
|
+
if (clickToCopy && copyOpts.trigger !== 'dblclick') {
|
|
91
|
+
handleCopy(evnt)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const dblclickIconEvent = (evnt: MouseEvent) => {
|
|
96
|
+
const { clickToCopy } = props
|
|
97
|
+
const copyOpts = computeCopyOpts.value
|
|
98
|
+
if (clickToCopy && copyOpts.trigger === 'dblclick') {
|
|
99
|
+
handleCopy(evnt)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
85
103
|
const $xeText = {
|
|
86
104
|
xID,
|
|
87
105
|
props,
|
|
@@ -127,24 +145,29 @@ export default defineVxeComponent({
|
|
|
127
145
|
Object.assign($xeText, textMethods, textPrivateMethods)
|
|
128
146
|
|
|
129
147
|
const renderCopyIcon = () => {
|
|
130
|
-
const
|
|
148
|
+
const copyOpts = computeCopyOpts.value
|
|
149
|
+
const { icon, status } = copyOpts
|
|
131
150
|
return h('span', {
|
|
132
151
|
key: 'ci',
|
|
133
|
-
class: 'vxe-text--copy-icon',
|
|
134
|
-
|
|
152
|
+
class: ['vxe-text--copy-icon', {
|
|
153
|
+
[`theme--${status}`]: status
|
|
154
|
+
}],
|
|
155
|
+
onClick: clickIconEvent,
|
|
156
|
+
onDblclick: dblclickIconEvent
|
|
135
157
|
}, [
|
|
136
158
|
h('i', {
|
|
137
|
-
class:
|
|
159
|
+
class: icon || getIcon().TEXT_COPY
|
|
138
160
|
})
|
|
139
161
|
])
|
|
140
162
|
}
|
|
141
163
|
|
|
142
164
|
const renderContent = () => {
|
|
143
|
-
const { loading, icon, prefixIcon, suffixIcon, clickToCopy, content
|
|
165
|
+
const { loading, icon, prefixIcon, suffixIcon, clickToCopy, content } = props
|
|
166
|
+
const copyOpts = computeCopyOpts.value
|
|
144
167
|
const defaultSlot = slots.default
|
|
145
168
|
const prefixIconSlot = slots.prefixIcon || slots['prefix-icon'] || slots.icon
|
|
146
169
|
const suffixIconSlot = slots.suffixIcon || slots['suffix-icon']
|
|
147
|
-
const copyToRight =
|
|
170
|
+
const copyToRight = copyOpts.layout === 'right'
|
|
148
171
|
const contVNs: VNode[] = []
|
|
149
172
|
if (loading) {
|
|
150
173
|
contVNs.push(
|
package/packages/ui/index.ts
CHANGED
|
@@ -61,21 +61,36 @@ $btnThemeList: (
|
|
|
61
61
|
color: map.get($item, textColor);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.vxe-text--copy-icon {
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
&:focus {
|
|
69
|
+
color: var(--vxe-ui-font-darken-color);
|
|
70
|
+
}
|
|
71
|
+
&:hover {
|
|
72
|
+
color: var(--vxe-ui-font-primary-lighten-color);
|
|
73
|
+
}
|
|
74
|
+
&:active {
|
|
75
|
+
color: var(--vxe-ui-font-primary-darken-color);
|
|
76
|
+
}
|
|
77
|
+
@for $index from 0 to list.length($btnThemeList) {
|
|
78
|
+
$item: list.nth($btnThemeList, $index + 1);
|
|
79
|
+
&.theme--#{map.get($item, name)} {
|
|
80
|
+
color: map.get($item, textColor);
|
|
67
81
|
&:focus {
|
|
68
|
-
color:
|
|
82
|
+
color: map.get($item, btnDarkenColor);
|
|
69
83
|
}
|
|
70
84
|
&:hover {
|
|
71
|
-
color:
|
|
85
|
+
color: map.get($item, btnLightenColor);
|
|
72
86
|
}
|
|
73
87
|
&:active {
|
|
74
|
-
color:
|
|
88
|
+
color: map.get($item, btnDarkenColor);
|
|
75
89
|
}
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
92
|
}
|
|
93
|
+
|
|
79
94
|
.vxe-text--loading,
|
|
80
95
|
.vxe-text--prefix-icon,
|
|
81
96
|
.vxe-text--suffix-icon,
|
|
@@ -94,10 +94,18 @@ export namespace VxeCountdownSlotTypes {
|
|
|
94
94
|
diffConf: DateDiffResult
|
|
95
95
|
currentValue: number
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
export interface PrefixSlotParams {
|
|
99
|
+
diffConf: DateDiffResult
|
|
100
|
+
currentValue: number
|
|
101
|
+
}
|
|
102
|
+
export interface SuffixSlotParams extends PrefixSlotParams {}
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
export interface VxeCountdownSlots {
|
|
100
106
|
default?: (params: VxeCountdownSlotTypes.DefaultSlotParams) => any
|
|
107
|
+
prefix?: (params: VxeCountdownSlotTypes.PrefixSlotParams) => any
|
|
108
|
+
suffix?: (params: VxeCountdownSlotTypes.SuffixSlotParams) => any
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
export const Countdown: typeof VxeCountdown
|
|
@@ -30,10 +30,15 @@ export namespace VxeTextPropTypes {
|
|
|
30
30
|
export type SuffixIcon = string
|
|
31
31
|
export type Loading = boolean
|
|
32
32
|
export type Content = string | number
|
|
33
|
-
export type CopyIcon = string
|
|
34
33
|
export type ClickToCopy = boolean
|
|
35
|
-
export type CopyLayout = 'left' | 'right' | '' | null
|
|
36
34
|
export type Size = VxeComponentSizeType
|
|
35
|
+
export interface CopyConfig {
|
|
36
|
+
layout?: 'left' | 'right' | '' | null
|
|
37
|
+
showMessage?: boolean
|
|
38
|
+
trigger?: 'click' | 'dblclick'
|
|
39
|
+
icon?: string
|
|
40
|
+
status?: VxeComponentStatusType
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
export type VxeTextProps = {
|
|
@@ -53,9 +58,8 @@ export type VxeTextProps = {
|
|
|
53
58
|
suffixIcon?: VxeTextPropTypes.SuffixIcon
|
|
54
59
|
loading?: VxeTextPropTypes.Loading
|
|
55
60
|
content?: VxeTextPropTypes.Content
|
|
56
|
-
copyIcon?: VxeTextPropTypes.CopyIcon
|
|
57
61
|
clickToCopy?: VxeTextPropTypes.ClickToCopy
|
|
58
|
-
|
|
62
|
+
copyConfig?: VxeTextPropTypes.CopyConfig
|
|
59
63
|
size?: VxeTextPropTypes.Size
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -76,8 +80,11 @@ export interface VxeTextPrivateMethods extends TextPrivateMethods { }
|
|
|
76
80
|
|
|
77
81
|
export type VxeTextEmits = [
|
|
78
82
|
'click',
|
|
83
|
+
'dblclick',
|
|
79
84
|
'prefix-click',
|
|
80
|
-
'suffix-click'
|
|
85
|
+
'suffix-click',
|
|
86
|
+
'copy-success',
|
|
87
|
+
'copy-error'
|
|
81
88
|
]
|
|
82
89
|
|
|
83
90
|
export namespace VxeTextDefines {
|
|
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
|