@mixd-id/web-scaffold 0.1.230406078 → 0.1.230406080

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 (37) hide show
  1. package/package.json +1 -1
  2. package/src/components/Block.vue +59 -0
  3. package/src/components/Button.vue +2 -0
  4. package/src/components/Carousel.vue +5 -35
  5. package/src/components/ColorPicker.vue +30 -11
  6. package/src/components/Datepicker.vue +16 -9
  7. package/src/components/Dropdown.vue +15 -4
  8. package/src/components/Flex.vue +7 -57
  9. package/src/components/Grid.vue +8 -31
  10. package/src/components/Image.vue +0 -35
  11. package/src/components/Timepicker.vue +15 -8
  12. package/src/index.js +5 -0
  13. package/src/stores/WebPageBuilder.js +2 -2
  14. package/src/utils/helpers.mjs +30 -5
  15. package/src/widgets/BlockItem.vue +25 -0
  16. package/src/widgets/BlockSetting.vue +42 -0
  17. package/src/widgets/ButtonGroupSetting.vue +1 -1
  18. package/src/widgets/ButtonSetting.vue +1 -1
  19. package/src/widgets/ComponentSetting.vue +83 -76
  20. package/src/widgets/ContactForm.vue +21 -5
  21. package/src/widgets/ContactFormSetting.vue +0 -11
  22. package/src/widgets/EmbeddedVideoSetting.vue +0 -3
  23. package/src/widgets/FAQ.vue +40 -21
  24. package/src/widgets/FeatureList.vue +4 -37
  25. package/src/widgets/FeatureListSetting.vue +6 -1
  26. package/src/widgets/FlexSetting.vue +54 -34
  27. package/src/widgets/GridItem.vue +0 -2
  28. package/src/widgets/GridSetting.vue +22 -2
  29. package/src/widgets/IconList.vue +2 -42
  30. package/src/widgets/IconListSetting.vue +13 -2
  31. package/src/widgets/ImageItem.vue +2 -12
  32. package/src/widgets/ImageSetting.vue +1 -1
  33. package/src/widgets/MarginSetting.vue +142 -0
  34. package/src/widgets/PaddingSetting.vue +142 -0
  35. package/src/widgets/Share.vue +22 -1
  36. package/src/widgets/StyleSetting.vue +1 -21
  37. package/src/widgets/WebPageBuilder.vue +68 -57
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.230406078",
4
+ "version": "0.1.230406080",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <div :class="compClass">
3
+
4
+ <component v-for="item in computedItems"
5
+ :is="item.type"
6
+ :uid="item.uid"
7
+ :items="item.items"
8
+ :="item.props" />
9
+
10
+ Block
11
+
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+
17
+ import {classFromProps} from "../utils/helpers.mjs";
18
+
19
+ export default{
20
+
21
+ props:{
22
+ class: String,
23
+ items: Array,
24
+ padding: Array,
25
+ margin: Array,
26
+ display: Array,
27
+ type: String,
28
+ enabled: undefined,
29
+ name: String
30
+ },
31
+
32
+ computed: {
33
+
34
+ computedItems() {
35
+ return this.items.filter((_) => _.props.enabled)
36
+ },
37
+
38
+ compClass(){
39
+ return [
40
+ this.$style.comp,
41
+ this.class ?? '',
42
+ classFromProps(this.$props)
43
+ ]
44
+ .filter(_ => _)
45
+ .join(' ')
46
+ }
47
+
48
+ }
49
+
50
+ }
51
+
52
+ </script>
53
+
54
+ <style module>
55
+
56
+ .comp{
57
+ }
58
+
59
+ </style>
@@ -15,6 +15,7 @@
15
15
  <script>
16
16
 
17
17
  import {componentMixin} from "../mixin/component";
18
+ import {classFromProps} from "../utils/helpers.mjs";
18
19
 
