lkt-item-crud 2.0.27 → 2.0.28

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.
@@ -7,21 +7,21 @@ declare var __VLS_17: {
7
7
  canUpdate: boolean | undefined;
8
8
  canDrop: boolean | undefined;
9
9
  perms: string[] | undefined;
10
- }, __VLS_21: {
10
+ }, __VLS_25: {
11
11
  item: LktObject;
12
12
  loading: boolean;
13
- }, __VLS_23: {
13
+ }, __VLS_27: {
14
14
  item: LktObject;
15
15
  loading: boolean;
16
- }, __VLS_36: {
16
+ }, __VLS_40: {
17
17
  canUpdate: boolean | undefined;
18
18
  canDrop: boolean | undefined;
19
19
  perms: string[] | undefined;
20
- }, __VLS_38: {
20
+ }, __VLS_42: {
21
21
  canUpdate: boolean | undefined;
22
22
  canDrop: boolean | undefined;
23
23
  perms: string[] | undefined;
24
- }, __VLS_55: string, __VLS_56: {}, __VLS_58: {
24
+ }, __VLS_59: string, __VLS_60: {}, __VLS_62: {
25
25
  item: LktObject;
26
26
  loading: false;
27
27
  editMode: boolean;
@@ -30,27 +30,27 @@ declare var __VLS_17: {
30
30
  canDrop: boolean;
31
31
  itemBeingEdited: boolean;
32
32
  perms: string[];
33
- }, __VLS_79: {}, __VLS_81: {};
33
+ }, __VLS_83: {}, __VLS_85: {};
34
34
  type __VLS_Slots = {} & {
35
- [K in NonNullable<typeof __VLS_55>]?: (props: typeof __VLS_56) => any;
35
+ [K in NonNullable<typeof __VLS_59>]?: (props: typeof __VLS_60) => any;
36
36
  } & {
37
37
  'prev-buttons-ever'?: (props: typeof __VLS_17) => any;
38
38
  } & {
39
39
  'prev-buttons'?: (props: typeof __VLS_19) => any;
40
40
  } & {
41
- 'pre-title'?: (props: typeof __VLS_21) => any;
41
+ 'pre-title'?: (props: typeof __VLS_25) => any;
42
42
  } & {
43
- 'post-title'?: (props: typeof __VLS_23) => any;
43
+ 'post-title'?: (props: typeof __VLS_27) => any;
44
44
  } & {
45
- 'prev-buttons-ever'?: (props: typeof __VLS_36) => any;
45
+ 'prev-buttons-ever'?: (props: typeof __VLS_40) => any;
46
46
  } & {
47
- 'prev-buttons'?: (props: typeof __VLS_38) => any;
47
+ 'prev-buttons'?: (props: typeof __VLS_42) => any;
48
48
  } & {
49
- item?: (props: typeof __VLS_58) => any;
49
+ item?: (props: typeof __VLS_62) => any;
50
50
  } & {
51
- 'prev-buttons-ever'?: (props: typeof __VLS_79) => any;
51
+ 'prev-buttons-ever'?: (props: typeof __VLS_83) => any;
52
52
  } & {
53
- 'prev-buttons'?: (props: typeof __VLS_81) => any;
53
+ 'prev-buttons'?: (props: typeof __VLS_85) => any;
54
54
  };
55
55
  declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
56
56
  doDrop: () => void;
@@ -91,6 +91,7 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
91
91
  }>, {
92
92
  view: ItemCrudView;
93
93
  form: import("lkt-vue-kernel").FormConfig;
94
+ header: import("lkt-vue-kernel").HeaderConfig;
94
95
  title: string;
95
96
  mode: ItemCrudMode;
96
97
  modelValue: LktObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "2.0.27",
3
+ "version": "2.0.28",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -453,6 +453,11 @@
453
453
 
454
454
  return computedTitle.value.length > 0 || !!slots['post-title'];
455
455
  }),
456
+ displayLktHeader = computed(() => {
457
+ if (isLoading.value) return false;
458
+ return typeof props.header === 'object'
459
+ && Object.keys(props.header).length > 0;
460
+ }),
456
461
  computedInsideModal = computed(() => {
457
462
  return props.view === ItemCrudView.Modal;
458
463
  }),
@@ -600,88 +605,88 @@
600
605
  </button-nav>
601
606
  </template>
602
607
 
