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

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 (35) 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/KDatatable/KDataIterator.global.d.vue.ts +1 -1
  6. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
  7. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +20 -0
  8. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +12 -0
  9. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +9 -0
  10. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +2 -1
  11. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +9 -0
  12. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +5 -0
  13. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +4 -0
  14. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +9 -0
  15. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +9 -0
  16. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +8 -0
  17. package/dist/runtime/components/KDropdown/KDropdown.logic.js +8 -1
  18. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
  19. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
  20. package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +1 -1
  21. package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +1 -1
  22. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +13 -2
  23. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +5 -2
  24. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +13 -2
  25. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +5 -0
  26. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +11 -5
  27. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
  28. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
  29. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +1 -0
  30. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +2 -1
  31. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +1 -0
  32. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +2 -0
  33. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +19 -9
  34. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +2 -0
  35. 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.52",
4
+ "version": "0.1.0-beta.54",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -46,7 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
46
46
  }>> & Readonly<{
47
47
  onClick?: (() => any) | undefined;
48
48
  }>, {
49
- size: "large" | "medium" | "small" | undefined;
49
+ size: "small" | "large" | "medium" | undefined;
50
50
  type: "info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | undefined;
51
51
  disabled: boolean;
52
52
  href: string;
@@ -46,7 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
46
46
  }>> & Readonly<{
47
47
  onClick?: (() => any) | undefined;
48
48
  }>, {
49
- size: "large" | "medium" | "small" | undefined;
49
+ size: "small" | "large" | "medium" | undefined;
50
50
  type: "info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | undefined;
51
51
  disabled: boolean;
52
52
  href: string;
@@ -22,7 +22,7 @@ export interface KButtonEmits {
22
22
  export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits): {
23
23
  isLink: import("vue").ComputedRef<boolean>;
24
24
  isDisabled: import("vue").ComputedRef<boolean | undefined>;
25
- buttonClasses: import("vue").ComputedRef<("info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "large" | "medium" | "small" | {
25
+ buttonClasses: import("vue").ComputedRef<("info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "small" | "large" | "medium" | {
26
26
  disabled: boolean | undefined;
27
27
  })[]>;
28
28
  onClick: () => void;
@@ -11,9 +11,9 @@ interface Props {
11
11
  page?: number;
12
12
  }
13
13
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
+ bulkActions: IKDatatableAction[];
14
15
  search: string;
15
16
  loading: boolean;
16
- bulkActions: IKDatatableAction[];
17
17
  visibleFields: Array<string> | null;
18
18
  rowActions: IKDatatableAction[];
19
19
  itemsPerPage: number;
@@ -11,9 +11,9 @@ interface Props {
11
11
  page?: number;
12
12
  }
13
13
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
+ bulkActions: IKDatatableAction[];
14
15
  search: string;
15
16
  loading: boolean;
16
- bulkActions: IKDatatableAction[];
17
17
  visibleFields: Array<string> | null;
18
18
  rowActions: IKDatatableAction[];
19
19
  itemsPerPage: number;
@@ -0,0 +1,20 @@
1
+ import { ADataProvider } from '@katlux/providers';
2
+ export interface KDataIteratorProps {
3
+ dataProvider: ADataProvider;
4
+ visibleFields?: Array<string> | null;
5
+ loading?: boolean;
6
+ search?: string;
7
+ itemsPerPage?: number;
8
+ page?: number;
9
+ }
10
+ export declare const KDataIteratorDefaultProps: {
11
+ visibleFields: null;
12
+ loading: boolean;
13
+ search: string;
14
+ itemsPerPage: number;
15
+ page: number;
16
+ };
17
+ export declare function useKDataIteratorLogic(props: KDataIteratorProps): {
18
+ selectedRows: import("vue").Ref<any[], any[]>;
19
+ selectAll: import("vue").Ref<boolean, boolean>;
20
+ };
@@ -0,0 +1,12 @@
1
+ import { ADataProvider } from '@katlux/providers';
2
+ export interface KDatatableProps {
3
+ dataProvider: ADataProvider;
4
+ visibleFields?: Array<string> | null;
5
+ }
6
+ export declare const KDatatableDefaultProps: {
7
+ visibleFields: null;
8
+ };
9
+ export declare function useKDatatableLogic(props: KDatatableProps): {
10
+ selectedRows: import("vue").Ref<any[], any[]>;
11
+ selectAll: import("vue").Ref<boolean, boolean>;
12
+ };
@@ -41,6 +41,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
41
41
  type: StringConstructor;
42
42
  default: string;
43
43
  };
44
+ align: {
45
+ type: import("vue").PropType<KDatePickerProps["align"]>;
46
+ default: string;
47
+ };
44
48
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
45
49
  "update:modelValue": (value: string | Date) => any;
46
50
  "update:maskedModel": (value: string) => any;
@@ -89,6 +93,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
89
93
  type: StringConstructor;
90
94
  default: string;
91
95
  };
