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.
Files changed (212) hide show
  1. package/components/app/index.vue +74 -22
  2. package/components/app/toast/index.vue +76 -71
  3. package/components/app/toast/toast.vue +62 -44
  4. package/components/avatar/index.vue +207 -84
  5. package/components/button/buttonConfirm.vue +53 -26
  6. package/components/button/buttonGroup.js +0 -2
  7. package/components/button/buttonGroup.vue +310 -62
  8. package/components/button/index.vue +584 -100
  9. package/components/calendar/index.js +0 -2
  10. package/components/calendar/index.vue +326 -262
  11. package/components/calendar/month.vue +64 -55
  12. package/components/calendar/year.vue +30 -25
  13. package/components/card/index.vue +139 -59
  14. package/components/codeEditor/highlightCss.vue +38 -39
  15. package/components/codeEditor/highlightHtml.vue +64 -64
  16. package/components/codeEditor/highlightJs.vue +37 -38
  17. package/components/codeEditor/index.vue +129 -79
  18. package/components/codeEditor/run.vue +225 -39
  19. package/components/codeEditor/useCodeFormatter.js +150 -0
  20. package/components/confirm/index.vue +139 -80
  21. package/components/container/col.vue +5 -4
  22. package/components/container/divider.vue +28 -19
  23. package/components/container/index.vue +34 -15
  24. package/components/container/row.vue +26 -9
  25. package/components/container/spacer.vue +2 -4
  26. package/components/container/style.scss +3 -0
  27. package/components/content/index.vue +49 -32
  28. package/components/cropper/index.vue +401 -244
  29. package/components/float/index.vue +542 -415
  30. package/components/form/addressInput/index.vue +184 -109
  31. package/components/form/camInput/index.vue +370 -244
  32. package/components/form/checkInput/index.vue +138 -71
  33. package/components/form/checkboxInput/index.vue +93 -49
  34. package/components/form/colorInput/Alpha.vue +81 -83
  35. package/components/form/colorInput/Hue.vue +91 -68
  36. package/components/form/colorInput/Preview.vue +43 -47
  37. package/components/form/colorInput/Saturation.vue +101 -86
  38. package/components/form/colorInput/index.vue +71 -39
  39. package/components/form/colorInput/picker.vue +111 -106
  40. package/components/form/colorInput/useColor.js +153 -0
  41. package/components/form/dateInput/index.vue +691 -356
  42. package/components/form/dateInput/month.vue +63 -54
  43. package/components/form/dateInput/year.vue +35 -25
  44. package/components/form/fileInput/index.js +0 -1
  45. package/components/form/fileInput/index.vue +263 -106
  46. package/components/form/fileInput/single.vue +332 -168
  47. package/components/form/groupInput/index.vue +199 -101
  48. package/components/form/index.vue +189 -83
  49. package/components/form/input/index.vue +416 -377
  50. package/components/form/jsonInput/JsonView.vue +54 -56
  51. package/components/form/jsonInput/index.vue +247 -165
  52. package/components/form/maskInput/index.vue +252 -132
  53. package/components/form/numberInput/index.js +0 -1
  54. package/components/form/numberInput/index.vue +226 -117
  55. package/components/form/passwordInput/index.js +2 -1
  56. package/components/form/passwordInput/index.vue +269 -102
  57. package/components/form/radioInput/index.vue +143 -72
  58. package/components/form/rangeInput/index.vue +280 -167
  59. package/components/form/ratingInput/index.vue +57 -57
  60. package/components/form/selectInput/index.js +1 -3
  61. package/components/form/selectInput/index.vue +584 -296
  62. package/components/form/switchInput/index.vue +73 -59
  63. package/components/form/telInput/index.js +0 -1
  64. package/components/form/telInput/index.vue +238 -135
  65. package/components/form/textArea/index.vue +72 -35
  66. package/components/form/textEditor/index.vue +739 -0
  67. package/components/form/{text-editor → textEditor}/style.scss +8 -16
  68. package/components/form/textInput/index.vue +54 -32
  69. package/components/form/timeInput/index.vue +82 -55
  70. package/components/form/timeInput/range.vue +115 -94
  71. package/components/form/timeInput/timepicker.vue +382 -449
  72. package/components/form/uniqueInput/index.vue +105 -48
  73. package/components/form/unitInput/index.vue +139 -84
  74. package/components/formCreator/index.js +0 -1
  75. package/components/formCreator/index.vue +314 -148
  76. package/components/highlight/index.vue +41 -25
  77. package/components/highlight/style.scss +2 -2
  78. package/components/highlight/{mixin.js → useHighlight.js} +181 -160
  79. package/components/icon/index.vue +79 -33
  80. package/components/img/index.vue +250 -147
  81. package/components/img/preview.vue +180 -198
  82. package/components/img/svgImg.vue +42 -39
  83. package/components/index.js +5 -20
  84. package/components/infinite/index.js +3 -3
  85. package/components/infinite/index.vue +290 -66
  86. package/components/map/index.vue +428 -261
  87. package/components/map/route.vue +794 -487
  88. package/components/map/select.vue +118 -58
  89. package/components/menu/index.vue +206 -94
  90. package/components/meta/meta.js +26 -3
  91. package/components/modal/index.vue +382 -156
  92. package/components/notify/index.vue +204 -86
  93. package/components/notify/notification.vue +38 -55
  94. package/components/progress/circle.vue +189 -70
  95. package/components/progress/line.vue +266 -46
  96. package/components/searchBox/index.js +1 -3
  97. package/components/searchBox/index.vue +194 -101
  98. package/components/skeleton/index.vue +45 -20
  99. package/components/slider/index.vue +319 -156
  100. package/components/swiper/index.vue +237 -108
  101. package/components/table/crud/footer.vue +77 -53
  102. package/components/table/crud/header.vue +71 -72
  103. package/components/table/crud/index.vue +629 -399
  104. package/components/table/index.vue +721 -278
  105. package/components/timeAgo/index.vue +145 -96
  106. package/components/tour/index.vue +338 -235
  107. package/components/tree/index.vue +235 -89
  108. package/components/tree/tree-element.vue +106 -106
  109. package/directive/animate/index.js +77 -0
  110. package/directive/clickOutSide/index.js +98 -0
  111. package/directive/drag/index.js +153 -0
  112. package/directive/index.js +11 -13
  113. package/directive/intersect/index.js +263 -0
  114. package/directive/mask/index.js +67 -0
  115. package/directive/parallax/index.js +78 -0
  116. package/directive/ripple/index.js +14 -0
  117. package/directive/scroll/index.js +272 -24
  118. package/directive/sortable/index.js +274 -0
  119. package/directive/title/index.js +75 -0
  120. package/directive/touch/index.js +268 -0
  121. package/index.js +11 -19
  122. package/package.json +5 -2
  123. package/plugins/validation/Validate.js +88 -79
  124. package/scripts/generate-docs.mjs +226 -0
  125. package/scripts/menu.mjs +240 -0
  126. package/scripts/parser.mjs +1086 -0
  127. package/style/_index.scss +7 -0
  128. package/style/app.scss +13 -65
  129. package/style/colors.scss +5 -22
  130. package/style/functions/index.scss +8 -0
  131. package/style/mixins/index.scss +17 -5
  132. package/style/variables/base.scss +155 -178
  133. package/style/variables/color.scss +0 -12
  134. package/style/variables/utilities.scss +0 -180
  135. package/tools/helper.js +0 -8
  136. package/tools/icons.js +7 -2
  137. package/tools/root.js +71 -0
  138. package/components/app/style.scss +0 -41
  139. package/components/app/toast/style.scss +0 -20
  140. package/components/avatar/style.scss +0 -32
  141. package/components/bar/bottomNav.js +0 -1
  142. package/components/bar/bottomNav.vue +0 -28
  143. package/components/bar/bottomNavigationCircle.js +0 -2
  144. package/components/bar/bottomNavigationCircle.vue +0 -99
  145. package/components/bar/scss/bottomNav.scss +0 -67
  146. package/components/bar/scss/toolbar.scss +0 -174
  147. package/components/bar/toolbar/index.js +0 -8
  148. package/components/bar/toolbar/index.vue +0 -35
  149. package/components/bar/toolbar/laptop.vue +0 -33
  150. package/components/bar/toolbar/menuChilds.vue +0 -41
  151. package/components/bar/toolbar/menuLaptop.vue +0 -41
  152. package/components/bar/toolbar/menuMob.vue +0 -39
  153. package/components/bar/toolbar/mixin.js +0 -43
  154. package/components/bar/toolbar/mobile.vue +0 -34
  155. package/components/breadcrumb/bredcrumbItem.vue +0 -39
  156. package/components/breadcrumb/index.js +0 -3
  157. package/components/breadcrumb/index.vue +0 -71
  158. package/components/breadcrumb/style.scss +0 -51
  159. package/components/button/style.scss +0 -411
  160. package/components/card/style.scss +0 -86
  161. package/components/chart/chart.js +0 -1
  162. package/components/chart/chart.vue +0 -69
  163. package/components/chart/worldMap.js +0 -2
  164. package/components/chart/worldMap.vue +0 -1112
  165. package/components/chat/MessageList.vue +0 -163
  166. package/components/chat/chatInput.vue +0 -150
  167. package/components/chat/chatMsg.vue +0 -276
  168. package/components/chat/index.js +0 -11
  169. package/components/chat/index.vue +0 -113
  170. package/components/chip/index.js +0 -3
  171. package/components/chip/index.vue +0 -77
  172. package/components/chip/style.scss +0 -199
  173. package/components/codeEditor/mixin.js +0 -145
  174. package/components/countdown/index.js +0 -1
  175. package/components/countdown/index.vue +0 -105
  176. package/components/form/colorInput/mixin.js +0 -132
  177. package/components/form/fileInput/file.js +0 -148
  178. package/components/form/telInput/assets/flags.png +0 -0
  179. package/components/form/telInput/assets/flags@2x.png +0 -0
  180. package/components/form/text-editor/index.vue +0 -705
  181. package/components/icon/style.scss +0 -17
  182. package/components/infinite/div.js +0 -6
  183. package/components/infinite/div.vue +0 -193
  184. package/components/infinite/page.js +0 -3
  185. package/components/infinite/page.vue +0 -105
  186. package/components/list/index.js +0 -3
  187. package/components/list/index.vue +0 -122
  188. package/components/list/style.scss +0 -66
  189. package/components/message/index.js +0 -4
  190. package/components/message/index.vue +0 -40
  191. package/components/modal/style.scss +0 -146
  192. package/components/nestable/NestableItem.vue +0 -307
  193. package/components/nestable/editable.js +0 -44
  194. package/components/nestable/index.js +0 -1
  195. package/components/nestable/index.vue +0 -226
  196. package/components/nestable/methods.js +0 -416
  197. package/components/progress/style.scss +0 -229
  198. package/components/table/style.scss +0 -338
  199. package/components/tabs/index.js +0 -3
  200. package/components/tabs/index.vue +0 -151
  201. package/components/timeline/index.js +0 -6
  202. package/components/timeline/index.vue +0 -76
  203. package/directive/resize/index.js +0 -30
  204. package/directive/skeleton/index.js +0 -27
  205. package/directive/skeleton/style.scss +0 -37
  206. package/plugins/request/Request.js +0 -68
  207. package/style/animation.scss +0 -94
  208. package/style/style.scss +0 -8
  209. package/tools/rootable.js +0 -75
  210. /package/components/form/{text-editor → textEditor}/index.js +0 -0
  211. /package/components/form/{text-editor → textEditor}/preview.js +0 -0
  212. /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 {computed, onBeforeUnmount, onMounted, ref} from 'vue';
