@katlux/toolkit 0.1.0-beta.56 → 0.1.0-beta.58

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 (23) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +9 -0
  3. package/dist/runtime/components/KCombobox/KCombobox.global.vue +4 -1
  4. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +9 -0
  5. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +5 -0
  6. package/dist/runtime/components/KCombobox/KCombobox.logic.js +4 -0
  7. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +1 -1
  8. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +1 -1
  9. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +9 -0
  10. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +2 -1
  11. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +9 -0
  12. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +5 -0
  13. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +4 -0
  14. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +1 -0
  15. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +16 -12
  16. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +1 -0
  17. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +2 -1
  18. package/dist/runtime/presets/default/components/KModal/KModal.vue +1 -1
  19. package/dist/runtime/presets/default/components/KTree/KTree.vue +1 -0
  20. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +1 -0
  21. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +21 -20
  22. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +1 -0
  23. 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.56",
4
+ "version": "0.1.0-beta.58",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -61,6 +61,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
61
61
  type: BooleanConstructor;
62
62
  default: undefined;
63
63
  };
64
+ fullWidth: {
65
+ type: BooleanConstructor;
66
+ default: boolean;
67
+ };
64
68
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
65
69
  "update:modelValue": (value: any) => any;
66
70
  "update:isOptionsOpen": (value: boolean) => any;
@@ -126,6 +130,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
126
130
  type: BooleanConstructor;
127
131
  default: undefined;
128
132
  };
