lkt-item-crud 2.0.19 → 2.0.20

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.
@@ -1,6 +1,7 @@
1
- import { ButtonConfig, ItemCrudButtonNavVisibility, ItemCrudMode, ItemCrudView, LktObject } from 'lkt-vue-kernel';
1
+ import { ButtonConfig, ItemCrudButtonNavVisibility, ItemCrudMode, ItemCrudView, LktObject, ModificationView } from 'lkt-vue-kernel';
2
2
  type __VLS_Props = {
3
3
  item: LktObject;
4
+ modifications: LktObject;
4
5
  editing?: boolean;
5
6
  loading?: boolean;
6
7
  grouped?: boolean;
@@ -22,122 +23,53 @@ type __VLS_Props = {
22
23
  perms?: Array<string>;
23
24
  httpSuccessRead?: boolean;
24
25
  buttonNavVisibility: ItemCrudButtonNavVisibility;
26
+ modificationView?: boolean | Array<ModificationView>;
27
+ pickedModificationView: string;
28
+ editableView: ModificationView;
25
29
  };
26
- declare var __VLS_5: {
30
+ declare var __VLS_9: {
27
31
  canUpdate: boolean | undefined;
28
32
  canDrop: boolean | undefined;
29
33
  perms: string[] | undefined;
30
- }, __VLS_7: {
34
+ }, __VLS_11: {
31
35
  canUpdate: boolean | undefined;
32
36
  canDrop: boolean | undefined;
33
37
  perms: string[] | undefined;
34
- }, __VLS_21: {
35
- item: LktObject;
36
- editMode: boolean;
37
- isCreate: boolean;
38
- canUpdate: boolean | undefined;
39
- canDrop: boolean | undefined;
40
- }, __VLS_35: {
41
- item: LktObject;
42
- editMode: boolean;
43
- isCreate: boolean;
44
- canUpdate: boolean | undefined;
45
- canDrop: boolean | undefined;
46
- }, __VLS_49: {
47
- item: LktObject;
48
- editMode: boolean;
49
- isCreate: boolean;
50
- canUpdate: boolean | undefined;
51
- canDrop: boolean | undefined;
52
- }, __VLS_51: {}, __VLS_63: {
38
+ }, __VLS_49: {}, __VLS_65: {
53
39
  canUpdate: boolean | undefined;
54
40
  canDrop: boolean | undefined;
55
41
  perms: string[] | undefined;
56
- }, __VLS_65: {
42
+ }, __VLS_67: {
57
43
  canUpdate: boolean | undefined;
58
44
  canDrop: boolean | undefined;
59
45
  perms: string[] | undefined;
60
- }, __VLS_79: {
61
- item: LktObject;
62
- editMode: boolean;
63
- isCreate: boolean;
64
- canUpdate: boolean | undefined;
65
- canDrop: boolean | undefined;
66
- }, __VLS_93: {
67
- item: LktObject;
68
- editMode: boolean;
69
- isCreate: boolean;
70
- canUpdate: boolean | undefined;
71
- canDrop: boolean | undefined;
72
- }, __VLS_107: {
73
- item: LktObject;
74
- editMode: boolean;
75
- isCreate: boolean;
76
- canUpdate: boolean | undefined;
77
- canDrop: boolean | undefined;
78
- }, __VLS_109: {}, __VLS_111: {
46
+ }, __VLS_105: {}, __VLS_107: {
79
47
  canUpdate: boolean | undefined;
80
48
  canDrop: boolean | undefined;
81
49
  perms: string[] | undefined;
82
- }, __VLS_113: {
50
+ }, __VLS_109: {
83
51
  canUpdate: boolean | undefined;
84
52
  canDrop: boolean | undefined;
85
53
  perms: string[] | undefined;
86
- }, __VLS_127: {
87
- item: LktObject;
88
- editMode: boolean;
89
- isCreate: boolean;
90
- canUpdate: boolean | undefined;
91
- canDrop: boolean | undefined;
92
- }, __VLS_141: {
93
- item: LktObject;
94
- editMode: boolean;
95
- isCreate: boolean;
96
- canUpdate: boolean | undefined;
97
- canDrop: boolean;
98
- }, __VLS_155: {
99
- item: LktObject;
100
- editMode: boolean;
101
- isCreate: boolean;
102
- canUpdate: boolean | undefined;
103
- canDrop: boolean | undefined;
104
- }, __VLS_157: {};
54
+ }, __VLS_147: {};
105
55
  type __VLS_Slots = {} & {
106
- 'prev-buttons-ever'?: (props: typeof __VLS_5) => any;
107
- } & {
108
- 'prev-buttons'?: (props: typeof __VLS_7) => any;
109
- } & {
110
- 'button-save'?: (props: typeof __VLS_21) => any;
111
- } & {
112
- 'button-save'?: (props: typeof __VLS_35) => any;
113
- } & {
114
- 'button-drop'?: (props: typeof __VLS_49) => any;
115
- } & {
116
- buttons?: (props: typeof __VLS_51) => any;
117
- } & {
118
- 'prev-buttons-ever'?: (props: typeof __VLS_63) => any;
119
- } & {
120
- 'prev-buttons'?: (props: typeof __VLS_65) => any;
121
- } & {
122
- 'button-save'?: (props: typeof __VLS_79) => any;
123
- } & {
124
- 'button-save'?: (props: typeof __VLS_93) => any;
56
+ 'prev-buttons-ever'?: (props: typeof __VLS_9) => any;
125
57
  } & {
126
- 'button-drop'?: (props: typeof __VLS_107) => any;
58
+ 'prev-buttons'?: (props: typeof __VLS_11) => any;
127
59
  } & {
128
- buttons?: (props: typeof __VLS_109) => any;
60
+ buttons?: (props: typeof __VLS_49) => any;
129
61
  } & {
130
- 'prev-buttons-ever'?: (props: typeof __VLS_111) => any;
62
+ 'prev-buttons-ever'?: (props: typeof __VLS_65) => any;
131
63
  } & {
132
- 'prev-buttons'?: (props: typeof __VLS_113) => any;
64
+ 'prev-buttons'?: (props: typeof __VLS_67) => any;
133
65
  } & {
134
- 'button-save'?: (props: typeof __VLS_127) => any;
66
+ buttons?: (props: typeof __VLS_105) => any;
135
67
  } & {
136
- 'button-save'?: (props: typeof __VLS_141) => any;
68
+ 'prev-buttons-ever'?: (props: typeof __VLS_107) => any;
137
69
  } & {
138
- 'button-drop'?: (props: typeof __VLS_155) => any;
70
+ 'prev-buttons'?: (props: typeof __VLS_109) => any;
139
71
  } & {
140
- buttons?: (props: typeof __VLS_157) => any;
72
+ buttons?: (props: typeof __VLS_147) => any;
141
73
  };
142
74
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
143
75
  doSave: () => void;
@@ -147,15 +79,18 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
147
79
  create: (...args: any[]) => void;
148
80
  "update:loading": (...args: any[]) => void;
149
81
  "update:editing": (...args: any[]) => void;
82
+ "update:pickedModificationView": (...args: any[]) => void;
150
83
  save: (...args: any[]) => void;
151
84
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
152
85
  onDrop?: ((...args: any[]) => any) | undefined;
153
86
  onCreate?: ((...args: any[]) => any) | undefined;
154
87
  "onUpdate:loading"?: ((...args: any[]) => any) | undefined;
155
88
  "onUpdate:editing"?: ((...args: any[]) => any) | undefined;
89
+ "onUpdate:pickedModificationView"?: ((...args: any[]) => any) | undefined;
156
90
  onSave?: ((...args: any[]) => any) | undefined;
157
91
  }>, {
158
92
  item: LktObject;
93
+ modifications: LktObject;
159
94
  editing: boolean;
160
95
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
161
96
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -0,0 +1,4 @@
1
+ import { FormConfig, LktObject } from 'lkt-vue-kernel';
2
+ import { DataState } from 'lkt-data-state';
3
+ export declare const getModificationsDataState: (value: LktObject, modifications: LktObject, form: FormConfig) => DataState;
4
+ export declare const detectFormFieldsKeys: (form: FormConfig) => string[];
@@ -1,4 +1,4 @@
1
- import { ButtonConfig, ItemCrudButtonNavPosition, ItemCrudConfig, ItemCrudMode, ItemCrudView, LktObject, ModalConfig, NotificationType } from 'lkt-vue-kernel';
1
+ import { ButtonConfig, ItemCrudButtonNavPosition, ItemCrudConfig, ItemCrudMode, ItemCrudView, LktObject, ModalConfig, ModificationView, NotificationType } from 'lkt-vue-kernel';
2
2
  declare var __VLS_17: {
3
3
  canUpdate: boolean | undefined;
4
4
  canDrop: boolean | undefined;
@@ -67,7 +67,8 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
67
67
  "update:modelValue": (...args: any[]) => void;
68
68
  "update:perms": (...args: any[]) => void;
69
69
  "update:customData": (...args: any[]) => void;
70
- "update:form": (...args: any[]) => void;
70
+ "update:modifications": (...args: any[]) => void;
71
+ "update:modificationView": (...args: any[]) => void;
71
72
  "before-save": (...args: any[]) => void;
72
73
  "modified-data": (...args: any[]) => void;
73
74
  }, string, import("vue").PublicProps, Readonly<ItemCrudConfig> & Readonly<{
@@ -81,7 +82,8 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
81
82
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
82
83
  "onUpdate:perms"?: ((...args: any[]) => any) | undefined;
83
84
  "onUpdate:customData"?: ((...args: any[]) => any) | undefined;
84
- "onUpdate:form"?: ((...args: any[]) => any) | undefined;
85
+ "onUpdate:modifications"?: ((...args: any[]) => any) | undefined;
86
+ "onUpdate:modificationView"?: ((...args: any[]) => any) | undefined;
85
87
  "onBefore-save"?: ((...args: any[]) => any) | undefined;
86
88
  "onModified-data"?: ((...args: any[]) => any) | undefined;
87
89
  }>, {
@@ -89,6 +91,7 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
89
91
  form: import("lkt-vue-kernel").FormConfig;
90
92
  title: string;
91
93
  mode: ItemCrudMode;
94
+ modifications: LktObject;
92
95
  modelValue: LktObject;
93
96
  events: {
94
97
  httpStart?: undefined | Function;
@@ -97,6 +100,8 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
97
100
  editing: boolean;
98
101
  perms: import("lkt-vue-kernel").ValidTablePermission[];
99
102
  customData: LktObject;
103
+ visibleView: ModificationView;
104
+ modificationViews: boolean | Array<ModificationView>;
100
105
  editModeButton: ButtonConfig | false;
101
106
  dropButton: ButtonConfig | false;
102
107
  createButton: ButtonConfig | false;
@@ -115,6 +120,7 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
115
120
  enabledSaveWithoutChanges: boolean;
116
121
  redirectOnCreate: string | ((id: number | string) => string);
117
122
  redirectOnDrop: string | (() => string);
123
+ differencesTableConfig: import("lkt-vue-kernel").TableConfig | ((config: import("lkt-vue-kernel").TableConfig) => import("lkt-vue-kernel").TableConfig);
118
124
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
119
125
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
120
126
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "2.0.19",
3
+ "version": "2.0.20",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -1,11 +1,20 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref, SetupContext, useSlots, watch } from 'vue';
3
- import { ButtonConfig, ItemCrudButtonNavVisibility, ItemCrudMode, ItemCrudView, LktObject } from 'lkt-vue-kernel';
3
+ import {
4
+ ButtonConfig,
5
+ ButtonType,
6
+ ItemCrudButtonNavVisibility,
7
+ ItemCrudMode,
8
+ ItemCrudView,
9
+ LktObject,
10
+ ModificationView,
11
+ } from 'lkt-vue-kernel';
4
12
  import { HTTPResponse } from 'lkt-http-client';
5
13
 
6
14
  const emit = defineEmits([
7
15
  'update:loading',
8
16
  'update:editing',
17
+ 'update:pickedModificationView',
9
18
  'create',
10
19
  'save',
11
20
  'drop',
@@ -13,6 +22,7 @@
13
22
 
14
23
  const props = withDefaults(defineProps<{
15
24
  item: LktObject,
25
+ modifications: LktObject,
16
26
  editing?: boolean
17
27
  loading?: boolean
18
28
  grouped?: boolean
@@ -20,11 +30,11 @@
20
30
  view: ItemCrudView
21
31
  mode: ItemCrudMode
22
32
 
23
- createButton?: ButtonConfig|false
24
- updateButton?: ButtonConfig|false
25
- dropButton?: ButtonConfig|false
26
- editModeButton?: ButtonConfig|false
27
- groupButton?: ButtonConfig|boolean
33
+ createButton?: ButtonConfig | false
34
+ updateButton?: ButtonConfig | false
35
+ dropButton?: ButtonConfig | false
36
+ editModeButton?: ButtonConfig | false
37
+ groupButton?: ButtonConfig | boolean
28
38
  groupButtonAsModalActions?: boolean
29
39
 
30
40
  dataChanged: boolean
@@ -40,12 +50,21 @@
40
50
  httpSuccessRead?: boolean
41
51
 
42
52
  buttonNavVisibility: ItemCrudButtonNavVisibility
53
+ modificationView?: boolean | Array<ModificationView>
54
+ pickedModificationView: string
55
+ editableView: ModificationView
43
56
  }>(), {
44
57
  item: () => ({}),
58
+ modifications: () => ({}),
45
59
  editing: false,
46
60
  isLoading: false,
47
61
  });
48
62
 
63
+ const selectedModificationView = ref(props.pickedModificationView);
64
+
65
+ watch(() => props.pickedModificationView, v => selectedModificationView.value = v);
66
+ watch(selectedModificationView, v => emit('update:pickedModificationView', v));
67
+
49
68
  const slots: SetupContext['slots'] = useSlots();
50
69
 
51
70
  const saveButtonRef = ref(<HTMLButtonElement | null>null);
@@ -65,19 +84,24 @@
65
84
  onButtonLoaded = () => {
66
85
  isLoading.value = false;
67
86
  },
68
- onCreate = ($event: Event|undefined, r: HTTPResponse) => {
87
+ onCreate = ($event: Event | undefined, r: HTTPResponse) => {
69
88
  if (typeof $event === 'undefined') return;
70
89
  emit('create', $event, r);
71
90
  },
72
- onSave = ($event: Event|undefined, r: HTTPResponse) => {
91
+ onSave = ($event: Event | undefined, r: HTTPResponse) => {
73
92
  if (typeof $event === 'undefined') return;
74
93
  emit('save', $event, r);
75
94
  },
76
- onDrop = ($event: Event|undefined, r: HTTPResponse) => {
95
+ onDrop = ($event: Event | undefined, r: HTTPResponse) => {
77
96
  if (typeof $event === 'undefined') return;
78
97
  emit('drop', $event, r);
79
98
  };
80
99
 
100
+ const computedUpdateData = computed(() => {
101
+ if (props.editableView === ModificationView.Modifications) return props.modifications;
102
+ return props.item;
103
+ })
104
+
81
105
  const doSave = () => {
82
106
  if (saveButtonRef.value && typeof saveButtonRef.value.click === 'function') saveButtonRef.value.click();
83
107
  },
@@ -124,6 +148,77 @@
124
148
  return showSaveButton.value || showDropButton.value || showSwitchButton.value;
125
149
  });
126
150
 
151
+ const computedModificationView = computed(() => {
152
+ if (props.modificationView === false) return [];
153
+ if (props.modificationView === true) return [
154
+ ModificationView.Current,
155
+ ModificationView.Modifications,
156
+ ModificationView.SplitView,
157
+ ModificationView.Differences,
158
+ ];
159
+ if (Array.isArray(props.modificationView)) return props.modificationView;
160
+ return [];
161
+ }),
162
+ computedModificationSplitButtons = computed(() => {
163
+
164
+ let r = [];
165
+
166
+ if (computedModificationView.value.includes(ModificationView.Current)) {
167
+ r.push({
168
+ text: 'Current',
169
+ icon: 'lkt-icn-see',
170
+ disabled: selectedModificationView.value === ModificationView.Current,
171
+ events: {
172
+ click: () => {
173
+ selectedModificationView.value = ModificationView.Current;
174
+ }
175
+ }
176
+ });
177
+ }
178
+
179
+ if (computedModificationView.value.includes(ModificationView.Modifications)) {
180
+ r.push({
181
+ text: 'Modifications',
182
+ icon: 'lkt-icn-edit',
183
+ disabled: selectedModificationView.value === ModificationView.Modifications,
184
+ events: {
185
+ click: () => {
186
+ selectedModificationView.value = ModificationView.Modifications;
187
+ }
188
+ }
189
+ });
190
+ }
191
+
192
+ if (computedModificationView.value.includes(ModificationView.SplitView)) {
193
+ r.push({
194
+ text: 'Split View',
195
+ icon: 'lkt-icn-columns',
196
+ disabled: selectedModificationView.value === ModificationView.SplitView,
197
+ events: {
198
+ click: () => {
199
+ selectedModificationView.value = ModificationView.SplitView;
200
+ }
201
+ }
202
+ });
203
+ }
204
+
205
+ if (computedModificationView.value.includes(ModificationView.Differences)) {
206
+
207
+ r.push({
208
+ text: 'Differences',
209
+ icon: 'lkt-icn-balance',
210
+ disabled: selectedModificationView.value === ModificationView.Differences,
211
+ events: {
212
+ click: () => {
213
+ selectedModificationView.value = ModificationView.Differences;
214
+ }
215
+ }
216
+ });
217
+ }
218
+
219
+ return r;
220
+ });
221
+
127
222
  </script>
128
223
 
129
224
  <template>
@@ -136,6 +231,19 @@
136
231
  v-model:checked="isEditing"
137
232
  class="lkt-item-crud--switch-mode-button" />
138
233
 
234
+ <lkt-button
235
+ v-if="computedModificationView.length > 0"
236
+ v-bind="<ButtonConfig>{
237
+ type: ButtonType.Tooltip,
238
+ icon: 'lkt-icn-cross-arrows',
239
+ class: 'lkt-item-crud--modifications-button',
240
+ splitButtons: computedModificationSplitButtons,
241
+ tooltip: {
242
+ contentClass: 'lkt-flex-column',
243
+ }
244
+ }"
245
+ />
246
+
139
247
 
140
248
  <template v-if="slots['prev-buttons-ever']" v-show="!isLoading">
141
249
  <slot name="prev-buttons-ever"
@@ -156,32 +264,34 @@
156
264
  <lkt-button
157
265
  ref="saveButtonRef"
158
266
  v-show="mode === ItemCrudMode.Update && showSaveButton"
159
- v-bind="updateButton"
160
- :disabled="!ableToUpdate"
267
+ v-bind="{
268
+ ...updateButton,
269
+ resourceData: {
270
+ ...updateButton?.resourceData,
271
+ ...computedUpdateData
272
+ },
273
+ disabled: !ableToUpdate
274
+ }"
161
275
  @loading="onButtonLoading"
162
276
  @loaded="onButtonLoaded"
163
- @click="onSave">
164
- <slot v-if="!!slots['button-save']" name="button-save" :item="item"
165
- :edit-mode="isEditing"
166
- :is-create="false"
167
- :can-update="canUpdate"
168
- :can-drop="canDrop" />
169
- </lkt-button>
277
+ @click="onSave"
278
+ />
170
279
 
171
280
  <lkt-button
172
281
  ref="saveButtonRef"
173
282
  v-show="mode === ItemCrudMode.Create && showSaveButton"
174
- v-bind="createButton"
175
- :disabled="!ableToCreate"
283
+ v-bind="{
284
+ ...createButton,
285
+ resourceData: {
286
+ ...createButton?.resourceData,
287
+ ...computedUpdateData
288
+ },
289
+ disabled: !ableToCreate
290
+ }"
176
291
  @loading="onButtonLoading"
177
292
  @loaded="onButtonLoaded"
178
- @click="onCreate">
179
- <slot v-if="!!slots['button-save']" name="button-save" :item="item"
180
- :edit-mode="isEditing"
181
- :is-create="true"
182
- :can-update="canUpdate"
183
- :can-drop="canDrop" />
184
- </lkt-button>
293
+ @click="onCreate"
294
+ />
185
295
 
186
296
  <lkt-button
187
297
  ref="dropButtonRef"
@@ -190,13 +300,8 @@
190
300
  :disabled="!ableToDrop"
191
301
  @loading="onButtonLoading"
192
302
  @loaded="onButtonLoaded"
193
- @click="onDrop">
194
- <slot v-if="!!slots['button-drop']" name="button-drop" :item="item"
195
- :edit-mode="isEditing"
196
- :is-create="false"
197
- :can-update="canUpdate"
198
- :can-drop="canDrop" />
199
- </lkt-button>
303
+ @click="onDrop"
304
+ />
200
305
 
201
306
  <template v-if="slots.buttons" v-show="isEditing && !isLoading">
202
307
  <slot name="buttons" />
@@ -215,6 +320,18 @@
215
320
  v-model:checked="isEditing"
216
321
  class="lkt-item-crud--switch-mode-button" />
217
322
 
323
+ <lkt-button
324
+ v-if="computedModificationView.length > 0"
325
+ v-bind="<ButtonConfig>{
326
+ type: ButtonType.Tooltip,
327
+ icon: 'lkt-icn-cross-arrows',
328
+ class: 'lkt-item-crud--modifications-button',
329
+ splitButtons: computedModificationSplitButtons,
330
+ tooltip: {
331
+ contentClass: 'lkt-flex-column',
332
+ }
333
+ }"
334
+ />
218
335
 
219
336
  <template v-if="slots['prev-buttons-ever']" v-show="!isLoading">
220
337
  <slot name="prev-buttons-ever"
@@ -235,32 +352,35 @@
235
352
  <lkt-button
236
353
  ref="saveButtonRef"
237
354
  v-show="mode === ItemCrudMode.Update && showSaveButton"
238
- v-bind="updateButton"
239
- :disabled="!ableToUpdate"
355
+ v-bind="{
356
+ ...updateButton,
357
+ resourceData: {
358
+ ...updateButton?.resourceData,
359
+ ...computedUpdateData
360
+ },
361
+ disabled: !ableToUpdate
362
+ }"
240
363
  @loading="onButtonLoading"
