renusify 2.5.2 → 3.0.1
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/components/app/index.vue +74 -22
- package/components/app/toast/index.vue +76 -71
- package/components/app/toast/toast.vue +62 -44
- package/components/avatar/index.vue +207 -84
- package/components/button/buttonConfirm.vue +53 -26
- package/components/button/buttonGroup.js +0 -2
- package/components/button/buttonGroup.vue +310 -62
- package/components/button/index.vue +584 -100
- package/components/calendar/index.js +0 -2
- package/components/calendar/index.vue +326 -262
- package/components/calendar/month.vue +64 -55
- package/components/calendar/year.vue +30 -25
- package/components/card/index.vue +139 -59
- package/components/codeEditor/highlightCss.vue +38 -39
- package/components/codeEditor/highlightHtml.vue +64 -64
- package/components/codeEditor/highlightJs.vue +37 -38
- package/components/codeEditor/index.vue +129 -79
- package/components/codeEditor/run.vue +225 -39
- package/components/codeEditor/useCodeFormatter.js +150 -0
- package/components/confirm/index.vue +139 -80
- package/components/container/col.vue +5 -4
- package/components/container/divider.vue +28 -19
- package/components/container/index.vue +34 -15
- package/components/container/row.vue +26 -9
- package/components/container/spacer.vue +2 -4
- package/components/container/style.scss +3 -0
- package/components/content/index.vue +49 -32
- package/components/cropper/index.vue +401 -244
- package/components/float/index.vue +542 -415
- package/components/form/addressInput/index.vue +184 -109
- package/components/form/camInput/index.vue +370 -244
- package/components/form/checkInput/index.vue +138 -71
- package/components/form/checkboxInput/index.vue +93 -49
- package/components/form/colorInput/Alpha.vue +81 -83
- package/components/form/colorInput/Hue.vue +91 -68
- package/components/form/colorInput/Preview.vue +43 -47
- package/components/form/colorInput/Saturation.vue +101 -86
- package/components/form/colorInput/index.vue +71 -39
- package/components/form/colorInput/picker.vue +111 -106
- package/components/form/colorInput/useColor.js +153 -0
- package/components/form/dateInput/index.vue +691 -356
- package/components/form/dateInput/month.vue +63 -54
- package/components/form/dateInput/year.vue +35 -25
- package/components/form/fileInput/index.js +0 -1
- package/components/form/fileInput/index.vue +263 -106
- package/components/form/fileInput/single.vue +332 -168
- package/components/form/groupInput/index.vue +199 -101
- package/components/form/index.vue +189 -83
- package/components/form/input/index.vue +416 -377
- package/components/form/jsonInput/JsonView.vue +54 -56
- package/components/form/jsonInput/index.vue +247 -165
- package/components/form/maskInput/index.vue +252 -132
- package/components/form/numberInput/index.js +0 -1
- package/components/form/numberInput/index.vue +226 -117
- package/components/form/passwordInput/index.js +2 -1
- package/components/form/passwordInput/index.vue +269 -102
- package/components/form/radioInput/index.vue +143 -72
- package/components/form/rangeInput/index.vue +280 -167
- package/components/form/ratingInput/index.vue +57 -57
- package/components/form/selectInput/index.js +1 -3
- package/components/form/selectInput/index.vue +584 -296
- package/components/form/switchInput/index.vue +73 -59
- package/components/form/telInput/index.js +0 -1
- package/components/form/telInput/index.vue +238 -135
- package/components/form/textArea/index.vue +72 -35
- package/components/form/textEditor/index.vue +739 -0
- package/components/form/{text-editor → textEditor}/style.scss +8 -16
- package/components/form/textInput/index.vue +54 -32
- package/components/form/timeInput/index.vue +82 -55
- package/components/form/timeInput/range.vue +115 -94
- package/components/form/timeInput/timepicker.vue +382 -449
- package/components/form/uniqueInput/index.vue +105 -48
- package/components/form/unitInput/index.vue +139 -84
- package/components/formCreator/index.js +0 -1
- package/components/formCreator/index.vue +314 -148
- package/components/highlight/index.vue +41 -25
- package/components/highlight/style.scss +2 -2
- package/components/highlight/{mixin.js → useHighlight.js} +181 -160
- package/components/icon/index.vue +79 -33
- package/components/img/index.vue +250 -147
- package/components/img/preview.vue +180 -198
- package/components/img/svgImg.vue +42 -39
- package/components/index.js +5 -20
- package/components/infinite/index.js +3 -3
- package/components/infinite/index.vue +290 -66
- package/components/map/index.vue +428 -261
- package/components/map/route.vue +794 -487
- package/components/map/select.vue +118 -58
- package/components/menu/index.vue +206 -94
- package/components/meta/meta.js +26 -3
- package/components/modal/index.vue +382 -156
- package/components/notify/index.vue +204 -86
- package/components/notify/notification.vue +38 -55
- package/components/progress/circle.vue +189 -70
- package/components/progress/line.vue +266 -46
- package/components/searchBox/index.js +1 -3
- package/components/searchBox/index.vue +194 -101
- package/components/skeleton/index.vue +45 -20
- package/components/slider/index.vue +319 -156
- package/components/swiper/index.vue +237 -108
- package/components/table/crud/footer.vue +77 -53
- package/components/table/crud/header.vue +71 -72
- package/components/table/crud/index.vue +629 -399
- package/components/table/index.vue +721 -278
- package/components/timeAgo/index.vue +145 -96
- package/components/tour/index.vue +338 -235
- package/components/tree/index.vue +235 -89
- package/components/tree/tree-element.vue +106 -106
- package/directive/animate/index.js +77 -0
- package/directive/clickOutSide/index.js +98 -0
- package/directive/drag/index.js +153 -0
- package/directive/index.js +11 -13
- package/directive/intersect/index.js +263 -0
- package/directive/mask/index.js +67 -0
- package/directive/parallax/index.js +78 -0
- package/directive/ripple/index.js +14 -0
- package/directive/scroll/index.js +272 -24
- package/directive/sortable/index.js +274 -0
- package/directive/title/index.js +75 -0
- package/directive/touch/index.js +268 -0
- package/index.js +11 -19
- package/package.json +5 -2
- package/plugins/validation/Validate.js +88 -79
- package/scripts/generate-docs.mjs +226 -0
- package/scripts/menu.mjs +240 -0
- package/scripts/parser.mjs +1086 -0
- package/style/_index.scss +7 -0
- package/style/app.scss +13 -65
- package/style/colors.scss +5 -22
- package/style/functions/index.scss +8 -0
- package/style/mixins/index.scss +17 -5
- package/style/variables/base.scss +155 -178
- package/style/variables/color.scss +0 -12
- package/style/variables/utilities.scss +0 -180
- package/tools/helper.js +0 -8
- package/tools/icons.js +7 -2
- package/tools/root.js +71 -0
- package/components/app/style.scss +0 -41
- package/components/app/toast/style.scss +0 -20
- package/components/avatar/style.scss +0 -32
- package/components/bar/bottomNav.js +0 -1
- package/components/bar/bottomNav.vue +0 -28
- package/components/bar/bottomNavigationCircle.js +0 -2
- package/components/bar/bottomNavigationCircle.vue +0 -99
- package/components/bar/scss/bottomNav.scss +0 -67
- package/components/bar/scss/toolbar.scss +0 -174
- package/components/bar/toolbar/index.js +0 -8
- package/components/bar/toolbar/index.vue +0 -35
- package/components/bar/toolbar/laptop.vue +0 -33
- package/components/bar/toolbar/menuChilds.vue +0 -41
- package/components/bar/toolbar/menuLaptop.vue +0 -41
- package/components/bar/toolbar/menuMob.vue +0 -39
- package/components/bar/toolbar/mixin.js +0 -43
- package/components/bar/toolbar/mobile.vue +0 -34
- package/components/breadcrumb/bredcrumbItem.vue +0 -39
- package/components/breadcrumb/index.js +0 -3
- package/components/breadcrumb/index.vue +0 -71
- package/components/breadcrumb/style.scss +0 -51
- package/components/button/style.scss +0 -411
- package/components/card/style.scss +0 -86
- package/components/chart/chart.js +0 -1
- package/components/chart/chart.vue +0 -69
- package/components/chart/worldMap.js +0 -2
- package/components/chart/worldMap.vue +0 -1112
- package/components/chat/MessageList.vue +0 -163
- package/components/chat/chatInput.vue +0 -150
- package/components/chat/chatMsg.vue +0 -276
- package/components/chat/index.js +0 -11
- package/components/chat/index.vue +0 -113
- package/components/chip/index.js +0 -3
- package/components/chip/index.vue +0 -77
- package/components/chip/style.scss +0 -199
- package/components/codeEditor/mixin.js +0 -145
- package/components/countdown/index.js +0 -1
- package/components/countdown/index.vue +0 -105
- package/components/form/colorInput/mixin.js +0 -132
- package/components/form/fileInput/file.js +0 -148
- package/components/form/telInput/assets/flags.png +0 -0
- package/components/form/telInput/assets/flags@2x.png +0 -0
- package/components/form/text-editor/index.vue +0 -705
- package/components/icon/style.scss +0 -17
- package/components/infinite/div.js +0 -6
- package/components/infinite/div.vue +0 -193
- package/components/infinite/page.js +0 -3
- package/components/infinite/page.vue +0 -105
- package/components/list/index.js +0 -3
- package/components/list/index.vue +0 -122
- package/components/list/style.scss +0 -66
- package/components/message/index.js +0 -4
- package/components/message/index.vue +0 -40
- package/components/modal/style.scss +0 -146
- package/components/nestable/NestableItem.vue +0 -307
- package/components/nestable/editable.js +0 -44
- package/components/nestable/index.js +0 -1
- package/components/nestable/index.vue +0 -226
- package/components/nestable/methods.js +0 -416
- package/components/progress/style.scss +0 -229
- package/components/table/style.scss +0 -338
- package/components/tabs/index.js +0 -3
- package/components/tabs/index.vue +0 -151
- package/components/timeline/index.js +0 -6
- package/components/timeline/index.vue +0 -76
- package/directive/resize/index.js +0 -30
- package/directive/skeleton/index.js +0 -27
- package/directive/skeleton/style.scss +0 -37
- package/plugins/request/Request.js +0 -68
- package/style/animation.scss +0 -94
- package/style/style.scss +0 -8
- package/tools/rootable.js +0 -75
- /package/components/form/{text-editor → textEditor}/index.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.vue +0 -0
|
@@ -35,204 +35,186 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
|
-
<script>
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
default: 5
|
|
50
|
-
},
|
|
51
|
-
minScale: {
|
|
52
|
-
type: Number,
|
|
53
|
-
default: 0.1
|
|
54
|
-
},
|
|
55
|
-
showControls: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: true
|
|
58
|
-
}
|
|
38
|
+
<script setup>
|
|
39
|
+
import {ref, computed, onMounted, onBeforeUnmount} from 'vue'
|
|
40
|
+
|
|
41
|
+
const props = defineProps({
|
|
42
|
+
src: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
maxScale: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 5
|
|
59
49
|
},
|
|
50
|
+
minScale: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 0.1
|
|
53
|
+
},
|
|
54
|
+
showControls: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: true
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const container = ref(null)
|
|
61
|
+
const scale = ref(1)
|
|
62
|
+
const rotation = ref(0)
|
|
63
|
+
const position = ref({x: 0, y: 0})
|
|
64
|
+
const isDragging = ref(false)
|
|
65
|
+
const dragStart = ref({x: 0, y: 0})
|
|
66
|
+
const naturalSize = ref({width: 0, height: 0})
|
|
67
|
+
const containerSize = ref({width: 0, height: 0})
|
|
68
|
+
|
|
69
|
+
const wrapperStyle = computed(() => ({
|
|
70
|
+
transform: `translate(${position.value.x}px, ${position.value.y}px)`,
|
|
71
|
+
cursor: isDragging.value ? 'grabbing' : 'grab'
|
|
72
|
+
}))
|
|
73
|
+
|
|
74
|
+
const imageStyle = computed(() => ({
|
|
75
|
+
transform: `scale(${scale.value})`,
|
|
76
|
+
transformOrigin: '0 0',
|
|
77
|
+
width: naturalSize.value.width ? `${naturalSize.value.width}px` : 'auto',
|
|
78
|
+
height: naturalSize.value.height ? `${naturalSize.value.height}px` : 'auto',
|
|
79
|
+
display: 'block'
|
|
80
|
+
}))
|
|
81
|
+
|
|
82
|
+
const imageHolderStyle = computed(() => ({
|
|
83
|
+
transform: `rotate(${rotation.value}deg)`,
|
|
84
|
+
transformOrigin: 'center center',
|
|
85
|
+
width: naturalSize.value.width ? `${naturalSize.value.width * scale.value}px` : 'auto',
|
|
86
|
+
height: naturalSize.value.height ? `${naturalSize.value.height * scale.value}px` : 'auto',
|
|
87
|
+
display: 'block'
|
|
88
|
+
}))
|
|
89
|
+
|
|
90
|
+
const handleImageLoad = (event) => {
|
|
91
|
+
naturalSize.value = {
|
|
92
|
+
width: event.target.naturalWidth,
|
|
93
|
+
height: event.target.naturalHeight
|
|
94
|
+
}
|
|
95
|
+
updateContainerSize()
|
|
96
|
+
centerImage()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const updateContainerSize = () => {
|
|
100
|
+
if (container.value) {
|
|
101
|
+
containerSize.value = {
|
|
102
|
+
width: container.value.clientWidth,
|
|
103
|
+
height: container.value.clientHeight
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const centerImage = () => {
|
|
109
|
+
if (!container.value || !naturalSize.value.width) return
|
|
110
|
+
|
|
111
|
+
const widthRatio = containerSize.value.width / naturalSize.value.width
|
|
112
|
+
const heightRatio = containerSize.value.height / naturalSize.value.height
|
|
113
|
+
const initialScale = Math.min(widthRatio, heightRatio, 1)
|
|
60
114
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
y: (containerSize.value.height - naturalSize.value.height * scale.value) / 2
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const rotate = () => {
|
|
126
|
-
if (!container.value) return;
|
|
127
|
-
rotation.value = (rotation.value + 22.5) % 360;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const zoom = (factor, clientX, clientY) => {
|
|
131
|
-
if (!container.value) return;
|
|
132
|
-
|
|
133
|
-
const oldScale = scale.value;
|
|
134
|
-
scale.value = Math.min(
|
|
135
|
-
Math.max(scale.value * factor, props.minScale),
|
|
136
|
-
props.maxScale
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const rect = container.value.getBoundingClientRect();
|
|
140
|
-
const containerX = clientX - rect.left;
|
|
141
|
-
const containerY = clientY - rect.top;
|
|
142
|
-
|
|
143
|
-
const imageX = (containerX - position.value.x) / oldScale;
|
|
144
|
-
const imageY = (containerY - position.value.y) / oldScale;
|
|
145
|
-
|
|
146
|
-
position.value.x = containerX - imageX * scale.value;
|
|
147
|
-
position.value.y = containerY - imageY * scale.value;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
const zoomIn = () => {
|
|
151
|
-
if (!container.value) return;
|
|
152
|
-
const rect = container.value.getBoundingClientRect();
|
|
153
|
-
zoom(1.2, rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const zoomOut = () => {
|
|
157
|
-
if (!container.value) return;
|
|
158
|
-
const rect = container.value.getBoundingClientRect();
|
|
159
|
-
zoom(0.8, rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
const reset = () => {
|
|
163
|
-
centerImage();
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const startDrag = (e) => {
|
|
167
|
-
if (isDragging.value) return
|
|
168
|
-
isDragging.value = true;
|
|
169
|
-
const clientX = e.clientX || e.touches[0].clientX;
|
|
170
|
-
const clientY = e.clientY || e.touches[0].clientY;
|
|
171
|
-
|
|
172
|
-
dragStart.value = {
|
|
173
|
-
x: clientX - position.value.x,
|
|
174
|
-
y: clientY - position.value.y
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
e.preventDefault();
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
const handleDrag = (e) => {
|
|
181
|
-
if (!isDragging.value) return;
|
|
182
|
-
|
|
183
|
-
const clientX = e.clientX || (e.touches && e.touches[0].clientX);
|
|
184
|
-
const clientY = e.clientY || (e.touches && e.touches[0].clientY);
|
|
185
|
-
|
|
186
|
-
if (clientX === undefined || clientY === undefined) return;
|
|
187
|
-
|
|
188
|
-
position.value = {
|
|
189
|
-
x: clientX - dragStart.value.x,
|
|
190
|
-
y: clientY - dragStart.value.y
|
|
191
|
-
};
|
|
192
|
-
e.preventDefault();
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
const endDrag = () => {
|
|
196
|
-
isDragging.value = false;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const handleWheel = (e) => {
|
|
200
|
-
const factor = e.deltaY < 0 ? 1.1 : 0.9;
|
|
201
|
-
zoom(factor, e.clientX, e.clientY);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
onMounted(() => {
|
|
205
|
-
window.addEventListener('mousemove', handleDrag);
|
|
206
|
-
window.addEventListener('mouseup', endDrag);
|
|
207
|
-
window.addEventListener('touchmove', handleDrag, {passive: false});
|
|
208
|
-
window.addEventListener('touchend', endDrag);
|
|
209
|
-
window.addEventListener('resize', updateContainerSize);
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
onBeforeUnmount(() => {
|
|
213
|
-
window.removeEventListener('mousemove', handleDrag);
|
|
214
|
-
window.removeEventListener('mouseup', endDrag);
|
|
215
|
-
window.removeEventListener('touchmove', handleDrag);
|
|
216
|
-
window.removeEventListener('touchend', endDrag);
|
|
217
|
-
window.removeEventListener('resize', updateContainerSize);
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
return {
|
|
221
|
-
container,
|
|
222
|
-
scale,
|
|
223
|
-
rotation,
|
|
224
|
-
position,
|
|
225
|
-
wrapperStyle,
|
|
226
|
-
imageStyle,
|
|
227
|
-
imageHolderStyle,
|
|
228
|
-
handleImageLoad,
|
|
229
|
-
startDrag,
|
|
230
|
-
handleWheel,
|
|
231
|
-
zoomIn,
|
|
232
|
-
zoomOut,
|
|
233
|
-
reset,
|
|
234
|
-
rotate
|
|
235
|
-
};
|
|
115
|
+
scale.value = initialScale
|
|
116
|
+
rotation.value = 0
|
|
117
|
+
|
|
118
|
+
position.value = {
|
|
119
|
+
x: (containerSize.value.width - naturalSize.value.width * scale.value) / 2,
|
|
120
|
+
y: (containerSize.value.height - naturalSize.value.height * scale.value) / 2
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const rotate = () => {
|
|
125
|
+
if (!container.value) return
|
|
126
|
+
rotation.value = (rotation.value + 22.5) % 360
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const zoom = (factor, clientX, clientY) => {
|
|
130
|
+
if (!container.value) return
|
|
131
|
+
|
|
132
|
+
const oldScale = scale.value
|
|
133
|
+
scale.value = Math.min(
|
|
134
|
+
Math.max(scale.value * factor, props.minScale),
|
|
135
|
+
props.maxScale
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
const rect = container.value.getBoundingClientRect()
|
|
139
|
+
const containerX = clientX - rect.left
|
|
140
|
+
const containerY = clientY - rect.top
|
|
141
|
+
|
|
142
|
+
const imageX = (containerX - position.value.x) / oldScale
|
|
143
|
+
const imageY = (containerY - position.value.y) / oldScale
|
|
144
|
+
|
|
145
|
+
position.value.x = containerX - imageX * scale.value
|
|
146
|
+
position.value.y = containerY - imageY * scale.value
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const zoomIn = () => {
|
|
150
|
+
if (!container.value) return
|
|
151
|
+
const rect = container.value.getBoundingClientRect()
|
|
152
|
+
zoom(1.2, rect.left + rect.width / 2, rect.top + rect.height / 2)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const zoomOut = () => {
|
|
156
|
+
if (!container.value) return
|
|
157
|
+
const rect = container.value.getBoundingClientRect()
|
|
158
|
+
zoom(0.8, rect.left + rect.width / 2, rect.top + rect.height / 2)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const reset = () => {
|
|
162
|
+
centerImage()
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const startDrag = (e) => {
|
|
166
|
+
if (isDragging.value) return
|
|
167
|
+
isDragging.value = true
|
|
168
|
+
|
|
169
|
+
const clientX = e.clientX || e.touches[0].clientX
|
|
170
|
+
const clientY = e.clientY || e.touches[0].clientY
|
|
171
|
+
|
|
172
|
+
dragStart.value = {
|
|
173
|
+
x: clientX - position.value.x,
|
|
174
|
+
y: clientY - position.value.y
|
|
236
175
|
}
|
|
237
|
-
|
|
238
|
-
|
|
176
|
+
|
|
177
|
+
e.preventDefault()
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const handleDrag = (e) => {
|
|
181
|
+
if (!isDragging.value) return
|
|
182
|
+
|
|
183
|
+
const clientX = e.clientX || (e.touches && e.touches[0].clientX)
|
|
184
|
+
const clientY = e.clientY || (e.touches && e.touches[0].clientY)
|
|
185
|
+
|
|
186
|
+
if (clientX === undefined || clientY === undefined) return
|
|
187
|
+
|
|
188
|
+
position.value = {
|
|
189
|
+
x: clientX - dragStart.value.x,
|
|
190
|
+
y: clientY - dragStart.value.y
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
e.preventDefault()
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const endDrag = () => {
|
|
197
|
+
isDragging.value = false
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const handleWheel = (e) => {
|
|
201
|
+
const factor = e.deltaY < 0 ? 1.1 : 0.9
|
|
202
|
+
zoom(factor, e.clientX, e.clientY)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
onMounted(() => {
|
|
206
|
+
container.value.addEventListener('mousemove', handleDrag)
|
|
207
|
+
container.value.addEventListener('mouseup', endDrag)
|
|
208
|
+
container.value.addEventListener('touchmove', handleDrag, {passive: false})
|
|
209
|
+
container.value.addEventListener('touchend', endDrag)
|
|
210
|
+
container.value.addEventListener('resize', updateContainerSize)
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
onBeforeUnmount(() => {
|
|
214
|
+
container.value.removeEventListener('mousemove', handleDrag)
|
|
215
|
+
container.value.removeEventListener('mouseup', endDrag)
|
|
216
|
+
container.value.removeEventListener('touchmove', handleDrag)
|
|
217
|
+
container.value.removeEventListener('touchend', endDrag)
|
|
218
|
+
container.value.removeEventListener('resize', updateContainerSize)
|
|
219
|
+
})
|
|
220
|
+
</script>
|
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span ref="
|
|
2
|
+
<span ref="imgRef"></span>
|
|
3
3
|
</template>
|
|
4
|
-
<script>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
this.$refs.img.replaceWith(svg)
|
|
23
|
-
},
|
|
24
|
-
ImgToSvg() {
|
|
25
|
-
const that = this
|
|
26
|
-
fetch(this.link).then(x => {
|
|
27
|
-
x.text().then((d) => {
|
|
28
|
-
const el = document.createElement('div')
|
|
29
|
-
el.innerHTML = d
|
|
30
|
-
let svg = el.querySelector('svg')
|
|
31
|
-
if (svg) {
|
|
32
|
-
svg.setAttribute('width', that.size.width + 'px')
|
|
33
|
-
svg.setAttribute('height', that.size.height + 'px')
|
|
34
|
-
that.replace(svg)
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
})
|
|
38
|
-
}
|
|
4
|
+
<script setup>
|
|
5
|
+
import {ref, onMounted, nextTick} from 'vue'
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
link: String,
|
|
9
|
+
size: Object
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const imgRef = ref(null)
|
|
13
|
+
|
|
14
|
+
const replace = (svg) => {
|
|
15
|
+
if (!imgRef.value) {
|
|
16
|
+
nextTick(() => {
|
|
17
|
+
replace(svg)
|
|
18
|
+
})
|
|
19
|
+
return
|
|
39
20
|
}
|
|
21
|
+
imgRef.value.replaceWith(svg)
|
|
40
22
|
}
|
|
41
|
-
</script>
|
|
42
23
|
|
|
43
|
-
|
|
24
|
+
const imgToSvg = () => {
|
|
25
|
+
fetch(props.link)
|
|
26
|
+
.then(response => response.text())
|
|
27
|
+
.then(data => {
|
|
28
|
+
const el = document.createElement('div')
|
|
29
|
+
el.innerHTML = data
|
|
30
|
+
const svg = el.querySelector('svg')
|
|
31
|
+
|
|
32
|
+
if (svg && props.size) {
|
|
33
|
+
svg.setAttribute('width', `${props.size.width}px`)
|
|
34
|
+
svg.setAttribute('height', `${props.size.height}px`)
|
|
35
|
+
replace(svg)
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
.catch(error => {
|
|
39
|
+
console.error('Failed to load SVG:', error)
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onMounted(() => {
|
|
44
|
+
imgToSvg()
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
</script>
|
|
44
48
|
|
|
45
|
-
</style>
|
package/components/index.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
export * as rApp from './app/index.js'
|
|
2
2
|
export * as rAvatar from './avatar/index.js'
|
|
3
|
-
export * as rToolbar from './bar/toolbar/index.js'
|
|
4
|
-
export * as rBottomNavigation from './bar/bottomNav.js'
|
|
5
|
-
export * as rBottomNavigationCircle from './bar/bottomNavigationCircle.js'
|
|
6
|
-
export * as rBreadcrumbs from './breadcrumb/index.js'
|
|
7
3
|
export * as rBtn from './button/index.js'
|
|
8
4
|
export * as rBtnConfirm from './button/buttonConfirm.js'
|
|
5
|
+
export * as rBtnGroup from './button/buttonGroup.js'
|
|
9
6
|
export * as rCalendar from './calendar/index.js'
|
|
10
7
|
export * as rCard from './card/index.js'
|
|
11
|
-
export * as rChart from './chart/chart.js'
|
|
12
|
-
export * as rChartMap from './chart/worldMap.js'
|
|
13
|
-
export * as rChat from './chat/index.js'
|
|
14
|
-
export * as rChip from './chip/index.js'
|
|
15
8
|
export * as rCodeEditor from './codeEditor/index.js'
|
|
16
9
|
export * as rConfirm from './confirm/index.js'
|
|
17
10
|
export * as rContainer from './container/index.js'
|
|
@@ -20,17 +13,17 @@ export * as rCol from './container/col.js'
|
|
|
20
13
|
export * as rSpacer from './container/spacer.js'
|
|
21
14
|
export * as rDivider from './container/divider.js'
|
|
22
15
|
export * as rContent from './content/index.js'
|
|
23
|
-
export * as rCountDown from './countdown/index.js'
|
|
24
16
|
export * as rCropper from './cropper/index.js'
|
|
25
17
|
export * as rFloat from './float/index.js'
|
|
26
18
|
export * as rForm from './form/index.js'
|
|
19
|
+
export * as rInput from './form/input/index.js'
|
|
27
20
|
export * as rColorInput from './form/colorInput/index.js'
|
|
28
21
|
export * as rDateInput from './form/dateInput/index.js'
|
|
29
22
|
export * as rFileInput from './form/fileInput/index.js'
|
|
30
23
|
export * as rTelInput from './form/telInput/index.js'
|
|
31
24
|
export * as rJsonInput from './form/jsonInput/index.js'
|
|
32
|
-
export * as rTextEditor from './form/
|
|
33
|
-
export * as rTextEditorPreview from './form/
|
|
25
|
+
export * as rTextEditor from './form/textEditor/index.js'
|
|
26
|
+
export * as rTextEditorPreview from './form/textEditor/preview.js'
|
|
34
27
|
export * as rTimeInput from './form/timeInput/index.js'
|
|
35
28
|
export * as rTimeRangeInput from './form/timeInput/range.js'
|
|
36
29
|
export * as rUniqueInput from './form/uniqueInput/index.js'
|
|
@@ -39,7 +32,6 @@ export * as rCamInput from './form/camInput/index.js'
|
|
|
39
32
|
export * as rCheckInput from './form/checkInput/index.js'
|
|
40
33
|
export * as rCheckboxInput from './form/checkboxInput/index.js'
|
|
41
34
|
export * as rGroupInput from './form/groupInput/index.js'
|
|
42
|
-
export * as rInput from './form/input/index.js'
|
|
43
35
|
export * as rMaskInput from './form/maskInput/index.js'
|
|
44
36
|
export * as rNumberInput from './form/numberInput/index.js'
|
|
45
37
|
export * as rPasswordInput from './form/passwordInput/index.js'
|
|
@@ -54,18 +46,13 @@ export * as rUnitInput from './form/unitInput/index.js'
|
|
|
54
46
|
export * as rFormCreator from './formCreator/index.js'
|
|
55
47
|
export * as rIcon from './icon/index.js'
|
|
56
48
|
export * as rImg from './img/index.js'
|
|
57
|
-
export * as
|
|
58
|
-
export * as rInfinitePage from './infinite/page.js'
|
|
59
|
-
export * as rInfiniteBox from './infinite/index.js'
|
|
60
|
-
export * as rList from './list/index.js'
|
|
49
|
+
export * as rInfinite from './infinite/index.js'
|
|
61
50
|
export * as rMap from './map/index.js'
|
|
62
51
|
export * as rMapSelect from './map/select.js'
|
|
63
52
|
export * as rMapRoute from './map/route.js'
|
|
64
53
|
export * as rMenu from './menu/index.js'
|
|
65
|
-
export * as rMessage from './message/index.js'
|
|
66
54
|
export * as rMeta from './meta/index.js'
|
|
67
55
|
export * as rModal from './modal/index.js'
|
|
68
|
-
export * as rNestable from './nestable/index.js'
|
|
69
56
|
export * as rNotify from './notify/index.js'
|
|
70
57
|
export * as rProgressCircle from './progress/circle.js'
|
|
71
58
|
export * as rProgressLine from './progress/line.js'
|
|
@@ -74,9 +61,7 @@ export * as rSlider from './slider/index.js'
|
|
|
74
61
|
export * as rSwiper from './swiper/index.js'
|
|
75
62
|
export * as rTable from './table/index.js'
|
|
76
63
|
export * as rTableCrud from './table/crud/index.js'
|
|
77
|
-
export * as rTabs from './tabs/index.js'
|
|
78
64
|
export * as rTimeAgo from './timeAgo/index.js'
|
|
79
|
-
export * as rTimeline from './timeline/index.js'
|
|
80
65
|
export * as rTour from './tour/index.js'
|
|
81
66
|
export * as rTree from './tree/index.js'
|
|
82
67
|
export * as rHighlight from './highlight/index.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * as
|
|
2
|
-
export * as l_div from './div.js'
|
|
1
|
+
export * as rInfinite from './index.vue'
|
|
3
2
|
export * as l_card from '../card/index.js'
|
|
4
3
|
export * as l_container from '../container/index.js'
|
|
5
4
|
export * as l_row from '../container/row.js'
|
|
6
5
|
export * as l_col from '../container/col.js'
|
|
7
|
-
export * as l_switch from '../form/switchInput/index.js'
|
|
6
|
+
export * as l_switch from '../form/switchInput/index.js'
|
|
7
|
+
export * as d_scroll from '../../directive/scroll/index.js'
|