@citruslime/ui 3.0.3-beta.8 → 3.0.3

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.
@@ -21,3 +21,4 @@ export * from './input-v2';
21
21
  export * from './toggle';
22
22
  export * from './select';
23
23
  export * from './menu';
24
+ export * from './tree-list';
@@ -0,0 +1,66 @@
1
+ import type { SlotProps, TreeNode } from './types';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
+ selectedPath: {
4
+ required: true;
5
+ type: import("vue").PropType<string | null>;
6
+ };
7
+ idPrefix: {
8
+ type: import("vue").PropType<string>;
9
+ required: true;
10
+ };
11
+ depth: {
12
+ type: import("vue").PropType<number>;
13
+ required: true;
14
+ };
15
+ breadth: {
16
+ type: import("vue").PropType<number>;
17
+ required: true;
18
+ };
19
+ pathFragments: {
20
+ type: import("vue").PropType<string[]>;
21
+ required: true;
22
+ };
23
+ rootNode: {
24
+ type: import("vue").PropType<TreeNode>;
25
+ required: true;
26
+ };
27
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
+ "update:selectedPath": (selectedPath: string | null) => void;
29
+ "recalculate-tree-path": () => void;
30
+ "set-child-node-height": (args_0: number) => void;
31
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
32
+ selectedPath: {
33
+ required: true;
34
+ type: import("vue").PropType<string | null>;
35
+ };
36
+ idPrefix: {
37
+ type: import("vue").PropType<string>;
38
+ required: true;
39
+ };
40
+ depth: {
41
+ type: import("vue").PropType<number>;
42
+ required: true;
43
+ };
44
+ breadth: {
45
+ type: import("vue").PropType<number>;
46
+ required: true;
47
+ };
48
+ pathFragments: {
49
+ type: import("vue").PropType<string[]>;
50
+ required: true;
51
+ };
52
+ rootNode: {
53
+ type: import("vue").PropType<TreeNode>;
54
+ required: true;
55
+ };
56
+ }>> & {
57
+ "onRecalculate-tree-path"?: (() => any) | undefined;
58
+ "onSet-child-node-height"?: ((args_0: number) => any) | undefined;
59
+ "onUpdate:selectedPath"?: ((selectedPath: string | null) => any) | undefined;
60
+ }, {}, {}>, Readonly<Record<string, (props: SlotProps) => void>> & Record<string, (props: SlotProps) => void>>;
61
+ export default _default;
62
+ type __VLS_WithTemplateSlots<T, S> = T & {
63
+ new (): {
64
+ $slots: S;
65
+ };
66
+ };
@@ -0,0 +1,15 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
+ branchesAt: (number | string)[];
3
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
4
+ branchesAt: (number | string)[];
5
+ }>>>, {}, {}>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToOption<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
@@ -0,0 +1,53 @@
1
+ import type { SlotProps, TreeNode } from './types';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
3
+ idPrefix: string;
4
+ rootNodes: TreeNode[];
5
+ allowSelect?: boolean | undefined;
6
+ allowDeselect?: boolean | undefined;
7
+ highlightSelectedDescendants?: boolean | undefined;
8
+ }>, {
9
+ allowSelect: boolean;
10
+ allowDeselect: boolean;
11
+ highlightSelectedDescendants: boolean;
12
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ select: (args_0: TreeNode | null) => void;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
15
+ idPrefix: string;
16
+ rootNodes: TreeNode[];
17
+ allowSelect?: boolean | undefined;
18
+ allowDeselect?: boolean | undefined;
19
+ highlightSelectedDescendants?: boolean | undefined;
20
+ }>, {
21
+ allowSelect: boolean;
22
+ allowDeselect: boolean;
23
+ highlightSelectedDescendants: boolean;
24
+ }>>> & {
25
+ onSelect?: ((args_0: TreeNode | null) => any) | undefined;
26
+ }, {
27
+ allowSelect: boolean;
28
+ allowDeselect: boolean;
29
+ highlightSelectedDescendants: boolean;
30
+ }, {}>, Readonly<Record<string, (props: SlotProps) => void>> & Record<string, (props: SlotProps) => void>>;
31
+ export default _default;
32
+ type __VLS_WithDefaults<P, D> = {
33
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
34
+ default: D[K];
35
+ }> : P[K];
36
+ };
37
+ type __VLS_Prettify<T> = {
38
+ [K in keyof T]: T[K];
39
+ } & {};
40
+ type __VLS_WithTemplateSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
45
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
46
+ type __VLS_TypePropsToOption<T> = {
47
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
48
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
49
+ } : {
50
+ type: import('vue').PropType<T[K]>;
51
+ required: true;
52
+ };
53
+ };
@@ -0,0 +1,2 @@
1
+ export { default as clUiTreeList } from './cl-ui-tree-list.vue';
2
+ export type * from './types';
@@ -0,0 +1,17 @@
1
+ import type { MaybeRef } from 'vue';
2
+ export type TreeNode = {
3
+ id: string;
4
+ slotName?: string;
5
+ children?: TreeNode[];
6
+ expanded?: MaybeRef<boolean>;
7
+ metadata?: unknown;
8
+ };
9
+ export type SlotProps = {
10
+ node: TreeNode;
11
+ path: string;
12
+ depth: number;
13
+ breadth: number;
14
+ isSelected: boolean;
15
+ isExpanded: boolean;
16
+ expand: (expand: boolean) => void;
17
+ };
@@ -0,0 +1,16 @@
1
+ import type { TreeNode } from './types';
2
+ /**
3
+ * Creates a path string from the given fragments.
4
+ *
5
+ * @param fragments The fragments to concatenate.
6
+ * @returns The path.
7
+ */
8
+ export declare function concatenatePath(...fragments: string[]): string;
9
+ /**
10
+ * Finds a node by its path.
11
+ *
12
+ * @param rootNodes The root nodes to search from.
13
+ * @param path The path of the node.
14
+ * @returns The node, or `null` if it could not be found.
15
+ */
16
+ export declare function findNodeByPath(rootNodes: TreeNode[], path: string): TreeNode | null;