diff --git a/src/app/components/app-setup/app-setup.component.ts b/src/app/components/app-setup/app-setup.component.ts index dff9caef6e82d7e94a7d98d0e8f3df92ad38c512..507c2212e8049223cc4dec55b74eae9e9c4cc834 100644 --- a/src/app/components/app-setup/app-setup.component.ts +++ b/src/app/components/app-setup/app-setup.component.ts @@ -5,7 +5,6 @@ import { ParamDomainValue, Observer } from "jalhyd"; import { ApplicationSetupService } from "../../services/app-setup/app-setup.service"; import { I18nService } from "../../services/internationalisation/internationalisation.service"; import { NgBaseParam } from "../base-param-input/base-param-input.component"; -import { BaseComponent } from "../base/base.component"; import { ErrorStateMatcher, MatSnackBar } from "@angular/material"; @@ -14,7 +13,7 @@ import { ErrorStateMatcher, MatSnackBar } from "@angular/material"; templateUrl: "./app-setup.component.html", styleUrls: ["./app-setup.component.scss"] }) -export class ApplicationSetupComponent extends BaseComponent implements Observer, OnInit { +export class ApplicationSetupComponent implements Observer, OnInit { /** précision d'affichage */ public displayPrec: NgBaseParam; @@ -32,7 +31,6 @@ export class ApplicationSetupComponent extends BaseComponent implements Observer private intlService: I18nService, private snackBar: MatSnackBar ) { - super(); this.appSetupService.addObserver(this); } diff --git a/src/app/components/base/base.component.ts b/src/app/components/base/base.component.ts deleted file mode 100644 index 5bdc6df61c28d4a4c9a2e97548512497984899b6..0000000000000000000000000000000000000000 --- a/src/app/components/base/base.component.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Output, EventEmitter, AfterViewChecked, OnChanges } from "@angular/core"; - -export abstract class BaseComponent implements AfterViewChecked, OnChanges { - /** - * true après le 1er affichage du composant - */ - private _firstViewChecked = false; - - /** - * true si on souhaite qu'un événement soit émis en même temps que l'appel à afterFirstViewChecked() - */ - protected emitFirstViewCheck = false; - - /** - * événement émis en même temps que l'appel à afterFirstViewChecked() - */ - @Output() - private firstViewCheck: EventEmitter<void>; - - constructor() { - this.firstViewCheck = new EventEmitter(); - } - - public ngAfterViewChecked() { - if (!this._firstViewChecked) { - this._firstViewChecked = true; - - this.afterFirstViewChecked(); - - if (this.emitFirstViewCheck) { - this.firstViewCheck.emit(); - } - } - } - - public ngOnChanges() { - } - - /** - * appelé une fois, après l'affichage complet du composant - */ - protected afterFirstViewChecked() { - } -} diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts index 005a9556544cbaca2aefde571fba3942af4cd452..870c8ef79412124bba1de2f8f3651c57d7e2c4a4 100644 --- a/src/app/components/generic-calculator/calculator.component.ts +++ b/src/app/components/generic-calculator/calculator.component.ts @@ -12,7 +12,6 @@ import { FormulaireDefinition } from "../../formulaire/definition/form-definitio import { CalculatorResultsComponent } from "../../components/calculator-results/calculator-results.component"; import { Subscription } from "rxjs"; import { FieldSetComponent } from "../field-set/field-set.component"; -import { BaseComponent } from "../base/base.component"; import { CalculatorNameComponent } from "./calc-name.component"; import { FormulaireElement } from "../../formulaire/formulaire-element"; import { FieldsetContainer } from "../../formulaire/fieldset-container"; @@ -31,7 +30,7 @@ import { HotkeysService, Hotkey } from "angular2-hotkeys"; templateUrl: "./calculator.component.html", styleUrls: ["./calculator.component.scss"] }) -export class GenericCalculatorComponent extends BaseComponent implements OnInit, DoCheck, AfterViewChecked, OnDestroy, Observer { +export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChecked, OnDestroy, Observer { /** * liste des FieldSetComponent */ @@ -116,7 +115,6 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit, private _elementRef: ElementRef, private hotkeysService: HotkeysService ) { - super(); this.intlService = ServiceFactory.instance.i18nService; this.formulaireService = ServiceFactory.instance.formulaireService; diff --git a/src/app/components/generic-input/generic-input.component.ts b/src/app/components/generic-input/generic-input.component.ts index e18680906029b4fca26f61f8d1543b1c33439ca7..12aea8fa076c5848c924ef874c5eb2f7f72f0c3b 100644 --- a/src/app/components/generic-input/generic-input.component.ts +++ b/src/app/components/generic-input/generic-input.component.ts @@ -1,6 +1,5 @@ import { Input, Output, EventEmitter, ChangeDetectorRef, OnChanges, ViewChild } from "@angular/core"; import { NgModel } from "@angular/forms"; -import { BaseComponent } from "../base/base.component"; import { isNumeric, Structure, Pab } from "jalhyd"; import { FormulaireDefinition } from "../../formulaire/definition/form-definition"; import { NgParameter } from "../../formulaire/ngparam"; @@ -16,7 +15,7 @@ import { I18nService } from "../../services/internationalisation/internationalis * - valeur gérée : entité elle même si c'est un type simple (number, string, ...) ou une partie d'un classe * - UI : interface utilisateur, présentation de la valeur gérée */ -export abstract class GenericInputComponent extends BaseComponent implements OnChanges { +export abstract class GenericInputComponent implements OnChanges { /** * entité mémoire gérée */ @@ -103,9 +102,7 @@ export abstract class GenericInputComponent extends BaseComponent implements OnC @ViewChild("inputControl", { static: true }) inputField: NgModel; - constructor(private cdRef: ChangeDetectorRef, protected intlService: I18nService) { - super(); - } + constructor(private cdRef: ChangeDetectorRef, protected intlService: I18nService) { } public get isDisabled(): boolean { return this._inputDisabled; diff --git a/src/app/components/modules-diagram/modules-diagram.component.ts b/src/app/components/modules-diagram/modules-diagram.component.ts index f9675ef8507df69c1a0adb26226d3b0da8e38b2a..de628af605119a21611b6d4475f2b4ed072f6d28 100644 --- a/src/app/components/modules-diagram/modules-diagram.component.ts +++ b/src/app/components/modules-diagram/modules-diagram.component.ts @@ -18,7 +18,6 @@ import { } from "jalhyd"; import { I18nService } from "../../services/internationalisation/internationalisation.service"; -import { BaseComponent } from "../base/base.component"; import { FormulaireService } from "../../services/formulaire/formulaire.service"; import * as mermaid from "mermaid"; @@ -30,7 +29,7 @@ import * as SvgPanZoom from "svg-pan-zoom"; templateUrl: "./modules-diagram.component.html", styleUrls: ["./modules-diagram.component.scss"] }) -export class ModulesDiagramComponent extends BaseComponent implements AfterContentInit, AfterViewChecked, AfterViewInit, OnInit { +export class ModulesDiagramComponent implements AfterContentInit, AfterViewChecked, AfterViewInit, OnInit { private svgPanZoom: SvgPanZoom.Instance = null; @@ -51,7 +50,6 @@ export class ModulesDiagramComponent extends BaseComponent implements AfterConte private router: Router, private formulaireService: FormulaireService ) { - super(); this.error = false; }