@katlux/toolkit 0.1.0-beta.6 → 0.1.0-beta.60

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 (185) hide show
  1. package/dist/compiled/composables/usePresetComponent.mjs +21 -16
  2. package/dist/module.cjs +52 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +52 -0
  5. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +9 -2
  6. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  7. package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -12
  8. package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -12
  9. package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +1 -0
  10. package/dist/runtime/components/KCalendar/KCalendar.logic.js +25 -10
  11. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +30 -0
  12. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
  13. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +30 -0
  14. package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +17 -0
  15. package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +16 -1
  16. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +75 -8
  17. package/dist/runtime/components/KCombobox/KCombobox.global.vue +18 -4
  18. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +75 -8
  19. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +46 -8
  20. package/dist/runtime/components/KCombobox/KCombobox.logic.js +77 -9
  21. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +169 -0
  22. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +46 -0
  23. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +169 -0
  24. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +127 -0
  25. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +160 -0
  26. package/dist/runtime/components/KDatatable/KDataIterator.global.vue +1 -1
  27. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +2 -2
  28. package/dist/runtime/components/KDatatable/KDatatable.global.vue +1 -1
  29. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +2 -2
  30. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +95 -8
  31. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +27 -3
  32. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +95 -8
  33. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +43 -1
  34. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +106 -7
  35. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +84 -8
  36. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +26 -3
  37. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +84 -8
  38. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +38 -1
  39. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +161 -7
  40. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +27 -0
  41. package/dist/runtime/components/KDropdown/KDropdown.global.vue +14 -4
  42. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +27 -0
  43. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +36 -1
  44. package/dist/runtime/components/KDropdown/KDropdown.logic.js +92 -4
  45. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +7 -56
  46. package/dist/runtime/components/KGrid/KGrid.global.vue +9 -2
  47. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +7 -56
  48. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +41 -0
  49. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +27 -12
  50. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +41 -0
  51. package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +26 -3
  52. package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +34 -10
  53. package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +4 -1
  54. package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
  55. package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
  56. package/dist/runtime/components/KIcon/KIcon.logic.d.ts +1 -1
  57. package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
  58. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +21 -0
  59. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +4 -2
  60. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +21 -0
  61. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +11 -0
  62. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +9 -0
  63. package/dist/runtime/components/KModal/KModal.global.d.vue.ts +14 -2
  64. package/dist/runtime/components/KModal/KModal.global.vue +5 -1
  65. package/dist/runtime/components/KModal/KModal.global.vue.d.ts +14 -2
  66. package/dist/runtime/components/KModal/KModal.logic.d.ts +10 -2
  67. package/dist/runtime/components/KModal/KModal.logic.js +12 -3
  68. package/dist/runtime/components/KPagination/KPagination.global.vue +1 -1
  69. package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +5 -28
  70. package/dist/runtime/components/KPanel/KPanel.global.vue +12 -4
  71. package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +5 -28
  72. package/dist/runtime/components/KPanel/KPanel.logic.d.ts +10 -0
  73. package/dist/runtime/components/KPanel/KPanel.logic.js +8 -0
  74. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
  75. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
  76. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
  77. package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
  78. package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
  79. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +21 -0
  80. package/dist/runtime/components/KTextarea/KTextarea.global.vue +3 -1
  81. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +21 -0
  82. package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +11 -0
  83. package/dist/runtime/components/KTextarea/KTextarea.logic.js +9 -0
  84. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +35 -2
  85. package/dist/runtime/components/KTextbox/KTextbox.global.vue +7 -4
  86. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +35 -2
  87. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +21 -4
  88. package/dist/runtime/components/KTextbox/KTextbox.logic.js +21 -5
  89. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
  90. package/dist/runtime/components/KToast/KToast.global.vue +32 -0
  91. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
  92. package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
  93. package/dist/runtime/components/KToast/KToast.logic.js +47 -0
  94. package/dist/runtime/components/KTree/KTree.logic.d.ts +1 -1
  95. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +65 -7
  96. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +15 -3
  97. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +65 -7
  98. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +37 -5
  99. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +32 -1
  100. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +8 -8
  101. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +8 -8
  102. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
  103. package/dist/runtime/composables/usePresetComponent.d.ts +16 -0
  104. package/dist/runtime/composables/usePresetComponent.js +21 -16
  105. package/dist/runtime/presets/default/assets/scss/css-variables.css +64 -13
  106. package/dist/runtime/presets/default/assets/scss/css-variables.scss +286 -0
  107. package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
  108. package/dist/runtime/presets/default/assets/scss/index.css +99 -13
  109. package/dist/runtime/presets/default/assets/scss/index.scss +42 -0
  110. package/dist/runtime/presets/default/assets/scss/mixins.scss +94 -0
  111. package/dist/runtime/presets/default/assets/scss/reset.scss +16 -0
  112. package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue +5 -2
  113. package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +40 -37
  114. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +29 -22
  115. package/dist/runtime/presets/default/components/KButton/KButton.vue +147 -428
  116. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +57 -53
  117. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +189 -161
  118. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +3 -0
  119. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +59 -42
  120. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +3 -0
  121. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +7 -0
  122. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +108 -79
  123. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +7 -0
  124. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -0
  125. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +79 -61
  126. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -0
  127. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +29 -0
  128. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +202 -0
  129. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +29 -0
  130. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +40 -31
  131. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +110 -92
  132. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +7 -0
  133. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +58 -25
  134. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +7 -0
  135. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +6 -0
  136. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +81 -52
  137. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +6 -0
  138. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +10 -0
  139. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +57 -25
  140. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +10 -0
  141. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +337 -241
  142. package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +40 -35
  143. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +170 -140
  144. package/dist/runtime/presets/default/components/KGrid/KGrid.vue +62 -60
  145. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +8 -2
  146. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +48 -28
  147. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +8 -2
  148. package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +34 -28
  149. package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
  150. package/dist/runtime/presets/default/components/KIcon/KIcon.vue +31 -22
  151. package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
  152. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +65 -48
  153. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +2 -0
  154. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +117 -84
  155. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +2 -0
  156. package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +2 -0
  157. package/dist/runtime/presets/default/components/KModal/KModal.vue +85 -35
  158. package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +2 -0
  159. package/dist/runtime/presets/default/components/KPagination/KPagination.vue +42 -40
  160. package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +3 -0
  161. package/dist/runtime/presets/default/components/KPanel/KPanel.vue +97 -34
  162. package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
  163. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
  164. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +40 -35
  165. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
  166. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +158 -125
  167. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +123 -100
  168. package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +40 -37
  169. package/dist/runtime/presets/default/components/KTabs/KTabs.vue +9 -6
  170. package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +2 -0
  171. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +40 -21
  172. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +2 -0
  173. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
  174. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +76 -37
  175. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
  176. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
  177. package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
  178. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
  179. package/dist/runtime/presets/default/components/KTree/KTree.vue +103 -80
  180. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +6 -0
  181. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +88 -55
  182. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +6 -0
  183. package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +31 -30
  184. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +34 -27
  185. package/package.json +5 -5
