@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
@@ -1,18 +1,22 @@
1
1
  <template lang="pug">
2
- .KCombobox(v-click-outside="closeDropdown" :class="{ disabled: disabled, open: isOptionsOpen }")
3
- KGrid(@click.stop="toggleDropdown" align="center" justify="space-between").KCombobox__selected-content-container
4
- KGrid(align="center" wrap="no-wrap").KCombobox__selected-content
5
- .KCombobox__selected-content-item(
6
- v-if="getSelectedContent().length>0"
7
- v-for="(item, index) in getSelectedContent()"
8
- :key="item.value || item.id || index"
9
- ) {{ item[labelField] }}
10
- .KCombobox__selected-content-placeholder(v-else) {{placeholder}}
11
- KIcon(iconname="chevron" width="12" height="12").chevron
12
- KDropdown(:isOpen="isOptionsOpen" fullWidth).KCombobox__options
13
- slot
2
+ .KCombobox-wrapper
3
+ .KCombobox(ref="activatorRef" :class="{ disabled: disabled, open: isOptionsOpen, ... (validation ? { [`is-${validation}`]: true } : {}) }")
4
+ KGrid(@click.stop="toggleDropdown" align="center" justify="space-between").KCombobox__selected-content-container
5
+ KGrid(align="center" wrap="no-wrap").KCombobox__selected-content
6
+ .KCombobox__selected-content-item(
7
+ v-if="getSelectedContent().length>0"
8
+ v-for="(item, index) in getSelectedContent()"
9
+ :key="item.value || item.id || index"
10
+ ) {{ item[labelField] }}
11
+ .KCombobox__selected-content-placeholder(v-else) {{placeholder}}
12
+ KIcon(iconname="chevron" width="20" height="20").chevron
13
+ KDropdown(v-model:isOpen="isOptionsOpenModel" :anchorEl="activatorRef" :fullWidth="fullWidth" :teleportTo="teleportTo").KCombobox__options
14
+ template(v-if="slots.default")
15
+ slot(name="default")
14
16
  KComboboxList(
17
+ v-else
15
18
  :searchbox="searchbox"
19
+ :searchPlaceholder="searchPlaceholder"
16
20
  v-model:searchtext="searchtextModel"
17
21
  :loading="loading"
18
22
  :filteredOptions="filteredOptions"
@@ -20,78 +24,103 @@
20
24
  :selectItem="selectItem"
21
25
  :isSelected="isSelected"
22
26
  )
27
+ span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
23
28
  </template>
24
29
 
25
- <script setup>
26
- import { computed } from "vue";
27
- import KComboboxList from "./KComboboxList.vue";
28
- const props = defineProps({
29
- disabled: { type: Boolean, required: true },
30
- isOptionsOpen: { type: Boolean, required: true },
31
- labelField: { type: String, required: true },
32
- placeholder: { type: String, required: true },
33
- searchbox: { type: Boolean, required: true },
34
- searchtext: { type: String, required: true },
35
- filteredOptions: { type: Array, required: true },
36
- getSelectedContent: { type: Function, required: true },
37
- toggleDropdown: { type: Function, required: true },
38
- closeDropdown: { type: Function, required: true },
39
- selectItem: { type: Function, required: true },
40
- isSelected: { type: Function, required: true },
41
- loading: { type: Boolean, required: true }
42
- });
43
- const emit = defineEmits(["update:searchtext"]);
30
+ <script lang="ts" setup>
31
+ import { computed, ref, useSlots } from 'vue'
32
+ const activatorRef = ref<HTMLElement | null>(null)
33
+ const slots = useSlots()
34
+ import KComboboxList from './KComboboxList.vue'
35
+ import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.logic'
36
+
37
+ const props = defineProps<{
38
+ disabled: boolean
39
+ isOptionsOpen: boolean
40
+ labelField: string
41
+ placeholder: string
42
+ searchbox: boolean
43
+ searchPlaceholder: string
44
+ searchtext: string
45
+ filteredOptions: any[]
46
+ getSelectedContent: () => any[]
47
+ toggleDropdown: () => void
48
+ closeDropdown: () => void
49
+ selectItem: (option: ComboboxItem) => void
50
+ isSelected: (option: ComboboxItem) => boolean
51
+ loading: boolean
52
+ teleportTo?: string
53
+ fullWidth: boolean
54
+ validation?: 'success' | 'warning' | 'error' | null
55
+ validationText?: string
56
+ }>()
57
+
58
+ const emit = defineEmits<{
59
+ (e: 'update:searchtext', value: string): void
60
+ (e: 'update:isOptionsOpen', value: boolean): void
61
+ }>()
62
+
44
63
  const searchtextModel = computed({
45
- get: () => props.searchtext,
46
- set: (value) => emit("update:searchtext", value)
47
- });
64
+ get: () => props.searchtext,
65
+ set: (value) => emit('update:searchtext', value)
66
+ })
67
+
68
+ const isOptionsOpenModel = computed({
69
+ get: () => props.isOptionsOpen,
70
+ set: (value) => emit('update:isOptionsOpen', value)
71
+ })
48
72
  </script>