96
+ align: {
97
+ type: import("vue").PropType<KDatePickerProps["align"]>;
98
+ default: string;
99
+ };
92
100
  }>> & Readonly<{
93
101
  "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
94
102
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
@@ -103,6 +111,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
103
111
  modelValue: string | Date;
104
112
  teleportTo: string;
105
113
  showClear: boolean;
114
+ align: "left" | "right" | undefined;
106
115
  format: string;
107
116
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
108
117
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
@@ -28,7 +28,8 @@ const templateProps = computed(() => ({
28
28
  dateSelected: handleDateSelected,
29
29
  teleportTo: props.teleportTo,
30
30
  validation: props.validation,
31
- validationText: props.validationText
31
+ validationText: props.validationText,
32
+ align: props.align
32
33
  }));
33
34
  const handleClear = () => {
34
35
  _date.value = "";
@@ -41,6 +41,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
41
41
  type: StringConstructor;
42
42
  default: string;
43
43
  };
44
+ align: {
45
+ type: import("vue").PropType<KDatePickerProps["align"]>;
46
+ default: string;
47
+ };
44
48
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
45
49
  "update:modelValue": (value: string | Date) => any;
46
50
  "update:maskedModel": (value: string) => any;
@@ -89,6 +93,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
89
93
  type: StringConstructor;
90
94
  default: string;
91
95
  };
96
+ align: {
97
+ type: import("vue").PropType<KDatePickerProps["align"]>;
98
+ default: string;
99
+ };
92
100
  }>> & Readonly<{
93
101
  "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
94
102
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
@@ -103,6 +111,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
103
111
  modelValue: string | Date;
104
112
  teleportTo: string;
105
113
  showClear: boolean;
114
+ align: "left" | "right" | undefined;
106
115
  format: string;
107
116
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
108
117
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
@@ -11,6 +11,7 @@ export interface KDatePickerProps {
11
11
  teleportTo?: string;
12
12
  validation?: 'success' | 'warning' | 'error' | null;
13
13
  validationText?: string;
14
+ align?: 'left' | 'right';
14
15
  }
15
16
  export declare const KDatePickerDefaultProps: {
16
17
  format: {
@@ -54,6 +55,10 @@ export declare const KDatePickerDefaultProps: {
54
55
  type: StringConstructor;
55
56
  default: string;
56
57
  };
58
+ align: {
59
+ type: PropType<KDatePickerProps["align"]>;
60
+ default: string;
61
+ };
57
62
  };
58
63
  export declare function useKDatePickerLogic(props: KDatePickerProps): {
59
64
  _date: import("vue").Ref<string | Date, string | Date>;
@@ -40,6 +40,10 @@ export const KDatePickerDefaultProps = {
40
40
  validationText: {
41
41
  type: String,
42
42
  default: ""
43
+ },
44
+ align: {
45
+ type: String,
46
+ default: "left"
43
47
  }
44
48
  };
45
49
  export function useKDatePickerLogic(props) {
@@ -15,6 +15,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
15
15
  type: import("vue").PropType<string>;
16
16
  default: undefined;
17
17
  };
18
+ align: {
19
+ type: import("vue").PropType<"left" | "right">;
20
+ default: string;
21
+ };
18
22
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
23
  "update:isOpen": (value: boolean) => any;
20
24
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -34,11 +38,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
34
38
  type: import("vue").PropType<string>;
35
39
  default: undefined;
36
40
  };
41
+ align: {
42
+ type: import("vue").PropType<"left" | "right">;
43
+ default: string;
44
+ };
37
45
  }>> & Readonly<{
38
46
  "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
39
47
  }>, {
40
48
  isOpen: boolean;
41
49
  teleportTo: string;
50
+ align: "left" | "right";
42
51
  fullWidth: boolean;
43
52
  anchorEl: HTMLElement;
44
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -15,6 +15,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
15
15
  type: import("vue").PropType<string>;
16
16
  default: undefined;
17
17
  };
18
+ align: {
19
+ type: import("vue").PropType<"left" | "right">;
20
+ default: string;
21
+ };
18
22
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
23
  "update:isOpen": (value: boolean) => any;
20
24
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -34,11 +38,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
34
38
  type: import("vue").PropType<string>;
35
39
  default: undefined;
36
40
  };
