vxe-pc-ui 4.11.27 → 4.11.29
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/README.md +6 -0
- package/es/backtop/index.js +12 -0
- package/es/backtop/src/backtop.js +231 -0
- package/es/backtop/style.css +90 -0
- package/es/backtop/style.min.css +1 -0
- package/es/cascader/index.js +12 -0
- package/es/cascader/src/cascader.js +669 -0
- package/es/cascader/style.css +168 -0
- package/es/cascader/style.min.css +1 -0
- package/es/components.js +18 -0
- package/es/date-range-picker/src/date-range-picker.js +2 -1
- package/es/form/render/index.js +3 -3
- package/es/form/src/render.js +4 -2
- package/es/form/style.css +5 -2
- package/es/form/style.min.css +1 -1
- package/es/icon/{iconfont.1767168857404.ttf → iconfont.1767441272505.ttf} +0 -0
- package/es/icon/iconfont.1767441272505.woff +0 -0
- package/es/icon/iconfont.1767441272505.woff2 +0 -0
- package/es/icon/style.css +9 -1
- package/es/icon/style.min.css +1 -1
- package/{lib/icon/style/iconfont.1767168857404.ttf → es/iconfont.1767441272505.ttf} +0 -0
- package/es/iconfont.1767441272505.woff +0 -0
- package/es/iconfont.1767441272505.woff2 +0 -0
- package/es/layout-body/src/layout-body.js +39 -6
- package/es/mention/index.js +12 -0
- package/es/mention/src/mention.js +51 -0
- package/es/mention/style.css +0 -0
- package/es/mention/style.min.css +0 -0
- package/es/radio/src/button.js +7 -5
- package/es/radio/src/group.js +3 -2
- package/es/radio/src/radio.js +3 -2
- package/es/segmented/index.js +12 -0
- package/es/segmented/src/segmented.js +218 -0
- package/es/segmented/style.css +195 -0
- package/es/segmented/style.min.css +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +1 -4
- package/es/timeline/index.js +12 -0
- package/es/timeline/src/timeline-item.js +46 -0
- package/es/timeline/src/timeline.js +51 -0
- package/es/timeline/style.css +0 -0
- package/es/timeline/style.min.css +0 -0
- package/es/timeline-item/index.js +12 -0
- package/es/timeline-item/style.css +0 -0
- package/es/timeline-item/style.min.css +0 -0
- package/es/tour/index.js +12 -0
- package/es/tour/src/tour.js +51 -0
- package/es/tour/style.css +0 -0
- package/es/tour/style.min.css +0 -0
- package/es/ui/index.js +15 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-backtop/index.js +3 -0
- package/es/vxe-backtop/style.css +90 -0
- package/es/vxe-backtop/style.min.css +1 -0
- package/es/vxe-cascader/index.js +3 -0
- package/es/vxe-cascader/style.css +168 -0
- package/es/vxe-cascader/style.min.css +1 -0
- package/es/vxe-form/style.css +5 -2
- package/es/vxe-form/style.min.css +1 -1
- package/es/vxe-icon/style.css +9 -1
- package/es/vxe-icon/style.min.css +1 -1
- package/es/vxe-mention/index.js +3 -0
- package/es/vxe-mention/style.css +0 -0
- package/es/vxe-mention/style.min.css +0 -0
- package/es/vxe-segmented/index.js +3 -0
- package/es/vxe-segmented/style.css +195 -0
- package/es/vxe-segmented/style.min.css +1 -0
- package/es/vxe-timeline/index.js +3 -0
- package/es/vxe-timeline/style.css +0 -0
- package/es/vxe-timeline/style.min.css +0 -0
- package/es/vxe-timeline-item/index.js +3 -0
- package/es/vxe-timeline-item/style.css +0 -0
- package/es/vxe-timeline-item/style.min.css +0 -0
- package/es/vxe-tour/index.js +3 -0
- package/es/vxe-tour/style.css +0 -0
- package/es/vxe-tour/style.min.css +0 -0
- package/lib/backtop/index.js +19 -0
- package/lib/backtop/index.min.js +1 -0
- package/lib/backtop/src/backtop.js +256 -0
- package/lib/backtop/src/backtop.min.js +1 -0
- package/lib/backtop/style/index.js +1 -0
- package/lib/backtop/style/style.css +90 -0
- package/lib/backtop/style/style.min.css +1 -0
- package/lib/cascader/index.js +19 -0
- package/lib/cascader/index.min.js +1 -0
- package/lib/cascader/src/cascader.js +723 -0
- package/lib/cascader/src/cascader.min.js +1 -0
- package/lib/cascader/style/index.js +1 -0
- package/lib/cascader/style/style.css +168 -0
- package/lib/cascader/style/style.min.css +1 -0
- package/lib/components.js +73 -1
- package/lib/components.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +5 -1
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/form/render/index.js +6 -3
- package/lib/form/render/index.min.js +1 -1
- package/lib/form/src/render.js +4 -1
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/style/style.css +5 -2
- package/lib/form/style/style.min.css +1 -1
- package/lib/{iconfont.1767168857404.ttf → icon/style/iconfont.1767441272505.ttf} +0 -0
- package/lib/icon/style/iconfont.1767441272505.woff +0 -0
- package/lib/icon/style/iconfont.1767441272505.woff2 +0 -0
- package/lib/icon/style/style.css +9 -1
- package/lib/icon/style/style.min.css +9 -1
- package/{es/iconfont.1767168857404.ttf → lib/iconfont.1767441272505.ttf} +0 -0
- package/lib/iconfont.1767441272505.woff +0 -0
- package/lib/iconfont.1767441272505.woff2 +0 -0
- package/lib/index.umd.js +5250 -3708
- package/lib/index.umd.min.js +1 -1
- package/lib/layout-body/src/layout-body.js +34 -4
- package/lib/layout-body/src/layout-body.min.js +1 -1
- package/lib/mention/index.js +19 -0
- package/lib/mention/index.min.js +1 -0
- package/lib/mention/src/mention.js +62 -0
- package/lib/mention/src/mention.min.js +1 -0
- package/lib/mention/style/index.js +1 -0
- package/lib/mention/style/style.css +0 -0
- package/lib/mention/style/style.min.css +0 -0
- package/lib/radio/src/button.js +15 -8
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/group.js +7 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/radio/src/radio.js +7 -2
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/segmented/index.js +19 -0
- package/lib/segmented/index.min.js +1 -0
- package/lib/segmented/src/segmented.js +237 -0
- package/lib/segmented/src/segmented.min.js +1 -0
- package/lib/segmented/style/index.js +1 -0
- package/lib/segmented/style/style.css +195 -0
- package/lib/segmented/style/style.min.css +1 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +1 -5
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/timeline/index.js +19 -0
- package/lib/timeline/index.min.js +1 -0
- package/lib/timeline/src/timeline-item.js +57 -0
- package/lib/timeline/src/timeline-item.min.js +1 -0
- package/lib/timeline/src/timeline.js +62 -0
- package/lib/timeline/src/timeline.min.js +1 -0
- package/lib/timeline/style/index.js +1 -0
- package/lib/timeline/style/style.css +0 -0
- package/lib/timeline/style/style.min.css +0 -0
- package/lib/timeline-item/index.js +19 -0
- package/lib/timeline-item/index.min.js +1 -0
- package/lib/timeline-item/style/index.js +1 -0
- package/lib/timeline-item/style/style.css +0 -0
- package/lib/timeline-item/style/style.min.css +0 -0
- package/lib/tour/index.js +19 -0
- package/lib/tour/index.min.js +1 -0
- package/lib/tour/src/tour.js +62 -0
- package/lib/tour/src/tour.min.js +1 -0
- package/lib/tour/style/index.js +1 -0
- package/lib/tour/style/style.css +0 -0
- package/lib/tour/style/style.min.css +0 -0
- package/lib/ui/index.js +15 -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-backtop/index.js +22 -0
- package/lib/vxe-backtop/index.min.js +1 -0
- package/lib/vxe-backtop/style/index.js +1 -0
- package/lib/vxe-backtop/style/style.css +90 -0
- package/lib/vxe-backtop/style/style.min.css +1 -0
- package/lib/vxe-cascader/index.js +22 -0
- package/lib/vxe-cascader/index.min.js +1 -0
- package/lib/vxe-cascader/style/index.js +1 -0
- package/lib/vxe-cascader/style/style.css +168 -0
- package/lib/vxe-cascader/style/style.min.css +1 -0
- package/lib/vxe-form/style/style.css +5 -2
- package/lib/vxe-form/style/style.min.css +1 -1
- package/lib/vxe-icon/style/style.css +9 -1
- package/lib/vxe-icon/style/style.min.css +1 -1
- package/lib/vxe-mention/index.js +22 -0
- package/lib/vxe-mention/index.min.js +1 -0
- package/lib/vxe-mention/style/index.js +1 -0
- package/lib/vxe-mention/style/style.css +0 -0
- package/lib/vxe-mention/style/style.min.css +0 -0
- package/lib/vxe-segmented/index.js +22 -0
- package/lib/vxe-segmented/index.min.js +1 -0
- package/lib/vxe-segmented/style/index.js +1 -0
- package/lib/vxe-segmented/style/style.css +195 -0
- package/lib/vxe-segmented/style/style.min.css +1 -0
- package/lib/vxe-timeline/index.js +22 -0
- package/lib/vxe-timeline/index.min.js +1 -0
- package/lib/vxe-timeline/style/index.js +1 -0
- package/lib/vxe-timeline/style/style.css +0 -0
- package/lib/vxe-timeline/style/style.min.css +0 -0
- package/lib/vxe-timeline-item/index.js +22 -0
- package/lib/vxe-timeline-item/index.min.js +1 -0
- package/lib/vxe-timeline-item/style/index.js +1 -0
- package/lib/vxe-timeline-item/style/style.css +0 -0
- package/lib/vxe-timeline-item/style/style.min.css +0 -0
- package/lib/vxe-tour/index.js +22 -0
- package/lib/vxe-tour/index.min.js +1 -0
- package/lib/vxe-tour/style/index.js +1 -0
- package/lib/vxe-tour/style/style.css +0 -0
- package/lib/vxe-tour/style/style.min.css +0 -0
- package/package.json +1 -1
- package/packages/backtop/index.ts +16 -0
- package/packages/backtop/src/backtop.ts +264 -0
- package/packages/cascader/index.ts +16 -0
- package/packages/cascader/src/cascader.ts +739 -0
- package/packages/components.ts +18 -0
- package/packages/date-range-picker/src/date-range-picker.ts +2 -1
- package/packages/form/render/index.ts +3 -3
- package/packages/form/src/render.ts +4 -2
- package/packages/layout-body/src/layout-body.ts +43 -9
- package/packages/mention/index.ts +16 -0
- package/packages/mention/src/mention.ts +71 -0
- package/packages/radio/src/button.ts +9 -6
- package/packages/radio/src/group.ts +3 -2
- package/packages/radio/src/radio.ts +3 -2
- package/packages/segmented/index.ts +16 -0
- package/packages/segmented/src/segmented.ts +254 -0
- package/packages/tabs/src/tabs.ts +1 -4
- package/packages/timeline/index.ts +16 -0
- package/packages/timeline/src/timeline-item.ts +67 -0
- package/packages/timeline/src/timeline.ts +71 -0
- package/packages/timeline-item/index.ts +16 -0
- package/packages/tour/index.ts +16 -0
- package/packages/tour/src/tour.ts +71 -0
- package/packages/ui/index.ts +15 -1
- package/styles/all.scss +7 -0
- package/styles/components/backtop.scss +111 -0
- package/styles/components/cascader.scss +140 -0
- package/styles/components/form.scss +7 -2
- package/styles/components/icon.scss +9 -2
- package/styles/components/mention.scss +0 -0
- package/styles/components/segmented.scss +214 -0
- package/styles/components/timeline-item.scss +0 -0
- package/styles/components/timeline.scss +0 -0
- package/styles/components/tour.scss +0 -0
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/theme/base.scss +6 -0
- package/types/all.d.ts +21 -0
- package/types/components/backtop.d.ts +111 -0
- package/types/components/cascader.d.ts +255 -0
- package/types/components/date-range-picker.d.ts +3 -1
- package/types/components/form.d.ts +4 -0
- package/types/components/icon.d.ts +2 -2
- package/types/components/layout-body.d.ts +9 -0
- package/types/components/list.d.ts +2 -2
- package/types/components/mention.d.ts +77 -0
- package/types/components/radio-group.d.ts +2 -1
- package/types/components/rate.d.ts +1 -1
- package/types/components/segmented.d.ts +123 -0
- package/types/components/select.d.ts +1 -1
- package/types/components/table.d.ts +15 -6
- package/types/components/timeline-item.d.ts +75 -0
- package/types/components/timeline.d.ts +77 -0
- package/types/components/tour.d.ts +77 -0
- package/types/components/tree-select.d.ts +1 -1
- package/types/components/tree.d.ts +1 -1
- package/types/ui/global-config.d.ts +14 -0
- package/types/ui/global-icon.d.ts +3 -0
- package/es/icon/iconfont.1767168857404.woff +0 -0
- package/es/icon/iconfont.1767168857404.woff2 +0 -0
- package/es/iconfont.1767168857404.woff +0 -0
- package/es/iconfont.1767168857404.woff2 +0 -0
- package/lib/icon/style/iconfont.1767168857404.woff +0 -0
- package/lib/icon/style/iconfont.1767168857404.woff2 +0 -0
- package/lib/iconfont.1767168857404.woff +0 -0
- package/lib/iconfont.1767168857404.woff2 +0 -0
package/README.md
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
* [x] anchor 锚点
|
|
70
70
|
* [x] anchor-link 锚点-链接
|
|
71
71
|
* [x] avatar 头像
|
|
72
|
+
* [ ] backtop 回到顶部
|
|
72
73
|
* [x] badge 徽标
|
|
73
74
|
* [x] breadcrumb 面包屑
|
|
74
75
|
* [x] breadcrumb-item 面包屑-项
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
* [x] card 卡片
|
|
79
80
|
* [x] carousel 走马灯
|
|
80
81
|
* [x] carousel-item 走马灯 - 项
|
|
82
|
+
* [ ] cascader 级联选择器
|
|
81
83
|
* [x] checkbox 复选框
|
|
82
84
|
* [x] checkbox-button 复选框-按钮
|
|
83
85
|
* [x] checkbox-group 复选框-组
|
|
@@ -107,6 +109,7 @@
|
|
|
107
109
|
* [x] link 链接
|
|
108
110
|
* [x] list 虚拟列表
|
|
109
111
|
* [x] loading 加载中
|
|
112
|
+
* [ ] mention 提及
|
|
110
113
|
* [x] menu 菜单
|
|
111
114
|
* [x] modal 模态窗口
|
|
112
115
|
* [x] number-input 数值输入框
|
|
@@ -121,6 +124,7 @@
|
|
|
121
124
|
* [x] rate 评分
|
|
122
125
|
* [x] result 结果
|
|
123
126
|
* [x] row 行
|
|
127
|
+
* [ ] segmented 分段控制器
|
|
124
128
|
* [x] select 下拉框
|
|
125
129
|
* [x] optgroup 下拉框-分组项
|
|
126
130
|
* [x] option 下拉框-项
|
|
@@ -134,6 +138,8 @@
|
|
|
134
138
|
* [x] text-ellipsis 多行文本溢出
|
|
135
139
|
* [x] table-select 表格下拉框
|
|
136
140
|
* [x] textarea 文本域
|
|
141
|
+
* [ ] timeline 时间线
|
|
142
|
+
* [ ] timeline-item 时间线-项
|
|
137
143
|
* [x] tip 提示
|
|
138
144
|
* [x] tooltip 文字提示
|
|
139
145
|
* [x] tree 树形组件
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VxeUI } from '@vxe-ui/core';
|
|
2
|
+
import VxeBacktopComponent from './src/backtop';
|
|
3
|
+
import { dynamicApp } from '../dynamics';
|
|
4
|
+
export const VxeBacktop = Object.assign({}, VxeBacktopComponent, {
|
|
5
|
+
install(app) {
|
|
6
|
+
app.component(VxeBacktopComponent.name, VxeBacktopComponent);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
dynamicApp.use(VxeBacktop);
|
|
10
|
+
VxeUI.component(VxeBacktopComponent);
|
|
11
|
+
export const Backtop = VxeBacktop;
|
|
12
|
+
export default VxeBacktop;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { ref, h, reactive, watch, onMounted, nextTick, computed, onBeforeUnmount, onUnmounted } from 'vue';
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
|
+
import XEUtils from 'xe-utils';
|
|
4
|
+
import { getConfig, getIcon, createEvent, useSize, renderEmptyElement } from '../../ui';
|
|
5
|
+
import { errLog } from '../../ui/src/log';
|
|
6
|
+
import { toCssUnit } from '../../ui/src/dom';
|
|
7
|
+
function createInternalData() {
|
|
8
|
+
return {
|
|
9
|
+
targetEl: null
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function createReactData() {
|
|
13
|
+
return {
|
|
14
|
+
showBtn: false
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export default defineVxeComponent({
|
|
18
|
+
name: 'VxeBacktop',
|
|
19
|
+
props: {
|
|
20
|
+
target: String,
|
|
21
|
+
size: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: () => getConfig().backtop.size || getConfig().size
|
|
24
|
+
},
|
|
25
|
+
circle: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: () => getConfig().backtop.circle
|
|
28
|
+
},
|
|
29
|
+
right: {
|
|
30
|
+
type: [String, Number],
|
|
31
|
+
default: () => getConfig().backtop.right
|
|
32
|
+
},
|
|
33
|
+
bottom: {
|
|
34
|
+
type: [String, Number],
|
|
35
|
+
default: () => getConfig().backtop.bottom
|
|
36
|
+
},
|
|
37
|
+
status: {
|
|
38
|
+
type: [String, Number],
|
|
39
|
+
default: () => getConfig().backtop.status
|
|
40
|
+
},
|
|
41
|
+
icon: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: () => getConfig().backtop.icon
|
|
44
|
+
},
|
|
45
|
+
showIcon: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: () => getConfig().backtop.showIcon
|
|
48
|
+
},
|
|
49
|
+
content: {
|
|
50
|
+
type: [String, Number],
|
|
51
|
+
default: () => getConfig().backtop.content
|
|
52
|
+
},
|
|
53
|
+
showContent: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: () => getConfig().backtop.showContent
|
|
56
|
+
},
|
|
57
|
+
zIndex: {
|
|
58
|
+
type: [String, Number],
|
|
59
|
+
default: () => getConfig().backtop.zIndex
|
|
60
|
+
},
|
|
61
|
+
threshold: {
|
|
62
|
+
type: [String, Number],
|
|
63
|
+
default: () => getConfig().backtop.threshold
|
|
64
|
+
},
|
|
65
|
+
position: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: () => getConfig().backtop.position
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
emits: [
|
|
71
|
+
'click'
|
|
72
|
+
],
|
|
73
|
+
setup(props, context) {
|
|
74
|
+
const { slots, emit } = context;
|
|
75
|
+
const xID = XEUtils.uniqueId();
|
|
76
|
+
const refElem = ref();
|
|
77
|
+
const { computeSize } = useSize(props);
|
|
78
|
+
const internalData = createInternalData();
|
|
79
|
+
const reactData = reactive(createReactData());
|
|
80
|
+
const refMaps = {
|
|
81
|
+
refElem
|
|
82
|
+
};
|
|
83
|
+
const computeWrapperStyle = computed(() => {
|
|
84
|
+
const { right, bottom, zIndex } = props;
|
|
85
|
+
const stys = {};
|
|
86
|
+
if (right) {
|
|
87
|
+
stys.right = toCssUnit(right);
|
|
88
|
+
}
|
|
89
|
+
if (bottom) {
|
|
90
|
+
stys.bottom = toCssUnit(bottom);
|
|
91
|
+
}
|
|
92
|
+
if (zIndex) {
|
|
93
|
+
stys.zIndex = zIndex;
|
|
94
|
+
}
|
|
95
|
+
return stys;
|
|
96
|
+
});
|
|
97
|
+
const computeMaps = {};
|
|
98
|
+
const $xeBacktop = {
|
|
99
|
+
xID,
|
|
100
|
+
props,
|
|
101
|
+
context,
|
|
102
|
+
internalData,
|
|
103
|
+
reactData,
|
|
104
|
+
getRefMaps: () => refMaps,
|
|
105
|
+
getComputeMaps: () => computeMaps
|
|
106
|
+
};
|
|
107
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
108
|
+
emit(type, createEvent(evnt, { $backtop: $xeBacktop }, params));
|
|
109
|
+
};
|
|
110
|
+
const handleScrollEvent = (evnt) => {
|
|
111
|
+
const { threshold } = props;
|
|
112
|
+
const currentEl = evnt.currentTarget;
|
|
113
|
+
const scrollTop = currentEl.scrollTop;
|
|
114
|
+
reactData.showBtn = scrollTop > Math.max(1, XEUtils.toNumber(threshold));
|
|
115
|
+
};
|
|
116
|
+
const handleToTop = () => {
|
|
117
|
+
const { targetEl } = internalData;
|
|
118
|
+
if (!targetEl) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const scrollTop = targetEl.scrollTop;
|
|
122
|
+
if (scrollTop > 0) {
|
|
123
|
+
requestAnimationFrame(handleToTop);
|
|
124
|
+
const currScrollTop = scrollTop - Math.max(12, scrollTop / 6);
|
|
125
|
+
targetEl.scrollTop = currScrollTop > 10 ? currScrollTop : 0;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const removeScrollEvent = () => {
|
|
129
|
+
const { targetEl } = internalData;
|
|
130
|
+
if (targetEl) {
|
|
131
|
+
targetEl.removeEventListener('scroll', handleScrollEvent);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const addScrollEvent = () => {
|
|
135
|
+
const { targetEl } = internalData;
|
|
136
|
+
if (targetEl) {
|
|
137
|
+
targetEl.addEventListener('scroll', handleScrollEvent, { passive: true });
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const handleTargetElement = () => {
|
|
141
|
+
nextTick(() => {
|
|
142
|
+
const { target } = props;
|
|
143
|
+
if (!target) {
|
|
144
|
+
removeScrollEvent();
|
|
145
|
+
errLog('vxe.error.reqProp', ['target']);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (XEUtils.isString(target)) {
|
|
149
|
+
const tEl = document.querySelector(target);
|
|
150
|
+
if (!tEl) {
|
|
151
|
+
errLog('vxe.error.errProp', [`target=${target}`, 'body']);
|
|
152
|
+
}
|
|
153
|
+
const { targetEl } = internalData;
|
|
154
|
+
if (targetEl !== tEl) {
|
|
155
|
+
removeScrollEvent();
|
|
156
|
+
internalData.targetEl = tEl;
|
|
157
|
+
addScrollEvent();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
const clickEvent = (evnt) => {
|
|
163
|
+
handleToTop();
|
|
164
|
+
dispatchEvent('click', {}, evnt);
|
|
165
|
+
};
|
|
166
|
+
const tagMethods = {
|
|
167
|
+
dispatchEvent
|
|
168
|
+
};
|
|
169
|
+
const tagPrivateMethods = {};
|
|
170
|
+
Object.assign($xeBacktop, tagMethods, tagPrivateMethods);
|
|
171
|
+
const renderVN = () => {
|
|
172
|
+
const { circle, position, status, icon, showIcon, content, showContent } = props;
|
|
173
|
+
const { showBtn } = reactData;
|
|
174
|
+
const wrapperStyle = computeWrapperStyle.value;
|
|
175
|
+
const vSize = computeSize.value;
|
|
176
|
+
const defaultSlot = slots.default;
|
|
177
|
+
return h('div', {
|
|
178
|
+
ref: refElem,
|
|
179
|
+
class: ['vxe-backtop', position === 'fixed' ? ('is--' + position) : 'is--absolute', {
|
|
180
|
+
[`size--${vSize}`]: vSize,
|
|
181
|
+
[`theme--${status}`]: status,
|
|
182
|
+
'is--circle': circle,
|
|
183
|
+
'is--visible': showBtn
|
|
184
|
+
}],
|
|
185
|
+
style: wrapperStyle,
|
|
186
|
+
onClick: clickEvent
|
|
187
|
+
}, [
|
|
188
|
+
h('div', {
|
|
189
|
+
class: 'vxe-backtop--inner'
|
|
190
|
+
}, [
|
|
191
|
+
defaultSlot
|
|
192
|
+
? defaultSlot({})
|
|
193
|
+
: [
|
|
194
|
+
showIcon
|
|
195
|
+
? h('div', {
|
|
196
|
+
class: 'vxe-backtop--icon'
|
|
197
|
+
}, [
|
|
198
|
+
h('i', {
|
|
199
|
+
class: icon || getIcon().BACKTOP_TOP
|
|
200
|
+
})
|
|
201
|
+
])
|
|
202
|
+
: renderEmptyElement($xeBacktop),
|
|
203
|
+
showContent
|
|
204
|
+
? h('div', {
|
|
205
|
+
class: 'vxe-backtop--content'
|
|
206
|
+
}, `${content || ''}`)
|
|
207
|
+
: renderEmptyElement($xeBacktop)
|
|
208
|
+
]
|
|
209
|
+
])
|
|
210
|
+
]);
|
|
211
|
+
};
|
|
212
|
+
watch(() => props.target, () => {
|
|
213
|
+
handleTargetElement();
|
|
214
|
+
});
|
|
215
|
+
onMounted(() => {
|
|
216
|
+
handleTargetElement();
|
|
217
|
+
});
|
|
218
|
+
onBeforeUnmount(() => {
|
|
219
|
+
removeScrollEvent();
|
|
220
|
+
XEUtils.assign(reactData, createReactData());
|
|
221
|
+
});
|
|
222
|
+
onUnmounted(() => {
|
|
223
|
+
XEUtils.assign(internalData, createInternalData());
|
|
224
|
+
});
|
|
225
|
+
$xeBacktop.renderVN = renderVN;
|
|
226
|
+
return $xeBacktop;
|
|
227
|
+
},
|
|
228
|
+
render() {
|
|
229
|
+
return this.renderVN();
|
|
230
|
+
}
|
|
231
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.vxe-backtop {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
position: absolute;
|
|
4
|
+
opacity: 0;
|
|
5
|
+
right: 1.6em;
|
|
6
|
+
bottom: 1.6em;
|
|
7
|
+
color: var(--vxe-ui-font-color);
|
|
8
|
+
font-family: var(--vxe-ui-font-family);
|
|
9
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
10
|
+
border-radius: var(--vxe-ui-base-border-radius);
|
|
11
|
+
transition: all 0.3s;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3);
|
|
14
|
+
z-index: 9;
|
|
15
|
+
}
|
|
16
|
+
.vxe-backtop.is--visible {
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}
|
|
19
|
+
.vxe-backtop.is--circle {
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
}
|
|
22
|
+
.vxe-backtop.is--circle .vxe-backtop--inner {
|
|
23
|
+
border-radius: 50%;
|
|
24
|
+
}
|
|
25
|
+
.vxe-backtop.is--fixed {
|
|
26
|
+
position: fixed;
|
|
27
|
+
}
|
|
28
|
+
.vxe-backtop.is--absolute {
|
|
29
|
+
position: absolute;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.vxe-backtop--inner {
|
|
33
|
+
min-width: 3em;
|
|
34
|
+
min-height: 3em;
|
|
35
|
+
padding: 0.4em;
|
|
36
|
+
display: flex;
|
|
37
|
+
text-align: center;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
border-radius: var(--vxe-ui-base-border-radius);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.vxe-backtop:hover {
|
|
45
|
+
color: var(--vxe-ui-font-primary-color);
|
|
46
|
+
}
|
|
47
|
+
.vxe-backtop:hover .vxe-backtop--inner {
|
|
48
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
49
|
+
}
|
|
50
|
+
.vxe-backtop.theme--primary {
|
|
51
|
+
color: #fff;
|
|
52
|
+
background-color: var(--vxe-ui-font-primary-color);
|
|
53
|
+
}
|
|
54
|
+
.vxe-backtop.theme--success {
|
|
55
|
+
color: #fff;
|
|
56
|
+
background-color: var(--vxe-ui-status-success-color);
|
|
57
|
+
}
|
|
58
|
+
.vxe-backtop.theme--info {
|
|
59
|
+
color: #fff;
|
|
60
|
+
background-color: var(--vxe-ui-status-info-color);
|
|
61
|
+
}
|
|
62
|
+
.vxe-backtop.theme--warning {
|
|
63
|
+
color: #fff;
|
|
64
|
+
background-color: var(--vxe-ui-status-warning-color);
|
|
65
|
+
}
|
|
66
|
+
.vxe-backtop.theme--danger {
|
|
67
|
+
color: #fff;
|
|
68
|
+
background-color: var(--vxe-ui-status-danger-color);
|
|
69
|
+
}
|
|
70
|
+
.vxe-backtop.theme--error {
|
|
71
|
+
color: #fff;
|
|
72
|
+
background-color: var(--vxe-ui-status-error-color);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.vxe-backtop--icon {
|
|
76
|
+
font-size: 1.4em;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.vxe-backtop {
|
|
80
|
+
font-size: var(--vxe-ui-font-size-default);
|
|
81
|
+
}
|
|
82
|
+
.vxe-backtop.size--medium {
|
|
83
|
+
font-size: var(--vxe-ui-font-size-medium);
|
|
84
|
+
}
|
|
85
|
+
.vxe-backtop.size--small {
|
|
86
|
+
font-size: var(--vxe-ui-font-size-small);
|
|
87
|
+
}
|
|
88
|
+
.vxe-backtop.size--mini {
|
|
89
|
+
font-size: var(--vxe-ui-font-size-mini);
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vxe-backtop{display:inline-flex;position:absolute;opacity:0;right:1.6em;bottom:1.6em;color:var(--vxe-ui-font-color);font-family:var(--vxe-ui-font-family);background-color:var(--vxe-ui-layout-background-color);border-radius:var(--vxe-ui-base-border-radius);transition:all .3s;cursor:pointer;box-shadow:0 0 6px rgba(0,0,0,.3);z-index:9}.vxe-backtop.is--visible{opacity:1}.vxe-backtop.is--circle{border-radius:50%}.vxe-backtop.is--circle .vxe-backtop--inner{border-radius:50%}.vxe-backtop.is--fixed{position:fixed}.vxe-backtop.is--absolute{position:absolute}.vxe-backtop--inner{min-width:3em;min-height:3em;padding:.4em;display:flex;text-align:center;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--vxe-ui-base-border-radius)}.vxe-backtop:hover{color:var(--vxe-ui-font-primary-color)}.vxe-backtop:hover .vxe-backtop--inner{background-color:rgba(0,0,0,.1)}.vxe-backtop.theme--primary{color:#fff;background-color:var(--vxe-ui-font-primary-color)}.vxe-backtop.theme--success{color:#fff;background-color:var(--vxe-ui-status-success-color)}.vxe-backtop.theme--info{color:#fff;background-color:var(--vxe-ui-status-info-color)}.vxe-backtop.theme--warning{color:#fff;background-color:var(--vxe-ui-status-warning-color)}.vxe-backtop.theme--danger{color:#fff;background-color:var(--vxe-ui-status-danger-color)}.vxe-backtop.theme--error{color:#fff;background-color:var(--vxe-ui-status-error-color)}.vxe-backtop--icon{font-size:1.4em}.vxe-backtop{font-size:var(--vxe-ui-font-size-default)}.vxe-backtop.size--medium{font-size:var(--vxe-ui-font-size-medium)}.vxe-backtop.size--small{font-size:var(--vxe-ui-font-size-small)}.vxe-backtop.size--mini{font-size:var(--vxe-ui-font-size-mini)}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VxeUI } from '@vxe-ui/core';
|
|
2
|
+
import VxeCascaderComponent from './src/cascader';
|
|
3
|
+
import { dynamicApp } from '../dynamics';
|
|
4
|
+
export const VxeCascader = Object.assign({}, VxeCascaderComponent, {
|
|
5
|
+
install(app) {
|
|
6
|
+
app.component(VxeCascaderComponent.name, VxeCascaderComponent);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
dynamicApp.use(VxeCascader);
|
|
10
|
+
VxeUI.component(VxeCascaderComponent);
|
|
11
|
+
export const Cascader = VxeCascader;
|
|
12
|
+
export default VxeCascader;
|