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

Commit 4ceeb1f

Browse files
committed
Merge branch 'master' into bugfix/in-contains-filter-sanitize-html
2 parents 92b444f + 838c6e7 commit 4ceeb1f

File tree

6 files changed

+1230
-892
lines changed

6 files changed

+1230
-892
lines changed

package.json

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,20 @@
7676
}
7777
},
7878
"dependencies": {
79-
"@slickgrid-universal/common": "^0.16.2",
80-
"@slickgrid-universal/custom-footer-component": "^0.16.2",
81-
"@slickgrid-universal/empty-warning-component": "^0.16.2",
82-
"@slickgrid-universal/event-pub-sub": "^0.16.2",
83-
"@slickgrid-universal/rxjs-observable": "^0.16.2",
79+
"@slickgrid-universal/common": "^0.17.0",
80+
"@slickgrid-universal/custom-footer-component": "^0.17.0",
81+
"@slickgrid-universal/empty-warning-component": "^0.17.0",
82+
"@slickgrid-universal/event-pub-sub": "^0.17.0",
83+
"@slickgrid-universal/rxjs-observable": "^0.17.0",
8484
"@types/dompurify": "^2.2.3",
8585
"@types/jquery": "^3.5.6",
8686
"dequal": "^2.0.2",
87-
"dompurify": "^2.3.0",
87+
"dompurify": "^2.3.1",
8888
"font-awesome": "^4.7.0",
8989
"jquery": "~3.5.1",
9090
"jquery-ui-dist": "^1.12.1",
9191
"moment-mini": "^2.24.0",
92-
"rxjs": "^7.2.0"
92+
"rxjs": "^7.3.0"
9393
},
9494
"peerDependencies": {
9595
"@angular/core": ">=12.1.2",
@@ -98,39 +98,39 @@
9898
"typescript": ">=4.3.5"
9999
},
100100
"devDependencies": {
101-
"@angular-devkit/build-angular": "~12.1.3",
102-
"@angular-eslint/builder": "12.3.1",
103-
"@angular-eslint/eslint-plugin": "12.3.1",
104-
"@angular-eslint/eslint-plugin-template": "12.3.1",
105-
"@angular-eslint/schematics": "12.3.1",
106-
"@angular-eslint/template-parser": "12.3.1",
107-
"@angular/animations": "^12.1.3",
108-
"@angular/cli": "^12.1.3",
109-
"@angular/common": "^12.1.3",
110-
"@angular/compiler": "^12.1.3",
111-
"@angular/compiler-cli": "^12.1.3",
112-
"@angular/core": "^12.1.3",
113-
"@angular/forms": "^12.1.3",
114-
"@angular/language-service": "^12.1.3",
115-
"@angular/platform-browser": "^12.1.3",
116-
"@angular/platform-browser-dynamic": "^12.1.3",
117-
"@angular/router": "^12.1.3",
101+
"@angular-devkit/build-angular": "~12.2.5",
102+
"@angular-eslint/builder": "12.4.1",
103+
"@angular-eslint/eslint-plugin": "12.4.1",
104+
"@angular-eslint/eslint-plugin-template": "12.4.1",
105+
"@angular-eslint/schematics": "12.4.1",
106+
"@angular-eslint/template-parser": "12.4.1",
107+
"@angular/animations": "^12.2.5",
108+
"@angular/cli": "^12.2.5",
109+
"@angular/common": "^12.2.5",
110+
"@angular/compiler": "^12.2.5",
111+
"@angular/compiler-cli": "^12.2.5",
112+
"@angular/core": "^12.2.5",
113+
"@angular/forms": "^12.2.5",
114+
"@angular/language-service": "^12.2.5",
115+
"@angular/platform-browser": "^12.2.5",
116+
"@angular/platform-browser-dynamic": "^12.2.5",
117+
"@angular/router": "^12.2.5",
118118
"@ng-select/ng-select": "^7.2.0",
119119
"@ngx-translate/core": "^13.0.0",
120120
"@ngx-translate/http-loader": "^6.0.0",
121-
"@slickgrid-universal/composite-editor-component": "^0.16.2",
122-
"@slickgrid-universal/excel-export": "^0.16.2",
123-
"@slickgrid-universal/graphql": "^0.16.2",
124-
"@slickgrid-universal/odata": "^0.16.2",
125-
"@slickgrid-universal/text-export": "^0.16.2",
121+
"@slickgrid-universal/composite-editor-component": "^0.17.0",
122+
"@slickgrid-universal/excel-export": "^0.17.0",
123+
"@slickgrid-universal/graphql": "^0.17.0",
124+
"@slickgrid-universal/odata": "^0.17.0",
125+
"@slickgrid-universal/text-export": "^0.17.0",
126126
"@types/flatpickr": "^3.1.2",
127-
"@types/jest": "^26.0.24",
127+
"@types/jest": "^27.0.1",
128128
"@types/moment": "^2.13.0",
129-
"@types/node": "^16.4.1",
129+
"@types/node": "^16.9.0",
130130
"@types/text-encoding-utf-8": "^1.0.2",
131-
"@typescript-eslint/eslint-plugin": "4.28.4",
132-
"@typescript-eslint/parser": "4.28.4",
133-
"autoprefixer": "^10.3.1",
131+
"@typescript-eslint/eslint-plugin": "4.31.0",
132+
"@typescript-eslint/parser": "4.31.0",
133+
"autoprefixer": "^10.3.4",
134134
"bootstrap": "^5.0.2",
135135
"codecov": "^3.8.3",
136136
"codelyzer": "^6.0.2",
@@ -140,29 +140,29 @@
140140
"custom-event-polyfill": "^1.0.7",
141141
"del": "^6.0.0",
142142
"del-cli": "^4.0.1",
143-
"eslint": "^7.31.0",
144-
"jest": "^27.0.6",
143+
"eslint": "^7.32.0",
144+
"jest": "^27.1.1",
145145
"jest-extended": "^0.11.5",
146-
"jest-preset-angular": "^9.0.5",
147-
"ng-packagr": "^12.1.2",
146+
"jest-preset-angular": "^9.0.7",
147+
"ng-packagr": "^12.2.1",
148148
"ngx-bootstrap": "^7.0.0",
149149
"npm-run-all": "^4.1.5",
150150
"postcss": "^8.3.6",
151151
"postcss-cli": "^8.3.1",
152152
"require-dir": "^1.2.0",
153153
"rimraf": "^3.0.2",
154154
"run-sequence": "^2.2.1",
155-
"sass": "^1.36.0",
155+
"sass": "^1.39.0",
156156
"standard-version": "^9.3.1",
157157
"stream-browserify": "^3.0.0",
158-
"ts-node": "^10.1.0",
159-
"tslib": "^2.3.0",
158+
"ts-node": "^10.2.1",
159+
"tslib": "^2.3.1",
160160
"typescript": "~4.3.5",
161-
"yargs": "^17.0.1",
161+
"yargs": "^17.1.1",
162162
"zone.js": "~0.11.4"
163163
},
164164
"engines": {
165165
"node": ">=14.15.0",
166166
"npm": ">=6.14.8"
167167
}
168-
}
168+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
AutocompleteOption,
88
Column,
99
Editors,
10-
EditorArgs,
10+
EditorArguments,
1111
EditorValidator,
1212
FieldType,
1313
Filters,
@@ -34,7 +34,7 @@ const URL_COUNTRIES_COLLECTION = 'assets/data/countries.json';
3434
const URL_COUNTRY_NAMES = 'assets/data/country_names.json';
3535

