@festo-ui/angular 3.0.0-pre-20220105.2 → 3.1.0

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.
@@ -1259,12 +1259,17 @@
1259
1259
  var TabPaneComponent = /** @class */ (function () {
1260
1260
  function TabPaneComponent() {
1261
1261
  this.tabPaneId = "tab-panel-content-" + ++TabPaneComponent.nextId;
1262
+ this.changesSubject = new rxjs.Subject();
1263
+ this.changes$ = this.changesSubject.asObservable();
1262
1264
  }
1265
+ TabPaneComponent.prototype.ngOnChanges = function () {
1266
+ this.changesSubject.next(true);
1267
+ };
1263
1268
  return TabPaneComponent;
1264
1269
  }());
1265
1270
  TabPaneComponent.nextId = 0;
1266
1271
  TabPaneComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0__namespace, type: TabPaneComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1267
- TabPaneComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: TabPaneComponent, selector: "fng-tab-pane", inputs: { id: "id", name: "name", icon: "icon", active: "active", isVisible: "isVisible" }, ngImport: i0__namespace, template: "<div role=\"tabpanel\" [id]=\"tabPaneId\" [attr.aria-labelledby]=\"tabId\" [class.fng-show]=\"isVisible\" [class.fng-hide]=\"!isVisible\">\n <ng-content></ng-content>\n</div>\n", styles: [".fng-show{display:block}.fng-hide{display:none}\n"] });
1272
+ TabPaneComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: TabPaneComponent, selector: "fng-tab-pane", inputs: { id: "id", name: "name", icon: "icon", active: "active", isVisible: "isVisible" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div role=\"tabpanel\" [id]=\"tabPaneId\" [attr.aria-labelledby]=\"tabId\" [class.fng-show]=\"isVisible\" [class.fng-hide]=\"!isVisible\">\n <ng-content></ng-content>\n</div>\n", styles: [".fng-show{display:block}.fng-hide{display:none}\n"] });
1268
1273
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0__namespace, type: TabPaneComponent, decorators: [{
1269
1274
  type: i0.Component,
1270
1275
  args: [{
@@ -1300,6 +1305,7 @@
1300
1305
  this.tabs = [];
1301
1306
  this.useCompactDensity = true;
1302
1307
  this.activeTab = null;
1308
+ this.complete = new rxjs.Subject();
1303
1309
  this.injectedWindow = this.document.defaultView;
1304
1310
  }
1305
1311
  TabsComponent.prototype.ngAfterContentInit = function () {
@@ -1341,6 +1347,11 @@
1341
1347
  if (this.elemScrollArea != null) {
1342
1348
  this.resizeObserver.observe(this.elemScrollArea);
1343
1349
  }
1350
+ this.handleTabPaneChanges();
1351
+ };
1352
+ TabsComponent.prototype.ngOnDestroy = function () {
1353
+ this.complete.next(true);
1354
+ this.complete.unsubscribe();
1344
1355
  };
1345
1356
  TabsComponent.prototype.showTabPane = function (id) {
1346
1357
  var _a;
@@ -1391,6 +1402,7 @@
1391
1402
  };
1392
1403
  TabsComponent.prototype.initTabs = function () {
1393
1404
  var _this = this;
1405
+ this.tabs = [];
1394
1406
  this.panes.map(function (pane, i) {
1395
1407
  pane.tabId = _this.componentId + '-tab-' + i;
1396
1408
  var tab = {
@@ -1402,6 +1414,7 @@
1402
1414
  _this.tabs.push(tab);
1403
1415
  });
1404
1416
  this.initActiveTab();
1417
+ this.cd.detectChanges();
1405
1418
  };
1406
1419
  TabsComponent.prototype.initActiveTab = function () {
1407
1420
  var activeTab = this.tabs.find(function (tab) { return !!tab.active; });
@@ -1413,6 +1426,16 @@
1413
1426
  this.activeTab = activeTab;
1414
1427
  }
1415
1428
  };
1429
+ TabsComponent.prototype.handleTabPaneChanges = function () {
1430
+ var _this = this;
1431
+ // first subscribe to any changes in tab pane, so that the tabs in this view wiil be updated
1432
+ this.panes.forEach(function (pane) {
1433
+ pane.changes$.pipe(operators.takeUntil(_this.complete)).subscribe(function () {
1434
+ // on changes in a tab pane, we init the tabs again
1435
+ _this.initTabs();
1436
+ });
1437
+ });
1438
+ };
1416
1439
  TabsComponent.prototype.scrollTo = function (scrollX) {
1417
1440
  var currentScrollX = this.getScrollPosition();
1418
1441
  var safeScrollX = this.clampScrollValue(scrollX);