@@ -17,41 +17,50 @@
17
17
  span(v-if="showNoRecord") No record
18
18
  </template>
19
19
 
20
- <script setup>
21
- import { computed } from "vue";
22
- import { ADataProvider } from "@katlux/providers";
23
- import KBulkActions from "../KBulkActions/KBulkActions.vue";
24
- import KPagination from "../KPagination/KPagination.vue";
25
- import KLoader from "../../../../components/KLoader/KLoader.global.vue";
26
- const props = defineProps({
27
- dataProvider: { type: null, required: true },
28
- visibleFields: { type: [Array, null], required: true },
29
- rowActions: { type: Array, required: true },
30
- bulkActions: { type: Array, required: true },
31
- selectedRows: { type: Array, required: true },
32
- selectAll: { type: Boolean, required: true },
33
- loading: { type: Boolean, required: false },
34
- search: { type: String, required: false },
35
- itemsPerPage: { type: Number, required: false },
36
- page: { type: Number, required: false },
37
- slots: { type: null, required: false }
38
- });
39
- const emit = defineEmits(["update:selectedRows", "update:selectAll"]);
20
+ <script setup lang="ts">
21
+ import { computed } from 'vue'
22
+ import { ADataProvider } from '@katlux/providers'
23
+ import type { IKDatatableAction } from '@katlux/providers'
24
+ import KBulkActions from '../KBulkActions/KBulkActions.vue'
25
+ import KPagination from '../KPagination/KPagination.vue'
26
+ import KLoader from '../../../../components/KLoader/KLoader.global.vue'
27
+
28
+ const props = defineProps<{
29
+ dataProvider: ADataProvider
30
+ visibleFields: Array<string> | null
31
+ rowActions: Array<IKDatatableAction>
32
+ bulkActions: Array<IKDatatableAction>
33
+ selectedRows: any[]
34
+ selectAll: boolean
35
+ loading?: boolean
36
+ search?: string
37
+ itemsPerPage?: number
38
+ page?: number
39
+ slots?: any
40
+ }>()
41
+
42
+ const emit = defineEmits<{
43
+ (e: 'update:selectedRows', value: any[]): void
44
+ (e: 'update:selectAll', value: boolean): void
45
+ }>()
46
+
40
47
  const selectedRows = computed({
41
- get: () => props.selectedRows,
42
- set: (val) => emit("update:selectedRows", val)
43
- });
48
+ get: () => props.selectedRows,
49
+ set: (val) => emit('update:selectedRows', val)
50
+ })
51
+
44
52
  const selectAll = computed({
45
- get: () => props.selectAll,
46
- set: (val) => emit("update:selectAll", val)
47
- });
48
- const isLoading = computed(() => props.loading || props.dataProvider.loading?.value || props.dataProvider.initialLoad?.value || false);
49
- const hasData = computed(() => (props.dataProvider.pageData.value?.length || 0) > 0);
50
- const showNoRecord = computed(() => !isLoading.value && !hasData.value);
53
+ get: () => props.selectAll,
54
+ set: (val) => emit('update:selectAll', val)
55
+ })
56
+
57
+ const isLoading = computed(() => props.loading || props.dataProvider.loading?.value || (props.dataProvider as any).initialLoad?.value || false)
58
+ const hasData = computed(() => (props.dataProvider.pageData.value?.length || 0) > 0)
59
+ const showNoRecord = computed(() => !isLoading.value && !hasData.value)
51
60
  </script>
