/* @license Copyright (C) Exontrol. All rights reserved. */ /////////////////////////////////////////////////////////// (exontrol.Rollist) // // The exontrol.Rollist class provides the following fields (public): // // Listeners {object}, holds a reference to exontrol.Lts which defines the items of the control. // // The exontrol.Rollist class provides the following methods (public): // // BeginUpdate(), prevents invalidating the control until the EndUpdate() method is called // EndUpdate(), resumes invalidating the control // Refresh(), refreshes the control // Update(callback, thisArg), locks the control's update during the callback, and invalidates the control once the method ends. // Items/GetItems() {exontrol.Rollist.Item}, returns the control's items. // Item(id) {exontrol.Rollist.Item}, returns the item based on its index or identifier. // Import(source, importOpts), imports data from CSV format // // Options/GetOptions()/SetOptions(value) {object}, specifies the options of the exontrol.Rollist control // WheelChange/GetWheelChange()/SetWheelChange(value) {number}, defines the amount the control scrolls when the user rolls the mouse wheel. // AllowActions/GetAllowActions()/SetAllowActions(value) {string}, customizes the actions the user can perform once the control is clicked or touched. // GetSmooth()/SetSmooth(value), defines the time in ms the control goes from one layout to another. // Data/SetData(value) {any}, loads the control's data from CSV files // Misc/GetMisc()/SetMisc(value) {MiscellaneousOptions}, defines the control's miscellaneous options // Select/GetSelect()/SetSelect(value) {any}, defines the position of the item that is currently selected, which is always displayed at the center of the control // Cyclic/GetCyclic()/SetCyclic(value) {boolean}, indicates whether the items are displayed in a continuous loop // Filter/GetFilter()/SetFilter(value) {string}, specifies the filter to be applied to the items, ensuring that only items matching the filter criteria are shown // AllowFilterInput/GetAllowFilterInput()/SetAllowFilterInput(value) {AllowFilterInputEnum}, specifies whether the control displays a filter bar, enabling the user to filter items that contain the typed text // ShowFilterInput(), displays the filter input field, enabling the user to type keywords for filtering items // CloseFilterInput(), hides and clears the filter input field, effectively removing it from view and disabling the filtering functionality. // // The exontrol.Rollist class provides the following items (through Listeners): // // "onadditem", notifies your application once a new item has been added. The onadditem's parameter is: // // oEvent {Item}, indicates an object of Item type that defines the item being added // // "onremoveitem", notifies your application once an item has been removed. The onremoveitem's parameter is: // // oEvent {Item}, indicates an object of Item type that defines the item being added // // "oncreate", occurs once an HTML element is created and linked to a visible item. You can use this event to associate or set additional properties or options for the newly created element. The oncreate's parameter is: // // oEvent {object}, defines the HTML element being constructed for a visible item, represented as an object with properties: {item,html}, where item is of type Item and html is of type HTMLElement // // oEvent.item {Item}, specifies the item for which the HTML element is generated // oEvent.html {HTMLElement}, indicates the HTML element associated with the item // // "ondestroy", occurs when the associated HTML element is removed from the DOM. The ondestroy's parameter is: // // oEvent {object}, represents the pair to be removed, constructed for a visible item, as an object of {item,html} type // // oEvent.item {Item}, specifies the item for which the HTML element was created // oEvent.html {HTMLElement}, indicates the HTML element associated with the item, to be removed // // "onselect", occurs once the user selects an item. The onselect's parameter is: // // oEvent {Item}, indicates an object of Item type that defines the item being clicked // // "onclick", occurs once the user clicks or double-clicks the control. The onclick's parameter is: // // oEvent {object}, specifies an object of {dblClick,button,modifiers,item,html} type, that holds information about the object being clicked // // oEvent.item {Item}, specifies undefined or an object of Item type that indicates the clicked item // oEvent.html {HTMLElement}, specifies undefined or an object of HTMLElement type that indicates the HTML element associated with the clicked item // oEvent.dblClick {boolean}, indicates whether the user clicks or double-clicks the item // oEvent.button {number}, indicates which button is pressed while clicking the item as 1 (left), 2 (right) or 4 (middle) // oEvent.modifiers {number}, specifies a combination of 1, 2, 4 and 16 according with modifier keys (ALT, CTRL, META and SHIFT), or 0 if no modifier keys // // "onfilter", notifies your application when the user applies or clears filters, such as by typing into the control's filter input. The onfilter's parameter is: // // oEvent {string}, specifies the new filter being applied (if the filter has been cleared, this will be undefined) // // "onload", notifies your application once the control loads/imports data. The onload event has no parameters. // "onerror", notifies your application once the control encountered an error. The onerror's parameter is: // // oEvent {DOMException}, an object of DOMException (or any other) type that holds information about the error // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// (exontrol.Def.Rollist) // // The exontrol.Def.Rollist namespace provides definitions for different objects, primitives, objects of exontrol.Rollist object // // The exontrol.Def.Rollist namespace provides the following fields: // // wheelChange {number}, specifies the amount the control scrolls when the user rolls the mouse wheel. // allowActions {string}, customizes the actions the user can perform once the user clicks or touches the control. // smooth {number}, defines the time in ms the control goes from one layout to another. // data {any}, imports the control's data from CSV files // allowDrop {boolean}, specifies whether the user can drag and drop local files into the control // misc {MiscellaneousOptions}, holds the control's miscellaneous options // select {any}, defines the position of the item that is currently selected, which is always displayed at the center of the control // cyclic {boolean}, indicates whether the items are displayed in a continuous loop // filter {string}, specifies the filter to be applied to the items, ensuring that only items matching the filter criteria are shown // allowFilterInput {AllowFilterInputEnum}, specifies whether the control displays a filter bar, enabling the user to filter items that contain the typed text // /////////////////////////////////////////////////////////// /** * @description The exontrol.Def.Rollist namespace provides definitions for different objects, primitives, objects of exontrol.Rollist object */ exontrol.Def.Rollist = { /** * @description The wheelChange field specifies the amount the control scrolls when the user rolls the mouse wheel. * @type {number} * @example * * 0 {number}, locks any action the mouse's wheel performs * 1 {number}, scrolls the control by 1-item when mouse's wheel is rotated */ wheelChange: 1, /** * @description The allowActions field customizes the actions the user can perform once the user clicks or touches the control. * * The format of allowActions field is: * * "action(shortcut,shortcut,...),action(shortcut,shortcut,...)..." * * where * * "action", indicates the name of the action. The "action" can have any of the following values: * * "scroll", scrolls the control by drag and drop * * "shortcut", defines the event's button or/and the modifier-keys that are required to perform the action. The "shortcut" is a combination of none, one or more of the following values: * * "Shift", indicates that the SHIFT key is pressed * "Ctrl" or "Control", indicates that the CTRL key is pressed * "Alt" or "Menu", indicates that the ALT key is pressed * "Meta" , indicates that the META key is pressed * "LButton", specifies that the mouse's left-button is pressed * "RButton", specifies that the mouse's right-button is pressed * "MButton", specifies that the mouse's middle/wheel-button is pressed * "Long", specifies that the action requires a "long" click or touch before it begins * "Double", specifies that the action requires a "double" click before it begins (this flag is available for non-dragable actions only such as "edit") * "+", indicates AND between values * * @type {string} * @example * * null {null}, indicates the control's default allowActions value * "" {string}, specifies that no operation is allowed once the user clicks or touches the control * "scroll" {string}, specifies that only "scroll" operation is allowed, no matter of the event's button or modifier-keys is pressed. * */ allowActions: "scroll", /** * @description The smooth field defines the time in ms the control goes from one layout to another. * @type {number} * @example * * 0 {number}, no smooth changes once the control goes from a layout to another * 125 {number}, specifies that a smooth-transition is performed from a layout to another for 125 ms. */ smooth: null, /** * @description The data field defines the source the control imports data from, as one of the following: * * A String expression that specifies the URL to a CSV file (contains no eof, eor or str) * A String expression in CSV format * An object that includes the "files" member of FileList type (a local file) * An array of data to load * * @type {any} * @example * * "sample.csv" {string}, imports data from sample.csv file */ data: null, /** * @description The misc field holds the control's miscellaneous options, as an object of MiscellaneousOptions type * @type {MiscellaneousOptions} */ misc: { /** * @description The hAlign field specifies the horizontal alignment of roll items along the top edge of the control, as a positive value. * * @type {number} * @example * * null {null} or 0.25 {number}, the roll-items go to the top-center of the control * 1 {number}, the roll-items go to the top-right corner of the control * */ hAlign: 0.25, /** * @description The vAlign field specifies a positive value that determines the vertical position of the top edge of the rectangle. * * @type {number} * @example * * null {null} or 0 {number}, keeps the top edge at its initial position * 1 {number}, shifts the top edge downward by the height of the rectangle * */ vAlign: 0, /** * @description The tagName field defines the type of HTML items to create within the control. The item's className property specifies an additional class name to apply to the HTML element that hosts the item * @type {string} * @example * * null {null} or "pre" {string}, specifies that items are hosted in
 HTML elements by default
     *  "div" {string}, indicates that items are hosted in 
HTML elements * */ tagName: "pre", /** * @description The selectPos field defines the vertical ratio for where the selected item is displayed, ranging from -1 (top) to 1 (bottom), with 0 indicating the center. * * @type {number} * @example * * null {null} or 0 {number}, centers the selected item * -1 {number}, always displays the selected item at the top of the control * */ selectPos: 0, /** * @description The gradualOpacity field defines a 'from-to' pair representing a gradual opacity transition, where the 'from' value is applied near the center (at the selectPos position), and the 'to' value is applied to the surrounding area. The gradualOpacityTransition field defines the transition effect applied by the gradualOpacity option. * @type {string} * @example * * undefined {undefined}, null {null} or "" {string}, no effect (by default) * "1 - 0.25" {string}, results in an opacity transition from 1 (fully opaque) at the center (selectPos) to 0.75 (slightly transparent) toward the edges * 0.5 {number}, semi-transparent for all * */ gradualOpacity: undefined, /** * @description The gradualOpacityTransition field defines the transition effect applied by the gradualOpacity option. It accepts one of the following values: *