603
- <article class="lkt-item-crud">
604
- <header class="lkt-item-crud_header" v-if="!computedInsideModal && displayHeader">
605
- <div class="lkt-item-crud_header-slot" v-if="slots['pre-title']">
606
- <slot name="pre-title" :item="item" :loading="isLoading" />
607
- </div>
608
- <h1 class="lkt-item-crud_header-title" v-if="computedTitle.length > 0">{{ computedTitle }}</h1>
609
- <div class="lkt-item-crud_header-slot" v-if="slots['post-title']">
610
- <slot name="post-title" :item="item" :loading="isLoading" />
611
- </div>
612
- </header>
613
-
614
- <button-nav
615
- ref="buttonNav"
616
- v-if="buttonNavPosition === ItemCrudButtonNavPosition.Top && (groupButton === false || !groupButtonAsModalActions) && computedHasButtons"
617
- v-model:loading="isLoading"
618
- v-model:editing="editMode"
619
- v-model:picked-modification-view="pickedModificationView"
620
- :item="item"
621
- :modifications="itemModifications"
622
- :mode="mode"
623
- :view="view"
624
- :grouped="groupButton !== false"
625
- :button-nav-visibility="buttonNavVisibility"
626
- :create-button="safeCreateButton"
627
- :update-button="safeUpdateButton"
628
- :drop-button="safeDropButton"
629
- :edit-mode-button="safeEditModeButton"
630
- :group-button="safeGroupButton"
631
- :data-changed="dataChanged"
632
- :http-success-read="httpSuccessRead"
633
- :can-update="canUpdate"
634
- :can-drop="canDrop"
635
- :can-switch-edit-mode="canSwitchEditMode"
636
- :group-button-as-modal-actions="groupButtonAsModalActions"
637
- :able-to-create="ableToCreate"
638
- :able-to-update="ableToUpdate"
639
- :able-to-drop="ableToDrop"
640
- :perms="permissions"
641
- :modification-view="computedModificationViews"
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"
647
- @create="onCreate"
648
- @save="onUpdate"
649
- @drop="onDrop"
650
- >
651
- <template #prev-buttons-ever="{canUpdate, canDrop, perms}" v-if="slots['prev-buttons-ever']">
652
- <slot name="prev-buttons-ever"
653
- :can-update="canUpdate"
654
- :can-drop="canDrop"
655
- :perms="perms"
656
- />
657
- </template>
658
- <template #prev-buttons="{canUpdate, canDrop, perms}" v-if="slots['prev-buttons']">
659
- <slot name="prev-buttons"
660
- :can-update="canUpdate"
661
- :can-drop="canDrop"
662
- :perms="perms"
663
- />
664
- </template>
665
- </button-nav>
666
-
667
- <div class="lkt-item-crud_content" v-if="!isLoading">
668
- <div v-if="httpSuccessRead" class="lkt-grid-1">
669
- <lkt-http-info
670
- v-if="showStoreMessage && notificationType === NotificationType.Inline"
671
- :code="httpStatus"
672
- :palette="httpStatus === 200 ? 'success' : 'danger'"
673
- quick
674
- can-close
675
- v-on:close="showStoreMessage = false" />
676
-
677
- <template v-if="computedHasForm">
678
- <lkt-form
679
- ref="formRef"
680
- v-model="item"
681
- v-model:modifications="itemModifications"
682
- v-model:valid="validForm"
683
- v-model:changed="changedForm"
684
- v-bind="<FormUiConfig>{
608
+ <lkt-header v-if="!computedInsideModal && displayLktHeader" v-bind="header"/>
609
+ <header class="lkt-item-crud_header" v-else-if="!computedInsideModal && displayHeader">
610
+ <div class="lkt-item-crud_header-slot" v-if="slots['pre-title']">
611
+ <slot name="pre-title" :item="item" :loading="isLoading" />
612
+ </div>
613
+ <h1 class="lkt-item-crud_header-title" v-if="computedTitle.length > 0">{{ computedTitle }}</h1>
614
+ <div class="lkt-item-crud_header-slot" v-if="slots['post-title']">
615
+ <slot name="post-title" :item="item" :loading="isLoading" />
616
+ </div>
617
+ </header>
618
+
619
+ <button-nav
620
+ ref="buttonNav"
621
+ v-if="buttonNavPosition === ItemCrudButtonNavPosition.Top && (groupButton === false || !groupButtonAsModalActions) && computedHasButtons"
622
+ v-model:loading="isLoading"
623
+ v-model:editing="editMode"
624
+ v-model:picked-modification-view="pickedModificationView"
625
+ :item="item"
626
+ :modifications="itemModifications"
627
+ :mode="mode"
628
+ :view="view"
629
+ :grouped="groupButton !== false"
630
+ :button-nav-visibility="buttonNavVisibility"
631
+ :create-button="safeCreateButton"
632
+ :update-button="safeUpdateButton"
633
+ :drop-button="safeDropButton"
634
+ :edit-mode-button="safeEditModeButton"
635
+ :group-button="safeGroupButton"
636
+ :data-changed="dataChanged"
637
+ :http-success-read="httpSuccessRead"
638
+ :can-update="canUpdate"
639
+ :can-drop="canDrop"
640
+ :can-switch-edit-mode="canSwitchEditMode"
641
+ :group-button-as-modal-actions="groupButtonAsModalActions"
642
+ :able-to-create="ableToCreate"
643
+ :able-to-update="ableToUpdate"
644
+ :able-to-drop="ableToDrop"
645
+ :perms="permissions"
646
+ :modification-view="computedModificationViews"
647
+ :editable-view="computedEditableView"
648
+ :nav-start-buttons="navStartButtons"
649
+ :nav-start-buttons-editing="navStartButtonsEditing"
650
+ :nav-end-buttons="navEndButtons"
651
+ :nav-end-buttons-editing="navEndButtonsEditing"
652
+ @create="onCreate"
653
+ @save="onUpdate"
654
+ @drop="onDrop"
655
+ >
656
+ <template #prev-buttons-ever="{canUpdate, canDrop, perms}" v-if="slots['prev-buttons-ever']">
657
+ <slot name="prev-buttons-ever"
658
+ :can-update="canUpdate"
659
+ :can-drop="canDrop"
660
+ :perms="perms"
661
+ />
662
+ </template>
663
+ <template #prev-buttons="{canUpdate, canDrop, perms}" v-if="slots['prev-buttons']">
664
+ <slot name="prev-buttons"
665
+ :can-update="canUpdate"
666
+ :can-drop="canDrop"
667
+ :perms="perms"
668
+ />
669
+ </template>
670
+ </button-nav>
671
+
672
+ <div class="lkt-item-crud_content" v-if="!isLoading">
673
+ <div v-if="httpSuccessRead" class="lkt-grid-1">
674
+ <lkt-http-info
675
+ v-if="showStoreMessage && notificationType === NotificationType.Inline"
676
+ :code="httpStatus"
677
+ :palette="httpStatus === 200 ? 'success' : 'danger'"
678
+ quick
679
+ can-close
680
+ v-on:close="showStoreMessage = false" />
681
+
682
+ <template v-if="computedHasForm">
683
+ <lkt-form
684
+ ref="formRef"
685
+ v-model="item"
686
+ v-model:modifications="itemModifications"
687
+ v-model:valid="validForm"
688
+ v-model:changed="changedForm"
689
+ v-bind="<FormUiConfig>{
685
690
  ...formUiConfig,
