primevue-mirror/components/lib/organizationchart/OrganizationChart.d.ts

366 lines
9.5 KiB
TypeScript
Raw Normal View History

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';
import { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
2022-09-06 12:03:37 +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 {
/**
* Defines instance.
*/
2023-07-06 12:01:33 +00:00
instance: any;
/**
* Defines valid properties.
*/
2023-05-10 08:07:14 +00:00
props: OrganizationChartProps;
/**
* Defines current inline state.
*/
2023-05-10 08:07:14 +00:00
state: OrganizationChartState;
/**
* Defines current options.
*/
2023-05-10 08:07:14 +00:00
context: OrganizationChartContext;
/**
* Defines valid attributes.
*/
attrs: any;
/**
* 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 {
/**
* Used to pass attributes to the root's DOM element.
2023-05-10 08:07:14 +00:00
*/
root?: OrganizationChartPassThroughOptionType;
/**
* Used to pass attributes to the table's DOM element.
2023-05-10 08:07:14 +00:00
*/
table?: OrganizationChartPassThroughOptionType;
/**
* 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;
/**
* Used to pass attributes to the cell's DOM element.
2023-05-10 08:07:14 +00:00
*/
cell?: OrganizationChartPassThroughOptionType;
/**
* Used to pass attributes to the node's DOM element.
2023-05-10 08:07:14 +00:00
*/
node?: OrganizationChartPassThroughOptionType;
/**
* Used to pass attributes to the node toggle button's DOM element.
2023-05-10 08:07:14 +00:00
*/
nodeToggleButton?: OrganizationChartPassThroughOptionType;
2023-05-10 08:07:14 +00:00
/**
* Used to pass attributes to the node toggle button icon's DOM element.
2023-05-10 08:07:14 +00:00
*/
nodeToggleButtonIcon?: OrganizationChartPassThroughOptionType;
2023-05-10 08:07:14 +00:00
/**
* Used to pass attributes to the connectors's DOM element.
2023-05-10 08:07:14 +00:00
*/
connectors?: OrganizationChartPassThroughOptionType;
2023-05-10 08:07:14 +00:00
/**
* Used to pass attributes to the lineCell's DOM element.
2023-05-10 08:07:14 +00:00
*/
lineCell?: OrganizationChartPassThroughOptionType;
/**
* Used to pass attributes to the connector down's DOM element.
2023-05-10 08:07:14 +00:00
*/
connectorDown?: OrganizationChartPassThroughOptionType;
2023-05-10 08:07:14 +00:00
/**
* Used to pass attributes to the connector left's DOM element.
2023-05-10 08:07:14 +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
/**
* 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;
/**
* 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}
*/
pt?: PassThrough<OrganizationChartPassThroughOptions>;
2023-09-05 08:50:46 +00:00
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
/**
* 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[];
/**
* 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.
*/
2024-05-16 14:05:43 +00:00
export interface OrganizationChartEmitsOptions {
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
export declare type OrganizationChartEmits = EmitFn<OrganizationChartEmitsOptions>;
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
*
2023-03-01 11:45:44 +00:00
*/
declare const OrganizationChart: DefineComponent<OrganizationChartProps, OrganizationChartSlots, OrganizationChartEmits>;
2022-09-06 12:03:37 +00:00
declare module 'vue' {
export interface GlobalComponents {
OrganizationChart: GlobalComponentConstructor<OrganizationChartProps, OrganizationChartSlots, OrganizationChartEmits>;
2022-09-06 12:03:37 +00:00
}
}
export default OrganizationChart;