@vc-shell/framework 1.0.70 → 1.0.72
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 +51 -1
- package/core/composables/useNotifications/index.ts +1 -1
- package/core/composables/usePermissions/index.ts +21 -8
- package/core/composables/useUser/index.ts +180 -13
- package/core/plugins/modularity/index.ts +17 -2
- package/core/utilities/index.ts +1 -0
- package/core/utilities/kebabToCamel.ts +7 -0
- package/dist/core/composables/useNotifications/index.d.ts +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/usePermissions/index.d.ts +1 -2
- package/dist/core/composables/usePermissions/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +18 -1
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/plugins/modularity/index.d.ts +4 -1
- package/dist/core/plugins/modularity/index.d.ts.map +1 -1
- package/dist/core/utilities/index.d.ts +1 -0
- package/dist/core/utilities/index.d.ts.map +1 -1
- package/dist/core/utilities/kebabToCamel.d.ts +2 -0
- package/dist/core/utilities/kebabToCamel.d.ts.map +1 -0
- package/dist/framework.mjs +18205 -16332
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts +1 -1
- package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/index.d.ts +5 -7
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts +5 -5
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts +21 -5
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/types/index.d.ts +1 -1
- package/dist/shared/components/blade-navigation/types/index.d.ts.map +1 -1
- package/dist/shared/components/change-password/change-password.vue.d.ts +7 -0
- package/dist/shared/components/change-password/change-password.vue.d.ts.map +1 -0
- package/dist/shared/components/change-password/index.d.ts +11 -0
- package/dist/shared/components/change-password/index.d.ts.map +1 -0
- package/dist/shared/components/index.d.ts +9 -0
- package/dist/shared/components/index.d.ts.map +1 -0
- package/dist/shared/components/language-selector/index.d.ts +55 -0
- package/dist/shared/components/language-selector/index.d.ts.map +1 -0
- package/dist/shared/components/language-selector/language-selector.vue.d.ts +45 -0
- package/dist/shared/components/language-selector/language-selector.vue.d.ts.map +1 -0
- package/dist/shared/components/notifications/core/notification.d.ts.map +1 -1
- package/dist/shared/components/notifications/types/index.d.ts +3 -1
- package/dist/shared/components/notifications/types/index.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/index.d.ts +43 -0
- package/dist/shared/components/user-dropdown-button/index.d.ts.map +1 -0
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts +33 -0
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -0
- package/dist/shared/index.d.ts +3 -7
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/locales/index.d.ts +3 -0
- package/dist/shared/locales/index.d.ts.map +1 -0
- package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts +2 -9
- package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts.map +1 -1
- package/dist/shared/modules/assets/components/assets-details/index.d.ts +23 -157
- package/dist/shared/modules/assets/components/assets-details/index.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +2 -9
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/index.d.ts +27 -172
- package/dist/shared/modules/assets-manager/components/assets-manager/index.d.ts.map +1 -1
- package/dist/shared/modules/index.d.ts +3 -0
- package/dist/shared/modules/index.d.ts.map +1 -0
- package/dist/shared/pages/InvitePage/components/index.d.ts +2 -0
- package/dist/shared/pages/InvitePage/components/index.d.ts.map +1 -0
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts +33 -0
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -0
- package/dist/shared/pages/InvitePage/components/invite/index.d.ts +32 -0
- package/dist/shared/pages/InvitePage/components/invite/index.d.ts.map +1 -0
- package/dist/shared/pages/InvitePage/index.d.ts +5 -0
- package/dist/shared/pages/InvitePage/index.d.ts.map +1 -0
- package/dist/shared/pages/InvitePage/locales/index.d.ts +3 -0
- package/dist/shared/pages/InvitePage/locales/index.d.ts.map +1 -0
- package/dist/shared/pages/LoginPage/components/index.d.ts +2 -0
- package/dist/shared/pages/LoginPage/components/index.d.ts.map +1 -0
- package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts +17 -0
- package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -0
- package/dist/shared/pages/LoginPage/components/login/index.d.ts +28 -0
- package/dist/shared/pages/LoginPage/components/login/index.d.ts.map +1 -0
- package/dist/shared/pages/LoginPage/index.d.ts +3 -0
- package/dist/shared/pages/LoginPage/index.d.ts.map +1 -0
- package/dist/shared/pages/LoginPage/locales/index.d.ts +3 -0
- package/dist/shared/pages/LoginPage/locales/index.d.ts.map +1 -0
- package/dist/shared/pages/LoginPage/plugin.d.ts +6 -0
- package/dist/shared/pages/LoginPage/plugin.d.ts.map +1 -0
- package/dist/shared/pages/ResetPasswordPage/components/index.d.ts +2 -0
- package/dist/shared/pages/ResetPasswordPage/components/index.d.ts.map +1 -0
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts +33 -0
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -0
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/index.d.ts +32 -0
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/index.d.ts.map +1 -0
- package/dist/shared/pages/ResetPasswordPage/index.d.ts +5 -0
- package/dist/shared/pages/ResetPasswordPage/index.d.ts.map +1 -0
- package/dist/shared/pages/ResetPasswordPage/locales/index.d.ts +3 -0
- package/dist/shared/pages/ResetPasswordPage/locales/index.d.ts.map +1 -0
- package/dist/shared/pages/index.d.ts +10 -0
- package/dist/shared/pages/index.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typings/index.d.ts +8 -0
- package/dist/typings/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-button/index.d.ts +36 -6
- package/dist/ui/components/atoms/vc-button/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts +10 -7
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-link/vc-link.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status/index.d.ts +6 -6
- package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/index.d.ts +1 -31
- package/dist/ui/components/organisms/vc-blade/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +1 -6
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/index.d.ts +6 -6
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts +2 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/index.d.ts +7 -7
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +7 -7
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +11 -8
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +1 -1
- package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +10 -21
- package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +150 -67
- package/shared/components/blade-navigation/types/index.ts +1 -1
- package/shared/components/change-password/change-password.vue +167 -0
- package/shared/components/change-password/index.ts +10 -0
- package/shared/components/index.ts +8 -0
- package/shared/components/language-selector/index.ts +10 -0
- package/shared/components/language-selector/language-selector.vue +60 -0
- package/shared/components/notifications/core/notification.ts +3 -3
- package/shared/components/notifications/types/index.ts +4 -1
- package/shared/components/user-dropdown-button/index.ts +10 -0
- package/shared/components/user-dropdown-button/user-dropdown-button.vue +124 -0
- package/shared/index.ts +12 -8
- package/shared/locales/en.json +35 -0
- package/shared/locales/index.ts +2 -0
- package/shared/modules/assets/components/assets-details/assets-details.vue +1 -7
- package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +0 -6
- package/shared/modules/index.ts +2 -0
- package/shared/pages/InvitePage/components/index.ts +1 -0
- package/shared/pages/InvitePage/components/invite/Invite.vue +172 -0
- package/shared/pages/InvitePage/components/invite/index.ts +3 -0
- package/shared/pages/InvitePage/index.ts +7 -0
- package/shared/pages/InvitePage/locales/en.json +31 -0
- package/shared/pages/InvitePage/locales/index.ts +2 -0
- package/shared/pages/LoginPage/components/index.ts +1 -0
- package/shared/pages/LoginPage/components/login/Login.vue +283 -0
- package/shared/pages/LoginPage/components/login/index.ts +3 -0
- package/shared/pages/LoginPage/index.ts +2 -0
- package/shared/pages/LoginPage/locales/en.json +36 -0
- package/shared/pages/LoginPage/locales/index.ts +2 -0
- package/shared/pages/LoginPage/plugin.ts +17 -0
- package/shared/pages/ResetPasswordPage/components/index.ts +1 -0
- package/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue +166 -0
- package/shared/pages/ResetPasswordPage/components/reset-password/index.ts +3 -0
- package/shared/pages/ResetPasswordPage/index.ts +7 -0
- package/shared/pages/ResetPasswordPage/locales/en.json +28 -0
- package/shared/pages/ResetPasswordPage/locales/index.ts +2 -0
- package/shared/pages/index.ts +12 -0
- package/ui/components/atoms/vc-button/vc-button.vue +109 -143
- package/ui/components/atoms/vc-link/vc-link.stories.ts +0 -1
- package/ui/components/atoms/vc-link/vc-link.vue +2 -2
- package/ui/components/molecules/vc-select/vc-select.vue +3 -3
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +2 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +3 -4
- package/ui/components/organisms/vc-app/vc-app.vue +12 -12
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +5 -8
- package/ui/components/organisms/vc-blade/vc-blade.vue +14 -22
- package/ui/components/organisms/vc-login-form/vc-login-form.stories.ts +1 -1
- package/ui/components/organisms/vc-popup/_internal/vc-popup-warning/vc-popup-warning.vue +1 -1
- package/ui/components/organisms/vc-popup/vc-popup.vue +1 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +5 -8
- package/ui/components/organisms/vc-table/vc-table.vue +25 -18
- package/ui/locales/en.json +3 -3
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<VcPopup
|
|
3
|
+
variant="small"
|
|
4
|
+
:title="$t('COMPONENTS.CHANGE_PASSWORD.TITLE')"
|
|
5
|
+
@close="$emit('close')"
|
|
6
|
+
>
|
|
7
|
+
<div class="tw-p-3">
|
|
8
|
+
<VcForm>
|
|
9
|
+
<Field
|
|
10
|
+
v-slot="{ field, errorMessage, errors }"
|
|
11
|
+
:label="$t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.LABEL')"
|
|
12
|
+
name="current"
|
|
13
|
+
rules="required|min:6"
|
|
14
|
+
:model-value="form.currentPassword"
|
|
15
|
+
>
|
|
16
|
+
<VcInput
|
|
17
|
+
v-bind="field"
|
|
18
|
+
ref="passwordField"
|
|
19
|
+
v-model="form.currentPassword"
|
|
20
|
+
class="tw-mb-4 tw-mt-1"
|
|
21
|
+
:label="$t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.LABEL')"
|
|
22
|
+
:placeholder="$t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.PLACEHOLDER')"
|
|
23
|
+
type="password"
|
|
24
|
+
required
|
|
25
|
+
:error="!!errors.length"
|
|
26
|
+
:error-message="errorMessage"
|
|
27
|
+
@update:model-value="validate"
|
|
28
|
+
></VcInput>
|
|
29
|
+
</Field>
|
|
30
|
+
<Field
|
|
31
|
+
v-slot="{ field, errorMessage, errors }"
|
|
32
|
+
:label="$t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.LABEL')"
|
|
33
|
+
name="new_pass"
|
|
34
|
+
rules="required|min:6"
|
|
35
|
+
:model-value="form.password"
|
|
36
|
+
>
|
|
37
|
+
<VcInput
|
|
38
|
+
v-bind="field"
|
|
39
|
+
ref="newPasswordField"
|
|
40
|
+
v-model="form.password"
|
|
41
|
+
class="tw-mb-4 tw-mt-1"
|
|
42
|
+
:label="$t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.LABEL')"
|
|
43
|
+
:placeholder="$t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.PLACEHOLDER')"
|
|
44
|
+
type="password"
|
|
45
|
+
required
|
|
46
|
+
:error="!!errors.length"
|
|
47
|
+
:error-message="errorMessage"
|
|
48
|
+
@update:model-value="validate"
|
|
49
|
+
></VcInput>
|
|
50
|
+
</Field>
|
|
51
|
+
<Field
|
|
52
|
+
v-slot="{ field, errorMessage, errors }"
|
|
53
|
+
:label="$t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.LABEL')"
|
|
54
|
+
name="confirm_pass"
|
|
55
|
+
rules="required|min:6"
|
|
56
|
+
:model-value="form.confirmPassword"
|
|
57
|
+
>
|
|
58
|
+
<VcInput
|
|
59
|
+
v-bind="field"
|
|
60
|
+
ref="confirmPasswordField"
|
|
61
|
+
v-model="form.confirmPassword"
|
|
62
|
+
class="tw-mb-4"
|
|
63
|
+
:label="$t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.LABEL')"
|
|
64
|
+
:placeholder="$t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.PLACEHOLDER')"
|
|
65
|
+
type="password"
|
|
66
|
+
required
|
|
67
|
+
:error="!!errors.length"
|
|
68
|
+
:error-message="errorMessage"
|
|
69
|
+
@update:model-value="validate"
|
|
70
|
+
></VcInput>
|
|
71
|
+
</Field>
|
|
72
|
+
<div class="tw-flex tw-justify-center tw-items-center tw-pt-2">
|
|
73
|
+
<span
|
|
74
|
+
v-if="$isDesktop.value"
|
|
75
|
+
class="tw-grow tw-basis-0"
|
|
76
|
+
></span>
|
|
77
|
+
<VcButton
|
|
78
|
+
:outline="true"
|
|
79
|
+
class="tw-mr-3"
|
|
80
|
+
@click="$emit('close')"
|
|
81
|
+
>
|
|
82
|
+
{{ $t("COMPONENTS.CHANGE_PASSWORD.CANCEL") }}
|
|
83
|
+
</VcButton>
|
|
84
|
+
<VcButton
|
|
85
|
+
:disabled="loading || !form.isValid || isDisabled"
|
|
86
|
+
@click="changePassword"
|
|
87
|
+
>
|
|
88
|
+
{{ $t("COMPONENTS.CHANGE_PASSWORD.SAVE") }}
|
|
89
|
+
</VcButton>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<VcHint
|
|
93
|
+
v-for="(err, i) in form.errors"
|
|
94
|
+
:key="i"
|
|
95
|
+
class="tw-mt-3 !tw-text-[#f14e4e]"
|
|
96
|
+
>
|
|
97
|
+
<!-- TODO: stylizing-->
|
|
98
|
+
{{
|
|
99
|
+
(err as IIdentityError).code ? $t(`COMPONENTS.CHANGE_PASSWORD.ERRORS.${(err as IIdentityError).code}`) : err
|
|
100
|
+
}}
|
|
101
|
+
</VcHint>
|
|
102
|
+
</VcForm>
|
|
103
|
+
</div>
|
|
104
|
+
</VcPopup>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<script lang="ts" setup>
|
|
108
|
+
import { nextTick, reactive, computed } from "vue";
|
|
109
|
+
import { useIsFormValid, Field, useIsFormDirty, useForm } from "vee-validate";
|
|
110
|
+
import { VcInput, VcHint, VcButton, VcPopup, VcForm } from "./../../../ui/components";
|
|
111
|
+
import { IIdentityError } from "./../../../core/api";
|
|
112
|
+
import { useUser } from "./../../../core/composables/useUser";
|
|
113
|
+
|
|
114
|
+
interface IChangePassForm {
|
|
115
|
+
isValid: boolean;
|
|
116
|
+
errors: IIdentityError[] | string[];
|
|
117
|
+
currentPassword: string;
|
|
118
|
+
password: string;
|
|
119
|
+
confirmPassword: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface Emits {
|
|
123
|
+
(event: "close"): void;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const emit = defineEmits<Emits>();
|
|
127
|
+
const { changeUserPassword, loading, validatePassword } = useUser();
|
|
128
|
+
useForm({ validateOnMount: false });
|
|
129
|
+
const isValid = useIsFormValid();
|
|
130
|
+
const isDirty = useIsFormDirty();
|
|
131
|
+
const form = reactive<IChangePassForm>({
|
|
132
|
+
isValid: false,
|
|
133
|
+
errors: [],
|
|
134
|
+
currentPassword: "",
|
|
135
|
+
password: "",
|
|
136
|
+
confirmPassword: "",
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const isDisabled = computed(() => {
|
|
140
|
+
return !isDirty.value || !isValid.value;
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
async function changePassword() {
|
|
144
|
+
const result = await changeUserPassword(form.currentPassword, form.password);
|
|
145
|
+
if (result.succeeded) {
|
|
146
|
+
emit("close");
|
|
147
|
+
} else {
|
|
148
|
+
form.errors = result.errors;
|
|
149
|
+
form.isValid = form.errors.length == 0;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function validate() {
|
|
154
|
+
nextTick(async () => {
|
|
155
|
+
if (form.password || form.confirmPassword) {
|
|
156
|
+
form.errors = (await validatePassword(form.password)).errors;
|
|
157
|
+
if (form.confirmPassword !== form.password) {
|
|
158
|
+
(form.errors as IIdentityError[]).push({ code: "Repeat-password" });
|
|
159
|
+
}
|
|
160
|
+
if (form.confirmPassword === form.currentPassword && form.password === form.currentPassword) {
|
|
161
|
+
(form.errors as IIdentityError[]).push({ code: "Equal-passwords" });
|
|
162
|
+
}
|
|
163
|
+
form.isValid = form.errors.length == 0;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
</script>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _ChangePassword from "./change-password.vue";
|
|
2
|
+
|
|
3
|
+
export const ChangePassword = _ChangePassword as typeof _ChangePassword;
|
|
4
|
+
|
|
5
|
+
// Declare globally
|
|
6
|
+
declare module "@vue/runtime-core" {
|
|
7
|
+
export interface GlobalComponents {
|
|
8
|
+
ChangePassword: typeof ChangePassword;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./app-switcher";
|
|
2
|
+
export * from "./blade-navigation";
|
|
3
|
+
export * from "./notifications";
|
|
4
|
+
export * from "./error-interceptor";
|
|
5
|
+
export * from "./popup-handler";
|
|
6
|
+
export * from "./change-password";
|
|
7
|
+
export * from "./language-selector";
|
|
8
|
+
export * from "./user-dropdown-button";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _LanguageSelector from "./language-selector.vue";
|
|
2
|
+
|
|
3
|
+
export const LanguageSelector = _LanguageSelector as typeof _LanguageSelector;
|
|
4
|
+
|
|
5
|
+
// Declare globally
|
|
6
|
+
declare module "@vue/runtime-core" {
|
|
7
|
+
export interface GlobalComponents {
|
|
8
|
+
LanguageSelector: typeof LanguageSelector;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-on-click-outside="
|
|
4
|
+
() => {
|
|
5
|
+
isDropActive = false;
|
|
6
|
+
}
|
|
7
|
+
"
|
|
8
|
+
class="tw-relative"
|
|
9
|
+
:title="title"
|
|
10
|
+
@click.stop="isDropActive = !isDropActive"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
:class="[
|
|
14
|
+
{
|
|
15
|
+
'tw-shadow-[0_-6px_6px_white,1px_1px_22px_rgba(126,142,157,0.2)] [clip-path:inset(0px_-20px_0px_-20px)] tw-bg-white tw-z-[10000]':
|
|
16
|
+
isDropActive,
|
|
17
|
+
},
|
|
18
|
+
'tw-relative tw-h-full tw-flex tw-items-center tw-justify-center tw-w-[var(--app-bar-button-width)] tw-border-l tw-border-solid tw-border-l-[color:var(--app-bar-button-border-color)] tw-cursor-pointer tw-text-[color:var(--app-bar-button-color)] tw-bg-[color:var(--app-bar-button-background-color)] tw-transition-[color] tw-duration-200 hover:tw-text-[color:var(--app-bar-button-color-hover)] hover:tw-bg-[color:var(--app-bar-button-background-color-hover)]',
|
|
19
|
+
]"
|
|
20
|
+
>
|
|
21
|
+
<VcIcon
|
|
22
|
+
icon="fas fa-globe"
|
|
23
|
+
size="xl"
|
|
24
|
+
></VcIcon>
|
|
25
|
+
</div>
|
|
26
|
+
<div
|
|
27
|
+
v-if="isDropActive"
|
|
28
|
+
class="tw-absolute tw-right-0 tw-top-[var(--app-bar-height)] tw-bg-white tw-shadow-[0_-6px_6px_white,1px_1px_22px_rgba(126,142,157,0.2)] tw-w-min tw-z-[10000]"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
v-for="(lang, i) in languageItems"
|
|
32
|
+
:key="i"
|
|
33
|
+
class="tw-p-3 tw-text-lg tw-text-black tw-border-l tw-border-solid tw-border-l-[#eef0f2] tw-border-b tw-border-b-[#eef0f2] tw-white tw-cursor-pointer hover:tw-bg-[#eff7fc]"
|
|
34
|
+
@click="lang.hasOwnProperty('clickHandler') && lang.clickHandler(lang.lang)"
|
|
35
|
+
>
|
|
36
|
+
{{ lang.title }}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script lang="ts" setup>
|
|
43
|
+
import { VcIcon } from "./../../../ui/components";
|
|
44
|
+
import { ref } from "vue";
|
|
45
|
+
import { vOnClickOutside } from "@vueuse/components";
|
|
46
|
+
|
|
47
|
+
export interface Props {
|
|
48
|
+
title: string;
|
|
49
|
+
value: string;
|
|
50
|
+
languageItems: { lang: string; title: string; clickHandler: (lang: string) => void }[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
withDefaults(defineProps<Props>(), {
|
|
54
|
+
title: "",
|
|
55
|
+
value: "",
|
|
56
|
+
languageItems: () => [],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const isDropActive = ref(false);
|
|
60
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mergeProps } from "vue";
|
|
2
|
-
import { NotificationOptions } from "../types";
|
|
2
|
+
import { InternalNotificationOptions, NotificationOptions } from "../types";
|
|
3
3
|
import { useContainer } from "../composables";
|
|
4
4
|
|
|
5
5
|
const {
|
|
@@ -18,7 +18,7 @@ function checkPending(limit?: number) {
|
|
|
18
18
|
return limitCount > 0 && visibleCount + pending.items.length >= limitCount;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function resolvePending(options:
|
|
21
|
+
function resolvePending(options: InternalNotificationOptions) {
|
|
22
22
|
if (checkPending(options.limit)) {
|
|
23
23
|
pending.items.push({
|
|
24
24
|
notificationId: options.notificationId,
|
|
@@ -27,7 +27,7 @@ function resolvePending(options: NotificationOptions) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function showNotification(content: string, options:
|
|
30
|
+
function showNotification(content: string, options: InternalNotificationOptions) {
|
|
31
31
|
options = mergeProps(defaultOptions as Record<string, unknown>, options as Record<string, unknown>);
|
|
32
32
|
|
|
33
33
|
if (
|
|
@@ -7,10 +7,13 @@ export interface NotificationOptions {
|
|
|
7
7
|
content?: string;
|
|
8
8
|
notificationId?: number | string;
|
|
9
9
|
type?: NotificationType;
|
|
10
|
-
closeNotification?(): void;
|
|
11
10
|
onOpen?: <T>(payload: T) => void;
|
|
12
11
|
onClose?: <T>(payload: T) => void;
|
|
13
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
13
|
payload?: string | Record<string, any>;
|
|
15
14
|
updateId?: string | number;
|
|
16
15
|
}
|
|
16
|
+
|
|
17
|
+
export interface InternalNotificationOptions extends NotificationOptions {
|
|
18
|
+
closeNotification?(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _UserDropdownButton from "./user-dropdown-button.vue";
|
|
2
|
+
|
|
3
|
+
export const UserDropdownButton = _UserDropdownButton as typeof _UserDropdownButton;
|
|
4
|
+
|
|
5
|
+
// Declare globally
|
|
6
|
+
declare module "@vue/runtime-core" {
|
|
7
|
+
export interface GlobalComponents {
|
|
8
|
+
UserDropdownButton: typeof UserDropdownButton;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-on-click-outside="onClose"
|
|
4
|
+
class="user-dropdown-button"
|
|
5
|
+
:class="{
|
|
6
|
+
'user-dropdown-button_active': accountMenuVisible,
|
|
7
|
+
'user-dropdown-button_no-pointer': $isMobile.value,
|
|
8
|
+
}"
|
|
9
|
+
@click.stop="toggleAccountMenuVisible"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="user-dropdown-button__avatar"
|
|
13
|
+
:style="{ 'background-image': `url(${avatar})` }"
|
|
14
|
+
></div>
|
|
15
|
+
<div class="tw-grow tw-basis-0 tw-ml-3 tw-overflow-hidden">
|
|
16
|
+
<div class="user-dropdown-button__name tw-truncate">
|
|
17
|
+
{{ name }}
|
|
18
|
+
</div>
|
|
19
|
+
<div class="user-dropdown-button__role">
|
|
20
|
+
{{ role }}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div
|
|
24
|
+
v-if="menuItems && menuItems.length"
|
|
25
|
+
class="user-dropdown-button__chevron"
|
|
26
|
+
>
|
|
27
|
+
<VcIcon
|
|
28
|
+
icon="fas fa-chevron-down"
|
|
29
|
+
size="xl"
|
|
30
|
+
></VcIcon>
|
|
31
|
+
</div>
|
|
32
|
+
<div
|
|
33
|
+
v-if="menuItems && accountMenuVisible"
|
|
34
|
+
class="user-dropdown-button__menu"
|
|
35
|
+
@click.stop="accountMenuVisible = false"
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
v-for="(item, i) in menuItems"
|
|
39
|
+
:key="`menu_item_${i}`"
|
|
40
|
+
class="user-dropdown-button__menu-item"
|
|
41
|
+
@click="item.hasOwnProperty('clickHandler') ? item.clickHandler() : null"
|
|
42
|
+
>
|
|
43
|
+
{{ item.title }}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script lang="ts" setup>
|
|
50
|
+
import { ref } from "vue";
|
|
51
|
+
import { vOnClickOutside } from "@vueuse/components";
|
|
52
|
+
import { BladeMenu } from "./../../../core/types";
|
|
53
|
+
|
|
54
|
+
export interface Props {
|
|
55
|
+
avatar: string;
|
|
56
|
+
name: string;
|
|
57
|
+
role: string;
|
|
58
|
+
menuItems?: BladeMenu[];
|
|
59
|
+
}
|
|
60
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
61
|
+
menuItems: () => [],
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const accountMenuVisible = ref(false);
|
|
65
|
+
|
|
66
|
+
const toggleAccountMenuVisible = () => {
|
|
67
|
+
if (props.menuItems && props.menuItems.length) {
|
|
68
|
+
accountMenuVisible.value = !accountMenuVisible.value;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const onClose = () => {
|
|
73
|
+
accountMenuVisible.value = false;
|
|
74
|
+
};
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style lang="scss">
|
|
78
|
+
.user-dropdown-button {
|
|
79
|
+
@apply tw-w-[240px] tw-border-l tw-border-solid tw-border-l-[color:var(--app-bar-divider-color)] tw-px-4 tw-cursor-pointer
|
|
80
|
+
tw-relative tw-flex tw-justify-between tw-items-center tw-h-full;
|
|
81
|
+
|
|
82
|
+
&_no-pointer {
|
|
83
|
+
@apply tw-cursor-default;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:hover,
|
|
87
|
+
&_active {
|
|
88
|
+
@apply tw-bg-[color:var(--app-bar-toolbar-icon-background-hover)];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&__avatar {
|
|
92
|
+
@apply tw-rounded-full tw-overflow-hidden tw-w-[34px] tw-h-[34px] tw-bg-[color:var(--app-bar-account-info-role-color)]
|
|
93
|
+
tw-bg-cover tw-bg-center tw-shrink-0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&__name {
|
|
97
|
+
@apply tw-text-base tw-text-[color:var(--app-bar-account-info-name-color)];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__role {
|
|
101
|
+
@apply tw-text-base tw-text-[color:var(--app-bar-account-info-role-color)];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&__chevron {
|
|
105
|
+
@apply tw-text-[#7e8e9d] [transition:transform_0.2s_ease] [transition:color_0.2s_ease];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:hover &__chevron {
|
|
109
|
+
@apply tw-text-[color:#34414f];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&_active &__chevron {
|
|
113
|
+
@apply -tw-scale-y-100;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&__menu {
|
|
117
|
+
@apply tw-absolute -tw-left-px tw-right-0 tw-top-[var(--app-bar-height)] tw-bg-white tw-z-[10000] tw-shadow-[0_-6px_6px_white,1px_1px_22px_rgba(126,142,157,0.2)];
|
|
118
|
+
|
|
119
|
+
&-item {
|
|
120
|
+
@apply tw-p-3 tw-text-lg tw-text-black tw-border-l tw-border-solid tw-border-l-[#eef0f2] tw-border-b tw-border-b-[#eef0f2] tw-bg-white hover:tw-bg-[#eff7fc];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</style>
|
package/shared/index.ts
CHANGED
|
@@ -4,9 +4,18 @@ import { VcAppSwitcherComponent } from "./components/app-switcher";
|
|
|
4
4
|
import { VcBladeNavigationComponent } from "./components/blade-navigation";
|
|
5
5
|
import { AssetsManagerModule } from "./modules/assets-manager";
|
|
6
6
|
import { VcPopupHandler } from "./components/popup-handler";
|
|
7
|
+
import * as locales from "./locales";
|
|
8
|
+
import { i18n } from "./../core/plugins";
|
|
7
9
|
|
|
8
10
|
export const SharedModule = {
|
|
9
11
|
install(app: App): void {
|
|
12
|
+
// Load locales
|
|
13
|
+
if (locales) {
|
|
14
|
+
Object.entries(locales).forEach(([key, message]) => {
|
|
15
|
+
i18n.global.mergeLocaleMessage(key, message);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
app
|
|
11
20
|
.use(AssetsDetailsModule)
|
|
12
21
|
.use(AssetsManagerModule)
|
|
@@ -16,11 +25,6 @@ export const SharedModule = {
|
|
|
16
25
|
},
|
|
17
26
|
};
|
|
18
27
|
|
|
19
|
-
export * from "./modules
|
|
20
|
-
export * from "./
|
|
21
|
-
|
|
22
|
-
export * from "./components/app-switcher";
|
|
23
|
-
export * from "./components/blade-navigation";
|
|
24
|
-
export * from "./components/notifications";
|
|
25
|
-
export * from "./components/error-interceptor";
|
|
26
|
-
export * from "./components/popup-handler";
|
|
28
|
+
export * from "./modules";
|
|
29
|
+
export * from "./components";
|
|
30
|
+
export * from "./pages";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COMPONENTS": {
|
|
3
|
+
"CHANGE_PASSWORD": {
|
|
4
|
+
"TITLE": "Change password",
|
|
5
|
+
"CURRENT_PASSWORD": {
|
|
6
|
+
"LABEL": "Current password",
|
|
7
|
+
"PLACEHOLDER": "Enter password"
|
|
8
|
+
},
|
|
9
|
+
"NEW_PASSWORD": {
|
|
10
|
+
"LABEL": "New password",
|
|
11
|
+
"PLACEHOLDER": "Enter password"
|
|
12
|
+
},
|
|
13
|
+
"CONFIRM_PASSWORD": {
|
|
14
|
+
"LABEL": "Confirm password",
|
|
15
|
+
"PLACEHOLDER": "Confirm password"
|
|
16
|
+
},
|
|
17
|
+
"CANCEL": "Cancel",
|
|
18
|
+
"SAVE": "Update",
|
|
19
|
+
"ERRORS": {
|
|
20
|
+
"Repeat-password": "Passwords are not same",
|
|
21
|
+
"Equal-passwords": "The new password must not match the old one",
|
|
22
|
+
"Invalid-token": "Token is invalid or expired",
|
|
23
|
+
"Password-too-weak": "New password does not comply one or more password security policies:",
|
|
24
|
+
"PasswordTooShort": "Passwords too short",
|
|
25
|
+
"PasswordRequiresUniqueChars": "Passwords must use different characters",
|
|
26
|
+
"PasswordRequiresLower": "Passwords must have at least one lowercase ('a'-'z')",
|
|
27
|
+
"PasswordRequiresUpper": "Passwords must have at least one uppercase ('A'-'Z')",
|
|
28
|
+
"PasswordRequiresDigit": "Passwords must have at least one digit ('0'-'9')",
|
|
29
|
+
"PasswordRequiresNonAlphanumeric": "Passwords must have at least one non alphanumeric character",
|
|
30
|
+
"Incorrect password.": "You entered an incorrect password",
|
|
31
|
+
"You have used this password in the past. Choose another one.": "You have used this password in the past. Choose another one."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -9,12 +9,6 @@
|
|
|
9
9
|
@expand="$emit('expand:blade')"
|
|
10
10
|
@collapse="$emit('collapse:blade')"
|
|
11
11
|
>
|
|
12
|
-
<template
|
|
13
|
-
v-if="$slots['error']"
|
|
14
|
-
#error
|
|
15
|
-
>
|
|
16
|
-
<slot name="error"></slot>
|
|
17
|
-
</template>
|
|
18
12
|
<!-- Blade contents -->
|
|
19
13
|
<div class="tw-flex tw-grow-1 tw-border-t tw-border-solid tw-border-t-[#eaedf3]">
|
|
20
14
|
<div class="assets-details__content tw-grow tw-basis-0 tw-w-full">
|
|
@@ -62,7 +56,7 @@
|
|
|
62
56
|
icon="far fa-copy"
|
|
63
57
|
size="m"
|
|
64
58
|
class="tw-ml-2"
|
|
65
|
-
|
|
59
|
+
text
|
|
66
60
|
title="Copy link"
|
|
67
61
|
@click="copyLink(defaultAsset.url)"
|
|
68
62
|
></VcButton>
|
|
@@ -9,12 +9,6 @@
|
|
|
9
9
|
@expand="$emit('expand:blade')"
|
|
10
10
|
@collapse="$emit('collapse:blade')"
|
|
11
11
|
>
|
|
12
|
-
<template
|
|
13
|
-
v-if="$slots['error']"
|
|
14
|
-
#error
|
|
15
|
-
>
|
|
16
|
-
<slot name="error"></slot>
|
|
17
|
-
</template>
|
|
18
12
|
<div
|
|
19
13
|
class="tw-relative tw-h-full"
|
|
20
14
|
@dragover.prevent.stop="dragOver"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./invite";
|