lkt-item-crud 2.0.24 → 2.0.26

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.
@@ -26,50 +26,54 @@ type __VLS_Props = {
26
26
  modificationView?: boolean | Array<ModificationView>;
27
27
  pickedModificationView: string;
28
28
  editableView: ModificationView;
29
+ navStartButtons?: Array<ButtonConfig>;
30
+ navStartButtonsEditing?: Array<ButtonConfig>;
31
+ navEndButtons?: Array<ButtonConfig>;
32
+ navEndButtonsEditing?: Array<ButtonConfig>;
29
33
  };
30
- declare var __VLS_9: {
34
+ declare var __VLS_13: {
31
35
  canUpdate: boolean | undefined;
32
36
  canDrop: boolean | undefined;
33
37
  perms: string[] | undefined;
34
- }, __VLS_11: {
38
+ }, __VLS_19: {
35
39
  canUpdate: boolean | undefined;
36
40
  canDrop: boolean | undefined;
37
41
  perms: string[] | undefined;
38
- }, __VLS_49: {}, __VLS_65: {
42
+ }, __VLS_57: {}, __VLS_85: {
39
43
  canUpdate: boolean | undefined;
40
44
  canDrop: boolean | undefined;
41
45
  perms: string[] | undefined;
42
- }, __VLS_67: {
46
+ }, __VLS_91: {
43
47
  canUpdate: boolean | undefined;
44
48
  canDrop: boolean | undefined;
45
49
  perms: string[] | undefined;
46
- }, __VLS_105: {}, __VLS_107: {
50
+ }, __VLS_129: {}, __VLS_143: {
47
51
  canUpdate: boolean | undefined;
48
52
  canDrop: boolean | undefined;
49
53
  perms: string[] | undefined;
50
- }, __VLS_109: {
54
+ }, __VLS_149: {
51
55
  canUpdate: boolean | undefined;
52
56
  canDrop: boolean | undefined;
53
57
  perms: string[] | undefined;
54
- }, __VLS_147: {};
58
+ }, __VLS_187: {};
55
59
  type __VLS_Slots = {} & {
56
- 'prev-buttons-ever'?: (props: typeof __VLS_9) => any;
60
+ 'prev-buttons-ever'?: (props: typeof __VLS_13) => any;
57
61
  } & {
58
- 'prev-buttons'?: (props: typeof __VLS_11) => any;
62
+ 'prev-buttons'?: (props: typeof __VLS_19) => any;
59
63
  } & {
60
- buttons?: (props: typeof __VLS_49) => any;
64
+ buttons?: (props: typeof __VLS_57) => any;
61
65
  } & {
62
- 'prev-buttons-ever'?: (props: typeof __VLS_65) => any;
66
+ 'prev-buttons-ever'?: (props: typeof __VLS_85) => any;
63
67
  } & {
64
- 'prev-buttons'?: (props: typeof __VLS_67) => any;
68
+ 'prev-buttons'?: (props: typeof __VLS_91) => any;
65
69
  } & {
66
- buttons?: (props: typeof __VLS_105) => any;
70
+ buttons?: (props: typeof __VLS_129) => any;
67
71
  } & {
68
- 'prev-buttons-ever'?: (props: typeof __VLS_107) => any;
72
+ 'prev-buttons-ever'?: (props: typeof __VLS_143) => any;
69
73
  } & {
70
- 'prev-buttons'?: (props: typeof __VLS_109) => any;
74
+ 'prev-buttons'?: (props: typeof __VLS_149) => any;
71
75
  } & {
72
- buttons?: (props: typeof __VLS_147) => any;
76
+ buttons?: (props: typeof __VLS_187) => any;
73
77
  };
74
78
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
75
79
  doSave: () => void;
@@ -93,12 +93,12 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
93
93
  form: import("lkt-vue-kernel").FormConfig;
94
94
  title: string;
95
95
  mode: ItemCrudMode;
96
- modifications: LktObject;
97
96
  modelValue: LktObject;
98
97
  events: {
99
98
  httpStart?: undefined | Function;
100
99
  httpEnd?: (data: import("lkt-vue-kernel").ClickEventArgs) => void | undefined;
101
100
  };
