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

Commit 8d5171c

Browse files
Ghislain BeaulacGhislain Beaulac
authored andcommitted
prepare version 0.7.8
1 parent f8653ca commit 8d5171c

11 files changed

+257
-149
lines changed

dist/angular-slickgrid.es5.js

Lines changed: 83 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9512,14 +9512,20 @@ var booleanFilterCondition = function (options) {
95129512
};
95139513
var testFilterCondition = function (operator, value1, value2) {
95149514
switch (operator) {
9515-
case '<': return (value1 < value2);
9516-
case '<=': return (value1 <= value2);
9517-
case '>': return (value1 > value2);
9518-
case '>=': return (value1 >= value2);
9515+
case '<':
9516+
case 'LT': return (value1 < value2);
9517+
case '<=':
9518+
case 'LE': return (value1 <= value2);
9519+
case '>':
9520+
case 'GT': return (value1 > value2);
9521+
case '>=':
9522+
case 'GE': return (value1 >= value2);
95199523
case '!=':
9520-
case '<>': return (value1 !== value2);
9524+
case '<>':
9525+
case 'NE': return (value1 !== value2);
95219526
case '=':
9522-
case '==': return (value1 === value2);
9527+
case '==':
9528+
case 'EQ': return (value1 === value2);
95239529
}
95249530
return true;
95259531
};
@@ -9638,13 +9644,17 @@ var FilterConditions = {
96389644
var inputFilterTemplate = function (searchTerm, columnDef) {
96399645
return "<input type=\"text\" class=\"form-control search-filter\" style=\"font-family: Segoe UI Symbol;\" placeholder=\"&#128269;\">";
96409646
};
9641-
var selectFilterTemplate = function (searchTerm, columnDef) {
9647+
var selectFilterTemplate = function (searchTerm, columnDef, i18n) {
96429648
if (!columnDef.filter.selectOptions) {
9643-
throw new Error("SelectOptions with value/label is required to populate the Select list, for example:: { filter: type: FormElementType.select, selectOptions: [ { value: '1', label: 'One' } ]')");
9649+
throw new Error("SelectOptions with value/label (or value/labelKey when using Locale) is required to populate the Select list, for example:: { filter: type: FormElementType.select, selectOptions: [ { value: '1', label: 'One' } ]')");
96449650
}
96459651
var /** @type {?} */ options = '';
96469652
columnDef.filter.selectOptions.forEach(function (option) {
9647-
options += "<option value=\"" + option.value + "\">" + option.label + "</option>";
9653+
if (!option || (option.label === undefined && option.labelKey === undefined)) {
9654+
throw new Error("SelectOptions with value/label (or value/labelKey when using Locale) is required to populate the Select list, for example:: { filter: type: FormElementType.select, selectOptions: [ { value: '1', label: 'One' } ]')");
9655+
}
9656+
var /** @type {?} */ textLabel = (option.labelKey && i18n && typeof i18n.instant === 'function') ? i18n.instant(option.labelKey) : option.label;
9657+
options += "<option value=\"" + option.value + "\">" + textLabel + "</option>";
96489658
});
96499659
return "<select class=\"form-control search-filter\">" + options + "</select>";
96509660
};
@@ -9866,7 +9876,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
98669876
});
98679877
};
98689878
var FilterService = /** @class */ (function () {
9869-
function FilterService() {
9879+
/**
9880+
* @param {?} translate
9881+
*/
9882+
function FilterService(translate) {
9883+
this.translate = translate;
98709884
this._columnFilters = {};
98719885
this.onFilterChanged = new EventEmitter();
98729886
}
@@ -9967,18 +9981,6 @@ var FilterService = /** @class */ (function () {
99679981
this._grid.render();
99689982
}
99699983
};
9970-
/**
9971-
* @return {?}
9972-
*/
9973-
FilterService.prototype.destroyFilters = function () {
9974-
// we need to loop through all columnFilters and delete them 1 by 1
9975-
// only trying to make columnFilter an empty (without looping) would not trigger a dataset change
9976-
for (var /** @type {?} */ columnId in this._columnFilters) {
9977-
if (columnId && this._columnFilters[columnId]) {
9978-
delete this._columnFilters[columnId];
9979-
}
9980-
}
9981-
};
99829984
/**
99839985
* @param {?} operator
99849986
* @param {?} value1
@@ -10074,7 +10076,23 @@ var FilterService = /** @class */ (function () {
1007410076
* @return {?}
1007510077
*/
1007610078
FilterService.prototype.destroy = function () {
10077-
this.subscriber.unsubscribe();
10079+
this.destroyFilters();
10080+
if (this.subscriber && typeof this.subscriber.unsubscribe === 'function') {
10081+
this.subscriber.unsubscribe();
10082+
}
10083+
};
10084+
/**
10085+
* Destroy the filters, since it's a singleton, we don't want to affect other grids with same columns
10086+
* @return {?}
10087+
*/
10088+
FilterService.prototype.destroyFilters = function () {
10089+
// we need to loop through all columnFilters and delete them 1 by 1
10090+
// only trying to make columnFilter an empty (without looping) would not trigger a dataset change
10091+
for (var /** @type {?} */ columnId in this._columnFilters) {
10092+
if (columnId && this._columnFilters[columnId]) {
10093+
delete this._columnFilters[columnId];
10094+
}
10095+
}
1007810096
};
1007910097
/**
1008010098
* @param {?} e
@@ -10128,7 +10146,7 @@ var FilterService = /** @class */ (function () {
1012810146
else {
1012910147
// custom Select template
1013010148
if (columnDef_1.filter.type === FormElementType.select) {
10131-
filterTemplate = FilterTemplates.select(searchTerm, columnDef_1);
10149+
filterTemplate = FilterTemplates.select(searchTerm, columnDef_1, this_1.translate);
1013210150
}
1013310151
}
1013410152
// when hiding/showing (Column Picker or Grid Menu), it will come re-create yet again the filters
@@ -10204,6 +10222,15 @@ var FilterService = /** @class */ (function () {
1020410222
};
1020510223
return FilterService;
1020610224
}());
10225+
FilterService.decorators = [
10226+
{ type: Injectable },
10227+
];
10228+
/**
10229+
* @nocollapse
10230+
*/
10231+
FilterService.ctorParameters = function () { return [
10232+
{ type: TranslateService, },
10233+
]; };
1020710234
var __awaiter$1 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1020810235
return new (P || (P = Promise))(function (resolve, reject) {
1020910236
function fulfilled(value) { try {
@@ -10328,7 +10355,9 @@ var SortService = /** @class */ (function () {
1032810355
* @return {?}
1032910356
*/
1033010357
SortService.prototype.destroy = function () {
10331-
this.subscriber.unsubscribe();
10358+
if (this.subscriber && typeof this.subscriber.unsubscribe === 'function') {
10359+
this.subscriber.unsubscribe();
10360+
}
1033210361
};
1033310362
/**
1033410363
* A simple function that is attached to the subscriber and emit a change when the sort is called.
@@ -10910,18 +10939,22 @@ var GridExtraService = /** @class */ (function () {
1091010939
this._grid.setSelectedRows([rowNumber]);
1091110940
this._dataView.getItemMetadata = this.getItemRowMetadata(this._dataView.getItemMetadata);
1091210941
var /** @type {?} */ item = this._dataView.getItem(rowNumber);
10913-
item.rowClass = 'highlight';
10914-
this._dataView.updateItem(item.id, item);
10915-
var /** @type {?} */ gridOptions = (this._grid.getOptions());
10916-
// highlight the row for a user defined timeout
10917-
var /** @type {?} */ rowElm = jquery("#" + gridOptions.gridId)
10918-
.find(".highlight.row" + rowNumber)
10919-
.first();
10920-
// delete the row's CSS that was attached for highlighting
10921-
setTimeout(function () {
10922-
delete item.rowClass;
10923-
_this._dataView.updateItem(item.id, item);
10924-
}, fadeDelay + 10);
10942+
if (item && item.id) {
10943+
item.rowClass = 'highlight';
10944+
this._dataView.updateItem(item.id, item);
10945+
var /** @type {?} */ gridOptions = (this._grid.getOptions());
10946+
// highlight the row for a user defined timeout
10947+
var /** @type {?} */ rowElm = jquery("#" + gridOptions.gridId)
10948+
.find(".highlight.row" + rowNumber)
10949+
.first();
10950+
// delete the row's CSS that was attached for highlighting
10951+
setTimeout(function () {
10952+
if (item && item.id) {
10953+
delete item.rowClass;
10954+
_this._dataView.updateItem(item.id, item);
10955+
}
10956+
}, fadeDelay + 10);
10957+
}
1092510958
};
1092610959
/**
1092710960
* @return {?}
@@ -10984,14 +11017,16 @@ var GridExtraService = /** @class */ (function () {
1098411017
if (itemId === -1) {
1098511018
throw new Error("Could not find the item in the item in the grid or it's associated \"id\"");
1098611019
}
10987-
// Update the item itself inside the dataView
10988-
this._dataView.updateItem(itemId, item);
10989-
// highlight the row we just updated
10990-
this.highlightRow(row, 1500);
10991-
// refresh dataview & grid
10992-
this._dataView.refresh();
10993-
// get new dataset length
10994-
var /** @type {?} */ datasetLength = this._dataView.getLength();
11020+
if (item && itemId >= 0) {
11021+
// Update the item itself inside the dataView
11022+
this._dataView.updateItem(itemId, item);
11023+
// highlight the row we just updated
11024+
this.highlightRow(row, 1500);
11025+
// refresh dataview & grid
11026+
this._dataView.refresh();
11027+
// get new dataset length
11028+
var /** @type {?} */ datasetLength = this._dataView.getLength();
11029+
}
1099511030
};
1099611031
return GridExtraService;
1099711032
}());
@@ -33569,10 +33604,11 @@ var AngularSlickgridComponent = /** @class */ (function () {
3356933604
AngularSlickgridComponent.prototype.ngOnDestroy = function () {
3357033605
this._dataView = [];
3357133606
this._gridOptions = {};
33607+
this.grid.destroy();
3357233608
this.controlAndPluginService.destroy();
33573-
this.filterService.destroyFilters();
33609+
this.filterService.destroy();
3357433610
this.resizer.destroy();
33575-
this.grid.destroy();
33611+
this.sortService.destroy();
3357633612
};
3357733613
/**
3357833614
* @return {?}

dist/angular-slickgrid.es5.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)