From 7e65d86f35b4252b226dfe0fccf392c47ade227c Mon Sep 17 00:00:00 2001 From: kdinev Date: Mon, 22 Jun 2026 14:54:53 +0300 Subject: [PATCH] fix(grid groupby): custom sorting strategy sample was throwing --- package-lock.json | 110 ------------------ .../grid-groupby-custom-sample.component.ts | 14 +-- 2 files changed, 7 insertions(+), 117 deletions(-) diff --git a/package-lock.json b/package-lock.json index 78d8725d4..54b404ddb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3908,9 +3908,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -3928,9 +3925,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -3948,9 +3942,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -3968,9 +3959,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -3988,9 +3976,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4008,9 +3993,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4028,9 +4010,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4498,9 +4477,6 @@ "cpu": [ "arm" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4521,9 +4497,6 @@ "cpu": [ "arm" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4544,9 +4517,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4567,9 +4537,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4590,9 +4557,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4613,9 +4577,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4805,9 +4766,6 @@ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4822,9 +4780,6 @@ "arm" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4839,9 +4794,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4856,9 +4808,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4873,9 +4822,6 @@ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4890,9 +4836,6 @@ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4907,9 +4850,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4924,9 +4864,6 @@ "ppc64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4941,9 +4878,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4958,9 +4892,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4975,9 +4906,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4992,9 +4920,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5009,9 +4934,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -5425,9 +5347,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5444,9 +5363,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -5463,9 +5379,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5482,9 +5395,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -12369,9 +12279,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -12392,9 +12299,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -12415,9 +12319,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -12438,9 +12339,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -15389,7 +15287,6 @@ "cpu": [ "arm" ], - "libc": "glibc", "license": "MIT", "optional": true, "os": [ @@ -15406,7 +15303,6 @@ "cpu": [ "arm64" ], - "libc": "glibc", "license": "MIT", "optional": true, "os": [ @@ -15423,7 +15319,6 @@ "cpu": [ "arm" ], - "libc": "musl", "license": "MIT", "optional": true, "os": [ @@ -15440,7 +15335,6 @@ "cpu": [ "arm64" ], - "libc": "musl", "license": "MIT", "optional": true, "os": [ @@ -15457,7 +15351,6 @@ "cpu": [ "riscv64" ], - "libc": "musl", "license": "MIT", "optional": true, "os": [ @@ -15474,7 +15367,6 @@ "cpu": [ "x64" ], - "libc": "musl", "license": "MIT", "optional": true, "os": [ @@ -15491,7 +15383,6 @@ "cpu": [ "riscv64" ], - "libc": "glibc", "license": "MIT", "optional": true, "os": [ @@ -15508,7 +15399,6 @@ "cpu": [ "x64" ], - "libc": "glibc", "license": "MIT", "optional": true, "os": [ diff --git a/src/app/grid/grid-groupby-custom-sample/grid-groupby-custom-sample.component.ts b/src/app/grid/grid-groupby-custom-sample/grid-groupby-custom-sample.component.ts index 096a847ba..9d1cac502 100644 --- a/src/app/grid/grid-groupby-custom-sample/grid-groupby-custom-sample.component.ts +++ b/src/app/grid/grid-groupby-custom-sample/grid-groupby-custom-sample.component.ts @@ -23,12 +23,12 @@ export class GridGroupByCustomSampleComponent { @ViewChild('grid1', { read: IgxGridComponent, static: true }) public grid1: IgxGridComponent; public data; - public sortingStrategy; - public groupByOptions = [ - { name: 'Day', ref: DaySortingStrategy.instance() }, - { name: 'Week', ref: WeekSortingStrategy.instance() }, - { name: 'Month', ref: BaseSortingStrategy.instance() }, - { name: 'Year', ref: BaseSortingStrategy.instance() } + public sortingStrategy: BaseSortingStrategy; + public groupByOptions: { name: string; ref: BaseSortingStrategy }[] = [ + { name: 'Day', ref: DaySortingStrategy.instance() as DaySortingStrategy }, + { name: 'Week', ref: WeekSortingStrategy.instance() as WeekSortingStrategy }, + { name: 'Month', ref: BaseSortingStrategy.instance() as BaseSortingStrategy }, + { name: 'Year', ref: BaseSortingStrategy.instance() as BaseSortingStrategy } ]; public groupByMode = this.groupByOptions[0].name; @@ -54,7 +54,7 @@ export class GridGroupByCustomSampleComponent { } else if (this.groupByMode === 'Year') { return dateA.year === dateB.year ? 0 : -1; } else if (this.groupByMode === 'Week') { - return this.sortingStrategy.getWeekOfDate(a) === this.sortingStrategy.getWeekOfDate(b) ? 0 : -1; + return (this.sortingStrategy as WeekSortingStrategy).getWeekOfDate(a) === (this.sortingStrategy as WeekSortingStrategy).getWeekOfDate(b) ? 0 : -1; } return dateA.day === dateB.day && dateA.month === dateB.month ? 0 : -1; }