@drax/identity-vue 0.5.20 → 0.7.0

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.5.20",
6
+ "version": "0.7.0",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -24,11 +24,12 @@
24
24
  "format": "prettier --write src/"
25
25
  },
26
26
  "dependencies": {
27
- "@drax/common-front": "^0.5.11",
28
- "@drax/common-vue": "^0.5.11",
29
- "@drax/crud-front": "^0.5.20",
30
- "@drax/crud-share": "^0.5.17",
31
- "@drax/identity-share": "^0.5.18"
27
+ "@drax/common-front": "^0.7.0",
28
+ "@drax/common-vue": "^0.7.0",
29
+ "@drax/crud-front": "^0.7.0",
30
+ "@drax/crud-share": "^0.7.0",
31
+ "@drax/crud-vue": "^0.7.0",
32
+ "@drax/identity-share": "^0.7.0"
32
33
  },
33
34
  "peerDependencies": {
34
35
  "pinia": "^2.2.2",
@@ -65,5 +66,5 @@
65
66
  "vue-tsc": "^2.1.6",
66
67
  "vuetify": "^3.7.1"
67
68
  },
68
- "gitHead": "0f55c328d87019aafcf55402d7d182945f034982"
69
+ "gitHead": "244c1ccf07c9e3cf11486dcd013b11bcee505c6d"
69
70
  }
