@mixd-id/web-scaffold 0.1.230406326 → 0.1.230406327
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/List.vue
CHANGED
|
@@ -551,9 +551,8 @@ export default{
|
|
|
551
551
|
},
|
|
552
552
|
|
|
553
553
|
onSignal(event, items){
|
|
554
|
-
if(this.pivotEnabled)
|
|
555
|
-
|
|
556
|
-
}
|
|
554
|
+
if(this.pivotEnabled) return
|
|
555
|
+
if(!Array.isArray(items) || items.length < 1) return
|
|
557
556
|
|
|
558
557
|
switch(event){
|
|
559
558
|
|
|
@@ -562,14 +561,15 @@ export default{
|
|
|
562
561
|
break
|
|
563
562
|
|
|
564
563
|
default:
|
|
564
|
+
const key = items[0] && items[0].uid ? 'uid' : 'id'
|
|
565
|
+
|
|
565
566
|
this.socket.send(this.src, {
|
|
566
567
|
...this.preset,
|
|
567
|
-
|
|
568
|
+
[key]: items.map(item => item[key])
|
|
568
569
|
})
|
|
569
570
|
.then(({ items:nextItems }) => {
|
|
570
571
|
nextItems.forEach(item => this.$util.unshift(this.data.items, item, { highlight: true }))
|
|
571
572
|
|
|
572
|
-
const key = nextItems[0] && nextItems[0].uid ? 'uid' : 'id'
|
|
573
573
|
const destroyedItems = items.filter(_ => !nextItems.find(i => i[key] === _[key]))
|
|
574
574
|
this.$util.remove(this.data.items, destroyedItems)
|
|
575
575
|
})
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
4
|
<div class="flex flex-row items-start">
|
|
5
|
-
<p contenteditable="true" spellcheck="false" class="flex-1 whitespace-pre-line"
|
|
5
|
+
<p contenteditable="true" spellcheck="false" class="flex-1 whitespace-pre-line"
|
|
6
|
+
ref="html"
|
|
7
|
+
v-html="html"
|
|
8
|
+
:class="itemClass"
|
|
9
|
+
@input="onInput"></p>
|
|
6
10
|
|
|
7
11
|
<button v-if="variant === 'minimal'" type="button" class="p-3" @click="$refs.modal.open()">
|
|
8
12
|
<svg width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg>
|
|
@@ -13,7 +17,7 @@
|
|
|
13
17
|
<div class="flex-1 flex flex-row gap-2 overflow-x-auto p-1" :class="$style.noScrollbar">
|
|
14
18
|
<button type="button" v-for="item in viewedItems" :class="$style.tag2" class="text-xs" @click="add(item)">{{ item.text ?? item.value }}</button>
|
|
15
19
|
</div>
|
|
16
|
-
<div class="p-1 flex items-center justify-center">
|
|
20
|
+
<div class="p-1 flex items-center justify-center" v-if="viewedItems.length > 4">
|
|
17
21
|
<button type="button" class="p-1" @click="$refs.modal.open()">
|
|
18
22
|
<svg width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg>
|
|
19
23
|
</button>
|
|
@@ -63,12 +67,16 @@ export default{
|
|
|
63
67
|
|
|
64
68
|
props:{
|
|
65
69
|
|
|
70
|
+
addFn: Function,
|
|
71
|
+
|
|
66
72
|
modelValue: String,
|
|
67
73
|
|
|
68
74
|
items: Array,
|
|
69
75
|
|
|
70
76
|
variant: String,
|
|
71
77
|
|
|
78
|
+
itemClass: String,
|
|
79
|
+
|
|
72
80
|
},
|
|
73
81
|
|
|
74
82
|
computed:{
|
|
@@ -118,6 +126,10 @@ export default{
|
|
|
118
126
|
add(item){
|
|
119
127
|
this.$refs.modal.close()
|
|
120
128
|
|
|
129
|
+
if(typeof this.addFn === 'function'){
|
|
130
|
+
item = this.addFn(item)
|
|
131
|
+
}
|
|
132
|
+
|
|
121
133
|
const el = document.createElement('span')
|
|
122
134
|
el.setAttribute('contenteditable', 'false')
|
|
123
135
|
el.setAttribute('class', this.$style.tag)
|
|
@@ -167,8 +179,10 @@ export default{
|
|
|
167
179
|
}
|
|
168
180
|
|
|
169
181
|
let html = val ?? ''
|
|
170
|
-
|
|
171
|
-
|
|
182
|
+
if(Array.isArray(this.items)){
|
|
183
|
+
for(let item of this.items){
|
|
184
|
+
html = html.replaceAll(item.value, `<span class="${this.$style.tag}" contenteditable="false" @click="remove" data-value="${item.value}">${item.text ?? item.value}</span>`, 'gi')
|
|
185
|
+
}
|
|
172
186
|
}
|
|
173
187
|
|
|
174
188
|
this.html = html
|
|
@@ -1277,7 +1277,7 @@ const presetToSequelizeList = async(preset, {
|
|
|
1277
1277
|
]
|
|
1278
1278
|
}
|
|
1279
1279
|
|
|
1280
|
-
const { itemsPerPage = 20, filters = [], sorts, pivot, afterItem, search, id } = preset;
|
|
1280
|
+
const { itemsPerPage = 20, filters = [], sorts, pivot, afterItem, search, id, uid } = preset;
|
|
1281
1281
|
|
|
1282
1282
|
let where = {}
|
|
1283
1283
|
const replacements = []
|
|
@@ -1294,6 +1294,15 @@ const presetToSequelizeList = async(preset, {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
1297
|
+
if(Array.isArray(uid)){
|
|
1298
|
+
where = {
|
|
1299
|
+
...where,
|
|
1300
|
+
uid: {
|
|
1301
|
+
[Op.in]: uid
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1297
1306
|
const { where:filterWhere, replacements:filterReplacements } = await filtersToSequelizeWhere(filters, {
|
|
1298
1307
|
config,
|
|
1299
1308
|
model
|