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

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 (184) 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/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 +30 -0
  11. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
  12. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +30 -0
  13. package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +17 -0
  14. package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +16 -1
  15. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +75 -8
  16. package/dist/runtime/components/KCombobox/KCombobox.global.vue +18 -4
  17. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +75 -8
  18. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +46 -8
  19. package/dist/runtime/components/KCombobox/KCombobox.logic.js +77 -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.global.vue +1 -1
  26. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +2 -2
  27. package/dist/runtime/components/KDatatable/KDatatable.global.vue +1 -1
  28. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +2 -2
  29. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +95 -8
  30. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +27 -3
  31. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +95 -8
  32. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +43 -1
  33. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +106 -7
  34. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +84 -8
  35. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +26 -3
  36. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +84 -8
  37. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +38 -1
  38. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +161 -7
  39. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +27 -0
  40. package/dist/runtime/components/KDropdown/KDropdown.global.vue +14 -4
  41. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +27 -0
  42. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +36 -1
  43. package/dist/runtime/components/KDropdown/KDropdown.logic.js +92 -4
  44. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +7 -56
  45. package/dist/runtime/components/KGrid/KGrid.global.vue +9 -2
  46. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +7 -56
  47. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +41 -0
  48. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +27 -12
  49. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +41 -0
  50. package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +26 -3
  51. package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +34 -10
  52. package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +4 -1
  53. package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
  54. package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
  55. package/dist/runtime/components/KIcon/KIcon.logic.d.ts +1 -1
  56. package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
  57. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +21 -0
  58. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +4 -2
  59. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +21 -0
  60. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +11 -0
  61. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +9 -0
  62. package/dist/runtime/components/KModal/KModal.global.d.vue.ts +14 -2
  63. package/dist/runtime/components/KModal/KModal.global.vue +5 -1
  64. package/dist/runtime/components/KModal/KModal.global.vue.d.ts +14 -2
  65. package/dist/runtime/components/KModal/KModal.logic.d.ts +10 -2
  66. package/dist/runtime/components/KModal/KModal.logic.js +12 -3
  67. package/dist/runtime/components/KPagination/KPagination.global.vue +1 -1
  68. package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +5 -28
  69. package/dist/runtime/components/KPanel/KPanel.global.vue +12 -4
  70. package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +5 -28
  71. package/dist/runtime/components/KPanel/KPanel.logic.d.ts +10 -0
  72. package/dist/runtime/components/KPanel/KPanel.logic.js +8 -0
  73. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
  74. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
  75. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
  76. package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
  77. package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
  78. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +21 -0
  79. package/dist/runtime/components/KTextarea/KTextarea.global.vue +3 -1
  80. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +21 -0
  81. package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +11 -0
  82. package/dist/runtime/components/KTextarea/KTextarea.logic.js +9 -0
  83. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +35 -2
  84. package/dist/runtime/components/KTextbox/KTextbox.global.vue +7 -4
  85. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +35 -2
  86. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +21 -4
  87. package/dist/runtime/components/KTextbox/KTextbox.logic.js +21 -5
  88. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
  89. package/dist/runtime/components/KToast/KToast.global.vue +32 -0
  90. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
  91. package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
  92. package/dist/runtime/components/KToast/KToast.logic.js +47 -0
  93. package/dist/runtime/components/KTree/KTree.logic.d.ts +1 -1
  94. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +63 -5
  95. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +15 -3
  96. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +63 -5
  97. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +37 -5
  98. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +32 -1
  99. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +5 -5
  100. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +5 -5
  101. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
  102. package/dist/runtime/composables/usePresetComponent.d.ts +16 -0
  103. package/dist/runtime/composables/usePresetComponent.js +21 -16
  104. package/dist/runtime/presets/default/assets/scss/css-variables.css +64 -13
  105. package/dist/runtime/presets/default/assets/scss/css-variables.scss +286 -0
  106. package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
  107. package/dist/runtime/presets/default/assets/scss/index.css +99 -13
  108. package/dist/runtime/presets/default/assets/scss/index.scss +42 -0
  109. package/dist/runtime/presets/default/assets/scss/mixins.scss +94 -0
  110. package/dist/runtime/presets/default/assets/scss/reset.scss +16 -0
  111. package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue +5 -2
  112. package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +40 -37
  113. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +29 -22
  114. package/dist/runtime/presets/default/components/KButton/KButton.vue +147 -428
  115. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +57 -53
  116. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +189 -161
  117. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +3 -0
  118. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +59 -42
  119. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +3 -0
  120. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +7 -0
  121. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +108 -79
  122. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +7 -0
  123. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -0
  124. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +79 -61
  125. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -0
  126. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +29 -0
  127. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +202 -0
  128. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +29 -0
  129. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +40 -31
  130. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +110 -92
  131. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +7 -0
  132. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +58 -25
  133. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +7 -0
  134. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +6 -0
  135. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +81 -52
  136. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +6 -0
  137. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +10 -0
  138. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +57 -25
  139. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +10 -0
  140. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +337 -241
  141. package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +40 -35
  142. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +170 -140
  143. package/dist/runtime/presets/default/components/KGrid/KGrid.vue +62 -60
  144. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +8 -2
  145. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +48 -28
  146. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +8 -2
  147. package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +34 -28
  148. package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
  149. package/dist/runtime/presets/default/components/KIcon/KIcon.vue +31 -22
  150. package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
  151. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +65 -48
  152. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +2 -0
  153. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +117 -84
  154. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +2 -0
  155. package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +2 -0
  156. package/dist/runtime/presets/default/components/KModal/KModal.vue +85 -35
  157. package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +2 -0
  158. package/dist/runtime/presets/default/components/KPagination/KPagination.vue +42 -40
  159. package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +3 -0
  160. package/dist/runtime/presets/default/components/KPanel/KPanel.vue +97 -34
  161. package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
  162. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
  163. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +40 -35
  164. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
  165. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +158 -125
  166. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +123 -100
  167. package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +40 -37
  168. package/dist/runtime/presets/default/components/KTabs/KTabs.vue +9 -6
  169. package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +2 -0
  170. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +40 -21
  171. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +2 -0
  172. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
  173. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +76 -37
  174. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
  175. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
  176. package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
  177. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
  178. package/dist/runtime/presets/default/components/KTree/KTree.vue +103 -80
  179. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +6 -0
  180. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +88 -55
  181. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +6 -0
  182. package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +31 -30
  183. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +34 -27
  184. package/package.json +5 -5