52
61
 
53
- <style scoped>
62
+ <style lang="scss" scoped>
54
63
  .k-data-iterator {
55
- position: relative;
64
+ position: relative;
56
65
  }
57
66
  </style>
@@ -1,6 +1,6 @@
1
1
  <template lang="pug">
2
2
  .k-datatable(:style="{ '--page-size': props.dataProvider?.pageSize?.value || 10 }")
3
- KGrid(:flex-child="true")
3
+ KGrid(:flex-child="true" align="stretch" direction="column")
4
4
  .datatable-container
5
5
  KLoader(:loading="isLoading" overlay)
6
6
  table
@@ -37,102 +37,120 @@
37
37
  KPagination.pagination(:dataProvider="props.dataProvider")
38
38
  </template>
39
39
 
40
- <script setup>
41
- import { computed } from "vue";
42
- import { ADataProvider } from "@katlux/providers";
43
- const props = defineProps({
44
- dataProvider: { type: null, required: true },
45
- visibleFields: { type: [Array, null], required: true },
46
- rowActions: { type: Array, required: true },
47
- bulkActions: { type: Array, required: true },
48
- selectedRows: { type: Array, required: true },
49
- selectAll: { type: Boolean, required: true },
50
- cellSlots: { type: Object, required: false },
51
- headerSlots: { type: Object, required: false },
52
- columnHeaders: { type: Object, required: false },
53
- columnWidths: { type: Object, required: false }
54
- });
55
- const emit = defineEmits(["update:selectedRows", "update:selectAll"]);
40
+ <script setup lang="ts">
41
+ import { computed } from 'vue'
42
+ import { ADataProvider } from '@katlux/providers'
43
+ import type { IKDatatableAction } from '@katlux/providers'
44
+
45
+ const props = defineProps<{
46
+ dataProvider: ADataProvider
47
+ visibleFields: Array<string> | null
48
+ rowActions: Array<IKDatatableAction>
49
+ bulkActions: Array<IKDatatableAction>
50
+ selectedRows: any[]
51
+ selectAll: boolean
52
+ cellSlots?: Record<string, any>
53
+ headerSlots?: Record<string, any>
54
+ columnHeaders?: Record<string, string>
55
+ columnWidths?: Record<string, string>
56
+ }>()
57
+
58
+ const emit = defineEmits<{
59
+ (e: 'update:selectedRows', value: any[]): void
60
+ (e: 'update:selectAll', value: boolean): void
61
+ }>()
62
+
63
+ // Bi-directional binding helpers
56
64
  const selectedRows = computed({
57
- get: () => props.selectedRows,
58
- set: (val) => emit("update:selectedRows", val)
59
- });
65
+ get: () => props.selectedRows,
66
+ set: (val) => emit('update:selectedRows', val)
67
+ })
68
+
60
69
  const selectAll = computed({
61
- get: () => props.selectAll,
62
- set: (val) => emit("update:selectAll", val)
63
- });
64
- const getCellSlot = (fieldName) => {
65
- const slotName = "cell-" + fieldName;
66
- return props.cellSlots?.[slotName];
67
- };
68
- const getHeaderSlot = (fieldName) => {
69
- const slotName = "header-" + fieldName;
70
- return props.headerSlots?.[slotName] || props.cellSlots?.[slotName];
71
- };
72
- const getColumnStyle = (field) => {
73
- const w = props.columnWidths?.[field];
74
- if (!w) return void 0;
75
- return { width: w, whiteSpace: "nowrap" };
76
- };
77
- const isLoading = computed(() => {
78
- return props.dataProvider.loading.value || props.dataProvider.initialLoad?.value || false;
79
- });
80
- </script>
70
+ get: () => props.selectAll,
71
+ set: (val) => emit('update:selectAll', val)
72
+ })
81
73
 
