@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
@@ -1,96 +1,120 @@
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
14
- KComboboxList(
15
- :searchbox="searchbox"
16
- v-model:searchtext="searchtextModel"
17
- :loading="loading"
18
- :filteredOptions="filteredOptions"
19
- :labelField="labelField"
20
- :selectItem="selectItem"
21
- :isSelected="isSelected"
22
- )
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 :teleportTo="teleportTo").KCombobox__options
14
+ slot
15
+ KComboboxList(
16
+ :searchbox="searchbox"
17
+ v-model:searchtext="searchtextModel"
18
+ :loading="loading"
19
+ :filteredOptions="filteredOptions"
20
+ :labelField="labelField"
21
+ :selectItem="selectItem"
22
+ :isSelected="isSelected"
23
+ )
24
+ span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
23
25
  </template>
24
26
 
25
- <script setup>
26
- import KComboboxList from "./KComboboxList.vue";
27
- const props = defineProps({
28
- disabled: { type: Boolean, required: true },
29
- isOptionsOpen: { type: Boolean, required: true },
30
- labelField: { type: String, required: true },
31
- placeholder: { type: String, required: true },
32
- searchbox: { type: Boolean, required: true },
33
- searchtext: { type: String, required: true },
34
- filteredOptions: { type: Array, required: true },
35
- getSelectedContent: { type: Function, required: true },
36
- toggleDropdown: { type: Function, required: true },
37
- closeDropdown: { type: Function, required: true },
38
- selectItem: { type: Function, required: true },
39
- isSelected: { type: Function, required: true },
40
- loading: { type: Boolean, required: true }
41
- });
42
- const emit = defineEmits(["update:searchtext"]);
27
+ <script lang="ts" setup>
28
+ import { computed, ref } from 'vue'
29
+ const activatorRef = ref<HTMLElement | null>(null)
30
+ import KComboboxList from './KComboboxList.vue'
31
+ import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.logic'
32
+
33
+ const props = defineProps<{
34
+ disabled: boolean
35
+ isOptionsOpen: boolean
36
+ labelField: string
37
+ placeholder: string
38
+ searchbox: boolean
39
+ searchtext: string
40
+ filteredOptions: any[]
41
+ getSelectedContent: () => any[]
42
+ toggleDropdown: () => void
43
+ closeDropdown: () => void
44
+ selectItem: (option: ComboboxItem) => void
45
+ isSelected: (option: ComboboxItem) => boolean
46
+ loading: boolean
47
+ teleportTo?: string
48
+ validation?: 'success' | 'warning' | 'error' | null
49
+ validationText?: string
50
+ }>()
51
+
52
+ const emit = defineEmits<{
53
+ (e: 'update:searchtext', value: string): void
54
+ (e: 'update:isOptionsOpen', value: boolean): void
55
+ }>()
56
+
43
57
  const searchtextModel = computed({
44
- get: () => props.searchtext,
45
- set: (value) => emit("update:searchtext", value)
46
- });
58
+ get: () => props.searchtext,
59
+ set: (value) => emit('update:searchtext', value)
60
+ })
61
+
62
+ const isOptionsOpenModel = computed({
63
+ get: () => props.isOptionsOpen,
64
+ set: (value) => emit('update:isOptionsOpen', value)
65
+ })
47
66
  </script>
48
67
 
49
- <style scoped>
68
+ <style lang="scss" scoped>
50
69
  .KCombobox {
51
- box-sizing: border-box;
52
- width: 200px;
53
- border: var(--input-border);
54
- border-radius: var(--input-border-radius);
55
- padding: 0px var(--component-gap);
56
- background-color: var(--neutral-50);
57
- height: 40px;
58
- position: relative;
59
- }
60
- .KCombobox__selected-content-container {
61
- cursor: pointer;
62
- box-sizing: border-box;
63
- height: 100%;
64
- }
65
- .KCombobox .chevron {
66
- transform: rotate(90deg);
67
- transition: transform 0.3s ease-in-out;
68
- }
69
- .KCombobox.open .chevron {
70
- transform: rotate(270deg);
71
- }
72
- .KCombobox.disabled {
73
- opacity: 0.5;
74
- cursor: not-allowed;
75
- }
76
- .KCombobox__selected-content {
77
- height: 100%;
78
- max-width: calc(100% - 40px);
79
- text-overflow: ellipsis;
80
- overflow: hidden;
81
- white-space: nowrap;
82
- gap: var(--component-gap);
83
- }
84
- .KCombobox__selected-content-item {
85
- padding: calc(var(--component-gap) / 2);
86
- border: var(--input-border);
87
- border-radius: var(--input-border-radius);
88
- background-color: var(--input-button-bg);
89
- }
90
- .KCombobox__selected-content-item:hover {
91
- background-color: var(--input-button-hover-bg);
92
- }
93
- .KCombobox__selected-content-placeholder {
94
- color: var(--neutral-400);
70
+ box-sizing: border-box;
71
+ border: var(--input-border);
72
+ border-radius: var(--input-border-radius);
73
+ padding: 0px var(--component-gap);
74
+
75
+ background-color: var(--neutral-50);
76
+ height: 40px;
77
+ position: relative;
78
+ &__selected-content-container {
79
+ cursor: pointer;
80
+
81
+ box-sizing: border-box;
82
+ height: 100%;
83
+ }
84
+ .chevron {
85
+ transform: rotate(90deg);
86
+ transition: transform 0.3s ease-in-out;
87
+ flex-shrink: 0;
88
+ min-width: 20px;
89
+ }
90
+ &.open {
91
+ .chevron {
92
+ transform: rotate(270deg);
93
+ }
94
+ }
95
+ &.disabled {
96
+ opacity: 0.5;
97
+ cursor: not-allowed;
98
+ }
99
+ &__selected-content {
100
+ height: 100%;
101
+ max-width: calc(100% - 40px);
102
+ text-overflow: ellipsis;
103
+ overflow: hidden;
104
+ white-space: nowrap;
105
+ gap: var(--component-gap);
106
+ &-item {
107
+ padding: calc(var(--component-gap) / 2);
108
+ border: var(--input-border);
109
+ border-radius: var(--input-border-radius);
110
+ background-color: var(--input-button-bg);
111
+ &:hover {
112
+ background-color: var(--input-button-hover-bg);
113
+ }
114
+ }
115
+ }
116
+ &__selected-content-placeholder {
117
+ color: var(--neutral-400);
118
+ }
95
119
  }
