@syncfusion/ej2-multicolumn-combobox 29.2.4 → 30.1.39

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 29.2.4
3
+ * version : 30.1.39
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. 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,62 +1,27 @@
1
1
  {
2
- "_from": "@syncfusion/ej2-multicolumn-combobox@*",
3
- "_id": "@syncfusion/ej2-multicolumn-combobox@29.1.40",
4
- "_inBundle": false,
5
- "_integrity": "sha512-VLAfsH/NyGm5CPBaNYfPdkU2zmbK4Q9+ZZ6QFvNnbZ+F2sChCSGsHLjJJ+CbNA9RvB3fGuTXCQB/5zff6VRQFA==",
6
- "_location": "/@syncfusion/ej2-multicolumn-combobox",
7
- "_phantomChildren": {},
8
- "_requested": {
9
- "type": "range",
10
- "registry": true,
11
- "raw": "@syncfusion/ej2-multicolumn-combobox@*",
12
- "name": "@syncfusion/ej2-multicolumn-combobox",
13
- "escapedName": "@syncfusion%2fej2-multicolumn-combobox",
14
- "scope": "@syncfusion",
15
- "rawSpec": "*",
16
- "saveSpec": null,
17
- "fetchSpec": "*"
18
- },
19
- "_requiredBy": [
20
- "/",
21
- "/@syncfusion/ej2",
22
- "/@syncfusion/ej2-angular-multicolumn-combobox",
23
- "/@syncfusion/ej2-react-multicolumn-combobox",
24
- "/@syncfusion/ej2-vue-multicolumn-combobox"
25
- ],
26
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-multicolumn-combobox/-/ej2-multicolumn-combobox-29.1.40.tgz",
27
- "_shasum": "3b87153c8da9c1646200aaf3ed8b6142eb39a246",
28
- "_spec": "@syncfusion/ej2-multicolumn-combobox@*",
29
- "_where": "/jenkins/workspace/elease-automation_release_29.1.1/packages/included",
30
- "author": {
31
- "name": "Syncfusion Inc."
32
- },
33
- "bugs": {
34
- "url": "https://github.com/syncfusion/ej2-multicolumn-combobox-component/issues"
35
- },
36
- "bundleDependencies": false,
2
+ "name": "@syncfusion/ej2-multicolumn-combobox",
3
+ "version": "30.1.39",
4
+ "description": "Essential JS 2 Component",
5
+ "author": "Syncfusion Inc.",
6
+ "license": "SEE LICENSE IN license",
7
+ "main": "./dist/ej2-multicolumn-combobox.umd.min.js",
8
+ "module": "./index.js",
9
+ "es2015": "./dist/es6/ej2-multicolumn-combobox.es5.js",
10
+ "typings": "index.d.ts",
37
11
  "dependencies": {
38
- "@syncfusion/ej2-base": "~29.2.4",
39
- "@syncfusion/ej2-grids": "~29.2.4"
12
+ "@syncfusion/ej2-base": "~30.1.38",
13
+ "@syncfusion/ej2-grids": "~30.1.39"
40
14
  },
41
- "deprecated": false,
42
- "description": "Essential JS 2 Component",
43
15
  "devDependencies": {},
44
- "es2015": "./dist/es6/ej2-multicolumn-combobox.es5.js",
45
- "homepage": "https://www.syncfusion.com/javascript-ui-controls",
46
16
  "keywords": [
47
17
  "ej2",
48
18
  "syncfusion",
49
19
  "ej2-multicolumn-combobox"
50
20
  ],
51
- "license": "SEE LICENSE IN license",
52
- "main": "./dist/ej2-multicolumn-combobox.umd.min.js",
53
- "module": "./index.js",
54
- "name": "@syncfusion/ej2-multicolumn-combobox",
55
21
  "repository": {
56
22
  "type": "git",
57
- "url": "git+https://github.com/syncfusion/ej2-multicolumn-combobox-component.git"
23
+ "url": "https://github.com/syncfusion/ej2-multicolumn-combobox-component.git"
58
24
  },
59
- "typings": "index.d.ts",
60
- "version": "29.2.4",
61
- "sideEffects": false
25
+ "sideEffects": false,
26
+ "homepage": "https://www.syncfusion.com/javascript-ui-controls"
62
27
  }
