@katlux/toolkit 0.1.0-beta.82 → 0.1.0-beta.84
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 +1 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +2 -2
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +9 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +10 -3
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +9 -0
- package/dist/runtime/components/KButton/KButton.global.vue +2 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +9 -0
- package/dist/runtime/components/KButton/KButton.logic.d.ts +7 -1
- package/dist/runtime/components/KButton/KButton.logic.js +5 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +1 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
- package/dist/runtime/components/KGantt/KGantt.logic.d.ts +2 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +6 -6
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +6 -6
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +2 -7
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +14 -1
- package/dist/runtime/presets/default/components/KButton/KButton.vue +29 -2
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +27 -6
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +9 -9
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue +6 -5
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +2 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -8,10 +8,10 @@ const props = defineProps({
|
|
|
8
8
|
selectedRows: { type: Array, required: true },
|
|
9
9
|
selectAll: { type: Boolean, required: true }
|
|
10
10
|
});
|
|
11
|
-
const { selected, dp, doAction } = useKBulkActionsLogic(props);
|
|
11
|
+
const { selected, dp, doAction, visibleBulkActions } = useKBulkActionsLogic(props);
|
|
12
12
|
const presetComponent = usePresetComponent("KBulkActions", KBulkActionsDefault);
|
|
13
13
|
const templateProps = computed(() => ({
|
|
14
|
-
bulkActions:
|
|
14
|
+
bulkActions: visibleBulkActions.value,
|
|
15
15
|
selectedRows: props.selectedRows,
|
|
16
16
|
selectAll: props.selectAll,
|
|
17
17
|
selected: selected.value,
|
|
@@ -10,10 +10,19 @@ 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;
|
|
16
|
+
visible?: Function | undefined;
|
|
13
17
|
} | null, IKDatatableAction | {
|
|
14
18
|
action: Function;
|
|
15
19
|
label: string;
|
|
20
|
+
icon?: string | undefined;
|
|
21
|
+
iconOnly?: boolean | undefined;
|
|
22
|
+
type?: "default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | undefined;
|
|
23
|
+
visible?: Function | undefined;
|
|
16
24
|
} | null>;
|
|
17
25
|
dp: CFlatClientDataProvider;
|
|
18
26
|
doAction: (action: any) => void;
|
|
27
|
+
visibleBulkActions: import("vue").ComputedRef<IKDatatableAction[]>;
|
|
19
28
|
};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { ref, watch } from "vue";
|
|
1
|
+
import { ref, watch, computed } from "vue";
|
|
2
2
|
import { CFlatClientDataProvider } from "@katlux/providers";
|
|
3
3
|
export const KBulkActionsDefaultProps = {};
|
|
4
4
|
export function useKBulkActionsLogic(props) {
|
|
5
5
|
const selected = ref(null);
|
|
6
6
|
const dp = new CFlatClientDataProvider();
|
|
7
|
-
|
|
7
|
+
const visibleBulkActions = computed(() => {
|
|
8
|
+
return props.bulkActions.filter((action) => {
|
|
9
|
+
if (!action.visible) return true;
|
|
10
|
+
return action.visible(props.selectedRows, props.selectAll);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
watch(visibleBulkActions, (actions) => {
|
|
8
14
|
dp.setData(actions.map((row) => ({
|
|
9
15
|
label: row.label,
|
|
10
16
|
action: row.action
|
|
@@ -19,6 +25,7 @@ export function useKBulkActionsLogic(props) {
|
|
|
19
25
|
return {
|
|
20
26
|
selected,
|
|
21
27
|
dp,
|
|
22
|
-
doAction
|
|
28
|
+
doAction,
|
|
29
|
+
visibleBulkActions
|
|
23
30
|
};
|
|
24
31
|
}
|
|
@@ -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;
|
|
@@ -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" | "
|
|
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[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IKDatatableAction } from '@katlux/providers';
|
|
2
|
-
import type { ITreeViewColumn
|
|
2
|
+
import type { ITreeViewColumn } from '../KTreeView/KTreeView.logic.js';
|
|
3
3
|
/**
|
|
4
4
|
* A single task (time block) assigned to a resource.
|
|
5
5
|
* Resources can have multiple tasks displayed as bars on the timeline.
|
|
@@ -45,7 +45,7 @@ export interface KGanttProps {
|
|
|
45
45
|
columns: ITreeViewColumn[];
|
|
46
46
|
treeColumnIndex?: number;
|
|
47
47
|
bulkActions?: IKDatatableAction[];
|
|
48
|
-
rowActions?:
|
|
48
|
+
rowActions?: IKDatatableAction[];
|
|
49
49
|
startDate?: Date | string | number;
|
|
50
50
|
endDate?: Date | string | number;
|
|
51
51
|
/** @deprecated use startingPoint and endingPoint */
|
|
@@ -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;
|
|
@@ -28,7 +28,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
28
28
|
default: () => never[];
|
|
29
29
|
};
|
|
30
30
|
rowActions: {
|
|
31
|
-
type: import("vue").PropType<import("
|
|
31
|
+
type: import("vue").PropType<import("@katlux/providers").IKDatatableAction[]>;
|
|
32
32
|
default: () => never[];
|
|
33
33
|
};
|
|
34
34
|
headerSlots: {
|
|
@@ -69,7 +69,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
69
69
|
default: () => never[];
|
|
70
70
|
};
|
|
71
71
|
rowActions: {
|
|
72
|
-
type: import("vue").PropType<import("
|
|
72
|
+
type: import("vue").PropType<import("@katlux/providers").IKDatatableAction[]>;
|
|
73
73
|
default: () => never[];
|
|
74
74
|
};
|
|
75
75
|
headerSlots: {
|
|
@@ -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
|
-
rowActions: import("
|
|
88
|
+
rowActions: import("@katlux/providers").IKDatatableAction[];
|
|
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;
|
|
@@ -28,7 +28,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
28
28
|
default: () => never[];
|
|
29
29
|
};
|
|
30
30
|
rowActions: {
|
|
31
|
-
type: import("vue").PropType<import("
|
|
31
|
+
type: import("vue").PropType<import("@katlux/providers").IKDatatableAction[]>;
|
|
32
32
|
default: () => never[];
|
|
33
33
|
};
|
|
34
34
|
headerSlots: {
|
|
@@ -69,7 +69,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
69
69
|
default: () => never[];
|
|
70
70
|
};
|
|
71
71
|
rowActions: {
|
|
72
|
-
type: import("vue").PropType<import("
|
|
72
|
+
type: import("vue").PropType<import("@katlux/providers").IKDatatableAction[]>;
|
|
73
73
|
default: () => never[];
|
|
74
74
|
};
|
|
75
75
|
headerSlots: {
|
|
@@ -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
|
-
rowActions: import("
|
|
88
|
+
rowActions: import("@katlux/providers").IKDatatableAction[];
|
|
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;
|
|
@@ -8,11 +8,6 @@ export interface ITreeViewColumn {
|
|
|
8
8
|
componentProps?: any;
|
|
9
9
|
width?: string;
|
|
10
10
|
}
|
|
11
|
-
export interface IRowAction {
|
|
12
|
-
label: string;
|
|
13
|
-
action: (row: any) => void;
|
|
14
|
-
icon?: string;
|
|
15
|
-
}
|
|
16
11
|
export interface KTreeViewProps {
|
|
17
12
|
dataProvider: ADataProvider;
|
|
18
13
|
columns: ITreeViewColumn[];
|
|
@@ -20,7 +15,7 @@ export interface KTreeViewProps {
|
|
|
20
15
|
parentKey: string;
|
|
21
16
|
idKey: string;
|
|
22
17
|
bulkActions?: IKDatatableAction[];
|
|
23
|
-
rowActions?:
|
|
18
|
+
rowActions?: IKDatatableAction[];
|
|
24
19
|
expandedByDefault?: boolean;
|
|
25
20
|
headerSlots?: Record<string, any>;
|
|
26
21
|
cellSlots?: Record<string, any>;
|
|
@@ -55,7 +50,7 @@ export declare const KTreeViewDefaultProps: {
|
|
|
55
50
|
default: () => never[];
|
|
56
51
|
};
|
|
57
52
|
rowActions: {
|
|
58
|
-
type: PropType<
|
|
53
|
+
type: PropType<IKDatatableAction[]>;
|
|
59
54
|
default: () => never[];
|
|
60
55
|
};
|
|
61
56
|
headerSlots: {
|
|
@@ -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
|
-
|
|
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
|
-
|
|
38
|
+
template(v-for="rowAction in props.rowActions" :key="rowAction.label")
|
|
39
|
+
KTooltip(
|
|
40
|
+
v-if="!rowAction.visible || rowAction.visible(row)"
|
|
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")
|
|
@@ -156,11 +170,18 @@ const isLoading = computed(() => {
|
|
|
156
170
|
width: 30px;
|
|
157
171
|
}
|
|
158
172
|
.rowAction {
|
|
159
|
-
width:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
173
|
+
width: 1%;
|
|
174
|
+
white-space: nowrap;
|
|
175
|
+
|
|
176
|
+
& > * {
|
|
177
|
+
display: inline-block;
|
|
178
|
+
margin-right: 10px;
|
|
179
|
+
vertical-align: middle;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
& > *:last-child {
|
|
183
|
+
margin-right: 0;
|
|
184
|
+
}
|
|
164
185
|
}
|
|
165
186
|
.footer {
|
|
166
187
|
display: flex;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ITreeViewColumn
|
|
1
|
+
import type { ITreeViewColumn } from '#toolkit/components/KTreeView/KTreeView.logic';
|
|
2
2
|
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
3
|
import type { IGanttTask } from '#toolkit/components/KGantt/KGantt.logic';
|
|
4
4
|
type __VLS_Props = {
|
|
@@ -6,7 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
columns: ITreeViewColumn[];
|
|
7
7
|
treeColumnIndex?: number;
|
|
8
8
|
bulkActions?: IKDatatableAction[];
|
|
9
|
-
rowActions?:
|
|
9
|
+
rowActions?: IKDatatableAction[];
|
|
10
10
|
globalDateRange: {
|
|
11
11
|
start: number;
|
|
12
12
|
end: number;
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
)
|
|
22
22
|
template(#cell-_ganttActions="{ row }")
|
|
23
23
|
.gantt-actions
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
template(v-for="rowAction in rowActions" :key="rowAction.label")
|
|
25
|
+
KButton(
|
|
26
|
+
v-if="!rowAction.visible || rowAction.visible(row)"
|
|
27
|
+
:type="rowAction.type || 'default'"
|
|
28
|
+
size="small"
|
|
29
|
+
@click="rowAction.action(row)"
|
|
30
|
+
) {{ rowAction.label }}
|
|
31
31
|
template(#header-ganttTimeline)
|
|
32
32
|
KGanttRuler(
|
|
33
33
|
:startMs="globalDateRange.start"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
import { computed, ref } from 'vue'
|
|
58
58
|
import KGanttRuler from './KGanttRuler.vue'
|
|
59
59
|
import KGanttTimeline from './KGanttTimeline.vue'
|
|
60
|
-
import type { ITreeViewColumn
|
|
60
|
+
import type { ITreeViewColumn } from '#toolkit/components/KTreeView/KTreeView.logic'
|
|
61
61
|
import type { IKDatatableAction } from '@katlux/providers'
|
|
62
62
|
import type { IGanttTask } from '#toolkit/components/KGantt/KGantt.logic'
|
|
63
63
|
import { getSnapMs, isTaskOverlapping, calculateGanttMinWidth } from '#toolkit/components/KGantt/KGantt.logic'
|
|
@@ -67,7 +67,7 @@ const props = defineProps<{
|
|
|
67
67
|
columns: ITreeViewColumn[]
|
|
68
68
|
treeColumnIndex?: number
|
|
69
69
|
bulkActions?: IKDatatableAction[]
|
|
70
|
-
rowActions?:
|
|
70
|
+
rowActions?: IKDatatableAction[]
|
|
71
71
|
|
|
72
72
|
globalDateRange: { start: number, end: number }
|
|
73
73
|
totalDuration: number
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ITreeViewColumn
|
|
1
|
+
import type { ITreeViewColumn } from '#toolkit/components/KTreeView/KTreeView.logic';
|
|
2
2
|
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
3
|
import type { IGanttTask } from '#toolkit/components/KGantt/KGantt.logic';
|
|
4
4
|
type __VLS_Props = {
|
|
@@ -6,7 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
columns: ITreeViewColumn[];
|
|
7
7
|
treeColumnIndex?: number;
|
|
8
8
|
bulkActions?: IKDatatableAction[];
|
|
9
|
-
rowActions?:
|
|
9
|
+
rowActions?: IKDatatableAction[];
|
|
10
10
|
globalDateRange: {
|
|
11
11
|
start: number;
|
|
12
12
|
end: number;
|
|
@@ -47,14 +47,15 @@ watch(internalWrapperRef, (newVal) => {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.KTooltip {
|
|
50
|
-
background-color: var(--
|
|
51
|
-
color: var(--
|
|
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-
|
|
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;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ITreeViewColumn
|
|
1
|
+
import type { ITreeViewColumn } from '../../../../components/KTreeView/KTreeView.logic.js';
|
|
2
2
|
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
dataProvider: any;
|
|
5
5
|
columns: ITreeViewColumn[];
|
|
6
6
|
treeColumnIndex?: number;
|
|
7
7
|
bulkActions?: IKDatatableAction[];
|
|
8
|
-
rowActions?:
|
|
8
|
+
rowActions?: IKDatatableAction[];
|
|
9
9
|
showCheckboxes: boolean;
|
|
10
10
|
selectedRows: any[];
|
|
11
11
|
selectAll: boolean;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<script lang="ts" setup>
|
|
25
25
|
import { computed } from 'vue'
|
|
26
26
|
import KTreeCell from './KTreeCell.vue'
|
|
27
|
-
import type { ITreeViewColumn
|
|
27
|
+
import type { ITreeViewColumn } from '../../../../components/KTreeView/KTreeView.logic'
|
|
28
28
|
import type { IKDatatableAction } from '@katlux/providers'
|
|
29
29
|
|
|
30
30
|
const props = defineProps<{
|
|
@@ -32,7 +32,7 @@ const props = defineProps<{
|
|
|
32
32
|
columns: ITreeViewColumn[]
|
|
33
33
|
treeColumnIndex?: number
|
|
34
34
|
bulkActions?: IKDatatableAction[]
|
|
35
|
-
rowActions?:
|
|
35
|
+
rowActions?: IKDatatableAction[]
|
|
36
36
|
showCheckboxes: boolean
|
|
37
37
|
selectedRows: any[]
|
|
38
38
|
selectAll: boolean
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ITreeViewColumn
|
|
1
|
+
import type { ITreeViewColumn } from '../../../../components/KTreeView/KTreeView.logic.js';
|
|
2
2
|
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
dataProvider: any;
|
|
5
5
|
columns: ITreeViewColumn[];
|
|
6
6
|
treeColumnIndex?: number;
|
|
7
7
|
bulkActions?: IKDatatableAction[];
|
|
8
|
-
rowActions?:
|
|
8
|
+
rowActions?: IKDatatableAction[];
|
|
9
9
|
showCheckboxes: boolean;
|
|
10
10
|
selectedRows: any[];
|
|
11
11
|
selectAll: boolean;
|