82
- <style scoped>
83
- .k-datatable {
84
- --page-height: 40px;
85
- width: 100%;
86
- }
87
- .k-datatable .datatable-container {
88
- min-height: calc(var(--page-height) * (var(--page-size) + 1));
89
- position: relative;
90
- }
91
- .k-datatable table {
92
- width: 100%;
93
- border-collapse: collapse;
94
- border: 1px solid #cccccc;
95
- }
96
- .k-datatable table thead tr {
97
- height: var(--page-height);
98
- }
99
- .k-datatable table thead tr th {
100
- border-bottom: 1px solid #cccccc;
101
- border-left: 1px solid #cccccc;
102
- padding: 5px;
103
- }
104
- .k-datatable table thead tr th:first-child {
105
- border-left: none;
106
- }
107
- .k-datatable table tbody tr {
108
- height: 40px;
109
- background-color: #faf8f8;
74
+ const getCellSlot = (fieldName: string) => {
75
+ const slotName = 'cell-' + fieldName
76
+ return props.cellSlots?.[slotName]
110
77
  }
111
- .k-datatable table tbody tr:nth-child(2n+1) {
112
- background-color: #ede9e9;
113
- }
114
- .k-datatable table tbody tr:hover {
115
- background-color: #f5e2e2;
116
- }
117
- .k-datatable table tbody tr td {
118
- padding: 5px;
119
- }
120
- .k-datatable .check {
121
- width: 30px;
122
- }
123
- .k-datatable .rowAction {
124
- width: 30px;
125
- }
126
- .k-datatable .rowAction {
127
- display: flex;
128
- gap: 10px;
78
+
79
+ const getHeaderSlot = (fieldName: string) => {
80
+ const slotName = 'header-' + fieldName
81
+ return props.headerSlots?.[slotName] || props.cellSlots?.[slotName]
129
82
  }
130
- .k-datatable .footer {
131
- display: flex;
132
- justify-content: space-between;
133
- align-items: center;
83
+
84
+ const getColumnStyle = (field: string) => {
85
+ const w = props.columnWidths?.[field]
86
+ if (!w) return undefined
87
+ return { width: w, whiteSpace: 'nowrap' as const }
134
88
  }
135
- .k-datatable .footer .pagination {
136
- flex: 1;
89
+
90
+ const isLoading = computed(() => {
91
+ return props.dataProvider.loading.value || (props.dataProvider as any).initialLoad?.value || false
92
+ })
93
+ </script>
94
+
95
+ <style lang="scss" scoped>
96
+ .k-datatable {
97
+ --page-height: 40px;
98
+ width: 100%;
99
+ .datatable-container {
100
+ min-height: calc(var(--page-height) * (var(--page-size) + 1));
101
+ position: relative; // Ensure loader overlay is contained
102
+ }
103
+ table {
104
+ width: 100%;
105
+ border-collapse: collapse;
106
+ border: 1px solid #cccccc;
107
+ thead {
108
+ tr {
109
+ background-color: color-mix(in srgb, var(--yellow-500), transparent 92%);
110
+ height: var(--page-height);
111
+ th {
112
+ border-bottom: 1px solid #cccccc;
113
+ border-left: 1px solid #cccccc;
114
+ padding: 5px;
115
+ &:first-child {
116
+ border-left: none;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ tbody {
122
+ tr {
123
+ height: 40px;
124
+ background-color: #faf8f8;
125
+ &:nth-child(2n + 1) {
126
+ background-color: #ede9e9;
127
+ }
128
+ &:hover {
129
+ background-color: #f5e2e2;
130
+ }
131
+ td {
132
+ padding: 5px;
133
+ }
134
+ }
135
+ }
136
+ }
137
+ .check {
138
+ width: 30px;
139
+ }
140
+ .rowAction {
141
+ width: 30px;
142
+ }
143
+ .rowAction {
144
+ display: flex;
145
+ gap: 10px;
146
+ }
147
+ .footer {
148
+ display: flex;
149
+ justify-content: space-between;
150
+ align-items: center;
151
+ .pagination {
152
+ flex: 1;
153
+ }
154
+ }
137
155
  }
138
156
  </style>
@@ -5,10 +5,17 @@ type __VLS_Props = {
5
5
  _date: any;
6
6
  calendarDay: Date | string;
7
7
  format: string;
8
+ showClear: boolean;
8
9
  calendarDefinedDays: IDefinedDay[];
9
10
  calendarMarkedDays: IMarkedDay[];
10
11
  textboxClicked: () => void;
12
+ onClear?: () => void;
11
13
  dateSelected: (date: Date) => void;
14
+ teleportTo?: string;
15
+ placeholder?: string;
16
+ validation?: 'success' | 'warning' | 'error' | null;
17
+ validationText?: string;
18
+ align?: 'left' | 'right';
12
19
  };
13
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
21
  "update:maskedModel": (value: string) => any;
@@ -1,33 +1,66 @@
1
1
  <template lang="pug">
2
- .KDatePicker
3
- KMaskTextbox(v-model="maskedModel" :key="maskedModel" :mask="format" :placeholder="format" @click="textboxClicked" showClear)
4
- KDropdown(v-model:isOpen="calendarShow" fullWidth)
2
+ .KDatePicker(ref="activatorRef")
3
+ KMaskTextbox(
4
+ v-model="maskedModel"
5
+ :key="maskedModel"
6
+ :mask="format"
7
+ :placeholder="placeholder || format"
8
+ @click.stop="textboxClicked"
9
+ :showClear="showClear"
10
+ @clear="onClear"
11
+ :validation="validation"
12
+ :validationText="validationText"
13
+ )
14
+ KDropdown(v-model:isOpen="calendarShow" :anchorEl="activatorRef" :teleportTo="teleportTo" :align="align")
5
15
  KCalendar(view="month" :viewCount="1" :day="calendarDay" :selectedDay="_date" @dayClicked="dateSelected" :definedDays="calendarDefinedDays" :markedDays="calendarMarkedDays")
6
16
  </template>
7
17
 
8
- <script setup>
9
- import { computed, watch } from "vue";
10
- const props = defineProps({
11
- maskedModel: { type: String, required: true },
12
- calendarShow: { type: Boolean, required: true },
13
- _date: { type: null, required: true },
14
- calendarDay: { type: [Date, String], required: true },
15
- format: { type: String, required: true },
16
- calendarDefinedDays: { type: Array, required: true },
17
- calendarMarkedDays: { type: Array, required: true },
18
- textboxClicked: { type: Function, required: true },
19
- dateSelected: { type: Function, required: true }
20
- });
21
- const emit = defineEmits(["update:maskedModel", "update:calendarShow"]);
18
+ <script lang="ts" setup>
19
+ import { computed, watch, ref } from 'vue'
20
+ const activatorRef = ref<HTMLElement | null>(null)
21
+ import type {
22
+ IMarkedDay,
23
+ IDefinedDay,
24
+ } from '../../../../components/KCalendar/types'
25
+
26
+ const props = defineProps<{
27
+ maskedModel: string
28
+ calendarShow: boolean
29
+ _date: any
30
+ calendarDay: Date | string
31
+ format: string
32
+ showClear: boolean
33
+ calendarDefinedDays: IDefinedDay[]
34
+ calendarMarkedDays: IMarkedDay[]
35
+ textboxClicked: () => void
36
+ onClear?: () => void
37
+ dateSelected: (date: Date) => void
38
+ teleportTo?: string
39
+ placeholder?: string
40
+ validation?: 'success' | 'warning' | 'error' | null
41
+ validationText?: string
42
+ align?: 'left' | 'right'
43
+ }>()
44
+
45
+ const emit = defineEmits<{
46
+ (e: 'update:maskedModel', value: string): void
47
+ (e: 'update:calendarShow', value: boolean): void
48
+ }>()
49
+
22
50
  const maskedModel = computed({
23
- get: () => props.maskedModel,
24
- set: (value) => emit("update:maskedModel", value)
25
- });
51
+ get: () => props.maskedModel,
52
+ set: (value) => emit('update:maskedModel', value)
53
+ })
54
+
26
55
  const calendarShow = computed({
27
- get: () => props.calendarShow,
28
- set: (value) => emit("update:calendarShow", value)
29
- });
56
+ get: () => props.calendarShow,
57
+ set: (value) => emit('update:calendarShow', value)
58
+ })
59
+
60
+ // Debug: watch prop changes
30
61
  watch(() => props.maskedModel, (newVal) => {
31
- console.log("Template component received new maskedModel prop:", newVal);
32
- });
62
+ })
33
63
  </script>
64
+
65
+ <style lang="scss" scoped>
66
+ </style>
@@ -5,10 +5,17 @@ type __VLS_Props = {
5
5
  _date: any;
6
6
  calendarDay: Date | string;
7
7
  format: string;
8
+ showClear: boolean;
8
9
  calendarDefinedDays: IDefinedDay[];
9
10
  calendarMarkedDays: IMarkedDay[];
10
11
  textboxClicked: () => void;
12
+ onClear?: () => void;
11
13
  dateSelected: (date: Date) => void;
14
+ teleportTo?: string;
15
+ placeholder?: string;
16
+ validation?: 'success' | 'warning' | 'error' | null;
17
+ validationText?: string;
18
+ align?: 'left' | 'right';
12
19
  };
13
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
21
  "update:maskedModel": (value: string) => any;
@@ -10,9 +10,15 @@ type __VLS_Props = {
10
10
  timeStep: number;
11
11
  calendarDefinedDays: IDefinedDay[];
12
12
  calendarMarkedDays: IMarkedDay[];
13
+ showClear: boolean;
13
14
  textboxClicked: () => void;
15
+ onClear?: () => void;
14
16
  dateSelected: (date: Date) => void;
15
17
  timeSelected: (time: string) => void;
18
+ teleportTo?: string;
19
+ placeholder?: string;
20
+ validation?: 'success' | 'warning' | 'error' | null;
21
+ validationText?: string;
16
22
  };
17
23
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
24
  "update:maskedModel": (value: string) => any;
@@ -1,66 +1,95 @@
1
1
  <template lang="pug">
2
- .KDateTimePicker
3
- KMaskTextbox(v-model="maskedModel" :key="maskedModel" :mask="format" :placeholder="format" @click="textboxClicked" showClear)
4
- KDropdown(v-model:isOpen="calendarShow" fullWidth)
5
- .datetime-picker-content
2
+ .KDateTimePicker(ref="activatorRef" @click.stop="textboxClicked")
3
+ KMaskTextbox(
4
+ v-model="maskedModel"
5
+ :key="maskedModel"
6
+ :mask="format"
7
+ :placeholder="placeholder || (format || 'MM-DD-YYYY HH:mm')"
8
+ @click.stop="textboxClicked"
9
+ :showClear="showClear"
10
+ @clear="onClear"
11
+ :validation="validation"
12
+ :validationText="validationText"
13
+ )
14
+ KDropdown(v-model:isOpen="calendarShow" :anchorEl="activatorRef" :teleportTo="teleportTo")
15
+ KGrid(direction="row" align="start" :noGap="false" wrap="nowrap").datetime-picker-grid
6
16
  .calendar-section
7
17
  KCalendar(view="month" :viewCount="1" :day="calendarDay" :selectedDay="_date" @dayClicked="dateSelected" :definedDays="calendarDefinedDays" :markedDays="calendarMarkedDays")
8
18
  .time-section
9
19
  KHourSelect(v-model="_time" :format="timeFormat" :step="timeStep" @update:modelValue="timeSelected")
10
20
  </template>
11
21
 
12
- <script setup>
13
- import { computed } from "vue";
14
- const props = defineProps({
15
- maskedModel: { type: String, required: true },
16
- calendarShow: { type: Boolean, required: true },
17
- _date: { type: null, required: true },
18
- _time: { type: String, required: true },
19
- calendarDay: { type: [Date, String], required: true },
20
- format: { type: String, required: true },
21
- timeFormat: { type: String, required: true },
22
- timeStep: { type: Number, required: true },
23
- calendarDefinedDays: { type: Array, required: true },
24
- calendarMarkedDays: { type: Array, required: true },
25
- textboxClicked: { type: Function, required: true },
26
- dateSelected: { type: Function, required: true },
27
- timeSelected: { type: Function, required: true }
28
- });
29
- const emit = defineEmits(["update:maskedModel", "update:calendarShow"]);
22
+ <script lang="ts" setup>
23
+ import { computed, watch, ref } from 'vue'
24
+ const activatorRef = ref<HTMLElement | null>(null)
25
+ import type {
26
+ IMarkedDay,
27
+ IDefinedDay,
28
+ } from '../../../../components/KCalendar/types'
29
+
30
+ const props = defineProps<{
31
+ maskedModel: string
32
+ calendarShow: boolean
33
+ _date: any
34
+ _time: string
35
+ calendarDay: Date | string
36
+ format: string
37
+ timeFormat: string
38
+ timeStep: number
39
+ calendarDefinedDays: IDefinedDay[]
40
+ calendarMarkedDays: IMarkedDay[]
41
+ showClear: boolean
42
+ textboxClicked: () => void
43
+ onClear?: () => void
44
+ dateSelected: (date: Date) => void
45
+ timeSelected: (time: string) => void
46
+ teleportTo?: string
47
+ placeholder?: string
48
+ validation?: 'success' | 'warning' | 'error' | null
49
+ validationText?: string
50
+ }>()
51
+
52
+ const emit = defineEmits<{
53
+ (e: 'update:maskedModel', value: string): void
54
+ (e: 'update:calendarShow', value: boolean): void
55
+ }>()
56
+
30
57
  const maskedModel = computed({
31
- get: () => props.maskedModel,
32
- set: (value) => emit("update:maskedModel", value)
33
- });
58
+ get: () => props.maskedModel,
59
+ set: (value) => emit('update:maskedModel', value)
60
+ })
61
+
34
62
  const calendarShow = computed({
35
- get: () => props.calendarShow,
36
- set: (value) => emit("update:calendarShow", value)
37
- });
63
+ get: () => props.calendarShow,
64
+ set: (value) => emit('update:calendarShow', value)
65
+ })
66
+
38
67
  const _time = computed({
39
- get: () => props._time,
40
- set: (value) => props.timeSelected(value)
41
- });
68
+ get: () => props._time,
69
+ set: (value) => props.timeSelected(value)
70
+ })
42
71
  </script>