133
+ fullWidth: {
134
+ type: BooleanConstructor;
135
+ default: boolean;
136
+ };
129
137
  }>> & Readonly<{
130
138
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
131
139
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
@@ -138,6 +146,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
138
146
  isOptionsOpen: boolean;
139
147
  placeholder: string;
140
148
  teleportTo: string;
149
+ fullWidth: boolean;
141
150
  closeOnSelect: boolean;
142
151
  multiSelect: boolean;
143
152
  maxSelectedDisplay: string | number | boolean;
@@ -38,7 +38,8 @@ const templateProps = computed(() => ({
38
38
  teleportTo: props.teleportTo,
39
39
  valueField: props.valueField,
40
40
  validation: props.validation,
41
- validationText: props.validationText
41
+ validationText: props.validationText,
42
+ fullWidth: props.fullWidth
42
43
  }));
43
44
  function updateSearchText(val) {
44
45
  searchtext.value = val;
@@ -50,4 +51,6 @@ function updateIsOptionsOpen(val) {
50
51
 
51
52
  <template lang="pug">
52
53
  component(:is="presetComponent" v-bind="{...templateProps, ...$attrs}" @update:searchtext="updateSearchText" @update:isOptionsOpen="updateIsOptionsOpen")
54
+ template(v-for="(_, slot) in $slots" #[slot]="scope")
55
+ slot(:name="slot" v-bind="scope")
53
56
  </template>
@@ -61,6 +61,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
61
61
  type: BooleanConstructor;
62
62
  default: undefined;
63
63
  };
64
+ fullWidth: {
65
+ type: BooleanConstructor;
66
+ default: boolean;
67
+ };
64
68
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
65
69
  "update:modelValue": (value: any) => any;
66
70
  "update:isOptionsOpen": (value: boolean) => any;
@@ -126,6 +130,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
126
130
  type: BooleanConstructor;
127
131
  default: undefined;
128
132
  };
133
+ fullWidth: {
134
+ type: BooleanConstructor;
135
+ default: boolean;
136
+ };
129
137
  }>> & Readonly<{
130
138
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
131
139
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
@@ -138,6 +146,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
138
146
  isOptionsOpen: boolean;
139
147
  placeholder: string;
140
148
  teleportTo: string;
149
+ fullWidth: boolean;
141
150
  closeOnSelect: boolean;
142
151
  multiSelect: boolean;
143
152
  maxSelectedDisplay: string | number | boolean;
@@ -16,6 +16,7 @@ export interface KComboboxProps {
16
16
  modelValue?: any;
17
17
  teleportTo?: string;
18
18
  isOptionsOpen?: boolean;
19
+ fullWidth?: boolean;
19
20
  validation?: 'success' | 'warning' | 'error' | null;
20
21
  validationText?: string;
21
22
  }
@@ -85,6 +86,10 @@ export declare const KComboboxDefaultProps: {
85
86
  type: BooleanConstructor;
86
87
  default: undefined;
87
88
  };
89
+ fullWidth: {
90
+ type: BooleanConstructor;
91
+ default: boolean;
92
+ };
88
93
  };
89
94
  export declare function useKComboboxLogic(props: KComboboxProps, emit: KComboboxEmits): {
90
95
  selectedItems: import("vue").Ref<TDataRow[] | null, TDataRow[] | null>;
@@ -63,6 +63,10 @@ export const KComboboxDefaultProps = {
63
63
  isOptionsOpen: {
64
64
  type: Boolean,
65
65
  default: void 0
66
+ },
67
+ fullWidth: {
68
+ type: Boolean,
69
+ default: true
66
70
  }
67
71
  };
68
72
  export function useKComboboxLogic(props, emit) {
@@ -47,8 +47,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
47
47
  }>, {
48
48
  isOpen: boolean;
49
49
  teleportTo: string;
50
- align: "left" | "right";
51
50
  fullWidth: boolean;
51
+ align: "left" | "right";
52
52
  anchorEl: HTMLElement;
53
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
54
54
  declare const _default: typeof __VLS_export;
@@ -47,8 +47,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
47
47
  }>, {
48
48
  isOpen: boolean;
49
49
  teleportTo: string;
50
- align: "left" | "right";
51
50
  fullWidth: boolean;
51
+ align: "left" | "right";
52
52
  anchorEl: HTMLElement;
53
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
54
54
  declare const _default: typeof __VLS_export;
@@ -65,6 +65,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
65
65
  type: BooleanConstructor;
66
66
  default: undefined;
67
67
  };
68
+ fullWidth: {
69
+ type: BooleanConstructor;
70
+ default: boolean;
71
+ };
68
72
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
69
73
  change: (value: any) => any;
70
74
  "update:modelValue": (value: any) => any;
@@ -135,6 +139,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
135
139
  type: BooleanConstructor;
136
140
  default: undefined;
137
141
  };
142
+ fullWidth: {
143
+ type: BooleanConstructor;
144
+ default: boolean;
145
+ };
138
146
  }>> & Readonly<{
139
147
  onChange?: ((value: any) => any) | undefined;
140
148
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -150,6 +158,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
150
158
  searchbox: boolean;
151
159
  isOptionsOpen: boolean;
152
160
  placeholder: string;
161
+ fullWidth: boolean;
153
162
  closeOnSelect: boolean;
154
163
  multiSelect: boolean;
155
164
  valueField: string;
@@ -46,7 +46,8 @@ const templateProps = computed(() => ({
46
46
  closeOnSelect: props.closeOnSelect,
47
47
  valueField: props.valueField || props.idKey,
48
48
  validation: props.validation,
49
- validationText: props.validationText
49
+ validationText: props.validationText,
50
+ fullWidth: props.fullWidth
50
51
  }));
51
52
  function onUpdateModelValue(val) {
52
53
  emit("update:modelValue", val);
@@ -65,6 +65,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
65
65
  type: BooleanConstructor;
66
66
  default: undefined;
67
67
  };
68
+ fullWidth: {
69
+ type: BooleanConstructor;
70
+ default: boolean;
71
+ };
68
72
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
69
73
  change: (value: any) => any;
70
74
  "update:modelValue": (value: any) => any;
@@ -135,6 +139,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
135
139
  type: BooleanConstructor;
136
140
  default: undefined;
137
141
  };
