@drax/crud-vue 3.11.0 → 3.13.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.11.0",
6
+ "version": "3.13.0",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -26,8 +26,8 @@
26
26
  "dependencies": {
27
27
  "@drax/common-front": "^3.11.0",
28
28
  "@drax/crud-front": "^3.11.0",
29
- "@drax/crud-share": "^3.11.0",
30
- "@drax/media-vue": "^3.11.0"
29
+ "@drax/crud-share": "^3.13.0",
30
+ "@drax/media-vue": "^3.13.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": "9f9de6fe51c4f11d885385bd31a12edec799823e"
53
+ "gitHead": "5f68eefbcb01c876471e387a815fee1040489c2c"
54
54
  }
@@ -16,7 +16,7 @@ const {entity} = defineProps({
16
16
  const {
17
17
  onView, onCreate, onEdit, onDelete, resetCrudStore,
18
18
  operation, dialog, notify, message, doExport, doImport,
19
- prepareFilters
19
+ prepareFilters, form
20
20
  } = useCrud(entity);
21
21
 
22
22
  onBeforeMount(() => {
@@ -130,7 +130,8 @@ const {xs} = useDisplay()
130
130
 
131
131
  </slot>
132
132
 
133
- <slot name="form">
133
+ <slot name="form" v-bind="{form, operation}">
134
+
134
135
  <crud-form
135
136
  :entity="entity"
136
137
  @created="item => emit('created', item)"
@@ -3,13 +3,14 @@ import type {
3
3
  IDraxPaginateResult,
4
4
  IEntityCrud,
5
5
  IEntityCrudFilter,
6
+ IEntityCrudOperation
6
7
  } from "@drax/crud-share";
7
8
  import {useCrudStore} from "../stores/UseCrudStore";
8
9
  import {computed, nextTick, toRaw} from "vue";
9
10
  import getItemId from "../helpers/getItemId";
10
11
  import {useI18n} from "vue-i18n";
11
12
  import {useRouter} from "vue-router";
12
- import type {IEntityCrudFilterDynamic} from "@drax/crud-share/types/interfaces/IEntityCrudFilterDynamic";
13
+
13
14
 
14
15
  export function useCrud(entity: IEntityCrud) {
15
16
 
@@ -55,6 +56,14 @@ export function useCrud(entity: IEntityCrud) {
55
56
  }
56
57
  })
57
58
 
59
+ const getOperation = computed(() => {
60
+ return store.operation
61
+ })
62
+
63
+ const setOperation = (operation: IEntityCrudOperation) => {
64
+ store.setOperation(operation)
65
+ }
66
+
58
67
  const form = computed({
59
68
  get() {
60
69
  return store.form
@@ -63,6 +72,14 @@ export function useCrud(entity: IEntityCrud) {
63
72
  }
64
73
  })
65
74
 
75
+ const getForm = computed(() => {
76
+ return store.form
77
+ })
78
+
79
+ const setForm = (form: any) => {
80
+ store.setForm(form)
81
+ }
82
+
66
83
  const formValid = computed({
67
84
  get() {
68
85
  return store.formValid
@@ -216,7 +233,7 @@ export function useCrud(entity: IEntityCrud) {
216
233
  })
217
234
 
218
235
  const prepareDynamicFilters = computed(() => {
219
- return store.dynamicFilters.map((filter: IEntityCrudFilterDynamic) => {
236
+ return store.dynamicFilters.map((filter: IEntityCrudFilter) => {
220
237
  return {
221
238
  field: filter.name,
222
239
  operator: filter.operator,
@@ -533,7 +550,9 @@ export function useCrud(entity: IEntityCrud) {
533
550
  return {
534
551
  doPaginate, doExport, doImport, doUpdate, doCreate, doDelete,
535
552
  onView, onCreate, onEdit, onDelete, onCancel, onSubmit, resetCrudStore,
536
- operation, dialog, form, notify, error, paginationError, message, formValid,
553
+ dialog, notify, error, paginationError, message, formValid,
554
+ form, getForm, setForm,
555
+ operation, getOperation, setOperation,
537
556
  loading, itemsPerPage, page, sortBy, search, totalItems, items,
538
557
  prepareFilters, filters, clearFilters, applyFilters,
539
558
  exportFiles, importFiles, exportLoading, importLoading, exportListVisible, importListVisible, exportError, importError,