@@ -14,108 +14,131 @@
14
14
  )
15
15
  </template>
16
16
 
17
- <script setup>
18
- import { computed } from "vue";
19
- const props = defineProps({
20
- rangeMin: { type: Number, required: true },
21
- rangeMax: { type: Number, required: true },
22
- rangeStep: { type: Number, required: true },
23
- isDisabled: { type: Boolean, required: true },
24
- currentValue: { type: Number, required: true },
25
- valuePercent: { type: Number, required: true }
26
- });
27
- const emit = defineEmits(["update:value"]);
28
- const updateValue = (event) => {
29
- const value = parseFloat(event.target.value);
30
- emit("update:value", value);
31
- };
32
- const handleTrackClick = (event) => {
33
- if (props.isDisabled) return;
34
- const target = event.currentTarget;
35
- const rect = target.getBoundingClientRect();
36
- const clickX = event.clientX - rect.left;
37
- const percentage = clickX / rect.width;
38
- const rawValue = props.rangeMin + percentage * (props.rangeMax - props.rangeMin);
39
- const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep;
40
- const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue));
41
- emit("update:value", value);
42
- };
43
- </script>
17
+ <script lang="ts" setup>
18
+ import { computed } from 'vue'
44
19
 
45
- <style scoped>
46
- .KSlider {
47
- position: relative;
48
- padding: 20px 0;
49
- }
50
- .KSlider.disabled {
51
- opacity: 0.5;
52
- cursor: not-allowed;
53
- }
54
- .KSlider .slider-container {
55
- position: relative;
56
- height: 6px;
57
- cursor: pointer;
58
- }
59
- .KSlider .slider-track {
60
- position: absolute;
61
- width: 100%;
62
- height: 6px;
63
- background-color: var(--neutral-200);
64
- border-radius: 3px;
65
- }
66
- .KSlider .slider-fill {
67
- position: absolute;
68
- height: 6px;
69
- background-color: var(--primary-500);
70
- border-radius: 3px;
71
- z-index: 1;
72
- }
73
- .KSlider .slider-input {
74
- position: absolute;
75
- width: 100%;
76
- height: 1px;
77
- background: transparent;
78
- pointer-events: none;
79
- -webkit-appearance: none;
80
- appearance: none;
81
- }
82
- .KSlider .slider-input::-webkit-slider-thumb {
83
- -webkit-appearance: none;
84
- appearance: none;
85
- width: 18px;
86
- height: 18px;
87
- background-color: var(--primary-500);
88
- border: 2px solid white;
89
- border-radius: 50%;
90
- cursor: pointer;
91
- pointer-events: auto;
92
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
93
- transition: transform 0.15s ease;
94
- }
95
- .KSlider .slider-input::-webkit-slider-thumb:hover {
96
- transform: scale(1.15);
97
- }
98
- .KSlider .slider-input::-moz-range-thumb {
99
- width: 18px;
100
- height: 18px;
101
- background-color: var(--primary-500);
102
- border: 2px solid white;
103
- border-radius: 50%;
104
- cursor: pointer;
105
- pointer-events: auto;
106
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
107
- transition: transform 0.15s ease;
108
- }
109
- .KSlider .slider-input::-moz-range-thumb:hover {
110
- transform: scale(1.15);
111
- }
112
- .KSlider .slider-input:disabled {
113
- cursor: not-allowed;
20
+ // Default template for KSlider
21
+ const props = defineProps<{
22
+ rangeMin: number
23
+ rangeMax: number
24
+ rangeStep: number
25
+ isDisabled: boolean
26
+ currentValue: number
27
+ valuePercent: number
28
+ }>()
29
+
30
+ const emit = defineEmits<{
31
+ (e: 'update:value', value: number): void
32
+ }>()
33
+
34
+ const updateValue = (event: Event) => {
35
+ const value = parseFloat((event.target as HTMLInputElement).value)
36
+ emit('update:value', value)
114
37
  }
115
- .KSlider .slider-input:disabled::-webkit-slider-thumb {
116
- cursor: not-allowed;
38
+
39
+ const handleTrackClick = (event: MouseEvent) => {
40
+ if (props.isDisabled) return
41
+
42
+ const target = event.currentTarget as HTMLElement
43
+ const rect = target.getBoundingClientRect()
44
+ const clickX = event.clientX - rect.left
45
+ const percentage = clickX / rect.width
46
+ const rawValue = props.rangeMin + (percentage * (props.rangeMax - props.rangeMin))
47
+
48
+ // Round to step
49
+ const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep
50
+ const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue))
51
+
52
+ emit('update:value', value)
117
53
  }
