@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
@@ -23,48 +23,50 @@
23
23
  KButton(@click="goToNext" :href="getPageHref(dp.currentPage.value + 1)" size="small" variant="outline") ›
24
24
  </template>
25
25
 
26
- <script setup>
27
- import { computed } from "vue";
28
- const props = defineProps({
29
- dp: { type: null, required: true },
30
- totalPages: { type: Number, required: true },
31
- getPageHref: { type: Function, required: true },
32
- visiblePages: { type: Array, required: true },
33
- showPrevButton: { type: Boolean, required: true },
34
- showNextButton: { type: Boolean, required: true },
35
- showFirstEllipsis: { type: Boolean, required: true },
36
- showLastEllipsis: { type: Boolean, required: true },
37
- pageClicked: { type: Function, required: true },
38
- goToPrev: { type: Function, required: true },
39
- goToNext: { type: Function, required: true },
40
- goToFirst: { type: Function, required: true },
41
- goToLast: { type: Function, required: true }
42
- });
26
+ <script setup lang="ts">
27
+ import { computed } from 'vue'
28
+
29
+ const props = defineProps<{
30
+ dp: any
31
+ totalPages: number
32
+ getPageHref: (page: number) => string | undefined
33
+ visiblePages: number[]
34
+ showPrevButton: boolean
35
+ showNextButton: boolean
36
+ showFirstEllipsis: boolean
37
+ showLastEllipsis: boolean
38
+ pageClicked: (item: number) => void
39
+ goToPrev: () => void
40
+ goToNext: () => void
41
+ goToFirst: () => void
42
+ goToLast: () => void
43
+ }>()
43
44
  </script>
44
45
 
45
- <style scoped>
46
+ <style lang="scss" scoped>
46
47
  .k-pagination {
47
- text-align: right;
48
- }
49
- .k-pagination ul {
50
- list-style-type: none;
51
- padding: 0px;
52
- margin: 0px;
53
- display: flex;
54
- flex-direction: row;
55
- flex-wrap: wrap;
56
- align-content: center;
57
- justify-content: flex-end;
58
- gap: 5px;
59
- }
60
- .k-pagination ul li {
61
- display: flex;
62
- align-items: center;
63
- }
64
- .k-pagination ul li .ellipsis {
65
- padding: 8px 12px;
66
- color: #666;
67
- font-weight: bold;
68
- user-select: none;
48
+ text-align: right;
49
+ ul {
50
+ list-style-type: none;
51
+ padding: 0px;
52
+ margin: 0px;
53
+ display: flex;
54
+ flex-direction: row;
55
+ flex-wrap: wrap;
56
+ align-content: center;
57
+ justify-content: flex-end;
58
+ gap: 5px;
59
+ li {
60
+ display: flex;
61
+ align-items: center;
62
+
63
+ .ellipsis {
64
+ padding: 8px 12px;
65
+ color: #666;
66
+ font-weight: bold;
67
+ user-select: none;
68
+ }
69
+ }
70
+ }
69
71
  }
70
72
  </style>
@@ -2,8 +2,11 @@ type __VLS_Props = {
2
2
  noGap?: boolean;
3
3
  flexContent?: boolean;
4
4
  scrollable?: boolean;
5
+ type?: 'default' | 'primary' | 'danger' | 'success' | 'warning' | 'info';
6
+ title?: string;
5
7
  };
6
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ type: "default" | "primary" | "danger" | "success" | "warning" | "info";
7
10
  noGap: boolean;
8
11
  flexContent: boolean;
9
12
  scrollable: boolean;
@@ -1,47 +1,110 @@
1
1
  <template lang="pug">
2
- .KPanel
2
+ .KPanel(:class="[`type-${type}`]")
3
3
  KGrid(direction="column" align="strech" :no-gap="noGap" wrap="nowrap").full-height
4
- .KPanel--header(v-if="$slots.header")
5
- slot(name="header")
4
+ .KPanel--header(v-if="$slots.header || title")
5
+ slot(name="header") {{ title }}
6
6
  .KPanel--content(:class="{'flex-content': flexContent, 'scrollable': scrollable}")
7
7
  slot
8
8
  .KPanel--footer(v-if="$slots.footer")
9
9
  slot(name="footer")
10
10
  </template>
11
11
 