686
691
  form,
687
692
  differencesTableConfig,
@@ -690,74 +695,73 @@
690
695
  editableViews: [computedEditableView],
691
696
  disabled: !editMode,
692
697
  }"
693
- >
694
- <template v-for="formSlot in computedFormSlots" v-slot:[formSlot]="{}">
695
- <slot :name="formSlot"/>
696
- </template>
697
- </lkt-form>
698
- </template>
699
-
700
- <template v-else>
701
- <slot name="item"
702
- :item="item"
703
- :loading="isLoading"
704
- :edit-mode="editMode"
705
- :is-create="createMode"
706
- :can-update="canUpdate"
707
- :can-drop="canDrop"
708
- :item-being-edited="itemBeingEdited"
709
- :perms="permissions"
710
- />
711
- </template>
712
- </div>
713
- <lkt-http-info :code="httpStatus" v-else-if="notificationType === NotificationType.Inline" />
714
- </div>
715
- <lkt-loader v-if="isLoading" />
716
-
717
- <button-nav
718
- ref="buttonNav"
719
- v-if="buttonNavPosition === ItemCrudButtonNavPosition.Bottom && (groupButton === false || !groupButtonAsModalActions) && computedHasButtons"
720
- v-model:loading="isLoading"
721
- v-model:editing="editMode"
722
- v-model:picked-modification-view="pickedModificationView"
723
- :item="item"
724
- :modifications="itemModifications"
725
- :mode="mode"
726
- :view="view"
727
- :grouped="groupButton !== false"
728
- :button-nav-visibility="buttonNavVisibility"
729
- :create-button="safeCreateButton"
730
- :update-button="safeUpdateButton"
731
- :drop-button="safeDropButton"
732
- :edit-mode-button="safeEditModeButton"
733
- :group-button="safeGroupButton"
734
- :data-changed="dataChanged"
735
- :http-success-read="httpSuccessRead"
736
- :can-update="canUpdate"
737
- :can-drop="canDrop"
738
- :can-switch-edit-mode="canSwitchEditMode"
739
- :group-button-as-modal-actions="groupButtonAsModalActions"
740
- :able-to-create="ableToCreate"
741
- :able-to-update="ableToUpdate"
742
- :able-to-drop="ableToDrop"
743
- :perms="permissions"
744
- :modification-view="computedModificationViews"
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"
750
- @create="onCreate"
751
- @save="onUpdate"
752
- @drop="onDrop"
753
- >
754
- <template #prev-buttons-ever v-if="slots['prev-buttons-ever']">
755
- <slot name="prev-buttons-ever" />
698
+ >
699
+ <template v-for="formSlot in computedFormSlots" v-slot:[formSlot]="{}">
700
+ <slot :name="formSlot"/>
701
+ </template>
702
+ </lkt-form>
756
703
  </template>
