@katlux/toolkit 0.1.0-beta.82 → 0.1.0-beta.83

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 (24) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +6 -0
  3. package/dist/runtime/components/KButton/KButton.global.d.vue.ts +9 -0
  4. package/dist/runtime/components/KButton/KButton.global.vue +2 -1
  5. package/dist/runtime/components/KButton/KButton.global.vue.d.ts +9 -0
  6. package/dist/runtime/components/KButton/KButton.logic.d.ts +7 -1
  7. package/dist/runtime/components/KButton/KButton.logic.js +5 -1
  8. package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +1 -1
  9. package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +1 -1
  10. package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
  11. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
  12. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +1 -1
  13. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +1 -1
  14. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +1 -1
  15. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +1 -1
  16. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +2 -2
  17. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +2 -2
  18. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
  19. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
  20. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +14 -1
  21. package/dist/runtime/presets/default/components/KButton/KButton.vue +29 -2
  22. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +15 -1
  23. package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue +6 -5
  24. 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.82",
4
+ "version": "0.1.0-beta.83",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -10,9 +10,15 @@ export declare function useKBulkActionsLogic(props: KBulkActionsProps): {
10
10
  selected: import("vue").Ref<{
11
11
  action: Function;
12
12
  label: string;
13
+ icon?: string | undefined;
14
+ iconOnly?: boolean | undefined;
15
+ type?: "default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | undefined;
13
16
  } | null, IKDatatableAction | {
14
17
  action: Function;
15
18
  label: string;
19
+ icon?: string | undefined;
20
+ iconOnly?: boolean | undefined;
21
+ type?: "default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | undefined;
16
22
  } | null>;
17
23
  dp: CFlatClientDataProvider;
18
24
  doAction: (action: any) => void;
@@ -16,6 +16,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
16
16
  type: BooleanConstructor;
17
17
  default: boolean;
18
18
  };
19
+ iconOnly: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
19
23
  href: {
20
24
  type: StringConstructor;
21
25
  default: undefined;
@@ -39,6 +43,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
39
43
  type: BooleanConstructor;
40
44
  default: boolean;
41
45
  };
46
+ iconOnly: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
42
50
  href: {
43
51
  type: StringConstructor;
44
52
  default: undefined;
@@ -48,6 +56,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
48
56
  }>, {
49
57
  size: "small" | "large" | "medium" | undefined;
50
58
  type: "info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | undefined;
59
+ iconOnly: boolean;
51
60
  disabled: boolean;
52
61
  href: string;
53
62
  loading: boolean;
@@ -13,7 +13,8 @@ const templateProps = computed(() => ({
13
13
  buttonClasses: buttonClasses.value,
14
14
  onClick,
15
15
  href: props.href,
16
- loading: props.loading
16
+ loading: props.loading,
17
+ iconOnly: props.iconOnly
17
18
  }));
18
19
  </script>
19
20
 
@@ -16,6 +16,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
16
16
  type: BooleanConstructor;
17
17
  default: boolean;
18
18
  };
19
+ iconOnly: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
19
23
  href: {
20
24
  type: StringConstructor;
21
25
  default: undefined;
@@ -39,6 +43,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
39
43
  type: BooleanConstructor;
40
44
  default: boolean;
41
45
  };
