@katlux/toolkit 0.1.1-alpha.110 → 0.1.1-alpha.112

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.
Files changed (139) hide show
  1. package/dist/compiled/composables/locales.mjs +195 -27
  2. package/dist/compiled/composables/useDataProvider.mjs +129 -82
  3. package/dist/compiled/composables/useDataProvider.spec.mjs +20 -1
  4. package/dist/compiled/composables/useKatluxContext.mjs +21 -0
  5. package/dist/compiled/composables/useKatluxContext.spec.mjs +63 -0
  6. package/dist/compiled/composables/useKatluxI18n.mjs +20 -9
  7. package/dist/compiled/composables/usePresetComponent.mjs +12 -3
  8. package/dist/compiled/composables/useRequestQueue.mjs +35 -0
  9. package/dist/compiled/utils/PresetResolver.mjs +21 -7
  10. package/dist/compiled/utils/TemplateResolver.mjs +11 -5
  11. package/dist/module.cjs +3 -31
  12. package/dist/module.json +1 -1
  13. package/dist/module.mjs +4 -32
  14. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +1 -1
  15. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +29 -2
  16. package/dist/runtime/components/KCombobox/KCombobox.global.vue +18 -1
  17. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +29 -2
  18. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +25 -0
  19. package/dist/runtime/components/KCombobox/KCombobox.logic.js +298 -15
  20. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +3 -3
  21. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +3 -3
  22. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +1 -1
  23. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +6 -5
  24. package/dist/runtime/components/KDatatable/KDataIterator.logic.js +48 -19
  25. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -3
  26. package/dist/runtime/components/KDatatable/KDatatable.logic.js +42 -18
  27. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +5 -5
  28. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +5 -5
  29. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +5 -5
  30. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +5 -5
  31. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
  32. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
  33. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
  34. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
  35. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
  36. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
  37. package/dist/runtime/components/KModal/KModal.global.d.vue.ts +15 -2
  38. package/dist/runtime/components/KModal/KModal.global.vue +6 -1
  39. package/dist/runtime/components/KModal/KModal.global.vue.d.ts +15 -2
  40. package/dist/runtime/components/KModal/KModal.logic.d.ts +8 -2
  41. package/dist/runtime/components/KModal/KModal.logic.js +21 -3
  42. package/dist/runtime/components/KPagination/KPagination.global.vue +2 -0
  43. package/dist/runtime/components/KPagination/KPagination.logic.d.ts +2 -1
  44. package/dist/runtime/components/KPagination/KPagination.logic.js +10 -5
  45. package/dist/runtime/components/KTabs/KTabItem.logic.js +20 -5
  46. package/dist/runtime/components/KTabs/KTabs.logic.js +18 -2
  47. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +1 -1
  48. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
  49. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +1 -1
  50. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +1 -1
  51. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +1 -1
  52. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +1 -1
  53. package/dist/runtime/components/KToast/KToast.logic.d.ts +1 -0
  54. package/dist/runtime/components/KToast/KToast.logic.js +19 -5
  55. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +11 -2
  56. package/dist/runtime/components/KTree/KTree.global.vue +1 -0
  57. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +11 -2
  58. package/dist/runtime/components/KTree/KTree.logic.d.ts +9 -4
  59. package/dist/runtime/components/KTree/KTree.logic.js +14 -8
  60. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +2 -2
  61. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +2 -2
  62. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +10 -0
  63. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +28 -4
  64. package/dist/runtime/components/KTreeView/KTreeView.global.vue +15 -1
  65. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +28 -4
  66. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +18 -4
  67. package/dist/runtime/components/KTreeView/KTreeView.logic.js +28 -6
  68. package/dist/runtime/composables/locales.js +195 -27
  69. package/dist/runtime/composables/useDataProvider.d.ts +1 -1
  70. package/dist/runtime/composables/useDataProvider.js +129 -82
  71. package/dist/runtime/composables/useDebounce.d.ts +1 -1
  72. package/dist/runtime/composables/useKatluxContext.d.ts +13 -0
  73. package/dist/runtime/composables/useKatluxContext.js +21 -0
  74. package/dist/runtime/composables/useKatluxI18n.js +20 -9
  75. package/dist/runtime/composables/usePresetComponent.js +12 -3
  76. package/dist/runtime/composables/useRequestQueue.d.ts +25 -0
  77. package/dist/runtime/composables/useRequestQueue.js +35 -0
  78. package/dist/runtime/directives/clickOutside.d.ts +3 -2
  79. package/dist/runtime/directives/clickOutside.js +9 -2
  80. package/dist/runtime/hydration/NuxtHydrationAdapter.d.ts +10 -0
  81. package/dist/runtime/hydration/NuxtHydrationAdapter.js +88 -0
  82. package/dist/runtime/plugins/PresetPlugin.js +9 -1
  83. package/dist/runtime/plugins/nuxtCompatPlugin.d.ts +2 -3
  84. package/dist/runtime/plugins/nuxtCompatPlugin.js +6 -1
  85. package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +1 -1
  86. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +1 -1
  87. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +1 -1
  88. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +1 -1
  89. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +1 -1
  90. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +1 -1
  91. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.d.vue.ts +1 -1
  92. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +1 -1
  93. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue.d.ts +1 -1
  94. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +24 -2
  95. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +19 -2
  96. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +42 -8
  97. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +19 -2
  98. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +19 -2
  99. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +203 -12
  100. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +19 -2
  101. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +1 -1
  102. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +1 -1
  103. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +1 -1
  104. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +1 -0
  105. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +1 -1
  106. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +1 -1
  107. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +1 -1
  108. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +1 -1
  109. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +1 -1
  110. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +1 -1
  111. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +1 -20
  112. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +2 -2
  113. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +2 -2
  114. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +2 -2
  115. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +6 -2
  116. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +1 -1
  117. package/dist/runtime/presets/default/components/KModal/KModal.vue +16 -4
  118. package/dist/runtime/presets/default/components/KPagination/KPagination.d.vue.ts +1 -0
  119. package/dist/runtime/presets/default/components/KPagination/KPagination.vue +5 -4
  120. package/dist/runtime/presets/default/components/KPagination/KPagination.vue.d.ts +1 -0
  121. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +3 -1
  122. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +2 -1
  123. package/dist/runtime/presets/default/components/KTabs/KTabs.vue +2 -1
  124. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +1 -1
  125. package/dist/runtime/presets/default/components/KToast/KToast.vue +1 -1
  126. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +1 -1
  127. package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue +2 -0
  128. package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +20 -10
  129. package/dist/runtime/presets/default/components/KTree/KTree.vue +34 -24
  130. package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +20 -10
  131. package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +2 -1
  132. package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +8 -2
  133. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +10 -1
  134. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +8 -2
  135. package/dist/runtime/server/middleware/session.d.ts +2 -0
  136. package/dist/runtime/server/middleware/session.js +36 -0
  137. package/dist/runtime/utils/PresetResolver.js +21 -7
  138. package/dist/runtime/utils/TemplateResolver.js +11 -5
  139. package/package.json +2 -2
