@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
@@ -2,6 +2,8 @@ export interface KTextareaProps {
2
2
  modelValue: string;
3
3
  placeholder?: string;
4
4
  rows?: number;
5
+ validation?: 'success' | 'warning' | 'error' | null;
6
+ validationText?: string;
5
7
  }
6
8
  export interface KTextareaEmits {
7
9
  (e: 'update:modelValue', value: string): void;
@@ -28,4 +30,13 @@ export declare const KTextareaDefaultProps: {
28
30
  type: NumberConstructor;
29
31
  default: number;
30
32
  };
33
+ validation: {
34
+ type: import("vue").PropType<KTextareaProps["validation"]>;
35
+ default: null;
36
+ validator: (value: string) => boolean;
37
+ };
38
+ validationText: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
31
42
  };
@@ -20,5 +20,14 @@ export const KTextareaDefaultProps = {
20
20
  rows: {
21
21
  type: Number,
22
22
  default: 4
23
+ },
24
+ validation: {
25
+ type: String,
26
+ default: null,
27
+ validator: (value) => [null, "success", "warning", "error"].includes(value)
28
+ },
29
+ validationText: {
30
+ type: String,
31
+ default: ""
23
32
  }
24
33
  };
@@ -1,7 +1,8 @@
1
+ import { type KTextboxProps } from './KTextbox.logic.js';
1
2
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
3
  modelValue: {
3
4
  type: StringConstructor;
4
- required: boolean;
5
+ default: string;
5
6
  };
6
7
  placeholder: {
7
8
  type: StringConstructor;
@@ -11,12 +12,26 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
11
12
  type: BooleanConstructor;
12
13
  default: boolean;
13
14
  };
15
+ type: {
16
+ type: import("vue").PropType<KTextboxProps["type"]>;
17
+ default: string;
18
+ validator: (value: string) => boolean;
19
+ };
20
+ validation: {
21
+ type: import("vue").PropType<KTextboxProps["validation"]>;
22
+ default: null;
23
+ validator: (value: string) => boolean;
24
+ };
25
+ validationText: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
14
29
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
30
  "update:modelValue": (value: string) => any;
16
31
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
32
  modelValue: {
18
33
  type: StringConstructor;
19
- required: boolean;
34
+ default: string;
20
35
  };
21
36
  placeholder: {
22
37
  type: StringConstructor;
@@ -26,9 +41,27 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
26
41
  type: BooleanConstructor;
27
42
  default: boolean;
28
43
  };