3636
// you can create custom validator to pass to an inline editor
37-
const myCustomTitleValidator: EditorValidator = (value: any, args?: EditorArgs) => {
37+
const myCustomTitleValidator: EditorValidator = (value: any, args?: EditorArguments) => {
3838
// you can get the Editor Args which can be helpful, e.g. we can get the Translate Service from it
3939
const grid = args && args.grid;
4040
const gridOptions = (grid?.getOptions?.() ?? {}) as GridOption;

src/app/modules/angular-slickgrid/components/__tests__/angular-slickgrid.component.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ const mockDataView = {
209209
destroy: jest.fn(),
210210
beginUpdate: jest.fn(),
211211
endUpdate: jest.fn(),
212+
getFilteredItemCount: jest.fn(),
212213
getItem: jest.fn(),
213214
getItems: jest.fn(),
214215
getItemCount: jest.fn(),
@@ -1839,6 +1840,7 @@ describe('Angular-Slickgrid Custom Component instantiated via Constructor', () =
18391840
totalItemCount: 2
18401841
};
18411842
jest.spyOn(mockDataView, 'getItemCount').mockReturnValue(mockData.length);
1843+
jest.spyOn(mockDataView, 'getFilteredItemCount').mockReturnValue(mockData.length);
18421844

18431845
component.gridOptions = { enablePagination: false, showCustomFooter: true };
18441846
component.initialization(slickEventHandler);
@@ -1854,10 +1856,10 @@ describe('Angular-Slickgrid Custom Component instantiated via Constructor', () =
18541856
const expectation = {
18551857
startTime: expect.toBeDate(),
18561858
endTime: expect.toBeDate(),
1857-
itemCount: 2,
1859+
itemCount: 0,
18581860
totalItemCount: 0
18591861
};
1860-
jest.spyOn(mockDataView, 'getLength').mockReturnValue(2);
1862+
jest.spyOn(mockDataView, 'getFilteredItemCount').mockReturnValue(0);
18611863

18621864
component.gridOptions = { enablePagination: false, showCustomFooter: true };
18631865
component.initialization(slickEventHandler);
@@ -1885,6 +1887,7 @@ describe('Angular-Slickgrid Custom Component instantiated via Constructor', () =
18851887

18861888
component.gridOptions.enableCheckboxSelector = true;
18871889
component.gridOptions.presets = { rowSelection: { dataContextIds: selectedRowIds } };
1890+
component.isDatasetInitialized = false;
18881891
component.initialization(slickEventHandler);
18891892
component.dataset = mockData;
18901893

src/app/modules/angular-slickgrid/components/angular-slickgrid.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy {
307307
const autoTooltipExtension = new AutoTooltipExtension(this.sharedService);
308308
const cellExternalCopyManagerExtension = new CellExternalCopyManagerExtension(this.extensionUtility, this.sharedService);
309309
const cellMenuExtension = new CellMenuExtension(this.extensionUtility, this.sharedService, this.translaterService);
310-
const contextMenuExtension = new ContextMenuExtension(this.extensionUtility, this.sharedService, this.treeDataService, this.translaterService);
310+
const contextMenuExtension = new ContextMenuExtension(this.extensionUtility, this._eventPubSubService, this.sharedService, this.treeDataService, this.translaterService);
311311
const columnPickerExtension = new ColumnPickerExtension(this.extensionUtility, this.sharedService);
312312
const checkboxExtension = new CheckboxSelectorExtension(this.sharedService);
313-
const draggableGroupingExtension = new DraggableGroupingExtension(this.extensionUtility, this.sharedService);
313+
const draggableGroupingExtension = new DraggableGroupingExtension(this.extensionUtility, this._eventPubSubService, this.sharedService);
314314
const gridMenuExtension = new GridMenuExtension(this.extensionUtility, this.filterService, this.sharedService, this.sortService, this.backendUtilityService, this.translaterService);
315315
const groupItemMetaProviderExtension = new GroupItemMetaProviderExtension(this.sharedService);
316316
const headerButtonExtension = new HeaderButtonExtension(this.extensionUtility, this.sharedService);
@@ -923,11 +923,12 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy {
923923
const onRowCountChangedHandler = dataView.onRowCountChanged;
924924
(this._eventHandler as SlickEventHandler<GetSlickEventType<typeof onRowCountChangedHandler>>).subscribe(onRowCountChangedHandler, (_e, args) => {
925925
grid.invalidate();
926-
this.handleOnItemCountChanged(args.current || 0, dataView.getItemCount());
926+
this.handleOnItemCountChanged(this.dataView.getFilteredItemCount() || 0, dataView.getItemCount());
927927
});
928928
const onSetItemsCalledHandler = dataView.onSetItemsCalled;
929929
(this._eventHandler as SlickEventHandler<GetSlickEventType<typeof onSetItemsCalledHandler>>).subscribe(onSetItemsCalledHandler, (_e, args) => {
930-
this.handleOnItemCountChanged(dataView.getLength(), args.itemCount);
930+
grid.invalidate();
931+
this.handleOnItemCountChanged(this.dataView.getFilteredItemCount(), args.itemCount);
931932

932933
// when user has resize by content enabled, we'll force a full width calculation since we change our entire dataset
933934
if (args.itemCount > 0 && (this.gridOptions.autosizeColumnsByCellContentOnFirstLoad || this.gridOptions.enableAutoResizeColumnsByCellContent)) {

test/cypress/integration/example30.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ describe('Example 30 Composite Editor Modal', { retries: 1 }, () => {
262262
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(7)`).find('.fa.fa-check.checkmark-icon').should('have.length', 1);
263263
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(8)`).should('not.be.empty');
264264
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(9)`).should('contain', 'Tasty Granite Table');
265+
266+
// next few rows Title should be unchanged
267+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 1}px"] > .slick-cell:nth(1)`).should('contain', 'TASK 0');
268+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 2}px"] > .slick-cell:nth(1)`).should('contain', 'TASK 1111');
265269
});
266270

267271
it('should open the Composite Editor (Edit Item) and expect all form inputs to be filled with TASK 8888 data of previous create item', () => {
@@ -292,6 +296,10 @@ describe('Example 30 Composite Editor Modal', { retries: 1 }, () => {
292296
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(7)`).find('.fa.fa-check.checkmark-icon').should('not.exist');
293297
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(8)`).should('be.empty');
294298
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(9)`).should('contain', 'Tasty Granite Table');
299+
300+
// next few rows Title should be unchanged
301+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 1}px"] > .slick-cell:nth(1)`).should('contain', 'TASK 0');
302+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 2}px"] > .slick-cell:nth(1)`).should('contain', 'TASK 1111');
295303
});
296304

297305
it('should open the Composite Editor (Mass Update) and be able to change some of the inputs in the form', () => {

0 commit comments

Comments
 (0)