@@ -55,10 +55,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
55
55
  };
56
56
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
57
57
  "update:modelValue": (value: string | Date) => any;
58
- "update:isOpen": (value: boolean) => any;
59
58
  "update:maskedModel": (value: string) => any;
60
59
  "update:calendarShow": (value: boolean) => any;
61
60
  "update:day": (value: string | Date) => any;
61
+ "update:isOpen": (value: boolean) => any;
62
62
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
63
63
  label: {
64
64
  type: StringConstructor;
@@ -115,19 +115,19 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
115
115
  };
116
116
  }>> & Readonly<{
117
117
  "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
118
- "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
119
118
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
120
119
  "onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
121
120
  "onUpdate:day"?: ((value: string | Date) => any) | undefined;
121
+ "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
122
122
  }>, {
123
123
  isOpen: boolean;
124
124
  label: string;
125
- day: string | Date;
126
125
  validation: "error" | "success" | "warning" | null | undefined;
127
- validationText: string;
128
- modelValue: string | Date;
129
126
  placeholder: string;
130
127
  teleportTo: string;
128
+ validationText: string;
129
+ modelValue: string | Date;
130
+ day: string | Date;
131
131
  showClear: boolean;
132
132
  align: "left" | "right" | undefined;
133
133
  format: string;
@@ -55,10 +55,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
55
55
  };