241
364
  @loaded="onButtonLoaded"
242
- @click="onSave">
243
- <slot v-if="!!slots['button-save']" name="button-save" :item="item"
244
- :edit-mode="isEditing"
245
- :is-create="false"
246
- :can-update="canUpdate"
247
- :can-drop="canDrop" />
248
- </lkt-button>
365
+ @click="onSave"
366
+ />
249
367
 
250
368
  <lkt-button
251
369
  ref="saveButtonRef"
252
370
  v-show="mode === ItemCrudMode.Create && showSaveButton"
253
- v-bind="createButton"
371
+ v-bind="{
372
+ ...createButton,
373
+ resourceData: {
374
+ ...createButton?.resourceData,
375
+ ...computedUpdateData
376
+ },
377
+ disabled: !ableToCreate
378
+ }"
254
379
  :disabled="!ableToCreate"
255
380
  @loading="onButtonLoading"
256
381
  @loaded="onButtonLoaded"
257
- @click="onCreate">
258
- <slot v-if="!!slots['button-save']" name="button-save" :item="item"
259
- :edit-mode="isEditing"
260
- :is-create="true"
261
- :can-update="canUpdate"
262
- :can-drop="canDrop" />
263
- </lkt-button>
382
+ @click="onCreate"
383
+ />
264
384
 