757
- <template #prev-buttons-ever v-if="slots['prev-buttons']">
758
- <slot name="prev-buttons" />
704
+
705
+ <template v-else>
706
+ <slot name="item"
707
+ :item="item"
708
+ :loading="isLoading"
709
+ :edit-mode="editMode"
710
+ :is-create="createMode"
711
+ :can-update="canUpdate"
712
+ :can-drop="canDrop"
713
+ :item-being-edited="itemBeingEdited"
714
+ :perms="permissions"
715
+ />
759
716
  </template>
760
- </button-nav>
761
- </article>
717
+ </div>
718
+ <lkt-http-info :code="httpStatus" v-else-if="notificationType === NotificationType.Inline" />
719
+ </div>
720
+ <lkt-loader v-if="isLoading" />
721
+
722
+ <button-nav
723
+ ref="buttonNav"
724
+ v-if="buttonNavPosition === ItemCrudButtonNavPosition.Bottom && (groupButton === false || !groupButtonAsModalActions) && computedHasButtons"
725
+ v-model:loading="isLoading"
726
+ v-model:editing="editMode"
727
+ v-model:picked-modification-view="pickedModificationView"
728
+ :item="item"
729
+ :modifications="itemModifications"
730
+ :mode="mode"
731
+ :view="view"
732
+ :grouped="groupButton !== false"
733
+ :button-nav-visibility="buttonNavVisibility"
734
+ :create-button="safeCreateButton"
735
+ :update-button="safeUpdateButton"
736
+ :drop-button="safeDropButton"
737
+ :edit-mode-button="safeEditModeButton"
738
+ :group-button="safeGroupButton"
739
+ :data-changed="dataChanged"
740
+ :http-success-read="httpSuccessRead"
741
+ :can-update="canUpdate"
742
+ :can-drop="canDrop"
743
+ :can-switch-edit-mode="canSwitchEditMode"
744
+ :group-button-as-modal-actions="groupButtonAsModalActions"
745
+ :able-to-create="ableToCreate"
746
+ :able-to-update="ableToUpdate"
747
+ :able-to-drop="ableToDrop"
748
+ :perms="permissions"
749
+ :modification-view="computedModificationViews"
750
+ :editable-view="computedEditableView"
751
+ :nav-start-buttons="navStartButtons"
752
+ :nav-start-buttons-editing="navStartButtonsEditing"
753
+ :nav-end-buttons="navEndButtons"
754
+ :nav-end-buttons-editing="navEndButtonsEditing"
755
+ @create="onCreate"
756
+ @save="onUpdate"
757
+ @drop="onDrop"
758
+ >
759
+ <template #prev-buttons-ever v-if="slots['prev-buttons-ever']">
760
+ <slot name="prev-buttons-ever" />
761
+ </template>
762
+ <template #prev-buttons-ever v-if="slots['prev-buttons']">
763
+ <slot name="prev-buttons" />
764
+ </template>
765
+ </button-nav>
762
766
  </component>
763
767
  </template>