49
73
 
50
- <style scoped>
74
+ <style lang="scss" scoped>
51
75
  .KCombobox {
52
- box-sizing: border-box;
53
- width: 200px;
54
- border: var(--input-border);
55
- border-radius: var(--input-border-radius);
56
- padding: 0px var(--component-gap);
57
- background-color: var(--neutral-50);
58
- height: 40px;
59
- position: relative;
60
- }
61
- .KCombobox__selected-content-container {
62
- cursor: pointer;
63
- box-sizing: border-box;
64
- height: 100%;
65
- }
66
- .KCombobox .chevron {
67
- transform: rotate(90deg);
68
- transition: transform 0.3s ease-in-out;
69
- }
70
- .KCombobox.open .chevron {
71
- transform: rotate(270deg);
72
- }
73
- .KCombobox.disabled {
74
- opacity: 0.5;
75
- cursor: not-allowed;
76
- }
77
- .KCombobox__selected-content {
78
- height: 100%;
79
- max-width: calc(100% - 40px);
80
- text-overflow: ellipsis;
81
- overflow: hidden;
82
- white-space: nowrap;
83
- gap: var(--component-gap);
84
- }
85
- .KCombobox__selected-content-item {
86
- padding: calc(var(--component-gap) / 2);
87
- border: var(--input-border);
88
- border-radius: var(--input-border-radius);
89
- background-color: var(--input-button-bg);
90
- }
91
- .KCombobox__selected-content-item:hover {
92
- background-color: var(--input-button-hover-bg);
93
- }
94
- .KCombobox__selected-content-placeholder {
95
- color: var(--neutral-400);
76
+ box-sizing: border-box;
77
+ border: var(--input-border);
78
+ border-radius: var(--input-border-radius);
79
+ padding: 0px var(--component-gap);
80
+
81
+ background-color: var(--neutral-50);
82
+ height: 40px;
83
+ position: relative;
84
+ &__selected-content-container {
85
+ cursor: pointer;
86
+
87
+ box-sizing: border-box;
88
+ height: 100%;
89
+ }
90
+ .chevron {
91
+ transform: rotate(90deg);
92
+ transition: transform 0.3s ease-in-out;
93
+ flex-shrink: 0;
94
+ min-width: 20px;
95
+ }
96
+ &.open {
97
+ .chevron {
98
+ transform: rotate(270deg);
99
+ }
100
+ }
101
+ &.disabled {
102
+ opacity: 0.5;
103
+ cursor: not-allowed;
104
+ }
105
+ &__selected-content {
106
+ height: 100%;
107
+ max-width: calc(100% - 40px);
108
+ text-overflow: ellipsis;
109
+ overflow: hidden;
110
+ white-space: nowrap;
111
+ gap: var(--component-gap);
112
+ &-item {
113
+ padding: calc(var(--component-gap) / 2);
114
+ border: var(--input-border);
115
+ border-radius: var(--input-border-radius);
116
+ background-color: var(--input-button-bg);
117
+ &:hover {
118
+ background-color: var(--input-button-hover-bg);
119
+ }
120
+ }
121
+ }
122
+ &__selected-content-placeholder {
123
+ color: var(--neutral-400);
124
+ }
96
125
  }