12
- <script setup>
13
- const props = defineProps({
14
- noGap: { type: Boolean, required: false, default: false },
15
- flexContent: { type: Boolean, required: false, default: false },
16
- scrollable: { type: Boolean, required: false, default: false }
17
- });
12
+ <script lang="ts" setup>
13
+ const props = withDefaults(defineProps<{
14
+ noGap?: boolean
15
+ flexContent?: boolean
16
+ scrollable?: boolean
17
+ type?: 'default' | 'primary' | 'danger' | 'success' | 'warning' | 'info'
18
+ title?: string
19
+ }>(), {
20
+ scrollable: false,
21
+ noGap: true,
22
+ flexContent: false,
23
+ type: 'default'
24
+ })
18
25
  </script>
19
26
 
20
- <style scoped>
27
+ <style lang="scss" scoped>
21
28
  .KPanel {
22
- border-radius: var(--box-border-radius);
23
- border: var(--box-border);
24
- box-shadow: var(--box-shadow);
25
- background-color: var(--background-color-light);
26
- width: 100%;
27
- }
28
- .KPanel .full-height {
29
- height: 100%;
30
- }
31
- .KPanel--header {
32
- padding: var(--component-gap);
33
- background-color: var(--background-color-medium);
34
- }
35
- .KPanel--content {
36
- padding: var(--box-padding);
37
- }
38
- .KPanel--content.scrollable {
39
- overflow-y: auto;
40
- }
41
- .KPanel--content.flex-content {
42
- flex-grow: 1;
43
- }
44
- .KPanel--footer {
45
- padding: var(--box-padding);
29
+ --current-panel-bg: var(--panel-bg-default);
30
+ --current-panel-header-bg: var(--panel-header-bg-default);
31
+ --current-panel-footer-bg: var(--panel-footer-bg-default);
32
+
33
+ border-radius: var(--border-radius-lg);
34
+ border: 1px solid var(--neutral-200);
35
+ box-shadow: var(--shadow-md);
36
+ background-color: color-mix(in srgb, var(--current-panel-bg), transparent calc((1 - var(--panel-bg-opacity)) * 100%));
37
+ backdrop-filter: blur(var(--panel-blur));
38
+ width: 100%;
39
+ display: flex;
40
+ flex-direction: column;
41
+ overflow: hidden;
42
+ transition: transform var(--transition-normal), box-shadow var(--transition-normal);
43
+
44
+ &.type-primary {
45
+ --current-panel-bg: var(--panel-bg-primary);
46
+ --current-panel-header-bg: var(--panel-header-bg-primary);
47
+ --current-panel-footer-bg: var(--panel-footer-bg-primary);
48
+ }
49
+ &.type-success {
50
+ --current-panel-bg: var(--panel-bg-success);
51
+ --current-panel-header-bg: var(--panel-header-bg-success);
52
+ --current-panel-footer-bg: var(--panel-footer-bg-success);
53
+ }
54
+ &.type-warning {
55
+ --current-panel-bg: var(--panel-bg-warning);
56
+ --current-panel-header-bg: var(--panel-header-bg-warning);
57
+ --current-panel-footer-bg: var(--panel-footer-bg-warning);
58
+ }
59
+ &.type-danger {
60
+ --current-panel-bg: var(--panel-bg-danger);
61
+ --current-panel-header-bg: var(--panel-header-bg-danger);
62
+ --current-panel-footer-bg: var(--panel-footer-bg-danger);
63
+ }
64
+ &.type-info {
65
+ --current-panel-bg: var(--panel-bg-info);
66
+ --current-panel-header-bg: var(--panel-header-bg-info);
67
+ --current-panel-footer-bg: var(--panel-footer-bg-info);
68
+ }
69
+
70
+ &:hover {
71
+ transform: translateY(-2px);
72
+ box-shadow: var(--shadow-lg);
73
+ }
74
+
75
+ .full-height {
76
+ height: 100%;
77
+ min-height: 0;
78
+ }
79
+
80
+ &--header {
81
+ padding: var(--gap-md);
82
+ background-color: color-mix(in srgb, var(--current-panel-header-bg), transparent 92%);
83
+ border-bottom: 1px solid var(--neutral-200);
84
+ font-weight: var(--font-weight-semibold);
85
+ color: var(--font-color-heading);
86
+ font-size: var(--font-size-lg);
87
+ }
88
+
89
+ &--content {
90
+ padding: var(--gap-md);
91
+ flex: 1;
92
+ min-height: 0;
93
+
94
+ &.scrollable {
95
+ overflow-y: auto;
96
+ }
97
+
98
+ &.flex-content {
99
+ display: flex;
100
+ flex-direction: column;
101
+ }
102
+ }
103
+
104
+ &--footer {
105
+ padding: var(--gap-md);
106
+ background-color: color-mix(in srgb, var(--current-panel-footer-bg), transparent 92%);
107
+ border-top: 1px solid var(--neutral-200);
108
+ }
46
109
  }
