@mixd-id/web-scaffold 0.1.230406110 → 0.1.230406111

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.230406110",
4
+ "version": "0.1.230406111",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -1,31 +1,199 @@
1
1
  <template>
2
- <a v-if="isExternalLink" :href="href" :target="target">
3
- <slot />
2
+ <a v-if="isExternalLink" :href="href" :target="target" :class="compClass">
3
+ <slot>{{ text }}</slot>
4
4
  </a>
5
- <router-link v-else :to="href" :target="target">
6
- <slot />
5
+ <router-link v-else :to="href" :target="target" :class="compClass">
6
+ <slot>{{ text }}</slot>
7
7
  </router-link>
8
8
  </template>
9
9
 
10
10
  <script>
11
11
 
12
+ import {componentMixin} from "../mixin/component";
13
+
12
14
  export default {
13
15
 
16
+ mixins: [ componentMixin ],
17
+
14
18
  props: {
15
- href: String,
16
- target: String
19
+
20
+ href: {
21
+ type: String,
22
+ default: ''
23
+ },
24
+
25
+ target: String,
26
+
27
+ text: String,
28
+
29
+ variant: {
30
+ type: [ String, Number ],
31
+ default: "primary" // primary|secondary|outline, default:primary
32
+ },
17
33
  },
18
34
 
19
35
  computed: {
20
36
 
21
37
  isExternalLink() {
22
38
  return typeof this.href === 'string' && this.href.indexOf('://') > 0
23
- }
39
+ },
40
+
41
+ compClass(){
42
+ return [
43
+ this.$style.button,
44
+ this.$style['button-' + this.variant]
45
+ ]
46
+ .filter(_ => _)
47
+ .join(' ')
48
+ },
24
49
  },
25
50
  }
26
51
  </script>
27
52
 
28
53
  <style module>
29
54
 
