@syncfusion/ej2-lists
Advanced tools
Comparing version 25.2.3 to 26.1.35
@@ -18,3 +18,4 @@ { | ||
"sourceType": "module" | ||
}, | ||
}, | ||
"ignorePatterns": ["*.d.ts", "*.js"], | ||
"plugins": [ | ||
@@ -188,3 +189,3 @@ "@typescript-eslint", | ||
], | ||
"@typescript-eslint/no-explicit-any": "error", | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"no-cond-assign": [ | ||
@@ -191,0 +192,0 @@ "error", |
/*! | ||
* filename: index.d.ts | ||
* version : 25.2.3 | ||
* version : 26.1.35 | ||
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved. | ||
@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license. |
{ | ||
"_from": "@syncfusion/ej2-lists@*", | ||
"_id": "@syncfusion/ej2-lists@25.1.39", | ||
"_id": "@syncfusion/ej2-lists@18.23.1", | ||
"_inBundle": false, | ||
"_integrity": "sha512-I1Q257ceQxqo7UHcrv3r9XGCW+Xomxh1QHOCu0V0g6oou48Ieph0Sbc0ScgtgXu7TYpKqIv0cc1EJYXvex0EUQ==", | ||
"_integrity": "sha512-B5xtA82CSsioZGwgph1vaJ8AmLhQOalwhJ18BwocDVrfoNIg6c724oS5AhYWe1luIL249ABaKE7MK8zIBFu7dw==", | ||
"_location": "/@syncfusion/ej2-lists", | ||
@@ -38,6 +38,6 @@ "_phantomChildren": {}, | ||
], | ||
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-lists/-/ej2-lists-25.1.39.tgz", | ||
"_shasum": "80283ddecbd264a24b1363f8d40ca30501095616", | ||
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-lists/-/ej2-lists-18.23.1.tgz", | ||
"_shasum": "bfdfceeae42d100ad824974d2a971bf56eb91bac", | ||
"_spec": "@syncfusion/ej2-lists@*", | ||
"_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included", | ||
"_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included", | ||
"author": { | ||
@@ -48,6 +48,6 @@ "name": "Syncfusion Inc." | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~25.2.3", | ||
"@syncfusion/ej2-buttons": "~25.2.3", | ||
"@syncfusion/ej2-data": "~25.2.3", | ||
"@syncfusion/ej2-popups": "~25.2.3" | ||
"@syncfusion/ej2-base": "~26.1.35", | ||
"@syncfusion/ej2-buttons": "~26.1.35", | ||
"@syncfusion/ej2-data": "~26.1.35", | ||
"@syncfusion/ej2-popups": "~26.1.35" | ||
}, | ||
@@ -92,5 +92,5 @@ "deprecated": false, | ||
"typings": "index.d.ts", | ||
"version": "25.2.3", | ||
"version": "26.1.35", | ||
"sideEffects": false, | ||
"homepage": "https://www.syncfusion.com/javascript-ui-controls" | ||
} |
@@ -47,7 +47,7 @@ import { Query } from '@syncfusion/ej2-data'; | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
@@ -66,7 +66,7 @@ * @returns {createElement} createListFromJson - Specifies the list options that need to provide. | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
@@ -83,7 +83,7 @@ * @returns {createElement} generateUL - returns the list options that need to provide. | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
@@ -100,9 +100,9 @@ * @returns {HTMLElement[]} subChild - returns the list options that need to provide. | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {number} [level] - Specifies the list options that need to provide. | ||
* | ||
* @param {number} level? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
@@ -121,9 +121,9 @@ * @returns {HTMLElement[]} child - returns the list options that need to provide. | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {number} level? - Specifies the list options that need to provide. | ||
* @param {number} [level] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
@@ -139,4 +139,5 @@ * @returns {createElement} generateUL - Specifies the list options that need to provide. | ||
* @param {Element[]|NodeList} elementArray - An element array to find next or previous element. | ||
* @param {Element} li - An element to find next or previous after this element. | ||
* @param {boolean} isPrevious? - Specify when the need get previous element from array. | ||
* @param {Element} element - An element to find next or previous after this element. | ||
* @param {boolean} [isPrevious] - Specify when the need get previous element from array. | ||
* @returns {Element|undefined} The next or previous visible element, or undefined if the element array is empty. | ||
*/ | ||
@@ -149,2 +150,3 @@ function getSiblingLI(elementArray: Element[] | NodeList, element: Element, isPrevious?: boolean): Element; | ||
* @param {Element[]} elementArray - An element array to find index of given li. | ||
* @returns {number} - The index of the item in the element array, or undefined if either parameter is false. | ||
*/ | ||
@@ -157,3 +159,4 @@ function indexOf(item: Element, elementArray: Element[] | NodeList): number; | ||
* @param {FieldsMapping} fields - Fields that are mapped from the data source. | ||
* @param {SortOrder} sortOrder- Specifies final result sort order. | ||
* @param {SortOrder} [sortOrder='None'] - Specifies final result sort order. Defaults to 'None'. | ||
* @returns {Object[]} - The grouped data. | ||
*/ | ||
@@ -171,2 +174,3 @@ function groupDataSource(dataSource: { | ||
* @param {Query} query - Pass if any existing query. | ||
* @returns {Query} - The updated query object with sorting applied. | ||
*/ | ||
@@ -180,2 +184,4 @@ function addSorting(sortOrder: SortOrder, sortBy: string, query?: Query): Query; | ||
* @param {Query} query - Specifies query that need to process. | ||
* | ||
* @returns {Object[]} - An array of objects representing the retrieved data. | ||
*/ | ||
@@ -191,3 +197,4 @@ function getDataSource(dataSource: { | ||
* @param {HTMLElement|Element} element - UL element that need to convert as a JSON | ||
* @param {ListBaseOptions} options? - Specifies listbase option for fields. | ||
* @param {ListBaseOptions} [options] - Specifies ListBase option for fields. | ||
* @returns {Object[]} - An array of objects representing the JSON data. | ||
*/ | ||
@@ -200,5 +207,9 @@ function createJsonFromElement(element: HTMLElement | Element, options?: ListBaseOptions): { | ||
* | ||
* @param {createElementParams} createElement - Specifies an array of JSON data. | ||
* @param {string} template - that need to convert and generate li element. | ||
* @param {{Object}[]} dataSource - Specifies local JSON data source. | ||
* @param {ListBaseOptions} options? - Specifies listbase option for fields. | ||
* @param {FieldsMapping} [fields] - Specifies fields for mapping the dataSource. | ||
* @param {ListBaseOptions} [options] - Specifies ListBase option for fields. | ||
* @param {any} [componentInstance] - Specifies component instance. | ||
* @returns {HTMLElement} - The generated LI element. | ||
*/ | ||
@@ -211,9 +222,15 @@ function renderContentTemplate(createElement: createElementParams, template: string | Function, dataSource: { | ||
* | ||
* @param {string} template - that need to convert and generate li element. | ||
* @param {string | Function} groupTemplate - that need to convert and generate li element. | ||
* | ||
* @param {{Object}[]} dataSource - Specifies local JSON data source. | ||
* @param {{Object}[]} groupDataSource - Specifies local JSON data source. | ||
* | ||
* @param {FieldsMapping} fields - Specifies fields for mapping the dataSource. | ||
* | ||
* @param {Element[]} headerItems? - Specifies listbase header items. | ||
* @param {Element[]} headerItems - Specifies ListBase header items. | ||
* | ||
* @param {ListBaseOptions} [options] - Optional ListBase options. | ||
* | ||
* @param {*} [componentInstance] - Optional component instance. | ||
* | ||
* @returns {Element[]} - An array of header elements with the rendered group template content. | ||
*/ | ||
@@ -223,2 +240,7 @@ function renderGroupTemplate(groupTemplate: string | Function, groupDataSource: { | ||
}[], fields: FieldsMapping, headerItems: Element[], options?: ListBaseOptions, componentInstance?: any): Element[]; | ||
/** | ||
* Generates a random hexadecimal ID string. | ||
* | ||
* @returns {string} - The generated ID string. | ||
*/ | ||
function generateId(): string; | ||
@@ -228,7 +250,11 @@ /** | ||
* | ||
* @param {Function} createElement - Function for creating elements. | ||
* | ||
* @param {HTMLElement[]} liElement - Specifies array of LI element. | ||
* | ||
* @param {string} className? - Specifies class name that need to be added in UL element. | ||
* @param {string} [className] - Specifies class name that need to be added in UL element. | ||
* | ||
* @param {ListBaseOptions} options? - Specifies ListBase options. | ||
* @param {ListBaseOptions} [options] - Specifies ListBase options. | ||
* | ||
* @returns {HTMLElement} - The created UL element. | ||
*/ | ||
@@ -239,7 +265,11 @@ function generateUL(createElement: createElementParams, liElement: HTMLElement[], className?: string, options?: ListBaseOptions): HTMLElement; | ||
* | ||
* @param {Function} createElement - Function for creating elements. | ||
* | ||
* @param {liElement} liElement - Specifies LI element. | ||
* | ||
* @param {string} className? - Specifies class name that need to be added in created DIV element. | ||
* @param {string} [className] - Specifies class name that need to be added in created DIV element. | ||
* | ||
* @param {ListBaseOptions} options? - Specifies ListBase options. | ||
* @param {ListBaseOptions} [options] - Specifies ListBase options. | ||
* | ||
* @returns {HTMLElement} - The modified LI element. | ||
*/ | ||
@@ -392,5 +422,6 @@ function generateIcon(createElement: createElementParams, liElement: HTMLElement, className?: string, options?: ListBaseOptions): HTMLElement; | ||
* | ||
* @param {Object} dataSource - Specifies an JSON or String data. | ||
* @param {Object} dataItem - Specifies an JSON or String data. | ||
* | ||
* @param {FieldsMapping} fields - Fields that are mapped from the dataSource. | ||
* @returns {Object|string|number} - The retrieved field values. | ||
*/ | ||
@@ -397,0 +428,0 @@ export declare function getFieldValues(dataItem: { |
@@ -92,13 +92,11 @@ /* eslint-disable no-inner-declarations */ | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
* @returns {createElement} createListFromJson - Specifies the list options that need to provide. | ||
*/ | ||
function createList(createElement, dataSource, | ||
// eslint-disable-next-line | ||
options, isSingleLevel, componentInstance) { | ||
function createList(createElement, dataSource, options, isSingleLevel, componentInstance) { | ||
var curOpt = extend({}, defaultListBaseOptions, options); | ||
@@ -122,14 +120,11 @@ var ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes); | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
* @returns {createElement} generateUL - returns the list options that need to provide. | ||
*/ | ||
function createListFromArray(createElement, dataSource, | ||
// tslint:disable-next-line | ||
// eslint-disable-next-line | ||
isSingleLevel, options, componentInstance) { | ||
function createListFromArray(createElement, dataSource, isSingleLevel, options, componentInstance) { | ||
var subChild = createListItemFromArray(createElement, dataSource, isSingleLevel, options, componentInstance); | ||
@@ -146,13 +141,11 @@ return generateUL(createElement, subChild, null, options); | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
* @returns {HTMLElement[]} subChild - returns the list options that need to provide. | ||
*/ | ||
function createListItemFromArray(createElement, dataSource, | ||
// eslint-disable-next-line | ||
isSingleLevel, options, componentInstance) { | ||
function createListItemFromArray(createElement, dataSource, isSingleLevel, options, componentInstance) { | ||
var subChild = []; | ||
@@ -204,15 +197,13 @@ var curOpt = extend({}, defaultListBaseOptions, options); | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {number} [level] - Specifies the list options that need to provide. | ||
* | ||
* @param {number} level? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
* @returns {HTMLElement[]} child - returns the list options that need to provide. | ||
*/ | ||
function createListItemFromJson(createElement, dataSource, | ||
// eslint-disable-next-line | ||
options, level, isSingleLevel, componentInstance) { | ||
function createListItemFromJson(createElement, dataSource, options, level, isSingleLevel, componentInstance) { | ||
var curOpt = extend({}, defaultListBaseOptions, options); | ||
@@ -233,4 +224,3 @@ cssClass = getModuleClass(curOpt.moduleName); | ||
if (dataSource && dataSource.length && !isNullOrUndefined(typeofData(dataSource).item) && | ||
// eslint-disable-next-line no-prototype-builtins | ||
!typeofData(dataSource).item.hasOwnProperty(fields.id)) { | ||
!Object.prototype.hasOwnProperty.call(typeofData(dataSource).item, fields.id)) { | ||
id = generateId(); // generate id for drop-down-list option. | ||
@@ -257,4 +247,3 @@ } | ||
} | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (fieldData.hasOwnProperty(fields.id) && !isNullOrUndefined(fieldData[fields.id])) { | ||
if (Object.prototype.hasOwnProperty.call(fieldData, fields.id) && !isNullOrUndefined(fieldData[fields.id])) { | ||
id = fieldData[fields.id]; | ||
@@ -272,9 +261,7 @@ } | ||
if (isSingleLevel === true) { | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (curOpt.showIcon && fieldData.hasOwnProperty(fields.iconCss) && !isNullOrUndefined(fieldData[fields.iconCss])) { | ||
if (curOpt.showIcon && Object.prototype.hasOwnProperty.call(fieldData, fields.iconCss) | ||
&& !isNullOrUndefined(fieldData[fields.iconCss])) { | ||
innerEle.push(createElement('span', { className: cssClass.icon + ' ' + fieldData[fields.iconCss] })); | ||
} | ||
li = generateSingleLevelLI(createElement, curItem, fieldData, fields, curOpt.itemClass, innerEle, | ||
// eslint-disable-next-line no-prototype-builtins | ||
(curItem.hasOwnProperty('isHeader') && | ||
li = generateSingleLevelLI(createElement, curItem, fieldData, fields, curOpt.itemClass, innerEle, (Object.prototype.hasOwnProperty.call(curItem, 'isHeader') && | ||
curItem.isHeader) ? true : false, id, i, options); | ||
@@ -294,4 +281,3 @@ anchorElement = li.querySelector('.' + cssClass.anchorWrap); | ||
anchorElement = li.querySelector('.' + cssClass.anchorWrap); | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (fieldData.hasOwnProperty(fields.tooltip)) { | ||
if (Object.prototype.hasOwnProperty.call(fieldData, fields.tooltip)) { | ||
var tooltipText = fieldData[fields.tooltip]; | ||
@@ -308,4 +294,3 @@ if (options && options.enableHtmlSanitizer) { | ||
} | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) { | ||
if (Object.prototype.hasOwnProperty.call(fieldData, fields.htmlAttributes) && fieldData[fields.htmlAttributes]) { | ||
var htmlAttributes = fieldData[fields.htmlAttributes]; | ||
@@ -318,14 +303,11 @@ // Check if 'class' attribute is present and not an empty string | ||
} | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (fieldData.hasOwnProperty(fields.enabled) && fieldData[fields.enabled] === false) { | ||
if (Object.prototype.hasOwnProperty.call(fieldData, fields.enabled) && fieldData[fields.enabled] === false) { | ||
li.classList.add(cssClass.disabled); | ||
} | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (fieldData.hasOwnProperty(fields.isVisible) && fieldData[fields.isVisible] === false) { | ||
if (Object.prototype.hasOwnProperty.call(fieldData, fields.isVisible) && fieldData[fields.isVisible] === false) { | ||
li.style.display = 'none'; | ||
} | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (fieldData.hasOwnProperty(fields.imageUrl) && !isNullOrUndefined(fieldData[fields.imageUrl]) | ||
if (Object.prototype.hasOwnProperty.call(fieldData, fields.imageUrl) && !isNullOrUndefined(fieldData[fields.imageUrl]) | ||
&& !curOpt.template) { | ||
var attr = { src: fieldData[fields.imageUrl] }; | ||
var attr = { src: fieldData[fields.imageUrl], alt: !isNullOrUndefined(fieldData.name) ? ('Displaying ' + fieldData.name + ' Image') : 'Displaying Image' }; | ||
merge(attr, fieldData[fields.imageAttributes]); | ||
@@ -340,4 +322,3 @@ var imageElemnt = createElement('img', { className: cssClass.image, attrs: attr }); | ||
} | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (curOpt.showIcon && fieldData.hasOwnProperty(fields.iconCss) && | ||
if (curOpt.showIcon && Object.prototype.hasOwnProperty.call(fieldData, fields.iconCss) && | ||
!isNullOrUndefined(fieldData[fields.iconCss]) && !curOpt.template) { | ||
@@ -387,15 +368,13 @@ var iconElement = createElement('div', { className: cssClass.icon + ' ' + fieldData[fields.iconCss] }); | ||
* | ||
* @param {ListBaseOptions} options? - Specifies the list options that need to provide. | ||
* @param {ListBaseOptions} [options] - Specifies the list options that need to provide. | ||
* | ||
* @param {number} level? - Specifies the list options that need to provide. | ||
* @param {number} [level] - Specifies the list options that need to provide. | ||
* | ||
* @param {boolean} isSingleLevel? - Specifies the list options that need to provide. | ||
* @param {boolean} [isSingleLevel] - Specifies the list options that need to provide. | ||
* | ||
* @param {any} componentInstance? - Specifies the list options that need to provide. | ||
* @param {any} [componentInstance] - Specifies the list options that need to provide. | ||
* | ||
* @returns {createElement} generateUL - Specifies the list options that need to provide. | ||
*/ | ||
function createListFromJson(createElement, dataSource, | ||
// eslint-disable-next-line | ||
options, level, isSingleLevel, componentInstance) { | ||
function createListFromJson(createElement, dataSource, options, level, isSingleLevel, componentInstance) { | ||
var curOpt = extend({}, defaultListBaseOptions, options); | ||
@@ -410,4 +389,5 @@ var li = createListItemFromJson(createElement, dataSource, options, level, isSingleLevel, componentInstance); | ||
* @param {Element[]|NodeList} elementArray - An element array to find next or previous element. | ||
* @param {Element} li - An element to find next or previous after this element. | ||
* @param {boolean} isPrevious? - Specify when the need get previous element from array. | ||
* @param {Element} element - An element to find next or previous after this element. | ||
* @param {boolean} [isPrevious] - Specify when the need get previous element from array. | ||
* @returns {Element|undefined} The next or previous visible element, or undefined if the element array is empty. | ||
*/ | ||
@@ -441,2 +421,3 @@ function getSiblingLI(elementArray, element, isPrevious) { | ||
* @param {Element[]} elementArray - An element array to find index of given li. | ||
* @returns {number} - The index of the item in the element array, or undefined if either parameter is false. | ||
*/ | ||
@@ -459,3 +440,4 @@ function indexOf(item, elementArray) { | ||
* @param {FieldsMapping} fields - Fields that are mapped from the data source. | ||
* @param {SortOrder} sortOrder- Specifies final result sort order. | ||
* @param {SortOrder} [sortOrder='None'] - Specifies final result sort order. Defaults to 'None'. | ||
* @returns {Object[]} - The grouped data. | ||
*/ | ||
@@ -498,2 +480,3 @@ function groupDataSource(dataSource, fields, sortOrder) { | ||
* @param {Query} query - Pass if any existing query. | ||
* @returns {Query} - The updated query object with sorting applied. | ||
*/ | ||
@@ -524,5 +507,6 @@ function addSorting(sortOrder, sortBy, query) { | ||
* @param {Query} query - Specifies query that need to process. | ||
* | ||
* @returns {Object[]} - An array of objects representing the retrieved data. | ||
*/ | ||
function getDataSource(dataSource, query) { | ||
// eslint-disable-next-line | ||
return new DataManager(dataSource) | ||
@@ -536,3 +520,4 @@ .executeLocal(query); | ||
* @param {HTMLElement|Element} element - UL element that need to convert as a JSON | ||
* @param {ListBaseOptions} options? - Specifies listbase option for fields. | ||
* @param {ListBaseOptions} [options] - Specifies ListBase option for fields. | ||
* @returns {Object[]} - An array of objects representing the JSON data. | ||
*/ | ||
@@ -584,2 +569,8 @@ function createJsonFromElement(element, options) { | ||
ListBase.createJsonFromElement = createJsonFromElement; | ||
/** | ||
* Determines the type of data in an array of objects, strings, or numbers. | ||
* | ||
* @param {Object[] | string[] | number[]} data - The array containing objects, strings, or numbers. | ||
* @returns {{typeof: (string | null), item: (Object | string | number)}} - An object containing the type of data and the corresponding item. | ||
*/ | ||
function typeofData(data) { | ||
@@ -594,2 +585,9 @@ var match = { typeof: null, item: null }; | ||
} | ||
/** | ||
* Sets attributes on an HTML element. | ||
* | ||
* @param {HTMLElement} element - The HTML element to set attributes on. | ||
* @param {Object.<string, string>} elementAttributes - An object containing attribute names and their corresponding values. | ||
* @returns {void} | ||
*/ | ||
function setAttribute(element, elementAttributes) { | ||
@@ -604,2 +602,8 @@ var attr = {}; | ||
} | ||
/** | ||
* Retrieves all attributes of an HTML element. | ||
* | ||
* @param {HTMLElement} element - The HTML element to retrieve attributes from. | ||
* @returns {Object.<string, string>} - An object containing attribute names as keys and their corresponding values as values. | ||
*/ | ||
function getAllAttributes(element) { | ||
@@ -616,9 +620,11 @@ var attributes = {}; | ||
* | ||
* @param {createElementParams} createElement - Specifies an array of JSON data. | ||
* @param {string} template - that need to convert and generate li element. | ||
* @param {{Object}[]} dataSource - Specifies local JSON data source. | ||
* @param {ListBaseOptions} options? - Specifies listbase option for fields. | ||
* @param {FieldsMapping} [fields] - Specifies fields for mapping the dataSource. | ||
* @param {ListBaseOptions} [options] - Specifies ListBase option for fields. | ||
* @param {any} [componentInstance] - Specifies component instance. | ||
* @returns {HTMLElement} - The generated LI element. | ||
*/ | ||
function renderContentTemplate(createElement, template, dataSource, | ||
// eslint-disable-next-line | ||
fields, options, componentInstance) { | ||
function renderContentTemplate(createElement, template, dataSource, fields, options, componentInstance) { | ||
cssClass = getModuleClass(defaultListBaseOptions.moduleName); | ||
@@ -677,3 +683,2 @@ var ulElement = createElement('ul', { className: cssClass.ul, attrs: { role: 'presentation' } }); | ||
if (componentInstance && componentInstance.getModuleName() !== 'listview') { | ||
// eslint-disable-next-line | ||
var compiledElement = compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate, null, li); | ||
@@ -690,3 +695,2 @@ if (compiledElement) { | ||
if (componentInstance && componentInstance.getModuleName() !== 'listview') { | ||
// eslint-disable-next-line | ||
var compiledElement = compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate, null, li); | ||
@@ -724,14 +728,19 @@ if (compiledElement) { | ||
* | ||
* @param {string} template - that need to convert and generate li element. | ||
* @param {string | Function} groupTemplate - that need to convert and generate li element. | ||
* | ||
* @param {{Object}[]} dataSource - Specifies local JSON data source. | ||
* @param {{Object}[]} groupDataSource - Specifies local JSON data source. | ||
* | ||
* @param {FieldsMapping} fields - Specifies fields for mapping the dataSource. | ||
* | ||
* @param {Element[]} headerItems? - Specifies listbase header items. | ||
* @param {Element[]} headerItems - Specifies ListBase header items. | ||
* | ||
* @param {ListBaseOptions} [options] - Optional ListBase options. | ||
* | ||
* @param {*} [componentInstance] - Optional component instance. | ||
* | ||
* @returns {Element[]} - An array of header elements with the rendered group template content. | ||
*/ | ||
function renderGroupTemplate(groupTemplate, | ||
// tslint:disable-next-line | ||
function renderGroupTemplate(groupTemplate, groupDataSource, fields, | ||
// eslint-disable-next-line | ||
headerItems, options, componentInstance) { | ||
groupDataSource, fields, headerItems, options, componentInstance) { | ||
var compiledString = compileTemplate(groupTemplate); | ||
@@ -747,3 +756,2 @@ var curFields = extend({}, ListBase.defaultMappedFields, fields); | ||
if (componentInstance && componentInstance.getModuleName() !== 'listview') { | ||
// eslint-disable-next-line | ||
var compiledElement = compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, header); | ||
@@ -761,2 +769,7 @@ if (compiledElement) { | ||
ListBase.renderGroupTemplate = renderGroupTemplate; | ||
/** | ||
* Generates a random hexadecimal ID string. | ||
* | ||
* @returns {string} - The generated ID string. | ||
*/ | ||
function generateId() { | ||
@@ -768,2 +781,14 @@ return Math.floor((1 + Math.random()) * 0x10000) | ||
ListBase.generateId = generateId; | ||
/** | ||
* Processes the sub-child elements and creates corresponding elements based on the provided field data and options. | ||
* | ||
* @param {Function} createElement - Function for creating elements. | ||
* @param {Object} fieldData - Field data containing sub-child information. | ||
* @param {FieldsMapping} fields - Field mappings. | ||
* @param {Object[]} ds - The data source array containing sub-child elements. | ||
* @param {ListBaseOptions} options - ListBase options. | ||
* @param {HTMLElement} element - The parent HTML element to append sub-child elements to. | ||
* @param {number} level - The level of the sub-child elements. | ||
* @returns {void} | ||
*/ | ||
function processSubChild(createElement, fieldData, fields, ds, options, element, level) { | ||
@@ -789,2 +814,17 @@ // Get SubList | ||
} | ||
/** | ||
* Generates a single-level LI (list item) element based on the provided item and field data. | ||
* | ||
* @param {Function} createElement - Function for creating elements. | ||
* @param {string | Object | number} item - The item data. | ||
* @param {Object} fieldData - Field data mapped from the item. | ||
* @param {FieldsMapping} [fields] - Field mappings. | ||
* @param {string} [className] - Optional class name to add to the created LI element. | ||
* @param {HTMLElement[]} [innerElements] - Optional array of inner elements to append to the LI element. | ||
* @param {boolean} [grpLI] - Indicates if the LI element is a group item. | ||
* @param {string} [id] - The ID of the LI element. | ||
* @param {number} [index] - The index of the LI element. | ||
* @param {ListBaseOptions} [options] - Optional ListBase options. | ||
* @returns {HTMLElement} - The generated LI element. | ||
*/ | ||
function generateSingleLevelLI(createElement, item, fieldData, fields, className, innerElements, grpLI, id, index, options) { | ||
@@ -815,4 +855,3 @@ var curOpt = extend({}, defaultListBaseOptions, options); | ||
}); | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (dataSource && fieldData.hasOwnProperty(fields.enabled) && fieldData[fields.enabled].toString() === 'false') { | ||
if (dataSource && Object.prototype.hasOwnProperty.call(fieldData, fields.enabled) && fieldData[fields.enabled].toString() === 'false') { | ||
li.classList.add(cssClass.disabled); | ||
@@ -826,4 +865,3 @@ } | ||
li.setAttribute('role', 'option'); | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (dataSource && fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) { | ||
if (dataSource && Object.prototype.hasOwnProperty.call(fieldData, fields.htmlAttributes) && fieldData[fields.htmlAttributes]) { | ||
setAttribute(li, fieldData[fields.htmlAttributes]); | ||
@@ -847,2 +885,8 @@ } | ||
} | ||
/** | ||
* Returns a set of CSS class names based on the provided module name. | ||
* | ||
* @param {string} moduleName - The name of the module. | ||
* @returns {ClassList} - The CSS class names associated with the module. | ||
*/ | ||
function getModuleClass(moduleName) { | ||
@@ -873,7 +917,17 @@ var moduleClass; | ||
} | ||
/** | ||
* Creates an anchor tag (<a>) element based on the provided data source, fields, and text. | ||
* | ||
* @param {Function} createElement - Function for creating elements. | ||
* @param {object} dataSource - The data source containing URL-related fields. | ||
* @param {FieldsMapping} fields - Field mappings for the data source. | ||
* @param {string} text - The text content of the anchor tag. | ||
* @param {HTMLElement[]} innerElements - Optional array of inner elements to append to the anchor tag. | ||
* @param {boolean} isFullNavigation - Indicates whether the anchor tag should be for full navigation. | ||
* @returns {HTMLElement} The created anchor tag element. | ||
*/ | ||
function anchorTag(createElement, dataSource, fields, text, innerElements, isFullNavigation) { | ||
var fieldData = getFieldValues(dataSource, fields); | ||
var attr = { href: fieldData[fields.url] }; | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (fieldData.hasOwnProperty(fields.urlAttributes) && fieldData[fields.urlAttributes]) { | ||
if (Object.prototype.hasOwnProperty.call(fieldData, fields.urlAttributes) && fieldData[fields.urlAttributes]) { | ||
merge(attr, fieldData[fields.urlAttributes]); | ||
@@ -899,7 +953,15 @@ attr.href = fieldData[fields.url] ? fieldData[fields.url] : | ||
} | ||
// tslint:disable-next-line | ||
/* tslint:disable:align */ | ||
function generateLI(createElement, item, fieldData, | ||
// eslint-disable-next-line | ||
fields, className, options, componentInstance) { | ||
/** | ||
* Generates an LI element based on the provided item and field data. | ||
* | ||
* @param {Function} createElement - Function for creating elements. | ||
* @param {string | Object | number} item - The item data. | ||
* @param {Object} fieldData - Field data mapped from the item. | ||
* @param {FieldsMapping} fields - Field mappings. | ||
* @param {string} [className] - Optional class name to add to the created LI element. | ||
* @param {ListBaseOptions} [options] - Optional ListBase options. | ||
* @param {*} [componentInstance] - Optional component instance. | ||
* @returns {HTMLElement} - The generated LI element. | ||
*/ | ||
function generateLI(createElement, item, fieldData, fields, className, options, componentInstance) { | ||
var curOpt = extend({}, defaultListBaseOptions, options); | ||
@@ -914,6 +976,4 @@ var ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes); | ||
text = fieldData[fields.text] || ''; | ||
// tslint:disable-next-line | ||
uID = (isNullOrUndefined(fieldData['_id'])) ? fieldData[fields.id] : fieldData['_id']; | ||
// eslint-disable-next-line no-prototype-builtins | ||
grpLI = (item.hasOwnProperty('isHeader') && item.isHeader) | ||
grpLI = (Object.prototype.hasOwnProperty.call(item, 'isHeader') && item.isHeader) | ||
? true : false; | ||
@@ -939,3 +999,2 @@ } | ||
if (componentInstance && componentInstance.getModuleName() !== 'listview') { | ||
// eslint-disable-next-line | ||
var compiledElement = compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, li); | ||
@@ -953,3 +1012,2 @@ if (compiledElement) { | ||
if (componentInstance && componentInstance.getModuleName() !== 'listview') { | ||
// eslint-disable-next-line | ||
var compiledElement = compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate, null, li); | ||
@@ -993,7 +1051,11 @@ if (compiledElement) { | ||
* | ||
* @param {Function} createElement - Function for creating elements. | ||
* | ||
* @param {HTMLElement[]} liElement - Specifies array of LI element. | ||
* | ||
* @param {string} className? - Specifies class name that need to be added in UL element. | ||
* @param {string} [className] - Specifies class name that need to be added in UL element. | ||
* | ||
* @param {ListBaseOptions} options? - Specifies ListBase options. | ||
* @param {ListBaseOptions} [options] - Specifies ListBase options. | ||
* | ||
* @returns {HTMLElement} - The created UL element. | ||
*/ | ||
@@ -1015,7 +1077,11 @@ function generateUL(createElement, liElement, className, options) { | ||
* | ||
* @param {Function} createElement - Function for creating elements. | ||
* | ||
* @param {liElement} liElement - Specifies LI element. | ||
* | ||
* @param {string} className? - Specifies class name that need to be added in created DIV element. | ||
* @param {string} [className] - Specifies class name that need to be added in created DIV element. | ||
* | ||
* @param {ListBaseOptions} options? - Specifies ListBase options. | ||
* @param {ListBaseOptions} [options] - Specifies ListBase options. | ||
* | ||
* @returns {HTMLElement} - The modified LI element. | ||
*/ | ||
@@ -1037,5 +1103,6 @@ function generateIcon(createElement, liElement, className, options) { | ||
* | ||
* @param {Object} dataSource - Specifies an JSON or String data. | ||
* @param {Object} dataItem - Specifies an JSON or String data. | ||
* | ||
* @param {FieldsMapping} fields - Fields that are mapped from the dataSource. | ||
* @returns {Object|string|number} - The retrieved field values. | ||
*/ | ||
@@ -1061,2 +1128,8 @@ export function getFieldValues(dataItem, fields) { | ||
} | ||
/** | ||
* Compiles a template string or function into a compiled function. | ||
* | ||
* @param {string | Function} template - The template string or function to compile. | ||
* @returns {Function | undefined} - The compiled function, or undefined if the input is false. | ||
*/ | ||
function compileTemplate(template) { | ||
@@ -1063,0 +1136,0 @@ if (template) { |
@@ -485,4 +485,2 @@ import { Virtualization } from './virtualization'; | ||
private createList; | ||
private exceptionEvent; | ||
private UpdateCurrentUL; | ||
private renderSubList; | ||
@@ -667,9 +665,9 @@ private renderIntoDom; | ||
/** | ||
* An enum type that denotes the ListView scroll direction when it reaches the end. | ||
* ```props | ||
* Top:- The scrollbar is moved upwards. | ||
* Bottom:- The scrollbar is moved downwards. | ||
* ``` | ||
*/ | ||
* An enum type that denotes the ListView scroll direction when it reaches the end. | ||
* ```props | ||
* Top:- The scrollbar is moved upwards. | ||
* Bottom:- The scrollbar is moved downwards. | ||
* ``` | ||
*/ | ||
export declare type direction = 'Top' | 'Bottom'; | ||
@@ -676,0 +674,0 @@ /** |
@@ -52,3 +52,2 @@ import { ListView, ItemCreatedArgs, Fields, UISelectedItem } from './list-view'; | ||
private wireScrollEvent; | ||
private updateUlContainer; | ||
private ValidateItemCount; | ||
@@ -55,0 +54,0 @@ private uiIndicesInitialization; |
@@ -37,5 +37,3 @@ import { classNames } from './list-view'; | ||
var firstDs = curViewDS.slice(0, 1); | ||
this.listViewInstance.ulElement = this.listViewInstance.curUL = ListBase.createList( | ||
// eslint-disable-next-line | ||
this.listViewInstance.createElement, firstDs, this.listViewInstance.listBaseOption, null, this.listViewInstance); | ||
this.listViewInstance.ulElement = this.listViewInstance.curUL = ListBase.createList(this.listViewInstance.createElement, firstDs, this.listViewInstance.listBaseOption, null, this.listViewInstance); | ||
this.listViewInstance.contentContainer = this.listViewInstance.createElement('div', { className: classNames.container }); | ||
@@ -50,5 +48,3 @@ this.listViewInstance.element.appendChild(this.listViewInstance.contentContainer); | ||
var otherDs = curViewDS.slice(1, this.domItemCount); | ||
var listItems = ListBase.createListItemFromJson( | ||
// eslint-disable-next-line | ||
this.listViewInstance.createElement, otherDs, this.listViewInstance.listBaseOption, null, null, this.listViewInstance); | ||
var listItems = ListBase.createListItemFromJson(this.listViewInstance.createElement, otherDs, this.listViewInstance.listBaseOption, null, null, this.listViewInstance); | ||
append(listItems, this.listViewInstance.ulElement); | ||
@@ -85,27 +81,5 @@ this.listViewInstance.liCollection = this.listViewInstance.curUL.querySelectorAll('li'); | ||
EventHandler.remove(this.listViewInstance.element, 'scroll', this.onVirtualUiScroll); | ||
EventHandler.remove(this.listViewInstance.element, 'scroll', this.updateUlContainer); | ||
} | ||
} | ||
}; | ||
Virtualization.prototype.updateUlContainer = function (e) { | ||
var listDiff; | ||
var virtualElementContainer = this.listViewInstance.ulElement.querySelector('.' + classNames.virtualElementContainer); | ||
if (isNullOrUndefined(this.listViewInstance.liElementHeight)) { | ||
this.listViewInstance.updateLiElementHeight(); | ||
} | ||
if (this.listViewInstance.isWindow) { | ||
// eslint-disable-next-line | ||
listDiff = Math.round(e.target.documentElement.scrollTop / this.listViewInstance.liElementHeight) - 2; | ||
} | ||
else { | ||
// eslint-disable-next-line | ||
listDiff = Math.round(e.target.scrollTop / this.listViewInstance.liElementHeight) - 2; | ||
} | ||
if (((listDiff - 1) * this.listViewInstance.liElementHeight) < 0) { | ||
virtualElementContainer.style.top = '0px'; | ||
} | ||
else { | ||
virtualElementContainer.style.top = (listDiff) * this.listViewInstance.liElementHeight + 'px'; | ||
} | ||
}; | ||
Virtualization.prototype.ValidateItemCount = function (dataSourceLength) { | ||
@@ -119,3 +93,2 @@ var height = parseFloat(formatUnit(this.listViewInstance.height)); | ||
if (typeof this.listViewInstance.height === 'string' && this.listViewInstance.height.indexOf('%') !== -1) { | ||
// eslint-disable-next-line max-len | ||
itemCount = Math.round((this.listViewInstance.element.getBoundingClientRect().height / this.listItemHeight) * listElementCount); | ||
@@ -139,6 +112,4 @@ } | ||
} | ||
// eslint-disable-next-line | ||
if (!isNullOrUndefined(data[i][this.listViewInstance.fields.enabled]) && | ||
if (!isNullOrUndefined(data[parseInt(i.toString(), 10)][this.listViewInstance.fields.enabled]) && | ||
!data[i][this.listViewInstance.fields.enabled]) { | ||
// eslint-disable-next-line | ||
(this.uiIndices.disabledItemIndices.push(i)); | ||
@@ -168,3 +139,3 @@ } | ||
}; | ||
Virtualization.prototype.onVirtualUiScroll = function (e) { | ||
Virtualization.prototype.onVirtualUiScroll = function () { | ||
var _a; | ||
@@ -244,3 +215,2 @@ var startingHeight; | ||
Virtualization.prototype.updateUiContent = function (element, index) { | ||
// eslint-disable-next-line | ||
var curViewDs = this.listViewInstance.curViewDS; | ||
@@ -254,9 +224,6 @@ if (typeof this.listViewInstance.dataSource[0] === 'string' || | ||
else { | ||
// eslint-disable-next-line | ||
element.dataset.uid = (curViewDs[index][this.listViewInstance.fields.id]) ? | ||
// eslint-disable-next-line | ||
(curViewDs[index][this.listViewInstance.fields.id]) : ListBase.generateId(); | ||
element.dataset.uid = (curViewDs[parseInt(index.toString(), 10)][this.listViewInstance.fields.id]) ? | ||
(curViewDs[parseInt(index.toString(), 10)][this.listViewInstance.fields.id]) : ListBase.generateId(); | ||
element.getElementsByClassName(classNames.listItemText)[0].innerHTML = | ||
// eslint-disable-next-line | ||
(curViewDs[index][this.listViewInstance.fields.text]); | ||
(curViewDs[parseInt(index.toString(), 10)][this.listViewInstance.fields.text]); | ||
} | ||
@@ -364,5 +331,3 @@ if (this.listViewInstance.showIcon) { | ||
if ((fields[_this.listViewInstance.fields.id] && | ||
// eslint-disable-next-line | ||
fields[_this.listViewInstance.fields.id] | ||
// eslint-disable-next-line | ||
=== (data[_this.listViewInstance.fields.id] && data[_this.listViewInstance.fields.id]) || fields === data)) { | ||
@@ -395,3 +360,2 @@ resultJSON.index = index; | ||
text: dataCollection, | ||
// eslint-disable-next-line | ||
data: dataCollection, | ||
@@ -418,6 +382,4 @@ index: this.uiIndices.activeIndices.map(function (index) { | ||
textCollection.push(curViewDS_2[indexArray[i]]["" + text]); | ||
// eslint-disable-next-line | ||
dataCollection.push(curViewDS_2[indexArray[i]]); | ||
dataCollection.push(curViewDS_2[indexArray[parseInt(i.toString(), 10)]]); | ||
} | ||
// eslint-disable-next-line | ||
var dataSource_1 = this.listViewInstance.dataSource instanceof DataManager | ||
@@ -427,3 +389,2 @@ ? curViewDS_2 : this.listViewInstance.dataSource; | ||
text: textCollection, | ||
// eslint-disable-next-line | ||
data: dataCollection, | ||
@@ -436,3 +397,2 @@ index: this.uiIndices.activeIndices.map(function (index) { | ||
else { | ||
// eslint-disable-next-line | ||
var dataSource = this.listViewInstance.dataSource instanceof DataManager | ||
@@ -442,3 +402,2 @@ ? curViewDS_2 : this.listViewInstance.dataSource; | ||
text: curViewDS_2[this.activeIndex][this.listViewInstance.fields.text], | ||
// eslint-disable-next-line | ||
data: curViewDS_2[this.activeIndex], | ||
@@ -455,3 +414,2 @@ index: dataSource.indexOf(curViewDS_2[this.activeIndex]) | ||
Virtualization.prototype.selectItem = function (obj) { | ||
// eslint-disable-next-line | ||
var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj); | ||
@@ -484,3 +442,2 @@ if (Object.keys(resutJSON).length) { | ||
else { | ||
// eslint-disable-next-line | ||
var eventArgs = void 0; | ||
@@ -519,3 +476,2 @@ if (typeof this.listViewInstance.dataSource[0] === 'string' || | ||
Virtualization.prototype.enableItem = function (obj) { | ||
// eslint-disable-next-line | ||
var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj); | ||
@@ -527,3 +483,2 @@ if (Object.keys(resutJSON).length) { | ||
Virtualization.prototype.disableItem = function (obj) { | ||
// eslint-disable-next-line | ||
var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj); | ||
@@ -535,3 +490,2 @@ if (Object.keys(resutJSON).length && this.uiIndices.disabledItemIndices.indexOf(resutJSON.index) === -1) { | ||
Virtualization.prototype.showItem = function (obj) { | ||
// eslint-disable-next-line | ||
var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj); | ||
@@ -543,3 +497,2 @@ if (Object.keys(resutJSON).length) { | ||
Virtualization.prototype.hideItem = function (obj) { | ||
// eslint-disable-next-line | ||
var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj); | ||
@@ -553,3 +506,2 @@ if (Object.keys(resutJSON).length && this.uiIndices.hiddenItemIndices.indexOf(resutJSON.index) === -1) { | ||
var curViewDS = this.listViewInstance.curViewDS; | ||
// eslint-disable-next-line | ||
var resutJSON = this.findDSAndIndexFromId(curViewDS, obj); | ||
@@ -775,3 +727,2 @@ if (Object.keys(resutJSON).length) { | ||
else { | ||
// eslint-disable-next-line | ||
var index_2 = this.listViewInstance.curViewDS.indexOf(currentItem); | ||
@@ -791,5 +742,3 @@ // virtually new add list item based on the scollbar position | ||
var target; | ||
var li = ListBase.createListItemFromJson(this.listViewInstance.createElement, | ||
// eslint-disable-next-line | ||
[itemData], this.listViewInstance.listBaseOption, null, null, this.listViewInstance); | ||
var li = ListBase.createListItemFromJson(this.listViewInstance.createElement, [itemData], this.listViewInstance.listBaseOption, null, null, this.listViewInstance); | ||
// check for target element whether to insert before last item or group item | ||
@@ -827,3 +776,2 @@ if ((Object.keys(this.listViewInstance.curViewDS).length - 1) === index) { | ||
if (this.listViewInstance.showCheckBox) { | ||
// eslint-disable-next-line | ||
this.listViewInstance.renderCheckbox(args); | ||
@@ -884,5 +832,3 @@ if ((!isNullOrUndefined(this.listViewInstance.virtualCheckBox)) && | ||
var curViewDS = this.listViewInstance.curViewDS[index]; | ||
// eslint-disable-next-line | ||
element.dataset.uid = (curViewDS[this.listViewInstance.fields.id]) ? | ||
// eslint-disable-next-line | ||
(curViewDS[this.listViewInstance.fields.id]) : ListBase.generateId(); | ||
@@ -908,5 +854,3 @@ onChange(curViewDS, element, this); | ||
Virtualization.prototype.onChange = function (newData, listElement, virtualThis) { | ||
var liItem = ListBase.createListItemFromJson(virtualThis.listViewInstance.createElement, | ||
// eslint-disable-next-line | ||
[newData], virtualThis.listViewInstance.listBaseOption, null, null, virtualThis.listViewInstance); | ||
var liItem = ListBase.createListItemFromJson(virtualThis.listViewInstance.createElement, [newData], virtualThis.listViewInstance.listBaseOption, null, null, virtualThis.listViewInstance); | ||
if (virtualThis.listViewInstance.isReact) { | ||
@@ -913,0 +857,0 @@ virtualThis.listViewInstance.renderReactTemplates(); |
@@ -121,2 +121,7 @@ import { Base, INotifyPropertyChanged } from '@syncfusion/ej2-base'; | ||
* | ||
* @param {HTMLElement} from - The source element from which to move elements. | ||
* @param {HTMLElement} [to=from] - The destination element to which to move elements. Defaults to the source element. | ||
* @param {number[]} [targetIndexes] - The indexes of elements to move. If not provided, all children of the source element will be moved. | ||
* @param {number} [insertBefore] - The index before which to insert the moved elements in the destination element. If not provided, elements will be appended to the end of the destination element. | ||
* @returns {void} | ||
* @private | ||
@@ -123,0 +128,0 @@ */ |
@@ -23,2 +23,3 @@ var __extends = (this && this.__extends) || (function () { | ||
import { addClass, isNullOrUndefined, getComponent, isBlazor, EventHandler } from '@syncfusion/ej2-base'; | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
/** | ||
@@ -45,3 +46,2 @@ * Sortable Module provides support to enable sortable functionality in Dom Elements. | ||
_this.getHelper = function (e) { | ||
// eslint-disable-next-line prefer-const | ||
var target = _this.getSortableElement(e.sender.target); | ||
@@ -64,3 +64,2 @@ if (!_this.isValidTarget(target, _this)) { | ||
}; | ||
// eslint-disable-next-line | ||
_this.onDrag = function (e) { | ||
@@ -143,3 +142,2 @@ if (!e.target) { | ||
}; | ||
// eslint-disable-next-line | ||
_this.onDragStart = function (e) { | ||
@@ -171,7 +169,6 @@ _this.target = _this.getSortableElement(e.target); | ||
}; | ||
// eslint-disable-next-line | ||
_this.onDragStop = function (e) { | ||
var dropInst = _this.getSortableInstance(_this.curTarget); | ||
var curIdx; | ||
var prevIdx; | ||
var curIdx; | ||
var handled; | ||
@@ -207,8 +204,13 @@ prevIdx = _this.getIndex(_this.target); | ||
dropInst = _this.getSortableInstance(e.target); | ||
// eslint-disable-next-line prefer-const | ||
curIdx = dropInst.element.childElementCount; | ||
prevIdx = _this.getIndex(_this.target); | ||
if (dropInst.element.querySelector('.e-list-nrt')) { | ||
curIdx = curIdx - 1; | ||
} | ||
if (_this.curTarget === _this.target && e.target === _this.curTarget) { | ||
curIdx = prevIdx; | ||
} | ||
if (dropInst.element === e.target || (!isPlaceHolderPresent && _this.curTarget === _this.target)) { | ||
var beforeDropArgs = { | ||
previousIndex: prevIdx, currentIndex: _this.curTarget === _this.target ? prevIdx : curIdx, | ||
previousIndex: prevIdx, currentIndex: curIdx, | ||
target: e.target, droppedElement: _this.target, helper: e.helper, cancel: false | ||
@@ -461,2 +463,7 @@ }; | ||
* | ||
* @param {HTMLElement} from - The source element from which to move elements. | ||
* @param {HTMLElement} [to=from] - The destination element to which to move elements. Defaults to the source element. | ||
* @param {number[]} [targetIndexes] - The indexes of elements to move. If not provided, all children of the source element will be moved. | ||
* @param {number} [insertBefore] - The index before which to insert the moved elements in the destination element. If not provided, elements will be appended to the end of the destination element. | ||
* @returns {void} | ||
* @private | ||
@@ -463,0 +470,0 @@ */ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3215190
224
36296
+ Added@syncfusion/ej2-base@26.1.42(transitive)
+ Added@syncfusion/ej2-buttons@26.1.40(transitive)
+ Added@syncfusion/ej2-data@26.1.42(transitive)
+ Added@syncfusion/ej2-icons@26.1.35(transitive)
+ Added@syncfusion/ej2-popups@26.1.42(transitive)
- Removed@syncfusion/ej2-base@25.2.7(transitive)
- Removed@syncfusion/ej2-buttons@25.2.7(transitive)
- Removed@syncfusion/ej2-data@25.2.3(transitive)
- Removed@syncfusion/ej2-icons@25.2.3(transitive)
- Removed@syncfusion/ej2-popups@25.2.7(transitive)