@mixd-id/web-scaffold 0.1.240411025 → 0.1.240411027
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 +1 -1
- package/src/widgets/IconListSetting.vue +69 -65
package/package.json
CHANGED
|
@@ -1,64 +1,66 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<div>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
4
|
+
<div class="p-6 py-4 flex flex-col gap-4">
|
|
5
|
+
<div>
|
|
6
|
+
<div class="flex flex-row gap-2">
|
|
7
|
+
<label class="flex-1 text-text-400">Icons</label>
|
|
8
|
+
<button type="button" class="text-primary"
|
|
9
|
+
@click="addIcon()">Add Icon</button>
|
|
10
|
+
</div>
|
|
11
|
+
<ListItem :items="item.props.icons" class="mt-4" body-class="divide-y divide-text-50"
|
|
12
|
+
@reorder="(from, to) => { item.props.icons.splice(to, 0, item.props.icons.splice(from, 1)[0]); apply() }">
|
|
13
|
+
<template v-slot="{ item, index }">
|
|
14
|
+
<div class="flex flex-row gap-1 p-2 bg-text-50 rounded-md mb-1">
|
|
15
|
+
<div data-reorder>
|
|
16
|
+
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="flex-1 flex flex-row gap-1" @click="openIcon(item)">
|
|
19
|
+
<Image :src="imageSrc(item)"
|
|
20
|
+
class="w-[36px] aspect-square rounded-lg" />
|
|
21
|
+
<div class="flex-1 flex flex-col px-3 leading-0">
|
|
22
|
+
<p class="text-ellipsis overflow-hidden whitespace-nowrap">{{ item.text }}</p>
|
|
23
|
+
<small class="text-ellipsis overflow-hidden whitespace-nowrap">{{ item.target }}</small>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div>
|
|
27
|
+
<button type="button" @click="removeIcon(index)">
|
|
28
|
+
<svg class="fill-text-300 hover:fill-red-500" width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
</ListItem>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="flex flex-row items-center gap-4">
|
|
37
|
+
<label class="flex-1 text-text-400">Columns</label>
|
|
38
|
+
<Dropdown v-for="(_viewType, idx) in viewTypes" class="w-[80px]"
|
|
39
|
+
v-model="item.props.columns[idx]"
|
|
40
|
+
v-show="_viewType.value === viewType"
|
|
41
|
+
@change="apply">
|
|
42
|
+
<option :value="`${viewType}grid-cols-1`">1</option>
|
|
43
|
+
<option :value="`${viewType}grid-cols-2`">2</option>
|
|
44
|
+
<option :value="`${viewType}grid-cols-3`">3</option>
|
|
45
|
+
<option :value="`${viewType}grid-cols-4`">4</option>
|
|
46
|
+
<option :value="`${viewType}grid-cols-5`">5</option>
|
|
47
|
+
<option :value="`${viewType}grid-cols-6`">6</option>
|
|
48
|
+
<option :value="`${viewType}grid-cols-7`">7</option>
|
|
49
|
+
<option :value="`${viewType}grid-cols-8`">8</option>
|
|
50
|
+
<option :value="`${viewType}grid-cols-9`">9</option>
|
|
51
|
+
<option :value="`${viewType}grid-cols-10`">10</option>
|
|
52
|
+
<option :value="`${viewType}grid-cols-11`">11</option>
|
|
53
|
+
<option :value="`${viewType}grid-cols-12`">12</option>
|
|
54
|
+
</Dropdown>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<ComponentSetting2 :item="item"
|
|
59
|
+
:view-type="viewType"
|
|
60
|
+
:view-types="viewTypes"
|
|
61
|
+
:view-index="viewIndex"
|
|
62
|
+
defaultDisplay="block"
|
|
63
|
+
@change="$emit('change')" />
|
|
62
64
|
|
|
63
65
|
<Modal ref="iconModal" width="400" height="320">
|
|
64
66
|
<template v-slot:head>
|
|
@@ -115,14 +117,16 @@ export default{
|
|
|
115
117
|
|
|
116
118
|
props: {
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
item: {
|
|
121
|
+
type: Object,
|
|
122
|
+
required: true
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
viewType: String,
|
|
122
126
|
|
|
123
|
-
|
|
127
|
+
viewIndex: Number,
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
viewTypes: Array,
|
|
126
130
|
|
|
127
131
|
},
|
|
128
132
|
|
|
@@ -178,7 +182,7 @@ export default{
|
|
|
178
182
|
<style module>
|
|
179
183
|
|
|
180
184
|
.comp{
|
|
181
|
-
|
|
185
|
+
@apply flex flex-col divide-y divide-text-50;
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
</style>
|