96
120
  </style>
@@ -13,11 +13,16 @@ type __VLS_Props = {
13
13
  selectItem: (option: ComboboxItem) => void;
14
14
  isSelected: (option: ComboboxItem) => boolean;
15
15
  loading: boolean;
16
+ teleportTo?: string;
17
+ validation?: 'success' | 'warning' | 'error' | null;
18
+ validationText?: string;
16
19
  };
17
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
21
  "update:searchtext": (value: string) => any;
22
+ "update:isOptionsOpen": (value: boolean) => any;
19
23
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
24
  "onUpdate:searchtext"?: ((value: string) => any) | undefined;
25
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
21
26
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
27
  declare const _default: typeof __VLS_export;
23
28
  export default _default;
@@ -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="Search..." :showClear="true")
4
4
  .KCombobox__loading(v-if="loading")
5
5
  .KCombobox__loading-spinner
6
6
  ul.KCombobox__options-list(v-else)
@@ -10,73 +10,91 @@
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
- const props = defineProps({
19
- searchbox: { type: Boolean, required: true },
20
- searchtext: { type: String, required: true },
21
- loading: { type: Boolean, required: true },
22
- filteredOptions: { type: Array, required: true },
23
- labelField: { type: String, required: true },
24
- selectItem: { type: Function, required: true },
25
- isSelected: { type: Function, required: true }
26
- });
27
- 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
+ loading: boolean
25
+ filteredOptions: any[]
26
+ labelField: string
27
+ selectItem: (option: ComboboxItem) => void
28
+ isSelected: (option: ComboboxItem) => boolean
29
+ }>()
30
+
31
+ const emit = defineEmits<{
32
+ (e: 'update:searchtext', value: string): void
33
+ }>()
34
+
28
35
  const searchtextModel = computed({
29
- get: () => props.searchtext,
30
- set: (value) => emit("update:searchtext", value)
31
- });
36
+ get: () => props.searchtext,
37
+ set: (value) => emit('update:searchtext', value)
38
+ })
32
39
  </script>
33
40
 
34
- <style scoped>
35
- .KCombobox__options-content {
36
- margin: -var(--grid-gap);
37
- }
38
- .KCombobox__options-list {
39
- max-height: 500px;
40
- overflow-y: auto;
41
- }
42
- .KCombobox__options-list-item {
43
- cursor: pointer;
44
- height: 40px;
45
- padding: 10px;
46
- box-sizing: border-box;
47
- border-bottom: 1px solid var(--border-color-light);
48
- }
49
- .KCombobox__options-list-item:hover {
50
- background-color: var(--background-color-medium);
51
- }
52
- .KCombobox__options-list-item:last-child {
53
- border-bottom: none;
54
- }
55
- .KCombobox__options-list .KIcon {
56
- visibility: hidden;
57
- }
58
- .KCombobox__options-list .KIcon.visible {
59
- visibility: visible;
60
- width: 12px;
41
+ <style lang="scss" scoped>
42
+ .KCombobox__options {
43
+ &-content {
44
+ margin: -var(--grid-gap);
45
+ }
46
+ &-list {
47
+ max-height: 500px;
48
+ overflow-y: auto;
49
+ &-item {
50
+ cursor: pointer;
51
+ height: 40px;
52
+ padding: 10px;
53
+ box-sizing: border-box;
54
+
55
+ border-bottom: 1px solid var(--border-color-light);
56
+ &:hover {
57
+ background-color: var(--background-color-medium);
58
+ }
59
+ &:last-child {
60
+ border-bottom: none;
61
+ }
62
+ &__text {
63
+ text-overflow: ellipsis;
64
+ overflow: hidden;
65
+ white-space: nowrap;
66
+ }
67
+ }
68
+
69
+ .KIcon {
70
+ visibility: hidden;
71
+ &.visible {
72
+ visibility: visible;
73
+ width: 12px;
74
+ }
75
+ }
76
+ }
61
77
  }
62
78
 
63
79
  .KCombobox__loading {
64
- padding: 10px;
65
- display: flex;
66
- justify-content: center;
67
- align-items: center;
68
- }
69
- .KCombobox__loading-spinner {
70
- width: 20px;
71
- height: 20px;
72
- border: 2px solid var(--border-color-light);
73
- border-top-color: var(--primary-color-500);
74
- border-radius: 50%;
75
- animation: spin 0.8s linear infinite;
76
- }
77
- @keyframes spin {
78
- to {
79
- transform: rotate(360deg);
80
- }
80
+ padding: 10px;
81
+ display: flex;
82
+ justify-content: center;
83
+ align-items: center;
84
+
85
+ &-spinner {
86
+ width: 20px;
87
+ height: 20px;
88
+ border: 2px solid var(--border-color-light);
89
+ border-top-color: var(--primary-color-500);
90
+ border-radius: 50%;
91
+ animation: spin 0.8s linear infinite;
92
+ }
93
+
94
+ @keyframes spin {
95
+ to {
96
+ transform: rotate(360deg);
97
+ }
98
+ }
81
99
  }
82
100
  </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;
@@ -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;