@vc-shell/framework 1.1.24 → 1.1.26

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/core/composables/useAppInsights/index.ts +2 -2
  3. package/core/composables/useErrorHandler/index.ts +3 -2
  4. package/core/composables/useGlobalSearch/useGlobalSearch.md +263 -0
  5. package/core/composables/usePermissions/index.ts +2 -2
  6. package/core/composables/useTheme/index.ts +74 -26
  7. package/core/composables/useUser/index.ts +29 -8
  8. package/core/composables/useUserManagement/index.ts +45 -0
  9. package/core/interceptors/index.ts +2 -2
  10. package/core/plugins/signalR/index.ts +2 -2
  11. package/core/services/global-search-service/global-search-service.md +203 -0
  12. package/core/services/widget-service.ts +35 -12
  13. package/dist/core/composables/useErrorHandler/index.d.ts.map +1 -1
  14. package/dist/core/composables/useTheme/index.d.ts +14 -5
  15. package/dist/core/composables/useTheme/index.d.ts.map +1 -1
  16. package/dist/core/composables/useUser/index.d.ts +11 -3
  17. package/dist/core/composables/useUser/index.d.ts.map +1 -1
  18. package/dist/core/composables/useUserManagement/index.d.ts +23 -0
  19. package/dist/core/composables/useUserManagement/index.d.ts.map +1 -0
  20. package/dist/core/services/widget-service.d.ts +9 -7
  21. package/dist/core/services/widget-service.d.ts.map +1 -1
  22. package/dist/framework.js +94 -93
  23. package/dist/{index-DvenBxy6.js → index-20xYwcGS.js} +22032 -21961
  24. package/dist/{index-Br7ZwtRW.js → index-3B7GY2EI.js} +1 -1
  25. package/dist/{index-DAnceKLv.js → index-BGUwsXYM.js} +1 -1
  26. package/dist/{index-eOG-NNYN.js → index-BGghog2f.js} +1 -1
  27. package/dist/{index-Cxkjjuah.js → index-BQNK41p5.js} +1 -1
  28. package/dist/{index-CIzLBvgg.js → index-BeIJlP3x.js} +1 -1
  29. package/dist/{index-BnqqEJTE.js → index-BobFEOd-.js} +1 -1
  30. package/dist/{index-BYcoxn-f.js → index-CYbdhec2.js} +1 -1
  31. package/dist/{index-BbuBDu8A.js → index-DQczMBoO.js} +1 -1
  32. package/dist/{index-cuex9jil.js → index-DSNT0XVw.js} +1 -1
  33. package/dist/{index-DoArZBIw.js → index-DXHjWa3b.js} +1 -1
  34. package/dist/{index-Dk1K3-27.js → index-Dcf_1-Il.js} +1 -1
  35. package/dist/{index-CGL9e-cM.js → index-DszRvG1r.js} +1 -1
  36. package/dist/{index-CLAYu8Qj.js → index-DyPpTQJI.js} +1 -1
  37. package/dist/{index-Cmbxdwnl.js → index-Nr1LNRXa.js} +1 -1
  38. package/dist/{index-CRwMOCjN.js → index-RMOqRXFr.js} +1 -1
  39. package/dist/{index-BLmjssqE.js → index-Tsyx9GI7.js} +1 -1
  40. package/dist/index.css +1 -1
  41. package/dist/locales/de.json +6 -0
  42. package/dist/locales/en.json +6 -0
  43. package/dist/shared/components/change-password/change-password.vue.d.ts.map +1 -1
  44. package/dist/shared/components/notifications/components/notification-container/index.d.ts +1 -1
  45. package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
  46. package/dist/shared/components/settings-menu/settings-menu.vue.d.ts.map +1 -1
  47. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts +6 -11
  48. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
  49. package/dist/shared/components/sidebar/sidebar.vue.d.ts +3 -11
  50. package/dist/shared/components/sidebar/sidebar.vue.d.ts.map +1 -1
  51. package/dist/shared/components/theme-selector/theme-selector.vue.d.ts.map +1 -1
  52. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
  53. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
  54. package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -1
  55. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
  56. package/dist/tsconfig.tsbuildinfo +1 -1
  57. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  58. package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts.map +1 -1
  59. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  60. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
  61. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
  62. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +1 -1
  63. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  64. package/package.json +4 -4
  65. package/shared/components/change-password/change-password.vue +2 -3
  66. package/shared/components/logout-button/logout-button.vue +2 -2
  67. package/shared/components/settings-menu/settings-menu.vue +1 -4
  68. package/shared/components/settings-menu-item/settings-menu-item.vue +9 -1
  69. package/shared/components/sidebar/sidebar.vue +6 -1
  70. package/shared/components/theme-selector/theme-selector.vue +11 -11
  71. package/shared/components/user-dropdown-button/_internal/user-info.vue +2 -2
  72. package/shared/modules/dynamic/pages/dynamic-blade-form.vue +1 -0
  73. package/shared/pages/InvitePage/components/invite/Invite.vue +217 -216
  74. package/shared/pages/LoginPage/components/login/Login.vue +3 -2
  75. package/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue +3 -2
  76. package/ui/components/atoms/vc-icon/vc-icon.vue +5 -10
  77. package/ui/components/atoms/vc-widget/vc-widget.vue +13 -6
  78. package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.stories.ts +0 -2
  79. package/ui/components/organisms/vc-app/vc-app.vue +4 -3
  80. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +2 -1
  81. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +2 -0
  82. package/ui/components/organisms/vc-popup/vc-popup.stories.ts +398 -0
  83. package/ui/components/organisms/vc-popup/vc-popup.vue +1 -1
