@xy-planning-network/trees 0.13.8 → 0.13.10-dev-1
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/trees.es.js +860 -856
- package/dist/trees.umd.js +8 -8
- package/package.json +2 -2
- package/src/lib-components/navigation/ActionsButtonGroup.vue +2 -2
- package/src/lib-components/navigation/ActionsDropdown.vue +3 -6
- package/types/composables/table.d.ts +2 -0
- package/types/composables/useActionItems.d.ts +12 -0
- package/types/composables/useTable.d.ts +6 -23
- package/types/lib-components/lists/DynamicTable.vue.d.ts +1 -1
- package/types/lib-components/lists/TableActionButtons.vue.d.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xy-planning-network/trees",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.10-dev-1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:xy-planning-network/trees",
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
"vue": "^3.5.12"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
|
-
"node": "
|
|
78
|
+
"node": "~24.15.0"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { ActionItems,
|
|
2
|
+
import { ActionItems, isActionItemLink } from "@/composables/nav"
|
|
3
3
|
import { computed } from "vue"
|
|
4
4
|
|
|
5
5
|
const props = withDefaults(
|
|
@@ -18,7 +18,7 @@ const actionItems = computed(() => {
|
|
|
18
18
|
return {
|
|
19
19
|
...a,
|
|
20
20
|
disabled: a.disabled ?? false,
|
|
21
|
-
kind:
|
|
21
|
+
kind: isActionItemLink(a) ? "link" : "button",
|
|
22
22
|
show: true,
|
|
23
23
|
onClick: a.onClick ? a.onClick : () => {},
|
|
24
24
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue"
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
EllipsisVerticalIcon,
|
|
6
|
-
} from "@heroicons/vue/solid"
|
|
7
|
-
import { isActionItemButton, type ActionItems } from "@/composables/nav"
|
|
3
|
+
import { ChevronDownIcon, EllipsisVerticalIcon } from "@heroicons/vue/solid"
|
|
4
|
+
import { isActionItemLink, type ActionItems } from "@/composables/nav"
|
|
8
5
|
import { computed, useTemplateRef } from "vue"
|
|
9
6
|
import { useFloating, autoUpdate, autoPlacement } from "@floating-ui/vue"
|
|
10
7
|
|
|
@@ -28,7 +25,7 @@ const actionItems = computed(() => {
|
|
|
28
25
|
return {
|
|
29
26
|
...a,
|
|
30
27
|
disabled: a.disabled ?? false,
|
|
31
|
-
kind:
|
|
28
|
+
kind: isActionItemLink(a) ? "link" : "button",
|
|
32
29
|
show: true,
|
|
33
30
|
onClick: a.onClick ? a.onClick : () => {},
|
|
34
31
|
}
|
|
@@ -65,6 +65,7 @@ export interface TableActionButton<T = TableRowData> {
|
|
|
65
65
|
*/
|
|
66
66
|
onClick: (rowData: T, rowIndex: number, tableAPI: DynamicTableAPI, e?: Event) => void;
|
|
67
67
|
}
|
|
68
|
+
export declare const isTableActionButton: (item: TableActionItem) => item is TableActionButton<TableRowData>;
|
|
68
69
|
/**
|
|
69
70
|
* TableActionLink determines the configuration for a link button within a table row.
|
|
70
71
|
* Visibility (`show`) and interactivity (`disabled`) can be toggled via static booleans
|
|
@@ -92,6 +93,7 @@ export interface TableActionLink<T = TableRowData> {
|
|
|
92
93
|
*/
|
|
93
94
|
onClick?: (rowData: T, rowIndex: number, tableAPI: DynamicTableAPI, e?: Event) => void;
|
|
94
95
|
}
|
|
96
|
+
export declare const isTableActionLink: (item: TableActionItem) => item is TableActionLink<TableRowData>;
|
|
95
97
|
/**
|
|
96
98
|
* TableBulkActionItem determines the configuration for a bulk action button on a table.
|
|
97
99
|
* Visibility (`show`) and interactivity (`disabled`) can be toggled via static booleans.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref } from "vue";
|
|
2
|
+
import { ActionItem } from "./nav";
|
|
3
|
+
export declare const useActionItems: (items: ActionItem[] | Ref<ActionItem[]>) => {
|
|
4
|
+
actions: import("vue").ComputedRef<{
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
show: boolean;
|
|
7
|
+
onClick: (...args: any[]) => void;
|
|
8
|
+
icon?: import("vue").RenderFunction | import("vue").FunctionalComponent<{}, {}, any, {}> | undefined;
|
|
9
|
+
label: string;
|
|
10
|
+
}[]>;
|
|
11
|
+
hasActions: import("vue").ComputedRef<boolean>;
|
|
12
|
+
};
|
|
@@ -1,44 +1,27 @@
|
|
|
1
1
|
import { Ref } from "vue";
|
|
2
2
|
import { TableColumns, TableRowsData, TableActions, DynamicTableAPI } from "./table";
|
|
3
|
+
import { ActionItemButton, ActionItemLink } from "../entry";
|
|
3
4
|
export declare const useTable: (rowData: TableRowsData | Ref<TableRowsData>, cols: TableColumns | Ref<TableColumns>, acts: TableActions | Ref<TableActions>, exposedAPI?: DynamicTableAPI) => {
|
|
4
5
|
columns: import("vue").ComputedRef<{
|
|
5
6
|
alignment: string;
|
|
6
|
-
classNames?: string | ((rowData: import("
|
|
7
|
+
classNames?: string | ((rowData: import("../entry").TableRowData, rowIndex: number) => string) | undefined;
|
|
7
8
|
title: string;
|
|
8
|
-
render: string | ((rowData: import("
|
|
9
|
+
render: string | ((rowData: import("../entry").TableRowData, rowIndex: number) => import("vue").VNodeChild);
|
|
9
10
|
show?: boolean | undefined;
|
|
10
11
|
sort?: string | undefined;
|
|
11
12
|
}[]>;
|
|
12
13
|
hasActions: import("vue").ComputedRef<boolean>;
|
|
13
14
|
isEmptyCellValue: (v: unknown) => boolean;
|
|
14
15
|
rows: import("vue").ComputedRef<{
|
|
15
|
-
actions: (
|
|
16
|
-
|
|
17
|
-
onClick: (e?: Event) => void | (() => void);
|
|
18
|
-
show: boolean | undefined;
|
|
19
|
-
url: string;
|
|
20
|
-
label: string;
|
|
21
|
-
attrs?: undefined;
|
|
22
|
-
icon?: import("vue").RenderFunction | import("vue").FunctionalComponent<{}, {}, any, {}> | undefined;
|
|
23
|
-
openInTab?: undefined;
|
|
24
|
-
} | {
|
|
25
|
-
disabled: boolean | undefined;
|
|
26
|
-
onClick: (e?: Event) => void | (() => void);
|
|
27
|
-
show: boolean | undefined;
|
|
28
|
-
url: string;
|
|
29
|
-
label: string;
|
|
30
|
-
attrs?: Record<string, string | number | boolean> | undefined;
|
|
31
|
-
icon?: import("vue").RenderFunction | import("vue").FunctionalComponent<{}, {}, any, {}> | undefined;
|
|
32
|
-
openInTab?: boolean | undefined;
|
|
33
|
-
})[];
|
|
34
|
-
rowData: import("./table").TableRowData;
|
|
16
|
+
actions: (ActionItemButton | ActionItemLink)[];
|
|
17
|
+
rowData: import("../entry").TableRowData;
|
|
35
18
|
cells: {
|
|
36
19
|
isComponent: boolean;
|
|
37
20
|
classNames: string;
|
|
38
21
|
val: any;
|
|
39
22
|
alignment: string;
|
|
40
23
|
title: string;
|
|
41
|
-
render: string | ((rowData: import("
|
|
24
|
+
render: string | ((rowData: import("../entry").TableRowData, rowIndex: number) => import("vue").VNodeChild);
|
|
42
25
|
show?: boolean | undefined;
|
|
43
26
|
sort?: string | undefined;
|
|
44
27
|
}[];
|
|
@@ -18,8 +18,8 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
18
18
|
} & {
|
|
19
19
|
"click:row": (v: any) => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
|
-
"onClick:row"?: ((v: any) => any) | undefined;
|
|
22
21
|
"onUpdate:selected"?: ((value: number[]) => any) | undefined;
|
|
22
|
+
"onClick:row"?: ((v: any) => any) | undefined;
|
|
23
23
|
}>, {
|
|
24
24
|
tableActions: TableActions<any>;
|
|
25
25
|
tableBulkActions: TableBulkActions<any>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableActionItem } from "../../composables";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
actions?: TableActionItem[];
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
+
actions: TableActionItem<import("../../composables").TableRowData>[];
|
|
7
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|