@mixd-id/web-scaffold 0.1.230406059 → 0.1.230406061
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 -2
- package/src/components/ColorPicker.vue +84 -0
- package/src/components/ImagePreview.vue +1 -1
- package/src/components/ListView.vue +57 -30
- package/src/components/ListViewSettings.vue +33 -9
- package/src/components/Modal.vue +3 -2
- package/src/components/VirtualScroll.vue +3 -5
- package/src/index.js +1 -0
- package/src/utils/listpage1.js +8 -0
- package/src/utils/listview.js +1507 -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.230406061",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite serve",
|
|
7
7
|
"build": "vite build",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"import": "./src/utils/helpers.mjs"
|
|
17
17
|
},
|
|
18
18
|
"./importer": "./src/utils/importer.js",
|
|
19
|
-
"./listpage1": "./src/utils/listpage1.js"
|
|
19
|
+
"./listpage1": "./src/utils/listpage1.js",
|
|
20
|
+
"./listview": "./src/utils/listview.js"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
23
|
"@faker-js/faker": "^7.3.0",
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
<div :class="$style.circle" @click="$refs.contextMenu.open($refs.btn)"
|
|
4
|
+
ref="btn" :style="{ backgroundColor:this.modelValue }"></div>
|
|
5
|
+
<input type="color" :class="$style.inputColor" ref="inputColor"
|
|
6
|
+
@change="select($refs.inputColor.value)"/>
|
|
7
|
+
|
|
8
|
+
<ContextMenu ref="contextMenu" :dismiss="false">
|
|
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>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<button type="button" v-if="Boolean(customColor)"
|
|
17
|
+
class="w-full p-1 border-text-100 border-[1px] rounded-lg"
|
|
18
|
+
@click="$refs.inputColor.click()">Custom</button>
|
|
19
|
+
</div>
|
|
20
|
+
</ContextMenu>
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
|
|
27
|
+
export default{
|
|
28
|
+
|
|
29
|
+
props: {
|
|
30
|
+
|
|
31
|
+
colors: Array,
|
|
32
|
+
|
|
33
|
+
customColor: undefined,
|
|
34
|
+
|
|
35
|
+
modelValue: String
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
methods: {
|
|
40
|
+
|
|
41
|
+
select(color){
|
|
42
|
+
this.$emit('update:modelValue', color)
|
|
43
|
+
this.$refs.contextMenu.close()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
computed:{
|
|
49
|
+
|
|
50
|
+
customColorCount(){
|
|
51
|
+
const count = parseInt(this.customColor)
|
|
52
|
+
return isNaN(count) ? 0 : count
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
data(){
|
|
58
|
+
return {
|
|
59
|
+
customColors: []
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style module>
|
|
68
|
+
|
|
69
|
+
.comp{
|
|
70
|
+
@apply p-[2px] border-[1px] border-text-200 rounded-full relative;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.circle{
|
|
74
|
+
@apply w-[19px] h-[19px] rounded-full cursor-pointer;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.inputColor{
|
|
78
|
+
@apply absolute top-0 left-0;
|
|
79
|
+
width: 0;
|
|
80
|
+
height: 0;
|
|
81
|
+
opacity: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
</style>
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="$style.comp"
|
|
2
|
+
<div :class="$style.comp">
|
|
3
3
|
|
|
4
4
|
<slot v-if="$slots.head" name="head"></slot>
|
|
5
5
|
<div v-else class="flex flex-row items-center gap-4 px-6 md:px-0 py-4 md:py-0 bg-base-400 dark:bg-base-300 md:bg-transparent">
|
|
6
|
-
<div class="flex-1 flex flex-row gap-
|
|
6
|
+
<div class="flex-1 flex flex-row gap-6">
|
|
7
7
|
<button type="button" ref="presetSelectorBtn"
|
|
8
8
|
class="flex-1 md:flex-none flex flex-row gap-1 items-center text-left md:ml-2"
|
|
9
9
|
@click="$refs.presetSelector.toggle($refs.presetSelectorBtn)">
|
|
10
10
|
<h2 class="overflow-hidden whitespace-nowrap text-ellipsis">{{ preset.name }}</h2>
|
|
11
|
-
<svg width="
|
|
12
|
-
</button>
|
|
13
|
-
<button type="button" @click="openPreset()">
|
|
14
|
-
<svg width="19" height="19" class="fill-text hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M452.515 237l31.843-18.382c9.426-5.441 13.996-16.542 11.177-27.054-11.404-42.531-33.842-80.547-64.058-110.797-7.68-7.688-19.575-9.246-28.985-3.811l-31.785 18.358a196.276 196.276 0 0 0-32.899-19.02V39.541a24.016 24.016 0 0 0-17.842-23.206c-41.761-11.107-86.117-11.121-127.93-.001-10.519 2.798-17.844 12.321-17.844 23.206v36.753a196.276 196.276 0 0 0-32.899 19.02l-31.785-18.358c-9.41-5.435-21.305-3.877-28.985 3.811-30.216 30.25-52.654 68.265-64.058 110.797-2.819 10.512 1.751 21.613 11.177 27.054L59.485 237a197.715 197.715 0 0 0 0 37.999l-31.843 18.382c-9.426 5.441-13.996 16.542-11.177 27.054 11.404 42.531 33.842 80.547 64.058 110.797 7.68 7.688 19.575 9.246 28.985 3.811l31.785-18.358a196.202 196.202 0 0 0 32.899 19.019v36.753a24.016 24.016 0 0 0 17.842 23.206c41.761 11.107 86.117 11.122 127.93.001 10.519-2.798 17.844-12.321 17.844-23.206v-36.753a196.34 196.34 0 0 0 32.899-19.019l31.785 18.358c9.41 5.435 21.305 3.877 28.985-3.811 30.216-30.25 52.654-68.266 64.058-110.797 2.819-10.512-1.751-21.613-11.177-27.054L452.515 275c1.22-12.65 1.22-25.35 0-38zm-52.679 63.019l43.819 25.289a200.138 200.138 0 0 1-33.849 58.528l-43.829-25.309c-31.984 27.397-36.659 30.077-76.168 44.029v50.599a200.917 200.917 0 0 1-67.618 0v-50.599c-39.504-13.95-44.196-16.642-76.168-44.029l-43.829 25.309a200.15 200.15 0 0 1-33.849-58.528l43.819-25.289c-7.63-41.299-7.634-46.719 0-88.038l-43.819-25.289c7.85-21.229 19.31-41.049 33.849-58.529l43.829 25.309c31.984-27.397 36.66-30.078 76.168-44.029V58.845a200.917 200.917 0 0 1 67.618 0v50.599c39.504 13.95 44.196 16.642 76.168 44.029l43.829-25.309a200.143 200.143 0 0 1 33.849 58.529l-43.819 25.289c7.631 41.3 7.634 46.718 0 88.037zM256 160c-52.935 0-96 43.065-96 96s43.065 96 96 96 96-43.065 96-96-43.065-96-96-96zm0 144c-26.468 0-48-21.532-48-48 0-26.467 21.532-48 48-48s48 21.533 48 48c0 26.468-21.532 48-48 48z"/></svg>
|
|
11
|
+
<svg width="13" height="13" class="ml-1 relative top-[2px] fill-text hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/></svg>
|
|
15
12
|
</button>
|
|
16
13
|
|
|
17
14
|
<ContextMenu ref="presetSelector">
|
|
18
|
-
<div class="flex-1 flex flex-col md:w-[270px] cursor-pointer">
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
<div class="flex-1 flex flex-col gap-4 md:w-[270px] cursor-pointer p-6">
|
|
16
|
+
<div class="pb-0 flex flex-row gap-4">
|
|
17
|
+
<h4 class="flex-1">Select Preset</h4>
|
|
18
|
+
<button type="button" class="text-primary" @click="openPreset">Settings</button>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="border-text-50 border-[1px] divide-y divide-text-50 bg-base-400 rounded-lg overflow-hidden">
|
|
21
|
+
<button type="button" v-for="(preset, idx) in config.presets"
|
|
22
|
+
class="p-3 text-left hover:bg-primary hover:text-white block w-full"
|
|
23
|
+
@click="selectPreset(idx)">
|
|
24
|
+
{{ preset.name }}
|
|
25
|
+
</button>
|
|
26
|
+
</div>
|
|
24
27
|
</div>
|
|
25
28
|
</ContextMenu>
|
|
26
29
|
|
|
@@ -50,8 +53,9 @@
|
|
|
50
53
|
|
|
51
54
|
<slot name="headerOpt"></slot>
|
|
52
55
|
|
|
53
|
-
<Textbox :placeholder="$t('Search...')" :clearable="true"
|
|
54
|
-
@
|
|
56
|
+
<Textbox v-if="mediaPrefix && mediaPrefix !== 'sm'" :placeholder="$t('Search...')" :clearable="true"
|
|
57
|
+
@clear="clearSearch" v-model="preset.search"
|
|
58
|
+
@keyup.enter="load" :class="$style.searchBox">
|
|
55
59
|
<template #start>
|
|
56
60
|
<div class="pl-2">
|
|
57
61
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.5 481.6l-129-129c-2.3-2.3-5.3-3.5-8.5-3.5h-10.3C395 312 416 262.5 416 208 416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c54.5 0 104-21 141.1-55.2V371c0 3.2 1.3 6.2 3.5 8.5l129 129c4.7 4.7 12.3 4.7 17 0l9.9-9.9c4.7-4.7 4.7-12.3 0-17zM208 384c-97.3 0-176-78.7-176-176S110.7 32 208 32s176 78.7 176 176-78.7 176-176 176z"/></svg>
|
|
@@ -60,9 +64,9 @@
|
|
|
60
64
|
</Textbox>
|
|
61
65
|
</div>
|
|
62
66
|
|
|
63
|
-
<div v-if="mediaPrefix === 'sm'" class="px-6 pb-4 border-b-[1px] border-text-50 bg-base-400 dark:bg-base-300">
|
|
67
|
+
<div v-if="mediaPrefix && mediaPrefix === 'sm'" class="px-6 pb-4 border-b-[1px] border-text-50 bg-base-400 dark:bg-base-300">
|
|
64
68
|
<Textbox :placeholder="$t('Search...')" :clearable="true" @clear="clearSearch" v-model="preset.search"
|
|
65
|
-
@keyup.enter="load" :class="$style.
|
|
69
|
+
@keyup.enter="load" :class="$style.searchBox2">
|
|
66
70
|
<template #start>
|
|
67
71
|
<div class="pl-2">
|
|
68
72
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.5 481.6l-129-129c-2.3-2.3-5.3-3.5-8.5-3.5h-10.3C395 312 416 262.5 416 208 416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c54.5 0 104-21 141.1-55.2V371c0 3.2 1.3 6.2 3.5 8.5l129 129c4.7 4.7 12.3 4.7 17 0l9.9-9.9c4.7-4.7 4.7-12.3 0-17zM208 384c-97.3 0-176-78.7-176-176S110.7 32 208 32s176 78.7 176 176-78.7 176-176 176z"/></svg>
|
|
@@ -71,9 +75,25 @@
|
|
|
71
75
|
</Textbox>
|
|
72
76
|
</div>
|
|
73
77
|
|
|
78
|
+
<div class="grid grid-cols-4 gap-4 hidden">
|
|
79
|
+
<div v-for="i in 4">
|
|
80
|
+
<div class="p-3 rounded-lg bg-base-400 border-[1px] border-text-50">
|
|
81
|
+
<label>Value</label>
|
|
82
|
+
<h2>23,000</h2>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
74
87
|
<div class="flex-1 flex" v-if="mediaPrefix">
|
|
75
|
-
<
|
|
76
|
-
|
|
88
|
+
<VirtualScroll v-if="mediaPrefix === 'sm'" :items="items" ref="table2"
|
|
89
|
+
class="flex-1 bg-base-400 dark:bg-base-300" @scroll-end="loadNext">
|
|
90
|
+
<template #item="{ item }">
|
|
91
|
+
<slot name="mobileItem" :item="item"></slot>
|
|
92
|
+
</template>
|
|
93
|
+
</VirtualScroll>
|
|
94
|
+
|
|
95
|
+
<VirtualTable v-else ref="table1" :columns="presetColumns" :items="items"
|
|
96
|
+
class="flex-1 bg-base-400"
|
|
77
97
|
@scroll-end="loadNext">
|
|
78
98
|
<template v-for="column in presetColumns" #[colOf(column.key)]="{}">
|
|
79
99
|
<div :class="getHeader(column)" @click="openColumnOptions(column.key, $event.target.closest('.' + $style.header))">
|
|
@@ -107,11 +127,6 @@
|
|
|
107
127
|
<slot :name="slot" :item="item" :index="index"></slot>
|
|
108
128
|
</template>
|
|
109
129
|
</VirtualTable>
|
|
110
|
-
<VirtualScroll v-else :items="items" ref="table2" class="flex-1 bg-base-400 dark:bg-base-300" @scroll-end="loadNext">
|
|
111
|
-
<template #item="{ item }">
|
|
112
|
-
<slot name="mobileItem" :item="item"></slot>
|
|
113
|
-
</template>
|
|
114
|
-
</VirtualScroll>
|
|
115
130
|
</div>
|
|
116
131
|
|
|
117
132
|
<ContextMenu ref="columnMenu" :dismiss="false">
|
|
@@ -211,7 +226,7 @@ export default{
|
|
|
211
226
|
this.presetFilterSelector = null
|
|
212
227
|
},
|
|
213
228
|
|
|
214
|
-
calcMediaPrefix
|
|
229
|
+
calcMediaPrefix() {
|
|
215
230
|
if(!this.$el) return
|
|
216
231
|
|
|
217
232
|
const w = this.$el.clientWidth
|
|
@@ -235,7 +250,7 @@ export default{
|
|
|
235
250
|
}
|
|
236
251
|
|
|
237
252
|
this.mediaPrefix = prefix
|
|
238
|
-
},
|
|
253
|
+
},
|
|
239
254
|
|
|
240
255
|
clearSearch(){
|
|
241
256
|
this.preset.search = ''
|
|
@@ -265,10 +280,16 @@ export default{
|
|
|
265
280
|
load(){
|
|
266
281
|
if(!this.src) return
|
|
267
282
|
|
|
283
|
+
this.$refs.table1 ? this.$refs.table1.setState(2) : this.$refs.table2.setState(3)
|
|
268
284
|
this.socketEmit2(this.src, { preset: this.preset })
|
|
269
285
|
.then((res) => {
|
|
270
286
|
Object.assign(this.$data, res)
|
|
271
287
|
})
|
|
288
|
+
.finally(() => {
|
|
289
|
+
this.$refs.table1 ? this.$refs.table1.setState(1) : this.$refs.table2.setState(1)
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
this.loadSummary()
|
|
272
293
|
},
|
|
273
294
|
|
|
274
295
|
loadNext(){
|
|
@@ -290,6 +311,7 @@ export default{
|
|
|
290
311
|
},
|
|
291
312
|
|
|
292
313
|
async loadConfig(){
|
|
314
|
+
|
|
293
315
|
if(!this.configStoreObj || 'reset' in ((this.$route ?? {}).query ?? {})){
|
|
294
316
|
this.configLoaded = true
|
|
295
317
|
return
|
|
@@ -305,7 +327,6 @@ export default{
|
|
|
305
327
|
}
|
|
306
328
|
|
|
307
329
|
this.configLoaded = true
|
|
308
|
-
this.$nextTick(() => this.calcMediaPrefix())
|
|
309
330
|
})
|
|
310
331
|
}
|
|
311
332
|
},
|
|
@@ -528,20 +549,22 @@ export default{
|
|
|
528
549
|
configLoaded: false,
|
|
529
550
|
selectedColumn: null,
|
|
530
551
|
copiedConfig: null,
|
|
531
|
-
mediaPrefix:
|
|
552
|
+
mediaPrefix: null
|
|
532
553
|
}
|
|
533
554
|
},
|
|
534
555
|
|
|
535
556
|
|
|
536
557
|
mounted() {
|
|
537
|
-
window.addEventListener('resize', () => this.calcMediaPrefix())
|
|
558
|
+
window.addEventListener('resize', throttle(() => this.calcMediaPrefix(), 100, { leading:true }))
|
|
538
559
|
this.calcMediaPrefix()
|
|
560
|
+
|
|
539
561
|
this.socket.onAny(this.onHooks)
|
|
540
562
|
|
|
541
563
|
window.setTimeout(() => {
|
|
542
564
|
this.loadConfig().then(() => {
|
|
543
|
-
|
|
544
|
-
|
|
565
|
+
window.setTimeout(() => {})
|
|
566
|
+
this.load()
|
|
567
|
+
}, 1000)
|
|
545
568
|
}, 201)
|
|
546
569
|
|
|
547
570
|
this.subscribe()
|
|
@@ -576,6 +599,10 @@ export default{
|
|
|
576
599
|
@apply !bg-base-400 md:w-[300px];
|
|
577
600
|
}
|
|
578
601
|
|
|
602
|
+
.searchBox2{
|
|
603
|
+
@apply bg-text-50;
|
|
604
|
+
}
|
|
605
|
+
|
|
579
606
|
.header{
|
|
580
607
|
@apply p-2 cursor-pointer border-b-[2px] border-transparent overflow-hidden;
|
|
581
608
|
}
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
|
|
12
12
|
<div class="flex-1 overflow-y-auto">
|
|
13
13
|
<div v-for="(preset, idx) in config.presets"
|
|
14
|
-
class="p-2 py-4 md:py-2 flex flex-row gap-2 items-center hover:bg-primary-50 cursor-pointer"
|
|
14
|
+
class="p-2 py-4 md:py-2 flex flex-row gap-2 px-4 items-center hover:bg-primary-50 cursor-pointer"
|
|
15
15
|
:class="config.presetIdx === idx ? 'bg-primary-100' : ''">
|
|
16
|
-
<div @click="config.presetIdx = idx" class="flex-1 p-1
|
|
16
|
+
<div @click="config.presetIdx = idx" class="flex-1 p-1 overflow-x-hidden whitespace-nowrap text-ellipsis">
|
|
17
17
|
<label>{{ preset.name }}</label>
|
|
18
18
|
</div>
|
|
19
|
-
<button type="button" @click="
|
|
20
|
-
<svg width="16" height="16" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0
|
|
19
|
+
<button type="button" @click="$refs.presetMenu.open($event.target, { idx })">
|
|
20
|
+
<svg width="16" height="16" class="fill-text-300 hover:fill-primary-500 pointer-events-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"/></svg>
|
|
21
21
|
</button>
|
|
22
|
-
<button type="button" class="px-2" v-if="config.presets.length > 1" @click="removePreset(idx)">
|
|
22
|
+
<button type="button" class="hidden px-2" v-if="config.presets.length > 1" @click="removePreset(idx)">
|
|
23
23
|
<svg width="16" height="16" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
|
|
24
24
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 10.25C10.4142 10.25 10.75 10.5858 10.75 11V16C10.75 16.4142 10.4142 16.75 10 16.75C9.58579 16.75 9.25 16.4142 9.25 16V11C9.25 10.5858 9.58579 10.25 10 10.25Z"/>
|
|
25
25
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 10.25C14.4142 10.25 14.75 10.5858 14.75 11V16C14.75 16.4142 14.4142 16.75 14 16.75C13.5858 16.75 13.25 16.4142 13.25 16V11C13.25 10.5858 13.5858 10.25 14 10.25Z"/>
|
|
@@ -27,6 +27,28 @@
|
|
|
27
27
|
</svg>
|
|
28
28
|
</button>
|
|
29
29
|
</div>
|
|
30
|
+
|
|
31
|
+
<ContextMenu ref="presetMenu">
|
|
32
|
+
<template #default="{ context }">
|
|
33
|
+
<div class="p-3 flex flex-col">
|
|
34
|
+
<button type="button"
|
|
35
|
+
@click="detailMode = true"
|
|
36
|
+
class="md:hidden w-full text-left p-2 px-3 hover:bg-text-50 rounded-lg">
|
|
37
|
+
Open
|
|
38
|
+
</button>
|
|
39
|
+
<button type="button"
|
|
40
|
+
@click="duplicatePreset(context.idx)"
|
|
41
|
+
class="w-full text-left p-2 px-3 hover:bg-text-50 rounded-lg">
|
|
42
|
+
Duplicate
|
|
43
|
+
</button>
|
|
44
|
+
<button type="button" v-if="config.presets.length > 1"
|
|
45
|
+
@click="removePreset(context.idx)"
|
|
46
|
+
class="w-full text-left p-2 px-3 hover:bg-text-50 rounded-lg">
|
|
47
|
+
Remove
|
|
48
|
+
</button>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
</ContextMenu>
|
|
30
52
|
</div>
|
|
31
53
|
|
|
32
54
|
</div>
|
|
@@ -35,12 +57,9 @@
|
|
|
35
57
|
<div class="p-6 pb-0">
|
|
36
58
|
<div class="flex flex-row items-center gap-4 mb-3">
|
|
37
59
|
<button type="button" class="md:hidden" @click="detailMode = false">
|
|
38
|
-
|
|
39
|
-
<path d="M10.5303 17.9697C10.8232 18.2626 10.8232 18.7374 10.5303 19.0303C10.2374 19.3232 9.76253 19.3232 9.46964 19.0303L3.67675 13.2374C2.99333 12.554 2.99333 11.446 3.67675 10.7626L9.46964 4.96967C9.76253 4.67678 10.2374 4.67678 10.5303 4.96967C10.8232 5.26256 10.8232 5.73744 10.5303 6.03033L5.31063 11.25H20C20.4142 11.25 20.75 11.5858 20.75 12C20.75 12.4142 20.4142 12.75 20 12.75H5.31063L10.5303 17.9697Z"/>
|
|
40
|
-
</svg>
|
|
60
|
+
<svg width="19" height="19" class="fill-text-300 hover:fill-primary-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48H48C21.49 32 0 53.49 0 80zm472 224H197.333v-96H472v96zm0 40v84c0 6.627-5.373 12-12 12H197.333v-96H472zM40 208h117.333v96H40v-96zm157.333-40V72H460c6.627 0 12 5.373 12 12v84H197.333zm-40-96v96H40V84c0-6.627 5.373-12 12-12h105.333zM40 344h117.333v96H52c-6.627 0-12-5.373-12-12v-84z"/></svg>
|
|
41
61
|
</button>
|
|
42
62
|
<div class="flex-1 flex flex-row items-center gap-2">
|
|
43
|
-
<svg @click="$refs.title.select()" width="16" height="16" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg>
|
|
44
63
|
<input ref="title" class="flex-1 text-xl bg-transparent outline-none" :value="preset.name" maxlength="30"
|
|
45
64
|
@blur="preset.name = $event.target.value"
|
|
46
65
|
@keyup.enter="preset.name = $event.target.value" />
|
|
@@ -412,6 +431,11 @@ export default{
|
|
|
412
431
|
this.config.presetIdx = this.config.presets[index] ? index : this.config.presets.length - 1
|
|
413
432
|
},
|
|
414
433
|
|
|
434
|
+
duplicatePreset(index){
|
|
435
|
+
this.config.presets.push(JSON.parse(JSON.stringify(this.config.presets[index])))
|
|
436
|
+
this.config.presetIdx = this.config.presets.length - 1
|
|
437
|
+
},
|
|
438
|
+
|
|
415
439
|
addFilter(key){
|
|
416
440
|
|
|
417
441
|
const column = this.presetColumns.find((_) => _.key === key)
|
package/src/components/Modal.vue
CHANGED
|
@@ -205,7 +205,8 @@ export default{
|
|
|
205
205
|
|
|
206
206
|
.modal{
|
|
207
207
|
@apply fixed;
|
|
208
|
-
@apply bg-base-
|
|
208
|
+
@apply bg-base-300;
|
|
209
|
+
@apply border-[1px] border-text-50 z-20 flex max-h-[90vh];
|
|
209
210
|
@apply rounded-xl overflow-hidden;
|
|
210
211
|
transition: all 300ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
211
212
|
}
|
|
@@ -215,7 +216,7 @@ export default{
|
|
|
215
216
|
}
|
|
216
217
|
|
|
217
218
|
.modalBody{
|
|
218
|
-
@apply flex-1 min-h-0 overflow-y-auto flex;
|
|
219
|
+
@apply flex-1 min-h-0 overflow-y-auto flex bg-base-400 dark:bg-base-300;
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
.overlay{
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
|
-
<div v-if="state ===
|
|
4
|
-
<
|
|
5
|
-
<svg class="animate-spin aspect-square w-[16px] h-[16px] text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
|
|
6
|
-
</div>
|
|
3
|
+
<div v-if="state === 3" ref="spinner" class="flex-1 flex items-center justify-center p-8">
|
|
4
|
+
<svg class="animate-spin aspect-square w-[32px] h-[32px] text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
|
|
7
5
|
</div>
|
|
8
|
-
<div ref="scroller" :class="$style.scroller" :style="scrollerStyle">
|
|
6
|
+
<div v-else ref="scroller" :class="$style.scroller" :style="scrollerStyle">
|
|
9
7
|
<div v-if="visibleItems && visibleItems.length > 0" :class="$style.spacer" ref="spacer" :style="spacerStyle">
|
|
10
8
|
<div v-for="(item, index) in visibleItems" :key="item" :data-id="item.id"
|
|
11
9
|
@click="select(item, index)"
|
package/src/index.js
CHANGED
|
@@ -225,6 +225,7 @@ export default{
|
|
|
225
225
|
app.component('Alert', defineAsyncComponent(() => import("./components/Alert.vue")))
|
|
226
226
|
app.component('Button', defineAsyncComponent(() => import("./components/Button.vue")))
|
|
227
227
|
app.component('Box', defineAsyncComponent(() => import("./components/Box.vue")))
|
|
228
|
+
app.component('ColorPicker', defineAsyncComponent(() => import("./components/ColorPicker.vue")))
|
|
228
229
|
app.component('SearchButton', defineAsyncComponent(() => import("./components/SearchButton.vue")))
|
|
229
230
|
app.component('ButtonGroup', defineAsyncComponent(() => import("./components/ButtonGroup.vue")))
|
|
230
231
|
app.component('ChatTyping', defineAsyncComponent(() => import("./components/ChatTyping.vue")))
|
package/src/utils/listpage1.js
CHANGED