@@ -1,216 +1,217 @@
1
- <template>
2
- <div class="vc-invite-page">
3
- <VcLoading
4
- v-if="loading"
5
- active
6
- ></VcLoading>
7
-
8
- <VcLoginForm
9
- :logo="customization.logo"
10
- :background="background"
11
- :title="t('INVITATION.TITLE')"
12
- >
13
- <VcForm>
14
- <VcInput
15
- class="vc-invite-page__input"
16
- :label="t('INVITATION.FIELDS.EMAIL.LABEL')"
17
- :model-value="userName"
18
- name="username"
19
- disabled
20
- ></VcInput>
21
-
22
- <Field
23
- v-slot="{ field, errorMessage, handleChange, errors }"
24
- :label="t('INVITATION.FIELDS.PASSWORD.LABEL')"
25
- :model-value="form.password"
26
- rules="required"
27
- name="password"
28
- >
29
- <VcInput
30
- v-bind="field"
31
- ref="passwordField"
32
- v-model="form.password"
33
- class="vc-invite-page__input"
34
- :label="t('INVITATION.FIELDS.PASSWORD.LABEL')"
35
- :placeholder="t('INVITATION.FIELDS.PASSWORD.PLACEHOLDER')"
36
- type="password"
37
- :disabled="!form.tokenIsValid"
38
- :error="!!errors.length"
39
- :error-message="errorMessage"
40
- required
41
- @update:model-value="
42
- (e) => {
43
- handleChange(e);
44
- validate();
45
- }
46
- "
47
- ></VcInput>
48
- </Field>
49
-
50
- <Field
51
- v-slot="{ field, errorMessage, handleChange, errors }"
52
- :label="t('INVITATION.FIELDS.CONFIRM_PASSWORD.LABEL')"
53
- :model-value="form.confirmPassword"
54
- rules="required"
55
- name="confirm_password"
56
- >
57
- <VcInput
58
- v-bind="field"
59
- ref="confirmPasswordField"
60
- v-model="form.confirmPassword"
61
- class="vc-invite-page__input--small"
62
- :label="t('INVITATION.FIELDS.CONFIRM_PASSWORD.LABEL')"
63
- :placeholder="t('INVITATION.FIELDS.CONFIRM_PASSWORD.PLACEHOLDER')"
64
- :disabled="!form.tokenIsValid"
65
- type="password"
66
- :error="!!errors.length"
67
- :error-message="errorMessage"
68
- required
69
- @update:model-value="
70
- (e) => {
71
- handleChange(e);
72
- validate();
73
- }
74
- "
75
- @keyup.enter="acceptInvitation"
76
- ></VcInput>
77
- </Field>
78
-
79
- <div class="vc-invite-page__button-container">
80
- <span
81
- v-if="$isDesktop.value"
82
- class="vc-invite-page__spacer"
83
- ></span>
84
- <vc-button
85
- :disabled="loading || !form.isValid || !form.tokenIsValid"
86
- @click="acceptInvitation"
87
- >
88
- {{ t("INVITATION.ACCEPT_INVITATION") }}
89
- </vc-button>
90
- </div>
91
-
92
- <VcHint
93
- v-for="error in form.errors"
94
- :key="error"
95
- class="vc-invite-page__hint"
96
- style="color: #f14e4e"
97
- >
98
- <!-- TODO: stylizing-->
99
- {{ t(`INVITATION.ERRORS.${error}`) }}
100
- </VcHint>
101
- </VcForm>
102
- </VcLoginForm>
103
- </div>
104
- </template>
105
-
106
- <script lang="ts" setup>
107
- import { reactive, onMounted, computed } from "vue";
108
- import { useRouter } from "vue-router";
109
- import { useIsFormValid, Field, useIsFormDirty, useForm } from "vee-validate";
110
- import { useUser, useSettings } from "./../../../../../core/composables";
111
- import { useI18n } from "vue-i18n";
112
-
113
- useForm({ validateOnMount: false });
114
-
115
- const props = withDefaults(
116
- defineProps<{
117
- userId: string;
118
- userName: string;
119
- token: string;
120
- logo: string;
121
- background: string;
122
- }>(),
123
- {
124
- background: "/assets/background.jpg",
125
- logo: "/assets/logo-white.svg",
126
- },
127
- );
128
-
129
- const { validateToken, validatePassword, resetPasswordByToken, signIn, loading } = useUser();
130
- const router = useRouter();
131
- const { t } = useI18n({ useScope: "global" });
132
- const isFormValid = useIsFormValid();
133
- const isDirty = useIsFormDirty();
134
- const { uiSettings, loading: customizationLoading } = useSettings();
135
- const form = reactive<{
136
- isValid: boolean;
137
- tokenIsValid: boolean;
138
- errors: string[];
139
- password: string;
140
- confirmPassword: string;
141
- }>({
142
- isValid: false,
143
- tokenIsValid: false,
144
- errors: [],
145
- password: "",
146
- confirmPassword: "",
147
- });
148
-
149
- const isDisabled = computed(() => {
150
- return !isDirty.value || !isFormValid.value;
151
- });
152
-
153
- onMounted(async () => {
154
- form.tokenIsValid = await validateToken(props.userId, props.token);
155
- if (!form.tokenIsValid) {
156
- form.errors.push("Invalid-token");
157
- }
158
- });
159
-
160
- const validate = async () => {
161
- if (form.tokenIsValid) {
162
- const errors = (await validatePassword(form.password)).errors;
163
- form.errors = errors?.map((x) => x.code) as string[];
164
- if (form.confirmPassword && form.confirmPassword !== form.password) {
165
- form.errors.push("Repeat-password");
166
- }
167
- form.isValid = form.errors.length == 0 && !isDisabled.value;
168
- }
169
- };
170
-
171
- const acceptInvitation = async () => {
172
- const result = await resetPasswordByToken(props.userId, form.password, props.token);
173
- if (result.succeeded) {
174
- const result = await signIn(props.userName, form.password);
175
- if (result.succeeded) {
176
- router.push("/");
177
- } else {
178
- // form.errors = [result.errorCode as string];
179
- }
180
- } else {
181
- form.errors = result.errors as string[];
182
- }
183
- };
184
-
185
- const customization = computed(() => {
186
- return {
187
- logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : "",
188
- };
189
- });
190
- </script>
191
-
192
- <style lang="scss">
193
- .vc-invite-page {
194
- @apply tw-w-full tw-h-full tw-box-border tw-flex tw-flex-col tw-items-center tw-m-0;
195
- }
196
-
197
- .vc-invite-page__input {
198
- @apply tw-mb-4 tw-mt-1;
199
- }
200
-
201
- .vc-invite-page__input--small {
202
- @apply tw-mb-4;
203
- }
204
-
205
- .vc-invite-page__button-container {
206
- @apply tw-flex tw-justify-center tw-items-center tw-pt-2;
207
- }
208
-
209
- .vc-invite-page__spacer {
210
- @apply tw-grow tw-basis-0;
211
- }
212
-
213
- .vc-invite-page__hint {
214
- @apply tw-mt-3;
215
- }
216
- </style>
1
+ <template>
2
+ <div class="vc-invite-page">
3
+ <VcLoading
4
+ v-if="loading"
5
+ active
6
+ ></VcLoading>
7
+
8
+ <VcLoginForm
9
+ :logo="customization.logo"
10
+ :background="background"
11
+ :title="t('INVITATION.TITLE')"
12
+ >
13
+ <VcForm>
14
+ <VcInput
15
+ class="vc-invite-page__input"
16
+ :label="t('INVITATION.FIELDS.EMAIL.LABEL')"
17
+ :model-value="userName"
18
+ name="username"
19
+ disabled
20
+ ></VcInput>
21
+
22
+ <Field
23
+ v-slot="{ field, errorMessage, handleChange, errors }"
24
+ :label="t('INVITATION.FIELDS.PASSWORD.LABEL')"
25
+ :model-value="form.password"
26
+ rules="required"
27
+ name="password"
28
+ >
29
+ <VcInput
30
+ v-bind="field"
31
+ ref="passwordField"
32
+ v-model="form.password"
33
+ class="vc-invite-page__input"
34
+ :label="t('INVITATION.FIELDS.PASSWORD.LABEL')"
35
+ :placeholder="t('INVITATION.FIELDS.PASSWORD.PLACEHOLDER')"
36
+ type="password"
37
+ :disabled="!form.tokenIsValid"
38
+ :error="!!errors.length"
39
+ :error-message="errorMessage"
40
+ required
41
+ @update:model-value="
42
+ (e) => {
43
+ handleChange(e);
44
+ validate();
45
+ }
46
+ "
47
+ ></VcInput>
48
+ </Field>
49
+
50
+ <Field
51
+ v-slot="{ field, errorMessage, handleChange, errors }"
52
+ :label="t('INVITATION.FIELDS.CONFIRM_PASSWORD.LABEL')"
53
+ :model-value="form.confirmPassword"
54
+ rules="required"
55
+ name="confirm_password"
56
+ >
57
+ <VcInput
58
+ v-bind="field"
59
+ ref="confirmPasswordField"
60
+ v-model="form.confirmPassword"
61
+ class="vc-invite-page__input--small"
62
+ :label="t('INVITATION.FIELDS.CONFIRM_PASSWORD.LABEL')"
63
+ :placeholder="t('INVITATION.FIELDS.CONFIRM_PASSWORD.PLACEHOLDER')"
64
+ :disabled="!form.tokenIsValid"
65
+ type="password"
66
+ :error="!!errors.length"
67
+ :error-message="errorMessage"
68
+ required
69
+ @update:model-value="
70
+ (e) => {
71
+ handleChange(e);
72
+ validate();
73
+ }
74
+ "
75
+ @keyup.enter="acceptInvitation"
76
+ ></VcInput>
77
+ </Field>
78
+
79
+ <div class="vc-invite-page__button-container">
80
+ <span
81
+ v-if="$isDesktop.value"
82
+ class="vc-invite-page__spacer"
83
+ ></span>
84
+ <vc-button
85
+ :disabled="loading || !form.isValid || !form.tokenIsValid"
86
+ @click="acceptInvitation"
87
+ >
88
+ {{ t("INVITATION.ACCEPT_INVITATION") }}
89
+ </vc-button>
90
+ </div>
91
+
92
+ <VcHint
93
+ v-for="error in form.errors"
94
+ :key="error"
95
+ class="vc-invite-page__hint"
96
+ style="color: #f14e4e"
97
+ >
98
+ <!-- TODO: stylizing-->
99
+ {{ t(`INVITATION.ERRORS.${error}`) }}
100
+ </VcHint>
101
+ </VcForm>
102
+ </VcLoginForm>
103
+ </div>
104
+ </template>
105
+
106
+ <script lang="ts" setup>
107
+ import { reactive, onMounted, computed } from "vue";
108
+ import { useRouter } from "vue-router";
109
+ import { useIsFormValid, Field, useIsFormDirty, useForm } from "vee-validate";
110
+ import { useSettings } from "./../../../../../core/composables";
111
+ import { useI18n } from "vue-i18n";
112
+ import { useUserManagement } from "./../../../../../core/composables/useUserManagement";
113
+
114
+ useForm({ validateOnMount: false });
115
+
116
+ const props = withDefaults(
117
+ defineProps<{
118
+ userId: string;
119
+ userName: string;
120
+ token: string;
121
+ logo: string;
122
+ background: string;
123
+ }>(),
124
+ {
125
+ background: "/assets/background.jpg",
126
+ logo: "/assets/logo-white.svg",
127
+ },
128
+ );
129
+
130
+ const { validateToken, validatePassword, resetPasswordByToken, signIn, loading } = useUserManagement();
131
+ const router = useRouter();
132
+ const { t } = useI18n({ useScope: "global" });
133
+ const isFormValid = useIsFormValid();
134
+ const isDirty = useIsFormDirty();
135
+ const { uiSettings, loading: customizationLoading } = useSettings();
136
+ const form = reactive<{
137
+ isValid: boolean;
138
+ tokenIsValid: boolean;
139
+ errors: string[];
140
+ password: string;
141
+ confirmPassword: string;
142
+ }>({
143
+ isValid: false,
144
+ tokenIsValid: false,
145
+ errors: [],
146
+ password: "",
147
+ confirmPassword: "",
148
+ });
149
+
150
+ const isDisabled = computed(() => {
151
+ return !isDirty.value || !isFormValid.value;
152
+ });
153
+
154
+ onMounted(async () => {
155
+ form.tokenIsValid = await validateToken(props.userId, props.token);
156
+ if (!form.tokenIsValid) {
157
+ form.errors.push("Invalid-token");
158
+ }
159
+ });
160
+
161
+ const validate = async () => {
162
+ if (form.tokenIsValid) {
163
+ const errors = (await validatePassword(form.password)).errors;
164
+ form.errors = errors?.map((x) => x.code) as string[];
165
+ if (form.confirmPassword && form.confirmPassword !== form.password) {
166
+ form.errors.push("Repeat-password");
167
+ }
168
+ form.isValid = form.errors.length == 0 && !isDisabled.value;
169
+ }
170
+ };
171
+
172
+ const acceptInvitation = async () => {
173
+ const result = await resetPasswordByToken(props.userId, form.password, props.token);
174
+ if (result.succeeded) {
175
+ const result = await signIn(props.userName, form.password);
176
+ if (result.succeeded) {
177
+ router.push("/");
178
+ } else {
179
+ // form.errors = [result.errorCode as string];
180
+ }
181
+ } else {
182
+ form.errors = result.errors as string[];
183
+ }
184
+ };
185
+
186
+ const customization = computed(() => {
187
+ return {
188
+ logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : "",
189
+ };
190
+ });
191
+ </script>
192
+
193
+ <style lang="scss">
194
+ .vc-invite-page {
195
+ @apply tw-w-full tw-h-full tw-box-border tw-flex tw-flex-col tw-items-center tw-m-0;
196
+ }
197
+
198
+ .vc-invite-page__input {
199
+ @apply tw-mb-4 tw-mt-1;
200
+ }
201
+
202
+ .vc-invite-page__input--small {
203
+ @apply tw-mb-4;
204
+ }
205
+
206
+ .vc-invite-page__button-container {
207
+ @apply tw-flex tw-justify-center tw-items-center tw-pt-2;
208
+ }
209
+
210
+ .vc-invite-page__spacer {
211
+ @apply tw-grow tw-basis-0;
212
+ }
213
+
214
+ .vc-invite-page__hint {
215
+ @apply tw-mt-3;
216
+ }
217
+ </style>
@@ -173,7 +173,8 @@
173
173
  import { ref, reactive, computed, onMounted, Ref, inject } from "vue";
