@katlux/toolkit 0.1.0-beta.51 → 0.1.0-beta.53

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 (27) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +11 -0
  3. package/dist/runtime/components/KCombobox/KCombobox.global.vue +5 -2
  4. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +11 -0
  5. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +6 -0
  6. package/dist/runtime/components/KCombobox/KCombobox.logic.js +9 -0
  7. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +2 -2
  8. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +2 -2
  9. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +2 -2
  10. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
  11. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
  12. package/dist/runtime/components/KToast/KToast.global.vue +32 -0
  13. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
  14. package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
  15. package/dist/runtime/components/KToast/KToast.logic.js +47 -0
  16. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +4 -0
  17. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +7 -5
  18. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +2 -2
  19. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +2 -2
  20. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +1 -1
  21. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
  22. package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
  23. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
  24. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +2 -0
  25. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +7 -1
  26. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +2 -0
  27. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
3
  "configKey": "katluxToolkit",
4
- "version": "0.1.0-beta.51",
4
+ "version": "0.1.0-beta.53",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -57,8 +57,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
57
57
  type: StringConstructor;
58
58
  default: string;
59
59
  };
60
+ isOptionsOpen: {
61
+ type: BooleanConstructor;
62
+ default: undefined;
63
+ };
60
64
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
61
65
  "update:modelValue": (value: any) => any;
66
+ "update:isOptionsOpen": (value: boolean) => any;
62
67
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
63
68
  dataProvider: {
64
69
  type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
@@ -117,14 +122,20 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
117
122
  type: StringConstructor;
118
123
  default: string;
119
124
  };
