@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406017",
4
+ "version": "0.1.230406019",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -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' && this.state.title.type === 'ValidationError'){
72
- title = 'Validation error'
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' && this.state.title.type === 'ValidationError'){
88
- description = {}
89
- for(let key in this.state.title.errors){
90
- this.state.title.errors[key].forEach((text) => {
91
- description[text] = 1
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-[50vh] overflow-y-auto bg-base-500 rounded-xl;
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-center gap-2;
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{
@@ -157,7 +157,7 @@ export default {
157
157
 
158
158
  .dropdown select,
159
159
  .dropdown input{
160
- @apply appearance-none outline-none p-2 bg-transparent cursor-pointer;
160
+ @apply appearance-none outline-none p-2 bg-transparent cursor-pointer w-full;
161
161
  }
162
162
 
163
163
  .arrow{
@@ -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)