igniteui-angular 14.2.17 → 14.2.18
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/esm2020/lib/grids/common/strategy.mjs +17 -12
- package/esm2020/lib/grids/grid/groupby-row.component.mjs +3 -3
- package/fesm2015/igniteui-angular.mjs +18 -13
- package/fesm2015/igniteui-angular.mjs.map +1 -1
- package/fesm2020/igniteui-angular.mjs +18 -13
- package/fesm2020/igniteui-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2223,9 +2223,9 @@ class IgxSorting {
|
|
|
2223
2223
|
while (i < data.length) {
|
|
2224
2224
|
const column = grid ? grid.getColumnByName(expressions[level].fieldName) : null;
|
|
2225
2225
|
const isDate = column?.dataType === DATE_TYPE || column?.dataType === DATE_TIME_TYPE;
|
|
2226
|
-
const isTime = column?.dataType === TIME_TYPE;
|
|
2226
|
+
const isTime = column?.dataType === TIME_TYPE || column?.dataType === DATE_TIME_TYPE;
|
|
2227
2227
|
const isString = column?.dataType === STRING_TYPE;
|
|
2228
|
-
const group = this.groupedRecordsByExpression(data, i, expressions[level], isDate, isString);
|
|
2228
|
+
const group = this.groupedRecordsByExpression(data, i, expressions[level], isDate, isTime, isString);
|
|
2229
2229
|
const groupRow = {
|
|
2230
2230
|
expression: expressions[level],
|
|
2231
2231
|
level,
|
|
@@ -2272,23 +2272,28 @@ class IgxSorting {
|
|
|
2272
2272
|
}
|
|
2273
2273
|
getFieldValue(obj, key, isDate = false, isTime = false) {
|
|
2274
2274
|
let resolvedValue = resolveNestedPath(obj, key);
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
resolvedValue =
|
|
2278
|
-
|
|
2275
|
+
const date = parseDate(resolvedValue);
|
|
2276
|
+
if (date && isDate && isTime) {
|
|
2277
|
+
resolvedValue = date;
|
|
2278
|
+
}
|
|
2279
|
+
else if (date && isDate && !isTime) {
|
|
2280
|
+
resolvedValue = new Date(date.setHours(0, 0, 0, 0));
|
|
2281
|
+
}
|
|
2282
|
+
else if (date && isTime && !isDate) {
|
|
2283
|
+
resolvedValue = new Date().setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
2279
2284
|
}
|
|
2280
2285
|
return resolvedValue;
|
|
2281
2286
|
}
|
|
2282
|
-
groupedRecordsByExpression(data, index, expression, isDate = false, isString) {
|
|
2287
|
+
groupedRecordsByExpression(data, index, expression, isDate = false, isTime = false, isString) {
|
|
2283
2288
|
const res = [];
|
|
2284
2289
|
const key = expression.fieldName;
|
|
2285
2290
|
const len = data.length;
|
|
2286
|
-
let groupval = this.getFieldValue(data[index], key, isDate);
|
|
2291
|
+
let groupval = this.getFieldValue(data[index], key, isDate, isTime);
|
|
2287
2292
|
res.push(data[index]);
|
|
2288
2293
|
index++;
|
|
2289
2294
|
const comparer = expression.groupingComparer || DefaultSortingStrategy.instance().compareValues;
|
|
2290
2295
|
for (let i = index; i < len; i++) {
|
|
2291
|
-
let fieldValue = this.getFieldValue(data[i], key, isDate);
|
|
2296
|
+
let fieldValue = this.getFieldValue(data[i], key, isDate, isTime);
|
|
2292
2297
|
if (expression.ignoreCase && isString) {
|
|
2293
2298
|
// when column's dataType is string but the value is number
|
|
2294
2299
|
fieldValue = fieldValue?.toString().toLowerCase();
|
|
@@ -2320,7 +2325,7 @@ class IgxSorting {
|
|
|
2320
2325
|
}
|
|
2321
2326
|
const column = grid?.getColumnByName(expr.fieldName);
|
|
2322
2327
|
const isDate = column?.dataType === DATE_TYPE || column?.dataType === DATE_TIME_TYPE;
|
|
2323
|
-
const isTime = column?.dataType === TIME_TYPE;
|
|
2328
|
+
const isTime = column?.dataType === TIME_TYPE || column?.dataType === DATE_TIME_TYPE;
|
|
2324
2329
|
const isString = column?.dataType === STRING_TYPE;
|
|
2325
2330
|
data = expr.strategy.sort(data, expr.fieldName, expr.dir, expr.ignoreCase, this.getFieldValue, isDate, isTime, grid);
|
|
2326
2331
|
if (expressionIndex === exprsLen - 1) {
|
|
@@ -2328,7 +2333,7 @@ class IgxSorting {
|
|
|
2328
2333
|
}
|
|
2329
2334
|
// in case of multiple sorting
|
|
2330
2335
|
for (i = 0; i < dataLen; i++) {
|
|
2331
|
-
gbData = this.groupedRecordsByExpression(data, i, expr, isDate, isString);
|
|
2336
|
+
gbData = this.groupedRecordsByExpression(data, i, expr, isDate, isTime, isString);
|
|
2332
2337
|
gbDataLen = gbData.length;
|
|
2333
2338
|
if (gbDataLen > 1) {
|
|
2334
2339
|
gbData = this.sortDataRecursive(gbData, expressions, expressionIndex + 1, grid);
|
|
@@ -67859,10 +67864,10 @@ class IgxGridGroupByRowComponent {
|
|
|
67859
67864
|
}
|
|
67860
67865
|
}
|
|
67861
67866
|
IgxGridGroupByRowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: IgxGridGroupByRowComponent, deps: [{ token: IGX_GRID_BASE }, { token: IgxGridSelectionService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: IgxFilteringService }], target: i0.ɵɵFactoryTarget.Component });
|
|
67862
|
-
IgxGridGroupByRowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: IgxGridGroupByRowComponent, selector: "igx-grid-groupby-row", inputs: { hideGroupRowSelectors: "hideGroupRowSelectors", rowDraggable: "rowDraggable", index: "index", gridID: "gridID", groupRow: "groupRow", isFocused: "isFocused" }, host: { listeners: { "pointerdown": "activate()" }, properties: { "attr.aria-expanded": "this.expanded", "attr.aria-describedby": "this.describedBy", "attr.data-rowIndex": "this.dataRowIndex", "attr.id": "this.attrCellID", "class": "this.styleClasses" } }, viewQueries: [{ propertyName: "groupContent", first: true, predicate: ["groupContent"], descendants: true, static: true }, { propertyName: "defaultGroupByExpandedTemplate", first: true, predicate: ["defaultGroupByExpandedTemplate"], descendants: true, read: TemplateRef, static: true }, { propertyName: "defaultGroupByCollapsedTemplate", first: true, predicate: ["defaultGroupByCollapsedTemplate"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-container #defaultGroupRow>\n\n <ng-container *ngIf=\"rowDraggable\">\n <div class=\"igx-grid__drag-indicator igx-grid__tr-action\">\n <igx-icon [style.visibility]=\"'hidden'\">drag_indicator</igx-icon>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"showRowSelectors\">\n <div class=\"igx-grid__cbx-selection igx-grid__tr-action\" style=\"background: none;\" (pointerdown)=\"$event.preventDefault()\"\n (click)=\"onGroupSelectorClick($event)\">\n <ng-template #groupByRowSelector *ngTemplateOutlet=\"\n this.grid.groupByRowSelectorTemplate ? this.grid.groupByRowSelectorTemplate : groupByRowSelectorBaseTemplate;\n context: { $implicit: {\n selectedCount: selectedRowsInTheGroup.length,\n totalCount: this.groupRow.records.length,\n groupRow: this.groupRow }}\">\n </ng-template>\n </div>\n </ng-container>\n\n <div (click)=\"toggle()\" class=\"igx-grid__grouping-indicator\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: this }\">\n </ng-container>\n </div>\n\n <div class=\"igx-grid__group-content\" #groupContent>\n <ng-container\n *ngTemplateOutlet=\"grid.groupRowTemplate ? grid.groupRowTemplate : defaultGroupByTemplate; context: { $implicit: groupRow }\">\n </ng-container>\n </div>\n\n <ng-template #defaultGroupByExpandedTemplate>\n <igx-icon>expand_more</igx-icon>\n </ng-template>\n\n <ng-template #defaultGroupByCollapsedTemplate>\n <igx-icon>chevron_right</igx-icon>\n </ng-template>\n\n\n <ng-template #defaultGroupByTemplate>\n <div class=\"igx-group-label\">\n <igx-icon class=\"igx-group-label__icon\">group_work</igx-icon>\n <span class=\"igx-group-label__column-name\">\n {{ groupRow.column && groupRow.column.header ?\n groupRow.column.header :\n (groupRow.expression ? groupRow.expression.fieldName : '') }}:\n </span>\n\n <ng-container *ngIf=\"dataType === 'boolean' || dataType === 'string'; else default\">\n <span class=\"igx-group-label__text\">{{ groupRow.value }}</span>\n </ng-container>\n <ng-template #default>\n <ng-container *ngIf=\"dataType === 'number'\">\n <span class=\"igx-group-label__text\">{{ groupRow.value | number }}</span>\n </ng-container>\n <ng-container *ngIf=\"dataType === 'date'\">\n <span class=\"igx-group-label__text\">{{ groupRow.value
|
|
67867
|
+
IgxGridGroupByRowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: IgxGridGroupByRowComponent, selector: "igx-grid-groupby-row", inputs: { hideGroupRowSelectors: "hideGroupRowSelectors", rowDraggable: "rowDraggable", index: "index", gridID: "gridID", groupRow: "groupRow", isFocused: "isFocused" }, host: { listeners: { "pointerdown": "activate()" }, properties: { "attr.aria-expanded": "this.expanded", "attr.aria-describedby": "this.describedBy", "attr.data-rowIndex": "this.dataRowIndex", "attr.id": "this.attrCellID", "class": "this.styleClasses" } }, viewQueries: [{ propertyName: "groupContent", first: true, predicate: ["groupContent"], descendants: true, static: true }, { propertyName: "defaultGroupByExpandedTemplate", first: true, predicate: ["defaultGroupByExpandedTemplate"], descendants: true, read: TemplateRef, static: true }, { propertyName: "defaultGroupByCollapsedTemplate", first: true, predicate: ["defaultGroupByCollapsedTemplate"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-container #defaultGroupRow>\n\n <ng-container *ngIf=\"rowDraggable\">\n <div class=\"igx-grid__drag-indicator igx-grid__tr-action\">\n <igx-icon [style.visibility]=\"'hidden'\">drag_indicator</igx-icon>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"showRowSelectors\">\n <div class=\"igx-grid__cbx-selection igx-grid__tr-action\" style=\"background: none;\" (pointerdown)=\"$event.preventDefault()\"\n (click)=\"onGroupSelectorClick($event)\">\n <ng-template #groupByRowSelector *ngTemplateOutlet=\"\n this.grid.groupByRowSelectorTemplate ? this.grid.groupByRowSelectorTemplate : groupByRowSelectorBaseTemplate;\n context: { $implicit: {\n selectedCount: selectedRowsInTheGroup.length,\n totalCount: this.groupRow.records.length,\n groupRow: this.groupRow }}\">\n </ng-template>\n </div>\n </ng-container>\n\n <div (click)=\"toggle()\" class=\"igx-grid__grouping-indicator\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: this }\">\n </ng-container>\n </div>\n\n <div class=\"igx-grid__group-content\" #groupContent>\n <ng-container\n *ngTemplateOutlet=\"grid.groupRowTemplate ? grid.groupRowTemplate : defaultGroupByTemplate; context: { $implicit: groupRow }\">\n </ng-container>\n </div>\n\n <ng-template #defaultGroupByExpandedTemplate>\n <igx-icon>expand_more</igx-icon>\n </ng-template>\n\n <ng-template #defaultGroupByCollapsedTemplate>\n <igx-icon>chevron_right</igx-icon>\n </ng-template>\n\n\n <ng-template #defaultGroupByTemplate>\n <div class=\"igx-group-label\">\n <igx-icon class=\"igx-group-label__icon\">group_work</igx-icon>\n <span class=\"igx-group-label__column-name\">\n {{ groupRow.column && groupRow.column.header ?\n groupRow.column.header :\n (groupRow.expression ? groupRow.expression.fieldName : '') }}:\n </span>\n\n <ng-container *ngIf=\"dataType === 'boolean' || dataType === 'string'; else default\">\n <span class=\"igx-group-label__text\">{{ groupRow.value }}</span>\n </ng-container>\n <ng-template #default>\n <ng-container *ngIf=\"dataType === 'number'\">\n <span class=\"igx-group-label__text\">{{ groupRow.value | number }}</span>\n </ng-container>\n <ng-container *ngIf=\"dataType === 'date' || dataType === 'dateTime' || dataType === 'time'\">\n <span class=\"igx-group-label__text\">{{ groupRow.value |\n date:groupRow.column.pipeArgs.format:groupRow.column.pipeArgs.timezone:grid.locale }}</span>\n </ng-container>\n </ng-template>\n\n <igx-badge [value]=\"groupRow.records ? groupRow.records.length : 0\" class='igx-group-label__count-badge'>\n </igx-badge>\n </div>\n </ng-template>\n <ng-template #groupByRowSelectorBaseTemplate let-context>\n <div class=\"igx-grid__cbx-padding\">\n <igx-checkbox [tabindex]=\"-1\" [readonly]=\"true\" [checked]=\"areAllRowsInTheGroupSelected\"\n [disableRipple]=\"true\" [indeterminate]=\"groupByRowCheckboxIndeterminateState\"\n [disabled]=\"this.grid.rowSelection === 'single'\" [aria-label]=\"groupByRowSelectorBaseAriaLabel\"\n #groupByRowCheckbox>\n </igx-checkbox>\n </div>\n </ng-template>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IgxIconComponent, selector: "igx-icon", inputs: ["family", "active", "name"] }, { kind: "component", type: IgxCheckboxComponent, selector: "igx-checkbox", inputs: ["id", "labelId", "value", "name", "tabindex", "labelPosition", "disableRipple", "required", "aria-labelledby", "aria-label", "indeterminate", "checked", "disabled", "readonly", "disableTransitions"], outputs: ["change"] }, { kind: "component", type: IgxBadgeComponent, selector: "igx-badge", inputs: ["id", "type", "value", "icon"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
67863
67868
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: IgxGridGroupByRowComponent, decorators: [{
|
|
67864
67869
|
type: Component,
|
|
67865
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'igx-grid-groupby-row', template: "<ng-container #defaultGroupRow>\n\n <ng-container *ngIf=\"rowDraggable\">\n <div class=\"igx-grid__drag-indicator igx-grid__tr-action\">\n <igx-icon [style.visibility]=\"'hidden'\">drag_indicator</igx-icon>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"showRowSelectors\">\n <div class=\"igx-grid__cbx-selection igx-grid__tr-action\" style=\"background: none;\" (pointerdown)=\"$event.preventDefault()\"\n (click)=\"onGroupSelectorClick($event)\">\n <ng-template #groupByRowSelector *ngTemplateOutlet=\"\n this.grid.groupByRowSelectorTemplate ? this.grid.groupByRowSelectorTemplate : groupByRowSelectorBaseTemplate;\n context: { $implicit: {\n selectedCount: selectedRowsInTheGroup.length,\n totalCount: this.groupRow.records.length,\n groupRow: this.groupRow }}\">\n </ng-template>\n </div>\n </ng-container>\n\n <div (click)=\"toggle()\" class=\"igx-grid__grouping-indicator\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: this }\">\n </ng-container>\n </div>\n\n <div class=\"igx-grid__group-content\" #groupContent>\n <ng-container\n *ngTemplateOutlet=\"grid.groupRowTemplate ? grid.groupRowTemplate : defaultGroupByTemplate; context: { $implicit: groupRow }\">\n </ng-container>\n </div>\n\n <ng-template #defaultGroupByExpandedTemplate>\n <igx-icon>expand_more</igx-icon>\n </ng-template>\n\n <ng-template #defaultGroupByCollapsedTemplate>\n <igx-icon>chevron_right</igx-icon>\n </ng-template>\n\n\n <ng-template #defaultGroupByTemplate>\n <div class=\"igx-group-label\">\n <igx-icon class=\"igx-group-label__icon\">group_work</igx-icon>\n <span class=\"igx-group-label__column-name\">\n {{ groupRow.column && groupRow.column.header ?\n groupRow.column.header :\n (groupRow.expression ? groupRow.expression.fieldName : '') }}:\n </span>\n\n <ng-container *ngIf=\"dataType === 'boolean' || dataType === 'string'; else default\">\n <span class=\"igx-group-label__text\">{{ groupRow.value }}</span>\n </ng-container>\n <ng-template #default>\n <ng-container *ngIf=\"dataType === 'number'\">\n <span class=\"igx-group-label__text\">{{ groupRow.value | number }}</span>\n </ng-container>\n <ng-container *ngIf=\"dataType === 'date'\">\n <span class=\"igx-group-label__text\">{{ groupRow.value
|
|
67870
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'igx-grid-groupby-row', template: "<ng-container #defaultGroupRow>\n\n <ng-container *ngIf=\"rowDraggable\">\n <div class=\"igx-grid__drag-indicator igx-grid__tr-action\">\n <igx-icon [style.visibility]=\"'hidden'\">drag_indicator</igx-icon>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"showRowSelectors\">\n <div class=\"igx-grid__cbx-selection igx-grid__tr-action\" style=\"background: none;\" (pointerdown)=\"$event.preventDefault()\"\n (click)=\"onGroupSelectorClick($event)\">\n <ng-template #groupByRowSelector *ngTemplateOutlet=\"\n this.grid.groupByRowSelectorTemplate ? this.grid.groupByRowSelectorTemplate : groupByRowSelectorBaseTemplate;\n context: { $implicit: {\n selectedCount: selectedRowsInTheGroup.length,\n totalCount: this.groupRow.records.length,\n groupRow: this.groupRow }}\">\n </ng-template>\n </div>\n </ng-container>\n\n <div (click)=\"toggle()\" class=\"igx-grid__grouping-indicator\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: this }\">\n </ng-container>\n </div>\n\n <div class=\"igx-grid__group-content\" #groupContent>\n <ng-container\n *ngTemplateOutlet=\"grid.groupRowTemplate ? grid.groupRowTemplate : defaultGroupByTemplate; context: { $implicit: groupRow }\">\n </ng-container>\n </div>\n\n <ng-template #defaultGroupByExpandedTemplate>\n <igx-icon>expand_more</igx-icon>\n </ng-template>\n\n <ng-template #defaultGroupByCollapsedTemplate>\n <igx-icon>chevron_right</igx-icon>\n </ng-template>\n\n\n <ng-template #defaultGroupByTemplate>\n <div class=\"igx-group-label\">\n <igx-icon class=\"igx-group-label__icon\">group_work</igx-icon>\n <span class=\"igx-group-label__column-name\">\n {{ groupRow.column && groupRow.column.header ?\n groupRow.column.header :\n (groupRow.expression ? groupRow.expression.fieldName : '') }}:\n </span>\n\n <ng-container *ngIf=\"dataType === 'boolean' || dataType === 'string'; else default\">\n <span class=\"igx-group-label__text\">{{ groupRow.value }}</span>\n </ng-container>\n <ng-template #default>\n <ng-container *ngIf=\"dataType === 'number'\">\n <span class=\"igx-group-label__text\">{{ groupRow.value | number }}</span>\n </ng-container>\n <ng-container *ngIf=\"dataType === 'date' || dataType === 'dateTime' || dataType === 'time'\">\n <span class=\"igx-group-label__text\">{{ groupRow.value |\n date:groupRow.column.pipeArgs.format:groupRow.column.pipeArgs.timezone:grid.locale }}</span>\n </ng-container>\n </ng-template>\n\n <igx-badge [value]=\"groupRow.records ? groupRow.records.length : 0\" class='igx-group-label__count-badge'>\n </igx-badge>\n </div>\n </ng-template>\n <ng-template #groupByRowSelectorBaseTemplate let-context>\n <div class=\"igx-grid__cbx-padding\">\n <igx-checkbox [tabindex]=\"-1\" [readonly]=\"true\" [checked]=\"areAllRowsInTheGroupSelected\"\n [disableRipple]=\"true\" [indeterminate]=\"groupByRowCheckboxIndeterminateState\"\n [disabled]=\"this.grid.rowSelection === 'single'\" [aria-label]=\"groupByRowSelectorBaseAriaLabel\"\n #groupByRowCheckbox>\n </igx-checkbox>\n </div>\n </ng-template>\n</ng-container>\n" }]
|
|
67866
67871
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
67867
67872
|
type: Inject,
|
|
67868
67873
|
args: [IGX_GRID_BASE]
|