@mixd-id/web-scaffold 0.1.230406195 → 0.1.230406197

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406195",
4
+ "version": "0.1.230406197",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <a v-if="isExternalLink" :href="href" :target="target" :class="compClass">
2
+ <a v-if="isExternalLink" :href="href" :target="target" :class="compClass" :style="computedStyle">
3
3
  <slot>{{ text }}</slot>
4
4
  </a>
5
5
  <router-link v-else :to="href" :target="target" :class="compClass">
@@ -59,7 +59,6 @@ export default {
59
59
  @apply relative flex items-center justify-center;
60
60
  @apply whitespace-nowrap text-ellipsis overflow-hidden;
61
61
  @apply rounded-lg;
62
- background-image: v-bind(bgImages[0]);
63
62
  }
64
63
  .button>*:first-child{
65
64
  @apply flex items-center justify-center
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp">
2
+ <div :class="$style.comp" :style="computedStyle">
3
3
  <article ref="article" :class="$style.article"
4
4
  v-html="computedHtml"
5
5
  :contenteditable="editMode === 1"
@@ -352,7 +352,6 @@ export default{
352
352
 
353
353
  .comp{
354
354
  @apply relative;
355
- background-image: v-bind(bgImages[0]);
356
355
  }
357
356
 
358
357
  .article{
@@ -391,10 +390,4 @@ export default{
391
390
  @apply break-words;
392
391
  }
393
392
 
394
- @media screen(md){
395
- .comp{
396
- background-image: v-bind(bgImages[1]);
397
- }
398
- }
399
-
400
393
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp">
2
+ <div :class="$style.comp" :style="computedStyle">
3
3
  <component v-for="item in items"
4
4
  :is="item.type"
5
5
  :="item" />
@@ -26,13 +26,6 @@ export default{
26
26
 
27
27
  .comp{
28
28
  @apply block;
29
- background-image: v-bind(bgImages[0]);
30
- }
31
-
32
- @media screen(md){
33
- .comp{
34
- background-image: v-bind(bgImages[1]);
35
- }
36
29
  }
37
30
 
38
31
  </style>
@@ -29,13 +29,6 @@ export default{
29
29
 
30
30
  .comp{
31
31
  @apply flex items-center justify-center;
32
- background-image: v-bind(bgImages[0]);
33
- }
34
-
35
- @media screen and (min-width: 768px){
36
- .comp{
37
- background-image: v-bind(bgImages[1]);
38
- }
39
32
  }
40
33
 
41
34
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <button :class="compClass" :disabled="isDisabled" @click="onClick">
2
+ <button :class="compClass" :disabled="isDisabled" @click="onClick" :style="computedStyle">
3
3
  <slot>{{ text }}</slot>
4
4
  <div v-if="isLoading" :class="$style.loadingPane">
5
5
  <svg :class="$style.spinner" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
@@ -88,7 +88,7 @@ export default{
88
88
  this.$el.focus()
89
89
  },
90
90
 
91
- setState(state){
91
+ setState(state, percentage){
92
92
  this._state = state
93
93
  },
94
94
 
@@ -136,7 +136,6 @@ export default{
136
136
  @apply relative flex items-center justify-center;
137
137
  @apply whitespace-nowrap text-ellipsis overflow-hidden;
138
138
  @apply rounded-lg;
139
- background-image: v-bind(bgImages[0]);
140
139
  }
141
140
  .button>*:first-child{
142
141
  @apply flex items-center justify-center
@@ -279,6 +278,9 @@ export default{
279
278
  .loadingPane{
280
279
  @apply absolute left-0 top-0 right-0 bottom-0 flex items-center justify-center pl-1;
281
280
  }
281
+ .loading{
282
+ color: transparent;
283
+ }
282
284
  .loading>*:first-child{
283
285
  @apply opacity-0
284
286
  }
@@ -298,10 +300,4 @@ export default{
298
300
  @apply animate-spin h-5 w-5;
299
301
  }
300
302
 
301
- @media screen(md){
302
- .button{
303
- background-image: v-bind(bgImages[1]);
304
- }
305
- }
306
-
307
303
  </style>
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <div :class="$style.comp" @mousedown="mouseDown" @touchstart.passive="mouseDown">
2
+ <div :class="$style.comp"
3
+ @mousedown="mouseDown"
4
+ @touchstart.passive="mouseDown"
5
+ :style="computedStyle">
3
6
 
4
7
  <div ref="inner" :class="computedContainerClass">
5
8
  <div v-for="item in items" :class="computedItemClass">
@@ -315,7 +318,6 @@ export default{
315
318
  white-space: nowrap;
316
319
  overflow: hidden;
317
320
  position: relative;
318
- background-image: v-bind(bgImages[0]);
319
321
  }
320
322
 
321
323
  .comp img{
@@ -375,10 +377,4 @@ export default{
375
377
  -webkit-overflow-scrolling: touch;
376
378
  }
377
379
 
378
- @media screen(md){
379
- .comp{
380
- background-image: v-bind(bgImages[1]);
381
- }
382
- }
383
-
384
380
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.Flex">
2
+ <div :class="$style.Flex" :style="computedStyle">
3
3
 
4
4
  <component v-for="(item, idx) in items"
5
5
  :is="item.type"
@@ -23,10 +23,6 @@ export default{
23
23
  columnType: Array,
24
24
  },
25
25
 
26
- methods: {
27
-
28
- }
29
-
30
26
  }
31
27
 
32
28
  </script>
@@ -35,12 +31,5 @@ export default{
35
31
 
36
32
  .Flex{
37
33
  @apply flex;
38
- background-image: v-bind(bgImages[0]);
39
- }
40
-
41
- @media screen(md){
42
- .Flex{
43
- background-image: v-bind(bgImages[1]);
44
- }
45
34
  }
46
35
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp">
2
+ <div :class="$style.comp" :style="computedStyle">
3
3
 
4
4
  <component v-for="item in items"
5
5
  :is="item.type"
@@ -28,13 +28,6 @@ export default{
28
28
 
29
29
  .comp{
30
30
  @apply grid w-full;
31
- background-image: v-bind(bgImages[0]);
32
- }
33
-
34
- @media screen(md){
35
- .comp{
36
- background-image: v-bind(bgImages[1]);
37
- }
38
31
  }
39
32
 
40
33
  </style>
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <div :class="$style.comp" @click="onClick" @mousemove="onMouseMove" @mousedown="onMouseDown">
2
+ <div :class="$style.comp"
3
+ @click="onClick"
4
+ @mousemove="onMouseMove"
5
+ @mousedown="onMouseDown"
6
+ :style="computedStyle">
3
7
 
4
8
  <slot v-if="status === 0" name="empty" :instance="this"></slot>
5
9
 
@@ -260,7 +264,6 @@ export default{
260
264
 
261
265
  .comp{
262
266
  @apply relative overflow-hidden;
263
- background-image: v-bind(bgImages[0]);
264
267
  }
265
268
 
266
269
  .img{
@@ -280,10 +283,4 @@ export default{
280
283
  @apply bg-text-200 animate-pulse;
281
284
  }
282
285
 
283
- @media screen and (min-width: 768px){
284
- .comp{
285
- background-image: v-bind(bgImages[1]);
286
- }
287
- }
288
-
289
286
  </style>
@@ -1,31 +1,31 @@
1
1
  <template>
2
2
  <a v-if="mode === 'download' && items.length > 0"
3
- :href="download.url"
4
- :download="download.as ?? ''">
3
+ :href="(download ?? {}).url"
4
+ :download="download.as ?? ((download ?? {}).originalName ?? '')">
5
5
  <component v-for="(item, idx) in items"
6
6
  :is="item.type"
7
7
  :key="idx"
8
8
  :="item" />
9
9
  </a>
10
10
  <a v-else-if="mode === 'download'"
11
- :href="download.url"
12
- :download="download.as ?? ''">
11
+ :href="(download ?? {}).url"
12
+ :download="(download ?? {}).as ?? ((download ?? {}).originalName ?? '')">
13
13
  {{ text }}
14
14
  </a>
15
- <a v-else-if="isExternalLink && items.length > 0" :target="target">
15
+ <a v-else-if="mode === 'link' && items.length > 0" :target="target">
16
16
  <component v-for="(item, idx) in items"
17
17
  :is="item.type"
18
18
  :key="idx"
19
19
  :="item" />
20
20
  </a>
21
- <a v-else-if="isExternalLink" :href="href" :target="target">{{ text }}</a>
22
- <router-link v-else-if="items.length > 0" :to="href">
21
+ <a v-else-if="mode === 'link'" :href="href" :target="target">{{ text }}</a>
22
+ <router-link v-else-if="items.length > 0" :to="to">
23
23
  <component v-for="(item, idx) in items"
24
24
  :is="item.type"
25
25
  :key="idx"
26
26
  :="item" />
27
27
  </router-link>
28
- <router-link v-else :to="href">{{ text }}</router-link>
28
+ <router-link v-else :to="to">{{ text }}</router-link>
29
29
  </template>
30
30
 
31
31
  <script>
@@ -42,6 +42,10 @@ export default{
42
42
  type: String,
43
43
  default: ''
44
44
  },
45
+ route: {
46
+ type: Object,
47
+ default: {}
48
+ },
45
49
  mode: String,
46
50
  target: String,
47
51
  text: String,
@@ -54,6 +58,18 @@ export default{
54
58
  return (this.href ?? '').indexOf('://') > -1;
55
59
  },
56
60
 
61
+ to(){
62
+ const obj = {}
63
+
64
+ if(this.route.hash)
65
+ obj.hash = '#' + this.route.hash
66
+
67
+ if(this.route.path)
68
+ obj.path = this.route.path
69
+
70
+ return obj
71
+ }
72
+
57
73
  }
58
74
 
59
75
  }
@@ -10,7 +10,12 @@
10
10
  :class="computedClass"
11
11
  :style="computedStyle"
12
12
  :data-state="computedState ? 1 : 0">
13
- <form v-if="useForm" @submit.prevent="$emit('submit')">
13
+ <component v-if="Array.isArray(items) && items.length > 0"
14
+ v-for="(item, idx) in items"
15
+ :is="item.type"
16
+ :key="item.key"
17
+ :="item" />
18
+ <form v-else-if="useForm" @submit.prevent="$emit('submit')">
14
19
  <div class="modal-head">
15
20
  <slot name="head" :context="context"></slot>
16
21
  </div>
@@ -91,6 +96,8 @@ export default{
91
96
  },
92
97
 
93
98
  mode: 'v-if', // v-if or v-show
99
+
100
+ items: Array,
94
101
  },
95
102
 
96
103
  methods: {
package/src/index.js CHANGED
@@ -444,6 +444,8 @@ export default{
444
444
  app.component('Header1', defineAsyncComponent(() => import("./widgets/Header1.vue")))
445
445
  app.component('Header2', defineAsyncComponent(() => import("./widgets/Header2.vue")))
446
446
  app.component('HeaderSetting', defineAsyncComponent(() => import("./widgets/HeaderSetting.vue")))
447
+ app.component('Header1Setting', defineAsyncComponent(() => import("./widgets/Header1Setting.vue")))
448
+ app.component('Header2Setting', defineAsyncComponent(() => import("./widgets/Header2Setting.vue")))
447
449
  app.component('IconList', defineAsyncComponent(() => import("./widgets/IconList.vue")))
448
450
  app.component('IconListSetting', defineAsyncComponent(() => import("./widgets/IconListSetting.vue")))
449
451
  app.component('LinkSetting', defineAsyncComponent(() => import("./widgets/LinkSetting.vue")))
@@ -467,5 +469,6 @@ export default{
467
469
  app.component('WebPageSelector', defineAsyncComponent(() => import("./widgets/WebPageSelector.vue")))
468
470
  app.component('WebLayoutSelector', defineAsyncComponent(() => import("./widgets/WebLayoutSelector.vue")))
469
471
  app.component('WebTemplateCreator', defineAsyncComponent(() => import("./widgets/WebTemplateCreator.vue")))
472
+ app.component('ModalSetting', defineAsyncComponent(() => import("./widgets/ModalSetting.vue")))
470
473
  }
471
474
  }
@@ -87,6 +87,17 @@ export const componentMixin = {
87
87
  ]
88
88
  },
89
89
 
90
+ computedStyle(){
91
+
92
+ const obj = {}
93
+
94
+ if(this.bgImages && this.bgImages[0]){
95
+ obj['background-image'] = this.bgImages[0]
96
+ }
97
+
98
+ return obj
99
+ },
100
+
90
101
  pageData(){
91
102
  return (this.page ?? {}).data
92
103
  },
@@ -1681,10 +1681,17 @@ export default{
1681
1681
  [ '6', 'h-6' ],
1682
1682
  [ '7', 'h-7' ],
1683
1683
  [ '8', 'h-8' ],
1684
+ [ '9', 'h-9' ],
1685
+ [ '10', 'h-10' ],
1686
+ [ '11', 'h-11' ],
1684
1687
  [ '12', 'h-12' ],
1688
+ [ '14', 'h-14' ],
1685
1689
  [ '16', 'h-16' ],
1686
1690
  [ '20', 'h-20' ],
1687
- [ '1/4', 'h-1/4' ],
1691
+ [ '24', 'h-24' ],
1692
+ [ '32', 'h-32' ],
1693
+ [ '36', 'h-36' ],
1694
+ [ '48', 'h-48' ],
1688
1695
  [ '10vh', 'h-10vh' ],
1689
1696
  [ '20vh', 'h-20vh' ],
1690
1697
  [ '30vh', 'h-30vh' ],
@@ -1937,6 +1944,11 @@ export default{
1937
1944
  [ '3', 'w-3' ],
1938
1945
  [ '4', 'w-4' ],
1939
1946
  [ '5', 'w-5' ],
1947
+ [ '6', 'w-6' ],
1948
+ [ '8', 'w-8' ],
1949
+ [ '10', 'w-10' ],
1950
+ [ '12', 'w-12' ],
1951
+ [ '16', 'w-16' ],
1940
1952
  [ '20', 'w-20' ],
1941
1953
  [ '24', 'w-24' ],
1942
1954
  [ '28', 'w-28' ],
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp" v-if="state === 1">
2
+ <div :class="$style.comp" v-if="state === 1" :style="computedStyle">
3
3
 
4
4
  <div class="flex flex-col gap-1">
5
5
  <h2 v-if="title">{{ title }}</h2>
@@ -155,13 +155,6 @@ export default{
155
155
  @apply flex-1 w-full max-w-[480px] min-h-[480px] mx-auto rounded-lg overflow-hidden;
156
156
  @apply border-text-200 border-[1px] p-6;
157
157
  @apply flex flex-col justify-center gap-8 bg-base;
158
- background-image: v-bind(bgImages[0]);
159
- }
160
-
161
- @media screen and (min-width: 768px){
162
- .comp{
163
- background-image: v-bind(bgImages[1]);
164
- }
165
158
  }
166
159
 
167
160
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp">
2
+ <div :class="$style.comp" :style="computedStyle">
3
3
  <iframe :class="videoClass"
4
4
  :src="computedSrc"
5
5
  frameborder="0"
@@ -49,7 +49,6 @@ export default{
49
49
 
50
50
  .comp{
51
51
  @apply flex flex-col;
52
- background-image: v-bind(bgImages[0]);
53
52
  }
54
53
 
55
54
  .video{
@@ -58,10 +57,4 @@ export default{
58
57
  width: 100%;
59
58
  }
60
59
 
61
- @media screen and (min-width: 768px){
62
- .comp{
63
- background-image: v-bind(bgImages[1]);
64
- }
65
- }
66
-
67
60
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp">
2
+ <div :class="$style.comp" :style="computedStyle">
3
3
  <h3>{{ title }}</h3>
4
4
  <div :class="$style.items">
5
5
  <div v-for="(item, idx) in items" :class="$style.item">
@@ -39,7 +39,6 @@ export default{
39
39
 
40
40
  .comp{
41
41
  @apply w-full mx-auto max-w-screen-md;
42
- background-image: v-bind(bgImages[0]);
43
42
  }
44
43
 
45
44
  .items{
@@ -77,10 +76,4 @@ export default{
77
76
  @apply rotate-180
78
77
  }
79
78
 
80
- @media screen(md){
81
- .comp{
82
- background-image: v-bind(bgImages[1]);
83
- }
84
- }
85
-
86
79
  </style>
@@ -1,5 +1,7 @@
1
1
  <template>
2
- <div :class="$style.comp" v-if="Array.isArray(items) && items.length > 0">
2
+ <div :class="$style.comp"
3
+ v-if="Array.isArray(items) && items.length > 0"
4
+ :style="computedStyle">
3
5
  <div v-if="id" :id="id" :class="$style.anchor"></div>
4
6
  <div class="mb-8">
5
7
  <h3>{{ title ?? '' }}</h3>
@@ -82,7 +84,6 @@ export default{
82
84
  .comp{
83
85
  @apply relative;
84
86
  @apply w-full max-w-screen-xl mx-auto p-6;
85
- background-image: v-bind(bgImages[0]);
86
87
  }
87
88
 
88
89
  .container{
@@ -97,12 +98,6 @@ export default{
97
98
  @apply absolute top-[-80px];
98
99
  }
99
100
 
100
- @media screen(md){
101
- .comp{
102
- background-image: v-bind(bgImages[1]);
103
- }
104
- }
105
-
106
101
  </style>
107
102
 
108
103
  <style>
@@ -1,19 +1,9 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
- <div class="w-[60px]">
4
- <button class="p-4">
5
- <svg width="28" height="28" viewBox="0 0 24 24" class="fill-text" xmlns="http://www.w3.org/2000/svg">
6
- <path fill-rule="evenodd" clip-rule="evenodd" d="M4.25 16C4.25 15.5858 4.58579 15.25 5 15.25H19C19.4142 15.25 19.75 15.5858 19.75 16C19.75 16.4142 19.4142 16.75 19 16.75H5C4.58579 16.75 4.25 16.4142 4.25 16Z"/>
7
- <path fill-rule="evenodd" clip-rule="evenodd" d="M4.25 8C4.25 7.58579 4.58579 7.25 5 7.25H19C19.4142 7.25 19.75 7.58579 19.75 8C19.75 8.41421 19.4142 8.75 19 8.75H5C4.58579 8.75 4.25 8.41421 4.25 8Z"/>
8
- </svg>
9
- </button>
10
- </div>
11
- <div class="flex-1 flex justify-center items-center">
12
- <Image :src="logoUrl" class="max-w-[35vw] h-[56px]"/>
13
- </div>
14
- <div class="w-[60px]">
15
-
16
- </div>
3
+ <component v-for="(item, idx) in items"
4
+ :is="item.type"
5
+ :key="item.key"
6
+ :="item" />
17
7
  </div>
18
8
  </template>
19
9
 
@@ -26,7 +16,8 @@ export default{
26
16
  mixins: [ componentMixin ],
27
17
 
28
18
  props: {
29
- images: Object
19
+ images: Object,
20
+ items: Array,
30
21
  },
31
22
 
32
23
  computed: {
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <div class="flex flex-col gap-6">
3
+
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+
9
+ export default{
10
+
11
+ emits: [ 'change' ],
12
+
13
+ inject: [ 'alert', 'imageSrc', 'openComponentSelector', 'uploadImage' ],
14
+
15
+ props: {
16
+
17
+ item: {
18
+ type: Object,
19
+ required: true
20
+ },
21
+
22
+ viewType: String,
23
+
24
+ viewTypes: Array,
25
+
26
+ },
27
+
28
+ computed: {
29
+
30
+ logoSrc(){
31
+ if(!this.item.props.images){
32
+ this.item.props.images = {}
33
+ }
34
+
35
+ return typeof this.item.props.images .logo === 'string' ?
36
+ import.meta.env.VITE_IMAGE_HOST + '/' + this.item.props.images.logo :
37
+ this.item.props.images.logo
38
+ },
39
+
40
+ menu(){
41
+ if(!this.item.props.menu){
42
+ this.item.props.menu = []
43
+ }
44
+
45
+ return this.item.props.menu
46
+ },
47
+
48
+ icons(){
49
+ if(!this.item.props.icons){
50
+ this.item.props.icons = []
51
+ }
52
+
53
+ return this.item.props.icons
54
+ },
55
+
56
+ },
57
+
58
+ methods: {
59
+
60
+
61
+ }
62
+
63
+ }
64
+
65
+ </script>
66
+
67
+ <style module>
68
+
69
+ .imageBg{
70
+ @apply p-2 bg-white;
71
+ background-image: radial-gradient(rgba(var(--primary-500)) 1px, transparent 1px);
72
+ background-size: calc(10 * 1px) calc(10 * 1px);
73
+ }
74
+
75
+ </style>