40
-
41
- export default {
42
- props: {
43
- src: {
44
- type: String,
45
- required: true
46
- },
47
- maxScale: {
48
- type: Number,
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
- setup(props) {
62
- const container = ref(null);
63
- const scale = ref(1);
64
- const rotation = ref(0);
65
- const position = ref({x: 0, y: 0});
66
- const isDragging = ref(false);
67
- const dragStart = ref({x: 0, y: 0});
68
- const naturalSize = ref({width: 0, height: 0});
69
- const containerSize = ref({width: 0, height: 0});
70
-
71
- const wrapperStyle = computed(() => ({
72
- transform: `translate(${position.value.x}px, ${position.value.y}px)`,
73
- cursor: isDragging.value ? 'grabbing' : 'grab'
74
- }));
75
-
76
- const imageStyle = computed(() => ({
77
- transform: `scale(${scale.value})`,
78
- transformOrigin: '0 0',
79
- width: naturalSize.value.width ? `${naturalSize.value.width}px` : 'auto',
80
- height: naturalSize.value.height ? `${naturalSize.value.height}px` : 'auto',
81
- display: 'block'
82
- }));
83
- const imageHolderStyle = computed(() => ({
84
- transform: `rotate(${rotation.value}deg)`,
85
- transformOrigin: 'center center',
86
- width: naturalSize.value.width ? `${naturalSize.value.width * scale.value}px` : 'auto',
87
- height: naturalSize.value.height ? `${naturalSize.value.height * scale.value}px` : 'auto',
88
- display: 'block'
89
- }));
90
-
91
- const handleImageLoad = (event) => {
92
- naturalSize.value = {
93
- width: event.target.naturalWidth,
94
- height: event.target.naturalHeight
95
- };
96
- updateContainerSize();
97
- centerImage();
98
- };
99
-
100
- const updateContainerSize = () => {
101
- if (container.value) {
102
- containerSize.value = {
103
- width: container.value.clientWidth,
104
- height: container.value.clientHeight
105
- };
106
- }
107
- };
108
-
109
- const centerImage = () => {
110
- if (!container.value || !naturalSize.value.width) return;
111
-
112
- const widthRatio = containerSize.value.width / naturalSize.value.width;
113
- const heightRatio = containerSize.value.height / naturalSize.value.height;
114
- const initialScale = Math.min(widthRatio, heightRatio, 1); // Don't scale up initially
115
-
116
- scale.value = initialScale;
117
- rotation.value = 0;
118
-
119
- position.value = {
120
- x: (containerSize.value.width - naturalSize.value.width * scale.value) / 2,
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
- </script>
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="img"></span>
2
+ <span ref="imgRef"></span>
3
3
  </template>
4
- <script>
5
- export default {
6
- name: "svgImg",
7
- props: {
8
- link: String,
9
- size: Object
10
- },
11
- created() {
12
- this.ImgToSvg()
13
- },
14
- methods: {
15
- replace(svg) {
16
- if (!this.$refs.img) {
17
- setTimeout(() => {
18
- this.replace(svg)
19
- }, 10)
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
- <style lang="scss">
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>
@@ -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/text-editor/index.js'
33
- export * as rTextEditorPreview from './form/text-editor/preview.js'
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 rInfiniteDiv from './infinite/div.js'
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 rInfiniteBox from './index.vue'
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'