@katlux/toolkit 0.1.0-beta.5 → 0.1.0-beta.51

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 (171) 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/KButton/KButton.logic.d.ts +1 -1
  6. package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -12
  7. package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -12
  8. package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +1 -0
  9. package/dist/runtime/components/KCalendar/KCalendar.logic.js +25 -10
  10. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +21 -0
  11. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +3 -1
  12. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +21 -0
  13. package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +11 -0
  14. package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +9 -0
  15. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +48 -10
  16. package/dist/runtime/components/KCombobox/KCombobox.global.vue +9 -2
  17. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +48 -10
  18. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +94 -0
  19. package/dist/runtime/components/KCombobox/KCombobox.logic.js +60 -9
  20. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +169 -0
  21. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +46 -0
  22. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +169 -0
  23. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +127 -0
  24. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +160 -0
  25. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +20 -0
  26. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +12 -0
  27. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +77 -8
  28. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +25 -3
  29. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +77 -8
  30. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +33 -1
  31. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +98 -7
  32. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +75 -8
  33. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +25 -3
  34. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +75 -8
  35. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +33 -1
  36. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +157 -7
  37. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +18 -0
  38. package/dist/runtime/components/KDropdown/KDropdown.global.vue +13 -4
  39. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +18 -0
  40. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +28 -1
  41. package/dist/runtime/components/KDropdown/KDropdown.logic.js +85 -4
  42. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +7 -56
  43. package/dist/runtime/components/KGrid/KGrid.global.vue +9 -2
  44. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +7 -56
  45. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +41 -0
  46. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +27 -12
  47. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +41 -0
  48. package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +26 -3
  49. package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +34 -10
  50. package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +4 -1
  51. package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
  52. package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
  53. package/dist/runtime/components/KIcon/KIcon.logic.d.ts +1 -1
  54. package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
  55. package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +3 -3
  56. package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +3 -3
  57. package/dist/runtime/components/KLoader/KLoader.logic.d.ts +8 -1
  58. package/dist/runtime/components/KLoader/KLoader.logic.js +1 -0
  59. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +21 -0
  60. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +4 -2
  61. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +21 -0
  62. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +11 -0
  63. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +9 -0
  64. package/dist/runtime/components/KModal/KModal.global.vue +4 -1
  65. package/dist/runtime/components/KModal/KModal.logic.d.ts +3 -1
  66. package/dist/runtime/components/KModal/KModal.logic.js +6 -2
  67. package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +5 -28
  68. package/dist/runtime/components/KPanel/KPanel.global.vue +12 -4
  69. package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +5 -28
  70. package/dist/runtime/components/KPanel/KPanel.logic.d.ts +10 -0
  71. package/dist/runtime/components/KPanel/KPanel.logic.js +8 -0
  72. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
  73. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
  74. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
  75. package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
  76. package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
  77. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +21 -0
  78. package/dist/runtime/components/KTextarea/KTextarea.global.vue +3 -1
  79. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +21 -0
  80. package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +11 -0
  81. package/dist/runtime/components/KTextarea/KTextarea.logic.js +9 -0
  82. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +35 -2
  83. package/dist/runtime/components/KTextbox/KTextbox.global.vue +7 -4
  84. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +35 -2
  85. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +21 -4
  86. package/dist/runtime/components/KTextbox/KTextbox.logic.js +21 -5
  87. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +36 -7
  88. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +4 -1
  89. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +36 -7
  90. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +94 -0
  91. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +18 -1
  92. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
  93. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
  94. package/dist/runtime/composables/usePresetComponent.d.ts +16 -0
  95. package/dist/runtime/composables/usePresetComponent.js +21 -16
  96. package/dist/runtime/presets/default/assets/scss/css-variables.css +64 -13
  97. package/dist/runtime/presets/default/assets/scss/css-variables.scss +286 -0
  98. package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
  99. package/dist/runtime/presets/default/assets/scss/index.css +99 -13
  100. package/dist/runtime/presets/default/assets/scss/index.scss +42 -0
  101. package/dist/runtime/presets/default/assets/scss/mixins.scss +94 -0
  102. package/dist/runtime/presets/default/assets/scss/reset.scss +16 -0
  103. package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue +5 -2
  104. package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +40 -37
  105. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +29 -22
  106. package/dist/runtime/presets/default/components/KButton/KButton.vue +147 -428
  107. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +57 -53
  108. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +189 -161
  109. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +2 -0
  110. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +56 -42
  111. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +2 -0
  112. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +5 -0
  113. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +111 -87
  114. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +5 -0
  115. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +78 -60
  116. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +29 -0
  117. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +202 -0
  118. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +29 -0
  119. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +40 -31
  120. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +110 -92
  121. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +5 -0
  122. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +56 -25
  123. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +5 -0
  124. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +5 -0
  125. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +79 -52
  126. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +5 -0
  127. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +8 -0
  128. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +46 -25
  129. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +8 -0
  130. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +337 -241
  131. package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +40 -35
  132. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +170 -140
  133. package/dist/runtime/presets/default/components/KGrid/KGrid.vue +62 -60
  134. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +8 -2
  135. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +48 -28
  136. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +8 -2
  137. package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +34 -28
  138. package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
  139. package/dist/runtime/presets/default/components/KIcon/KIcon.vue +31 -22
  140. package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
  141. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +65 -48
  142. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +2 -0
  143. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +117 -84
  144. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +2 -0
  145. package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +1 -0
  146. package/dist/runtime/presets/default/components/KModal/KModal.vue +64 -35
  147. package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +1 -0
  148. package/dist/runtime/presets/default/components/KPagination/KPagination.vue +42 -40
  149. package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +3 -0
  150. package/dist/runtime/presets/default/components/KPanel/KPanel.vue +95 -34
  151. package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
  152. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
  153. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +40 -35
  154. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
  155. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +158 -125
  156. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +123 -100
  157. package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +40 -37
  158. package/dist/runtime/presets/default/components/KTabs/KTabs.vue +9 -6
  159. package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +2 -0
  160. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +28 -21
  161. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +2 -0
  162. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
  163. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +53 -36
  164. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
  165. package/dist/runtime/presets/default/components/KTree/KTree.vue +102 -80
  166. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +2 -0
  167. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +59 -34
  168. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +2 -0
  169. package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +31 -30
  170. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +34 -27
  171. 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: Object, 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: Object, 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,15 @@ 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