265
385
  <lkt-button
266
386
  ref="dropButtonRef"
@@ -269,13 +389,8 @@
269
389
  :disabled="!ableToDrop"
270
390
  @loading="onButtonLoading"
271
391
  @loaded="onButtonLoaded"
272
- @click="onDrop">
273
- <slot v-if="!!slots['button-drop']" name="button-drop" :item="item"
274
- :edit-mode="isEditing"
275
- :is-create="false"
276
- :can-update="canUpdate"
277
- :can-drop="canDrop" />
278
- </lkt-button>
392
+ @click="onDrop"
393
+ />
279
394
 
280
395
  <template v-if="slots.buttons" v-show="isEditing && !isLoading">
281
396
  <slot name="buttons" />
@@ -305,32 +420,34 @@
305
420
  <lkt-button
306
421
  ref="saveButtonRef"
307
422
  v-show="mode === ItemCrudMode.Update && showSaveButton"
308
- v-bind="updateButton"
309
- :disabled="!ableToUpdate"
423
+ v-bind="{
424
+ ...updateButton,
425
+ resourceData: {
426
+ ...updateButton?.resourceData,
427
+ ...computedUpdateData
428
+ },
429
+ disabled: !ableToUpdate
430
+ }"
310
431
  @loading="onButtonLoading"
