@vc-shell/framework 1.0.313 → 1.0.315
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 +25 -0
- package/dist/{azuread-COPuaobe.js → azuread-ro_7UIeB.js} +2 -2
- package/dist/{external-provider-DeK40P95.js → external-provider-DIJSQNDN.js} +1 -1
- package/dist/{external-provider.vue_vue_type_script_setup_true_lang-gI8I1Hee.js → external-provider.vue_vue_type_script_setup_true_lang-CA11mQRb.js} +1 -1
- package/dist/external-providers-CvCHkuwZ.js +4 -0
- package/dist/framework.js +1 -1
- package/dist/{index-U_I2M0E7.js → index-B4vEqgyq.js} +1 -1
- package/dist/{index-Dk1PPRvo.js → index-BEEZ0xdg.js} +1 -1
- package/dist/{index-BtPyk3BC.js → index-BO1wI3tF.js} +1 -1
- package/dist/{index-BEGBwWJ2.js → index-Be5RmfZ4.js} +1 -1
- package/dist/{index-TeXIUBHy.js → index-BieKeX7e.js} +1 -1
- package/dist/{index-Bmwb9klD.js → index-C2i7kY9v.js} +1 -1
- package/dist/{index-rhu7K19V.js → index-CbLjMkjt.js} +1 -1
- package/dist/{index-DoLYS2ol.js → index-CgGITXaa.js} +1 -1
- package/dist/{index-zm8mJa_L.js → index-CnHCPuYe.js} +1 -1
- package/dist/{index-Bft9OqbB.js → index-DKRn9i7P.js} +1 -1
- package/dist/{index-BFv1TC2E.js → index-DaZ7PLVa.js} +1 -1
- package/dist/{index-1EnrD2Y2.js → index-DxAmNnWQ.js} +1 -1
- package/dist/{index-DeSI-xsQ.js → index-KTXdpPqB.js} +1 -1
- package/dist/{index-C_219sz2.js → index-NSvb_rwM.js} +1 -1
- package/dist/{index-BXGnP-5c.js → index-UAIJpfpg.js} +1 -1
- package/dist/{index-BpZkDMnC.js → index-_iCNHJpV.js} +1 -1
- package/dist/{index-CqsWAoFE.js → index-kmtVz5uo.js} +9480 -9454
- package/dist/index.css +1 -1
- package/dist/shared/components/sidebar/sidebar.vue.d.ts +5 -1
- package/dist/shared/components/sidebar/sidebar.vue.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/shared/components/sidebar/sidebar.vue +13 -9
- package/shared/components/user-dropdown-button/user-dropdown-button.vue +37 -0
- package/shared/modules/dynamic/components/SchemaRender.ts +2 -6
- package/shared/modules/dynamic/components/fields/DynamicProperty.ts +6 -7
- package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +34 -7
- package/ui/components/molecules/vc-input/vc-input.vue +1 -1
- package/dist/external-providers-C5TviitJ.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.315",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/framework.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/dompurify": "^3.0.5",
|
|
62
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
63
|
-
"@vc-shell/config-generator": "^1.0.
|
|
64
|
-
"@vc-shell/ts-config": "^1.0.
|
|
62
|
+
"@vc-shell/api-client-generator": "^1.0.315",
|
|
63
|
+
"@vc-shell/config-generator": "^1.0.315",
|
|
64
|
+
"@vc-shell/ts-config": "^1.0.315",
|
|
65
65
|
"@vitejs/plugin-vue": "5.0.3",
|
|
66
66
|
"cypress-signalr-mock": "^1.5.0",
|
|
67
67
|
"sass": "^1.69.6",
|
|
@@ -19,14 +19,11 @@
|
|
|
19
19
|
},
|
|
20
20
|
]"
|
|
21
21
|
>
|
|
22
|
-
<slot
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@click.stop="$emit('close')"
|
|
28
|
-
></VcIcon>
|
|
29
|
-
</div>
|
|
22
|
+
<slot
|
|
23
|
+
name="header"
|
|
24
|
+
:header="header"
|
|
25
|
+
>
|
|
26
|
+
<component :is="header" />
|
|
30
27
|
</slot>
|
|
31
28
|
|
|
32
29
|
<slot name="content"></slot>
|
|
@@ -38,6 +35,9 @@
|
|
|
38
35
|
</template>
|
|
39
36
|
|
|
40
37
|
<script lang="ts" setup>
|
|
38
|
+
import { h } from "vue";
|
|
39
|
+
import { VcIcon } from "../../../ui/components";
|
|
40
|
+
|
|
41
41
|
export interface Props {
|
|
42
42
|
position?: "left" | "right";
|
|
43
43
|
render: "always" | "mobile" | "desktop";
|
|
@@ -48,12 +48,16 @@ export interface Emits {
|
|
|
48
48
|
(event: "close"): void;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
defineEmits<Emits>();
|
|
51
|
+
const emit = defineEmits<Emits>();
|
|
52
52
|
|
|
53
53
|
withDefaults(defineProps<Props>(), {
|
|
54
54
|
position: "right",
|
|
55
55
|
render: "always",
|
|
56
56
|
});
|
|
57
|
+
|
|
58
|
+
const header = h("div", { class: "sidebar__header" }, [
|
|
59
|
+
h(VcIcon, { icon: "fas fa-times", size: "xl", onClick: () => emit("close") }),
|
|
60
|
+
]);
|
|
57
61
|
</script>
|
|
58
62
|
|
|
59
63
|
<style lang="scss">
|
|
@@ -76,6 +76,35 @@
|
|
|
76
76
|
render="mobile"
|
|
77
77
|
@close="toggle"
|
|
78
78
|
>
|
|
79
|
+
<template #header="{ header }">
|
|
80
|
+
<div class="vc-user-dropdown-button__header-wrap">
|
|
81
|
+
<div class="vc-user-dropdown-button__header">
|
|
82
|
+
<div
|
|
83
|
+
v-if="avatarUrl"
|
|
84
|
+
class="vc-user-dropdown-button__avatar"
|
|
85
|
+
:style="imageHandler"
|
|
86
|
+
></div>
|
|
87
|
+
<VcIcon
|
|
88
|
+
v-else
|
|
89
|
+
icon="fas fa-user-circle"
|
|
90
|
+
size="xxl"
|
|
91
|
+
class="vc-user-dropdown-button__icon"
|
|
92
|
+
/>
|
|
93
|
+
<div class="vc-user-dropdown-button__info">
|
|
94
|
+
<div class="vc-user-dropdown-button__name">
|
|
95
|
+
{{ name || user?.userName }}
|
|
96
|
+
</div>
|
|
97
|
+
<div class="vc-user-dropdown-button__role">
|
|
98
|
+
{{
|
|
99
|
+
(role && $t(`SHELL.USER.ROLE.${role}`)) ||
|
|
100
|
+
(user?.isAdministrator ? $t("SHELL.USER.ROLE.ADMINISTRATOR") : "")
|
|
101
|
+
}}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<component :is="header" />
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
79
108
|
<template #content>
|
|
80
109
|
<div
|
|
81
110
|
v-if="menu && opened"
|
|
@@ -228,6 +257,14 @@ const imageHandler = computed(() => {
|
|
|
228
257
|
@apply tw-flex tw-justify-between tw-items-center tw-flex-auto tw-px-4 tw-bg-[--user-dropdown-wrap-bg] tw-gap-3;
|
|
229
258
|
}
|
|
230
259
|
|
|
260
|
+
&__header {
|
|
261
|
+
@apply tw-flex tw-justify-between tw-items-center tw-px-3 tw-py-3 tw-bg-[--user-dropdown-wrap-bg] tw-gap-3;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&__header-wrap {
|
|
265
|
+
@apply tw-flex tw-justify-between tw-items-center;
|
|
266
|
+
}
|
|
267
|
+
|
|
231
268
|
&__avatar {
|
|
232
269
|
@apply tw-rounded-full tw-overflow-hidden tw-w-[34px] tw-h-[34px] tw-bg-[color:var(--user-dropdown-account-info-role-color)]
|
|
233
270
|
tw-bg-cover tw-bg-center tw-shrink-0;
|
|
@@ -54,17 +54,13 @@ export default defineComponent({
|
|
|
54
54
|
watch(
|
|
55
55
|
() => props.modelValue,
|
|
56
56
|
(newVal) => {
|
|
57
|
-
|
|
58
|
-
Object.assign(internalFormData, toRefs(newVal));
|
|
59
|
-
}
|
|
57
|
+
Object.assign(internalFormData, toRefs(newVal));
|
|
60
58
|
},
|
|
61
59
|
{ deep: true, immediate: true },
|
|
62
60
|
);
|
|
63
61
|
|
|
64
62
|
function updateFormData(newVal: ToRefs<unknown>) {
|
|
65
|
-
|
|
66
|
-
ctx.emit("update:modelValue", unrefNested(newVal));
|
|
67
|
-
}
|
|
63
|
+
ctx.emit("update:modelValue", unrefNested(newVal));
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
return () =>
|
|
@@ -125,13 +125,12 @@ export default {
|
|
|
125
125
|
|
|
126
126
|
return () => {
|
|
127
127
|
return properties && properties.length
|
|
128
|
-
? properties
|
|
129
|
-
h(
|
|
130
|
-
field.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
),
|
|
128
|
+
? properties.map((field) =>
|
|
129
|
+
h(field.component as Component, {
|
|
130
|
+
...unrefNested(field.props),
|
|
131
|
+
class: unrefNested(props.baseProps).classNames ?? "",
|
|
132
|
+
key: field.props.key,
|
|
133
|
+
}),
|
|
135
134
|
)
|
|
136
135
|
: null;
|
|
137
136
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef, MaybeRef, computed, ref, watch } from "vue";
|
|
1
|
+
import { ComputedRef, MaybeRef, computed, ref, watch, toRaw } from "vue";
|
|
2
2
|
import * as _ from "lodash-es";
|
|
3
3
|
import { useForm, useIsFormValid } from "vee-validate";
|
|
4
4
|
import { useAsync, useLoading } from "../../../../../core/composables";
|
|
@@ -74,14 +74,41 @@ export const useDetailsFactory = <Item extends { id?: string }>(factoryParams: U
|
|
|
74
74
|
}),
|
|
75
75
|
);
|
|
76
76
|
|
|
77
|
+
function normalizeData(data: unknown): unknown {
|
|
78
|
+
if (
|
|
79
|
+
data === null ||
|
|
80
|
+
data === undefined ||
|
|
81
|
+
data === "" ||
|
|
82
|
+
(Array.isArray(data) && data.length === 0) ||
|
|
83
|
+
(typeof data === "object" && data !== null && Object.keys(data).length === 0)
|
|
84
|
+
) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (Array.isArray(data)) {
|
|
89
|
+
return data.map((item) => normalizeData(item));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (typeof data === "object") {
|
|
93
|
+
const normalizedObj: Record<string, unknown> = {};
|
|
94
|
+
for (const key in data) {
|
|
95
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
96
|
+
normalizedObj[key] = normalizeData(data[key as keyof typeof data]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return normalizedObj;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return data;
|
|
103
|
+
}
|
|
104
|
+
|
|
77
105
|
watch(
|
|
78
|
-
[() => item, () => itemTemp],
|
|
106
|
+
[() => item.value, () => itemTemp.value],
|
|
79
107
|
([state, stateCopy]) => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
108
|
+
const normalizedState = normalizeData(state);
|
|
109
|
+
const normalizedStateCopy = normalizeData(stateCopy);
|
|
110
|
+
|
|
111
|
+
isModified.value = !_.isEqual(normalizedState, normalizedStateCopy);
|
|
85
112
|
},
|
|
86
113
|
{ deep: true },
|
|
87
114
|
);
|
|
@@ -490,7 +490,7 @@ function onKeyDown(e: KeyboardEvent) {
|
|
|
490
490
|
const keypressed = e.key;
|
|
491
491
|
|
|
492
492
|
if (props.type === "number" || props.type === "integer") {
|
|
493
|
-
if (keypressed === "-" || keypressed === "e") {
|
|
493
|
+
if (keypressed === "-" || keypressed === "e" || keypressed === "+") {
|
|
494
494
|
e.preventDefault();
|
|
495
495
|
}
|
|
496
496
|
}
|