142
+ fullWidth: {
143
+ type: BooleanConstructor;
144
+ default: boolean;
145
+ };
138
146
  }>> & Readonly<{
139
147
  onChange?: ((value: any) => any) | undefined;
140
148
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -150,6 +158,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
150
158
  searchbox: boolean;
151
159
  isOptionsOpen: boolean;
152
160
  placeholder: string;
161
+ fullWidth: boolean;
153
162
  closeOnSelect: boolean;
154
163
  multiSelect: boolean;
155
164
  valueField: string;
@@ -17,6 +17,7 @@ export interface KTreePickerProps {
17
17
  validation?: 'success' | 'warning' | 'error' | null;
18
18
  validationText?: string;
19
19
  isOptionsOpen?: boolean;
20
+ fullWidth?: boolean;
20
21
  }
21
22
  export declare const KTreePickerDefaultProps: {
22
23
  modelValue: {
@@ -84,6 +85,10 @@ export declare const KTreePickerDefaultProps: {
84
85
  type: BooleanConstructor;
85
86
  default: undefined;
86
87
  };
88
+ fullWidth: {
89
+ type: BooleanConstructor;
90
+ default: boolean;
91
+ };
87
92
  };
88
93
  export declare function useKTreePickerLogic(props: KTreePickerProps, emit: any): {
89
94
  selectedItems: import("vue").Ref<import("@katlux/providers").TDataRow[] | null, import("@katlux/providers").TDataRow[] | null>;
@@ -64,6 +64,10 @@ export const KTreePickerDefaultProps = {
64
64
  isOptionsOpen: {
65
65
  type: Boolean,
66
66
  default: void 0
67
+ },
68
+ fullWidth: {
69
+ type: Boolean,
70
+ default: true
67
71
  }
68
72
  };
69
73
  import { useKComboboxLogic } from "../KCombobox/KCombobox.logic.js";
@@ -14,6 +14,7 @@ type __VLS_Props = {
14
14
  isSelected: (option: ComboboxItem) => boolean;
15
15
  loading: boolean;
16
16
  teleportTo?: string;
17
+ fullWidth: boolean;
17
18
  validation?: 'success' | 'warning' | 'error' | null;
18
19
  validationText?: string;
19
20
  };
@@ -10,23 +10,26 @@
10
10
  ) {{ item[labelField] }}
11
11
  .KCombobox__selected-content-placeholder(v-else) {{placeholder}}
12
12
  KIcon(iconname="chevron" width="20" height="20").chevron
13
- KDropdown(v-model:isOpen="isOptionsOpenModel" :anchorEl="activatorRef" fullWidth :teleportTo="teleportTo").KCombobox__options
14
- slot
15
- KComboboxList(
16
- :searchbox="searchbox"
17
- v-model:searchtext="searchtextModel"
18
- :loading="loading"
19
- :filteredOptions="filteredOptions"
20
- :labelField="labelField"
21
- :selectItem="selectItem"
22
- :isSelected="isSelected"
23
- )
13
+ KDropdown(v-model:isOpen="isOptionsOpenModel" :anchorEl="activatorRef" :fullWidth="fullWidth" :teleportTo="teleportTo").KCombobox__options
14
+ template(v-if="slots.default")
15
+ slot(name="default")
16
+ KComboboxList(
17
+ v-else
18
+ :searchbox="searchbox"
19
+ v-model:searchtext="searchtextModel"
20
+ :loading="loading"
21
+ :filteredOptions="filteredOptions"
22
+ :labelField="labelField"
23
+ :selectItem="selectItem"
24
+ :isSelected="isSelected"
25
+ )
24
26
  span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
25
27
  </template>
26
28
 
27
29
  <script lang="ts" setup>
28
- import { computed, ref } from 'vue'
30
+ import { computed, ref, useSlots } from 'vue'
29
31
  const activatorRef = ref<HTMLElement | null>(null)
32
+ const slots = useSlots()
30
33
  import KComboboxList from './KComboboxList.vue'
31
34
  import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.logic'
32
35
 
@@ -45,6 +48,7 @@ const props = defineProps<{
45
48
  isSelected: (option: ComboboxItem) => boolean
46
49
  loading: boolean
47
50
  teleportTo?: string
51
+ fullWidth: boolean
48
52
  validation?: 'success' | 'warning' | 'error' | null
49
53
  validationText?: string
50
54
  }>()
@@ -14,6 +14,7 @@ type __VLS_Props = {
14
14
  isSelected: (option: ComboboxItem) => boolean;
15
15
  loading: boolean;
16
16
  teleportTo?: string;
17
+ fullWidth: boolean;
17
18
  validation?: 'success' | 'warning' | 'error' | null;
18
19
  validationText?: string;
19
20
  };
@@ -34,7 +34,8 @@ const dialogStyle = computed(() => {
34
34
  const style: any = {
35
35
  position: 'absolute',
36
36
  top: `${props.dropdownRect.top}px`,
37
- width: props.fullWidth ? `${props.dropdownRect.width}px` : 'fit-content',
37
+ width: props.fullWidth ? 'fit-content' : 'fit-content',
38
+ minWidth: props.fullWidth ? `${props.dropdownRect.width}px` : 'auto',
38
39
  zIndex: 2000
39
40
  }
40
41
 
@@ -58,7 +58,7 @@ const handleBackdropClick = (event: MouseEvent) => {
58
58
  background: transparent;
59
59
  padding: 0;
60
60
  /* margin: auto applied natively by browsers for showModal */
61
- overflow: hidden;
61
+ overflow: visible;
62
62
  max-width: 95vw;
63
63
  max-height: 95vh;
64
64
  width: fit-content;
@@ -142,6 +142,7 @@ const isLoading = computed(() => props.dataProvider?.loading?.value || props.dat
142
142
  display: flex;
143
143
  align-items: center;
144
144
  gap: 6px;
145
+ cursor: pointer;
145
146
  }
146
147
  }
147
148
  }
@@ -18,6 +18,7 @@ type __VLS_Props = {
18
18
  isSelected: (option: any) => boolean;
19
19
  loading: boolean;
20
20
  closeOnSelect: boolean;
21
+ fullWidth: boolean;
21
22
  validation?: 'success' | 'warning' | 'error' | null;
22
23
  validationText?: string;
23
24
  };
@@ -14,30 +14,30 @@ KCombobox(
14
14
  :selectItem="selectItem"
15
15
  :isSelected="isSelected"
16
16
  :loading="loading"
17
+ :fullWidth="fullWidth"
17
18
  :validation="validation"
18
19
  :validationText="validationText"
19
20
  )
20
- template(#default)
21
- .KTreePicker__tree-container
22
- .KTreePicker__search(v-if="searchbox" style="margin-bottom: 10px")
23
- KTextbox(
24
- v-model="searchtextModel"
25
- placeholder="Search..."
26
- showClear
27
- )
28
- KTree(
29
- :dataProvider="dataProvider"
30
- :idKey="idKey"
31
- :parentKey="parentKey"
32
- :labelField="labelField"
33
- :iconField="iconField"
34
- :loading="loading"
35
- :multiSelect="multiSelect"
36
- :isNodeSelected="isSelected"
37
- :searchtext="searchtext"
38
- :selectable="true"
39
- @select="onTreeSelect"
21
+ .KTreePicker__tree-container
22
+ .KTreePicker__search(v-if="searchbox")
23
+ KTextbox(
24
+ v-model="searchtextModel"
25
+ placeholder="Search..."
26
+ showClear
40
27
  )
28
+ KTree(
29
+ :dataProvider="dataProvider"
30
+ :idKey="idKey"
31
+ :parentKey="parentKey"
32
+ :labelField="labelField"
33
+ :iconField="iconField"
34
+ :loading="loading"
35
+ :multiSelect="multiSelect"
36
+ :isNodeSelected="isSelected"
37
+ :searchtext="searchtext"
38
+ :selectable="true"
39
+ @select="onTreeSelect"
40
+ )
41
41
  </template>
42
42
 
43
43
  <script lang="ts" setup>
@@ -66,6 +66,7 @@ const props = defineProps<{
66
66
  isSelected: (option: any) => boolean
67
67
  loading: boolean
68
68
  closeOnSelect: boolean
69
+ fullWidth: boolean
69
70
  validation?: 'success' | 'warning' | 'error' | null
70
71
  validationText?: string
71
72
  }>()
@@ -18,6 +18,7 @@ type __VLS_Props = {
18
18
  isSelected: (option: any) => boolean;
19
19
  loading: boolean;
20
20
  closeOnSelect: boolean;
21
+ fullWidth: boolean;
21
22
  validation?: 'success' | 'warning' | 'error' | null;
22
23
  validationText?: string;
23
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
- "version": "0.1.0-beta.56",
3
+ "version": "0.1.0-beta.58",
4
4
  "description": "Core UI toolkit and utilities for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "MIT",