@drax/crud-vue 0.33.0 → 0.34.2

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.33.0",
6
+ "version": "0.34.2",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -24,10 +24,10 @@
24
24
  "format": "prettier --write src/"
25
25
  },
26
26
  "dependencies": {
27
- "@drax/common-front": "^0.33.0",
28
- "@drax/crud-front": "^0.33.0",
29
- "@drax/crud-share": "^0.33.0",
30
- "@drax/media-vue": "^0.33.0"
27
+ "@drax/common-front": "^0.34.2",
28
+ "@drax/crud-front": "^0.34.0",
29
+ "@drax/crud-share": "^0.34.0",
30
+ "@drax/media-vue": "^0.34.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "pinia": "^2.2.2",
@@ -64,5 +64,5 @@
64
64
  "vue-tsc": "^2.1.10",
65
65
  "vuetify": "^3.8.2"
66
66
  },
67
- "gitHead": "2a006597a635f61776d252f92bb3899371244379"
67
+ "gitHead": "9b12fafdf8a43df90e2df88ddae374c1a31cef4a"
68
68
  }
package/src/EntityCrud.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  IEntityCrud, IEntityCrudForm, IEntityCrudHeader, IEntityCrudRefs,
3
3
  IEntityCrudRules, IEntityCrudField, IEntityCrudPermissions,
4
- IDraxCrudProvider, IEntityCrudFilter, IEntityCrudFormFilter
4
+ IDraxCrudProvider, IEntityCrudFilter, IEntityCrudFormFilter, IEntityCrudFieldVariant
5
5
  } from "@drax/crud-share";
6
6
 
7
7
 
@@ -158,6 +158,10 @@ class EntityCrud implements IEntityCrud {
158
158
  return true
159
159
  }
160
160
 
161
+ isItemDeletable():boolean{
162
+ return true
163
+ }
164
+
161
165
  get isDeletable() {
162
166
  return true
163
167
  }
@@ -271,6 +275,24 @@ class EntityCrud implements IEntityCrud {
271
275
  get cancelBtnFormClass() {
272
276
  return 'text-grey'
273
277
  }
278
+
279
+ get inputVariantCreate(): IEntityCrudFieldVariant {
280
+ return 'outlined'
281
+ }
282
+
283
+ get inputVariantEdit(): IEntityCrudFieldVariant {
284
+ return 'outlined'
285
+ }
286
+
287
+ get inputVariantView(): IEntityCrudFieldVariant {
288
+ return 'filled'
289
+ }
290
+
291
+ get inputVariantDelete() : IEntityCrudFieldVariant{
292
+ return 'underlined'
293
+ }
294
+
295
+
274
296
  }
275
297
 
276
298
  export default EntityCrud;
@@ -26,7 +26,7 @@ const {
26
26
  </v-card-title>
27
27
  <v-card-text>
28
28
  <v-alert v-if="exportError" type="error">
29
- {{ t('export.error.message') }}
29
+ {{ t('error.crud.export') }}
30
30
  </v-alert>
31
31
  <v-table density="compact" v-else>
32
32
  <thead>
@@ -1,7 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import {useI18n} from "vue-i18n";
3
3
  import type {IEntityCrud, IEntityCrudField} from "@drax/crud-share";
4
- import {useFormUtils} from "../composables/UseFormUtils";
5
4
  import {getItemId} from "../helpers/getItemId";
6
5
  import CrudFormField from "./CrudFormField.vue";
7
6
  import {computed, defineEmits, defineProps, ref} from "vue";
@@ -98,9 +97,19 @@ function cancel() {
98
97
  emit('canceled')
99
98
  }
100
99
 
101
- const {
102
- variant
103
- } = useFormUtils(operation.value)
100
+
101
+ const variant = computed(() => {
102
+ if (operation.value === 'create') {
103
+ return entity.inputVariantCreate
104
+ } else if (operation.value === 'edit') {
105
+ return entity.inputVariantEdit
106
+ } else if (operation.value === 'delete') {
107
+ return entity.inputVariantDelete
108
+ } else if (operation.value === 'view') {
109
+ return entity.inputVariantView
110
+ }
111
+ return 'outlined'
112
+ })
104
113
 
105
114
  const tabInputErrors = computed(() => {
106
115
  return (tab:string) => {
@@ -148,6 +148,7 @@ const {xs} = useDisplay()
148
148
  class="text-blue text--darken-3 float-left mt-1 mr-2">
149
149
  <v-icon>mdi-plus</v-icon> {{ label }}
150
150
  </v-btn>
151
+
151
152
  <v-chip-group v-model="itemSelected"
152
153
  :style="{ maxHeight: menuMaxHeight, overflowY: 'auto' }"
153
154
  direction="horizontal"
@@ -155,14 +156,15 @@ const {xs} = useDisplay()
155
156
  >
156
157
  <v-chip v-for="(item,index) in valueModel" :key="index"
157
158
  :value="item" @click="menuSelect(item, index)"
158
- label closable @click:close="removeItem(index)"
159
+ label filter class="pr-0"
159
160
  >
160
- <!-- <template v-slot:prepend>-->
161
- <!-- <v-avatar>{{ index }}</v-avatar>-->
162
- <!-- </template>-->
161
+
163
162
  {{//@ts-ignore
164
163
  valueModel[index][Object.keys(valueModel[index] as any)[0]] || index
165
164
  }}
165
+ <template v-slot:append>
166
+ <v-btn variant="text" class="ml-2" density="compact" icon="mdi-close-circle" @click="removeItem(index)"></v-btn>
167
+ </template>
166
168
  </v-chip>
167
169
 
168
170
  </v-chip-group>