97
126
  </style>
@@ -5,6 +5,7 @@ type __VLS_Props = {
5
5
  labelField: string;
6
6
  placeholder: string;
7
7
  searchbox: boolean;
8
+ searchPlaceholder: string;
8
9
  searchtext: string;
9
10
  filteredOptions: any[];
10
11
  getSelectedContent: () => any[];
@@ -13,10 +14,16 @@ type __VLS_Props = {
13
14
  selectItem: (option: ComboboxItem) => void;
14
15
  isSelected: (option: ComboboxItem) => boolean;
15
16
  loading: boolean;
17
+ teleportTo?: string;
18
+ fullWidth: boolean;
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, {} & {
23
+ "update:isOptionsOpen": (value: boolean) => any;
18
24
  "update:searchtext": (value: string) => any;
19
25
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
26
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
20
27
  "onUpdate:searchtext"?: ((value: string) => any) | undefined;
21
28
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
29
  declare const _default: typeof __VLS_export;
@@ -2,6 +2,7 @@ import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.lo
2
2
  type __VLS_Props = {
3
3
  searchbox: boolean;
4
4
  searchtext: string;
5
+ searchPlaceholder: string;
5
6
  loading: boolean;
6
7
  filteredOptions: any[];
7
8
  labelField: string;
@@ -1,6 +1,6 @@
1
1
  <template lang="pug">
2
2
  .KCombobox__options-content
3
- KTextbox(v-if="searchbox" v-model="searchtextModel" placeholder="Search..." showClear)
3
+ KTextbox(v-if="searchbox" v-model="searchtextModel" :placeholder="searchPlaceholder" :showClear="true")
4
4
  .KCombobox__loading(v-if="loading")
5
5
  .KCombobox__loading-spinner
6
6
  ul.KCombobox__options-list(v-else)
@@ -10,74 +10,92 @@
10
10
  @click.stop="selectItem(option)"
11
11
  )
12
12
  KGrid(align="center" justify="space-between" wrap="nowrap")
13
- span {{ option[labelField] }}
13
+ span.KCombobox__options-list-item__text {{ option[labelField] }}
14
14
  KIcon(iconname="check" width="12" height="12" :class="{'visible': isSelected(option)}")
15
15
  </template>
16
16
 
17
- <script setup>
18
- import { computed } from "vue";
19
- const props = defineProps({
20
- searchbox: { type: Boolean, required: true },
21
- searchtext: { type: String, required: true },
22
- loading: { type: Boolean, required: true },
23
- filteredOptions: { type: Array, required: true },
24
- labelField: { type: String, required: true },
25
- selectItem: { type: Function, required: true },
26
- isSelected: { type: Function, required: true }
27
- });
28
- const emit = defineEmits(["update:searchtext"]);
17
+ <script lang="ts" setup>
18
+ import { computed } from 'vue'
19
+ import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.logic'
20
+
21
+ const props = defineProps<{
22
+ searchbox: boolean
23
+ searchtext: string
24
+ searchPlaceholder: string
25
+ loading: boolean
26
+ filteredOptions: any[]
27
+ labelField: string
28
+ selectItem: (option: ComboboxItem) => void
29
+ isSelected: (option: ComboboxItem) => boolean
30
+ }>()
31
+
32
+ const emit = defineEmits<{
33
+ (e: 'update:searchtext', value: string): void
34
+ }>()
35
+
29
36
  const searchtextModel = computed({
30
- get: () => props.searchtext,
31
- set: (value) => emit("update:searchtext", value)
32
- });
37
+ get: () => props.searchtext,
38
+ set: (value) => emit('update:searchtext', value)
39
+ })
33
40
  </script>
34
41
 
35
- <style scoped>
36
- .KCombobox__options-content {
37
- margin: -var(--grid-gap);
38
- }
39
- .KCombobox__options-list {
40
- max-height: 500px;
41
- overflow-y: auto;
42
- }
43
- .KCombobox__options-list-item {
44
- cursor: pointer;
45
- height: 40px;
46
- padding: 10px;
47
- box-sizing: border-box;
48
- border-bottom: 1px solid var(--border-color-light);
49
- }
50
- .KCombobox__options-list-item:hover {
51
- background-color: var(--background-color-medium);
52
- }
53
- .KCombobox__options-list-item:last-child {
54
- border-bottom: none;
55
- }
56
- .KCombobox__options-list .KIcon {
57
- visibility: hidden;
58
- }
59
- .KCombobox__options-list .KIcon.visible {
60
- visibility: visible;
61
- width: 12px;
42
+ <style lang="scss" scoped>
43
+ .KCombobox__options {
44
+ &-content {
45
+ margin: -var(--grid-gap);
46
+ }
47
+ &-list {
48
+ max-height: 500px;
49
+ overflow-y: auto;
50
+ &-item {
51
+ cursor: pointer;
52
+ height: 40px;
53
+ padding: 10px;
54
+ box-sizing: border-box;
55
+
56
+ border-bottom: 1px solid var(--border-color-light);
57
+ &:hover {
58
+ background-color: var(--background-color-medium);
59
+ }
60
+ &:last-child {
61
+ border-bottom: none;
62
+ }
63
+ &__text {
64
+ text-overflow: ellipsis;
65
+ overflow: hidden;
66
+ white-space: nowrap;
67
+ }
68
+ }
69
+
70
+ .KIcon {
71
+ visibility: hidden;
72
+ &.visible {
73
+ visibility: visible;
74
+ width: 12px;
75
+ }
76
+ }
77
+ }
62
78
  }
63
79
 
64
80
  .KCombobox__loading {
65
- padding: 10px;
66
- display: flex;
67
- justify-content: center;
68
- align-items: center;
69
- }
70
- .KCombobox__loading-spinner {
71
- width: 20px;
72
- height: 20px;
73
- border: 2px solid var(--border-color-light);
74
- border-top-color: var(--primary-color-500);
75
- border-radius: 50%;
76
- animation: spin 0.8s linear infinite;
77
- }
78
- @keyframes spin {
79
- to {
80
- transform: rotate(360deg);
81
- }
81
+ padding: 10px;
82
+ display: flex;
83
+ justify-content: center;
84
+ align-items: center;
85
+
86
+ &-spinner {
87
+ width: 20px;
88
+ height: 20px;
89
+ border: 2px solid var(--border-color-light);
90
+ border-top-color: var(--primary-color-500);
91
+ border-radius: 50%;
92
+ animation: spin 0.8s linear infinite;
93
+ }
94
+
95
+ @keyframes spin {
96
+ to {
97
+ transform: rotate(360deg);
98
+ }
99
+ }
82
100
  }
83
101
  </style>
@@ -2,6 +2,7 @@ import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.lo
2
2
  type __VLS_Props = {
3
3
  searchbox: boolean;
4
4
  searchtext: string;
5
+ searchPlaceholder: string;
5
6
  loading: boolean;
6
7
  filteredOptions: any[];
7
8
  labelField: string;
@@ -0,0 +1,29 @@
1
+ import type { ADataProvider } from '@katlux/providers';
2
+ type __VLS_Props = {
3
+ selectionValue: any;
4
+ inputValue: any;
5
+ modelValue: any[];
6
+ dataProvider: ADataProvider;
7
+ type: string;
8
+ selectionSide: string;
9
+ inputType: any;
10
+ mask: string;
11
+ labelField: string;
12
+ valueField: string;
13
+ placeholder: string;
14
+ inputPlaceholder: string;
15
+ searchbox: boolean;
16
+ showClear: boolean;
17
+ teleportTo?: string;
18
+ validation?: 'success' | 'warning' | 'error' | null;
19
+ validationText?: string;
20
+ };
21
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
22
+ "update:selectionValue": (value: any) => any;
23
+ "update:inputValue": (value: any) => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ "onUpdate:selectionValue"?: ((value: any) => any) | undefined;
26
+ "onUpdate:inputValue"?: ((value: any) => any) | undefined;
27
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
@@ -0,0 +1,202 @@
1
+ <template lang="pug">
2
+ .KCompositeInput-wrapper
3
+ .KCompositeInput(:class="{'selection-right': selectionSide === 'right'}")
4
+ KGrid(gap="0" align="stretch" :class="validation ? `is-${validation}` : ''")
5
+ //- Selection Combobox
6
+ .KCompositeInput-selection(:style="selectionStyle")
7
+ KCombobox(
8
+ v-model="selectionValue"
9
+ :dataProvider="dataProvider"
10
+ :labelField="labelField"
11
+ :valueField="valueField"
12
+ :placeholder="placeholder"
13
+ :searchbox="searchbox"
14
+ closeOnSelect
15
+ :teleportTo="teleportTo"
16
+ :validation="validation"
17
+ )
18
+
19
+ //- Secondary Input
20
+ .KCompositeInput-main
21
+ template(v-if="type === 'textbox'")
22
+ KTextbox(
23
+ v-model="inputValue"
24
+ :type="inputType"
25
+ :placeholder="inputPlaceholder"
26
+ :showClear="showClear"
27
+ :validation="validation"
28
+ )
29
+ template(v-else-if="type === 'textarea'")
30
+ KTextarea(
31
+ v-model="inputValue"
32
+ :placeholder="inputPlaceholder"
33
+ :validation="validation"
34
+ )
35
+ template(v-else-if="type === 'maskedtextbox'")
36
+ KMaskTextbox(
37
+ v-model="inputValue"
38
+ :mask="mask"
39
+ :placeholder="inputPlaceholder"
40
+ :showClear="showClear"
41
+ :validation="validation"
42
+ )
43
+ template(v-else-if="type === 'combobox'")
44
+ //- For internal combobox, we assume same items for now or specific logic could be added
45
+ KCombobox(
46
+ v-model="inputValue"
47
+ :dataProvider="dataProvider"
48
+ :labelField="labelField"
49
+ :valueField="valueField"
50
+ :placeholder="inputPlaceholder"
51
+ :searchbox="searchbox"
52
+ :teleportTo="teleportTo"
53
+ :validation="validation"
54
+ )
55
+ template(v-else-if="type === 'datepicker'")
56
+ KDatePicker(
57
+ v-model="inputValue"
58
+ :placeholder="inputPlaceholder"
59
+ :showClear="showClear"
60
+ :validation="validation"
61
+ )
62
+ template(v-else-if="type === 'datetimepicker'")
63
+ KDateTimePicker(
64
+ v-model="inputValue"
65
+ :placeholder="inputPlaceholder"
66
+ :showClear="showClear"
67
+ :validation="validation"
68
+ )
69
+ template(v-else-if="type === 'hourpicker'")
70
+ KHourPicker(
71
+ v-model="inputValue"
72
+ :placeholder="inputPlaceholder"
73
+ :showClear="showClear"
74
+ :validation="validation"
75
+ )
76
+ span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
77
+ </template>
78
+
79
+ <script lang="ts" setup>
80
+ import { computed } from 'vue'
81
+ import type { ADataProvider } from '@katlux/providers'
82
+
83
+ const props = defineProps<{
84
+ selectionValue: any
85
+ inputValue: any
86
+ modelValue: any[]
87
+ dataProvider: ADataProvider
88
+ type: string
89
+ selectionSide: string
90
+ inputType: any
91
+ mask: string
92
+ labelField: string
93
+ valueField: string
94
+ placeholder: string
95
+ inputPlaceholder: string
96
+ searchbox: boolean
97
+ showClear: boolean
98
+ teleportTo?: string
99
+ validation?: 'success' | 'warning' | 'error' | null
100
+ validationText?: string
101
+ }>()
102
+
103
+ const emit = defineEmits<{
104
+ (e: 'update:selectionValue', value: any): void
105
+ (e: 'update:inputValue', value: any): void
106
+ }>()
107
+
108
+ const selectionValue = computed({
109
+ get: () => props.selectionValue,
110
+ set: (val) => emit('update:selectionValue', val)
111
+ })
112
+
113
+ const inputValue = computed({
114
+ get: () => props.inputValue,
115
+ set: (val) => emit('update:inputValue', val)
116
+ })
117
+
118
+ const selectionStyle = computed(() => ({
119
+ width: '120px', // Default width for selection, can be made prop if needed
120
+ flex: '0 0 auto'
121
+ }))
122
+ </script>
123
+
124
+ <style lang="scss" scoped>
125
+ .KCompositeInput {
126
+ width: 100%;
127
+
128
+ :deep(.KGrid) {
129
+ border: 1px solid var(--neutral-200);
130
+ border-radius: var(--radius-md);
131
+ overflow: hidden;
132
+ background: var(--neutral-50);
133
+
134
+ &:focus-within {
135
+ border-color: var(--primary-500);
136
+ box-shadow: 0 0 0 2px var(--primary-100);
137
+ }
138
+ }
139
+
140
+ &-selection {
141
+ border-right: 1px solid var(--neutral-200);
142
+
143
+ :deep(.KGrid).is-error & { border-right-color: var(--error-500); }
144
+ :deep(.KGrid).is-warning & { border-right-color: var(--warning-500); }
145
+ :deep(.KGrid).is-success & { border-right-color: var(--success-500); }
146
+
147
+ :deep(.KCombobox) {
148
+ border: none !important;
149
+ background: transparent !important;
150
+ box-shadow: none !important;
151
+ padding: 0 !important;
152
+ }
153
+ }
154
+
155
+ &-main {
156
+ flex: 1;
157
+ min-width: 0;
158
+ display: flex;
159
+ align-items: center;
160
+
161
+ :deep(.KTextbox), :deep(.KTextarea), :deep(.KMaskTextbox), :deep(.KCombobox),
162
+ :deep(.KDatePicker), :deep(.KDateTimePicker), :deep(.KHourPicker) {
163
+ width: 100%;
164
+ border: none !important;
165
+ background: transparent !important;
166
+ box-shadow: none !important;
167
+ padding: 0 !important;
168
+
169
+ // Ensure they don't have their own internal grids with borders
170
+ .KTextbox, .KGrid, .KCombobox, .KDatePicker, .KDateTimePicker, .KHourPicker {
171
+ border: none !important;
172
+ background: transparent !important;
173
+ box-shadow: none !important;
174
+ padding: 0 !important;
175
+ }
176
+
177
+ input, textarea, .KCombobox-trigger {
178
+ border: none !important;
179
+ border-radius: 0 !important;
180
+ background: transparent !important;
181
+ box-shadow: none !important;
182
+ outline: none !important;
183
+ padding: 0 12px !important;
184
+ }
185
+ }
186
+ }
187
+
188
+ &.selection-right {
189
+ .KGrid {
190
+ flex-direction: row-reverse;
191
+ }
192
+ .KCompositeInput-selection {
193
+ border-right: none;
194
+ border-left: 1px solid var(--neutral-200);
195
+
196
+ :deep(.KGrid).is-error & { border-left-color: var(--error-500); }
197
+ :deep(.KGrid).is-warning & { border-left-color: var(--warning-500); }
198
+ :deep(.KGrid).is-success & { border-left-color: var(--success-500); }
199
+ }
200
+ }
201
+ }
202
+ </style>
@@ -0,0 +1,29 @@
1
+ import type { ADataProvider } from '@katlux/providers';
2
+ type __VLS_Props = {
3
+ selectionValue: any;
4
+ inputValue: any;
5
+ modelValue: any[];
6
+ dataProvider: ADataProvider;
7
+ type: string;
8
+ selectionSide: string;
9
+ inputType: any;
10
+ mask: string;
11
+ labelField: string;
12
+ valueField: string;
13
+ placeholder: string;
14
+ inputPlaceholder: string;
15
+ searchbox: boolean;
16
+ showClear: boolean;
17
+ teleportTo?: string;
18
+ validation?: 'success' | 'warning' | 'error' | null;
19
+ validationText?: string;
20
+ };
21
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
22
+ "update:selectionValue": (value: any) => any;
23
+ "update:inputValue": (value: any) => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ "onUpdate:selectionValue"?: ((value: any) => any) | undefined;
26
+ "onUpdate:inputValue"?: ((value: any) => any) | undefined;
27
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;