@meethive/components 0.0.3 → 0.0.4
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/AutoComplete/AutoComplete.js +71 -80
- package/es/BadgeStatus/Badge.js +38 -47
- package/es/CardSelect/CardSelect.js +115 -137
- package/es/CheckButton/CheckButton.js +102 -118
- package/es/ConfigProvider/ConfigProvider.js +44 -68
- package/es/DragModal/DragModal.js +191 -212
- package/es/EditTable/Body.js +158 -189
- package/es/EditTable/CellRender.js +10 -12
- package/es/EditTable/EditTable.js +385 -434
- package/es/EditTable/FormItem.js +140 -169
- package/es/EditTable/Group.js +171 -204
- package/es/EditTable/Header.js +57 -63
- package/es/EditTable/HeaderRender.js +10 -12
- package/es/EditTable/components/ContextMenu/Menu.js +78 -86
- package/es/EditTable/components/Search/Search.js +151 -163
- package/es/EditTable/components/Search/Sort.js +104 -119
- package/es/Ellipsis/Ellipsis.js +144 -148
- package/es/Empty/Empty.js +51 -57
- package/es/FullPage/FullPage.js +20 -19
- package/es/Icon/Icon.js +42 -49
- package/es/LocaleProvider/LocaleProvider.js +32 -38
- package/es/Markdown/Markdown.js +101 -118
- package/es/PermissionButton/PermissionButton.js +118 -118
- package/es/ProLayout/Basic/BasicLayout.js +301 -418
- package/es/ProLayout/Basic/Header.js +91 -111
- package/es/ProLayout/PageContainer/index.js +267 -344
- package/es/ProLayout/SiderMenu/BaseMenu.js +186 -240
- package/es/ProTable/Alert.js +39 -40
- package/es/ProTable/Content.js +84 -97
- package/es/ProTable/Header.js +32 -33
- package/es/ProTable/Pagination.js +56 -55
- package/es/ProTable/ProTable.js +256 -276
- package/es/RadioButton/RadioButton.js +48 -53
- package/es/Scrollbar/Bar.js +65 -76
- package/es/Scrollbar/Scrollbar.js +129 -161
- package/es/Scrollbar/Thumb.js +101 -150
- package/es/Search/Item.js +208 -236
- package/es/Search/Search.js +90 -90
- package/es/Skeleton/Skeleton.js +26 -27
- package/es/Skeleton/components/DashBoardCard.js +26 -27
- package/es/Skeleton/components/DashBoardChart.js +26 -27
- package/es/Skeleton/components/Detail.js +26 -27
- package/es/Skeleton/components/Drawer.js +26 -27
- package/es/Skeleton/components/Item.js +55 -54
- package/es/Skeleton/components/List.js +29 -27
- package/es/Skeleton/components/ListCard.js +28 -28
- package/es/Skeleton/components/ListCardItem.js +20 -20
- package/es/Skeleton/components/ListTable.js +26 -27
- package/es/Skeleton/components/Page.js +27 -26
- package/es/Skeleton/components/Search.js +16 -16
- package/es/Skeleton/components/Tree.js +26 -27
- package/es/TimeFormat/TimeFormat.js +32 -36
- package/es/Title/Title.js +23 -26
- package/es/ValueItem/ValueItem.js +100 -113
- package/es/VirtualTable/VirtualTable.js +235 -271
- package/lib/AutoComplete/AutoComplete.js +71 -80
- package/lib/BadgeStatus/Badge.js +38 -47
- package/lib/CardSelect/CardSelect.js +115 -137
- package/lib/CheckButton/CheckButton.js +102 -118
- package/lib/ConfigProvider/ConfigProvider.js +44 -68
- package/lib/DragModal/DragModal.js +191 -212
- package/lib/EditTable/Body.js +158 -189
- package/lib/EditTable/CellRender.js +10 -12
- package/lib/EditTable/EditTable.js +385 -434
- package/lib/EditTable/FormItem.js +140 -169
- package/lib/EditTable/Group.js +171 -204
- package/lib/EditTable/Header.js +57 -63
- package/lib/EditTable/HeaderRender.js +10 -12
- package/lib/EditTable/components/ContextMenu/Menu.js +78 -86
- package/lib/EditTable/components/Search/Search.js +151 -163
- package/lib/EditTable/components/Search/Sort.js +104 -119
- package/lib/Ellipsis/Ellipsis.js +144 -148
- package/lib/Empty/Empty.js +51 -57
- package/lib/FullPage/FullPage.js +20 -19
- package/lib/Icon/Icon.js +42 -49
- package/lib/LocaleProvider/LocaleProvider.js +32 -38
- package/lib/Markdown/Markdown.js +101 -118
- package/lib/PermissionButton/PermissionButton.js +118 -118
- package/lib/ProLayout/Basic/BasicLayout.js +301 -418
- package/lib/ProLayout/Basic/Header.js +91 -111
- package/lib/ProLayout/PageContainer/index.js +267 -344
- package/lib/ProLayout/SiderMenu/BaseMenu.js +186 -240
- package/lib/ProTable/Alert.js +39 -40
- package/lib/ProTable/Content.js +84 -97
- package/lib/ProTable/Header.js +32 -33
- package/lib/ProTable/Pagination.js +56 -55
- package/lib/ProTable/ProTable.js +256 -276
- package/lib/RadioButton/RadioButton.js +48 -53
- package/lib/Scrollbar/Bar.js +65 -76
- package/lib/Scrollbar/Scrollbar.js +129 -161
- package/lib/Scrollbar/Thumb.js +101 -150
- package/lib/Search/Item.js +208 -236
- package/lib/Search/Search.js +90 -90
- package/lib/Skeleton/Skeleton.js +26 -27
- package/lib/Skeleton/components/DashBoardCard.js +26 -27
- package/lib/Skeleton/components/DashBoardChart.js +26 -27
- package/lib/Skeleton/components/Detail.js +26 -27
- package/lib/Skeleton/components/Drawer.js +26 -27
- package/lib/Skeleton/components/Item.js +55 -54
- package/lib/Skeleton/components/List.js +29 -27
- package/lib/Skeleton/components/ListCard.js +28 -28
- package/lib/Skeleton/components/ListCardItem.js +20 -20
- package/lib/Skeleton/components/ListTable.js +26 -27
- package/lib/Skeleton/components/Page.js +27 -26
- package/lib/Skeleton/components/Search.js +16 -16
- package/lib/Skeleton/components/Tree.js +26 -27
- package/lib/TimeFormat/TimeFormat.js +32 -36
- package/lib/Title/Title.js +23 -26
- package/lib/ValueItem/ValueItem.js +100 -113
- package/lib/VirtualTable/VirtualTable.js +235 -271
- package/package.json +1 -1
|
@@ -1,119 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const [contextLocale] = useLocaleReceiver('EditTable')
|
|
42
|
-
const tableWrapperRef = useTableWrapper()
|
|
43
|
-
const tableTool = useTableTool()
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
mySelectedRowKeys.value
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
props,
|
|
106
|
-
contextLocale,
|
|
107
|
-
tableWrapperRef,
|
|
108
|
-
visible,
|
|
109
|
-
localDataSource,
|
|
110
|
-
mySelectedRowKeys,
|
|
111
|
-
columns,
|
|
112
|
-
visibleChange,
|
|
113
|
-
onSelectChange,
|
|
114
|
-
cleanParams,
|
|
115
|
-
onAsc,
|
|
116
|
-
onDesc
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
})
|
|
1
|
+
import { defineComponent, ref, reactive } from 'vue';
|
|
2
|
+
import { Popover as APopover, Table as ATable, Space as ASpace, Button as AButton } from 'ant-design-vue';
|
|
3
|
+
import { useTableTool, useTableWrapper } from '../../context';
|
|
4
|
+
import { useLocaleReceiver } from '../../../LocaleReciver';
|
|
5
|
+
import AIcon from '../../../Icon';
|
|
6
|
+
export default defineComponent({
|
|
7
|
+
name: 'JEditTableSearchSort',
|
|
8
|
+
components: {
|
|
9
|
+
APopover,
|
|
10
|
+
ATable,
|
|
11
|
+
ASpace,
|
|
12
|
+
AButton,
|
|
13
|
+
AIcon
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
dataSource: {
|
|
17
|
+
type: [Function, Array],
|
|
18
|
+
default: () => []
|
|
19
|
+
},
|
|
20
|
+
sortKey: {
|
|
21
|
+
type: [String, Array],
|
|
22
|
+
default: undefined
|
|
23
|
+
},
|
|
24
|
+
dataIndex: {
|
|
25
|
+
type: [Number, String],
|
|
26
|
+
default: undefined
|
|
27
|
+
},
|
|
28
|
+
selectedRowKeys: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => []
|
|
31
|
+
},
|
|
32
|
+
active: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
emits: ['click'],
|
|
38
|
+
setup(props, {
|
|
39
|
+
emit
|
|
40
|
+
}) {
|
|
41
|
+
const [contextLocale] = useLocaleReceiver('EditTable');
|
|
42
|
+
const tableWrapperRef = useTableWrapper();
|
|
43
|
+
const tableTool = useTableTool();
|
|
44
|
+
const visible = ref(false);
|
|
45
|
+
const localDataSource = ref([]);
|
|
46
|
+
const mySelectedRowKeys = ref([]);
|
|
47
|
+
const columns = reactive([{
|
|
48
|
+
dataIndex: 'name',
|
|
49
|
+
title: contextLocale.value.columns.name
|
|
50
|
+
}, {
|
|
51
|
+
dataIndex: 'total',
|
|
52
|
+
title: contextLocale.value.columns.count,
|
|
53
|
+
width: 70
|
|
54
|
+
}]);
|
|
55
|
+
const visibleChange = e => {
|
|
56
|
+
if (e) {
|
|
57
|
+
mySelectedRowKeys.value = props.selectedRowKeys;
|
|
58
|
+
const ds = typeof props.dataSource === 'function' ? props.dataSource() : props.dataSource;
|
|
59
|
+
localDataSource.value = (ds || []).map((item, index) => Object.assign(item, {
|
|
60
|
+
__index: index + 1
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
if (!e) {
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
visible.value = e;
|
|
66
|
+
}, 300);
|
|
67
|
+
} else {
|
|
68
|
+
visible.value = e;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const onSelectChange = keys => {
|
|
72
|
+
mySelectedRowKeys.value = keys;
|
|
73
|
+
};
|
|
74
|
+
const cleanParams = () => {
|
|
75
|
+
mySelectedRowKeys.value = [];
|
|
76
|
+
tableTool.cleanOrder();
|
|
77
|
+
};
|
|
78
|
+
const handleSortRowKeys = () => {
|
|
79
|
+
return localDataSource.value.filter(item => mySelectedRowKeys.value.includes(item.key)).sort((a, b) => b.__index - a.__index).map(item => item.key);
|
|
80
|
+
};
|
|
81
|
+
const onAsc = () => {
|
|
82
|
+
tableTool.order('asc', props.sortKey, handleSortRowKeys(), props.dataIndex);
|
|
83
|
+
emit('click');
|
|
84
|
+
};
|
|
85
|
+
const onDesc = () => {
|
|
86
|
+
tableTool.order('desc', props.sortKey, handleSortRowKeys(), props.dataIndex);
|
|
87
|
+
emit('click');
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
props,
|
|
91
|
+
contextLocale,
|
|
92
|
+
tableWrapperRef,
|
|
93
|
+
visible,
|
|
94
|
+
localDataSource,
|
|
95
|
+
mySelectedRowKeys,
|
|
96
|
+
columns,
|
|
97
|
+
visibleChange,
|
|
98
|
+
onSelectChange,
|
|
99
|
+
cleanParams,
|
|
100
|
+
onAsc,
|
|
101
|
+
onDesc
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
package/es/Ellipsis/Ellipsis.js
CHANGED
|
@@ -1,148 +1,144 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
'
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
function triggerAttrs() {
|
|
65
|
-
return {
|
|
66
|
-
...mergeProps(attrs, {
|
|
67
|
-
class: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
getTooltipDisabled
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
})
|
|
1
|
+
import { defineComponent, computed, ref, useAttrs, mergeProps } from 'vue';
|
|
2
|
+
import { Tooltip } from 'ant-design-vue';
|
|
3
|
+
import useEllipsisStyle from './style';
|
|
4
|
+
const jEllipsis = 'j-ellipsis';
|
|
5
|
+
const jEllipsisCursorClass = 'j-ellipsis-cursor';
|
|
6
|
+
const jEllipsisLineClampClass = 'j-ellipsis-line-clamp';
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
name: 'JEllipsis',
|
|
9
|
+
components: {
|
|
10
|
+
Tooltip
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
expandTrigger: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: undefined
|
|
16
|
+
},
|
|
17
|
+
/** multiline ellipsis */
|
|
18
|
+
lineClamp: {
|
|
19
|
+
type: [Number, String],
|
|
20
|
+
default: 1
|
|
21
|
+
},
|
|
22
|
+
tooltip: {
|
|
23
|
+
type: [Boolean, Object],
|
|
24
|
+
default: true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(props) {
|
|
28
|
+
const prefixCls = computed(() => 'j-ellipsis');
|
|
29
|
+
const [wrapSSR, hashId] = useEllipsisStyle(prefixCls);
|
|
30
|
+
|
|
31
|
+
// define class name
|
|
32
|
+
const expandedRef = ref(false);
|
|
33
|
+
const tooltipRef = ref(null);
|
|
34
|
+
const triggerRef = ref(null);
|
|
35
|
+
const visible = ref(false);
|
|
36
|
+
const attrs = useAttrs();
|
|
37
|
+
const handleClickRef = computed(() => {
|
|
38
|
+
return props.expandTrigger === 'click' ? () => {
|
|
39
|
+
const {
|
|
40
|
+
value: expanded
|
|
41
|
+
} = expandedRef;
|
|
42
|
+
expandedRef.value = !expanded;
|
|
43
|
+
} : undefined;
|
|
44
|
+
});
|
|
45
|
+
const ellipsisStyleRef = computed(() => {
|
|
46
|
+
const {
|
|
47
|
+
lineClamp
|
|
48
|
+
} = props;
|
|
49
|
+
const {
|
|
50
|
+
value: expanded
|
|
51
|
+
} = expandedRef;
|
|
52
|
+
if (lineClamp !== undefined) {
|
|
53
|
+
return {
|
|
54
|
+
textOverflow: '',
|
|
55
|
+
'-webkit-line-clamp': expanded ? '' : lineClamp
|
|
56
|
+
};
|
|
57
|
+
} else {
|
|
58
|
+
return {
|
|
59
|
+
textOverflow: expanded ? '' : 'ellipsis',
|
|
60
|
+
'-webkit-line-clamp': ''
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
function triggerAttrs() {
|
|
65
|
+
return {
|
|
66
|
+
...mergeProps(attrs, {
|
|
67
|
+
class: [jEllipsis, props.lineClamp !== undefined ? jEllipsisLineClampClass : undefined, props.expandTrigger === 'click' ? jEllipsisCursorClass : undefined, hashId.value],
|
|
68
|
+
style: ellipsisStyleRef.value
|
|
69
|
+
})
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const showTooltip = () => {
|
|
73
|
+
const {
|
|
74
|
+
value: trigger
|
|
75
|
+
} = triggerRef;
|
|
76
|
+
if (trigger) {
|
|
77
|
+
visible.value = trigger.scrollHeight > trigger.offsetHeight;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const syncTriggerClass = (trigger, styleClass, action) => {
|
|
81
|
+
if (action === 'add') {
|
|
82
|
+
if (!trigger.classList.contains(styleClass)) {
|
|
83
|
+
trigger.classList.add(styleClass);
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
if (trigger.classList.contains(styleClass)) {
|
|
87
|
+
trigger.classList.remove(styleClass);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const syncEllipsisStyle = trigger => {
|
|
92
|
+
if (!trigger) return;
|
|
93
|
+
const latestStyle = ellipsisStyleRef.value;
|
|
94
|
+
const lineClampClass = jEllipsisLineClampClass;
|
|
95
|
+
if (props.lineClamp !== undefined) {
|
|
96
|
+
syncTriggerClass(trigger, lineClampClass, 'add');
|
|
97
|
+
} else {
|
|
98
|
+
syncTriggerClass(trigger, lineClampClass, 'remove');
|
|
99
|
+
}
|
|
100
|
+
for (const key in latestStyle) {
|
|
101
|
+
if (trigger.style[key] !== latestStyle[key]) {
|
|
102
|
+
;
|
|
103
|
+
trigger.style[key] = latestStyle[key];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const syncCursorStyle = (trigger, tooltipDisabled) => {
|
|
108
|
+
if (props.expandTrigger === 'click' && !tooltipDisabled) {
|
|
109
|
+
syncTriggerClass(trigger, jEllipsisCursorClass, 'add');
|
|
110
|
+
} else {
|
|
111
|
+
syncTriggerClass(trigger, jEllipsisCursorClass, 'remove');
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const getTooltipDisabled = () => {
|
|
115
|
+
let tooltipDisabled = false;
|
|
116
|
+
const {
|
|
117
|
+
value: expanded
|
|
118
|
+
} = expandedRef;
|
|
119
|
+
if (expanded) return true;
|
|
120
|
+
const {
|
|
121
|
+
value: trigger
|
|
122
|
+
} = triggerRef;
|
|
123
|
+
if (trigger) {
|
|
124
|
+
syncEllipsisStyle(trigger);
|
|
125
|
+
tooltipDisabled = trigger.scrollHeight <= trigger.offsetHeight;
|
|
126
|
+
syncCursorStyle(trigger, tooltipDisabled);
|
|
127
|
+
}
|
|
128
|
+
return tooltipDisabled;
|
|
129
|
+
};
|
|
130
|
+
return {
|
|
131
|
+
jEllipsis,
|
|
132
|
+
jEllipsisCursorClass,
|
|
133
|
+
jEllipsisLineClampClass,
|
|
134
|
+
hashId,
|
|
135
|
+
tooltipRef,
|
|
136
|
+
triggerRef,
|
|
137
|
+
visible,
|
|
138
|
+
handleClickRef,
|
|
139
|
+
triggerAttrs,
|
|
140
|
+
showTooltip,
|
|
141
|
+
getTooltipDisabled
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
});
|
package/es/Empty/Empty.js
CHANGED
|
@@ -1,63 +1,57 @@
|
|
|
1
|
-
import { defineComponent as _defineComponent } from 'vue'
|
|
2
|
-
import { unref as _unref, renderSlot as _renderSlot, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from "vue"
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import LocaleProvider from '../LocaleProvider'
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, renderSlot as _renderSlot, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
3
|
+
import { useSlots } from 'vue';
|
|
4
|
+
import { Empty } from 'ant-design-vue';
|
|
5
|
+
import NoData from './image';
|
|
6
|
+
import { omit } from 'lodash-es';
|
|
7
|
+
import { useLocaleReceiver } from '../LocaleReciver';
|
|
8
|
+
import LocaleProvider from '../LocaleProvider';
|
|
12
9
|
const __sfc_main__ = _defineComponent({
|
|
13
|
-
...{
|
|
14
|
-
|
|
15
|
-
},
|
|
10
|
+
...{
|
|
11
|
+
name: 'JEmpty'
|
|
12
|
+
},
|
|
16
13
|
__name: 'Empty',
|
|
17
|
-
props: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
14
|
+
props: {
|
|
15
|
+
description: {
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
image: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: NoData
|
|
21
|
+
},
|
|
22
|
+
imageStyle: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => {
|
|
25
|
+
return {
|
|
26
|
+
height: '60px'
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
32
31
|
setup(__props) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_createVNode(_unref(Empty), _normalizeProps(_guardReactiveProps(_unref(baseProps))), _createSlots({ _: 2 /* DYNAMIC */ }, [
|
|
47
|
-
_renderList(_unref(renderArr), (item) => {
|
|
32
|
+
const props = __props;
|
|
33
|
+
const slots = useSlots();
|
|
34
|
+
const renderArr = Object.keys(slots);
|
|
35
|
+
const [contextLocale] = useLocaleReceiver('Empty');
|
|
36
|
+
const baseProps = omit({
|
|
37
|
+
...props,
|
|
38
|
+
description: props.description || contextLocale.value.description
|
|
39
|
+
}, ...renderArr);
|
|
40
|
+
return (_ctx, _cache) => {
|
|
41
|
+
return _openBlock(), _createBlock(_unref(LocaleProvider), null, {
|
|
42
|
+
default: _withCtx(() => [_createVNode(_unref(Empty), _normalizeProps(_guardReactiveProps(_unref(baseProps))), _createSlots({
|
|
43
|
+
_: 2 /* DYNAMIC */
|
|
44
|
+
}, [_renderList(_unref(renderArr), item => {
|
|
48
45
|
return {
|
|
49
46
|
name: item,
|
|
50
|
-
fn: _withCtx(
|
|
51
|
-
|
|
52
|
-
])
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
})
|
|
47
|
+
fn: _withCtx(scope => [_renderSlot(_ctx.$slots, item, {
|
|
48
|
+
scope: scope
|
|
49
|
+
})])
|
|
50
|
+
};
|
|
51
|
+
})]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */)]),
|
|
52
|
+
_: 3 /* FORWARDED */
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
63
57
|
export default __sfc_main__;
|