@@ -1,4 +1,4 @@
1
- import { Component, EventHandler, INotifyPropertyChanged, Property, NotifyPropertyChanges, closest, attributes, append, compile, detach, KeyboardEvents, getValue } from '@syncfusion/ej2-base';import { ChildProperty, prepend, Collection, getUniqueID, Complex, isNullOrUndefined as isNOU, select, L10n, Browser } from '@syncfusion/ej2-base';import { formatUnit, addClass, removeClass, NumberFormatOptions, DateFormatOptions, Event, EmitType, AnimationModel, Animation, KeyboardEventArgs } from '@syncfusion/ej2-base';import { Input, InputObject } from '@syncfusion/ej2-inputs';import { DataManager, Query, Group } from '@syncfusion/ej2-data';import { Popup, createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';import { Grid, Resize, FailureEventArgs, VirtualScroll, Group as GridGroup, Edit, Sort, GridColumnModel } from '@syncfusion/ej2-grids';
1
+ import { Component, EventHandler, INotifyPropertyChanged, Property, NotifyPropertyChanges, closest, attributes, append, compile, detach, KeyboardEvents, getValue } from '@syncfusion/ej2-base';import { ChildProperty, prepend, Collection, getUniqueID, Complex, isNullOrUndefined as isNOU, select, L10n, Browser } from '@syncfusion/ej2-base';import { formatUnit, addClass, removeClass, NumberFormatOptions, DateFormatOptions, Event, EmitType, AnimationModel, Animation, KeyboardEventArgs } from '@syncfusion/ej2-base';import { Input, InputObject } from '@syncfusion/ej2-inputs';import { DataManager, Query, Group, DataOptions } from '@syncfusion/ej2-data';import { Popup, createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';import { Grid, Resize, FailureEventArgs, VirtualScroll, Group as GridGroup, Edit, Sort, GridColumnModel } from '@syncfusion/ej2-grids';
2
2
  import {TextAlign,GridLine,WrapMode,ResizeArgs,DataResult,FilterType,FloatLabelType,SortOrder,SortType,PopupEventArgs,FilteringEventArgs,SelectEventArgs,ChangeEventArgs} from "./multi-column-combo-box";
3
3
  import {ComponentModel} from '@syncfusion/ej2-base';
4
4
 
@@ -783,6 +783,13 @@ export declare class MultiColumnComboBox extends Component<HTMLElement> implemen
783
783
  private selectedRowIndex;
784
784
  private isShowSpinner;
785
785
  private hiddenElement;
786
+ private isLocaleChanged;
787
+ private gridData;
788
+ private mainData;
789
+ private isMainDataUpdated;
790
+ private isCustomFilter;
791
+ private customFilterQuery;
792
+ private typedString;
786
793
  /**
787
794
  * *Constructor for creating the component
788
795
  *
@@ -815,6 +822,8 @@ export declare class MultiColumnComboBox extends Component<HTMLElement> implemen
815
822
  protected getPersistData(): string;
816
823
  private persistData;
817
824
  protected render(): void;
825
+ private setGridData;
826
+ protected getQuery(query: Query): Query;
818
827
  private setHiddenValue;
819
828
  private renderGrid;
820
829
  private handleActionComplete;
@@ -858,9 +867,6 @@ export declare class MultiColumnComboBox extends Component<HTMLElement> implemen
858
867
  private updateInputValue;
859
868
  private filterDatas;
860
869
  private selectFilteredRows;
861
- private filterAction;
862
- private filteringHandler;
863
- private filterData;
864
870
  private updateGridDataSource;
865
871
  private wireEvents;
866
872
  private unWireEvents;
@@ -332,6 +332,9 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
332
332
  };
333
333
  MultiColumnComboBox.prototype.render = function () {
334
334
  this.renderInput();
335
+ if (this.gridData == null) {
336
+ this.setGridData(this.dataSource);
337
+ }
335
338
  this.renderGrid();
336
339
  this.popupDiv = this.createElement('div', { className: CONTENT });
337
340
  this.popupDiv.appendChild(this.gridEle);
@@ -339,6 +342,63 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
339
342
  this.renderPopup();
340
343
  this.wireEvents();
341
344
  };
345
+ MultiColumnComboBox.prototype.setGridData = function (dataSource, query) {
346
+ var _this = this;
347
+ this.trigger('actionBegin', { cancel: false, query: query }, function (args) {
348
+ if (!args.cancel) {
349
+ if (dataSource instanceof DataManager) {
350
+ if (_this.isShowSpinner) {
351
+ _this.showHideSpinner(true);
352
+ }
353
+ dataSource.executeQuery(_this.getQuery(query)).then(function (e) {
354
+ _this.gridData = e.result;
355
+ _this.trigger('actionComplete', e, function (e) {
356
+ _this.showHideSpinner(false);
357
+ if (!_this.isMainDataUpdated) {
358
+ _this.mainData = _this.gridData;
359
+ _this.isMainDataUpdated = true;
360
+ }
361
+ if (_this.popupDiv) {
362
+ _this.updateGridDataSource();
363
+ }
364
+ });
365
+ }).catch(function (e) {
366
+ _this.trigger('actionFailure', e, null);
367
+ });
368
+ }
369
+ else {
370
+ var dataManager = new DataManager(dataSource);
371
+ var listItems = (_this.getQuery(query)).executeLocal(dataManager);
372
+ _this.gridData = listItems;
373
+ _this.trigger('actionComplete', { result: listItems }, function (e) {
374
+ if (!_this.isMainDataUpdated) {
375
+ _this.mainData = _this.gridData;
376
+ _this.isMainDataUpdated = true;
377
+ }
378
+ if (_this.popupDiv) {
379
+ _this.updateGridDataSource();
380
+ }
381
+ });
382
+ }
383
+ }
384
+ });
385
+ };
386
+ MultiColumnComboBox.prototype.getQuery = function (query) {
387
+ var filterQuery;
388
+ if (!this.isCustomFilter && this.allowFiltering) {
389
+ filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
390
+ var filterType = this.typedString === '' ? 'contains' : this.filterType;
391
+ if ((this.allowFiltering && this.typedString && this.typedString !== '')) {
392
+ var fields = (this.fields.text) ? this.fields.text : '';
393
+ filterQuery.where(fields, filterType, this.typedString, true, false);
394
+ }
395
+ }
396
+ else {
397
+ filterQuery = (this.customFilterQuery != null) ?
398
+ this.customFilterQuery.clone() : query ? query.clone() : this.query ? this.query.clone() : new Query();
399
+ }
400
+ return filterQuery;
401
+ };
342
402
  MultiColumnComboBox.prototype.setHiddenValue = function () {
343
403
  if (isNOU(this.value)) {
344
404
  this.hiddenElement.innerHTML = '';
@@ -362,7 +422,7 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
362
422
  var gridColumns = this.getGridColumns();
363
423
  var sortOrder = this.sortOrder.toString().toLowerCase();
364
424
  this.gridObj = new Grid({
365
- dataSource: this.dataSource,
425
+ dataSource: this.gridData,
366
426
  columns: gridColumns,
367
427
  allowSorting: this.allowSorting,
368
428
  enableStickyHeader: true,
@@ -372,7 +432,6 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
372
432
  enableVirtualization: this.enableVirtualization,
373
433
  enableRtl: this.enableRtl,
374
434
  editSettings: { allowAdding: false },
375
- query: this.query,
376
435
  allowTextWrap: this.gridSettings.allowTextWrap,
377
436
  textWrapSettings: { wrapMode: this.gridSettings.textWrapMode },
378
437
  height: this.popupHeight,
@@ -387,7 +446,6 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
387
446
  },
388
447
  dataBound: function () { _this.onDataBound(); },
389
448
  actionFailure: function (args) { _this.onActionFailure(args); },
390
- actionBegin: function (args) { _this.trigger('actionBegin', args); },
391
449
  actionComplete: this.handleActionComplete.bind(this),
392
450
  keyPressed: this.handleKeyPressed.bind(this),
393
451
  resizing: function (args) {
@@ -423,7 +481,6 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
423
481
  };
424
482
  MultiColumnComboBox.prototype.handleActionComplete = function (args) {
425
483
  var _this = this;
426
- this.trigger('actionComplete', args);
427
484
  if (args.requestType === 'sorting') {
428
485
  this.updateRowSelection(args);
429
486
  }
@@ -548,6 +605,11 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
548
605
  };
549
606
  MultiColumnComboBox.prototype.onDataBound = function () {
550
607
  var _this = this;
608
+ if (this.isLocaleChanged) {
609
+ this.isLocaleChanged = false;
610
+ this.unWireEvents();
611
+ this.wireEvents();
612
+ }
551
613
  var dataCount = this.dataSource.length;
552
614
  var popupChild = this.popupDiv.querySelector('.' + MULTICOLUMNGRID);
553
615
  var hasNoDataClass = this.popupDiv.classList.contains(NODATA);
@@ -787,8 +849,8 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
787
849
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
788
850
  var dataLists = e.result;
789
851
  var filteredData = dataLists.filter(function (item) {
790
- var fieldVal = _this.updateFieldValue(isRerender ? (isValue ? _this.fields.value : _this.fields.text) :
791
- !isNOU(_this.value) ? _this.fields.value : _this.fields.text, item);
852
+ var fieldVal = item ? (_this.updateFieldValue(isRerender ? (isValue ? _this.fields.value :
853
+ _this.fields.text) : !isNOU(_this.value) ? _this.fields.value : _this.fields.text, item)) : null;
792
854
  return fieldVal === value_1;
793
855
  });
794
856
  if (filteredData.length > 0) {
@@ -1099,24 +1161,24 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
1099
1161
  this.showPopup(null, true);
1100
1162
  this.updateClearIconState();
1101
1163
  if (this.allowFiltering) {
1102
- var inputValue_1 = e.target.value.toLowerCase();
1103
- var customFiltering_1 = false;
1164
+ this.typedString = e.target.value.toLowerCase();
1104
1165
  var eventArgs_1 = {
1105
1166
  preventDefaultAction: false,
1106
- text: inputValue_1,
1167
+ text: this.typedString,
1107
1168
  updateData: function (dataSource, query, fields) {
1108
1169
  if (eventArgs_1.cancel) {
1109
1170
  return;
1110
1171
  }
1111
- customFiltering_1 = true;
1112
- _this.filterAction(dataSource, inputValue_1, query, fields);
1172
+ _this.isCustomFilter = true;
1173
+ _this.customFilterQuery = query ? query.clone() : query;
1174
+ _this.setGridData(dataSource, query);
1113
1175
  },
1114
1176
  event: e,
1115
1177
  cancel: false
1116
1178
  };
1117
1179
  this.trigger('filtering', eventArgs_1, function (eventArgs) {
1118
- if (!eventArgs.cancel && !eventArgs.preventDefaultAction && !customFiltering_1) {
1119
- _this.filterAction(_this.dataSource, inputValue_1, _this.query, _this.fields);
1180
+ if (!eventArgs.cancel && !eventArgs.preventDefaultAction && !_this.isCustomFilter) {
1181
+ _this.setGridData(_this.dataSource, _this.query ? _this.query.clone() : null);
1120
1182
  }
1121
1183
  });
1122
1184
  }
@@ -1124,27 +1186,16 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
1124
1186
  };
1125
1187
  MultiColumnComboBox.prototype.updateInputValue = function (inputValue) {
1126
1188
  return __awaiter(this, void 0, void 0, function () {
1127
- var _a, _b, data, exactData, query, result, totaldata;
1189
+ var _a, _b, data, exactData;
1128
1190
  return __generator(this, function (_c) {
1129
- switch (_c.label) {
1130
- case 0:
1131
- if (!(this.dataSource instanceof DataManager)) return [3 /*break*/, 2];
1132
- query = new Query();
1133
- return [4 /*yield*/, this.dataSource.executeQuery(query)];
1134
- case 1:
1135
- result = _c.sent();
1136
- totaldata = result.result;
1137
- (_a = this.filterDatas(totaldata, inputValue), data = _a.data, exactData = _a.exactData);
1138
- return [3 /*break*/, 3];
1139
- case 2:
1140
- if (Array.isArray(this.dataSource)) {
1141
- (_b = this.filterDatas(this.dataSource, inputValue), data = _b.data, exactData = _b.exactData);
1142
- }
1143
- _c.label = 3;
1144
- case 3:
1145
- this.selectFilteredRows(data, exactData);
1146
- return [2 /*return*/];
1191
+ if (this.dataSource instanceof DataManager) {
1192
+ (_a = this.filterDatas(this.mainData, inputValue), data = _a.data, exactData = _a.exactData);
1193
+ }
1194
+ else if (Array.isArray(this.dataSource)) {
1195
+ (_b = this.filterDatas(this.dataSource, inputValue), data = _b.data, exactData = _b.exactData);
1147
1196
  }
1197
+ this.selectFilteredRows(data, exactData);
1198
+ return [2 /*return*/];
1148
1199
  });
