@mixd-id/web-scaffold 0.1.230406012 → 0.1.230406014

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.230406012",
4
+ "version": "0.1.230406014",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -60,8 +60,8 @@
60
60
  </div>
61
61
  </div>
62
62
 
63
- <div class="flex-1 relative flex" v-if="!hideDetails">
64
- <VirtualTable v-if="!hideDetails" ref="table1" :class="$style.vtable" :columns="presetColumns" :items="items"
63
+ <div :class="$style.contentArea" v-if="!hideDetails">
64
+ <VirtualTable v-if="!hideDetails" ref="table1" :columns="presetColumns" :items="items"
65
65
  :appearances="presetAppearances" @scroll-end="loadNext" :pinned="pinned">
66
66
  <template v-for="column in presetColumns" #[colOf(column.key)]="{}">
67
67
  <div :class="getHeader(column)" @click="openColumnOptions(column.key, $event.target.closest('.' + $style.header))">
@@ -101,9 +101,10 @@
101
101
  <slot name="mobileItem" :item="item"></slot>
102
102
  </template>
103
103
  </VirtualScroll>
104
- <div v-if="isLoading" :class="$style.overlay">
105
- <svg class="animate-spin aspect-square w-[48px] h-[48px] text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
106
- </div>
104
+ </div>
105
+
106
+ <div v-if="isLoading" :class="$style.overlay">
107
+ <svg class="animate-spin aspect-square w-[48px] h-[48px] text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
107
108
  </div>
108
109
 
109
110
  <ContextMenu ref="columnMenu" :dismiss="false">
@@ -1345,6 +1346,13 @@ export default{
1345
1346
  @apply flex flex-row gap-3 items-center;
1346
1347
  }
1347
1348
 
1349
+ .contentArea{
1350
+ @apply flex-1 relative flex;
1351
+ }
1352
+ .contentArea>*:last-child{
1353
+ @apply hidden
1354
+ }
1355
+
1348
1356
  .overlay{
1349
1357
  @apply absolute top-0 right-0 bottom-0 left-0 flex items-center justify-center;
1350
1358
  background-color: rgba(var(--base-500), .7);
@@ -1368,18 +1376,18 @@ export default{
1368
1376
  @apply px-6 py-4;
1369
1377
  }
1370
1378
 
1371
- .vtable{
1372
- @apply hidden;
1379
+ .contentArea>*:first-child{
1380
+ @apply hidden
1381
+ }
1382
+ .contentArea>*:last-child{
1383
+ @apply flex
1373
1384
  }
1374
1385
 
1375
1386
  .vscroll{
1376
1387
  @apply flex-1 flex border-t-[1px] border-b-[1px] border-text-50;
1377
1388
  }
1378
- .vscroll>*{
1379
- @apply divide-y divide-text-50;
1380
- }
1381
1389
  .vscroll>*>*{
1382
- @apply bg-base-500;
1390
+ @apply bg-base-500 divide-y divide-text-50;
1383
1391
  }
1384
1392
 
1385
1393
  .optArea{
@@ -321,7 +321,7 @@ export default{
321
321
  formatColumn(item, column){
322
322
 
323
323
  let value
324
- if(column.key.indexOf('.') > -1){
324
+ if((column.key ?? '').toString().indexOf('.') > -1){
325
325
  const columnKeys = column.key.split('.')
326
326
  const columnAs = columnKeys[0]
327
327
  const columnKey = columnKeys[1]
@@ -448,6 +448,10 @@ export default{
448
448
  width: 100%;
449
449
  }
450
450
 
451
+ .table tr{
452
+ vertical-align: top;
453
+ }
454
+
451
455
  .table th{
452
456
  @apply relative text-left;
453
457
  }
@@ -1,6 +1,7 @@
1
1
  const md5 = require("md5");
2
2
  const fs = require("fs");
3
3
  const { Op } = module.parent.require('sequelize')
4
+ const axios = module.parent.require('axios')
4
5
 
5
6
 
6
7
  const ceil = (num, precision = 0) => {
@@ -96,7 +97,7 @@ const saveBuffer = async(buffer, dir = '/storage/files/images') => {
96
97
 
97
98
  const type = await fileTypeFromBuffer(buffer)
98
99
 
99
- const storagePath = process.env.ROOT_PATH + (dir)
100
+ const storagePath = process.env.ROOT_PATH + dir
100
101
  const ext = type && type.ext ? '.' + type.ext : ''
101
102
  const filename = md5(buffer) + ext
102
103
  const to = storagePath + '/' + filename
@@ -477,6 +477,13 @@ let ListPage1 = {
477
477
  }
478
478
  }
479
479
 
480
+ if(typeof this['loadFilters'] === 'function'){
481
+ where = {
482
+ ...where,
483
+ ...(await this['loadFilters']() ?? {})
484
+ }
485
+ }
486
+
480
487
  if(preset.sorts){
481
488
  const { order:presetOrder } = this.getPresetSortParams(preset, includes)
482
489
  if(presetOrder){