@meethive/components 0.0.3 → 0.0.5
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 +361 -418
- package/es/ProLayout/Basic/Header.js +97 -111
- package/es/ProLayout/PageContainer/index.js +298 -344
- package/es/ProLayout/SiderMenu/BaseMenu.js +233 -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 +361 -418
- package/lib/ProLayout/Basic/Header.js +97 -111
- package/lib/ProLayout/PageContainer/index.js +298 -344
- package/lib/ProLayout/SiderMenu/BaseMenu.js +233 -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,212 +1,191 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
props: {
|
|
11
|
-
title: {
|
|
12
|
-
type: [String, Boolean],
|
|
13
|
-
default: ''
|
|
14
|
-
},
|
|
15
|
-
width: {
|
|
16
|
-
type: Number,
|
|
17
|
-
default: 400
|
|
18
|
-
},
|
|
19
|
-
height: {
|
|
20
|
-
type: Number,
|
|
21
|
-
default: 100
|
|
22
|
-
},
|
|
23
|
-
dragRang: {
|
|
24
|
-
type: [Array, Number],
|
|
25
|
-
default: [400, 200]
|
|
26
|
-
},
|
|
27
|
-
bodyStyle: {
|
|
28
|
-
type: Object,
|
|
29
|
-
default: () => ({})
|
|
30
|
-
},
|
|
31
|
-
footer: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: true
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
emits: ['cancel', 'heightChange', 'ok', 'visibleChange'],
|
|
37
|
-
setup(props, {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const prefixCls = computed(() => 'jetlinks-drag-modal')
|
|
50
|
-
const [wrapSSR, hashId] = genDragModalStyle(prefixCls)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
let
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
let
|
|
104
|
-
let
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
} else if (position === 'drag-
|
|
120
|
-
x = true
|
|
121
|
-
y = true
|
|
122
|
-
xp = true
|
|
123
|
-
xc = true
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
xc
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
watch(
|
|
193
|
-
() => props.height,
|
|
194
|
-
() => {
|
|
195
|
-
if (props.height > baseHeight.value) {
|
|
196
|
-
baseHeight.value = props.height
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
)
|
|
200
|
-
|
|
201
|
-
return {
|
|
202
|
-
dialog,
|
|
203
|
-
header,
|
|
204
|
-
styles,
|
|
205
|
-
hashId,
|
|
206
|
-
contextLocale,
|
|
207
|
-
rangeMove,
|
|
208
|
-
onCancel,
|
|
209
|
-
onOk
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
})
|
|
1
|
+
import { defineComponent, ref, useSlots, computed, onMounted, watch } from 'vue';
|
|
2
|
+
import { Button } from 'ant-design-vue';
|
|
3
|
+
import { useLocaleReceiver } from '../LocaleReciver/index';
|
|
4
|
+
import genDragModalStyle from './style';
|
|
5
|
+
export default defineComponent({
|
|
6
|
+
name: 'JDragModal',
|
|
7
|
+
components: {
|
|
8
|
+
Button
|
|
9
|
+
},
|
|
10
|
+
props: {
|
|
11
|
+
title: {
|
|
12
|
+
type: [String, Boolean],
|
|
13
|
+
default: ''
|
|
14
|
+
},
|
|
15
|
+
width: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 400
|
|
18
|
+
},
|
|
19
|
+
height: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 100
|
|
22
|
+
},
|
|
23
|
+
dragRang: {
|
|
24
|
+
type: [Array, Number],
|
|
25
|
+
default: [400, 200]
|
|
26
|
+
},
|
|
27
|
+
bodyStyle: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default: () => ({})
|
|
30
|
+
},
|
|
31
|
+
footer: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
emits: ['cancel', 'heightChange', 'ok', 'visibleChange'],
|
|
37
|
+
setup(props, {
|
|
38
|
+
emit
|
|
39
|
+
}) {
|
|
40
|
+
const slots = useSlots();
|
|
41
|
+
const [contextLocale] = useLocaleReceiver('DragModal');
|
|
42
|
+
const ele = document.body;
|
|
43
|
+
const dialog = ref();
|
|
44
|
+
const header = ref();
|
|
45
|
+
const baseWidth = ref(props.width || 400);
|
|
46
|
+
const baseHeight = ref(props.height || 100);
|
|
47
|
+
const baseLeft = ref(100);
|
|
48
|
+
const baseTop = ref(100);
|
|
49
|
+
const prefixCls = computed(() => 'jetlinks-drag-modal');
|
|
50
|
+
const [wrapSSR, hashId] = genDragModalStyle(prefixCls);
|
|
51
|
+
const styles = computed(() => {
|
|
52
|
+
return {
|
|
53
|
+
top: getFixed(baseTop.value) + 'px',
|
|
54
|
+
left: getFixed(baseLeft.value) + 'px',
|
|
55
|
+
width: getFixed(baseWidth.value) + 'px',
|
|
56
|
+
height: getFixed(baseHeight.value) + 'px'
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
const getFixed = val => {
|
|
60
|
+
return Number(val.toFixed(2));
|
|
61
|
+
};
|
|
62
|
+
const onDrag = () => {
|
|
63
|
+
let active = false;
|
|
64
|
+
let initialX;
|
|
65
|
+
let initialY;
|
|
66
|
+
let initialWindowX;
|
|
67
|
+
let initialWindowY;
|
|
68
|
+
header.value.addEventListener('mousedown', e => {
|
|
69
|
+
active = true;
|
|
70
|
+
initialX = e.clientX;
|
|
71
|
+
initialY = e.clientY;
|
|
72
|
+
initialWindowX = dialog.value.offsetLeft;
|
|
73
|
+
initialWindowY = dialog.value.offsetTop;
|
|
74
|
+
});
|
|
75
|
+
document.addEventListener('mouseup', () => {
|
|
76
|
+
active = false;
|
|
77
|
+
});
|
|
78
|
+
document.addEventListener('mousemove', e => {
|
|
79
|
+
if (active) {
|
|
80
|
+
const dx = e.clientX - initialX;
|
|
81
|
+
const dy = e.clientY - initialY;
|
|
82
|
+
baseLeft.value = initialWindowX + dx;
|
|
83
|
+
baseTop.value = initialWindowY + dy;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const handleClear = () => {
|
|
88
|
+
document.onmouseup = () => {
|
|
89
|
+
document.onmousemove = null;
|
|
90
|
+
document.onmouseup = null;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
const rangeMove = (e, position) => {
|
|
94
|
+
//移动的方向
|
|
95
|
+
let x = false;
|
|
96
|
+
let y = false;
|
|
97
|
+
//移动的位置
|
|
98
|
+
let xp = false;
|
|
99
|
+
let yp = false;
|
|
100
|
+
//移动的正负
|
|
101
|
+
let xc = false;
|
|
102
|
+
let yc = false;
|
|
103
|
+
let disX = e.clientX;
|
|
104
|
+
let disY = e.clientY;
|
|
105
|
+
document.onmousemove = e => {
|
|
106
|
+
if (position === 'drag-bottom-right') {
|
|
107
|
+
x = true;
|
|
108
|
+
y = true;
|
|
109
|
+
} else if (position === 'drag-bottom-left') {
|
|
110
|
+
x = true;
|
|
111
|
+
y = true;
|
|
112
|
+
xp = true;
|
|
113
|
+
xc = true;
|
|
114
|
+
} else if (position === 'drag-top-right') {
|
|
115
|
+
x = true;
|
|
116
|
+
y = true;
|
|
117
|
+
yp = true;
|
|
118
|
+
yc = true;
|
|
119
|
+
} else if (position === 'drag-top-left') {
|
|
120
|
+
x = true;
|
|
121
|
+
y = true;
|
|
122
|
+
xp = true;
|
|
123
|
+
xc = true;
|
|
124
|
+
yp = true;
|
|
125
|
+
yc = true;
|
|
126
|
+
}
|
|
127
|
+
let left = e.clientX - disX;
|
|
128
|
+
let top = e.clientY - disY;
|
|
129
|
+
disX = e.clientX;
|
|
130
|
+
disY = e.clientY;
|
|
131
|
+
if (x) {
|
|
132
|
+
let calc = left;
|
|
133
|
+
if (xc) {
|
|
134
|
+
calc = -calc;
|
|
135
|
+
}
|
|
136
|
+
if (xp) {
|
|
137
|
+
baseLeft.value = baseLeft.value - calc;
|
|
138
|
+
}
|
|
139
|
+
const width = baseWidth.value + calc;
|
|
140
|
+
baseWidth.value = width <= props.dragRang[0] ? props.dragRang[0] : width;
|
|
141
|
+
}
|
|
142
|
+
if (y) {
|
|
143
|
+
let calc = top;
|
|
144
|
+
if (yc) {
|
|
145
|
+
calc = -calc;
|
|
146
|
+
}
|
|
147
|
+
if (yp) {
|
|
148
|
+
baseTop.value = baseTop.value - calc;
|
|
149
|
+
}
|
|
150
|
+
const height = baseHeight.value + calc;
|
|
151
|
+
baseHeight.value = height <= props.dragRang[1] ? props.dragRang[1] : height;
|
|
152
|
+
emit('heightChange', baseHeight.value);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
handleClear();
|
|
156
|
+
};
|
|
157
|
+
const onCancel = () => {
|
|
158
|
+
emit('cancel');
|
|
159
|
+
emit('visibleChange', false);
|
|
160
|
+
};
|
|
161
|
+
const onOk = () => {
|
|
162
|
+
emit('ok');
|
|
163
|
+
emit('visibleChange', true);
|
|
164
|
+
};
|
|
165
|
+
onMounted(() => {
|
|
166
|
+
if (dialog.value && header.value) {
|
|
167
|
+
onDrag();
|
|
168
|
+
}
|
|
169
|
+
if (ele) {
|
|
170
|
+
const data = ele?.getBoundingClientRect();
|
|
171
|
+
baseLeft.value = (data?.right - baseWidth.value) / 2 || 0;
|
|
172
|
+
baseTop.value = data?.top + 200 || 0;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
watch(() => props.height, () => {
|
|
176
|
+
if (props.height > baseHeight.value) {
|
|
177
|
+
baseHeight.value = props.height;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
return {
|
|
181
|
+
dialog,
|
|
182
|
+
header,
|
|
183
|
+
styles,
|
|
184
|
+
hashId,
|
|
185
|
+
contextLocale,
|
|
186
|
+
rangeMove,
|
|
187
|
+
onCancel,
|
|
188
|
+
onOk
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|