44
+ type: {
45
+ type: import("vue").PropType<KTextboxProps["type"]>;
46
+ default: string;
47
+ validator: (value: string) => boolean;
48
+ };
49
+ validation: {
50
+ type: import("vue").PropType<KTextboxProps["validation"]>;
51
+ default: null;
52
+ validator: (value: string) => boolean;
53
+ };
54
+ validationText: {
55
+ type: StringConstructor;
56
+ default: string;
57
+ };
29
58
  }>> & Readonly<{
30
59
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
31
60
  }>, {
61
+ type: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
62
+ validation: "error" | "success" | "warning" | null | undefined;
63
+ validationText: string;
64
+ modelValue: string;
32
65
  placeholder: string;
33
66
  showClear: boolean;
34
67
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -5,16 +5,19 @@ import { computed } from "vue";
5
5
  import KTextboxDefault from "../../presets/default/components/KTextbox/KTextbox.vue";
6
6
  const props = defineProps(KTextboxDefaultProps);
7
7
  const emit = defineEmits(["update:modelValue"]);
8
- const { text, showClearIcon, clear } = useKTextboxLogic(props, emit);
8
+ const { text, showClear, clear } = useKTextboxLogic(props, emit);
9
9
  const presetComponent = usePresetComponent("KTextbox", KTextboxDefault);
10
10
  const templateProps = computed(() => ({
11
11
  text: text.value,
12
- showClearIcon: showClearIcon.value,
12
+ showClear: showClear.value,
13
13
  clear,
14
- placeholder: props.placeholder
14
+ placeholder: props.placeholder,
15
+ type: props.type,
16
+ validation: props.validation,
17
+ validationText: props.validationText
15
18
  }));
16
19
  </script>
17
20
 
18
21
  <template lang="pug">
19
- component(:is="presetComponent" v-bind="templateProps" @update:text="text = $event")
22
+ component(:is="presetComponent" v-bind="{ ...templateProps, ...$attrs }" @update:text="text = $event")
20
23
  </template>
@@ -1,7 +1,8 @@
1
+ import { type KTextboxProps } from './KTextbox.logic.js';
1
2
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
3
  modelValue: {
3
4
  type: StringConstructor;
4
- required: boolean;
5
+ default: string;
5
6
  };
6
7
  placeholder: {
7
8
  type: StringConstructor;
@@ -11,12 +12,26 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
11
12
  type: BooleanConstructor;
12
13
  default: boolean;
13
14
  };
15
+ type: {
16
+ type: import("vue").PropType<KTextboxProps["type"]>;
17
+ default: string;
18
+ validator: (value: string) => boolean;
19
+ };
20
+ validation: {
21
+ type: import("vue").PropType<KTextboxProps["validation"]>;
22
+ default: null;
23
+ validator: (value: string) => boolean;
24
+ };
25
+ validationText: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
14
29
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
30
  "update:modelValue": (value: string) => any;
16
31
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
32
  modelValue: {
18
33
  type: StringConstructor;
19
- required: boolean;
34
+ default: string;
20
35
  };
21
36
  placeholder: {
22
37
  type: StringConstructor;
@@ -26,9 +41,27 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
26
41
  type: BooleanConstructor;
27
42
  default: boolean;
28
43
  };
44
+ type: {
45
+ type: import("vue").PropType<KTextboxProps["type"]>;
46
+ default: string;
47
+ validator: (value: string) => boolean;
48
+ };
49
+ validation: {
50
+ type: import("vue").PropType<KTextboxProps["validation"]>;
51
+ default: null;
52
+ validator: (value: string) => boolean;
53
+ };
54
+ validationText: {
55
+ type: StringConstructor;
56
+ default: string;
57
+ };
29
58
  }>> & Readonly<{
30
59
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
31
60
  }>, {
61
+ type: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
62
+ validation: "error" | "success" | "warning" | null | undefined;
63
+ validationText: string;
64
+ modelValue: string;
32
65
  placeholder: string;
33
66
  showClear: boolean;
34
67
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,7 +1,10 @@
1
1
  export interface KTextboxProps {
2
- modelValue: string;
3
- placeholder: string;
2
+ modelValue?: string;
3
+ placeholder?: string;
4
4
  showClear?: boolean;
5
+ type?: 'text' | 'password' | 'email' | 'url' | 'tel' | 'search' | 'number';
6
+ validation?: 'success' | 'warning' | 'error' | null;
7
+ validationText?: string;
5
8
  }
6
9
  export interface KTextboxEmits {
7
10
  (e: 'update:modelValue', value: string): void;
@@ -11,7 +14,7 @@ export interface KTextboxEmits {
11
14
  */
12
15
  export declare function useKTextboxLogic(props: KTextboxProps, emit: KTextboxEmits): {
13
16
  text: import("vue").WritableComputedRef<string, string>;
14
- showClearIcon: import("vue").ComputedRef<boolean | undefined>;
17
+ showClear: import("vue").ComputedRef<boolean>;
15
18
  clear: () => void;
16
19
  };
17
20
  /**
@@ -20,7 +23,7 @@ export declare function useKTextboxLogic(props: KTextboxProps, emit: KTextboxEmi
20
23
  export declare const KTextboxDefaultProps: {
21
24
  modelValue: {
22
25
  type: StringConstructor;
23
- required: boolean;
26
+ default: string;
24
27
  };
25
28
  placeholder: {
26
29
  type: StringConstructor;
@@ -30,4 +33,18 @@ export declare const KTextboxDefaultProps: {
30
33
  type: BooleanConstructor;
31
34
  default: boolean;
32
35
  };
36
+ type: {
37
+ type: import("vue").PropType<KTextboxProps["type"]>;
38
+ default: string;
39
+ validator: (value: string) => boolean;
40
+ };
41
+ validation: {
42
+ type: import("vue").PropType<KTextboxProps["validation"]>;
43
+ default: null;
44
+ validator: (value: string) => boolean;
45
+ };
46
+ validationText: {
47
+ type: StringConstructor;
48
+ default: string;
49
+ };
33
50
  };
@@ -1,25 +1,25 @@
1
1
  import { computed } from "vue";
2
2
  export function useKTextboxLogic(props, emit) {
3
3
  const text = computed({
4
- get: () => props.modelValue,
4
+ get: () => props.modelValue ?? "",
5
5
  set: (value) => emit("update:modelValue", value)
6
6
  });
7
- const showClearIcon = computed(() => {
8
- return props.showClear && text.value !== "";
7
+ const showClear = computed(() => {
8
+ return !!props.showClear && text.value !== "";
9
9
  });
10
10
  const clear = () => {
11
11
  text.value = "";
12
12
  };
13
13
  return {
14
14
  text,
15
- showClearIcon,
15
+ showClear,
16
16
  clear
17
17
  };
18
18
  }
19
19
  export const KTextboxDefaultProps = {
20
20
  modelValue: {
21
21
  type: String,
22
- required: true
22
+ default: ""
23
23
  },
24
24
  placeholder: {
25
25
  type: String,
@@ -28,5 +28,21 @@ export const KTextboxDefaultProps = {
28
28
  showClear: {
29
29
  type: Boolean,
30
30
  default: false
31
+ },
32
+ type: {
33
+ type: String,
34
+ default: "text",
35
+ validator: (value) => {
36
+ return ["text", "password", "email", "url", "tel", "search", "number"].includes(value);
37
+ }
38
+ },
39
+ validation: {
40
+ type: String,
41
+ default: null,
42
+ validator: (value) => [null, "success", "warning", "error"].includes(value)
43
+ },
44
+ validationText: {
45
+ type: String,
46
+ default: ""
31
47
  }
32
48
  };
@@ -0,0 +1,57 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ modelValue: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ text: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ timeout: {
11
+ type: NumberConstructor;
12
+ default: number;
13
+ };
14
+ teleport: {
15
+ type: BooleanConstructor;
16
+ default: boolean;
17
+ };
18
+ type: {
19
+ type: import("vue").PropType<import("./KToast.logic.js").KToastType>;
20
+ default: string;
21
+ };
22
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ close: (...args: any[]) => void;
24
+ "update:modelValue": (...args: any[]) => void;
25
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ modelValue: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ text: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ timeout: {
35
+ type: NumberConstructor;
36
+ default: number;
37
+ };
38
+ teleport: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ type: {
43
+ type: import("vue").PropType<import("./KToast.logic.js").KToastType>;
44
+ default: string;
45
+ };
46
+ }>> & Readonly<{
47
+ onClose?: ((...args: any[]) => any) | undefined;
48
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
+ }>, {
50
+ text: string;
51
+ type: import("./KToast.logic.js").KToastType;
52
+ modelValue: boolean;
53
+ timeout: number;
54
+ teleport: boolean;
55
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
56
+ declare const _default: typeof __VLS_export;
57
+ export default _default;
@@ -0,0 +1,32 @@
1
+ <script setup>
2
+ import { useKToastLogic, KToastDefaultProps } from "./KToast.logic";
3
+ import { usePresetComponent } from "../../composables/usePresetComponent";
4
+ import { computed } from "vue";
5
+ import KToastDefault from "../../presets/default/components/KToast/KToast.vue";
6
+ const props = defineProps(KToastDefaultProps);
7
+ const emit = defineEmits(["update:modelValue", "close"]);
8
+ const { startTimeout } = useKToastLogic(props, emit);
9
+ const presetComponent = usePresetComponent("KToast", KToastDefault);
10
+ const templateProps = computed(() => ({
11
+ modelValue: props.modelValue,
12
+ text: props.text,
13
+ timeout: props.timeout,
14
+ teleport: props.teleport,
15
+ type: props.type
16
+ }));
17
+ const onClose = () => {
18
+ emit("update:modelValue", false);
19
+ emit("close");
20
+ };
21
+ </script>
22
+
23
+ <template lang="pug">
24
+ component(
25
+ :is="presetComponent"
26
+ v-bind="templateProps"
27
+ @update:modelValue="$emit('update:modelValue', $event)"
28
+ @close="onClose"
29
+ )
30
+ template(v-for="(_, slot) in $slots" #[slot]="scope")
31
+ slot(:name="slot" v-bind="scope")
32
+ </template>
@@ -0,0 +1,57 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ modelValue: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ text: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ timeout: {
11
+ type: NumberConstructor;
12
+ default: number;
13
+ };
14
+ teleport: {
15
+ type: BooleanConstructor;
16
+ default: boolean;
17
+ };
18
+ type: {
19
+ type: import("vue").PropType<import("./KToast.logic.js").KToastType>;
20
+ default: string;
21
+ };
22
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ close: (...args: any[]) => void;
24
+ "update:modelValue": (...args: any[]) => void;
25
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ modelValue: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ text: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ timeout: {
35
+ type: NumberConstructor;
36
+ default: number;
37
+ };
38
+ teleport: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ type: {
43
+ type: import("vue").PropType<import("./KToast.logic.js").KToastType>;
44
+ default: string;
45
+ };
46
+ }>> & Readonly<{
47
+ onClose?: ((...args: any[]) => any) | undefined;
48
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
+ }>, {
50
+ text: string;
51
+ type: import("./KToast.logic.js").KToastType;
52
+ modelValue: boolean;
53
+ timeout: number;
54
+ teleport: boolean;
55
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
56
+ declare const _default: typeof __VLS_export;
57
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import { type PropType } from 'vue';
2
+ export type KToastType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'error' | 'default';
3
+ export interface KToastProps {
4
+ modelValue: boolean;
5
+ text?: string;
6
+ timeout?: number;
7
+ teleport?: boolean;
8
+ type?: KToastType;
9
+ }
10
+ export declare const KToastDefaultProps: {
11
+ modelValue: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ text: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ timeout: {
20
+ type: NumberConstructor;
21
+ default: number;
22
+ };
23
+ teleport: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ type: {
28
+ type: PropType<KToastType>;
29
+ default: string;
30
+ };
31
+ };
32
+ export declare function useKToastLogic(props: KToastProps, emit: any): {
33
+ startTimeout: () => void;
34
+ };
@@ -0,0 +1,47 @@
1
+ import { watch } from "vue";
2
+ export const KToastDefaultProps = {
3
+ modelValue: {
4
+ type: Boolean,
5
+ default: false
6
+ },
7
+ text: {
8
+ type: String,
9
+ default: ""
10
+ },
11
+ timeout: {
12
+ type: Number,
13
+ default: 3e3
14
+ },
15
+ teleport: {
16
+ type: Boolean,
17
+ default: false
18
+ },
19
+ type: {
20
+ type: String,
21
+ default: "info"
22
+ }
23
+ };
24
+ export function useKToastLogic(props, emit) {
25
+ let timeoutId = null;
26
+ const startTimeout = () => {
27
+ if (timeoutId) clearTimeout(timeoutId);
28
+ if (props.timeout && props.timeout > 0 && props.modelValue) {
29
+ timeoutId = setTimeout(() => {
30
+ emit("update:modelValue", false);
31
+ }, props.timeout);
32
+ }
33
+ };
34
+ watch(() => props.modelValue, (val) => {
35
+ if (val) {
36
+ startTimeout();
37
+ } else if (timeoutId) {
38
+ clearTimeout(timeoutId);
39
+ }
40
+ }, { immediate: true });
41
+ watch(() => props.timeout, () => {
42
+ if (props.modelValue) startTimeout();
43
+ });
44
+ return {
45
+ startTimeout
46
+ };
47
+ }
@@ -45,7 +45,7 @@ export declare const KTreeDefaultProps: {
45
45
  };
46
46
  };
47
47
  export declare function useKTreeLogic(props: KTreeProps): {
48
- visibleRows: import("vue").ComputedRef<any>;
48
+ visibleRows: import("vue").ComputedRef<import("@katlux/providers").TDataRow[]>;
49
49
  expandedNodes: any;
50
50
  toggleNode: (nodeId: string | number) => void;
51
51
  };
@@ -1,16 +1,21 @@
1
+ import { type KTreePickerProps } from './KTreePicker.logic.js';
1
2
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
3
  modelValue: {
3
- type: PropType<any>;
4
+ type: import("vue").PropType<any>;
4
5
  default: null;
5
6
  };
6
7
  dataProvider: {
7
- type: PropType<ADataProvider>;
8
+ type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
8
9
  required: boolean;
9
10
  };
10
11
  labelField: {
11
12
  type: StringConstructor;
12
13
  required: boolean;
13
14
  };
15
+ valueField: {
16
+ type: StringConstructor;
17
+ default: null;
18
+ };
14
19
  placeholder: {
15
20
  type: StringConstructor;
16
21
  default: string;
@@ -47,22 +52,48 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
47
52
  type: BooleanConstructor;
48
53
  default: boolean;
49
54
  };
55
+ searchPlaceholder: {
56
+ type: StringConstructor;
57
+ default: string;
58
+ };
59
+ validation: {
60
+ type: import("vue").PropType<KTreePickerProps["validation"]>;
61
+ default: null;
62
+ validator: (value: string) => boolean;
63
+ };
64
+ validationText: {
65
+ type: StringConstructor;
66
+ default: string;
67
+ };
68
+ isOptionsOpen: {
69
+ type: BooleanConstructor;
70
+ default: undefined;
71
+ };
72
+ fullWidth: {
73
+ type: BooleanConstructor;
74
+ default: boolean;
75
+ };
50
76
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
51
77
  change: (value: any) => any;
52
78
  "update:modelValue": (value: any) => any;
79
+ "update:isOptionsOpen": (value: boolean) => any;
53
80
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
54
81
  modelValue: {
55
- type: PropType<any>;
82
+ type: import("vue").PropType<any>;
56
83
  default: null;
57
84
  };
58
85
  dataProvider: {
59
- type: PropType<ADataProvider>;
86
+ type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
60
87
  required: boolean;
61
88
  };
62
89
  labelField: {
63
90
  type: StringConstructor;
64
91
  required: boolean;
65
92
  };
93
+ valueField: {
94
+ type: StringConstructor;
95
+ default: null;
96
+ };
66
97
  placeholder: {
67
98
  type: StringConstructor;
68
99
  default: string;
@@ -99,21 +130,48 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
99
130
  type: BooleanConstructor;
100
131
  default: boolean;
101
132
  };
133
+ searchPlaceholder: {
134
+ type: StringConstructor;
135
+ default: string;
136
+ };
137
+ validation: {
138
+ type: import("vue").PropType<KTreePickerProps["validation"]>;
139
+ default: null;
140
+ validator: (value: string) => boolean;
141
+ };
142
+ validationText: {
143
+ type: StringConstructor;
144
+ default: string;
145
+ };
146
+ isOptionsOpen: {
147
+ type: BooleanConstructor;
148
+ default: undefined;
149
+ };
150
+ fullWidth: {
151
+ type: BooleanConstructor;
152
+ default: boolean;
153
+ };
102
154
  }>> & Readonly<{
103
155
  onChange?: ((value: any) => any) | undefined;
104
156
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
157
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
105
158
  }>, {
159
+ parentKey: string;
160
+ idKey: string;
106
161
  disabled: boolean;
107
162
  loading: boolean;
163
+ validation: "error" | "success" | "warning" | null | undefined;
164
+ validationText: string;
108
165
  modelValue: any;
109
166
  searchbox: boolean;
167
+ searchPlaceholder: string;
168
+ isOptionsOpen: boolean;
110
169
  placeholder: string;
111
- dataProvider: any;
170
+ fullWidth: boolean;
112
171
  closeOnSelect: boolean;
113
172
  multiSelect: boolean;
173
+ valueField: string;
114
174
  iconField: string;
115
- idKey: string;
116
- parentKey: string;
117
175
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
118
176
  declare const _default: typeof __VLS_export;
119
177
  export default _default;