@mixd-id/web-scaffold 0.1.240411061 → 0.1.240411062

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.240411061",
4
+ "version": "0.1.240411062",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -137,10 +137,12 @@
137
137
  :items="dataItems"
138
138
  :enumCache="enumCache"
139
139
  :freeze-left="freezeLeft"
140
+ :item-class="itemClass"
140
141
  @freeze="freeze"
141
142
  @unfreeze="unfreeze"
142
143
  @scroll-end="loadNext"
143
- @item-click="onTableItemClick">
144
+ @item-click="onTableItemClick"
145
+ @dragover="(...args) => $emit('dragover', ...args)">
144
146
 
145
147
  <template v-for="(_, slot) in headerSlots" #[slot]="{ item, index }">
146
148
  <div :class="getHeader(slot.replace('col-', ''))">
@@ -281,7 +283,7 @@ import {groupBy, invokeAfterIdle, queueForLater} from "../utils/helpers.mjs";
281
283
 
282
284
  export default{
283
285
 
284
- emits: [ 'after-load', 'open-preset', 'signal', 'pivot-item-click' ],
286
+ emits: [ 'dragover', 'after-load', 'open-preset', 'signal', 'pivot-item-click' ],
285
287
 
286
288
  inject: [ 'socket', 'toast' ],
287
289
 
@@ -322,6 +324,7 @@ export default{
322
324
  type: String,
323
325
  default: "md:p-5 md:gap-3"
324
326
  },
327
+ itemClass: String,
325
328
  toolbar: {
326
329
  type: [ String, Boolean ],
327
330
  default: true
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+
4
+ <TreeViewItem2 v-for="item in items"
5
+ :item="item"
6
+ :container-class="containerClass">
7
+ <template #default="{ item }">
8
+ <slot :item="item"></slot>
9
+ </template>
10
+ </TreeViewItem2>
11
+
12
+ </div>
13
+ </template>
14
+
15
+ <script setup>
16
+
17
+ import TreeViewItem2 from "./TreeViewItem2.vue";
18
+
19
+
20
+ const { } = defineProps({
21
+
22
+ containerClass: String,
23
+
24
+ items: Array
25
+
26
+ })
27
+
28
+ </script>
29
+
30
+ <style module>
31
+
32
+ .comp {
33
+ @apply flex flex-col gap-1;
34
+ }
35
+
36
+ </style>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+
4
+ <slot name="default" :item="item">
5
+ <div :class="$style.item">
6
+ <label>{{ item.title }}</label>
7
+ </div>
8
+ </slot>
9
+
10
+ <div v-if="(item.items ?? []).length > 0" :class="containerClass ?? $style.subitems">
11
+ <TreeViewItem2 v-for="subItem in item.items"
12
+ :item="subItem"
13
+ :container-class="containerClass">
14
+ <template #default="{ item }">
15
+ <slot :item="item"></slot>
16
+ </template>
17
+ </TreeViewItem2>
18
+ </div>
19
+
20
+ </div>
21
+ </template>
22
+
23
+ <script setup>
24
+
25
+ const { } = defineProps({
26
+
27
+ containerClass: String,
28
+
29
+ item: Object
30
+ })
31
+
32
+ </script>
33
+
34
+ <style module>
35
+
36
+ .comp{
37
+
38
+ }
39
+
40
+ .item{
41
+ @apply bg-text-50 hover:bg-text-100;
42
+ }
43
+
44
+ .subitems {
45
+ @apply ml-4 flex flex-col gap-1 mt-1;
46
+ }
47
+
48
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :class="$style.comp" @click="$refs.file.click()">
3
- <input type="file" :multiple="Boolean(multiple)" ref="file" class="hidden" @change="onUpload"/>
3
+ <input type="file" :multiple="Boolean(multiple)" :accept="accept" ref="file" class="hidden" @change="onUpload"/>
4
4
  <slot name="default"></slot>
5
5
  </div>
6
6
  </template>
@@ -13,7 +13,8 @@ export default{
13
13
 
14
14
  props:{
15
15
 
16
- multiple: undefined
16
+ accept: undefined,
17
+ multiple: undefined,
17
18
 
18
19
  },
19
20
 
@@ -89,6 +89,7 @@
89
89
  <tbody>
90
90
  <tr v-for="(item, index) in visibleItems"
91
91
  :key="item"
92
+ @dragover="(e) => $emit('dragover', e, item)"
92
93
  @mouseover="hover(item, index)" @mouseout="hoverIndex = -1"
93
94
  @click="select(item, index)"
94
95
  :class="trClass(item, index)">
@@ -131,6 +132,7 @@
131
132
  <tbody ref="tbody">
132
133
  <tr v-for="(item, index) in visibleItems"
133
134
  :key="item"
135
+ @dragover="(e) => $emit('dragover', e, item)"
134
136
  @mouseover="hover(item, index)" @mouseout="hoverIndex = -1"
135
137
  @click="select(item, index)"
136
138
  :class="trClass(item, index)">
@@ -207,7 +209,7 @@ export default{
207
209
 
208
210
  inject: [ 'emitRoot', 'listStyle' ],
209
211
 
210
- emits: [ 'freeze', 'unfreeze', 'scroll-end', 'item-click' ],
212
+ emits: [ 'dragover', 'freeze', 'unfreeze', 'scroll-end', 'item-click' ],
211
213
 
212
214
  props:{
213
215
 
package/src/index.js CHANGED
@@ -494,6 +494,8 @@ export default{
494
494
  app.component('Toast', defineAsyncComponent(() => import("./components/Toast.vue")))
495
495
  app.component('TreeView', defineAsyncComponent(() => import("./components/TreeView.vue")))
496
496
  app.component('TreeViewItem', defineAsyncComponent(() => import("./components/TreeViewItem.vue")))
497
+ app.component('TreeView2', defineAsyncComponent(() => import("./components/TreeView2.vue")))
498
+ app.component('TreeViewItem2', defineAsyncComponent(() => import("./components/TreeViewItem2.vue")))
497
499
  app.component('Uploader', defineAsyncComponent(() => import("./components/Uploader.vue")))
498
500
  app.component('VirtualGrid', defineAsyncComponent(() => import("./components/VirtualGrid.vue")))
499
501
  app.component('VirtualScroll', defineAsyncComponent(() => import("./components/VirtualScroll.vue")))