47
110
  </style>
@@ -2,8 +2,11 @@ type __VLS_Props = {
2
2
  noGap?: boolean;
3
3
  flexContent?: boolean;
4
4
  scrollable?: boolean;
5
+ type?: 'default' | 'primary' | 'danger' | 'success' | 'warning' | 'info';
6
+ title?: string;
5
7
  };
6
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ type: "default" | "primary" | "danger" | "success" | "warning" | "info";
7
10
  noGap: boolean;
8
11
  flexContent: boolean;
9
12
  scrollable: boolean;
@@ -3,6 +3,8 @@ type __VLS_Props = {
3
3
  label?: string;
4
4
  value?: string;
5
5
  disabled?: boolean;
6
+ validation?: 'success' | 'warning' | 'error' | null;
7
+ validationText?: string;
6
8
  };
7
9
  type __VLS_ModelProps = {
8
10
  modelValue?: any;
@@ -1,43 +1,48 @@
1
1
  <template lang="pug">
2
- label.KRadiobox
3
- input(type="radio" v-model="model" :disabled="disabled" :value="value")
4
- .icon-container
5
- KIcon.icon(iconname="check")
6
- span
7
- slot
2
+ .KRadiobox-wrapper
3
+ label.KRadiobox
4
+ input(type="radio" v-model="model" :disabled="disabled" :value="value")
5
+ .icon-container(:class="validation ? `is-${validation}` : ''")
6
+ KIcon.icon(iconname="check")
7
+ span
8
+ slot
9
+ span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
8
10
  </template>
9
11
 
10
- <script setup>
11
- defineProps({
12
- model: { type: null, required: true },
13
- label: { type: String, required: false },
14
- value: { type: String, required: false },
15
- disabled: { type: Boolean, required: false }
16
- });
17
- const model = defineModel();
12
+ <script lang="ts" setup>
13
+ defineProps<{
14
+ model: any
15
+ label?: string
16
+ value?: string
17
+ disabled?: boolean
18
+ validation?: 'success' | 'warning' | 'error' | null
19
+ validationText?: string
20
+ }>()
21
+
22
+ const model = defineModel()
18
23
  </script>
19
24
 
20
- <style scoped>
25
+ <style lang="scss" scoped>
21
26
  .KRadiobox {
22
- display: flex;
23
- gap: 5px;
24
- }
25
- .KRadiobox input {
26
- display: none;
27
- }
28
- .KRadiobox .icon-container {
29
- border: var(--input-border);
30
- width: var(--box-padding);
31
- height: var(--box-padding);
32
- text-align: center;
33
- line-height: var(--box-padding);
34
- border-radius: var(--input-border-radius);
35
- background-color: var(--checkbox-bg);
36
- }
37
- .KRadiobox .icon {
38
- display: none;
39
- }
40
- .KRadiobox :checked + .icon-container > .icon {
41
- display: block;
27
+ display: flex;
28
+ gap: 5px;
29
+ input {
30
+ display: none;
31
+ }
32
+ .icon-container {
33
+ border: var(--input-border);
34
+ width: var(--box-padding);
35
+ height: var(--box-padding);
36
+ text-align: center;
37
+ line-height: var(--box-padding);
38
+ border-radius: var(--input-border-radius);
39
+ background-color: var(--checkbox-bg);
40
+ }
41
+ .icon {
42
+ display: none;
43
+ }
44
+ :checked + .icon-container > .icon {
45
+ display: block;
46
+ }
42
47
  }
43
48
  </style>
@@ -3,6 +3,8 @@ type __VLS_Props = {
3
3
  label?: string;
4
4
  value?: string;
5
5
  disabled?: boolean;
6
+ validation?: 'success' | 'warning' | 'error' | null;
7
+ validationText?: string;
6
8
  };
7
9
  type __VLS_ModelProps = {
8
10
  modelValue?: any;
@@ -23,134 +23,167 @@
23
23
  )
24
24
  </template>
25
25
 
26
- <script setup>
27
- import { computed } from "vue";
28
- const props = defineProps({
29
- rangeMin: { type: Number, required: true },
30
- rangeMax: { type: Number, required: true },
31
- rangeStep: { type: Number, required: true },
32
- isDisabled: { type: Boolean, required: true },
33
- currentMinValue: { type: Number, required: true },
34
- currentMaxValue: { type: Number, required: true },
35
- minPercent: { type: Number, required: true },
36
- maxPercent: { type: Number, required: true }
37
- });
38
- const emit = defineEmits(["update:minValue", "update:maxValue"]);
39
- const updateMinValue = (event) => {
40
- const value = parseFloat(event.target.value);
41
- if (value <= props.currentMaxValue) {
42
- emit("update:minValue", value);
43
- }
44
- };
45
- const updateMaxValue = (event) => {
46
- const value = parseFloat(event.target.value);
47
- if (value >= props.currentMinValue) {
48
- emit("update:maxValue", value);
49
- }
50
- };
51
- const handleTrackClick = (event) => {
52
- if (props.isDisabled) return;
53
- const target = event.currentTarget;
54
- const rect = target.getBoundingClientRect();
55
- const clickX = event.clientX - rect.left;
56
- const percentage = clickX / rect.width;
57
- const rawValue = props.rangeMin + percentage * (props.rangeMax - props.rangeMin);
58
- const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep;
59
- const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue));
60
- const distanceToMin = Math.abs(value - props.currentMinValue);
61
- const distanceToMax = Math.abs(value - props.currentMaxValue);
62
- if (distanceToMin < distanceToMax) {
63
- if (value <= props.currentMaxValue) {
64
- emit("update:minValue", value);
65
- }
66
- } else {
67
- if (value >= props.currentMinValue) {
68
- emit("update:maxValue", value);
69
- }
70
- }
71
- };
72
- </script>
26
+ <script lang="ts" setup>
27
+ import { computed } from 'vue'
73
28
 
