2023-03-01 11:45:44 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* OrganizationChart visualizes hierarchical organization data.
|
|
|
|
*
|
2023-03-02 09:53:55 +00:00
|
|
|
* [Live Demo](https://primevue.org/organizationchart)
|
2023-03-01 11:45:44 +00:00
|
|
|
*
|
|
|
|
* @module organizationchart
|
2023-03-02 09:53:55 +00:00
|
|
|
*
|
2023-03-01 11:45:44 +00:00
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
2023-07-06 11:17:08 +00:00
|
|
|
import { ComponentHooks } from '../basecomponent';
|
2023-09-05 08:50:46 +00:00
|
|
|
import { PassThroughOptions } from '../passthrough';
|
2024-04-02 08:24:31 +00:00
|
|
|
import { ClassComponent, DesignToken, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-07-11 22:42:43 +00:00
|
|
|
export declare type OrganizationChartPassThroughOptionType = OrganizationChartPassThroughAttributes | ((options: OrganizationChartPassThroughMethodOptions) => OrganizationChartPassThroughAttributes | string) | string | null | undefined;
|
2023-05-10 08:07:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface OrganizationChartPassThroughMethodOptions {
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines instance.
|
|
|
|
*/
|
2023-07-06 12:01:33 +00:00
|
|
|
instance: any;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
2023-05-10 08:07:14 +00:00
|
|
|
props: OrganizationChartProps;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines current inline state.
|
|
|
|
*/
|
2023-05-10 08:07:14 +00:00
|
|
|
state: OrganizationChartState;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines current options.
|
|
|
|
*/
|
2023-05-10 08:07:14 +00:00
|
|
|
context: OrganizationChartContext;
|
2023-12-10 21:41:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid attributes.
|
|
|
|
*/
|
|
|
|
attrs: any;
|
2023-12-05 11:06:32 +00:00
|
|
|
/**
|
|
|
|
* Defines parent options.
|
|
|
|
*/
|
|
|
|
parent: any;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Defines passthrough(pt) options in global config.
|
|
|
|
*/
|
|
|
|
global: object | undefined;
|
2023-05-10 08:07:14 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 11:45:44 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in OrganizationChartNode.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface OrganizationChartNode {
|
|
|
|
/**
|
|
|
|
* Unique identifier of the node. (required)
|
|
|
|
*/
|
|
|
|
key: any;
|
|
|
|
/**
|
|
|
|
* Type of the node to match a template.
|
|
|
|
*/
|
|
|
|
type?: string;
|
|
|
|
/**
|
|
|
|
* Style class of the node content.
|
|
|
|
*/
|
|
|
|
styleClass?: string;
|
|
|
|
/**
|
|
|
|
* Data represented by the node.
|
|
|
|
*/
|
|
|
|
data?: any;
|
|
|
|
/**
|
|
|
|
* Whether node is selectable when selection is enabled.
|
2023-03-10 14:00:58 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
selectable?: boolean;
|
|
|
|
/**
|
|
|
|
* Whether node is collapsible when node expansion is enabled.
|
2023-03-10 14:00:58 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
collapsible?: boolean;
|
|
|
|
/**
|
|
|
|
* Children nodes array.
|
|
|
|
*/
|
|
|
|
children?: OrganizationChartNode[];
|
|
|
|
/**
|
|
|
|
* Optional keys
|
|
|
|
*/
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OrganizationChartSelectionKeys {
|
|
|
|
/**
|
|
|
|
* Optional keys
|
|
|
|
*/
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OrganizationChartCollapsedKeys {
|
|
|
|
/**
|
|
|
|
* Optional keys
|
|
|
|
*/
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
2023-05-10 08:07:14 +00:00
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link OrganizationChartProps.pt}
|
|
|
|
*/
|
|
|
|
export interface OrganizationChartPassThroughOptions {
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
|
|
|
root?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the table's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
|
|
|
table?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the body's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
|
|
|
body?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the row' DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
|
|
|
row?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the cell's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
|
|
|
cell?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the node's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
|
|
|
node?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
2024-05-02 06:27:51 +00:00
|
|
|
* Used to pass attributes to the node toggle button's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
2024-05-02 06:27:51 +00:00
|
|
|
nodeToggleButton?: OrganizationChartPassThroughOptionType;
|
2023-05-10 08:07:14 +00:00
|
|
|
/**
|
2024-05-02 06:27:51 +00:00
|
|
|
* Used to pass attributes to the node toggle button icon's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
2024-05-02 06:27:51 +00:00
|
|
|
nodeToggleButtonIcon?: OrganizationChartPassThroughOptionType;
|
2023-05-10 08:07:14 +00:00
|
|
|
/**
|
2024-05-02 06:27:51 +00:00
|
|
|
* Used to pass attributes to the connectors's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
2024-05-02 06:27:51 +00:00
|
|
|
connectors?: OrganizationChartPassThroughOptionType;
|
2023-05-10 08:07:14 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the lineCell's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
|
|
|
lineCell?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
2024-05-02 06:27:51 +00:00
|
|
|
* Used to pass attributes to the connector down's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
2024-05-02 06:27:51 +00:00
|
|
|
connectorDown?: OrganizationChartPassThroughOptionType;
|
2023-05-10 08:07:14 +00:00
|
|
|
/**
|
2024-05-02 06:27:51 +00:00
|
|
|
* Used to pass attributes to the connector left's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
2024-05-02 06:27:51 +00:00
|
|
|
connectorLeft?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Used to pass attributes to the connector right's DOM element.
|
|
|
|
*/
|
|
|
|
connectorRight?: OrganizationChartPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Used to pass attributes to the node children's DOM element.
|
|
|
|
*/
|
|
|
|
nodeChildren?: OrganizationChartPassThroughOptionType;
|
2023-05-10 08:07:14 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the nodeCell's DOM element.
|
2023-05-10 08:07:14 +00:00
|
|
|
*/
|
|
|
|
nodeCell?: OrganizationChartPassThroughOptionType;
|
2023-07-06 11:09:01 +00:00
|
|
|
/**
|
2023-11-07 06:16:39 +00:00
|
|
|
* Used to manage all lifecycle hooks.
|
2023-07-06 11:09:01 +00:00
|
|
|
* @see {@link BaseComponent.ComponentHooks}
|
|
|
|
*/
|
|
|
|
hooks?: ComponentHooks;
|
2023-05-10 08:07:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface OrganizationChartPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines current inline state in OrganizationChart component.
|
|
|
|
*/
|
|
|
|
export interface OrganizationChartState {
|
|
|
|
/**
|
|
|
|
* Current collapsed keys' state.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
d_collapsedKeys: OrganizationChartCollapsedKeys;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines current options in OrganizationChart component.
|
|
|
|
*/
|
|
|
|
export interface OrganizationChartContext {
|
|
|
|
/**
|
|
|
|
* Current focus expanded of the node as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
expanded: boolean;
|
|
|
|
/**
|
|
|
|
* Current selectable state of the node as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
selectable: boolean;
|
|
|
|
/**
|
|
|
|
* Current selection state of the node as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
selected: boolean;
|
|
|
|
/**
|
|
|
|
* Current toggleable state of the node as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
toggleable: boolean;
|
|
|
|
/**
|
|
|
|
* Current active state of the node as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
active: boolean;
|
|
|
|
/**
|
|
|
|
* Current being top line state of the node as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
lineTop: boolean;
|
|
|
|
}
|
|
|
|
|
2023-03-01 11:45:44 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in OrganizationChart component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface OrganizationChartProps {
|
|
|
|
/**
|
|
|
|
* Value of the component.
|
|
|
|
*/
|
|
|
|
value?: OrganizationChartNode;
|
|
|
|
/**
|
|
|
|
* A map instance of key-value pairs to represented the selected nodes.
|
|
|
|
*/
|
|
|
|
selectionKeys?: OrganizationChartSelectionKeys;
|
|
|
|
/**
|
|
|
|
* Type of the selection.
|
|
|
|
*/
|
2023-03-01 11:45:44 +00:00
|
|
|
selectionMode?: 'single' | 'multiple' | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* A map instance of key-value pairs to represented the collapsed nodes.
|
|
|
|
*/
|
|
|
|
collapsedKeys?: OrganizationChartCollapsedKeys;
|
|
|
|
/**
|
|
|
|
* Whether the nodes can be expanded or toggled.
|
2023-03-10 14:00:58 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
collapsible?: boolean;
|
2024-04-02 08:24:31 +00:00
|
|
|
/**
|
|
|
|
* It generates scoped CSS variables using design tokens for the component.
|
|
|
|
*/
|
|
|
|
dt?: DesignToken<any>;
|
2023-05-10 08:07:14 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-05-10 08:07:14 +00:00
|
|
|
* @type {OrganizationChartPassThroughOptions}
|
|
|
|
*/
|
2023-09-05 11:28:04 +00:00
|
|
|
pt?: PassThrough<OrganizationChartPassThroughOptions>;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Used to configure passthrough(pt) options of the component.
|
|
|
|
* @type {PassThroughOptions}
|
|
|
|
*/
|
|
|
|
ptOptions?: PassThroughOptions;
|
2023-06-01 21:51:07 +00:00
|
|
|
/**
|
|
|
|
* When enabled, it removes component related styles in the core.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
unstyled?: boolean;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 11:45:44 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in OrganizationChart component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface OrganizationChartSlots {
|
|
|
|
/**
|
|
|
|
* Custom content template.
|
|
|
|
*/
|
2023-10-11 08:59:22 +00:00
|
|
|
default(scope: {
|
|
|
|
/**
|
|
|
|
* Current node
|
|
|
|
*/
|
|
|
|
node: any;
|
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Dynamic content template.
|
2023-03-01 11:45:44 +00:00
|
|
|
* @todo
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-07 13:40:44 +00:00
|
|
|
[key: string]: (node: any) => VNode[];
|
2023-04-07 06:49:35 +00:00
|
|
|
/**
|
|
|
|
* Custom toggler icon template.
|
|
|
|
* @param {Object} scope - togglericon slot's params.
|
|
|
|
*/
|
|
|
|
togglericon(scope: {
|
|
|
|
/**
|
|
|
|
* Curent state of the node
|
|
|
|
*/
|
|
|
|
expanded: boolean;
|
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 11:45:44 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in OrganizationChart component.
|
|
|
|
*/
|
|
|
|
export interface OrganizationChartEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the value changes.
|
|
|
|
* @param {*} value - New value.
|
|
|
|
*/
|
2023-03-01 11:45:44 +00:00
|
|
|
'update:selectionKeys'(value: any): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the value changes.
|
|
|
|
* @param {boolean} value - New value.
|
|
|
|
*/
|
2023-03-01 11:45:44 +00:00
|
|
|
'update:collapsedKeys'(value: boolean): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when a suggestion is selected.
|
|
|
|
* @param {OrganizationChartNode} node - Node instance.
|
|
|
|
*/
|
2023-03-01 11:45:44 +00:00
|
|
|
'node-select'(node: OrganizationChartNode): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when a node is unselected.
|
|
|
|
* @param {OrganizationChartNode} node - Node instance.
|
|
|
|
*/
|
2023-03-01 11:45:44 +00:00
|
|
|
'node-unselect'(node: OrganizationChartNode): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when a node is expanded.
|
|
|
|
* @param {OrganizationChartNode} node - Node instance.
|
|
|
|
*/
|
2023-03-01 11:45:44 +00:00
|
|
|
'node-expand'(node: OrganizationChartNode): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when a node is collapsed.
|
|
|
|
* @param {OrganizationChartNode} node - Node instance.
|
|
|
|
*/
|
2023-03-01 11:45:44 +00:00
|
|
|
'node-collapsed'(node: OrganizationChartNode): void;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 11:45:44 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - OrganizationChart**
|
|
|
|
*
|
|
|
|
* _OrganizationChart visualizes hierarchical organization data._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/organizationchart/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class OrganizationChart extends ClassComponent<OrganizationChartProps, OrganizationChartSlots, OrganizationChartEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-03-14 22:58:11 +00:00
|
|
|
declare module 'vue' {
|
|
|
|
export interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
OrganizationChart: GlobalComponentConstructor<OrganizationChart>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default OrganizationChart;
|