@mixd-id/web-scaffold 0.1.2301231315 → 0.1.2301231316
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 +3 -1
- package/src/components/Dropdown.vue +7 -1
- package/src/components/Image.vue +7 -5
- package/src/components/ListPage1.vue +2 -2
- package/src/components/ListPage2.vue +1 -1
- package/src/components/TextEditor.vue +85 -0
- package/src/components/Textbox.vue +8 -1
- package/src/components/VirtualScroll.vue +1 -1
- package/src/components/VirtualTable.vue +1 -1
- package/src/index.js +1 -0
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.
|
|
4
|
+
"version": "0.1.2301231316",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite serve",
|
|
7
7
|
"build": "vite build",
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
"dayjs": "^1.11.2",
|
|
28
28
|
"express": "^4.18.1",
|
|
29
29
|
"glob": "^8.0.3",
|
|
30
|
+
"lodash": "^4.17.21",
|
|
30
31
|
"lodash-es": "^4.17.21",
|
|
32
|
+
"lodash.throttle": "^4.1.1",
|
|
31
33
|
"nprogress": "^0.2.0",
|
|
32
34
|
"pinia": "^2.0.14",
|
|
33
35
|
"prismjs": "^1.28.0",
|
|
@@ -48,6 +48,8 @@ export default {
|
|
|
48
48
|
|
|
49
49
|
position: String,
|
|
50
50
|
|
|
51
|
+
width: String,
|
|
52
|
+
|
|
51
53
|
state: {
|
|
52
54
|
type: [ Number, String ],
|
|
53
55
|
default: 1 // 1:normal, -1:disabled, -2:error
|
|
@@ -178,13 +180,17 @@ export default {
|
|
|
178
180
|
|
|
179
181
|
.size-sm select,
|
|
180
182
|
.size-sm input{
|
|
181
|
-
@apply p-
|
|
183
|
+
@apply p-0;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
.size-sm .arrow{
|
|
185
187
|
@apply p-2
|
|
186
188
|
}
|
|
187
189
|
|
|
190
|
+
.variant-transparent{
|
|
191
|
+
@apply bg-transparent border-transparent hover:border-transparent
|
|
192
|
+
}
|
|
193
|
+
|
|
188
194
|
.state--2{
|
|
189
195
|
@apply border-red-500
|
|
190
196
|
}
|
package/src/components/Image.vue
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div :class="$style.img">
|
|
3
3
|
<img :class="computedClass" :src="actualSrc" ref="img" @click="onClick" :style="imageStyle"/>
|
|
4
4
|
<input v-if="Boolean(editable)" class="hidden" type="file" accept="image/*" ref="file" @change="onChange"/>
|
|
5
|
-
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</div>
|
|
6
7
|
</template>
|
|
7
8
|
|
|
8
9
|
<script>
|
|
@@ -22,8 +23,6 @@ export default{
|
|
|
22
23
|
|
|
23
24
|
props:{
|
|
24
25
|
|
|
25
|
-
class: String,
|
|
26
|
-
|
|
27
26
|
editable:{
|
|
28
27
|
type: [ Boolean, String ],
|
|
29
28
|
default: false
|
|
@@ -48,7 +47,6 @@ export default{
|
|
|
48
47
|
|
|
49
48
|
computedClass(){
|
|
50
49
|
return [
|
|
51
|
-
this.class,
|
|
52
50
|
this.$style.img
|
|
53
51
|
]
|
|
54
52
|
.join(' ')
|
|
@@ -154,5 +152,9 @@ export default{
|
|
|
154
152
|
.img{
|
|
155
153
|
}
|
|
156
154
|
|
|
155
|
+
.img img{
|
|
156
|
+
height: 100%;
|
|
157
|
+
}
|
|
158
|
+
|
|
157
159
|
|
|
158
160
|
</style>
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
|
|
174
174
|
<script>
|
|
175
175
|
|
|
176
|
-
import
|
|
176
|
+
import throttle from "lodash.throttle";
|
|
177
177
|
|
|
178
178
|
export default{
|
|
179
179
|
|
|
@@ -268,7 +268,7 @@ export default{
|
|
|
268
268
|
})
|
|
269
269
|
},
|
|
270
270
|
|
|
271
|
-
savePreset:
|
|
271
|
+
savePreset: throttle(function(preset) {
|
|
272
272
|
this.socket.emit('user.save-preset', { key:this.model, preset:{
|
|
273
273
|
presetIdx: this.presetIdx,
|
|
274
274
|
presets: this.presets
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
<Textbox v-model="modelValue.text" @blur="$emit('change')" class="border-none"/>
|
|
4
|
+
<div class="bg-base-300 flex flex-row gap-2 border-t-[1px] border-text-200 px-2">
|
|
5
|
+
<Dropdown v-model="modelValue.tagName" size="sm" variant="transparent">
|
|
6
|
+
<option value="default">Default</option>
|
|
7
|
+
<option value="h1">Heading 1</option>
|
|
8
|
+
<option value="h2">Heading 2</option>
|
|
9
|
+
<option value="h3">Heading 3</option>
|
|
10
|
+
<option value="h4">Heading 4</option>
|
|
11
|
+
<option value="h5">Heading 5</option>
|
|
12
|
+
<option value="custom">Custom</option>
|
|
13
|
+
</Dropdown>
|
|
14
|
+
<Dropdown v-if="modelValue.style && modelValue.tagName === 'custom'"
|
|
15
|
+
v-model="modelValue.style.fontFamily" size="sm" variant="transparent">
|
|
16
|
+
<option value="default">Default</option>
|
|
17
|
+
<option value="Arial">Arial</option>
|
|
18
|
+
<option value="Arial Black">Arial Black</option>
|
|
19
|
+
<option value="Impact">Impact</option>
|
|
20
|
+
<option value="Helvetica">Helvetica</option>
|
|
21
|
+
</Dropdown>
|
|
22
|
+
<Dropdown v-if="modelValue.style && modelValue.tagName === 'custom'"
|
|
23
|
+
v-model="modelValue.style.fontSize" size="sm" variant="transparent">
|
|
24
|
+
<option value="default">Default</option>
|
|
25
|
+
<option value="48px">48px</option>
|
|
26
|
+
<option value="42px">42px</option>
|
|
27
|
+
<option value="36px">36px</option>
|
|
28
|
+
<option value="32px">32px</option>
|
|
29
|
+
<option value="28px">28px</option>
|
|
30
|
+
<option value="24px">24px</option>
|
|
31
|
+
<option value="22px">22px</option>
|
|
32
|
+
<option value="21px">21px</option>
|
|
33
|
+
<option value="20px">20px</option>
|
|
34
|
+
<option value="18px">18px</option>
|
|
35
|
+
<option value="16px">16px</option>
|
|
36
|
+
<option value="14px">14px</option>
|
|
37
|
+
<option value="13px">13px</option>
|
|
38
|
+
<option value="12px">12px</option>
|
|
39
|
+
<option value="11px">11px</option>
|
|
40
|
+
</Dropdown>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* modelValue: { text:"", style:"", tagName:"" }
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
export default{
|
|
52
|
+
|
|
53
|
+
props: {
|
|
54
|
+
|
|
55
|
+
modelValue: Object
|
|
56
|
+
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
mounted() {
|
|
60
|
+
if(this.modelValue){
|
|
61
|
+
if(!this.modelValue.style){
|
|
62
|
+
this.modelValue.style = {
|
|
63
|
+
fontFamily: 'default',
|
|
64
|
+
fontSize: 'default',
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if(!this.modelValue.tagName){
|
|
69
|
+
this.modelValue.tagName = 'default'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
console.log('mounted', this.modelValue)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style module>
|
|
80
|
+
|
|
81
|
+
.comp{
|
|
82
|
+
@apply flex flex-col border-[1px] border-text-200 bg-base-50 rounded-lg overflow-hidden;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
</style>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<slot name="start"></slot>
|
|
4
4
|
<input :type="type" :disabled="isDisabled" @focus="isActive = true" @blur="onBlur"
|
|
5
5
|
:placeholder="placeholder" :maxlength="maxlength" ref="input" autocomplete="new-password"
|
|
6
|
-
:value="modelValue" @input="
|
|
6
|
+
:value="modelValue ?? value" @input="onInput"
|
|
7
7
|
@keydown="onKeyDown"/>
|
|
8
8
|
<div v-if="!!(errors)">
|
|
9
9
|
<svg :class="$style.svg" width="24" height="24" class="fill-red-500" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -59,6 +59,8 @@ export default{
|
|
|
59
59
|
|
|
60
60
|
modelValue: [ String, Number ],
|
|
61
61
|
|
|
62
|
+
value: String,
|
|
63
|
+
|
|
62
64
|
placeholder: [ String, Number ],
|
|
63
65
|
maxlength: String,
|
|
64
66
|
type: String,
|
|
@@ -126,6 +128,11 @@ export default{
|
|
|
126
128
|
}
|
|
127
129
|
},
|
|
128
130
|
|
|
131
|
+
onInput(e){
|
|
132
|
+
this.$emit('update:modelValue', e.target.value)
|
|
133
|
+
this.$emit('change', e.target.value)
|
|
134
|
+
},
|
|
135
|
+
|
|
129
136
|
onBlur(){
|
|
130
137
|
this.isActive = false
|
|
131
138
|
this.$emit('blur')
|
package/src/index.js
CHANGED
|
@@ -82,6 +82,7 @@ export default{
|
|
|
82
82
|
app.component('VirtualTable', defineAsyncComponent(() => import("./components/VirtualTable.vue")))
|
|
83
83
|
app.component('Slider', defineAsyncComponent(() => import("./components/Slider.vue")))
|
|
84
84
|
app.component('TabView', defineAsyncComponent(() => import("./components/TabView.vue")))
|
|
85
|
+
app.component('TextEditor', defineAsyncComponent(() => import("./components/TextEditor.vue")))
|
|
85
86
|
app.component('SplitPane', defineAsyncComponent(() => import("./components/SplitPane.vue")))
|
|
86
87
|
|
|
87
88
|
|