311
432
  @loaded="onButtonLoaded"
312
- @click="onSave">
313
- <slot v-if="!!slots['button-save']" name="button-save" :item="item"
314
- :edit-mode="isEditing"
315
- :is-create="false"
316
- :can-update="canUpdate"
317
- :can-drop="canDrop" />
318
- </lkt-button>
433
+ @click="onSave"
434
+ />
319
435
 
320
436
  <lkt-button
321
437
  ref="saveButtonRef"
322
438
  v-show="mode === ItemCrudMode.Create && showSaveButton"
323
- v-bind="createButton"
324
- :disabled="!ableToCreate"
439
+ v-bind="{
440
+ ...createButton,
441
+ resourceData: {
442
+ ...createButton?.resourceData,
443
+ ...computedUpdateData
444
+ },
445
+ disabled: !ableToCreate
446
+ }"
325
447
  @loading="onButtonLoading"
326
448
  @loaded="onButtonLoaded"
327
- @click="onCreate">
328
- <slot v-if="!!slots['button-save']" name="button-save" :item="item"
329
- :edit-mode="isEditing"
330
- :is-create="true"
331
- :can-update="canUpdate"
332
- :can-drop="false" />
333
- </lkt-button>
449
+ @click="onCreate"
450
+ />
334
451
 
