@mixd-id/web-scaffold 0.1.230406001

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 (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/package.json +71 -0
  4. package/public/images/mixd-logo2.png +0 -0
  5. package/src/App.vue +17 -0
  6. package/src/components/Ahref.vue +34 -0
  7. package/src/components/Alert.vue +160 -0
  8. package/src/components/Button.vue +253 -0
  9. package/src/components/ButtonGroup.vue +101 -0
  10. package/src/components/Carousel.vue +293 -0
  11. package/src/components/ChatTyping.vue +69 -0
  12. package/src/components/Checkbox.vue +152 -0
  13. package/src/components/ContextMenu.vue +261 -0
  14. package/src/components/CopyToClipboard.vue +59 -0
  15. package/src/components/Countdown.vue +213 -0
  16. package/src/components/Datepicker.vue +312 -0
  17. package/src/components/Dropdown.vue +198 -0
  18. package/src/components/DynamicTemplate.vue +44 -0
  19. package/src/components/ErrorText.vue +36 -0
  20. package/src/components/Feed.vue +118 -0
  21. package/src/components/Gmaps.vue +227 -0
  22. package/src/components/Grid.vue +29 -0
  23. package/src/components/GridColumn.vue +31 -0
  24. package/src/components/HTMLEditor.vue +396 -0
  25. package/src/components/Image.vue +207 -0
  26. package/src/components/Image360.vue +140 -0
  27. package/src/components/ImageFullScreen.vue +101 -0
  28. package/src/components/ImagePreview.vue +71 -0
  29. package/src/components/ImportModal.vue +247 -0
  30. package/src/components/ListItem.vue +147 -0
  31. package/src/components/ListPage1.vue +1331 -0
  32. package/src/components/ListPage1Filter.vue +170 -0
  33. package/src/components/Modal.vue +253 -0
  34. package/src/components/OTPField.vue +126 -0
  35. package/src/components/Radio.vue +134 -0
  36. package/src/components/SearchButton.vue +57 -0
  37. package/src/components/Slider.vue +285 -0
  38. package/src/components/SplitPane.vue +129 -0
  39. package/src/components/Switch.vue +89 -0
  40. package/src/components/TabView.vue +106 -0
  41. package/src/components/TableView.vue +201 -0
  42. package/src/components/TableViewHead.vue +159 -0
  43. package/src/components/Tabs.vue +74 -0
  44. package/src/components/TextEditor.vue +85 -0
  45. package/src/components/Textarea.vue +184 -0
  46. package/src/components/Textbox.vue +200 -0
  47. package/src/components/Timepicker.vue +108 -0
  48. package/src/components/Toast.vue +93 -0
  49. package/src/components/VirtualScroll.vue +215 -0
  50. package/src/components/VirtualTable.vue +497 -0
  51. package/src/entry-client.js +27 -0
  52. package/src/entry-server.js +73 -0
  53. package/src/index.css +3 -0
  54. package/src/index.js +255 -0
  55. package/src/main.js +38 -0
  56. package/src/router.js +57 -0
  57. package/src/themes/default/index.js +200 -0
  58. package/src/utils/helpers.js +185 -0
  59. package/src/utils/helpers.mjs +197 -0
  60. package/src/utils/importer.js +156 -0
  61. package/src/utils/listpage1.js +1371 -0
  62. package/src/utils/selection.js +64 -0
@@ -0,0 +1,293 @@
1
+ <template>
2
+ <div :class="$style.carousel" @mousedown.prevent.capture="mouseDown" @touchstart.passive.capture="mouseDown">
3
+ <div :class="$style.inner">
4
+ <span v-if="images && images.length && images.length > 0" v-for="image in images" :key="image">
5
+ <a v-if="image.target && image.target.indexOf('://') >= 0" :href="image.target" @click="checkClick">
6
+ <Image :src="image.imageUrl" :class="imageClass" />
7
+ </a>
8
+ <router-link v-if="image.target" :to="scrolling ? '' : image.target">
9
+ <Image :src="image.imageUrl" :class="imageClass"/>
10
+ </router-link>
11
+ <Image v-else :src="image.imageUrl" :class="imageClass" />
12
+ </span>
13
+ <div v-else :class="imageClass" class="bg-gray-200 animate-pulse"></div>
14
+ </div>
15
+ <div v-if="images && images.length > 1" class="carousel-next" @click="next(false, true)">
16
+ <slot name="next">
17
+ <div class="w-10 h-10 rounded-full bg-black/10 hover:bg-black/60 group cursor-pointer flex items-center justify-center">
18
+ <svg width="24" height="24" viewBox="0 0 24 24" class="fill-white/30 group-hover:fill-white/60" xmlns="http://www.w3.org/2000/svg">
19
+ <g clip-path="url(#clip0)">
20
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.04289 19.2071C7.65237 18.8166 7.65237 18.1834 8.04289 17.7929L13.8358 12L8.04289 6.20711C7.65237 5.81658 7.65237 5.18342 8.04289 4.79289C8.43342 4.40237 9.06658 4.40237 9.45711 4.79289L15.25 10.5858C16.031 11.3668 16.031 12.6332 15.25 13.4142L9.45711 19.2071C9.06658 19.5976 8.43342 19.5976 8.04289 19.2071Z"/>
21
+ </g>
22
+ </svg>
23
+ </div>
24
+ </slot>
25
+ </div>
26
+ <div v-if="images && images.length > 1" class="carousel-prev" @click="prev">
27
+ <slot name="prev">
28
+ <div class="w-10 h-10 rounded-full bg-black/10 cursor-pointer flex items-center justify-center">
29
+ <svg width="24" height="24" viewBox="0 0 24 24" class="fill-white/30" xmlns="http://www.w3.org/2000/svg">
30
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.7071 19.2071C16.0976 18.8166 16.0976 18.1834 15.7071 17.7929L9.91421 12L15.7071 6.20711C16.0976 5.81658 16.0976 5.18342 15.7071 4.79289C15.3166 4.40237 14.6834 4.40237 14.2929 4.79289L8.5 10.5858C7.71895 11.3668 7.71895 12.6332 8.5 13.4142L14.2929 19.2071C14.6834 19.5976 15.3166 19.5976 15.7071 19.2071Z"/>
31
+ </svg>
32
+ </div>
33
+ </slot>
34
+ </div>
35
+ <div v-if="images && images.length > 1" class="carousel-legend">
36
+ <div v-if="images && images.length && images.length > 0" v-for="_index in images.length"
37
+ :class="'legend-item ' + (index === _index - 1 ? 'active' : '')" :key="_index"
38
+ @click="index = _index - 1">
39
+ <slot name="legend">
40
+ <span></span>
41
+ </slot>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </template>
46
+
47
+ <script>
48
+
49
+ import { parseBoolean } from "../utils/helpers.mjs";
50
+
51
+ export default{
52
+
53
+ props:{
54
+
55
+ images: {
56
+ type: Array,
57
+ default: []
58
+ },
59
+
60
+ infinite: {
61
+ type: [ Boolean, String, Number ],
62
+ default: false
63
+ },
64
+
65
+ ratioMobile: String,
66
+ ratioDesktop: String,
67
+
68
+ imageClass:{
69
+ type: String,
70
+ default: "w-full"
71
+ }
72
+
73
+ },
74
+
75
+ emits: [ 'changed' ],
76
+
77
+ computed: {
78
+
79
+ },
80
+
81
+ data(){
82
+ return {
83
+ count: 0,
84
+ index: 0,
85
+ scrolling:0
86
+ }
87
+ },
88
+
89
+ mounted(){
90
+ this.count = this.$el.querySelectorAll('img').length
91
+ },
92
+
93
+ watch:{
94
+
95
+ index(to, from){
96
+ this.setPosition()
97
+ this.$emit('changed', to)
98
+ },
99
+
100
+ images(to){
101
+ this.index = 0
102
+ }
103
+
104
+ },
105
+
106
+ methods:{
107
+
108
+ checkClick(e){
109
+ if(this.scrolling){
110
+ e.preventDefault()
111
+ e.stopPropagation()
112
+ }
113
+ },
114
+
115
+ setPosition(noAnimation){
116
+
117
+ const index = this.index
118
+
119
+ let left = 0
120
+ this.$el.querySelectorAll('img').forEach((img, curIndex) => {
121
+ if(curIndex < index)
122
+ left += img.clientWidth
123
+ })
124
+ left *= -1
125
+
126
+ if(!noAnimation){
127
+ this.$el.firstElementChild.addEventListener('transitionend', function(){
128
+ this.classList.remove('transition-carousel')
129
+ })
130
+ this.$el.firstElementChild.classList.add('transition-carousel')
131
+ }
132
+
133
+ this.$el.firstElementChild.style.transform = `translate3d(${left}px, 0, 0)`
134
+ },
135
+
136
+ next(setPosition, useBack){
137
+
138
+ let index = this.index + 1
139
+
140
+ if(index >= this._props['count'])
141
+ index = typeof useBack !== 'undefined' && useBack === true && parseBoolean(this.infinite) ? 0 : this._props['count'] - 1
142
+
143
+ this.index = index
144
+
145
+ if(setPosition) this.setPosition()
146
+ },
147
+
148
+ prev(setPosition){
149
+
150
+ let index = this.index - 1;
151
+
152
+ if(index < 0) index = 0
153
+
154
+ this.index = index
155
+
156
+ if(setPosition) this.setPosition()
157
+ },
158
+
159
+ mouseMove(e){
160
+
161
+ this.scrolling = true
162
+
163
+ const sx = typeof e.touches !== 'undefined' ? e.touches[0].clientX : e.clientX
164
+ const dx = sx - this._props['sx']
165
+ const ix = parseInt(this._props['ix'] + dx)
166
+
167
+ //console.warn('mousemove', dx, ix)
168
+
169
+ this.$el.firstElementChild.style.transform = `translate3d(${ix}px, 0, 0)`
170
+ },
171
+
172
+ mouseUp(e){
173
+
174
+ window.setTimeout(() => {
175
+ this.scrolling = false
176
+ }, 50)
177
+
178
+ const tn = e.timeStamp - this._props['t0']
179
+ const sx = typeof e.changedTouches !== 'undefined' ? e.changedTouches[0].clientX : e.clientX
180
+ const dx = sx - this._props['sx']
181
+
182
+ //console.warn('mouseup', tn, dx, dx)
183
+
184
+ if (Math.abs(dx) > 10) {
185
+ if (tn < 1200){
186
+ dx < 0 ? this.next(true) : this.prev(true)
187
+ }
188
+ else{
189
+ this.setPosition()
190
+ }
191
+ }
192
+ else{
193
+ this.setPosition()
194
+ }
195
+
196
+ window.removeEventListener('mousemove', this.mouseMove)
197
+ window.removeEventListener('mouseup', this.mouseUp)
198
+ window.removeEventListener('mouseout', this.mouseUp)
199
+ window.removeEventListener('touchmove', this.mouseMove)
200
+ window.removeEventListener('touchend', this.mouseUp)
201
+ },
202
+
203
+ mouseDown(e){
204
+
205
+ if(!this.images || this.images.length <= 1)
206
+ return
207
+
208
+ var matches = this.$el.firstElementChild.style.transform.match(/translate3d\((.*?)(?=\,)/)
209
+ var ix = matches != null && typeof matches[1] != 'undefined' ? parseInt(matches[1].replace('px', '')) : 0
210
+
211
+ this._props = {
212
+ sx:typeof e.touches !== 'undefined' ? e.touches[0].clientX : e.clientX,
213
+ ix:ix,
214
+ t0:e.timeStamp,
215
+ count: this.$el.querySelectorAll('img').length,
216
+ }
217
+
218
+ //console.log('mousedown', this._props, this.count)
219
+
220
+ window.addEventListener('mousemove', this.mouseMove)
221
+ window.addEventListener('mouseup', this.mouseUp)
222
+ window.addEventListener('mouseout', this.mouseUp)
223
+ window.addEventListener('touchmove', this.mouseMove)
224
+ window.addEventListener('touchend', this.mouseUp)
225
+ }
226
+
227
+ }
228
+ }
229
+ </script>
230
+
231
+ <style>
232
+
233
+ .carousel-next,
234
+ .carousel-prev{
235
+ position: absolute;
236
+ top: 50%;
237
+ transform: translate3d(0, -50%, 0);
238
+ }
239
+ .carousel-next{
240
+ right: 10px;
241
+ }
242
+ .carousel-prev{
243
+ left: 10px;
244
+ }
245
+
246
+ .transition-carousel{
247
+ transition: all 300ms cubic-bezier(0.25, 1, 0.5, 1);
248
+ }
249
+ </style>
250
+
251
+ <style module>
252
+
253
+ .carousel{
254
+ white-space: nowrap;
255
+ overflow: hidden;
256
+ position: relative;
257
+ touch-action: none;
258
+ }
259
+
260
+ .inner{
261
+ white-space: nowrap;
262
+ will-change: transform;
263
+ touch-action: none;
264
+ }
265
+ .inner>*{
266
+ display: inline-block;
267
+ width: 100%;
268
+ touch-action: none;
269
+ vertical-align: top;
270
+ }
271
+
272
+ .legend{
273
+ position: absolute;
274
+ bottom: 6px;
275
+ left: 50%;
276
+ transform: translate3d(-50%, 0, 0);
277
+ }
278
+ .legend .legend-item{
279
+ display: inline-block;
280
+ }
281
+ .legend .legend-item>*{
282
+ width: 12px;
283
+ height: 12px;
284
+ border-radius: 100%;
285
+ background: rgba(0, 0, 0, .2);
286
+ margin: 0 3px;
287
+ display: inline-block;
288
+ }
289
+ .legend .legend-item.active>*{
290
+ background: rgba(0, 0, 0, .6);
291
+ }
292
+
293
+ </style>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+ <div :class="$style.typing">
4
+ <div :class="$style.dot"></div>
5
+ <div :class="$style.dot"></div>
6
+ <div :class="$style.dot"></div>
7
+ </div>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+
13
+ export default{
14
+
15
+ }
16
+
17
+ </script>
18
+
19
+ <style module>
20
+
21
+ .comp{
22
+ @apply bg-primary-100 p-5 rounded-3xl inline-block;
23
+ border-bottom-left-radius: 2px;
24
+ }
25
+
26
+ .typing {
27
+ align-items: center;
28
+ display: flex;
29
+ }
30
+
31
+ .dot {
32
+ animation: chatTypingAnimation 1.8s infinite ease-in-out;
33
+ @apply bg-primary-200;
34
+ border-radius: 50%;
35
+ height: 8px;
36
+ margin-right: 4px;
37
+ vertical-align: middle;
38
+ width: 8px;
39
+ display: inline-block;
40
+ }
41
+ .dot:nth-child(1) {
42
+ animation-delay: 200ms;
43
+ }
44
+ .dot:nth-child(2) {
45
+ animation-delay: 300ms;
46
+ }
47
+ .dot:nth-child(3) {
48
+ animation-delay: 400ms;
49
+ }
50
+ .dot:last-child {
51
+ margin-right: 0;
52
+ }
53
+
54
+ @keyframes chatTypingAnimation {
55
+ 0% {
56
+ transform: translateY(0px);
57
+ @apply bg-primary-300;
58
+ }
59
+ 28% {
60
+ transform: translateY(-7px);
61
+ @apply bg-primary-300;
62
+ }
63
+ 44% {
64
+ transform: translateY(0px);
65
+ @apply bg-primary-200;
66
+ }
67
+ }
68
+
69
+ </style>
@@ -0,0 +1,152 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+ <input :id="id" type="checkbox" :checked="computedChecked" @change="onChange" />
4
+ <label :for="id">
5
+ <div :class="$style.indicator">
6
+ <Transition name="checkbox">
7
+ <div v-if="computedChecked">
8
+ <svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M470.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L192 338.7 425.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>
9
+ </div>
10
+ </Transition>
11
+ </div>
12
+ <slot></slot>
13
+ </label>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+
19
+ import { parseBoolean } from "../utils/helpers.mjs";
20
+
21
+ export default{
22
+
23
+ props:{
24
+ name: String,
25
+ checked: undefined,
26
+ value: undefined,
27
+
28
+ modelValue: undefined,
29
+ trueValue: undefined,
30
+ falseValue: undefined,
31
+
32
+ customClass: String,
33
+ variant: String, // default
34
+ },
35
+
36
+ computed: {
37
+
38
+ id(){
39
+ return this.$style.comp + this.uniqid()
40
+ },
41
+
42
+ computedChecked(){
43
+ let checked
44
+ if(this.modelValue){
45
+
46
+ const isArray = Array.isArray(this.modelValue)
47
+
48
+ if(this.value){
49
+ checked = isArray ? this.modelValue.includes(this.value) :
50
+ this.modelValue === this.value
51
+ }
52
+ else if(this.trueValue){
53
+ checked = isArray ? this.modelValue.includes(this.trueValue) :
54
+ this.modelValue === this.trueValue
55
+ }
56
+ else{
57
+ checked = parseBoolean(this.modelValue)
58
+ }
59
+ }
60
+ else{
61
+ checked = !!this.checked
62
+ }
63
+ return checked
64
+ }
65
+
66
+ },
67
+
68
+ methods: {
69
+
70
+ onChange(e){
71
+
72
+ let value
73
+ if(e.target.checked){
74
+ if(this.value) value = this.value
75
+ else if(this.trueValue) value = this.trueValue
76
+ else value = true
77
+
78
+ if(this.modelValue && Array.isArray(this.modelValue)){
79
+ value = [ ...this.modelValue, value ].filter((v, idx, arr) => {
80
+ return arr.indexOf(v) === idx
81
+ })
82
+ }
83
+ }
84
+ else{
85
+ if(this.value) value = null
86
+ else if(this.falseValue) value = this.falseValue
87
+ else value = false
88
+
89
+ if(this.modelValue && Array.isArray(this.modelValue)){
90
+ value = this.modelValue.filter((v) => {
91
+ return v !== this.value ?? (this.falseValue ?? false)
92
+ })
93
+ }
94
+ }
95
+ this.$emit('update:modelValue', value)
96
+ }
97
+
98
+ }
99
+
100
+ }
101
+
102
+ </script>
103
+
104
+ <style module>
105
+
106
+ .comp{
107
+ @apply h-[var(--h-cp)] flex items-center;
108
+ }
109
+
110
+ .comp label{
111
+ @apply flex flex-row items-center gap-2;
112
+ }
113
+
114
+ .comp input{
115
+ @apply hidden;
116
+ }
117
+
118
+ .indicator{
119
+ @apply w-[21px] h-[21px] border-[1px] rounded-lg border-text-200 bg-base-50;
120
+ @apply flex items-center justify-center overflow-hidden;
121
+ transition: border 300ms cubic-bezier(0.25, 1, 0.5, 1);
122
+ }
123
+ .comp:hover .indicator{
124
+ @apply border-primary;
125
+ }
126
+
127
+ .indicator>div{
128
+ @apply w-[21px] h-[21px] flex items-center justify-center bg-primary;
129
+ }
130
+ .indicator>div>*{
131
+ @apply fill-white;
132
+ }
133
+
134
+ </style>
135
+
136
+ <style>
137
+
138
+ .checkbox-enter-active{
139
+ transition: all 300ms cubic-bezier(0.25, 1, 0.5, 1);
140
+ }
141
+
142
+ .checkbox-leave-active{
143
+ transition: all 300ms cubic-bezier(0.25, 1, 0.5, 1);
144
+ }
145
+
146
+ .checkbox-enter-from,
147
+ .checkbox-leave-to{
148
+ transform: scale(0);
149
+ opacity: 0;
150
+ }
151
+
152
+ </style>