igniteui-angular 12.3.7 → 12.3.8

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.
@@ -2011,6 +2011,7 @@
2011
2011
  var DATE_TYPE = 'date';
2012
2012
  var TIME_TYPE = 'time';
2013
2013
  var DATE_TIME_TYPE = 'dateTime';
2014
+ var STRING_TYPE = 'string';
2014
2015
  var DefaultSortingStrategy = /** @class */ (function () {
2015
2016
  function DefaultSortingStrategy() {
2016
2017
  }
@@ -2084,7 +2085,8 @@
2084
2085
  var column = grid ? grid.getColumnByName(expressions[level].fieldName) : null;
2085
2086
  var isDate = (column === null || column === void 0 ? void 0 : column.dataType) === DATE_TYPE || (column === null || column === void 0 ? void 0 : column.dataType) === DATE_TIME_TYPE;
2086
2087
  var isTime = (column === null || column === void 0 ? void 0 : column.dataType) === TIME_TYPE;
2087
- var group = this_1.groupedRecordsByExpression(data, i, expressions[level], isDate);
2088
+ var isString = (column === null || column === void 0 ? void 0 : column.dataType) === STRING_TYPE;
2089
+ var group = this_1.groupedRecordsByExpression(data, i, expressions[level], isDate, isString);
2088
2090
  var groupRow = {
2089
2091
  expression: expressions[level],
2090
2092
  level: level,
@@ -2163,7 +2165,7 @@
2163
2165
  }
2164
2166
  return resolvedValue;
2165
2167
  };
2166
- IgxSorting.prototype.groupedRecordsByExpression = function (data, index, expression, isDate) {
2168
+ IgxSorting.prototype.groupedRecordsByExpression = function (data, index, expression, isDate, isString) {
2167
2169
  if (isDate === void 0) { isDate = false; }
2168
2170
  var res = [];
2169
2171
  var key = expression.fieldName;
@@ -2173,7 +2175,13 @@
2173
2175
  index++;
2174
2176
  var comparer = expression.groupingComparer || DefaultSortingStrategy.instance().compareValues;
2175
2177
  for (var i = index; i < len; i++) {
2176
- if (comparer(this.getFieldValue(data[i], key, isDate), groupval) === 0) {
2178
+ var fieldValue = this.getFieldValue(data[i], key, isDate);
2179
+ if (expression.ignoreCase && isString) {
2180
+ // when column's dataType is string but the value is number
2181
+ fieldValue = fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.toString().toLowerCase();
2182
+ groupval = groupval === null || groupval === void 0 ? void 0 : groupval.toString().toLowerCase();
2183
+ }
2184
+ if (comparer(fieldValue, groupval) === 0) {
2177
2185
  res.push(data[i]);
2178
2186
  }
2179
2187
  else {
@@ -2201,13 +2209,14 @@
2201
2209
  var column = grid === null || grid === void 0 ? void 0 : grid.getColumnByName(expr.fieldName);
2202
2210
  var isDate = (column === null || column === void 0 ? void 0 : column.dataType) === DATE_TYPE || (column === null || column === void 0 ? void 0 : column.dataType) === DATE_TIME_TYPE;
2203
2211
  var isTime = (column === null || column === void 0 ? void 0 : column.dataType) === TIME_TYPE;
2212
+ var isString = (column === null || column === void 0 ? void 0 : column.dataType) === STRING_TYPE;
2204
2213
  data = expr.strategy.sort(data, expr.fieldName, expr.dir, expr.ignoreCase, this.getFieldValue, isDate, isTime);
2205
2214
  if (expressionIndex === exprsLen - 1) {
2206
2215
  return data;
2207
2216
  }
2208
2217
  // in case of multiple sorting
2209
2218
  for (i = 0; i < dataLen; i++) {
2210
- gbData = this.groupedRecordsByExpression(data, i, expr, isDate);
2219
+ gbData = this.groupedRecordsByExpression(data, i, expr, isDate, isString);
2211
2220
  gbDataLen = gbData.length;
2212
2221
  if (gbDataLen > 1) {
2213
2222
  gbData = this.sortDataRecursive(gbData, expressions, expressionIndex + 1, grid);
@@ -14172,7 +14181,7 @@
14172
14181
  else {
14173
14182
  var owner = worksheetData.owner;
14174
14183
  var isHierarchicalGrid = worksheetData.data[0].type === exports.ExportRecordType.HierarchicalGridRecord;
14175
- var hasMultiColumnHeader_1 = owner.columns.some(function (col) { return !col.skip && col.headerType === exports.HeaderType.MultiColumnHeader; });
14184
+ var hasMultiColumnHeader_1 = worksheetData.hasMultiColumnHeader;
14176
14185
  var hasUserSetIndex = owner.columns.some(function (col) { return col.exportIndex !== undefined; });
14177
14186
  var height = worksheetData.options.rowHeight;
14178
14187
  var rowStyle = isHierarchicalGrid ? ' s="3"' : '';
@@ -14315,7 +14324,7 @@
14315
14324
  var record = worksheetData.data[i];
14316
14325
  if (record.type === exports.ExportRecordType.HeaderRecord) {
14317
14326
  var recordOwner = worksheetData.owners.get(record.owner);
14318
- var hasMultiColumnHeaders = recordOwner.columns.some(function (c) { return c.headerType === exports.HeaderType.MultiColumnHeader; });
14327
+ var hasMultiColumnHeaders = recordOwner.columns.some(function (c) { return !c.skip && c.headerType === exports.HeaderType.MultiColumnHeader; });
14319
14328
  if (hasMultiColumnHeaders) {
14320
14329
  _this.hGridPrintMultiColHeaders(worksheetData, rowDataArr, record, recordOwner);
14321
14330
  }
@@ -14944,13 +14953,21 @@
14944
14953
  enumerable: false,
14945
14954
  configurable: true
14946
14955
  });
14956
+ Object.defineProperty(WorksheetData.prototype, "hasMultiColumnHeader", {
14957
+ get: function () {
14958
+ return this._hasMultiColumnHeader;
14959
+ },
14960
+ enumerable: false,
14961
+ configurable: true
14962
+ });
14947
14963
  WorksheetData.prototype.initializeData = function () {
14948
14964
  if (!this._data || this._data.length === 0) {
14949
14965
  return;
14950
14966
  }
14951
- var isMultiColumnHeader = this.owner.columns.some(function (col) { return !col.skip && col.headerType === exports.HeaderType.MultiColumnHeader; });
14967
+ this._hasMultiColumnHeader = Array.from(this.owners.values())
14968
+ .some(function (o) { return o.columns.some(function (col) { return !col.skip && col.headerType === exports.HeaderType.MultiColumnHeader; }); });
14952
14969
  var hasHierarchicalGridRecord = this._data[0].type === exports.ExportRecordType.HierarchicalGridRecord;
14953
- if (hasHierarchicalGridRecord || (isMultiColumnHeader && !this.options.ignoreMultiColumnHeaders)) {
14970
+ if (hasHierarchicalGridRecord || (this._hasMultiColumnHeader && !this.options.ignoreMultiColumnHeaders)) {
14954
14971
  this.options.exportAsTable = false;
14955
14972
  }
14956
14973
  this._isSpecialData = ExportUtilities.isSpecialData(this._data[0].data);
@@ -39516,10 +39533,7 @@
39516
39533
  };
39517
39534
  _this.findMatch = function (element) {
39518
39535
  var value = _this.displayKey ? element[_this.displayKey] : element;
39519
- if (value === undefined || value === null) {
39520
- return false;
39521
- }
39522
- return value.toString().toLowerCase() === _this.searchValue.trim().toLowerCase();
39536
+ return (value === null || value === void 0 ? void 0 : value.toString().toLowerCase()) === _this.searchValue.trim().toLowerCase();
39523
39537
  };
39524
39538
  return _this;
39525
39539
  }
@@ -49260,10 +49274,13 @@
49260
49274
  return rowSummaries;
49261
49275
  };
49262
49276
  IgxGridSummaryService.prototype.resetSummaryHeight = function () {
49277
+ var _this = this;
49263
49278
  this.summaryHeight = 0;
49264
49279
  this.grid.summaryPipeTrigger++;
49265
49280
  if (this.grid.rootSummariesEnabled) {
49281
+ this.grid.summariesHeight = 0;
49266
49282
  this.retriggerRootPipe++;
49283
+ Promise.resolve().then(function () { return _this.grid.notifyChanges(true); });
49267
49284
  }
49268
49285
  };
49269
49286
  IgxGridSummaryService.prototype.updateSummaryCache = function (groupingArgs) {
@@ -61939,6 +61956,22 @@
61939
61956
  enumerable: false,
61940
61957
  configurable: true
61941
61958
  });
61959
+ Object.defineProperty(BaseRow.prototype, "addRowUI", {
61960
+ /**
61961
+ * Gets if this represents add row UI
61962
+ *
61963
+ * ```typescript
61964
+ * let isAddRow = row.addRowUI;
61965
+ * ```
61966
+ */
61967
+ get: function () {
61968
+ return !!this.grid.crudService.row &&
61969
+ this.grid.crudService.row.getClassName() === IgxAddRow.name &&
61970
+ this.grid.crudService.row.id === this.key;
61971
+ },
61972
+ enumerable: false,
61973
+ configurable: true
61974
+ });
61942
61975
  Object.defineProperty(BaseRow.prototype, "data", {
61943
61976
  /**
61944
61977
  * The data record that populates the row.
@@ -74920,16 +74953,20 @@
74920
74953
  var value = isDateTime
74921
74954
  ? this.grid.datePipe.transform(record[key])
74922
74955
  : record[key];
74956
+ var valueCase = value;
74923
74957
  var groupByRecord = void 0;
74924
- if (map.has(value)) {
74925
- groupByRecord = map.get(value);
74958
+ if (groupingExpression.ignoreCase) {
74959
+ valueCase = value === null || value === void 0 ? void 0 : value.toString().toLowerCase();
74960
+ }
74961
+ if (map.has(valueCase)) {
74962
+ groupByRecord = map.get(valueCase);
74926
74963
  }
74927
74964
  else {
74928
74965
  groupByRecord = new GroupByRecord();
74929
74966
  groupByRecord.key = key;
74930
74967
  groupByRecord.value = value;
74931
74968
  groupByRecord.records = [];
74932
- map.set(value, groupByRecord);
74969
+ map.set(valueCase, groupByRecord);
74933
74970
  }
74934
74971
  groupByRecord.records.push(record);
74935
74972
  }