55
+ .button{
56
+ @apply p-2 h-[var(--h-cp)];
57
+ @apply relative flex items-center justify-center;
58
+ @apply whitespace-nowrap text-ellipsis overflow-hidden;
59
+ @apply rounded-lg;
60
+ background-image: v-bind(bgImages[0]);
61
+ }
62
+ .button>*:first-child{
63
+ @apply flex items-center justify-center
64
+ }
65
+ .button:disabled{
66
+ @apply opacity-60;
67
+ }
68
+ .button:active{
69
+ @apply top-[1px] left-[1px] relative;
70
+ }
71
+
72
+ .button-primary{
73
+ @apply bg-primary-500 text-white rounded-lg;
74
+ box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
75
+ outline: solid 1px rgb(var(--primary-700));
76
+ border: solid 1px rgb(var(--primary-400));
77
+ }
78
+ .button-primary:focus{
79
+ outline-color: rgb(var(--primary-800));
80
+ border-color: rgb(var(--primary-600));
81
+ }
82
+ .button-primary:hover{
83
+ @apply bg-primary-600;
84
+ outline-color: rgb(var(--primary-800))
85
+ }
86
+ .button-primary:disabled{
87
+ @apply bg-primary-500 opacity-50 top-0 left-0 cursor-not-allowed;
88
+ @apply top-0 left-0;
89
+ outline: solid 1px rgb(var(--primary-700));
90
+ }
91
+ .button-primary *{
92
+ @apply text-white fill-white;
93
+ }
94
+ .button-primary.loading *{
95
+ @apply fill-transparent
96
+ }
97
+ .button-primary .svgBg{
98
+ stroke: #fff;
99
+ stroke-opacity: 25%;
100
+ }
101
+ .button-primary .svgHg{
102
+ fill: #fff;
103
+ fill-opacity: 75%;
104
+ }
105
+
106
+ .button-outline{
107
+ @apply bg-transparent text-primary-500;
108
+ outline: solid 1px rgb(var(--primary-700));
109
+ }
110
+ .button-outline:hover{
111
+ outline-color: rgb(var(--primary-800))
112
+ }
113
+ .button-outline:disabled{
114
+ @apply opacity-50 top-0 left-0 cursor-not-allowed;
115
+ @apply text-text border-primary-500;
116
+ }
117
+ .button-outline *{
118
+ @apply text-primary-500 fill-primary-500;
119
+ }
120
+ .button-outline.loading *{
121
+ @apply fill-transparent
122
+ }
123
+ .button-outline .svgBg{
124
+ stroke: rgb(var(--primary-600));
125
+ stroke-opacity: 50%;
126
+ }
127
+ .button-outline .svgHg{
128
+ fill: rgb(var(--primary));
129
+ fill-opacity: 100%;
130
+ }
131
+
132
+ .button-secondary{
133
+ @apply bg-secondary text-text-500 rounded-lg;
134
+ box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
135
+ outline: solid 1px rgb(var(--secondary-700));
136
+ border: solid 1px rgb(var(--secondary-400));
137
+ }
138
+ .button-secondary:hover{
139
+ @apply bg-secondary-600;
140
+ outline-color: rgb(var(--secondary-800))
141
+ }
142
+ .button-secondary:disabled{
143
+ @apply bg-secondary-500 opacity-50 top-0 left-0 cursor-not-allowed;
144
+ outline: solid 1px rgb(var(--secondary-700));
145
+ }
146
+ .button-secondary *{
147
+ @apply text-text-500 fill-white;
148
+ }
149
+ .button-secondary.loading *{
150
+ @apply fill-transparent
151
+ }
152
+ .button-secondary .svgBg{
153
+ stroke: rgb(var(--text-400));
154
+ stroke-opacity: 25%;
155
+ }
156
+ .button-secondary .svgHg{
157
+ fill: rgb(var(--text-500));
158
+ fill-opacity: 75%;
159
+ }
160
+
161
+ .button-red{
162
+ @apply bg-red-500 text-white rounded-md border-[2px] border-red-500;
163
+ }
164
+ .button-red:hover{
165
+ @apply bg-red-600 border-red-600;
166
+ }
167
+ .button-red:disabled{
168
+ @apply bg-red-500 border-red-500 opacity-50 top-0 left-0 cursor-not-allowed;
169
+ }
170
+ .button-red *{
171
+ @apply text-white fill-white;
172
+ }
173
+ .button-red.loading *{
174
+ @apply fill-transparent
175
+ }
176
+ .button-red .svgBg{
177
+ @apply stroke-red-400;
178
+ stroke-opacity: 50%;
179
+ }
180
+ .button-red .svgHg{
181
+ @apply fill-text-500;
182
+ fill-opacity: 100%;
183
+ }
184
+
185
+ .button-minimal{
186
+ @apply border-[2px] border-transparent;
187
+ }
188
+ .button-minimal:hover{
189
+ }
190
+ .button-minimal .svgBg{
191
+ stroke: rgb(var(--text-500));
192
+ stroke-opacity: 25%;
193
+ }
194
+ .button-minimal .svgHg{
195
+ fill: rgb(var(--text));
196
+ fill-opacity: 75%;
197
+ }
30
198
 
31
199
  </style>
