@mixd-id/web-scaffold 0.1.230406247 → 0.1.230406249
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 +5 -2
- package/src/components/Button.vue +4 -7
- package/src/components/Chart.vue +45 -15
- package/src/components/ContextMenu.vue +3 -3
- package/src/components/DGrid.vue +1 -1
- package/src/components/DGridItem.vue +76 -9
- package/src/components/Dropdown.vue +7 -2
- package/src/components/ErrorText.vue +1 -1
- package/src/components/List.vue +348 -115
- package/src/components/ListItem.vue +0 -2
- package/src/components/ListView.vue +7 -7
- package/src/components/MultilineText.vue +1 -1
- package/src/components/ObjectTree.vue +10 -7
- package/src/components/PresetSelectorFilterItem.vue +107 -0
- package/src/components/SearchButton.vue +1 -1
- package/src/components/Tabs.vue +23 -3
- package/src/components/TextWithTag.vue +3 -3
- package/src/components/Textbox.vue +6 -2
- package/src/components/VirtualScroll.vue +1 -1
- package/src/components/VirtualTable.vue +2 -2
- package/src/index.js +77 -58
- package/src/themes/default/index.js +33 -12
- package/src/utils/preset-selector.js +542 -116
- package/src/utils/preset-selector.mjs +47 -0
- package/src/widgets/ColumnSelector.vue +81 -0
- package/src/widgets/PresetBar.vue +592 -0
- package/src/widgets/PresetSelector.vue +257 -114
- package/src/widgets/Share.vue +2 -2
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.230406249",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite serve",
|
|
7
7
|
"build": "vite build",
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
"./importer": "./src/utils/importer.js",
|
|
27
27
|
"./listpage1": "./src/utils/listpage1.js",
|
|
28
28
|
"./listview": "./src/utils/listview.js",
|
|
29
|
-
"./preset-selector":
|
|
29
|
+
"./preset-selector": {
|
|
30
|
+
"require": "./src/utils/preset-selector.js",
|
|
31
|
+
"import": "./src/utils/preset-selector.mjs"
|
|
32
|
+
},
|
|
30
33
|
"./web": "./src/utils/web.js"
|
|
31
34
|
},
|
|
32
35
|
"dependencies": {
|
|
@@ -155,7 +155,7 @@ export default{
|
|
|
155
155
|
.button-primary{
|
|
156
156
|
@apply bg-primary-500 text-white rounded-lg;
|
|
157
157
|
box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
|
|
158
|
-
border: solid 1px rgb(var(--primary-
|
|
158
|
+
border: solid 1px rgb(var(--primary-500));
|
|
159
159
|
}
|
|
160
160
|
.button-primary:focus{
|
|
161
161
|
border-color: rgb(var(--primary-600));
|
|
@@ -207,16 +207,13 @@ export default{
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
.button-secondary{
|
|
210
|
-
@apply bg-
|
|
211
|
-
box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
|
|
212
|
-
border: solid 1px rgb(var(--secondary-200));
|
|
210
|
+
@apply bg-primary-100 border-primary-100 text-primary-700 rounded-lg text-text;
|
|
213
211
|
}
|
|
214
212
|
.button-secondary:hover{
|
|
215
|
-
@apply bg-
|
|
216
|
-
border-color: rgb(var(--secondary-100));
|
|
213
|
+
@apply bg-primary-200 border-primary-200;
|
|
217
214
|
}
|
|
218
215
|
.button-secondary:disabled{
|
|
219
|
-
@apply bg-
|
|
216
|
+
@apply bg-primary-100 opacity-50 top-0 left-0 cursor-not-allowed;
|
|
220
217
|
}
|
|
221
218
|
.button-secondary *{
|
|
222
219
|
@apply text-text-500 fill-white;
|
package/src/components/Chart.vue
CHANGED
|
@@ -2,17 +2,24 @@
|
|
|
2
2
|
<div v-if="readyState === 1" :class="$style.comp">
|
|
3
3
|
|
|
4
4
|
<div class="p-3 flex flex-col items-start leading-tight">
|
|
5
|
-
<small class="text-text-400">
|
|
6
|
-
<
|
|
5
|
+
<small class="text-text-400 text-xs">{{ title ?? 'Untitled' }}</small>
|
|
6
|
+
<h4 class="inline align-top cursor-pointer hover:text-primary group"
|
|
7
|
+
@click="openPreset">
|
|
7
8
|
{{ preset.name ?? 'Preset Name' }}
|
|
8
9
|
<span v-if="badgeCount > 0" class="mx-1 min-w-[19px] px-2 h-[19px] relative top-[-2px] rounded-full bg-primary text-white inline-flex items-center justify-center">
|
|
9
10
|
{{ badgeCount }}
|
|
10
11
|
</span>
|
|
11
|
-
<svg width="13" height="13" class="inline fill-text pointer-events-none group-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>
|
|
12
|
-
</
|
|
12
|
+
<svg v-if="![ 'sidebar', 'external' ].includes(presetMode)" width="13" height="13" class="inline fill-text pointer-events-none group-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>
|
|
13
|
+
</h4>
|
|
13
14
|
</div>
|
|
14
15
|
|
|
15
|
-
<Bar class="w-full"
|
|
16
|
+
<Bar v-if="preset.chart.type === 'bar'" class="w-full"
|
|
17
|
+
id="my-chart-id"
|
|
18
|
+
:options="chartOptions"
|
|
19
|
+
:data="chartData"
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<Line v-if="preset.chart.type === 'line'" class="w-full"
|
|
16
23
|
id="my-chart-id"
|
|
17
24
|
:options="chartOptions"
|
|
18
25
|
:data="chartData"
|
|
@@ -31,16 +38,17 @@
|
|
|
31
38
|
|
|
32
39
|
<script>
|
|
33
40
|
|
|
34
|
-
import { Bar } from 'vue-chartjs'
|
|
35
|
-
import
|
|
41
|
+
import { Bar, Line } from 'vue-chartjs'
|
|
42
|
+
import Chart from 'chart.js/auto'
|
|
36
43
|
import PresetSelector from "../widgets/PresetSelector.vue";
|
|
37
44
|
import throttle from "lodash/throttle";
|
|
38
|
-
|
|
39
|
-
ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale)
|
|
45
|
+
import dayjs from "dayjs";
|
|
40
46
|
|
|
41
47
|
export default{
|
|
42
48
|
|
|
43
|
-
components: {Bar, PresetSelector},
|
|
49
|
+
components: {Bar, Line, PresetSelector},
|
|
50
|
+
|
|
51
|
+
emits: [ 'open-preset' ],
|
|
44
52
|
|
|
45
53
|
inject: [ 'alert', 'socket' ],
|
|
46
54
|
|
|
@@ -52,7 +60,9 @@ export default{
|
|
|
52
60
|
|
|
53
61
|
presetKey: undefined,
|
|
54
62
|
src: undefined,
|
|
63
|
+
title: String,
|
|
55
64
|
subscribeKey: String,
|
|
65
|
+
presetMode: String,
|
|
56
66
|
},
|
|
57
67
|
|
|
58
68
|
data(){
|
|
@@ -108,7 +118,7 @@ export default{
|
|
|
108
118
|
}
|
|
109
119
|
else{
|
|
110
120
|
for(let key in items[0] ?? {}){
|
|
111
|
-
if(key !==
|
|
121
|
+
if(key !== xAxis[0].key){
|
|
112
122
|
datasets.push({
|
|
113
123
|
label: key,
|
|
114
124
|
data: [],
|
|
@@ -121,7 +131,7 @@ export default{
|
|
|
121
131
|
|
|
122
132
|
const labels = []
|
|
123
133
|
for(let item of this.data.items ?? []){
|
|
124
|
-
labels.push(item[xAxis[0].key])
|
|
134
|
+
labels.push(dayjs(item[xAxis[0].key]).format('DD MMM'))
|
|
125
135
|
|
|
126
136
|
if((yAxis[0] ?? {}).aggregrate === 'count'){
|
|
127
137
|
datasets[0].data.push(item['count'])
|
|
@@ -152,7 +162,7 @@ export default{
|
|
|
152
162
|
animation: false,
|
|
153
163
|
plugins: {
|
|
154
164
|
legend: {
|
|
155
|
-
display: false, // Disable the legend
|
|
165
|
+
display: this.preset.chart.showLegend ?? false, // Disable the legend
|
|
156
166
|
},
|
|
157
167
|
},
|
|
158
168
|
scales: {
|
|
@@ -164,6 +174,7 @@ export default{
|
|
|
164
174
|
return `rgb(${gridColor2})`
|
|
165
175
|
}
|
|
166
176
|
},
|
|
177
|
+
stacked: this.preset.chart.type === 'bar' && this.preset.chart.stack
|
|
167
178
|
},
|
|
168
179
|
y: {
|
|
169
180
|
beginAtZero: true, // Adjust y-axis as needed
|
|
@@ -173,6 +184,7 @@ export default{
|
|
|
173
184
|
return `rgb(${gridColor})`
|
|
174
185
|
}
|
|
175
186
|
},
|
|
187
|
+
stacked: this.preset.chart.type === 'bar' && this.preset.chart.stack
|
|
176
188
|
},
|
|
177
189
|
},
|
|
178
190
|
}
|
|
@@ -247,6 +259,24 @@ export default{
|
|
|
247
259
|
}
|
|
248
260
|
|
|
249
261
|
},
|
|
262
|
+
|
|
263
|
+
openPreset(){
|
|
264
|
+
|
|
265
|
+
switch(this.presetMode){
|
|
266
|
+
|
|
267
|
+
case 'external':
|
|
268
|
+
this.$emit('open-preset')
|
|
269
|
+
break
|
|
270
|
+
|
|
271
|
+
case 'sidebar':
|
|
272
|
+
break
|
|
273
|
+
|
|
274
|
+
default:
|
|
275
|
+
this.$refs.presetSelector.open()
|
|
276
|
+
break
|
|
277
|
+
|
|
278
|
+
}
|
|
279
|
+
},
|
|
250
280
|
},
|
|
251
281
|
|
|
252
282
|
mounted() {
|
|
@@ -287,8 +317,8 @@ export default{
|
|
|
287
317
|
<style module>
|
|
288
318
|
|
|
289
319
|
.comp{
|
|
290
|
-
@apply flex flex-col;
|
|
291
|
-
@apply bg-base-
|
|
320
|
+
@apply flex flex-col p-2;
|
|
321
|
+
@apply bg-base-500;
|
|
292
322
|
padding-bottom: 50px;
|
|
293
323
|
}
|
|
294
324
|
|
|
@@ -301,8 +301,8 @@ export default {
|
|
|
301
301
|
<style module>
|
|
302
302
|
|
|
303
303
|
.contextMenu{
|
|
304
|
-
@apply fixed z-20 bg-base-400
|
|
305
|
-
@apply border-[2px] border-
|
|
304
|
+
@apply fixed z-20 bg-base-400 min-w-[150px] overflow-y-auto rounded-xl;
|
|
305
|
+
@apply border-[2px] border-border-50 shadow-2xl whitespace-nowrap;
|
|
306
306
|
transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
307
307
|
opacity: 0;
|
|
308
308
|
}
|
|
@@ -315,7 +315,7 @@ export default {
|
|
|
315
315
|
@media screen(md){
|
|
316
316
|
|
|
317
317
|
.contextMenu{
|
|
318
|
-
@apply fixed z-20 bg-base-
|
|
318
|
+
@apply fixed z-20 bg-base-400 backdrop-blur-md min-w-[150px] overflow-y-auto rounded-lg;
|
|
319
319
|
@apply border-[1px] border-text-50 shadow-2xl whitespace-nowrap;
|
|
320
320
|
transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
321
321
|
opacity: 0;
|
package/src/components/DGrid.vue
CHANGED
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
@click="editMode = true"
|
|
16
16
|
@mousedown="(e) => onMouseDown(e, 'bottom')"></div>
|
|
17
17
|
|
|
18
|
+
<div ref="drag" :class="`${$style.drag} ${editMode ? $style.editMode : ''}`">
|
|
19
|
+
<svg width="48" height="48" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M512 255.1c0 6.755-2.844 13.09-7.844 17.62l-88 80.05C411.5 357.8 405.8 359.9 400 359.9c-13.27 0-24-10.76-24-24c0-6.534 2.647-13.04 7.844-17.78l42.07-38.28H280v146l38.25-42.1c4.715-5.2 11.21-7.849 17.74-7.849c13.23 0 24.01 10.71 24.01 24.03c0 5.765-2.061 11.55-6.25 16.15l-80 88.06C269.2 509.2 262.8 512 256 512s-13.22-2.846-17.75-7.849l-80-88.06c-4.189-4.603-6.25-10.39-6.25-16.15c0-13.38 10.83-24.03 23.1-24.03c6.526 0 13.02 2.649 17.75 7.849L232 425.9V279.8H86.09l42.07 38.28c5.196 4.735 7.844 11.24 7.844 17.78c0 13.22-10.71 24-24 24c-5.781 0-11.53-2.064-16.16-6.254l-88-80.05C2.844 269.1 0 262.7 0 255.1c0-6.755 2.844-13.37 7.844-17.9l88-80.05C100.5 153.8 106.2 151.8 112 151.8c13.26 0 23.99 10.74 23.99 23.99c0 6.534-2.647 13.04-7.844 17.78L86.09 231.8H232V85.8L193.8 127.9C189 133.1 182.5 135.7 175.1 135.7c-13.16 0-23.1-10.66-23.1-24.03c0-5.765 2.061-11.55 6.25-16.15l80-88.06C242.8 2.502 249.4 0 256 0s13.22 2.502 17.75 7.505l80 88.06c4.189 4.603 6.25 10.39 6.25 16.15c0 13.35-10.81 24.03-24 24.03c-6.531 0-13.03-2.658-17.75-7.849L280 85.8v146h145.9l-42.07-38.28c-5.196-4.735-7.844-11.24-7.844-17.78c0-13.25 10.74-23.99 23.98-23.99c5.759 0 11.55 2.061 16.18 6.242l88 80.05C509.2 242.6 512 249.2 512 255.1z"/></svg>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
18
22
|
<button type="button" :class="`${$style.removeBtn} ${editMode ? $style.editMode : ''}`" @click="$emit('remove')">
|
|
19
23
|
<svg width="11" height="11" class="fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M378.4 440.6c8.531 10.16 7.203 25.28-2.938 33.81C370.9 478.2 365.5 480 360 480c-6.844 0-13.64-2.906-18.39-8.562L192 293.3l-149.6 178.1C37.63 477.1 30.83 480 23.98 480c-5.453 0-10.92-1.844-15.42-5.625c-10.14-8.531-11.47-23.66-2.938-33.81L160.7 256L5.625 71.44C-2.906 61.28-1.578 46.16 8.563 37.63C18.69 29.08 33.84 30.39 42.38 40.56L192 218.7l149.6-178.1c8.547-10.17 23.67-11.47 33.81-2.938s11.47 23.66 2.938 33.81L223.3 256L378.4 440.6z"/></svg>
|
|
20
24
|
</button>
|
|
@@ -26,7 +30,7 @@
|
|
|
26
30
|
|
|
27
31
|
export default{
|
|
28
32
|
|
|
29
|
-
emits: [ 'class-change', 'remove' ],
|
|
33
|
+
emits: [ 'class-change', 'remove', 'reorder' ],
|
|
30
34
|
|
|
31
35
|
props: {
|
|
32
36
|
|
|
@@ -53,6 +57,7 @@ export default{
|
|
|
53
57
|
return {
|
|
54
58
|
drag: null,
|
|
55
59
|
editMode: false,
|
|
60
|
+
oEl: null,
|
|
56
61
|
}
|
|
57
62
|
},
|
|
58
63
|
|
|
@@ -82,16 +87,12 @@ export default{
|
|
|
82
87
|
|
|
83
88
|
if(Math.abs(distanceX) > 35){
|
|
84
89
|
const match = this.class.match(/col-span-(\d+)/)
|
|
85
|
-
console.log(match)
|
|
86
90
|
const colSpan = match ? parseInt(match[1]) : 1
|
|
87
91
|
const nextColSpan = distanceX > 0 ? colSpan + 1 <= 12 ? colSpan + 1 : 12 :
|
|
88
92
|
colSpan - 1 >= 1 ? colSpan - 1 : 1
|
|
89
|
-
console.log(colSpan, nextColSpan)
|
|
90
93
|
|
|
91
|
-
console.log(2, this.class)
|
|
92
94
|
const nextClass = match ? this.class.replace(`col-span-${colSpan}`, `col-span-${nextColSpan}`) :
|
|
93
95
|
`${this.class} col-span-${nextColSpan}`
|
|
94
|
-
console.log(2, nextClass)
|
|
95
96
|
|
|
96
97
|
this.drag.x = e.clientX
|
|
97
98
|
this.$emit('class-change', nextClass)
|
|
@@ -100,17 +101,17 @@ export default{
|
|
|
100
101
|
|
|
101
102
|
case 'bottom':
|
|
102
103
|
const distanceY = e.clientY - this.drag.y
|
|
103
|
-
if(Math.abs(distanceY) >
|
|
104
|
+
if(Math.abs(distanceY) > 30){
|
|
104
105
|
const match = this.class.match(/row-span-(\d+)/)
|
|
105
106
|
const rowSpan = match ? parseInt(match[1]) : 1
|
|
106
107
|
const nextRowSpan = distanceY > 0 ? rowSpan + 1 <= 12 ? rowSpan + 1 : 12 :
|
|
107
108
|
rowSpan - 1 >= 1 ? rowSpan - 1 : 1
|
|
108
109
|
|
|
109
|
-
match ? this.class.replace(`row-span-${rowSpan}`, `row-span-${nextRowSpan}`) :
|
|
110
|
-
this.class
|
|
110
|
+
const nextClass = match ? this.class.replace(`row-span-${rowSpan}`, `row-span-${nextRowSpan}`) :
|
|
111
|
+
`${this.class} row-span-${nextRowSpan}`
|
|
111
112
|
|
|
112
113
|
this.drag.y = e.clientY
|
|
113
|
-
this.$emit('class-change',
|
|
114
|
+
this.$emit('class-change', nextClass)
|
|
114
115
|
}
|
|
115
116
|
break
|
|
116
117
|
}
|
|
@@ -131,6 +132,47 @@ export default{
|
|
|
131
132
|
|
|
132
133
|
},
|
|
133
134
|
|
|
135
|
+
onDragOver(e){
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
const oEl = e.target.closest(`.${this.$style.comp}`)
|
|
138
|
+
|
|
139
|
+
if(this.oEl !== oEl){
|
|
140
|
+
this.oEl ? this.oEl.style.opacity = '' : '';
|
|
141
|
+
|
|
142
|
+
if(oEl){
|
|
143
|
+
this.oEl = oEl
|
|
144
|
+
this.oEl.style.opacity = '.5'
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
onDragStart(e){
|
|
150
|
+
window.addEventListener('dragover', this.onDragOver)
|
|
151
|
+
window.addEventListener('dragend', this.onDragEnd)
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
onDragEnd(e){
|
|
155
|
+
|
|
156
|
+
e.preventDefault()
|
|
157
|
+
|
|
158
|
+
const childNodes = Array.from(this.$el.parentNode.children)
|
|
159
|
+
const fromIdx = childNodes.indexOf(this.$el)
|
|
160
|
+
const toIdx = childNodes.indexOf(this.oEl)
|
|
161
|
+
|
|
162
|
+
this.oEl ? this.oEl.style.opacity = '' : '';
|
|
163
|
+
|
|
164
|
+
this.$el.setAttribute('draggable', false)
|
|
165
|
+
window.removeEventListener('dragover', this.onDragOver)
|
|
166
|
+
window.removeEventListener('dragend', this.onDragEnd)
|
|
167
|
+
|
|
168
|
+
this.$emit('reorder', fromIdx, toIdx)
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
onDrag(e){
|
|
172
|
+
this.$el.addEventListener('dragstart', this.onDragStart)
|
|
173
|
+
this.$el.setAttribute('draggable', true)
|
|
174
|
+
}
|
|
175
|
+
|
|
134
176
|
},
|
|
135
177
|
|
|
136
178
|
watch: {
|
|
@@ -138,6 +180,9 @@ export default{
|
|
|
138
180
|
editMode(to){
|
|
139
181
|
to ? window.addEventListener('click', this.checkEditMode) :
|
|
140
182
|
window.removeEventListener('click', this.checkEditMode)
|
|
183
|
+
|
|
184
|
+
to ? this.$refs.drag.addEventListener('mousedown', this.onDrag) :
|
|
185
|
+
this.$refs.drag.removeEventListener('mousedown', this.onDrag)
|
|
141
186
|
}
|
|
142
187
|
|
|
143
188
|
}
|
|
@@ -151,6 +196,19 @@ export default{
|
|
|
151
196
|
.comp{
|
|
152
197
|
@apply relative flex;
|
|
153
198
|
}
|
|
199
|
+
.comp[class~='row-span-2']>*:first-child,
|
|
200
|
+
.comp[class~='row-span-3']>*:first-child,
|
|
201
|
+
.comp[class~='row-span-4']>*:first-child,
|
|
202
|
+
.comp[class~='row-span-5']>*:first-child,
|
|
203
|
+
.comp[class~='row-span-6']>*:first-child,
|
|
204
|
+
.comp[class~='row-span-7']>*:first-child,
|
|
205
|
+
.comp[class~='row-span-8']>*:first-child,
|
|
206
|
+
.comp[class~='row-span-9']>*:first-child,
|
|
207
|
+
.comp[class~='row-span-10']>*:first-child,
|
|
208
|
+
.comp[class~='row-span-11']>*:first-child
|
|
209
|
+
.comp[class~='row-span-12']>*:first-child{
|
|
210
|
+
@apply !absolute !top-0 !left-0 !right-0 !bottom-0 !h-auto;
|
|
211
|
+
}
|
|
154
212
|
|
|
155
213
|
.top{
|
|
156
214
|
@apply h-[3px];
|
|
@@ -193,4 +251,13 @@ export default{
|
|
|
193
251
|
@apply flex;
|
|
194
252
|
}
|
|
195
253
|
|
|
254
|
+
.drag{
|
|
255
|
+
@apply absolute top-0 left-0 right-0 bottom-0;
|
|
256
|
+
@apply rounded-full hidden;
|
|
257
|
+
}
|
|
258
|
+
.drag.editMode{
|
|
259
|
+
@apply flex items-center justify-center flex items-center justify-center;
|
|
260
|
+
@apply cursor-move;
|
|
261
|
+
}
|
|
262
|
+
|
|
196
263
|
</style>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div :class="computedClass">
|
|
4
4
|
|
|
5
5
|
<select v-if="[ 1 ].includes(mode)" class="flex-1" ref="select" @change="onChanged" :disabled="isDisabled"
|
|
6
|
-
:value="modelValue" @input="$emit('update:modelValue', $event.target.value)">
|
|
6
|
+
:value="modelValue" @input="$emit('update:modelValue', $event.target.value)" :class="containerClass">
|
|
7
7
|
<slot></slot>
|
|
8
8
|
</select>
|
|
9
9
|
|
|
@@ -33,6 +33,8 @@ export default {
|
|
|
33
33
|
|
|
34
34
|
props: {
|
|
35
35
|
|
|
36
|
+
containerClass: String,
|
|
37
|
+
|
|
36
38
|
mode: {
|
|
37
39
|
type: [ String, Number ],
|
|
38
40
|
default: 1
|
|
@@ -158,7 +160,6 @@ export default {
|
|
|
158
160
|
<style module>
|
|
159
161
|
|
|
160
162
|
.dropdown{
|
|
161
|
-
@apply min-h-[var(--h-cp)];
|
|
162
163
|
@apply flex items-center rounded-lg overflow-hidden cursor-pointer relative;
|
|
163
164
|
@apply border-[1px] border-text-200 bg-base-50;
|
|
164
165
|
}
|
|
@@ -174,6 +175,10 @@ export default {
|
|
|
174
175
|
@apply appearance-none outline-none p-2 bg-transparent cursor-pointer w-full;
|
|
175
176
|
}
|
|
176
177
|
|
|
178
|
+
.dropdown option{
|
|
179
|
+
@apply bg-base-50 text-text;
|
|
180
|
+
}
|
|
181
|
+
|
|
177
182
|
.dropdown option[disabled]{
|
|
178
183
|
@apply text-text-300;
|
|
179
184
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="$style.comp" v-if="error" @click="$emit('
|
|
2
|
+
<div :class="$style.comp" v-if="error" @click="$emit('dismiss')">
|
|
3
3
|
<div v-if="error.response && error.response.data && error.response.data.errors">
|
|
4
4
|
<div v-if="typeof error.response.data.errors === 'string'">{{ error.response.data.errors }}</div>
|
|
5
5
|
<div v-else v-for="(text, key) in error.response.data.errors">
|