335
452
  <lkt-button
336
453
  ref="dropButtonRef"
@@ -339,18 +456,26 @@
339
456
  :disabled="!ableToDrop"
340
457
  @loading="onButtonLoading"
341
458
  @loaded="onButtonLoaded"
342
- @click="onDrop">
343
- <slot v-if="!!slots['button-drop']" name="button-drop" :item="item"
344
- :edit-mode="isEditing"
345
- :is-create="false"
346
- :can-update="canUpdate"
347
- :can-drop="canDrop" />
348
- </lkt-button>
459
+ @click="onDrop"
460
+ />
349
461
 
350
462
  <div class="lkt-item-crud-buttons" v-if="slots.buttons" v-show="isEditing && !isLoading">
351
463
  <slot name="buttons" />
352
464
  </div>
353
465
 
466
+ <lkt-button
467
+ v-if="computedModificationView.length > 0"
468
+ v-bind="<ButtonConfig>{
469
+ type: ButtonType.Tooltip,
470
+ icon: 'lkt-icn-cross-arrows',
471
+ class: 'lkt-item-crud--modifications-button',
472
+ splitButtons: computedModificationSplitButtons,
473
+ tooltip: {
474
+ contentClass: 'lkt-flex-column',
475
+ }
476
+ }"
477
+ />
478
+
354
479
  <lkt-button
355
480
  v-if="showSwitchButton"
356
481
  v-bind="editModeButton"