@drax/crud-vue 3.31.0 → 3.34.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": "3.31.0",
6
+ "version": "3.34.0",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -27,7 +27,7 @@
27
27
  "@drax/common-front": "^3.29.0",
28
28
  "@drax/crud-front": "^3.21.0",
29
29
  "@drax/crud-share": "^3.29.0",
30
- "@drax/media-vue": "^3.31.0"
30
+ "@drax/media-vue": "^3.34.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "pinia": "^3.0.4",
@@ -50,5 +50,5 @@
50
50
  "vue-tsc": "^3.2.4",
51
51
  "vuetify": "^3.11.8"
52
52
  },
53
- "gitHead": "90e6f71d45f95f14df6b8334920f9af82a1c99a2"
53
+ "gitHead": "07287d9622062215b653e5ded218e07af1b22190"
54
54
  }
@@ -8,7 +8,7 @@ import CrudCreateOnTheFlyButton from "./buttons/CrudCreateOnTheFlyButton.vue";
8
8
 
9
9
  const valueModel = defineModel<string | string[]>({type: [String, Array], required: false})
10
10
 
11
- const {entity, multiple} = defineProps({
11
+ const {entity, multiple, itemValue} = defineProps({
12
12
  entity: {type: Object as PropType<IEntityCrud|undefined>, required: true},
13
13
  field: {type: Object as PropType<IEntityCrudField>, required: true},
14
14
  label: {type: String},
@@ -68,7 +68,7 @@ async function search(value: any) {
68
68
  async function checkIds(ids: Array<string> = []) {
69
69
  try{
70
70
 
71
- if(valueModel.value) {
71
+ if(itemValue === '_id' && valueModel.value) {
72
72
  let ids = Array.isArray(valueModel.value) ? valueModel.value : [valueModel.value]
73
73
  for (let id of ids) {
74
74
  if (!items.value.some((item: any) => getItemId(item) === id)) {
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import {computed, onBeforeMount, watch, type PropType} from "vue";
3
3
  import {useRoute, useRouter} from "vue-router";
4
+ import {useI18n} from "vue-i18n";
4
5
  import type {IEntityCrud} from "@drax/crud-share";
5
6
  import CrudForm from "./CrudForm.vue";
6
7
  import CrudNotify from "./CrudNotify.vue";
@@ -19,6 +20,7 @@ const emit = defineEmits(['created', 'updated', 'deleted', 'viewed', 'canceled']
19
20
  const route = useRoute()
20
21
  const router = useRouter()
21
22
  const store = useCrudStore(entity?.name)
23
+ const {t, te} = useI18n()
22
24
 
23
25
  const {
24
26
  resetCrudStore,
@@ -165,6 +167,16 @@ async function prepareRouteForm() {
165
167
  <v-card :class="entity.cardClass" :density="entity.cardDensity">
166
168
  <v-progress-linear v-if="store.loading" indeterminate/>
167
169
 
170
+ <v-card-actions class="justify-start pa-2 pb-0">
171
+ <v-btn
172
+ prepend-icon="mdi-arrow-left"
173
+ variant="text"
174
+ @click="goToList"
175
+ >
176
+ {{ te('action.back') ? t('action.back') : 'Volver' }}
177
+ </v-btn>
178
+ </v-card-actions>
179
+
168
180
  <crud-form
169
181
  v-if="formReady || store.error"
170
182
  :entity="entity"