@@ -113,11 +113,12 @@ export default{
113
113
 
114
114
  const rect = this.$el.getBoundingClientRect()
115
115
  const startX = e.clientX
116
+ const startY = e.clientY
116
117
 
117
118
  const cloned = this.$el.cloneNode(true)
118
119
  cloned.style.position = 'absolute'
119
120
  cloned.style.left = rect.x + "px"
120
- cloned.style.top = (e.clientY - 10) + "px"
121
+ cloned.style.top = rect.y + "px"
121
122
  cloned.style.width = this.$el.clientWidth + "px"
122
123
  cloned.style.pointerEvents = 'none'
123
124
  document.body.appendChild(cloned)
@@ -129,8 +130,9 @@ export default{
129
130
 
130
131
  const mouseMove = (e) => {
131
132
  const distanceX = e.clientX - startX
133
+ const distanceY = e.clientY - startY
132
134
  cloned.style.left = (rect.x + distanceX) + "px"
133
- cloned.style.top = (e.clientY - 10) + "px"
135
+ cloned.style.top = (rect.y + distanceY) + "px"
134
136
  }
135
137
 
136
138
  const mouseUp = (e) => {
package/src/index.js CHANGED
@@ -354,6 +354,8 @@ export default{
354
354
  app.component('BlockSetting', defineAsyncComponent(() => import("./widgets/BlockSetting.vue")))
355
355
  app.component('BoxItem', defineAsyncComponent(() => import("./widgets/BoxItem.vue")))
356
356
  app.component('BoxSetting', defineAsyncComponent(() => import("./widgets/BoxSetting.vue")))
357
+ app.component('AhrefItem', defineAsyncComponent(() => import("./widgets/AhrefItem.vue")))
358
+ app.component('AhrefSetting', defineAsyncComponent(() => import("./widgets/AhrefSetting.vue")))
357
359
  app.component('ButtonItem', defineAsyncComponent(() => import("./widgets/ButtonItem.vue")))
358
360
  app.component('ButtonSetting', defineAsyncComponent(() => import("./widgets/ButtonSetting.vue")))
359
361
  app.component('CarouselItem', defineAsyncComponent(() => import("./widgets/CarouselItem.vue")))
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <div class="flex-1 flex flex-row items-center gap-2">
3
+ {{ item.props.name ?? item.type }}
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+
9
+ export default{
10
+
11
+ props: {
12
+ item: Object
13
+ }
14
+
15
+ }
16
+
17
+ </script>
18
+
19
+ <style module>
20
+
21
+ .comp{
22
+
23
+ }
24
+
25
+ </style>
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+
4
+ <div>
5
+ <label class="flex-1 text-text-400">Text</label>
6
+ <Textbox v-model="item.props.text" @keyup.enter="$emit('change')"/>
7
+ </div>
8
+
9
+ <div>
10
+ <label class="flex-1 text-text-400">Href</label>
11
+ <Textbox v-model="item.props.href" @keyup.enter="$emit('change')"/>
12
+ </div>
13
+
14
+ <div>
15
+ <label class="flex-1 text-text-400">Target</label>
16
+ <Dropdown v-model="item.props.target" @change="$emit('change')">
17
+ <option value="_self">Self</option>
18
+ <option value="_blank">Blank</option>
19
+ <option value="_parent">Parent</option>
20
+ <option value="_top">Top</option>
21
+ </Dropdown>
22
+ </div>
23
+
24
+ <div>
25
+ <label class="flex-1 text-text-400">Variant</label>
26
+ <Dropdown v-model="item.props.variant"
27
+ @change="$emit('change')">
28
+ <option value="primary">Primary</option>
29
+ <option value="secondary">Secondary</option>
30
+ <option value="red">Red</option>
31
+ <option value="minimal">Minimal</option>
32
+ <option value="outline">Outline</option>
33
+ <option value="">Not Set</option>
34
+ </Dropdown>
35
+ </div>
36
+
37
+ <ComponentSetting :item="item"
38
+ :view-type="viewType"
39
+ :view-types="viewTypes"
40
+ defaultDisplay="flex"
41
+ @change="$emit('change')" />
42
+
43
+ </div>
44
+ </template>
45
+
46
+ <script>
47
+
48
+ export default{
49
+
50
+ emits: [ 'change' ],
51
+
52
+ props: {
53
+
54
+ item: {
55
+ type: Object,
56
+ required: true
57
+ },
58
+
59
+ viewType: String,
60
+
61
+ viewTypes: Array,
62
+
63
+ },
64
+
65
+ data(){
66
+ return {
67
+ }
68
+ },
69
+
70
+ inject: [ 'confirm', 'imageSrc' ],
71
+
72
+ methods: {
73
+
74
+
75
+ },
76
+
77
+ computed: {
78
+
79
+ }
80
+
81
+ }
82
+
83
+ </script>
84
+
85
+ <style module>
86
+
87
+ .comp{
88
+ @apply flex flex-col gap-4;
89
+ }
90
+
91
+ </style>
@@ -421,7 +421,7 @@
421
421
 
422
422
  <div class="flex flex-col gap-4">
423
423
 
424
- <label class="flex-1 text-text-400">Shadow</label>
424
+ <strong class="flex-1 text-text-400">Shadow</strong>
425
425
 
426
426
  <div class="flex flex-row items-center gap-4">
427
427
  <label class="flex-1 text-text-400">Box Shadow</label>
@@ -997,6 +997,10 @@ export default{
997
997
  htmlText:'', images:{},
998
998
  }},
999
999
 
1000
+ { type:'Ahref', name:'Ahref', group:'Components', props:{
1001
+ name:'Ahref', text:'Ahref'
1002
+ }},
1003
+
1000
1004
  { type:'Button', name:'Button', group:'Components', props:{
1001
1005
  name:'Button', text:'Button'
1002
1006
  }},