118
- .KSlider .slider-input:disabled::-moz-range-thumb {
119
- cursor: not-allowed;
54
+ </script>
55
+
56
+ <style lang="scss" scoped>
57
+ .KSlider {
58
+ position: relative;
59
+ padding: 20px 0;
60
+
61
+ &.disabled {
62
+ opacity: 0.5;
63
+ cursor: not-allowed;
64
+ }
65
+
66
+ .slider-container {
67
+ position: relative;
68
+ height: 6px;
69
+ cursor: pointer;
70
+ }
71
+
72
+ .slider-track {
73
+ position: absolute;
74
+ width: 100%;
75
+ height: 6px;
76
+ background-color: var(--neutral-200);
77
+ border-radius: 3px;
78
+ }
79
+
80
+ .slider-fill {
81
+ position: absolute;
82
+ height: 6px;
83
+ background-color: var(--primary-500);
84
+ border-radius: 3px;
85
+ z-index: 1;
86
+ }
87
+
88
+ .slider-input {
89
+ position: absolute;
90
+ width: 100%;
91
+ height: 1px;
92
+ background: transparent;
93
+ pointer-events: none;
94
+ -webkit-appearance: none;
95
+ appearance: none;
96
+
97
+ &::-webkit-slider-thumb {
98
+ -webkit-appearance: none;
99
+ appearance: none;
100
+ width: 18px;
101
+ height: 18px;
102
+ background-color: var(--primary-500);
103
+ border: 2px solid white;
104
+ border-radius: 50%;
105
+ cursor: pointer;
106
+ pointer-events: auto;
107
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
108
+ transition: transform 0.15s ease;
109
+
110
+ &:hover {
111
+ transform: scale(1.15);
112
+ }
113
+ }
114
+
115
+ &::-moz-range-thumb {
116
+ width: 18px;
117
+ height: 18px;
118
+ background-color: var(--primary-500);
119
+ border: 2px solid white;
120
+ border-radius: 50%;
121
+ cursor: pointer;
122
+ pointer-events: auto;
123
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
124
+ transition: transform 0.15s ease;
125
+
126
+ &:hover {
127
+ transform: scale(1.15);
128
+ }
129
+ }
130
+
131
+ &:disabled {
132
+ cursor: not-allowed;
133
+
134
+ &::-webkit-slider-thumb {
135
+ cursor: not-allowed;
136
+ }
137
+
138
+ &::-moz-range-thumb {
139
+ cursor: not-allowed;
140
+ }
141
+ }
142
+ }
120
143
  }
121
144
  </style>
@@ -3,44 +3,47 @@
3
3
  slot
4
4
  </template>
5
5
 
6
- <script setup>
7
- const props = defineProps({
8
- title: { type: String, required: true },
9
- isOpen: { type: Boolean, required: true },
10
- toggleTab: { type: Function, required: true }
11
- });
6
+ <script lang="ts" setup>
7
+ const props = defineProps<{
8
+ title: string
9
+ isOpen: boolean
10
+ toggleTab: () => void
11
+ }>()
12
12
  </script>
13
13
 
14
- <style scoped>
15
- .KTab-item__header {
16
- padding: var(--component-gap);
17
- background-color: var(--background-color-medium);
18
- cursor: pointer;
19
- border-radius: var(--box-border-radius);
20
- }
21
- .isOpen .KTab-item__header {
22
- border-bottom-left-radius: 0;
23
- border-bottom-right-radius: 0;
24
- }
25
- .KTab-item__title {
26
- flex-grow: 1;
27
- }
28
- .KTab-item__chevron {
29
- transform: rotate(90deg);
30
- transition: transform 0.3s ease-in-out;
31
- }
32
- .KTab-item__chevron.open {
33
- transform: rotate(270deg);
34
- }
35
- .KTab-item__content {
36
- display: none;
37
- padding-top: var(--box-padding);
38
- padding-bottom: var(--box-padding);
39
- }
40
- .KTab-item__content.open {
41
- border-bottom: var(--box-border);
42
- }
43
- .isOpen .KTab-item__content {
44
- display: block;
14
+ <style lang="scss" scoped>
15
+ .KTab-item {
16
+ &__header {
17
+ padding: var(--component-gap);
18
+ background-color: var(--background-color-medium);
19
+ cursor: pointer;
20
+ border-radius: var(--box-border-radius);
21
+
22
+ .isOpen & {
23
+ border-bottom-left-radius: 0;
24
+ border-bottom-right-radius: 0;
25
+ }
26
+ }
27
+ &__title {
28
+ flex-grow: 1;
29
+ }
30
+ &__chevron {
31
+ transform: rotate(90deg);
32
+ transition: transform 0.3s ease-in-out;
33
+ &.open {
34
+ transform: rotate(270deg);
35
+ }
36
+ }
37
+ &__content {
38
+ display: none;
39
+ padding-top: var(--box-padding);
40
+ padding-bottom: var(--box-padding);
41
+ &.open {
42
+ border-bottom: var(--box-border);
43
+ }
44
+ .isOpen & {
45
+ display: block;
46
+ }
47
+ }
45
48
  }
46
49
  </style>
@@ -7,10 +7,13 @@
7
7
  slot
8
8
  </template>
9
9
 
10
- <script setup>
11
- const props = defineProps({
12
- items: { type: Array, required: true },
13
- toggleItem: { type: Function, required: true },
14
- isOpen: { type: Function, required: true }
15
- });
10
+ <script lang="ts" setup>
11
+ const props = defineProps<{
12
+ items: any[]
13
+ toggleItem: (index: number) => void
14
+ isOpen: (index: number) => boolean
15
+ }>()
16
16
  </script>
17
+
18
+ <style lang="scss" scoped>
19
+ </style>
@@ -1,6 +1,8 @@
1
1
  type __VLS_Props = {
2
2
  placeholder: string;
3
3
  rows: number;
4
+ validation?: 'success' | 'warning' | 'error' | null;
5
+ validationText?: string;
4
6
  };
5
7
  type __VLS_ModelProps = {
6
8
  'text'?: string;
@@ -1,29 +1,48 @@
1
1
  <template lang="pug">
2
- textarea.KTextarea(v-model="text" :placeholder="placeholder" :rows="rows")
2
+ .KTextarea-wrapper(:class="$attrs.class" :style="$attrs.style")
3
+ textarea.KTextarea(v-bind="textareaAttrs" v-model="text" :placeholder="placeholder" :rows="rows" :class="validation ? `is-${validation}` : ''")
4
+ span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
3
5
  </template>
4
6
 
5
- <script setup>
6
- const text = defineModel("text", { type: String });
7
- defineProps({
8
- placeholder: { type: String, required: true },
9
- rows: { type: Number, required: true }
10
- });
7
+ <script lang="ts" setup>
8
+ import { useAttrs, computed } from 'vue'
9
+
10
+ defineOptions({
11
+ inheritAttrs: false
12
+ })
13
+
14
+ // Default template for KTextarea
15
+ const text = defineModel<string>('text')
16
+
17
+ const props = defineProps<{
18
+ placeholder: string
19
+ rows: number
20
+ validation?: 'success' | 'warning' | 'error' | null
21
+ validationText?: string
22
+ }>()
23
+
24
+ const attrs = useAttrs()
25
+ const textareaAttrs = computed(() => {
26
+ const { class: _, style: __, ...rest } = attrs
27
+ return rest
28
+ })
11
29
  </script>
12
30
 
13
- <style scoped>
31
+ <style lang="scss" scoped>
14
32
  .KTextarea {
15
- border: var(--input-border);
16
- border-radius: var(--input-border-radius);
17
- background-color: var(--neutral-50);
18
- padding: var(--component-gap);
19
- font-family: inherit;
20
- font-size: 14px;
21
- resize: vertical;
22
- outline: none;
23
- width: 100%;
24
- box-sizing: border-box;
25
- }
26
- .KTextarea:focus {
27
- border-color: var(--input-focus-border-color);
33
+ border: var(--input-border);
34
+ border-radius: var(--input-border-radius);
35
+ background-color: var(--neutral-50);
36
+ padding: var(--component-gap);
37
+ font-family: inherit;
38
+ font-size: 14px;
39
+ resize: vertical;
40
+ outline: none;
41
+ width: 100%;
42
+ box-sizing: border-box;
43
+
44
+ &:focus {
45
+ border-color: var(--input-focus-border-color);
46
+ }
28
47
  }
29
48
  </style>
@@ -1,6 +1,8 @@
1
1
  type __VLS_Props = {
2
2
  placeholder: string;
3
3
  rows: number;
4
+ validation?: 'success' | 'warning' | 'error' | null;
5
+ validationText?: string;
4
6
  };
5
7
  type __VLS_ModelProps = {
6
8
  'text'?: string;
@@ -1,8 +1,11 @@
1
1
  type __VLS_Props = {
2
2
  text: string;
3
- showClearIcon: boolean;
3
+ showClear: boolean;
4
4
  clear: () => void;
5
5
  placeholder: string;
6
+ type: string;
7
+ validation?: 'success' | 'warning' | 'error' | null;
8
+ validationText?: string;
6
9
  };
7
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
11
  "update:text": (value: string) => any;
@@ -1,46 +1,85 @@
1
1
  <template lang="pug">
2
- KGrid(align="center" noGap).KTextbox
3
- input(type="text" v-model="text" :placeholder="placeholder")
4
- KIcon(v-if="showClearIcon" @click="clear" iconname="close" width="12" height="12").closeIcon
2
+ .KTextbox-wrapper(:class="$attrs.class" :style="$attrs.style")
3
+ KGrid(align="center" noGap wrap="nowrap" :class="validation ? `is-${validation}` : ''").KTextbox
4
+ input(v-bind="inputAttrs" :type="props.type" v-model="text" :placeholder="placeholder")
5
+ KIcon(v-if="showClear" @click.stop="clear" @mousedown.stop iconname="close" width="10" height="10").closeIcon
6
+ span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
5
7
  </template>
6
8
 
7
- <script setup>
8
- import { computed } from "vue";
9
- const props = defineProps({
10
- text: { type: String, required: true },
11
- showClearIcon: { type: Boolean, required: true },
12
- clear: { type: Function, required: true },
13
- placeholder: { type: String, required: true }
14
- });
15
- const emit = defineEmits(["update:text"]);
9
+ <script lang="ts" setup>
10
+ import { computed, useAttrs } from 'vue'
11
+
12
+ defineOptions({
13
+ inheritAttrs: false
14
+ })
15
+
16
+ // Default template for KTextbox
17
+ const props = defineProps<{
18
+ text: string
19
+ showClear: boolean
20
+ clear: () => void
21
+ placeholder: string
22
+ type: string
23
+ validation?: 'success' | 'warning' | 'error' | null
24
+ validationText?: string
25
+ }>()
26
+
27
+ const emit = defineEmits<{
28
+ (e: 'update:text', value: string): void
29
+ }>()
30
+
16
31
  const text = computed({
17
- get: () => props.text,
18
- set: (value) => emit("update:text", value)
19
- });
32
+ get: () => props.text,
33
+ set: (value) => emit('update:text', value)
34
+ })
35
+
36
+ const attrs = useAttrs()
37
+ const inputAttrs = computed(() => {
38
+ const { class: _, style: __, ...rest } = attrs
39
+ return rest
40
+ })
20
41
  </script>
21
42
 
22
- <style scoped>
43
+ <style lang="scss" scoped>
23
44
  .KTextbox {
24
- border: var(--input-border);
25
- border-radius: var(--input-border-radius);
26
- overflow: hidden;
27
- background-color: var(--neutral-50);
28
- height: 40px;
29
- }
30
- .KTextbox input {
31
- background-color: var(--neutral-50);
32
- box-sizing: border-box;
33
- flex-grow: 1;
34
- padding: var(--component-gap);
35
- border: none;
36
- outline: none;
37
- }
38
- .KTextbox .closeIcon {
39
- padding-right: var(--component-gap);
40
- color: var(--icon-color-medium);
41
- cursor: pointer;
42
- }
43
- .KTextbox .closeIcon:hover {
44
- color: var(--icon-color-dark);
45
+ border: var(--input-border);
46
+ border-radius: var(--input-border-radius);
47
+ overflow: hidden;
48
+ background-color: var(--neutral-50);
49
+ height: 40px;
50
+
51
+ input {
52
+ background-color: var(--neutral-50);
53
+ box-sizing: border-box;
54
+ flex-grow: 1;
55
+ min-width: 0;
56
+ padding: var(--component-gap);
57
+ border: none;
58
+ outline: none;
59
+
60
+ /* Hide arrows in Chrome, Safari, Edge, Opera */
61
+ &::-webkit-outer-spin-button,
62
+ &::-webkit-inner-spin-button {
63
+ -webkit-appearance: none;
64
+ margin: 0;
65
+ }
66
+
67
+ /* Hide arrows in Firefox */
68
+ &[type=number] {
69
+ -moz-appearance: textfield;
70
+ }
71
+ }
72
+
73
+ .closeIcon {
74
+ padding-right: var(--component-gap);
75
+ color: var(--icon-color-medium);
76
+ cursor: pointer;
77
+ flex-shrink: 0;
78
+ min-width: 10px;
79
+
80
+ &:hover {
81
+ color: var(--icon-color-dark);
82
+ }
83
+ }
45
84
  }
46
85
  </style>
@@ -1,8 +1,11 @@
1
1
  type __VLS_Props = {
2
2
  text: string;
3
- showClearIcon: boolean;
3
+ showClear: boolean;
4
4
  clear: () => void;
5
5
  placeholder: string;
6
+ type: string;
7
+ validation?: 'success' | 'warning' | 'error' | null;
8
+ validationText?: string;
6
9
  };
7
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
11
  "update:text": (value: string) => any;
@@ -0,0 +1,17 @@
1
+ import type { KToastType } from '../../../../components/KToast/KToast.logic.js';
2
+ type __VLS_Props = {
3
+ modelValue: boolean;
4
+ text?: string;
5
+ timeout?: number;
6
+ teleport?: boolean;
7
+ type?: KToastType;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ close: (...args: any[]) => void;
11
+ "update:modelValue": (...args: any[]) => void;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onClose?: ((...args: any[]) => any) | undefined;
14
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;