+ validation?: 'success' | 'warning' | 'error' | null;
16
+ validationText?: string;
12
17
  };
13
18
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
19
  "update:maskedModel": (value: string) => any;
@@ -1,33 +1,64 @@
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="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")
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
+ validation?: 'success' | 'warning' | 'error' | null
40
+ validationText?: string
41
+ }>()
42
+
43
+ const emit = defineEmits<{
44
+ (e: 'update:maskedModel', value: string): void
45
+ (e: 'update:calendarShow', value: boolean): void
46
+ }>()
47
+
22
48
  const maskedModel = computed({
23
- get: () => props.maskedModel,
24
- set: (value) => emit("update:maskedModel", value)
25
- });
49
+ get: () => props.maskedModel,
50
+ set: (value) => emit('update:maskedModel', value)
51
+ })
52
+
26
53
  const calendarShow = computed({
27
- get: () => props.calendarShow,
28
- set: (value) => emit("update:calendarShow", value)
29
- });
54
+ get: () => props.calendarShow,
55
+ set: (value) => emit('update:calendarShow', value)
56
+ })
57
+
58
+ // Debug: watch prop changes
30
59
  watch(() => props.maskedModel, (newVal) => {
31
- console.log("Template component received new maskedModel prop:", newVal);
32
- });
60
+ })
33
61
  </script>
62
+
63
+ <style lang="scss" scoped>
64
+ </style>
@@ -5,10 +5,15 @@ 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
+ validation?: 'success' | 'warning' | 'error' | null;
16
+ validationText?: string;
12
17
  };
13
18
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
19
  "update:maskedModel": (value: string) => any;
@@ -10,9 +10,14 @@ 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
+ validation?: 'success' | 'warning' | 'error' | null;
20
+ validationText?: string;
16
21
  };
