@syncfusion/ej2-lists 23.2.4 → 24.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -9
- package/README.md +1 -1
- package/dist/ej2-lists.min.js +2 -2
- package/dist/ej2-lists.umd.min.js +2 -2
- package/dist/ej2-lists.umd.min.js.map +1 -1
- package/dist/es6/ej2-lists.es2015.js +57 -58
- package/dist/es6/ej2-lists.es2015.js.map +1 -1
- package/dist/es6/ej2-lists.es5.js +53 -54
- package/dist/es6/ej2-lists.es5.js.map +1 -1
- package/dist/global/ej2-lists.min.js +2 -2
- package/dist/global/ej2-lists.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +10 -9
- package/src/common/list-base.js +19 -14
- package/src/list-view/list-view-model.d.ts +8 -1
- package/src/list-view/list-view.d.ts +34 -0
- package/src/list-view/list-view.js +32 -35
- package/src/list-view/virtualization.js +2 -5
- package/styles/bootstrap4.css +2 -2
- package/styles/bootstrap5-dark.css +1 -1
- package/styles/bootstrap5.css +1 -1
- package/styles/list-view/_bootstrap4-definition.scss +2 -2
- package/styles/list-view/_bootstrap5-definition.scss +1 -1
- package/styles/list-view/_material-definition.scss +1 -1
- package/styles/list-view/_material3-definition.scss +1 -1
- package/styles/list-view/_tailwind-definition.scss +2 -2
- package/styles/list-view/bootstrap4.css +2 -2
- package/styles/list-view/bootstrap5-dark.css +1 -1
- package/styles/list-view/bootstrap5.css +1 -1
- package/styles/list-view/material.css +1 -1
- package/styles/list-view/material3-dark.css +1 -1
- package/styles/list-view/material3.css +1 -1
- package/styles/list-view/tailwind-dark.css +4 -4
- package/styles/list-view/tailwind.css +4 -4
- package/styles/material.css +1 -1
- package/styles/material3-dark.css +1 -1
- package/styles/material3.css +1 -1
- package/styles/tailwind-dark.css +4 -4
- package/styles/tailwind.css +4 -4
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 24.1.46
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-lists@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-lists@
|
|
3
|
+
"_id": "@syncfusion/ej2-lists@24.1.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-DU792nwYrUL8BOQa6yRYPxP9L4Cgs1xH9KaX2YvwpdfT+205Eh7DXet/VZpAU9Ec48FZSry+EMfrHe2xKD9GgA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-lists",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -35,18 +35,19 @@
|
|
|
35
35
|
"/@syncfusion/ej2-schedule",
|
|
36
36
|
"/@syncfusion/ej2-vue-lists"
|
|
37
37
|
],
|
|
38
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-lists/-/ej2-lists-
|
|
39
|
-
"_shasum": "
|
|
38
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-lists/-/ej2-lists-24.1.41.tgz",
|
|
39
|
+
"_shasum": "ab5c523d5315d581d9ae5174016d9e513768470a",
|
|
40
40
|
"_spec": "@syncfusion/ej2-lists@*",
|
|
41
|
-
"_where": "/jenkins/workspace/elease-
|
|
41
|
+
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
42
42
|
"author": {
|
|
43
43
|
"name": "Syncfusion Inc."
|
|
44
44
|
},
|
|
45
45
|
"bundleDependencies": false,
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@syncfusion/ej2-base": "~
|
|
48
|
-
"@syncfusion/ej2-buttons": "~
|
|
49
|
-
"@syncfusion/ej2-data": "~
|
|
47
|
+
"@syncfusion/ej2-base": "~24.1.46",
|
|
48
|
+
"@syncfusion/ej2-buttons": "~24.1.46",
|
|
49
|
+
"@syncfusion/ej2-data": "~24.1.41",
|
|
50
|
+
"@syncfusion/ej2-popups": "~24.1.46"
|
|
50
51
|
},
|
|
51
52
|
"deprecated": false,
|
|
52
53
|
"description": "The listview control allows you to select an item or multiple items from a list-like interface and represents the data in interactive hierarchical structure across different layouts or views.",
|
|
@@ -86,7 +87,7 @@
|
|
|
86
87
|
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/lists"
|
|
87
88
|
},
|
|
88
89
|
"typings": "index.d.ts",
|
|
89
|
-
"version": "
|
|
90
|
+
"version": "24.1.46",
|
|
90
91
|
"sideEffects": false,
|
|
91
92
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
92
93
|
}
|
package/src/common/list-base.js
CHANGED
|
@@ -280,18 +280,31 @@ export var ListBase;
|
|
|
280
280
|
li = generateLI(createElement, curItem, fieldData, fields, curOpt.itemClass, options, componentInstance);
|
|
281
281
|
li.classList.add(cssClass.level + '-' + ariaAttributes.level);
|
|
282
282
|
li.setAttribute('aria-level', ariaAttributes.level.toString());
|
|
283
|
-
if (ariaAttributes.groupItemRole
|
|
283
|
+
if (ariaAttributes.groupItemRole === 'presentation' || ariaAttributes.itemRole === 'presentation') {
|
|
284
284
|
li.removeAttribute('aria-level');
|
|
285
285
|
}
|
|
286
286
|
anchorElement = li.querySelector('.' + cssClass.anchorWrap);
|
|
287
287
|
// eslint-disable-next-line no-prototype-builtins
|
|
288
288
|
if (fieldData.hasOwnProperty(fields.tooltip)) {
|
|
289
|
-
var tooltipText =
|
|
289
|
+
var tooltipText = fieldData[fields.tooltip];
|
|
290
|
+
if (options && options.enableHtmlSanitizer) {
|
|
291
|
+
tooltipText = SanitizeHtmlHelper.sanitize(tooltipText);
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
var tooltipTextElement = createElement('span', { innerHTML: tooltipText });
|
|
295
|
+
tooltipText = tooltipTextElement.innerText;
|
|
296
|
+
tooltipTextElement = null;
|
|
297
|
+
}
|
|
290
298
|
li.setAttribute('title', tooltipText);
|
|
291
299
|
}
|
|
292
300
|
// eslint-disable-next-line no-prototype-builtins
|
|
293
301
|
if (fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) {
|
|
294
|
-
|
|
302
|
+
var htmlAttributes = fieldData[fields.htmlAttributes];
|
|
303
|
+
// Check if 'class' attribute is present and not an empty string
|
|
304
|
+
if (htmlAttributes.hasOwnProperty('class') && typeof htmlAttributes['class'] === 'string' && htmlAttributes['class'].trim() === '') {
|
|
305
|
+
delete htmlAttributes['class'];
|
|
306
|
+
}
|
|
307
|
+
setAttribute(li, htmlAttributes);
|
|
295
308
|
}
|
|
296
309
|
// eslint-disable-next-line no-prototype-builtins
|
|
297
310
|
if (fieldData.hasOwnProperty(fields.enabled) && fieldData[fields.enabled] === false) {
|
|
@@ -509,7 +522,6 @@ export var ListBase;
|
|
|
509
522
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
510
523
|
var fields = extend({}, ListBase.defaultMappedFields, curOpt.fields);
|
|
511
524
|
var curEle = element.cloneNode(true);
|
|
512
|
-
// eslint-disable-next-line
|
|
513
525
|
var jsonAr = [];
|
|
514
526
|
curEle.classList.add('json-parent');
|
|
515
527
|
var childs = curEle.querySelectorAll('.json-parent>li');
|
|
@@ -518,7 +530,6 @@ export var ListBase;
|
|
|
518
530
|
var li = childs[i];
|
|
519
531
|
var anchor = li.querySelector('a');
|
|
520
532
|
var ul = li.querySelector('ul');
|
|
521
|
-
// eslint-disable-next-line
|
|
522
533
|
var json = {};
|
|
523
534
|
var childNodes = anchor ? anchor.childNodes : li.childNodes;
|
|
524
535
|
var keys = Object.keys(childNodes);
|
|
@@ -592,7 +603,6 @@ export var ListBase;
|
|
|
592
603
|
var ulElement = createElement('ul', { className: cssClass.ul, attrs: { role: 'presentation' } });
|
|
593
604
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
594
605
|
var curFields = extend({}, ListBase.defaultMappedFields, fields);
|
|
595
|
-
// eslint-disable-next-line
|
|
596
606
|
var compiledString = compileTemplate(template);
|
|
597
607
|
var liCollection = [];
|
|
598
608
|
var value;
|
|
@@ -641,7 +651,7 @@ export var ListBase;
|
|
|
641
651
|
else {
|
|
642
652
|
var currentID = isHeader ? curOpt.groupTemplateID : curOpt.templateID;
|
|
643
653
|
if (isHeader) {
|
|
644
|
-
if (componentInstance && componentInstance.getModuleName()
|
|
654
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
645
655
|
// eslint-disable-next-line
|
|
646
656
|
var compiledElement = compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate, null, li);
|
|
647
657
|
if (compiledElement) {
|
|
@@ -699,7 +709,6 @@ export var ListBase;
|
|
|
699
709
|
function renderGroupTemplate(groupTemplate, groupDataSource, fields,
|
|
700
710
|
// eslint-disable-next-line
|
|
701
711
|
headerItems, options, componentInstance) {
|
|
702
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
703
712
|
var compiledString = compileTemplate(groupTemplate);
|
|
704
713
|
var curFields = extend({}, ListBase.defaultMappedFields, fields);
|
|
705
714
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
@@ -709,7 +718,7 @@ export var ListBase;
|
|
|
709
718
|
var headerData = {};
|
|
710
719
|
headerData["" + category] = header.textContent;
|
|
711
720
|
header.innerHTML = '';
|
|
712
|
-
if (componentInstance && componentInstance.getModuleName() !==
|
|
721
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
713
722
|
// eslint-disable-next-line
|
|
714
723
|
var compiledElement = compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, header);
|
|
715
724
|
if (compiledElement) {
|
|
@@ -745,7 +754,6 @@ export var ListBase;
|
|
|
745
754
|
// Create expand and collapse node
|
|
746
755
|
if (!!options.expandCollapse && hasChildren && !options.template) {
|
|
747
756
|
element.firstElementChild.classList.add(cssClass.iconWrapper);
|
|
748
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
749
757
|
var expandElement = options.expandIconPosition === 'Left' ? prepend : append;
|
|
750
758
|
expandElement([createElement('div', { className: 'e-icons ' + options.expandIconClass })], element.querySelector('.' + cssClass.textContent));
|
|
751
759
|
}
|
|
@@ -891,9 +899,8 @@ export var ListBase;
|
|
|
891
899
|
li.setAttribute('data-uid', generateId());
|
|
892
900
|
}
|
|
893
901
|
if (grpLI && options && options.groupTemplate) {
|
|
894
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
895
902
|
var compiledString = compileTemplate(options.groupTemplate);
|
|
896
|
-
if (componentInstance && componentInstance.getModuleName() !==
|
|
903
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
897
904
|
// eslint-disable-next-line
|
|
898
905
|
var compiledElement = compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, li);
|
|
899
906
|
if (compiledElement) {
|
|
@@ -905,7 +912,6 @@ export var ListBase;
|
|
|
905
912
|
}
|
|
906
913
|
}
|
|
907
914
|
else if (!grpLI && options && options.template) {
|
|
908
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
909
915
|
var compiledString = compileTemplate(options.template);
|
|
910
916
|
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
911
917
|
// eslint-disable-next-line
|
|
@@ -977,7 +983,6 @@ export var ListBase;
|
|
|
977
983
|
function generateIcon(createElement, liElement, className, options) {
|
|
978
984
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
979
985
|
cssClass = getModuleClass(curOpt.moduleName);
|
|
980
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
981
986
|
var expandElement = curOpt.expandIconPosition === 'Left' ? prepend : append;
|
|
982
987
|
expandElement([createElement('div', {
|
|
983
988
|
className: 'e-icons ' + curOpt.expandIconClass + ' ' +
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Virtualization } from './virtualization';import { merge, formatUnit, isNullOrUndefined, append, detach, ModuleDeclaration, extend } from '@syncfusion/ej2-base';import { attributes, addClass, removeClass, prepend, closest, remove } from '@syncfusion/ej2-base';import { Component, EventHandler, BaseEventArgs, Property, Complex, Event } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty } from '@syncfusion/ej2-base';import { KeyboardEventArgs, EmitType, compile, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { Animation, AnimationOptions, Effect, rippleEffect, Touch, SwipeEventArgs, animationMode } from '@syncfusion/ej2-base';import { DataManager, Query } from '@syncfusion/ej2-data';import { createCheckBox } from '@syncfusion/ej2-buttons';import { ListBase, ListBaseOptions, SortOrder, getFieldValues, FieldsMapping } from '../common/list-base';
|
|
2
|
-
import {AnimationSettings,checkBoxPosition,SelectEventArgs} from "./list-view";
|
|
2
|
+
import {AnimationSettings,checkBoxPosition,SelectEventArgs,ScrolledEventArgs} from "./list-view";
|
|
3
3
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -314,4 +314,11 @@ export interface ListViewModel extends ComponentModel{
|
|
|
314
314
|
*/
|
|
315
315
|
actionFailure?: EmitType<MouseEvent>;
|
|
316
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Triggers when scrollbar of the ListView component reaches to the top or bottom.
|
|
319
|
+
*
|
|
320
|
+
* @event 'object'
|
|
321
|
+
*/
|
|
322
|
+
scroll?: EmitType<ScrolledEventArgs>;
|
|
323
|
+
|
|
317
324
|
}
|
|
@@ -167,6 +167,7 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
167
167
|
private enabledItems;
|
|
168
168
|
private disabledItems;
|
|
169
169
|
private isOffline;
|
|
170
|
+
private previousScrollTop;
|
|
170
171
|
/**
|
|
171
172
|
* The `cssClass` property is used to add a user-preferred class name in the root element of the ListView,
|
|
172
173
|
* using which we can customize the component (both CSS and functionality customization)
|
|
@@ -383,6 +384,12 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
383
384
|
*
|
|
384
385
|
*/
|
|
385
386
|
actionFailure: EmitType<MouseEvent>;
|
|
387
|
+
/**
|
|
388
|
+
* Triggers when scrollbar of the ListView component reaches to the top or bottom.
|
|
389
|
+
*
|
|
390
|
+
* @event 'object'
|
|
391
|
+
*/
|
|
392
|
+
scroll: EmitType<ScrolledEventArgs>;
|
|
386
393
|
/**
|
|
387
394
|
* Constructor for creating the widget
|
|
388
395
|
*
|
|
@@ -584,6 +591,7 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
584
591
|
private findParent;
|
|
585
592
|
protected getModuleName(): string;
|
|
586
593
|
requiredModules(): ModuleDeclaration[];
|
|
594
|
+
private onListScroll;
|
|
587
595
|
/**
|
|
588
596
|
* Get the properties to be maintained in the persisted state.
|
|
589
597
|
*/
|
|
@@ -648,6 +656,15 @@ export interface ListSelectedItem {
|
|
|
648
656
|
*/
|
|
649
657
|
parentId?: string[];
|
|
650
658
|
}
|
|
659
|
+
/**
|
|
660
|
+
* An enum type that denotes the ListView scroll direction when it reaches the end.
|
|
661
|
+
* ```props
|
|
662
|
+
* Top:- The scrollbar is moved upwards.
|
|
663
|
+
* Bottom:- The scrollbar is moved downwards.
|
|
664
|
+
|
|
665
|
+
* ```
|
|
666
|
+
*/
|
|
667
|
+
export declare type direction = 'Top' | 'Bottom';
|
|
651
668
|
/**
|
|
652
669
|
* An interface that holds selected item.
|
|
653
670
|
*/
|
|
@@ -785,6 +802,23 @@ export interface SelectEventArgs extends BaseEventArgs, SelectedItem {
|
|
|
785
802
|
*/
|
|
786
803
|
cancel: boolean;
|
|
787
804
|
}
|
|
805
|
+
/**
|
|
806
|
+
* An interface that holds scrolled event arguments
|
|
807
|
+
*/
|
|
808
|
+
export interface ScrolledEventArgs {
|
|
809
|
+
/**
|
|
810
|
+
* Specifies the direction “Top” or “Bottom” in which the scrolling occurs.
|
|
811
|
+
*/
|
|
812
|
+
scrollDirection: direction;
|
|
813
|
+
/**
|
|
814
|
+
* Specifies the default scroll event arguments.
|
|
815
|
+
*/
|
|
816
|
+
originalEvent: Event;
|
|
817
|
+
/**
|
|
818
|
+
* Specifies the distance from the scrollbar to the top and bottom ends.
|
|
819
|
+
*/
|
|
820
|
+
distanceY: number;
|
|
821
|
+
}
|
|
788
822
|
/**
|
|
789
823
|
* An interface that holds item created event arguments
|
|
790
824
|
*/
|
|
@@ -314,7 +314,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
314
314
|
this.headerEle.appendChild(hedBackButton);
|
|
315
315
|
this.headerEle.appendChild(textEle);
|
|
316
316
|
if (this.headerTemplate) {
|
|
317
|
-
// eslint-disable-next-line
|
|
318
317
|
var compiledString = compile(this.headerTemplate);
|
|
319
318
|
var headerTemplateEle = this.createElement('div', { className: classNames.headerTemplateText });
|
|
320
319
|
// eslint-disable-next-line
|
|
@@ -434,7 +433,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
434
433
|
itemCreated: this.renderCheckbox.bind(this),
|
|
435
434
|
templateID: "" + this.element.id + LISTVIEW_TEMPLATE_PROPERTY,
|
|
436
435
|
groupTemplateID: "" + this.element.id + LISTVIEW_GROUPTEMPLATE_PROPERTY,
|
|
437
|
-
enableHtmlSanitizer: this.enableHtmlSanitizer
|
|
436
|
+
enableHtmlSanitizer: this.enableHtmlSanitizer
|
|
438
437
|
};
|
|
439
438
|
this.initialization();
|
|
440
439
|
};
|
|
@@ -476,8 +475,8 @@ var ListView = /** @class */ (function (_super) {
|
|
|
476
475
|
if (typeof this.dataSource[0] !== 'string' && typeof this.dataSource[0] !== 'number') {
|
|
477
476
|
fieldData_1 = getFieldValues(args.curData, this.listBaseOption.fields);
|
|
478
477
|
if (this.enablePersistence && !isNullOrUndefined(this.selectedId)) {
|
|
479
|
-
var index = this.selectedId.findIndex(function (e) { return e
|
|
480
|
-
if (index
|
|
478
|
+
var index = this.selectedId.findIndex(function (e) { return e === fieldData_1[_this.listBaseOption.fields.id].toString(); });
|
|
479
|
+
if (index !== -1) {
|
|
481
480
|
this.checkInternally(args, checkboxElement);
|
|
482
481
|
}
|
|
483
482
|
}
|
|
@@ -490,7 +489,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
490
489
|
this.checkInternally(args, checkboxElement);
|
|
491
490
|
}
|
|
492
491
|
checkboxElement.setAttribute('aria-checked', frameElement_1.classList.contains(classNames.checked) ? 'true' : 'false');
|
|
493
|
-
checkboxElement.setAttribute('aria-label',
|
|
492
|
+
checkboxElement.setAttribute('aria-label', args.text);
|
|
494
493
|
if (this.checkBoxPosition === 'Left') {
|
|
495
494
|
checkboxElement.classList.add(classNames.checkboxLeft);
|
|
496
495
|
args.item.firstElementChild.classList.add(classNames.checkboxLeft);
|
|
@@ -687,7 +686,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
687
686
|
}
|
|
688
687
|
else {
|
|
689
688
|
this.setCheckboxLI(li, e);
|
|
690
|
-
if ((target.nodeName
|
|
689
|
+
if ((target.nodeName === 'INPUT') || (target.nodeName === 'TEXTAREA')) {
|
|
691
690
|
target.classList.add('e-focused');
|
|
692
691
|
this.targetElement = target;
|
|
693
692
|
}
|
|
@@ -695,7 +694,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
695
694
|
}
|
|
696
695
|
else {
|
|
697
696
|
this.setSelectLI(li, e);
|
|
698
|
-
if ((target.nodeName
|
|
697
|
+
if ((target.nodeName === 'INPUT') || (target.nodeName === 'TEXTAREA')) {
|
|
699
698
|
target.classList.add('e-focused');
|
|
700
699
|
this.targetElement = target;
|
|
701
700
|
}
|
|
@@ -957,6 +956,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
957
956
|
EventHandler.add(this.element, 'mouseout', this.leaveHandler, this);
|
|
958
957
|
EventHandler.add(this.element, 'focusout', this.focusout, this);
|
|
959
958
|
this.touchModule = new Touch(this.element, { swipe: this.swipeActionHandler.bind(this) });
|
|
959
|
+
if (!isNullOrUndefined(this.scroll)) {
|
|
960
|
+
EventHandler.add(this.element, 'scroll', this.onListScroll, this);
|
|
961
|
+
}
|
|
960
962
|
};
|
|
961
963
|
ListView.prototype.unWireEvents = function () {
|
|
962
964
|
EventHandler.remove(this.element, 'click', this.clickHandler);
|
|
@@ -964,6 +966,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
964
966
|
EventHandler.remove(this.element, 'mouseout', this.leaveHandler);
|
|
965
967
|
EventHandler.remove(this.element, 'mouseover', this.hoverHandler);
|
|
966
968
|
EventHandler.remove(this.element, 'mouseout', this.leaveHandler);
|
|
969
|
+
if (!isNullOrUndefined(this.scroll)) {
|
|
970
|
+
EventHandler.remove(this.element, 'scroll', this.onListScroll);
|
|
971
|
+
}
|
|
967
972
|
this.touchModule.destroy();
|
|
968
973
|
this.touchModule = null;
|
|
969
974
|
};
|
|
@@ -1047,7 +1052,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1047
1052
|
}
|
|
1048
1053
|
else {
|
|
1049
1054
|
selectedItem =
|
|
1050
|
-
// eslint-disable-next-line
|
|
1051
1055
|
{
|
|
1052
1056
|
item: li, text: fieldData && fieldData[this.listBaseOption.fields.text],
|
|
1053
1057
|
// eslint-disable-next-line
|
|
@@ -1289,7 +1293,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1289
1293
|
this.removeElement(this.headerEle);
|
|
1290
1294
|
this.removeElement(this.ulElement);
|
|
1291
1295
|
this.removeElement(this.contentContainer);
|
|
1292
|
-
// eslint-disable-next-line
|
|
1293
1296
|
if (this.isReact) {
|
|
1294
1297
|
this.clearTemplate();
|
|
1295
1298
|
}
|
|
@@ -1328,7 +1331,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1328
1331
|
ListView.prototype.UpdateCurrentUL = function () {
|
|
1329
1332
|
this.ulElement = this.curUL = this.element.querySelector('.' + classNames.parentItem);
|
|
1330
1333
|
if (this.curUL) {
|
|
1331
|
-
// eslint-disable-next-line
|
|
1332
1334
|
this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
|
|
1333
1335
|
}
|
|
1334
1336
|
};
|
|
@@ -1343,7 +1345,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1343
1345
|
if (!ele) {
|
|
1344
1346
|
var data = this.curViewDS;
|
|
1345
1347
|
ele = ListBase.createListFromJson(this.createElement, data, this.listBaseOption, this.curDSLevel.length, null, this);
|
|
1346
|
-
// eslint-disable-next-line
|
|
1347
1348
|
if (this.isReact) {
|
|
1348
1349
|
this.renderReactTemplates();
|
|
1349
1350
|
}
|
|
@@ -1357,7 +1358,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1357
1358
|
this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
|
|
1358
1359
|
if (this.selectedItems) {
|
|
1359
1360
|
var fieldData = getFieldValues(this.selectedItems.data, this.listBaseOption.fields);
|
|
1360
|
-
// eslint-disable-next-line
|
|
1361
1361
|
this.header((fieldData[this.listBaseOption.fields.text]), true, 'header');
|
|
1362
1362
|
}
|
|
1363
1363
|
this.selectedLI = undefined;
|
|
@@ -1381,7 +1381,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1381
1381
|
this.contentContainer = this.createElement('div', { className: classNames.container });
|
|
1382
1382
|
this.element.appendChild(this.contentContainer);
|
|
1383
1383
|
this.renderIntoDom(this.ulElement);
|
|
1384
|
-
// eslint-disable-next-line
|
|
1385
1384
|
if (this.isReact) {
|
|
1386
1385
|
this.renderReactTemplates();
|
|
1387
1386
|
}
|
|
@@ -1390,7 +1389,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1390
1389
|
ListView.prototype.getElementUID = function (obj) {
|
|
1391
1390
|
var fields = {};
|
|
1392
1391
|
if (obj instanceof Element) {
|
|
1393
|
-
// eslint-disable-next-line
|
|
1394
1392
|
fields[this.fields.id] = obj.getAttribute('data-uid');
|
|
1395
1393
|
}
|
|
1396
1394
|
else {
|
|
@@ -1416,12 +1414,12 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1416
1414
|
selector: '.' + classNames.listItem
|
|
1417
1415
|
});
|
|
1418
1416
|
this.renderComplete();
|
|
1417
|
+
this.previousScrollTop = this.element.scrollTop;
|
|
1419
1418
|
};
|
|
1420
1419
|
/**
|
|
1421
1420
|
* It is used to destroy the ListView component.
|
|
1422
1421
|
*/
|
|
1423
1422
|
ListView.prototype.destroy = function () {
|
|
1424
|
-
// eslint-disable-next-line
|
|
1425
1423
|
if (this.isReact) {
|
|
1426
1424
|
this.clearTemplate();
|
|
1427
1425
|
}
|
|
@@ -1463,7 +1461,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1463
1461
|
toUL = toUL.parentElement;
|
|
1464
1462
|
}
|
|
1465
1463
|
var fieldData = getFieldValues(this.curDSJSON, this.listBaseOption.fields);
|
|
1466
|
-
// eslint-disable-next-line
|
|
1467
1464
|
var text = fieldData[this.fields.text];
|
|
1468
1465
|
this.switchView(fromUL, toUL, true);
|
|
1469
1466
|
this.removeFocus();
|
|
@@ -1536,7 +1533,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1536
1533
|
if (!this.enableVirtualization && isNullOrUndefined(li)) {
|
|
1537
1534
|
var curLi = this.element.querySelectorAll('.' + classNames.listItem);
|
|
1538
1535
|
for (var i = 0; i < curLi.length; i++) {
|
|
1539
|
-
// eslint-disable-next-line
|
|
1540
1536
|
if (curLi[i].innerText.trim() === fieldData[this.fields.text]) {
|
|
1541
1537
|
li = curLi[i];
|
|
1542
1538
|
}
|
|
@@ -1586,7 +1582,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1586
1582
|
*
|
|
1587
1583
|
*/
|
|
1588
1584
|
ListView.prototype.getSelectedItems = function () {
|
|
1589
|
-
// eslint-disable-next-line
|
|
1590
1585
|
var finalValue;
|
|
1591
1586
|
var isCompleted = false;
|
|
1592
1587
|
this.selectedId = [];
|
|
@@ -1597,7 +1592,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1597
1592
|
isCompleted = true;
|
|
1598
1593
|
}
|
|
1599
1594
|
else if (this.showCheckBox && !isCompleted) {
|
|
1600
|
-
// eslint-disable-next-line
|
|
1601
1595
|
var liCollection = this.curUL.getElementsByClassName(classNames.selected);
|
|
1602
1596
|
var liTextCollection = [];
|
|
1603
1597
|
var liDataCollection = [];
|
|
@@ -1617,9 +1611,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1617
1611
|
liDataCollection.push(tempData);
|
|
1618
1612
|
}
|
|
1619
1613
|
if (fieldData) {
|
|
1620
|
-
// eslint-disable-next-line
|
|
1621
1614
|
liTextCollection.push(fieldData[this.listBaseOption.fields.text]);
|
|
1622
|
-
// eslint-disable-next-line
|
|
1623
1615
|
this.selectedId.push(fieldData[this.listBaseOption.fields.id]);
|
|
1624
1616
|
}
|
|
1625
1617
|
else {
|
|
@@ -1661,7 +1653,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1661
1653
|
isCompleted = true;
|
|
1662
1654
|
}
|
|
1663
1655
|
else {
|
|
1664
|
-
// eslint-disable-next-line
|
|
1665
1656
|
this.selectedId.push(fieldData[this.listBaseOption.fields.id]);
|
|
1666
1657
|
finalValue = {
|
|
1667
1658
|
text: fieldData[this.listBaseOption.fields.text], item: liElement,
|
|
@@ -1719,7 +1710,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1719
1710
|
if (li) {
|
|
1720
1711
|
li.classList.add(classNames.disable);
|
|
1721
1712
|
}
|
|
1722
|
-
// eslint-disable-next-line
|
|
1723
1713
|
resultJSON[this.fields.enabled] = false;
|
|
1724
1714
|
}
|
|
1725
1715
|
}
|
|
@@ -1755,7 +1745,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1755
1745
|
li.style.display = display;
|
|
1756
1746
|
}
|
|
1757
1747
|
if (isHide) {
|
|
1758
|
-
// eslint-disable-next-line
|
|
1759
1748
|
resultJSON[this.fields.isVisible] = false;
|
|
1760
1749
|
}
|
|
1761
1750
|
else {
|
|
@@ -1839,7 +1828,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1839
1828
|
return newDataSource;
|
|
1840
1829
|
};
|
|
1841
1830
|
ListView.prototype.addItemInNestedList = function (targetItemData, itemQueue) {
|
|
1842
|
-
// eslint-disable-next-line
|
|
1843
1831
|
var targetItemId = targetItemData[this.fields.id];
|
|
1844
1832
|
var targetChildDS = targetItemData[this.fields.child];
|
|
1845
1833
|
var isAlreadyRenderedUL = this.element.querySelector('[pid=\'' + targetItemId + '\']');
|
|
@@ -1883,7 +1871,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1883
1871
|
this.getLiFromObjOrElement(curViewDS[index + 2]) || null;
|
|
1884
1872
|
var li = ListBase.createListItemFromJson(this.createElement, [dataSource], this.listBaseOption, null, null, this);
|
|
1885
1873
|
this.setAttributes(li);
|
|
1886
|
-
// eslint-disable-next-line
|
|
1887
1874
|
if (this.template && this.isReact) {
|
|
1888
1875
|
this.renderReactTemplates();
|
|
1889
1876
|
}
|
|
@@ -1916,11 +1903,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1916
1903
|
var curViewDS = this.curViewDS;
|
|
1917
1904
|
var fields = obj instanceof Element ? this.getElementUID(obj) : obj;
|
|
1918
1905
|
var dataSource;
|
|
1919
|
-
// eslint-disable-next-line prefer-const
|
|
1920
1906
|
dataSource = this.findItemFromDS(listDataSource, fields, true);
|
|
1921
1907
|
if (dataSource) {
|
|
1922
1908
|
var data_1;
|
|
1923
|
-
// eslint-disable-next-line prefer-const
|
|
1924
1909
|
data_1 = this.findItemFromDS(dataSource, fields);
|
|
1925
1910
|
var index = curViewDS.indexOf(data_1);
|
|
1926
1911
|
var li = this.getLiFromObjOrElement(obj);
|
|
@@ -1941,11 +1926,8 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1941
1926
|
if (groupLi) {
|
|
1942
1927
|
detach(groupLi);
|
|
1943
1928
|
}
|
|
1944
|
-
// eslint-disable-next-line
|
|
1945
1929
|
var foundData = (dataSource.length - 1) <= 0
|
|
1946
|
-
? this.findParent(this.localData, this.fields.id,
|
|
1947
|
-
// eslint-disable-next-line
|
|
1948
|
-
function (value) { return value === data_1[_this.fields.id]; }, null) : null;
|
|
1930
|
+
? this.findParent(this.localData, this.fields.id, function (value) { return value === data_1[_this.fields.id]; }, null) : null;
|
|
1949
1931
|
var dsIndex = dataSource.indexOf(data_1);
|
|
1950
1932
|
dataSource.splice(dsIndex, 1);
|
|
1951
1933
|
this.setViewDataSource(listDataSource);
|
|
@@ -1988,16 +1970,13 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1988
1970
|
}
|
|
1989
1971
|
}
|
|
1990
1972
|
};
|
|
1991
|
-
// eslint-disable-next-line
|
|
1992
1973
|
ListView.prototype.findParent = function (dataSource, id, callback, parent) {
|
|
1993
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
1994
1974
|
if (dataSource.hasOwnProperty(id) && callback(dataSource[id]) === true) {
|
|
1995
1975
|
return extend({}, dataSource);
|
|
1996
1976
|
}
|
|
1997
1977
|
for (var i = 0; i < Object.keys(dataSource).length; i++) {
|
|
1998
1978
|
if (dataSource[Object.keys(dataSource)[i]]
|
|
1999
1979
|
&& typeof dataSource[Object.keys(dataSource)[i]] === 'object') {
|
|
2000
|
-
// eslint-disable-next-line
|
|
2001
1980
|
var result = this.findParent(dataSource[Object.keys(dataSource)[i]], id, callback, dataSource);
|
|
2002
1981
|
if (result != null) {
|
|
2003
1982
|
if (!result.parent) {
|
|
@@ -2020,6 +1999,21 @@ var ListView = /** @class */ (function (_super) {
|
|
|
2020
1999
|
}
|
|
2021
2000
|
return modules;
|
|
2022
2001
|
};
|
|
2002
|
+
ListView.prototype.onListScroll = function (e) {
|
|
2003
|
+
var args = { originalEvent: e, scrollDirection: "Bottom", distanceY: this.element.scrollHeight - this.element.scrollTop };
|
|
2004
|
+
var currentScrollTop = this.element.scrollTop;
|
|
2005
|
+
if (currentScrollTop > this.previousScrollTop) {
|
|
2006
|
+
args.scrollDirection = "Bottom";
|
|
2007
|
+
args.distanceY = this.element.scrollHeight - this.element.clientHeight - this.element.scrollTop;
|
|
2008
|
+
this.trigger('scroll', args);
|
|
2009
|
+
}
|
|
2010
|
+
else if (this.previousScrollTop > currentScrollTop) {
|
|
2011
|
+
args.scrollDirection = "Top";
|
|
2012
|
+
args.distanceY = this.element.scrollTop;
|
|
2013
|
+
this.trigger('scroll', args);
|
|
2014
|
+
}
|
|
2015
|
+
this.previousScrollTop = currentScrollTop;
|
|
2016
|
+
};
|
|
2023
2017
|
/**
|
|
2024
2018
|
* Get the properties to be maintained in the persisted state.
|
|
2025
2019
|
*/
|
|
@@ -2100,6 +2094,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
2100
2094
|
__decorate([
|
|
2101
2095
|
Event()
|
|
2102
2096
|
], ListView.prototype, "actionFailure", void 0);
|
|
2097
|
+
__decorate([
|
|
2098
|
+
Event()
|
|
2099
|
+
], ListView.prototype, "scroll", void 0);
|
|
2103
2100
|
ListView = __decorate([
|
|
2104
2101
|
NotifyPropertyChanges
|
|
2105
2102
|
], ListView);
|
|
@@ -164,7 +164,7 @@ var Virtualization = /** @class */ (function () {
|
|
|
164
164
|
var _a;
|
|
165
165
|
var startingHeight;
|
|
166
166
|
var curViewDS = this.listViewInstance.curViewDS;
|
|
167
|
-
this.listItemHeight = select(
|
|
167
|
+
this.listItemHeight = select('.e-list-item', this.listViewInstance.element).getBoundingClientRect().height;
|
|
168
168
|
this.totalHeight = (Object.keys(curViewDS).length * this.listItemHeight) - (this.domItemCount * this.listItemHeight);
|
|
169
169
|
if (this.listViewInstance.isWindow) {
|
|
170
170
|
startingHeight = this.listViewInstance.ulElement.getBoundingClientRect().top -
|
|
@@ -531,7 +531,6 @@ var Virtualization = /** @class */ (function () {
|
|
|
531
531
|
var curViewDS = this.listViewInstance.curViewDS;
|
|
532
532
|
// eslint-disable-next-line
|
|
533
533
|
var resutJSON = this.findDSAndIndexFromId(curViewDS, obj);
|
|
534
|
-
// eslint-disable-next-line
|
|
535
534
|
if (Object.keys(resutJSON).length) {
|
|
536
535
|
dataSource = resutJSON.data;
|
|
537
536
|
if (curViewDS[resutJSON.index - 1] &&
|
|
@@ -795,7 +794,7 @@ var Virtualization = /** @class */ (function () {
|
|
|
795
794
|
this.refreshItemHeight();
|
|
796
795
|
};
|
|
797
796
|
Virtualization.prototype.createUIItem = function (args) {
|
|
798
|
-
if (!args.item.classList.contains(
|
|
797
|
+
if (!args.item.classList.contains('e-list-group-item')) {
|
|
799
798
|
this.templateData = args.curData.isHeader ? args.curData.items[0] :
|
|
800
799
|
args.curData;
|
|
801
800
|
if (this.listViewInstance.showCheckBox) {
|
|
@@ -852,7 +851,6 @@ var Virtualization = /** @class */ (function () {
|
|
|
852
851
|
this.listViewInstance.setLocalData();
|
|
853
852
|
};
|
|
854
853
|
Virtualization.prototype.updateUI = function (element, index, targetElement) {
|
|
855
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
856
854
|
var onChange = this.isNgTemplate() ? this.onNgChange : this.onChange;
|
|
857
855
|
if (this.listViewInstance.template || this.listViewInstance.groupTemplate) {
|
|
858
856
|
var curViewDS = this.listViewInstance.curViewDS[index];
|
|
@@ -893,7 +891,6 @@ var Virtualization = /** @class */ (function () {
|
|
|
893
891
|
};
|
|
894
892
|
Virtualization.prototype.onNgChange = function (newData, listElement, virtualThis) {
|
|
895
893
|
// compile given target element with template for new data
|
|
896
|
-
// eslint-disable-next-line
|
|
897
894
|
var templateCompiler = compile(virtualThis.listViewInstance.template);
|
|
898
895
|
var resultElement = templateCompiler(newData);
|
|
899
896
|
while (listElement.lastChild) {
|
package/styles/bootstrap4.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
.e-bigger .e-listview:not(.e-list-template) .e-list-item,
|
|
23
23
|
.e-listview.e-bigger:not(.e-list-template) .e-list-item {
|
|
24
24
|
height: 50px;
|
|
25
|
-
line-height: 1.
|
|
25
|
+
line-height: 1.6;
|
|
26
26
|
position: relative;
|
|
27
27
|
padding: 12px 20px;
|
|
28
28
|
}
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
.e-listview:not(.e-list-template) .e-list-item {
|
|
108
108
|
height: 40px;
|
|
109
|
-
line-height: 1.
|
|
109
|
+
line-height: 1.6;
|
|
110
110
|
padding: 8px 16px 8px 16px;
|
|
111
111
|
position: relative;
|
|
112
112
|
}
|
package/styles/bootstrap5.css
CHANGED
|
@@ -11,7 +11,7 @@ $listview-background: $content-bg !default;
|
|
|
11
11
|
$listview-line-color: rgba($black, .13) !default;
|
|
12
12
|
$listview-item-hover-bg: darken($gray-100, 5%) !default;
|
|
13
13
|
$listview-item-height: 40px !default;
|
|
14
|
-
$listview-item-line-height: 1.
|
|
14
|
+
$listview-item-line-height: 1.6 !default;
|
|
15
15
|
$listview-item-padding: 8px 16px 8px 16px !default;
|
|
16
16
|
|
|
17
17
|
$listview-root-border-color: rgba($black, .13);
|
|
@@ -62,7 +62,7 @@ $listview-back-padding-right: 10px !default;
|
|
|
62
62
|
$listview-back-icon-height: 0 !default;
|
|
63
63
|
$listview-back-icon-font-size: 14px !default;
|
|
64
64
|
$listview-touch-item-height: 50px !default;
|
|
65
|
-
$listview-touch-item-line-height: 1.
|
|
65
|
+
$listview-touch-item-line-height: 1.6 !default;
|
|
66
66
|
$listview-touch-item-font-size: 16px !default;
|
|
67
67
|
$listview-touch-groupheader-height: 50px !default;
|
|
68
68
|
$listview-touch-groupheader-line-height: 1.5 !default;
|
|
@@ -29,7 +29,7 @@ $listview-font-size: $text-sm !default;
|
|
|
29
29
|
$listview-back-padding-right: 8px !default;
|
|
30
30
|
$listview-back-icon-size: 20px !default;
|
|
31
31
|
$listview-touch-item-height: 40px !default;
|
|
32
|
-
$listview-touch-item-line-height:
|
|
32
|
+
$listview-touch-item-line-height: 24px !default;
|
|
33
33
|
$listview-touch-item-size: 24px !default;
|
|
34
34
|
$listview-touch-item-padding: 16px 14px 12px 16px !default;
|
|
35
35
|
$listview-rtl-touch-item-padding: 12px 16px 12px 14px !default;
|