@mixd-id/web-scaffold 0.1.230406311 → 0.1.230406313
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/App.vue +9 -1
- package/src/components/Carousel.vue +3 -3
- package/src/components/ColorPicker2.vue +1 -1
- package/src/components/Image.vue +5 -3
- package/src/components/List.vue +48 -13
- package/src/components/Modal.vue +2 -2
- package/src/components/Text.vue +34 -0
- package/src/components/Textbox.vue +1 -1
- package/src/components/VirtualTable.vue +124 -95
- package/src/index.js +22 -38
- package/src/main.js +0 -9
- package/src/mixin/component.js +2 -1
- package/src/utils/preset-selector.js +53 -24
- package/src/utils/preset-selector.mjs +21 -1
- package/src/utils/wss.js +6 -1
- package/src/utils/wss.mjs +2 -2
- package/src/widgets/PresetBar.vue +6 -0
- package/src/widgets/WebPageBuilder3.vue +3 -218
- package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +54 -0
- package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +75 -0
- package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/BlurSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +64 -0
- package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +75 -0
- package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +69 -0
- package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +73 -0
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +65 -0
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +178 -0
- package/src/widgets/WebPageBuilder4/DisplaySetting.vue +76 -0
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +71 -0
- package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +70 -0
- package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +74 -0
- package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +71 -0
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +96 -0
- package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +69 -0
- package/src/widgets/WebPageBuilder4/GapSetting.vue +75 -0
- package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +68 -0
- package/src/widgets/WebPageBuilder4/GridSetting.vue +166 -0
- package/src/widgets/WebPageBuilder4/HeightSetting.vue +95 -0
- package/src/widgets/WebPageBuilder4/ImageSetting.vue +102 -0
- package/src/widgets/WebPageBuilder4/MarginSetting.vue +64 -0
- package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +82 -0
- package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +90 -0
- package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +81 -0
- package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +101 -0
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +155 -0
- package/src/widgets/WebPageBuilder4/OpacitySetting.vue +77 -0
- package/src/widgets/WebPageBuilder4/OverflowSetting.vue +81 -0
- package/src/widgets/WebPageBuilder4/PaddingSetting.vue +53 -0
- package/src/widgets/WebPageBuilder4/PositionSetting.vue +191 -0
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +176 -0
- package/src/widgets/WebPageBuilder4/TextSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/TreeView.vue +43 -0
- package/src/widgets/WebPageBuilder4/TreeViewItem.vue +298 -0
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +141 -0
- package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +172 -0
- package/src/widgets/WebPageBuilder4/WidthSetting.vue +105 -0
- package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4.vue +798 -0
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
14
|
<div v-if="items && items.length > 1" :class="$style.carouselNext" @click="next(true)">
|
|
15
|
-
<slot name="next">
|
|
16
|
-
</slot>
|
|
15
|
+
<slot name="next"></slot>
|
|
17
16
|
</div>
|
|
18
17
|
|
|
19
18
|
<div v-if="items && items.length > 1" :class="$style.carouselPrev" @click="prev">
|
|
@@ -179,7 +178,8 @@ export default{
|
|
|
179
178
|
},
|
|
180
179
|
|
|
181
180
|
play(){
|
|
182
|
-
|
|
181
|
+
if(this.autoPlay > 0)
|
|
182
|
+
this.timeoutId = window.setTimeout(() => { this.next(true); this.play() }, this.autoPlay)
|
|
183
183
|
},
|
|
184
184
|
|
|
185
185
|
stop(){
|
|
@@ -83,7 +83,7 @@ export default{
|
|
|
83
83
|
|
|
84
84
|
select(color){
|
|
85
85
|
if(this.mode === 'class'){
|
|
86
|
-
this.$emit('update:modelValue', color ? this.keys[0][0] + color : '')
|
|
86
|
+
this.$emit('update:modelValue', color ? `${this.prefix}${this.keys[0][0]}` + color : '')
|
|
87
87
|
}
|
|
88
88
|
else{
|
|
89
89
|
if(this.valueType === 'rgb'){
|
package/src/components/Image.vue
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</slot>
|
|
15
15
|
|
|
16
16
|
<div v-else-if="status === 2 && actualSrc.indexOf('<svg') >= 0" v-html="actualSrc"></div>
|
|
17
|
-
<img v-else-if="status === 2" :class="computedItemClass" :src="actualSrc" ref="img" />
|
|
17
|
+
<img v-else-if="status === 2" :class="computedItemClass" :src="actualSrc" ref="img" :alt="alt" />
|
|
18
18
|
|
|
19
19
|
<slot v-else-if="status === 3" name="error" :instance="this"></slot>
|
|
20
20
|
|
|
@@ -45,6 +45,8 @@ export default{
|
|
|
45
45
|
|
|
46
46
|
props:{
|
|
47
47
|
|
|
48
|
+
alt: String,
|
|
49
|
+
|
|
48
50
|
eager: {
|
|
49
51
|
type: [ Boolean, String ],
|
|
50
52
|
default: false
|
|
@@ -207,9 +209,9 @@ export default{
|
|
|
207
209
|
else if(Array.isArray(this.src)){
|
|
208
210
|
|
|
209
211
|
const src = {}
|
|
210
|
-
src['all'] =
|
|
212
|
+
src['all'] = this.src[0]
|
|
211
213
|
if(this.src[1]){
|
|
212
|
-
src['md'] =
|
|
214
|
+
src['md'] = this.src[1]
|
|
213
215
|
}
|
|
214
216
|
|
|
215
217
|
let imgSrc
|
package/src/components/List.vue
CHANGED
|
@@ -250,7 +250,7 @@ import VirtualGrid from "./VirtualGrid.vue";
|
|
|
250
250
|
import throttle from "lodash/throttle";
|
|
251
251
|
import PresetSelector from "../widgets/PresetSelector.vue";
|
|
252
252
|
import groupBy from "lodash/groupBy";
|
|
253
|
-
import { generatePivotColumns, sortsFn } from "../utils/preset-selector.mjs";
|
|
253
|
+
import { generatePivotColumns, generateTotalColumns, sortsFn } from "../utils/preset-selector.mjs";
|
|
254
254
|
import PresetBar from "../widgets/PresetBar.vue";
|
|
255
255
|
|
|
256
256
|
export default{
|
|
@@ -340,12 +340,11 @@ export default{
|
|
|
340
340
|
itemsPerPage: this.data.itemsPerPage,
|
|
341
341
|
})
|
|
342
342
|
.then(data => {
|
|
343
|
-
|
|
344
343
|
generatePivotColumns(this.preset, data.items)
|
|
344
|
+
generateTotalColumns(this.preset, data.items)
|
|
345
345
|
this.loadEnums(data.items)
|
|
346
346
|
Object.assign(this.data, data ?? {})
|
|
347
347
|
this.$emit('after-load')
|
|
348
|
-
|
|
349
348
|
})
|
|
350
349
|
.catch(err => {
|
|
351
350
|
this.toast(err)
|
|
@@ -586,24 +585,60 @@ export default{
|
|
|
586
585
|
const filters = []
|
|
587
586
|
|
|
588
587
|
for(let idx in this.preset.pivot.rows){
|
|
589
|
-
const
|
|
588
|
+
const pivotRow = this.preset.pivot.rows[idx]
|
|
589
|
+
const key = pivotRow.key
|
|
590
590
|
const presetColumn = this.preset.columns.find(_ => _.key === key)
|
|
591
|
-
let value = item[
|
|
591
|
+
let value = item[pivotRow.key]
|
|
592
592
|
switch(presetColumn.type){
|
|
593
593
|
|
|
594
594
|
case 'bool':
|
|
595
595
|
case 'boolean':
|
|
596
|
-
|
|
596
|
+
filters.push({
|
|
597
|
+
key,
|
|
598
|
+
value: [{
|
|
599
|
+
operator: '=',
|
|
600
|
+
value: value === 'true'
|
|
601
|
+
}]
|
|
602
|
+
})
|
|
603
|
+
break
|
|
604
|
+
|
|
605
|
+
case 'date':
|
|
606
|
+
switch(pivotRow.aggregrate){
|
|
607
|
+
|
|
608
|
+
case 'hour':
|
|
609
|
+
value = value.split('-')
|
|
610
|
+
filters.push({
|
|
611
|
+
key,
|
|
612
|
+
value: [{
|
|
613
|
+
operator: '>=',
|
|
614
|
+
value: value[0] + ':00',
|
|
615
|
+
fn: 'format_hour'
|
|
616
|
+
}]
|
|
617
|
+
})
|
|
618
|
+
filters.push({
|
|
619
|
+
key,
|
|
620
|
+
value: [{
|
|
621
|
+
operator: '<=',
|
|
622
|
+
value: value[1] + ':59',
|
|
623
|
+
fn: 'format_hour'
|
|
624
|
+
}]
|
|
625
|
+
})
|
|
626
|
+
break
|
|
627
|
+
|
|
628
|
+
}
|
|
629
|
+
break
|
|
630
|
+
|
|
631
|
+
default:
|
|
632
|
+
filters.push({
|
|
633
|
+
key,
|
|
634
|
+
value: [{
|
|
635
|
+
operator: '=',
|
|
636
|
+
value
|
|
637
|
+
}]
|
|
638
|
+
})
|
|
597
639
|
break
|
|
598
640
|
}
|
|
599
641
|
|
|
600
|
-
filters.push({
|
|
601
|
-
key,
|
|
602
|
-
value: [{
|
|
603
|
-
operator: '=',
|
|
604
|
-
value
|
|
605
|
-
}]
|
|
606
|
-
})
|
|
607
642
|
}
|
|
608
643
|
|
|
609
644
|
let [ kk, ...vv ] = column.key.split('-')
|
package/src/components/Modal.vue
CHANGED
|
@@ -308,7 +308,7 @@ export default{
|
|
|
308
308
|
|
|
309
309
|
.bW9k{
|
|
310
310
|
@apply z-20 hidden w-[100vw] h-[100vh];
|
|
311
|
-
@apply bg-white/50 backdrop-blur-
|
|
311
|
+
@apply bg-white/50 backdrop-blur-xl;
|
|
312
312
|
position: fixed;
|
|
313
313
|
top: 0;
|
|
314
314
|
left: 0;
|
|
@@ -334,7 +334,7 @@ export default{
|
|
|
334
334
|
background-color: rgba(255, 255, 255, .6)
|
|
335
335
|
}
|
|
336
336
|
html[data-theme='dark'] .modal{
|
|
337
|
-
background-color: rgba(0, 0, 0, .
|
|
337
|
+
background-color: rgba(0, 0, 0, .6)
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
.modal.v-show{
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="tag" v-html="htmlText2[$device.mediaIndex]"></component>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
|
|
7
|
+
import {componentMixin} from "../mixin/component";
|
|
8
|
+
|
|
9
|
+
export default{
|
|
10
|
+
|
|
11
|
+
mixins: [ componentMixin ],
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
|
|
15
|
+
tag: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: 'div'
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
htmlText2: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => []
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style module>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
</style>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<table :class="$style.table" ref="tableHead" :style="tableHeadStyle">
|
|
5
5
|
<thead>
|
|
6
6
|
<tr>
|
|
7
|
-
<th v-for="column in visibleColumns" :style="thStyle(column)"
|
|
7
|
+
<th v-for="column in visibleColumns" :style="thStyle(column)" :class="thClass(column)"
|
|
8
8
|
v-tooltip="`${column.label ? column.label : column.key}`">
|
|
9
9
|
<slot v-if="$slots['col-' + column.key]" :name="'col-' + column.key" :column="column"></slot>
|
|
10
10
|
<div v-else :class="headerColumnClass(column)">
|
|
@@ -32,18 +32,23 @@
|
|
|
32
32
|
</tr>
|
|
33
33
|
</thead>
|
|
34
34
|
<tbody ref="tbody">
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
<tr v-for="(item, index) in visibleItems" :key="item"
|
|
36
|
+
@click="select(item, index)"
|
|
37
|
+
:class="trClass(item, index)">
|
|
38
|
+
<td v-for="(column, columnIndex) in visibleColumns"
|
|
39
|
+
:class="tdClass(item, column)"
|
|
40
|
+
@click="$emit('item-click', item, column)">
|
|
41
|
+
|
|
42
|
+
<div v-if="columnIndex === 0 && item._type === 'totalRow'" :class="$style.total">Total</div>
|
|
43
|
+
<div v-else-if="item._type === 'totalRow' && !column.key.startsWith('_')"></div>
|
|
44
|
+
|
|
45
|
+
<slot v-else-if="$slots[column.key]" :name="column.key" :column="column" :item="item" :index="visibleStartIndex + index"></slot>
|
|
46
|
+
<slot v-else-if="$slots.default" name="default" :column="column" :item="item" :index="visibleStartIndex + index"></slot>
|
|
47
|
+
<div v-else :class="columnClass(column, item)" v-html="formatColumn(item, column)"></div>
|
|
48
|
+
|
|
49
|
+
</td>
|
|
50
|
+
<td :class="$style.spacer"></td>
|
|
51
|
+
</tr>
|
|
47
52
|
</tbody>
|
|
48
53
|
</table>
|
|
49
54
|
<div v-if="state === 2" ref="spinner" class="h-[44px] relative">
|
|
@@ -64,7 +69,7 @@
|
|
|
64
69
|
<table :class="$style.table">
|
|
65
70
|
<tbody>
|
|
66
71
|
<tr>
|
|
67
|
-
<td v-for="column in columns" :style="thStyle(column)">
|
|
72
|
+
<td v-for="column in columns" :style="thStyle(column)" :class="thClass(column)">
|
|
68
73
|
<slot v-if="$slots[column.key]" :name="column.key" :column="column" :item="items[0]"></slot>
|
|
69
74
|
<slot v-else-if="$slots.default" name="default" :column="column" :item="items[0]"></slot>
|
|
70
75
|
<div v-else :class="columnClass(column)" v-html="formatColumn(items[0] ?? {}, column)"></div>
|
|
@@ -246,6 +251,16 @@ export default{
|
|
|
246
251
|
}
|
|
247
252
|
},
|
|
248
253
|
|
|
254
|
+
thClass(column){
|
|
255
|
+
let classNames = []
|
|
256
|
+
|
|
257
|
+
if(column.align){
|
|
258
|
+
classNames.push(`text-${column.align}`)
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return classNames.join(' ')
|
|
262
|
+
},
|
|
263
|
+
|
|
249
264
|
async resize(){
|
|
250
265
|
|
|
251
266
|
this.$nextTick(() => {
|
|
@@ -333,8 +348,16 @@ export default{
|
|
|
333
348
|
case 'currency':
|
|
334
349
|
align = 'right'
|
|
335
350
|
break
|
|
351
|
+
|
|
352
|
+
default:
|
|
353
|
+
if(column.key.startsWith('_'))
|
|
354
|
+
align = 'center'
|
|
355
|
+
break
|
|
336
356
|
}
|
|
337
357
|
}
|
|
358
|
+
else{
|
|
359
|
+
align = column.align
|
|
360
|
+
}
|
|
338
361
|
|
|
339
362
|
let appearanceClass = ''
|
|
340
363
|
if(item && Array.isArray(column.appearances)){
|
|
@@ -351,93 +374,95 @@ export default{
|
|
|
351
374
|
break
|
|
352
375
|
}
|
|
353
376
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
377
|
+
if(!('_type' in item)){
|
|
378
|
+
for(let appearance of column.appearances){
|
|
379
|
+
|
|
380
|
+
let conditionMatched = false
|
|
381
|
+
for(let condition of appearance.conditions ?? []){
|
|
382
|
+
switch(condition.operator){
|
|
383
|
+
|
|
384
|
+
case '>':
|
|
385
|
+
if(value > condition.value){
|
|
386
|
+
conditionMatched = true
|
|
387
|
+
}
|
|
388
|
+
break
|
|
389
|
+
|
|
390
|
+
case '>=':
|
|
391
|
+
if(value >= condition.value){
|
|
392
|
+
conditionMatched = true
|
|
393
|
+
}
|
|
394
|
+
break
|
|
395
|
+
|
|
396
|
+
case '=':
|
|
397
|
+
if(value === condition.value){
|
|
398
|
+
conditionMatched = true
|
|
399
|
+
}
|
|
400
|
+
break
|
|
401
|
+
|
|
402
|
+
case '<':
|
|
403
|
+
if(value < condition.value){
|
|
404
|
+
conditionMatched = true
|
|
405
|
+
}
|
|
406
|
+
break
|
|
407
|
+
|
|
408
|
+
case '<=':
|
|
409
|
+
if(value <= condition.value){
|
|
410
|
+
conditionMatched = true
|
|
411
|
+
}
|
|
412
|
+
break
|
|
413
|
+
|
|
414
|
+
case 'startsWith':
|
|
415
|
+
if(value.startsWith(condition.value)){
|
|
416
|
+
conditionMatched = true
|
|
417
|
+
}
|
|
418
|
+
break
|
|
419
|
+
|
|
420
|
+
case 'notStartsWith':
|
|
421
|
+
if(!value.startsWith(condition.value)){
|
|
422
|
+
conditionMatched = true
|
|
423
|
+
}
|
|
424
|
+
break
|
|
425
|
+
|
|
426
|
+
case 'contains':
|
|
427
|
+
if(value.indexOf(condition.value) >= 0){
|
|
428
|
+
conditionMatched = true
|
|
429
|
+
}
|
|
430
|
+
break
|
|
431
|
+
|
|
432
|
+
case 'notContains':
|
|
433
|
+
if(value.indexOf(condition.value) < 0){
|
|
434
|
+
conditionMatched = true
|
|
435
|
+
}
|
|
436
|
+
break
|
|
437
|
+
|
|
438
|
+
case 'endsWith':
|
|
439
|
+
if(value.endsWith(condition.value)){
|
|
440
|
+
conditionMatched = true
|
|
441
|
+
}
|
|
442
|
+
break
|
|
443
|
+
|
|
444
|
+
case 'notEndsWith':
|
|
445
|
+
if(!value.endsWith(condition.value)){
|
|
446
|
+
conditionMatched = true
|
|
447
|
+
}
|
|
448
|
+
break
|
|
449
|
+
|
|
450
|
+
case 'none':
|
|
362
451
|
conditionMatched = true
|
|
363
|
-
|
|
364
|
-
break
|
|
452
|
+
break
|
|
365
453
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
conditionMatched = true
|
|
369
|
-
}
|
|
370
|
-
break
|
|
454
|
+
case 'regex':
|
|
455
|
+
break
|
|
371
456
|
|
|
372
|
-
|
|
373
|
-
if(value === condition.value){
|
|
374
|
-
conditionMatched = true
|
|
375
|
-
}
|
|
376
|
-
break
|
|
377
|
-
|
|
378
|
-
case '<':
|
|
379
|
-
if(value < condition.value){
|
|
380
|
-
conditionMatched = true
|
|
381
|
-
}
|
|
382
|
-
break
|
|
383
|
-
|
|
384
|
-
case '<=':
|
|
385
|
-
if(value <= condition.value){
|
|
386
|
-
conditionMatched = true
|
|
387
|
-
}
|
|
388
|
-
break
|
|
389
|
-
|
|
390
|
-
case 'startsWith':
|
|
391
|
-
if(value.startsWith(condition.value)){
|
|
392
|
-
conditionMatched = true
|
|
393
|
-
}
|
|
394
|
-
break
|
|
395
|
-
|
|
396
|
-
case 'notStartsWith':
|
|
397
|
-
if(!value.startsWith(condition.value)){
|
|
398
|
-
conditionMatched = true
|
|
399
|
-
}
|
|
400
|
-
break
|
|
401
|
-
|
|
402
|
-
case 'contains':
|
|
403
|
-
if(value.indexOf(condition.value) >= 0){
|
|
404
|
-
conditionMatched = true
|
|
405
|
-
}
|
|
406
|
-
break
|
|
407
|
-
|
|
408
|
-
case 'notContains':
|
|
409
|
-
if(value.indexOf(condition.value) < 0){
|
|
410
|
-
conditionMatched = true
|
|
411
|
-
}
|
|
412
|
-
break
|
|
413
|
-
|
|
414
|
-
case 'endsWith':
|
|
415
|
-
if(value.endsWith(condition.value)){
|
|
416
|
-
conditionMatched = true
|
|
417
|
-
}
|
|
418
|
-
break
|
|
419
|
-
|
|
420
|
-
case 'notEndsWith':
|
|
421
|
-
if(!value.endsWith(condition.value)){
|
|
422
|
-
conditionMatched = true
|
|
423
|
-
}
|
|
424
|
-
break
|
|
425
|
-
|
|
426
|
-
case 'none':
|
|
427
|
-
conditionMatched = true
|
|
428
|
-
break
|
|
429
|
-
|
|
430
|
-
case 'regex':
|
|
431
|
-
break
|
|
457
|
+
}
|
|
432
458
|
|
|
459
|
+
if(conditionMatched) break
|
|
433
460
|
}
|
|
434
461
|
|
|
435
|
-
if(conditionMatched)
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
appearanceClass = appearance.class
|
|
440
|
-
break
|
|
462
|
+
if(conditionMatched){
|
|
463
|
+
appearanceClass = appearance.class
|
|
464
|
+
break
|
|
465
|
+
}
|
|
441
466
|
}
|
|
442
467
|
}
|
|
443
468
|
}
|
|
@@ -665,4 +690,8 @@ export default{
|
|
|
665
690
|
@apply inline-block m-1 rounded-md bg-orange-600 text-white px-2 text-sm;
|
|
666
691
|
}
|
|
667
692
|
|
|
693
|
+
.total{
|
|
694
|
+
@apply px-3 uppercase font-bold;
|
|
695
|
+
}
|
|
696
|
+
|
|
668
697
|
</style>
|
package/src/index.js
CHANGED
|
@@ -10,13 +10,13 @@ const uniqid = (additionalKey = '') => {
|
|
|
10
10
|
return 'u' + Math.random().toString(36).substr(2) + Date.now().toString(36)
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const mediaBreakpoints =
|
|
14
|
-
640
|
|
15
|
-
768
|
|
16
|
-
1024
|
|
17
|
-
1280
|
|
18
|
-
1536
|
|
19
|
-
|
|
13
|
+
const mediaBreakpoints = [
|
|
14
|
+
[ 640, 'sm:' ],
|
|
15
|
+
[ 768, 'md:' ],
|
|
16
|
+
[ 1024, 'lg:' ],
|
|
17
|
+
[ 1280, 'xl:' ],
|
|
18
|
+
[ 1536, '2xl:' ],
|
|
19
|
+
]
|
|
20
20
|
|
|
21
21
|
const download = (url, as) => {
|
|
22
22
|
url = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'nocache=' + new Date().getTime()
|
|
@@ -291,14 +291,18 @@ const util = {
|
|
|
291
291
|
|
|
292
292
|
calculateMediaPrefix(width){
|
|
293
293
|
|
|
294
|
-
let
|
|
295
|
-
|
|
294
|
+
let media = ''
|
|
295
|
+
let mediaIndex = 0
|
|
296
|
+
for(let breakpointIdx in mediaBreakpoints){
|
|
297
|
+
const [ breakpoint, breakpointPrefix ] = mediaBreakpoints[breakpointIdx]
|
|
296
298
|
if(width > breakpoint){
|
|
297
|
-
|
|
299
|
+
media = breakpointPrefix
|
|
300
|
+
mediaIndex = breakpointIdx
|
|
298
301
|
}
|
|
302
|
+
else break
|
|
299
303
|
}
|
|
300
304
|
|
|
301
|
-
return
|
|
305
|
+
return { media, mediaIndex }
|
|
302
306
|
},
|
|
303
307
|
|
|
304
308
|
uniqid
|
|
@@ -403,29 +407,9 @@ export default{
|
|
|
403
407
|
app.config.globalProperties.timeLog = consoleTimeLog
|
|
404
408
|
app.config.globalProperties.timeEnd = consoleTimeEnd
|
|
405
409
|
app.config.globalProperties.$device = reactive({
|
|
406
|
-
|
|
407
|
-
getValue: (arr) => {
|
|
408
|
-
if(Array.isArray(arr)){
|
|
409
|
-
let index = 0
|
|
410
|
-
switch(app.config.globalProperties.$device){
|
|
411
|
-
case 'md':
|
|
412
|
-
index = 1
|
|
413
|
-
break
|
|
414
|
-
case 'lg':
|
|
415
|
-
index = 2
|
|
416
|
-
break
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
for(let i = index ; i >= 0 ; i--){
|
|
420
|
-
if(arr && arr[i])
|
|
421
|
-
return arr[i]
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
|
|
426
410
|
type: 'mobile',
|
|
427
411
|
media: '',
|
|
428
|
-
|
|
412
|
+
mediaIndex: 0
|
|
429
413
|
})
|
|
430
414
|
app.config.globalProperties.$isDebugMode = () => {
|
|
431
415
|
if(!('isDebugMode' in privateVars)){
|
|
@@ -477,18 +461,16 @@ export default{
|
|
|
477
461
|
}
|
|
478
462
|
|
|
479
463
|
const onWindowResize = throttle(() => {
|
|
480
|
-
|
|
481
464
|
Object.assign(app.config.globalProperties.$device, {
|
|
482
465
|
type: getDeviceType(),
|
|
483
|
-
|
|
466
|
+
...util.calculateMediaPrefix(document.documentElement.clientWidth)
|
|
484
467
|
})
|
|
485
468
|
|
|
486
469
|
resizeEvents.forEach((fn) => fn())
|
|
487
|
-
},
|
|
470
|
+
}, 300, {leading: true})
|
|
488
471
|
window.addEventListener('resize', onWindowResize)
|
|
489
472
|
|
|
490
473
|
app.config.globalProperties.$addResizeListener = (el, fn) => {
|
|
491
|
-
|
|
492
474
|
if (!resizeObserver) {
|
|
493
475
|
resizeObserver = new ResizeObserver((entries) => {
|
|
494
476
|
for (const entry of entries) {
|
|
@@ -515,8 +497,8 @@ export default{
|
|
|
515
497
|
app.config.globalProperties.$onMounted = () => {
|
|
516
498
|
Object.assign(app.config.globalProperties.$device, {
|
|
517
499
|
type: getDeviceType(),
|
|
518
|
-
|
|
519
|
-
|
|
500
|
+
touchSupported: isTouchSupported(),
|
|
501
|
+
...util.calculateMediaPrefix(document.documentElement.clientWidth)
|
|
520
502
|
})
|
|
521
503
|
}
|
|
522
504
|
}
|
|
@@ -658,6 +640,7 @@ export default{
|
|
|
658
640
|
app.component('WebPageBuilder', defineAsyncComponent(() => import("./widgets/WebPageBuilder.vue")))
|
|
659
641
|
app.component('WebPageBuilder2', defineAsyncComponent(() => import("./widgets/WebPageBuilder2.vue")))
|
|
660
642
|
app.component('WebPageBuilder3', defineAsyncComponent(() => import("./widgets/WebPageBuilder3.vue")))
|
|
643
|
+
app.component('WebPageBuilder4', defineAsyncComponent(() => import("./widgets/WebPageBuilder4.vue")))
|
|
661
644
|
app.component('WebPagePreview', defineAsyncComponent(() => import("./widgets/WebPagePreview.vue")))
|
|
662
645
|
app.component('WebComponentSelector', defineAsyncComponent(() => import("./widgets/WebComponentSelector.vue")))
|
|
663
646
|
app.component('WebDatasourceSelector', defineAsyncComponent(() => import("./widgets/WebDatasourceSelector.vue")))
|
|
@@ -685,6 +668,7 @@ export default{
|
|
|
685
668
|
app.component('TypographySetting', defineAsyncComponent(() => import("./widgets/TypographySetting.vue")))
|
|
686
669
|
app.component('FiltersSetting', defineAsyncComponent(() => import("./widgets/FiltersSetting.vue")))
|
|
687
670
|
app.component('MenuEditor', defineAsyncComponent(() => import("./widgets/MenuEditor.vue")))
|
|
671
|
+
app.component('Text', defineAsyncComponent(() => import("./components/Text.vue")))
|
|
688
672
|
}
|
|
689
673
|
|
|
690
674
|
}
|
package/src/main.js
CHANGED
|
@@ -5,14 +5,6 @@ import { createRouter } from './router'
|
|
|
5
5
|
import WebScaffold from './index'
|
|
6
6
|
import './index.css'
|
|
7
7
|
|
|
8
|
-
const AppScaffold = {
|
|
9
|
-
install: (app, options) => {
|
|
10
|
-
app.component('PropertyTable', defineAsyncComponent(() => import("./pages/playground/components/PropertyTable.vue")))
|
|
11
|
-
app.component('Preview', defineAsyncComponent(() => import("./pages/playground/components/Preview.vue")))
|
|
12
|
-
app.component('SourceCode', defineAsyncComponent(() => import("./pages/playground/components/SourceCode.vue")))
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
8
|
export function createApp(){
|
|
17
9
|
|
|
18
10
|
const app = createSSRApp(App)
|
|
@@ -22,7 +14,6 @@ export function createApp(){
|
|
|
22
14
|
app.use(router)
|
|
23
15
|
app.use(pinia)
|
|
24
16
|
app.use(WebScaffold)
|
|
25
|
-
app.use(AppScaffold)
|
|
26
17
|
|
|
27
18
|
return { app, router, pinia }
|
|
28
19
|
}
|
package/src/mixin/component.js
CHANGED
|
@@ -67,6 +67,7 @@ export const componentMixin = {
|
|
|
67
67
|
},
|
|
68
68
|
|
|
69
69
|
htmlText: String,
|
|
70
|
+
htmlText2: Array,
|
|
70
71
|
|
|
71
72
|
editSelectable: {
|
|
72
73
|
type: undefined,
|
|
@@ -119,7 +120,7 @@ export const componentMixin = {
|
|
|
119
120
|
},
|
|
120
121
|
|
|
121
122
|
componentClick(e){
|
|
122
|
-
if(this.editMode
|
|
123
|
+
if(!this.editMode) return
|
|
123
124
|
|
|
124
125
|
e.stopPropagation()
|
|
125
126
|
e.preventDefault()
|