174
174
  import { useRouter } from "vue-router";
175
175
  import { useIsFormValid, Field, useIsFormDirty, useForm } from "vee-validate";
176
- import { useSettings, useUser } from "./../../../../../core/composables";
176
+ import { useSettings } from "./../../../../../core/composables";
177
+ import { useUserManagement } from "./../../../../../core/composables/useUserManagement";
177
178
  import { RequestPasswordResult } from "./../../../../../core/types";
178
179
  import { ExternalSignInProviderInfo, SignInResult } from "./../../../../../core/api/platform";
179
180
  import { useI18n } from "vue-i18n";
@@ -201,7 +202,7 @@ let useLogin;
201
202
  const signInResult = ref({ succeeded: true }) as Ref<SignInResult & { status?: number; error?: any }>;
202
203
  const requestPassResult = ref<RequestPasswordResult>({ succeeded: true });
203
204
  const forgotPasswordRequestSent = ref(false);
204
- const { signIn, loading, user } = useUser();
205
+ const { signIn, loading, user } = useUserManagement();
205
206
  const { getProviders } = useExternalProvider();
206
207
 
207
208
  const isLogin = ref(true);
@@ -100,8 +100,9 @@
100
100
  import { reactive, onMounted, computed } from "vue";
101
101
  import { useRouter } from "vue-router";
