@maas/vue-equipment 0.22.3 → 0.22.5
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/dist/nuxt/module.json
CHANGED
|
@@ -20,31 +20,31 @@ export function useCommandStore() {
|
|
|
20
20
|
const itemElements = parent.querySelectorAll("[data-item-id]");
|
|
21
21
|
itemElements.forEach((el, index) => {
|
|
22
22
|
const itemId = el.dataset.itemId;
|
|
23
|
-
const item = instance.items
|
|
23
|
+
const item = instance.items?.find((item2) => item2.id === itemId);
|
|
24
24
|
if (item) {
|
|
25
25
|
item.index = index;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
instance.items
|
|
28
|
+
instance.items?.sort((a, b) => a.index - b.index);
|
|
29
29
|
}
|
|
30
30
|
function addItem(id, item) {
|
|
31
31
|
const instance = findInstance(id);
|
|
32
|
-
instance.items
|
|
32
|
+
instance.items?.push({ index: -1, id: item });
|
|
33
33
|
}
|
|
34
34
|
function removeItem(id, item) {
|
|
35
35
|
const instance = findInstance(id);
|
|
36
36
|
if (instance) {
|
|
37
|
-
instance.items = instance.items
|
|
37
|
+
instance.items = instance.items?.filter((x) => x.id !== item);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
function addView(id, view) {
|
|
41
41
|
const instance = findInstance(id);
|
|
42
|
-
instance.views
|
|
42
|
+
instance.views?.push(view);
|
|
43
43
|
}
|
|
44
44
|
function removeView(id, view) {
|
|
45
45
|
const instance = findInstance(id);
|
|
46
46
|
if (instance) {
|
|
47
|
-
instance.views = instance.views
|
|
47
|
+
instance.views = instance.views?.filter((x) => x !== view);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maas/vue-equipment",
|
|
3
3
|
"description": "A magic collection of Vue composables, plugins, components and directives",
|
|
4
|
-
"version": "0.22.
|
|
4
|
+
"version": "0.22.5",
|
|
5
5
|
"author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@antfu/ni": "^0.21.12",
|