@mixd-id/web-scaffold 0.1.230406017 → 0.1.230406019
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
CHANGED
package/src/components/Alert.vue
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<div v-if="!!state" :class="$style.alert" ref="alert">
|
|
5
5
|
<Transition name="alert" @after-appear="onAfterAppear" appear>
|
|
6
6
|
<div class="p-4 flex flex-col items-center leading-6">
|
|
7
|
-
|
|
8
7
|
<slot v-if="$slots['icon']" name="icon"></slot>
|
|
9
8
|
<svg v-else-if="mode === 'alert'" width="100" height="100" class="fill-red-500" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
10
9
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 13.75C12.4142 13.75 12.75 13.4142 12.75 13V8.00001C12.75 7.5858 12.4142 7.25001 12 7.25001C11.5858 7.25001 11.25 7.5858 11.25 8.00001V13C11.25 13.4142 11.5858 13.75 12 13.75Z"/>
|
|
@@ -68,8 +67,13 @@ export default{
|
|
|
68
67
|
let title
|
|
69
68
|
|
|
70
69
|
if(this.state && this.state.title){
|
|
71
|
-
if(typeof this.state.title === 'object'
|
|
72
|
-
title
|
|
70
|
+
if(typeof this.state.title === 'object'){
|
|
71
|
+
if(this.state.title.type === 'ValidationError'){
|
|
72
|
+
title = 'Validation error'
|
|
73
|
+
}
|
|
74
|
+
else if(this.state.title.status){
|
|
75
|
+
title = 'Error ' + this.state.title.status
|
|
76
|
+
}
|
|
73
77
|
}
|
|
74
78
|
else{
|
|
75
79
|
title = this.state.title
|
|
@@ -84,14 +88,19 @@ export default{
|
|
|
84
88
|
|
|
85
89
|
if(this.state){
|
|
86
90
|
|
|
87
|
-
if(typeof this.state.title === 'object'
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this.state.title.errors
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
if(typeof this.state.title === 'object'){
|
|
92
|
+
if(this.state.title.type === 'ValidationError'){
|
|
93
|
+
description = {}
|
|
94
|
+
for(let key in this.state.title.errors){
|
|
95
|
+
this.state.title.errors[key].forEach((text) => {
|
|
96
|
+
description[text] = 1
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
description = Object.keys(description).join("\n")
|
|
100
|
+
}
|
|
101
|
+
else if(this.state.title.message){
|
|
102
|
+
description = this.state.title.message
|
|
93
103
|
}
|
|
94
|
-
description = Object.keys(description).join("\n")
|
|
95
104
|
}
|
|
96
105
|
else{
|
|
97
106
|
description = this.state.description
|
|
@@ -126,7 +135,7 @@ export default{
|
|
|
126
135
|
}
|
|
127
136
|
|
|
128
137
|
.alert>*{
|
|
129
|
-
@apply max-h-[
|
|
138
|
+
@apply max-h-[60vh] overflow-y-auto bg-base-500 rounded-xl;
|
|
130
139
|
@apply border-[1px] border-text-50;
|
|
131
140
|
@apply min-w-[280px] max-w-[80vw] md:max-w-[400px];
|
|
132
141
|
}
|
|
@@ -104,11 +104,15 @@ export default{
|
|
|
104
104
|
<style module>
|
|
105
105
|
|
|
106
106
|
.comp{
|
|
107
|
-
@apply h-[var(--h-cp)] flex items-center;
|
|
107
|
+
@apply min-h-[var(--h-cp)] flex items-center;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.comp label{
|
|
111
|
-
@apply flex flex-row items-
|
|
111
|
+
@apply flex flex-row items-start gap-2;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.comp label>*:last-child{
|
|
115
|
+
@apply flex-1;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
.comp input{
|
package/src/utils/listpage1.js
CHANGED
|
@@ -1429,7 +1429,7 @@ let ListPage1 = {
|
|
|
1429
1429
|
|
|
1430
1430
|
async onHooks(model, event, items, socket){
|
|
1431
1431
|
|
|
1432
|
-
if(socket.loadParams[this.name] && [ 'create', 'update' ].includes(event)){
|
|
1432
|
+
if(socket.loadParams && socket.loadParams[this.name] && [ 'create', 'update' ].includes(event)){
|
|
1433
1433
|
const loadParams = { ...socket.loadParams[this.name] }
|
|
1434
1434
|
|
|
1435
1435
|
if(!loadParams.preset.filters)
|