1149
1200
  });
1150
1201
  };
@@ -1170,72 +1221,14 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
1170
1221
  var selectedIndex = this.findIndex(this.gridObj.currentViewData, this.matchedContent);
1171
1222
  this.matchedRowEle = this.gridObj.getRowByIndex(selectedIndex);
1172
1223
  };
1173
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1174
- MultiColumnComboBox.prototype.filterAction = function (dataSource, inputValue, query, fields) {
1175
- var _this = this;
1176
- var isQuery = query || new Query();
1177
- var filterType = this.filterType.toString().toLowerCase();
1178
- if (isNOU(query) && isNOU(fields)) {
1179
- this.updateGridDataSource(dataSource);
1180
- }
1181
- else if (query) {
1182
- if (dataSource instanceof DataManager) {
1183
- this.filteringHandler(dataSource, inputValue, query, fields);
1184
- }
1185
- else {
1186
- new DataManager(dataSource).executeQuery(query).then(function (e) {
1187
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1188
- var dataLists = e.result;
1189
- _this.updateGridDataSource(dataLists);
1190
- });
1191
- }
1192
- }
1193
- else {
1194
- if (dataSource instanceof DataManager) {
1195
- this.filteringHandler(dataSource, inputValue, isQuery, fields);
1196
- }
1197
- else if (Array.isArray(dataSource)) {
1198
- var filteredData = dataSource.filter(function (item) {
1199
- return _this.filterData(item, filterType, inputValue, fields);
1200
- });
1201
- this.updateGridDataSource(filteredData);
1202
- }
1203
- }
1204
- };
1205
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1206
- MultiColumnComboBox.prototype.filteringHandler = function (dataSource, inputValue, query, fields) {
1207
- var _this = this;
1208
- var filterType = this.filterType.toString().toLowerCase();
1209
- var filteredData;
1210
- dataSource.executeQuery(query).then(function (e) {
1211
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1212
- var dataLists = e.result;
1213
- filteredData = dataLists.filter(function (item) { return _this.filterData(item, filterType, inputValue, fields); });
1214
- _this.updateGridDataSource(filteredData);
1215
- });
1216
- };
1217
- MultiColumnComboBox.prototype.filterData = function (item, filterType, inputValue, fields) {
1218
- var dataValue = this.updateFieldValue(fields ? fields.text : this.fields.text, item);
1219
- var itemValue = dataValue.toLowerCase();
1220
- switch (filterType) {
1221
- case 'startswith':
1222
- return itemValue.startsWith(inputValue);
1223
- case 'endswith':
1224
- return itemValue.endsWith(inputValue);
1225
- case 'contains':
1226
- return itemValue.includes(inputValue);
1227
- default:
1228
- return false;
1229
- }
1230
- };
1231
- MultiColumnComboBox.prototype.updateGridDataSource = function (dataSource) {
1232
- if (dataSource.length > 0) {
1224
+ MultiColumnComboBox.prototype.updateGridDataSource = function () {
1225
+ if (this.gridData && this.gridData.length > 0) {
1233
1226
  removeClass([this.popupDiv], [NODATA]);
1234
1227
  var noRecordEle = this.popupDiv.querySelector('.e-no-records');
1235
1228
  if (noRecordEle) {
1236
1229
  this.popupDiv.removeChild(noRecordEle);
1237
1230
  }
1238
- this.gridObj.dataSource = dataSource;
1231
+ this.gridObj.dataSource = this.gridData;
1239
1232
  this.isDataFiltered = true;
1240
1233
  }
1241
1234
  else {
@@ -1524,7 +1517,7 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
1524
1517
  if (this.gridObj) {
1525
1518
  var dataLength_1;
1526
1519
  this.isShowSpinner = true;
1527
- this.gridObj.dataSource = newDataSource;
1520
+ this.setGridData(newDataSource);
1528
1521
  var isRemoteData = oldDataSource instanceof DataManager;
1529
1522
  if (isRemoteData) {
1530
1523
  oldDataSource.executeQuery(new Query()).then(function (e) {
@@ -1653,11 +1646,17 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
1653
1646
  }
1654
1647
  _this.inputEle.removeAttribute('aria-owns');
1655
1648
  _this.inputEle.removeAttribute('aria-activedescendant');
1649
+ _this.customFilterQuery = null;
1656
1650
  }
1657
1651
  });
1658
1652
  setTimeout(function () {
1659
1653
  if (_this.gridObj) {
1660
- _this.gridObj.dataSource = _this.dataSource;
1654
+ _this.gridObj.dataSource = _this.allowFiltering ? _this.mainData : _this.gridData;
1655
+ var noRecordEle = _this.popupDiv.querySelector('.e-no-records');
1656
+ if (noRecordEle) {
1657
+ _this.popupDiv.removeChild(noRecordEle);
1658
+ removeClass([_this.popupDiv], [NODATA]);
1659
+ }
1661
1660
  _this.updateGridHeight(true, false);
1662
1661
  }
1663
1662
  }, 100);
@@ -1864,9 +1863,8 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
1864
1863
  this.updateDynamicDataSource(newProp.dataSource, oldProp.dataSource);
1865
1864
  break;
1866
1865
  case 'query':
1867
- if (this.gridObj) {
1868
- this.gridObj.query = newProp.query;
1869
- }
1866
+ this.isMainDataUpdated = false;
1867
+ this.setGridData(this.dataSource);
1870
1868
  break;
1871
1869
  case 'gridSettings':
1872
1870
  if (this.gridObj) {
@@ -1914,6 +1912,9 @@ var MultiColumnComboBox = /** @class */ (function (_super) {
1914
1912
  this.gridObj.columns = gridColumns;
1915
1913
  }
1916
1914
  break;
1915
+ case 'locale':
1916
+ this.isLocaleChanged = true;
1917
+ break;
1917
1918
  }
1918
1919
  }
1919
1920
  };