43
72
 
44
- <style scoped>
45
- .KDateTimePicker .datetime-picker-content {
46
- display: flex;
47
- gap: 16px;
48
- padding: 8px;
49
- }
50
- .KDateTimePicker .datetime-picker-content .calendar-section {
51
- flex: 1;
52
- }
53
- .KDateTimePicker .datetime-picker-content .time-section {
54
- min-width: 120px;
55
- display: flex;
56
- flex-direction: column;
57
- }
58
- .KDateTimePicker .datetime-picker-content .time-section :deep(.KHourSelect) {
59
- display: flex;
60
- flex-direction: column;
61
- }
62
- .KDateTimePicker .datetime-picker-content .time-section :deep(.KHourSelect) .time-list {
63
- max-height: 280px;
64
- overflow-y: auto;
73
+ <style lang="scss" scoped>
74
+ .KDateTimePicker {
75
+ position: relative;
76
+ .datetime-picker-grid {
77
+ width: max-content;
78
+ padding: 8px;
79
+
80
+ .calendar-section {
81
+ }
82
+
83
+ .time-section {
84
+ min-width: 120px;
85
+
86
+ :deep(.KHourSelect) {
87
+ .time-list {
88
+ max-height: 310px;
89
+ overflow-y: auto;
90
+ }
91
+ }
92
+ }
93
+ }
65
94
  }
66
95
  </style>
@@ -10,9 +10,15 @@ type __VLS_Props = {
10
10
  timeStep: number;
11
11
  calendarDefinedDays: IDefinedDay[];
12
12
  calendarMarkedDays: IMarkedDay[];
13
+ showClear: boolean;
13
14
  textboxClicked: () => void;
15
+ onClear?: () => void;
14
16
  dateSelected: (date: Date) => void;
15
17
  timeSelected: (time: string) => void;
18
+ teleportTo?: string;
19
+ placeholder?: string;
20
+ validation?: 'success' | 'warning' | 'error' | null;
21
+ validationText?: string;
16
22
  };
17
23
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
24
  "update:maskedModel": (value: string) => any;
@@ -1,7 +1,17 @@
1
1
  type __VLS_Props = {
2
2
  open: boolean;
3
3
  fullWidth: boolean;
4
+ anchorEl?: HTMLElement;
5
+ dropdownRect: {
6
+ top: number;
7
+ left: number;
8
+ right: number;
9
+ width: number;
10
+ };
4
11
  clickoutside: () => void;
12
+ teleportTarget: string | null;
13
+ isInModal: boolean;
14
+ align?: 'left' | 'right';
5
15
  };
6
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
17
  declare const _default: typeof __VLS_export;