46
+ iconOnly: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
42
50
  href: {
43
51
  type: StringConstructor;
44
52
  default: undefined;
@@ -48,6 +56,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
48
56
  }>, {
49
57
  size: "small" | "large" | "medium" | undefined;
50
58
  type: "info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | undefined;
59
+ iconOnly: boolean;
51
60
  disabled: boolean;
52
61
  href: string;
53
62
  loading: boolean;
@@ -4,6 +4,7 @@ export interface KButtonProps {
4
4
  size?: 'large' | 'medium' | 'small';
5
5
  disabled?: boolean;
6
6
  loading?: boolean;
7
+ iconOnly?: boolean;
7
8
  href?: string;
8
9
  }
9
10
  export interface KButtonEmits {
@@ -22,8 +23,9 @@ export interface KButtonEmits {
22
23
  export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits): {
23
24
  isLink: import("vue").ComputedRef<boolean>;
24
25
  isDisabled: import("vue").ComputedRef<boolean | undefined>;
25
- buttonClasses: import("vue").ComputedRef<("info" | "default" | "small" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "large" | "medium" | {
26
+ buttonClasses: import("vue").ComputedRef<("info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "small" | "large" | "medium" | {
26
27
  disabled: boolean | undefined;
28
+ 'icon-only': boolean | undefined;
27
29
  })[]>;
28
30
  onClick: () => void;
29
31
  };
@@ -47,6 +49,10 @@ export declare const KButtonDefaultProps: {
47
49
  type: BooleanConstructor;
48
50
  default: boolean;
49
51
  };
52
+ iconOnly: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
50
56
  href: {
51
57
  type: StringConstructor;
52
58
  default: undefined;
@@ -5,7 +5,7 @@ export function useKButtonLogic(props, emit) {
5
5
  const buttonClasses = computed(() => [
6
6
  props.type || "default",
7
7
  props.size || "medium",
8
- { disabled: isDisabled.value }
8
+ { disabled: isDisabled.value, "icon-only": props.iconOnly }
9
9
  ]);
10
10
  const onClick = () => {
11
11
  if (isDisabled.value) return;
@@ -35,6 +35,10 @@ export const KButtonDefaultProps = {
35
35
  type: Boolean,
36
36
  default: false
37
37
  },
38
+ iconOnly: {
39
+ type: Boolean,
40
+ default: false
41
+ },
38
42
  href: {
39
43
  type: String,
40
44
  default: void 0
@@ -46,8 +46,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
46
46
  "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
47
47
  }>, {
48
48
  isOpen: boolean;
49
- teleportTo: string;
50
49
  x: number;
50
+ teleportTo: string;
51
51
  y: number;
52
52
  target: string | HTMLElement;
53
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -46,8 +46,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
46
46
  "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
47
47
  }>, {
48
48
  isOpen: boolean;
49
- teleportTo: string;
50
49
  x: number;
50
+ teleportTo: string;
51
51
  y: number;
52
52
  target: string | HTMLElement;
53
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -11,8 +11,8 @@ 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[];
15
14
  search: string;
15
+ bulkActions: IKDatatableAction[];
16
16
  loading: boolean;
17
17
  visibleFields: Array<string> | null;
18
18
  rowActions: IKDatatableAction[];
@@ -11,8 +11,8 @@ 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[];
15
14
  search: string;
15
+ bulkActions: IKDatatableAction[];
16
16
  loading: boolean;
17
17
  visibleFields: Array<string> | null;
18
18
  rowActions: IKDatatableAction[];
@@ -122,12 +122,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
122
122
  }>, {
123
123
  label: string;
124
124
  isOpen: boolean;
125
- day: string | Date;
126
125
  validation: "error" | "success" | "warning" | null | undefined;
127
126
  validationText: string;
128
127
  modelValue: string | Date;
129
128
  placeholder: string;
130
129
  teleportTo: string;
130
+ day: string | Date;
131
131
  showClear: boolean;
132
132
  align: "left" | "right" | undefined;
133
133
  format: string;
@@ -122,12 +122,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
122
122
  }>, {
123
123
  label: string;
124
124
  isOpen: boolean;
125
- day: string | Date;
126
125
  validation: "error" | "success" | "warning" | null | undefined;
127
126
  validationText: string;
128
127
  modelValue: string | Date;
129
128
  placeholder: string;
130
129
  teleportTo: string;
130
+ day: string | Date;
131
131
  showClear: boolean;
132
132
  align: "left" | "right" | undefined;
133
133
  format: string;
@@ -128,12 +128,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
128
128
  }>, {
129
129
  label: string;
130
130
  isOpen: boolean;
131
- day: string | Date;
132
131
  validation: "error" | "success" | "warning" | null | undefined;
133
132
  validationText: string;
134
133
  modelValue: string | Date;
135
134
  placeholder: string;
136
135
  teleportTo: string;
136
+ day: string | Date;
137
137
  showClear: boolean;
138
138
  format: string;
139
139
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
@@ -128,12 +128,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
128
128
  }>, {
129
129
  label: string;
130
130
  isOpen: boolean;
131
- day: string | Date;
132
131
  validation: "error" | "success" | "warning" | null | undefined;
133
132
  validationText: string;
134
133
  modelValue: string | Date;
135
134
  placeholder: string;
136
135
  teleportTo: string;
136
+ day: string | Date;
137
137
  showClear: boolean;
138
138
  format: string;
139
139
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
@@ -165,6 +165,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
165
165
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
166
166
  }>, {
167
167
  label: string;
168
+ parentKey: string;
169
+ idKey: string;
168
170
  disabled: boolean;
169
171
  loading: boolean;
170
172
  validation: "error" | "success" | "warning" | null | undefined;
@@ -179,8 +181,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
179
181
  multiSelect: boolean;
180
182
  valueField: string;
181
183
  iconField: string;
182
- idKey: string;
183
- parentKey: string;
184
184
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
185
185
  declare const _default: typeof __VLS_export;
186
186
  export default _default;
@@ -165,6 +165,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
165
165
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
166
166
  }>, {
167
167
  label: string;
168
+ parentKey: string;
169
+ idKey: string;
168
170
  disabled: boolean;
169
171
  loading: boolean;
170
172
  validation: "error" | "success" | "warning" | null | undefined;
@@ -179,8 +181,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
179
181
  multiSelect: boolean;
180
182
  valueField: string;
181
183
  iconField: string;
182
- idKey: string;
183
- parentKey: string;
184
184
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
185
185
  declare const _default: typeof __VLS_export;
186
186
  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;
@@ -4,7 +4,20 @@
4
4
  KCombobox(:dataProvider="dp" v-model="internalSelected" labelField="label" closeOnSelect :disabled="props.selectedRows.length === 0" placeholder="Select an action")
5
5
  KButton(@click="doAction(internalSelected)" size="small" :disabled="props.selectedRows.length === 0 || internalSelected == undefined") Do
6
6
  template(v-else-if="props.bulkActions.length<=3" v-for="(action, index) in props.bulkActions")
7
- KButton(@click="doAction(action)" size="small" :disabled="props.selectedRows.length === 0") {{action.label}}
7
+ KTooltip(
8
+ :text="action.label"
9
+ :disabled="!(action.iconOnly || !!action.icon)"
10
+ )
11
+ KButton(
12
+ @click="doAction(action)"
13
+ size="small"
14
+ :type="action.type || 'default'"
15
+ :iconOnly="action.iconOnly || !!action.icon"
16
+ :disabled="props.selectedRows.length === 0"
17
+ )
18
+ template(#icon v-if="action.icon")
19
+ KIcon(:iconname="action.icon" :width="16" :height="16")
20
+ template(#default v-if="!action.iconOnly && !action.icon") {{action.label}}
8
21
  .info Selected {{props.selectedRows.length}} items
9
22
  </template>
10
23
 
@@ -1,10 +1,14 @@
1
1
  <template lang="pug">
2
2
  NuxtLink.KButton(v-if="isLink" :to="href" @click.prevent="onClick" :class="buttonClasses")
3
- span
3
+ span.button-icon(v-if="$slots.icon")
4
+ slot(name="icon")
5
+ span.button-text(v-if="$slots.default")
4
6
  slot
5
7
  span.loading(v-if="loading")
6
8
  button.KButton(v-else @click="onClick" :class="buttonClasses" :disabled="isDisabled")
7
- span
9
+ span.button-icon(v-if="$slots.icon")
10
+ slot(name="icon")
11
+ span.button-text(v-if="$slots.default")
8
12
  slot
9
13
  span.loading(v-if="loading")
10
14
  </template>
@@ -159,5 +163,28 @@ defineProps<{
159
163
  font-size: var(--button-font-size-md);
160
164
  padding: 5px 10px;
161
165
  }
166
+
167
+ &.icon-only {
168
+ padding: 0;
169
+ display: inline-flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ aspect-ratio: 1 / 1;
173
+
174
+ &.large {
175
+ width: 44px;
176
+ height: 44px;
177
+ }
178
+
179
+ &.medium {
180
+ width: 36px;
181
+ height: 36px;
182
+ }
183
+
184
+ &.small {
185
+ width: 28px;
186
+ height: 28px;
187
+ }
188
+ }
162
189
  }
163
190
  </style>
@@ -35,7 +35,21 @@
35
35
  component(v-if="getCellSlot(visibleField)" :is="getCellSlot(visibleField)" :row="row" :field="visibleField" :value="row[visibleField]")
36
36
  span(v-else) {{ row[visibleField] }}
37
37
  td.rowAction(v-if="props.rowActions && props.rowActions.length>0")
38
- KButton(v-for="rowAction in props.rowActions" :key="rowAction.label" size="small" @click="rowAction.action(row)") {{rowAction.label}}
38
+ KTooltip(
39
+ v-for="rowAction in props.rowActions"
40
+ :key="rowAction.label"
41
+ :text="rowAction.label"
42
+ :disabled="!(rowAction.iconOnly || !!rowAction.icon)"
43
+ )
44
+ KButton(
45
+ size="small"
46
+ :type="rowAction.type || 'default'"
47
+ :iconOnly="rowAction.iconOnly || !!rowAction.icon"
48
+ @click="rowAction.action(row)"
49
+ )
50
+ template(#icon v-if="rowAction.icon")
51
+ KIcon(:iconname="rowAction.icon" :width="16" :height="16")
52
+ template(#default v-if="!rowAction.iconOnly && !rowAction.icon") {{rowAction.label}}
39
53
  .footer
40
54
  KBulkActions.bulk-actions(v-if="props.bulkActions && props.bulkActions.length>0" :bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll")
41
55
  KPagination.pagination(:dataProvider="props.dataProvider")
@@ -47,14 +47,15 @@ watch(internalWrapperRef, (newVal) => {
47
47
  }
48
48
 
49
49
  .KTooltip {
50
- background-color: var(--neutral-800, #1f2937);
51
- color: var(--font-color-light, #ffffff);
50
+ background-color: var(--tooltip-bg, var(--button-bg-dark, #1f2937));
51
+ color: var(--tooltip-color, var(--button-text-dark, #ffffff));
52
52
  padding: 6px 10px;
53
- border-radius: var(--border-radius-sm, 4px);
54
- font-size: 11px;
53
+ border-radius: var(--tooltip-border-radius, var(--border-radius-sm, 4px));
54
+ font-family: var(--tooltip-font-family, var(--font-family, sans-serif));
55
+ font-size: var(--tooltip-font-size, var(--font-size-xs, 12px));
55
56
  line-height: 1.4;
56
57
  white-space: nowrap;
57
- box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
58
+ box-shadow: var(--tooltip-shadow, var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1)));
58
59
  max-width: 250px;
59
60
  pointer-events: none;
60
61
  opacity: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
- "version": "0.1.0-beta.82",
3
+ "version": "0.1.0-beta.83",
4
4
  "description": "Core UI toolkit and utilities for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "Apache-2.0",