@katlux/toolkit 0.1.0-beta.50 → 0.1.0-beta.52

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 (110) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
  3. package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
  4. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  5. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +21 -0
  6. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +3 -1
  7. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +21 -0
  8. package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +11 -0
  9. package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +9 -0
  10. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +47 -6
  11. package/dist/runtime/components/KCombobox/KCombobox.global.vue +9 -3
  12. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +47 -6
  13. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +25 -3
  14. package/dist/runtime/components/KCombobox/KCombobox.logic.js +61 -6
  15. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +29 -9
  16. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +2 -21
  17. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +29 -9
  18. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +15 -4
  19. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +16 -5
  20. package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
  21. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
  22. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +22 -1
  23. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +3 -1
  24. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +22 -1
  25. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +11 -0
  26. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +9 -0
  27. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +22 -1
  28. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +3 -1
  29. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +22 -1
  30. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +11 -0
  31. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +9 -0
  32. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +21 -0
  33. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +3 -1
  34. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +21 -0
  35. package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +12 -0
  36. package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +9 -0
  37. package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +1 -1
  38. package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +1 -1
  39. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +21 -0
  40. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +3 -1
  41. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +21 -0
  42. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +11 -0
  43. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +9 -0
  44. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
  45. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
  46. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
  47. package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
  48. package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
  49. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +21 -0
  50. package/dist/runtime/components/KTextarea/KTextarea.global.vue +3 -1
  51. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +21 -0
  52. package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +11 -0
  53. package/dist/runtime/components/KTextarea/KTextarea.logic.js +9 -0
  54. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +20 -0
  55. package/dist/runtime/components/KTextbox/KTextbox.global.vue +3 -1
  56. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +20 -0
  57. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +11 -0
  58. package/dist/runtime/components/KTextbox/KTextbox.logic.js +9 -0
  59. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
  60. package/dist/runtime/components/KToast/KToast.global.vue +32 -0
  61. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
  62. package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
  63. package/dist/runtime/components/KToast/KToast.logic.js +47 -0
  64. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
  65. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
  66. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +35 -6
  67. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +8 -1
  68. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +35 -6
  69. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +17 -0
  70. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +18 -1
  71. package/dist/runtime/presets/default/assets/scss/index.css +27 -0
  72. package/dist/runtime/presets/default/assets/scss/index.scss +30 -0
  73. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +2 -0
  74. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +10 -6
  75. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +2 -0
  76. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +4 -2
  77. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +25 -21
  78. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +4 -2
  79. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +2 -0
  80. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +91 -79
  81. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +2 -0
  82. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +2 -0
  83. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +13 -1
  84. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +2 -0
  85. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +2 -0
  86. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +12 -1
  87. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +2 -0
  88. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +2 -0
  89. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +4 -0
  90. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +2 -0
  91. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +13 -2
  92. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +2 -0
  93. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +4 -0
  94. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +2 -0
  95. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
  96. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +10 -6
  97. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
  98. package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +2 -0
  99. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +5 -1
  100. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +2 -0
  101. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +2 -0
  102. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +7 -3
  103. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +2 -0
  104. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
  105. package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
  106. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
  107. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +4 -0
  108. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +11 -1
  109. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +4 -0
  110. package/package.json +1 -1
@@ -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
+ }
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
66
66
  };
67
67
  }>> & Readonly<{}>, {
68
68
  disabled: boolean;
69
- labelField: string;
70
69
  searchtext: string;
70
+ labelField: string;
71
71
  multiSelect: boolean;
72
72
  iconField: string;
73
73
  isNodeSelected: (node: any) => boolean;
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
66
66
  };
67
67
  }>> & Readonly<{}>, {
68
68
  disabled: boolean;
69
- labelField: string;
70
69
  searchtext: string;
70
+ labelField: string;
71
71
  multiSelect: boolean;
72
72
  iconField: string;
73
73
  isNodeSelected: (node: any) => boolean;
@@ -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<import("@katlux/providers").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,35 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
47
52
  type: BooleanConstructor;
48
53
  default: boolean;
49
54
  };
55
+ validation: {
56
+ type: import("vue").PropType<KTreePickerProps["validation"]>;
57
+ default: null;
58
+ validator: (value: string) => boolean;
59
+ };
60
+ validationText: {
61
+ type: StringConstructor;
62
+ default: string;
63
+ };
50
64
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
51
65
  change: (value: any) => any;