56
56
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
57
57
  "update:modelValue": (value: string | Date) => any;
58
- "update:isOpen": (value: boolean) => any;
59
58
  "update:maskedModel": (value: string) => any;
60
59
  "update:calendarShow": (value: boolean) => any;
61
60
  "update:day": (value: string | Date) => any;
61
+ "update:isOpen": (value: boolean) => any;
62
62
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
63
63
  label: {
64
64
  type: StringConstructor;
@@ -115,19 +115,19 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
115
115
  };
116
116
  }>> & Readonly<{
117
117
  "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
118
- "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
119
118
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
120
119
  "onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
121
120
  "onUpdate:day"?: ((value: string | Date) => any) | undefined;
121
+ "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
122
122
  }>, {
123
123
  isOpen: boolean;
124
124
  label: string;
125
- day: string | Date;
126
125
  validation: "error" | "success" | "warning" | null | undefined;
127
- validationText: string;
128
- modelValue: string | Date;
129
126
  placeholder: string;
130
127
  teleportTo: string;
128
+ validationText: string;
129
+ modelValue: string | Date;
130
+ day: string | Date;
131
131
  showClear: boolean;
132
132
  align: "left" | "right" | undefined;
133
133
  format: string;
@@ -59,9 +59,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
59
59
  };
60
60
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
61
61
  "update:modelValue": (value: string | Date) => any;
62
- "update:isOpen": (value: boolean) => any;
63
62
  "update:maskedModel": (value: string) => any;
64
63
  "update:calendarShow": (value: boolean) => any;
64
+ "update:isOpen": (value: boolean) => any;
65
65
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
66
66
  label: {
67
67
  type: StringConstructor;
@@ -122,18 +122,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
122
122
  };
123
123
  }>> & Readonly<{
124
124
  "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
125
- "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
126
125
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
127
126
  "onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
127
+ "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
128
128
  }>, {
129
129
  isOpen: boolean;
130
130
  label: string;
131
- day: string | Date;
132
131
  validation: "error" | "success" | "warning" | null | undefined;
133
- validationText: string;
134
- modelValue: string | Date;
135
132
  placeholder: string;
136
133
  teleportTo: string;
134
+ validationText: string;
135
+ modelValue: string | Date;
136
+ day: string | Date;
137
137
  showClear: boolean;
138
138
  format: string;
139
139
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
@@ -59,9 +59,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
59
59
  };
60
60
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
61
61
  "update:modelValue": (value: string | Date) => any;
62
- "update:isOpen": (value: boolean) => any;
63
62
  "update:maskedModel": (value: string) => any;
64
63
  "update:calendarShow": (value: boolean) => any;
64
+ "update:isOpen": (value: boolean) => any;
65
65
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
66
66
  label: {
67
67
  type: StringConstructor;
@@ -122,18 +122,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
122
122
  };
