@syncfusion/ej2-dropdowns 21.2.8 → 21.2.10

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +32 -6
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +37 -11
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +37 -11
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +11 -11
  13. package/src/drop-down-base/drop-down-base.js +3 -0
  14. package/src/drop-down-list/drop-down-list.js +5 -5
  15. package/src/list-box/list-box.d.ts +1 -0
  16. package/src/list-box/list-box.js +20 -0
  17. package/src/multi-select/multi-select-model.d.ts +1 -1
  18. package/src/multi-select/multi-select.js +9 -6
  19. package/styles/bootstrap-dark.css +207 -99
  20. package/styles/bootstrap.css +209 -100
  21. package/styles/bootstrap4.css +209 -100
  22. package/styles/bootstrap5-dark.css +207 -99
  23. package/styles/bootstrap5.css +207 -99
  24. package/styles/fabric-dark.css +207 -99
  25. package/styles/fabric.css +209 -100
  26. package/styles/fluent-dark.css +209 -100
  27. package/styles/fluent.css +209 -100
  28. package/styles/highcontrast-light.css +207 -99
  29. package/styles/highcontrast.css +209 -100
  30. package/styles/list-box/_layout.scss +8 -2
  31. package/styles/list-box/_theme.scss +2 -1
  32. package/styles/list-box/bootstrap-dark.css +207 -99
  33. package/styles/list-box/bootstrap.css +209 -100
  34. package/styles/list-box/bootstrap4.css +209 -100
  35. package/styles/list-box/bootstrap5-dark.css +207 -99
  36. package/styles/list-box/bootstrap5.css +207 -99
  37. package/styles/list-box/fabric-dark.css +207 -99
  38. package/styles/list-box/fabric.css +209 -100
  39. package/styles/list-box/fluent-dark.css +209 -100
  40. package/styles/list-box/fluent.css +209 -100
  41. package/styles/list-box/highcontrast-light.css +207 -99
  42. package/styles/list-box/highcontrast.css +209 -100
  43. package/styles/list-box/material-dark.css +207 -99
  44. package/styles/list-box/material.css +209 -100
  45. package/styles/list-box/tailwind-dark.css +209 -100
  46. package/styles/list-box/tailwind.css +209 -100
  47. package/styles/material-dark.css +207 -99
  48. package/styles/material.css +209 -100
  49. package/styles/tailwind-dark.css +209 -100
  50. package/styles/tailwind.css +209 -100
  51. package/.eslintrc.json +0 -259
  52. package/tslint.json +0 -111
@@ -1,5 +1,5 @@
1
1
  import { Animation, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, append, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getComponent, getUniqueID, getValue, isNullOrUndefined, isUndefined, matches, prepend, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
2
- import { DataManager, DataUtil, Predicate, Query } from '@syncfusion/ej2-data';
2
+ import { DataManager, DataUtil, JsonAdaptor, Predicate, Query } from '@syncfusion/ej2-data';
3
3
  import { ListBase, Sortable, cssClass, moveTo } from '@syncfusion/ej2-lists';
4
4
  import { Popup, createSpinner, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
5
5
  import { Input, TextBox } from '@syncfusion/ej2-inputs';
@@ -1373,6 +1373,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1373
1373
  }
1374
1374
  }
1375
1375
  }
1376
+ if (this.getModuleName() === 'listbox' && this.isReact) {
1377
+ this.renderReactTemplates();
1378
+ }
1376
1379
  if (selectedItemValue || itemIndex === 0) {
1377
1380
  this.updateSelection();
1378
1381
  }
@@ -2445,7 +2448,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2445
2448
  this.removeSelection();
2446
2449
  li.classList.add(dropDownBaseClasses.selected);
2447
2450
  this.removeHover();
2448
- var value = this.getFormattedValue(li.getAttribute('data-value'));
2451
+ var value = li.getAttribute('data-value') !== "null" ? this.getFormattedValue(li.getAttribute('data-value')) : null;
2449
2452
  var selectedData = this.getDataByValue(value);
2450
2453
  if (!this.initial && !preventSelect && !isNullOrUndefined(e)) {
2451
2454
  var items = this.detachChanges(selectedData);
@@ -2561,7 +2564,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2561
2564
  }
2562
2565
  if (Browser.info.name !== 'mozilla') {
2563
2566
  if (this.targetElement()) {
2564
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id !== '' ? this.inputElement.id : this.element.id });
2567
+ if (this.getModuleName() !== 'combobox') {
2568
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id !== '' ? this.inputElement.id : this.element.id });
2569
+ }
2565
2570
  this.targetElement().removeAttribute('aria-live');
2566
2571
  }
2567
2572
  }
@@ -2614,9 +2619,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2614
2619
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2615
2620
  var valueCompTemp = compiledString(this.itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, this.valueTempElement);
