@mixd-id/web-scaffold 0.1.240411018 → 0.1.240411019
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/package.json +1 -1
- package/src/components/Article.vue +1 -1
- package/src/components/Link.vue +2 -2
- package/src/components/MenuItem1.vue +1 -1
- package/src/components/TreeView.vue +0 -1
- package/src/mixin/component.js +75 -12
- package/src/widgets/ComponentSetting2.vue +9 -0
- package/src/widgets/Share.vue +1 -2
- package/src/widgets/WebPageBuilder.vue +1 -1
package/package.json
CHANGED
package/src/components/Link.vue
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
|
|
38
38
|
<script>
|
|
39
39
|
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
40
|
+
import {componentMixin} from "../mixin/component";
|
|
41
|
+
import {applyDatasourceReplacer} from "../utils/helpers";
|
|
42
42
|
|
|
43
43
|
export default{
|
|
44
44
|
|
package/src/mixin/component.js
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import {inject} from 'vue'
|
|
2
|
-
import {parseBoolean} from "../utils/helpers.mjs";
|
|
3
2
|
|
|
4
|
-
let guide
|
|
3
|
+
let guide, guide2
|
|
4
|
+
let selectedUid
|
|
5
|
+
|
|
6
|
+
function scrollIntoViewIfNeededWithOffset(elem, offset = 100) {
|
|
7
|
+
const rect = elem.getBoundingClientRect();
|
|
8
|
+
|
|
9
|
+
const isVisible = (
|
|
10
|
+
rect.top >= 0 &&
|
|
11
|
+
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
if (!isVisible) {
|
|
15
|
+
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
16
|
+
const targetScroll = rect.top + scrollTop - offset;
|
|
17
|
+
|
|
18
|
+
window.scrollTo({
|
|
19
|
+
top: targetScroll,
|
|
20
|
+
behavior: 'smooth'
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
5
25
|
|
|
6
26
|
export const componentMixin = {
|
|
7
27
|
|
|
@@ -165,7 +185,10 @@ export const componentMixin = {
|
|
|
165
185
|
e.stopPropagation()
|
|
166
186
|
e.preventDefault()
|
|
167
187
|
|
|
188
|
+
selectedUid = this.uid
|
|
189
|
+
|
|
168
190
|
this.editModeClick ? this.editModeClick(this.uid) : null
|
|
191
|
+
this.select2()
|
|
169
192
|
},
|
|
170
193
|
|
|
171
194
|
componentMouseOver(e){
|
|
@@ -174,15 +197,22 @@ export const componentMixin = {
|
|
|
174
197
|
e.stopPropagation()
|
|
175
198
|
e.preventDefault()
|
|
176
199
|
|
|
177
|
-
|
|
178
|
-
|
|
200
|
+
const offset = this.$el.getBoundingClientRect()
|
|
201
|
+
const top = offset.top + window.scrollY + 1
|
|
202
|
+
const left = offset.left + window.scrollX + 1
|
|
203
|
+
const width = offset.width - 2
|
|
204
|
+
const height = offset.height - 2
|
|
179
205
|
|
|
180
|
-
this
|
|
206
|
+
const guide = this.getGuide()
|
|
207
|
+
guide.style.top = `${top}px`
|
|
208
|
+
guide.style.left = `${left}px`
|
|
209
|
+
guide.style.width = `${width}px`
|
|
210
|
+
guide.style.height = `${height}px`
|
|
211
|
+
document.body.appendChild(guide)
|
|
181
212
|
},
|
|
182
213
|
|
|
183
214
|
componentMouseOut(){
|
|
184
215
|
if(this.editMode !== 1) return
|
|
185
|
-
this.$el.style.position = this.lastStyle.position
|
|
186
216
|
|
|
187
217
|
const guide = this.getGuide()
|
|
188
218
|
if(guide.parentNode){
|
|
@@ -193,22 +223,55 @@ export const componentMixin = {
|
|
|
193
223
|
getGuide(){
|
|
194
224
|
if(!guide){
|
|
195
225
|
guide = document.createElement('div')
|
|
196
|
-
guide.className = "absolute
|
|
226
|
+
guide.className = "absolute border-[2px] border-blue-600" +
|
|
197
227
|
" pointer-events-none"
|
|
198
228
|
}
|
|
199
229
|
|
|
200
230
|
return guide
|
|
201
231
|
},
|
|
202
232
|
|
|
233
|
+
getGuide2(){
|
|
234
|
+
if(!guide2){
|
|
235
|
+
console.log('create')
|
|
236
|
+
guide2 = document.createElement('div')
|
|
237
|
+
guide2.className = "absolute border-[2px] border-blue-600 pointer-events-none"
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return guide2
|
|
241
|
+
},
|
|
242
|
+
|
|
203
243
|
select(){
|
|
244
|
+
const offset = this.$el.getBoundingClientRect()
|
|
245
|
+
const top = offset.top + window.scrollY + 1
|
|
246
|
+
const left = offset.left + window.scrollX + 1
|
|
247
|
+
const width = offset.width - 2
|
|
248
|
+
const height = offset.height - 2
|
|
249
|
+
|
|
250
|
+
const guide = this.getGuide2()
|
|
251
|
+
guide.style.top = `${top}px`
|
|
252
|
+
guide.style.left = `${left}px`
|
|
253
|
+
guide.style.width = `${width}px`
|
|
254
|
+
guide.style.height = `${height}px`
|
|
255
|
+
document.body.appendChild(guide)
|
|
256
|
+
|
|
257
|
+
scrollIntoViewIfNeededWithOffset(this.$el, 100)
|
|
204
258
|
},
|
|
205
259
|
|
|
206
|
-
|
|
260
|
+
select2(){
|
|
261
|
+
const offset = this.$el.getBoundingClientRect()
|
|
262
|
+
const top = offset.top + window.scrollY + 1
|
|
263
|
+
const left = offset.left + window.scrollX + 1
|
|
264
|
+
const width = offset.width - 2
|
|
265
|
+
const height = offset.height - 2
|
|
266
|
+
|
|
267
|
+
const guide = this.getGuide2()
|
|
268
|
+
guide.style.top = `${top}px`
|
|
269
|
+
guide.style.left = `${left}px`
|
|
270
|
+
guide.style.width = `${width}px`
|
|
271
|
+
guide.style.height = `${height}px`
|
|
272
|
+
document.body.appendChild(guide)
|
|
273
|
+
},
|
|
207
274
|
|
|
208
|
-
data(){
|
|
209
|
-
return {
|
|
210
|
-
lastStyle: {}
|
|
211
|
-
}
|
|
212
275
|
},
|
|
213
276
|
|
|
214
277
|
mounted(){
|
|
@@ -287,6 +287,15 @@ export default{
|
|
|
287
287
|
[ 'overflow-y-scroll', 'Y Scroll' ],
|
|
288
288
|
]},
|
|
289
289
|
|
|
290
|
+
{ text:'Z Index', key:'zIndex', values: [
|
|
291
|
+
[ 'z-0', '0' ],
|
|
292
|
+
[ 'z-10', '10' ],
|
|
293
|
+
[ 'z-20', '20' ],
|
|
294
|
+
[ 'z-30', '30' ],
|
|
295
|
+
[ 'z-40', '40' ],
|
|
296
|
+
[ 'z-50', '50' ],
|
|
297
|
+
]},
|
|
298
|
+
|
|
290
299
|
]},
|
|
291
300
|
|
|
292
301
|
{ text:'Flexbox & Grid', items: [
|
package/src/widgets/Share.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="$style.comp">
|
|
2
|
+
<div :class="$style.comp" :data-uid="uid">
|
|
3
3
|
<strong v-if="title" class="mr-6">{{ title }}</strong>
|
|
4
4
|
|
|
5
5
|
<div v-if="direction === 'vertical'" class="flex-1 flex flex-col divide-y divide-text-100 self-stretch">
|
|
@@ -110,7 +110,6 @@ export default{
|
|
|
110
110
|
},
|
|
111
111
|
|
|
112
112
|
waShareUrl(){
|
|
113
|
-
if(typeof window === 'undefined') return
|
|
114
113
|
return `https://wa.me/send?text=` + encodeURIComponent(this.currentUrl)
|
|
115
114
|
},
|
|
116
115
|
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
|
|
559
559
|
import throttle from "lodash/throttle";
|
|
560
560
|
import md5 from "md5";
|
|
561
|
-
import {
|
|
561
|
+
import {createFormData, invokeAfterIdle} from "../utils/helpers.mjs";
|
|
562
562
|
import {ref} from 'vue'
|
|
563
563
|
import {useManualRefHistory} from "@vueuse/core";
|
|
564
564
|
import axios from "axios";
|