lkt-item-crud 2.0.31 → 2.0.33
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.
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
view: ItemCrudView;
|
|
9
9
|
mode: ItemCrudMode;
|
|
10
10
|
createButton?: ButtonConfig | false;
|
|
11
|
+
createAndNewButton?: ButtonConfig | false;
|
|
11
12
|
updateButton?: ButtonConfig | false;
|
|
12
13
|
dropButton?: ButtonConfig | false;
|
|
13
14
|
editModeButton?: ButtonConfig | false;
|
|
@@ -15,6 +16,7 @@ type __VLS_Props = {
|
|
|
15
16
|
groupButtonAsModalActions?: boolean;
|
|
16
17
|
dataChanged: boolean;
|
|
17
18
|
ableToCreate?: boolean;
|
|
19
|
+
ableToCreateAndNew?: boolean;
|
|
18
20
|
ableToUpdate?: boolean;
|
|
19
21
|
ableToDrop?: boolean;
|
|
20
22
|
canCreate?: boolean;
|
|
@@ -40,41 +42,41 @@ declare var __VLS_13: {
|
|
|
40
42
|
canUpdate: boolean | undefined;
|
|
41
43
|
canDrop: boolean | undefined;
|
|
42
44
|
perms: string[] | undefined;
|
|
43
|
-
},
|
|
45
|
+
}, __VLS_69: {}, __VLS_97: {
|
|
44
46
|
canUpdate: boolean | undefined;
|
|
45
47
|
canDrop: boolean | undefined;
|
|
46
48
|
perms: string[] | undefined;
|
|
47
|
-
},
|
|
49
|
+
}, __VLS_103: {
|
|
48
50
|
canUpdate: boolean | undefined;
|
|
49
51
|
canDrop: boolean | undefined;
|
|
50
52
|
perms: string[] | undefined;
|
|
51
|
-
},
|
|
53
|
+
}, __VLS_153: {}, __VLS_167: {
|
|
52
54
|
canUpdate: boolean | undefined;
|
|
53
55
|
canDrop: boolean | undefined;
|
|
54
56
|
perms: string[] | undefined;
|
|
55
|
-
},
|
|
57
|
+
}, __VLS_173: {
|
|
56
58
|
canUpdate: boolean | undefined;
|
|
57
59
|
canDrop: boolean | undefined;
|
|
58
60
|
perms: string[] | undefined;
|
|
59
|
-
},
|
|
61
|
+
}, __VLS_223: {};
|
|
60
62
|
type __VLS_Slots = {} & {
|
|
61
63
|
'prev-buttons-ever'?: (props: typeof __VLS_13) => any;
|
|
62
64
|
} & {
|
|
63
65
|
'prev-buttons'?: (props: typeof __VLS_19) => any;
|
|
64
66
|
} & {
|
|
65
|
-
buttons?: (props: typeof
|
|
67
|
+
buttons?: (props: typeof __VLS_69) => any;
|
|
66
68
|
} & {
|
|
67
|
-
'prev-buttons-ever'?: (props: typeof
|
|
69
|
+
'prev-buttons-ever'?: (props: typeof __VLS_97) => any;
|
|
68
70
|
} & {
|
|
69
|
-
'prev-buttons'?: (props: typeof
|
|
71
|
+
'prev-buttons'?: (props: typeof __VLS_103) => any;
|
|
70
72
|
} & {
|
|
71
|
-
buttons?: (props: typeof
|
|
73
|
+
buttons?: (props: typeof __VLS_153) => any;
|
|
72
74
|
} & {
|
|
73
|
-
'prev-buttons-ever'?: (props: typeof
|
|
75
|
+
'prev-buttons-ever'?: (props: typeof __VLS_167) => any;
|
|
74
76
|
} & {
|
|
75
|
-
'prev-buttons'?: (props: typeof
|
|
77
|
+
'prev-buttons'?: (props: typeof __VLS_173) => any;
|
|
76
78
|
} & {
|
|
77
|
-
buttons?: (props: typeof
|
|
79
|
+
buttons?: (props: typeof __VLS_223) => any;
|
|
78
80
|
};
|
|
79
81
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
80
82
|
doSave: () => void;
|
|
@@ -95,6 +95,7 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
|
|
|
95
95
|
title: string;
|
|
96
96
|
mode: ItemCrudMode;
|
|
97
97
|
modelValue: LktObject;
|
|
98
|
+
createButton: ButtonConfig | false;
|
|
98
99
|
events: {
|
|
99
100
|
httpStart?: undefined | Function;
|
|
100
101
|
httpEnd?: (data: import("lkt-vue-kernel").ClickEventArgs) => void | undefined;
|
|
@@ -108,7 +109,7 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
|
|
|
108
109
|
modificationViews: boolean | Array<ModificationView>;
|
|
109
110
|
editModeButton: ButtonConfig | false;
|
|
110
111
|
dropButton: ButtonConfig | false;
|
|
111
|
-
|
|
112
|
+
createAndNewButton: ButtonConfig | false;
|
|
112
113
|
updateButton: ButtonConfig | false;
|
|
113
114
|
groupButton: ButtonConfig | boolean;
|
|
114
115
|
groupButtonAsModalActions: boolean;
|
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
mode: ItemCrudMode
|
|
32
32
|
|
|
33
33
|
createButton?: ButtonConfig | false
|
|
34
|
+
createAndNewButton?: ButtonConfig | false
|
|
34
35
|
updateButton?: ButtonConfig | false
|
|
35
36
|
dropButton?: ButtonConfig | false
|
|
36
37
|
editModeButton?: ButtonConfig | false
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
dataChanged: boolean
|
|
41
42
|
|
|
42
43
|
ableToCreate?: boolean
|
|
44
|
+
ableToCreateAndNew?: boolean
|
|
43
45
|
ableToUpdate?: boolean
|
|
44
46
|
ableToDrop?: boolean
|
|
45
47
|
canCreate?: boolean
|
|
@@ -302,6 +304,22 @@
|
|
|
302
304
|
@click="onCreate"
|
|
303
305
|
/>
|
|
304
306
|
|
|
307
|
+
<lkt-button
|
|
308
|
+
ref="saveButtonRef"
|
|
309
|
+
v-show="mode === ItemCrudMode.Create && showSaveButton && ableToCreateAndNew"
|
|
310
|
+
v-bind="{
|
|
311
|
+
...createAndNewButton,
|
|
312
|
+
resourceData: {
|
|
313
|
+
...createAndNewButton?.resourceData,
|
|
314
|
+
...computedUpdateData
|
|
315
|
+
},
|
|
316
|
+
disabled: !ableToCreate
|
|
317
|
+
}"
|
|
318
|
+
@loading="onButtonLoading"
|
|
319
|
+
@loaded="onButtonLoaded"
|
|
320
|
+
@click="onCreate"
|
|
321
|
+
/>
|
|
322
|
+
|
|
305
323
|
<lkt-button
|
|
306
324
|
ref="dropButtonRef"
|
|
307
325
|
v-show="showDropButton && mode !== ItemCrudMode.Create"
|
|
@@ -399,6 +417,23 @@
|
|
|
399
417
|
@click="onCreate"
|
|
400
418
|
/>
|
|
401
419
|
|
|
420
|
+
<lkt-button
|
|
421
|
+
ref="saveButtonRef"
|
|
422
|
+
v-show="mode === ItemCrudMode.Create && showSaveButton && ableToCreateAndNew"
|
|
423
|
+
v-bind="{
|
|
424
|
+
...createAndNewButton,
|
|
425
|
+
resourceData: {
|
|
426
|
+
...createAndNewButton?.resourceData,
|
|
427
|
+
...computedUpdateData
|
|
428
|
+
},
|
|
429
|
+
disabled: !ableToCreate
|
|
430
|
+
}"
|
|
431
|
+
:disabled="!ableToCreate"
|
|
432
|
+
@loading="onButtonLoading"
|
|
433
|
+
@loaded="onButtonLoaded"
|
|
434
|
+
@click="onCreate"
|
|
435
|
+
/>
|
|
436
|
+
|
|
402
437
|
<lkt-button
|
|
403
438
|
ref="dropButtonRef"
|
|
404
439
|
v-show="showDropButton && mode !== ItemCrudMode.Create"
|
|
@@ -474,6 +509,22 @@
|
|
|
474
509
|
@click="onCreate"
|
|
475
510
|
/>
|
|
476
511
|
|
|
512
|
+
<lkt-button
|
|
513
|
+
ref="saveButtonRef"
|
|
514
|
+
v-show="mode === ItemCrudMode.Create && showSaveButton && ableToCreateAndNew"
|
|
515
|
+
v-bind="{
|
|
516
|
+
...createAndNewButton,
|
|
517
|
+
resourceData: {
|
|
518
|
+
...createAndNewButton?.resourceData,
|
|
519
|
+
...computedUpdateData
|
|
520
|
+
},
|
|
521
|
+
disabled: !ableToCreate
|
|
522
|
+
}"
|
|
523
|
+
@loading="onButtonLoading"
|
|
524
|
+
@loaded="onButtonLoaded"
|
|
525
|
+
@click="onCreate"
|
|
526
|
+
/>
|
|
527
|
+
|
|
477
528
|
<lkt-button
|
|
478
529
|
ref="dropButtonRef"
|
|
479
530
|
v-show="showDropButton && mode !== ItemCrudMode.Create"
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
}, {deep: true});
|
|
117
117
|
|
|
118
118
|
const safeCreateButton = ref(ensureButtonConfig(props.createButton, LktSettings.defaultCreateButton)),
|
|
119
|
+
safeCreateAndNewButton = ref(ensureButtonConfig(props.createAndNewButton, props.createButton)),
|
|
119
120
|
safeUpdateButton = ref(ensureButtonConfig(props.updateButton, LktSettings.defaultUpdateButton)),
|
|
120
121
|
safeDropButton = ref(ensureButtonConfig(props.dropButton, LktSettings.defaultDropButton)),
|
|
121
122
|
safeEditModeButton = ref(ensureButtonConfig(props.editModeButton, LktSettings.defaultEditModeButton)),
|
|
@@ -490,6 +491,12 @@
|
|
|
490
491
|
|
|
491
492
|
return true;
|
|
492
493
|
}),
|
|
494
|
+
ableToCreateAndNew = computed(() => {
|
|
495
|
+
return props.createAndNewButton !== false
|
|
496
|
+
&& typeof props.createAndNewButton === 'object'
|
|
497
|
+
&& !Array.isArray(props.createAndNewButton)
|
|
498
|
+
&& Object.keys(props.createAndNewButton).length > 0;
|
|
499
|
+
}),
|
|
493
500
|
ableToDrop = computed(() => {
|
|
494
501
|
|
|
495
502
|
if (!canDrop.value) return false;
|
|
@@ -547,7 +554,8 @@
|
|
|
547
554
|
mode: props.mode,
|
|
548
555
|
view: pickedModificationView.value,
|
|
549
556
|
item: item.value,
|
|
550
|
-
modifications: itemModifications.value
|
|
557
|
+
modifications: itemModifications.value,
|
|
558
|
+
editing: editMode.value
|
|
551
559
|
});
|
|
552
560
|
return props.form;
|
|
553
561
|
})
|
|
@@ -573,6 +581,7 @@
|
|
|
573
581
|
:grouped="true"
|
|
574
582
|
:button-nav-visibility="buttonNavVisibility"
|
|
575
583
|
:create-button="safeCreateButton"
|
|
584
|
+
:create-and-new-button="safeCreateAndNewButton"
|
|
576
585
|
:update-button="safeUpdateButton"
|
|
577
586
|
:drop-button="safeDropButton"
|
|
578
587
|
:edit-mode-button="safeEditModeButton"
|
|
@@ -585,6 +594,7 @@
|
|
|
585
594
|
:can-switch-edit-mode="canSwitchEditMode"
|
|
586
595
|
:group-button-as-modal-actions="groupButtonAsModalActions"
|
|
587
596
|
:able-to-create="ableToCreate"
|
|
597
|
+
:able-to-create-and-new="ableToCreateAndNew"
|
|
588
598
|
:able-to-update="ableToUpdate"
|
|
589
599
|
:able-to-drop="ableToDrop"
|
|
590
600
|
:perms="permissions"
|
|
@@ -639,6 +649,7 @@
|
|
|
639
649
|
:grouped="groupButton !== false"
|
|
640
650
|
:button-nav-visibility="buttonNavVisibility"
|
|
641
651
|
:create-button="safeCreateButton"
|
|
652
|
+
:create-and-new-button="safeCreateAndNewButton"
|
|
642
653
|
:update-button="safeUpdateButton"
|
|
643
654
|
:drop-button="safeDropButton"
|
|
644
655
|
:edit-mode-button="safeEditModeButton"
|
|
@@ -651,6 +662,7 @@
|
|
|
651
662
|
:can-switch-edit-mode="canSwitchEditMode"
|
|
652
663
|
:group-button-as-modal-actions="groupButtonAsModalActions"
|
|
653
664
|
:able-to-create="ableToCreate"
|
|
665
|
+
:able-to-create-and-new="ableToCreateAndNew"
|
|
654
666
|
:able-to-update="ableToUpdate"
|
|
655
667
|
:able-to-drop="ableToDrop"
|
|
656
668
|
:perms="permissions"
|
|
@@ -743,6 +755,7 @@
|
|
|
743
755
|
:grouped="groupButton !== false"
|
|
744
756
|
:button-nav-visibility="buttonNavVisibility"
|
|
745
757
|
:create-button="safeCreateButton"
|
|
758
|
+
:create-and-new-button="safeCreateAndNewButton"
|
|
746
759
|
:update-button="safeUpdateButton"
|
|
747
760
|
:drop-button="safeDropButton"
|
|
748
761
|
:edit-mode-button="safeEditModeButton"
|
|
@@ -755,6 +768,7 @@
|
|
|
755
768
|
:can-switch-edit-mode="canSwitchEditMode"
|
|
756
769
|
:group-button-as-modal-actions="groupButtonAsModalActions"
|
|
757
770
|
:able-to-create="ableToCreate"
|
|
771
|
+
:able-to-create-and-new="ableToCreateAndNew"
|
|
758
772
|
:able-to-update="ableToUpdate"
|
|
759
773
|
:able-to-drop="ableToDrop"
|
|
760
774
|
:perms="permissions"
|