@katlux/toolkit 0.1.0-beta.55 → 0.1.0-beta.57

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 (42) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  3. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +9 -0
  4. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +2 -1
  5. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +9 -0
  6. package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +6 -0
  7. package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +7 -1
  8. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +2 -2
  9. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +2 -2
  10. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +2 -2
  11. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +2 -2
  12. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +20 -0
  13. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +12 -0
  14. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +1 -1
  15. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +1 -1
  16. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +1 -1
  17. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +1 -1
  18. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
  19. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
  20. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
  21. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
  22. package/dist/runtime/components/KModal/KModal.global.d.vue.ts +14 -2
  23. package/dist/runtime/components/KModal/KModal.global.vue +1 -0
  24. package/dist/runtime/components/KModal/KModal.global.vue.d.ts +14 -2
  25. package/dist/runtime/components/KModal/KModal.logic.d.ts +7 -1
  26. package/dist/runtime/components/KModal/KModal.logic.js +6 -1
  27. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +1 -1
  28. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
  29. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +1 -1
  30. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +1 -1
  31. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +4 -4
  32. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +4 -4
  33. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
  34. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
  35. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +1 -0
  36. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +4 -1
  37. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +1 -0
  38. package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +1 -0
  39. package/dist/runtime/presets/default/components/KModal/KModal.vue +30 -9
  40. package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +1 -0
  41. package/dist/runtime/presets/default/components/KPanel/KPanel.vue +2 -0
  42. 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.55",
4
+ "version": "0.1.0-beta.57",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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" | "small" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "large" | "medium" | {
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;
@@ -17,6 +17,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
17
17
  type: StringConstructor;
18
18
  default: string;
19
19
  };
20
+ label: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
20
24
  modelValue: {
21
25
  type: import("vue").PropType<any>;
22
26
  };
@@ -40,12 +44,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
40
44
  type: StringConstructor;
41
45
  default: string;
42
46
  };
47
+ label: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
43
51
  modelValue: {
44
52
  type: import("vue").PropType<any>;
45
53
  };
46
54
  }>> & Readonly<{
47
55
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
48
56
  }>, {
57
+ label: string;
49
58
  value: any;
50
59
  disabled: boolean;
51
60
  validation: "error" | "success" | "warning" | null | undefined;
@@ -12,7 +12,8 @@ const templateProps = computed(() => ({
12
12
  checkboxValue: checkboxValue.value,
13
13
  isDisabled: isDisabled.value,
14
14
  validation: props.validation,
15
- validationText: props.validationText
15
+ validationText: props.validationText,
16
+ label: props.label
16
17
  }));
17
18
  </script>
18
19
 
@@ -17,6 +17,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
17
17
  type: StringConstructor;
18
18
  default: string;
19
19
  };
20
+ label: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
20
24
  modelValue: {
21
25
  type: import("vue").PropType<any>;
22
26
  };
@@ -40,12 +44,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
40
44
  type: StringConstructor;
41
45
  default: string;
42
46
  };
47
+ label: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
43
51
  modelValue: {
44
52
  type: import("vue").PropType<any>;
45
53
  };