123
123
  }>> & Readonly<{
124
124
  "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
125
- "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
126
125
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
127
126
  "onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
127
+ "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
128
128
  }>, {
129
129
  isOpen: boolean;
130
130
  label: string;
131
- day: string | Date;
132
131
  validation: "error" | "success" | "warning" | null | undefined;
133
- validationText: string;
134
- modelValue: string | Date;
135
132
  placeholder: string;
136
133
  teleportTo: string;
134
+ validationText: string;
135
+ modelValue: string | Date;
136
+ day: string | Date;
137
137
  showClear: boolean;
138
138
  format: string;
139
139
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
@@ -1,8 +1,8 @@
1
1
  import { type KGridProps } from './KGrid.logic.js';
2
2
  declare const __VLS_export: import("vue").DefineComponent<KGridProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KGridProps> & Readonly<{}>, {
3
3
  direction: "row" | "column";
4
- noGap: boolean;
5
4
  align: "start" | "center" | "end" | "stretch" | "baseline";
5
+ noGap: boolean;
6
6
  wrap: "wrap" | "nowrap";
7
7
  flexChild: boolean;
8
8
  justify: "start" | "center" | "end" | "space-between" | "around" | "evenly";
@@ -1,8 +1,8 @@
1
1
  import { type KGridProps } from './KGrid.logic.js';
2
2
  declare const __VLS_export: import("vue").DefineComponent<KGridProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KGridProps> & Readonly<{}>, {
3
3
  direction: "row" | "column";
4
- noGap: boolean;
5
4
  align: "start" | "center" | "end" | "stretch" | "baseline";
5
+ noGap: boolean;
6
6
  wrap: "wrap" | "nowrap";
7
7
  flexChild: boolean;
8
8
  justify: "start" | "center" | "end" | "space-between" | "around" | "evenly";
@@ -110,9 +110,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
110
110
  label: string;
111
111
  disabled: boolean;
112
112
  validation: "error" | "success" | "warning" | null | undefined;
113
+ placeholder: string;
113
114
  validationText: string;
114
115
  modelValue: string;
115
- placeholder: string;
116
116
  showClear: boolean;
117
117
  format: string;
118
118
  step: number;
@@ -110,9 +110,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
110
110
  label: string;
111
111
  disabled: boolean;
112
112
  validation: "error" | "success" | "warning" | null | undefined;
113
+ placeholder: string;
113
114
  validationText: string;
114
115
  modelValue: string;
115
- placeholder: string;
116
116
  showClear: boolean;
117
117
  format: string;
118
118
  step: number;
@@ -66,9 +66,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
66
66
  }>, {
67
67
  label: string;
68
68
  validation: "error" | "success" | "warning" | null | undefined;
69
+ placeholder: string;
69
70
  validationText: string;
70
71
  modelValue: string;
71
- placeholder: string;
72
72
  showClear: boolean;
73
73
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
74
  declare const _default: typeof __VLS_export;
@@ -66,9 +66,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
66
66
  }>, {
67
67
  label: string;
68
68
  validation: "error" | "success" | "warning" | null | undefined;
69
+ placeholder: string;
69
70
  validationText: string;
70
71
  modelValue: string;
71
- placeholder: string;
72
72
  showClear: boolean;
73
73
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
74
  declare const _default: typeof __VLS_export;
@@ -1,4 +1,8 @@
1
1
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ modelValue: {
3
+ type: BooleanConstructor;
4
+ default: undefined;
5
+ };
2
6
  closeOnOutsideClick: {
3
7
  type: BooleanConstructor;
4
8
  default: boolean;
@@ -6,12 +10,21 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
6
10
  }>, {
7
11
  openModal: () => void;
8
12
  closeModal: () => void;
9
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
+ "update:modelValue": (value: boolean) => any;
15
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ modelValue: {
17
+ type: BooleanConstructor;
18
+ default: undefined;
19
+ };
10
20
  closeOnOutsideClick: {
11
21
  type: BooleanConstructor;
12
22
  default: boolean;
13
23
  };
14
- }>> & Readonly<{}>, {
24
+ }>> & Readonly<{
25
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
26
+ }>, {
27
+ modelValue: boolean;
15
28
  closeOnOutsideClick: boolean;
16
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
17
30
  declare const _default: typeof __VLS_export;
@@ -5,9 +5,14 @@ import { usePresetComponent } from "../../composables/usePresetComponent";
5
5
  import { computed } from "vue";
6
6
  import KModalDefault from "../../presets/default/components/KModal/KModal.vue";
7
7
  const props = defineProps(KModalDefaultProps);
8
+ const emit = defineEmits(["update:modelValue"]);
8
9
  const generatedId = useId();
9
10
  const stableId = `k-modal-${generatedId}`;
10
- const { modalId, opened, openModal, closeModal } = useKModalLogic(props, stableId);
11
+ const { modalId, opened, openModal, closeModal } = useKModalLogic(
12
+ props,
13
+ stableId,
14
+ (e, val) => emit(e, val)
15
+ );
11
16
  defineExpose({
12
17
  openModal,
13
18
  closeModal
@@ -1,4 +1,8 @@
1
1
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ modelValue: {
3
+ type: BooleanConstructor;
4
+ default: undefined;
5
+ };
2
6
  closeOnOutsideClick: {
3
7
  type: BooleanConstructor;
4
8
  default: boolean;
@@ -6,12 +10,21 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
6
10
  }>, {
7
11
  openModal: () => void;
8
12
  closeModal: () => void;
9
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
+ "update:modelValue": (value: boolean) => any;
15
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ modelValue: {
17
+ type: BooleanConstructor;
18
+ default: undefined;
19
+ };
10
20
  closeOnOutsideClick: {
11
21
  type: BooleanConstructor;
12
22
  default: boolean;
13
23
  };
14
- }>> & Readonly<{}>, {
24
+ }>> & Readonly<{
25
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
26
+ }>, {
27
+ modelValue: boolean;
15
28
  closeOnOutsideClick: boolean;
16
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
17
30
  declare const _default: typeof __VLS_export;
@@ -1,16 +1,22 @@
1
1
  export declare const KMODAL_PORTAL_ID_KEY = "KMODAL_PORTAL_ID";
2
2
  export interface KModalProps {
3
+ modelValue?: boolean;
3
4
  closeOnOutsideClick?: boolean;
4
5
  }
5
6
  export declare const KModalDefaultProps: {
7
+ modelValue: {
8
+ type: BooleanConstructor;
9
+ default: undefined;
10
+ };
6
11
  closeOnOutsideClick: {
7
12
  type: BooleanConstructor;
8
13
  default: boolean;
9
14
  };
10
15
  };
11
- export declare function useKModalLogic(props: KModalProps, stableId: string): {
16
+ export type KModalEmits = (e: 'update:modelValue', value: boolean) => void;
17
+ export declare function useKModalLogic(props: KModalProps, stableId: string, emit?: KModalEmits): {
12
18
  modalId: import("vue").ComputedRef<string>;
13
- opened: import("vue").Ref<boolean, boolean>;
19
+ opened: import("vue").WritableComputedRef<boolean, boolean>;
14
20
  openModal: () => void;
15
21
  closeModal: () => void;
16
22
  };
@@ -1,18 +1,36 @@
1
- import { ref, provide, computed } from "vue";
1
+ import { ref, provide, computed, watch } from "vue";
2
2
  export const KMODAL_PORTAL_ID_KEY = "KMODAL_PORTAL_ID";
3
3
  export const KModalDefaultProps = {
4
+ modelValue: {
5
+ type: Boolean,
6
+ default: void 0
7
+ },
4
8
  closeOnOutsideClick: {
5
9
  type: Boolean,
6
10
  default: true
7
11
  }
8
12
  };
9
- export function useKModalLogic(props, stableId) {
13
+ export function useKModalLogic(props, stableId, emit) {
10
14
  const modalId = computed(() => stableId);
11
15
  try {
12
16
  provide(KMODAL_PORTAL_ID_KEY, modalId);
13
17
  } catch (e) {
14
18
  }
15
- const opened = ref(false);
19
+ const internalOpened = ref(props.modelValue ?? false);
20
+ watch(() => props.modelValue, (newVal) => {
21
+ if (newVal !== void 0) {
22
+ internalOpened.value = newVal;
23
+ }
24
+ });
25
+ const opened = computed({
26
+ get: () => internalOpened.value,
27
+ set: (val) => {
28
+ if (internalOpened.value !== val) {
29
+ internalOpened.value = val;
30
+ emit?.("update:modelValue", val);
31
+ }
32
+ }
33
+ });
16
34
  function openModal() {
17
35
  opened.value = true;
18
36
  }
@@ -10,6 +10,7 @@ const props = defineProps({
10
10
  const {
11
11
  dp,
12
12
  totalPages,
13
+ currentPage,
13
14
  getPageHref,
14
15
  visiblePages,
15
16
  showPrevButton,
@@ -25,6 +26,7 @@ const {
25
26
  const presetComponent = usePresetComponent("KPagination", KPaginationDefault);
26
27
  const templateProps = computed(() => ({
27
28
  dp,
29
+ currentPage: currentPage.value,
28
30
  totalPages: totalPages.value,
29
31
  getPageHref,
30
32
  visiblePages: visiblePages.value,
@@ -4,8 +4,9 @@ export interface KPaginationProps {
4
4
  }
5
5
  export declare const KPaginationDefaultProps: {};
6
6
  export declare function useKPaginationLogic(props: KPaginationProps): {
7
- dp: ADataProvider;
7
+ dp: ADataProvider<import("@katlux/providers").TDataRow>;
8
8
  totalPages: import("vue").ComputedRef<number>;
9
+ currentPage: import("vue").ComputedRef<number>;
9
10
  getPageHref: (page: number) => string | undefined;
10
11
  visiblePages: import("vue").ComputedRef<number[]>;
11
12
  showPrevButton: import("vue").ComputedRef<boolean>;
@@ -5,9 +5,9 @@ export const KPaginationDefaultProps = {};
5
5
  export function useKPaginationLogic(props) {
6
6
  const dp = props.dataProvider;
7
7
  const { rowCount: dpRowCount, pageSize: dpPageSize, currentPage: dpCurrentPage } = useDataProvider(props.dataProvider);
8
- const rowCount = computed(() => dpRowCount.value ?? dp?.rowCount?.value ?? 0);
9
- const pageSize = computed(() => dpPageSize.value ?? dp?.pageSize?.value ?? 10);
10
- const currentPage = computed(() => dpCurrentPage.value ?? dp?.currentPage?.value ?? 1);
8
+ const rowCount = computed(() => dpRowCount.value ?? dp?.rowCount?.value ?? dp?.rowCount ?? 0);
9
+ const pageSize = computed(() => dpPageSize.value ?? dp?.pageSize?.value ?? dp?.pageSize ?? 10);
10
+ const currentPage = computed(() => dpCurrentPage.value ?? dp?.currentPage?.value ?? dp?.currentPage ?? 1);
11
11
  let route;
12
12
  try {
13
13
  route = useRoute();
@@ -49,8 +49,12 @@ export function useKPaginationLogic(props) {
49
49
  const pageClicked = (item) => {
50
50
  if (typeof dp?.setCurrentPage === "function") {
51
51
  dp.setCurrentPage(item);
52
- } else if (dp?.currentPage) {
53
- dp.currentPage.value = item;
52
+ } else if (dp) {
53
+ if (typeof dp.currentPage === "object" && "value" in dp.currentPage) {
54
+ dp.currentPage.value = item;
55
+ } else {
56
+ dp.currentPage = item;
57
+ }
54
58
  }
55
59
  dpCurrentPage.value = item;
56
60
  };
@@ -73,6 +77,7 @@ export function useKPaginationLogic(props) {
73
77
  return {
74
78
  dp,
75
79
  totalPages,
80
+ currentPage,
76
81
  getPageHref,
77
82
  visiblePages,
78
83
  showPrevButton,
@@ -1,4 +1,4 @@
1
- import { inject, ref, computed } from "vue";
1
+ import { inject, ref, computed, watch, onUnmounted } from "vue";
2
2
  export const KTabItemDefaultProps = {
3
3
  title: {
4
4
  type: String,
@@ -10,6 +10,8 @@ export const KTabItemDefaultProps = {
10
10
  };
11
11
  export function useKTabItemLogic(props) {
12
12
  const register = inject("tabRegister");
13
+ const unregister = inject("tabUnregister");
14
+ const getIndex = inject("tabGetIndex");
13
15
  const toggle = inject("tabToggle");
14
16
  const isOpenFn = inject("tabIsOpen");
15
17
  const index = ref(-1);
@@ -21,13 +23,26 @@ export function useKTabItemLogic(props) {
21
23
  }
22
24
  }
23
25
  }
26
+ watch(() => props.isOpen, (newVal) => {
27
+ const currentIndex = getIndex ? getIndex(props) : index.value;
28
+ if (newVal && toggle && currentIndex !== -1) {
29
+ toggle(currentIndex);
30
+ }
31
+ });
32
+ onUnmounted(() => {
33
+ if (unregister) {
34
+ unregister(props);
35
+ }
36
+ });
24
37
  const isOpen = computed(() => {
25
- if (index.value === -1 || !isOpenFn) return !!props.isOpen;
26
- return isOpenFn(index.value);
38
+ const currentIndex = getIndex ? getIndex(props) : index.value;
39
+ if (currentIndex === -1 || !isOpenFn) return !!props.isOpen;
40
+ return isOpenFn(currentIndex);
27
41
  });
28
42
  function toggleTab() {
29
- if (toggle && index.value !== -1) {
30
- toggle(index.value);
43
+ const currentIndex = getIndex ? getIndex(props) : index.value;
44
+ if (toggle && currentIndex !== -1) {
45
+ toggle(currentIndex);
31
46
  }
32
47
  }
33
48
  return {
@@ -32,9 +32,23 @@ export function useKTabsLogic() {
32
32
  });
33
33
  }
34
34
  }, { immediate: true });
35
- let registerCount = 0;
35
+ const registeredItems = ref([]);
36
36
  function registerItem(item) {
37
- return registerCount++;
37
+ registeredItems.value.push(item);
38
+ return registeredItems.value.length - 1;
39
+ }
40
+ function unregisterItem(item) {
41
+ const idx = registeredItems.value.indexOf(item);
42
+ if (idx !== -1) {
43
+ registeredItems.value.splice(idx, 1);
44
+ openIndexes.value = openIndexes.value.filter((i) => i !== idx).map((i) => i > idx ? i - 1 : i);
45
+ if (openIndexes.value.length === 0 && registeredItems.value.length > 0) {
46
+ openIndexes.value = [Math.min(idx, registeredItems.value.length - 1)];
47
+ }
48
+ }
49
+ }
50
+ function getItemIndex(item) {
51
+ return registeredItems.value.indexOf(item);
38
52
  }
39
53
  function toggleItem(index) {
40
54
  openIndexes.value = [index];
@@ -44,6 +58,8 @@ export function useKTabsLogic() {
44
58
  }
45
59
  try {
46
60
  provide("tabRegister", registerItem);
61
+ provide("tabUnregister", unregisterItem);
62
+ provide("tabGetIndex", getItemIndex);
47
63
  provide("tabToggle", toggleItem);
48
64
  provide("tabIsOpen", isOpen);
49
65
  } catch (e) {
@@ -59,8 +59,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
59
59
  label: string;
60
60
  rows: number;
61
61
  validation: "error" | "success" | "warning" | null | undefined;
62
- validationText: string;
63
62
  placeholder: string;
63
+ validationText: string;
64
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
65
  declare const _default: typeof __VLS_export;
66
66
  export default _default;
@@ -59,8 +59,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
59
59
  label: string;
60
60
  rows: number;
61
61
  validation: "error" | "success" | "warning" | null | undefined;
62
- validationText: string;
63
62
  placeholder: string;
63
+ validationText: string;
64
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
65
  declare const _default: typeof __VLS_export;
66
66
  export default _default;
@@ -69,9 +69,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
69
69
  type: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
70
70
  label: string;
71
71
  validation: "error" | "success" | "warning" | null | undefined;
72
+ placeholder: string;
72
73
  validationText: string;
73
74
  modelValue: string;
74
- placeholder: string;
75
75
  showClear: boolean;
76
76
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
77
77
  declare const _default: typeof __VLS_export;
@@ -69,9 +69,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
69
69
  type: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
70
70
  label: string;
71
71
  validation: "error" | "success" | "warning" | null | undefined;
72
+ placeholder: string;
72
73
  validationText: string;
73
74
  modelValue: string;
74
- placeholder: string;
75
75
  showClear: boolean;
76
76
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
77
77
  declare const _default: typeof __VLS_export;
@@ -48,8 +48,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
48
48
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
49
  }>, {
50
50
  type: import("./KToast.logic.js").KToastType;
51
- modelValue: boolean;
52
51
  text: string;
52
+ modelValue: boolean;
53
53
  timeout: number;
54
54
  teleport: boolean;
55
55
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -48,8 +48,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
48
48
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
49
  }>, {
50
50
  type: import("./KToast.logic.js").KToastType;
51
- modelValue: boolean;
52
51
  text: string;
52
+ modelValue: boolean;
53
53
  timeout: number;
54
54
  teleport: boolean;
55
55
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -31,4 +31,5 @@ export declare const KToastDefaultProps: {
31
31
  };
32
32
  export declare function useKToastLogic(props: KToastProps, emit: any): {
33
33
  startTimeout: () => void;
34
+ stopTimeout: () => void;
34
35
  };
@@ -1,4 +1,4 @@
1
- import { watch } from "vue";
1
+ import { watch, onScopeDispose } from "vue";
2
2
  export const KToastDefaultProps = {
3
3
  modelValue: {
4
4
  type: Boolean,
@@ -23,10 +23,17 @@ export const KToastDefaultProps = {
23
23
  };
24
24
  export function useKToastLogic(props, emit) {
25
25
  let timeoutId = null;
26
+ const stopTimeout = () => {
27
+ if (timeoutId) {
28
+ clearTimeout(timeoutId);
29
+ timeoutId = null;
30
+ }
31
+ };
26
32
  const startTimeout = () => {
27
- if (timeoutId) clearTimeout(timeoutId);
33
+ stopTimeout();
28
34
  if (props.timeout && props.timeout > 0 && props.modelValue) {
29
35
  timeoutId = setTimeout(() => {
36
+ timeoutId = null;
30
37
  emit("update:modelValue", false);
31
38
  }, props.timeout);
32
39
  }
@@ -34,14 +41,21 @@ export function useKToastLogic(props, emit) {
34
41
  watch(() => props.modelValue, (val) => {
35
42
  if (val) {
36
43
  startTimeout();
37
- } else if (timeoutId) {
38
- clearTimeout(timeoutId);
44
+ } else {
45
+ stopTimeout();
39
46
  }
40
47
  }, { immediate: true });
41
48
  watch(() => props.timeout, () => {
42
49
  if (props.modelValue) startTimeout();
43
50
  });
51
+ try {
52
+ onScopeDispose(() => {
53
+ stopTimeout();
54
+ });
55
+ } catch {
56
+ }
44
57
  return {
45
- startTimeout
58
+ startTimeout,
59
+ stopTimeout
46
60
  };
47
61
  }