@katlux/toolkit 0.1.0-beta.81 → 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.
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.81",
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 {
@@ -24,6 +25,7 @@ export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits)
24
25
  isDisabled: import("vue").ComputedRef<boolean | undefined>;
25
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
@@ -122,17 +122,17 @@ 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
+ align: "left" | "right" | undefined;
132
133
  format: string;
133
134
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
134
135
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
135
- align: "left" | "right" | undefined;
136
136
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
137
137
  declare const _default: typeof __VLS_export;
138
138
  export default _default;
@@ -122,17 +122,17 @@ 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
+ align: "left" | "right" | undefined;
132
133
  format: string;
133
134
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
134
135
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
135
- align: "left" | "right" | undefined;
136
136
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
137
137
  declare const _default: typeof __VLS_export;
138
138
  export default _default;
@@ -128,18 +128,18 @@ 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
- timeFormat: string;
140
- timeStep: number;
141
139
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
142
140
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
141
+ timeFormat: string;
142
+ timeStep: number;
143
143
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
144
144
  declare const _default: typeof __VLS_export;
145
145
  export default _default;
@@ -128,18 +128,18 @@ 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
- timeFormat: string;
140
- timeStep: number;
141
139
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
142
140
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
141
+ timeFormat: string;
142
+ timeStep: number;
143
143
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
144
144
  declare const _default: typeof __VLS_export;
145
145
  export default _default;
@@ -56,8 +56,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
56
56
  isOpen: boolean;
57
57
  teleportTo: string;
58
58
  fullWidth: boolean;
59
- anchorEl: HTMLElement;
60
59
  align: import("./KDropdown.logic.js").KDropdownAlign;
60
+ anchorEl: HTMLElement;
61
61
  direction: import("./KDropdown.logic.js").KDropdownDirection;
62
62
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
63
63
  declare const _default: typeof __VLS_export;
@@ -56,8 +56,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
56
56
  isOpen: boolean;
57
57
  teleportTo: string;
58
58
  fullWidth: boolean;
59
- anchorEl: HTMLElement;
60
59
  align: import("./KDropdown.logic.js").KDropdownAlign;
60
+ anchorEl: HTMLElement;
61
61
  direction: import("./KDropdown.logic.js").KDropdownDirection;
62
62
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
63
63
  declare const _default: typeof __VLS_export;
@@ -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.81",
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",