19
20
  export default{
20
21
 
@@ -51,6 +52,7 @@ export default{
51
52
  this.$style['button-' + this.variant],
52
53
  this.class ?? '',
53
54
  parseInt(this.computedState) === 2 ? this.$style.loading : '',
55
+ classFromProps(this.$props)
54
56
  ]
55
57
  .filter(_ => _)
56
58
  .join(' ')
@@ -32,7 +32,7 @@
32
32
 
33
33
  <script>
34
34
 
35
- import { parseBoolean } from "../utils/helpers.mjs";
35
+ import {_applyClass, parseBoolean} from "../utils/helpers.mjs";
36
36
  import {componentMixin} from "../mixin/component";
37
37
 
38
38
  export default{
@@ -67,7 +67,8 @@ export default{
67
67
 
68
68
  compClass(){
69
69
  return [
70
- this.$style.comp
70
+ this.$style.comp,
71
+ ..._applyClass(this.$props)
71
72
  ]
72
73
  .filter(_ => _)
73
74
  .join(' ')
@@ -295,23 +296,7 @@ export default{
295
296
  overflow: hidden;
296
297
  position: relative;
297
298
  touch-action: none;
298
-
299
- background-color: v-bind(bgColor[0]);
300
299
  background-image: v-bind(bgImages[0]);
301
- background-position: v-bind(bgPositions[0]);
302
- background-size: v-bind(bgSizes[0]);
303
- background-repeat: v-bind(bgRepeats[0]);
304
-
305
- border-left-width: v-bind(bdSizes[0][0]);
306
- border-top-width: v-bind(bdSizes[0][1]);
307
- border-right-width: v-bind(bdSizes[0][2]);
308
- border-bottom-width: v-bind(bdSizes[0][3]);
309
- border-color: v-bind(bdColors[0]);
310
- border-top-left-radius: v-bind(bdRadiuses[0][0]);
311
- border-top-right-radius: v-bind(bdRadiuses[0][1]);
312
- border-bottom-right-radius: v-bind(bdRadiuses[0][2]);
313
- border-bottom-left-radius: v-bind(bdRadiuses[0][3]);
314
- border-style: v-bind(bdStyles[0]);
315
300
  }
316
301
 
317
302
  .carouselNext{
@@ -340,12 +325,12 @@ export default{
340
325
  }
341
326
 
342
327
  .legend{
343
- @apply flex justify-center gap-2 py-2;
328
+ @apply flex justify-center gap-2 py-1;
344
329
  }
345
330
  .legend .legendItem{
346
331
  }
347
332
  .legend .legendItem>*{
348
- @apply w-3 h-3 rounded-full bg-gray-100;
333
+ @apply w-2 h-2 rounded-full bg-gray-100;
349
334
  }
350
335
  .legend .legendItemActive>*{
351
336
  @apply bg-primary;
@@ -353,22 +338,7 @@ export default{
353
338
 
354
339
  @media screen and (min-width: 768px){
355
340
  .comp{
356
- background-color: v-bind(bgColor[1]);
357
341
  background-image: v-bind(bgImages[1]);
358
- background-position: v-bind(bgPositions[1]);
359
- background-size: v-bind(bgSizes[1]);
360
- background-repeat: v-bind(bgRepeats[1]);
361
-
362
- border-left-width: v-bind(bdSizes[1][0]);
363
- border-top-width: v-bind(bdSizes[1][1]);
364
- border-right-width: v-bind(bdSizes[1][2]);
365
- border-bottom-width: v-bind(bdSizes[1][3]);
366
- border-color: v-bind(bdColors[1]);
367
- border-top-left-radius: v-bind(bdRadiuses[1][0]);
368
- border-top-right-radius: v-bind(bdRadiuses[1][1]);
369
- border-bottom-right-radius: v-bind(bdRadiuses[1][2]);
370
- border-bottom-left-radius: v-bind(bdRadiuses[1][3]);
371
- border-style: v-bind(bdStyles[1]);
372
342
  }
373
343
  }
374
344
 
@@ -1,16 +1,18 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
- <div :class="$style.circle" @click="$refs.contextMenu.open($refs.btn)"
4
- ref="btn" :style="{ backgroundColor:this.modelValue }"></div>
3
+ <div :class="`${$style.circle} ${modelValue}`" @click="$refs.contextMenu.open($refs.btn)"
4
+ ref="btn"></div>
5
5
  <input type="color" :class="$style.inputColor" ref="inputColor"
6
6
  @change="select($refs.inputColor.value)"/>
7
7
 
8
8
  <ContextMenu ref="contextMenu" :dismiss="false">
9
9
  <div class="p-4 flex flex-col gap-4">
10
- <div class="grid grid-cols-6 gap-4">
11
- <div v-for="color in colors">
12
- <div :class="$style.circle" :style="{ backgroundColor:color }"
13
- @click="select(color)"></div>
10
+ <div class="flex flex-col gap-4">
11
+ <div v-for="color in colors" class="grid gap-4" :class="`grid-cols-10`">
12
+ <div v-for="step in steps">
13
+ <div :class="`${$style.circle} bg-${color}-${step}`"
14
+ @click="select(`${color}-${step}`)"></div>
15
+ </div>
14
16
  </div>
15
17
  </div>
16
18
  <div class="grid grid-cols-2 gap-4">
@@ -34,18 +36,35 @@ export default{
34
36
 
35
37
  props: {
36
38
 
37
- colors: Array,
39
+ colors: {
40
+ type: Array,
41
+ default: [
42
+ 'primary',
43
+ 'gray',
44
+ 'red',
45
+ 'amber',
46
+ 'lime',
47
+ 'blue',
48
+ ]
49
+ },
50
+
51
+ steps: {
52
+ type: Array,
53
+ default: [ 50, 100, 200, 300, 400, 500, 600, 700, 800, 900 ]
54
+ },
38
55
 
39
56
  customColor: undefined,
40
57
 
41
- modelValue: String
58
+ modelValue: String,
59
+
60
+ prefix: String
42
61
 
43
62
  },
44
63
 
45
64
  methods: {
46
65
 
47
66
  select(color){
48
- this.$emit('update:modelValue', color)
67
+ this.$emit('update:modelValue', this.prefix + color)
49
68
  this.$emit('change')
50
69
  this.$refs.contextMenu.close()
51
70
  }
@@ -74,11 +93,11 @@ export default{
74
93
  <style module>
75
94
 
76
95
  .comp{
77
- @apply p-[2px] border-[1px] border-text-200 rounded-full relative;
96
+ @apply relative;
78
97
  }
79
98
 
80
99
  .circle{
81
- @apply w-[19px] h-[19px] rounded-full cursor-pointer;
100
+ @apply w-[24px] h-[24px] rounded-full cursor-pointer border-[2px] border-text-200;
82
101
  }
83
102
 
84
103
  .inputColor{
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
 
3
- <div :class="className">
3
+ <div :class="compClass">
4
4
 
5
5
  <div v-if="mode === '' || mode === 'simple'">
6
6
  <select v-model="DD">
@@ -17,10 +17,11 @@
17
17
  </select>
18
18
  </div>
19
19
 
20
- <div v-else-if="mode === 'popup'" ref="popup" @click="contextMenu = { caller:$refs.popup, value:this.modelValue }"
20
+ <div v-else-if="mode === 'popup'" ref="popup"
21
+ @click="!readonly ? contextMenu = { caller:$refs.popup, value:this.modelValue } : null"
21
22
  class="flex-1">
22
23
  <input class="flex-1" type="text" readonly :value="DMMMYYYY"/>
23
- <div :class="$style.arrow">
24
+ <div :class="$style.arrow" v-if="!readonly">
24
25
  <svg width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
25
26
  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967L11.8232 14.5126C11.9209 14.6102 12.0791 14.6102 12.1768 14.5126L17.9697 8.71967C18.2626 8.42677 18.7374 8.42677 19.0303 8.71967C19.3232 9.01256 19.3232 9.48743 19.0303 9.78033L13.2374 15.5732C12.554 16.2566 11.446 16.2566 10.7626 15.5732L4.96967 9.78033C4.67678 9.48744 4.67678 9.01256 4.96967 8.71967Z"/>
26
27
  </svg>
@@ -133,7 +134,9 @@ export default{
133
134
  default: ''
134
135
  },
135
136
 
136
- modelValue:String
137
+ modelValue:String,
138
+
139
+ readonly: undefined,
137
140
 
138
141
  },
139
142
 
@@ -147,13 +150,14 @@ export default{
147
150
  return dayjs(this.contextMenu.value).format('YYYY-MM')
148
151
  },
149
152
 
150
- className(){
153
+ compClass(){
151
154
  return [
152
155
  this.$style.datepicker,
153
- this.$style['mode-' + this.mode]
156
+ this.$style['mode-' + this.mode],
157
+ this.readonly ? this.$style.readonly : ''
154
158
  ]
155
- .join(' ')
156
- .trim()
159
+ .filter(_ => _)
160
+ .join(' ')
157
161
  },
158
162
 
159
163
  contextMenuTitle(){
@@ -261,7 +265,10 @@ export default{
261
265
  @apply h-[var(--h-cp)];
262
266
  @apply flex items-center rounded-lg overflow-hidden cursor-pointer relative;
263
267
  @apply border-[1px] border-text-200 bg-base-50;
264
- @apply hover:border-text-300 cursor-pointer;
268
+ @apply cursor-pointer;
269
+ }
270
+ .datepicker:not(.readonly){
271
+ @apply hover:border-text-300
265
272
  }
266
273
  .datepicker select{
267
274
  @apply appearance-none p-2 bg-transparent text-center w-full outline-none;
@@ -2,15 +2,15 @@
2
2
 
3
3
  <div :class="computedClass">
4
4
 
5
- <select v-if="[ 1 ].includes(mode)" class="flex-1" ref="select" @change="onChanged" :disabled="disabled"
5
+ <select v-if="[ 1 ].includes(mode)" class="flex-1" ref="select" @change="onChanged" :disabled="isDisabled"
6
6
  :value="modelValue" @input="$emit('update:modelValue', $event.target.value)">
7
7
  <slot></slot>
8
8
  </select>
9
9
 
10
- <input v-else-if="[ 2, 'custom' ].includes(mode)" type="text" class="flex-1" readonly :disabled="disabled"
10
+ <input v-else-if="[ 2, 'custom' ].includes(mode)" type="text" class="flex-1" readonly :disabled="isDisabled"
11
11
  @click="openContextMenu" ref="input"
12
12
  :value="modelValue ?? value" @input="$emit('update:modelValue', $event.target.value)" />
13
- <div :class="$style.arrow">
13
+ <div :class="$style.arrow" v-if="!isDisabled">
14
14
  <svg width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
15
15
  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967L11.8232 14.5126C11.9209 14.6102 12.0791 14.6102 12.1768 14.5126L17.9697 8.71967C18.2626 8.42677 18.7374 8.42677 19.0303 8.71967C19.3232 9.01256 19.3232 9.48743 19.0303 9.78033L13.2374 15.5732C12.554 16.2566 11.446 16.2566 10.7626 15.5732L4.96967 9.78033C4.67678 9.48744 4.67678 9.01256 4.96967 8.71967Z"/>
16
16
  </svg>
@@ -40,6 +40,8 @@ export default {
40
40
 
41
41
  disabled: undefined,
42
42
 
43
+ readonly: undefined,
44
+
43
45
  modelValue: undefined,
44
46
 
45
47
  variant: String,
@@ -82,8 +84,14 @@ export default {
82
84
  this.$style['state-' + this.computedState],
83
85
  this.$style['variant-' + this.variant],
84
86
  this.$style['size-' + this.size],
87
+ this.isDisabled ? this.$style.readonly : ''
85
88
  ]
89
+ .filter(_=>_)
86
90
  .join(' ')
91
+ },
92
+
93
+ isDisabled(){
94
+ return this.disabled || this.readonly
87
95
  }
88
96
 
89
97
  },
@@ -152,7 +160,10 @@ export default {
152
160
  .dropdown{
153
161
  @apply min-h-[var(--h-cp)];
154
162
  @apply flex items-center rounded-lg overflow-hidden cursor-pointer relative;
155
- @apply border-[1px] border-text-200 bg-base-50 hover:border-text-300;
163
+ @apply border-[1px] border-text-200 bg-base-50;
164
+ }
165
+ .dropdown:not(.readonly){
166
+ @apply hover:border-text-300;
156
167
  }
157
168
 
158
169
  .dropdown select,
@@ -6,14 +6,15 @@
6
6
  :uid="item.uid"
7
7
  :items="item.items"
8
8
  :="item.props"
9
- :class="classOf(item, idx)" />
9
+ :class="itemClass(idx)" />
10
10
 
11
11
  </div>
12
+
12
13
  </template>
13
14
 
14
15
  <script>
15
16
 
16
- import {_applyClass, mediaPrefixes} from "../utils/helpers.mjs";
17
+ import {_applyClass, classFromProps, mediaPrefixes} from "../utils/helpers.mjs";
17
18
  import {componentMixin} from "../mixin/component";
18
19
 
19
20
  export default{
@@ -22,6 +23,7 @@ export default{
22
23
 
23
24
  props:{
24
25
  items: Array,
26
+ flexColumns: Array,
25
27
  type: Array,
26
28
  columnType: Array,
27
29
  columns: Array,
@@ -60,26 +62,9 @@ export default{
60
62
 
61
63
  methods: {
62
64
 
63
- classOf(item, idx){
64
-
65
- const classNames = []
66
- for(let i in this.columns){
67
- const column = this.columns[i][idx % this.columns.length]
68
-
69
- if(!column) continue
70
-
71
- if(column && column.width !== 'auto'){
72
- classNames.push(`${mediaPrefixes[i]}w-[${column.width}]`)
73
- }
74
- else{
75
- classNames.push(`${mediaPrefixes[i]}flex-1`)
76
- }
77
- }
78
-
79
- classNames.push(..._applyClass(item.props))
80
-
81
- return classNames.join(' ')
82
- }
65
+ itemClass(idx){
66
+ return (this.flexColumns[idx] ?? []).join(' ')
67
+ },
83
68
  },
84
69
 
85
70
  data(){
@@ -95,47 +80,12 @@ export default{
95
80
 
96
81
  .comp{
97
82
  @apply flex;
98
-
99
- background-color: v-bind(bgColor[0]);
100
83
  background-image: v-bind(bgImages[0]);
101
- background-position: v-bind(bgPositions[0]);
102
- background-size: v-bind(bgSizes[0]);
103
- background-repeat: v-bind(bgRepeats[0]);
104
-
105
- border-left-width: v-bind(bdSizes[0][0]);
106
- border-top-width: v-bind(bdSizes[0][1]);
107
- border-right-width: v-bind(bdSizes[0][2]);
108
- border-bottom-width: v-bind(bdSizes[0][3]);
109
- border-color: v-bind(bdColors[0]);
110
- border-top-left-radius: v-bind(bdRadiuses[0][0]);
111
- border-top-right-radius: v-bind(bdRadiuses[0][1]);
112
- border-bottom-right-radius: v-bind(bdRadiuses[0][2]);
113
- border-bottom-left-radius: v-bind(bdRadiuses[0][3]);
114
- border-style: v-bind(bdStyles[0]);
115
-
116
- max-width: v-bind(maxWidths[0]);
117
84
  }
118
85
 
119
86
  @media screen and (min-width: 768px){
120
87
  .comp{
121
- background-color: v-bind(bgColor[1]);
122
88
  background-image: v-bind(bgImages[1]);
123
- background-position: v-bind(bgPositions[1]);
124
- background-size: v-bind(bgSizes[1]);
125
- background-repeat: v-bind(bgRepeats[1]);
126
-
127
- border-left-width: v-bind(bdSizes[1][0]);
128
- border-top-width: v-bind(bdSizes[1][1]);
129
- border-right-width: v-bind(bdSizes[1][2]);
130
- border-bottom-width: v-bind(bdSizes[1][3]);
131
- border-color: v-bind(bdColors[1]);
132
- border-top-left-radius: v-bind(bdRadiuses[1][0]);
133
- border-top-right-radius: v-bind(bdRadiuses[1][1]);
134
- border-bottom-right-radius: v-bind(bdRadiuses[1][2]);
135
- border-bottom-left-radius: v-bind(bdRadiuses[1][3]);
136
- border-style: v-bind(bdStyles[1]);
137
-
138
- max-width: v-bind(maxWidths[1]);
139
89
  }
140
90
  }
141
91
 
@@ -1,19 +1,18 @@
1
1
  <template>
2
- <div :class="gridClass">
2
+ <div :class="compClass">
3
3
 
4
4
  <component v-for="item in computedItems"
5
5
  :is="item.type"
6
6
  :uid="item.uid"
7
7
  :items="item.items"
8
- :="item.props"
9
- :class="classOf(item)" />
8
+ :="item.props" />
10
9
 
11
10
  </div>
12
11
  </template>
13
12
 
14
13
  <script>
15
14
 
16
- import {_applyClass, mediaPrefixes} from "../utils/helpers.mjs";
15
+ import {_applyClass} from "../utils/helpers.mjs";
17
16
  import {componentMixin} from "../mixin/component";
18
17
 
19
18
  export default{
@@ -38,40 +37,18 @@ export default{
38
37
  return this.items.filter((_) => _.props.enabled)
39
38
  },
40
39
 
41
- gridClass(){
42
-
43
- const classNames = [
44
- this.$style.comp
40
+ compClass(){
41
+ return [
42
+ this.$style.comp,
43
+ ..._applyClass(this.$props)
45
44
  ]
46
-
47
- if(Array.isArray(this.columns)){
48
- for(let i in this.columns){
49
- classNames.push(mediaPrefixes[i] + 'grid-cols-' + this.columns[i])
50
- }
51
- }
52
-
53
- if(Array.isArray(this.gap)){
54
- for(let i in this.gap){
55
- classNames.push(mediaPrefixes[i] + 'gap-' + this.gap[i])
56
- }
57
- }
58
-
59
- classNames.push(..._applyClass(this.$props))
60
-
61
- return classNames.join(' ')
45
+ .join(' ')
62
46
  }
63
47
 
64
48
  },
65
49
 
66
50
  methods: {
67
51
 
68
- classOf(item){
69
-
70
- return [
71
- item.props.colSpan ? 'col-span-' + item.props.colSpan : ''
72
- ]
73
- .join(' ')
74
- }
75
52
 
76
53
  }
77
54
 
@@ -261,25 +261,7 @@ export default{
261
261
 
262
262
  .comp{
263
263
  @apply relative overflow-hidden;
264
-
265
- background-color: v-bind(bgColor[0]);
266
264
  background-image: v-bind(bgImages[0]);
267
- background-position: v-bind(bgPositions[0]);
268
- background-size: v-bind(bgSizes[0]);
269
- background-repeat: v-bind(bgRepeats[0]);
270
-
271
- border-left-width: v-bind(bdSizes[0][0]);
272
- border-top-width: v-bind(bdSizes[0][1]);
273
- border-right-width: v-bind(bdSizes[0][2]);
274
- border-bottom-width: v-bind(bdSizes[0][3]);
275
- border-color: v-bind(bdColors[0]);
276
- border-top-left-radius: v-bind(bdRadiuses[0][0]);
277
- border-top-right-radius: v-bind(bdRadiuses[0][1]);
278
- border-bottom-right-radius: v-bind(bdRadiuses[0][2]);
279
- border-bottom-left-radius: v-bind(bdRadiuses[0][3]);
280
- border-style: v-bind(bdStyles[0]);
281
-
282
- max-width: v-bind(maxWidths[0]);
283
265
  }
284
266
 
285
267
  .img{
@@ -301,24 +283,7 @@ export default{
301
283
 
302
284
  @media screen and (min-width: 768px){
303
285
  .comp{
304
- background-color: v-bind(bgColor[1]);
305
286
  background-image: v-bind(bgImages[1]);
306
- background-position: v-bind(bgPositions[1]);
307
- background-size: v-bind(bgSizes[1]);
308
- background-repeat: v-bind(bgRepeats[1]);
309
-
310
- border-left-width: v-bind(bdSizes[1][0]);
311
- border-top-width: v-bind(bdSizes[1][1]);
312
- border-right-width: v-bind(bdSizes[1][2]);
313
- border-bottom-width: v-bind(bdSizes[1][3]);
314
- border-color: v-bind(bdColors[1]);
315
- border-top-left-radius: v-bind(bdRadiuses[1][0]);
316
- border-top-right-radius: v-bind(bdRadiuses[1][1]);
317
- border-bottom-right-radius: v-bind(bdRadiuses[1][2]);
318
- border-bottom-left-radius: v-bind(bdRadiuses[1][3]);
319
- border-style: v-bind(bdStyles[1]);
320
-
321
- max-width: v-bind(maxWidths[1]);
322
287
  }
323
288
  }
324
289
 
@@ -4,7 +4,7 @@
4
4
  <slot></slot>
5
5
  </div>
6
6
  <div class="flex-1">
7
- <select @change="onChanged" ref="hour">
7
+ <select @change="onChanged" ref="hour" :disabled="readonly">
8
8
  <option v-for="_hour in 24" :value="(_hour - 1).toString().padStart(2, '0')"
9
9
  :selected="(_hour - 1) === computedHour">
10
10
  {{ (_hour - 1).toString().padStart(2, '0') }}
@@ -15,7 +15,7 @@
15
15
  <label>:</label>
16
16
  </div>
17
17
  <div class="flex-1">
18
- <select @change="onChanged" ref="minute">
18
+ <select @change="onChanged" ref="minute" :disabled="readonly">
19
19
  <option v-for="_minute in 60" :value="(_minute - 1).toString().padStart(2, '0')"
20
20
  :selected="(_minute - 1) === computedMinute">
21
21
  {{ (_minute - 1).toString().padStart(2, '0') }}
@@ -34,6 +34,8 @@ export default{
34
34
  default: '00:00'
35
35
  },
36
36
 
37
+ readonly: undefined,
38
+
37
39
  size:{
38
40
  type: String,
39
41
  default: ''
@@ -45,10 +47,12 @@ export default{
45
47
 
46
48
  computedClass(){
47
49
  return [
48
- 'timepicker',
49
- this.size !== '' ? 'timepicker-' + this.size : ''
50
+ this.$style.timepicker,
51
+ this.size !== '' ? 'timepicker-' + this.$style.size : '',
52
+ this.readonly ? this.$style.readonly : ''
50
53
  ]
51
- .join(' ').trim()
54
+ .filter(_=>_)
55
+ .join(' ')
52
56
  },
53
57
 
54
58
  computedHour(){
@@ -75,7 +79,7 @@ export default{
75
79
  }
76
80
  </script>
77
81
 
78
- <style>
82
+ <style module>
79
83
 
80
84
  .timepicker{
81
85
  @apply inline-flex flex-row items-center bg-base-50;
@@ -87,9 +91,12 @@ export default{
87
91
 
88
92
  .timepicker select{
89
93
  @apply w-full p-2 appearance-none bg-transparent outline-none;
90
- @apply border-[1px] border-text-200 hover:border-text-300 rounded-lg;
94
+ @apply border-[1px] border-text-200 rounded-lg;
91
95
  @apply text-center;
92
96
  }
97
+ .timepicker:not(.readonly) select{
98
+ @apply hover:border-text-300;
99
+ }
93
100
 
94
101
  .timepicker.timepicker-sm select{
95
102
  @apply text-sm p-1;
@@ -105,4 +112,4 @@ export default{
105
112
  @apply text-lg p-3;
106
113
  }
107
114
 
108
- </style>
115
+ </style>
package/src/index.js CHANGED
@@ -248,6 +248,7 @@ export default{
248
248
  app.config.globalProperties.info = consoleInfo
249
249
 
250
250
  app.component('Alert', defineAsyncComponent(() => import("./components/Alert.vue")))
251
+ app.component('Block', defineAsyncComponent(() => import("./components/Block.vue")))
251
252
  app.component('Button', defineAsyncComponent(() => import("./components/Button.vue")))
252
253
  app.component('Box', defineAsyncComponent(() => import("./components/Box.vue")))
253
254
  app.component('ColorPicker', defineAsyncComponent(() => import("./components/ColorPicker.vue")))
@@ -313,6 +314,8 @@ export default{
313
314
  app.component('Banner', defineAsyncComponent(() => import("./widgets/Banner.vue")))
314
315
  app.component('BannerItem', defineAsyncComponent(() => import("./widgets/BannerItem.vue")))
315
316
  app.component('BannerSetting', defineAsyncComponent(() => import("./widgets/BannerSetting.vue")))
317
+ app.component('BlockItem', defineAsyncComponent(() => import("./widgets/BlockItem.vue")))
318
+ app.component('BlockSetting', defineAsyncComponent(() => import("./widgets/BlockSetting.vue")))
316
319
  app.component('BoxItem', defineAsyncComponent(() => import("./widgets/BoxItem.vue")))
317
320
  app.component('BoxSetting', defineAsyncComponent(() => import("./widgets/BoxSetting.vue")))
318
321
  app.component('ButtonItem', defineAsyncComponent(() => import("./widgets/ButtonItem.vue")))
@@ -343,6 +346,8 @@ export default{
343
346
  app.component('IconListSetting', defineAsyncComponent(() => import("./widgets/IconListSetting.vue")))
344
347
  app.component('ImageItem', defineAsyncComponent(() => import("./widgets/ImageItem.vue")))
345
348
  app.component('ImageSetting', defineAsyncComponent(() => import("./widgets/ImageSetting.vue")))
349
+ app.component('MarginSetting', defineAsyncComponent(() => import("./widgets/MarginSetting.vue")))
350
+ app.component('PaddingSetting', defineAsyncComponent(() => import("./widgets/PaddingSetting.vue")))
346
351
  app.component('Share', defineAsyncComponent(() => import("./widgets/Share.vue")))
347
352
  app.component('ShareItem', defineAsyncComponent(() => import("./widgets/ShareItem.vue")))
348
353
  app.component('ShareSetting', defineAsyncComponent(() => import("./widgets/ShareSetting.vue")))