17
22
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
23
  "update:maskedModel": (value: string) => any;
@@ -1,66 +1,93 @@
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="format"
8
+ :showClear="showClear"
9
+ @clear="onClear"
10
+ :validation="validation"
11
+ :validationText="validationText"
12
+ )
13
+ KDropdown(v-model:isOpen="calendarShow" :anchorEl="activatorRef" :teleportTo="teleportTo")
14
+ KGrid(direction="row" align="start" :noGap="false" wrap="nowrap").datetime-picker-grid
6
15
  .calendar-section
7
16
  KCalendar(view="month" :viewCount="1" :day="calendarDay" :selectedDay="_date" @dayClicked="dateSelected" :definedDays="calendarDefinedDays" :markedDays="calendarMarkedDays")
8
17
  .time-section
9
18
  KHourSelect(v-model="_time" :format="timeFormat" :step="timeStep" @update:modelValue="timeSelected")
10
19
  </template>
11
20
 
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"]);
21
+ <script lang="ts" setup>
22
+ import { computed, watch, ref } from 'vue'
23
+ const activatorRef = ref<HTMLElement | null>(null)
24
+ import type {
25
+ IMarkedDay,
26
+ IDefinedDay,
27
+ } from '../../../../components/KCalendar/types'
28
+
29
+ const props = defineProps<{
30
+ maskedModel: string
31
+ calendarShow: boolean
32
+ _date: any
33
+ _time: string
34
+ calendarDay: Date | string
35
+ format: string
36
+ timeFormat: string
37
+ timeStep: number
38
+ calendarDefinedDays: IDefinedDay[]
39
+ calendarMarkedDays: IMarkedDay[]
40
+ showClear: boolean
41
+ textboxClicked: () => void
42
+ onClear?: () => void
43
+ dateSelected: (date: Date) => void
44
+ timeSelected: (time: string) => void
45
+ teleportTo?: string
46
+ validation?: 'success' | 'warning' | 'error' | null
47
+ validationText?: string
48
+ }>()
49
+
50
+ const emit = defineEmits<{
51
+ (e: 'update:maskedModel', value: string): void
52
+ (e: 'update:calendarShow', value: boolean): void
53
+ }>()
54
+
30
55
  const maskedModel = computed({
31
- get: () => props.maskedModel,
32
- set: (value) => emit("update:maskedModel", value)
33
- });
56
+ get: () => props.maskedModel,
57
+ set: (value) => emit('update:maskedModel', value)
58
+ })
59
+
34
60
  const calendarShow = computed({
35
- get: () => props.calendarShow,
36
- set: (value) => emit("update:calendarShow", value)
37
- });
61
+ get: () => props.calendarShow,
62
+ set: (value) => emit('update:calendarShow', value)
63
+ })
64
+
38
65
  const _time = computed({
39
- get: () => props._time,
40
- set: (value) => props.timeSelected(value)
41
- });
66
+ get: () => props._time,
67
+ set: (value) => props.timeSelected(value)
68
+ })
42
69
  </script>
43
70
 
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;
71
+ <style lang="scss" scoped>
72
+ .KDateTimePicker {
73
+ position: relative;
74
+ .datetime-picker-grid {
75
+ width: max-content;
76
+ padding: 8px;
77
+
78
+ .calendar-section {
79
+ }
80
+
81
+ .time-section {
82
+ min-width: 120px;
83
+
84
+ :deep(.KHourSelect) {
85
+ .time-list {
86
+ max-height: 310px;
87
+ overflow-y: auto;
88
+ }
89
+ }
90
+ }
91
+ }
65
92
  }
66
93
  </style>
@@ -10,9 +10,14 @@ 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
+ validation?: 'success' | 'warning' | 'error' | null;
20
+ validationText?: string;
16
21
  };
17
22
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
23
  "update:maskedModel": (value: string) => any;
@@ -1,7 +1,15 @@
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
+ width: number;
9
+ };
4
10
  clickoutside: () => void;
11
+ teleportTarget: string | null;
12
+ isInModal: boolean;
5
13
  };
6
14
  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
15
  declare const _default: typeof __VLS_export;