102
102
  import { Field, useForm } from "vee-validate";
103
- import { useUser, useSettings } from "./../../../../../core/composables";
103
+ import { useSettings } from "./../../../../../core/composables";
104
104
  import { useI18n } from "vue-i18n";
105
+ import { useUserManagement } from "./../../../../../core/composables/useUserManagement";
105
106
 
106
107
  const props = withDefaults(
107
108
  defineProps<{
@@ -117,7 +118,7 @@ const props = withDefaults(
117
118
  },
118
119
  );
119
120
 
120
- const { validateToken, validatePassword, resetPasswordByToken, signIn, loading } = useUser();
121
+ const { validateToken, validatePassword, resetPasswordByToken, signIn, loading } = useUserManagement();
121
122
  const router = useRouter();
122
123
  const { t } = useI18n({ useScope: "global" });
123
124
  const { validate: veeValidate } = useForm({ validateOnMount: false });
@@ -569,16 +569,11 @@ const svgPath = computed(() => {
569
569
  /* Font Awesome Icons */
570
570
  [class^="fa-"],
571
571
  [class*=" fa-"],
572
- [class^="fas"],
573
- [class*=" fas"],
574
- [class^="far"],
575
- [class*=" far"],
576
- [class^="fal"],
577
- [class*=" fal"],
578
- [class^="fab"],
579
- [class*=" fab"],
580
- [class^="fad"],
581
- [class*=" fad"] {
572
+ [class~="fas"],
573
+ [class~="far"],
574
+ [class~="fal"],
575
+ [class~="fab"],
576
+ [class~="fad"] {
582
577
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 6 Duotone", "Font Awesome 6 Pro";
583
578
  font-style: normal;
584
579
  font-weight: normal;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="vc-widget"
4
- :data-widget-id="widgetName"
4
+ :data-widget-id="actualWidgetId"
5
5
  :data-widget-name="title"
6
6
  :class="[
7
7
  { 'vc-widget--expanded': isExpanded },
@@ -38,7 +38,7 @@
38
38
  </template>
39
39
 
40
40
  <script lang="ts" setup>
41
- import { computed, getCurrentInstance } from "vue";
41
+ import { computed, getCurrentInstance, useAttrs } from "vue";
42
42
  import { VcIcon } from "./../vc-icon";
43
43
  import { useWidgets } from "../../../../core/composables";
44
44
 
@@ -57,15 +57,22 @@ const emit = defineEmits<{
57
57
  }>();
58
58
 
59
59
  const instance = getCurrentInstance();
60
-
60
+ const attrs = useAttrs();
61
61
  const widgetService = useWidgets();
62
62
 
63
- const widgetName = instance?.parent?.type.__name;
63
+ // Get widgetId from attributes passed by the parent container
64
+ const actualWidgetId = computed(() => (attrs.widgetId || attrs["widget-id"]) as string | undefined);
64
65
 
65
66
  function onClick() {
66
67
  if (!props.disabled) {
67
- if (widgetName && instance?.parent?.exposed) {
68
- widgetService.setActiveWidget(instance?.parent?.exposed);
68
+ // Use the actualWidgetId from attrs
69
+ if (actualWidgetId.value && instance?.parent?.exposed) {
70
+ widgetService.setActiveWidget({
71
+ exposed: instance.parent.exposed,
72
+ widgetId: actualWidgetId.value,
73
+ });
74
+ } else if (!actualWidgetId.value) {
75
+ console.warn("VcWidget: widgetId is missing from attrs. Widget activation might not work as expected.");
69
76
  }
70
77
  emit("click");
71
78
  }
@@ -273,8 +273,6 @@ const meta = {
273
273
  docs: {
274
274
  description: {
275
275
  component: `
276
- ### VcInputDropdown Component
277
-
278
276
  The VcInputDropdown component combines an input field with a dropdown selection in a unified interface.
279
277
  This creates a powerful and flexible control ideal for scenarios where users need to both input a value
280
278
  and select a category, unit, or format for that value.
@@ -67,7 +67,7 @@
67
67
  </template>
68
68
  <!-- eslint-disable @typescript-eslint/no-explicit-any -->
69
69
  <script lang="ts" setup>
70
- import { inject, provide, useAttrs, watch, ref, onUnmounted, computed } from "vue";
70
+ import { inject, provide, watch, ref, onUnmounted, computed } from "vue";
71
71
  import VcAppBar from "./_internal/vc-app-bar/vc-app-bar.vue";
72
72
  import VcAppMenu from "./_internal/vc-app-menu/vc-app-menu.vue";
73
73
  import {
@@ -78,7 +78,7 @@ import {
78
78
  NotificationDropdown,
79
79
  BladeRoutesRecord,
80
80
  } from "./../../../../shared/components";
81
- import { provideAppBarWidget, provideWidgetService, useNotifications, useUser } from "../../../../core/composables";
81
+ import { provideAppBarWidget, useNotifications } from "../../../../core/composables";
82
82
  import { useRoute, useRouter } from "vue-router";
83
83
  import { watchOnce } from "@vueuse/core";
84
84
  import { MenuItem } from "../../../../core/types";
@@ -94,6 +94,7 @@ import { DynamicModulesKey } from "../../../../injection-keys";
94
94
  import { provideMenuService } from "../../../../core/composables/useMenuService";
95
95
  import { BellIcon } from "../../atoms/vc-icon/icons";
96
96
  import { provideAppBarMobileButtonsService } from "../../../../core/composables/useAppBarMobileButtons";
97
+ import { useUserManagement } from "../../../../core/composables/useUserManagement";
97
98
 
98
99
  export interface Props {
99
100
  isReady: boolean;
@@ -134,7 +135,7 @@ const { appsList, switchApp, getApps } = useAppSwitcher();
134
135
 
135
136
  const { loadFromHistory, notifications, markAllAsRead } = useNotifications();
136
137
  const route = useRoute();
137
- const { isAuthenticated } = useUser();
138
+ const { isAuthenticated } = useUserManagement();
138
139
 
139
140
  const routes = router.getRoutes();
140
141
 
@@ -6,6 +6,7 @@
6
6
  v-for="widget in displayedItems"
7
7
  :key="widget.id"
8
8
  v-bind="widget.props || {}"
9
+ :widget-id="widget.id"
9
10
  v-on="widget.events || {}"
10
11
  />
11
12
 
@@ -34,6 +35,7 @@
34
35
  class="tw-p-3 tw-w-full"
35
36
  v-bind="item.props || {}"
36
37
  horizontal
38
+ :widget-id="item.id"
37
39
  v-on="item.events || {}"
38
40
  />
39
41
  </template>
@@ -54,7 +56,6 @@ interface Props {
54
56
  }
55
57
 
56
58
  const props = defineProps<Props>();
57
- const normalizedBladeId = computed(() => props.bladeId?.toLowerCase() || "");
58
59
  const showToolbar = ref(false);
59
60
 
60
61
  const displayedItems = computed(() => props.widgets.slice(0, 3));
@@ -13,6 +13,7 @@
13
13
  :key="widget.id"
14
14
  v-bind="widget.props || {}"
15
15
  :data-item-key="widget.id"
16
+ :widget-id="widget.id"
16
17
  v-on="widget.events || {}"
17
18
  />
18
19
 
@@ -42,6 +43,7 @@
42
43
  class="tw-p-3 tw-w-full"
43
44
  v-bind="item.props || {}"
44
45
  horizontal
46
+ :widget-id="item.id"
45
47
  v-on="item.events || {}"
46
48
  />
47
49
  </template>