@drax/crud-vue 2.0.5 → 2.0.7

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": "2.0.5",
6
+ "version": "2.0.7",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -50,5 +50,5 @@
50
50
  "vue-tsc": "^3.2.4",
51
51
  "vuetify": "^3.11.8"
52
52
  },
53
- "gitHead": "931e009c53493f4a14a79fd0d214bd0ad51b251a"
53
+ "gitHead": "7f2c7c7fa1b3e77276c8ce1ec7e86c008a51a776"
54
54
  }
package/src/EntityCrud.ts CHANGED
@@ -141,7 +141,7 @@ class EntityCrud implements IEntityCrud {
141
141
  throw new Error("Ref not found: " + ref)
142
142
  }
143
143
 
144
- return this.refs[ref]
144
+ return this.refs[ref] as IEntityCrud
145
145
  }
146
146
 
147
147
  get rules(): IEntityCrudRules {
@@ -184,7 +184,7 @@ const menuInputErrors = computed(() => {
184
184
  <v-card-text>
185
185
  <v-tabs-window v-model="tabSelected">
186
186
  <v-tabs-window-item v-for="tab in entity.tabs" :value="tab">
187
- <v-row>
187
+ <v-row class="pt-3">
188
188
  <v-col
189
189
  v-for="field in tabFields(tab)"
190
190
  :key="field.name"
@@ -277,7 +277,7 @@ const menuInputErrors = computed(() => {
277
277
  {{ operation == 'view' ? t('action.close') : t('action.cancel') }}
278
278
  </v-btn>
279
279
  <v-btn variant="flat" v-if="operation != 'view'" :class="entity.submitBtnFormClass" @click="submit" :loading="store.loading">
280
- {{ operation ? t('action.' + operation) : t('action.sent') }}
280
+ {{ operation ? t('action.'+operation) : t('action.sent') }}
281
281
  </v-btn>
282
282
  </v-card-actions>
283
283
  </v-card>
@@ -19,7 +19,7 @@ const {hasPermission} = useAuth()
19
19
 
20
20
  const valueModel = defineModel<any>({type: [String, Number, Boolean, Object, Array], default: false})
21
21
 
22
- const {index, entity, field, disableRules, parentField} = defineProps({
22
+ const {index, entity, field, disableRules, parentField, errorMessages} = defineProps({
23
23
  entity: {type: Object as PropType<IEntityCrud>, required: true},
24
24
  field: {type: Object as PropType<IEntityCrudField | IEntityCrudFilter | undefined>, required: true},
25
25
  prependIcon: {type: String, default: ''},
@@ -35,6 +35,7 @@ const {index, entity, field, disableRules, parentField} = defineProps({
35
35
  preview: {type: Boolean, default: true},
36
36
  previewHeight: {type: String, default: '100px'},
37
37
  parentField: {type: String, default: null, required: false},
38
+ errorMessages: {type: Array as PropType<string[]>, default: null, required: false},
38
39
  index: {type: Number, default: null, required: false},
39
40
  density: {type: String as PropType<'comfortable' | 'compact' | 'default'>, default: 'default'},
40
41
  variant: {
@@ -64,13 +65,17 @@ const rules = computed(() => {
64
65
  return entity.getRule(field.name) as any
65
66
  })
66
67
 
67
- const inputErrors = computed(() => {
68
+ const storeErrorMessages = computed(() => {
68
69
  let sIndex = (index != null && index >= 0) ? `${index}.` : ''
69
70
  let name = parentField ? `${parentField}.${sIndex}${field.name}` : field.name
70
71
  return store.getFieldInputErrors(name).map((error: string) =>te(error) ? t(error) : error)
71
72
  }
72
73
  )
73
74
 
75
+ const inputErrors = computed(() => {
76
+ return errorMessages ?? storeErrorMessages.value
77
+ })
78
+
74
79
  defineEmits(['updateValue'])
75
80
 
76
81
  </script>
@@ -109,6 +109,7 @@ const totalCount = computed(() => {
109
109
  chips
110
110
  closable-chips
111
111
  return-object
112
+ :menu-props="{ zIndex: 3000 }"
112
113
  >
113
114
  </v-select>
114
115
 
@@ -121,6 +122,7 @@ const totalCount = computed(() => {
121
122
  density="compact"
122
123
  variant="outlined"
123
124
  class="mt-4"
125
+ :menu-props="{ zIndex: 3000 }"
124
126
  >
125
127
  <template v-slot:prepend-inner>
126
128
  <v-icon>mdi-calendar-clock</v-icon>
@@ -399,7 +399,8 @@ export function useCrud(entity: IEntityCrud) {
399
399
 
400
400
 
401
401
  return {
402
- doPaginate, doExport, onView, onCreate, onEdit, onDelete, onCancel, onSubmit, resetCrudStore,
402
+ doPaginate, doExport, doUpdate, doCreate, doDelete,
403
+ onView, onCreate, onEdit, onDelete, onCancel, onSubmit, resetCrudStore,
403
404
  operation, dialog, form, notify, error, message, formValid,
404
405
  loading, itemsPerPage, page, sortBy, search, totalItems, items,
405
406
  prepareFilters, filters, clearFilters, applyFilters,