41
+ align: {
42
+ type: import("vue").PropType<"left" | "right">;
43
+ default: string;
44
+ };
37
45
  }>> & Readonly<{
38
46
  "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
39
47
  }>, {
40
48
  isOpen: boolean;
41
49
  teleportTo: string;
50
+ align: "left" | "right";
42
51
  fullWidth: boolean;
43
52
  anchorEl: HTMLElement;
44
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -4,6 +4,7 @@ export interface KDropdownProps {
4
4
  fullWidth: boolean;
5
5
  anchorEl?: HTMLElement;
6
6
  teleportTo?: string;
7
+ align?: 'left' | 'right';
7
8
  }
8
9
  export interface KDropdownEmits {
9
10
  (e: 'update:isOpen', value: boolean): void;
@@ -25,20 +26,27 @@ export declare const KDropdownDefaultProps: {
25
26
  type: PropType<string>;
26
27
  default: undefined;
27
28
  };
29
+ align: {
30
+ type: PropType<"left" | "right">;
31
+ default: string;
32
+ };
28
33
  };
29
34
  export declare function useKDropdownLogic(props: KDropdownProps, emit: KDropdownEmits): {
30
35
  open: Ref<boolean, boolean>;
31
36
  dropdownRect: Ref<{
32
37
  top: number;
33
38
  left: number;
39
+ right: number;
34
40
  width: number;
35
41
  }, {
36
42
  top: number;
37
43
  left: number;
44
+ right: number;
38
45
  width: number;
39
46
  } | {
40
47
  top: number;
41
48
  left: number;
49
+ right: number;
42
50
  width: number;
43
51
  }>;
44
52
  clickoutside: () => void;
@@ -16,6 +16,10 @@ export const KDropdownDefaultProps = {
16
16
  teleportTo: {
17
17
  type: String,
18
18
  default: void 0
19
+ },
20
+ align: {
21
+ type: String,
22
+ default: "left"
19
23
  }
20
24
  };
21
25
  export function useKDropdownLogic(props, emit) {
@@ -34,7 +38,7 @@ export function useKDropdownLogic(props, emit) {
34
38
  return "body";
35
39
  });
36
40
  const open = ref(false);
37
- const dropdownRect = ref({ top: 0, left: 0, width: 0 });
41
+ const dropdownRect = ref({ top: 0, left: 0, right: 0, width: 0 });
38
42
  const clickoutside = () => {
39
43
  open.value = false;
40
44
  emit("update:isOpen", open.value);
@@ -49,14 +53,17 @@ export function useKDropdownLogic(props, emit) {
49
53
  dropdownRect.value = {
50
54
  top: rect.bottom + window.scrollY,
51
55
  left: rect.left + window.scrollX,
56
+ right: document.documentElement.clientWidth - rect.right + window.scrollX,
52
57
  width: rect.width
53
58
  };
54
59
  } else {
55
60
  const portalEl = document.querySelector(teleportTarget.value);
56
61
  const portalRect = portalEl ? portalEl.getBoundingClientRect() : { top: 0, left: 0 };
62
+ const portalWidth = portalEl ? portalEl.clientWidth : document.documentElement.clientWidth;
57
63
  dropdownRect.value = {
58
64
  top: rect.bottom - portalRect.top,
59
65
  left: rect.left - portalRect.left,
66
+ right: portalWidth - (rect.right - portalRect.left),
60
67
  width: rect.width
61
68
  };
62
69
  }
@@ -1,9 +1,9 @@
1
1
  import { type KGridProps } from './KGrid.logic.js';
2
2
  declare const __VLS_export: import("vue").DefineComponent<KGridProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KGridProps> & Readonly<{}>, {
3
+ align: "start" | "center" | "end" | "stretch" | "baseline";
3
4
  wrap: "wrap" | "nowrap";
4
5
  direction: "row" | "column";
5
6
  flexChild: boolean;
6
- align: "start" | "center" | "end" | "stretch" | "baseline";
7
7
  justify: "start" | "center" | "end" | "space-between" | "around" | "evenly";
8
8
  noGap: boolean;
9
9
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,9 +1,9 @@
1
1
  import { type KGridProps } from './KGrid.logic.js';
2
2
  declare const __VLS_export: import("vue").DefineComponent<KGridProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KGridProps> & Readonly<{}>, {
3
+ align: "start" | "center" | "end" | "stretch" | "baseline";
3
4
  wrap: "wrap" | "nowrap";
4
5
  direction: "row" | "column";
5
6
  flexChild: boolean;
6
- align: "start" | "center" | "end" | "stretch" | "baseline";
7
7
  justify: "start" | "center" | "end" | "space-between" | "around" | "evenly";
8
8
  noGap: boolean;
9
9
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -25,7 +25,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
25
25
  default: string;
26
26
  };
27
27
  }>> & Readonly<{}>, {
28
- size: "large" | "medium" | "small";
28
+ size: "small" | "large" | "medium";
29
29
  overlay: boolean;
30
30
  loading: boolean;
31
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -25,7 +25,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
25
25
  default: string;
26
26
  };
27
27
  }>> & Readonly<{}>, {
28
- size: "large" | "medium" | "small";
28
+ size: "small" | "large" | "medium";
29
29
  overlay: boolean;
30
30
  loading: boolean;
31
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -61,9 +61,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
61
61
  type: StringConstructor;
62
62
  default: string;
63
63
  };
64
+ isOptionsOpen: {
65
+ type: BooleanConstructor;
66
+ default: undefined;
67
+ };
64
68
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
65
69
  change: (value: any) => any;
66
70
  "update:modelValue": (value: any) => any;
71
+ "update:isOptionsOpen": (value: boolean) => any;
67
72
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
68
73
  modelValue: {
69
74
  type: import("vue").PropType<any>;
@@ -126,23 +131,29 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
126
131
  type: StringConstructor;
127
132
  default: string;
128
133
  };
134
+ isOptionsOpen: {
135
+ type: BooleanConstructor;
136
+ default: undefined;
137
+ };
129
138
  }>> & Readonly<{
130
139
  onChange?: ((value: any) => any) | undefined;
131
140
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
141
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
132
142
  }>, {
143
+ parentKey: string;
144
+ idKey: string;
133
145
  disabled: boolean;
134
146
  loading: boolean;
135
147
  validation: "error" | "success" | "warning" | null | undefined;
136
148
  validationText: string;
137
149
  modelValue: any;
138
150
  searchbox: boolean;
151
+ isOptionsOpen: boolean;
139
152
  placeholder: string;
140
153
  closeOnSelect: boolean;
141
154
  multiSelect: boolean;
142
155
  valueField: string;
143
156
  iconField: string;
144
- idKey: string;
145
- parentKey: string;
146
157
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
147
158
  declare const _default: typeof __VLS_export;
148
159
  export default _default;
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { KTreePickerDefaultProps, useKTreePickerLogic } from "./KTreePicker.logic";
3
3
  import { usePresetComponent } from "../../composables/usePresetComponent";
4
- import { computed } from "vue";
4
+ import { computed, watch } from "vue";
5
5
  import KTreePickerDefault from "../../presets/default/components/KTreePicker/KTreePicker.vue";
6
6
  const props = defineProps(KTreePickerDefaultProps);
7
- const emit = defineEmits(["update:modelValue", "change"]);
7
+ const emit = defineEmits(["update:modelValue", "change", "update:isOptionsOpen"]);
8
8
  const {
9
9
  selectedItems,
10
10
  isOptionsOpen,
@@ -17,6 +17,9 @@ const {
17
17
  filteredOptions,
18
18
  loading
19
19
  } = useKTreePickerLogic(props, emit);
20
+ watch(isOptionsOpen, (newVal) => {
21
+ emit("update:isOptionsOpen", newVal);
22
+ });
20
23
  const presetComponent = usePresetComponent("KTreePicker", KTreePickerDefault);
21
24
  const templateProps = computed(() => ({
22
25
  // KTreePicker specific
@@ -61,9 +61,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
61
61
  type: StringConstructor;
62
62
  default: string;
63
63
  };
64
+ isOptionsOpen: {
65
+ type: BooleanConstructor;
66
+ default: undefined;
67
+ };
64
68
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
65
69
  change: (value: any) => any;
66
70
  "update:modelValue": (value: any) => any;
71
+ "update:isOptionsOpen": (value: boolean) => any;
67
72
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
68
73
  modelValue: {
69
74
  type: import("vue").PropType<any>;
@@ -126,23 +131,29 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
126
131
  type: StringConstructor;
127
132
  default: string;
128
133
  };
134
+ isOptionsOpen: {
135
+ type: BooleanConstructor;
136
+ default: undefined;
137
+ };
129
138
  }>> & Readonly<{
130
139
  onChange?: ((value: any) => any) | undefined;
131
140
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
141
+ "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
132
142
  }>, {
143
+ parentKey: string;
144
+ idKey: string;
133
145
  disabled: boolean;
134
146
  loading: boolean;
135
147
  validation: "error" | "success" | "warning" | null | undefined;
136
148
  validationText: string;
137
149
  modelValue: any;
138
150
  searchbox: boolean;
151
+ isOptionsOpen: boolean;
139
152
  placeholder: string;
140
153
  closeOnSelect: boolean;
141
154
  multiSelect: boolean;
142
155
  valueField: string;
143
156
  iconField: string;
144
- idKey: string;
145
- parentKey: string;
146
157
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
147
158
  declare const _default: typeof __VLS_export;
148
159
  export default _default;
@@ -16,6 +16,7 @@ export interface KTreePickerProps {
16
16
  searchbox?: boolean;
17
17
  validation?: 'success' | 'warning' | 'error' | null;
18
18
  validationText?: string;
19
+ isOptionsOpen?: boolean;
19
20
  }
20
21
  export declare const KTreePickerDefaultProps: {
21
22
  modelValue: {
@@ -79,6 +80,10 @@ export declare const KTreePickerDefaultProps: {
79
80
  type: StringConstructor;
80
81
  default: string;
81
82
  };
83
+ isOptionsOpen: {
84
+ type: BooleanConstructor;
85
+ default: undefined;
86
+ };
82
87
  };
83
88
  export declare function useKTreePickerLogic(props: KTreePickerProps, emit: any): {
84
89
  selectedItems: import("vue").Ref<import("@katlux/providers").TDataRow[] | null, import("@katlux/providers").TDataRow[] | null>;
@@ -60,15 +60,21 @@ export const KTreePickerDefaultProps = {
60
60
  validationText: {
61
61
  type: String,
62
62
  default: ""
63
+ },
64
+ isOptionsOpen: {
65
+ type: Boolean,
66
+ default: void 0
63
67
  }
64
68
  };
65
69
  import { useKComboboxLogic } from "../KCombobox/KCombobox.logic.js";
66
70
  export function useKTreePickerLogic(props, emit) {
67
- const logicProps = {
68
- ...props,
69
- valueField: props.valueField || props.idKey
70
- };
71
- const comboboxLogic = useKComboboxLogic(logicProps, emit);
71
+ const effectiveProps = new Proxy(props, {
72
+ get(target, key) {
73
+ if (key === "valueField") return target.valueField || target.idKey;
74
+ return target[key];
75
+ }
76
+ });
77
+ const comboboxLogic = useKComboboxLogic(effectiveProps, emit);
72
78
  return {
73
79
  ...comboboxLogic
74
80
  };
@@ -81,14 +81,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
81
81
  default: () => {};
82
82
  };
83
83
  }>> & Readonly<{}>, {
84
+ parentKey: string;
85
+ idKey: string;
86
+ expandedByDefault: boolean;
84
87
  bulkActions: import("@katlux/providers").IKDatatableAction[];
85
88
  rowActions: import("./KTreeView.logic.js").IRowAction[];
86
89
  cellSlots: Record<string, any>;
87
90
  headerSlots: Record<string, any>;
88
91
  treeColumnIndex: number;
89
- idKey: string;
90
- parentKey: string;
91
- expandedByDefault: boolean;
92
92
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
93
93
  declare const _default: typeof __VLS_export;
94
94
  export default _default;
@@ -81,14 +81,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
81
81
  default: () => {};
82
82
  };
83
83
  }>> & Readonly<{}>, {
84
+ parentKey: string;
85
+ idKey: string;
86
+ expandedByDefault: boolean;
84
87
  bulkActions: import("@katlux/providers").IKDatatableAction[];
85
88
  rowActions: import("./KTreeView.logic.js").IRowAction[];
86
89
  cellSlots: Record<string, any>;
87
90
  headerSlots: Record<string, any>;
88
91
  treeColumnIndex: number;
89
- idKey: string;
90
- parentKey: string;
91
- expandedByDefault: boolean;
92
92
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
93
93
  declare const _default: typeof __VLS_export;
94
94
  export default _default;
@@ -14,6 +14,7 @@ type __VLS_Props = {
14
14
  teleportTo?: string;
15
15
  validation?: 'success' | 'warning' | 'error' | null;
16
16
  validationText?: string;
17
+ align?: 'left' | 'right';
17
18
  };
18
19
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
20
  "update:maskedModel": (value: string) => any;
@@ -11,7 +11,7 @@
11
11
  :validation="validation"
12
12
  :validationText="validationText"
13
13
  )
14
- KDropdown(v-model:isOpen="calendarShow" :anchorEl="activatorRef" :teleportTo="teleportTo")
14
+ KDropdown(v-model:isOpen="calendarShow" :anchorEl="activatorRef" :teleportTo="teleportTo" :align="align")
15
15
  KCalendar(view="month" :viewCount="1" :day="calendarDay" :selectedDay="_date" @dayClicked="dateSelected" :definedDays="calendarDefinedDays" :markedDays="calendarMarkedDays")
16
16
  </template>
17
17
 
@@ -38,6 +38,7 @@ const props = defineProps<{
38
38
  teleportTo?: string
39
39
  validation?: 'success' | 'warning' | 'error' | null
40
40
  validationText?: string
41
+ align?: 'left' | 'right'
41
42
  }>()
42
43
 
43
44
  const emit = defineEmits<{
@@ -14,6 +14,7 @@ type __VLS_Props = {
14
14
  teleportTo?: string;
15
15
  validation?: 'success' | 'warning' | 'error' | null;
16
16
  validationText?: string;
17
+ align?: 'left' | 'right';
17
18
  };
18
19
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
20
  "update:maskedModel": (value: string) => any;
@@ -5,11 +5,13 @@ type __VLS_Props = {
5
5
  dropdownRect: {
6
6
  top: number;
7
7
  left: number;
8
+ right: number;
8
9
  width: number;
9
10
  };
10
11
  clickoutside: () => void;
11
12
  teleportTarget: string | null;
12
13
  isInModal: boolean;
14
+ align?: 'left' | 'right';
13
15
  };
14
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
17
  declare const _default: typeof __VLS_export;
@@ -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>
@@ -18,10 +18,11 @@ const props = defineProps<{
18
18
  open: boolean
19
19
  fullWidth: boolean
20
20
  anchorEl?: HTMLElement
21
- dropdownRect: { top: number, left: number, width: number }
21
+ dropdownRect: { top: number, left: number, right: number, width: number }
22
22
  clickoutside: () => void
23
23
  teleportTarget: string | null
24
24
  isInModal: boolean
25
+ align?: 'left' | 'right'
25
26
  }>()
26
27
 
27
28
  const isMounted = ref(false)
@@ -29,13 +30,22 @@ onMounted(() => {
29
30
  isMounted.value = true
30
31
  })
31
32
 
32
- const dialogStyle = computed(() => ({
33
- position: 'absolute',
34
- top: `${props.dropdownRect.top}px`,
35
- left: `${props.dropdownRect.left}px`,
36
- width: props.fullWidth ? `${props.dropdownRect.width}px` : 'fit-content',
37
- zIndex: 2000
38
- }))
33
+ const dialogStyle = computed(() => {
34
+ const style: any = {
35
+ position: 'absolute',
36
+ top: `${props.dropdownRect.top}px`,
37
+ width: props.fullWidth ? `${props.dropdownRect.width}px` : 'fit-content',
38
+ zIndex: 2000
39
+ }
40
+
41
+ if (props.align === 'right') {
42
+ style.right = `${props.dropdownRect.right}px`
43
+ } else {
44
+ style.left = `${props.dropdownRect.left}px`
45
+ }
46
+
47
+ return style
48
+ })
39
49
  </script>
40
50
 
41
51
  <style lang="scss" scoped>
@@ -5,11 +5,13 @@ type __VLS_Props = {
5
5
  dropdownRect: {
6
6
  top: number;
7
7
  left: number;
8
+ right: number;
8
9
  width: number;
9
10
  };
10
11
  clickoutside: () => void;
11
12
  teleportTarget: string | null;
12
13
  isInModal: boolean;
14
+ align?: 'left' | 'right';
13
15
  };
14
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
17
  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.52",
3
+ "version": "0.1.0-beta.54",
4
4
  "description": "Core UI toolkit and utilities for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "MIT",