2616
2621
  if (valueCompTemp && valueCompTemp.length > 0) {
2617
- for (var i = 0; i < valueCompTemp.length; i++) {
2618
- this.valueTempElement.appendChild(valueCompTemp[i]);
2619
- }
2622
+ append(valueCompTemp, this.valueTempElement);
2620
2623
  }
2621
2624
  this.renderReactTemplates();
2622
2625
  };
@@ -9466,7 +9469,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9466
9469
  predicate = predicate.or(field, 'equal', valuecheck[i]);
9467
9470
  }
9468
9471
  }
9469
- return this.getQuery(this.query).where(predicate);
9472
+ if (this.dataSource instanceof DataManager && this.dataSource.adaptor instanceof JsonAdaptor) {
9473
+ return new Query().where(predicate);
9474
+ }
9475
+ else {
9476
+ return this.getQuery(this.query).clone().where(predicate);
9477
+ }
9470
9478
  };
9471
9479
  /* eslint-disable @typescript-eslint/no-unused-vars */
9472
9480
  MultiSelect.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
@@ -9485,7 +9493,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9485
9493
  }
9486
9494
  }
9487
9495
  var valuecheck = [];
9488
- if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9496
+ if (!isNullOrUndefined(this.value)) {
9489
9497
  valuecheck = this.presentItemValue(this.ulElement);
9490
9498
  }
9491
9499
  if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
@@ -11000,9 +11008,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11000
11008
  // eslint-disable-next-line
11001
11009
  var valueCompTemp = compiledString(itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, chipContent);
11002
11010
  if (valueCompTemp && valueCompTemp.length > 0) {
11003
- for (var i = 0; i < valueCompTemp.length; i++) {
11004
- chipContent.appendChild(valueCompTemp[i]);
11005
- }
11011
+ append(valueCompTemp, chipContent);
11006
11012
  }
11007
11013
  this.renderReactTemplates();
11008
11014
  }
@@ -14347,6 +14353,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14347
14353
  this.trigger('drag', this.getDragArgs(args));
14348
14354
  };
14349
14355
  ListBox.prototype.beforeDragEnd = function (args) {
14356
+ var items = [];
14350
14357
  this.dragValue = this.getFormattedValue(args.droppedElement.getAttribute('data-value'));
14351
14358
  if (this.value.indexOf(this.dragValue) > -1) {
14352
14359
  args.items = this.getDataByValues(this.value);
@@ -14354,7 +14361,11 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14354
14361
  else {
14355
14362
  args.items = this.getDataByValues([this.dragValue]);
14356
14363
  }
14364
+ extend(items, args.items);
14357
14365
  this.trigger('beforeDrop', args);
14366
+ if (args.items !== items) {
14367
+ this.customDraggedItem = args.items;
14368
+ }
14358
14369
  };
14359
14370
  ListBox.prototype.dragEnd = function (args) {
14360
14371
  var _this = this;
@@ -14402,6 +14413,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14402
14413
  liColl.splice(toIdx_1, 0, liColl.splice(rIdx, 1)[0]);
14403
14414
  if (this.allowDragAll) {
14404
14415
  selectedOptions = this.value && Array.prototype.indexOf.call(this.value, dropValue) > -1 ? this.value : [dropValue];
14416
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14417
+ selectedOptions = [];
14418
+ this.customDraggedItem.forEach(function (item) {
14419
+ selectedOptions.push(getValue(_this.fields.value, item));
14420
+ });
14421
+ }
14405
14422
  selectedOptions.forEach(function (value) {
14406
14423
  if (value !== dropValue) {
14407
14424
  var idx = listData.indexOf(_this.getDataByValue(value));
@@ -14434,6 +14451,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14434
14451
  sortedData = [].slice.call(listObj.sortedData);
14435
14452
  selectedOptions = (this.value && Array.prototype.indexOf.call(this.value, dropValue) > -1 && this.allowDragAll)
14436
14453
  ? this.value : [dropValue];
14454
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14455
+ selectedOptions = [];
14456
+ this.customDraggedItem.forEach(function (item) {
14457
+ selectedOptions.push(getValue(_this.fields.value, item));
14458
+ });
14459
+ }
14437
14460
  var fListData_1 = [].slice.call(this.listData);
14438
14461
  var fSortData_1 = [].slice.call(this.sortedData);
14439
14462
  selectedOptions.forEach(function (value, index) {
@@ -14504,6 +14527,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14504
14527
  var dragArgs1 = extend(destArgs, { currentData: listData });
14505
14528
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
14506
14529
  }
14530
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14531
+ dragArgs.items = this.customDraggedItem;
14532
+ }
14507
14533
  this.trigger('drop', dragArgs);
14508
14534
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14509
14535
  var liCollElem = dragArgs.elements;