@@ -33,7 +33,7 @@ onMounted(async () => {
33
33
  :items="items"
34
34
  item-title="name"
35
35
  item-value="id"
36
- variant="outlined"
36
+ :variant="variant"
37
37
  :error-messages="errorMessages"
38
38
  :clearable="clearable"
39
39
  :rules="rules"
@@ -14,7 +14,6 @@ function onAvatarClick() {
14
14
  }
15
15
 
16
16
  async function onFileChanged(e: Event) {
17
- console.log("OnFileChanged",e)
18
17
  if (e.target && (e.target as HTMLInputElement).files) {
19
18
  const files = (e.target as HTMLInputElement).files;
20
19
  if (files && files[0]) {
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import {useAuthStore} from "../../stores/auth/AuthStore.js";
3
3
  import IdentityProfileAvatarEdit from "../IdentityProfileAvatarEdit/IdentityProfileAvatarEdit.vue";
4
- const emit = defineEmits(['click'])
4
+ import {useI18n} from "vue-i18n";
5
+ defineEmits(['click'])
5
6
  const authStore = useAuthStore()
6
-
7
+ const {t} = useI18n()
7
8
  </script>
8
9
 
9
10
  <template>
@@ -16,10 +17,11 @@ const authStore = useAuthStore()
16
17
  </v-sheet>
17
18
 
18
19
  <v-divider></v-divider>
19
- <v-sheet class="d-flex justify-center align-center" height="50">
20
+ <v-sheet class="d-flex justify-center align-center" height="70">
20
21
  <v-sheet class="text-center">
21
22
  <h6 class="text-caption">{{ authStore.authUser?.email }}</h6>
22
- <h6 class="text-subtitle-2">role: {{ authStore.authUser?.role?.name }}</h6>
23
+ <h6 class="text-caption">{{ authStore.authUser?.tenant?.name }}</h6>
24
+ <h6 class="text-subtitle-2">{{t('user.field.role')}}: {{ authStore.authUser?.role?.name }}</h6>
23
25
  </v-sheet>
24
26
  </v-sheet>
25
27
  </template>
@@ -62,7 +62,7 @@ const {
62
62
  <v-text-field
63
63
  id="name-input"
64
64
  name="name"
65
- :label="$t('role.field.name')"
65
+ :label="t('role.field.name')"
66
66
  v-model="valueModel.name"
67
67
  prepend-inner-icon="mdi-card-account-details"
68
68
  :variant="variant"
@@ -1,15 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import {useFormUtils, useCrudStore} from "@drax/crud-vue";
3
- import {defineEmits, defineModel, defineProps, ref} from "vue";
3
+ import {defineEmits, defineModel, defineProps, type PropType, ref} from "vue";
4
4
  import {useI18nValidation} from "@drax/common-vue";
5
5
  import RoleCombobox from "../../combobox/RoleCombobox.vue";
6
6
  import TenantCombobox from "../../combobox/TenantCombobox.vue";
7
7
  import {useI18n} from "vue-i18n";
8
+ import type {IEntityCrudOperation} from "@drax/crud-share";
8
9
 
9
10
  const {$ta} = useI18nValidation()
10
11
  const {t, te} = useI18n()
11
12
 
12
- defineProps({
13
+ const {operation} = defineProps({
14
+ operation: {type: String as PropType<IEntityCrudOperation>, required: true},
13
15
  enablePassword: {type: Boolean, default: false}
14
16
  })
15
17
 
@@ -25,6 +27,12 @@ const formRef = ref()
25
27
 
26
28
  async function submit() {
27
29
  store.resetErrors()
30
+
31
+ if(operation === 'delete') {
32
+ emit('submit',valueModel.value)
33
+ return
34
+ }
35
+
28
36
  await formRef.value.validate()
29
37
  if (valid.value) {
30
38
  emit('submit', valueModel.value)
@@ -62,7 +70,7 @@ let passwordVisibility = ref(false)
62
70
 
63
71
  <v-text-field
64
72
  id="name-input"
65
- :label="$t('user.field.name')"
73
+ :label="t('user.field.name')"
66
74
  v-model="valueModel.name"
67
75
  prepend-inner-icon="mdi-card-account-details"
68
76
  :variant="variant"
@@ -73,7 +81,7 @@ let passwordVisibility = ref(false)
73
81
 
74
82
  <v-text-field
75
83
  id="username-input"
76
- :label="$t('user.field.username')"
84
+ :label="t('user.field.username')"
77
85
  v-model="valueModel.username"
78
86
  prepend-inner-icon="mdi-account-question"
79
87
  :variant="variant"
@@ -86,7 +94,7 @@ let passwordVisibility = ref(false)
86
94
  <v-text-field
87
95
  v-if="enablePassword"
88
96
  id="password-input"
89
- :label="$t('user.field.password')"
97
+ :label="t('user.field.password')"
90
98
  v-model="valueModel.password"
91
99
  :type="passwordVisibility ? 'text': 'password'"
92
100
  :variant="variant"
@@ -101,7 +109,7 @@ let passwordVisibility = ref(false)
101
109
 
102
110
  <RoleCombobox
103
111
  v-model="valueModel.role"
104
- :label="$t('user.field.role')"
112
+ :label="t('user.field.role')"
105
113
  :variant="variant"
106
114
  :rules="[(v:any) => !!v || t('validation.required')]"
107
115
  :error-messages="$ta(store.inputErrors?.role)"
@@ -110,7 +118,7 @@ let passwordVisibility = ref(false)
110
118
 
111
119
  <TenantCombobox
112
120
  v-model="valueModel.tenant"
113
- :label="$t('user.field.tenant')"
121
+ :label="t('user.field.tenant')"
114
122
  :variant="variant"
115
123
  :error-messages="$ta(store.inputErrors?.tenant)"
116
124
  clearable
@@ -121,7 +129,7 @@ let passwordVisibility = ref(false)
121
129
  v-model="valueModel.email"
122
130
  :variant="variant"
123
131
  id="email-input"
124
- :label="$t('user.field.email')"
132
+ :label="t('user.field.email')"
125
133
  prepend-inner-icon="mdi-email"
126
134
  :rules="[(v:any) => !!v || t('validation.required')]"
127
135
  :error-messages="$ta(store.inputErrors?.email)"
@@ -132,7 +140,7 @@ let passwordVisibility = ref(false)
132
140
  v-model="valueModel.phone"
133
141
  :variant="variant"
134
142
  id="phone-input"
135
- :label="$t('user.field.phone')"
143
+ :label="t('user.field.phone')"
136
144
  prepend-inner-icon="mdi-phone"
137
145
  :rules="[(v:any) => !!v || t('validation.required')]"
138
146
  :error-messages="$ta(store.inputErrors?.phone)"
@@ -33,6 +33,7 @@ function onChangePassword(user:IUser){
33
33
  <template v-slot:form>
34
34
  <user-form
35
35
  :enable-password="operation === 'create'"
36
+ :operation="operation"
36
37
  v-model="form"
37
38
  @submit="onSubmit"
38
39
  @cancel="onCancel"