@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';
@@ -1342,6 +1342,9 @@ let DropDownBase = class DropDownBase extends Component {
1342
1342
  }
1343
1343
  }
1344
1344
  }
1345
+ if (this.getModuleName() === 'listbox' && this.isReact) {
1346
+ this.renderReactTemplates();
1347
+ }
1345
1348
  if (selectedItemValue || itemIndex === 0) {
1346
1349
  this.updateSelection();
1347
1350
  }
@@ -2393,7 +2396,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2393
2396
  this.removeSelection();
2394
2397
  li.classList.add(dropDownBaseClasses.selected);
2395
2398
  this.removeHover();
2396
- const value = this.getFormattedValue(li.getAttribute('data-value'));
2399
+ const value = li.getAttribute('data-value') !== "null" ? this.getFormattedValue(li.getAttribute('data-value')) : null;
2397
2400
  const selectedData = this.getDataByValue(value);
2398
2401
  if (!this.initial && !preventSelect && !isNullOrUndefined(e)) {
2399
2402
  const items = this.detachChanges(selectedData);
@@ -2509,7 +2512,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2509
2512
  }
2510
2513
  if (Browser.info.name !== 'mozilla') {
2511
2514
  if (this.targetElement()) {
2512
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id !== '' ? this.inputElement.id : this.element.id });
2515
+ if (this.getModuleName() !== 'combobox') {
2516
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id !== '' ? this.inputElement.id : this.element.id });
2517
+ }
2513
2518
  this.targetElement().removeAttribute('aria-live');
2514
2519
  }
2515
2520
  }
@@ -2562,9 +2567,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2562
2567
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2563
2568
  const valueCompTemp = compiledString(this.itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, this.valueTempElement);
2564
2569
  if (valueCompTemp && valueCompTemp.length > 0) {
2565
- for (let i = 0; i < valueCompTemp.length; i++) {
2566
- this.valueTempElement.appendChild(valueCompTemp[i]);
2567
- }
2570
+ append(valueCompTemp, this.valueTempElement);
2568
2571
  }
2569
2572
  this.renderReactTemplates();
2570
2573
  }
@@ -9302,7 +9305,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9302
9305
  predicate = predicate.or(field, 'equal', valuecheck[i]);
9303
9306
  }
9304
9307
  }
9305
- return this.getQuery(this.query).where(predicate);
9308
+ if (this.dataSource instanceof DataManager && this.dataSource.adaptor instanceof JsonAdaptor) {
9309
+ return new Query().where(predicate);
9310
+ }
9311
+ else {
9312
+ return this.getQuery(this.query).clone().where(predicate);
9313
+ }
9306
9314
  }
9307
9315
  /* eslint-disable @typescript-eslint/no-unused-vars */
9308
9316
  onActionComplete(ulElement, list, e, isUpdated) {
@@ -9321,7 +9329,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9321
9329
  }
9322
9330
  }
9323
9331
  let valuecheck = [];
9324
- if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9332
+ if (!isNullOrUndefined(this.value)) {
9325
9333
  valuecheck = this.presentItemValue(this.ulElement);
9326
9334
  }
9327
9335
  if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
@@ -10832,9 +10840,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10832
10840
  // eslint-disable-next-line
10833
10841
  let valueCompTemp = compiledString(itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, chipContent);
10834
10842
  if (valueCompTemp && valueCompTemp.length > 0) {
10835
- for (let i = 0; i < valueCompTemp.length; i++) {
10836
- chipContent.appendChild(valueCompTemp[i]);
10837
- }
10843
+ append(valueCompTemp, chipContent);
10838
10844
  }
10839
10845
  this.renderReactTemplates();
10840
10846
  }
@@ -14133,6 +14139,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14133
14139
  this.trigger('drag', this.getDragArgs(args));
14134
14140
  }
14135
14141
  beforeDragEnd(args) {
14142
+ let items = [];
14136
14143
  this.dragValue = this.getFormattedValue(args.droppedElement.getAttribute('data-value'));
14137
14144
  if (this.value.indexOf(this.dragValue) > -1) {
14138
14145
  args.items = this.getDataByValues(this.value);
@@ -14140,7 +14147,11 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14140
14147
  else {
14141
14148
  args.items = this.getDataByValues([this.dragValue]);
14142
14149
  }
14150
+ extend(items, args.items);
14143
14151
  this.trigger('beforeDrop', args);
14152
+ if (args.items !== items) {
14153
+ this.customDraggedItem = args.items;
14154
+ }
14144
14155
  }
14145
14156
  dragEnd(args) {
14146
14157
  let listData;
@@ -14187,6 +14198,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14187
14198
  liColl.splice(toIdx, 0, liColl.splice(rIdx, 1)[0]);
14188
14199
  if (this.allowDragAll) {
14189
14200
  selectedOptions = this.value && Array.prototype.indexOf.call(this.value, dropValue) > -1 ? this.value : [dropValue];
14201
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14202
+ selectedOptions = [];
14203
+ this.customDraggedItem.forEach((item) => {
14204
+ selectedOptions.push(getValue(this.fields.value, item));
14205
+ });
14206
+ }
14190
14207
  selectedOptions.forEach((value) => {
14191
14208
  if (value !== dropValue) {
14192
14209
  const idx = listData.indexOf(this.getDataByValue(value));
@@ -14219,6 +14236,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14219
14236
  sortedData = [].slice.call(listObj.sortedData);
14220
14237
  selectedOptions = (this.value && Array.prototype.indexOf.call(this.value, dropValue) > -1 && this.allowDragAll)
14221
14238
  ? this.value : [dropValue];
14239
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14240
+ selectedOptions = [];
14241
+ this.customDraggedItem.forEach((item) => {
14242
+ selectedOptions.push(getValue(this.fields.value, item));
14243
+ });
14244
+ }
14222
14245
  const fListData = [].slice.call(this.listData);
14223
14246
  const fSortData = [].slice.call(this.sortedData);
14224
14247
  selectedOptions.forEach((value, index) => {
@@ -14289,6 +14312,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14289
14312
  const dragArgs1 = extend(destArgs, { currentData: listData });
14290
14313
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
14291
14314
  }
14315
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14316
+ dragArgs.items = this.customDraggedItem;
14317
+ }
14292
14318
  this.trigger('drop', dragArgs);
14293
14319
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14294
14320
  const liCollElem = dragArgs.elements;