101
+ modifications: LktObject;
102
102
  editing: boolean;
103
103
  perms: import("lkt-vue-kernel").ValidTablePermission[];
104
104
  customData: LktObject;
@@ -124,6 +124,10 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
124
124
  redirectOnCreate: string | ((id: number | string) => string);
125
125
  redirectOnDrop: string | (() => string);
126
126
  differencesTableConfig: import("lkt-vue-kernel").TableConfig | ((config: import("lkt-vue-kernel").TableConfig) => import("lkt-vue-kernel").TableConfig);
127
+ navStartButtons: Array<ButtonConfig>;
128
+ navStartButtonsEditing: Array<ButtonConfig>;
129
+ navEndButtons: Array<ButtonConfig>;
130
+ navEndButtonsEditing: Array<ButtonConfig>;
127
131
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
128
132
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
129
133
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -53,6 +53,11 @@
53
53
  modificationView?: boolean | Array<ModificationView>
54
54
  pickedModificationView: string
55
55
  editableView: ModificationView
56
+
57
+ navStartButtons?: Array<ButtonConfig>
58
+ navStartButtonsEditing?: Array<ButtonConfig>
59
+ navEndButtons?: Array<ButtonConfig>
60
+ navEndButtonsEditing?: Array<ButtonConfig>
56
61
  }>(), {
57
62
  item: () => ({}),
58
63
  modifications: () => ({}),
@@ -244,6 +249,7 @@
244
249
  }"
245
250
  />
246
251
 
252
+ <lkt-button v-for="btn in navStartButtons" v-bind="btn" v-show="!isLoading"/>
247
253
 
248
254
  <template v-if="slots['prev-buttons-ever']" v-show="!isLoading">
249
255
  <slot name="prev-buttons-ever"
@@ -253,6 +259,8 @@
253
259
  />
254
260
  </template>
255
261
 
262
+ <lkt-button v-for="btn in navStartButtonsEditing" v-bind="btn" v-show="isEditing && !isLoading"/>
263
+
256
264
  <template v-if="slots['prev-buttons']" v-show="isEditing && !isLoading">
257
265
  <slot name="prev-buttons"
258
266
  :can-update="canUpdate"
@@ -306,6 +314,10 @@
306
314
  <template v-if="slots.buttons" v-show="isEditing && !isLoading">
307
315
  <slot name="buttons" />
308
316
  </template>
317
+
318
+ <lkt-button v-for="btn in navEndButtons" v-bind="btn" v-show="!isLoading"/>
319
+
320
+ <lkt-button v-for="btn in navEndButtonsEditing" v-bind="btn" v-show="isEditing && !isLoading"/>
309
321
  </template>
310
322
  <template v-else-if="grouped">
311
323
  <lkt-button
@@ -333,6 +345,8 @@
333
345
  }"
334
346
  />
335
347
 
348
+ <lkt-button v-for="btn in navStartButtons" v-bind="btn" v-show="!isLoading"/>
349
+
336
350
  <template v-if="slots['prev-buttons-ever']" v-show="!isLoading">
337
351
  <slot name="prev-buttons-ever"
338
352
  :can-update="canUpdate"
@@ -341,6 +355,8 @@
341
355
  />
342
356
  </template>
343
357
 
358
+ <lkt-button v-for="btn in navStartButtonsEditing" v-bind="btn" v-show="isEditing && !isLoading"/>
359
+
344
360
  <template v-if="slots['prev-buttons']" v-show="isEditing && !isLoading">
345
361
  <slot name="prev-buttons"
346
362
  :can-update="canUpdate"
@@ -395,12 +411,18 @@
395
411
  <template v-if="slots.buttons" v-show="isEditing && !isLoading">
396
412
  <slot name="buttons" />
397
413
  </template>
414
+
415
+ <lkt-button v-for="btn in navEndButtons" v-bind="btn" v-show="!isLoading"/>
416
+
417
+ <lkt-button v-for="btn in navEndButtonsEditing" v-bind="btn" v-show="isEditing && !isLoading"/>
398
418
  </template>
399
419
  </lkt-button>
400
420
  </template>
401
421
 
402
422
  <template v-else>
403
423
 
