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

315 lines
8.1 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';
2022-09-06 12:03:37 +00:00
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
2023-05-10 08:07:14 +00:00
export declare type OrganizationChartPassThroughOptionType = OrganizationChartPassThroughAttributes | ((options: OrganizationChartPassThroughMethodOptions) => OrganizationChartPassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface OrganizationChartPassThroughMethodOptions {
props: OrganizationChartProps;
state: OrganizationChartState;
context: OrganizationChartContext;
}
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 {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the table's DOM element.
*/
table?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the body's DOM element.
*/
body?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the row' DOM element.
*/
row?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the cell's DOM element.
*/
cell?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the node's DOM element.
*/
node?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the nodeToggler's DOM element.
*/
nodeToggler?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the nodeTogglerIcon's DOM element.
*/
nodeTogglerIcon?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the lines's DOM element.
*/
lines?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the lineCell's DOM element.
*/
lineCell?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the lineDown's DOM element.
*/
lineDown?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the nodes's DOM element.
*/
nodes?: OrganizationChartPassThroughOptionType;
/**
* Uses to pass attributes to the nodeCell's DOM element.
*/
nodeCell?: OrganizationChartPassThroughOptionType;
2023-07-06 11:09:01 +00:00
/**
* Uses to manage all lifecycle hooks
* @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;
2023-05-10 08:07:14 +00:00
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {OrganizationChartPassThroughOptions}
*/
pt?: OrganizationChartPassThroughOptions;
/**
* 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-03-01 11:45:44 +00:00
default(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.
*/
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
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
OrganizationChart: GlobalComponentConstructor<OrganizationChart>;
2022-09-06 12:03:37 +00:00
}
}
export default OrganizationChart;