52
66
  "update:modelValue": (value: any) => any;
53
67
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
54
68
  modelValue: {
55
- type: PropType<any>;
69
+ type: import("vue").PropType<any>;
56
70
  default: null;
57
71
  };
58
72
  dataProvider: {
59
- type: PropType<import("@katlux/providers").ADataProvider>;
73
+ type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
60
74
  required: boolean;
61
75
  };
62
76
  labelField: {
63
77
  type: StringConstructor;
64
78
  required: boolean;
65
79
  };
80
+ valueField: {
81
+ type: StringConstructor;
82
+ default: null;
83
+ };
66
84
  placeholder: {
67
85
  type: StringConstructor;
68
86
  default: string;
@@ -99,18 +117,29 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
99
117
  type: BooleanConstructor;
100
118
  default: boolean;
101
119
  };
120
+ validation: {
121
+ type: import("vue").PropType<KTreePickerProps["validation"]>;
122
+ default: null;
123
+ validator: (value: string) => boolean;
124
+ };
125
+ validationText: {
126
+ type: StringConstructor;
127
+ default: string;
128
+ };
102
129
  }>> & Readonly<{
103
130
  onChange?: ((value: any) => any) | undefined;
104
131
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
105
132
  }>, {
106
133
  disabled: boolean;
107
134
  loading: boolean;
135
+ validation: "error" | "success" | "warning" | null | undefined;
136
+ validationText: string;
108
137
  modelValue: any;
109
- dataProvider: any;
110
- placeholder: string;
111
138
  searchbox: boolean;
139
+ placeholder: string;
112
140
  closeOnSelect: boolean;
113
141
  multiSelect: boolean;
142
+ valueField: string;
114
143
  iconField: string;
115
144
  idKey: string;
116
145
  parentKey: string;
@@ -40,7 +40,10 @@ const templateProps = computed(() => ({
40
40
  selectItem,
41
41
  isSelected,
42
42
  loading: loading.value || props.loading,
43
- closeOnSelect: props.closeOnSelect
43
+ closeOnSelect: props.closeOnSelect,
44
+ valueField: props.valueField || props.idKey,
45
+ validation: props.validation,
46
+ validationText: props.validationText
44
47
  }));
45
48
  function onUpdateModelValue(val) {
46
49
  emit("update:modelValue", val);
@@ -51,6 +54,9 @@ function onChange(val) {
51
54
  function updateSearchText(val) {
52
55
  searchtext.value = val;
53
56
  }
57
+ function updateIsOptionsOpen(val) {
58
+ isOptionsOpen.value = val;
59
+ }
54
60
  </script>
55
61
 
56
62
  <template lang="pug">
@@ -60,6 +66,7 @@ component(
60
66
  @update:modelValue="onUpdateModelValue"
61
67
  @change="onChange"
62
68
  @update:searchtext="updateSearchText"
69
+ @update:isOptionsOpen="updateIsOptionsOpen"
63
70
  )
64
71
  template(v-for="(_, slot) in $slots" #[slot]="scope")
65
72
  slot(:name="slot" v-bind="scope")
@@ -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<import("@katlux/providers").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,35 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
47
52
  type: BooleanConstructor;
48
53
  default: boolean;
49
54
  };
55
+ validation: {
56
+ type: import("vue").PropType<KTreePickerProps["validation"]>;
57
+ default: null;
58
+ validator: (value: string) => boolean;
59
+ };
60
+ validationText: {
61
+ type: StringConstructor;
62
+ default: string;
63
+ };
50
64
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
51
65
  change: (value: any) => any;
52
66
  "update:modelValue": (value: any) => any;
53
67
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
54
68
  modelValue: {
55
- type: PropType<any>;
69
+ type: import("vue").PropType<any>;
56
70
  default: null;
57
71
  };
58
72
  dataProvider: {
59
- type: PropType<import("@katlux/providers").ADataProvider>;
73
+ type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
60
74
  required: boolean;
61
75
  };
62
76
  labelField: {
63
77
  type: StringConstructor;
64
78
  required: boolean;
65
79
  };
80
+ valueField: {
81
+ type: StringConstructor;
82
+ default: null;
83
+ };
66
84
  placeholder: {
67
85
  type: StringConstructor;
68
86
  default: string;
@@ -99,18 +117,29 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
99
117
  type: BooleanConstructor;
100
118
  default: boolean;
101
119
  };
120
+ validation: {
121
+ type: import("vue").PropType<KTreePickerProps["validation"]>;
122
+ default: null;
123
+ validator: (value: string) => boolean;
124
+ };
125
+ validationText: {
126
+ type: StringConstructor;
127
+ default: string;
128
+ };
102
129
  }>> & Readonly<{
103
130
  onChange?: ((value: any) => any) | undefined;
104
131
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
105
132
  }>, {
106
133
  disabled: boolean;
107
134
  loading: boolean;
135
+ validation: "error" | "success" | "warning" | null | undefined;
136
+ validationText: string;
108
137
  modelValue: any;
109
- dataProvider: any;
110
- placeholder: string;
111
138
  searchbox: boolean;
139
+ placeholder: string;
112
140
  closeOnSelect: boolean;
113
141
  multiSelect: boolean;
142
+ valueField: string;
114
143
  iconField: string;
115
144
  idKey: string;
116
145
  parentKey: string;
@@ -1,8 +1,10 @@
1
1
  import type { ADataProvider } from '@katlux/providers';
2
+ import { type PropType } from 'vue';
2
3
  export interface KTreePickerProps {
3
4
  modelValue?: any;
4
5
  dataProvider: ADataProvider;
5
6
  labelField: string;
7
+ valueField?: string;
6
8
  placeholder?: string;
7
9
  disabled?: boolean;
8
10
  closeOnSelect?: boolean;
@@ -12,6 +14,8 @@ export interface KTreePickerProps {
12
14
  loading?: boolean;
13
15
  multiSelect?: boolean;
14
16
  searchbox?: boolean;
17
+ validation?: 'success' | 'warning' | 'error' | null;
18
+ validationText?: string;
15
19
  }
16
20
  export declare const KTreePickerDefaultProps: {
17
21
  modelValue: {
@@ -26,6 +30,10 @@ export declare const KTreePickerDefaultProps: {
26
30
  type: StringConstructor;
27
31
  required: boolean;
28
32
  };
33
+ valueField: {
34
+ type: StringConstructor;
35
+ default: null;
36
+ };
29
37
  placeholder: {
30
38
  type: StringConstructor;
31
39
  default: string;
@@ -62,6 +70,15 @@ export declare const KTreePickerDefaultProps: {
62
70
  type: BooleanConstructor;
63
71
  default: boolean;
64
72
  };
73
+ validation: {
74
+ type: PropType<KTreePickerProps["validation"]>;
75
+ default: null;
76
+ validator: (value: string) => boolean;
77
+ };
78
+ validationText: {
79
+ type: StringConstructor;
80
+ default: string;
81
+ };
65
82
  };
66
83
  export declare function useKTreePickerLogic(props: KTreePickerProps, emit: any): {
67
84
  selectedItems: import("vue").Ref<import("@katlux/providers").TDataRow[] | null, import("@katlux/providers").TDataRow[] | null>;
@@ -11,6 +11,10 @@ export const KTreePickerDefaultProps = {
11
11
  type: String,
12
12
  required: true
13
13
  },
14
+ valueField: {
15
+ type: String,
16
+ default: null
17
+ },
14
18
  placeholder: {
15
19
  type: String,
16
20
  default: "Select..."
@@ -47,11 +51,24 @@ export const KTreePickerDefaultProps = {
47
51
  searchbox: {
48
52
  type: Boolean,
49
53
  default: false
54
+ },
55
+ validation: {
56
+ type: String,
57
+ default: null,
58
+ validator: (value) => [null, "success", "warning", "error"].includes(value)
59
+ },
60
+ validationText: {
61
+ type: String,
62
+ default: ""
50
63
  }
51
64
  };
52
65
  import { useKComboboxLogic } from "../KCombobox/KCombobox.logic.js";
53
66
  export function useKTreePickerLogic(props, emit) {
54
- const comboboxLogic = useKComboboxLogic(props, emit);
67
+ const logicProps = {
68
+ ...props,
69
+ valueField: props.valueField || props.idKey
70
+ };
71
+ const comboboxLogic = useKComboboxLogic(logicProps, emit);
55
72
  return {
56
73
  ...comboboxLogic
57
74
  };
@@ -267,4 +267,31 @@ body {
267
267
  background-color: var(--layout-content-bg);
268
268
  font-family: var(--font-family);
269
269
  color: var(--font-color-primary);
270
+ }
271
+
272
+ .validation-text {
273
+ font-size: var(--font-size-xs);
274
+ margin-top: 4px;
275
+ display: block;
276
+ }
277
+ .validation-text.is-success {
278
+ color: var(--success-color);
279
+ }
280
+ .validation-text.is-warning {
281
+ color: var(--warning-color);
282
+ }
283
+ .validation-text.is-error {
284
+ color: var(--error-color);
285
+ }
286
+
287
+ .is-success {
288
+ border-color: var(--success-color) !important;
289
+ }
290
+
291
+ .is-warning {
292
+ border-color: var(--warning-color) !important;
293
+ }
294
+
295
+ .is-error {
296
+ border-color: var(--error-color) !important;
270
297
  }
@@ -9,4 +9,34 @@ body {
9
9
  background-color: var(--layout-content-bg);
10
10
  font-family: var(--font-family);
11
11
  color: var(--font-color-primary);
12
+ }
13
+
14
+ .validation-text {
15
+ font-size: var(--font-size-xs);
16
+ margin-top: 4px;
17
+ display: block;
18
+
19
+ &.is-success {
20
+ color: var(--success-color);
21
+ }
22
+
23
+ &.is-warning {
24
+ color: var(--warning-color);
25
+ }
26
+
27
+ &.is-error {
28
+ color: var(--error-color);
29
+ }
30
+ }
31
+
32
+ .is-success {
33
+ border-color: var(--success-color) !important;
34
+ }
35
+
36
+ .is-warning {
37
+ border-color: var(--warning-color) !important;
38
+ }
39
+
40
+ .is-error {
41
+ border-color: var(--error-color) !important;
12
42
  }
@@ -2,6 +2,8 @@ type __VLS_Props = {
2
2
  model: any;
3
3
  checkboxValue: any;
4
4
  isDisabled: boolean;
5
+ validation?: 'success' | 'warning' | 'error' | null;
6
+ validationText?: string;
5
7
  };
6
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
9
  "update:model": (value: any) => any;
@@ -1,10 +1,12 @@
1
1
  <template lang="pug">
2
- label.KCheckbox
3
- input(type="checkbox" v-model="internalModel" :value="checkboxValue" :disabled="isDisabled")
4
- .icon-container
5
- KIcon.icon(iconname="check")
6
- span
7
- slot
2
+ .KCheckbox-wrapper
3
+ label.KCheckbox
4
+ input(type="checkbox" v-model="internalModel" :value="checkboxValue" :disabled="isDisabled")
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
12
  <script lang="ts" setup>
@@ -15,6 +17,8 @@ const props = defineProps<{
15
17
  model: any
16
18
  checkboxValue: any
17
19
  isDisabled: boolean
20
+ validation?: 'success' | 'warning' | 'error' | null
21
+ validationText?: string
18
22
  }>()
19
23
 
20
24
  const emit = defineEmits<{
@@ -2,6 +2,8 @@ type __VLS_Props = {
2
2
  model: any;
3
3
  checkboxValue: any;
4
4
  isDisabled: boolean;
5
+ validation?: 'success' | 'warning' | 'error' | null;
6
+ validationText?: string;
5
7
  };
6
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
9
  "update:model": (value: any) => any;
@@ -14,13 +14,15 @@ type __VLS_Props = {
14
14
  isSelected: (option: ComboboxItem) => boolean;
15
15
  loading: boolean;
16
16
  teleportTo?: string;
17
+ validation?: 'success' | 'warning' | 'error' | null;
18
+ validationText?: string;
17
19
  };
18
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
- "update:searchtext": (value: string) => any;
20
21
  "update:isOptionsOpen": (value: boolean) => any;
22
+ "update:searchtext": (value: string) => any;
21
23
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
- "onUpdate:searchtext"?: ((value: string) => any) | undefined;
23
24
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
25
+ "onUpdate:searchtext"?: ((value: string) => any) | undefined;
24
26
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
27
  declare const _default: typeof __VLS_export;
26
28
  export default _default;