74
- <style scoped>
75
- .KRangeSlider {
76
- position: relative;
77
- padding: 20px 0;
78
- }
79
- .KRangeSlider.disabled {
80
- opacity: 0.5;
81
- cursor: not-allowed;
82
- }
83
- .KRangeSlider .slider-container {
84
- position: relative;
85
- height: 6px;
86
- cursor: pointer;
87
- }
88
- .KRangeSlider .slider-track {
89
- position: absolute;
90
- width: 100%;
91
- height: 6px;
92
- background-color: var(--neutral-200);
93
- border-radius: 3px;
94
- }
95
- .KRangeSlider .slider-range {
96
- position: absolute;
97
- height: 6px;
98
- background-color: var(--primary-500);
99
- border-radius: 3px;
100
- z-index: 1;
101
- }
102
- .KRangeSlider .slider-input {
103
- position: absolute;
104
- width: 100%;
105
- height: 1px;
106
- background: transparent;
107
- pointer-events: none;
108
- -webkit-appearance: none;
109
- appearance: none;
110
- }
111
- .KRangeSlider .slider-input::-webkit-slider-thumb {
112
- -webkit-appearance: none;
113
- appearance: none;
114
- width: 18px;
115
- height: 18px;
116
- background-color: var(--primary-500);
117
- border: 2px solid white;
118
- border-radius: 50%;
119
- cursor: pointer;
120
- pointer-events: auto;
121
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
122
- transition: transform 0.15s ease;
123
- }
124
- .KRangeSlider .slider-input::-webkit-slider-thumb:hover {
125
- transform: scale(1.15);
126
- }
127
- .KRangeSlider .slider-input::-moz-range-thumb {
128
- width: 18px;
129
- height: 18px;
130
- background-color: var(--primary-500);
131
- border: 2px solid white;
132
- border-radius: 50%;
133
- cursor: pointer;
134
- pointer-events: auto;
135
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
136
- transition: transform 0.15s ease;
137
- }
138
- .KRangeSlider .slider-input::-moz-range-thumb:hover {
139
- transform: scale(1.15);
140
- }
141
- .KRangeSlider .slider-input:disabled {
142
- cursor: not-allowed;
143
- }
144
- .KRangeSlider .slider-input:disabled::-webkit-slider-thumb {
145
- cursor: not-allowed;
29
+ // Default template for KRangeSlider
30
+ const props = defineProps<{
31
+ rangeMin: number
32
+ rangeMax: number
33
+ rangeStep: number
34
+ isDisabled: boolean
35
+ currentMinValue: number
36
+ currentMaxValue: number
37
+ minPercent: number
38
+ maxPercent: number
39
+ }>()
40
+
41
+ const emit = defineEmits<{
42
+ (e: 'update:minValue', value: number): void
43
+ (e: 'update:maxValue', value: number): void
44
+ }>()
45
+
46
+ const updateMinValue = (event: Event) => {
47
+ const value = parseFloat((event.target as HTMLInputElement).value)
48
+ // Ensure min doesn't exceed max
49
+ if (value <= props.currentMaxValue) {
50
+ emit('update:minValue', value)
51
+ }
146
52
  }
147
- .KRangeSlider .slider-input:disabled::-moz-range-thumb {
148
- cursor: not-allowed;
53
+
54
+ const updateMaxValue = (event: Event) => {
55
+ const value = parseFloat((event.target as HTMLInputElement).value)
56
+ // Ensure max doesn't go below min
57
+ if (value >= props.currentMinValue) {
58
+ emit('update:maxValue', value)
59
+ }
149
60
  }
150
- .KRangeSlider .slider-min {
151
- z-index: 3;
61
+
62
+ const handleTrackClick = (event: MouseEvent) => {
63
+ if (props.isDisabled) return
64
+
65
+ const target = event.currentTarget as HTMLElement
66
+ const rect = target.getBoundingClientRect()
67
+ const clickX = event.clientX - rect.left
68
+ const percentage = clickX / rect.width
69
+ const rawValue = props.rangeMin + (percentage * (props.rangeMax - props.rangeMin))
70
+
71
+ // Round to step
72
+ const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep
73
+ const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue))
74
+
75
+ // Determine which handle is closer
76
+ const distanceToMin = Math.abs(value - props.currentMinValue)
77
+ const distanceToMax = Math.abs(value - props.currentMaxValue)
78
+
79
+ if (distanceToMin < distanceToMax) {
80
+ // Move min handle
81
+ if (value <= props.currentMaxValue) {
82
+ emit('update:minValue', value)
83
+ }
84
+ } else {
85
+ // Move max handle
86
+ if (value >= props.currentMinValue) {
87
+ emit('update:maxValue', value)
88
+ }
89
+ }
152
90
  }
153
- .KRangeSlider .slider-max {
154
- z-index: 4;
91
+ </script>
92
+
93
+ <style lang="scss" scoped>
94
+ .KRangeSlider {
95
+ position: relative;
96
+ padding: 20px 0;
97
+
98
+ &.disabled {
99
+ opacity: 0.5;
100
+ cursor: not-allowed;
101
+ }
102
+
103
+ .slider-container {
104
+ position: relative;
105
+ height: 6px;
106
+ cursor: pointer;
107
+ }
108
+
109
+ .slider-track {
110
+ position: absolute;
111
+ width: 100%;
112
+ height: 6px;
113
+ background-color: var(--neutral-200);
114
+ border-radius: 3px;
115
+ }
116
+
117
+ .slider-range {
118
+ position: absolute;
119
+ height: 6px;
120
+ background-color: var(--primary-500);
121
+ border-radius: 3px;
122
+ z-index: 1;
123
+ }
124
+
125
+ .slider-input {
126
+ position: absolute;
127
+ width: 100%;
128
+ height: 1px;
129
+ background: transparent;
130
+ pointer-events: none;
131
+ -webkit-appearance: none;
132
+ appearance: none;
133
+
134
+ &::-webkit-slider-thumb {
135
+ -webkit-appearance: none;
136
+ appearance: none;
137
+ width: 18px;
138
+ height: 18px;
139
+ background-color: var(--primary-500);
140
+ border: 2px solid white;
141
+ border-radius: 50%;
142
+ cursor: pointer;
143
+ pointer-events: auto;
144
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
145
+ transition: transform 0.15s ease;
146
+
147
+ &:hover {
148
+ transform: scale(1.15);
149
+ }
150
+ }
151
+
152
+ &::-moz-range-thumb {
153
+ width: 18px;
154
+ height: 18px;
155
+ background-color: var(--primary-500);
156
+ border: 2px solid white;
157
+ border-radius: 50%;
158
+ cursor: pointer;
159
+ pointer-events: auto;
160
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
161
+ transition: transform 0.15s ease;
162
+
163
+ &:hover {
164
+ transform: scale(1.15);
165
+ }
166
+ }
167
+
168
+ &:disabled {
169
+ cursor: not-allowed;
170
+
171
+ &::-webkit-slider-thumb {
172
+ cursor: not-allowed;
173
+ }
174
+
175
+ &::-moz-range-thumb {
176
+ cursor: not-allowed;
177
+ }
178
+ }
179
+ }
180
+
181
+ .slider-min {
182
+ z-index: 3;
183
+ }
184
+
185
+ .slider-max {
186
+ z-index: 4;
187
+ }
155
188
  }
156
189
  </style>