UNPKG

smart-webcomponents-react

Version:

[![Price](https://img.shields.io/badge/price-COMMERCIAL-00JS8f7.svg)](https://jqwidgets.com/license/)

1,102 lines (1,096 loc) 62.3 kB
"use client"; import '../source/modules/smart.listbox' if(typeof window !== 'undefined') { if (!window['Smart']) { window['Smart'] = { RenderMode: 'manual' }; } else { window['Smart'].RenderMode = 'manual'; } //require('../source/modules/smart.listbox'); } import React from 'react'; import ReactDOM from 'react-dom/client'; let Smart$2; if (typeof window !== "undefined") { Smart$2 = window.Smart; } /** Defines a list item for ListBox, ComboBox, DropDownList. */ class ListItem extends React.Component { // Gets the id of the React component. get id() { if (!this._id) { this._id = 'ListItem' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); } return this._id; } /** * Property type: number */ get alternationIndex() { return this.nativeElement ? this.nativeElement.alternationIndex : undefined; } set alternationIndex(value) { if (this.nativeElement) { this.nativeElement.alternationIndex = value; } } /** * Property type: string */ get color() { return this.nativeElement ? this.nativeElement.color : undefined; } set color(value) { if (this.nativeElement) { this.nativeElement.color = value; } } /** * Property type: ListItemDisplayMode | string */ get displayMode() { return this.nativeElement ? this.nativeElement.displayMode : undefined; } set displayMode(value) { if (this.nativeElement) { this.nativeElement.displayMode = value; } } /** * Property type: boolean */ get grouped() { return this.nativeElement ? this.nativeElement.grouped : undefined; } set grouped(value) { if (this.nativeElement) { this.nativeElement.grouped = value; } } /** * Property type: boolean */ get selected() { return this.nativeElement ? this.nativeElement.selected : undefined; } set selected(value) { if (this.nativeElement) { this.nativeElement.selected = value; } } /** * Property type: string */ get value() { return this.nativeElement ? this.nativeElement.value : undefined; } set value(value) { if (this.nativeElement) { this.nativeElement.value = value; } } /** * Property type: string */ get label() { return this.nativeElement ? this.nativeElement.label : undefined; } set label(value) { if (this.nativeElement) { this.nativeElement.label = value; } } /** * Property type: string */ get details() { return this.nativeElement ? this.nativeElement.details : undefined; } set details(value) { if (this.nativeElement) { this.nativeElement.details = value; } } /** * Property type: string */ get group() { return this.nativeElement ? this.nativeElement.group : undefined; } set group(value) { if (this.nativeElement) { this.nativeElement.group = value; } } /** * Property type: boolean */ get hidden() { return this.nativeElement ? this.nativeElement.hidden : undefined; } set hidden(value) { if (this.nativeElement) { this.nativeElement.hidden = value; } } /** * Property type: boolean */ get readonly() { return this.nativeElement ? this.nativeElement.readonly : undefined; } set readonly(value) { if (this.nativeElement) { this.nativeElement.readonly = value; } } // Gets the properties of the React component. get properties() { return ["alternationIndex", "color", "displayMode", "grouped", "selected", "value", "label", "details", "group", "hidden", "readonly"]; } // Gets the events of the React component. get eventListeners() { return ["onCreate", "onReady"]; } constructor(props) { super(props); this.componentRef = React.createRef(); } componentDidRender(initialize) { const that = this; const props = {}; const events = {}; let styles = null; const stringifyCircularJSON = (obj) => { const seen = new WeakSet(); return JSON.stringify(obj, (k, v) => { if (v !== null && typeof v === 'object') { if (seen.has(v)) return; seen.add(v); } if (k === 'Smart') { return v; } return v; }); }; for (let prop in that.props) { if (prop === 'children') { continue; } if (prop === 'style') { styles = that.props[prop]; continue; } if (prop.startsWith('on') && that.properties.indexOf(prop) === -1) { events[prop] = that.props[prop]; continue; } props[prop] = that.props[prop]; } if (initialize) { that.nativeElement = this.componentRef.current; that.nativeElement.React = React; that.nativeElement.ReactDOM = ReactDOM; if (that.nativeElement && !that.nativeElement.isCompleted) { that.nativeElement.reactStateProps = JSON.parse(stringifyCircularJSON(props)); } } if (initialize && that.nativeElement && that.nativeElement.isCompleted) { // return; } for (let prop in props) { if (prop === 'class' || prop === 'className') { const classNames = props[prop].trim().split(' '); if (that.nativeElement._classNames) { const oldClassNames = that.nativeElement._classNames; for (let className in oldClassNames) { if (that.nativeElement.classList.contains(oldClassNames[className]) && oldClassNames[className] !== "") { that.nativeElement.classList.remove(oldClassNames[className]); } } } that.nativeElement._classNames = classNames; for (let className in classNames) { if (!that.nativeElement.classList.contains(classNames[className]) && classNames[className] !== "") { that.nativeElement.classList.add(classNames[className]); } } continue; } if (props[prop] !== that.nativeElement[prop]) { const normalizeProp = (str) => { return str.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); }; if (prop === 'hover' || prop === 'active' || prop === 'focus' || prop === 'selected') { that.nativeElement.setAttribute(prop, ''); } const normalizedProp = normalizeProp(prop); if (that.nativeElement[normalizedProp] === undefined) { that.nativeElement.setAttribute(prop, props[prop]); } if (props[prop] !== undefined) { if (typeof props[prop] === 'object' && that.nativeElement.reactStateProps && !initialize) { if (stringifyCircularJSON(props[prop]) === stringifyCircularJSON(that.nativeElement.reactStateProps[normalizedProp])) { continue; } } that.nativeElement[normalizedProp] = props[prop]; } } } for (let eventName in events) { that[eventName] = events[eventName]; that.nativeElement[eventName.toLowerCase()] = events[eventName]; } if (initialize) { if (that.onCreate) { that.onCreate(); } that.nativeElement.whenRendered(() => { if (that.onReady) { that.onReady(); } }); } // setup styles. if (styles) { for (let styleName in styles) { that.nativeElement.style[styleName] = styles[styleName]; } } } componentDidMount() { this.componentDidRender(true); } componentDidUpdate() { this.componentDidRender(false); } componentWillUnmount() { const that = this; if (!that.nativeElement) { return; } that.nativeElement.whenRenderedCallbacks = []; for (let i = 0; i < that.eventListeners.length; i++) { const eventName = that.eventListeners[i]; that.nativeElement.removeEventListener(eventName.substring(2).toLowerCase(), that[eventName]); } } render() { return (React.createElement("smart-list-item", { ref: this.componentRef, suppressHydrationWarning: true }, this.props.children)); } } let Smart$1; if (typeof window !== "undefined") { Smart$1 = window.Smart; } /** Defines a group of list items. */ class ListItemsGroup extends React.Component { // Gets the id of the React component. get id() { if (!this._id) { this._id = 'ListItemsGroup' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); } return this._id; } /** * Property type: string */ get label() { return this.nativeElement ? this.nativeElement.label : undefined; } set label(value) { if (this.nativeElement) { this.nativeElement.label = value; } } // Gets the properties of the React component. get properties() { return ["label"]; } // Gets the events of the React component. get eventListeners() { return ["onCreate", "onReady"]; } constructor(props) { super(props); this.componentRef = React.createRef(); } componentDidRender(initialize) { const that = this; const props = {}; const events = {}; let styles = null; const stringifyCircularJSON = (obj) => { const seen = new WeakSet(); return JSON.stringify(obj, (k, v) => { if (v !== null && typeof v === 'object') { if (seen.has(v)) return; seen.add(v); } if (k === 'Smart') { return v; } return v; }); }; for (let prop in that.props) { if (prop === 'children') { continue; } if (prop === 'style') { styles = that.props[prop]; continue; } if (prop.startsWith('on') && that.properties.indexOf(prop) === -1) { events[prop] = that.props[prop]; continue; } props[prop] = that.props[prop]; } if (initialize) { that.nativeElement = this.componentRef.current; that.nativeElement.React = React; that.nativeElement.ReactDOM = ReactDOM; if (that.nativeElement && !that.nativeElement.isCompleted) { that.nativeElement.reactStateProps = JSON.parse(stringifyCircularJSON(props)); } } if (initialize && that.nativeElement && that.nativeElement.isCompleted) { // return; } for (let prop in props) { if (prop === 'class' || prop === 'className') { const classNames = props[prop].trim().split(' '); if (that.nativeElement._classNames) { const oldClassNames = that.nativeElement._classNames; for (let className in oldClassNames) { if (that.nativeElement.classList.contains(oldClassNames[className]) && oldClassNames[className] !== "") { that.nativeElement.classList.remove(oldClassNames[className]); } } } that.nativeElement._classNames = classNames; for (let className in classNames) { if (!that.nativeElement.classList.contains(classNames[className]) && classNames[className] !== "") { that.nativeElement.classList.add(classNames[className]); } } continue; } if (props[prop] !== that.nativeElement[prop]) { const normalizeProp = (str) => { return str.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); }; if (prop === 'hover' || prop === 'active' || prop === 'focus' || prop === 'selected') { that.nativeElement.setAttribute(prop, ''); } const normalizedProp = normalizeProp(prop); if (that.nativeElement[normalizedProp] === undefined) { that.nativeElement.setAttribute(prop, props[prop]); } if (props[prop] !== undefined) { if (typeof props[prop] === 'object' && that.nativeElement.reactStateProps && !initialize) { if (stringifyCircularJSON(props[prop]) === stringifyCircularJSON(that.nativeElement.reactStateProps[normalizedProp])) { continue; } } that.nativeElement[normalizedProp] = props[prop]; } } } for (let eventName in events) { that[eventName] = events[eventName]; that.nativeElement[eventName.toLowerCase()] = events[eventName]; } if (initialize) { if (that.onCreate) { that.onCreate(); } that.nativeElement.whenRendered(() => { if (that.onReady) { that.onReady(); } }); } // setup styles. if (styles) { for (let styleName in styles) { that.nativeElement.style[styleName] = styles[styleName]; } } } componentDidMount() { this.componentDidRender(true); } componentDidUpdate() { this.componentDidRender(false); } componentWillUnmount() { const that = this; if (!that.nativeElement) { return; } that.nativeElement.whenRenderedCallbacks = []; for (let i = 0; i < that.eventListeners.length; i++) { const eventName = that.eventListeners[i]; that.nativeElement.removeEventListener(eventName.substring(2).toLowerCase(), that[eventName]); } } render() { return (React.createElement("smart-list-items-group", { ref: this.componentRef, suppressHydrationWarning: true }, this.props.children)); } } let Smart; if (typeof window !== "undefined") { Smart = window.Smart; } /** ListBox allows the user to select one or more items from a list. */ class ListBox extends React.Component { // Gets the id of the React component. get id() { if (!this._id) { this._id = 'ListBox' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); } return this._id; } /** Controls whether users can drag items out of the List box. When enabled, users can drag and move list items, except for those marked as disabled. Disabled items remain fixed and cannot be dragged or moved by the user. * Property type: boolean */ get allowDrag() { return this.nativeElement ? this.nativeElement.allowDrag : undefined; } set allowDrag(value) { if (this.nativeElement) { this.nativeElement.allowDrag = value; } } /** Controls whether users can drag and drop list items into the target ListBox. When enabled, items can be dropped into the ListBox; when disabled, dropping items is not permitted. * Property type: boolean */ get allowDrop() { return this.nativeElement ? this.nativeElement.allowDrop : undefined; } set allowDrop(value) { if (this.nativeElement) { this.nativeElement.allowDrop = value; } } /** Specifies how many times the row colors alternate, controlling the pattern and frequency of color changes applied to rows in a table or list. This helps customize the visual distinction between adjacent rows. * Property type: number */ get alternationCount() { return this.nativeElement ? this.nativeElement.alternationCount : undefined; } set alternationCount(value) { if (this.nativeElement) { this.nativeElement.alternationCount = value; } } /** Specifies the last row index up to which alternating row colors are applied. Rows after this index will no longer display color alternations. * Property type: number */ get alternationEnd() { return this.nativeElement ? this.nativeElement.alternationEnd : undefined; } set alternationEnd(value) { if (this.nativeElement) { this.nativeElement.alternationEnd = value; } } /** Specifies the initial row index from which color alternation begins, determining where the alternating row colors pattern is applied in the table. * Property type: number */ get alternationStart() { return this.nativeElement ? this.nativeElement.alternationStart : undefined; } set alternationStart(value) { if (this.nativeElement) { this.nativeElement.alternationStart = value; } } /** Specifies the animation mode for the element. You can retrieve the current animation mode or set a new one by assigning a value to this property. When set to 'none', all animations are disabled. To enable different animation effects, assign one of the supported animation mode values other than 'none'. * Property type: Animation | string */ get animation() { return this.nativeElement ? this.nativeElement.animation : undefined; } set animation(value) { if (this.nativeElement) { this.nativeElement.animation = value; } } /** Controls whether automatic sorting is performed. When autoSort is set to true, the element will automatically re-sort itself whenever its data changes. If sorted is enabled but autoSort is set to false, the element will only be sorted once (typically on initialization) and will not automatically update its order in response to subsequent data changes. * Property type: boolean */ get autoSort() { return this.nativeElement ? this.nativeElement.autoSort : undefined; } set autoSort(value) { if (this.nativeElement) { this.nativeElement.autoSort = value; } } /** Specifies the source of data to populate the ListBox. The dataSource can be provided in several formats:- An array of strings or numbers, where each item represents a single ListBox entry.- An array of objects, where each object defines the properties of a ListBox item, such as label (the displayed text), value (the underlying value), and group (used for grouping items).- A callback function that returns an array of items in either of the formats described above.Using these options, you can flexibly supply data from static arrays or dynamically generate the list items as needed. * Property type: any */ get dataSource() { return this.nativeElement ? this.nativeElement.dataSource : undefined; } set dataSource(value) { if (this.nativeElement) { this.nativeElement.dataSource = value; } } /** Determines whether the list box is active and can be interacted with by the user. When enabled, users can select items from the list box; when disabled, the list box appears grayed out and does not respond to user input. * Property type: boolean */ get disabled() { return this.nativeElement ? this.nativeElement.disabled : undefined; } set disabled(value) { if (this.nativeElement) { this.nativeElement.disabled = value; } } /** Specifies whether a visual indicator (such as a loading spinner or progress bar) will be displayed while filtering data or loading items from a remote source. * Property type: boolean */ get displayLoadingIndicator() { return this.nativeElement ? this.nativeElement.displayLoadingIndicator : undefined; } set displayLoadingIndicator(value) { if (this.nativeElement) { this.nativeElement.displayLoadingIndicator = value; } } /** Defines or retrieves the displayMember property, which specifies the name of the object property to be shown in the UI for each item in the data source. The specified name should match a key present in the objects within the collection assigned to the 'dataSource' property. This allows you to control which property value is displayed for each item when rendering data-bound lists or dropdowns. * Property type: string */ get displayMember() { return this.nativeElement ? this.nativeElement.displayMember : undefined; } set displayMember(value) { if (this.nativeElement) { this.nativeElement.displayMember = value; } } /** A callback function that allows you to customize the HTML markup displayed as visual feedback while an item is being dragged. This function receives a single parameter representing the item currently being dragged, enabling you to tailor the appearance of the drag feedback element based on its properties or content. * Property type: any */ get dragFeedbackFormatFunction() { return this.nativeElement ? this.nativeElement.dragFeedbackFormatFunction : undefined; } set dragFeedbackFormatFunction(value) { if (this.nativeElement) { this.nativeElement.dragFeedbackFormatFunction = value; } } /** Specifies the position offset of the drag feedback element relative to the mouse cursor during a drag operation. This property takes an array with two values: the first value sets the horizontal offset (in pixels), and the second value sets the vertical offset (in pixels). These offsets determine how far the feedback element is displayed from the cursor while dragging an item. * Property type: number[] */ get dragOffset() { return this.nativeElement ? this.nativeElement.dragOffset : undefined; } set dragOffset(value) { if (this.nativeElement) { this.nativeElement.dragOffset = value; } } /** Specifies the actions or behavior that are triggered when an item is released or dropped during a drag-and-drop operation. This may include updating the interface, modifying data structures, or invoking specific callback functions associated with the drop event. * Property type: ListBoxDropAction | string */ get dropAction() { return this.nativeElement ? this.nativeElement.dropAction : undefined; } set dropAction(value) { if (this.nativeElement) { this.nativeElement.dropAction = value; } } /** Specifies whether list items are editable. When this option is enabled, users can modify items in the list by either double-clicking on a non-disabled item or by selecting the item and pressing the F2 key. Disabled items remain uneditable regardless of this setting. * Property type: boolean */ get editable() { return this.nativeElement ? this.nativeElement.editable : undefined; } set editable(value) { if (this.nativeElement) { this.nativeElement.editable = value; } } /** Specifies whether users can filter the items in the list. When enabled, a filter input field appears at the top of the list box, allowing users to quickly search and narrow down the displayed items based on their input. If disabled, the entire list is shown without any filtering option. * Property type: boolean */ get filterable() { return this.nativeElement ? this.nativeElement.filterable : undefined; } set filterable(value) { if (this.nativeElement) { this.nativeElement.filterable = value; } } /** A callback function that must return a condition (typically a boolean value) used to determine whether each item should be included when filtering the list. This function is called for every item and is intended for use when the filterMode is set to 'custom', allowing you to define your own filtering logic beyond the default behavior. * Property type: any */ get filterCallback() { return this.nativeElement ? this.nativeElement.filterCallback : undefined; } set filterCallback(value) { if (this.nativeElement) { this.nativeElement.filterCallback = value; } } /** Specifies which filtering mode is applied to the data set, controlling how items are included or excluded based on defined criteria. * Property type: FilterMode | string */ get filterMode() { return this.nativeElement ? this.nativeElement.filterMode : undefined; } set filterMode(value) { if (this.nativeElement) { this.nativeElement.filterMode = value; } } /** Specifies the placeholder text that appears inside the filter input field, guiding users on what to enter or search for. * Property type: string */ get filterInputPlaceholder() { return this.nativeElement ? this.nativeElement.filterInputPlaceholder : undefined; } set filterInputPlaceholder(value) { if (this.nativeElement) { this.nativeElement.filterInputPlaceholder = value; } } /** When enabled, this option organizes the items into groups based on the first letter of each item's value. Note: This setting is incompatible with data sources that are already grouped; it can only be used when the dataSource does not contain predefined groupings. * Property type: boolean */ get grouped() { return this.nativeElement ? this.nativeElement.grouped : undefined; } set grouped(value) { if (this.nativeElement) { this.nativeElement.grouped = value; } } /** Specifies the property name within the dataSource object that will be used to group the items in the ListBox. If this property is not set, the component defaults to using the 'group' attribute from each data item for grouping purposes. The groupMember property is particularly useful when loading data from a JSON file as the dataSource and you need to group items based on a specific custom property, rather than the default 'group' property. This allows for flexible and customized grouping behavior based on the structure of your data. * Property type: string | null */ get groupMember() { return this.nativeElement ? this.nativeElement.groupMember : undefined; } set groupMember(value) { if (this.nativeElement) { this.nativeElement.groupMember = value; } } /** Controls whether the horizontal scroll bar is displayed, allowing users to scroll content left and right when it overflows the container. * Property type: HorizontalScrollBarVisibility | string */ get horizontalScrollBarVisibility() { return this.nativeElement ? this.nativeElement.horizontalScrollBarVisibility : undefined; } set horizontalScrollBarVisibility(value) { if (this.nativeElement) { this.nativeElement.horizontalScrollBarVisibility = value; } } /** The 'IncrementalSearchDelay' property defines the amount of time, in milliseconds, that the system waits after the user stops typing before clearing the previous search query. This delay timer begins as soon as the user ceases input. Only after the specified delay has fully elapsed will the previous search query be reset, allowing a new search query to be initiated. This property helps control the responsiveness of incremental search operations, preventing premature query resets while the user is still entering input. * Property type: number */ get incrementalSearchDelay() { return this.nativeElement ? this.nativeElement.incrementalSearchDelay : undefined; } set incrementalSearchDelay(value) { if (this.nativeElement) { this.nativeElement.incrementalSearchDelay = value; } } /** Sets or retrieves the current incremental search mode. By default, incremental search is enabled, allowing users to begin searching by typing while the ListBox is focused. This mode enables real-time filtering or selection as the user types, making it easier to quickly find items in the list. * Property type: SearchMode | string */ get incrementalSearchMode() { return this.nativeElement ? this.nativeElement.incrementalSearchMode : undefined; } set incrementalSearchMode(value) { if (this.nativeElement) { this.nativeElement.incrementalSearchMode = value; } } /** Specifies the height, in pixels, for each item within the list box when virtualization is enabled. This property is required for correct rendering and performance optimizations during virtualization. It ensures each list item is allocated sufficient space and enables efficient scrolling and item measurement. * Property type: number */ get itemHeight() { return this.nativeElement ? this.nativeElement.itemHeight : undefined; } set itemHeight(value) { if (this.nativeElement) { this.nativeElement.itemHeight = value; } } /** Specifies the algorithm used to calculate the width of each item. This setting determines how the item width is measured, such as using fixed values, automatic sizing based on content, or percentage-based calculations. * Property type: ListItemMeasureMode | string */ get itemMeasureMode() { return this.nativeElement ? this.nativeElement.itemMeasureMode : undefined; } set itemMeasureMode(value) { if (this.nativeElement) { this.nativeElement.itemMeasureMode = value; } } /** A read-only property that retrieves an array containing all the items currently present in the ListBox. Each element in the array represents a distinct item from the ListBox, preserving their order as displayed. * Property type: ListBoxItem[] */ get items() { return this.nativeElement ? this.nativeElement.items : undefined; } set items(value) { if (this.nativeElement) { this.nativeElement.items = value; } } /** A string specifying either the ID of an HTMLTemplateElement present in the DOM or a direct reference to the template element itself. This property allows you to define a custom template for rendering individual list items, enabling flexible and reusable item layouts within the component. * Property type: any */ get itemTemplate() { return this.nativeElement ? this.nativeElement.itemTemplate : undefined; } set itemTemplate(value) { if (this.nativeElement) { this.nativeElement.itemTemplate = value; } } /** Specifies the text to be displayed alongside the loading indicator when the loader is visible and positioned at either the top or bottom of the component. This text provides contextual feedback to users during loading operations. * Property type: string */ get loadingIndicatorPlaceholder() { return this.nativeElement ? this.nativeElement.loadingIndicatorPlaceholder : undefined; } set loadingIndicatorPlaceholder(value) { if (this.nativeElement) { this.nativeElement.loadingIndicatorPlaceholder = value; } } /** Specifies the placement of the loading indicator within the user interface, such as at the top, center, or bottom of the container or screen. This property controls where the loading spinner or progress bar will appear while content is being loaded. * Property type: VerticalAlignment | string */ get loadingIndicatorPosition() { return this.nativeElement ? this.nativeElement.loadingIndicatorPosition : undefined; } set loadingIndicatorPosition(value) { if (this.nativeElement) { this.nativeElement.loadingIndicatorPosition = value; } } /** Gets or sets the unlockKey property, a unique code required to unlock access to the product. This key is used for product activation or to enable restricted features. * Property type: string */ get unlockKey() { return this.nativeElement ? this.nativeElement.unlockKey : undefined; } set unlockKey(value) { if (this.nativeElement) { this.nativeElement.unlockKey = value; } } /** Specifies or retrieves the language code to be used for message localization. This property determines which set of messages from the messages object will be displayed, enabling support for multiple languages and dynamic language switching in your application. * Property type: string */ get locale() { return this.nativeElement ? this.nativeElement.locale : undefined; } set locale(value) { if (this.nativeElement) { this.nativeElement.locale = value; } } /** A callback function that allows you to customize the formatting of messages returned by the Localization Module. Use this to modify how localized messages are structured or displayed before they are rendered to the user. * Property type: any */ get localizeFormatFunction() { return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined; } set localizeFormatFunction(value) { if (this.nativeElement) { this.nativeElement.localizeFormatFunction = value; } } /** Defines or retrieves an object containing localized strings used throughout the widget’s user interface. This allows you to customize all display text and messages according to different languages or regions. Typically used together with the language property to support internationalization and provide translations for various UI elements. * Property type: any */ get messages() { return this.nativeElement ? this.nativeElement.messages : undefined; } set messages(value) { if (this.nativeElement) { this.nativeElement.messages = value; } } /** Sets or retrieves the value of the element's name attribute. The name attribute identifies the element when submitting an HTML form, allowing its value to be included in the form data sent to the server. This is essential for processing form fields on the server-side. * Property type: string */ get name() { return this.nativeElement ? this.nativeElement.name : undefined; } set name(value) { if (this.nativeElement) { this.nativeElement.name = value; } } /** Specifies the placeholder text that will be displayed in the List box when there are no available items to show. This text provides guidance or information to the user when the List box is empty. * Property type: string */ get placeholder() { return this.nativeElement ? this.nativeElement.placeholder : undefined; } set placeholder(value) { if (this.nativeElement) { this.nativeElement.placeholder = value; } } /** Sets or retrieves the readonly property of the element. When the readonly property is set to true, the element becomes non-editable—users can view its content but cannot modify it. This property is commonly used with input and textarea elements to prevent user interaction while still displaying the field’s value. * Property type: boolean */ get readonly() { return this.nativeElement ? this.nativeElement.readonly : undefined; } set readonly(value) { if (this.nativeElement) { this.nativeElement.readonly = value; } } /** Specifies or retrieves a value that determines whether the element’s text direction is set to right-to-left (RTL) alignment, enabling proper display and support for languages and locales that use right-to-left scripts, such as Arabic or Hebrew. * Property type: boolean */ get rightToLeft() { return this.nativeElement ? this.nativeElement.rightToLeft : undefined; } set rightToLeft(value) { if (this.nativeElement) { this.nativeElement.rightToLeft = value; } } /** Controls whether the select all item is displayed when Checkboxes are enabled. * Property type: boolean */ get selectAll() { return this.nativeElement ? this.nativeElement.selectAll : undefined; } set selectAll(value) { if (this.nativeElement) { this.nativeElement.selectAll = value; } } /** Gets or sets the selected indexes. The selected indexes property is an array containing the numerical indexes of the items that are currently selected. Assigning an array of indexes will update the selection to match those items; retrieving this property returns the array of currently selected item indexes. * Property type: number[] */ get selectedIndexes() { return this.nativeElement ? this.nativeElement.selectedIndexes : undefined; } set selectedIndexes(value) { if (this.nativeElement) { this.nativeElement.selectedIndexes = value; } } /** Sets or retrieves the selected indexes. The selected values correspond to the values of the items that are currently selected. When setting, provide an array of indexes or values to specify which items should be marked as selected; when getting, this returns the values associated with the selected items. * Property type: string[] */ get selectedValues() { return this.nativeElement ? this.nativeElement.selectedValues : undefined; } set selectedValues(value) { if (this.nativeElement) { this.nativeElement.selectedValues = value; } } /** Specifies the maximum number of items that a user can select, based on the current selection mode (e.g., single, multiple, or none). This setting controls and restricts selection behavior within the interface. * Property type: ListSelectionMode | string */ get selectionMode() { return this.nativeElement ? this.nativeElement.selectionMode : undefined; } set selectionMode(value) { if (this.nativeElement) { this.nativeElement.selectionMode = value; } } /** Specifies the user interaction event that triggers the selection of a listbox item: either when the item is initially pressed (‘press’) or when the user releases the press (‘release’). Choosing ‘press’ selects the item on mouse down or touch start, while ‘release’ selects it on mouse up or touch end. This setting controls how and when the user’s selection action is registered. * Property type: ListBoxSelectionChangeAction | string */ get selectionChangeAction() { return this.nativeElement ? this.nativeElement.selectionChangeAction : undefined; } set selectionChangeAction(value) { if (this.nativeElement) { this.nativeElement.selectionChangeAction = value; } } /** Specifies whether the items should be automatically arranged in alphabetical order. If set to true, the items will be displayed from A to Z (or according to the selected locale’s alphabetical rules); if false, items will retain their original order. * Property type: boolean */ get sorted() { return this.nativeElement ? this.nativeElement.sorted : undefined; } set sorted(value) { if (this.nativeElement) { this.nativeElement.sorted = value; } } /** Specifies the sorting order for the data. Accepts either 'asc' for ascending order (from lowest to highest) or 'desc' for descending order (from highest to lowest). * Property type: string */ get sortDirection() { return this.nativeElement ? this.nativeElement.sortDirection : undefined; } set sortDirection(value) { if (this.nativeElement) { this.nativeElement.sortDirection = value; } } /** Specifies the visual theme applied to the element. Themes control the overall appearance, including colors, fonts, spacing, and other stylistic properties that define the element's look and feel. Choosing a theme ensures consistency and enhances the user interface design across the application. * Property type: string */ get theme() { return this.nativeElement ? this.nativeElement.theme : undefined; } set theme(value) { if (this.nativeElement) { this.nativeElement.theme = value; } } /** Scrolls the list box so that the item at the specified index appears as the first (topmost) visible item, ensuring it is fully in view at the top of the list. * Property type: number */ get topVisibleIndex() { return this.nativeElement ? this.nativeElement.topVisibleIndex : undefined; } set topVisibleIndex(value) { if (this.nativeElement) { this.nativeElement.topVisibleIndex = value; } } /** When set to true, this property prevents the element from receiving keyboard focus, meaning users will not be able to select the element using the keyboard (e.g., via the Tab key) or by programmatic focus methods. * Property type: boolean */ get unfocusable() { return this.nativeElement ? this.nativeElement.unfocusable : undefined; } set unfocusable(value) { if (this.nativeElement) { this.nativeElement.unfocusable = value; } } /** Gets or sets the current selection value(s). This property returns an array of objects, where each object represents a selected option with the following structure: { label: string, value: any }. The 'label' is the display text shown to users, and 'value' holds the corresponding data for that option. Return type: { label: string, value: any }[]. * Property type: any */ get value() { return this.nativeElement ? this.nativeElement.value : undefined; } set value(value) { if (this.nativeElement) { this.nativeElement.value = value; } } /** Determines which property of each item object should be used as the item's value. The specified property is stored as the value in the item object. Similar to groupMember, the valueMember property is particularly useful when binding data from a JSON file as a dataSource for the ListBox, allowing you to designate a specific field to serve as the value for each item. This is helpful when your data objects contain multiple properties, and you want to control exactly which one will represent the underlying value of each ListBox entry. * Property type: string */ get valueMember() { return this.nativeElement ? this.nativeElement.valueMember : undefined; } set valueMember(value) { if (this.nativeElement) { this.nativeElement.valueMember = value; } } /** Controls whether the vertical scroll bar is displayed, allowing users to scroll through content vertically when it overflows the container. This setting can be used to show, hide, or automatically display the scroll bar based on the content size. * Property type: VerticalScrollBarVisibility | string */ get verticalScrollBarVisibility() { return this.nativeElement ? this.nativeElement.verticalScrollBarVisibility : undefined; } set verticalScrollBarVisibility(value) { if (this.nativeElement) { this.nativeElement.verticalScrollBarVisibility = value; } } /** Specifies whether virtualization is enabled for the ListBox. When virtualization is enabled, the ListBox renders only the visible items in the UI, instead of generating UI elements for every item in the collection. This significantly improves performance and reduces memory usage, especially when working with large data sets (e.g., displaying one million items). Virtualization ensures smooth scrolling and responsiveness, even with a vast number of items in the ListBox. * Property type: boolean */ get virtualized() { return this.nativeElement ? this.nativeElement.virtualized : undefined; } set virtualized(value) { if (this.nativeElement) { this.nativeElement.virtualized = value; } } // Gets the properties of the React component. get properties() { return ["allowDrag", "allowDrop", "alternationCount", "alternationEnd", "alternationStart", "animation", "autoSort", "dataSource", "disabled", "displayLoadingIndicator", "displayMember", "dragFeedbackFormatFunction", "dragOffset", "dropAction", "editable", "filterable", "filterCallback", "filterMode", "filterInputPlaceholder", "grouped", "groupMember", "horizontalScrollBarVisibility", "incrementalSearchDelay", "incrementalSearchMode", "itemHeight", "itemMeasureMode", "items", "itemTemplate", "loadingIndicatorPlaceholder", "loadingIndicatorPosition", "unlockKey", "locale", "localizeFormatFunction", "messages", "name", "placeholder", "readonly", "rightToLeft", "selectAll", "selectedIndexes", "selectedValues", "selectionMode", "selectionChangeAction", "sorted", "sortDirection", "theme", "topVisibleIndex", "unfocusable", "value", "valueMember", "verticalScrollBarVisibility", "virtualized"]; } // Gets the events of the React component. get eventListeners() { return ["onBindingComplete", "onChange", "onDragEnd", "onDragging", "onDragStart", "onItemClick", "onItemLabelChange", "onScrollBottomReached", "onScrollTopReached", "onSwipeleft", "onSwiperight", "onCreate", "onReady"]; } /** Adds a new ListItem element to the end of the existing items within the specified container element, maintaining the original order of all previously added items. * @param {Node} node. A ListItem element that should be added to the rest of the items as the last item. * @returns {Node} */ appendChild(node) { const result = this.nativeElement.appendChild(node); return result; } /** Adds one or more new items to the collection. This operation updates the data set by appending the provided item(s), making them available for future retrieval or processing. * @param {any} item. Describes the properties of the item that will be inserted. You can also pass an array of items. */ add(item) { if (this.nativeElement.isRendered) { this.nativeElement.add(item); } else { this.nativeElement.whenRendered(() => { this.nativeElement.add(item); }); } } /** Clears all items from the listBox, effectively removing every entry and leaving the listBox empty. This operation does not delete the listBox itself, only its contents. */ clearItems() { if (this.nativeElement.isRendered) { this.nativeElement.clearItems(); } else { this.nativeElement.whenRendered(() => { this.nativeElement.clearItems(); }); } } /** Deselects all currently selected items, ensuring that no items remain selected within the list or interface. */ clearSelection() { if (this.nativeElement.isRendered) { this.nativeElement.clearSelection(); } else { this.nativeElement.whenRendered(() => { this.nativeElement.clearSelection(); }); } } /** Binds the latest data from the data source to the component, ensuring the user interface reflects current information. This method can be called to refresh or update the displayed data whene