@mixd-id/web-scaffold 0.1.230406031 → 0.1.230406033

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.230406031",
4
+ "version": "0.1.230406033",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -74,6 +74,9 @@ export default{
74
74
  else if(this.state.title.status){
75
75
  title = 'Error ' + this.state.title.status
76
76
  }
77
+ else if(this.state.title.reason && this.state.title.reason.status){
78
+ title = 'Error ' + this.state.title.reason.status
79
+ }
77
80
  }
78
81
  else{
79
82
  title = this.state.title
@@ -101,6 +104,10 @@ export default{
101
104
  else if(this.state.title.message){
102
105
  description = this.state.title.message
103
106
  }
107
+ else if(this.state.title.reason && this.state.title.reason.message &&
108
+ this.state.title.reason.message.message){
109
+ description = this.state.title.reason.message.message
110
+ }
104
111
  }
105
112
  else{
106
113
  description = this.state.description
@@ -137,7 +144,7 @@ export default{
137
144
  .alert>*{
138
145
  @apply max-h-[60vh] overflow-y-auto bg-base-500 rounded-xl;
139
146
  @apply border-[1px] border-text-50;
140
- @apply min-w-[280px] max-w-[80vw] md:max-w-[400px];
147
+ @apply min-w-[280px] max-w-[80vw] md:max-w-[480px];
141
148
  }
142
149
 
143
150
  .cont1{
@@ -153,7 +160,15 @@ export default{
153
160
  }
154
161
 
155
162
  .description{
156
- @apply break-words overflow-y-auto whitespace-pre-line text-center;
163
+ @apply overflow-y-auto whitespace-pre-line text-center;
164
+ overflow-wrap: break-word;
165
+ word-wrap: break-word;
166
+ -ms-word-break: break-all;
167
+ word-break: break-word;
168
+ -ms-hyphens: auto;
169
+ -moz-hyphens: auto;
170
+ -webkit-hyphens: auto;
171
+ hyphens: auto;
157
172
  }
158
173
 
159
174
  </style>
@@ -33,7 +33,10 @@ export default{
33
33
  default: '' // 0|1|2|3, default: 2
34
34
  },
35
35
 
36
- state: [ String, Number ], // -1:disabled, 1:normal, 2:loading, default: normal
36
+ state: {
37
+ type: [ String, Number ], // -1:disabled, 1:normal, 2:loading, default: normal,
38
+ default: 1
39
+ }
37
40
 
38
41
  },
39
42
 
@@ -60,14 +63,14 @@ export default{
60
63
  },
61
64
 
62
65
  computedState(){
63
- return this.state ?? this._state
66
+ return this._state ?? this.state
64
67
  }
65
68
 
66
69
  },
67
70
 
68
71
  data(){
69
72
  return {
70
- _state: 1
73
+ _state: null
71
74
  }
72
75
  },
73
76
 
@@ -79,6 +82,10 @@ export default{
79
82
 
80
83
  setState(state){
81
84
  this._state = state
85
+ },
86
+
87
+ resetState(){
88
+ this._state = null
82
89
  }
83
90
 
84
91
  }
@@ -143,19 +150,22 @@ export default{
143
150
  fill: #fff;
144
151
  fill-opacity: 75%;
145
152
  }
153
+ .variant-primary:disabled{
154
+ @apply bg-primary-500 border-primary-500 opacity-50 top-0 left-0 cursor-not-allowed;
155
+ }
146
156
 
147
157
  .variant-outline{
148
158
  @apply bg-transparent text-primary-500 border-[2px] border-primary-500;
149
159
  }
150
160
  .variant-outline:hover{
151
- @apply border-primary-300 text-primary-300;
161
+ @apply border-primary-500 text-text;
152
162
  }
153
163
  .variant-outline:active{
154
164
  @apply top-[1px] left-[1px] active:relative;
155
165
  }
156
166
  .variant-outline:disabled{
157
167
  @apply opacity-50 top-0 left-0 cursor-not-allowed;
158
- @apply text-primary-500 border-primary-500;
168
+ @apply text-text border-primary-500;
159
169
  }
160
170
  .variant-outline *{
161
171
  @apply text-primary-500 fill-primary-500;
@@ -173,7 +183,7 @@ export default{
173
183
  }
174
184
 
175
185
  .variant-secondary{
176
- @apply bg-secondary text-primary rounded-md border-[2px] border-secondary;
186
+ @apply bg-secondary text-white rounded-md border-[2px] border-secondary;
177
187
  }
178
188
  .variant-secondary:hover{
179
189
  @apply bg-secondary-600 border-secondary-600;
@@ -185,7 +195,7 @@ export default{
185
195
  @apply bg-secondary-500 border-secondary-500 opacity-50 top-0 left-0 cursor-not-allowed;
186
196
  }
187
197
  .variant-secondary *{
188
- @apply text-primary fill-primary;
198
+ @apply text-white fill-white;
189
199
  }
190
200
  .variant-secondary.loading *{
191
201
  @apply fill-transparent
@@ -204,6 +214,9 @@ export default{
204
214
  }
205
215
  .variant-minimal:hover{
206
216
  }
217
+ .variant-minimal:active{
218
+ @apply top-[1px] left-[1px] relative;
219
+ }
207
220
  .variant-minimal .svgBg{
208
221
  stroke: var(--base-500);
209
222
  stroke-opacity: 25%;
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <div :class="$style.comp" v-if="error" @click="$emit('dismissError')">
3
3
  <div v-if="error.response && error.response.data && error.response.data.errors">
4
- <div v-for="(text, key) in error.response.data.errors">
4
+ <div v-if="typeof error.response.data.errors === 'string'">{{ error.response.data.errors }}</div>
5
+ <div v-else v-for="(text, key) in error.response.data.errors">
5
6
  <div v-if="!errorKey || key === errorKey">
6
7
  <div v-for="txt in text">{{ txt }}</div>
7
8
  </div>
@@ -9,7 +10,7 @@
9
10
  </div>
10
11
  <div v-else-if="error.message" class="p-2 bg-base-500">{{ error.message }}</div>
11
12
  <div v-else>
12
- <pre>{{ error }}</pre>
13
+
13
14
  </div>
14
15
  </div>
15
16
  </template>
@@ -18,9 +19,24 @@
18
19
 
19
20
  export default{
20
21
 
21
- props: {
22
- error: Object,
23
- errorKey: String
22
+ data(){
23
+ return {
24
+ error: null,
25
+ errorKey: null
26
+ }
27
+ },
28
+
29
+ methods: {
30
+
31
+ show(err, key){
32
+ this.error = err
33
+ this.errorKey = key
34
+ },
35
+
36
+ hide(){
37
+ this.error = this.errorKey = null
38
+ }
39
+
24
40
  }
25
41
 
26
42
  }
@@ -32,7 +32,7 @@
32
32
  <option value="thisMonth">This Month</option>
33
33
  <option value="monthAgo">1 Month Ago</option>
34
34
  <option value="lastMonth">Last Month</option>
35
- <option value="thisMonth">This Year</option>
35
+ <option value="thisYear">This Year</option>
36
36
  <option value="lastYear">Last Year</option>
37
37
  <option value="between">Between</option>
38
38
  </Dropdown>
@@ -6,8 +6,6 @@
6
6
  :value="typeof modelValue === 'string' ? modelValue.split('')[i - 1] : ''"
7
7
  @paste="verifyPaste" @keyup="verifyKeyUp($event, i - 1)" />
8
8
  </div>
9
- <ErrorText :error="error" :errorKey="errorKey" @dismissError="$emit('dismissError')"
10
- :class="$style.errorText + (errorClass ? ' ' + errorClass : '')"/>
11
9
  </div>
12
10
  </template>
13
11
 
@@ -16,9 +14,6 @@
16
14
  export default{
17
15
 
18
16
  props: {
19
- error: Object,
20
- errorKey: String,
21
- errorClass: String,
22
17
 
23
18
  modelValue: String,
24
19
 
@@ -149,7 +149,8 @@ export default{
149
149
 
150
150
  .textbox{
151
151
  @apply min-h-[var(--h-cp)];
152
- @apply flex items-center border-[1px] border-text-200 bg-base-50 rounded-lg overflow-hidden;
152
+ @apply flex items-center border-[1px] border-text-200 bg-base-50;
153
+ @apply rounded-lg overflow-hidden;
153
154
  }
154
155
 
155
156
  .textbox input:read-only{
@@ -131,10 +131,30 @@ const importRequest = async(req) => {
131
131
  if(index >= rowStart){
132
132
  const obj = {}
133
133
 
134
+ // Check if cells in row 2 and 3 is notes in italic
135
+ if(index <= 3){
136
+ let isItalic = false
137
+ for(let idx in keys){
138
+ const key = keys[idx]
139
+ if(key.value && columnAddress[key.value]){
140
+ const cell = row.getCell(columnAddress[key.value])
141
+ if(cell.font && cell.font.italic){
142
+ isItalic = true
143
+ break
144
+ }
145
+ }
146
+ }
147
+
148
+ if(isItalic)
149
+ return
150
+ }
151
+
134
152
  for(let idx in keys){
135
153
  const key = keys[idx]
136
- const cell = row.getCell(columnAddress[key.value])
137
- obj[key.key] = cell.formulaType === 1 ? cell.result : cell.value
154
+ if(key.value && columnAddress[key.value]){
155
+ const cell = row.getCell(columnAddress[key.value])
156
+ obj[key.key] = cell.formulaType === 1 ? cell.result : cell.value
157
+ }
138
158
  }
139
159
 
140
160
  rows.push(unflatten(obj))
@@ -526,7 +526,7 @@ let ListPage1 = {
526
526
  }
527
527
 
528
528
  let derivedSql
529
- const { rows:items, count } = await this.model.findAndCountAll({
529
+ let { rows:items, count } = await this.model.findAndCountAll({
530
530
  where,
531
531
  attributes: {
532
532
  ...attributes,
@@ -564,6 +564,13 @@ let ListPage1 = {
564
564
  }
565
565
  }*/
566
566
 
567
+ if(this.postLoadItems){
568
+ const postLoadItems = await this.postLoadItems(params, { where, attributes, order, include:includes, replacements })
569
+ if(Array.isArray(postLoadItems)){
570
+ items = postLoadItems.concat(items)
571
+ }
572
+ }
573
+
567
574
  if(this.socket){
568
575
  this.socket.join(this.channel)
569
576
  }