@vc-shell/framework 1.0.167 → 1.0.169
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/CHANGELOG.md +19 -0
- package/dist/framework.js +5281 -5213
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/modules/dynamic/components/fields/Card.ts +16 -10
- package/shared/modules/dynamic/composables/useFilterBuilder/index.ts +0 -1
- package/shared/modules/dynamic/helpers/override.ts +61 -9
- package/ui/components/molecules/vc-select/vc-select.vue +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-select.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-select/vc-select.vue.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;;;;;;;;
|
|
1
|
+
{"version":3,"file":"vc-select.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/molecules/vc-select/vc-select.vue.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;;;;;;;;iBA05CxD,GAAG;;;;;;;;;gCAmDM,MAAM,SAAS,MAAM,QAAQ,MAAM,EAAE;;;;;;;;;;;;;;;;WAiDxD,GAAG;;QAv+CR;;WAEG;yBACc;YAAE,aAAa,EAAE,MAAM,IAAI,CAAA;SAAE,KAAK,GAAG;QACtD;;WAEG;iCACsB,GAAG,KAAK,GAAG;QACpC;;WAEG;gCACqB,GAAG,KA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kB,GAAG,KAAK,GAAG;YAChC;;eAEG;2BACY,GAAG,KAAK,GAAG;YAC1B;;eAEG;0BACW,GAAG,KAAK,GAAG;YACzB;;;eAGG;;gBAED;;mBAEG;uBACI,MAAM;gBACb;;mBAEG;;gBAEH;;mBAEG;0BACO,OAAO;gBACjB;;;mBAGG;uCACoB,MAAM,KAAK,IAAI;kBAClC,GAAG;YACT;;eAEG;;gBAED;;mBAEG;uBACI,MAAM;gBACb;;mBAEG;;gBAEH;;mBAEG;0BACO,OAAO;gBACjB;;;mBAGG;oCACiB,GAAG,KAAK,IAAI;kBAC5B,GAAG;kCACa,GAAG,KAAK,GAAG;;;;;AAnGnC,wBAigD2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.169",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/framework.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"whatwg-fetch": "^3.6.19"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
57
|
-
"@vc-shell/config-generator": "^1.0.
|
|
58
|
-
"@vc-shell/ts-config": "^1.0.
|
|
56
|
+
"@vc-shell/api-client-generator": "^1.0.169",
|
|
57
|
+
"@vc-shell/config-generator": "^1.0.169",
|
|
58
|
+
"@vc-shell/ts-config": "^1.0.169",
|
|
59
59
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
60
60
|
"sass": "^1.69.6",
|
|
61
61
|
"typescript": "^5.3.3",
|
|
@@ -13,7 +13,6 @@ import { CardCollection } from "../factories";
|
|
|
13
13
|
import componentProps from "./props";
|
|
14
14
|
import { CardSchema } from "../../types";
|
|
15
15
|
import { nodeBuilder } from "../../helpers/nodeBuilder";
|
|
16
|
-
import * as _ from "lodash-es";
|
|
17
16
|
import { unrefNested } from "../../helpers/unrefNested";
|
|
18
17
|
|
|
19
18
|
export default {
|
|
@@ -32,24 +31,31 @@ export default {
|
|
|
32
31
|
|
|
33
32
|
const hasNoCommentNodes = (components: (VNodeChild | VNodeNormalizedChildren)[]): boolean => {
|
|
34
33
|
const vnodeIterable = Array.isArray(components) ? components : [components];
|
|
35
|
-
|
|
36
|
-
if (Array.isArray(component) && component.length > 0) {
|
|
37
|
-
return hasNoCommentNodes(component);
|
|
38
|
-
}
|
|
34
|
+
const commentCounter = ref(0);
|
|
39
35
|
|
|
40
|
-
|
|
36
|
+
for (const component of vnodeIterable) {
|
|
37
|
+
if (Array.isArray(component) && component.length > 0) {
|
|
38
|
+
if (!hasNoCommentNodes(component)) {
|
|
39
|
+
commentCounter.value++;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
} else if (component && typeof component === "object" && !Array.isArray(component)) {
|
|
41
43
|
if (Array.isArray(component.children) && component.children.length > 0) {
|
|
42
44
|
// Recursive check for nested components
|
|
43
|
-
|
|
45
|
+
if (!hasNoCommentNodes(component.children)) {
|
|
46
|
+
commentCounter.value++;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
if (component.el && (component.el as HTMLElement).nodeType === 8) {
|
|
47
|
-
|
|
52
|
+
commentCounter.value++;
|
|
53
|
+
break;
|
|
48
54
|
}
|
|
49
55
|
}
|
|
56
|
+
}
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
});
|
|
58
|
+
return commentCounter.value !== vnodeIterable.length;
|
|
53
59
|
};
|
|
54
60
|
|
|
55
61
|
return () => {
|
|
@@ -127,7 +127,6 @@ export default <Query>(args: {
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
// TODO add to documentation support of dynamic data for filter
|
|
131
130
|
function createCheckboxFromData(data: MaybeRef<Record<string, string>[]>, control: FilterCheckbox) {
|
|
132
131
|
if (!(toValue(data) && toValue(data).length)) return;
|
|
133
132
|
return toValue(data).reduce(
|
|
@@ -25,17 +25,45 @@ const upsertHelper = (overrides: OverridesSchema, schemaCopy: { [key: string]: D
|
|
|
25
25
|
overrides.upsert
|
|
26
26
|
?.filter((x) => clonedSchema.settings.id === x.id)
|
|
27
27
|
.forEach((args) => {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
let valueByPath = _.get(clonedSchema, args.path);
|
|
29
|
+
let currentPath: string | (string | number)[] = args.path;
|
|
30
|
+
|
|
31
|
+
// if we can't get value with lodash - try to parse path, cause it could be path with elements id's
|
|
32
|
+
if (!valueByPath) {
|
|
33
|
+
const pathParts = args.path.split(".");
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
+
let current: any = clonedSchema;
|
|
37
|
+
const generatedPath = [];
|
|
38
|
+
for (const part of pathParts) {
|
|
39
|
+
if (Array.isArray(current)) {
|
|
40
|
+
const currentCopy = [...current];
|
|
41
|
+
current = current.find((x) => Object.entries(x).some(([key, value]) => key === part || value === part));
|
|
42
|
+
|
|
43
|
+
const fountElIndex = currentCopy.findIndex((x) => x === current);
|
|
44
|
+
|
|
45
|
+
generatedPath.push(fountElIndex);
|
|
46
|
+
} else {
|
|
47
|
+
current = current[part];
|
|
48
|
+
generatedPath.push(part);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
currentPath = generatedPath;
|
|
53
|
+
|
|
54
|
+
valueByPath = current;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (Array.isArray(valueByPath) && valueByPath.length && typeof args.value === "object") {
|
|
30
58
|
const findIndex = _.findIndex(valueByPath, { id: args.value.id });
|
|
31
59
|
|
|
32
60
|
const spliced = valueByPath /* @ts-expect-error - toSpliced is not parsed correctly by ts */
|
|
33
|
-
.toSpliced(findIndex >= 0 ? findIndex : args.index, findIndex >= 0 ? 1 : 0, args.value);
|
|
34
|
-
_.set(clonedSchema,
|
|
61
|
+
.toSpliced(findIndex >= 0 ? findIndex : args.index ?? 0, findIndex >= 0 ? 1 : 0, args.value);
|
|
62
|
+
_.set(clonedSchema, currentPath, spliced);
|
|
35
63
|
} else {
|
|
36
|
-
_.set(clonedSchema,
|
|
64
|
+
_.set(clonedSchema, currentPath, args.value);
|
|
37
65
|
}
|
|
38
|
-
}
|
|
66
|
+
});
|
|
39
67
|
obj[name] = clonedSchema;
|
|
40
68
|
return obj;
|
|
41
69
|
},
|
|
@@ -60,9 +88,33 @@ const removeHelper = (overrides: OverridesSchema, schemaCopy: Record<string, Dyn
|
|
|
60
88
|
};
|
|
61
89
|
|
|
62
90
|
function removePath(obj: DynamicSchema, path: string) {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
91
|
+
const removeItem = _.get(obj, path);
|
|
92
|
+
|
|
93
|
+
if (removeItem) {
|
|
94
|
+
const parentPath = path.slice(0, path.lastIndexOf("["));
|
|
95
|
+
_.unset(obj, path);
|
|
96
|
+
_.update(obj, parentPath, _.compact);
|
|
97
|
+
} else {
|
|
98
|
+
const pathParts = path.split(".");
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
+
let current: any = obj;
|
|
101
|
+
const generatedPath = [];
|
|
102
|
+
for (const part of pathParts) {
|
|
103
|
+
if (Array.isArray(current)) {
|
|
104
|
+
const currentCopy = [...current];
|
|
105
|
+
current = current.find((x) => Object.entries(x).some(([key, value]) => key === part || value === part));
|
|
106
|
+
|
|
107
|
+
const foundElIndex = currentCopy.findIndex((x) => x === current);
|
|
108
|
+
|
|
109
|
+
generatedPath.push(foundElIndex);
|
|
110
|
+
} else {
|
|
111
|
+
current = current[part];
|
|
112
|
+
generatedPath.push(part);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
_.unset(obj, generatedPath);
|
|
116
|
+
_.update(obj, generatedPath, _.compact);
|
|
117
|
+
}
|
|
66
118
|
}
|
|
67
119
|
|
|
68
120
|
// this part sorts paths with indexes in descending order to avoid deleting items with already changed indexes
|
|
@@ -620,7 +620,8 @@ async function onLoadMore() {
|
|
|
620
620
|
try {
|
|
621
621
|
listLoading.value = true;
|
|
622
622
|
const data = await props.options(filterString.value, optionsList.value.length);
|
|
623
|
-
optionsList.value.
|
|
623
|
+
optionsList.value = _.unionBy<Option>(optionsList.value, data.results as Option[], "id");
|
|
624
|
+
|
|
624
625
|
totalItems.value = data.totalCount;
|
|
625
626
|
optionsTemp.value = optionsList.value;
|
|
626
627
|
} finally {
|
|
@@ -824,7 +825,8 @@ function toggleOption(opt: Option) {
|
|
|
824
825
|
if (innerValue.value.length === 0 || _.isEqual(getOptionValue.value(innerValue.value[0]), optValue) !== true) {
|
|
825
826
|
emit("update:modelValue", props.emitValue === true ? optValue : opt);
|
|
826
827
|
}
|
|
827
|
-
|
|
828
|
+
|
|
829
|
+
closeDropdown();
|
|
828
830
|
return;
|
|
829
831
|
}
|
|
830
832
|
|