125
+ isOptionsOpen: {
126
+ type: BooleanConstructor;
127
+ default: undefined;
128
+ };
120
129
  }>> & Readonly<{
121
130
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
131
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
122
132
  }>, {
123
133
  disabled: boolean;
124
134
  validation: "error" | "success" | "warning" | null | undefined;
125
135
  validationText: string;
126
136
  modelValue: any;
127
137
  searchbox: boolean;
138
+ isOptionsOpen: boolean;
128
139
  placeholder: string;
129
140
  teleportTo: string;
130
141
  closeOnSelect: boolean;
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { useKComboboxLogic, KComboboxDefaultProps } from "./KCombobox.logic";
3
3
  import { usePresetComponent } from "../../composables/usePresetComponent";
4
- import { computed } from "vue";
4
+ import { computed, watch } from "vue";
5
5
  import KComboboxDefault from "../../presets/default/components/KCombobox/KCombobox.vue";
6
6
  const props = defineProps(KComboboxDefaultProps);
7
- const emit = defineEmits(["update:modelValue"]);
7
+ const emit = defineEmits(["update:modelValue", "update:isOptionsOpen"]);
8
8
  const {
9
9
  selectedItems,
10
10
  isOptionsOpen,
@@ -17,6 +17,9 @@ const {
17
17
  filteredOptions,
18
18
  loading
19
19
  } = useKComboboxLogic(props, emit);
20
+ watch(isOptionsOpen, (newVal) => {
21
+ emit("update:isOptionsOpen", newVal);
22
+ });
20
23
  const presetComponent = usePresetComponent("KCombobox", KComboboxDefault);
21
24
  const templateProps = computed(() => ({
22
25
  disabled: props.disabled,
@@ -57,8 +57,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
57
57
  type: StringConstructor;
58
58
  default: string;
59
59
  };
60
+ isOptionsOpen: {
61
+ type: BooleanConstructor;
62
+ default: undefined;
63
+ };
60
64
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
61
65
  "update:modelValue": (value: any) => any;
66
+ "update:isOptionsOpen": (value: boolean) => any;
62
67
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
63
68
  dataProvider: {
64
69
  type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
@@ -117,14 +122,20 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
117
122
  type: StringConstructor;
118
123
  default: string;
119
124
  };
125
+ isOptionsOpen: {
126
+ type: BooleanConstructor;
127
+ default: undefined;
128
+ };
120
129
  }>> & Readonly<{
121
130
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
131
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
122
132
  }>, {
123
133
  disabled: boolean;
124
134
  validation: "error" | "success" | "warning" | null | undefined;
125
135
  validationText: string;
126
136
  modelValue: any;
127
137
  searchbox: boolean;
138
+ isOptionsOpen: boolean;
128
139
  placeholder: string;
129
140
  teleportTo: string;
130
141
  closeOnSelect: boolean;
@@ -15,11 +15,13 @@ export interface KComboboxProps {
15
15
  valueField?: string;
16
16
  modelValue?: any;
17
17
  teleportTo?: string;
18
+ isOptionsOpen?: boolean;
18
19
  validation?: 'success' | 'warning' | 'error' | null;
19
20
  validationText?: string;
20
21
  }
21
22
  export interface KComboboxEmits {
22
23
  (e: 'update:modelValue', value: any): void;
24
+ (e: 'update:isOptionsOpen', value: boolean): void;
23
25
  }
24
26
  export declare const KComboboxDefaultProps: {
25
27
  dataProvider: {
@@ -79,6 +81,10 @@ export declare const KComboboxDefaultProps: {
79
81
  type: StringConstructor;
80
82
  default: string;
81
83
  };
84
+ isOptionsOpen: {
85
+ type: BooleanConstructor;
86
+ default: undefined;
87
+ };
82
88
  };
83
89
  export declare function useKComboboxLogic(props: KComboboxProps, emit: KComboboxEmits): {
84
90
  selectedItems: import("vue").Ref<TDataRow[] | null, TDataRow[] | null>;
@@ -59,12 +59,21 @@ export const KComboboxDefaultProps = {
59
59
  validationText: {
60
60
  type: String,
61
61
  default: ""
62
+ },
63
+ isOptionsOpen: {
64
+ type: Boolean,
65
+ default: void 0
62
66
  }
63
67
  };
64
68
  export function useKComboboxLogic(props, emit) {
65
69
  const selectedItems = ref(null);
66
70
  const isOptionsOpen = ref(false);
67
71
  const searchtext = ref("");
72
+ watch(() => props.isOptionsOpen, (newVal) => {
73
+ if (newVal !== void 0 && newVal !== isOptionsOpen.value) {
74
+ isOptionsOpen.value = newVal;
75
+ }
76
+ });
68
77
  function selectItem(option) {
69
78
  if (props.multiSelect) {
70
79
  if (isSelected(option)) {
@@ -45,8 +45,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
45
45
  "update:modelValue": (value: string | Date) => any;
46
46
  "update:maskedModel": (value: string) => any;
47
47
  "update:calendarShow": (value: boolean) => any;
48
- "update:isOpen": (value: boolean) => any;
49
48
  "update:day": (value: string | Date) => any;
49
+ "update:isOpen": (value: boolean) => any;
50
50
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
51
51
  format: {
52
52
  type: StringConstructor;
@@ -93,8 +93,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
93
93
  "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
94
94
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
95
95
  "onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
96
- "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
97
96
  "onUpdate:day"?: ((value: string | Date) => any) | undefined;
97
+ "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
98
98
  }>, {
99
99
  isOpen: boolean;
100
100
  day: string | Date;
@@ -45,8 +45,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
45
45
  "update:modelValue": (value: string | Date) => any;
46
46
  "update:maskedModel": (value: string) => any;
47
47
  "update:calendarShow": (value: boolean) => any;
48
- "update:isOpen": (value: boolean) => any;
49
48
  "update:day": (value: string | Date) => any;
49
+ "update:isOpen": (value: boolean) => any;
50
50
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
51
51
  format: {
52
52
  type: StringConstructor;
@@ -93,8 +93,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
93
93
  "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
94
94
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
95
95
  "onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
96
- "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
97
96
  "onUpdate:day"?: ((value: string | Date) => any) | undefined;
97
+ "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
98
98
  }>, {
99
99
  isOpen: boolean;
100
100
  day: string | Date;
@@ -118,10 +118,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
118
118
  teleportTo: string;
119
119
  showClear: boolean;
120
120
  format: string;
121
- timeFormat: string;
122
- timeStep: number;
123
121
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
124
122
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
123
+ timeFormat: string;
124
+ timeStep: number;
125
125
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
126
126
  declare const _default: typeof __VLS_export;
127
127
  export default _default;
@@ -118,10 +118,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
118
118
  teleportTo: string;
119
119
  showClear: boolean;
120
120
  format: string;
121
- timeFormat: string;
122
- timeStep: number;
123
121
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
124
122
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
123
+ timeFormat: string;
124
+ timeStep: number;
125
125
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
126
126
  declare const _default: typeof __VLS_export;
127
127
  export default _default;
@@ -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
+ }
@@ -54,6 +54,9 @@ function onChange(val) {
54
54
  function updateSearchText(val) {
55
55
  searchtext.value = val;
56
56
  }
57
+ function updateIsOptionsOpen(val) {
58
+ isOptionsOpen.value = val;
59
+ }
57
60
  </script>
58
61
 
59
62
  <template lang="pug">
@@ -63,6 +66,7 @@ component(
63
66
  @update:modelValue="onUpdateModelValue"
64
67
  @change="onChange"
65
68
  @update:searchtext="updateSearchText"
69
+ @update:isOptionsOpen="updateIsOptionsOpen"
66
70
  )
67
71
  template(v-for="(_, slot) in $slots" #[slot]="scope")
68
72
  slot(:name="slot" v-bind="scope")
@@ -64,11 +64,13 @@ export const KTreePickerDefaultProps = {
64
64
  };
65
65
  import { useKComboboxLogic } from "../KCombobox/KCombobox.logic.js";
66
66
  export function useKTreePickerLogic(props, emit) {
67
- const logicProps = {
68
- ...props,
69
- valueField: props.valueField || props.idKey
70
- };
71
- const comboboxLogic = useKComboboxLogic(logicProps, emit);
67
+ const effectiveProps = new Proxy(props, {
68
+ get(target, key) {
69
+ if (key === "valueField") return target.valueField || target.idKey;
70
+ return target[key];
71
+ }
72
+ });
73
+ const comboboxLogic = useKComboboxLogic(effectiveProps, emit);
72
74
  return {
73
75
  ...comboboxLogic
74
76
  };
@@ -18,11 +18,11 @@ type __VLS_Props = {
18
18
  validationText?: string;
19
19
  };
20
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
21
- "update:searchtext": (value: string) => any;
22
21
  "update:isOptionsOpen": (value: boolean) => any;
22
+ "update:searchtext": (value: string) => any;
23
23
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
24
- "onUpdate:searchtext"?: ((value: string) => any) | undefined;
25
24
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
25
+ "onUpdate:searchtext"?: ((value: string) => any) | undefined;
26
26
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -18,11 +18,11 @@ type __VLS_Props = {
18
18
  validationText?: string;
19
19
  };
20
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
21
- "update:searchtext": (value: string) => any;
22
21
  "update:isOptionsOpen": (value: boolean) => any;
22
+ "update:searchtext": (value: string) => any;
23
23
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
24
- "onUpdate:searchtext"?: ((value: string) => any) | undefined;
25
24
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
25
+ "onUpdate:searchtext"?: ((value: string) => any) | undefined;
26
26
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -2,7 +2,7 @@
2
2
  .KDropdown-source
3
3
  Teleport(v-if="isMounted && open && teleportTarget" :to="teleportTarget")
4
4
  .KDropdown-teleported
5
- .KDropdown(v-click-outside="clickoutside" :style="dialogStyle" v-bind="$attrs")
5
+ .KDropdown(v-click-outside="{ handler: clickoutside, extraInside: anchorEl }" :style="dialogStyle" v-bind="$attrs")
6
6
  KPanel.KDropdown-container(:class="{'fullWidth': fullWidth}")
7
7
  slot
8
8
  </template>
@@ -0,0 +1,17 @@
1
+ import type { KToastType } from '../../../../components/KToast/KToast.logic.js';
2
+ type __VLS_Props = {
3
+ modelValue: boolean;
4
+ text?: string;
5
+ timeout?: number;
6
+ teleport?: boolean;
7
+ type?: KToastType;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ close: (...args: any[]) => void;
11
+ "update:modelValue": (...args: any[]) => void;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onClose?: ((...args: any[]) => any) | undefined;
14
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,118 @@
1
+ <template lang="pug">
2
+ Teleport(to="body" :disabled="!teleport")
3
+ Transition(name="toast-fade")
4
+ .KToast(
5
+ v-if="modelValue"
6
+ :class="[`type-${type}`, { 'is-fixed': teleport }]"
7
+ )
8
+ .KToast--content
9
+ slot {{ text }}
10
+ .KToast--actions
11
+ button.close-btn(@click="$emit('close')")
12
+ KIcon(iconname="close" :width="16" :height="16")
13
+ </template>
14
+
15
+ <script lang="ts" setup>
16
+ import type { KToastType } from '../../../../components/KToast/KToast.logic'
17
+
18
+ defineProps<{
19
+ modelValue: boolean
20
+ text?: string
21
+ timeout?: number
22
+ teleport?: boolean
23
+ type?: KToastType
24
+ }>()
25
+
26
+ defineEmits(['update:modelValue', 'close'])
27
+ </script>
28
+
29
+ <style lang="scss" scoped>
30
+ .KToast {
31
+ --current-toast-bg: var(--panel-bg-default);
32
+ --current-toast-border: var(--neutral-200);
33
+ --current-toast-text: var(--font-color-default);
34
+
35
+ display: flex;
36
+ align-items: center;
37
+ padding: var(--gap-sm) var(--gap-md);
38
+ border-radius: var(--border-radius-md);
39
+ border: 1px solid var(--current-toast-border);
40
+ background-color: color-mix(in srgb, var(--current-toast-bg), transparent calc((1 - var(--panel-bg-opacity, 0.9)) * 100%));
41
+ backdrop-filter: blur(var(--panel-blur, 8px));
42
+ box-shadow: var(--shadow-lg);
43
+ min-width: 250px;
44
+ max-width: 450px;
45
+ pointer-events: auto;
46
+ z-index: 9999;
47
+
48
+ &.is-fixed {
49
+ position: fixed;
50
+ top: 20px;
51
+ right: 20px;
52
+ }
53
+
54
+ &.type-primary {
55
+ --current-toast-bg: var(--panel-bg-primary);
56
+ --current-toast-border: var(--color-primary-300);
57
+ }
58
+ &.type-success {
59
+ --current-toast-bg: var(--panel-bg-success);
60
+ --current-toast-border: var(--color-success-300);
61
+ }
62
+ &.type-warning {
63
+ --current-toast-bg: var(--panel-bg-warning);
64
+ --current-toast-border: var(--color-warning-300);
65
+ }
66
+ &.type-danger, &.type-error {
67
+ --current-toast-bg: var(--panel-bg-danger);
68
+ --current-toast-border: var(--color-danger-300);
69
+ }
70
+ &.type-info {
71
+ --current-toast-bg: var(--panel-bg-info);
72
+ --current-toast-border: var(--color-info-300);
73
+ }
74
+
75
+ &--content {
76
+ flex: 1;
77
+ font-size: var(--font-size-md);
78
+ color: var(--current-toast-text);
79
+ margin-right: var(--gap-md);
80
+ line-height: 1.4;
81
+ }
82
+
83
+ &--actions {
84
+ display: flex;
85
+ align-items: center;
86
+
87
+ .close-btn {
88
+ background: transparent;
89
+ border: none;
90
+ padding: 4px;
91
+ cursor: pointer;
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+ border-radius: var(--border-radius-sm);
96
+ color: var(--current-toast-text);
97
+ opacity: 0.6;
98
+ transition: opacity var(--transition-fast), background-color var(--transition-fast);
99
+
100
+ &:hover {
101
+ opacity: 1;
102
+ background-color: rgba(0, 0, 0, 0.05);
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ .toast-fade-enter-active,
109
+ .toast-fade-leave-active {
110
+ transition: all 0.3s ease;
111
+ }
112
+
113
+ .toast-fade-enter-from,
114
+ .toast-fade-leave-to {
115
+ opacity: 0;
116
+ transform: translateY(-20px) scale(0.95);
117
+ }
118
+ </style>
@@ -0,0 +1,17 @@
1
+ import type { KToastType } from '../../../../components/KToast/KToast.logic.js';
2
+ type __VLS_Props = {
3
+ modelValue: boolean;
4
+ text?: string;
5
+ timeout?: number;
6
+ teleport?: boolean;
7
+ type?: KToastType;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ close: (...args: any[]) => void;
11
+ "update:modelValue": (...args: any[]) => void;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onClose?: ((...args: any[]) => any) | undefined;
14
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -22,8 +22,10 @@ type __VLS_Props = {
22
22
  validationText?: string;
23
23
  };
24
24
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
+ "update:isOptionsOpen": (value: boolean) => any;
25
26
  "update:searchtext": (value: string) => any;
26
27
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
28
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
27
29
  "onUpdate:searchtext"?: ((value: string) => any) | undefined;
28
30
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
31
  declare const _default: typeof __VLS_export;
@@ -2,7 +2,7 @@
2
2
  KCombobox(
3
3
  :dataProvider="dataProvider"
4
4
  :disabled="disabled"
5
- :isOptionsOpen="isOptionsOpen"
5
+ v-model:isOptionsOpen="isOptionsOpenModel"
6
6
  :labelField="labelField"
7
7
  :placeholder="placeholder"
8
8
  :searchbox="searchbox"
@@ -72,6 +72,7 @@ const props = defineProps<{
72
72
 
73
73
  const emit = defineEmits<{
74
74
  (e: 'update:searchtext', value: string): void
75
+ (e: 'update:isOptionsOpen', value: boolean): void
75
76
  }>()
76
77
 
77
78
  const searchtextModel = computed({
@@ -79,6 +80,11 @@ const searchtextModel = computed({
79
80
  set: (value) => emit('update:searchtext', value)
80
81
  })
81
82
 
83
+ const isOptionsOpenModel = computed({
84
+ get: () => props.isOptionsOpen,
85
+ set: (value) => emit('update:isOptionsOpen', value)
86
+ })
87
+
82
88
  function onTreeSelect(node: any) {
83
89
  // Call the selectItem method from logic
84
90
  props.selectItem(node)
@@ -22,8 +22,10 @@ type __VLS_Props = {
22
22
  validationText?: string;
23
23
  };
24
24
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
+ "update:isOptionsOpen": (value: boolean) => any;
25
26
  "update:searchtext": (value: string) => any;
26
27
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
28
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
27
29
  "onUpdate:searchtext"?: ((value: string) => any) | undefined;
28
30
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
31
  declare const _default: typeof __VLS_export;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
- "version": "0.1.0-beta.51",
3
+ "version": "0.1.0-beta.53",
4
4
  "description": "Core UI toolkit and utilities for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "MIT",