424
+ <lkt-button v-for="btn in navStartButtons" v-bind="btn" v-show="!isLoading"/>
425
+
404
426
  <div class="lkt-item-crud-buttons" v-if="slots['prev-buttons-ever']" v-show="!isLoading">
405
427
  <slot name="prev-buttons-ever"
406
428
  :can-update="canUpdate"
@@ -409,6 +431,8 @@
409
431
  />
410
432
  </div>
411
433
 
434
+ <lkt-button v-for="btn in navStartButtonsEditing" v-bind="btn" v-show="isEditing && !isLoading"/>
435
+
412
436
  <div class="lkt-item-crud-buttons" v-if="slots['prev-buttons']" v-show="isEditing && !isLoading">
413
437
  <slot name="prev-buttons"
414
438
  :can-update="canUpdate"
@@ -463,6 +487,10 @@
463
487
  <slot name="buttons" />
464
488
  </div>
465
489
 
490
+ <lkt-button v-for="btn in navEndButtons" v-bind="btn" v-show="!isLoading"/>
491
+
492
+ <lkt-button v-for="btn in navEndButtonsEditing" v-bind="btn" v-show="isEditing && !isLoading"/>
493
+
466
494
  <lkt-button
467
495
  v-if="computedModificationView.length > 0"
468
496
  v-bind="<ButtonConfig>{
@@ -75,9 +75,9 @@
75
75
  itemCreated = ref(false),
76
76
  buttonNav = ref(null),
77
77
  formRef = ref(null),
78
- canUpdate = computed(() => !createMode.value && Array.isArray(permissions.value) && permissions.value.includes(TablePermission.Update)),
79
- canDrop = computed(() => !createMode.value && Array.isArray(permissions.value) && permissions.value.includes(TablePermission.Drop)),
80
- canSwitchEditMode = computed(() => !createMode.value && Array.isArray(permissions.value) && permissions.value.includes(TablePermission.SwitchEditMode));
78
+ canUpdate = computed(() => !createMode.value && props.updateButton !== false && Array.isArray(permissions.value) && permissions.value.includes(TablePermission.Update)),
79
+ canDrop = computed(() => !createMode.value && props.dropButton !== false && Array.isArray(permissions.value) && permissions.value.includes(TablePermission.Drop)),
80
+ canSwitchEditMode = computed(() => props.editModeButton !== false && !createMode.value && Array.isArray(permissions.value) && permissions.value.includes(TablePermission.SwitchEditMode));
81
81
 
82
82
  const pickedModificationView = ref(props.visibleView);
83
83
 
@@ -575,6 +575,10 @@
575
575
  :perms="permissions"
576
576
  :modification-view="computedModificationViews"
577
577
  :editable-view="computedEditableView"
578
+ :nav-start-buttons="navStartButtons"
579
+ :nav-start-buttons-editing="navStartButtonsEditing"
580
+ :nav-end-buttons="navEndButtons"
581
+ :nav-end-buttons-editing="navEndButtonsEditing"
578
582
  @create="onCreate"
579
583
  @save="onUpdate"
580
584
  @drop="onDrop"
@@ -636,6 +640,10 @@
636
640
  :perms="permissions"
637
641
  :modification-view="computedModificationViews"
638
642
  :editable-view="computedEditableView"
643
+ :nav-start-buttons="navStartButtons"
644
+ :nav-start-buttons-editing="navStartButtonsEditing"
645
+ :nav-end-buttons="navEndButtons"
646
+ :nav-end-buttons-editing="navEndButtonsEditing"
639
647
  @create="onCreate"
640
648
  @save="onUpdate"
641
649
  @drop="onDrop"
@@ -735,6 +743,10 @@
735
743
  :perms="permissions"
736
744
  :modification-view="computedModificationViews"
737
745
  :editable-view="computedEditableView"
746
+ :nav-start-buttons="navStartButtons"
747
+ :nav-start-buttons-editing="navStartButtonsEditing"
748
+ :nav-end-buttons="navEndButtons"
749
+ :nav-end-buttons-editing="navEndButtonsEditing"
738
750
  @create="onCreate"
739
751
  @save="onUpdate"
740
752
  @drop="onDrop"