import { Input, InputObject, FloatLabelType, TextBox, InputEventArgs } from '@syncfusion/ej2-inputs';import { createCheckBox } from '@syncfusion/ej2-buttons';import { NotifyPropertyChanges, INotifyPropertyChanged, Property, Event, EmitType, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { Component, EventHandler, attributes, formatUnit, ChildProperty, remove, L10n, extend } from '@syncfusion/ej2-base';import { addClass, removeClass, detach, prepend, Complex, closest, setValue, getValue, compile, append } from '@syncfusion/ej2-base';import { select, selectAll, isNullOrUndefined as isNOU, matches, Browser, KeyboardEvents, KeyboardEventArgs } from '@syncfusion/ej2-base';import { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';import { Popup, isCollide } from '@syncfusion/ej2-popups';import { TreeView, NodeSelectEventArgs, DataBoundEventArgs, FieldsSettingsModel, NodeClickEventArgs } from '@syncfusion/ej2-navigations';import { NodeCheckEventArgs, FailureEventArgs} from '@syncfusion/ej2-navigations'; import {Mode,ExpandOn,TreeFilterType,SortOrder,DdtBeforeOpenEventArgs,DdtChangeEventArgs,DdtPopupEventArgs,DdtDataBoundEventArgs,DdtFilteringEventArgs,DdtFocusEventArgs,DdtKeyPressEventArgs,DdtSelectEventArgs} from "./drop-down-tree"; import {ComponentModel} from '@syncfusion/ej2-base'; /** * Interface for a class Fields */ export interface FieldsModel { /** * This field specifies the child items or mapping field for the nested child items that contains an array of JSON objects. */ child?: string | FieldsModel; /** * Specifies the array of JavaScript objects or instance of Data Manager to populate the dropdown tree items. * * @default [] */ dataSource?: DataManager | { [key: string]: Object }[]; /** * This fields specifies the mapping field to define the expanded state of a Dropdown tree item. */ expanded?: string; /** * This field specifies the mapping field to indicate whether the Dropdown tree item has children or not. */ hasChildren?: string; /** * Specifies the mapping field for htmlAttributes to be added to the Dropdown Tree item. */ htmlAttributes?: string; /** * Specifies the mapping field for icon class of each Dropdown Tree item that will be added before the text. */ iconCss?: string; /** * Specifies the mapping field for image URL of each Dropdown Tree item where image will be added before the text. */ imageUrl?: string; /** * Specifies the parent value field mapped in the data source. */ parentValue?: string; /** * Defines the external [`Query`](https://ej2.syncfusion.com/documentation/api/data/query/) * that will execute along with the data processing. * * @default null */ query?: Query; /** * Specifies whether the node can be selected by users or not * When set to false, the user interaction is prevented for the corresponding node. */ selectable?: string; /** * Specifies the mapping field for the selected state of the Dropdown Tree item. */ selected?: string; /** * Specifies the table name used to fetch data from a specific table in the server. */ tableName?: string; /** * Specifies the mapping field for text displayed as Dropdown Tree items display text. */ text?: string; /** * Specifies the mapping field for tooltip that will be displayed as hovering text of the Dropdown Tree item. */ tooltip?: string; /** * Specifies the value(ID) field mapped in the data source. */ value?: string; } /** * Interface for a class TreeSettings */ export interface TreeSettingsModel { /** * Specifies whether the child and parent tree items check states are dependent over each other when checkboxes are enabled. * * @default false */ autoCheck?: boolean; /** * Determines whether the disabled children will be checked or not if their parent is checked. * * @default true */ checkDisabledChildren?: boolean; /** * Specifies the action on which the parent items in the pop-up should expand or collapse. The available actions are * * `Auto` - In desktop, the expand or collapse operation happens when you double-click the node, * and in mobile devices it happens on single-tap. * * `Click` - The expand or collapse operation happens when you perform single-click/tap * on the pop-up item in both desktop and mobile devices. * * `DblClick` - The expand or collapse operation happens when you perform a double-click/tap * on the pop-up item in both desktop and mobile devices. * * `None` - The expand or collapse operation will not happen when you perform single-click/tap * or double-click/tap on the pop-up items in both desktop and mobile devices. * * @default 'Auto' */ expandOn?: ExpandOn; /** * By default, the load on demand (Lazy load) is set to false. * Enabling this property will render only the parent tree items in the popup and * the child items will be rendered on demand when expanding the corresponding parent node. * * @default false */ loadOnDemand?: boolean; } /** * Interface for a class DropDownTree */ export interface DropDownTreeModel extends ComponentModel{ /** * Specifies the template that renders to the popup list content of the * Dropdown Tree component when the data fetch request from the remote server fails. * * @default 'The Request Failed' * @aspType string */ actionFailureTemplate?: string | Function; /** * When allowFiltering is set to true, it shows the filter bar (search text box) of the component. * The filter action retrieves matched items through the **filtering** event based on the characters typed in the search text box. * If no match is found, the value of the **noRecordsTemplate** property will be displayed. * * @default false */ allowFiltering?: boolean; /** * Enables or disables the multi-selection of items. To select multiple items: * * Select the items by holding down the **Ctrl** key when clicking on the items. * * Select consecutive items by clicking the first item to select and hold down the **Shift** key and click the last item to select. * * @default false */ allowMultiSelection?: boolean; /** * By default, the Dropdown Tree component fires the change event while focusing out the component. * If you want to fire the change event on every value selection and remove, then disable this property. * * @default true */ changeOnBlur?: boolean; /** * Specifies the CSS classes to be added with the root and popup element of the Dropdown Tree component. * that allows customization of appearance. * * @default '' */ cssClass?: string; /** * This property is used to customize the display text of the selected items in the Dropdown Tree. The given custom template is * added to the input instead of the selected item text in the Dropdown Tree when the multi-selection or checkbox support is enabled. * * @default "${value.length} item(s) selected" * @aspType string */ customTemplate?: string | Function; /** * Defines the value separator character in the input element when multi-selection or checkbox is enabled in the Dropdown Tree. * The delimiter character is applicable only for **default** and **delimiter** visibility modes. * * @default "," */ delimiterChar?: string; /** * Specifies a value that indicates whether the Dropdown Tree component is enabled or not. * * @default true */ enabled?: boolean; /** * Specifies the data source and mapping fields to render Dropdown Tree items. * * @default {value: 'value', text: 'text', dataSource: [], child: 'child', parentValue: 'parentValue', hasChildren: 'hasChildren', * expanded: 'expanded', htmlAttributes: 'htmlAttributes', iconCss: 'iconCss', imageUrl: 'imageUrl', * query: null, selected: 'selected', selectable: 'selectable', tableName: null, tooltip: 'tooltip' } */ fields?: FieldsModel; /** * Accepts the value to be displayed as a watermark text on the filter bar. * * @default null */ filterBarPlaceholder?: string; /** * Determines on which filter type, the component needs to be considered on search action. * The **TreeFilterType** and its supported data types are, * *
| * TreeFilterType | * Description | * Supported Types |
|
* StartsWith |
* Checks whether a value begins with the specified value. |
* String |
|
* EndsWith |
* Checks whether a value ends with the specified value. |
* String |
|
* Contains |
* Checks whether a value contains with specified value. |
* String |