@mixd-id/web-scaffold 0.1.230406233 → 0.1.230406235
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
|
@@ -51,7 +51,7 @@ export default{
|
|
|
51
51
|
|
|
52
52
|
gap: {
|
|
53
53
|
type: [ String ],
|
|
54
|
-
default: 'gap-
|
|
54
|
+
default: 'gap-0'
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
items: Array,
|
|
@@ -232,9 +232,16 @@ export default{
|
|
|
232
232
|
this.resize()
|
|
233
233
|
},
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
items: {
|
|
236
|
+
deep: true,
|
|
237
|
+
handler(to, from){
|
|
238
|
+
if((to ?? []).length !== (from ?? []).length){
|
|
239
|
+
this.scrollTop = 0
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
this.resize()
|
|
243
|
+
}
|
|
244
|
+
},
|
|
238
245
|
|
|
239
246
|
}
|
|
240
247
|
|
|
@@ -210,10 +210,14 @@ export default{
|
|
|
210
210
|
|
|
211
211
|
items: {
|
|
212
212
|
deep: true,
|
|
213
|
-
handler(){
|
|
214
|
-
|
|
213
|
+
handler(to, from){
|
|
214
|
+
if((to ?? []).length !== (from ?? []).length){
|
|
215
|
+
this.scrollTop = 0
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
this.resize()
|
|
215
219
|
}
|
|
216
|
-
}
|
|
220
|
+
},
|
|
217
221
|
|
|
218
222
|
}
|
|
219
223
|
|
|
@@ -241,11 +245,11 @@ export default{
|
|
|
241
245
|
}
|
|
242
246
|
|
|
243
247
|
.item:hover{
|
|
244
|
-
@apply bg-
|
|
248
|
+
@apply bg-text-50;
|
|
245
249
|
}
|
|
246
250
|
|
|
247
251
|
.item.trSelected{
|
|
248
|
-
@apply bg-
|
|
252
|
+
@apply bg-text-100;
|
|
249
253
|
}
|
|
250
254
|
|
|
251
255
|
.highlight{
|
package/src/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import {defineAsyncComponent, ref} from "vue"
|
|
|
2
2
|
import {observeInit} from './utils/helpers.mjs'
|
|
3
3
|
import throttle from "lodash/throttle"
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
|
+
import groupBy from "lodash/groupBy";
|
|
5
6
|
|
|
6
7
|
let _UNIQID = 0
|
|
7
8
|
const uniqid = (additionalKey = '') => {
|
|
@@ -184,13 +185,35 @@ const util = {
|
|
|
184
185
|
window.addEventListener('mouseup', onMouseUp)
|
|
185
186
|
},
|
|
186
187
|
|
|
187
|
-
push: (arr,
|
|
188
|
-
|
|
189
|
-
if(
|
|
190
|
-
|
|
188
|
+
push: (arr, items, opt = { key:"id" }) => {
|
|
189
|
+
if(!Array.isArray(arr)) return
|
|
190
|
+
if(!Array.isArray(items)) items = [ items ]
|
|
191
|
+
|
|
192
|
+
for(let item of items){
|
|
193
|
+
if(!item) continue
|
|
194
|
+
|
|
195
|
+
const index = arr.findIndex((_) => _[opt.key] === item[opt.key])
|
|
196
|
+
if(index >= 0){
|
|
197
|
+
Object.assign(arr[index], item)
|
|
198
|
+
}
|
|
199
|
+
else{
|
|
200
|
+
arr.push(item)
|
|
201
|
+
}
|
|
191
202
|
}
|
|
192
|
-
|
|
193
|
-
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
remove: (arr, sliced, opt = { key:'id' }) => {
|
|
206
|
+
if(!Array.isArray(arr)) return
|
|
207
|
+
if(!Array.isArray(sliced)) sliced = [ sliced ]
|
|
208
|
+
|
|
209
|
+
sliced = groupBy(sliced, opt.key)
|
|
210
|
+
|
|
211
|
+
for(let i = arr.length - 1 ; i >= 0 ; i--){
|
|
212
|
+
if(!arr[i]) continue
|
|
213
|
+
|
|
214
|
+
if(arr[i][opt.key] in sliced){
|
|
215
|
+
arr.splice(i, 1)
|
|
216
|
+
}
|
|
194
217
|
}
|
|
195
218
|
},
|
|
196
219
|
|