Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit ee3bf0e

Browse files
authored
Merge pull request #864 from ghiscoding/feat/slickgrid-universal-plugins
BREAKING CHANGE: upgrade to Slickgrid-Universal official 1.x major version
2 parents 332a567 + 4072336 commit ee3bf0e

File tree

60 files changed

+3624
-3524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3624
-3524
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ One of the best javascript datagrid [SlickGrid](https://github.com/mleibman/Slic
2020
[Angular-Slickgrid on NPM](https://www.npmjs.com/package/angular-slickgrid)
2121

2222
### Demo page
23-
`Angular-Slickgrid` works with `Bootstrap 4` and even latest `Bootstrap 5` version, you can see a demo of each one below. There are also 2 new styling Themes, Material & Salesforce are also available and you could also use SVG icons if so take a look at the [Wiki - SVG Icons](https://github.com/ghiscoding/Angular-Slickgrid/wiki/SVG-Icons)
23+
`Angular-Slickgrid` works with all `Bootstrap` versions, you can see a demo of each one below. There are also 2 new styling Themes, Material & Salesforce which are also available. You can also use different SVG icons, you may want to look at the [Wiki - SVG Icons](https://github.com/ghiscoding/Angular-Slickgrid/wiki/SVG-Icons)
2424
- [Bootstrap 5 demo](https://ghiscoding.github.io/Angular-Slickgrid) / [examples repo](https://github.com/ghiscoding/angular-slickgrid-demos/tree/master/bootstrap5-demo-with-translate)
2525
- [Bootstrap 4 demo](https://ghiscoding.github.io/angular-slickgrid-demos) / [examples repo](https://github.com/ghiscoding/angular-slickgrid-demos/tree/master/bootstrap4-demo-with-translate)
2626

@@ -54,10 +54,12 @@ Check out the [Releases](https://github.com/ghiscoding/Angular-Slickgrid/release
5454
## Angular Compatibility
5555
- version `1.x.x` for Angular 4 to 6
5656
- version `2.x.x` for Angular 7+
57-
- version `3.x.x` for Angular 12+ and RxJS 7+
57+
- version `3.x.x` for Angular 12+ and RxJS 7+ ([migration guide to 3.x](https://github.com/ghiscoding/Angular-Slickgrid/wiki/Migration-to-3.x))
5858
- build `target` got bumped to `ES2018` for modern browser **only**
5959
- IE11 is reaching EOL by year end and is **no longer supported**, if you still need to support it then stick with version 2.x
6060
- uses [Slickgrid-Universal](https://github.com/ghiscoding/slickgrid-universal) monorepo
61+
- version `4.x.x` for Angular 13+ and RxJS 7+ (**Ivy only**, [migration guide to 4.x](https://github.com/ghiscoding/Angular-Slickgrid/wiki/Migration-to-4.x))
62+
- for Ivy build only (no more UMD bundle), IE is definitely out of the picture
6163

6264
For Angular 12+ see the instructions below - [Angular 12 with WebPack 5 - polyfill issue](https://github.com/ghiscoding/Angular-Slickgrid#angular-12-with-webpack-5---how-to-fix-polyfill-error)
6365

@@ -67,10 +69,10 @@ If you are facing any issues with `ngx-translate` library while building your An
6769

6870
| Angular Version | @ngx-translate/core |
6971
|-----------------|---------------------|
70-
| 10+ | 13.x+ |
71-
| 9 | 12.x+ |
72-
| 8 | 12.x+ |
73-
| 7 | 11.x+ |
72+
| 13+ (Ivy only) | 14.x+ |
73+
| 10-13 | 13.x+ |
74+
| 8-9 | 12.x+ |
75+
| 7 | 11.x+ |
7476

7577
### Build Warnings (Angular 8+)
7678
You might get warnings about SlickGrid while doing a production build, most of them are fine and the best way to fix them, is to simply remove/ignore the warnings, all you have to do is to add a file named `ngcc.config.js` in your project root (same location as the `angular.json` file) with the following content (you can also see this [commit](https://github.com/ghiscoding/angular-slickgrid-demos/commit/1fe8092bcd2e99ede5ab048f4a7ebe6254e4bee0) which fixes the Angular-Slickgrid-Demos prod build):
@@ -129,7 +131,7 @@ This is no longer the case. Verify if you need this module and configure a polyf
129131
```
130132

131133
### Fully Tested with [Jest](https://jestjs.io/) (Unit Tests) - [Cypress](https://www.cypress.io/) (E2E Tests)
132-
Angular-Slickgrid and Slickgrid-Universal both have **100%** Unit Test Coverage, we are talking about +13,000 lines of code (+3,000 unit tests) that are fully tested with [Jest](https://jestjs.io/). On the UI side, all Angular-Slickgrid Examples are tested with [Cypress](https://www.cypress.io/), there are over 500 Cypress E2E tests.
134+
Angular-Slickgrid and Slickgrid-Universal both have **100%** Unit Test Coverage, we are talking about +15,000 lines of code (+3,750 unit tests) that are fully tested with [Jest](https://jestjs.io/). On the UI side, all Angular-Slickgrid Examples are tested with [Cypress](https://www.cypress.io/), there are over +500 Cypress E2E tests.
133135

134136
## Installation
135137
Refer to the **[Wiki - HOWTO Step by Step](https://github.com/ghiscoding/angular-slickgrid/wiki/HOWTO---Step-by-Step)** and/or clone the [Angular-Slickgrid Demos](https://github.com/ghiscoding/angular-slickgrid-demos) repository. Please don't open any issue unless you have followed these steps (from the Wiki), and if any of the steps are incorrect or confusing, then please let me know.

package.json

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,17 @@
7070
}
7171
},
7272
"dependencies": {
73-
"@slickgrid-universal/common": "^0.19.2",
74-
"@slickgrid-universal/custom-footer-component": "^0.19.2",
75-
"@slickgrid-universal/empty-warning-component": "^0.19.2",
76-
"@slickgrid-universal/event-pub-sub": "^0.19.2",
77-
"@slickgrid-universal/pagination-component": "^0.19.2",
78-
"@slickgrid-universal/rxjs-observable": "^0.19.2",
79-
"@types/dompurify": "^2.3.1",
80-
"@types/jquery": "^3.5.8",
73+
"@slickgrid-universal/common": "^1.1.0",
74+
"@slickgrid-universal/custom-footer-component": "^1.1.1",
75+
"@slickgrid-universal/empty-warning-component": "^1.1.1",
76+
"@slickgrid-universal/event-pub-sub": "^1.1.1",
77+
"@slickgrid-universal/pagination-component": "^1.1.1",
78+
"@slickgrid-universal/row-detail-view-plugin": "^1.1.1",
79+
"@slickgrid-universal/rxjs-observable": "^1.1.1",
80+
"@types/dompurify": "^2.3.2",
81+
"@types/jquery": "^3.5.10",
8182
"dequal": "^2.0.2",
82-
"dompurify": "^2.3.3",
83+
"dompurify": "^2.3.4",
8384
"font-awesome": "^4.7.0",
8485
"jquery": "~3.5.1",
8586
"jquery-ui-dist": "^1.12.1",
@@ -90,39 +91,39 @@
9091
"@ngx-translate/core": ">=14.0.0"
9192
},
9293
"devDependencies": {
93-
"@angular-devkit/build-angular": "~13.0.3",
94+
"@angular-devkit/build-angular": "~13.1.1",
9495
"@angular-eslint/builder": "13.0.1",
9596
"@angular-eslint/eslint-plugin": "13.0.1",
9697
"@angular-eslint/eslint-plugin-template": "13.0.1",
9798
"@angular-eslint/schematics": "13.0.1",
9899
"@angular-eslint/template-parser": "13.0.1",
99-
"@angular/animations": "^13.0.2",
100-
"@angular/cli": "^13.0.3",
101-
"@angular/common": "^13.0.2",
102-
"@angular/compiler": "^13.0.2",
103-
"@angular/compiler-cli": "^13.0.2",
104-
"@angular/core": "^13.0.2",
105-
"@angular/forms": "^13.0.2",
106-
"@angular/language-service": "^13.0.2",
107-
"@angular/platform-browser": "^13.0.2",
108-
"@angular/platform-browser-dynamic": "^13.0.2",
109-
"@angular/router": "^13.0.2",
100+
"@angular/animations": "^13.1.0",
101+
"@angular/cli": "^13.1.1",
102+
"@angular/common": "^13.1.0",
103+
"@angular/compiler": "^13.1.0",
104+
"@angular/compiler-cli": "^13.1.0",
105+
"@angular/core": "^13.1.0",
106+
"@angular/forms": "^13.1.0",
107+
"@angular/language-service": "^13.1.0",
108+
"@angular/platform-browser": "^13.1.0",
109+
"@angular/platform-browser-dynamic": "^13.1.0",
110+
"@angular/router": "^13.1.0",
110111
"@ng-select/ng-select": "^8.1.1",
111112
"@ngx-translate/core": "^14.0.0",
112113
"@ngx-translate/http-loader": "^7.0.0",
113-
"@slickgrid-universal/composite-editor-component": "^0.19.2",
114-
"@slickgrid-universal/custom-tooltip-plugin": "^0.19.2",
115-
"@slickgrid-universal/excel-export": "^0.19.2",
116-
"@slickgrid-universal/graphql": "^0.19.2",
117-
"@slickgrid-universal/odata": "^0.19.2",
118-
"@slickgrid-universal/text-export": "^0.19.2",
114+
"@slickgrid-universal/composite-editor-component": "^1.1.1",
115+
"@slickgrid-universal/custom-tooltip-plugin": "^1.1.1",
116+
"@slickgrid-universal/excel-export": "^1.1.1",
117+
"@slickgrid-universal/graphql": "^1.1.1",
118+
"@slickgrid-universal/odata": "^1.1.1",
119+
"@slickgrid-universal/text-export": "^1.1.1",
119120
"@types/flatpickr": "^3.1.2",
120121
"@types/jest": "^27.0.3",
121122
"@types/moment": "^2.13.0",
122-
"@types/node": "^16.11.9",
123+
"@types/node": "^16.11.12",
123124
"@types/text-encoding-utf-8": "^1.0.2",
124-
"@typescript-eslint/eslint-plugin": "^5.4.0",
125-
"@typescript-eslint/parser": "^5.4.0",
125+
"@typescript-eslint/eslint-plugin": "^5.6.0",
126+
"@typescript-eslint/parser": "^5.6.0",
126127
"autoprefixer": "^10.4.0",
127128
"bootstrap": "^5.1.3",
128129
"codecov": "^3.8.3",
@@ -133,25 +134,25 @@
133134
"custom-event-polyfill": "^1.0.7",
134135
"del": "^6.0.0",
135136
"del-cli": "^4.0.1",
136-
"eslint": "^8.2.0",
137-
"jest": "^27.3.1",
138-
"jest-extended": "^1.1.0",
139-
"jest-preset-angular": "^11.0.0",
140-
"ng-packagr": "^13.0.6",
137+
"eslint": "^8.4.1",
138+
"jest": "^27.4.3",
139+
"jest-extended": "^1.2.0",
140+
"jest-preset-angular": "^11.0.1",
141+
"ng-packagr": "^13.1.1",
141142
"ngx-bootstrap": "^7.1.0",
142143
"npm-run-all": "^4.1.5",
143-
"postcss": "^8.3.11",
144-
"postcss-cli": "^9.0.2",
144+
"postcss": "^8.4.4",
145+
"postcss-cli": "^9.1.0",
145146
"require-dir": "^1.2.0",
146147
"rimraf": "^3.0.2",
147148
"run-sequence": "^2.2.1",
148-
"sass": "^1.43.4",
149+
"sass": "^1.45.0",
149150
"standard-version": "^9.3.2",
150151
"stream-browserify": "^3.0.0",
151152
"ts-node": "^10.4.0",
152153
"tslib": "^2.3.1",
153154
"typescript": "~4.4.4",
154-
"yargs": "^17.2.1",
155+
"yargs": "^17.3.0",
155156
"zone.js": "~0.11.4"
156157
},
157158
"engines": {

src/app/examples/grid-angular.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ export class GridAngularComponent implements OnInit {
229229
field: 'id',
230230
formatter: () => `<div class="fake-hyperlink">Action <i class="fa fa-caret-down"></i></div>`,
231231
cellMenu: {
232-
width: 175,
233232
commandTitle: 'Commands',
234233
commandItems: [
235234
{
@@ -260,6 +259,7 @@ export class GridAngularComponent implements OnInit {
260259
headerRowHeight: 45,
261260
rowHeight: 45, // increase row height so that the ng-select fits in the cell
262261
editable: true,
262+
enableCellMenu: true,
263263
enableCellNavigation: true,
264264
enableColumnPicker: true,
265265
enableExcelCopyBuffer: true,
@@ -270,7 +270,6 @@ export class GridAngularComponent implements OnInit {
270270
this._commandQueue.push(editCommand);
271271
editCommand.execute();
272272
},
273-
enableCellMenu: true,
274273
i18n: this.translate,
275274
params: {
276275
angularUtilService: this.angularUtilService // provide the service to all at once (Editor, Filter, AsyncPostRender)

src/app/examples/grid-clientside.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, OnInit } from '@angular/core';
22
import { HttpClient } from '@angular/common/http';
3+
import { ExcelExportService } from '@slickgrid-universal/excel-export';
34
import { TranslateService } from '@ngx-translate/core';
4-
import { CustomInputFilter } from './custom-inputFilter';
55
import {
66
AngularGridInstance,
77
Column,
@@ -15,6 +15,7 @@ import {
1515
MultipleSelectOption,
1616
OperatorType,
1717
} from './../modules/angular-slickgrid';
18+
import { CustomInputFilter } from './custom-inputFilter';
1819

1920
function randomBetween(min: number, max: number) {
2021
return Math.floor(Math.random() * (max - min + 1) + min);
@@ -195,6 +196,7 @@ export class GridClientSideComponent implements OnInit {
195196
{ columnId: 'complete', direction: 'ASC' }
196197
],
197198
},
199+
registerExternalResources: [new ExcelExportService()],
198200
};
199201

200202
// mock a dataset
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$button-border-color: #ababab !default;
1+
$slick-button-border-color: #ababab !default;
22

33
.editable-field {
44
background-color: rgba(227, 240, 251, 0.569) !important;
@@ -9,11 +9,11 @@ $button-border-color: #ababab !default;
99
.button-style {
1010
cursor: pointer;
1111
background-color: white;
12-
border: 1px solid #{$button-border-color};
12+
border: 1px solid #{$slick-button-border-color};
1313
border-radius: 2px;
1414
justify-content: center;
1515
text-align: center;
1616
&:hover {
17-
border-color: darken($button-border-color, 10%);
17+
border-color: darken($slick-button-border-color, 10%);
1818
}
1919
}

src/app/examples/grid-composite-editor.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ export class GridCompositeEditorComponent implements OnInit {
321321
formatter: () => `<div class="button-style margin-auto" style="width: 35px;"><span class="fa fa-chevron-down text-primary"></span></div>`,
322322
cellMenu: {
323323
hideCloseButton: false,
324-
width: 175,
325324
commandTitle: 'Commands',
326325
commandItems: [
327326
{

src/app/examples/grid-contextmenu.component.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
108108
this.angularGrid = angularGrid;
109109
}
110110

111-
get cellMenuInstance(): any {
112-
return this.angularGrid?.extensionService?.getSlickgridAddonInstance?.(ExtensionName.cellMenu) ?? {};
111+
get cellMenuInstance() {
112+
return this.angularGrid?.extensionService?.getExtensionInstanceByName(ExtensionName.cellMenu);
113113
}
114114

115-
get contextMenuInstance(): any {
116-
return this.angularGrid?.extensionService?.getSlickgridAddonInstance?.(ExtensionName.contextMenu) ?? {};
115+
get contextMenuInstance() {
116+
return this.angularGrid?.extensionService?.getExtensionInstanceByName(ExtensionName.contextMenu);
117117
}
118118

119119
ngOnInit() {
@@ -183,7 +183,6 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
183183
formatter: actionFormatter,
184184
cellMenu: {
185185
hideCloseButton: false,
186-
width: 200,
187186
// you can override the logic of when the menu is usable
188187
// for example say that we want to show a menu only when then Priority is set to 'High'.
189188
// Note that this ONLY overrides the usability itself NOT the text displayed in the cell,
@@ -352,7 +351,6 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
352351
getContextMenuOptions(): ContextMenu {
353352
return {
354353
hideCloseButton: false,
355-
width: 200,
356354
// optionally and conditionally define when the the menu is usable,
357355
// this should be used with a custom formatter to show/hide/disable the menu
358356
menuUsabilityOverride: (args) => {
@@ -434,7 +432,7 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
434432
onOptionSelected: ((e, args) => {
435433
// change Priority
436434
const dataContext = args && args.dataContext;
437-
if (dataContext && dataContext.hasOwnProperty('priority')) {
435+
if (dataContext?.hasOwnProperty('priority')) {
438436
dataContext.priority = args.item.option;
439437
this.angularGrid.gridService.updateItem(dataContext);
440438
}
@@ -446,15 +444,15 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
446444
// when showing both Commands/Options, we can just pass an empty array to show over all columns
447445
// else show on all columns except Priority
448446
const showOverColumnIds = showBothList ? [] : ['id', 'title', 'complete', 'start', 'finish', 'completed', 'action'];
449-
this.contextMenuInstance.setOptions({
447+
this.contextMenuInstance?.setOptions({
450448
commandShownOverColumnIds: showOverColumnIds,
451449
// hideCommandSection: !showBothList
452450
});
453451
}
454452

455453
showCellMenuCommandsAndOptions(showBothList: boolean) {
456454
// change via the plugin setOptions
457-
this.cellMenuInstance.setOptions({
455+
this.cellMenuInstance?.setOptions({
458456
hideOptionSection: !showBothList
459457
});
460458

src/app/examples/grid-custom-tooltip.component.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$button-border-color: #ababab !default;
1+
$slick-button-border-color: #ababab !default;
22
@import '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-bootstrap.scss';
33

44
// --
@@ -24,12 +24,12 @@ $button-border-color: #ababab !default;
2424
.button-style {
2525
cursor: pointer;
2626
background-color: white;
27-
border: 1px solid #{$button-border-color};
27+
border: 1px solid #{$slick-button-border-color};
2828
border-radius: 2px;
2929
justify-content: center;
3030
text-align: center;
3131
&:hover {
32-
border-color: darken($button-border-color, 10%);
32+
border-color: darken($slick-button-border-color, 10%);
3333
}
3434
}
3535

src/app/examples/grid-custom-tooltip.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ export class GridCustomTooltipComponent implements OnInit {
270270
excludeFromExport: true,
271271
cellMenu: {
272272
hideCloseButton: false,
273-
width: 175,
274273
commandTitle: 'Commands',
275274
commandItems: [
276275
// array of command item objects, you can also use the "positionOrder" that will be used to sort the items in the list

src/app/examples/grid-draggrouping.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class GridDraggableGroupingComponent implements OnInit {
188188
}
189189
},
190190
{
191-
id: 'effortDriven', name: 'Effort Driven', field: 'effortDriven',
191+
id: 'effortDriven', name: 'Effort-Driven', field: 'effortDriven',
192192
width: 80, minWidth: 20, maxWidth: 100,
193193
cssClass: 'cell-effort-driven',
194194
sortable: true,
@@ -218,6 +218,7 @@ export class GridDraggableGroupingComponent implements OnInit {
218218
createPreHeaderPanel: true,
219219
showPreHeaderPanel: true,
220220
preHeaderPanelHeight: 40,
221+
showCustomFooter: true,
221222
enableFiltering: true,
222223
// you could debounce/throttle the input text filter if you have lots of data
223224
// filterTypingDebounce: 250,

0 commit comments

Comments
 (0)