@rxap/material-table-system 12.5.5 → 12.5.8

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.
@@ -892,13 +892,18 @@
892
892
  }
893
893
  TableFilterService.prototype.setMap = function (map) {
894
894
  var current = this.current;
895
- var next = Object.assign(current, map);
895
+ var next = utilities.DeleteEmptyProperties(Object.assign(current, map));
896
896
  this.change.next(next);
897
897
  };
898
898
  TableFilterService.prototype.set = function (key, value) {
899
- var current = this.current;
900
- current[key] = value;
901
- this.change.next(current);
899
+ if (value === null || value === undefined || value === '') {
900
+ this.remove(key);
901
+ }
902
+ else {
903
+ var current = this.current;
904
+ current[key] = value;
905
+ this.change.next(current);
906
+ }
902
907
  };
903
908
  TableFilterService.prototype.remove = function (key) {
904
909
  var current = this.current;
@@ -1171,10 +1176,6 @@
1171
1176
  _super.prototype.ngOnInit.call(this);
1172
1177
  this._subscription = this.form.value$
1173
1178
  .pipe(operators.debounceTime(1000), operators.map(function (values) { return Object.entries(values)
1174
- .filter(function (_b) {
1175
- var _c = __read(_b, 2), key = _c[0], value = _c[1];
1176
- return value !== null && value !== undefined && value !== '';
1177
- })
1178
1179
  .reduce(function (obj, _b) {
1179
1180
  var _c;
1180
1181
  var _d = __read(_b, 2), key = _d[0], value = _d[1];
@@ -1261,9 +1262,9 @@
1261
1262
  }] });
1262
1263
 
1263
1264
  var TableColumnOptionComponent = /** @class */ (function () {
1264
- function TableColumnOptionComponent(_element, route) {
1265
+ function TableColumnOptionComponent(_element, router) {
1265
1266
  this._element = _element;
1266
- this.route = route;
1267
+ this.router = router;
1267
1268
  this.active = true;
1268
1269
  this._hidden = false;
1269
1270
  }
@@ -1304,7 +1305,7 @@
1304
1305
  });
1305
1306
  Object.defineProperty(TableColumnOptionComponent.prototype, "cacheId", {
1306
1307
  get: function () {
1307
- return this.route.snapshot.url.map(function (u) { return u.path; }).join('__') + '--' + this.name;
1308
+ return this.router.url + '--' + this.name;
1308
1309
  },
1309
1310
  enumerable: false,
1310
1311
  configurable: true
@@ -1332,7 +1333,7 @@
1332
1333
  };
1333
1334
  return TableColumnOptionComponent;
1334
1335
  }());
1335
- TableColumnOptionComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TableColumnOptionComponent, deps: [{ token: i0.ElementRef }, { token: i1__namespace$4.ActivatedRoute }], target: i0__namespace.ɵɵFactoryTarget.Component });
1336
+ TableColumnOptionComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TableColumnOptionComponent, deps: [{ token: i0.ElementRef }, { token: i1__namespace$4.Router }], target: i0__namespace.ɵɵFactoryTarget.Component });
1336
1337
  TableColumnOptionComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TableColumnOptionComponent, selector: "rxap-table-column-option", inputs: { name: "name", active: "active", inactive: "inactive", hidden: "hidden", show: "show" }, ngImport: i0__namespace, template: "<ng-content></ng-content>\n", styles: [""] });
1337
1338
  __decorate([
1338
1339
  utilities.Required,
@@ -1349,7 +1350,7 @@
1349
1350
  return [{ type: i0__namespace.ElementRef, decorators: [{
1350
1351
  type: i0.Inject,
1351
1352
  args: [i0.ElementRef]
1352
- }] }, { type: i1__namespace$4.ActivatedRoute }];
1353
+ }] }, { type: i1__namespace$4.Router }];
1353
1354
  }, propDecorators: { name: [{
1354
1355
  type: i0.Input
1355
1356
  }], active: [{
@@ -2328,6 +2329,7 @@
2328
2329
  function OptionsCellComponent(renderer) {
2329
2330
  this.renderer = renderer;
2330
2331
  this._subscription = new rxjs.Subscription();
2332
+ this._initialised = false;
2331
2333
  this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;
2332
2334
  this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;
2333
2335
  }
@@ -2335,6 +2337,11 @@
2335
2337
  var _this = this;
2336
2338
  // Hide the mat-option elements
2337
2339
  this._subscription.add(this.options.changes.pipe(operators.startWith(null), operators.tap(function () { return _this.options.forEach(function (option) { return _this.renderer.setStyle(option._getHostElement(), 'display', 'none'); }); })).subscribe());
2340
+ this.setViewValue();
2341
+ this._initialised = true;
2342
+ };
2343
+ OptionsCellComponent.prototype.setViewValue = function () {
2344
+ var _this = this;
2338
2345
  if (this.value === undefined || this.value === null) {
2339
2346
  this.viewValue = this.emptyViewValue;
2340
2347
  }
@@ -2349,6 +2356,13 @@
2349
2356
  }
2350
2357
  }
2351
2358
  };
2359
+ OptionsCellComponent.prototype.ngOnChanges = function (changes) {
2360
+ if (this._initialised) {
2361
+ if (changes['value']) {
2362
+ this.setViewValue();
2363
+ }
2364
+ }
2365
+ };
2352
2366
  OptionsCellComponent.prototype.getViewValue = function () {
2353
2367
  var _this = this;
2354
2368
  var _a, _b;
@@ -2361,7 +2375,7 @@
2361
2375
  return OptionsCellComponent;
2362
2376
  }());
2363
2377
  OptionsCellComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OptionsCellComponent, deps: [{ token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Component });
2364
- OptionsCellComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: OptionsCellComponent, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, host: { classAttribute: "rxap-options-cell" }, queries: [{ propertyName: "options", predicate: core.MatOption, descendants: true }], ngImport: i0__namespace, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2378
+ OptionsCellComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: OptionsCellComponent, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, host: { classAttribute: "rxap-options-cell" }, queries: [{ propertyName: "options", predicate: core.MatOption, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2365
2379
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: OptionsCellComponent, decorators: [{
2366
2380
  type: i0.Component,
2367
2381
  args: [{