46
54
  }>> & Readonly<{
47
55
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
48
56
  }>, {
57
+ label: string;
49
58
  value: any;
50
59
  disabled: boolean;
51
60
  validation: "error" | "success" | "warning" | null | undefined;
@@ -4,6 +4,7 @@ export interface KCheckboxProps {
4
4
  value?: any;
5
5
  validation?: 'success' | 'warning' | 'error' | null;
6
6
  validationText?: string;
7
+ label?: string;
7
8
  }
8
9
  /**
9
10
  * KCheckbox Logic Composable
@@ -14,6 +15,7 @@ export declare function useKCheckboxLogic(props: KCheckboxProps, model: any): {
14
15
  isDisabled: import("vue").ComputedRef<boolean | undefined>;
15
16
  checkboxValue: import("vue").ComputedRef<any>;
16
17
  model: any;
18
+ label: import("vue").ComputedRef<string | undefined>;
17
19
  };
18
20
  /**
19
21
  * Default props for KCheckbox
@@ -36,4 +38,8 @@ export declare const KCheckboxDefaultProps: {
36
38
  type: StringConstructor;
37
39
  default: string;
38
40
  };
41
+ label: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
39
45
  };
@@ -2,10 +2,12 @@ import { computed } from "vue";
2
2
  export function useKCheckboxLogic(props, model) {
3
3
  const isDisabled = computed(() => props.disabled);
4
4
  const checkboxValue = computed(() => props.value);
5
+ const label = computed(() => props.label);
5
6
  return {
6
7
  isDisabled,
7
8
  checkboxValue,
8
- model
9
+ model,
10
+ label
9
11
  };
10
12
  }
11
13
  export const KCheckboxDefaultProps = {
@@ -25,5 +27,9 @@ export const KCheckboxDefaultProps = {
25
27
  validationText: {
26
28
  type: String,
27
29
  default: ""
30
+ },
31
+ label: {
32
+ type: String,
33
+ default: ""
28
34
  }
29
35
  };
@@ -132,17 +132,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
132
132
  }>, {
133
133
  disabled: boolean;
134
134
  validation: "error" | "success" | "warning" | null | undefined;
135
+ validationText: string;
136
+ modelValue: any;
135
137
  searchbox: boolean;
136
138
  isOptionsOpen: boolean;
137
139
  placeholder: string;
138
140
  teleportTo: string;
139
- validationText: string;
140
141
  closeOnSelect: boolean;
141
142
  multiSelect: boolean;
142
143
  maxSelectedDisplay: string | number | boolean;
143
144
  visibleFields: String[];
144
145
  valueField: string;
145
- modelValue: any;
146
146
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
147
147
  declare const _default: typeof __VLS_export;
148
148
  export default _default;
@@ -132,17 +132,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
132
132
  }>, {
133
133
  disabled: boolean;
134
134
  validation: "error" | "success" | "warning" | null | undefined;
135
+ validationText: string;
136
+ modelValue: any;
135
137
  searchbox: boolean;
136
138
  isOptionsOpen: boolean;
137
139
  placeholder: string;
138
140
  teleportTo: string;
139
- validationText: string;
140
141
  closeOnSelect: boolean;
141
142
  multiSelect: boolean;
142
143
  maxSelectedDisplay: string | number | boolean;
143
144
  visibleFields: String[];
144
145
  valueField: string;
145
- modelValue: any;
146
146
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
147
147
  declare const _default: typeof __VLS_export;
148
148
  export default _default;
@@ -150,13 +150,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
150
150
  }>, {
151
151
  type: import("./KCompositeInput.logic.js").CompositeInputType;
152
152
  validation: "error" | "success" | "warning" | null | undefined;
153
+ validationText: string;
154
+ modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
153
155
  searchbox: boolean;
154
156
  labelField: string;
155
157
  placeholder: string;
156
158
  teleportTo: string;
157
- validationText: string;
158
159
  valueField: string;
159
- modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
160
160
  inputType: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
161
161
  selectionValue: string | number | Record<string, any> | unknown[];
162
162
  inputValue: string | number | Record<string, any> | unknown[];
@@ -150,13 +150,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
150
150
  }>, {
151
151
  type: import("./KCompositeInput.logic.js").CompositeInputType;
152
152
  validation: "error" | "success" | "warning" | null | undefined;
153
+ validationText: string;
154
+ modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
153
155
  searchbox: boolean;
154
156
  labelField: string;
155
157
  placeholder: string;
156
158
  teleportTo: string;
157
- validationText: string;
158
159
  valueField: string;
159
- modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
160
160
  inputType: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
161
161
  selectionValue: string | number | Record<string, any> | unknown[];
162
162
  inputValue: string | number | Record<string, any> | unknown[];
@@ -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
+ };
@@ -107,9 +107,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
107
107
  isOpen: boolean;
108
108
  day: string | Date;
109
109
  validation: "error" | "success" | "warning" | null | undefined;
110
- teleportTo: string;
111
110
  validationText: string;
112
111
  modelValue: string | Date;
112
+ teleportTo: string;
113
113
  showClear: boolean;
114
114
  align: "left" | "right" | undefined;
115
115
  format: string;
@@ -107,9 +107,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
107
107
  isOpen: boolean;
108
108
  day: string | Date;
109
109
  validation: "error" | "success" | "warning" | null | undefined;
110
- teleportTo: string;
111
110
  validationText: string;
112
111
  modelValue: string | Date;
112
+ teleportTo: string;
113
113
  showClear: boolean;
114
114
  align: "left" | "right" | undefined;
115
115
  format: string;
@@ -113,9 +113,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
113
113
  isOpen: boolean;
114
114
  day: string | Date;
115
115
  validation: "error" | "success" | "warning" | null | undefined;
116
- teleportTo: string;
117
116
  validationText: string;
118
117
  modelValue: string | Date;
118
+ teleportTo: string;
119
119
  showClear: boolean;
120
120
  format: string;
121
121
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
@@ -113,9 +113,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
113
113
  isOpen: boolean;
114
114
  day: string | Date;
115
115
  validation: "error" | "success" | "warning" | null | undefined;
116
- teleportTo: string;
117
116
  validationText: string;
118
117
  modelValue: string | Date;
118
+ teleportTo: string;
119
119
  showClear: boolean;
120
120
  format: string;
121
121
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
@@ -101,9 +101,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
101
101
  isOpen: boolean;
102
102
  disabled: boolean;
103
103
  validation: "error" | "success" | "warning" | null | undefined;
104
- placeholder: string;
105
104
  validationText: string;
106
105
  modelValue: string;
106
+ placeholder: string;
107
107
  showClear: boolean;
108
108
  format: string;
109
109
  step: number;
@@ -101,9 +101,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
101
101
  isOpen: boolean;
102
102
  disabled: boolean;
103
103
  validation: "error" | "success" | "warning" | null | undefined;
104
- placeholder: string;
105
104
  validationText: string;
106
105
  modelValue: string;
106
+ placeholder: string;
107
107
  showClear: boolean;
108
108
  format: string;
109
109
  step: number;
@@ -57,9 +57,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
57
57
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
58
58
  }>, {
59
59
  validation: "error" | "success" | "warning" | null | undefined;
60
- placeholder: string;
61
60
  validationText: string;
62
61
  modelValue: string;
62
+ placeholder: string;
63
63
  showClear: boolean;
64
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
65
  declare const _default: typeof __VLS_export;
@@ -57,9 +57,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
57
57
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
58
58
  }>, {
59
59
  validation: "error" | "success" | "warning" | null | undefined;
60
- placeholder: string;
61
60
  validationText: string;
62
61
  modelValue: string;
62
+ placeholder: string;
63
63
  showClear: boolean;
64
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
65
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,18 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {
1
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ closeOnOutsideClick: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ }>, {
2
7
  openModal: () => void;
3
8
  closeModal: () => void;
4
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
+ closeOnOutsideClick: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ }>> & Readonly<{}>, {
15
+ closeOnOutsideClick: boolean;
16
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
5
17
  declare const _default: typeof __VLS_export;
6
18
  export default _default;
@@ -15,6 +15,7 @@ const presetComponent = usePresetComponent("KModal", KModalDefault);
15
15
  const templateProps = computed(() => ({
16
16
  modalId: modalId.value,
17
17
  opened: opened.value,
18
+ closeOnOutsideClick: props.closeOnOutsideClick,
18
19
  closeModal
19
20
  }));
20
21
  </script>
@@ -1,6 +1,18 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {
1
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ closeOnOutsideClick: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ }>, {
2
7
  openModal: () => void;
3
8
  closeModal: () => void;
4
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
+ closeOnOutsideClick: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ }>> & Readonly<{}>, {
15
+ closeOnOutsideClick: boolean;
16
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
5
17
  declare const _default: typeof __VLS_export;
6
18
  export default _default;
@@ -1,7 +1,13 @@
1
1
  export declare const KMODAL_PORTAL_ID_KEY = "KMODAL_PORTAL_ID";
2
2
  export interface KModalProps {
3
+ closeOnOutsideClick?: boolean;
3
4
  }
4
- export declare const KModalDefaultProps: {};
5
+ export declare const KModalDefaultProps: {
6
+ closeOnOutsideClick: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ };
5
11
  export declare function useKModalLogic(props: KModalProps, stableId: string): {
6
12
  modalId: import("vue").ComputedRef<string>;
7
13
  opened: import("vue").Ref<boolean, boolean>;
@@ -1,6 +1,11 @@
1
1
  import { ref, provide, computed } from "vue";
2
2
  export const KMODAL_PORTAL_ID_KEY = "KMODAL_PORTAL_ID";
3
- export const KModalDefaultProps = {};
3
+ export const KModalDefaultProps = {
4
+ closeOnOutsideClick: {
5
+ type: Boolean,
6
+ default: true
7
+ }
8
+ };
4
9
  export function useKModalLogic(props, stableId) {
5
10
  const modalId = computed(() => stableId);
6
11
  provide(KMODAL_PORTAL_ID_KEY, modalId);
@@ -50,8 +50,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
50
50
  }>, {
51
51
  rows: number;
52
52
  validation: "error" | "success" | "warning" | null | undefined;
53
- placeholder: string;
54
53
  validationText: string;
54
+ placeholder: string;
55
55
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
56
56
  declare const _default: typeof __VLS_export;
57
57
  export default _default;
@@ -50,8 +50,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
50
50
  }>, {
51
51
  rows: number;
52
52
  validation: "error" | "success" | "warning" | null | undefined;
53
- placeholder: string;
54
53
  validationText: string;
54
+ placeholder: string;
55
55
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
56
56
  declare const _default: typeof __VLS_export;
57
57
  export default _default;
@@ -60,9 +60,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
60
60
  }>, {
61
61
  type: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
62
62
  validation: "error" | "success" | "warning" | null | undefined;
63
- placeholder: string;
64
63
  validationText: string;
65
64
  modelValue: string;
65
+ placeholder: string;
66
66
  showClear: boolean;
67
67
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
68
68
  declare const _default: typeof __VLS_export;
@@ -60,9 +60,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
60
60
  }>, {
61
61
  type: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
62
62
  validation: "error" | "success" | "warning" | null | undefined;
63
- placeholder: string;
64
63
  validationText: string;
65
64
  modelValue: string;
65
+ placeholder: string;
66
66
  showClear: boolean;
67
67
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
68
68
  declare const _default: typeof __VLS_export;
@@ -140,20 +140,20 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
140
140
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
141
141
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
142
142
  }>, {
143
+ parentKey: string;
144
+ idKey: string;
143
145
  disabled: boolean;
144
146
  loading: boolean;
145
147
  validation: "error" | "success" | "warning" | null | undefined;
148
+ validationText: string;
149
+ modelValue: any;
146
150
  searchbox: boolean;
147
151
  isOptionsOpen: boolean;
148
152
  placeholder: string;
149
- validationText: string;
150
153
  closeOnSelect: boolean;
151
154
  multiSelect: boolean;
152
155
  valueField: string;
153
- modelValue: any;
154
156
  iconField: string;
155
- idKey: string;
156
- parentKey: string;
157
157
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
158
158
  declare const _default: typeof __VLS_export;
159
159
  export default _default;
@@ -140,20 +140,20 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
140
140
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
141
141
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
142
142
  }>, {
143
+ parentKey: string;
144
+ idKey: string;
143
145
  disabled: boolean;
144
146
  loading: boolean;
145
147
  validation: "error" | "success" | "warning" | null | undefined;
148
+ validationText: string;
149
+ modelValue: any;
146
150
  searchbox: boolean;
147
151
  isOptionsOpen: boolean;
148
152
  placeholder: string;
149
- validationText: string;
150
153
  closeOnSelect: boolean;
151
154
  multiSelect: boolean;
152
155
  valueField: string;
153
- modelValue: any;
154
156
  iconField: string;
155
- idKey: string;
156
- parentKey: string;
157
157
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
158
158
  declare const _default: typeof __VLS_export;
159
159
  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;
@@ -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;
@@ -2,6 +2,7 @@ type __VLS_Props = {
2
2
  model: any;
3
3
  checkboxValue: any;
4
4
  isDisabled: boolean;
5
+ label?: string;
5
6
  validation?: 'success' | 'warning' | 'error' | null;
6
7
  validationText?: string;
7
8
  };
@@ -5,7 +5,9 @@
5
5
  .icon-container(:class="validation ? `is-${validation}` : ''")
6
6
  KIcon.icon(iconname="check")
7
7
  span
8
- slot
8
+ slot(name="label")
9
+ slot
10
+ | {{ label }}
9
11
  span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
10
12
  </template>
11
13
 
@@ -17,6 +19,7 @@ const props = defineProps<{
17
19
  model: any
18
20
  checkboxValue: any
19
21
  isDisabled: boolean
22
+ label?: string
20
23
  validation?: 'success' | 'warning' | 'error' | null
21
24
  validationText?: string
22
25
  }>()
@@ -2,6 +2,7 @@ type __VLS_Props = {
2
2
  model: any;
3
3
  checkboxValue: any;
4
4
  isDisabled: boolean;
5
+ label?: string;
5
6
  validation?: 'success' | 'warning' | 'error' | null;
6
7
  validationText?: string;
7
8
  };
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  modalId: string;
3
3
  opened: boolean;
4
+ closeOnOutsideClick: boolean;
4
5
  closeModal: () => void;
5
6
  };
6
7
  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>;
@@ -1,5 +1,5 @@
1
1
  <template lang="pug">
2
- dialog.k-dialog(ref="dialogRef" @close="closeModal" @click="handleBackdropClick")
2
+ dialog.k-modal(ref="dialogRef" @close="closeModal" @click="handleBackdropClick" @mousedown="handleMouseDown")
3
3
  .modal-portal(:id="modalId" style="position: absolute; top: 0; left: 0; z-index: 2000;")
4
4
  KPanel(no-gap flex-content scrollable).modal-container
5
5
  template(#header)
@@ -15,10 +15,12 @@ import { ref, watch, onMounted } from 'vue'
15
15
  const props = defineProps<{
16
16
  modalId: string
17
17
  opened: boolean
18
+ closeOnOutsideClick: boolean
18
19
  closeModal: () => void
19
20
  }>()
20
21
 
21
22
  const dialogRef = ref<HTMLDialogElement | null>(null)
23
+ let isMouseDownOnBackdrop = false
22
24
 
23
25
  // When your prop changes, trigger the native browser methods to enter/exit the Top Layer
24
26
  watch(() => props.opened, (isOpen) => {
@@ -37,23 +39,39 @@ onMounted(() => {
37
39
  }
38
40
  })
39
41
 
42
+ const handleMouseDown = (event: MouseEvent) => {
43
+ isMouseDownOnBackdrop = event.target === dialogRef.value
44
+ }
45
+
40
46
  // Native dialogs require a script trick to close when clicking the ::backdrop pseudo-element
41
47
  const handleBackdropClick = (event: MouseEvent) => {
42
- if (event.target === dialogRef.value) {
48
+ if (props.closeOnOutsideClick && isMouseDownOnBackdrop && event.target === dialogRef.value) {
43
49
  props.closeModal()
44
50
  }
51
+ isMouseDownOnBackdrop = false
45
52
  }
46
53
  </script>
47
54
 
48
55
  <style lang="scss" scoped>
49
- .k-dialog {
56
+ .k-modal {
50
57
  border: none;
51
58
  background: transparent;
52
59
  padding: 0;
53
60
  /* margin: auto applied natively by browsers for showModal */
54
61
  overflow: visible;
55
- max-width: 100vw;
56
- max-height: 100vh;
62
+ max-width: 95vw;
63
+ max-height: 95vh;
64
+ width: fit-content;
65
+ height: fit-content;
66
+
67
+ &:not([open]) {
68
+ display: none;
69
+ }
70
+
71
+ &[open] {
72
+ display: flex;
73
+ flex-direction: column;
74
+ }
57
75
 
58
76
  &::backdrop {
59
77
  background-color: var(--modal-overlay-bg);
@@ -61,10 +79,13 @@ const handleBackdropClick = (event: MouseEvent) => {
61
79
  }
62
80
 
63
81
  .modal-container {
64
- max-height: 600px;
65
- height: 80vh;
66
- max-width: 700px;
67
- min-width: 500px;
82
+ flex: 1;
83
+ display: flex;
84
+ flex-direction: column;
85
+ min-height: 0;
86
+ max-height: 100%;
87
+ width: 100%;
88
+ min-width: 400px;
68
89
  }
69
90
  }
70
91
  </style>
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  modalId: string;
3
3
  opened: boolean;
4
+ closeOnOutsideClick: boolean;
4
5
  closeModal: () => void;
5
6
  };
6
7
  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>;
@@ -74,6 +74,7 @@ const props = withDefaults(defineProps<{
74
74
 
75
75
  .full-height {
76
76
  height: 100%;
77
+ min-height: 0;
77
78
  }
78
79
 
79
80
  &--header {
@@ -88,6 +89,7 @@ const props = withDefaults(defineProps<{
88
89
  &--content {
89
90
  padding: var(--gap-md);
90
91
  flex: 1;
92
+ min-height: 0;
91
93
 
92
94
  &.scrollable {
93
95
  overflow-y: auto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
- "version": "0.1.0-beta.55",
3
+ "version": "0.1.0-beta.57",
4
4
  "description": "Core UI toolkit and utilities for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "MIT",