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

167 lines
4.0 KiB
TypeScript
Raw Normal View History

2023-03-01 11:45:44 +00:00
/**
*
* OrganizationChart visualizes hierarchical organization data.
*@todo
* Helper API:
*
* - OrganizationChartNode
*
* - [Live Demo](https://www.primefaces.org/primevue/organizationchart)
*
* @module organizationchart
*/
2022-09-06 12:03:37 +00:00
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
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.
* Default value is true.
*/
selectable?: boolean;
/**
* Whether node is collapsible when node expansion is enabled.
* Default value is true.
*/
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-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.
*/
collapsible?: boolean;
}
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-01 11:45:44 +00:00
// [key: string](node: any): 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;