import { TreeQueryParams } from '@/services/tree.service'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; import { TreeNode } from 'v2/Tree/Tree.vue.d'; export type KeysModelValue = number[] | undefined; export interface ButtonSelectTreeProps { /** * Set custom query params for group tree. * * By default, query params has been determined by the path */ groupParams?: TreeQueryParams; /** * The keys model value. * Keys also be used as field value. If you deal with form validation of edit action, * you need to bind the initital keys :keys="yourKeys" */ keys?: KeysModelValue; disableKeys?: number[]; exactDisableKey?: number; /** * Disable node 'All' selection */ disableNodeAll?: boolean; /** * The selected tree nodes object model value. */ selectedNodes?: TreeNode[]; /** * Used for single selection model value. */ selectedNode?: TreeNode; /** * For checkbox selection, old behavior is preventing select if there is no node selected. * * This props comes to make options, wether the selection can be empty or not. * @default true */ allowEmptySelection?: boolean; /** * Set custom header Dialog Select Tree */ dialogHeader?: string; /** * The tree type. */ type: 'Group' | 'Category'; /** * The button label. * * @default 'Select ${props.type}' */ label?: string; /** * The field label */ fieldLabel?: string; /** * The selection Mode. * * @default 'checkbox'; */ selectionMode?: 'single' | 'checkbox'; /** * Wether the input should be validated with vee-validator or not. * If you use this component within form input, you need to set this props as true. */ useValidator?: boolean; /** * This prop is required if you use this component in a form input. * Specify the unique field name, match with your needs for API request. * * @default 'selectTree' */ fieldName?: string; /** * The information to be shown to user by hovering info icon. */ fieldInfo?: string; /** * Make this field as mandatory on form input. */ mandatory?: boolean; /** * Invalid state. */ invalid?: boolean; /** * Set custom validator message. * Will be show if invalid="true" */ validatorMessage?: string; /** * Defines width of button for 'Select Group' / 'Select Category' in px. */ btnWidth?: number; /** * Defines the tree is readonly and disabled. */ readonly?: boolean; /** * Defines the group tree to showing disposable groups. */ showDisposableGroups?: boolean; /** * Defines the tree to be flattened and shows disposable only */ flattenDisposableNode?: boolean; /** * Defines the group tree to disable excluded keys */ excludedKeys?: number[]; } export type ButtonSelectTreeEmits = { 'update:keys': [keys: KeysModelValue]; 'update:selectedNode': [node: TreeNode | undefined]; 'update:selectedNodes': [nodes: TreeNode[]]; 'dialogShown': []; 'dialogHidden': []; }; /** * **TSVue v2 - ButtonSelectTree** * * _ButtonSelectTree handles select tree dialog and field validaion._ * * --- --- * ![TSVue](https://ik.imagekit.io/kurniadev/TS-HEAD-BLACK.png) * * @group Component */ declare class ButtonSelectTree extends ClassComponent {} declare module '@vue/runtime-core' { interface GlobalComponents { ButtonSelectTree: GlobalComponentConstructor; } } export default ButtonSelectTree;